@tokensize/agent-router 0.3.0-beta.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.
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/index.cjs +777 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1464 -0
- package/dist/index.d.ts +1464 -0
- package/dist/index.js +717 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1464 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const AGENT_ROUTER_SCHEMA_VERSION: 2;
|
|
4
|
+
declare const AGENT_ROUTER_VERSION = "2026-07-20-allowance-aware-v2";
|
|
5
|
+
declare const harnessIdSchema: z.ZodEnum<{
|
|
6
|
+
codex: "codex";
|
|
7
|
+
claude: "claude";
|
|
8
|
+
copilot: "copilot";
|
|
9
|
+
cursor: "cursor";
|
|
10
|
+
opencode: "opencode";
|
|
11
|
+
custom: "custom";
|
|
12
|
+
}>;
|
|
13
|
+
declare const readinessSchema: z.ZodEnum<{
|
|
14
|
+
installed: "installed";
|
|
15
|
+
"auth-ready": "auth-ready";
|
|
16
|
+
"model-listed": "model-listed";
|
|
17
|
+
"invocation-compatible": "invocation-compatible";
|
|
18
|
+
"live-confirmed": "live-confirmed";
|
|
19
|
+
}>;
|
|
20
|
+
declare const permissionProfileSchema: z.ZodEnum<{
|
|
21
|
+
inspect: "inspect";
|
|
22
|
+
edit: "edit";
|
|
23
|
+
test: "test";
|
|
24
|
+
network: "network";
|
|
25
|
+
}>;
|
|
26
|
+
declare const taskRoleSchema: z.ZodEnum<{
|
|
27
|
+
inspect: "inspect";
|
|
28
|
+
test: "test";
|
|
29
|
+
plan: "plan";
|
|
30
|
+
implement: "implement";
|
|
31
|
+
review: "review";
|
|
32
|
+
}>;
|
|
33
|
+
declare const taskTypeSchema: z.ZodEnum<{
|
|
34
|
+
test: "test";
|
|
35
|
+
review: "review";
|
|
36
|
+
bug: "bug";
|
|
37
|
+
feature: "feature";
|
|
38
|
+
refactor: "refactor";
|
|
39
|
+
migration: "migration";
|
|
40
|
+
research: "research";
|
|
41
|
+
docs: "docs";
|
|
42
|
+
unknown: "unknown";
|
|
43
|
+
}>;
|
|
44
|
+
declare const routingObjectiveSchema: z.ZodEnum<{
|
|
45
|
+
quality: "quality";
|
|
46
|
+
balanced: "balanced";
|
|
47
|
+
tokens: "tokens";
|
|
48
|
+
latency: "latency";
|
|
49
|
+
}>;
|
|
50
|
+
declare const clientSurfaceSchema: z.ZodEnum<{
|
|
51
|
+
cli: "cli";
|
|
52
|
+
skill: "skill";
|
|
53
|
+
"codex-plugin": "codex-plugin";
|
|
54
|
+
"opencode-plugin": "opencode-plugin";
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* A privacy-safe, point-in-time view of a local harness allowance. Clients
|
|
58
|
+
* derive this through the harness's supported status interface and discard the
|
|
59
|
+
* raw account response. It is routing metadata, never a credential or bill.
|
|
60
|
+
*/
|
|
61
|
+
declare const allowanceSchema: z.ZodObject<{
|
|
62
|
+
status: z.ZodEnum<{
|
|
63
|
+
unknown: "unknown";
|
|
64
|
+
available: "available";
|
|
65
|
+
low: "low";
|
|
66
|
+
exhausted: "exhausted";
|
|
67
|
+
unmetered: "unmetered";
|
|
68
|
+
}>;
|
|
69
|
+
remainingFraction: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
resetsAt: z.ZodOptional<z.ZodISODateTime>;
|
|
71
|
+
observedAt: z.ZodISODateTime;
|
|
72
|
+
source: z.ZodEnum<{
|
|
73
|
+
"runtime-reported": "runtime-reported";
|
|
74
|
+
"credential-free": "credential-free";
|
|
75
|
+
unavailable: "unavailable";
|
|
76
|
+
}>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
declare const agentModelSchema: z.ZodObject<{
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
harness: z.ZodEnum<{
|
|
81
|
+
codex: "codex";
|
|
82
|
+
claude: "claude";
|
|
83
|
+
copilot: "copilot";
|
|
84
|
+
cursor: "cursor";
|
|
85
|
+
opencode: "opencode";
|
|
86
|
+
custom: "custom";
|
|
87
|
+
}>;
|
|
88
|
+
nativeModelId: z.ZodString;
|
|
89
|
+
displayName: z.ZodString;
|
|
90
|
+
readiness: z.ZodEnum<{
|
|
91
|
+
installed: "installed";
|
|
92
|
+
"auth-ready": "auth-ready";
|
|
93
|
+
"model-listed": "model-listed";
|
|
94
|
+
"invocation-compatible": "invocation-compatible";
|
|
95
|
+
"live-confirmed": "live-confirmed";
|
|
96
|
+
}>;
|
|
97
|
+
authMode: z.ZodEnum<{
|
|
98
|
+
unknown: "unknown";
|
|
99
|
+
subscription: "subscription";
|
|
100
|
+
"api-key": "api-key";
|
|
101
|
+
"cloud-provider": "cloud-provider";
|
|
102
|
+
local: "local";
|
|
103
|
+
}>;
|
|
104
|
+
productUseApproved: z.ZodBoolean;
|
|
105
|
+
capabilities: z.ZodObject<{
|
|
106
|
+
tools: z.ZodBoolean;
|
|
107
|
+
vision: z.ZodBoolean;
|
|
108
|
+
structuredOutput: z.ZodEnum<{
|
|
109
|
+
none: "none";
|
|
110
|
+
json: "json";
|
|
111
|
+
jsonl: "jsonl";
|
|
112
|
+
schema: "schema";
|
|
113
|
+
}>;
|
|
114
|
+
sessions: z.ZodEnum<{
|
|
115
|
+
none: "none";
|
|
116
|
+
resume: "resume";
|
|
117
|
+
continue: "continue";
|
|
118
|
+
}>;
|
|
119
|
+
permissions: z.ZodArray<z.ZodEnum<{
|
|
120
|
+
inspect: "inspect";
|
|
121
|
+
edit: "edit";
|
|
122
|
+
test: "test";
|
|
123
|
+
network: "network";
|
|
124
|
+
}>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
identityProof: z.ZodEnum<{
|
|
127
|
+
"runtime-reported": "runtime-reported";
|
|
128
|
+
unavailable: "unavailable";
|
|
129
|
+
requested: "requested";
|
|
130
|
+
}>;
|
|
131
|
+
qualityPrior: z.ZodNumber;
|
|
132
|
+
tokenEfficiencyPrior: z.ZodNumber;
|
|
133
|
+
latencyPrior: z.ZodNumber;
|
|
134
|
+
allowance: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
status: z.ZodEnum<{
|
|
136
|
+
unknown: "unknown";
|
|
137
|
+
available: "available";
|
|
138
|
+
low: "low";
|
|
139
|
+
exhausted: "exhausted";
|
|
140
|
+
unmetered: "unmetered";
|
|
141
|
+
}>;
|
|
142
|
+
remainingFraction: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
resetsAt: z.ZodOptional<z.ZodISODateTime>;
|
|
144
|
+
observedAt: z.ZodISODateTime;
|
|
145
|
+
source: z.ZodEnum<{
|
|
146
|
+
"runtime-reported": "runtime-reported";
|
|
147
|
+
"credential-free": "credential-free";
|
|
148
|
+
unavailable: "unavailable";
|
|
149
|
+
}>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
localHistory: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
verifiedRuns: z.ZodNumber;
|
|
153
|
+
successRate: z.ZodNumber;
|
|
154
|
+
medianTokens: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
declare const agentTaskFeaturesSchema: z.ZodObject<{
|
|
158
|
+
role: z.ZodEnum<{
|
|
159
|
+
inspect: "inspect";
|
|
160
|
+
test: "test";
|
|
161
|
+
plan: "plan";
|
|
162
|
+
implement: "implement";
|
|
163
|
+
review: "review";
|
|
164
|
+
}>;
|
|
165
|
+
type: z.ZodEnum<{
|
|
166
|
+
test: "test";
|
|
167
|
+
review: "review";
|
|
168
|
+
bug: "bug";
|
|
169
|
+
feature: "feature";
|
|
170
|
+
refactor: "refactor";
|
|
171
|
+
migration: "migration";
|
|
172
|
+
research: "research";
|
|
173
|
+
docs: "docs";
|
|
174
|
+
unknown: "unknown";
|
|
175
|
+
}>;
|
|
176
|
+
complexity: z.ZodNumber;
|
|
177
|
+
scopeBreadth: z.ZodNumber;
|
|
178
|
+
contextTokens: z.ZodNumber;
|
|
179
|
+
oracleStrength: z.ZodNumber;
|
|
180
|
+
codeDensity: z.ZodNumber;
|
|
181
|
+
risk: z.ZodEnum<{
|
|
182
|
+
low: "low";
|
|
183
|
+
medium: "medium";
|
|
184
|
+
high: "high";
|
|
185
|
+
critical: "critical";
|
|
186
|
+
}>;
|
|
187
|
+
languages: z.ZodArray<z.ZodString>;
|
|
188
|
+
requiredTools: z.ZodArray<z.ZodString>;
|
|
189
|
+
requiresVision: z.ZodBoolean;
|
|
190
|
+
requiresNetwork: z.ZodBoolean;
|
|
191
|
+
cacheHit: z.ZodBoolean;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
declare const agentRouteRequestSchema: z.ZodObject<{
|
|
194
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
195
|
+
client: z.ZodObject<{
|
|
196
|
+
surface: z.ZodEnum<{
|
|
197
|
+
cli: "cli";
|
|
198
|
+
skill: "skill";
|
|
199
|
+
"codex-plugin": "codex-plugin";
|
|
200
|
+
"opencode-plugin": "opencode-plugin";
|
|
201
|
+
}>;
|
|
202
|
+
version: z.ZodString;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
requestId: z.ZodUUID;
|
|
205
|
+
installationId: z.ZodString;
|
|
206
|
+
routerMode: z.ZodEnum<{
|
|
207
|
+
"metadata-only": "metadata-only";
|
|
208
|
+
"prompt-assisted": "prompt-assisted";
|
|
209
|
+
}>;
|
|
210
|
+
task: z.ZodObject<{
|
|
211
|
+
role: z.ZodEnum<{
|
|
212
|
+
inspect: "inspect";
|
|
213
|
+
test: "test";
|
|
214
|
+
plan: "plan";
|
|
215
|
+
implement: "implement";
|
|
216
|
+
review: "review";
|
|
217
|
+
}>;
|
|
218
|
+
type: z.ZodEnum<{
|
|
219
|
+
test: "test";
|
|
220
|
+
review: "review";
|
|
221
|
+
bug: "bug";
|
|
222
|
+
feature: "feature";
|
|
223
|
+
refactor: "refactor";
|
|
224
|
+
migration: "migration";
|
|
225
|
+
research: "research";
|
|
226
|
+
docs: "docs";
|
|
227
|
+
unknown: "unknown";
|
|
228
|
+
}>;
|
|
229
|
+
complexity: z.ZodNumber;
|
|
230
|
+
scopeBreadth: z.ZodNumber;
|
|
231
|
+
contextTokens: z.ZodNumber;
|
|
232
|
+
oracleStrength: z.ZodNumber;
|
|
233
|
+
codeDensity: z.ZodNumber;
|
|
234
|
+
risk: z.ZodEnum<{
|
|
235
|
+
low: "low";
|
|
236
|
+
medium: "medium";
|
|
237
|
+
high: "high";
|
|
238
|
+
critical: "critical";
|
|
239
|
+
}>;
|
|
240
|
+
languages: z.ZodArray<z.ZodString>;
|
|
241
|
+
requiredTools: z.ZodArray<z.ZodString>;
|
|
242
|
+
requiresVision: z.ZodBoolean;
|
|
243
|
+
requiresNetwork: z.ZodBoolean;
|
|
244
|
+
cacheHit: z.ZodBoolean;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
247
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
248
|
+
id: z.ZodString;
|
|
249
|
+
harness: z.ZodEnum<{
|
|
250
|
+
codex: "codex";
|
|
251
|
+
claude: "claude";
|
|
252
|
+
copilot: "copilot";
|
|
253
|
+
cursor: "cursor";
|
|
254
|
+
opencode: "opencode";
|
|
255
|
+
custom: "custom";
|
|
256
|
+
}>;
|
|
257
|
+
nativeModelId: z.ZodString;
|
|
258
|
+
displayName: z.ZodString;
|
|
259
|
+
readiness: z.ZodEnum<{
|
|
260
|
+
installed: "installed";
|
|
261
|
+
"auth-ready": "auth-ready";
|
|
262
|
+
"model-listed": "model-listed";
|
|
263
|
+
"invocation-compatible": "invocation-compatible";
|
|
264
|
+
"live-confirmed": "live-confirmed";
|
|
265
|
+
}>;
|
|
266
|
+
authMode: z.ZodEnum<{
|
|
267
|
+
unknown: "unknown";
|
|
268
|
+
subscription: "subscription";
|
|
269
|
+
"api-key": "api-key";
|
|
270
|
+
"cloud-provider": "cloud-provider";
|
|
271
|
+
local: "local";
|
|
272
|
+
}>;
|
|
273
|
+
productUseApproved: z.ZodBoolean;
|
|
274
|
+
capabilities: z.ZodObject<{
|
|
275
|
+
tools: z.ZodBoolean;
|
|
276
|
+
vision: z.ZodBoolean;
|
|
277
|
+
structuredOutput: z.ZodEnum<{
|
|
278
|
+
none: "none";
|
|
279
|
+
json: "json";
|
|
280
|
+
jsonl: "jsonl";
|
|
281
|
+
schema: "schema";
|
|
282
|
+
}>;
|
|
283
|
+
sessions: z.ZodEnum<{
|
|
284
|
+
none: "none";
|
|
285
|
+
resume: "resume";
|
|
286
|
+
continue: "continue";
|
|
287
|
+
}>;
|
|
288
|
+
permissions: z.ZodArray<z.ZodEnum<{
|
|
289
|
+
inspect: "inspect";
|
|
290
|
+
edit: "edit";
|
|
291
|
+
test: "test";
|
|
292
|
+
network: "network";
|
|
293
|
+
}>>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
identityProof: z.ZodEnum<{
|
|
296
|
+
"runtime-reported": "runtime-reported";
|
|
297
|
+
unavailable: "unavailable";
|
|
298
|
+
requested: "requested";
|
|
299
|
+
}>;
|
|
300
|
+
qualityPrior: z.ZodNumber;
|
|
301
|
+
tokenEfficiencyPrior: z.ZodNumber;
|
|
302
|
+
latencyPrior: z.ZodNumber;
|
|
303
|
+
allowance: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
status: z.ZodEnum<{
|
|
305
|
+
unknown: "unknown";
|
|
306
|
+
available: "available";
|
|
307
|
+
low: "low";
|
|
308
|
+
exhausted: "exhausted";
|
|
309
|
+
unmetered: "unmetered";
|
|
310
|
+
}>;
|
|
311
|
+
remainingFraction: z.ZodOptional<z.ZodNumber>;
|
|
312
|
+
resetsAt: z.ZodOptional<z.ZodISODateTime>;
|
|
313
|
+
observedAt: z.ZodISODateTime;
|
|
314
|
+
source: z.ZodEnum<{
|
|
315
|
+
"runtime-reported": "runtime-reported";
|
|
316
|
+
"credential-free": "credential-free";
|
|
317
|
+
unavailable: "unavailable";
|
|
318
|
+
}>;
|
|
319
|
+
}, z.core.$strip>>;
|
|
320
|
+
localHistory: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
verifiedRuns: z.ZodNumber;
|
|
322
|
+
successRate: z.ZodNumber;
|
|
323
|
+
medianTokens: z.ZodOptional<z.ZodNumber>;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
}, z.core.$strip>>;
|
|
326
|
+
root: z.ZodObject<{
|
|
327
|
+
harness: z.ZodEnum<{
|
|
328
|
+
codex: "codex";
|
|
329
|
+
claude: "claude";
|
|
330
|
+
copilot: "copilot";
|
|
331
|
+
cursor: "cursor";
|
|
332
|
+
opencode: "opencode";
|
|
333
|
+
custom: "custom";
|
|
334
|
+
}>;
|
|
335
|
+
active: z.ZodBoolean;
|
|
336
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
337
|
+
qualityPrior: z.ZodDefault<z.ZodNumber>;
|
|
338
|
+
allowance: z.ZodOptional<z.ZodObject<{
|
|
339
|
+
status: z.ZodEnum<{
|
|
340
|
+
unknown: "unknown";
|
|
341
|
+
available: "available";
|
|
342
|
+
low: "low";
|
|
343
|
+
exhausted: "exhausted";
|
|
344
|
+
unmetered: "unmetered";
|
|
345
|
+
}>;
|
|
346
|
+
remainingFraction: z.ZodOptional<z.ZodNumber>;
|
|
347
|
+
resetsAt: z.ZodOptional<z.ZodISODateTime>;
|
|
348
|
+
observedAt: z.ZodISODateTime;
|
|
349
|
+
source: z.ZodEnum<{
|
|
350
|
+
"runtime-reported": "runtime-reported";
|
|
351
|
+
"credential-free": "credential-free";
|
|
352
|
+
unavailable: "unavailable";
|
|
353
|
+
}>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
policy: z.ZodObject<{
|
|
357
|
+
objective: z.ZodEnum<{
|
|
358
|
+
quality: "quality";
|
|
359
|
+
balanced: "balanced";
|
|
360
|
+
tokens: "tokens";
|
|
361
|
+
latency: "latency";
|
|
362
|
+
}>;
|
|
363
|
+
maxDelegationDepth: z.ZodNumber;
|
|
364
|
+
delegationDepth: z.ZodNumber;
|
|
365
|
+
allowedHarnesses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
366
|
+
codex: "codex";
|
|
367
|
+
claude: "claude";
|
|
368
|
+
copilot: "copilot";
|
|
369
|
+
cursor: "cursor";
|
|
370
|
+
opencode: "opencode";
|
|
371
|
+
custom: "custom";
|
|
372
|
+
}>>>;
|
|
373
|
+
permissionCeiling: z.ZodEnum<{
|
|
374
|
+
inspect: "inspect";
|
|
375
|
+
edit: "edit";
|
|
376
|
+
test: "test";
|
|
377
|
+
network: "network";
|
|
378
|
+
}>;
|
|
379
|
+
tokenBudget: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
wallTimeBudgetMs: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
declare const workflowSchema: z.ZodEnum<{
|
|
384
|
+
"root-only": "root-only";
|
|
385
|
+
"single-inspector": "single-inspector";
|
|
386
|
+
"single-implementer": "single-implementer";
|
|
387
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
388
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
389
|
+
}>;
|
|
390
|
+
declare const executionPlanSchema: z.ZodObject<{
|
|
391
|
+
workflow: z.ZodEnum<{
|
|
392
|
+
"root-only": "root-only";
|
|
393
|
+
"single-inspector": "single-inspector";
|
|
394
|
+
"single-implementer": "single-implementer";
|
|
395
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
396
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
397
|
+
}>;
|
|
398
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
399
|
+
permissionProfile: z.ZodEnum<{
|
|
400
|
+
inspect: "inspect";
|
|
401
|
+
edit: "edit";
|
|
402
|
+
test: "test";
|
|
403
|
+
network: "network";
|
|
404
|
+
}>;
|
|
405
|
+
maxWallMs: z.ZodNumber;
|
|
406
|
+
maxTurns: z.ZodNumber;
|
|
407
|
+
requiresWorktree: z.ZodBoolean;
|
|
408
|
+
}, z.core.$strip>;
|
|
409
|
+
declare const agentRouteResponseSchema: z.ZodObject<{
|
|
410
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
411
|
+
requestId: z.ZodUUID;
|
|
412
|
+
routeId: z.ZodUUID;
|
|
413
|
+
routerVersion: z.ZodString;
|
|
414
|
+
expiresAt: z.ZodISODateTime;
|
|
415
|
+
plan: z.ZodObject<{
|
|
416
|
+
workflow: z.ZodEnum<{
|
|
417
|
+
"root-only": "root-only";
|
|
418
|
+
"single-inspector": "single-inspector";
|
|
419
|
+
"single-implementer": "single-implementer";
|
|
420
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
421
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
422
|
+
}>;
|
|
423
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
424
|
+
permissionProfile: z.ZodEnum<{
|
|
425
|
+
inspect: "inspect";
|
|
426
|
+
edit: "edit";
|
|
427
|
+
test: "test";
|
|
428
|
+
network: "network";
|
|
429
|
+
}>;
|
|
430
|
+
maxWallMs: z.ZodNumber;
|
|
431
|
+
maxTurns: z.ZodNumber;
|
|
432
|
+
requiresWorktree: z.ZodBoolean;
|
|
433
|
+
}, z.core.$strip>;
|
|
434
|
+
fallback: z.ZodObject<{
|
|
435
|
+
workflow: z.ZodEnum<{
|
|
436
|
+
"root-only": "root-only";
|
|
437
|
+
"single-inspector": "single-inspector";
|
|
438
|
+
"single-implementer": "single-implementer";
|
|
439
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
440
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
441
|
+
}>;
|
|
442
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
443
|
+
permissionProfile: z.ZodEnum<{
|
|
444
|
+
inspect: "inspect";
|
|
445
|
+
edit: "edit";
|
|
446
|
+
test: "test";
|
|
447
|
+
network: "network";
|
|
448
|
+
}>;
|
|
449
|
+
maxWallMs: z.ZodNumber;
|
|
450
|
+
maxTurns: z.ZodNumber;
|
|
451
|
+
requiresWorktree: z.ZodBoolean;
|
|
452
|
+
}, z.core.$strip>;
|
|
453
|
+
confidence: z.ZodNumber;
|
|
454
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
455
|
+
expected: z.ZodObject<{
|
|
456
|
+
verifiedSuccess: z.ZodNumber;
|
|
457
|
+
contextTokens: z.ZodNumber;
|
|
458
|
+
wallTimeMs: z.ZodNumber;
|
|
459
|
+
}, z.core.$strip>;
|
|
460
|
+
feedbackToken: z.ZodString;
|
|
461
|
+
}, z.core.$strip>;
|
|
462
|
+
declare const agentFeedbackSchema: z.ZodObject<{
|
|
463
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
464
|
+
routeId: z.ZodUUID;
|
|
465
|
+
feedbackToken: z.ZodString;
|
|
466
|
+
idempotencyKey: z.ZodString;
|
|
467
|
+
status: z.ZodEnum<{
|
|
468
|
+
completed: "completed";
|
|
469
|
+
verified: "verified";
|
|
470
|
+
failed: "failed";
|
|
471
|
+
blocked: "blocked";
|
|
472
|
+
cancelled: "cancelled";
|
|
473
|
+
}>;
|
|
474
|
+
confirmedTargetId: z.ZodNullable<z.ZodString>;
|
|
475
|
+
identityConfirmed: z.ZodBoolean;
|
|
476
|
+
checksPassed: z.ZodNumber;
|
|
477
|
+
checksFailed: z.ZodNumber;
|
|
478
|
+
retries: z.ZodNumber;
|
|
479
|
+
usage: z.ZodObject<{
|
|
480
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
481
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
482
|
+
contextTokensEstimated: z.ZodNumber;
|
|
483
|
+
source: z.ZodEnum<{
|
|
484
|
+
unknown: "unknown";
|
|
485
|
+
reported: "reported";
|
|
486
|
+
estimated: "estimated";
|
|
487
|
+
}>;
|
|
488
|
+
}, z.core.$strip>;
|
|
489
|
+
timings: z.ZodObject<{
|
|
490
|
+
totalMs: z.ZodNumber;
|
|
491
|
+
routingMs: z.ZodNumber;
|
|
492
|
+
executionMs: z.ZodNumber;
|
|
493
|
+
verificationMs: z.ZodNumber;
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
failureCode: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
type HarnessId = z.infer<typeof harnessIdSchema>;
|
|
498
|
+
type ClientSurface = z.infer<typeof clientSurfaceSchema>;
|
|
499
|
+
type Readiness = z.infer<typeof readinessSchema>;
|
|
500
|
+
type PermissionProfile = z.infer<typeof permissionProfileSchema>;
|
|
501
|
+
type TaskRole = z.infer<typeof taskRoleSchema>;
|
|
502
|
+
type RoutingObjective = z.infer<typeof routingObjectiveSchema>;
|
|
503
|
+
type Allowance = z.infer<typeof allowanceSchema>;
|
|
504
|
+
type AgentModel = z.infer<typeof agentModelSchema>;
|
|
505
|
+
type AgentTaskFeatures = z.infer<typeof agentTaskFeaturesSchema>;
|
|
506
|
+
type AgentRouteRequest = z.infer<typeof agentRouteRequestSchema>;
|
|
507
|
+
type ExecutionPlan = z.infer<typeof executionPlanSchema>;
|
|
508
|
+
type AgentRouteResponse = z.infer<typeof agentRouteResponseSchema>;
|
|
509
|
+
type AgentFeedback = z.infer<typeof agentFeedbackSchema>;
|
|
510
|
+
|
|
511
|
+
interface FeaturizeAgentTaskInput {
|
|
512
|
+
task: string;
|
|
513
|
+
role?: AgentTaskFeatures["role"];
|
|
514
|
+
permissionProfile?: "inspect" | "edit" | "test" | "network";
|
|
515
|
+
languages?: string[];
|
|
516
|
+
requiredTools?: string[];
|
|
517
|
+
contextTokens?: number;
|
|
518
|
+
scopePaths?: string[];
|
|
519
|
+
acceptance?: string[];
|
|
520
|
+
}
|
|
521
|
+
declare function featurizeAgentTask(input: FeaturizeAgentTaskInput): AgentTaskFeatures;
|
|
522
|
+
|
|
523
|
+
interface RouteSelection {
|
|
524
|
+
plan: ExecutionPlan;
|
|
525
|
+
fallback: ExecutionPlan;
|
|
526
|
+
confidence: number;
|
|
527
|
+
reasonCodes: string[];
|
|
528
|
+
expected: {
|
|
529
|
+
verifiedSuccess: number;
|
|
530
|
+
contextTokens: number;
|
|
531
|
+
wallTimeMs: number;
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
declare function selectAgentRoute(request: AgentRouteRequest): RouteSelection;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* The Run document: one durable, addressable record per routed task. The Run
|
|
538
|
+
* owns the run — chat transcripts, CLI output, and dashboards are views. Every
|
|
539
|
+
* hand (router, root agent, delegate harness, human) appends typed events; the
|
|
540
|
+
* status is derived from the event log, never stored independently.
|
|
541
|
+
*
|
|
542
|
+
* Content rule: no prompt text, code, diffs, model output, repository paths,
|
|
543
|
+
* or raw installation identifiers may enter a Run. Every payload field is an
|
|
544
|
+
* enum, number, boolean, identifier, or bounded machine-generated code, and
|
|
545
|
+
* every object is strict so an unexpected free-text field is a schema error.
|
|
546
|
+
*/
|
|
547
|
+
declare const RUN_SCHEMA_VERSION: 3;
|
|
548
|
+
declare const runStatusSchema: z.ZodEnum<{
|
|
549
|
+
completed: "completed";
|
|
550
|
+
failed: "failed";
|
|
551
|
+
cancelled: "cancelled";
|
|
552
|
+
planned: "planned";
|
|
553
|
+
"awaiting-approval": "awaiting-approval";
|
|
554
|
+
executing: "executing";
|
|
555
|
+
verifying: "verifying";
|
|
556
|
+
expired: "expired";
|
|
557
|
+
}>;
|
|
558
|
+
declare const runActorSchema: z.ZodEnum<{
|
|
559
|
+
router: "router";
|
|
560
|
+
"root-agent": "root-agent";
|
|
561
|
+
delegate: "delegate";
|
|
562
|
+
human: "human";
|
|
563
|
+
system: "system";
|
|
564
|
+
}>;
|
|
565
|
+
declare const approvalKindSchema: z.ZodEnum<{
|
|
566
|
+
"subscription-use": "subscription-use";
|
|
567
|
+
execute: "execute";
|
|
568
|
+
"share-prompt": "share-prompt";
|
|
569
|
+
}>;
|
|
570
|
+
declare const approvalSurfaceSchema: z.ZodEnum<{
|
|
571
|
+
"local-cli": "local-cli";
|
|
572
|
+
web: "web";
|
|
573
|
+
}>;
|
|
574
|
+
declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
575
|
+
type: z.ZodLiteral<"created">;
|
|
576
|
+
data: z.ZodObject<{
|
|
577
|
+
surface: z.ZodEnum<{
|
|
578
|
+
cli: "cli";
|
|
579
|
+
skill: "skill";
|
|
580
|
+
"codex-plugin": "codex-plugin";
|
|
581
|
+
"opencode-plugin": "opencode-plugin";
|
|
582
|
+
}>;
|
|
583
|
+
routerMode: z.ZodEnum<{
|
|
584
|
+
"metadata-only": "metadata-only";
|
|
585
|
+
"prompt-assisted": "prompt-assisted";
|
|
586
|
+
}>;
|
|
587
|
+
}, z.core.$strict>;
|
|
588
|
+
seq: z.ZodNumber;
|
|
589
|
+
at: z.ZodISODateTime;
|
|
590
|
+
actor: z.ZodEnum<{
|
|
591
|
+
router: "router";
|
|
592
|
+
"root-agent": "root-agent";
|
|
593
|
+
delegate: "delegate";
|
|
594
|
+
human: "human";
|
|
595
|
+
system: "system";
|
|
596
|
+
}>;
|
|
597
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
598
|
+
type: z.ZodLiteral<"routed">;
|
|
599
|
+
data: z.ZodObject<{
|
|
600
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
601
|
+
workflow: z.ZodEnum<{
|
|
602
|
+
"root-only": "root-only";
|
|
603
|
+
"single-inspector": "single-inspector";
|
|
604
|
+
"single-implementer": "single-implementer";
|
|
605
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
606
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
607
|
+
}>;
|
|
608
|
+
confidence: z.ZodNumber;
|
|
609
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
610
|
+
}, z.core.$strict>;
|
|
611
|
+
seq: z.ZodNumber;
|
|
612
|
+
at: z.ZodISODateTime;
|
|
613
|
+
actor: z.ZodEnum<{
|
|
614
|
+
router: "router";
|
|
615
|
+
"root-agent": "root-agent";
|
|
616
|
+
delegate: "delegate";
|
|
617
|
+
human: "human";
|
|
618
|
+
system: "system";
|
|
619
|
+
}>;
|
|
620
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
621
|
+
type: z.ZodLiteral<"approval-requested">;
|
|
622
|
+
data: z.ZodObject<{
|
|
623
|
+
kind: z.ZodEnum<{
|
|
624
|
+
"subscription-use": "subscription-use";
|
|
625
|
+
execute: "execute";
|
|
626
|
+
"share-prompt": "share-prompt";
|
|
627
|
+
}>;
|
|
628
|
+
harness: z.ZodOptional<z.ZodEnum<{
|
|
629
|
+
codex: "codex";
|
|
630
|
+
claude: "claude";
|
|
631
|
+
copilot: "copilot";
|
|
632
|
+
cursor: "cursor";
|
|
633
|
+
opencode: "opencode";
|
|
634
|
+
custom: "custom";
|
|
635
|
+
}>>;
|
|
636
|
+
}, z.core.$strict>;
|
|
637
|
+
seq: z.ZodNumber;
|
|
638
|
+
at: z.ZodISODateTime;
|
|
639
|
+
actor: z.ZodEnum<{
|
|
640
|
+
router: "router";
|
|
641
|
+
"root-agent": "root-agent";
|
|
642
|
+
delegate: "delegate";
|
|
643
|
+
human: "human";
|
|
644
|
+
system: "system";
|
|
645
|
+
}>;
|
|
646
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
647
|
+
type: z.ZodLiteral<"approval-granted">;
|
|
648
|
+
data: z.ZodObject<{
|
|
649
|
+
kind: z.ZodEnum<{
|
|
650
|
+
"subscription-use": "subscription-use";
|
|
651
|
+
execute: "execute";
|
|
652
|
+
"share-prompt": "share-prompt";
|
|
653
|
+
}>;
|
|
654
|
+
grantedBy: z.ZodEnum<{
|
|
655
|
+
"local-cli": "local-cli";
|
|
656
|
+
web: "web";
|
|
657
|
+
}>;
|
|
658
|
+
}, z.core.$strict>;
|
|
659
|
+
seq: z.ZodNumber;
|
|
660
|
+
at: z.ZodISODateTime;
|
|
661
|
+
actor: z.ZodEnum<{
|
|
662
|
+
router: "router";
|
|
663
|
+
"root-agent": "root-agent";
|
|
664
|
+
delegate: "delegate";
|
|
665
|
+
human: "human";
|
|
666
|
+
system: "system";
|
|
667
|
+
}>;
|
|
668
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
669
|
+
type: z.ZodLiteral<"approval-denied">;
|
|
670
|
+
data: z.ZodObject<{
|
|
671
|
+
kind: z.ZodEnum<{
|
|
672
|
+
"subscription-use": "subscription-use";
|
|
673
|
+
execute: "execute";
|
|
674
|
+
"share-prompt": "share-prompt";
|
|
675
|
+
}>;
|
|
676
|
+
deniedBy: z.ZodEnum<{
|
|
677
|
+
"local-cli": "local-cli";
|
|
678
|
+
web: "web";
|
|
679
|
+
}>;
|
|
680
|
+
}, z.core.$strict>;
|
|
681
|
+
seq: z.ZodNumber;
|
|
682
|
+
at: z.ZodISODateTime;
|
|
683
|
+
actor: z.ZodEnum<{
|
|
684
|
+
router: "router";
|
|
685
|
+
"root-agent": "root-agent";
|
|
686
|
+
delegate: "delegate";
|
|
687
|
+
human: "human";
|
|
688
|
+
system: "system";
|
|
689
|
+
}>;
|
|
690
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
691
|
+
type: z.ZodLiteral<"execution-started">;
|
|
692
|
+
data: z.ZodObject<{
|
|
693
|
+
targetId: z.ZodString;
|
|
694
|
+
permissionProfile: z.ZodEnum<{
|
|
695
|
+
inspect: "inspect";
|
|
696
|
+
edit: "edit";
|
|
697
|
+
test: "test";
|
|
698
|
+
network: "network";
|
|
699
|
+
}>;
|
|
700
|
+
worktree: z.ZodBoolean;
|
|
701
|
+
}, z.core.$strict>;
|
|
702
|
+
seq: z.ZodNumber;
|
|
703
|
+
at: z.ZodISODateTime;
|
|
704
|
+
actor: z.ZodEnum<{
|
|
705
|
+
router: "router";
|
|
706
|
+
"root-agent": "root-agent";
|
|
707
|
+
delegate: "delegate";
|
|
708
|
+
human: "human";
|
|
709
|
+
system: "system";
|
|
710
|
+
}>;
|
|
711
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
712
|
+
type: z.ZodLiteral<"execution-progress">;
|
|
713
|
+
data: z.ZodObject<{
|
|
714
|
+
turn: z.ZodNumber;
|
|
715
|
+
elapsedMs: z.ZodNumber;
|
|
716
|
+
}, z.core.$strict>;
|
|
717
|
+
seq: z.ZodNumber;
|
|
718
|
+
at: z.ZodISODateTime;
|
|
719
|
+
actor: z.ZodEnum<{
|
|
720
|
+
router: "router";
|
|
721
|
+
"root-agent": "root-agent";
|
|
722
|
+
delegate: "delegate";
|
|
723
|
+
human: "human";
|
|
724
|
+
system: "system";
|
|
725
|
+
}>;
|
|
726
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
727
|
+
type: z.ZodLiteral<"execution-finished">;
|
|
728
|
+
data: z.ZodObject<{
|
|
729
|
+
outcome: z.ZodEnum<{
|
|
730
|
+
success: "success";
|
|
731
|
+
failure: "failure";
|
|
732
|
+
timeout: "timeout";
|
|
733
|
+
}>;
|
|
734
|
+
failureCode: z.ZodOptional<z.ZodString>;
|
|
735
|
+
elapsedMs: z.ZodNumber;
|
|
736
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
737
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
738
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
739
|
+
contextTokensEstimated: z.ZodNumber;
|
|
740
|
+
source: z.ZodEnum<{
|
|
741
|
+
unknown: "unknown";
|
|
742
|
+
reported: "reported";
|
|
743
|
+
estimated: "estimated";
|
|
744
|
+
}>;
|
|
745
|
+
}, z.core.$strict>>;
|
|
746
|
+
}, z.core.$strict>;
|
|
747
|
+
seq: z.ZodNumber;
|
|
748
|
+
at: z.ZodISODateTime;
|
|
749
|
+
actor: z.ZodEnum<{
|
|
750
|
+
router: "router";
|
|
751
|
+
"root-agent": "root-agent";
|
|
752
|
+
delegate: "delegate";
|
|
753
|
+
human: "human";
|
|
754
|
+
system: "system";
|
|
755
|
+
}>;
|
|
756
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
757
|
+
type: z.ZodLiteral<"verification-started">;
|
|
758
|
+
data: z.ZodObject<{}, z.core.$strict>;
|
|
759
|
+
seq: z.ZodNumber;
|
|
760
|
+
at: z.ZodISODateTime;
|
|
761
|
+
actor: z.ZodEnum<{
|
|
762
|
+
router: "router";
|
|
763
|
+
"root-agent": "root-agent";
|
|
764
|
+
delegate: "delegate";
|
|
765
|
+
human: "human";
|
|
766
|
+
system: "system";
|
|
767
|
+
}>;
|
|
768
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
769
|
+
type: z.ZodLiteral<"verification-finished">;
|
|
770
|
+
data: z.ZodObject<{
|
|
771
|
+
passed: z.ZodBoolean;
|
|
772
|
+
checksPassed: z.ZodNumber;
|
|
773
|
+
checksFailed: z.ZodNumber;
|
|
774
|
+
}, z.core.$strict>;
|
|
775
|
+
seq: z.ZodNumber;
|
|
776
|
+
at: z.ZodISODateTime;
|
|
777
|
+
actor: z.ZodEnum<{
|
|
778
|
+
router: "router";
|
|
779
|
+
"root-agent": "root-agent";
|
|
780
|
+
delegate: "delegate";
|
|
781
|
+
human: "human";
|
|
782
|
+
system: "system";
|
|
783
|
+
}>;
|
|
784
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
785
|
+
type: z.ZodLiteral<"feedback">;
|
|
786
|
+
data: z.ZodObject<{
|
|
787
|
+
status: z.ZodEnum<{
|
|
788
|
+
completed: "completed";
|
|
789
|
+
verified: "verified";
|
|
790
|
+
failed: "failed";
|
|
791
|
+
blocked: "blocked";
|
|
792
|
+
cancelled: "cancelled";
|
|
793
|
+
}>;
|
|
794
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
795
|
+
modelChoice: z.ZodOptional<z.ZodEnum<{
|
|
796
|
+
right: "right";
|
|
797
|
+
acceptable: "acceptable";
|
|
798
|
+
wrong: "wrong";
|
|
799
|
+
}>>;
|
|
800
|
+
wouldUseAgain: z.ZodOptional<z.ZodBoolean>;
|
|
801
|
+
}, z.core.$strict>;
|
|
802
|
+
seq: z.ZodNumber;
|
|
803
|
+
at: z.ZodISODateTime;
|
|
804
|
+
actor: z.ZodEnum<{
|
|
805
|
+
router: "router";
|
|
806
|
+
"root-agent": "root-agent";
|
|
807
|
+
delegate: "delegate";
|
|
808
|
+
human: "human";
|
|
809
|
+
system: "system";
|
|
810
|
+
}>;
|
|
811
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
812
|
+
type: z.ZodLiteral<"cancelled">;
|
|
813
|
+
data: z.ZodObject<{
|
|
814
|
+
by: z.ZodEnum<{
|
|
815
|
+
router: "router";
|
|
816
|
+
"root-agent": "root-agent";
|
|
817
|
+
delegate: "delegate";
|
|
818
|
+
human: "human";
|
|
819
|
+
system: "system";
|
|
820
|
+
}>;
|
|
821
|
+
}, z.core.$strict>;
|
|
822
|
+
seq: z.ZodNumber;
|
|
823
|
+
at: z.ZodISODateTime;
|
|
824
|
+
actor: z.ZodEnum<{
|
|
825
|
+
router: "router";
|
|
826
|
+
"root-agent": "root-agent";
|
|
827
|
+
delegate: "delegate";
|
|
828
|
+
human: "human";
|
|
829
|
+
system: "system";
|
|
830
|
+
}>;
|
|
831
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
832
|
+
type: z.ZodLiteral<"expired">;
|
|
833
|
+
data: z.ZodObject<{}, z.core.$strict>;
|
|
834
|
+
seq: z.ZodNumber;
|
|
835
|
+
at: z.ZodISODateTime;
|
|
836
|
+
actor: z.ZodEnum<{
|
|
837
|
+
router: "router";
|
|
838
|
+
"root-agent": "root-agent";
|
|
839
|
+
delegate: "delegate";
|
|
840
|
+
human: "human";
|
|
841
|
+
system: "system";
|
|
842
|
+
}>;
|
|
843
|
+
}, z.core.$strict>], "type">;
|
|
844
|
+
type RunStatus = z.infer<typeof runStatusSchema>;
|
|
845
|
+
type RunActor = z.infer<typeof runActorSchema>;
|
|
846
|
+
type RunEvent = z.infer<typeof runEventSchema>;
|
|
847
|
+
type RunEventType = RunEvent["type"];
|
|
848
|
+
type ApprovalKind = z.infer<typeof approvalKindSchema>;
|
|
849
|
+
/** Candidate snapshot persisted with a Run: capability metadata only, never allowance or local history. */
|
|
850
|
+
declare const runCandidateSchema: z.ZodObject<{
|
|
851
|
+
id: z.ZodString;
|
|
852
|
+
harness: z.ZodEnum<{
|
|
853
|
+
codex: "codex";
|
|
854
|
+
claude: "claude";
|
|
855
|
+
copilot: "copilot";
|
|
856
|
+
cursor: "cursor";
|
|
857
|
+
opencode: "opencode";
|
|
858
|
+
custom: "custom";
|
|
859
|
+
}>;
|
|
860
|
+
nativeModelId: z.ZodString;
|
|
861
|
+
readiness: z.ZodEnum<{
|
|
862
|
+
installed: "installed";
|
|
863
|
+
"auth-ready": "auth-ready";
|
|
864
|
+
"model-listed": "model-listed";
|
|
865
|
+
"invocation-compatible": "invocation-compatible";
|
|
866
|
+
"live-confirmed": "live-confirmed";
|
|
867
|
+
}>;
|
|
868
|
+
authMode: z.ZodEnum<{
|
|
869
|
+
unknown: "unknown";
|
|
870
|
+
subscription: "subscription";
|
|
871
|
+
"api-key": "api-key";
|
|
872
|
+
"cloud-provider": "cloud-provider";
|
|
873
|
+
local: "local";
|
|
874
|
+
}>;
|
|
875
|
+
productUseApproved: z.ZodBoolean;
|
|
876
|
+
capabilities: z.ZodObject<{
|
|
877
|
+
tools: z.ZodBoolean;
|
|
878
|
+
vision: z.ZodBoolean;
|
|
879
|
+
structuredOutput: z.ZodEnum<{
|
|
880
|
+
none: "none";
|
|
881
|
+
json: "json";
|
|
882
|
+
jsonl: "jsonl";
|
|
883
|
+
schema: "schema";
|
|
884
|
+
}>;
|
|
885
|
+
sessions: z.ZodEnum<{
|
|
886
|
+
none: "none";
|
|
887
|
+
resume: "resume";
|
|
888
|
+
continue: "continue";
|
|
889
|
+
}>;
|
|
890
|
+
permissions: z.ZodArray<z.ZodEnum<{
|
|
891
|
+
inspect: "inspect";
|
|
892
|
+
edit: "edit";
|
|
893
|
+
test: "test";
|
|
894
|
+
network: "network";
|
|
895
|
+
}>>;
|
|
896
|
+
}, z.core.$strip>;
|
|
897
|
+
identityProof: z.ZodEnum<{
|
|
898
|
+
"runtime-reported": "runtime-reported";
|
|
899
|
+
unavailable: "unavailable";
|
|
900
|
+
requested: "requested";
|
|
901
|
+
}>;
|
|
902
|
+
qualityPrior: z.ZodNumber;
|
|
903
|
+
tokenEfficiencyPrior: z.ZodNumber;
|
|
904
|
+
latencyPrior: z.ZodNumber;
|
|
905
|
+
}, z.core.$strict>;
|
|
906
|
+
declare const effectivePolicySchema: z.ZodObject<{
|
|
907
|
+
objective: z.ZodEnum<{
|
|
908
|
+
quality: "quality";
|
|
909
|
+
balanced: "balanced";
|
|
910
|
+
tokens: "tokens";
|
|
911
|
+
latency: "latency";
|
|
912
|
+
}>;
|
|
913
|
+
maxDelegationDepth: z.ZodNumber;
|
|
914
|
+
permissionCeiling: z.ZodEnum<{
|
|
915
|
+
inspect: "inspect";
|
|
916
|
+
edit: "edit";
|
|
917
|
+
test: "test";
|
|
918
|
+
network: "network";
|
|
919
|
+
}>;
|
|
920
|
+
allowedHarnesses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
921
|
+
codex: "codex";
|
|
922
|
+
claude: "claude";
|
|
923
|
+
copilot: "copilot";
|
|
924
|
+
cursor: "cursor";
|
|
925
|
+
opencode: "opencode";
|
|
926
|
+
custom: "custom";
|
|
927
|
+
}>>>;
|
|
928
|
+
tokenBudget: z.ZodOptional<z.ZodNumber>;
|
|
929
|
+
wallTimeBudgetMs: z.ZodOptional<z.ZodNumber>;
|
|
930
|
+
}, z.core.$strict>;
|
|
931
|
+
declare const runApprovalSchema: z.ZodObject<{
|
|
932
|
+
kind: z.ZodEnum<{
|
|
933
|
+
"subscription-use": "subscription-use";
|
|
934
|
+
execute: "execute";
|
|
935
|
+
"share-prompt": "share-prompt";
|
|
936
|
+
}>;
|
|
937
|
+
state: z.ZodEnum<{
|
|
938
|
+
pending: "pending";
|
|
939
|
+
granted: "granted";
|
|
940
|
+
denied: "denied";
|
|
941
|
+
}>;
|
|
942
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
943
|
+
"local-cli": "local-cli";
|
|
944
|
+
web: "web";
|
|
945
|
+
}>>;
|
|
946
|
+
at: z.ZodISODateTime;
|
|
947
|
+
}, z.core.$strict>;
|
|
948
|
+
declare const runDocumentSchema: z.ZodObject<{
|
|
949
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
950
|
+
runId: z.ZodUUID;
|
|
951
|
+
createdAt: z.ZodISODateTime;
|
|
952
|
+
expiresAt: z.ZodISODateTime;
|
|
953
|
+
origin: z.ZodObject<{
|
|
954
|
+
surface: z.ZodEnum<{
|
|
955
|
+
cli: "cli";
|
|
956
|
+
skill: "skill";
|
|
957
|
+
"codex-plugin": "codex-plugin";
|
|
958
|
+
"opencode-plugin": "opencode-plugin";
|
|
959
|
+
}>;
|
|
960
|
+
clientVersion: z.ZodString;
|
|
961
|
+
}, z.core.$strict>;
|
|
962
|
+
task: z.ZodObject<{
|
|
963
|
+
role: z.ZodEnum<{
|
|
964
|
+
inspect: "inspect";
|
|
965
|
+
test: "test";
|
|
966
|
+
plan: "plan";
|
|
967
|
+
implement: "implement";
|
|
968
|
+
review: "review";
|
|
969
|
+
}>;
|
|
970
|
+
type: z.ZodEnum<{
|
|
971
|
+
test: "test";
|
|
972
|
+
review: "review";
|
|
973
|
+
bug: "bug";
|
|
974
|
+
feature: "feature";
|
|
975
|
+
refactor: "refactor";
|
|
976
|
+
migration: "migration";
|
|
977
|
+
research: "research";
|
|
978
|
+
docs: "docs";
|
|
979
|
+
unknown: "unknown";
|
|
980
|
+
}>;
|
|
981
|
+
complexity: z.ZodNumber;
|
|
982
|
+
scopeBreadth: z.ZodNumber;
|
|
983
|
+
contextTokens: z.ZodNumber;
|
|
984
|
+
oracleStrength: z.ZodNumber;
|
|
985
|
+
codeDensity: z.ZodNumber;
|
|
986
|
+
risk: z.ZodEnum<{
|
|
987
|
+
low: "low";
|
|
988
|
+
medium: "medium";
|
|
989
|
+
high: "high";
|
|
990
|
+
critical: "critical";
|
|
991
|
+
}>;
|
|
992
|
+
languages: z.ZodArray<z.ZodString>;
|
|
993
|
+
requiredTools: z.ZodArray<z.ZodString>;
|
|
994
|
+
requiresVision: z.ZodBoolean;
|
|
995
|
+
requiresNetwork: z.ZodBoolean;
|
|
996
|
+
cacheHit: z.ZodBoolean;
|
|
997
|
+
}, z.core.$strip>;
|
|
998
|
+
candidatesSnapshot: z.ZodArray<z.ZodObject<{
|
|
999
|
+
id: z.ZodString;
|
|
1000
|
+
harness: z.ZodEnum<{
|
|
1001
|
+
codex: "codex";
|
|
1002
|
+
claude: "claude";
|
|
1003
|
+
copilot: "copilot";
|
|
1004
|
+
cursor: "cursor";
|
|
1005
|
+
opencode: "opencode";
|
|
1006
|
+
custom: "custom";
|
|
1007
|
+
}>;
|
|
1008
|
+
nativeModelId: z.ZodString;
|
|
1009
|
+
readiness: z.ZodEnum<{
|
|
1010
|
+
installed: "installed";
|
|
1011
|
+
"auth-ready": "auth-ready";
|
|
1012
|
+
"model-listed": "model-listed";
|
|
1013
|
+
"invocation-compatible": "invocation-compatible";
|
|
1014
|
+
"live-confirmed": "live-confirmed";
|
|
1015
|
+
}>;
|
|
1016
|
+
authMode: z.ZodEnum<{
|
|
1017
|
+
unknown: "unknown";
|
|
1018
|
+
subscription: "subscription";
|
|
1019
|
+
"api-key": "api-key";
|
|
1020
|
+
"cloud-provider": "cloud-provider";
|
|
1021
|
+
local: "local";
|
|
1022
|
+
}>;
|
|
1023
|
+
productUseApproved: z.ZodBoolean;
|
|
1024
|
+
capabilities: z.ZodObject<{
|
|
1025
|
+
tools: z.ZodBoolean;
|
|
1026
|
+
vision: z.ZodBoolean;
|
|
1027
|
+
structuredOutput: z.ZodEnum<{
|
|
1028
|
+
none: "none";
|
|
1029
|
+
json: "json";
|
|
1030
|
+
jsonl: "jsonl";
|
|
1031
|
+
schema: "schema";
|
|
1032
|
+
}>;
|
|
1033
|
+
sessions: z.ZodEnum<{
|
|
1034
|
+
none: "none";
|
|
1035
|
+
resume: "resume";
|
|
1036
|
+
continue: "continue";
|
|
1037
|
+
}>;
|
|
1038
|
+
permissions: z.ZodArray<z.ZodEnum<{
|
|
1039
|
+
inspect: "inspect";
|
|
1040
|
+
edit: "edit";
|
|
1041
|
+
test: "test";
|
|
1042
|
+
network: "network";
|
|
1043
|
+
}>>;
|
|
1044
|
+
}, z.core.$strip>;
|
|
1045
|
+
identityProof: z.ZodEnum<{
|
|
1046
|
+
"runtime-reported": "runtime-reported";
|
|
1047
|
+
unavailable: "unavailable";
|
|
1048
|
+
requested: "requested";
|
|
1049
|
+
}>;
|
|
1050
|
+
qualityPrior: z.ZodNumber;
|
|
1051
|
+
tokenEfficiencyPrior: z.ZodNumber;
|
|
1052
|
+
latencyPrior: z.ZodNumber;
|
|
1053
|
+
}, z.core.$strict>>;
|
|
1054
|
+
decision: z.ZodObject<{
|
|
1055
|
+
plan: z.ZodObject<{
|
|
1056
|
+
workflow: z.ZodEnum<{
|
|
1057
|
+
"root-only": "root-only";
|
|
1058
|
+
"single-inspector": "single-inspector";
|
|
1059
|
+
"single-implementer": "single-implementer";
|
|
1060
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
1061
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
1062
|
+
}>;
|
|
1063
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
1064
|
+
permissionProfile: z.ZodEnum<{
|
|
1065
|
+
inspect: "inspect";
|
|
1066
|
+
edit: "edit";
|
|
1067
|
+
test: "test";
|
|
1068
|
+
network: "network";
|
|
1069
|
+
}>;
|
|
1070
|
+
maxWallMs: z.ZodNumber;
|
|
1071
|
+
maxTurns: z.ZodNumber;
|
|
1072
|
+
requiresWorktree: z.ZodBoolean;
|
|
1073
|
+
}, z.core.$strip>;
|
|
1074
|
+
fallback: z.ZodObject<{
|
|
1075
|
+
workflow: z.ZodEnum<{
|
|
1076
|
+
"root-only": "root-only";
|
|
1077
|
+
"single-inspector": "single-inspector";
|
|
1078
|
+
"single-implementer": "single-implementer";
|
|
1079
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
1080
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
1081
|
+
}>;
|
|
1082
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
1083
|
+
permissionProfile: z.ZodEnum<{
|
|
1084
|
+
inspect: "inspect";
|
|
1085
|
+
edit: "edit";
|
|
1086
|
+
test: "test";
|
|
1087
|
+
network: "network";
|
|
1088
|
+
}>;
|
|
1089
|
+
maxWallMs: z.ZodNumber;
|
|
1090
|
+
maxTurns: z.ZodNumber;
|
|
1091
|
+
requiresWorktree: z.ZodBoolean;
|
|
1092
|
+
}, z.core.$strip>;
|
|
1093
|
+
confidence: z.ZodNumber;
|
|
1094
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
1095
|
+
expected: z.ZodObject<{
|
|
1096
|
+
verifiedSuccess: z.ZodNumber;
|
|
1097
|
+
contextTokens: z.ZodNumber;
|
|
1098
|
+
wallTimeMs: z.ZodNumber;
|
|
1099
|
+
}, z.core.$strict>;
|
|
1100
|
+
routerVersion: z.ZodString;
|
|
1101
|
+
}, z.core.$strict>;
|
|
1102
|
+
policy: z.ZodObject<{
|
|
1103
|
+
objective: z.ZodEnum<{
|
|
1104
|
+
quality: "quality";
|
|
1105
|
+
balanced: "balanced";
|
|
1106
|
+
tokens: "tokens";
|
|
1107
|
+
latency: "latency";
|
|
1108
|
+
}>;
|
|
1109
|
+
maxDelegationDepth: z.ZodNumber;
|
|
1110
|
+
permissionCeiling: z.ZodEnum<{
|
|
1111
|
+
inspect: "inspect";
|
|
1112
|
+
edit: "edit";
|
|
1113
|
+
test: "test";
|
|
1114
|
+
network: "network";
|
|
1115
|
+
}>;
|
|
1116
|
+
allowedHarnesses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1117
|
+
codex: "codex";
|
|
1118
|
+
claude: "claude";
|
|
1119
|
+
copilot: "copilot";
|
|
1120
|
+
cursor: "cursor";
|
|
1121
|
+
opencode: "opencode";
|
|
1122
|
+
custom: "custom";
|
|
1123
|
+
}>>>;
|
|
1124
|
+
tokenBudget: z.ZodOptional<z.ZodNumber>;
|
|
1125
|
+
wallTimeBudgetMs: z.ZodOptional<z.ZodNumber>;
|
|
1126
|
+
}, z.core.$strict>;
|
|
1127
|
+
approvals: z.ZodArray<z.ZodObject<{
|
|
1128
|
+
kind: z.ZodEnum<{
|
|
1129
|
+
"subscription-use": "subscription-use";
|
|
1130
|
+
execute: "execute";
|
|
1131
|
+
"share-prompt": "share-prompt";
|
|
1132
|
+
}>;
|
|
1133
|
+
state: z.ZodEnum<{
|
|
1134
|
+
pending: "pending";
|
|
1135
|
+
granted: "granted";
|
|
1136
|
+
denied: "denied";
|
|
1137
|
+
}>;
|
|
1138
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
1139
|
+
"local-cli": "local-cli";
|
|
1140
|
+
web: "web";
|
|
1141
|
+
}>>;
|
|
1142
|
+
at: z.ZodISODateTime;
|
|
1143
|
+
}, z.core.$strict>>;
|
|
1144
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1145
|
+
type: z.ZodLiteral<"created">;
|
|
1146
|
+
data: z.ZodObject<{
|
|
1147
|
+
surface: z.ZodEnum<{
|
|
1148
|
+
cli: "cli";
|
|
1149
|
+
skill: "skill";
|
|
1150
|
+
"codex-plugin": "codex-plugin";
|
|
1151
|
+
"opencode-plugin": "opencode-plugin";
|
|
1152
|
+
}>;
|
|
1153
|
+
routerMode: z.ZodEnum<{
|
|
1154
|
+
"metadata-only": "metadata-only";
|
|
1155
|
+
"prompt-assisted": "prompt-assisted";
|
|
1156
|
+
}>;
|
|
1157
|
+
}, z.core.$strict>;
|
|
1158
|
+
seq: z.ZodNumber;
|
|
1159
|
+
at: z.ZodISODateTime;
|
|
1160
|
+
actor: z.ZodEnum<{
|
|
1161
|
+
router: "router";
|
|
1162
|
+
"root-agent": "root-agent";
|
|
1163
|
+
delegate: "delegate";
|
|
1164
|
+
human: "human";
|
|
1165
|
+
system: "system";
|
|
1166
|
+
}>;
|
|
1167
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1168
|
+
type: z.ZodLiteral<"routed">;
|
|
1169
|
+
data: z.ZodObject<{
|
|
1170
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
1171
|
+
workflow: z.ZodEnum<{
|
|
1172
|
+
"root-only": "root-only";
|
|
1173
|
+
"single-inspector": "single-inspector";
|
|
1174
|
+
"single-implementer": "single-implementer";
|
|
1175
|
+
"implementer-deterministic-verify": "implementer-deterministic-verify";
|
|
1176
|
+
"implementer-independent-review": "implementer-independent-review";
|
|
1177
|
+
}>;
|
|
1178
|
+
confidence: z.ZodNumber;
|
|
1179
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
1180
|
+
}, z.core.$strict>;
|
|
1181
|
+
seq: z.ZodNumber;
|
|
1182
|
+
at: z.ZodISODateTime;
|
|
1183
|
+
actor: z.ZodEnum<{
|
|
1184
|
+
router: "router";
|
|
1185
|
+
"root-agent": "root-agent";
|
|
1186
|
+
delegate: "delegate";
|
|
1187
|
+
human: "human";
|
|
1188
|
+
system: "system";
|
|
1189
|
+
}>;
|
|
1190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1191
|
+
type: z.ZodLiteral<"approval-requested">;
|
|
1192
|
+
data: z.ZodObject<{
|
|
1193
|
+
kind: z.ZodEnum<{
|
|
1194
|
+
"subscription-use": "subscription-use";
|
|
1195
|
+
execute: "execute";
|
|
1196
|
+
"share-prompt": "share-prompt";
|
|
1197
|
+
}>;
|
|
1198
|
+
harness: z.ZodOptional<z.ZodEnum<{
|
|
1199
|
+
codex: "codex";
|
|
1200
|
+
claude: "claude";
|
|
1201
|
+
copilot: "copilot";
|
|
1202
|
+
cursor: "cursor";
|
|
1203
|
+
opencode: "opencode";
|
|
1204
|
+
custom: "custom";
|
|
1205
|
+
}>>;
|
|
1206
|
+
}, z.core.$strict>;
|
|
1207
|
+
seq: z.ZodNumber;
|
|
1208
|
+
at: z.ZodISODateTime;
|
|
1209
|
+
actor: z.ZodEnum<{
|
|
1210
|
+
router: "router";
|
|
1211
|
+
"root-agent": "root-agent";
|
|
1212
|
+
delegate: "delegate";
|
|
1213
|
+
human: "human";
|
|
1214
|
+
system: "system";
|
|
1215
|
+
}>;
|
|
1216
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1217
|
+
type: z.ZodLiteral<"approval-granted">;
|
|
1218
|
+
data: z.ZodObject<{
|
|
1219
|
+
kind: z.ZodEnum<{
|
|
1220
|
+
"subscription-use": "subscription-use";
|
|
1221
|
+
execute: "execute";
|
|
1222
|
+
"share-prompt": "share-prompt";
|
|
1223
|
+
}>;
|
|
1224
|
+
grantedBy: z.ZodEnum<{
|
|
1225
|
+
"local-cli": "local-cli";
|
|
1226
|
+
web: "web";
|
|
1227
|
+
}>;
|
|
1228
|
+
}, z.core.$strict>;
|
|
1229
|
+
seq: z.ZodNumber;
|
|
1230
|
+
at: z.ZodISODateTime;
|
|
1231
|
+
actor: z.ZodEnum<{
|
|
1232
|
+
router: "router";
|
|
1233
|
+
"root-agent": "root-agent";
|
|
1234
|
+
delegate: "delegate";
|
|
1235
|
+
human: "human";
|
|
1236
|
+
system: "system";
|
|
1237
|
+
}>;
|
|
1238
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1239
|
+
type: z.ZodLiteral<"approval-denied">;
|
|
1240
|
+
data: z.ZodObject<{
|
|
1241
|
+
kind: z.ZodEnum<{
|
|
1242
|
+
"subscription-use": "subscription-use";
|
|
1243
|
+
execute: "execute";
|
|
1244
|
+
"share-prompt": "share-prompt";
|
|
1245
|
+
}>;
|
|
1246
|
+
deniedBy: z.ZodEnum<{
|
|
1247
|
+
"local-cli": "local-cli";
|
|
1248
|
+
web: "web";
|
|
1249
|
+
}>;
|
|
1250
|
+
}, z.core.$strict>;
|
|
1251
|
+
seq: z.ZodNumber;
|
|
1252
|
+
at: z.ZodISODateTime;
|
|
1253
|
+
actor: z.ZodEnum<{
|
|
1254
|
+
router: "router";
|
|
1255
|
+
"root-agent": "root-agent";
|
|
1256
|
+
delegate: "delegate";
|
|
1257
|
+
human: "human";
|
|
1258
|
+
system: "system";
|
|
1259
|
+
}>;
|
|
1260
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1261
|
+
type: z.ZodLiteral<"execution-started">;
|
|
1262
|
+
data: z.ZodObject<{
|
|
1263
|
+
targetId: z.ZodString;
|
|
1264
|
+
permissionProfile: z.ZodEnum<{
|
|
1265
|
+
inspect: "inspect";
|
|
1266
|
+
edit: "edit";
|
|
1267
|
+
test: "test";
|
|
1268
|
+
network: "network";
|
|
1269
|
+
}>;
|
|
1270
|
+
worktree: z.ZodBoolean;
|
|
1271
|
+
}, z.core.$strict>;
|
|
1272
|
+
seq: z.ZodNumber;
|
|
1273
|
+
at: z.ZodISODateTime;
|
|
1274
|
+
actor: z.ZodEnum<{
|
|
1275
|
+
router: "router";
|
|
1276
|
+
"root-agent": "root-agent";
|
|
1277
|
+
delegate: "delegate";
|
|
1278
|
+
human: "human";
|
|
1279
|
+
system: "system";
|
|
1280
|
+
}>;
|
|
1281
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1282
|
+
type: z.ZodLiteral<"execution-progress">;
|
|
1283
|
+
data: z.ZodObject<{
|
|
1284
|
+
turn: z.ZodNumber;
|
|
1285
|
+
elapsedMs: z.ZodNumber;
|
|
1286
|
+
}, z.core.$strict>;
|
|
1287
|
+
seq: z.ZodNumber;
|
|
1288
|
+
at: z.ZodISODateTime;
|
|
1289
|
+
actor: z.ZodEnum<{
|
|
1290
|
+
router: "router";
|
|
1291
|
+
"root-agent": "root-agent";
|
|
1292
|
+
delegate: "delegate";
|
|
1293
|
+
human: "human";
|
|
1294
|
+
system: "system";
|
|
1295
|
+
}>;
|
|
1296
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1297
|
+
type: z.ZodLiteral<"execution-finished">;
|
|
1298
|
+
data: z.ZodObject<{
|
|
1299
|
+
outcome: z.ZodEnum<{
|
|
1300
|
+
success: "success";
|
|
1301
|
+
failure: "failure";
|
|
1302
|
+
timeout: "timeout";
|
|
1303
|
+
}>;
|
|
1304
|
+
failureCode: z.ZodOptional<z.ZodString>;
|
|
1305
|
+
elapsedMs: z.ZodNumber;
|
|
1306
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
1307
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1308
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1309
|
+
contextTokensEstimated: z.ZodNumber;
|
|
1310
|
+
source: z.ZodEnum<{
|
|
1311
|
+
unknown: "unknown";
|
|
1312
|
+
reported: "reported";
|
|
1313
|
+
estimated: "estimated";
|
|
1314
|
+
}>;
|
|
1315
|
+
}, z.core.$strict>>;
|
|
1316
|
+
}, z.core.$strict>;
|
|
1317
|
+
seq: z.ZodNumber;
|
|
1318
|
+
at: z.ZodISODateTime;
|
|
1319
|
+
actor: z.ZodEnum<{
|
|
1320
|
+
router: "router";
|
|
1321
|
+
"root-agent": "root-agent";
|
|
1322
|
+
delegate: "delegate";
|
|
1323
|
+
human: "human";
|
|
1324
|
+
system: "system";
|
|
1325
|
+
}>;
|
|
1326
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1327
|
+
type: z.ZodLiteral<"verification-started">;
|
|
1328
|
+
data: z.ZodObject<{}, z.core.$strict>;
|
|
1329
|
+
seq: z.ZodNumber;
|
|
1330
|
+
at: z.ZodISODateTime;
|
|
1331
|
+
actor: z.ZodEnum<{
|
|
1332
|
+
router: "router";
|
|
1333
|
+
"root-agent": "root-agent";
|
|
1334
|
+
delegate: "delegate";
|
|
1335
|
+
human: "human";
|
|
1336
|
+
system: "system";
|
|
1337
|
+
}>;
|
|
1338
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1339
|
+
type: z.ZodLiteral<"verification-finished">;
|
|
1340
|
+
data: z.ZodObject<{
|
|
1341
|
+
passed: z.ZodBoolean;
|
|
1342
|
+
checksPassed: z.ZodNumber;
|
|
1343
|
+
checksFailed: z.ZodNumber;
|
|
1344
|
+
}, z.core.$strict>;
|
|
1345
|
+
seq: z.ZodNumber;
|
|
1346
|
+
at: z.ZodISODateTime;
|
|
1347
|
+
actor: z.ZodEnum<{
|
|
1348
|
+
router: "router";
|
|
1349
|
+
"root-agent": "root-agent";
|
|
1350
|
+
delegate: "delegate";
|
|
1351
|
+
human: "human";
|
|
1352
|
+
system: "system";
|
|
1353
|
+
}>;
|
|
1354
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1355
|
+
type: z.ZodLiteral<"feedback">;
|
|
1356
|
+
data: z.ZodObject<{
|
|
1357
|
+
status: z.ZodEnum<{
|
|
1358
|
+
completed: "completed";
|
|
1359
|
+
verified: "verified";
|
|
1360
|
+
failed: "failed";
|
|
1361
|
+
blocked: "blocked";
|
|
1362
|
+
cancelled: "cancelled";
|
|
1363
|
+
}>;
|
|
1364
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
1365
|
+
modelChoice: z.ZodOptional<z.ZodEnum<{
|
|
1366
|
+
right: "right";
|
|
1367
|
+
acceptable: "acceptable";
|
|
1368
|
+
wrong: "wrong";
|
|
1369
|
+
}>>;
|
|
1370
|
+
wouldUseAgain: z.ZodOptional<z.ZodBoolean>;
|
|
1371
|
+
}, z.core.$strict>;
|
|
1372
|
+
seq: z.ZodNumber;
|
|
1373
|
+
at: z.ZodISODateTime;
|
|
1374
|
+
actor: z.ZodEnum<{
|
|
1375
|
+
router: "router";
|
|
1376
|
+
"root-agent": "root-agent";
|
|
1377
|
+
delegate: "delegate";
|
|
1378
|
+
human: "human";
|
|
1379
|
+
system: "system";
|
|
1380
|
+
}>;
|
|
1381
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1382
|
+
type: z.ZodLiteral<"cancelled">;
|
|
1383
|
+
data: z.ZodObject<{
|
|
1384
|
+
by: z.ZodEnum<{
|
|
1385
|
+
router: "router";
|
|
1386
|
+
"root-agent": "root-agent";
|
|
1387
|
+
delegate: "delegate";
|
|
1388
|
+
human: "human";
|
|
1389
|
+
system: "system";
|
|
1390
|
+
}>;
|
|
1391
|
+
}, z.core.$strict>;
|
|
1392
|
+
seq: z.ZodNumber;
|
|
1393
|
+
at: z.ZodISODateTime;
|
|
1394
|
+
actor: z.ZodEnum<{
|
|
1395
|
+
router: "router";
|
|
1396
|
+
"root-agent": "root-agent";
|
|
1397
|
+
delegate: "delegate";
|
|
1398
|
+
human: "human";
|
|
1399
|
+
system: "system";
|
|
1400
|
+
}>;
|
|
1401
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1402
|
+
type: z.ZodLiteral<"expired">;
|
|
1403
|
+
data: z.ZodObject<{}, z.core.$strict>;
|
|
1404
|
+
seq: z.ZodNumber;
|
|
1405
|
+
at: z.ZodISODateTime;
|
|
1406
|
+
actor: z.ZodEnum<{
|
|
1407
|
+
router: "router";
|
|
1408
|
+
"root-agent": "root-agent";
|
|
1409
|
+
delegate: "delegate";
|
|
1410
|
+
human: "human";
|
|
1411
|
+
system: "system";
|
|
1412
|
+
}>;
|
|
1413
|
+
}, z.core.$strict>], "type">>;
|
|
1414
|
+
status: z.ZodEnum<{
|
|
1415
|
+
completed: "completed";
|
|
1416
|
+
failed: "failed";
|
|
1417
|
+
cancelled: "cancelled";
|
|
1418
|
+
planned: "planned";
|
|
1419
|
+
"awaiting-approval": "awaiting-approval";
|
|
1420
|
+
executing: "executing";
|
|
1421
|
+
verifying: "verifying";
|
|
1422
|
+
expired: "expired";
|
|
1423
|
+
}>;
|
|
1424
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
1425
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1426
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1427
|
+
contextTokensEstimated: z.ZodNumber;
|
|
1428
|
+
source: z.ZodEnum<{
|
|
1429
|
+
unknown: "unknown";
|
|
1430
|
+
reported: "reported";
|
|
1431
|
+
estimated: "estimated";
|
|
1432
|
+
}>;
|
|
1433
|
+
}, z.core.$strict>>;
|
|
1434
|
+
}, z.core.$strict>;
|
|
1435
|
+
type RunDocument = z.infer<typeof runDocumentSchema>;
|
|
1436
|
+
type EffectivePolicy = z.infer<typeof effectivePolicySchema>;
|
|
1437
|
+
type RunCandidate = z.infer<typeof runCandidateSchema>;
|
|
1438
|
+
type RunApproval = z.infer<typeof runApprovalSchema>;
|
|
1439
|
+
/** True when `event` may be appended to a run whose derived status is `status`. */
|
|
1440
|
+
declare function validateTransition(status: RunStatus | "none", event: Pick<RunEvent, "type">): boolean;
|
|
1441
|
+
/**
|
|
1442
|
+
* Derive the run status from the full event log. Pure and total: any event
|
|
1443
|
+
* list produces a status; invalid sequences should be rejected at append time
|
|
1444
|
+
* with {@link validateTransition} or {@link appendRunEvent}.
|
|
1445
|
+
*/
|
|
1446
|
+
declare function deriveRunStatus(events: readonly RunEvent[]): RunStatus | "none";
|
|
1447
|
+
/**
|
|
1448
|
+
* Validate and append one event: enforces schema strictness, monotonic `seq`,
|
|
1449
|
+
* and the transition table. Shared by the hosted coordinator and the local
|
|
1450
|
+
* client so both sides agree on what a legal Run history is.
|
|
1451
|
+
*/
|
|
1452
|
+
declare function appendRunEvent(events: readonly RunEvent[], candidate: RunEvent): RunEvent[];
|
|
1453
|
+
declare function isTerminalRunStatus(status: RunStatus): boolean;
|
|
1454
|
+
/**
|
|
1455
|
+
* Merge local and hosted policy into the effective policy stamped on a Run.
|
|
1456
|
+
* The hosted side can only narrow: ceilings combine by minimum, budgets by
|
|
1457
|
+
* minimum, harness allowlists by intersection. The objective is a preference,
|
|
1458
|
+
* so the local value wins when both are present. A hosted policy therefore can
|
|
1459
|
+
* never raise a local permission ceiling — a tampered or malicious hosted
|
|
1460
|
+
* response is inert.
|
|
1461
|
+
*/
|
|
1462
|
+
declare function mergePolicy(local: Partial<EffectivePolicy>, hosted?: Partial<EffectivePolicy>): EffectivePolicy;
|
|
1463
|
+
|
|
1464
|
+
export { AGENT_ROUTER_SCHEMA_VERSION, AGENT_ROUTER_VERSION, type AgentFeedback, type AgentModel, type AgentRouteRequest, type AgentRouteResponse, type AgentTaskFeatures, type Allowance, type ApprovalKind, type ClientSurface, type EffectivePolicy, type ExecutionPlan, type FeaturizeAgentTaskInput, type HarnessId, type PermissionProfile, RUN_SCHEMA_VERSION, type Readiness, type RouteSelection, type RoutingObjective, type RunActor, type RunApproval, type RunCandidate, type RunDocument, type RunEvent, type RunEventType, type RunStatus, type TaskRole, agentFeedbackSchema, agentModelSchema, agentRouteRequestSchema, agentRouteResponseSchema, agentTaskFeaturesSchema, allowanceSchema, appendRunEvent, approvalKindSchema, approvalSurfaceSchema, clientSurfaceSchema, deriveRunStatus, effectivePolicySchema, executionPlanSchema, featurizeAgentTask, harnessIdSchema, isTerminalRunStatus, mergePolicy, permissionProfileSchema, readinessSchema, routingObjectiveSchema, runActorSchema, runApprovalSchema, runCandidateSchema, runDocumentSchema, runEventSchema, runStatusSchema, selectAgentRoute, taskRoleSchema, taskTypeSchema, validateTransition, workflowSchema };
|