/** * Per-agent colocated capability registration. * * Directory-layout agents (`agents/{id}/`) may ship their own tools and * skills: * - Tools: `agents/{id}/tools/*.ts` → registered into the global tool * registry under `{agentId}--{shortName}` with `ownerAgentId` metadata. * - Skills: `agents/{id}/SKILL.md` (the agent's own skill, registered under * the agent id) and `agents/{id}/skills//SKILL.md` (registered under * `{agentId}--{sub}`), both with `ownerAgentId` metadata. * * Discovery here is PURE REGISTRATION: no binding decisions. Visibility and * selector resolution (`skills:` / `tools:`, `true` or lists, own short names * first) happen at invocation time through the owner-aware resolvers, so flat * and directory agents share identical binding semantics. * * The namespace separator is `--` (decided platform-wide): provider-safe and * never confusable with `__` integration tool naming. */ import type { DiscoveryResult, FileDiscoveryContext } from "./types.js"; /** Separator between the agent namespace and the capability short name. */ export declare const AGENT_CAPABILITY_NAMESPACE_SEPARATOR = "--"; /** Whether a namespaced tool name is valid for provider tool calls. */ export declare function isProviderSafeToolName(name: string): boolean; /** * Whether a directory/file entry name is a safe single path segment — used * before joining it into a filesystem path. Rejects `.` and `..` (which match * the permissive name regex) as defense-in-depth against path traversal. */ export declare function isSafePathSegment(name: string): boolean; /** Sanitizes an agent id into a provider-safe namespace segment. */ export declare function sanitizeCapabilityNamespace(agentId: string): string; /** Namespaces a capability short name under its owning agent. */ export declare function namespaceAgentCapability(agentId: string, shortName: string): string; /** Input payload for registering an agent's colocated capabilities. */ export type RegisterAgentColocatedCapabilitiesInput = { agentId: string; rootPath: string; context: FileDiscoveryContext; result?: DiscoveryResult; }; /** * Registers an agent's colocated `tools/*.ts` into the global tool registry * under `{agentId}--{shortName}` with owner metadata. Returns registered ids. */ export declare function registerAgentColocatedTools(input: RegisterAgentColocatedCapabilitiesInput): Promise; /** * Registers an agent's colocated skills into the skill registry with owner * metadata. The agent's own `SKILL.md` registers under the agent id; nested * `skills//SKILL.md` skills register under `{agentId}--{sub}`. Returns * registered ids. */ export declare function registerAgentColocatedSkills(input: RegisterAgentColocatedCapabilitiesInput): Promise; //# sourceMappingURL=agent-scoped-capabilities.d.ts.map