This repository has been archived on 2026-06-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
master-ai/vibn-agent-runner/dist/agents/registry.js

35 lines
1.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AGENTS = void 0;
exports.registerAgent = registerAgent;
exports.getAgent = getAgent;
exports.allAgents = allAgents;
exports.pick = pick;
const tools_1 = require("../tools");
const _registry = new Map();
function registerAgent(config) {
_registry.set(config.name, config);
}
function getAgent(name) {
return _registry.get(name);
}
function allAgents() {
return [..._registry.values()];
}
/**
* Backwards-compatible AGENTS object — populated as agents register.
* server.ts uses AGENTS[name] and Object.values(AGENTS).
*/
exports.AGENTS = new Proxy({}, {
get(_target, prop) { return _registry.get(prop); },
ownKeys() { return [..._registry.keys()]; },
getOwnPropertyDescriptor(_target, prop) {
const v = _registry.get(prop);
return v ? { configurable: true, enumerable: true, value: v } : undefined;
}
});
/** Pick tools from ALL_TOOLS by name. */
function pick(names) {
return tools_1.ALL_TOOLS.filter(t => names.includes(t.name));
}