chore: convert submodules to standard directories for true monorepo structure
This commit is contained in:
34
vibn-agent-runner/dist/agents/registry.js
vendored
Normal file
34
vibn-agent-runner/dist/agents/registry.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"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));
|
||||
}
|
||||
Reference in New Issue
Block a user