import { type ClarificationWait } from '@xopcai/gateway-contract'; import { z } from 'zod'; import { type CapabilityDispatcher } from '../capabilities/runtime/dispatcher.js'; import type { Config } from '../config/schema.js'; import type { ChatScheduleService } from '../chat-schedules/index.js'; import type { FileSpaceService } from '../files/file-service.js'; import type { ProjectService } from '../projects/project-service.js'; import type { McpConnectionCallback } from './callback-config.js'; export interface McpDelegationGrantPolicy { maxConcurrentRuns?: number; callback?: McpConnectionCallback; } export interface McpDelegationDeps { getConfig: () => Config; getProjects: () => ProjectService; getFiles: () => FileSpaceService; getChatSchedules?: () => ChatScheduleService | undefined; wake: () => void; stop: (runId: string) => void; deliverSteer: (conversationId: string, inputId: string) => Promise; resumeClarification: (wait: ClarificationWait) => void; getGrantPolicy?: (principalId: string) => McpDelegationGrantPolicy | undefined; } export declare const mcpDelegationTools: { readonly 'xopc.agent_runs.agents': { readonly scope: "agents.read"; readonly output: z.ZodObject<{ defaultAgentId: z.ZodString; agents: z.ZodArray; description: z.ZodOptional; purpose: z.ZodOptional>; specialties: z.ZodOptional>; skills: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; }; readonly 'xopc.agent_runs.list': { readonly scope: "tasks.read"; readonly output: z.ZodObject<{ items: z.ZodArray; agentId: z.ZodString; status: z.ZodEnum<{ queued: "queued"; cancelled: "cancelled"; failed: "failed"; running: "running"; succeeded: "succeeded"; waiting: "waiting"; verifying: "verifying"; }>; version: z.ZodNumber; queuedAt: z.ZodNumber; startedAt: z.ZodOptional; completedAt: z.ZodOptional; hasActiveClarification: z.ZodBoolean; }, z.core.$strip>>; hasMore: z.ZodBoolean; }, z.core.$strip>; }; readonly 'xopc.agent_runs.start': { readonly scope: "tasks.write"; readonly output: z.ZodObject<{ runId: z.ZodUUID; taskId: z.ZodUUID; agentId: z.ZodString; status: z.ZodLiteral<"queued">; }, z.core.$strict>; }; readonly 'xopc.agent_runs.get': { readonly scope: "tasks.read"; readonly output: z.ZodObject<{ runId: z.ZodUUID; taskId: z.ZodUUID; agentId: z.ZodString; status: z.ZodEnum<{ queued: "queued"; cancelled: "cancelled"; failed: "failed"; running: "running"; succeeded: "succeeded"; waiting: "waiting"; verifying: "verifying"; }>; version: z.ZodNumber; queuedAt: z.ZodNumber; startedAt: z.ZodOptional; completedAt: z.ZodOptional; result: z.ZodOptional; summary: z.ZodString; nextAction: z.ZodOptional; needsUser: z.ZodBoolean; completionVerdict: z.ZodOptional>; finalizedAt: z.ZodNumber; verification: z.ZodObject<{ status: z.ZodEnum<{ failed: "failed"; passed: "passed"; unverified: "unverified"; }>; }, z.core.$strip>; failure: z.ZodOptional>; }, z.core.$strip>>; steer: z.ZodOptional; }, z.core.$strip>>; clarification: z.ZodOptional; schemaVersion: z.ZodOptional, z.ZodLiteral<2>]>>; questions: z.ZodOptional; id: z.ZodString; header: z.ZodString; question: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"single_choice">; choices: z.ZodArray; }, z.core.$strict>>; recommendedChoiceId: z.ZodOptional; id: z.ZodString; header: z.ZodString; question: z.ZodString; }, z.core.$strict>], "type">>>; interactionMode: z.ZodOptional>; choiceDetails: z.ZodOptional; }, z.core.$strict>>>; id: z.ZodUUID; version: z.ZodNumber; question: z.ZodString; status: z.ZodEnum<{ open: "open"; queued: "queued"; }>; }, z.core.$strip>>; }, z.core.$strict>; }; readonly 'xopc.agent_runs.result': { readonly scope: "tasks.read"; readonly output: z.ZodObject<{ runId: z.ZodUUID; status: z.ZodEnum<{ queued: "queued"; cancelled: "cancelled"; failed: "failed"; running: "running"; succeeded: "succeeded"; waiting: "waiting"; verifying: "verifying"; }>; receipt: z.ZodOptional; summary: z.ZodString; nextAction: z.ZodOptional; needsUser: z.ZodBoolean; completionVerdict: z.ZodOptional>; finalizedAt: z.ZodNumber; verification: z.ZodObject<{ status: z.ZodEnum<{ failed: "failed"; passed: "passed"; unverified: "unverified"; }>; }, z.core.$strip>; failure: z.ZodOptional>; }, z.core.$strip>>; text: z.ZodOptional; textSource: z.ZodOptional>; nextTextOffset: z.ZodNullable; artifacts: z.ZodArray; kind: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; sha256: z.ZodOptional; canRead: z.ZodBoolean; workspaceFileId: z.ZodOptional; shareUrl: z.ZodOptional; }, z.core.$strip>>; nextArtifactOffset: z.ZodNullable; }, z.core.$strip>; }; readonly 'xopc.agent_runs.artifact_read': { readonly scope: "tasks.read"; readonly output: z.ZodObject<{ runId: z.ZodUUID; artifactId: z.ZodString; encoding: z.ZodLiteral<"base64">; data: z.ZodString; nextOffset: z.ZodNullable; size: z.ZodNumber; revision: z.ZodString; }, z.core.$strip>; }; readonly 'xopc.agent_runs.events': { readonly scope: "tasks.read"; readonly output: z.ZodObject<{ runId: z.ZodUUID; status: z.ZodEnum<{ queued: "queued"; cancelled: "cancelled"; failed: "failed"; running: "running"; succeeded: "succeeded"; waiting: "waiting"; verifying: "verifying"; }>; nextSequence: z.ZodNumber; hasMore: z.ZodBoolean; events: z.ZodArray>; }, z.core.$strip>; }; readonly 'xopc.agent_runs.respond': { readonly scope: "tasks.write"; readonly output: z.ZodObject<{ runId: z.ZodUUID; clarificationId: z.ZodUUID; status: z.ZodLiteral<"queued">; }, z.core.$strip>; }; readonly 'xopc.agent_runs.steer': { readonly scope: "tasks.write"; readonly output: z.ZodObject<{ runId: z.ZodUUID; inputId: z.ZodUUID; status: z.ZodLiteral<"accepted">; }, z.core.$strip>; }; readonly 'xopc.agent_runs.cancel': { readonly scope: "tasks.write"; readonly output: z.ZodObject<{ runId: z.ZodUUID; taskId: z.ZodUUID; agentId: z.ZodString; version: z.ZodNumber; queuedAt: z.ZodNumber; startedAt: z.ZodOptional; completedAt: z.ZodOptional; result: z.ZodOptional; summary: z.ZodString; nextAction: z.ZodOptional; needsUser: z.ZodBoolean; completionVerdict: z.ZodOptional>; finalizedAt: z.ZodNumber; verification: z.ZodObject<{ status: z.ZodEnum<{ failed: "failed"; passed: "passed"; unverified: "unverified"; }>; }, z.core.$strip>; failure: z.ZodOptional>; }, z.core.$strip>>; steer: z.ZodOptional; }, z.core.$strip>>; clarification: z.ZodOptional; schemaVersion: z.ZodOptional, z.ZodLiteral<2>]>>; questions: z.ZodOptional; id: z.ZodString; header: z.ZodString; question: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"single_choice">; choices: z.ZodArray; }, z.core.$strict>>; recommendedChoiceId: z.ZodOptional; id: z.ZodString; header: z.ZodString; question: z.ZodString; }, z.core.$strict>], "type">>>; interactionMode: z.ZodOptional>; choiceDetails: z.ZodOptional; }, z.core.$strict>>>; id: z.ZodUUID; version: z.ZodNumber; question: z.ZodString; status: z.ZodEnum<{ open: "open"; queued: "queued"; }>; }, z.core.$strip>>; status: z.ZodLiteral<"cancelled">; executionStopConfirmed: z.ZodLiteral; }, z.core.$strict>; }; }; export declare function registerMcpDelegation(dispatcher: CapabilityDispatcher, deps: McpDelegationDeps): void;