import { ClaudePreToolUseOutput, PolicyConfig, ApprovalMode, ModeState, AutoResolveOrigin, AgentQuestion } from '@pushary/contracts'; export { ApprovalMode, ModeState, PolicyConfig, ToolPolicy, resolvePolicy } from '@pushary/contracts'; import { ReceiptMeta } from '@pushary/hook-mapping'; interface ToolInput { tool_name: string; tool_input: Record; session_id?: string; cwd?: string; transcript_path?: string; tool_use_id?: string; permission_mode?: string; } type HookOutput = ClaudePreToolUseOutput; declare const handlePreToolUse: (input: ToolInput) => Promise; declare const getPolicy: (apiKey: string, expectedVersion?: string | null, agent?: string, repoAware?: boolean, sessionId?: string) => Promise; declare const fetchModeState: (apiKey: string, sessionId?: string, reuseWithinMs?: number) => Promise; declare const fetchModeOverride: (apiKey: string) => Promise; interface UsageReport { readonly tokensIn: number; readonly tokensOut: number; readonly costUsd: number; readonly deltaUsd: number; } type DecisionSource = 'policy_auto' | 'human' | 'terminal'; interface AgentIdentity { readonly type: string; readonly label: string; } interface AgentEvent { event: string; agentType: string; agentName?: string; action?: string; machineId?: string; repoKey?: string; sessionId?: string; error?: string; taskTitle?: string; decisionSource?: DecisionSource; decisionOrigin?: AutoResolveOrigin; toolName?: string; toolTarget?: string; agents?: readonly string[]; meta?: ReceiptMeta; usage?: UsageReport; pid?: number; } interface ReportEventOptions { maxAttempts?: number; timeoutMs?: number; requireOk?: boolean; /** * Authenticate with this key instead of the ambient one. * * getApiKey() reads the environment and ~/.pushary/config.json, so it can only * ever speak for a key that is already installed. setup resolves a key minutes * before it writes one, and its abort beacons run inside that window: without * an override they post as nobody, so the runs that fail before saveApiKey are * exactly the runs that cannot report failing. */ apiKey?: string; } interface EventResponse { readonly ok?: boolean; readonly pendingCommand?: string; } declare const reportEvent: (event: AgentEvent, options?: ReportEventOptions) => Promise; declare const handlePostToolUse: (input: { tool_name: string; tool_input: Record; tool_response?: unknown; tool_result?: unknown; cwd?: string; session_id?: string; transcript_path?: string; }, agent?: AgentIdentity) => Promise; interface StopHookOutput { readonly decision: 'block'; readonly reason: string; } declare const handleStop: (input: { cwd?: string; session_id?: string; stop_hook_active?: boolean; transcript_path?: string; last_assistant_message?: string; background_tasks?: unknown; session_crons?: unknown; }, agent?: AgentIdentity) => Promise; declare const handleNotification: (input: { message?: string; title?: string; type?: string; notification_type?: string; cwd?: string; session_id?: string; }, agent?: AgentIdentity) => Promise; interface AskUserParams { question: string; type?: 'confirm' | 'select' | 'input'; options?: string[]; questions?: AgentQuestion[]; context?: string; agentName?: string; sessionId?: string; machineId?: string; toolName?: string; toolTarget?: string; repoKey?: string; intent?: string; action?: string; blocker?: string; actionBody?: string; scopePath?: string; toolUseId?: string; requestId?: string; } interface AskUserResponse { correlationId: string; status: string; delivery?: { web: number; mobile: number; }; suppressed?: boolean; noDevices?: boolean; answerUrl?: string; } interface AnswerResult { answered: boolean; value?: string; note?: string; } declare const askUser: (apiKey: string, params: AskUserParams, timeoutMs?: number) => Promise; declare const waitForAnswer: (apiKey: string, correlationId: string, timeoutMs?: number) => Promise; declare const cancelQuestion: (apiKey: string, correlationId: string) => Promise; declare const getApiKey: () => string; declare const getBaseUrl: () => string; export { askUser, cancelQuestion, fetchModeOverride, fetchModeState, getApiKey, getBaseUrl, getPolicy, handleNotification, handlePostToolUse, handlePreToolUse, handleStop, reportEvent, waitForAnswer };