export interface AwbConfig { url: string; apiKey: string; workspace_id?: string; agent_id?: string; cli?: string; silentExitVerifyDelayMs?: number; retryApiKey?: string; [key: string]: unknown; } export declare function postRuntimeChildEvent(config: AwbConfig, body: { phase: 'start' | 'finish'; parent_agent_id: string; parent_run_id: string; child_run_id: string; strategy: 'delegated' | 'swarm'; depth?: number; budget?: number; title?: string; status?: 'completed' | 'failed' | 'cancelled'; summary?: string; metadata?: unknown; }): Promise; export type SendOutcome = 'ok' | 'retryable' | 'permanent'; export declare function classifyHttpSendFailure(status: number): SendOutcome; interface RestOutboxSink { enqueue(kind: 'chat_message' | 'silent_exit_comment' | 'dispatch_ack' | 'command_ack' | 'cli_login_progress', payload: unknown): void; } export declare function setRestOutbox(sink: RestOutboxSink | null): void; export declare function fetchTicketContext(config: AwbConfig, ticketId: string | undefined): Promise; export declare function hasAuditTrailSince(config: AwbConfig, ticketId: string | undefined, sinceMs: number): Promise; export declare function hasNewAgentComment(config: AwbConfig, ticketId: string | undefined, agentId: string | undefined, knownCommentIds: ReadonlySet): Promise; export declare function fetchChatRoomHistory(config: AwbConfig, roomId: string | undefined, limit?: number): Promise; export interface OrdinaryWorkBoardCandidate { id: string; name: string; description: string; } export declare function fetchOrdinaryWorkBoardCandidates(config: AwbConfig, fetchImpl?: typeof fetch): Promise; export declare function postFsResponse(config: AwbConfig, requestId: string, body: unknown): Promise; export declare function postCommandAck(config: AwbConfig, command_id: string, status: 'ok' | 'error', detail?: string): Promise; export declare function postCommandAckRaw(config: AwbConfig, command_id: string, status: 'ok' | 'error', detail?: string): Promise; export interface CliLoginProgressBody { session_id: string; command_id: string; status: 'awaiting_user' | 'succeeded' | 'failed' | 'timed_out' | 'cancelled'; verification_url?: string; user_code?: string; raw_output_fallback?: string; error_detail?: string; credential_fields?: Record; } export declare function _setSucceededRetryDelaysMsForTests(delays: number[] | null): void; export declare function postCliLoginProgress(config: AwbConfig, body: CliLoginProgressBody): Promise; export declare function postCliLoginProgressRaw(config: AwbConfig, body: CliLoginProgressBody): Promise; export interface DispatchAckBody { ticket_id: string; role: string; trigger_id: string; outcome: 'processed' | 'nack' | 'suppressed'; reason?: string; skill_snapshot_run_id?: string; } export declare function postDispatchAck(config: AwbConfig, body: DispatchAckBody): Promise; export declare function postDispatchAckRaw(config: AwbConfig, body: DispatchAckBody): Promise; export declare function postToolCallTelemetry(config: AwbConfig, apiKey: string, body: { agent_id: string; ticket_id: string; role: string; graph_calls: number; native_calls: number; }): Promise; export declare function postOutputLiveness(config: AwbConfig, apiKey: string, body: { agent_id: string; ticket_id: string; role: string; }): Promise; export declare function fetchAgentRecord(config: AwbConfig, agentId: string): Promise<{ id: string; name: string; type: string; working_dir: string; manager_agent_id: string | null; credential_id?: string | null; model?: string | null; runtime_config?: import('./runtime/runtime-types.js').AgentRuntimeConfig | null; } | null>; export declare function fetchAgentCredential(config: AwbConfig, agentId: string, workspaceId?: string): Promise<{ credential_id: string; provider: string; fields: Record; } | null>; export declare function fetchRepositoryCredential(config: AwbConfig, resourceId: string, agentId: string, workspaceId?: string): Promise<{ username?: string; token: string; } | null>; export interface RepositoryCredentialStatus { credential: { username?: string; token: string; } | null; failure: string | null; } export declare function fetchRepositoryCredentialStatus(config: AwbConfig, resourceId: string, agentId: string, workspaceId?: string): Promise; export declare function fetchChatAttachment(config: AwbConfig, roomId: string, attachmentId: string): Promise<{ id: string; file_name: string; file_mimetype: string; file_size: number; file_data: string; download_url: string; } | null>; export declare function postChatRoomMessage(config: AwbConfig, roomId: string, agentId: string, content: string, opts?: { type?: 'message' | 'progress'; metadata?: unknown; }): Promise; export declare function postChatRoomMessageRaw(config: AwbConfig, roomId: string, agentId: string, content: string, opts?: { type?: 'message' | 'progress'; metadata?: unknown; } | null): Promise; export declare function postChatRoomSessionStatus(config: AwbConfig, roomId: string, agentId: string, body: { keep_alive_until_ms: number | null; background_task_count: number; }): Promise; export declare function postSilentExitSystemComment(config: AwbConfig, ticketId: string, body: { content: string; exit_code: number | null; cycle_trigger_id?: string; role?: string; actor_name?: string; agent_id?: string; subagent_session_id?: string; cycle_started_at?: string; silent_exit_attempt?: number; terminal_reason?: string; silent_exit_family_key?: string; silent_exit_retry_count?: number; }): Promise<'created' | 'suppressed' | 'failed'>; export declare function startMentionAuditRun(config: AwbConfig, ticketId: string, body: { cycle_trigger_id: string; agent_id: string; role?: string; attempt: number; subagent_session_id?: string; }): Promise<{ run_token: string; attempt: number; } | null>; export declare function completeMentionAuditRun(config: AwbConfig, ticketId: string, runToken: string, exitCode: number | null): Promise<{ decision: 'succeeded' | 'retry' | 'retry_claimed' | 'failed'; attempt: number; reason?: string; } | null>; export declare function failMentionAuditRetrySpawn(config: AwbConfig, ticketId: string, runToken: string): Promise<{ decision: 'failed'; attempt: 1; reason: string; family_key?: string; } | null>; export declare function postSilentExitSystemCommentRaw(config: AwbConfig, ticketId: string, body: Parameters[2]): Promise<{ outcome: SendOutcome; result: 'created' | 'suppressed' | 'failed'; }>; export declare function provisionManagedAgentApiKey(config: AwbConfig, agentId: string, workspaceId?: string): Promise<{ raw_key: string; key_id: string; agent_id: string; workspace_id: string; } | null>; export declare function requestManagerTriggerRepush(config: AwbConfig, agentId: string, items: Array<{ ticket_id: string; role: string; }>): Promise<{ emitted: number; skipped: number; } | null>; export interface AgentSessionRef { manager_id: string; cli: string; session_id: string; } export interface AgentSessionEventInput { type: string; payload: Record; turn_id?: string; seq?: number; id?: string; created_at?: string; } export interface AgentSessionConfigOptionPatch { config_id: string; name: string; description?: string; category: string; type: string; current_value: string | boolean | null; options: Array<{ value: string; name: string; description?: string; group?: string; }>; } export interface AgentSessionAuthPatch { source: 'credential' | 'operator'; kind: string; label: string; detail?: string; account?: { email?: string; organization?: string; plan?: string; }; } export interface AgentSessionStatePatch { status?: string; cwd?: string; title?: string; current_mode?: string | null; available_modes?: Array<{ id: string; name: string; description?: string; }> | null; config_options?: AgentSessionConfigOptionPatch[] | null; available_commands?: Array<{ name: string; description: string; input_hint?: string; }> | null; auth?: AgentSessionAuthPatch | null; resume_supported?: boolean; last_error?: string | null; reason?: string; } export interface AgentSessionRestResult { ok: boolean; status: number; body?: any; } export declare function postAgentSessionRpcResponse(config: AwbConfig, managerId: string, requestId: string, body: { ok: boolean; result?: unknown; error?: string; code?: string; }): Promise; export declare function postAgentSessionEvents(config: AwbConfig, ref: AgentSessionRef, events: AgentSessionEventInput[], state?: AgentSessionStatePatch | null): Promise; export declare function patchAgentSessionState(config: AwbConfig, ref: AgentSessionRef, state: AgentSessionStatePatch): Promise; export declare function claimPrivilegedCommand(config: AwbConfig, instanceId: string, requestId: string): Promise<{ request_id: string; command: string; args: string[]; cwd: string | null; } | null>; export declare function postPrivilegedCommandResult(config: AwbConfig, instanceId: string, requestId: string, result: { ok: boolean; output: string; failure?: string | null; }): Promise; export declare function fetchSudoTicket(config: AwbConfig, ticketId: string): Promise<{ password: string; scope: Record; } | null>; export declare function fetchSessionCredential(config: AwbConfig, managerId: string, credentialId: string, workspaceId: string): Promise<{ credential_id: string; provider: string; fields: Record; } | null>; export {};