@cleocode/adapters 2026.6.7 → 2026.6.9
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/dist/index.js +717 -674
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -8396,7 +8396,7 @@ var init_operations_registry = __esm({
|
|
|
8396
8396
|
gateway: "mutate",
|
|
8397
8397
|
domain: "docs",
|
|
8398
8398
|
operation: "add",
|
|
8399
|
-
description: "docs.add (mutate) \u2014 attach a local file or
|
|
8399
|
+
description: "docs.add (mutate) \u2014 attach a local file, URL, or inline content to a CLEO owner entity (task, session, observation)",
|
|
8400
8400
|
tier: 1,
|
|
8401
8401
|
idempotent: false,
|
|
8402
8402
|
sessionRequired: false,
|
|
@@ -8420,6 +8420,12 @@ var init_operations_registry = __esm({
|
|
|
8420
8420
|
required: false,
|
|
8421
8421
|
description: "Remote URL to attach"
|
|
8422
8422
|
},
|
|
8423
|
+
{
|
|
8424
|
+
name: "content",
|
|
8425
|
+
type: "string",
|
|
8426
|
+
required: false,
|
|
8427
|
+
description: "Inline document body (T10965); mutually exclusive with file/url"
|
|
8428
|
+
},
|
|
8423
8429
|
{
|
|
8424
8430
|
name: "desc",
|
|
8425
8431
|
type: "string",
|
|
@@ -10126,7 +10132,8 @@ var init_provenance = __esm({
|
|
|
10126
10132
|
"superseded-by",
|
|
10127
10133
|
"related-task",
|
|
10128
10134
|
"linked-decision",
|
|
10129
|
-
"derived-from"
|
|
10135
|
+
"derived-from",
|
|
10136
|
+
"shares-topic"
|
|
10130
10137
|
];
|
|
10131
10138
|
DOC_LIFECYCLE_STATUSES = [
|
|
10132
10139
|
"active",
|
|
@@ -10201,6 +10208,41 @@ var init_provenance = __esm({
|
|
|
10201
10208
|
}
|
|
10202
10209
|
});
|
|
10203
10210
|
|
|
10211
|
+
// packages/contracts/src/docs/read.ts
|
|
10212
|
+
import { z as z8 } from "zod";
|
|
10213
|
+
var docFrontmatterSchema, docBodySchema, docReadResponseSchema;
|
|
10214
|
+
var init_read = __esm({
|
|
10215
|
+
"packages/contracts/src/docs/read.ts"() {
|
|
10216
|
+
"use strict";
|
|
10217
|
+
docFrontmatterSchema = z8.object({
|
|
10218
|
+
slug: z8.string(),
|
|
10219
|
+
kind: z8.string().nullable(),
|
|
10220
|
+
title: z8.string().nullable(),
|
|
10221
|
+
summary: z8.string().nullable(),
|
|
10222
|
+
lifecycleStatus: z8.string(),
|
|
10223
|
+
docVersion: z8.number().int(),
|
|
10224
|
+
ownerVersion: z8.string().nullable(),
|
|
10225
|
+
supersedes: z8.string().nullable(),
|
|
10226
|
+
supersededBy: z8.string().nullable(),
|
|
10227
|
+
topics: z8.array(z8.string()).readonly(),
|
|
10228
|
+
relatedTasks: z8.array(z8.string()).readonly(),
|
|
10229
|
+
sha256: z8.string(),
|
|
10230
|
+
createdAt: z8.string()
|
|
10231
|
+
});
|
|
10232
|
+
docBodySchema = z8.object({
|
|
10233
|
+
encoding: z8.enum(["utf-8", "base64"]),
|
|
10234
|
+
text: z8.string().optional(),
|
|
10235
|
+
base64: z8.string().optional(),
|
|
10236
|
+
sizeBytes: z8.number().int().nonnegative(),
|
|
10237
|
+
mimeType: z8.string().nullable()
|
|
10238
|
+
});
|
|
10239
|
+
docReadResponseSchema = z8.object({
|
|
10240
|
+
frontmatter: docFrontmatterSchema,
|
|
10241
|
+
body: docBodySchema
|
|
10242
|
+
});
|
|
10243
|
+
}
|
|
10244
|
+
});
|
|
10245
|
+
|
|
10204
10246
|
// packages/contracts/src/engine-result.ts
|
|
10205
10247
|
var init_engine_result = __esm({
|
|
10206
10248
|
"packages/contracts/src/engine-result.ts"() {
|
|
@@ -10254,72 +10296,72 @@ var init_errors = __esm({
|
|
|
10254
10296
|
});
|
|
10255
10297
|
|
|
10256
10298
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
10257
|
-
import { z as
|
|
10299
|
+
import { z as z9 } from "zod";
|
|
10258
10300
|
var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, AC_UUID_REGEX, AC_ALIAS_REGEX, SATISFIES_TASK_ID_REGEX, SATISFIES_VERSION_PIN_REGEX, satisfiesAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, ATOM_EXAMPLES;
|
|
10259
10301
|
var init_evidence_atom_schema = __esm({
|
|
10260
10302
|
"packages/contracts/src/evidence-atom-schema.ts"() {
|
|
10261
10303
|
"use strict";
|
|
10262
|
-
commitAtomSchema =
|
|
10263
|
-
kind:
|
|
10264
|
-
sha:
|
|
10304
|
+
commitAtomSchema = z9.object({
|
|
10305
|
+
kind: z9.literal("commit"),
|
|
10306
|
+
sha: z9.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
10265
10307
|
});
|
|
10266
|
-
filesAtomSchema =
|
|
10267
|
-
kind:
|
|
10268
|
-
paths:
|
|
10308
|
+
filesAtomSchema = z9.object({
|
|
10309
|
+
kind: z9.literal("files"),
|
|
10310
|
+
paths: z9.array(z9.string().min(1)).min(1, "files atom requires at least one path")
|
|
10269
10311
|
});
|
|
10270
|
-
testRunAtomSchema =
|
|
10271
|
-
kind:
|
|
10272
|
-
path:
|
|
10312
|
+
testRunAtomSchema = z9.object({
|
|
10313
|
+
kind: z9.literal("test-run"),
|
|
10314
|
+
path: z9.string().min(1, "test-run atom requires a non-empty path")
|
|
10273
10315
|
});
|
|
10274
|
-
toolAtomSchema =
|
|
10275
|
-
kind:
|
|
10276
|
-
tool:
|
|
10316
|
+
toolAtomSchema = z9.object({
|
|
10317
|
+
kind: z9.literal("tool"),
|
|
10318
|
+
tool: z9.string().min(1, "tool atom requires a non-empty tool name")
|
|
10277
10319
|
});
|
|
10278
|
-
urlAtomSchema =
|
|
10279
|
-
kind:
|
|
10280
|
-
url:
|
|
10320
|
+
urlAtomSchema = z9.object({
|
|
10321
|
+
kind: z9.literal("url"),
|
|
10322
|
+
url: z9.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
10281
10323
|
});
|
|
10282
|
-
noteAtomSchema =
|
|
10283
|
-
kind:
|
|
10284
|
-
note:
|
|
10324
|
+
noteAtomSchema = z9.object({
|
|
10325
|
+
kind: z9.literal("note"),
|
|
10326
|
+
note: z9.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
10285
10327
|
});
|
|
10286
|
-
decisionAtomSchema =
|
|
10287
|
-
kind:
|
|
10288
|
-
decisionId:
|
|
10328
|
+
decisionAtomSchema = z9.object({
|
|
10329
|
+
kind: z9.literal("decision"),
|
|
10330
|
+
decisionId: z9.string().min(1, "decision atom requires a non-empty decision ID")
|
|
10289
10331
|
});
|
|
10290
|
-
prAtomSchema =
|
|
10291
|
-
kind:
|
|
10292
|
-
prNumber:
|
|
10332
|
+
prAtomSchema = z9.object({
|
|
10333
|
+
kind: z9.literal("pr"),
|
|
10334
|
+
prNumber: z9.number().int().positive("pr atom requires a positive integer PR number")
|
|
10293
10335
|
});
|
|
10294
|
-
locDropAtomSchema =
|
|
10295
|
-
kind:
|
|
10296
|
-
fromLines:
|
|
10297
|
-
toLines:
|
|
10336
|
+
locDropAtomSchema = z9.object({
|
|
10337
|
+
kind: z9.literal("loc-drop"),
|
|
10338
|
+
fromLines: z9.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
10339
|
+
toLines: z9.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
10298
10340
|
});
|
|
10299
|
-
callsiteCoverageAtomSchema =
|
|
10300
|
-
kind:
|
|
10301
|
-
symbolName:
|
|
10302
|
-
relativeSourcePath:
|
|
10341
|
+
callsiteCoverageAtomSchema = z9.object({
|
|
10342
|
+
kind: z9.literal("callsite-coverage"),
|
|
10343
|
+
symbolName: z9.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
10344
|
+
relativeSourcePath: z9.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
10303
10345
|
});
|
|
10304
10346
|
AC_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
10305
10347
|
AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
10306
10348
|
SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
10307
10349
|
SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
10308
|
-
satisfiesAtomSchema =
|
|
10309
|
-
kind:
|
|
10350
|
+
satisfiesAtomSchema = z9.object({
|
|
10351
|
+
kind: z9.literal("satisfies"),
|
|
10310
10352
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
10311
|
-
targetTaskId:
|
|
10353
|
+
targetTaskId: z9.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
10312
10354
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
10313
|
-
targetAcId:
|
|
10355
|
+
targetAcId: z9.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
10314
10356
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
10315
|
-
targetAcAlias:
|
|
10357
|
+
targetAcAlias: z9.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
10316
10358
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
10317
|
-
versionPin:
|
|
10359
|
+
versionPin: z9.string().regex(
|
|
10318
10360
|
SATISFIES_VERSION_PIN_REGEX,
|
|
10319
10361
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
10320
10362
|
).optional()
|
|
10321
10363
|
});
|
|
10322
|
-
EvidenceAtomSchema =
|
|
10364
|
+
EvidenceAtomSchema = z9.discriminatedUnion("kind", [
|
|
10323
10365
|
commitAtomSchema,
|
|
10324
10366
|
filesAtomSchema,
|
|
10325
10367
|
testRunAtomSchema,
|
|
@@ -10366,58 +10408,58 @@ var init_evidence_atom_schema = __esm({
|
|
|
10366
10408
|
});
|
|
10367
10409
|
|
|
10368
10410
|
// packages/contracts/src/evidence-record-schema.ts
|
|
10369
|
-
import { z as
|
|
10411
|
+
import { z as z10 } from "zod";
|
|
10370
10412
|
var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
|
|
10371
10413
|
var init_evidence_record_schema = __esm({
|
|
10372
10414
|
"packages/contracts/src/evidence-record-schema.ts"() {
|
|
10373
10415
|
"use strict";
|
|
10374
|
-
evidenceBaseSchema =
|
|
10416
|
+
evidenceBaseSchema = z10.object({
|
|
10375
10417
|
/** Identity string of the agent that produced this record. */
|
|
10376
|
-
agentIdentity:
|
|
10418
|
+
agentIdentity: z10.string().min(1),
|
|
10377
10419
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
10378
|
-
attachmentSha256:
|
|
10420
|
+
attachmentSha256: z10.string().length(64),
|
|
10379
10421
|
/** ISO 8601 timestamp at which the action ran. */
|
|
10380
|
-
ranAt:
|
|
10422
|
+
ranAt: z10.string().datetime(),
|
|
10381
10423
|
/** Wall-clock duration of the action in milliseconds. */
|
|
10382
|
-
durationMs:
|
|
10424
|
+
durationMs: z10.number().nonnegative()
|
|
10383
10425
|
});
|
|
10384
10426
|
implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
10385
|
-
kind:
|
|
10386
|
-
phase:
|
|
10387
|
-
filesChanged:
|
|
10388
|
-
linesAdded:
|
|
10389
|
-
linesRemoved:
|
|
10427
|
+
kind: z10.literal("impl-diff"),
|
|
10428
|
+
phase: z10.literal("implement"),
|
|
10429
|
+
filesChanged: z10.array(z10.string().min(1)).min(1),
|
|
10430
|
+
linesAdded: z10.number().int().nonnegative(),
|
|
10431
|
+
linesRemoved: z10.number().int().nonnegative()
|
|
10390
10432
|
});
|
|
10391
10433
|
validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
10392
|
-
kind:
|
|
10393
|
-
phase:
|
|
10394
|
-
reqIdsChecked:
|
|
10395
|
-
passed:
|
|
10396
|
-
details:
|
|
10434
|
+
kind: z10.literal("validate-spec-check"),
|
|
10435
|
+
phase: z10.literal("validate"),
|
|
10436
|
+
reqIdsChecked: z10.array(z10.string().min(1)).min(1),
|
|
10437
|
+
passed: z10.boolean(),
|
|
10438
|
+
details: z10.string().min(1)
|
|
10397
10439
|
});
|
|
10398
10440
|
testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
10399
|
-
kind:
|
|
10400
|
-
phase:
|
|
10401
|
-
command:
|
|
10402
|
-
exitCode:
|
|
10403
|
-
testsPassed:
|
|
10404
|
-
testsFailed:
|
|
10441
|
+
kind: z10.literal("test-output"),
|
|
10442
|
+
phase: z10.literal("test"),
|
|
10443
|
+
command: z10.string().min(1),
|
|
10444
|
+
exitCode: z10.number().int(),
|
|
10445
|
+
testsPassed: z10.number().int().nonnegative(),
|
|
10446
|
+
testsFailed: z10.number().int().nonnegative()
|
|
10405
10447
|
});
|
|
10406
10448
|
lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
10407
|
-
kind:
|
|
10408
|
-
phase:
|
|
10409
|
-
tool:
|
|
10410
|
-
passed:
|
|
10411
|
-
warnings:
|
|
10412
|
-
errors:
|
|
10449
|
+
kind: z10.literal("lint-report"),
|
|
10450
|
+
phase: z10.enum(["implement", "test"]),
|
|
10451
|
+
tool: z10.string().min(1),
|
|
10452
|
+
passed: z10.boolean(),
|
|
10453
|
+
warnings: z10.number().int().nonnegative(),
|
|
10454
|
+
errors: z10.number().int().nonnegative()
|
|
10413
10455
|
});
|
|
10414
10456
|
commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
10415
|
-
kind:
|
|
10416
|
-
phase:
|
|
10417
|
-
cmd:
|
|
10418
|
-
exitCode:
|
|
10457
|
+
kind: z10.literal("command-output"),
|
|
10458
|
+
phase: z10.enum(["implement", "validate", "test"]),
|
|
10459
|
+
cmd: z10.string().min(1),
|
|
10460
|
+
exitCode: z10.number().int()
|
|
10419
10461
|
});
|
|
10420
|
-
evidenceRecordSchema =
|
|
10462
|
+
evidenceRecordSchema = z10.discriminatedUnion("kind", [
|
|
10421
10463
|
implDiffRecordSchema,
|
|
10422
10464
|
validateSpecCheckRecordSchema,
|
|
10423
10465
|
testOutputRecordSchema,
|
|
@@ -10973,7 +11015,7 @@ var init_status_registry = __esm({
|
|
|
10973
11015
|
});
|
|
10974
11016
|
|
|
10975
11017
|
// packages/contracts/src/workgraph.ts
|
|
10976
|
-
import { z as
|
|
11018
|
+
import { z as z11 } from "zod";
|
|
10977
11019
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX, taskTypeSchema, taskPrioritySchema, taskStatusSchema, verificationGateSchema, workGraphRelationKindSchema, workGraphTraversalDirectionSchema, workGraphEdgeDirectionSchema, paginationParamsSchema, workGraphNodeSchema, workGraphEdgeSchema, workGraphHierarchyEdgeSchema, workGraphPageInfoSchema, workGraphRollupCountsSchema, workGraphSubtreePercentagesSchema, workGraphProjectionMismatchSchema, workGraphReadyFrontierTaskSchema, workGraphRelationEdgeSchema, workGraphDependencyEdgeSchema, workGraphOmissionReasonSchema, workGraphContextBudgetSchema, workGraphOmissionSchema, workGraphDirectEdgeSchema, workGraphContextPackParamsSchema, workGraphSliceParamsSchema, workGraphSliceSchema, workGraphReadinessParamsSchema, workGraphReadinessResultSchema, workGraphContextPackSchema, workGraphScaffoldValidateParamsSchema, workGraphScaffoldValidationIssueSchema, workGraphScaffoldValidateResultSchema, workGraphScaffoldApplyParamsSchema, workGraphScaffoldApplyResultSchema, workGraphPlanningDocParamsSchema, workGraphPlanningDocSchema, tasksTraverseParamsSchema, tasksTraverseResultSchema, tasksTreeParamsSchema, tasksTreeResultSchema, tasksRollupParamsSchema, tasksRollupResultSchema, tasksFrontierParamsSchema, tasksFrontierResultSchema, tasksWorkGraphAuditParamsSchema, tasksWorkGraphAuditResultSchema;
|
|
10978
11020
|
var init_workgraph = __esm({
|
|
10979
11021
|
"packages/contracts/src/workgraph.ts"() {
|
|
@@ -10981,10 +11023,10 @@ var init_workgraph = __esm({
|
|
|
10981
11023
|
init_enums();
|
|
10982
11024
|
init_status_registry();
|
|
10983
11025
|
E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
10984
|
-
taskTypeSchema =
|
|
10985
|
-
taskPrioritySchema =
|
|
10986
|
-
taskStatusSchema =
|
|
10987
|
-
verificationGateSchema =
|
|
11026
|
+
taskTypeSchema = z11.enum(["saga", "epic", "task", "subtask"]);
|
|
11027
|
+
taskPrioritySchema = z11.enum(["critical", "high", "medium", "low"]);
|
|
11028
|
+
taskStatusSchema = z11.enum(TASK_STATUSES);
|
|
11029
|
+
verificationGateSchema = z11.enum([
|
|
10988
11030
|
"implemented",
|
|
10989
11031
|
"testsPassed",
|
|
10990
11032
|
"qaPassed",
|
|
@@ -10993,7 +11035,7 @@ var init_workgraph = __esm({
|
|
|
10993
11035
|
"documented",
|
|
10994
11036
|
"nexusImpact"
|
|
10995
11037
|
]);
|
|
10996
|
-
workGraphRelationKindSchema =
|
|
11038
|
+
workGraphRelationKindSchema = z11.enum([
|
|
10997
11039
|
"contains",
|
|
10998
11040
|
"depends_on",
|
|
10999
11041
|
"blocks",
|
|
@@ -11001,317 +11043,317 @@ var init_workgraph = __esm({
|
|
|
11001
11043
|
"groups",
|
|
11002
11044
|
"satisfies"
|
|
11003
11045
|
]);
|
|
11004
|
-
workGraphTraversalDirectionSchema =
|
|
11046
|
+
workGraphTraversalDirectionSchema = z11.enum([
|
|
11005
11047
|
"ancestors",
|
|
11006
11048
|
"descendants",
|
|
11007
11049
|
"upstream",
|
|
11008
11050
|
"downstream"
|
|
11009
11051
|
]);
|
|
11010
|
-
workGraphEdgeDirectionSchema =
|
|
11011
|
-
paginationParamsSchema =
|
|
11012
|
-
cursor:
|
|
11013
|
-
limit:
|
|
11052
|
+
workGraphEdgeDirectionSchema = z11.enum(["out", "in", "both"]);
|
|
11053
|
+
paginationParamsSchema = z11.object({
|
|
11054
|
+
cursor: z11.string().min(1).optional(),
|
|
11055
|
+
limit: z11.number().int().positive().max(500).optional()
|
|
11014
11056
|
});
|
|
11015
|
-
workGraphNodeSchema =
|
|
11016
|
-
id:
|
|
11057
|
+
workGraphNodeSchema = z11.object({
|
|
11058
|
+
id: z11.string().min(1),
|
|
11017
11059
|
type: taskTypeSchema,
|
|
11018
|
-
title:
|
|
11060
|
+
title: z11.string(),
|
|
11019
11061
|
status: taskStatusSchema,
|
|
11020
11062
|
priority: taskPrioritySchema,
|
|
11021
|
-
parentId:
|
|
11063
|
+
parentId: z11.string().min(1).optional()
|
|
11022
11064
|
});
|
|
11023
|
-
workGraphEdgeSchema =
|
|
11024
|
-
fromId:
|
|
11025
|
-
toId:
|
|
11065
|
+
workGraphEdgeSchema = z11.object({
|
|
11066
|
+
fromId: z11.string().min(1),
|
|
11067
|
+
toId: z11.string().min(1),
|
|
11026
11068
|
kind: workGraphRelationKindSchema
|
|
11027
11069
|
});
|
|
11028
|
-
workGraphHierarchyEdgeSchema =
|
|
11029
|
-
fromId:
|
|
11030
|
-
toId:
|
|
11031
|
-
kind:
|
|
11070
|
+
workGraphHierarchyEdgeSchema = z11.object({
|
|
11071
|
+
fromId: z11.string().min(1),
|
|
11072
|
+
toId: z11.string().min(1),
|
|
11073
|
+
kind: z11.literal("contains")
|
|
11032
11074
|
}).strict();
|
|
11033
|
-
workGraphPageInfoSchema =
|
|
11034
|
-
nextCursor:
|
|
11035
|
-
hasMore:
|
|
11036
|
-
});
|
|
11037
|
-
workGraphRollupCountsSchema =
|
|
11038
|
-
total:
|
|
11039
|
-
byStatus:
|
|
11040
|
-
byType:
|
|
11041
|
-
});
|
|
11042
|
-
workGraphSubtreePercentagesSchema =
|
|
11043
|
-
done:
|
|
11044
|
-
active:
|
|
11045
|
-
blocked:
|
|
11046
|
-
pending:
|
|
11047
|
-
cancelled:
|
|
11048
|
-
});
|
|
11049
|
-
workGraphProjectionMismatchSchema =
|
|
11050
|
-
field:
|
|
11051
|
-
expected:
|
|
11052
|
-
actual:
|
|
11075
|
+
workGraphPageInfoSchema = z11.object({
|
|
11076
|
+
nextCursor: z11.string().min(1).optional(),
|
|
11077
|
+
hasMore: z11.boolean()
|
|
11078
|
+
});
|
|
11079
|
+
workGraphRollupCountsSchema = z11.object({
|
|
11080
|
+
total: z11.number().int().nonnegative(),
|
|
11081
|
+
byStatus: z11.partialRecord(taskStatusSchema, z11.number().int().nonnegative()),
|
|
11082
|
+
byType: z11.partialRecord(taskTypeSchema, z11.number().int().nonnegative())
|
|
11083
|
+
});
|
|
11084
|
+
workGraphSubtreePercentagesSchema = z11.object({
|
|
11085
|
+
done: z11.number().nonnegative(),
|
|
11086
|
+
active: z11.number().nonnegative(),
|
|
11087
|
+
blocked: z11.number().nonnegative(),
|
|
11088
|
+
pending: z11.number().nonnegative(),
|
|
11089
|
+
cancelled: z11.number().nonnegative()
|
|
11090
|
+
});
|
|
11091
|
+
workGraphProjectionMismatchSchema = z11.object({
|
|
11092
|
+
field: z11.string().min(1),
|
|
11093
|
+
expected: z11.number().int().nonnegative(),
|
|
11094
|
+
actual: z11.number().int().nonnegative()
|
|
11053
11095
|
});
|
|
11054
11096
|
workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
11055
|
-
role:
|
|
11056
|
-
dependencyBlockers:
|
|
11057
|
-
gateBlockers:
|
|
11097
|
+
role: z11.string().min(1).optional(),
|
|
11098
|
+
dependencyBlockers: z11.array(z11.object({ taskId: z11.string().min(1), status: taskStatusSchema })),
|
|
11099
|
+
gateBlockers: z11.array(z11.object({ gate: verificationGateSchema }))
|
|
11058
11100
|
});
|
|
11059
11101
|
workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
11060
|
-
source:
|
|
11061
|
-
relationType:
|
|
11062
|
-
reason:
|
|
11102
|
+
source: z11.literal("relation"),
|
|
11103
|
+
relationType: z11.enum(TASK_RELATION_TYPES),
|
|
11104
|
+
reason: z11.string().min(1).optional()
|
|
11063
11105
|
});
|
|
11064
11106
|
workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
11065
|
-
source:
|
|
11066
|
-
kind:
|
|
11107
|
+
source: z11.literal("dependency"),
|
|
11108
|
+
kind: z11.literal("depends_on")
|
|
11067
11109
|
});
|
|
11068
|
-
workGraphOmissionReasonSchema =
|
|
11110
|
+
workGraphOmissionReasonSchema = z11.enum([
|
|
11069
11111
|
"budget_exceeded",
|
|
11070
11112
|
"not_requested",
|
|
11071
11113
|
"not_available",
|
|
11072
11114
|
"redacted",
|
|
11073
11115
|
"truncated"
|
|
11074
11116
|
]);
|
|
11075
|
-
workGraphContextBudgetSchema =
|
|
11076
|
-
tokenBudget:
|
|
11077
|
-
estimatedTokens:
|
|
11078
|
-
remainingTokens:
|
|
11079
|
-
truncated:
|
|
11080
|
-
});
|
|
11081
|
-
workGraphOmissionSchema =
|
|
11082
|
-
path:
|
|
11117
|
+
workGraphContextBudgetSchema = z11.object({
|
|
11118
|
+
tokenBudget: z11.number().int().nonnegative(),
|
|
11119
|
+
estimatedTokens: z11.number().int().nonnegative(),
|
|
11120
|
+
remainingTokens: z11.number().int().nonnegative(),
|
|
11121
|
+
truncated: z11.boolean()
|
|
11122
|
+
});
|
|
11123
|
+
workGraphOmissionSchema = z11.object({
|
|
11124
|
+
path: z11.string().min(1),
|
|
11083
11125
|
reason: workGraphOmissionReasonSchema,
|
|
11084
|
-
message:
|
|
11085
|
-
estimatedTokens:
|
|
11126
|
+
message: z11.string().min(1),
|
|
11127
|
+
estimatedTokens: z11.number().int().nonnegative().optional()
|
|
11086
11128
|
});
|
|
11087
|
-
workGraphDirectEdgeSchema =
|
|
11129
|
+
workGraphDirectEdgeSchema = z11.discriminatedUnion("source", [
|
|
11088
11130
|
workGraphRelationEdgeSchema,
|
|
11089
11131
|
workGraphDependencyEdgeSchema
|
|
11090
11132
|
]);
|
|
11091
11133
|
workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
11092
|
-
rootId:
|
|
11093
|
-
tokenBudget:
|
|
11094
|
-
includeRelations:
|
|
11095
|
-
includeReadiness:
|
|
11096
|
-
includeRollup:
|
|
11134
|
+
rootId: z11.string().min(1),
|
|
11135
|
+
tokenBudget: z11.number().int().positive().optional(),
|
|
11136
|
+
includeRelations: z11.boolean().optional(),
|
|
11137
|
+
includeReadiness: z11.boolean().optional(),
|
|
11138
|
+
includeRollup: z11.boolean().optional()
|
|
11097
11139
|
});
|
|
11098
11140
|
workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
11099
|
-
rootId:
|
|
11141
|
+
rootId: z11.string().min(1),
|
|
11100
11142
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
11101
|
-
maxDepth:
|
|
11102
|
-
includeRelations:
|
|
11143
|
+
maxDepth: z11.number().int().nonnegative().optional(),
|
|
11144
|
+
includeRelations: z11.boolean().optional()
|
|
11103
11145
|
});
|
|
11104
|
-
workGraphSliceSchema =
|
|
11105
|
-
rootId:
|
|
11146
|
+
workGraphSliceSchema = z11.object({
|
|
11147
|
+
rootId: z11.string().min(1),
|
|
11106
11148
|
direction: workGraphTraversalDirectionSchema,
|
|
11107
|
-
nodes:
|
|
11108
|
-
edges:
|
|
11149
|
+
nodes: z11.array(workGraphNodeSchema),
|
|
11150
|
+
edges: z11.array(workGraphEdgeSchema),
|
|
11109
11151
|
pageInfo: workGraphPageInfoSchema,
|
|
11110
|
-
omissions:
|
|
11111
|
-
});
|
|
11112
|
-
workGraphReadinessParamsSchema =
|
|
11113
|
-
rootId:
|
|
11114
|
-
role:
|
|
11115
|
-
includeGateBlockers:
|
|
11116
|
-
});
|
|
11117
|
-
workGraphReadinessResultSchema =
|
|
11118
|
-
rootId:
|
|
11119
|
-
role:
|
|
11120
|
-
ready:
|
|
11121
|
-
warnings:
|
|
11122
|
-
groups:
|
|
11123
|
-
ready:
|
|
11124
|
-
blocked:
|
|
11125
|
-
blockedBy:
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
kind:
|
|
11129
|
-
blockerId:
|
|
11130
|
-
blocks:
|
|
11152
|
+
omissions: z11.array(workGraphOmissionSchema).optional()
|
|
11153
|
+
});
|
|
11154
|
+
workGraphReadinessParamsSchema = z11.object({
|
|
11155
|
+
rootId: z11.string().min(1),
|
|
11156
|
+
role: z11.string().min(1).optional(),
|
|
11157
|
+
includeGateBlockers: z11.boolean().optional()
|
|
11158
|
+
});
|
|
11159
|
+
workGraphReadinessResultSchema = z11.object({
|
|
11160
|
+
rootId: z11.string().min(1),
|
|
11161
|
+
role: z11.string().min(1).optional(),
|
|
11162
|
+
ready: z11.boolean(),
|
|
11163
|
+
warnings: z11.array(z11.string()),
|
|
11164
|
+
groups: z11.object({
|
|
11165
|
+
ready: z11.array(workGraphReadyFrontierTaskSchema),
|
|
11166
|
+
blocked: z11.array(workGraphReadyFrontierTaskSchema),
|
|
11167
|
+
blockedBy: z11.array(
|
|
11168
|
+
z11.discriminatedUnion("kind", [
|
|
11169
|
+
z11.object({
|
|
11170
|
+
kind: z11.literal("dependency"),
|
|
11171
|
+
blockerId: z11.string().min(1),
|
|
11172
|
+
blocks: z11.array(z11.string().min(1))
|
|
11131
11173
|
}),
|
|
11132
|
-
|
|
11133
|
-
kind:
|
|
11174
|
+
z11.object({
|
|
11175
|
+
kind: z11.literal("gate"),
|
|
11134
11176
|
gate: verificationGateSchema,
|
|
11135
|
-
blocks:
|
|
11177
|
+
blocks: z11.array(z11.string().min(1))
|
|
11136
11178
|
})
|
|
11137
11179
|
])
|
|
11138
11180
|
)
|
|
11139
11181
|
})
|
|
11140
11182
|
});
|
|
11141
|
-
workGraphContextPackSchema =
|
|
11142
|
-
rootId:
|
|
11143
|
-
generatedAt:
|
|
11183
|
+
workGraphContextPackSchema = z11.object({
|
|
11184
|
+
rootId: z11.string().min(1),
|
|
11185
|
+
generatedAt: z11.string().min(1),
|
|
11144
11186
|
budget: workGraphContextBudgetSchema,
|
|
11145
11187
|
slice: workGraphSliceSchema,
|
|
11146
|
-
relationEdges:
|
|
11147
|
-
rootId:
|
|
11188
|
+
relationEdges: z11.object({
|
|
11189
|
+
rootId: z11.string().min(1),
|
|
11148
11190
|
direction: workGraphEdgeDirectionSchema,
|
|
11149
|
-
edges:
|
|
11191
|
+
edges: z11.array(workGraphDirectEdgeSchema)
|
|
11150
11192
|
}).optional(),
|
|
11151
11193
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
11152
|
-
rollup:
|
|
11153
|
-
omissions:
|
|
11154
|
-
});
|
|
11155
|
-
workGraphScaffoldValidateParamsSchema =
|
|
11156
|
-
rootId:
|
|
11157
|
-
nodes:
|
|
11158
|
-
|
|
11159
|
-
id:
|
|
11194
|
+
rollup: z11.lazy(() => tasksRollupResultSchema).optional(),
|
|
11195
|
+
omissions: z11.array(workGraphOmissionSchema)
|
|
11196
|
+
});
|
|
11197
|
+
workGraphScaffoldValidateParamsSchema = z11.object({
|
|
11198
|
+
rootId: z11.string().min(1),
|
|
11199
|
+
nodes: z11.array(
|
|
11200
|
+
z11.object({
|
|
11201
|
+
id: z11.string().min(1),
|
|
11160
11202
|
type: taskTypeSchema,
|
|
11161
|
-
parentId:
|
|
11203
|
+
parentId: z11.string().min(1).nullable().optional()
|
|
11162
11204
|
})
|
|
11163
11205
|
),
|
|
11164
|
-
edges:
|
|
11165
|
-
dryRun:
|
|
11166
|
-
});
|
|
11167
|
-
workGraphScaffoldValidationIssueSchema =
|
|
11168
|
-
code:
|
|
11169
|
-
message:
|
|
11170
|
-
taskId:
|
|
11171
|
-
severity:
|
|
11172
|
-
});
|
|
11173
|
-
workGraphScaffoldValidateResultSchema =
|
|
11174
|
-
rootId:
|
|
11175
|
-
valid:
|
|
11176
|
-
dryRun:
|
|
11177
|
-
issues:
|
|
11178
|
-
hierarchy:
|
|
11179
|
-
valid:
|
|
11180
|
-
violations:
|
|
11181
|
-
|
|
11182
|
-
code:
|
|
11183
|
-
taskId:
|
|
11206
|
+
edges: z11.array(workGraphDirectEdgeSchema).optional(),
|
|
11207
|
+
dryRun: z11.boolean().optional()
|
|
11208
|
+
});
|
|
11209
|
+
workGraphScaffoldValidationIssueSchema = z11.object({
|
|
11210
|
+
code: z11.string().min(1),
|
|
11211
|
+
message: z11.string().min(1),
|
|
11212
|
+
taskId: z11.string().min(1).optional(),
|
|
11213
|
+
severity: z11.enum(["error", "warning"])
|
|
11214
|
+
});
|
|
11215
|
+
workGraphScaffoldValidateResultSchema = z11.object({
|
|
11216
|
+
rootId: z11.string().min(1),
|
|
11217
|
+
valid: z11.boolean(),
|
|
11218
|
+
dryRun: z11.boolean(),
|
|
11219
|
+
issues: z11.array(workGraphScaffoldValidationIssueSchema),
|
|
11220
|
+
hierarchy: z11.object({
|
|
11221
|
+
valid: z11.boolean(),
|
|
11222
|
+
violations: z11.array(
|
|
11223
|
+
z11.object({
|
|
11224
|
+
code: z11.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
11225
|
+
taskId: z11.string().min(1),
|
|
11184
11226
|
taskType: taskTypeSchema,
|
|
11185
|
-
parentId:
|
|
11227
|
+
parentId: z11.string().min(1).nullable(),
|
|
11186
11228
|
parentType: taskTypeSchema.optional(),
|
|
11187
|
-
message:
|
|
11229
|
+
message: z11.string().min(1)
|
|
11188
11230
|
})
|
|
11189
11231
|
)
|
|
11190
11232
|
})
|
|
11191
11233
|
});
|
|
11192
11234
|
workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
11193
|
-
apply:
|
|
11235
|
+
apply: z11.boolean().optional()
|
|
11194
11236
|
});
|
|
11195
11237
|
workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
11196
|
-
applied:
|
|
11197
|
-
nodesChanged:
|
|
11198
|
-
edgesChanged:
|
|
11199
|
-
});
|
|
11200
|
-
workGraphPlanningDocParamsSchema =
|
|
11201
|
-
rootId:
|
|
11202
|
-
audience:
|
|
11203
|
-
tokenBudget:
|
|
11204
|
-
includeRelations:
|
|
11205
|
-
includeReadiness:
|
|
11206
|
-
includeRollup:
|
|
11207
|
-
});
|
|
11208
|
-
workGraphPlanningDocSchema =
|
|
11209
|
-
rootId:
|
|
11210
|
-
generatedAt:
|
|
11211
|
-
audience:
|
|
11212
|
-
title:
|
|
11213
|
-
content:
|
|
11214
|
-
sections:
|
|
11215
|
-
estimatedTokens:
|
|
11216
|
-
budget:
|
|
11217
|
-
tokenBudget:
|
|
11218
|
-
truncated:
|
|
11238
|
+
applied: z11.boolean(),
|
|
11239
|
+
nodesChanged: z11.number().int().nonnegative(),
|
|
11240
|
+
edgesChanged: z11.number().int().nonnegative()
|
|
11241
|
+
});
|
|
11242
|
+
workGraphPlanningDocParamsSchema = z11.object({
|
|
11243
|
+
rootId: z11.string().min(1),
|
|
11244
|
+
audience: z11.enum(["agent", "maintainer"]),
|
|
11245
|
+
tokenBudget: z11.number().int().positive().optional(),
|
|
11246
|
+
includeRelations: z11.boolean().optional(),
|
|
11247
|
+
includeReadiness: z11.boolean().optional(),
|
|
11248
|
+
includeRollup: z11.boolean().optional()
|
|
11249
|
+
});
|
|
11250
|
+
workGraphPlanningDocSchema = z11.object({
|
|
11251
|
+
rootId: z11.string().min(1),
|
|
11252
|
+
generatedAt: z11.string().min(1),
|
|
11253
|
+
audience: z11.enum(["agent", "maintainer"]),
|
|
11254
|
+
title: z11.string().min(1),
|
|
11255
|
+
content: z11.string(),
|
|
11256
|
+
sections: z11.array(z11.string().min(1)),
|
|
11257
|
+
estimatedTokens: z11.number().int().nonnegative(),
|
|
11258
|
+
budget: z11.object({
|
|
11259
|
+
tokenBudget: z11.number().int().positive(),
|
|
11260
|
+
truncated: z11.boolean()
|
|
11219
11261
|
}).optional()
|
|
11220
11262
|
});
|
|
11221
11263
|
tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
11222
|
-
rootId:
|
|
11264
|
+
rootId: z11.string().min(1),
|
|
11223
11265
|
direction: workGraphTraversalDirectionSchema,
|
|
11224
|
-
maxDepth:
|
|
11225
|
-
includeRelations:
|
|
11266
|
+
maxDepth: z11.number().int().nonnegative().optional(),
|
|
11267
|
+
includeRelations: z11.boolean().optional()
|
|
11226
11268
|
});
|
|
11227
|
-
tasksTraverseResultSchema =
|
|
11228
|
-
rootId:
|
|
11269
|
+
tasksTraverseResultSchema = z11.object({
|
|
11270
|
+
rootId: z11.string().min(1),
|
|
11229
11271
|
direction: workGraphTraversalDirectionSchema,
|
|
11230
|
-
nodes:
|
|
11231
|
-
edges:
|
|
11272
|
+
nodes: z11.array(workGraphNodeSchema),
|
|
11273
|
+
edges: z11.array(workGraphEdgeSchema),
|
|
11232
11274
|
pageInfo: workGraphPageInfoSchema
|
|
11233
11275
|
});
|
|
11234
11276
|
tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
11235
|
-
rootId:
|
|
11236
|
-
maxDepth:
|
|
11277
|
+
rootId: z11.string().min(1),
|
|
11278
|
+
maxDepth: z11.number().int().nonnegative().optional()
|
|
11237
11279
|
});
|
|
11238
|
-
tasksTreeResultSchema =
|
|
11239
|
-
rootId:
|
|
11240
|
-
nodes:
|
|
11241
|
-
edges:
|
|
11280
|
+
tasksTreeResultSchema = z11.object({
|
|
11281
|
+
rootId: z11.string().min(1),
|
|
11282
|
+
nodes: z11.array(workGraphNodeSchema.extend({ depth: z11.number().int().positive() })),
|
|
11283
|
+
edges: z11.array(workGraphHierarchyEdgeSchema),
|
|
11242
11284
|
pageInfo: workGraphPageInfoSchema
|
|
11243
11285
|
});
|
|
11244
|
-
tasksRollupParamsSchema =
|
|
11245
|
-
rootId:
|
|
11286
|
+
tasksRollupParamsSchema = z11.object({
|
|
11287
|
+
rootId: z11.string().min(1),
|
|
11246
11288
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
11247
11289
|
});
|
|
11248
|
-
tasksRollupResultSchema =
|
|
11249
|
-
rootId:
|
|
11290
|
+
tasksRollupResultSchema = z11.object({
|
|
11291
|
+
rootId: z11.string().min(1),
|
|
11250
11292
|
direct: workGraphRollupCountsSchema,
|
|
11251
11293
|
subtree: workGraphRollupCountsSchema,
|
|
11252
|
-
percentDenominator:
|
|
11253
|
-
basis:
|
|
11254
|
-
total:
|
|
11255
|
-
description:
|
|
11294
|
+
percentDenominator: z11.object({
|
|
11295
|
+
basis: z11.literal("subtree-total"),
|
|
11296
|
+
total: z11.number().int().nonnegative(),
|
|
11297
|
+
description: z11.string().min(1)
|
|
11256
11298
|
}),
|
|
11257
11299
|
percentages: workGraphSubtreePercentagesSchema,
|
|
11258
|
-
staleProjection:
|
|
11259
|
-
projectionMismatches:
|
|
11260
|
-
});
|
|
11261
|
-
tasksFrontierParamsSchema =
|
|
11262
|
-
rootId:
|
|
11263
|
-
role:
|
|
11264
|
-
});
|
|
11265
|
-
tasksFrontierResultSchema =
|
|
11266
|
-
rootId:
|
|
11267
|
-
role:
|
|
11268
|
-
groups:
|
|
11269
|
-
ready:
|
|
11270
|
-
blocked:
|
|
11271
|
-
blockedBy:
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
kind:
|
|
11275
|
-
blockerId:
|
|
11276
|
-
blocks:
|
|
11300
|
+
staleProjection: z11.boolean(),
|
|
11301
|
+
projectionMismatches: z11.array(workGraphProjectionMismatchSchema)
|
|
11302
|
+
});
|
|
11303
|
+
tasksFrontierParamsSchema = z11.object({
|
|
11304
|
+
rootId: z11.string().min(1),
|
|
11305
|
+
role: z11.string().min(1).optional()
|
|
11306
|
+
});
|
|
11307
|
+
tasksFrontierResultSchema = z11.object({
|
|
11308
|
+
rootId: z11.string().min(1),
|
|
11309
|
+
role: z11.string().min(1).optional(),
|
|
11310
|
+
groups: z11.object({
|
|
11311
|
+
ready: z11.array(workGraphReadyFrontierTaskSchema),
|
|
11312
|
+
blocked: z11.array(workGraphReadyFrontierTaskSchema),
|
|
11313
|
+
blockedBy: z11.array(
|
|
11314
|
+
z11.discriminatedUnion("kind", [
|
|
11315
|
+
z11.object({
|
|
11316
|
+
kind: z11.literal("dependency"),
|
|
11317
|
+
blockerId: z11.string().min(1),
|
|
11318
|
+
blocks: z11.array(z11.string().min(1))
|
|
11277
11319
|
}),
|
|
11278
|
-
|
|
11279
|
-
kind:
|
|
11320
|
+
z11.object({
|
|
11321
|
+
kind: z11.literal("gate"),
|
|
11280
11322
|
gate: verificationGateSchema,
|
|
11281
|
-
blocks:
|
|
11323
|
+
blocks: z11.array(z11.string().min(1))
|
|
11282
11324
|
})
|
|
11283
11325
|
])
|
|
11284
11326
|
)
|
|
11285
11327
|
})
|
|
11286
11328
|
});
|
|
11287
11329
|
tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
11288
|
-
rootId:
|
|
11289
|
-
maxDepth:
|
|
11290
|
-
includeRelations:
|
|
11291
|
-
});
|
|
11292
|
-
tasksWorkGraphAuditResultSchema =
|
|
11293
|
-
rootId:
|
|
11294
|
-
hierarchy:
|
|
11295
|
-
valid:
|
|
11296
|
-
violations:
|
|
11297
|
-
|
|
11298
|
-
code:
|
|
11299
|
-
taskId:
|
|
11330
|
+
rootId: z11.string().min(1),
|
|
11331
|
+
maxDepth: z11.number().int().nonnegative().optional(),
|
|
11332
|
+
includeRelations: z11.boolean().optional()
|
|
11333
|
+
});
|
|
11334
|
+
tasksWorkGraphAuditResultSchema = z11.object({
|
|
11335
|
+
rootId: z11.string().min(1),
|
|
11336
|
+
hierarchy: z11.object({
|
|
11337
|
+
valid: z11.boolean(),
|
|
11338
|
+
violations: z11.array(
|
|
11339
|
+
z11.object({
|
|
11340
|
+
code: z11.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
11341
|
+
taskId: z11.string().min(1),
|
|
11300
11342
|
taskType: taskTypeSchema,
|
|
11301
|
-
parentId:
|
|
11343
|
+
parentId: z11.string().min(1).nullable(),
|
|
11302
11344
|
parentType: taskTypeSchema.optional(),
|
|
11303
|
-
message:
|
|
11345
|
+
message: z11.string().min(1)
|
|
11304
11346
|
})
|
|
11305
11347
|
)
|
|
11306
11348
|
}),
|
|
11307
11349
|
traversal: tasksTraverseResultSchema,
|
|
11308
11350
|
frontier: tasksFrontierResultSchema,
|
|
11309
11351
|
rollup: tasksRollupResultSchema,
|
|
11310
|
-
relationEdges:
|
|
11311
|
-
rootId:
|
|
11352
|
+
relationEdges: z11.object({
|
|
11353
|
+
rootId: z11.string().min(1),
|
|
11312
11354
|
direction: workGraphEdgeDirectionSchema,
|
|
11313
|
-
edges:
|
|
11314
|
-
|
|
11355
|
+
edges: z11.array(
|
|
11356
|
+
z11.discriminatedUnion("source", [
|
|
11315
11357
|
workGraphRelationEdgeSchema,
|
|
11316
11358
|
workGraphDependencyEdgeSchema
|
|
11317
11359
|
])
|
|
@@ -11666,31 +11708,31 @@ var init_peer = __esm({
|
|
|
11666
11708
|
});
|
|
11667
11709
|
|
|
11668
11710
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
11669
|
-
import { z as
|
|
11711
|
+
import { z as z12 } from "zod";
|
|
11670
11712
|
var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
|
|
11671
11713
|
var init_evidence_atoms = __esm({
|
|
11672
11714
|
"packages/contracts/src/release/evidence-atoms.ts"() {
|
|
11673
11715
|
"use strict";
|
|
11674
|
-
parsedPrEvidenceAtomSchema =
|
|
11675
|
-
kind:
|
|
11676
|
-
prNumber:
|
|
11677
|
-
});
|
|
11678
|
-
prEvidenceStateModifierSchema =
|
|
11679
|
-
kind:
|
|
11680
|
-
value:
|
|
11681
|
-
});
|
|
11682
|
-
ghPrViewSchema =
|
|
11683
|
-
state:
|
|
11684
|
-
mergedAt:
|
|
11685
|
-
headRefOid:
|
|
11686
|
-
mergeable:
|
|
11687
|
-
statusCheckRollup:
|
|
11688
|
-
|
|
11689
|
-
__typename:
|
|
11690
|
-
name:
|
|
11691
|
-
workflowName:
|
|
11692
|
-
conclusion:
|
|
11693
|
-
status:
|
|
11716
|
+
parsedPrEvidenceAtomSchema = z12.object({
|
|
11717
|
+
kind: z12.literal("pr"),
|
|
11718
|
+
prNumber: z12.number().int().positive()
|
|
11719
|
+
});
|
|
11720
|
+
prEvidenceStateModifierSchema = z12.object({
|
|
11721
|
+
kind: z12.literal("state"),
|
|
11722
|
+
value: z12.literal("MERGED")
|
|
11723
|
+
});
|
|
11724
|
+
ghPrViewSchema = z12.object({
|
|
11725
|
+
state: z12.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
11726
|
+
mergedAt: z12.string().nullable(),
|
|
11727
|
+
headRefOid: z12.string().optional(),
|
|
11728
|
+
mergeable: z12.string().optional(),
|
|
11729
|
+
statusCheckRollup: z12.array(
|
|
11730
|
+
z12.object({
|
|
11731
|
+
__typename: z12.string().optional(),
|
|
11732
|
+
name: z12.string().optional(),
|
|
11733
|
+
workflowName: z12.string().optional(),
|
|
11734
|
+
conclusion: z12.string().nullable().optional(),
|
|
11735
|
+
status: z12.string().optional()
|
|
11694
11736
|
}).passthrough()
|
|
11695
11737
|
).optional().default([])
|
|
11696
11738
|
}).passthrough();
|
|
@@ -11703,7 +11745,7 @@ var init_evidence_atoms = __esm({
|
|
|
11703
11745
|
});
|
|
11704
11746
|
|
|
11705
11747
|
// packages/contracts/src/release/plan.ts
|
|
11706
|
-
import { z as
|
|
11748
|
+
import { z as z13 } from "zod";
|
|
11707
11749
|
var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
|
|
11708
11750
|
var init_plan = __esm({
|
|
11709
11751
|
"packages/contracts/src/release/plan.ts"() {
|
|
@@ -11746,20 +11788,20 @@ var init_plan = __esm({
|
|
|
11746
11788
|
];
|
|
11747
11789
|
IMPACT = ["major", "minor", "patch"];
|
|
11748
11790
|
RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
|
|
11749
|
-
ReleaseChannelSchema =
|
|
11750
|
-
ReleaseSchemeSchema =
|
|
11751
|
-
ReleaseKindSchema =
|
|
11752
|
-
ReleaseStatusSchema =
|
|
11753
|
-
GateStatusSchema =
|
|
11754
|
-
GateNameSchema =
|
|
11755
|
-
PlatformTupleSchema =
|
|
11756
|
-
PublisherSchema =
|
|
11757
|
-
TaskKindSchema =
|
|
11758
|
-
ImpactSchema =
|
|
11759
|
-
ResolvedSourceSchema =
|
|
11760
|
-
Iso8601 =
|
|
11761
|
-
NonEmptyString =
|
|
11762
|
-
ReleasePlanTaskSchema =
|
|
11791
|
+
ReleaseChannelSchema = z13.enum(RELEASE_CHANNEL);
|
|
11792
|
+
ReleaseSchemeSchema = z13.enum(RELEASE_SCHEME);
|
|
11793
|
+
ReleaseKindSchema = z13.enum(RELEASE_KIND);
|
|
11794
|
+
ReleaseStatusSchema = z13.enum(RELEASE_STATUS);
|
|
11795
|
+
GateStatusSchema = z13.enum(GATE_STATUS);
|
|
11796
|
+
GateNameSchema = z13.enum(GATE_NAME);
|
|
11797
|
+
PlatformTupleSchema = z13.enum(PLATFORM_TUPLE);
|
|
11798
|
+
PublisherSchema = z13.enum(PUBLISHER);
|
|
11799
|
+
TaskKindSchema = z13.enum(TASK_KIND);
|
|
11800
|
+
ImpactSchema = z13.enum(IMPACT);
|
|
11801
|
+
ResolvedSourceSchema = z13.enum(RESOLVED_SOURCE);
|
|
11802
|
+
Iso8601 = z13.iso.datetime({ offset: true });
|
|
11803
|
+
NonEmptyString = z13.string().min(1);
|
|
11804
|
+
ReleasePlanTaskSchema = z13.object({
|
|
11763
11805
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
11764
11806
|
id: NonEmptyString,
|
|
11765
11807
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -11767,20 +11809,20 @@ var init_plan = __esm({
|
|
|
11767
11809
|
/** SemVer impact classification. */
|
|
11768
11810
|
impact: ImpactSchema,
|
|
11769
11811
|
/** Human-readable changelog line for this task. */
|
|
11770
|
-
userFacingSummary:
|
|
11812
|
+
userFacingSummary: z13.string(),
|
|
11771
11813
|
/**
|
|
11772
11814
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
11773
11815
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
11774
11816
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
11775
11817
|
* enforces non-empty via R-301.
|
|
11776
11818
|
*/
|
|
11777
|
-
evidenceAtoms:
|
|
11819
|
+
evidenceAtoms: z13.array(NonEmptyString),
|
|
11778
11820
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
11779
|
-
ivtrPhaseAtPlan:
|
|
11821
|
+
ivtrPhaseAtPlan: z13.string().optional(),
|
|
11780
11822
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
11781
11823
|
epicAncestor: NonEmptyString
|
|
11782
11824
|
});
|
|
11783
|
-
ReleaseGateSchema =
|
|
11825
|
+
ReleaseGateSchema = z13.object({
|
|
11784
11826
|
/** Canonical gate name. */
|
|
11785
11827
|
name: GateNameSchema,
|
|
11786
11828
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -11790,11 +11832,11 @@ var init_plan = __esm({
|
|
|
11790
11832
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
11791
11833
|
lastVerifiedAt: Iso8601,
|
|
11792
11834
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
11793
|
-
resolvedCommand:
|
|
11835
|
+
resolvedCommand: z13.string().optional(),
|
|
11794
11836
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
11795
11837
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
11796
11838
|
});
|
|
11797
|
-
ReleasePlatformMatrixEntrySchema =
|
|
11839
|
+
ReleasePlatformMatrixEntrySchema = z13.object({
|
|
11798
11840
|
/** Target platform tuple. */
|
|
11799
11841
|
platform: PlatformTupleSchema,
|
|
11800
11842
|
/** Distribution backend. */
|
|
@@ -11802,47 +11844,47 @@ var init_plan = __esm({
|
|
|
11802
11844
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
11803
11845
|
package: NonEmptyString,
|
|
11804
11846
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
11805
|
-
smoke:
|
|
11847
|
+
smoke: z13.boolean().default(true).optional()
|
|
11806
11848
|
});
|
|
11807
|
-
ReleasePreflightSummarySchema =
|
|
11849
|
+
ReleasePreflightSummarySchema = z13.object({
|
|
11808
11850
|
/** True if esbuild externals are out of sync with package.json. */
|
|
11809
|
-
esbuildExternalsDrift:
|
|
11851
|
+
esbuildExternalsDrift: z13.boolean(),
|
|
11810
11852
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
11811
|
-
lockfileDrift:
|
|
11853
|
+
lockfileDrift: z13.boolean(),
|
|
11812
11854
|
/** True if all epic children are in terminal lifecycle states. */
|
|
11813
|
-
epicCompletenessClean:
|
|
11855
|
+
epicCompletenessClean: z13.boolean(),
|
|
11814
11856
|
/** True if no task appears in multiple in-flight release plans. */
|
|
11815
|
-
doubleListingClean:
|
|
11857
|
+
doubleListingClean: z13.boolean(),
|
|
11816
11858
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
11817
|
-
preflightWarnings:
|
|
11859
|
+
preflightWarnings: z13.array(z13.string()).default([]).optional()
|
|
11818
11860
|
});
|
|
11819
|
-
ReleasePlanChangelogSchema =
|
|
11861
|
+
ReleasePlanChangelogSchema = z13.object({
|
|
11820
11862
|
/** `kind=feat` tasks. */
|
|
11821
|
-
features:
|
|
11863
|
+
features: z13.array(NonEmptyString).default([]),
|
|
11822
11864
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
11823
|
-
fixes:
|
|
11865
|
+
fixes: z13.array(NonEmptyString).default([]),
|
|
11824
11866
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
11825
|
-
chores:
|
|
11867
|
+
chores: z13.array(NonEmptyString).default([]),
|
|
11826
11868
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
11827
|
-
breaking:
|
|
11869
|
+
breaking: z13.array(NonEmptyString).default([])
|
|
11828
11870
|
});
|
|
11829
|
-
ReleasePlanMetaSchema =
|
|
11871
|
+
ReleasePlanMetaSchema = z13.object({
|
|
11830
11872
|
/** True if this is the project's first ever release. */
|
|
11831
|
-
firstEverRelease:
|
|
11873
|
+
firstEverRelease: z13.boolean().optional(),
|
|
11832
11874
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
11833
|
-
unresolvedTools:
|
|
11875
|
+
unresolvedTools: z13.array(z13.string()).optional(),
|
|
11834
11876
|
/** Project archetype detected at plan time. */
|
|
11835
|
-
archetype:
|
|
11836
|
-
}).catchall(
|
|
11837
|
-
ReleasePlanSchema =
|
|
11877
|
+
archetype: z13.string().optional()
|
|
11878
|
+
}).catchall(z13.unknown());
|
|
11879
|
+
ReleasePlanSchema = z13.object({
|
|
11838
11880
|
/** Schema URL for this plan version. */
|
|
11839
|
-
$schema:
|
|
11881
|
+
$schema: z13.string().optional(),
|
|
11840
11882
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
11841
11883
|
version: NonEmptyString,
|
|
11842
11884
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
11843
11885
|
resolvedVersion: NonEmptyString,
|
|
11844
11886
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
11845
|
-
suffixApplied:
|
|
11887
|
+
suffixApplied: z13.boolean(),
|
|
11846
11888
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
11847
11889
|
scheme: ReleaseSchemeSchema,
|
|
11848
11890
|
/** npm dist-tag channel for this release. */
|
|
@@ -11859,27 +11901,27 @@ var init_plan = __esm({
|
|
|
11859
11901
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
11860
11902
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
11861
11903
|
*/
|
|
11862
|
-
previousVersion:
|
|
11904
|
+
previousVersion: z13.string().nullable(),
|
|
11863
11905
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
11864
|
-
previousTag:
|
|
11906
|
+
previousTag: z13.string().nullable(),
|
|
11865
11907
|
/** ISO-8601 timestamp the previous release was published. */
|
|
11866
11908
|
previousShippedAt: Iso8601.nullable(),
|
|
11867
11909
|
/** Tasks rolled into this release. */
|
|
11868
|
-
tasks:
|
|
11910
|
+
tasks: z13.array(ReleasePlanTaskSchema),
|
|
11869
11911
|
/** Bucketed changelog. */
|
|
11870
11912
|
changelog: ReleasePlanChangelogSchema,
|
|
11871
11913
|
/** Per-gate verification status. */
|
|
11872
|
-
gates:
|
|
11914
|
+
gates: z13.array(ReleaseGateSchema),
|
|
11873
11915
|
/** Platform / publisher matrix. */
|
|
11874
|
-
platformMatrix:
|
|
11916
|
+
platformMatrix: z13.array(ReleasePlatformMatrixEntrySchema),
|
|
11875
11917
|
/** Preflight summary from `cleo release plan`. */
|
|
11876
11918
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
11877
11919
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
11878
|
-
workflowRunUrl:
|
|
11920
|
+
workflowRunUrl: z13.string().nullable(),
|
|
11879
11921
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
11880
|
-
prUrl:
|
|
11922
|
+
prUrl: z13.string().nullable(),
|
|
11881
11923
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
11882
|
-
mergeCommitSha:
|
|
11924
|
+
mergeCommitSha: z13.string().nullable(),
|
|
11883
11925
|
/** Current FSM state per R-302. */
|
|
11884
11926
|
status: ReleaseStatusSchema,
|
|
11885
11927
|
/** Informational / forward-compat metadata. */
|
|
@@ -11935,52 +11977,52 @@ var init_session2 = __esm({
|
|
|
11935
11977
|
});
|
|
11936
11978
|
|
|
11937
11979
|
// packages/contracts/src/session-journal.ts
|
|
11938
|
-
import { z as
|
|
11980
|
+
import { z as z14 } from "zod";
|
|
11939
11981
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
11940
11982
|
var init_session_journal = __esm({
|
|
11941
11983
|
"packages/contracts/src/session-journal.ts"() {
|
|
11942
11984
|
"use strict";
|
|
11943
11985
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
11944
|
-
sessionJournalDoctorSummarySchema =
|
|
11986
|
+
sessionJournalDoctorSummarySchema = z14.object({
|
|
11945
11987
|
/** `true` when zero noise patterns were detected. */
|
|
11946
|
-
isClean:
|
|
11988
|
+
isClean: z14.boolean(),
|
|
11947
11989
|
/** Total number of noise findings across all patterns. */
|
|
11948
|
-
findingsCount:
|
|
11990
|
+
findingsCount: z14.number().int().nonnegative(),
|
|
11949
11991
|
/** Pattern names that were detected (empty when isClean). */
|
|
11950
|
-
patterns:
|
|
11992
|
+
patterns: z14.array(z14.string()),
|
|
11951
11993
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
11952
|
-
totalScanned:
|
|
11994
|
+
totalScanned: z14.number().int().nonnegative()
|
|
11953
11995
|
});
|
|
11954
|
-
sessionJournalDebriefSummarySchema =
|
|
11996
|
+
sessionJournalDebriefSummarySchema = z14.object({
|
|
11955
11997
|
/** First 200 characters of the session end note (if provided). */
|
|
11956
|
-
noteExcerpt:
|
|
11998
|
+
noteExcerpt: z14.string().max(200).optional(),
|
|
11957
11999
|
/** Number of tasks completed during the session. */
|
|
11958
|
-
tasksCompletedCount:
|
|
12000
|
+
tasksCompletedCount: z14.number().int().nonnegative(),
|
|
11959
12001
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
11960
|
-
tasksFocused:
|
|
12002
|
+
tasksFocused: z14.array(z14.string()).max(5).optional()
|
|
11961
12003
|
});
|
|
11962
|
-
sessionJournalEntrySchema =
|
|
12004
|
+
sessionJournalEntrySchema = z14.object({
|
|
11963
12005
|
// Identity
|
|
11964
12006
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
11965
|
-
schemaVersion:
|
|
12007
|
+
schemaVersion: z14.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
11966
12008
|
/** ISO 8601 timestamp when the entry was written. */
|
|
11967
|
-
timestamp:
|
|
12009
|
+
timestamp: z14.string(),
|
|
11968
12010
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
11969
|
-
sessionId:
|
|
12011
|
+
sessionId: z14.string(),
|
|
11970
12012
|
/** Event type that triggered this journal entry. */
|
|
11971
|
-
eventType:
|
|
12013
|
+
eventType: z14.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
11972
12014
|
// Session metadata (set on session_start / session_end)
|
|
11973
12015
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
11974
|
-
agentIdentifier:
|
|
12016
|
+
agentIdentifier: z14.string().optional(),
|
|
11975
12017
|
/** Provider adapter ID active for this session. */
|
|
11976
|
-
providerId:
|
|
12018
|
+
providerId: z14.string().optional(),
|
|
11977
12019
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
11978
|
-
scope:
|
|
12020
|
+
scope: z14.string().optional(),
|
|
11979
12021
|
// Session-end fields
|
|
11980
12022
|
/** Duration of the session in seconds (session_end only). */
|
|
11981
|
-
duration:
|
|
12023
|
+
duration: z14.number().int().nonnegative().optional(),
|
|
11982
12024
|
/** Task IDs (not titles) completed during the session. */
|
|
11983
|
-
tasksCompleted:
|
|
12025
|
+
tasksCompleted: z14.array(z14.string()).optional(),
|
|
11984
12026
|
// Doctor summary (T1262 absorbed)
|
|
11985
12027
|
/** Compact result of `scanBrainNoise` run at session-end. */
|
|
11986
12028
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
@@ -11989,7 +12031,7 @@ var init_session_journal = __esm({
|
|
|
11989
12031
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
11990
12032
|
// Optional hash chain
|
|
11991
12033
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
11992
|
-
prevEntryHash:
|
|
12034
|
+
prevEntryHash: z14.string().optional()
|
|
11993
12035
|
});
|
|
11994
12036
|
}
|
|
11995
12037
|
});
|
|
@@ -12002,52 +12044,52 @@ var init_task = __esm({
|
|
|
12002
12044
|
});
|
|
12003
12045
|
|
|
12004
12046
|
// packages/contracts/src/task-evidence.ts
|
|
12005
|
-
import { z as
|
|
12047
|
+
import { z as z15 } from "zod";
|
|
12006
12048
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
12007
12049
|
var init_task_evidence = __esm({
|
|
12008
12050
|
"packages/contracts/src/task-evidence.ts"() {
|
|
12009
12051
|
"use strict";
|
|
12010
|
-
fileEvidenceSchema =
|
|
12011
|
-
kind:
|
|
12012
|
-
sha256:
|
|
12013
|
-
timestamp:
|
|
12014
|
-
path:
|
|
12015
|
-
mime:
|
|
12016
|
-
description:
|
|
12017
|
-
});
|
|
12018
|
-
logEvidenceSchema =
|
|
12019
|
-
kind:
|
|
12020
|
-
sha256:
|
|
12021
|
-
timestamp:
|
|
12022
|
-
source:
|
|
12023
|
-
description:
|
|
12024
|
-
});
|
|
12025
|
-
screenshotEvidenceSchema =
|
|
12026
|
-
kind:
|
|
12027
|
-
sha256:
|
|
12028
|
-
timestamp:
|
|
12029
|
-
mime:
|
|
12030
|
-
description:
|
|
12031
|
-
});
|
|
12032
|
-
testOutputEvidenceSchema =
|
|
12033
|
-
kind:
|
|
12034
|
-
sha256:
|
|
12035
|
-
timestamp:
|
|
12036
|
-
passed:
|
|
12037
|
-
failed:
|
|
12038
|
-
skipped:
|
|
12039
|
-
exitCode:
|
|
12040
|
-
description:
|
|
12041
|
-
});
|
|
12042
|
-
commandOutputEvidenceSchema =
|
|
12043
|
-
kind:
|
|
12044
|
-
sha256:
|
|
12045
|
-
timestamp:
|
|
12046
|
-
cmd:
|
|
12047
|
-
exitCode:
|
|
12048
|
-
description:
|
|
12049
|
-
});
|
|
12050
|
-
taskEvidenceSchema =
|
|
12052
|
+
fileEvidenceSchema = z15.object({
|
|
12053
|
+
kind: z15.literal("file"),
|
|
12054
|
+
sha256: z15.string().length(64),
|
|
12055
|
+
timestamp: z15.string().datetime(),
|
|
12056
|
+
path: z15.string().min(1),
|
|
12057
|
+
mime: z15.string().optional(),
|
|
12058
|
+
description: z15.string().optional()
|
|
12059
|
+
});
|
|
12060
|
+
logEvidenceSchema = z15.object({
|
|
12061
|
+
kind: z15.literal("log"),
|
|
12062
|
+
sha256: z15.string().length(64),
|
|
12063
|
+
timestamp: z15.string().datetime(),
|
|
12064
|
+
source: z15.string().min(1),
|
|
12065
|
+
description: z15.string().optional()
|
|
12066
|
+
});
|
|
12067
|
+
screenshotEvidenceSchema = z15.object({
|
|
12068
|
+
kind: z15.literal("screenshot"),
|
|
12069
|
+
sha256: z15.string().length(64),
|
|
12070
|
+
timestamp: z15.string().datetime(),
|
|
12071
|
+
mime: z15.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
12072
|
+
description: z15.string().optional()
|
|
12073
|
+
});
|
|
12074
|
+
testOutputEvidenceSchema = z15.object({
|
|
12075
|
+
kind: z15.literal("test-output"),
|
|
12076
|
+
sha256: z15.string().length(64),
|
|
12077
|
+
timestamp: z15.string().datetime(),
|
|
12078
|
+
passed: z15.number().int().nonnegative(),
|
|
12079
|
+
failed: z15.number().int().nonnegative(),
|
|
12080
|
+
skipped: z15.number().int().nonnegative(),
|
|
12081
|
+
exitCode: z15.number().int(),
|
|
12082
|
+
description: z15.string().optional()
|
|
12083
|
+
});
|
|
12084
|
+
commandOutputEvidenceSchema = z15.object({
|
|
12085
|
+
kind: z15.literal("command-output"),
|
|
12086
|
+
sha256: z15.string().length(64),
|
|
12087
|
+
timestamp: z15.string().datetime(),
|
|
12088
|
+
cmd: z15.string().min(1),
|
|
12089
|
+
exitCode: z15.number().int(),
|
|
12090
|
+
description: z15.string().optional()
|
|
12091
|
+
});
|
|
12092
|
+
taskEvidenceSchema = z15.discriminatedUnion("kind", [
|
|
12051
12093
|
fileEvidenceSchema,
|
|
12052
12094
|
logEvidenceSchema,
|
|
12053
12095
|
screenshotEvidenceSchema,
|
|
@@ -12058,12 +12100,12 @@ var init_task_evidence = __esm({
|
|
|
12058
12100
|
});
|
|
12059
12101
|
|
|
12060
12102
|
// packages/contracts/src/tasks/archive.ts
|
|
12061
|
-
import { z as
|
|
12103
|
+
import { z as z16 } from "zod";
|
|
12062
12104
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
12063
12105
|
var init_archive = __esm({
|
|
12064
12106
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
12065
12107
|
"use strict";
|
|
12066
|
-
ArchiveReason =
|
|
12108
|
+
ArchiveReason = z16.enum([
|
|
12067
12109
|
"verified",
|
|
12068
12110
|
"reconciled",
|
|
12069
12111
|
"superseded",
|
|
@@ -12076,47 +12118,47 @@ var init_archive = __esm({
|
|
|
12076
12118
|
});
|
|
12077
12119
|
|
|
12078
12120
|
// packages/contracts/src/tasks.ts
|
|
12079
|
-
import { z as
|
|
12121
|
+
import { z as z17 } from "zod";
|
|
12080
12122
|
var taskMutationWarningSeveritySchema, taskMutationWarningSchema, taskMutationDryRunSummarySchema, taskMutationTaskRecordSchema, taskMutationEnvelopeSchema, completionTaskStatusSchema, completionCriterionKindSchema, completionCriterionStatusSchema, completionBlockerReasonSchema, completionStaleReasonSchema, completionProjectionRepairErrorCodeSchema, completionCriterionWaiverSchema, completionCriterionReplacementSchema, completionCriterionEvaluationSchema, unsatisfiedCompletionCriterionSchema, completionTotalsSchema, completionContextPackSchema, completionEvaluationSchema, completionExplanationSchema, completionListParamsSchema, completionListResultSchema, completionEvaluateParamsSchema, completionProjectionRepairErrorSchema, completionProjectionRepairParamsSchema, completionProjectionRepairResultSchema;
|
|
12081
12123
|
var init_tasks2 = __esm({
|
|
12082
12124
|
"packages/contracts/src/tasks.ts"() {
|
|
12083
12125
|
"use strict";
|
|
12084
12126
|
init_status_registry();
|
|
12085
|
-
taskMutationWarningSeveritySchema =
|
|
12086
|
-
taskMutationWarningSchema =
|
|
12087
|
-
code:
|
|
12088
|
-
message:
|
|
12127
|
+
taskMutationWarningSeveritySchema = z17.enum(["info", "warning"]);
|
|
12128
|
+
taskMutationWarningSchema = z17.object({
|
|
12129
|
+
code: z17.string().min(1),
|
|
12130
|
+
message: z17.string().min(1),
|
|
12089
12131
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
12090
|
-
taskId:
|
|
12091
|
-
field:
|
|
12092
|
-
index:
|
|
12093
|
-
});
|
|
12094
|
-
taskMutationDryRunSummarySchema =
|
|
12095
|
-
dryRun:
|
|
12096
|
-
wouldCreate:
|
|
12097
|
-
wouldUpdate:
|
|
12098
|
-
wouldDelete:
|
|
12099
|
-
wouldAffect:
|
|
12100
|
-
validatedCount:
|
|
12101
|
-
insertedCount:
|
|
12102
|
-
updatedCount:
|
|
12103
|
-
deletedCount:
|
|
12104
|
-
warnings:
|
|
12105
|
-
});
|
|
12106
|
-
taskMutationTaskRecordSchema =
|
|
12107
|
-
taskMutationEnvelopeSchema =
|
|
12108
|
-
dryRun:
|
|
12109
|
-
created:
|
|
12110
|
-
updated:
|
|
12111
|
-
deleted:
|
|
12112
|
-
affectedCount:
|
|
12113
|
-
mutationWarnings:
|
|
12132
|
+
taskId: z17.string().min(1).optional(),
|
|
12133
|
+
field: z17.string().min(1).optional(),
|
|
12134
|
+
index: z17.number().int().nonnegative().optional()
|
|
12135
|
+
});
|
|
12136
|
+
taskMutationDryRunSummarySchema = z17.object({
|
|
12137
|
+
dryRun: z17.literal(true),
|
|
12138
|
+
wouldCreate: z17.number().int().nonnegative(),
|
|
12139
|
+
wouldUpdate: z17.number().int().nonnegative(),
|
|
12140
|
+
wouldDelete: z17.number().int().nonnegative(),
|
|
12141
|
+
wouldAffect: z17.number().int().nonnegative(),
|
|
12142
|
+
validatedCount: z17.number().int().nonnegative(),
|
|
12143
|
+
insertedCount: z17.literal(0),
|
|
12144
|
+
updatedCount: z17.literal(0),
|
|
12145
|
+
deletedCount: z17.literal(0),
|
|
12146
|
+
warnings: z17.array(taskMutationWarningSchema)
|
|
12147
|
+
});
|
|
12148
|
+
taskMutationTaskRecordSchema = z17.object({ id: z17.string().min(1) }).passthrough();
|
|
12149
|
+
taskMutationEnvelopeSchema = z17.object({
|
|
12150
|
+
dryRun: z17.boolean().optional(),
|
|
12151
|
+
created: z17.array(taskMutationTaskRecordSchema),
|
|
12152
|
+
updated: z17.array(taskMutationTaskRecordSchema),
|
|
12153
|
+
deleted: z17.array(taskMutationTaskRecordSchema),
|
|
12154
|
+
affectedCount: z17.number().int().nonnegative(),
|
|
12155
|
+
mutationWarnings: z17.array(taskMutationWarningSchema),
|
|
12114
12156
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
12115
12157
|
});
|
|
12116
|
-
completionTaskStatusSchema =
|
|
12117
|
-
completionCriterionKindSchema =
|
|
12118
|
-
completionCriterionStatusSchema =
|
|
12119
|
-
completionBlockerReasonSchema =
|
|
12158
|
+
completionTaskStatusSchema = z17.enum(TASK_STATUSES);
|
|
12159
|
+
completionCriterionKindSchema = z17.enum(["text", "evidence_bound", "child_task"]);
|
|
12160
|
+
completionCriterionStatusSchema = z17.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
12161
|
+
completionBlockerReasonSchema = z17.enum([
|
|
12120
12162
|
"missing_evidence_binding",
|
|
12121
12163
|
"child_not_done",
|
|
12122
12164
|
"child_cancelled_requires_waiver",
|
|
@@ -12124,68 +12166,68 @@ var init_tasks2 = __esm({
|
|
|
12124
12166
|
"child_missing",
|
|
12125
12167
|
"done_parent_stale"
|
|
12126
12168
|
]);
|
|
12127
|
-
completionStaleReasonSchema =
|
|
12128
|
-
completionProjectionRepairErrorCodeSchema =
|
|
12169
|
+
completionStaleReasonSchema = z17.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
12170
|
+
completionProjectionRepairErrorCodeSchema = z17.enum([
|
|
12129
12171
|
"projection_not_stale",
|
|
12130
12172
|
"criteria_missing",
|
|
12131
12173
|
"binding_target_missing",
|
|
12132
12174
|
"repair_conflict"
|
|
12133
12175
|
]);
|
|
12134
|
-
completionCriterionWaiverSchema =
|
|
12135
|
-
criterionAcId:
|
|
12136
|
-
childTaskId:
|
|
12137
|
-
reason:
|
|
12138
|
-
actor:
|
|
12139
|
-
waivedAt:
|
|
12140
|
-
});
|
|
12141
|
-
completionCriterionReplacementSchema =
|
|
12142
|
-
criterionAcId:
|
|
12143
|
-
originalChildTaskId:
|
|
12144
|
-
replacementChildTaskId:
|
|
12145
|
-
reason:
|
|
12146
|
-
actor:
|
|
12147
|
-
replacedAt:
|
|
12148
|
-
});
|
|
12149
|
-
completionCriterionEvaluationSchema =
|
|
12150
|
-
acId:
|
|
12151
|
-
alias:
|
|
12152
|
-
text:
|
|
12176
|
+
completionCriterionWaiverSchema = z17.object({
|
|
12177
|
+
criterionAcId: z17.string().min(1),
|
|
12178
|
+
childTaskId: z17.string().min(1),
|
|
12179
|
+
reason: z17.string().min(1),
|
|
12180
|
+
actor: z17.string().min(1),
|
|
12181
|
+
waivedAt: z17.string().min(1)
|
|
12182
|
+
});
|
|
12183
|
+
completionCriterionReplacementSchema = z17.object({
|
|
12184
|
+
criterionAcId: z17.string().min(1),
|
|
12185
|
+
originalChildTaskId: z17.string().min(1),
|
|
12186
|
+
replacementChildTaskId: z17.string().min(1),
|
|
12187
|
+
reason: z17.string().min(1),
|
|
12188
|
+
actor: z17.string().min(1),
|
|
12189
|
+
replacedAt: z17.string().min(1)
|
|
12190
|
+
});
|
|
12191
|
+
completionCriterionEvaluationSchema = z17.object({
|
|
12192
|
+
acId: z17.string().min(1),
|
|
12193
|
+
alias: z17.string().min(1),
|
|
12194
|
+
text: z17.string(),
|
|
12153
12195
|
kind: completionCriterionKindSchema,
|
|
12154
12196
|
status: completionCriterionStatusSchema,
|
|
12155
12197
|
reason: completionBlockerReasonSchema.optional(),
|
|
12156
|
-
targetTaskId:
|
|
12198
|
+
targetTaskId: z17.string().min(1).optional(),
|
|
12157
12199
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
12158
12200
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
12159
12201
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
12160
12202
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
12161
|
-
evidenceBindings:
|
|
12203
|
+
evidenceBindings: z17.number().int().nonnegative()
|
|
12162
12204
|
});
|
|
12163
12205
|
unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
12164
|
-
status:
|
|
12206
|
+
status: z17.literal("unsatisfied"),
|
|
12165
12207
|
reason: completionBlockerReasonSchema
|
|
12166
12208
|
});
|
|
12167
|
-
completionTotalsSchema =
|
|
12168
|
-
criteria:
|
|
12169
|
-
satisfied:
|
|
12170
|
-
unsatisfied:
|
|
12171
|
-
waived:
|
|
12172
|
-
replaced:
|
|
12173
|
-
});
|
|
12174
|
-
completionContextPackSchema =
|
|
12175
|
-
taskId:
|
|
12176
|
-
generatedAt:
|
|
12177
|
-
source:
|
|
12178
|
-
window:
|
|
12179
|
-
limit:
|
|
12180
|
-
since:
|
|
12181
|
-
relationDepth:
|
|
12182
|
-
relatedTaskIds:
|
|
12209
|
+
completionTotalsSchema = z17.object({
|
|
12210
|
+
criteria: z17.number().int().nonnegative(),
|
|
12211
|
+
satisfied: z17.number().int().nonnegative(),
|
|
12212
|
+
unsatisfied: z17.number().int().nonnegative(),
|
|
12213
|
+
waived: z17.number().int().nonnegative(),
|
|
12214
|
+
replaced: z17.number().int().nonnegative()
|
|
12215
|
+
});
|
|
12216
|
+
completionContextPackSchema = z17.object({
|
|
12217
|
+
taskId: z17.string().min(1),
|
|
12218
|
+
generatedAt: z17.string().min(1),
|
|
12219
|
+
source: z17.literal("audit_log"),
|
|
12220
|
+
window: z17.object({
|
|
12221
|
+
limit: z17.number().int().positive(),
|
|
12222
|
+
since: z17.string().min(1).optional(),
|
|
12223
|
+
relationDepth: z17.number().int().nonnegative(),
|
|
12224
|
+
relatedTaskIds: z17.array(z17.string().min(1))
|
|
12183
12225
|
}),
|
|
12184
|
-
events:
|
|
12185
|
-
|
|
12186
|
-
id:
|
|
12187
|
-
timestamp:
|
|
12188
|
-
action:
|
|
12226
|
+
events: z17.array(
|
|
12227
|
+
z17.object({
|
|
12228
|
+
id: z17.string().min(1),
|
|
12229
|
+
timestamp: z17.string().min(1),
|
|
12230
|
+
action: z17.enum([
|
|
12189
12231
|
"task_completed",
|
|
12190
12232
|
"task_reopened",
|
|
12191
12233
|
"task_cancelled",
|
|
@@ -12193,77 +12235,77 @@ var init_tasks2 = __esm({
|
|
|
12193
12235
|
"task_reparented",
|
|
12194
12236
|
"ac_projection_rebuilt"
|
|
12195
12237
|
]),
|
|
12196
|
-
taskId:
|
|
12197
|
-
relation:
|
|
12198
|
-
actor:
|
|
12199
|
-
details:
|
|
12200
|
-
before:
|
|
12201
|
-
after:
|
|
12238
|
+
taskId: z17.string().min(1),
|
|
12239
|
+
relation: z17.enum(["self", "parent", "child", "sibling", "related"]),
|
|
12240
|
+
actor: z17.string().min(1),
|
|
12241
|
+
details: z17.record(z17.string(), z17.unknown()).optional(),
|
|
12242
|
+
before: z17.record(z17.string(), z17.unknown()).optional(),
|
|
12243
|
+
after: z17.record(z17.string(), z17.unknown()).optional()
|
|
12202
12244
|
})
|
|
12203
12245
|
),
|
|
12204
|
-
summary:
|
|
12205
|
-
totalEvents:
|
|
12206
|
-
byAction:
|
|
12207
|
-
byRelation:
|
|
12208
|
-
latestEventAt:
|
|
12246
|
+
summary: z17.object({
|
|
12247
|
+
totalEvents: z17.number().int().nonnegative(),
|
|
12248
|
+
byAction: z17.record(z17.string(), z17.number().int().nonnegative()),
|
|
12249
|
+
byRelation: z17.record(z17.string(), z17.number().int().nonnegative()),
|
|
12250
|
+
latestEventAt: z17.string().nullable()
|
|
12209
12251
|
})
|
|
12210
12252
|
});
|
|
12211
|
-
completionEvaluationSchema =
|
|
12212
|
-
taskId:
|
|
12253
|
+
completionEvaluationSchema = z17.object({
|
|
12254
|
+
taskId: z17.string().min(1),
|
|
12213
12255
|
taskStatus: completionTaskStatusSchema,
|
|
12214
|
-
ready:
|
|
12215
|
-
stale:
|
|
12216
|
-
staleReasons:
|
|
12256
|
+
ready: z17.boolean(),
|
|
12257
|
+
stale: z17.boolean(),
|
|
12258
|
+
staleReasons: z17.array(completionStaleReasonSchema),
|
|
12217
12259
|
contextPack: completionContextPackSchema.optional(),
|
|
12218
|
-
satisfied:
|
|
12219
|
-
unsatisfied:
|
|
12220
|
-
waived:
|
|
12221
|
-
replaced:
|
|
12260
|
+
satisfied: z17.array(completionCriterionEvaluationSchema),
|
|
12261
|
+
unsatisfied: z17.array(unsatisfiedCompletionCriterionSchema),
|
|
12262
|
+
waived: z17.array(completionCriterionEvaluationSchema),
|
|
12263
|
+
replaced: z17.array(completionCriterionEvaluationSchema),
|
|
12222
12264
|
totals: completionTotalsSchema
|
|
12223
12265
|
});
|
|
12224
|
-
completionExplanationSchema =
|
|
12225
|
-
taskId:
|
|
12226
|
-
ready:
|
|
12227
|
-
stale:
|
|
12228
|
-
summary:
|
|
12266
|
+
completionExplanationSchema = z17.object({
|
|
12267
|
+
taskId: z17.string().min(1),
|
|
12268
|
+
ready: z17.boolean(),
|
|
12269
|
+
stale: z17.boolean(),
|
|
12270
|
+
summary: z17.string(),
|
|
12229
12271
|
contextPack: completionContextPackSchema.optional(),
|
|
12230
|
-
blockers:
|
|
12272
|
+
blockers: z17.array(completionCriterionEvaluationSchema)
|
|
12231
12273
|
});
|
|
12232
|
-
completionListParamsSchema =
|
|
12233
|
-
taskId:
|
|
12274
|
+
completionListParamsSchema = z17.object({
|
|
12275
|
+
taskId: z17.string().min(1),
|
|
12234
12276
|
status: completionCriterionStatusSchema.optional(),
|
|
12235
12277
|
kind: completionCriterionKindSchema.optional()
|
|
12236
12278
|
});
|
|
12237
|
-
completionListResultSchema =
|
|
12238
|
-
taskId:
|
|
12239
|
-
criteria:
|
|
12279
|
+
completionListResultSchema = z17.object({
|
|
12280
|
+
taskId: z17.string().min(1),
|
|
12281
|
+
criteria: z17.array(completionCriterionEvaluationSchema),
|
|
12240
12282
|
totals: completionTotalsSchema
|
|
12241
12283
|
});
|
|
12242
|
-
completionEvaluateParamsSchema =
|
|
12243
|
-
taskId:
|
|
12244
|
-
includeContext:
|
|
12245
|
-
limit:
|
|
12246
|
-
since:
|
|
12247
|
-
relationDepth:
|
|
12284
|
+
completionEvaluateParamsSchema = z17.object({
|
|
12285
|
+
taskId: z17.string().min(1),
|
|
12286
|
+
includeContext: z17.boolean().optional(),
|
|
12287
|
+
limit: z17.number().int().positive().optional(),
|
|
12288
|
+
since: z17.string().min(1).optional(),
|
|
12289
|
+
relationDepth: z17.number().int().nonnegative().optional()
|
|
12248
12290
|
});
|
|
12249
|
-
completionProjectionRepairErrorSchema =
|
|
12291
|
+
completionProjectionRepairErrorSchema = z17.object({
|
|
12250
12292
|
code: completionProjectionRepairErrorCodeSchema,
|
|
12251
|
-
message:
|
|
12252
|
-
taskId:
|
|
12253
|
-
acId:
|
|
12254
|
-
evidenceAtomId:
|
|
12293
|
+
message: z17.string().min(1),
|
|
12294
|
+
taskId: z17.string().min(1),
|
|
12295
|
+
acId: z17.string().min(1).optional(),
|
|
12296
|
+
evidenceAtomId: z17.string().min(1).optional()
|
|
12255
12297
|
});
|
|
12256
|
-
completionProjectionRepairParamsSchema =
|
|
12257
|
-
taskId:
|
|
12258
|
-
dryRun:
|
|
12298
|
+
completionProjectionRepairParamsSchema = z17.object({
|
|
12299
|
+
taskId: z17.string().min(1),
|
|
12300
|
+
dryRun: z17.boolean().optional()
|
|
12259
12301
|
});
|
|
12260
|
-
completionProjectionRepairResultSchema =
|
|
12261
|
-
taskId:
|
|
12262
|
-
repaired:
|
|
12263
|
-
dryRun:
|
|
12264
|
-
staleBefore:
|
|
12265
|
-
staleAfter:
|
|
12266
|
-
errors:
|
|
12302
|
+
completionProjectionRepairResultSchema = z17.object({
|
|
12303
|
+
taskId: z17.string().min(1),
|
|
12304
|
+
repaired: z17.boolean(),
|
|
12305
|
+
dryRun: z17.boolean(),
|
|
12306
|
+
staleBefore: z17.boolean(),
|
|
12307
|
+
staleAfter: z17.boolean(),
|
|
12308
|
+
errors: z17.array(completionProjectionRepairErrorSchema)
|
|
12267
12309
|
});
|
|
12268
12310
|
}
|
|
12269
12311
|
});
|
|
@@ -12774,7 +12816,7 @@ var init_taxonomy = __esm({
|
|
|
12774
12816
|
});
|
|
12775
12817
|
|
|
12776
12818
|
// packages/contracts/src/templates/manifest.ts
|
|
12777
|
-
import { z as
|
|
12819
|
+
import { z as z18 } from "zod";
|
|
12778
12820
|
var TEMPLATE_KINDS, TEMPLATE_SUBSTITUTIONS, TEMPLATE_UPDATE_STRATEGIES, PLACEHOLDER_SOURCES, PlaceholderSpecSchema, TemplateManifestEntrySchema;
|
|
12779
12821
|
var init_manifest2 = __esm({
|
|
12780
12822
|
"packages/contracts/src/templates/manifest.ts"() {
|
|
@@ -12795,85 +12837,85 @@ var init_manifest2 = __esm({
|
|
|
12795
12837
|
"tool-resolver",
|
|
12796
12838
|
"literal"
|
|
12797
12839
|
];
|
|
12798
|
-
PlaceholderSpecSchema =
|
|
12840
|
+
PlaceholderSpecSchema = z18.object({
|
|
12799
12841
|
/**
|
|
12800
12842
|
* Placeholder identifier as it appears in the template body
|
|
12801
12843
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
12802
12844
|
*/
|
|
12803
|
-
name:
|
|
12845
|
+
name: z18.string().min(1, "placeholder name must be non-empty"),
|
|
12804
12846
|
/** Resolver source the installer consults for this placeholder. */
|
|
12805
|
-
source:
|
|
12847
|
+
source: z18.enum(PLACEHOLDER_SOURCES),
|
|
12806
12848
|
/**
|
|
12807
12849
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
12808
12850
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
12809
12851
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
12810
12852
|
*/
|
|
12811
|
-
sourcePath:
|
|
12853
|
+
sourcePath: z18.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
12812
12854
|
/**
|
|
12813
12855
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
12814
12856
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
12815
12857
|
*/
|
|
12816
|
-
defaultValue:
|
|
12858
|
+
defaultValue: z18.union([z18.string(), z18.number(), z18.boolean(), z18.null()]).optional()
|
|
12817
12859
|
});
|
|
12818
|
-
TemplateManifestEntrySchema =
|
|
12860
|
+
TemplateManifestEntrySchema = z18.object({
|
|
12819
12861
|
/** Stable identifier for this template entry. */
|
|
12820
|
-
id:
|
|
12862
|
+
id: z18.string().min(1, "id must be non-empty"),
|
|
12821
12863
|
/** Category of file this template represents. */
|
|
12822
|
-
kind:
|
|
12864
|
+
kind: z18.enum(TEMPLATE_KINDS),
|
|
12823
12865
|
/** Repo-relative path of the template source file. */
|
|
12824
|
-
sourcePath:
|
|
12866
|
+
sourcePath: z18.string().min(1, "sourcePath must be non-empty"),
|
|
12825
12867
|
/** Project-relative path where the rendered template installs. */
|
|
12826
|
-
installPath:
|
|
12868
|
+
installPath: z18.string().min(1, "installPath must be non-empty"),
|
|
12827
12869
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
12828
|
-
substitution:
|
|
12870
|
+
substitution: z18.enum(TEMPLATE_SUBSTITUTIONS),
|
|
12829
12871
|
/** Declared placeholders this template requires. May be empty. */
|
|
12830
|
-
placeholders:
|
|
12872
|
+
placeholders: z18.array(PlaceholderSpecSchema),
|
|
12831
12873
|
/** Reconciliation policy on upgrade. */
|
|
12832
|
-
updateStrategy:
|
|
12874
|
+
updateStrategy: z18.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
12833
12875
|
});
|
|
12834
12876
|
}
|
|
12835
12877
|
});
|
|
12836
12878
|
|
|
12837
12879
|
// packages/contracts/src/validator/index.ts
|
|
12838
|
-
import { z as
|
|
12880
|
+
import { z as z19 } from "zod";
|
|
12839
12881
|
var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
|
|
12840
12882
|
var init_validator = __esm({
|
|
12841
12883
|
"packages/contracts/src/validator/index.ts"() {
|
|
12842
12884
|
"use strict";
|
|
12843
12885
|
VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
12844
|
-
validatorFindingSchema =
|
|
12845
|
-
acId:
|
|
12846
|
-
status:
|
|
12847
|
-
reasoning:
|
|
12848
|
-
evidenceRefs:
|
|
12849
|
-
checkedAt:
|
|
12850
|
-
});
|
|
12851
|
-
validatorAttestationSchema =
|
|
12852
|
-
verdict:
|
|
12853
|
-
taskId:
|
|
12854
|
-
validatorId:
|
|
12855
|
-
findings:
|
|
12886
|
+
validatorFindingSchema = z19.object({
|
|
12887
|
+
acId: z19.string().min(1, "acId must be non-empty"),
|
|
12888
|
+
status: z19.enum(["pass", "fail", "inconclusive"]),
|
|
12889
|
+
reasoning: z19.string().min(1, "reasoning must be non-empty"),
|
|
12890
|
+
evidenceRefs: z19.array(z19.string()).optional(),
|
|
12891
|
+
checkedAt: z19.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
12892
|
+
});
|
|
12893
|
+
validatorAttestationSchema = z19.object({
|
|
12894
|
+
verdict: z19.literal("attest"),
|
|
12895
|
+
taskId: z19.string().min(1),
|
|
12896
|
+
validatorId: z19.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
12897
|
+
findings: z19.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
12856
12898
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
12857
12899
|
'attestation requires every finding to have status="pass"'
|
|
12858
12900
|
),
|
|
12859
|
-
summary:
|
|
12860
|
-
attestedAt:
|
|
12861
|
-
schemaVersion:
|
|
12862
|
-
});
|
|
12863
|
-
validatorRejectionSchema =
|
|
12864
|
-
verdict:
|
|
12865
|
-
taskId:
|
|
12866
|
-
validatorId:
|
|
12867
|
-
findings:
|
|
12901
|
+
summary: z19.string().optional(),
|
|
12902
|
+
attestedAt: z19.string().min(1),
|
|
12903
|
+
schemaVersion: z19.literal("1")
|
|
12904
|
+
});
|
|
12905
|
+
validatorRejectionSchema = z19.object({
|
|
12906
|
+
verdict: z19.literal("reject"),
|
|
12907
|
+
taskId: z19.string().min(1),
|
|
12908
|
+
validatorId: z19.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
12909
|
+
findings: z19.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
12868
12910
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
12869
12911
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
12870
12912
|
),
|
|
12871
|
-
summary:
|
|
12872
|
-
remediationHints:
|
|
12873
|
-
rejectedAt:
|
|
12874
|
-
schemaVersion:
|
|
12913
|
+
summary: z19.string().min(1, "rejection summary must be non-empty"),
|
|
12914
|
+
remediationHints: z19.array(z19.string()).optional(),
|
|
12915
|
+
rejectedAt: z19.string().min(1),
|
|
12916
|
+
schemaVersion: z19.literal("1")
|
|
12875
12917
|
});
|
|
12876
|
-
validatorVerdictSchema =
|
|
12918
|
+
validatorVerdictSchema = z19.discriminatedUnion("verdict", [
|
|
12877
12919
|
validatorAttestationSchema,
|
|
12878
12920
|
validatorRejectionSchema
|
|
12879
12921
|
]);
|
|
@@ -12897,6 +12939,7 @@ var init_src = __esm({
|
|
|
12897
12939
|
init_identity();
|
|
12898
12940
|
init_operations_registry();
|
|
12899
12941
|
init_provenance();
|
|
12942
|
+
init_read();
|
|
12900
12943
|
init_docs_taxonomy();
|
|
12901
12944
|
init_engine_result();
|
|
12902
12945
|
init_enums();
|
|
@@ -26956,7 +26999,7 @@ function resolveRef(ref, ctx) {
|
|
|
26956
26999
|
function convertBaseSchema(schema, ctx) {
|
|
26957
27000
|
if (schema.not !== void 0) {
|
|
26958
27001
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
26959
|
-
return
|
|
27002
|
+
return z20.never();
|
|
26960
27003
|
}
|
|
26961
27004
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
26962
27005
|
}
|
|
@@ -26978,7 +27021,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
26978
27021
|
return ctx.refs.get(refPath);
|
|
26979
27022
|
}
|
|
26980
27023
|
if (ctx.processing.has(refPath)) {
|
|
26981
|
-
return
|
|
27024
|
+
return z20.lazy(() => {
|
|
26982
27025
|
if (!ctx.refs.has(refPath)) {
|
|
26983
27026
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
26984
27027
|
}
|
|
@@ -26995,25 +27038,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
26995
27038
|
if (schema.enum !== void 0) {
|
|
26996
27039
|
const enumValues = schema.enum;
|
|
26997
27040
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
26998
|
-
return
|
|
27041
|
+
return z20.null();
|
|
26999
27042
|
}
|
|
27000
27043
|
if (enumValues.length === 0) {
|
|
27001
|
-
return
|
|
27044
|
+
return z20.never();
|
|
27002
27045
|
}
|
|
27003
27046
|
if (enumValues.length === 1) {
|
|
27004
|
-
return
|
|
27047
|
+
return z20.literal(enumValues[0]);
|
|
27005
27048
|
}
|
|
27006
27049
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
27007
|
-
return
|
|
27050
|
+
return z20.enum(enumValues);
|
|
27008
27051
|
}
|
|
27009
|
-
const literalSchemas = enumValues.map((v) =>
|
|
27052
|
+
const literalSchemas = enumValues.map((v) => z20.literal(v));
|
|
27010
27053
|
if (literalSchemas.length < 2) {
|
|
27011
27054
|
return literalSchemas[0];
|
|
27012
27055
|
}
|
|
27013
|
-
return
|
|
27056
|
+
return z20.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
27014
27057
|
}
|
|
27015
27058
|
if (schema.const !== void 0) {
|
|
27016
|
-
return
|
|
27059
|
+
return z20.literal(schema.const);
|
|
27017
27060
|
}
|
|
27018
27061
|
const type = schema.type;
|
|
27019
27062
|
if (Array.isArray(type)) {
|
|
@@ -27022,68 +27065,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27022
27065
|
return convertBaseSchema(typeSchema, ctx);
|
|
27023
27066
|
});
|
|
27024
27067
|
if (typeSchemas.length === 0) {
|
|
27025
|
-
return
|
|
27068
|
+
return z20.never();
|
|
27026
27069
|
}
|
|
27027
27070
|
if (typeSchemas.length === 1) {
|
|
27028
27071
|
return typeSchemas[0];
|
|
27029
27072
|
}
|
|
27030
|
-
return
|
|
27073
|
+
return z20.union(typeSchemas);
|
|
27031
27074
|
}
|
|
27032
27075
|
if (!type) {
|
|
27033
|
-
return
|
|
27076
|
+
return z20.any();
|
|
27034
27077
|
}
|
|
27035
27078
|
let zodSchema2;
|
|
27036
27079
|
switch (type) {
|
|
27037
27080
|
case "string": {
|
|
27038
|
-
let stringSchema =
|
|
27081
|
+
let stringSchema = z20.string();
|
|
27039
27082
|
if (schema.format) {
|
|
27040
27083
|
const format = schema.format;
|
|
27041
27084
|
if (format === "email") {
|
|
27042
|
-
stringSchema = stringSchema.check(
|
|
27085
|
+
stringSchema = stringSchema.check(z20.email());
|
|
27043
27086
|
} else if (format === "uri" || format === "uri-reference") {
|
|
27044
|
-
stringSchema = stringSchema.check(
|
|
27087
|
+
stringSchema = stringSchema.check(z20.url());
|
|
27045
27088
|
} else if (format === "uuid" || format === "guid") {
|
|
27046
|
-
stringSchema = stringSchema.check(
|
|
27089
|
+
stringSchema = stringSchema.check(z20.uuid());
|
|
27047
27090
|
} else if (format === "date-time") {
|
|
27048
|
-
stringSchema = stringSchema.check(
|
|
27091
|
+
stringSchema = stringSchema.check(z20.iso.datetime());
|
|
27049
27092
|
} else if (format === "date") {
|
|
27050
|
-
stringSchema = stringSchema.check(
|
|
27093
|
+
stringSchema = stringSchema.check(z20.iso.date());
|
|
27051
27094
|
} else if (format === "time") {
|
|
27052
|
-
stringSchema = stringSchema.check(
|
|
27095
|
+
stringSchema = stringSchema.check(z20.iso.time());
|
|
27053
27096
|
} else if (format === "duration") {
|
|
27054
|
-
stringSchema = stringSchema.check(
|
|
27097
|
+
stringSchema = stringSchema.check(z20.iso.duration());
|
|
27055
27098
|
} else if (format === "ipv4") {
|
|
27056
|
-
stringSchema = stringSchema.check(
|
|
27099
|
+
stringSchema = stringSchema.check(z20.ipv4());
|
|
27057
27100
|
} else if (format === "ipv6") {
|
|
27058
|
-
stringSchema = stringSchema.check(
|
|
27101
|
+
stringSchema = stringSchema.check(z20.ipv6());
|
|
27059
27102
|
} else if (format === "mac") {
|
|
27060
|
-
stringSchema = stringSchema.check(
|
|
27103
|
+
stringSchema = stringSchema.check(z20.mac());
|
|
27061
27104
|
} else if (format === "cidr") {
|
|
27062
|
-
stringSchema = stringSchema.check(
|
|
27105
|
+
stringSchema = stringSchema.check(z20.cidrv4());
|
|
27063
27106
|
} else if (format === "cidr-v6") {
|
|
27064
|
-
stringSchema = stringSchema.check(
|
|
27107
|
+
stringSchema = stringSchema.check(z20.cidrv6());
|
|
27065
27108
|
} else if (format === "base64") {
|
|
27066
|
-
stringSchema = stringSchema.check(
|
|
27109
|
+
stringSchema = stringSchema.check(z20.base64());
|
|
27067
27110
|
} else if (format === "base64url") {
|
|
27068
|
-
stringSchema = stringSchema.check(
|
|
27111
|
+
stringSchema = stringSchema.check(z20.base64url());
|
|
27069
27112
|
} else if (format === "e164") {
|
|
27070
|
-
stringSchema = stringSchema.check(
|
|
27113
|
+
stringSchema = stringSchema.check(z20.e164());
|
|
27071
27114
|
} else if (format === "jwt") {
|
|
27072
|
-
stringSchema = stringSchema.check(
|
|
27115
|
+
stringSchema = stringSchema.check(z20.jwt());
|
|
27073
27116
|
} else if (format === "emoji") {
|
|
27074
|
-
stringSchema = stringSchema.check(
|
|
27117
|
+
stringSchema = stringSchema.check(z20.emoji());
|
|
27075
27118
|
} else if (format === "nanoid") {
|
|
27076
|
-
stringSchema = stringSchema.check(
|
|
27119
|
+
stringSchema = stringSchema.check(z20.nanoid());
|
|
27077
27120
|
} else if (format === "cuid") {
|
|
27078
|
-
stringSchema = stringSchema.check(
|
|
27121
|
+
stringSchema = stringSchema.check(z20.cuid());
|
|
27079
27122
|
} else if (format === "cuid2") {
|
|
27080
|
-
stringSchema = stringSchema.check(
|
|
27123
|
+
stringSchema = stringSchema.check(z20.cuid2());
|
|
27081
27124
|
} else if (format === "ulid") {
|
|
27082
|
-
stringSchema = stringSchema.check(
|
|
27125
|
+
stringSchema = stringSchema.check(z20.ulid());
|
|
27083
27126
|
} else if (format === "xid") {
|
|
27084
|
-
stringSchema = stringSchema.check(
|
|
27127
|
+
stringSchema = stringSchema.check(z20.xid());
|
|
27085
27128
|
} else if (format === "ksuid") {
|
|
27086
|
-
stringSchema = stringSchema.check(
|
|
27129
|
+
stringSchema = stringSchema.check(z20.ksuid());
|
|
27087
27130
|
}
|
|
27088
27131
|
}
|
|
27089
27132
|
if (typeof schema.minLength === "number") {
|
|
@@ -27100,7 +27143,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27100
27143
|
}
|
|
27101
27144
|
case "number":
|
|
27102
27145
|
case "integer": {
|
|
27103
|
-
let numberSchema = type === "integer" ?
|
|
27146
|
+
let numberSchema = type === "integer" ? z20.number().int() : z20.number();
|
|
27104
27147
|
if (typeof schema.minimum === "number") {
|
|
27105
27148
|
numberSchema = numberSchema.min(schema.minimum);
|
|
27106
27149
|
}
|
|
@@ -27124,11 +27167,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27124
27167
|
break;
|
|
27125
27168
|
}
|
|
27126
27169
|
case "boolean": {
|
|
27127
|
-
zodSchema2 =
|
|
27170
|
+
zodSchema2 = z20.boolean();
|
|
27128
27171
|
break;
|
|
27129
27172
|
}
|
|
27130
27173
|
case "null": {
|
|
27131
|
-
zodSchema2 =
|
|
27174
|
+
zodSchema2 = z20.null();
|
|
27132
27175
|
break;
|
|
27133
27176
|
}
|
|
27134
27177
|
case "object": {
|
|
@@ -27141,14 +27184,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27141
27184
|
}
|
|
27142
27185
|
if (schema.propertyNames) {
|
|
27143
27186
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
27144
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
27187
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z20.any();
|
|
27145
27188
|
if (Object.keys(shape).length === 0) {
|
|
27146
|
-
zodSchema2 =
|
|
27189
|
+
zodSchema2 = z20.record(keySchema, valueSchema);
|
|
27147
27190
|
break;
|
|
27148
27191
|
}
|
|
27149
|
-
const objectSchema2 =
|
|
27150
|
-
const recordSchema =
|
|
27151
|
-
zodSchema2 =
|
|
27192
|
+
const objectSchema2 = z20.object(shape).passthrough();
|
|
27193
|
+
const recordSchema = z20.looseRecord(keySchema, valueSchema);
|
|
27194
|
+
zodSchema2 = z20.intersection(objectSchema2, recordSchema);
|
|
27152
27195
|
break;
|
|
27153
27196
|
}
|
|
27154
27197
|
if (schema.patternProperties) {
|
|
@@ -27157,28 +27200,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27157
27200
|
const looseRecords = [];
|
|
27158
27201
|
for (const pattern of patternKeys) {
|
|
27159
27202
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
27160
|
-
const keySchema =
|
|
27161
|
-
looseRecords.push(
|
|
27203
|
+
const keySchema = z20.string().regex(new RegExp(pattern));
|
|
27204
|
+
looseRecords.push(z20.looseRecord(keySchema, patternValue));
|
|
27162
27205
|
}
|
|
27163
27206
|
const schemasToIntersect = [];
|
|
27164
27207
|
if (Object.keys(shape).length > 0) {
|
|
27165
|
-
schemasToIntersect.push(
|
|
27208
|
+
schemasToIntersect.push(z20.object(shape).passthrough());
|
|
27166
27209
|
}
|
|
27167
27210
|
schemasToIntersect.push(...looseRecords);
|
|
27168
27211
|
if (schemasToIntersect.length === 0) {
|
|
27169
|
-
zodSchema2 =
|
|
27212
|
+
zodSchema2 = z20.object({}).passthrough();
|
|
27170
27213
|
} else if (schemasToIntersect.length === 1) {
|
|
27171
27214
|
zodSchema2 = schemasToIntersect[0];
|
|
27172
27215
|
} else {
|
|
27173
|
-
let result =
|
|
27216
|
+
let result = z20.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
27174
27217
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
27175
|
-
result =
|
|
27218
|
+
result = z20.intersection(result, schemasToIntersect[i]);
|
|
27176
27219
|
}
|
|
27177
27220
|
zodSchema2 = result;
|
|
27178
27221
|
}
|
|
27179
27222
|
break;
|
|
27180
27223
|
}
|
|
27181
|
-
const objectSchema =
|
|
27224
|
+
const objectSchema = z20.object(shape);
|
|
27182
27225
|
if (schema.additionalProperties === false) {
|
|
27183
27226
|
zodSchema2 = objectSchema.strict();
|
|
27184
27227
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -27195,33 +27238,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27195
27238
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
27196
27239
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
27197
27240
|
if (rest) {
|
|
27198
|
-
zodSchema2 =
|
|
27241
|
+
zodSchema2 = z20.tuple(tupleItems).rest(rest);
|
|
27199
27242
|
} else {
|
|
27200
|
-
zodSchema2 =
|
|
27243
|
+
zodSchema2 = z20.tuple(tupleItems);
|
|
27201
27244
|
}
|
|
27202
27245
|
if (typeof schema.minItems === "number") {
|
|
27203
|
-
zodSchema2 = zodSchema2.check(
|
|
27246
|
+
zodSchema2 = zodSchema2.check(z20.minLength(schema.minItems));
|
|
27204
27247
|
}
|
|
27205
27248
|
if (typeof schema.maxItems === "number") {
|
|
27206
|
-
zodSchema2 = zodSchema2.check(
|
|
27249
|
+
zodSchema2 = zodSchema2.check(z20.maxLength(schema.maxItems));
|
|
27207
27250
|
}
|
|
27208
27251
|
} else if (Array.isArray(items)) {
|
|
27209
27252
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
27210
27253
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
27211
27254
|
if (rest) {
|
|
27212
|
-
zodSchema2 =
|
|
27255
|
+
zodSchema2 = z20.tuple(tupleItems).rest(rest);
|
|
27213
27256
|
} else {
|
|
27214
|
-
zodSchema2 =
|
|
27257
|
+
zodSchema2 = z20.tuple(tupleItems);
|
|
27215
27258
|
}
|
|
27216
27259
|
if (typeof schema.minItems === "number") {
|
|
27217
|
-
zodSchema2 = zodSchema2.check(
|
|
27260
|
+
zodSchema2 = zodSchema2.check(z20.minLength(schema.minItems));
|
|
27218
27261
|
}
|
|
27219
27262
|
if (typeof schema.maxItems === "number") {
|
|
27220
|
-
zodSchema2 = zodSchema2.check(
|
|
27263
|
+
zodSchema2 = zodSchema2.check(z20.maxLength(schema.maxItems));
|
|
27221
27264
|
}
|
|
27222
27265
|
} else if (items !== void 0) {
|
|
27223
27266
|
const element = convertSchema(items, ctx);
|
|
27224
|
-
let arraySchema =
|
|
27267
|
+
let arraySchema = z20.array(element);
|
|
27225
27268
|
if (typeof schema.minItems === "number") {
|
|
27226
27269
|
arraySchema = arraySchema.min(schema.minItems);
|
|
27227
27270
|
}
|
|
@@ -27230,7 +27273,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27230
27273
|
}
|
|
27231
27274
|
zodSchema2 = arraySchema;
|
|
27232
27275
|
} else {
|
|
27233
|
-
zodSchema2 =
|
|
27276
|
+
zodSchema2 = z20.array(z20.any());
|
|
27234
27277
|
}
|
|
27235
27278
|
break;
|
|
27236
27279
|
}
|
|
@@ -27247,37 +27290,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27247
27290
|
}
|
|
27248
27291
|
function convertSchema(schema, ctx) {
|
|
27249
27292
|
if (typeof schema === "boolean") {
|
|
27250
|
-
return schema ?
|
|
27293
|
+
return schema ? z20.any() : z20.never();
|
|
27251
27294
|
}
|
|
27252
27295
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
27253
27296
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
27254
27297
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
27255
27298
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
27256
|
-
const anyOfUnion =
|
|
27257
|
-
baseSchema = hasExplicitType ?
|
|
27299
|
+
const anyOfUnion = z20.union(options);
|
|
27300
|
+
baseSchema = hasExplicitType ? z20.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
27258
27301
|
}
|
|
27259
27302
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
27260
27303
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
27261
|
-
const oneOfUnion =
|
|
27262
|
-
baseSchema = hasExplicitType ?
|
|
27304
|
+
const oneOfUnion = z20.xor(options);
|
|
27305
|
+
baseSchema = hasExplicitType ? z20.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
27263
27306
|
}
|
|
27264
27307
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
27265
27308
|
if (schema.allOf.length === 0) {
|
|
27266
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
27309
|
+
baseSchema = hasExplicitType ? baseSchema : z20.any();
|
|
27267
27310
|
} else {
|
|
27268
27311
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
27269
27312
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
27270
27313
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
27271
|
-
result =
|
|
27314
|
+
result = z20.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
27272
27315
|
}
|
|
27273
27316
|
baseSchema = result;
|
|
27274
27317
|
}
|
|
27275
27318
|
}
|
|
27276
27319
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
27277
|
-
baseSchema =
|
|
27320
|
+
baseSchema = z20.nullable(baseSchema);
|
|
27278
27321
|
}
|
|
27279
27322
|
if (schema.readOnly === true) {
|
|
27280
|
-
baseSchema =
|
|
27323
|
+
baseSchema = z20.readonly(baseSchema);
|
|
27281
27324
|
}
|
|
27282
27325
|
const extraMeta = {};
|
|
27283
27326
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -27304,7 +27347,7 @@ function convertSchema(schema, ctx) {
|
|
|
27304
27347
|
}
|
|
27305
27348
|
function fromJSONSchema(schema, params) {
|
|
27306
27349
|
if (typeof schema === "boolean") {
|
|
27307
|
-
return schema ?
|
|
27350
|
+
return schema ? z20.any() : z20.never();
|
|
27308
27351
|
}
|
|
27309
27352
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
27310
27353
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -27318,14 +27361,14 @@ function fromJSONSchema(schema, params) {
|
|
|
27318
27361
|
};
|
|
27319
27362
|
return convertSchema(schema, ctx);
|
|
27320
27363
|
}
|
|
27321
|
-
var
|
|
27364
|
+
var z20, RECOGNIZED_KEYS;
|
|
27322
27365
|
var init_from_json_schema = __esm({
|
|
27323
27366
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
27324
27367
|
init_registries();
|
|
27325
27368
|
init_checks2();
|
|
27326
27369
|
init_iso();
|
|
27327
27370
|
init_schemas2();
|
|
27328
|
-
|
|
27371
|
+
z20 = {
|
|
27329
27372
|
...schemas_exports2,
|
|
27330
27373
|
...checks_exports2,
|
|
27331
27374
|
iso: iso_exports
|