import { Type } from "typebox"; /** * Session protocol schemas. * * These requests and results cover transcript discovery, lifecycle control, * compaction checkpoints, per-session plugin state, and usage reporting. The * schemas are shared by dashboard, CLI, ACP, and gateway RPC callers. */ /** Reason a compaction checkpoint was created. */ export declare const SessionCompactionCheckpointReasonSchema: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"auto-threshold">, Type.TLiteral<"overflow-retry">, Type.TLiteral<"timeout-retry">]>; /** Start/end event emitted while a session compaction operation runs. */ export declare const SessionOperationEventSchema: Type.TObject<{ operationId: Type.TString; operation: Type.TLiteral<"compact">; phase: Type.TUnion<[Type.TLiteral<"start">, Type.TLiteral<"end">]>; sessionKey: Type.TString; agentId: Type.TOptional; ts: Type.TInteger; completed: Type.TOptional; reason: Type.TOptional; }>; /** Reference to the transcript location before or after compaction. */ export declare const SessionCompactionTranscriptReferenceSchema: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; /** Stored compaction checkpoint metadata for branching or restoring a session. */ export declare const SessionCompactionCheckpointSchema: Type.TObject<{ checkpointId: Type.TString; sessionKey: Type.TString; sessionId: Type.TString; createdAt: Type.TInteger; reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"auto-threshold">, Type.TLiteral<"overflow-retry">, Type.TLiteral<"timeout-retry">]>; tokensBefore: Type.TOptional; tokensAfter: Type.TOptional; summary: Type.TOptional; firstKeptEntryId: Type.TOptional; preCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; postCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; }>; /** Lists sessions with optional scope, activity, label, and preview filters. */ export declare const SessionsListParamsSchema: Type.TObject<{ /** * Maximum rows to return. Omitted Gateway RPC calls use a bounded default * to keep large session stores from monopolizing the event loop. */ limit: Type.TOptional; offset: Type.TOptional; activeMinutes: Type.TOptional; includeGlobal: Type.TOptional; includeUnknown: Type.TOptional; /** * Limit returned agent-scoped rows to agents currently present in config. * Broad disk discovery remains the default for recovery/ACP consumers. */ configuredAgentsOnly: Type.TOptional; /** * Read first 8KB of each session transcript to derive title from first user message. * Performs a file read per session - use `limit` to bound result set on large stores. */ includeDerivedTitles: Type.TOptional; /** * Read last 16KB of each session transcript to extract most recent message preview. * Performs a file read per session - use `limit` to bound result set on large stores. */ includeLastMessage: Type.TOptional; label: Type.TOptional; spawnedBy: Type.TOptional; agentId: Type.TOptional; search: Type.TOptional; }>; /** Repairs or removes invalid session records from the selected agent scope. */ export declare const SessionsCleanupParamsSchema: Type.TObject<{ agent: Type.TOptional; allAgents: Type.TOptional; enforce: Type.TOptional; activeKey: Type.TOptional; fixMissing: Type.TOptional; fixDmScope: Type.TOptional; }>; /** Reads short previews for selected session keys. */ export declare const SessionsPreviewParamsSchema: Type.TObject<{ keys: Type.TArray; limit: Type.TOptional; maxChars: Type.TOptional; }>; /** Describes one session and optional derived title/last-message previews. */ export declare const SessionsDescribeParamsSchema: Type.TObject<{ key: Type.TString; includeDerivedTitles: Type.TOptional; includeLastMessage: Type.TOptional; }>; /** Resolves a session by key, raw session id, label, or parent/agent scope. */ export declare const SessionsResolveParamsSchema: Type.TObject<{ key: Type.TOptional; sessionId: Type.TOptional; label: Type.TOptional; agentId: Type.TOptional; spawnedBy: Type.TOptional; includeGlobal: Type.TOptional; includeUnknown: Type.TOptional; }>; /** Creates or adopts a session with optional model, label, and parent linkage. */ export declare const SessionsCreateParamsSchema: Type.TObject<{ key: Type.TOptional; agentId: Type.TOptional; label: Type.TOptional; model: Type.TOptional; parentSessionKey: Type.TOptional; emitCommandHooks: Type.TOptional; task: Type.TOptional; message: Type.TOptional; }>; /** Sends one message into an existing session. */ export declare const SessionsSendParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; message: Type.TString; thinking: Type.TOptional; attachments: Type.TOptional>; timeoutMs: Type.TOptional; idempotencyKey: Type.TOptional; }>; /** Subscribes a client to live message updates for one session. */ export declare const SessionsMessagesSubscribeParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; }>; /** Removes a live message subscription for one session. */ export declare const SessionsMessagesUnsubscribeParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; }>; /** Aborts the active or named run for a session. */ export declare const SessionsAbortParamsSchema: Type.TObject<{ key: Type.TOptional; runId: Type.TOptional; agentId: Type.TOptional; }>; /** Mutable per-session preferences and routing metadata. */ export declare const SessionsPatchParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; label: Type.TOptional>; thinkingLevel: Type.TOptional>; fastMode: Type.TOptional>; verboseLevel: Type.TOptional>; traceLevel: Type.TOptional>; reasoningLevel: Type.TOptional>; responseUsage: Type.TOptional, Type.TLiteral<"tokens">, Type.TLiteral<"full">, Type.TLiteral<"on">, Type.TNull]>>; elevatedLevel: Type.TOptional>; execHost: Type.TOptional>; execSecurity: Type.TOptional>; execAsk: Type.TOptional>; execNode: Type.TOptional>; model: Type.TOptional>; spawnedBy: Type.TOptional>; spawnedWorkspaceDir: Type.TOptional>; spawnedCwd: Type.TOptional>; spawnDepth: Type.TOptional>; subagentRole: Type.TOptional, Type.TLiteral<"leaf">, Type.TNull]>>; subagentControlScope: Type.TOptional, Type.TLiteral<"none">, Type.TNull]>>; inheritedToolAllow: Type.TOptional, Type.TNull]>>; inheritedToolDeny: Type.TOptional, Type.TNull]>>; sendPolicy: Type.TOptional, Type.TLiteral<"deny">, Type.TNull]>>; groupActivation: Type.TOptional, Type.TLiteral<"always">, Type.TNull]>>; }>; /** Updates or clears one plugin namespace value on a session record. */ export declare const SessionsPluginPatchParamsSchema: Type.TObject<{ key: Type.TString; pluginId: Type.TString; namespace: Type.TString; value: Type.TOptional; unset: Type.TOptional; }>; /** Result returned after patching session plugin state. */ export declare const SessionsPluginPatchResultSchema: Type.TObject<{ ok: Type.TLiteral; key: Type.TString; value: Type.TOptional; }>; /** Resets a session to a new or reset transcript state. */ export declare const SessionsResetParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; reason: Type.TOptional, Type.TLiteral<"reset">]>>; }>; /** Deletes a session record and optionally its transcript. */ export declare const SessionsDeleteParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; deleteTranscript: Type.TOptional; emitLifecycleHooks: Type.TOptional; }>; /** Requests manual compaction for a session transcript. */ export declare const SessionsCompactParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; maxLines: Type.TOptional; }>; /** Lists compaction checkpoints for one session. */ export declare const SessionsCompactionListParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; }>; /** Reads one compaction checkpoint by id. */ export declare const SessionsCompactionGetParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; checkpointId: Type.TString; }>; /** Creates a new branch from a compaction checkpoint. */ export declare const SessionsCompactionBranchParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; checkpointId: Type.TString; }>; /** Restores an existing session to a compaction checkpoint. */ export declare const SessionsCompactionRestoreParamsSchema: Type.TObject<{ key: Type.TString; agentId: Type.TOptional; checkpointId: Type.TString; }>; /** List response for session compaction checkpoints. */ export declare const SessionsCompactionListResultSchema: Type.TObject<{ ok: Type.TLiteral; key: Type.TString; checkpoints: Type.TArray, Type.TLiteral<"auto-threshold">, Type.TLiteral<"overflow-retry">, Type.TLiteral<"timeout-retry">]>; tokensBefore: Type.TOptional; tokensAfter: Type.TOptional; summary: Type.TOptional; firstKeptEntryId: Type.TOptional; preCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; postCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; }>>; }>; /** Get response for a single compaction checkpoint. */ export declare const SessionsCompactionGetResultSchema: Type.TObject<{ ok: Type.TLiteral; key: Type.TString; checkpoint: Type.TObject<{ checkpointId: Type.TString; sessionKey: Type.TString; sessionId: Type.TString; createdAt: Type.TInteger; reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"auto-threshold">, Type.TLiteral<"overflow-retry">, Type.TLiteral<"timeout-retry">]>; tokensBefore: Type.TOptional; tokensAfter: Type.TOptional; summary: Type.TOptional; firstKeptEntryId: Type.TOptional; preCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; postCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; }>; }>; /** Branch response with the newly created session key and entry metadata. */ export declare const SessionsCompactionBranchResultSchema: Type.TObject<{ ok: Type.TLiteral; sourceKey: Type.TString; key: Type.TString; sessionId: Type.TString; checkpoint: Type.TObject<{ checkpointId: Type.TString; sessionKey: Type.TString; sessionId: Type.TString; createdAt: Type.TInteger; reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"auto-threshold">, Type.TLiteral<"overflow-retry">, Type.TLiteral<"timeout-retry">]>; tokensBefore: Type.TOptional; tokensAfter: Type.TOptional; summary: Type.TOptional; firstKeptEntryId: Type.TOptional; preCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; postCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; }>; entry: Type.TObject<{ sessionId: Type.TString; updatedAt: Type.TInteger; }>; }>; /** Restore response with updated session entry metadata. */ export declare const SessionsCompactionRestoreResultSchema: Type.TObject<{ ok: Type.TLiteral; key: Type.TString; sessionId: Type.TString; checkpoint: Type.TObject<{ checkpointId: Type.TString; sessionKey: Type.TString; sessionId: Type.TString; createdAt: Type.TInteger; reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"auto-threshold">, Type.TLiteral<"overflow-retry">, Type.TLiteral<"timeout-retry">]>; tokensBefore: Type.TOptional; tokensAfter: Type.TOptional; summary: Type.TOptional; firstKeptEntryId: Type.TOptional; preCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; postCompaction: Type.TObject<{ sessionId: Type.TString; sessionFile: Type.TOptional; leafId: Type.TOptional; entryId: Type.TOptional; }>; }>; entry: Type.TObject<{ sessionId: Type.TString; updatedAt: Type.TInteger; }>; }>; /** Usage report query across one session, one agent, or all agent sessions. */ export declare const SessionsUsageParamsSchema: Type.TObject<{ /** Specific session key to analyze; if omitted returns sessions for the effective agent. */ key: Type.TOptional; /** Agent scope for list-style usage queries. */ agentId: Type.TOptional; /** Explicit all-agent scope for list-style usage queries. */ agentScope: Type.TOptional>; /** Start date for range filter (YYYY-MM-DD). */ startDate: Type.TOptional; /** End date for range filter (YYYY-MM-DD). */ endDate: Type.TOptional; /** How start/end dates should be interpreted. Defaults to UTC when omitted. */ mode: Type.TOptional, Type.TLiteral<"gateway">, Type.TLiteral<"specific">]>>; /** Preset range for usage queries when explicit start/end dates are omitted. */ range: Type.TOptional, Type.TLiteral<"30d">, Type.TLiteral<"90d">, Type.TLiteral<"1y">, Type.TLiteral<"all">]>>; /** Usage row grouping. `family` rolls up known rotated session ids for a logical key. */ groupBy: Type.TOptional, Type.TLiteral<"family">]>>; /** Backward-compatible alias for requesting family grouping. */ includeHistorical: Type.TOptional; /** UTC offset to use when mode is `specific` (for example, UTC-4 or UTC+5:30). */ utcOffset: Type.TOptional; /** Maximum sessions to return (default 50). */ limit: Type.TOptional; /** Include context weight breakdown (systemPromptReport). */ includeContextWeight: Type.TOptional; }>;