@nylorun/core 0.21.0-beta → 0.23.0-beta

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 (74) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +1 -1
  3. package/dist/compatibility.d.ts +37 -20
  4. package/dist/compatibility.js +38 -21
  5. package/dist/contracts.d.ts +531 -88
  6. package/dist/contracts.js +315 -204
  7. package/dist/define.d.ts +8 -12
  8. package/dist/define.js +7 -11
  9. package/dist/definition/assemble.d.ts +1 -3
  10. package/dist/definition/assemble.js +4 -8
  11. package/dist/definition/bound.d.ts +1 -1
  12. package/dist/definition/delegate.d.ts +5 -0
  13. package/dist/definition/delegate.js +6 -1
  14. package/dist/definition/from.d.ts +4 -2
  15. package/dist/definition/from.js +11 -29
  16. package/dist/definition/http-tool.d.ts +54 -8
  17. package/dist/definition/http-tool.js +175 -10
  18. package/dist/definition/manifest.d.ts +7 -6
  19. package/dist/definition/manifest.js +7 -6
  20. package/dist/definition/mcp.d.ts +1 -1
  21. package/dist/definition/media-reference.d.ts +2 -11
  22. package/dist/definition/media-reference.js +0 -12
  23. package/dist/definition/model-failure.js +1 -0
  24. package/dist/definition/removed.js +1 -0
  25. package/dist/definition/trace.d.ts +0 -7
  26. package/dist/definition/trace.js +0 -34
  27. package/dist/definition/variant.d.ts +1 -1
  28. package/dist/definition/variant.js +1 -3
  29. package/dist/harness-api/artifacts.d.ts +84 -0
  30. package/dist/harness-api/artifacts.js +128 -0
  31. package/dist/harness-api/gates.d.ts +0 -4
  32. package/dist/harness-api/gates.js +0 -4
  33. package/dist/harness-api/harness-api.schema.json +2422 -924
  34. package/dist/harness-api/index.d.ts +9 -6
  35. package/dist/harness-api/index.js +9 -6
  36. package/dist/harness-api/json-schema.js +5 -2
  37. package/dist/harness-api/mcp.d.ts +77 -30
  38. package/dist/harness-api/mcp.js +42 -25
  39. package/dist/harness-api/messages.d.ts +45 -17
  40. package/dist/harness-api/messages.js +20 -5
  41. package/dist/harness-api/schema.d.ts +538 -198
  42. package/dist/harness-api/schema.js +298 -59
  43. package/dist/harness-api/transcript.d.ts +8 -10
  44. package/dist/harness-api/transcript.js +27 -11
  45. package/dist/harness-api/transport.d.ts +7 -1
  46. package/dist/harness-api/transport.js +10 -7
  47. package/dist/manifest-schemas.js +14 -2
  48. package/dist/schemas/agent-manifest.schema.json +14 -147
  49. package/dist/schemas/environment-manifest.schema.json +76 -16
  50. package/dist/types/manifest.d.ts +17 -18
  51. package/dist/types/model.d.ts +10 -5
  52. package/dist/utils/definition-files.d.ts +20 -6
  53. package/dist/utils/definition-files.js +31 -17
  54. package/dist/utils/file-systems.d.ts +20 -0
  55. package/dist/utils/file-systems.js +20 -0
  56. package/dist/utils/harness-id.d.ts +4 -1
  57. package/dist/utils/harness-id.js +4 -1
  58. package/dist/utils/media-types.d.ts +30 -0
  59. package/dist/utils/media-types.js +128 -0
  60. package/dist/utils/runtime-limits.d.ts +229 -0
  61. package/dist/utils/runtime-limits.js +482 -0
  62. package/dist/utils/runtime-tools.d.ts +8 -16
  63. package/dist/utils/runtime-tools.js +8 -27
  64. package/dist/utils/sandbox.d.ts +4 -1
  65. package/dist/utils/sandbox.js +4 -1
  66. package/package.json +1 -1
  67. package/dist/definition/deferred-tools.d.ts +0 -27
  68. package/dist/definition/deferred-tools.js +0 -82
  69. package/dist/definition/runtime-manifest.d.ts +0 -30
  70. package/dist/definition/runtime-manifest.js +0 -132
  71. package/dist/definition/sandbox-tools.d.ts +0 -5
  72. package/dist/definition/sandbox-tools.js +0 -109
  73. package/dist/definition/skill-tools.d.ts +0 -23
  74. package/dist/definition/skill-tools.js +0 -76
@@ -5,12 +5,45 @@
5
5
  * checked by the engine and the record, not here.
6
6
  */
7
7
  import { z } from "zod";
8
- /** The payload of one `transcript.updated` event. */
9
- export declare const TranscriptUpdateSchema: z.ZodObject<{
8
+ /**
9
+ * What a harness says of a compaction it made (protocol 15): why, its estimated tokens before and
10
+ * after, and the model calls of this turn that wrote the summary (`purpose: "summary"`), in
11
+ * order. Core checks them and writes one `context.compacted` from them and the last call.
12
+ */
13
+ export declare const CompactionFactsSchema: z.ZodObject<{
14
+ trigger: z.ZodEnum<{
15
+ overflow: "overflow";
16
+ threshold: "threshold";
17
+ }>;
18
+ tokensBefore: z.ZodNumber;
19
+ tokensAfter: z.ZodNumber;
20
+ summaryEffectIds: z.ZodArray<z.ZodString>;
21
+ }, z.core.$strict>;
22
+ /**
23
+ * The payload of one `transcript.updated` event: keep the first `keep` entries, append `entries`,
24
+ * giving `length` entries. A harness that replaced older history with a summary marks the edit
25
+ * `kind: "compaction"` with its facts (the first chunk of the edit; the record never parses the
26
+ * entries to find one).
27
+ */
28
+ export declare const TranscriptUpdateSchema: z.ZodUnion<readonly [z.ZodObject<{
10
29
  keep: z.ZodNumber;
11
30
  entries: z.ZodArray<z.ZodUnknown>;
12
31
  length: z.ZodNumber;
13
- }, z.core.$strict>;
32
+ }, z.core.$strict>, z.ZodObject<{
33
+ keep: z.ZodNumber;
34
+ entries: z.ZodArray<z.ZodUnknown>;
35
+ length: z.ZodNumber;
36
+ kind: z.ZodLiteral<"compaction">;
37
+ compaction: z.ZodObject<{
38
+ trigger: z.ZodEnum<{
39
+ overflow: "overflow";
40
+ threshold: "threshold";
41
+ }>;
42
+ tokensBefore: z.ZodNumber;
43
+ tokensAfter: z.ZodNumber;
44
+ summaryEffectIds: z.ZodArray<z.ZodString>;
45
+ }, z.core.$strict>;
46
+ }, z.core.$strict>]>;
14
47
  export declare const FrameSchema: z.ZodUnion<readonly [z.ZodObject<{
15
48
  t: z.ZodLiteral<"req">;
16
49
  id: z.ZodNumber;
@@ -30,6 +63,8 @@ export declare const FrameSchema: z.ZodUnion<readonly [z.ZodObject<{
30
63
  effect_drift: "effect_drift";
31
64
  internal: "internal";
32
65
  invalid: "invalid";
66
+ limit_exceeded: "limit_exceeded";
67
+ not_found: "not_found";
33
68
  ownership_lost: "ownership_lost";
34
69
  run_not_held: "run_not_held";
35
70
  turn_cancelled: "turn_cancelled";
@@ -47,12 +82,57 @@ export declare const FrameSchema: z.ZodUnion<readonly [z.ZodObject<{
47
82
  }, z.core.$strict>, z.ZodObject<{
48
83
  t: z.ZodLiteral<"ping">;
49
84
  }, z.core.$strict>]>;
85
+ /**
86
+ * What a tool call runs (protocol 15). The record routes a call by its target, never by the
87
+ * tool's name: the name the model used (`toolName`) is for display, and no name is reserved.
88
+ *
89
+ * - `mcp`: the tool `tool` (its own name on the server) of the MCP server `server` that the call's
90
+ * agent declares (`effect.agent`, absent for the root), as the session discovered it
91
+ * (`turn.start.mcp`); the harness calls it through the Tool Gate. The record refuses one the
92
+ * session did not discover (`tool.unknown`) or the turn disables (`tool.disabled`).
93
+ * - `http`: the HTTP tool the agent declares as `tool`; the harness calls it through the Tool Gate.
94
+ * - `sandbox`: one of the sandbox operations (`bash`, `read`, `write`, `edit`, `grep`, `glob`,
95
+ * named by `toolName`) in the session's sandbox, which the harness runs. Only a session with a
96
+ * sandbox runs one.
97
+ * - `harness`: a tool the harness runs in its own process over the Harness API's seams, such as
98
+ * our engine's `load_skill`, `read_artifact` and `tool_search`. Its egress gate is its only
99
+ * control.
100
+ *
101
+ * Tool policy and approval key on the identity (`server` and `tool`, or the HTTP tool's declared
102
+ * name), never on the model's name. A tool call without a target, or with one the session lacks,
103
+ * fails to the model (`tool.unavailable`), and nothing runs.
104
+ */
105
+ export declare const EffectTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
+ kind: z.ZodLiteral<"mcp">;
107
+ server: z.ZodString;
108
+ tool: z.ZodString;
109
+ }, z.core.$strict>, z.ZodObject<{
110
+ kind: z.ZodLiteral<"http">;
111
+ tool: z.ZodString;
112
+ }, z.core.$strict>, z.ZodObject<{
113
+ kind: z.ZodLiteral<"sandbox">;
114
+ }, z.core.$strict>, z.ZodObject<{
115
+ kind: z.ZodLiteral<"harness">;
116
+ }, z.core.$strict>], "kind">;
50
117
  /**
51
118
  * One effect the engine asks for: a `HostEffect`, by structure. Model intents carry no `input`.
52
119
  * `context` carries the ids the record derives its events from: a model effect's
53
120
  * `invocationId` (the step), and a tool effect's `callId` (the model's tool call id) and
54
121
  * `invocationId`; without them the call is journaled but no `tool.completed` is written. A
55
- * tool effect may name its step (`stepId`), which shares one result budget among its calls.
122
+ * tool effect may name its step (`stepId`).
123
+ *
124
+ * A model effect that writes a compaction's summary says so (`purpose: "summary"`): it is no
125
+ * assistant message, and the compaction edit that follows names it (`CompactionFactsSchema`).
126
+ *
127
+ * An agent's tool effect names its `target` (what runs it: for an MCP or HTTP tool, its
128
+ * identity) beside the name the model used (`toolName`, for display), and may name the `skill` it
129
+ * ran (a skill tool's skill, or a sandbox call in a skill's folder): the record keeps the skill,
130
+ * and the plugin that brought it, when the agent has that skill. The target is in the request
131
+ * hash, so a replay that names another tool is `effect_drift`.
132
+ *
133
+ * Each outcome the harness reports is one record entry: past `turn.start.limits.recordEntryBytes`
134
+ * it is refused (`limit_exceeded`), so a harness stores a large tool result with
135
+ * `artifact.write` and reports a preview.
56
136
  *
57
137
  * `requestHash` (`effectRequestHash`) covers the whole request: for a model effect, the intent
58
138
  * with `input` set to its `ModelCall`, though the intent is sent without it. A replay that asks
@@ -76,6 +156,20 @@ export declare const EffectIntentSchema: z.ZodObject<{
76
156
  delegationId: z.ZodOptional<z.ZodString>;
77
157
  }, z.core.$strict>>;
78
158
  toolName: z.ZodOptional<z.ZodString>;
159
+ target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
160
+ kind: z.ZodLiteral<"mcp">;
161
+ server: z.ZodString;
162
+ tool: z.ZodString;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ kind: z.ZodLiteral<"http">;
165
+ tool: z.ZodString;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ kind: z.ZodLiteral<"sandbox">;
168
+ }, z.core.$strict>, z.ZodObject<{
169
+ kind: z.ZodLiteral<"harness">;
170
+ }, z.core.$strict>], "kind">>;
171
+ skill: z.ZodOptional<z.ZodString>;
172
+ purpose: z.ZodOptional<z.ZodLiteral<"summary">>;
79
173
  path: z.ZodOptional<z.ZodString>;
80
174
  key: z.ZodOptional<z.ZodString>;
81
175
  iterations: z.ZodOptional<z.ZodString>;
@@ -91,6 +185,24 @@ export declare const RecordedOutcomeSchema: z.ZodObject<{
91
185
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
92
186
  }, z.core.$strict>;
93
187
  }, z.core.$strict>;
188
+ /**
189
+ * An artifact as the artifact seam shows it to a harness: one version of a file (or a folder,
190
+ * whose bytes the seam does not serve). `tenantWide` marks a Tenant-wide artifact (no session),
191
+ * which the run reads only because the session's messages named it.
192
+ */
193
+ export declare const ArtifactMetaSchema: z.ZodObject<{
194
+ artifactId: z.ZodString;
195
+ kind: z.ZodEnum<{
196
+ file: "file";
197
+ folder: "folder";
198
+ }>;
199
+ name: z.ZodString;
200
+ version: z.ZodNumber;
201
+ contentType: z.ZodString;
202
+ size: z.ZodNumber;
203
+ sha256: z.ZodString;
204
+ tenantWide: z.ZodBoolean;
205
+ }, z.core.$strict>;
94
206
  /** A workspace's compute record, as the harness keeps it. */
95
207
  export declare const WorkspaceRecordSchema: z.ZodObject<{
96
208
  key: z.ZodString;
@@ -130,40 +242,6 @@ export declare const WorkspaceCallSchema: z.ZodObject<{
130
242
  }>;
131
243
  input: z.ZodUnknown;
132
244
  }, z.core.$strict>;
133
- /**
134
- * A file of a workspace read as bytes (`save_artifact`, F8.1), at most `maxBytes`. The answer is
135
- * `{kind: "read", path, base64}`, `{kind: "missing", path}` or a failed tool outcome.
136
- */
137
- export declare const WorkspaceBytesCallSchema: z.ZodObject<{
138
- session: z.ZodObject<{
139
- ownerId: z.ZodString;
140
- environmentId: z.ZodOptional<z.ZodString>;
141
- activeTurnId: z.ZodNullable<z.ZodString>;
142
- }, z.core.$strict>;
143
- spec: z.ZodUnknown;
144
- bytes: z.ZodObject<{
145
- path: z.ZodString;
146
- maxBytes: z.ZodNumber;
147
- }, z.core.$strict>;
148
- }, z.core.$strict>;
149
- /**
150
- * The regular files under a directory of a workspace, recursively, at most `maxEntries + 1`
151
- * (the turn-end export, F8.2). The answer is `{kind: "listed", path, listing: {entries,
152
- * truncated}}`, `{kind: "missing", path}` (no sandbox yet, or not a directory) or a failed tool
153
- * outcome.
154
- */
155
- export declare const WorkspaceListCallSchema: z.ZodObject<{
156
- session: z.ZodObject<{
157
- ownerId: z.ZodString;
158
- environmentId: z.ZodOptional<z.ZodString>;
159
- activeTurnId: z.ZodNullable<z.ZodString>;
160
- }, z.core.$strict>;
161
- spec: z.ZodUnknown;
162
- list: z.ZodObject<{
163
- dir: z.ZodString;
164
- maxEntries: z.ZodNumber;
165
- }, z.core.$strict>;
166
- }, z.core.$strict>;
167
245
  /**
168
246
  * One operation on the disk of a workspace (R2d step 3): `list` its entries (files with mode and
169
247
  * modification time, links, empty directories; paths relative to the volume, `workspace/…` and
@@ -245,29 +323,6 @@ export declare const RunGrantSchema: z.ZodObject<{
245
323
  /** Where a harness sends the session's tool calls. */
246
324
  export declare const RunRoutingSchema: z.ZodObject<{
247
325
  rootManifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
248
- mcpSnapshot: z.ZodOptional<z.ZodObject<{
249
- snapshotSchemaVersion: z.ZodLiteral<1>;
250
- manifestHash: z.ZodString;
251
- mcpTools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
252
- agentId: z.ZodOptional<z.ZodString>;
253
- serverName: z.ZodString;
254
- serverToolName: z.ZodString;
255
- name: z.ZodString;
256
- description: z.ZodOptional<z.ZodString>;
257
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
258
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
259
- annotations: z.ZodOptional<z.ZodObject<{
260
- readOnlyHint: z.ZodOptional<z.ZodBoolean>;
261
- idempotentHint: z.ZodOptional<z.ZodBoolean>;
262
- }, z.core.$strip>>;
263
- deferred: z.ZodOptional<z.ZodLiteral<true>>;
264
- }, z.core.$strip>>>;
265
- servers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
266
- agentId: z.ZodOptional<z.ZodString>;
267
- serverName: z.ZodString;
268
- instructions: z.ZodString;
269
- }, z.core.$strip>>>>;
270
- }, z.core.$strip>>;
271
326
  sandbox: z.ZodOptional<z.ZodObject<{
272
327
  ownerId: z.ZodString;
273
328
  environmentId: z.ZodOptional<z.ZodString>;
@@ -281,7 +336,7 @@ export declare const RunRoutingSchema: z.ZodObject<{
281
336
  * metadata?}` with user content parts, `{kind: "continue"}` for the next segment of a yielded
282
337
  * turn, or an approval or response event. Effect ids are prefixed `<turnId>:<segment>:`
283
338
  * (`effectIdOf`), and every intent carries `manifestHash`. `state` is the harness's own, as its
284
- * last output left it: core stores it unread (at most `MAX_HARNESS_STATE_BYTES` for a harness
339
+ * last output left it: core stores it unread (at most `limits.harnessStateBytes` for a harness
285
340
  * other than ours) and folds the transcript every segment, whatever the state holds. A model
286
341
  * call's `executionId` is the session id.
287
342
  */
@@ -299,15 +354,43 @@ export declare const TraceContextSchema: z.ZodObject<{
299
354
  tracestate: z.ZodOptional<z.ZodString>;
300
355
  }, z.core.$strict>;
301
356
  /**
302
- * A tool a harness runs itself (R4.2, Q3), declared in `hello`: the model may call it, and the
303
- * harness journals each call as a `tool` effect with intent and outcome, like a sandbox tool, so
304
- * the log records what really ran. Its name may not be one the agent or the Runtime already uses. It runs in
305
- * the harness's own process or pod: the egress gate is its only control.
357
+ * The model a turn's calls use when they name none (protocol 15): the Tenant's model, as the
358
+ * Model Gate resolves it. `provider` and `id` name it (`fixture` for the fixture model); `inputs`
359
+ * is what it reads, text first, in `MODEL_INPUTS` order (its catalog's inputs and the operator's
360
+ * additions); `contextWindow` and `maxOutputTokens` are in tokens. A harness decides from it how
361
+ * each file reaches the model; the gate refuses a part the model cannot take
362
+ * (`unsupported_input`).
306
363
  */
307
- export declare const NativeToolSchema: z.ZodObject<{
308
- name: z.ZodString;
309
- description: z.ZodOptional<z.ZodString>;
310
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
364
+ export declare const ModelDescriptorSchema: z.ZodObject<{
365
+ provider: z.ZodString;
366
+ id: z.ZodString;
367
+ inputs: z.ZodArray<z.ZodEnum<{
368
+ audio: "audio";
369
+ image: "image";
370
+ office: "office";
371
+ pdf: "pdf";
372
+ text: "text";
373
+ video: "video";
374
+ }>>;
375
+ contextWindow: z.ZodNumber;
376
+ maxOutputTokens: z.ZodNumber;
377
+ reasoning: z.ZodOptional<z.ZodBoolean>;
378
+ }, z.core.$strict>;
379
+ /**
380
+ * The Environment a turn runs in (protocol 15): its id and kind and, when the session has a
381
+ * sandbox, the workspace its commands start in. A harness writes the model's instructions and
382
+ * defines its sandbox tools from it; the sandbox's spec is the routing's (`routing.sandbox.spec`).
383
+ */
384
+ export declare const TurnEnvironmentSchema: z.ZodObject<{
385
+ id: z.ZodString;
386
+ kind: z.ZodEnum<{
387
+ none: "none";
388
+ pod: "pod";
389
+ virtual: "virtual";
390
+ }>;
391
+ sandbox: z.ZodOptional<z.ZodObject<{
392
+ workspace: z.ZodString;
393
+ }, z.core.$strict>>;
311
394
  }, z.core.$strict>;
312
395
  /** What a run starts from: `turn.start` (message, continue, resume) or `approval.answer`. */
313
396
  export declare const TurnStartSchema: z.ZodObject<{
@@ -321,7 +404,22 @@ export declare const TurnStartSchema: z.ZodObject<{
321
404
  }>;
322
405
  manifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
323
406
  checkpoint: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
324
- sessionTools: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnknown>>>;
407
+ mcp: z.ZodOptional<z.ZodObject<{
408
+ servers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
409
+ agentId: z.ZodOptional<z.ZodString>;
410
+ name: z.ZodString;
411
+ instructions: z.ZodOptional<z.ZodString>;
412
+ tools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
413
+ name: z.ZodString;
414
+ description: z.ZodOptional<z.ZodString>;
415
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
416
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
417
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
418
+ enabled: z.ZodBoolean;
419
+ deferred: z.ZodOptional<z.ZodBoolean>;
420
+ }, z.core.$strip>>>;
421
+ }, z.core.$strip>>>;
422
+ }, z.core.$strip>>;
325
423
  outcomes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
326
424
  effectId: z.ZodString;
327
425
  requestHash: z.ZodString;
@@ -343,29 +441,6 @@ export declare const TurnStartSchema: z.ZodObject<{
343
441
  }, z.core.$strict>;
344
442
  routing: z.ZodObject<{
345
443
  rootManifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
346
- mcpSnapshot: z.ZodOptional<z.ZodObject<{
347
- snapshotSchemaVersion: z.ZodLiteral<1>;
348
- manifestHash: z.ZodString;
349
- mcpTools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
350
- agentId: z.ZodOptional<z.ZodString>;
351
- serverName: z.ZodString;
352
- serverToolName: z.ZodString;
353
- name: z.ZodString;
354
- description: z.ZodOptional<z.ZodString>;
355
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
356
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
357
- annotations: z.ZodOptional<z.ZodObject<{
358
- readOnlyHint: z.ZodOptional<z.ZodBoolean>;
359
- idempotentHint: z.ZodOptional<z.ZodBoolean>;
360
- }, z.core.$strip>>;
361
- deferred: z.ZodOptional<z.ZodLiteral<true>>;
362
- }, z.core.$strip>>>;
363
- servers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
364
- agentId: z.ZodOptional<z.ZodString>;
365
- serverName: z.ZodString;
366
- instructions: z.ZodString;
367
- }, z.core.$strip>>>>;
368
- }, z.core.$strip>>;
369
444
  sandbox: z.ZodOptional<z.ZodObject<{
370
445
  ownerId: z.ZodString;
371
446
  environmentId: z.ZodOptional<z.ZodString>;
@@ -377,6 +452,41 @@ export declare const TurnStartSchema: z.ZodObject<{
377
452
  traceparent: z.ZodString;
378
453
  tracestate: z.ZodOptional<z.ZodString>;
379
454
  }, z.core.$strict>>;
455
+ limits: z.ZodObject<{
456
+ recordEntryBytes: z.ZodNumber;
457
+ modelCallBytes: z.ZodNumber;
458
+ modelFileBytes: z.ZodNumber;
459
+ toolAnswerBytes: z.ZodNumber;
460
+ harnessStateBytes: z.ZodNumber;
461
+ chunkBytes: z.ZodNumber;
462
+ folderEntries: z.ZodNumber;
463
+ }, z.core.$strip>;
464
+ model: z.ZodOptional<z.ZodObject<{
465
+ provider: z.ZodString;
466
+ id: z.ZodString;
467
+ inputs: z.ZodArray<z.ZodEnum<{
468
+ audio: "audio";
469
+ image: "image";
470
+ office: "office";
471
+ pdf: "pdf";
472
+ text: "text";
473
+ video: "video";
474
+ }>>;
475
+ contextWindow: z.ZodNumber;
476
+ maxOutputTokens: z.ZodNumber;
477
+ reasoning: z.ZodOptional<z.ZodBoolean>;
478
+ }, z.core.$strict>>;
479
+ environment: z.ZodOptional<z.ZodObject<{
480
+ id: z.ZodString;
481
+ kind: z.ZodEnum<{
482
+ none: "none";
483
+ pod: "pod";
484
+ virtual: "virtual";
485
+ }>;
486
+ sandbox: z.ZodOptional<z.ZodObject<{
487
+ workspace: z.ZodString;
488
+ }, z.core.$strict>>;
489
+ }, z.core.$strict>>;
380
490
  }, z.core.$strict>;
381
491
  /**
382
492
  * A segment's end. `state` is the harness's state for the next segment (our engine's has no
@@ -405,11 +515,25 @@ export declare const TurnOutputSchema: z.ZodObject<{
405
515
  error: z.ZodOptional<z.ZodUnknown>;
406
516
  effectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
407
517
  cancelEffectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
408
- transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
518
+ transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
409
519
  keep: z.ZodNumber;
410
520
  entries: z.ZodArray<z.ZodUnknown>;
411
521
  length: z.ZodNumber;
412
- }, z.core.$strict>>>>;
522
+ }, z.core.$strict>, z.ZodObject<{
523
+ keep: z.ZodNumber;
524
+ entries: z.ZodArray<z.ZodUnknown>;
525
+ length: z.ZodNumber;
526
+ kind: z.ZodLiteral<"compaction">;
527
+ compaction: z.ZodObject<{
528
+ trigger: z.ZodEnum<{
529
+ overflow: "overflow";
530
+ threshold: "threshold";
531
+ }>;
532
+ tokensBefore: z.ZodNumber;
533
+ tokensAfter: z.ZodNumber;
534
+ summaryEffectIds: z.ZodArray<z.ZodString>;
535
+ }, z.core.$strict>;
536
+ }, z.core.$strict>]>>>>;
413
537
  thrown: z.ZodOptional<z.ZodObject<{
414
538
  code: z.ZodOptional<z.ZodString>;
415
539
  message: z.ZodString;
@@ -471,15 +595,10 @@ export declare const harnessRequests: {
471
595
  version: z.ZodString;
472
596
  features: z.ZodObject<{
473
597
  workspace: z.ZodOptional<z.ZodUnknown>;
474
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
475
- name: z.ZodString;
476
- description: z.ZodOptional<z.ZodString>;
477
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
478
- }, z.core.$strict>>>;
479
598
  }, z.core.$strict>;
480
599
  }, z.core.$strict>;
481
600
  result: z.ZodObject<{
482
- api: z.ZodLiteral<3>;
601
+ api: z.ZodLiteral<4>;
483
602
  tenantId: z.ZodString;
484
603
  sandbox: z.ZodObject<{
485
604
  backend: z.ZodNullable<z.ZodString>;
@@ -511,7 +630,22 @@ export declare const harnessRequests: {
511
630
  }>;
512
631
  manifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
513
632
  checkpoint: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
514
- sessionTools: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnknown>>>;
633
+ mcp: z.ZodOptional<z.ZodObject<{
634
+ servers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
635
+ agentId: z.ZodOptional<z.ZodString>;
636
+ name: z.ZodString;
637
+ instructions: z.ZodOptional<z.ZodString>;
638
+ tools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
639
+ name: z.ZodString;
640
+ description: z.ZodOptional<z.ZodString>;
641
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
642
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
643
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
644
+ enabled: z.ZodBoolean;
645
+ deferred: z.ZodOptional<z.ZodBoolean>;
646
+ }, z.core.$strip>>>;
647
+ }, z.core.$strip>>>;
648
+ }, z.core.$strip>>;
515
649
  outcomes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
516
650
  effectId: z.ZodString;
517
651
  requestHash: z.ZodString;
@@ -533,29 +667,6 @@ export declare const harnessRequests: {
533
667
  }, z.core.$strict>;
534
668
  routing: z.ZodObject<{
535
669
  rootManifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
536
- mcpSnapshot: z.ZodOptional<z.ZodObject<{
537
- snapshotSchemaVersion: z.ZodLiteral<1>;
538
- manifestHash: z.ZodString;
539
- mcpTools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
540
- agentId: z.ZodOptional<z.ZodString>;
541
- serverName: z.ZodString;
542
- serverToolName: z.ZodString;
543
- name: z.ZodString;
544
- description: z.ZodOptional<z.ZodString>;
545
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
546
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
547
- annotations: z.ZodOptional<z.ZodObject<{
548
- readOnlyHint: z.ZodOptional<z.ZodBoolean>;
549
- idempotentHint: z.ZodOptional<z.ZodBoolean>;
550
- }, z.core.$strip>>;
551
- deferred: z.ZodOptional<z.ZodLiteral<true>>;
552
- }, z.core.$strip>>>;
553
- servers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
554
- agentId: z.ZodOptional<z.ZodString>;
555
- serverName: z.ZodString;
556
- instructions: z.ZodString;
557
- }, z.core.$strip>>>>;
558
- }, z.core.$strip>>;
559
670
  sandbox: z.ZodOptional<z.ZodObject<{
560
671
  ownerId: z.ZodString;
561
672
  environmentId: z.ZodOptional<z.ZodString>;
@@ -567,6 +678,41 @@ export declare const harnessRequests: {
567
678
  traceparent: z.ZodString;
568
679
  tracestate: z.ZodOptional<z.ZodString>;
569
680
  }, z.core.$strict>>;
681
+ limits: z.ZodObject<{
682
+ recordEntryBytes: z.ZodNumber;
683
+ modelCallBytes: z.ZodNumber;
684
+ modelFileBytes: z.ZodNumber;
685
+ toolAnswerBytes: z.ZodNumber;
686
+ harnessStateBytes: z.ZodNumber;
687
+ chunkBytes: z.ZodNumber;
688
+ folderEntries: z.ZodNumber;
689
+ }, z.core.$strip>;
690
+ model: z.ZodOptional<z.ZodObject<{
691
+ provider: z.ZodString;
692
+ id: z.ZodString;
693
+ inputs: z.ZodArray<z.ZodEnum<{
694
+ audio: "audio";
695
+ image: "image";
696
+ office: "office";
697
+ pdf: "pdf";
698
+ text: "text";
699
+ video: "video";
700
+ }>>;
701
+ contextWindow: z.ZodNumber;
702
+ maxOutputTokens: z.ZodNumber;
703
+ reasoning: z.ZodOptional<z.ZodBoolean>;
704
+ }, z.core.$strict>>;
705
+ environment: z.ZodOptional<z.ZodObject<{
706
+ id: z.ZodString;
707
+ kind: z.ZodEnum<{
708
+ none: "none";
709
+ pod: "pod";
710
+ virtual: "virtual";
711
+ }>;
712
+ sandbox: z.ZodOptional<z.ZodObject<{
713
+ workspace: z.ZodString;
714
+ }, z.core.$strict>>;
715
+ }, z.core.$strict>>;
570
716
  }, z.core.$strict>;
571
717
  }, z.core.$strict>;
572
718
  };
@@ -614,6 +760,20 @@ export declare const harnessRequests: {
614
760
  delegationId: z.ZodOptional<z.ZodString>;
615
761
  }, z.core.$strict>>;
616
762
  toolName: z.ZodOptional<z.ZodString>;
763
+ target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
764
+ kind: z.ZodLiteral<"mcp">;
765
+ server: z.ZodString;
766
+ tool: z.ZodString;
767
+ }, z.core.$strict>, z.ZodObject<{
768
+ kind: z.ZodLiteral<"http">;
769
+ tool: z.ZodString;
770
+ }, z.core.$strict>, z.ZodObject<{
771
+ kind: z.ZodLiteral<"sandbox">;
772
+ }, z.core.$strict>, z.ZodObject<{
773
+ kind: z.ZodLiteral<"harness">;
774
+ }, z.core.$strict>], "kind">>;
775
+ skill: z.ZodOptional<z.ZodString>;
776
+ purpose: z.ZodOptional<z.ZodLiteral<"summary">>;
617
777
  path: z.ZodOptional<z.ZodString>;
618
778
  key: z.ZodOptional<z.ZodString>;
619
779
  iterations: z.ZodOptional<z.ZodString>;
@@ -674,6 +834,8 @@ export declare const harnessRequests: {
674
834
  sessionId: z.ZodString;
675
835
  turnId: z.ZodNullable<z.ZodString>;
676
836
  type: z.ZodEnum<{
837
+ "artifact.export.failed": "artifact.export.failed";
838
+ "artifact.export.skipped": "artifact.export.skipped";
677
839
  "environment.exec": "environment.exec";
678
840
  "environment.state": "environment.state";
679
841
  }>;
@@ -699,70 +861,201 @@ export declare const harnessRequests: {
699
861
  params: z.ZodObject<{
700
862
  runId: z.ZodString;
701
863
  snapshot: z.ZodOptional<z.ZodObject<{
702
- snapshotSchemaVersion: z.ZodLiteral<1>;
864
+ snapshotSchemaVersion: z.ZodLiteral<2>;
703
865
  manifestHash: z.ZodString;
704
- mcpTools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
866
+ servers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
705
867
  agentId: z.ZodOptional<z.ZodString>;
706
- serverName: z.ZodString;
707
- serverToolName: z.ZodString;
708
868
  name: z.ZodString;
709
- description: z.ZodOptional<z.ZodString>;
710
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
711
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
712
- annotations: z.ZodOptional<z.ZodObject<{
713
- readOnlyHint: z.ZodOptional<z.ZodBoolean>;
714
- idempotentHint: z.ZodOptional<z.ZodBoolean>;
715
- }, z.core.$strip>>;
716
- deferred: z.ZodOptional<z.ZodLiteral<true>>;
869
+ instructions: z.ZodOptional<z.ZodString>;
870
+ tools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
871
+ name: z.ZodString;
872
+ description: z.ZodOptional<z.ZodString>;
873
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
874
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
875
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
876
+ }, z.core.$strip>>>;
717
877
  }, z.core.$strip>>>;
718
- servers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
719
- agentId: z.ZodOptional<z.ZodString>;
720
- serverName: z.ZodString;
721
- instructions: z.ZodString;
722
- }, z.core.$strip>>>>;
723
878
  }, z.core.$strip>>;
724
879
  diagnostics: z.ZodArray<z.ZodUnknown>;
725
880
  }, z.core.$strict>;
726
881
  result: z.ZodObject<{
727
- snapshot: z.ZodOptional<z.ZodObject<{
728
- snapshotSchemaVersion: z.ZodLiteral<1>;
729
- manifestHash: z.ZodString;
730
- mcpTools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
882
+ mcp: z.ZodOptional<z.ZodObject<{
883
+ servers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
731
884
  agentId: z.ZodOptional<z.ZodString>;
732
- serverName: z.ZodString;
733
- serverToolName: z.ZodString;
734
885
  name: z.ZodString;
735
- description: z.ZodOptional<z.ZodString>;
736
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
737
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
738
- annotations: z.ZodOptional<z.ZodObject<{
739
- readOnlyHint: z.ZodOptional<z.ZodBoolean>;
740
- idempotentHint: z.ZodOptional<z.ZodBoolean>;
741
- }, z.core.$strip>>;
742
- deferred: z.ZodOptional<z.ZodLiteral<true>>;
886
+ instructions: z.ZodOptional<z.ZodString>;
887
+ tools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
888
+ name: z.ZodString;
889
+ description: z.ZodOptional<z.ZodString>;
890
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
891
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
892
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
893
+ enabled: z.ZodBoolean;
894
+ deferred: z.ZodOptional<z.ZodBoolean>;
895
+ }, z.core.$strip>>>;
743
896
  }, z.core.$strip>>>;
744
- servers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
745
- agentId: z.ZodOptional<z.ZodString>;
746
- serverName: z.ZodString;
747
- instructions: z.ZodString;
748
- }, z.core.$strip>>>>;
749
897
  }, z.core.$strip>>;
750
- sessionTools: z.ZodArray<z.ZodUnknown>;
751
898
  }, z.core.$strict>;
752
899
  };
753
900
  /**
754
901
  * A definition file's bytes, base64 (track R2 M4): one the run's definition names, for the
755
- * skills its sandbox mounts.
902
+ * skills its sandbox mounts. With `offset` and `length` (at most `turn.start.limits.chunkBytes`,
903
+ * its default without `length`; more is `limit_exceeded`), only those bytes: fewer than
904
+ * `length`, none past the end, once the file ends. Without them the whole file, which must then
905
+ * fit one frame.
756
906
  */
757
907
  "definition.file": {
758
908
  params: z.ZodObject<{
759
909
  runId: z.ZodString;
760
910
  sha256: z.ZodString;
911
+ offset: z.ZodOptional<z.ZodNumber>;
912
+ length: z.ZodOptional<z.ZodNumber>;
761
913
  }, z.core.$strict>;
762
914
  result: z.ZodObject<{
763
915
  base64: z.ZodString;
764
916
  }, z.core.$strict>;
765
917
  };
918
+ /**
919
+ * An artifact the run's session may read (the artifact seam, protocol 15): one of the session's
920
+ * own, or a Tenant-wide one its messages named; anything else is `not_found`, alike. The answer
921
+ * carries the version's metadata (`version`, default the latest) and its bytes from `offset`
922
+ * (default 0), base64: at most `length`, which defaults to and is held to
923
+ * `turn.start.limits.chunkBytes`; `length: 0` asks for the metadata alone. `eof` says no bytes
924
+ * are left past this chunk. A folder answers its metadata, with no bytes.
925
+ */
926
+ "artifact.read": {
927
+ params: z.ZodObject<{
928
+ runId: z.ZodString;
929
+ artifactId: z.ZodString;
930
+ version: z.ZodOptional<z.ZodNumber>;
931
+ offset: z.ZodOptional<z.ZodNumber>;
932
+ length: z.ZodOptional<z.ZodNumber>;
933
+ }, z.core.$strict>;
934
+ result: z.ZodObject<{
935
+ artifact: z.ZodObject<{
936
+ artifactId: z.ZodString;
937
+ kind: z.ZodEnum<{
938
+ file: "file";
939
+ folder: "folder";
940
+ }>;
941
+ name: z.ZodString;
942
+ version: z.ZodNumber;
943
+ contentType: z.ZodString;
944
+ size: z.ZodNumber;
945
+ sha256: z.ZodString;
946
+ tenantWide: z.ZodBoolean;
947
+ }, z.core.$strict>;
948
+ offset: z.ZodNumber;
949
+ base64: z.ZodString;
950
+ eof: z.ZodBoolean;
951
+ }, z.core.$strict>;
952
+ };
953
+ /**
954
+ * Writes a file artifact of the run's session, or a new version of one of its own (the artifact
955
+ * seam, protocol 15), streamed in chunks of at most `turn.start.limits.chunkBytes`:
956
+ *
957
+ * - `begin` opens an upload, answered `open` with its `uploadId` and the most bytes it may hold
958
+ * now (`maxBytes`: the file limit, or the room left in a total). `key` makes the write
959
+ * idempotent within the session: a key already written answers `written` with `created:
960
+ * false` and the version it wrote. With `base64`, the whole body comes in the `begin`, which
961
+ * then commits at once. `effectId` links the artifact to a tool call of the run's turn, whose
962
+ * call id its `artifact.created` event carries.
963
+ * - `chunk` sends the bytes from `offset`, which must equal the bytes received so far; a repeat
964
+ * of the last chunk is answered as before.
965
+ * - `commit` stores the version (`written`); `abort` drops the upload. An upload the run leaves
966
+ * open ends with the run.
967
+ *
968
+ * With `kind: "folder"`, `begin` opens a folder version instead: a new version of the session's
969
+ * folder `artifactId`, or with `sameName` of its newest folder named `name` (made when there is
970
+ * none), or else a new folder. Its answer adds `maxFileBytes` (one file's limit) and
971
+ * `maxEntries` (`limits.folderEntries`); `maxBytes` is the most its files may hold together.
972
+ * Each file starts with `file` (its path in the folder, size and SHA-256, the whole body in
973
+ * `base64` when it fits one chunk), and goes on with `chunk`s naming it by `sha256`, from
974
+ * `offset` within the file. Core always takes every byte, stored or not (it holds content once,
975
+ * by hash), and refuses a file whose bytes do not match its hash (`invalid`; the upload ends).
976
+ * `commit` answers `written` with `unchanged: true` and no new version when the files are the
977
+ * folder's latest version's, and `refused` when a total would be passed.
978
+ */
979
+ "artifact.write": {
980
+ params: z.ZodUnion<readonly [z.ZodObject<{
981
+ runId: z.ZodString;
982
+ op: z.ZodLiteral<"begin">;
983
+ key: z.ZodString;
984
+ artifactId: z.ZodOptional<z.ZodString>;
985
+ name: z.ZodOptional<z.ZodString>;
986
+ contentType: z.ZodOptional<z.ZodString>;
987
+ size: z.ZodOptional<z.ZodNumber>;
988
+ effectId: z.ZodOptional<z.ZodString>;
989
+ base64: z.ZodOptional<z.ZodString>;
990
+ }, z.core.$strict>, z.ZodObject<{
991
+ runId: z.ZodString;
992
+ op: z.ZodLiteral<"begin">;
993
+ kind: z.ZodLiteral<"folder">;
994
+ key: z.ZodString;
995
+ name: z.ZodString;
996
+ artifactId: z.ZodOptional<z.ZodString>;
997
+ sameName: z.ZodOptional<z.ZodLiteral<true>>;
998
+ }, z.core.$strict>, z.ZodObject<{
999
+ runId: z.ZodString;
1000
+ op: z.ZodLiteral<"file">;
1001
+ uploadId: z.ZodString;
1002
+ path: z.ZodString;
1003
+ size: z.ZodNumber;
1004
+ sha256: z.ZodString;
1005
+ contentType: z.ZodOptional<z.ZodString>;
1006
+ base64: z.ZodOptional<z.ZodString>;
1007
+ }, z.core.$strict>, z.ZodObject<{
1008
+ runId: z.ZodString;
1009
+ op: z.ZodLiteral<"chunk">;
1010
+ uploadId: z.ZodString;
1011
+ sha256: z.ZodOptional<z.ZodString>;
1012
+ offset: z.ZodNumber;
1013
+ base64: z.ZodString;
1014
+ }, z.core.$strict>, z.ZodObject<{
1015
+ runId: z.ZodString;
1016
+ op: z.ZodLiteral<"commit">;
1017
+ uploadId: z.ZodString;
1018
+ }, z.core.$strict>, z.ZodObject<{
1019
+ runId: z.ZodString;
1020
+ op: z.ZodLiteral<"abort">;
1021
+ uploadId: z.ZodString;
1022
+ }, z.core.$strict>]>;
1023
+ result: z.ZodUnion<readonly [z.ZodObject<{
1024
+ status: z.ZodLiteral<"open">;
1025
+ uploadId: z.ZodString;
1026
+ maxBytes: z.ZodNumber;
1027
+ maxFileBytes: z.ZodOptional<z.ZodNumber>;
1028
+ maxEntries: z.ZodOptional<z.ZodNumber>;
1029
+ received: z.ZodNumber;
1030
+ }, z.core.$strict>, z.ZodObject<{
1031
+ status: z.ZodLiteral<"written">;
1032
+ artifact: z.ZodObject<{
1033
+ artifactId: z.ZodString;
1034
+ kind: z.ZodEnum<{
1035
+ file: "file";
1036
+ folder: "folder";
1037
+ }>;
1038
+ name: z.ZodString;
1039
+ version: z.ZodNumber;
1040
+ contentType: z.ZodString;
1041
+ size: z.ZodNumber;
1042
+ sha256: z.ZodString;
1043
+ tenantWide: z.ZodBoolean;
1044
+ }, z.core.$strict>;
1045
+ created: z.ZodBoolean;
1046
+ unchanged: z.ZodOptional<z.ZodLiteral<true>>;
1047
+ }, z.core.$strict>, z.ZodObject<{
1048
+ status: z.ZodLiteral<"refused">;
1049
+ reason: z.ZodEnum<{
1050
+ environment_total: "environment_total";
1051
+ tenant_total: "tenant_total";
1052
+ }>;
1053
+ message: z.ZodString;
1054
+ limit: z.ZodNumber;
1055
+ }, z.core.$strict>, z.ZodObject<{
1056
+ status: z.ZodLiteral<"aborted">;
1057
+ }, z.core.$strict>]>;
1058
+ };
766
1059
  "turn.completed": {
767
1060
  params: z.ZodObject<{
768
1061
  runId: z.ZodString;
@@ -781,11 +1074,25 @@ export declare const harnessRequests: {
781
1074
  error: z.ZodOptional<z.ZodUnknown>;
782
1075
  effectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
783
1076
  cancelEffectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
784
- transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1077
+ transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
785
1078
  keep: z.ZodNumber;
786
1079
  entries: z.ZodArray<z.ZodUnknown>;
787
1080
  length: z.ZodNumber;
788
- }, z.core.$strict>>>>;
1081
+ }, z.core.$strict>, z.ZodObject<{
1082
+ keep: z.ZodNumber;
1083
+ entries: z.ZodArray<z.ZodUnknown>;
1084
+ length: z.ZodNumber;
1085
+ kind: z.ZodLiteral<"compaction">;
1086
+ compaction: z.ZodObject<{
1087
+ trigger: z.ZodEnum<{
1088
+ overflow: "overflow";
1089
+ threshold: "threshold";
1090
+ }>;
1091
+ tokensBefore: z.ZodNumber;
1092
+ tokensAfter: z.ZodNumber;
1093
+ summaryEffectIds: z.ZodArray<z.ZodString>;
1094
+ }, z.core.$strict>;
1095
+ }, z.core.$strict>]>>>>;
789
1096
  thrown: z.ZodOptional<z.ZodObject<{
790
1097
  code: z.ZodOptional<z.ZodString>;
791
1098
  message: z.ZodString;
@@ -813,11 +1120,25 @@ export declare const harnessRequests: {
813
1120
  error: z.ZodOptional<z.ZodUnknown>;
814
1121
  effectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
815
1122
  cancelEffectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
816
- transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1123
+ transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
817
1124
  keep: z.ZodNumber;
818
1125
  entries: z.ZodArray<z.ZodUnknown>;
819
1126
  length: z.ZodNumber;
820
- }, z.core.$strict>>>>;
1127
+ }, z.core.$strict>, z.ZodObject<{
1128
+ keep: z.ZodNumber;
1129
+ entries: z.ZodArray<z.ZodUnknown>;
1130
+ length: z.ZodNumber;
1131
+ kind: z.ZodLiteral<"compaction">;
1132
+ compaction: z.ZodObject<{
1133
+ trigger: z.ZodEnum<{
1134
+ overflow: "overflow";
1135
+ threshold: "threshold";
1136
+ }>;
1137
+ tokensBefore: z.ZodNumber;
1138
+ tokensAfter: z.ZodNumber;
1139
+ summaryEffectIds: z.ZodArray<z.ZodString>;
1140
+ }, z.core.$strict>;
1141
+ }, z.core.$strict>]>>>>;
821
1142
  thrown: z.ZodOptional<z.ZodObject<{
822
1143
  code: z.ZodOptional<z.ZodString>;
823
1144
  message: z.ZodString;
@@ -845,11 +1166,25 @@ export declare const harnessRequests: {
845
1166
  error: z.ZodOptional<z.ZodUnknown>;
846
1167
  effectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
847
1168
  cancelEffectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
848
- transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1169
+ transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
849
1170
  keep: z.ZodNumber;
850
1171
  entries: z.ZodArray<z.ZodUnknown>;
851
1172
  length: z.ZodNumber;
852
- }, z.core.$strict>>>>;
1173
+ }, z.core.$strict>, z.ZodObject<{
1174
+ keep: z.ZodNumber;
1175
+ entries: z.ZodArray<z.ZodUnknown>;
1176
+ length: z.ZodNumber;
1177
+ kind: z.ZodLiteral<"compaction">;
1178
+ compaction: z.ZodObject<{
1179
+ trigger: z.ZodEnum<{
1180
+ overflow: "overflow";
1181
+ threshold: "threshold";
1182
+ }>;
1183
+ tokensBefore: z.ZodNumber;
1184
+ tokensAfter: z.ZodNumber;
1185
+ summaryEffectIds: z.ZodArray<z.ZodString>;
1186
+ }, z.core.$strict>;
1187
+ }, z.core.$strict>]>>>>;
853
1188
  thrown: z.ZodOptional<z.ZodObject<{
854
1189
  code: z.ZodOptional<z.ZodString>;
855
1190
  message: z.ZodString;
@@ -877,11 +1212,25 @@ export declare const harnessRequests: {
877
1212
  error: z.ZodOptional<z.ZodUnknown>;
878
1213
  effectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
879
1214
  cancelEffectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
880
- transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1215
+ transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1216
+ keep: z.ZodNumber;
1217
+ entries: z.ZodArray<z.ZodUnknown>;
1218
+ length: z.ZodNumber;
1219
+ }, z.core.$strict>, z.ZodObject<{
881
1220
  keep: z.ZodNumber;
882
1221
  entries: z.ZodArray<z.ZodUnknown>;
883
1222
  length: z.ZodNumber;
884
- }, z.core.$strict>>>>;
1223
+ kind: z.ZodLiteral<"compaction">;
1224
+ compaction: z.ZodObject<{
1225
+ trigger: z.ZodEnum<{
1226
+ overflow: "overflow";
1227
+ threshold: "threshold";
1228
+ }>;
1229
+ tokensBefore: z.ZodNumber;
1230
+ tokensAfter: z.ZodNumber;
1231
+ summaryEffectIds: z.ZodArray<z.ZodString>;
1232
+ }, z.core.$strict>;
1233
+ }, z.core.$strict>]>>>>;
885
1234
  thrown: z.ZodOptional<z.ZodObject<{
886
1235
  code: z.ZodOptional<z.ZodString>;
887
1236
  message: z.ZodString;
@@ -910,11 +1259,25 @@ export declare const harnessRequests: {
910
1259
  error: z.ZodOptional<z.ZodUnknown>;
911
1260
  effectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
912
1261
  cancelEffectIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
913
- transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1262
+ transcript: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1263
+ keep: z.ZodNumber;
1264
+ entries: z.ZodArray<z.ZodUnknown>;
1265
+ length: z.ZodNumber;
1266
+ }, z.core.$strict>, z.ZodObject<{
914
1267
  keep: z.ZodNumber;
915
1268
  entries: z.ZodArray<z.ZodUnknown>;
916
1269
  length: z.ZodNumber;
917
- }, z.core.$strict>>>>;
1270
+ kind: z.ZodLiteral<"compaction">;
1271
+ compaction: z.ZodObject<{
1272
+ trigger: z.ZodEnum<{
1273
+ overflow: "overflow";
1274
+ threshold: "threshold";
1275
+ }>;
1276
+ tokensBefore: z.ZodNumber;
1277
+ tokensAfter: z.ZodNumber;
1278
+ summaryEffectIds: z.ZodArray<z.ZodString>;
1279
+ }, z.core.$strict>;
1280
+ }, z.core.$strict>]>>>>;
918
1281
  thrown: z.ZodOptional<z.ZodObject<{
919
1282
  code: z.ZodOptional<z.ZodString>;
920
1283
  message: z.ZodString;
@@ -928,8 +1291,7 @@ export declare const harnessRequests: {
928
1291
  /**
929
1292
  * Requests core sends to a harness that declared `workspace` (F6.2), with their answers. A
930
1293
  * sandbox tool's answer is its `SandboxToolOutcome`; the harness claims its `environment.*` events
931
- * while the request is in flight. `workspace.read` stays generic: F8.2 exports outputs
932
- * through it.
1294
+ * while the request is in flight.
933
1295
  */
934
1296
  export declare const coreRequests: {
935
1297
  "workspace.read": {
@@ -949,28 +1311,6 @@ export declare const coreRequests: {
949
1311
  write: "write";
950
1312
  }>;
951
1313
  input: z.ZodUnknown;
952
- }, z.core.$strict>, z.ZodObject<{
953
- session: z.ZodObject<{
954
- ownerId: z.ZodString;
955
- environmentId: z.ZodOptional<z.ZodString>;
956
- activeTurnId: z.ZodNullable<z.ZodString>;
957
- }, z.core.$strict>;
958
- spec: z.ZodUnknown;
959
- bytes: z.ZodObject<{
960
- path: z.ZodString;
961
- maxBytes: z.ZodNumber;
962
- }, z.core.$strict>;
963
- }, z.core.$strict>, z.ZodObject<{
964
- session: z.ZodObject<{
965
- ownerId: z.ZodString;
966
- environmentId: z.ZodOptional<z.ZodString>;
967
- activeTurnId: z.ZodNullable<z.ZodString>;
968
- }, z.core.$strict>;
969
- spec: z.ZodUnknown;
970
- list: z.ZodObject<{
971
- dir: z.ZodString;
972
- maxEntries: z.ZodNumber;
973
- }, z.core.$strict>;
974
1314
  }, z.core.$strict>, z.ZodObject<{
975
1315
  session: z.ZodObject<{
976
1316
  ownerId: z.ZodString;