import { type Tool } from "@github/copilot-sdk"; import { type CapabilitySource, type CapabilityState, type CapabilitySelection } from "./capability-catalog.js"; import type { FeatureOwner } from "./feature-flags.js"; import { type McpAllowlistAgent } from "./mcp-loader.js"; export interface PackageRequest { source_ref: string; tools?: string[]; mcp_servers?: string[]; action?: "add" | "remove"; expected_revision: number; request_id: string; } export interface CapabilityServices { search(args: any): Promise; load(ref: string, kind: "skill" | "agent"): Promise; list(): Promise; use(args: PackageRequest): Promise<{ changed: boolean; revision: number; }>; } export declare const CAPABILITY_TOOL_SPECS: { readonly search_capabilities: { readonly description: "MANDATORY first tool when the user names or might be referring to an unattached capability, including natural phrases such as 'X exploration' or 'X review'. Search before web, repository, shell or delegation tools even when those tools could answer the request. Covers visible static and published skills, authored agent workflows, tools and MCP servers, plus curated shared skills. Use the user's named phrase and goal as the query. Returns metadata, ownership (static, owned, other_shared or curated) and exact references; it does not load instructions or grant tools. In Base V2, other_shared packages may be mentioned but must not be loaded or activated unless the session owner explicitly requests that capability. Static/package search is weighted keyword matching; curated search uses the configured hybrid index."; readonly parameters: { readonly type: "object"; readonly properties: { readonly query: { readonly type: "string"; }; readonly limit: { readonly type: "integer"; readonly minimum: 1; readonly maximum: 30; }; readonly kinds: { readonly type: "array"; readonly items: { readonly type: "string"; readonly enum: readonly ["skill", "agent", "tool", "mcp"]; }; }; readonly sources: { readonly type: "array"; readonly items: { readonly type: "string"; readonly enum: readonly ["static", "published", "curated"]; }; }; }; readonly required: readonly ["query"]; }; }; readonly load_agent_guidelines: { readonly description: "Read an authored agent's own workflow as reference material using its search reference. In Base V2, do not load an other_shared workflow unless the session owner explicitly requested that capability. Before applying it, tell the user which agent supplied the instructions and describe material adaptations. Does not launch an agent, adopt its identity, grant tools, or execute its startup prompt."; readonly parameters: { readonly type: "object"; readonly properties: { readonly ref: { readonly type: "string"; }; }; readonly required: readonly ["ref"]; }; }; readonly list_session_capabilities: { readonly description: "List this durable session's explicit capability-source tool/MCP selections, their availability, and the revision required by use_package. No secrets or server configuration are returned."; readonly parameters: { readonly type: "object"; readonly properties: {}; }; }; readonly use_package: { readonly description: "Add or remove explicitly selected tools/MCP servers from an exact visible static or published source_ref returned by search_capabilities. In Base V2, do not activate other_shared packages unless the session owner explicitly requested that capability. Does not install packages, grant an agent identity, or load every export. Parent-session only. Selections persist for this durable session; changes refresh the same session at the next turn boundary and continue automatically. Finish native tasks first. Use list_session_capabilities for expected_revision; use a new request_id per logical change and reuse it on retry. Existing original/bound tools cannot be removed here."; readonly parameters: { readonly type: "object"; readonly properties: { readonly source_ref: { readonly type: "string"; }; readonly tools: { readonly type: "array"; readonly items: { readonly type: "string"; }; }; readonly mcp_servers: { readonly type: "array"; readonly items: { readonly type: "string"; }; }; readonly action: { readonly type: "string"; readonly enum: readonly ["add", "remove"]; }; readonly expected_revision: { readonly type: "integer"; readonly minimum: 0; }; readonly request_id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; }; readonly required: readonly ["source_ref", "expected_revision", "request_id"]; }; }; }; export declare function capabilityToolDeclarations(): Tool[]; export declare function validatePackageRequest(args: PackageRequest): void; export declare function nextCapabilityState(state: CapabilityState, sourceId: string, args: PackageRequest): { state: CapabilityState; changed: boolean; }; /** Resolve exact exports. Never fall back to a same-named package or the legacy flat registry. */ export declare function bindCapabilities(sources: CapabilitySource[], owner: FeatureOwner | null, selections: CapabilitySelection[], originalTools: Tool[], originalMcp: Record, agent: McpAllowlistAgent | null, strict?: boolean): { tools: Tool[]; mcpServers: Record; unavailable: string[]; fingerprint: string; }; //# sourceMappingURL=capability-runtime.d.ts.map