@intentic/sandbox-contract 1.167.0 → 1.169.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 (68) hide show
  1. package/dist/agent-catalog.d.ts +20 -2
  2. package/dist/agent-catalog.d.ts.map +1 -1
  3. package/dist/agent-catalog.js +80 -4
  4. package/dist/agent-catalog.js.map +1 -1
  5. package/dist/contracts/agent.contract.d.ts +36 -8
  6. package/dist/contracts/agent.contract.d.ts.map +1 -1
  7. package/dist/contracts/agent.contract.js +1 -2
  8. package/dist/contracts/agent.contract.js.map +1 -1
  9. package/dist/contracts/agents.contract.d.ts +37 -39
  10. package/dist/contracts/agents.contract.d.ts.map +1 -1
  11. package/dist/contracts/extensions.contract.d.ts +4 -0
  12. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  13. package/dist/contracts/prepush.contract.d.ts +25 -0
  14. package/dist/contracts/prepush.contract.d.ts.map +1 -0
  15. package/dist/contracts/prepush.contract.js +8 -0
  16. package/dist/contracts/prepush.contract.js.map +1 -0
  17. package/dist/contracts/sessions.contract.d.ts +1 -39
  18. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  19. package/dist/contracts/settings.contract.d.ts +8 -10
  20. package/dist/contracts/settings.contract.d.ts.map +1 -1
  21. package/dist/contracts/system.contract.d.ts +56 -0
  22. package/dist/contracts/system.contract.d.ts.map +1 -1
  23. package/dist/contracts/system.contract.js +7 -2
  24. package/dist/contracts/system.contract.js.map +1 -1
  25. package/dist/contracts/translator.contract.d.ts +36 -0
  26. package/dist/contracts/translator.contract.d.ts.map +1 -1
  27. package/dist/events.d.ts +88 -159
  28. package/dist/events.d.ts.map +1 -1
  29. package/dist/events.js +37 -4
  30. package/dist/events.js.map +1 -1
  31. package/dist/index.d.ts +218 -157
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -3
  34. package/dist/index.js.map +1 -1
  35. package/dist/quick-model.d.ts +1 -0
  36. package/dist/quick-model.d.ts.map +1 -1
  37. package/dist/quick-model.js +1 -1
  38. package/dist/quick-model.js.map +1 -1
  39. package/dist/schemas.d.ts +176 -69
  40. package/dist/schemas.d.ts.map +1 -1
  41. package/dist/schemas.js +48 -40
  42. package/dist/schemas.js.map +1 -1
  43. package/dist/title.d.ts.map +1 -1
  44. package/dist/title.js.map +1 -1
  45. package/dist/workspace-state.d.ts +9 -0
  46. package/dist/workspace-state.d.ts.map +1 -0
  47. package/dist/workspace-state.js +61 -0
  48. package/dist/workspace-state.js.map +1 -0
  49. package/package.json +2 -2
  50. package/src/agent-catalog.test.ts +118 -0
  51. package/src/agent-catalog.ts +179 -15
  52. package/src/contracts/agent.contract.ts +1 -14
  53. package/src/contracts/prepush.contract.ts +16 -0
  54. package/src/contracts/system.contract.ts +15 -1
  55. package/src/events.test.ts +32 -0
  56. package/src/events.ts +105 -27
  57. package/src/index.ts +4 -3
  58. package/src/quick-model.ts +4 -2
  59. package/src/schemas.test.ts +13 -18
  60. package/src/schemas.ts +179 -152
  61. package/src/title.ts +6 -2
  62. package/src/workspace-state.test.ts +129 -0
  63. package/src/workspace-state.ts +150 -0
  64. package/dist/contracts/gate.contract.d.ts +0 -47
  65. package/dist/contracts/gate.contract.d.ts.map +0 -1
  66. package/dist/contracts/gate.contract.js +0 -9
  67. package/dist/contracts/gate.contract.js.map +0 -1
  68. package/src/contracts/gate.contract.ts +0 -19
@@ -102,6 +102,10 @@ export declare const systemContract: {
102
102
  };
103
103
  turns?: number | undefined;
104
104
  toolUses?: number | undefined;
105
+ subagents?: {
106
+ running: number;
107
+ total: number;
108
+ } | undefined;
105
109
  diff?: {
106
110
  files: number;
107
111
  insertions: number;
@@ -198,6 +202,10 @@ export declare const systemContract: {
198
202
  };
199
203
  turns?: number | undefined;
200
204
  toolUses?: number | undefined;
205
+ subagents?: {
206
+ running: number;
207
+ total: number;
208
+ } | undefined;
201
209
  diff?: {
202
210
  files: number;
203
211
  insertions: number;
@@ -264,6 +272,7 @@ export declare const systemContract: {
264
272
  server: z.ZodString;
265
273
  running: z.ZodBoolean;
266
274
  activityAt: z.ZodNumber;
275
+ finishedAt: z.ZodOptional<z.ZodNumber>;
267
276
  pages: z.ZodArray<z.ZodObject<{
268
277
  id: z.ZodString;
269
278
  title: z.ZodOptional<z.ZodString>;
@@ -277,5 +286,52 @@ export declare const systemContract: {
277
286
  }, z.core.$strip>, z.ZodObject<{
278
287
  ok: z.ZodLiteral<true>;
279
288
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
289
+ subagents: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
290
+ sessions: z.ZodArray<z.ZodObject<{
291
+ id: z.ZodString;
292
+ kind: z.ZodEnum<{
293
+ codex: "codex";
294
+ grok: "grok";
295
+ subagent: "subagent";
296
+ }>;
297
+ conversationId: z.ZodString;
298
+ agentType: z.ZodOptional<z.ZodString>;
299
+ description: z.ZodOptional<z.ZodString>;
300
+ model: z.ZodOptional<z.ZodString>;
301
+ spawnDepth: z.ZodOptional<z.ZodNumber>;
302
+ background: z.ZodOptional<z.ZodBoolean>;
303
+ status: z.ZodEnum<{
304
+ completed: "completed";
305
+ failed: "failed";
306
+ killed: "killed";
307
+ paused: "paused";
308
+ pending: "pending";
309
+ running: "running";
310
+ }>;
311
+ startedAt: z.ZodNumber;
312
+ endedAt: z.ZodOptional<z.ZodNumber>;
313
+ activityAt: z.ZodNumber;
314
+ tokens: z.ZodOptional<z.ZodNumber>;
315
+ toolUses: z.ZodOptional<z.ZodNumber>;
316
+ lastTool: z.ZodOptional<z.ZodString>;
317
+ summary: z.ZodOptional<z.ZodString>;
318
+ error: z.ZodOptional<z.ZodString>;
319
+ terminal: z.ZodOptional<z.ZodString>;
320
+ }, z.core.$strip>>;
321
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
322
+ subagentTranscript: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
323
+ id: z.ZodString;
324
+ }, z.core.$strip>, z.ZodObject<{
325
+ messages: z.ZodArray<z.ZodObject<{
326
+ role: z.ZodEnum<{
327
+ assistant: "assistant";
328
+ user: "user";
329
+ }>;
330
+ text: z.ZodString;
331
+ attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
332
+ thinking: z.ZodOptional<z.ZodString>;
333
+ tools: z.ZodOptional<z.ZodArray<z.ZodType<import("../events.js").RestoredToolCall, unknown, z.core.$ZodTypeInternals<import("../events.js").RestoredToolCall, unknown>>>>;
334
+ }, z.core.$strip>>;
335
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
280
336
  };
281
337
  //# sourceMappingURL=system.contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"system.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/system.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,cAAc;IACvB,IAAI;;;;;;;IAGJ,OAAO;;;;;IACP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKN,QAAQ;;;;;;;;;IACR,UAAU;;;;;;IAEV,KAAK;;;;;;;;;;;;IAKL,SAAS;;;;;;;;;;;;;;;;;;IACT,YAAY;;;;;IAMZ,QAAQ;;;;;;;;;;;;;;;IACR,YAAY;;;;;CACf,CAAC"}
1
+ {"version":3,"file":"system.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/system.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,cAAc;IACvB,IAAI;;;;;;;IAGJ,OAAO;;;;;IACP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKN,QAAQ;;;;;;;;;IACR,UAAU;;;;;;IAEV,KAAK;;;;;;;;;;;;IAKL,SAAS;;;;;;;;;;;;;;;;;;IACT,YAAY;;;;;IAMZ,QAAQ;;;;;;;;;;;;;;;;IACR,YAAY;;;;;IAQZ,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACT,kBAAkB;;;;;;;;;;;;;;CAIrB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { eventIterator, oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
- import { SystemEventSchema } from "../events.js";
4
- import { BrowserNameParamSchema, BrowsersListSchema, DaemonSessionSchema, HostTunnelInputSchema, HostTunnelSchema, InfoSchema, OkSchema, PresenceReportSchema, TerminalNameParamSchema, TerminalsListSchema, UsageSummarySchema, } from "../schemas.js";
3
+ import { SessionTranscriptSchema, SystemEventSchema } from "../events.js";
4
+ import { BrowserNameParamSchema, BrowsersListSchema, DaemonSessionSchema, HostTunnelInputSchema, HostTunnelSchema, InfoSchema, OkSchema, PresenceReportSchema, SubagentIdParamSchema, SubagentsListSchema, TerminalNameParamSchema, TerminalsListSchema, UsageSummarySchema, } from "../schemas.js";
5
5
  export const systemContract = {
6
6
  info: oc.route({ method: "GET", path: "/info" }).output(InfoSchema),
7
7
  session: oc.route({ method: "POST", path: "/system/session" }).output(DaemonSessionSchema),
@@ -16,5 +16,10 @@ export const systemContract = {
16
16
  killTerminal: oc.route({ method: "DELETE", path: "/system/terminals/{name}" }).input(TerminalNameParamSchema).output(OkSchema),
17
17
  browsers: oc.route({ method: "GET", path: "/system/browsers" }).output(BrowsersListSchema),
18
18
  closeBrowser: oc.route({ method: "DELETE", path: "/system/browsers/{name}" }).input(BrowserNameParamSchema).output(OkSchema),
19
+ subagents: oc.route({ method: "GET", path: "/system/subagents" }).output(SubagentsListSchema),
20
+ subagentTranscript: oc
21
+ .route({ method: "GET", path: "/system/subagents/{id}/transcript" })
22
+ .input(SubagentIdParamSchema)
23
+ .output(SessionTranscriptSchema),
19
24
  };
20
25
  //# sourceMappingURL=system.contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"system.contract.js","sourceRoot":"","sources":["../../src/contracts/system.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,GACrB,MAAM,eAAe,CAAC;AAOvB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;IAGnE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAC1F,MAAM,EAAE,EAAE;SACL,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;SACzC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QA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atorContract: {
4
4
  codex: z.ZodArray<z.ZodObject<{
5
5
  name: z.ZodString;
6
6
  label: z.ZodString;
7
+ usage: z.ZodOptional<z.ZodObject<{
8
+ windows: z.ZodArray<z.ZodObject<{
9
+ kind: z.ZodString;
10
+ label: z.ZodOptional<z.ZodString>;
11
+ utilization: z.ZodNumber;
12
+ resetsAt: z.ZodOptional<z.ZodNumber>;
13
+ }, z.core.$strip>>;
14
+ measuredAt: z.ZodNumber;
15
+ }, z.core.$strip>>;
7
16
  }, z.core.$strip>>;
8
17
  grok: z.ZodArray<z.ZodObject<{
9
18
  name: z.ZodString;
10
19
  label: z.ZodString;
20
+ usage: z.ZodOptional<z.ZodObject<{
21
+ windows: z.ZodArray<z.ZodObject<{
22
+ kind: z.ZodString;
23
+ label: z.ZodOptional<z.ZodString>;
24
+ utilization: z.ZodNumber;
25
+ resetsAt: z.ZodOptional<z.ZodNumber>;
26
+ }, z.core.$strip>>;
27
+ measuredAt: z.ZodNumber;
28
+ }, z.core.$strip>>;
11
29
  }, z.core.$strip>>;
12
30
  kimi: z.ZodArray<z.ZodObject<{
13
31
  name: z.ZodString;
14
32
  label: z.ZodString;
33
+ usage: z.ZodOptional<z.ZodObject<{
34
+ windows: z.ZodArray<z.ZodObject<{
35
+ kind: z.ZodString;
36
+ label: z.ZodOptional<z.ZodString>;
37
+ utilization: z.ZodNumber;
38
+ resetsAt: z.ZodOptional<z.ZodNumber>;
39
+ }, z.core.$strip>>;
40
+ measuredAt: z.ZodNumber;
41
+ }, z.core.$strip>>;
15
42
  }, z.core.$strip>>;
16
43
  gemini: z.ZodArray<z.ZodObject<{
17
44
  name: z.ZodString;
18
45
  label: z.ZodString;
46
+ usage: z.ZodOptional<z.ZodObject<{
47
+ windows: z.ZodArray<z.ZodObject<{
48
+ kind: z.ZodString;
49
+ label: z.ZodOptional<z.ZodString>;
50
+ utilization: z.ZodNumber;
51
+ resetsAt: z.ZodOptional<z.ZodNumber>;
52
+ }, z.core.$strip>>;
53
+ measuredAt: z.ZodNumber;
54
+ }, z.core.$strip>>;
19
55
  }, z.core.$strip>>;
20
56
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
21
57
  connect: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"translator.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/translator.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,kBAAkB;IAC3B,QAAQ;;;;;;;;;;;;;;;;;;IACR,OAAO;;;;;;;;;;;;;;;;IAIP,QAAQ;;;;;;;;;;;;IACR,UAAU;;;;;;;;;;;CAIb,CAAC"}
1
+ {"version":3,"file":"translator.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/translator.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,kBAAkB;IAC3B,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACR,OAAO;;;;;;;;;;;;;;;;IAIP,QAAQ;;;;;;;;;;;;IACR,UAAU;;;;;;;;;;;CAIb,CAAC"}
package/dist/events.d.ts CHANGED
@@ -95,46 +95,18 @@ export declare const ToolCallContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject
95
95
  path: z.ZodString;
96
96
  }, z.core.$strip>], "type">;
97
97
  export type ToolCallContent = z.infer<typeof ToolCallContentSchema>;
98
- export declare const RestoredToolCallSchema: z.ZodObject<{
99
- id: z.ZodString;
100
- name: z.ZodString;
101
- category: z.ZodEnum<{
102
- delete: "delete";
103
- edit: "edit";
104
- execute: "execute";
105
- fetch: "fetch";
106
- move: "move";
107
- other: "other";
108
- read: "read";
109
- search: "search";
110
- think: "think";
111
- }>;
112
- status: z.ZodEnum<{
113
- completed: "completed";
114
- failed: "failed";
115
- in_progress: "in_progress";
116
- pending: "pending";
117
- }>;
118
- target: z.ZodOptional<z.ZodString>;
119
- locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
- path: z.ZodString;
121
- line: z.ZodOptional<z.ZodNumber>;
122
- }, z.core.$strip>>>;
123
- content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
124
- type: z.ZodLiteral<"text">;
125
- text: z.ZodString;
126
- }, z.core.$strip>, z.ZodObject<{
127
- type: z.ZodLiteral<"diff">;
128
- path: z.ZodString;
129
- oldText: z.ZodOptional<z.ZodString>;
130
- newText: z.ZodString;
131
- truncated: z.ZodOptional<z.ZodBoolean>;
132
- }, z.core.$strip>, z.ZodObject<{
133
- type: z.ZodLiteral<"image">;
134
- path: z.ZodString;
135
- }, z.core.$strip>], "type">>>;
136
- }, z.core.$strip>;
137
- export type RestoredToolCall = z.infer<typeof RestoredToolCallSchema>;
98
+ export declare const RestoredToolCallSchema: z.ZodType<RestoredToolCall>;
99
+ export interface RestoredToolCall {
100
+ id: string;
101
+ name: string;
102
+ category: ToolKind;
103
+ status: ToolCallStatus;
104
+ target?: string | undefined;
105
+ locations?: ToolCallLocation[] | undefined;
106
+ content?: ToolCallContent[] | undefined;
107
+ children?: RestoredToolCall[] | undefined;
108
+ thinking?: string | undefined;
109
+ }
138
110
  export declare const RestoredMessageSchema: z.ZodObject<{
139
111
  role: z.ZodEnum<{
140
112
  assistant: "assistant";
@@ -143,45 +115,7 @@ export declare const RestoredMessageSchema: z.ZodObject<{
143
115
  text: z.ZodString;
144
116
  attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
117
  thinking: z.ZodOptional<z.ZodString>;
146
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
147
- id: z.ZodString;
148
- name: z.ZodString;
149
- category: z.ZodEnum<{
150
- delete: "delete";
151
- edit: "edit";
152
- execute: "execute";
153
- fetch: "fetch";
154
- move: "move";
155
- other: "other";
156
- read: "read";
157
- search: "search";
158
- think: "think";
159
- }>;
160
- status: z.ZodEnum<{
161
- completed: "completed";
162
- failed: "failed";
163
- in_progress: "in_progress";
164
- pending: "pending";
165
- }>;
166
- target: z.ZodOptional<z.ZodString>;
167
- locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
168
- path: z.ZodString;
169
- line: z.ZodOptional<z.ZodNumber>;
170
- }, z.core.$strip>>>;
171
- content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
172
- type: z.ZodLiteral<"text">;
173
- text: z.ZodString;
174
- }, z.core.$strip>, z.ZodObject<{
175
- type: z.ZodLiteral<"diff">;
176
- path: z.ZodString;
177
- oldText: z.ZodOptional<z.ZodString>;
178
- newText: z.ZodString;
179
- truncated: z.ZodOptional<z.ZodBoolean>;
180
- }, z.core.$strip>, z.ZodObject<{
181
- type: z.ZodLiteral<"image">;
182
- path: z.ZodString;
183
- }, z.core.$strip>], "type">>>;
184
- }, z.core.$strip>>>;
118
+ tools: z.ZodOptional<z.ZodArray<z.ZodType<RestoredToolCall, unknown, z.core.$ZodTypeInternals<RestoredToolCall, unknown>>>>;
185
119
  }, z.core.$strip>;
186
120
  export type RestoredMessage = z.infer<typeof RestoredMessageSchema>;
187
121
  export declare const SessionTranscriptSchema: z.ZodObject<{
@@ -193,45 +127,7 @@ export declare const SessionTranscriptSchema: z.ZodObject<{
193
127
  text: z.ZodString;
194
128
  attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
129
  thinking: z.ZodOptional<z.ZodString>;
196
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
197
- id: z.ZodString;
198
- name: z.ZodString;
199
- category: z.ZodEnum<{
200
- delete: "delete";
201
- edit: "edit";
202
- execute: "execute";
203
- fetch: "fetch";
204
- move: "move";
205
- other: "other";
206
- read: "read";
207
- search: "search";
208
- think: "think";
209
- }>;
210
- status: z.ZodEnum<{
211
- completed: "completed";
212
- failed: "failed";
213
- in_progress: "in_progress";
214
- pending: "pending";
215
- }>;
216
- target: z.ZodOptional<z.ZodString>;
217
- locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
- path: z.ZodString;
219
- line: z.ZodOptional<z.ZodNumber>;
220
- }, z.core.$strip>>>;
221
- content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
222
- type: z.ZodLiteral<"text">;
223
- text: z.ZodString;
224
- }, z.core.$strip>, z.ZodObject<{
225
- type: z.ZodLiteral<"diff">;
226
- path: z.ZodString;
227
- oldText: z.ZodOptional<z.ZodString>;
228
- newText: z.ZodString;
229
- truncated: z.ZodOptional<z.ZodBoolean>;
230
- }, z.core.$strip>, z.ZodObject<{
231
- type: z.ZodLiteral<"image">;
232
- path: z.ZodString;
233
- }, z.core.$strip>], "type">>>;
234
- }, z.core.$strip>>>;
130
+ tools: z.ZodOptional<z.ZodArray<z.ZodType<RestoredToolCall, unknown, z.core.$ZodTypeInternals<RestoredToolCall, unknown>>>>;
235
131
  }, z.core.$strip>>;
236
132
  }, z.core.$strip>;
237
133
  export declare const AgentTranscriptSchema: z.ZodObject<{
@@ -243,45 +139,7 @@ export declare const AgentTranscriptSchema: z.ZodObject<{
243
139
  text: z.ZodString;
244
140
  attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
141
  thinking: z.ZodOptional<z.ZodString>;
246
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
247
- id: z.ZodString;
248
- name: z.ZodString;
249
- category: z.ZodEnum<{
250
- delete: "delete";
251
- edit: "edit";
252
- execute: "execute";
253
- fetch: "fetch";
254
- move: "move";
255
- other: "other";
256
- read: "read";
257
- search: "search";
258
- think: "think";
259
- }>;
260
- status: z.ZodEnum<{
261
- completed: "completed";
262
- failed: "failed";
263
- in_progress: "in_progress";
264
- pending: "pending";
265
- }>;
266
- target: z.ZodOptional<z.ZodString>;
267
- locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
268
- path: z.ZodString;
269
- line: z.ZodOptional<z.ZodNumber>;
270
- }, z.core.$strip>>>;
271
- content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
272
- type: z.ZodLiteral<"text">;
273
- text: z.ZodString;
274
- }, z.core.$strip>, z.ZodObject<{
275
- type: z.ZodLiteral<"diff">;
276
- path: z.ZodString;
277
- oldText: z.ZodOptional<z.ZodString>;
278
- newText: z.ZodString;
279
- truncated: z.ZodOptional<z.ZodBoolean>;
280
- }, z.core.$strip>, z.ZodObject<{
281
- type: z.ZodLiteral<"image">;
282
- path: z.ZodString;
283
- }, z.core.$strip>], "type">>>;
284
- }, z.core.$strip>>>;
142
+ tools: z.ZodOptional<z.ZodArray<z.ZodType<RestoredToolCall, unknown, z.core.$ZodTypeInternals<RestoredToolCall, unknown>>>>;
285
143
  }, z.core.$strip>>;
286
144
  sessionId: z.ZodOptional<z.ZodString>;
287
145
  }, z.core.$strip>;
@@ -398,6 +256,35 @@ export declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
398
256
  }, z.core.$strip>, z.ZodObject<{
399
257
  kind: z.ZodLiteral<"browser">;
400
258
  session: z.ZodString;
259
+ }, z.core.$strip>, z.ZodObject<{
260
+ kind: z.ZodLiteral<"subagent">;
261
+ id: z.ZodString;
262
+ subagentKind: z.ZodEnum<{
263
+ codex: "codex";
264
+ grok: "grok";
265
+ subagent: "subagent";
266
+ }>;
267
+ agentType: z.ZodOptional<z.ZodString>;
268
+ description: z.ZodOptional<z.ZodString>;
269
+ model: z.ZodOptional<z.ZodString>;
270
+ background: z.ZodOptional<z.ZodBoolean>;
271
+ terminal: z.ZodOptional<z.ZodString>;
272
+ }, z.core.$strip>, z.ZodObject<{
273
+ kind: z.ZodLiteral<"subagent_update">;
274
+ id: z.ZodString;
275
+ status: z.ZodOptional<z.ZodEnum<{
276
+ completed: "completed";
277
+ failed: "failed";
278
+ killed: "killed";
279
+ paused: "paused";
280
+ pending: "pending";
281
+ running: "running";
282
+ }>>;
283
+ tokens: z.ZodOptional<z.ZodNumber>;
284
+ toolUses: z.ZodOptional<z.ZodNumber>;
285
+ lastTool: z.ZodOptional<z.ZodString>;
286
+ summary: z.ZodOptional<z.ZodString>;
287
+ error: z.ZodOptional<z.ZodString>;
401
288
  }, z.core.$strip>, z.ZodObject<{
402
289
  kind: z.ZodLiteral<"todos">;
403
290
  items: z.ZodArray<z.ZodObject<{
@@ -552,7 +439,6 @@ export declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
552
439
  attempt: z.ZodNumber;
553
440
  maxAttempts: z.ZodNumber;
554
441
  }, z.core.$strip>>;
555
- account: z.ZodOptional<z.ZodString>;
556
442
  }, z.core.$strip>, z.ZodObject<{
557
443
  kind: z.ZodLiteral<"done">;
558
444
  }, z.core.$strip>], "kind">;
@@ -679,6 +565,35 @@ export declare const AttachFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
679
565
  }, z.core.$strip>, z.ZodObject<{
680
566
  kind: z.ZodLiteral<"browser">;
681
567
  session: z.ZodString;
568
+ }, z.core.$strip>, z.ZodObject<{
569
+ kind: z.ZodLiteral<"subagent">;
570
+ id: z.ZodString;
571
+ subagentKind: z.ZodEnum<{
572
+ codex: "codex";
573
+ grok: "grok";
574
+ subagent: "subagent";
575
+ }>;
576
+ agentType: z.ZodOptional<z.ZodString>;
577
+ description: z.ZodOptional<z.ZodString>;
578
+ model: z.ZodOptional<z.ZodString>;
579
+ background: z.ZodOptional<z.ZodBoolean>;
580
+ terminal: z.ZodOptional<z.ZodString>;
581
+ }, z.core.$strip>, z.ZodObject<{
582
+ kind: z.ZodLiteral<"subagent_update">;
583
+ id: z.ZodString;
584
+ status: z.ZodOptional<z.ZodEnum<{
585
+ completed: "completed";
586
+ failed: "failed";
587
+ killed: "killed";
588
+ paused: "paused";
589
+ pending: "pending";
590
+ running: "running";
591
+ }>>;
592
+ tokens: z.ZodOptional<z.ZodNumber>;
593
+ toolUses: z.ZodOptional<z.ZodNumber>;
594
+ lastTool: z.ZodOptional<z.ZodString>;
595
+ summary: z.ZodOptional<z.ZodString>;
596
+ error: z.ZodOptional<z.ZodString>;
682
597
  }, z.core.$strip>, z.ZodObject<{
683
598
  kind: z.ZodLiteral<"todos">;
684
599
  items: z.ZodArray<z.ZodObject<{
@@ -833,7 +748,6 @@ export declare const AttachFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
833
748
  attempt: z.ZodNumber;
834
749
  maxAttempts: z.ZodNumber;
835
750
  }, z.core.$strip>>;
836
- account: z.ZodOptional<z.ZodString>;
837
751
  }, z.core.$strip>, z.ZodObject<{
838
752
  kind: z.ZodLiteral<"done">;
839
753
  }, z.core.$strip>], "kind">;
@@ -841,6 +755,13 @@ export declare const AttachFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
841
755
  kind: z.ZodLiteral<"end">;
842
756
  }, z.core.$strip>], "kind">;
843
757
  export type AttachFrame = z.infer<typeof AttachFrameSchema>;
758
+ export declare const RESUME_NOTES: {
759
+ readonly auth: "The Claude credential that interrupted this conversation has been renewed, and this turn resumed automatically.";
760
+ readonly outage: "The model provider was briefly unavailable and interrupted this conversation; this turn resumed automatically.";
761
+ readonly restart: "The sandbox restarted while this turn was running, which stopped it, and this turn resumed automatically once it came back.";
762
+ };
763
+ export declare const withResumeNote: (prompt: string, note: string) => string;
764
+ export declare const withoutResumeNote: (prompt: string) => string;
844
765
  export declare const IntenticLineSchema: z.ZodObject<{
845
766
  kind: z.ZodString;
846
767
  }, z.core.$loose>;
@@ -1008,6 +929,10 @@ export declare const AgentsSchema: z.ZodObject<{
1008
929
  }, z.core.$strip>;
1009
930
  turns: z.ZodOptional<z.ZodNumber>;
1010
931
  toolUses: z.ZodOptional<z.ZodNumber>;
932
+ subagents: z.ZodOptional<z.ZodObject<{
933
+ running: z.ZodNumber;
934
+ total: z.ZodNumber;
935
+ }, z.core.$strip>>;
1011
936
  diff: z.ZodOptional<z.ZodObject<{
1012
937
  files: z.ZodNumber;
1013
938
  insertions: z.ZodNumber;
@@ -1130,6 +1055,10 @@ export declare const SystemEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1130
1055
  }, z.core.$strip>;
1131
1056
  turns: z.ZodOptional<z.ZodNumber>;
1132
1057
  toolUses: z.ZodOptional<z.ZodNumber>;
1058
+ subagents: z.ZodOptional<z.ZodObject<{
1059
+ running: z.ZodNumber;
1060
+ total: z.ZodNumber;
1061
+ }, z.core.$strip>>;
1133
1062
  diff: z.ZodOptional<z.ZodObject<{
1134
1063
  files: z.ZodNumber;
1135
1064
  insertions: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,eAAe;;;;iBAI1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,iBAAiB;;;;;;;;;iBAK5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D,eAAO,MAAM,mBAAmB;;;;;;;;iBAY9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAKhE,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,eAAO,MAAM,wBAAwB;;iBAAsD,CAAC;AAC5F,eAAO,MAAM,mBAAmB;;;;;;iBAAsD,CAAC;AAGvF,eAAO,MAAM,cAAc;;;;;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAItD,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CA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;;;;;;;;;;;;iBAAgG,CAAC;AAC1H,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAKlD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAQ5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
package/dist/events.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { AgentProviderSchema, AgentReplySchema, AgentSummarySchema, LandConflictSchema, PermissionModeSchema, RateLimitInfoSchema, UsageWindowSchema, } from "./schemas.js";
2
+ import { AgentProviderSchema, AgentReplySchema, AgentSummarySchema, LandConflictSchema, PermissionModeSchema, RateLimitInfoSchema, SubagentKindSchema, SubagentStatusSchema, UsageWindowSchema, } from "./schemas.js";
3
3
  export const AskOptionSchema = z.object({
4
4
  label: z.string(),
5
5
  description: z.string(),
@@ -53,7 +53,7 @@ export const ToolCallContentSchema = z.discriminatedUnion("type", [
53
53
  }),
54
54
  z.object({ type: z.literal("image"), path: z.string() }),
55
55
  ]);
56
- export const RestoredToolCallSchema = z.object({
56
+ export const RestoredToolCallSchema = z.lazy(() => z.object({
57
57
  id: z.string(),
58
58
  name: z.string(),
59
59
  category: ToolKindSchema,
@@ -61,7 +61,9 @@ export const RestoredToolCallSchema = z.object({
61
61
  target: z.string().optional(),
62
62
  locations: z.array(ToolCallLocationSchema).optional(),
63
63
  content: z.array(ToolCallContentSchema).optional(),
64
- });
64
+ children: z.array(RestoredToolCallSchema).optional(),
65
+ thinking: z.string().optional(),
66
+ }));
65
67
  export const RestoredMessageSchema = z.object({
66
68
  role: z.enum(["user", "assistant"]),
67
69
  text: z.string(),
@@ -105,6 +107,26 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
105
107
  }),
106
108
  z.object({ kind: z.literal("terminal"), session: z.string() }),
107
109
  z.object({ kind: z.literal("browser"), session: z.string() }),
110
+ z.object({
111
+ kind: z.literal("subagent"),
112
+ id: z.string(),
113
+ subagentKind: SubagentKindSchema,
114
+ agentType: z.string().optional(),
115
+ description: z.string().optional(),
116
+ model: z.string().optional(),
117
+ background: z.boolean().optional(),
118
+ terminal: z.string().optional(),
119
+ }),
120
+ z.object({
121
+ kind: z.literal("subagent_update"),
122
+ id: z.string(),
123
+ status: SubagentStatusSchema.optional(),
124
+ tokens: z.number().optional(),
125
+ toolUses: z.number().optional(),
126
+ lastTool: z.string().optional(),
127
+ summary: z.string().optional(),
128
+ error: z.string().optional(),
129
+ }),
108
130
  z.object({ kind: z.literal("todos"), items: z.array(TodoItemSchema) }),
109
131
  z.object({ kind: z.literal("commands"), items: z.array(AgentCommandSchema) }),
110
132
  z.object({
@@ -156,7 +178,6 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
156
178
  resetsAt: z.number().optional(),
157
179
  autoResume: z.enum(["scheduled", "available"]).optional(),
158
180
  outage: z.object({ retryAt: z.number(), attempt: z.number(), maxAttempts: z.number() }).optional(),
159
- account: z.string().optional(),
160
181
  }),
161
182
  z.object({ kind: z.literal("done") }),
162
183
  ]);
@@ -165,6 +186,18 @@ export const AttachFrameSchema = z.discriminatedUnion("kind", [
165
186
  z.object({ kind: z.literal("frame"), seq: z.number(), event: AgentEventSchema }),
166
187
  z.object({ kind: z.literal("end") }),
167
188
  ]);
189
+ export const RESUME_NOTES = {
190
+ auth: "The Claude credential that interrupted this conversation has been renewed, and this turn resumed automatically.",
191
+ outage: "The model provider was briefly unavailable and interrupted this conversation; this turn resumed automatically.",
192
+ restart: "The sandbox restarted while this turn was running, which stopped it, and this turn resumed automatically once it came back.",
193
+ };
194
+ export const withResumeNote = (prompt, note) => Object.values(RESUME_NOTES).some((known) => prompt.startsWith(known))
195
+ ? prompt
196
+ : `${note} The interrupted request is repeated below — where part of it was already completed in this session, continue from that point instead of starting over.\n\n${prompt}`;
197
+ export const withoutResumeNote = (prompt) => {
198
+ const note = Object.values(RESUME_NOTES).find((known) => prompt.startsWith(known));
199
+ return note === undefined ? prompt : prompt.slice(prompt.indexOf("\n\n") + 2);
200
+ };
168
201
  export const IntenticLineSchema = z.looseObject({ kind: z.string() });
169
202
  export const HeartbeatSchema = z.object({ kind: z.literal("heartbeat") });
170
203
  export const BootStepSchema = z.object({