import type { AgentToolResult } from '@earendil-works/pi-agent-core'; import { type ProductDeliveryEnvelope } from '@xopcai/gateway-contract'; import type { AvailabilityCheck } from '../../agent-matching/service.js'; import type { AutomationService } from '../../automations/index.js'; import type { CalendarService } from '../../calendar/index.js'; import type { BrowserSetupService } from '../../browser/setup/service.js'; import type { CapabilityContext } from '../../capabilities/runtime/dispatcher.js'; import type { ChatPreviewService } from '../../chat-previews/index.js'; import type { Config } from '../../config/schema.js'; import type { LocalAppService } from '../../local-apps/index.js'; import type { NotesService } from '../../notes/index.js'; import type { ProjectService } from '../../projects/index.js'; import type { SelfConfigService, UnifiedSetupSceneService } from '../../self-config/index.js'; import type { TaskApplicationService } from '../../tasks/task-application-service.js'; import type { WorkDiscoveryService } from '../../work-discovery/service.js'; import type { McpConversationSetup } from '../mcp/conversation-setup.js'; import type { AgentServiceConfig } from '../service.types.js'; export declare const XOPC_USE_MODES: readonly ["context", "project", "automation", "note", "calendar", "task", "task_run", "local_app", "chat_preview", "agent", "settings", "setup", "browser_setup", "mcp_setup"]; export type XopcUseMode = (typeof XOPC_USE_MODES)[number]; export interface XopcUseToolInput { mode: XopcUseMode; command: string; args?: Record; dryRun?: boolean; } export interface XopcUseToolDeps { getAgentToolAvailability?: (agentId: string, tool: string) => AvailabilityCheck; canConfigureFromConversation?: () => boolean; canShowMcpSetupCard?: () => boolean; canRequestWeixinMcpSetup?: () => boolean; canOpenMobileMcpForm?: () => boolean; getBrowserSetupService?: () => BrowserSetupService | undefined; getMcpSetupService?: () => McpConversationSetup | undefined; getSelfConfigService?: () => SelfConfigService | undefined; getSetupSceneService?: () => UnifiedSetupSceneService | undefined; authorizeCapability?: CapabilityContext['authorize']; getWorkspace?: () => string; getConfig?: () => Config | undefined; getCurrentAgentId?: () => string | undefined; getCurrentConversationId?: () => string | undefined; getAutomationService?: () => AutomationService | undefined; getCalendarService?: () => CalendarService | undefined; getNotesService?: () => NotesService | undefined; getProjectService?: () => ProjectService | undefined; getWorkDiscovery?: () => WorkDiscoveryService | undefined; getLocalAppService?: () => LocalAppService | undefined; getChatPreviewService?: () => ChatPreviewService | undefined; dispatchTaskEvents?: () => void; createTask?: TaskApplicationService['create']; dispatchTaskRuns?: () => void; retryTask?: AgentServiceConfig['retryTask']; onAgentCatalogMutate?: () => void; } export type XopcUseDetails = { mode: XopcUseMode; command: string; dryRun: boolean; result?: unknown; delivery?: ProductDeliveryEnvelope; }; export declare function okText(details: XopcUseDetails): AgentToolResult; export declare function errorText(message: string, details: XopcUseDetails): AgentToolResult; export declare function trimString(value: unknown): string | undefined; export declare function optionalString(value: unknown): string | null | undefined; export declare function enumValue(value: unknown, allowed: Set): T | undefined; export declare function finiteNumber(value: unknown): number | undefined; export declare function stringArray(value: unknown): string[] | undefined; export declare function record(value: unknown): Record | undefined; export declare function taskTextList(value: unknown): string[] | undefined; export declare function ensureArgs(input: XopcUseToolInput): Record; export declare function currentProjectId(args: Record, deps: XopcUseToolDeps): string | undefined; export declare function pickDefined(source: Record, fields: readonly string[]): Record;