/** * Skill Registry * * Project-scoped registry for discovered skills. * Follows the same pattern as src/tool/registry.ts. * * Capability visibility is owner-aware: a skill registered with an * `ownerAgentId` is visible only to that agent; unowned skills are * project-global. One resolver rule applies to every agent kind (TS, flat * markdown, directory markdown) and to the skill tools. * * @module */ import type { Skill } from "./types.js"; import { ScopedRegistryFacade, ScopedRegistryView } from "../registry/scoped-registry-facade.js"; import { type ResolvedSkillSelectorSnapshot } from "./selector.js"; /** Caller scope used for owner-aware capability resolution. */ export type AgentCapabilityScope = { /** Id of the calling agent; absent for project-level/external callers. */ agentId?: string; }; /** Whether a skill is visible to the caller identified by the scope. */ export declare function isSkillVisibleTo(skill: Skill, scope?: AgentCapabilityScope): boolean; declare class SkillRegistryInternal extends ScopedRegistryFacade { register(id: string, skill: Skill): void; registerPublic(id: string, skill: Skill): void; registerShared(id: string, skill: Skill): void; /** * Resolve a presence-aware, execution-facing skill selector snapshot. * * Omitted and `true` resolve to all visible skills, `[]` resolves to none, * and explicit entries must resolve to this caller's own short names or * exact visible ids. Explicit misses fail closed with a generic error. */ resolveSelectorForAgent(skillsConfig: true | string[] | undefined, scope?: AgentCapabilityScope): ResolvedSkillSelectorSnapshot; /** * Resolve skills for an agent configuration. * * - `true` resolves to every skill visible to the caller: unowned * (project-global) skills plus the caller's own skills — never another * agent's owned skills. * - An explicit list resolves each entry as the caller's own short name * first, then as an exact id of a visible skill (missing/invisible ids are * silently skipped, preserving prior behavior for missing ids). * * @param skillsConfig - `true` for all visible skills, or array of ids/short names * @param scope - caller scope; omit for project-level callers */ resolveForAgent(skillsConfig: true | string[], scope?: AgentCapabilityScope): Map; /** * Resolve a single requested skill for a caller: own short name first, then * exact id — returning only skills visible to the caller. */ resolveVisibleSkill(requested: string, scope?: AgentCapabilityScope): Skill | undefined; /** Ids of every skill visible to the caller (for manifests and error messages). */ getVisibleSkillIds(scope?: AgentCapabilityScope): string[]; /** Whether at least one skill is visible without materializing a catalog. */ hasVisibleSkills(scope?: AgentCapabilityScope): boolean; } /** Framework-only skill registry with process-wide maintenance capabilities. */ export declare const skillRegistryInternal: SkillRegistryInternal; /** * Application-facing project-scoped skill registry API. * * Process-wide maintenance methods remain for compatibility; framework * composition roots should use `skillRegistryInternal` for that behavior. */ declare class SkillRegistry extends ScopedRegistryView { #private; constructor(registry: SkillRegistryInternal); register(id: string, skill: Skill): void; get(id: string): Skill | undefined; getOwn(id: string): Skill | undefined; getAll(): Map; resolveSelectorForAgent(skillsConfig: true | string[] | undefined, scope?: AgentCapabilityScope): ResolvedSkillSelectorSnapshot; resolveForAgent(skillsConfig: true | string[], scope?: AgentCapabilityScope): Map; resolveVisibleSkill(requested: string, scope?: AgentCapabilityScope): Skill | undefined; getVisibleSkillIds(scope?: AgentCapabilityScope): string[]; hasVisibleSkills(scope?: AgentCapabilityScope): boolean; } export declare const skillRegistry: SkillRegistry; export declare function registerSkill(id: string, skill: Skill): void; export declare function getSkill(id: string): Skill | undefined; export declare function getAllSkills(): Map; export {}; //# sourceMappingURL=registry.d.ts.map