@oneharness/sdk 0.6.14 → 0.6.16
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/README.md +1 -1
- package/dist/generated/capabilities.d.ts +1010 -0
- package/dist/generated/capabilities.js +1162 -0
- package/dist/generated/config-options.d.ts +8 -0
- package/dist/generated/config-options.js +2 -0
- package/dist/generated/config-report.d.ts +283 -0
- package/dist/generated/config-report.js +2 -0
- package/dist/generated/detect-options.d.ts +19 -0
- package/dist/generated/detect-options.js +2 -0
- package/dist/generated/detection.d.ts +6 -0
- package/dist/generated/gate-options.d.ts +17 -0
- package/dist/generated/gate-options.js +2 -0
- package/dist/generated/history-clear-options.d.ts +15 -0
- package/dist/generated/history-clear-options.js +2 -0
- package/dist/generated/history-clear-report.d.ts +39 -0
- package/dist/generated/history-clear-report.js +2 -0
- package/dist/generated/history-list-options.d.ts +13 -0
- package/dist/generated/history-lookup.d.ts +26 -0
- package/dist/generated/history-migrate-options.d.ts +8 -0
- package/dist/generated/history-migrate-options.js +2 -0
- package/dist/generated/history-migrate-report.d.ts +31 -0
- package/dist/generated/history-migrate-report.js +2 -0
- package/dist/generated/history-watch-options.d.ts +13 -0
- package/dist/generated/init-options.d.ts +11 -0
- package/dist/generated/init-options.js +2 -0
- package/dist/generated/interrupt-options.d.ts +12 -0
- package/dist/generated/interrupt-options.js +2 -0
- package/dist/generated/interrupt-response.d.ts +40 -0
- package/dist/generated/interrupt-response.js +2 -0
- package/dist/generated/mock-options.d.ts +12 -0
- package/dist/generated/mock-options.js +2 -0
- package/dist/generated/options.d.ts +108 -0
- package/dist/generated/registry.d.ts +14 -4
- package/dist/generated/schemas.json +3245 -15
- package/dist/generated/sync-options.d.ts +14 -0
- package/dist/generated/sync-options.js +2 -0
- package/dist/generated/sync-report.d.ts +64 -0
- package/dist/generated/sync-report.js +2 -0
- package/dist/generated/usage-options.d.ts +15 -0
- package/dist/generated/usage-options.js +2 -0
- package/dist/generated/usage-report.d.ts +241 -0
- package/dist/generated/usage-report.js +2 -0
- package/dist/generated/zod.d.ts +70 -2
- package/dist/generated/zod.js +444 -0
- package/dist/index.d.ts +91 -1
- package/dist/index.js +271 -102
- package/package.json +2 -2
package/dist/generated/zod.js
CHANGED
|
@@ -19,6 +19,11 @@ export const ActionEventSchema = z.looseObject({
|
|
|
19
19
|
timing_source: z.union([z.lazy(() => TimingSourceSchema), z.null()]).optional(),
|
|
20
20
|
tool_call_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
21
21
|
});
|
|
22
|
+
export const AuthModeSchema = z.union([
|
|
23
|
+
z.literal("subscription"),
|
|
24
|
+
z.literal("api_key"),
|
|
25
|
+
z.literal("unknown"),
|
|
26
|
+
]);
|
|
22
27
|
export const BatchReportSchema = z.looseObject({
|
|
23
28
|
forked: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
|
|
24
29
|
prompt_count: z
|
|
@@ -28,6 +33,46 @@ export const BatchReportSchema = z.looseObject({
|
|
|
28
33
|
strategy: z.lazy(() => BatchStrategySchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
29
34
|
});
|
|
30
35
|
export const BatchStrategySchema = z.union([z.literal("speed"), z.literal("min-tokens")]);
|
|
36
|
+
export const ConfigOptionsSchema = z.strictObject({
|
|
37
|
+
config: z.string().optional(),
|
|
38
|
+
cwd: z.string().optional(),
|
|
39
|
+
noConfig: z.boolean().optional(),
|
|
40
|
+
});
|
|
41
|
+
export const ConfigReportSchema = z.looseObject({
|
|
42
|
+
all: z.lazy(() => FieldSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
43
|
+
allowed_tools: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
44
|
+
bypass: z.lazy(() => FieldSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
45
|
+
config_files: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
46
|
+
denied_tools: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
47
|
+
env: z
|
|
48
|
+
.record(z.string(), z.lazy(() => Field3Schema))
|
|
49
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
50
|
+
exclude: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
51
|
+
harness: z
|
|
52
|
+
.record(z.string(), z.lazy(() => HarnessReportSchema))
|
|
53
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
54
|
+
harnesses: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
55
|
+
history: z.lazy(() => FieldSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
56
|
+
history_dir: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
57
|
+
history_labels: z
|
|
58
|
+
.record(z.string(), z.lazy(() => Field3Schema))
|
|
59
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
60
|
+
hooks: z.lazy(() => Field10Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
61
|
+
max_parallel: z.lazy(() => Field8Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
62
|
+
mode: z.lazy(() => Field4Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
63
|
+
model: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
64
|
+
models: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
65
|
+
output_format: z.lazy(() => Field6Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
66
|
+
reasoning: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
67
|
+
require_available: z.lazy(() => FieldSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
68
|
+
run_mode: z.lazy(() => Field9Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
69
|
+
schema_file: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
70
|
+
schema_max_retries: z.lazy(() => Field7Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
71
|
+
schema_version: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
72
|
+
stream: z.lazy(() => FieldSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
73
|
+
system: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
74
|
+
timeout: z.lazy(() => Field5Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
75
|
+
});
|
|
31
76
|
export const ControlEventSchema = z.union([
|
|
32
77
|
z.looseObject({
|
|
33
78
|
at: z.lazy(() => UtcInstantSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
@@ -67,6 +112,15 @@ export const DetectInfoSchema = z.looseObject({
|
|
|
67
112
|
path: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
68
113
|
version: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
69
114
|
});
|
|
115
|
+
export const DetectOptionsSchema = z.strictObject({
|
|
116
|
+
all: z.boolean().optional(),
|
|
117
|
+
bins: z.record(z.string(), z.string()).optional(),
|
|
118
|
+
config: z.string().optional(),
|
|
119
|
+
exclude: z.array(z.string()).optional(),
|
|
120
|
+
harnesses: z.array(z.string()).optional(),
|
|
121
|
+
noConfig: z.boolean().optional(),
|
|
122
|
+
requireAvailable: z.boolean().optional(),
|
|
123
|
+
});
|
|
70
124
|
export const DetectReportSchema = z.looseObject({
|
|
71
125
|
detected: z.array(z.lazy(() => DetectInfoSchema)).refine((value) => value !== undefined, { message: "Required" }),
|
|
72
126
|
schema_version: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
@@ -126,6 +180,68 @@ export const FallbackReportSchema = z.looseObject({
|
|
|
126
180
|
.refine((value) => value !== undefined, { message: "Required" }),
|
|
127
181
|
ran: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
128
182
|
});
|
|
183
|
+
export const FieldSchema = z.looseObject({
|
|
184
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
185
|
+
value: z.union([z.boolean(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
186
|
+
});
|
|
187
|
+
export const Field10Schema = z.looseObject({
|
|
188
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
189
|
+
value: z
|
|
190
|
+
.union([z.array(z.lazy(() => HookEntrySchema)), z.null()])
|
|
191
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
192
|
+
});
|
|
193
|
+
export const Field2Schema = z.looseObject({
|
|
194
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
195
|
+
value: z.union([z.array(z.string()), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
196
|
+
});
|
|
197
|
+
export const Field3Schema = z.looseObject({
|
|
198
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
199
|
+
value: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
200
|
+
});
|
|
201
|
+
export const Field4Schema = z.looseObject({
|
|
202
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
203
|
+
value: z
|
|
204
|
+
.union([z.lazy(() => PermissionModeSchema), z.null()])
|
|
205
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
206
|
+
});
|
|
207
|
+
export const Field5Schema = z.looseObject({
|
|
208
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
209
|
+
value: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
210
|
+
});
|
|
211
|
+
export const Field6Schema = z.looseObject({
|
|
212
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
213
|
+
value: z
|
|
214
|
+
.union([z.lazy(() => OutputFormatSchema), z.null()])
|
|
215
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
216
|
+
});
|
|
217
|
+
export const Field7Schema = z.looseObject({
|
|
218
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
219
|
+
value: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
220
|
+
});
|
|
221
|
+
export const Field8Schema = z.looseObject({
|
|
222
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
223
|
+
value: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
224
|
+
});
|
|
225
|
+
export const Field9Schema = z.looseObject({
|
|
226
|
+
source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
227
|
+
value: z
|
|
228
|
+
.union([z.lazy(() => RunModeSchema), z.null()])
|
|
229
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
230
|
+
});
|
|
231
|
+
export const FileStatusSchema = z.union([
|
|
232
|
+
z.literal("created"),
|
|
233
|
+
z.literal("updated"),
|
|
234
|
+
z.literal("unchanged"),
|
|
235
|
+
]);
|
|
236
|
+
export const GateOptionsSchema = z.strictObject({
|
|
237
|
+
denyIfContains: z.string().optional(),
|
|
238
|
+
event: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
239
|
+
harness: z
|
|
240
|
+
.string()
|
|
241
|
+
.min(1)
|
|
242
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
243
|
+
reason: z.string().optional(),
|
|
244
|
+
});
|
|
129
245
|
export const HarnessInfoSchema = z.looseObject({
|
|
130
246
|
control: z
|
|
131
247
|
.union([z.lazy(() => ControlShapeSchema), z.null()])
|
|
@@ -153,6 +269,51 @@ export const HarnessInfoSchema = z.looseObject({
|
|
|
153
269
|
sync_file: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
154
270
|
variants: z.array(z.lazy(() => VariantInfoSchema)).refine((value) => value !== undefined, { message: "Required" }),
|
|
155
271
|
});
|
|
272
|
+
export const HarnessReportSchema = z.looseObject({
|
|
273
|
+
allowed_tools: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
274
|
+
args: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
275
|
+
bin: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
276
|
+
denied_tools: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
277
|
+
env: z
|
|
278
|
+
.record(z.string(), z.lazy(() => Field3Schema))
|
|
279
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
280
|
+
hooks: z.looseObject({}).refine((value) => value !== undefined, { message: "Required" }),
|
|
281
|
+
model: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
282
|
+
reasoning: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
283
|
+
settings: z.looseObject({}).refine((value) => value !== undefined, { message: "Required" }),
|
|
284
|
+
variant: z
|
|
285
|
+
.record(z.string(), z.lazy(() => VariantReportSchema))
|
|
286
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
287
|
+
});
|
|
288
|
+
export const HistoryClearDryRunSchema = z.looseObject({
|
|
289
|
+
dry_run: z.literal(true).refine((value) => value !== undefined, { message: "Required" }),
|
|
290
|
+
files: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
291
|
+
hint: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
292
|
+
would_remove: z
|
|
293
|
+
.int()
|
|
294
|
+
.gte(0)
|
|
295
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
296
|
+
});
|
|
297
|
+
export const HistoryClearOptionsSchema = z.strictObject({
|
|
298
|
+
allProjects: z.boolean().optional(),
|
|
299
|
+
config: z.string().optional(),
|
|
300
|
+
historyDir: z.string().optional(),
|
|
301
|
+
noConfig: z.boolean().optional(),
|
|
302
|
+
project: z.string().optional(),
|
|
303
|
+
yes: z.boolean().optional(),
|
|
304
|
+
});
|
|
305
|
+
export const HistoryClearRemovedSchema = z.looseObject({
|
|
306
|
+
dry_run: z.literal(false).refine((value) => value !== undefined, { message: "Required" }),
|
|
307
|
+
files: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
308
|
+
removed: z
|
|
309
|
+
.int()
|
|
310
|
+
.gte(0)
|
|
311
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
312
|
+
});
|
|
313
|
+
export const HistoryClearReportSchema = z.union([
|
|
314
|
+
z.lazy(() => HistoryClearRemovedSchema),
|
|
315
|
+
z.lazy(() => HistoryClearDryRunSchema),
|
|
316
|
+
]);
|
|
156
317
|
export const HistoryEventLineSchema = z.union([
|
|
157
318
|
z.looseObject({
|
|
158
319
|
event: z.lazy(() => ActionEventSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
@@ -726,30 +887,51 @@ export const HistoryLineSchema = z.union([
|
|
|
726
887
|
export const HistoryListSchema = z.array(z.lazy(() => HistorySessionSummarySchema));
|
|
727
888
|
export const HistoryListOptionsSchema = z.strictObject({
|
|
728
889
|
allProjects: z.boolean().optional(),
|
|
890
|
+
config: z.string().optional(),
|
|
729
891
|
historyDir: z.string().optional(),
|
|
892
|
+
noConfig: z.boolean().optional(),
|
|
730
893
|
project: z.string().optional(),
|
|
894
|
+
variant: z.string().optional(),
|
|
731
895
|
});
|
|
732
896
|
export const HistoryLookupSchema = z.union([
|
|
733
897
|
z.lazy(() => HistoryLookupByLastSchema),
|
|
734
898
|
z.lazy(() => HistoryLookupBySessionSchema),
|
|
735
899
|
]);
|
|
736
900
|
export const HistoryLookupByLastSchema = z.strictObject({
|
|
901
|
+
all: z.boolean().optional(),
|
|
737
902
|
allProjects: z.boolean().optional(),
|
|
903
|
+
config: z.string().optional(),
|
|
738
904
|
historyDir: z.string().optional(),
|
|
739
905
|
last: z.literal(true).refine((value) => value !== undefined, { message: "Required" }),
|
|
906
|
+
noConfig: z.boolean().optional(),
|
|
740
907
|
project: z.string().optional(),
|
|
741
908
|
session: z.string().optional(),
|
|
742
909
|
});
|
|
743
910
|
export const HistoryLookupBySessionSchema = z.strictObject({
|
|
911
|
+
all: z.boolean().optional(),
|
|
744
912
|
allProjects: z.boolean().optional(),
|
|
913
|
+
config: z.string().optional(),
|
|
745
914
|
historyDir: z.string().optional(),
|
|
746
915
|
last: z.boolean().optional(),
|
|
916
|
+
noConfig: z.boolean().optional(),
|
|
747
917
|
project: z.string().optional(),
|
|
748
918
|
session: z
|
|
749
919
|
.string()
|
|
750
920
|
.min(1)
|
|
751
921
|
.refine((value) => value !== undefined, { message: "Required" }),
|
|
752
922
|
});
|
|
923
|
+
export const HistoryMigrateOptionsSchema = z.strictObject({
|
|
924
|
+
config: z.string().optional(),
|
|
925
|
+
historyDir: z.string().optional(),
|
|
926
|
+
noConfig: z.boolean().optional(),
|
|
927
|
+
});
|
|
928
|
+
export const HistoryMigrateReportSchema = z.looseObject({
|
|
929
|
+
files: z.array(z.lazy(() => MigrationSummarySchema)).refine((value) => value !== undefined, { message: "Required" }),
|
|
930
|
+
files_processed: z
|
|
931
|
+
.int()
|
|
932
|
+
.gte(0)
|
|
933
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
934
|
+
});
|
|
753
935
|
export const HistoryRecordSchema = z.intersection(z.intersection(z.intersection(z.union([
|
|
754
936
|
z.looseObject({
|
|
755
937
|
duration_ms: z
|
|
@@ -1570,15 +1752,98 @@ export const HistoryWatchOptionsSchema = z.strictObject({
|
|
|
1570
1752
|
.refine((value) => [...value].length <= 36, { message: "Too long: expected at most 36 characters" })
|
|
1571
1753
|
.optional(),
|
|
1572
1754
|
allProjects: z.boolean().optional(),
|
|
1755
|
+
config: z.string().optional(),
|
|
1573
1756
|
events: z.boolean().optional(),
|
|
1574
1757
|
historyDir: z.string().optional(),
|
|
1575
1758
|
labels: z.lazy(() => HistoryLabelsSchema).optional(),
|
|
1759
|
+
noConfig: z.boolean().optional(),
|
|
1576
1760
|
project: z.string().optional(),
|
|
1761
|
+
variant: z.string().optional(),
|
|
1762
|
+
});
|
|
1763
|
+
export const HookEntrySchema = z.strictObject({
|
|
1764
|
+
command: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1765
|
+
harnesses: z.union([z.array(z.string()), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
1766
|
+
matcher: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
1767
|
+
plugin_name: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
1768
|
+
timeout: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
1577
1769
|
});
|
|
1770
|
+
export const HookFileResultSchema = z.looseObject({
|
|
1771
|
+
file: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1772
|
+
status: z.lazy(() => FileStatusSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
1773
|
+
});
|
|
1774
|
+
export const IdentitySelectorSchema = z.union([
|
|
1775
|
+
z.looseObject({
|
|
1776
|
+
env: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1777
|
+
kind: z.literal("env_path").refine((value) => value !== undefined, { message: "Required" }),
|
|
1778
|
+
path: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1779
|
+
}),
|
|
1780
|
+
z.looseObject({
|
|
1781
|
+
env: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1782
|
+
kind: z.literal("env_secret").refine((value) => value !== undefined, { message: "Required" }),
|
|
1783
|
+
}),
|
|
1784
|
+
z.looseObject({
|
|
1785
|
+
kind: z.literal("ambient").refine((value) => value !== undefined, { message: "Required" }),
|
|
1786
|
+
}),
|
|
1787
|
+
]);
|
|
1788
|
+
export const InitOptionsSchema = z.strictObject({
|
|
1789
|
+
force: z.boolean().optional(),
|
|
1790
|
+
path: z.string().optional(),
|
|
1791
|
+
});
|
|
1792
|
+
export const InterruptOptionsSchema = z.strictObject({
|
|
1793
|
+
cwd: z.string().optional(),
|
|
1794
|
+
input: z.string().optional(),
|
|
1795
|
+
session: z
|
|
1796
|
+
.string()
|
|
1797
|
+
.min(1)
|
|
1798
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
1799
|
+
sessionDir: z.string().optional(),
|
|
1800
|
+
});
|
|
1801
|
+
export const InterruptResponseSchema = z.union([
|
|
1802
|
+
z.looseObject({
|
|
1803
|
+
error: z.never().optional(),
|
|
1804
|
+
mechanism: z.lazy(() => ControlShapeSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
1805
|
+
ok: z.literal(true).refine((value) => value !== undefined, { message: "Required" }),
|
|
1806
|
+
reason: z.never().optional(),
|
|
1807
|
+
redirected: z.boolean().optional(),
|
|
1808
|
+
v: z.literal(2).refine((value) => value !== undefined, { message: "Required" }),
|
|
1809
|
+
}),
|
|
1810
|
+
z.looseObject({
|
|
1811
|
+
error: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1812
|
+
mechanism: z.never().optional(),
|
|
1813
|
+
ok: z.literal(false).refine((value) => value !== undefined, { message: "Required" }),
|
|
1814
|
+
reason: z.lazy(() => ControlReasonSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
1815
|
+
redirected: z.literal(false).optional(),
|
|
1816
|
+
v: z.literal(2).refine((value) => value !== undefined, { message: "Required" }),
|
|
1817
|
+
}),
|
|
1818
|
+
]);
|
|
1578
1819
|
export const ListReportSchema = z.looseObject({
|
|
1579
1820
|
harnesses: z.array(z.lazy(() => HarnessInfoSchema)).refine((value) => value !== undefined, { message: "Required" }),
|
|
1580
1821
|
schema_version: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1581
1822
|
});
|
|
1823
|
+
export const MigrationSummarySchema = z.looseObject({
|
|
1824
|
+
already_current: z
|
|
1825
|
+
.int()
|
|
1826
|
+
.gte(0)
|
|
1827
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
1828
|
+
path: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1829
|
+
records_migrated: z
|
|
1830
|
+
.int()
|
|
1831
|
+
.gte(0)
|
|
1832
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
1833
|
+
skipped: z
|
|
1834
|
+
.int()
|
|
1835
|
+
.gte(0)
|
|
1836
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
1837
|
+
});
|
|
1838
|
+
export const MockOptionsSchema = z.strictObject({
|
|
1839
|
+
event: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1840
|
+
harness: z
|
|
1841
|
+
.string()
|
|
1842
|
+
.min(1)
|
|
1843
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
1844
|
+
rules: z.string().optional(),
|
|
1845
|
+
spyFile: z.string().optional(),
|
|
1846
|
+
});
|
|
1582
1847
|
export const ModeHeadlessSchema = z.union([z.literal("clean"), z.literal("hangs")]);
|
|
1583
1848
|
export const ModeInfoSchema = z.looseObject({
|
|
1584
1849
|
headless: z.lazy(() => ModeHeadlessSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
@@ -1597,27 +1862,62 @@ export const PermissionModeSchema = z.union([
|
|
|
1597
1862
|
z.literal("auto"),
|
|
1598
1863
|
z.literal("bypass"),
|
|
1599
1864
|
]);
|
|
1865
|
+
export const QuotaAmountSchema = z.int().gte(0);
|
|
1866
|
+
export const QuotaCountersSchema = z.looseObject({
|
|
1867
|
+
entitlement: z.lazy(() => QuotaAmountSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
1868
|
+
has_quota: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
|
|
1869
|
+
overage_permitted: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
|
|
1870
|
+
remaining: z.int().refine((value) => value !== undefined, { message: "Required" }),
|
|
1871
|
+
unit: z.lazy(() => QuotaUnitSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
1872
|
+
used: z.lazy(() => QuotaAmountSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
1873
|
+
});
|
|
1874
|
+
export const QuotaUnitSchema = z.union([z.literal("ai_credits"), z.literal("unspecified")]);
|
|
1875
|
+
export const RunModeSchema = z.union([z.literal("parallel"), z.literal("fallback")]);
|
|
1600
1876
|
export const RunOptionsSchema = z.strictObject({
|
|
1877
|
+
all: z.boolean().optional(),
|
|
1878
|
+
batchPrompts: z.array(z.string()).optional(),
|
|
1879
|
+
batchStrategy: z.lazy(() => BatchStrategySchema).optional(),
|
|
1601
1880
|
bins: z.record(z.string(), z.string()).optional(),
|
|
1881
|
+
config: z.string().optional(),
|
|
1882
|
+
control: z.boolean().optional(),
|
|
1602
1883
|
cwd: z.string().optional(),
|
|
1603
1884
|
env: z.record(z.string(), z.string()).optional(),
|
|
1604
1885
|
events: z.boolean().optional(),
|
|
1886
|
+
exclude: z.array(z.string()).optional(),
|
|
1605
1887
|
fork: z.boolean().optional(),
|
|
1606
1888
|
harnesses: z.array(z.string()).optional(),
|
|
1607
1889
|
history: z.boolean().optional(),
|
|
1608
1890
|
historyDir: z.string().optional(),
|
|
1609
1891
|
historyLabels: z.lazy(() => HistoryLabelsSchema).optional(),
|
|
1610
1892
|
historyName: z.string().optional(),
|
|
1893
|
+
maxParallel: z.int().gte(0).optional(),
|
|
1894
|
+
mockHarnesses: z.array(z.string()).optional(),
|
|
1895
|
+
mockRules: z.string().optional(),
|
|
1611
1896
|
mode: z.lazy(() => PermissionModeSchema).optional(),
|
|
1612
1897
|
models: z.array(z.string()).optional(),
|
|
1898
|
+
noConfig: z.boolean().optional(),
|
|
1899
|
+
noHistory: z.boolean().optional(),
|
|
1900
|
+
outputDir: z.string().optional(),
|
|
1901
|
+
outputFormat: z.lazy(() => OutputFormatSchema).optional(),
|
|
1902
|
+
passthrough: z.array(z.string()).optional(),
|
|
1903
|
+
permitPrompts: z.boolean().optional(),
|
|
1904
|
+
printCommand: z.boolean().optional(),
|
|
1613
1905
|
prompt: z
|
|
1614
1906
|
.string()
|
|
1615
1907
|
.min(1)
|
|
1616
1908
|
.refine((value) => value !== undefined, { message: "Required" }),
|
|
1909
|
+
promptFiles: z.array(z.string()).optional(),
|
|
1617
1910
|
reasoning: z.string().optional(),
|
|
1911
|
+
requireAvailable: z.boolean().optional(),
|
|
1618
1912
|
resume: z.string().optional(),
|
|
1913
|
+
runMode: z.lazy(() => RunModeSchema).optional(),
|
|
1914
|
+
schema: z.string().optional(),
|
|
1915
|
+
schemaMaxRetries: z.int().gte(0).optional(),
|
|
1619
1916
|
session: z.string().optional(),
|
|
1917
|
+
sessionDir: z.string().optional(),
|
|
1918
|
+
spyFile: z.string().optional(),
|
|
1620
1919
|
system: z.string().optional(),
|
|
1920
|
+
systemFile: z.string().optional(),
|
|
1621
1921
|
timeoutSeconds: z.int().gte(0).optional(),
|
|
1622
1922
|
});
|
|
1623
1923
|
export const RunReportSchema = z.looseObject({
|
|
@@ -1716,6 +2016,33 @@ export const StatusSchema = z.union([
|
|
|
1716
2016
|
z.literal("skipped"),
|
|
1717
2017
|
z.literal("planned"),
|
|
1718
2018
|
]);
|
|
2019
|
+
export const SyncOptionsSchema = z.strictObject({
|
|
2020
|
+
check: z.boolean().optional(),
|
|
2021
|
+
config: z.string().optional(),
|
|
2022
|
+
cwd: z.string().optional(),
|
|
2023
|
+
global: z.boolean().optional(),
|
|
2024
|
+
harnesses: z.array(z.string()).optional(),
|
|
2025
|
+
noConfig: z.boolean().optional(),
|
|
2026
|
+
});
|
|
2027
|
+
export const SyncReportSchema = z.looseObject({
|
|
2028
|
+
check: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
|
|
2029
|
+
config_files: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
2030
|
+
results: z.array(z.lazy(() => SyncResultSchema)).refine((value) => value !== undefined, { message: "Required" }),
|
|
2031
|
+
schema_version: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
2032
|
+
});
|
|
2033
|
+
export const SyncResultSchema = z.looseObject({
|
|
2034
|
+
file: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
2035
|
+
harness: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
2036
|
+
hooks: z.array(z.lazy(() => HookFileResultSchema)).refine((value) => value !== undefined, { message: "Required" }),
|
|
2037
|
+
status: z.lazy(() => SyncStatusSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2038
|
+
unmapped: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
2039
|
+
});
|
|
2040
|
+
export const SyncStatusSchema = z.union([
|
|
2041
|
+
z.literal("created"),
|
|
2042
|
+
z.literal("updated"),
|
|
2043
|
+
z.literal("unchanged"),
|
|
2044
|
+
z.literal("skipped"),
|
|
2045
|
+
]);
|
|
1719
2046
|
export const TimingSourceSchema = z.union([
|
|
1720
2047
|
z.literal("provider_measured"),
|
|
1721
2048
|
z.literal("stdout_observed"),
|
|
@@ -1726,6 +2053,26 @@ export const ToolCallStatusSchema = z.union([
|
|
|
1726
2053
|
z.literal("timeout"),
|
|
1727
2054
|
z.literal("interrupted"),
|
|
1728
2055
|
]);
|
|
2056
|
+
export const UnavailableReasonSchema = z.union([
|
|
2057
|
+
z.literal("api_key_auth"),
|
|
2058
|
+
z.literal("not_logged_in"),
|
|
2059
|
+
z.literal("no_windows_reported"),
|
|
2060
|
+
z.literal("no_plan_quota"),
|
|
2061
|
+
z.literal("no_headroom_reader"),
|
|
2062
|
+
]);
|
|
2063
|
+
export const UnknownReasonSchema = z.union([
|
|
2064
|
+
z.looseObject({
|
|
2065
|
+
kind: z.literal("unprobed").refine((value) => value !== undefined, { message: "Required" }),
|
|
2066
|
+
}),
|
|
2067
|
+
z.looseObject({
|
|
2068
|
+
kind: z.literal("probe_failed").refine((value) => value !== undefined, { message: "Required" }),
|
|
2069
|
+
message: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
2070
|
+
}),
|
|
2071
|
+
z.looseObject({
|
|
2072
|
+
bin: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
2073
|
+
kind: z.literal("binary_missing").refine((value) => value !== undefined, { message: "Required" }),
|
|
2074
|
+
}),
|
|
2075
|
+
]);
|
|
1729
2076
|
export const UsageSchema = z.looseObject({
|
|
1730
2077
|
cache_read_tokens: z
|
|
1731
2078
|
.union([z.int().gte(0), z.null()])
|
|
@@ -1737,6 +2084,74 @@ export const UsageSchema = z.looseObject({
|
|
|
1737
2084
|
input_tokens: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
1738
2085
|
output_tokens: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
|
|
1739
2086
|
});
|
|
2087
|
+
export const UsageAvailabilitySchema = z.union([
|
|
2088
|
+
z.looseObject({
|
|
2089
|
+
state: z.literal("available").refine((value) => value !== undefined, { message: "Required" }),
|
|
2090
|
+
windows: z.lazy(() => WindowsSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2091
|
+
}),
|
|
2092
|
+
z.looseObject({
|
|
2093
|
+
reason: z.lazy(() => UnavailableReasonSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2094
|
+
state: z.literal("unavailable").refine((value) => value !== undefined, { message: "Required" }),
|
|
2095
|
+
}),
|
|
2096
|
+
z.looseObject({
|
|
2097
|
+
reason: z.lazy(() => UnknownReasonSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2098
|
+
state: z.literal("unknown").refine((value) => value !== undefined, { message: "Required" }),
|
|
2099
|
+
}),
|
|
2100
|
+
]);
|
|
2101
|
+
export const UsageIdentitySchema = z.looseObject({
|
|
2102
|
+
auth_mode: z.lazy(() => AuthModeSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2103
|
+
availability: z.lazy(() => UsageAvailabilitySchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2104
|
+
harness: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
2105
|
+
plan: z.union([z.string(), z.null()]).optional(),
|
|
2106
|
+
selector: z.lazy(() => IdentitySelectorSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2107
|
+
variant: z.union([z.string(), z.null()]).optional(),
|
|
2108
|
+
});
|
|
2109
|
+
export const UsageOptionsSchema = z.strictObject({
|
|
2110
|
+
all: z.boolean().optional(),
|
|
2111
|
+
bins: z.record(z.string(), z.string()).optional(),
|
|
2112
|
+
config: z.string().optional(),
|
|
2113
|
+
cwd: z.string().optional(),
|
|
2114
|
+
exclude: z.array(z.string()).optional(),
|
|
2115
|
+
harnesses: z.array(z.string()).optional(),
|
|
2116
|
+
noConfig: z.boolean().optional(),
|
|
2117
|
+
timeoutSeconds: z.int().gte(0).optional(),
|
|
2118
|
+
});
|
|
2119
|
+
export const UsageReportSchema = z.looseObject({
|
|
2120
|
+
identities: z
|
|
2121
|
+
.array(z.lazy(() => UsageIdentitySchema))
|
|
2122
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
2123
|
+
observed_at: z.lazy(() => UtcInstantSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2124
|
+
schema_version: z.literal("0.1").refine((value) => value !== undefined, { message: "Required" }),
|
|
2125
|
+
});
|
|
2126
|
+
export const UsageWindowSchema = z.intersection(z.looseObject({
|
|
2127
|
+
id: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
2128
|
+
is_binding: z.union([z.boolean(), z.null()]).optional(),
|
|
2129
|
+
label: z.union([z.string(), z.null()]).optional(),
|
|
2130
|
+
resets_at: z.union([z.lazy(() => UtcInstantSchema), z.null()]).optional(),
|
|
2131
|
+
scope: z.union([z.string(), z.null()]).optional(),
|
|
2132
|
+
usage: z.lazy(() => WindowUsageSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2133
|
+
}), z.union([
|
|
2134
|
+
z.looseObject({
|
|
2135
|
+
window_seconds: z
|
|
2136
|
+
.int()
|
|
2137
|
+
.gte(1)
|
|
2138
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
2139
|
+
window_seconds_source: z.literal("reported").refine((value) => value !== undefined, { message: "Required" }),
|
|
2140
|
+
}),
|
|
2141
|
+
z.looseObject({
|
|
2142
|
+
window_seconds: z
|
|
2143
|
+
.int()
|
|
2144
|
+
.gte(1)
|
|
2145
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
2146
|
+
window_seconds_source: z
|
|
2147
|
+
.literal("inferred_from_id")
|
|
2148
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
2149
|
+
}),
|
|
2150
|
+
z.looseObject({
|
|
2151
|
+
window_seconds_source: z.literal("unknown").refine((value) => value !== undefined, { message: "Required" }),
|
|
2152
|
+
}),
|
|
2153
|
+
]));
|
|
2154
|
+
export const UsedPercentSchema = z.number().gte(0);
|
|
1740
2155
|
export const UtcInstantSchema = z.string();
|
|
1741
2156
|
export const VariantInfoSchema = z.looseObject({
|
|
1742
2157
|
args: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
@@ -1749,3 +2164,32 @@ export const VariantInfoSchema = z.looseObject({
|
|
|
1749
2164
|
name: z.string().refine((value) => value !== undefined, { message: "Required" }),
|
|
1750
2165
|
unset_env: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
|
|
1751
2166
|
});
|
|
2167
|
+
export const VariantReportSchema = z.looseObject({
|
|
2168
|
+
allowed_tools: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2169
|
+
args: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2170
|
+
bin: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2171
|
+
denied_tools: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2172
|
+
env: z
|
|
2173
|
+
.record(z.string(), z.lazy(() => Field3Schema))
|
|
2174
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
2175
|
+
env_file: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2176
|
+
env_from: z
|
|
2177
|
+
.record(z.string(), z.lazy(() => Field3Schema))
|
|
2178
|
+
.refine((value) => value !== undefined, { message: "Required" }),
|
|
2179
|
+
hooks: z.looseObject({}).refine((value) => value !== undefined, { message: "Required" }),
|
|
2180
|
+
model: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2181
|
+
reasoning: z.lazy(() => Field3Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2182
|
+
settings: z.looseObject({}).refine((value) => value !== undefined, { message: "Required" }),
|
|
2183
|
+
unset_env: z.lazy(() => Field2Schema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2184
|
+
});
|
|
2185
|
+
export const WindowUsageSchema = z.union([
|
|
2186
|
+
z.looseObject({
|
|
2187
|
+
counters: z.union([z.lazy(() => QuotaCountersSchema), z.null()]).optional(),
|
|
2188
|
+
kind: z.literal("metered").refine((value) => value !== undefined, { message: "Required" }),
|
|
2189
|
+
used_percent: z.lazy(() => UsedPercentSchema).refine((value) => value !== undefined, { message: "Required" }),
|
|
2190
|
+
}),
|
|
2191
|
+
z.looseObject({
|
|
2192
|
+
kind: z.literal("unlimited").refine((value) => value !== undefined, { message: "Required" }),
|
|
2193
|
+
}),
|
|
2194
|
+
]);
|
|
2195
|
+
export const WindowsSchema = z.array(z.lazy(() => UsageWindowSchema));
|