@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
|
@@ -14363,7 +14363,7 @@ function resolveRef(ref, ctx) {
|
|
|
14363
14363
|
function convertBaseSchema(schema, ctx) {
|
|
14364
14364
|
if (schema.not !== void 0) {
|
|
14365
14365
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
14366
|
-
return
|
|
14366
|
+
return z31.never();
|
|
14367
14367
|
}
|
|
14368
14368
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
14369
14369
|
}
|
|
@@ -14385,7 +14385,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14385
14385
|
return ctx.refs.get(refPath);
|
|
14386
14386
|
}
|
|
14387
14387
|
if (ctx.processing.has(refPath)) {
|
|
14388
|
-
return
|
|
14388
|
+
return z31.lazy(() => {
|
|
14389
14389
|
if (!ctx.refs.has(refPath)) {
|
|
14390
14390
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
14391
14391
|
}
|
|
@@ -14402,25 +14402,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14402
14402
|
if (schema.enum !== void 0) {
|
|
14403
14403
|
const enumValues = schema.enum;
|
|
14404
14404
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
14405
|
-
return
|
|
14405
|
+
return z31.null();
|
|
14406
14406
|
}
|
|
14407
14407
|
if (enumValues.length === 0) {
|
|
14408
|
-
return
|
|
14408
|
+
return z31.never();
|
|
14409
14409
|
}
|
|
14410
14410
|
if (enumValues.length === 1) {
|
|
14411
|
-
return
|
|
14411
|
+
return z31.literal(enumValues[0]);
|
|
14412
14412
|
}
|
|
14413
14413
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
14414
|
-
return
|
|
14414
|
+
return z31.enum(enumValues);
|
|
14415
14415
|
}
|
|
14416
|
-
const literalSchemas = enumValues.map((v) =>
|
|
14416
|
+
const literalSchemas = enumValues.map((v) => z31.literal(v));
|
|
14417
14417
|
if (literalSchemas.length < 2) {
|
|
14418
14418
|
return literalSchemas[0];
|
|
14419
14419
|
}
|
|
14420
|
-
return
|
|
14420
|
+
return z31.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
14421
14421
|
}
|
|
14422
14422
|
if (schema.const !== void 0) {
|
|
14423
|
-
return
|
|
14423
|
+
return z31.literal(schema.const);
|
|
14424
14424
|
}
|
|
14425
14425
|
const type = schema.type;
|
|
14426
14426
|
if (Array.isArray(type)) {
|
|
@@ -14429,68 +14429,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14429
14429
|
return convertBaseSchema(typeSchema, ctx);
|
|
14430
14430
|
});
|
|
14431
14431
|
if (typeSchemas.length === 0) {
|
|
14432
|
-
return
|
|
14432
|
+
return z31.never();
|
|
14433
14433
|
}
|
|
14434
14434
|
if (typeSchemas.length === 1) {
|
|
14435
14435
|
return typeSchemas[0];
|
|
14436
14436
|
}
|
|
14437
|
-
return
|
|
14437
|
+
return z31.union(typeSchemas);
|
|
14438
14438
|
}
|
|
14439
14439
|
if (!type) {
|
|
14440
|
-
return
|
|
14440
|
+
return z31.any();
|
|
14441
14441
|
}
|
|
14442
14442
|
let zodSchema2;
|
|
14443
14443
|
switch (type) {
|
|
14444
14444
|
case "string": {
|
|
14445
|
-
let stringSchema =
|
|
14445
|
+
let stringSchema = z31.string();
|
|
14446
14446
|
if (schema.format) {
|
|
14447
14447
|
const format = schema.format;
|
|
14448
14448
|
if (format === "email") {
|
|
14449
|
-
stringSchema = stringSchema.check(
|
|
14449
|
+
stringSchema = stringSchema.check(z31.email());
|
|
14450
14450
|
} else if (format === "uri" || format === "uri-reference") {
|
|
14451
|
-
stringSchema = stringSchema.check(
|
|
14451
|
+
stringSchema = stringSchema.check(z31.url());
|
|
14452
14452
|
} else if (format === "uuid" || format === "guid") {
|
|
14453
|
-
stringSchema = stringSchema.check(
|
|
14453
|
+
stringSchema = stringSchema.check(z31.uuid());
|
|
14454
14454
|
} else if (format === "date-time") {
|
|
14455
|
-
stringSchema = stringSchema.check(
|
|
14455
|
+
stringSchema = stringSchema.check(z31.iso.datetime());
|
|
14456
14456
|
} else if (format === "date") {
|
|
14457
|
-
stringSchema = stringSchema.check(
|
|
14457
|
+
stringSchema = stringSchema.check(z31.iso.date());
|
|
14458
14458
|
} else if (format === "time") {
|
|
14459
|
-
stringSchema = stringSchema.check(
|
|
14459
|
+
stringSchema = stringSchema.check(z31.iso.time());
|
|
14460
14460
|
} else if (format === "duration") {
|
|
14461
|
-
stringSchema = stringSchema.check(
|
|
14461
|
+
stringSchema = stringSchema.check(z31.iso.duration());
|
|
14462
14462
|
} else if (format === "ipv4") {
|
|
14463
|
-
stringSchema = stringSchema.check(
|
|
14463
|
+
stringSchema = stringSchema.check(z31.ipv4());
|
|
14464
14464
|
} else if (format === "ipv6") {
|
|
14465
|
-
stringSchema = stringSchema.check(
|
|
14465
|
+
stringSchema = stringSchema.check(z31.ipv6());
|
|
14466
14466
|
} else if (format === "mac") {
|
|
14467
|
-
stringSchema = stringSchema.check(
|
|
14467
|
+
stringSchema = stringSchema.check(z31.mac());
|
|
14468
14468
|
} else if (format === "cidr") {
|
|
14469
|
-
stringSchema = stringSchema.check(
|
|
14469
|
+
stringSchema = stringSchema.check(z31.cidrv4());
|
|
14470
14470
|
} else if (format === "cidr-v6") {
|
|
14471
|
-
stringSchema = stringSchema.check(
|
|
14471
|
+
stringSchema = stringSchema.check(z31.cidrv6());
|
|
14472
14472
|
} else if (format === "base64") {
|
|
14473
|
-
stringSchema = stringSchema.check(
|
|
14473
|
+
stringSchema = stringSchema.check(z31.base64());
|
|
14474
14474
|
} else if (format === "base64url") {
|
|
14475
|
-
stringSchema = stringSchema.check(
|
|
14475
|
+
stringSchema = stringSchema.check(z31.base64url());
|
|
14476
14476
|
} else if (format === "e164") {
|
|
14477
|
-
stringSchema = stringSchema.check(
|
|
14477
|
+
stringSchema = stringSchema.check(z31.e164());
|
|
14478
14478
|
} else if (format === "jwt") {
|
|
14479
|
-
stringSchema = stringSchema.check(
|
|
14479
|
+
stringSchema = stringSchema.check(z31.jwt());
|
|
14480
14480
|
} else if (format === "emoji") {
|
|
14481
|
-
stringSchema = stringSchema.check(
|
|
14481
|
+
stringSchema = stringSchema.check(z31.emoji());
|
|
14482
14482
|
} else if (format === "nanoid") {
|
|
14483
|
-
stringSchema = stringSchema.check(
|
|
14483
|
+
stringSchema = stringSchema.check(z31.nanoid());
|
|
14484
14484
|
} else if (format === "cuid") {
|
|
14485
|
-
stringSchema = stringSchema.check(
|
|
14485
|
+
stringSchema = stringSchema.check(z31.cuid());
|
|
14486
14486
|
} else if (format === "cuid2") {
|
|
14487
|
-
stringSchema = stringSchema.check(
|
|
14487
|
+
stringSchema = stringSchema.check(z31.cuid2());
|
|
14488
14488
|
} else if (format === "ulid") {
|
|
14489
|
-
stringSchema = stringSchema.check(
|
|
14489
|
+
stringSchema = stringSchema.check(z31.ulid());
|
|
14490
14490
|
} else if (format === "xid") {
|
|
14491
|
-
stringSchema = stringSchema.check(
|
|
14491
|
+
stringSchema = stringSchema.check(z31.xid());
|
|
14492
14492
|
} else if (format === "ksuid") {
|
|
14493
|
-
stringSchema = stringSchema.check(
|
|
14493
|
+
stringSchema = stringSchema.check(z31.ksuid());
|
|
14494
14494
|
}
|
|
14495
14495
|
}
|
|
14496
14496
|
if (typeof schema.minLength === "number") {
|
|
@@ -14507,7 +14507,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14507
14507
|
}
|
|
14508
14508
|
case "number":
|
|
14509
14509
|
case "integer": {
|
|
14510
|
-
let numberSchema = type === "integer" ?
|
|
14510
|
+
let numberSchema = type === "integer" ? z31.number().int() : z31.number();
|
|
14511
14511
|
if (typeof schema.minimum === "number") {
|
|
14512
14512
|
numberSchema = numberSchema.min(schema.minimum);
|
|
14513
14513
|
}
|
|
@@ -14531,11 +14531,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14531
14531
|
break;
|
|
14532
14532
|
}
|
|
14533
14533
|
case "boolean": {
|
|
14534
|
-
zodSchema2 =
|
|
14534
|
+
zodSchema2 = z31.boolean();
|
|
14535
14535
|
break;
|
|
14536
14536
|
}
|
|
14537
14537
|
case "null": {
|
|
14538
|
-
zodSchema2 =
|
|
14538
|
+
zodSchema2 = z31.null();
|
|
14539
14539
|
break;
|
|
14540
14540
|
}
|
|
14541
14541
|
case "object": {
|
|
@@ -14548,14 +14548,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14548
14548
|
}
|
|
14549
14549
|
if (schema.propertyNames) {
|
|
14550
14550
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
14551
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
14551
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z31.any();
|
|
14552
14552
|
if (Object.keys(shape).length === 0) {
|
|
14553
|
-
zodSchema2 =
|
|
14553
|
+
zodSchema2 = z31.record(keySchema, valueSchema);
|
|
14554
14554
|
break;
|
|
14555
14555
|
}
|
|
14556
|
-
const objectSchema2 =
|
|
14557
|
-
const recordSchema =
|
|
14558
|
-
zodSchema2 =
|
|
14556
|
+
const objectSchema2 = z31.object(shape).passthrough();
|
|
14557
|
+
const recordSchema = z31.looseRecord(keySchema, valueSchema);
|
|
14558
|
+
zodSchema2 = z31.intersection(objectSchema2, recordSchema);
|
|
14559
14559
|
break;
|
|
14560
14560
|
}
|
|
14561
14561
|
if (schema.patternProperties) {
|
|
@@ -14564,28 +14564,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14564
14564
|
const looseRecords = [];
|
|
14565
14565
|
for (const pattern of patternKeys) {
|
|
14566
14566
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
14567
|
-
const keySchema =
|
|
14568
|
-
looseRecords.push(
|
|
14567
|
+
const keySchema = z31.string().regex(new RegExp(pattern));
|
|
14568
|
+
looseRecords.push(z31.looseRecord(keySchema, patternValue));
|
|
14569
14569
|
}
|
|
14570
14570
|
const schemasToIntersect = [];
|
|
14571
14571
|
if (Object.keys(shape).length > 0) {
|
|
14572
|
-
schemasToIntersect.push(
|
|
14572
|
+
schemasToIntersect.push(z31.object(shape).passthrough());
|
|
14573
14573
|
}
|
|
14574
14574
|
schemasToIntersect.push(...looseRecords);
|
|
14575
14575
|
if (schemasToIntersect.length === 0) {
|
|
14576
|
-
zodSchema2 =
|
|
14576
|
+
zodSchema2 = z31.object({}).passthrough();
|
|
14577
14577
|
} else if (schemasToIntersect.length === 1) {
|
|
14578
14578
|
zodSchema2 = schemasToIntersect[0];
|
|
14579
14579
|
} else {
|
|
14580
|
-
let result =
|
|
14580
|
+
let result = z31.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
14581
14581
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
14582
|
-
result =
|
|
14582
|
+
result = z31.intersection(result, schemasToIntersect[i]);
|
|
14583
14583
|
}
|
|
14584
14584
|
zodSchema2 = result;
|
|
14585
14585
|
}
|
|
14586
14586
|
break;
|
|
14587
14587
|
}
|
|
14588
|
-
const objectSchema =
|
|
14588
|
+
const objectSchema = z31.object(shape);
|
|
14589
14589
|
if (schema.additionalProperties === false) {
|
|
14590
14590
|
zodSchema2 = objectSchema.strict();
|
|
14591
14591
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -14602,33 +14602,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14602
14602
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
14603
14603
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
14604
14604
|
if (rest) {
|
|
14605
|
-
zodSchema2 =
|
|
14605
|
+
zodSchema2 = z31.tuple(tupleItems).rest(rest);
|
|
14606
14606
|
} else {
|
|
14607
|
-
zodSchema2 =
|
|
14607
|
+
zodSchema2 = z31.tuple(tupleItems);
|
|
14608
14608
|
}
|
|
14609
14609
|
if (typeof schema.minItems === "number") {
|
|
14610
|
-
zodSchema2 = zodSchema2.check(
|
|
14610
|
+
zodSchema2 = zodSchema2.check(z31.minLength(schema.minItems));
|
|
14611
14611
|
}
|
|
14612
14612
|
if (typeof schema.maxItems === "number") {
|
|
14613
|
-
zodSchema2 = zodSchema2.check(
|
|
14613
|
+
zodSchema2 = zodSchema2.check(z31.maxLength(schema.maxItems));
|
|
14614
14614
|
}
|
|
14615
14615
|
} else if (Array.isArray(items)) {
|
|
14616
14616
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
14617
14617
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
14618
14618
|
if (rest) {
|
|
14619
|
-
zodSchema2 =
|
|
14619
|
+
zodSchema2 = z31.tuple(tupleItems).rest(rest);
|
|
14620
14620
|
} else {
|
|
14621
|
-
zodSchema2 =
|
|
14621
|
+
zodSchema2 = z31.tuple(tupleItems);
|
|
14622
14622
|
}
|
|
14623
14623
|
if (typeof schema.minItems === "number") {
|
|
14624
|
-
zodSchema2 = zodSchema2.check(
|
|
14624
|
+
zodSchema2 = zodSchema2.check(z31.minLength(schema.minItems));
|
|
14625
14625
|
}
|
|
14626
14626
|
if (typeof schema.maxItems === "number") {
|
|
14627
|
-
zodSchema2 = zodSchema2.check(
|
|
14627
|
+
zodSchema2 = zodSchema2.check(z31.maxLength(schema.maxItems));
|
|
14628
14628
|
}
|
|
14629
14629
|
} else if (items !== void 0) {
|
|
14630
14630
|
const element = convertSchema(items, ctx);
|
|
14631
|
-
let arraySchema =
|
|
14631
|
+
let arraySchema = z31.array(element);
|
|
14632
14632
|
if (typeof schema.minItems === "number") {
|
|
14633
14633
|
arraySchema = arraySchema.min(schema.minItems);
|
|
14634
14634
|
}
|
|
@@ -14637,7 +14637,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14637
14637
|
}
|
|
14638
14638
|
zodSchema2 = arraySchema;
|
|
14639
14639
|
} else {
|
|
14640
|
-
zodSchema2 =
|
|
14640
|
+
zodSchema2 = z31.array(z31.any());
|
|
14641
14641
|
}
|
|
14642
14642
|
break;
|
|
14643
14643
|
}
|
|
@@ -14654,37 +14654,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14654
14654
|
}
|
|
14655
14655
|
function convertSchema(schema, ctx) {
|
|
14656
14656
|
if (typeof schema === "boolean") {
|
|
14657
|
-
return schema ?
|
|
14657
|
+
return schema ? z31.any() : z31.never();
|
|
14658
14658
|
}
|
|
14659
14659
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
14660
14660
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
14661
14661
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
14662
14662
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
14663
|
-
const anyOfUnion =
|
|
14664
|
-
baseSchema = hasExplicitType ?
|
|
14663
|
+
const anyOfUnion = z31.union(options);
|
|
14664
|
+
baseSchema = hasExplicitType ? z31.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
14665
14665
|
}
|
|
14666
14666
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
14667
14667
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
14668
|
-
const oneOfUnion =
|
|
14669
|
-
baseSchema = hasExplicitType ?
|
|
14668
|
+
const oneOfUnion = z31.xor(options);
|
|
14669
|
+
baseSchema = hasExplicitType ? z31.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
14670
14670
|
}
|
|
14671
14671
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
14672
14672
|
if (schema.allOf.length === 0) {
|
|
14673
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
14673
|
+
baseSchema = hasExplicitType ? baseSchema : z31.any();
|
|
14674
14674
|
} else {
|
|
14675
14675
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
14676
14676
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
14677
14677
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
14678
|
-
result =
|
|
14678
|
+
result = z31.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
14679
14679
|
}
|
|
14680
14680
|
baseSchema = result;
|
|
14681
14681
|
}
|
|
14682
14682
|
}
|
|
14683
14683
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
14684
|
-
baseSchema =
|
|
14684
|
+
baseSchema = z31.nullable(baseSchema);
|
|
14685
14685
|
}
|
|
14686
14686
|
if (schema.readOnly === true) {
|
|
14687
|
-
baseSchema =
|
|
14687
|
+
baseSchema = z31.readonly(baseSchema);
|
|
14688
14688
|
}
|
|
14689
14689
|
const extraMeta = {};
|
|
14690
14690
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -14711,7 +14711,7 @@ function convertSchema(schema, ctx) {
|
|
|
14711
14711
|
}
|
|
14712
14712
|
function fromJSONSchema(schema, params) {
|
|
14713
14713
|
if (typeof schema === "boolean") {
|
|
14714
|
-
return schema ?
|
|
14714
|
+
return schema ? z31.any() : z31.never();
|
|
14715
14715
|
}
|
|
14716
14716
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
14717
14717
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -14725,14 +14725,14 @@ function fromJSONSchema(schema, params) {
|
|
|
14725
14725
|
};
|
|
14726
14726
|
return convertSchema(schema, ctx);
|
|
14727
14727
|
}
|
|
14728
|
-
var
|
|
14728
|
+
var z31, RECOGNIZED_KEYS;
|
|
14729
14729
|
var init_from_json_schema = __esm({
|
|
14730
14730
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
14731
14731
|
init_registries();
|
|
14732
14732
|
init_checks2();
|
|
14733
14733
|
init_iso();
|
|
14734
14734
|
init_schemas2();
|
|
14735
|
-
|
|
14735
|
+
z31 = {
|
|
14736
14736
|
...schemas_exports2,
|
|
14737
14737
|
...checks_exports2,
|
|
14738
14738
|
iso: iso_exports
|
|
@@ -26874,17 +26874,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
26874
26874
|
});
|
|
26875
26875
|
|
|
26876
26876
|
// packages/contracts/src/config/manifest.ts
|
|
26877
|
-
import { z as
|
|
26877
|
+
import { z as z6 } from "zod";
|
|
26878
26878
|
|
|
26879
|
-
// packages/contracts/src/
|
|
26879
|
+
// packages/contracts/src/orca-execution.ts
|
|
26880
26880
|
import { z as z4 } from "zod";
|
|
26881
|
-
var
|
|
26882
|
-
|
|
26883
|
-
|
|
26884
|
-
|
|
26881
|
+
var identifier = z4.string().min(1);
|
|
26882
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
26883
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
26884
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
26885
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
26886
|
+
});
|
|
26887
|
+
var orcaContextSchema = z4.object({
|
|
26888
|
+
runtimeId: identifier,
|
|
26889
|
+
coordinatorHandle: identifier,
|
|
26890
|
+
executionHostId: z4.literal("local")
|
|
26891
|
+
});
|
|
26892
|
+
var orcaRoutingRunSchema = z4.object({
|
|
26893
|
+
runId: identifier.nullable(),
|
|
26894
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
26895
|
+
});
|
|
26896
|
+
var orcaLaunchSchema = z4.object({
|
|
26897
|
+
projectId: identifier,
|
|
26898
|
+
projectRoot: identifier,
|
|
26899
|
+
taskId: identifier,
|
|
26900
|
+
instanceId: identifier,
|
|
26901
|
+
workerSessionId: identifier,
|
|
26902
|
+
agentId: identifier,
|
|
26903
|
+
role: z4.enum(["worker", "lead"]),
|
|
26904
|
+
protocol: identifier,
|
|
26905
|
+
worktreePath: identifier,
|
|
26906
|
+
worktreeBranch: identifier,
|
|
26907
|
+
projectHash: identifier,
|
|
26908
|
+
lockToken: identifier,
|
|
26909
|
+
prompt: identifier,
|
|
26910
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
26911
|
+
leadMailbox: identifier.nullable(),
|
|
26912
|
+
model: identifier.optional(),
|
|
26913
|
+
effort: identifier.optional(),
|
|
26914
|
+
accountId: identifier.optional()
|
|
26915
|
+
});
|
|
26916
|
+
var orcaStartBindingSchema = z4.object({
|
|
26917
|
+
runId: identifier.nullable(),
|
|
26918
|
+
orcaTaskId: identifier.nullable(),
|
|
26919
|
+
retryOf: identifier.nullable()
|
|
26920
|
+
});
|
|
26921
|
+
var orcaAttemptSchema = z4.object({
|
|
26922
|
+
backend: z4.literal("orca"),
|
|
26923
|
+
version: z4.literal(1),
|
|
26924
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
26925
|
+
revision: z4.number().int().nonnegative(),
|
|
26926
|
+
context: orcaContextSchema,
|
|
26927
|
+
launch: orcaLaunchSchema,
|
|
26928
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26929
|
+
workspaceId: identifier,
|
|
26930
|
+
workspaceSelector: identifier,
|
|
26931
|
+
state: z4.enum([
|
|
26932
|
+
"prepared",
|
|
26933
|
+
"launching",
|
|
26934
|
+
"ready",
|
|
26935
|
+
"turn_unobserved",
|
|
26936
|
+
"outcome_unknown",
|
|
26937
|
+
"stop_pending",
|
|
26938
|
+
"stop_unknown",
|
|
26939
|
+
"stopped",
|
|
26940
|
+
"failed",
|
|
26941
|
+
"circuit_broken"
|
|
26942
|
+
]),
|
|
26943
|
+
runId: identifier.nullable(),
|
|
26944
|
+
orcaTaskId: identifier.nullable(),
|
|
26945
|
+
dispatchId: identifier.nullable(),
|
|
26946
|
+
retryOf: identifier.nullable(),
|
|
26947
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
26948
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
26949
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
26950
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
26951
|
+
startRequestId: identifier.nullable(),
|
|
26952
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
26953
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
26954
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
26955
|
+
stopRequestId: identifier.nullable(),
|
|
26956
|
+
/**
|
|
26957
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
26958
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
26959
|
+
*/
|
|
26960
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
26961
|
+
failureCount: z4.number().int().nonnegative(),
|
|
26962
|
+
resourceState: z4.string(),
|
|
26963
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
26964
|
+
lastReceipt: z4.string().nullable(),
|
|
26965
|
+
lastError: z4.string().nullable(),
|
|
26966
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
26967
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
26968
|
+
observedAt: z4.string()
|
|
26969
|
+
});
|
|
26970
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
26971
|
+
messageId: identifier,
|
|
26972
|
+
runtimeId: identifier,
|
|
26973
|
+
runId: identifier,
|
|
26974
|
+
orcaTaskId: identifier,
|
|
26975
|
+
dispatchId: identifier,
|
|
26976
|
+
senderHandle: identifier,
|
|
26977
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
26978
|
+
body: z4.string(),
|
|
26979
|
+
reportPath: identifier
|
|
26980
|
+
});
|
|
26981
|
+
var orcaWorkerReportSchema = z4.object({
|
|
26982
|
+
event: orcaWorkerDoneSchema,
|
|
26983
|
+
manifestId: identifier,
|
|
26984
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26985
|
+
reportText: z4.string().min(1).max(65536),
|
|
26986
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26987
|
+
ingestedAt: z4.string().datetime()
|
|
26988
|
+
});
|
|
26989
|
+
var orcaReportDeliverySchema = z4.object({
|
|
26990
|
+
key: identifier,
|
|
26991
|
+
mailbox: identifier.nullable(),
|
|
26992
|
+
state: z4.enum(["pending", "delivered"]),
|
|
26993
|
+
messageId: identifier.nullable(),
|
|
26994
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
26995
|
+
lastError: z4.string().nullable()
|
|
26996
|
+
});
|
|
26997
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
26998
|
+
resourceRelease: z4.object({
|
|
26999
|
+
dispatchId: identifier,
|
|
27000
|
+
releasedAt: z4.string().datetime(),
|
|
27001
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
27002
|
+
receipt: identifier
|
|
27003
|
+
}).optional(),
|
|
27004
|
+
retiredAt: z4.string().datetime().optional(),
|
|
27005
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
27006
|
+
});
|
|
27007
|
+
var orcaReportMessageSchema = z4.object({
|
|
27008
|
+
id: identifier,
|
|
27009
|
+
run_id: z4.string().nullable(),
|
|
27010
|
+
delivery_contract: z4.string(),
|
|
27011
|
+
from_handle: z4.string(),
|
|
27012
|
+
to_handle: z4.string(),
|
|
27013
|
+
type: z4.string(),
|
|
27014
|
+
body: z4.string(),
|
|
27015
|
+
payload: z4.string().nullable(),
|
|
27016
|
+
sender_pane_key: z4.string().nullable()
|
|
27017
|
+
});
|
|
27018
|
+
var orcaReportSourceSchema = z4.object({
|
|
27019
|
+
ok: z4.literal(true),
|
|
27020
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
27021
|
+
result: z4.object({
|
|
27022
|
+
messages: z4.array(z4.json()).optional(),
|
|
27023
|
+
dispatch: z4.object({
|
|
27024
|
+
id: identifier,
|
|
27025
|
+
run_id: identifier,
|
|
27026
|
+
task_id: identifier,
|
|
27027
|
+
assignee_handle: identifier,
|
|
27028
|
+
assignee_pane_key: z4.string().nullable(),
|
|
27029
|
+
status: z4.string()
|
|
27030
|
+
}).optional()
|
|
27031
|
+
})
|
|
27032
|
+
});
|
|
27033
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
27034
|
+
taskId: identifier,
|
|
27035
|
+
dispatchId: identifier,
|
|
27036
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
27037
|
+
reportPath: identifier
|
|
27038
|
+
});
|
|
27039
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
27040
|
+
action: z4.enum([
|
|
27041
|
+
"show",
|
|
27042
|
+
"read",
|
|
27043
|
+
"recover-start",
|
|
27044
|
+
"recover-stop",
|
|
27045
|
+
"retry",
|
|
27046
|
+
"stop",
|
|
27047
|
+
"ingest-report",
|
|
27048
|
+
"relay-report"
|
|
27049
|
+
]),
|
|
27050
|
+
recordId: identifier,
|
|
27051
|
+
cursor: identifier.optional(),
|
|
27052
|
+
messageId: identifier.optional()
|
|
27053
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
27054
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
27055
|
+
path: ["cursor"]
|
|
27056
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
27057
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
27058
|
+
path: ["messageId"]
|
|
27059
|
+
});
|
|
27060
|
+
var effectSchema = z4.object({
|
|
27061
|
+
kind: z4.string(),
|
|
27062
|
+
role: z4.string().optional(),
|
|
27063
|
+
action: z4.string().optional(),
|
|
27064
|
+
id: z4.string().optional()
|
|
27065
|
+
});
|
|
27066
|
+
var selectionSchema = z4.object({
|
|
27067
|
+
agent: z4.string().nullable().optional(),
|
|
27068
|
+
model: z4.string().nullable().optional(),
|
|
27069
|
+
effort: z4.string().nullable().optional()
|
|
27070
|
+
});
|
|
27071
|
+
var orcaReplySchema = z4.object({
|
|
27072
|
+
ok: z4.boolean(),
|
|
27073
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
27074
|
+
error: z4.object({
|
|
27075
|
+
code: z4.string(),
|
|
27076
|
+
message: z4.string(),
|
|
27077
|
+
data: z4.object({
|
|
27078
|
+
requestId: identifier.optional(),
|
|
27079
|
+
orchestrationRequestId: identifier.optional(),
|
|
27080
|
+
dispatchId: identifier.optional()
|
|
27081
|
+
}).optional()
|
|
27082
|
+
}).optional(),
|
|
27083
|
+
result: z4.object({
|
|
27084
|
+
state: z4.string().optional(),
|
|
27085
|
+
requestId: identifier.optional(),
|
|
27086
|
+
/**
|
|
27087
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
27088
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
27089
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
27090
|
+
* be bound to the request key this attempt issued.
|
|
27091
|
+
*/
|
|
27092
|
+
mutation: z4.object({
|
|
27093
|
+
requestId: identifier.optional(),
|
|
27094
|
+
replayed: z4.boolean().optional()
|
|
27095
|
+
}).optional(),
|
|
27096
|
+
stage: z4.string().optional(),
|
|
27097
|
+
turnStart: z4.string().optional(),
|
|
27098
|
+
runId: identifier.optional(),
|
|
27099
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
27100
|
+
taskId: identifier.optional(),
|
|
27101
|
+
dispatchId: identifier.optional(),
|
|
27102
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
27103
|
+
effects: z4.array(effectSchema).optional(),
|
|
27104
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
27105
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
27106
|
+
lastError: z4.string().nullable().optional(),
|
|
27107
|
+
processAction: z4.string().optional(),
|
|
27108
|
+
helpers: z4.array(
|
|
27109
|
+
z4.object({
|
|
27110
|
+
dispatchId: identifier.optional(),
|
|
27111
|
+
creatorDispatchId: identifier.optional(),
|
|
27112
|
+
outcome: z4.string(),
|
|
27113
|
+
keptOpenBy: identifier.optional(),
|
|
27114
|
+
state: z4.string().optional(),
|
|
27115
|
+
lastError: z4.string().nullable().optional()
|
|
27116
|
+
})
|
|
27117
|
+
).optional(),
|
|
27118
|
+
helperStopError: z4.string().nullable().optional(),
|
|
27119
|
+
status: z4.string().optional(),
|
|
27120
|
+
terminal: z4.object({
|
|
27121
|
+
handle: identifier,
|
|
27122
|
+
connected: z4.boolean(),
|
|
27123
|
+
writable: z4.boolean(),
|
|
27124
|
+
executionHostId: identifier
|
|
27125
|
+
}).optional(),
|
|
27126
|
+
runtime: z4.object({
|
|
27127
|
+
runtimeId: identifier,
|
|
27128
|
+
reachable: z4.boolean(),
|
|
27129
|
+
state: z4.string(),
|
|
27130
|
+
capabilities: z4.array(z4.string())
|
|
27131
|
+
}).optional(),
|
|
27132
|
+
worktree: z4.object({
|
|
27133
|
+
id: identifier,
|
|
27134
|
+
path: identifier,
|
|
27135
|
+
branch: identifier,
|
|
27136
|
+
hostId: identifier,
|
|
27137
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
27138
|
+
}).optional(),
|
|
27139
|
+
dispatch: z4.object({
|
|
27140
|
+
id: identifier,
|
|
27141
|
+
runId: identifier,
|
|
27142
|
+
taskId: identifier,
|
|
27143
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
27144
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
27145
|
+
failureCount: z4.number().int().nonnegative()
|
|
27146
|
+
}).optional(),
|
|
27147
|
+
worker: z4.object({
|
|
27148
|
+
dispatchId: identifier,
|
|
27149
|
+
runtimeEpoch: identifier,
|
|
27150
|
+
state: z4.string(),
|
|
27151
|
+
stage: z4.string(),
|
|
27152
|
+
worktreeId: identifier.nullable()
|
|
27153
|
+
}).optional(),
|
|
27154
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
27155
|
+
projection: z4.object({
|
|
27156
|
+
resource: z4.object({
|
|
27157
|
+
state: z4.string(),
|
|
27158
|
+
terminalState: z4.string(),
|
|
27159
|
+
ownerDispatchId: identifier.optional(),
|
|
27160
|
+
releaseState: z4.string().optional()
|
|
27161
|
+
}).optional()
|
|
27162
|
+
}).optional()
|
|
27163
|
+
}).optional()
|
|
27164
|
+
});
|
|
27165
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
27166
|
+
schemaVersion: z4.number().int().positive(),
|
|
27167
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
27168
|
+
});
|
|
27169
|
+
var accountProviderSchema = z4.object({
|
|
27170
|
+
accounts: z4.array(z4.object({})),
|
|
27171
|
+
activeAccountId: identifier.nullable()
|
|
27172
|
+
});
|
|
27173
|
+
var orcaAccountReplySchema = z4.object({
|
|
27174
|
+
ok: z4.literal(true),
|
|
27175
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
27176
|
+
result: z4.object({
|
|
27177
|
+
codex: accountProviderSchema,
|
|
27178
|
+
opencode: accountProviderSchema,
|
|
27179
|
+
claude: accountProviderSchema
|
|
27180
|
+
})
|
|
27181
|
+
});
|
|
27182
|
+
|
|
27183
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
27184
|
+
import { z as z5 } from "zod";
|
|
27185
|
+
var projectWorkerPolicySchema = z5.object({
|
|
27186
|
+
verification: z5.object({
|
|
27187
|
+
full: z5.enum(["local", "ci"]),
|
|
27188
|
+
local: z5.enum(["single-file", "affected"])
|
|
26885
27189
|
}).strict().optional(),
|
|
26886
|
-
instructions:
|
|
26887
|
-
|
|
27190
|
+
instructions: z5.array(
|
|
27191
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
26888
27192
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
26889
27193
|
"Instructions must be single-line text without control characters or a leading #"
|
|
26890
27194
|
)
|
|
@@ -26912,8 +27216,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
26912
27216
|
path: ".cleo/config.json",
|
|
26913
27217
|
mergePrecedence: 20,
|
|
26914
27218
|
driftDetection: "schema-validate",
|
|
26915
|
-
schema:
|
|
26916
|
-
orchestrate:
|
|
27219
|
+
schema: z6.object({
|
|
27220
|
+
orchestrate: z6.object({
|
|
27221
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
27222
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
27223
|
+
}).passthrough().optional()
|
|
26917
27224
|
}).passthrough()
|
|
26918
27225
|
};
|
|
26919
27226
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -26929,19 +27236,19 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
26929
27236
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
26930
27237
|
CLEO_CONFIG_MANIFEST
|
|
26931
27238
|
]);
|
|
26932
|
-
var configManifestEntrySchema =
|
|
26933
|
-
id:
|
|
26934
|
-
scope:
|
|
26935
|
-
path:
|
|
26936
|
-
schema:
|
|
26937
|
-
mergePrecedence:
|
|
26938
|
-
driftDetection:
|
|
26939
|
-
|
|
26940
|
-
|
|
26941
|
-
|
|
26942
|
-
|
|
27239
|
+
var configManifestEntrySchema = z6.object({
|
|
27240
|
+
id: z6.string().min(1),
|
|
27241
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
27242
|
+
path: z6.string().min(1),
|
|
27243
|
+
schema: z6.unknown().optional(),
|
|
27244
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
27245
|
+
driftDetection: z6.union([
|
|
27246
|
+
z6.literal("schema-validate"),
|
|
27247
|
+
z6.literal("staleness-gate"),
|
|
27248
|
+
z6.literal("value-diff"),
|
|
27249
|
+
z6.literal("none")
|
|
26943
27250
|
]),
|
|
26944
|
-
defaults:
|
|
27251
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
26945
27252
|
});
|
|
26946
27253
|
|
|
26947
27254
|
// packages/contracts/src/credentials.ts
|
|
@@ -26971,123 +27278,123 @@ function parseClaudeCodeCredentials(buf) {
|
|
|
26971
27278
|
}
|
|
26972
27279
|
|
|
26973
27280
|
// packages/contracts/src/daemon/health.ts
|
|
26974
|
-
import { z as
|
|
27281
|
+
import { z as z8 } from "zod";
|
|
26975
27282
|
|
|
26976
27283
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
26977
|
-
import { z as
|
|
26978
|
-
var EnvPairSchema =
|
|
27284
|
+
import { z as z7 } from "zod";
|
|
27285
|
+
var EnvPairSchema = z7.object({
|
|
26979
27286
|
/** Environment variable name. */
|
|
26980
|
-
key:
|
|
27287
|
+
key: z7.string().min(1),
|
|
26981
27288
|
/** Environment variable value. */
|
|
26982
|
-
value:
|
|
27289
|
+
value: z7.string()
|
|
26983
27290
|
}).strict();
|
|
26984
|
-
var ChildStateSchema =
|
|
26985
|
-
var ChildStatusSchema =
|
|
27291
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
27292
|
+
var ChildStatusSchema = z7.object({
|
|
26986
27293
|
/** Logical id of the child (stable across restarts). */
|
|
26987
|
-
child_id:
|
|
27294
|
+
child_id: z7.string().min(1),
|
|
26988
27295
|
/** Current OS pid (0 when not currently running). */
|
|
26989
|
-
pid:
|
|
27296
|
+
pid: z7.number().int().nonnegative(),
|
|
26990
27297
|
/** Current liveness state. */
|
|
26991
27298
|
state: ChildStateSchema,
|
|
26992
27299
|
/** Total restarts observed for this child. */
|
|
26993
|
-
restart_count:
|
|
27300
|
+
restart_count: z7.number().int().nonnegative()
|
|
26994
27301
|
}).strict();
|
|
26995
|
-
var SpawnRequestSchema =
|
|
27302
|
+
var SpawnRequestSchema = z7.object({
|
|
26996
27303
|
/** Tag discriminating this request variant. */
|
|
26997
|
-
kind:
|
|
27304
|
+
kind: z7.literal("spawn"),
|
|
26998
27305
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
26999
|
-
child_id:
|
|
27306
|
+
child_id: z7.string().min(1),
|
|
27000
27307
|
/** Absolute path to the program to execute. */
|
|
27001
|
-
program:
|
|
27308
|
+
program: z7.string().min(1),
|
|
27002
27309
|
/** Arguments passed to the program. */
|
|
27003
|
-
args:
|
|
27310
|
+
args: z7.array(z7.string()).default([]),
|
|
27004
27311
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
27005
|
-
env:
|
|
27312
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
27006
27313
|
/** Optional working directory for the child. */
|
|
27007
|
-
cwd:
|
|
27314
|
+
cwd: z7.string().optional()
|
|
27008
27315
|
}).strict();
|
|
27009
|
-
var RestartRequestSchema =
|
|
27316
|
+
var RestartRequestSchema = z7.object({
|
|
27010
27317
|
/** Tag discriminating this request variant. */
|
|
27011
|
-
kind:
|
|
27318
|
+
kind: z7.literal("restart"),
|
|
27012
27319
|
/** Logical id of the child to restart. */
|
|
27013
|
-
child_id:
|
|
27320
|
+
child_id: z7.string().min(1)
|
|
27014
27321
|
}).strict();
|
|
27015
|
-
var MonitorRequestSchema =
|
|
27322
|
+
var MonitorRequestSchema = z7.object({
|
|
27016
27323
|
/** Tag discriminating this request variant. */
|
|
27017
|
-
kind:
|
|
27324
|
+
kind: z7.literal("monitor"),
|
|
27018
27325
|
/** Specific child id to monitor; omit to request all children. */
|
|
27019
|
-
child_id:
|
|
27326
|
+
child_id: z7.string().optional()
|
|
27020
27327
|
}).strict();
|
|
27021
|
-
var HealthRequestSchema =
|
|
27328
|
+
var HealthRequestSchema = z7.object({
|
|
27022
27329
|
/** Tag discriminating this request variant. */
|
|
27023
|
-
kind:
|
|
27330
|
+
kind: z7.literal("health")
|
|
27024
27331
|
}).strict();
|
|
27025
|
-
var SupervisorIpcRequestSchema =
|
|
27332
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
27026
27333
|
SpawnRequestSchema,
|
|
27027
27334
|
RestartRequestSchema,
|
|
27028
27335
|
MonitorRequestSchema,
|
|
27029
27336
|
HealthRequestSchema
|
|
27030
27337
|
]);
|
|
27031
|
-
var SpawnedResponseSchema =
|
|
27338
|
+
var SpawnedResponseSchema = z7.object({
|
|
27032
27339
|
/** Tag discriminating this response variant. */
|
|
27033
|
-
kind:
|
|
27340
|
+
kind: z7.literal("spawned"),
|
|
27034
27341
|
/** Logical id of the spawned child. */
|
|
27035
|
-
child_id:
|
|
27342
|
+
child_id: z7.string().min(1),
|
|
27036
27343
|
/** OS pid assigned to the spawned child. */
|
|
27037
|
-
pid:
|
|
27344
|
+
pid: z7.number().int().nonnegative()
|
|
27038
27345
|
}).strict();
|
|
27039
|
-
var RestartedResponseSchema =
|
|
27346
|
+
var RestartedResponseSchema = z7.object({
|
|
27040
27347
|
/** Tag discriminating this response variant. */
|
|
27041
|
-
kind:
|
|
27348
|
+
kind: z7.literal("restarted"),
|
|
27042
27349
|
/** Logical id of the restarted child. */
|
|
27043
|
-
child_id:
|
|
27350
|
+
child_id: z7.string().min(1),
|
|
27044
27351
|
/** New OS pid after the restart. */
|
|
27045
|
-
pid:
|
|
27352
|
+
pid: z7.number().int().nonnegative(),
|
|
27046
27353
|
/** Number of times this child has been restarted in total. */
|
|
27047
|
-
restart_count:
|
|
27354
|
+
restart_count: z7.number().int().nonnegative()
|
|
27048
27355
|
}).strict();
|
|
27049
|
-
var MonitorResponseSchema =
|
|
27356
|
+
var MonitorResponseSchema = z7.object({
|
|
27050
27357
|
/** Tag discriminating this response variant. */
|
|
27051
|
-
kind:
|
|
27358
|
+
kind: z7.literal("monitor"),
|
|
27052
27359
|
/** One row per monitored child. */
|
|
27053
|
-
children:
|
|
27360
|
+
children: z7.array(ChildStatusSchema)
|
|
27054
27361
|
}).strict();
|
|
27055
|
-
var HealthResponseSchema =
|
|
27362
|
+
var HealthResponseSchema = z7.object({
|
|
27056
27363
|
/** Tag discriminating this response variant. */
|
|
27057
|
-
kind:
|
|
27364
|
+
kind: z7.literal("health"),
|
|
27058
27365
|
/** Supervisor process pid. */
|
|
27059
|
-
pid:
|
|
27366
|
+
pid: z7.number().int().nonnegative(),
|
|
27060
27367
|
/** Number of children currently tracked. */
|
|
27061
|
-
child_count:
|
|
27368
|
+
child_count: z7.number().int().nonnegative(),
|
|
27062
27369
|
/** Seconds the supervisor has been running. */
|
|
27063
|
-
uptime_secs:
|
|
27370
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
27064
27371
|
/** Frozen protocol version the supervisor speaks. */
|
|
27065
|
-
protocol_version:
|
|
27372
|
+
protocol_version: z7.string()
|
|
27066
27373
|
}).strict();
|
|
27067
|
-
var LifecycleEventKindSchema =
|
|
27068
|
-
var LifecycleEventResponseSchema =
|
|
27374
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
27375
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
27069
27376
|
/** Tag discriminating this response variant. */
|
|
27070
|
-
kind:
|
|
27377
|
+
kind: z7.literal("event"),
|
|
27071
27378
|
/** What happened. */
|
|
27072
27379
|
event: LifecycleEventKindSchema,
|
|
27073
27380
|
/** Logical id of the affected child. */
|
|
27074
|
-
child_id:
|
|
27381
|
+
child_id: z7.string().min(1),
|
|
27075
27382
|
/** Exit code, when the OS reported one. */
|
|
27076
|
-
exit_code:
|
|
27383
|
+
exit_code: z7.number().int().optional(),
|
|
27077
27384
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
27078
|
-
signal:
|
|
27385
|
+
signal: z7.string().optional(),
|
|
27079
27386
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
27080
|
-
restart_delay_ms:
|
|
27387
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
27081
27388
|
}).strict();
|
|
27082
|
-
var ErrorResponseSchema =
|
|
27389
|
+
var ErrorResponseSchema = z7.object({
|
|
27083
27390
|
/** Tag discriminating this response variant. */
|
|
27084
|
-
kind:
|
|
27391
|
+
kind: z7.literal("error"),
|
|
27085
27392
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
27086
|
-
code:
|
|
27393
|
+
code: z7.string().min(1),
|
|
27087
27394
|
/** Human-readable error message. */
|
|
27088
|
-
message:
|
|
27395
|
+
message: z7.string()
|
|
27089
27396
|
}).strict();
|
|
27090
|
-
var SupervisorIpcResponseSchema =
|
|
27397
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
27091
27398
|
SpawnedResponseSchema,
|
|
27092
27399
|
RestartedResponseSchema,
|
|
27093
27400
|
MonitorResponseSchema,
|
|
@@ -27095,27 +27402,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
27095
27402
|
LifecycleEventResponseSchema,
|
|
27096
27403
|
ErrorResponseSchema
|
|
27097
27404
|
]);
|
|
27098
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
27405
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
27099
27406
|
/** Frozen protocol version. */
|
|
27100
|
-
protocol_version:
|
|
27407
|
+
protocol_version: z7.string(),
|
|
27101
27408
|
/** Correlation id echoed back on the matching response. */
|
|
27102
|
-
id:
|
|
27409
|
+
id: z7.string().min(1),
|
|
27103
27410
|
/** Direction discriminator. */
|
|
27104
|
-
direction:
|
|
27411
|
+
direction: z7.literal("request"),
|
|
27105
27412
|
/** The request body. */
|
|
27106
27413
|
request: SupervisorIpcRequestSchema
|
|
27107
27414
|
}).strict();
|
|
27108
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
27415
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
27109
27416
|
/** Frozen protocol version. */
|
|
27110
|
-
protocol_version:
|
|
27417
|
+
protocol_version: z7.string(),
|
|
27111
27418
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
27112
|
-
id:
|
|
27419
|
+
id: z7.string().min(1),
|
|
27113
27420
|
/** Direction discriminator. */
|
|
27114
|
-
direction:
|
|
27421
|
+
direction: z7.literal("response"),
|
|
27115
27422
|
/** The response body. */
|
|
27116
27423
|
response: SupervisorIpcResponseSchema
|
|
27117
27424
|
}).strict();
|
|
27118
|
-
var SupervisorIpcEnvelopeSchema =
|
|
27425
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
27119
27426
|
SupervisorIpcRequestEnvelopeSchema,
|
|
27120
27427
|
SupervisorIpcResponseEnvelopeSchema
|
|
27121
27428
|
]);
|
|
@@ -27139,17 +27446,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
27139
27446
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
27140
27447
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
27141
27448
|
*/
|
|
27142
|
-
detail:
|
|
27449
|
+
detail: z8.string().optional()
|
|
27143
27450
|
}).strict();
|
|
27144
|
-
var HealthStatusSchema =
|
|
27451
|
+
var HealthStatusSchema = z8.object({
|
|
27145
27452
|
/** One health row per registered subsystem. */
|
|
27146
|
-
subsystems:
|
|
27453
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
27147
27454
|
/**
|
|
27148
27455
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
27149
27456
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
27150
27457
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
27151
27458
|
*/
|
|
27152
|
-
allHealthy:
|
|
27459
|
+
allHealthy: z8.boolean()
|
|
27153
27460
|
}).strict();
|
|
27154
27461
|
|
|
27155
27462
|
// packages/contracts/src/db-inventory.json
|
|
@@ -39078,7 +39385,7 @@ var OPERATIONS = [
|
|
|
39078
39385
|
];
|
|
39079
39386
|
|
|
39080
39387
|
// packages/contracts/src/docs/modernize.ts
|
|
39081
|
-
import { z as
|
|
39388
|
+
import { z as z9 } from "zod";
|
|
39082
39389
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
39083
39390
|
var DOCS_MODERNIZE_OPS = [
|
|
39084
39391
|
"ingest",
|
|
@@ -39092,105 +39399,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
39092
39399
|
"reslug",
|
|
39093
39400
|
"link-task"
|
|
39094
39401
|
];
|
|
39095
|
-
var judgmentSchema =
|
|
39096
|
-
question:
|
|
39097
|
-
site:
|
|
39098
|
-
mode:
|
|
39099
|
-
ruleAnswer:
|
|
39100
|
-
decidedAnswer:
|
|
39101
|
-
decidedConfidence:
|
|
39102
|
-
source:
|
|
39103
|
-
acted:
|
|
39104
|
-
});
|
|
39105
|
-
var relPath =
|
|
39106
|
-
var docsModernizePlanSchema =
|
|
39107
|
-
root:
|
|
39108
|
-
generatedAt:
|
|
39109
|
-
mode:
|
|
39110
|
-
counts:
|
|
39111
|
-
rows:
|
|
39112
|
-
|
|
39402
|
+
var judgmentSchema = z9.object({
|
|
39403
|
+
question: z9.enum(["classify", "merge"]),
|
|
39404
|
+
site: z9.string(),
|
|
39405
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
39406
|
+
ruleAnswer: z9.string(),
|
|
39407
|
+
decidedAnswer: z9.string().nullable(),
|
|
39408
|
+
decidedConfidence: z9.number().nullable(),
|
|
39409
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
39410
|
+
acted: z9.string()
|
|
39411
|
+
});
|
|
39412
|
+
var relPath = z9.string().min(1).max(1024);
|
|
39413
|
+
var docsModernizePlanSchema = z9.object({
|
|
39414
|
+
root: z9.string().min(1),
|
|
39415
|
+
generatedAt: z9.string(),
|
|
39416
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
39417
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
39418
|
+
rows: z9.array(
|
|
39419
|
+
z9.object({
|
|
39113
39420
|
path: relPath,
|
|
39114
|
-
sha256:
|
|
39115
|
-
kind:
|
|
39116
|
-
slug:
|
|
39117
|
-
title:
|
|
39118
|
-
disposition:
|
|
39119
|
-
target:
|
|
39120
|
-
reasons:
|
|
39121
|
-
judgments:
|
|
39122
|
-
ownerTasks:
|
|
39123
|
-
category:
|
|
39124
|
-
refs:
|
|
39125
|
-
overridden:
|
|
39126
|
-
covers:
|
|
39127
|
-
baselineRemove:
|
|
39421
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
39422
|
+
kind: z9.string().min(1),
|
|
39423
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
39424
|
+
title: z9.string(),
|
|
39425
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
39426
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
39427
|
+
reasons: z9.array(z9.string()),
|
|
39428
|
+
judgments: z9.array(judgmentSchema),
|
|
39429
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
39430
|
+
category: z9.string(),
|
|
39431
|
+
refs: z9.array(z9.string()),
|
|
39432
|
+
overridden: z9.boolean(),
|
|
39433
|
+
covers: z9.array(z9.string()),
|
|
39434
|
+
baselineRemove: z9.boolean()
|
|
39128
39435
|
})
|
|
39129
39436
|
),
|
|
39130
|
-
linkFixes:
|
|
39131
|
-
|
|
39132
|
-
kind:
|
|
39437
|
+
linkFixes: z9.array(
|
|
39438
|
+
z9.object({
|
|
39439
|
+
kind: z9.literal("link-fix"),
|
|
39133
39440
|
path: relPath,
|
|
39134
|
-
href:
|
|
39135
|
-
newHref:
|
|
39136
|
-
base:
|
|
39137
|
-
sha256:
|
|
39441
|
+
href: z9.string().min(1).max(2048),
|
|
39442
|
+
newHref: z9.string().min(1).max(2048),
|
|
39443
|
+
base: z9.literal("repo").optional(),
|
|
39444
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
39138
39445
|
})
|
|
39139
39446
|
).optional(),
|
|
39140
|
-
repoRoot:
|
|
39447
|
+
repoRoot: z9.string().min(1).optional()
|
|
39141
39448
|
});
|
|
39142
|
-
var docsModernizeOverridesSchema =
|
|
39449
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
39143
39450
|
relPath,
|
|
39144
|
-
|
|
39145
|
-
disposition:
|
|
39146
|
-
target:
|
|
39147
|
-
reason:
|
|
39148
|
-
kind:
|
|
39149
|
-
slug:
|
|
39150
|
-
covers:
|
|
39451
|
+
z9.object({
|
|
39452
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
39453
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
39454
|
+
reason: z9.string().min(1),
|
|
39455
|
+
kind: z9.string().min(1).optional(),
|
|
39456
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
39457
|
+
covers: z9.array(z9.string()).optional()
|
|
39151
39458
|
})
|
|
39152
39459
|
);
|
|
39153
|
-
var receiptOpSchema =
|
|
39154
|
-
op:
|
|
39155
|
-
state:
|
|
39156
|
-
slug:
|
|
39460
|
+
var receiptOpSchema = z9.object({
|
|
39461
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
39462
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
39463
|
+
slug: z9.string().nullable(),
|
|
39157
39464
|
path: relPath.nullable(),
|
|
39158
|
-
target:
|
|
39159
|
-
attachmentId:
|
|
39160
|
-
ownerId:
|
|
39161
|
-
beforeSha256:
|
|
39162
|
-
afterSha256:
|
|
39163
|
-
prior:
|
|
39164
|
-
lifecycleStatus:
|
|
39165
|
-
supersededBy:
|
|
39166
|
-
supersedes:
|
|
39167
|
-
previousAttachmentId:
|
|
39168
|
-
newAttachmentId:
|
|
39169
|
-
linkTargets:
|
|
39170
|
-
kind:
|
|
39465
|
+
target: z9.string().nullable(),
|
|
39466
|
+
attachmentId: z9.string().nullable(),
|
|
39467
|
+
ownerId: z9.string().nullable(),
|
|
39468
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
39469
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
39470
|
+
prior: z9.object({
|
|
39471
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
39472
|
+
supersededBy: z9.string().nullable().optional(),
|
|
39473
|
+
supersedes: z9.string().nullable().optional(),
|
|
39474
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
39475
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
39476
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
39477
|
+
kind: z9.string().nullable().optional()
|
|
39171
39478
|
}).optional(),
|
|
39172
|
-
base:
|
|
39479
|
+
base: z9.literal("repo").optional()
|
|
39173
39480
|
});
|
|
39174
39481
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
39175
|
-
i:
|
|
39176
|
-
});
|
|
39177
|
-
var docsModernizeReceiptSchema =
|
|
39178
|
-
runId:
|
|
39179
|
-
root:
|
|
39180
|
-
appliedAt:
|
|
39181
|
-
planSha256:
|
|
39182
|
-
edgeCount:
|
|
39183
|
-
rolledBackAt:
|
|
39184
|
-
blobs:
|
|
39185
|
-
moves:
|
|
39186
|
-
deleted:
|
|
39187
|
-
ops:
|
|
39188
|
-
durationMs:
|
|
39189
|
-
repoRoot:
|
|
39482
|
+
i: z9.number().int().min(0)
|
|
39483
|
+
});
|
|
39484
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
39485
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
39486
|
+
root: z9.string().min(1),
|
|
39487
|
+
appliedAt: z9.string(),
|
|
39488
|
+
planSha256: z9.string(),
|
|
39489
|
+
edgeCount: z9.number(),
|
|
39490
|
+
rolledBackAt: z9.string().nullable(),
|
|
39491
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
39492
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
39493
|
+
deleted: z9.array(relPath),
|
|
39494
|
+
ops: z9.array(receiptOpSchema),
|
|
39495
|
+
durationMs: z9.number().optional(),
|
|
39496
|
+
repoRoot: z9.string().min(1).optional()
|
|
39190
39497
|
});
|
|
39191
39498
|
|
|
39192
39499
|
// packages/contracts/src/docs/provenance.ts
|
|
39193
|
-
import { z as
|
|
39500
|
+
import { z as z10 } from "zod";
|
|
39194
39501
|
var PROVENANCE_NODE_KINDS = [
|
|
39195
39502
|
"doc",
|
|
39196
39503
|
"task",
|
|
@@ -39213,96 +39520,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
39213
39520
|
"archived",
|
|
39214
39521
|
"draft"
|
|
39215
39522
|
];
|
|
39216
|
-
var provenanceNodeKindSchema =
|
|
39217
|
-
var provenanceEdgeRelationSchema =
|
|
39218
|
-
var docLifecycleStatusSchema =
|
|
39523
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
39524
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
39525
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
39219
39526
|
var provenanceNodeBaseFields = {
|
|
39220
|
-
id:
|
|
39221
|
-
title:
|
|
39222
|
-
metadata:
|
|
39527
|
+
id: z10.string().min(1),
|
|
39528
|
+
title: z10.string().min(1),
|
|
39529
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
39223
39530
|
};
|
|
39224
|
-
var provenanceDocNodeSchema =
|
|
39531
|
+
var provenanceDocNodeSchema = z10.object({
|
|
39225
39532
|
...provenanceNodeBaseFields,
|
|
39226
|
-
kind:
|
|
39227
|
-
slug:
|
|
39228
|
-
docKind:
|
|
39533
|
+
kind: z10.literal("doc"),
|
|
39534
|
+
slug: z10.string().min(1),
|
|
39535
|
+
docKind: z10.string().min(1),
|
|
39229
39536
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
39230
|
-
publishedAt:
|
|
39231
|
-
supersededAt:
|
|
39232
|
-
summary:
|
|
39537
|
+
publishedAt: z10.string().min(1),
|
|
39538
|
+
supersededAt: z10.string().min(1).optional(),
|
|
39539
|
+
summary: z10.string().optional()
|
|
39233
39540
|
});
|
|
39234
|
-
var provenanceTaskNodeSchema =
|
|
39541
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
39235
39542
|
...provenanceNodeBaseFields,
|
|
39236
|
-
kind:
|
|
39237
|
-
taskType:
|
|
39238
|
-
status:
|
|
39543
|
+
kind: z10.literal("task"),
|
|
39544
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
39545
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
39239
39546
|
});
|
|
39240
|
-
var provenanceDecisionNodeSchema =
|
|
39547
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
39241
39548
|
...provenanceNodeBaseFields,
|
|
39242
|
-
kind:
|
|
39243
|
-
outcome:
|
|
39244
|
-
decidedAt:
|
|
39549
|
+
kind: z10.literal("decision"),
|
|
39550
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
39551
|
+
decidedAt: z10.string().min(1)
|
|
39245
39552
|
});
|
|
39246
|
-
var provenanceSessionNodeSchema =
|
|
39553
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
39247
39554
|
...provenanceNodeBaseFields,
|
|
39248
|
-
kind:
|
|
39249
|
-
startedAt:
|
|
39250
|
-
endedAt:
|
|
39555
|
+
kind: z10.literal("session"),
|
|
39556
|
+
startedAt: z10.string().min(1),
|
|
39557
|
+
endedAt: z10.string().min(1).optional()
|
|
39251
39558
|
});
|
|
39252
|
-
var provenanceMemoryNodeSchema =
|
|
39559
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
39253
39560
|
...provenanceNodeBaseFields,
|
|
39254
|
-
kind:
|
|
39255
|
-
memoryType:
|
|
39256
|
-
recordedAt:
|
|
39561
|
+
kind: z10.literal("memory"),
|
|
39562
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
39563
|
+
recordedAt: z10.string().min(1)
|
|
39257
39564
|
});
|
|
39258
|
-
var provenanceNodeSchema =
|
|
39565
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
39259
39566
|
provenanceDocNodeSchema,
|
|
39260
39567
|
provenanceTaskNodeSchema,
|
|
39261
39568
|
provenanceDecisionNodeSchema,
|
|
39262
39569
|
provenanceSessionNodeSchema,
|
|
39263
39570
|
provenanceMemoryNodeSchema
|
|
39264
39571
|
]);
|
|
39265
|
-
var provenanceEdgeSchema =
|
|
39572
|
+
var provenanceEdgeSchema = z10.object({
|
|
39266
39573
|
relation: provenanceEdgeRelationSchema,
|
|
39267
|
-
from:
|
|
39574
|
+
from: z10.string().min(1),
|
|
39268
39575
|
fromKind: provenanceNodeKindSchema,
|
|
39269
|
-
to:
|
|
39576
|
+
to: z10.string().min(1),
|
|
39270
39577
|
toKind: provenanceNodeKindSchema,
|
|
39271
|
-
addedAt:
|
|
39272
|
-
summary:
|
|
39578
|
+
addedAt: z10.string().min(1),
|
|
39579
|
+
summary: z10.string().optional()
|
|
39273
39580
|
});
|
|
39274
|
-
var docProvenanceResponseSchema =
|
|
39275
|
-
nodes:
|
|
39276
|
-
edges:
|
|
39277
|
-
totalNodes:
|
|
39278
|
-
totalEdges:
|
|
39581
|
+
var docProvenanceResponseSchema = z10.object({
|
|
39582
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
39583
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
39584
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
39585
|
+
totalEdges: z10.number().int().nonnegative()
|
|
39279
39586
|
});
|
|
39280
39587
|
|
|
39281
39588
|
// packages/contracts/src/docs/read.ts
|
|
39282
|
-
import { z as
|
|
39283
|
-
var docFrontmatterSchema =
|
|
39284
|
-
slug:
|
|
39285
|
-
kind:
|
|
39286
|
-
title:
|
|
39287
|
-
summary:
|
|
39288
|
-
lifecycleStatus:
|
|
39289
|
-
docVersion:
|
|
39290
|
-
ownerVersion:
|
|
39291
|
-
supersedes:
|
|
39292
|
-
supersededBy:
|
|
39293
|
-
topics:
|
|
39294
|
-
relatedTasks:
|
|
39295
|
-
sha256:
|
|
39296
|
-
createdAt:
|
|
39297
|
-
});
|
|
39298
|
-
var docBodySchema =
|
|
39299
|
-
encoding:
|
|
39300
|
-
text:
|
|
39301
|
-
base64:
|
|
39302
|
-
sizeBytes:
|
|
39303
|
-
mimeType:
|
|
39304
|
-
});
|
|
39305
|
-
var docReadResponseSchema =
|
|
39589
|
+
import { z as z11 } from "zod";
|
|
39590
|
+
var docFrontmatterSchema = z11.object({
|
|
39591
|
+
slug: z11.string(),
|
|
39592
|
+
kind: z11.string().nullable(),
|
|
39593
|
+
title: z11.string().nullable(),
|
|
39594
|
+
summary: z11.string().nullable(),
|
|
39595
|
+
lifecycleStatus: z11.string(),
|
|
39596
|
+
docVersion: z11.number().int(),
|
|
39597
|
+
ownerVersion: z11.string().nullable(),
|
|
39598
|
+
supersedes: z11.string().nullable(),
|
|
39599
|
+
supersededBy: z11.string().nullable(),
|
|
39600
|
+
topics: z11.array(z11.string()).readonly(),
|
|
39601
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
39602
|
+
sha256: z11.string(),
|
|
39603
|
+
createdAt: z11.string()
|
|
39604
|
+
});
|
|
39605
|
+
var docBodySchema = z11.object({
|
|
39606
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
39607
|
+
text: z11.string().optional(),
|
|
39608
|
+
base64: z11.string().optional(),
|
|
39609
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
39610
|
+
mimeType: z11.string().nullable()
|
|
39611
|
+
});
|
|
39612
|
+
var docReadResponseSchema = z11.object({
|
|
39306
39613
|
frontmatter: docFrontmatterSchema,
|
|
39307
39614
|
body: docBodySchema
|
|
39308
39615
|
});
|
|
@@ -39472,7 +39779,7 @@ function getErrorMessage(error48, fallback = "Unknown error") {
|
|
|
39472
39779
|
}
|
|
39473
39780
|
|
|
39474
39781
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
39475
|
-
import { z as
|
|
39782
|
+
import { z as z12 } from "zod";
|
|
39476
39783
|
var EVIDENCE_ATOM_KINDS = [
|
|
39477
39784
|
"commit",
|
|
39478
39785
|
"files",
|
|
@@ -39494,96 +39801,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
39494
39801
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
39495
39802
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
39496
39803
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
39497
|
-
var commitAtomSchema =
|
|
39498
|
-
kind:
|
|
39499
|
-
sha:
|
|
39500
|
-
});
|
|
39501
|
-
var filesAtomSchema =
|
|
39502
|
-
kind:
|
|
39503
|
-
paths:
|
|
39504
|
-
});
|
|
39505
|
-
var testRunAtomSchema =
|
|
39506
|
-
kind:
|
|
39507
|
-
path:
|
|
39508
|
-
});
|
|
39509
|
-
var qaRunAtomSchema =
|
|
39510
|
-
kind:
|
|
39511
|
-
path:
|
|
39512
|
-
});
|
|
39513
|
-
var toolAtomSchema =
|
|
39514
|
-
kind:
|
|
39515
|
-
tool:
|
|
39516
|
-
});
|
|
39517
|
-
var urlAtomSchema =
|
|
39518
|
-
kind:
|
|
39519
|
-
url:
|
|
39520
|
-
});
|
|
39521
|
-
var noteAtomSchema =
|
|
39522
|
-
kind:
|
|
39523
|
-
note:
|
|
39524
|
-
});
|
|
39525
|
-
var decisionAtomSchema =
|
|
39526
|
-
kind:
|
|
39527
|
-
decisionId:
|
|
39528
|
-
});
|
|
39529
|
-
var prAtomSchema =
|
|
39530
|
-
kind:
|
|
39531
|
-
prNumber:
|
|
39532
|
-
componentPrNumber:
|
|
39804
|
+
var commitAtomSchema = z12.object({
|
|
39805
|
+
kind: z12.literal("commit"),
|
|
39806
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
39807
|
+
});
|
|
39808
|
+
var filesAtomSchema = z12.object({
|
|
39809
|
+
kind: z12.literal("files"),
|
|
39810
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
39811
|
+
});
|
|
39812
|
+
var testRunAtomSchema = z12.object({
|
|
39813
|
+
kind: z12.literal("test-run"),
|
|
39814
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
39815
|
+
});
|
|
39816
|
+
var qaRunAtomSchema = z12.object({
|
|
39817
|
+
kind: z12.literal("qa-run"),
|
|
39818
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
39819
|
+
});
|
|
39820
|
+
var toolAtomSchema = z12.object({
|
|
39821
|
+
kind: z12.literal("tool"),
|
|
39822
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
39823
|
+
});
|
|
39824
|
+
var urlAtomSchema = z12.object({
|
|
39825
|
+
kind: z12.literal("url"),
|
|
39826
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
39827
|
+
});
|
|
39828
|
+
var noteAtomSchema = z12.object({
|
|
39829
|
+
kind: z12.literal("note"),
|
|
39830
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
39831
|
+
});
|
|
39832
|
+
var decisionAtomSchema = z12.object({
|
|
39833
|
+
kind: z12.literal("decision"),
|
|
39834
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
39835
|
+
});
|
|
39836
|
+
var prAtomSchema = z12.object({
|
|
39837
|
+
kind: z12.literal("pr"),
|
|
39838
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
39839
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
39533
39840
|
/**
|
|
39534
39841
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
39535
39842
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
39536
39843
|
* `origin`, since PR numbers are only unique per repository.
|
|
39537
39844
|
*/
|
|
39538
|
-
repo:
|
|
39845
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
39539
39846
|
});
|
|
39540
|
-
var ciAtomSchema =
|
|
39541
|
-
kind:
|
|
39542
|
-
prNumber:
|
|
39543
|
-
componentPrNumber:
|
|
39847
|
+
var ciAtomSchema = z12.object({
|
|
39848
|
+
kind: z12.literal("ci"),
|
|
39849
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
39850
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
39544
39851
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
39545
|
-
repo:
|
|
39852
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
39546
39853
|
});
|
|
39547
|
-
var ciRunAtomSchema =
|
|
39548
|
-
kind:
|
|
39549
|
-
runId:
|
|
39854
|
+
var ciRunAtomSchema = z12.object({
|
|
39855
|
+
kind: z12.literal("ci-run"),
|
|
39856
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
39550
39857
|
});
|
|
39551
|
-
var deployAtomSchema =
|
|
39552
|
-
kind:
|
|
39553
|
-
provider:
|
|
39554
|
-
deploymentId:
|
|
39555
|
-
sha:
|
|
39556
|
-
probeUrl:
|
|
39858
|
+
var deployAtomSchema = z12.object({
|
|
39859
|
+
kind: z12.literal("deploy"),
|
|
39860
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
39861
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
39862
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
39863
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
39557
39864
|
});
|
|
39558
|
-
var locDropAtomSchema =
|
|
39559
|
-
kind:
|
|
39560
|
-
fromLines:
|
|
39561
|
-
toLines:
|
|
39865
|
+
var locDropAtomSchema = z12.object({
|
|
39866
|
+
kind: z12.literal("loc-drop"),
|
|
39867
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
39868
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
39562
39869
|
});
|
|
39563
|
-
var callsiteCoverageAtomSchema =
|
|
39564
|
-
kind:
|
|
39565
|
-
symbolName:
|
|
39566
|
-
relativeSourcePath:
|
|
39870
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
39871
|
+
kind: z12.literal("callsite-coverage"),
|
|
39872
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
39873
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
39567
39874
|
});
|
|
39568
39875
|
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}$/;
|
|
39569
39876
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
39570
39877
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
39571
39878
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
39572
|
-
var satisfiesAtomSchema =
|
|
39573
|
-
kind:
|
|
39879
|
+
var satisfiesAtomSchema = z12.object({
|
|
39880
|
+
kind: z12.literal("satisfies"),
|
|
39574
39881
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
39575
|
-
targetTaskId:
|
|
39882
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
39576
39883
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
39577
|
-
targetAcId:
|
|
39884
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
39578
39885
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
39579
|
-
targetAcAlias:
|
|
39886
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
39580
39887
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
39581
|
-
versionPin:
|
|
39888
|
+
versionPin: z12.string().regex(
|
|
39582
39889
|
SATISFIES_VERSION_PIN_REGEX,
|
|
39583
39890
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
39584
39891
|
).optional()
|
|
39585
39892
|
});
|
|
39586
|
-
var EvidenceAtomSchema =
|
|
39893
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
39587
39894
|
commitAtomSchema,
|
|
39588
39895
|
filesAtomSchema,
|
|
39589
39896
|
testRunAtomSchema,
|
|
@@ -39645,54 +39952,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
39645
39952
|
});
|
|
39646
39953
|
|
|
39647
39954
|
// packages/contracts/src/evidence-record-schema.ts
|
|
39648
|
-
import { z as
|
|
39649
|
-
var evidenceBaseSchema =
|
|
39955
|
+
import { z as z13 } from "zod";
|
|
39956
|
+
var evidenceBaseSchema = z13.object({
|
|
39650
39957
|
/** Identity string of the agent that produced this record. */
|
|
39651
|
-
agentIdentity:
|
|
39958
|
+
agentIdentity: z13.string().min(1),
|
|
39652
39959
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
39653
|
-
attachmentSha256:
|
|
39960
|
+
attachmentSha256: z13.string().length(64),
|
|
39654
39961
|
/** ISO 8601 timestamp at which the action ran. */
|
|
39655
|
-
ranAt:
|
|
39962
|
+
ranAt: z13.string().datetime(),
|
|
39656
39963
|
/** Wall-clock duration of the action in milliseconds. */
|
|
39657
|
-
durationMs:
|
|
39964
|
+
durationMs: z13.number().nonnegative()
|
|
39658
39965
|
});
|
|
39659
39966
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
39660
|
-
kind:
|
|
39661
|
-
phase:
|
|
39662
|
-
filesChanged:
|
|
39663
|
-
linesAdded:
|
|
39664
|
-
linesRemoved:
|
|
39967
|
+
kind: z13.literal("impl-diff"),
|
|
39968
|
+
phase: z13.literal("implement"),
|
|
39969
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
39970
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
39971
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
39665
39972
|
});
|
|
39666
39973
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
39667
|
-
kind:
|
|
39668
|
-
phase:
|
|
39669
|
-
reqIdsChecked:
|
|
39670
|
-
passed:
|
|
39671
|
-
details:
|
|
39974
|
+
kind: z13.literal("validate-spec-check"),
|
|
39975
|
+
phase: z13.literal("validate"),
|
|
39976
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
39977
|
+
passed: z13.boolean(),
|
|
39978
|
+
details: z13.string().min(1)
|
|
39672
39979
|
});
|
|
39673
39980
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
39674
|
-
kind:
|
|
39675
|
-
phase:
|
|
39676
|
-
command:
|
|
39677
|
-
exitCode:
|
|
39678
|
-
testsPassed:
|
|
39679
|
-
testsFailed:
|
|
39981
|
+
kind: z13.literal("test-output"),
|
|
39982
|
+
phase: z13.literal("test"),
|
|
39983
|
+
command: z13.string().min(1),
|
|
39984
|
+
exitCode: z13.number().int(),
|
|
39985
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
39986
|
+
testsFailed: z13.number().int().nonnegative()
|
|
39680
39987
|
});
|
|
39681
39988
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
39682
|
-
kind:
|
|
39683
|
-
phase:
|
|
39684
|
-
tool:
|
|
39685
|
-
passed:
|
|
39686
|
-
warnings:
|
|
39687
|
-
errors:
|
|
39989
|
+
kind: z13.literal("lint-report"),
|
|
39990
|
+
phase: z13.enum(["implement", "test"]),
|
|
39991
|
+
tool: z13.string().min(1),
|
|
39992
|
+
passed: z13.boolean(),
|
|
39993
|
+
warnings: z13.number().int().nonnegative(),
|
|
39994
|
+
errors: z13.number().int().nonnegative()
|
|
39688
39995
|
});
|
|
39689
39996
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
39690
|
-
kind:
|
|
39691
|
-
phase:
|
|
39692
|
-
cmd:
|
|
39693
|
-
exitCode:
|
|
39997
|
+
kind: z13.literal("command-output"),
|
|
39998
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
39999
|
+
cmd: z13.string().min(1),
|
|
40000
|
+
exitCode: z13.number().int()
|
|
39694
40001
|
});
|
|
39695
|
-
var evidenceRecordSchema =
|
|
40002
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
39696
40003
|
implDiffRecordSchema,
|
|
39697
40004
|
validateSpecCheckRecordSchema,
|
|
39698
40005
|
testOutputRecordSchema,
|
|
@@ -40627,107 +40934,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
40627
40934
|
});
|
|
40628
40935
|
|
|
40629
40936
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
40630
|
-
import { z as
|
|
40631
|
-
var LeaseScopeSchema =
|
|
40632
|
-
var LeaseLaneSchema =
|
|
40633
|
-
var LeaseAcquireRequestSchema =
|
|
40937
|
+
import { z as z14 } from "zod";
|
|
40938
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
40939
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
40940
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
40634
40941
|
/** Tag discriminating this request variant. */
|
|
40635
|
-
kind:
|
|
40942
|
+
kind: z14.literal("lease_acquire"),
|
|
40636
40943
|
/** The cleo.db scope being arbitrated. */
|
|
40637
40944
|
scope: LeaseScopeSchema,
|
|
40638
40945
|
/** The write lane within the scope. */
|
|
40639
40946
|
lane: LeaseLaneSchema,
|
|
40640
40947
|
/** Process+lane holder identity. */
|
|
40641
|
-
holder_id:
|
|
40948
|
+
holder_id: z14.string().min(1),
|
|
40642
40949
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
40643
|
-
priority:
|
|
40950
|
+
priority: z14.number().int().min(0).max(255),
|
|
40644
40951
|
/** Lease time-to-live in milliseconds. */
|
|
40645
|
-
ttl_ms:
|
|
40952
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
40646
40953
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
40647
|
-
reentrant:
|
|
40954
|
+
reentrant: z14.boolean()
|
|
40648
40955
|
}).strict();
|
|
40649
|
-
var LeaseReleaseRequestSchema =
|
|
40956
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
40650
40957
|
/** Tag discriminating this request variant. */
|
|
40651
|
-
kind:
|
|
40958
|
+
kind: z14.literal("lease_release"),
|
|
40652
40959
|
/** The cleo.db scope being arbitrated. */
|
|
40653
40960
|
scope: LeaseScopeSchema,
|
|
40654
40961
|
/** The write lane within the scope. */
|
|
40655
40962
|
lane: LeaseLaneSchema,
|
|
40656
40963
|
/** Process+lane holder identity. */
|
|
40657
|
-
holder_id:
|
|
40964
|
+
holder_id: z14.string().min(1),
|
|
40658
40965
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
40659
|
-
epoch:
|
|
40966
|
+
epoch: z14.number().int().nonnegative()
|
|
40660
40967
|
}).strict();
|
|
40661
|
-
var LeaseRenewRequestSchema =
|
|
40968
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
40662
40969
|
/** Tag discriminating this request variant. */
|
|
40663
|
-
kind:
|
|
40970
|
+
kind: z14.literal("lease_renew"),
|
|
40664
40971
|
/** The cleo.db scope being arbitrated. */
|
|
40665
40972
|
scope: LeaseScopeSchema,
|
|
40666
40973
|
/** The write lane within the scope. */
|
|
40667
40974
|
lane: LeaseLaneSchema,
|
|
40668
40975
|
/** Process+lane holder identity. */
|
|
40669
|
-
holder_id:
|
|
40976
|
+
holder_id: z14.string().min(1),
|
|
40670
40977
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
40671
|
-
epoch:
|
|
40978
|
+
epoch: z14.number().int().nonnegative()
|
|
40672
40979
|
}).strict();
|
|
40673
|
-
var RateCheckRequestSchema =
|
|
40980
|
+
var RateCheckRequestSchema = z14.object({
|
|
40674
40981
|
/** Tag discriminating this request variant. */
|
|
40675
|
-
kind:
|
|
40982
|
+
kind: z14.literal("rate_check"),
|
|
40676
40983
|
/** The cleo.db scope being checked. */
|
|
40677
40984
|
scope: LeaseScopeSchema,
|
|
40678
40985
|
/** The write lane within the scope. */
|
|
40679
40986
|
lane: LeaseLaneSchema,
|
|
40680
40987
|
/** Estimated bytes the caller intends to write. */
|
|
40681
|
-
est_bytes:
|
|
40988
|
+
est_bytes: z14.number().int().nonnegative()
|
|
40682
40989
|
}).strict();
|
|
40683
|
-
var ToolGrantRequestSchema =
|
|
40990
|
+
var ToolGrantRequestSchema = z14.object({
|
|
40684
40991
|
/** Tag discriminating this request variant. */
|
|
40685
|
-
kind:
|
|
40992
|
+
kind: z14.literal("tool_grant"),
|
|
40686
40993
|
/** The tool name being requested. */
|
|
40687
|
-
tool:
|
|
40994
|
+
tool: z14.string().min(1),
|
|
40688
40995
|
/** The requesting holder identity. */
|
|
40689
|
-
holder_id:
|
|
40996
|
+
holder_id: z14.string().min(1)
|
|
40690
40997
|
}).strict();
|
|
40691
|
-
var QueuePriorityClassSchema =
|
|
40692
|
-
var QueueAdmitRequestSchema =
|
|
40998
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
40999
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
40693
41000
|
/** Tag discriminating this request variant. */
|
|
40694
|
-
kind:
|
|
41001
|
+
kind: z14.literal("queue_admit"),
|
|
40695
41002
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
40696
|
-
provider:
|
|
41003
|
+
provider: z14.string().min(1),
|
|
40697
41004
|
/** The caller's priority class (lead > worker > background). */
|
|
40698
41005
|
priority_class: QueuePriorityClassSchema,
|
|
40699
41006
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
40700
|
-
est_tokens:
|
|
41007
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
40701
41008
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
40702
|
-
child_id:
|
|
41009
|
+
child_id: z14.string().min(1)
|
|
40703
41010
|
}).strict();
|
|
40704
|
-
var WorkerHeartbeatRequestSchema =
|
|
41011
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
40705
41012
|
/** Tag discriminating this request variant. */
|
|
40706
|
-
kind:
|
|
41013
|
+
kind: z14.literal("worker_heartbeat"),
|
|
40707
41014
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
40708
|
-
child_id:
|
|
41015
|
+
child_id: z14.string().min(1),
|
|
40709
41016
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
40710
|
-
in_flight_llm:
|
|
41017
|
+
in_flight_llm: z14.boolean()
|
|
40711
41018
|
}).strict();
|
|
40712
|
-
var ResourceAdmitRequestSchema =
|
|
41019
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
40713
41020
|
/** Tag discriminating this request variant. */
|
|
40714
|
-
kind:
|
|
41021
|
+
kind: z14.literal("resource_admit"),
|
|
40715
41022
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
40716
|
-
class:
|
|
41023
|
+
class: z14.string().min(1),
|
|
40717
41024
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
40718
|
-
holder_id:
|
|
41025
|
+
holder_id: z14.string().min(1),
|
|
40719
41026
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
40720
|
-
budget:
|
|
41027
|
+
budget: z14.number().int().nonnegative()
|
|
40721
41028
|
}).strict();
|
|
40722
|
-
var ResourceReleaseRequestSchema =
|
|
41029
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
40723
41030
|
/** Tag discriminating this request variant. */
|
|
40724
|
-
kind:
|
|
41031
|
+
kind: z14.literal("resource_release"),
|
|
40725
41032
|
/** The resource class the slot belongs to. */
|
|
40726
|
-
class:
|
|
41033
|
+
class: z14.string().min(1),
|
|
40727
41034
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
40728
|
-
holder_id:
|
|
41035
|
+
holder_id: z14.string().min(1)
|
|
40729
41036
|
}).strict();
|
|
40730
|
-
var LeaseIpcRequestSchema =
|
|
41037
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
40731
41038
|
LeaseAcquireRequestSchema,
|
|
40732
41039
|
LeaseReleaseRequestSchema,
|
|
40733
41040
|
LeaseRenewRequestSchema,
|
|
@@ -40738,133 +41045,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
40738
41045
|
ResourceAdmitRequestSchema,
|
|
40739
41046
|
ResourceReleaseRequestSchema
|
|
40740
41047
|
]);
|
|
40741
|
-
var LeaseGrantedResponseSchema =
|
|
41048
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
40742
41049
|
/** Tag discriminating this response variant. */
|
|
40743
|
-
kind:
|
|
41050
|
+
kind: z14.literal("lease_granted"),
|
|
40744
41051
|
/** The granted cleo.db scope. */
|
|
40745
41052
|
scope: LeaseScopeSchema,
|
|
40746
41053
|
/** The granted write lane. */
|
|
40747
41054
|
lane: LeaseLaneSchema,
|
|
40748
41055
|
/** The holder the lease was granted to. */
|
|
40749
|
-
holder_id:
|
|
41056
|
+
holder_id: z14.string().min(1),
|
|
40750
41057
|
/** The monotonic epoch fence assigned to this grant. */
|
|
40751
|
-
epoch:
|
|
41058
|
+
epoch: z14.number().int().nonnegative(),
|
|
40752
41059
|
/** The lease TTL in milliseconds. */
|
|
40753
|
-
ttl_ms:
|
|
41060
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
40754
41061
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
40755
|
-
expires_at_ms:
|
|
41062
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
40756
41063
|
}).strict();
|
|
40757
|
-
var LeaseQueuedResponseSchema =
|
|
41064
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
40758
41065
|
/** Tag discriminating this response variant. */
|
|
40759
|
-
kind:
|
|
41066
|
+
kind: z14.literal("lease_queued"),
|
|
40760
41067
|
/** The queued cleo.db scope. */
|
|
40761
41068
|
scope: LeaseScopeSchema,
|
|
40762
41069
|
/** The queued write lane. */
|
|
40763
41070
|
lane: LeaseLaneSchema,
|
|
40764
41071
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
40765
|
-
ticket:
|
|
41072
|
+
ticket: z14.number().int().nonnegative(),
|
|
40766
41073
|
/** Number of waiters ahead of this one. */
|
|
40767
|
-
ahead:
|
|
41074
|
+
ahead: z14.number().int().nonnegative()
|
|
40768
41075
|
}).strict();
|
|
40769
|
-
var LeaseDeniedResponseSchema =
|
|
41076
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
40770
41077
|
/** Tag discriminating this response variant. */
|
|
40771
|
-
kind:
|
|
41078
|
+
kind: z14.literal("lease_denied"),
|
|
40772
41079
|
/** The denied cleo.db scope. */
|
|
40773
41080
|
scope: LeaseScopeSchema,
|
|
40774
41081
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
40775
|
-
code:
|
|
41082
|
+
code: z14.string().min(1),
|
|
40776
41083
|
/** Human-readable denial message. */
|
|
40777
|
-
message:
|
|
41084
|
+
message: z14.string()
|
|
40778
41085
|
}).strict();
|
|
40779
|
-
var RateResultResponseSchema =
|
|
41086
|
+
var RateResultResponseSchema = z14.object({
|
|
40780
41087
|
/** Tag discriminating this response variant. */
|
|
40781
|
-
kind:
|
|
41088
|
+
kind: z14.literal("rate_result"),
|
|
40782
41089
|
/** The checked cleo.db scope. */
|
|
40783
41090
|
scope: LeaseScopeSchema,
|
|
40784
41091
|
/** Whether the write is within budget. */
|
|
40785
|
-
ok:
|
|
41092
|
+
ok: z14.boolean(),
|
|
40786
41093
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
40787
|
-
retry_after_ms:
|
|
41094
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40788
41095
|
/** Remaining token budget for the scope. */
|
|
40789
|
-
tokens_remaining:
|
|
41096
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
40790
41097
|
}).strict();
|
|
40791
|
-
var ToolGrantedResponseSchema =
|
|
41098
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
40792
41099
|
/** Tag discriminating this response variant. */
|
|
40793
|
-
kind:
|
|
41100
|
+
kind: z14.literal("tool_granted"),
|
|
40794
41101
|
/** The granted tool name. */
|
|
40795
|
-
tool:
|
|
41102
|
+
tool: z14.string().min(1),
|
|
40796
41103
|
/** The holder the tool grant was issued to. */
|
|
40797
|
-
holder_id:
|
|
41104
|
+
holder_id: z14.string().min(1)
|
|
40798
41105
|
}).strict();
|
|
40799
|
-
var LeaseRevokedResponseSchema =
|
|
41106
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
40800
41107
|
/** Tag discriminating this response variant. */
|
|
40801
|
-
kind:
|
|
41108
|
+
kind: z14.literal("lease_revoked"),
|
|
40802
41109
|
/** The revoked cleo.db scope. */
|
|
40803
41110
|
scope: LeaseScopeSchema,
|
|
40804
41111
|
/** The revoked write lane. */
|
|
40805
41112
|
lane: LeaseLaneSchema,
|
|
40806
41113
|
/** The holder whose lease was revoked. */
|
|
40807
|
-
holder_id:
|
|
41114
|
+
holder_id: z14.string().min(1),
|
|
40808
41115
|
/** Human-readable reason for the revocation. */
|
|
40809
|
-
reason:
|
|
41116
|
+
reason: z14.string()
|
|
40810
41117
|
}).strict();
|
|
40811
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
41118
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
40812
41119
|
/** Tag discriminating this response variant. */
|
|
40813
|
-
kind:
|
|
41120
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
40814
41121
|
/** Logical id of the killed child. */
|
|
40815
|
-
child_id:
|
|
41122
|
+
child_id: z14.string().min(1),
|
|
40816
41123
|
/** The holder identity the killed child held the lease as. */
|
|
40817
|
-
holder_id:
|
|
41124
|
+
holder_id: z14.string().min(1),
|
|
40818
41125
|
/** The cleo.db scope the killed child held the lease in. */
|
|
40819
41126
|
scope: LeaseScopeSchema,
|
|
40820
41127
|
/** Human-readable reason for the kill. */
|
|
40821
|
-
reason:
|
|
41128
|
+
reason: z14.string()
|
|
40822
41129
|
}).strict();
|
|
40823
|
-
var QueueAdmitDispositionSchema =
|
|
40824
|
-
var QueueAdmitResultResponseSchema =
|
|
41130
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
41131
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
40825
41132
|
/** Tag discriminating this response variant. */
|
|
40826
|
-
kind:
|
|
41133
|
+
kind: z14.literal("queue_admit_result"),
|
|
40827
41134
|
/** Whether the LLM call was admitted or deferred. */
|
|
40828
41135
|
disposition: QueueAdmitDispositionSchema,
|
|
40829
41136
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
40830
|
-
retry_after_ms:
|
|
41137
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40831
41138
|
/** Remaining provider token budget after this decision. */
|
|
40832
|
-
tokens_remaining:
|
|
41139
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
40833
41140
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
40834
|
-
queue_position:
|
|
41141
|
+
queue_position: z14.number().int().nonnegative()
|
|
40835
41142
|
}).strict();
|
|
40836
|
-
var HeartbeatAckResponseSchema =
|
|
41143
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
40837
41144
|
/** Tag discriminating this response variant. */
|
|
40838
|
-
kind:
|
|
41145
|
+
kind: z14.literal("heartbeat_ack")
|
|
40839
41146
|
}).strict();
|
|
40840
|
-
var ResourceAdmitDispositionSchema =
|
|
40841
|
-
var ResourceAdmitResultResponseSchema =
|
|
41147
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
41148
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
40842
41149
|
/** Tag discriminating this response variant. */
|
|
40843
|
-
kind:
|
|
41150
|
+
kind: z14.literal("resource_admit_result"),
|
|
40844
41151
|
/** Whether the heavy op was admitted or deferred. */
|
|
40845
41152
|
disposition: ResourceAdmitDispositionSchema,
|
|
40846
41153
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
40847
|
-
retry_after_ms:
|
|
41154
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40848
41155
|
/** Remaining slots for the class after this decision. */
|
|
40849
|
-
slots_remaining:
|
|
41156
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
40850
41157
|
}).strict();
|
|
40851
|
-
var ResourceReleaseResultResponseSchema =
|
|
41158
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
40852
41159
|
/** Tag discriminating this response variant. */
|
|
40853
|
-
kind:
|
|
41160
|
+
kind: z14.literal("resource_release_result"),
|
|
40854
41161
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
40855
|
-
released:
|
|
41162
|
+
released: z14.boolean(),
|
|
40856
41163
|
/** Remaining in-flight holders for the class after the release. */
|
|
40857
|
-
slots_remaining:
|
|
41164
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
40858
41165
|
}).strict();
|
|
40859
|
-
var LeaseErrorResponseSchema =
|
|
41166
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
40860
41167
|
/** Tag discriminating this response variant. */
|
|
40861
|
-
kind:
|
|
41168
|
+
kind: z14.literal("error"),
|
|
40862
41169
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
40863
|
-
code:
|
|
41170
|
+
code: z14.string().min(1),
|
|
40864
41171
|
/** Human-readable error message. */
|
|
40865
|
-
message:
|
|
41172
|
+
message: z14.string()
|
|
40866
41173
|
}).strict();
|
|
40867
|
-
var LeaseIpcResponseSchema =
|
|
41174
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
40868
41175
|
LeaseGrantedResponseSchema,
|
|
40869
41176
|
LeaseQueuedResponseSchema,
|
|
40870
41177
|
LeaseDeniedResponseSchema,
|
|
@@ -40878,27 +41185,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
40878
41185
|
ResourceReleaseResultResponseSchema,
|
|
40879
41186
|
LeaseErrorResponseSchema
|
|
40880
41187
|
]);
|
|
40881
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
41188
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
40882
41189
|
/** Parallel protocol version. */
|
|
40883
|
-
protocol_version:
|
|
41190
|
+
protocol_version: z14.string(),
|
|
40884
41191
|
/** Correlation id echoed back on the matching response. */
|
|
40885
|
-
id:
|
|
41192
|
+
id: z14.string().min(1),
|
|
40886
41193
|
/** Direction discriminator. */
|
|
40887
|
-
direction:
|
|
41194
|
+
direction: z14.literal("request"),
|
|
40888
41195
|
/** The request body. */
|
|
40889
41196
|
request: LeaseIpcRequestSchema
|
|
40890
41197
|
}).strict();
|
|
40891
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
41198
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
40892
41199
|
/** Parallel protocol version. */
|
|
40893
|
-
protocol_version:
|
|
41200
|
+
protocol_version: z14.string(),
|
|
40894
41201
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
40895
|
-
id:
|
|
41202
|
+
id: z14.string().min(1),
|
|
40896
41203
|
/** Direction discriminator. */
|
|
40897
|
-
direction:
|
|
41204
|
+
direction: z14.literal("response"),
|
|
40898
41205
|
/** The response body. */
|
|
40899
41206
|
response: LeaseIpcResponseSchema
|
|
40900
41207
|
}).strict();
|
|
40901
|
-
var LeaseIpcEnvelopeSchema =
|
|
41208
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
40902
41209
|
LeaseIpcRequestEnvelopeSchema,
|
|
40903
41210
|
LeaseIpcResponseEnvelopeSchema
|
|
40904
41211
|
]);
|
|
@@ -40933,7 +41240,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
40933
41240
|
];
|
|
40934
41241
|
|
|
40935
41242
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
40936
|
-
import { z as
|
|
41243
|
+
import { z as z15 } from "zod";
|
|
40937
41244
|
var CATALOG_MODEL_STATUSES = [
|
|
40938
41245
|
"stable",
|
|
40939
41246
|
"beta",
|
|
@@ -40942,78 +41249,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
40942
41249
|
"retired"
|
|
40943
41250
|
];
|
|
40944
41251
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
40945
|
-
var isoDate =
|
|
40946
|
-
var semver =
|
|
40947
|
-
var catalogModalitiesSchema =
|
|
40948
|
-
input:
|
|
40949
|
-
output:
|
|
41252
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
41253
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
41254
|
+
var catalogModalitiesSchema = z15.object({
|
|
41255
|
+
input: z15.array(z15.string()),
|
|
41256
|
+
output: z15.array(z15.string())
|
|
40950
41257
|
}).strict();
|
|
40951
|
-
var catalogCostSchema =
|
|
40952
|
-
input:
|
|
40953
|
-
output:
|
|
40954
|
-
cache_read:
|
|
40955
|
-
cache_write:
|
|
40956
|
-
context_over_200k:
|
|
41258
|
+
var catalogCostSchema = z15.object({
|
|
41259
|
+
input: z15.number().optional(),
|
|
41260
|
+
output: z15.number().optional(),
|
|
41261
|
+
cache_read: z15.number().optional(),
|
|
41262
|
+
cache_write: z15.number().optional(),
|
|
41263
|
+
context_over_200k: z15.number().optional()
|
|
40957
41264
|
}).strict();
|
|
40958
|
-
var catalogLimitSchema =
|
|
40959
|
-
context:
|
|
40960
|
-
output:
|
|
41265
|
+
var catalogLimitSchema = z15.object({
|
|
41266
|
+
context: z15.number(),
|
|
41267
|
+
output: z15.number()
|
|
40961
41268
|
}).strict();
|
|
40962
|
-
var catalogModelProviderSchema =
|
|
40963
|
-
npm:
|
|
40964
|
-
api:
|
|
41269
|
+
var catalogModelProviderSchema = z15.object({
|
|
41270
|
+
npm: z15.string(),
|
|
41271
|
+
api: z15.string()
|
|
40965
41272
|
}).strict();
|
|
40966
|
-
var catalogModelEntrySchema =
|
|
40967
|
-
id:
|
|
40968
|
-
name:
|
|
40969
|
-
family:
|
|
40970
|
-
attachment:
|
|
40971
|
-
reasoning:
|
|
40972
|
-
temperature:
|
|
40973
|
-
interleaved:
|
|
40974
|
-
tool_call:
|
|
41273
|
+
var catalogModelEntrySchema = z15.object({
|
|
41274
|
+
id: z15.string(),
|
|
41275
|
+
name: z15.string(),
|
|
41276
|
+
family: z15.string(),
|
|
41277
|
+
attachment: z15.boolean(),
|
|
41278
|
+
reasoning: z15.boolean(),
|
|
41279
|
+
temperature: z15.boolean(),
|
|
41280
|
+
interleaved: z15.boolean(),
|
|
41281
|
+
tool_call: z15.boolean(),
|
|
40975
41282
|
modalities: catalogModalitiesSchema,
|
|
40976
41283
|
cost: catalogCostSchema,
|
|
40977
41284
|
limit: catalogLimitSchema,
|
|
40978
|
-
status:
|
|
41285
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
40979
41286
|
release_date: isoDate,
|
|
40980
41287
|
provider: catalogModelProviderSchema
|
|
40981
41288
|
}).strict();
|
|
40982
|
-
var catalogProviderSchema =
|
|
40983
|
-
id:
|
|
40984
|
-
endpoint:
|
|
40985
|
-
authTypes:
|
|
40986
|
-
npm:
|
|
41289
|
+
var catalogProviderSchema = z15.object({
|
|
41290
|
+
id: z15.string(),
|
|
41291
|
+
endpoint: z15.string(),
|
|
41292
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
41293
|
+
npm: z15.string().optional()
|
|
40987
41294
|
}).strict();
|
|
40988
|
-
var curatedCatalogSchema =
|
|
40989
|
-
$schema:
|
|
41295
|
+
var curatedCatalogSchema = z15.object({
|
|
41296
|
+
$schema: z15.string().optional(),
|
|
40990
41297
|
version: semver,
|
|
40991
41298
|
lastUpdated: isoDate,
|
|
40992
|
-
providers:
|
|
40993
|
-
models:
|
|
41299
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
41300
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
40994
41301
|
}).strict();
|
|
40995
|
-
var modelsCatalogRowInsertSchema =
|
|
40996
|
-
id:
|
|
40997
|
-
providerId:
|
|
40998
|
-
name:
|
|
40999
|
-
family:
|
|
41000
|
-
attachment:
|
|
41001
|
-
reasoning:
|
|
41002
|
-
temperature:
|
|
41003
|
-
interleaved:
|
|
41004
|
-
toolCall:
|
|
41005
|
-
modalities:
|
|
41006
|
-
cost:
|
|
41007
|
-
contextLimit:
|
|
41008
|
-
outputLimit:
|
|
41009
|
-
status:
|
|
41302
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
41303
|
+
id: z15.string(),
|
|
41304
|
+
providerId: z15.string(),
|
|
41305
|
+
name: z15.string(),
|
|
41306
|
+
family: z15.string(),
|
|
41307
|
+
attachment: z15.boolean(),
|
|
41308
|
+
reasoning: z15.boolean(),
|
|
41309
|
+
temperature: z15.boolean(),
|
|
41310
|
+
interleaved: z15.boolean(),
|
|
41311
|
+
toolCall: z15.boolean(),
|
|
41312
|
+
modalities: z15.string(),
|
|
41313
|
+
cost: z15.string(),
|
|
41314
|
+
contextLimit: z15.number().nullable().optional(),
|
|
41315
|
+
outputLimit: z15.number().nullable().optional(),
|
|
41316
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
41010
41317
|
releaseDate: isoDate,
|
|
41011
|
-
modelsDevId:
|
|
41012
|
-
source:
|
|
41013
|
-
seededAt:
|
|
41318
|
+
modelsDevId: z15.string(),
|
|
41319
|
+
source: z15.string(),
|
|
41320
|
+
seededAt: z15.string().optional()
|
|
41014
41321
|
}).strict();
|
|
41015
41322
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
41016
|
-
seededAt:
|
|
41323
|
+
seededAt: z15.string()
|
|
41017
41324
|
});
|
|
41018
41325
|
|
|
41019
41326
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -41061,7 +41368,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
41061
41368
|
];
|
|
41062
41369
|
|
|
41063
41370
|
// packages/contracts/src/workgraph.ts
|
|
41064
|
-
import { z as
|
|
41371
|
+
import { z as z16 } from "zod";
|
|
41065
41372
|
|
|
41066
41373
|
// packages/contracts/src/status-registry.ts
|
|
41067
41374
|
var TASK_STATUSES = [
|
|
@@ -41076,10 +41383,10 @@ var TASK_STATUSES = [
|
|
|
41076
41383
|
|
|
41077
41384
|
// packages/contracts/src/workgraph.ts
|
|
41078
41385
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
41079
|
-
var taskTypeSchema =
|
|
41080
|
-
var taskPrioritySchema =
|
|
41081
|
-
var taskStatusSchema =
|
|
41082
|
-
var verificationGateSchema =
|
|
41386
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
41387
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
41388
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
41389
|
+
var verificationGateSchema = z16.enum([
|
|
41083
41390
|
"implemented",
|
|
41084
41391
|
"testsPassed",
|
|
41085
41392
|
"qaPassed",
|
|
@@ -41088,7 +41395,7 @@ var verificationGateSchema = z15.enum([
|
|
|
41088
41395
|
"documented",
|
|
41089
41396
|
"nexusImpact"
|
|
41090
41397
|
]);
|
|
41091
|
-
var workGraphRelationKindSchema =
|
|
41398
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
41092
41399
|
"contains",
|
|
41093
41400
|
"depends_on",
|
|
41094
41401
|
"blocks",
|
|
@@ -41096,317 +41403,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
41096
41403
|
"groups",
|
|
41097
41404
|
"satisfies"
|
|
41098
41405
|
]);
|
|
41099
|
-
var workGraphTraversalDirectionSchema =
|
|
41406
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
41100
41407
|
"ancestors",
|
|
41101
41408
|
"descendants",
|
|
41102
41409
|
"upstream",
|
|
41103
41410
|
"downstream"
|
|
41104
41411
|
]);
|
|
41105
|
-
var workGraphEdgeDirectionSchema =
|
|
41106
|
-
var paginationParamsSchema =
|
|
41107
|
-
cursor:
|
|
41108
|
-
limit:
|
|
41412
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
41413
|
+
var paginationParamsSchema = z16.object({
|
|
41414
|
+
cursor: z16.string().min(1).optional(),
|
|
41415
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
41109
41416
|
});
|
|
41110
|
-
var workGraphNodeSchema =
|
|
41111
|
-
id:
|
|
41417
|
+
var workGraphNodeSchema = z16.object({
|
|
41418
|
+
id: z16.string().min(1),
|
|
41112
41419
|
type: taskTypeSchema,
|
|
41113
|
-
title:
|
|
41420
|
+
title: z16.string(),
|
|
41114
41421
|
status: taskStatusSchema,
|
|
41115
41422
|
priority: taskPrioritySchema,
|
|
41116
|
-
parentId:
|
|
41423
|
+
parentId: z16.string().min(1).optional()
|
|
41117
41424
|
});
|
|
41118
|
-
var workGraphEdgeSchema =
|
|
41119
|
-
fromId:
|
|
41120
|
-
toId:
|
|
41425
|
+
var workGraphEdgeSchema = z16.object({
|
|
41426
|
+
fromId: z16.string().min(1),
|
|
41427
|
+
toId: z16.string().min(1),
|
|
41121
41428
|
kind: workGraphRelationKindSchema
|
|
41122
41429
|
});
|
|
41123
|
-
var workGraphHierarchyEdgeSchema =
|
|
41124
|
-
fromId:
|
|
41125
|
-
toId:
|
|
41126
|
-
kind:
|
|
41430
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
41431
|
+
fromId: z16.string().min(1),
|
|
41432
|
+
toId: z16.string().min(1),
|
|
41433
|
+
kind: z16.literal("contains")
|
|
41127
41434
|
}).strict();
|
|
41128
|
-
var workGraphPageInfoSchema =
|
|
41129
|
-
nextCursor:
|
|
41130
|
-
hasMore:
|
|
41131
|
-
});
|
|
41132
|
-
var workGraphRollupCountsSchema =
|
|
41133
|
-
total:
|
|
41134
|
-
byStatus:
|
|
41135
|
-
byType:
|
|
41136
|
-
});
|
|
41137
|
-
var workGraphSubtreePercentagesSchema =
|
|
41138
|
-
done:
|
|
41139
|
-
active:
|
|
41140
|
-
blocked:
|
|
41141
|
-
pending:
|
|
41142
|
-
cancelled:
|
|
41143
|
-
});
|
|
41144
|
-
var workGraphProjectionMismatchSchema =
|
|
41145
|
-
field:
|
|
41146
|
-
expected:
|
|
41147
|
-
actual:
|
|
41435
|
+
var workGraphPageInfoSchema = z16.object({
|
|
41436
|
+
nextCursor: z16.string().min(1).optional(),
|
|
41437
|
+
hasMore: z16.boolean()
|
|
41438
|
+
});
|
|
41439
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
41440
|
+
total: z16.number().int().nonnegative(),
|
|
41441
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
41442
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
41443
|
+
});
|
|
41444
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
41445
|
+
done: z16.number().nonnegative(),
|
|
41446
|
+
active: z16.number().nonnegative(),
|
|
41447
|
+
blocked: z16.number().nonnegative(),
|
|
41448
|
+
pending: z16.number().nonnegative(),
|
|
41449
|
+
cancelled: z16.number().nonnegative()
|
|
41450
|
+
});
|
|
41451
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
41452
|
+
field: z16.string().min(1),
|
|
41453
|
+
expected: z16.number().int().nonnegative(),
|
|
41454
|
+
actual: z16.number().int().nonnegative()
|
|
41148
41455
|
});
|
|
41149
41456
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
41150
|
-
role:
|
|
41151
|
-
dependencyBlockers:
|
|
41152
|
-
gateBlockers:
|
|
41457
|
+
role: z16.string().min(1).optional(),
|
|
41458
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
41459
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
41153
41460
|
});
|
|
41154
41461
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
41155
|
-
source:
|
|
41156
|
-
relationType:
|
|
41157
|
-
reason:
|
|
41462
|
+
source: z16.literal("relation"),
|
|
41463
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
41464
|
+
reason: z16.string().min(1).optional()
|
|
41158
41465
|
});
|
|
41159
41466
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
41160
|
-
source:
|
|
41161
|
-
kind:
|
|
41467
|
+
source: z16.literal("dependency"),
|
|
41468
|
+
kind: z16.literal("depends_on")
|
|
41162
41469
|
});
|
|
41163
|
-
var workGraphOmissionReasonSchema =
|
|
41470
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
41164
41471
|
"budget_exceeded",
|
|
41165
41472
|
"not_requested",
|
|
41166
41473
|
"not_available",
|
|
41167
41474
|
"redacted",
|
|
41168
41475
|
"truncated"
|
|
41169
41476
|
]);
|
|
41170
|
-
var workGraphContextBudgetSchema =
|
|
41171
|
-
tokenBudget:
|
|
41172
|
-
estimatedTokens:
|
|
41173
|
-
remainingTokens:
|
|
41174
|
-
truncated:
|
|
41175
|
-
});
|
|
41176
|
-
var workGraphOmissionSchema =
|
|
41177
|
-
path:
|
|
41477
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
41478
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
41479
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
41480
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
41481
|
+
truncated: z16.boolean()
|
|
41482
|
+
});
|
|
41483
|
+
var workGraphOmissionSchema = z16.object({
|
|
41484
|
+
path: z16.string().min(1),
|
|
41178
41485
|
reason: workGraphOmissionReasonSchema,
|
|
41179
|
-
message:
|
|
41180
|
-
estimatedTokens:
|
|
41486
|
+
message: z16.string().min(1),
|
|
41487
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
41181
41488
|
});
|
|
41182
|
-
var workGraphDirectEdgeSchema =
|
|
41489
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
41183
41490
|
workGraphRelationEdgeSchema,
|
|
41184
41491
|
workGraphDependencyEdgeSchema
|
|
41185
41492
|
]);
|
|
41186
41493
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
41187
|
-
rootId:
|
|
41188
|
-
tokenBudget:
|
|
41189
|
-
includeRelations:
|
|
41190
|
-
includeReadiness:
|
|
41191
|
-
includeRollup:
|
|
41494
|
+
rootId: z16.string().min(1),
|
|
41495
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
41496
|
+
includeRelations: z16.boolean().optional(),
|
|
41497
|
+
includeReadiness: z16.boolean().optional(),
|
|
41498
|
+
includeRollup: z16.boolean().optional()
|
|
41192
41499
|
});
|
|
41193
41500
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
41194
|
-
rootId:
|
|
41501
|
+
rootId: z16.string().min(1),
|
|
41195
41502
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
41196
|
-
maxDepth:
|
|
41197
|
-
includeRelations:
|
|
41503
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41504
|
+
includeRelations: z16.boolean().optional()
|
|
41198
41505
|
});
|
|
41199
|
-
var workGraphSliceSchema =
|
|
41200
|
-
rootId:
|
|
41506
|
+
var workGraphSliceSchema = z16.object({
|
|
41507
|
+
rootId: z16.string().min(1),
|
|
41201
41508
|
direction: workGraphTraversalDirectionSchema,
|
|
41202
|
-
nodes:
|
|
41203
|
-
edges:
|
|
41509
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
41510
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
41204
41511
|
pageInfo: workGraphPageInfoSchema,
|
|
41205
|
-
omissions:
|
|
41206
|
-
});
|
|
41207
|
-
var workGraphReadinessParamsSchema =
|
|
41208
|
-
rootId:
|
|
41209
|
-
role:
|
|
41210
|
-
includeGateBlockers:
|
|
41211
|
-
});
|
|
41212
|
-
var workGraphReadinessResultSchema =
|
|
41213
|
-
rootId:
|
|
41214
|
-
role:
|
|
41215
|
-
ready:
|
|
41216
|
-
warnings:
|
|
41217
|
-
groups:
|
|
41218
|
-
ready:
|
|
41219
|
-
blocked:
|
|
41220
|
-
blockedBy:
|
|
41221
|
-
|
|
41222
|
-
|
|
41223
|
-
kind:
|
|
41224
|
-
blockerId:
|
|
41225
|
-
blocks:
|
|
41512
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
41513
|
+
});
|
|
41514
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
41515
|
+
rootId: z16.string().min(1),
|
|
41516
|
+
role: z16.string().min(1).optional(),
|
|
41517
|
+
includeGateBlockers: z16.boolean().optional()
|
|
41518
|
+
});
|
|
41519
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
41520
|
+
rootId: z16.string().min(1),
|
|
41521
|
+
role: z16.string().min(1).optional(),
|
|
41522
|
+
ready: z16.boolean(),
|
|
41523
|
+
warnings: z16.array(z16.string()),
|
|
41524
|
+
groups: z16.object({
|
|
41525
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41526
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41527
|
+
blockedBy: z16.array(
|
|
41528
|
+
z16.discriminatedUnion("kind", [
|
|
41529
|
+
z16.object({
|
|
41530
|
+
kind: z16.literal("dependency"),
|
|
41531
|
+
blockerId: z16.string().min(1),
|
|
41532
|
+
blocks: z16.array(z16.string().min(1))
|
|
41226
41533
|
}),
|
|
41227
|
-
|
|
41228
|
-
kind:
|
|
41534
|
+
z16.object({
|
|
41535
|
+
kind: z16.literal("gate"),
|
|
41229
41536
|
gate: verificationGateSchema,
|
|
41230
|
-
blocks:
|
|
41537
|
+
blocks: z16.array(z16.string().min(1))
|
|
41231
41538
|
})
|
|
41232
41539
|
])
|
|
41233
41540
|
)
|
|
41234
41541
|
})
|
|
41235
41542
|
});
|
|
41236
|
-
var workGraphContextPackSchema =
|
|
41237
|
-
rootId:
|
|
41238
|
-
generatedAt:
|
|
41543
|
+
var workGraphContextPackSchema = z16.object({
|
|
41544
|
+
rootId: z16.string().min(1),
|
|
41545
|
+
generatedAt: z16.string().min(1),
|
|
41239
41546
|
budget: workGraphContextBudgetSchema,
|
|
41240
41547
|
slice: workGraphSliceSchema,
|
|
41241
|
-
relationEdges:
|
|
41242
|
-
rootId:
|
|
41548
|
+
relationEdges: z16.object({
|
|
41549
|
+
rootId: z16.string().min(1),
|
|
41243
41550
|
direction: workGraphEdgeDirectionSchema,
|
|
41244
|
-
edges:
|
|
41551
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
41245
41552
|
}).optional(),
|
|
41246
41553
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
41247
|
-
rollup:
|
|
41248
|
-
omissions:
|
|
41249
|
-
});
|
|
41250
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
41251
|
-
rootId:
|
|
41252
|
-
nodes:
|
|
41253
|
-
|
|
41254
|
-
id:
|
|
41554
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
41555
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
41556
|
+
});
|
|
41557
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
41558
|
+
rootId: z16.string().min(1),
|
|
41559
|
+
nodes: z16.array(
|
|
41560
|
+
z16.object({
|
|
41561
|
+
id: z16.string().min(1),
|
|
41255
41562
|
type: taskTypeSchema,
|
|
41256
|
-
parentId:
|
|
41563
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
41257
41564
|
})
|
|
41258
41565
|
),
|
|
41259
|
-
edges:
|
|
41260
|
-
dryRun:
|
|
41261
|
-
});
|
|
41262
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
41263
|
-
code:
|
|
41264
|
-
message:
|
|
41265
|
-
taskId:
|
|
41266
|
-
severity:
|
|
41267
|
-
});
|
|
41268
|
-
var workGraphScaffoldValidateResultSchema =
|
|
41269
|
-
rootId:
|
|
41270
|
-
valid:
|
|
41271
|
-
dryRun:
|
|
41272
|
-
issues:
|
|
41273
|
-
hierarchy:
|
|
41274
|
-
valid:
|
|
41275
|
-
violations:
|
|
41276
|
-
|
|
41277
|
-
code:
|
|
41278
|
-
taskId:
|
|
41566
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
41567
|
+
dryRun: z16.boolean().optional()
|
|
41568
|
+
});
|
|
41569
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
41570
|
+
code: z16.string().min(1),
|
|
41571
|
+
message: z16.string().min(1),
|
|
41572
|
+
taskId: z16.string().min(1).optional(),
|
|
41573
|
+
severity: z16.enum(["error", "warning"])
|
|
41574
|
+
});
|
|
41575
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
41576
|
+
rootId: z16.string().min(1),
|
|
41577
|
+
valid: z16.boolean(),
|
|
41578
|
+
dryRun: z16.boolean(),
|
|
41579
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
41580
|
+
hierarchy: z16.object({
|
|
41581
|
+
valid: z16.boolean(),
|
|
41582
|
+
violations: z16.array(
|
|
41583
|
+
z16.object({
|
|
41584
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
41585
|
+
taskId: z16.string().min(1),
|
|
41279
41586
|
taskType: taskTypeSchema,
|
|
41280
|
-
parentId:
|
|
41587
|
+
parentId: z16.string().min(1).nullable(),
|
|
41281
41588
|
parentType: taskTypeSchema.optional(),
|
|
41282
|
-
message:
|
|
41589
|
+
message: z16.string().min(1)
|
|
41283
41590
|
})
|
|
41284
41591
|
)
|
|
41285
41592
|
})
|
|
41286
41593
|
});
|
|
41287
41594
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
41288
|
-
apply:
|
|
41595
|
+
apply: z16.boolean().optional()
|
|
41289
41596
|
});
|
|
41290
41597
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
41291
|
-
applied:
|
|
41292
|
-
nodesChanged:
|
|
41293
|
-
edgesChanged:
|
|
41294
|
-
});
|
|
41295
|
-
var workGraphPlanningDocParamsSchema =
|
|
41296
|
-
rootId:
|
|
41297
|
-
audience:
|
|
41298
|
-
tokenBudget:
|
|
41299
|
-
includeRelations:
|
|
41300
|
-
includeReadiness:
|
|
41301
|
-
includeRollup:
|
|
41302
|
-
});
|
|
41303
|
-
var workGraphPlanningDocSchema =
|
|
41304
|
-
rootId:
|
|
41305
|
-
generatedAt:
|
|
41306
|
-
audience:
|
|
41307
|
-
title:
|
|
41308
|
-
content:
|
|
41309
|
-
sections:
|
|
41310
|
-
estimatedTokens:
|
|
41311
|
-
budget:
|
|
41312
|
-
tokenBudget:
|
|
41313
|
-
truncated:
|
|
41598
|
+
applied: z16.boolean(),
|
|
41599
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
41600
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
41601
|
+
});
|
|
41602
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
41603
|
+
rootId: z16.string().min(1),
|
|
41604
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
41605
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
41606
|
+
includeRelations: z16.boolean().optional(),
|
|
41607
|
+
includeReadiness: z16.boolean().optional(),
|
|
41608
|
+
includeRollup: z16.boolean().optional()
|
|
41609
|
+
});
|
|
41610
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
41611
|
+
rootId: z16.string().min(1),
|
|
41612
|
+
generatedAt: z16.string().min(1),
|
|
41613
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
41614
|
+
title: z16.string().min(1),
|
|
41615
|
+
content: z16.string(),
|
|
41616
|
+
sections: z16.array(z16.string().min(1)),
|
|
41617
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
41618
|
+
budget: z16.object({
|
|
41619
|
+
tokenBudget: z16.number().int().positive(),
|
|
41620
|
+
truncated: z16.boolean()
|
|
41314
41621
|
}).optional()
|
|
41315
41622
|
});
|
|
41316
41623
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
41317
|
-
rootId:
|
|
41624
|
+
rootId: z16.string().min(1),
|
|
41318
41625
|
direction: workGraphTraversalDirectionSchema,
|
|
41319
|
-
maxDepth:
|
|
41320
|
-
includeRelations:
|
|
41626
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41627
|
+
includeRelations: z16.boolean().optional()
|
|
41321
41628
|
});
|
|
41322
|
-
var tasksTraverseResultSchema =
|
|
41323
|
-
rootId:
|
|
41629
|
+
var tasksTraverseResultSchema = z16.object({
|
|
41630
|
+
rootId: z16.string().min(1),
|
|
41324
41631
|
direction: workGraphTraversalDirectionSchema,
|
|
41325
|
-
nodes:
|
|
41326
|
-
edges:
|
|
41632
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
41633
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
41327
41634
|
pageInfo: workGraphPageInfoSchema
|
|
41328
41635
|
});
|
|
41329
41636
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
41330
|
-
rootId:
|
|
41331
|
-
maxDepth:
|
|
41637
|
+
rootId: z16.string().min(1),
|
|
41638
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
41332
41639
|
});
|
|
41333
|
-
var tasksTreeResultSchema =
|
|
41334
|
-
rootId:
|
|
41335
|
-
nodes:
|
|
41336
|
-
edges:
|
|
41640
|
+
var tasksTreeResultSchema = z16.object({
|
|
41641
|
+
rootId: z16.string().min(1),
|
|
41642
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
41643
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
41337
41644
|
pageInfo: workGraphPageInfoSchema
|
|
41338
41645
|
});
|
|
41339
|
-
var tasksRollupParamsSchema =
|
|
41340
|
-
rootId:
|
|
41646
|
+
var tasksRollupParamsSchema = z16.object({
|
|
41647
|
+
rootId: z16.string().min(1),
|
|
41341
41648
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
41342
41649
|
});
|
|
41343
|
-
var tasksRollupResultSchema =
|
|
41344
|
-
rootId:
|
|
41650
|
+
var tasksRollupResultSchema = z16.object({
|
|
41651
|
+
rootId: z16.string().min(1),
|
|
41345
41652
|
direct: workGraphRollupCountsSchema,
|
|
41346
41653
|
subtree: workGraphRollupCountsSchema,
|
|
41347
|
-
percentDenominator:
|
|
41348
|
-
basis:
|
|
41349
|
-
total:
|
|
41350
|
-
description:
|
|
41654
|
+
percentDenominator: z16.object({
|
|
41655
|
+
basis: z16.literal("subtree-total"),
|
|
41656
|
+
total: z16.number().int().nonnegative(),
|
|
41657
|
+
description: z16.string().min(1)
|
|
41351
41658
|
}),
|
|
41352
41659
|
percentages: workGraphSubtreePercentagesSchema,
|
|
41353
|
-
staleProjection:
|
|
41354
|
-
projectionMismatches:
|
|
41355
|
-
});
|
|
41356
|
-
var tasksFrontierParamsSchema =
|
|
41357
|
-
rootId:
|
|
41358
|
-
role:
|
|
41359
|
-
});
|
|
41360
|
-
var tasksFrontierResultSchema =
|
|
41361
|
-
rootId:
|
|
41362
|
-
role:
|
|
41363
|
-
groups:
|
|
41364
|
-
ready:
|
|
41365
|
-
blocked:
|
|
41366
|
-
blockedBy:
|
|
41367
|
-
|
|
41368
|
-
|
|
41369
|
-
kind:
|
|
41370
|
-
blockerId:
|
|
41371
|
-
blocks:
|
|
41660
|
+
staleProjection: z16.boolean(),
|
|
41661
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
41662
|
+
});
|
|
41663
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
41664
|
+
rootId: z16.string().min(1),
|
|
41665
|
+
role: z16.string().min(1).optional()
|
|
41666
|
+
});
|
|
41667
|
+
var tasksFrontierResultSchema = z16.object({
|
|
41668
|
+
rootId: z16.string().min(1),
|
|
41669
|
+
role: z16.string().min(1).optional(),
|
|
41670
|
+
groups: z16.object({
|
|
41671
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41672
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41673
|
+
blockedBy: z16.array(
|
|
41674
|
+
z16.discriminatedUnion("kind", [
|
|
41675
|
+
z16.object({
|
|
41676
|
+
kind: z16.literal("dependency"),
|
|
41677
|
+
blockerId: z16.string().min(1),
|
|
41678
|
+
blocks: z16.array(z16.string().min(1))
|
|
41372
41679
|
}),
|
|
41373
|
-
|
|
41374
|
-
kind:
|
|
41680
|
+
z16.object({
|
|
41681
|
+
kind: z16.literal("gate"),
|
|
41375
41682
|
gate: verificationGateSchema,
|
|
41376
|
-
blocks:
|
|
41683
|
+
blocks: z16.array(z16.string().min(1))
|
|
41377
41684
|
})
|
|
41378
41685
|
])
|
|
41379
41686
|
)
|
|
41380
41687
|
})
|
|
41381
41688
|
});
|
|
41382
41689
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
41383
|
-
rootId:
|
|
41384
|
-
maxDepth:
|
|
41385
|
-
includeRelations:
|
|
41386
|
-
});
|
|
41387
|
-
var tasksWorkGraphAuditResultSchema =
|
|
41388
|
-
rootId:
|
|
41389
|
-
hierarchy:
|
|
41390
|
-
valid:
|
|
41391
|
-
violations:
|
|
41392
|
-
|
|
41393
|
-
code:
|
|
41394
|
-
taskId:
|
|
41690
|
+
rootId: z16.string().min(1),
|
|
41691
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41692
|
+
includeRelations: z16.boolean().optional()
|
|
41693
|
+
});
|
|
41694
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
41695
|
+
rootId: z16.string().min(1),
|
|
41696
|
+
hierarchy: z16.object({
|
|
41697
|
+
valid: z16.boolean(),
|
|
41698
|
+
violations: z16.array(
|
|
41699
|
+
z16.object({
|
|
41700
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
41701
|
+
taskId: z16.string().min(1),
|
|
41395
41702
|
taskType: taskTypeSchema,
|
|
41396
|
-
parentId:
|
|
41703
|
+
parentId: z16.string().min(1).nullable(),
|
|
41397
41704
|
parentType: taskTypeSchema.optional(),
|
|
41398
|
-
message:
|
|
41705
|
+
message: z16.string().min(1)
|
|
41399
41706
|
})
|
|
41400
41707
|
)
|
|
41401
41708
|
}),
|
|
41402
41709
|
traversal: tasksTraverseResultSchema,
|
|
41403
41710
|
frontier: tasksFrontierResultSchema,
|
|
41404
41711
|
rollup: tasksRollupResultSchema,
|
|
41405
|
-
relationEdges:
|
|
41406
|
-
rootId:
|
|
41712
|
+
relationEdges: z16.object({
|
|
41713
|
+
rootId: z16.string().min(1),
|
|
41407
41714
|
direction: workGraphEdgeDirectionSchema,
|
|
41408
|
-
edges:
|
|
41409
|
-
|
|
41715
|
+
edges: z16.array(
|
|
41716
|
+
z16.discriminatedUnion("source", [
|
|
41410
41717
|
workGraphRelationEdgeSchema,
|
|
41411
41718
|
workGraphDependencyEdgeSchema
|
|
41412
41719
|
])
|
|
@@ -41415,60 +41722,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
41415
41722
|
});
|
|
41416
41723
|
|
|
41417
41724
|
// packages/contracts/src/operations/docs.ts
|
|
41418
|
-
import { z as
|
|
41419
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
41420
|
-
version:
|
|
41421
|
-
operation:
|
|
41422
|
-
identity:
|
|
41423
|
-
projectId:
|
|
41424
|
-
projectRoot:
|
|
41425
|
-
actor:
|
|
41426
|
-
operation:
|
|
41427
|
-
idempotencyKey:
|
|
41725
|
+
import { z as z17 } from "zod";
|
|
41726
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
41727
|
+
version: z17.literal(1),
|
|
41728
|
+
operation: z17.literal("docs.projection"),
|
|
41729
|
+
identity: z17.object({
|
|
41730
|
+
projectId: z17.string().min(1),
|
|
41731
|
+
projectRoot: z17.string().min(1),
|
|
41732
|
+
actor: z17.string().min(1),
|
|
41733
|
+
operation: z17.literal("docs.projection"),
|
|
41734
|
+
idempotencyKey: z17.string().min(1)
|
|
41428
41735
|
}).strict(),
|
|
41429
|
-
source:
|
|
41430
|
-
attachmentId:
|
|
41431
|
-
sha256:
|
|
41432
|
-
ownerId:
|
|
41433
|
-
ownerType:
|
|
41434
|
-
label:
|
|
41736
|
+
source: z17.object({
|
|
41737
|
+
attachmentId: z17.string().min(1),
|
|
41738
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
41739
|
+
ownerId: z17.string().min(1),
|
|
41740
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
41741
|
+
label: z17.string().min(1)
|
|
41435
41742
|
}).strict(),
|
|
41436
|
-
observation:
|
|
41437
|
-
kind:
|
|
41438
|
-
attachmentId:
|
|
41439
|
-
ownerId:
|
|
41440
|
-
addedAt:
|
|
41441
|
-
slug:
|
|
41442
|
-
type:
|
|
41743
|
+
observation: z17.object({
|
|
41744
|
+
kind: z17.literal("doc-attachment"),
|
|
41745
|
+
attachmentId: z17.string().min(1),
|
|
41746
|
+
ownerId: z17.string().min(1),
|
|
41747
|
+
addedAt: z17.string().min(1),
|
|
41748
|
+
slug: z17.string().optional(),
|
|
41749
|
+
type: z17.string().optional()
|
|
41443
41750
|
}).strict()
|
|
41444
41751
|
}).strict();
|
|
41445
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
41446
|
-
version:
|
|
41447
|
-
sourceHash:
|
|
41448
|
-
graph:
|
|
41752
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
41753
|
+
version: z17.literal(1),
|
|
41754
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
41755
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
41449
41756
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
41450
|
-
observationId:
|
|
41757
|
+
observationId: z17.string().min(1).optional(),
|
|
41451
41758
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
41452
|
-
documents:
|
|
41453
|
-
verifiedAt:
|
|
41454
|
-
actor:
|
|
41759
|
+
documents: z17.literal(true).optional(),
|
|
41760
|
+
verifiedAt: z17.string().min(1),
|
|
41761
|
+
actor: z17.string().min(1)
|
|
41455
41762
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
41456
41763
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
41457
41764
|
});
|
|
41458
41765
|
|
|
41459
41766
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
41460
|
-
import { z as
|
|
41461
|
-
var taskTreeEntrySchema =
|
|
41462
|
-
title:
|
|
41463
|
-
acceptance:
|
|
41767
|
+
import { z as z18 } from "zod";
|
|
41768
|
+
var taskTreeEntrySchema = z18.object({
|
|
41769
|
+
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" }),
|
|
41770
|
+
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), {
|
|
41464
41771
|
message: "acceptance array contains no non-empty strings"
|
|
41465
41772
|
}),
|
|
41466
|
-
id:
|
|
41467
|
-
parentId:
|
|
41468
|
-
depends:
|
|
41773
|
+
id: z18.string().optional(),
|
|
41774
|
+
parentId: z18.string().optional(),
|
|
41775
|
+
depends: z18.array(z18.string()).optional()
|
|
41469
41776
|
});
|
|
41470
|
-
var taskTreeSchema =
|
|
41471
|
-
var evidenceSchema =
|
|
41777
|
+
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" });
|
|
41778
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
41472
41779
|
if (value === null || value === void 0) {
|
|
41473
41780
|
ctx.addIssue({
|
|
41474
41781
|
code: "custom",
|
|
@@ -41502,7 +41809,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
41502
41809
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
41503
41810
|
});
|
|
41504
41811
|
});
|
|
41505
|
-
var passthroughSchema =
|
|
41812
|
+
var passthroughSchema = z18.unknown();
|
|
41506
41813
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
41507
41814
|
// release.cantbook
|
|
41508
41815
|
"version_bump_report",
|
|
@@ -41535,44 +41842,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
41535
41842
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
41536
41843
|
|
|
41537
41844
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
41538
|
-
import { z as
|
|
41539
|
-
var parsedPrEvidenceAtomSchema =
|
|
41540
|
-
kind:
|
|
41541
|
-
prNumber:
|
|
41542
|
-
});
|
|
41543
|
-
var prEvidenceStateModifierSchema =
|
|
41544
|
-
kind:
|
|
41545
|
-
value:
|
|
41546
|
-
});
|
|
41547
|
-
var ghPrViewSchema =
|
|
41548
|
-
state:
|
|
41549
|
-
mergedAt:
|
|
41550
|
-
headRefOid:
|
|
41551
|
-
mergeCommit:
|
|
41552
|
-
title:
|
|
41553
|
-
body:
|
|
41554
|
-
headRefName:
|
|
41555
|
-
files:
|
|
41556
|
-
changedFiles:
|
|
41557
|
-
mergeable:
|
|
41558
|
-
statusCheckRollup:
|
|
41559
|
-
|
|
41560
|
-
__typename:
|
|
41561
|
-
name:
|
|
41562
|
-
workflowName:
|
|
41563
|
-
conclusion:
|
|
41564
|
-
status:
|
|
41845
|
+
import { z as z19 } from "zod";
|
|
41846
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
41847
|
+
kind: z19.literal("pr"),
|
|
41848
|
+
prNumber: z19.number().int().positive()
|
|
41849
|
+
});
|
|
41850
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
41851
|
+
kind: z19.literal("state"),
|
|
41852
|
+
value: z19.literal("MERGED")
|
|
41853
|
+
});
|
|
41854
|
+
var ghPrViewSchema = z19.object({
|
|
41855
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
41856
|
+
mergedAt: z19.string().nullable(),
|
|
41857
|
+
headRefOid: z19.string().optional(),
|
|
41858
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
41859
|
+
title: z19.string().optional(),
|
|
41860
|
+
body: z19.string().optional(),
|
|
41861
|
+
headRefName: z19.string().optional(),
|
|
41862
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
41863
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
41864
|
+
mergeable: z19.string().optional(),
|
|
41865
|
+
statusCheckRollup: z19.array(
|
|
41866
|
+
z19.object({
|
|
41867
|
+
__typename: z19.string().optional(),
|
|
41868
|
+
name: z19.string().optional(),
|
|
41869
|
+
workflowName: z19.string().optional(),
|
|
41870
|
+
conclusion: z19.string().nullable().optional(),
|
|
41871
|
+
status: z19.string().optional(),
|
|
41565
41872
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
41566
|
-
startedAt:
|
|
41873
|
+
startedAt: z19.string().nullable().optional(),
|
|
41567
41874
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
41568
|
-
completedAt:
|
|
41875
|
+
completedAt: z19.string().nullable().optional()
|
|
41569
41876
|
}).passthrough()
|
|
41570
41877
|
).optional().default([])
|
|
41571
41878
|
}).passthrough();
|
|
41572
41879
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
41573
41880
|
|
|
41574
41881
|
// packages/contracts/src/release/plan.ts
|
|
41575
|
-
import { z as
|
|
41882
|
+
import { z as z20 } from "zod";
|
|
41576
41883
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
41577
41884
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
41578
41885
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -41616,20 +41923,20 @@ var RESOLVED_SOURCE = [
|
|
|
41616
41923
|
"language-default",
|
|
41617
41924
|
"legacy-alias"
|
|
41618
41925
|
];
|
|
41619
|
-
var ReleaseChannelSchema =
|
|
41620
|
-
var ReleaseSchemeSchema =
|
|
41621
|
-
var ReleaseKindSchema =
|
|
41622
|
-
var ReleaseStatusSchema =
|
|
41623
|
-
var GateStatusSchema =
|
|
41624
|
-
var GateNameSchema =
|
|
41625
|
-
var PlatformTupleSchema =
|
|
41626
|
-
var PublisherSchema =
|
|
41627
|
-
var TaskKindSchema =
|
|
41628
|
-
var ImpactSchema =
|
|
41629
|
-
var ResolvedSourceSchema =
|
|
41630
|
-
var Iso8601 =
|
|
41631
|
-
var NonEmptyString =
|
|
41632
|
-
var ReleasePlanTaskSchema =
|
|
41926
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
41927
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
41928
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
41929
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
41930
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
41931
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
41932
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
41933
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
41934
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
41935
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
41936
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
41937
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
41938
|
+
var NonEmptyString = z20.string().min(1);
|
|
41939
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
41633
41940
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
41634
41941
|
id: NonEmptyString,
|
|
41635
41942
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -41637,20 +41944,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
41637
41944
|
/** SemVer impact classification. */
|
|
41638
41945
|
impact: ImpactSchema,
|
|
41639
41946
|
/** Human-readable changelog line for this task. */
|
|
41640
|
-
userFacingSummary:
|
|
41947
|
+
userFacingSummary: z20.string(),
|
|
41641
41948
|
/**
|
|
41642
41949
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
41643
41950
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
41644
41951
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
41645
41952
|
* enforces non-empty via R-301.
|
|
41646
41953
|
*/
|
|
41647
|
-
evidenceAtoms:
|
|
41954
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
41648
41955
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
41649
|
-
ivtrPhaseAtPlan:
|
|
41956
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
41650
41957
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
41651
41958
|
epicAncestor: NonEmptyString
|
|
41652
41959
|
});
|
|
41653
|
-
var ReleaseGateSchema =
|
|
41960
|
+
var ReleaseGateSchema = z20.object({
|
|
41654
41961
|
/** Canonical gate name. */
|
|
41655
41962
|
name: GateNameSchema,
|
|
41656
41963
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -41660,11 +41967,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
41660
41967
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
41661
41968
|
lastVerifiedAt: Iso8601,
|
|
41662
41969
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
41663
|
-
resolvedCommand:
|
|
41970
|
+
resolvedCommand: z20.string().optional(),
|
|
41664
41971
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
41665
41972
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
41666
41973
|
});
|
|
41667
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
41974
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
41668
41975
|
/** Target platform tuple. */
|
|
41669
41976
|
platform: PlatformTupleSchema,
|
|
41670
41977
|
/** Distribution backend. */
|
|
@@ -41672,47 +41979,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
41672
41979
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
41673
41980
|
package: NonEmptyString,
|
|
41674
41981
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
41675
|
-
smoke:
|
|
41982
|
+
smoke: z20.boolean().default(true).optional()
|
|
41676
41983
|
});
|
|
41677
|
-
var ReleasePreflightSummarySchema =
|
|
41984
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
41678
41985
|
/** True if esbuild externals are out of sync with package.json. */
|
|
41679
|
-
esbuildExternalsDrift:
|
|
41986
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
41680
41987
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
41681
|
-
lockfileDrift:
|
|
41988
|
+
lockfileDrift: z20.boolean(),
|
|
41682
41989
|
/** True if all epic children are in terminal lifecycle states. */
|
|
41683
|
-
epicCompletenessClean:
|
|
41990
|
+
epicCompletenessClean: z20.boolean(),
|
|
41684
41991
|
/** True if no task appears in multiple in-flight release plans. */
|
|
41685
|
-
doubleListingClean:
|
|
41992
|
+
doubleListingClean: z20.boolean(),
|
|
41686
41993
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
41687
|
-
preflightWarnings:
|
|
41994
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
41688
41995
|
});
|
|
41689
|
-
var ReleasePlanChangelogSchema =
|
|
41996
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
41690
41997
|
/** `kind=feat` tasks. */
|
|
41691
|
-
features:
|
|
41998
|
+
features: z20.array(NonEmptyString).default([]),
|
|
41692
41999
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
41693
|
-
fixes:
|
|
42000
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
41694
42001
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
41695
|
-
chores:
|
|
42002
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
41696
42003
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
41697
|
-
breaking:
|
|
42004
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
41698
42005
|
});
|
|
41699
|
-
var ReleasePlanMetaSchema =
|
|
42006
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
41700
42007
|
/** True if this is the project's first ever release. */
|
|
41701
|
-
firstEverRelease:
|
|
42008
|
+
firstEverRelease: z20.boolean().optional(),
|
|
41702
42009
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
41703
|
-
unresolvedTools:
|
|
42010
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
41704
42011
|
/** Project archetype detected at plan time. */
|
|
41705
|
-
archetype:
|
|
41706
|
-
}).catchall(
|
|
41707
|
-
var ReleasePlanSchema =
|
|
42012
|
+
archetype: z20.string().optional()
|
|
42013
|
+
}).catchall(z20.unknown());
|
|
42014
|
+
var ReleasePlanSchema = z20.object({
|
|
41708
42015
|
/** Schema URL for this plan version. */
|
|
41709
|
-
$schema:
|
|
42016
|
+
$schema: z20.string().optional(),
|
|
41710
42017
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
41711
42018
|
version: NonEmptyString,
|
|
41712
42019
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
41713
42020
|
resolvedVersion: NonEmptyString,
|
|
41714
42021
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
41715
|
-
suffixApplied:
|
|
42022
|
+
suffixApplied: z20.boolean(),
|
|
41716
42023
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
41717
42024
|
scheme: ReleaseSchemeSchema,
|
|
41718
42025
|
/** npm dist-tag channel for this release. */
|
|
@@ -41726,7 +42033,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
41726
42033
|
/** Release-kind classification. */
|
|
41727
42034
|
releaseKind: ReleaseKindSchema,
|
|
41728
42035
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
41729
|
-
hooksV1Promotion:
|
|
42036
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
41730
42037
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
41731
42038
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
41732
42039
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -41737,27 +42044,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
41737
42044
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
41738
42045
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
41739
42046
|
*/
|
|
41740
|
-
previousVersion:
|
|
42047
|
+
previousVersion: z20.string().nullable(),
|
|
41741
42048
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
41742
|
-
previousTag:
|
|
42049
|
+
previousTag: z20.string().nullable(),
|
|
41743
42050
|
/** ISO-8601 timestamp the previous release was published. */
|
|
41744
42051
|
previousShippedAt: Iso8601.nullable(),
|
|
41745
42052
|
/** Tasks rolled into this release. */
|
|
41746
|
-
tasks:
|
|
42053
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
41747
42054
|
/** Bucketed changelog. */
|
|
41748
42055
|
changelog: ReleasePlanChangelogSchema,
|
|
41749
42056
|
/** Per-gate verification status. */
|
|
41750
|
-
gates:
|
|
42057
|
+
gates: z20.array(ReleaseGateSchema),
|
|
41751
42058
|
/** Platform / publisher matrix. */
|
|
41752
|
-
platformMatrix:
|
|
42059
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
41753
42060
|
/** Preflight summary from `cleo release plan`. */
|
|
41754
42061
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
41755
42062
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
41756
|
-
workflowRunUrl:
|
|
42063
|
+
workflowRunUrl: z20.string().nullable(),
|
|
41757
42064
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
41758
|
-
prUrl:
|
|
42065
|
+
prUrl: z20.string().nullable(),
|
|
41759
42066
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
41760
|
-
mergeCommitSha:
|
|
42067
|
+
mergeCommitSha: z20.string().nullable(),
|
|
41761
42068
|
/** Current FSM state per R-302. */
|
|
41762
42069
|
status: ReleaseStatusSchema,
|
|
41763
42070
|
/** Informational / forward-compat metadata. */
|
|
@@ -41787,48 +42094,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
41787
42094
|
]);
|
|
41788
42095
|
|
|
41789
42096
|
// packages/contracts/src/session-journal.ts
|
|
41790
|
-
import { z as
|
|
42097
|
+
import { z as z21 } from "zod";
|
|
41791
42098
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
41792
|
-
var sessionJournalDoctorSummarySchema =
|
|
42099
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
41793
42100
|
/** `true` when zero noise patterns were detected. */
|
|
41794
|
-
isClean:
|
|
42101
|
+
isClean: z21.boolean(),
|
|
41795
42102
|
/** Total number of noise findings across all patterns. */
|
|
41796
|
-
findingsCount:
|
|
42103
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
41797
42104
|
/** Pattern names that were detected (empty when isClean). */
|
|
41798
|
-
patterns:
|
|
42105
|
+
patterns: z21.array(z21.string()),
|
|
41799
42106
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
41800
|
-
totalScanned:
|
|
42107
|
+
totalScanned: z21.number().int().nonnegative()
|
|
41801
42108
|
});
|
|
41802
|
-
var sessionJournalDebriefSummarySchema =
|
|
42109
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
41803
42110
|
/** First 200 characters of the session end note (if provided). */
|
|
41804
|
-
noteExcerpt:
|
|
42111
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
41805
42112
|
/** Number of tasks completed during the session. */
|
|
41806
|
-
tasksCompletedCount:
|
|
42113
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
41807
42114
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
41808
|
-
tasksFocused:
|
|
42115
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
41809
42116
|
});
|
|
41810
|
-
var sessionJournalEntrySchema =
|
|
42117
|
+
var sessionJournalEntrySchema = z21.object({
|
|
41811
42118
|
// Identity
|
|
41812
42119
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
41813
|
-
schemaVersion:
|
|
42120
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
41814
42121
|
/** ISO 8601 timestamp when the entry was written. */
|
|
41815
|
-
timestamp:
|
|
42122
|
+
timestamp: z21.string(),
|
|
41816
42123
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
41817
|
-
sessionId:
|
|
42124
|
+
sessionId: z21.string(),
|
|
41818
42125
|
/** Event type that triggered this journal entry. */
|
|
41819
|
-
eventType:
|
|
42126
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
41820
42127
|
// Session metadata (set on session_start / session_end)
|
|
41821
42128
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
41822
|
-
agentIdentifier:
|
|
42129
|
+
agentIdentifier: z21.string().optional(),
|
|
41823
42130
|
/** Provider adapter ID active for this session. */
|
|
41824
|
-
providerId:
|
|
42131
|
+
providerId: z21.string().optional(),
|
|
41825
42132
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
41826
|
-
scope:
|
|
42133
|
+
scope: z21.string().optional(),
|
|
41827
42134
|
// Session-end fields
|
|
41828
42135
|
/** Duration of the session in seconds (session_end only). */
|
|
41829
|
-
duration:
|
|
42136
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
41830
42137
|
/** Task IDs (not titles) completed during the session. */
|
|
41831
|
-
tasksCompleted:
|
|
42138
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
41832
42139
|
// Doctor summary (T1262 absorbed)
|
|
41833
42140
|
/**
|
|
41834
42141
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -41843,52 +42150,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
41843
42150
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
41844
42151
|
// Optional hash chain
|
|
41845
42152
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
41846
|
-
prevEntryHash:
|
|
42153
|
+
prevEntryHash: z21.string().optional()
|
|
41847
42154
|
});
|
|
41848
42155
|
|
|
41849
42156
|
// packages/contracts/src/task-evidence.ts
|
|
41850
|
-
import { z as
|
|
41851
|
-
var fileEvidenceSchema =
|
|
41852
|
-
kind:
|
|
41853
|
-
sha256:
|
|
41854
|
-
timestamp:
|
|
41855
|
-
path:
|
|
41856
|
-
mime:
|
|
41857
|
-
description:
|
|
41858
|
-
});
|
|
41859
|
-
var logEvidenceSchema =
|
|
41860
|
-
kind:
|
|
41861
|
-
sha256:
|
|
41862
|
-
timestamp:
|
|
41863
|
-
source:
|
|
41864
|
-
description:
|
|
41865
|
-
});
|
|
41866
|
-
var screenshotEvidenceSchema =
|
|
41867
|
-
kind:
|
|
41868
|
-
sha256:
|
|
41869
|
-
timestamp:
|
|
41870
|
-
mime:
|
|
41871
|
-
description:
|
|
41872
|
-
});
|
|
41873
|
-
var testOutputEvidenceSchema =
|
|
41874
|
-
kind:
|
|
41875
|
-
sha256:
|
|
41876
|
-
timestamp:
|
|
41877
|
-
passed:
|
|
41878
|
-
failed:
|
|
41879
|
-
skipped:
|
|
41880
|
-
exitCode:
|
|
41881
|
-
description:
|
|
41882
|
-
});
|
|
41883
|
-
var commandOutputEvidenceSchema =
|
|
41884
|
-
kind:
|
|
41885
|
-
sha256:
|
|
41886
|
-
timestamp:
|
|
41887
|
-
cmd:
|
|
41888
|
-
exitCode:
|
|
41889
|
-
description:
|
|
41890
|
-
});
|
|
41891
|
-
var taskEvidenceSchema =
|
|
42157
|
+
import { z as z22 } from "zod";
|
|
42158
|
+
var fileEvidenceSchema = z22.object({
|
|
42159
|
+
kind: z22.literal("file"),
|
|
42160
|
+
sha256: z22.string().length(64),
|
|
42161
|
+
timestamp: z22.string().datetime(),
|
|
42162
|
+
path: z22.string().min(1),
|
|
42163
|
+
mime: z22.string().optional(),
|
|
42164
|
+
description: z22.string().optional()
|
|
42165
|
+
});
|
|
42166
|
+
var logEvidenceSchema = z22.object({
|
|
42167
|
+
kind: z22.literal("log"),
|
|
42168
|
+
sha256: z22.string().length(64),
|
|
42169
|
+
timestamp: z22.string().datetime(),
|
|
42170
|
+
source: z22.string().min(1),
|
|
42171
|
+
description: z22.string().optional()
|
|
42172
|
+
});
|
|
42173
|
+
var screenshotEvidenceSchema = z22.object({
|
|
42174
|
+
kind: z22.literal("screenshot"),
|
|
42175
|
+
sha256: z22.string().length(64),
|
|
42176
|
+
timestamp: z22.string().datetime(),
|
|
42177
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
42178
|
+
description: z22.string().optional()
|
|
42179
|
+
});
|
|
42180
|
+
var testOutputEvidenceSchema = z22.object({
|
|
42181
|
+
kind: z22.literal("test-output"),
|
|
42182
|
+
sha256: z22.string().length(64),
|
|
42183
|
+
timestamp: z22.string().datetime(),
|
|
42184
|
+
passed: z22.number().int().nonnegative(),
|
|
42185
|
+
failed: z22.number().int().nonnegative(),
|
|
42186
|
+
skipped: z22.number().int().nonnegative(),
|
|
42187
|
+
exitCode: z22.number().int(),
|
|
42188
|
+
description: z22.string().optional()
|
|
42189
|
+
});
|
|
42190
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
42191
|
+
kind: z22.literal("command-output"),
|
|
42192
|
+
sha256: z22.string().length(64),
|
|
42193
|
+
timestamp: z22.string().datetime(),
|
|
42194
|
+
cmd: z22.string().min(1),
|
|
42195
|
+
exitCode: z22.number().int(),
|
|
42196
|
+
description: z22.string().optional()
|
|
42197
|
+
});
|
|
42198
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
41892
42199
|
fileEvidenceSchema,
|
|
41893
42200
|
logEvidenceSchema,
|
|
41894
42201
|
screenshotEvidenceSchema,
|
|
@@ -41897,8 +42204,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
41897
42204
|
]);
|
|
41898
42205
|
|
|
41899
42206
|
// packages/contracts/src/tasks/archive.ts
|
|
41900
|
-
import { z as
|
|
41901
|
-
var ArchiveReason =
|
|
42207
|
+
import { z as z23 } from "zod";
|
|
42208
|
+
var ArchiveReason = z23.enum([
|
|
41902
42209
|
"verified",
|
|
41903
42210
|
"reconciled",
|
|
41904
42211
|
"superseded",
|
|
@@ -41909,42 +42216,42 @@ var ArchiveReason = z22.enum([
|
|
|
41909
42216
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
41910
42217
|
|
|
41911
42218
|
// packages/contracts/src/tasks/index.ts
|
|
41912
|
-
import { z as
|
|
41913
|
-
var taskMutationWarningSeveritySchema =
|
|
41914
|
-
var taskMutationWarningSchema =
|
|
41915
|
-
code:
|
|
41916
|
-
message:
|
|
42219
|
+
import { z as z24 } from "zod";
|
|
42220
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
42221
|
+
var taskMutationWarningSchema = z24.object({
|
|
42222
|
+
code: z24.string().min(1),
|
|
42223
|
+
message: z24.string().min(1),
|
|
41917
42224
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
41918
|
-
taskId:
|
|
41919
|
-
field:
|
|
41920
|
-
index:
|
|
41921
|
-
});
|
|
41922
|
-
var taskMutationDryRunSummarySchema =
|
|
41923
|
-
dryRun:
|
|
41924
|
-
wouldCreate:
|
|
41925
|
-
wouldUpdate:
|
|
41926
|
-
wouldDelete:
|
|
41927
|
-
wouldAffect:
|
|
41928
|
-
validatedCount:
|
|
41929
|
-
insertedCount:
|
|
41930
|
-
updatedCount:
|
|
41931
|
-
deletedCount:
|
|
41932
|
-
warnings:
|
|
41933
|
-
});
|
|
41934
|
-
var taskMutationTaskRecordSchema =
|
|
41935
|
-
var taskMutationEnvelopeSchema =
|
|
41936
|
-
dryRun:
|
|
41937
|
-
created:
|
|
41938
|
-
updated:
|
|
41939
|
-
deleted:
|
|
41940
|
-
affectedCount:
|
|
41941
|
-
mutationWarnings:
|
|
42225
|
+
taskId: z24.string().min(1).optional(),
|
|
42226
|
+
field: z24.string().min(1).optional(),
|
|
42227
|
+
index: z24.number().int().nonnegative().optional()
|
|
42228
|
+
});
|
|
42229
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
42230
|
+
dryRun: z24.literal(true),
|
|
42231
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
42232
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
42233
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
42234
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
42235
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
42236
|
+
insertedCount: z24.literal(0),
|
|
42237
|
+
updatedCount: z24.literal(0),
|
|
42238
|
+
deletedCount: z24.literal(0),
|
|
42239
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
42240
|
+
});
|
|
42241
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
42242
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
42243
|
+
dryRun: z24.boolean().optional(),
|
|
42244
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
42245
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
42246
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
42247
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
42248
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
41942
42249
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
41943
42250
|
});
|
|
41944
|
-
var completionTaskStatusSchema =
|
|
41945
|
-
var completionCriterionKindSchema =
|
|
41946
|
-
var completionCriterionStatusSchema =
|
|
41947
|
-
var completionBlockerReasonSchema =
|
|
42251
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
42252
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
42253
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
42254
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
41948
42255
|
"missing_evidence_binding",
|
|
41949
42256
|
"child_not_done",
|
|
41950
42257
|
"child_cancelled_requires_waiver",
|
|
@@ -41952,68 +42259,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
41952
42259
|
"child_missing",
|
|
41953
42260
|
"done_parent_stale"
|
|
41954
42261
|
]);
|
|
41955
|
-
var completionStaleReasonSchema =
|
|
41956
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
42262
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
42263
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
41957
42264
|
"projection_not_stale",
|
|
41958
42265
|
"criteria_missing",
|
|
41959
42266
|
"binding_target_missing",
|
|
41960
42267
|
"repair_conflict"
|
|
41961
42268
|
]);
|
|
41962
|
-
var completionCriterionWaiverSchema =
|
|
41963
|
-
criterionAcId:
|
|
41964
|
-
childTaskId:
|
|
41965
|
-
reason:
|
|
41966
|
-
actor:
|
|
41967
|
-
waivedAt:
|
|
41968
|
-
});
|
|
41969
|
-
var completionCriterionReplacementSchema =
|
|
41970
|
-
criterionAcId:
|
|
41971
|
-
originalChildTaskId:
|
|
41972
|
-
replacementChildTaskId:
|
|
41973
|
-
reason:
|
|
41974
|
-
actor:
|
|
41975
|
-
replacedAt:
|
|
41976
|
-
});
|
|
41977
|
-
var completionCriterionEvaluationSchema =
|
|
41978
|
-
acId:
|
|
41979
|
-
alias:
|
|
41980
|
-
text:
|
|
42269
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
42270
|
+
criterionAcId: z24.string().min(1),
|
|
42271
|
+
childTaskId: z24.string().min(1),
|
|
42272
|
+
reason: z24.string().min(1),
|
|
42273
|
+
actor: z24.string().min(1),
|
|
42274
|
+
waivedAt: z24.string().min(1)
|
|
42275
|
+
});
|
|
42276
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
42277
|
+
criterionAcId: z24.string().min(1),
|
|
42278
|
+
originalChildTaskId: z24.string().min(1),
|
|
42279
|
+
replacementChildTaskId: z24.string().min(1),
|
|
42280
|
+
reason: z24.string().min(1),
|
|
42281
|
+
actor: z24.string().min(1),
|
|
42282
|
+
replacedAt: z24.string().min(1)
|
|
42283
|
+
});
|
|
42284
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
42285
|
+
acId: z24.string().min(1),
|
|
42286
|
+
alias: z24.string().min(1),
|
|
42287
|
+
text: z24.string(),
|
|
41981
42288
|
kind: completionCriterionKindSchema,
|
|
41982
42289
|
status: completionCriterionStatusSchema,
|
|
41983
42290
|
reason: completionBlockerReasonSchema.optional(),
|
|
41984
|
-
targetTaskId:
|
|
42291
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
41985
42292
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
41986
42293
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
41987
42294
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
41988
42295
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
41989
|
-
evidenceBindings:
|
|
42296
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
41990
42297
|
});
|
|
41991
42298
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
41992
|
-
status:
|
|
42299
|
+
status: z24.literal("unsatisfied"),
|
|
41993
42300
|
reason: completionBlockerReasonSchema
|
|
41994
42301
|
});
|
|
41995
|
-
var completionTotalsSchema =
|
|
41996
|
-
criteria:
|
|
41997
|
-
satisfied:
|
|
41998
|
-
unsatisfied:
|
|
41999
|
-
waived:
|
|
42000
|
-
replaced:
|
|
42001
|
-
});
|
|
42002
|
-
var completionContextPackSchema =
|
|
42003
|
-
taskId:
|
|
42004
|
-
generatedAt:
|
|
42005
|
-
source:
|
|
42006
|
-
window:
|
|
42007
|
-
limit:
|
|
42008
|
-
since:
|
|
42009
|
-
relationDepth:
|
|
42010
|
-
relatedTaskIds:
|
|
42302
|
+
var completionTotalsSchema = z24.object({
|
|
42303
|
+
criteria: z24.number().int().nonnegative(),
|
|
42304
|
+
satisfied: z24.number().int().nonnegative(),
|
|
42305
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
42306
|
+
waived: z24.number().int().nonnegative(),
|
|
42307
|
+
replaced: z24.number().int().nonnegative()
|
|
42308
|
+
});
|
|
42309
|
+
var completionContextPackSchema = z24.object({
|
|
42310
|
+
taskId: z24.string().min(1),
|
|
42311
|
+
generatedAt: z24.string().min(1),
|
|
42312
|
+
source: z24.literal("audit_log"),
|
|
42313
|
+
window: z24.object({
|
|
42314
|
+
limit: z24.number().int().positive(),
|
|
42315
|
+
since: z24.string().min(1).optional(),
|
|
42316
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
42317
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
42011
42318
|
}),
|
|
42012
|
-
events:
|
|
42013
|
-
|
|
42014
|
-
id:
|
|
42015
|
-
timestamp:
|
|
42016
|
-
action:
|
|
42319
|
+
events: z24.array(
|
|
42320
|
+
z24.object({
|
|
42321
|
+
id: z24.string().min(1),
|
|
42322
|
+
timestamp: z24.string().min(1),
|
|
42323
|
+
action: z24.enum([
|
|
42017
42324
|
"task_completed",
|
|
42018
42325
|
"task_reopened",
|
|
42019
42326
|
"task_cancelled",
|
|
@@ -42021,77 +42328,77 @@ var completionContextPackSchema = z23.object({
|
|
|
42021
42328
|
"task_reparented",
|
|
42022
42329
|
"ac_projection_rebuilt"
|
|
42023
42330
|
]),
|
|
42024
|
-
taskId:
|
|
42025
|
-
relation:
|
|
42026
|
-
actor:
|
|
42027
|
-
details:
|
|
42028
|
-
before:
|
|
42029
|
-
after:
|
|
42331
|
+
taskId: z24.string().min(1),
|
|
42332
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
42333
|
+
actor: z24.string().min(1),
|
|
42334
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
42335
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
42336
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
42030
42337
|
})
|
|
42031
42338
|
),
|
|
42032
|
-
summary:
|
|
42033
|
-
totalEvents:
|
|
42034
|
-
byAction:
|
|
42035
|
-
byRelation:
|
|
42036
|
-
latestEventAt:
|
|
42339
|
+
summary: z24.object({
|
|
42340
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
42341
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
42342
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
42343
|
+
latestEventAt: z24.string().nullable()
|
|
42037
42344
|
})
|
|
42038
42345
|
});
|
|
42039
|
-
var completionEvaluationSchema =
|
|
42040
|
-
taskId:
|
|
42346
|
+
var completionEvaluationSchema = z24.object({
|
|
42347
|
+
taskId: z24.string().min(1),
|
|
42041
42348
|
taskStatus: completionTaskStatusSchema,
|
|
42042
|
-
ready:
|
|
42043
|
-
stale:
|
|
42044
|
-
staleReasons:
|
|
42349
|
+
ready: z24.boolean(),
|
|
42350
|
+
stale: z24.boolean(),
|
|
42351
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
42045
42352
|
contextPack: completionContextPackSchema.optional(),
|
|
42046
|
-
satisfied:
|
|
42047
|
-
unsatisfied:
|
|
42048
|
-
waived:
|
|
42049
|
-
replaced:
|
|
42353
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
42354
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
42355
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
42356
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
42050
42357
|
totals: completionTotalsSchema
|
|
42051
42358
|
});
|
|
42052
|
-
var completionExplanationSchema =
|
|
42053
|
-
taskId:
|
|
42054
|
-
ready:
|
|
42055
|
-
stale:
|
|
42056
|
-
summary:
|
|
42359
|
+
var completionExplanationSchema = z24.object({
|
|
42360
|
+
taskId: z24.string().min(1),
|
|
42361
|
+
ready: z24.boolean(),
|
|
42362
|
+
stale: z24.boolean(),
|
|
42363
|
+
summary: z24.string(),
|
|
42057
42364
|
contextPack: completionContextPackSchema.optional(),
|
|
42058
|
-
blockers:
|
|
42365
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
42059
42366
|
});
|
|
42060
|
-
var completionListParamsSchema =
|
|
42061
|
-
taskId:
|
|
42367
|
+
var completionListParamsSchema = z24.object({
|
|
42368
|
+
taskId: z24.string().min(1),
|
|
42062
42369
|
status: completionCriterionStatusSchema.optional(),
|
|
42063
42370
|
kind: completionCriterionKindSchema.optional()
|
|
42064
42371
|
});
|
|
42065
|
-
var completionListResultSchema =
|
|
42066
|
-
taskId:
|
|
42067
|
-
criteria:
|
|
42372
|
+
var completionListResultSchema = z24.object({
|
|
42373
|
+
taskId: z24.string().min(1),
|
|
42374
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
42068
42375
|
totals: completionTotalsSchema
|
|
42069
42376
|
});
|
|
42070
|
-
var completionEvaluateParamsSchema =
|
|
42071
|
-
taskId:
|
|
42072
|
-
includeContext:
|
|
42073
|
-
limit:
|
|
42074
|
-
since:
|
|
42075
|
-
relationDepth:
|
|
42377
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
42378
|
+
taskId: z24.string().min(1),
|
|
42379
|
+
includeContext: z24.boolean().optional(),
|
|
42380
|
+
limit: z24.number().int().positive().optional(),
|
|
42381
|
+
since: z24.string().min(1).optional(),
|
|
42382
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
42076
42383
|
});
|
|
42077
|
-
var completionProjectionRepairErrorSchema =
|
|
42384
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
42078
42385
|
code: completionProjectionRepairErrorCodeSchema,
|
|
42079
|
-
message:
|
|
42080
|
-
taskId:
|
|
42081
|
-
acId:
|
|
42082
|
-
evidenceAtomId:
|
|
42083
|
-
});
|
|
42084
|
-
var completionProjectionRepairParamsSchema =
|
|
42085
|
-
taskId:
|
|
42086
|
-
dryRun:
|
|
42087
|
-
});
|
|
42088
|
-
var completionProjectionRepairResultSchema =
|
|
42089
|
-
taskId:
|
|
42090
|
-
repaired:
|
|
42091
|
-
dryRun:
|
|
42092
|
-
staleBefore:
|
|
42093
|
-
staleAfter:
|
|
42094
|
-
errors:
|
|
42386
|
+
message: z24.string().min(1),
|
|
42387
|
+
taskId: z24.string().min(1),
|
|
42388
|
+
acId: z24.string().min(1).optional(),
|
|
42389
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
42390
|
+
});
|
|
42391
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
42392
|
+
taskId: z24.string().min(1),
|
|
42393
|
+
dryRun: z24.boolean().optional()
|
|
42394
|
+
});
|
|
42395
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
42396
|
+
taskId: z24.string().min(1),
|
|
42397
|
+
repaired: z24.boolean(),
|
|
42398
|
+
dryRun: z24.boolean(),
|
|
42399
|
+
staleBefore: z24.boolean(),
|
|
42400
|
+
staleAfter: z24.boolean(),
|
|
42401
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
42095
42402
|
});
|
|
42096
42403
|
|
|
42097
42404
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -42594,7 +42901,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
42594
42901
|
};
|
|
42595
42902
|
|
|
42596
42903
|
// packages/contracts/src/templates/manifest.ts
|
|
42597
|
-
import { z as
|
|
42904
|
+
import { z as z25 } from "zod";
|
|
42598
42905
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
42599
42906
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
42600
42907
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -42611,79 +42918,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
42611
42918
|
"tool-resolver",
|
|
42612
42919
|
"literal"
|
|
42613
42920
|
];
|
|
42614
|
-
var PlaceholderSpecSchema =
|
|
42921
|
+
var PlaceholderSpecSchema = z25.object({
|
|
42615
42922
|
/**
|
|
42616
42923
|
* Placeholder identifier as it appears in the template body
|
|
42617
42924
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
42618
42925
|
*/
|
|
42619
|
-
name:
|
|
42926
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
42620
42927
|
/** Resolver source the installer consults for this placeholder. */
|
|
42621
|
-
source:
|
|
42928
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
42622
42929
|
/**
|
|
42623
42930
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
42624
42931
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
42625
42932
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
42626
42933
|
*/
|
|
42627
|
-
sourcePath:
|
|
42934
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
42628
42935
|
/**
|
|
42629
42936
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
42630
42937
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
42631
42938
|
*/
|
|
42632
|
-
defaultValue:
|
|
42939
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
42633
42940
|
});
|
|
42634
|
-
var TemplateManifestEntrySchema =
|
|
42941
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
42635
42942
|
/** Stable identifier for this template entry. */
|
|
42636
|
-
id:
|
|
42943
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
42637
42944
|
/** Category of file this template represents. */
|
|
42638
|
-
kind:
|
|
42945
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
42639
42946
|
/** Repo-relative path of the template source file. */
|
|
42640
|
-
sourcePath:
|
|
42947
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
42641
42948
|
/** Project-relative path where the rendered template installs. */
|
|
42642
|
-
installPath:
|
|
42949
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
42643
42950
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
42644
|
-
substitution:
|
|
42951
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
42645
42952
|
/** Declared placeholders this template requires. May be empty. */
|
|
42646
|
-
placeholders:
|
|
42953
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
42647
42954
|
/** Reconciliation policy on upgrade. */
|
|
42648
|
-
updateStrategy:
|
|
42955
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
42649
42956
|
});
|
|
42650
42957
|
|
|
42651
42958
|
// packages/contracts/src/validator/index.ts
|
|
42652
|
-
import { z as
|
|
42959
|
+
import { z as z26 } from "zod";
|
|
42653
42960
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
42654
|
-
var validatorFindingSchema =
|
|
42655
|
-
acId:
|
|
42656
|
-
status:
|
|
42657
|
-
reasoning:
|
|
42658
|
-
evidenceRefs:
|
|
42659
|
-
checkedAt:
|
|
42660
|
-
});
|
|
42661
|
-
var validatorAttestationSchema =
|
|
42662
|
-
verdict:
|
|
42663
|
-
taskId:
|
|
42664
|
-
validatorId:
|
|
42665
|
-
findings:
|
|
42961
|
+
var validatorFindingSchema = z26.object({
|
|
42962
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
42963
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
42964
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
42965
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
42966
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
42967
|
+
});
|
|
42968
|
+
var validatorAttestationSchema = z26.object({
|
|
42969
|
+
verdict: z26.literal("attest"),
|
|
42970
|
+
taskId: z26.string().min(1),
|
|
42971
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
42972
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
42666
42973
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
42667
42974
|
'attestation requires every finding to have status="pass"'
|
|
42668
42975
|
),
|
|
42669
|
-
summary:
|
|
42670
|
-
attestedAt:
|
|
42671
|
-
schemaVersion:
|
|
42672
|
-
});
|
|
42673
|
-
var validatorRejectionSchema =
|
|
42674
|
-
verdict:
|
|
42675
|
-
taskId:
|
|
42676
|
-
validatorId:
|
|
42677
|
-
findings:
|
|
42976
|
+
summary: z26.string().optional(),
|
|
42977
|
+
attestedAt: z26.string().min(1),
|
|
42978
|
+
schemaVersion: z26.literal("1")
|
|
42979
|
+
});
|
|
42980
|
+
var validatorRejectionSchema = z26.object({
|
|
42981
|
+
verdict: z26.literal("reject"),
|
|
42982
|
+
taskId: z26.string().min(1),
|
|
42983
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
42984
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
42678
42985
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
42679
42986
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
42680
42987
|
),
|
|
42681
|
-
summary:
|
|
42682
|
-
remediationHints:
|
|
42683
|
-
rejectedAt:
|
|
42684
|
-
schemaVersion:
|
|
42988
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
42989
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
42990
|
+
rejectedAt: z26.string().min(1),
|
|
42991
|
+
schemaVersion: z26.literal("1")
|
|
42685
42992
|
});
|
|
42686
|
-
var validatorVerdictSchema =
|
|
42993
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
42687
42994
|
validatorAttestationSchema,
|
|
42688
42995
|
validatorRejectionSchema
|
|
42689
42996
|
]);
|
|
@@ -43433,7 +43740,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
43433
43740
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
43434
43741
|
|
|
43435
43742
|
// packages/contracts/src/decide.ts
|
|
43436
|
-
import { z as
|
|
43743
|
+
import { z as z27 } from "zod";
|
|
43437
43744
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
43438
43745
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
43439
43746
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -43455,11 +43762,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
43455
43762
|
maxScoreLevels: 10
|
|
43456
43763
|
};
|
|
43457
43764
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
43458
|
-
var decisionQuestionTypeSchema =
|
|
43459
|
-
var decisionOutcomeSourceSchema =
|
|
43460
|
-
var decisionInstructionsSchema =
|
|
43461
|
-
var unitIntervalSchema =
|
|
43462
|
-
var decisionStateSchema =
|
|
43765
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
43766
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
43767
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
43768
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
43769
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
43463
43770
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
43464
43771
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
43465
43772
|
context.addIssue({
|
|
@@ -43468,34 +43775,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
43468
43775
|
});
|
|
43469
43776
|
}
|
|
43470
43777
|
});
|
|
43471
|
-
var noulDecisionQuestionSchema =
|
|
43472
|
-
type:
|
|
43778
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
43779
|
+
type: z27.literal("noul"),
|
|
43473
43780
|
instructions: decisionInstructionsSchema.optional(),
|
|
43474
|
-
criteria:
|
|
43781
|
+
criteria: z27.string().min(1)
|
|
43475
43782
|
});
|
|
43476
|
-
var choiceDecisionQuestionSchema =
|
|
43477
|
-
type:
|
|
43783
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
43784
|
+
type: z27.literal("choice"),
|
|
43478
43785
|
instructions: decisionInstructionsSchema.optional(),
|
|
43479
|
-
criteria:
|
|
43786
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
43480
43787
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
43481
43788
|
})
|
|
43482
43789
|
});
|
|
43483
|
-
var scoreDecisionQuestionSchema =
|
|
43484
|
-
type:
|
|
43790
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
43791
|
+
type: z27.literal("score"),
|
|
43485
43792
|
instructions: decisionInstructionsSchema.optional(),
|
|
43486
|
-
criteria:
|
|
43793
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
43487
43794
|
});
|
|
43488
|
-
var decisionQuestionSchema =
|
|
43795
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
43489
43796
|
noulDecisionQuestionSchema,
|
|
43490
43797
|
choiceDecisionQuestionSchema,
|
|
43491
43798
|
scoreDecisionQuestionSchema
|
|
43492
43799
|
]);
|
|
43493
|
-
var decisionRequestSchema =
|
|
43494
|
-
model:
|
|
43495
|
-
lang:
|
|
43496
|
-
cache:
|
|
43800
|
+
var decisionRequestSchema = z27.object({
|
|
43801
|
+
model: z27.string().min(1).optional(),
|
|
43802
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
43803
|
+
cache: z27.boolean().optional(),
|
|
43497
43804
|
state: decisionStateSchema,
|
|
43498
|
-
questions:
|
|
43805
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
43499
43806
|
(questions) => {
|
|
43500
43807
|
const count = Object.keys(questions).length;
|
|
43501
43808
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -43505,139 +43812,139 @@ var decisionRequestSchema = z26.object({
|
|
|
43505
43812
|
}
|
|
43506
43813
|
)
|
|
43507
43814
|
});
|
|
43508
|
-
var noulDecisionAnswerSchema =
|
|
43509
|
-
type:
|
|
43510
|
-
value:
|
|
43815
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
43816
|
+
type: z27.literal("noul"),
|
|
43817
|
+
value: z27.boolean(),
|
|
43511
43818
|
probability: unitIntervalSchema,
|
|
43512
43819
|
confidence: unitIntervalSchema
|
|
43513
43820
|
});
|
|
43514
|
-
var choiceDecisionAnswerSchema =
|
|
43515
|
-
type:
|
|
43516
|
-
value:
|
|
43517
|
-
probabilities:
|
|
43821
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
43822
|
+
type: z27.literal("choice"),
|
|
43823
|
+
value: z27.string().min(1),
|
|
43824
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
43518
43825
|
confidence: unitIntervalSchema
|
|
43519
43826
|
});
|
|
43520
|
-
var scoreDecisionAnswerSchema =
|
|
43521
|
-
type:
|
|
43522
|
-
value:
|
|
43523
|
-
probabilities:
|
|
43827
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
43828
|
+
type: z27.literal("score"),
|
|
43829
|
+
value: z27.number().int().nonnegative(),
|
|
43830
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
43524
43831
|
confidence: unitIntervalSchema
|
|
43525
43832
|
});
|
|
43526
|
-
var decisionAnswerSchema =
|
|
43833
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
43527
43834
|
noulDecisionAnswerSchema,
|
|
43528
43835
|
choiceDecisionAnswerSchema,
|
|
43529
43836
|
scoreDecisionAnswerSchema
|
|
43530
43837
|
]);
|
|
43531
|
-
var decisionOutcomeSchema =
|
|
43532
|
-
answers:
|
|
43838
|
+
var decisionOutcomeSchema = z27.object({
|
|
43839
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
43533
43840
|
source: decisionOutcomeSourceSchema,
|
|
43534
|
-
requestId:
|
|
43535
|
-
latencyMs:
|
|
43536
|
-
costUsd:
|
|
43537
|
-
costMicros:
|
|
43538
|
-
balanceMicros:
|
|
43539
|
-
checkpoint:
|
|
43540
|
-
inputTokens:
|
|
43541
|
-
});
|
|
43542
|
-
var decisionProviderKindSchema =
|
|
43543
|
-
var decisionProviderConfigSchema =
|
|
43544
|
-
baseUrl:
|
|
43841
|
+
requestId: z27.string().min(1).optional(),
|
|
43842
|
+
latencyMs: z27.number().nonnegative(),
|
|
43843
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
43844
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
43845
|
+
balanceMicros: z27.number().int().optional(),
|
|
43846
|
+
checkpoint: z27.string().min(1).optional(),
|
|
43847
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
43848
|
+
});
|
|
43849
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
43850
|
+
var decisionProviderConfigSchema = z27.object({
|
|
43851
|
+
baseUrl: z27.url(),
|
|
43545
43852
|
provider: decisionProviderKindSchema.optional()
|
|
43546
43853
|
});
|
|
43547
43854
|
|
|
43548
43855
|
// packages/contracts/src/nexus-account.ts
|
|
43549
|
-
import { z as
|
|
43550
|
-
var nexusAccountUserSchema =
|
|
43551
|
-
id:
|
|
43552
|
-
email:
|
|
43553
|
-
name:
|
|
43554
|
-
});
|
|
43555
|
-
var nexusAccountOrganizationSchema =
|
|
43556
|
-
id:
|
|
43557
|
-
name:
|
|
43558
|
-
slug:
|
|
43559
|
-
role:
|
|
43856
|
+
import { z as z28 } from "zod";
|
|
43857
|
+
var nexusAccountUserSchema = z28.object({
|
|
43858
|
+
id: z28.string(),
|
|
43859
|
+
email: z28.string(),
|
|
43860
|
+
name: z28.string().nullable().optional()
|
|
43861
|
+
});
|
|
43862
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
43863
|
+
id: z28.string(),
|
|
43864
|
+
name: z28.string(),
|
|
43865
|
+
slug: z28.string().nullable().optional(),
|
|
43866
|
+
role: z28.string().optional(),
|
|
43560
43867
|
/** `true` for the personal organization created at sign-up. */
|
|
43561
|
-
personal:
|
|
43868
|
+
personal: z28.boolean().optional()
|
|
43562
43869
|
});
|
|
43563
|
-
var nexusAccountMeSchema =
|
|
43870
|
+
var nexusAccountMeSchema = z28.object({
|
|
43564
43871
|
user: nexusAccountUserSchema,
|
|
43565
|
-
organizations:
|
|
43872
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
43566
43873
|
});
|
|
43567
43874
|
|
|
43568
43875
|
// packages/contracts/src/nexus-cloud.ts
|
|
43569
|
-
import { z as
|
|
43876
|
+
import { z as z29 } from "zod";
|
|
43570
43877
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
43571
43878
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
43572
43879
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
43573
|
-
var isoTime =
|
|
43574
|
-
var profile =
|
|
43575
|
-
var deviceState =
|
|
43576
|
-
var nexusCloudCredentialSchema =
|
|
43577
|
-
kind:
|
|
43578
|
-
credentialId:
|
|
43880
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
43881
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
43882
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
43883
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
43884
|
+
kind: z29.enum(["device", "session"]),
|
|
43885
|
+
credentialId: z29.string().nullable().optional(),
|
|
43579
43886
|
profile: profile.optional(),
|
|
43580
|
-
scopes:
|
|
43887
|
+
scopes: z29.array(z29.string()).default([]),
|
|
43581
43888
|
createdAt: isoTime.nullable().optional(),
|
|
43582
43889
|
lastUsedAt: isoTime.nullable().optional(),
|
|
43583
43890
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
43584
43891
|
idleExpiresAt: isoTime.nullable().optional()
|
|
43585
43892
|
});
|
|
43586
|
-
var nexusCloudDeviceSchema =
|
|
43587
|
-
deviceId:
|
|
43588
|
-
name:
|
|
43589
|
-
platform:
|
|
43590
|
-
arch:
|
|
43591
|
-
cliVersion:
|
|
43893
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
43894
|
+
deviceId: z29.string(),
|
|
43895
|
+
name: z29.string(),
|
|
43896
|
+
platform: z29.string().optional(),
|
|
43897
|
+
arch: z29.string().nullable().optional(),
|
|
43898
|
+
cliVersion: z29.string().nullable().optional(),
|
|
43592
43899
|
createdAt: isoTime.optional(),
|
|
43593
43900
|
lastSeenAt: isoTime.nullable().optional(),
|
|
43594
43901
|
state: deviceState,
|
|
43595
43902
|
signedOutAt: isoTime.nullable().optional(),
|
|
43596
43903
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
43597
|
-
certificate:
|
|
43904
|
+
certificate: z29.string().nullable().optional(),
|
|
43598
43905
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
43599
43906
|
profile: profile.optional(),
|
|
43600
43907
|
/** True for the device whose credential made this request. */
|
|
43601
|
-
current:
|
|
43602
|
-
projects:
|
|
43603
|
-
replicas:
|
|
43908
|
+
current: z29.boolean().default(false),
|
|
43909
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
43910
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
43604
43911
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43605
43912
|
lastPresenceAt: isoTime.nullable().optional()
|
|
43606
43913
|
});
|
|
43607
|
-
var nexusCloudOrganizationSchema =
|
|
43608
|
-
id:
|
|
43609
|
-
name:
|
|
43610
|
-
slug:
|
|
43611
|
-
role:
|
|
43612
|
-
personal:
|
|
43914
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
43915
|
+
id: z29.string(),
|
|
43916
|
+
name: z29.string(),
|
|
43917
|
+
slug: z29.string().nullable().optional(),
|
|
43918
|
+
role: z29.string().optional(),
|
|
43919
|
+
personal: z29.boolean().optional()
|
|
43613
43920
|
});
|
|
43614
|
-
var nexusCloudUserSchema =
|
|
43615
|
-
id:
|
|
43616
|
-
email:
|
|
43617
|
-
name:
|
|
43921
|
+
var nexusCloudUserSchema = z29.object({
|
|
43922
|
+
id: z29.string(),
|
|
43923
|
+
email: z29.string(),
|
|
43924
|
+
name: z29.string().nullable().optional()
|
|
43618
43925
|
});
|
|
43619
|
-
var nexusCloudWhoamiSchema =
|
|
43926
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
43620
43927
|
serverTime: isoTime.optional(),
|
|
43621
43928
|
user: nexusCloudUserSchema,
|
|
43622
|
-
organizations:
|
|
43929
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
43623
43930
|
credential: nexusCloudCredentialSchema,
|
|
43624
43931
|
/** The calling device; null for a session caller. */
|
|
43625
43932
|
device: nexusCloudDeviceSchema.nullable()
|
|
43626
43933
|
});
|
|
43627
|
-
var nexusCloudDevicePageSchema =
|
|
43628
|
-
devices:
|
|
43629
|
-
nextCursor:
|
|
43630
|
-
truncated:
|
|
43934
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
43935
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
43936
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43937
|
+
truncated: z29.boolean().default(false)
|
|
43631
43938
|
});
|
|
43632
|
-
var nexusCloudPresenceSchema =
|
|
43939
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
43633
43940
|
observedAt: isoTime.optional(),
|
|
43634
|
-
sync:
|
|
43941
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
43635
43942
|
});
|
|
43636
|
-
var nexusCloudReplicaSchema =
|
|
43637
|
-
projectId:
|
|
43638
|
-
replicaId:
|
|
43639
|
-
deviceId:
|
|
43640
|
-
deviceName:
|
|
43943
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
43944
|
+
projectId: z29.string(),
|
|
43945
|
+
replicaId: z29.string(),
|
|
43946
|
+
deviceId: z29.string(),
|
|
43947
|
+
deviceName: z29.string(),
|
|
43641
43948
|
deviceState: deviceState.optional(),
|
|
43642
43949
|
attachedAt: isoTime.optional(),
|
|
43643
43950
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -43646,72 +43953,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
43646
43953
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
43647
43954
|
retiredAt: isoTime.nullable().optional(),
|
|
43648
43955
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
43649
|
-
successor:
|
|
43956
|
+
successor: z29.string().nullable().optional()
|
|
43650
43957
|
});
|
|
43651
|
-
var nexusCloudDeviceCountsSchema =
|
|
43652
|
-
active:
|
|
43653
|
-
total:
|
|
43958
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
43959
|
+
active: z29.number().int().nonnegative(),
|
|
43960
|
+
total: z29.number().int().nonnegative()
|
|
43654
43961
|
});
|
|
43655
43962
|
var projectFields = {
|
|
43656
|
-
projectId:
|
|
43657
|
-
label:
|
|
43658
|
-
organizationId:
|
|
43659
|
-
organizationName:
|
|
43660
|
-
remoteUrl:
|
|
43963
|
+
projectId: z29.string(),
|
|
43964
|
+
label: z29.string().nullable(),
|
|
43965
|
+
organizationId: z29.string(),
|
|
43966
|
+
organizationName: z29.string().optional(),
|
|
43967
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
43661
43968
|
createdAt: isoTime.optional()
|
|
43662
43969
|
};
|
|
43663
|
-
var nexusCloudProjectListItemSchema =
|
|
43970
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
43664
43971
|
...projectFields,
|
|
43665
|
-
role:
|
|
43972
|
+
role: z29.string(),
|
|
43666
43973
|
/**
|
|
43667
43974
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
43668
43975
|
* only a holder of the account key can open it (T13102).
|
|
43669
43976
|
*/
|
|
43670
|
-
encryptedName:
|
|
43671
|
-
streamId:
|
|
43672
|
-
headSeq:
|
|
43977
|
+
encryptedName: z29.string().nullable().optional(),
|
|
43978
|
+
streamId: z29.string().optional(),
|
|
43979
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
43673
43980
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
43674
|
-
headCheckpointId:
|
|
43675
|
-
openConflicts:
|
|
43676
|
-
replicas:
|
|
43981
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
43982
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
43983
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
43677
43984
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
43678
|
-
replicaCount:
|
|
43985
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
43679
43986
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43680
43987
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
43681
43988
|
/** This project's replica list was cut at 50 (T12858). */
|
|
43682
|
-
replicasTruncated:
|
|
43989
|
+
replicasTruncated: z29.boolean().default(false)
|
|
43683
43990
|
});
|
|
43684
|
-
var nexusCloudProjectPageSchema =
|
|
43685
|
-
projects:
|
|
43686
|
-
nextCursor:
|
|
43991
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
43992
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
43993
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43687
43994
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
43688
|
-
truncated:
|
|
43995
|
+
truncated: z29.boolean().default(false),
|
|
43689
43996
|
/** The project list itself was cut at 1000 (T12858). */
|
|
43690
|
-
projectsTruncated:
|
|
43997
|
+
projectsTruncated: z29.boolean().default(false)
|
|
43691
43998
|
});
|
|
43692
|
-
var nexusCloudProjectDetailSchema =
|
|
43693
|
-
project:
|
|
43694
|
-
role:
|
|
43695
|
-
canTrash:
|
|
43696
|
-
openConflicts:
|
|
43999
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
44000
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
44001
|
+
role: z29.string(),
|
|
44002
|
+
canTrash: z29.boolean().optional(),
|
|
44003
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
43697
44004
|
/** At most 50, oldest attachment first. */
|
|
43698
|
-
replicas:
|
|
44005
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
43699
44006
|
devices: nexusCloudDeviceCountsSchema,
|
|
43700
|
-
replicaCount:
|
|
44007
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
43701
44008
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43702
44009
|
/** `replicas` was cut at 50. */
|
|
43703
|
-
truncated:
|
|
43704
|
-
stream:
|
|
43705
|
-
streamId:
|
|
43706
|
-
headSeq:
|
|
43707
|
-
headCheckpointId:
|
|
44010
|
+
truncated: z29.boolean().default(false),
|
|
44011
|
+
stream: z29.object({
|
|
44012
|
+
streamId: z29.string(),
|
|
44013
|
+
headSeq: z29.number().int().nonnegative(),
|
|
44014
|
+
headCheckpointId: z29.string().nullable()
|
|
43708
44015
|
}).nullable()
|
|
43709
44016
|
});
|
|
43710
|
-
var nexusCloudReplicaPageSchema =
|
|
43711
|
-
replicas:
|
|
44017
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
44018
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
43712
44019
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
43713
|
-
nextCursor:
|
|
43714
|
-
truncated:
|
|
44020
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
44021
|
+
truncated: z29.boolean().default(false)
|
|
43715
44022
|
});
|
|
43716
44023
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
43717
44024
|
"credential.valid",
|
|
@@ -43727,56 +44034,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
43727
44034
|
];
|
|
43728
44035
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
43729
44036
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
43730
|
-
var knownCheckId =
|
|
43731
|
-
var nexusCloudStatusCheckSchema =
|
|
43732
|
-
id:
|
|
43733
|
-
ok:
|
|
43734
|
-
required:
|
|
43735
|
-
detail:
|
|
43736
|
-
});
|
|
43737
|
-
var nexusCloudStatusSchema =
|
|
44037
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
44038
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
44039
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
44040
|
+
ok: z29.boolean(),
|
|
44041
|
+
required: z29.boolean(),
|
|
44042
|
+
detail: z29.string()
|
|
44043
|
+
});
|
|
44044
|
+
var nexusCloudStatusSchema = z29.object({
|
|
43738
44045
|
serverTime: isoTime.optional(),
|
|
43739
|
-
apiVersion:
|
|
44046
|
+
apiVersion: z29.string().optional(),
|
|
43740
44047
|
/**
|
|
43741
44048
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
43742
44049
|
* than the list, which therefore support none of them.
|
|
43743
44050
|
*/
|
|
43744
|
-
features:
|
|
44051
|
+
features: z29.array(z29.string()).optional(),
|
|
43745
44052
|
user: nexusCloudUserSchema,
|
|
43746
44053
|
credential: nexusCloudCredentialSchema,
|
|
43747
44054
|
device: nexusCloudDeviceSchema.nullable(),
|
|
43748
|
-
project:
|
|
43749
|
-
projectId:
|
|
43750
|
-
registered:
|
|
43751
|
-
organizationId:
|
|
43752
|
-
organizationName:
|
|
43753
|
-
role:
|
|
44055
|
+
project: z29.object({
|
|
44056
|
+
projectId: z29.string(),
|
|
44057
|
+
registered: z29.boolean(),
|
|
44058
|
+
organizationId: z29.string().nullable(),
|
|
44059
|
+
organizationName: z29.string().nullable(),
|
|
44060
|
+
role: z29.string().nullable()
|
|
43754
44061
|
}).nullable(),
|
|
43755
|
-
replica:
|
|
43756
|
-
replicaId:
|
|
43757
|
-
attached:
|
|
43758
|
-
attachedElsewhere:
|
|
44062
|
+
replica: z29.object({
|
|
44063
|
+
replicaId: z29.string(),
|
|
44064
|
+
attached: z29.boolean(),
|
|
44065
|
+
attachedElsewhere: z29.boolean(),
|
|
43759
44066
|
attachedAt: isoTime.nullable(),
|
|
43760
44067
|
lastSyncAt: isoTime.nullable(),
|
|
43761
44068
|
presenceAt: isoTime.nullable(),
|
|
43762
|
-
lastReplicaSeq:
|
|
44069
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
43763
44070
|
}).nullable(),
|
|
43764
|
-
stream:
|
|
43765
|
-
streamId:
|
|
43766
|
-
headSeq:
|
|
43767
|
-
headCheckpointId:
|
|
43768
|
-
openConflicts:
|
|
44071
|
+
stream: z29.object({
|
|
44072
|
+
streamId: z29.string(),
|
|
44073
|
+
headSeq: z29.number().int().nonnegative(),
|
|
44074
|
+
headCheckpointId: z29.string().nullable(),
|
|
44075
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
43769
44076
|
devices: nexusCloudDeviceCountsSchema
|
|
43770
44077
|
}).nullable(),
|
|
43771
44078
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
43772
|
-
checks:
|
|
44079
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
43773
44080
|
(list) => list.flatMap((c) => {
|
|
43774
44081
|
const id = knownCheckId.safeParse(c.id);
|
|
43775
44082
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
43776
44083
|
})
|
|
43777
44084
|
),
|
|
43778
44085
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
43779
|
-
verdict:
|
|
44086
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
43780
44087
|
});
|
|
43781
44088
|
var LOGIN = "run `cleo login nexus`";
|
|
43782
44089
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -43821,52 +44128,55 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
43821
44128
|
};
|
|
43822
44129
|
|
|
43823
44130
|
// packages/contracts/src/nexus-vault.ts
|
|
43824
|
-
import { z as
|
|
43825
|
-
var isoTime2 =
|
|
43826
|
-
var uuid =
|
|
43827
|
-
var nexusUserKeysSchema =
|
|
43828
|
-
keyVersion:
|
|
43829
|
-
masterKeyVerifier:
|
|
43830
|
-
});
|
|
43831
|
-
var nexusProjectKeysSchema =
|
|
43832
|
-
keys:
|
|
43833
|
-
|
|
44131
|
+
import { z as z30 } from "zod";
|
|
44132
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
44133
|
+
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);
|
|
44134
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
44135
|
+
keyVersion: z30.number().int().positive(),
|
|
44136
|
+
masterKeyVerifier: z30.string()
|
|
44137
|
+
});
|
|
44138
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
44139
|
+
keys: z30.array(
|
|
44140
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
43834
44141
|
)
|
|
43835
44142
|
});
|
|
43836
|
-
var nexusLeaseSchema =
|
|
43837
|
-
streamId:
|
|
43838
|
-
role:
|
|
44143
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
44144
|
+
streamId: z30.string(),
|
|
44145
|
+
role: z30.string(),
|
|
43839
44146
|
replicaId: uuid,
|
|
43840
44147
|
expiresAt: isoTime2,
|
|
43841
44148
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
43842
44149
|
});
|
|
43843
|
-
var nexusLeaseAcquireSchema =
|
|
43844
|
-
var nexusStreamHeadSchema =
|
|
43845
|
-
streamId:
|
|
43846
|
-
kind:
|
|
43847
|
-
headSeq:
|
|
43848
|
-
headCheckpointId:
|
|
44150
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
44151
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
44152
|
+
streamId: z30.string(),
|
|
44153
|
+
kind: z30.string().optional(),
|
|
44154
|
+
headSeq: z30.number().int().nonnegative(),
|
|
44155
|
+
headCheckpointId: z30.string().nullable(),
|
|
43849
44156
|
/**
|
|
43850
44157
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
43851
44158
|
* Absent from an older server.
|
|
43852
44159
|
*/
|
|
43853
|
-
maxSchemaVersion:
|
|
44160
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
43854
44161
|
});
|
|
43855
|
-
var nexusActivityEventSchema =
|
|
43856
|
-
id:
|
|
44162
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
44163
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
43857
44164
|
at: isoTime2,
|
|
43858
|
-
actorUserId:
|
|
43859
|
-
actorDeviceId:
|
|
43860
|
-
requestId:
|
|
43861
|
-
action:
|
|
43862
|
-
target:
|
|
43863
|
-
detail:
|
|
44165
|
+
actorUserId: z30.string().nullable().optional(),
|
|
44166
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
44167
|
+
requestId: z30.string().nullable().optional(),
|
|
44168
|
+
action: z30.string(),
|
|
44169
|
+
target: z30.string().nullable().optional(),
|
|
44170
|
+
detail: z30.unknown().optional()
|
|
43864
44171
|
});
|
|
43865
|
-
var nexusActivityPageSchema =
|
|
43866
|
-
events:
|
|
43867
|
-
nextBefore:
|
|
44172
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
44173
|
+
events: z30.array(nexusActivityEventSchema),
|
|
44174
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
43868
44175
|
});
|
|
43869
44176
|
|
|
44177
|
+
// packages/adapters/src/providers/claude-sdk/spawn.ts
|
|
44178
|
+
import { E_LEAD_NO_OWNER_CHANNEL as E_LEAD_NO_OWNER_CHANNEL2 } from "@cleocode/contracts/operations/orchestrate.js";
|
|
44179
|
+
|
|
43870
44180
|
// packages/adapters/src/providers/shared/credentials.ts
|
|
43871
44181
|
import { existsSync, readFileSync } from "node:fs";
|
|
43872
44182
|
import { homedir } from "node:os";
|
|
@@ -44018,6 +44328,18 @@ var ClaudeSDKSpawnProvider = class {
|
|
|
44018
44328
|
const instanceId = `sdk-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
44019
44329
|
const sessionId = `cleo-${instanceId}`;
|
|
44020
44330
|
const startTime = (/* @__PURE__ */ new Date()).toISOString();
|
|
44331
|
+
if (leadDeniedTools(context) !== null && context.options?.leadMode !== "detached") {
|
|
44332
|
+
return {
|
|
44333
|
+
instanceId,
|
|
44334
|
+
taskId: context.taskId,
|
|
44335
|
+
providerId: "claude-sdk",
|
|
44336
|
+
status: "failed",
|
|
44337
|
+
startTime,
|
|
44338
|
+
endTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
44339
|
+
exitCode: 1,
|
|
44340
|
+
error: `${E_LEAD_NO_OWNER_CHANNEL2}: claude-sdk cannot deliver interactive AskUserQuestion answers; use --detached with --adapter claude-code and a configured mbx MCP server`
|
|
44341
|
+
};
|
|
44342
|
+
}
|
|
44021
44343
|
this.sessions.add({
|
|
44022
44344
|
instanceId,
|
|
44023
44345
|
sessionId,
|