export function isMainToolDispatchContext(context) {
    return context.scope === "main";
}
export function isSubagentToolDispatchContext(context) {
    return context.scope === "subagent";
}
export class ToolRegistry {
    byName = new Map();
    constructor(definitions) {
        for (const def of definitions) {
            this.byName.set(def.schema.name, def);
        }
    }
    get schemas() {
        return [...this.byName.values()].map((d) => d.schema);
    }
    get(toolName) {
        return this.byName.get(toolName);
    }
    getEnabledToolSchemas(personaTools) {
        if (!personaTools) {
            return this.schemas;
        }
        return personaTools.map((toolName) => {
            const definition = this.byName.get(toolName);
            if (!definition) {
                throw new Error(`tool '${toolName}' is not registered`);
            }
            return definition.schema;
        });
    }
}
//# sourceMappingURL=registry.js.map