import type { Tool } from "@github/copilot-sdk"; import type { SessionCatalog } from "./cms.js"; import { type ProviderWakeClient } from "./provider-wake.js"; /** * Agent ids that hold these tools. * * A tool declaration is resident context on every turn of every session that * carries it, so they go only to the two agents whose job this is. The * list decides who SEES the tools, never what they may do: `token-manager` * runs with cluster authority and `user-token-manager` runs as its owner, and * both refusals are made by the database either way. */ export declare const PROVIDER_TOOL_AGENT_IDS: Set; /** Does this agent identity hold the provider budget tools? */ export declare function holdsProviderTools(agentIdentity?: string | null): boolean; /** Who the tool call runs as. Numbers, because the procedures take numbers. */ export interface ProviderToolsViewer { userId: number | null; isAdmin: boolean; adminScope?: "unrestricted" | "cluster"; } export interface CreateProviderToolsOptions { catalog: SessionCatalog; /** Worker queue client: budget changes wake parked work after authorization. */ duroxideClient?: ProviderWakeClient; /** * Resolved per call, never stamped at session start: a session outlives * the role that created it, so caching would let a demoted administrator * keep cluster reach for as long as their session stayed open. */ resolveViewer: () => ProviderToolsViewer | Promise; /** * Does this PROVIDER authenticate with the worker's own identity rather * than a stored key? These actions write to the store directly, so unlike * the HTTP route they have no type catalog of their own to consult. * Without it, a key rotated onto such a provider is accepted, stored and * then ignored for ever — and reported as a successful rotation. */ providerUsesWorkloadIdentity?: (providerName: string) => boolean; } /** Every provider budget tool name, in the order the specs declare them. */ export declare const PROVIDER_TOOL_NAMES: readonly string[]; /** * The declarations, with no behaviour — what `systemToolDefs()` shows the * model at session-create time. The handlers that actually run are registered * for the turn; see the two-place trap at the top of this file. */ export declare function providerToolDefs(): Tool[]; /** * The same tools with nothing behind them, refusing by name. * * Registered for a turn where the host wired no data layer. A clean refusal * is the point: the alternative to a registered handler is no handler, and a * call the CLI has no handler for is dropped without a response, which wedges * the turn instead of answering it. */ export declare function providerToolsUnavailable(reason: string): Tool[]; export declare function createProviderTools(opts: CreateProviderToolsOptions): Tool[]; //# sourceMappingURL=provider-tools.d.ts.map