/** * Pending delegations SSOT — written by task-handler on delegate-deferred. * Grok hooks read the same file; PostToolUse never re-parses MCP output. */ import type { LeadDevPlan, LeadDevTodo } from './autonomy-kernel.js'; export declare const DEFAULT_PENDING_TTL_MS: number; export type DelegationMatchMethod = 'taskId' | 'description' | 'agent-only' | 'none'; export interface SpawnHint { tool: 'Task'; subagent_type: string; description: string; planTodoId: string | null; delegationId: string; } export interface PendingDelegation { id: string; taskId: string; agent: string; taskDescription: string; taskType: string; sessionId: string; planTodoId: string | null; planTodoTask: string | null; matchMethod: DelegationMatchMethod; matchConfidence: number; status: 'pending' | 'satisfied'; createdAt: string; satisfiedAt: string | null; spawnHint: SpawnHint; } export interface PendingDelegationsState { sessionId: string; createdAt: string; ttlMs: number; delegations: PendingDelegation[]; } export interface DeferredTaskRecord { taskId: string; agent: string; description: string; type?: string; } export declare function pendingDelegationsPath(projectRoot?: string): string; export declare function leadDevPlanPath(projectRoot?: string): string; export declare function isAutoChainDelegationsEnabled(projectRoot?: string): boolean; export declare function matchPlanTodo(agent: string, taskDescription: string, taskId: string, plan: LeadDevPlan | null): { todo: LeadDevTodo | null; method: DelegationMatchMethod; confidence: number; }; export declare function mapSubagentToTaskType(agent: string): string; export declare function buildSpawnHint(delegation: Pick): SpawnHint; export declare function loadPendingDelegationsState(projectRoot?: string): PendingDelegationsState | null; export declare function savePendingDelegationsState(state: PendingDelegationsState, projectRoot?: string): string; export declare function recordDeferredDelegations(sessionId: string, deferrals: DeferredTaskRecord[], projectRoot?: string): PendingDelegation[]; export declare function isPendingStateActive(state: PendingDelegationsState | null, sessionId: string | null | undefined): boolean; export declare function getActivePendingDelegations(sessionId: string | null | undefined, projectRoot?: string): PendingDelegation[]; export interface SatisfyDelegationInput { delegationId?: string; taskId?: string; planTodoId?: string; agent?: string; toolPrompt?: string; } export declare function satisfyDelegation(input: SatisfyDelegationInput, projectRoot?: string): { satisfied: PendingDelegation[]; clearedAll: boolean; }; export declare function clearPendingDelegations(projectRoot?: string): boolean; export declare function clearPendingDelegationsForSessionChange(newSessionId: string | null | undefined, projectRoot?: string): boolean; export declare function delegationSummaryForResponse(delegations: PendingDelegation[]): Array>;