@cleocode/adapters 2026.9.7 → 2026.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1894 -942
- package/dist/index.js.map +2 -2
- package/package.json +5 -5
- package/src/__tests__/claude-code-adapter.test.ts +22 -11
- package/src/__tests__/cursor-adapter.test.ts +11 -1
- package/src/__tests__/opencode-adapter.test.ts +20 -9
- package/src/providers/claude-code/__tests__/hooks-install.test.ts +6 -1
- package/src/providers/cursor/__tests__/hooks-install.test.ts +12 -2
- package/src/providers/opencode/__tests__/hooks-install.test.ts +12 -2
package/dist/index.js
CHANGED
|
@@ -480,7 +480,7 @@ var init_cant_context = __esm({
|
|
|
480
480
|
|
|
481
481
|
// packages/contracts/src/acceptance-gate-schema.ts
|
|
482
482
|
import { z } from "zod";
|
|
483
|
-
var gateBaseSchema, fileAssertionSchema, testGateSchema, fileGateSchema, commandGateSchema, lintGateSchema, httpGateSchema, manualGateSchema, acceptanceGateSchema, gateResultDetailsSchema, acceptanceGateResultSchema, acceptanceItemSchema, acceptanceArraySchema;
|
|
483
|
+
var gateBaseSchema, fileAssertionSchema, testGateSchema, testCountReportSchema, fileGateSchema, commandGateSchema, lintGateSchema, httpGateSchema, manualGateSchema, acceptanceGateSchema, gateResultDetailsSchema, capturedExecutionSchema, gateBindingPathSchema, acceptanceGateBindingSchema, acceptanceGateResultSchema, acceptanceItemSchema, acceptanceArraySchema;
|
|
484
484
|
var init_acceptance_gate_schema = __esm({
|
|
485
485
|
"packages/contracts/src/acceptance-gate-schema.ts"() {
|
|
486
486
|
"use strict";
|
|
@@ -519,6 +519,52 @@ var init_acceptance_gate_schema = __esm({
|
|
|
519
519
|
cwd: z.string().optional(),
|
|
520
520
|
env: z.record(z.string(), z.string()).optional()
|
|
521
521
|
});
|
|
522
|
+
testCountReportSchema = z.object({
|
|
523
|
+
numTotalTests: z.number().int().nonnegative().safe(),
|
|
524
|
+
numPassedTests: z.number().int().nonnegative().safe(),
|
|
525
|
+
numFailedTests: z.number().int().nonnegative().safe(),
|
|
526
|
+
numPendingTests: z.number().int().nonnegative().safe(),
|
|
527
|
+
numTodoTests: z.number().int().nonnegative().safe(),
|
|
528
|
+
numTotalTestSuites: z.number().int().nonnegative().safe(),
|
|
529
|
+
numPassedTestSuites: z.number().int().nonnegative().safe(),
|
|
530
|
+
numFailedTestSuites: z.number().int().nonnegative().safe(),
|
|
531
|
+
numPendingTestSuites: z.number().int().nonnegative().safe(),
|
|
532
|
+
success: z.boolean(),
|
|
533
|
+
testResults: z.array(
|
|
534
|
+
z.object({
|
|
535
|
+
name: z.string().min(1),
|
|
536
|
+
status: z.enum(["passed", "failed"]),
|
|
537
|
+
assertionResults: z.array(
|
|
538
|
+
z.object({
|
|
539
|
+
fullName: z.string(),
|
|
540
|
+
status: z.enum(["passed", "failed", "pending", "skipped", "todo"])
|
|
541
|
+
})
|
|
542
|
+
)
|
|
543
|
+
})
|
|
544
|
+
)
|
|
545
|
+
}).superRefine((report, context) => {
|
|
546
|
+
const assertions = report.testResults.flatMap((file2) => file2.assertionResults);
|
|
547
|
+
const passed = assertions.filter((test) => test.status === "passed").length;
|
|
548
|
+
const failed = assertions.filter((test) => test.status === "failed").length;
|
|
549
|
+
const pending = assertions.filter(
|
|
550
|
+
(test) => test.status === "pending" || test.status === "skipped"
|
|
551
|
+
).length;
|
|
552
|
+
const todo = assertions.filter((test) => test.status === "todo").length;
|
|
553
|
+
if (report.numTotalTests !== assertions.length || report.numPassedTests !== passed || report.numFailedTests !== failed || report.numPendingTests !== pending || report.numTodoTests !== todo) {
|
|
554
|
+
context.addIssue({
|
|
555
|
+
code: "custom",
|
|
556
|
+
message: "Test counters disagree with assertion results"
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
if (report.numTotalTestSuites !== report.numPassedTestSuites + report.numFailedTestSuites + report.numPendingTestSuites) {
|
|
560
|
+
context.addIssue({ code: "custom", message: "Suite counters are inconsistent" });
|
|
561
|
+
}
|
|
562
|
+
if (report.testResults.some(
|
|
563
|
+
(file2) => file2.status === "passed" && file2.assertionResults.some((test) => test.status === "failed")
|
|
564
|
+
) || report.success && (failed > 0 || report.numFailedTestSuites > 0 || report.testResults.some((file2) => file2.status === "failed"))) {
|
|
565
|
+
context.addIssue({ code: "custom", message: "Success status contradicts failed results" });
|
|
566
|
+
}
|
|
567
|
+
});
|
|
522
568
|
fileGateSchema = gateBaseSchema.extend({
|
|
523
569
|
kind: z.literal("file"),
|
|
524
570
|
/** Absolute or project-root-relative file path. Mutually exclusive with `attachmentSha256`. */
|
|
@@ -608,7 +654,116 @@ var init_acceptance_gate_schema = __esm({
|
|
|
608
654
|
accepted: z.boolean()
|
|
609
655
|
})
|
|
610
656
|
]);
|
|
657
|
+
capturedExecutionSchema = z.object({
|
|
658
|
+
started: z.boolean(),
|
|
659
|
+
targetPid: z.number().int().positive().safe().nullable(),
|
|
660
|
+
exitCode: z.number().int().nonnegative().safe().nullable(),
|
|
661
|
+
signal: z.string().min(1).nullable(),
|
|
662
|
+
error: z.string().nullable(),
|
|
663
|
+
stopped: z.enum([
|
|
664
|
+
"deadline",
|
|
665
|
+
"cancelled",
|
|
666
|
+
"teardown",
|
|
667
|
+
"output-limit",
|
|
668
|
+
"resource-limit",
|
|
669
|
+
"transport-error"
|
|
670
|
+
]).nullable(),
|
|
671
|
+
stdout: z.string(),
|
|
672
|
+
stderr: z.string(),
|
|
673
|
+
outputTruncated: z.boolean(),
|
|
674
|
+
durationMs: z.number().finite().nonnegative(),
|
|
675
|
+
mode: z.enum(["systemd", "pgid"]),
|
|
676
|
+
unitName: z.string().min(1).optional(),
|
|
677
|
+
nativeMemory: z.enum(["unverified", "observed-cgroup"]),
|
|
678
|
+
resourceLimits: z.object({
|
|
679
|
+
cgroup: z.string().startsWith("/"),
|
|
680
|
+
memoryMaxBytes: z.number().int().positive().safe().nullable(),
|
|
681
|
+
tasksMax: z.number().int().positive().safe().nullable()
|
|
682
|
+
}).strict().optional(),
|
|
683
|
+
cleanupScope: z.enum(["process-group", "direct-child"]),
|
|
684
|
+
transportClosed: z.literal(true),
|
|
685
|
+
targetCloseObserved: z.boolean(),
|
|
686
|
+
cleanupObservation: z.enum([
|
|
687
|
+
"scope-terminal",
|
|
688
|
+
"process-group-absent",
|
|
689
|
+
"process-group-signalled",
|
|
690
|
+
"unverified"
|
|
691
|
+
]),
|
|
692
|
+
cleanupErrors: z.array(z.string())
|
|
693
|
+
}).strict().superRefine((execution, context) => {
|
|
694
|
+
if (execution.started !== (execution.targetPid !== null) || !execution.started && (execution.exitCode !== null || execution.signal !== null) || execution.exitCode !== null && execution.signal !== null || !execution.targetCloseObserved && (execution.exitCode !== null || execution.signal !== null))
|
|
695
|
+
context.addIssue({ code: "custom", message: "Contradictory target lifecycle observation" });
|
|
696
|
+
if (execution.nativeMemory === "observed-cgroup" && !execution.resourceLimits?.memoryMaxBytes)
|
|
697
|
+
context.addIssue({
|
|
698
|
+
code: "custom",
|
|
699
|
+
message: "Observed native-memory claim requires a finite kernel limit"
|
|
700
|
+
});
|
|
701
|
+
if (execution.resourceLimits && (execution.mode !== "systemd" || !execution.unitName || !execution.resourceLimits.cgroup.split("/").includes(execution.unitName) || execution.resourceLimits.cgroup.split("/").includes("..")))
|
|
702
|
+
context.addIssue({
|
|
703
|
+
code: "custom",
|
|
704
|
+
message: "Resource observation must name the exact owned scope"
|
|
705
|
+
});
|
|
706
|
+
if (execution.cleanupObservation === "scope-terminal" && (execution.mode !== "systemd" || !execution.unitName))
|
|
707
|
+
context.addIssue({
|
|
708
|
+
code: "custom",
|
|
709
|
+
message: "Terminal scope observation requires an identified systemd scope"
|
|
710
|
+
});
|
|
711
|
+
});
|
|
712
|
+
gateBindingPathSchema = z.string().min(1).refine(
|
|
713
|
+
(value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value) && !value.includes("\0"),
|
|
714
|
+
"Captured gate paths must be absolute and contain no null byte"
|
|
715
|
+
);
|
|
716
|
+
acceptanceGateBindingSchema = z.object({
|
|
717
|
+
version: z.literal(1),
|
|
718
|
+
verificationId: z.string().uuid(),
|
|
719
|
+
identity: z.object({
|
|
720
|
+
projectId: z.string().min(1),
|
|
721
|
+
projectRoot: gateBindingPathSchema,
|
|
722
|
+
actor: z.string().min(1),
|
|
723
|
+
operation: z.literal("check.gate.verify"),
|
|
724
|
+
idempotencyKey: z.string().min(1)
|
|
725
|
+
}).strict(),
|
|
726
|
+
taskId: z.string().min(1),
|
|
727
|
+
criterionId: z.string().uuid(),
|
|
728
|
+
criterionHash: z.string().regex(/^[a-f0-9]{64}$/),
|
|
729
|
+
gateHash: z.string().regex(/^[a-f0-9]{64}$/),
|
|
730
|
+
capturedAt: z.string().datetime(),
|
|
731
|
+
deadlineAt: z.number().int().positive().safe(),
|
|
732
|
+
invocation: z.object({
|
|
733
|
+
command: z.string().min(1),
|
|
734
|
+
args: z.array(z.string()),
|
|
735
|
+
cwd: gateBindingPathSchema,
|
|
736
|
+
environmentHash: z.string().regex(/^[a-f0-9]{64}$/)
|
|
737
|
+
}).strict().optional(),
|
|
738
|
+
artifacts: z.array(
|
|
739
|
+
z.object({
|
|
740
|
+
path: gateBindingPathSchema,
|
|
741
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/).nullable(),
|
|
742
|
+
bytes: z.number().int().nonnegative().safe().nullable()
|
|
743
|
+
}).strict().superRefine((artifact, context) => {
|
|
744
|
+
if (artifact.sha256 === null !== (artifact.bytes === null))
|
|
745
|
+
context.addIssue({
|
|
746
|
+
code: "custom",
|
|
747
|
+
message: "Absent input requires both null digest and size"
|
|
748
|
+
});
|
|
749
|
+
})
|
|
750
|
+
)
|
|
751
|
+
}).strict().superRefine((binding, context) => {
|
|
752
|
+
if (new Set(binding.artifacts.map(({ path }) => path)).size !== binding.artifacts.length)
|
|
753
|
+
context.addIssue({
|
|
754
|
+
code: "custom",
|
|
755
|
+
path: ["artifacts"],
|
|
756
|
+
message: "Input paths must be unique"
|
|
757
|
+
});
|
|
758
|
+
if (Date.parse(binding.capturedAt) >= binding.deadlineAt)
|
|
759
|
+
context.addIssue({
|
|
760
|
+
code: "custom",
|
|
761
|
+
path: ["deadlineAt"],
|
|
762
|
+
message: "Input capture must precede the original deadline"
|
|
763
|
+
});
|
|
764
|
+
});
|
|
611
765
|
acceptanceGateResultSchema = z.object({
|
|
766
|
+
binding: acceptanceGateBindingSchema.optional(),
|
|
612
767
|
index: z.number().int().nonnegative(),
|
|
613
768
|
req: z.string().optional(),
|
|
614
769
|
kind: z.enum(["test", "file", "command", "lint", "http", "manual"]),
|
|
@@ -616,11 +771,57 @@ var init_acceptance_gate_schema = __esm({
|
|
|
616
771
|
durationMs: z.number().nonnegative(),
|
|
617
772
|
/** Typed kind-specific detail payload (T802). */
|
|
618
773
|
details: gateResultDetailsSchema.optional(),
|
|
774
|
+
/** Actual target/transport/containment observations when supplied by the runner. */
|
|
775
|
+
execution: capturedExecutionSchema.optional(),
|
|
619
776
|
evidence: z.string().optional(),
|
|
620
777
|
errorMessage: z.string().optional(),
|
|
621
778
|
/** ISO 8601 timestamp. */
|
|
622
779
|
checkedAt: z.string().datetime(),
|
|
623
780
|
checkedBy: z.string().min(1)
|
|
781
|
+
}).superRefine((result, context) => {
|
|
782
|
+
const binding = result.binding;
|
|
783
|
+
if (binding) {
|
|
784
|
+
if (binding.identity.actor !== result.checkedBy)
|
|
785
|
+
context.addIssue({
|
|
786
|
+
code: "custom",
|
|
787
|
+
path: ["binding", "identity", "actor"],
|
|
788
|
+
message: "Result actor must match captured operation identity"
|
|
789
|
+
});
|
|
790
|
+
if (Date.parse(binding.capturedAt) > Date.parse(result.checkedAt))
|
|
791
|
+
context.addIssue({
|
|
792
|
+
code: "custom",
|
|
793
|
+
path: ["binding", "capturedAt"],
|
|
794
|
+
message: "Result cannot precede input capture"
|
|
795
|
+
});
|
|
796
|
+
const executable = ["test", "command", "lint"].includes(result.kind);
|
|
797
|
+
if (executable && !binding.invocation)
|
|
798
|
+
context.addIssue({
|
|
799
|
+
code: "custom",
|
|
800
|
+
path: ["binding", "invocation"],
|
|
801
|
+
message: "Executable gate requires captured invocation"
|
|
802
|
+
});
|
|
803
|
+
if (["pass", "fail", "warn"].includes(result.result)) {
|
|
804
|
+
if (executable && !result.execution)
|
|
805
|
+
context.addIssue({
|
|
806
|
+
code: "custom",
|
|
807
|
+
path: ["execution"],
|
|
808
|
+
message: "Bound executable verdict requires process observation"
|
|
809
|
+
});
|
|
810
|
+
if (Date.parse(result.checkedAt) > binding.deadlineAt)
|
|
811
|
+
context.addIssue({
|
|
812
|
+
code: "custom",
|
|
813
|
+
path: ["checkedAt"],
|
|
814
|
+
message: "Verdict exceeds the original admitted deadline"
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
const execution = result.execution;
|
|
819
|
+
if (execution && ["pass", "fail", "warn"].includes(result.result) && (!execution.started || !execution.targetCloseObserved || execution.exitCode === null || execution.signal !== null || execution.error !== null || execution.stopped !== null || execution.outputTruncated || execution.cleanupErrors.length > 0))
|
|
820
|
+
context.addIssue({
|
|
821
|
+
code: "custom",
|
|
822
|
+
path: ["execution"],
|
|
823
|
+
message: "Incomplete process observation cannot establish a gate verdict"
|
|
824
|
+
});
|
|
624
825
|
});
|
|
625
826
|
acceptanceItemSchema = z.union([
|
|
626
827
|
z.string().trim().min(1, {
|
|
@@ -1502,11 +1703,46 @@ var init_docs_taxonomy = __esm({
|
|
|
1502
1703
|
});
|
|
1503
1704
|
|
|
1504
1705
|
// packages/contracts/src/operations/docs.ts
|
|
1505
|
-
|
|
1706
|
+
import { z as z7 } from "zod";
|
|
1707
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA, DOCS_PROJECTION_RECEIPT_SCHEMA, DOCS_LIFECYCLE_STATUSES;
|
|
1506
1708
|
var init_docs = __esm({
|
|
1507
1709
|
"packages/contracts/src/operations/docs.ts"() {
|
|
1508
1710
|
"use strict";
|
|
1509
1711
|
init_docs_taxonomy();
|
|
1712
|
+
DOCS_PROJECTION_PROPOSAL_SCHEMA = z7.object({
|
|
1713
|
+
version: z7.literal(1),
|
|
1714
|
+
operation: z7.literal("docs.projection"),
|
|
1715
|
+
identity: z7.object({
|
|
1716
|
+
projectId: z7.string().min(1),
|
|
1717
|
+
projectRoot: z7.string().min(1),
|
|
1718
|
+
actor: z7.string().min(1),
|
|
1719
|
+
operation: z7.literal("docs.projection"),
|
|
1720
|
+
idempotencyKey: z7.string().min(1)
|
|
1721
|
+
}).strict(),
|
|
1722
|
+
source: z7.object({
|
|
1723
|
+
attachmentId: z7.string().min(1),
|
|
1724
|
+
sha256: z7.string().regex(/^[a-f0-9]{64}$/),
|
|
1725
|
+
ownerId: z7.string().min(1),
|
|
1726
|
+
ownerType: z7.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
1727
|
+
label: z7.string().min(1)
|
|
1728
|
+
}).strict(),
|
|
1729
|
+
observation: z7.object({
|
|
1730
|
+
kind: z7.literal("doc-attachment"),
|
|
1731
|
+
attachmentId: z7.string().min(1),
|
|
1732
|
+
ownerId: z7.string().min(1),
|
|
1733
|
+
addedAt: z7.string().min(1),
|
|
1734
|
+
slug: z7.string().optional(),
|
|
1735
|
+
type: z7.string().optional()
|
|
1736
|
+
}).strict()
|
|
1737
|
+
}).strict();
|
|
1738
|
+
DOCS_PROJECTION_RECEIPT_SCHEMA = z7.object({
|
|
1739
|
+
version: z7.literal(1),
|
|
1740
|
+
sourceHash: z7.string().regex(/^[a-f0-9]{64}$/),
|
|
1741
|
+
graph: z7.enum(["completed", "disabled"]),
|
|
1742
|
+
observationId: z7.string().min(1),
|
|
1743
|
+
verifiedAt: z7.string().min(1),
|
|
1744
|
+
actor: z7.string().min(1)
|
|
1745
|
+
}).strict();
|
|
1510
1746
|
DOCS_LIFECYCLE_STATUSES = [
|
|
1511
1747
|
"draft",
|
|
1512
1748
|
"proposed",
|
|
@@ -2038,7 +2274,7 @@ var init_service = __esm({
|
|
|
2038
2274
|
});
|
|
2039
2275
|
|
|
2040
2276
|
// packages/contracts/src/operations/output-contracts-data.ts
|
|
2041
|
-
var tasksShowOutputContract, tasksListOutputContract, tasksFindOutputContract, TASK_MUTATION_DATA_SCHEMA, tasksAddOutputContract, tasksAddBatchOutputContract, tasksUpdateOutputContract, tasksCompleteOutputContract, tasksReorderRankOutputContract, tasksBulkMoveOutputContract, tasksAssigneeOutputContract, adminConfigGetOutputContract, adminConfigListOutputContract, adminConfigValidateOutputContract, adminConfigUnsetOutputContract, OUTPUT_CONTRACTS;
|
|
2277
|
+
var tasksShowOutputContract, taskPopulationSchema, tasksListOutputContract, tasksFindOutputContract, TASK_MUTATION_DATA_SCHEMA, tasksAddOutputContract, tasksAddBatchOutputContract, tasksUpdateOutputContract, tasksCompleteOutputContract, tasksReorderRankOutputContract, tasksBulkMoveOutputContract, tasksAssigneeOutputContract, adminConfigGetOutputContract, adminConfigListOutputContract, adminConfigValidateOutputContract, adminConfigUnsetOutputContract, OUTPUT_CONTRACTS;
|
|
2042
2278
|
var init_output_contracts_data = __esm({
|
|
2043
2279
|
"packages/contracts/src/operations/output-contracts-data.ts"() {
|
|
2044
2280
|
"use strict";
|
|
@@ -2105,12 +2341,27 @@ var init_output_contracts_data = __esm({
|
|
|
2105
2341
|
"/data/view/title"
|
|
2106
2342
|
]
|
|
2107
2343
|
};
|
|
2344
|
+
taskPopulationSchema = {
|
|
2345
|
+
type: "object",
|
|
2346
|
+
required: ["matched", "returned", "truncated", "archive", "limit", "offset"],
|
|
2347
|
+
properties: {
|
|
2348
|
+
matched: { type: "number", description: "All rows matching the query before pagination." },
|
|
2349
|
+
returned: {
|
|
2350
|
+
type: "number",
|
|
2351
|
+
description: "Rows present in this response; also --output count."
|
|
2352
|
+
},
|
|
2353
|
+
truncated: { type: "boolean", description: "Matching rows are omitted by this page." },
|
|
2354
|
+
archive: { type: "string", enum: ["included", "excluded", "only"] },
|
|
2355
|
+
limit: { type: ["number", "null"] },
|
|
2356
|
+
offset: { type: "number" }
|
|
2357
|
+
}
|
|
2358
|
+
};
|
|
2108
2359
|
tasksListOutputContract = {
|
|
2109
2360
|
operation: "tasks.list",
|
|
2110
2361
|
shapeNote: "Rows are under /data/tasks (an array); counts are /data/total and /data/filtered.",
|
|
2111
2362
|
dataSchema: {
|
|
2112
2363
|
type: "object",
|
|
2113
|
-
required: ["tasks", "total", "filtered"],
|
|
2364
|
+
required: ["tasks", "total", "filtered", "population"],
|
|
2114
2365
|
additionalProperties: true,
|
|
2115
2366
|
properties: {
|
|
2116
2367
|
tasks: {
|
|
@@ -2126,7 +2377,8 @@ var init_output_contracts_data = __esm({
|
|
|
2126
2377
|
}
|
|
2127
2378
|
},
|
|
2128
2379
|
total: { type: "number", description: "Total tasks before filtering." },
|
|
2129
|
-
filtered: { type: "number", description: "Number of tasks after filters applied." }
|
|
2380
|
+
filtered: { type: "number", description: "Number of tasks after filters applied." },
|
|
2381
|
+
population: taskPopulationSchema
|
|
2130
2382
|
}
|
|
2131
2383
|
},
|
|
2132
2384
|
fieldPointers: [
|
|
@@ -2134,7 +2386,10 @@ var init_output_contracts_data = __esm({
|
|
|
2134
2386
|
"/data/tasks/0/title",
|
|
2135
2387
|
"/data/tasks/0/status",
|
|
2136
2388
|
"/data/total",
|
|
2137
|
-
"/data/filtered"
|
|
2389
|
+
"/data/filtered",
|
|
2390
|
+
"/data/population/matched",
|
|
2391
|
+
"/data/population/returned",
|
|
2392
|
+
"/data/population/archive"
|
|
2138
2393
|
]
|
|
2139
2394
|
};
|
|
2140
2395
|
tasksFindOutputContract = {
|
|
@@ -2142,7 +2397,7 @@ var init_output_contracts_data = __esm({
|
|
|
2142
2397
|
shapeNote: "Results are wrapped: /data/results (array of matches), /data/total (count). Use /data/results/0/id \u2014 NOT /data/0/id.",
|
|
2143
2398
|
dataSchema: {
|
|
2144
2399
|
type: "object",
|
|
2145
|
-
required: ["results", "total"],
|
|
2400
|
+
required: ["results", "total", "population"],
|
|
2146
2401
|
additionalProperties: true,
|
|
2147
2402
|
properties: {
|
|
2148
2403
|
results: {
|
|
@@ -2159,15 +2414,24 @@ var init_output_contracts_data = __esm({
|
|
|
2159
2414
|
}
|
|
2160
2415
|
},
|
|
2161
2416
|
total: { type: "number", description: "Total matching tasks." },
|
|
2417
|
+
population: taskPopulationSchema,
|
|
2162
2418
|
query: { type: "string", description: "The query string that was searched." },
|
|
2163
|
-
searchType: {
|
|
2419
|
+
searchType: {
|
|
2420
|
+
type: "string",
|
|
2421
|
+
description: "Requested matching mode: lexical (default), fuzzy (explicit opt-in), exact, id, or filter."
|
|
2422
|
+
}
|
|
2164
2423
|
}
|
|
2165
2424
|
},
|
|
2166
2425
|
fieldPointers: [
|
|
2167
2426
|
"/data/results/0/id",
|
|
2168
2427
|
"/data/results/0/title",
|
|
2169
2428
|
"/data/results/0/status",
|
|
2170
|
-
"/data/
|
|
2429
|
+
"/data/results/0/match",
|
|
2430
|
+
"/data/searchType",
|
|
2431
|
+
"/data/total",
|
|
2432
|
+
"/data/population/matched",
|
|
2433
|
+
"/data/population/returned",
|
|
2434
|
+
"/data/population/archive"
|
|
2171
2435
|
]
|
|
2172
2436
|
};
|
|
2173
2437
|
TASK_MUTATION_DATA_SCHEMA = {
|
|
@@ -2454,6 +2718,7 @@ var init_tasks = __esm({
|
|
|
2454
2718
|
enum: ["pending", "active", "blocked", "done", "cancelled"]
|
|
2455
2719
|
},
|
|
2456
2720
|
priority: { type: "string", enum: ["low", "medium", "high", "critical"] },
|
|
2721
|
+
phase: { type: "string" },
|
|
2457
2722
|
notes: { type: "string" },
|
|
2458
2723
|
labels: { type: "array", items: { type: "string" } },
|
|
2459
2724
|
addLabels: { type: "array", items: { type: "string" } },
|
|
@@ -2479,6 +2744,7 @@ var init_tasks = __esm({
|
|
|
2479
2744
|
dependsWaiver: { type: "string" },
|
|
2480
2745
|
blockedBy: { type: "string" },
|
|
2481
2746
|
clearBlockedBy: { type: "boolean" },
|
|
2747
|
+
noAutoComplete: { type: "boolean" },
|
|
2482
2748
|
relates: {
|
|
2483
2749
|
type: "array",
|
|
2484
2750
|
items: {
|
|
@@ -2530,14 +2796,142 @@ var init_tasks = __esm({
|
|
|
2530
2796
|
});
|
|
2531
2797
|
|
|
2532
2798
|
// packages/contracts/src/dispatch/operations-registry.ts
|
|
2533
|
-
var OPERATIONS;
|
|
2799
|
+
var requirementTaskParam, OPERATIONS;
|
|
2534
2800
|
var init_operations_registry = __esm({
|
|
2535
2801
|
"packages/contracts/src/dispatch/operations-registry.ts"() {
|
|
2536
2802
|
"use strict";
|
|
2537
2803
|
init_docs();
|
|
2538
2804
|
init_output_contracts_data();
|
|
2539
2805
|
init_tasks();
|
|
2806
|
+
requirementTaskParam = {
|
|
2807
|
+
name: "taskId",
|
|
2808
|
+
type: "string",
|
|
2809
|
+
required: true,
|
|
2810
|
+
description: "Task that owns the requirement gates",
|
|
2811
|
+
cli: { positional: true }
|
|
2812
|
+
};
|
|
2540
2813
|
OPERATIONS = [
|
|
2814
|
+
{
|
|
2815
|
+
gateway: "mutate",
|
|
2816
|
+
domain: "tasks",
|
|
2817
|
+
operation: "req.add",
|
|
2818
|
+
description: "Add a validated typed requirement gate without executing it",
|
|
2819
|
+
tier: 1,
|
|
2820
|
+
idempotent: false,
|
|
2821
|
+
sessionRequired: true,
|
|
2822
|
+
requiredParams: ["taskId", "gate"],
|
|
2823
|
+
params: [
|
|
2824
|
+
requirementTaskParam,
|
|
2825
|
+
{
|
|
2826
|
+
name: "gate",
|
|
2827
|
+
type: "string",
|
|
2828
|
+
required: true,
|
|
2829
|
+
description: "AcceptanceGate JSON; must include kind, description and kind-specific fields",
|
|
2830
|
+
cli: { flag: "gate" }
|
|
2831
|
+
}
|
|
2832
|
+
],
|
|
2833
|
+
inputSchema: {
|
|
2834
|
+
operation: "tasks.req.add",
|
|
2835
|
+
schema: {
|
|
2836
|
+
type: "object",
|
|
2837
|
+
required: ["taskId", "gate"],
|
|
2838
|
+
additionalProperties: false,
|
|
2839
|
+
properties: {
|
|
2840
|
+
taskId: { type: "string", minLength: 1 },
|
|
2841
|
+
gate: { type: "string", minLength: 1 }
|
|
2842
|
+
}
|
|
2843
|
+
},
|
|
2844
|
+
examples: [
|
|
2845
|
+
{
|
|
2846
|
+
name: "test",
|
|
2847
|
+
value: {
|
|
2848
|
+
taskId: "T121",
|
|
2849
|
+
gate: '{"kind":"test","command":"node","args":["verify.mjs"],"expect":"exit0","description":"Task harness passes","req":"PARTNER-121"}'
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
]
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
gateway: "query",
|
|
2857
|
+
domain: "tasks",
|
|
2858
|
+
operation: "req.list",
|
|
2859
|
+
description: "List named typed requirement gates without executing them",
|
|
2860
|
+
tier: 1,
|
|
2861
|
+
idempotent: true,
|
|
2862
|
+
sessionRequired: false,
|
|
2863
|
+
requiredParams: ["taskId"],
|
|
2864
|
+
params: [requirementTaskParam],
|
|
2865
|
+
inputSchema: {
|
|
2866
|
+
operation: "tasks.req.list",
|
|
2867
|
+
schema: {
|
|
2868
|
+
type: "object",
|
|
2869
|
+
required: ["taskId"],
|
|
2870
|
+
additionalProperties: false,
|
|
2871
|
+
properties: { taskId: { type: "string", minLength: 1 } }
|
|
2872
|
+
},
|
|
2873
|
+
examples: [{ name: "task", value: { taskId: "T121" } }]
|
|
2874
|
+
}
|
|
2875
|
+
},
|
|
2876
|
+
{
|
|
2877
|
+
gateway: "query",
|
|
2878
|
+
domain: "tasks",
|
|
2879
|
+
operation: "req.migrate.preview",
|
|
2880
|
+
description: "Preview typed-gate migration proposals without writing",
|
|
2881
|
+
tier: 1,
|
|
2882
|
+
idempotent: true,
|
|
2883
|
+
sessionRequired: false,
|
|
2884
|
+
requiredParams: ["taskId"],
|
|
2885
|
+
params: [
|
|
2886
|
+
requirementTaskParam,
|
|
2887
|
+
{
|
|
2888
|
+
name: "apply",
|
|
2889
|
+
type: "boolean",
|
|
2890
|
+
required: false,
|
|
2891
|
+
description: "Must be absent or false for preview"
|
|
2892
|
+
}
|
|
2893
|
+
],
|
|
2894
|
+
inputSchema: {
|
|
2895
|
+
operation: "tasks.req.migrate.preview",
|
|
2896
|
+
schema: {
|
|
2897
|
+
type: "object",
|
|
2898
|
+
required: ["taskId"],
|
|
2899
|
+
additionalProperties: false,
|
|
2900
|
+
properties: { taskId: { type: "string", minLength: 1 }, apply: { const: false } }
|
|
2901
|
+
},
|
|
2902
|
+
examples: [{ name: "preview", value: { taskId: "T121", apply: false } }]
|
|
2903
|
+
}
|
|
2904
|
+
},
|
|
2905
|
+
{
|
|
2906
|
+
gateway: "mutate",
|
|
2907
|
+
domain: "tasks",
|
|
2908
|
+
operation: "req.migrate",
|
|
2909
|
+
description: "Explicitly apply validated typed-gate migration proposals",
|
|
2910
|
+
tier: 1,
|
|
2911
|
+
idempotent: false,
|
|
2912
|
+
sessionRequired: true,
|
|
2913
|
+
requiredParams: ["taskId", "apply"],
|
|
2914
|
+
params: [
|
|
2915
|
+
requirementTaskParam,
|
|
2916
|
+
{
|
|
2917
|
+
name: "apply",
|
|
2918
|
+
type: "boolean",
|
|
2919
|
+
required: true,
|
|
2920
|
+
description: "Must be true to apply proposals",
|
|
2921
|
+
cli: { flag: "apply" }
|
|
2922
|
+
}
|
|
2923
|
+
],
|
|
2924
|
+
inputSchema: {
|
|
2925
|
+
operation: "tasks.req.migrate",
|
|
2926
|
+
schema: {
|
|
2927
|
+
type: "object",
|
|
2928
|
+
required: ["taskId", "apply"],
|
|
2929
|
+
additionalProperties: false,
|
|
2930
|
+
properties: { taskId: { type: "string", minLength: 1 }, apply: { const: true } }
|
|
2931
|
+
},
|
|
2932
|
+
examples: [{ name: "apply", value: { taskId: "T121", apply: true } }]
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2541
2935
|
{
|
|
2542
2936
|
gateway: "query",
|
|
2543
2937
|
domain: "tasks",
|
|
@@ -2772,6 +3166,13 @@ var init_operations_registry = __esm({
|
|
|
2772
3166
|
sessionRequired: false,
|
|
2773
3167
|
requiredParams: [],
|
|
2774
3168
|
params: [
|
|
3169
|
+
{
|
|
3170
|
+
name: "includeArchive",
|
|
3171
|
+
type: "boolean",
|
|
3172
|
+
required: false,
|
|
3173
|
+
description: "Include archived rows under the same filters",
|
|
3174
|
+
cli: { flag: "include-archive" }
|
|
3175
|
+
},
|
|
2775
3176
|
{ name: "parent", type: "string", required: false, description: "Filter by parent task ID" },
|
|
2776
3177
|
{ name: "status", type: "string", required: false, description: "Filter by task status" },
|
|
2777
3178
|
{ name: "priority", type: "string", required: false, description: "Filter by task priority" },
|
|
@@ -2800,7 +3201,7 @@ var init_operations_registry = __esm({
|
|
|
2800
3201
|
name: "limit",
|
|
2801
3202
|
type: "number",
|
|
2802
3203
|
required: false,
|
|
2803
|
-
description: "Maximum number of tasks to return (default 10).
|
|
3204
|
+
description: "Maximum number of tasks to return (default 10). --all or --limit 0 returns every match."
|
|
2804
3205
|
},
|
|
2805
3206
|
{
|
|
2806
3207
|
name: "offset",
|
|
@@ -4932,7 +5333,7 @@ var init_operations_registry = __esm({
|
|
|
4932
5333
|
type: "string",
|
|
4933
5334
|
required: false,
|
|
4934
5335
|
description: "Task type",
|
|
4935
|
-
enum: ["epic", "task", "subtask"],
|
|
5336
|
+
enum: ["saga", "epic", "task", "subtask"],
|
|
4936
5337
|
cli: { flag: "type", short: "-t" }
|
|
4937
5338
|
},
|
|
4938
5339
|
{
|
|
@@ -4984,6 +5385,72 @@ var init_operations_registry = __esm({
|
|
|
4984
5385
|
required: false,
|
|
4985
5386
|
description: "Initial note entry for the task",
|
|
4986
5387
|
cli: { flag: "notes" }
|
|
5388
|
+
},
|
|
5389
|
+
{
|
|
5390
|
+
name: "dependsWaiver",
|
|
5391
|
+
type: "string",
|
|
5392
|
+
required: false,
|
|
5393
|
+
description: "Nonempty reason waiving dependencies for explicit critical priority",
|
|
5394
|
+
cli: { flag: "depends-waiver" }
|
|
5395
|
+
},
|
|
5396
|
+
{
|
|
5397
|
+
name: "files",
|
|
5398
|
+
type: "array",
|
|
5399
|
+
required: false,
|
|
5400
|
+
description: "Associated repository file paths",
|
|
5401
|
+
cli: { flag: "files" }
|
|
5402
|
+
},
|
|
5403
|
+
{
|
|
5404
|
+
name: "dryRun",
|
|
5405
|
+
type: "boolean",
|
|
5406
|
+
required: false,
|
|
5407
|
+
description: "Preview creation without task or committed audit writes",
|
|
5408
|
+
cli: { flag: "dry-run" }
|
|
5409
|
+
},
|
|
5410
|
+
{
|
|
5411
|
+
name: "parentSearch",
|
|
5412
|
+
type: "string",
|
|
5413
|
+
required: false,
|
|
5414
|
+
description: "Search term for resolving the parent task",
|
|
5415
|
+
cli: { flag: "parent-search" }
|
|
5416
|
+
},
|
|
5417
|
+
{
|
|
5418
|
+
name: "kind",
|
|
5419
|
+
type: "string",
|
|
5420
|
+
required: false,
|
|
5421
|
+
description: "Task intent, independent of hierarchy",
|
|
5422
|
+
enum: ["work", "research", "experiment", "bug", "spike", "release"],
|
|
5423
|
+
cli: { flag: "kind" }
|
|
5424
|
+
},
|
|
5425
|
+
{
|
|
5426
|
+
name: "scope",
|
|
5427
|
+
type: "string",
|
|
5428
|
+
required: false,
|
|
5429
|
+
description: "Task granularity",
|
|
5430
|
+
enum: ["project", "feature", "unit"],
|
|
5431
|
+
cli: { flag: "scope" }
|
|
5432
|
+
},
|
|
5433
|
+
{
|
|
5434
|
+
name: "severity",
|
|
5435
|
+
type: "string",
|
|
5436
|
+
required: false,
|
|
5437
|
+
description: "Project-authorized severity with transactional signed evidence",
|
|
5438
|
+
enum: ["P0", "P1", "P2", "P3"],
|
|
5439
|
+
cli: { flag: "severity" }
|
|
5440
|
+
},
|
|
5441
|
+
{
|
|
5442
|
+
name: "forceDuplicate",
|
|
5443
|
+
type: "boolean",
|
|
5444
|
+
required: false,
|
|
5445
|
+
description: "Bypass duplicate rejection with committed decision provenance",
|
|
5446
|
+
cli: { flag: "force-duplicate" }
|
|
5447
|
+
},
|
|
5448
|
+
{
|
|
5449
|
+
name: "autoDecompose",
|
|
5450
|
+
type: "boolean",
|
|
5451
|
+
required: false,
|
|
5452
|
+
description: "Move the parent's text acceptance criteria onto a new first subtask when they would otherwise block this add (PM-Core V2 design-point 3) (T12298)",
|
|
5453
|
+
cli: { flag: "auto-decompose" }
|
|
4987
5454
|
}
|
|
4988
5455
|
]
|
|
4989
5456
|
},
|
|
@@ -5218,6 +5685,20 @@ var init_operations_registry = __esm({
|
|
|
5218
5685
|
type: "array",
|
|
5219
5686
|
required: false,
|
|
5220
5687
|
description: "Remove related-task edges by taskId"
|
|
5688
|
+
},
|
|
5689
|
+
{
|
|
5690
|
+
name: "phase",
|
|
5691
|
+
type: "string",
|
|
5692
|
+
required: false,
|
|
5693
|
+
description: "Project-defined phase, independent of pipeline stage",
|
|
5694
|
+
cli: { flag: "phase" }
|
|
5695
|
+
},
|
|
5696
|
+
{
|
|
5697
|
+
name: "noAutoComplete",
|
|
5698
|
+
type: "boolean",
|
|
5699
|
+
required: false,
|
|
5700
|
+
description: "Disable automatic parent completion",
|
|
5701
|
+
cli: { flag: "no-auto-complete" }
|
|
5221
5702
|
}
|
|
5222
5703
|
],
|
|
5223
5704
|
inputSchema: tasksUpdateInputContract,
|
|
@@ -5288,6 +5769,88 @@ var init_operations_registry = __esm({
|
|
|
5288
5769
|
required: true,
|
|
5289
5770
|
description: "taskId parameter",
|
|
5290
5771
|
cli: { positional: true }
|
|
5772
|
+
},
|
|
5773
|
+
{
|
|
5774
|
+
name: "force",
|
|
5775
|
+
type: "boolean",
|
|
5776
|
+
required: false,
|
|
5777
|
+
description: "Allow dependents and orphan children unless cascade is enabled"
|
|
5778
|
+
},
|
|
5779
|
+
{
|
|
5780
|
+
name: "cascade",
|
|
5781
|
+
type: "boolean",
|
|
5782
|
+
required: false,
|
|
5783
|
+
description: "Archive all descendants with the selected task"
|
|
5784
|
+
}
|
|
5785
|
+
]
|
|
5786
|
+
},
|
|
5787
|
+
{
|
|
5788
|
+
gateway: "mutate",
|
|
5789
|
+
domain: "tasks",
|
|
5790
|
+
operation: "reconcile-scope",
|
|
5791
|
+
description: "tasks.reconcile-scope (mutate) \u2014 sweep a saga/epic subtree for tasks whose scope overlaps and propose merge/absorb/split/link; read-only unless --apply",
|
|
5792
|
+
tier: 1,
|
|
5793
|
+
idempotent: true,
|
|
5794
|
+
sessionRequired: false,
|
|
5795
|
+
requiredParams: ["rootId"],
|
|
5796
|
+
params: [
|
|
5797
|
+
{
|
|
5798
|
+
name: "rootId",
|
|
5799
|
+
type: "string",
|
|
5800
|
+
required: true,
|
|
5801
|
+
description: "Saga, epic or other container to sweep (its whole subtree is considered)",
|
|
5802
|
+
cli: { positional: true }
|
|
5803
|
+
},
|
|
5804
|
+
{
|
|
5805
|
+
name: "apply",
|
|
5806
|
+
type: "boolean",
|
|
5807
|
+
required: false,
|
|
5808
|
+
description: "Write the proposed `relates` edges (read-only without it)",
|
|
5809
|
+
cli: { flag: "apply" }
|
|
5810
|
+
},
|
|
5811
|
+
{
|
|
5812
|
+
name: "threshold",
|
|
5813
|
+
type: "number",
|
|
5814
|
+
required: false,
|
|
5815
|
+
description: "Report pairs at or above this similarity score, 0-1 (default 0.55)",
|
|
5816
|
+
cli: { flag: "threshold" }
|
|
5817
|
+
}
|
|
5818
|
+
]
|
|
5819
|
+
},
|
|
5820
|
+
{
|
|
5821
|
+
gateway: "mutate",
|
|
5822
|
+
domain: "tasks",
|
|
5823
|
+
operation: "decompose",
|
|
5824
|
+
description: "tasks.decompose (mutate) \u2014 move a task\u2019s free-text acceptance criteria onto a new first child, turning the leaf into a container (PM-Core V2 design-point 3)",
|
|
5825
|
+
tier: 1,
|
|
5826
|
+
idempotent: false,
|
|
5827
|
+
sessionRequired: false,
|
|
5828
|
+
requiredParams: ["taskId"],
|
|
5829
|
+
params: [
|
|
5830
|
+
{
|
|
5831
|
+
name: "taskId",
|
|
5832
|
+
type: "string",
|
|
5833
|
+
required: true,
|
|
5834
|
+
description: "Task whose text acceptance criteria move to a new child",
|
|
5835
|
+
cli: { positional: true }
|
|
5836
|
+
},
|
|
5837
|
+
{
|
|
5838
|
+
name: "childTitle",
|
|
5839
|
+
type: "string",
|
|
5840
|
+
required: false,
|
|
5841
|
+
description: "Title for the child that inherits the criteria (default: the parent\u2019s)"
|
|
5842
|
+
},
|
|
5843
|
+
{
|
|
5844
|
+
name: "childDescription",
|
|
5845
|
+
type: "string",
|
|
5846
|
+
required: false,
|
|
5847
|
+
description: "Description for the child (default: the parent\u2019s)"
|
|
5848
|
+
},
|
|
5849
|
+
{
|
|
5850
|
+
name: "dryRun",
|
|
5851
|
+
type: "boolean",
|
|
5852
|
+
required: false,
|
|
5853
|
+
description: "Preview the move without writing"
|
|
5291
5854
|
}
|
|
5292
5855
|
]
|
|
5293
5856
|
},
|
|
@@ -6790,21 +7353,41 @@ var init_operations_registry = __esm({
|
|
|
6790
7353
|
idempotent: false,
|
|
6791
7354
|
sessionRequired: false,
|
|
6792
7355
|
requiredParams: [],
|
|
6793
|
-
params: []
|
|
6794
|
-
},
|
|
6795
|
-
{
|
|
6796
|
-
gateway: "mutate",
|
|
6797
|
-
domain: "memory",
|
|
6798
|
-
operation: "backfill.approve",
|
|
6799
|
-
description: "memory.backfill.approve (mutate) \u2014 approve a staged backfill run (commits rows to live tables)",
|
|
6800
|
-
tier: 1,
|
|
6801
|
-
idempotent: false,
|
|
6802
|
-
sessionRequired: false,
|
|
6803
|
-
requiredParams: ["runId"],
|
|
6804
7356
|
params: [
|
|
6805
|
-
{
|
|
6806
|
-
|
|
6807
|
-
|
|
7357
|
+
{
|
|
7358
|
+
name: "source",
|
|
7359
|
+
type: "string",
|
|
7360
|
+
required: false,
|
|
7361
|
+
description: "Source of the reviewed backfill request."
|
|
7362
|
+
},
|
|
7363
|
+
{ name: "kind", type: "string", required: false, description: "Backfill classification." },
|
|
7364
|
+
{
|
|
7365
|
+
name: "targetTable",
|
|
7366
|
+
type: "string",
|
|
7367
|
+
required: false,
|
|
7368
|
+
description: "Derived brain_page_nodes target only."
|
|
7369
|
+
},
|
|
7370
|
+
{
|
|
7371
|
+
name: "nodeIds",
|
|
7372
|
+
type: "array",
|
|
7373
|
+
required: false,
|
|
7374
|
+
description: "Exact qualified graph node IDs to stage; all must resolve to missing, eligible typed sources."
|
|
7375
|
+
}
|
|
7376
|
+
]
|
|
7377
|
+
},
|
|
7378
|
+
{
|
|
7379
|
+
gateway: "mutate",
|
|
7380
|
+
domain: "memory",
|
|
7381
|
+
operation: "backfill.approve",
|
|
7382
|
+
description: "memory.backfill.approve (mutate) \u2014 approve a staged backfill run (commits rows to live tables)",
|
|
7383
|
+
tier: 1,
|
|
7384
|
+
idempotent: false,
|
|
7385
|
+
sessionRequired: false,
|
|
7386
|
+
requiredParams: ["runId"],
|
|
7387
|
+
params: [
|
|
7388
|
+
{ name: "runId", type: "string", required: true, description: "Backfill run ID to approve" }
|
|
7389
|
+
]
|
|
7390
|
+
},
|
|
6808
7391
|
{
|
|
6809
7392
|
gateway: "mutate",
|
|
6810
7393
|
domain: "memory",
|
|
@@ -9828,6 +10411,369 @@ var init_operations_registry = __esm({
|
|
|
9828
10411
|
}
|
|
9829
10412
|
]
|
|
9830
10413
|
},
|
|
10414
|
+
{
|
|
10415
|
+
gateway: "query",
|
|
10416
|
+
domain: "docs",
|
|
10417
|
+
operation: "status",
|
|
10418
|
+
description: "docs.status (query) \u2014 inspect published documentation drift",
|
|
10419
|
+
tier: 1,
|
|
10420
|
+
idempotent: true,
|
|
10421
|
+
sessionRequired: false,
|
|
10422
|
+
requiredParams: [],
|
|
10423
|
+
params: []
|
|
10424
|
+
},
|
|
10425
|
+
{
|
|
10426
|
+
gateway: "query",
|
|
10427
|
+
domain: "docs",
|
|
10428
|
+
operation: "export",
|
|
10429
|
+
description: "docs.export (query) \u2014 Export a task document",
|
|
10430
|
+
tier: 1,
|
|
10431
|
+
idempotent: true,
|
|
10432
|
+
sessionRequired: false,
|
|
10433
|
+
requiredParams: ["taskId"],
|
|
10434
|
+
params: [
|
|
10435
|
+
{
|
|
10436
|
+
name: "taskId",
|
|
10437
|
+
type: "string",
|
|
10438
|
+
required: true,
|
|
10439
|
+
description: "Task whose document to export"
|
|
10440
|
+
},
|
|
10441
|
+
{
|
|
10442
|
+
name: "includeAttachments",
|
|
10443
|
+
type: "boolean",
|
|
10444
|
+
required: false,
|
|
10445
|
+
description: "Include attachment manifest"
|
|
10446
|
+
},
|
|
10447
|
+
{
|
|
10448
|
+
name: "includeMemoryRefs",
|
|
10449
|
+
type: "boolean",
|
|
10450
|
+
required: false,
|
|
10451
|
+
description: "Include memory references"
|
|
10452
|
+
}
|
|
10453
|
+
]
|
|
10454
|
+
},
|
|
10455
|
+
{
|
|
10456
|
+
gateway: "query",
|
|
10457
|
+
domain: "docs",
|
|
10458
|
+
operation: "search",
|
|
10459
|
+
description: "docs.search (query) \u2014 Search document content",
|
|
10460
|
+
tier: 1,
|
|
10461
|
+
idempotent: true,
|
|
10462
|
+
sessionRequired: false,
|
|
10463
|
+
requiredParams: ["query"],
|
|
10464
|
+
params: [
|
|
10465
|
+
{
|
|
10466
|
+
name: "query",
|
|
10467
|
+
type: "string",
|
|
10468
|
+
required: true,
|
|
10469
|
+
description: "Document search text"
|
|
10470
|
+
},
|
|
10471
|
+
{
|
|
10472
|
+
name: "ownerId",
|
|
10473
|
+
type: "string",
|
|
10474
|
+
required: false,
|
|
10475
|
+
description: "Optional owner scope"
|
|
10476
|
+
},
|
|
10477
|
+
{ name: "limit", type: "number", required: false, description: "Maximum matches" },
|
|
10478
|
+
{
|
|
10479
|
+
name: "type",
|
|
10480
|
+
type: "string",
|
|
10481
|
+
required: false,
|
|
10482
|
+
description: "Document kind filter"
|
|
10483
|
+
}
|
|
10484
|
+
]
|
|
10485
|
+
},
|
|
10486
|
+
{
|
|
10487
|
+
gateway: "query",
|
|
10488
|
+
domain: "docs",
|
|
10489
|
+
operation: "find",
|
|
10490
|
+
description: "docs.find (query) \u2014 Find similar documents",
|
|
10491
|
+
tier: 1,
|
|
10492
|
+
idempotent: true,
|
|
10493
|
+
sessionRequired: false,
|
|
10494
|
+
requiredParams: ["similarSlug"],
|
|
10495
|
+
params: [
|
|
10496
|
+
{
|
|
10497
|
+
name: "similarSlug",
|
|
10498
|
+
type: "string",
|
|
10499
|
+
required: true,
|
|
10500
|
+
description: "Existing document slug to compare"
|
|
10501
|
+
},
|
|
10502
|
+
{ name: "limit", type: "number", required: false, description: "Maximum matches" },
|
|
10503
|
+
{
|
|
10504
|
+
name: "threshold",
|
|
10505
|
+
type: "number",
|
|
10506
|
+
required: false,
|
|
10507
|
+
description: "Minimum similarity"
|
|
10508
|
+
},
|
|
10509
|
+
{
|
|
10510
|
+
name: "allKinds",
|
|
10511
|
+
type: "boolean",
|
|
10512
|
+
required: false,
|
|
10513
|
+
description: "Compare all document kinds"
|
|
10514
|
+
}
|
|
10515
|
+
]
|
|
10516
|
+
},
|
|
10517
|
+
{
|
|
10518
|
+
gateway: "query",
|
|
10519
|
+
domain: "docs",
|
|
10520
|
+
operation: "merge",
|
|
10521
|
+
description: "docs.merge (query) \u2014 Preview a document merge",
|
|
10522
|
+
tier: 1,
|
|
10523
|
+
idempotent: true,
|
|
10524
|
+
sessionRequired: false,
|
|
10525
|
+
requiredParams: ["attA", "attB"],
|
|
10526
|
+
params: [
|
|
10527
|
+
{
|
|
10528
|
+
name: "attA",
|
|
10529
|
+
type: "string",
|
|
10530
|
+
required: true,
|
|
10531
|
+
description: "First attachment reference"
|
|
10532
|
+
},
|
|
10533
|
+
{
|
|
10534
|
+
name: "attB",
|
|
10535
|
+
type: "string",
|
|
10536
|
+
required: true,
|
|
10537
|
+
description: "Second attachment reference"
|
|
10538
|
+
},
|
|
10539
|
+
{
|
|
10540
|
+
name: "strategy",
|
|
10541
|
+
type: "string",
|
|
10542
|
+
required: false,
|
|
10543
|
+
description: "three-way, cherry-pick, or multi-diff"
|
|
10544
|
+
},
|
|
10545
|
+
{
|
|
10546
|
+
name: "base",
|
|
10547
|
+
type: "string",
|
|
10548
|
+
required: false,
|
|
10549
|
+
description: "Common ancestor attachment reference"
|
|
10550
|
+
}
|
|
10551
|
+
]
|
|
10552
|
+
},
|
|
10553
|
+
{
|
|
10554
|
+
gateway: "query",
|
|
10555
|
+
domain: "docs",
|
|
10556
|
+
operation: "rank",
|
|
10557
|
+
description: "docs.rank (query) \u2014 Rank owner documents",
|
|
10558
|
+
tier: 1,
|
|
10559
|
+
idempotent: true,
|
|
10560
|
+
sessionRequired: false,
|
|
10561
|
+
requiredParams: ["ownerId"],
|
|
10562
|
+
params: [
|
|
10563
|
+
{
|
|
10564
|
+
name: "ownerId",
|
|
10565
|
+
type: "string",
|
|
10566
|
+
required: true,
|
|
10567
|
+
description: "Owner whose documents to rank"
|
|
10568
|
+
},
|
|
10569
|
+
{
|
|
10570
|
+
name: "query",
|
|
10571
|
+
type: "string",
|
|
10572
|
+
required: false,
|
|
10573
|
+
description: "Optional ranking query"
|
|
10574
|
+
}
|
|
10575
|
+
]
|
|
10576
|
+
},
|
|
10577
|
+
{
|
|
10578
|
+
gateway: "query",
|
|
10579
|
+
domain: "docs",
|
|
10580
|
+
operation: "versions",
|
|
10581
|
+
description: "docs.versions (query) \u2014 List document versions",
|
|
10582
|
+
tier: 1,
|
|
10583
|
+
idempotent: true,
|
|
10584
|
+
sessionRequired: false,
|
|
10585
|
+
requiredParams: ["ownerId"],
|
|
10586
|
+
params: [
|
|
10587
|
+
{ name: "ownerId", type: "string", required: true, description: "Document owner" },
|
|
10588
|
+
{
|
|
10589
|
+
name: "name",
|
|
10590
|
+
type: "string",
|
|
10591
|
+
required: false,
|
|
10592
|
+
description: "Optional document name"
|
|
10593
|
+
}
|
|
10594
|
+
]
|
|
10595
|
+
},
|
|
10596
|
+
{
|
|
10597
|
+
gateway: "mutate",
|
|
10598
|
+
domain: "docs",
|
|
10599
|
+
operation: "publish",
|
|
10600
|
+
description: "docs.publish (mutate) \u2014 Publish a document to a file or pull request",
|
|
10601
|
+
tier: 1,
|
|
10602
|
+
idempotent: false,
|
|
10603
|
+
sessionRequired: false,
|
|
10604
|
+
requiredParams: [],
|
|
10605
|
+
params: [
|
|
10606
|
+
{
|
|
10607
|
+
name: "target",
|
|
10608
|
+
type: "string",
|
|
10609
|
+
required: false,
|
|
10610
|
+
description: "Publication target: file or pr"
|
|
10611
|
+
},
|
|
10612
|
+
{
|
|
10613
|
+
name: "ownerId",
|
|
10614
|
+
type: "string",
|
|
10615
|
+
required: false,
|
|
10616
|
+
description: "Required for file publication"
|
|
10617
|
+
},
|
|
10618
|
+
{
|
|
10619
|
+
name: "toPath",
|
|
10620
|
+
type: "string",
|
|
10621
|
+
required: false,
|
|
10622
|
+
description: "Required destination for file publication"
|
|
10623
|
+
},
|
|
10624
|
+
{
|
|
10625
|
+
name: "attachmentId",
|
|
10626
|
+
type: "string",
|
|
10627
|
+
required: false,
|
|
10628
|
+
description: "Attachment to publish"
|
|
10629
|
+
},
|
|
10630
|
+
{
|
|
10631
|
+
name: "slugOrId",
|
|
10632
|
+
type: "string",
|
|
10633
|
+
required: false,
|
|
10634
|
+
description: "Required document reference for PR publication"
|
|
10635
|
+
},
|
|
10636
|
+
{
|
|
10637
|
+
name: "slug",
|
|
10638
|
+
type: "string",
|
|
10639
|
+
required: false,
|
|
10640
|
+
description: "Override document slug"
|
|
10641
|
+
},
|
|
10642
|
+
{
|
|
10643
|
+
name: "type",
|
|
10644
|
+
type: "string",
|
|
10645
|
+
required: false,
|
|
10646
|
+
description: "Override document kind"
|
|
10647
|
+
},
|
|
10648
|
+
{ name: "title", type: "string", required: false, description: "Override PR title" },
|
|
10649
|
+
{ name: "body", type: "string", required: false, description: "Override PR body" },
|
|
10650
|
+
{ name: "base", type: "string", required: false, description: "PR base branch" }
|
|
10651
|
+
]
|
|
10652
|
+
},
|
|
10653
|
+
{
|
|
10654
|
+
gateway: "mutate",
|
|
10655
|
+
domain: "docs",
|
|
10656
|
+
operation: "publish-pr",
|
|
10657
|
+
description: "docs.publish-pr (mutate) \u2014 Legacy alias for PR publication",
|
|
10658
|
+
tier: 1,
|
|
10659
|
+
idempotent: false,
|
|
10660
|
+
sessionRequired: false,
|
|
10661
|
+
requiredParams: ["slugOrId"],
|
|
10662
|
+
params: [
|
|
10663
|
+
{
|
|
10664
|
+
name: "slugOrId",
|
|
10665
|
+
type: "string",
|
|
10666
|
+
required: true,
|
|
10667
|
+
description: "Document reference to publish"
|
|
10668
|
+
},
|
|
10669
|
+
{
|
|
10670
|
+
name: "slug",
|
|
10671
|
+
type: "string",
|
|
10672
|
+
required: false,
|
|
10673
|
+
description: "Override document slug"
|
|
10674
|
+
},
|
|
10675
|
+
{
|
|
10676
|
+
name: "type",
|
|
10677
|
+
type: "string",
|
|
10678
|
+
required: false,
|
|
10679
|
+
description: "Override document kind"
|
|
10680
|
+
},
|
|
10681
|
+
{ name: "title", type: "string", required: false, description: "Override PR title" },
|
|
10682
|
+
{ name: "body", type: "string", required: false, description: "Override PR body" },
|
|
10683
|
+
{ name: "base", type: "string", required: false, description: "PR base branch" }
|
|
10684
|
+
]
|
|
10685
|
+
},
|
|
10686
|
+
{
|
|
10687
|
+
gateway: "mutate",
|
|
10688
|
+
domain: "docs",
|
|
10689
|
+
operation: "sync",
|
|
10690
|
+
description: "docs.sync (mutate) \u2014 Sync document content from a file",
|
|
10691
|
+
tier: 1,
|
|
10692
|
+
idempotent: false,
|
|
10693
|
+
sessionRequired: false,
|
|
10694
|
+
requiredParams: ["ownerId", "fromPath"],
|
|
10695
|
+
params: [
|
|
10696
|
+
{ name: "ownerId", type: "string", required: true, description: "Document owner" },
|
|
10697
|
+
{
|
|
10698
|
+
name: "fromPath",
|
|
10699
|
+
type: "string",
|
|
10700
|
+
required: true,
|
|
10701
|
+
description: "Source file path"
|
|
10702
|
+
},
|
|
10703
|
+
{
|
|
10704
|
+
name: "blobName",
|
|
10705
|
+
type: "string",
|
|
10706
|
+
required: false,
|
|
10707
|
+
description: "Document blob name"
|
|
10708
|
+
},
|
|
10709
|
+
{
|
|
10710
|
+
name: "contentType",
|
|
10711
|
+
type: "string",
|
|
10712
|
+
required: false,
|
|
10713
|
+
description: "Document media type"
|
|
10714
|
+
}
|
|
10715
|
+
]
|
|
10716
|
+
},
|
|
10717
|
+
{
|
|
10718
|
+
gateway: "mutate",
|
|
10719
|
+
domain: "docs",
|
|
10720
|
+
operation: "import",
|
|
10721
|
+
description: "docs.import (mutate) \u2014 Import classified project documents",
|
|
10722
|
+
tier: 1,
|
|
10723
|
+
idempotent: false,
|
|
10724
|
+
sessionRequired: false,
|
|
10725
|
+
requiredParams: ["scanRoot"],
|
|
10726
|
+
params: [
|
|
10727
|
+
{
|
|
10728
|
+
name: "scanRoot",
|
|
10729
|
+
type: "string",
|
|
10730
|
+
required: true,
|
|
10731
|
+
description: "Root directory to scan"
|
|
10732
|
+
},
|
|
10733
|
+
{
|
|
10734
|
+
name: "dryRun",
|
|
10735
|
+
type: "boolean",
|
|
10736
|
+
required: false,
|
|
10737
|
+
description: "Preview without writing"
|
|
10738
|
+
},
|
|
10739
|
+
{
|
|
10740
|
+
name: "force",
|
|
10741
|
+
type: "boolean",
|
|
10742
|
+
required: false,
|
|
10743
|
+
description: "Replace conflicting import mappings"
|
|
10744
|
+
},
|
|
10745
|
+
{
|
|
10746
|
+
name: "manifestPath",
|
|
10747
|
+
type: "string",
|
|
10748
|
+
required: false,
|
|
10749
|
+
description: "Import manifest path"
|
|
10750
|
+
}
|
|
10751
|
+
]
|
|
10752
|
+
},
|
|
10753
|
+
{
|
|
10754
|
+
gateway: "query",
|
|
10755
|
+
domain: "docs",
|
|
10756
|
+
operation: "audit",
|
|
10757
|
+
description: "docs.audit (query) \u2014 inspect document history or verify audit chain integrity",
|
|
10758
|
+
tier: 1,
|
|
10759
|
+
idempotent: true,
|
|
10760
|
+
sessionRequired: false,
|
|
10761
|
+
requiredParams: [],
|
|
10762
|
+
params: [
|
|
10763
|
+
{
|
|
10764
|
+
name: "slug",
|
|
10765
|
+
type: "string",
|
|
10766
|
+
required: false,
|
|
10767
|
+
description: "Document slug whose history to inspect"
|
|
10768
|
+
},
|
|
10769
|
+
{
|
|
10770
|
+
name: "verify",
|
|
10771
|
+
type: "boolean",
|
|
10772
|
+
required: false,
|
|
10773
|
+
description: "Verify the full audit chain"
|
|
10774
|
+
}
|
|
10775
|
+
]
|
|
10776
|
+
},
|
|
9831
10777
|
// ── docs.generate (T798) ─────────────────────────────────────────────────
|
|
9832
10778
|
{
|
|
9833
10779
|
gateway: "query",
|
|
@@ -12067,7 +13013,7 @@ var init_operations_registry = __esm({
|
|
|
12067
13013
|
});
|
|
12068
13014
|
|
|
12069
13015
|
// packages/contracts/src/docs/provenance.ts
|
|
12070
|
-
import { z as
|
|
13016
|
+
import { z as z8 } from "zod";
|
|
12071
13017
|
var PROVENANCE_NODE_KINDS, PROVENANCE_EDGE_RELATIONS, DOC_LIFECYCLE_STATUSES, provenanceNodeKindSchema, provenanceEdgeRelationSchema, docLifecycleStatusSchema, provenanceNodeBaseFields, provenanceDocNodeSchema, provenanceTaskNodeSchema, provenanceDecisionNodeSchema, provenanceSessionNodeSchema, provenanceMemoryNodeSchema, provenanceNodeSchema, provenanceEdgeSchema, docProvenanceResponseSchema;
|
|
12072
13018
|
var init_provenance = __esm({
|
|
12073
13019
|
"packages/contracts/src/docs/provenance.ts"() {
|
|
@@ -12094,102 +13040,102 @@ var init_provenance = __esm({
|
|
|
12094
13040
|
"archived",
|
|
12095
13041
|
"draft"
|
|
12096
13042
|
];
|
|
12097
|
-
provenanceNodeKindSchema =
|
|
12098
|
-
provenanceEdgeRelationSchema =
|
|
12099
|
-
docLifecycleStatusSchema =
|
|
13043
|
+
provenanceNodeKindSchema = z8.enum(PROVENANCE_NODE_KINDS);
|
|
13044
|
+
provenanceEdgeRelationSchema = z8.enum(PROVENANCE_EDGE_RELATIONS);
|
|
13045
|
+
docLifecycleStatusSchema = z8.enum(DOC_LIFECYCLE_STATUSES);
|
|
12100
13046
|
provenanceNodeBaseFields = {
|
|
12101
|
-
id:
|
|
12102
|
-
title:
|
|
12103
|
-
metadata:
|
|
13047
|
+
id: z8.string().min(1),
|
|
13048
|
+
title: z8.string().min(1),
|
|
13049
|
+
metadata: z8.record(z8.string(), z8.unknown()).optional()
|
|
12104
13050
|
};
|
|
12105
|
-
provenanceDocNodeSchema =
|
|
13051
|
+
provenanceDocNodeSchema = z8.object({
|
|
12106
13052
|
...provenanceNodeBaseFields,
|
|
12107
|
-
kind:
|
|
12108
|
-
slug:
|
|
12109
|
-
docKind:
|
|
13053
|
+
kind: z8.literal("doc"),
|
|
13054
|
+
slug: z8.string().min(1),
|
|
13055
|
+
docKind: z8.string().min(1),
|
|
12110
13056
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
12111
|
-
publishedAt:
|
|
12112
|
-
supersededAt:
|
|
12113
|
-
summary:
|
|
13057
|
+
publishedAt: z8.string().min(1),
|
|
13058
|
+
supersededAt: z8.string().min(1).optional(),
|
|
13059
|
+
summary: z8.string().optional()
|
|
12114
13060
|
});
|
|
12115
|
-
provenanceTaskNodeSchema =
|
|
13061
|
+
provenanceTaskNodeSchema = z8.object({
|
|
12116
13062
|
...provenanceNodeBaseFields,
|
|
12117
|
-
kind:
|
|
12118
|
-
taskType:
|
|
12119
|
-
status:
|
|
13063
|
+
kind: z8.literal("task"),
|
|
13064
|
+
taskType: z8.enum(["saga", "epic", "task", "subtask"]),
|
|
13065
|
+
status: z8.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
12120
13066
|
});
|
|
12121
|
-
provenanceDecisionNodeSchema =
|
|
13067
|
+
provenanceDecisionNodeSchema = z8.object({
|
|
12122
13068
|
...provenanceNodeBaseFields,
|
|
12123
|
-
kind:
|
|
12124
|
-
outcome:
|
|
12125
|
-
decidedAt:
|
|
13069
|
+
kind: z8.literal("decision"),
|
|
13070
|
+
outcome: z8.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
13071
|
+
decidedAt: z8.string().min(1)
|
|
12126
13072
|
});
|
|
12127
|
-
provenanceSessionNodeSchema =
|
|
13073
|
+
provenanceSessionNodeSchema = z8.object({
|
|
12128
13074
|
...provenanceNodeBaseFields,
|
|
12129
|
-
kind:
|
|
12130
|
-
startedAt:
|
|
12131
|
-
endedAt:
|
|
13075
|
+
kind: z8.literal("session"),
|
|
13076
|
+
startedAt: z8.string().min(1),
|
|
13077
|
+
endedAt: z8.string().min(1).optional()
|
|
12132
13078
|
});
|
|
12133
|
-
provenanceMemoryNodeSchema =
|
|
13079
|
+
provenanceMemoryNodeSchema = z8.object({
|
|
12134
13080
|
...provenanceNodeBaseFields,
|
|
12135
|
-
kind:
|
|
12136
|
-
memoryType:
|
|
12137
|
-
recordedAt:
|
|
13081
|
+
kind: z8.literal("memory"),
|
|
13082
|
+
memoryType: z8.enum(["observation", "pattern", "decision", "diary"]),
|
|
13083
|
+
recordedAt: z8.string().min(1)
|
|
12138
13084
|
});
|
|
12139
|
-
provenanceNodeSchema =
|
|
13085
|
+
provenanceNodeSchema = z8.discriminatedUnion("kind", [
|
|
12140
13086
|
provenanceDocNodeSchema,
|
|
12141
13087
|
provenanceTaskNodeSchema,
|
|
12142
13088
|
provenanceDecisionNodeSchema,
|
|
12143
13089
|
provenanceSessionNodeSchema,
|
|
12144
13090
|
provenanceMemoryNodeSchema
|
|
12145
13091
|
]);
|
|
12146
|
-
provenanceEdgeSchema =
|
|
13092
|
+
provenanceEdgeSchema = z8.object({
|
|
12147
13093
|
relation: provenanceEdgeRelationSchema,
|
|
12148
|
-
from:
|
|
13094
|
+
from: z8.string().min(1),
|
|
12149
13095
|
fromKind: provenanceNodeKindSchema,
|
|
12150
|
-
to:
|
|
13096
|
+
to: z8.string().min(1),
|
|
12151
13097
|
toKind: provenanceNodeKindSchema,
|
|
12152
|
-
addedAt:
|
|
12153
|
-
summary:
|
|
13098
|
+
addedAt: z8.string().min(1),
|
|
13099
|
+
summary: z8.string().optional()
|
|
12154
13100
|
});
|
|
12155
|
-
docProvenanceResponseSchema =
|
|
12156
|
-
nodes:
|
|
12157
|
-
edges:
|
|
12158
|
-
totalNodes:
|
|
12159
|
-
totalEdges:
|
|
13101
|
+
docProvenanceResponseSchema = z8.object({
|
|
13102
|
+
nodes: z8.array(provenanceNodeSchema).readonly(),
|
|
13103
|
+
edges: z8.array(provenanceEdgeSchema).readonly(),
|
|
13104
|
+
totalNodes: z8.number().int().nonnegative(),
|
|
13105
|
+
totalEdges: z8.number().int().nonnegative()
|
|
12160
13106
|
});
|
|
12161
13107
|
}
|
|
12162
13108
|
});
|
|
12163
13109
|
|
|
12164
13110
|
// packages/contracts/src/docs/read.ts
|
|
12165
|
-
import { z as
|
|
13111
|
+
import { z as z9 } from "zod";
|
|
12166
13112
|
var docFrontmatterSchema, docBodySchema, docReadResponseSchema;
|
|
12167
13113
|
var init_read = __esm({
|
|
12168
13114
|
"packages/contracts/src/docs/read.ts"() {
|
|
12169
13115
|
"use strict";
|
|
12170
|
-
docFrontmatterSchema =
|
|
12171
|
-
slug:
|
|
12172
|
-
kind:
|
|
12173
|
-
title:
|
|
12174
|
-
summary:
|
|
12175
|
-
lifecycleStatus:
|
|
12176
|
-
docVersion:
|
|
12177
|
-
ownerVersion:
|
|
12178
|
-
supersedes:
|
|
12179
|
-
supersededBy:
|
|
12180
|
-
topics:
|
|
12181
|
-
relatedTasks:
|
|
12182
|
-
sha256:
|
|
12183
|
-
createdAt:
|
|
12184
|
-
});
|
|
12185
|
-
docBodySchema =
|
|
12186
|
-
encoding:
|
|
12187
|
-
text:
|
|
12188
|
-
base64:
|
|
12189
|
-
sizeBytes:
|
|
12190
|
-
mimeType:
|
|
12191
|
-
});
|
|
12192
|
-
docReadResponseSchema =
|
|
13116
|
+
docFrontmatterSchema = z9.object({
|
|
13117
|
+
slug: z9.string(),
|
|
13118
|
+
kind: z9.string().nullable(),
|
|
13119
|
+
title: z9.string().nullable(),
|
|
13120
|
+
summary: z9.string().nullable(),
|
|
13121
|
+
lifecycleStatus: z9.string(),
|
|
13122
|
+
docVersion: z9.number().int(),
|
|
13123
|
+
ownerVersion: z9.string().nullable(),
|
|
13124
|
+
supersedes: z9.string().nullable(),
|
|
13125
|
+
supersededBy: z9.string().nullable(),
|
|
13126
|
+
topics: z9.array(z9.string()).readonly(),
|
|
13127
|
+
relatedTasks: z9.array(z9.string()).readonly(),
|
|
13128
|
+
sha256: z9.string(),
|
|
13129
|
+
createdAt: z9.string()
|
|
13130
|
+
});
|
|
13131
|
+
docBodySchema = z9.object({
|
|
13132
|
+
encoding: z9.enum(["utf-8", "base64"]),
|
|
13133
|
+
text: z9.string().optional(),
|
|
13134
|
+
base64: z9.string().optional(),
|
|
13135
|
+
sizeBytes: z9.number().int().nonnegative(),
|
|
13136
|
+
mimeType: z9.string().nullable()
|
|
13137
|
+
});
|
|
13138
|
+
docReadResponseSchema = z9.object({
|
|
12193
13139
|
frontmatter: docFrontmatterSchema,
|
|
12194
13140
|
body: docBodySchema
|
|
12195
13141
|
});
|
|
@@ -12249,7 +13195,7 @@ var init_errors = __esm({
|
|
|
12249
13195
|
});
|
|
12250
13196
|
|
|
12251
13197
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
12252
|
-
import { z as
|
|
13198
|
+
import { z as z10 } from "zod";
|
|
12253
13199
|
var EVIDENCE_ATOM_KINDS, PARSER_PREFIXES, KIND_BOUNDARY_REGEX, 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;
|
|
12254
13200
|
var init_evidence_atom_schema = __esm({
|
|
12255
13201
|
"packages/contracts/src/evidence-atom-schema.ts"() {
|
|
@@ -12269,67 +13215,67 @@ var init_evidence_atom_schema = __esm({
|
|
|
12269
13215
|
];
|
|
12270
13216
|
PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
12271
13217
|
KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
12272
|
-
commitAtomSchema =
|
|
12273
|
-
kind:
|
|
12274
|
-
sha:
|
|
13218
|
+
commitAtomSchema = z10.object({
|
|
13219
|
+
kind: z10.literal("commit"),
|
|
13220
|
+
sha: z10.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
12275
13221
|
});
|
|
12276
|
-
filesAtomSchema =
|
|
12277
|
-
kind:
|
|
12278
|
-
paths:
|
|
13222
|
+
filesAtomSchema = z10.object({
|
|
13223
|
+
kind: z10.literal("files"),
|
|
13224
|
+
paths: z10.array(z10.string().min(1)).min(1, "files atom requires at least one path")
|
|
12279
13225
|
});
|
|
12280
|
-
testRunAtomSchema =
|
|
12281
|
-
kind:
|
|
12282
|
-
path:
|
|
13226
|
+
testRunAtomSchema = z10.object({
|
|
13227
|
+
kind: z10.literal("test-run"),
|
|
13228
|
+
path: z10.string().min(1, "test-run atom requires a non-empty path")
|
|
12283
13229
|
});
|
|
12284
|
-
toolAtomSchema =
|
|
12285
|
-
kind:
|
|
12286
|
-
tool:
|
|
13230
|
+
toolAtomSchema = z10.object({
|
|
13231
|
+
kind: z10.literal("tool"),
|
|
13232
|
+
tool: z10.string().min(1, "tool atom requires a non-empty tool name")
|
|
12287
13233
|
});
|
|
12288
|
-
urlAtomSchema =
|
|
12289
|
-
kind:
|
|
12290
|
-
url:
|
|
13234
|
+
urlAtomSchema = z10.object({
|
|
13235
|
+
kind: z10.literal("url"),
|
|
13236
|
+
url: z10.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
12291
13237
|
});
|
|
12292
|
-
noteAtomSchema =
|
|
12293
|
-
kind:
|
|
12294
|
-
note:
|
|
13238
|
+
noteAtomSchema = z10.object({
|
|
13239
|
+
kind: z10.literal("note"),
|
|
13240
|
+
note: z10.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
12295
13241
|
});
|
|
12296
|
-
decisionAtomSchema =
|
|
12297
|
-
kind:
|
|
12298
|
-
decisionId:
|
|
13242
|
+
decisionAtomSchema = z10.object({
|
|
13243
|
+
kind: z10.literal("decision"),
|
|
13244
|
+
decisionId: z10.string().min(1, "decision atom requires a non-empty decision ID")
|
|
12299
13245
|
});
|
|
12300
|
-
prAtomSchema =
|
|
12301
|
-
kind:
|
|
12302
|
-
prNumber:
|
|
13246
|
+
prAtomSchema = z10.object({
|
|
13247
|
+
kind: z10.literal("pr"),
|
|
13248
|
+
prNumber: z10.number().int().positive("pr atom requires a positive integer PR number")
|
|
12303
13249
|
});
|
|
12304
|
-
locDropAtomSchema =
|
|
12305
|
-
kind:
|
|
12306
|
-
fromLines:
|
|
12307
|
-
toLines:
|
|
13250
|
+
locDropAtomSchema = z10.object({
|
|
13251
|
+
kind: z10.literal("loc-drop"),
|
|
13252
|
+
fromLines: z10.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
13253
|
+
toLines: z10.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
12308
13254
|
});
|
|
12309
|
-
callsiteCoverageAtomSchema =
|
|
12310
|
-
kind:
|
|
12311
|
-
symbolName:
|
|
12312
|
-
relativeSourcePath:
|
|
13255
|
+
callsiteCoverageAtomSchema = z10.object({
|
|
13256
|
+
kind: z10.literal("callsite-coverage"),
|
|
13257
|
+
symbolName: z10.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
13258
|
+
relativeSourcePath: z10.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
12313
13259
|
});
|
|
12314
13260
|
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}$/;
|
|
12315
13261
|
AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
12316
13262
|
SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
12317
13263
|
SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
12318
|
-
satisfiesAtomSchema =
|
|
12319
|
-
kind:
|
|
13264
|
+
satisfiesAtomSchema = z10.object({
|
|
13265
|
+
kind: z10.literal("satisfies"),
|
|
12320
13266
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
12321
|
-
targetTaskId:
|
|
13267
|
+
targetTaskId: z10.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
12322
13268
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
12323
|
-
targetAcId:
|
|
13269
|
+
targetAcId: z10.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
12324
13270
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
12325
|
-
targetAcAlias:
|
|
13271
|
+
targetAcAlias: z10.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
12326
13272
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
12327
|
-
versionPin:
|
|
13273
|
+
versionPin: z10.string().regex(
|
|
12328
13274
|
SATISFIES_VERSION_PIN_REGEX,
|
|
12329
13275
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
12330
13276
|
).optional()
|
|
12331
13277
|
});
|
|
12332
|
-
EvidenceAtomSchema =
|
|
13278
|
+
EvidenceAtomSchema = z10.discriminatedUnion("kind", [
|
|
12333
13279
|
commitAtomSchema,
|
|
12334
13280
|
filesAtomSchema,
|
|
12335
13281
|
testRunAtomSchema,
|
|
@@ -12349,11 +13295,11 @@ var init_evidence_atom_schema = __esm({
|
|
|
12349
13295
|
["commit", "note"],
|
|
12350
13296
|
["decision", "files"],
|
|
12351
13297
|
["decision", "note"],
|
|
12352
|
-
["pr"]
|
|
13298
|
+
["pr", "files"]
|
|
12353
13299
|
]
|
|
12354
13300
|
},
|
|
12355
|
-
testsPassed: { oneOf: [["test-run"], ["tool"]
|
|
12356
|
-
qaPassed: { oneOf: [["tool"]
|
|
13301
|
+
testsPassed: { oneOf: [["test-run"], ["tool"]] },
|
|
13302
|
+
qaPassed: { oneOf: [["tool"]] },
|
|
12357
13303
|
documented: { oneOf: [["files"], ["url"]] },
|
|
12358
13304
|
securityPassed: { oneOf: [["tool"], ["note"]] },
|
|
12359
13305
|
cleanupDone: { oneOf: [["note"]] },
|
|
@@ -12376,58 +13322,58 @@ var init_evidence_atom_schema = __esm({
|
|
|
12376
13322
|
});
|
|
12377
13323
|
|
|
12378
13324
|
// packages/contracts/src/evidence-record-schema.ts
|
|
12379
|
-
import { z as
|
|
13325
|
+
import { z as z11 } from "zod";
|
|
12380
13326
|
var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
|
|
12381
13327
|
var init_evidence_record_schema = __esm({
|
|
12382
13328
|
"packages/contracts/src/evidence-record-schema.ts"() {
|
|
12383
13329
|
"use strict";
|
|
12384
|
-
evidenceBaseSchema =
|
|
13330
|
+
evidenceBaseSchema = z11.object({
|
|
12385
13331
|
/** Identity string of the agent that produced this record. */
|
|
12386
|
-
agentIdentity:
|
|
13332
|
+
agentIdentity: z11.string().min(1),
|
|
12387
13333
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
12388
|
-
attachmentSha256:
|
|
13334
|
+
attachmentSha256: z11.string().length(64),
|
|
12389
13335
|
/** ISO 8601 timestamp at which the action ran. */
|
|
12390
|
-
ranAt:
|
|
13336
|
+
ranAt: z11.string().datetime(),
|
|
12391
13337
|
/** Wall-clock duration of the action in milliseconds. */
|
|
12392
|
-
durationMs:
|
|
13338
|
+
durationMs: z11.number().nonnegative()
|
|
12393
13339
|
});
|
|
12394
13340
|
implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
12395
|
-
kind:
|
|
12396
|
-
phase:
|
|
12397
|
-
filesChanged:
|
|
12398
|
-
linesAdded:
|
|
12399
|
-
linesRemoved:
|
|
13341
|
+
kind: z11.literal("impl-diff"),
|
|
13342
|
+
phase: z11.literal("implement"),
|
|
13343
|
+
filesChanged: z11.array(z11.string().min(1)).min(1),
|
|
13344
|
+
linesAdded: z11.number().int().nonnegative(),
|
|
13345
|
+
linesRemoved: z11.number().int().nonnegative()
|
|
12400
13346
|
});
|
|
12401
13347
|
validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
12402
|
-
kind:
|
|
12403
|
-
phase:
|
|
12404
|
-
reqIdsChecked:
|
|
12405
|
-
passed:
|
|
12406
|
-
details:
|
|
13348
|
+
kind: z11.literal("validate-spec-check"),
|
|
13349
|
+
phase: z11.literal("validate"),
|
|
13350
|
+
reqIdsChecked: z11.array(z11.string().min(1)).min(1),
|
|
13351
|
+
passed: z11.boolean(),
|
|
13352
|
+
details: z11.string().min(1)
|
|
12407
13353
|
});
|
|
12408
13354
|
testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
12409
|
-
kind:
|
|
12410
|
-
phase:
|
|
12411
|
-
command:
|
|
12412
|
-
exitCode:
|
|
12413
|
-
testsPassed:
|
|
12414
|
-
testsFailed:
|
|
13355
|
+
kind: z11.literal("test-output"),
|
|
13356
|
+
phase: z11.literal("test"),
|
|
13357
|
+
command: z11.string().min(1),
|
|
13358
|
+
exitCode: z11.number().int(),
|
|
13359
|
+
testsPassed: z11.number().int().nonnegative(),
|
|
13360
|
+
testsFailed: z11.number().int().nonnegative()
|
|
12415
13361
|
});
|
|
12416
13362
|
lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
12417
|
-
kind:
|
|
12418
|
-
phase:
|
|
12419
|
-
tool:
|
|
12420
|
-
passed:
|
|
12421
|
-
warnings:
|
|
12422
|
-
errors:
|
|
13363
|
+
kind: z11.literal("lint-report"),
|
|
13364
|
+
phase: z11.enum(["implement", "test"]),
|
|
13365
|
+
tool: z11.string().min(1),
|
|
13366
|
+
passed: z11.boolean(),
|
|
13367
|
+
warnings: z11.number().int().nonnegative(),
|
|
13368
|
+
errors: z11.number().int().nonnegative()
|
|
12423
13369
|
});
|
|
12424
13370
|
commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
12425
|
-
kind:
|
|
12426
|
-
phase:
|
|
12427
|
-
cmd:
|
|
12428
|
-
exitCode:
|
|
13371
|
+
kind: z11.literal("command-output"),
|
|
13372
|
+
phase: z11.enum(["implement", "validate", "test"]),
|
|
13373
|
+
cmd: z11.string().min(1),
|
|
13374
|
+
exitCode: z11.number().int()
|
|
12429
13375
|
});
|
|
12430
|
-
evidenceRecordSchema =
|
|
13376
|
+
evidenceRecordSchema = z11.discriminatedUnion("kind", [
|
|
12431
13377
|
implDiffRecordSchema,
|
|
12432
13378
|
validateSpecCheckRecordSchema,
|
|
12433
13379
|
testOutputRecordSchema,
|
|
@@ -12577,7 +13523,7 @@ var init_adr_070_orchestration = __esm({
|
|
|
12577
13523
|
WORKTREE_CREATE_MODULE = "packages/worktree/src/worktree-create.ts";
|
|
12578
13524
|
CT_ORCHESTRATOR_SKILL = "packages/skills/skills/ct-orchestrator/SKILL.md";
|
|
12579
13525
|
VALIDATE_SPAWN_MODULE = "packages/core/src/orchestration/validate-spawn.ts";
|
|
12580
|
-
SKILL_VALIDATOR_TESTS = "packages/core/src/skills/orchestrator/__tests__/validator.test.ts";
|
|
13526
|
+
SKILL_VALIDATOR_TESTS = "packages/core/src/skills/orchestrator/__tests__/validator.orchestrator.test.ts";
|
|
12581
13527
|
ADR_070_INVARIANTS = Object.freeze([
|
|
12582
13528
|
{
|
|
12583
13529
|
adr: "ADR-070",
|
|
@@ -12861,8 +13807,8 @@ var init_adr_073_saga = __esm({
|
|
|
12861
13807
|
{
|
|
12862
13808
|
adr: "ADR-073",
|
|
12863
13809
|
code: "I7",
|
|
12864
|
-
name: "
|
|
12865
|
-
description:
|
|
13810
|
+
name: "No nested sagas",
|
|
13811
|
+
description: 'A saga-member candidate MUST NOT itself be saga-shaped. Enforced at runtime by assertSagaInvariantI7, which checks exactly this and nothing else. The depth clause this invariant used to carry \u2014 "the parent ladder Subtask \u2192 Task \u2192 Epic is fixed at depth 3; sagas do NOT consume depth, they attach via groups relations, not parent edges" \u2014 is SUPERSEDED BY ADR-088: member epics now attach via tasks.parent_id containment and task_relations.groups is non-containment provenance only, so a saga DOES consume a level. The canonical spine is saga(0) \u2192 epic(1) \u2192 task(2) \u2192 subtask(3) at hierarchy.maxDepth=3, inclusive; the depth rule lives in exceedsMaxDepth (core tasks/hierarchy.ts), never here. The stale clause outlived its premise by long enough for the write-path guards calibrated on it to make the subtask tier unreachable.',
|
|
12866
13812
|
severity: "error",
|
|
12867
13813
|
runtimeGate: {
|
|
12868
13814
|
module: SAGA_ENFORCEMENT_MODULE,
|
|
@@ -12931,111 +13877,111 @@ var init_lafs = __esm({
|
|
|
12931
13877
|
});
|
|
12932
13878
|
|
|
12933
13879
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
12934
|
-
import { z as
|
|
13880
|
+
import { z as z12 } from "zod";
|
|
12935
13881
|
var LeaseScopeSchema, LeaseLaneSchema, LeaseAcquireRequestSchema, LeaseReleaseRequestSchema, LeaseRenewRequestSchema, RateCheckRequestSchema, ToolGrantRequestSchema, QueuePriorityClassSchema, QueueAdmitRequestSchema, WorkerHeartbeatRequestSchema, ResourceAdmitRequestSchema, ResourceReleaseRequestSchema, LeaseIpcRequestSchema, LeaseGrantedResponseSchema, LeaseQueuedResponseSchema, LeaseDeniedResponseSchema, RateResultResponseSchema, ToolGrantedResponseSchema, LeaseRevokedResponseSchema, ChildKilledUnresponsiveResponseSchema, QueueAdmitDispositionSchema, QueueAdmitResultResponseSchema, HeartbeatAckResponseSchema, ResourceAdmitDispositionSchema, ResourceAdmitResultResponseSchema, ResourceReleaseResultResponseSchema, LeaseErrorResponseSchema, LeaseIpcResponseSchema, LeaseIpcRequestEnvelopeSchema, LeaseIpcResponseEnvelopeSchema, LeaseIpcEnvelopeSchema, LEASE_IPC_REQUEST_KINDS, LEASE_IPC_RESPONSE_KINDS, LEASE_IPC_MESSAGE_KINDS;
|
|
12936
13882
|
var init_messages2 = __esm({
|
|
12937
13883
|
"packages/contracts/src/lease-ipc/messages.ts"() {
|
|
12938
13884
|
"use strict";
|
|
12939
|
-
LeaseScopeSchema =
|
|
12940
|
-
LeaseLaneSchema =
|
|
12941
|
-
LeaseAcquireRequestSchema =
|
|
13885
|
+
LeaseScopeSchema = z12.enum(["project", "global"]);
|
|
13886
|
+
LeaseLaneSchema = z12.enum(["tasks", "brain", "bulk"]);
|
|
13887
|
+
LeaseAcquireRequestSchema = z12.object({
|
|
12942
13888
|
/** Tag discriminating this request variant. */
|
|
12943
|
-
kind:
|
|
13889
|
+
kind: z12.literal("lease_acquire"),
|
|
12944
13890
|
/** The cleo.db scope being arbitrated. */
|
|
12945
13891
|
scope: LeaseScopeSchema,
|
|
12946
13892
|
/** The write lane within the scope. */
|
|
12947
13893
|
lane: LeaseLaneSchema,
|
|
12948
13894
|
/** Process+lane holder identity. */
|
|
12949
|
-
holder_id:
|
|
13895
|
+
holder_id: z12.string().min(1),
|
|
12950
13896
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
12951
|
-
priority:
|
|
13897
|
+
priority: z12.number().int().min(0).max(255),
|
|
12952
13898
|
/** Lease time-to-live in milliseconds. */
|
|
12953
|
-
ttl_ms:
|
|
13899
|
+
ttl_ms: z12.number().int().nonnegative(),
|
|
12954
13900
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
12955
|
-
reentrant:
|
|
13901
|
+
reentrant: z12.boolean()
|
|
12956
13902
|
}).strict();
|
|
12957
|
-
LeaseReleaseRequestSchema =
|
|
13903
|
+
LeaseReleaseRequestSchema = z12.object({
|
|
12958
13904
|
/** Tag discriminating this request variant. */
|
|
12959
|
-
kind:
|
|
13905
|
+
kind: z12.literal("lease_release"),
|
|
12960
13906
|
/** The cleo.db scope being arbitrated. */
|
|
12961
13907
|
scope: LeaseScopeSchema,
|
|
12962
13908
|
/** The write lane within the scope. */
|
|
12963
13909
|
lane: LeaseLaneSchema,
|
|
12964
13910
|
/** Process+lane holder identity. */
|
|
12965
|
-
holder_id:
|
|
13911
|
+
holder_id: z12.string().min(1),
|
|
12966
13912
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
12967
|
-
epoch:
|
|
13913
|
+
epoch: z12.number().int().nonnegative()
|
|
12968
13914
|
}).strict();
|
|
12969
|
-
LeaseRenewRequestSchema =
|
|
13915
|
+
LeaseRenewRequestSchema = z12.object({
|
|
12970
13916
|
/** Tag discriminating this request variant. */
|
|
12971
|
-
kind:
|
|
13917
|
+
kind: z12.literal("lease_renew"),
|
|
12972
13918
|
/** The cleo.db scope being arbitrated. */
|
|
12973
13919
|
scope: LeaseScopeSchema,
|
|
12974
13920
|
/** The write lane within the scope. */
|
|
12975
13921
|
lane: LeaseLaneSchema,
|
|
12976
13922
|
/** Process+lane holder identity. */
|
|
12977
|
-
holder_id:
|
|
13923
|
+
holder_id: z12.string().min(1),
|
|
12978
13924
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
12979
|
-
epoch:
|
|
13925
|
+
epoch: z12.number().int().nonnegative()
|
|
12980
13926
|
}).strict();
|
|
12981
|
-
RateCheckRequestSchema =
|
|
13927
|
+
RateCheckRequestSchema = z12.object({
|
|
12982
13928
|
/** Tag discriminating this request variant. */
|
|
12983
|
-
kind:
|
|
13929
|
+
kind: z12.literal("rate_check"),
|
|
12984
13930
|
/** The cleo.db scope being checked. */
|
|
12985
13931
|
scope: LeaseScopeSchema,
|
|
12986
13932
|
/** The write lane within the scope. */
|
|
12987
13933
|
lane: LeaseLaneSchema,
|
|
12988
13934
|
/** Estimated bytes the caller intends to write. */
|
|
12989
|
-
est_bytes:
|
|
13935
|
+
est_bytes: z12.number().int().nonnegative()
|
|
12990
13936
|
}).strict();
|
|
12991
|
-
ToolGrantRequestSchema =
|
|
13937
|
+
ToolGrantRequestSchema = z12.object({
|
|
12992
13938
|
/** Tag discriminating this request variant. */
|
|
12993
|
-
kind:
|
|
13939
|
+
kind: z12.literal("tool_grant"),
|
|
12994
13940
|
/** The tool name being requested. */
|
|
12995
|
-
tool:
|
|
13941
|
+
tool: z12.string().min(1),
|
|
12996
13942
|
/** The requesting holder identity. */
|
|
12997
|
-
holder_id:
|
|
13943
|
+
holder_id: z12.string().min(1)
|
|
12998
13944
|
}).strict();
|
|
12999
|
-
QueuePriorityClassSchema =
|
|
13000
|
-
QueueAdmitRequestSchema =
|
|
13945
|
+
QueuePriorityClassSchema = z12.enum(["lead", "worker", "background"]);
|
|
13946
|
+
QueueAdmitRequestSchema = z12.object({
|
|
13001
13947
|
/** Tag discriminating this request variant. */
|
|
13002
|
-
kind:
|
|
13948
|
+
kind: z12.literal("queue_admit"),
|
|
13003
13949
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
13004
|
-
provider:
|
|
13950
|
+
provider: z12.string().min(1),
|
|
13005
13951
|
/** The caller's priority class (lead > worker > background). */
|
|
13006
13952
|
priority_class: QueuePriorityClassSchema,
|
|
13007
13953
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
13008
|
-
est_tokens:
|
|
13954
|
+
est_tokens: z12.number().int().nonnegative(),
|
|
13009
13955
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
13010
|
-
child_id:
|
|
13956
|
+
child_id: z12.string().min(1)
|
|
13011
13957
|
}).strict();
|
|
13012
|
-
WorkerHeartbeatRequestSchema =
|
|
13958
|
+
WorkerHeartbeatRequestSchema = z12.object({
|
|
13013
13959
|
/** Tag discriminating this request variant. */
|
|
13014
|
-
kind:
|
|
13960
|
+
kind: z12.literal("worker_heartbeat"),
|
|
13015
13961
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
13016
|
-
child_id:
|
|
13962
|
+
child_id: z12.string().min(1),
|
|
13017
13963
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
13018
|
-
in_flight_llm:
|
|
13964
|
+
in_flight_llm: z12.boolean()
|
|
13019
13965
|
}).strict();
|
|
13020
|
-
ResourceAdmitRequestSchema =
|
|
13966
|
+
ResourceAdmitRequestSchema = z12.object({
|
|
13021
13967
|
/** Tag discriminating this request variant. */
|
|
13022
|
-
kind:
|
|
13968
|
+
kind: z12.literal("resource_admit"),
|
|
13023
13969
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
13024
|
-
class:
|
|
13970
|
+
class: z12.string().min(1),
|
|
13025
13971
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
13026
|
-
holder_id:
|
|
13972
|
+
holder_id: z12.string().min(1),
|
|
13027
13973
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
13028
|
-
budget:
|
|
13974
|
+
budget: z12.number().int().nonnegative()
|
|
13029
13975
|
}).strict();
|
|
13030
|
-
ResourceReleaseRequestSchema =
|
|
13976
|
+
ResourceReleaseRequestSchema = z12.object({
|
|
13031
13977
|
/** Tag discriminating this request variant. */
|
|
13032
|
-
kind:
|
|
13978
|
+
kind: z12.literal("resource_release"),
|
|
13033
13979
|
/** The resource class the slot belongs to. */
|
|
13034
|
-
class:
|
|
13980
|
+
class: z12.string().min(1),
|
|
13035
13981
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
13036
|
-
holder_id:
|
|
13982
|
+
holder_id: z12.string().min(1)
|
|
13037
13983
|
}).strict();
|
|
13038
|
-
LeaseIpcRequestSchema =
|
|
13984
|
+
LeaseIpcRequestSchema = z12.discriminatedUnion("kind", [
|
|
13039
13985
|
LeaseAcquireRequestSchema,
|
|
13040
13986
|
LeaseReleaseRequestSchema,
|
|
13041
13987
|
LeaseRenewRequestSchema,
|
|
@@ -13046,133 +13992,133 @@ var init_messages2 = __esm({
|
|
|
13046
13992
|
ResourceAdmitRequestSchema,
|
|
13047
13993
|
ResourceReleaseRequestSchema
|
|
13048
13994
|
]);
|
|
13049
|
-
LeaseGrantedResponseSchema =
|
|
13995
|
+
LeaseGrantedResponseSchema = z12.object({
|
|
13050
13996
|
/** Tag discriminating this response variant. */
|
|
13051
|
-
kind:
|
|
13997
|
+
kind: z12.literal("lease_granted"),
|
|
13052
13998
|
/** The granted cleo.db scope. */
|
|
13053
13999
|
scope: LeaseScopeSchema,
|
|
13054
14000
|
/** The granted write lane. */
|
|
13055
14001
|
lane: LeaseLaneSchema,
|
|
13056
14002
|
/** The holder the lease was granted to. */
|
|
13057
|
-
holder_id:
|
|
14003
|
+
holder_id: z12.string().min(1),
|
|
13058
14004
|
/** The monotonic epoch fence assigned to this grant. */
|
|
13059
|
-
epoch:
|
|
14005
|
+
epoch: z12.number().int().nonnegative(),
|
|
13060
14006
|
/** The lease TTL in milliseconds. */
|
|
13061
|
-
ttl_ms:
|
|
14007
|
+
ttl_ms: z12.number().int().nonnegative(),
|
|
13062
14008
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
13063
|
-
expires_at_ms:
|
|
14009
|
+
expires_at_ms: z12.number().int().nonnegative()
|
|
13064
14010
|
}).strict();
|
|
13065
|
-
LeaseQueuedResponseSchema =
|
|
14011
|
+
LeaseQueuedResponseSchema = z12.object({
|
|
13066
14012
|
/** Tag discriminating this response variant. */
|
|
13067
|
-
kind:
|
|
14013
|
+
kind: z12.literal("lease_queued"),
|
|
13068
14014
|
/** The queued cleo.db scope. */
|
|
13069
14015
|
scope: LeaseScopeSchema,
|
|
13070
14016
|
/** The queued write lane. */
|
|
13071
14017
|
lane: LeaseLaneSchema,
|
|
13072
14018
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
13073
|
-
ticket:
|
|
14019
|
+
ticket: z12.number().int().nonnegative(),
|
|
13074
14020
|
/** Number of waiters ahead of this one. */
|
|
13075
|
-
ahead:
|
|
14021
|
+
ahead: z12.number().int().nonnegative()
|
|
13076
14022
|
}).strict();
|
|
13077
|
-
LeaseDeniedResponseSchema =
|
|
14023
|
+
LeaseDeniedResponseSchema = z12.object({
|
|
13078
14024
|
/** Tag discriminating this response variant. */
|
|
13079
|
-
kind:
|
|
14025
|
+
kind: z12.literal("lease_denied"),
|
|
13080
14026
|
/** The denied cleo.db scope. */
|
|
13081
14027
|
scope: LeaseScopeSchema,
|
|
13082
14028
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
13083
|
-
code:
|
|
14029
|
+
code: z12.string().min(1),
|
|
13084
14030
|
/** Human-readable denial message. */
|
|
13085
|
-
message:
|
|
14031
|
+
message: z12.string()
|
|
13086
14032
|
}).strict();
|
|
13087
|
-
RateResultResponseSchema =
|
|
14033
|
+
RateResultResponseSchema = z12.object({
|
|
13088
14034
|
/** Tag discriminating this response variant. */
|
|
13089
|
-
kind:
|
|
14035
|
+
kind: z12.literal("rate_result"),
|
|
13090
14036
|
/** The checked cleo.db scope. */
|
|
13091
14037
|
scope: LeaseScopeSchema,
|
|
13092
14038
|
/** Whether the write is within budget. */
|
|
13093
|
-
ok:
|
|
14039
|
+
ok: z12.boolean(),
|
|
13094
14040
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
13095
|
-
retry_after_ms:
|
|
14041
|
+
retry_after_ms: z12.number().int().nonnegative(),
|
|
13096
14042
|
/** Remaining token budget for the scope. */
|
|
13097
|
-
tokens_remaining:
|
|
14043
|
+
tokens_remaining: z12.number().int().nonnegative()
|
|
13098
14044
|
}).strict();
|
|
13099
|
-
ToolGrantedResponseSchema =
|
|
14045
|
+
ToolGrantedResponseSchema = z12.object({
|
|
13100
14046
|
/** Tag discriminating this response variant. */
|
|
13101
|
-
kind:
|
|
14047
|
+
kind: z12.literal("tool_granted"),
|
|
13102
14048
|
/** The granted tool name. */
|
|
13103
|
-
tool:
|
|
14049
|
+
tool: z12.string().min(1),
|
|
13104
14050
|
/** The holder the tool grant was issued to. */
|
|
13105
|
-
holder_id:
|
|
14051
|
+
holder_id: z12.string().min(1)
|
|
13106
14052
|
}).strict();
|
|
13107
|
-
LeaseRevokedResponseSchema =
|
|
14053
|
+
LeaseRevokedResponseSchema = z12.object({
|
|
13108
14054
|
/** Tag discriminating this response variant. */
|
|
13109
|
-
kind:
|
|
14055
|
+
kind: z12.literal("lease_revoked"),
|
|
13110
14056
|
/** The revoked cleo.db scope. */
|
|
13111
14057
|
scope: LeaseScopeSchema,
|
|
13112
14058
|
/** The revoked write lane. */
|
|
13113
14059
|
lane: LeaseLaneSchema,
|
|
13114
14060
|
/** The holder whose lease was revoked. */
|
|
13115
|
-
holder_id:
|
|
14061
|
+
holder_id: z12.string().min(1),
|
|
13116
14062
|
/** Human-readable reason for the revocation. */
|
|
13117
|
-
reason:
|
|
14063
|
+
reason: z12.string()
|
|
13118
14064
|
}).strict();
|
|
13119
|
-
ChildKilledUnresponsiveResponseSchema =
|
|
14065
|
+
ChildKilledUnresponsiveResponseSchema = z12.object({
|
|
13120
14066
|
/** Tag discriminating this response variant. */
|
|
13121
|
-
kind:
|
|
14067
|
+
kind: z12.literal("child_killed_unresponsive"),
|
|
13122
14068
|
/** Logical id of the killed child. */
|
|
13123
|
-
child_id:
|
|
14069
|
+
child_id: z12.string().min(1),
|
|
13124
14070
|
/** The holder identity the killed child held the lease as. */
|
|
13125
|
-
holder_id:
|
|
14071
|
+
holder_id: z12.string().min(1),
|
|
13126
14072
|
/** The cleo.db scope the killed child held the lease in. */
|
|
13127
14073
|
scope: LeaseScopeSchema,
|
|
13128
14074
|
/** Human-readable reason for the kill. */
|
|
13129
|
-
reason:
|
|
14075
|
+
reason: z12.string()
|
|
13130
14076
|
}).strict();
|
|
13131
|
-
QueueAdmitDispositionSchema =
|
|
13132
|
-
QueueAdmitResultResponseSchema =
|
|
14077
|
+
QueueAdmitDispositionSchema = z12.enum(["admitted", "deferred"]);
|
|
14078
|
+
QueueAdmitResultResponseSchema = z12.object({
|
|
13133
14079
|
/** Tag discriminating this response variant. */
|
|
13134
|
-
kind:
|
|
14080
|
+
kind: z12.literal("queue_admit_result"),
|
|
13135
14081
|
/** Whether the LLM call was admitted or deferred. */
|
|
13136
14082
|
disposition: QueueAdmitDispositionSchema,
|
|
13137
14083
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
13138
|
-
retry_after_ms:
|
|
14084
|
+
retry_after_ms: z12.number().int().nonnegative(),
|
|
13139
14085
|
/** Remaining provider token budget after this decision. */
|
|
13140
|
-
tokens_remaining:
|
|
14086
|
+
tokens_remaining: z12.number().int().nonnegative(),
|
|
13141
14087
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
13142
|
-
queue_position:
|
|
14088
|
+
queue_position: z12.number().int().nonnegative()
|
|
13143
14089
|
}).strict();
|
|
13144
|
-
HeartbeatAckResponseSchema =
|
|
14090
|
+
HeartbeatAckResponseSchema = z12.object({
|
|
13145
14091
|
/** Tag discriminating this response variant. */
|
|
13146
|
-
kind:
|
|
14092
|
+
kind: z12.literal("heartbeat_ack")
|
|
13147
14093
|
}).strict();
|
|
13148
|
-
ResourceAdmitDispositionSchema =
|
|
13149
|
-
ResourceAdmitResultResponseSchema =
|
|
14094
|
+
ResourceAdmitDispositionSchema = z12.enum(["admitted", "deferred"]);
|
|
14095
|
+
ResourceAdmitResultResponseSchema = z12.object({
|
|
13150
14096
|
/** Tag discriminating this response variant. */
|
|
13151
|
-
kind:
|
|
14097
|
+
kind: z12.literal("resource_admit_result"),
|
|
13152
14098
|
/** Whether the heavy op was admitted or deferred. */
|
|
13153
14099
|
disposition: ResourceAdmitDispositionSchema,
|
|
13154
14100
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
13155
|
-
retry_after_ms:
|
|
14101
|
+
retry_after_ms: z12.number().int().nonnegative(),
|
|
13156
14102
|
/** Remaining slots for the class after this decision. */
|
|
13157
|
-
slots_remaining:
|
|
14103
|
+
slots_remaining: z12.number().int().nonnegative()
|
|
13158
14104
|
}).strict();
|
|
13159
|
-
ResourceReleaseResultResponseSchema =
|
|
14105
|
+
ResourceReleaseResultResponseSchema = z12.object({
|
|
13160
14106
|
/** Tag discriminating this response variant. */
|
|
13161
|
-
kind:
|
|
14107
|
+
kind: z12.literal("resource_release_result"),
|
|
13162
14108
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
13163
|
-
released:
|
|
14109
|
+
released: z12.boolean(),
|
|
13164
14110
|
/** Remaining in-flight holders for the class after the release. */
|
|
13165
|
-
slots_remaining:
|
|
14111
|
+
slots_remaining: z12.number().int().nonnegative()
|
|
13166
14112
|
}).strict();
|
|
13167
|
-
LeaseErrorResponseSchema =
|
|
14113
|
+
LeaseErrorResponseSchema = z12.object({
|
|
13168
14114
|
/** Tag discriminating this response variant. */
|
|
13169
|
-
kind:
|
|
14115
|
+
kind: z12.literal("error"),
|
|
13170
14116
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
13171
|
-
code:
|
|
14117
|
+
code: z12.string().min(1),
|
|
13172
14118
|
/** Human-readable error message. */
|
|
13173
|
-
message:
|
|
14119
|
+
message: z12.string()
|
|
13174
14120
|
}).strict();
|
|
13175
|
-
LeaseIpcResponseSchema =
|
|
14121
|
+
LeaseIpcResponseSchema = z12.discriminatedUnion("kind", [
|
|
13176
14122
|
LeaseGrantedResponseSchema,
|
|
13177
14123
|
LeaseQueuedResponseSchema,
|
|
13178
14124
|
LeaseDeniedResponseSchema,
|
|
@@ -13186,27 +14132,27 @@ var init_messages2 = __esm({
|
|
|
13186
14132
|
ResourceReleaseResultResponseSchema,
|
|
13187
14133
|
LeaseErrorResponseSchema
|
|
13188
14134
|
]);
|
|
13189
|
-
LeaseIpcRequestEnvelopeSchema =
|
|
14135
|
+
LeaseIpcRequestEnvelopeSchema = z12.object({
|
|
13190
14136
|
/** Parallel protocol version. */
|
|
13191
|
-
protocol_version:
|
|
14137
|
+
protocol_version: z12.string(),
|
|
13192
14138
|
/** Correlation id echoed back on the matching response. */
|
|
13193
|
-
id:
|
|
14139
|
+
id: z12.string().min(1),
|
|
13194
14140
|
/** Direction discriminator. */
|
|
13195
|
-
direction:
|
|
14141
|
+
direction: z12.literal("request"),
|
|
13196
14142
|
/** The request body. */
|
|
13197
14143
|
request: LeaseIpcRequestSchema
|
|
13198
14144
|
}).strict();
|
|
13199
|
-
LeaseIpcResponseEnvelopeSchema =
|
|
14145
|
+
LeaseIpcResponseEnvelopeSchema = z12.object({
|
|
13200
14146
|
/** Parallel protocol version. */
|
|
13201
|
-
protocol_version:
|
|
14147
|
+
protocol_version: z12.string(),
|
|
13202
14148
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
13203
|
-
id:
|
|
14149
|
+
id: z12.string().min(1),
|
|
13204
14150
|
/** Direction discriminator. */
|
|
13205
|
-
direction:
|
|
14151
|
+
direction: z12.literal("response"),
|
|
13206
14152
|
/** The response body. */
|
|
13207
14153
|
response: LeaseIpcResponseSchema
|
|
13208
14154
|
}).strict();
|
|
13209
|
-
LeaseIpcEnvelopeSchema =
|
|
14155
|
+
LeaseIpcEnvelopeSchema = z12.discriminatedUnion("direction", [
|
|
13210
14156
|
LeaseIpcRequestEnvelopeSchema,
|
|
13211
14157
|
LeaseIpcResponseEnvelopeSchema
|
|
13212
14158
|
]);
|
|
@@ -13259,7 +14205,7 @@ var init_lease_ipc = __esm({
|
|
|
13259
14205
|
});
|
|
13260
14206
|
|
|
13261
14207
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
13262
|
-
import { z as
|
|
14208
|
+
import { z as z13 } from "zod";
|
|
13263
14209
|
var CATALOG_MODEL_STATUSES, CATALOG_AUTH_TYPES, isoDate, semver, catalogModalitiesSchema, catalogCostSchema, catalogLimitSchema, catalogModelProviderSchema, catalogModelEntrySchema, catalogProviderSchema, curatedCatalogSchema, modelsCatalogRowInsertSchema, modelsCatalogRowSelectSchema;
|
|
13264
14210
|
var init_catalog_schema = __esm({
|
|
13265
14211
|
"packages/contracts/src/llm/catalog-schema.ts"() {
|
|
@@ -13272,78 +14218,78 @@ var init_catalog_schema = __esm({
|
|
|
13272
14218
|
"retired"
|
|
13273
14219
|
];
|
|
13274
14220
|
CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
13275
|
-
isoDate =
|
|
13276
|
-
semver =
|
|
13277
|
-
catalogModalitiesSchema =
|
|
13278
|
-
input:
|
|
13279
|
-
output:
|
|
14221
|
+
isoDate = z13.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
14222
|
+
semver = z13.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
14223
|
+
catalogModalitiesSchema = z13.object({
|
|
14224
|
+
input: z13.array(z13.string()),
|
|
14225
|
+
output: z13.array(z13.string())
|
|
13280
14226
|
}).strict();
|
|
13281
|
-
catalogCostSchema =
|
|
13282
|
-
input:
|
|
13283
|
-
output:
|
|
13284
|
-
cache_read:
|
|
13285
|
-
cache_write:
|
|
13286
|
-
context_over_200k:
|
|
14227
|
+
catalogCostSchema = z13.object({
|
|
14228
|
+
input: z13.number().optional(),
|
|
14229
|
+
output: z13.number().optional(),
|
|
14230
|
+
cache_read: z13.number().optional(),
|
|
14231
|
+
cache_write: z13.number().optional(),
|
|
14232
|
+
context_over_200k: z13.number().optional()
|
|
13287
14233
|
}).strict();
|
|
13288
|
-
catalogLimitSchema =
|
|
13289
|
-
context:
|
|
13290
|
-
output:
|
|
14234
|
+
catalogLimitSchema = z13.object({
|
|
14235
|
+
context: z13.number(),
|
|
14236
|
+
output: z13.number()
|
|
13291
14237
|
}).strict();
|
|
13292
|
-
catalogModelProviderSchema =
|
|
13293
|
-
npm:
|
|
13294
|
-
api:
|
|
14238
|
+
catalogModelProviderSchema = z13.object({
|
|
14239
|
+
npm: z13.string(),
|
|
14240
|
+
api: z13.string()
|
|
13295
14241
|
}).strict();
|
|
13296
|
-
catalogModelEntrySchema =
|
|
13297
|
-
id:
|
|
13298
|
-
name:
|
|
13299
|
-
family:
|
|
13300
|
-
attachment:
|
|
13301
|
-
reasoning:
|
|
13302
|
-
temperature:
|
|
13303
|
-
interleaved:
|
|
13304
|
-
tool_call:
|
|
14242
|
+
catalogModelEntrySchema = z13.object({
|
|
14243
|
+
id: z13.string(),
|
|
14244
|
+
name: z13.string(),
|
|
14245
|
+
family: z13.string(),
|
|
14246
|
+
attachment: z13.boolean(),
|
|
14247
|
+
reasoning: z13.boolean(),
|
|
14248
|
+
temperature: z13.boolean(),
|
|
14249
|
+
interleaved: z13.boolean(),
|
|
14250
|
+
tool_call: z13.boolean(),
|
|
13305
14251
|
modalities: catalogModalitiesSchema,
|
|
13306
14252
|
cost: catalogCostSchema,
|
|
13307
14253
|
limit: catalogLimitSchema,
|
|
13308
|
-
status:
|
|
14254
|
+
status: z13.enum(CATALOG_MODEL_STATUSES),
|
|
13309
14255
|
release_date: isoDate,
|
|
13310
14256
|
provider: catalogModelProviderSchema
|
|
13311
14257
|
}).strict();
|
|
13312
|
-
catalogProviderSchema =
|
|
13313
|
-
id:
|
|
13314
|
-
endpoint:
|
|
13315
|
-
authTypes:
|
|
13316
|
-
npm:
|
|
14258
|
+
catalogProviderSchema = z13.object({
|
|
14259
|
+
id: z13.string(),
|
|
14260
|
+
endpoint: z13.string(),
|
|
14261
|
+
authTypes: z13.array(z13.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
14262
|
+
npm: z13.string().optional()
|
|
13317
14263
|
}).strict();
|
|
13318
|
-
curatedCatalogSchema =
|
|
13319
|
-
$schema:
|
|
14264
|
+
curatedCatalogSchema = z13.object({
|
|
14265
|
+
$schema: z13.string().optional(),
|
|
13320
14266
|
version: semver,
|
|
13321
14267
|
lastUpdated: isoDate,
|
|
13322
|
-
providers:
|
|
13323
|
-
models:
|
|
14268
|
+
providers: z13.record(z13.string(), catalogProviderSchema),
|
|
14269
|
+
models: z13.record(z13.string(), z13.record(z13.string(), catalogModelEntrySchema))
|
|
13324
14270
|
}).strict();
|
|
13325
|
-
modelsCatalogRowInsertSchema =
|
|
13326
|
-
id:
|
|
13327
|
-
providerId:
|
|
13328
|
-
name:
|
|
13329
|
-
family:
|
|
13330
|
-
attachment:
|
|
13331
|
-
reasoning:
|
|
13332
|
-
temperature:
|
|
13333
|
-
interleaved:
|
|
13334
|
-
toolCall:
|
|
13335
|
-
modalities:
|
|
13336
|
-
cost:
|
|
13337
|
-
contextLimit:
|
|
13338
|
-
outputLimit:
|
|
13339
|
-
status:
|
|
14271
|
+
modelsCatalogRowInsertSchema = z13.object({
|
|
14272
|
+
id: z13.string(),
|
|
14273
|
+
providerId: z13.string(),
|
|
14274
|
+
name: z13.string(),
|
|
14275
|
+
family: z13.string(),
|
|
14276
|
+
attachment: z13.boolean(),
|
|
14277
|
+
reasoning: z13.boolean(),
|
|
14278
|
+
temperature: z13.boolean(),
|
|
14279
|
+
interleaved: z13.boolean(),
|
|
14280
|
+
toolCall: z13.boolean(),
|
|
14281
|
+
modalities: z13.string(),
|
|
14282
|
+
cost: z13.string(),
|
|
14283
|
+
contextLimit: z13.number().nullable().optional(),
|
|
14284
|
+
outputLimit: z13.number().nullable().optional(),
|
|
14285
|
+
status: z13.enum(CATALOG_MODEL_STATUSES),
|
|
13340
14286
|
releaseDate: isoDate,
|
|
13341
|
-
modelsDevId:
|
|
13342
|
-
source:
|
|
13343
|
-
seededAt:
|
|
14287
|
+
modelsDevId: z13.string(),
|
|
14288
|
+
source: z13.string(),
|
|
14289
|
+
seededAt: z13.string().optional()
|
|
13344
14290
|
}).strict();
|
|
13345
14291
|
modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
13346
|
-
seededAt:
|
|
14292
|
+
seededAt: z13.string()
|
|
13347
14293
|
});
|
|
13348
14294
|
}
|
|
13349
14295
|
});
|
|
@@ -13458,7 +14404,7 @@ var init_status_registry = __esm({
|
|
|
13458
14404
|
});
|
|
13459
14405
|
|
|
13460
14406
|
// packages/contracts/src/workgraph.ts
|
|
13461
|
-
import { z as
|
|
14407
|
+
import { z as z14 } from "zod";
|
|
13462
14408
|
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;
|
|
13463
14409
|
var init_workgraph = __esm({
|
|
13464
14410
|
"packages/contracts/src/workgraph.ts"() {
|
|
@@ -13466,10 +14412,10 @@ var init_workgraph = __esm({
|
|
|
13466
14412
|
init_enums();
|
|
13467
14413
|
init_status_registry();
|
|
13468
14414
|
E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
13469
|
-
taskTypeSchema =
|
|
13470
|
-
taskPrioritySchema =
|
|
13471
|
-
taskStatusSchema =
|
|
13472
|
-
verificationGateSchema =
|
|
14415
|
+
taskTypeSchema = z14.enum(["saga", "epic", "task", "subtask"]);
|
|
14416
|
+
taskPrioritySchema = z14.enum(["critical", "high", "medium", "low"]);
|
|
14417
|
+
taskStatusSchema = z14.enum(TASK_STATUSES);
|
|
14418
|
+
verificationGateSchema = z14.enum([
|
|
13473
14419
|
"implemented",
|
|
13474
14420
|
"testsPassed",
|
|
13475
14421
|
"qaPassed",
|
|
@@ -13478,7 +14424,7 @@ var init_workgraph = __esm({
|
|
|
13478
14424
|
"documented",
|
|
13479
14425
|
"nexusImpact"
|
|
13480
14426
|
]);
|
|
13481
|
-
workGraphRelationKindSchema =
|
|
14427
|
+
workGraphRelationKindSchema = z14.enum([
|
|
13482
14428
|
"contains",
|
|
13483
14429
|
"depends_on",
|
|
13484
14430
|
"blocks",
|
|
@@ -13486,317 +14432,317 @@ var init_workgraph = __esm({
|
|
|
13486
14432
|
"groups",
|
|
13487
14433
|
"satisfies"
|
|
13488
14434
|
]);
|
|
13489
|
-
workGraphTraversalDirectionSchema =
|
|
14435
|
+
workGraphTraversalDirectionSchema = z14.enum([
|
|
13490
14436
|
"ancestors",
|
|
13491
14437
|
"descendants",
|
|
13492
14438
|
"upstream",
|
|
13493
14439
|
"downstream"
|
|
13494
14440
|
]);
|
|
13495
|
-
workGraphEdgeDirectionSchema =
|
|
13496
|
-
paginationParamsSchema =
|
|
13497
|
-
cursor:
|
|
13498
|
-
limit:
|
|
14441
|
+
workGraphEdgeDirectionSchema = z14.enum(["out", "in", "both"]);
|
|
14442
|
+
paginationParamsSchema = z14.object({
|
|
14443
|
+
cursor: z14.string().min(1).optional(),
|
|
14444
|
+
limit: z14.number().int().positive().max(500).optional()
|
|
13499
14445
|
});
|
|
13500
|
-
workGraphNodeSchema =
|
|
13501
|
-
id:
|
|
14446
|
+
workGraphNodeSchema = z14.object({
|
|
14447
|
+
id: z14.string().min(1),
|
|
13502
14448
|
type: taskTypeSchema,
|
|
13503
|
-
title:
|
|
14449
|
+
title: z14.string(),
|
|
13504
14450
|
status: taskStatusSchema,
|
|
13505
14451
|
priority: taskPrioritySchema,
|
|
13506
|
-
parentId:
|
|
14452
|
+
parentId: z14.string().min(1).optional()
|
|
13507
14453
|
});
|
|
13508
|
-
workGraphEdgeSchema =
|
|
13509
|
-
fromId:
|
|
13510
|
-
toId:
|
|
14454
|
+
workGraphEdgeSchema = z14.object({
|
|
14455
|
+
fromId: z14.string().min(1),
|
|
14456
|
+
toId: z14.string().min(1),
|
|
13511
14457
|
kind: workGraphRelationKindSchema
|
|
13512
14458
|
});
|
|
13513
|
-
workGraphHierarchyEdgeSchema =
|
|
13514
|
-
fromId:
|
|
13515
|
-
toId:
|
|
13516
|
-
kind:
|
|
14459
|
+
workGraphHierarchyEdgeSchema = z14.object({
|
|
14460
|
+
fromId: z14.string().min(1),
|
|
14461
|
+
toId: z14.string().min(1),
|
|
14462
|
+
kind: z14.literal("contains")
|
|
13517
14463
|
}).strict();
|
|
13518
|
-
workGraphPageInfoSchema =
|
|
13519
|
-
nextCursor:
|
|
13520
|
-
hasMore:
|
|
13521
|
-
});
|
|
13522
|
-
workGraphRollupCountsSchema =
|
|
13523
|
-
total:
|
|
13524
|
-
byStatus:
|
|
13525
|
-
byType:
|
|
13526
|
-
});
|
|
13527
|
-
workGraphSubtreePercentagesSchema =
|
|
13528
|
-
done:
|
|
13529
|
-
active:
|
|
13530
|
-
blocked:
|
|
13531
|
-
pending:
|
|
13532
|
-
cancelled:
|
|
13533
|
-
});
|
|
13534
|
-
workGraphProjectionMismatchSchema =
|
|
13535
|
-
field:
|
|
13536
|
-
expected:
|
|
13537
|
-
actual:
|
|
14464
|
+
workGraphPageInfoSchema = z14.object({
|
|
14465
|
+
nextCursor: z14.string().min(1).optional(),
|
|
14466
|
+
hasMore: z14.boolean()
|
|
14467
|
+
});
|
|
14468
|
+
workGraphRollupCountsSchema = z14.object({
|
|
14469
|
+
total: z14.number().int().nonnegative(),
|
|
14470
|
+
byStatus: z14.partialRecord(taskStatusSchema, z14.number().int().nonnegative()),
|
|
14471
|
+
byType: z14.partialRecord(taskTypeSchema, z14.number().int().nonnegative())
|
|
14472
|
+
});
|
|
14473
|
+
workGraphSubtreePercentagesSchema = z14.object({
|
|
14474
|
+
done: z14.number().nonnegative(),
|
|
14475
|
+
active: z14.number().nonnegative(),
|
|
14476
|
+
blocked: z14.number().nonnegative(),
|
|
14477
|
+
pending: z14.number().nonnegative(),
|
|
14478
|
+
cancelled: z14.number().nonnegative()
|
|
14479
|
+
});
|
|
14480
|
+
workGraphProjectionMismatchSchema = z14.object({
|
|
14481
|
+
field: z14.string().min(1),
|
|
14482
|
+
expected: z14.number().int().nonnegative(),
|
|
14483
|
+
actual: z14.number().int().nonnegative()
|
|
13538
14484
|
});
|
|
13539
14485
|
workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
13540
|
-
role:
|
|
13541
|
-
dependencyBlockers:
|
|
13542
|
-
gateBlockers:
|
|
14486
|
+
role: z14.string().min(1).optional(),
|
|
14487
|
+
dependencyBlockers: z14.array(z14.object({ taskId: z14.string().min(1), status: taskStatusSchema })),
|
|
14488
|
+
gateBlockers: z14.array(z14.object({ gate: verificationGateSchema }))
|
|
13543
14489
|
});
|
|
13544
14490
|
workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
13545
|
-
source:
|
|
13546
|
-
relationType:
|
|
13547
|
-
reason:
|
|
14491
|
+
source: z14.literal("relation"),
|
|
14492
|
+
relationType: z14.enum(TASK_RELATION_TYPES),
|
|
14493
|
+
reason: z14.string().min(1).optional()
|
|
13548
14494
|
});
|
|
13549
14495
|
workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
13550
|
-
source:
|
|
13551
|
-
kind:
|
|
14496
|
+
source: z14.literal("dependency"),
|
|
14497
|
+
kind: z14.literal("depends_on")
|
|
13552
14498
|
});
|
|
13553
|
-
workGraphOmissionReasonSchema =
|
|
14499
|
+
workGraphOmissionReasonSchema = z14.enum([
|
|
13554
14500
|
"budget_exceeded",
|
|
13555
14501
|
"not_requested",
|
|
13556
14502
|
"not_available",
|
|
13557
14503
|
"redacted",
|
|
13558
14504
|
"truncated"
|
|
13559
14505
|
]);
|
|
13560
|
-
workGraphContextBudgetSchema =
|
|
13561
|
-
tokenBudget:
|
|
13562
|
-
estimatedTokens:
|
|
13563
|
-
remainingTokens:
|
|
13564
|
-
truncated:
|
|
13565
|
-
});
|
|
13566
|
-
workGraphOmissionSchema =
|
|
13567
|
-
path:
|
|
14506
|
+
workGraphContextBudgetSchema = z14.object({
|
|
14507
|
+
tokenBudget: z14.number().int().nonnegative(),
|
|
14508
|
+
estimatedTokens: z14.number().int().nonnegative(),
|
|
14509
|
+
remainingTokens: z14.number().int().nonnegative(),
|
|
14510
|
+
truncated: z14.boolean()
|
|
14511
|
+
});
|
|
14512
|
+
workGraphOmissionSchema = z14.object({
|
|
14513
|
+
path: z14.string().min(1),
|
|
13568
14514
|
reason: workGraphOmissionReasonSchema,
|
|
13569
|
-
message:
|
|
13570
|
-
estimatedTokens:
|
|
14515
|
+
message: z14.string().min(1),
|
|
14516
|
+
estimatedTokens: z14.number().int().nonnegative().optional()
|
|
13571
14517
|
});
|
|
13572
|
-
workGraphDirectEdgeSchema =
|
|
14518
|
+
workGraphDirectEdgeSchema = z14.discriminatedUnion("source", [
|
|
13573
14519
|
workGraphRelationEdgeSchema,
|
|
13574
14520
|
workGraphDependencyEdgeSchema
|
|
13575
14521
|
]);
|
|
13576
14522
|
workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
13577
|
-
rootId:
|
|
13578
|
-
tokenBudget:
|
|
13579
|
-
includeRelations:
|
|
13580
|
-
includeReadiness:
|
|
13581
|
-
includeRollup:
|
|
14523
|
+
rootId: z14.string().min(1),
|
|
14524
|
+
tokenBudget: z14.number().int().positive().optional(),
|
|
14525
|
+
includeRelations: z14.boolean().optional(),
|
|
14526
|
+
includeReadiness: z14.boolean().optional(),
|
|
14527
|
+
includeRollup: z14.boolean().optional()
|
|
13582
14528
|
});
|
|
13583
14529
|
workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
13584
|
-
rootId:
|
|
14530
|
+
rootId: z14.string().min(1),
|
|
13585
14531
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
13586
|
-
maxDepth:
|
|
13587
|
-
includeRelations:
|
|
14532
|
+
maxDepth: z14.number().int().nonnegative().optional(),
|
|
14533
|
+
includeRelations: z14.boolean().optional()
|
|
13588
14534
|
});
|
|
13589
|
-
workGraphSliceSchema =
|
|
13590
|
-
rootId:
|
|
14535
|
+
workGraphSliceSchema = z14.object({
|
|
14536
|
+
rootId: z14.string().min(1),
|
|
13591
14537
|
direction: workGraphTraversalDirectionSchema,
|
|
13592
|
-
nodes:
|
|
13593
|
-
edges:
|
|
14538
|
+
nodes: z14.array(workGraphNodeSchema),
|
|
14539
|
+
edges: z14.array(workGraphEdgeSchema),
|
|
13594
14540
|
pageInfo: workGraphPageInfoSchema,
|
|
13595
|
-
omissions:
|
|
13596
|
-
});
|
|
13597
|
-
workGraphReadinessParamsSchema =
|
|
13598
|
-
rootId:
|
|
13599
|
-
role:
|
|
13600
|
-
includeGateBlockers:
|
|
13601
|
-
});
|
|
13602
|
-
workGraphReadinessResultSchema =
|
|
13603
|
-
rootId:
|
|
13604
|
-
role:
|
|
13605
|
-
ready:
|
|
13606
|
-
warnings:
|
|
13607
|
-
groups:
|
|
13608
|
-
ready:
|
|
13609
|
-
blocked:
|
|
13610
|
-
blockedBy:
|
|
13611
|
-
|
|
13612
|
-
|
|
13613
|
-
kind:
|
|
13614
|
-
blockerId:
|
|
13615
|
-
blocks:
|
|
14541
|
+
omissions: z14.array(workGraphOmissionSchema).optional()
|
|
14542
|
+
});
|
|
14543
|
+
workGraphReadinessParamsSchema = z14.object({
|
|
14544
|
+
rootId: z14.string().min(1),
|
|
14545
|
+
role: z14.string().min(1).optional(),
|
|
14546
|
+
includeGateBlockers: z14.boolean().optional()
|
|
14547
|
+
});
|
|
14548
|
+
workGraphReadinessResultSchema = z14.object({
|
|
14549
|
+
rootId: z14.string().min(1),
|
|
14550
|
+
role: z14.string().min(1).optional(),
|
|
14551
|
+
ready: z14.boolean(),
|
|
14552
|
+
warnings: z14.array(z14.string()),
|
|
14553
|
+
groups: z14.object({
|
|
14554
|
+
ready: z14.array(workGraphReadyFrontierTaskSchema),
|
|
14555
|
+
blocked: z14.array(workGraphReadyFrontierTaskSchema),
|
|
14556
|
+
blockedBy: z14.array(
|
|
14557
|
+
z14.discriminatedUnion("kind", [
|
|
14558
|
+
z14.object({
|
|
14559
|
+
kind: z14.literal("dependency"),
|
|
14560
|
+
blockerId: z14.string().min(1),
|
|
14561
|
+
blocks: z14.array(z14.string().min(1))
|
|
13616
14562
|
}),
|
|
13617
|
-
|
|
13618
|
-
kind:
|
|
14563
|
+
z14.object({
|
|
14564
|
+
kind: z14.literal("gate"),
|
|
13619
14565
|
gate: verificationGateSchema,
|
|
13620
|
-
blocks:
|
|
14566
|
+
blocks: z14.array(z14.string().min(1))
|
|
13621
14567
|
})
|
|
13622
14568
|
])
|
|
13623
14569
|
)
|
|
13624
14570
|
})
|
|
13625
14571
|
});
|
|
13626
|
-
workGraphContextPackSchema =
|
|
13627
|
-
rootId:
|
|
13628
|
-
generatedAt:
|
|
14572
|
+
workGraphContextPackSchema = z14.object({
|
|
14573
|
+
rootId: z14.string().min(1),
|
|
14574
|
+
generatedAt: z14.string().min(1),
|
|
13629
14575
|
budget: workGraphContextBudgetSchema,
|
|
13630
14576
|
slice: workGraphSliceSchema,
|
|
13631
|
-
relationEdges:
|
|
13632
|
-
rootId:
|
|
14577
|
+
relationEdges: z14.object({
|
|
14578
|
+
rootId: z14.string().min(1),
|
|
13633
14579
|
direction: workGraphEdgeDirectionSchema,
|
|
13634
|
-
edges:
|
|
14580
|
+
edges: z14.array(workGraphDirectEdgeSchema)
|
|
13635
14581
|
}).optional(),
|
|
13636
14582
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
13637
|
-
rollup:
|
|
13638
|
-
omissions:
|
|
13639
|
-
});
|
|
13640
|
-
workGraphScaffoldValidateParamsSchema =
|
|
13641
|
-
rootId:
|
|
13642
|
-
nodes:
|
|
13643
|
-
|
|
13644
|
-
id:
|
|
14583
|
+
rollup: z14.lazy(() => tasksRollupResultSchema).optional(),
|
|
14584
|
+
omissions: z14.array(workGraphOmissionSchema)
|
|
14585
|
+
});
|
|
14586
|
+
workGraphScaffoldValidateParamsSchema = z14.object({
|
|
14587
|
+
rootId: z14.string().min(1),
|
|
14588
|
+
nodes: z14.array(
|
|
14589
|
+
z14.object({
|
|
14590
|
+
id: z14.string().min(1),
|
|
13645
14591
|
type: taskTypeSchema,
|
|
13646
|
-
parentId:
|
|
14592
|
+
parentId: z14.string().min(1).nullable().optional()
|
|
13647
14593
|
})
|
|
13648
14594
|
),
|
|
13649
|
-
edges:
|
|
13650
|
-
dryRun:
|
|
13651
|
-
});
|
|
13652
|
-
workGraphScaffoldValidationIssueSchema =
|
|
13653
|
-
code:
|
|
13654
|
-
message:
|
|
13655
|
-
taskId:
|
|
13656
|
-
severity:
|
|
13657
|
-
});
|
|
13658
|
-
workGraphScaffoldValidateResultSchema =
|
|
13659
|
-
rootId:
|
|
13660
|
-
valid:
|
|
13661
|
-
dryRun:
|
|
13662
|
-
issues:
|
|
13663
|
-
hierarchy:
|
|
13664
|
-
valid:
|
|
13665
|
-
violations:
|
|
13666
|
-
|
|
13667
|
-
code:
|
|
13668
|
-
taskId:
|
|
14595
|
+
edges: z14.array(workGraphDirectEdgeSchema).optional(),
|
|
14596
|
+
dryRun: z14.boolean().optional()
|
|
14597
|
+
});
|
|
14598
|
+
workGraphScaffoldValidationIssueSchema = z14.object({
|
|
14599
|
+
code: z14.string().min(1),
|
|
14600
|
+
message: z14.string().min(1),
|
|
14601
|
+
taskId: z14.string().min(1).optional(),
|
|
14602
|
+
severity: z14.enum(["error", "warning"])
|
|
14603
|
+
});
|
|
14604
|
+
workGraphScaffoldValidateResultSchema = z14.object({
|
|
14605
|
+
rootId: z14.string().min(1),
|
|
14606
|
+
valid: z14.boolean(),
|
|
14607
|
+
dryRun: z14.boolean(),
|
|
14608
|
+
issues: z14.array(workGraphScaffoldValidationIssueSchema),
|
|
14609
|
+
hierarchy: z14.object({
|
|
14610
|
+
valid: z14.boolean(),
|
|
14611
|
+
violations: z14.array(
|
|
14612
|
+
z14.object({
|
|
14613
|
+
code: z14.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
14614
|
+
taskId: z14.string().min(1),
|
|
13669
14615
|
taskType: taskTypeSchema,
|
|
13670
|
-
parentId:
|
|
14616
|
+
parentId: z14.string().min(1).nullable(),
|
|
13671
14617
|
parentType: taskTypeSchema.optional(),
|
|
13672
|
-
message:
|
|
14618
|
+
message: z14.string().min(1)
|
|
13673
14619
|
})
|
|
13674
14620
|
)
|
|
13675
14621
|
})
|
|
13676
14622
|
});
|
|
13677
14623
|
workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
13678
|
-
apply:
|
|
14624
|
+
apply: z14.boolean().optional()
|
|
13679
14625
|
});
|
|
13680
14626
|
workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
13681
|
-
applied:
|
|
13682
|
-
nodesChanged:
|
|
13683
|
-
edgesChanged:
|
|
13684
|
-
});
|
|
13685
|
-
workGraphPlanningDocParamsSchema =
|
|
13686
|
-
rootId:
|
|
13687
|
-
audience:
|
|
13688
|
-
tokenBudget:
|
|
13689
|
-
includeRelations:
|
|
13690
|
-
includeReadiness:
|
|
13691
|
-
includeRollup:
|
|
13692
|
-
});
|
|
13693
|
-
workGraphPlanningDocSchema =
|
|
13694
|
-
rootId:
|
|
13695
|
-
generatedAt:
|
|
13696
|
-
audience:
|
|
13697
|
-
title:
|
|
13698
|
-
content:
|
|
13699
|
-
sections:
|
|
13700
|
-
estimatedTokens:
|
|
13701
|
-
budget:
|
|
13702
|
-
tokenBudget:
|
|
13703
|
-
truncated:
|
|
14627
|
+
applied: z14.boolean(),
|
|
14628
|
+
nodesChanged: z14.number().int().nonnegative(),
|
|
14629
|
+
edgesChanged: z14.number().int().nonnegative()
|
|
14630
|
+
});
|
|
14631
|
+
workGraphPlanningDocParamsSchema = z14.object({
|
|
14632
|
+
rootId: z14.string().min(1),
|
|
14633
|
+
audience: z14.enum(["agent", "maintainer"]),
|
|
14634
|
+
tokenBudget: z14.number().int().positive().optional(),
|
|
14635
|
+
includeRelations: z14.boolean().optional(),
|
|
14636
|
+
includeReadiness: z14.boolean().optional(),
|
|
14637
|
+
includeRollup: z14.boolean().optional()
|
|
14638
|
+
});
|
|
14639
|
+
workGraphPlanningDocSchema = z14.object({
|
|
14640
|
+
rootId: z14.string().min(1),
|
|
14641
|
+
generatedAt: z14.string().min(1),
|
|
14642
|
+
audience: z14.enum(["agent", "maintainer"]),
|
|
14643
|
+
title: z14.string().min(1),
|
|
14644
|
+
content: z14.string(),
|
|
14645
|
+
sections: z14.array(z14.string().min(1)),
|
|
14646
|
+
estimatedTokens: z14.number().int().nonnegative(),
|
|
14647
|
+
budget: z14.object({
|
|
14648
|
+
tokenBudget: z14.number().int().positive(),
|
|
14649
|
+
truncated: z14.boolean()
|
|
13704
14650
|
}).optional()
|
|
13705
14651
|
});
|
|
13706
14652
|
tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
13707
|
-
rootId:
|
|
14653
|
+
rootId: z14.string().min(1),
|
|
13708
14654
|
direction: workGraphTraversalDirectionSchema,
|
|
13709
|
-
maxDepth:
|
|
13710
|
-
includeRelations:
|
|
14655
|
+
maxDepth: z14.number().int().nonnegative().optional(),
|
|
14656
|
+
includeRelations: z14.boolean().optional()
|
|
13711
14657
|
});
|
|
13712
|
-
tasksTraverseResultSchema =
|
|
13713
|
-
rootId:
|
|
14658
|
+
tasksTraverseResultSchema = z14.object({
|
|
14659
|
+
rootId: z14.string().min(1),
|
|
13714
14660
|
direction: workGraphTraversalDirectionSchema,
|
|
13715
|
-
nodes:
|
|
13716
|
-
edges:
|
|
14661
|
+
nodes: z14.array(workGraphNodeSchema),
|
|
14662
|
+
edges: z14.array(workGraphEdgeSchema),
|
|
13717
14663
|
pageInfo: workGraphPageInfoSchema
|
|
13718
14664
|
});
|
|
13719
14665
|
tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
13720
|
-
rootId:
|
|
13721
|
-
maxDepth:
|
|
14666
|
+
rootId: z14.string().min(1),
|
|
14667
|
+
maxDepth: z14.number().int().nonnegative().optional()
|
|
13722
14668
|
});
|
|
13723
|
-
tasksTreeResultSchema =
|
|
13724
|
-
rootId:
|
|
13725
|
-
nodes:
|
|
13726
|
-
edges:
|
|
14669
|
+
tasksTreeResultSchema = z14.object({
|
|
14670
|
+
rootId: z14.string().min(1),
|
|
14671
|
+
nodes: z14.array(workGraphNodeSchema.extend({ depth: z14.number().int().positive() })),
|
|
14672
|
+
edges: z14.array(workGraphHierarchyEdgeSchema),
|
|
13727
14673
|
pageInfo: workGraphPageInfoSchema
|
|
13728
14674
|
});
|
|
13729
|
-
tasksRollupParamsSchema =
|
|
13730
|
-
rootId:
|
|
14675
|
+
tasksRollupParamsSchema = z14.object({
|
|
14676
|
+
rootId: z14.string().min(1),
|
|
13731
14677
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
13732
14678
|
});
|
|
13733
|
-
tasksRollupResultSchema =
|
|
13734
|
-
rootId:
|
|
14679
|
+
tasksRollupResultSchema = z14.object({
|
|
14680
|
+
rootId: z14.string().min(1),
|
|
13735
14681
|
direct: workGraphRollupCountsSchema,
|
|
13736
14682
|
subtree: workGraphRollupCountsSchema,
|
|
13737
|
-
percentDenominator:
|
|
13738
|
-
basis:
|
|
13739
|
-
total:
|
|
13740
|
-
description:
|
|
14683
|
+
percentDenominator: z14.object({
|
|
14684
|
+
basis: z14.literal("subtree-total"),
|
|
14685
|
+
total: z14.number().int().nonnegative(),
|
|
14686
|
+
description: z14.string().min(1)
|
|
13741
14687
|
}),
|
|
13742
14688
|
percentages: workGraphSubtreePercentagesSchema,
|
|
13743
|
-
staleProjection:
|
|
13744
|
-
projectionMismatches:
|
|
13745
|
-
});
|
|
13746
|
-
tasksFrontierParamsSchema =
|
|
13747
|
-
rootId:
|
|
13748
|
-
role:
|
|
13749
|
-
});
|
|
13750
|
-
tasksFrontierResultSchema =
|
|
13751
|
-
rootId:
|
|
13752
|
-
role:
|
|
13753
|
-
groups:
|
|
13754
|
-
ready:
|
|
13755
|
-
blocked:
|
|
13756
|
-
blockedBy:
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
kind:
|
|
13760
|
-
blockerId:
|
|
13761
|
-
blocks:
|
|
14689
|
+
staleProjection: z14.boolean(),
|
|
14690
|
+
projectionMismatches: z14.array(workGraphProjectionMismatchSchema)
|
|
14691
|
+
});
|
|
14692
|
+
tasksFrontierParamsSchema = z14.object({
|
|
14693
|
+
rootId: z14.string().min(1),
|
|
14694
|
+
role: z14.string().min(1).optional()
|
|
14695
|
+
});
|
|
14696
|
+
tasksFrontierResultSchema = z14.object({
|
|
14697
|
+
rootId: z14.string().min(1),
|
|
14698
|
+
role: z14.string().min(1).optional(),
|
|
14699
|
+
groups: z14.object({
|
|
14700
|
+
ready: z14.array(workGraphReadyFrontierTaskSchema),
|
|
14701
|
+
blocked: z14.array(workGraphReadyFrontierTaskSchema),
|
|
14702
|
+
blockedBy: z14.array(
|
|
14703
|
+
z14.discriminatedUnion("kind", [
|
|
14704
|
+
z14.object({
|
|
14705
|
+
kind: z14.literal("dependency"),
|
|
14706
|
+
blockerId: z14.string().min(1),
|
|
14707
|
+
blocks: z14.array(z14.string().min(1))
|
|
13762
14708
|
}),
|
|
13763
|
-
|
|
13764
|
-
kind:
|
|
14709
|
+
z14.object({
|
|
14710
|
+
kind: z14.literal("gate"),
|
|
13765
14711
|
gate: verificationGateSchema,
|
|
13766
|
-
blocks:
|
|
14712
|
+
blocks: z14.array(z14.string().min(1))
|
|
13767
14713
|
})
|
|
13768
14714
|
])
|
|
13769
14715
|
)
|
|
13770
14716
|
})
|
|
13771
14717
|
});
|
|
13772
14718
|
tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
13773
|
-
rootId:
|
|
13774
|
-
maxDepth:
|
|
13775
|
-
includeRelations:
|
|
13776
|
-
});
|
|
13777
|
-
tasksWorkGraphAuditResultSchema =
|
|
13778
|
-
rootId:
|
|
13779
|
-
hierarchy:
|
|
13780
|
-
valid:
|
|
13781
|
-
violations:
|
|
13782
|
-
|
|
13783
|
-
code:
|
|
13784
|
-
taskId:
|
|
14719
|
+
rootId: z14.string().min(1),
|
|
14720
|
+
maxDepth: z14.number().int().nonnegative().optional(),
|
|
14721
|
+
includeRelations: z14.boolean().optional()
|
|
14722
|
+
});
|
|
14723
|
+
tasksWorkGraphAuditResultSchema = z14.object({
|
|
14724
|
+
rootId: z14.string().min(1),
|
|
14725
|
+
hierarchy: z14.object({
|
|
14726
|
+
valid: z14.boolean(),
|
|
14727
|
+
violations: z14.array(
|
|
14728
|
+
z14.object({
|
|
14729
|
+
code: z14.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
14730
|
+
taskId: z14.string().min(1),
|
|
13785
14731
|
taskType: taskTypeSchema,
|
|
13786
|
-
parentId:
|
|
14732
|
+
parentId: z14.string().min(1).nullable(),
|
|
13787
14733
|
parentType: taskTypeSchema.optional(),
|
|
13788
|
-
message:
|
|
14734
|
+
message: z14.string().min(1)
|
|
13789
14735
|
})
|
|
13790
14736
|
)
|
|
13791
14737
|
}),
|
|
13792
14738
|
traversal: tasksTraverseResultSchema,
|
|
13793
14739
|
frontier: tasksFrontierResultSchema,
|
|
13794
14740
|
rollup: tasksRollupResultSchema,
|
|
13795
|
-
relationEdges:
|
|
13796
|
-
rootId:
|
|
14741
|
+
relationEdges: z14.object({
|
|
14742
|
+
rootId: z14.string().min(1),
|
|
13797
14743
|
direction: workGraphEdgeDirectionSchema,
|
|
13798
|
-
edges:
|
|
13799
|
-
|
|
14744
|
+
edges: z14.array(
|
|
14745
|
+
z14.discriminatedUnion("source", [
|
|
13800
14746
|
workGraphRelationEdgeSchema,
|
|
13801
14747
|
workGraphDependencyEdgeSchema
|
|
13802
14748
|
])
|
|
@@ -13816,22 +14762,22 @@ var init_operation_envelope_validation = __esm({
|
|
|
13816
14762
|
});
|
|
13817
14763
|
|
|
13818
14764
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
13819
|
-
import { z as
|
|
14765
|
+
import { z as z15 } from "zod";
|
|
13820
14766
|
var taskTreeEntrySchema, taskTreeSchema, evidenceSchema, passthroughSchema, LEGACY_PASSTHROUGH_SCHEMA_NAMES, ENSURES_SCHEMA_REGISTRY;
|
|
13821
14767
|
var init_ensures_schema_registry = __esm({
|
|
13822
14768
|
"packages/contracts/src/operations/ensures-schema-registry.ts"() {
|
|
13823
14769
|
"use strict";
|
|
13824
|
-
taskTreeEntrySchema =
|
|
13825
|
-
title:
|
|
13826
|
-
acceptance:
|
|
14770
|
+
taskTreeEntrySchema = z15.object({
|
|
14771
|
+
title: z15.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
|
|
14772
|
+
acceptance: z15.array(z15.unknown(), { message: "must have a non-empty acceptance array" }).min(1, { message: "must have a non-empty acceptance array" }).refine((arr) => arr.some((s) => typeof s === "string" && s.trim().length > 0), {
|
|
13827
14773
|
message: "acceptance array contains no non-empty strings"
|
|
13828
14774
|
}),
|
|
13829
|
-
id:
|
|
13830
|
-
parentId:
|
|
13831
|
-
depends:
|
|
14775
|
+
id: z15.string().optional(),
|
|
14776
|
+
parentId: z15.string().optional(),
|
|
14777
|
+
depends: z15.array(z15.string()).optional()
|
|
13832
14778
|
});
|
|
13833
|
-
taskTreeSchema =
|
|
13834
|
-
evidenceSchema =
|
|
14779
|
+
taskTreeSchema = z15.array(taskTreeEntrySchema, { message: "task_tree must be a non-empty array" }).min(1, { message: "task_tree is an empty array \u2014 decomposition produced no tasks" });
|
|
14780
|
+
evidenceSchema = z15.unknown().superRefine((value, ctx) => {
|
|
13835
14781
|
if (value === null || value === void 0) {
|
|
13836
14782
|
ctx.addIssue({
|
|
13837
14783
|
code: "custom",
|
|
@@ -13865,7 +14811,7 @@ var init_ensures_schema_registry = __esm({
|
|
|
13865
14811
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
13866
14812
|
});
|
|
13867
14813
|
});
|
|
13868
|
-
passthroughSchema =
|
|
14814
|
+
passthroughSchema = z15.unknown();
|
|
13869
14815
|
LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
13870
14816
|
// release.cantbook
|
|
13871
14817
|
"version_bump_report",
|
|
@@ -14143,31 +15089,37 @@ var init_peer = __esm({
|
|
|
14143
15089
|
});
|
|
14144
15090
|
|
|
14145
15091
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
14146
|
-
import { z as
|
|
15092
|
+
import { z as z16 } from "zod";
|
|
14147
15093
|
var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
|
|
14148
15094
|
var init_evidence_atoms = __esm({
|
|
14149
15095
|
"packages/contracts/src/release/evidence-atoms.ts"() {
|
|
14150
15096
|
"use strict";
|
|
14151
|
-
parsedPrEvidenceAtomSchema =
|
|
14152
|
-
kind:
|
|
14153
|
-
prNumber:
|
|
14154
|
-
});
|
|
14155
|
-
prEvidenceStateModifierSchema =
|
|
14156
|
-
kind:
|
|
14157
|
-
value:
|
|
14158
|
-
});
|
|
14159
|
-
ghPrViewSchema =
|
|
14160
|
-
state:
|
|
14161
|
-
mergedAt:
|
|
14162
|
-
headRefOid:
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
15097
|
+
parsedPrEvidenceAtomSchema = z16.object({
|
|
15098
|
+
kind: z16.literal("pr"),
|
|
15099
|
+
prNumber: z16.number().int().positive()
|
|
15100
|
+
});
|
|
15101
|
+
prEvidenceStateModifierSchema = z16.object({
|
|
15102
|
+
kind: z16.literal("state"),
|
|
15103
|
+
value: z16.literal("MERGED")
|
|
15104
|
+
});
|
|
15105
|
+
ghPrViewSchema = z16.object({
|
|
15106
|
+
state: z16.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
15107
|
+
mergedAt: z16.string().nullable(),
|
|
15108
|
+
headRefOid: z16.string().optional(),
|
|
15109
|
+
mergeCommit: z16.object({ oid: z16.string() }).nullable().optional(),
|
|
15110
|
+
title: z16.string().optional(),
|
|
15111
|
+
body: z16.string().optional(),
|
|
15112
|
+
headRefName: z16.string().optional(),
|
|
15113
|
+
files: z16.array(z16.object({ path: z16.string() })).optional(),
|
|
15114
|
+
changedFiles: z16.number().int().nonnegative().optional(),
|
|
15115
|
+
mergeable: z16.string().optional(),
|
|
15116
|
+
statusCheckRollup: z16.array(
|
|
15117
|
+
z16.object({
|
|
15118
|
+
__typename: z16.string().optional(),
|
|
15119
|
+
name: z16.string().optional(),
|
|
15120
|
+
workflowName: z16.string().optional(),
|
|
15121
|
+
conclusion: z16.string().nullable().optional(),
|
|
15122
|
+
status: z16.string().optional()
|
|
14171
15123
|
}).passthrough()
|
|
14172
15124
|
).optional().default([])
|
|
14173
15125
|
}).passthrough();
|
|
@@ -14180,7 +15132,7 @@ var init_evidence_atoms = __esm({
|
|
|
14180
15132
|
});
|
|
14181
15133
|
|
|
14182
15134
|
// packages/contracts/src/release/plan.ts
|
|
14183
|
-
import { z as
|
|
15135
|
+
import { z as z17 } from "zod";
|
|
14184
15136
|
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;
|
|
14185
15137
|
var init_plan = __esm({
|
|
14186
15138
|
"packages/contracts/src/release/plan.ts"() {
|
|
@@ -14223,20 +15175,20 @@ var init_plan = __esm({
|
|
|
14223
15175
|
];
|
|
14224
15176
|
IMPACT = ["major", "minor", "patch"];
|
|
14225
15177
|
RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
|
|
14226
|
-
ReleaseChannelSchema =
|
|
14227
|
-
ReleaseSchemeSchema =
|
|
14228
|
-
ReleaseKindSchema =
|
|
14229
|
-
ReleaseStatusSchema =
|
|
14230
|
-
GateStatusSchema =
|
|
14231
|
-
GateNameSchema =
|
|
14232
|
-
PlatformTupleSchema =
|
|
14233
|
-
PublisherSchema =
|
|
14234
|
-
TaskKindSchema =
|
|
14235
|
-
ImpactSchema =
|
|
14236
|
-
ResolvedSourceSchema =
|
|
14237
|
-
Iso8601 =
|
|
14238
|
-
NonEmptyString =
|
|
14239
|
-
ReleasePlanTaskSchema =
|
|
15178
|
+
ReleaseChannelSchema = z17.enum(RELEASE_CHANNEL);
|
|
15179
|
+
ReleaseSchemeSchema = z17.enum(RELEASE_SCHEME);
|
|
15180
|
+
ReleaseKindSchema = z17.enum(RELEASE_KIND);
|
|
15181
|
+
ReleaseStatusSchema = z17.enum(RELEASE_STATUS);
|
|
15182
|
+
GateStatusSchema = z17.enum(GATE_STATUS);
|
|
15183
|
+
GateNameSchema = z17.enum(GATE_NAME);
|
|
15184
|
+
PlatformTupleSchema = z17.enum(PLATFORM_TUPLE);
|
|
15185
|
+
PublisherSchema = z17.enum(PUBLISHER);
|
|
15186
|
+
TaskKindSchema = z17.enum(TASK_KIND);
|
|
15187
|
+
ImpactSchema = z17.enum(IMPACT);
|
|
15188
|
+
ResolvedSourceSchema = z17.enum(RESOLVED_SOURCE);
|
|
15189
|
+
Iso8601 = z17.iso.datetime({ offset: true });
|
|
15190
|
+
NonEmptyString = z17.string().min(1);
|
|
15191
|
+
ReleasePlanTaskSchema = z17.object({
|
|
14240
15192
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
14241
15193
|
id: NonEmptyString,
|
|
14242
15194
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -14244,20 +15196,20 @@ var init_plan = __esm({
|
|
|
14244
15196
|
/** SemVer impact classification. */
|
|
14245
15197
|
impact: ImpactSchema,
|
|
14246
15198
|
/** Human-readable changelog line for this task. */
|
|
14247
|
-
userFacingSummary:
|
|
15199
|
+
userFacingSummary: z17.string(),
|
|
14248
15200
|
/**
|
|
14249
15201
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
14250
15202
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
14251
15203
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
14252
15204
|
* enforces non-empty via R-301.
|
|
14253
15205
|
*/
|
|
14254
|
-
evidenceAtoms:
|
|
15206
|
+
evidenceAtoms: z17.array(NonEmptyString),
|
|
14255
15207
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
14256
|
-
ivtrPhaseAtPlan:
|
|
15208
|
+
ivtrPhaseAtPlan: z17.string().optional(),
|
|
14257
15209
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
14258
15210
|
epicAncestor: NonEmptyString
|
|
14259
15211
|
});
|
|
14260
|
-
ReleaseGateSchema =
|
|
15212
|
+
ReleaseGateSchema = z17.object({
|
|
14261
15213
|
/** Canonical gate name. */
|
|
14262
15214
|
name: GateNameSchema,
|
|
14263
15215
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -14267,11 +15219,11 @@ var init_plan = __esm({
|
|
|
14267
15219
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
14268
15220
|
lastVerifiedAt: Iso8601,
|
|
14269
15221
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
14270
|
-
resolvedCommand:
|
|
15222
|
+
resolvedCommand: z17.string().optional(),
|
|
14271
15223
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
14272
15224
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
14273
15225
|
});
|
|
14274
|
-
ReleasePlatformMatrixEntrySchema =
|
|
15226
|
+
ReleasePlatformMatrixEntrySchema = z17.object({
|
|
14275
15227
|
/** Target platform tuple. */
|
|
14276
15228
|
platform: PlatformTupleSchema,
|
|
14277
15229
|
/** Distribution backend. */
|
|
@@ -14279,47 +15231,47 @@ var init_plan = __esm({
|
|
|
14279
15231
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
14280
15232
|
package: NonEmptyString,
|
|
14281
15233
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
14282
|
-
smoke:
|
|
15234
|
+
smoke: z17.boolean().default(true).optional()
|
|
14283
15235
|
});
|
|
14284
|
-
ReleasePreflightSummarySchema =
|
|
15236
|
+
ReleasePreflightSummarySchema = z17.object({
|
|
14285
15237
|
/** True if esbuild externals are out of sync with package.json. */
|
|
14286
|
-
esbuildExternalsDrift:
|
|
15238
|
+
esbuildExternalsDrift: z17.boolean(),
|
|
14287
15239
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
14288
|
-
lockfileDrift:
|
|
15240
|
+
lockfileDrift: z17.boolean(),
|
|
14289
15241
|
/** True if all epic children are in terminal lifecycle states. */
|
|
14290
|
-
epicCompletenessClean:
|
|
15242
|
+
epicCompletenessClean: z17.boolean(),
|
|
14291
15243
|
/** True if no task appears in multiple in-flight release plans. */
|
|
14292
|
-
doubleListingClean:
|
|
15244
|
+
doubleListingClean: z17.boolean(),
|
|
14293
15245
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
14294
|
-
preflightWarnings:
|
|
15246
|
+
preflightWarnings: z17.array(z17.string()).default([]).optional()
|
|
14295
15247
|
});
|
|
14296
|
-
ReleasePlanChangelogSchema =
|
|
15248
|
+
ReleasePlanChangelogSchema = z17.object({
|
|
14297
15249
|
/** `kind=feat` tasks. */
|
|
14298
|
-
features:
|
|
15250
|
+
features: z17.array(NonEmptyString).default([]),
|
|
14299
15251
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
14300
|
-
fixes:
|
|
15252
|
+
fixes: z17.array(NonEmptyString).default([]),
|
|
14301
15253
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
14302
|
-
chores:
|
|
15254
|
+
chores: z17.array(NonEmptyString).default([]),
|
|
14303
15255
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
14304
|
-
breaking:
|
|
15256
|
+
breaking: z17.array(NonEmptyString).default([])
|
|
14305
15257
|
});
|
|
14306
|
-
ReleasePlanMetaSchema =
|
|
15258
|
+
ReleasePlanMetaSchema = z17.object({
|
|
14307
15259
|
/** True if this is the project's first ever release. */
|
|
14308
|
-
firstEverRelease:
|
|
15260
|
+
firstEverRelease: z17.boolean().optional(),
|
|
14309
15261
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
14310
|
-
unresolvedTools:
|
|
15262
|
+
unresolvedTools: z17.array(z17.string()).optional(),
|
|
14311
15263
|
/** Project archetype detected at plan time. */
|
|
14312
|
-
archetype:
|
|
14313
|
-
}).catchall(
|
|
14314
|
-
ReleasePlanSchema =
|
|
15264
|
+
archetype: z17.string().optional()
|
|
15265
|
+
}).catchall(z17.unknown());
|
|
15266
|
+
ReleasePlanSchema = z17.object({
|
|
14315
15267
|
/** Schema URL for this plan version. */
|
|
14316
|
-
$schema:
|
|
15268
|
+
$schema: z17.string().optional(),
|
|
14317
15269
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
14318
15270
|
version: NonEmptyString,
|
|
14319
15271
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
14320
15272
|
resolvedVersion: NonEmptyString,
|
|
14321
15273
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
14322
|
-
suffixApplied:
|
|
15274
|
+
suffixApplied: z17.boolean(),
|
|
14323
15275
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
14324
15276
|
scheme: ReleaseSchemeSchema,
|
|
14325
15277
|
/** npm dist-tag channel for this release. */
|
|
@@ -14336,27 +15288,27 @@ var init_plan = __esm({
|
|
|
14336
15288
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
14337
15289
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
14338
15290
|
*/
|
|
14339
|
-
previousVersion:
|
|
15291
|
+
previousVersion: z17.string().nullable(),
|
|
14340
15292
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
14341
|
-
previousTag:
|
|
15293
|
+
previousTag: z17.string().nullable(),
|
|
14342
15294
|
/** ISO-8601 timestamp the previous release was published. */
|
|
14343
15295
|
previousShippedAt: Iso8601.nullable(),
|
|
14344
15296
|
/** Tasks rolled into this release. */
|
|
14345
|
-
tasks:
|
|
15297
|
+
tasks: z17.array(ReleasePlanTaskSchema),
|
|
14346
15298
|
/** Bucketed changelog. */
|
|
14347
15299
|
changelog: ReleasePlanChangelogSchema,
|
|
14348
15300
|
/** Per-gate verification status. */
|
|
14349
|
-
gates:
|
|
15301
|
+
gates: z17.array(ReleaseGateSchema),
|
|
14350
15302
|
/** Platform / publisher matrix. */
|
|
14351
|
-
platformMatrix:
|
|
15303
|
+
platformMatrix: z17.array(ReleasePlatformMatrixEntrySchema),
|
|
14352
15304
|
/** Preflight summary from `cleo release plan`. */
|
|
14353
15305
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
14354
15306
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
14355
|
-
workflowRunUrl:
|
|
15307
|
+
workflowRunUrl: z17.string().nullable(),
|
|
14356
15308
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
14357
|
-
prUrl:
|
|
15309
|
+
prUrl: z17.string().nullable(),
|
|
14358
15310
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
14359
|
-
mergeCommitSha:
|
|
15311
|
+
mergeCommitSha: z17.string().nullable(),
|
|
14360
15312
|
/** Current FSM state per R-302. */
|
|
14361
15313
|
status: ReleaseStatusSchema,
|
|
14362
15314
|
/** Informational / forward-compat metadata. */
|
|
@@ -14430,52 +15382,52 @@ var init_session2 = __esm({
|
|
|
14430
15382
|
});
|
|
14431
15383
|
|
|
14432
15384
|
// packages/contracts/src/session-journal.ts
|
|
14433
|
-
import { z as
|
|
15385
|
+
import { z as z18 } from "zod";
|
|
14434
15386
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
14435
15387
|
var init_session_journal = __esm({
|
|
14436
15388
|
"packages/contracts/src/session-journal.ts"() {
|
|
14437
15389
|
"use strict";
|
|
14438
15390
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
14439
|
-
sessionJournalDoctorSummarySchema =
|
|
15391
|
+
sessionJournalDoctorSummarySchema = z18.object({
|
|
14440
15392
|
/** `true` when zero noise patterns were detected. */
|
|
14441
|
-
isClean:
|
|
15393
|
+
isClean: z18.boolean(),
|
|
14442
15394
|
/** Total number of noise findings across all patterns. */
|
|
14443
|
-
findingsCount:
|
|
15395
|
+
findingsCount: z18.number().int().nonnegative(),
|
|
14444
15396
|
/** Pattern names that were detected (empty when isClean). */
|
|
14445
|
-
patterns:
|
|
15397
|
+
patterns: z18.array(z18.string()),
|
|
14446
15398
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
14447
|
-
totalScanned:
|
|
15399
|
+
totalScanned: z18.number().int().nonnegative()
|
|
14448
15400
|
});
|
|
14449
|
-
sessionJournalDebriefSummarySchema =
|
|
15401
|
+
sessionJournalDebriefSummarySchema = z18.object({
|
|
14450
15402
|
/** First 200 characters of the session end note (if provided). */
|
|
14451
|
-
noteExcerpt:
|
|
15403
|
+
noteExcerpt: z18.string().max(200).optional(),
|
|
14452
15404
|
/** Number of tasks completed during the session. */
|
|
14453
|
-
tasksCompletedCount:
|
|
15405
|
+
tasksCompletedCount: z18.number().int().nonnegative(),
|
|
14454
15406
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
14455
|
-
tasksFocused:
|
|
15407
|
+
tasksFocused: z18.array(z18.string()).max(5).optional()
|
|
14456
15408
|
});
|
|
14457
|
-
sessionJournalEntrySchema =
|
|
15409
|
+
sessionJournalEntrySchema = z18.object({
|
|
14458
15410
|
// Identity
|
|
14459
15411
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
14460
|
-
schemaVersion:
|
|
15412
|
+
schemaVersion: z18.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
14461
15413
|
/** ISO 8601 timestamp when the entry was written. */
|
|
14462
|
-
timestamp:
|
|
15414
|
+
timestamp: z18.string(),
|
|
14463
15415
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
14464
|
-
sessionId:
|
|
15416
|
+
sessionId: z18.string(),
|
|
14465
15417
|
/** Event type that triggered this journal entry. */
|
|
14466
|
-
eventType:
|
|
15418
|
+
eventType: z18.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
14467
15419
|
// Session metadata (set on session_start / session_end)
|
|
14468
15420
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
14469
|
-
agentIdentifier:
|
|
15421
|
+
agentIdentifier: z18.string().optional(),
|
|
14470
15422
|
/** Provider adapter ID active for this session. */
|
|
14471
|
-
providerId:
|
|
15423
|
+
providerId: z18.string().optional(),
|
|
14472
15424
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
14473
|
-
scope:
|
|
15425
|
+
scope: z18.string().optional(),
|
|
14474
15426
|
// Session-end fields
|
|
14475
15427
|
/** Duration of the session in seconds (session_end only). */
|
|
14476
|
-
duration:
|
|
15428
|
+
duration: z18.number().int().nonnegative().optional(),
|
|
14477
15429
|
/** Task IDs (not titles) completed during the session. */
|
|
14478
|
-
tasksCompleted:
|
|
15430
|
+
tasksCompleted: z18.array(z18.string()).optional(),
|
|
14479
15431
|
// Doctor summary (T1262 absorbed)
|
|
14480
15432
|
/** Compact result of `scanBrainNoise` run at session-end. */
|
|
14481
15433
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
@@ -14484,7 +15436,7 @@ var init_session_journal = __esm({
|
|
|
14484
15436
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
14485
15437
|
// Optional hash chain
|
|
14486
15438
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
14487
|
-
prevEntryHash:
|
|
15439
|
+
prevEntryHash: z18.string().optional()
|
|
14488
15440
|
});
|
|
14489
15441
|
}
|
|
14490
15442
|
});
|
|
@@ -14497,52 +15449,52 @@ var init_task = __esm({
|
|
|
14497
15449
|
});
|
|
14498
15450
|
|
|
14499
15451
|
// packages/contracts/src/task-evidence.ts
|
|
14500
|
-
import { z as
|
|
15452
|
+
import { z as z19 } from "zod";
|
|
14501
15453
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
14502
15454
|
var init_task_evidence = __esm({
|
|
14503
15455
|
"packages/contracts/src/task-evidence.ts"() {
|
|
14504
15456
|
"use strict";
|
|
14505
|
-
fileEvidenceSchema =
|
|
14506
|
-
kind:
|
|
14507
|
-
sha256:
|
|
14508
|
-
timestamp:
|
|
14509
|
-
path:
|
|
14510
|
-
mime:
|
|
14511
|
-
description:
|
|
14512
|
-
});
|
|
14513
|
-
logEvidenceSchema =
|
|
14514
|
-
kind:
|
|
14515
|
-
sha256:
|
|
14516
|
-
timestamp:
|
|
14517
|
-
source:
|
|
14518
|
-
description:
|
|
14519
|
-
});
|
|
14520
|
-
screenshotEvidenceSchema =
|
|
14521
|
-
kind:
|
|
14522
|
-
sha256:
|
|
14523
|
-
timestamp:
|
|
14524
|
-
mime:
|
|
14525
|
-
description:
|
|
14526
|
-
});
|
|
14527
|
-
testOutputEvidenceSchema =
|
|
14528
|
-
kind:
|
|
14529
|
-
sha256:
|
|
14530
|
-
timestamp:
|
|
14531
|
-
passed:
|
|
14532
|
-
failed:
|
|
14533
|
-
skipped:
|
|
14534
|
-
exitCode:
|
|
14535
|
-
description:
|
|
14536
|
-
});
|
|
14537
|
-
commandOutputEvidenceSchema =
|
|
14538
|
-
kind:
|
|
14539
|
-
sha256:
|
|
14540
|
-
timestamp:
|
|
14541
|
-
cmd:
|
|
14542
|
-
exitCode:
|
|
14543
|
-
description:
|
|
14544
|
-
});
|
|
14545
|
-
taskEvidenceSchema =
|
|
15457
|
+
fileEvidenceSchema = z19.object({
|
|
15458
|
+
kind: z19.literal("file"),
|
|
15459
|
+
sha256: z19.string().length(64),
|
|
15460
|
+
timestamp: z19.string().datetime(),
|
|
15461
|
+
path: z19.string().min(1),
|
|
15462
|
+
mime: z19.string().optional(),
|
|
15463
|
+
description: z19.string().optional()
|
|
15464
|
+
});
|
|
15465
|
+
logEvidenceSchema = z19.object({
|
|
15466
|
+
kind: z19.literal("log"),
|
|
15467
|
+
sha256: z19.string().length(64),
|
|
15468
|
+
timestamp: z19.string().datetime(),
|
|
15469
|
+
source: z19.string().min(1),
|
|
15470
|
+
description: z19.string().optional()
|
|
15471
|
+
});
|
|
15472
|
+
screenshotEvidenceSchema = z19.object({
|
|
15473
|
+
kind: z19.literal("screenshot"),
|
|
15474
|
+
sha256: z19.string().length(64),
|
|
15475
|
+
timestamp: z19.string().datetime(),
|
|
15476
|
+
mime: z19.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
15477
|
+
description: z19.string().optional()
|
|
15478
|
+
});
|
|
15479
|
+
testOutputEvidenceSchema = z19.object({
|
|
15480
|
+
kind: z19.literal("test-output"),
|
|
15481
|
+
sha256: z19.string().length(64),
|
|
15482
|
+
timestamp: z19.string().datetime(),
|
|
15483
|
+
passed: z19.number().int().nonnegative(),
|
|
15484
|
+
failed: z19.number().int().nonnegative(),
|
|
15485
|
+
skipped: z19.number().int().nonnegative(),
|
|
15486
|
+
exitCode: z19.number().int(),
|
|
15487
|
+
description: z19.string().optional()
|
|
15488
|
+
});
|
|
15489
|
+
commandOutputEvidenceSchema = z19.object({
|
|
15490
|
+
kind: z19.literal("command-output"),
|
|
15491
|
+
sha256: z19.string().length(64),
|
|
15492
|
+
timestamp: z19.string().datetime(),
|
|
15493
|
+
cmd: z19.string().min(1),
|
|
15494
|
+
exitCode: z19.number().int(),
|
|
15495
|
+
description: z19.string().optional()
|
|
15496
|
+
});
|
|
15497
|
+
taskEvidenceSchema = z19.discriminatedUnion("kind", [
|
|
14546
15498
|
fileEvidenceSchema,
|
|
14547
15499
|
logEvidenceSchema,
|
|
14548
15500
|
screenshotEvidenceSchema,
|
|
@@ -14553,12 +15505,12 @@ var init_task_evidence = __esm({
|
|
|
14553
15505
|
});
|
|
14554
15506
|
|
|
14555
15507
|
// packages/contracts/src/tasks/archive.ts
|
|
14556
|
-
import { z as
|
|
15508
|
+
import { z as z20 } from "zod";
|
|
14557
15509
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
14558
15510
|
var init_archive = __esm({
|
|
14559
15511
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
14560
15512
|
"use strict";
|
|
14561
|
-
ArchiveReason =
|
|
15513
|
+
ArchiveReason = z20.enum([
|
|
14562
15514
|
"verified",
|
|
14563
15515
|
"reconciled",
|
|
14564
15516
|
"superseded",
|
|
@@ -14571,47 +15523,47 @@ var init_archive = __esm({
|
|
|
14571
15523
|
});
|
|
14572
15524
|
|
|
14573
15525
|
// packages/contracts/src/tasks.ts
|
|
14574
|
-
import { z as
|
|
15526
|
+
import { z as z21 } from "zod";
|
|
14575
15527
|
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;
|
|
14576
15528
|
var init_tasks2 = __esm({
|
|
14577
15529
|
"packages/contracts/src/tasks.ts"() {
|
|
14578
15530
|
"use strict";
|
|
14579
15531
|
init_status_registry();
|
|
14580
|
-
taskMutationWarningSeveritySchema =
|
|
14581
|
-
taskMutationWarningSchema =
|
|
14582
|
-
code:
|
|
14583
|
-
message:
|
|
15532
|
+
taskMutationWarningSeveritySchema = z21.enum(["info", "warning"]);
|
|
15533
|
+
taskMutationWarningSchema = z21.object({
|
|
15534
|
+
code: z21.string().min(1),
|
|
15535
|
+
message: z21.string().min(1),
|
|
14584
15536
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
14585
|
-
taskId:
|
|
14586
|
-
field:
|
|
14587
|
-
index:
|
|
14588
|
-
});
|
|
14589
|
-
taskMutationDryRunSummarySchema =
|
|
14590
|
-
dryRun:
|
|
14591
|
-
wouldCreate:
|
|
14592
|
-
wouldUpdate:
|
|
14593
|
-
wouldDelete:
|
|
14594
|
-
wouldAffect:
|
|
14595
|
-
validatedCount:
|
|
14596
|
-
insertedCount:
|
|
14597
|
-
updatedCount:
|
|
14598
|
-
deletedCount:
|
|
14599
|
-
warnings:
|
|
14600
|
-
});
|
|
14601
|
-
taskMutationTaskRecordSchema =
|
|
14602
|
-
taskMutationEnvelopeSchema =
|
|
14603
|
-
dryRun:
|
|
14604
|
-
created:
|
|
14605
|
-
updated:
|
|
14606
|
-
deleted:
|
|
14607
|
-
affectedCount:
|
|
14608
|
-
mutationWarnings:
|
|
15537
|
+
taskId: z21.string().min(1).optional(),
|
|
15538
|
+
field: z21.string().min(1).optional(),
|
|
15539
|
+
index: z21.number().int().nonnegative().optional()
|
|
15540
|
+
});
|
|
15541
|
+
taskMutationDryRunSummarySchema = z21.object({
|
|
15542
|
+
dryRun: z21.literal(true),
|
|
15543
|
+
wouldCreate: z21.number().int().nonnegative(),
|
|
15544
|
+
wouldUpdate: z21.number().int().nonnegative(),
|
|
15545
|
+
wouldDelete: z21.number().int().nonnegative(),
|
|
15546
|
+
wouldAffect: z21.number().int().nonnegative(),
|
|
15547
|
+
validatedCount: z21.number().int().nonnegative(),
|
|
15548
|
+
insertedCount: z21.literal(0),
|
|
15549
|
+
updatedCount: z21.literal(0),
|
|
15550
|
+
deletedCount: z21.literal(0),
|
|
15551
|
+
warnings: z21.array(taskMutationWarningSchema)
|
|
15552
|
+
});
|
|
15553
|
+
taskMutationTaskRecordSchema = z21.object({ id: z21.string().min(1) }).passthrough();
|
|
15554
|
+
taskMutationEnvelopeSchema = z21.object({
|
|
15555
|
+
dryRun: z21.boolean().optional(),
|
|
15556
|
+
created: z21.array(taskMutationTaskRecordSchema),
|
|
15557
|
+
updated: z21.array(taskMutationTaskRecordSchema),
|
|
15558
|
+
deleted: z21.array(taskMutationTaskRecordSchema),
|
|
15559
|
+
affectedCount: z21.number().int().nonnegative(),
|
|
15560
|
+
mutationWarnings: z21.array(taskMutationWarningSchema),
|
|
14609
15561
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
14610
15562
|
});
|
|
14611
|
-
completionTaskStatusSchema =
|
|
14612
|
-
completionCriterionKindSchema =
|
|
14613
|
-
completionCriterionStatusSchema =
|
|
14614
|
-
completionBlockerReasonSchema =
|
|
15563
|
+
completionTaskStatusSchema = z21.enum(TASK_STATUSES);
|
|
15564
|
+
completionCriterionKindSchema = z21.enum(["text", "evidence_bound", "child_task"]);
|
|
15565
|
+
completionCriterionStatusSchema = z21.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
15566
|
+
completionBlockerReasonSchema = z21.enum([
|
|
14615
15567
|
"missing_evidence_binding",
|
|
14616
15568
|
"child_not_done",
|
|
14617
15569
|
"child_cancelled_requires_waiver",
|
|
@@ -14619,68 +15571,68 @@ var init_tasks2 = __esm({
|
|
|
14619
15571
|
"child_missing",
|
|
14620
15572
|
"done_parent_stale"
|
|
14621
15573
|
]);
|
|
14622
|
-
completionStaleReasonSchema =
|
|
14623
|
-
completionProjectionRepairErrorCodeSchema =
|
|
15574
|
+
completionStaleReasonSchema = z21.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
15575
|
+
completionProjectionRepairErrorCodeSchema = z21.enum([
|
|
14624
15576
|
"projection_not_stale",
|
|
14625
15577
|
"criteria_missing",
|
|
14626
15578
|
"binding_target_missing",
|
|
14627
15579
|
"repair_conflict"
|
|
14628
15580
|
]);
|
|
14629
|
-
completionCriterionWaiverSchema =
|
|
14630
|
-
criterionAcId:
|
|
14631
|
-
childTaskId:
|
|
14632
|
-
reason:
|
|
14633
|
-
actor:
|
|
14634
|
-
waivedAt:
|
|
14635
|
-
});
|
|
14636
|
-
completionCriterionReplacementSchema =
|
|
14637
|
-
criterionAcId:
|
|
14638
|
-
originalChildTaskId:
|
|
14639
|
-
replacementChildTaskId:
|
|
14640
|
-
reason:
|
|
14641
|
-
actor:
|
|
14642
|
-
replacedAt:
|
|
14643
|
-
});
|
|
14644
|
-
completionCriterionEvaluationSchema =
|
|
14645
|
-
acId:
|
|
14646
|
-
alias:
|
|
14647
|
-
text:
|
|
15581
|
+
completionCriterionWaiverSchema = z21.object({
|
|
15582
|
+
criterionAcId: z21.string().min(1),
|
|
15583
|
+
childTaskId: z21.string().min(1),
|
|
15584
|
+
reason: z21.string().min(1),
|
|
15585
|
+
actor: z21.string().min(1),
|
|
15586
|
+
waivedAt: z21.string().min(1)
|
|
15587
|
+
});
|
|
15588
|
+
completionCriterionReplacementSchema = z21.object({
|
|
15589
|
+
criterionAcId: z21.string().min(1),
|
|
15590
|
+
originalChildTaskId: z21.string().min(1),
|
|
15591
|
+
replacementChildTaskId: z21.string().min(1),
|
|
15592
|
+
reason: z21.string().min(1),
|
|
15593
|
+
actor: z21.string().min(1),
|
|
15594
|
+
replacedAt: z21.string().min(1)
|
|
15595
|
+
});
|
|
15596
|
+
completionCriterionEvaluationSchema = z21.object({
|
|
15597
|
+
acId: z21.string().min(1),
|
|
15598
|
+
alias: z21.string().min(1),
|
|
15599
|
+
text: z21.string(),
|
|
14648
15600
|
kind: completionCriterionKindSchema,
|
|
14649
15601
|
status: completionCriterionStatusSchema,
|
|
14650
15602
|
reason: completionBlockerReasonSchema.optional(),
|
|
14651
|
-
targetTaskId:
|
|
15603
|
+
targetTaskId: z21.string().min(1).optional(),
|
|
14652
15604
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
14653
15605
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
14654
15606
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
14655
15607
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
14656
|
-
evidenceBindings:
|
|
15608
|
+
evidenceBindings: z21.number().int().nonnegative()
|
|
14657
15609
|
});
|
|
14658
15610
|
unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
14659
|
-
status:
|
|
15611
|
+
status: z21.literal("unsatisfied"),
|
|
14660
15612
|
reason: completionBlockerReasonSchema
|
|
14661
15613
|
});
|
|
14662
|
-
completionTotalsSchema =
|
|
14663
|
-
criteria:
|
|
14664
|
-
satisfied:
|
|
14665
|
-
unsatisfied:
|
|
14666
|
-
waived:
|
|
14667
|
-
replaced:
|
|
14668
|
-
});
|
|
14669
|
-
completionContextPackSchema =
|
|
14670
|
-
taskId:
|
|
14671
|
-
generatedAt:
|
|
14672
|
-
source:
|
|
14673
|
-
window:
|
|
14674
|
-
limit:
|
|
14675
|
-
since:
|
|
14676
|
-
relationDepth:
|
|
14677
|
-
relatedTaskIds:
|
|
15614
|
+
completionTotalsSchema = z21.object({
|
|
15615
|
+
criteria: z21.number().int().nonnegative(),
|
|
15616
|
+
satisfied: z21.number().int().nonnegative(),
|
|
15617
|
+
unsatisfied: z21.number().int().nonnegative(),
|
|
15618
|
+
waived: z21.number().int().nonnegative(),
|
|
15619
|
+
replaced: z21.number().int().nonnegative()
|
|
15620
|
+
});
|
|
15621
|
+
completionContextPackSchema = z21.object({
|
|
15622
|
+
taskId: z21.string().min(1),
|
|
15623
|
+
generatedAt: z21.string().min(1),
|
|
15624
|
+
source: z21.literal("audit_log"),
|
|
15625
|
+
window: z21.object({
|
|
15626
|
+
limit: z21.number().int().positive(),
|
|
15627
|
+
since: z21.string().min(1).optional(),
|
|
15628
|
+
relationDepth: z21.number().int().nonnegative(),
|
|
15629
|
+
relatedTaskIds: z21.array(z21.string().min(1))
|
|
14678
15630
|
}),
|
|
14679
|
-
events:
|
|
14680
|
-
|
|
14681
|
-
id:
|
|
14682
|
-
timestamp:
|
|
14683
|
-
action:
|
|
15631
|
+
events: z21.array(
|
|
15632
|
+
z21.object({
|
|
15633
|
+
id: z21.string().min(1),
|
|
15634
|
+
timestamp: z21.string().min(1),
|
|
15635
|
+
action: z21.enum([
|
|
14684
15636
|
"task_completed",
|
|
14685
15637
|
"task_reopened",
|
|
14686
15638
|
"task_cancelled",
|
|
@@ -14688,77 +15640,77 @@ var init_tasks2 = __esm({
|
|
|
14688
15640
|
"task_reparented",
|
|
14689
15641
|
"ac_projection_rebuilt"
|
|
14690
15642
|
]),
|
|
14691
|
-
taskId:
|
|
14692
|
-
relation:
|
|
14693
|
-
actor:
|
|
14694
|
-
details:
|
|
14695
|
-
before:
|
|
14696
|
-
after:
|
|
15643
|
+
taskId: z21.string().min(1),
|
|
15644
|
+
relation: z21.enum(["self", "parent", "child", "sibling", "related"]),
|
|
15645
|
+
actor: z21.string().min(1),
|
|
15646
|
+
details: z21.record(z21.string(), z21.unknown()).optional(),
|
|
15647
|
+
before: z21.record(z21.string(), z21.unknown()).optional(),
|
|
15648
|
+
after: z21.record(z21.string(), z21.unknown()).optional()
|
|
14697
15649
|
})
|
|
14698
15650
|
),
|
|
14699
|
-
summary:
|
|
14700
|
-
totalEvents:
|
|
14701
|
-
byAction:
|
|
14702
|
-
byRelation:
|
|
14703
|
-
latestEventAt:
|
|
15651
|
+
summary: z21.object({
|
|
15652
|
+
totalEvents: z21.number().int().nonnegative(),
|
|
15653
|
+
byAction: z21.record(z21.string(), z21.number().int().nonnegative()),
|
|
15654
|
+
byRelation: z21.record(z21.string(), z21.number().int().nonnegative()),
|
|
15655
|
+
latestEventAt: z21.string().nullable()
|
|
14704
15656
|
})
|
|
14705
15657
|
});
|
|
14706
|
-
completionEvaluationSchema =
|
|
14707
|
-
taskId:
|
|
15658
|
+
completionEvaluationSchema = z21.object({
|
|
15659
|
+
taskId: z21.string().min(1),
|
|
14708
15660
|
taskStatus: completionTaskStatusSchema,
|
|
14709
|
-
ready:
|
|
14710
|
-
stale:
|
|
14711
|
-
staleReasons:
|
|
15661
|
+
ready: z21.boolean(),
|
|
15662
|
+
stale: z21.boolean(),
|
|
15663
|
+
staleReasons: z21.array(completionStaleReasonSchema),
|
|
14712
15664
|
contextPack: completionContextPackSchema.optional(),
|
|
14713
|
-
satisfied:
|
|
14714
|
-
unsatisfied:
|
|
14715
|
-
waived:
|
|
14716
|
-
replaced:
|
|
15665
|
+
satisfied: z21.array(completionCriterionEvaluationSchema),
|
|
15666
|
+
unsatisfied: z21.array(unsatisfiedCompletionCriterionSchema),
|
|
15667
|
+
waived: z21.array(completionCriterionEvaluationSchema),
|
|
15668
|
+
replaced: z21.array(completionCriterionEvaluationSchema),
|
|
14717
15669
|
totals: completionTotalsSchema
|
|
14718
15670
|
});
|
|
14719
|
-
completionExplanationSchema =
|
|
14720
|
-
taskId:
|
|
14721
|
-
ready:
|
|
14722
|
-
stale:
|
|
14723
|
-
summary:
|
|
15671
|
+
completionExplanationSchema = z21.object({
|
|
15672
|
+
taskId: z21.string().min(1),
|
|
15673
|
+
ready: z21.boolean(),
|
|
15674
|
+
stale: z21.boolean(),
|
|
15675
|
+
summary: z21.string(),
|
|
14724
15676
|
contextPack: completionContextPackSchema.optional(),
|
|
14725
|
-
blockers:
|
|
15677
|
+
blockers: z21.array(completionCriterionEvaluationSchema)
|
|
14726
15678
|
});
|
|
14727
|
-
completionListParamsSchema =
|
|
14728
|
-
taskId:
|
|
15679
|
+
completionListParamsSchema = z21.object({
|
|
15680
|
+
taskId: z21.string().min(1),
|
|
14729
15681
|
status: completionCriterionStatusSchema.optional(),
|
|
14730
15682
|
kind: completionCriterionKindSchema.optional()
|
|
14731
15683
|
});
|
|
14732
|
-
completionListResultSchema =
|
|
14733
|
-
taskId:
|
|
14734
|
-
criteria:
|
|
15684
|
+
completionListResultSchema = z21.object({
|
|
15685
|
+
taskId: z21.string().min(1),
|
|
15686
|
+
criteria: z21.array(completionCriterionEvaluationSchema),
|
|
14735
15687
|
totals: completionTotalsSchema
|
|
14736
15688
|
});
|
|
14737
|
-
completionEvaluateParamsSchema =
|
|
14738
|
-
taskId:
|
|
14739
|
-
includeContext:
|
|
14740
|
-
limit:
|
|
14741
|
-
since:
|
|
14742
|
-
relationDepth:
|
|
15689
|
+
completionEvaluateParamsSchema = z21.object({
|
|
15690
|
+
taskId: z21.string().min(1),
|
|
15691
|
+
includeContext: z21.boolean().optional(),
|
|
15692
|
+
limit: z21.number().int().positive().optional(),
|
|
15693
|
+
since: z21.string().min(1).optional(),
|
|
15694
|
+
relationDepth: z21.number().int().nonnegative().optional()
|
|
14743
15695
|
});
|
|
14744
|
-
completionProjectionRepairErrorSchema =
|
|
15696
|
+
completionProjectionRepairErrorSchema = z21.object({
|
|
14745
15697
|
code: completionProjectionRepairErrorCodeSchema,
|
|
14746
|
-
message:
|
|
14747
|
-
taskId:
|
|
14748
|
-
acId:
|
|
14749
|
-
evidenceAtomId:
|
|
15698
|
+
message: z21.string().min(1),
|
|
15699
|
+
taskId: z21.string().min(1),
|
|
15700
|
+
acId: z21.string().min(1).optional(),
|
|
15701
|
+
evidenceAtomId: z21.string().min(1).optional()
|
|
14750
15702
|
});
|
|
14751
|
-
completionProjectionRepairParamsSchema =
|
|
14752
|
-
taskId:
|
|
14753
|
-
dryRun:
|
|
15703
|
+
completionProjectionRepairParamsSchema = z21.object({
|
|
15704
|
+
taskId: z21.string().min(1),
|
|
15705
|
+
dryRun: z21.boolean().optional()
|
|
14754
15706
|
});
|
|
14755
|
-
completionProjectionRepairResultSchema =
|
|
14756
|
-
taskId:
|
|
14757
|
-
repaired:
|
|
14758
|
-
dryRun:
|
|
14759
|
-
staleBefore:
|
|
14760
|
-
staleAfter:
|
|
14761
|
-
errors:
|
|
15707
|
+
completionProjectionRepairResultSchema = z21.object({
|
|
15708
|
+
taskId: z21.string().min(1),
|
|
15709
|
+
repaired: z21.boolean(),
|
|
15710
|
+
dryRun: z21.boolean(),
|
|
15711
|
+
staleBefore: z21.boolean(),
|
|
15712
|
+
staleAfter: z21.boolean(),
|
|
15713
|
+
errors: z21.array(completionProjectionRepairErrorSchema)
|
|
14762
15714
|
});
|
|
14763
15715
|
}
|
|
14764
15716
|
});
|
|
@@ -15269,7 +16221,7 @@ var init_taxonomy = __esm({
|
|
|
15269
16221
|
});
|
|
15270
16222
|
|
|
15271
16223
|
// packages/contracts/src/templates/manifest.ts
|
|
15272
|
-
import { z as
|
|
16224
|
+
import { z as z22 } from "zod";
|
|
15273
16225
|
var TEMPLATE_KINDS, TEMPLATE_SUBSTITUTIONS, TEMPLATE_UPDATE_STRATEGIES, PLACEHOLDER_SOURCES, PlaceholderSpecSchema, TemplateManifestEntrySchema;
|
|
15274
16226
|
var init_manifest2 = __esm({
|
|
15275
16227
|
"packages/contracts/src/templates/manifest.ts"() {
|
|
@@ -15290,85 +16242,85 @@ var init_manifest2 = __esm({
|
|
|
15290
16242
|
"tool-resolver",
|
|
15291
16243
|
"literal"
|
|
15292
16244
|
];
|
|
15293
|
-
PlaceholderSpecSchema =
|
|
16245
|
+
PlaceholderSpecSchema = z22.object({
|
|
15294
16246
|
/**
|
|
15295
16247
|
* Placeholder identifier as it appears in the template body
|
|
15296
16248
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
15297
16249
|
*/
|
|
15298
|
-
name:
|
|
16250
|
+
name: z22.string().min(1, "placeholder name must be non-empty"),
|
|
15299
16251
|
/** Resolver source the installer consults for this placeholder. */
|
|
15300
|
-
source:
|
|
16252
|
+
source: z22.enum(PLACEHOLDER_SOURCES),
|
|
15301
16253
|
/**
|
|
15302
16254
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
15303
16255
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
15304
16256
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
15305
16257
|
*/
|
|
15306
|
-
sourcePath:
|
|
16258
|
+
sourcePath: z22.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
15307
16259
|
/**
|
|
15308
16260
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
15309
16261
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
15310
16262
|
*/
|
|
15311
|
-
defaultValue:
|
|
16263
|
+
defaultValue: z22.union([z22.string(), z22.number(), z22.boolean(), z22.null()]).optional()
|
|
15312
16264
|
});
|
|
15313
|
-
TemplateManifestEntrySchema =
|
|
16265
|
+
TemplateManifestEntrySchema = z22.object({
|
|
15314
16266
|
/** Stable identifier for this template entry. */
|
|
15315
|
-
id:
|
|
16267
|
+
id: z22.string().min(1, "id must be non-empty"),
|
|
15316
16268
|
/** Category of file this template represents. */
|
|
15317
|
-
kind:
|
|
16269
|
+
kind: z22.enum(TEMPLATE_KINDS),
|
|
15318
16270
|
/** Repo-relative path of the template source file. */
|
|
15319
|
-
sourcePath:
|
|
16271
|
+
sourcePath: z22.string().min(1, "sourcePath must be non-empty"),
|
|
15320
16272
|
/** Project-relative path where the rendered template installs. */
|
|
15321
|
-
installPath:
|
|
16273
|
+
installPath: z22.string().min(1, "installPath must be non-empty"),
|
|
15322
16274
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
15323
|
-
substitution:
|
|
16275
|
+
substitution: z22.enum(TEMPLATE_SUBSTITUTIONS),
|
|
15324
16276
|
/** Declared placeholders this template requires. May be empty. */
|
|
15325
|
-
placeholders:
|
|
16277
|
+
placeholders: z22.array(PlaceholderSpecSchema),
|
|
15326
16278
|
/** Reconciliation policy on upgrade. */
|
|
15327
|
-
updateStrategy:
|
|
16279
|
+
updateStrategy: z22.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
15328
16280
|
});
|
|
15329
16281
|
}
|
|
15330
16282
|
});
|
|
15331
16283
|
|
|
15332
16284
|
// packages/contracts/src/validator/index.ts
|
|
15333
|
-
import { z as
|
|
16285
|
+
import { z as z23 } from "zod";
|
|
15334
16286
|
var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
|
|
15335
16287
|
var init_validator = __esm({
|
|
15336
16288
|
"packages/contracts/src/validator/index.ts"() {
|
|
15337
16289
|
"use strict";
|
|
15338
16290
|
VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
15339
|
-
validatorFindingSchema =
|
|
15340
|
-
acId:
|
|
15341
|
-
status:
|
|
15342
|
-
reasoning:
|
|
15343
|
-
evidenceRefs:
|
|
15344
|
-
checkedAt:
|
|
15345
|
-
});
|
|
15346
|
-
validatorAttestationSchema =
|
|
15347
|
-
verdict:
|
|
15348
|
-
taskId:
|
|
15349
|
-
validatorId:
|
|
15350
|
-
findings:
|
|
16291
|
+
validatorFindingSchema = z23.object({
|
|
16292
|
+
acId: z23.string().min(1, "acId must be non-empty"),
|
|
16293
|
+
status: z23.enum(["pass", "fail", "inconclusive"]),
|
|
16294
|
+
reasoning: z23.string().min(1, "reasoning must be non-empty"),
|
|
16295
|
+
evidenceRefs: z23.array(z23.string()).optional(),
|
|
16296
|
+
checkedAt: z23.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
16297
|
+
});
|
|
16298
|
+
validatorAttestationSchema = z23.object({
|
|
16299
|
+
verdict: z23.literal("attest"),
|
|
16300
|
+
taskId: z23.string().min(1),
|
|
16301
|
+
validatorId: z23.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
16302
|
+
findings: z23.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
15351
16303
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
15352
16304
|
'attestation requires every finding to have status="pass"'
|
|
15353
16305
|
),
|
|
15354
|
-
summary:
|
|
15355
|
-
attestedAt:
|
|
15356
|
-
schemaVersion:
|
|
15357
|
-
});
|
|
15358
|
-
validatorRejectionSchema =
|
|
15359
|
-
verdict:
|
|
15360
|
-
taskId:
|
|
15361
|
-
validatorId:
|
|
15362
|
-
findings:
|
|
16306
|
+
summary: z23.string().optional(),
|
|
16307
|
+
attestedAt: z23.string().min(1),
|
|
16308
|
+
schemaVersion: z23.literal("1")
|
|
16309
|
+
});
|
|
16310
|
+
validatorRejectionSchema = z23.object({
|
|
16311
|
+
verdict: z23.literal("reject"),
|
|
16312
|
+
taskId: z23.string().min(1),
|
|
16313
|
+
validatorId: z23.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
16314
|
+
findings: z23.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
15363
16315
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
15364
16316
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
15365
16317
|
),
|
|
15366
|
-
summary:
|
|
15367
|
-
remediationHints:
|
|
15368
|
-
rejectedAt:
|
|
15369
|
-
schemaVersion:
|
|
16318
|
+
summary: z23.string().min(1, "rejection summary must be non-empty"),
|
|
16319
|
+
remediationHints: z23.array(z23.string()).optional(),
|
|
16320
|
+
rejectedAt: z23.string().min(1),
|
|
16321
|
+
schemaVersion: z23.literal("1")
|
|
15370
16322
|
});
|
|
15371
|
-
validatorVerdictSchema =
|
|
16323
|
+
validatorVerdictSchema = z23.discriminatedUnion("verdict", [
|
|
15372
16324
|
validatorAttestationSchema,
|
|
15373
16325
|
validatorRejectionSchema
|
|
15374
16326
|
]);
|
|
@@ -30234,7 +31186,7 @@ function resolveRef(ref, ctx) {
|
|
|
30234
31186
|
function convertBaseSchema(schema, ctx) {
|
|
30235
31187
|
if (schema.not !== void 0) {
|
|
30236
31188
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
30237
|
-
return
|
|
31189
|
+
return z24.never();
|
|
30238
31190
|
}
|
|
30239
31191
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
30240
31192
|
}
|
|
@@ -30256,7 +31208,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30256
31208
|
return ctx.refs.get(refPath);
|
|
30257
31209
|
}
|
|
30258
31210
|
if (ctx.processing.has(refPath)) {
|
|
30259
|
-
return
|
|
31211
|
+
return z24.lazy(() => {
|
|
30260
31212
|
if (!ctx.refs.has(refPath)) {
|
|
30261
31213
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
30262
31214
|
}
|
|
@@ -30273,25 +31225,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30273
31225
|
if (schema.enum !== void 0) {
|
|
30274
31226
|
const enumValues = schema.enum;
|
|
30275
31227
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
30276
|
-
return
|
|
31228
|
+
return z24.null();
|
|
30277
31229
|
}
|
|
30278
31230
|
if (enumValues.length === 0) {
|
|
30279
|
-
return
|
|
31231
|
+
return z24.never();
|
|
30280
31232
|
}
|
|
30281
31233
|
if (enumValues.length === 1) {
|
|
30282
|
-
return
|
|
31234
|
+
return z24.literal(enumValues[0]);
|
|
30283
31235
|
}
|
|
30284
31236
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
30285
|
-
return
|
|
31237
|
+
return z24.enum(enumValues);
|
|
30286
31238
|
}
|
|
30287
|
-
const literalSchemas = enumValues.map((v) =>
|
|
31239
|
+
const literalSchemas = enumValues.map((v) => z24.literal(v));
|
|
30288
31240
|
if (literalSchemas.length < 2) {
|
|
30289
31241
|
return literalSchemas[0];
|
|
30290
31242
|
}
|
|
30291
|
-
return
|
|
31243
|
+
return z24.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
30292
31244
|
}
|
|
30293
31245
|
if (schema.const !== void 0) {
|
|
30294
|
-
return
|
|
31246
|
+
return z24.literal(schema.const);
|
|
30295
31247
|
}
|
|
30296
31248
|
const type = schema.type;
|
|
30297
31249
|
if (Array.isArray(type)) {
|
|
@@ -30300,68 +31252,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30300
31252
|
return convertBaseSchema(typeSchema, ctx);
|
|
30301
31253
|
});
|
|
30302
31254
|
if (typeSchemas.length === 0) {
|
|
30303
|
-
return
|
|
31255
|
+
return z24.never();
|
|
30304
31256
|
}
|
|
30305
31257
|
if (typeSchemas.length === 1) {
|
|
30306
31258
|
return typeSchemas[0];
|
|
30307
31259
|
}
|
|
30308
|
-
return
|
|
31260
|
+
return z24.union(typeSchemas);
|
|
30309
31261
|
}
|
|
30310
31262
|
if (!type) {
|
|
30311
|
-
return
|
|
31263
|
+
return z24.any();
|
|
30312
31264
|
}
|
|
30313
31265
|
let zodSchema2;
|
|
30314
31266
|
switch (type) {
|
|
30315
31267
|
case "string": {
|
|
30316
|
-
let stringSchema =
|
|
31268
|
+
let stringSchema = z24.string();
|
|
30317
31269
|
if (schema.format) {
|
|
30318
31270
|
const format = schema.format;
|
|
30319
31271
|
if (format === "email") {
|
|
30320
|
-
stringSchema = stringSchema.check(
|
|
31272
|
+
stringSchema = stringSchema.check(z24.email());
|
|
30321
31273
|
} else if (format === "uri" || format === "uri-reference") {
|
|
30322
|
-
stringSchema = stringSchema.check(
|
|
31274
|
+
stringSchema = stringSchema.check(z24.url());
|
|
30323
31275
|
} else if (format === "uuid" || format === "guid") {
|
|
30324
|
-
stringSchema = stringSchema.check(
|
|
31276
|
+
stringSchema = stringSchema.check(z24.uuid());
|
|
30325
31277
|
} else if (format === "date-time") {
|
|
30326
|
-
stringSchema = stringSchema.check(
|
|
31278
|
+
stringSchema = stringSchema.check(z24.iso.datetime());
|
|
30327
31279
|
} else if (format === "date") {
|
|
30328
|
-
stringSchema = stringSchema.check(
|
|
31280
|
+
stringSchema = stringSchema.check(z24.iso.date());
|
|
30329
31281
|
} else if (format === "time") {
|
|
30330
|
-
stringSchema = stringSchema.check(
|
|
31282
|
+
stringSchema = stringSchema.check(z24.iso.time());
|
|
30331
31283
|
} else if (format === "duration") {
|
|
30332
|
-
stringSchema = stringSchema.check(
|
|
31284
|
+
stringSchema = stringSchema.check(z24.iso.duration());
|
|
30333
31285
|
} else if (format === "ipv4") {
|
|
30334
|
-
stringSchema = stringSchema.check(
|
|
31286
|
+
stringSchema = stringSchema.check(z24.ipv4());
|
|
30335
31287
|
} else if (format === "ipv6") {
|
|
30336
|
-
stringSchema = stringSchema.check(
|
|
31288
|
+
stringSchema = stringSchema.check(z24.ipv6());
|
|
30337
31289
|
} else if (format === "mac") {
|
|
30338
|
-
stringSchema = stringSchema.check(
|
|
31290
|
+
stringSchema = stringSchema.check(z24.mac());
|
|
30339
31291
|
} else if (format === "cidr") {
|
|
30340
|
-
stringSchema = stringSchema.check(
|
|
31292
|
+
stringSchema = stringSchema.check(z24.cidrv4());
|
|
30341
31293
|
} else if (format === "cidr-v6") {
|
|
30342
|
-
stringSchema = stringSchema.check(
|
|
31294
|
+
stringSchema = stringSchema.check(z24.cidrv6());
|
|
30343
31295
|
} else if (format === "base64") {
|
|
30344
|
-
stringSchema = stringSchema.check(
|
|
31296
|
+
stringSchema = stringSchema.check(z24.base64());
|
|
30345
31297
|
} else if (format === "base64url") {
|
|
30346
|
-
stringSchema = stringSchema.check(
|
|
31298
|
+
stringSchema = stringSchema.check(z24.base64url());
|
|
30347
31299
|
} else if (format === "e164") {
|
|
30348
|
-
stringSchema = stringSchema.check(
|
|
31300
|
+
stringSchema = stringSchema.check(z24.e164());
|
|
30349
31301
|
} else if (format === "jwt") {
|
|
30350
|
-
stringSchema = stringSchema.check(
|
|
31302
|
+
stringSchema = stringSchema.check(z24.jwt());
|
|
30351
31303
|
} else if (format === "emoji") {
|
|
30352
|
-
stringSchema = stringSchema.check(
|
|
31304
|
+
stringSchema = stringSchema.check(z24.emoji());
|
|
30353
31305
|
} else if (format === "nanoid") {
|
|
30354
|
-
stringSchema = stringSchema.check(
|
|
31306
|
+
stringSchema = stringSchema.check(z24.nanoid());
|
|
30355
31307
|
} else if (format === "cuid") {
|
|
30356
|
-
stringSchema = stringSchema.check(
|
|
31308
|
+
stringSchema = stringSchema.check(z24.cuid());
|
|
30357
31309
|
} else if (format === "cuid2") {
|
|
30358
|
-
stringSchema = stringSchema.check(
|
|
31310
|
+
stringSchema = stringSchema.check(z24.cuid2());
|
|
30359
31311
|
} else if (format === "ulid") {
|
|
30360
|
-
stringSchema = stringSchema.check(
|
|
31312
|
+
stringSchema = stringSchema.check(z24.ulid());
|
|
30361
31313
|
} else if (format === "xid") {
|
|
30362
|
-
stringSchema = stringSchema.check(
|
|
31314
|
+
stringSchema = stringSchema.check(z24.xid());
|
|
30363
31315
|
} else if (format === "ksuid") {
|
|
30364
|
-
stringSchema = stringSchema.check(
|
|
31316
|
+
stringSchema = stringSchema.check(z24.ksuid());
|
|
30365
31317
|
}
|
|
30366
31318
|
}
|
|
30367
31319
|
if (typeof schema.minLength === "number") {
|
|
@@ -30378,7 +31330,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30378
31330
|
}
|
|
30379
31331
|
case "number":
|
|
30380
31332
|
case "integer": {
|
|
30381
|
-
let numberSchema = type === "integer" ?
|
|
31333
|
+
let numberSchema = type === "integer" ? z24.number().int() : z24.number();
|
|
30382
31334
|
if (typeof schema.minimum === "number") {
|
|
30383
31335
|
numberSchema = numberSchema.min(schema.minimum);
|
|
30384
31336
|
}
|
|
@@ -30402,11 +31354,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30402
31354
|
break;
|
|
30403
31355
|
}
|
|
30404
31356
|
case "boolean": {
|
|
30405
|
-
zodSchema2 =
|
|
31357
|
+
zodSchema2 = z24.boolean();
|
|
30406
31358
|
break;
|
|
30407
31359
|
}
|
|
30408
31360
|
case "null": {
|
|
30409
|
-
zodSchema2 =
|
|
31361
|
+
zodSchema2 = z24.null();
|
|
30410
31362
|
break;
|
|
30411
31363
|
}
|
|
30412
31364
|
case "object": {
|
|
@@ -30419,14 +31371,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30419
31371
|
}
|
|
30420
31372
|
if (schema.propertyNames) {
|
|
30421
31373
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
30422
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
31374
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z24.any();
|
|
30423
31375
|
if (Object.keys(shape).length === 0) {
|
|
30424
|
-
zodSchema2 =
|
|
31376
|
+
zodSchema2 = z24.record(keySchema, valueSchema);
|
|
30425
31377
|
break;
|
|
30426
31378
|
}
|
|
30427
|
-
const objectSchema2 =
|
|
30428
|
-
const recordSchema =
|
|
30429
|
-
zodSchema2 =
|
|
31379
|
+
const objectSchema2 = z24.object(shape).passthrough();
|
|
31380
|
+
const recordSchema = z24.looseRecord(keySchema, valueSchema);
|
|
31381
|
+
zodSchema2 = z24.intersection(objectSchema2, recordSchema);
|
|
30430
31382
|
break;
|
|
30431
31383
|
}
|
|
30432
31384
|
if (schema.patternProperties) {
|
|
@@ -30435,28 +31387,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30435
31387
|
const looseRecords = [];
|
|
30436
31388
|
for (const pattern of patternKeys) {
|
|
30437
31389
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
30438
|
-
const keySchema =
|
|
30439
|
-
looseRecords.push(
|
|
31390
|
+
const keySchema = z24.string().regex(new RegExp(pattern));
|
|
31391
|
+
looseRecords.push(z24.looseRecord(keySchema, patternValue));
|
|
30440
31392
|
}
|
|
30441
31393
|
const schemasToIntersect = [];
|
|
30442
31394
|
if (Object.keys(shape).length > 0) {
|
|
30443
|
-
schemasToIntersect.push(
|
|
31395
|
+
schemasToIntersect.push(z24.object(shape).passthrough());
|
|
30444
31396
|
}
|
|
30445
31397
|
schemasToIntersect.push(...looseRecords);
|
|
30446
31398
|
if (schemasToIntersect.length === 0) {
|
|
30447
|
-
zodSchema2 =
|
|
31399
|
+
zodSchema2 = z24.object({}).passthrough();
|
|
30448
31400
|
} else if (schemasToIntersect.length === 1) {
|
|
30449
31401
|
zodSchema2 = schemasToIntersect[0];
|
|
30450
31402
|
} else {
|
|
30451
|
-
let result =
|
|
31403
|
+
let result = z24.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
30452
31404
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
30453
|
-
result =
|
|
31405
|
+
result = z24.intersection(result, schemasToIntersect[i]);
|
|
30454
31406
|
}
|
|
30455
31407
|
zodSchema2 = result;
|
|
30456
31408
|
}
|
|
30457
31409
|
break;
|
|
30458
31410
|
}
|
|
30459
|
-
const objectSchema =
|
|
31411
|
+
const objectSchema = z24.object(shape);
|
|
30460
31412
|
if (schema.additionalProperties === false) {
|
|
30461
31413
|
zodSchema2 = objectSchema.strict();
|
|
30462
31414
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -30473,33 +31425,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30473
31425
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
30474
31426
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
30475
31427
|
if (rest) {
|
|
30476
|
-
zodSchema2 =
|
|
31428
|
+
zodSchema2 = z24.tuple(tupleItems).rest(rest);
|
|
30477
31429
|
} else {
|
|
30478
|
-
zodSchema2 =
|
|
31430
|
+
zodSchema2 = z24.tuple(tupleItems);
|
|
30479
31431
|
}
|
|
30480
31432
|
if (typeof schema.minItems === "number") {
|
|
30481
|
-
zodSchema2 = zodSchema2.check(
|
|
31433
|
+
zodSchema2 = zodSchema2.check(z24.minLength(schema.minItems));
|
|
30482
31434
|
}
|
|
30483
31435
|
if (typeof schema.maxItems === "number") {
|
|
30484
|
-
zodSchema2 = zodSchema2.check(
|
|
31436
|
+
zodSchema2 = zodSchema2.check(z24.maxLength(schema.maxItems));
|
|
30485
31437
|
}
|
|
30486
31438
|
} else if (Array.isArray(items)) {
|
|
30487
31439
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
30488
31440
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
30489
31441
|
if (rest) {
|
|
30490
|
-
zodSchema2 =
|
|
31442
|
+
zodSchema2 = z24.tuple(tupleItems).rest(rest);
|
|
30491
31443
|
} else {
|
|
30492
|
-
zodSchema2 =
|
|
31444
|
+
zodSchema2 = z24.tuple(tupleItems);
|
|
30493
31445
|
}
|
|
30494
31446
|
if (typeof schema.minItems === "number") {
|
|
30495
|
-
zodSchema2 = zodSchema2.check(
|
|
31447
|
+
zodSchema2 = zodSchema2.check(z24.minLength(schema.minItems));
|
|
30496
31448
|
}
|
|
30497
31449
|
if (typeof schema.maxItems === "number") {
|
|
30498
|
-
zodSchema2 = zodSchema2.check(
|
|
31450
|
+
zodSchema2 = zodSchema2.check(z24.maxLength(schema.maxItems));
|
|
30499
31451
|
}
|
|
30500
31452
|
} else if (items !== void 0) {
|
|
30501
31453
|
const element = convertSchema(items, ctx);
|
|
30502
|
-
let arraySchema =
|
|
31454
|
+
let arraySchema = z24.array(element);
|
|
30503
31455
|
if (typeof schema.minItems === "number") {
|
|
30504
31456
|
arraySchema = arraySchema.min(schema.minItems);
|
|
30505
31457
|
}
|
|
@@ -30508,7 +31460,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30508
31460
|
}
|
|
30509
31461
|
zodSchema2 = arraySchema;
|
|
30510
31462
|
} else {
|
|
30511
|
-
zodSchema2 =
|
|
31463
|
+
zodSchema2 = z24.array(z24.any());
|
|
30512
31464
|
}
|
|
30513
31465
|
break;
|
|
30514
31466
|
}
|
|
@@ -30525,37 +31477,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
30525
31477
|
}
|
|
30526
31478
|
function convertSchema(schema, ctx) {
|
|
30527
31479
|
if (typeof schema === "boolean") {
|
|
30528
|
-
return schema ?
|
|
31480
|
+
return schema ? z24.any() : z24.never();
|
|
30529
31481
|
}
|
|
30530
31482
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
30531
31483
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
30532
31484
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
30533
31485
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
30534
|
-
const anyOfUnion =
|
|
30535
|
-
baseSchema = hasExplicitType ?
|
|
31486
|
+
const anyOfUnion = z24.union(options);
|
|
31487
|
+
baseSchema = hasExplicitType ? z24.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
30536
31488
|
}
|
|
30537
31489
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
30538
31490
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
30539
|
-
const oneOfUnion =
|
|
30540
|
-
baseSchema = hasExplicitType ?
|
|
31491
|
+
const oneOfUnion = z24.xor(options);
|
|
31492
|
+
baseSchema = hasExplicitType ? z24.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
30541
31493
|
}
|
|
30542
31494
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
30543
31495
|
if (schema.allOf.length === 0) {
|
|
30544
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
31496
|
+
baseSchema = hasExplicitType ? baseSchema : z24.any();
|
|
30545
31497
|
} else {
|
|
30546
31498
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
30547
31499
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
30548
31500
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
30549
|
-
result =
|
|
31501
|
+
result = z24.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
30550
31502
|
}
|
|
30551
31503
|
baseSchema = result;
|
|
30552
31504
|
}
|
|
30553
31505
|
}
|
|
30554
31506
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
30555
|
-
baseSchema =
|
|
31507
|
+
baseSchema = z24.nullable(baseSchema);
|
|
30556
31508
|
}
|
|
30557
31509
|
if (schema.readOnly === true) {
|
|
30558
|
-
baseSchema =
|
|
31510
|
+
baseSchema = z24.readonly(baseSchema);
|
|
30559
31511
|
}
|
|
30560
31512
|
const extraMeta = {};
|
|
30561
31513
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -30582,7 +31534,7 @@ function convertSchema(schema, ctx) {
|
|
|
30582
31534
|
}
|
|
30583
31535
|
function fromJSONSchema(schema, params) {
|
|
30584
31536
|
if (typeof schema === "boolean") {
|
|
30585
|
-
return schema ?
|
|
31537
|
+
return schema ? z24.any() : z24.never();
|
|
30586
31538
|
}
|
|
30587
31539
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
30588
31540
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -30596,14 +31548,14 @@ function fromJSONSchema(schema, params) {
|
|
|
30596
31548
|
};
|
|
30597
31549
|
return convertSchema(schema, ctx);
|
|
30598
31550
|
}
|
|
30599
|
-
var
|
|
31551
|
+
var z24, RECOGNIZED_KEYS;
|
|
30600
31552
|
var init_from_json_schema = __esm({
|
|
30601
31553
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
30602
31554
|
init_registries();
|
|
30603
31555
|
init_checks2();
|
|
30604
31556
|
init_iso();
|
|
30605
31557
|
init_schemas2();
|
|
30606
|
-
|
|
31558
|
+
z24 = {
|
|
30607
31559
|
...schemas_exports2,
|
|
30608
31560
|
...checks_exports2,
|
|
30609
31561
|
iso: iso_exports
|