stitchkit 0.128.0 → 0.129.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 (162) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/agent-executor/claude/transcript.d.ts +2 -2
  3. package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
  4. package/dist/agent-executor/claude-sdk/controls.d.ts +19 -0
  5. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -0
  6. package/dist/agent-executor/claude-sdk/driver.d.ts +114 -4
  7. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  8. package/dist/agent-executor/claude-sdk/query-loop.d.ts +46 -0
  9. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -0
  10. package/dist/agent-executor/claude-sdk/query-options.d.ts +27 -0
  11. package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -0
  12. package/dist/agent-executor/claude-sdk/session.d.ts +6 -5
  13. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  14. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  15. package/dist/agent-executor/codex/connect.d.ts +45 -0
  16. package/dist/agent-executor/codex/connect.d.ts.map +1 -0
  17. package/dist/agent-executor/codex/driver.d.ts +51 -10
  18. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  19. package/dist/agent-executor/codex/limits.d.ts +11 -2
  20. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  21. package/dist/agent-executor/codex/protocol.d.ts +49 -4
  22. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  23. package/dist/agent-executor/codex/session-controls.d.ts +155 -0
  24. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -0
  25. package/dist/agent-executor/codex/session.d.ts +27 -31
  26. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  27. package/dist/agent-executor/codex/unix-socket-target.d.ts +26 -0
  28. package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -0
  29. package/dist/agent-executor/codex/unix-socket.d.ts +26 -0
  30. package/dist/agent-executor/codex/unix-socket.d.ts.map +1 -0
  31. package/dist/agent-executor/codex/ws-frame.d.ts +15 -0
  32. package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -0
  33. package/dist/agent-executor/contract.d.ts +2 -0
  34. package/dist/agent-executor/contract.d.ts.map +1 -1
  35. package/dist/agent-executor/engine-process.d.ts +9 -0
  36. package/dist/agent-executor/engine-process.d.ts.map +1 -1
  37. package/dist/agent-executor/hello.d.ts +8 -0
  38. package/dist/agent-executor/hello.d.ts.map +1 -1
  39. package/dist/agent-runtime/branch-observations.d.ts +5 -5
  40. package/dist/agent-runtime/branch-provider.d.ts +2 -2
  41. package/dist/agent-runtime/sql-rows.d.ts +10 -10
  42. package/dist/agent-runtime/terminal-commit.d.ts +10 -10
  43. package/dist/entrypoints/agent-executor/acp.js +7 -7
  44. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +1 -1
  45. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  46. package/dist/entrypoints/agent-executor/claude-sdk.js +532 -101
  47. package/dist/entrypoints/agent-executor/claude.js +8 -8
  48. package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
  49. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  50. package/dist/entrypoints/agent-executor/codex.js +1491 -228
  51. package/dist/entrypoints/agent-executor.js +7 -7
  52. package/dist/entrypoints/agent-runtime/browser.js +1 -1
  53. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  54. package/dist/entrypoints/agent-runtime/harness.js +8 -8
  55. package/dist/entrypoints/agent-runtime/openrouter.js +2 -2
  56. package/dist/entrypoints/agent-runtime/postgres.js +6 -6
  57. package/dist/entrypoints/agent-runtime/realtime.js +4 -4
  58. package/dist/entrypoints/agent-runtime/sandbox.js +5 -5
  59. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  60. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  61. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  62. package/dist/entrypoints/agent-runtime.js +17 -17
  63. package/dist/entrypoints/application/directory-inbox.js +2 -2
  64. package/dist/entrypoints/application/opentelemetry.js +2 -2
  65. package/dist/entrypoints/application.js +2 -2
  66. package/dist/entrypoints/cli/publish.js +3 -3
  67. package/dist/entrypoints/cli.js +8 -8
  68. package/dist/entrypoints/contract.js +2 -2
  69. package/dist/entrypoints/files/packaging.js +2 -2
  70. package/dist/entrypoints/files.js +7 -7
  71. package/dist/entrypoints/handler.js +4 -4
  72. package/dist/entrypoints/http.js +5 -5
  73. package/dist/entrypoints/index.js +7 -7
  74. package/dist/entrypoints/node.js +5 -5
  75. package/dist/entrypoints/observability.js +4 -4
  76. package/dist/entrypoints/primitives.js +2 -2
  77. package/dist/entrypoints/process.js +5 -5
  78. package/dist/entrypoints/react.js +1 -1
  79. package/dist/entrypoints/remote.js +2 -2
  80. package/dist/entrypoints/server.js +6 -6
  81. package/dist/entrypoints/service-host/macos.js +5 -5
  82. package/dist/entrypoints/service-host.js +7 -7
  83. package/dist/entrypoints/spend.js +1 -1
  84. package/dist/entrypoints/sync/postgres.js +1 -1
  85. package/dist/entrypoints/sync.js +2 -2
  86. package/dist/entrypoints/telegram.js +2 -2
  87. package/dist/entrypoints/testing.js +5 -5
  88. package/dist/entrypoints/tools/agent.js +5 -5
  89. package/dist/entrypoints/tools/connections.js +2 -2
  90. package/dist/entrypoints/tools/invoker.js +4 -4
  91. package/dist/entrypoints/tools/mcp.js +5 -5
  92. package/dist/entrypoints/tools/toolkit.js +8 -8
  93. package/dist/entrypoints/tools.js +12 -12
  94. package/dist/entrypoints/tracking/contract.js +1 -1
  95. package/dist/entrypoints/xlsx.js +1 -1
  96. package/dist/{index-prf6ayhf.js → index-13wmzpa6.js} +1 -1
  97. package/dist/{index-n7f89hjw.js → index-17qgm6xe.js} +3 -3
  98. package/dist/{index-wv8dqy7q.js → index-205456mf.js} +1 -1
  99. package/dist/{index-pwskmywy.js → index-21cfxc4z.js} +1 -1
  100. package/dist/{index-d4svrknj.js → index-39c2hj6h.js} +2 -2
  101. package/dist/{index-sfzfd2m2.js → index-39rmc00v.js} +1 -1
  102. package/dist/{index-ky3ardqn.js → index-3fym4j8n.js} +1 -1
  103. package/dist/{index-c5gp2gh6.js → index-5tdc0q43.js} +1 -1
  104. package/dist/{index-3ypvpkwr.js → index-669374qc.js} +1 -1
  105. package/dist/{index-m18xm96h.js → index-7jqn3b3g.js} +4 -4
  106. package/dist/{index-5jyjb4s0.js → index-80acsm27.js} +1 -1
  107. package/dist/{index-xmr47znh.js → index-827bgv33.js} +1 -1
  108. package/dist/{index-v1mxss62.js → index-93n6jwy0.js} +3 -3
  109. package/dist/{index-d54npte7.js → index-9kpxz49v.js} +2 -2
  110. package/dist/{index-xv9jb84s.js → index-9sfhje6y.js} +3 -3
  111. package/dist/{index-bh4pmtr9.js → index-afb6z77w.js} +3 -1
  112. package/dist/{index-9y0afd5f.js → index-apf5g7y9.js} +1 -1
  113. package/dist/{index-4qvyhn23.js → index-bjmj2q1z.js} +1 -1
  114. package/dist/{index-g3e57qj6.js → index-dcsxj68j.js} +2 -2
  115. package/dist/{index-waa6t4zx.js → index-dnzxxf8a.js} +1 -1
  116. package/dist/{index-gf92hc87.js → index-fgahdc7s.js} +2 -2
  117. package/dist/{index-kzavdze2.js → index-gr0kxymw.js} +5 -1
  118. package/dist/{index-e06z0tkb.js → index-gya4hwh3.js} +2 -2
  119. package/dist/{index-gzny6zsw.js → index-hab790s6.js} +5 -5
  120. package/dist/{index-bz3gn6cs.js → index-j0ef04jw.js} +2 -2
  121. package/dist/{index-rhb33thr.js → index-jcge9tx3.js} +1 -1
  122. package/dist/{index-pn5b11ce.js → index-mkfhpk11.js} +1 -1
  123. package/dist/{index-1qwrczr1.js → index-mttkdm5a.js} +1 -1
  124. package/dist/{index-rxnyygke.js → index-n3bm7zqq.js} +1 -1
  125. package/dist/{index-6wp4dn9d.js → index-p06z7g7w.js} +3 -3
  126. package/dist/{index-kt6dh1n6.js → index-p16q492v.js} +1 -1
  127. package/dist/{index-t7wa7k12.js → index-pp97q86a.js} +1 -1
  128. package/dist/{index-39n02e0q.js → index-psye60qn.js} +1 -1
  129. package/dist/{index-5ptwb6ka.js → index-pzhqydxb.js} +1 -1
  130. package/dist/{index-7kfcb576.js → index-qa2jjb65.js} +1 -1
  131. package/dist/{index-rzeezh79.js → index-qhjmmsm2.js} +2 -2
  132. package/dist/{index-7grgs8cx.js → index-qpzyahe3.js} +2 -2
  133. package/dist/{index-jfecdk1e.js → index-r97ppg0g.js} +2 -2
  134. package/dist/{index-bmaz3jzy.js → index-rjs94dny.js} +1 -1
  135. package/dist/{index-5v5vg85s.js → index-rxh3qy4x.js} +32 -5
  136. package/dist/{index-en8e5zsj.js → index-ryxb427v.js} +1 -1
  137. package/dist/{index-y065r8g5.js → index-sd4e5x5j.js} +7 -7
  138. package/dist/{index-g56ht6qf.js → index-t3qcac2a.js} +1 -1
  139. package/dist/{index-13dnv6d0.js → index-wv2amqm4.js} +4 -4
  140. package/dist/{index-4j8efqr3.js → index-x2fb37t0.js} +2 -2
  141. package/dist/{index-0gqs8ght.js → index-y71zn1gw.js} +32 -4
  142. package/dist/{index-wavv538x.js → index-ybdq8kk2.js} +3 -3
  143. package/dist/{index-4gk6k3zc.js → index-ycr4pk0z.js} +1 -1
  144. package/dist/{index-0tyt97nk.js → index-yrr3n391.js} +1 -1
  145. package/dist/{index-v37b2cd6.js → index-z20pdxeb.js} +2 -2
  146. package/dist/{index-8x22nprv.js → index-z9d74jmb.js} +3 -3
  147. package/dist/{index-3tnwtz38.js → index-zhshhxew.js} +1 -1
  148. package/dist/{index-hj1zq7mh.js → index-znd1b57f.js} +3 -3
  149. package/dist/internal/positive-integer.d.ts +2 -0
  150. package/dist/internal/positive-integer.d.ts.map +1 -1
  151. package/dist/internal/unix-socket.d.ts +7 -0
  152. package/dist/internal/unix-socket.d.ts.map +1 -1
  153. package/llms/agent-executor-claude-sdk.txt +13 -10
  154. package/llms/agent-executor-claude.txt +1 -1
  155. package/llms/agent-executor-codex.txt +9 -3
  156. package/llms/agent-executor.txt +2 -2
  157. package/llms/stitchkit.txt +74 -74
  158. package/llms/{upgrading-0.128.0.txt → upgrading-0.128.0-0.129.0.txt} +31 -3
  159. package/llms/upgrading.txt +1 -1
  160. package/llms-full.txt +127 -90
  161. package/llms.txt +6 -6
  162. package/package.json +1 -1
@@ -1,10 +1,30 @@
1
1
  import { z } from 'zod';
2
+ import type { JsonRpcValue } from '../json-rpc-peer.js';
2
3
  /**
3
- * The slice of Codex's app-server protocol (0.162.1, JSON-RPC over stdio
4
- * without the `jsonrpc` header) the driver reads. Every schema lets fields
5
- * it does not use through; a test checks each against the JSON Schema the
6
- * pinned CLI generates, so a renamed field fails there and not in a turn.
4
+ * The slice of Codex's app-server protocol (0.171.0, JSON-RPC over stdio or
5
+ * WebSocket-over-Unix-socket without the `jsonrpc` header) the driver reads.
6
+ * Every schema lets fields it does not use through; a test checks each against
7
+ * the JSON Schema the pinned CLI generates, so a renamed field fails there and
8
+ * not in a turn.
7
9
  */
10
+ /** Approval policy values accepted by Codex `thread/start`, `thread/resume`, `thread/fork`, and `turn/start`. */
11
+ export type CodexApprovalPolicy = 'untrusted' | 'on-failure' | 'on-request' | 'never' | Readonly<Record<string, JsonRpcValue>>;
12
+ /** Sandbox mode values accepted by Codex `thread/start`, `thread/resume`, and `thread/fork`. */
13
+ export type CodexSandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
14
+ /** Collaboration mode settings passed on `turn/start`. */
15
+ export declare const CodexCollaborationModeSchema: z.ZodObject<{
16
+ mode: z.ZodEnum<{
17
+ default: "default";
18
+ plan: "plan";
19
+ }>;
20
+ settings: z.ZodObject<{
21
+ model: z.ZodString;
22
+ reasoning_effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ developer_instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ }, z.core.$strict>;
25
+ }, z.core.$strict>;
26
+ /** Collaboration mode override accepted by Codex `turn/start`. */
27
+ export type CodexCollaborationMode = z.infer<typeof CodexCollaborationModeSchema>;
8
28
  export declare const CodexThreadItemSchema: z.ZodObject<{
9
29
  type: z.ZodString;
10
30
  id: z.ZodString;
@@ -85,6 +105,7 @@ export declare const CodexNotificationParams: {
85
105
  }, z.core.$loose>;
86
106
  readonly 'account/rateLimits/updated': z.ZodObject<{
87
107
  rateLimits: z.ZodJSONSchema;
108
+ rateLimitsByLimitId: z.ZodOptional<z.ZodJSONSchema>;
88
109
  }, z.core.$loose>;
89
110
  };
90
111
  export declare const CodexApprovalParamsSchema: z.ZodObject<{
@@ -104,16 +125,40 @@ export declare const CodexUserInputParamsSchema: z.ZodObject<{
104
125
  export declare const CodexUserInputAnswersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
105
126
  answers: z.ZodArray<z.ZodString>;
106
127
  }, z.core.$strict>>;
128
+ /** Applied thread policy and runtime context returned by `thread/start`, `thread/resume`, or `thread/fork`. */
129
+ export declare const CodexThreadContextSchema: z.ZodObject<{
130
+ model: z.ZodOptional<z.ZodString>;
131
+ modelProvider: z.ZodOptional<z.ZodString>;
132
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
133
+ approvalPolicy: z.ZodOptional<z.ZodJSONSchema>;
134
+ sandbox: z.ZodOptional<z.ZodJSONSchema>;
135
+ cwd: z.ZodOptional<z.ZodString>;
136
+ runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
137
+ }, z.core.$strip>;
138
+ /** Applied policy and model context reported by Codex when opening, resuming, or forking a thread. */
139
+ export type CodexThreadContext = Readonly<z.infer<typeof CodexThreadContextSchema>>;
107
140
  export declare const CodexStartedThreadSchema: z.ZodObject<{
141
+ model: z.ZodOptional<z.ZodString>;
142
+ modelProvider: z.ZodOptional<z.ZodString>;
143
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
144
+ approvalPolicy: z.ZodOptional<z.ZodJSONSchema>;
145
+ sandbox: z.ZodOptional<z.ZodJSONSchema>;
146
+ cwd: z.ZodOptional<z.ZodString>;
147
+ runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
108
148
  thread: z.ZodObject<{
109
149
  id: z.ZodString;
110
150
  }, z.core.$loose>;
111
151
  }, z.core.$loose>;
152
+ /** Extract the normalized applied thread context from a parsed `thread/start`, `thread/resume`, or `thread/fork` reply. */
153
+ export declare function extractCodexThreadContext(parsed: z.infer<typeof CodexStartedThreadSchema>): CodexThreadContext;
112
154
  export declare const CodexStartedTurnSchema: z.ZodObject<{
113
155
  turn: z.ZodObject<{
114
156
  id: z.ZodString;
115
157
  }, z.core.$loose>;
116
158
  }, z.core.$loose>;
159
+ export declare const CodexTurnSteerResponseSchema: z.ZodObject<{
160
+ turnId: z.ZodString;
161
+ }, z.core.$loose>;
117
162
  export declare const CodexListedTurnItemSchema: z.ZodObject<{
118
163
  type: z.ZodString;
119
164
  clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;iBAU1B,CAAC;AAEH,eAAO,MAAM,uBAAuB;aAClC,yBAAyB;;;;aACzB,0BAA0B;;;;aAC1B,iCAAiC;;;;aACjC,cAAc;;;;;;aACd,gBAAgB;;;;;;aAChB,gBAAgB;;;;;;;;;;;;;;;;;;;aAChB,2BAA2B;;;;;;;;;aAS3B,wBAAwB;;;aACxB,4BAA4B;;;CACpB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AAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,UAQzC,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,aAkBpC,CAAC;AAEH,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,aAGlC,CAAC;AACH,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAChE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;aAClC,OAAO,EAAE,QAAQ;aACjB,IAAI,EAAE,SAAS;aACf,WAAW,EAAE,QAAQ;CACb,CAAC"}
@@ -0,0 +1,155 @@
1
+ import type { AgentMessagePart } from '../../agent-parts/parts.js';
2
+ import type { AgentEngineDriver, AgentEngineSession, AgentEngineTurn } from '../engine.js';
3
+ import { type DriverImageOptions, type InlinedPart } from '../image-input.js';
4
+ import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
5
+ import { type CodexApprovalPolicy, type CodexCollaborationMode, type CodexSandboxMode, type CodexThreadContext } from './protocol.js';
6
+ /** Policy and configuration fields forwarded to Codex `thread/start`, `thread/resume`, and `thread/fork`. */
7
+ export interface CodexThreadPolicyOverrides {
8
+ /** Model identifier to use for the thread. */
9
+ readonly model?: string;
10
+ /** Model provider identifier (for example `openai`). */
11
+ readonly modelProvider?: string;
12
+ /** Approval policy applied to the thread. */
13
+ readonly approvalPolicy?: CodexApprovalPolicy;
14
+ /** Sandbox mode applied to the thread. */
15
+ readonly sandbox?: CodexSandboxMode;
16
+ /** Developer instructions appended to the thread system context. */
17
+ readonly developerInstructions?: string;
18
+ /** Additional workspace roots allowed for runtime filesystem access. */
19
+ readonly runtimeWorkspaceRoots?: readonly string[];
20
+ /** Codex app-server config overrides for the thread (sandbox writable roots, disabled MCP/plugins/features, network policy). */
21
+ readonly config?: Readonly<Record<string, JsonRpcValue>>;
22
+ }
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. */
58
+ export interface CodexTurnInput {
59
+ readonly turnId: string;
60
+ readonly clientId: string;
61
+ readonly input: readonly AgentMessagePart[];
62
+ /** Per-turn model override forwarded on `turn/start`. */
63
+ readonly model?: string;
64
+ /**
65
+ * Verified fail-closed against the thread's active `modelProvider`; Codex's `turn/start`
66
+ * does not switch providers mid-thread.
67
+ */
68
+ readonly modelProvider?: string;
69
+ /** Per-turn reasoning effort override (forwarded to Codex as `effort`). */
70
+ readonly reasoningEffort?: string;
71
+ /** Per-turn collaboration mode override (`plan` or `default`). */
72
+ readonly collaborationMode?: CodexCollaborationMode;
73
+ /** Per-turn approval policy override. */
74
+ readonly approvalPolicy?: CodexApprovalPolicy;
75
+ /** Per-turn sandbox policy object override (`sandboxPolicy`). */
76
+ readonly sandboxPolicy?: JsonRpcValue;
77
+ /** Per-turn runtime workspace roots override. */
78
+ readonly runtimeWorkspaceRoots?: readonly string[];
79
+ }
80
+ /** Input to {@link CodexSession.steerTurn} (`turn/steer`). */
81
+ export interface CodexSteerTurnInput {
82
+ readonly input: readonly AgentMessagePart[];
83
+ readonly clientId?: string;
84
+ /** Optional guard asserting which active Codex turn id is being steered. */
85
+ readonly expectedTurnId?: string;
86
+ }
87
+ /** Options for {@link CodexSession.forkThread} (`thread/fork`). */
88
+ export interface CodexForkThreadOptions extends CodexThreadPolicyOverrides {
89
+ readonly cwd?: string;
90
+ readonly beforeTurnId?: string;
91
+ readonly lastTurnId?: string;
92
+ readonly excludeTurns?: boolean;
93
+ }
94
+ /** Result returned by {@link CodexSession.forkThread} without mutating the current session. */
95
+ export interface CodexForkedThread {
96
+ readonly nativeThreadId: string;
97
+ readonly threadContext: CodexThreadContext;
98
+ }
99
+ /** Extended Codex session handle exposing `providerPid`, applied `threadContext`, and live app-server controls. */
100
+ export interface CodexSession extends AgentEngineSession, CodexControlClient {
101
+ /** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
102
+ readonly providerPid: number | undefined;
103
+ /** Applied thread settings reported by `thread/start` or `thread/resume`. */
104
+ readonly threadContext: CodexThreadContext;
105
+ /** Start a turn with optional per-turn Codex overrides. */
106
+ startTurn(input: CodexTurnInput): Promise<AgentEngineTurn>;
107
+ /** Steer the currently running turn with additional input (`turn/steer`). */
108
+ steerTurn(input: CodexSteerTurnInput): Promise<{
109
+ readonly turnId: string;
110
+ }>;
111
+ /** Fork the session's thread into a new thread id without mutating the current session (`thread/fork`). */
112
+ forkThread(options?: CodexForkThreadOptions): Promise<CodexForkedThread>;
113
+ /** Request context compaction for the current thread (`thread/compact/start`). */
114
+ compactThread(): Promise<void>;
115
+ }
116
+ /** Codex driver returned by {@link createCodexDriver}; `open()` resolves to a {@link CodexSession}. */
117
+ export interface CodexDriver extends AgentEngineDriver {
118
+ readonly engine: 'codex';
119
+ readonly reconcile: 'client-id';
120
+ findInput: NonNullable<AgentEngineDriver['findInput']>;
121
+ open(input: Parameters<AgentEngineDriver['open']>[0]): Promise<CodexSession>;
122
+ }
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[];
125
+ /** Validate `runtimeWorkspaceRoots` and `config` policy overrides before sending them to Codex. */
126
+ export declare function validateCodexPolicyOverrides(overrides: Pick<CodexThreadPolicyOverrides, 'runtimeWorkspaceRoots' | 'config'>, caller: string): void;
127
+ /** Build JSON-RPC params for `thread/start`, `thread/resume`, or `thread/fork` from merged policy fields. */
128
+ export declare function buildCodexThreadPolicyParams(base: CodexThreadPolicyOverrides, overrides: CodexThreadPolicyOverrides | undefined): Record<string, JsonRpcValue>;
129
+ /** Validate per-turn overrides eagerly before host image files are read. */
130
+ export declare function validateCodexTurnStartOverrides(turnInput: CodexTurnInput, activeModelProvider: string | undefined): void;
131
+ /** 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;
138
+ /** Create thread/turn control methods (`steerTurn`, `forkThread`, `compactThread`) for a live Codex session. */
139
+ export declare function createCodexSessionMutators(input: {
140
+ peer: JsonRpcPeer;
141
+ threadId: string;
142
+ imageOptions: DriverImageOptions;
143
+ signal: AbortSignal;
144
+ ensureAlive(): void;
145
+ getActiveTurn(): {
146
+ readonly codexTurnId?: string;
147
+ } | undefined;
148
+ }): {
149
+ steerTurn(steerInput: CodexSteerTurnInput): Promise<{
150
+ readonly turnId: string;
151
+ }>;
152
+ forkThread(options?: CodexForkThreadOptions): Promise<CodexForkedThread>;
153
+ compactThread(): Promise<void>;
154
+ };
155
+ //# sourceMappingURL=session-controls.d.ts.map
@@ -0,0 +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,CAAC;AAEpB,6GAA6G;AAC7G,MAAM,WAAW,0BAA0B;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,6CAA6C;IAC7C,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAC9C,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IACpC,oEAAoE;IACpE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,wEAAwE;IACxE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,gIAAgI;IAChI,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;CAC1D;AAED,gIAAgI;AAChI,MAAM,WAAW,kBAA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PlanLimits } from '../hello.js';
3
2
  import { type DriverImageOptions } from '../image-input.js';
4
- import { createJsonRpcPeer, type JsonRpcValue } from '../json-rpc-peer.js';
3
+ import { type JsonRpcValue } from '../json-rpc-peer.js';
5
4
  import { type ExecutorProfileConfig } from '../profile.js';
6
- export interface CodexSessionConfig extends DriverImageOptions {
7
- executable: string;
8
- prefix: readonly string[];
9
- model?: string;
10
- approvalPolicy: string;
11
- sandbox: string;
12
- ambient: Readonly<Record<string, string | undefined>>;
13
- limits: Map<string, PlanLimits>;
14
- version: string;
15
- maxLineBytes?: number;
5
+ import { type CodexConnectConfig } from './connect.js';
6
+ import { type CodexThreadContext } from './protocol.js';
7
+ import { type CodexControlClient, type CodexSession, type CodexThreadPolicyOverrides } from './session-controls.js';
8
+ export interface CodexSessionConfig extends DriverImageOptions, CodexConnectConfig {
9
+ readonly model?: string;
10
+ readonly modelProvider?: string;
11
+ readonly approvalPolicy: CodexThreadPolicyOverrides['approvalPolicy'];
12
+ readonly sandbox: CodexThreadPolicyOverrides['sandbox'];
13
+ readonly developerInstructions?: string;
14
+ readonly runtimeWorkspaceRoots?: readonly string[];
15
+ readonly config?: Readonly<Record<string, JsonRpcValue>>;
16
+ readonly prepareThread?: (context: {
17
+ readonly controls: CodexControlClient;
18
+ readonly cwd: string;
19
+ readonly nativeThreadId?: string;
20
+ }) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined;
21
+ readonly verifyThread?: (context: {
22
+ readonly nativeThreadId: string;
23
+ readonly threadContext: CodexThreadContext;
24
+ readonly controls: CodexControlClient;
25
+ }) => Promise<void> | void;
26
+ readonly limits: Map<string, PlanLimits>;
16
27
  }
17
- /** Spawn `codex app-server`, initialize it, and return the peer; the caller owns the process. */
18
- export declare function connectCodex(config: CodexSessionConfig, profile: ExecutorProfileConfig, cwd: string, signal: AbortSignal, handlers?: Partial<Pick<Parameters<typeof createJsonRpcPeer>[0], 'onRequest' | 'onNotification'>>,
19
- /** The app-server's output ended, or carried a line that is not JSON-RPC. */
20
- onEnd?: (error: Error) => void): Promise<{
21
- engine: import("../engine-process.js").EngineProcess;
22
- peer: {
23
- request(method: string, params?: JsonRpcValue, options?: {
24
- readonly timeoutMs?: number | null;
25
- }): Promise<JsonRpcValue>;
26
- notify(method: string, params?: JsonRpcValue): void;
27
- receive(line: string): void;
28
- close(reason?: unknown): void;
29
- };
30
- reading: Promise<void>;
31
- }>;
32
28
  /**
33
- * One app-server for one connection, holding one thread. Server requests
34
- * the driver knows become `request` deltas answered by `respond`; any other
35
- * is refused at once with `-32601`, so no unanswered request hangs a turn.
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.
36
32
  */
37
33
  export declare function openCodexSession(config: CodexSessionConfig, input: {
38
34
  profile: ExecutorProfileConfig;
39
35
  cwd: string;
40
36
  nativeThreadId?: string;
41
37
  signal?: AbortSignal;
42
- }): Promise<AgentEngineSession>;
38
+ }): Promise<CodexSession>;
43
39
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,WAAW,CAAC;AAWrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,kBAAkB,EAAsC,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EACL,iBAAiB,EAIjB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAoC,MAAM,YAAY,CAAC;AA0B1F,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf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Q,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC1C;AAiPD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE;IACL,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,YAAY,CAAC,CAmJvB"}
@@ -0,0 +1,26 @@
1
+ /** Distinct failure categories for Codex WebSocket-over-Unix-socket connections. */
2
+ export type CodexUnixSocketErrorKind = 'endpoint-absent' | 'endpoint-not-listening' | 'target-refused' | 'upgrade-refused' | 'connection-lost';
3
+ /** Typed transport error raised when dialing, upgrading, or reading a Codex Unix socket. */
4
+ export declare class CodexUnixSocketError extends Error {
5
+ readonly kind: CodexUnixSocketErrorKind;
6
+ readonly socketPath: string;
7
+ constructor(kind: CodexUnixSocketErrorKind, socketPath: string, message: string, options?: ErrorOptions);
8
+ }
9
+ /** Validate a Codex Unix socket path eagerly before spawning or connecting. */
10
+ export declare function validateCodexUnixSocketPath(socketPath: string, caller: string): void;
11
+ /**
12
+ * Verify that `dirname(socketPath)` exists and is a private non-symlink directory, and that
13
+ * `socketPath` itself does not already exist before spawning `codex app-server --listen`.
14
+ * Throws {@link CodexUnixSocketError} (`'target-refused'`) on any violation.
15
+ */
16
+ export declare function assertCodexUnixListenTargetAvailable(socketPath: string, caller: string): void;
17
+ /**
18
+ * Inspect the socket directory and target socket before dialing a Codex app-server Unix socket.
19
+ *
20
+ * Real `codex app-server --listen unix://<path>` publishes `<path>` as a user-owned symlink
21
+ * pointing into a private `0o700` daemon directory (`/tmp/codex-daemon-<uid>/<hash>`). When
22
+ * `<path>` is a symlink, both the symlink itself and its resolved target directory + socket inode
23
+ * must satisfy ownership and privacy checks.
24
+ */
25
+ export declare function assertCodexUnixSocketClientTarget(socketPath: string, caller: string, expectedOwnerUid?: number): 'present' | 'absent';
26
+ //# sourceMappingURL=unix-socket-target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unix-socket-target.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/unix-socket-target.ts"],"names":[],"mappings":"AASA,oFAAoF;AACpF,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,wBAAwB,GACxB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB,4FAA4F;AAC5F,qBAAa,oBAAqB,SAAQ,KAAK;IAE3C,QAAQ,CAAC,IAAI,EAAE,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAF7B,YACW,IAAI,EAAE,wBAAwB,EAC9B,UAAU,EAAE,MAAM,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,EAIvB;CACF;AAED,+EAA+E;AAC/E,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAepF;AAoCD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,IAAI,CAkBN;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,GACxB,SAAS,GAAG,QAAQ,CAkEtB"}
@@ -0,0 +1,26 @@
1
+ import { assertCodexUnixSocketClientTarget, CodexUnixSocketError, type CodexUnixSocketErrorKind, validateCodexUnixSocketPath } from './unix-socket-target.js';
2
+ export { assertCodexUnixSocketClientTarget, CodexUnixSocketError, type CodexUnixSocketErrorKind, validateCodexUnixSocketPath, };
3
+ /** Active RFC 6455 WebSocket-over-Unix-socket connection to a Codex app-server. */
4
+ export interface CodexUnixSocketClient {
5
+ /** Send one masked UTF-8 text frame; throws `RangeError` if outbound queue limit would be exceeded. */
6
+ send(text: string): void;
7
+ /** Gracefully close the client socket (never terminates an external server). */
8
+ close(): Promise<void>;
9
+ /** Resolves once the client socket has fully closed. */
10
+ readonly closed: Promise<void>;
11
+ }
12
+ /** Dial a Codex app-server Unix domain socket and perform the RFC 6455 `/rpc` WebSocket handshake. */
13
+ export declare function connectCodexUnixSocket(input: {
14
+ socketPath: string;
15
+ expectedOwnerUid?: number;
16
+ /** Long-lived signal controlling the established WebSocket connection lifetime. */
17
+ signal: AbortSignal;
18
+ /** Optional shorter signal bounding only the connect + HTTP upgrade handshake. */
19
+ connectSignal?: AbortSignal;
20
+ handshakeTimeoutMs?: number;
21
+ maxFrameBytes?: number;
22
+ maxPendingWriteBytes?: number;
23
+ onMessage(text: string): void;
24
+ onClose(error: Error): void;
25
+ }): Promise<CodexUnixSocketClient>;
26
+ //# sourceMappingURL=unix-socket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unix-socket.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/unix-socket.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,iCAAiC,EACjC,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EACL,iCAAiC,EACjC,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,2BAA2B,GAC5B,CAAC;AASF,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,uGAAuG;IACvG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gFAAgF;IAChF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAyMD,sGAAsG;AACtG,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,MAAM,EAAE,WAAW,CAAC;IACpB,kFAAkF;IAClF,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC7B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuKjC"}
@@ -0,0 +1,15 @@
1
+ /** Compute the encoded wire byte length of a masked client-to-server RFC 6455 frame. */
2
+ export declare function maskedWsFrameByteLength(payloadBytes: number): number;
3
+ /** Encode a single masked client-to-server RFC 6455 WebSocket frame. */
4
+ export declare function encodeMaskedWsFrame(opcode: number, payload: Uint8Array): Buffer;
5
+ /** Bounded streaming RFC 6455 server-to-client frame decoder (UTF-8 text + control frames). */
6
+ export declare function createWsFrameDecoder(handlers: {
7
+ maxFrameBytes: number;
8
+ onMessage(text: string): void;
9
+ onPing(payload: Buffer): void;
10
+ onClose(code: number | undefined, reason: string): void;
11
+ onProtocolError(message: string): void;
12
+ }): {
13
+ push(chunk: Buffer): void;
14
+ };
15
+ //# sourceMappingURL=ws-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-frame.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/ws-frame.ts"],"names":[],"mappings":"AAKA,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,CA2B/E;AAmFD,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACxD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC,GAAG;IAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAyIhC"}
@@ -69,6 +69,8 @@ declare const agentExecutorEndpoints: {
69
69
  name: z.ZodString;
70
70
  usedPercent: z.ZodNumber;
71
71
  resetsAt: z.ZodOptional<z.ZodISODateTime>;
72
+ windowDurationMins: z.ZodOptional<z.ZodInt>;
73
+ label: z.ZodOptional<z.ZodString>;
72
74
  }, z.core.$strict>>;
73
75
  observedAt: z.ZodISODateTime;
74
76
  error: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/agent-executor/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAc9B,yFAAyF;AACzF,QAAA,MAAM,sBAAsB;;iBAExB,MAAM,EAAE,MAAM;iBACd,IAAI,EAAE,QAAQ;iBACd,MAAM;iBACN,MAAM,EAAE,OAAO;iBACf,IAAI,EAAE,mGAAmG;iBACzG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBACL,MAAM;;;;;;;;;;;;;iBAGN,MAAM,EAAE,MAAM;iBACd,IAAI,EAAE,gBAAgB;iBACtB,MAAM;iBACN,MAAM,EAAE,OAAO;iBACf,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBACL,MAAM;;;;;;;;;;CAEsC,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,WAAW,CAAC,OAAO,sBAAsB,EAAE,MAAM,CAAC,CAKrD;AAED,4DAA4D;AAC5D,QAAA,MAAM,yBAAyB;;QACb,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACA,IAAI;;;;;;QACR,IAAI;;;;;;;;;;;;;;CACW,CAAC;AAElC,wFAAwF;AACxF,eAAO,MAAM,6BAA6B,EAAE,gBAAgB,CAC1D,OAAO,yBAAyB,EAChC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CACuE,CAAC"}
@@ -3,6 +3,10 @@ import type { NativeCommandResult } from '../process/contract.js';
3
3
  export declare const ENGINE_LINE_BYTES: number;
4
4
  /** An engine process talked to by lines: one connection, one process. */
5
5
  export interface EngineProcess {
6
+ /** OS process id of the spawned engine once its leader has started, if available. */
7
+ readonly pid?: number;
8
+ /** Settles to the spawned leader PID once started, or `undefined` if startup ended without one. */
9
+ readonly pidReady?: Promise<number | undefined>;
6
10
  /**
7
11
  * Write one line; refused once the process closed its input, when queuing
8
12
  * the line would exceed `maxPendingStdinBytes`, or when it would take the
@@ -41,5 +45,10 @@ export declare function spawnEngineProcess(input: {
41
45
  * line past it and the engine keeps running. Default 256 MiB.
42
46
  */
43
47
  maxStdinBytes?: number;
48
+ /**
49
+ * How stdout is consumed: `'lines'` (default, caller reads `lines`) or `'drain'` (drained
50
+ * continuously in the background when the engine speaks over another transport such as a Unix socket).
51
+ */
52
+ stdoutMode?: 'lines' | 'drain';
44
53
  }): EngineProcess;
45
54
  //# sourceMappingURL=engine-process.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine-process.d.ts","sourceRoot":"","sources":["../../src/agent-executor/engine-process.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,QAAkB,CAAC;AAQjD,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,sDAAsD;IACtD,UAAU,IAAI,MAAM,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9C,uEAAuE;IACvE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,WAAW,CAAC;IACpB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2FAA2F;IAC3F,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,aAAa,CA+FhB"}
1
+ {"version":3,"file":"engine-process.d.ts","sourceRoot":"","sources":["../../src/agent-execut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ZodObject<{
20
20
  name: z.ZodString;
21
21
  usedPercent: z.ZodNumber;
22
22
  resetsAt: z.ZodOptional<z.ZodISODateTime>;
23
+ windowDurationMins: z.ZodOptional<z.ZodInt>;
24
+ label: z.ZodOptional<z.ZodString>;
23
25
  }, z.core.$strict>;
24
26
  /**
25
27
  * A subscription's limits, as its source answers: `known` with windows,
@@ -37,6 +39,8 @@ export declare const PlanLimitsSchema: z.ZodObject<{
37
39
  name: z.ZodString;
38
40
  usedPercent: z.ZodNumber;
39
41
  resetsAt: z.ZodOptional<z.ZodISODateTime>;
42
+ windowDurationMins: z.ZodOptional<z.ZodInt>;
43
+ label: z.ZodOptional<z.ZodString>;
40
44
  }, z.core.$strict>>;
41
45
  observedAt: z.ZodISODateTime;
42
46
  error: z.ZodOptional<z.ZodString>;
@@ -79,6 +83,8 @@ export declare const ExecutorProfileSchema: z.ZodObject<{
79
83
  name: z.ZodString;
80
84
  usedPercent: z.ZodNumber;
81
85
  resetsAt: z.ZodOptional<z.ZodISODateTime>;
86
+ windowDurationMins: z.ZodOptional<z.ZodInt>;
87
+ label: z.ZodOptional<z.ZodString>;
82
88
  }, z.core.$strict>>;
83
89
  observedAt: z.ZodISODateTime;
84
90
  error: z.ZodOptional<z.ZodString>;
@@ -176,6 +182,8 @@ export declare const ExecutorHelloSchema: z.ZodObject<{
176
182
  name: z.ZodString;
177
183
  usedPercent: z.ZodNumber;
178
184
  resetsAt: z.ZodOptional<z.ZodISODateTime>;
185
+ windowDurationMins: z.ZodOptional<z.ZodInt>;
186
+ label: z.ZodOptional<z.ZodString>;
179
187
  }, z.core.$strict>>;
180
188
  observedAt: z.ZodISODateTime;
181
189
  error: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"hello.d.ts","sourceRoot":"","sources":["../../src/agent-executor/hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,8CAA8C;AAC9C,eAAO,MAAM,oBAA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;;;;;;;;;;kBAGjC,CAAC;AAEH,uDAAuD;AACvD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,qFAAqF;AACrF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,kGAAkG;AAClG,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -134,6 +134,11 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
134
134
  artifactId?: string | undefined;
135
135
  payloadOmitted?: "max-payload-bytes" | undefined;
136
136
  payloadSha256: string;
137
+ } | {
138
+ stepName: string;
139
+ encoded: string;
140
+ runId: string;
141
+ id?: string | undefined;
137
142
  } | {
138
143
  kind: "sleep";
139
144
  name: string;
@@ -147,11 +152,6 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
147
152
  id: string;
148
153
  encoded?: string | undefined;
149
154
  runId: string;
150
- } | {
151
- stepName: string;
152
- encoded: string;
153
- runId: string;
154
- id?: string | undefined;
155
155
  } | {
156
156
  event: string;
157
157
  id: string;
@@ -178,16 +178,17 @@ export declare class BranchProvider {
178
178
  })[];
179
179
  };
180
180
  } | {
181
+ message?: undefined;
181
182
  attempt: number;
182
183
  stepNumber: number;
183
184
  modelId: string;
184
185
  instructionsSha256: string;
185
186
  sha256?: undefined;
186
- message?: undefined;
187
187
  runId: string;
188
188
  messageShas: string[];
189
189
  bodySha256: string;
190
190
  } | {
191
+ message?: undefined;
191
192
  attempt: number;
192
193
  stepNumber: number;
193
194
  response: {
@@ -222,7 +223,6 @@ export declare class BranchProvider {
222
223
  } | undefined;
223
224
  } | undefined;
224
225
  sha256?: undefined;
225
- message?: undefined;
226
226
  runId: string;
227
227
  };
228
228
  private rekeyPart;
@@ -124,16 +124,6 @@ export declare function parseRunRow(value: unknown): {
124
124
  provider: string;
125
125
  data: Record<string, z.JSONType>;
126
126
  } | undefined;
127
- } | {
128
- type: "file";
129
- mediaType: string;
130
- reference: string;
131
- filename?: string | undefined;
132
- } | {
133
- type: "source";
134
- sourceId: string;
135
- url?: string | undefined;
136
- title?: string | undefined;
137
127
  } | {
138
128
  type: "tool-call";
139
129
  callId: string;
@@ -150,6 +140,16 @@ export declare function parseRunRow(value: unknown): {
150
140
  toolName: string;
151
141
  outcome: "error" | "interrupted" | "success";
152
142
  output?: z.JSONType | undefined;
143
+ } | {
144
+ type: "file";
145
+ mediaType: string;
146
+ reference: string;
147
+ filename?: string | undefined;
148
+ } | {
149
+ type: "source";
150
+ sourceId: string;
151
+ url?: string | undefined;
152
+ title?: string | undefined;
153
153
  } | {
154
154
  type: "tool-approval-request";
155
155
  approvalId: string;