@cleocode/adapters 2026.11.1-canary.9 → 2026.11.1
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/.source-stamp.json +1 -1
- package/dist/index.js +1691 -1354
- package/dist/index.js.map +3 -3
- package/dist/orca-execution.d.ts +90 -0
- package/dist/orca-execution.d.ts.map +1 -0
- package/dist/orca-execution.js +843 -0
- package/dist/orca-execution.js.map +6 -0
- package/dist/providers/claude-code/index.js +1689 -1357
- package/dist/providers/claude-code/index.js.map +3 -3
- package/dist/providers/claude-code/lead-session.d.ts +8 -5
- package/dist/providers/claude-code/lead-session.d.ts.map +1 -1
- package/dist/providers/claude-sdk/index.js +1674 -1352
- package/dist/providers/claude-sdk/index.js.map +3 -3
- package/dist/providers/claude-sdk/spawn.d.ts.map +1 -1
- package/dist/providers/codex/index.js +1540 -1233
- package/dist/providers/codex/index.js.map +3 -3
- package/dist/providers/gemini-cli/index.js +1540 -1233
- package/dist/providers/gemini-cli/index.js.map +3 -3
- package/dist/providers/kimi/index.js +1540 -1233
- package/dist/providers/kimi/index.js.map +3 -3
- package/dist/providers/openai-sdk/index.js +1660 -1353
- package/dist/providers/openai-sdk/index.js.map +3 -3
- package/dist/providers/opencode/index.js +1540 -1233
- package/dist/providers/opencode/index.js.map +3 -3
- package/dist/providers/pi/index.js +1540 -1233
- package/dist/providers/pi/index.js.map +3 -3
- package/package.json +10 -6
- package/src/__tests__/orca-execution-fixture.ts +422 -0
- package/src/__tests__/orca-execution.test.ts +1357 -0
- package/src/__tests__/orca-plugin-panel.test.ts +661 -0
- package/src/__tests__/orca-plugin.test.ts +660 -0
- package/src/orca-execution.ts +1193 -0
- package/src/providers/claude-code/__tests__/lead-mcp.test.ts +27 -2
- package/src/providers/claude-code/lead-session.ts +21 -8
- package/src/providers/claude-sdk/__tests__/spawn.test.ts +19 -0
- package/src/providers/claude-sdk/spawn.ts +14 -0
- package/src/providers/shared/__tests__/lead-tool-strip.test.ts +1 -1
|
@@ -14474,7 +14474,7 @@ function resolveRef(ref, ctx) {
|
|
|
14474
14474
|
function convertBaseSchema(schema, ctx) {
|
|
14475
14475
|
if (schema.not !== void 0) {
|
|
14476
14476
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
14477
|
-
return
|
|
14477
|
+
return z31.never();
|
|
14478
14478
|
}
|
|
14479
14479
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
14480
14480
|
}
|
|
@@ -14496,7 +14496,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14496
14496
|
return ctx.refs.get(refPath);
|
|
14497
14497
|
}
|
|
14498
14498
|
if (ctx.processing.has(refPath)) {
|
|
14499
|
-
return
|
|
14499
|
+
return z31.lazy(() => {
|
|
14500
14500
|
if (!ctx.refs.has(refPath)) {
|
|
14501
14501
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
14502
14502
|
}
|
|
@@ -14513,25 +14513,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14513
14513
|
if (schema.enum !== void 0) {
|
|
14514
14514
|
const enumValues = schema.enum;
|
|
14515
14515
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
14516
|
-
return
|
|
14516
|
+
return z31.null();
|
|
14517
14517
|
}
|
|
14518
14518
|
if (enumValues.length === 0) {
|
|
14519
|
-
return
|
|
14519
|
+
return z31.never();
|
|
14520
14520
|
}
|
|
14521
14521
|
if (enumValues.length === 1) {
|
|
14522
|
-
return
|
|
14522
|
+
return z31.literal(enumValues[0]);
|
|
14523
14523
|
}
|
|
14524
14524
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
14525
|
-
return
|
|
14525
|
+
return z31.enum(enumValues);
|
|
14526
14526
|
}
|
|
14527
|
-
const literalSchemas = enumValues.map((v) =>
|
|
14527
|
+
const literalSchemas = enumValues.map((v) => z31.literal(v));
|
|
14528
14528
|
if (literalSchemas.length < 2) {
|
|
14529
14529
|
return literalSchemas[0];
|
|
14530
14530
|
}
|
|
14531
|
-
return
|
|
14531
|
+
return z31.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
14532
14532
|
}
|
|
14533
14533
|
if (schema.const !== void 0) {
|
|
14534
|
-
return
|
|
14534
|
+
return z31.literal(schema.const);
|
|
14535
14535
|
}
|
|
14536
14536
|
const type = schema.type;
|
|
14537
14537
|
if (Array.isArray(type)) {
|
|
@@ -14540,68 +14540,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14540
14540
|
return convertBaseSchema(typeSchema, ctx);
|
|
14541
14541
|
});
|
|
14542
14542
|
if (typeSchemas.length === 0) {
|
|
14543
|
-
return
|
|
14543
|
+
return z31.never();
|
|
14544
14544
|
}
|
|
14545
14545
|
if (typeSchemas.length === 1) {
|
|
14546
14546
|
return typeSchemas[0];
|
|
14547
14547
|
}
|
|
14548
|
-
return
|
|
14548
|
+
return z31.union(typeSchemas);
|
|
14549
14549
|
}
|
|
14550
14550
|
if (!type) {
|
|
14551
|
-
return
|
|
14551
|
+
return z31.any();
|
|
14552
14552
|
}
|
|
14553
14553
|
let zodSchema2;
|
|
14554
14554
|
switch (type) {
|
|
14555
14555
|
case "string": {
|
|
14556
|
-
let stringSchema =
|
|
14556
|
+
let stringSchema = z31.string();
|
|
14557
14557
|
if (schema.format) {
|
|
14558
14558
|
const format = schema.format;
|
|
14559
14559
|
if (format === "email") {
|
|
14560
|
-
stringSchema = stringSchema.check(
|
|
14560
|
+
stringSchema = stringSchema.check(z31.email());
|
|
14561
14561
|
} else if (format === "uri" || format === "uri-reference") {
|
|
14562
|
-
stringSchema = stringSchema.check(
|
|
14562
|
+
stringSchema = stringSchema.check(z31.url());
|
|
14563
14563
|
} else if (format === "uuid" || format === "guid") {
|
|
14564
|
-
stringSchema = stringSchema.check(
|
|
14564
|
+
stringSchema = stringSchema.check(z31.uuid());
|
|
14565
14565
|
} else if (format === "date-time") {
|
|
14566
|
-
stringSchema = stringSchema.check(
|
|
14566
|
+
stringSchema = stringSchema.check(z31.iso.datetime());
|
|
14567
14567
|
} else if (format === "date") {
|
|
14568
|
-
stringSchema = stringSchema.check(
|
|
14568
|
+
stringSchema = stringSchema.check(z31.iso.date());
|
|
14569
14569
|
} else if (format === "time") {
|
|
14570
|
-
stringSchema = stringSchema.check(
|
|
14570
|
+
stringSchema = stringSchema.check(z31.iso.time());
|
|
14571
14571
|
} else if (format === "duration") {
|
|
14572
|
-
stringSchema = stringSchema.check(
|
|
14572
|
+
stringSchema = stringSchema.check(z31.iso.duration());
|
|
14573
14573
|
} else if (format === "ipv4") {
|
|
14574
|
-
stringSchema = stringSchema.check(
|
|
14574
|
+
stringSchema = stringSchema.check(z31.ipv4());
|
|
14575
14575
|
} else if (format === "ipv6") {
|
|
14576
|
-
stringSchema = stringSchema.check(
|
|
14576
|
+
stringSchema = stringSchema.check(z31.ipv6());
|
|
14577
14577
|
} else if (format === "mac") {
|
|
14578
|
-
stringSchema = stringSchema.check(
|
|
14578
|
+
stringSchema = stringSchema.check(z31.mac());
|
|
14579
14579
|
} else if (format === "cidr") {
|
|
14580
|
-
stringSchema = stringSchema.check(
|
|
14580
|
+
stringSchema = stringSchema.check(z31.cidrv4());
|
|
14581
14581
|
} else if (format === "cidr-v6") {
|
|
14582
|
-
stringSchema = stringSchema.check(
|
|
14582
|
+
stringSchema = stringSchema.check(z31.cidrv6());
|
|
14583
14583
|
} else if (format === "base64") {
|
|
14584
|
-
stringSchema = stringSchema.check(
|
|
14584
|
+
stringSchema = stringSchema.check(z31.base64());
|
|
14585
14585
|
} else if (format === "base64url") {
|
|
14586
|
-
stringSchema = stringSchema.check(
|
|
14586
|
+
stringSchema = stringSchema.check(z31.base64url());
|
|
14587
14587
|
} else if (format === "e164") {
|
|
14588
|
-
stringSchema = stringSchema.check(
|
|
14588
|
+
stringSchema = stringSchema.check(z31.e164());
|
|
14589
14589
|
} else if (format === "jwt") {
|
|
14590
|
-
stringSchema = stringSchema.check(
|
|
14590
|
+
stringSchema = stringSchema.check(z31.jwt());
|
|
14591
14591
|
} else if (format === "emoji") {
|
|
14592
|
-
stringSchema = stringSchema.check(
|
|
14592
|
+
stringSchema = stringSchema.check(z31.emoji());
|
|
14593
14593
|
} else if (format === "nanoid") {
|
|
14594
|
-
stringSchema = stringSchema.check(
|
|
14594
|
+
stringSchema = stringSchema.check(z31.nanoid());
|
|
14595
14595
|
} else if (format === "cuid") {
|
|
14596
|
-
stringSchema = stringSchema.check(
|
|
14596
|
+
stringSchema = stringSchema.check(z31.cuid());
|
|
14597
14597
|
} else if (format === "cuid2") {
|
|
14598
|
-
stringSchema = stringSchema.check(
|
|
14598
|
+
stringSchema = stringSchema.check(z31.cuid2());
|
|
14599
14599
|
} else if (format === "ulid") {
|
|
14600
|
-
stringSchema = stringSchema.check(
|
|
14600
|
+
stringSchema = stringSchema.check(z31.ulid());
|
|
14601
14601
|
} else if (format === "xid") {
|
|
14602
|
-
stringSchema = stringSchema.check(
|
|
14602
|
+
stringSchema = stringSchema.check(z31.xid());
|
|
14603
14603
|
} else if (format === "ksuid") {
|
|
14604
|
-
stringSchema = stringSchema.check(
|
|
14604
|
+
stringSchema = stringSchema.check(z31.ksuid());
|
|
14605
14605
|
}
|
|
14606
14606
|
}
|
|
14607
14607
|
if (typeof schema.minLength === "number") {
|
|
@@ -14618,7 +14618,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14618
14618
|
}
|
|
14619
14619
|
case "number":
|
|
14620
14620
|
case "integer": {
|
|
14621
|
-
let numberSchema = type === "integer" ?
|
|
14621
|
+
let numberSchema = type === "integer" ? z31.number().int() : z31.number();
|
|
14622
14622
|
if (typeof schema.minimum === "number") {
|
|
14623
14623
|
numberSchema = numberSchema.min(schema.minimum);
|
|
14624
14624
|
}
|
|
@@ -14642,11 +14642,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14642
14642
|
break;
|
|
14643
14643
|
}
|
|
14644
14644
|
case "boolean": {
|
|
14645
|
-
zodSchema2 =
|
|
14645
|
+
zodSchema2 = z31.boolean();
|
|
14646
14646
|
break;
|
|
14647
14647
|
}
|
|
14648
14648
|
case "null": {
|
|
14649
|
-
zodSchema2 =
|
|
14649
|
+
zodSchema2 = z31.null();
|
|
14650
14650
|
break;
|
|
14651
14651
|
}
|
|
14652
14652
|
case "object": {
|
|
@@ -14659,14 +14659,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14659
14659
|
}
|
|
14660
14660
|
if (schema.propertyNames) {
|
|
14661
14661
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
14662
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
14662
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z31.any();
|
|
14663
14663
|
if (Object.keys(shape).length === 0) {
|
|
14664
|
-
zodSchema2 =
|
|
14664
|
+
zodSchema2 = z31.record(keySchema, valueSchema);
|
|
14665
14665
|
break;
|
|
14666
14666
|
}
|
|
14667
|
-
const objectSchema2 =
|
|
14668
|
-
const recordSchema =
|
|
14669
|
-
zodSchema2 =
|
|
14667
|
+
const objectSchema2 = z31.object(shape).passthrough();
|
|
14668
|
+
const recordSchema = z31.looseRecord(keySchema, valueSchema);
|
|
14669
|
+
zodSchema2 = z31.intersection(objectSchema2, recordSchema);
|
|
14670
14670
|
break;
|
|
14671
14671
|
}
|
|
14672
14672
|
if (schema.patternProperties) {
|
|
@@ -14675,28 +14675,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14675
14675
|
const looseRecords = [];
|
|
14676
14676
|
for (const pattern of patternKeys) {
|
|
14677
14677
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
14678
|
-
const keySchema =
|
|
14679
|
-
looseRecords.push(
|
|
14678
|
+
const keySchema = z31.string().regex(new RegExp(pattern));
|
|
14679
|
+
looseRecords.push(z31.looseRecord(keySchema, patternValue));
|
|
14680
14680
|
}
|
|
14681
14681
|
const schemasToIntersect = [];
|
|
14682
14682
|
if (Object.keys(shape).length > 0) {
|
|
14683
|
-
schemasToIntersect.push(
|
|
14683
|
+
schemasToIntersect.push(z31.object(shape).passthrough());
|
|
14684
14684
|
}
|
|
14685
14685
|
schemasToIntersect.push(...looseRecords);
|
|
14686
14686
|
if (schemasToIntersect.length === 0) {
|
|
14687
|
-
zodSchema2 =
|
|
14687
|
+
zodSchema2 = z31.object({}).passthrough();
|
|
14688
14688
|
} else if (schemasToIntersect.length === 1) {
|
|
14689
14689
|
zodSchema2 = schemasToIntersect[0];
|
|
14690
14690
|
} else {
|
|
14691
|
-
let result =
|
|
14691
|
+
let result = z31.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
14692
14692
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
14693
|
-
result =
|
|
14693
|
+
result = z31.intersection(result, schemasToIntersect[i]);
|
|
14694
14694
|
}
|
|
14695
14695
|
zodSchema2 = result;
|
|
14696
14696
|
}
|
|
14697
14697
|
break;
|
|
14698
14698
|
}
|
|
14699
|
-
const objectSchema =
|
|
14699
|
+
const objectSchema = z31.object(shape);
|
|
14700
14700
|
if (schema.additionalProperties === false) {
|
|
14701
14701
|
zodSchema2 = objectSchema.strict();
|
|
14702
14702
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -14713,33 +14713,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14713
14713
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
14714
14714
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
14715
14715
|
if (rest) {
|
|
14716
|
-
zodSchema2 =
|
|
14716
|
+
zodSchema2 = z31.tuple(tupleItems).rest(rest);
|
|
14717
14717
|
} else {
|
|
14718
|
-
zodSchema2 =
|
|
14718
|
+
zodSchema2 = z31.tuple(tupleItems);
|
|
14719
14719
|
}
|
|
14720
14720
|
if (typeof schema.minItems === "number") {
|
|
14721
|
-
zodSchema2 = zodSchema2.check(
|
|
14721
|
+
zodSchema2 = zodSchema2.check(z31.minLength(schema.minItems));
|
|
14722
14722
|
}
|
|
14723
14723
|
if (typeof schema.maxItems === "number") {
|
|
14724
|
-
zodSchema2 = zodSchema2.check(
|
|
14724
|
+
zodSchema2 = zodSchema2.check(z31.maxLength(schema.maxItems));
|
|
14725
14725
|
}
|
|
14726
14726
|
} else if (Array.isArray(items)) {
|
|
14727
14727
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
14728
14728
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
14729
14729
|
if (rest) {
|
|
14730
|
-
zodSchema2 =
|
|
14730
|
+
zodSchema2 = z31.tuple(tupleItems).rest(rest);
|
|
14731
14731
|
} else {
|
|
14732
|
-
zodSchema2 =
|
|
14732
|
+
zodSchema2 = z31.tuple(tupleItems);
|
|
14733
14733
|
}
|
|
14734
14734
|
if (typeof schema.minItems === "number") {
|
|
14735
|
-
zodSchema2 = zodSchema2.check(
|
|
14735
|
+
zodSchema2 = zodSchema2.check(z31.minLength(schema.minItems));
|
|
14736
14736
|
}
|
|
14737
14737
|
if (typeof schema.maxItems === "number") {
|
|
14738
|
-
zodSchema2 = zodSchema2.check(
|
|
14738
|
+
zodSchema2 = zodSchema2.check(z31.maxLength(schema.maxItems));
|
|
14739
14739
|
}
|
|
14740
14740
|
} else if (items !== void 0) {
|
|
14741
14741
|
const element = convertSchema(items, ctx);
|
|
14742
|
-
let arraySchema =
|
|
14742
|
+
let arraySchema = z31.array(element);
|
|
14743
14743
|
if (typeof schema.minItems === "number") {
|
|
14744
14744
|
arraySchema = arraySchema.min(schema.minItems);
|
|
14745
14745
|
}
|
|
@@ -14748,7 +14748,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14748
14748
|
}
|
|
14749
14749
|
zodSchema2 = arraySchema;
|
|
14750
14750
|
} else {
|
|
14751
|
-
zodSchema2 =
|
|
14751
|
+
zodSchema2 = z31.array(z31.any());
|
|
14752
14752
|
}
|
|
14753
14753
|
break;
|
|
14754
14754
|
}
|
|
@@ -14765,37 +14765,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14765
14765
|
}
|
|
14766
14766
|
function convertSchema(schema, ctx) {
|
|
14767
14767
|
if (typeof schema === "boolean") {
|
|
14768
|
-
return schema ?
|
|
14768
|
+
return schema ? z31.any() : z31.never();
|
|
14769
14769
|
}
|
|
14770
14770
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
14771
14771
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
14772
14772
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
14773
14773
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
14774
|
-
const anyOfUnion =
|
|
14775
|
-
baseSchema = hasExplicitType ?
|
|
14774
|
+
const anyOfUnion = z31.union(options);
|
|
14775
|
+
baseSchema = hasExplicitType ? z31.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
14776
14776
|
}
|
|
14777
14777
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
14778
14778
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
14779
|
-
const oneOfUnion =
|
|
14780
|
-
baseSchema = hasExplicitType ?
|
|
14779
|
+
const oneOfUnion = z31.xor(options);
|
|
14780
|
+
baseSchema = hasExplicitType ? z31.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
14781
14781
|
}
|
|
14782
14782
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
14783
14783
|
if (schema.allOf.length === 0) {
|
|
14784
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
14784
|
+
baseSchema = hasExplicitType ? baseSchema : z31.any();
|
|
14785
14785
|
} else {
|
|
14786
14786
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
14787
14787
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
14788
14788
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
14789
|
-
result =
|
|
14789
|
+
result = z31.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
14790
14790
|
}
|
|
14791
14791
|
baseSchema = result;
|
|
14792
14792
|
}
|
|
14793
14793
|
}
|
|
14794
14794
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
14795
|
-
baseSchema =
|
|
14795
|
+
baseSchema = z31.nullable(baseSchema);
|
|
14796
14796
|
}
|
|
14797
14797
|
if (schema.readOnly === true) {
|
|
14798
|
-
baseSchema =
|
|
14798
|
+
baseSchema = z31.readonly(baseSchema);
|
|
14799
14799
|
}
|
|
14800
14800
|
const extraMeta = {};
|
|
14801
14801
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -14822,7 +14822,7 @@ function convertSchema(schema, ctx) {
|
|
|
14822
14822
|
}
|
|
14823
14823
|
function fromJSONSchema(schema, params) {
|
|
14824
14824
|
if (typeof schema === "boolean") {
|
|
14825
|
-
return schema ?
|
|
14825
|
+
return schema ? z31.any() : z31.never();
|
|
14826
14826
|
}
|
|
14827
14827
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
14828
14828
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -14836,14 +14836,14 @@ function fromJSONSchema(schema, params) {
|
|
|
14836
14836
|
};
|
|
14837
14837
|
return convertSchema(schema, ctx);
|
|
14838
14838
|
}
|
|
14839
|
-
var
|
|
14839
|
+
var z31, RECOGNIZED_KEYS;
|
|
14840
14840
|
var init_from_json_schema = __esm({
|
|
14841
14841
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
14842
14842
|
init_registries();
|
|
14843
14843
|
init_checks2();
|
|
14844
14844
|
init_iso();
|
|
14845
14845
|
init_schemas2();
|
|
14846
|
-
|
|
14846
|
+
z31 = {
|
|
14847
14847
|
...schemas_exports2,
|
|
14848
14848
|
...checks_exports2,
|
|
14849
14849
|
iso: iso_exports
|
|
@@ -26401,17 +26401,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
26401
26401
|
});
|
|
26402
26402
|
|
|
26403
26403
|
// packages/contracts/src/config/manifest.ts
|
|
26404
|
-
import { z as
|
|
26404
|
+
import { z as z6 } from "zod";
|
|
26405
26405
|
|
|
26406
|
-
// packages/contracts/src/
|
|
26406
|
+
// packages/contracts/src/orca-execution.ts
|
|
26407
26407
|
import { z as z4 } from "zod";
|
|
26408
|
-
var
|
|
26409
|
-
|
|
26410
|
-
|
|
26411
|
-
|
|
26408
|
+
var identifier = z4.string().min(1);
|
|
26409
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
26410
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
26411
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
26412
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
26413
|
+
});
|
|
26414
|
+
var orcaContextSchema = z4.object({
|
|
26415
|
+
runtimeId: identifier,
|
|
26416
|
+
coordinatorHandle: identifier,
|
|
26417
|
+
executionHostId: z4.literal("local")
|
|
26418
|
+
});
|
|
26419
|
+
var orcaRoutingRunSchema = z4.object({
|
|
26420
|
+
runId: identifier.nullable(),
|
|
26421
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
26422
|
+
});
|
|
26423
|
+
var orcaLaunchSchema = z4.object({
|
|
26424
|
+
projectId: identifier,
|
|
26425
|
+
projectRoot: identifier,
|
|
26426
|
+
taskId: identifier,
|
|
26427
|
+
instanceId: identifier,
|
|
26428
|
+
workerSessionId: identifier,
|
|
26429
|
+
agentId: identifier,
|
|
26430
|
+
role: z4.enum(["worker", "lead"]),
|
|
26431
|
+
protocol: identifier,
|
|
26432
|
+
worktreePath: identifier,
|
|
26433
|
+
worktreeBranch: identifier,
|
|
26434
|
+
projectHash: identifier,
|
|
26435
|
+
lockToken: identifier,
|
|
26436
|
+
prompt: identifier,
|
|
26437
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
26438
|
+
leadMailbox: identifier.nullable(),
|
|
26439
|
+
model: identifier.optional(),
|
|
26440
|
+
effort: identifier.optional(),
|
|
26441
|
+
accountId: identifier.optional()
|
|
26442
|
+
});
|
|
26443
|
+
var orcaStartBindingSchema = z4.object({
|
|
26444
|
+
runId: identifier.nullable(),
|
|
26445
|
+
orcaTaskId: identifier.nullable(),
|
|
26446
|
+
retryOf: identifier.nullable()
|
|
26447
|
+
});
|
|
26448
|
+
var orcaAttemptSchema = z4.object({
|
|
26449
|
+
backend: z4.literal("orca"),
|
|
26450
|
+
version: z4.literal(1),
|
|
26451
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
26452
|
+
revision: z4.number().int().nonnegative(),
|
|
26453
|
+
context: orcaContextSchema,
|
|
26454
|
+
launch: orcaLaunchSchema,
|
|
26455
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26456
|
+
workspaceId: identifier,
|
|
26457
|
+
workspaceSelector: identifier,
|
|
26458
|
+
state: z4.enum([
|
|
26459
|
+
"prepared",
|
|
26460
|
+
"launching",
|
|
26461
|
+
"ready",
|
|
26462
|
+
"turn_unobserved",
|
|
26463
|
+
"outcome_unknown",
|
|
26464
|
+
"stop_pending",
|
|
26465
|
+
"stop_unknown",
|
|
26466
|
+
"stopped",
|
|
26467
|
+
"failed",
|
|
26468
|
+
"circuit_broken"
|
|
26469
|
+
]),
|
|
26470
|
+
runId: identifier.nullable(),
|
|
26471
|
+
orcaTaskId: identifier.nullable(),
|
|
26472
|
+
dispatchId: identifier.nullable(),
|
|
26473
|
+
retryOf: identifier.nullable(),
|
|
26474
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
26475
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
26476
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
26477
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
26478
|
+
startRequestId: identifier.nullable(),
|
|
26479
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
26480
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
26481
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
26482
|
+
stopRequestId: identifier.nullable(),
|
|
26483
|
+
/**
|
|
26484
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
26485
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
26486
|
+
*/
|
|
26487
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
26488
|
+
failureCount: z4.number().int().nonnegative(),
|
|
26489
|
+
resourceState: z4.string(),
|
|
26490
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
26491
|
+
lastReceipt: z4.string().nullable(),
|
|
26492
|
+
lastError: z4.string().nullable(),
|
|
26493
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
26494
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
26495
|
+
observedAt: z4.string()
|
|
26496
|
+
});
|
|
26497
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
26498
|
+
messageId: identifier,
|
|
26499
|
+
runtimeId: identifier,
|
|
26500
|
+
runId: identifier,
|
|
26501
|
+
orcaTaskId: identifier,
|
|
26502
|
+
dispatchId: identifier,
|
|
26503
|
+
senderHandle: identifier,
|
|
26504
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
26505
|
+
body: z4.string(),
|
|
26506
|
+
reportPath: identifier
|
|
26507
|
+
});
|
|
26508
|
+
var orcaWorkerReportSchema = z4.object({
|
|
26509
|
+
event: orcaWorkerDoneSchema,
|
|
26510
|
+
manifestId: identifier,
|
|
26511
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26512
|
+
reportText: z4.string().min(1).max(65536),
|
|
26513
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26514
|
+
ingestedAt: z4.string().datetime()
|
|
26515
|
+
});
|
|
26516
|
+
var orcaReportDeliverySchema = z4.object({
|
|
26517
|
+
key: identifier,
|
|
26518
|
+
mailbox: identifier.nullable(),
|
|
26519
|
+
state: z4.enum(["pending", "delivered"]),
|
|
26520
|
+
messageId: identifier.nullable(),
|
|
26521
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
26522
|
+
lastError: z4.string().nullable()
|
|
26523
|
+
});
|
|
26524
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
26525
|
+
resourceRelease: z4.object({
|
|
26526
|
+
dispatchId: identifier,
|
|
26527
|
+
releasedAt: z4.string().datetime(),
|
|
26528
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26529
|
+
receipt: identifier
|
|
26530
|
+
}).optional(),
|
|
26531
|
+
retiredAt: z4.string().datetime().optional(),
|
|
26532
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
26533
|
+
});
|
|
26534
|
+
var orcaReportMessageSchema = z4.object({
|
|
26535
|
+
id: identifier,
|
|
26536
|
+
run_id: z4.string().nullable(),
|
|
26537
|
+
delivery_contract: z4.string(),
|
|
26538
|
+
from_handle: z4.string(),
|
|
26539
|
+
to_handle: z4.string(),
|
|
26540
|
+
type: z4.string(),
|
|
26541
|
+
body: z4.string(),
|
|
26542
|
+
payload: z4.string().nullable(),
|
|
26543
|
+
sender_pane_key: z4.string().nullable()
|
|
26544
|
+
});
|
|
26545
|
+
var orcaReportSourceSchema = z4.object({
|
|
26546
|
+
ok: z4.literal(true),
|
|
26547
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
26548
|
+
result: z4.object({
|
|
26549
|
+
messages: z4.array(z4.json()).optional(),
|
|
26550
|
+
dispatch: z4.object({
|
|
26551
|
+
id: identifier,
|
|
26552
|
+
run_id: identifier,
|
|
26553
|
+
task_id: identifier,
|
|
26554
|
+
assignee_handle: identifier,
|
|
26555
|
+
assignee_pane_key: z4.string().nullable(),
|
|
26556
|
+
status: z4.string()
|
|
26557
|
+
}).optional()
|
|
26558
|
+
})
|
|
26559
|
+
});
|
|
26560
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
26561
|
+
taskId: identifier,
|
|
26562
|
+
dispatchId: identifier,
|
|
26563
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
26564
|
+
reportPath: identifier
|
|
26565
|
+
});
|
|
26566
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
26567
|
+
action: z4.enum([
|
|
26568
|
+
"show",
|
|
26569
|
+
"read",
|
|
26570
|
+
"recover-start",
|
|
26571
|
+
"recover-stop",
|
|
26572
|
+
"retry",
|
|
26573
|
+
"stop",
|
|
26574
|
+
"ingest-report",
|
|
26575
|
+
"relay-report"
|
|
26576
|
+
]),
|
|
26577
|
+
recordId: identifier,
|
|
26578
|
+
cursor: identifier.optional(),
|
|
26579
|
+
messageId: identifier.optional()
|
|
26580
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
26581
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
26582
|
+
path: ["cursor"]
|
|
26583
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
26584
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
26585
|
+
path: ["messageId"]
|
|
26586
|
+
});
|
|
26587
|
+
var effectSchema = z4.object({
|
|
26588
|
+
kind: z4.string(),
|
|
26589
|
+
role: z4.string().optional(),
|
|
26590
|
+
action: z4.string().optional(),
|
|
26591
|
+
id: z4.string().optional()
|
|
26592
|
+
});
|
|
26593
|
+
var selectionSchema = z4.object({
|
|
26594
|
+
agent: z4.string().nullable().optional(),
|
|
26595
|
+
model: z4.string().nullable().optional(),
|
|
26596
|
+
effort: z4.string().nullable().optional()
|
|
26597
|
+
});
|
|
26598
|
+
var orcaReplySchema = z4.object({
|
|
26599
|
+
ok: z4.boolean(),
|
|
26600
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
26601
|
+
error: z4.object({
|
|
26602
|
+
code: z4.string(),
|
|
26603
|
+
message: z4.string(),
|
|
26604
|
+
data: z4.object({
|
|
26605
|
+
requestId: identifier.optional(),
|
|
26606
|
+
orchestrationRequestId: identifier.optional(),
|
|
26607
|
+
dispatchId: identifier.optional()
|
|
26608
|
+
}).optional()
|
|
26609
|
+
}).optional(),
|
|
26610
|
+
result: z4.object({
|
|
26611
|
+
state: z4.string().optional(),
|
|
26612
|
+
requestId: identifier.optional(),
|
|
26613
|
+
/**
|
|
26614
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
26615
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
26616
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
26617
|
+
* be bound to the request key this attempt issued.
|
|
26618
|
+
*/
|
|
26619
|
+
mutation: z4.object({
|
|
26620
|
+
requestId: identifier.optional(),
|
|
26621
|
+
replayed: z4.boolean().optional()
|
|
26622
|
+
}).optional(),
|
|
26623
|
+
stage: z4.string().optional(),
|
|
26624
|
+
turnStart: z4.string().optional(),
|
|
26625
|
+
runId: identifier.optional(),
|
|
26626
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
26627
|
+
taskId: identifier.optional(),
|
|
26628
|
+
dispatchId: identifier.optional(),
|
|
26629
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
26630
|
+
effects: z4.array(effectSchema).optional(),
|
|
26631
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
26632
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
26633
|
+
lastError: z4.string().nullable().optional(),
|
|
26634
|
+
processAction: z4.string().optional(),
|
|
26635
|
+
helpers: z4.array(
|
|
26636
|
+
z4.object({
|
|
26637
|
+
dispatchId: identifier.optional(),
|
|
26638
|
+
creatorDispatchId: identifier.optional(),
|
|
26639
|
+
outcome: z4.string(),
|
|
26640
|
+
keptOpenBy: identifier.optional(),
|
|
26641
|
+
state: z4.string().optional(),
|
|
26642
|
+
lastError: z4.string().nullable().optional()
|
|
26643
|
+
})
|
|
26644
|
+
).optional(),
|
|
26645
|
+
helperStopError: z4.string().nullable().optional(),
|
|
26646
|
+
status: z4.string().optional(),
|
|
26647
|
+
terminal: z4.object({
|
|
26648
|
+
handle: identifier,
|
|
26649
|
+
connected: z4.boolean(),
|
|
26650
|
+
writable: z4.boolean(),
|
|
26651
|
+
executionHostId: identifier
|
|
26652
|
+
}).optional(),
|
|
26653
|
+
runtime: z4.object({
|
|
26654
|
+
runtimeId: identifier,
|
|
26655
|
+
reachable: z4.boolean(),
|
|
26656
|
+
state: z4.string(),
|
|
26657
|
+
capabilities: z4.array(z4.string())
|
|
26658
|
+
}).optional(),
|
|
26659
|
+
worktree: z4.object({
|
|
26660
|
+
id: identifier,
|
|
26661
|
+
path: identifier,
|
|
26662
|
+
branch: identifier,
|
|
26663
|
+
hostId: identifier,
|
|
26664
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
26665
|
+
}).optional(),
|
|
26666
|
+
dispatch: z4.object({
|
|
26667
|
+
id: identifier,
|
|
26668
|
+
runId: identifier,
|
|
26669
|
+
taskId: identifier,
|
|
26670
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
26671
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
26672
|
+
failureCount: z4.number().int().nonnegative()
|
|
26673
|
+
}).optional(),
|
|
26674
|
+
worker: z4.object({
|
|
26675
|
+
dispatchId: identifier,
|
|
26676
|
+
runtimeEpoch: identifier,
|
|
26677
|
+
state: z4.string(),
|
|
26678
|
+
stage: z4.string(),
|
|
26679
|
+
worktreeId: identifier.nullable()
|
|
26680
|
+
}).optional(),
|
|
26681
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
26682
|
+
projection: z4.object({
|
|
26683
|
+
resource: z4.object({
|
|
26684
|
+
state: z4.string(),
|
|
26685
|
+
terminalState: z4.string(),
|
|
26686
|
+
ownerDispatchId: identifier.optional(),
|
|
26687
|
+
releaseState: z4.string().optional()
|
|
26688
|
+
}).optional()
|
|
26689
|
+
}).optional()
|
|
26690
|
+
}).optional()
|
|
26691
|
+
});
|
|
26692
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
26693
|
+
schemaVersion: z4.number().int().positive(),
|
|
26694
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
26695
|
+
});
|
|
26696
|
+
var accountProviderSchema = z4.object({
|
|
26697
|
+
accounts: z4.array(z4.object({})),
|
|
26698
|
+
activeAccountId: identifier.nullable()
|
|
26699
|
+
});
|
|
26700
|
+
var orcaAccountReplySchema = z4.object({
|
|
26701
|
+
ok: z4.literal(true),
|
|
26702
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
26703
|
+
result: z4.object({
|
|
26704
|
+
codex: accountProviderSchema,
|
|
26705
|
+
opencode: accountProviderSchema,
|
|
26706
|
+
claude: accountProviderSchema
|
|
26707
|
+
})
|
|
26708
|
+
});
|
|
26709
|
+
|
|
26710
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
26711
|
+
import { z as z5 } from "zod";
|
|
26712
|
+
var projectWorkerPolicySchema = z5.object({
|
|
26713
|
+
verification: z5.object({
|
|
26714
|
+
full: z5.enum(["local", "ci"]),
|
|
26715
|
+
local: z5.enum(["single-file", "affected"])
|
|
26412
26716
|
}).strict().optional(),
|
|
26413
|
-
instructions:
|
|
26414
|
-
|
|
26717
|
+
instructions: z5.array(
|
|
26718
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
26415
26719
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
26416
26720
|
"Instructions must be single-line text without control characters or a leading #"
|
|
26417
26721
|
)
|
|
@@ -26439,8 +26743,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
26439
26743
|
path: ".cleo/config.json",
|
|
26440
26744
|
mergePrecedence: 20,
|
|
26441
26745
|
driftDetection: "schema-validate",
|
|
26442
|
-
schema:
|
|
26443
|
-
orchestrate:
|
|
26746
|
+
schema: z6.object({
|
|
26747
|
+
orchestrate: z6.object({
|
|
26748
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
26749
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
26750
|
+
}).passthrough().optional()
|
|
26444
26751
|
}).passthrough()
|
|
26445
26752
|
};
|
|
26446
26753
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -26456,139 +26763,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
26456
26763
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
26457
26764
|
CLEO_CONFIG_MANIFEST
|
|
26458
26765
|
]);
|
|
26459
|
-
var configManifestEntrySchema =
|
|
26460
|
-
id:
|
|
26461
|
-
scope:
|
|
26462
|
-
path:
|
|
26463
|
-
schema:
|
|
26464
|
-
mergePrecedence:
|
|
26465
|
-
driftDetection:
|
|
26466
|
-
|
|
26467
|
-
|
|
26468
|
-
|
|
26469
|
-
|
|
26766
|
+
var configManifestEntrySchema = z6.object({
|
|
26767
|
+
id: z6.string().min(1),
|
|
26768
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
26769
|
+
path: z6.string().min(1),
|
|
26770
|
+
schema: z6.unknown().optional(),
|
|
26771
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
26772
|
+
driftDetection: z6.union([
|
|
26773
|
+
z6.literal("schema-validate"),
|
|
26774
|
+
z6.literal("staleness-gate"),
|
|
26775
|
+
z6.literal("value-diff"),
|
|
26776
|
+
z6.literal("none")
|
|
26470
26777
|
]),
|
|
26471
|
-
defaults:
|
|
26778
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
26472
26779
|
});
|
|
26473
26780
|
|
|
26474
26781
|
// packages/contracts/src/daemon/health.ts
|
|
26475
|
-
import { z as
|
|
26782
|
+
import { z as z8 } from "zod";
|
|
26476
26783
|
|
|
26477
26784
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
26478
|
-
import { z as
|
|
26479
|
-
var EnvPairSchema =
|
|
26785
|
+
import { z as z7 } from "zod";
|
|
26786
|
+
var EnvPairSchema = z7.object({
|
|
26480
26787
|
/** Environment variable name. */
|
|
26481
|
-
key:
|
|
26788
|
+
key: z7.string().min(1),
|
|
26482
26789
|
/** Environment variable value. */
|
|
26483
|
-
value:
|
|
26790
|
+
value: z7.string()
|
|
26484
26791
|
}).strict();
|
|
26485
|
-
var ChildStateSchema =
|
|
26486
|
-
var ChildStatusSchema =
|
|
26792
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
26793
|
+
var ChildStatusSchema = z7.object({
|
|
26487
26794
|
/** Logical id of the child (stable across restarts). */
|
|
26488
|
-
child_id:
|
|
26795
|
+
child_id: z7.string().min(1),
|
|
26489
26796
|
/** Current OS pid (0 when not currently running). */
|
|
26490
|
-
pid:
|
|
26797
|
+
pid: z7.number().int().nonnegative(),
|
|
26491
26798
|
/** Current liveness state. */
|
|
26492
26799
|
state: ChildStateSchema,
|
|
26493
26800
|
/** Total restarts observed for this child. */
|
|
26494
|
-
restart_count:
|
|
26801
|
+
restart_count: z7.number().int().nonnegative()
|
|
26495
26802
|
}).strict();
|
|
26496
|
-
var SpawnRequestSchema =
|
|
26803
|
+
var SpawnRequestSchema = z7.object({
|
|
26497
26804
|
/** Tag discriminating this request variant. */
|
|
26498
|
-
kind:
|
|
26805
|
+
kind: z7.literal("spawn"),
|
|
26499
26806
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
26500
|
-
child_id:
|
|
26807
|
+
child_id: z7.string().min(1),
|
|
26501
26808
|
/** Absolute path to the program to execute. */
|
|
26502
|
-
program:
|
|
26809
|
+
program: z7.string().min(1),
|
|
26503
26810
|
/** Arguments passed to the program. */
|
|
26504
|
-
args:
|
|
26811
|
+
args: z7.array(z7.string()).default([]),
|
|
26505
26812
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
26506
|
-
env:
|
|
26813
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
26507
26814
|
/** Optional working directory for the child. */
|
|
26508
|
-
cwd:
|
|
26815
|
+
cwd: z7.string().optional()
|
|
26509
26816
|
}).strict();
|
|
26510
|
-
var RestartRequestSchema =
|
|
26817
|
+
var RestartRequestSchema = z7.object({
|
|
26511
26818
|
/** Tag discriminating this request variant. */
|
|
26512
|
-
kind:
|
|
26819
|
+
kind: z7.literal("restart"),
|
|
26513
26820
|
/** Logical id of the child to restart. */
|
|
26514
|
-
child_id:
|
|
26821
|
+
child_id: z7.string().min(1)
|
|
26515
26822
|
}).strict();
|
|
26516
|
-
var MonitorRequestSchema =
|
|
26823
|
+
var MonitorRequestSchema = z7.object({
|
|
26517
26824
|
/** Tag discriminating this request variant. */
|
|
26518
|
-
kind:
|
|
26825
|
+
kind: z7.literal("monitor"),
|
|
26519
26826
|
/** Specific child id to monitor; omit to request all children. */
|
|
26520
|
-
child_id:
|
|
26827
|
+
child_id: z7.string().optional()
|
|
26521
26828
|
}).strict();
|
|
26522
|
-
var HealthRequestSchema =
|
|
26829
|
+
var HealthRequestSchema = z7.object({
|
|
26523
26830
|
/** Tag discriminating this request variant. */
|
|
26524
|
-
kind:
|
|
26831
|
+
kind: z7.literal("health")
|
|
26525
26832
|
}).strict();
|
|
26526
|
-
var SupervisorIpcRequestSchema =
|
|
26833
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
26527
26834
|
SpawnRequestSchema,
|
|
26528
26835
|
RestartRequestSchema,
|
|
26529
26836
|
MonitorRequestSchema,
|
|
26530
26837
|
HealthRequestSchema
|
|
26531
26838
|
]);
|
|
26532
|
-
var SpawnedResponseSchema =
|
|
26839
|
+
var SpawnedResponseSchema = z7.object({
|
|
26533
26840
|
/** Tag discriminating this response variant. */
|
|
26534
|
-
kind:
|
|
26841
|
+
kind: z7.literal("spawned"),
|
|
26535
26842
|
/** Logical id of the spawned child. */
|
|
26536
|
-
child_id:
|
|
26843
|
+
child_id: z7.string().min(1),
|
|
26537
26844
|
/** OS pid assigned to the spawned child. */
|
|
26538
|
-
pid:
|
|
26845
|
+
pid: z7.number().int().nonnegative()
|
|
26539
26846
|
}).strict();
|
|
26540
|
-
var RestartedResponseSchema =
|
|
26847
|
+
var RestartedResponseSchema = z7.object({
|
|
26541
26848
|
/** Tag discriminating this response variant. */
|
|
26542
|
-
kind:
|
|
26849
|
+
kind: z7.literal("restarted"),
|
|
26543
26850
|
/** Logical id of the restarted child. */
|
|
26544
|
-
child_id:
|
|
26851
|
+
child_id: z7.string().min(1),
|
|
26545
26852
|
/** New OS pid after the restart. */
|
|
26546
|
-
pid:
|
|
26853
|
+
pid: z7.number().int().nonnegative(),
|
|
26547
26854
|
/** Number of times this child has been restarted in total. */
|
|
26548
|
-
restart_count:
|
|
26855
|
+
restart_count: z7.number().int().nonnegative()
|
|
26549
26856
|
}).strict();
|
|
26550
|
-
var MonitorResponseSchema =
|
|
26857
|
+
var MonitorResponseSchema = z7.object({
|
|
26551
26858
|
/** Tag discriminating this response variant. */
|
|
26552
|
-
kind:
|
|
26859
|
+
kind: z7.literal("monitor"),
|
|
26553
26860
|
/** One row per monitored child. */
|
|
26554
|
-
children:
|
|
26861
|
+
children: z7.array(ChildStatusSchema)
|
|
26555
26862
|
}).strict();
|
|
26556
|
-
var HealthResponseSchema =
|
|
26863
|
+
var HealthResponseSchema = z7.object({
|
|
26557
26864
|
/** Tag discriminating this response variant. */
|
|
26558
|
-
kind:
|
|
26865
|
+
kind: z7.literal("health"),
|
|
26559
26866
|
/** Supervisor process pid. */
|
|
26560
|
-
pid:
|
|
26867
|
+
pid: z7.number().int().nonnegative(),
|
|
26561
26868
|
/** Number of children currently tracked. */
|
|
26562
|
-
child_count:
|
|
26869
|
+
child_count: z7.number().int().nonnegative(),
|
|
26563
26870
|
/** Seconds the supervisor has been running. */
|
|
26564
|
-
uptime_secs:
|
|
26871
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
26565
26872
|
/** Frozen protocol version the supervisor speaks. */
|
|
26566
|
-
protocol_version:
|
|
26873
|
+
protocol_version: z7.string()
|
|
26567
26874
|
}).strict();
|
|
26568
|
-
var LifecycleEventKindSchema =
|
|
26569
|
-
var LifecycleEventResponseSchema =
|
|
26875
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
26876
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
26570
26877
|
/** Tag discriminating this response variant. */
|
|
26571
|
-
kind:
|
|
26878
|
+
kind: z7.literal("event"),
|
|
26572
26879
|
/** What happened. */
|
|
26573
26880
|
event: LifecycleEventKindSchema,
|
|
26574
26881
|
/** Logical id of the affected child. */
|
|
26575
|
-
child_id:
|
|
26882
|
+
child_id: z7.string().min(1),
|
|
26576
26883
|
/** Exit code, when the OS reported one. */
|
|
26577
|
-
exit_code:
|
|
26884
|
+
exit_code: z7.number().int().optional(),
|
|
26578
26885
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
26579
|
-
signal:
|
|
26886
|
+
signal: z7.string().optional(),
|
|
26580
26887
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
26581
|
-
restart_delay_ms:
|
|
26888
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
26582
26889
|
}).strict();
|
|
26583
|
-
var ErrorResponseSchema =
|
|
26890
|
+
var ErrorResponseSchema = z7.object({
|
|
26584
26891
|
/** Tag discriminating this response variant. */
|
|
26585
|
-
kind:
|
|
26892
|
+
kind: z7.literal("error"),
|
|
26586
26893
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
26587
|
-
code:
|
|
26894
|
+
code: z7.string().min(1),
|
|
26588
26895
|
/** Human-readable error message. */
|
|
26589
|
-
message:
|
|
26896
|
+
message: z7.string()
|
|
26590
26897
|
}).strict();
|
|
26591
|
-
var SupervisorIpcResponseSchema =
|
|
26898
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
26592
26899
|
SpawnedResponseSchema,
|
|
26593
26900
|
RestartedResponseSchema,
|
|
26594
26901
|
MonitorResponseSchema,
|
|
@@ -26596,27 +26903,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
26596
26903
|
LifecycleEventResponseSchema,
|
|
26597
26904
|
ErrorResponseSchema
|
|
26598
26905
|
]);
|
|
26599
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
26906
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
26600
26907
|
/** Frozen protocol version. */
|
|
26601
|
-
protocol_version:
|
|
26908
|
+
protocol_version: z7.string(),
|
|
26602
26909
|
/** Correlation id echoed back on the matching response. */
|
|
26603
|
-
id:
|
|
26910
|
+
id: z7.string().min(1),
|
|
26604
26911
|
/** Direction discriminator. */
|
|
26605
|
-
direction:
|
|
26912
|
+
direction: z7.literal("request"),
|
|
26606
26913
|
/** The request body. */
|
|
26607
26914
|
request: SupervisorIpcRequestSchema
|
|
26608
26915
|
}).strict();
|
|
26609
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
26916
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
26610
26917
|
/** Frozen protocol version. */
|
|
26611
|
-
protocol_version:
|
|
26918
|
+
protocol_version: z7.string(),
|
|
26612
26919
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
26613
|
-
id:
|
|
26920
|
+
id: z7.string().min(1),
|
|
26614
26921
|
/** Direction discriminator. */
|
|
26615
|
-
direction:
|
|
26922
|
+
direction: z7.literal("response"),
|
|
26616
26923
|
/** The response body. */
|
|
26617
26924
|
response: SupervisorIpcResponseSchema
|
|
26618
26925
|
}).strict();
|
|
26619
|
-
var SupervisorIpcEnvelopeSchema =
|
|
26926
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
26620
26927
|
SupervisorIpcRequestEnvelopeSchema,
|
|
26621
26928
|
SupervisorIpcResponseEnvelopeSchema
|
|
26622
26929
|
]);
|
|
@@ -26640,17 +26947,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
26640
26947
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
26641
26948
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
26642
26949
|
*/
|
|
26643
|
-
detail:
|
|
26950
|
+
detail: z8.string().optional()
|
|
26644
26951
|
}).strict();
|
|
26645
|
-
var HealthStatusSchema =
|
|
26952
|
+
var HealthStatusSchema = z8.object({
|
|
26646
26953
|
/** One health row per registered subsystem. */
|
|
26647
|
-
subsystems:
|
|
26954
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
26648
26955
|
/**
|
|
26649
26956
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
26650
26957
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
26651
26958
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
26652
26959
|
*/
|
|
26653
|
-
allHealthy:
|
|
26960
|
+
allHealthy: z8.boolean()
|
|
26654
26961
|
}).strict();
|
|
26655
26962
|
|
|
26656
26963
|
// packages/contracts/src/db-inventory.json
|
|
@@ -38579,7 +38886,7 @@ var OPERATIONS = [
|
|
|
38579
38886
|
];
|
|
38580
38887
|
|
|
38581
38888
|
// packages/contracts/src/docs/modernize.ts
|
|
38582
|
-
import { z as
|
|
38889
|
+
import { z as z9 } from "zod";
|
|
38583
38890
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
38584
38891
|
var DOCS_MODERNIZE_OPS = [
|
|
38585
38892
|
"ingest",
|
|
@@ -38593,105 +38900,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
38593
38900
|
"reslug",
|
|
38594
38901
|
"link-task"
|
|
38595
38902
|
];
|
|
38596
|
-
var judgmentSchema =
|
|
38597
|
-
question:
|
|
38598
|
-
site:
|
|
38599
|
-
mode:
|
|
38600
|
-
ruleAnswer:
|
|
38601
|
-
decidedAnswer:
|
|
38602
|
-
decidedConfidence:
|
|
38603
|
-
source:
|
|
38604
|
-
acted:
|
|
38605
|
-
});
|
|
38606
|
-
var relPath =
|
|
38607
|
-
var docsModernizePlanSchema =
|
|
38608
|
-
root:
|
|
38609
|
-
generatedAt:
|
|
38610
|
-
mode:
|
|
38611
|
-
counts:
|
|
38612
|
-
rows:
|
|
38613
|
-
|
|
38903
|
+
var judgmentSchema = z9.object({
|
|
38904
|
+
question: z9.enum(["classify", "merge"]),
|
|
38905
|
+
site: z9.string(),
|
|
38906
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
38907
|
+
ruleAnswer: z9.string(),
|
|
38908
|
+
decidedAnswer: z9.string().nullable(),
|
|
38909
|
+
decidedConfidence: z9.number().nullable(),
|
|
38910
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
38911
|
+
acted: z9.string()
|
|
38912
|
+
});
|
|
38913
|
+
var relPath = z9.string().min(1).max(1024);
|
|
38914
|
+
var docsModernizePlanSchema = z9.object({
|
|
38915
|
+
root: z9.string().min(1),
|
|
38916
|
+
generatedAt: z9.string(),
|
|
38917
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
38918
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
38919
|
+
rows: z9.array(
|
|
38920
|
+
z9.object({
|
|
38614
38921
|
path: relPath,
|
|
38615
|
-
sha256:
|
|
38616
|
-
kind:
|
|
38617
|
-
slug:
|
|
38618
|
-
title:
|
|
38619
|
-
disposition:
|
|
38620
|
-
target:
|
|
38621
|
-
reasons:
|
|
38622
|
-
judgments:
|
|
38623
|
-
ownerTasks:
|
|
38624
|
-
category:
|
|
38625
|
-
refs:
|
|
38626
|
-
overridden:
|
|
38627
|
-
covers:
|
|
38628
|
-
baselineRemove:
|
|
38922
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
38923
|
+
kind: z9.string().min(1),
|
|
38924
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
38925
|
+
title: z9.string(),
|
|
38926
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
38927
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
38928
|
+
reasons: z9.array(z9.string()),
|
|
38929
|
+
judgments: z9.array(judgmentSchema),
|
|
38930
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
38931
|
+
category: z9.string(),
|
|
38932
|
+
refs: z9.array(z9.string()),
|
|
38933
|
+
overridden: z9.boolean(),
|
|
38934
|
+
covers: z9.array(z9.string()),
|
|
38935
|
+
baselineRemove: z9.boolean()
|
|
38629
38936
|
})
|
|
38630
38937
|
),
|
|
38631
|
-
linkFixes:
|
|
38632
|
-
|
|
38633
|
-
kind:
|
|
38938
|
+
linkFixes: z9.array(
|
|
38939
|
+
z9.object({
|
|
38940
|
+
kind: z9.literal("link-fix"),
|
|
38634
38941
|
path: relPath,
|
|
38635
|
-
href:
|
|
38636
|
-
newHref:
|
|
38637
|
-
base:
|
|
38638
|
-
sha256:
|
|
38942
|
+
href: z9.string().min(1).max(2048),
|
|
38943
|
+
newHref: z9.string().min(1).max(2048),
|
|
38944
|
+
base: z9.literal("repo").optional(),
|
|
38945
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
38639
38946
|
})
|
|
38640
38947
|
).optional(),
|
|
38641
|
-
repoRoot:
|
|
38948
|
+
repoRoot: z9.string().min(1).optional()
|
|
38642
38949
|
});
|
|
38643
|
-
var docsModernizeOverridesSchema =
|
|
38950
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
38644
38951
|
relPath,
|
|
38645
|
-
|
|
38646
|
-
disposition:
|
|
38647
|
-
target:
|
|
38648
|
-
reason:
|
|
38649
|
-
kind:
|
|
38650
|
-
slug:
|
|
38651
|
-
covers:
|
|
38952
|
+
z9.object({
|
|
38953
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
38954
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
38955
|
+
reason: z9.string().min(1),
|
|
38956
|
+
kind: z9.string().min(1).optional(),
|
|
38957
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
38958
|
+
covers: z9.array(z9.string()).optional()
|
|
38652
38959
|
})
|
|
38653
38960
|
);
|
|
38654
|
-
var receiptOpSchema =
|
|
38655
|
-
op:
|
|
38656
|
-
state:
|
|
38657
|
-
slug:
|
|
38961
|
+
var receiptOpSchema = z9.object({
|
|
38962
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
38963
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
38964
|
+
slug: z9.string().nullable(),
|
|
38658
38965
|
path: relPath.nullable(),
|
|
38659
|
-
target:
|
|
38660
|
-
attachmentId:
|
|
38661
|
-
ownerId:
|
|
38662
|
-
beforeSha256:
|
|
38663
|
-
afterSha256:
|
|
38664
|
-
prior:
|
|
38665
|
-
lifecycleStatus:
|
|
38666
|
-
supersededBy:
|
|
38667
|
-
supersedes:
|
|
38668
|
-
previousAttachmentId:
|
|
38669
|
-
newAttachmentId:
|
|
38670
|
-
linkTargets:
|
|
38671
|
-
kind:
|
|
38966
|
+
target: z9.string().nullable(),
|
|
38967
|
+
attachmentId: z9.string().nullable(),
|
|
38968
|
+
ownerId: z9.string().nullable(),
|
|
38969
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
38970
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
38971
|
+
prior: z9.object({
|
|
38972
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
38973
|
+
supersededBy: z9.string().nullable().optional(),
|
|
38974
|
+
supersedes: z9.string().nullable().optional(),
|
|
38975
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
38976
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
38977
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
38978
|
+
kind: z9.string().nullable().optional()
|
|
38672
38979
|
}).optional(),
|
|
38673
|
-
base:
|
|
38980
|
+
base: z9.literal("repo").optional()
|
|
38674
38981
|
});
|
|
38675
38982
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
38676
|
-
i:
|
|
38677
|
-
});
|
|
38678
|
-
var docsModernizeReceiptSchema =
|
|
38679
|
-
runId:
|
|
38680
|
-
root:
|
|
38681
|
-
appliedAt:
|
|
38682
|
-
planSha256:
|
|
38683
|
-
edgeCount:
|
|
38684
|
-
rolledBackAt:
|
|
38685
|
-
blobs:
|
|
38686
|
-
moves:
|
|
38687
|
-
deleted:
|
|
38688
|
-
ops:
|
|
38689
|
-
durationMs:
|
|
38690
|
-
repoRoot:
|
|
38983
|
+
i: z9.number().int().min(0)
|
|
38984
|
+
});
|
|
38985
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
38986
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
38987
|
+
root: z9.string().min(1),
|
|
38988
|
+
appliedAt: z9.string(),
|
|
38989
|
+
planSha256: z9.string(),
|
|
38990
|
+
edgeCount: z9.number(),
|
|
38991
|
+
rolledBackAt: z9.string().nullable(),
|
|
38992
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
38993
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
38994
|
+
deleted: z9.array(relPath),
|
|
38995
|
+
ops: z9.array(receiptOpSchema),
|
|
38996
|
+
durationMs: z9.number().optional(),
|
|
38997
|
+
repoRoot: z9.string().min(1).optional()
|
|
38691
38998
|
});
|
|
38692
38999
|
|
|
38693
39000
|
// packages/contracts/src/docs/provenance.ts
|
|
38694
|
-
import { z as
|
|
39001
|
+
import { z as z10 } from "zod";
|
|
38695
39002
|
var PROVENANCE_NODE_KINDS = [
|
|
38696
39003
|
"doc",
|
|
38697
39004
|
"task",
|
|
@@ -38714,96 +39021,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
38714
39021
|
"archived",
|
|
38715
39022
|
"draft"
|
|
38716
39023
|
];
|
|
38717
|
-
var provenanceNodeKindSchema =
|
|
38718
|
-
var provenanceEdgeRelationSchema =
|
|
38719
|
-
var docLifecycleStatusSchema =
|
|
39024
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
39025
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
39026
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
38720
39027
|
var provenanceNodeBaseFields = {
|
|
38721
|
-
id:
|
|
38722
|
-
title:
|
|
38723
|
-
metadata:
|
|
39028
|
+
id: z10.string().min(1),
|
|
39029
|
+
title: z10.string().min(1),
|
|
39030
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
38724
39031
|
};
|
|
38725
|
-
var provenanceDocNodeSchema =
|
|
39032
|
+
var provenanceDocNodeSchema = z10.object({
|
|
38726
39033
|
...provenanceNodeBaseFields,
|
|
38727
|
-
kind:
|
|
38728
|
-
slug:
|
|
38729
|
-
docKind:
|
|
39034
|
+
kind: z10.literal("doc"),
|
|
39035
|
+
slug: z10.string().min(1),
|
|
39036
|
+
docKind: z10.string().min(1),
|
|
38730
39037
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
38731
|
-
publishedAt:
|
|
38732
|
-
supersededAt:
|
|
38733
|
-
summary:
|
|
39038
|
+
publishedAt: z10.string().min(1),
|
|
39039
|
+
supersededAt: z10.string().min(1).optional(),
|
|
39040
|
+
summary: z10.string().optional()
|
|
38734
39041
|
});
|
|
38735
|
-
var provenanceTaskNodeSchema =
|
|
39042
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
38736
39043
|
...provenanceNodeBaseFields,
|
|
38737
|
-
kind:
|
|
38738
|
-
taskType:
|
|
38739
|
-
status:
|
|
39044
|
+
kind: z10.literal("task"),
|
|
39045
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
39046
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
38740
39047
|
});
|
|
38741
|
-
var provenanceDecisionNodeSchema =
|
|
39048
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
38742
39049
|
...provenanceNodeBaseFields,
|
|
38743
|
-
kind:
|
|
38744
|
-
outcome:
|
|
38745
|
-
decidedAt:
|
|
39050
|
+
kind: z10.literal("decision"),
|
|
39051
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
39052
|
+
decidedAt: z10.string().min(1)
|
|
38746
39053
|
});
|
|
38747
|
-
var provenanceSessionNodeSchema =
|
|
39054
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
38748
39055
|
...provenanceNodeBaseFields,
|
|
38749
|
-
kind:
|
|
38750
|
-
startedAt:
|
|
38751
|
-
endedAt:
|
|
39056
|
+
kind: z10.literal("session"),
|
|
39057
|
+
startedAt: z10.string().min(1),
|
|
39058
|
+
endedAt: z10.string().min(1).optional()
|
|
38752
39059
|
});
|
|
38753
|
-
var provenanceMemoryNodeSchema =
|
|
39060
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
38754
39061
|
...provenanceNodeBaseFields,
|
|
38755
|
-
kind:
|
|
38756
|
-
memoryType:
|
|
38757
|
-
recordedAt:
|
|
39062
|
+
kind: z10.literal("memory"),
|
|
39063
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
39064
|
+
recordedAt: z10.string().min(1)
|
|
38758
39065
|
});
|
|
38759
|
-
var provenanceNodeSchema =
|
|
39066
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
38760
39067
|
provenanceDocNodeSchema,
|
|
38761
39068
|
provenanceTaskNodeSchema,
|
|
38762
39069
|
provenanceDecisionNodeSchema,
|
|
38763
39070
|
provenanceSessionNodeSchema,
|
|
38764
39071
|
provenanceMemoryNodeSchema
|
|
38765
39072
|
]);
|
|
38766
|
-
var provenanceEdgeSchema =
|
|
39073
|
+
var provenanceEdgeSchema = z10.object({
|
|
38767
39074
|
relation: provenanceEdgeRelationSchema,
|
|
38768
|
-
from:
|
|
39075
|
+
from: z10.string().min(1),
|
|
38769
39076
|
fromKind: provenanceNodeKindSchema,
|
|
38770
|
-
to:
|
|
39077
|
+
to: z10.string().min(1),
|
|
38771
39078
|
toKind: provenanceNodeKindSchema,
|
|
38772
|
-
addedAt:
|
|
38773
|
-
summary:
|
|
39079
|
+
addedAt: z10.string().min(1),
|
|
39080
|
+
summary: z10.string().optional()
|
|
38774
39081
|
});
|
|
38775
|
-
var docProvenanceResponseSchema =
|
|
38776
|
-
nodes:
|
|
38777
|
-
edges:
|
|
38778
|
-
totalNodes:
|
|
38779
|
-
totalEdges:
|
|
39082
|
+
var docProvenanceResponseSchema = z10.object({
|
|
39083
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
39084
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
39085
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
39086
|
+
totalEdges: z10.number().int().nonnegative()
|
|
38780
39087
|
});
|
|
38781
39088
|
|
|
38782
39089
|
// packages/contracts/src/docs/read.ts
|
|
38783
|
-
import { z as
|
|
38784
|
-
var docFrontmatterSchema =
|
|
38785
|
-
slug:
|
|
38786
|
-
kind:
|
|
38787
|
-
title:
|
|
38788
|
-
summary:
|
|
38789
|
-
lifecycleStatus:
|
|
38790
|
-
docVersion:
|
|
38791
|
-
ownerVersion:
|
|
38792
|
-
supersedes:
|
|
38793
|
-
supersededBy:
|
|
38794
|
-
topics:
|
|
38795
|
-
relatedTasks:
|
|
38796
|
-
sha256:
|
|
38797
|
-
createdAt:
|
|
38798
|
-
});
|
|
38799
|
-
var docBodySchema =
|
|
38800
|
-
encoding:
|
|
38801
|
-
text:
|
|
38802
|
-
base64:
|
|
38803
|
-
sizeBytes:
|
|
38804
|
-
mimeType:
|
|
38805
|
-
});
|
|
38806
|
-
var docReadResponseSchema =
|
|
39090
|
+
import { z as z11 } from "zod";
|
|
39091
|
+
var docFrontmatterSchema = z11.object({
|
|
39092
|
+
slug: z11.string(),
|
|
39093
|
+
kind: z11.string().nullable(),
|
|
39094
|
+
title: z11.string().nullable(),
|
|
39095
|
+
summary: z11.string().nullable(),
|
|
39096
|
+
lifecycleStatus: z11.string(),
|
|
39097
|
+
docVersion: z11.number().int(),
|
|
39098
|
+
ownerVersion: z11.string().nullable(),
|
|
39099
|
+
supersedes: z11.string().nullable(),
|
|
39100
|
+
supersededBy: z11.string().nullable(),
|
|
39101
|
+
topics: z11.array(z11.string()).readonly(),
|
|
39102
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
39103
|
+
sha256: z11.string(),
|
|
39104
|
+
createdAt: z11.string()
|
|
39105
|
+
});
|
|
39106
|
+
var docBodySchema = z11.object({
|
|
39107
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
39108
|
+
text: z11.string().optional(),
|
|
39109
|
+
base64: z11.string().optional(),
|
|
39110
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
39111
|
+
mimeType: z11.string().nullable()
|
|
39112
|
+
});
|
|
39113
|
+
var docReadResponseSchema = z11.object({
|
|
38807
39114
|
frontmatter: docFrontmatterSchema,
|
|
38808
39115
|
body: docBodySchema
|
|
38809
39116
|
});
|
|
@@ -38976,7 +39283,7 @@ function getErrorMessage(error48, fallback = "Unknown error") {
|
|
|
38976
39283
|
}
|
|
38977
39284
|
|
|
38978
39285
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
38979
|
-
import { z as
|
|
39286
|
+
import { z as z12 } from "zod";
|
|
38980
39287
|
var EVIDENCE_ATOM_KINDS = [
|
|
38981
39288
|
"commit",
|
|
38982
39289
|
"files",
|
|
@@ -38998,96 +39305,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
38998
39305
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
38999
39306
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
39000
39307
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
39001
|
-
var commitAtomSchema =
|
|
39002
|
-
kind:
|
|
39003
|
-
sha:
|
|
39004
|
-
});
|
|
39005
|
-
var filesAtomSchema =
|
|
39006
|
-
kind:
|
|
39007
|
-
paths:
|
|
39008
|
-
});
|
|
39009
|
-
var testRunAtomSchema =
|
|
39010
|
-
kind:
|
|
39011
|
-
path:
|
|
39012
|
-
});
|
|
39013
|
-
var qaRunAtomSchema =
|
|
39014
|
-
kind:
|
|
39015
|
-
path:
|
|
39016
|
-
});
|
|
39017
|
-
var toolAtomSchema =
|
|
39018
|
-
kind:
|
|
39019
|
-
tool:
|
|
39020
|
-
});
|
|
39021
|
-
var urlAtomSchema =
|
|
39022
|
-
kind:
|
|
39023
|
-
url:
|
|
39024
|
-
});
|
|
39025
|
-
var noteAtomSchema =
|
|
39026
|
-
kind:
|
|
39027
|
-
note:
|
|
39028
|
-
});
|
|
39029
|
-
var decisionAtomSchema =
|
|
39030
|
-
kind:
|
|
39031
|
-
decisionId:
|
|
39032
|
-
});
|
|
39033
|
-
var prAtomSchema =
|
|
39034
|
-
kind:
|
|
39035
|
-
prNumber:
|
|
39036
|
-
componentPrNumber:
|
|
39308
|
+
var commitAtomSchema = z12.object({
|
|
39309
|
+
kind: z12.literal("commit"),
|
|
39310
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
39311
|
+
});
|
|
39312
|
+
var filesAtomSchema = z12.object({
|
|
39313
|
+
kind: z12.literal("files"),
|
|
39314
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
39315
|
+
});
|
|
39316
|
+
var testRunAtomSchema = z12.object({
|
|
39317
|
+
kind: z12.literal("test-run"),
|
|
39318
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
39319
|
+
});
|
|
39320
|
+
var qaRunAtomSchema = z12.object({
|
|
39321
|
+
kind: z12.literal("qa-run"),
|
|
39322
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
39323
|
+
});
|
|
39324
|
+
var toolAtomSchema = z12.object({
|
|
39325
|
+
kind: z12.literal("tool"),
|
|
39326
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
39327
|
+
});
|
|
39328
|
+
var urlAtomSchema = z12.object({
|
|
39329
|
+
kind: z12.literal("url"),
|
|
39330
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
39331
|
+
});
|
|
39332
|
+
var noteAtomSchema = z12.object({
|
|
39333
|
+
kind: z12.literal("note"),
|
|
39334
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
39335
|
+
});
|
|
39336
|
+
var decisionAtomSchema = z12.object({
|
|
39337
|
+
kind: z12.literal("decision"),
|
|
39338
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
39339
|
+
});
|
|
39340
|
+
var prAtomSchema = z12.object({
|
|
39341
|
+
kind: z12.literal("pr"),
|
|
39342
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
39343
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
39037
39344
|
/**
|
|
39038
39345
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
39039
39346
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
39040
39347
|
* `origin`, since PR numbers are only unique per repository.
|
|
39041
39348
|
*/
|
|
39042
|
-
repo:
|
|
39349
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
39043
39350
|
});
|
|
39044
|
-
var ciAtomSchema =
|
|
39045
|
-
kind:
|
|
39046
|
-
prNumber:
|
|
39047
|
-
componentPrNumber:
|
|
39351
|
+
var ciAtomSchema = z12.object({
|
|
39352
|
+
kind: z12.literal("ci"),
|
|
39353
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
39354
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
39048
39355
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
39049
|
-
repo:
|
|
39356
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
39050
39357
|
});
|
|
39051
|
-
var ciRunAtomSchema =
|
|
39052
|
-
kind:
|
|
39053
|
-
runId:
|
|
39358
|
+
var ciRunAtomSchema = z12.object({
|
|
39359
|
+
kind: z12.literal("ci-run"),
|
|
39360
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
39054
39361
|
});
|
|
39055
|
-
var deployAtomSchema =
|
|
39056
|
-
kind:
|
|
39057
|
-
provider:
|
|
39058
|
-
deploymentId:
|
|
39059
|
-
sha:
|
|
39060
|
-
probeUrl:
|
|
39362
|
+
var deployAtomSchema = z12.object({
|
|
39363
|
+
kind: z12.literal("deploy"),
|
|
39364
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
39365
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
39366
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
39367
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
39061
39368
|
});
|
|
39062
|
-
var locDropAtomSchema =
|
|
39063
|
-
kind:
|
|
39064
|
-
fromLines:
|
|
39065
|
-
toLines:
|
|
39369
|
+
var locDropAtomSchema = z12.object({
|
|
39370
|
+
kind: z12.literal("loc-drop"),
|
|
39371
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
39372
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
39066
39373
|
});
|
|
39067
|
-
var callsiteCoverageAtomSchema =
|
|
39068
|
-
kind:
|
|
39069
|
-
symbolName:
|
|
39070
|
-
relativeSourcePath:
|
|
39374
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
39375
|
+
kind: z12.literal("callsite-coverage"),
|
|
39376
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
39377
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
39071
39378
|
});
|
|
39072
39379
|
var 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}$/;
|
|
39073
39380
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
39074
39381
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
39075
39382
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
39076
|
-
var satisfiesAtomSchema =
|
|
39077
|
-
kind:
|
|
39383
|
+
var satisfiesAtomSchema = z12.object({
|
|
39384
|
+
kind: z12.literal("satisfies"),
|
|
39078
39385
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
39079
|
-
targetTaskId:
|
|
39386
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
39080
39387
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
39081
|
-
targetAcId:
|
|
39388
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
39082
39389
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
39083
|
-
targetAcAlias:
|
|
39390
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
39084
39391
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
39085
|
-
versionPin:
|
|
39392
|
+
versionPin: z12.string().regex(
|
|
39086
39393
|
SATISFIES_VERSION_PIN_REGEX,
|
|
39087
39394
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
39088
39395
|
).optional()
|
|
39089
39396
|
});
|
|
39090
|
-
var EvidenceAtomSchema =
|
|
39397
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
39091
39398
|
commitAtomSchema,
|
|
39092
39399
|
filesAtomSchema,
|
|
39093
39400
|
testRunAtomSchema,
|
|
@@ -39149,54 +39456,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
39149
39456
|
});
|
|
39150
39457
|
|
|
39151
39458
|
// packages/contracts/src/evidence-record-schema.ts
|
|
39152
|
-
import { z as
|
|
39153
|
-
var evidenceBaseSchema =
|
|
39459
|
+
import { z as z13 } from "zod";
|
|
39460
|
+
var evidenceBaseSchema = z13.object({
|
|
39154
39461
|
/** Identity string of the agent that produced this record. */
|
|
39155
|
-
agentIdentity:
|
|
39462
|
+
agentIdentity: z13.string().min(1),
|
|
39156
39463
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
39157
|
-
attachmentSha256:
|
|
39464
|
+
attachmentSha256: z13.string().length(64),
|
|
39158
39465
|
/** ISO 8601 timestamp at which the action ran. */
|
|
39159
|
-
ranAt:
|
|
39466
|
+
ranAt: z13.string().datetime(),
|
|
39160
39467
|
/** Wall-clock duration of the action in milliseconds. */
|
|
39161
|
-
durationMs:
|
|
39468
|
+
durationMs: z13.number().nonnegative()
|
|
39162
39469
|
});
|
|
39163
39470
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
39164
|
-
kind:
|
|
39165
|
-
phase:
|
|
39166
|
-
filesChanged:
|
|
39167
|
-
linesAdded:
|
|
39168
|
-
linesRemoved:
|
|
39471
|
+
kind: z13.literal("impl-diff"),
|
|
39472
|
+
phase: z13.literal("implement"),
|
|
39473
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
39474
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
39475
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
39169
39476
|
});
|
|
39170
39477
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
39171
|
-
kind:
|
|
39172
|
-
phase:
|
|
39173
|
-
reqIdsChecked:
|
|
39174
|
-
passed:
|
|
39175
|
-
details:
|
|
39478
|
+
kind: z13.literal("validate-spec-check"),
|
|
39479
|
+
phase: z13.literal("validate"),
|
|
39480
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
39481
|
+
passed: z13.boolean(),
|
|
39482
|
+
details: z13.string().min(1)
|
|
39176
39483
|
});
|
|
39177
39484
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
39178
|
-
kind:
|
|
39179
|
-
phase:
|
|
39180
|
-
command:
|
|
39181
|
-
exitCode:
|
|
39182
|
-
testsPassed:
|
|
39183
|
-
testsFailed:
|
|
39485
|
+
kind: z13.literal("test-output"),
|
|
39486
|
+
phase: z13.literal("test"),
|
|
39487
|
+
command: z13.string().min(1),
|
|
39488
|
+
exitCode: z13.number().int(),
|
|
39489
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
39490
|
+
testsFailed: z13.number().int().nonnegative()
|
|
39184
39491
|
});
|
|
39185
39492
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
39186
|
-
kind:
|
|
39187
|
-
phase:
|
|
39188
|
-
tool:
|
|
39189
|
-
passed:
|
|
39190
|
-
warnings:
|
|
39191
|
-
errors:
|
|
39493
|
+
kind: z13.literal("lint-report"),
|
|
39494
|
+
phase: z13.enum(["implement", "test"]),
|
|
39495
|
+
tool: z13.string().min(1),
|
|
39496
|
+
passed: z13.boolean(),
|
|
39497
|
+
warnings: z13.number().int().nonnegative(),
|
|
39498
|
+
errors: z13.number().int().nonnegative()
|
|
39192
39499
|
});
|
|
39193
39500
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
39194
|
-
kind:
|
|
39195
|
-
phase:
|
|
39196
|
-
cmd:
|
|
39197
|
-
exitCode:
|
|
39501
|
+
kind: z13.literal("command-output"),
|
|
39502
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
39503
|
+
cmd: z13.string().min(1),
|
|
39504
|
+
exitCode: z13.number().int()
|
|
39198
39505
|
});
|
|
39199
|
-
var evidenceRecordSchema =
|
|
39506
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
39200
39507
|
implDiffRecordSchema,
|
|
39201
39508
|
validateSpecCheckRecordSchema,
|
|
39202
39509
|
testOutputRecordSchema,
|
|
@@ -40131,107 +40438,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
40131
40438
|
});
|
|
40132
40439
|
|
|
40133
40440
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
40134
|
-
import { z as
|
|
40135
|
-
var LeaseScopeSchema =
|
|
40136
|
-
var LeaseLaneSchema =
|
|
40137
|
-
var LeaseAcquireRequestSchema =
|
|
40441
|
+
import { z as z14 } from "zod";
|
|
40442
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
40443
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
40444
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
40138
40445
|
/** Tag discriminating this request variant. */
|
|
40139
|
-
kind:
|
|
40446
|
+
kind: z14.literal("lease_acquire"),
|
|
40140
40447
|
/** The cleo.db scope being arbitrated. */
|
|
40141
40448
|
scope: LeaseScopeSchema,
|
|
40142
40449
|
/** The write lane within the scope. */
|
|
40143
40450
|
lane: LeaseLaneSchema,
|
|
40144
40451
|
/** Process+lane holder identity. */
|
|
40145
|
-
holder_id:
|
|
40452
|
+
holder_id: z14.string().min(1),
|
|
40146
40453
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
40147
|
-
priority:
|
|
40454
|
+
priority: z14.number().int().min(0).max(255),
|
|
40148
40455
|
/** Lease time-to-live in milliseconds. */
|
|
40149
|
-
ttl_ms:
|
|
40456
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
40150
40457
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
40151
|
-
reentrant:
|
|
40458
|
+
reentrant: z14.boolean()
|
|
40152
40459
|
}).strict();
|
|
40153
|
-
var LeaseReleaseRequestSchema =
|
|
40460
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
40154
40461
|
/** Tag discriminating this request variant. */
|
|
40155
|
-
kind:
|
|
40462
|
+
kind: z14.literal("lease_release"),
|
|
40156
40463
|
/** The cleo.db scope being arbitrated. */
|
|
40157
40464
|
scope: LeaseScopeSchema,
|
|
40158
40465
|
/** The write lane within the scope. */
|
|
40159
40466
|
lane: LeaseLaneSchema,
|
|
40160
40467
|
/** Process+lane holder identity. */
|
|
40161
|
-
holder_id:
|
|
40468
|
+
holder_id: z14.string().min(1),
|
|
40162
40469
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
40163
|
-
epoch:
|
|
40470
|
+
epoch: z14.number().int().nonnegative()
|
|
40164
40471
|
}).strict();
|
|
40165
|
-
var LeaseRenewRequestSchema =
|
|
40472
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
40166
40473
|
/** Tag discriminating this request variant. */
|
|
40167
|
-
kind:
|
|
40474
|
+
kind: z14.literal("lease_renew"),
|
|
40168
40475
|
/** The cleo.db scope being arbitrated. */
|
|
40169
40476
|
scope: LeaseScopeSchema,
|
|
40170
40477
|
/** The write lane within the scope. */
|
|
40171
40478
|
lane: LeaseLaneSchema,
|
|
40172
40479
|
/** Process+lane holder identity. */
|
|
40173
|
-
holder_id:
|
|
40480
|
+
holder_id: z14.string().min(1),
|
|
40174
40481
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
40175
|
-
epoch:
|
|
40482
|
+
epoch: z14.number().int().nonnegative()
|
|
40176
40483
|
}).strict();
|
|
40177
|
-
var RateCheckRequestSchema =
|
|
40484
|
+
var RateCheckRequestSchema = z14.object({
|
|
40178
40485
|
/** Tag discriminating this request variant. */
|
|
40179
|
-
kind:
|
|
40486
|
+
kind: z14.literal("rate_check"),
|
|
40180
40487
|
/** The cleo.db scope being checked. */
|
|
40181
40488
|
scope: LeaseScopeSchema,
|
|
40182
40489
|
/** The write lane within the scope. */
|
|
40183
40490
|
lane: LeaseLaneSchema,
|
|
40184
40491
|
/** Estimated bytes the caller intends to write. */
|
|
40185
|
-
est_bytes:
|
|
40492
|
+
est_bytes: z14.number().int().nonnegative()
|
|
40186
40493
|
}).strict();
|
|
40187
|
-
var ToolGrantRequestSchema =
|
|
40494
|
+
var ToolGrantRequestSchema = z14.object({
|
|
40188
40495
|
/** Tag discriminating this request variant. */
|
|
40189
|
-
kind:
|
|
40496
|
+
kind: z14.literal("tool_grant"),
|
|
40190
40497
|
/** The tool name being requested. */
|
|
40191
|
-
tool:
|
|
40498
|
+
tool: z14.string().min(1),
|
|
40192
40499
|
/** The requesting holder identity. */
|
|
40193
|
-
holder_id:
|
|
40500
|
+
holder_id: z14.string().min(1)
|
|
40194
40501
|
}).strict();
|
|
40195
|
-
var QueuePriorityClassSchema =
|
|
40196
|
-
var QueueAdmitRequestSchema =
|
|
40502
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
40503
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
40197
40504
|
/** Tag discriminating this request variant. */
|
|
40198
|
-
kind:
|
|
40505
|
+
kind: z14.literal("queue_admit"),
|
|
40199
40506
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
40200
|
-
provider:
|
|
40507
|
+
provider: z14.string().min(1),
|
|
40201
40508
|
/** The caller's priority class (lead > worker > background). */
|
|
40202
40509
|
priority_class: QueuePriorityClassSchema,
|
|
40203
40510
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
40204
|
-
est_tokens:
|
|
40511
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
40205
40512
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
40206
|
-
child_id:
|
|
40513
|
+
child_id: z14.string().min(1)
|
|
40207
40514
|
}).strict();
|
|
40208
|
-
var WorkerHeartbeatRequestSchema =
|
|
40515
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
40209
40516
|
/** Tag discriminating this request variant. */
|
|
40210
|
-
kind:
|
|
40517
|
+
kind: z14.literal("worker_heartbeat"),
|
|
40211
40518
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
40212
|
-
child_id:
|
|
40519
|
+
child_id: z14.string().min(1),
|
|
40213
40520
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
40214
|
-
in_flight_llm:
|
|
40521
|
+
in_flight_llm: z14.boolean()
|
|
40215
40522
|
}).strict();
|
|
40216
|
-
var ResourceAdmitRequestSchema =
|
|
40523
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
40217
40524
|
/** Tag discriminating this request variant. */
|
|
40218
|
-
kind:
|
|
40525
|
+
kind: z14.literal("resource_admit"),
|
|
40219
40526
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
40220
|
-
class:
|
|
40527
|
+
class: z14.string().min(1),
|
|
40221
40528
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
40222
|
-
holder_id:
|
|
40529
|
+
holder_id: z14.string().min(1),
|
|
40223
40530
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
40224
|
-
budget:
|
|
40531
|
+
budget: z14.number().int().nonnegative()
|
|
40225
40532
|
}).strict();
|
|
40226
|
-
var ResourceReleaseRequestSchema =
|
|
40533
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
40227
40534
|
/** Tag discriminating this request variant. */
|
|
40228
|
-
kind:
|
|
40535
|
+
kind: z14.literal("resource_release"),
|
|
40229
40536
|
/** The resource class the slot belongs to. */
|
|
40230
|
-
class:
|
|
40537
|
+
class: z14.string().min(1),
|
|
40231
40538
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
40232
|
-
holder_id:
|
|
40539
|
+
holder_id: z14.string().min(1)
|
|
40233
40540
|
}).strict();
|
|
40234
|
-
var LeaseIpcRequestSchema =
|
|
40541
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
40235
40542
|
LeaseAcquireRequestSchema,
|
|
40236
40543
|
LeaseReleaseRequestSchema,
|
|
40237
40544
|
LeaseRenewRequestSchema,
|
|
@@ -40242,133 +40549,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
40242
40549
|
ResourceAdmitRequestSchema,
|
|
40243
40550
|
ResourceReleaseRequestSchema
|
|
40244
40551
|
]);
|
|
40245
|
-
var LeaseGrantedResponseSchema =
|
|
40552
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
40246
40553
|
/** Tag discriminating this response variant. */
|
|
40247
|
-
kind:
|
|
40554
|
+
kind: z14.literal("lease_granted"),
|
|
40248
40555
|
/** The granted cleo.db scope. */
|
|
40249
40556
|
scope: LeaseScopeSchema,
|
|
40250
40557
|
/** The granted write lane. */
|
|
40251
40558
|
lane: LeaseLaneSchema,
|
|
40252
40559
|
/** The holder the lease was granted to. */
|
|
40253
|
-
holder_id:
|
|
40560
|
+
holder_id: z14.string().min(1),
|
|
40254
40561
|
/** The monotonic epoch fence assigned to this grant. */
|
|
40255
|
-
epoch:
|
|
40562
|
+
epoch: z14.number().int().nonnegative(),
|
|
40256
40563
|
/** The lease TTL in milliseconds. */
|
|
40257
|
-
ttl_ms:
|
|
40564
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
40258
40565
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
40259
|
-
expires_at_ms:
|
|
40566
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
40260
40567
|
}).strict();
|
|
40261
|
-
var LeaseQueuedResponseSchema =
|
|
40568
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
40262
40569
|
/** Tag discriminating this response variant. */
|
|
40263
|
-
kind:
|
|
40570
|
+
kind: z14.literal("lease_queued"),
|
|
40264
40571
|
/** The queued cleo.db scope. */
|
|
40265
40572
|
scope: LeaseScopeSchema,
|
|
40266
40573
|
/** The queued write lane. */
|
|
40267
40574
|
lane: LeaseLaneSchema,
|
|
40268
40575
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
40269
|
-
ticket:
|
|
40576
|
+
ticket: z14.number().int().nonnegative(),
|
|
40270
40577
|
/** Number of waiters ahead of this one. */
|
|
40271
|
-
ahead:
|
|
40578
|
+
ahead: z14.number().int().nonnegative()
|
|
40272
40579
|
}).strict();
|
|
40273
|
-
var LeaseDeniedResponseSchema =
|
|
40580
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
40274
40581
|
/** Tag discriminating this response variant. */
|
|
40275
|
-
kind:
|
|
40582
|
+
kind: z14.literal("lease_denied"),
|
|
40276
40583
|
/** The denied cleo.db scope. */
|
|
40277
40584
|
scope: LeaseScopeSchema,
|
|
40278
40585
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
40279
|
-
code:
|
|
40586
|
+
code: z14.string().min(1),
|
|
40280
40587
|
/** Human-readable denial message. */
|
|
40281
|
-
message:
|
|
40588
|
+
message: z14.string()
|
|
40282
40589
|
}).strict();
|
|
40283
|
-
var RateResultResponseSchema =
|
|
40590
|
+
var RateResultResponseSchema = z14.object({
|
|
40284
40591
|
/** Tag discriminating this response variant. */
|
|
40285
|
-
kind:
|
|
40592
|
+
kind: z14.literal("rate_result"),
|
|
40286
40593
|
/** The checked cleo.db scope. */
|
|
40287
40594
|
scope: LeaseScopeSchema,
|
|
40288
40595
|
/** Whether the write is within budget. */
|
|
40289
|
-
ok:
|
|
40596
|
+
ok: z14.boolean(),
|
|
40290
40597
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
40291
|
-
retry_after_ms:
|
|
40598
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40292
40599
|
/** Remaining token budget for the scope. */
|
|
40293
|
-
tokens_remaining:
|
|
40600
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
40294
40601
|
}).strict();
|
|
40295
|
-
var ToolGrantedResponseSchema =
|
|
40602
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
40296
40603
|
/** Tag discriminating this response variant. */
|
|
40297
|
-
kind:
|
|
40604
|
+
kind: z14.literal("tool_granted"),
|
|
40298
40605
|
/** The granted tool name. */
|
|
40299
|
-
tool:
|
|
40606
|
+
tool: z14.string().min(1),
|
|
40300
40607
|
/** The holder the tool grant was issued to. */
|
|
40301
|
-
holder_id:
|
|
40608
|
+
holder_id: z14.string().min(1)
|
|
40302
40609
|
}).strict();
|
|
40303
|
-
var LeaseRevokedResponseSchema =
|
|
40610
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
40304
40611
|
/** Tag discriminating this response variant. */
|
|
40305
|
-
kind:
|
|
40612
|
+
kind: z14.literal("lease_revoked"),
|
|
40306
40613
|
/** The revoked cleo.db scope. */
|
|
40307
40614
|
scope: LeaseScopeSchema,
|
|
40308
40615
|
/** The revoked write lane. */
|
|
40309
40616
|
lane: LeaseLaneSchema,
|
|
40310
40617
|
/** The holder whose lease was revoked. */
|
|
40311
|
-
holder_id:
|
|
40618
|
+
holder_id: z14.string().min(1),
|
|
40312
40619
|
/** Human-readable reason for the revocation. */
|
|
40313
|
-
reason:
|
|
40620
|
+
reason: z14.string()
|
|
40314
40621
|
}).strict();
|
|
40315
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
40622
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
40316
40623
|
/** Tag discriminating this response variant. */
|
|
40317
|
-
kind:
|
|
40624
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
40318
40625
|
/** Logical id of the killed child. */
|
|
40319
|
-
child_id:
|
|
40626
|
+
child_id: z14.string().min(1),
|
|
40320
40627
|
/** The holder identity the killed child held the lease as. */
|
|
40321
|
-
holder_id:
|
|
40628
|
+
holder_id: z14.string().min(1),
|
|
40322
40629
|
/** The cleo.db scope the killed child held the lease in. */
|
|
40323
40630
|
scope: LeaseScopeSchema,
|
|
40324
40631
|
/** Human-readable reason for the kill. */
|
|
40325
|
-
reason:
|
|
40632
|
+
reason: z14.string()
|
|
40326
40633
|
}).strict();
|
|
40327
|
-
var QueueAdmitDispositionSchema =
|
|
40328
|
-
var QueueAdmitResultResponseSchema =
|
|
40634
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
40635
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
40329
40636
|
/** Tag discriminating this response variant. */
|
|
40330
|
-
kind:
|
|
40637
|
+
kind: z14.literal("queue_admit_result"),
|
|
40331
40638
|
/** Whether the LLM call was admitted or deferred. */
|
|
40332
40639
|
disposition: QueueAdmitDispositionSchema,
|
|
40333
40640
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
40334
|
-
retry_after_ms:
|
|
40641
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40335
40642
|
/** Remaining provider token budget after this decision. */
|
|
40336
|
-
tokens_remaining:
|
|
40643
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
40337
40644
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
40338
|
-
queue_position:
|
|
40645
|
+
queue_position: z14.number().int().nonnegative()
|
|
40339
40646
|
}).strict();
|
|
40340
|
-
var HeartbeatAckResponseSchema =
|
|
40647
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
40341
40648
|
/** Tag discriminating this response variant. */
|
|
40342
|
-
kind:
|
|
40649
|
+
kind: z14.literal("heartbeat_ack")
|
|
40343
40650
|
}).strict();
|
|
40344
|
-
var ResourceAdmitDispositionSchema =
|
|
40345
|
-
var ResourceAdmitResultResponseSchema =
|
|
40651
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
40652
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
40346
40653
|
/** Tag discriminating this response variant. */
|
|
40347
|
-
kind:
|
|
40654
|
+
kind: z14.literal("resource_admit_result"),
|
|
40348
40655
|
/** Whether the heavy op was admitted or deferred. */
|
|
40349
40656
|
disposition: ResourceAdmitDispositionSchema,
|
|
40350
40657
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
40351
|
-
retry_after_ms:
|
|
40658
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40352
40659
|
/** Remaining slots for the class after this decision. */
|
|
40353
|
-
slots_remaining:
|
|
40660
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
40354
40661
|
}).strict();
|
|
40355
|
-
var ResourceReleaseResultResponseSchema =
|
|
40662
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
40356
40663
|
/** Tag discriminating this response variant. */
|
|
40357
|
-
kind:
|
|
40664
|
+
kind: z14.literal("resource_release_result"),
|
|
40358
40665
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
40359
|
-
released:
|
|
40666
|
+
released: z14.boolean(),
|
|
40360
40667
|
/** Remaining in-flight holders for the class after the release. */
|
|
40361
|
-
slots_remaining:
|
|
40668
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
40362
40669
|
}).strict();
|
|
40363
|
-
var LeaseErrorResponseSchema =
|
|
40670
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
40364
40671
|
/** Tag discriminating this response variant. */
|
|
40365
|
-
kind:
|
|
40672
|
+
kind: z14.literal("error"),
|
|
40366
40673
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
40367
|
-
code:
|
|
40674
|
+
code: z14.string().min(1),
|
|
40368
40675
|
/** Human-readable error message. */
|
|
40369
|
-
message:
|
|
40676
|
+
message: z14.string()
|
|
40370
40677
|
}).strict();
|
|
40371
|
-
var LeaseIpcResponseSchema =
|
|
40678
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
40372
40679
|
LeaseGrantedResponseSchema,
|
|
40373
40680
|
LeaseQueuedResponseSchema,
|
|
40374
40681
|
LeaseDeniedResponseSchema,
|
|
@@ -40382,27 +40689,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
40382
40689
|
ResourceReleaseResultResponseSchema,
|
|
40383
40690
|
LeaseErrorResponseSchema
|
|
40384
40691
|
]);
|
|
40385
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
40692
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
40386
40693
|
/** Parallel protocol version. */
|
|
40387
|
-
protocol_version:
|
|
40694
|
+
protocol_version: z14.string(),
|
|
40388
40695
|
/** Correlation id echoed back on the matching response. */
|
|
40389
|
-
id:
|
|
40696
|
+
id: z14.string().min(1),
|
|
40390
40697
|
/** Direction discriminator. */
|
|
40391
|
-
direction:
|
|
40698
|
+
direction: z14.literal("request"),
|
|
40392
40699
|
/** The request body. */
|
|
40393
40700
|
request: LeaseIpcRequestSchema
|
|
40394
40701
|
}).strict();
|
|
40395
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
40702
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
40396
40703
|
/** Parallel protocol version. */
|
|
40397
|
-
protocol_version:
|
|
40704
|
+
protocol_version: z14.string(),
|
|
40398
40705
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
40399
|
-
id:
|
|
40706
|
+
id: z14.string().min(1),
|
|
40400
40707
|
/** Direction discriminator. */
|
|
40401
|
-
direction:
|
|
40708
|
+
direction: z14.literal("response"),
|
|
40402
40709
|
/** The response body. */
|
|
40403
40710
|
response: LeaseIpcResponseSchema
|
|
40404
40711
|
}).strict();
|
|
40405
|
-
var LeaseIpcEnvelopeSchema =
|
|
40712
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
40406
40713
|
LeaseIpcRequestEnvelopeSchema,
|
|
40407
40714
|
LeaseIpcResponseEnvelopeSchema
|
|
40408
40715
|
]);
|
|
@@ -40437,7 +40744,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
40437
40744
|
];
|
|
40438
40745
|
|
|
40439
40746
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
40440
|
-
import { z as
|
|
40747
|
+
import { z as z15 } from "zod";
|
|
40441
40748
|
var CATALOG_MODEL_STATUSES = [
|
|
40442
40749
|
"stable",
|
|
40443
40750
|
"beta",
|
|
@@ -40446,78 +40753,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
40446
40753
|
"retired"
|
|
40447
40754
|
];
|
|
40448
40755
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
40449
|
-
var isoDate =
|
|
40450
|
-
var semver =
|
|
40451
|
-
var catalogModalitiesSchema =
|
|
40452
|
-
input:
|
|
40453
|
-
output:
|
|
40756
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
40757
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
40758
|
+
var catalogModalitiesSchema = z15.object({
|
|
40759
|
+
input: z15.array(z15.string()),
|
|
40760
|
+
output: z15.array(z15.string())
|
|
40454
40761
|
}).strict();
|
|
40455
|
-
var catalogCostSchema =
|
|
40456
|
-
input:
|
|
40457
|
-
output:
|
|
40458
|
-
cache_read:
|
|
40459
|
-
cache_write:
|
|
40460
|
-
context_over_200k:
|
|
40762
|
+
var catalogCostSchema = z15.object({
|
|
40763
|
+
input: z15.number().optional(),
|
|
40764
|
+
output: z15.number().optional(),
|
|
40765
|
+
cache_read: z15.number().optional(),
|
|
40766
|
+
cache_write: z15.number().optional(),
|
|
40767
|
+
context_over_200k: z15.number().optional()
|
|
40461
40768
|
}).strict();
|
|
40462
|
-
var catalogLimitSchema =
|
|
40463
|
-
context:
|
|
40464
|
-
output:
|
|
40769
|
+
var catalogLimitSchema = z15.object({
|
|
40770
|
+
context: z15.number(),
|
|
40771
|
+
output: z15.number()
|
|
40465
40772
|
}).strict();
|
|
40466
|
-
var catalogModelProviderSchema =
|
|
40467
|
-
npm:
|
|
40468
|
-
api:
|
|
40773
|
+
var catalogModelProviderSchema = z15.object({
|
|
40774
|
+
npm: z15.string(),
|
|
40775
|
+
api: z15.string()
|
|
40469
40776
|
}).strict();
|
|
40470
|
-
var catalogModelEntrySchema =
|
|
40471
|
-
id:
|
|
40472
|
-
name:
|
|
40473
|
-
family:
|
|
40474
|
-
attachment:
|
|
40475
|
-
reasoning:
|
|
40476
|
-
temperature:
|
|
40477
|
-
interleaved:
|
|
40478
|
-
tool_call:
|
|
40777
|
+
var catalogModelEntrySchema = z15.object({
|
|
40778
|
+
id: z15.string(),
|
|
40779
|
+
name: z15.string(),
|
|
40780
|
+
family: z15.string(),
|
|
40781
|
+
attachment: z15.boolean(),
|
|
40782
|
+
reasoning: z15.boolean(),
|
|
40783
|
+
temperature: z15.boolean(),
|
|
40784
|
+
interleaved: z15.boolean(),
|
|
40785
|
+
tool_call: z15.boolean(),
|
|
40479
40786
|
modalities: catalogModalitiesSchema,
|
|
40480
40787
|
cost: catalogCostSchema,
|
|
40481
40788
|
limit: catalogLimitSchema,
|
|
40482
|
-
status:
|
|
40789
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
40483
40790
|
release_date: isoDate,
|
|
40484
40791
|
provider: catalogModelProviderSchema
|
|
40485
40792
|
}).strict();
|
|
40486
|
-
var catalogProviderSchema =
|
|
40487
|
-
id:
|
|
40488
|
-
endpoint:
|
|
40489
|
-
authTypes:
|
|
40490
|
-
npm:
|
|
40793
|
+
var catalogProviderSchema = z15.object({
|
|
40794
|
+
id: z15.string(),
|
|
40795
|
+
endpoint: z15.string(),
|
|
40796
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
40797
|
+
npm: z15.string().optional()
|
|
40491
40798
|
}).strict();
|
|
40492
|
-
var curatedCatalogSchema =
|
|
40493
|
-
$schema:
|
|
40799
|
+
var curatedCatalogSchema = z15.object({
|
|
40800
|
+
$schema: z15.string().optional(),
|
|
40494
40801
|
version: semver,
|
|
40495
40802
|
lastUpdated: isoDate,
|
|
40496
|
-
providers:
|
|
40497
|
-
models:
|
|
40803
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
40804
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
40498
40805
|
}).strict();
|
|
40499
|
-
var modelsCatalogRowInsertSchema =
|
|
40500
|
-
id:
|
|
40501
|
-
providerId:
|
|
40502
|
-
name:
|
|
40503
|
-
family:
|
|
40504
|
-
attachment:
|
|
40505
|
-
reasoning:
|
|
40506
|
-
temperature:
|
|
40507
|
-
interleaved:
|
|
40508
|
-
toolCall:
|
|
40509
|
-
modalities:
|
|
40510
|
-
cost:
|
|
40511
|
-
contextLimit:
|
|
40512
|
-
outputLimit:
|
|
40513
|
-
status:
|
|
40806
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
40807
|
+
id: z15.string(),
|
|
40808
|
+
providerId: z15.string(),
|
|
40809
|
+
name: z15.string(),
|
|
40810
|
+
family: z15.string(),
|
|
40811
|
+
attachment: z15.boolean(),
|
|
40812
|
+
reasoning: z15.boolean(),
|
|
40813
|
+
temperature: z15.boolean(),
|
|
40814
|
+
interleaved: z15.boolean(),
|
|
40815
|
+
toolCall: z15.boolean(),
|
|
40816
|
+
modalities: z15.string(),
|
|
40817
|
+
cost: z15.string(),
|
|
40818
|
+
contextLimit: z15.number().nullable().optional(),
|
|
40819
|
+
outputLimit: z15.number().nullable().optional(),
|
|
40820
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
40514
40821
|
releaseDate: isoDate,
|
|
40515
|
-
modelsDevId:
|
|
40516
|
-
source:
|
|
40517
|
-
seededAt:
|
|
40822
|
+
modelsDevId: z15.string(),
|
|
40823
|
+
source: z15.string(),
|
|
40824
|
+
seededAt: z15.string().optional()
|
|
40518
40825
|
}).strict();
|
|
40519
40826
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
40520
|
-
seededAt:
|
|
40827
|
+
seededAt: z15.string()
|
|
40521
40828
|
});
|
|
40522
40829
|
|
|
40523
40830
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -40565,7 +40872,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
40565
40872
|
];
|
|
40566
40873
|
|
|
40567
40874
|
// packages/contracts/src/workgraph.ts
|
|
40568
|
-
import { z as
|
|
40875
|
+
import { z as z16 } from "zod";
|
|
40569
40876
|
|
|
40570
40877
|
// packages/contracts/src/status-registry.ts
|
|
40571
40878
|
var TASK_STATUSES = [
|
|
@@ -40580,10 +40887,10 @@ var TASK_STATUSES = [
|
|
|
40580
40887
|
|
|
40581
40888
|
// packages/contracts/src/workgraph.ts
|
|
40582
40889
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
40583
|
-
var taskTypeSchema =
|
|
40584
|
-
var taskPrioritySchema =
|
|
40585
|
-
var taskStatusSchema =
|
|
40586
|
-
var verificationGateSchema =
|
|
40890
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
40891
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
40892
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
40893
|
+
var verificationGateSchema = z16.enum([
|
|
40587
40894
|
"implemented",
|
|
40588
40895
|
"testsPassed",
|
|
40589
40896
|
"qaPassed",
|
|
@@ -40592,7 +40899,7 @@ var verificationGateSchema = z15.enum([
|
|
|
40592
40899
|
"documented",
|
|
40593
40900
|
"nexusImpact"
|
|
40594
40901
|
]);
|
|
40595
|
-
var workGraphRelationKindSchema =
|
|
40902
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
40596
40903
|
"contains",
|
|
40597
40904
|
"depends_on",
|
|
40598
40905
|
"blocks",
|
|
@@ -40600,317 +40907,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
40600
40907
|
"groups",
|
|
40601
40908
|
"satisfies"
|
|
40602
40909
|
]);
|
|
40603
|
-
var workGraphTraversalDirectionSchema =
|
|
40910
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
40604
40911
|
"ancestors",
|
|
40605
40912
|
"descendants",
|
|
40606
40913
|
"upstream",
|
|
40607
40914
|
"downstream"
|
|
40608
40915
|
]);
|
|
40609
|
-
var workGraphEdgeDirectionSchema =
|
|
40610
|
-
var paginationParamsSchema =
|
|
40611
|
-
cursor:
|
|
40612
|
-
limit:
|
|
40916
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
40917
|
+
var paginationParamsSchema = z16.object({
|
|
40918
|
+
cursor: z16.string().min(1).optional(),
|
|
40919
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
40613
40920
|
});
|
|
40614
|
-
var workGraphNodeSchema =
|
|
40615
|
-
id:
|
|
40921
|
+
var workGraphNodeSchema = z16.object({
|
|
40922
|
+
id: z16.string().min(1),
|
|
40616
40923
|
type: taskTypeSchema,
|
|
40617
|
-
title:
|
|
40924
|
+
title: z16.string(),
|
|
40618
40925
|
status: taskStatusSchema,
|
|
40619
40926
|
priority: taskPrioritySchema,
|
|
40620
|
-
parentId:
|
|
40927
|
+
parentId: z16.string().min(1).optional()
|
|
40621
40928
|
});
|
|
40622
|
-
var workGraphEdgeSchema =
|
|
40623
|
-
fromId:
|
|
40624
|
-
toId:
|
|
40929
|
+
var workGraphEdgeSchema = z16.object({
|
|
40930
|
+
fromId: z16.string().min(1),
|
|
40931
|
+
toId: z16.string().min(1),
|
|
40625
40932
|
kind: workGraphRelationKindSchema
|
|
40626
40933
|
});
|
|
40627
|
-
var workGraphHierarchyEdgeSchema =
|
|
40628
|
-
fromId:
|
|
40629
|
-
toId:
|
|
40630
|
-
kind:
|
|
40934
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
40935
|
+
fromId: z16.string().min(1),
|
|
40936
|
+
toId: z16.string().min(1),
|
|
40937
|
+
kind: z16.literal("contains")
|
|
40631
40938
|
}).strict();
|
|
40632
|
-
var workGraphPageInfoSchema =
|
|
40633
|
-
nextCursor:
|
|
40634
|
-
hasMore:
|
|
40635
|
-
});
|
|
40636
|
-
var workGraphRollupCountsSchema =
|
|
40637
|
-
total:
|
|
40638
|
-
byStatus:
|
|
40639
|
-
byType:
|
|
40640
|
-
});
|
|
40641
|
-
var workGraphSubtreePercentagesSchema =
|
|
40642
|
-
done:
|
|
40643
|
-
active:
|
|
40644
|
-
blocked:
|
|
40645
|
-
pending:
|
|
40646
|
-
cancelled:
|
|
40647
|
-
});
|
|
40648
|
-
var workGraphProjectionMismatchSchema =
|
|
40649
|
-
field:
|
|
40650
|
-
expected:
|
|
40651
|
-
actual:
|
|
40939
|
+
var workGraphPageInfoSchema = z16.object({
|
|
40940
|
+
nextCursor: z16.string().min(1).optional(),
|
|
40941
|
+
hasMore: z16.boolean()
|
|
40942
|
+
});
|
|
40943
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
40944
|
+
total: z16.number().int().nonnegative(),
|
|
40945
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
40946
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
40947
|
+
});
|
|
40948
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
40949
|
+
done: z16.number().nonnegative(),
|
|
40950
|
+
active: z16.number().nonnegative(),
|
|
40951
|
+
blocked: z16.number().nonnegative(),
|
|
40952
|
+
pending: z16.number().nonnegative(),
|
|
40953
|
+
cancelled: z16.number().nonnegative()
|
|
40954
|
+
});
|
|
40955
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
40956
|
+
field: z16.string().min(1),
|
|
40957
|
+
expected: z16.number().int().nonnegative(),
|
|
40958
|
+
actual: z16.number().int().nonnegative()
|
|
40652
40959
|
});
|
|
40653
40960
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
40654
|
-
role:
|
|
40655
|
-
dependencyBlockers:
|
|
40656
|
-
gateBlockers:
|
|
40961
|
+
role: z16.string().min(1).optional(),
|
|
40962
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
40963
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
40657
40964
|
});
|
|
40658
40965
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
40659
|
-
source:
|
|
40660
|
-
relationType:
|
|
40661
|
-
reason:
|
|
40966
|
+
source: z16.literal("relation"),
|
|
40967
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
40968
|
+
reason: z16.string().min(1).optional()
|
|
40662
40969
|
});
|
|
40663
40970
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
40664
|
-
source:
|
|
40665
|
-
kind:
|
|
40971
|
+
source: z16.literal("dependency"),
|
|
40972
|
+
kind: z16.literal("depends_on")
|
|
40666
40973
|
});
|
|
40667
|
-
var workGraphOmissionReasonSchema =
|
|
40974
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
40668
40975
|
"budget_exceeded",
|
|
40669
40976
|
"not_requested",
|
|
40670
40977
|
"not_available",
|
|
40671
40978
|
"redacted",
|
|
40672
40979
|
"truncated"
|
|
40673
40980
|
]);
|
|
40674
|
-
var workGraphContextBudgetSchema =
|
|
40675
|
-
tokenBudget:
|
|
40676
|
-
estimatedTokens:
|
|
40677
|
-
remainingTokens:
|
|
40678
|
-
truncated:
|
|
40679
|
-
});
|
|
40680
|
-
var workGraphOmissionSchema =
|
|
40681
|
-
path:
|
|
40981
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
40982
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
40983
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
40984
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
40985
|
+
truncated: z16.boolean()
|
|
40986
|
+
});
|
|
40987
|
+
var workGraphOmissionSchema = z16.object({
|
|
40988
|
+
path: z16.string().min(1),
|
|
40682
40989
|
reason: workGraphOmissionReasonSchema,
|
|
40683
|
-
message:
|
|
40684
|
-
estimatedTokens:
|
|
40990
|
+
message: z16.string().min(1),
|
|
40991
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
40685
40992
|
});
|
|
40686
|
-
var workGraphDirectEdgeSchema =
|
|
40993
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
40687
40994
|
workGraphRelationEdgeSchema,
|
|
40688
40995
|
workGraphDependencyEdgeSchema
|
|
40689
40996
|
]);
|
|
40690
40997
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
40691
|
-
rootId:
|
|
40692
|
-
tokenBudget:
|
|
40693
|
-
includeRelations:
|
|
40694
|
-
includeReadiness:
|
|
40695
|
-
includeRollup:
|
|
40998
|
+
rootId: z16.string().min(1),
|
|
40999
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
41000
|
+
includeRelations: z16.boolean().optional(),
|
|
41001
|
+
includeReadiness: z16.boolean().optional(),
|
|
41002
|
+
includeRollup: z16.boolean().optional()
|
|
40696
41003
|
});
|
|
40697
41004
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
40698
|
-
rootId:
|
|
41005
|
+
rootId: z16.string().min(1),
|
|
40699
41006
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
40700
|
-
maxDepth:
|
|
40701
|
-
includeRelations:
|
|
41007
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41008
|
+
includeRelations: z16.boolean().optional()
|
|
40702
41009
|
});
|
|
40703
|
-
var workGraphSliceSchema =
|
|
40704
|
-
rootId:
|
|
41010
|
+
var workGraphSliceSchema = z16.object({
|
|
41011
|
+
rootId: z16.string().min(1),
|
|
40705
41012
|
direction: workGraphTraversalDirectionSchema,
|
|
40706
|
-
nodes:
|
|
40707
|
-
edges:
|
|
41013
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
41014
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
40708
41015
|
pageInfo: workGraphPageInfoSchema,
|
|
40709
|
-
omissions:
|
|
40710
|
-
});
|
|
40711
|
-
var workGraphReadinessParamsSchema =
|
|
40712
|
-
rootId:
|
|
40713
|
-
role:
|
|
40714
|
-
includeGateBlockers:
|
|
40715
|
-
});
|
|
40716
|
-
var workGraphReadinessResultSchema =
|
|
40717
|
-
rootId:
|
|
40718
|
-
role:
|
|
40719
|
-
ready:
|
|
40720
|
-
warnings:
|
|
40721
|
-
groups:
|
|
40722
|
-
ready:
|
|
40723
|
-
blocked:
|
|
40724
|
-
blockedBy:
|
|
40725
|
-
|
|
40726
|
-
|
|
40727
|
-
kind:
|
|
40728
|
-
blockerId:
|
|
40729
|
-
blocks:
|
|
41016
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
41017
|
+
});
|
|
41018
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
41019
|
+
rootId: z16.string().min(1),
|
|
41020
|
+
role: z16.string().min(1).optional(),
|
|
41021
|
+
includeGateBlockers: z16.boolean().optional()
|
|
41022
|
+
});
|
|
41023
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
41024
|
+
rootId: z16.string().min(1),
|
|
41025
|
+
role: z16.string().min(1).optional(),
|
|
41026
|
+
ready: z16.boolean(),
|
|
41027
|
+
warnings: z16.array(z16.string()),
|
|
41028
|
+
groups: z16.object({
|
|
41029
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41030
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41031
|
+
blockedBy: z16.array(
|
|
41032
|
+
z16.discriminatedUnion("kind", [
|
|
41033
|
+
z16.object({
|
|
41034
|
+
kind: z16.literal("dependency"),
|
|
41035
|
+
blockerId: z16.string().min(1),
|
|
41036
|
+
blocks: z16.array(z16.string().min(1))
|
|
40730
41037
|
}),
|
|
40731
|
-
|
|
40732
|
-
kind:
|
|
41038
|
+
z16.object({
|
|
41039
|
+
kind: z16.literal("gate"),
|
|
40733
41040
|
gate: verificationGateSchema,
|
|
40734
|
-
blocks:
|
|
41041
|
+
blocks: z16.array(z16.string().min(1))
|
|
40735
41042
|
})
|
|
40736
41043
|
])
|
|
40737
41044
|
)
|
|
40738
41045
|
})
|
|
40739
41046
|
});
|
|
40740
|
-
var workGraphContextPackSchema =
|
|
40741
|
-
rootId:
|
|
40742
|
-
generatedAt:
|
|
41047
|
+
var workGraphContextPackSchema = z16.object({
|
|
41048
|
+
rootId: z16.string().min(1),
|
|
41049
|
+
generatedAt: z16.string().min(1),
|
|
40743
41050
|
budget: workGraphContextBudgetSchema,
|
|
40744
41051
|
slice: workGraphSliceSchema,
|
|
40745
|
-
relationEdges:
|
|
40746
|
-
rootId:
|
|
41052
|
+
relationEdges: z16.object({
|
|
41053
|
+
rootId: z16.string().min(1),
|
|
40747
41054
|
direction: workGraphEdgeDirectionSchema,
|
|
40748
|
-
edges:
|
|
41055
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
40749
41056
|
}).optional(),
|
|
40750
41057
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
40751
|
-
rollup:
|
|
40752
|
-
omissions:
|
|
40753
|
-
});
|
|
40754
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
40755
|
-
rootId:
|
|
40756
|
-
nodes:
|
|
40757
|
-
|
|
40758
|
-
id:
|
|
41058
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
41059
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
41060
|
+
});
|
|
41061
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
41062
|
+
rootId: z16.string().min(1),
|
|
41063
|
+
nodes: z16.array(
|
|
41064
|
+
z16.object({
|
|
41065
|
+
id: z16.string().min(1),
|
|
40759
41066
|
type: taskTypeSchema,
|
|
40760
|
-
parentId:
|
|
41067
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
40761
41068
|
})
|
|
40762
41069
|
),
|
|
40763
|
-
edges:
|
|
40764
|
-
dryRun:
|
|
40765
|
-
});
|
|
40766
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
40767
|
-
code:
|
|
40768
|
-
message:
|
|
40769
|
-
taskId:
|
|
40770
|
-
severity:
|
|
40771
|
-
});
|
|
40772
|
-
var workGraphScaffoldValidateResultSchema =
|
|
40773
|
-
rootId:
|
|
40774
|
-
valid:
|
|
40775
|
-
dryRun:
|
|
40776
|
-
issues:
|
|
40777
|
-
hierarchy:
|
|
40778
|
-
valid:
|
|
40779
|
-
violations:
|
|
40780
|
-
|
|
40781
|
-
code:
|
|
40782
|
-
taskId:
|
|
41070
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
41071
|
+
dryRun: z16.boolean().optional()
|
|
41072
|
+
});
|
|
41073
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
41074
|
+
code: z16.string().min(1),
|
|
41075
|
+
message: z16.string().min(1),
|
|
41076
|
+
taskId: z16.string().min(1).optional(),
|
|
41077
|
+
severity: z16.enum(["error", "warning"])
|
|
41078
|
+
});
|
|
41079
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
41080
|
+
rootId: z16.string().min(1),
|
|
41081
|
+
valid: z16.boolean(),
|
|
41082
|
+
dryRun: z16.boolean(),
|
|
41083
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
41084
|
+
hierarchy: z16.object({
|
|
41085
|
+
valid: z16.boolean(),
|
|
41086
|
+
violations: z16.array(
|
|
41087
|
+
z16.object({
|
|
41088
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
41089
|
+
taskId: z16.string().min(1),
|
|
40783
41090
|
taskType: taskTypeSchema,
|
|
40784
|
-
parentId:
|
|
41091
|
+
parentId: z16.string().min(1).nullable(),
|
|
40785
41092
|
parentType: taskTypeSchema.optional(),
|
|
40786
|
-
message:
|
|
41093
|
+
message: z16.string().min(1)
|
|
40787
41094
|
})
|
|
40788
41095
|
)
|
|
40789
41096
|
})
|
|
40790
41097
|
});
|
|
40791
41098
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
40792
|
-
apply:
|
|
41099
|
+
apply: z16.boolean().optional()
|
|
40793
41100
|
});
|
|
40794
41101
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
40795
|
-
applied:
|
|
40796
|
-
nodesChanged:
|
|
40797
|
-
edgesChanged:
|
|
40798
|
-
});
|
|
40799
|
-
var workGraphPlanningDocParamsSchema =
|
|
40800
|
-
rootId:
|
|
40801
|
-
audience:
|
|
40802
|
-
tokenBudget:
|
|
40803
|
-
includeRelations:
|
|
40804
|
-
includeReadiness:
|
|
40805
|
-
includeRollup:
|
|
40806
|
-
});
|
|
40807
|
-
var workGraphPlanningDocSchema =
|
|
40808
|
-
rootId:
|
|
40809
|
-
generatedAt:
|
|
40810
|
-
audience:
|
|
40811
|
-
title:
|
|
40812
|
-
content:
|
|
40813
|
-
sections:
|
|
40814
|
-
estimatedTokens:
|
|
40815
|
-
budget:
|
|
40816
|
-
tokenBudget:
|
|
40817
|
-
truncated:
|
|
41102
|
+
applied: z16.boolean(),
|
|
41103
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
41104
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
41105
|
+
});
|
|
41106
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
41107
|
+
rootId: z16.string().min(1),
|
|
41108
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
41109
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
41110
|
+
includeRelations: z16.boolean().optional(),
|
|
41111
|
+
includeReadiness: z16.boolean().optional(),
|
|
41112
|
+
includeRollup: z16.boolean().optional()
|
|
41113
|
+
});
|
|
41114
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
41115
|
+
rootId: z16.string().min(1),
|
|
41116
|
+
generatedAt: z16.string().min(1),
|
|
41117
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
41118
|
+
title: z16.string().min(1),
|
|
41119
|
+
content: z16.string(),
|
|
41120
|
+
sections: z16.array(z16.string().min(1)),
|
|
41121
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
41122
|
+
budget: z16.object({
|
|
41123
|
+
tokenBudget: z16.number().int().positive(),
|
|
41124
|
+
truncated: z16.boolean()
|
|
40818
41125
|
}).optional()
|
|
40819
41126
|
});
|
|
40820
41127
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
40821
|
-
rootId:
|
|
41128
|
+
rootId: z16.string().min(1),
|
|
40822
41129
|
direction: workGraphTraversalDirectionSchema,
|
|
40823
|
-
maxDepth:
|
|
40824
|
-
includeRelations:
|
|
41130
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41131
|
+
includeRelations: z16.boolean().optional()
|
|
40825
41132
|
});
|
|
40826
|
-
var tasksTraverseResultSchema =
|
|
40827
|
-
rootId:
|
|
41133
|
+
var tasksTraverseResultSchema = z16.object({
|
|
41134
|
+
rootId: z16.string().min(1),
|
|
40828
41135
|
direction: workGraphTraversalDirectionSchema,
|
|
40829
|
-
nodes:
|
|
40830
|
-
edges:
|
|
41136
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
41137
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
40831
41138
|
pageInfo: workGraphPageInfoSchema
|
|
40832
41139
|
});
|
|
40833
41140
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
40834
|
-
rootId:
|
|
40835
|
-
maxDepth:
|
|
41141
|
+
rootId: z16.string().min(1),
|
|
41142
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
40836
41143
|
});
|
|
40837
|
-
var tasksTreeResultSchema =
|
|
40838
|
-
rootId:
|
|
40839
|
-
nodes:
|
|
40840
|
-
edges:
|
|
41144
|
+
var tasksTreeResultSchema = z16.object({
|
|
41145
|
+
rootId: z16.string().min(1),
|
|
41146
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
41147
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
40841
41148
|
pageInfo: workGraphPageInfoSchema
|
|
40842
41149
|
});
|
|
40843
|
-
var tasksRollupParamsSchema =
|
|
40844
|
-
rootId:
|
|
41150
|
+
var tasksRollupParamsSchema = z16.object({
|
|
41151
|
+
rootId: z16.string().min(1),
|
|
40845
41152
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
40846
41153
|
});
|
|
40847
|
-
var tasksRollupResultSchema =
|
|
40848
|
-
rootId:
|
|
41154
|
+
var tasksRollupResultSchema = z16.object({
|
|
41155
|
+
rootId: z16.string().min(1),
|
|
40849
41156
|
direct: workGraphRollupCountsSchema,
|
|
40850
41157
|
subtree: workGraphRollupCountsSchema,
|
|
40851
|
-
percentDenominator:
|
|
40852
|
-
basis:
|
|
40853
|
-
total:
|
|
40854
|
-
description:
|
|
41158
|
+
percentDenominator: z16.object({
|
|
41159
|
+
basis: z16.literal("subtree-total"),
|
|
41160
|
+
total: z16.number().int().nonnegative(),
|
|
41161
|
+
description: z16.string().min(1)
|
|
40855
41162
|
}),
|
|
40856
41163
|
percentages: workGraphSubtreePercentagesSchema,
|
|
40857
|
-
staleProjection:
|
|
40858
|
-
projectionMismatches:
|
|
40859
|
-
});
|
|
40860
|
-
var tasksFrontierParamsSchema =
|
|
40861
|
-
rootId:
|
|
40862
|
-
role:
|
|
40863
|
-
});
|
|
40864
|
-
var tasksFrontierResultSchema =
|
|
40865
|
-
rootId:
|
|
40866
|
-
role:
|
|
40867
|
-
groups:
|
|
40868
|
-
ready:
|
|
40869
|
-
blocked:
|
|
40870
|
-
blockedBy:
|
|
40871
|
-
|
|
40872
|
-
|
|
40873
|
-
kind:
|
|
40874
|
-
blockerId:
|
|
40875
|
-
blocks:
|
|
41164
|
+
staleProjection: z16.boolean(),
|
|
41165
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
41166
|
+
});
|
|
41167
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
41168
|
+
rootId: z16.string().min(1),
|
|
41169
|
+
role: z16.string().min(1).optional()
|
|
41170
|
+
});
|
|
41171
|
+
var tasksFrontierResultSchema = z16.object({
|
|
41172
|
+
rootId: z16.string().min(1),
|
|
41173
|
+
role: z16.string().min(1).optional(),
|
|
41174
|
+
groups: z16.object({
|
|
41175
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41176
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41177
|
+
blockedBy: z16.array(
|
|
41178
|
+
z16.discriminatedUnion("kind", [
|
|
41179
|
+
z16.object({
|
|
41180
|
+
kind: z16.literal("dependency"),
|
|
41181
|
+
blockerId: z16.string().min(1),
|
|
41182
|
+
blocks: z16.array(z16.string().min(1))
|
|
40876
41183
|
}),
|
|
40877
|
-
|
|
40878
|
-
kind:
|
|
41184
|
+
z16.object({
|
|
41185
|
+
kind: z16.literal("gate"),
|
|
40879
41186
|
gate: verificationGateSchema,
|
|
40880
|
-
blocks:
|
|
41187
|
+
blocks: z16.array(z16.string().min(1))
|
|
40881
41188
|
})
|
|
40882
41189
|
])
|
|
40883
41190
|
)
|
|
40884
41191
|
})
|
|
40885
41192
|
});
|
|
40886
41193
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
40887
|
-
rootId:
|
|
40888
|
-
maxDepth:
|
|
40889
|
-
includeRelations:
|
|
40890
|
-
});
|
|
40891
|
-
var tasksWorkGraphAuditResultSchema =
|
|
40892
|
-
rootId:
|
|
40893
|
-
hierarchy:
|
|
40894
|
-
valid:
|
|
40895
|
-
violations:
|
|
40896
|
-
|
|
40897
|
-
code:
|
|
40898
|
-
taskId:
|
|
41194
|
+
rootId: z16.string().min(1),
|
|
41195
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41196
|
+
includeRelations: z16.boolean().optional()
|
|
41197
|
+
});
|
|
41198
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
41199
|
+
rootId: z16.string().min(1),
|
|
41200
|
+
hierarchy: z16.object({
|
|
41201
|
+
valid: z16.boolean(),
|
|
41202
|
+
violations: z16.array(
|
|
41203
|
+
z16.object({
|
|
41204
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
41205
|
+
taskId: z16.string().min(1),
|
|
40899
41206
|
taskType: taskTypeSchema,
|
|
40900
|
-
parentId:
|
|
41207
|
+
parentId: z16.string().min(1).nullable(),
|
|
40901
41208
|
parentType: taskTypeSchema.optional(),
|
|
40902
|
-
message:
|
|
41209
|
+
message: z16.string().min(1)
|
|
40903
41210
|
})
|
|
40904
41211
|
)
|
|
40905
41212
|
}),
|
|
40906
41213
|
traversal: tasksTraverseResultSchema,
|
|
40907
41214
|
frontier: tasksFrontierResultSchema,
|
|
40908
41215
|
rollup: tasksRollupResultSchema,
|
|
40909
|
-
relationEdges:
|
|
40910
|
-
rootId:
|
|
41216
|
+
relationEdges: z16.object({
|
|
41217
|
+
rootId: z16.string().min(1),
|
|
40911
41218
|
direction: workGraphEdgeDirectionSchema,
|
|
40912
|
-
edges:
|
|
40913
|
-
|
|
41219
|
+
edges: z16.array(
|
|
41220
|
+
z16.discriminatedUnion("source", [
|
|
40914
41221
|
workGraphRelationEdgeSchema,
|
|
40915
41222
|
workGraphDependencyEdgeSchema
|
|
40916
41223
|
])
|
|
@@ -40919,60 +41226,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
40919
41226
|
});
|
|
40920
41227
|
|
|
40921
41228
|
// packages/contracts/src/operations/docs.ts
|
|
40922
|
-
import { z as
|
|
40923
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
40924
|
-
version:
|
|
40925
|
-
operation:
|
|
40926
|
-
identity:
|
|
40927
|
-
projectId:
|
|
40928
|
-
projectRoot:
|
|
40929
|
-
actor:
|
|
40930
|
-
operation:
|
|
40931
|
-
idempotencyKey:
|
|
41229
|
+
import { z as z17 } from "zod";
|
|
41230
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
41231
|
+
version: z17.literal(1),
|
|
41232
|
+
operation: z17.literal("docs.projection"),
|
|
41233
|
+
identity: z17.object({
|
|
41234
|
+
projectId: z17.string().min(1),
|
|
41235
|
+
projectRoot: z17.string().min(1),
|
|
41236
|
+
actor: z17.string().min(1),
|
|
41237
|
+
operation: z17.literal("docs.projection"),
|
|
41238
|
+
idempotencyKey: z17.string().min(1)
|
|
40932
41239
|
}).strict(),
|
|
40933
|
-
source:
|
|
40934
|
-
attachmentId:
|
|
40935
|
-
sha256:
|
|
40936
|
-
ownerId:
|
|
40937
|
-
ownerType:
|
|
40938
|
-
label:
|
|
41240
|
+
source: z17.object({
|
|
41241
|
+
attachmentId: z17.string().min(1),
|
|
41242
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
41243
|
+
ownerId: z17.string().min(1),
|
|
41244
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
41245
|
+
label: z17.string().min(1)
|
|
40939
41246
|
}).strict(),
|
|
40940
|
-
observation:
|
|
40941
|
-
kind:
|
|
40942
|
-
attachmentId:
|
|
40943
|
-
ownerId:
|
|
40944
|
-
addedAt:
|
|
40945
|
-
slug:
|
|
40946
|
-
type:
|
|
41247
|
+
observation: z17.object({
|
|
41248
|
+
kind: z17.literal("doc-attachment"),
|
|
41249
|
+
attachmentId: z17.string().min(1),
|
|
41250
|
+
ownerId: z17.string().min(1),
|
|
41251
|
+
addedAt: z17.string().min(1),
|
|
41252
|
+
slug: z17.string().optional(),
|
|
41253
|
+
type: z17.string().optional()
|
|
40947
41254
|
}).strict()
|
|
40948
41255
|
}).strict();
|
|
40949
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
40950
|
-
version:
|
|
40951
|
-
sourceHash:
|
|
40952
|
-
graph:
|
|
41256
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
41257
|
+
version: z17.literal(1),
|
|
41258
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
41259
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
40953
41260
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
40954
|
-
observationId:
|
|
41261
|
+
observationId: z17.string().min(1).optional(),
|
|
40955
41262
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
40956
|
-
documents:
|
|
40957
|
-
verifiedAt:
|
|
40958
|
-
actor:
|
|
41263
|
+
documents: z17.literal(true).optional(),
|
|
41264
|
+
verifiedAt: z17.string().min(1),
|
|
41265
|
+
actor: z17.string().min(1)
|
|
40959
41266
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
40960
41267
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
40961
41268
|
});
|
|
40962
41269
|
|
|
40963
41270
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
40964
|
-
import { z as
|
|
40965
|
-
var taskTreeEntrySchema =
|
|
40966
|
-
title:
|
|
40967
|
-
acceptance:
|
|
41271
|
+
import { z as z18 } from "zod";
|
|
41272
|
+
var taskTreeEntrySchema = z18.object({
|
|
41273
|
+
title: z18.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
|
|
41274
|
+
acceptance: z18.array(z18.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), {
|
|
40968
41275
|
message: "acceptance array contains no non-empty strings"
|
|
40969
41276
|
}),
|
|
40970
|
-
id:
|
|
40971
|
-
parentId:
|
|
40972
|
-
depends:
|
|
41277
|
+
id: z18.string().optional(),
|
|
41278
|
+
parentId: z18.string().optional(),
|
|
41279
|
+
depends: z18.array(z18.string()).optional()
|
|
40973
41280
|
});
|
|
40974
|
-
var taskTreeSchema =
|
|
40975
|
-
var evidenceSchema =
|
|
41281
|
+
var taskTreeSchema = z18.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" });
|
|
41282
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
40976
41283
|
if (value === null || value === void 0) {
|
|
40977
41284
|
ctx.addIssue({
|
|
40978
41285
|
code: "custom",
|
|
@@ -41006,7 +41313,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
41006
41313
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
41007
41314
|
});
|
|
41008
41315
|
});
|
|
41009
|
-
var passthroughSchema =
|
|
41316
|
+
var passthroughSchema = z18.unknown();
|
|
41010
41317
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
41011
41318
|
// release.cantbook
|
|
41012
41319
|
"version_bump_report",
|
|
@@ -41039,44 +41346,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
41039
41346
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
41040
41347
|
|
|
41041
41348
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
41042
|
-
import { z as
|
|
41043
|
-
var parsedPrEvidenceAtomSchema =
|
|
41044
|
-
kind:
|
|
41045
|
-
prNumber:
|
|
41046
|
-
});
|
|
41047
|
-
var prEvidenceStateModifierSchema =
|
|
41048
|
-
kind:
|
|
41049
|
-
value:
|
|
41050
|
-
});
|
|
41051
|
-
var ghPrViewSchema =
|
|
41052
|
-
state:
|
|
41053
|
-
mergedAt:
|
|
41054
|
-
headRefOid:
|
|
41055
|
-
mergeCommit:
|
|
41056
|
-
title:
|
|
41057
|
-
body:
|
|
41058
|
-
headRefName:
|
|
41059
|
-
files:
|
|
41060
|
-
changedFiles:
|
|
41061
|
-
mergeable:
|
|
41062
|
-
statusCheckRollup:
|
|
41063
|
-
|
|
41064
|
-
__typename:
|
|
41065
|
-
name:
|
|
41066
|
-
workflowName:
|
|
41067
|
-
conclusion:
|
|
41068
|
-
status:
|
|
41349
|
+
import { z as z19 } from "zod";
|
|
41350
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
41351
|
+
kind: z19.literal("pr"),
|
|
41352
|
+
prNumber: z19.number().int().positive()
|
|
41353
|
+
});
|
|
41354
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
41355
|
+
kind: z19.literal("state"),
|
|
41356
|
+
value: z19.literal("MERGED")
|
|
41357
|
+
});
|
|
41358
|
+
var ghPrViewSchema = z19.object({
|
|
41359
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
41360
|
+
mergedAt: z19.string().nullable(),
|
|
41361
|
+
headRefOid: z19.string().optional(),
|
|
41362
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
41363
|
+
title: z19.string().optional(),
|
|
41364
|
+
body: z19.string().optional(),
|
|
41365
|
+
headRefName: z19.string().optional(),
|
|
41366
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
41367
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
41368
|
+
mergeable: z19.string().optional(),
|
|
41369
|
+
statusCheckRollup: z19.array(
|
|
41370
|
+
z19.object({
|
|
41371
|
+
__typename: z19.string().optional(),
|
|
41372
|
+
name: z19.string().optional(),
|
|
41373
|
+
workflowName: z19.string().optional(),
|
|
41374
|
+
conclusion: z19.string().nullable().optional(),
|
|
41375
|
+
status: z19.string().optional(),
|
|
41069
41376
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
41070
|
-
startedAt:
|
|
41377
|
+
startedAt: z19.string().nullable().optional(),
|
|
41071
41378
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
41072
|
-
completedAt:
|
|
41379
|
+
completedAt: z19.string().nullable().optional()
|
|
41073
41380
|
}).passthrough()
|
|
41074
41381
|
).optional().default([])
|
|
41075
41382
|
}).passthrough();
|
|
41076
41383
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
41077
41384
|
|
|
41078
41385
|
// packages/contracts/src/release/plan.ts
|
|
41079
|
-
import { z as
|
|
41386
|
+
import { z as z20 } from "zod";
|
|
41080
41387
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
41081
41388
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
41082
41389
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -41120,20 +41427,20 @@ var RESOLVED_SOURCE = [
|
|
|
41120
41427
|
"language-default",
|
|
41121
41428
|
"legacy-alias"
|
|
41122
41429
|
];
|
|
41123
|
-
var ReleaseChannelSchema =
|
|
41124
|
-
var ReleaseSchemeSchema =
|
|
41125
|
-
var ReleaseKindSchema =
|
|
41126
|
-
var ReleaseStatusSchema =
|
|
41127
|
-
var GateStatusSchema =
|
|
41128
|
-
var GateNameSchema =
|
|
41129
|
-
var PlatformTupleSchema =
|
|
41130
|
-
var PublisherSchema =
|
|
41131
|
-
var TaskKindSchema =
|
|
41132
|
-
var ImpactSchema =
|
|
41133
|
-
var ResolvedSourceSchema =
|
|
41134
|
-
var Iso8601 =
|
|
41135
|
-
var NonEmptyString =
|
|
41136
|
-
var ReleasePlanTaskSchema =
|
|
41430
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
41431
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
41432
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
41433
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
41434
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
41435
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
41436
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
41437
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
41438
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
41439
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
41440
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
41441
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
41442
|
+
var NonEmptyString = z20.string().min(1);
|
|
41443
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
41137
41444
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
41138
41445
|
id: NonEmptyString,
|
|
41139
41446
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -41141,20 +41448,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
41141
41448
|
/** SemVer impact classification. */
|
|
41142
41449
|
impact: ImpactSchema,
|
|
41143
41450
|
/** Human-readable changelog line for this task. */
|
|
41144
|
-
userFacingSummary:
|
|
41451
|
+
userFacingSummary: z20.string(),
|
|
41145
41452
|
/**
|
|
41146
41453
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
41147
41454
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
41148
41455
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
41149
41456
|
* enforces non-empty via R-301.
|
|
41150
41457
|
*/
|
|
41151
|
-
evidenceAtoms:
|
|
41458
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
41152
41459
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
41153
|
-
ivtrPhaseAtPlan:
|
|
41460
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
41154
41461
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
41155
41462
|
epicAncestor: NonEmptyString
|
|
41156
41463
|
});
|
|
41157
|
-
var ReleaseGateSchema =
|
|
41464
|
+
var ReleaseGateSchema = z20.object({
|
|
41158
41465
|
/** Canonical gate name. */
|
|
41159
41466
|
name: GateNameSchema,
|
|
41160
41467
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -41164,11 +41471,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
41164
41471
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
41165
41472
|
lastVerifiedAt: Iso8601,
|
|
41166
41473
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
41167
|
-
resolvedCommand:
|
|
41474
|
+
resolvedCommand: z20.string().optional(),
|
|
41168
41475
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
41169
41476
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
41170
41477
|
});
|
|
41171
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
41478
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
41172
41479
|
/** Target platform tuple. */
|
|
41173
41480
|
platform: PlatformTupleSchema,
|
|
41174
41481
|
/** Distribution backend. */
|
|
@@ -41176,47 +41483,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
41176
41483
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
41177
41484
|
package: NonEmptyString,
|
|
41178
41485
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
41179
|
-
smoke:
|
|
41486
|
+
smoke: z20.boolean().default(true).optional()
|
|
41180
41487
|
});
|
|
41181
|
-
var ReleasePreflightSummarySchema =
|
|
41488
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
41182
41489
|
/** True if esbuild externals are out of sync with package.json. */
|
|
41183
|
-
esbuildExternalsDrift:
|
|
41490
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
41184
41491
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
41185
|
-
lockfileDrift:
|
|
41492
|
+
lockfileDrift: z20.boolean(),
|
|
41186
41493
|
/** True if all epic children are in terminal lifecycle states. */
|
|
41187
|
-
epicCompletenessClean:
|
|
41494
|
+
epicCompletenessClean: z20.boolean(),
|
|
41188
41495
|
/** True if no task appears in multiple in-flight release plans. */
|
|
41189
|
-
doubleListingClean:
|
|
41496
|
+
doubleListingClean: z20.boolean(),
|
|
41190
41497
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
41191
|
-
preflightWarnings:
|
|
41498
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
41192
41499
|
});
|
|
41193
|
-
var ReleasePlanChangelogSchema =
|
|
41500
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
41194
41501
|
/** `kind=feat` tasks. */
|
|
41195
|
-
features:
|
|
41502
|
+
features: z20.array(NonEmptyString).default([]),
|
|
41196
41503
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
41197
|
-
fixes:
|
|
41504
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
41198
41505
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
41199
|
-
chores:
|
|
41506
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
41200
41507
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
41201
|
-
breaking:
|
|
41508
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
41202
41509
|
});
|
|
41203
|
-
var ReleasePlanMetaSchema =
|
|
41510
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
41204
41511
|
/** True if this is the project's first ever release. */
|
|
41205
|
-
firstEverRelease:
|
|
41512
|
+
firstEverRelease: z20.boolean().optional(),
|
|
41206
41513
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
41207
|
-
unresolvedTools:
|
|
41514
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
41208
41515
|
/** Project archetype detected at plan time. */
|
|
41209
|
-
archetype:
|
|
41210
|
-
}).catchall(
|
|
41211
|
-
var ReleasePlanSchema =
|
|
41516
|
+
archetype: z20.string().optional()
|
|
41517
|
+
}).catchall(z20.unknown());
|
|
41518
|
+
var ReleasePlanSchema = z20.object({
|
|
41212
41519
|
/** Schema URL for this plan version. */
|
|
41213
|
-
$schema:
|
|
41520
|
+
$schema: z20.string().optional(),
|
|
41214
41521
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
41215
41522
|
version: NonEmptyString,
|
|
41216
41523
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
41217
41524
|
resolvedVersion: NonEmptyString,
|
|
41218
41525
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
41219
|
-
suffixApplied:
|
|
41526
|
+
suffixApplied: z20.boolean(),
|
|
41220
41527
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
41221
41528
|
scheme: ReleaseSchemeSchema,
|
|
41222
41529
|
/** npm dist-tag channel for this release. */
|
|
@@ -41230,7 +41537,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
41230
41537
|
/** Release-kind classification. */
|
|
41231
41538
|
releaseKind: ReleaseKindSchema,
|
|
41232
41539
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
41233
|
-
hooksV1Promotion:
|
|
41540
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
41234
41541
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
41235
41542
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
41236
41543
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -41241,27 +41548,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
41241
41548
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
41242
41549
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
41243
41550
|
*/
|
|
41244
|
-
previousVersion:
|
|
41551
|
+
previousVersion: z20.string().nullable(),
|
|
41245
41552
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
41246
|
-
previousTag:
|
|
41553
|
+
previousTag: z20.string().nullable(),
|
|
41247
41554
|
/** ISO-8601 timestamp the previous release was published. */
|
|
41248
41555
|
previousShippedAt: Iso8601.nullable(),
|
|
41249
41556
|
/** Tasks rolled into this release. */
|
|
41250
|
-
tasks:
|
|
41557
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
41251
41558
|
/** Bucketed changelog. */
|
|
41252
41559
|
changelog: ReleasePlanChangelogSchema,
|
|
41253
41560
|
/** Per-gate verification status. */
|
|
41254
|
-
gates:
|
|
41561
|
+
gates: z20.array(ReleaseGateSchema),
|
|
41255
41562
|
/** Platform / publisher matrix. */
|
|
41256
|
-
platformMatrix:
|
|
41563
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
41257
41564
|
/** Preflight summary from `cleo release plan`. */
|
|
41258
41565
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
41259
41566
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
41260
|
-
workflowRunUrl:
|
|
41567
|
+
workflowRunUrl: z20.string().nullable(),
|
|
41261
41568
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
41262
|
-
prUrl:
|
|
41569
|
+
prUrl: z20.string().nullable(),
|
|
41263
41570
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
41264
|
-
mergeCommitSha:
|
|
41571
|
+
mergeCommitSha: z20.string().nullable(),
|
|
41265
41572
|
/** Current FSM state per R-302. */
|
|
41266
41573
|
status: ReleaseStatusSchema,
|
|
41267
41574
|
/** Informational / forward-compat metadata. */
|
|
@@ -41291,48 +41598,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
41291
41598
|
]);
|
|
41292
41599
|
|
|
41293
41600
|
// packages/contracts/src/session-journal.ts
|
|
41294
|
-
import { z as
|
|
41601
|
+
import { z as z21 } from "zod";
|
|
41295
41602
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
41296
|
-
var sessionJournalDoctorSummarySchema =
|
|
41603
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
41297
41604
|
/** `true` when zero noise patterns were detected. */
|
|
41298
|
-
isClean:
|
|
41605
|
+
isClean: z21.boolean(),
|
|
41299
41606
|
/** Total number of noise findings across all patterns. */
|
|
41300
|
-
findingsCount:
|
|
41607
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
41301
41608
|
/** Pattern names that were detected (empty when isClean). */
|
|
41302
|
-
patterns:
|
|
41609
|
+
patterns: z21.array(z21.string()),
|
|
41303
41610
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
41304
|
-
totalScanned:
|
|
41611
|
+
totalScanned: z21.number().int().nonnegative()
|
|
41305
41612
|
});
|
|
41306
|
-
var sessionJournalDebriefSummarySchema =
|
|
41613
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
41307
41614
|
/** First 200 characters of the session end note (if provided). */
|
|
41308
|
-
noteExcerpt:
|
|
41615
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
41309
41616
|
/** Number of tasks completed during the session. */
|
|
41310
|
-
tasksCompletedCount:
|
|
41617
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
41311
41618
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
41312
|
-
tasksFocused:
|
|
41619
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
41313
41620
|
});
|
|
41314
|
-
var sessionJournalEntrySchema =
|
|
41621
|
+
var sessionJournalEntrySchema = z21.object({
|
|
41315
41622
|
// Identity
|
|
41316
41623
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
41317
|
-
schemaVersion:
|
|
41624
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
41318
41625
|
/** ISO 8601 timestamp when the entry was written. */
|
|
41319
|
-
timestamp:
|
|
41626
|
+
timestamp: z21.string(),
|
|
41320
41627
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
41321
|
-
sessionId:
|
|
41628
|
+
sessionId: z21.string(),
|
|
41322
41629
|
/** Event type that triggered this journal entry. */
|
|
41323
|
-
eventType:
|
|
41630
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
41324
41631
|
// Session metadata (set on session_start / session_end)
|
|
41325
41632
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
41326
|
-
agentIdentifier:
|
|
41633
|
+
agentIdentifier: z21.string().optional(),
|
|
41327
41634
|
/** Provider adapter ID active for this session. */
|
|
41328
|
-
providerId:
|
|
41635
|
+
providerId: z21.string().optional(),
|
|
41329
41636
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
41330
|
-
scope:
|
|
41637
|
+
scope: z21.string().optional(),
|
|
41331
41638
|
// Session-end fields
|
|
41332
41639
|
/** Duration of the session in seconds (session_end only). */
|
|
41333
|
-
duration:
|
|
41640
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
41334
41641
|
/** Task IDs (not titles) completed during the session. */
|
|
41335
|
-
tasksCompleted:
|
|
41642
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
41336
41643
|
// Doctor summary (T1262 absorbed)
|
|
41337
41644
|
/**
|
|
41338
41645
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -41347,52 +41654,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
41347
41654
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
41348
41655
|
// Optional hash chain
|
|
41349
41656
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
41350
|
-
prevEntryHash:
|
|
41657
|
+
prevEntryHash: z21.string().optional()
|
|
41351
41658
|
});
|
|
41352
41659
|
|
|
41353
41660
|
// packages/contracts/src/task-evidence.ts
|
|
41354
|
-
import { z as
|
|
41355
|
-
var fileEvidenceSchema =
|
|
41356
|
-
kind:
|
|
41357
|
-
sha256:
|
|
41358
|
-
timestamp:
|
|
41359
|
-
path:
|
|
41360
|
-
mime:
|
|
41361
|
-
description:
|
|
41362
|
-
});
|
|
41363
|
-
var logEvidenceSchema =
|
|
41364
|
-
kind:
|
|
41365
|
-
sha256:
|
|
41366
|
-
timestamp:
|
|
41367
|
-
source:
|
|
41368
|
-
description:
|
|
41369
|
-
});
|
|
41370
|
-
var screenshotEvidenceSchema =
|
|
41371
|
-
kind:
|
|
41372
|
-
sha256:
|
|
41373
|
-
timestamp:
|
|
41374
|
-
mime:
|
|
41375
|
-
description:
|
|
41376
|
-
});
|
|
41377
|
-
var testOutputEvidenceSchema =
|
|
41378
|
-
kind:
|
|
41379
|
-
sha256:
|
|
41380
|
-
timestamp:
|
|
41381
|
-
passed:
|
|
41382
|
-
failed:
|
|
41383
|
-
skipped:
|
|
41384
|
-
exitCode:
|
|
41385
|
-
description:
|
|
41386
|
-
});
|
|
41387
|
-
var commandOutputEvidenceSchema =
|
|
41388
|
-
kind:
|
|
41389
|
-
sha256:
|
|
41390
|
-
timestamp:
|
|
41391
|
-
cmd:
|
|
41392
|
-
exitCode:
|
|
41393
|
-
description:
|
|
41394
|
-
});
|
|
41395
|
-
var taskEvidenceSchema =
|
|
41661
|
+
import { z as z22 } from "zod";
|
|
41662
|
+
var fileEvidenceSchema = z22.object({
|
|
41663
|
+
kind: z22.literal("file"),
|
|
41664
|
+
sha256: z22.string().length(64),
|
|
41665
|
+
timestamp: z22.string().datetime(),
|
|
41666
|
+
path: z22.string().min(1),
|
|
41667
|
+
mime: z22.string().optional(),
|
|
41668
|
+
description: z22.string().optional()
|
|
41669
|
+
});
|
|
41670
|
+
var logEvidenceSchema = z22.object({
|
|
41671
|
+
kind: z22.literal("log"),
|
|
41672
|
+
sha256: z22.string().length(64),
|
|
41673
|
+
timestamp: z22.string().datetime(),
|
|
41674
|
+
source: z22.string().min(1),
|
|
41675
|
+
description: z22.string().optional()
|
|
41676
|
+
});
|
|
41677
|
+
var screenshotEvidenceSchema = z22.object({
|
|
41678
|
+
kind: z22.literal("screenshot"),
|
|
41679
|
+
sha256: z22.string().length(64),
|
|
41680
|
+
timestamp: z22.string().datetime(),
|
|
41681
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
41682
|
+
description: z22.string().optional()
|
|
41683
|
+
});
|
|
41684
|
+
var testOutputEvidenceSchema = z22.object({
|
|
41685
|
+
kind: z22.literal("test-output"),
|
|
41686
|
+
sha256: z22.string().length(64),
|
|
41687
|
+
timestamp: z22.string().datetime(),
|
|
41688
|
+
passed: z22.number().int().nonnegative(),
|
|
41689
|
+
failed: z22.number().int().nonnegative(),
|
|
41690
|
+
skipped: z22.number().int().nonnegative(),
|
|
41691
|
+
exitCode: z22.number().int(),
|
|
41692
|
+
description: z22.string().optional()
|
|
41693
|
+
});
|
|
41694
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
41695
|
+
kind: z22.literal("command-output"),
|
|
41696
|
+
sha256: z22.string().length(64),
|
|
41697
|
+
timestamp: z22.string().datetime(),
|
|
41698
|
+
cmd: z22.string().min(1),
|
|
41699
|
+
exitCode: z22.number().int(),
|
|
41700
|
+
description: z22.string().optional()
|
|
41701
|
+
});
|
|
41702
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
41396
41703
|
fileEvidenceSchema,
|
|
41397
41704
|
logEvidenceSchema,
|
|
41398
41705
|
screenshotEvidenceSchema,
|
|
@@ -41401,8 +41708,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
41401
41708
|
]);
|
|
41402
41709
|
|
|
41403
41710
|
// packages/contracts/src/tasks/archive.ts
|
|
41404
|
-
import { z as
|
|
41405
|
-
var ArchiveReason =
|
|
41711
|
+
import { z as z23 } from "zod";
|
|
41712
|
+
var ArchiveReason = z23.enum([
|
|
41406
41713
|
"verified",
|
|
41407
41714
|
"reconciled",
|
|
41408
41715
|
"superseded",
|
|
@@ -41413,42 +41720,42 @@ var ArchiveReason = z22.enum([
|
|
|
41413
41720
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
41414
41721
|
|
|
41415
41722
|
// packages/contracts/src/tasks/index.ts
|
|
41416
|
-
import { z as
|
|
41417
|
-
var taskMutationWarningSeveritySchema =
|
|
41418
|
-
var taskMutationWarningSchema =
|
|
41419
|
-
code:
|
|
41420
|
-
message:
|
|
41723
|
+
import { z as z24 } from "zod";
|
|
41724
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
41725
|
+
var taskMutationWarningSchema = z24.object({
|
|
41726
|
+
code: z24.string().min(1),
|
|
41727
|
+
message: z24.string().min(1),
|
|
41421
41728
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
41422
|
-
taskId:
|
|
41423
|
-
field:
|
|
41424
|
-
index:
|
|
41425
|
-
});
|
|
41426
|
-
var taskMutationDryRunSummarySchema =
|
|
41427
|
-
dryRun:
|
|
41428
|
-
wouldCreate:
|
|
41429
|
-
wouldUpdate:
|
|
41430
|
-
wouldDelete:
|
|
41431
|
-
wouldAffect:
|
|
41432
|
-
validatedCount:
|
|
41433
|
-
insertedCount:
|
|
41434
|
-
updatedCount:
|
|
41435
|
-
deletedCount:
|
|
41436
|
-
warnings:
|
|
41437
|
-
});
|
|
41438
|
-
var taskMutationTaskRecordSchema =
|
|
41439
|
-
var taskMutationEnvelopeSchema =
|
|
41440
|
-
dryRun:
|
|
41441
|
-
created:
|
|
41442
|
-
updated:
|
|
41443
|
-
deleted:
|
|
41444
|
-
affectedCount:
|
|
41445
|
-
mutationWarnings:
|
|
41729
|
+
taskId: z24.string().min(1).optional(),
|
|
41730
|
+
field: z24.string().min(1).optional(),
|
|
41731
|
+
index: z24.number().int().nonnegative().optional()
|
|
41732
|
+
});
|
|
41733
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
41734
|
+
dryRun: z24.literal(true),
|
|
41735
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
41736
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
41737
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
41738
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
41739
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
41740
|
+
insertedCount: z24.literal(0),
|
|
41741
|
+
updatedCount: z24.literal(0),
|
|
41742
|
+
deletedCount: z24.literal(0),
|
|
41743
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
41744
|
+
});
|
|
41745
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
41746
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
41747
|
+
dryRun: z24.boolean().optional(),
|
|
41748
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
41749
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
41750
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
41751
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
41752
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
41446
41753
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
41447
41754
|
});
|
|
41448
|
-
var completionTaskStatusSchema =
|
|
41449
|
-
var completionCriterionKindSchema =
|
|
41450
|
-
var completionCriterionStatusSchema =
|
|
41451
|
-
var completionBlockerReasonSchema =
|
|
41755
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
41756
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
41757
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
41758
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
41452
41759
|
"missing_evidence_binding",
|
|
41453
41760
|
"child_not_done",
|
|
41454
41761
|
"child_cancelled_requires_waiver",
|
|
@@ -41456,68 +41763,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
41456
41763
|
"child_missing",
|
|
41457
41764
|
"done_parent_stale"
|
|
41458
41765
|
]);
|
|
41459
|
-
var completionStaleReasonSchema =
|
|
41460
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
41766
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
41767
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
41461
41768
|
"projection_not_stale",
|
|
41462
41769
|
"criteria_missing",
|
|
41463
41770
|
"binding_target_missing",
|
|
41464
41771
|
"repair_conflict"
|
|
41465
41772
|
]);
|
|
41466
|
-
var completionCriterionWaiverSchema =
|
|
41467
|
-
criterionAcId:
|
|
41468
|
-
childTaskId:
|
|
41469
|
-
reason:
|
|
41470
|
-
actor:
|
|
41471
|
-
waivedAt:
|
|
41472
|
-
});
|
|
41473
|
-
var completionCriterionReplacementSchema =
|
|
41474
|
-
criterionAcId:
|
|
41475
|
-
originalChildTaskId:
|
|
41476
|
-
replacementChildTaskId:
|
|
41477
|
-
reason:
|
|
41478
|
-
actor:
|
|
41479
|
-
replacedAt:
|
|
41480
|
-
});
|
|
41481
|
-
var completionCriterionEvaluationSchema =
|
|
41482
|
-
acId:
|
|
41483
|
-
alias:
|
|
41484
|
-
text:
|
|
41773
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
41774
|
+
criterionAcId: z24.string().min(1),
|
|
41775
|
+
childTaskId: z24.string().min(1),
|
|
41776
|
+
reason: z24.string().min(1),
|
|
41777
|
+
actor: z24.string().min(1),
|
|
41778
|
+
waivedAt: z24.string().min(1)
|
|
41779
|
+
});
|
|
41780
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
41781
|
+
criterionAcId: z24.string().min(1),
|
|
41782
|
+
originalChildTaskId: z24.string().min(1),
|
|
41783
|
+
replacementChildTaskId: z24.string().min(1),
|
|
41784
|
+
reason: z24.string().min(1),
|
|
41785
|
+
actor: z24.string().min(1),
|
|
41786
|
+
replacedAt: z24.string().min(1)
|
|
41787
|
+
});
|
|
41788
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
41789
|
+
acId: z24.string().min(1),
|
|
41790
|
+
alias: z24.string().min(1),
|
|
41791
|
+
text: z24.string(),
|
|
41485
41792
|
kind: completionCriterionKindSchema,
|
|
41486
41793
|
status: completionCriterionStatusSchema,
|
|
41487
41794
|
reason: completionBlockerReasonSchema.optional(),
|
|
41488
|
-
targetTaskId:
|
|
41795
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
41489
41796
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
41490
41797
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
41491
41798
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
41492
41799
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
41493
|
-
evidenceBindings:
|
|
41800
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
41494
41801
|
});
|
|
41495
41802
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
41496
|
-
status:
|
|
41803
|
+
status: z24.literal("unsatisfied"),
|
|
41497
41804
|
reason: completionBlockerReasonSchema
|
|
41498
41805
|
});
|
|
41499
|
-
var completionTotalsSchema =
|
|
41500
|
-
criteria:
|
|
41501
|
-
satisfied:
|
|
41502
|
-
unsatisfied:
|
|
41503
|
-
waived:
|
|
41504
|
-
replaced:
|
|
41505
|
-
});
|
|
41506
|
-
var completionContextPackSchema =
|
|
41507
|
-
taskId:
|
|
41508
|
-
generatedAt:
|
|
41509
|
-
source:
|
|
41510
|
-
window:
|
|
41511
|
-
limit:
|
|
41512
|
-
since:
|
|
41513
|
-
relationDepth:
|
|
41514
|
-
relatedTaskIds:
|
|
41806
|
+
var completionTotalsSchema = z24.object({
|
|
41807
|
+
criteria: z24.number().int().nonnegative(),
|
|
41808
|
+
satisfied: z24.number().int().nonnegative(),
|
|
41809
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
41810
|
+
waived: z24.number().int().nonnegative(),
|
|
41811
|
+
replaced: z24.number().int().nonnegative()
|
|
41812
|
+
});
|
|
41813
|
+
var completionContextPackSchema = z24.object({
|
|
41814
|
+
taskId: z24.string().min(1),
|
|
41815
|
+
generatedAt: z24.string().min(1),
|
|
41816
|
+
source: z24.literal("audit_log"),
|
|
41817
|
+
window: z24.object({
|
|
41818
|
+
limit: z24.number().int().positive(),
|
|
41819
|
+
since: z24.string().min(1).optional(),
|
|
41820
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
41821
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
41515
41822
|
}),
|
|
41516
|
-
events:
|
|
41517
|
-
|
|
41518
|
-
id:
|
|
41519
|
-
timestamp:
|
|
41520
|
-
action:
|
|
41823
|
+
events: z24.array(
|
|
41824
|
+
z24.object({
|
|
41825
|
+
id: z24.string().min(1),
|
|
41826
|
+
timestamp: z24.string().min(1),
|
|
41827
|
+
action: z24.enum([
|
|
41521
41828
|
"task_completed",
|
|
41522
41829
|
"task_reopened",
|
|
41523
41830
|
"task_cancelled",
|
|
@@ -41525,77 +41832,77 @@ var completionContextPackSchema = z23.object({
|
|
|
41525
41832
|
"task_reparented",
|
|
41526
41833
|
"ac_projection_rebuilt"
|
|
41527
41834
|
]),
|
|
41528
|
-
taskId:
|
|
41529
|
-
relation:
|
|
41530
|
-
actor:
|
|
41531
|
-
details:
|
|
41532
|
-
before:
|
|
41533
|
-
after:
|
|
41835
|
+
taskId: z24.string().min(1),
|
|
41836
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
41837
|
+
actor: z24.string().min(1),
|
|
41838
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
41839
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
41840
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
41534
41841
|
})
|
|
41535
41842
|
),
|
|
41536
|
-
summary:
|
|
41537
|
-
totalEvents:
|
|
41538
|
-
byAction:
|
|
41539
|
-
byRelation:
|
|
41540
|
-
latestEventAt:
|
|
41843
|
+
summary: z24.object({
|
|
41844
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
41845
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
41846
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
41847
|
+
latestEventAt: z24.string().nullable()
|
|
41541
41848
|
})
|
|
41542
41849
|
});
|
|
41543
|
-
var completionEvaluationSchema =
|
|
41544
|
-
taskId:
|
|
41850
|
+
var completionEvaluationSchema = z24.object({
|
|
41851
|
+
taskId: z24.string().min(1),
|
|
41545
41852
|
taskStatus: completionTaskStatusSchema,
|
|
41546
|
-
ready:
|
|
41547
|
-
stale:
|
|
41548
|
-
staleReasons:
|
|
41853
|
+
ready: z24.boolean(),
|
|
41854
|
+
stale: z24.boolean(),
|
|
41855
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
41549
41856
|
contextPack: completionContextPackSchema.optional(),
|
|
41550
|
-
satisfied:
|
|
41551
|
-
unsatisfied:
|
|
41552
|
-
waived:
|
|
41553
|
-
replaced:
|
|
41857
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
41858
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
41859
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
41860
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
41554
41861
|
totals: completionTotalsSchema
|
|
41555
41862
|
});
|
|
41556
|
-
var completionExplanationSchema =
|
|
41557
|
-
taskId:
|
|
41558
|
-
ready:
|
|
41559
|
-
stale:
|
|
41560
|
-
summary:
|
|
41863
|
+
var completionExplanationSchema = z24.object({
|
|
41864
|
+
taskId: z24.string().min(1),
|
|
41865
|
+
ready: z24.boolean(),
|
|
41866
|
+
stale: z24.boolean(),
|
|
41867
|
+
summary: z24.string(),
|
|
41561
41868
|
contextPack: completionContextPackSchema.optional(),
|
|
41562
|
-
blockers:
|
|
41869
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
41563
41870
|
});
|
|
41564
|
-
var completionListParamsSchema =
|
|
41565
|
-
taskId:
|
|
41871
|
+
var completionListParamsSchema = z24.object({
|
|
41872
|
+
taskId: z24.string().min(1),
|
|
41566
41873
|
status: completionCriterionStatusSchema.optional(),
|
|
41567
41874
|
kind: completionCriterionKindSchema.optional()
|
|
41568
41875
|
});
|
|
41569
|
-
var completionListResultSchema =
|
|
41570
|
-
taskId:
|
|
41571
|
-
criteria:
|
|
41876
|
+
var completionListResultSchema = z24.object({
|
|
41877
|
+
taskId: z24.string().min(1),
|
|
41878
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
41572
41879
|
totals: completionTotalsSchema
|
|
41573
41880
|
});
|
|
41574
|
-
var completionEvaluateParamsSchema =
|
|
41575
|
-
taskId:
|
|
41576
|
-
includeContext:
|
|
41577
|
-
limit:
|
|
41578
|
-
since:
|
|
41579
|
-
relationDepth:
|
|
41881
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
41882
|
+
taskId: z24.string().min(1),
|
|
41883
|
+
includeContext: z24.boolean().optional(),
|
|
41884
|
+
limit: z24.number().int().positive().optional(),
|
|
41885
|
+
since: z24.string().min(1).optional(),
|
|
41886
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
41580
41887
|
});
|
|
41581
|
-
var completionProjectionRepairErrorSchema =
|
|
41888
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
41582
41889
|
code: completionProjectionRepairErrorCodeSchema,
|
|
41583
|
-
message:
|
|
41584
|
-
taskId:
|
|
41585
|
-
acId:
|
|
41586
|
-
evidenceAtomId:
|
|
41587
|
-
});
|
|
41588
|
-
var completionProjectionRepairParamsSchema =
|
|
41589
|
-
taskId:
|
|
41590
|
-
dryRun:
|
|
41591
|
-
});
|
|
41592
|
-
var completionProjectionRepairResultSchema =
|
|
41593
|
-
taskId:
|
|
41594
|
-
repaired:
|
|
41595
|
-
dryRun:
|
|
41596
|
-
staleBefore:
|
|
41597
|
-
staleAfter:
|
|
41598
|
-
errors:
|
|
41890
|
+
message: z24.string().min(1),
|
|
41891
|
+
taskId: z24.string().min(1),
|
|
41892
|
+
acId: z24.string().min(1).optional(),
|
|
41893
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
41894
|
+
});
|
|
41895
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
41896
|
+
taskId: z24.string().min(1),
|
|
41897
|
+
dryRun: z24.boolean().optional()
|
|
41898
|
+
});
|
|
41899
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
41900
|
+
taskId: z24.string().min(1),
|
|
41901
|
+
repaired: z24.boolean(),
|
|
41902
|
+
dryRun: z24.boolean(),
|
|
41903
|
+
staleBefore: z24.boolean(),
|
|
41904
|
+
staleAfter: z24.boolean(),
|
|
41905
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
41599
41906
|
});
|
|
41600
41907
|
|
|
41601
41908
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -42098,7 +42405,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
42098
42405
|
};
|
|
42099
42406
|
|
|
42100
42407
|
// packages/contracts/src/templates/manifest.ts
|
|
42101
|
-
import { z as
|
|
42408
|
+
import { z as z25 } from "zod";
|
|
42102
42409
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
42103
42410
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
42104
42411
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -42115,79 +42422,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
42115
42422
|
"tool-resolver",
|
|
42116
42423
|
"literal"
|
|
42117
42424
|
];
|
|
42118
|
-
var PlaceholderSpecSchema =
|
|
42425
|
+
var PlaceholderSpecSchema = z25.object({
|
|
42119
42426
|
/**
|
|
42120
42427
|
* Placeholder identifier as it appears in the template body
|
|
42121
42428
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
42122
42429
|
*/
|
|
42123
|
-
name:
|
|
42430
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
42124
42431
|
/** Resolver source the installer consults for this placeholder. */
|
|
42125
|
-
source:
|
|
42432
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
42126
42433
|
/**
|
|
42127
42434
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
42128
42435
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
42129
42436
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
42130
42437
|
*/
|
|
42131
|
-
sourcePath:
|
|
42438
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
42132
42439
|
/**
|
|
42133
42440
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
42134
42441
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
42135
42442
|
*/
|
|
42136
|
-
defaultValue:
|
|
42443
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
42137
42444
|
});
|
|
42138
|
-
var TemplateManifestEntrySchema =
|
|
42445
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
42139
42446
|
/** Stable identifier for this template entry. */
|
|
42140
|
-
id:
|
|
42447
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
42141
42448
|
/** Category of file this template represents. */
|
|
42142
|
-
kind:
|
|
42449
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
42143
42450
|
/** Repo-relative path of the template source file. */
|
|
42144
|
-
sourcePath:
|
|
42451
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
42145
42452
|
/** Project-relative path where the rendered template installs. */
|
|
42146
|
-
installPath:
|
|
42453
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
42147
42454
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
42148
|
-
substitution:
|
|
42455
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
42149
42456
|
/** Declared placeholders this template requires. May be empty. */
|
|
42150
|
-
placeholders:
|
|
42457
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
42151
42458
|
/** Reconciliation policy on upgrade. */
|
|
42152
|
-
updateStrategy:
|
|
42459
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
42153
42460
|
});
|
|
42154
42461
|
|
|
42155
42462
|
// packages/contracts/src/validator/index.ts
|
|
42156
|
-
import { z as
|
|
42463
|
+
import { z as z26 } from "zod";
|
|
42157
42464
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
42158
|
-
var validatorFindingSchema =
|
|
42159
|
-
acId:
|
|
42160
|
-
status:
|
|
42161
|
-
reasoning:
|
|
42162
|
-
evidenceRefs:
|
|
42163
|
-
checkedAt:
|
|
42164
|
-
});
|
|
42165
|
-
var validatorAttestationSchema =
|
|
42166
|
-
verdict:
|
|
42167
|
-
taskId:
|
|
42168
|
-
validatorId:
|
|
42169
|
-
findings:
|
|
42465
|
+
var validatorFindingSchema = z26.object({
|
|
42466
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
42467
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
42468
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
42469
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
42470
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
42471
|
+
});
|
|
42472
|
+
var validatorAttestationSchema = z26.object({
|
|
42473
|
+
verdict: z26.literal("attest"),
|
|
42474
|
+
taskId: z26.string().min(1),
|
|
42475
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
42476
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
42170
42477
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
42171
42478
|
'attestation requires every finding to have status="pass"'
|
|
42172
42479
|
),
|
|
42173
|
-
summary:
|
|
42174
|
-
attestedAt:
|
|
42175
|
-
schemaVersion:
|
|
42176
|
-
});
|
|
42177
|
-
var validatorRejectionSchema =
|
|
42178
|
-
verdict:
|
|
42179
|
-
taskId:
|
|
42180
|
-
validatorId:
|
|
42181
|
-
findings:
|
|
42480
|
+
summary: z26.string().optional(),
|
|
42481
|
+
attestedAt: z26.string().min(1),
|
|
42482
|
+
schemaVersion: z26.literal("1")
|
|
42483
|
+
});
|
|
42484
|
+
var validatorRejectionSchema = z26.object({
|
|
42485
|
+
verdict: z26.literal("reject"),
|
|
42486
|
+
taskId: z26.string().min(1),
|
|
42487
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
42488
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
42182
42489
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
42183
42490
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
42184
42491
|
),
|
|
42185
|
-
summary:
|
|
42186
|
-
remediationHints:
|
|
42187
|
-
rejectedAt:
|
|
42188
|
-
schemaVersion:
|
|
42492
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
42493
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
42494
|
+
rejectedAt: z26.string().min(1),
|
|
42495
|
+
schemaVersion: z26.literal("1")
|
|
42189
42496
|
});
|
|
42190
|
-
var validatorVerdictSchema =
|
|
42497
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
42191
42498
|
validatorAttestationSchema,
|
|
42192
42499
|
validatorRejectionSchema
|
|
42193
42500
|
]);
|
|
@@ -42937,7 +43244,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
42937
43244
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
42938
43245
|
|
|
42939
43246
|
// packages/contracts/src/decide.ts
|
|
42940
|
-
import { z as
|
|
43247
|
+
import { z as z27 } from "zod";
|
|
42941
43248
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
42942
43249
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
42943
43250
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -42959,11 +43266,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
42959
43266
|
maxScoreLevels: 10
|
|
42960
43267
|
};
|
|
42961
43268
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
42962
|
-
var decisionQuestionTypeSchema =
|
|
42963
|
-
var decisionOutcomeSourceSchema =
|
|
42964
|
-
var decisionInstructionsSchema =
|
|
42965
|
-
var unitIntervalSchema =
|
|
42966
|
-
var decisionStateSchema =
|
|
43269
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
43270
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
43271
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
43272
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
43273
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
42967
43274
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
42968
43275
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
42969
43276
|
context.addIssue({
|
|
@@ -42972,34 +43279,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
42972
43279
|
});
|
|
42973
43280
|
}
|
|
42974
43281
|
});
|
|
42975
|
-
var noulDecisionQuestionSchema =
|
|
42976
|
-
type:
|
|
43282
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
43283
|
+
type: z27.literal("noul"),
|
|
42977
43284
|
instructions: decisionInstructionsSchema.optional(),
|
|
42978
|
-
criteria:
|
|
43285
|
+
criteria: z27.string().min(1)
|
|
42979
43286
|
});
|
|
42980
|
-
var choiceDecisionQuestionSchema =
|
|
42981
|
-
type:
|
|
43287
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
43288
|
+
type: z27.literal("choice"),
|
|
42982
43289
|
instructions: decisionInstructionsSchema.optional(),
|
|
42983
|
-
criteria:
|
|
43290
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
42984
43291
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
42985
43292
|
})
|
|
42986
43293
|
});
|
|
42987
|
-
var scoreDecisionQuestionSchema =
|
|
42988
|
-
type:
|
|
43294
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
43295
|
+
type: z27.literal("score"),
|
|
42989
43296
|
instructions: decisionInstructionsSchema.optional(),
|
|
42990
|
-
criteria:
|
|
43297
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
42991
43298
|
});
|
|
42992
|
-
var decisionQuestionSchema =
|
|
43299
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
42993
43300
|
noulDecisionQuestionSchema,
|
|
42994
43301
|
choiceDecisionQuestionSchema,
|
|
42995
43302
|
scoreDecisionQuestionSchema
|
|
42996
43303
|
]);
|
|
42997
|
-
var decisionRequestSchema =
|
|
42998
|
-
model:
|
|
42999
|
-
lang:
|
|
43000
|
-
cache:
|
|
43304
|
+
var decisionRequestSchema = z27.object({
|
|
43305
|
+
model: z27.string().min(1).optional(),
|
|
43306
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
43307
|
+
cache: z27.boolean().optional(),
|
|
43001
43308
|
state: decisionStateSchema,
|
|
43002
|
-
questions:
|
|
43309
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
43003
43310
|
(questions) => {
|
|
43004
43311
|
const count = Object.keys(questions).length;
|
|
43005
43312
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -43009,139 +43316,139 @@ var decisionRequestSchema = z26.object({
|
|
|
43009
43316
|
}
|
|
43010
43317
|
)
|
|
43011
43318
|
});
|
|
43012
|
-
var noulDecisionAnswerSchema =
|
|
43013
|
-
type:
|
|
43014
|
-
value:
|
|
43319
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
43320
|
+
type: z27.literal("noul"),
|
|
43321
|
+
value: z27.boolean(),
|
|
43015
43322
|
probability: unitIntervalSchema,
|
|
43016
43323
|
confidence: unitIntervalSchema
|
|
43017
43324
|
});
|
|
43018
|
-
var choiceDecisionAnswerSchema =
|
|
43019
|
-
type:
|
|
43020
|
-
value:
|
|
43021
|
-
probabilities:
|
|
43325
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
43326
|
+
type: z27.literal("choice"),
|
|
43327
|
+
value: z27.string().min(1),
|
|
43328
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
43022
43329
|
confidence: unitIntervalSchema
|
|
43023
43330
|
});
|
|
43024
|
-
var scoreDecisionAnswerSchema =
|
|
43025
|
-
type:
|
|
43026
|
-
value:
|
|
43027
|
-
probabilities:
|
|
43331
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
43332
|
+
type: z27.literal("score"),
|
|
43333
|
+
value: z27.number().int().nonnegative(),
|
|
43334
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
43028
43335
|
confidence: unitIntervalSchema
|
|
43029
43336
|
});
|
|
43030
|
-
var decisionAnswerSchema =
|
|
43337
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
43031
43338
|
noulDecisionAnswerSchema,
|
|
43032
43339
|
choiceDecisionAnswerSchema,
|
|
43033
43340
|
scoreDecisionAnswerSchema
|
|
43034
43341
|
]);
|
|
43035
|
-
var decisionOutcomeSchema =
|
|
43036
|
-
answers:
|
|
43342
|
+
var decisionOutcomeSchema = z27.object({
|
|
43343
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
43037
43344
|
source: decisionOutcomeSourceSchema,
|
|
43038
|
-
requestId:
|
|
43039
|
-
latencyMs:
|
|
43040
|
-
costUsd:
|
|
43041
|
-
costMicros:
|
|
43042
|
-
balanceMicros:
|
|
43043
|
-
checkpoint:
|
|
43044
|
-
inputTokens:
|
|
43045
|
-
});
|
|
43046
|
-
var decisionProviderKindSchema =
|
|
43047
|
-
var decisionProviderConfigSchema =
|
|
43048
|
-
baseUrl:
|
|
43345
|
+
requestId: z27.string().min(1).optional(),
|
|
43346
|
+
latencyMs: z27.number().nonnegative(),
|
|
43347
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
43348
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
43349
|
+
balanceMicros: z27.number().int().optional(),
|
|
43350
|
+
checkpoint: z27.string().min(1).optional(),
|
|
43351
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
43352
|
+
});
|
|
43353
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
43354
|
+
var decisionProviderConfigSchema = z27.object({
|
|
43355
|
+
baseUrl: z27.url(),
|
|
43049
43356
|
provider: decisionProviderKindSchema.optional()
|
|
43050
43357
|
});
|
|
43051
43358
|
|
|
43052
43359
|
// packages/contracts/src/nexus-account.ts
|
|
43053
|
-
import { z as
|
|
43054
|
-
var nexusAccountUserSchema =
|
|
43055
|
-
id:
|
|
43056
|
-
email:
|
|
43057
|
-
name:
|
|
43058
|
-
});
|
|
43059
|
-
var nexusAccountOrganizationSchema =
|
|
43060
|
-
id:
|
|
43061
|
-
name:
|
|
43062
|
-
slug:
|
|
43063
|
-
role:
|
|
43360
|
+
import { z as z28 } from "zod";
|
|
43361
|
+
var nexusAccountUserSchema = z28.object({
|
|
43362
|
+
id: z28.string(),
|
|
43363
|
+
email: z28.string(),
|
|
43364
|
+
name: z28.string().nullable().optional()
|
|
43365
|
+
});
|
|
43366
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
43367
|
+
id: z28.string(),
|
|
43368
|
+
name: z28.string(),
|
|
43369
|
+
slug: z28.string().nullable().optional(),
|
|
43370
|
+
role: z28.string().optional(),
|
|
43064
43371
|
/** `true` for the personal organization created at sign-up. */
|
|
43065
|
-
personal:
|
|
43372
|
+
personal: z28.boolean().optional()
|
|
43066
43373
|
});
|
|
43067
|
-
var nexusAccountMeSchema =
|
|
43374
|
+
var nexusAccountMeSchema = z28.object({
|
|
43068
43375
|
user: nexusAccountUserSchema,
|
|
43069
|
-
organizations:
|
|
43376
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
43070
43377
|
});
|
|
43071
43378
|
|
|
43072
43379
|
// packages/contracts/src/nexus-cloud.ts
|
|
43073
|
-
import { z as
|
|
43380
|
+
import { z as z29 } from "zod";
|
|
43074
43381
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
43075
43382
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
43076
43383
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
43077
|
-
var isoTime =
|
|
43078
|
-
var profile =
|
|
43079
|
-
var deviceState =
|
|
43080
|
-
var nexusCloudCredentialSchema =
|
|
43081
|
-
kind:
|
|
43082
|
-
credentialId:
|
|
43384
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
43385
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
43386
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
43387
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
43388
|
+
kind: z29.enum(["device", "session"]),
|
|
43389
|
+
credentialId: z29.string().nullable().optional(),
|
|
43083
43390
|
profile: profile.optional(),
|
|
43084
|
-
scopes:
|
|
43391
|
+
scopes: z29.array(z29.string()).default([]),
|
|
43085
43392
|
createdAt: isoTime.nullable().optional(),
|
|
43086
43393
|
lastUsedAt: isoTime.nullable().optional(),
|
|
43087
43394
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
43088
43395
|
idleExpiresAt: isoTime.nullable().optional()
|
|
43089
43396
|
});
|
|
43090
|
-
var nexusCloudDeviceSchema =
|
|
43091
|
-
deviceId:
|
|
43092
|
-
name:
|
|
43093
|
-
platform:
|
|
43094
|
-
arch:
|
|
43095
|
-
cliVersion:
|
|
43397
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
43398
|
+
deviceId: z29.string(),
|
|
43399
|
+
name: z29.string(),
|
|
43400
|
+
platform: z29.string().optional(),
|
|
43401
|
+
arch: z29.string().nullable().optional(),
|
|
43402
|
+
cliVersion: z29.string().nullable().optional(),
|
|
43096
43403
|
createdAt: isoTime.optional(),
|
|
43097
43404
|
lastSeenAt: isoTime.nullable().optional(),
|
|
43098
43405
|
state: deviceState,
|
|
43099
43406
|
signedOutAt: isoTime.nullable().optional(),
|
|
43100
43407
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
43101
|
-
certificate:
|
|
43408
|
+
certificate: z29.string().nullable().optional(),
|
|
43102
43409
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
43103
43410
|
profile: profile.optional(),
|
|
43104
43411
|
/** True for the device whose credential made this request. */
|
|
43105
|
-
current:
|
|
43106
|
-
projects:
|
|
43107
|
-
replicas:
|
|
43412
|
+
current: z29.boolean().default(false),
|
|
43413
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
43414
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
43108
43415
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43109
43416
|
lastPresenceAt: isoTime.nullable().optional()
|
|
43110
43417
|
});
|
|
43111
|
-
var nexusCloudOrganizationSchema =
|
|
43112
|
-
id:
|
|
43113
|
-
name:
|
|
43114
|
-
slug:
|
|
43115
|
-
role:
|
|
43116
|
-
personal:
|
|
43418
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
43419
|
+
id: z29.string(),
|
|
43420
|
+
name: z29.string(),
|
|
43421
|
+
slug: z29.string().nullable().optional(),
|
|
43422
|
+
role: z29.string().optional(),
|
|
43423
|
+
personal: z29.boolean().optional()
|
|
43117
43424
|
});
|
|
43118
|
-
var nexusCloudUserSchema =
|
|
43119
|
-
id:
|
|
43120
|
-
email:
|
|
43121
|
-
name:
|
|
43425
|
+
var nexusCloudUserSchema = z29.object({
|
|
43426
|
+
id: z29.string(),
|
|
43427
|
+
email: z29.string(),
|
|
43428
|
+
name: z29.string().nullable().optional()
|
|
43122
43429
|
});
|
|
43123
|
-
var nexusCloudWhoamiSchema =
|
|
43430
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
43124
43431
|
serverTime: isoTime.optional(),
|
|
43125
43432
|
user: nexusCloudUserSchema,
|
|
43126
|
-
organizations:
|
|
43433
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
43127
43434
|
credential: nexusCloudCredentialSchema,
|
|
43128
43435
|
/** The calling device; null for a session caller. */
|
|
43129
43436
|
device: nexusCloudDeviceSchema.nullable()
|
|
43130
43437
|
});
|
|
43131
|
-
var nexusCloudDevicePageSchema =
|
|
43132
|
-
devices:
|
|
43133
|
-
nextCursor:
|
|
43134
|
-
truncated:
|
|
43438
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
43439
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
43440
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43441
|
+
truncated: z29.boolean().default(false)
|
|
43135
43442
|
});
|
|
43136
|
-
var nexusCloudPresenceSchema =
|
|
43443
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
43137
43444
|
observedAt: isoTime.optional(),
|
|
43138
|
-
sync:
|
|
43445
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
43139
43446
|
});
|
|
43140
|
-
var nexusCloudReplicaSchema =
|
|
43141
|
-
projectId:
|
|
43142
|
-
replicaId:
|
|
43143
|
-
deviceId:
|
|
43144
|
-
deviceName:
|
|
43447
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
43448
|
+
projectId: z29.string(),
|
|
43449
|
+
replicaId: z29.string(),
|
|
43450
|
+
deviceId: z29.string(),
|
|
43451
|
+
deviceName: z29.string(),
|
|
43145
43452
|
deviceState: deviceState.optional(),
|
|
43146
43453
|
attachedAt: isoTime.optional(),
|
|
43147
43454
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -43150,72 +43457,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
43150
43457
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
43151
43458
|
retiredAt: isoTime.nullable().optional(),
|
|
43152
43459
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
43153
|
-
successor:
|
|
43460
|
+
successor: z29.string().nullable().optional()
|
|
43154
43461
|
});
|
|
43155
|
-
var nexusCloudDeviceCountsSchema =
|
|
43156
|
-
active:
|
|
43157
|
-
total:
|
|
43462
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
43463
|
+
active: z29.number().int().nonnegative(),
|
|
43464
|
+
total: z29.number().int().nonnegative()
|
|
43158
43465
|
});
|
|
43159
43466
|
var projectFields = {
|
|
43160
|
-
projectId:
|
|
43161
|
-
label:
|
|
43162
|
-
organizationId:
|
|
43163
|
-
organizationName:
|
|
43164
|
-
remoteUrl:
|
|
43467
|
+
projectId: z29.string(),
|
|
43468
|
+
label: z29.string().nullable(),
|
|
43469
|
+
organizationId: z29.string(),
|
|
43470
|
+
organizationName: z29.string().optional(),
|
|
43471
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
43165
43472
|
createdAt: isoTime.optional()
|
|
43166
43473
|
};
|
|
43167
|
-
var nexusCloudProjectListItemSchema =
|
|
43474
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
43168
43475
|
...projectFields,
|
|
43169
|
-
role:
|
|
43476
|
+
role: z29.string(),
|
|
43170
43477
|
/**
|
|
43171
43478
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
43172
43479
|
* only a holder of the account key can open it (T13102).
|
|
43173
43480
|
*/
|
|
43174
|
-
encryptedName:
|
|
43175
|
-
streamId:
|
|
43176
|
-
headSeq:
|
|
43481
|
+
encryptedName: z29.string().nullable().optional(),
|
|
43482
|
+
streamId: z29.string().optional(),
|
|
43483
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
43177
43484
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
43178
|
-
headCheckpointId:
|
|
43179
|
-
openConflicts:
|
|
43180
|
-
replicas:
|
|
43485
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
43486
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
43487
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
43181
43488
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
43182
|
-
replicaCount:
|
|
43489
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
43183
43490
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43184
43491
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
43185
43492
|
/** This project's replica list was cut at 50 (T12858). */
|
|
43186
|
-
replicasTruncated:
|
|
43493
|
+
replicasTruncated: z29.boolean().default(false)
|
|
43187
43494
|
});
|
|
43188
|
-
var nexusCloudProjectPageSchema =
|
|
43189
|
-
projects:
|
|
43190
|
-
nextCursor:
|
|
43495
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
43496
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
43497
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43191
43498
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
43192
|
-
truncated:
|
|
43499
|
+
truncated: z29.boolean().default(false),
|
|
43193
43500
|
/** The project list itself was cut at 1000 (T12858). */
|
|
43194
|
-
projectsTruncated:
|
|
43501
|
+
projectsTruncated: z29.boolean().default(false)
|
|
43195
43502
|
});
|
|
43196
|
-
var nexusCloudProjectDetailSchema =
|
|
43197
|
-
project:
|
|
43198
|
-
role:
|
|
43199
|
-
canTrash:
|
|
43200
|
-
openConflicts:
|
|
43503
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
43504
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
43505
|
+
role: z29.string(),
|
|
43506
|
+
canTrash: z29.boolean().optional(),
|
|
43507
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
43201
43508
|
/** At most 50, oldest attachment first. */
|
|
43202
|
-
replicas:
|
|
43509
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
43203
43510
|
devices: nexusCloudDeviceCountsSchema,
|
|
43204
|
-
replicaCount:
|
|
43511
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
43205
43512
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43206
43513
|
/** `replicas` was cut at 50. */
|
|
43207
|
-
truncated:
|
|
43208
|
-
stream:
|
|
43209
|
-
streamId:
|
|
43210
|
-
headSeq:
|
|
43211
|
-
headCheckpointId:
|
|
43514
|
+
truncated: z29.boolean().default(false),
|
|
43515
|
+
stream: z29.object({
|
|
43516
|
+
streamId: z29.string(),
|
|
43517
|
+
headSeq: z29.number().int().nonnegative(),
|
|
43518
|
+
headCheckpointId: z29.string().nullable()
|
|
43212
43519
|
}).nullable()
|
|
43213
43520
|
});
|
|
43214
|
-
var nexusCloudReplicaPageSchema =
|
|
43215
|
-
replicas:
|
|
43521
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
43522
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
43216
43523
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
43217
|
-
nextCursor:
|
|
43218
|
-
truncated:
|
|
43524
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43525
|
+
truncated: z29.boolean().default(false)
|
|
43219
43526
|
});
|
|
43220
43527
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
43221
43528
|
"credential.valid",
|
|
@@ -43231,56 +43538,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
43231
43538
|
];
|
|
43232
43539
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
43233
43540
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
43234
|
-
var knownCheckId =
|
|
43235
|
-
var nexusCloudStatusCheckSchema =
|
|
43236
|
-
id:
|
|
43237
|
-
ok:
|
|
43238
|
-
required:
|
|
43239
|
-
detail:
|
|
43240
|
-
});
|
|
43241
|
-
var nexusCloudStatusSchema =
|
|
43541
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
43542
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
43543
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
43544
|
+
ok: z29.boolean(),
|
|
43545
|
+
required: z29.boolean(),
|
|
43546
|
+
detail: z29.string()
|
|
43547
|
+
});
|
|
43548
|
+
var nexusCloudStatusSchema = z29.object({
|
|
43242
43549
|
serverTime: isoTime.optional(),
|
|
43243
|
-
apiVersion:
|
|
43550
|
+
apiVersion: z29.string().optional(),
|
|
43244
43551
|
/**
|
|
43245
43552
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
43246
43553
|
* than the list, which therefore support none of them.
|
|
43247
43554
|
*/
|
|
43248
|
-
features:
|
|
43555
|
+
features: z29.array(z29.string()).optional(),
|
|
43249
43556
|
user: nexusCloudUserSchema,
|
|
43250
43557
|
credential: nexusCloudCredentialSchema,
|
|
43251
43558
|
device: nexusCloudDeviceSchema.nullable(),
|
|
43252
|
-
project:
|
|
43253
|
-
projectId:
|
|
43254
|
-
registered:
|
|
43255
|
-
organizationId:
|
|
43256
|
-
organizationName:
|
|
43257
|
-
role:
|
|
43559
|
+
project: z29.object({
|
|
43560
|
+
projectId: z29.string(),
|
|
43561
|
+
registered: z29.boolean(),
|
|
43562
|
+
organizationId: z29.string().nullable(),
|
|
43563
|
+
organizationName: z29.string().nullable(),
|
|
43564
|
+
role: z29.string().nullable()
|
|
43258
43565
|
}).nullable(),
|
|
43259
|
-
replica:
|
|
43260
|
-
replicaId:
|
|
43261
|
-
attached:
|
|
43262
|
-
attachedElsewhere:
|
|
43566
|
+
replica: z29.object({
|
|
43567
|
+
replicaId: z29.string(),
|
|
43568
|
+
attached: z29.boolean(),
|
|
43569
|
+
attachedElsewhere: z29.boolean(),
|
|
43263
43570
|
attachedAt: isoTime.nullable(),
|
|
43264
43571
|
lastSyncAt: isoTime.nullable(),
|
|
43265
43572
|
presenceAt: isoTime.nullable(),
|
|
43266
|
-
lastReplicaSeq:
|
|
43573
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
43267
43574
|
}).nullable(),
|
|
43268
|
-
stream:
|
|
43269
|
-
streamId:
|
|
43270
|
-
headSeq:
|
|
43271
|
-
headCheckpointId:
|
|
43272
|
-
openConflicts:
|
|
43575
|
+
stream: z29.object({
|
|
43576
|
+
streamId: z29.string(),
|
|
43577
|
+
headSeq: z29.number().int().nonnegative(),
|
|
43578
|
+
headCheckpointId: z29.string().nullable(),
|
|
43579
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
43273
43580
|
devices: nexusCloudDeviceCountsSchema
|
|
43274
43581
|
}).nullable(),
|
|
43275
43582
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
43276
|
-
checks:
|
|
43583
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
43277
43584
|
(list) => list.flatMap((c) => {
|
|
43278
43585
|
const id = knownCheckId.safeParse(c.id);
|
|
43279
43586
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
43280
43587
|
})
|
|
43281
43588
|
),
|
|
43282
43589
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
43283
|
-
verdict:
|
|
43590
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
43284
43591
|
});
|
|
43285
43592
|
var LOGIN = "run `cleo login nexus`";
|
|
43286
43593
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -43325,50 +43632,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
43325
43632
|
};
|
|
43326
43633
|
|
|
43327
43634
|
// packages/contracts/src/nexus-vault.ts
|
|
43328
|
-
import { z as
|
|
43329
|
-
var isoTime2 =
|
|
43330
|
-
var uuid =
|
|
43331
|
-
var nexusUserKeysSchema =
|
|
43332
|
-
keyVersion:
|
|
43333
|
-
masterKeyVerifier:
|
|
43334
|
-
});
|
|
43335
|
-
var nexusProjectKeysSchema =
|
|
43336
|
-
keys:
|
|
43337
|
-
|
|
43635
|
+
import { z as z30 } from "zod";
|
|
43636
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
43637
|
+
var uuid = z30.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
|
|
43638
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
43639
|
+
keyVersion: z30.number().int().positive(),
|
|
43640
|
+
masterKeyVerifier: z30.string()
|
|
43641
|
+
});
|
|
43642
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
43643
|
+
keys: z30.array(
|
|
43644
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
43338
43645
|
)
|
|
43339
43646
|
});
|
|
43340
|
-
var nexusLeaseSchema =
|
|
43341
|
-
streamId:
|
|
43342
|
-
role:
|
|
43647
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
43648
|
+
streamId: z30.string(),
|
|
43649
|
+
role: z30.string(),
|
|
43343
43650
|
replicaId: uuid,
|
|
43344
43651
|
expiresAt: isoTime2,
|
|
43345
43652
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
43346
43653
|
});
|
|
43347
|
-
var nexusLeaseAcquireSchema =
|
|
43348
|
-
var nexusStreamHeadSchema =
|
|
43349
|
-
streamId:
|
|
43350
|
-
kind:
|
|
43351
|
-
headSeq:
|
|
43352
|
-
headCheckpointId:
|
|
43654
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
43655
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
43656
|
+
streamId: z30.string(),
|
|
43657
|
+
kind: z30.string().optional(),
|
|
43658
|
+
headSeq: z30.number().int().nonnegative(),
|
|
43659
|
+
headCheckpointId: z30.string().nullable(),
|
|
43353
43660
|
/**
|
|
43354
43661
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
43355
43662
|
* Absent from an older server.
|
|
43356
43663
|
*/
|
|
43357
|
-
maxSchemaVersion:
|
|
43664
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
43358
43665
|
});
|
|
43359
|
-
var nexusActivityEventSchema =
|
|
43360
|
-
id:
|
|
43666
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
43667
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
43361
43668
|
at: isoTime2,
|
|
43362
|
-
actorUserId:
|
|
43363
|
-
actorDeviceId:
|
|
43364
|
-
requestId:
|
|
43365
|
-
action:
|
|
43366
|
-
target:
|
|
43367
|
-
detail:
|
|
43368
|
-
});
|
|
43369
|
-
var nexusActivityPageSchema =
|
|
43370
|
-
events:
|
|
43371
|
-
nextBefore:
|
|
43669
|
+
actorUserId: z30.string().nullable().optional(),
|
|
43670
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
43671
|
+
requestId: z30.string().nullable().optional(),
|
|
43672
|
+
action: z30.string(),
|
|
43673
|
+
target: z30.string().nullable().optional(),
|
|
43674
|
+
detail: z30.unknown().optional()
|
|
43675
|
+
});
|
|
43676
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
43677
|
+
events: z30.array(nexusActivityEventSchema),
|
|
43678
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
43372
43679
|
});
|
|
43373
43680
|
|
|
43374
43681
|
// packages/adapters/src/providers/shared/lead-tool-strip.ts
|