import type { AgentLoopRuntime } from "./loop.js"; import type { FabricSession } from "./session.js"; import type { ModelProvider, ThinkingLevel } from "./model.js"; import type { ModelConfig, ProvidersConfig } from "./providers.js"; import type { CapabilityPolicy } from "./policy.js"; import type { SandboxEnv, SandboxFactory } from "./sandbox.js"; import type { Command, SecretRef, ToolCall, ToolDef } from "./tools.js"; import type { DeliveredMessage } from "./delivered-message.js"; export type JsonPrimitive = string | number | boolean | null; export type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue; }; export type JsonObject = { [key: string]: JsonValue; }; export interface ActorIdentity { id: string; type?: "user" | "agent" | "service" | "system"; provider?: string; tenantId?: string; displayName?: string; } /** * The governed identity a piece of work runs as (v2). Distinct from * {@link ActorIdentity} (who asked): the principal is what the platform's * access control enforces — a human user, a machine service principal, or a * hosted app's own identity. `ucPrincipal` carries the catalog-governance * principal name when the platform has one (e.g. Unity Catalog). */ export interface FabricPrincipal { kind: "user" | "service-principal" | "app-principal"; id: string; ucPrincipal?: string; displayName?: string; } export interface FabricActor { agentId?: string | ActorIdentity; onBehalfOf?: string | ActorIdentity; approver?: string | ActorIdentity; /** Governed identity the work executes as; propagated through submissions → tool calls → lineage. */ principal?: FabricPrincipal; } /** * JSON-safe identity required to re-render a persistent dynamic agent at a * trusted durable-runtime boundary. Hook functions, tool implementations, * credentials, and resolved MCP connections are deliberately excluded. */ export interface DynamicAgentExecutionDescriptor { readonly version: 1; readonly agentName: string; readonly instanceId: string; readonly resourceFingerprint: string; readonly delivery?: DeliveredMessage; readonly tenantId?: string; readonly actor?: FabricActor; readonly submissionId?: string; readonly attemptId?: string; } /** * Execution runtime selection. * * - `inline` (default): single-process execution. Uses the configured * `SessionStore` (in-memory by default) for history, artifacts, approvals. * - `stateless`: explicit headless / ephemeral mode. No session store, * no artifact persistence, no approval waiting. Each invocation is * independent. Use for high-volume webhook agents and edge runtimes * where state would just be discarded anyway. In production * (`FABRIC_ENV=production` or `NODE_ENV=production`) this mode must * be selected explicitly — `inline` without an explicit store will * warn or fail depending on `FABRIC_ALLOW_EPHEMERAL_STATE`. * - `temporal`: durable, restartable workflows via @fabric-harness/temporal. */ export type FabricRuntime = "inline" | "stateless" | "temporal"; /** * Structural delegate for durable session execution. When `init()` is given a * `sessionRuntime` factory that produces one of these, the SDK's session calls * (`prompt`, `task`, `shell`, `checkpoint.*`) are routed through the runtime * instead of executing inline. This is the seam for Temporal workflows, * external orchestration runtimes, or test fakes. * * `mount`, `history`, `artifact`, and `compact` remain SDK-local concerns and * are not delegated — they operate against the local session store. */ export interface DurableSessionRuntime { /** * Explicit capability signal. Dynamic agents fail closed unless the durable * runtime can re-render their configuration at a trusted execution boundary. */ readonly supportsDynamicAgents?: true; prompt(input: { text: string; options?: PromptOptions; dynamic?: DynamicAgentExecutionDescriptor; }): Promise; task(input: { text: string; taskId?: string; options?: PromptOptions; dynamic?: DynamicAgentExecutionDescriptor; }): Promise; shell(input: { command: string; options?: ShellOptions; }): Promise; checkpointCreate(input: { options: CheckpointCreateOptions | string; }): Promise; checkpointRestore(input: { options: CheckpointRestoreOptions | string; }): Promise; /** * Optional. When present, `session.approval.request()` routes through the * runtime instead of the local `SessionStore` waiter. Temporal-backed * runtimes implement this by signaling the workflow that owns the session, * making custom approvals durable across worker rotation. Returning * `undefined` indicates the runtime cannot service this approval (e.g. no * active workflow); the SDK falls back to its store-based path. */ approvalRequest?(input: { request: ApprovalRequest; timeoutMs?: number; }): Promise; } export type DurableSessionRuntimeFactory = (context: { sessionId: string; agentId?: string; }) => DurableSessionRuntime | Promise; export type AutonomyMode = "background" | "interactive"; export type MissingInputStrategy = "assume" | "fail"; export type ApprovalUnavailableStrategy = "fail" | "deny" | "wait"; export type CredentialMissingStrategy = "fail"; export interface AutonomyOptions { /** * background means no human operator is assumed. Agents should make safe * progress, fail with actionable errors when blocked, and use approvals as * control-plane gates rather than asking clarifying questions in-band. */ mode?: AutonomyMode; onMissingInput?: MissingInputStrategy; onApprovalUnavailable?: ApprovalUnavailableStrategy; onCredentialMissing?: CredentialMissingStrategy; } export type SandboxBackend = "empty" | "virtual" | "local" | "docker" | "azure-container-apps" | "azure-container-instances" | "aks" | "databricks" | "e2b" | "daytona" | "cloudflare" | "modal" | "kubernetes" | "firecracker"; export interface FabricContext { init: (options?: AgentInit) => Promise; payload: TPayload; env?: Record; request?: unknown; /** Cancellation for the containing finite run or host request. */ signal?: AbortSignal; } export interface AgentInit { id?: string; name?: string; model?: ModelConfig; modelProvider?: ModelProvider; /** Resolve the provider that owns a dynamically selected model. */ modelProviderResolver?: ModelProviderResolver; providers?: ProvidersConfig; /** * Default reasoning effort for this agent's prompts. Overridable per session * (`SessionOptions.thinkingLevel`) and per call (`PromptOptions.thinkingLevel`). * Applied only by reasoning-capable providers; ignored otherwise. */ thinkingLevel?: ThinkingLevel; loopRuntime?: AgentLoopRuntime; runtime?: FabricRuntime; /** * Optional factory producing a durable session runtime. When set, the * session's `prompt`, `task`, `shell`, and `checkpoint.*` methods delegate * to the returned runtime instead of executing inline. Pair with * `runtime: 'temporal'` and a Temporal-backed factory for durable execution. */ sessionRuntime?: DurableSessionRuntimeFactory; sandbox?: SandboxBackend | SandboxFactory | SandboxEnv; role?: string | Role; roles?: Role[]; skills?: Skill[]; packagedSkills?: Record; tools?: ToolDef[]; commands?: Command[]; policy?: CapabilityPolicy; store?: SessionStore; /** * Optional persistence adapter. When provided, the SDK calls * `persistence.connect()` to obtain the session store. Mutually exclusive * with `store` — provide one or the other. */ persistence?: import("./persistence.js").PersistenceAdapter; metadata?: JsonObject; /** Default working directory for session shell/file tools, scoped inside the sandbox workspace. */ cwd?: string; /** * When true, raw `sandbox.exec` / `readFile` / `writeFile` etc. calls do * NOT go through `CapabilityPolicy` enforcement. Tool/command-layer * enforcement still applies. Use only when you have your own enforcement * layered higher (e.g. an external proxy, network policy, custom tools). * Defaults to false. */ bypassPolicyEnforcement?: boolean; actor?: FabricActor; autonomy?: AutonomyOptions; compaction?: CompactionSettings; onEvent?: FabricEventCallback; resolveSecret?: (ref: SecretRef) => string | undefined | Promise; onApproval?: ApprovalCallback; /** Default timeout for approval requests created by this agent's sessions. */ approvalTimeoutMs?: number; /** * Per-call / per-session USD spend caps. Builds on per-call cost telemetry. * Limits are evaluated after each model call's cost is computed; on a * violation, the loop either throws (`onExceed: 'throw'`, default) or * pauses for an approval (`onExceed: 'approve'`). */ costLimit?: import("./cost-budget.js").CostLimit; /** * Opaque tenant id stamped on every session/entry/event/approval this * agent creates. fabric-harness never interprets this string — host * applications map it to their own identity layer. */ tenantId?: string; /** * Optional cross-session memory store. When set, exposed on every * spawned session as `session.memory`. Distinct from session entries * (audit log) — memory is for recall, entries are for audit. */ memory?: import("./session-memory.js").SessionMemory; /** Runtime declarations produced by hook-style `createAgent()` rendering. */ dynamic?: import("./dynamic-agent.js").DynamicAgentRuntime; } /** * Aggregate context-compaction config. When enabled, the harness summarizes * older session entries before they exceed the model's context window, and * also recovers from a context-overflow error from the provider by compacting * and retrying once. * * Merged at prompt time with any per-call overrides on `PromptOptions`. * * - **Bare `@fabric-harness/sdk` import** defaults `enabled: true` so long * sessions don't fail at the context-window boundary. * - **`@fabric-harness/sdk/strict` import** does not inject any default — * compaction is off unless you set `init({ compaction: { enabled: true } })` * explicitly. Required for Temporal replay determinism. */ export interface CompactionSettings { enabled?: boolean; /** * Threshold (in estimated tokens) at which auto-compaction triggers. * If unset, derived from `contextWindowTokens - reserveTokens` whenever * a `contextWindowTokens` is known (model-provided or `init.contextWindowTokens`). */ compactAtTokens?: number; /** * Tokens kept in reserve below the model's context window. Default 20000. */ reserveTokens?: number; /** * Tokens of recent context kept verbatim during compaction. Older entries * are folded into a single summary entry. Default 8000. */ keepRecentTokens?: number; /** * Number of recent session entries kept verbatim during compaction. Older * entries are folded into a single summary entry. Default 20. */ keepRecentEntries?: number; /** * If true (default), the harness catches `context overflow` errors from * the model provider, compacts, and retries the prompt once. */ recoverFromOverflow?: boolean; } export interface FabricAgent { readonly id: string; readonly model?: string; /** Default reasoning effort inherited by spawned sessions. */ readonly thinkingLevel?: ThinkingLevel; readonly role?: string | Role; /** * Out-of-band filesystem helper backed by a lazily-created default session. * Prefer `session.fs` when you need explicit session identity/lifecycle. */ readonly fs: import("./filesystem.js").FabricFs; session(id?: string, options?: SessionOptions): Promise; } export interface SessionOptions { id?: string; role?: string | Role; model?: ModelConfig; modelProvider?: ModelProvider; /** Resolve the provider that owns a dynamically selected model. */ modelProviderResolver?: ModelProviderResolver; providers?: ProvidersConfig; /** Per-session reasoning effort. Inherited from the agent when unset. */ thinkingLevel?: ThinkingLevel; loopRuntime?: AgentLoopRuntime; store?: SessionStore; /** * Optional per-session persistence adapter. When provided, the SDK calls * `persistence.connect()` to obtain the session store. Mutually exclusive * with `store`. */ persistence?: import("./persistence.js").PersistenceAdapter; roles?: Role[]; skills?: Skill[]; packagedSkills?: Record; sandbox?: SandboxBackend | SandboxFactory | SandboxEnv; tools?: ToolDef[]; commands?: Command[]; policy?: CapabilityPolicy; compaction?: CompactionSettings; metadata?: JsonObject; /** Default working directory for this session's shell/file tools, scoped inside the sandbox workspace. */ cwd?: string; /** * Disable sandbox-layer policy enforcement for this session. See * `AgentInit.bypassPolicyEnforcement` for the contract. */ bypassPolicyEnforcement?: boolean; actor?: FabricActor; autonomy?: AutonomyOptions; onEvent?: FabricEventCallback; resolveSecret?: (ref: SecretRef) => string | undefined | Promise; onApproval?: ApprovalCallback; approvalTimeoutMs?: number; /** Per-session override for the agent's `costLimit`. */ costLimit?: import("./cost-budget.js").CostLimit; /** Opaque tenant id. Inherited from agent's `tenantId` when unset. */ tenantId?: string; /** Per-session memory override. Inherited from agent when unset. */ memory?: import("./session-memory.js").SessionMemory; /** * Optional durable runtime delegate. Inherited from `AgentInit.sessionRuntime` * unless overridden per-session. */ sessionRuntime?: DurableSessionRuntimeFactory; /** Runtime declarations produced by hook-style `createAgent()` rendering. */ dynamic?: import("./dynamic-agent.js").DynamicAgentRuntime; } /** Provider and normalized model selected for a dynamically rendered model reference. */ export interface ResolvedDynamicModelProvider { provider: ModelProvider; /** Provider-native model id, when it differs from the rendered provider/model reference. */ model?: string; } export type ModelProviderResolver = (model: string) => ModelProvider | ResolvedDynamicModelProvider | Promise; export interface SubmissionDurability { maxRetry?: number; timeoutAt?: number; leaseExpiresAt?: number; } export interface TurnJournalState { operationId: string; turnId: string; } export interface JournalCallbacks { beforeProvider?: (state: TurnJournalState) => Promise | void; providerStarted?: (state: TurnJournalState) => Promise | void; toolRequestRecorded?: (state: TurnJournalState & { toolRequest: unknown; }) => Promise | void; committed?: (state: TurnJournalState & { committedLeafId?: string; }) => Promise | void; } export interface PromptOptions { role?: string | Role; model?: ModelConfig; modelProvider?: ModelProvider; providers?: ProvidersConfig; /** Per-call reasoning effort. Overrides the session/agent default. */ thinkingLevel?: ThinkingLevel; tools?: ToolDef[]; commands?: Command[]; policy?: CapabilityPolicy; toolCalls?: ToolCall[]; loopRuntime?: AgentLoopRuntime; maxIterations?: number; modelTimeoutMs?: number; modelRetries?: number; modelRetryDelayMs?: number; contextWindowTokens?: number; compactAtTokens?: number; reserveTokens?: number; autoCompact?: boolean; compactionKeepRecentEntries?: number; recoverContextOverflow?: boolean; approvalTimeoutMs?: number; signal?: AbortSignal; onEvent?: FabricEventCallback; onApproval?: ApprovalCallback; result?: ResultValidator; resultExtraction?: boolean | ResultExtractionOptions; resultRetries?: number; /** Working directory for prompt tool calls, relative to the session cwd when not absolute. */ cwd?: string; metadata?: JsonObject; autonomy?: AutonomyOptions; durability?: SubmissionDurability; /** * Correlates this prompt with a durable submission (v2 lifecycle). The * `submissionId` is stamped onto the canonical `user_prompt` or `signal` * entry so the reconciler can classify how far the submission progressed; * `onInputApplied` fires after the input entry is durably persisted and * before any provider work — the crash boundary the submission runner's * input-applied marker records. */ submission?: { submissionId: string; /** * Original typed delivery admitted by the trusted runtime. Signal inputs * are persisted as canonical `signal` entries instead of being flattened * into visible user prompts. Its rendered form must match the `text` * argument or the prompt fails closed. */ message?: DeliveredMessage; onInputApplied?: () => Promise | void; /** * Trusted runtime seam for messages admitted while this response is * busy. Called only at model turn boundaries; each returned input must be * durably recorded before its acknowledgement callback runs. */ takeJoinedInputs?: () => Promise Promise | void; }>>; }; } export interface SkillOptions extends PromptOptions { args?: JsonObject; } export interface TaskOptions extends PromptOptions { id?: string; agent?: string; /** Create a sandbox checkpoint before and after task execution for resumability/audit. */ checkpoint?: boolean | string; metadata?: JsonObject; /** * Internal: tracks task nesting depth. Set automatically when one task * spawns another. Hard-capped at {@link MAX_TASK_DEPTH} (4) to prevent * runaway recursion. */ depth?: number; } export declare const MAX_TASK_DEPTH = 4; export interface ShellOptions { cwd?: string; env?: Record; timeout?: number; signal?: AbortSignal; command?: Command; policy?: CapabilityPolicy; approvalTimeoutMs?: number; onApproval?: ApprovalCallback; } export interface ShellResult { command: string; exitCode: number; stdout: string; stderr: string; durationMs?: number; signal?: string; } export interface PackagedSkillDirectory { id: string; name: string; files: Record; } export interface Skill { name: string; description?: string; path?: string; relativePath?: string; model?: string; content?: string; metadata?: JsonObject; packaged?: PackagedSkillDirectory; } export interface Role { name: string; description?: string; path?: string; model?: string; thinkingLevel?: ThinkingLevel; content: string; /** Capabilities scoped to this delegated role. They are not inherited by sibling roles. */ tools?: ToolDef[]; skills?: Skill[]; subagents?: Role[]; metadata?: JsonObject; } export interface ArtifactCreateOptions { contentType?: string; metadata?: JsonObject; } export interface ArtifactRef { id: string; sessionId: string; name: string; path: string; contentType?: string; size: number; sha256: string; createdAt: string; uri?: string; metadata?: JsonObject; } export interface StreamChunkStore { appendStreamChunkSegment(streamKey: string, segmentIndex: number, body: string): Promise; getStreamChunkSegments(streamKey: string): Promise>; } export interface SessionStore { load(id: string): Promise; save(data: SessionData): Promise; /** Optional store-wide listing for dashboard/ops commands. */ listSessions?(): Promise; appendEvent?(sessionId: string, event: FabricEvent): Promise; appendEntry?(sessionId: string, entry: SessionEntry): Promise; /** * Atomically append a parent-linked batch of entries. * * Implementations must commit every previously unseen entry together or * commit none of them. Existing byte-equivalent ids make an exact replay a * successful no-op; reusing an id with different content must throw. * `expectedLeafId` is a compare-and-set fence: return `false`, without * writing, when the current leaf differs. Return `true` after an append or * an exact replay. */ appendEntries?(sessionId: string, entries: readonly SessionEntry[], options?: { expectedLeafId?: string | undefined; }): Promise; waitForApproval?(sessionId: string, approvalId: string, timeoutMs?: number): Promise; resolveApproval?(sessionId: string, approvalId: string, response: ApprovalResponse): Promise; voteApproval?(sessionId: string, approvalId: string, vote: ApprovalVote): Promise; getApprovalState?(sessionId: string, approvalId: string): Promise; listApprovalStates?(sessionId: string): Promise; putArtifact?(sessionId: string, name: string, content: string | Uint8Array, options?: ArtifactCreateOptions): Promise; getArtifact?(sessionId: string, artifactIdOrName: string): Promise<{ ref: ArtifactRef; content: Uint8Array; } | undefined>; listArtifacts?(sessionId: string): Promise; /** * Optional pub/sub for task-cancellation watching. When implemented, the * SDK uses this instead of polling `load()` every 500ms. The store should * invoke `onCancel()` once whenever a `task_cancelled` entry is appended * for the given `taskId`. The returned function unsubscribes. */ subscribeTaskCancellation?(sessionId: string, taskId: string, onCancel: () => void): () => void; /** * Optional deletion. Removes the session and all associated ephemeral * data (events, entries, artifacts) from the store. Implementations * that do not support deletion may omit this method. */ delete?(sessionId: string): Promise; } export type SessionEntryType = "user_prompt" | "assistant_message" | "model_attempt" | "tool_call" | "tool_result" | "shell_command" | "shell_result" | "task_start" | "task_checkpoint" | "task_end" | "task_failed" | "task_cancelled" | "artifact_created" | "metric" | "skill_start" | "skill_end" | "checkpoint_created" | "checkpoint_restored" | "compaction" | "approval_requested" | "approval_escalated" | "approval_voted" | "approval_granted" | "approval_denied" | "approval_expired" | "result" | "result_retry" | "activity_result" | "sandbox_ref" | "mount" | "signal" | "submission_settled" | "agent_state" | "tool_step" | "message_data" | "response_metadata" | "agent_initial_data" | "agent_instance" | "agent_render_structure" | "agent_lifecycle" | "error"; export interface SignalEntryData { tagName?: string; signalType: string; content: string; attributes?: Record; } export interface SessionEntry { id: string; type: SessionEntryType; timestamp: string; parentId?: string; actor?: FabricActor; data?: TData; /** * Opaque tenant id. fabric-harness never interprets this string — host * applications stamp it during session creation; downstream consumers * (audit pipelines, multi-tenant UIs) filter by it. */ tenantId?: string; } export interface SessionData { id: string; agentId?: string; createdAt: string; updatedAt: string; metadata?: JsonObject; events?: FabricEvent[]; entries?: SessionEntry[]; leafId?: string; /** Opaque tenant id. Inherited from agent / session options at create time. */ tenantId?: string; /** * Session data format version. Used for future migration support. * Defaults to 1 when not present. */ version?: number; /** * Opaque provider affinity key in `aff_` format. Generated * deterministically from `(agentId, sessionId)` and persisted so it * is stable across restarts. Forwarded to model providers as * `sessionId` where supported (e.g. Bedrock prompt caching). */ affinityKey?: string; } export interface CheckpointCreateOptions { label: string; metadata?: JsonObject; } export interface CheckpointRestoreOptions { label: string; } export interface CheckpointResult { label: string; entryId: string; snapshotId?: string; } export interface CompactionOptions { keepRecentEntries?: number; keepRecentTokens?: number; summary?: string; generateSummary?: boolean; /** Why compaction was triggered. Surfaced on the emitted `compaction` event. */ reason?: "threshold" | "overflow" | "manual"; /** Pre-compaction message count, surfaced on the event. */ messagesBefore?: number; /** Pre-compaction estimated tokens, surfaced on the event. */ tokensBefore?: number; } export interface CompactionResult { entryId: string; summary: string; compactedEntries: number; firstKeptEntryId?: string; details?: { readFiles: string[]; modifiedFiles: string[]; }; } export type FabricEventType = "text_delta" | "toolcall_delta" | "submission_queued" | "submission_running" | "submission_recovery" | "submission_settled" | "turn_start" | "turn_end" | "model_attempt" | "agent_start" | "session_start" | "prompt_start" | "prompt_end" | "skill_start" | "skill_end" | "task_start" | "task_checkpoint" | "task_end" | "task_failed" | "task_cancelled" | "artifact_created" | "metric" | "command_start" | "command_end" | "tool_start" | "tool_end" | "checkpoint_created" | "checkpoint_restored" | "compaction" | "approval_requested" | "approval_escalated" | "approval_voted" | "approval_granted" | "approval_denied" | "approval_expired" | "error" | "result_retry" | "result" | "mount" | "cost_limit" | "webhook_received"; export interface FabricEvent { id: string; type: FabricEventType; timestamp: string; sessionId?: string; data?: TData; /** Opaque tenant id, propagated from the session. */ tenantId?: string; /** Durable submission that emitted this event, when execution is submission-backed. */ submissionId?: string; /** Operation id for durable execution tracking. */ operationId?: string; /** Turn id for loop iteration tracking. */ turnId?: string; /** Sequential event index within a workflow run for append-only enforcement. */ eventIndex?: number; } export type FabricEventCallback = (event: FabricEvent) => void | Promise; export type ApprovalDecision = "approved" | "denied"; export interface ApprovalRequest { id: string; sessionId: string; reason: string; subject: string; kind: "tool" | "command" | "custom" | "cost-limit"; risk?: "low" | "medium" | "high"; requiredApprovals?: number; escalation?: { afterMs: number; notify?: string[]; risk?: "low" | "medium" | "high"; }; matchedPattern?: string; envKeys?: string[]; affectedPaths?: string[]; tool?: string; command?: string; input?: JsonValue; /** Logical call identity and digest bound into the resulting grant. */ toolCallId?: string; inputDigest?: string; executingPrincipal?: FabricPrincipal; actor?: FabricActor; createdAt: string; /** * Opaque audience id from a matched ApprovalPolicyRule. fabric-harness never * interprets this string — host applications map ids to humans via their * own identity layer (e.g. 'reviewer', 'compliance-team', 'project-admin'). */ audience?: string; /** Time-to-live in seconds for the approval request. */ ttlSeconds?: number; /** Opaque tenant id, propagated from the session. */ tenantId?: string; } export interface ApprovalResponse { decision: ApprovalDecision; reason?: string; /** Trusted identities that contributed approving votes. */ approvers?: ActorIdentity[]; /** * Durable authorization provenance for an approved logical operation. * Present only for approved responses that have been bound to a tool call, * input digest, and executing principal. */ grant?: ApprovalGrant; } /** * Durable provenance for one approved logical tool operation. * * A grant may be replayed for the same logical operation after a crash, but * must never authorize a different tool call, input, or executing principal. */ export interface ApprovalGrant { approvalId: string; toolCallId: string; /** `sha256-canonical-json-v1:` over the exact tool input. */ inputDigest: string; executingPrincipal: FabricPrincipal; approvers: ActorIdentity[]; decidedAt: string; expiresAt?: string; } export type ApprovalStateStatus = "pending" | "approved" | "denied" | "expired"; export interface ApprovalVote { approvalId: string; actor: ActorIdentity | string; decision: ApprovalDecision; reason?: string; votedAt: string; } export interface ApprovalState { id: string; sessionId: string; status: ApprovalStateStatus; requiredApprovals: number; approvedCount: number; deniedCount: number; votes: ApprovalVote[]; request: ApprovalRequest; grant?: ApprovalGrant; resolvedAt?: string; resolutionReason?: string; } export interface ApprovalOptions { timeoutMs?: number; } export type ApprovalCallback = (request: ApprovalRequest) => ApprovalResponse | ApprovalDecision | boolean | Promise; export interface ResultExtractionOptions { startDelimiter?: string; endDelimiter?: string; parseJson?: boolean; required?: boolean; } export interface ResultValidator { parse?: (value: unknown) => TResult; safeParse?: (value: unknown) => { success: true; data: TResult; } | { success: false; error: unknown; }; validate?: (value: unknown) => TResult | Promise; } //# sourceMappingURL=types.d.ts.map