@withgauge/cli 0.7.0 → 0.8.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/README.md +7 -1
- package/dist/index.js +1861 -1526
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57,6 +57,26 @@ var updateActionBodySchema = z.object({
|
|
|
57
57
|
note: z.string().max(2e3).optional()
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
// ../packages/api-schemas/src/aiTraffic.ts
|
|
61
|
+
import { z as z2 } from "zod";
|
|
62
|
+
var drainPlatformSchema = z2.enum(["cloudflare", "custom", "vercel"]);
|
|
63
|
+
var createDrainRequestSchema = z2.object({
|
|
64
|
+
platform: drainPlatformSchema.default("custom")
|
|
65
|
+
});
|
|
66
|
+
var drainSchema = z2.object({
|
|
67
|
+
id: z2.number().int().positive(),
|
|
68
|
+
tenantId: z2.string().uuid(),
|
|
69
|
+
platform: drainPlatformSchema,
|
|
70
|
+
drainUrl: z2.string().url(),
|
|
71
|
+
firstEventReceivedAt: z2.string().nullable(),
|
|
72
|
+
revokedAt: z2.string().nullable(),
|
|
73
|
+
/** One-time credential, present only on create/rotation. */
|
|
74
|
+
secret: z2.string().nullable().optional()
|
|
75
|
+
});
|
|
76
|
+
var listDrainsResponseSchema = z2.object({
|
|
77
|
+
items: z2.array(drainSchema.omit({ secret: true }))
|
|
78
|
+
});
|
|
79
|
+
|
|
60
80
|
// ../packages/api-schemas/src/batteries.ts
|
|
61
81
|
var batteries_exports = {};
|
|
62
82
|
__export(batteries_exports, {
|
|
@@ -83,10 +103,10 @@ __export(batteries_exports, {
|
|
|
83
103
|
batterySkillsSchema: () => batterySkillsSchema,
|
|
84
104
|
batterySpecSchema: () => batterySpecSchema
|
|
85
105
|
});
|
|
86
|
-
import { z as
|
|
106
|
+
import { z as z4 } from "zod";
|
|
87
107
|
|
|
88
108
|
// ../packages/api-schemas/src/common.ts
|
|
89
|
-
import { z as
|
|
109
|
+
import { z as z3 } from "zod";
|
|
90
110
|
var ERROR_CODES = [
|
|
91
111
|
"unauthorized",
|
|
92
112
|
"forbidden",
|
|
@@ -102,26 +122,41 @@ var ERROR_CODES = [
|
|
|
102
122
|
// pre-0.6 clients drop the message on any code outside their enum.
|
|
103
123
|
"upgrade_required"
|
|
104
124
|
];
|
|
105
|
-
var errorCodeSchema =
|
|
106
|
-
var
|
|
107
|
-
|
|
125
|
+
var errorCodeSchema = z3.enum(ERROR_CODES);
|
|
126
|
+
var upgradeOfferSchema = z3.object({
|
|
127
|
+
skuId: z3.string(),
|
|
128
|
+
tierLabel: z3.string(),
|
|
129
|
+
monthlyAmountCents: z3.number().int(),
|
|
130
|
+
monthlyCredits: z3.number().int(),
|
|
131
|
+
/** Browser URL of the organization's billing page. */
|
|
132
|
+
billingUrl: z3.string()
|
|
133
|
+
});
|
|
134
|
+
var errorEnvelopeSchema = z3.object({
|
|
135
|
+
error: z3.object({
|
|
108
136
|
code: errorCodeSchema,
|
|
109
|
-
message:
|
|
137
|
+
message: z3.string(),
|
|
138
|
+
upgrade: upgradeOfferSchema.optional()
|
|
110
139
|
})
|
|
111
140
|
});
|
|
112
|
-
var listQuerySchema =
|
|
113
|
-
limit:
|
|
114
|
-
cursor:
|
|
141
|
+
var listQuerySchema = z3.object({
|
|
142
|
+
limit: z3.coerce.number().int().min(1).max(200).default(50),
|
|
143
|
+
cursor: z3.string().optional()
|
|
115
144
|
});
|
|
116
145
|
function listResponseSchema(item) {
|
|
117
|
-
return
|
|
118
|
-
items:
|
|
119
|
-
nextCursor:
|
|
146
|
+
return z3.object({
|
|
147
|
+
items: z3.array(item),
|
|
148
|
+
nextCursor: z3.string().optional()
|
|
120
149
|
});
|
|
121
150
|
}
|
|
122
151
|
|
|
123
152
|
// ../packages/api-schemas/src/batteries.ts
|
|
124
|
-
var BATTERY_AGENTS = [
|
|
153
|
+
var BATTERY_AGENTS = [
|
|
154
|
+
"CLAUDE_CODE",
|
|
155
|
+
"CODEX_CLI",
|
|
156
|
+
"CURSOR",
|
|
157
|
+
"PI",
|
|
158
|
+
"OPENCODE"
|
|
159
|
+
];
|
|
125
160
|
var BATTERY_CADENCES = [
|
|
126
161
|
"NONE",
|
|
127
162
|
"DAILY",
|
|
@@ -129,111 +164,111 @@ var BATTERY_CADENCES = [
|
|
|
129
164
|
"MONTHLY",
|
|
130
165
|
"DAYS_PER_WEEK"
|
|
131
166
|
];
|
|
132
|
-
var batteryAgentSchema =
|
|
167
|
+
var batteryAgentSchema = z4.enum(BATTERY_AGENTS);
|
|
133
168
|
var BATTERY_MAX_LIMITS = {
|
|
134
169
|
maxTurns: 30,
|
|
135
170
|
wallClockS: 1800,
|
|
136
171
|
maxUsd: 10
|
|
137
172
|
};
|
|
138
173
|
var MAX_SAMPLES_PER_CYCLE = 50;
|
|
139
|
-
var batteryLimitsSchema =
|
|
140
|
-
maxTurns:
|
|
141
|
-
wallClockS:
|
|
142
|
-
maxUsd:
|
|
174
|
+
var batteryLimitsSchema = z4.object({
|
|
175
|
+
maxTurns: z4.number().positive().max(BATTERY_MAX_LIMITS.maxTurns).optional(),
|
|
176
|
+
wallClockS: z4.number().positive().max(BATTERY_MAX_LIMITS.wallClockS).optional(),
|
|
177
|
+
maxUsd: z4.number().positive().max(BATTERY_MAX_LIMITS.maxUsd).optional()
|
|
143
178
|
});
|
|
144
|
-
var batterySkillRefSchema =
|
|
179
|
+
var batterySkillRefSchema = z4.string().regex(
|
|
145
180
|
/^[A-Za-z0-9][A-Za-z0-9._-]*@\S+$/,
|
|
146
181
|
'skills entries must be "name@label" (a bare name is a search, not a reference)'
|
|
147
182
|
);
|
|
148
|
-
var batterySkillsSchema =
|
|
149
|
-
var batteryScheduleSpecSchema =
|
|
150
|
-
repoUrl:
|
|
151
|
-
repoRef:
|
|
183
|
+
var batterySkillsSchema = z4.array(batterySkillRefSchema);
|
|
184
|
+
var batteryScheduleSpecSchema = z4.object({
|
|
185
|
+
repoUrl: z4.string().nullish(),
|
|
186
|
+
repoRef: z4.string().nullish(),
|
|
152
187
|
/** Pinned model id; `null` explicitly clears to the agent default (vs.
|
|
153
188
|
* omitted, which inherits `defaults.model`). */
|
|
154
|
-
model:
|
|
155
|
-
agents:
|
|
156
|
-
samplesPerCycle:
|
|
157
|
-
cadence:
|
|
158
|
-
daysPerWeek:
|
|
159
|
-
experiment:
|
|
189
|
+
model: z4.string().nullable().optional(),
|
|
190
|
+
agents: z4.array(batteryAgentSchema).optional(),
|
|
191
|
+
samplesPerCycle: z4.number().int().min(1).max(MAX_SAMPLES_PER_CYCLE).optional(),
|
|
192
|
+
cadence: z4.enum(BATTERY_CADENCES).optional(),
|
|
193
|
+
daysPerWeek: z4.number().int().min(1).max(7).optional(),
|
|
194
|
+
experiment: z4.string().optional(),
|
|
160
195
|
limits: batteryLimitsSchema.optional(),
|
|
161
196
|
/** ALG-217 — ordered `name@label` skill references staged into this target's
|
|
162
197
|
* runs. `cadence: NONE` targets only in v1. */
|
|
163
198
|
skills: batterySkillsSchema.optional()
|
|
164
199
|
});
|
|
165
|
-
var batteryDefaultsSchema =
|
|
166
|
-
isBranded:
|
|
167
|
-
topic:
|
|
168
|
-
tags:
|
|
169
|
-
model:
|
|
170
|
-
agents:
|
|
171
|
-
samplesPerCycle:
|
|
172
|
-
cadence:
|
|
200
|
+
var batteryDefaultsSchema = z4.object({
|
|
201
|
+
isBranded: z4.boolean().optional(),
|
|
202
|
+
topic: z4.string().optional(),
|
|
203
|
+
tags: z4.array(z4.string()).optional(),
|
|
204
|
+
model: z4.string().nullable().optional(),
|
|
205
|
+
agents: z4.array(batteryAgentSchema).optional(),
|
|
206
|
+
samplesPerCycle: z4.number().int().min(1).max(MAX_SAMPLES_PER_CYCLE).optional(),
|
|
207
|
+
cadence: z4.enum(BATTERY_CADENCES).optional(),
|
|
173
208
|
limits: batteryLimitsSchema.optional(),
|
|
174
209
|
/** ALG-217 — the skill set every target inherits unless it names its own. */
|
|
175
210
|
skills: batterySkillsSchema.optional()
|
|
176
211
|
});
|
|
177
|
-
var batteryPromptSpecSchema =
|
|
212
|
+
var batteryPromptSpecSchema = z4.object({
|
|
178
213
|
/** Idempotency key, unique per org (→ Prompt.externalKey). */
|
|
179
|
-
key:
|
|
180
|
-
text:
|
|
181
|
-
isBranded:
|
|
182
|
-
topic:
|
|
183
|
-
tags:
|
|
184
|
-
experiment:
|
|
214
|
+
key: z4.string().min(1),
|
|
215
|
+
text: z4.string().min(1),
|
|
216
|
+
isBranded: z4.boolean().optional(),
|
|
217
|
+
topic: z4.string().optional(),
|
|
218
|
+
tags: z4.array(z4.string()).optional(),
|
|
219
|
+
experiment: z4.string().optional(),
|
|
185
220
|
/** Omitted ⇒ one greenfield schedule from `defaults`. */
|
|
186
|
-
schedules:
|
|
221
|
+
schedules: z4.array(batteryScheduleSpecSchema).optional()
|
|
187
222
|
});
|
|
188
|
-
var batterySpecSchema =
|
|
189
|
-
version:
|
|
190
|
-
org:
|
|
191
|
-
experiment:
|
|
223
|
+
var batterySpecSchema = z4.object({
|
|
224
|
+
version: z4.literal(1),
|
|
225
|
+
org: z4.string().optional(),
|
|
226
|
+
experiment: z4.string().optional(),
|
|
192
227
|
/** Expand + enqueue runs now (credit-gated on the API path). */
|
|
193
|
-
expand:
|
|
228
|
+
expand: z4.boolean().optional(),
|
|
194
229
|
defaults: batteryDefaultsSchema.optional(),
|
|
195
|
-
prompts:
|
|
230
|
+
prompts: z4.array(batteryPromptSpecSchema).min(1)
|
|
196
231
|
});
|
|
197
|
-
var batteryPlanScheduleSchema =
|
|
198
|
-
action:
|
|
199
|
-
repoUrl:
|
|
200
|
-
repoRef:
|
|
232
|
+
var batteryPlanScheduleSchema = z4.object({
|
|
233
|
+
action: z4.enum(["create", "update", "none"]),
|
|
234
|
+
repoUrl: z4.string().nullable(),
|
|
235
|
+
repoRef: z4.string().nullable(),
|
|
201
236
|
/** Runs this target would enqueue (agents × samples; 0 unless `expand`). */
|
|
202
|
-
runs:
|
|
203
|
-
});
|
|
204
|
-
var batteryPlanPromptSchema =
|
|
205
|
-
key:
|
|
206
|
-
action:
|
|
207
|
-
schedules:
|
|
208
|
-
});
|
|
209
|
-
var batteryPlanSchema =
|
|
210
|
-
dryRun:
|
|
211
|
-
org:
|
|
212
|
-
experiment:
|
|
213
|
-
expand:
|
|
214
|
-
prompts:
|
|
215
|
-
summary:
|
|
216
|
-
promptsToCreate:
|
|
217
|
-
promptsToUpdate:
|
|
218
|
-
schedulesToCreate:
|
|
219
|
-
schedulesToUpdate:
|
|
220
|
-
runsToEnqueue:
|
|
237
|
+
runs: z4.number().int()
|
|
238
|
+
});
|
|
239
|
+
var batteryPlanPromptSchema = z4.object({
|
|
240
|
+
key: z4.string(),
|
|
241
|
+
action: z4.enum(["create", "update"]),
|
|
242
|
+
schedules: z4.array(batteryPlanScheduleSchema)
|
|
243
|
+
});
|
|
244
|
+
var batteryPlanSchema = z4.object({
|
|
245
|
+
dryRun: z4.literal(true),
|
|
246
|
+
org: z4.string(),
|
|
247
|
+
experiment: z4.string().nullable(),
|
|
248
|
+
expand: z4.boolean(),
|
|
249
|
+
prompts: z4.array(batteryPlanPromptSchema),
|
|
250
|
+
summary: z4.object({
|
|
251
|
+
promptsToCreate: z4.number().int(),
|
|
252
|
+
promptsToUpdate: z4.number().int(),
|
|
253
|
+
schedulesToCreate: z4.number().int(),
|
|
254
|
+
schedulesToUpdate: z4.number().int(),
|
|
255
|
+
runsToEnqueue: z4.number().int(),
|
|
221
256
|
/** Run count keyed by agent (only populated when `expand`). */
|
|
222
|
-
runsByAgent:
|
|
257
|
+
runsByAgent: z4.record(z4.string(), z4.number().int()),
|
|
223
258
|
/** Flat estimate (runs × credits-per-run) for ORG-funded applies; the real
|
|
224
259
|
* gate (key gate, balance truncation, overage) runs at apply time. */
|
|
225
|
-
estimatedCredits:
|
|
260
|
+
estimatedCredits: z4.number().int()
|
|
226
261
|
})
|
|
227
262
|
});
|
|
228
|
-
var batteryApplyResponseSchema =
|
|
229
|
-
batchIds:
|
|
230
|
-
runIds:
|
|
231
|
-
experiment:
|
|
263
|
+
var batteryApplyResponseSchema = z4.object({
|
|
264
|
+
batchIds: z4.array(z4.string()),
|
|
265
|
+
runIds: z4.array(z4.string()),
|
|
266
|
+
experiment: z4.string().nullable(),
|
|
232
267
|
/** Present when part of the expansion hit a billing gate but at least one
|
|
233
268
|
* run was enqueued (an all-blocked apply is a 402 error instead). */
|
|
234
|
-
blocked:
|
|
269
|
+
blocked: z4.enum(["insufficient_credits", "needs_provider_key"]).optional()
|
|
235
270
|
});
|
|
236
|
-
var batchRunStatusSchema =
|
|
271
|
+
var batchRunStatusSchema = z4.enum([
|
|
237
272
|
"QUEUED",
|
|
238
273
|
"CLAIMED",
|
|
239
274
|
"PROVISIONING",
|
|
@@ -244,73 +279,118 @@ var batchRunStatusSchema = z3.enum([
|
|
|
244
279
|
"CANCELED"
|
|
245
280
|
]);
|
|
246
281
|
var batchListQuerySchema = listQuerySchema.extend({
|
|
247
|
-
promptId:
|
|
248
|
-
experiment:
|
|
282
|
+
promptId: z4.string().optional(),
|
|
283
|
+
experiment: z4.string().optional()
|
|
249
284
|
});
|
|
250
|
-
var batchSummarySchema =
|
|
251
|
-
id:
|
|
252
|
-
promptId:
|
|
285
|
+
var batchSummarySchema = z4.object({
|
|
286
|
+
id: z4.string(),
|
|
287
|
+
promptId: z4.string(),
|
|
253
288
|
/** Whitespace-collapsed prompt text, truncated (~80 chars) for list views;
|
|
254
289
|
* the full text is on GET /batches/{id}. */
|
|
255
|
-
promptText:
|
|
256
|
-
experiment:
|
|
257
|
-
createdAt:
|
|
290
|
+
promptText: z4.string(),
|
|
291
|
+
experiment: z4.string().nullable(),
|
|
292
|
+
createdAt: z4.string(),
|
|
258
293
|
// ISO 8601
|
|
259
294
|
/** Run count keyed by RunStatus (absent statuses omitted). */
|
|
260
|
-
runCounts:
|
|
295
|
+
runCounts: z4.record(z4.string(), z4.number().int())
|
|
261
296
|
});
|
|
262
297
|
var batchListResponseSchema = listResponseSchema(batchSummarySchema);
|
|
263
|
-
var batchRunSummarySchema =
|
|
264
|
-
id:
|
|
265
|
-
agent:
|
|
266
|
-
model:
|
|
298
|
+
var batchRunSummarySchema = z4.object({
|
|
299
|
+
id: z4.string(),
|
|
300
|
+
agent: z4.string(),
|
|
301
|
+
model: z4.string(),
|
|
267
302
|
status: batchRunStatusSchema,
|
|
268
|
-
createdAt:
|
|
269
|
-
startedAt:
|
|
270
|
-
finishedAt:
|
|
271
|
-
});
|
|
272
|
-
var batchDetailSchema =
|
|
273
|
-
id:
|
|
274
|
-
promptId:
|
|
275
|
-
scheduleId:
|
|
303
|
+
createdAt: z4.string(),
|
|
304
|
+
startedAt: z4.string().nullable(),
|
|
305
|
+
finishedAt: z4.string().nullable()
|
|
306
|
+
});
|
|
307
|
+
var batchDetailSchema = z4.object({
|
|
308
|
+
id: z4.string(),
|
|
309
|
+
promptId: z4.string(),
|
|
310
|
+
scheduleId: z4.string().nullable(),
|
|
276
311
|
/** The preset this batch expanded from (specs/run-presets.md §4); null on
|
|
277
312
|
* pre-preset batches. `runPresetName` is a display snapshot frozen at
|
|
278
313
|
* expansion, so it survives preset renames and deletes. */
|
|
279
|
-
runPresetId:
|
|
280
|
-
runPresetName:
|
|
281
|
-
promptText:
|
|
282
|
-
scenario:
|
|
283
|
-
repoUrl:
|
|
284
|
-
repoRef:
|
|
285
|
-
experiment:
|
|
286
|
-
funding:
|
|
287
|
-
createdAt:
|
|
288
|
-
runCounts:
|
|
289
|
-
runs:
|
|
314
|
+
runPresetId: z4.string().nullable().optional(),
|
|
315
|
+
runPresetName: z4.string().nullable().optional(),
|
|
316
|
+
promptText: z4.string(),
|
|
317
|
+
scenario: z4.string(),
|
|
318
|
+
repoUrl: z4.string().nullable(),
|
|
319
|
+
repoRef: z4.string().nullable(),
|
|
320
|
+
experiment: z4.string().nullable(),
|
|
321
|
+
funding: z4.string(),
|
|
322
|
+
createdAt: z4.string(),
|
|
323
|
+
runCounts: z4.record(z4.string(), z4.number().int()),
|
|
324
|
+
runs: z4.array(batchRunSummarySchema)
|
|
290
325
|
});
|
|
291
326
|
|
|
292
327
|
// ../packages/api-schemas/src/billing.ts
|
|
293
|
-
import { z as
|
|
294
|
-
var
|
|
328
|
+
import { z as z5 } from "zod";
|
|
329
|
+
var billingTierSchema = z5.object({
|
|
330
|
+
skuId: z5.string(),
|
|
331
|
+
tierLabel: z5.string(),
|
|
332
|
+
position: z5.number().int(),
|
|
333
|
+
monthlyAmountCents: z5.number().int(),
|
|
334
|
+
/** The real, spendable allowance — base plus bonus. */
|
|
335
|
+
monthlyCredits: z5.number().int(),
|
|
336
|
+
/** What the price buys at list rate; the remainder is the volume discount,
|
|
337
|
+
* handed back as bonus credits rather than a lower unit price. */
|
|
338
|
+
baseCredits: z5.number().int(),
|
|
339
|
+
bonusCredits: z5.number().int(),
|
|
340
|
+
dollarsPerThousandCredits: z5.number()
|
|
341
|
+
});
|
|
342
|
+
var billingCatalogSchema = z5.object({
|
|
343
|
+
catalogKey: z5.string(),
|
|
344
|
+
catalogLabel: z5.string(),
|
|
345
|
+
visibility: z5.enum(["PUBLIC", "PRIVATE"]),
|
|
346
|
+
tiers: z5.array(billingTierSchema)
|
|
347
|
+
});
|
|
348
|
+
var workloadCreditStateSchema = (value) => z5.object({
|
|
349
|
+
eval: value,
|
|
350
|
+
visibility: value,
|
|
351
|
+
generic: value
|
|
352
|
+
});
|
|
353
|
+
var billingStatusSchema = z5.object({
|
|
295
354
|
/** When false, billing is disabled: unlimited runs. */
|
|
296
|
-
enforced:
|
|
297
|
-
balance:
|
|
298
|
-
/**
|
|
299
|
-
allowance:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
355
|
+
enforced: z5.boolean(),
|
|
356
|
+
balance: z5.number(),
|
|
357
|
+
/** The current tier's monthly allowance; null = no paid subscription. */
|
|
358
|
+
allowance: z5.number().nullable(),
|
|
359
|
+
/** What the organization pays for today. */
|
|
360
|
+
currentSku: billingTierSchema.nullable(),
|
|
361
|
+
/** The ladder it is allowed to buy from. */
|
|
362
|
+
offeredCatalog: billingCatalogSchema.nullable(),
|
|
363
|
+
/** The tier an upgrade resolves to; null = no self-service upgrade. */
|
|
364
|
+
nextTier: billingTierSchema.nullable(),
|
|
365
|
+
subscriptionStatus: z5.string().nullable(),
|
|
366
|
+
currentPeriodStart: z5.string().nullable(),
|
|
367
|
+
currentPeriodEnd: z5.string().nullable(),
|
|
368
|
+
cancelAtPeriodEnd: z5.boolean(),
|
|
369
|
+
creditsUsedThisPeriod: z5.number(),
|
|
370
|
+
runsThisPeriod: z5.number(),
|
|
371
|
+
/** @deprecated Generic-run compatibility value. Use `holdsPerRun`. */
|
|
372
|
+
holdPerRun: z5.number(),
|
|
373
|
+
/** @deprecated Generic-run compatibility value. Use `canRunByWorkload`. */
|
|
374
|
+
canRun: z5.boolean(),
|
|
375
|
+
/** Credits held to start one run, keyed by workload provenance. */
|
|
376
|
+
holdsPerRun: workloadCreditStateSchema(z5.number()),
|
|
377
|
+
/** Can the org fund at least one more run of each workload right now. */
|
|
378
|
+
canRunByWorkload: workloadCreditStateSchema(z5.boolean()),
|
|
379
|
+
// --- Deprecated. Retained for v1 compatibility; removal needs an API-version
|
|
380
|
+
// decision. Overage is retired, so these are always inert.
|
|
381
|
+
/** @deprecated Use `currentSku.tierLabel`. */
|
|
382
|
+
plan: z5.string().nullable(),
|
|
383
|
+
/** @deprecated Overage is retired; always false. */
|
|
384
|
+
overageEnabled: z5.boolean(),
|
|
385
|
+
/** @deprecated Overage is retired; always null. */
|
|
386
|
+
overageCapCredits: z5.number().nullable(),
|
|
387
|
+
/** @deprecated Overage is retired; always 0. */
|
|
388
|
+
overageThisPeriod: z5.number()
|
|
311
389
|
});
|
|
312
390
|
var LEDGER_KINDS = [
|
|
313
391
|
"SIGNUP_GRANT",
|
|
392
|
+
"SUBSCRIPTION_GRANT",
|
|
393
|
+
"UPGRADE_GRANT",
|
|
314
394
|
"RENEWAL_GRANT",
|
|
315
395
|
"RUN_DEBIT",
|
|
316
396
|
"RUN_REFUND",
|
|
@@ -318,18 +398,18 @@ var LEDGER_KINDS = [
|
|
|
318
398
|
"ADMIN_ADJUST",
|
|
319
399
|
"EXPIRY"
|
|
320
400
|
];
|
|
321
|
-
var ledgerKindSchema =
|
|
322
|
-
var usageEntrySchema =
|
|
323
|
-
id:
|
|
401
|
+
var ledgerKindSchema = z5.enum(LEDGER_KINDS);
|
|
402
|
+
var usageEntrySchema = z5.object({
|
|
403
|
+
id: z5.string(),
|
|
324
404
|
kind: ledgerKindSchema,
|
|
325
|
-
delta:
|
|
326
|
-
runId:
|
|
327
|
-
batchId:
|
|
328
|
-
createdAt:
|
|
405
|
+
delta: z5.number().int(),
|
|
406
|
+
runId: z5.string().nullable(),
|
|
407
|
+
batchId: z5.string().nullable(),
|
|
408
|
+
createdAt: z5.string()
|
|
329
409
|
});
|
|
330
410
|
var usageQuerySchema = listQuerySchema.extend({
|
|
331
411
|
/** Relative window ("30d", "24h", "15m", "2w") or an ISO-8601 date/datetime. */
|
|
332
|
-
since:
|
|
412
|
+
since: z5.string().optional()
|
|
333
413
|
});
|
|
334
414
|
var usageListResponseSchema = listResponseSchema(usageEntrySchema);
|
|
335
415
|
|
|
@@ -348,9 +428,9 @@ __export(brands_exports, {
|
|
|
348
428
|
listBrandsQuerySchema: () => listBrandsQuerySchema,
|
|
349
429
|
updateBrandBodySchema: () => updateBrandBodySchema
|
|
350
430
|
});
|
|
351
|
-
import { z as
|
|
431
|
+
import { z as z6 } from "zod";
|
|
352
432
|
var BRAND_KINDS = ["OWNED", "COMPETITOR", "OTHER"];
|
|
353
|
-
var brandKindSchema =
|
|
433
|
+
var brandKindSchema = z6.enum(BRAND_KINDS);
|
|
354
434
|
var BRAND_PACKAGE_ECOSYSTEMS = [
|
|
355
435
|
"npm",
|
|
356
436
|
"pypi",
|
|
@@ -359,42 +439,42 @@ var BRAND_PACKAGE_ECOSYSTEMS = [
|
|
|
359
439
|
"rubygems",
|
|
360
440
|
"other"
|
|
361
441
|
];
|
|
362
|
-
var brandPackageEcosystemSchema =
|
|
363
|
-
var brandPackageSchema =
|
|
364
|
-
name:
|
|
365
|
-
ecosystem:
|
|
366
|
-
});
|
|
367
|
-
var brandSchema =
|
|
368
|
-
id:
|
|
369
|
-
name:
|
|
442
|
+
var brandPackageEcosystemSchema = z6.enum(BRAND_PACKAGE_ECOSYSTEMS);
|
|
443
|
+
var brandPackageSchema = z6.object({
|
|
444
|
+
name: z6.string(),
|
|
445
|
+
ecosystem: z6.string().nullable()
|
|
446
|
+
});
|
|
447
|
+
var brandSchema = z6.object({
|
|
448
|
+
id: z6.string(),
|
|
449
|
+
name: z6.string(),
|
|
370
450
|
kind: brandKindSchema,
|
|
371
451
|
/** Provenance: MANUAL | BOOTSTRAP | OBSERVED (additive server-side). */
|
|
372
|
-
source:
|
|
373
|
-
aliases:
|
|
374
|
-
websites:
|
|
375
|
-
category:
|
|
376
|
-
packages:
|
|
377
|
-
createdAt:
|
|
378
|
-
updatedAt:
|
|
379
|
-
});
|
|
380
|
-
var brandPackageInputSchema =
|
|
381
|
-
name:
|
|
452
|
+
source: z6.string(),
|
|
453
|
+
aliases: z6.array(z6.string()),
|
|
454
|
+
websites: z6.array(z6.string()),
|
|
455
|
+
category: z6.string().nullable(),
|
|
456
|
+
packages: z6.array(brandPackageSchema),
|
|
457
|
+
createdAt: z6.string(),
|
|
458
|
+
updatedAt: z6.string()
|
|
459
|
+
});
|
|
460
|
+
var brandPackageInputSchema = z6.object({
|
|
461
|
+
name: z6.string().min(1),
|
|
382
462
|
/** Omitted/null = "not a package-manager entry". */
|
|
383
463
|
ecosystem: brandPackageEcosystemSchema.nullable().optional()
|
|
384
464
|
});
|
|
385
|
-
var createBrandBodySchema =
|
|
386
|
-
name:
|
|
465
|
+
var createBrandBodySchema = z6.object({
|
|
466
|
+
name: z6.string().min(1),
|
|
387
467
|
kind: brandKindSchema,
|
|
388
|
-
aliases:
|
|
389
|
-
websites:
|
|
390
|
-
packages:
|
|
468
|
+
aliases: z6.array(z6.string().min(1)).default([]),
|
|
469
|
+
websites: z6.array(z6.string().min(1)).default([]),
|
|
470
|
+
packages: z6.array(brandPackageInputSchema).default([])
|
|
391
471
|
});
|
|
392
|
-
var updateBrandBodySchema =
|
|
393
|
-
name:
|
|
472
|
+
var updateBrandBodySchema = z6.object({
|
|
473
|
+
name: z6.string().min(1).optional(),
|
|
394
474
|
kind: brandKindSchema.optional(),
|
|
395
|
-
aliases:
|
|
396
|
-
websites:
|
|
397
|
-
packages:
|
|
475
|
+
aliases: z6.array(z6.string().min(1)).optional(),
|
|
476
|
+
websites: z6.array(z6.string().min(1)).optional(),
|
|
477
|
+
packages: z6.array(brandPackageInputSchema).optional()
|
|
398
478
|
});
|
|
399
479
|
var listBrandsQuerySchema = listQuerySchema.extend({
|
|
400
480
|
kind: brandKindSchema.optional()
|
|
@@ -402,27 +482,27 @@ var listBrandsQuerySchema = listQuerySchema.extend({
|
|
|
402
482
|
var brandListResponseSchema = listResponseSchema(brandSchema);
|
|
403
483
|
|
|
404
484
|
// ../packages/api-schemas/src/checkpoints.ts
|
|
405
|
-
import { z as
|
|
485
|
+
import { z as z7 } from "zod";
|
|
406
486
|
var CHECKPOINT_STORE_VERSION = 2;
|
|
407
487
|
var ALIGNED_CHECKPOINT_SUPERVISOR_ARTIFACT = "0.0.76-byok-ha-26071639";
|
|
408
488
|
var ALIGNED_RUNSC_VERSION = "release-20260112.0";
|
|
409
489
|
var ALIGNED_RUNSC_PLATFORM = "systrap";
|
|
410
490
|
var SHA256_PATTERN = /^sha256:[0-9a-f]{64}$/;
|
|
411
491
|
var CHECKPOINT_ARTIFACT_PATTERN = /^alg-checkpoint:v2:sha256:[0-9a-f]{64}$/;
|
|
412
|
-
var sha256DigestSchema =
|
|
492
|
+
var sha256DigestSchema = z7.custom(
|
|
413
493
|
(value) => typeof value === "string" && SHA256_PATTERN.test(value),
|
|
414
494
|
"expected a sha256:<64 lowercase hex> digest"
|
|
415
495
|
);
|
|
416
|
-
var checkpointArtifactRefSchema =
|
|
496
|
+
var checkpointArtifactRefSchema = z7.custom(
|
|
417
497
|
(value) => typeof value === "string" && CHECKPOINT_ARTIFACT_PATTERN.test(value),
|
|
418
498
|
"expected an alg-checkpoint:v2 artifact reference"
|
|
419
499
|
);
|
|
420
|
-
var publicArtifactScopeSchema =
|
|
421
|
-
var orgArtifactScopeSchema =
|
|
422
|
-
kind:
|
|
423
|
-
organizationId:
|
|
500
|
+
var publicArtifactScopeSchema = z7.object({ kind: z7.literal("public") });
|
|
501
|
+
var orgArtifactScopeSchema = z7.object({
|
|
502
|
+
kind: z7.literal("org"),
|
|
503
|
+
organizationId: z7.string().min(1)
|
|
424
504
|
});
|
|
425
|
-
var artifactScopeSchema =
|
|
505
|
+
var artifactScopeSchema = z7.discriminatedUnion("kind", [
|
|
426
506
|
publicArtifactScopeSchema,
|
|
427
507
|
orgArtifactScopeSchema
|
|
428
508
|
]);
|
|
@@ -438,27 +518,27 @@ function manifestScopeReferenceViolation(manifestScope, referenced) {
|
|
|
438
518
|
}
|
|
439
519
|
return "a manifest must not reference another organization's object";
|
|
440
520
|
}
|
|
441
|
-
var checkpointStorePrincipalSchema =
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
kind:
|
|
445
|
-
organizationId:
|
|
521
|
+
var checkpointStorePrincipalSchema = z7.discriminatedUnion("kind", [
|
|
522
|
+
z7.object({ kind: z7.literal("system") }),
|
|
523
|
+
z7.object({
|
|
524
|
+
kind: z7.literal("organization"),
|
|
525
|
+
organizationId: z7.string().min(1)
|
|
446
526
|
})
|
|
447
527
|
]);
|
|
448
|
-
var checkpointChunkSchema =
|
|
449
|
-
ordinal:
|
|
528
|
+
var checkpointChunkSchema = z7.object({
|
|
529
|
+
ordinal: z7.number().int().nonnegative(),
|
|
450
530
|
digest: sha256DigestSchema,
|
|
451
531
|
rawDigest: sha256DigestSchema,
|
|
452
|
-
rawBytes:
|
|
453
|
-
storedBytes:
|
|
532
|
+
rawBytes: z7.number().int().positive(),
|
|
533
|
+
storedBytes: z7.number().int().positive()
|
|
454
534
|
});
|
|
455
|
-
var chunkedPayloadSchema =
|
|
456
|
-
format:
|
|
535
|
+
var chunkedPayloadSchema = z7.object({
|
|
536
|
+
format: z7.enum([
|
|
457
537
|
"canonical-workspace-chunked-zstd-v1",
|
|
458
538
|
"runsc-checkpoint-chunked-zstd-v1",
|
|
459
539
|
"overlay-upper-chunked-zstd-v1"
|
|
460
540
|
]),
|
|
461
|
-
chunks:
|
|
541
|
+
chunks: z7.array(checkpointChunkSchema).min(1).superRefine((chunks, context) => {
|
|
462
542
|
for (const [index, chunk] of chunks.entries()) {
|
|
463
543
|
if (chunk.ordinal !== index) {
|
|
464
544
|
context.addIssue({
|
|
@@ -471,10 +551,10 @@ var chunkedPayloadSchema = z6.object({
|
|
|
471
551
|
})
|
|
472
552
|
});
|
|
473
553
|
var canonicalBaselinePayloadSchema = chunkedPayloadSchema.extend({
|
|
474
|
-
format:
|
|
554
|
+
format: z7.literal("canonical-workspace-chunked-zstd-v1")
|
|
475
555
|
});
|
|
476
|
-
var nydusBaselineBlobSchema =
|
|
477
|
-
nydusBlobId:
|
|
556
|
+
var nydusBaselineBlobSchema = z7.object({
|
|
557
|
+
nydusBlobId: z7.string().regex(/^[0-9a-f]{64}$/),
|
|
478
558
|
object: checkpointChunkSchema,
|
|
479
559
|
/**
|
|
480
560
|
* CAS scope this blob's object actually lives in, when it is NOT the manifest's own
|
|
@@ -492,34 +572,34 @@ var nydusBaselineBlobSchema = z6.object({
|
|
|
492
572
|
*/
|
|
493
573
|
scope: artifactScopeSchema.optional()
|
|
494
574
|
});
|
|
495
|
-
var nydusBaselinePayloadSchema =
|
|
496
|
-
format:
|
|
497
|
-
fsVersion:
|
|
575
|
+
var nydusBaselinePayloadSchema = z7.object({
|
|
576
|
+
format: z7.literal("nydus-rafs-v6"),
|
|
577
|
+
fsVersion: z7.literal(6),
|
|
498
578
|
/** Always the manifest's own scope: a build always produces its own bootstrap, so
|
|
499
579
|
* only inherited BLOBS can be foreign. Confining the override to where a foreign
|
|
500
580
|
* scope is possible is what keeps the invariant checkable. */
|
|
501
581
|
bootstrap: checkpointChunkSchema,
|
|
502
|
-
blobs:
|
|
582
|
+
blobs: z7.array(nydusBaselineBlobSchema)
|
|
503
583
|
});
|
|
504
|
-
var workspaceBaselinePayloadSchema =
|
|
584
|
+
var workspaceBaselinePayloadSchema = z7.discriminatedUnion("format", [
|
|
505
585
|
canonicalBaselinePayloadSchema,
|
|
506
586
|
nydusBaselinePayloadSchema
|
|
507
587
|
]);
|
|
508
|
-
var workspaceBaselineManifestV2Schema =
|
|
509
|
-
schemaVersion:
|
|
510
|
-
kind:
|
|
588
|
+
var workspaceBaselineManifestV2Schema = z7.object({
|
|
589
|
+
schemaVersion: z7.literal(CHECKPOINT_STORE_VERSION),
|
|
590
|
+
kind: z7.literal("workspace-baseline"),
|
|
511
591
|
scope: artifactScopeSchema,
|
|
512
592
|
workspaceRoot: sha256DigestSchema,
|
|
513
593
|
payload: workspaceBaselinePayloadSchema,
|
|
514
|
-
repo:
|
|
515
|
-
canonicalUrl:
|
|
516
|
-
requestedRef:
|
|
517
|
-
resolvedCommit:
|
|
594
|
+
repo: z7.object({
|
|
595
|
+
canonicalUrl: z7.string().url(),
|
|
596
|
+
requestedRef: z7.string().min(1),
|
|
597
|
+
resolvedCommit: z7.string().regex(/^[0-9a-f]{40,64}$/)
|
|
518
598
|
}),
|
|
519
|
-
recipe:
|
|
599
|
+
recipe: z7.object({
|
|
520
600
|
digest: sha256DigestSchema,
|
|
521
601
|
sandboxImageDigest: sha256DigestSchema,
|
|
522
|
-
architecture:
|
|
602
|
+
architecture: z7.string().min(1)
|
|
523
603
|
})
|
|
524
604
|
}).superRefine((manifest, context) => {
|
|
525
605
|
if (manifest.payload.format !== "nydus-rafs-v6") return;
|
|
@@ -537,93 +617,111 @@ var workspaceBaselineManifestV2Schema = z6.object({
|
|
|
537
617
|
}
|
|
538
618
|
}
|
|
539
619
|
});
|
|
540
|
-
var checkpointBoundaryV2Schema =
|
|
541
|
-
kind:
|
|
542
|
-
turn:
|
|
543
|
-
ordinal:
|
|
544
|
-
toolName:
|
|
545
|
-
url:
|
|
620
|
+
var checkpointBoundaryV2Schema = z7.object({
|
|
621
|
+
kind: z7.enum(["tool_call", "assistant_message", "user_message"]),
|
|
622
|
+
turn: z7.number().int().nonnegative(),
|
|
623
|
+
ordinal: z7.number().int().nonnegative(),
|
|
624
|
+
toolName: z7.string().optional(),
|
|
625
|
+
url: z7.string().url().optional()
|
|
546
626
|
});
|
|
547
|
-
var memoryDiskManifestV2Schema =
|
|
548
|
-
schemaVersion:
|
|
549
|
-
kind:
|
|
627
|
+
var memoryDiskManifestV2Schema = z7.object({
|
|
628
|
+
schemaVersion: z7.literal(CHECKPOINT_STORE_VERSION),
|
|
629
|
+
kind: z7.literal("runsc-memory-disk"),
|
|
550
630
|
scope: orgArtifactScopeSchema,
|
|
551
631
|
boundary: checkpointBoundaryV2Schema,
|
|
552
632
|
memory: chunkedPayloadSchema.extend({
|
|
553
|
-
format:
|
|
633
|
+
format: z7.literal("runsc-checkpoint-chunked-zstd-v1")
|
|
554
634
|
}),
|
|
555
|
-
disk:
|
|
635
|
+
disk: z7.object({
|
|
556
636
|
baselineArtifact: checkpointArtifactRefSchema,
|
|
557
637
|
baselineScope: artifactScopeSchema,
|
|
558
638
|
baselineWorkspaceRoot: sha256DigestSchema,
|
|
559
639
|
delta: chunkedPayloadSchema.extend({
|
|
560
|
-
format:
|
|
640
|
+
format: z7.literal("overlay-upper-chunked-zstd-v1")
|
|
561
641
|
})
|
|
562
642
|
}),
|
|
563
|
-
runtime:
|
|
564
|
-
runscVersion:
|
|
565
|
-
platform:
|
|
643
|
+
runtime: z7.object({
|
|
644
|
+
runscVersion: z7.string().min(1),
|
|
645
|
+
platform: z7.string().min(1),
|
|
566
646
|
configDigest: sha256DigestSchema,
|
|
567
|
-
supervisorArtifact:
|
|
568
|
-
architecture:
|
|
647
|
+
supervisorArtifact: z7.string().min(1),
|
|
648
|
+
architecture: z7.string().min(1)
|
|
569
649
|
}),
|
|
570
|
-
memorySharing:
|
|
650
|
+
memorySharing: z7.literal("none")
|
|
571
651
|
});
|
|
572
|
-
var workspaceSourceSchema =
|
|
573
|
-
|
|
574
|
-
kind:
|
|
652
|
+
var workspaceSourceSchema = z7.discriminatedUnion("kind", [
|
|
653
|
+
z7.object({
|
|
654
|
+
kind: z7.literal("nvme-baseline"),
|
|
575
655
|
artifact: checkpointArtifactRefSchema,
|
|
576
656
|
workspaceRoot: sha256DigestSchema,
|
|
577
657
|
scope: artifactScopeSchema
|
|
578
658
|
}),
|
|
579
|
-
|
|
580
|
-
kind:
|
|
659
|
+
z7.object({
|
|
660
|
+
kind: z7.literal("memory-disk"),
|
|
581
661
|
artifact: checkpointArtifactRefSchema,
|
|
582
662
|
boundary: checkpointBoundaryV2Schema
|
|
583
663
|
}),
|
|
584
|
-
|
|
585
|
-
kind:
|
|
586
|
-
volumeSnapshot:
|
|
587
|
-
resumeSessionId:
|
|
664
|
+
z7.object({
|
|
665
|
+
kind: z7.literal("legacy-ebs"),
|
|
666
|
+
volumeSnapshot: z7.string().min(1),
|
|
667
|
+
resumeSessionId: z7.string().min(1).optional()
|
|
588
668
|
})
|
|
589
669
|
]);
|
|
590
|
-
var baselinePayloadFormatSchema =
|
|
670
|
+
var baselinePayloadFormatSchema = z7.enum([
|
|
591
671
|
"canonical-workspace-chunked-zstd-v1",
|
|
592
672
|
"runsc-checkpoint-chunked-zstd-v1",
|
|
593
673
|
"overlay-upper-chunked-zstd-v1",
|
|
594
674
|
"nydus-rafs-v6"
|
|
595
675
|
]);
|
|
596
|
-
var checkpointStoreCapabilitiesSchema =
|
|
597
|
-
storeVersion:
|
|
598
|
-
manifestSchemas:
|
|
599
|
-
payloadFormats:
|
|
600
|
-
runtime:
|
|
601
|
-
runscVersion:
|
|
602
|
-
platform:
|
|
603
|
-
supervisorArtifact:
|
|
676
|
+
var checkpointStoreCapabilitiesSchema = z7.object({
|
|
677
|
+
storeVersion: z7.literal(CHECKPOINT_STORE_VERSION),
|
|
678
|
+
manifestSchemas: z7.array(z7.literal(CHECKPOINT_STORE_VERSION)).min(1),
|
|
679
|
+
payloadFormats: z7.array(baselinePayloadFormatSchema),
|
|
680
|
+
runtime: z7.object({
|
|
681
|
+
runscVersion: z7.literal(ALIGNED_RUNSC_VERSION),
|
|
682
|
+
platform: z7.literal(ALIGNED_RUNSC_PLATFORM),
|
|
683
|
+
supervisorArtifact: z7.literal(ALIGNED_CHECKPOINT_SUPERVISOR_ARTIFACT)
|
|
604
684
|
})
|
|
605
685
|
});
|
|
606
686
|
|
|
607
687
|
// ../packages/api-schemas/src/cli-auth.ts
|
|
608
|
-
import { z as
|
|
688
|
+
import { z as z8 } from "zod";
|
|
609
689
|
var PKCE_VERIFIER_PATTERN = /^[A-Za-z0-9._~-]{43,128}$/;
|
|
610
|
-
var cliAuthorizationTokenRequestSchema =
|
|
611
|
-
code:
|
|
612
|
-
codeVerifier:
|
|
690
|
+
var cliAuthorizationTokenRequestSchema = z8.object({
|
|
691
|
+
code: z8.string().min(1).max(512),
|
|
692
|
+
codeVerifier: z8.string().regex(PKCE_VERIFIER_PATTERN)
|
|
613
693
|
});
|
|
614
|
-
var cliAuthorizationTokenResponseSchema =
|
|
615
|
-
accessToken:
|
|
616
|
-
tokenType:
|
|
617
|
-
expiresAt:
|
|
694
|
+
var cliAuthorizationTokenResponseSchema = z8.object({
|
|
695
|
+
accessToken: z8.string(),
|
|
696
|
+
tokenType: z8.literal("bearer"),
|
|
697
|
+
expiresAt: z8.string().nullable()
|
|
618
698
|
});
|
|
619
699
|
|
|
620
|
-
// ../packages/api-schemas/src/
|
|
700
|
+
// ../packages/api-schemas/src/connections.ts
|
|
621
701
|
import { z as z9 } from "zod";
|
|
702
|
+
var MAX_CONNECTION_SET_ENTRIES = 32;
|
|
703
|
+
var connectionSetEntrySchema = z9.object({
|
|
704
|
+
connectionId: z9.string().min(1),
|
|
705
|
+
handle: z9.string().min(1),
|
|
706
|
+
profileId: z9.string().min(1),
|
|
707
|
+
profileSlug: z9.string().min(1),
|
|
708
|
+
providerName: z9.string().min(1),
|
|
709
|
+
credentialKey: z9.string().min(1),
|
|
710
|
+
headerName: z9.string().min(1),
|
|
711
|
+
headerValuePrefix: z9.string()
|
|
712
|
+
});
|
|
713
|
+
var connectionSetSchema = z9.array(connectionSetEntrySchema).max(
|
|
714
|
+
MAX_CONNECTION_SET_ENTRIES,
|
|
715
|
+
`a run may attach at most ${MAX_CONNECTION_SET_ENTRIES} connections`
|
|
716
|
+
);
|
|
717
|
+
|
|
718
|
+
// ../packages/api-schemas/src/cycles.ts
|
|
719
|
+
import { z as z11 } from "zod";
|
|
622
720
|
|
|
623
721
|
// ../packages/api-schemas/src/schedules.ts
|
|
624
|
-
import { z as
|
|
722
|
+
import { z as z10 } from "zod";
|
|
625
723
|
var AGENTS = ["CLAUDE_CODE", "CODEX_CLI", "CURSOR"];
|
|
626
|
-
var agentSchema =
|
|
724
|
+
var agentSchema = z10.enum(AGENTS);
|
|
627
725
|
var CADENCES = [
|
|
628
726
|
"NONE",
|
|
629
727
|
"DAILY",
|
|
@@ -631,89 +729,89 @@ var CADENCES = [
|
|
|
631
729
|
"MONTHLY",
|
|
632
730
|
"DAYS_PER_WEEK"
|
|
633
731
|
];
|
|
634
|
-
var cadenceSchema =
|
|
635
|
-
var daysPerWeekSchema =
|
|
636
|
-
var scheduleRepoSchema =
|
|
637
|
-
repoUrl:
|
|
732
|
+
var cadenceSchema = z10.enum(CADENCES);
|
|
733
|
+
var daysPerWeekSchema = z10.number().int().min(1).max(7);
|
|
734
|
+
var scheduleRepoSchema = z10.object({
|
|
735
|
+
repoUrl: z10.string().nullable(),
|
|
638
736
|
/** Branch/ref; null = the repo's default branch (always null for greenfield). */
|
|
639
|
-
repoRef:
|
|
737
|
+
repoRef: z10.string().nullable()
|
|
640
738
|
});
|
|
641
|
-
var scheduleAgentConfigSchema =
|
|
739
|
+
var scheduleAgentConfigSchema = z10.object({
|
|
642
740
|
agent: agentSchema,
|
|
643
|
-
models:
|
|
741
|
+
models: z10.array(z10.string().min(1)).default([])
|
|
644
742
|
});
|
|
645
|
-
var scheduleAgentConfigInputSchema =
|
|
743
|
+
var scheduleAgentConfigInputSchema = z10.object({
|
|
646
744
|
agent: agentSchema,
|
|
647
|
-
models:
|
|
648
|
-
model:
|
|
745
|
+
models: z10.array(z10.string().min(1)).optional(),
|
|
746
|
+
model: z10.string().min(1).nullish()
|
|
649
747
|
}).transform(({ agent, models, model }) => ({
|
|
650
748
|
agent,
|
|
651
749
|
models: models ?? (model ? [model] : [])
|
|
652
750
|
}));
|
|
653
|
-
var scheduleSchema =
|
|
654
|
-
id:
|
|
655
|
-
name:
|
|
751
|
+
var scheduleSchema = z10.object({
|
|
752
|
+
id: z10.string(),
|
|
753
|
+
name: z10.string(),
|
|
656
754
|
cadence: cadenceSchema,
|
|
657
755
|
/** Only set when cadence is DAYS_PER_WEEK (1–7). */
|
|
658
|
-
daysPerWeek:
|
|
659
|
-
samplesPerCycle:
|
|
756
|
+
daysPerWeek: z10.number().int().nullable(),
|
|
757
|
+
samplesPerCycle: z10.number().int(),
|
|
660
758
|
/** Authoritative per-agent configuration. */
|
|
661
|
-
agentConfigs:
|
|
759
|
+
agentConfigs: z10.array(scheduleAgentConfigSchema),
|
|
662
760
|
/** Deprecated compatibility projection of agentConfigs. */
|
|
663
|
-
agents:
|
|
761
|
+
agents: z10.array(agentSchema),
|
|
664
762
|
/** Deprecated: null for schedules with per-agent pins. */
|
|
665
|
-
model:
|
|
763
|
+
model: z10.string().nullable(),
|
|
666
764
|
/** Repo targets in stable expansion order; empty = the default scaffold. A
|
|
667
765
|
* null-repoUrl entry is greenfield alongside named repos. */
|
|
668
|
-
repos:
|
|
766
|
+
repos: z10.array(scheduleRepoSchema),
|
|
669
767
|
/** Cohort label for experiment analysis; null outside labeled experiments. */
|
|
670
|
-
experiment:
|
|
671
|
-
enabled:
|
|
672
|
-
lastExpandedAt:
|
|
768
|
+
experiment: z10.string().nullable(),
|
|
769
|
+
enabled: z10.boolean(),
|
|
770
|
+
lastExpandedAt: z10.string().nullable(),
|
|
673
771
|
/** Membership tag ids — the schedule runs the live union of these tags'
|
|
674
772
|
* prompts (resolved at dispatch, not stored). */
|
|
675
|
-
tagIds:
|
|
676
|
-
tagCount:
|
|
773
|
+
tagIds: z10.array(z10.string()),
|
|
774
|
+
tagCount: z10.number().int(),
|
|
677
775
|
/** Persona matrix (ALG-155): member UserProfile ids, in stable expansion
|
|
678
776
|
* order. Empty = the default, unconfigured HaikuJudge (no persona). */
|
|
679
|
-
profileIds:
|
|
777
|
+
profileIds: z10.array(z10.string()),
|
|
680
778
|
/** ALG-155.1: when profileIds is non-empty, also expand once per (prompt ×
|
|
681
779
|
* repo) with no persona alongside the persona batches. Ignored when
|
|
682
780
|
* profileIds is empty (always the implicit default judge). */
|
|
683
|
-
includeDefaultPersona:
|
|
684
|
-
createdAt:
|
|
685
|
-
updatedAt:
|
|
781
|
+
includeDefaultPersona: z10.boolean(),
|
|
782
|
+
createdAt: z10.string(),
|
|
783
|
+
updatedAt: z10.string()
|
|
686
784
|
});
|
|
687
785
|
var scheduleListResponseSchema = listResponseSchema(scheduleSchema);
|
|
688
|
-
var scheduleRepoInputSchema =
|
|
786
|
+
var scheduleRepoInputSchema = z10.object({
|
|
689
787
|
/** null/omitted = the greenfield scaffold as an explicit target. */
|
|
690
|
-
repoUrl:
|
|
691
|
-
repoRef:
|
|
788
|
+
repoUrl: z10.string().min(1).nullish(),
|
|
789
|
+
repoRef: z10.string().min(1).nullish()
|
|
692
790
|
});
|
|
693
|
-
var createScheduleBodyObject =
|
|
694
|
-
name:
|
|
791
|
+
var createScheduleBodyObject = z10.object({
|
|
792
|
+
name: z10.string().min(1, "name is required"),
|
|
695
793
|
cadence: cadenceSchema.default("NONE"),
|
|
696
794
|
daysPerWeek: daysPerWeekSchema.optional(),
|
|
697
|
-
samplesPerCycle:
|
|
795
|
+
samplesPerCycle: z10.number().int().min(1).default(1),
|
|
698
796
|
/** Preferred paired representation (per-agent model tiers). */
|
|
699
|
-
agentConfigs:
|
|
797
|
+
agentConfigs: z10.array(scheduleAgentConfigInputSchema).min(1).optional(),
|
|
700
798
|
/** Legacy shared-model input, accepted during the API transition. */
|
|
701
|
-
agents:
|
|
702
|
-
model:
|
|
799
|
+
agents: z10.array(agentSchema).min(1, "Select at least one agent").optional(),
|
|
800
|
+
model: z10.string().min(1).nullish(),
|
|
703
801
|
/** Repo targets; empty = the default scaffold (greenfield). Add a
|
|
704
802
|
* null-repoUrl entry to run greenfield alongside named repos. */
|
|
705
|
-
repos:
|
|
803
|
+
repos: z10.array(scheduleRepoInputSchema).default([]),
|
|
706
804
|
/** Membership tag ids — the schedule runs the live union of these tags'
|
|
707
805
|
* prompts (specs/schedules-tags-migration.md). Must belong to the org. */
|
|
708
|
-
tagIds:
|
|
806
|
+
tagIds: z10.array(z10.string().min(1)).default([]),
|
|
709
807
|
/** Persona matrix (ALG-155): member UserProfile ids. Empty/omitted = the
|
|
710
808
|
* default, unconfigured HaikuJudge (no persona). */
|
|
711
|
-
profileIds:
|
|
809
|
+
profileIds: z10.array(z10.string().min(1)).default([]),
|
|
712
810
|
/** ALG-155.1: also expand once per (prompt × repo) with no persona
|
|
713
811
|
* alongside the persona batches, when profileIds is non-empty. Ignored
|
|
714
812
|
* when profileIds is empty. */
|
|
715
|
-
includeDefaultPersona:
|
|
716
|
-
enabled:
|
|
813
|
+
includeDefaultPersona: z10.boolean().default(false),
|
|
814
|
+
enabled: z10.boolean().default(true)
|
|
717
815
|
});
|
|
718
816
|
var createScheduleBodySchema = createScheduleBodyObject.refine(
|
|
719
817
|
(body) => body.agentConfigs !== void 0 || body.agents !== void 0,
|
|
@@ -722,115 +820,115 @@ var createScheduleBodySchema = createScheduleBodyObject.refine(
|
|
|
722
820
|
path: ["agentConfigs"]
|
|
723
821
|
}
|
|
724
822
|
);
|
|
725
|
-
var updateScheduleBodySchema =
|
|
726
|
-
name:
|
|
823
|
+
var updateScheduleBodySchema = z10.object({
|
|
824
|
+
name: z10.string().min(1).optional(),
|
|
727
825
|
cadence: cadenceSchema.optional(),
|
|
728
826
|
daysPerWeek: daysPerWeekSchema.optional(),
|
|
729
|
-
samplesPerCycle:
|
|
827
|
+
samplesPerCycle: z10.number().int().min(1).optional(),
|
|
730
828
|
/** Full replacement of the enabled agent/model set (per-agent model tiers). */
|
|
731
|
-
agentConfigs:
|
|
829
|
+
agentConfigs: z10.array(scheduleAgentConfigInputSchema).min(1).optional(),
|
|
732
830
|
/** Legacy shared-model input, accepted during the API transition. */
|
|
733
|
-
agents:
|
|
734
|
-
model:
|
|
735
|
-
repos:
|
|
736
|
-
tagIds:
|
|
737
|
-
profileIds:
|
|
738
|
-
includeDefaultPersona:
|
|
739
|
-
enabled:
|
|
740
|
-
});
|
|
741
|
-
var runScheduleResponseSchema =
|
|
742
|
-
batchIds:
|
|
743
|
-
runIds:
|
|
744
|
-
blocked:
|
|
745
|
-
notReady:
|
|
746
|
-
|
|
747
|
-
repoUrl:
|
|
748
|
-
status:
|
|
831
|
+
agents: z10.array(agentSchema).min(1, "Select at least one agent").optional(),
|
|
832
|
+
model: z10.string().min(1).nullish(),
|
|
833
|
+
repos: z10.array(scheduleRepoInputSchema).optional(),
|
|
834
|
+
tagIds: z10.array(z10.string().min(1)).optional(),
|
|
835
|
+
profileIds: z10.array(z10.string().min(1)).optional(),
|
|
836
|
+
includeDefaultPersona: z10.boolean().optional(),
|
|
837
|
+
enabled: z10.boolean().optional()
|
|
838
|
+
});
|
|
839
|
+
var runScheduleResponseSchema = z10.object({
|
|
840
|
+
batchIds: z10.array(z10.string()),
|
|
841
|
+
runIds: z10.array(z10.string()),
|
|
842
|
+
blocked: z10.enum(["insufficient_credits", "needs_provider_key"]).optional(),
|
|
843
|
+
notReady: z10.array(
|
|
844
|
+
z10.object({
|
|
845
|
+
repoUrl: z10.string(),
|
|
846
|
+
status: z10.enum(["building", "failed", "none"])
|
|
749
847
|
})
|
|
750
848
|
).optional()
|
|
751
849
|
});
|
|
752
850
|
|
|
753
851
|
// ../packages/api-schemas/src/cycles.ts
|
|
754
|
-
var cycleSchema =
|
|
755
|
-
id:
|
|
756
|
-
name:
|
|
852
|
+
var cycleSchema = z11.object({
|
|
853
|
+
id: z11.string(),
|
|
854
|
+
name: z11.string(),
|
|
757
855
|
cadence: cadenceSchema,
|
|
758
|
-
samplesPerCycle:
|
|
759
|
-
enabled:
|
|
856
|
+
samplesPerCycle: z11.number().int(),
|
|
857
|
+
enabled: z11.boolean()
|
|
760
858
|
});
|
|
761
859
|
var cycleWithCountsSchema = cycleSchema.extend({
|
|
762
|
-
evalSetCount:
|
|
763
|
-
visibilityPromptCount:
|
|
860
|
+
evalSetCount: z11.number().int(),
|
|
861
|
+
visibilityPromptCount: z11.number().int()
|
|
764
862
|
});
|
|
765
|
-
var listCyclesResponseSchema =
|
|
766
|
-
items:
|
|
863
|
+
var listCyclesResponseSchema = z11.object({
|
|
864
|
+
items: z11.array(cycleWithCountsSchema)
|
|
767
865
|
});
|
|
768
866
|
var CYCLE_CADENCES = ["NONE", "DAILY", "WEEKLY", "MONTHLY"];
|
|
769
|
-
var cycleCadenceSchema =
|
|
770
|
-
var updateCycleBodySchema =
|
|
867
|
+
var cycleCadenceSchema = z11.enum(CYCLE_CADENCES);
|
|
868
|
+
var updateCycleBodySchema = z11.object({
|
|
771
869
|
cadence: cycleCadenceSchema
|
|
772
870
|
});
|
|
773
871
|
|
|
774
872
|
// ../packages/api-schemas/src/dashboards.ts
|
|
775
|
-
import { z as
|
|
873
|
+
import { z as z14 } from "zod";
|
|
776
874
|
|
|
777
875
|
// ../packages/api-schemas/src/query.ts
|
|
778
|
-
import { z as
|
|
876
|
+
import { z as z13 } from "zod";
|
|
779
877
|
|
|
780
878
|
// ../packages/api-schemas/src/stats.ts
|
|
781
|
-
import { z as
|
|
879
|
+
import { z as z12 } from "zod";
|
|
782
880
|
var BRAND_KINDS2 = ["OWNED", "COMPETITOR", "OTHER"];
|
|
783
|
-
var brandKindSchema2 =
|
|
784
|
-
var brandRankingSchema =
|
|
785
|
-
rank:
|
|
786
|
-
brandId:
|
|
787
|
-
brandName:
|
|
881
|
+
var brandKindSchema2 = z12.enum(BRAND_KINDS2);
|
|
882
|
+
var brandRankingSchema = z12.object({
|
|
883
|
+
rank: z12.number().int(),
|
|
884
|
+
brandId: z12.string(),
|
|
885
|
+
brandName: z12.string(),
|
|
788
886
|
kind: brandKindSchema2,
|
|
789
|
-
installs:
|
|
790
|
-
installRate:
|
|
791
|
-
mentionRate:
|
|
887
|
+
installs: z12.number().int(),
|
|
888
|
+
installRate: z12.number(),
|
|
889
|
+
mentionRate: z12.number(),
|
|
792
890
|
/** Movement between the two most recent batch windows; null if not ranked in both. */
|
|
793
|
-
deltaRank:
|
|
891
|
+
deltaRank: z12.number().int().nullable()
|
|
794
892
|
});
|
|
795
|
-
var packageRateSchema =
|
|
796
|
-
ecosystem:
|
|
797
|
-
name:
|
|
798
|
-
brandName:
|
|
893
|
+
var packageRateSchema = z12.object({
|
|
894
|
+
ecosystem: z12.string(),
|
|
895
|
+
name: z12.string(),
|
|
896
|
+
brandName: z12.string().optional(),
|
|
799
897
|
kind: brandKindSchema2.optional(),
|
|
800
|
-
installs:
|
|
801
|
-
rate:
|
|
898
|
+
installs: z12.number().int(),
|
|
899
|
+
rate: z12.number()
|
|
802
900
|
});
|
|
803
|
-
var brandRateSchema =
|
|
804
|
-
brandId:
|
|
805
|
-
brandName:
|
|
901
|
+
var brandRateSchema = z12.object({
|
|
902
|
+
brandId: z12.string(),
|
|
903
|
+
brandName: z12.string(),
|
|
806
904
|
kind: brandKindSchema2,
|
|
807
|
-
installs:
|
|
808
|
-
rate:
|
|
905
|
+
installs: z12.number().int(),
|
|
906
|
+
rate: z12.number()
|
|
809
907
|
});
|
|
810
|
-
var brandFunnelRowSchema =
|
|
811
|
-
brandId:
|
|
812
|
-
brandName:
|
|
908
|
+
var brandFunnelRowSchema = z12.object({
|
|
909
|
+
brandId: z12.string(),
|
|
910
|
+
brandName: z12.string(),
|
|
813
911
|
kind: brandKindSchema2,
|
|
814
|
-
mentionRate:
|
|
815
|
-
installRate:
|
|
816
|
-
});
|
|
817
|
-
var domainRateSchema =
|
|
818
|
-
domain:
|
|
819
|
-
runs:
|
|
820
|
-
rate:
|
|
821
|
-
requests:
|
|
822
|
-
brandName:
|
|
823
|
-
owned:
|
|
824
|
-
});
|
|
825
|
-
var statsFreshnessSchema =
|
|
912
|
+
mentionRate: z12.number(),
|
|
913
|
+
installRate: z12.number()
|
|
914
|
+
});
|
|
915
|
+
var domainRateSchema = z12.object({
|
|
916
|
+
domain: z12.string(),
|
|
917
|
+
runs: z12.number().int(),
|
|
918
|
+
rate: z12.number(),
|
|
919
|
+
requests: z12.number().int(),
|
|
920
|
+
brandName: z12.string().optional(),
|
|
921
|
+
owned: z12.boolean().optional()
|
|
922
|
+
});
|
|
923
|
+
var statsFreshnessSchema = z12.object({
|
|
826
924
|
/** Newest run-ingest time across the org (ISO), or null if nothing ingested. */
|
|
827
|
-
watermark:
|
|
925
|
+
watermark: z12.string().nullable(),
|
|
828
926
|
/** Runs that succeeded recently but haven't landed in the warehouse yet. */
|
|
829
|
-
pending:
|
|
927
|
+
pending: z12.number().int(),
|
|
830
928
|
/** False when the freshness read itself failed (distinguish from genuine zero). */
|
|
831
|
-
available:
|
|
929
|
+
available: z12.boolean()
|
|
832
930
|
});
|
|
833
|
-
var statsResponseSchema = (item) =>
|
|
931
|
+
var statsResponseSchema = (item) => z12.object({ items: z12.array(item), freshness: statsFreshnessSchema });
|
|
834
932
|
var rankingsResponseSchema = statsResponseSchema(brandRankingSchema);
|
|
835
933
|
var installsResponseSchema = statsResponseSchema(packageRateSchema);
|
|
836
934
|
var brandsResponseSchema = statsResponseSchema(brandRateSchema);
|
|
@@ -849,7 +947,7 @@ var DATASETS = [
|
|
|
849
947
|
"tokens",
|
|
850
948
|
"brand_rollup"
|
|
851
949
|
];
|
|
852
|
-
var datasetSchema =
|
|
950
|
+
var datasetSchema = z13.enum(DATASETS);
|
|
853
951
|
var WHERE_OPS = [
|
|
854
952
|
"eq",
|
|
855
953
|
"neq",
|
|
@@ -861,216 +959,216 @@ var WHERE_OPS = [
|
|
|
861
959
|
"lt",
|
|
862
960
|
"lte"
|
|
863
961
|
];
|
|
864
|
-
var whereOpSchema =
|
|
962
|
+
var whereOpSchema = z13.enum(WHERE_OPS);
|
|
865
963
|
var GRANULARITIES = ["day", "week", "month"];
|
|
866
|
-
var granularitySchema =
|
|
964
|
+
var granularitySchema = z13.enum(GRANULARITIES);
|
|
867
965
|
var DEFAULT_QUERY_LIMIT = 50;
|
|
868
966
|
var MAX_QUERY_LIMIT = 1e3;
|
|
869
|
-
var scalar =
|
|
870
|
-
var whereClauseSchema =
|
|
871
|
-
dimension:
|
|
967
|
+
var scalar = z13.union([z13.string(), z13.number(), z13.boolean()]);
|
|
968
|
+
var whereClauseSchema = z13.object({
|
|
969
|
+
dimension: z13.string().min(1),
|
|
872
970
|
op: whereOpSchema,
|
|
873
|
-
value:
|
|
874
|
-
});
|
|
875
|
-
var queryFiltersSchema =
|
|
876
|
-
prompt:
|
|
877
|
-
topic:
|
|
878
|
-
tag:
|
|
879
|
-
repo:
|
|
880
|
-
language:
|
|
881
|
-
framework:
|
|
882
|
-
size:
|
|
883
|
-
agent:
|
|
971
|
+
value: z13.union([scalar, z13.array(scalar)])
|
|
972
|
+
});
|
|
973
|
+
var queryFiltersSchema = z13.object({
|
|
974
|
+
prompt: z13.string(),
|
|
975
|
+
topic: z13.array(z13.string()),
|
|
976
|
+
tag: z13.array(z13.string()),
|
|
977
|
+
repo: z13.array(z13.string()),
|
|
978
|
+
language: z13.array(z13.string()),
|
|
979
|
+
framework: z13.array(z13.string()),
|
|
980
|
+
size: z13.array(z13.string()),
|
|
981
|
+
agent: z13.array(z13.string()),
|
|
884
982
|
/** Persona UserProfile ids; the NO_PERSONA sentinel = default judge. */
|
|
885
|
-
persona:
|
|
886
|
-
model:
|
|
887
|
-
scenario:
|
|
888
|
-
experiment:
|
|
889
|
-
branded:
|
|
983
|
+
persona: z13.array(z13.string()),
|
|
984
|
+
model: z13.array(z13.string()),
|
|
985
|
+
scenario: z13.array(z13.string()),
|
|
986
|
+
experiment: z13.array(z13.string()),
|
|
987
|
+
branded: z13.boolean()
|
|
890
988
|
}).partial();
|
|
891
|
-
var dateRangeSchema =
|
|
892
|
-
since:
|
|
893
|
-
until:
|
|
894
|
-
lastDays:
|
|
989
|
+
var dateRangeSchema = z13.object({
|
|
990
|
+
since: z13.string(),
|
|
991
|
+
until: z13.string(),
|
|
992
|
+
lastDays: z13.number().int().positive()
|
|
895
993
|
}).partial();
|
|
896
|
-
var orderBySchema =
|
|
994
|
+
var orderBySchema = z13.object({
|
|
897
995
|
/** A selected dimension or metric name. */
|
|
898
|
-
key:
|
|
899
|
-
dir:
|
|
996
|
+
key: z13.string().min(1),
|
|
997
|
+
dir: z13.enum(["asc", "desc"]).default("desc")
|
|
900
998
|
});
|
|
901
|
-
var querySpecSchema =
|
|
999
|
+
var querySpecSchema = z13.object({
|
|
902
1000
|
dataset: datasetSchema.default("runs"),
|
|
903
|
-
dimensions:
|
|
904
|
-
metrics:
|
|
1001
|
+
dimensions: z13.array(z13.string()).default([]),
|
|
1002
|
+
metrics: z13.array(z13.string()).min(1, "at least one metric is required"),
|
|
905
1003
|
filters: queryFiltersSchema.default({}),
|
|
906
|
-
where:
|
|
1004
|
+
where: z13.array(whereClauseSchema).default([]),
|
|
907
1005
|
dateRange: dateRangeSchema.optional(),
|
|
908
|
-
orderBy:
|
|
909
|
-
limit:
|
|
1006
|
+
orderBy: z13.array(orderBySchema).default([]),
|
|
1007
|
+
limit: z13.number().int().min(1).max(MAX_QUERY_LIMIT).default(DEFAULT_QUERY_LIMIT),
|
|
910
1008
|
granularity: granularitySchema.default("day"),
|
|
911
1009
|
/** When true, the response echoes the compiled SQL (params bound, not inlined). */
|
|
912
|
-
explain:
|
|
1010
|
+
explain: z13.boolean().default(false)
|
|
913
1011
|
});
|
|
914
|
-
var columnKindSchema =
|
|
915
|
-
var queryColumnSchema =
|
|
916
|
-
key:
|
|
1012
|
+
var columnKindSchema = z13.enum(["dimension", "metric"]);
|
|
1013
|
+
var queryColumnSchema = z13.object({
|
|
1014
|
+
key: z13.string(),
|
|
917
1015
|
kind: columnKindSchema
|
|
918
1016
|
});
|
|
919
|
-
var queryRowSchema =
|
|
920
|
-
|
|
921
|
-
|
|
1017
|
+
var queryRowSchema = z13.record(
|
|
1018
|
+
z13.string(),
|
|
1019
|
+
z13.union([z13.string(), z13.number(), z13.boolean(), z13.null()])
|
|
922
1020
|
);
|
|
923
|
-
var queryResponseSchema =
|
|
924
|
-
columns:
|
|
925
|
-
rows:
|
|
1021
|
+
var queryResponseSchema = z13.object({
|
|
1022
|
+
columns: z13.array(queryColumnSchema),
|
|
1023
|
+
rows: z13.array(queryRowSchema),
|
|
926
1024
|
/** Present only when the request set explain=true. */
|
|
927
|
-
sql:
|
|
1025
|
+
sql: z13.string().optional(),
|
|
928
1026
|
freshness: statsFreshnessSchema
|
|
929
1027
|
});
|
|
930
|
-
var fieldTypeSchema =
|
|
1028
|
+
var fieldTypeSchema = z13.enum([
|
|
931
1029
|
"string",
|
|
932
1030
|
"number",
|
|
933
1031
|
"rate",
|
|
934
1032
|
"date",
|
|
935
1033
|
"boolean"
|
|
936
1034
|
]);
|
|
937
|
-
var fieldSchema =
|
|
938
|
-
name:
|
|
1035
|
+
var fieldSchema = z13.object({
|
|
1036
|
+
name: z13.string(),
|
|
939
1037
|
type: fieldTypeSchema,
|
|
940
1038
|
/** One-line human/agent hint. */
|
|
941
|
-
description:
|
|
1039
|
+
description: z13.string().optional()
|
|
942
1040
|
});
|
|
943
|
-
var datasetMetaSchema =
|
|
1041
|
+
var datasetMetaSchema = z13.object({
|
|
944
1042
|
name: datasetSchema,
|
|
945
|
-
grain:
|
|
946
|
-
dimensions:
|
|
947
|
-
metrics:
|
|
1043
|
+
grain: z13.string(),
|
|
1044
|
+
dimensions: z13.array(fieldSchema),
|
|
1045
|
+
metrics: z13.array(fieldSchema)
|
|
948
1046
|
});
|
|
949
|
-
var metadataResponseSchema =
|
|
950
|
-
datasets:
|
|
1047
|
+
var metadataResponseSchema = z13.object({
|
|
1048
|
+
datasets: z13.array(datasetMetaSchema)
|
|
951
1049
|
});
|
|
952
1050
|
|
|
953
1051
|
// ../packages/api-schemas/src/dashboards.ts
|
|
954
1052
|
var VIZ_TYPES = ["line", "bar", "table", "kpi"];
|
|
955
|
-
var vizTypeSchema =
|
|
956
|
-
var widgetEncodingSchema =
|
|
957
|
-
x:
|
|
1053
|
+
var vizTypeSchema = z14.enum(VIZ_TYPES);
|
|
1054
|
+
var widgetEncodingSchema = z14.object({
|
|
1055
|
+
x: z14.string(),
|
|
958
1056
|
// dimension key for the x axis (line)
|
|
959
|
-
series:
|
|
1057
|
+
series: z14.string(),
|
|
960
1058
|
// dimension key split into one series per value (line)
|
|
961
|
-
y:
|
|
1059
|
+
y: z14.array(z14.string())
|
|
962
1060
|
// metric keys for the value axis
|
|
963
1061
|
}).partial();
|
|
964
1062
|
var widgetFields = {
|
|
965
|
-
id:
|
|
966
|
-
title:
|
|
1063
|
+
id: z14.string().min(1),
|
|
1064
|
+
title: z14.string(),
|
|
967
1065
|
viz: vizTypeSchema,
|
|
968
1066
|
spec: querySpecSchema,
|
|
969
1067
|
// 12-col grid placement.
|
|
970
|
-
x:
|
|
971
|
-
y:
|
|
972
|
-
w:
|
|
973
|
-
h:
|
|
1068
|
+
x: z14.number().int().min(0).max(11),
|
|
1069
|
+
y: z14.number().int().min(0),
|
|
1070
|
+
w: z14.number().int().min(1).max(12),
|
|
1071
|
+
h: z14.number().int().min(1),
|
|
974
1072
|
encoding: widgetEncodingSchema.optional()
|
|
975
1073
|
};
|
|
976
|
-
var widgetSchema =
|
|
1074
|
+
var widgetSchema = z14.object(widgetFields).refine((w) => w.x + w.w <= 12, {
|
|
977
1075
|
message: "widget spills past the 12-column grid (x + w must be \u2264 12)"
|
|
978
1076
|
});
|
|
979
|
-
var widgetPatchSchema =
|
|
980
|
-
var dashboardFiltersSchema =
|
|
1077
|
+
var widgetPatchSchema = z14.object(widgetFields).partial();
|
|
1078
|
+
var dashboardFiltersSchema = z14.object({
|
|
981
1079
|
filters: queryFiltersSchema,
|
|
982
1080
|
dateRange: dateRangeSchema
|
|
983
1081
|
}).partial();
|
|
984
|
-
var overlayPatchSchema =
|
|
985
|
-
name:
|
|
1082
|
+
var overlayPatchSchema = z14.object({
|
|
1083
|
+
name: z14.string(),
|
|
986
1084
|
defaultFilters: dashboardFiltersSchema,
|
|
987
|
-
widgets:
|
|
1085
|
+
widgets: z14.record(z14.string(), widgetPatchSchema.nullable()),
|
|
988
1086
|
// Explicit widget-id ordering (for reordering and from-scratch widgets).
|
|
989
|
-
order:
|
|
1087
|
+
order: z14.array(z14.string())
|
|
990
1088
|
}).partial();
|
|
991
|
-
var resolvedDashboardSchema =
|
|
992
|
-
key:
|
|
993
|
-
name:
|
|
994
|
-
widgets:
|
|
1089
|
+
var resolvedDashboardSchema = z14.object({
|
|
1090
|
+
key: z14.string(),
|
|
1091
|
+
name: z14.string(),
|
|
1092
|
+
widgets: z14.array(widgetSchema),
|
|
995
1093
|
defaultFilters: dashboardFiltersSchema,
|
|
996
|
-
hasOrgOverlay:
|
|
997
|
-
hasUserOverlay:
|
|
1094
|
+
hasOrgOverlay: z14.boolean(),
|
|
1095
|
+
hasUserOverlay: z14.boolean()
|
|
998
1096
|
});
|
|
999
|
-
var dashboardTemplateSchema =
|
|
1000
|
-
key:
|
|
1001
|
-
name:
|
|
1002
|
-
description:
|
|
1003
|
-
widgets:
|
|
1097
|
+
var dashboardTemplateSchema = z14.object({
|
|
1098
|
+
key: z14.string().min(1),
|
|
1099
|
+
name: z14.string(),
|
|
1100
|
+
description: z14.string().optional(),
|
|
1101
|
+
widgets: z14.array(widgetSchema),
|
|
1004
1102
|
defaultFilters: dashboardFiltersSchema.optional()
|
|
1005
1103
|
});
|
|
1006
|
-
var dashboardSummarySchema =
|
|
1007
|
-
key:
|
|
1008
|
-
name:
|
|
1009
|
-
source:
|
|
1010
|
-
isUserDefault:
|
|
1011
|
-
isOrgDefault:
|
|
1104
|
+
var dashboardSummarySchema = z14.object({
|
|
1105
|
+
key: z14.string(),
|
|
1106
|
+
name: z14.string(),
|
|
1107
|
+
source: z14.enum(["template", "org", "user"]),
|
|
1108
|
+
isUserDefault: z14.boolean(),
|
|
1109
|
+
isOrgDefault: z14.boolean()
|
|
1012
1110
|
});
|
|
1013
|
-
var listDashboardsResponseSchema =
|
|
1014
|
-
items:
|
|
1111
|
+
var listDashboardsResponseSchema = z14.object({
|
|
1112
|
+
items: z14.array(dashboardSummarySchema)
|
|
1015
1113
|
});
|
|
1016
|
-
var createDashboardBodySchema =
|
|
1017
|
-
name:
|
|
1018
|
-
widgets:
|
|
1114
|
+
var createDashboardBodySchema = z14.object({
|
|
1115
|
+
name: z14.string().min(1).max(120),
|
|
1116
|
+
widgets: z14.array(widgetSchema).optional()
|
|
1019
1117
|
});
|
|
1020
|
-
var updateDashboardBodySchema =
|
|
1021
|
-
name:
|
|
1118
|
+
var updateDashboardBodySchema = z14.object({
|
|
1119
|
+
name: z14.string().min(1).max(120)
|
|
1022
1120
|
});
|
|
1023
1121
|
|
|
1024
1122
|
// ../packages/api-schemas/src/device.ts
|
|
1025
|
-
import { z as
|
|
1026
|
-
var deviceAuthorizeRequestSchema =
|
|
1123
|
+
import { z as z15 } from "zod";
|
|
1124
|
+
var deviceAuthorizeRequestSchema = z15.object({
|
|
1027
1125
|
/** Device label (the CLI's hostname) for display + token naming. */
|
|
1028
|
-
deviceName:
|
|
1126
|
+
deviceName: z15.string().trim().max(64).optional(),
|
|
1029
1127
|
/** Optional: email a magic-link that lands on the approval page pre-scoped
|
|
1030
1128
|
* to this device (best-effort — the printed URL always works regardless). */
|
|
1031
|
-
email:
|
|
1129
|
+
email: z15.string().trim().email().max(320).optional()
|
|
1032
1130
|
});
|
|
1033
|
-
var deviceAuthorizeResponseSchema =
|
|
1131
|
+
var deviceAuthorizeResponseSchema = z15.object({
|
|
1034
1132
|
/** The one-time secret the CLI polls with (never shown again). */
|
|
1035
|
-
deviceCode:
|
|
1133
|
+
deviceCode: z15.string(),
|
|
1036
1134
|
/** Short human-typed code the user confirms in the browser (e.g. WXYZ-1234). */
|
|
1037
|
-
userCode:
|
|
1135
|
+
userCode: z15.string(),
|
|
1038
1136
|
/** Where the user approves (e.g. https://…/cli/authorize). */
|
|
1039
|
-
verificationUri:
|
|
1137
|
+
verificationUri: z15.string(),
|
|
1040
1138
|
/** verificationUri with the code pre-filled, for one-click / QR. */
|
|
1041
|
-
verificationUriComplete:
|
|
1139
|
+
verificationUriComplete: z15.string(),
|
|
1042
1140
|
/** Minimum seconds between polls. */
|
|
1043
|
-
interval:
|
|
1141
|
+
interval: z15.number().int().positive(),
|
|
1044
1142
|
/** Seconds until the device code expires. */
|
|
1045
|
-
expiresIn:
|
|
1143
|
+
expiresIn: z15.number().int().positive(),
|
|
1046
1144
|
/** Whether a magic-link email was dispatched (best-effort). */
|
|
1047
|
-
emailSent:
|
|
1145
|
+
emailSent: z15.boolean()
|
|
1048
1146
|
});
|
|
1049
|
-
var deviceTokenRequestSchema =
|
|
1050
|
-
deviceCode:
|
|
1147
|
+
var deviceTokenRequestSchema = z15.object({
|
|
1148
|
+
deviceCode: z15.string().min(1)
|
|
1051
1149
|
});
|
|
1052
|
-
var deviceTokenApprovedSchema =
|
|
1053
|
-
status:
|
|
1150
|
+
var deviceTokenApprovedSchema = z15.object({
|
|
1151
|
+
status: z15.literal("approved"),
|
|
1054
1152
|
/** The `gauge_…` bearer secret. Store it now — never returned again. */
|
|
1055
|
-
accessToken:
|
|
1056
|
-
tokenType:
|
|
1153
|
+
accessToken: z15.string(),
|
|
1154
|
+
tokenType: z15.literal("bearer"),
|
|
1057
1155
|
/** ISO-8601 expiry, or null for no expiry. */
|
|
1058
|
-
expiresAt:
|
|
1156
|
+
expiresAt: z15.string().nullable()
|
|
1059
1157
|
});
|
|
1060
|
-
var deviceTokenResultSchema =
|
|
1158
|
+
var deviceTokenResultSchema = z15.discriminatedUnion("status", [
|
|
1061
1159
|
// Not yet approved — keep polling at `interval`.
|
|
1062
|
-
|
|
1160
|
+
z15.object({ status: z15.literal("pending") }),
|
|
1063
1161
|
// Polled faster than `interval` — back off by `interval` seconds.
|
|
1064
|
-
|
|
1162
|
+
z15.object({ status: z15.literal("slow_down"), interval: z15.number().int() }),
|
|
1065
1163
|
// The user explicitly denied the request. Stop.
|
|
1066
|
-
|
|
1164
|
+
z15.object({ status: z15.literal("denied") }),
|
|
1067
1165
|
// The device code expired or is unknown/already-redeemed. Stop and restart.
|
|
1068
|
-
|
|
1166
|
+
z15.object({ status: z15.literal("expired") }),
|
|
1069
1167
|
deviceTokenApprovedSchema
|
|
1070
1168
|
]);
|
|
1071
1169
|
|
|
1072
1170
|
// ../packages/api-schemas/src/evals.ts
|
|
1073
|
-
import { z as
|
|
1171
|
+
import { z as z19 } from "zod";
|
|
1074
1172
|
|
|
1075
1173
|
// ../packages/api-schemas/src/runPresets.ts
|
|
1076
1174
|
var runPresets_exports = {};
|
|
@@ -1101,18 +1199,308 @@ __export(runPresets_exports, {
|
|
|
1101
1199
|
totalRunsPerCycle: () => totalRunsPerCycle,
|
|
1102
1200
|
updateRunPresetBodySchema: () => updateRunPresetBodySchema
|
|
1103
1201
|
});
|
|
1104
|
-
import { z as
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1202
|
+
import { z as z18 } from "zod";
|
|
1203
|
+
|
|
1204
|
+
// ../packages/api-schemas/src/runs.ts
|
|
1205
|
+
import { z as z17 } from "zod";
|
|
1206
|
+
|
|
1207
|
+
// ../packages/api-schemas/src/web-fixtures.ts
|
|
1208
|
+
import { z as z16 } from "zod";
|
|
1209
|
+
var MAX_WEB_FIXTURE_BYTES = 1e6;
|
|
1210
|
+
function withoutFragment(raw) {
|
|
1211
|
+
const fragment = raw.indexOf("#");
|
|
1212
|
+
return fragment === -1 ? raw : raw.slice(0, fragment);
|
|
1213
|
+
}
|
|
1214
|
+
var searchResultSchema = z16.object({
|
|
1215
|
+
title: z16.string().min(1),
|
|
1216
|
+
url: z16.url().transform(withoutFragment),
|
|
1217
|
+
snippet: z16.string()
|
|
1218
|
+
});
|
|
1219
|
+
var searchFixtureSchema = z16.object({
|
|
1220
|
+
query: z16.string().trim().min(1),
|
|
1221
|
+
results: z16.array(searchResultSchema)
|
|
1222
|
+
});
|
|
1223
|
+
var pageFixtureSchema = z16.object({
|
|
1224
|
+
url: z16.url().transform(withoutFragment),
|
|
1225
|
+
status: z16.int().min(100).max(599).default(200),
|
|
1226
|
+
contentType: z16.string().trim().min(1).default("text/html"),
|
|
1227
|
+
body: z16.string()
|
|
1228
|
+
});
|
|
1229
|
+
var webFixtureSchema = z16.object({
|
|
1230
|
+
version: z16.literal(1),
|
|
1231
|
+
searches: z16.array(searchFixtureSchema).default([]),
|
|
1232
|
+
pages: z16.array(pageFixtureSchema).default([])
|
|
1233
|
+
}).superRefine((fixture, ctx) => {
|
|
1234
|
+
const queries = /* @__PURE__ */ new Set();
|
|
1235
|
+
fixture.searches.forEach((entry, index) => {
|
|
1236
|
+
if (queries.has(entry.query)) {
|
|
1237
|
+
ctx.addIssue({
|
|
1238
|
+
code: "custom",
|
|
1239
|
+
path: ["searches", index, "query"],
|
|
1240
|
+
message: `duplicate normalized query: ${entry.query}`
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
queries.add(entry.query);
|
|
1244
|
+
});
|
|
1245
|
+
const urls = /* @__PURE__ */ new Set();
|
|
1246
|
+
fixture.pages.forEach((entry, index) => {
|
|
1247
|
+
if (urls.has(entry.url)) {
|
|
1248
|
+
ctx.addIssue({
|
|
1249
|
+
code: "custom",
|
|
1250
|
+
path: ["pages", index, "url"],
|
|
1251
|
+
message: `duplicate normalized URL: ${entry.url}`
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
urls.add(entry.url);
|
|
1255
|
+
});
|
|
1256
|
+
const bytes = new TextEncoder().encode(JSON.stringify(fixture)).byteLength;
|
|
1257
|
+
if (bytes > MAX_WEB_FIXTURE_BYTES) {
|
|
1258
|
+
ctx.addIssue({
|
|
1259
|
+
code: "custom",
|
|
1260
|
+
message: `serialized fixture is ${bytes} bytes; maximum is ${MAX_WEB_FIXTURE_BYTES}`
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1110
1263
|
});
|
|
1111
|
-
|
|
1264
|
+
|
|
1265
|
+
// ../packages/api-schemas/src/runs.ts
|
|
1266
|
+
var RUN_STATUSES = [
|
|
1267
|
+
"QUEUED",
|
|
1268
|
+
"CLAIMED",
|
|
1269
|
+
"PROVISIONING",
|
|
1270
|
+
"RUNNING",
|
|
1271
|
+
"SUCCEEDED",
|
|
1272
|
+
"FAILED",
|
|
1273
|
+
"TIMED_OUT",
|
|
1274
|
+
"CANCELED"
|
|
1275
|
+
];
|
|
1276
|
+
var runStatusSchema = z17.enum(RUN_STATUSES);
|
|
1277
|
+
var AGENTS2 = [
|
|
1278
|
+
"CLAUDE_CODE",
|
|
1279
|
+
"CODEX_CLI",
|
|
1280
|
+
"CURSOR",
|
|
1281
|
+
"PI",
|
|
1282
|
+
"OPENCODE"
|
|
1283
|
+
];
|
|
1284
|
+
var agentSchema2 = z17.enum(AGENTS2);
|
|
1285
|
+
var OBSERVED_PROVIDER_SOURCES = [
|
|
1286
|
+
"AGENT_STREAM",
|
|
1287
|
+
"GATEWAY_RESPONSE",
|
|
1288
|
+
"GATEWAY_AUDIT",
|
|
1289
|
+
"CANARY"
|
|
1290
|
+
];
|
|
1291
|
+
var observedProviderSourceSchema = z17.enum(OBSERVED_PROVIDER_SOURCES);
|
|
1292
|
+
var selectedProviderSchema = z17.object({
|
|
1293
|
+
slug: z17.string(),
|
|
1294
|
+
displayName: z17.string()
|
|
1295
|
+
});
|
|
1296
|
+
var observedProviderSchema = z17.object({
|
|
1297
|
+
slug: z17.string(),
|
|
1298
|
+
source: observedProviderSourceSchema
|
|
1299
|
+
});
|
|
1300
|
+
var runStatusFilterSchema = z17.string().transform(
|
|
1301
|
+
(raw) => raw.split(",").map((s) => s.trim().toUpperCase()).filter(Boolean)
|
|
1302
|
+
).pipe(z17.array(runStatusSchema).min(1));
|
|
1303
|
+
var runListQuerySchema = listQuerySchema.extend({
|
|
1304
|
+
status: runStatusFilterSchema.optional(),
|
|
1305
|
+
batch: z17.string().optional(),
|
|
1306
|
+
prompt: z17.string().optional(),
|
|
1307
|
+
experiment: z17.string().optional(),
|
|
1308
|
+
evalSet: z17.string().optional(),
|
|
1309
|
+
since: z17.string().optional()
|
|
1310
|
+
});
|
|
1311
|
+
var runListItemSchema = z17.object({
|
|
1312
|
+
id: z17.string(),
|
|
1313
|
+
status: runStatusSchema,
|
|
1314
|
+
agent: agentSchema2,
|
|
1315
|
+
/** Requested logical-model pin. Empty means the platform default was used. */
|
|
1316
|
+
model: z17.string(),
|
|
1317
|
+
/** Model reported by the harness; null until observed or on legacy runs. */
|
|
1318
|
+
resolvedModel: z17.string().nullable().optional(),
|
|
1319
|
+
/** Catalog presentation label for the selected logical model. */
|
|
1320
|
+
modelDisplayName: z17.string().nullable().optional(),
|
|
1321
|
+
/** Catalog provider selected before execution; null on legacy runs. */
|
|
1322
|
+
selectedProvider: selectedProviderSchema.nullable().optional(),
|
|
1323
|
+
/** Trusted terminal upstream observation; may differ from the selected
|
|
1324
|
+
* aggregator and is null when the runtime supplies no provenance. */
|
|
1325
|
+
observedProvider: observedProviderSchema.nullable().optional(),
|
|
1326
|
+
promptId: z17.string(),
|
|
1327
|
+
/** First ~80 chars of the batch's prompt snapshot, whitespace-collapsed. */
|
|
1328
|
+
promptSnippet: z17.string(),
|
|
1329
|
+
batchId: z17.string(),
|
|
1330
|
+
experiment: z17.string().nullable(),
|
|
1331
|
+
/** The eval set whose expansion (or backfill) minted the batch; null for
|
|
1332
|
+
* schedule/visibility/ad-hoc runs. */
|
|
1333
|
+
evalSetId: z17.string().nullable(),
|
|
1334
|
+
turns: z17.number().int().nullable(),
|
|
1335
|
+
usdCost: z17.number().nullable(),
|
|
1336
|
+
durationMs: z17.number().int().nullable(),
|
|
1337
|
+
exitReason: z17.string().nullable(),
|
|
1338
|
+
createdAt: z17.string(),
|
|
1339
|
+
startedAt: z17.string().nullable(),
|
|
1340
|
+
finishedAt: z17.string().nullable(),
|
|
1341
|
+
/** Fork lineage (fork-simulations WS1): the source run this was forked from,
|
|
1342
|
+
* or null for an organic run. Forks are excluded from aggregate analytics but
|
|
1343
|
+
* kept visible; consumers badge on these fields. */
|
|
1344
|
+
parentRunId: z17.string().nullable(),
|
|
1345
|
+
/** Set when this run is a fetch-fork simulation variant (injected web
|
|
1346
|
+
* content); null otherwise. Distinguishes a "Simulation" badge from a plain
|
|
1347
|
+
* conversation fork. */
|
|
1348
|
+
fetchForkPlanId: z17.string().nullable()
|
|
1349
|
+
});
|
|
1350
|
+
var runListResponseSchema = listResponseSchema(runListItemSchema);
|
|
1351
|
+
var runDetailSchema = runListItemSchema.omit({ promptSnippet: true }).extend({
|
|
1352
|
+
promptText: z17.string(),
|
|
1353
|
+
attempt: z17.number().int(),
|
|
1354
|
+
cancelRequested: z17.boolean(),
|
|
1355
|
+
failureReason: z17.string().nullable(),
|
|
1356
|
+
repoUrl: z17.string().nullable(),
|
|
1357
|
+
repoRef: z17.string().nullable(),
|
|
1358
|
+
scenario: z17.string(),
|
|
1359
|
+
funding: z17.string(),
|
|
1360
|
+
/** Raw harness usage write-back (token counts etc.); shape may evolve. */
|
|
1361
|
+
usage: z17.unknown().nullable(),
|
|
1362
|
+
/** Artifact pointer: a working-tree diff exists at GET /runs/{id}/diff. */
|
|
1363
|
+
hasDiff: z17.boolean(),
|
|
1364
|
+
claimedAt: z17.string().nullable(),
|
|
1365
|
+
/** Judged criteria verdicts for eval-set runs (empty otherwise). `name`
|
|
1366
|
+
* is the judge-time snapshot; `criterionId` is null once the criterion
|
|
1367
|
+
* was deleted from its set. */
|
|
1368
|
+
criterionResults: z17.array(
|
|
1369
|
+
z17.object({
|
|
1370
|
+
criterionId: z17.string().nullable(),
|
|
1371
|
+
name: z17.string(),
|
|
1372
|
+
passed: z17.boolean(),
|
|
1373
|
+
reasoning: z17.string().nullable()
|
|
1374
|
+
})
|
|
1375
|
+
)
|
|
1376
|
+
});
|
|
1377
|
+
var cancelRunResponseSchema = z17.object({
|
|
1378
|
+
id: z17.string(),
|
|
1379
|
+
status: runStatusSchema,
|
|
1380
|
+
cancelRequested: z17.boolean(),
|
|
1381
|
+
note: z17.string().optional()
|
|
1382
|
+
});
|
|
1383
|
+
var forkRunBodySchema = z17.object({
|
|
1384
|
+
prompt: z17.string().trim().min(1).max(2e4),
|
|
1385
|
+
turn: z17.number().int().min(0).optional(),
|
|
1386
|
+
webFixture: webFixtureSchema.optional()
|
|
1387
|
+
});
|
|
1388
|
+
var forkRunResponseSchema = z17.object({
|
|
1389
|
+
runId: z17.string(),
|
|
1390
|
+
batchId: z17.string(),
|
|
1391
|
+
parentRunId: z17.string(),
|
|
1392
|
+
checkpointId: z17.string(),
|
|
1393
|
+
turn: z17.number().int().min(0)
|
|
1394
|
+
});
|
|
1395
|
+
var fetchForkAtFetchBodySchema = z17.object({
|
|
1396
|
+
boundarySeq: z17.string().min(1),
|
|
1397
|
+
injectedContent: z17.string(),
|
|
1398
|
+
prompts: z17.array(z17.string()).min(1)
|
|
1399
|
+
});
|
|
1400
|
+
var fetchForkAtFetchResponseSchema = z17.object({
|
|
1401
|
+
planId: z17.string()
|
|
1402
|
+
});
|
|
1403
|
+
var fetchForkPlanStatusSchema = z17.enum([
|
|
1404
|
+
"DRAFT",
|
|
1405
|
+
"SURGERY_RUNNING",
|
|
1406
|
+
"SURGERY_READY",
|
|
1407
|
+
"FORKED",
|
|
1408
|
+
"FAILED"
|
|
1409
|
+
]);
|
|
1410
|
+
var fetchForkPlanResponseSchema = z17.object({
|
|
1411
|
+
id: z17.string(),
|
|
1412
|
+
status: fetchForkPlanStatusSchema,
|
|
1413
|
+
boundaryUrl: z17.string(),
|
|
1414
|
+
boundaryTurn: z17.number().int(),
|
|
1415
|
+
prompts: z17.array(z17.string()),
|
|
1416
|
+
surgicalCheckpointId: z17.string().nullable(),
|
|
1417
|
+
forkBatchId: z17.string().nullable(),
|
|
1418
|
+
errorText: z17.string().nullable(),
|
|
1419
|
+
forkedRunIds: z17.array(z17.string())
|
|
1420
|
+
});
|
|
1421
|
+
var RUN_INSIGHT_STATUSES = [
|
|
1422
|
+
"PENDING",
|
|
1423
|
+
"RUNNING",
|
|
1424
|
+
"COMPLETE",
|
|
1425
|
+
"FAILED",
|
|
1426
|
+
"SKIPPED"
|
|
1427
|
+
];
|
|
1428
|
+
var runInsightStatusSchema = z17.enum(RUN_INSIGHT_STATUSES);
|
|
1429
|
+
var insightPassSchema = z17.object({
|
|
1430
|
+
status: runInsightStatusSchema,
|
|
1431
|
+
model: z17.string().nullable(),
|
|
1432
|
+
inputTokens: z17.number().int().nullable(),
|
|
1433
|
+
outputTokens: z17.number().int().nullable(),
|
|
1434
|
+
usdCost: z17.number().nullable(),
|
|
1435
|
+
error: z17.string().nullable()
|
|
1436
|
+
});
|
|
1437
|
+
var runDecisionSchema = z17.object({
|
|
1438
|
+
index: z17.number().int(),
|
|
1439
|
+
category: z17.string(),
|
|
1440
|
+
categoryRaw: z17.string().nullable(),
|
|
1441
|
+
chosenName: z17.string(),
|
|
1442
|
+
chosenEcosystem: z17.string().nullable(),
|
|
1443
|
+
chosenPackage: z17.string().nullable(),
|
|
1444
|
+
reversed: z17.boolean(),
|
|
1445
|
+
detail: z17.unknown()
|
|
1446
|
+
});
|
|
1447
|
+
var runImplementationSchema = z17.object({
|
|
1448
|
+
brandName: z17.string(),
|
|
1449
|
+
ecosystem: z17.string().nullable(),
|
|
1450
|
+
package: z17.string().nullable(),
|
|
1451
|
+
verdict: z17.string(),
|
|
1452
|
+
docConsulted: z17.boolean(),
|
|
1453
|
+
detail: z17.unknown()
|
|
1454
|
+
});
|
|
1455
|
+
var RUN_INSIGHT_PASS_KINDS = [
|
|
1456
|
+
"INSTALL",
|
|
1457
|
+
"DECISION",
|
|
1458
|
+
"EVAL",
|
|
1459
|
+
"INTEGRATION",
|
|
1460
|
+
"EXPERIMENT_DELTA",
|
|
1461
|
+
"VISIBILITY"
|
|
1462
|
+
];
|
|
1463
|
+
var runInsightPassKindSchema = z17.enum(RUN_INSIGHT_PASS_KINDS);
|
|
1464
|
+
var insightPipelinePassSchema = insightPassSchema.extend({
|
|
1465
|
+
kind: runInsightPassKindSchema
|
|
1466
|
+
});
|
|
1467
|
+
var runInsightResponseSchema = z17.object({
|
|
1468
|
+
runId: z17.string(),
|
|
1469
|
+
decision: insightPassSchema,
|
|
1470
|
+
implementation: insightPassSchema,
|
|
1471
|
+
passes: z17.array(insightPipelinePassSchema),
|
|
1472
|
+
decisions: z17.array(runDecisionSchema),
|
|
1473
|
+
implementations: z17.array(runImplementationSchema),
|
|
1474
|
+
experimentDelta: z17.unknown().nullable(),
|
|
1475
|
+
/** The VISIBILITY pass's output (winners/picks) — loose server JSON, null
|
|
1476
|
+
* for non-visibility runs or before the pass completes. */
|
|
1477
|
+
visibilityVerdict: z17.unknown().nullable()
|
|
1478
|
+
});
|
|
1479
|
+
var runEventSchema = z17.looseObject({
|
|
1480
|
+
run_id: z17.string(),
|
|
1481
|
+
seq: z17.number(),
|
|
1482
|
+
turn: z17.number(),
|
|
1483
|
+
ts: z17.string(),
|
|
1484
|
+
type: z17.string()
|
|
1485
|
+
});
|
|
1486
|
+
|
|
1487
|
+
// ../packages/api-schemas/src/runPresets.ts
|
|
1488
|
+
var SCHEDULABLE_AGENTS = [
|
|
1489
|
+
"CLAUDE_CODE",
|
|
1490
|
+
"CODEX_CLI",
|
|
1491
|
+
"PI",
|
|
1492
|
+
"OPENCODE"
|
|
1493
|
+
];
|
|
1494
|
+
var schedulableAgentSchema = z18.enum(SCHEDULABLE_AGENTS);
|
|
1495
|
+
var presetAgentSchema = z18.object({
|
|
1496
|
+
agent: agentSchema2,
|
|
1497
|
+
models: z18.array(z18.string().min(1))
|
|
1498
|
+
});
|
|
1499
|
+
var presetAgentInputSchema = z18.object({
|
|
1112
1500
|
agent: schedulableAgentSchema,
|
|
1113
|
-
models:
|
|
1501
|
+
models: z18.array(z18.string().min(1)).default([])
|
|
1114
1502
|
});
|
|
1115
|
-
var assetRefSchema =
|
|
1503
|
+
var assetRefSchema = z18.string().max(320).regex(
|
|
1116
1504
|
/^[A-Za-z0-9][A-Za-z0-9._-]*@[^\s,]+$/,
|
|
1117
1505
|
'asset references must be "name@label"'
|
|
1118
1506
|
);
|
|
@@ -1120,7 +1508,7 @@ function refAssetName(ref) {
|
|
|
1120
1508
|
const at = ref.indexOf("@");
|
|
1121
1509
|
return at < 0 ? ref : ref.slice(0, at);
|
|
1122
1510
|
}
|
|
1123
|
-
var assetRefListSchema =
|
|
1511
|
+
var assetRefListSchema = z18.array(assetRefSchema).superRefine((refs, ctx) => {
|
|
1124
1512
|
const names = /* @__PURE__ */ new Set();
|
|
1125
1513
|
for (const ref of refs) {
|
|
1126
1514
|
const name = refAssetName(ref);
|
|
@@ -1133,111 +1521,121 @@ var assetRefListSchema = z14.array(assetRefSchema).superRefine((refs, ctx) => {
|
|
|
1133
1521
|
names.add(name);
|
|
1134
1522
|
}
|
|
1135
1523
|
});
|
|
1136
|
-
var runPresetSummarySchema =
|
|
1137
|
-
id:
|
|
1138
|
-
name:
|
|
1524
|
+
var runPresetSummarySchema = z18.object({
|
|
1525
|
+
id: z18.string(),
|
|
1526
|
+
name: z18.string(),
|
|
1527
|
+
/** Lineage: true = this org's copy of a Gauge catalog preset. Editable
|
|
1528
|
+
* like any other row. Optional-defaulting-false for wire compat. */
|
|
1529
|
+
fromGauge: z18.boolean().optional().default(false),
|
|
1530
|
+
description: z18.string().nullish().default(null),
|
|
1139
1531
|
/** false = anonymous — runnable and attachable, but not library furniture. */
|
|
1140
|
-
saved:
|
|
1532
|
+
saved: z18.boolean(),
|
|
1141
1533
|
/** null = the greenfield scaffold. */
|
|
1142
|
-
repoUrl:
|
|
1143
|
-
repoRef:
|
|
1144
|
-
profile:
|
|
1145
|
-
agents:
|
|
1146
|
-
skillRefs:
|
|
1147
|
-
mcpRefs:
|
|
1534
|
+
repoUrl: z18.string().nullable(),
|
|
1535
|
+
repoRef: z18.string().nullable(),
|
|
1536
|
+
profile: z18.object({ id: z18.string(), name: z18.string() }).nullable(),
|
|
1537
|
+
agents: z18.array(presetAgentSchema),
|
|
1538
|
+
skillRefs: z18.array(z18.string()),
|
|
1539
|
+
mcpRefs: z18.array(z18.string())
|
|
1148
1540
|
});
|
|
1149
1541
|
var runPresetSchema = runPresetSummarySchema.extend({
|
|
1150
|
-
evalSets:
|
|
1151
|
-
visibilityPrompts:
|
|
1152
|
-
|
|
1542
|
+
evalSets: z18.array(z18.object({ id: z18.string(), name: z18.string() })),
|
|
1543
|
+
visibilityPrompts: z18.array(
|
|
1544
|
+
z18.object({ id: z18.string(), promptText: z18.string() })
|
|
1153
1545
|
),
|
|
1154
|
-
createdAt:
|
|
1155
|
-
updatedAt:
|
|
1546
|
+
createdAt: z18.string(),
|
|
1547
|
+
updatedAt: z18.string()
|
|
1156
1548
|
});
|
|
1157
|
-
var listRunPresetsQuerySchema =
|
|
1158
|
-
all:
|
|
1549
|
+
var listRunPresetsQuerySchema = z18.object({
|
|
1550
|
+
all: z18.enum(["1", "true", "0", "false"]).optional().transform((v) => v === "1" || v === "true")
|
|
1159
1551
|
});
|
|
1160
|
-
var listRunPresetsResponseSchema =
|
|
1161
|
-
items:
|
|
1552
|
+
var listRunPresetsResponseSchema = z18.object({
|
|
1553
|
+
items: z18.array(runPresetSchema),
|
|
1162
1554
|
/** D8 footnote: anonymous presets attached to at least one member. */
|
|
1163
|
-
anonymousInUse:
|
|
1555
|
+
anonymousInUse: z18.number().int()
|
|
1164
1556
|
});
|
|
1165
1557
|
var presetConfigInput = {
|
|
1166
1558
|
/** Omit/null = the greenfield scaffold. */
|
|
1167
|
-
repoUrl:
|
|
1168
|
-
repoRef:
|
|
1559
|
+
repoUrl: z18.string().nullish(),
|
|
1560
|
+
repoRef: z18.string().nullish(),
|
|
1169
1561
|
/** Persona id; must belong to the org. null = the default judge. */
|
|
1170
|
-
profileId:
|
|
1171
|
-
agents:
|
|
1562
|
+
profileId: z18.string().nullish(),
|
|
1563
|
+
agents: z18.array(presetAgentInputSchema).min(1, "Select at least one agent"),
|
|
1172
1564
|
skillRefs: assetRefListSchema.default([]),
|
|
1173
1565
|
mcpRefs: assetRefListSchema.default([])
|
|
1174
1566
|
};
|
|
1175
|
-
var createRunPresetBodySchema =
|
|
1176
|
-
name:
|
|
1177
|
-
saved:
|
|
1567
|
+
var createRunPresetBodySchema = z18.object({
|
|
1568
|
+
name: z18.string().min(1).max(120).optional(),
|
|
1569
|
+
saved: z18.boolean().default(true),
|
|
1178
1570
|
...presetConfigInput
|
|
1179
1571
|
}).refine((body) => !body.saved || body.name !== void 0, {
|
|
1180
1572
|
message: "name is required for a saved preset",
|
|
1181
1573
|
path: ["name"]
|
|
1182
1574
|
});
|
|
1183
|
-
var updateRunPresetBodySchema =
|
|
1184
|
-
name:
|
|
1185
|
-
repoUrl:
|
|
1186
|
-
repoRef:
|
|
1187
|
-
profileId:
|
|
1188
|
-
agents:
|
|
1575
|
+
var updateRunPresetBodySchema = z18.object({
|
|
1576
|
+
name: z18.string().min(1).max(120).optional(),
|
|
1577
|
+
repoUrl: z18.string().nullish(),
|
|
1578
|
+
repoRef: z18.string().nullish(),
|
|
1579
|
+
profileId: z18.string().nullish(),
|
|
1580
|
+
agents: z18.array(presetAgentInputSchema).min(1).optional(),
|
|
1189
1581
|
skillRefs: assetRefListSchema.optional(),
|
|
1190
1582
|
mcpRefs: assetRefListSchema.optional()
|
|
1191
1583
|
});
|
|
1192
|
-
var promoteRunPresetBodySchema =
|
|
1193
|
-
name:
|
|
1584
|
+
var promoteRunPresetBodySchema = z18.object({
|
|
1585
|
+
name: z18.string().min(1).max(120).optional()
|
|
1194
1586
|
});
|
|
1195
|
-
var promoteRunPresetResponseSchema =
|
|
1196
|
-
id:
|
|
1197
|
-
name:
|
|
1198
|
-
saved:
|
|
1587
|
+
var promoteRunPresetResponseSchema = z18.object({
|
|
1588
|
+
id: z18.string(),
|
|
1589
|
+
name: z18.string(),
|
|
1590
|
+
saved: z18.boolean()
|
|
1199
1591
|
});
|
|
1200
|
-
var deleteRunPresetResponseSchema =
|
|
1201
|
-
detachedEvalSets:
|
|
1202
|
-
detachedVisibilityPrompts:
|
|
1203
|
-
referencedBatches:
|
|
1204
|
-
referencedRuns:
|
|
1592
|
+
var deleteRunPresetResponseSchema = z18.object({
|
|
1593
|
+
detachedEvalSets: z18.number().int(),
|
|
1594
|
+
detachedVisibilityPrompts: z18.number().int(),
|
|
1595
|
+
referencedBatches: z18.number().int(),
|
|
1596
|
+
referencedRuns: z18.number().int()
|
|
1205
1597
|
});
|
|
1206
|
-
var runPresetRunSchema =
|
|
1207
|
-
runId:
|
|
1208
|
-
agent:
|
|
1209
|
-
turns:
|
|
1210
|
-
durationMs:
|
|
1211
|
-
costUsd:
|
|
1212
|
-
finishedAt:
|
|
1598
|
+
var runPresetRunSchema = z18.object({
|
|
1599
|
+
runId: z18.string(),
|
|
1600
|
+
agent: agentSchema2,
|
|
1601
|
+
turns: z18.number().int().nullable(),
|
|
1602
|
+
durationMs: z18.number().int().nullable(),
|
|
1603
|
+
costUsd: z18.number().nullable(),
|
|
1604
|
+
finishedAt: z18.string().nullable(),
|
|
1213
1605
|
/** The attached eval / preference prompt the batch ran, by name. */
|
|
1214
|
-
sourceLabel:
|
|
1606
|
+
sourceLabel: z18.string().nullable()
|
|
1215
1607
|
});
|
|
1216
|
-
var listRunPresetRunsResponseSchema =
|
|
1217
|
-
items:
|
|
1608
|
+
var listRunPresetRunsResponseSchema = z18.object({
|
|
1609
|
+
items: z18.array(runPresetRunSchema)
|
|
1218
1610
|
});
|
|
1219
|
-
var inlinePresetSchema =
|
|
1611
|
+
var inlinePresetSchema = z18.object({
|
|
1220
1612
|
/** Omitted derives from the repo ("Default" for greenfield). */
|
|
1221
|
-
presetName:
|
|
1613
|
+
presetName: z18.string().min(1).max(120).optional(),
|
|
1222
1614
|
...presetConfigInput
|
|
1223
1615
|
});
|
|
1224
|
-
var attachPresetBodySchema =
|
|
1225
|
-
runPresetId:
|
|
1616
|
+
var attachPresetBodySchema = z18.object({
|
|
1617
|
+
runPresetId: z18.string().min(1).optional(),
|
|
1226
1618
|
newPreset: inlinePresetSchema.optional()
|
|
1227
1619
|
}).refine(
|
|
1228
1620
|
(body) => body.runPresetId !== void 0 !== (body.newPreset !== void 0),
|
|
1229
1621
|
{ message: "pass exactly one of runPresetId or newPreset" }
|
|
1230
1622
|
);
|
|
1231
|
-
var listMemberPresetsResponseSchema =
|
|
1232
|
-
items:
|
|
1233
|
-
});
|
|
1234
|
-
var runMemberBodySchema =
|
|
1235
|
-
runPresetIds:
|
|
1236
|
-
oneOff:
|
|
1237
|
-
repoUrl:
|
|
1238
|
-
repoRef:
|
|
1239
|
-
profileId:
|
|
1240
|
-
agents:
|
|
1623
|
+
var listMemberPresetsResponseSchema = z18.object({
|
|
1624
|
+
items: z18.array(runPresetSummarySchema)
|
|
1625
|
+
});
|
|
1626
|
+
var runMemberBodySchema = z18.object({
|
|
1627
|
+
runPresetIds: z18.array(z18.string().min(1)).optional(),
|
|
1628
|
+
oneOff: z18.object({
|
|
1629
|
+
repoUrl: z18.string().nullish(),
|
|
1630
|
+
repoRef: z18.string().nullish(),
|
|
1631
|
+
profileId: z18.string().nullish(),
|
|
1632
|
+
agents: z18.array(presetAgentInputSchema).min(1, "Select at least one agent"),
|
|
1633
|
+
skillRefs: assetRefListSchema.optional(),
|
|
1634
|
+
mcpRefs: assetRefListSchema.optional(),
|
|
1635
|
+
connectionIds: z18.array(z18.string().min(1)).max(32).optional(),
|
|
1636
|
+
/** Filled = save the config as a library preset under this name
|
|
1637
|
+
* (still not attached). */
|
|
1638
|
+
saveAsPresetName: z18.string().trim().max(120).optional()
|
|
1241
1639
|
}).optional()
|
|
1242
1640
|
}).refine(
|
|
1243
1641
|
(body) => body.runPresetIds === void 0 || body.runPresetIds.length > 0 || body.oneOff !== void 0,
|
|
@@ -1262,127 +1660,186 @@ function totalRunsPerCycle(presets, samplesPerCycle) {
|
|
|
1262
1660
|
}
|
|
1263
1661
|
|
|
1264
1662
|
// ../packages/api-schemas/src/evals.ts
|
|
1265
|
-
var criterionSchema =
|
|
1266
|
-
id:
|
|
1267
|
-
name:
|
|
1268
|
-
rubric:
|
|
1269
|
-
position:
|
|
1663
|
+
var criterionSchema = z19.object({
|
|
1664
|
+
id: z19.string(),
|
|
1665
|
+
name: z19.string(),
|
|
1666
|
+
rubric: z19.string(),
|
|
1667
|
+
position: z19.number().int()
|
|
1270
1668
|
});
|
|
1271
|
-
var criterionInputSchema =
|
|
1669
|
+
var criterionInputSchema = z19.object({
|
|
1272
1670
|
/** Present = update in place; absent = create. */
|
|
1273
|
-
id:
|
|
1671
|
+
id: z19.string().optional(),
|
|
1274
1672
|
/** Label only; omit and the server derives it from the rubric. */
|
|
1275
|
-
name:
|
|
1276
|
-
rubric:
|
|
1673
|
+
name: z19.string().min(1).optional(),
|
|
1674
|
+
rubric: z19.string().min(1)
|
|
1277
1675
|
});
|
|
1278
|
-
var evalSetSchema =
|
|
1279
|
-
id:
|
|
1280
|
-
name:
|
|
1281
|
-
promptText:
|
|
1676
|
+
var evalSetSchema = z19.object({
|
|
1677
|
+
id: z19.string(),
|
|
1678
|
+
name: z19.string(),
|
|
1679
|
+
promptText: z19.string(),
|
|
1282
1680
|
/** null = the greenfield scaffold. */
|
|
1283
|
-
repoUrl:
|
|
1284
|
-
repoRef:
|
|
1681
|
+
repoUrl: z19.string().nullable(),
|
|
1682
|
+
repoRef: z19.string().nullable(),
|
|
1285
1683
|
/** Persona judging the runs; null = the default judge. */
|
|
1286
|
-
profile:
|
|
1287
|
-
enabled:
|
|
1288
|
-
createdAt:
|
|
1684
|
+
profile: z19.object({ id: z19.string(), name: z19.string() }).nullable(),
|
|
1685
|
+
enabled: z19.boolean(),
|
|
1686
|
+
createdAt: z19.string(),
|
|
1289
1687
|
cycle: cycleSchema,
|
|
1290
|
-
criteria:
|
|
1688
|
+
criteria: z19.array(criterionSchema),
|
|
1291
1689
|
/** User tag names on the hidden backing prompt (Surface:* excluded). */
|
|
1292
|
-
tags:
|
|
1690
|
+
tags: z19.array(z19.string()),
|
|
1293
1691
|
/** ALL attached presets in expansion order — every one runs each cycle.
|
|
1294
1692
|
* The flattened repoUrl/repoRef/profile above mirror the primary
|
|
1295
1693
|
* (lowest-position) attachment only. */
|
|
1296
|
-
runPresets:
|
|
1694
|
+
runPresets: z19.array(runPresetSummarySchema)
|
|
1297
1695
|
});
|
|
1298
|
-
var agentPassRateSchema =
|
|
1299
|
-
agent:
|
|
1300
|
-
model:
|
|
1301
|
-
runId:
|
|
1302
|
-
finishedAt:
|
|
1303
|
-
passed:
|
|
1304
|
-
total:
|
|
1305
|
-
});
|
|
1306
|
-
var evalSetStatSchema =
|
|
1307
|
-
passRates:
|
|
1308
|
-
runCount:
|
|
1696
|
+
var agentPassRateSchema = z19.object({
|
|
1697
|
+
agent: agentSchema2,
|
|
1698
|
+
model: z19.string(),
|
|
1699
|
+
runId: z19.string(),
|
|
1700
|
+
finishedAt: z19.string().nullable(),
|
|
1701
|
+
passed: z19.number().int(),
|
|
1702
|
+
total: z19.number().int()
|
|
1703
|
+
});
|
|
1704
|
+
var evalSetStatSchema = z19.object({
|
|
1705
|
+
passRates: z19.array(agentPassRateSchema),
|
|
1706
|
+
runCount: z19.number().int(),
|
|
1309
1707
|
/** Run-level aggregate: a run passes only when every criterion passed. */
|
|
1310
|
-
judgedRuns:
|
|
1311
|
-
passedRuns:
|
|
1708
|
+
judgedRuns: z19.number().int(),
|
|
1709
|
+
passedRuns: z19.number().int()
|
|
1312
1710
|
});
|
|
1313
|
-
var csv2 =
|
|
1711
|
+
var csv2 = z19.string().transform(
|
|
1314
1712
|
(s) => s.split(",").map((x) => x.trim()).filter(Boolean)
|
|
1315
1713
|
);
|
|
1316
|
-
var listEvalSetsQuerySchema =
|
|
1317
|
-
agents: csv2.pipe(
|
|
1714
|
+
var listEvalSetsQuerySchema = z19.object({
|
|
1715
|
+
agents: csv2.pipe(z19.array(agentSchema2)).optional(),
|
|
1318
1716
|
models: csv2.optional(),
|
|
1319
|
-
since:
|
|
1717
|
+
since: z19.coerce.date().optional()
|
|
1320
1718
|
});
|
|
1321
1719
|
var evalSetListItemSchema = evalSetSchema.extend({
|
|
1322
1720
|
stats: evalSetStatSchema
|
|
1323
1721
|
});
|
|
1324
|
-
var listEvalSetsResponseSchema =
|
|
1325
|
-
items:
|
|
1722
|
+
var listEvalSetsResponseSchema = z19.object({
|
|
1723
|
+
items: z19.array(evalSetListItemSchema)
|
|
1326
1724
|
});
|
|
1327
|
-
var createEvalSetBodySchema =
|
|
1328
|
-
name:
|
|
1329
|
-
promptText:
|
|
1725
|
+
var createEvalSetBodySchema = z19.object({
|
|
1726
|
+
name: z19.string().min(1),
|
|
1727
|
+
promptText: z19.string().min(1),
|
|
1330
1728
|
/** Omit/null = the greenfield scaffold. */
|
|
1331
|
-
repoUrl:
|
|
1332
|
-
repoRef:
|
|
1729
|
+
repoUrl: z19.string().nullish(),
|
|
1730
|
+
repoRef: z19.string().nullish(),
|
|
1333
1731
|
/** Persona id; must belong to the org. */
|
|
1334
|
-
profileId:
|
|
1335
|
-
criteria:
|
|
1336
|
-
enabled:
|
|
1732
|
+
profileId: z19.string().nullish(),
|
|
1733
|
+
criteria: z19.array(criterionInputSchema).min(1),
|
|
1734
|
+
enabled: z19.boolean().optional(),
|
|
1337
1735
|
/** User tag names, create-on-type (Surface:* rejected/dropped). */
|
|
1338
|
-
tags:
|
|
1736
|
+
tags: z19.array(z19.string()).optional(),
|
|
1339
1737
|
/** Attach these existing presets, in order. When either preset field is
|
|
1340
1738
|
* present the repo/persona fields above are ignored for configuration —
|
|
1341
1739
|
* presets are explicit and authoritative (D2). */
|
|
1342
|
-
runPresetIds:
|
|
1740
|
+
runPresetIds: z19.array(z19.string().min(1)).optional(),
|
|
1343
1741
|
/** Mint a saved preset and attach it (after runPresetIds). */
|
|
1344
1742
|
newPreset: inlinePresetSchema.optional()
|
|
1345
1743
|
});
|
|
1346
|
-
var updateEvalSetBodySchema =
|
|
1347
|
-
name:
|
|
1348
|
-
promptText:
|
|
1349
|
-
repoUrl:
|
|
1350
|
-
repoRef:
|
|
1351
|
-
profileId:
|
|
1352
|
-
criteria:
|
|
1353
|
-
enabled:
|
|
1354
|
-
tags:
|
|
1355
|
-
});
|
|
1356
|
-
var runEvalSetResponseSchema =
|
|
1357
|
-
batchIds:
|
|
1358
|
-
runIds:
|
|
1359
|
-
});
|
|
1360
|
-
var evalSetRunSchema =
|
|
1361
|
-
id:
|
|
1362
|
-
status:
|
|
1363
|
-
agent:
|
|
1364
|
-
model:
|
|
1365
|
-
resolvedModel:
|
|
1366
|
-
createdAt:
|
|
1367
|
-
startedAt:
|
|
1368
|
-
finishedAt:
|
|
1369
|
-
failureReason:
|
|
1370
|
-
judge:
|
|
1371
|
-
criterionResults:
|
|
1372
|
-
|
|
1373
|
-
criterionId:
|
|
1374
|
-
name:
|
|
1375
|
-
passed:
|
|
1376
|
-
reasoning:
|
|
1744
|
+
var updateEvalSetBodySchema = z19.object({
|
|
1745
|
+
name: z19.string().min(1).optional(),
|
|
1746
|
+
promptText: z19.string().min(1).optional(),
|
|
1747
|
+
repoUrl: z19.string().nullish(),
|
|
1748
|
+
repoRef: z19.string().nullish(),
|
|
1749
|
+
profileId: z19.string().nullish(),
|
|
1750
|
+
criteria: z19.array(criterionInputSchema).min(1).optional(),
|
|
1751
|
+
enabled: z19.boolean().optional(),
|
|
1752
|
+
tags: z19.array(z19.string()).optional()
|
|
1753
|
+
});
|
|
1754
|
+
var runEvalSetResponseSchema = z19.object({
|
|
1755
|
+
batchIds: z19.array(z19.string()),
|
|
1756
|
+
runIds: z19.array(z19.string())
|
|
1757
|
+
});
|
|
1758
|
+
var evalSetRunSchema = z19.object({
|
|
1759
|
+
id: z19.string(),
|
|
1760
|
+
status: z19.string(),
|
|
1761
|
+
agent: agentSchema2,
|
|
1762
|
+
model: z19.string().nullable(),
|
|
1763
|
+
resolvedModel: z19.string().nullable(),
|
|
1764
|
+
createdAt: z19.string(),
|
|
1765
|
+
startedAt: z19.string().nullable(),
|
|
1766
|
+
finishedAt: z19.string().nullable(),
|
|
1767
|
+
failureReason: z19.string().nullable(),
|
|
1768
|
+
judge: z19.object({ status: z19.string(), error: z19.string().nullable() }).nullable(),
|
|
1769
|
+
criterionResults: z19.array(
|
|
1770
|
+
z19.object({
|
|
1771
|
+
criterionId: z19.string().nullable(),
|
|
1772
|
+
name: z19.string(),
|
|
1773
|
+
passed: z19.boolean(),
|
|
1774
|
+
reasoning: z19.string().nullable()
|
|
1377
1775
|
})
|
|
1378
1776
|
)
|
|
1379
1777
|
});
|
|
1380
|
-
var listEvalSetRunsResponseSchema =
|
|
1381
|
-
items:
|
|
1778
|
+
var listEvalSetRunsResponseSchema = z19.object({
|
|
1779
|
+
items: z19.array(evalSetRunSchema)
|
|
1780
|
+
});
|
|
1781
|
+
|
|
1782
|
+
// ../packages/api-schemas/src/executionTargets.ts
|
|
1783
|
+
import { z as z20 } from "zod";
|
|
1784
|
+
var executionTargetCapabilitiesSchema = z20.object({
|
|
1785
|
+
skills: z20.boolean(),
|
|
1786
|
+
mcp: z20.boolean(),
|
|
1787
|
+
connections: z20.boolean(),
|
|
1788
|
+
agentContext: z20.boolean(),
|
|
1789
|
+
resume: z20.boolean()
|
|
1790
|
+
});
|
|
1791
|
+
var executionTargetSchema = z20.object({
|
|
1792
|
+
harness: agentSchema2,
|
|
1793
|
+
harnessSlug: z20.string(),
|
|
1794
|
+
harnessLabel: z20.string(),
|
|
1795
|
+
model: z20.string(),
|
|
1796
|
+
modelLabel: z20.string(),
|
|
1797
|
+
providerSlug: z20.string(),
|
|
1798
|
+
providerLabel: z20.string(),
|
|
1799
|
+
capabilities: executionTargetCapabilitiesSchema
|
|
1800
|
+
});
|
|
1801
|
+
var executionTargetsResponseSchema = z20.object({
|
|
1802
|
+
items: z20.array(executionTargetSchema)
|
|
1382
1803
|
});
|
|
1383
1804
|
|
|
1384
1805
|
// ../packages/api-schemas/src/experiments.ts
|
|
1385
|
-
|
|
1806
|
+
var experiments_exports = {};
|
|
1807
|
+
__export(experiments_exports, {
|
|
1808
|
+
EXPERIMENT_MODES: () => EXPERIMENT_MODES,
|
|
1809
|
+
EXPERIMENT_STATUSES: () => EXPERIMENT_STATUSES,
|
|
1810
|
+
SUPPORT_CLASSES: () => SUPPORT_CLASSES,
|
|
1811
|
+
TERMINAL_EXPERIMENT_STATUSES: () => TERMINAL_EXPERIMENT_STATUSES,
|
|
1812
|
+
addVariantBodySchema: () => addVariantBodySchema,
|
|
1813
|
+
cancelResponseSchema: () => cancelResponseSchema,
|
|
1814
|
+
createExperimentBodyFields: () => createExperimentBodyFields,
|
|
1815
|
+
createExperimentBodySchema: () => createExperimentBodySchema,
|
|
1816
|
+
createExperimentResponseSchema: () => createExperimentResponseSchema,
|
|
1817
|
+
eligibleExperimentRunSchema: () => eligibleExperimentRunSchema,
|
|
1818
|
+
experimentBoundarySchema: () => experimentBoundarySchema,
|
|
1819
|
+
experimentContentQuerySchema: () => experimentContentQuerySchema,
|
|
1820
|
+
experimentContentResponseSchema: () => experimentContentResponseSchema,
|
|
1821
|
+
experimentDetailSchema: () => experimentDetailSchema,
|
|
1822
|
+
experimentListQuerySchema: () => experimentListQuerySchema,
|
|
1823
|
+
experimentListResponseSchema: () => experimentListResponseSchema,
|
|
1824
|
+
experimentModeSchema: () => experimentModeSchema,
|
|
1825
|
+
experimentStatusResponseSchema: () => experimentStatusResponseSchema,
|
|
1826
|
+
experimentStatusSchema: () => experimentStatusSchema,
|
|
1827
|
+
experimentSummarySchema: () => experimentSummarySchema,
|
|
1828
|
+
experimentVariantSchema: () => experimentVariantSchema,
|
|
1829
|
+
fixerEditSchema: () => fixerEditSchema,
|
|
1830
|
+
launchResultSchema: () => launchResultSchema,
|
|
1831
|
+
patchVariantBodySchema: () => patchVariantBodySchema,
|
|
1832
|
+
recommendationSchema: () => recommendationSchema,
|
|
1833
|
+
shipBodySchema: () => shipBodySchema,
|
|
1834
|
+
supportClassSchema: () => supportClassSchema,
|
|
1835
|
+
variantDeltaSchema: () => variantDeltaSchema,
|
|
1836
|
+
variantRefSchema: () => variantRefSchema,
|
|
1837
|
+
variantRunSchema: () => variantRunSchema,
|
|
1838
|
+
writeRoundResponseSchema: () => writeRoundResponseSchema,
|
|
1839
|
+
writeVariantContentBodySchema: () => writeVariantContentBodySchema,
|
|
1840
|
+
writeVariantContentResponseSchema: () => writeVariantContentResponseSchema
|
|
1841
|
+
});
|
|
1842
|
+
import { z as z21 } from "zod";
|
|
1386
1843
|
var EXPERIMENT_STATUSES = [
|
|
1387
1844
|
"DRAFT",
|
|
1388
1845
|
"GENERATING",
|
|
@@ -1394,227 +1851,257 @@ var EXPERIMENT_STATUSES = [
|
|
|
1394
1851
|
"FAILED",
|
|
1395
1852
|
"CANCELED"
|
|
1396
1853
|
];
|
|
1397
|
-
var experimentStatusSchema =
|
|
1854
|
+
var experimentStatusSchema = z21.enum(EXPERIMENT_STATUSES);
|
|
1855
|
+
var TERMINAL_EXPERIMENT_STATUSES = [
|
|
1856
|
+
"COMPLETE",
|
|
1857
|
+
"PARTIAL",
|
|
1858
|
+
"FAILED",
|
|
1859
|
+
"CANCELED"
|
|
1860
|
+
];
|
|
1398
1861
|
var SUPPORT_CLASSES = [
|
|
1399
1862
|
"RECOMMENDED",
|
|
1400
1863
|
"PROMISING",
|
|
1401
1864
|
"NOT_SUPPORTED",
|
|
1402
1865
|
"NOT_EVALUABLE"
|
|
1403
1866
|
];
|
|
1404
|
-
var supportClassSchema =
|
|
1405
|
-
var jsonValue =
|
|
1406
|
-
var
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1867
|
+
var supportClassSchema = z21.enum(SUPPORT_CLASSES);
|
|
1868
|
+
var jsonValue = z21.unknown();
|
|
1869
|
+
var EXPERIMENT_MODES = ["PROPOSE", "DIRECT", "MANUAL"];
|
|
1870
|
+
var experimentModeSchema = z21.enum(EXPERIMENT_MODES);
|
|
1871
|
+
var createExperimentBodyFields = z21.object({
|
|
1872
|
+
runId: z21.string().min(1),
|
|
1873
|
+
boundarySeq: z21.string().min(1),
|
|
1874
|
+
problemText: z21.string().trim().min(1).optional(),
|
|
1875
|
+
/** OPTIONAL, and it stays optional: a CLI built before the bifurcation must
|
|
1876
|
+
* keep working, and omitting it means PROPOSE — the behaviour it already
|
|
1877
|
+
* expects. */
|
|
1878
|
+
mode: experimentModeSchema.optional(),
|
|
1879
|
+
/** DIRECT only: the one change to make, in the author's own words. Ignored
|
|
1880
|
+
* in the other modes. Carried as the single rewrite's title, and REQUIRED
|
|
1881
|
+
* when `mode` is DIRECT — see the cross-field check below. */
|
|
1882
|
+
changeInstruction: z21.string().trim().min(1).max(200).optional()
|
|
1883
|
+
});
|
|
1884
|
+
var createExperimentBodySchema = createExperimentBodyFields.superRefine((body, ctx) => {
|
|
1885
|
+
if (body.mode === "DIRECT" && !body.changeInstruction) {
|
|
1886
|
+
ctx.addIssue({
|
|
1887
|
+
code: "custom",
|
|
1888
|
+
path: ["changeInstruction"],
|
|
1889
|
+
message: "mode DIRECT requires changeInstruction \u2014 the one change to make, in your own words"
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
var createExperimentResponseSchema = z21.object({
|
|
1894
|
+
experimentId: z21.string(),
|
|
1413
1895
|
/** false = an existing draft for this (run, boundary) was resumed. */
|
|
1414
|
-
created:
|
|
1896
|
+
created: z21.boolean(),
|
|
1415
1897
|
/** What is persisted — a resume keeps the statement it was opened with. */
|
|
1416
|
-
problemText:
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1898
|
+
problemText: z21.string(),
|
|
1899
|
+
/** The PERSISTED mode, echoed for the same reason `problemText` is: exactly
|
|
1900
|
+
* one live draft exists per (run, boundary), so a resume returns the mode
|
|
1901
|
+
* that draft was opened with — which may not be the one this call asked
|
|
1902
|
+
* for. Clients report what came back, not what they sent. */
|
|
1903
|
+
mode: experimentModeSchema
|
|
1904
|
+
});
|
|
1905
|
+
var experimentListQuerySchema = z21.object({
|
|
1906
|
+
status: z21.string().transform(
|
|
1420
1907
|
(s) => s.split(",").map((x) => x.trim().toUpperCase()).filter(Boolean)
|
|
1421
|
-
).pipe(
|
|
1422
|
-
limit:
|
|
1908
|
+
).pipe(z21.array(experimentStatusSchema)).optional(),
|
|
1909
|
+
limit: z21.coerce.number().int().min(1).max(100).default(25)
|
|
1423
1910
|
});
|
|
1424
|
-
var experimentSummarySchema =
|
|
1425
|
-
id:
|
|
1911
|
+
var experimentSummarySchema = z21.object({
|
|
1912
|
+
id: z21.string(),
|
|
1426
1913
|
status: experimentStatusSchema,
|
|
1427
|
-
problem:
|
|
1428
|
-
boundaryUrl:
|
|
1429
|
-
sourceRunId:
|
|
1430
|
-
variantCount:
|
|
1431
|
-
createdAt:
|
|
1914
|
+
problem: z21.string(),
|
|
1915
|
+
boundaryUrl: z21.string().nullable(),
|
|
1916
|
+
sourceRunId: z21.string(),
|
|
1917
|
+
variantCount: z21.number().int(),
|
|
1918
|
+
createdAt: z21.string()
|
|
1432
1919
|
});
|
|
1433
|
-
var experimentListResponseSchema =
|
|
1434
|
-
items:
|
|
1920
|
+
var experimentListResponseSchema = z21.object({
|
|
1921
|
+
items: z21.array(experimentSummarySchema)
|
|
1435
1922
|
});
|
|
1436
|
-
var eligibleExperimentRunSchema =
|
|
1437
|
-
runId:
|
|
1438
|
-
agent:
|
|
1439
|
-
promptText:
|
|
1440
|
-
createdAt:
|
|
1441
|
-
verdict:
|
|
1442
|
-
boundaryCount:
|
|
1443
|
-
});
|
|
1444
|
-
var experimentBoundarySchema =
|
|
1445
|
-
boundarySeq:
|
|
1446
|
-
turn:
|
|
1447
|
-
url:
|
|
1448
|
-
domain:
|
|
1449
|
-
fetchPrompt:
|
|
1450
|
-
source:
|
|
1451
|
-
boundaryCheckpointId:
|
|
1452
|
-
boundaryOrdinal:
|
|
1453
|
-
capturedOccurrence:
|
|
1454
|
-
});
|
|
1455
|
-
var variantRunSchema =
|
|
1456
|
-
runId:
|
|
1457
|
-
status:
|
|
1458
|
-
failureReason:
|
|
1459
|
-
integrations:
|
|
1460
|
-
});
|
|
1461
|
-
var experimentVariantSchema =
|
|
1462
|
-
variantId:
|
|
1463
|
-
key:
|
|
1464
|
-
title:
|
|
1465
|
-
hypothesis:
|
|
1466
|
-
rewriteChars:
|
|
1467
|
-
hasRewrite:
|
|
1468
|
-
invalidReason:
|
|
1469
|
-
planStatus:
|
|
1470
|
-
planError:
|
|
1471
|
-
runs:
|
|
1923
|
+
var eligibleExperimentRunSchema = z21.object({
|
|
1924
|
+
runId: z21.string(),
|
|
1925
|
+
agent: agentSchema2,
|
|
1926
|
+
promptText: z21.string(),
|
|
1927
|
+
createdAt: z21.string(),
|
|
1928
|
+
verdict: z21.string().nullable(),
|
|
1929
|
+
boundaryCount: z21.number().int()
|
|
1930
|
+
});
|
|
1931
|
+
var experimentBoundarySchema = z21.object({
|
|
1932
|
+
boundarySeq: z21.union([z21.string(), z21.number()]),
|
|
1933
|
+
turn: z21.number().int().nullable(),
|
|
1934
|
+
url: z21.string(),
|
|
1935
|
+
domain: z21.string().nullable(),
|
|
1936
|
+
fetchPrompt: z21.string().nullable(),
|
|
1937
|
+
source: z21.string(),
|
|
1938
|
+
boundaryCheckpointId: z21.string().nullable(),
|
|
1939
|
+
boundaryOrdinal: z21.number().int().nullable(),
|
|
1940
|
+
capturedOccurrence: z21.number().int().nullable()
|
|
1941
|
+
});
|
|
1942
|
+
var variantRunSchema = z21.object({
|
|
1943
|
+
runId: z21.string(),
|
|
1944
|
+
status: z21.string(),
|
|
1945
|
+
failureReason: z21.string().nullable(),
|
|
1946
|
+
integrations: z21.array(jsonValue)
|
|
1947
|
+
});
|
|
1948
|
+
var experimentVariantSchema = z21.object({
|
|
1949
|
+
variantId: z21.string(),
|
|
1950
|
+
key: z21.string(),
|
|
1951
|
+
title: z21.string(),
|
|
1952
|
+
hypothesis: z21.string(),
|
|
1953
|
+
rewriteChars: z21.number().int(),
|
|
1954
|
+
hasRewrite: z21.boolean(),
|
|
1955
|
+
invalidReason: z21.string().nullable(),
|
|
1956
|
+
planStatus: z21.string().nullable(),
|
|
1957
|
+
planError: z21.string().nullable(),
|
|
1958
|
+
runs: z21.array(variantRunSchema),
|
|
1472
1959
|
/** Arm verdict / finding counts / EXPERIMENT_DELTA output — server-owned
|
|
1473
1960
|
* analytic JSON, null until computable. */
|
|
1474
1961
|
verdict: jsonValue.nullable(),
|
|
1475
1962
|
findings: jsonValue.nullable(),
|
|
1476
1963
|
delta: jsonValue.nullable()
|
|
1477
1964
|
});
|
|
1478
|
-
var experimentDetailSchema =
|
|
1479
|
-
id:
|
|
1965
|
+
var experimentDetailSchema = z21.object({
|
|
1966
|
+
id: z21.string(),
|
|
1480
1967
|
status: experimentStatusSchema,
|
|
1481
|
-
problem:
|
|
1482
|
-
boundaryUrl:
|
|
1483
|
-
createdAt:
|
|
1484
|
-
editable:
|
|
1485
|
-
roundInFlight:
|
|
1486
|
-
launching:
|
|
1487
|
-
launchError:
|
|
1488
|
-
planned:
|
|
1968
|
+
problem: z21.string(),
|
|
1969
|
+
boundaryUrl: z21.string().nullable(),
|
|
1970
|
+
createdAt: z21.string(),
|
|
1971
|
+
editable: z21.boolean(),
|
|
1972
|
+
roundInFlight: z21.boolean(),
|
|
1973
|
+
launching: z21.boolean(),
|
|
1974
|
+
launchError: z21.string().nullable(),
|
|
1975
|
+
planned: z21.boolean(),
|
|
1489
1976
|
livePage: jsonValue.nullable(),
|
|
1490
|
-
sourceRun:
|
|
1491
|
-
runId:
|
|
1492
|
-
agent:
|
|
1493
|
-
status:
|
|
1494
|
-
task:
|
|
1495
|
-
repoUrl:
|
|
1977
|
+
sourceRun: z21.object({
|
|
1978
|
+
runId: z21.string(),
|
|
1979
|
+
agent: agentSchema2,
|
|
1980
|
+
status: z21.string(),
|
|
1981
|
+
task: z21.string(),
|
|
1982
|
+
repoUrl: z21.string().nullable(),
|
|
1496
1983
|
verdict: jsonValue.nullable(),
|
|
1497
|
-
integrations:
|
|
1984
|
+
integrations: z21.array(jsonValue)
|
|
1498
1985
|
}),
|
|
1499
|
-
variants:
|
|
1986
|
+
variants: z21.array(experimentVariantSchema),
|
|
1500
1987
|
/** The settled comparison (winners vs baseline) — null until launched. */
|
|
1501
1988
|
summary: jsonValue.nullable()
|
|
1502
1989
|
});
|
|
1503
|
-
var experimentStatusResponseSchema =
|
|
1504
|
-
id:
|
|
1990
|
+
var experimentStatusResponseSchema = z21.object({
|
|
1991
|
+
id: z21.string(),
|
|
1505
1992
|
status: experimentStatusSchema,
|
|
1506
|
-
planned:
|
|
1507
|
-
writeStartedAt:
|
|
1508
|
-
launchStartedAt:
|
|
1509
|
-
launchError:
|
|
1510
|
-
shippedVariantId:
|
|
1511
|
-
shippedAt:
|
|
1512
|
-
});
|
|
1513
|
-
var addVariantBodySchema =
|
|
1514
|
-
title:
|
|
1515
|
-
hypothesis:
|
|
1516
|
-
});
|
|
1517
|
-
var patchVariantBodySchema =
|
|
1518
|
-
title:
|
|
1519
|
-
hypothesis:
|
|
1520
|
-
});
|
|
1521
|
-
var fixerEditSchema =
|
|
1522
|
-
find:
|
|
1523
|
-
replace:
|
|
1524
|
-
});
|
|
1525
|
-
var writeVariantContentBodySchema =
|
|
1526
|
-
content:
|
|
1527
|
-
edits:
|
|
1528
|
-
});
|
|
1529
|
-
var writeVariantContentResponseSchema =
|
|
1530
|
-
variantId:
|
|
1531
|
-
chars:
|
|
1532
|
-
truncated:
|
|
1533
|
-
applied:
|
|
1534
|
-
skipped:
|
|
1535
|
-
});
|
|
1536
|
-
var experimentContentQuerySchema =
|
|
1537
|
-
variantId:
|
|
1538
|
-
offset:
|
|
1539
|
-
maxChars:
|
|
1540
|
-
});
|
|
1541
|
-
var experimentContentResponseSchema =
|
|
1542
|
-
source:
|
|
1543
|
-
totalChars:
|
|
1544
|
-
offset:
|
|
1545
|
-
returnedChars:
|
|
1546
|
-
nextOffset:
|
|
1547
|
-
content:
|
|
1548
|
-
});
|
|
1549
|
-
var writeRoundResponseSchema =
|
|
1550
|
-
queued:
|
|
1551
|
-
reason:
|
|
1552
|
-
});
|
|
1553
|
-
var launchResultSchema =
|
|
1554
|
-
experimentId:
|
|
1555
|
-
status:
|
|
1556
|
-
});
|
|
1557
|
-
var shipBodySchema =
|
|
1558
|
-
var cancelResponseSchema =
|
|
1559
|
-
id:
|
|
1560
|
-
status:
|
|
1561
|
-
});
|
|
1562
|
-
var variantDeltaSchema =
|
|
1563
|
-
changed:
|
|
1564
|
-
hypothesisSupported:
|
|
1565
|
-
summary:
|
|
1566
|
-
});
|
|
1567
|
-
var variantRefSchema =
|
|
1568
|
-
key:
|
|
1569
|
-
title:
|
|
1570
|
-
effect:
|
|
1571
|
-
consistency:
|
|
1572
|
-
note:
|
|
1993
|
+
planned: z21.boolean(),
|
|
1994
|
+
writeStartedAt: z21.string().nullable(),
|
|
1995
|
+
launchStartedAt: z21.string().nullable(),
|
|
1996
|
+
launchError: z21.string().nullable(),
|
|
1997
|
+
shippedVariantId: z21.string().nullable(),
|
|
1998
|
+
shippedAt: z21.string().nullable()
|
|
1999
|
+
});
|
|
2000
|
+
var addVariantBodySchema = z21.object({
|
|
2001
|
+
title: z21.string().optional(),
|
|
2002
|
+
hypothesis: z21.string().optional()
|
|
2003
|
+
});
|
|
2004
|
+
var patchVariantBodySchema = z21.object({
|
|
2005
|
+
title: z21.string().optional(),
|
|
2006
|
+
hypothesis: z21.string().optional()
|
|
2007
|
+
});
|
|
2008
|
+
var fixerEditSchema = z21.object({
|
|
2009
|
+
find: z21.string().min(1),
|
|
2010
|
+
replace: z21.string()
|
|
2011
|
+
});
|
|
2012
|
+
var writeVariantContentBodySchema = z21.object({
|
|
2013
|
+
content: z21.string().optional(),
|
|
2014
|
+
edits: z21.array(fixerEditSchema).optional()
|
|
2015
|
+
});
|
|
2016
|
+
var writeVariantContentResponseSchema = z21.object({
|
|
2017
|
+
variantId: z21.string(),
|
|
2018
|
+
chars: z21.number().int(),
|
|
2019
|
+
truncated: z21.boolean(),
|
|
2020
|
+
applied: z21.number().int(),
|
|
2021
|
+
skipped: z21.number().int()
|
|
2022
|
+
});
|
|
2023
|
+
var experimentContentQuerySchema = z21.object({
|
|
2024
|
+
variantId: z21.string().optional(),
|
|
2025
|
+
offset: z21.coerce.number().int().min(0).default(0),
|
|
2026
|
+
maxChars: z21.coerce.number().int().min(1).max(4e4).default(2e4)
|
|
2027
|
+
});
|
|
2028
|
+
var experimentContentResponseSchema = z21.object({
|
|
2029
|
+
source: z21.string(),
|
|
2030
|
+
totalChars: z21.number().int(),
|
|
2031
|
+
offset: z21.number().int(),
|
|
2032
|
+
returnedChars: z21.number().int(),
|
|
2033
|
+
nextOffset: z21.number().int().nullable(),
|
|
2034
|
+
content: z21.string()
|
|
2035
|
+
});
|
|
2036
|
+
var writeRoundResponseSchema = z21.object({
|
|
2037
|
+
queued: z21.number().int(),
|
|
2038
|
+
reason: z21.enum(["round_in_flight", "nothing_pending"]).optional()
|
|
2039
|
+
});
|
|
2040
|
+
var launchResultSchema = z21.object({
|
|
2041
|
+
experimentId: z21.string(),
|
|
2042
|
+
status: z21.literal("LAUNCHING")
|
|
2043
|
+
});
|
|
2044
|
+
var shipBodySchema = z21.object({ variantId: z21.string().min(1) });
|
|
2045
|
+
var cancelResponseSchema = z21.object({
|
|
2046
|
+
id: z21.string(),
|
|
2047
|
+
status: z21.literal("CANCELED")
|
|
2048
|
+
});
|
|
2049
|
+
var variantDeltaSchema = z21.object({
|
|
2050
|
+
changed: z21.boolean().nullable(),
|
|
2051
|
+
hypothesisSupported: z21.enum(["supported", "refuted", "inconclusive"]).nullable(),
|
|
2052
|
+
summary: z21.string().nullable()
|
|
2053
|
+
});
|
|
2054
|
+
var variantRefSchema = z21.object({
|
|
2055
|
+
key: z21.string(),
|
|
2056
|
+
title: z21.string(),
|
|
2057
|
+
effect: z21.number().nullable(),
|
|
2058
|
+
consistency: z21.string().nullable(),
|
|
2059
|
+
note: z21.string().nullable(),
|
|
1573
2060
|
delta: variantDeltaSchema.nullable().optional()
|
|
1574
2061
|
});
|
|
1575
|
-
var recommendationSchema =
|
|
1576
|
-
evaluatorVersion:
|
|
1577
|
-
summary:
|
|
1578
|
-
groups:
|
|
1579
|
-
recommended:
|
|
1580
|
-
promising:
|
|
1581
|
-
notSupported:
|
|
1582
|
-
notEvaluable:
|
|
2062
|
+
var recommendationSchema = z21.object({
|
|
2063
|
+
evaluatorVersion: z21.string(),
|
|
2064
|
+
summary: z21.string(),
|
|
2065
|
+
groups: z21.object({
|
|
2066
|
+
recommended: z21.array(variantRefSchema),
|
|
2067
|
+
promising: z21.array(variantRefSchema),
|
|
2068
|
+
notSupported: z21.array(variantRefSchema),
|
|
2069
|
+
notEvaluable: z21.array(variantRefSchema)
|
|
1583
2070
|
}),
|
|
1584
|
-
tradeoffs:
|
|
2071
|
+
tradeoffs: z21.array(z21.string())
|
|
1585
2072
|
});
|
|
1586
2073
|
|
|
1587
2074
|
// ../packages/api-schemas/src/implementationDoc.ts
|
|
1588
|
-
import { z as
|
|
2075
|
+
import { z as z22 } from "zod";
|
|
1589
2076
|
var IMPLEMENTATION_DOC_MAX_CHARS = 5e5;
|
|
1590
|
-
var implementationDocSchema =
|
|
2077
|
+
var implementationDocSchema = z22.object({
|
|
1591
2078
|
/** The whole doc; "" when none has been written. */
|
|
1592
|
-
content:
|
|
2079
|
+
content: z22.string()
|
|
1593
2080
|
});
|
|
1594
|
-
var putImplementationDocBodySchema =
|
|
1595
|
-
content:
|
|
2081
|
+
var putImplementationDocBodySchema = z22.object({
|
|
2082
|
+
content: z22.string().max(IMPLEMENTATION_DOC_MAX_CHARS)
|
|
1596
2083
|
});
|
|
1597
|
-
var patchImplementationDocBodySchema =
|
|
1598
|
-
brandName:
|
|
1599
|
-
ecosystem:
|
|
1600
|
-
package:
|
|
1601
|
-
body:
|
|
2084
|
+
var patchImplementationDocBodySchema = z22.object({
|
|
2085
|
+
brandName: z22.string().min(1).max(200),
|
|
2086
|
+
ecosystem: z22.string().max(100).nullish(),
|
|
2087
|
+
package: z22.string().max(300).nullish(),
|
|
2088
|
+
body: z22.string().max(IMPLEMENTATION_DOC_MAX_CHARS)
|
|
1602
2089
|
});
|
|
1603
2090
|
|
|
1604
2091
|
// ../packages/api-schemas/src/invites.ts
|
|
1605
|
-
import { z as
|
|
1606
|
-
var inviteSchema =
|
|
1607
|
-
id:
|
|
1608
|
-
email:
|
|
1609
|
-
invitedBy:
|
|
1610
|
-
name:
|
|
1611
|
-
email:
|
|
2092
|
+
import { z as z23 } from "zod";
|
|
2093
|
+
var inviteSchema = z23.object({
|
|
2094
|
+
id: z23.string(),
|
|
2095
|
+
email: z23.string(),
|
|
2096
|
+
invitedBy: z23.object({
|
|
2097
|
+
name: z23.string().nullable(),
|
|
2098
|
+
email: z23.string().nullable()
|
|
1612
2099
|
}),
|
|
1613
|
-
createdAt:
|
|
1614
|
-
expiresAt:
|
|
2100
|
+
createdAt: z23.string(),
|
|
2101
|
+
expiresAt: z23.string()
|
|
1615
2102
|
});
|
|
1616
|
-
var listInvitesResponseSchema =
|
|
1617
|
-
items:
|
|
2103
|
+
var listInvitesResponseSchema = z23.object({
|
|
2104
|
+
items: z23.array(inviteSchema)
|
|
1618
2105
|
});
|
|
1619
2106
|
|
|
1620
2107
|
// ../packages/api-schemas/src/keys.ts
|
|
@@ -1627,168 +2114,168 @@ __export(keys_exports, {
|
|
|
1627
2114
|
setProviderKeyBodySchema: () => setProviderKeyBodySchema,
|
|
1628
2115
|
setProviderKeyResponseSchema: () => setProviderKeyResponseSchema
|
|
1629
2116
|
});
|
|
1630
|
-
import { z as
|
|
2117
|
+
import { z as z24 } from "zod";
|
|
1631
2118
|
var PROVIDER_TYPES = ["anthropic", "openai"];
|
|
1632
|
-
var providerTypeSchema =
|
|
1633
|
-
var setProviderKeyBodySchema =
|
|
2119
|
+
var providerTypeSchema = z24.enum(PROVIDER_TYPES);
|
|
2120
|
+
var setProviderKeyBodySchema = z24.object({
|
|
1634
2121
|
/** The raw provider API key. Verified + stored server-side (AWS Secrets
|
|
1635
2122
|
* Manager); never persisted in the app DB and never echoed back. */
|
|
1636
|
-
key:
|
|
2123
|
+
key: z24.string().min(1)
|
|
1637
2124
|
});
|
|
1638
|
-
var setProviderKeyResponseSchema =
|
|
2125
|
+
var setProviderKeyResponseSchema = z24.object({
|
|
1639
2126
|
providerType: providerTypeSchema,
|
|
1640
|
-
last4:
|
|
2127
|
+
last4: z24.string()
|
|
1641
2128
|
});
|
|
1642
|
-
var providerKeySchema =
|
|
2129
|
+
var providerKeySchema = z24.object({
|
|
1643
2130
|
providerType: providerTypeSchema,
|
|
1644
|
-
last4:
|
|
1645
|
-
createdAt:
|
|
2131
|
+
last4: z24.string(),
|
|
2132
|
+
createdAt: z24.string(),
|
|
1646
2133
|
/** When the key was last saved/rotated. */
|
|
1647
|
-
updatedAt:
|
|
2134
|
+
updatedAt: z24.string()
|
|
1648
2135
|
});
|
|
1649
2136
|
var providerKeyListResponseSchema = listResponseSchema(providerKeySchema);
|
|
1650
2137
|
|
|
1651
2138
|
// ../packages/api-schemas/src/mcp.ts
|
|
1652
|
-
import { z as
|
|
2139
|
+
import { z as z26 } from "zod";
|
|
1653
2140
|
|
|
1654
2141
|
// ../packages/api-schemas/src/skills.ts
|
|
1655
|
-
import { z as
|
|
2142
|
+
import { z as z25 } from "zod";
|
|
1656
2143
|
var sha256Hex = sha256DigestSchema;
|
|
1657
|
-
var skillHandleSchema =
|
|
1658
|
-
var skillSetEntrySchema =
|
|
1659
|
-
skillId:
|
|
2144
|
+
var skillHandleSchema = z25.string().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "invalid skill handle").refine((name) => name !== "." && name !== "..", "invalid skill handle");
|
|
2145
|
+
var skillSetEntrySchema = z25.object({
|
|
2146
|
+
skillId: z25.string().min(1),
|
|
1660
2147
|
name: skillHandleSchema,
|
|
1661
|
-
label:
|
|
2148
|
+
label: z25.string().min(1),
|
|
1662
2149
|
contentDigest: sha256Hex,
|
|
1663
2150
|
blobDigest: sha256Hex,
|
|
1664
2151
|
/** `cas/v2/<scope>/skills/sha256/<ab>/<blobDigest>.tar.zst`. */
|
|
1665
|
-
blobKey:
|
|
2152
|
+
blobKey: z25.string().min(1),
|
|
1666
2153
|
/** Raw canonical-tar size. Bounds the decompression allocation when present. */
|
|
1667
|
-
rawBytes:
|
|
2154
|
+
rawBytes: z25.number().int().positive().optional(),
|
|
1668
2155
|
/** Stored compressed size, verified against the object when present. */
|
|
1669
|
-
storedBytes:
|
|
2156
|
+
storedBytes: z25.number().int().positive().optional(),
|
|
1670
2157
|
/**
|
|
1671
2158
|
* What the MODEL sees, parsed from the frontmatter at push time
|
|
1672
2159
|
* (`{ name, description, descriptionChars, bodyBytes }`). Carried through to
|
|
1673
2160
|
* the trace for the record; the staging path never branches on it.
|
|
1674
2161
|
*/
|
|
1675
|
-
exposure:
|
|
2162
|
+
exposure: z25.record(z25.string(), z25.unknown()).optional()
|
|
1676
2163
|
});
|
|
1677
2164
|
var MAX_SKILL_SET_ENTRIES = 32;
|
|
1678
|
-
var skillSetSchema =
|
|
2165
|
+
var skillSetSchema = z25.array(skillSetEntrySchema).max(
|
|
1679
2166
|
MAX_SKILL_SET_ENTRIES,
|
|
1680
2167
|
`a run may stage at most ${MAX_SKILL_SET_ENTRIES} skills`
|
|
1681
2168
|
);
|
|
1682
|
-
var skillSourceWireSchema =
|
|
1683
|
-
repoFullName:
|
|
1684
|
-
ref:
|
|
1685
|
-
subpath:
|
|
1686
|
-
autoIngest:
|
|
1687
|
-
lastSeenCommit:
|
|
1688
|
-
lastCheckedAt:
|
|
1689
|
-
lastError:
|
|
1690
|
-
});
|
|
1691
|
-
var skillVersionWireSchema =
|
|
1692
|
-
id:
|
|
1693
|
-
label:
|
|
1694
|
-
contentDigest:
|
|
1695
|
-
ingestTrigger:
|
|
1696
|
-
createdAt:
|
|
1697
|
-
});
|
|
1698
|
-
var skillListItemSchema =
|
|
1699
|
-
id:
|
|
2169
|
+
var skillSourceWireSchema = z25.object({
|
|
2170
|
+
repoFullName: z25.string(),
|
|
2171
|
+
ref: z25.string(),
|
|
2172
|
+
subpath: z25.string(),
|
|
2173
|
+
autoIngest: z25.boolean(),
|
|
2174
|
+
lastSeenCommit: z25.string().nullable(),
|
|
2175
|
+
lastCheckedAt: z25.string().nullable(),
|
|
2176
|
+
lastError: z25.string().nullable()
|
|
2177
|
+
});
|
|
2178
|
+
var skillVersionWireSchema = z25.object({
|
|
2179
|
+
id: z25.string(),
|
|
2180
|
+
label: z25.string(),
|
|
2181
|
+
contentDigest: z25.string(),
|
|
2182
|
+
ingestTrigger: z25.string().nullable(),
|
|
2183
|
+
createdAt: z25.string()
|
|
2184
|
+
});
|
|
2185
|
+
var skillListItemSchema = z25.object({
|
|
2186
|
+
id: z25.string(),
|
|
1700
2187
|
/** OUR storage handle — the {ref} segment. */
|
|
1701
2188
|
name: skillHandleSchema,
|
|
1702
|
-
note:
|
|
2189
|
+
note: z25.string().nullable(),
|
|
1703
2190
|
source: skillSourceWireSchema.nullable(),
|
|
1704
2191
|
latestVersion: skillVersionWireSchema.nullable(),
|
|
1705
|
-
versionCount:
|
|
1706
|
-
createdAt:
|
|
1707
|
-
updatedAt:
|
|
2192
|
+
versionCount: z25.number().int(),
|
|
2193
|
+
createdAt: z25.string(),
|
|
2194
|
+
updatedAt: z25.string()
|
|
1708
2195
|
});
|
|
1709
|
-
var listSkillsResponseSchema =
|
|
1710
|
-
items:
|
|
2196
|
+
var listSkillsResponseSchema = z25.object({
|
|
2197
|
+
items: z25.array(skillListItemSchema)
|
|
1711
2198
|
});
|
|
1712
|
-
var skillDetailSchema = skillListItemSchema.omit({ latestVersion: true }).extend({ versions:
|
|
1713
|
-
var addSkillBodySchema =
|
|
1714
|
-
reference:
|
|
2199
|
+
var skillDetailSchema = skillListItemSchema.omit({ latestVersion: true }).extend({ versions: z25.array(skillVersionWireSchema) });
|
|
2200
|
+
var addSkillBodySchema = z25.object({
|
|
2201
|
+
reference: z25.string().min(1),
|
|
1715
2202
|
/** OUR handle; defaults to the resolved directory basename. */
|
|
1716
2203
|
handle: skillHandleSchema.optional(),
|
|
1717
2204
|
/** Explicit version label — a typed label is intent and always mints;
|
|
1718
2205
|
* omitted derives from the resolved anchor and dedups by digest. */
|
|
1719
|
-
label:
|
|
2206
|
+
label: z25.string().min(1).max(120).optional(),
|
|
1720
2207
|
/** Select one skill from a source holding several. */
|
|
1721
|
-
skill:
|
|
1722
|
-
note:
|
|
2208
|
+
skill: z25.string().min(1).optional(),
|
|
2209
|
+
note: z25.string().max(2e3).optional(),
|
|
1723
2210
|
/** Track the source branch for auto re-ingest (needs an explicit branch). */
|
|
1724
|
-
trackSource:
|
|
2211
|
+
trackSource: z25.boolean().optional()
|
|
1725
2212
|
});
|
|
1726
|
-
var addSkillResponseSchema =
|
|
1727
|
-
skillId:
|
|
1728
|
-
handle:
|
|
1729
|
-
label:
|
|
2213
|
+
var addSkillResponseSchema = z25.object({
|
|
2214
|
+
skillId: z25.string().nullable(),
|
|
2215
|
+
handle: z25.string(),
|
|
2216
|
+
label: z25.string(),
|
|
1730
2217
|
/** True = the newest version already carried this content; nothing minted. */
|
|
1731
|
-
unchanged:
|
|
2218
|
+
unchanged: z25.boolean()
|
|
1732
2219
|
});
|
|
1733
|
-
var updateSkillBodySchema =
|
|
2220
|
+
var updateSkillBodySchema = z25.object({
|
|
1734
2221
|
name: skillHandleSchema.optional(),
|
|
1735
|
-
note:
|
|
1736
|
-
source:
|
|
1737
|
-
repoFullName:
|
|
2222
|
+
note: z25.string().max(2e3).nullish(),
|
|
2223
|
+
source: z25.object({
|
|
2224
|
+
repoFullName: z25.string().min(1),
|
|
1738
2225
|
/** A branch name — never HEAD, never a SHA. */
|
|
1739
|
-
ref:
|
|
1740
|
-
subpath:
|
|
1741
|
-
autoIngest:
|
|
2226
|
+
ref: z25.string().min(1),
|
|
2227
|
+
subpath: z25.string().optional(),
|
|
2228
|
+
autoIngest: z25.boolean().optional()
|
|
1742
2229
|
}).nullish()
|
|
1743
2230
|
});
|
|
1744
|
-
var reingestSkillResponseSchema =
|
|
1745
|
-
label:
|
|
2231
|
+
var reingestSkillResponseSchema = z25.object({
|
|
2232
|
+
label: z25.string().nullable(),
|
|
1746
2233
|
/** True = "already current": the source content matches the newest version. */
|
|
1747
|
-
unchanged:
|
|
1748
|
-
});
|
|
1749
|
-
var skillRunWireSchema =
|
|
1750
|
-
runId:
|
|
1751
|
-
agent:
|
|
1752
|
-
turns:
|
|
1753
|
-
durationMs:
|
|
1754
|
-
costUsd:
|
|
1755
|
-
finishedAt:
|
|
2234
|
+
unchanged: z25.boolean()
|
|
2235
|
+
});
|
|
2236
|
+
var skillRunWireSchema = z25.object({
|
|
2237
|
+
runId: z25.string(),
|
|
2238
|
+
agent: z25.string(),
|
|
2239
|
+
turns: z25.number().int().nullable(),
|
|
2240
|
+
durationMs: z25.number().int().nullable(),
|
|
2241
|
+
costUsd: z25.number().nullable(),
|
|
2242
|
+
finishedAt: z25.string().nullable(),
|
|
1756
2243
|
/** WHICH version of the skill the session staged. */
|
|
1757
|
-
versionLabel:
|
|
2244
|
+
versionLabel: z25.string().nullable()
|
|
1758
2245
|
});
|
|
1759
|
-
var listSkillRunsResponseSchema =
|
|
1760
|
-
items:
|
|
2246
|
+
var listSkillRunsResponseSchema = z25.object({
|
|
2247
|
+
items: z25.array(skillRunWireSchema)
|
|
1761
2248
|
});
|
|
1762
2249
|
|
|
1763
2250
|
// ../packages/api-schemas/src/mcp.ts
|
|
1764
2251
|
var mcpServerHandleSchema = skillHandleSchema;
|
|
1765
2252
|
var MCP_SPEC_VERSION = 1;
|
|
1766
|
-
var envVarNameSchema =
|
|
2253
|
+
var envVarNameSchema = z26.string().min(1).max(128).regex(
|
|
1767
2254
|
/^[A-Za-z_][A-Za-z0-9_]*$/,
|
|
1768
2255
|
"an environment variable name (letters, digits, underscore; not starting with a digit)"
|
|
1769
2256
|
);
|
|
1770
|
-
var headerNameSchema =
|
|
2257
|
+
var headerNameSchema = z26.string().min(1).max(128).regex(
|
|
1771
2258
|
/^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/,
|
|
1772
2259
|
"an HTTP header name (a token \u2014 no colon, no spaces)"
|
|
1773
2260
|
);
|
|
1774
|
-
var mcpToolSchema =
|
|
1775
|
-
name:
|
|
1776
|
-
description:
|
|
2261
|
+
var mcpToolSchema = z26.object({
|
|
2262
|
+
name: z26.string().min(1).max(128),
|
|
2263
|
+
description: z26.string().max(4096).optional()
|
|
1777
2264
|
});
|
|
1778
|
-
var mcpSpecSchema =
|
|
1779
|
-
specVersion:
|
|
1780
|
-
transport:
|
|
2265
|
+
var mcpSpecSchema = z26.object({
|
|
2266
|
+
specVersion: z26.literal(MCP_SPEC_VERSION),
|
|
2267
|
+
transport: z26.enum(["stdio", "http"]),
|
|
1781
2268
|
// stdio
|
|
1782
|
-
command:
|
|
1783
|
-
args:
|
|
1784
|
-
envNames:
|
|
2269
|
+
command: z26.string().min(1).max(512).optional(),
|
|
2270
|
+
args: z26.array(z26.string().max(4096)).max(64).optional(),
|
|
2271
|
+
envNames: z26.array(envVarNameSchema).max(32).optional(),
|
|
1785
2272
|
// http
|
|
1786
|
-
url:
|
|
1787
|
-
headerNames:
|
|
2273
|
+
url: z26.string().url().max(2048).optional(),
|
|
2274
|
+
headerNames: z26.array(headerNameSchema).max(32).optional(),
|
|
1788
2275
|
// display only — outside the digest (D13)
|
|
1789
2276
|
serverName: mcpServerHandleSchema,
|
|
1790
|
-
description:
|
|
1791
|
-
tools:
|
|
2277
|
+
description: z26.string().max(4096).optional(),
|
|
2278
|
+
tools: z26.array(mcpToolSchema).max(256).optional()
|
|
1792
2279
|
}).strict().superRefine((spec, ctx) => {
|
|
1793
2280
|
if (spec.transport === "stdio") {
|
|
1794
2281
|
if (!spec.command) {
|
|
@@ -1832,17 +2319,17 @@ var mcpSpecSchema = z21.object({
|
|
|
1832
2319
|
}
|
|
1833
2320
|
}
|
|
1834
2321
|
});
|
|
1835
|
-
var mcpExposureSchema =
|
|
1836
|
-
serverName:
|
|
1837
|
-
description:
|
|
1838
|
-
tools:
|
|
2322
|
+
var mcpExposureSchema = z26.object({
|
|
2323
|
+
serverName: z26.string().min(1),
|
|
2324
|
+
description: z26.string().optional(),
|
|
2325
|
+
tools: z26.array(mcpToolSchema).default([]),
|
|
1839
2326
|
/** Declared credential NAMES, mirrored here so the picker and the index row can
|
|
1840
2327
|
* render the contract without parsing `spec`. Never values. */
|
|
1841
|
-
envNames:
|
|
1842
|
-
headerNames:
|
|
2328
|
+
envNames: z26.array(z26.string()).default([]),
|
|
2329
|
+
headerNames: z26.array(z26.string()).default([])
|
|
1843
2330
|
});
|
|
1844
|
-
var mcpWarningSchema =
|
|
1845
|
-
code:
|
|
2331
|
+
var mcpWarningSchema = z26.object({
|
|
2332
|
+
code: z26.enum([
|
|
1846
2333
|
"unpinned_package",
|
|
1847
2334
|
"credential_required",
|
|
1848
2335
|
"value_discarded",
|
|
@@ -1852,734 +2339,487 @@ var mcpWarningSchema = z21.object({
|
|
|
1852
2339
|
// contract was recorded when none was (Bugbot, medium).
|
|
1853
2340
|
"flag_ignored"
|
|
1854
2341
|
]),
|
|
1855
|
-
message:
|
|
2342
|
+
message: z26.string()
|
|
1856
2343
|
});
|
|
1857
|
-
var mcpSetEntrySchema =
|
|
2344
|
+
var mcpSetEntrySchema = z26.object({
|
|
1858
2345
|
/** `McpServer.id` — the stable handle a UI chip links back to; `label` already
|
|
1859
2346
|
* names the version, so this is deliberately not `McpServerVersion.id`. */
|
|
1860
|
-
serverId:
|
|
2347
|
+
serverId: z26.string().min(1),
|
|
1861
2348
|
/** `McpServer.name` — OUR handle, and the CONFIG KEY the serializer writes. NOT
|
|
1862
2349
|
* the agent-visible `spec.serverName`. */
|
|
1863
2350
|
name: mcpServerHandleSchema,
|
|
1864
|
-
label:
|
|
1865
|
-
specDigest:
|
|
2351
|
+
label: z26.string().min(1),
|
|
2352
|
+
specDigest: z26.string().min(1),
|
|
1866
2353
|
spec: mcpSpecSchema,
|
|
1867
2354
|
/** Declared tools/description as at authoring time. The preparation path never
|
|
1868
2355
|
* branches on it; it rides along for the trace and the UI. */
|
|
1869
|
-
exposure:
|
|
2356
|
+
exposure: z26.record(z26.string(), z26.unknown()).optional(),
|
|
2357
|
+
/** Connection selected by this immutable MCP version. The matching non-secret
|
|
2358
|
+
* provider metadata lives in Batch.connectionSet. */
|
|
2359
|
+
connectionId: z26.string().min(1).optional()
|
|
1870
2360
|
});
|
|
1871
2361
|
var MAX_MCP_SET_ENTRIES = 8;
|
|
1872
|
-
var mcpSetSchema =
|
|
2362
|
+
var mcpSetSchema = z26.array(mcpSetEntrySchema).max(
|
|
1873
2363
|
MAX_MCP_SET_ENTRIES,
|
|
1874
2364
|
`a run may prepare at most ${MAX_MCP_SET_ENTRIES} MCP servers`
|
|
1875
2365
|
);
|
|
1876
|
-
var mcpRefSchema =
|
|
2366
|
+
var mcpRefSchema = z26.string().min(3).max(320).regex(
|
|
1877
2367
|
/^[A-Za-z0-9][A-Za-z0-9._-]*@[^,]+$/,
|
|
1878
2368
|
'an MCP server reference must be "name@label" (a bare name is not a reference)'
|
|
1879
2369
|
);
|
|
1880
|
-
var mcpRefsSchema =
|
|
1881
|
-
var mcpVersionWireSchema =
|
|
1882
|
-
id:
|
|
1883
|
-
label:
|
|
1884
|
-
specDigest:
|
|
2370
|
+
var mcpRefsSchema = z26.array(mcpRefSchema).max(MAX_MCP_SET_ENTRIES);
|
|
2371
|
+
var mcpVersionWireSchema = z26.object({
|
|
2372
|
+
id: z26.string(),
|
|
2373
|
+
label: z26.string(),
|
|
2374
|
+
specDigest: z26.string(),
|
|
1885
2375
|
spec: mcpSpecSchema,
|
|
1886
2376
|
exposure: mcpExposureSchema,
|
|
1887
|
-
warnings:
|
|
1888
|
-
createdAt:
|
|
2377
|
+
warnings: z26.array(mcpWarningSchema),
|
|
2378
|
+
createdAt: z26.string()
|
|
1889
2379
|
});
|
|
1890
|
-
var mcpServerListItemSchema =
|
|
1891
|
-
id:
|
|
2380
|
+
var mcpServerListItemSchema = z26.object({
|
|
2381
|
+
id: z26.string(),
|
|
1892
2382
|
/** OUR handle — the {ref} segment and the config key the serializer writes. */
|
|
1893
2383
|
name: mcpServerHandleSchema,
|
|
1894
|
-
note:
|
|
2384
|
+
note: z26.string().nullable(),
|
|
1895
2385
|
latestVersion: mcpVersionWireSchema.nullable(),
|
|
1896
|
-
versionCount:
|
|
1897
|
-
createdAt:
|
|
1898
|
-
updatedAt:
|
|
2386
|
+
versionCount: z26.number().int(),
|
|
2387
|
+
createdAt: z26.string(),
|
|
2388
|
+
updatedAt: z26.string()
|
|
1899
2389
|
});
|
|
1900
|
-
var listMcpServersResponseSchema =
|
|
1901
|
-
items:
|
|
2390
|
+
var listMcpServersResponseSchema = z26.object({
|
|
2391
|
+
items: z26.array(mcpServerListItemSchema)
|
|
1902
2392
|
});
|
|
1903
|
-
var mcpServerDetailSchema = mcpServerListItemSchema.omit({ latestVersion: true }).extend({ versions:
|
|
1904
|
-
var saveMcpServerBodySchema =
|
|
2393
|
+
var mcpServerDetailSchema = mcpServerListItemSchema.omit({ latestVersion: true }).extend({ versions: z26.array(mcpVersionWireSchema) });
|
|
2394
|
+
var saveMcpServerBodySchema = z26.object({
|
|
1905
2395
|
name: mcpServerHandleSchema,
|
|
1906
|
-
spec:
|
|
2396
|
+
spec: z26.unknown(),
|
|
1907
2397
|
/** A typed label is intent and always mints; omitted defaults to a UTC
|
|
1908
2398
|
* timestamp label and dedups by spec digest. */
|
|
1909
|
-
label:
|
|
1910
|
-
note:
|
|
1911
|
-
});
|
|
1912
|
-
var saveMcpServerResponseSchema =
|
|
1913
|
-
serverId:
|
|
1914
|
-
handle:
|
|
1915
|
-
label:
|
|
1916
|
-
specDigest:
|
|
1917
|
-
warnings:
|
|
2399
|
+
label: z26.string().min(1).max(120).optional(),
|
|
2400
|
+
note: z26.string().max(2e3).optional()
|
|
2401
|
+
});
|
|
2402
|
+
var saveMcpServerResponseSchema = z26.object({
|
|
2403
|
+
serverId: z26.string().nullable(),
|
|
2404
|
+
handle: z26.string(),
|
|
2405
|
+
label: z26.string(),
|
|
2406
|
+
specDigest: z26.string(),
|
|
2407
|
+
warnings: z26.array(mcpWarningSchema),
|
|
1918
2408
|
/** True = the newest version already carries this exact spec. */
|
|
1919
|
-
unchanged:
|
|
2409
|
+
unchanged: z26.boolean(),
|
|
1920
2410
|
/** Display-only rendered invocation or URL. */
|
|
1921
|
-
invocation:
|
|
2411
|
+
invocation: z26.string()
|
|
1922
2412
|
});
|
|
1923
|
-
var updateMcpServerBodySchema =
|
|
2413
|
+
var updateMcpServerBodySchema = z26.object({
|
|
1924
2414
|
name: mcpServerHandleSchema.optional(),
|
|
1925
|
-
note:
|
|
2415
|
+
note: z26.string().max(2e3).nullish()
|
|
1926
2416
|
});
|
|
1927
2417
|
|
|
1928
2418
|
// ../packages/api-schemas/src/me.ts
|
|
1929
|
-
import { z as
|
|
1930
|
-
var meUserSchema =
|
|
1931
|
-
id:
|
|
1932
|
-
email:
|
|
1933
|
-
isSuperuser:
|
|
2419
|
+
import { z as z27 } from "zod";
|
|
2420
|
+
var meUserSchema = z27.object({
|
|
2421
|
+
id: z27.string(),
|
|
2422
|
+
email: z27.string().nullable(),
|
|
2423
|
+
isSuperuser: z27.boolean()
|
|
1934
2424
|
});
|
|
1935
|
-
var meOrgSchema =
|
|
1936
|
-
slug:
|
|
2425
|
+
var meOrgSchema = z27.object({
|
|
2426
|
+
slug: z27.string(),
|
|
1937
2427
|
// Gauge's immutable Organization.public_id; null for LOCAL orgs.
|
|
1938
|
-
publicId:
|
|
1939
|
-
name:
|
|
2428
|
+
publicId: z27.string().nullable(),
|
|
2429
|
+
name: z27.string()
|
|
1940
2430
|
});
|
|
1941
|
-
var meResponseSchema =
|
|
2431
|
+
var meResponseSchema = z27.object({
|
|
1942
2432
|
user: meUserSchema,
|
|
1943
2433
|
// Membership-scoped for normal users; superusers see every org (mirrors the
|
|
1944
2434
|
// web tier's userOrgs).
|
|
1945
|
-
orgs:
|
|
2435
|
+
orgs: z27.array(meOrgSchema)
|
|
1946
2436
|
});
|
|
1947
2437
|
|
|
1948
2438
|
// ../packages/api-schemas/src/orgs.ts
|
|
1949
|
-
import { z as
|
|
1950
|
-
var createOrgRequestSchema =
|
|
2439
|
+
import { z as z28 } from "zod";
|
|
2440
|
+
var createOrgRequestSchema = z28.object({
|
|
1951
2441
|
/** Workspace display name; the slug is derived server-side. */
|
|
1952
|
-
name:
|
|
2442
|
+
name: z28.string().trim().min(1).max(200),
|
|
1953
2443
|
/** Optional company site (logo source; stamped onto the org). */
|
|
1954
|
-
website:
|
|
2444
|
+
website: z28.string().trim().max(300).optional()
|
|
1955
2445
|
});
|
|
1956
|
-
var createOrgResponseSchema =
|
|
1957
|
-
slug:
|
|
1958
|
-
name:
|
|
2446
|
+
var createOrgResponseSchema = z28.object({
|
|
2447
|
+
slug: z28.string(),
|
|
2448
|
+
name: z28.string(),
|
|
1959
2449
|
// LOCAL orgs never have a Gauge publicId.
|
|
1960
|
-
publicId:
|
|
2450
|
+
publicId: z28.string().nullable()
|
|
1961
2451
|
});
|
|
1962
|
-
var orgSettingsSchema =
|
|
1963
|
-
slug:
|
|
1964
|
-
name:
|
|
1965
|
-
publicId:
|
|
1966
|
-
website:
|
|
2452
|
+
var orgSettingsSchema = z28.object({
|
|
2453
|
+
slug: z28.string(),
|
|
2454
|
+
name: z28.string(),
|
|
2455
|
+
publicId: z28.string().nullable(),
|
|
2456
|
+
website: z28.string().nullable(),
|
|
1967
2457
|
/** Per-run max-spend override in USD; null = the server default. */
|
|
1968
|
-
maxSpendUsd:
|
|
1969
|
-
overageEnabled:
|
|
2458
|
+
maxSpendUsd: z28.number().nullable(),
|
|
2459
|
+
overageEnabled: z28.boolean(),
|
|
1970
2460
|
/** Per-cycle overage cap in credits; null = uncapped. */
|
|
1971
|
-
overageCapCredits:
|
|
2461
|
+
overageCapCredits: z28.number().int().nullable(),
|
|
1972
2462
|
/** Domain claimed for same-domain auto-join; null = off. */
|
|
1973
|
-
autoJoinDomain:
|
|
2463
|
+
autoJoinDomain: z28.string().nullable()
|
|
1974
2464
|
});
|
|
1975
|
-
var orgMemberSchema =
|
|
1976
|
-
userId:
|
|
1977
|
-
name:
|
|
1978
|
-
email:
|
|
1979
|
-
joinedAt:
|
|
2465
|
+
var orgMemberSchema = z28.object({
|
|
2466
|
+
userId: z28.string(),
|
|
2467
|
+
name: z28.string().nullable(),
|
|
2468
|
+
email: z28.string().nullable(),
|
|
2469
|
+
joinedAt: z28.string()
|
|
1980
2470
|
});
|
|
1981
|
-
var listMembersResponseSchema =
|
|
1982
|
-
items:
|
|
2471
|
+
var listMembersResponseSchema = z28.object({
|
|
2472
|
+
items: z28.array(orgMemberSchema)
|
|
1983
2473
|
});
|
|
1984
2474
|
|
|
1985
2475
|
// ../packages/api-schemas/src/personas.ts
|
|
1986
|
-
import { z as
|
|
1987
|
-
var personaSchema =
|
|
1988
|
-
id:
|
|
1989
|
-
name:
|
|
1990
|
-
description:
|
|
2476
|
+
import { z as z29 } from "zod";
|
|
2477
|
+
var personaSchema = z29.object({
|
|
2478
|
+
id: z29.string(),
|
|
2479
|
+
name: z29.string(),
|
|
2480
|
+
description: z29.string(),
|
|
1991
2481
|
/** The judge model this persona calls (Claude only). */
|
|
1992
|
-
model:
|
|
1993
|
-
createdAt:
|
|
1994
|
-
updatedAt:
|
|
2482
|
+
model: z29.string(),
|
|
2483
|
+
createdAt: z29.string(),
|
|
2484
|
+
updatedAt: z29.string()
|
|
1995
2485
|
});
|
|
1996
|
-
var listPersonasResponseSchema =
|
|
1997
|
-
items:
|
|
2486
|
+
var listPersonasResponseSchema = z29.object({
|
|
2487
|
+
items: z29.array(personaSchema)
|
|
1998
2488
|
});
|
|
1999
|
-
var createPersonaBodySchema =
|
|
2000
|
-
name:
|
|
2001
|
-
description:
|
|
2489
|
+
var createPersonaBodySchema = z29.object({
|
|
2490
|
+
name: z29.string().min(1).max(120),
|
|
2491
|
+
description: z29.string().min(1)
|
|
2002
2492
|
});
|
|
2003
|
-
var updatePersonaBodySchema =
|
|
2004
|
-
name:
|
|
2005
|
-
description:
|
|
2493
|
+
var updatePersonaBodySchema = z29.object({
|
|
2494
|
+
name: z29.string().min(1).max(120).optional(),
|
|
2495
|
+
description: z29.string().min(1).optional()
|
|
2006
2496
|
});
|
|
2007
2497
|
|
|
2008
2498
|
// ../packages/api-schemas/src/prompts.ts
|
|
2009
|
-
import { z as
|
|
2499
|
+
import { z as z32 } from "zod";
|
|
2010
2500
|
|
|
2011
2501
|
// ../packages/api-schemas/src/tags.ts
|
|
2012
|
-
import { z as
|
|
2013
|
-
var tagSchema =
|
|
2014
|
-
id:
|
|
2015
|
-
name:
|
|
2502
|
+
import { z as z30 } from "zod";
|
|
2503
|
+
var tagSchema = z30.object({
|
|
2504
|
+
id: z30.string(),
|
|
2505
|
+
name: z30.string(),
|
|
2016
2506
|
/** A Mantine palette name (e.g. "blue", "grape"); unknown values are
|
|
2017
2507
|
* normalized server-side to the default ("gray"). */
|
|
2018
|
-
color:
|
|
2508
|
+
color: z30.string()
|
|
2019
2509
|
});
|
|
2020
|
-
var createTagBodySchema =
|
|
2021
|
-
name:
|
|
2022
|
-
color:
|
|
2510
|
+
var createTagBodySchema = z30.object({
|
|
2511
|
+
name: z30.string().min(1),
|
|
2512
|
+
color: z30.string().optional()
|
|
2023
2513
|
});
|
|
2024
|
-
var updateTagBodySchema =
|
|
2025
|
-
name:
|
|
2026
|
-
color:
|
|
2514
|
+
var updateTagBodySchema = z30.object({
|
|
2515
|
+
name: z30.string().min(1).optional(),
|
|
2516
|
+
color: z30.string().optional()
|
|
2027
2517
|
});
|
|
2028
2518
|
var tagListResponseSchema = listResponseSchema(tagSchema);
|
|
2029
2519
|
|
|
2030
2520
|
// ../packages/api-schemas/src/topics.ts
|
|
2031
|
-
import { z as
|
|
2032
|
-
var topicSchema =
|
|
2033
|
-
id:
|
|
2034
|
-
name:
|
|
2521
|
+
import { z as z31 } from "zod";
|
|
2522
|
+
var topicSchema = z31.object({
|
|
2523
|
+
id: z31.string(),
|
|
2524
|
+
name: z31.string()
|
|
2035
2525
|
});
|
|
2036
|
-
var createTopicBodySchema =
|
|
2037
|
-
name:
|
|
2526
|
+
var createTopicBodySchema = z31.object({
|
|
2527
|
+
name: z31.string().min(1, "name is required")
|
|
2038
2528
|
});
|
|
2039
2529
|
var topicListResponseSchema = listResponseSchema(topicSchema);
|
|
2040
2530
|
|
|
2041
|
-
// ../packages/api-schemas/src/web-fixtures.ts
|
|
2042
|
-
import { z as z27 } from "zod";
|
|
2043
|
-
var MAX_WEB_FIXTURE_BYTES = 1e6;
|
|
2044
|
-
function withoutFragment(raw) {
|
|
2045
|
-
const fragment = raw.indexOf("#");
|
|
2046
|
-
return fragment === -1 ? raw : raw.slice(0, fragment);
|
|
2047
|
-
}
|
|
2048
|
-
var searchResultSchema = z27.object({
|
|
2049
|
-
title: z27.string().min(1),
|
|
2050
|
-
url: z27.url().transform(withoutFragment),
|
|
2051
|
-
snippet: z27.string()
|
|
2052
|
-
});
|
|
2053
|
-
var searchFixtureSchema = z27.object({
|
|
2054
|
-
query: z27.string().trim().min(1),
|
|
2055
|
-
results: z27.array(searchResultSchema)
|
|
2056
|
-
});
|
|
2057
|
-
var pageFixtureSchema = z27.object({
|
|
2058
|
-
url: z27.url().transform(withoutFragment),
|
|
2059
|
-
status: z27.int().min(100).max(599).default(200),
|
|
2060
|
-
contentType: z27.string().trim().min(1).default("text/html"),
|
|
2061
|
-
body: z27.string()
|
|
2062
|
-
});
|
|
2063
|
-
var webFixtureSchema = z27.object({
|
|
2064
|
-
version: z27.literal(1),
|
|
2065
|
-
searches: z27.array(searchFixtureSchema).default([]),
|
|
2066
|
-
pages: z27.array(pageFixtureSchema).default([])
|
|
2067
|
-
}).superRefine((fixture, ctx) => {
|
|
2068
|
-
const queries = /* @__PURE__ */ new Set();
|
|
2069
|
-
fixture.searches.forEach((entry, index) => {
|
|
2070
|
-
if (queries.has(entry.query)) {
|
|
2071
|
-
ctx.addIssue({
|
|
2072
|
-
code: "custom",
|
|
2073
|
-
path: ["searches", index, "query"],
|
|
2074
|
-
message: `duplicate normalized query: ${entry.query}`
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
queries.add(entry.query);
|
|
2078
|
-
});
|
|
2079
|
-
const urls = /* @__PURE__ */ new Set();
|
|
2080
|
-
fixture.pages.forEach((entry, index) => {
|
|
2081
|
-
if (urls.has(entry.url)) {
|
|
2082
|
-
ctx.addIssue({
|
|
2083
|
-
code: "custom",
|
|
2084
|
-
path: ["pages", index, "url"],
|
|
2085
|
-
message: `duplicate normalized URL: ${entry.url}`
|
|
2086
|
-
});
|
|
2087
|
-
}
|
|
2088
|
-
urls.add(entry.url);
|
|
2089
|
-
});
|
|
2090
|
-
const bytes = new TextEncoder().encode(JSON.stringify(fixture)).byteLength;
|
|
2091
|
-
if (bytes > MAX_WEB_FIXTURE_BYTES) {
|
|
2092
|
-
ctx.addIssue({
|
|
2093
|
-
code: "custom",
|
|
2094
|
-
message: `serialized fixture is ${bytes} bytes; maximum is ${MAX_WEB_FIXTURE_BYTES}`
|
|
2095
|
-
});
|
|
2096
|
-
}
|
|
2097
|
-
});
|
|
2098
|
-
|
|
2099
2531
|
// ../packages/api-schemas/src/prompts.ts
|
|
2100
|
-
var promptSummarySchema =
|
|
2101
|
-
id:
|
|
2102
|
-
text:
|
|
2103
|
-
isBranded:
|
|
2532
|
+
var promptSummarySchema = z32.object({
|
|
2533
|
+
id: z32.string(),
|
|
2534
|
+
text: z32.string(),
|
|
2535
|
+
isBranded: z32.boolean(),
|
|
2104
2536
|
/** Battery-spec identity (idempotent applies); null for UI/CLI-created prompts. */
|
|
2105
|
-
externalKey:
|
|
2537
|
+
externalKey: z32.string().nullable(),
|
|
2106
2538
|
topic: topicSchema.nullable(),
|
|
2107
|
-
tags:
|
|
2108
|
-
scheduleCount:
|
|
2109
|
-
createdAt:
|
|
2539
|
+
tags: z32.array(tagSchema),
|
|
2540
|
+
scheduleCount: z32.number().int(),
|
|
2541
|
+
createdAt: z32.string()
|
|
2110
2542
|
});
|
|
2111
|
-
var promptScheduleRefSchema =
|
|
2112
|
-
id:
|
|
2113
|
-
name:
|
|
2543
|
+
var promptScheduleRefSchema = z32.object({
|
|
2544
|
+
id: z32.string(),
|
|
2545
|
+
name: z32.string(),
|
|
2114
2546
|
cadence: cadenceSchema,
|
|
2115
|
-
daysPerWeek:
|
|
2116
|
-
enabled:
|
|
2547
|
+
daysPerWeek: z32.number().int().nullable(),
|
|
2548
|
+
enabled: z32.boolean()
|
|
2117
2549
|
});
|
|
2118
2550
|
var promptDetailSchema = promptSummarySchema.extend({
|
|
2119
|
-
schedules:
|
|
2551
|
+
schedules: z32.array(promptScheduleRefSchema)
|
|
2120
2552
|
});
|
|
2121
2553
|
var promptListResponseSchema = listResponseSchema(promptSummarySchema);
|
|
2122
2554
|
var listPromptsQuerySchema = listQuerySchema.extend({
|
|
2123
|
-
topic:
|
|
2124
|
-
tag:
|
|
2125
|
-
q:
|
|
2126
|
-
});
|
|
2127
|
-
var createPromptBodySchema =
|
|
2128
|
-
text:
|
|
2129
|
-
isBranded:
|
|
2130
|
-
topic:
|
|
2131
|
-
tags:
|
|
2132
|
-
});
|
|
2133
|
-
var updatePromptBodySchema =
|
|
2134
|
-
text:
|
|
2135
|
-
isBranded:
|
|
2136
|
-
topicId:
|
|
2137
|
-
tags:
|
|
2138
|
-
});
|
|
2139
|
-
var runPromptBodySchema =
|
|
2555
|
+
topic: z32.string().min(1).optional(),
|
|
2556
|
+
tag: z32.string().min(1).optional(),
|
|
2557
|
+
q: z32.string().min(1).optional()
|
|
2558
|
+
});
|
|
2559
|
+
var createPromptBodySchema = z32.object({
|
|
2560
|
+
text: z32.string().min(1, "text is required"),
|
|
2561
|
+
isBranded: z32.boolean().default(false),
|
|
2562
|
+
topic: z32.string().min(1).optional(),
|
|
2563
|
+
tags: z32.array(z32.string().min(1)).default([])
|
|
2564
|
+
});
|
|
2565
|
+
var updatePromptBodySchema = z32.object({
|
|
2566
|
+
text: z32.string().min(1).optional(),
|
|
2567
|
+
isBranded: z32.boolean().optional(),
|
|
2568
|
+
topicId: z32.string().min(1).nullish(),
|
|
2569
|
+
tags: z32.array(z32.string().min(1)).optional()
|
|
2570
|
+
});
|
|
2571
|
+
var runPromptBodySchema = z32.object({
|
|
2140
2572
|
/** Preferred paired representation; each agent may pin its own model tiers. */
|
|
2141
|
-
agentConfigs:
|
|
2573
|
+
agentConfigs: z32.array(scheduleAgentConfigInputSchema).min(1).optional(),
|
|
2142
2574
|
/** Legacy agent set (no per-agent pins), kept during the API transition. */
|
|
2143
|
-
agents:
|
|
2144
|
-
repoUrl:
|
|
2145
|
-
repoRef:
|
|
2146
|
-
samplesPerCycle:
|
|
2575
|
+
agents: z32.array(agentSchema).min(1, "Select at least one agent").default(["CLAUDE_CODE", "CODEX_CLI"]),
|
|
2576
|
+
repoUrl: z32.string().min(1).nullish(),
|
|
2577
|
+
repoRef: z32.string().min(1).nullish(),
|
|
2578
|
+
samplesPerCycle: z32.number().int().min(1).max(10).default(1),
|
|
2147
2579
|
webFixture: webFixtureSchema.optional()
|
|
2148
2580
|
});
|
|
2149
|
-
var runPromptResponseSchema =
|
|
2150
|
-
batchIds:
|
|
2151
|
-
runIds:
|
|
2152
|
-
blocked:
|
|
2581
|
+
var runPromptResponseSchema = z32.object({
|
|
2582
|
+
batchIds: z32.array(z32.string()),
|
|
2583
|
+
runIds: z32.array(z32.string()),
|
|
2584
|
+
blocked: z32.enum(["insufficient_credits", "needs_provider_key"]).optional()
|
|
2153
2585
|
});
|
|
2154
2586
|
|
|
2155
2587
|
// ../packages/api-schemas/src/repos.ts
|
|
2156
|
-
import { z as
|
|
2588
|
+
import { z as z33 } from "zod";
|
|
2157
2589
|
var REPO_SIZE_BUCKETS = [
|
|
2158
2590
|
"small",
|
|
2159
2591
|
"medium",
|
|
2160
2592
|
"large",
|
|
2161
2593
|
"xlarge"
|
|
2162
2594
|
];
|
|
2163
|
-
var repoSizeBucketSchema =
|
|
2164
|
-
var repoSchema =
|
|
2165
|
-
url:
|
|
2166
|
-
name:
|
|
2167
|
-
isSystem:
|
|
2168
|
-
languages:
|
|
2169
|
-
frameworks:
|
|
2595
|
+
var repoSizeBucketSchema = z33.enum(REPO_SIZE_BUCKETS);
|
|
2596
|
+
var repoSchema = z33.object({
|
|
2597
|
+
url: z33.string(),
|
|
2598
|
+
name: z33.string(),
|
|
2599
|
+
isSystem: z33.boolean(),
|
|
2600
|
+
languages: z33.array(z33.string()),
|
|
2601
|
+
frameworks: z33.array(z33.string()),
|
|
2170
2602
|
/** Faceted labels (complexity:L2, buildable:yes, stack:nextjs, …). */
|
|
2171
|
-
tags:
|
|
2172
|
-
primaryLanguage:
|
|
2173
|
-
sizeKb:
|
|
2603
|
+
tags: z33.array(z33.string()),
|
|
2604
|
+
primaryLanguage: z33.string(),
|
|
2605
|
+
sizeKb: z33.number(),
|
|
2174
2606
|
sizeBucket: repoSizeBucketSchema.nullable(),
|
|
2175
|
-
stars:
|
|
2607
|
+
stars: z33.number()
|
|
2176
2608
|
});
|
|
2177
2609
|
var repoListResponseSchema = listResponseSchema(repoSchema);
|
|
2178
|
-
var addRepoBodySchema =
|
|
2179
|
-
url:
|
|
2610
|
+
var addRepoBodySchema = z33.object({
|
|
2611
|
+
url: z33.string().min(1, "url is required"),
|
|
2180
2612
|
/**
|
|
2181
2613
|
* Reserved (accepted, not yet persisted): the catalog keys repos by URL only
|
|
2182
2614
|
* — `fact_repo` has no ref column and metadata sync always reads the default
|
|
2183
2615
|
* branch. Kept in the wire format so `gauge repos add --ref` is stable once
|
|
2184
2616
|
* the catalog learns refs.
|
|
2185
2617
|
*/
|
|
2186
|
-
ref:
|
|
2618
|
+
ref: z33.string().min(1).optional(),
|
|
2187
2619
|
/** Display name; defaults to the `owner/repo` label of the URL. */
|
|
2188
|
-
name:
|
|
2620
|
+
name: z33.string().min(1).optional(),
|
|
2189
2621
|
/** Manual override; defaults to frameworks detected from the repo's manifests. */
|
|
2190
|
-
frameworks:
|
|
2191
|
-
tags:
|
|
2622
|
+
frameworks: z33.array(z33.string()).optional(),
|
|
2623
|
+
tags: z33.array(z33.string()).optional()
|
|
2192
2624
|
});
|
|
2193
|
-
var updateRepoBodySchema =
|
|
2194
|
-
url:
|
|
2195
|
-
name:
|
|
2196
|
-
frameworks:
|
|
2197
|
-
tags:
|
|
2625
|
+
var updateRepoBodySchema = z33.object({
|
|
2626
|
+
url: z33.string().min(1, "url is required"),
|
|
2627
|
+
name: z33.string().min(1).optional(),
|
|
2628
|
+
frameworks: z33.array(z33.string()).optional(),
|
|
2629
|
+
tags: z33.array(z33.string()).optional()
|
|
2198
2630
|
});
|
|
2199
|
-
var resyncRepoBodySchema =
|
|
2200
|
-
url:
|
|
2631
|
+
var resyncRepoBodySchema = z33.object({
|
|
2632
|
+
url: z33.string().min(1, "url is required")
|
|
2201
2633
|
});
|
|
2202
|
-
var deleteRepoQuerySchema =
|
|
2203
|
-
url:
|
|
2634
|
+
var deleteRepoQuerySchema = z33.object({
|
|
2635
|
+
url: z33.string().min(1, "url is required")
|
|
2204
2636
|
});
|
|
2205
|
-
var repoSyncResultSchema =
|
|
2637
|
+
var repoSyncResultSchema = z33.object({
|
|
2206
2638
|
repo: repoSchema,
|
|
2207
|
-
synced:
|
|
2208
|
-
});
|
|
2209
|
-
|
|
2210
|
-
// ../packages/api-schemas/src/runs.ts
|
|
2211
|
-
import { z as z30 } from "zod";
|
|
2212
|
-
var RUN_STATUSES = [
|
|
2213
|
-
"QUEUED",
|
|
2214
|
-
"CLAIMED",
|
|
2215
|
-
"PROVISIONING",
|
|
2216
|
-
"RUNNING",
|
|
2217
|
-
"SUCCEEDED",
|
|
2218
|
-
"FAILED",
|
|
2219
|
-
"TIMED_OUT",
|
|
2220
|
-
"CANCELED"
|
|
2221
|
-
];
|
|
2222
|
-
var runStatusSchema = z30.enum(RUN_STATUSES);
|
|
2223
|
-
var AGENTS2 = ["CLAUDE_CODE", "CODEX_CLI", "CURSOR"];
|
|
2224
|
-
var agentSchema2 = z30.enum(AGENTS2);
|
|
2225
|
-
var runStatusFilterSchema = z30.string().transform(
|
|
2226
|
-
(raw) => raw.split(",").map((s) => s.trim().toUpperCase()).filter(Boolean)
|
|
2227
|
-
).pipe(z30.array(runStatusSchema).min(1));
|
|
2228
|
-
var runListQuerySchema = listQuerySchema.extend({
|
|
2229
|
-
status: runStatusFilterSchema.optional(),
|
|
2230
|
-
batch: z30.string().optional(),
|
|
2231
|
-
prompt: z30.string().optional(),
|
|
2232
|
-
experiment: z30.string().optional(),
|
|
2233
|
-
evalSet: z30.string().optional(),
|
|
2234
|
-
since: z30.string().optional()
|
|
2235
|
-
});
|
|
2236
|
-
var runListItemSchema = z30.object({
|
|
2237
|
-
id: z30.string(),
|
|
2238
|
-
status: runStatusSchema,
|
|
2239
|
-
agent: agentSchema2,
|
|
2240
|
-
model: z30.string(),
|
|
2241
|
-
promptId: z30.string(),
|
|
2242
|
-
/** First ~80 chars of the batch's prompt snapshot, whitespace-collapsed. */
|
|
2243
|
-
promptSnippet: z30.string(),
|
|
2244
|
-
batchId: z30.string(),
|
|
2245
|
-
experiment: z30.string().nullable(),
|
|
2246
|
-
/** The eval set whose expansion (or backfill) minted the batch; null for
|
|
2247
|
-
* schedule/visibility/ad-hoc runs. */
|
|
2248
|
-
evalSetId: z30.string().nullable(),
|
|
2249
|
-
turns: z30.number().int().nullable(),
|
|
2250
|
-
usdCost: z30.number().nullable(),
|
|
2251
|
-
durationMs: z30.number().int().nullable(),
|
|
2252
|
-
exitReason: z30.string().nullable(),
|
|
2253
|
-
createdAt: z30.string(),
|
|
2254
|
-
startedAt: z30.string().nullable(),
|
|
2255
|
-
finishedAt: z30.string().nullable(),
|
|
2256
|
-
/** Fork lineage (fork-simulations WS1): the source run this was forked from,
|
|
2257
|
-
* or null for an organic run. Forks are excluded from aggregate analytics but
|
|
2258
|
-
* kept visible; consumers badge on these fields. */
|
|
2259
|
-
parentRunId: z30.string().nullable(),
|
|
2260
|
-
/** Set when this run is a fetch-fork simulation variant (injected web
|
|
2261
|
-
* content); null otherwise. Distinguishes a "Simulation" badge from a plain
|
|
2262
|
-
* conversation fork. */
|
|
2263
|
-
fetchForkPlanId: z30.string().nullable()
|
|
2264
|
-
});
|
|
2265
|
-
var runListResponseSchema = listResponseSchema(runListItemSchema);
|
|
2266
|
-
var runDetailSchema = runListItemSchema.omit({ promptSnippet: true }).extend({
|
|
2267
|
-
promptText: z30.string(),
|
|
2268
|
-
attempt: z30.number().int(),
|
|
2269
|
-
cancelRequested: z30.boolean(),
|
|
2270
|
-
failureReason: z30.string().nullable(),
|
|
2271
|
-
repoUrl: z30.string().nullable(),
|
|
2272
|
-
repoRef: z30.string().nullable(),
|
|
2273
|
-
scenario: z30.string(),
|
|
2274
|
-
funding: z30.string(),
|
|
2275
|
-
/** Raw harness usage write-back (token counts etc.); shape may evolve. */
|
|
2276
|
-
usage: z30.unknown().nullable(),
|
|
2277
|
-
/** Artifact pointer: a working-tree diff exists at GET /runs/{id}/diff. */
|
|
2278
|
-
hasDiff: z30.boolean(),
|
|
2279
|
-
claimedAt: z30.string().nullable(),
|
|
2280
|
-
/** Judged criteria verdicts for eval-set runs (empty otherwise). `name`
|
|
2281
|
-
* is the judge-time snapshot; `criterionId` is null once the criterion
|
|
2282
|
-
* was deleted from its set. */
|
|
2283
|
-
criterionResults: z30.array(
|
|
2284
|
-
z30.object({
|
|
2285
|
-
criterionId: z30.string().nullable(),
|
|
2286
|
-
name: z30.string(),
|
|
2287
|
-
passed: z30.boolean(),
|
|
2288
|
-
reasoning: z30.string().nullable()
|
|
2289
|
-
})
|
|
2290
|
-
)
|
|
2291
|
-
});
|
|
2292
|
-
var cancelRunResponseSchema = z30.object({
|
|
2293
|
-
id: z30.string(),
|
|
2294
|
-
status: runStatusSchema,
|
|
2295
|
-
cancelRequested: z30.boolean(),
|
|
2296
|
-
note: z30.string().optional()
|
|
2297
|
-
});
|
|
2298
|
-
var forkRunBodySchema = z30.object({
|
|
2299
|
-
prompt: z30.string().trim().min(1).max(2e4),
|
|
2300
|
-
turn: z30.number().int().min(0).optional(),
|
|
2301
|
-
webFixture: webFixtureSchema.optional()
|
|
2302
|
-
});
|
|
2303
|
-
var forkRunResponseSchema = z30.object({
|
|
2304
|
-
runId: z30.string(),
|
|
2305
|
-
batchId: z30.string(),
|
|
2306
|
-
parentRunId: z30.string(),
|
|
2307
|
-
checkpointId: z30.string(),
|
|
2308
|
-
turn: z30.number().int().min(0)
|
|
2309
|
-
});
|
|
2310
|
-
var fetchForkAtFetchBodySchema = z30.object({
|
|
2311
|
-
boundarySeq: z30.string().min(1),
|
|
2312
|
-
injectedContent: z30.string(),
|
|
2313
|
-
prompts: z30.array(z30.string()).min(1)
|
|
2314
|
-
});
|
|
2315
|
-
var fetchForkAtFetchResponseSchema = z30.object({
|
|
2316
|
-
planId: z30.string()
|
|
2317
|
-
});
|
|
2318
|
-
var fetchForkPlanStatusSchema = z30.enum([
|
|
2319
|
-
"DRAFT",
|
|
2320
|
-
"SURGERY_RUNNING",
|
|
2321
|
-
"SURGERY_READY",
|
|
2322
|
-
"FORKED",
|
|
2323
|
-
"FAILED"
|
|
2324
|
-
]);
|
|
2325
|
-
var fetchForkPlanResponseSchema = z30.object({
|
|
2326
|
-
id: z30.string(),
|
|
2327
|
-
status: fetchForkPlanStatusSchema,
|
|
2328
|
-
boundaryUrl: z30.string(),
|
|
2329
|
-
boundaryTurn: z30.number().int(),
|
|
2330
|
-
prompts: z30.array(z30.string()),
|
|
2331
|
-
surgicalCheckpointId: z30.string().nullable(),
|
|
2332
|
-
forkBatchId: z30.string().nullable(),
|
|
2333
|
-
errorText: z30.string().nullable(),
|
|
2334
|
-
forkedRunIds: z30.array(z30.string())
|
|
2335
|
-
});
|
|
2336
|
-
var RUN_INSIGHT_STATUSES = [
|
|
2337
|
-
"PENDING",
|
|
2338
|
-
"RUNNING",
|
|
2339
|
-
"COMPLETE",
|
|
2340
|
-
"FAILED",
|
|
2341
|
-
"SKIPPED"
|
|
2342
|
-
];
|
|
2343
|
-
var runInsightStatusSchema = z30.enum(RUN_INSIGHT_STATUSES);
|
|
2344
|
-
var insightPassSchema = z30.object({
|
|
2345
|
-
status: runInsightStatusSchema,
|
|
2346
|
-
model: z30.string().nullable(),
|
|
2347
|
-
inputTokens: z30.number().int().nullable(),
|
|
2348
|
-
outputTokens: z30.number().int().nullable(),
|
|
2349
|
-
usdCost: z30.number().nullable(),
|
|
2350
|
-
error: z30.string().nullable()
|
|
2351
|
-
});
|
|
2352
|
-
var runDecisionSchema = z30.object({
|
|
2353
|
-
index: z30.number().int(),
|
|
2354
|
-
category: z30.string(),
|
|
2355
|
-
categoryRaw: z30.string().nullable(),
|
|
2356
|
-
chosenName: z30.string(),
|
|
2357
|
-
chosenEcosystem: z30.string().nullable(),
|
|
2358
|
-
chosenPackage: z30.string().nullable(),
|
|
2359
|
-
reversed: z30.boolean(),
|
|
2360
|
-
detail: z30.unknown()
|
|
2361
|
-
});
|
|
2362
|
-
var runImplementationSchema = z30.object({
|
|
2363
|
-
brandName: z30.string(),
|
|
2364
|
-
ecosystem: z30.string().nullable(),
|
|
2365
|
-
package: z30.string().nullable(),
|
|
2366
|
-
verdict: z30.string(),
|
|
2367
|
-
docConsulted: z30.boolean(),
|
|
2368
|
-
detail: z30.unknown()
|
|
2369
|
-
});
|
|
2370
|
-
var RUN_INSIGHT_PASS_KINDS = [
|
|
2371
|
-
"INSTALL",
|
|
2372
|
-
"DECISION",
|
|
2373
|
-
"EVAL",
|
|
2374
|
-
"INTEGRATION",
|
|
2375
|
-
"EXPERIMENT_DELTA",
|
|
2376
|
-
"VISIBILITY"
|
|
2377
|
-
];
|
|
2378
|
-
var runInsightPassKindSchema = z30.enum(RUN_INSIGHT_PASS_KINDS);
|
|
2379
|
-
var insightPipelinePassSchema = insightPassSchema.extend({
|
|
2380
|
-
kind: runInsightPassKindSchema
|
|
2381
|
-
});
|
|
2382
|
-
var runInsightResponseSchema = z30.object({
|
|
2383
|
-
runId: z30.string(),
|
|
2384
|
-
decision: insightPassSchema,
|
|
2385
|
-
implementation: insightPassSchema,
|
|
2386
|
-
passes: z30.array(insightPipelinePassSchema),
|
|
2387
|
-
decisions: z30.array(runDecisionSchema),
|
|
2388
|
-
implementations: z30.array(runImplementationSchema),
|
|
2389
|
-
experimentDelta: z30.unknown().nullable(),
|
|
2390
|
-
/** The VISIBILITY pass's output (winners/picks) — loose server JSON, null
|
|
2391
|
-
* for non-visibility runs or before the pass completes. */
|
|
2392
|
-
visibilityVerdict: z30.unknown().nullable()
|
|
2393
|
-
});
|
|
2394
|
-
var runEventSchema = z30.looseObject({
|
|
2395
|
-
run_id: z30.string(),
|
|
2396
|
-
seq: z30.number(),
|
|
2397
|
-
turn: z30.number(),
|
|
2398
|
-
ts: z30.string(),
|
|
2399
|
-
type: z30.string()
|
|
2639
|
+
synced: z33.boolean()
|
|
2400
2640
|
});
|
|
2401
2641
|
|
|
2402
2642
|
// ../packages/api-schemas/src/summary.ts
|
|
2403
|
-
import { z as
|
|
2643
|
+
import { z as z34 } from "zod";
|
|
2404
2644
|
function cardResultSchema(data) {
|
|
2405
|
-
return
|
|
2406
|
-
|
|
2407
|
-
|
|
2645
|
+
return z34.union([
|
|
2646
|
+
z34.object({ ok: z34.literal(true), data }),
|
|
2647
|
+
z34.object({ ok: z34.literal(false), error: z34.string() })
|
|
2408
2648
|
]);
|
|
2409
2649
|
}
|
|
2410
|
-
var summaryActionSchema =
|
|
2411
|
-
id:
|
|
2412
|
-
title:
|
|
2413
|
-
priority:
|
|
2414
|
-
status:
|
|
2415
|
-
evidenceCount:
|
|
2416
|
-
});
|
|
2417
|
-
var summaryAeCardSchema =
|
|
2418
|
-
id:
|
|
2419
|
-
name:
|
|
2420
|
-
judgedRuns:
|
|
2421
|
-
passRate:
|
|
2650
|
+
var summaryActionSchema = z34.object({
|
|
2651
|
+
id: z34.string(),
|
|
2652
|
+
title: z34.string(),
|
|
2653
|
+
priority: z34.string(),
|
|
2654
|
+
status: z34.string(),
|
|
2655
|
+
evidenceCount: z34.number().int()
|
|
2656
|
+
});
|
|
2657
|
+
var summaryAeCardSchema = z34.object({
|
|
2658
|
+
id: z34.string(),
|
|
2659
|
+
name: z34.string(),
|
|
2660
|
+
judgedRuns: z34.number().int(),
|
|
2661
|
+
passRate: z34.number().nullable(),
|
|
2422
2662
|
/** pp delta vs the prior 30d; null with no prior. */
|
|
2423
|
-
deltaPP:
|
|
2424
|
-
});
|
|
2425
|
-
var summaryVisibilityCardSchema =
|
|
2426
|
-
name:
|
|
2427
|
-
owned:
|
|
2428
|
-
name:
|
|
2429
|
-
rank:
|
|
2430
|
-
chosenRate:
|
|
2431
|
-
mentionRate:
|
|
2663
|
+
deltaPP: z34.number().nullable()
|
|
2664
|
+
});
|
|
2665
|
+
var summaryVisibilityCardSchema = z34.object({
|
|
2666
|
+
name: z34.string(),
|
|
2667
|
+
owned: z34.object({
|
|
2668
|
+
name: z34.string(),
|
|
2669
|
+
rank: z34.number(),
|
|
2670
|
+
chosenRate: z34.number(),
|
|
2671
|
+
mentionRate: z34.number()
|
|
2432
2672
|
}).nullable(),
|
|
2433
|
-
chosenDeltaPP:
|
|
2673
|
+
chosenDeltaPP: z34.number().nullable()
|
|
2434
2674
|
});
|
|
2435
|
-
var homeSummarySchema =
|
|
2436
|
-
hasAnyRuns:
|
|
2437
|
-
lastSynthesisAt:
|
|
2438
|
-
actions: cardResultSchema(
|
|
2675
|
+
var homeSummarySchema = z34.object({
|
|
2676
|
+
hasAnyRuns: z34.boolean(),
|
|
2677
|
+
lastSynthesisAt: z34.string().nullable(),
|
|
2678
|
+
actions: cardResultSchema(z34.array(summaryActionSchema)),
|
|
2439
2679
|
visibility: cardResultSchema(
|
|
2440
|
-
|
|
2441
|
-
cards:
|
|
2442
|
-
marketsTotal:
|
|
2443
|
-
promptCount:
|
|
2680
|
+
z34.object({
|
|
2681
|
+
cards: z34.array(summaryVisibilityCardSchema),
|
|
2682
|
+
marketsTotal: z34.number().int(),
|
|
2683
|
+
promptCount: z34.number().int()
|
|
2444
2684
|
})
|
|
2445
2685
|
),
|
|
2446
2686
|
agentExperience: cardResultSchema(
|
|
2447
|
-
|
|
2448
|
-
cards:
|
|
2449
|
-
total:
|
|
2450
|
-
setCount:
|
|
2687
|
+
z34.object({
|
|
2688
|
+
cards: z34.array(summaryAeCardSchema),
|
|
2689
|
+
total: z34.number().int(),
|
|
2690
|
+
setCount: z34.number().int()
|
|
2451
2691
|
})
|
|
2452
2692
|
),
|
|
2453
|
-
notableSessions: cardResultSchema(
|
|
2693
|
+
notableSessions: cardResultSchema(z34.array(z34.unknown()))
|
|
2454
2694
|
});
|
|
2455
2695
|
|
|
2456
2696
|
// ../packages/api-schemas/src/tokens.ts
|
|
2457
|
-
import { z as
|
|
2458
|
-
var apiTokenSchema =
|
|
2459
|
-
id:
|
|
2460
|
-
name:
|
|
2697
|
+
import { z as z35 } from "zod";
|
|
2698
|
+
var apiTokenSchema = z35.object({
|
|
2699
|
+
id: z35.string(),
|
|
2700
|
+
name: z35.string(),
|
|
2461
2701
|
/** Last 4 chars of the plaintext, for recognizability (non-secret). */
|
|
2462
|
-
last4:
|
|
2463
|
-
expiresAt:
|
|
2464
|
-
lastUsedAt:
|
|
2465
|
-
createdAt:
|
|
2466
|
-
revokedAt:
|
|
2467
|
-
});
|
|
2468
|
-
var createTokenRequestSchema =
|
|
2469
|
-
name:
|
|
2702
|
+
last4: z35.string(),
|
|
2703
|
+
expiresAt: z35.iso.datetime().nullable(),
|
|
2704
|
+
lastUsedAt: z35.iso.datetime().nullable(),
|
|
2705
|
+
createdAt: z35.iso.datetime(),
|
|
2706
|
+
revokedAt: z35.iso.datetime().nullable()
|
|
2707
|
+
});
|
|
2708
|
+
var createTokenRequestSchema = z35.object({
|
|
2709
|
+
name: z35.string().min(1).max(100),
|
|
2470
2710
|
/** ISO-8601 datetime; omit for no expiry. */
|
|
2471
|
-
expiresAt:
|
|
2711
|
+
expiresAt: z35.iso.datetime({ offset: true }).optional()
|
|
2472
2712
|
});
|
|
2473
2713
|
var createTokenResponseSchema = apiTokenSchema.extend({
|
|
2474
|
-
token:
|
|
2714
|
+
token: z35.string()
|
|
2475
2715
|
});
|
|
2476
2716
|
var listTokensResponseSchema = listResponseSchema(apiTokenSchema);
|
|
2477
2717
|
|
|
2478
2718
|
// ../packages/api-schemas/src/visibility.ts
|
|
2479
|
-
import { z as
|
|
2719
|
+
import { z as z36 } from "zod";
|
|
2480
2720
|
var VISIBILITY_PROMPT_KINDS = ["HEAD_TO_HEAD", "RECOMMEND"];
|
|
2481
|
-
var visibilityPromptKindSchema =
|
|
2482
|
-
var visibilityPromptSchema =
|
|
2483
|
-
id:
|
|
2721
|
+
var visibilityPromptKindSchema = z36.enum(VISIBILITY_PROMPT_KINDS);
|
|
2722
|
+
var visibilityPromptSchema = z36.object({
|
|
2723
|
+
id: z36.string(),
|
|
2484
2724
|
kind: visibilityPromptKindSchema,
|
|
2485
|
-
promptText:
|
|
2725
|
+
promptText: z36.string(),
|
|
2486
2726
|
/** HEAD_TO_HEAD is always branded; RECOMMEND may be either. */
|
|
2487
|
-
branded:
|
|
2488
|
-
brandA:
|
|
2489
|
-
brandB:
|
|
2727
|
+
branded: z36.boolean(),
|
|
2728
|
+
brandA: z36.string().nullable(),
|
|
2729
|
+
brandB: z36.string().nullable(),
|
|
2490
2730
|
/** null = the greenfield scaffold. */
|
|
2491
|
-
repoUrl:
|
|
2492
|
-
repoRef:
|
|
2493
|
-
market:
|
|
2494
|
-
position:
|
|
2495
|
-
enabled:
|
|
2496
|
-
createdAt:
|
|
2731
|
+
repoUrl: z36.string().nullable(),
|
|
2732
|
+
repoRef: z36.string().nullable(),
|
|
2733
|
+
market: z36.object({ id: z36.string(), slug: z36.string(), name: z36.string() }).nullable(),
|
|
2734
|
+
position: z36.number().int(),
|
|
2735
|
+
enabled: z36.boolean(),
|
|
2736
|
+
createdAt: z36.string(),
|
|
2497
2737
|
cycle: cycleSchema,
|
|
2498
2738
|
/** User tag names on the hidden backing prompt (Surface:* excluded). */
|
|
2499
|
-
tags:
|
|
2500
|
-
runCount:
|
|
2501
|
-
lastRunAt:
|
|
2739
|
+
tags: z36.array(z36.string()),
|
|
2740
|
+
runCount: z36.number().int(),
|
|
2741
|
+
lastRunAt: z36.string().nullable(),
|
|
2502
2742
|
/** ALL attached presets in expansion order — every one runs each cycle.
|
|
2503
2743
|
* The flattened repoUrl/repoRef above mirror the primary only. */
|
|
2504
|
-
runPresets:
|
|
2744
|
+
runPresets: z36.array(runPresetSummarySchema)
|
|
2505
2745
|
});
|
|
2506
|
-
var listVisibilityPromptsResponseSchema =
|
|
2507
|
-
items:
|
|
2746
|
+
var listVisibilityPromptsResponseSchema = z36.object({
|
|
2747
|
+
items: z36.array(visibilityPromptSchema)
|
|
2508
2748
|
});
|
|
2509
|
-
var createVisibilityPromptBodySchema =
|
|
2510
|
-
promptText:
|
|
2749
|
+
var createVisibilityPromptBodySchema = z36.object({
|
|
2750
|
+
promptText: z36.string().min(1),
|
|
2511
2751
|
kind: visibilityPromptKindSchema,
|
|
2512
|
-
branded:
|
|
2752
|
+
branded: z36.boolean().optional(),
|
|
2513
2753
|
/** Required pair for HEAD_TO_HEAD (order-independent). */
|
|
2514
|
-
brandA:
|
|
2515
|
-
brandB:
|
|
2516
|
-
repoUrl:
|
|
2517
|
-
repoRef:
|
|
2754
|
+
brandA: z36.string().nullish(),
|
|
2755
|
+
brandB: z36.string().nullish(),
|
|
2756
|
+
repoUrl: z36.string().nullish(),
|
|
2757
|
+
repoRef: z36.string().nullish(),
|
|
2518
2758
|
/** Measured market id from the org's tracked set. */
|
|
2519
|
-
marketId:
|
|
2520
|
-
enabled:
|
|
2521
|
-
tags:
|
|
2759
|
+
marketId: z36.string().nullish(),
|
|
2760
|
+
enabled: z36.boolean().optional(),
|
|
2761
|
+
tags: z36.array(z36.string()).optional(),
|
|
2522
2762
|
/** Attach these existing presets, in order. When either preset field is
|
|
2523
2763
|
* present the repo fields above are ignored for configuration (D2). */
|
|
2524
|
-
runPresetIds:
|
|
2764
|
+
runPresetIds: z36.array(z36.string().min(1)).optional(),
|
|
2525
2765
|
/** Mint a saved preset and attach it (after runPresetIds). */
|
|
2526
2766
|
newPreset: inlinePresetSchema.optional()
|
|
2527
2767
|
});
|
|
2528
|
-
var synthesizeResponseSchema =
|
|
2768
|
+
var synthesizeResponseSchema = z36.object({
|
|
2529
2769
|
/** False when the pre-check found no new evidence and nothing was queued. */
|
|
2530
|
-
queued:
|
|
2531
|
-
});
|
|
2532
|
-
var updateVisibilityPromptBodySchema =
|
|
2533
|
-
promptText:
|
|
2534
|
-
branded:
|
|
2535
|
-
brandA:
|
|
2536
|
-
brandB:
|
|
2537
|
-
repoUrl:
|
|
2538
|
-
repoRef:
|
|
2539
|
-
marketId:
|
|
2540
|
-
enabled:
|
|
2541
|
-
tags:
|
|
2542
|
-
});
|
|
2543
|
-
var runVisibilityPromptResponseSchema =
|
|
2544
|
-
batchIds:
|
|
2545
|
-
runIds:
|
|
2546
|
-
});
|
|
2547
|
-
var visibilityPromptRunSchema =
|
|
2548
|
-
id:
|
|
2549
|
-
status:
|
|
2550
|
-
agent:
|
|
2551
|
-
model:
|
|
2552
|
-
resolvedModel:
|
|
2553
|
-
createdAt:
|
|
2554
|
-
startedAt:
|
|
2555
|
-
finishedAt:
|
|
2556
|
-
failureReason:
|
|
2557
|
-
verdict:
|
|
2558
|
-
status:
|
|
2559
|
-
error:
|
|
2560
|
-
payload:
|
|
2770
|
+
queued: z36.boolean()
|
|
2771
|
+
});
|
|
2772
|
+
var updateVisibilityPromptBodySchema = z36.object({
|
|
2773
|
+
promptText: z36.string().min(1).optional(),
|
|
2774
|
+
branded: z36.boolean().optional(),
|
|
2775
|
+
brandA: z36.string().nullish(),
|
|
2776
|
+
brandB: z36.string().nullish(),
|
|
2777
|
+
repoUrl: z36.string().nullish(),
|
|
2778
|
+
repoRef: z36.string().nullish(),
|
|
2779
|
+
marketId: z36.string().nullish(),
|
|
2780
|
+
enabled: z36.boolean().optional(),
|
|
2781
|
+
tags: z36.array(z36.string()).optional()
|
|
2782
|
+
});
|
|
2783
|
+
var runVisibilityPromptResponseSchema = z36.object({
|
|
2784
|
+
batchIds: z36.array(z36.string()),
|
|
2785
|
+
runIds: z36.array(z36.string())
|
|
2786
|
+
});
|
|
2787
|
+
var visibilityPromptRunSchema = z36.object({
|
|
2788
|
+
id: z36.string(),
|
|
2789
|
+
status: z36.string(),
|
|
2790
|
+
agent: agentSchema2,
|
|
2791
|
+
model: z36.string().nullable(),
|
|
2792
|
+
resolvedModel: z36.string().nullable(),
|
|
2793
|
+
createdAt: z36.string(),
|
|
2794
|
+
startedAt: z36.string().nullable(),
|
|
2795
|
+
finishedAt: z36.string().nullable(),
|
|
2796
|
+
failureReason: z36.string().nullable(),
|
|
2797
|
+
verdict: z36.object({
|
|
2798
|
+
status: z36.string(),
|
|
2799
|
+
error: z36.string().nullable(),
|
|
2800
|
+
payload: z36.unknown().nullable()
|
|
2561
2801
|
}).nullable()
|
|
2562
2802
|
});
|
|
2563
|
-
var listVisibilityPromptRunsResponseSchema =
|
|
2564
|
-
items:
|
|
2803
|
+
var listVisibilityPromptRunsResponseSchema = z36.object({
|
|
2804
|
+
items: z36.array(visibilityPromptRunSchema)
|
|
2565
2805
|
});
|
|
2566
|
-
var orgMarketSchema =
|
|
2567
|
-
marketId:
|
|
2568
|
-
slug:
|
|
2569
|
-
name:
|
|
2806
|
+
var orgMarketSchema = z36.object({
|
|
2807
|
+
marketId: z36.string(),
|
|
2808
|
+
slug: z36.string(),
|
|
2809
|
+
name: z36.string(),
|
|
2570
2810
|
/** The one line saying what the market measures. */
|
|
2571
|
-
capability:
|
|
2811
|
+
capability: z36.string(),
|
|
2572
2812
|
/** SUGGESTED (the matcher) | USER (a human picked it). */
|
|
2573
|
-
source:
|
|
2813
|
+
source: z36.string()
|
|
2574
2814
|
});
|
|
2575
2815
|
var addableMarketSchema = orgMarketSchema.omit({ source: true });
|
|
2576
|
-
var listMarketsResponseSchema =
|
|
2577
|
-
tracked:
|
|
2816
|
+
var listMarketsResponseSchema = z36.object({
|
|
2817
|
+
tracked: z36.array(orgMarketSchema),
|
|
2578
2818
|
/** Published markets the org does not track yet (closed set — no free-text
|
|
2579
2819
|
* market creation). */
|
|
2580
|
-
addable:
|
|
2820
|
+
addable: z36.array(addableMarketSchema)
|
|
2581
2821
|
});
|
|
2582
|
-
var addMarketBodySchema =
|
|
2822
|
+
var addMarketBodySchema = z36.object({ marketId: z36.string().min(1) });
|
|
2583
2823
|
|
|
2584
2824
|
// src/version.ts
|
|
2585
2825
|
import { createRequire } from "module";
|
|
@@ -2962,7 +3202,7 @@ __export(apply_exports, {
|
|
|
2962
3202
|
register: () => register2
|
|
2963
3203
|
});
|
|
2964
3204
|
import { readFileSync as readFileSync3 } from "fs";
|
|
2965
|
-
import { z as
|
|
3205
|
+
import { z as z37 } from "zod";
|
|
2966
3206
|
var EXAMPLE_SPEC = {
|
|
2967
3207
|
version: 1,
|
|
2968
3208
|
expand: true,
|
|
@@ -3084,7 +3324,7 @@ function register2(program2) {
|
|
|
3084
3324
|
).option("-f, --file <path>", "battery spec JSON file").option("--dry-run", "print the plan without applying").option("--schema", "print the battery spec JSON Schema and exit").option("--example", "print a minimal example battery spec and exit").action(
|
|
3085
3325
|
async (opts, command) => {
|
|
3086
3326
|
if (opts.schema) {
|
|
3087
|
-
printJson(
|
|
3327
|
+
printJson(z37.toJSONSchema(batteries_exports.batterySpecSchema));
|
|
3088
3328
|
return;
|
|
3089
3329
|
}
|
|
3090
3330
|
if (opts.example) {
|
|
@@ -3617,7 +3857,11 @@ var AGENT_ALIASES = {
|
|
|
3617
3857
|
codex: "CODEX_CLI",
|
|
3618
3858
|
"codex-cli": "CODEX_CLI",
|
|
3619
3859
|
codex_cli: "CODEX_CLI",
|
|
3620
|
-
cursor: "CURSOR"
|
|
3860
|
+
cursor: "CURSOR",
|
|
3861
|
+
pi: "PI",
|
|
3862
|
+
opencode: "OPENCODE",
|
|
3863
|
+
"open-code": "OPENCODE",
|
|
3864
|
+
open_code: "OPENCODE"
|
|
3621
3865
|
};
|
|
3622
3866
|
function parseAgents(raw) {
|
|
3623
3867
|
const out = [];
|
|
@@ -3628,7 +3872,7 @@ function parseAgents(raw) {
|
|
|
3628
3872
|
if (!agent) {
|
|
3629
3873
|
throw new CliError(
|
|
3630
3874
|
"usage",
|
|
3631
|
-
`unknown agent "${name}" (expected: claude-code, codex, cursor)`
|
|
3875
|
+
`unknown agent "${name}" (expected: claude-code, codex, cursor, pi, opencode)`
|
|
3632
3876
|
);
|
|
3633
3877
|
}
|
|
3634
3878
|
out.push(agent);
|
|
@@ -3643,13 +3887,13 @@ function parseAgentSpec(raw) {
|
|
|
3643
3887
|
if (!agent) {
|
|
3644
3888
|
throw new CliError(
|
|
3645
3889
|
"usage",
|
|
3646
|
-
`unknown agent "${name}" in --agent "${raw}" (expected: claude-code or
|
|
3890
|
+
`unknown agent "${name}" in --agent "${raw}" (expected: claude-code, codex, pi, or opencode, optionally ":model1,model2")`
|
|
3647
3891
|
);
|
|
3648
3892
|
}
|
|
3649
3893
|
if (agent === "CURSOR") {
|
|
3650
3894
|
throw new CliError(
|
|
3651
3895
|
"usage",
|
|
3652
|
-
"cursor is not schedulable \u2014 presets may roster claude-code and
|
|
3896
|
+
"cursor is not schedulable \u2014 presets may roster claude-code, codex, pi, and opencode"
|
|
3653
3897
|
);
|
|
3654
3898
|
}
|
|
3655
3899
|
const models = colon < 0 ? [] : raw.slice(colon + 1).split(",").map((m) => m.trim()).filter(Boolean);
|
|
@@ -3807,7 +4051,9 @@ function statusLines(s) {
|
|
|
3807
4051
|
"Overage",
|
|
3808
4052
|
s.overageEnabled ? `enabled (${s.overageThisPeriod} used${s.overageCapCredits === null ? ", uncapped" : `, cap ${s.overageCapCredits}`})` : "disabled"
|
|
3809
4053
|
],
|
|
3810
|
-
["Can run", s.
|
|
4054
|
+
["Can run eval", s.canRunByWorkload.eval ? "yes" : "no"],
|
|
4055
|
+
["Can run visibility", s.canRunByWorkload.visibility ? "yes" : "no"],
|
|
4056
|
+
["Can run generic", s.canRunByWorkload.generic ? "yes" : "no"],
|
|
3811
4057
|
["Billing enforced", s.enforced ? "yes" : "no"]
|
|
3812
4058
|
];
|
|
3813
4059
|
}
|
|
@@ -4366,7 +4612,9 @@ function presetsPath(org) {
|
|
|
4366
4612
|
var AGENT_LABELS = {
|
|
4367
4613
|
CLAUDE_CODE: "claude-code",
|
|
4368
4614
|
CODEX_CLI: "codex",
|
|
4369
|
-
CURSOR: "cursor"
|
|
4615
|
+
CURSOR: "cursor",
|
|
4616
|
+
PI: "pi",
|
|
4617
|
+
OPENCODE: "opencode"
|
|
4370
4618
|
};
|
|
4371
4619
|
function agentsLabel(agents) {
|
|
4372
4620
|
return agents.map((a) => {
|
|
@@ -4383,6 +4631,7 @@ function printPresetSummaryTable(presets) {
|
|
|
4383
4631
|
presets.map((p) => ({
|
|
4384
4632
|
id: p.id,
|
|
4385
4633
|
name: p.name,
|
|
4634
|
+
gauge: p.fromGauge ? "yes" : "",
|
|
4386
4635
|
saved: p.saved ? "yes" : "no",
|
|
4387
4636
|
repo: presetRepoLabel(p),
|
|
4388
4637
|
persona: p.profile?.name ?? "",
|
|
@@ -4396,6 +4645,8 @@ function printPresetSummaryTable(presets) {
|
|
|
4396
4645
|
function printDetail(p) {
|
|
4397
4646
|
console.log(`id: ${p.id}`);
|
|
4398
4647
|
console.log(`name: ${p.name}`);
|
|
4648
|
+
if (p.fromGauge) console.log("origin: from the Gauge catalog");
|
|
4649
|
+
if (p.description) console.log(`about: ${p.description}`);
|
|
4399
4650
|
console.log(`saved: ${p.saved ? "yes" : "no (anonymous)"}`);
|
|
4400
4651
|
console.log(`repo: ${presetRepoLabel(p)}`);
|
|
4401
4652
|
console.log(`persona: ${p.profile ? p.profile.name : "(default judge)"}`);
|
|
@@ -5084,13 +5335,37 @@ function register12(program2) {
|
|
|
5084
5335
|
).requiredOption("--run <runId>", "source run id").requiredOption(
|
|
5085
5336
|
"--boundary <seq>",
|
|
5086
5337
|
"opaque boundarySeq from `experiments boundaries`"
|
|
5087
|
-
).option("--problem <text>", "problem statement (derived if omitted)").
|
|
5338
|
+
).option("--problem <text>", "problem statement (derived if omitted)").option(
|
|
5339
|
+
"--mode <mode>",
|
|
5340
|
+
"who writes the rewrites: propose (default, Fixer proposes directions then writes each), direct (one --change instruction, one write), manual (no generation \u2014 the rewrite is seeded with the page the agent read)",
|
|
5341
|
+
"propose"
|
|
5342
|
+
).option(
|
|
5343
|
+
"--change <text>",
|
|
5344
|
+
"--mode direct only: the one change to make, in your words"
|
|
5345
|
+
).action(
|
|
5088
5346
|
async (opts, cmd) => {
|
|
5089
5347
|
const org = resolveOrg(cmd);
|
|
5348
|
+
const parsedMode = experiments_exports.experimentModeSchema.safeParse(
|
|
5349
|
+
opts.mode.toUpperCase()
|
|
5350
|
+
);
|
|
5351
|
+
if (!parsedMode.success) {
|
|
5352
|
+
throw new Error(
|
|
5353
|
+
`--mode must be one of ${experiments_exports.EXPERIMENT_MODES.map((m) => m.toLowerCase()).join(", ")}`
|
|
5354
|
+
);
|
|
5355
|
+
}
|
|
5356
|
+
const mode = parsedMode.data;
|
|
5357
|
+
if (mode === "DIRECT" && !opts.change?.trim()) {
|
|
5358
|
+
throw new Error("--mode direct requires --change <text>");
|
|
5359
|
+
}
|
|
5360
|
+
if (mode !== "DIRECT" && opts.change !== void 0) {
|
|
5361
|
+
throw new Error(`--change only applies to --mode direct`);
|
|
5362
|
+
}
|
|
5090
5363
|
const body = {
|
|
5091
5364
|
runId: opts.run,
|
|
5092
5365
|
boundarySeq: opts.boundary,
|
|
5093
|
-
...opts.problem !== void 0 ? { problemText: opts.problem } : {}
|
|
5366
|
+
...opts.problem !== void 0 ? { problemText: opts.problem } : {},
|
|
5367
|
+
mode,
|
|
5368
|
+
...opts.change !== void 0 ? { changeInstruction: opts.change.trim() } : {}
|
|
5094
5369
|
};
|
|
5095
5370
|
const result = await createClient().post(
|
|
5096
5371
|
experimentsPath(org),
|
|
@@ -5104,8 +5379,14 @@ function register12(program2) {
|
|
|
5104
5379
|
`${result.created ? "Created" : "Resumed"} experiment ${result.experimentId}`
|
|
5105
5380
|
);
|
|
5106
5381
|
console.log(`Problem: ${result.problemText}`);
|
|
5382
|
+
console.log(`Mode: ${result.mode.toLowerCase()}`);
|
|
5383
|
+
if (!result.created && result.mode !== mode) {
|
|
5384
|
+
console.error(
|
|
5385
|
+
`Note: this fetch already had a live ${result.mode.toLowerCase()} draft, so --mode ${mode.toLowerCase()} was not applied \u2014 that draft was resumed instead.`
|
|
5386
|
+
);
|
|
5387
|
+
}
|
|
5107
5388
|
console.error(
|
|
5108
|
-
`Tip: \`gauge experiments watch ${result.experimentId}\` follows the plan round`
|
|
5389
|
+
result.mode === "MANUAL" ? `Tip: \`gauge experiments get ${result.experimentId}\` shows the seeded rewrite once the page is recovered` : `Tip: \`gauge experiments watch ${result.experimentId}\` follows the ${result.mode === "DIRECT" ? "write" : "plan"} round`
|
|
5109
5390
|
);
|
|
5110
5391
|
}
|
|
5111
5392
|
);
|
|
@@ -5716,10 +5997,47 @@ function register16(program2) {
|
|
|
5716
5997
|
});
|
|
5717
5998
|
}
|
|
5718
5999
|
|
|
6000
|
+
// src/commands/models.ts
|
|
6001
|
+
var models_exports = {};
|
|
6002
|
+
__export(models_exports, {
|
|
6003
|
+
capabilityLabel: () => capabilityLabel,
|
|
6004
|
+
executionTargetsPath: () => executionTargetsPath,
|
|
6005
|
+
register: () => register17
|
|
6006
|
+
});
|
|
6007
|
+
function executionTargetsPath(org) {
|
|
6008
|
+
return `/api/v1/orgs/${encodeURIComponent(org)}/execution-targets`;
|
|
6009
|
+
}
|
|
6010
|
+
function capabilityLabel(capabilities) {
|
|
6011
|
+
return Object.entries(capabilities).filter(([, supported]) => supported).map(([name]) => name === "agentContext" ? "context" : name).join(", ");
|
|
6012
|
+
}
|
|
6013
|
+
function register17(program2) {
|
|
6014
|
+
const group = program2.command("models").description("Discover supported models, harnesses, and providers");
|
|
6015
|
+
group.command("list", { isDefault: true }).description("List execution targets available to the organization").action(async (_opts, cmd) => {
|
|
6016
|
+
const org = resolveOrg(cmd);
|
|
6017
|
+
const response = await createClient().get(
|
|
6018
|
+
executionTargetsPath(org)
|
|
6019
|
+
);
|
|
6020
|
+
if (resolveOutput(cmd) === "json") {
|
|
6021
|
+
printJson(response.items);
|
|
6022
|
+
return;
|
|
6023
|
+
}
|
|
6024
|
+
printItems(
|
|
6025
|
+
response.items.map((target) => ({
|
|
6026
|
+
model: target.model,
|
|
6027
|
+
name: target.modelLabel,
|
|
6028
|
+
harness: target.harnessSlug,
|
|
6029
|
+
provider: target.providerSlug,
|
|
6030
|
+
capabilities: capabilityLabel(target.capabilities)
|
|
6031
|
+
})),
|
|
6032
|
+
"table"
|
|
6033
|
+
);
|
|
6034
|
+
});
|
|
6035
|
+
}
|
|
6036
|
+
|
|
5719
6037
|
// src/commands/onboard.ts
|
|
5720
6038
|
var onboard_exports = {};
|
|
5721
6039
|
__export(onboard_exports, {
|
|
5722
|
-
register: () =>
|
|
6040
|
+
register: () => register18
|
|
5723
6041
|
});
|
|
5724
6042
|
function orgNameFromEmail(email) {
|
|
5725
6043
|
const domain = email?.split("@")[1] ?? "";
|
|
@@ -5727,7 +6045,7 @@ function orgNameFromEmail(email) {
|
|
|
5727
6045
|
if (!base) return "My Workspace";
|
|
5728
6046
|
return base.charAt(0).toUpperCase() + base.slice(1);
|
|
5729
6047
|
}
|
|
5730
|
-
function
|
|
6048
|
+
function register18(program2) {
|
|
5731
6049
|
program2.command("onboard").description(
|
|
5732
6050
|
"Self-serve onboarding: sign in (device flow) and create your first workspace"
|
|
5733
6051
|
).option("--email <email>", "email a sign-in link (device-flow convenience)").option("--org-name <name>", "workspace name (default: from your email)").option("--website <url>", "company site (scanned to seed the workspace)").option("--new", "create a new workspace even if you already belong to one").option(
|
|
@@ -5824,7 +6142,7 @@ Using workspace ${orgSlug}.`
|
|
|
5824
6142
|
// src/commands/org.ts
|
|
5825
6143
|
var org_exports = {};
|
|
5826
6144
|
__export(org_exports, {
|
|
5827
|
-
register: () =>
|
|
6145
|
+
register: () => register19
|
|
5828
6146
|
});
|
|
5829
6147
|
function printSettings(s) {
|
|
5830
6148
|
console.log(`slug: ${s.slug}`);
|
|
@@ -5838,7 +6156,7 @@ function printSettings(s) {
|
|
|
5838
6156
|
);
|
|
5839
6157
|
console.log(`auto-join: ${s.autoJoinDomain ?? "off"}`);
|
|
5840
6158
|
}
|
|
5841
|
-
function
|
|
6159
|
+
function register19(program2) {
|
|
5842
6160
|
const group = program2.command("org").description(
|
|
5843
6161
|
"This org's settings, read-only (see `gauge orgs` for the org list)"
|
|
5844
6162
|
);
|
|
@@ -5855,12 +6173,12 @@ function register18(program2) {
|
|
|
5855
6173
|
// src/commands/orgs.ts
|
|
5856
6174
|
var orgs_exports2 = {};
|
|
5857
6175
|
__export(orgs_exports2, {
|
|
5858
|
-
register: () =>
|
|
6176
|
+
register: () => register20
|
|
5859
6177
|
});
|
|
5860
6178
|
function isDefault(org, defaultOrg) {
|
|
5861
6179
|
return defaultOrg !== void 0 && (org.slug === defaultOrg || org.publicId === defaultOrg);
|
|
5862
6180
|
}
|
|
5863
|
-
function
|
|
6181
|
+
function register20(program2) {
|
|
5864
6182
|
const orgs = program2.command("orgs").description("Organizations");
|
|
5865
6183
|
orgs.command("list").description("List orgs you belong to").action(async (_opts, command) => {
|
|
5866
6184
|
const output = resolveOutput(command);
|
|
@@ -5931,12 +6249,12 @@ function register19(program2) {
|
|
|
5931
6249
|
// src/commands/personas.ts
|
|
5932
6250
|
var personas_exports2 = {};
|
|
5933
6251
|
__export(personas_exports2, {
|
|
5934
|
-
register: () =>
|
|
6252
|
+
register: () => register21
|
|
5935
6253
|
});
|
|
5936
6254
|
function personasPath(org) {
|
|
5937
6255
|
return `/api/v1/orgs/${encodeURIComponent(org)}/personas`;
|
|
5938
6256
|
}
|
|
5939
|
-
function
|
|
6257
|
+
function register21(program2) {
|
|
5940
6258
|
const group = program2.command("personas").description("Manage judge personas (referenced by presets)");
|
|
5941
6259
|
group.command("list").description("List the org's personas").action(async (_opts, cmd) => {
|
|
5942
6260
|
const org = resolveOrg(cmd);
|
|
@@ -6009,7 +6327,7 @@ function register20(program2) {
|
|
|
6009
6327
|
// src/commands/query.ts
|
|
6010
6328
|
var query_exports2 = {};
|
|
6011
6329
|
__export(query_exports2, {
|
|
6012
|
-
register: () =>
|
|
6330
|
+
register: () => register22
|
|
6013
6331
|
});
|
|
6014
6332
|
var collect3 = (value, prev = []) => [
|
|
6015
6333
|
...prev,
|
|
@@ -6201,7 +6519,7 @@ async function showMetadata(command, mode, dataset) {
|
|
|
6201
6519
|
console.error(`dataset: ${ds.name} \u2014 ${ds.grain}`);
|
|
6202
6520
|
printItems(rows, "table");
|
|
6203
6521
|
}
|
|
6204
|
-
function
|
|
6522
|
+
function register22(program2) {
|
|
6205
6523
|
const group = program2.command("query").description(
|
|
6206
6524
|
"Flexible reports over your event warehouse (run a report, or discover the catalog)"
|
|
6207
6525
|
);
|
|
@@ -6237,7 +6555,7 @@ function register21(program2) {
|
|
|
6237
6555
|
// src/commands/repos.ts
|
|
6238
6556
|
var repos_exports2 = {};
|
|
6239
6557
|
__export(repos_exports2, {
|
|
6240
|
-
register: () =>
|
|
6558
|
+
register: () => register23
|
|
6241
6559
|
});
|
|
6242
6560
|
function reposPath(org) {
|
|
6243
6561
|
return `/api/v1/orgs/${encodeURIComponent(org)}/repos`;
|
|
@@ -6260,7 +6578,7 @@ function toRow5(repo) {
|
|
|
6260
6578
|
function syncWarning(repo) {
|
|
6261
6579
|
return `warning: GitHub metadata sync failed; retry with \`gauge repos resync ${repo.url}\``;
|
|
6262
6580
|
}
|
|
6263
|
-
function
|
|
6581
|
+
function register23(program2) {
|
|
6264
6582
|
const repos = program2.command("repos").description("Manage repositories");
|
|
6265
6583
|
repos.command("list").description("List repositories (yours + read-only Gauge-provided ones)").action(async (_opts, command) => {
|
|
6266
6584
|
const org = resolveOrg(command);
|
|
@@ -6357,7 +6675,7 @@ function register22(program2) {
|
|
|
6357
6675
|
// src/commands/runs.ts
|
|
6358
6676
|
var runs_exports2 = {};
|
|
6359
6677
|
__export(runs_exports2, {
|
|
6360
|
-
register: () =>
|
|
6678
|
+
register: () => register24
|
|
6361
6679
|
});
|
|
6362
6680
|
function runPath(id) {
|
|
6363
6681
|
return `/api/v1/runs/${encodeURIComponent(id)}`;
|
|
@@ -6379,10 +6697,14 @@ function compact(value, max = 140) {
|
|
|
6379
6697
|
return one.length > max ? `${one.slice(0, max - 1)}\u2026` : one;
|
|
6380
6698
|
}
|
|
6381
6699
|
function toRow6(run) {
|
|
6700
|
+
const selected = run.selectedProvider?.slug ?? "";
|
|
6701
|
+
const observed = run.observedProvider?.slug;
|
|
6382
6702
|
return {
|
|
6383
6703
|
id: run.id,
|
|
6384
6704
|
status: run.status,
|
|
6385
6705
|
agent: run.agent,
|
|
6706
|
+
model: run.modelDisplayName ?? run.resolvedModel ?? run.model,
|
|
6707
|
+
provider: observed && observed !== selected ? `${selected || "?"} \u2192 ${observed}` : selected || observed || "",
|
|
6386
6708
|
experiment: run.experiment ?? "",
|
|
6387
6709
|
turns: run.turns ?? "",
|
|
6388
6710
|
cost: fmtUsd(run.usdCost),
|
|
@@ -6396,7 +6718,19 @@ function detailLines(run) {
|
|
|
6396
6718
|
["Id", run.id],
|
|
6397
6719
|
["Status", run.status],
|
|
6398
6720
|
["Agent", run.agent],
|
|
6399
|
-
[
|
|
6721
|
+
[
|
|
6722
|
+
"Model",
|
|
6723
|
+
run.modelDisplayName || run.resolvedModel || run.model || "(platform default)"
|
|
6724
|
+
],
|
|
6725
|
+
["Requested model", run.model || "(platform default)"],
|
|
6726
|
+
[
|
|
6727
|
+
"Selected provider",
|
|
6728
|
+
run.selectedProvider ? `${run.selectedProvider.displayName} (${run.selectedProvider.slug})` : "\u2014"
|
|
6729
|
+
],
|
|
6730
|
+
[
|
|
6731
|
+
"Observed provider",
|
|
6732
|
+
run.observedProvider ? `${run.observedProvider.slug} (${run.observedProvider.source.toLowerCase().replaceAll("_", " ")})` : "\u2014"
|
|
6733
|
+
],
|
|
6400
6734
|
["Prompt", compact(run.promptText, 120)],
|
|
6401
6735
|
["Prompt id", run.promptId],
|
|
6402
6736
|
["Batch", run.batchId],
|
|
@@ -6620,7 +6954,7 @@ async function streamRun(id, json, opts) {
|
|
|
6620
6954
|
if (drainTimer) clearTimeout(drainTimer);
|
|
6621
6955
|
}
|
|
6622
6956
|
}
|
|
6623
|
-
function
|
|
6957
|
+
function register24(program2) {
|
|
6624
6958
|
const runs = program2.command("runs").description("Inspect and manage runs");
|
|
6625
6959
|
runs.command("list").description("List runs (newest first)").option("--status <status>", "filter by status, e.g. running,queued").option("--batch <id>", "filter by batch").option("--prompt <id>", "filter by prompt").option("--experiment <experiment>", "filter by experiment label").option("--eval-set <id>", "filter by eval set").option("--since <window>", "e.g. 24h, 7d, or an ISO date").option("--limit <n>", "page size (1-200)", "50").option("--cursor <cursor>", "resume from a previous page's nextCursor").action(
|
|
6626
6960
|
async (opts, command) => {
|
|
@@ -6746,7 +7080,7 @@ function register23(program2) {
|
|
|
6746
7080
|
var skills_exports2 = {};
|
|
6747
7081
|
__export(skills_exports2, {
|
|
6748
7082
|
buildSkillEditBody: () => buildSkillEditBody,
|
|
6749
|
-
register: () =>
|
|
7083
|
+
register: () => register25
|
|
6750
7084
|
});
|
|
6751
7085
|
function skillsPath(org) {
|
|
6752
7086
|
return `/api/v1/orgs/${encodeURIComponent(org)}/skills`;
|
|
@@ -6808,7 +7142,7 @@ async function buildSkillEditBody(opts, fetchCurrentSource) {
|
|
|
6808
7142
|
throw new CliError("usage", "nothing to change");
|
|
6809
7143
|
return body;
|
|
6810
7144
|
}
|
|
6811
|
-
function
|
|
7145
|
+
function register25(program2) {
|
|
6812
7146
|
const group = program2.command("skills").description("Manage agent skills (staged into runs via preset refs)");
|
|
6813
7147
|
group.command("list").description("List the org's skills with their newest version").action(async (_opts, cmd) => {
|
|
6814
7148
|
const org = resolveOrg(cmd);
|
|
@@ -6949,7 +7283,7 @@ function register24(program2) {
|
|
|
6949
7283
|
// src/commands/stats.ts
|
|
6950
7284
|
var stats_exports2 = {};
|
|
6951
7285
|
__export(stats_exports2, {
|
|
6952
|
-
register: () =>
|
|
7286
|
+
register: () => register26
|
|
6953
7287
|
});
|
|
6954
7288
|
function addFilterOptions(cmd) {
|
|
6955
7289
|
return cmd.option("--prompt <id>", "filter to a single prompt").option("--tag <ids>", "comma-separated tag ids").option("--repo <urls>", "comma-separated base repo urls").option("--language <langs>", "comma-separated repo languages").option("--framework <names>", "comma-separated repo frameworks").option("--size <buckets>", "comma-separated codebase-size buckets").option("--branded", "only branded prompts").option("--unbranded", "only non-branded prompts").option("--limit <n>", "max rows (default 50)").option("--full", "return all rows (up to 1000)");
|
|
@@ -7032,7 +7366,7 @@ var domainRow = (r) => ({
|
|
|
7032
7366
|
rate: pct2(r.rate),
|
|
7033
7367
|
requests: r.requests
|
|
7034
7368
|
});
|
|
7035
|
-
function
|
|
7369
|
+
function register26(program2) {
|
|
7036
7370
|
const group = program2.command("stats").description("Read-only analytics over your runs");
|
|
7037
7371
|
addFilterOptions(
|
|
7038
7372
|
group.command("rankings").description("Brands ranked by install rate")
|
|
@@ -7064,7 +7398,7 @@ function register25(program2) {
|
|
|
7064
7398
|
// src/commands/status.ts
|
|
7065
7399
|
var status_exports = {};
|
|
7066
7400
|
__export(status_exports, {
|
|
7067
|
-
register: () =>
|
|
7401
|
+
register: () => register27
|
|
7068
7402
|
});
|
|
7069
7403
|
function pct3(rate) {
|
|
7070
7404
|
return rate == null ? "\u2014" : `${Math.round(rate * 100)}%`;
|
|
@@ -7074,7 +7408,7 @@ function delta2(pp) {
|
|
|
7074
7408
|
const rounded = Math.round(pp);
|
|
7075
7409
|
return rounded === 0 ? "" : ` (${rounded > 0 ? "+" : ""}${rounded}pp)`;
|
|
7076
7410
|
}
|
|
7077
|
-
function
|
|
7411
|
+
function register27(program2) {
|
|
7078
7412
|
program2.command("status").description("One-shot org summary: actions, visibility, agent experience").action(async (_opts, cmd) => {
|
|
7079
7413
|
const org = resolveOrg(cmd);
|
|
7080
7414
|
const s = await createClient().get(
|
|
@@ -7136,12 +7470,12 @@ function register26(program2) {
|
|
|
7136
7470
|
// src/commands/tags.ts
|
|
7137
7471
|
var tags_exports2 = {};
|
|
7138
7472
|
__export(tags_exports2, {
|
|
7139
|
-
register: () =>
|
|
7473
|
+
register: () => register28
|
|
7140
7474
|
});
|
|
7141
7475
|
function tagsPath(org) {
|
|
7142
7476
|
return `/api/v1/orgs/${encodeURIComponent(org)}/tags`;
|
|
7143
7477
|
}
|
|
7144
|
-
function
|
|
7478
|
+
function register28(program2) {
|
|
7145
7479
|
const group = program2.command("tags").description("Manage org tags");
|
|
7146
7480
|
group.command("list").description("List tags").action(async (_opts, cmd) => {
|
|
7147
7481
|
const org = resolveOrg(cmd);
|
|
@@ -7184,9 +7518,9 @@ function register27(program2) {
|
|
|
7184
7518
|
// src/commands/usage.ts
|
|
7185
7519
|
var usage_exports = {};
|
|
7186
7520
|
__export(usage_exports, {
|
|
7187
|
-
register: () =>
|
|
7521
|
+
register: () => register29
|
|
7188
7522
|
});
|
|
7189
|
-
function
|
|
7523
|
+
function register29(program2) {
|
|
7190
7524
|
program2.command("usage").description("List credit ledger entries").option("--since <window>", 'e.g. "30d", "24h", or an ISO date').option("--limit <n>", "page size (1-200)", parseLimit, 50).option("--cursor <cursor>", "resume from a previous page's nextCursor").action(
|
|
7191
7525
|
async (opts, cmd) => {
|
|
7192
7526
|
const org = resolveOrg(cmd);
|
|
@@ -7233,7 +7567,7 @@ function register28(program2) {
|
|
|
7233
7567
|
// src/commands/visibility.ts
|
|
7234
7568
|
var visibility_exports2 = {};
|
|
7235
7569
|
__export(visibility_exports2, {
|
|
7236
|
-
register: () =>
|
|
7570
|
+
register: () => register30,
|
|
7237
7571
|
visibilityPath: () => visibilityPath
|
|
7238
7572
|
});
|
|
7239
7573
|
function visibilityPath(org) {
|
|
@@ -7607,7 +7941,7 @@ function registerPreferenceGroup(group) {
|
|
|
7607
7941
|
);
|
|
7608
7942
|
});
|
|
7609
7943
|
}
|
|
7610
|
-
function
|
|
7944
|
+
function register30(program2) {
|
|
7611
7945
|
const preference = program2.command("preference").description("Manage Agent Preference prompts and measured markets");
|
|
7612
7946
|
registerPreferenceGroup(preference);
|
|
7613
7947
|
const legacy = program2.command("visibility", { hidden: true });
|
|
@@ -7631,6 +7965,7 @@ for (const group of [
|
|
|
7631
7965
|
orgs_exports2,
|
|
7632
7966
|
org_exports,
|
|
7633
7967
|
members_exports,
|
|
7968
|
+
models_exports,
|
|
7634
7969
|
evals_exports2,
|
|
7635
7970
|
visibility_exports2,
|
|
7636
7971
|
presets_exports,
|