@kortyx/telemetry-contracts 0.17.2 → 0.19.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/CHANGELOG.md +31 -0
- package/README.md +40 -0
- package/dist/index.d.ts +707 -3
- package/dist/index.js +1434 -671
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@ var __export = (target, all) => {
|
|
|
8
8
|
};
|
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
|
10
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let
|
|
12
|
-
if (!__hasOwnProp.call(to,
|
|
13
|
-
__defProp(to,
|
|
11
|
+
for (let key2 of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
13
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
14
14
|
}
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
@@ -28,11 +28,15 @@ __export(index_exports, {
|
|
|
28
28
|
DiagnosticNoteSchema: () => DiagnosticNoteSchema,
|
|
29
29
|
DiagnosticPartSchema: () => DiagnosticPartSchema,
|
|
30
30
|
DiagnosticResponseSchema: () => DiagnosticResponseSchema,
|
|
31
|
+
EMPTY_TABLE_FILTERS: () => EMPTY_TABLE_FILTERS,
|
|
32
|
+
EVALUATION_TABLE_FILTER_FIELDS: () => EVALUATION_TABLE_FILTER_FIELDS,
|
|
31
33
|
EnsureWorkflowTopologyRequestSchema: () => EnsureWorkflowTopologyRequestSchema,
|
|
32
34
|
EnsureWorkflowTopologyResponseSchema: () => EnsureWorkflowTopologyResponseSchema,
|
|
33
35
|
FEEDBACK_FILTERS: () => FEEDBACK_FILTERS,
|
|
34
36
|
FeedbackReasonSchema: () => FeedbackReasonSchema,
|
|
35
37
|
FeedbackSummarySchema: () => FeedbackSummarySchema,
|
|
38
|
+
LEGACY_TABLE_FILTERS: () => LEGACY_TABLE_FILTERS,
|
|
39
|
+
PROMPT_TABLE_FILTER_FIELDS: () => PROMPT_TABLE_FILTER_FIELDS,
|
|
36
40
|
PromptAssetSchema: () => PromptAssetSchema,
|
|
37
41
|
PromptAssignmentSchema: () => PromptAssignmentSchema,
|
|
38
42
|
PromptBundleSchema: () => PromptBundleSchema,
|
|
@@ -48,7 +52,9 @@ __export(index_exports, {
|
|
|
48
52
|
PromptTransferRequestSchema: () => PromptTransferRequestSchema,
|
|
49
53
|
PromptUsageSchema: () => PromptUsageSchema,
|
|
50
54
|
ReviewVerdictSchema: () => ReviewVerdictSchema,
|
|
55
|
+
SAMPLE_PROJECT: () => SAMPLE_PROJECT,
|
|
51
56
|
STUDIO_API_PROTOCOL_VERSION: () => STUDIO_API_PROTOCOL_VERSION,
|
|
57
|
+
STUDIO_TABLE_FIELDS: () => STUDIO_TABLE_FIELDS,
|
|
52
58
|
STUDIO_TIME_RANGES: () => STUDIO_TIME_RANGES,
|
|
53
59
|
StudioCatalogsResponseSchema: () => StudioCatalogsResponseSchema,
|
|
54
60
|
StudioChangeResourceSchema: () => StudioChangeResourceSchema,
|
|
@@ -76,11 +82,23 @@ __export(index_exports, {
|
|
|
76
82
|
StudioRunSchema: () => StudioRunSchema,
|
|
77
83
|
StudioRunStatusSchema: () => StudioRunStatusSchema,
|
|
78
84
|
StudioRunsResponseSchema: () => StudioRunsResponseSchema,
|
|
85
|
+
StudioSavedViewDefinitionSchema: () => StudioSavedViewDefinitionSchema,
|
|
79
86
|
StudioScoreResponseSchema: () => StudioScoreResponseSchema,
|
|
80
87
|
StudioScoreSchema: () => StudioScoreSchema,
|
|
81
88
|
StudioSessionDetailResponseSchema: () => StudioSessionDetailResponseSchema,
|
|
82
89
|
StudioSessionSchema: () => StudioSessionSchema,
|
|
83
90
|
StudioSessionsResponseSchema: () => StudioSessionsResponseSchema,
|
|
91
|
+
StudioTableConfigurationSchema: () => StudioTableConfigurationSchema,
|
|
92
|
+
StudioTableDefaultsSchema: () => StudioTableDefaultsSchema,
|
|
93
|
+
StudioTableIdSchema: () => StudioTableIdSchema,
|
|
94
|
+
StudioTableLayoutSchema: () => StudioTableLayoutSchema,
|
|
95
|
+
StudioTablePreferenceOperationSchema: () => StudioTablePreferenceOperationSchema,
|
|
96
|
+
StudioTablePreferenceResponseSchema: () => StudioTablePreferenceResponseSchema,
|
|
97
|
+
StudioTablePreferenceScopeSchema: () => StudioTablePreferenceScopeSchema,
|
|
98
|
+
StudioTablePreferenceWriteSchema: () => StudioTablePreferenceWriteSchema,
|
|
99
|
+
StudioTablePreferencesSchema: () => StudioTablePreferencesSchema,
|
|
100
|
+
StudioTableQueryPreferencesSchema: () => StudioTableQueryPreferencesSchema,
|
|
101
|
+
StudioTableViewSchema: () => StudioTableViewSchema,
|
|
84
102
|
StudioTimeRangeContextSchema: () => StudioTimeRangeContextSchema,
|
|
85
103
|
StudioTimeRangeQuerySchema: () => StudioTimeRangeQuerySchema,
|
|
86
104
|
StudioTimeRangeSchema: () => StudioTimeRangeSchema,
|
|
@@ -95,6 +113,8 @@ __export(index_exports, {
|
|
|
95
113
|
StudioWorkflowTransitionSchema: () => StudioWorkflowTransitionSchema,
|
|
96
114
|
StudioWorkflowsResponseSchema: () => StudioWorkflowsResponseSchema,
|
|
97
115
|
TELEMETRY_EVENT_TYPES: () => TELEMETRY_EVENT_TYPES,
|
|
116
|
+
TableFilterRuleSchema: () => TableFilterRuleSchema,
|
|
117
|
+
TableFiltersSchema: () => TableFiltersSchema,
|
|
98
118
|
TelemetryEventBatchResponseSchema: () => TelemetryEventBatchResponseSchema,
|
|
99
119
|
TelemetryEventBatchSchema: () => TelemetryEventBatchSchema,
|
|
100
120
|
TelemetryEventSchema: () => TelemetryEventSchema,
|
|
@@ -116,19 +136,29 @@ __export(index_exports, {
|
|
|
116
136
|
WorkflowTopologyEdgeSchema: () => WorkflowTopologyEdgeSchema,
|
|
117
137
|
WorkflowTopologyNodeSchema: () => WorkflowTopologyNodeSchema,
|
|
118
138
|
WorkflowTopologyTransitionSchema: () => WorkflowTopologyTransitionSchema,
|
|
139
|
+
applyTablePreferenceOperation: () => applyTablePreferenceOperation,
|
|
140
|
+
captureDiagnosticContent: () => captureDiagnosticContent,
|
|
141
|
+
emptyTablePreferences: () => emptyTablePreferences,
|
|
142
|
+
filterOperators: () => filterOperators,
|
|
119
143
|
isPrivateDiagnosticField: () => isPrivateDiagnosticField,
|
|
144
|
+
matchesTableFilters: () => matchesTableFilters,
|
|
145
|
+
matchesTableRule: () => matchesTableRule,
|
|
120
146
|
newerStudioVersion: () => newerStudioVersion,
|
|
121
147
|
projectWorkflowCalls: () => projectWorkflowCalls,
|
|
148
|
+
readStudioTableFilters: () => readStudioTableFilters,
|
|
122
149
|
redactDiagnosticContent: () => redactDiagnosticContent,
|
|
123
150
|
redactDiagnosticText: () => redactDiagnosticText,
|
|
124
151
|
resolveStudioInterruptStatus: () => resolveStudioInterruptStatus,
|
|
125
152
|
resolveStudioTimeRange: () => resolveStudioTimeRange,
|
|
126
153
|
studioUpdateRunning: () => studioUpdateRunning,
|
|
127
154
|
summarizeDiagnostic: () => summarizeDiagnostic,
|
|
128
|
-
summarizeUserFeedback: () => summarizeUserFeedback
|
|
155
|
+
summarizeUserFeedback: () => summarizeUserFeedback,
|
|
156
|
+
tablePassRate: () => tablePassRate,
|
|
157
|
+
tableQueueMs: () => tableQueueMs,
|
|
158
|
+
validateTableFilters: () => validateTableFilters
|
|
129
159
|
});
|
|
130
160
|
module.exports = __toCommonJS(index_exports);
|
|
131
|
-
var
|
|
161
|
+
var import_zod8 = require("zod");
|
|
132
162
|
|
|
133
163
|
// src/scores.ts
|
|
134
164
|
var import_zod = require("zod");
|
|
@@ -203,8 +233,410 @@ function summarizeUserFeedback(scores) {
|
|
|
203
233
|
return feedback;
|
|
204
234
|
}
|
|
205
235
|
|
|
206
|
-
// src/
|
|
236
|
+
// src/table-preferences.ts
|
|
237
|
+
var import_zod3 = require("zod");
|
|
238
|
+
|
|
239
|
+
// src/table-filters.ts
|
|
207
240
|
var import_zod2 = require("zod");
|
|
241
|
+
var TableFilterRuleSchema = import_zod2.z.object({
|
|
242
|
+
field: import_zod2.z.string().min(1).max(80),
|
|
243
|
+
operator: import_zod2.z.enum([
|
|
244
|
+
"contains",
|
|
245
|
+
"notContains",
|
|
246
|
+
"is",
|
|
247
|
+
"isNot",
|
|
248
|
+
"gt",
|
|
249
|
+
"gte",
|
|
250
|
+
"lt",
|
|
251
|
+
"lte",
|
|
252
|
+
"between",
|
|
253
|
+
"present",
|
|
254
|
+
"missing"
|
|
255
|
+
]),
|
|
256
|
+
values: import_zod2.z.array(
|
|
257
|
+
import_zod2.z.union([import_zod2.z.string().min(1).max(512), import_zod2.z.number().finite(), import_zod2.z.boolean()])
|
|
258
|
+
).max(30)
|
|
259
|
+
}).strict();
|
|
260
|
+
var TableFiltersSchema = import_zod2.z.object({
|
|
261
|
+
match: import_zod2.z.enum(["all", "any"]),
|
|
262
|
+
rules: import_zod2.z.array(TableFilterRuleSchema).max(32)
|
|
263
|
+
}).strict().refine(
|
|
264
|
+
(value) => JSON.stringify(value).length <= 32768,
|
|
265
|
+
"Filters must fit within 32 KiB."
|
|
266
|
+
);
|
|
267
|
+
var EMPTY_TABLE_FILTERS = { match: "all", rules: [] };
|
|
268
|
+
var filterOperators = (kind) => [
|
|
269
|
+
...kind === "text" ? ["contains", "notContains"] : [],
|
|
270
|
+
"is",
|
|
271
|
+
"isNot",
|
|
272
|
+
...kind === "number" || kind === "date" ? ["gt", "gte", "lt", "lte", "between"] : [],
|
|
273
|
+
"present",
|
|
274
|
+
"missing"
|
|
275
|
+
];
|
|
276
|
+
function validateTableFilters(filters, fields) {
|
|
277
|
+
const parsed = TableFiltersSchema.safeParse(filters);
|
|
278
|
+
if (!parsed.success) throw new Error("Enter valid values for every filter.");
|
|
279
|
+
for (const rule of filters.rules) {
|
|
280
|
+
const field2 = fields.find((item) => item.key === rule.field);
|
|
281
|
+
if (!field2 || !filterOperators(field2.kind).includes(rule.operator))
|
|
282
|
+
throw new Error("Unsupported filter field or operator.");
|
|
283
|
+
const noValue = rule.operator === "present" || rule.operator === "missing";
|
|
284
|
+
if (noValue ? rule.values.length !== 0 : rule.operator === "between" ? rule.values.length !== 2 : !rule.values.length)
|
|
285
|
+
throw new Error("Invalid number of filter values.");
|
|
286
|
+
for (const value of rule.values) {
|
|
287
|
+
if (field2.kind === "number" && typeof value !== "number")
|
|
288
|
+
throw new Error("Numeric filters require numbers.");
|
|
289
|
+
if (field2.kind === "boolean" && typeof value !== "boolean")
|
|
290
|
+
throw new Error("Boolean filters require true or false.");
|
|
291
|
+
if ((field2.kind === "text" || field2.kind === "enum" || field2.kind === "date") && typeof value !== "string")
|
|
292
|
+
throw new Error("Text filters require strings.");
|
|
293
|
+
if (field2.kind === "date" && (typeof value !== "string" || !Number.isFinite(Date.parse(value)) || !/(Z|[+-]\d{2}:\d{2})$/.test(value)))
|
|
294
|
+
throw new Error("Date filters require ISO timestamps with an offset.");
|
|
295
|
+
}
|
|
296
|
+
if (rule.operator === "between" && (field2.kind === "date" ? Date.parse(String(rule.values[0])) > Date.parse(String(rule.values[1])) : Number(rule.values[0]) > Number(rule.values[1])))
|
|
297
|
+
throw new Error("Filter minimum must not exceed maximum.");
|
|
298
|
+
}
|
|
299
|
+
return filters;
|
|
300
|
+
}
|
|
301
|
+
function matchesTableRule(value, rule, kind) {
|
|
302
|
+
const values = (Array.isArray(value) ? value : [value]).filter(
|
|
303
|
+
(item) => item !== null && item !== void 0 && item !== ""
|
|
304
|
+
);
|
|
305
|
+
if (rule.operator === "present") return values.length > 0;
|
|
306
|
+
if (rule.operator === "missing") return values.length === 0;
|
|
307
|
+
if (!values.length) return false;
|
|
308
|
+
const equal = (a, b) => typeof a === "string" && typeof b === "string" ? kind === "date" ? Date.parse(a) === Date.parse(b) : a.toLowerCase() === b.toLowerCase() : a === b;
|
|
309
|
+
const contains = () => values.some(
|
|
310
|
+
(a) => rule.values.some(
|
|
311
|
+
(b) => String(a).toLowerCase().includes(String(b).toLowerCase())
|
|
312
|
+
)
|
|
313
|
+
);
|
|
314
|
+
if (rule.operator === "contains") return contains();
|
|
315
|
+
if (rule.operator === "notContains") return !contains();
|
|
316
|
+
if (rule.operator === "is")
|
|
317
|
+
return values.some((a) => rule.values.some((b) => equal(a, b)));
|
|
318
|
+
if (rule.operator === "isNot")
|
|
319
|
+
return !values.some((a) => rule.values.some((b) => equal(a, b)));
|
|
320
|
+
return values.some((a) => {
|
|
321
|
+
const comparable = typeof a === "string" && a.includes("T") && (a.endsWith("Z") || /[+-]\d{2}:\d{2}$/.test(a)) ? Date.parse(a) : Number(a);
|
|
322
|
+
const bounds = rule.values.map(
|
|
323
|
+
(b) => typeof b === "string" ? Date.parse(b) : Number(b)
|
|
324
|
+
);
|
|
325
|
+
switch (rule.operator) {
|
|
326
|
+
case "gt":
|
|
327
|
+
return comparable > bounds[0];
|
|
328
|
+
case "gte":
|
|
329
|
+
return comparable >= bounds[0];
|
|
330
|
+
case "lt":
|
|
331
|
+
return comparable < bounds[0];
|
|
332
|
+
case "lte":
|
|
333
|
+
return comparable <= bounds[0];
|
|
334
|
+
case "between":
|
|
335
|
+
return comparable >= bounds[0] && comparable <= bounds[1];
|
|
336
|
+
default:
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
function matchesTableFilters(filters, read, fields) {
|
|
342
|
+
if (!filters.rules.length) return true;
|
|
343
|
+
const match = (rule) => matchesTableRule(
|
|
344
|
+
read(rule.field),
|
|
345
|
+
rule,
|
|
346
|
+
fields?.find((f) => f.key === rule.field)?.kind
|
|
347
|
+
);
|
|
348
|
+
return filters.match === "any" ? filters.rules.some(match) : filters.rules.every(match);
|
|
349
|
+
}
|
|
350
|
+
var field = (key2, label, kind = "text", unit) => ({ key: key2, label, kind, ...unit ? { unit } : {} });
|
|
351
|
+
var identity = [field("userId", "User ID"), field("tenantId", "Tenant ID")];
|
|
352
|
+
var metrics = [
|
|
353
|
+
field("durationMs", "Duration", "number", "ms"),
|
|
354
|
+
field("tokens", "Tokens", "number"),
|
|
355
|
+
field("cost", "Cost", "number", "currency units"),
|
|
356
|
+
field("currency", "Currency", "enum")
|
|
357
|
+
];
|
|
358
|
+
var STUDIO_TABLE_FIELDS = {
|
|
359
|
+
runs: [
|
|
360
|
+
field("id", "Run ID"),
|
|
361
|
+
field("execution", "Execution", "enum"),
|
|
362
|
+
field("parentRunId", "Parent run ID"),
|
|
363
|
+
field("callId", "Call ID"),
|
|
364
|
+
field("status", "Status", "enum"),
|
|
365
|
+
field("startedAt", "Started", "date"),
|
|
366
|
+
field("endedAt", "Ended", "date"),
|
|
367
|
+
...identity,
|
|
368
|
+
field("environment", "Environment", "enum"),
|
|
369
|
+
field("pricingStatus", "Pricing status", "enum"),
|
|
370
|
+
field("feedback", "Feedback", "enum"),
|
|
371
|
+
field("workflowIds", "Workflow"),
|
|
372
|
+
field("versions", "Version"),
|
|
373
|
+
field("path", "Path"),
|
|
374
|
+
field("sessionId", "Session ID"),
|
|
375
|
+
field("provider", "Provider", "enum"),
|
|
376
|
+
field("models", "Model"),
|
|
377
|
+
...metrics,
|
|
378
|
+
field("result", "Result"),
|
|
379
|
+
field("hasTool", "Has tool call", "boolean"),
|
|
380
|
+
field("toolName", "Tool name"),
|
|
381
|
+
field("toolOutcome", "Tool outcome", "enum"),
|
|
382
|
+
field("toolMode", "Called by", "enum"),
|
|
383
|
+
field("transitionIds", "Workflow transition")
|
|
384
|
+
],
|
|
385
|
+
sessions: [
|
|
386
|
+
field("id", "Session ID"),
|
|
387
|
+
field("status", "Status", "enum"),
|
|
388
|
+
field("lastActivityAt", "Last activity", "date"),
|
|
389
|
+
field("environment", "Environment", "enum"),
|
|
390
|
+
...identity,
|
|
391
|
+
field("workflowIds", "Workflow"),
|
|
392
|
+
field("activeVersion", "Version"),
|
|
393
|
+
field("runs", "Runs", "number"),
|
|
394
|
+
field("succeeded", "Successful runs", "number"),
|
|
395
|
+
field("failed", "Failed runs", "number"),
|
|
396
|
+
field("interrupted", "Interrupted runs", "number"),
|
|
397
|
+
field("checkpoints", "Checkpoints", "number"),
|
|
398
|
+
field("hasFork", "Has branch", "boolean"),
|
|
399
|
+
...metrics,
|
|
400
|
+
field("latestResult", "Latest result"),
|
|
401
|
+
field("latestError", "Latest error"),
|
|
402
|
+
field("pendingInterruptId", "Pending interrupt"),
|
|
403
|
+
field("hasError", "Has error", "boolean"),
|
|
404
|
+
field("hasInterrupt", "Has interrupt", "boolean"),
|
|
405
|
+
field("hasCheckpoint", "Has checkpoint", "boolean"),
|
|
406
|
+
field("providers", "Provider", "enum"),
|
|
407
|
+
field("models", "Model"),
|
|
408
|
+
field("tags", "Tags")
|
|
409
|
+
],
|
|
410
|
+
interrupts: [
|
|
411
|
+
field("id", "Interrupt ID"),
|
|
412
|
+
field("status", "Status", "enum"),
|
|
413
|
+
field("createdAt", "Created", "date"),
|
|
414
|
+
field("expiresAt", "Expires", "date"),
|
|
415
|
+
field("resolvedAt", "Resolved", "date"),
|
|
416
|
+
field("environment", "Environment", "enum"),
|
|
417
|
+
field("age", "Age", "number", "minutes"),
|
|
418
|
+
field("resolutionMs", "Resolution time", "number", "ms"),
|
|
419
|
+
field("type", "Type", "enum"),
|
|
420
|
+
field("question", "Request"),
|
|
421
|
+
field("contract", "Contract"),
|
|
422
|
+
field("schemaId", "Schema ID"),
|
|
423
|
+
field("workflowId", "Workflow"),
|
|
424
|
+
field("nodeId", "Node"),
|
|
425
|
+
field("sessionId", "Session ID"),
|
|
426
|
+
...identity,
|
|
427
|
+
field("response", "Response"),
|
|
428
|
+
field("resolvedBy", "Resolved by"),
|
|
429
|
+
field("resumeOutcome", "Resume outcome", "enum"),
|
|
430
|
+
field("resumeError", "Resume error"),
|
|
431
|
+
field("runId", "Run ID")
|
|
432
|
+
]
|
|
433
|
+
};
|
|
434
|
+
var LEGACY_TABLE_FILTERS = {
|
|
435
|
+
toolName: ["toolName", "contains"],
|
|
436
|
+
toolOutcome: ["toolOutcome", "is"],
|
|
437
|
+
toolMode: ["toolMode", "is"],
|
|
438
|
+
error: ["hasError", "is"],
|
|
439
|
+
interrupt: ["hasInterrupt", "is"],
|
|
440
|
+
checkpoint: ["hasCheckpoint", "is"],
|
|
441
|
+
fork: ["hasFork", "is"],
|
|
442
|
+
transition: ["transitionIds", "is"],
|
|
443
|
+
status: ["status", "is"],
|
|
444
|
+
provider: ["provider", "is"],
|
|
445
|
+
workflow: ["workflowIds", "is"],
|
|
446
|
+
version: ["versions", "is"],
|
|
447
|
+
path: ["path", "is"],
|
|
448
|
+
session: ["sessionId", "contains"],
|
|
449
|
+
model: ["models", "contains"],
|
|
450
|
+
result: ["result", "contains"],
|
|
451
|
+
feedback: ["feedback", "is"],
|
|
452
|
+
tool: ["hasTool", "is"],
|
|
453
|
+
user: ["userId", "contains"],
|
|
454
|
+
tenant: ["tenantId", "contains"],
|
|
455
|
+
tags: ["tags", "contains"],
|
|
456
|
+
node: ["nodeId", "contains"],
|
|
457
|
+
resolver: ["resolvedBy", "contains"],
|
|
458
|
+
outcome: ["resumeOutcome", "is"],
|
|
459
|
+
type: ["type", "is"],
|
|
460
|
+
minCost: ["cost", "gte"],
|
|
461
|
+
maxCost: ["cost", "lte"],
|
|
462
|
+
minTokens: ["tokens", "gte"],
|
|
463
|
+
maxTokens: ["tokens", "lte"],
|
|
464
|
+
minDuration: ["durationMs", "gte"],
|
|
465
|
+
maxDuration: ["durationMs", "lte"],
|
|
466
|
+
minAge: ["age", "gte"],
|
|
467
|
+
maxAge: ["age", "lte"]
|
|
468
|
+
};
|
|
469
|
+
function readStudioTableFilters(query, resource) {
|
|
470
|
+
const fields = STUDIO_TABLE_FIELDS[resource];
|
|
471
|
+
const filters = query.tableFilters ? TableFiltersSchema.parse(JSON.parse(query.tableFilters)) : { match: "all", rules: [] };
|
|
472
|
+
const rules = [...filters.rules];
|
|
473
|
+
for (const [alias, [original, operator]] of Object.entries(
|
|
474
|
+
LEGACY_TABLE_FILTERS
|
|
475
|
+
)) {
|
|
476
|
+
const raw = query[alias];
|
|
477
|
+
if (!raw) continue;
|
|
478
|
+
if (resource === "interrupts" && alias === "error") {
|
|
479
|
+
if (raw === "true" || raw === "1")
|
|
480
|
+
rules.push({ field: "resumeError", operator: "present", values: [] });
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
const key2 = resource === "sessions" && alias === "provider" ? "providers" : resource === "sessions" && alias === "version" ? "activeVersion" : resource === "interrupts" && alias === "workflow" ? "workflowId" : original;
|
|
484
|
+
const definition = fields.find((f) => f.key === key2);
|
|
485
|
+
if (!definition) continue;
|
|
486
|
+
const values = definition.kind === "number" ? [Number(raw) * (alias.endsWith("Duration") ? 1e3 : 1)] : definition.kind === "boolean" ? [raw === "true" || raw === "1"] : operator === "is" ? raw.split(",").filter(Boolean) : [raw];
|
|
487
|
+
rules.push({
|
|
488
|
+
field: key2,
|
|
489
|
+
operator: resource === "interrupts" && alias === "workflow" ? "contains" : operator,
|
|
490
|
+
values
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
return validateTableFilters(
|
|
494
|
+
TableFiltersSchema.parse({ ...filters, rules }),
|
|
495
|
+
fields
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
var PROMPT_TABLE_FILTER_FIELDS = [
|
|
499
|
+
field("name", "Prompt"),
|
|
500
|
+
field("key", "Key"),
|
|
501
|
+
field("category", "Category"),
|
|
502
|
+
field("categoryId", "Category ID"),
|
|
503
|
+
field("live", "Is live", "boolean"),
|
|
504
|
+
field("liveVersion", "Live version", "number"),
|
|
505
|
+
field("latestVersion", "Newest version", "number"),
|
|
506
|
+
field("updatedAt", "Updated", "date"),
|
|
507
|
+
field("assignedTags", "Assigned tags"),
|
|
508
|
+
field("assignedVersions", "Assigned versions"),
|
|
509
|
+
field("versionsBehindLive", "Versions behind live", "number")
|
|
510
|
+
];
|
|
511
|
+
var EVALUATION_TABLE_FILTER_FIELDS = [
|
|
512
|
+
field("name", "Evaluation run"),
|
|
513
|
+
field("id", "Evaluation ID"),
|
|
514
|
+
field("selection", "Suite selection", "enum"),
|
|
515
|
+
field("suiteCount", "Suites", "number"),
|
|
516
|
+
field("judge", "Judge"),
|
|
517
|
+
field("judgeVersion", "Judge version"),
|
|
518
|
+
field("passRate", "Pass rate (%)", "number"),
|
|
519
|
+
field("queueMs", "Queue time (ms)", "number"),
|
|
520
|
+
field("status", "Status", "enum"),
|
|
521
|
+
field("completedSuites", "Completed suites", "number"),
|
|
522
|
+
field("completedAttempts", "Graded attempts", "number"),
|
|
523
|
+
field("totalAttempts", "Total attempts", "number"),
|
|
524
|
+
field("passed", "Passed", "number"),
|
|
525
|
+
field("failed", "Failed", "number"),
|
|
526
|
+
field("error", "Errors", "number"),
|
|
527
|
+
field("cancelled", "Cancelled", "number"),
|
|
528
|
+
field("applicationId", "Application ID"),
|
|
529
|
+
field("application", "Application"),
|
|
530
|
+
field("environment", "Environment", "enum"),
|
|
531
|
+
field("trigger", "Trigger", "enum"),
|
|
532
|
+
field("commit", "Commit"),
|
|
533
|
+
field("createdAt", "Created", "date"),
|
|
534
|
+
field("cost", "Cost", "number"),
|
|
535
|
+
field("duration", "Duration (ms)", "number")
|
|
536
|
+
];
|
|
537
|
+
function tablePassRate(counts) {
|
|
538
|
+
const total = counts ? counts.passed + counts.failed + counts.error : 0;
|
|
539
|
+
return counts && total > 0 ? counts.passed / total * 100 : void 0;
|
|
540
|
+
}
|
|
541
|
+
function tableQueueMs(createdAt, startedAt) {
|
|
542
|
+
if (!startedAt) return void 0;
|
|
543
|
+
const value = Date.parse(startedAt) - Date.parse(createdAt);
|
|
544
|
+
return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// src/table-preferences.ts
|
|
548
|
+
var StudioTableIdSchema = import_zod3.z.enum([
|
|
549
|
+
"runs",
|
|
550
|
+
"sessions",
|
|
551
|
+
"interrupts",
|
|
552
|
+
"prompts",
|
|
553
|
+
"prompt-groups",
|
|
554
|
+
"prompt-runs",
|
|
555
|
+
"prompt-evals",
|
|
556
|
+
"evaluations",
|
|
557
|
+
"eval-comparison",
|
|
558
|
+
"eval-cases",
|
|
559
|
+
"evaluation-suites",
|
|
560
|
+
"legacy-eval-runs",
|
|
561
|
+
"eval-suites"
|
|
562
|
+
]);
|
|
563
|
+
var key = import_zod3.z.string().min(1).max(80);
|
|
564
|
+
var StudioTableLayoutSchema = import_zod3.z.object({
|
|
565
|
+
widths: import_zod3.z.record(key, import_zod3.z.number().finite().min(1).max(1e4)).refine((v) => Object.keys(v).length <= 256),
|
|
566
|
+
order: import_zod3.z.array(key).max(256),
|
|
567
|
+
hidden: import_zod3.z.array(key).max(256),
|
|
568
|
+
pinned: import_zod3.z.record(key, import_zod3.z.enum(["left", "right"]).optional()).refine((v) => Object.keys(v).length <= 256)
|
|
569
|
+
}).strict();
|
|
570
|
+
var StudioTableQueryPreferencesSchema = import_zod3.z.object({
|
|
571
|
+
sort: import_zod3.z.string().max(80),
|
|
572
|
+
dir: import_zod3.z.enum(["asc", "desc"]),
|
|
573
|
+
pageSize: import_zod3.z.number().int().min(1).max(250)
|
|
574
|
+
}).strict();
|
|
575
|
+
var StudioSavedViewDefinitionSchema = import_zod3.z.object({
|
|
576
|
+
name: import_zod3.z.string().trim().min(1).max(80),
|
|
577
|
+
filters: TableFiltersSchema,
|
|
578
|
+
layout: StudioTableLayoutSchema,
|
|
579
|
+
scope: import_zod3.z.record(key, import_zod3.z.string().max(512)).refine((v) => Object.keys(v).length <= 32),
|
|
580
|
+
sort: import_zod3.z.string().max(80).optional(),
|
|
581
|
+
direction: import_zod3.z.enum(["asc", "desc"]).optional(),
|
|
582
|
+
pageSize: import_zod3.z.number().int().min(1).max(250).optional()
|
|
583
|
+
}).strict();
|
|
584
|
+
var StudioTableViewSchema = StudioSavedViewDefinitionSchema.extend({
|
|
585
|
+
id: import_zod3.z.uuid()
|
|
586
|
+
});
|
|
587
|
+
var StudioTableDefaultsSchema = import_zod3.z.object({
|
|
588
|
+
layout: StudioTableLayoutSchema.optional(),
|
|
589
|
+
query: StudioTableQueryPreferencesSchema.optional()
|
|
590
|
+
}).strict();
|
|
591
|
+
var StudioTableConfigurationSchema = import_zod3.z.object({
|
|
592
|
+
schemaVersion: import_zod3.z.literal(1),
|
|
593
|
+
defaults: StudioTableDefaultsSchema,
|
|
594
|
+
views: import_zod3.z.array(StudioTableViewSchema).max(30).refine((v) => new Set(v.map((x) => x.id)).size === v.length)
|
|
595
|
+
}).strict();
|
|
596
|
+
var StudioTablePreferencesSchema = StudioTableConfigurationSchema.extend({ revision: import_zod3.z.number().int().min(0) });
|
|
597
|
+
var StudioTablePreferenceScopeSchema = import_zod3.z.object({
|
|
598
|
+
cacheKey: import_zod3.z.string().regex(/^[a-f0-9]{64}$/),
|
|
599
|
+
ownerKind: import_zod3.z.enum(["project", "user"])
|
|
600
|
+
});
|
|
601
|
+
var StudioTablePreferenceOperationSchema = import_zod3.z.discriminatedUnion(
|
|
602
|
+
"kind",
|
|
603
|
+
[
|
|
604
|
+
import_zod3.z.object({ kind: import_zod3.z.literal("defaults"), patch: StudioTableDefaultsSchema }).strict(),
|
|
605
|
+
import_zod3.z.object({ kind: import_zod3.z.literal("putView"), view: StudioTableViewSchema }).strict(),
|
|
606
|
+
import_zod3.z.object({ kind: import_zod3.z.literal("deleteView"), id: import_zod3.z.uuid() }).strict()
|
|
607
|
+
]
|
|
608
|
+
);
|
|
609
|
+
var StudioTablePreferenceWriteSchema = import_zod3.z.object({
|
|
610
|
+
scopeKey: import_zod3.z.string().regex(/^[a-f0-9]{64}$/),
|
|
611
|
+
expectedRevision: import_zod3.z.number().int().min(0),
|
|
612
|
+
operation: StudioTablePreferenceOperationSchema
|
|
613
|
+
}).strict();
|
|
614
|
+
function emptyTablePreferences() {
|
|
615
|
+
return { schemaVersion: 1, revision: 0, defaults: {}, views: [] };
|
|
616
|
+
}
|
|
617
|
+
function applyTablePreferenceOperation(state, operation) {
|
|
618
|
+
if (operation.kind === "defaults")
|
|
619
|
+
return { ...state, defaults: { ...state.defaults, ...operation.patch } };
|
|
620
|
+
if (operation.kind === "deleteView")
|
|
621
|
+
return {
|
|
622
|
+
...state,
|
|
623
|
+
views: state.views.filter((v) => v.id !== operation.id)
|
|
624
|
+
};
|
|
625
|
+
const exists = state.views.some((v) => v.id === operation.view.id);
|
|
626
|
+
return StudioTablePreferencesSchema.parse({
|
|
627
|
+
...state,
|
|
628
|
+
views: exists ? state.views.map(
|
|
629
|
+
(v) => v.id === operation.view.id ? operation.view : v
|
|
630
|
+
) : [...state.views, operation.view]
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
var StudioTablePreferenceResponseSchema = import_zod3.z.object({
|
|
634
|
+
scope: StudioTablePreferenceScopeSchema,
|
|
635
|
+
preferences: StudioTablePreferencesSchema
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
// src/diagnostics.ts
|
|
639
|
+
var import_zod4 = require("zod");
|
|
208
640
|
var DIAGNOSTIC_LIMITS = {
|
|
209
641
|
bytes: 8 * 1024 * 1024,
|
|
210
642
|
partBytes: 64 * 1024,
|
|
@@ -213,55 +645,60 @@ var DIAGNOSTIC_LIMITS = {
|
|
|
213
645
|
depth: 128,
|
|
214
646
|
properties: 1e3
|
|
215
647
|
};
|
|
216
|
-
var DiagnosticNoteSchema =
|
|
217
|
-
path:
|
|
218
|
-
reason:
|
|
219
|
-
originalBytes:
|
|
220
|
-
originalCount:
|
|
648
|
+
var DiagnosticNoteSchema = import_zod4.z.object({
|
|
649
|
+
path: import_zod4.z.string().max(4096),
|
|
650
|
+
reason: import_zod4.z.string().max(128),
|
|
651
|
+
originalBytes: import_zod4.z.number().int().nonnegative().optional(),
|
|
652
|
+
originalCount: import_zod4.z.number().int().nonnegative().optional()
|
|
221
653
|
}).strict();
|
|
222
|
-
var DiagnosticContentSchema =
|
|
223
|
-
schemaVersion:
|
|
224
|
-
data:
|
|
225
|
-
capture:
|
|
226
|
-
status:
|
|
227
|
-
omissions:
|
|
228
|
-
redactions:
|
|
654
|
+
var DiagnosticContentSchema = import_zod4.z.object({
|
|
655
|
+
schemaVersion: import_zod4.z.literal(1),
|
|
656
|
+
data: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()),
|
|
657
|
+
capture: import_zod4.z.object({
|
|
658
|
+
status: import_zod4.z.enum(["complete", "partial", "failed"]),
|
|
659
|
+
omissions: import_zod4.z.array(DiagnosticNoteSchema).max(1e4),
|
|
660
|
+
redactions: import_zod4.z.array(DiagnosticNoteSchema).max(1e4)
|
|
229
661
|
}).strict()
|
|
230
662
|
}).strict();
|
|
231
|
-
var DiagnosticCorrelationSchema =
|
|
232
|
-
runId:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
663
|
+
var DiagnosticCorrelationSchema = import_zod4.z.object({
|
|
664
|
+
runId: import_zod4.z.string().optional(),
|
|
665
|
+
evaluationId: import_zod4.z.string().optional(),
|
|
666
|
+
suiteRunId: import_zod4.z.string().optional(),
|
|
667
|
+
caseId: import_zod4.z.string().optional(),
|
|
668
|
+
repetition: import_zod4.z.string().optional(),
|
|
669
|
+
phase: import_zod4.z.string().optional(),
|
|
670
|
+
workflowId: import_zod4.z.string().optional(),
|
|
671
|
+
nodeId: import_zod4.z.string().optional(),
|
|
672
|
+
sessionId: import_zod4.z.string().optional(),
|
|
673
|
+
invocationId: import_zod4.z.string().optional(),
|
|
674
|
+
parentInvocationId: import_zod4.z.string().optional(),
|
|
675
|
+
branchId: import_zod4.z.string().optional(),
|
|
676
|
+
toolCallId: import_zod4.z.string().optional(),
|
|
677
|
+
attemptId: import_zod4.z.string().optional(),
|
|
678
|
+
workflowRevisionId: import_zod4.z.string().optional(),
|
|
679
|
+
traceId: import_zod4.z.string().optional(),
|
|
680
|
+
spanId: import_zod4.z.string().optional(),
|
|
681
|
+
parentSpanId: import_zod4.z.string().optional()
|
|
245
682
|
}).strict();
|
|
246
|
-
var DiagnosticManifestSchema =
|
|
247
|
-
schemaVersion:
|
|
248
|
-
diagnosticId:
|
|
249
|
-
occurrenceId:
|
|
250
|
-
occurredAt:
|
|
251
|
-
environment:
|
|
252
|
-
service:
|
|
253
|
-
name:
|
|
254
|
-
deploymentRef:
|
|
683
|
+
var DiagnosticManifestSchema = import_zod4.z.object({
|
|
684
|
+
schemaVersion: import_zod4.z.literal(1),
|
|
685
|
+
diagnosticId: import_zod4.z.string().uuid(),
|
|
686
|
+
occurrenceId: import_zod4.z.string().uuid(),
|
|
687
|
+
occurredAt: import_zod4.z.string().datetime({ offset: true }),
|
|
688
|
+
environment: import_zod4.z.string().min(1).max(256),
|
|
689
|
+
service: import_zod4.z.object({
|
|
690
|
+
name: import_zod4.z.string().min(1).max(256),
|
|
691
|
+
deploymentRef: import_zod4.z.string().max(1024).optional()
|
|
255
692
|
}).strict(),
|
|
256
693
|
correlation: DiagnosticCorrelationSchema,
|
|
257
|
-
handled:
|
|
258
|
-
severity:
|
|
259
|
-
mechanism:
|
|
260
|
-
summary:
|
|
261
|
-
captureStatus:
|
|
262
|
-
checksum:
|
|
263
|
-
byteLength:
|
|
264
|
-
partCount:
|
|
694
|
+
handled: import_zod4.z.boolean(),
|
|
695
|
+
severity: import_zod4.z.enum(["warning", "error"]),
|
|
696
|
+
mechanism: import_zod4.z.enum(["span", "report", "tool"]),
|
|
697
|
+
summary: import_zod4.z.object({ type: import_zod4.z.string().max(256), message: import_zod4.z.string().max(8192) }).strict(),
|
|
698
|
+
captureStatus: import_zod4.z.enum(["complete", "partial", "failed"]),
|
|
699
|
+
checksum: import_zod4.z.string().regex(/^[a-f0-9]{64}$/),
|
|
700
|
+
byteLength: import_zod4.z.number().int().min(1).max(DIAGNOSTIC_LIMITS.bytes),
|
|
701
|
+
partCount: import_zod4.z.number().int().min(1).max(DIAGNOSTIC_LIMITS.parts)
|
|
265
702
|
}).strict().superRefine((value, ctx) => {
|
|
266
703
|
if (value.partCount !== Math.ceil(value.byteLength / DIAGNOSTIC_LIMITS.partBytes))
|
|
267
704
|
ctx.addIssue({
|
|
@@ -270,23 +707,23 @@ var DiagnosticManifestSchema = import_zod2.z.object({
|
|
|
270
707
|
message: "Part count does not match byte length."
|
|
271
708
|
});
|
|
272
709
|
});
|
|
273
|
-
var DiagnosticPartSchema =
|
|
274
|
-
index:
|
|
275
|
-
data:
|
|
710
|
+
var DiagnosticPartSchema = import_zod4.z.object({
|
|
711
|
+
index: import_zod4.z.number().int().min(0).max(DIAGNOSTIC_LIMITS.parts - 1),
|
|
712
|
+
data: import_zod4.z.string().max(Math.ceil(DIAGNOSTIC_LIMITS.partBytes / 3) * 4).regex(
|
|
276
713
|
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
|
|
277
714
|
)
|
|
278
715
|
}).strict();
|
|
279
|
-
var DiagnosticResponseSchema =
|
|
716
|
+
var DiagnosticResponseSchema = import_zod4.z.object({
|
|
280
717
|
manifest: DiagnosticManifestSchema,
|
|
281
|
-
state:
|
|
282
|
-
receivedParts:
|
|
283
|
-
expiresAt:
|
|
718
|
+
state: import_zod4.z.enum(["pending", "available", "incomplete", "expired"]),
|
|
719
|
+
receivedParts: import_zod4.z.number().int().nonnegative(),
|
|
720
|
+
expiresAt: import_zod4.z.string().datetime({ offset: true }),
|
|
284
721
|
content: DiagnosticContentSchema.nullable(),
|
|
285
|
-
contentChecksum:
|
|
286
|
-
contentByteLength:
|
|
722
|
+
contentChecksum: import_zod4.z.string().regex(/^[a-f0-9]{64}$/).nullable(),
|
|
723
|
+
contentByteLength: import_zod4.z.number().int().nonnegative().nullable()
|
|
287
724
|
}).strict();
|
|
288
|
-
var isPrivateDiagnosticField = (
|
|
289
|
-
|
|
725
|
+
var isPrivateDiagnosticField = (key2) => /^(?:password|passwd|secret|clientsecret|privatekey|credential|credentials|authorization|proxyauthorization|bearer|bearertoken|jwt|token|accesstoken|refreshtoken|authtoken|apikey|xapikey|apitoken|xauthtoken|xaccesstoken|awsaccesskeyid|awssecretaccesskey|awssessiontoken|xamzsecuritytoken|apisecret|cookie|setcookie|resumehandle|resumetoken)$/.test(
|
|
726
|
+
key2.toLowerCase().replace(/[^a-z0-9]/g, "")
|
|
290
727
|
);
|
|
291
728
|
function redactDiagnosticText(value) {
|
|
292
729
|
return value.replace(/\bBearer\s+[A-Za-z0-9._~+/-]+=*/gi, "Bearer [REDACTED]").replace(
|
|
@@ -357,17 +794,17 @@ function redactDiagnosticContent(content) {
|
|
|
357
794
|
originalCount: keys.length
|
|
358
795
|
});
|
|
359
796
|
return Object.fromEntries(
|
|
360
|
-
keys.slice(0, DIAGNOSTIC_LIMITS.properties).map((
|
|
361
|
-
const nested = value[
|
|
362
|
-
if (isPrivateDiagnosticField(
|
|
797
|
+
keys.slice(0, DIAGNOSTIC_LIMITS.properties).map((key2) => {
|
|
798
|
+
const nested = value[key2];
|
|
799
|
+
if (isPrivateDiagnosticField(key2)) {
|
|
363
800
|
if (redactions.length < 1e4 && nested !== "[REDACTED]")
|
|
364
801
|
redactions.push({
|
|
365
|
-
path: `${path}/${
|
|
802
|
+
path: `${path}/${key2}`.slice(0, 4096),
|
|
366
803
|
reason: "server_credential_field"
|
|
367
804
|
});
|
|
368
|
-
return [
|
|
805
|
+
return [key2, "[REDACTED]"];
|
|
369
806
|
}
|
|
370
|
-
return [
|
|
807
|
+
return [key2, visit(nested, `${path}/${key2}`, depth + 1)];
|
|
371
808
|
})
|
|
372
809
|
);
|
|
373
810
|
}
|
|
@@ -393,217 +830,512 @@ function redactDiagnosticContent(content) {
|
|
|
393
830
|
};
|
|
394
831
|
}
|
|
395
832
|
|
|
833
|
+
// src/sample-project.ts
|
|
834
|
+
var SAMPLE_PROJECT = {
|
|
835
|
+
id: "kortyx-sample",
|
|
836
|
+
name: "Sample project",
|
|
837
|
+
version: 5,
|
|
838
|
+
recordedAt: "2026-10-01T12:00:00.000Z",
|
|
839
|
+
referenceTime: "2026-10-01T12:10:00.000Z",
|
|
840
|
+
workflowId: "sample-support-assistant",
|
|
841
|
+
revisionId: "10000000-0000-4000-8000-000000000001",
|
|
842
|
+
runs: {
|
|
843
|
+
success: "sample-support-success",
|
|
844
|
+
failure: "sample-support-failure",
|
|
845
|
+
approval: "sample-support-approval",
|
|
846
|
+
followUp: "sample-support-follow-up",
|
|
847
|
+
baseline: "sample-support-baseline"
|
|
848
|
+
},
|
|
849
|
+
sessions: {
|
|
850
|
+
success: "sample-session-success",
|
|
851
|
+
failure: "sample-session-failure",
|
|
852
|
+
approval: "sample-session-approval",
|
|
853
|
+
followUp: "sample-session-success",
|
|
854
|
+
baseline: "sample-session-baseline"
|
|
855
|
+
},
|
|
856
|
+
specialistWorkflowIds: {
|
|
857
|
+
research: "sample-order-research",
|
|
858
|
+
resolution: "sample-order-resolution"
|
|
859
|
+
},
|
|
860
|
+
specialistRevisionIds: {
|
|
861
|
+
research: "10000000-0000-4000-8000-000000000020",
|
|
862
|
+
resolution: "10000000-0000-4000-8000-000000000021"
|
|
863
|
+
},
|
|
864
|
+
evaluationIds: {
|
|
865
|
+
baseline: "10000000-0000-4000-8000-000000000030",
|
|
866
|
+
candidate: "10000000-0000-4000-8000-000000000031",
|
|
867
|
+
latest: "10000000-0000-4000-8000-000000000003"
|
|
868
|
+
},
|
|
869
|
+
candidateEvalRunId: "10000000-0000-4000-8000-000000000032",
|
|
870
|
+
pendingApprovalId: "sample-pending-credit-review",
|
|
871
|
+
pendingChoiceId: "sample-pending-parcel-choice",
|
|
872
|
+
diagnosticIds: {
|
|
873
|
+
budgetLimit: "30000000-0000-4000-8000-e6dfcc9c117a"
|
|
874
|
+
},
|
|
875
|
+
interruptId: "sample-refund-approval",
|
|
876
|
+
promptId: "10000000-0000-4000-8000-000000000002",
|
|
877
|
+
evaluationId: "10000000-0000-4000-8000-000000000003",
|
|
878
|
+
evalRunId: "10000000-0000-4000-8000-000000000004",
|
|
879
|
+
baselineEvalRunId: "10000000-0000-4000-8000-000000000005",
|
|
880
|
+
caseId: "order-status",
|
|
881
|
+
gradingCaseId: "delivery-note",
|
|
882
|
+
targetId: "sample-support",
|
|
883
|
+
suiteId: "sample-support-quality",
|
|
884
|
+
anchors: {
|
|
885
|
+
selector: "sample-project-selector",
|
|
886
|
+
notice: "sample-project-notice",
|
|
887
|
+
visibility: "sample-project-visibility"
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
|
|
396
891
|
// src/tools.ts
|
|
397
|
-
var
|
|
398
|
-
var ToolOutcomeSchema =
|
|
892
|
+
var import_zod5 = require("zod");
|
|
893
|
+
var ToolOutcomeSchema = import_zod5.z.enum([
|
|
399
894
|
"success",
|
|
400
895
|
"denied",
|
|
401
896
|
"fault",
|
|
402
897
|
"cancelled"
|
|
403
898
|
]);
|
|
404
|
-
var ToolObservationSchema =
|
|
405
|
-
version:
|
|
406
|
-
name:
|
|
407
|
-
toolCallId:
|
|
408
|
-
attemptId:
|
|
409
|
-
callingMode:
|
|
410
|
-
executed:
|
|
899
|
+
var ToolObservationSchema = import_zod5.z.object({
|
|
900
|
+
version: import_zod5.z.literal(1),
|
|
901
|
+
name: import_zod5.z.string().min(1).max(256),
|
|
902
|
+
toolCallId: import_zod5.z.string().min(1),
|
|
903
|
+
attemptId: import_zod5.z.string().min(1),
|
|
904
|
+
callingMode: import_zod5.z.enum(["direct", "model"]),
|
|
905
|
+
executed: import_zod5.z.boolean(),
|
|
411
906
|
outcome: ToolOutcomeSchema.optional(),
|
|
412
|
-
denialCode:
|
|
413
|
-
errorType:
|
|
414
|
-
errorMessage:
|
|
415
|
-
diagnosticId:
|
|
416
|
-
durationMs:
|
|
417
|
-
workflowId:
|
|
418
|
-
nodeId:
|
|
419
|
-
workflowRevisionId:
|
|
420
|
-
runId:
|
|
421
|
-
invocationId:
|
|
422
|
-
parentInvocationId:
|
|
423
|
-
branchId:
|
|
424
|
-
observationKind:
|
|
425
|
-
suspended:
|
|
426
|
-
source:
|
|
427
|
-
runId:
|
|
428
|
-
invocationId:
|
|
429
|
-
branchId:
|
|
430
|
-
toolCallId:
|
|
431
|
-
attemptId:
|
|
907
|
+
denialCode: import_zod5.z.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional(),
|
|
908
|
+
errorType: import_zod5.z.string().max(256).optional(),
|
|
909
|
+
errorMessage: import_zod5.z.string().max(8192).optional(),
|
|
910
|
+
diagnosticId: import_zod5.z.string().uuid().optional(),
|
|
911
|
+
durationMs: import_zod5.z.number().finite().nonnegative().optional(),
|
|
912
|
+
workflowId: import_zod5.z.string().optional(),
|
|
913
|
+
nodeId: import_zod5.z.string().optional(),
|
|
914
|
+
workflowRevisionId: import_zod5.z.string().optional(),
|
|
915
|
+
runId: import_zod5.z.string().optional(),
|
|
916
|
+
invocationId: import_zod5.z.string().optional(),
|
|
917
|
+
parentInvocationId: import_zod5.z.string().optional(),
|
|
918
|
+
branchId: import_zod5.z.string().optional(),
|
|
919
|
+
observationKind: import_zod5.z.enum(["reused", "waiting"]).optional(),
|
|
920
|
+
suspended: import_zod5.z.boolean().optional(),
|
|
921
|
+
source: import_zod5.z.object({
|
|
922
|
+
runId: import_zod5.z.string().optional(),
|
|
923
|
+
invocationId: import_zod5.z.string().optional(),
|
|
924
|
+
branchId: import_zod5.z.string().optional(),
|
|
925
|
+
toolCallId: import_zod5.z.string(),
|
|
926
|
+
attemptId: import_zod5.z.string()
|
|
432
927
|
}).strict().optional()
|
|
433
928
|
});
|
|
434
|
-
var WorkflowToolSchema =
|
|
435
|
-
name:
|
|
436
|
-
description:
|
|
437
|
-
callingMode:
|
|
438
|
-
provenance:
|
|
439
|
-
inputFields:
|
|
440
|
-
|
|
929
|
+
var WorkflowToolSchema = import_zod5.z.object({
|
|
930
|
+
name: import_zod5.z.string().min(1).max(256),
|
|
931
|
+
description: import_zod5.z.string().max(4096).optional(),
|
|
932
|
+
callingMode: import_zod5.z.enum(["direct", "model"]),
|
|
933
|
+
provenance: import_zod5.z.enum(["source", "observed"]),
|
|
934
|
+
inputFields: import_zod5.z.array(
|
|
935
|
+
import_zod5.z.object({ name: import_zod5.z.string(), type: import_zod5.z.string(), required: import_zod5.z.boolean() }).strict()
|
|
441
936
|
).optional()
|
|
442
937
|
}).strict();
|
|
443
|
-
var ToolDiscoverySchema =
|
|
444
|
-
status:
|
|
445
|
-
publishedAt:
|
|
446
|
-
warnings:
|
|
938
|
+
var ToolDiscoverySchema = import_zod5.z.object({
|
|
939
|
+
status: import_zod5.z.enum(["complete", "unresolved"]),
|
|
940
|
+
publishedAt: import_zod5.z.string().datetime().optional(),
|
|
941
|
+
warnings: import_zod5.z.array(import_zod5.z.string()).optional()
|
|
447
942
|
}).strict();
|
|
448
943
|
var StudioToolSchema = WorkflowToolSchema.extend({
|
|
449
|
-
callingMode:
|
|
450
|
-
calls:
|
|
451
|
-
replays:
|
|
452
|
-
successes:
|
|
453
|
-
denials:
|
|
454
|
-
faults:
|
|
455
|
-
cancellations:
|
|
456
|
-
p50DurationMs:
|
|
457
|
-
p95DurationMs:
|
|
944
|
+
callingMode: import_zod5.z.enum(["direct", "model", "unknown"]),
|
|
945
|
+
calls: import_zod5.z.number().nonnegative(),
|
|
946
|
+
replays: import_zod5.z.number().nonnegative(),
|
|
947
|
+
successes: import_zod5.z.number().nonnegative(),
|
|
948
|
+
denials: import_zod5.z.number().nonnegative(),
|
|
949
|
+
faults: import_zod5.z.number().nonnegative(),
|
|
950
|
+
cancellations: import_zod5.z.number().nonnegative(),
|
|
951
|
+
p50DurationMs: import_zod5.z.number().nonnegative().nullable(),
|
|
952
|
+
p95DurationMs: import_zod5.z.number().nonnegative().nullable()
|
|
458
953
|
}).strict();
|
|
459
954
|
|
|
955
|
+
// src/diagnostic-capture.ts
|
|
956
|
+
var import_errors = require("@kortyx/core/errors");
|
|
957
|
+
var encoder = new TextEncoder();
|
|
958
|
+
var nativeStackGetter = Object.getOwnPropertyDescriptor(
|
|
959
|
+
new Error(),
|
|
960
|
+
"stack"
|
|
961
|
+
)?.get;
|
|
962
|
+
function nativeStack(object, getter) {
|
|
963
|
+
if (!getter || getter !== nativeStackGetter)
|
|
964
|
+
throw new Error("Custom stack accessor");
|
|
965
|
+
for (const key2 of ["name", "message"]) {
|
|
966
|
+
let cursor = object;
|
|
967
|
+
while (cursor) {
|
|
968
|
+
const descriptor = Object.getOwnPropertyDescriptor(cursor, key2);
|
|
969
|
+
if (descriptor) {
|
|
970
|
+
if (!("value" in descriptor) || typeof descriptor.value !== "string")
|
|
971
|
+
throw new Error("Custom error formatting");
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
cursor = Object.getPrototypeOf(cursor);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
const formatter = Object.getOwnPropertyDescriptor(Error, "prepareStackTrace");
|
|
978
|
+
if (formatter && (!("value" in formatter) || !formatter.writable))
|
|
979
|
+
throw new Error("Custom stack formatter");
|
|
980
|
+
Object.defineProperty(Error, "prepareStackTrace", {
|
|
981
|
+
...formatter ?? { configurable: true, writable: true },
|
|
982
|
+
value: void 0
|
|
983
|
+
});
|
|
984
|
+
try {
|
|
985
|
+
return getter.call(object);
|
|
986
|
+
} finally {
|
|
987
|
+
if (formatter) Object.defineProperty(Error, "prepareStackTrace", formatter);
|
|
988
|
+
else Reflect.deleteProperty(Error, "prepareStackTrace");
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
var pointer = (key2) => key2.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
992
|
+
function captureDiagnosticContent(error, project) {
|
|
993
|
+
const omissions = [];
|
|
994
|
+
const redactions = [];
|
|
995
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
|
996
|
+
let nodes = 0;
|
|
997
|
+
let remaining = DIAGNOSTIC_LIMITS.bytes - 64 * 1024;
|
|
998
|
+
const omit = (path, reason, extra = {}) => {
|
|
999
|
+
if (omissions.length < 1e3)
|
|
1000
|
+
omissions.push({ path: path.slice(0, 4096), reason, ...extra });
|
|
1001
|
+
return { $omitted: reason };
|
|
1002
|
+
};
|
|
1003
|
+
const visit = (value, path, depth) => {
|
|
1004
|
+
if (++nodes > DIAGNOSTIC_LIMITS.nodes) return omit(path, "node_limit");
|
|
1005
|
+
if (depth > DIAGNOSTIC_LIMITS.depth) return omit(path, "depth_limit");
|
|
1006
|
+
if (typeof value === "string") {
|
|
1007
|
+
const clean = redactDiagnosticText(value);
|
|
1008
|
+
if (clean !== value && redactions.length < 1e3)
|
|
1009
|
+
redactions.push({
|
|
1010
|
+
path: path.slice(0, 4096),
|
|
1011
|
+
reason: "credential_text"
|
|
1012
|
+
});
|
|
1013
|
+
const bytes = encoder.encode(JSON.stringify(clean)).length;
|
|
1014
|
+
if (bytes > remaining)
|
|
1015
|
+
return omit(path, "byte_limit", {
|
|
1016
|
+
originalBytes: encoder.encode(value).length
|
|
1017
|
+
});
|
|
1018
|
+
remaining -= bytes;
|
|
1019
|
+
return clean;
|
|
1020
|
+
}
|
|
1021
|
+
if (value === null || typeof value === "boolean") return value;
|
|
1022
|
+
if (typeof value === "number")
|
|
1023
|
+
return Number.isFinite(value) ? value : { $type: "number", value: String(value) };
|
|
1024
|
+
if (typeof value === "bigint")
|
|
1025
|
+
return { $type: "bigint", value: value.toString() };
|
|
1026
|
+
if (typeof value === "undefined") return { $type: "undefined" };
|
|
1027
|
+
if (typeof value === "function" || typeof value === "symbol")
|
|
1028
|
+
return omit(path, `unsupported_${typeof value}`);
|
|
1029
|
+
const object = value;
|
|
1030
|
+
const reference = seen.get(object);
|
|
1031
|
+
if (reference) return { $ref: reference };
|
|
1032
|
+
seen.set(object, path);
|
|
1033
|
+
remaining -= 32;
|
|
1034
|
+
if (remaining < 0) return omit(path, "byte_limit");
|
|
1035
|
+
try {
|
|
1036
|
+
if (value instanceof Date)
|
|
1037
|
+
return { $type: "Date", value: Date.prototype.toISOString.call(value) };
|
|
1038
|
+
if (value instanceof Map || value instanceof Set) {
|
|
1039
|
+
const isMap = value instanceof Map;
|
|
1040
|
+
const iterator = isMap ? Map.prototype.entries.call(value) : Set.prototype.values.call(value);
|
|
1041
|
+
const count = Object.getOwnPropertyDescriptor(
|
|
1042
|
+
isMap ? Map.prototype : Set.prototype,
|
|
1043
|
+
"size"
|
|
1044
|
+
)?.get?.call(value);
|
|
1045
|
+
const entries = [];
|
|
1046
|
+
for (let index = 0; index < Math.min(count, DIAGNOSTIC_LIMITS.properties); index++)
|
|
1047
|
+
entries.push(iterator.next().value);
|
|
1048
|
+
if (count > entries.length)
|
|
1049
|
+
omissions.push({
|
|
1050
|
+
path,
|
|
1051
|
+
reason: "collection_limit",
|
|
1052
|
+
originalCount: count
|
|
1053
|
+
});
|
|
1054
|
+
return isMap ? {
|
|
1055
|
+
$type: "Map",
|
|
1056
|
+
entries: visit(entries, `${path}/entries`, depth + 1)
|
|
1057
|
+
} : {
|
|
1058
|
+
$type: "Set",
|
|
1059
|
+
values: visit(entries, `${path}/values`, depth + 1)
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
if (Array.isArray(value)) {
|
|
1063
|
+
const count = Math.min(value.length, DIAGNOSTIC_LIMITS.properties);
|
|
1064
|
+
const items = Array.from(
|
|
1065
|
+
{ length: count },
|
|
1066
|
+
(_, index) => read(value, String(index), `${path}/${index}`, depth)
|
|
1067
|
+
);
|
|
1068
|
+
if (count < value.length)
|
|
1069
|
+
items.push(
|
|
1070
|
+
omit(path, "collection_limit", { originalCount: value.length })
|
|
1071
|
+
);
|
|
1072
|
+
return items;
|
|
1073
|
+
}
|
|
1074
|
+
const keys = Object.getOwnPropertyNames(object);
|
|
1075
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
1076
|
+
if (value instanceof Error) {
|
|
1077
|
+
const ownName = Object.getOwnPropertyDescriptor(object, "name");
|
|
1078
|
+
let type = ownName && "value" in ownName ? ownName.value : void 0;
|
|
1079
|
+
if (typeof type !== "string") {
|
|
1080
|
+
const name2 = Object.getOwnPropertyDescriptor(
|
|
1081
|
+
Object.getPrototypeOf(value),
|
|
1082
|
+
"name"
|
|
1083
|
+
);
|
|
1084
|
+
type = name2 && "value" in name2 ? name2.value : "Error";
|
|
1085
|
+
}
|
|
1086
|
+
result.type = visit(
|
|
1087
|
+
typeof type === "string" ? type : "Error",
|
|
1088
|
+
`${path}/type`,
|
|
1089
|
+
depth + 1
|
|
1090
|
+
);
|
|
1091
|
+
}
|
|
1092
|
+
for (const key2 of keys.slice(0, DIAGNOSTIC_LIMITS.properties)) {
|
|
1093
|
+
if (["__proto__", "constructor", "prototype"].includes(key2)) {
|
|
1094
|
+
result[key2] = omit(`${path}/${pointer(key2)}`, "unsafe_key");
|
|
1095
|
+
continue;
|
|
1096
|
+
}
|
|
1097
|
+
remaining -= encoder.encode(key2).length + 4;
|
|
1098
|
+
result[key2] = read(object, key2, `${path}/${pointer(key2)}`, depth);
|
|
1099
|
+
}
|
|
1100
|
+
if (keys.length > DIAGNOSTIC_LIMITS.properties)
|
|
1101
|
+
result.$omittedProperties = omit(path, "property_limit", {
|
|
1102
|
+
originalCount: keys.length
|
|
1103
|
+
});
|
|
1104
|
+
return result;
|
|
1105
|
+
} catch {
|
|
1106
|
+
return omit(path, "unreadable_object");
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
const read = (object, key2, path, depth) => {
|
|
1110
|
+
if (isPrivateDiagnosticField(key2)) {
|
|
1111
|
+
if (redactions.length < 1e3)
|
|
1112
|
+
redactions.push({
|
|
1113
|
+
path: path.slice(0, 4096),
|
|
1114
|
+
reason: "credential_field"
|
|
1115
|
+
});
|
|
1116
|
+
return "[REDACTED]";
|
|
1117
|
+
}
|
|
1118
|
+
try {
|
|
1119
|
+
const property = Object.getOwnPropertyDescriptor(object, key2);
|
|
1120
|
+
if (property && "value" in property)
|
|
1121
|
+
return visit(property.value, path, depth + 1);
|
|
1122
|
+
if (key2 === "stack" && object instanceof Error && property?.get && property.get === nativeStackGetter)
|
|
1123
|
+
return visit(nativeStack(object, property.get), path, depth + 1);
|
|
1124
|
+
return omit(
|
|
1125
|
+
path,
|
|
1126
|
+
property ? "accessor_not_evaluated" : "unavailable_property"
|
|
1127
|
+
);
|
|
1128
|
+
} catch {
|
|
1129
|
+
return omit(path, "unreadable_property");
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
try {
|
|
1133
|
+
const original = project ? project(error) : error;
|
|
1134
|
+
if (project && original === null) return null;
|
|
1135
|
+
const captured = visit(original, "#/data", 0);
|
|
1136
|
+
const upstreamOmissions = (0, import_errors.errorProperty)(original, "diagnosticOmissions");
|
|
1137
|
+
if (Array.isArray(upstreamOmissions))
|
|
1138
|
+
for (const note of upstreamOmissions.slice(0, 1e3)) {
|
|
1139
|
+
const path = (0, import_errors.errorProperty)(note, "path");
|
|
1140
|
+
const reason = (0, import_errors.errorProperty)(note, "reason");
|
|
1141
|
+
if (typeof path === "string" && typeof reason === "string")
|
|
1142
|
+
omissions.push({
|
|
1143
|
+
path: redactDiagnosticText(path).slice(0, 4096),
|
|
1144
|
+
reason: redactDiagnosticText(reason).slice(0, 128)
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
const data = captured && typeof captured === "object" && !Array.isArray(captured) ? captured : {
|
|
1148
|
+
type: "Error",
|
|
1149
|
+
message: typeof captured === "string" ? captured : "Execution reported a fault.",
|
|
1150
|
+
value: captured
|
|
1151
|
+
};
|
|
1152
|
+
if (typeof data.message !== "string" && !("message" in data))
|
|
1153
|
+
data.message = "Execution reported a fault.";
|
|
1154
|
+
if (!("type" in data))
|
|
1155
|
+
data.type = typeof data.name === "string" ? data.name : "Error";
|
|
1156
|
+
const content = {
|
|
1157
|
+
schemaVersion: 1,
|
|
1158
|
+
data,
|
|
1159
|
+
capture: {
|
|
1160
|
+
status: omissions.length ? "partial" : "complete",
|
|
1161
|
+
omissions,
|
|
1162
|
+
redactions
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
if (encoder.encode(JSON.stringify(content)).length > DIAGNOSTIC_LIMITS.bytes)
|
|
1166
|
+
return {
|
|
1167
|
+
schemaVersion: 1,
|
|
1168
|
+
data: {
|
|
1169
|
+
type: "Error",
|
|
1170
|
+
message: "Diagnostic exceeded the capture budget."
|
|
1171
|
+
},
|
|
1172
|
+
capture: {
|
|
1173
|
+
status: "partial",
|
|
1174
|
+
redactions: [],
|
|
1175
|
+
omissions: [{ path: "#/data", reason: "serialized_byte_limit" }]
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
return content;
|
|
1179
|
+
} catch {
|
|
1180
|
+
return {
|
|
1181
|
+
schemaVersion: 1,
|
|
1182
|
+
data: { type: "Error", message: "Diagnostic capture failed." },
|
|
1183
|
+
capture: {
|
|
1184
|
+
status: "failed",
|
|
1185
|
+
redactions: [],
|
|
1186
|
+
omissions: [{ path: "#/data", reason: "projection_or_capture_failed" }]
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
460
1192
|
// src/prompts.ts
|
|
461
1193
|
var import_browser = require("@kortyx/prompts/browser");
|
|
462
|
-
var
|
|
463
|
-
var name =
|
|
464
|
-
var version =
|
|
465
|
-
var revision =
|
|
466
|
-
var PromptCategorySchema =
|
|
467
|
-
id:
|
|
1194
|
+
var import_zod6 = require("zod");
|
|
1195
|
+
var name = import_zod6.z.string().trim().min(1).max(200);
|
|
1196
|
+
var version = import_zod6.z.number().int().positive();
|
|
1197
|
+
var revision = import_zod6.z.number().int().nonnegative();
|
|
1198
|
+
var PromptCategorySchema = import_zod6.z.object({
|
|
1199
|
+
id: import_zod6.z.uuid(),
|
|
468
1200
|
name,
|
|
469
|
-
parentId:
|
|
1201
|
+
parentId: import_zod6.z.uuid().nullable(),
|
|
470
1202
|
revision
|
|
471
1203
|
});
|
|
472
|
-
var PromptGroupSchema =
|
|
473
|
-
id:
|
|
1204
|
+
var PromptGroupSchema = import_zod6.z.object({
|
|
1205
|
+
id: import_zod6.z.uuid(),
|
|
474
1206
|
name,
|
|
475
1207
|
revision,
|
|
476
|
-
members:
|
|
477
|
-
|
|
478
|
-
promptId:
|
|
1208
|
+
members: import_zod6.z.array(
|
|
1209
|
+
import_zod6.z.object({
|
|
1210
|
+
promptId: import_zod6.z.uuid(),
|
|
479
1211
|
version,
|
|
480
1212
|
key: import_browser.PromptKeySchema.optional(),
|
|
481
1213
|
name: name.optional(),
|
|
482
|
-
archived:
|
|
1214
|
+
archived: import_zod6.z.boolean().optional()
|
|
483
1215
|
})
|
|
484
1216
|
).max(100),
|
|
485
|
-
updatedAt:
|
|
1217
|
+
updatedAt: import_zod6.z.string()
|
|
486
1218
|
});
|
|
487
|
-
var PromptAssignmentSchema =
|
|
1219
|
+
var PromptAssignmentSchema = import_zod6.z.object({
|
|
488
1220
|
tag: import_browser.PromptTagSchema,
|
|
489
1221
|
version,
|
|
490
1222
|
revision,
|
|
491
|
-
updatedAt:
|
|
1223
|
+
updatedAt: import_zod6.z.string()
|
|
492
1224
|
});
|
|
493
|
-
var PromptAssetSchema =
|
|
494
|
-
id:
|
|
1225
|
+
var PromptAssetSchema = import_zod6.z.object({
|
|
1226
|
+
id: import_zod6.z.uuid(),
|
|
495
1227
|
key: import_browser.PromptKeySchema,
|
|
496
1228
|
name,
|
|
497
|
-
categoryId:
|
|
1229
|
+
categoryId: import_zod6.z.uuid().nullable(),
|
|
498
1230
|
latestVersion: version,
|
|
499
1231
|
revision,
|
|
500
|
-
archived:
|
|
501
|
-
updatedAt:
|
|
502
|
-
assignments:
|
|
1232
|
+
archived: import_zod6.z.boolean(),
|
|
1233
|
+
updatedAt: import_zod6.z.string(),
|
|
1234
|
+
assignments: import_zod6.z.array(PromptAssignmentSchema)
|
|
503
1235
|
});
|
|
504
|
-
var PromptLibrarySchema =
|
|
505
|
-
schemaVersion:
|
|
506
|
-
assets:
|
|
507
|
-
categories:
|
|
508
|
-
groups:
|
|
509
|
-
totalCount:
|
|
510
|
-
nextCursor:
|
|
511
|
-
permissions:
|
|
512
|
-
edit:
|
|
513
|
-
promote:
|
|
514
|
-
review:
|
|
515
|
-
settings:
|
|
1236
|
+
var PromptLibrarySchema = import_zod6.z.object({
|
|
1237
|
+
schemaVersion: import_zod6.z.literal(1),
|
|
1238
|
+
assets: import_zod6.z.array(PromptAssetSchema),
|
|
1239
|
+
categories: import_zod6.z.array(PromptCategorySchema),
|
|
1240
|
+
groups: import_zod6.z.array(PromptGroupSchema),
|
|
1241
|
+
totalCount: import_zod6.z.number().int().nonnegative(),
|
|
1242
|
+
nextCursor: import_zod6.z.string().nullable(),
|
|
1243
|
+
permissions: import_zod6.z.object({
|
|
1244
|
+
edit: import_zod6.z.boolean(),
|
|
1245
|
+
promote: import_zod6.z.boolean(),
|
|
1246
|
+
review: import_zod6.z.boolean(),
|
|
1247
|
+
settings: import_zod6.z.boolean()
|
|
516
1248
|
})
|
|
517
1249
|
});
|
|
518
1250
|
var PromptStoredVersionSchema = import_browser.PromptVersionSchema.extend({
|
|
519
|
-
promptId:
|
|
520
|
-
note:
|
|
521
|
-
author:
|
|
522
|
-
createdAt:
|
|
523
|
-
origin:
|
|
524
|
-
apiUrl:
|
|
525
|
-
projectId:
|
|
526
|
-
key:
|
|
1251
|
+
promptId: import_zod6.z.uuid(),
|
|
1252
|
+
note: import_zod6.z.string(),
|
|
1253
|
+
author: import_zod6.z.string(),
|
|
1254
|
+
createdAt: import_zod6.z.string(),
|
|
1255
|
+
origin: import_zod6.z.object({
|
|
1256
|
+
apiUrl: import_zod6.z.string(),
|
|
1257
|
+
projectId: import_zod6.z.string(),
|
|
1258
|
+
key: import_zod6.z.string(),
|
|
527
1259
|
version,
|
|
528
|
-
hash:
|
|
1260
|
+
hash: import_zod6.z.string()
|
|
529
1261
|
}).nullable()
|
|
530
1262
|
});
|
|
531
|
-
var PromptPolicySchema =
|
|
1263
|
+
var PromptPolicySchema = import_zod6.z.object({
|
|
532
1264
|
revision,
|
|
533
|
-
requireTest:
|
|
534
|
-
requireChangeNote:
|
|
535
|
-
requiredSuites:
|
|
536
|
-
requiredReviews:
|
|
537
|
-
allowException:
|
|
1265
|
+
requireTest: import_zod6.z.boolean(),
|
|
1266
|
+
requireChangeNote: import_zod6.z.boolean().default(false),
|
|
1267
|
+
requiredSuites: import_zod6.z.array(import_zod6.z.object({ targetId: name, suiteId: name })).max(100),
|
|
1268
|
+
requiredReviews: import_zod6.z.number().int().min(0).max(10),
|
|
1269
|
+
allowException: import_zod6.z.boolean()
|
|
538
1270
|
});
|
|
539
|
-
var PromptEvidenceSchema =
|
|
540
|
-
environment:
|
|
541
|
-
runId:
|
|
542
|
-
evaluationId:
|
|
543
|
-
targetId:
|
|
544
|
-
suiteId:
|
|
545
|
-
suiteRevision:
|
|
546
|
-
status:
|
|
1271
|
+
var PromptEvidenceSchema = import_zod6.z.object({
|
|
1272
|
+
environment: import_zod6.z.string(),
|
|
1273
|
+
runId: import_zod6.z.string(),
|
|
1274
|
+
evaluationId: import_zod6.z.string().nullable().optional(),
|
|
1275
|
+
targetId: import_zod6.z.string(),
|
|
1276
|
+
suiteId: import_zod6.z.string(),
|
|
1277
|
+
suiteRevision: import_zod6.z.string().optional(),
|
|
1278
|
+
status: import_zod6.z.string(),
|
|
547
1279
|
version,
|
|
548
|
-
fullSuite:
|
|
549
|
-
usage:
|
|
1280
|
+
fullSuite: import_zod6.z.boolean(),
|
|
1281
|
+
usage: import_zod6.z.enum([
|
|
550
1282
|
"verified",
|
|
551
1283
|
"pending",
|
|
552
1284
|
"not-used",
|
|
553
1285
|
"mismatch",
|
|
554
1286
|
"context-differs"
|
|
555
1287
|
]),
|
|
556
|
-
groupName:
|
|
557
|
-
createdAt:
|
|
558
|
-
companions:
|
|
1288
|
+
groupName: import_zod6.z.string().nullable(),
|
|
1289
|
+
createdAt: import_zod6.z.string(),
|
|
1290
|
+
companions: import_zod6.z.array(import_zod6.z.object({ key: import_browser.PromptKeySchema, version }))
|
|
559
1291
|
});
|
|
560
|
-
var PromptUsageSchema =
|
|
561
|
-
eventId:
|
|
562
|
-
runId:
|
|
563
|
-
sessionId:
|
|
564
|
-
nodeId:
|
|
565
|
-
version:
|
|
566
|
-
hash:
|
|
567
|
-
source:
|
|
568
|
-
model:
|
|
569
|
-
environment:
|
|
570
|
-
occurredAt:
|
|
571
|
-
captured:
|
|
1292
|
+
var PromptUsageSchema = import_zod6.z.object({
|
|
1293
|
+
eventId: import_zod6.z.string(),
|
|
1294
|
+
runId: import_zod6.z.string(),
|
|
1295
|
+
sessionId: import_zod6.z.string().nullable(),
|
|
1296
|
+
nodeId: import_zod6.z.string().nullable(),
|
|
1297
|
+
version: import_zod6.z.number().int(),
|
|
1298
|
+
hash: import_zod6.z.string().nullable(),
|
|
1299
|
+
source: import_zod6.z.string().nullable(),
|
|
1300
|
+
model: import_zod6.z.string().nullable(),
|
|
1301
|
+
environment: import_zod6.z.string(),
|
|
1302
|
+
occurredAt: import_zod6.z.string(),
|
|
1303
|
+
captured: import_zod6.z.boolean()
|
|
572
1304
|
});
|
|
573
|
-
var PromptDetailSchema =
|
|
1305
|
+
var PromptDetailSchema = import_zod6.z.object({
|
|
574
1306
|
asset: PromptAssetSchema,
|
|
575
|
-
versions:
|
|
576
|
-
versionsNextCursor:
|
|
1307
|
+
versions: import_zod6.z.array(PromptStoredVersionSchema),
|
|
1308
|
+
versionsNextCursor: import_zod6.z.string().nullable().optional(),
|
|
577
1309
|
draft: import_browser.PromptContentSchema.nullable(),
|
|
578
|
-
draftBase:
|
|
1310
|
+
draftBase: import_zod6.z.number().int().nullable(),
|
|
579
1311
|
draftRevision: revision,
|
|
580
|
-
evidence:
|
|
581
|
-
usage:
|
|
582
|
-
activity:
|
|
583
|
-
|
|
584
|
-
id:
|
|
585
|
-
action:
|
|
586
|
-
actor:
|
|
587
|
-
details:
|
|
588
|
-
createdAt:
|
|
1312
|
+
evidence: import_zod6.z.array(PromptEvidenceSchema),
|
|
1313
|
+
usage: import_zod6.z.array(PromptUsageSchema),
|
|
1314
|
+
activity: import_zod6.z.array(
|
|
1315
|
+
import_zod6.z.object({
|
|
1316
|
+
id: import_zod6.z.string(),
|
|
1317
|
+
action: import_zod6.z.string(),
|
|
1318
|
+
actor: import_zod6.z.string(),
|
|
1319
|
+
details: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.unknown()),
|
|
1320
|
+
createdAt: import_zod6.z.string()
|
|
589
1321
|
})
|
|
590
1322
|
),
|
|
591
|
-
policies:
|
|
592
|
-
reviews:
|
|
593
|
-
|
|
1323
|
+
policies: import_zod6.z.array(PromptPolicySchema),
|
|
1324
|
+
reviews: import_zod6.z.array(
|
|
1325
|
+
import_zod6.z.object({
|
|
594
1326
|
version,
|
|
595
|
-
hash:
|
|
596
|
-
independent:
|
|
597
|
-
reviewer:
|
|
598
|
-
note:
|
|
599
|
-
createdAt:
|
|
1327
|
+
hash: import_zod6.z.string(),
|
|
1328
|
+
independent: import_zod6.z.boolean(),
|
|
1329
|
+
reviewer: import_zod6.z.string(),
|
|
1330
|
+
note: import_zod6.z.string(),
|
|
1331
|
+
createdAt: import_zod6.z.string()
|
|
600
1332
|
})
|
|
601
1333
|
).optional()
|
|
602
1334
|
});
|
|
603
|
-
var PromptMutationSchema =
|
|
604
|
-
|
|
605
|
-
action:
|
|
606
|
-
id:
|
|
1335
|
+
var PromptMutationSchema = import_zod6.z.discriminatedUnion("action", [
|
|
1336
|
+
import_zod6.z.object({
|
|
1337
|
+
action: import_zod6.z.literal("tag-set"),
|
|
1338
|
+
id: import_zod6.z.uuid(),
|
|
607
1339
|
tag: import_browser.PromptTagSchema.refine(
|
|
608
1340
|
(tag) => tag !== "live",
|
|
609
1341
|
"Use promotion to update live."
|
|
@@ -611,183 +1343,183 @@ var PromptMutationSchema = import_zod4.z.discriminatedUnion("action", [
|
|
|
611
1343
|
version,
|
|
612
1344
|
expectedRevision: revision
|
|
613
1345
|
}).strict(),
|
|
614
|
-
|
|
615
|
-
action:
|
|
616
|
-
id:
|
|
1346
|
+
import_zod6.z.object({
|
|
1347
|
+
action: import_zod6.z.literal("tag-remove"),
|
|
1348
|
+
id: import_zod6.z.uuid(),
|
|
617
1349
|
tag: import_browser.PromptTagSchema.refine(
|
|
618
1350
|
(tag) => tag !== "live",
|
|
619
1351
|
"The live tag cannot be removed manually."
|
|
620
1352
|
),
|
|
621
1353
|
expectedRevision: revision
|
|
622
1354
|
}).strict(),
|
|
623
|
-
|
|
624
|
-
action:
|
|
625
|
-
assets:
|
|
626
|
-
categoryId:
|
|
627
|
-
archived:
|
|
1355
|
+
import_zod6.z.object({
|
|
1356
|
+
action: import_zod6.z.literal("bulk-update"),
|
|
1357
|
+
assets: import_zod6.z.array(import_zod6.z.object({ id: import_zod6.z.uuid(), expectedRevision: revision })).min(1).max(100),
|
|
1358
|
+
categoryId: import_zod6.z.uuid().nullable().optional(),
|
|
1359
|
+
archived: import_zod6.z.boolean().optional()
|
|
628
1360
|
}).strict().refine(
|
|
629
1361
|
(value) => value.categoryId !== void 0 || value.archived !== void 0,
|
|
630
1362
|
"Choose a category or archive state."
|
|
631
1363
|
),
|
|
632
|
-
|
|
633
|
-
action:
|
|
1364
|
+
import_zod6.z.object({
|
|
1365
|
+
action: import_zod6.z.literal("create"),
|
|
634
1366
|
key: import_browser.PromptKeySchema,
|
|
635
1367
|
name,
|
|
636
|
-
categoryId:
|
|
1368
|
+
categoryId: import_zod6.z.uuid().nullable().default(null),
|
|
637
1369
|
content: import_browser.PromptContentSchema,
|
|
638
|
-
note:
|
|
639
|
-
idempotencyKey:
|
|
1370
|
+
note: import_zod6.z.string().trim().max(2e3).default(""),
|
|
1371
|
+
idempotencyKey: import_zod6.z.uuid().optional()
|
|
640
1372
|
}).strict(),
|
|
641
|
-
|
|
642
|
-
action:
|
|
643
|
-
id:
|
|
1373
|
+
import_zod6.z.object({
|
|
1374
|
+
action: import_zod6.z.literal("draft"),
|
|
1375
|
+
id: import_zod6.z.uuid(),
|
|
644
1376
|
content: import_browser.PromptContentSchema,
|
|
645
1377
|
baseVersion: version,
|
|
646
1378
|
expectedRevision: revision
|
|
647
1379
|
}).strict(),
|
|
648
|
-
|
|
649
|
-
action:
|
|
650
|
-
id:
|
|
1380
|
+
import_zod6.z.object({
|
|
1381
|
+
action: import_zod6.z.literal("discard-draft"),
|
|
1382
|
+
id: import_zod6.z.uuid(),
|
|
651
1383
|
expectedRevision: revision
|
|
652
1384
|
}).strict(),
|
|
653
|
-
|
|
654
|
-
action:
|
|
655
|
-
id:
|
|
1385
|
+
import_zod6.z.object({
|
|
1386
|
+
action: import_zod6.z.literal("save"),
|
|
1387
|
+
id: import_zod6.z.uuid(),
|
|
656
1388
|
content: import_browser.PromptContentSchema,
|
|
657
1389
|
baseVersion: version,
|
|
658
|
-
expectedHash:
|
|
1390
|
+
expectedHash: import_zod6.z.string().regex(/^[a-f0-9]{64}$/),
|
|
659
1391
|
expectedDraftRevision: revision.optional(),
|
|
660
|
-
note:
|
|
661
|
-
idempotencyKey:
|
|
1392
|
+
note: import_zod6.z.string().trim().max(2e3).default(""),
|
|
1393
|
+
idempotencyKey: import_zod6.z.uuid()
|
|
662
1394
|
}).strict(),
|
|
663
|
-
|
|
664
|
-
action:
|
|
665
|
-
id:
|
|
1395
|
+
import_zod6.z.object({
|
|
1396
|
+
action: import_zod6.z.literal("update"),
|
|
1397
|
+
id: import_zod6.z.uuid(),
|
|
666
1398
|
expectedRevision: revision,
|
|
667
1399
|
name: name.optional(),
|
|
668
|
-
categoryId:
|
|
669
|
-
archived:
|
|
1400
|
+
categoryId: import_zod6.z.uuid().nullable().optional(),
|
|
1401
|
+
archived: import_zod6.z.boolean().optional()
|
|
670
1402
|
}).strict(),
|
|
671
|
-
|
|
672
|
-
action:
|
|
673
|
-
path:
|
|
1403
|
+
import_zod6.z.object({
|
|
1404
|
+
action: import_zod6.z.literal("category-create"),
|
|
1405
|
+
path: import_zod6.z.string().trim().min(1).max(1e3)
|
|
674
1406
|
}).strict(),
|
|
675
|
-
|
|
676
|
-
action:
|
|
677
|
-
id:
|
|
1407
|
+
import_zod6.z.object({
|
|
1408
|
+
action: import_zod6.z.literal("category-update"),
|
|
1409
|
+
id: import_zod6.z.uuid(),
|
|
678
1410
|
expectedRevision: revision,
|
|
679
1411
|
name: name.optional(),
|
|
680
|
-
parentId:
|
|
1412
|
+
parentId: import_zod6.z.uuid().nullable().optional()
|
|
681
1413
|
}).strict(),
|
|
682
|
-
|
|
683
|
-
action:
|
|
684
|
-
id:
|
|
1414
|
+
import_zod6.z.object({
|
|
1415
|
+
action: import_zod6.z.literal("category-delete"),
|
|
1416
|
+
id: import_zod6.z.uuid(),
|
|
685
1417
|
expectedRevision: revision,
|
|
686
|
-
destinationId:
|
|
1418
|
+
destinationId: import_zod6.z.uuid().nullable()
|
|
687
1419
|
}).strict(),
|
|
688
|
-
|
|
689
|
-
action:
|
|
1420
|
+
import_zod6.z.object({
|
|
1421
|
+
action: import_zod6.z.literal("group-create"),
|
|
690
1422
|
name,
|
|
691
|
-
members:
|
|
1423
|
+
members: import_zod6.z.array(import_zod6.z.object({ promptId: import_zod6.z.uuid(), version })).max(100).optional()
|
|
692
1424
|
}).strict(),
|
|
693
|
-
|
|
694
|
-
action:
|
|
695
|
-
id:
|
|
1425
|
+
import_zod6.z.object({
|
|
1426
|
+
action: import_zod6.z.literal("group-update"),
|
|
1427
|
+
id: import_zod6.z.uuid(),
|
|
696
1428
|
expectedRevision: revision,
|
|
697
1429
|
name: name.optional(),
|
|
698
|
-
members:
|
|
1430
|
+
members: import_zod6.z.array(import_zod6.z.object({ promptId: import_zod6.z.uuid(), version })).max(100).optional()
|
|
699
1431
|
}).strict(),
|
|
700
|
-
|
|
701
|
-
action:
|
|
702
|
-
id:
|
|
1432
|
+
import_zod6.z.object({
|
|
1433
|
+
action: import_zod6.z.literal("group-delete"),
|
|
1434
|
+
id: import_zod6.z.uuid(),
|
|
703
1435
|
expectedRevision: revision
|
|
704
1436
|
}).strict(),
|
|
705
|
-
|
|
706
|
-
action:
|
|
707
|
-
id:
|
|
1437
|
+
import_zod6.z.object({
|
|
1438
|
+
action: import_zod6.z.literal("promote"),
|
|
1439
|
+
id: import_zod6.z.uuid(),
|
|
708
1440
|
version,
|
|
709
1441
|
expectedRevision: revision,
|
|
710
|
-
exceptionReason:
|
|
711
|
-
rollback:
|
|
1442
|
+
exceptionReason: import_zod6.z.string().trim().min(1).max(2e3).optional(),
|
|
1443
|
+
rollback: import_zod6.z.boolean().default(false)
|
|
712
1444
|
}).strict(),
|
|
713
|
-
|
|
714
|
-
action:
|
|
715
|
-
id:
|
|
1445
|
+
import_zod6.z.object({
|
|
1446
|
+
action: import_zod6.z.literal("review"),
|
|
1447
|
+
id: import_zod6.z.uuid(),
|
|
716
1448
|
version,
|
|
717
|
-
note:
|
|
1449
|
+
note: import_zod6.z.string().trim().min(1).max(2e3)
|
|
718
1450
|
}).strict(),
|
|
719
|
-
|
|
720
|
-
action:
|
|
721
|
-
id:
|
|
1451
|
+
import_zod6.z.object({
|
|
1452
|
+
action: import_zod6.z.literal("policy"),
|
|
1453
|
+
id: import_zod6.z.uuid(),
|
|
722
1454
|
policy: PromptPolicySchema
|
|
723
1455
|
}).strict()
|
|
724
1456
|
]);
|
|
725
|
-
var PromptSelectionSchema =
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
type:
|
|
729
|
-
id:
|
|
730
|
-
version:
|
|
1457
|
+
var PromptSelectionSchema = import_zod6.z.discriminatedUnion("type", [
|
|
1458
|
+
import_zod6.z.object({ type: import_zod6.z.literal("live") }).strict(),
|
|
1459
|
+
import_zod6.z.object({
|
|
1460
|
+
type: import_zod6.z.literal("single"),
|
|
1461
|
+
id: import_zod6.z.string().min(1),
|
|
1462
|
+
version: import_zod6.z.number().int().positive()
|
|
731
1463
|
}).strict(),
|
|
732
|
-
|
|
1464
|
+
import_zod6.z.object({ type: import_zod6.z.literal("group"), groupId: import_zod6.z.uuid() }).strict()
|
|
733
1465
|
]);
|
|
734
|
-
var PromptBundleSchema =
|
|
735
|
-
schemaVersion:
|
|
736
|
-
origin:
|
|
737
|
-
apiUrl:
|
|
1466
|
+
var PromptBundleSchema = import_zod6.z.object({
|
|
1467
|
+
schemaVersion: import_zod6.z.literal(1),
|
|
1468
|
+
origin: import_zod6.z.object({
|
|
1469
|
+
apiUrl: import_zod6.z.url().refine((value) => {
|
|
738
1470
|
const url = new URL(value);
|
|
739
1471
|
return /^https?:$/.test(url.protocol) && !url.username && !url.password && !url.search;
|
|
740
1472
|
}),
|
|
741
|
-
projectId:
|
|
1473
|
+
projectId: import_zod6.z.string().min(1)
|
|
742
1474
|
}).strict(),
|
|
743
|
-
prompts:
|
|
744
|
-
|
|
1475
|
+
prompts: import_zod6.z.array(
|
|
1476
|
+
import_zod6.z.object({
|
|
745
1477
|
key: import_browser.PromptKeySchema,
|
|
746
1478
|
name,
|
|
747
|
-
categoryPath:
|
|
748
|
-
versions:
|
|
1479
|
+
categoryPath: import_zod6.z.string().optional(),
|
|
1480
|
+
versions: import_zod6.z.array(import_browser.PromptVersionSchema.extend({ note: import_zod6.z.string().max(2e3) })).min(1).max(200)
|
|
749
1481
|
}).strict()
|
|
750
1482
|
).min(1).max(200),
|
|
751
|
-
groups:
|
|
752
|
-
|
|
1483
|
+
groups: import_zod6.z.array(
|
|
1484
|
+
import_zod6.z.object({
|
|
753
1485
|
name,
|
|
754
|
-
members:
|
|
1486
|
+
members: import_zod6.z.array(import_zod6.z.object({ key: import_browser.PromptKeySchema, version })).max(100)
|
|
755
1487
|
}).strict()
|
|
756
1488
|
).max(100).default([])
|
|
757
1489
|
}).strict();
|
|
758
|
-
var PromptTransferRequestSchema =
|
|
1490
|
+
var PromptTransferRequestSchema = import_zod6.z.object({
|
|
759
1491
|
bundle: PromptBundleSchema,
|
|
760
|
-
conflicts:
|
|
761
|
-
rename:
|
|
762
|
-
categories:
|
|
763
|
-
groups:
|
|
1492
|
+
conflicts: import_zod6.z.enum(["error", "append"]).default("error"),
|
|
1493
|
+
rename: import_zod6.z.record(import_browser.PromptKeySchema, import_browser.PromptKeySchema).default({}),
|
|
1494
|
+
categories: import_zod6.z.boolean().default(true),
|
|
1495
|
+
groups: import_zod6.z.boolean().default(false)
|
|
764
1496
|
}).strict();
|
|
765
1497
|
|
|
766
1498
|
// src/studio-updates.ts
|
|
767
|
-
var
|
|
768
|
-
var StudioReleaseVersionSchema =
|
|
769
|
-
var StudioReleaseDeploymentSchema =
|
|
770
|
-
strategy:
|
|
1499
|
+
var import_zod7 = require("zod");
|
|
1500
|
+
var StudioReleaseVersionSchema = import_zod7.z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/);
|
|
1501
|
+
var StudioReleaseDeploymentSchema = import_zod7.z.object({
|
|
1502
|
+
strategy: import_zod7.z.enum(["rolling", "recreate"])
|
|
771
1503
|
});
|
|
772
|
-
var StudioReleaseSchema =
|
|
773
|
-
format:
|
|
774
|
-
installer:
|
|
1504
|
+
var StudioReleaseSchema = import_zod7.z.object({
|
|
1505
|
+
format: import_zod7.z.literal(1),
|
|
1506
|
+
installer: import_zod7.z.literal(1),
|
|
775
1507
|
version: StudioReleaseVersionSchema,
|
|
776
|
-
api:
|
|
777
|
-
studio:
|
|
1508
|
+
api: import_zod7.z.string().regex(/^ghcr\.io\/kortyx-io\/kortyx-api@sha256:[a-f0-9]{64}$/),
|
|
1509
|
+
studio: import_zod7.z.string().regex(/^ghcr\.io\/kortyx-io\/kortyx-studio@sha256:[a-f0-9]{64}$/),
|
|
778
1510
|
deployment: StudioReleaseDeploymentSchema.default({
|
|
779
1511
|
strategy: "recreate"
|
|
780
1512
|
})
|
|
781
1513
|
});
|
|
782
|
-
var StudioUpdateSettingsSchema =
|
|
783
|
-
automatic:
|
|
784
|
-
hourUtc:
|
|
1514
|
+
var StudioUpdateSettingsSchema = import_zod7.z.object({
|
|
1515
|
+
automatic: import_zod7.z.boolean(),
|
|
1516
|
+
hourUtc: import_zod7.z.number().int().min(0).max(23)
|
|
785
1517
|
});
|
|
786
|
-
var StudioUpdateOperationSchema =
|
|
787
|
-
id:
|
|
788
|
-
from:
|
|
1518
|
+
var StudioUpdateOperationSchema = import_zod7.z.object({
|
|
1519
|
+
id: import_zod7.z.uuid(),
|
|
1520
|
+
from: import_zod7.z.string(),
|
|
789
1521
|
release: StudioReleaseSchema,
|
|
790
|
-
phase:
|
|
1522
|
+
phase: import_zod7.z.enum([
|
|
791
1523
|
"starting",
|
|
792
1524
|
"pulling",
|
|
793
1525
|
"backup",
|
|
@@ -796,16 +1528,16 @@ var StudioUpdateOperationSchema = import_zod5.z.object({
|
|
|
796
1528
|
"succeeded",
|
|
797
1529
|
"failed"
|
|
798
1530
|
]),
|
|
799
|
-
startedAt:
|
|
800
|
-
updatedAt:
|
|
801
|
-
backup:
|
|
802
|
-
messages:
|
|
1531
|
+
startedAt: import_zod7.z.iso.datetime(),
|
|
1532
|
+
updatedAt: import_zod7.z.iso.datetime(),
|
|
1533
|
+
backup: import_zod7.z.string().nullable(),
|
|
1534
|
+
messages: import_zod7.z.array(import_zod7.z.string()).max(100)
|
|
803
1535
|
});
|
|
804
|
-
var StudioUpdateStatusSchema =
|
|
805
|
-
current:
|
|
1536
|
+
var StudioUpdateStatusSchema = import_zod7.z.object({
|
|
1537
|
+
current: import_zod7.z.string().nullable(),
|
|
806
1538
|
available: StudioReleaseSchema.nullable(),
|
|
807
|
-
checkedAt:
|
|
808
|
-
checkError:
|
|
1539
|
+
checkedAt: import_zod7.z.iso.datetime().nullable(),
|
|
1540
|
+
checkError: import_zod7.z.string().nullable(),
|
|
809
1541
|
settings: StudioUpdateSettingsSchema,
|
|
810
1542
|
operation: StudioUpdateOperationSchema.nullable()
|
|
811
1543
|
});
|
|
@@ -828,10 +1560,10 @@ function projectWorkflowCalls(events) {
|
|
|
828
1560
|
for (const event of events) {
|
|
829
1561
|
if (!event.type.startsWith("workflow.call.") || !str(event.payload.invocationId) || !str(event.payload.targetWorkflowId))
|
|
830
1562
|
continue;
|
|
831
|
-
const
|
|
832
|
-
const group = groups.get(
|
|
1563
|
+
const key2 = `${event.runId}:${str(event.payload.branchId, event.runId)}:${event.payload.invocationId}`;
|
|
1564
|
+
const group = groups.get(key2) ?? [];
|
|
833
1565
|
if (!group.some((existing) => existing.id === event.id)) group.push(event);
|
|
834
|
-
groups.set(
|
|
1566
|
+
groups.set(key2, group);
|
|
835
1567
|
}
|
|
836
1568
|
return [...groups.entries()].map(([id, group]) => {
|
|
837
1569
|
group.sort(
|
|
@@ -960,82 +1692,82 @@ var TELEMETRY_EVENT_TYPES = [
|
|
|
960
1692
|
"session.forked",
|
|
961
1693
|
"session.rolled_back"
|
|
962
1694
|
];
|
|
963
|
-
var TelemetryServiceSchema =
|
|
964
|
-
name:
|
|
965
|
-
deploymentRef:
|
|
1695
|
+
var TelemetryServiceSchema = import_zod8.z.object({
|
|
1696
|
+
name: import_zod8.z.string().min(1),
|
|
1697
|
+
deploymentRef: import_zod8.z.string().min(1).optional()
|
|
966
1698
|
}).strict();
|
|
967
|
-
var WorkflowTopologyNodeSchema =
|
|
968
|
-
id:
|
|
969
|
-
label:
|
|
970
|
-
type:
|
|
971
|
-
provider:
|
|
972
|
-
model:
|
|
973
|
-
metadata:
|
|
974
|
-
tools:
|
|
1699
|
+
var WorkflowTopologyNodeSchema = import_zod8.z.object({
|
|
1700
|
+
id: import_zod8.z.string().min(1),
|
|
1701
|
+
label: import_zod8.z.string().optional(),
|
|
1702
|
+
type: import_zod8.z.string().optional(),
|
|
1703
|
+
provider: import_zod8.z.string().optional(),
|
|
1704
|
+
model: import_zod8.z.string().optional(),
|
|
1705
|
+
metadata: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).optional(),
|
|
1706
|
+
tools: import_zod8.z.array(WorkflowToolSchema).optional(),
|
|
975
1707
|
toolDiscovery: ToolDiscoverySchema.optional()
|
|
976
1708
|
}).strict();
|
|
977
|
-
var WorkflowTopologyEdgeSchema =
|
|
978
|
-
sourceNodeId:
|
|
979
|
-
targetNodeId:
|
|
980
|
-
condition:
|
|
1709
|
+
var WorkflowTopologyEdgeSchema = import_zod8.z.object({
|
|
1710
|
+
sourceNodeId: import_zod8.z.string().min(1),
|
|
1711
|
+
targetNodeId: import_zod8.z.string().min(1),
|
|
1712
|
+
condition: import_zod8.z.string().optional()
|
|
981
1713
|
}).strict();
|
|
982
|
-
var WorkflowTopologyCallSchema =
|
|
983
|
-
sourceNodeId:
|
|
984
|
-
targetWorkflowId:
|
|
1714
|
+
var WorkflowTopologyCallSchema = import_zod8.z.object({
|
|
1715
|
+
sourceNodeId: import_zod8.z.string().min(1),
|
|
1716
|
+
targetWorkflowId: import_zod8.z.string().min(1)
|
|
985
1717
|
}).strict();
|
|
986
|
-
var WorkflowTopologyTransitionSchema =
|
|
987
|
-
sourceNodeId:
|
|
988
|
-
targetWorkflowId:
|
|
989
|
-
condition:
|
|
990
|
-
intent:
|
|
991
|
-
kind:
|
|
1718
|
+
var WorkflowTopologyTransitionSchema = import_zod8.z.object({
|
|
1719
|
+
sourceNodeId: import_zod8.z.string().min(1).optional(),
|
|
1720
|
+
targetWorkflowId: import_zod8.z.string().min(1),
|
|
1721
|
+
condition: import_zod8.z.string().optional(),
|
|
1722
|
+
intent: import_zod8.z.string().optional(),
|
|
1723
|
+
kind: import_zod8.z.enum(["call", "handoff"]).optional()
|
|
992
1724
|
}).strict();
|
|
993
|
-
var EnsureWorkflowTopologyRequestSchema =
|
|
994
|
-
schemaVersion:
|
|
995
|
-
environment:
|
|
1725
|
+
var EnsureWorkflowTopologyRequestSchema = import_zod8.z.object({
|
|
1726
|
+
schemaVersion: import_zod8.z.literal(1),
|
|
1727
|
+
environment: import_zod8.z.string().min(1),
|
|
996
1728
|
service: TelemetryServiceSchema,
|
|
997
|
-
workflow:
|
|
998
|
-
id:
|
|
999
|
-
declaredVersion:
|
|
1000
|
-
description:
|
|
1001
|
-
tags:
|
|
1002
|
-
topologyHash:
|
|
1003
|
-
nodes:
|
|
1004
|
-
edges:
|
|
1005
|
-
transitions:
|
|
1006
|
-
calls:
|
|
1729
|
+
workflow: import_zod8.z.object({
|
|
1730
|
+
id: import_zod8.z.string().min(1),
|
|
1731
|
+
declaredVersion: import_zod8.z.string().min(1),
|
|
1732
|
+
description: import_zod8.z.string().optional(),
|
|
1733
|
+
tags: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
1734
|
+
topologyHash: import_zod8.z.string().regex(/^[a-f0-9]{64}$/),
|
|
1735
|
+
nodes: import_zod8.z.array(WorkflowTopologyNodeSchema),
|
|
1736
|
+
edges: import_zod8.z.array(WorkflowTopologyEdgeSchema),
|
|
1737
|
+
transitions: import_zod8.z.array(WorkflowTopologyTransitionSchema).optional(),
|
|
1738
|
+
calls: import_zod8.z.array(WorkflowTopologyCallSchema).optional()
|
|
1007
1739
|
}).strict()
|
|
1008
1740
|
}).strict();
|
|
1009
|
-
var EnsureWorkflowTopologyResponseSchema =
|
|
1010
|
-
var TelemetryEventTypeSchema =
|
|
1011
|
-
var TelemetryEventSchema =
|
|
1012
|
-
schemaVersion:
|
|
1013
|
-
eventId:
|
|
1014
|
-
occurredAt:
|
|
1015
|
-
environment:
|
|
1741
|
+
var EnsureWorkflowTopologyResponseSchema = import_zod8.z.object({ workflowRevisionId: import_zod8.z.string().min(1), created: import_zod8.z.boolean() }).strict();
|
|
1742
|
+
var TelemetryEventTypeSchema = import_zod8.z.enum(TELEMETRY_EVENT_TYPES);
|
|
1743
|
+
var TelemetryEventSchema = import_zod8.z.object({
|
|
1744
|
+
schemaVersion: import_zod8.z.literal(1),
|
|
1745
|
+
eventId: import_zod8.z.string().min(1),
|
|
1746
|
+
occurredAt: import_zod8.z.string().datetime({ offset: true }),
|
|
1747
|
+
environment: import_zod8.z.string().min(1),
|
|
1016
1748
|
service: TelemetryServiceSchema,
|
|
1017
|
-
correlation:
|
|
1018
|
-
invocationId:
|
|
1019
|
-
parentInvocationId:
|
|
1020
|
-
branchId:
|
|
1021
|
-
traceId:
|
|
1022
|
-
spanId:
|
|
1023
|
-
parentSpanId:
|
|
1024
|
-
runId:
|
|
1025
|
-
sessionId:
|
|
1026
|
-
workflowId:
|
|
1027
|
-
workflowRevisionId:
|
|
1028
|
-
topologyHash:
|
|
1029
|
-
nodeId:
|
|
1749
|
+
correlation: import_zod8.z.object({
|
|
1750
|
+
invocationId: import_zod8.z.string().optional(),
|
|
1751
|
+
parentInvocationId: import_zod8.z.string().optional(),
|
|
1752
|
+
branchId: import_zod8.z.string().optional(),
|
|
1753
|
+
traceId: import_zod8.z.string().optional(),
|
|
1754
|
+
spanId: import_zod8.z.string().optional(),
|
|
1755
|
+
parentSpanId: import_zod8.z.string().optional(),
|
|
1756
|
+
runId: import_zod8.z.string().min(1),
|
|
1757
|
+
sessionId: import_zod8.z.string().optional(),
|
|
1758
|
+
workflowId: import_zod8.z.string().min(1),
|
|
1759
|
+
workflowRevisionId: import_zod8.z.string().optional(),
|
|
1760
|
+
topologyHash: import_zod8.z.string().regex(/^[a-f0-9]{64}$/).optional(),
|
|
1761
|
+
nodeId: import_zod8.z.string().optional()
|
|
1030
1762
|
}).strict(),
|
|
1031
|
-
context:
|
|
1032
|
-
userId:
|
|
1033
|
-
tenantId:
|
|
1034
|
-
tags:
|
|
1035
|
-
metadata:
|
|
1763
|
+
context: import_zod8.z.object({
|
|
1764
|
+
userId: import_zod8.z.string().optional(),
|
|
1765
|
+
tenantId: import_zod8.z.string().optional(),
|
|
1766
|
+
tags: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
1767
|
+
metadata: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).optional()
|
|
1036
1768
|
}).strict().optional(),
|
|
1037
1769
|
type: TelemetryEventTypeSchema,
|
|
1038
|
-
payload:
|
|
1770
|
+
payload: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown())
|
|
1039
1771
|
}).strict().superRefine((event, ctx) => {
|
|
1040
1772
|
if (!event.type.startsWith("tool.")) return;
|
|
1041
1773
|
const canonical = event.payload.version === 1 || [
|
|
@@ -1078,20 +1810,20 @@ var TelemetryEventSchema = import_zod6.z.object({
|
|
|
1078
1810
|
});
|
|
1079
1811
|
}
|
|
1080
1812
|
});
|
|
1081
|
-
var TelemetryEventBatchSchema =
|
|
1082
|
-
var TelemetryEventBatchResponseSchema =
|
|
1083
|
-
accepted:
|
|
1084
|
-
inserted:
|
|
1085
|
-
duplicates:
|
|
1813
|
+
var TelemetryEventBatchSchema = import_zod8.z.object({ events: import_zod8.z.array(TelemetryEventSchema).min(1) }).strict();
|
|
1814
|
+
var TelemetryEventBatchResponseSchema = import_zod8.z.object({
|
|
1815
|
+
accepted: import_zod8.z.number().int().nonnegative(),
|
|
1816
|
+
inserted: import_zod8.z.number().int().nonnegative(),
|
|
1817
|
+
duplicates: import_zod8.z.number().int().nonnegative()
|
|
1086
1818
|
}).strict();
|
|
1087
|
-
var TelemetryPricingSourceSchema =
|
|
1819
|
+
var TelemetryPricingSourceSchema = import_zod8.z.enum([
|
|
1088
1820
|
"sdk",
|
|
1089
1821
|
"provider",
|
|
1090
1822
|
"custom",
|
|
1091
1823
|
"project-rate-card",
|
|
1092
1824
|
"default-rate-card"
|
|
1093
1825
|
]);
|
|
1094
|
-
var TelemetryPricingUnitSchema =
|
|
1826
|
+
var TelemetryPricingUnitSchema = import_zod8.z.enum([
|
|
1095
1827
|
"token",
|
|
1096
1828
|
"character",
|
|
1097
1829
|
"request",
|
|
@@ -1104,7 +1836,7 @@ var TelemetryPricingUnitSchema = import_zod6.z.enum([
|
|
|
1104
1836
|
"minute",
|
|
1105
1837
|
"custom"
|
|
1106
1838
|
]);
|
|
1107
|
-
var TelemetryPricingUsageTypeSchema =
|
|
1839
|
+
var TelemetryPricingUsageTypeSchema = import_zod8.z.enum([
|
|
1108
1840
|
"input",
|
|
1109
1841
|
"output",
|
|
1110
1842
|
"reasoning",
|
|
@@ -1120,42 +1852,42 @@ var TelemetryPricingUsageTypeSchema = import_zod6.z.enum([
|
|
|
1120
1852
|
"request",
|
|
1121
1853
|
"custom"
|
|
1122
1854
|
]);
|
|
1123
|
-
var TelemetryUsageItemSchema =
|
|
1855
|
+
var TelemetryUsageItemSchema = import_zod8.z.object({
|
|
1124
1856
|
usageType: TelemetryPricingUsageTypeSchema,
|
|
1125
|
-
quantity:
|
|
1857
|
+
quantity: import_zod8.z.number().nonnegative(),
|
|
1126
1858
|
unit: TelemetryPricingUnitSchema,
|
|
1127
|
-
label:
|
|
1859
|
+
label: import_zod8.z.string().optional()
|
|
1128
1860
|
}).strict();
|
|
1129
|
-
var TelemetryUnitPriceSchema =
|
|
1861
|
+
var TelemetryUnitPriceSchema = import_zod8.z.object({
|
|
1130
1862
|
usageType: TelemetryPricingUsageTypeSchema,
|
|
1131
1863
|
unit: TelemetryPricingUnitSchema,
|
|
1132
|
-
unitQuantity:
|
|
1133
|
-
priceMicros:
|
|
1134
|
-
label:
|
|
1864
|
+
unitQuantity: import_zod8.z.number().positive().default(1),
|
|
1865
|
+
priceMicros: import_zod8.z.number().int().nonnegative(),
|
|
1866
|
+
label: import_zod8.z.string().optional()
|
|
1135
1867
|
}).strict();
|
|
1136
|
-
var TelemetryPricingLineItemSchema =
|
|
1868
|
+
var TelemetryPricingLineItemSchema = import_zod8.z.object({
|
|
1137
1869
|
usageType: TelemetryPricingUsageTypeSchema,
|
|
1138
|
-
quantity:
|
|
1870
|
+
quantity: import_zod8.z.number().nonnegative(),
|
|
1139
1871
|
unit: TelemetryPricingUnitSchema,
|
|
1140
|
-
unitQuantity:
|
|
1141
|
-
unitPriceMicros:
|
|
1142
|
-
totalCostMicros:
|
|
1143
|
-
label:
|
|
1872
|
+
unitQuantity: import_zod8.z.number().positive().default(1),
|
|
1873
|
+
unitPriceMicros: import_zod8.z.number().int().nonnegative().optional(),
|
|
1874
|
+
totalCostMicros: import_zod8.z.number().int().nonnegative().optional(),
|
|
1875
|
+
label: import_zod8.z.string().optional()
|
|
1144
1876
|
}).strict().refine(
|
|
1145
1877
|
(value) => value.totalCostMicros !== void 0 || value.unitPriceMicros !== void 0,
|
|
1146
1878
|
"line item requires totalCostMicros or unitPriceMicros"
|
|
1147
1879
|
);
|
|
1148
|
-
var TelemetryPricingHintSchema =
|
|
1880
|
+
var TelemetryPricingHintSchema = import_zod8.z.object({
|
|
1149
1881
|
source: TelemetryPricingSourceSchema.extract(["sdk", "provider", "custom"]),
|
|
1150
|
-
currency:
|
|
1151
|
-
actualCostMicros:
|
|
1152
|
-
lineItems:
|
|
1153
|
-
unitPrices:
|
|
1154
|
-
usageItems:
|
|
1155
|
-
pricingRef:
|
|
1156
|
-
metadata:
|
|
1882
|
+
currency: import_zod8.z.string().min(3).max(12).default("USD"),
|
|
1883
|
+
actualCostMicros: import_zod8.z.number().int().nonnegative().optional(),
|
|
1884
|
+
lineItems: import_zod8.z.array(TelemetryPricingLineItemSchema).optional(),
|
|
1885
|
+
unitPrices: import_zod8.z.array(TelemetryUnitPriceSchema).optional(),
|
|
1886
|
+
usageItems: import_zod8.z.array(TelemetryUsageItemSchema).optional(),
|
|
1887
|
+
pricingRef: import_zod8.z.string().min(1).optional(),
|
|
1888
|
+
metadata: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).optional()
|
|
1157
1889
|
}).strict();
|
|
1158
|
-
var StudioRunStatusSchema =
|
|
1890
|
+
var StudioRunStatusSchema = import_zod8.z.enum([
|
|
1159
1891
|
"running",
|
|
1160
1892
|
"completed",
|
|
1161
1893
|
"interrupted",
|
|
@@ -1171,16 +1903,16 @@ var STUDIO_TIME_RANGES = [
|
|
|
1171
1903
|
"All time",
|
|
1172
1904
|
"Custom range"
|
|
1173
1905
|
];
|
|
1174
|
-
var StudioTimeRangeSchema =
|
|
1175
|
-
var StudioTimeRangeQuerySchema =
|
|
1906
|
+
var StudioTimeRangeSchema = import_zod8.z.enum(STUDIO_TIME_RANGES);
|
|
1907
|
+
var StudioTimeRangeQuerySchema = import_zod8.z.object({
|
|
1176
1908
|
range: StudioTimeRangeSchema.optional(),
|
|
1177
|
-
startedAfter:
|
|
1178
|
-
startedBefore:
|
|
1909
|
+
startedAfter: import_zod8.z.string().optional(),
|
|
1910
|
+
startedBefore: import_zod8.z.string().optional()
|
|
1179
1911
|
}).strict();
|
|
1180
|
-
var StudioTimeRangeContextSchema =
|
|
1912
|
+
var StudioTimeRangeContextSchema = import_zod8.z.object({
|
|
1181
1913
|
range: StudioTimeRangeSchema,
|
|
1182
|
-
startedAfter:
|
|
1183
|
-
startedBefore:
|
|
1914
|
+
startedAfter: import_zod8.z.string().datetime({ offset: true }).nullable(),
|
|
1915
|
+
startedBefore: import_zod8.z.string().datetime({ offset: true }).nullable()
|
|
1184
1916
|
}).strict();
|
|
1185
1917
|
var STUDIO_TIME_RANGE_MILLISECONDS = {
|
|
1186
1918
|
"Last hour": 60 * 60 * 1e3,
|
|
@@ -1254,7 +1986,7 @@ var resolveStudioTimeRange = (input, now = /* @__PURE__ */ new Date()) => {
|
|
|
1254
1986
|
}
|
|
1255
1987
|
};
|
|
1256
1988
|
};
|
|
1257
|
-
var StudioInterruptStatusSchema =
|
|
1989
|
+
var StudioInterruptStatusSchema = import_zod8.z.enum([
|
|
1258
1990
|
"pending",
|
|
1259
1991
|
"resolved",
|
|
1260
1992
|
"expired",
|
|
@@ -1267,341 +1999,342 @@ var resolveStudioInterruptStatus = (input, now = Date.now()) => {
|
|
|
1267
1999
|
const nowMs = typeof now === "number" ? now : now.getTime();
|
|
1268
2000
|
return Number.isFinite(expiresAt) && Number.isFinite(nowMs) && expiresAt <= nowMs ? "expired" : input.status;
|
|
1269
2001
|
};
|
|
1270
|
-
var StudioInterruptTypeSchema =
|
|
2002
|
+
var StudioInterruptTypeSchema = import_zod8.z.enum([
|
|
1271
2003
|
"choice",
|
|
1272
2004
|
"multi-choice",
|
|
1273
2005
|
"text",
|
|
1274
2006
|
"structured",
|
|
1275
2007
|
"unknown"
|
|
1276
2008
|
]);
|
|
1277
|
-
var StudioInterruptInteractionModeSchema =
|
|
2009
|
+
var StudioInterruptInteractionModeSchema = import_zod8.z.enum([
|
|
1278
2010
|
"static-options",
|
|
1279
2011
|
"dynamic-picker",
|
|
1280
2012
|
"freeform",
|
|
1281
2013
|
"unknown"
|
|
1282
2014
|
]);
|
|
1283
|
-
var StudioInterruptOptionSchema =
|
|
1284
|
-
id:
|
|
1285
|
-
label:
|
|
1286
|
-
description:
|
|
2015
|
+
var StudioInterruptOptionSchema = import_zod8.z.object({
|
|
2016
|
+
id: import_zod8.z.string().min(1),
|
|
2017
|
+
label: import_zod8.z.string().min(1),
|
|
2018
|
+
description: import_zod8.z.string().nullable()
|
|
1287
2019
|
}).strip();
|
|
1288
|
-
var StudioInterruptValueSchema =
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
2020
|
+
var StudioInterruptValueSchema = import_zod8.z.union([
|
|
2021
|
+
import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()),
|
|
2022
|
+
import_zod8.z.array(import_zod8.z.unknown()),
|
|
2023
|
+
import_zod8.z.string(),
|
|
2024
|
+
import_zod8.z.number(),
|
|
2025
|
+
import_zod8.z.boolean()
|
|
1294
2026
|
]);
|
|
1295
|
-
var StudioResumeOutcomeSchema =
|
|
2027
|
+
var StudioResumeOutcomeSchema = import_zod8.z.enum([
|
|
1296
2028
|
"resumed",
|
|
1297
2029
|
"resume failed",
|
|
1298
2030
|
"expired before resume",
|
|
1299
2031
|
"cancelled"
|
|
1300
2032
|
]);
|
|
1301
|
-
var StudioWorkflowHealthSchema =
|
|
2033
|
+
var StudioWorkflowHealthSchema = import_zod8.z.enum([
|
|
1302
2034
|
"unknown",
|
|
1303
2035
|
"healthy",
|
|
1304
2036
|
"degraded",
|
|
1305
2037
|
"failing",
|
|
1306
2038
|
"idle"
|
|
1307
2039
|
]);
|
|
1308
|
-
var StudioPricingStatusSchema =
|
|
2040
|
+
var StudioPricingStatusSchema = import_zod8.z.enum([
|
|
1309
2041
|
"priced",
|
|
1310
2042
|
"unpriced",
|
|
1311
2043
|
"unknown"
|
|
1312
2044
|
]);
|
|
1313
2045
|
var StudioPricingSourceSchema = TelemetryPricingSourceSchema.nullable();
|
|
1314
|
-
var StudioChangeResourceSchema =
|
|
2046
|
+
var StudioChangeResourceSchema = import_zod8.z.enum([
|
|
1315
2047
|
"evals",
|
|
1316
2048
|
"workflows",
|
|
1317
2049
|
"runs",
|
|
1318
2050
|
"sessions",
|
|
1319
2051
|
"interrupts"
|
|
1320
2052
|
]);
|
|
1321
|
-
var StudioChangeSchema =
|
|
1322
|
-
schemaVersion:
|
|
1323
|
-
changeId:
|
|
1324
|
-
emittedAt:
|
|
1325
|
-
organizationId:
|
|
1326
|
-
projectId:
|
|
1327
|
-
environment:
|
|
1328
|
-
resources:
|
|
2053
|
+
var StudioChangeSchema = import_zod8.z.object({
|
|
2054
|
+
schemaVersion: import_zod8.z.literal(1),
|
|
2055
|
+
changeId: import_zod8.z.string().min(1),
|
|
2056
|
+
emittedAt: import_zod8.z.string().datetime({ offset: true }),
|
|
2057
|
+
organizationId: import_zod8.z.string().min(1),
|
|
2058
|
+
projectId: import_zod8.z.string().min(1),
|
|
2059
|
+
environment: import_zod8.z.string().min(1).optional(),
|
|
2060
|
+
resources: import_zod8.z.array(StudioChangeResourceSchema).min(1)
|
|
1329
2061
|
}).strict();
|
|
1330
|
-
var StudioCostSummarySchema =
|
|
1331
|
-
amounts:
|
|
1332
|
-
|
|
1333
|
-
amount:
|
|
1334
|
-
currency:
|
|
2062
|
+
var StudioCostSummarySchema = import_zod8.z.object({
|
|
2063
|
+
amounts: import_zod8.z.array(
|
|
2064
|
+
import_zod8.z.object({
|
|
2065
|
+
amount: import_zod8.z.number().nonnegative(),
|
|
2066
|
+
currency: import_zod8.z.string().nullable()
|
|
1335
2067
|
}).strip()
|
|
1336
2068
|
),
|
|
1337
|
-
complete:
|
|
2069
|
+
complete: import_zod8.z.boolean()
|
|
1338
2070
|
}).strip();
|
|
1339
|
-
var StudioMetricSchema =
|
|
1340
|
-
runCount:
|
|
1341
|
-
successRate:
|
|
1342
|
-
errorRate:
|
|
1343
|
-
retryCount:
|
|
1344
|
-
interruptRate:
|
|
1345
|
-
p50DurationMs:
|
|
1346
|
-
p95DurationMs:
|
|
1347
|
-
averageTokens:
|
|
1348
|
-
averageCost:
|
|
2071
|
+
var StudioMetricSchema = import_zod8.z.object({
|
|
2072
|
+
runCount: import_zod8.z.number().int().nonnegative(),
|
|
2073
|
+
successRate: import_zod8.z.number().min(0).max(100).nullable(),
|
|
2074
|
+
errorRate: import_zod8.z.number().min(0).max(100).nullable(),
|
|
2075
|
+
retryCount: import_zod8.z.number().int().nonnegative().nullable(),
|
|
2076
|
+
interruptRate: import_zod8.z.number().min(0).max(100).nullable(),
|
|
2077
|
+
p50DurationMs: import_zod8.z.number().nonnegative().nullable(),
|
|
2078
|
+
p95DurationMs: import_zod8.z.number().nonnegative().nullable(),
|
|
2079
|
+
averageTokens: import_zod8.z.number().nonnegative().nullable(),
|
|
2080
|
+
averageCost: import_zod8.z.number().nonnegative().nullable(),
|
|
1349
2081
|
averageCostSummary: StudioCostSummarySchema.optional(),
|
|
1350
|
-
currency:
|
|
2082
|
+
currency: import_zod8.z.string().nullable()
|
|
1351
2083
|
}).strip();
|
|
1352
|
-
var StudioRunSchema =
|
|
1353
|
-
id:
|
|
2084
|
+
var StudioRunSchema = import_zod8.z.object({
|
|
2085
|
+
id: import_zod8.z.string().min(1),
|
|
1354
2086
|
feedback: FeedbackSummarySchema.optional(),
|
|
1355
|
-
callerNodeId:
|
|
1356
|
-
parentRunId:
|
|
1357
|
-
parentWorkflowId:
|
|
1358
|
-
invocationId:
|
|
1359
|
-
branchId:
|
|
1360
|
-
callId:
|
|
2087
|
+
callerNodeId: import_zod8.z.string().optional(),
|
|
2088
|
+
parentRunId: import_zod8.z.string().optional(),
|
|
2089
|
+
parentWorkflowId: import_zod8.z.string().optional(),
|
|
2090
|
+
invocationId: import_zod8.z.string().optional(),
|
|
2091
|
+
branchId: import_zod8.z.string().optional(),
|
|
2092
|
+
callId: import_zod8.z.string().optional(),
|
|
1361
2093
|
status: StudioRunStatusSchema,
|
|
1362
|
-
startedAt:
|
|
1363
|
-
endedAt:
|
|
1364
|
-
workflowId:
|
|
1365
|
-
workflowIds:
|
|
1366
|
-
workflowRefs:
|
|
1367
|
-
|
|
1368
|
-
workflowId:
|
|
1369
|
-
workflowRevisionId:
|
|
1370
|
-
declaredVersion:
|
|
2094
|
+
startedAt: import_zod8.z.string().datetime({ offset: true }),
|
|
2095
|
+
endedAt: import_zod8.z.string().datetime({ offset: true }).nullable(),
|
|
2096
|
+
workflowId: import_zod8.z.string().min(1),
|
|
2097
|
+
workflowIds: import_zod8.z.array(import_zod8.z.string().min(1)),
|
|
2098
|
+
workflowRefs: import_zod8.z.array(
|
|
2099
|
+
import_zod8.z.object({
|
|
2100
|
+
workflowId: import_zod8.z.string().min(1),
|
|
2101
|
+
workflowRevisionId: import_zod8.z.string().nullable(),
|
|
2102
|
+
declaredVersion: import_zod8.z.string().nullable()
|
|
1371
2103
|
}).strip()
|
|
1372
2104
|
),
|
|
1373
|
-
workflowRevisionId:
|
|
1374
|
-
declaredVersion:
|
|
1375
|
-
transitionIds:
|
|
1376
|
-
path:
|
|
1377
|
-
sessionId:
|
|
1378
|
-
provider:
|
|
1379
|
-
model:
|
|
1380
|
-
models:
|
|
1381
|
-
durationMs:
|
|
1382
|
-
tokens:
|
|
1383
|
-
cost:
|
|
2105
|
+
workflowRevisionId: import_zod8.z.string().nullable(),
|
|
2106
|
+
declaredVersion: import_zod8.z.string().nullable(),
|
|
2107
|
+
transitionIds: import_zod8.z.array(import_zod8.z.string().min(1)),
|
|
2108
|
+
path: import_zod8.z.array(import_zod8.z.string()),
|
|
2109
|
+
sessionId: import_zod8.z.string().nullable(),
|
|
2110
|
+
provider: import_zod8.z.string().nullable(),
|
|
2111
|
+
model: import_zod8.z.string().nullable(),
|
|
2112
|
+
models: import_zod8.z.array(import_zod8.z.string()),
|
|
2113
|
+
durationMs: import_zod8.z.number().nonnegative().nullable(),
|
|
2114
|
+
tokens: import_zod8.z.number().int().nonnegative().nullable(),
|
|
2115
|
+
cost: import_zod8.z.number().nonnegative().nullable(),
|
|
1384
2116
|
costSummary: StudioCostSummarySchema.optional(),
|
|
1385
2117
|
pricingStatus: StudioPricingStatusSchema,
|
|
1386
2118
|
pricingSource: StudioPricingSourceSchema,
|
|
1387
|
-
currency:
|
|
1388
|
-
result:
|
|
1389
|
-
environment:
|
|
1390
|
-
userId:
|
|
1391
|
-
tenantId:
|
|
1392
|
-
hasTool:
|
|
1393
|
-
hasRetry:
|
|
1394
|
-
interruptNodeId:
|
|
1395
|
-
interruptId:
|
|
2119
|
+
currency: import_zod8.z.string().nullable(),
|
|
2120
|
+
result: import_zod8.z.string().nullable(),
|
|
2121
|
+
environment: import_zod8.z.string().min(1),
|
|
2122
|
+
userId: import_zod8.z.string().nullable(),
|
|
2123
|
+
tenantId: import_zod8.z.string().nullable(),
|
|
2124
|
+
hasTool: import_zod8.z.boolean(),
|
|
2125
|
+
hasRetry: import_zod8.z.boolean(),
|
|
2126
|
+
interruptNodeId: import_zod8.z.string().nullable(),
|
|
2127
|
+
interruptId: import_zod8.z.string().nullable().optional(),
|
|
1396
2128
|
interruptStatus: StudioInterruptStatusSchema.nullable().optional(),
|
|
1397
|
-
interruptExpiresAt:
|
|
2129
|
+
interruptExpiresAt: import_zod8.z.string().datetime({ offset: true }).nullable().optional()
|
|
1398
2130
|
}).strip();
|
|
1399
|
-
var StudioSessionSchema =
|
|
1400
|
-
id:
|
|
2131
|
+
var StudioSessionSchema = import_zod8.z.object({
|
|
2132
|
+
id: import_zod8.z.string().min(1),
|
|
1401
2133
|
status: StudioRunStatusSchema,
|
|
1402
|
-
lastActivityAt:
|
|
1403
|
-
workflowIds:
|
|
1404
|
-
workflowCount:
|
|
1405
|
-
activeWorkflowId:
|
|
1406
|
-
activeVersion:
|
|
1407
|
-
userId:
|
|
1408
|
-
tenantId:
|
|
1409
|
-
runs:
|
|
1410
|
-
succeeded:
|
|
1411
|
-
failed:
|
|
1412
|
-
interrupted:
|
|
1413
|
-
checkpoints:
|
|
1414
|
-
hasFork:
|
|
1415
|
-
durationMs:
|
|
1416
|
-
tokens:
|
|
1417
|
-
cost:
|
|
2134
|
+
lastActivityAt: import_zod8.z.string().datetime({ offset: true }),
|
|
2135
|
+
workflowIds: import_zod8.z.array(import_zod8.z.string()),
|
|
2136
|
+
workflowCount: import_zod8.z.number().int().nonnegative(),
|
|
2137
|
+
activeWorkflowId: import_zod8.z.string().nullable(),
|
|
2138
|
+
activeVersion: import_zod8.z.string().nullable(),
|
|
2139
|
+
userId: import_zod8.z.string().nullable(),
|
|
2140
|
+
tenantId: import_zod8.z.string().nullable(),
|
|
2141
|
+
runs: import_zod8.z.number().int().nonnegative(),
|
|
2142
|
+
succeeded: import_zod8.z.number().int().nonnegative(),
|
|
2143
|
+
failed: import_zod8.z.number().int().nonnegative(),
|
|
2144
|
+
interrupted: import_zod8.z.number().int().nonnegative(),
|
|
2145
|
+
checkpoints: import_zod8.z.number().int().nonnegative(),
|
|
2146
|
+
hasFork: import_zod8.z.boolean(),
|
|
2147
|
+
durationMs: import_zod8.z.number().nonnegative().nullable(),
|
|
2148
|
+
tokens: import_zod8.z.number().int().nonnegative().nullable(),
|
|
2149
|
+
cost: import_zod8.z.number().nonnegative().nullable(),
|
|
1418
2150
|
costSummary: StudioCostSummarySchema.optional(),
|
|
1419
2151
|
pricingStatus: StudioPricingStatusSchema,
|
|
1420
2152
|
pricingSource: StudioPricingSourceSchema,
|
|
1421
|
-
currency:
|
|
1422
|
-
latestResult:
|
|
1423
|
-
latestError:
|
|
1424
|
-
pendingInterruptId:
|
|
2153
|
+
currency: import_zod8.z.string().nullable(),
|
|
2154
|
+
latestResult: import_zod8.z.string().nullable(),
|
|
2155
|
+
latestError: import_zod8.z.string().nullable(),
|
|
2156
|
+
pendingInterruptId: import_zod8.z.string().nullable(),
|
|
1425
2157
|
interruptStatus: StudioInterruptStatusSchema.nullable().optional(),
|
|
1426
|
-
interruptExpiresAt:
|
|
1427
|
-
providers:
|
|
1428
|
-
models:
|
|
1429
|
-
tags:
|
|
1430
|
-
environment:
|
|
2158
|
+
interruptExpiresAt: import_zod8.z.string().datetime({ offset: true }).nullable().optional(),
|
|
2159
|
+
providers: import_zod8.z.array(import_zod8.z.string()),
|
|
2160
|
+
models: import_zod8.z.array(import_zod8.z.string()),
|
|
2161
|
+
tags: import_zod8.z.array(import_zod8.z.string()),
|
|
2162
|
+
environment: import_zod8.z.string().min(1)
|
|
1431
2163
|
}).strip();
|
|
1432
|
-
var StudioInterruptSchema =
|
|
1433
|
-
afterResponseCompleted:
|
|
1434
|
-
id:
|
|
2164
|
+
var StudioInterruptSchema = import_zod8.z.object({
|
|
2165
|
+
afterResponseCompleted: import_zod8.z.boolean().optional(),
|
|
2166
|
+
id: import_zod8.z.string().min(1),
|
|
1435
2167
|
status: StudioInterruptStatusSchema,
|
|
1436
2168
|
type: StudioInterruptTypeSchema,
|
|
1437
2169
|
interactionMode: StudioInterruptInteractionModeSchema,
|
|
1438
|
-
contract:
|
|
1439
|
-
schemaId:
|
|
1440
|
-
schemaVersion:
|
|
1441
|
-
createdAt:
|
|
1442
|
-
resolvedAt:
|
|
1443
|
-
expiresAt:
|
|
1444
|
-
question:
|
|
1445
|
-
contentCaptured:
|
|
1446
|
-
request:
|
|
1447
|
-
requestCaptured:
|
|
1448
|
-
optionCount:
|
|
1449
|
-
options:
|
|
1450
|
-
workflowId:
|
|
1451
|
-
nodeId:
|
|
1452
|
-
sessionId:
|
|
1453
|
-
userId:
|
|
1454
|
-
tenantId:
|
|
1455
|
-
response:
|
|
2170
|
+
contract: import_zod8.z.string().nullable().default(null),
|
|
2171
|
+
schemaId: import_zod8.z.string().nullable(),
|
|
2172
|
+
schemaVersion: import_zod8.z.string().nullable(),
|
|
2173
|
+
createdAt: import_zod8.z.string().datetime({ offset: true }),
|
|
2174
|
+
resolvedAt: import_zod8.z.string().datetime({ offset: true }).nullable(),
|
|
2175
|
+
expiresAt: import_zod8.z.string().datetime({ offset: true }).nullable(),
|
|
2176
|
+
question: import_zod8.z.string().nullable(),
|
|
2177
|
+
contentCaptured: import_zod8.z.boolean(),
|
|
2178
|
+
request: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).nullable().default(null),
|
|
2179
|
+
requestCaptured: import_zod8.z.boolean().default(false),
|
|
2180
|
+
optionCount: import_zod8.z.number().int().nonnegative().nullable(),
|
|
2181
|
+
options: import_zod8.z.array(StudioInterruptOptionSchema).nullable(),
|
|
2182
|
+
workflowId: import_zod8.z.string().min(1),
|
|
2183
|
+
nodeId: import_zod8.z.string().nullable(),
|
|
2184
|
+
sessionId: import_zod8.z.string().nullable(),
|
|
2185
|
+
userId: import_zod8.z.string().nullable(),
|
|
2186
|
+
tenantId: import_zod8.z.string().nullable(),
|
|
2187
|
+
response: import_zod8.z.string().nullable(),
|
|
1456
2188
|
responseValue: StudioInterruptValueSchema.nullable().default(null),
|
|
1457
|
-
responseCaptured:
|
|
2189
|
+
responseCaptured: import_zod8.z.boolean(),
|
|
1458
2190
|
resumeOutcome: StudioResumeOutcomeSchema.nullable(),
|
|
1459
|
-
resumeError:
|
|
1460
|
-
runId:
|
|
1461
|
-
resumeToken:
|
|
1462
|
-
resolvedBy:
|
|
1463
|
-
environment:
|
|
2191
|
+
resumeError: import_zod8.z.string().nullable(),
|
|
2192
|
+
runId: import_zod8.z.string().min(1),
|
|
2193
|
+
resumeToken: import_zod8.z.string().nullable(),
|
|
2194
|
+
resolvedBy: import_zod8.z.string().nullable(),
|
|
2195
|
+
environment: import_zod8.z.string().min(1)
|
|
1464
2196
|
}).strip();
|
|
1465
|
-
var StudioDetailEventSchema =
|
|
1466
|
-
id:
|
|
2197
|
+
var StudioDetailEventSchema = import_zod8.z.object({
|
|
2198
|
+
id: import_zod8.z.string().min(1),
|
|
1467
2199
|
// Studio readers must preserve future event kinds within the same API major.
|
|
1468
|
-
type:
|
|
1469
|
-
occurredAt:
|
|
1470
|
-
receivedAt:
|
|
1471
|
-
environment:
|
|
1472
|
-
serviceName:
|
|
1473
|
-
deploymentRef:
|
|
1474
|
-
traceId:
|
|
1475
|
-
spanId:
|
|
1476
|
-
parentSpanId:
|
|
1477
|
-
runId:
|
|
1478
|
-
sessionId:
|
|
1479
|
-
workflowId:
|
|
1480
|
-
workflowRevisionId:
|
|
1481
|
-
nodeId:
|
|
1482
|
-
userId:
|
|
1483
|
-
tenantId:
|
|
1484
|
-
tags:
|
|
1485
|
-
metadata:
|
|
1486
|
-
payload:
|
|
2200
|
+
type: import_zod8.z.string().min(1),
|
|
2201
|
+
occurredAt: import_zod8.z.string().datetime({ offset: true }),
|
|
2202
|
+
receivedAt: import_zod8.z.string().datetime({ offset: true }),
|
|
2203
|
+
environment: import_zod8.z.string().min(1),
|
|
2204
|
+
serviceName: import_zod8.z.string().min(1),
|
|
2205
|
+
deploymentRef: import_zod8.z.string().nullable(),
|
|
2206
|
+
traceId: import_zod8.z.string().nullable(),
|
|
2207
|
+
spanId: import_zod8.z.string().nullable(),
|
|
2208
|
+
parentSpanId: import_zod8.z.string().nullable(),
|
|
2209
|
+
runId: import_zod8.z.string().min(1),
|
|
2210
|
+
sessionId: import_zod8.z.string().nullable(),
|
|
2211
|
+
workflowId: import_zod8.z.string().min(1),
|
|
2212
|
+
workflowRevisionId: import_zod8.z.string().nullable(),
|
|
2213
|
+
nodeId: import_zod8.z.string().nullable(),
|
|
2214
|
+
userId: import_zod8.z.string().nullable(),
|
|
2215
|
+
tenantId: import_zod8.z.string().nullable(),
|
|
2216
|
+
tags: import_zod8.z.array(import_zod8.z.string()),
|
|
2217
|
+
metadata: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).nullable(),
|
|
2218
|
+
payload: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown())
|
|
1487
2219
|
}).strip();
|
|
1488
|
-
var StudioWorkflowNodeSchema =
|
|
1489
|
-
tools:
|
|
2220
|
+
var StudioWorkflowNodeSchema = import_zod8.z.object({
|
|
2221
|
+
tools: import_zod8.z.array(StudioToolSchema).optional(),
|
|
1490
2222
|
toolDiscovery: ToolDiscoverySchema.optional(),
|
|
1491
|
-
id:
|
|
1492
|
-
label:
|
|
1493
|
-
type:
|
|
1494
|
-
state:
|
|
1495
|
-
provider:
|
|
1496
|
-
model:
|
|
2223
|
+
id: import_zod8.z.string().min(1),
|
|
2224
|
+
label: import_zod8.z.string(),
|
|
2225
|
+
type: import_zod8.z.string().nullable(),
|
|
2226
|
+
state: import_zod8.z.enum(["healthy", "warning", "failed", "interrupted", "retried"]).nullable(),
|
|
2227
|
+
provider: import_zod8.z.string().nullable(),
|
|
2228
|
+
model: import_zod8.z.string().nullable(),
|
|
1497
2229
|
metrics: StudioMetricSchema
|
|
1498
2230
|
}).strip();
|
|
1499
|
-
var StudioWorkflowInternalEdgeSchema =
|
|
1500
|
-
id:
|
|
1501
|
-
source:
|
|
1502
|
-
target:
|
|
1503
|
-
condition:
|
|
2231
|
+
var StudioWorkflowInternalEdgeSchema = import_zod8.z.object({
|
|
2232
|
+
id: import_zod8.z.string().min(1),
|
|
2233
|
+
source: import_zod8.z.string().min(1),
|
|
2234
|
+
target: import_zod8.z.string().min(1),
|
|
2235
|
+
condition: import_zod8.z.string().nullable()
|
|
1504
2236
|
}).strip();
|
|
1505
|
-
var StudioWorkflowTransitionSchema =
|
|
1506
|
-
kind:
|
|
1507
|
-
id:
|
|
1508
|
-
sourceWorkflowId:
|
|
1509
|
-
sourceNodeId:
|
|
1510
|
-
targetWorkflowId:
|
|
1511
|
-
condition:
|
|
1512
|
-
volume:
|
|
1513
|
-
successRate:
|
|
1514
|
-
medianDurationMs:
|
|
1515
|
-
errorRate:
|
|
2237
|
+
var StudioWorkflowTransitionSchema = import_zod8.z.object({
|
|
2238
|
+
kind: import_zod8.z.enum(["call", "handoff"]).optional(),
|
|
2239
|
+
id: import_zod8.z.string().min(1),
|
|
2240
|
+
sourceWorkflowId: import_zod8.z.string().min(1),
|
|
2241
|
+
sourceNodeId: import_zod8.z.string().nullable(),
|
|
2242
|
+
targetWorkflowId: import_zod8.z.string().min(1),
|
|
2243
|
+
condition: import_zod8.z.string().nullable(),
|
|
2244
|
+
volume: import_zod8.z.number().int().nonnegative(),
|
|
2245
|
+
successRate: import_zod8.z.number().min(0).max(100).nullable(),
|
|
2246
|
+
medianDurationMs: import_zod8.z.number().nonnegative().nullable(),
|
|
2247
|
+
errorRate: import_zod8.z.number().min(0).max(100).nullable()
|
|
1516
2248
|
}).strip();
|
|
1517
|
-
var StudioWorkflowSchema =
|
|
1518
|
-
id:
|
|
1519
|
-
name:
|
|
1520
|
-
description:
|
|
1521
|
-
versions:
|
|
1522
|
-
activeVersion:
|
|
1523
|
-
activeRevisionId:
|
|
2249
|
+
var StudioWorkflowSchema = import_zod8.z.object({
|
|
2250
|
+
id: import_zod8.z.string().min(1),
|
|
2251
|
+
name: import_zod8.z.string().min(1),
|
|
2252
|
+
description: import_zod8.z.string().nullable(),
|
|
2253
|
+
versions: import_zod8.z.array(import_zod8.z.string()),
|
|
2254
|
+
activeVersion: import_zod8.z.string().nullable(),
|
|
2255
|
+
activeRevisionId: import_zod8.z.string().nullable(),
|
|
1524
2256
|
health: StudioWorkflowHealthSchema,
|
|
1525
|
-
tags:
|
|
1526
|
-
lastActivityAt:
|
|
2257
|
+
tags: import_zod8.z.array(import_zod8.z.string()),
|
|
2258
|
+
lastActivityAt: import_zod8.z.string().datetime({ offset: true }).nullable(),
|
|
1527
2259
|
metrics: StudioMetricSchema,
|
|
1528
|
-
nodes:
|
|
1529
|
-
internalEdges:
|
|
2260
|
+
nodes: import_zod8.z.array(StudioWorkflowNodeSchema),
|
|
2261
|
+
internalEdges: import_zod8.z.array(StudioWorkflowInternalEdgeSchema)
|
|
1530
2262
|
}).strip();
|
|
1531
|
-
var StudioRunsResponseSchema =
|
|
1532
|
-
runs:
|
|
1533
|
-
totalCount:
|
|
2263
|
+
var StudioRunsResponseSchema = import_zod8.z.object({
|
|
2264
|
+
runs: import_zod8.z.array(StudioRunSchema),
|
|
2265
|
+
totalCount: import_zod8.z.number().int().nonnegative()
|
|
1534
2266
|
}).strip();
|
|
1535
|
-
var StudioSessionsResponseSchema =
|
|
1536
|
-
sessions:
|
|
1537
|
-
totalCount:
|
|
2267
|
+
var StudioSessionsResponseSchema = import_zod8.z.object({
|
|
2268
|
+
sessions: import_zod8.z.array(StudioSessionSchema),
|
|
2269
|
+
totalCount: import_zod8.z.number().int().nonnegative()
|
|
1538
2270
|
}).strip();
|
|
1539
|
-
var StudioInterruptsResponseSchema =
|
|
1540
|
-
interrupts:
|
|
1541
|
-
totalCount:
|
|
2271
|
+
var StudioInterruptsResponseSchema = import_zod8.z.object({
|
|
2272
|
+
interrupts: import_zod8.z.array(StudioInterruptSchema),
|
|
2273
|
+
totalCount: import_zod8.z.number().int().nonnegative()
|
|
1542
2274
|
}).strip();
|
|
1543
|
-
var StudioRunDetailResponseSchema =
|
|
2275
|
+
var StudioRunDetailResponseSchema = import_zod8.z.object({
|
|
1544
2276
|
run: StudioRunSchema,
|
|
1545
|
-
scores:
|
|
1546
|
-
canReview:
|
|
1547
|
-
reviewActorId:
|
|
1548
|
-
events:
|
|
2277
|
+
scores: import_zod8.z.array(StudioScoreSchema).optional(),
|
|
2278
|
+
canReview: import_zod8.z.boolean().optional(),
|
|
2279
|
+
reviewActorId: import_zod8.z.string().optional(),
|
|
2280
|
+
events: import_zod8.z.array(StudioDetailEventSchema),
|
|
1549
2281
|
session: StudioSessionSchema.nullable(),
|
|
1550
|
-
interrupts:
|
|
1551
|
-
updatedAt:
|
|
2282
|
+
interrupts: import_zod8.z.array(StudioInterruptSchema),
|
|
2283
|
+
updatedAt: import_zod8.z.string().datetime({ offset: true })
|
|
1552
2284
|
}).strip();
|
|
1553
|
-
var StudioSessionDetailResponseSchema =
|
|
2285
|
+
var StudioSessionDetailResponseSchema = import_zod8.z.object({
|
|
1554
2286
|
session: StudioSessionSchema,
|
|
1555
|
-
runs:
|
|
1556
|
-
events:
|
|
1557
|
-
interrupts:
|
|
1558
|
-
updatedAt:
|
|
2287
|
+
runs: import_zod8.z.array(StudioRunSchema),
|
|
2288
|
+
events: import_zod8.z.array(StudioDetailEventSchema),
|
|
2289
|
+
interrupts: import_zod8.z.array(StudioInterruptSchema),
|
|
2290
|
+
updatedAt: import_zod8.z.string().datetime({ offset: true })
|
|
1559
2291
|
}).strip();
|
|
1560
|
-
var StudioInterruptDetailResponseSchema =
|
|
2292
|
+
var StudioInterruptDetailResponseSchema = import_zod8.z.object({
|
|
1561
2293
|
interrupt: StudioInterruptSchema,
|
|
1562
|
-
events:
|
|
2294
|
+
events: import_zod8.z.array(StudioDetailEventSchema),
|
|
1563
2295
|
run: StudioRunSchema.nullable(),
|
|
1564
2296
|
session: StudioSessionSchema.nullable(),
|
|
1565
|
-
updatedAt:
|
|
2297
|
+
updatedAt: import_zod8.z.string().datetime({ offset: true })
|
|
1566
2298
|
}).strip();
|
|
1567
|
-
var StudioWorkflowsResponseSchema =
|
|
1568
|
-
workflows:
|
|
1569
|
-
observedCalls:
|
|
2299
|
+
var StudioWorkflowsResponseSchema = import_zod8.z.object({
|
|
2300
|
+
workflows: import_zod8.z.array(StudioWorkflowSchema),
|
|
2301
|
+
observedCalls: import_zod8.z.array(
|
|
1570
2302
|
StudioWorkflowTransitionSchema.extend({
|
|
1571
|
-
runId:
|
|
1572
|
-
invocationId:
|
|
1573
|
-
branchId:
|
|
2303
|
+
runId: import_zod8.z.string(),
|
|
2304
|
+
invocationId: import_zod8.z.string(),
|
|
2305
|
+
branchId: import_zod8.z.string()
|
|
1574
2306
|
})
|
|
1575
2307
|
).optional(),
|
|
1576
|
-
transitions:
|
|
2308
|
+
transitions: import_zod8.z.array(StudioWorkflowTransitionSchema),
|
|
1577
2309
|
cohort: StudioTimeRangeContextSchema.extend({
|
|
1578
|
-
workflowId:
|
|
1579
|
-
version:
|
|
2310
|
+
workflowId: import_zod8.z.string().nullable(),
|
|
2311
|
+
version: import_zod8.z.string().nullable()
|
|
1580
2312
|
}).strip()
|
|
1581
2313
|
}).strip();
|
|
1582
|
-
var StudioCatalogsResponseSchema =
|
|
1583
|
-
environments:
|
|
1584
|
-
providers:
|
|
1585
|
-
models:
|
|
1586
|
-
workflows:
|
|
1587
|
-
tags:
|
|
2314
|
+
var StudioCatalogsResponseSchema = import_zod8.z.object({
|
|
2315
|
+
environments: import_zod8.z.array(import_zod8.z.string()),
|
|
2316
|
+
providers: import_zod8.z.array(import_zod8.z.string()),
|
|
2317
|
+
models: import_zod8.z.array(import_zod8.z.string()),
|
|
2318
|
+
workflows: import_zod8.z.array(import_zod8.z.string()),
|
|
2319
|
+
tags: import_zod8.z.array(import_zod8.z.string())
|
|
1588
2320
|
}).strip();
|
|
1589
|
-
var StudioContextResponseSchema =
|
|
1590
|
-
|
|
1591
|
-
|
|
2321
|
+
var StudioContextResponseSchema = import_zod8.z.object({
|
|
2322
|
+
tablePreferenceScope: StudioTablePreferenceScopeSchema.nullable().optional(),
|
|
2323
|
+
organization: import_zod8.z.object({
|
|
2324
|
+
name: import_zod8.z.string().min(1)
|
|
1592
2325
|
}).strip(),
|
|
1593
|
-
project:
|
|
1594
|
-
name:
|
|
2326
|
+
project: import_zod8.z.object({
|
|
2327
|
+
name: import_zod8.z.string().min(1)
|
|
1595
2328
|
}).strip(),
|
|
1596
|
-
environments:
|
|
1597
|
-
apiKey:
|
|
1598
|
-
mode:
|
|
1599
|
-
scopes:
|
|
2329
|
+
environments: import_zod8.z.array(import_zod8.z.string()),
|
|
2330
|
+
apiKey: import_zod8.z.object({
|
|
2331
|
+
mode: import_zod8.z.enum(["test", "live"]),
|
|
2332
|
+
scopes: import_zod8.z.array(import_zod8.z.string())
|
|
1600
2333
|
}).strip().nullable(),
|
|
1601
|
-
api:
|
|
1602
|
-
status:
|
|
1603
|
-
service:
|
|
1604
|
-
version:
|
|
2334
|
+
api: import_zod8.z.object({
|
|
2335
|
+
status: import_zod8.z.literal("ok"),
|
|
2336
|
+
service: import_zod8.z.literal("kortyx-api"),
|
|
2337
|
+
version: import_zod8.z.string().min(1)
|
|
1605
2338
|
}).strip()
|
|
1606
2339
|
}).strip();
|
|
1607
2340
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1615,11 +2348,15 @@ var StudioContextResponseSchema = import_zod6.z.object({
|
|
|
1615
2348
|
DiagnosticNoteSchema,
|
|
1616
2349
|
DiagnosticPartSchema,
|
|
1617
2350
|
DiagnosticResponseSchema,
|
|
2351
|
+
EMPTY_TABLE_FILTERS,
|
|
2352
|
+
EVALUATION_TABLE_FILTER_FIELDS,
|
|
1618
2353
|
EnsureWorkflowTopologyRequestSchema,
|
|
1619
2354
|
EnsureWorkflowTopologyResponseSchema,
|
|
1620
2355
|
FEEDBACK_FILTERS,
|
|
1621
2356
|
FeedbackReasonSchema,
|
|
1622
2357
|
FeedbackSummarySchema,
|
|
2358
|
+
LEGACY_TABLE_FILTERS,
|
|
2359
|
+
PROMPT_TABLE_FILTER_FIELDS,
|
|
1623
2360
|
PromptAssetSchema,
|
|
1624
2361
|
PromptAssignmentSchema,
|
|
1625
2362
|
PromptBundleSchema,
|
|
@@ -1635,7 +2372,9 @@ var StudioContextResponseSchema = import_zod6.z.object({
|
|
|
1635
2372
|
PromptTransferRequestSchema,
|
|
1636
2373
|
PromptUsageSchema,
|
|
1637
2374
|
ReviewVerdictSchema,
|
|
2375
|
+
SAMPLE_PROJECT,
|
|
1638
2376
|
STUDIO_API_PROTOCOL_VERSION,
|
|
2377
|
+
STUDIO_TABLE_FIELDS,
|
|
1639
2378
|
STUDIO_TIME_RANGES,
|
|
1640
2379
|
StudioCatalogsResponseSchema,
|
|
1641
2380
|
StudioChangeResourceSchema,
|
|
@@ -1663,11 +2402,23 @@ var StudioContextResponseSchema = import_zod6.z.object({
|
|
|
1663
2402
|
StudioRunSchema,
|
|
1664
2403
|
StudioRunStatusSchema,
|
|
1665
2404
|
StudioRunsResponseSchema,
|
|
2405
|
+
StudioSavedViewDefinitionSchema,
|
|
1666
2406
|
StudioScoreResponseSchema,
|
|
1667
2407
|
StudioScoreSchema,
|
|
1668
2408
|
StudioSessionDetailResponseSchema,
|
|
1669
2409
|
StudioSessionSchema,
|
|
1670
2410
|
StudioSessionsResponseSchema,
|
|
2411
|
+
StudioTableConfigurationSchema,
|
|
2412
|
+
StudioTableDefaultsSchema,
|
|
2413
|
+
StudioTableIdSchema,
|
|
2414
|
+
StudioTableLayoutSchema,
|
|
2415
|
+
StudioTablePreferenceOperationSchema,
|
|
2416
|
+
StudioTablePreferenceResponseSchema,
|
|
2417
|
+
StudioTablePreferenceScopeSchema,
|
|
2418
|
+
StudioTablePreferenceWriteSchema,
|
|
2419
|
+
StudioTablePreferencesSchema,
|
|
2420
|
+
StudioTableQueryPreferencesSchema,
|
|
2421
|
+
StudioTableViewSchema,
|
|
1671
2422
|
StudioTimeRangeContextSchema,
|
|
1672
2423
|
StudioTimeRangeQuerySchema,
|
|
1673
2424
|
StudioTimeRangeSchema,
|
|
@@ -1682,6 +2433,8 @@ var StudioContextResponseSchema = import_zod6.z.object({
|
|
|
1682
2433
|
StudioWorkflowTransitionSchema,
|
|
1683
2434
|
StudioWorkflowsResponseSchema,
|
|
1684
2435
|
TELEMETRY_EVENT_TYPES,
|
|
2436
|
+
TableFilterRuleSchema,
|
|
2437
|
+
TableFiltersSchema,
|
|
1685
2438
|
TelemetryEventBatchResponseSchema,
|
|
1686
2439
|
TelemetryEventBatchSchema,
|
|
1687
2440
|
TelemetryEventSchema,
|
|
@@ -1703,15 +2456,25 @@ var StudioContextResponseSchema = import_zod6.z.object({
|
|
|
1703
2456
|
WorkflowTopologyEdgeSchema,
|
|
1704
2457
|
WorkflowTopologyNodeSchema,
|
|
1705
2458
|
WorkflowTopologyTransitionSchema,
|
|
2459
|
+
applyTablePreferenceOperation,
|
|
2460
|
+
captureDiagnosticContent,
|
|
2461
|
+
emptyTablePreferences,
|
|
2462
|
+
filterOperators,
|
|
1706
2463
|
isPrivateDiagnosticField,
|
|
2464
|
+
matchesTableFilters,
|
|
2465
|
+
matchesTableRule,
|
|
1707
2466
|
newerStudioVersion,
|
|
1708
2467
|
projectWorkflowCalls,
|
|
2468
|
+
readStudioTableFilters,
|
|
1709
2469
|
redactDiagnosticContent,
|
|
1710
2470
|
redactDiagnosticText,
|
|
1711
2471
|
resolveStudioInterruptStatus,
|
|
1712
2472
|
resolveStudioTimeRange,
|
|
1713
2473
|
studioUpdateRunning,
|
|
1714
2474
|
summarizeDiagnostic,
|
|
1715
|
-
summarizeUserFeedback
|
|
2475
|
+
summarizeUserFeedback,
|
|
2476
|
+
tablePassRate,
|
|
2477
|
+
tableQueueMs,
|
|
2478
|
+
validateTableFilters
|
|
1716
2479
|
});
|
|
1717
2480
|
//# sourceMappingURL=index.js.map
|