@cleocode/adapters 2026.6.6 → 2026.6.8
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 +799 -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
|
])
|
|
@@ -11577,6 +11619,87 @@ var init_nexus_scope_map = __esm({
|
|
|
11577
11619
|
}
|
|
11578
11620
|
});
|
|
11579
11621
|
|
|
11622
|
+
// packages/contracts/src/operations/output-contracts-data.ts
|
|
11623
|
+
var TASK_MUTATION_DATA_SCHEMA, tasksAddOutputContract, tasksAddBatchOutputContract, tasksUpdateOutputContract, tasksCompleteOutputContract;
|
|
11624
|
+
var init_output_contracts_data = __esm({
|
|
11625
|
+
"packages/contracts/src/operations/output-contracts-data.ts"() {
|
|
11626
|
+
"use strict";
|
|
11627
|
+
TASK_MUTATION_DATA_SCHEMA = {
|
|
11628
|
+
type: "object",
|
|
11629
|
+
required: ["count", "created", "updated", "deleted"],
|
|
11630
|
+
additionalProperties: true,
|
|
11631
|
+
properties: {
|
|
11632
|
+
count: { type: "number", description: "Number of records the mutation affected." },
|
|
11633
|
+
created: {
|
|
11634
|
+
type: "array",
|
|
11635
|
+
description: 'Task IDs created by the mutation (bare strings, e.g. "T11692"). Empty for update/delete-only mutations.',
|
|
11636
|
+
items: { type: "string" }
|
|
11637
|
+
},
|
|
11638
|
+
updated: {
|
|
11639
|
+
type: "array",
|
|
11640
|
+
description: "Task IDs updated by the mutation (bare strings). Empty for create/delete-only mutations.",
|
|
11641
|
+
items: { type: "string" }
|
|
11642
|
+
},
|
|
11643
|
+
deleted: {
|
|
11644
|
+
type: "array",
|
|
11645
|
+
description: "Task IDs deleted by the mutation (bare strings). Empty for create/update-only mutations.",
|
|
11646
|
+
items: { type: "string" }
|
|
11647
|
+
},
|
|
11648
|
+
ids: {
|
|
11649
|
+
type: "array",
|
|
11650
|
+
description: "Deprecated alias for the non-empty bucket. Prefer created/updated/deleted.",
|
|
11651
|
+
items: { type: "string" }
|
|
11652
|
+
},
|
|
11653
|
+
dryRun: { type: "boolean", description: "True when this was a preview-only mutation." },
|
|
11654
|
+
status: { type: "string", description: "Post-mutation task status (add/update/complete)." }
|
|
11655
|
+
}
|
|
11656
|
+
};
|
|
11657
|
+
tasksAddOutputContract = {
|
|
11658
|
+
operation: "tasks.add",
|
|
11659
|
+
shapeNote: 'The created task ID (bare string) is at /data/created/0 \u2014 NOT /data/created/0/id. Example: /data/created/0 \u2192 "T11692".',
|
|
11660
|
+
dataSchema: { ...TASK_MUTATION_DATA_SCHEMA },
|
|
11661
|
+
fieldPointers: ["/data/created/0", "/data/count"]
|
|
11662
|
+
};
|
|
11663
|
+
tasksAddBatchOutputContract = {
|
|
11664
|
+
operation: "tasks.add-batch",
|
|
11665
|
+
shapeNote: "Atomic batch insert. Each created task ID (bare string) is in /data/created (array). Dry-run projections are at root: /data/wouldCreate and /data/insertedCount (=0). NOT under /data/dryRunSummary.",
|
|
11666
|
+
dataSchema: {
|
|
11667
|
+
type: "object",
|
|
11668
|
+
required: ["count", "created", "updated", "deleted"],
|
|
11669
|
+
additionalProperties: true,
|
|
11670
|
+
properties: {
|
|
11671
|
+
...TASK_MUTATION_DATA_SCHEMA.properties,
|
|
11672
|
+
wouldCreate: {
|
|
11673
|
+
type: "number",
|
|
11674
|
+
description: "Dry-run: predicted write count. Present only when dryRun=true."
|
|
11675
|
+
},
|
|
11676
|
+
insertedCount: {
|
|
11677
|
+
type: "number",
|
|
11678
|
+
description: "Dry-run: always 0 (no DB write). Present only when dryRun=true."
|
|
11679
|
+
},
|
|
11680
|
+
wouldAffect: {
|
|
11681
|
+
type: "number",
|
|
11682
|
+
description: "Dry-run: generic affected count. Present only when dryRun=true."
|
|
11683
|
+
}
|
|
11684
|
+
}
|
|
11685
|
+
},
|
|
11686
|
+
fieldPointers: ["/data/created/0", "/data/count", "/data/wouldCreate", "/data/insertedCount"]
|
|
11687
|
+
};
|
|
11688
|
+
tasksUpdateOutputContract = {
|
|
11689
|
+
operation: "tasks.update",
|
|
11690
|
+
shapeNote: "The updated task ID (bare string) is at /data/updated/0 \u2014 NOT /data/updated/0/id. Use /data/status for the post-mutation status.",
|
|
11691
|
+
dataSchema: { ...TASK_MUTATION_DATA_SCHEMA },
|
|
11692
|
+
fieldPointers: ["/data/updated/0", "/data/status", "/data/count"]
|
|
11693
|
+
};
|
|
11694
|
+
tasksCompleteOutputContract = {
|
|
11695
|
+
operation: "tasks.complete",
|
|
11696
|
+
shapeNote: "Completion is a status mutation \u2014 the task ID (bare string) is at /data/updated/0 (status=done). Use /data/status for the post-mutation status.",
|
|
11697
|
+
dataSchema: { ...TASK_MUTATION_DATA_SCHEMA },
|
|
11698
|
+
fieldPointers: ["/data/updated/0", "/data/status", "/data/count"]
|
|
11699
|
+
};
|
|
11700
|
+
}
|
|
11701
|
+
});
|
|
11702
|
+
|
|
11580
11703
|
// packages/contracts/src/peer.ts
|
|
11581
11704
|
var init_peer = __esm({
|
|
11582
11705
|
"packages/contracts/src/peer.ts"() {
|
|
@@ -11585,31 +11708,31 @@ var init_peer = __esm({
|
|
|
11585
11708
|
});
|
|
11586
11709
|
|
|
11587
11710
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
11588
|
-
import { z as
|
|
11711
|
+
import { z as z12 } from "zod";
|
|
11589
11712
|
var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
|
|
11590
11713
|
var init_evidence_atoms = __esm({
|
|
11591
11714
|
"packages/contracts/src/release/evidence-atoms.ts"() {
|
|
11592
11715
|
"use strict";
|
|
11593
|
-
parsedPrEvidenceAtomSchema =
|
|
11594
|
-
kind:
|
|
11595
|
-
prNumber:
|
|
11596
|
-
});
|
|
11597
|
-
prEvidenceStateModifierSchema =
|
|
11598
|
-
kind:
|
|
11599
|
-
value:
|
|
11600
|
-
});
|
|
11601
|
-
ghPrViewSchema =
|
|
11602
|
-
state:
|
|
11603
|
-
mergedAt:
|
|
11604
|
-
headRefOid:
|
|
11605
|
-
mergeable:
|
|
11606
|
-
statusCheckRollup:
|
|
11607
|
-
|
|
11608
|
-
__typename:
|
|
11609
|
-
name:
|
|
11610
|
-
workflowName:
|
|
11611
|
-
conclusion:
|
|
11612
|
-
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()
|
|
11613
11736
|
}).passthrough()
|
|
11614
11737
|
).optional().default([])
|
|
11615
11738
|
}).passthrough();
|
|
@@ -11622,7 +11745,7 @@ var init_evidence_atoms = __esm({
|
|
|
11622
11745
|
});
|
|
11623
11746
|
|
|
11624
11747
|
// packages/contracts/src/release/plan.ts
|
|
11625
|
-
import { z as
|
|
11748
|
+
import { z as z13 } from "zod";
|
|
11626
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;
|
|
11627
11750
|
var init_plan = __esm({
|
|
11628
11751
|
"packages/contracts/src/release/plan.ts"() {
|
|
@@ -11665,20 +11788,20 @@ var init_plan = __esm({
|
|
|
11665
11788
|
];
|
|
11666
11789
|
IMPACT = ["major", "minor", "patch"];
|
|
11667
11790
|
RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
|
|
11668
|
-
ReleaseChannelSchema =
|
|
11669
|
-
ReleaseSchemeSchema =
|
|
11670
|
-
ReleaseKindSchema =
|
|
11671
|
-
ReleaseStatusSchema =
|
|
11672
|
-
GateStatusSchema =
|
|
11673
|
-
GateNameSchema =
|
|
11674
|
-
PlatformTupleSchema =
|
|
11675
|
-
PublisherSchema =
|
|
11676
|
-
TaskKindSchema =
|
|
11677
|
-
ImpactSchema =
|
|
11678
|
-
ResolvedSourceSchema =
|
|
11679
|
-
Iso8601 =
|
|
11680
|
-
NonEmptyString =
|
|
11681
|
-
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({
|
|
11682
11805
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
11683
11806
|
id: NonEmptyString,
|
|
11684
11807
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -11686,20 +11809,20 @@ var init_plan = __esm({
|
|
|
11686
11809
|
/** SemVer impact classification. */
|
|
11687
11810
|
impact: ImpactSchema,
|
|
11688
11811
|
/** Human-readable changelog line for this task. */
|
|
11689
|
-
userFacingSummary:
|
|
11812
|
+
userFacingSummary: z13.string(),
|
|
11690
11813
|
/**
|
|
11691
11814
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
11692
11815
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
11693
11816
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
11694
11817
|
* enforces non-empty via R-301.
|
|
11695
11818
|
*/
|
|
11696
|
-
evidenceAtoms:
|
|
11819
|
+
evidenceAtoms: z13.array(NonEmptyString),
|
|
11697
11820
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
11698
|
-
ivtrPhaseAtPlan:
|
|
11821
|
+
ivtrPhaseAtPlan: z13.string().optional(),
|
|
11699
11822
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
11700
11823
|
epicAncestor: NonEmptyString
|
|
11701
11824
|
});
|
|
11702
|
-
ReleaseGateSchema =
|
|
11825
|
+
ReleaseGateSchema = z13.object({
|
|
11703
11826
|
/** Canonical gate name. */
|
|
11704
11827
|
name: GateNameSchema,
|
|
11705
11828
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -11709,11 +11832,11 @@ var init_plan = __esm({
|
|
|
11709
11832
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
11710
11833
|
lastVerifiedAt: Iso8601,
|
|
11711
11834
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
11712
|
-
resolvedCommand:
|
|
11835
|
+
resolvedCommand: z13.string().optional(),
|
|
11713
11836
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
11714
11837
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
11715
11838
|
});
|
|
11716
|
-
ReleasePlatformMatrixEntrySchema =
|
|
11839
|
+
ReleasePlatformMatrixEntrySchema = z13.object({
|
|
11717
11840
|
/** Target platform tuple. */
|
|
11718
11841
|
platform: PlatformTupleSchema,
|
|
11719
11842
|
/** Distribution backend. */
|
|
@@ -11721,47 +11844,47 @@ var init_plan = __esm({
|
|
|
11721
11844
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
11722
11845
|
package: NonEmptyString,
|
|
11723
11846
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
11724
|
-
smoke:
|
|
11847
|
+
smoke: z13.boolean().default(true).optional()
|
|
11725
11848
|
});
|
|
11726
|
-
ReleasePreflightSummarySchema =
|
|
11849
|
+
ReleasePreflightSummarySchema = z13.object({
|
|
11727
11850
|
/** True if esbuild externals are out of sync with package.json. */
|
|
11728
|
-
esbuildExternalsDrift:
|
|
11851
|
+
esbuildExternalsDrift: z13.boolean(),
|
|
11729
11852
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
11730
|
-
lockfileDrift:
|
|
11853
|
+
lockfileDrift: z13.boolean(),
|
|
11731
11854
|
/** True if all epic children are in terminal lifecycle states. */
|
|
11732
|
-
epicCompletenessClean:
|
|
11855
|
+
epicCompletenessClean: z13.boolean(),
|
|
11733
11856
|
/** True if no task appears in multiple in-flight release plans. */
|
|
11734
|
-
doubleListingClean:
|
|
11857
|
+
doubleListingClean: z13.boolean(),
|
|
11735
11858
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
11736
|
-
preflightWarnings:
|
|
11859
|
+
preflightWarnings: z13.array(z13.string()).default([]).optional()
|
|
11737
11860
|
});
|
|
11738
|
-
ReleasePlanChangelogSchema =
|
|
11861
|
+
ReleasePlanChangelogSchema = z13.object({
|
|
11739
11862
|
/** `kind=feat` tasks. */
|
|
11740
|
-
features:
|
|
11863
|
+
features: z13.array(NonEmptyString).default([]),
|
|
11741
11864
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
11742
|
-
fixes:
|
|
11865
|
+
fixes: z13.array(NonEmptyString).default([]),
|
|
11743
11866
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
11744
|
-
chores:
|
|
11867
|
+
chores: z13.array(NonEmptyString).default([]),
|
|
11745
11868
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
11746
|
-
breaking:
|
|
11869
|
+
breaking: z13.array(NonEmptyString).default([])
|
|
11747
11870
|
});
|
|
11748
|
-
ReleasePlanMetaSchema =
|
|
11871
|
+
ReleasePlanMetaSchema = z13.object({
|
|
11749
11872
|
/** True if this is the project's first ever release. */
|
|
11750
|
-
firstEverRelease:
|
|
11873
|
+
firstEverRelease: z13.boolean().optional(),
|
|
11751
11874
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
11752
|
-
unresolvedTools:
|
|
11875
|
+
unresolvedTools: z13.array(z13.string()).optional(),
|
|
11753
11876
|
/** Project archetype detected at plan time. */
|
|
11754
|
-
archetype:
|
|
11755
|
-
}).catchall(
|
|
11756
|
-
ReleasePlanSchema =
|
|
11877
|
+
archetype: z13.string().optional()
|
|
11878
|
+
}).catchall(z13.unknown());
|
|
11879
|
+
ReleasePlanSchema = z13.object({
|
|
11757
11880
|
/** Schema URL for this plan version. */
|
|
11758
|
-
$schema:
|
|
11881
|
+
$schema: z13.string().optional(),
|
|
11759
11882
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
11760
11883
|
version: NonEmptyString,
|
|
11761
11884
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
11762
11885
|
resolvedVersion: NonEmptyString,
|
|
11763
11886
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
11764
|
-
suffixApplied:
|
|
11887
|
+
suffixApplied: z13.boolean(),
|
|
11765
11888
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
11766
11889
|
scheme: ReleaseSchemeSchema,
|
|
11767
11890
|
/** npm dist-tag channel for this release. */
|
|
@@ -11778,27 +11901,27 @@ var init_plan = __esm({
|
|
|
11778
11901
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
11779
11902
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
11780
11903
|
*/
|
|
11781
|
-
previousVersion:
|
|
11904
|
+
previousVersion: z13.string().nullable(),
|
|
11782
11905
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
11783
|
-
previousTag:
|
|
11906
|
+
previousTag: z13.string().nullable(),
|
|
11784
11907
|
/** ISO-8601 timestamp the previous release was published. */
|
|
11785
11908
|
previousShippedAt: Iso8601.nullable(),
|
|
11786
11909
|
/** Tasks rolled into this release. */
|
|
11787
|
-
tasks:
|
|
11910
|
+
tasks: z13.array(ReleasePlanTaskSchema),
|
|
11788
11911
|
/** Bucketed changelog. */
|
|
11789
11912
|
changelog: ReleasePlanChangelogSchema,
|
|
11790
11913
|
/** Per-gate verification status. */
|
|
11791
|
-
gates:
|
|
11914
|
+
gates: z13.array(ReleaseGateSchema),
|
|
11792
11915
|
/** Platform / publisher matrix. */
|
|
11793
|
-
platformMatrix:
|
|
11916
|
+
platformMatrix: z13.array(ReleasePlatformMatrixEntrySchema),
|
|
11794
11917
|
/** Preflight summary from `cleo release plan`. */
|
|
11795
11918
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
11796
11919
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
11797
|
-
workflowRunUrl:
|
|
11920
|
+
workflowRunUrl: z13.string().nullable(),
|
|
11798
11921
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
11799
|
-
prUrl:
|
|
11922
|
+
prUrl: z13.string().nullable(),
|
|
11800
11923
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
11801
|
-
mergeCommitSha:
|
|
11924
|
+
mergeCommitSha: z13.string().nullable(),
|
|
11802
11925
|
/** Current FSM state per R-302. */
|
|
11803
11926
|
status: ReleaseStatusSchema,
|
|
11804
11927
|
/** Informational / forward-compat metadata. */
|
|
@@ -11854,52 +11977,52 @@ var init_session2 = __esm({
|
|
|
11854
11977
|
});
|
|
11855
11978
|
|
|
11856
11979
|
// packages/contracts/src/session-journal.ts
|
|
11857
|
-
import { z as
|
|
11980
|
+
import { z as z14 } from "zod";
|
|
11858
11981
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
11859
11982
|
var init_session_journal = __esm({
|
|
11860
11983
|
"packages/contracts/src/session-journal.ts"() {
|
|
11861
11984
|
"use strict";
|
|
11862
11985
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
11863
|
-
sessionJournalDoctorSummarySchema =
|
|
11986
|
+
sessionJournalDoctorSummarySchema = z14.object({
|
|
11864
11987
|
/** `true` when zero noise patterns were detected. */
|
|
11865
|
-
isClean:
|
|
11988
|
+
isClean: z14.boolean(),
|
|
11866
11989
|
/** Total number of noise findings across all patterns. */
|
|
11867
|
-
findingsCount:
|
|
11990
|
+
findingsCount: z14.number().int().nonnegative(),
|
|
11868
11991
|
/** Pattern names that were detected (empty when isClean). */
|
|
11869
|
-
patterns:
|
|
11992
|
+
patterns: z14.array(z14.string()),
|
|
11870
11993
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
11871
|
-
totalScanned:
|
|
11994
|
+
totalScanned: z14.number().int().nonnegative()
|
|
11872
11995
|
});
|
|
11873
|
-
sessionJournalDebriefSummarySchema =
|
|
11996
|
+
sessionJournalDebriefSummarySchema = z14.object({
|
|
11874
11997
|
/** First 200 characters of the session end note (if provided). */
|
|
11875
|
-
noteExcerpt:
|
|
11998
|
+
noteExcerpt: z14.string().max(200).optional(),
|
|
11876
11999
|
/** Number of tasks completed during the session. */
|
|
11877
|
-
tasksCompletedCount:
|
|
12000
|
+
tasksCompletedCount: z14.number().int().nonnegative(),
|
|
11878
12001
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
11879
|
-
tasksFocused:
|
|
12002
|
+
tasksFocused: z14.array(z14.string()).max(5).optional()
|
|
11880
12003
|
});
|
|
11881
|
-
sessionJournalEntrySchema =
|
|
12004
|
+
sessionJournalEntrySchema = z14.object({
|
|
11882
12005
|
// Identity
|
|
11883
12006
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
11884
|
-
schemaVersion:
|
|
12007
|
+
schemaVersion: z14.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
11885
12008
|
/** ISO 8601 timestamp when the entry was written. */
|
|
11886
|
-
timestamp:
|
|
12009
|
+
timestamp: z14.string(),
|
|
11887
12010
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
11888
|
-
sessionId:
|
|
12011
|
+
sessionId: z14.string(),
|
|
11889
12012
|
/** Event type that triggered this journal entry. */
|
|
11890
|
-
eventType:
|
|
12013
|
+
eventType: z14.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
11891
12014
|
// Session metadata (set on session_start / session_end)
|
|
11892
12015
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
11893
|
-
agentIdentifier:
|
|
12016
|
+
agentIdentifier: z14.string().optional(),
|
|
11894
12017
|
/** Provider adapter ID active for this session. */
|
|
11895
|
-
providerId:
|
|
12018
|
+
providerId: z14.string().optional(),
|
|
11896
12019
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
11897
|
-
scope:
|
|
12020
|
+
scope: z14.string().optional(),
|
|
11898
12021
|
// Session-end fields
|
|
11899
12022
|
/** Duration of the session in seconds (session_end only). */
|
|
11900
|
-
duration:
|
|
12023
|
+
duration: z14.number().int().nonnegative().optional(),
|
|
11901
12024
|
/** Task IDs (not titles) completed during the session. */
|
|
11902
|
-
tasksCompleted:
|
|
12025
|
+
tasksCompleted: z14.array(z14.string()).optional(),
|
|
11903
12026
|
// Doctor summary (T1262 absorbed)
|
|
11904
12027
|
/** Compact result of `scanBrainNoise` run at session-end. */
|
|
11905
12028
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
@@ -11908,7 +12031,7 @@ var init_session_journal = __esm({
|
|
|
11908
12031
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
11909
12032
|
// Optional hash chain
|
|
11910
12033
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
11911
|
-
prevEntryHash:
|
|
12034
|
+
prevEntryHash: z14.string().optional()
|
|
11912
12035
|
});
|
|
11913
12036
|
}
|
|
11914
12037
|
});
|
|
@@ -11921,52 +12044,52 @@ var init_task = __esm({
|
|
|
11921
12044
|
});
|
|
11922
12045
|
|
|
11923
12046
|
// packages/contracts/src/task-evidence.ts
|
|
11924
|
-
import { z as
|
|
12047
|
+
import { z as z15 } from "zod";
|
|
11925
12048
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
11926
12049
|
var init_task_evidence = __esm({
|
|
11927
12050
|
"packages/contracts/src/task-evidence.ts"() {
|
|
11928
12051
|
"use strict";
|
|
11929
|
-
fileEvidenceSchema =
|
|
11930
|
-
kind:
|
|
11931
|
-
sha256:
|
|
11932
|
-
timestamp:
|
|
11933
|
-
path:
|
|
11934
|
-
mime:
|
|
11935
|
-
description:
|
|
11936
|
-
});
|
|
11937
|
-
logEvidenceSchema =
|
|
11938
|
-
kind:
|
|
11939
|
-
sha256:
|
|
11940
|
-
timestamp:
|
|
11941
|
-
source:
|
|
11942
|
-
description:
|
|
11943
|
-
});
|
|
11944
|
-
screenshotEvidenceSchema =
|
|
11945
|
-
kind:
|
|
11946
|
-
sha256:
|
|
11947
|
-
timestamp:
|
|
11948
|
-
mime:
|
|
11949
|
-
description:
|
|
11950
|
-
});
|
|
11951
|
-
testOutputEvidenceSchema =
|
|
11952
|
-
kind:
|
|
11953
|
-
sha256:
|
|
11954
|
-
timestamp:
|
|
11955
|
-
passed:
|
|
11956
|
-
failed:
|
|
11957
|
-
skipped:
|
|
11958
|
-
exitCode:
|
|
11959
|
-
description:
|
|
11960
|
-
});
|
|
11961
|
-
commandOutputEvidenceSchema =
|
|
11962
|
-
kind:
|
|
11963
|
-
sha256:
|
|
11964
|
-
timestamp:
|
|
11965
|
-
cmd:
|
|
11966
|
-
exitCode:
|
|
11967
|
-
description:
|
|
11968
|
-
});
|
|
11969
|
-
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", [
|
|
11970
12093
|
fileEvidenceSchema,
|
|
11971
12094
|
logEvidenceSchema,
|
|
11972
12095
|
screenshotEvidenceSchema,
|
|
@@ -11977,12 +12100,12 @@ var init_task_evidence = __esm({
|
|
|
11977
12100
|
});
|
|
11978
12101
|
|
|
11979
12102
|
// packages/contracts/src/tasks/archive.ts
|
|
11980
|
-
import { z as
|
|
12103
|
+
import { z as z16 } from "zod";
|
|
11981
12104
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
11982
12105
|
var init_archive = __esm({
|
|
11983
12106
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
11984
12107
|
"use strict";
|
|
11985
|
-
ArchiveReason =
|
|
12108
|
+
ArchiveReason = z16.enum([
|
|
11986
12109
|
"verified",
|
|
11987
12110
|
"reconciled",
|
|
11988
12111
|
"superseded",
|
|
@@ -11995,47 +12118,47 @@ var init_archive = __esm({
|
|
|
11995
12118
|
});
|
|
11996
12119
|
|
|
11997
12120
|
// packages/contracts/src/tasks.ts
|
|
11998
|
-
import { z as
|
|
12121
|
+
import { z as z17 } from "zod";
|
|
11999
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;
|
|
12000
12123
|
var init_tasks2 = __esm({
|
|
12001
12124
|
"packages/contracts/src/tasks.ts"() {
|
|
12002
12125
|
"use strict";
|
|
12003
12126
|
init_status_registry();
|
|
12004
|
-
taskMutationWarningSeveritySchema =
|
|
12005
|
-
taskMutationWarningSchema =
|
|
12006
|
-
code:
|
|
12007
|
-
message:
|
|
12127
|
+
taskMutationWarningSeveritySchema = z17.enum(["info", "warning"]);
|
|
12128
|
+
taskMutationWarningSchema = z17.object({
|
|
12129
|
+
code: z17.string().min(1),
|
|
12130
|
+
message: z17.string().min(1),
|
|
12008
12131
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
12009
|
-
taskId:
|
|
12010
|
-
field:
|
|
12011
|
-
index:
|
|
12012
|
-
});
|
|
12013
|
-
taskMutationDryRunSummarySchema =
|
|
12014
|
-
dryRun:
|
|
12015
|
-
wouldCreate:
|
|
12016
|
-
wouldUpdate:
|
|
12017
|
-
wouldDelete:
|
|
12018
|
-
wouldAffect:
|
|
12019
|
-
validatedCount:
|
|
12020
|
-
insertedCount:
|
|
12021
|
-
updatedCount:
|
|
12022
|
-
deletedCount:
|
|
12023
|
-
warnings:
|
|
12024
|
-
});
|
|
12025
|
-
taskMutationTaskRecordSchema =
|
|
12026
|
-
taskMutationEnvelopeSchema =
|
|
12027
|
-
dryRun:
|
|
12028
|
-
created:
|
|
12029
|
-
updated:
|
|
12030
|
-
deleted:
|
|
12031
|
-
affectedCount:
|
|
12032
|
-
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),
|
|
12033
12156
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
12034
12157
|
});
|
|
12035
|
-
completionTaskStatusSchema =
|
|
12036
|
-
completionCriterionKindSchema =
|
|
12037
|
-
completionCriterionStatusSchema =
|
|
12038
|
-
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([
|
|
12039
12162
|
"missing_evidence_binding",
|
|
12040
12163
|
"child_not_done",
|
|
12041
12164
|
"child_cancelled_requires_waiver",
|
|
@@ -12043,68 +12166,68 @@ var init_tasks2 = __esm({
|
|
|
12043
12166
|
"child_missing",
|
|
12044
12167
|
"done_parent_stale"
|
|
12045
12168
|
]);
|
|
12046
|
-
completionStaleReasonSchema =
|
|
12047
|
-
completionProjectionRepairErrorCodeSchema =
|
|
12169
|
+
completionStaleReasonSchema = z17.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
12170
|
+
completionProjectionRepairErrorCodeSchema = z17.enum([
|
|
12048
12171
|
"projection_not_stale",
|
|
12049
12172
|
"criteria_missing",
|
|
12050
12173
|
"binding_target_missing",
|
|
12051
12174
|
"repair_conflict"
|
|
12052
12175
|
]);
|
|
12053
|
-
completionCriterionWaiverSchema =
|
|
12054
|
-
criterionAcId:
|
|
12055
|
-
childTaskId:
|
|
12056
|
-
reason:
|
|
12057
|
-
actor:
|
|
12058
|
-
waivedAt:
|
|
12059
|
-
});
|
|
12060
|
-
completionCriterionReplacementSchema =
|
|
12061
|
-
criterionAcId:
|
|
12062
|
-
originalChildTaskId:
|
|
12063
|
-
replacementChildTaskId:
|
|
12064
|
-
reason:
|
|
12065
|
-
actor:
|
|
12066
|
-
replacedAt:
|
|
12067
|
-
});
|
|
12068
|
-
completionCriterionEvaluationSchema =
|
|
12069
|
-
acId:
|
|
12070
|
-
alias:
|
|
12071
|
-
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(),
|
|
12072
12195
|
kind: completionCriterionKindSchema,
|
|
12073
12196
|
status: completionCriterionStatusSchema,
|
|
12074
12197
|
reason: completionBlockerReasonSchema.optional(),
|
|
12075
|
-
targetTaskId:
|
|
12198
|
+
targetTaskId: z17.string().min(1).optional(),
|
|
12076
12199
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
12077
12200
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
12078
12201
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
12079
12202
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
12080
|
-
evidenceBindings:
|
|
12203
|
+
evidenceBindings: z17.number().int().nonnegative()
|
|
12081
12204
|
});
|
|
12082
12205
|
unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
12083
|
-
status:
|
|
12206
|
+
status: z17.literal("unsatisfied"),
|
|
12084
12207
|
reason: completionBlockerReasonSchema
|
|
12085
12208
|
});
|
|
12086
|
-
completionTotalsSchema =
|
|
12087
|
-
criteria:
|
|
12088
|
-
satisfied:
|
|
12089
|
-
unsatisfied:
|
|
12090
|
-
waived:
|
|
12091
|
-
replaced:
|
|
12092
|
-
});
|
|
12093
|
-
completionContextPackSchema =
|
|
12094
|
-
taskId:
|
|
12095
|
-
generatedAt:
|
|
12096
|
-
source:
|
|
12097
|
-
window:
|
|
12098
|
-
limit:
|
|
12099
|
-
since:
|
|
12100
|
-
relationDepth:
|
|
12101
|
-
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))
|
|
12102
12225
|
}),
|
|
12103
|
-
events:
|
|
12104
|
-
|
|
12105
|
-
id:
|
|
12106
|
-
timestamp:
|
|
12107
|
-
action:
|
|
12226
|
+
events: z17.array(
|
|
12227
|
+
z17.object({
|
|
12228
|
+
id: z17.string().min(1),
|
|
12229
|
+
timestamp: z17.string().min(1),
|
|
12230
|
+
action: z17.enum([
|
|
12108
12231
|
"task_completed",
|
|
12109
12232
|
"task_reopened",
|
|
12110
12233
|
"task_cancelled",
|
|
@@ -12112,77 +12235,77 @@ var init_tasks2 = __esm({
|
|
|
12112
12235
|
"task_reparented",
|
|
12113
12236
|
"ac_projection_rebuilt"
|
|
12114
12237
|
]),
|
|
12115
|
-
taskId:
|
|
12116
|
-
relation:
|
|
12117
|
-
actor:
|
|
12118
|
-
details:
|
|
12119
|
-
before:
|
|
12120
|
-
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()
|
|
12121
12244
|
})
|
|
12122
12245
|
),
|
|
12123
|
-
summary:
|
|
12124
|
-
totalEvents:
|
|
12125
|
-
byAction:
|
|
12126
|
-
byRelation:
|
|
12127
|
-
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()
|
|
12128
12251
|
})
|
|
12129
12252
|
});
|
|
12130
|
-
completionEvaluationSchema =
|
|
12131
|
-
taskId:
|
|
12253
|
+
completionEvaluationSchema = z17.object({
|
|
12254
|
+
taskId: z17.string().min(1),
|
|
12132
12255
|
taskStatus: completionTaskStatusSchema,
|
|
12133
|
-
ready:
|
|
12134
|
-
stale:
|
|
12135
|
-
staleReasons:
|
|
12256
|
+
ready: z17.boolean(),
|
|
12257
|
+
stale: z17.boolean(),
|
|
12258
|
+
staleReasons: z17.array(completionStaleReasonSchema),
|
|
12136
12259
|
contextPack: completionContextPackSchema.optional(),
|
|
12137
|
-
satisfied:
|
|
12138
|
-
unsatisfied:
|
|
12139
|
-
waived:
|
|
12140
|
-
replaced:
|
|
12260
|
+
satisfied: z17.array(completionCriterionEvaluationSchema),
|
|
12261
|
+
unsatisfied: z17.array(unsatisfiedCompletionCriterionSchema),
|
|
12262
|
+
waived: z17.array(completionCriterionEvaluationSchema),
|
|
12263
|
+
replaced: z17.array(completionCriterionEvaluationSchema),
|
|
12141
12264
|
totals: completionTotalsSchema
|
|
12142
12265
|
});
|
|
12143
|
-
completionExplanationSchema =
|
|
12144
|
-
taskId:
|
|
12145
|
-
ready:
|
|
12146
|
-
stale:
|
|
12147
|
-
summary:
|
|
12266
|
+
completionExplanationSchema = z17.object({
|
|
12267
|
+
taskId: z17.string().min(1),
|
|
12268
|
+
ready: z17.boolean(),
|
|
12269
|
+
stale: z17.boolean(),
|
|
12270
|
+
summary: z17.string(),
|
|
12148
12271
|
contextPack: completionContextPackSchema.optional(),
|
|
12149
|
-
blockers:
|
|
12272
|
+
blockers: z17.array(completionCriterionEvaluationSchema)
|
|
12150
12273
|
});
|
|
12151
|
-
completionListParamsSchema =
|
|
12152
|
-
taskId:
|
|
12274
|
+
completionListParamsSchema = z17.object({
|
|
12275
|
+
taskId: z17.string().min(1),
|
|
12153
12276
|
status: completionCriterionStatusSchema.optional(),
|
|
12154
12277
|
kind: completionCriterionKindSchema.optional()
|
|
12155
12278
|
});
|
|
12156
|
-
completionListResultSchema =
|
|
12157
|
-
taskId:
|
|
12158
|
-
criteria:
|
|
12279
|
+
completionListResultSchema = z17.object({
|
|
12280
|
+
taskId: z17.string().min(1),
|
|
12281
|
+
criteria: z17.array(completionCriterionEvaluationSchema),
|
|
12159
12282
|
totals: completionTotalsSchema
|
|
12160
12283
|
});
|
|
12161
|
-
completionEvaluateParamsSchema =
|
|
12162
|
-
taskId:
|
|
12163
|
-
includeContext:
|
|
12164
|
-
limit:
|
|
12165
|
-
since:
|
|
12166
|
-
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()
|
|
12167
12290
|
});
|
|
12168
|
-
completionProjectionRepairErrorSchema =
|
|
12291
|
+
completionProjectionRepairErrorSchema = z17.object({
|
|
12169
12292
|
code: completionProjectionRepairErrorCodeSchema,
|
|
12170
|
-
message:
|
|
12171
|
-
taskId:
|
|
12172
|
-
acId:
|
|
12173
|
-
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()
|
|
12174
12297
|
});
|
|
12175
|
-
completionProjectionRepairParamsSchema =
|
|
12176
|
-
taskId:
|
|
12177
|
-
dryRun:
|
|
12298
|
+
completionProjectionRepairParamsSchema = z17.object({
|
|
12299
|
+
taskId: z17.string().min(1),
|
|
12300
|
+
dryRun: z17.boolean().optional()
|
|
12178
12301
|
});
|
|
12179
|
-
completionProjectionRepairResultSchema =
|
|
12180
|
-
taskId:
|
|
12181
|
-
repaired:
|
|
12182
|
-
dryRun:
|
|
12183
|
-
staleBefore:
|
|
12184
|
-
staleAfter:
|
|
12185
|
-
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)
|
|
12186
12309
|
});
|
|
12187
12310
|
}
|
|
12188
12311
|
});
|
|
@@ -12693,7 +12816,7 @@ var init_taxonomy = __esm({
|
|
|
12693
12816
|
});
|
|
12694
12817
|
|
|
12695
12818
|
// packages/contracts/src/templates/manifest.ts
|
|
12696
|
-
import { z as
|
|
12819
|
+
import { z as z18 } from "zod";
|
|
12697
12820
|
var TEMPLATE_KINDS, TEMPLATE_SUBSTITUTIONS, TEMPLATE_UPDATE_STRATEGIES, PLACEHOLDER_SOURCES, PlaceholderSpecSchema, TemplateManifestEntrySchema;
|
|
12698
12821
|
var init_manifest2 = __esm({
|
|
12699
12822
|
"packages/contracts/src/templates/manifest.ts"() {
|
|
@@ -12714,85 +12837,85 @@ var init_manifest2 = __esm({
|
|
|
12714
12837
|
"tool-resolver",
|
|
12715
12838
|
"literal"
|
|
12716
12839
|
];
|
|
12717
|
-
PlaceholderSpecSchema =
|
|
12840
|
+
PlaceholderSpecSchema = z18.object({
|
|
12718
12841
|
/**
|
|
12719
12842
|
* Placeholder identifier as it appears in the template body
|
|
12720
12843
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
12721
12844
|
*/
|
|
12722
|
-
name:
|
|
12845
|
+
name: z18.string().min(1, "placeholder name must be non-empty"),
|
|
12723
12846
|
/** Resolver source the installer consults for this placeholder. */
|
|
12724
|
-
source:
|
|
12847
|
+
source: z18.enum(PLACEHOLDER_SOURCES),
|
|
12725
12848
|
/**
|
|
12726
12849
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
12727
12850
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
12728
12851
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
12729
12852
|
*/
|
|
12730
|
-
sourcePath:
|
|
12853
|
+
sourcePath: z18.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
12731
12854
|
/**
|
|
12732
12855
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
12733
12856
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
12734
12857
|
*/
|
|
12735
|
-
defaultValue:
|
|
12858
|
+
defaultValue: z18.union([z18.string(), z18.number(), z18.boolean(), z18.null()]).optional()
|
|
12736
12859
|
});
|
|
12737
|
-
TemplateManifestEntrySchema =
|
|
12860
|
+
TemplateManifestEntrySchema = z18.object({
|
|
12738
12861
|
/** Stable identifier for this template entry. */
|
|
12739
|
-
id:
|
|
12862
|
+
id: z18.string().min(1, "id must be non-empty"),
|
|
12740
12863
|
/** Category of file this template represents. */
|
|
12741
|
-
kind:
|
|
12864
|
+
kind: z18.enum(TEMPLATE_KINDS),
|
|
12742
12865
|
/** Repo-relative path of the template source file. */
|
|
12743
|
-
sourcePath:
|
|
12866
|
+
sourcePath: z18.string().min(1, "sourcePath must be non-empty"),
|
|
12744
12867
|
/** Project-relative path where the rendered template installs. */
|
|
12745
|
-
installPath:
|
|
12868
|
+
installPath: z18.string().min(1, "installPath must be non-empty"),
|
|
12746
12869
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
12747
|
-
substitution:
|
|
12870
|
+
substitution: z18.enum(TEMPLATE_SUBSTITUTIONS),
|
|
12748
12871
|
/** Declared placeholders this template requires. May be empty. */
|
|
12749
|
-
placeholders:
|
|
12872
|
+
placeholders: z18.array(PlaceholderSpecSchema),
|
|
12750
12873
|
/** Reconciliation policy on upgrade. */
|
|
12751
|
-
updateStrategy:
|
|
12874
|
+
updateStrategy: z18.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
12752
12875
|
});
|
|
12753
12876
|
}
|
|
12754
12877
|
});
|
|
12755
12878
|
|
|
12756
12879
|
// packages/contracts/src/validator/index.ts
|
|
12757
|
-
import { z as
|
|
12880
|
+
import { z as z19 } from "zod";
|
|
12758
12881
|
var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
|
|
12759
12882
|
var init_validator = __esm({
|
|
12760
12883
|
"packages/contracts/src/validator/index.ts"() {
|
|
12761
12884
|
"use strict";
|
|
12762
12885
|
VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
12763
|
-
validatorFindingSchema =
|
|
12764
|
-
acId:
|
|
12765
|
-
status:
|
|
12766
|
-
reasoning:
|
|
12767
|
-
evidenceRefs:
|
|
12768
|
-
checkedAt:
|
|
12769
|
-
});
|
|
12770
|
-
validatorAttestationSchema =
|
|
12771
|
-
verdict:
|
|
12772
|
-
taskId:
|
|
12773
|
-
validatorId:
|
|
12774
|
-
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(
|
|
12775
12898
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
12776
12899
|
'attestation requires every finding to have status="pass"'
|
|
12777
12900
|
),
|
|
12778
|
-
summary:
|
|
12779
|
-
attestedAt:
|
|
12780
|
-
schemaVersion:
|
|
12781
|
-
});
|
|
12782
|
-
validatorRejectionSchema =
|
|
12783
|
-
verdict:
|
|
12784
|
-
taskId:
|
|
12785
|
-
validatorId:
|
|
12786
|
-
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(
|
|
12787
12910
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
12788
12911
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
12789
12912
|
),
|
|
12790
|
-
summary:
|
|
12791
|
-
remediationHints:
|
|
12792
|
-
rejectedAt:
|
|
12793
|
-
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")
|
|
12794
12917
|
});
|
|
12795
|
-
validatorVerdictSchema =
|
|
12918
|
+
validatorVerdictSchema = z19.discriminatedUnion("verdict", [
|
|
12796
12919
|
validatorAttestationSchema,
|
|
12797
12920
|
validatorRejectionSchema
|
|
12798
12921
|
]);
|
|
@@ -12816,6 +12939,7 @@ var init_src = __esm({
|
|
|
12816
12939
|
init_identity();
|
|
12817
12940
|
init_operations_registry();
|
|
12818
12941
|
init_provenance();
|
|
12942
|
+
init_read();
|
|
12819
12943
|
init_docs_taxonomy();
|
|
12820
12944
|
init_engine_result();
|
|
12821
12945
|
init_enums();
|
|
@@ -12837,6 +12961,7 @@ var init_src = __esm({
|
|
|
12837
12961
|
init_docs();
|
|
12838
12962
|
init_operations();
|
|
12839
12963
|
init_nexus_scope_map();
|
|
12964
|
+
init_output_contracts_data();
|
|
12840
12965
|
init_params();
|
|
12841
12966
|
init_tasks();
|
|
12842
12967
|
init_peer();
|
|
@@ -26874,7 +26999,7 @@ function resolveRef(ref, ctx) {
|
|
|
26874
26999
|
function convertBaseSchema(schema, ctx) {
|
|
26875
27000
|
if (schema.not !== void 0) {
|
|
26876
27001
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
26877
|
-
return
|
|
27002
|
+
return z20.never();
|
|
26878
27003
|
}
|
|
26879
27004
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
26880
27005
|
}
|
|
@@ -26896,7 +27021,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
26896
27021
|
return ctx.refs.get(refPath);
|
|
26897
27022
|
}
|
|
26898
27023
|
if (ctx.processing.has(refPath)) {
|
|
26899
|
-
return
|
|
27024
|
+
return z20.lazy(() => {
|
|
26900
27025
|
if (!ctx.refs.has(refPath)) {
|
|
26901
27026
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
26902
27027
|
}
|
|
@@ -26913,25 +27038,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
26913
27038
|
if (schema.enum !== void 0) {
|
|
26914
27039
|
const enumValues = schema.enum;
|
|
26915
27040
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
26916
|
-
return
|
|
27041
|
+
return z20.null();
|
|
26917
27042
|
}
|
|
26918
27043
|
if (enumValues.length === 0) {
|
|
26919
|
-
return
|
|
27044
|
+
return z20.never();
|
|
26920
27045
|
}
|
|
26921
27046
|
if (enumValues.length === 1) {
|
|
26922
|
-
return
|
|
27047
|
+
return z20.literal(enumValues[0]);
|
|
26923
27048
|
}
|
|
26924
27049
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
26925
|
-
return
|
|
27050
|
+
return z20.enum(enumValues);
|
|
26926
27051
|
}
|
|
26927
|
-
const literalSchemas = enumValues.map((v) =>
|
|
27052
|
+
const literalSchemas = enumValues.map((v) => z20.literal(v));
|
|
26928
27053
|
if (literalSchemas.length < 2) {
|
|
26929
27054
|
return literalSchemas[0];
|
|
26930
27055
|
}
|
|
26931
|
-
return
|
|
27056
|
+
return z20.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
26932
27057
|
}
|
|
26933
27058
|
if (schema.const !== void 0) {
|
|
26934
|
-
return
|
|
27059
|
+
return z20.literal(schema.const);
|
|
26935
27060
|
}
|
|
26936
27061
|
const type = schema.type;
|
|
26937
27062
|
if (Array.isArray(type)) {
|
|
@@ -26940,68 +27065,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
26940
27065
|
return convertBaseSchema(typeSchema, ctx);
|
|
26941
27066
|
});
|
|
26942
27067
|
if (typeSchemas.length === 0) {
|
|
26943
|
-
return
|
|
27068
|
+
return z20.never();
|
|
26944
27069
|
}
|
|
26945
27070
|
if (typeSchemas.length === 1) {
|
|
26946
27071
|
return typeSchemas[0];
|
|
26947
27072
|
}
|
|
26948
|
-
return
|
|
27073
|
+
return z20.union(typeSchemas);
|
|
26949
27074
|
}
|
|
26950
27075
|
if (!type) {
|
|
26951
|
-
return
|
|
27076
|
+
return z20.any();
|
|
26952
27077
|
}
|
|
26953
27078
|
let zodSchema2;
|
|
26954
27079
|
switch (type) {
|
|
26955
27080
|
case "string": {
|
|
26956
|
-
let stringSchema =
|
|
27081
|
+
let stringSchema = z20.string();
|
|
26957
27082
|
if (schema.format) {
|
|
26958
27083
|
const format = schema.format;
|
|
26959
27084
|
if (format === "email") {
|
|
26960
|
-
stringSchema = stringSchema.check(
|
|
27085
|
+
stringSchema = stringSchema.check(z20.email());
|
|
26961
27086
|
} else if (format === "uri" || format === "uri-reference") {
|
|
26962
|
-
stringSchema = stringSchema.check(
|
|
27087
|
+
stringSchema = stringSchema.check(z20.url());
|
|
26963
27088
|
} else if (format === "uuid" || format === "guid") {
|
|
26964
|
-
stringSchema = stringSchema.check(
|
|
27089
|
+
stringSchema = stringSchema.check(z20.uuid());
|
|
26965
27090
|
} else if (format === "date-time") {
|
|
26966
|
-
stringSchema = stringSchema.check(
|
|
27091
|
+
stringSchema = stringSchema.check(z20.iso.datetime());
|
|
26967
27092
|
} else if (format === "date") {
|
|
26968
|
-
stringSchema = stringSchema.check(
|
|
27093
|
+
stringSchema = stringSchema.check(z20.iso.date());
|
|
26969
27094
|
} else if (format === "time") {
|
|
26970
|
-
stringSchema = stringSchema.check(
|
|
27095
|
+
stringSchema = stringSchema.check(z20.iso.time());
|
|
26971
27096
|
} else if (format === "duration") {
|
|
26972
|
-
stringSchema = stringSchema.check(
|
|
27097
|
+
stringSchema = stringSchema.check(z20.iso.duration());
|
|
26973
27098
|
} else if (format === "ipv4") {
|
|
26974
|
-
stringSchema = stringSchema.check(
|
|
27099
|
+
stringSchema = stringSchema.check(z20.ipv4());
|
|
26975
27100
|
} else if (format === "ipv6") {
|
|
26976
|
-
stringSchema = stringSchema.check(
|
|
27101
|
+
stringSchema = stringSchema.check(z20.ipv6());
|
|
26977
27102
|
} else if (format === "mac") {
|
|
26978
|
-
stringSchema = stringSchema.check(
|
|
27103
|
+
stringSchema = stringSchema.check(z20.mac());
|
|
26979
27104
|
} else if (format === "cidr") {
|
|
26980
|
-
stringSchema = stringSchema.check(
|
|
27105
|
+
stringSchema = stringSchema.check(z20.cidrv4());
|
|
26981
27106
|
} else if (format === "cidr-v6") {
|
|
26982
|
-
stringSchema = stringSchema.check(
|
|
27107
|
+
stringSchema = stringSchema.check(z20.cidrv6());
|
|
26983
27108
|
} else if (format === "base64") {
|
|
26984
|
-
stringSchema = stringSchema.check(
|
|
27109
|
+
stringSchema = stringSchema.check(z20.base64());
|
|
26985
27110
|
} else if (format === "base64url") {
|
|
26986
|
-
stringSchema = stringSchema.check(
|
|
27111
|
+
stringSchema = stringSchema.check(z20.base64url());
|
|
26987
27112
|
} else if (format === "e164") {
|
|
26988
|
-
stringSchema = stringSchema.check(
|
|
27113
|
+
stringSchema = stringSchema.check(z20.e164());
|
|
26989
27114
|
} else if (format === "jwt") {
|
|
26990
|
-
stringSchema = stringSchema.check(
|
|
27115
|
+
stringSchema = stringSchema.check(z20.jwt());
|
|
26991
27116
|
} else if (format === "emoji") {
|
|
26992
|
-
stringSchema = stringSchema.check(
|
|
27117
|
+
stringSchema = stringSchema.check(z20.emoji());
|
|
26993
27118
|
} else if (format === "nanoid") {
|
|
26994
|
-
stringSchema = stringSchema.check(
|
|
27119
|
+
stringSchema = stringSchema.check(z20.nanoid());
|
|
26995
27120
|
} else if (format === "cuid") {
|
|
26996
|
-
stringSchema = stringSchema.check(
|
|
27121
|
+
stringSchema = stringSchema.check(z20.cuid());
|
|
26997
27122
|
} else if (format === "cuid2") {
|
|
26998
|
-
stringSchema = stringSchema.check(
|
|
27123
|
+
stringSchema = stringSchema.check(z20.cuid2());
|
|
26999
27124
|
} else if (format === "ulid") {
|
|
27000
|
-
stringSchema = stringSchema.check(
|
|
27125
|
+
stringSchema = stringSchema.check(z20.ulid());
|
|
27001
27126
|
} else if (format === "xid") {
|
|
27002
|
-
stringSchema = stringSchema.check(
|
|
27127
|
+
stringSchema = stringSchema.check(z20.xid());
|
|
27003
27128
|
} else if (format === "ksuid") {
|
|
27004
|
-
stringSchema = stringSchema.check(
|
|
27129
|
+
stringSchema = stringSchema.check(z20.ksuid());
|
|
27005
27130
|
}
|
|
27006
27131
|
}
|
|
27007
27132
|
if (typeof schema.minLength === "number") {
|
|
@@ -27018,7 +27143,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27018
27143
|
}
|
|
27019
27144
|
case "number":
|
|
27020
27145
|
case "integer": {
|
|
27021
|
-
let numberSchema = type === "integer" ?
|
|
27146
|
+
let numberSchema = type === "integer" ? z20.number().int() : z20.number();
|
|
27022
27147
|
if (typeof schema.minimum === "number") {
|
|
27023
27148
|
numberSchema = numberSchema.min(schema.minimum);
|
|
27024
27149
|
}
|
|
@@ -27042,11 +27167,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27042
27167
|
break;
|
|
27043
27168
|
}
|
|
27044
27169
|
case "boolean": {
|
|
27045
|
-
zodSchema2 =
|
|
27170
|
+
zodSchema2 = z20.boolean();
|
|
27046
27171
|
break;
|
|
27047
27172
|
}
|
|
27048
27173
|
case "null": {
|
|
27049
|
-
zodSchema2 =
|
|
27174
|
+
zodSchema2 = z20.null();
|
|
27050
27175
|
break;
|
|
27051
27176
|
}
|
|
27052
27177
|
case "object": {
|
|
@@ -27059,14 +27184,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27059
27184
|
}
|
|
27060
27185
|
if (schema.propertyNames) {
|
|
27061
27186
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
27062
|
-
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();
|
|
27063
27188
|
if (Object.keys(shape).length === 0) {
|
|
27064
|
-
zodSchema2 =
|
|
27189
|
+
zodSchema2 = z20.record(keySchema, valueSchema);
|
|
27065
27190
|
break;
|
|
27066
27191
|
}
|
|
27067
|
-
const objectSchema2 =
|
|
27068
|
-
const recordSchema =
|
|
27069
|
-
zodSchema2 =
|
|
27192
|
+
const objectSchema2 = z20.object(shape).passthrough();
|
|
27193
|
+
const recordSchema = z20.looseRecord(keySchema, valueSchema);
|
|
27194
|
+
zodSchema2 = z20.intersection(objectSchema2, recordSchema);
|
|
27070
27195
|
break;
|
|
27071
27196
|
}
|
|
27072
27197
|
if (schema.patternProperties) {
|
|
@@ -27075,28 +27200,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27075
27200
|
const looseRecords = [];
|
|
27076
27201
|
for (const pattern of patternKeys) {
|
|
27077
27202
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
27078
|
-
const keySchema =
|
|
27079
|
-
looseRecords.push(
|
|
27203
|
+
const keySchema = z20.string().regex(new RegExp(pattern));
|
|
27204
|
+
looseRecords.push(z20.looseRecord(keySchema, patternValue));
|
|
27080
27205
|
}
|
|
27081
27206
|
const schemasToIntersect = [];
|
|
27082
27207
|
if (Object.keys(shape).length > 0) {
|
|
27083
|
-
schemasToIntersect.push(
|
|
27208
|
+
schemasToIntersect.push(z20.object(shape).passthrough());
|
|
27084
27209
|
}
|
|
27085
27210
|
schemasToIntersect.push(...looseRecords);
|
|
27086
27211
|
if (schemasToIntersect.length === 0) {
|
|
27087
|
-
zodSchema2 =
|
|
27212
|
+
zodSchema2 = z20.object({}).passthrough();
|
|
27088
27213
|
} else if (schemasToIntersect.length === 1) {
|
|
27089
27214
|
zodSchema2 = schemasToIntersect[0];
|
|
27090
27215
|
} else {
|
|
27091
|
-
let result =
|
|
27216
|
+
let result = z20.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
27092
27217
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
27093
|
-
result =
|
|
27218
|
+
result = z20.intersection(result, schemasToIntersect[i]);
|
|
27094
27219
|
}
|
|
27095
27220
|
zodSchema2 = result;
|
|
27096
27221
|
}
|
|
27097
27222
|
break;
|
|
27098
27223
|
}
|
|
27099
|
-
const objectSchema =
|
|
27224
|
+
const objectSchema = z20.object(shape);
|
|
27100
27225
|
if (schema.additionalProperties === false) {
|
|
27101
27226
|
zodSchema2 = objectSchema.strict();
|
|
27102
27227
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -27113,33 +27238,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27113
27238
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
27114
27239
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
27115
27240
|
if (rest) {
|
|
27116
|
-
zodSchema2 =
|
|
27241
|
+
zodSchema2 = z20.tuple(tupleItems).rest(rest);
|
|
27117
27242
|
} else {
|
|
27118
|
-
zodSchema2 =
|
|
27243
|
+
zodSchema2 = z20.tuple(tupleItems);
|
|
27119
27244
|
}
|
|
27120
27245
|
if (typeof schema.minItems === "number") {
|
|
27121
|
-
zodSchema2 = zodSchema2.check(
|
|
27246
|
+
zodSchema2 = zodSchema2.check(z20.minLength(schema.minItems));
|
|
27122
27247
|
}
|
|
27123
27248
|
if (typeof schema.maxItems === "number") {
|
|
27124
|
-
zodSchema2 = zodSchema2.check(
|
|
27249
|
+
zodSchema2 = zodSchema2.check(z20.maxLength(schema.maxItems));
|
|
27125
27250
|
}
|
|
27126
27251
|
} else if (Array.isArray(items)) {
|
|
27127
27252
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
27128
27253
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
27129
27254
|
if (rest) {
|
|
27130
|
-
zodSchema2 =
|
|
27255
|
+
zodSchema2 = z20.tuple(tupleItems).rest(rest);
|
|
27131
27256
|
} else {
|
|
27132
|
-
zodSchema2 =
|
|
27257
|
+
zodSchema2 = z20.tuple(tupleItems);
|
|
27133
27258
|
}
|
|
27134
27259
|
if (typeof schema.minItems === "number") {
|
|
27135
|
-
zodSchema2 = zodSchema2.check(
|
|
27260
|
+
zodSchema2 = zodSchema2.check(z20.minLength(schema.minItems));
|
|
27136
27261
|
}
|
|
27137
27262
|
if (typeof schema.maxItems === "number") {
|
|
27138
|
-
zodSchema2 = zodSchema2.check(
|
|
27263
|
+
zodSchema2 = zodSchema2.check(z20.maxLength(schema.maxItems));
|
|
27139
27264
|
}
|
|
27140
27265
|
} else if (items !== void 0) {
|
|
27141
27266
|
const element = convertSchema(items, ctx);
|
|
27142
|
-
let arraySchema =
|
|
27267
|
+
let arraySchema = z20.array(element);
|
|
27143
27268
|
if (typeof schema.minItems === "number") {
|
|
27144
27269
|
arraySchema = arraySchema.min(schema.minItems);
|
|
27145
27270
|
}
|
|
@@ -27148,7 +27273,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27148
27273
|
}
|
|
27149
27274
|
zodSchema2 = arraySchema;
|
|
27150
27275
|
} else {
|
|
27151
|
-
zodSchema2 =
|
|
27276
|
+
zodSchema2 = z20.array(z20.any());
|
|
27152
27277
|
}
|
|
27153
27278
|
break;
|
|
27154
27279
|
}
|
|
@@ -27165,37 +27290,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
27165
27290
|
}
|
|
27166
27291
|
function convertSchema(schema, ctx) {
|
|
27167
27292
|
if (typeof schema === "boolean") {
|
|
27168
|
-
return schema ?
|
|
27293
|
+
return schema ? z20.any() : z20.never();
|
|
27169
27294
|
}
|
|
27170
27295
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
27171
27296
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
27172
27297
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
27173
27298
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
27174
|
-
const anyOfUnion =
|
|
27175
|
-
baseSchema = hasExplicitType ?
|
|
27299
|
+
const anyOfUnion = z20.union(options);
|
|
27300
|
+
baseSchema = hasExplicitType ? z20.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
27176
27301
|
}
|
|
27177
27302
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
27178
27303
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
27179
|
-
const oneOfUnion =
|
|
27180
|
-
baseSchema = hasExplicitType ?
|
|
27304
|
+
const oneOfUnion = z20.xor(options);
|
|
27305
|
+
baseSchema = hasExplicitType ? z20.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
27181
27306
|
}
|
|
27182
27307
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
27183
27308
|
if (schema.allOf.length === 0) {
|
|
27184
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
27309
|
+
baseSchema = hasExplicitType ? baseSchema : z20.any();
|
|
27185
27310
|
} else {
|
|
27186
27311
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
27187
27312
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
27188
27313
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
27189
|
-
result =
|
|
27314
|
+
result = z20.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
27190
27315
|
}
|
|
27191
27316
|
baseSchema = result;
|
|
27192
27317
|
}
|
|
27193
27318
|
}
|
|
27194
27319
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
27195
|
-
baseSchema =
|
|
27320
|
+
baseSchema = z20.nullable(baseSchema);
|
|
27196
27321
|
}
|
|
27197
27322
|
if (schema.readOnly === true) {
|
|
27198
|
-
baseSchema =
|
|
27323
|
+
baseSchema = z20.readonly(baseSchema);
|
|
27199
27324
|
}
|
|
27200
27325
|
const extraMeta = {};
|
|
27201
27326
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -27222,7 +27347,7 @@ function convertSchema(schema, ctx) {
|
|
|
27222
27347
|
}
|
|
27223
27348
|
function fromJSONSchema(schema, params) {
|
|
27224
27349
|
if (typeof schema === "boolean") {
|
|
27225
|
-
return schema ?
|
|
27350
|
+
return schema ? z20.any() : z20.never();
|
|
27226
27351
|
}
|
|
27227
27352
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
27228
27353
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -27236,14 +27361,14 @@ function fromJSONSchema(schema, params) {
|
|
|
27236
27361
|
};
|
|
27237
27362
|
return convertSchema(schema, ctx);
|
|
27238
27363
|
}
|
|
27239
|
-
var
|
|
27364
|
+
var z20, RECOGNIZED_KEYS;
|
|
27240
27365
|
var init_from_json_schema = __esm({
|
|
27241
27366
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
27242
27367
|
init_registries();
|
|
27243
27368
|
init_checks2();
|
|
27244
27369
|
init_iso();
|
|
27245
27370
|
init_schemas2();
|
|
27246
|
-
|
|
27371
|
+
z20 = {
|
|
27247
27372
|
...schemas_exports2,
|
|
27248
27373
|
...checks_exports2,
|
|
27249
27374
|
iso: iso_exports
|