import type { DelegationRecoveryGuarantee, DelegationSignalSource, DelegationStatus } from "../coordination/delegation/types.js"; export type TaskStatus = "pending" | "queued" | "running" | "completed" | "failed" | "error" | "cancelled" | "interrupt"; export type TaskNotification = { sessionID: string; description: string; agent: string; status: "started" | "completed" | "failed" | "cancelled"; error?: string; resultPreview?: string; briefSummary?: string; outputLink?: string; duration?: number; toolCallCount?: number; actionCount?: number; messageCount?: number; signalSource?: DelegationSignalSource; elapsedHuman?: string; progressPct?: number; artifacts?: string[]; commits?: string[]; metadata?: { delegationId: string; terminalState: DelegationStatus; recoveryGuarantee?: DelegationRecoveryGuarantee; summaryPreview?: string; }; }; export type PendingNotification = TaskNotification & { createdAt: number; delivered: boolean; /** Number of times this notification has been retried. */ retryCount: number; /** Maximum retry attempts before the notification is dropped. */ maxRetries: number; }; export declare const MAX_DESCENDANTS_PER_ROOT = 10; export type SpecialistAgent = string; export type PermissionAction = "allow" | "ask"; export type PermissionRule = { permission: string; pattern: string; action: PermissionAction; }; export type SessionStatusType = "idle" | "busy" | "retry" | string; export type SessionStatus = { type: SessionStatusType; [key: string]: unknown; }; export type RootBudget = { descendants: Set; reserved: number; }; export type LoopWindow = { signature: string; count: number; }; export type ToolCallSummary = { tool: string; args?: string; output?: string; status?: string; }; export type CapturedResult = { resultText: string; artifactPaths: string[]; gitCommits: string[]; toolCallSummary: ToolCallSummary[]; messageCount: number; capturedAt: number; partial?: boolean; }; export type SessionStats = { total: number; byTool: Record; loop: LoopWindow; warnings: string[]; }; export type DelegationMeta = { rootID: string; depth: number; budgetUsed: number; agent: SpecialistAgent; model?: string; queueKey: string; /** Per-session runtime-policy override from trusted continuity/delegation metadata. */ runtimePolicyOverride?: SessionPolicyOverride; }; export type CompactionCheckpointData = { agent: string | null; model: string | null; tools: string[]; delegationMeta: DelegationMeta | null; warnings: string[]; sessionStats: { total: number; byTool: Record; loop: { signature: string; count: number; }; }; capturedAt: number; }; export type HarnessStatus = "pending" | "queued" | "dispatching" | "running" | "completed" | "error" | "cancelled" | "interrupt" | "failed"; export type DelegationPacketStatus = "pending" | "running" | "completed" | "failed"; export declare const HARNESS_STATUS_TO_LIFECYCLE_PHASE: Record, "created" | "queued" | "dispatching" | "running" | "completed" | "failed">; /** * Map DelegationStatus → HarnessStatus at the coordination-to-plugin boundary. * Keeps each enum independent and avoids breaking existing direct imports. * Opt-in: existing direct imports of DelegationStatus continue to work unchanged. * @phase 22 */ export declare function delegationStatusToHarnessStatus(status: DelegationStatus): HarnessStatus; export type PerKeyConcurrencyPolicy = { limit: number; acquireTimeoutMs?: number; }; export type ConcurrencyPolicy = { globalLimit: number; perKey?: Record; }; export type BudgetPolicy = { maxToolCallsPerSession: number; repeatedSignatureThreshold: number; warningCap: number; resetOnCompact: boolean; }; export type TrustedRuntimePolicy = { /** * @deprecated Phase 46.1 (audit 2026-04-30, Finding 3): the harness now * always uses async dispatch for SDK-mode delegations. This flag is kept * on the policy schema only for backwards-compat with on-disk YAML and is * no longer consulted by the dispatch path. Removing it from a policy * file is safe; setting it to `false` no longer downgrades to sync. */ builtinAsyncBackgroundChildSessions: boolean; }; export type RuntimePolicy = { concurrency: ConcurrencyPolicy; budget: BudgetPolicy; trustedRuntime: TrustedRuntimePolicy; maxDelegationDepth?: number; }; export type SessionBudgetOverride = Partial; export type SessionConcurrencyOverride = { globalLimit?: number; perKey?: Record; }; export type SessionPolicyOverride = { concurrency?: SessionConcurrencyOverride; budget?: SessionBudgetOverride; trustedRuntime?: Partial; /** Override for max delegation nesting depth */ maxDelegationDepth?: number; }; export type ResolvedConcurrencyPolicy = { limit: number; acquireTimeoutMs?: number; }; export type ResolvedBudgetPolicy = BudgetPolicy; export type SessionLifecyclePhase = "created" | "queued" | "dispatching" | "running" | "completed" | "failed"; export type SessionLifecycleState = { phase: SessionLifecyclePhase; launchedAt?: number; completedAt?: number; runMode?: string; queue?: { active: number; limit: number; pending: number; }; observation?: { source: string; observedAt: number; detail: string; }; error?: string; }; export type SessionPromptParams = { agent?: string; category?: string; tools?: string[]; [key: string]: unknown; }; export type SessionToolProfile = { allowed?: string[]; denied?: string[]; [key: string]: unknown; }; export type DelegationPacket = { id: string; createdAt: number; spec: string; plan?: string; artifacts: string[]; commits: string[]; parentChain: string[]; status: DelegationPacketStatus; updatedAt: number; }; export type SessionContinuityMetadata = { status: TaskStatus; description: string; title?: string; delegation: DelegationMeta | null; category?: string; constraints: string[]; lifecycle?: SessionLifecycleState; pendingNotifications: PendingNotification[]; resultCapture?: CapturedResult; compactionCheckpoint?: CompactionCheckpointData; delegationPacket?: DelegationPacket; route?: string; lastToolActivityAt?: number; updatedAt: number; }; export type SessionContinuityRecord = { sessionID: string; promptParams: SessionPromptParams; toolProfile?: SessionToolProfile; metadata: SessionContinuityMetadata; }; export type GovernanceRule = { id: string; condition: { toolNames?: string[]; sessionIDs?: string[]; depth?: { min?: number; max?: number; }; [key: string]: unknown; }; action: { type: string; escalation?: Record; [key: string]: unknown; }; enabled: boolean; }; export type GovernanceViolation = { ruleId: string; sessionID: string; timestamp: number; detail: string; escalation?: Record; }; export type GovernancePersistenceState = { rules: GovernanceRule[]; violations: GovernanceViolation[]; updatedAt: number; }; export type ContinuityStoreFile = { version: number; updatedAt: number; sessions: Record; governance: GovernancePersistenceState; }; export type CheckpointData = CompactionCheckpointData; export type { DelegationStatus, DelegationSurface, DelegationRecoveryGuarantee, DelegationTerminalKind, Delegation, DelegationResult, CommandDelegationParams, } from "../coordination/delegation/types.js"; export { MAX_DELEGATION_DEPTH, TASK_CLEANUP_DELAY_MS, MAX_DELEGATIONS_BEFORE_PRUNE, DEFAULT_PRUNE_MAX_AGE_MS, POLL_INTERVAL_ACTIVE_MS, POLL_INTERVAL_BASE_MS, POLL_INTERVAL_IDLE_MS, POLL_INTERVAL_DEEP_IDLE_MS, MIN_IDLE_TIME_MS, DEFAULT_STALE_TIMEOUT_MS, MIN_STABILITY_TIME_MS, STABLE_POLLS_REQUIRED, STABILITY_THRESHOLD, STABILITY_POLL_INTERVAL_MS, } from "../coordination/delegation/types.js"; export type { ConfigWorkflowState, WorkflowTurn, WorkflowTurnRecord, WorkflowTurnStatus, WorkflowResumeResult, } from "../config/workflow/workflow-types.js"; export { WORKFLOW_TURNS } from "../config/workflow/workflow-types.js"; export interface ValidationResult { valid: boolean; errors: string[]; warnings?: string[]; } //# sourceMappingURL=types.d.ts.map