import { z } from "zod"; import { type DelegationInput, type SessionScope } from "./protocol.js"; export declare const MCP_TOOL_NAMES: readonly [string, string, string, string, string, string]; declare const delegateToolName: string, statusToolName: string, resultToolName: string, followUpToolName: string, cancelToolName: string, reviewToolName: string; export declare const mcpToolNameSchema: z.ZodEnum<{ [x: string]: string; }>; export type McpToolName = z.infer; /** 32 random bytes, base64url. Sent only on the transport, never in tool args, prompts or logs. */ export declare const capabilityTokenSchema: z.ZodString; export declare const capabilityRecordSchema: z.ZodObject<{ protocolVersion: z.ZodLiteral<1>; tokenDigest: z.ZodString; scope: z.ZodObject<{ sessionId: z.ZodUUID; organizationId: z.ZodNullable; userId: z.ZodString; }, z.core.$strict>; tools: z.ZodArray>; issuedAt: z.ZodISODateTime; expiresAt: z.ZodISODateTime; revoked: z.ZodBoolean; }, z.core.$strict>; export type CapabilityRecord = z.infer; /** Wire-only scope projection; the raw capability token is intentionally absent. */ export declare const tokenScopeSchema: z.ZodObject<{ protocolVersion: z.ZodOptional>; token: z.ZodString; sessionId: z.ZodUUID; organizationId: z.ZodString; issuedAt: z.ZodISODateTime; expiresAt: z.ZodISODateTime; tools: z.ZodArray>; }, z.core.$strict>; export declare function authorizeMcpCapability(record: CapabilityRecord, token: unknown, scope: SessionScope, tool: McpToolName, nowMs: number): void; export declare const delegateToolSchema: z.ZodObject<{ operationId: z.ZodUUID; task: z.ZodString; mode: z.ZodEnum<{ local: "local"; cloud: "cloud"; }>; repository: z.ZodString; baseCommitSha: z.ZodString; model: z.ZodString; capabilities: z.ZodArray>; budget: z.ZodObject<{ maxProviderCalls: z.ZodNumber; wallTimeMs: z.ZodNumber; maxCostMicrousd: z.ZodNumber; }, z.core.$strict>; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export type DelegateToolInput = z.infer; export declare const statusToolSchema: z.ZodObject<{ delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const resultToolSchema: z.ZodObject<{ delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const followUpToolSchema: z.ZodObject<{ operationId: z.ZodUUID; generation: z.ZodString; resultDigest: z.ZodString; task: z.ZodString; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const cancelToolSchema: z.ZodObject<{ operationId: z.ZodUUID; generation: z.ZodString; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const reviewToolSchema: z.ZodObject<{ protocolVersion: z.ZodLiteral<1>; operationId: z.ZodUUID; delegationId: z.ZodUUID; generation: z.ZodString; resultDigest: z.ZodString; expectedBaseCommitSha: z.ZodString; expectedWorkingTreeDigest: z.ZodString; decision: z.ZodEnum<{ apply: "apply"; take_over: "take_over"; discard: "discard"; }>; }, z.core.$strict>; export declare const toolRequestSchemas: Readonly<{ [delegateToolName]: z.ZodObject<{ operationId: z.ZodUUID; task: z.ZodString; mode: z.ZodEnum<{ local: "local"; cloud: "cloud"; }>; repository: z.ZodString; baseCommitSha: z.ZodString; model: z.ZodString; capabilities: z.ZodArray>; budget: z.ZodObject<{ maxProviderCalls: z.ZodNumber; wallTimeMs: z.ZodNumber; maxCostMicrousd: z.ZodNumber; }, z.core.$strict>; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [statusToolName]: z.ZodObject<{ delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [resultToolName]: z.ZodObject<{ delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [followUpToolName]: z.ZodObject<{ operationId: z.ZodUUID; generation: z.ZodString; resultDigest: z.ZodString; task: z.ZodString; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [cancelToolName]: z.ZodObject<{ operationId: z.ZodUUID; generation: z.ZodString; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [reviewToolName]: z.ZodObject<{ protocolVersion: z.ZodLiteral<1>; operationId: z.ZodUUID; delegationId: z.ZodUUID; generation: z.ZodString; resultDigest: z.ZodString; expectedBaseCommitSha: z.ZodString; expectedWorkingTreeDigest: z.ZodString; decision: z.ZodEnum<{ apply: "apply"; take_over: "take_over"; discard: "discard"; }>; }, z.core.$strict>; }>; export declare const toolErrorSchema: z.ZodObject<{ code: z.ZodEnum<{ cancelled: "cancelled"; timed_out: "timed_out"; invalid_request: "invalid_request"; conflict: "conflict"; sidekick_limit: "sidekick_limit"; unauthorized: "unauthorized"; not_found: "not_found"; stale_generation: "stale_generation"; terminal_replay: "terminal_replay"; expired_result: "expired_result"; result_not_ready: "result_not_ready"; review_required: "review_required"; follow_up_limit: "follow_up_limit"; incomplete_result: "incomplete_result"; stale_base: "stale_base"; working_tree_conflict: "working_tree_conflict"; digest_mismatch: "digest_mismatch"; policy_denied: "policy_denied"; budget_exceeded: "budget_exceeded"; repository_unavailable: "repository_unavailable"; worker_lost: "worker_lost"; unavailable: "unavailable"; caller_identity_forbidden: "caller_identity_forbidden"; model_auto_disallowed: "model_auto_disallowed"; event_conflict: "event_conflict"; }>; retryable: z.ZodBoolean; }, z.core.$strict>; export type McpToolError = z.infer; export declare const delegateResultSchema: z.ZodObject<{ operationId: z.ZodUUID; state: z.ZodEnum<{ failed: "failed"; queued: "queued"; running: "running"; succeeded: "succeeded"; cancelled: "cancelled"; timed_out: "timed_out"; awaiting_review: "awaiting_review"; taken_over: "taken_over"; discarded: "discarded"; expired: "expired"; }>; duplicate: z.ZodBoolean; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const statusResultSchema: z.ZodObject<{ attemptId: z.ZodUUID; generation: z.ZodString; attemptNumber: z.ZodNumber; state: z.ZodEnum<{ failed: "failed"; queued: "queued"; running: "running"; succeeded: "succeeded"; cancelled: "cancelled"; timed_out: "timed_out"; awaiting_review: "awaiting_review"; taken_over: "taken_over"; discarded: "discarded"; expired: "expired"; }>; resultDigest: z.ZodNullable; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const reviewIntentSchema: z.ZodObject<{ request: z.ZodObject<{ protocolVersion: z.ZodLiteral<1>; operationId: z.ZodUUID; delegationId: z.ZodUUID; generation: z.ZodString; resultDigest: z.ZodString; expectedBaseCommitSha: z.ZodString; expectedWorkingTreeDigest: z.ZodString; decision: z.ZodEnum<{ apply: "apply"; take_over: "take_over"; discard: "discard"; }>; }, z.core.$strict>; hostApprovalRequired: z.ZodLiteral; }, z.core.$strict>; export declare const toolResponseSchemas: Readonly<{ [delegateToolName]: z.ZodObject<{ operationId: z.ZodUUID; state: z.ZodEnum<{ failed: "failed"; queued: "queued"; running: "running"; succeeded: "succeeded"; cancelled: "cancelled"; timed_out: "timed_out"; awaiting_review: "awaiting_review"; taken_over: "taken_over"; discarded: "discarded"; expired: "expired"; }>; duplicate: z.ZodBoolean; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [statusToolName]: z.ZodObject<{ attemptId: z.ZodUUID; generation: z.ZodString; attemptNumber: z.ZodNumber; state: z.ZodEnum<{ failed: "failed"; queued: "queued"; running: "running"; succeeded: "succeeded"; cancelled: "cancelled"; timed_out: "timed_out"; awaiting_review: "awaiting_review"; taken_over: "taken_over"; discarded: "discarded"; expired: "expired"; }>; resultDigest: z.ZodNullable; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [resultToolName]: z.ZodObject<{ protocolVersion: z.ZodLiteral<1>; delegationId: z.ZodUUID; attemptId: z.ZodUUID; generation: z.ZodString; baseCommitSha: z.ZodString; summary: z.ZodString; patch: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"no_change">; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"patch">; sha256: z.ZodString; bytes: z.ZodNumber; }, z.core.$strict>], "kind">; changedFiles: z.ZodArray; beforeSha256: z.ZodNullable; afterSha256: z.ZodNullable; }, z.core.$strict>>; tests: z.ZodArray; exitCode: z.ZodNullable; }, z.core.$strict>>; warnings: z.ZodArray; complete: z.ZodBoolean; digest: z.ZodString; }, z.core.$strict>; [followUpToolName]: z.ZodObject<{ attemptId: z.ZodUUID; generation: z.ZodString; attemptNumber: z.ZodNumber; state: z.ZodEnum<{ failed: "failed"; queued: "queued"; running: "running"; succeeded: "succeeded"; cancelled: "cancelled"; timed_out: "timed_out"; awaiting_review: "awaiting_review"; taken_over: "taken_over"; discarded: "discarded"; expired: "expired"; }>; resultDigest: z.ZodNullable; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [cancelToolName]: z.ZodObject<{ attemptId: z.ZodUUID; generation: z.ZodString; attemptNumber: z.ZodNumber; state: z.ZodEnum<{ failed: "failed"; queued: "queued"; running: "running"; succeeded: "succeeded"; cancelled: "cancelled"; timed_out: "timed_out"; awaiting_review: "awaiting_review"; taken_over: "taken_over"; discarded: "discarded"; expired: "expired"; }>; resultDigest: z.ZodNullable; delegationId: z.ZodUUID; protocolVersion: z.ZodLiteral<1>; }, z.core.$strict>; [reviewToolName]: z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodEnum<{ taken_over: "taken_over"; discarded: "discarded"; applied: "applied"; already_applied: "already_applied"; }>; resultDigest: z.ZodString; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"conflict">; resultDigest: z.ZodString; conflictPaths: z.ZodArray; }, z.core.$strict>], "status">; }>; export declare const trustedLeadSchema: z.ZodObject<{ scope: z.ZodObject<{ sessionId: z.ZodUUID; organizationId: z.ZodNullable; userId: z.ZodString; }, z.core.$strict>; harness: z.ZodEnum<{ codex: "codex"; claude_code: "claude_code"; }>; model: z.ZodString; }, z.core.$strict>; export declare function toDelegationInput(raw: DelegateToolInput, host: z.infer): DelegationInput; /** Hook data is advisory and contains no task text, token, transcript, or native resume cursor. */ export declare const hookIntentSchema: z.ZodObject<{ protocolVersion: z.ZodLiteral<1>; eventId: z.ZodUUID; sessionId: z.ZodUUID; kind: z.ZodEnum<{ session_start: "session_start"; completion: "completion"; compaction: "compaction"; session_end: "session_end"; }>; harness: z.ZodEnum<{ codex: "codex"; claude_code: "claude_code"; }>; occurredAt: z.ZodISODateTime; installationId: z.ZodString; }, z.core.$strict>; export type HookIntent = z.infer; export {};