stitchkit 0.129.0 → 0.130.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/agent-executor/acp/v1-connect.d.ts +87 -19
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +4 -2
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-handlers.d.ts +56 -0
  7. package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -0
  8. package/dist/agent-executor/acp/v1-map.d.ts +13 -2
  9. package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
  10. package/dist/agent-executor/acp/v1-permission.d.ts +44 -0
  11. package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -0
  12. package/dist/agent-executor/acp/v1-protocol.d.ts +63 -10
  13. package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
  14. package/dist/agent-executor/acp/v1-session.d.ts +34 -7
  15. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  16. package/dist/agent-executor/acp/v1-turn.d.ts +51 -13
  17. package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
  18. package/dist/agent-executor/claude/classify.d.ts +10 -0
  19. package/dist/agent-executor/claude/classify.d.ts.map +1 -1
  20. package/dist/agent-executor/claude/cli-driver.d.ts +4 -1
  21. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  22. package/dist/agent-executor/claude/events.d.ts +146 -0
  23. package/dist/agent-executor/claude/events.d.ts.map +1 -0
  24. package/dist/agent-executor/claude/limits.d.ts +7 -1
  25. package/dist/agent-executor/claude/limits.d.ts.map +1 -1
  26. package/dist/agent-executor/claude/protocol.d.ts +49 -9
  27. package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
  28. package/dist/agent-executor/claude/session.d.ts +2 -0
  29. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  30. package/dist/agent-executor/claude-sdk/controls.d.ts +10 -1
  31. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
  32. package/dist/agent-executor/claude-sdk/driver.d.ts +97 -3
  33. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  34. package/dist/agent-executor/claude-sdk/probe.d.ts +29 -0
  35. package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -0
  36. package/dist/agent-executor/claude-sdk/query-loop.d.ts +53 -5
  37. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  38. package/dist/agent-executor/claude-sdk/query-options.d.ts +2 -0
  39. package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
  40. package/dist/agent-executor/claude-sdk/session.d.ts +2 -3
  41. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  42. package/dist/agent-executor/claude-sdk/turn-usage.d.ts +81 -0
  43. package/dist/agent-executor/claude-sdk/turn-usage.d.ts.map +1 -0
  44. package/dist/agent-executor/codex/classify.d.ts +4 -0
  45. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  46. package/dist/agent-executor/codex/connect.d.ts +2 -1
  47. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  48. package/dist/agent-executor/codex/control-client.d.ts +168 -0
  49. package/dist/agent-executor/codex/control-client.d.ts.map +1 -0
  50. package/dist/agent-executor/codex/driver.d.ts +22 -2
  51. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  52. package/dist/agent-executor/codex/handlers.d.ts +47 -0
  53. package/dist/agent-executor/codex/handlers.d.ts.map +1 -0
  54. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  55. package/dist/agent-executor/codex/protocol.d.ts +124 -0
  56. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  57. package/dist/agent-executor/codex/request-answers.d.ts +101 -0
  58. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -0
  59. package/dist/agent-executor/codex/session-controls.d.ts +91 -51
  60. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
  61. package/dist/agent-executor/codex/session.d.ts +34 -12
  62. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  63. package/dist/agent-executor/codex/shared-server.d.ts +29 -0
  64. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -0
  65. package/dist/agent-executor/codex/shared-thread.d.ts +46 -0
  66. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -0
  67. package/dist/agent-executor/codex/thread-controls.d.ts +128 -0
  68. package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -0
  69. package/dist/agent-executor/codex/turn-input.d.ts +30 -0
  70. package/dist/agent-executor/codex/turn-input.d.ts.map +1 -0
  71. package/dist/agent-executor/contract.d.ts +77 -0
  72. package/dist/agent-executor/contract.d.ts.map +1 -1
  73. package/dist/agent-executor/engine.d.ts +6 -2
  74. package/dist/agent-executor/engine.d.ts.map +1 -1
  75. package/dist/agent-executor/executor-contract.d.ts +54 -0
  76. package/dist/agent-executor/executor-contract.d.ts.map +1 -1
  77. package/dist/agent-executor/handoff-schemas.d.ts +407 -0
  78. package/dist/agent-executor/handoff-schemas.d.ts.map +1 -0
  79. package/dist/agent-executor/handoff.d.ts +12 -0
  80. package/dist/agent-executor/handoff.d.ts.map +1 -0
  81. package/dist/agent-executor/hello.d.ts +72 -0
  82. package/dist/agent-executor/hello.d.ts.map +1 -1
  83. package/dist/agent-executor/image-input.d.ts +22 -0
  84. package/dist/agent-executor/image-input.d.ts.map +1 -1
  85. package/dist/agent-executor/projection.d.ts +2 -2
  86. package/dist/agent-executor/projection.d.ts.map +1 -1
  87. package/dist/agent-executor/session-primitives.d.ts +10 -1
  88. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  89. package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
  90. package/dist/agent-executor/testing/replay-driver.d.ts +41 -0
  91. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -0
  92. package/dist/agent-executor/testing/replay-gate.d.ts +11 -0
  93. package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -0
  94. package/dist/agent-executor/testing/replay-runner.d.ts +27 -0
  95. package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -0
  96. package/dist/agent-executor/testing/replay-scenarios.d.ts +21 -0
  97. package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -0
  98. package/dist/agent-executor/testing/replay-transcript.d.ts +296 -0
  99. package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -0
  100. package/dist/agent-executor/vocabulary.d.ts +135 -0
  101. package/dist/agent-executor/vocabulary.d.ts.map +1 -1
  102. package/dist/agent-runtime/branch-provider.d.ts +2 -2
  103. package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -1
  104. package/dist/entrypoints/agent-executor/acp.d.ts +4 -1
  105. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  106. package/dist/entrypoints/agent-executor/acp.js +847 -214
  107. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +5 -1
  108. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  109. package/dist/entrypoints/agent-executor/claude-sdk.js +713 -205
  110. package/dist/entrypoints/agent-executor/claude.js +44 -19
  111. package/dist/entrypoints/agent-executor/codex.d.ts +9 -2
  112. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  113. package/dist/entrypoints/agent-executor/codex.js +1775 -359
  114. package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
  115. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  116. package/dist/entrypoints/agent-executor/testing.js +1002 -2
  117. package/dist/entrypoints/agent-executor.d.ts +4 -2
  118. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  119. package/dist/entrypoints/agent-executor.js +411 -23
  120. package/dist/entrypoints/agent-runtime.js +4 -23
  121. package/dist/entrypoints/tools/mcp.d.ts +1 -0
  122. package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
  123. package/dist/entrypoints/tools/mcp.js +1 -1
  124. package/dist/entrypoints/tools/toolkit.js +1 -1
  125. package/dist/{index-wv2amqm4.js → index-2s8sy57y.js} +36 -103
  126. package/dist/{index-afb6z77w.js → index-dbp6xemn.js} +75 -7
  127. package/dist/{index-bjmj2q1z.js → index-jrn3prgm.js} +1 -1
  128. package/dist/index-kne9g2c5.js +30 -0
  129. package/dist/index-p1qmpq0p.js +1300 -0
  130. package/dist/{index-7jqn3b3g.js → index-v759mzed.js} +152 -2
  131. package/dist/{index-cbhxhma2.js → index-x5ayy5bn.js} +1 -0
  132. package/dist/index-y0a4gt1s.js +142 -0
  133. package/dist/tools/internal/rank-tools.d.ts +10 -0
  134. package/dist/tools/internal/rank-tools.d.ts.map +1 -0
  135. package/dist/tools/mcp/handler.d.ts +7 -3
  136. package/dist/tools/mcp/handler.d.ts.map +1 -1
  137. package/dist/tools/mcp/lazy-discovery.d.ts +47 -0
  138. package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -0
  139. package/dist/tools/mcp/mount.d.ts +7 -0
  140. package/dist/tools/mcp/mount.d.ts.map +1 -1
  141. package/dist/tools/mcp/register.d.ts +2 -2
  142. package/dist/tools/mcp/register.d.ts.map +1 -1
  143. package/llms/agent-executor-acp.txt +7 -8
  144. package/llms/agent-executor-claude-sdk.txt +4 -2
  145. package/llms/agent-executor-codex.txt +8 -4
  146. package/llms/agent-executor-testing.txt +5 -1
  147. package/llms/agent-executor.txt +7 -6
  148. package/llms/stitchkit.txt +74 -74
  149. package/llms/tools-mcp.txt +3 -2
  150. package/llms/tools.txt +24 -0
  151. package/llms/{upgrading-0.128.0-0.129.0.txt → upgrading-0.128.0-0.130.0.txt} +30 -3
  152. package/llms/upgrading.txt +1 -1
  153. package/llms-full.txt +159 -97
  154. package/llms.txt +8 -8
  155. package/package.json +1 -1
  156. package/dist/index-y71zn1gw.js +0 -586
@@ -1,8 +1,15 @@
1
- import type { AgentMessagePart } from '../../agent-parts/parts.js';
2
1
  import type { AgentEngineDriver, AgentEngineSession, AgentEngineTurn } from '../engine.js';
3
- import { type DriverImageOptions, type InlinedPart } from '../image-input.js';
2
+ import type { InteractionReply } from '../executor-contract.js';
3
+ import type { ExecutorDriverCapabilities } from '../hello.js';
4
+ import type { DriverImageOptions } from '../image-input.js';
4
5
  import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
6
+ import type { ExecutorProfileConfig } from '../profile.js';
7
+ import type { ExecutorStartupPhase } from '../vocabulary.js';
8
+ import type { CodexControlClient, CodexControlConnectInput, CodexControlConnection, CodexListItemsParams, CodexListTurnsParams, CodexReadThreadParams } from './control-client.js';
5
9
  import { type CodexApprovalPolicy, type CodexCollaborationMode, type CodexSandboxMode, type CodexThreadContext } from './protocol.js';
10
+ import type { CodexSharedServer, CodexSharedServerOpenInput } from './shared-server.js';
11
+ import type { CodexInjectItemsParams, CodexRevertThreadParams, CodexRevertThreadResult, CodexSetThreadNameParams, CodexUpdateThreadMetadataParams } from './thread-controls.js';
12
+ import { type CodexTurnInputPart, type InlinedCodexPart } from './turn-input.js';
6
13
  /** Policy and configuration fields forwarded to Codex `thread/start`, `thread/resume`, and `thread/fork`. */
7
14
  export interface CodexThreadPolicyOverrides {
8
15
  /** Model identifier to use for the thread. */
@@ -20,45 +27,11 @@ export interface CodexThreadPolicyOverrides {
20
27
  /** Codex app-server config overrides for the thread (sandbox writable roots, disabled MCP/plugins/features, network policy). */
21
28
  readonly config?: Readonly<Record<string, JsonRpcValue>>;
22
29
  }
23
- /** Read-only and inspection RPCs exposed during thread setup (`prepareThread` / `verifyThread`) and on {@link CodexSession}. */
24
- export interface CodexControlClient {
25
- /** Read effective Codex configuration (`config/read`). */
26
- readConfig(params?: {
27
- readonly cwd?: string;
28
- readonly includeLayers?: boolean;
29
- }): Promise<JsonRpcValue>;
30
- /** List MCP servers and their statuses (`mcpServerStatus/list`). */
31
- listMcpServerStatus(params?: {
32
- readonly cursor?: string;
33
- readonly limit?: number;
34
- readonly threadId?: string;
35
- readonly serverName?: string;
36
- readonly detail?: string;
37
- }): Promise<JsonRpcValue>;
38
- /** List discovered Codex skills (`skills/list`). */
39
- listSkills(params?: {
40
- readonly cwds?: readonly string[];
41
- readonly forceReload?: boolean;
42
- }): Promise<JsonRpcValue>;
43
- /** List available models (`model/list`). */
44
- listModels(params?: {
45
- readonly cursor?: string;
46
- readonly limit?: number;
47
- readonly includeHidden?: boolean;
48
- readonly modelProvider?: string;
49
- }): Promise<JsonRpcValue>;
50
- /** Read active account information (`account/read`). */
51
- readAccount(params?: {
52
- readonly refreshToken?: boolean;
53
- }): Promise<JsonRpcValue>;
54
- /** Read the raw `account/rateLimits/read` response envelope. */
55
- readRateLimits(): Promise<JsonRpcValue>;
56
- }
57
- /** Input to {@link CodexSession.startTurn}, extending the portable turn input with Codex per-turn overrides. */
30
+ /** Input to {@link CodexSession.startTurn}, extending the portable turn input with Codex per-turn overrides and `skill` items. */
58
31
  export interface CodexTurnInput {
59
32
  readonly turnId: string;
60
33
  readonly clientId: string;
61
- readonly input: readonly AgentMessagePart[];
34
+ readonly input: readonly CodexTurnInputPart[];
62
35
  /** Per-turn model override forwarded on `turn/start`. */
63
36
  readonly model?: string;
64
37
  /**
@@ -79,7 +52,7 @@ export interface CodexTurnInput {
79
52
  }
80
53
  /** Input to {@link CodexSession.steerTurn} (`turn/steer`). */
81
54
  export interface CodexSteerTurnInput {
82
- readonly input: readonly AgentMessagePart[];
55
+ readonly input: readonly CodexTurnInputPart[];
83
56
  readonly clientId?: string;
84
57
  /** Optional guard asserting which active Codex turn id is being steered. */
85
58
  readonly expectedTurnId?: string;
@@ -90,6 +63,31 @@ export interface CodexForkThreadOptions extends CodexThreadPolicyOverrides {
90
63
  readonly beforeTurnId?: string;
91
64
  readonly lastTurnId?: string;
92
65
  readonly excludeTurns?: boolean;
66
+ /** Carry the source thread's goal into the fork without starting automatic continuation. */
67
+ readonly deferGoalContinuation?: boolean;
68
+ }
69
+ /** Options to open a new {@link CodexSession} directly via `thread/fork` instead of `thread/start`. */
70
+ export interface CodexOpenForkOptions extends CodexThreadPolicyOverrides {
71
+ /** Existing thread id to fork from. */
72
+ readonly threadId: string;
73
+ readonly beforeTurnId?: string;
74
+ readonly lastTurnId?: string;
75
+ /** Defaults to `true` when omitted so large threads do not inline full history into the fork reply. */
76
+ readonly excludeTurns?: boolean;
77
+ /** Carry the source thread's goal into the fork without starting automatic continuation. */
78
+ readonly deferGoalContinuation?: boolean;
79
+ }
80
+ /** Input to {@link CodexDriver.open}, extending {@link AgentEngineDriver.open} with `forkFrom`. */
81
+ export interface CodexOpenInput {
82
+ readonly profile: ExecutorProfileConfig;
83
+ readonly cwd: string;
84
+ /** Resume this native thread via `thread/resume` (mutually exclusive with `forkFrom`). */
85
+ readonly nativeThreadId?: string;
86
+ /** Open the session by forking an existing thread via `thread/fork` (mutually exclusive with `nativeThreadId`). */
87
+ readonly forkFrom?: CodexOpenForkOptions;
88
+ /** Optional observer invoked with startup phases (`spawning`, `initializing`, `verifying`) during open. */
89
+ readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
90
+ readonly signal?: AbortSignal;
93
91
  }
94
92
  /** Result returned by {@link CodexSession.forkThread} without mutating the current session. */
95
93
  export interface CodexForkedThread {
@@ -100,10 +98,52 @@ export interface CodexForkedThread {
100
98
  export interface CodexSession extends AgentEngineSession, CodexControlClient {
101
99
  /** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
102
100
  readonly providerPid: number | undefined;
103
- /** Applied thread settings reported by `thread/start` or `thread/resume`. */
101
+ /** Applied thread settings reported by `thread/start`, `thread/resume`, or `thread/fork`. */
104
102
  readonly threadContext: CodexThreadContext;
105
- /** Start a turn with optional per-turn Codex overrides. */
103
+ /** Start a turn with optional per-turn Codex overrides and `skill` items. */
106
104
  startTurn(input: CodexTurnInput): Promise<AgentEngineTurn>;
105
+ /** Answer a pending request from either the active turn or an external/TUI server request. */
106
+ respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
107
+ /** Read thread metadata (`thread/read`); defaults `threadId` to this session's `nativeThreadId`. */
108
+ readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
109
+ readonly threadId?: string;
110
+ }): Promise<JsonRpcValue>;
111
+ /** List turns (`thread/turns/list`); defaults `threadId` to this session's `nativeThreadId`. */
112
+ listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
113
+ readonly threadId?: string;
114
+ }): Promise<JsonRpcValue>;
115
+ /** List items (`thread/items/list`); defaults `threadId` to this session's `nativeThreadId`. */
116
+ listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
117
+ readonly threadId?: string;
118
+ }): Promise<JsonRpcValue>;
119
+ /** Revert thread durable history before `beforeTurnId` (`thread/revert`); defaults `threadId` to `nativeThreadId`. */
120
+ revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
121
+ readonly threadId?: string;
122
+ }): Promise<CodexRevertThreadResult>;
123
+ /** Inject raw Responses API items (`thread/inject_items`); defaults `threadId` to `nativeThreadId`. */
124
+ injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
125
+ readonly threadId?: string;
126
+ }): Promise<JsonRpcValue>;
127
+ /** Unsubscribe this connection (`thread/unsubscribe`); defaults `threadId` to `nativeThreadId`. */
128
+ unsubscribeThread(params?: {
129
+ readonly threadId?: string;
130
+ }): Promise<JsonRpcValue>;
131
+ /** Archive a thread (`thread/archive`); defaults `threadId` to `nativeThreadId`. */
132
+ archiveThread(params?: {
133
+ readonly threadId?: string;
134
+ }): Promise<JsonRpcValue>;
135
+ /** Unarchive a thread (`thread/unarchive`); defaults `threadId` to `nativeThreadId`. */
136
+ unarchiveThread(params?: {
137
+ readonly threadId?: string;
138
+ }): Promise<JsonRpcValue>;
139
+ /** Patch thread metadata (`thread/metadata/update`); defaults `threadId` to `nativeThreadId`. */
140
+ updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
141
+ readonly threadId?: string;
142
+ }): Promise<JsonRpcValue>;
143
+ /** Set thread display name (`thread/name/set`); defaults `threadId` to `nativeThreadId`. */
144
+ setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
145
+ readonly threadId?: string;
146
+ }): Promise<JsonRpcValue>;
107
147
  /** Steer the currently running turn with additional input (`turn/steer`). */
108
148
  steerTurn(input: CodexSteerTurnInput): Promise<{
109
149
  readonly turnId: string;
@@ -113,15 +153,20 @@ export interface CodexSession extends AgentEngineSession, CodexControlClient {
113
153
  /** Request context compaction for the current thread (`thread/compact/start`). */
114
154
  compactThread(): Promise<void>;
115
155
  }
116
- /** Codex driver returned by {@link createCodexDriver}; `open()` resolves to a {@link CodexSession}. */
156
+ /** Codex driver returned by {@link createCodexDriver}; `open()` resolves to {@link CodexSession} and `connectControl()` opens a threadless control link. */
117
157
  export interface CodexDriver extends AgentEngineDriver {
118
158
  readonly engine: 'codex';
119
159
  readonly reconcile: 'client-id';
160
+ readonly capabilities: ExecutorDriverCapabilities;
120
161
  findInput: NonNullable<AgentEngineDriver['findInput']>;
121
- open(input: Parameters<AgentEngineDriver['open']>[0]): Promise<CodexSession>;
162
+ open(input: CodexOpenInput): Promise<CodexSession>;
163
+ /** Connect to `codex app-server` without starting, resuming, or forking a thread. */
164
+ connectControl(input: CodexControlConnectInput): Promise<CodexControlConnection>;
165
+ /** Open a shared headless `stdio` `codex app-server` multiplexing multiple threads (ADR 0329). */
166
+ openSharedServer(input: CodexSharedServerOpenInput): Promise<CodexSharedServer>;
122
167
  }
123
- /** Encode validated host-inlined text and image parts into Codex app-server wire input items. */
124
- export declare function codexTurnInput(parts: readonly InlinedPart[]): JsonRpcValue[];
168
+ /** Validate `beforeTurnId` and `lastTurnId` mutual exclusion for `thread/fork`. */
169
+ export declare function validateCodexForkBounds(options: Pick<CodexForkThreadOptions, 'beforeTurnId' | 'lastTurnId'>, caller: string): void;
125
170
  /** Validate `runtimeWorkspaceRoots` and `config` policy overrides before sending them to Codex. */
126
171
  export declare function validateCodexPolicyOverrides(overrides: Pick<CodexThreadPolicyOverrides, 'runtimeWorkspaceRoots' | 'config'>, caller: string): void;
127
172
  /** Build JSON-RPC params for `thread/start`, `thread/resume`, or `thread/fork` from merged policy fields. */
@@ -129,12 +174,7 @@ export declare function buildCodexThreadPolicyParams(base: CodexThreadPolicyOver
129
174
  /** Validate per-turn overrides eagerly before host image files are read. */
130
175
  export declare function validateCodexTurnStartOverrides(turnInput: CodexTurnInput, activeModelProvider: string | undefined): void;
131
176
  /** Build validated `turn/start` RPC parameters from turn input and inlined parts. */
132
- export declare function buildCodexTurnStartParams(threadId: string, turnInput: CodexTurnInput, parts: readonly InlinedPart[], activeModelProvider: string | undefined): Record<string, JsonRpcValue>;
133
- /** Create the read/inspection control facade backed by an active Codex JSON-RPC peer. */
134
- export declare function createCodexControlClient(input: {
135
- peer: JsonRpcPeer;
136
- ensureAlive(): void;
137
- }): CodexControlClient;
177
+ export declare function buildCodexTurnStartParams(threadId: string, turnInput: CodexTurnInput, parts: readonly InlinedCodexPart[], activeModelProvider: string | undefined): Record<string, JsonRpcValue>;
138
178
  /** Create thread/turn control methods (`steerTurn`, `forkThread`, `compactThread`) for a live Codex session. */
139
179
  export declare function createCodexSessionMutators(input: {
140
180
  peer: JsonRpcPeer;
@@ -1 +1 @@
1
- {"version":3,"file":"session-controls.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/session-controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAe,MAAM,gBAAgB,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAE3B,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EAGxB,MAAM,YAAY,CAA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AAC;CACrB,GAAG,kBAAkB,CA+CrB;AAED,gHAAgH;AAChH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,IAAI,IAAI,CAAC;IACpB,aAAa,IAAI;QAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAChE;IAES,SAAS,aAAa,mBAAmB,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAuChF,UAAU,WAAU,sBAAsB,GAAQ,OAAO,CAAC,iBAAiB,CAAC;IAkB5E,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;EAKvC"}
1
+ {"version":3,"file":"session-controls.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/session-controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KA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
2
  import type { PlanLimits } from '../hello.js';
2
3
  import { type DriverImageOptions } from '../image-input.js';
3
- import { type JsonRpcValue } from '../json-rpc-peer.js';
4
- import { type ExecutorProfileConfig } from '../profile.js';
4
+ import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
5
5
  import { type CodexConnectConfig } from './connect.js';
6
+ import { type CodexControlClient, type CodexControlConnectInput, type CodexControlConnection } from './control-client.js';
7
+ import { type CodexNotificationEvent, type CodexServerRequestEvent } from './handlers.js';
6
8
  import { type CodexThreadContext } from './protocol.js';
7
- import { type CodexControlClient, type CodexSession, type CodexThreadPolicyOverrides } from './session-controls.js';
9
+ import { type CodexTurnSlot } from './request-answers.js';
10
+ import { type CodexOpenForkOptions, type CodexOpenInput, type CodexSession, type CodexThreadPolicyOverrides, type CodexTurnInput } from './session-controls.js';
8
11
  export interface CodexSessionConfig extends DriverImageOptions, CodexConnectConfig {
9
12
  readonly model?: string;
10
13
  readonly modelProvider?: string;
@@ -17,23 +20,42 @@ export interface CodexSessionConfig extends DriverImageOptions, CodexConnectConf
17
20
  readonly controls: CodexControlClient;
18
21
  readonly cwd: string;
19
22
  readonly nativeThreadId?: string;
23
+ readonly forkFrom?: CodexOpenForkOptions;
20
24
  }) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined;
21
25
  readonly verifyThread?: (context: {
22
26
  readonly nativeThreadId: string;
23
27
  readonly threadContext: CodexThreadContext;
24
28
  readonly controls: CodexControlClient;
25
29
  }) => Promise<void> | void;
30
+ readonly onNotification?: (event: CodexNotificationEvent) => void;
31
+ readonly onServerRequest?: (event: CodexServerRequestEvent) => void;
32
+ readonly onDisconnect?: (error: Error) => void;
26
33
  readonly limits: Map<string, PlanLimits>;
27
34
  }
35
+ export declare function createCodexStartTurn(input: {
36
+ config: CodexSessionConfig;
37
+ peer: JsonRpcPeer;
38
+ threadId: string;
39
+ activeModelProvider: string | undefined;
40
+ signal: AbortSignal;
41
+ ensureAlive(): void;
42
+ getTurn(): CodexTurnSlot | undefined;
43
+ setTurn(turn: CodexTurnSlot | undefined): void;
44
+ }): (turnInput: CodexTurnInput) => Promise<AgentEngineTurn>;
45
+ export declare function validateCodexOpenInput(input: CodexOpenInput): void;
46
+ export declare function mergeOpenThreadPolicy(config: CodexSessionConfig, forkFrom: CodexOpenForkOptions | undefined, dynamicOverrides: CodexThreadPolicyOverrides | undefined): Record<string, JsonRpcValue>;
47
+ /** Dispatch `thread/fork`, `thread/resume`, or `thread/start` with merged policy overrides. */
48
+ export declare function openCodexThreadRpc(peer: JsonRpcPeer, config: CodexSessionConfig, input: {
49
+ readonly cwd: string;
50
+ readonly nativeThreadId?: string;
51
+ readonly forkFrom?: CodexOpenForkOptions;
52
+ }, dynamicOverrides: CodexThreadPolicyOverrides | undefined): Promise<JsonRpcValue>;
28
53
  /**
29
- * One app-server connection holding one thread. Server requests the driver knows
30
- * become `request` deltas answered by `respond`; any other is refused at once with
31
- * `-32601`, so no unanswered request hangs a turn.
54
+ * One app-server connection holding one thread. Server requests during `startTurn()` become
55
+ * `request` deltas answered by `respond`; external/TUI requests route through `onServerRequest`
56
+ * when configured, and unknown methods are refused `-32601`.
32
57
  */
33
- export declare function openCodexSession(config: CodexSessionConfig, input: {
34
- profile: ExecutorProfileConfig;
35
- cwd: string;
36
- nativeThreadId?: string;
37
- signal?: AbortSignal;
38
- }): Promise<CodexSession>;
58
+ export declare function openCodexSession(config: CodexSessionConfig, input: CodexOpenInput): Promise<CodexSession>;
59
+ /** Open a threadless app-server connection (no `thread/start`) for metadata reads or external observation. */
60
+ export declare function openCodexControlConnection(config: CodexSessionConfig, input: CodexControlConnectInput): Promise<CodexControlConnection>;
39
61
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/session.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,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SAAS,GACvD,OAAO,CAAC,YAAY,CAAC,CA0BvB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,YAAY,CAAC,CAuJvB;AAED,8GAA8G;AAC9G,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CA0EjC"}
@@ -0,0 +1,29 @@
1
+ import type { ExecutorDriverCapabilities } from '../hello.js';
2
+ import { type ExecutorProfileConfig } from '../profile.js';
3
+ import type { ExecutorStartupPhase } from '../vocabulary.js';
4
+ import { type CodexControlClient } from './control-client.js';
5
+ import type { CodexSessionConfig } from './session.js';
6
+ import type { CodexSession } from './session-controls.js';
7
+ import { type CodexSharedServerThreadInput } from './shared-thread.js';
8
+ /** Input to {@link CodexDriver.openSharedServer} for a headless multi-thread `codex app-server`. */
9
+ export interface CodexSharedServerOpenInput {
10
+ readonly profile: ExecutorProfileConfig;
11
+ readonly cwd: string;
12
+ /** Maximum concurrent open threads multiplexed on this shared server (`1..256`). Default `32`. */
13
+ readonly maxThreads?: number;
14
+ /** Optional observer invoked with startup phases (`spawning`, `initializing`) during server startup. */
15
+ readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
16
+ readonly signal?: AbortSignal;
17
+ }
18
+ /** Shared headless `codex app-server` multiplexing up to `maxThreads` independent {@link CodexSession}s. */
19
+ export interface CodexSharedServer extends CodexControlClient {
20
+ readonly providerPid: number | undefined;
21
+ readonly maxThreads: number;
22
+ readonly activeThreadCount: number;
23
+ readonly capabilities: ExecutorDriverCapabilities;
24
+ openThread(input: CodexSharedServerThreadInput): Promise<CodexSession>;
25
+ close(): Promise<void>;
26
+ }
27
+ /** Open a single `stdio` `codex app-server` multiplexing up to `maxThreads` independent sessions. */
28
+ export declare function openCodexSharedServer(config: CodexSessionConfig, baseCapabilities: ExecutorDriverCapabilities, input: CodexSharedServerOpenInput): Promise<CodexSharedServer>;
29
+ //# sourceMappingURL=shared-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-server.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/shared-server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,KAAK,qBAAqB,EAAiB,MAAM,YAAY,CAAC;AAEvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,kBAAkB,CAAC;AAGrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,KAAK,4BAA4B,EAIlC,MAAM,iBAAiB,CAAC;AAKzB,oGAAoG;AACpG,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kGAAkG;IAClG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wGAAwG;IACxG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,4GAA4G;AAC5G,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAC;IAClD,UAAU,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA6CD,qGAAqG;AACrG,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,kBAAkB,EAC1B,gBAAgB,EAAE,0BAA0B,EAC5C,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,iBAAiB,CAAC,CAgI5B"}
@@ -0,0 +1,46 @@
1
+ import type { JsonRpcPeer } from '../json-rpc-peer.js';
2
+ import type { ExecutorProfileConfig } from '../profile.js';
3
+ import type { ExecutorStartupPhase } from '../vocabulary.js';
4
+ import { type CodexControlClient } from './control-client.js';
5
+ import { createCodexHandlers } from './handlers.js';
6
+ import { type CodexTurnSlot, type PendingExternalCodexRequest } from './request-answers.js';
7
+ import { type CodexSessionConfig } from './session.js';
8
+ import { type CodexOpenForkOptions, type CodexSession } from './session-controls.js';
9
+ /** Input to {@link CodexSharedServer.openThread} for opening one thread over a shared server. */
10
+ export interface CodexSharedServerThreadInput {
11
+ readonly cwd: string;
12
+ /** Resume this native thread via `thread/resume` (mutually exclusive with `forkFrom`). */
13
+ readonly nativeThreadId?: string;
14
+ /** Open the thread by forking an existing thread via `thread/fork` (mutually exclusive with `nativeThreadId`). */
15
+ readonly forkFrom?: CodexOpenForkOptions;
16
+ /** Optional observer invoked with startup phases (`verifying`) during thread open. */
17
+ readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
18
+ readonly signal?: AbortSignal;
19
+ }
20
+ export interface SharedThreadSlot {
21
+ readonly threadId: string;
22
+ current: CodexTurnSlot | undefined;
23
+ readonly externalPending: Map<string, PendingExternalCodexRequest>;
24
+ readonly handlers: ReturnType<typeof createCodexHandlers>;
25
+ closed: boolean;
26
+ dead: Error | undefined;
27
+ readonly abortThread: () => void;
28
+ readonly releaseThreadSignal: () => void;
29
+ }
30
+ export interface SharedServerState {
31
+ readonly config: CodexSessionConfig;
32
+ readonly profile: ExecutorProfileConfig;
33
+ readonly peer: JsonRpcPeer;
34
+ readonly providerPid: number | undefined;
35
+ readonly maxThreads: number;
36
+ readonly controlClient: CodexControlClient;
37
+ readonly serverSignal: AbortSignal;
38
+ readonly threads: Map<string, SharedThreadSlot>;
39
+ readonly openingNativeThreadIds: Set<string>;
40
+ openingThreads: number;
41
+ readonly isServerClosing: () => boolean;
42
+ readonly getServerDead: () => Error | undefined;
43
+ readonly ensureServerAlive: () => void;
44
+ }
45
+ export declare function openSharedCodexThread(state: SharedServerState, threadInput: CodexSharedServerThreadInput): Promise<CodexSession>;
46
+ //# sourceMappingURL=shared-thread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-thread.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/shared-thread.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAMjD,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAGlB,MAAM,oBAAoB,CAAC;AAI5B,iGAAiG;AACjG,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,kHAAkH;IAClH,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IACzC,sFAAsF;IACtF,QAAQ,CAAC,cAAc,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I,CAAC;CACxC;AA4GD,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,iBAAiB,EACxB,WAAW,EAAE,4BAA4B,GACxC,OAAO,CAAC,YAAY,CAAC,CAoJvB"}
@@ -0,0 +1,128 @@
1
+ import type { JsonRpcValue } from '../json-rpc-peer.js';
2
+ /** Thread identifier target shared by single-thread Codex RPCs (`thread/unsubscribe`, `thread/archive`, `thread/unarchive`). */
3
+ export interface CodexThreadIdParams {
4
+ /** Thread identifier to target. */
5
+ readonly threadId: string;
6
+ }
7
+ /** Parameters for Codex `thread/revert`. */
8
+ export interface CodexRevertThreadParams {
9
+ /** Thread identifier whose durable history will be reverted. */
10
+ readonly threadId: string;
11
+ /** Turn excluded from the replacement history, together with every later turn. */
12
+ readonly beforeTurnId: string;
13
+ }
14
+ /** Result returned by Codex `thread/revert`. */
15
+ export interface CodexRevertThreadResult {
16
+ /** Updated loaded thread metadata (`turns` is empty; hydrate via `thread/turns/list`). */
17
+ readonly thread: JsonRpcValue;
18
+ /** Opaque cursor for hydrating retained turns backwards, or `null` when absent. */
19
+ readonly turnsBackwardsCursor: string | null;
20
+ /** Opaque cursor for hydrating retained items backwards, or `null` when absent. */
21
+ readonly itemsBackwardsCursor: string | null;
22
+ }
23
+ /** Parameters for Codex `thread/inject_items`. */
24
+ export interface CodexInjectItemsParams {
25
+ /** Thread identifier to append Responses API items into. */
26
+ readonly threadId: string;
27
+ /** Raw Responses API items to append to the thread's model-visible history. */
28
+ readonly items: readonly JsonRpcValue[];
29
+ }
30
+ /** Sort key accepted by Codex `thread/list`. */
31
+ export type CodexThreadSortKey = 'created_at' | 'updated_at' | 'recency_at' | 'section_position';
32
+ /** Thread source kind filter accepted by Codex `thread/list`. */
33
+ export type CodexThreadSourceKind = 'cli' | 'vscode' | 'exec' | 'appServer' | 'subAgent' | 'subAgentReview' | 'subAgentCompact' | 'subAgentThreadSpawn' | 'subAgentOther' | 'unknown';
34
+ /** Parameters for Codex `thread/list`. */
35
+ export interface CodexListThreadsParams {
36
+ /** Opaque pagination cursor returned by a previous call. */
37
+ readonly cursor?: string | null;
38
+ /** Optional page size (`uint32`). */
39
+ readonly limit?: number | null;
40
+ /** Optional sort key (`created_at`, `updated_at`, `recency_at`, or `section_position`). */
41
+ readonly sortKey?: CodexThreadSortKey | null;
42
+ /** Optional sort direction (`asc` or `desc`). */
43
+ readonly sortDirection?: 'asc' | 'desc' | null;
44
+ /** Optional provider allowlist filter. */
45
+ readonly modelProviders?: readonly string[] | null;
46
+ /** Optional source kind filter. */
47
+ readonly sourceKinds?: readonly CodexThreadSourceKind[] | null;
48
+ /** Optional archived filter (`true` for archived only; `false`/`null` for non-archived). */
49
+ readonly archived?: boolean | null;
50
+ /** Optional exact working directory filter (one path or list of paths). */
51
+ readonly cwd?: string | readonly string[] | null;
52
+ /** Optional substring filter for the extracted thread title. */
53
+ readonly searchTerm?: string | null;
54
+ /** Section filter: omit for all sections, `null` for unsectioned, or a section id string. */
55
+ readonly sectionId?: string | null;
56
+ /** Restrict results to up to 100 thread IDs before pagination. */
57
+ readonly includedThreadIds?: readonly string[] | null;
58
+ /** Exclude up to 100 thread IDs before applying the page limit. */
59
+ readonly excludedThreadIds?: readonly string[] | null;
60
+ /** Optional originator allowlist (hosted backends only). */
61
+ readonly originators?: readonly string[] | null;
62
+ /** Show local history visible to the current ChatGPT account. */
63
+ readonly currentAccountOnly?: boolean;
64
+ /** Return indexed local state-DB metadata without scanning JSONL rollouts. */
65
+ readonly useStateDbOnly?: boolean;
66
+ }
67
+ /** Parameters for Codex `thread/loaded/list`. */
68
+ export interface CodexListLoadedThreadsParams {
69
+ /** Opaque pagination cursor returned by a previous call. */
70
+ readonly cursor?: string | null;
71
+ /** Optional page size (`uint32`). */
72
+ readonly limit?: number | null;
73
+ }
74
+ /** Git metadata patch accepted by Codex `thread/metadata/update`. */
75
+ export interface CodexThreadGitInfoUpdate {
76
+ /** Omit to leave unchanged, `null` to clear, or a non-empty string to replace. */
77
+ readonly branch?: string | null;
78
+ /** Omit to leave unchanged, `null` to clear, or a non-empty string to replace. */
79
+ readonly originUrl?: string | null;
80
+ /** Omit to leave unchanged, `null` to clear, or a non-empty string to replace. */
81
+ readonly sha?: string | null;
82
+ }
83
+ /** Parameters for Codex `thread/metadata/update`. */
84
+ export interface CodexUpdateThreadMetadataParams {
85
+ /** Thread identifier whose stored metadata will be patched. */
86
+ readonly threadId: string;
87
+ /** Patch stored Git metadata for the thread. */
88
+ readonly gitInfo?: CodexThreadGitInfoUpdate | null;
89
+ }
90
+ /** Parameters for Codex `thread/name/set`. */
91
+ export interface CodexSetThreadNameParams {
92
+ /** Thread identifier to rename. */
93
+ readonly threadId: string;
94
+ /** Non-empty display name to assign to the thread. */
95
+ readonly name: string;
96
+ }
97
+ /** Thread lifecycle, history, and catalog RPCs verified in `codex-cli 0.171.0`. */
98
+ export interface CodexThreadControlMethods {
99
+ /** Revert a thread's durable history to before `beforeTurnId` (`thread/revert`). */
100
+ revertThread(params: CodexRevertThreadParams): Promise<CodexRevertThreadResult>;
101
+ /** Append raw Responses API items to a thread's model-visible history (`thread/inject_items`). */
102
+ injectItems(params: CodexInjectItemsParams): Promise<JsonRpcValue>;
103
+ /** Unsubscribe this connection from a thread (`thread/unsubscribe`). */
104
+ unsubscribeThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
105
+ /** List threads with pagination and bounded filters (`thread/list`). */
106
+ listThreads(params?: CodexListThreadsParams): Promise<JsonRpcValue>;
107
+ /** List thread identifiers currently loaded in memory (`thread/loaded/list`). */
108
+ listLoadedThreads(params?: CodexListLoadedThreadsParams): Promise<JsonRpcValue>;
109
+ /** Archive a thread (`thread/archive`). */
110
+ archiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
111
+ /** Unarchive a thread (`thread/unarchive`). */
112
+ unarchiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
113
+ /** Patch stored metadata (such as Git info) for a thread (`thread/metadata/update`). */
114
+ updateThreadMetadata(params: CodexUpdateThreadMetadataParams): Promise<JsonRpcValue>;
115
+ /** Set a thread's display name (`thread/name/set`). */
116
+ setThreadName(params: CodexSetThreadNameParams): Promise<JsonRpcValue>;
117
+ }
118
+ /** Validate a required non-empty thread identifier. */
119
+ export declare function assertNonEmptyThreadId(threadId: unknown, caller: string): string;
120
+ /** Validate a required non-empty string parameter. */
121
+ export declare function assertRequiredNonEmptyString(value: unknown, field: string, caller: string): string;
122
+ /** Validate an optional non-empty string parameter. */
123
+ export declare function assertOptionalNonEmptyString(value: string | undefined, field: string, caller: string): void;
124
+ /** Validate an optional or nullable `uint32` page limit. */
125
+ export declare function assertOptionalLimit(limit: number | null | undefined, caller: string): void;
126
+ /** Build the 9 verified `0.171.0` thread lifecycle, revert, injection, and catalog RPC methods. */
127
+ export declare function createCodexThreadControlMethods(call: (method: string, params?: Record<string, JsonRpcValue>) => Promise<JsonRpcValue>): CodexThreadControlMethods;
128
+ //# sourceMappingURL=thread-controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-controls.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/thread-controls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOrD,gIAAgI;AAChI,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kFAAkF;IAClF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,mFAAmF;IACnF,QAAQ,CAAC,o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AKR;AAED,uDAAuD;AACvD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,IAAI,CAKN;AAED,4DAA4D;AAC5D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAM1F;AA2GD,mGAAmG;AACnG,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,GACrF,yBAAyB,CAgF3B"}
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import type { AgentMessagePart } from '../../agent-parts/parts.js';
3
+ import { type DriverImageOptions, type InlinedPart } from '../image-input.js';
4
+ import type { JsonRpcValue } from '../json-rpc-peer.js';
5
+ /** Codex-native `skill` user input item forwarded verbatim in `turn/start` and `turn/steer`. */
6
+ export declare const CodexSkillInputSchema: z.ZodObject<{
7
+ type: z.ZodLiteral<"skill">;
8
+ name: z.ZodString;
9
+ path: z.ZodString;
10
+ }, z.core.$strict>;
11
+ /** Codex-native `skill` input item inferred from {@link CodexSkillInputSchema}. */
12
+ export type CodexSkillInput = z.infer<typeof CodexSkillInputSchema>;
13
+ /** Ordered input element accepted by {@link CodexSession.startTurn} and {@link CodexSession.steerTurn}. */
14
+ export type CodexTurnInputPart = AgentMessagePart | CodexSkillInput;
15
+ /** Validated, host-resolved Codex turn part ready for wire serialization. */
16
+ export type InlinedCodexPart = InlinedPart | CodexSkillInput;
17
+ /**
18
+ * Validate every Codex turn part synchronously before the first `resolveFile` call, then resolve
19
+ * image attachments in original order alongside text and `skill` items.
20
+ */
21
+ export declare function inlineCodexParts(parts: readonly CodexTurnInputPart[], options: DriverImageOptions & {
22
+ readonly driverLabel: string;
23
+ readonly signal?: AbortSignal;
24
+ }): Promise<InlinedCodexPart[]>;
25
+ /**
26
+ * Encode validated Codex turn parts into app-server `UserInput[]` items: plain text joins into
27
+ * one text item (preserving wire compatibility), while inputs with images or skills keep exact order.
28
+ */
29
+ export declare function codexTurnInput(parts: readonly InlinedCodexPart[]): JsonRpcValue[];
30
+ //# sourceMappingURL=turn-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-input.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/turn-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAsB,MAAM,gBAAgB,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,gGAAgG;AAChG,eAAO,MAAM,qBAAqB;;;;kBAIhC,CAAC;AAEH,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,2GAA2G;AAC3G,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEpE,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,eAAe,CAAC;AAa7D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,OAAO,EAAE,kBAAkB,GAAG;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B,GACA,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAM7B;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG,YAAY,EAAE,CAiBjF"}