@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
|
|
@@ -26836,17 +26836,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
26836
26836
|
});
|
|
26837
26837
|
|
|
26838
26838
|
// packages/contracts/src/config/manifest.ts
|
|
26839
|
-
import { z as
|
|
26839
|
+
import { z as z6 } from "zod";
|
|
26840
26840
|
|
|
26841
|
-
// packages/contracts/src/
|
|
26841
|
+
// packages/contracts/src/orca-execution.ts
|
|
26842
26842
|
import { z as z4 } from "zod";
|
|
26843
|
-
var
|
|
26844
|
-
|
|
26845
|
-
|
|
26846
|
-
|
|
26843
|
+
var identifier = z4.string().min(1);
|
|
26844
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
26845
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
26846
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
26847
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
26848
|
+
});
|
|
26849
|
+
var orcaContextSchema = z4.object({
|
|
26850
|
+
runtimeId: identifier,
|
|
26851
|
+
coordinatorHandle: identifier,
|
|
26852
|
+
executionHostId: z4.literal("local")
|
|
26853
|
+
});
|
|
26854
|
+
var orcaRoutingRunSchema = z4.object({
|
|
26855
|
+
runId: identifier.nullable(),
|
|
26856
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
26857
|
+
});
|
|
26858
|
+
var orcaLaunchSchema = z4.object({
|
|
26859
|
+
projectId: identifier,
|
|
26860
|
+
projectRoot: identifier,
|
|
26861
|
+
taskId: identifier,
|
|
26862
|
+
instanceId: identifier,
|
|
26863
|
+
workerSessionId: identifier,
|
|
26864
|
+
agentId: identifier,
|
|
26865
|
+
role: z4.enum(["worker", "lead"]),
|
|
26866
|
+
protocol: identifier,
|
|
26867
|
+
worktreePath: identifier,
|
|
26868
|
+
worktreeBranch: identifier,
|
|
26869
|
+
projectHash: identifier,
|
|
26870
|
+
lockToken: identifier,
|
|
26871
|
+
prompt: identifier,
|
|
26872
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
26873
|
+
leadMailbox: identifier.nullable(),
|
|
26874
|
+
model: identifier.optional(),
|
|
26875
|
+
effort: identifier.optional(),
|
|
26876
|
+
accountId: identifier.optional()
|
|
26877
|
+
});
|
|
26878
|
+
var orcaStartBindingSchema = z4.object({
|
|
26879
|
+
runId: identifier.nullable(),
|
|
26880
|
+
orcaTaskId: identifier.nullable(),
|
|
26881
|
+
retryOf: identifier.nullable()
|
|
26882
|
+
});
|
|
26883
|
+
var orcaAttemptSchema = z4.object({
|
|
26884
|
+
backend: z4.literal("orca"),
|
|
26885
|
+
version: z4.literal(1),
|
|
26886
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
26887
|
+
revision: z4.number().int().nonnegative(),
|
|
26888
|
+
context: orcaContextSchema,
|
|
26889
|
+
launch: orcaLaunchSchema,
|
|
26890
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26891
|
+
workspaceId: identifier,
|
|
26892
|
+
workspaceSelector: identifier,
|
|
26893
|
+
state: z4.enum([
|
|
26894
|
+
"prepared",
|
|
26895
|
+
"launching",
|
|
26896
|
+
"ready",
|
|
26897
|
+
"turn_unobserved",
|
|
26898
|
+
"outcome_unknown",
|
|
26899
|
+
"stop_pending",
|
|
26900
|
+
"stop_unknown",
|
|
26901
|
+
"stopped",
|
|
26902
|
+
"failed",
|
|
26903
|
+
"circuit_broken"
|
|
26904
|
+
]),
|
|
26905
|
+
runId: identifier.nullable(),
|
|
26906
|
+
orcaTaskId: identifier.nullable(),
|
|
26907
|
+
dispatchId: identifier.nullable(),
|
|
26908
|
+
retryOf: identifier.nullable(),
|
|
26909
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
26910
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
26911
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
26912
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
26913
|
+
startRequestId: identifier.nullable(),
|
|
26914
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
26915
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
26916
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
26917
|
+
stopRequestId: identifier.nullable(),
|
|
26918
|
+
/**
|
|
26919
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
26920
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
26921
|
+
*/
|
|
26922
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
26923
|
+
failureCount: z4.number().int().nonnegative(),
|
|
26924
|
+
resourceState: z4.string(),
|
|
26925
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
26926
|
+
lastReceipt: z4.string().nullable(),
|
|
26927
|
+
lastError: z4.string().nullable(),
|
|
26928
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
26929
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
26930
|
+
observedAt: z4.string()
|
|
26931
|
+
});
|
|
26932
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
26933
|
+
messageId: identifier,
|
|
26934
|
+
runtimeId: identifier,
|
|
26935
|
+
runId: identifier,
|
|
26936
|
+
orcaTaskId: identifier,
|
|
26937
|
+
dispatchId: identifier,
|
|
26938
|
+
senderHandle: identifier,
|
|
26939
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
26940
|
+
body: z4.string(),
|
|
26941
|
+
reportPath: identifier
|
|
26942
|
+
});
|
|
26943
|
+
var orcaWorkerReportSchema = z4.object({
|
|
26944
|
+
event: orcaWorkerDoneSchema,
|
|
26945
|
+
manifestId: identifier,
|
|
26946
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26947
|
+
reportText: z4.string().min(1).max(65536),
|
|
26948
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26949
|
+
ingestedAt: z4.string().datetime()
|
|
26950
|
+
});
|
|
26951
|
+
var orcaReportDeliverySchema = z4.object({
|
|
26952
|
+
key: identifier,
|
|
26953
|
+
mailbox: identifier.nullable(),
|
|
26954
|
+
state: z4.enum(["pending", "delivered"]),
|
|
26955
|
+
messageId: identifier.nullable(),
|
|
26956
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
26957
|
+
lastError: z4.string().nullable()
|
|
26958
|
+
});
|
|
26959
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
26960
|
+
resourceRelease: z4.object({
|
|
26961
|
+
dispatchId: identifier,
|
|
26962
|
+
releasedAt: z4.string().datetime(),
|
|
26963
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
26964
|
+
receipt: identifier
|
|
26965
|
+
}).optional(),
|
|
26966
|
+
retiredAt: z4.string().datetime().optional(),
|
|
26967
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
26968
|
+
});
|
|
26969
|
+
var orcaReportMessageSchema = z4.object({
|
|
26970
|
+
id: identifier,
|
|
26971
|
+
run_id: z4.string().nullable(),
|
|
26972
|
+
delivery_contract: z4.string(),
|
|
26973
|
+
from_handle: z4.string(),
|
|
26974
|
+
to_handle: z4.string(),
|
|
26975
|
+
type: z4.string(),
|
|
26976
|
+
body: z4.string(),
|
|
26977
|
+
payload: z4.string().nullable(),
|
|
26978
|
+
sender_pane_key: z4.string().nullable()
|
|
26979
|
+
});
|
|
26980
|
+
var orcaReportSourceSchema = z4.object({
|
|
26981
|
+
ok: z4.literal(true),
|
|
26982
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
26983
|
+
result: z4.object({
|
|
26984
|
+
messages: z4.array(z4.json()).optional(),
|
|
26985
|
+
dispatch: z4.object({
|
|
26986
|
+
id: identifier,
|
|
26987
|
+
run_id: identifier,
|
|
26988
|
+
task_id: identifier,
|
|
26989
|
+
assignee_handle: identifier,
|
|
26990
|
+
assignee_pane_key: z4.string().nullable(),
|
|
26991
|
+
status: z4.string()
|
|
26992
|
+
}).optional()
|
|
26993
|
+
})
|
|
26994
|
+
});
|
|
26995
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
26996
|
+
taskId: identifier,
|
|
26997
|
+
dispatchId: identifier,
|
|
26998
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
26999
|
+
reportPath: identifier
|
|
27000
|
+
});
|
|
27001
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
27002
|
+
action: z4.enum([
|
|
27003
|
+
"show",
|
|
27004
|
+
"read",
|
|
27005
|
+
"recover-start",
|
|
27006
|
+
"recover-stop",
|
|
27007
|
+
"retry",
|
|
27008
|
+
"stop",
|
|
27009
|
+
"ingest-report",
|
|
27010
|
+
"relay-report"
|
|
27011
|
+
]),
|
|
27012
|
+
recordId: identifier,
|
|
27013
|
+
cursor: identifier.optional(),
|
|
27014
|
+
messageId: identifier.optional()
|
|
27015
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
27016
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
27017
|
+
path: ["cursor"]
|
|
27018
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
27019
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
27020
|
+
path: ["messageId"]
|
|
27021
|
+
});
|
|
27022
|
+
var effectSchema = z4.object({
|
|
27023
|
+
kind: z4.string(),
|
|
27024
|
+
role: z4.string().optional(),
|
|
27025
|
+
action: z4.string().optional(),
|
|
27026
|
+
id: z4.string().optional()
|
|
27027
|
+
});
|
|
27028
|
+
var selectionSchema = z4.object({
|
|
27029
|
+
agent: z4.string().nullable().optional(),
|
|
27030
|
+
model: z4.string().nullable().optional(),
|
|
27031
|
+
effort: z4.string().nullable().optional()
|
|
27032
|
+
});
|
|
27033
|
+
var orcaReplySchema = z4.object({
|
|
27034
|
+
ok: z4.boolean(),
|
|
27035
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
27036
|
+
error: z4.object({
|
|
27037
|
+
code: z4.string(),
|
|
27038
|
+
message: z4.string(),
|
|
27039
|
+
data: z4.object({
|
|
27040
|
+
requestId: identifier.optional(),
|
|
27041
|
+
orchestrationRequestId: identifier.optional(),
|
|
27042
|
+
dispatchId: identifier.optional()
|
|
27043
|
+
}).optional()
|
|
27044
|
+
}).optional(),
|
|
27045
|
+
result: z4.object({
|
|
27046
|
+
state: z4.string().optional(),
|
|
27047
|
+
requestId: identifier.optional(),
|
|
27048
|
+
/**
|
|
27049
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
27050
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
27051
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
27052
|
+
* be bound to the request key this attempt issued.
|
|
27053
|
+
*/
|
|
27054
|
+
mutation: z4.object({
|
|
27055
|
+
requestId: identifier.optional(),
|
|
27056
|
+
replayed: z4.boolean().optional()
|
|
27057
|
+
}).optional(),
|
|
27058
|
+
stage: z4.string().optional(),
|
|
27059
|
+
turnStart: z4.string().optional(),
|
|
27060
|
+
runId: identifier.optional(),
|
|
27061
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
27062
|
+
taskId: identifier.optional(),
|
|
27063
|
+
dispatchId: identifier.optional(),
|
|
27064
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
27065
|
+
effects: z4.array(effectSchema).optional(),
|
|
27066
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
27067
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
27068
|
+
lastError: z4.string().nullable().optional(),
|
|
27069
|
+
processAction: z4.string().optional(),
|
|
27070
|
+
helpers: z4.array(
|
|
27071
|
+
z4.object({
|
|
27072
|
+
dispatchId: identifier.optional(),
|
|
27073
|
+
creatorDispatchId: identifier.optional(),
|
|
27074
|
+
outcome: z4.string(),
|
|
27075
|
+
keptOpenBy: identifier.optional(),
|
|
27076
|
+
state: z4.string().optional(),
|
|
27077
|
+
lastError: z4.string().nullable().optional()
|
|
27078
|
+
})
|
|
27079
|
+
).optional(),
|
|
27080
|
+
helperStopError: z4.string().nullable().optional(),
|
|
27081
|
+
status: z4.string().optional(),
|
|
27082
|
+
terminal: z4.object({
|
|
27083
|
+
handle: identifier,
|
|
27084
|
+
connected: z4.boolean(),
|
|
27085
|
+
writable: z4.boolean(),
|
|
27086
|
+
executionHostId: identifier
|
|
27087
|
+
}).optional(),
|
|
27088
|
+
runtime: z4.object({
|
|
27089
|
+
runtimeId: identifier,
|
|
27090
|
+
reachable: z4.boolean(),
|
|
27091
|
+
state: z4.string(),
|
|
27092
|
+
capabilities: z4.array(z4.string())
|
|
27093
|
+
}).optional(),
|
|
27094
|
+
worktree: z4.object({
|
|
27095
|
+
id: identifier,
|
|
27096
|
+
path: identifier,
|
|
27097
|
+
branch: identifier,
|
|
27098
|
+
hostId: identifier,
|
|
27099
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
27100
|
+
}).optional(),
|
|
27101
|
+
dispatch: z4.object({
|
|
27102
|
+
id: identifier,
|
|
27103
|
+
runId: identifier,
|
|
27104
|
+
taskId: identifier,
|
|
27105
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
27106
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
27107
|
+
failureCount: z4.number().int().nonnegative()
|
|
27108
|
+
}).optional(),
|
|
27109
|
+
worker: z4.object({
|
|
27110
|
+
dispatchId: identifier,
|
|
27111
|
+
runtimeEpoch: identifier,
|
|
27112
|
+
state: z4.string(),
|
|
27113
|
+
stage: z4.string(),
|
|
27114
|
+
worktreeId: identifier.nullable()
|
|
27115
|
+
}).optional(),
|
|
27116
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
27117
|
+
projection: z4.object({
|
|
27118
|
+
resource: z4.object({
|
|
27119
|
+
state: z4.string(),
|
|
27120
|
+
terminalState: z4.string(),
|
|
27121
|
+
ownerDispatchId: identifier.optional(),
|
|
27122
|
+
releaseState: z4.string().optional()
|
|
27123
|
+
}).optional()
|
|
27124
|
+
}).optional()
|
|
27125
|
+
}).optional()
|
|
27126
|
+
});
|
|
27127
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
27128
|
+
schemaVersion: z4.number().int().positive(),
|
|
27129
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
27130
|
+
});
|
|
27131
|
+
var accountProviderSchema = z4.object({
|
|
27132
|
+
accounts: z4.array(z4.object({})),
|
|
27133
|
+
activeAccountId: identifier.nullable()
|
|
27134
|
+
});
|
|
27135
|
+
var orcaAccountReplySchema = z4.object({
|
|
27136
|
+
ok: z4.literal(true),
|
|
27137
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
27138
|
+
result: z4.object({
|
|
27139
|
+
codex: accountProviderSchema,
|
|
27140
|
+
opencode: accountProviderSchema,
|
|
27141
|
+
claude: accountProviderSchema
|
|
27142
|
+
})
|
|
27143
|
+
});
|
|
27144
|
+
|
|
27145
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
27146
|
+
import { z as z5 } from "zod";
|
|
27147
|
+
var projectWorkerPolicySchema = z5.object({
|
|
27148
|
+
verification: z5.object({
|
|
27149
|
+
full: z5.enum(["local", "ci"]),
|
|
27150
|
+
local: z5.enum(["single-file", "affected"])
|
|
26847
27151
|
}).strict().optional(),
|
|
26848
|
-
instructions:
|
|
26849
|
-
|
|
27152
|
+
instructions: z5.array(
|
|
27153
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
26850
27154
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
26851
27155
|
"Instructions must be single-line text without control characters or a leading #"
|
|
26852
27156
|
)
|
|
@@ -26874,8 +27178,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
26874
27178
|
path: ".cleo/config.json",
|
|
26875
27179
|
mergePrecedence: 20,
|
|
26876
27180
|
driftDetection: "schema-validate",
|
|
26877
|
-
schema:
|
|
26878
|
-
orchestrate:
|
|
27181
|
+
schema: z6.object({
|
|
27182
|
+
orchestrate: z6.object({
|
|
27183
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
27184
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
27185
|
+
}).passthrough().optional()
|
|
26879
27186
|
}).passthrough()
|
|
26880
27187
|
};
|
|
26881
27188
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -26891,19 +27198,19 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
26891
27198
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
26892
27199
|
CLEO_CONFIG_MANIFEST
|
|
26893
27200
|
]);
|
|
26894
|
-
var configManifestEntrySchema =
|
|
26895
|
-
id:
|
|
26896
|
-
scope:
|
|
26897
|
-
path:
|
|
26898
|
-
schema:
|
|
26899
|
-
mergePrecedence:
|
|
26900
|
-
driftDetection:
|
|
26901
|
-
|
|
26902
|
-
|
|
26903
|
-
|
|
26904
|
-
|
|
27201
|
+
var configManifestEntrySchema = z6.object({
|
|
27202
|
+
id: z6.string().min(1),
|
|
27203
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
27204
|
+
path: z6.string().min(1),
|
|
27205
|
+
schema: z6.unknown().optional(),
|
|
27206
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
27207
|
+
driftDetection: z6.union([
|
|
27208
|
+
z6.literal("schema-validate"),
|
|
27209
|
+
z6.literal("staleness-gate"),
|
|
27210
|
+
z6.literal("value-diff"),
|
|
27211
|
+
z6.literal("none")
|
|
26905
27212
|
]),
|
|
26906
|
-
defaults:
|
|
27213
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
26907
27214
|
});
|
|
26908
27215
|
|
|
26909
27216
|
// packages/contracts/src/credentials.ts
|
|
@@ -26933,123 +27240,123 @@ function parseClaudeCodeCredentials(buf) {
|
|
|
26933
27240
|
}
|
|
26934
27241
|
|
|
26935
27242
|
// packages/contracts/src/daemon/health.ts
|
|
26936
|
-
import { z as
|
|
27243
|
+
import { z as z8 } from "zod";
|
|
26937
27244
|
|
|
26938
27245
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
26939
|
-
import { z as
|
|
26940
|
-
var EnvPairSchema =
|
|
27246
|
+
import { z as z7 } from "zod";
|
|
27247
|
+
var EnvPairSchema = z7.object({
|
|
26941
27248
|
/** Environment variable name. */
|
|
26942
|
-
key:
|
|
27249
|
+
key: z7.string().min(1),
|
|
26943
27250
|
/** Environment variable value. */
|
|
26944
|
-
value:
|
|
27251
|
+
value: z7.string()
|
|
26945
27252
|
}).strict();
|
|
26946
|
-
var ChildStateSchema =
|
|
26947
|
-
var ChildStatusSchema =
|
|
27253
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
27254
|
+
var ChildStatusSchema = z7.object({
|
|
26948
27255
|
/** Logical id of the child (stable across restarts). */
|
|
26949
|
-
child_id:
|
|
27256
|
+
child_id: z7.string().min(1),
|
|
26950
27257
|
/** Current OS pid (0 when not currently running). */
|
|
26951
|
-
pid:
|
|
27258
|
+
pid: z7.number().int().nonnegative(),
|
|
26952
27259
|
/** Current liveness state. */
|
|
26953
27260
|
state: ChildStateSchema,
|
|
26954
27261
|
/** Total restarts observed for this child. */
|
|
26955
|
-
restart_count:
|
|
27262
|
+
restart_count: z7.number().int().nonnegative()
|
|
26956
27263
|
}).strict();
|
|
26957
|
-
var SpawnRequestSchema =
|
|
27264
|
+
var SpawnRequestSchema = z7.object({
|
|
26958
27265
|
/** Tag discriminating this request variant. */
|
|
26959
|
-
kind:
|
|
27266
|
+
kind: z7.literal("spawn"),
|
|
26960
27267
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
26961
|
-
child_id:
|
|
27268
|
+
child_id: z7.string().min(1),
|
|
26962
27269
|
/** Absolute path to the program to execute. */
|
|
26963
|
-
program:
|
|
27270
|
+
program: z7.string().min(1),
|
|
26964
27271
|
/** Arguments passed to the program. */
|
|
26965
|
-
args:
|
|
27272
|
+
args: z7.array(z7.string()).default([]),
|
|
26966
27273
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
26967
|
-
env:
|
|
27274
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
26968
27275
|
/** Optional working directory for the child. */
|
|
26969
|
-
cwd:
|
|
27276
|
+
cwd: z7.string().optional()
|
|
26970
27277
|
}).strict();
|
|
26971
|
-
var RestartRequestSchema =
|
|
27278
|
+
var RestartRequestSchema = z7.object({
|
|
26972
27279
|
/** Tag discriminating this request variant. */
|
|
26973
|
-
kind:
|
|
27280
|
+
kind: z7.literal("restart"),
|
|
26974
27281
|
/** Logical id of the child to restart. */
|
|
26975
|
-
child_id:
|
|
27282
|
+
child_id: z7.string().min(1)
|
|
26976
27283
|
}).strict();
|
|
26977
|
-
var MonitorRequestSchema =
|
|
27284
|
+
var MonitorRequestSchema = z7.object({
|
|
26978
27285
|
/** Tag discriminating this request variant. */
|
|
26979
|
-
kind:
|
|
27286
|
+
kind: z7.literal("monitor"),
|
|
26980
27287
|
/** Specific child id to monitor; omit to request all children. */
|
|
26981
|
-
child_id:
|
|
27288
|
+
child_id: z7.string().optional()
|
|
26982
27289
|
}).strict();
|
|
26983
|
-
var HealthRequestSchema =
|
|
27290
|
+
var HealthRequestSchema = z7.object({
|
|
26984
27291
|
/** Tag discriminating this request variant. */
|
|
26985
|
-
kind:
|
|
27292
|
+
kind: z7.literal("health")
|
|
26986
27293
|
}).strict();
|
|
26987
|
-
var SupervisorIpcRequestSchema =
|
|
27294
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
26988
27295
|
SpawnRequestSchema,
|
|
26989
27296
|
RestartRequestSchema,
|
|
26990
27297
|
MonitorRequestSchema,
|
|
26991
27298
|
HealthRequestSchema
|
|
26992
27299
|
]);
|
|
26993
|
-
var SpawnedResponseSchema =
|
|
27300
|
+
var SpawnedResponseSchema = z7.object({
|
|
26994
27301
|
/** Tag discriminating this response variant. */
|
|
26995
|
-
kind:
|
|
27302
|
+
kind: z7.literal("spawned"),
|
|
26996
27303
|
/** Logical id of the spawned child. */
|
|
26997
|
-
child_id:
|
|
27304
|
+
child_id: z7.string().min(1),
|
|
26998
27305
|
/** OS pid assigned to the spawned child. */
|
|
26999
|
-
pid:
|
|
27306
|
+
pid: z7.number().int().nonnegative()
|
|
27000
27307
|
}).strict();
|
|
27001
|
-
var RestartedResponseSchema =
|
|
27308
|
+
var RestartedResponseSchema = z7.object({
|
|
27002
27309
|
/** Tag discriminating this response variant. */
|
|
27003
|
-
kind:
|
|
27310
|
+
kind: z7.literal("restarted"),
|
|
27004
27311
|
/** Logical id of the restarted child. */
|
|
27005
|
-
child_id:
|
|
27312
|
+
child_id: z7.string().min(1),
|
|
27006
27313
|
/** New OS pid after the restart. */
|
|
27007
|
-
pid:
|
|
27314
|
+
pid: z7.number().int().nonnegative(),
|
|
27008
27315
|
/** Number of times this child has been restarted in total. */
|
|
27009
|
-
restart_count:
|
|
27316
|
+
restart_count: z7.number().int().nonnegative()
|
|
27010
27317
|
}).strict();
|
|
27011
|
-
var MonitorResponseSchema =
|
|
27318
|
+
var MonitorResponseSchema = z7.object({
|
|
27012
27319
|
/** Tag discriminating this response variant. */
|
|
27013
|
-
kind:
|
|
27320
|
+
kind: z7.literal("monitor"),
|
|
27014
27321
|
/** One row per monitored child. */
|
|
27015
|
-
children:
|
|
27322
|
+
children: z7.array(ChildStatusSchema)
|
|
27016
27323
|
}).strict();
|
|
27017
|
-
var HealthResponseSchema =
|
|
27324
|
+
var HealthResponseSchema = z7.object({
|
|
27018
27325
|
/** Tag discriminating this response variant. */
|
|
27019
|
-
kind:
|
|
27326
|
+
kind: z7.literal("health"),
|
|
27020
27327
|
/** Supervisor process pid. */
|
|
27021
|
-
pid:
|
|
27328
|
+
pid: z7.number().int().nonnegative(),
|
|
27022
27329
|
/** Number of children currently tracked. */
|
|
27023
|
-
child_count:
|
|
27330
|
+
child_count: z7.number().int().nonnegative(),
|
|
27024
27331
|
/** Seconds the supervisor has been running. */
|
|
27025
|
-
uptime_secs:
|
|
27332
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
27026
27333
|
/** Frozen protocol version the supervisor speaks. */
|
|
27027
|
-
protocol_version:
|
|
27334
|
+
protocol_version: z7.string()
|
|
27028
27335
|
}).strict();
|
|
27029
|
-
var LifecycleEventKindSchema =
|
|
27030
|
-
var LifecycleEventResponseSchema =
|
|
27336
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
27337
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
27031
27338
|
/** Tag discriminating this response variant. */
|
|
27032
|
-
kind:
|
|
27339
|
+
kind: z7.literal("event"),
|
|
27033
27340
|
/** What happened. */
|
|
27034
27341
|
event: LifecycleEventKindSchema,
|
|
27035
27342
|
/** Logical id of the affected child. */
|
|
27036
|
-
child_id:
|
|
27343
|
+
child_id: z7.string().min(1),
|
|
27037
27344
|
/** Exit code, when the OS reported one. */
|
|
27038
|
-
exit_code:
|
|
27345
|
+
exit_code: z7.number().int().optional(),
|
|
27039
27346
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
27040
|
-
signal:
|
|
27347
|
+
signal: z7.string().optional(),
|
|
27041
27348
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
27042
|
-
restart_delay_ms:
|
|
27349
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
27043
27350
|
}).strict();
|
|
27044
|
-
var ErrorResponseSchema =
|
|
27351
|
+
var ErrorResponseSchema = z7.object({
|
|
27045
27352
|
/** Tag discriminating this response variant. */
|
|
27046
|
-
kind:
|
|
27353
|
+
kind: z7.literal("error"),
|
|
27047
27354
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
27048
|
-
code:
|
|
27355
|
+
code: z7.string().min(1),
|
|
27049
27356
|
/** Human-readable error message. */
|
|
27050
|
-
message:
|
|
27357
|
+
message: z7.string()
|
|
27051
27358
|
}).strict();
|
|
27052
|
-
var SupervisorIpcResponseSchema =
|
|
27359
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
27053
27360
|
SpawnedResponseSchema,
|
|
27054
27361
|
RestartedResponseSchema,
|
|
27055
27362
|
MonitorResponseSchema,
|
|
@@ -27057,27 +27364,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
27057
27364
|
LifecycleEventResponseSchema,
|
|
27058
27365
|
ErrorResponseSchema
|
|
27059
27366
|
]);
|
|
27060
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
27367
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
27061
27368
|
/** Frozen protocol version. */
|
|
27062
|
-
protocol_version:
|
|
27369
|
+
protocol_version: z7.string(),
|
|
27063
27370
|
/** Correlation id echoed back on the matching response. */
|
|
27064
|
-
id:
|
|
27371
|
+
id: z7.string().min(1),
|
|
27065
27372
|
/** Direction discriminator. */
|
|
27066
|
-
direction:
|
|
27373
|
+
direction: z7.literal("request"),
|
|
27067
27374
|
/** The request body. */
|
|
27068
27375
|
request: SupervisorIpcRequestSchema
|
|
27069
27376
|
}).strict();
|
|
27070
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
27377
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
27071
27378
|
/** Frozen protocol version. */
|
|
27072
|
-
protocol_version:
|
|
27379
|
+
protocol_version: z7.string(),
|
|
27073
27380
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
27074
|
-
id:
|
|
27381
|
+
id: z7.string().min(1),
|
|
27075
27382
|
/** Direction discriminator. */
|
|
27076
|
-
direction:
|
|
27383
|
+
direction: z7.literal("response"),
|
|
27077
27384
|
/** The response body. */
|
|
27078
27385
|
response: SupervisorIpcResponseSchema
|
|
27079
27386
|
}).strict();
|
|
27080
|
-
var SupervisorIpcEnvelopeSchema =
|
|
27387
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
27081
27388
|
SupervisorIpcRequestEnvelopeSchema,
|
|
27082
27389
|
SupervisorIpcResponseEnvelopeSchema
|
|
27083
27390
|
]);
|
|
@@ -27101,17 +27408,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
27101
27408
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
27102
27409
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
27103
27410
|
*/
|
|
27104
|
-
detail:
|
|
27411
|
+
detail: z8.string().optional()
|
|
27105
27412
|
}).strict();
|
|
27106
|
-
var HealthStatusSchema =
|
|
27413
|
+
var HealthStatusSchema = z8.object({
|
|
27107
27414
|
/** One health row per registered subsystem. */
|
|
27108
|
-
subsystems:
|
|
27415
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
27109
27416
|
/**
|
|
27110
27417
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
27111
27418
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
27112
27419
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
27113
27420
|
*/
|
|
27114
|
-
allHealthy:
|
|
27421
|
+
allHealthy: z8.boolean()
|
|
27115
27422
|
}).strict();
|
|
27116
27423
|
|
|
27117
27424
|
// packages/contracts/src/db-inventory.json
|
|
@@ -39040,7 +39347,7 @@ var OPERATIONS = [
|
|
|
39040
39347
|
];
|
|
39041
39348
|
|
|
39042
39349
|
// packages/contracts/src/docs/modernize.ts
|
|
39043
|
-
import { z as
|
|
39350
|
+
import { z as z9 } from "zod";
|
|
39044
39351
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
39045
39352
|
var DOCS_MODERNIZE_OPS = [
|
|
39046
39353
|
"ingest",
|
|
@@ -39054,105 +39361,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
39054
39361
|
"reslug",
|
|
39055
39362
|
"link-task"
|
|
39056
39363
|
];
|
|
39057
|
-
var judgmentSchema =
|
|
39058
|
-
question:
|
|
39059
|
-
site:
|
|
39060
|
-
mode:
|
|
39061
|
-
ruleAnswer:
|
|
39062
|
-
decidedAnswer:
|
|
39063
|
-
decidedConfidence:
|
|
39064
|
-
source:
|
|
39065
|
-
acted:
|
|
39066
|
-
});
|
|
39067
|
-
var relPath =
|
|
39068
|
-
var docsModernizePlanSchema =
|
|
39069
|
-
root:
|
|
39070
|
-
generatedAt:
|
|
39071
|
-
mode:
|
|
39072
|
-
counts:
|
|
39073
|
-
rows:
|
|
39074
|
-
|
|
39364
|
+
var judgmentSchema = z9.object({
|
|
39365
|
+
question: z9.enum(["classify", "merge"]),
|
|
39366
|
+
site: z9.string(),
|
|
39367
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
39368
|
+
ruleAnswer: z9.string(),
|
|
39369
|
+
decidedAnswer: z9.string().nullable(),
|
|
39370
|
+
decidedConfidence: z9.number().nullable(),
|
|
39371
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
39372
|
+
acted: z9.string()
|
|
39373
|
+
});
|
|
39374
|
+
var relPath = z9.string().min(1).max(1024);
|
|
39375
|
+
var docsModernizePlanSchema = z9.object({
|
|
39376
|
+
root: z9.string().min(1),
|
|
39377
|
+
generatedAt: z9.string(),
|
|
39378
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
39379
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
39380
|
+
rows: z9.array(
|
|
39381
|
+
z9.object({
|
|
39075
39382
|
path: relPath,
|
|
39076
|
-
sha256:
|
|
39077
|
-
kind:
|
|
39078
|
-
slug:
|
|
39079
|
-
title:
|
|
39080
|
-
disposition:
|
|
39081
|
-
target:
|
|
39082
|
-
reasons:
|
|
39083
|
-
judgments:
|
|
39084
|
-
ownerTasks:
|
|
39085
|
-
category:
|
|
39086
|
-
refs:
|
|
39087
|
-
overridden:
|
|
39088
|
-
covers:
|
|
39089
|
-
baselineRemove:
|
|
39383
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
39384
|
+
kind: z9.string().min(1),
|
|
39385
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
39386
|
+
title: z9.string(),
|
|
39387
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
39388
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
39389
|
+
reasons: z9.array(z9.string()),
|
|
39390
|
+
judgments: z9.array(judgmentSchema),
|
|
39391
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
39392
|
+
category: z9.string(),
|
|
39393
|
+
refs: z9.array(z9.string()),
|
|
39394
|
+
overridden: z9.boolean(),
|
|
39395
|
+
covers: z9.array(z9.string()),
|
|
39396
|
+
baselineRemove: z9.boolean()
|
|
39090
39397
|
})
|
|
39091
39398
|
),
|
|
39092
|
-
linkFixes:
|
|
39093
|
-
|
|
39094
|
-
kind:
|
|
39399
|
+
linkFixes: z9.array(
|
|
39400
|
+
z9.object({
|
|
39401
|
+
kind: z9.literal("link-fix"),
|
|
39095
39402
|
path: relPath,
|
|
39096
|
-
href:
|
|
39097
|
-
newHref:
|
|
39098
|
-
base:
|
|
39099
|
-
sha256:
|
|
39403
|
+
href: z9.string().min(1).max(2048),
|
|
39404
|
+
newHref: z9.string().min(1).max(2048),
|
|
39405
|
+
base: z9.literal("repo").optional(),
|
|
39406
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
39100
39407
|
})
|
|
39101
39408
|
).optional(),
|
|
39102
|
-
repoRoot:
|
|
39409
|
+
repoRoot: z9.string().min(1).optional()
|
|
39103
39410
|
});
|
|
39104
|
-
var docsModernizeOverridesSchema =
|
|
39411
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
39105
39412
|
relPath,
|
|
39106
|
-
|
|
39107
|
-
disposition:
|
|
39108
|
-
target:
|
|
39109
|
-
reason:
|
|
39110
|
-
kind:
|
|
39111
|
-
slug:
|
|
39112
|
-
covers:
|
|
39413
|
+
z9.object({
|
|
39414
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
39415
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
39416
|
+
reason: z9.string().min(1),
|
|
39417
|
+
kind: z9.string().min(1).optional(),
|
|
39418
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
39419
|
+
covers: z9.array(z9.string()).optional()
|
|
39113
39420
|
})
|
|
39114
39421
|
);
|
|
39115
|
-
var receiptOpSchema =
|
|
39116
|
-
op:
|
|
39117
|
-
state:
|
|
39118
|
-
slug:
|
|
39422
|
+
var receiptOpSchema = z9.object({
|
|
39423
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
39424
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
39425
|
+
slug: z9.string().nullable(),
|
|
39119
39426
|
path: relPath.nullable(),
|
|
39120
|
-
target:
|
|
39121
|
-
attachmentId:
|
|
39122
|
-
ownerId:
|
|
39123
|
-
beforeSha256:
|
|
39124
|
-
afterSha256:
|
|
39125
|
-
prior:
|
|
39126
|
-
lifecycleStatus:
|
|
39127
|
-
supersededBy:
|
|
39128
|
-
supersedes:
|
|
39129
|
-
previousAttachmentId:
|
|
39130
|
-
newAttachmentId:
|
|
39131
|
-
linkTargets:
|
|
39132
|
-
kind:
|
|
39427
|
+
target: z9.string().nullable(),
|
|
39428
|
+
attachmentId: z9.string().nullable(),
|
|
39429
|
+
ownerId: z9.string().nullable(),
|
|
39430
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
39431
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
39432
|
+
prior: z9.object({
|
|
39433
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
39434
|
+
supersededBy: z9.string().nullable().optional(),
|
|
39435
|
+
supersedes: z9.string().nullable().optional(),
|
|
39436
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
39437
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
39438
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
39439
|
+
kind: z9.string().nullable().optional()
|
|
39133
39440
|
}).optional(),
|
|
39134
|
-
base:
|
|
39441
|
+
base: z9.literal("repo").optional()
|
|
39135
39442
|
});
|
|
39136
39443
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
39137
|
-
i:
|
|
39138
|
-
});
|
|
39139
|
-
var docsModernizeReceiptSchema =
|
|
39140
|
-
runId:
|
|
39141
|
-
root:
|
|
39142
|
-
appliedAt:
|
|
39143
|
-
planSha256:
|
|
39144
|
-
edgeCount:
|
|
39145
|
-
rolledBackAt:
|
|
39146
|
-
blobs:
|
|
39147
|
-
moves:
|
|
39148
|
-
deleted:
|
|
39149
|
-
ops:
|
|
39150
|
-
durationMs:
|
|
39151
|
-
repoRoot:
|
|
39444
|
+
i: z9.number().int().min(0)
|
|
39445
|
+
});
|
|
39446
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
39447
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
39448
|
+
root: z9.string().min(1),
|
|
39449
|
+
appliedAt: z9.string(),
|
|
39450
|
+
planSha256: z9.string(),
|
|
39451
|
+
edgeCount: z9.number(),
|
|
39452
|
+
rolledBackAt: z9.string().nullable(),
|
|
39453
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
39454
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
39455
|
+
deleted: z9.array(relPath),
|
|
39456
|
+
ops: z9.array(receiptOpSchema),
|
|
39457
|
+
durationMs: z9.number().optional(),
|
|
39458
|
+
repoRoot: z9.string().min(1).optional()
|
|
39152
39459
|
});
|
|
39153
39460
|
|
|
39154
39461
|
// packages/contracts/src/docs/provenance.ts
|
|
39155
|
-
import { z as
|
|
39462
|
+
import { z as z10 } from "zod";
|
|
39156
39463
|
var PROVENANCE_NODE_KINDS = [
|
|
39157
39464
|
"doc",
|
|
39158
39465
|
"task",
|
|
@@ -39175,96 +39482,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
39175
39482
|
"archived",
|
|
39176
39483
|
"draft"
|
|
39177
39484
|
];
|
|
39178
|
-
var provenanceNodeKindSchema =
|
|
39179
|
-
var provenanceEdgeRelationSchema =
|
|
39180
|
-
var docLifecycleStatusSchema =
|
|
39485
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
39486
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
39487
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
39181
39488
|
var provenanceNodeBaseFields = {
|
|
39182
|
-
id:
|
|
39183
|
-
title:
|
|
39184
|
-
metadata:
|
|
39489
|
+
id: z10.string().min(1),
|
|
39490
|
+
title: z10.string().min(1),
|
|
39491
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
39185
39492
|
};
|
|
39186
|
-
var provenanceDocNodeSchema =
|
|
39493
|
+
var provenanceDocNodeSchema = z10.object({
|
|
39187
39494
|
...provenanceNodeBaseFields,
|
|
39188
|
-
kind:
|
|
39189
|
-
slug:
|
|
39190
|
-
docKind:
|
|
39495
|
+
kind: z10.literal("doc"),
|
|
39496
|
+
slug: z10.string().min(1),
|
|
39497
|
+
docKind: z10.string().min(1),
|
|
39191
39498
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
39192
|
-
publishedAt:
|
|
39193
|
-
supersededAt:
|
|
39194
|
-
summary:
|
|
39499
|
+
publishedAt: z10.string().min(1),
|
|
39500
|
+
supersededAt: z10.string().min(1).optional(),
|
|
39501
|
+
summary: z10.string().optional()
|
|
39195
39502
|
});
|
|
39196
|
-
var provenanceTaskNodeSchema =
|
|
39503
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
39197
39504
|
...provenanceNodeBaseFields,
|
|
39198
|
-
kind:
|
|
39199
|
-
taskType:
|
|
39200
|
-
status:
|
|
39505
|
+
kind: z10.literal("task"),
|
|
39506
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
39507
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
39201
39508
|
});
|
|
39202
|
-
var provenanceDecisionNodeSchema =
|
|
39509
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
39203
39510
|
...provenanceNodeBaseFields,
|
|
39204
|
-
kind:
|
|
39205
|
-
outcome:
|
|
39206
|
-
decidedAt:
|
|
39511
|
+
kind: z10.literal("decision"),
|
|
39512
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
39513
|
+
decidedAt: z10.string().min(1)
|
|
39207
39514
|
});
|
|
39208
|
-
var provenanceSessionNodeSchema =
|
|
39515
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
39209
39516
|
...provenanceNodeBaseFields,
|
|
39210
|
-
kind:
|
|
39211
|
-
startedAt:
|
|
39212
|
-
endedAt:
|
|
39517
|
+
kind: z10.literal("session"),
|
|
39518
|
+
startedAt: z10.string().min(1),
|
|
39519
|
+
endedAt: z10.string().min(1).optional()
|
|
39213
39520
|
});
|
|
39214
|
-
var provenanceMemoryNodeSchema =
|
|
39521
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
39215
39522
|
...provenanceNodeBaseFields,
|
|
39216
|
-
kind:
|
|
39217
|
-
memoryType:
|
|
39218
|
-
recordedAt:
|
|
39523
|
+
kind: z10.literal("memory"),
|
|
39524
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
39525
|
+
recordedAt: z10.string().min(1)
|
|
39219
39526
|
});
|
|
39220
|
-
var provenanceNodeSchema =
|
|
39527
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
39221
39528
|
provenanceDocNodeSchema,
|
|
39222
39529
|
provenanceTaskNodeSchema,
|
|
39223
39530
|
provenanceDecisionNodeSchema,
|
|
39224
39531
|
provenanceSessionNodeSchema,
|
|
39225
39532
|
provenanceMemoryNodeSchema
|
|
39226
39533
|
]);
|
|
39227
|
-
var provenanceEdgeSchema =
|
|
39534
|
+
var provenanceEdgeSchema = z10.object({
|
|
39228
39535
|
relation: provenanceEdgeRelationSchema,
|
|
39229
|
-
from:
|
|
39536
|
+
from: z10.string().min(1),
|
|
39230
39537
|
fromKind: provenanceNodeKindSchema,
|
|
39231
|
-
to:
|
|
39538
|
+
to: z10.string().min(1),
|
|
39232
39539
|
toKind: provenanceNodeKindSchema,
|
|
39233
|
-
addedAt:
|
|
39234
|
-
summary:
|
|
39540
|
+
addedAt: z10.string().min(1),
|
|
39541
|
+
summary: z10.string().optional()
|
|
39235
39542
|
});
|
|
39236
|
-
var docProvenanceResponseSchema =
|
|
39237
|
-
nodes:
|
|
39238
|
-
edges:
|
|
39239
|
-
totalNodes:
|
|
39240
|
-
totalEdges:
|
|
39543
|
+
var docProvenanceResponseSchema = z10.object({
|
|
39544
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
39545
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
39546
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
39547
|
+
totalEdges: z10.number().int().nonnegative()
|
|
39241
39548
|
});
|
|
39242
39549
|
|
|
39243
39550
|
// packages/contracts/src/docs/read.ts
|
|
39244
|
-
import { z as
|
|
39245
|
-
var docFrontmatterSchema =
|
|
39246
|
-
slug:
|
|
39247
|
-
kind:
|
|
39248
|
-
title:
|
|
39249
|
-
summary:
|
|
39250
|
-
lifecycleStatus:
|
|
39251
|
-
docVersion:
|
|
39252
|
-
ownerVersion:
|
|
39253
|
-
supersedes:
|
|
39254
|
-
supersededBy:
|
|
39255
|
-
topics:
|
|
39256
|
-
relatedTasks:
|
|
39257
|
-
sha256:
|
|
39258
|
-
createdAt:
|
|
39259
|
-
});
|
|
39260
|
-
var docBodySchema =
|
|
39261
|
-
encoding:
|
|
39262
|
-
text:
|
|
39263
|
-
base64:
|
|
39264
|
-
sizeBytes:
|
|
39265
|
-
mimeType:
|
|
39266
|
-
});
|
|
39267
|
-
var docReadResponseSchema =
|
|
39551
|
+
import { z as z11 } from "zod";
|
|
39552
|
+
var docFrontmatterSchema = z11.object({
|
|
39553
|
+
slug: z11.string(),
|
|
39554
|
+
kind: z11.string().nullable(),
|
|
39555
|
+
title: z11.string().nullable(),
|
|
39556
|
+
summary: z11.string().nullable(),
|
|
39557
|
+
lifecycleStatus: z11.string(),
|
|
39558
|
+
docVersion: z11.number().int(),
|
|
39559
|
+
ownerVersion: z11.string().nullable(),
|
|
39560
|
+
supersedes: z11.string().nullable(),
|
|
39561
|
+
supersededBy: z11.string().nullable(),
|
|
39562
|
+
topics: z11.array(z11.string()).readonly(),
|
|
39563
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
39564
|
+
sha256: z11.string(),
|
|
39565
|
+
createdAt: z11.string()
|
|
39566
|
+
});
|
|
39567
|
+
var docBodySchema = z11.object({
|
|
39568
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
39569
|
+
text: z11.string().optional(),
|
|
39570
|
+
base64: z11.string().optional(),
|
|
39571
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
39572
|
+
mimeType: z11.string().nullable()
|
|
39573
|
+
});
|
|
39574
|
+
var docReadResponseSchema = z11.object({
|
|
39268
39575
|
frontmatter: docFrontmatterSchema,
|
|
39269
39576
|
body: docBodySchema
|
|
39270
39577
|
});
|
|
@@ -39434,7 +39741,7 @@ function getErrorMessage(error48, fallback = "Unknown error") {
|
|
|
39434
39741
|
}
|
|
39435
39742
|
|
|
39436
39743
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
39437
|
-
import { z as
|
|
39744
|
+
import { z as z12 } from "zod";
|
|
39438
39745
|
var EVIDENCE_ATOM_KINDS = [
|
|
39439
39746
|
"commit",
|
|
39440
39747
|
"files",
|
|
@@ -39456,96 +39763,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
39456
39763
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
39457
39764
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
39458
39765
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
39459
|
-
var commitAtomSchema =
|
|
39460
|
-
kind:
|
|
39461
|
-
sha:
|
|
39462
|
-
});
|
|
39463
|
-
var filesAtomSchema =
|
|
39464
|
-
kind:
|
|
39465
|
-
paths:
|
|
39466
|
-
});
|
|
39467
|
-
var testRunAtomSchema =
|
|
39468
|
-
kind:
|
|
39469
|
-
path:
|
|
39470
|
-
});
|
|
39471
|
-
var qaRunAtomSchema =
|
|
39472
|
-
kind:
|
|
39473
|
-
path:
|
|
39474
|
-
});
|
|
39475
|
-
var toolAtomSchema =
|
|
39476
|
-
kind:
|
|
39477
|
-
tool:
|
|
39478
|
-
});
|
|
39479
|
-
var urlAtomSchema =
|
|
39480
|
-
kind:
|
|
39481
|
-
url:
|
|
39482
|
-
});
|
|
39483
|
-
var noteAtomSchema =
|
|
39484
|
-
kind:
|
|
39485
|
-
note:
|
|
39486
|
-
});
|
|
39487
|
-
var decisionAtomSchema =
|
|
39488
|
-
kind:
|
|
39489
|
-
decisionId:
|
|
39490
|
-
});
|
|
39491
|
-
var prAtomSchema =
|
|
39492
|
-
kind:
|
|
39493
|
-
prNumber:
|
|
39494
|
-
componentPrNumber:
|
|
39766
|
+
var commitAtomSchema = z12.object({
|
|
39767
|
+
kind: z12.literal("commit"),
|
|
39768
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
39769
|
+
});
|
|
39770
|
+
var filesAtomSchema = z12.object({
|
|
39771
|
+
kind: z12.literal("files"),
|
|
39772
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
39773
|
+
});
|
|
39774
|
+
var testRunAtomSchema = z12.object({
|
|
39775
|
+
kind: z12.literal("test-run"),
|
|
39776
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
39777
|
+
});
|
|
39778
|
+
var qaRunAtomSchema = z12.object({
|
|
39779
|
+
kind: z12.literal("qa-run"),
|
|
39780
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
39781
|
+
});
|
|
39782
|
+
var toolAtomSchema = z12.object({
|
|
39783
|
+
kind: z12.literal("tool"),
|
|
39784
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
39785
|
+
});
|
|
39786
|
+
var urlAtomSchema = z12.object({
|
|
39787
|
+
kind: z12.literal("url"),
|
|
39788
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
39789
|
+
});
|
|
39790
|
+
var noteAtomSchema = z12.object({
|
|
39791
|
+
kind: z12.literal("note"),
|
|
39792
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
39793
|
+
});
|
|
39794
|
+
var decisionAtomSchema = z12.object({
|
|
39795
|
+
kind: z12.literal("decision"),
|
|
39796
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
39797
|
+
});
|
|
39798
|
+
var prAtomSchema = z12.object({
|
|
39799
|
+
kind: z12.literal("pr"),
|
|
39800
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
39801
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
39495
39802
|
/**
|
|
39496
39803
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
39497
39804
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
39498
39805
|
* `origin`, since PR numbers are only unique per repository.
|
|
39499
39806
|
*/
|
|
39500
|
-
repo:
|
|
39807
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
39501
39808
|
});
|
|
39502
|
-
var ciAtomSchema =
|
|
39503
|
-
kind:
|
|
39504
|
-
prNumber:
|
|
39505
|
-
componentPrNumber:
|
|
39809
|
+
var ciAtomSchema = z12.object({
|
|
39810
|
+
kind: z12.literal("ci"),
|
|
39811
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
39812
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
39506
39813
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
39507
|
-
repo:
|
|
39814
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
39508
39815
|
});
|
|
39509
|
-
var ciRunAtomSchema =
|
|
39510
|
-
kind:
|
|
39511
|
-
runId:
|
|
39816
|
+
var ciRunAtomSchema = z12.object({
|
|
39817
|
+
kind: z12.literal("ci-run"),
|
|
39818
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
39512
39819
|
});
|
|
39513
|
-
var deployAtomSchema =
|
|
39514
|
-
kind:
|
|
39515
|
-
provider:
|
|
39516
|
-
deploymentId:
|
|
39517
|
-
sha:
|
|
39518
|
-
probeUrl:
|
|
39820
|
+
var deployAtomSchema = z12.object({
|
|
39821
|
+
kind: z12.literal("deploy"),
|
|
39822
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
39823
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
39824
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
39825
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
39519
39826
|
});
|
|
39520
|
-
var locDropAtomSchema =
|
|
39521
|
-
kind:
|
|
39522
|
-
fromLines:
|
|
39523
|
-
toLines:
|
|
39827
|
+
var locDropAtomSchema = z12.object({
|
|
39828
|
+
kind: z12.literal("loc-drop"),
|
|
39829
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
39830
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
39524
39831
|
});
|
|
39525
|
-
var callsiteCoverageAtomSchema =
|
|
39526
|
-
kind:
|
|
39527
|
-
symbolName:
|
|
39528
|
-
relativeSourcePath:
|
|
39832
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
39833
|
+
kind: z12.literal("callsite-coverage"),
|
|
39834
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
39835
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
39529
39836
|
});
|
|
39530
39837
|
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}$/;
|
|
39531
39838
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
39532
39839
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
39533
39840
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
39534
|
-
var satisfiesAtomSchema =
|
|
39535
|
-
kind:
|
|
39841
|
+
var satisfiesAtomSchema = z12.object({
|
|
39842
|
+
kind: z12.literal("satisfies"),
|
|
39536
39843
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
39537
|
-
targetTaskId:
|
|
39844
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
39538
39845
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
39539
|
-
targetAcId:
|
|
39846
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
39540
39847
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
39541
|
-
targetAcAlias:
|
|
39848
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
39542
39849
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
39543
|
-
versionPin:
|
|
39850
|
+
versionPin: z12.string().regex(
|
|
39544
39851
|
SATISFIES_VERSION_PIN_REGEX,
|
|
39545
39852
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
39546
39853
|
).optional()
|
|
39547
39854
|
});
|
|
39548
|
-
var EvidenceAtomSchema =
|
|
39855
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
39549
39856
|
commitAtomSchema,
|
|
39550
39857
|
filesAtomSchema,
|
|
39551
39858
|
testRunAtomSchema,
|
|
@@ -39607,54 +39914,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
39607
39914
|
});
|
|
39608
39915
|
|
|
39609
39916
|
// packages/contracts/src/evidence-record-schema.ts
|
|
39610
|
-
import { z as
|
|
39611
|
-
var evidenceBaseSchema =
|
|
39917
|
+
import { z as z13 } from "zod";
|
|
39918
|
+
var evidenceBaseSchema = z13.object({
|
|
39612
39919
|
/** Identity string of the agent that produced this record. */
|
|
39613
|
-
agentIdentity:
|
|
39920
|
+
agentIdentity: z13.string().min(1),
|
|
39614
39921
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
39615
|
-
attachmentSha256:
|
|
39922
|
+
attachmentSha256: z13.string().length(64),
|
|
39616
39923
|
/** ISO 8601 timestamp at which the action ran. */
|
|
39617
|
-
ranAt:
|
|
39924
|
+
ranAt: z13.string().datetime(),
|
|
39618
39925
|
/** Wall-clock duration of the action in milliseconds. */
|
|
39619
|
-
durationMs:
|
|
39926
|
+
durationMs: z13.number().nonnegative()
|
|
39620
39927
|
});
|
|
39621
39928
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
39622
|
-
kind:
|
|
39623
|
-
phase:
|
|
39624
|
-
filesChanged:
|
|
39625
|
-
linesAdded:
|
|
39626
|
-
linesRemoved:
|
|
39929
|
+
kind: z13.literal("impl-diff"),
|
|
39930
|
+
phase: z13.literal("implement"),
|
|
39931
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
39932
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
39933
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
39627
39934
|
});
|
|
39628
39935
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
39629
|
-
kind:
|
|
39630
|
-
phase:
|
|
39631
|
-
reqIdsChecked:
|
|
39632
|
-
passed:
|
|
39633
|
-
details:
|
|
39936
|
+
kind: z13.literal("validate-spec-check"),
|
|
39937
|
+
phase: z13.literal("validate"),
|
|
39938
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
39939
|
+
passed: z13.boolean(),
|
|
39940
|
+
details: z13.string().min(1)
|
|
39634
39941
|
});
|
|
39635
39942
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
39636
|
-
kind:
|
|
39637
|
-
phase:
|
|
39638
|
-
command:
|
|
39639
|
-
exitCode:
|
|
39640
|
-
testsPassed:
|
|
39641
|
-
testsFailed:
|
|
39943
|
+
kind: z13.literal("test-output"),
|
|
39944
|
+
phase: z13.literal("test"),
|
|
39945
|
+
command: z13.string().min(1),
|
|
39946
|
+
exitCode: z13.number().int(),
|
|
39947
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
39948
|
+
testsFailed: z13.number().int().nonnegative()
|
|
39642
39949
|
});
|
|
39643
39950
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
39644
|
-
kind:
|
|
39645
|
-
phase:
|
|
39646
|
-
tool:
|
|
39647
|
-
passed:
|
|
39648
|
-
warnings:
|
|
39649
|
-
errors:
|
|
39951
|
+
kind: z13.literal("lint-report"),
|
|
39952
|
+
phase: z13.enum(["implement", "test"]),
|
|
39953
|
+
tool: z13.string().min(1),
|
|
39954
|
+
passed: z13.boolean(),
|
|
39955
|
+
warnings: z13.number().int().nonnegative(),
|
|
39956
|
+
errors: z13.number().int().nonnegative()
|
|
39650
39957
|
});
|
|
39651
39958
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
39652
|
-
kind:
|
|
39653
|
-
phase:
|
|
39654
|
-
cmd:
|
|
39655
|
-
exitCode:
|
|
39959
|
+
kind: z13.literal("command-output"),
|
|
39960
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
39961
|
+
cmd: z13.string().min(1),
|
|
39962
|
+
exitCode: z13.number().int()
|
|
39656
39963
|
});
|
|
39657
|
-
var evidenceRecordSchema =
|
|
39964
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
39658
39965
|
implDiffRecordSchema,
|
|
39659
39966
|
validateSpecCheckRecordSchema,
|
|
39660
39967
|
testOutputRecordSchema,
|
|
@@ -40589,107 +40896,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
40589
40896
|
});
|
|
40590
40897
|
|
|
40591
40898
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
40592
|
-
import { z as
|
|
40593
|
-
var LeaseScopeSchema =
|
|
40594
|
-
var LeaseLaneSchema =
|
|
40595
|
-
var LeaseAcquireRequestSchema =
|
|
40899
|
+
import { z as z14 } from "zod";
|
|
40900
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
40901
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
40902
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
40596
40903
|
/** Tag discriminating this request variant. */
|
|
40597
|
-
kind:
|
|
40904
|
+
kind: z14.literal("lease_acquire"),
|
|
40598
40905
|
/** The cleo.db scope being arbitrated. */
|
|
40599
40906
|
scope: LeaseScopeSchema,
|
|
40600
40907
|
/** The write lane within the scope. */
|
|
40601
40908
|
lane: LeaseLaneSchema,
|
|
40602
40909
|
/** Process+lane holder identity. */
|
|
40603
|
-
holder_id:
|
|
40910
|
+
holder_id: z14.string().min(1),
|
|
40604
40911
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
40605
|
-
priority:
|
|
40912
|
+
priority: z14.number().int().min(0).max(255),
|
|
40606
40913
|
/** Lease time-to-live in milliseconds. */
|
|
40607
|
-
ttl_ms:
|
|
40914
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
40608
40915
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
40609
|
-
reentrant:
|
|
40916
|
+
reentrant: z14.boolean()
|
|
40610
40917
|
}).strict();
|
|
40611
|
-
var LeaseReleaseRequestSchema =
|
|
40918
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
40612
40919
|
/** Tag discriminating this request variant. */
|
|
40613
|
-
kind:
|
|
40920
|
+
kind: z14.literal("lease_release"),
|
|
40614
40921
|
/** The cleo.db scope being arbitrated. */
|
|
40615
40922
|
scope: LeaseScopeSchema,
|
|
40616
40923
|
/** The write lane within the scope. */
|
|
40617
40924
|
lane: LeaseLaneSchema,
|
|
40618
40925
|
/** Process+lane holder identity. */
|
|
40619
|
-
holder_id:
|
|
40926
|
+
holder_id: z14.string().min(1),
|
|
40620
40927
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
40621
|
-
epoch:
|
|
40928
|
+
epoch: z14.number().int().nonnegative()
|
|
40622
40929
|
}).strict();
|
|
40623
|
-
var LeaseRenewRequestSchema =
|
|
40930
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
40624
40931
|
/** Tag discriminating this request variant. */
|
|
40625
|
-
kind:
|
|
40932
|
+
kind: z14.literal("lease_renew"),
|
|
40626
40933
|
/** The cleo.db scope being arbitrated. */
|
|
40627
40934
|
scope: LeaseScopeSchema,
|
|
40628
40935
|
/** The write lane within the scope. */
|
|
40629
40936
|
lane: LeaseLaneSchema,
|
|
40630
40937
|
/** Process+lane holder identity. */
|
|
40631
|
-
holder_id:
|
|
40938
|
+
holder_id: z14.string().min(1),
|
|
40632
40939
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
40633
|
-
epoch:
|
|
40940
|
+
epoch: z14.number().int().nonnegative()
|
|
40634
40941
|
}).strict();
|
|
40635
|
-
var RateCheckRequestSchema =
|
|
40942
|
+
var RateCheckRequestSchema = z14.object({
|
|
40636
40943
|
/** Tag discriminating this request variant. */
|
|
40637
|
-
kind:
|
|
40944
|
+
kind: z14.literal("rate_check"),
|
|
40638
40945
|
/** The cleo.db scope being checked. */
|
|
40639
40946
|
scope: LeaseScopeSchema,
|
|
40640
40947
|
/** The write lane within the scope. */
|
|
40641
40948
|
lane: LeaseLaneSchema,
|
|
40642
40949
|
/** Estimated bytes the caller intends to write. */
|
|
40643
|
-
est_bytes:
|
|
40950
|
+
est_bytes: z14.number().int().nonnegative()
|
|
40644
40951
|
}).strict();
|
|
40645
|
-
var ToolGrantRequestSchema =
|
|
40952
|
+
var ToolGrantRequestSchema = z14.object({
|
|
40646
40953
|
/** Tag discriminating this request variant. */
|
|
40647
|
-
kind:
|
|
40954
|
+
kind: z14.literal("tool_grant"),
|
|
40648
40955
|
/** The tool name being requested. */
|
|
40649
|
-
tool:
|
|
40956
|
+
tool: z14.string().min(1),
|
|
40650
40957
|
/** The requesting holder identity. */
|
|
40651
|
-
holder_id:
|
|
40958
|
+
holder_id: z14.string().min(1)
|
|
40652
40959
|
}).strict();
|
|
40653
|
-
var QueuePriorityClassSchema =
|
|
40654
|
-
var QueueAdmitRequestSchema =
|
|
40960
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
40961
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
40655
40962
|
/** Tag discriminating this request variant. */
|
|
40656
|
-
kind:
|
|
40963
|
+
kind: z14.literal("queue_admit"),
|
|
40657
40964
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
40658
|
-
provider:
|
|
40965
|
+
provider: z14.string().min(1),
|
|
40659
40966
|
/** The caller's priority class (lead > worker > background). */
|
|
40660
40967
|
priority_class: QueuePriorityClassSchema,
|
|
40661
40968
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
40662
|
-
est_tokens:
|
|
40969
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
40663
40970
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
40664
|
-
child_id:
|
|
40971
|
+
child_id: z14.string().min(1)
|
|
40665
40972
|
}).strict();
|
|
40666
|
-
var WorkerHeartbeatRequestSchema =
|
|
40973
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
40667
40974
|
/** Tag discriminating this request variant. */
|
|
40668
|
-
kind:
|
|
40975
|
+
kind: z14.literal("worker_heartbeat"),
|
|
40669
40976
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
40670
|
-
child_id:
|
|
40977
|
+
child_id: z14.string().min(1),
|
|
40671
40978
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
40672
|
-
in_flight_llm:
|
|
40979
|
+
in_flight_llm: z14.boolean()
|
|
40673
40980
|
}).strict();
|
|
40674
|
-
var ResourceAdmitRequestSchema =
|
|
40981
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
40675
40982
|
/** Tag discriminating this request variant. */
|
|
40676
|
-
kind:
|
|
40983
|
+
kind: z14.literal("resource_admit"),
|
|
40677
40984
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
40678
|
-
class:
|
|
40985
|
+
class: z14.string().min(1),
|
|
40679
40986
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
40680
|
-
holder_id:
|
|
40987
|
+
holder_id: z14.string().min(1),
|
|
40681
40988
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
40682
|
-
budget:
|
|
40989
|
+
budget: z14.number().int().nonnegative()
|
|
40683
40990
|
}).strict();
|
|
40684
|
-
var ResourceReleaseRequestSchema =
|
|
40991
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
40685
40992
|
/** Tag discriminating this request variant. */
|
|
40686
|
-
kind:
|
|
40993
|
+
kind: z14.literal("resource_release"),
|
|
40687
40994
|
/** The resource class the slot belongs to. */
|
|
40688
|
-
class:
|
|
40995
|
+
class: z14.string().min(1),
|
|
40689
40996
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
40690
|
-
holder_id:
|
|
40997
|
+
holder_id: z14.string().min(1)
|
|
40691
40998
|
}).strict();
|
|
40692
|
-
var LeaseIpcRequestSchema =
|
|
40999
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
40693
41000
|
LeaseAcquireRequestSchema,
|
|
40694
41001
|
LeaseReleaseRequestSchema,
|
|
40695
41002
|
LeaseRenewRequestSchema,
|
|
@@ -40700,133 +41007,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
40700
41007
|
ResourceAdmitRequestSchema,
|
|
40701
41008
|
ResourceReleaseRequestSchema
|
|
40702
41009
|
]);
|
|
40703
|
-
var LeaseGrantedResponseSchema =
|
|
41010
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
40704
41011
|
/** Tag discriminating this response variant. */
|
|
40705
|
-
kind:
|
|
41012
|
+
kind: z14.literal("lease_granted"),
|
|
40706
41013
|
/** The granted cleo.db scope. */
|
|
40707
41014
|
scope: LeaseScopeSchema,
|
|
40708
41015
|
/** The granted write lane. */
|
|
40709
41016
|
lane: LeaseLaneSchema,
|
|
40710
41017
|
/** The holder the lease was granted to. */
|
|
40711
|
-
holder_id:
|
|
41018
|
+
holder_id: z14.string().min(1),
|
|
40712
41019
|
/** The monotonic epoch fence assigned to this grant. */
|
|
40713
|
-
epoch:
|
|
41020
|
+
epoch: z14.number().int().nonnegative(),
|
|
40714
41021
|
/** The lease TTL in milliseconds. */
|
|
40715
|
-
ttl_ms:
|
|
41022
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
40716
41023
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
40717
|
-
expires_at_ms:
|
|
41024
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
40718
41025
|
}).strict();
|
|
40719
|
-
var LeaseQueuedResponseSchema =
|
|
41026
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
40720
41027
|
/** Tag discriminating this response variant. */
|
|
40721
|
-
kind:
|
|
41028
|
+
kind: z14.literal("lease_queued"),
|
|
40722
41029
|
/** The queued cleo.db scope. */
|
|
40723
41030
|
scope: LeaseScopeSchema,
|
|
40724
41031
|
/** The queued write lane. */
|
|
40725
41032
|
lane: LeaseLaneSchema,
|
|
40726
41033
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
40727
|
-
ticket:
|
|
41034
|
+
ticket: z14.number().int().nonnegative(),
|
|
40728
41035
|
/** Number of waiters ahead of this one. */
|
|
40729
|
-
ahead:
|
|
41036
|
+
ahead: z14.number().int().nonnegative()
|
|
40730
41037
|
}).strict();
|
|
40731
|
-
var LeaseDeniedResponseSchema =
|
|
41038
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
40732
41039
|
/** Tag discriminating this response variant. */
|
|
40733
|
-
kind:
|
|
41040
|
+
kind: z14.literal("lease_denied"),
|
|
40734
41041
|
/** The denied cleo.db scope. */
|
|
40735
41042
|
scope: LeaseScopeSchema,
|
|
40736
41043
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
40737
|
-
code:
|
|
41044
|
+
code: z14.string().min(1),
|
|
40738
41045
|
/** Human-readable denial message. */
|
|
40739
|
-
message:
|
|
41046
|
+
message: z14.string()
|
|
40740
41047
|
}).strict();
|
|
40741
|
-
var RateResultResponseSchema =
|
|
41048
|
+
var RateResultResponseSchema = z14.object({
|
|
40742
41049
|
/** Tag discriminating this response variant. */
|
|
40743
|
-
kind:
|
|
41050
|
+
kind: z14.literal("rate_result"),
|
|
40744
41051
|
/** The checked cleo.db scope. */
|
|
40745
41052
|
scope: LeaseScopeSchema,
|
|
40746
41053
|
/** Whether the write is within budget. */
|
|
40747
|
-
ok:
|
|
41054
|
+
ok: z14.boolean(),
|
|
40748
41055
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
40749
|
-
retry_after_ms:
|
|
41056
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40750
41057
|
/** Remaining token budget for the scope. */
|
|
40751
|
-
tokens_remaining:
|
|
41058
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
40752
41059
|
}).strict();
|
|
40753
|
-
var ToolGrantedResponseSchema =
|
|
41060
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
40754
41061
|
/** Tag discriminating this response variant. */
|
|
40755
|
-
kind:
|
|
41062
|
+
kind: z14.literal("tool_granted"),
|
|
40756
41063
|
/** The granted tool name. */
|
|
40757
|
-
tool:
|
|
41064
|
+
tool: z14.string().min(1),
|
|
40758
41065
|
/** The holder the tool grant was issued to. */
|
|
40759
|
-
holder_id:
|
|
41066
|
+
holder_id: z14.string().min(1)
|
|
40760
41067
|
}).strict();
|
|
40761
|
-
var LeaseRevokedResponseSchema =
|
|
41068
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
40762
41069
|
/** Tag discriminating this response variant. */
|
|
40763
|
-
kind:
|
|
41070
|
+
kind: z14.literal("lease_revoked"),
|
|
40764
41071
|
/** The revoked cleo.db scope. */
|
|
40765
41072
|
scope: LeaseScopeSchema,
|
|
40766
41073
|
/** The revoked write lane. */
|
|
40767
41074
|
lane: LeaseLaneSchema,
|
|
40768
41075
|
/** The holder whose lease was revoked. */
|
|
40769
|
-
holder_id:
|
|
41076
|
+
holder_id: z14.string().min(1),
|
|
40770
41077
|
/** Human-readable reason for the revocation. */
|
|
40771
|
-
reason:
|
|
41078
|
+
reason: z14.string()
|
|
40772
41079
|
}).strict();
|
|
40773
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
41080
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
40774
41081
|
/** Tag discriminating this response variant. */
|
|
40775
|
-
kind:
|
|
41082
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
40776
41083
|
/** Logical id of the killed child. */
|
|
40777
|
-
child_id:
|
|
41084
|
+
child_id: z14.string().min(1),
|
|
40778
41085
|
/** The holder identity the killed child held the lease as. */
|
|
40779
|
-
holder_id:
|
|
41086
|
+
holder_id: z14.string().min(1),
|
|
40780
41087
|
/** The cleo.db scope the killed child held the lease in. */
|
|
40781
41088
|
scope: LeaseScopeSchema,
|
|
40782
41089
|
/** Human-readable reason for the kill. */
|
|
40783
|
-
reason:
|
|
41090
|
+
reason: z14.string()
|
|
40784
41091
|
}).strict();
|
|
40785
|
-
var QueueAdmitDispositionSchema =
|
|
40786
|
-
var QueueAdmitResultResponseSchema =
|
|
41092
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
41093
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
40787
41094
|
/** Tag discriminating this response variant. */
|
|
40788
|
-
kind:
|
|
41095
|
+
kind: z14.literal("queue_admit_result"),
|
|
40789
41096
|
/** Whether the LLM call was admitted or deferred. */
|
|
40790
41097
|
disposition: QueueAdmitDispositionSchema,
|
|
40791
41098
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
40792
|
-
retry_after_ms:
|
|
41099
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40793
41100
|
/** Remaining provider token budget after this decision. */
|
|
40794
|
-
tokens_remaining:
|
|
41101
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
40795
41102
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
40796
|
-
queue_position:
|
|
41103
|
+
queue_position: z14.number().int().nonnegative()
|
|
40797
41104
|
}).strict();
|
|
40798
|
-
var HeartbeatAckResponseSchema =
|
|
41105
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
40799
41106
|
/** Tag discriminating this response variant. */
|
|
40800
|
-
kind:
|
|
41107
|
+
kind: z14.literal("heartbeat_ack")
|
|
40801
41108
|
}).strict();
|
|
40802
|
-
var ResourceAdmitDispositionSchema =
|
|
40803
|
-
var ResourceAdmitResultResponseSchema =
|
|
41109
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
41110
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
40804
41111
|
/** Tag discriminating this response variant. */
|
|
40805
|
-
kind:
|
|
41112
|
+
kind: z14.literal("resource_admit_result"),
|
|
40806
41113
|
/** Whether the heavy op was admitted or deferred. */
|
|
40807
41114
|
disposition: ResourceAdmitDispositionSchema,
|
|
40808
41115
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
40809
|
-
retry_after_ms:
|
|
41116
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
40810
41117
|
/** Remaining slots for the class after this decision. */
|
|
40811
|
-
slots_remaining:
|
|
41118
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
40812
41119
|
}).strict();
|
|
40813
|
-
var ResourceReleaseResultResponseSchema =
|
|
41120
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
40814
41121
|
/** Tag discriminating this response variant. */
|
|
40815
|
-
kind:
|
|
41122
|
+
kind: z14.literal("resource_release_result"),
|
|
40816
41123
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
40817
|
-
released:
|
|
41124
|
+
released: z14.boolean(),
|
|
40818
41125
|
/** Remaining in-flight holders for the class after the release. */
|
|
40819
|
-
slots_remaining:
|
|
41126
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
40820
41127
|
}).strict();
|
|
40821
|
-
var LeaseErrorResponseSchema =
|
|
41128
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
40822
41129
|
/** Tag discriminating this response variant. */
|
|
40823
|
-
kind:
|
|
41130
|
+
kind: z14.literal("error"),
|
|
40824
41131
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
40825
|
-
code:
|
|
41132
|
+
code: z14.string().min(1),
|
|
40826
41133
|
/** Human-readable error message. */
|
|
40827
|
-
message:
|
|
41134
|
+
message: z14.string()
|
|
40828
41135
|
}).strict();
|
|
40829
|
-
var LeaseIpcResponseSchema =
|
|
41136
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
40830
41137
|
LeaseGrantedResponseSchema,
|
|
40831
41138
|
LeaseQueuedResponseSchema,
|
|
40832
41139
|
LeaseDeniedResponseSchema,
|
|
@@ -40840,27 +41147,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
40840
41147
|
ResourceReleaseResultResponseSchema,
|
|
40841
41148
|
LeaseErrorResponseSchema
|
|
40842
41149
|
]);
|
|
40843
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
41150
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
40844
41151
|
/** Parallel protocol version. */
|
|
40845
|
-
protocol_version:
|
|
41152
|
+
protocol_version: z14.string(),
|
|
40846
41153
|
/** Correlation id echoed back on the matching response. */
|
|
40847
|
-
id:
|
|
41154
|
+
id: z14.string().min(1),
|
|
40848
41155
|
/** Direction discriminator. */
|
|
40849
|
-
direction:
|
|
41156
|
+
direction: z14.literal("request"),
|
|
40850
41157
|
/** The request body. */
|
|
40851
41158
|
request: LeaseIpcRequestSchema
|
|
40852
41159
|
}).strict();
|
|
40853
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
41160
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
40854
41161
|
/** Parallel protocol version. */
|
|
40855
|
-
protocol_version:
|
|
41162
|
+
protocol_version: z14.string(),
|
|
40856
41163
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
40857
|
-
id:
|
|
41164
|
+
id: z14.string().min(1),
|
|
40858
41165
|
/** Direction discriminator. */
|
|
40859
|
-
direction:
|
|
41166
|
+
direction: z14.literal("response"),
|
|
40860
41167
|
/** The response body. */
|
|
40861
41168
|
response: LeaseIpcResponseSchema
|
|
40862
41169
|
}).strict();
|
|
40863
|
-
var LeaseIpcEnvelopeSchema =
|
|
41170
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
40864
41171
|
LeaseIpcRequestEnvelopeSchema,
|
|
40865
41172
|
LeaseIpcResponseEnvelopeSchema
|
|
40866
41173
|
]);
|
|
@@ -40895,7 +41202,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
40895
41202
|
];
|
|
40896
41203
|
|
|
40897
41204
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
40898
|
-
import { z as
|
|
41205
|
+
import { z as z15 } from "zod";
|
|
40899
41206
|
var CATALOG_MODEL_STATUSES = [
|
|
40900
41207
|
"stable",
|
|
40901
41208
|
"beta",
|
|
@@ -40904,78 +41211,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
40904
41211
|
"retired"
|
|
40905
41212
|
];
|
|
40906
41213
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
40907
|
-
var isoDate =
|
|
40908
|
-
var semver =
|
|
40909
|
-
var catalogModalitiesSchema =
|
|
40910
|
-
input:
|
|
40911
|
-
output:
|
|
41214
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
41215
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
41216
|
+
var catalogModalitiesSchema = z15.object({
|
|
41217
|
+
input: z15.array(z15.string()),
|
|
41218
|
+
output: z15.array(z15.string())
|
|
40912
41219
|
}).strict();
|
|
40913
|
-
var catalogCostSchema =
|
|
40914
|
-
input:
|
|
40915
|
-
output:
|
|
40916
|
-
cache_read:
|
|
40917
|
-
cache_write:
|
|
40918
|
-
context_over_200k:
|
|
41220
|
+
var catalogCostSchema = z15.object({
|
|
41221
|
+
input: z15.number().optional(),
|
|
41222
|
+
output: z15.number().optional(),
|
|
41223
|
+
cache_read: z15.number().optional(),
|
|
41224
|
+
cache_write: z15.number().optional(),
|
|
41225
|
+
context_over_200k: z15.number().optional()
|
|
40919
41226
|
}).strict();
|
|
40920
|
-
var catalogLimitSchema =
|
|
40921
|
-
context:
|
|
40922
|
-
output:
|
|
41227
|
+
var catalogLimitSchema = z15.object({
|
|
41228
|
+
context: z15.number(),
|
|
41229
|
+
output: z15.number()
|
|
40923
41230
|
}).strict();
|
|
40924
|
-
var catalogModelProviderSchema =
|
|
40925
|
-
npm:
|
|
40926
|
-
api:
|
|
41231
|
+
var catalogModelProviderSchema = z15.object({
|
|
41232
|
+
npm: z15.string(),
|
|
41233
|
+
api: z15.string()
|
|
40927
41234
|
}).strict();
|
|
40928
|
-
var catalogModelEntrySchema =
|
|
40929
|
-
id:
|
|
40930
|
-
name:
|
|
40931
|
-
family:
|
|
40932
|
-
attachment:
|
|
40933
|
-
reasoning:
|
|
40934
|
-
temperature:
|
|
40935
|
-
interleaved:
|
|
40936
|
-
tool_call:
|
|
41235
|
+
var catalogModelEntrySchema = z15.object({
|
|
41236
|
+
id: z15.string(),
|
|
41237
|
+
name: z15.string(),
|
|
41238
|
+
family: z15.string(),
|
|
41239
|
+
attachment: z15.boolean(),
|
|
41240
|
+
reasoning: z15.boolean(),
|
|
41241
|
+
temperature: z15.boolean(),
|
|
41242
|
+
interleaved: z15.boolean(),
|
|
41243
|
+
tool_call: z15.boolean(),
|
|
40937
41244
|
modalities: catalogModalitiesSchema,
|
|
40938
41245
|
cost: catalogCostSchema,
|
|
40939
41246
|
limit: catalogLimitSchema,
|
|
40940
|
-
status:
|
|
41247
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
40941
41248
|
release_date: isoDate,
|
|
40942
41249
|
provider: catalogModelProviderSchema
|
|
40943
41250
|
}).strict();
|
|
40944
|
-
var catalogProviderSchema =
|
|
40945
|
-
id:
|
|
40946
|
-
endpoint:
|
|
40947
|
-
authTypes:
|
|
40948
|
-
npm:
|
|
41251
|
+
var catalogProviderSchema = z15.object({
|
|
41252
|
+
id: z15.string(),
|
|
41253
|
+
endpoint: z15.string(),
|
|
41254
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
41255
|
+
npm: z15.string().optional()
|
|
40949
41256
|
}).strict();
|
|
40950
|
-
var curatedCatalogSchema =
|
|
40951
|
-
$schema:
|
|
41257
|
+
var curatedCatalogSchema = z15.object({
|
|
41258
|
+
$schema: z15.string().optional(),
|
|
40952
41259
|
version: semver,
|
|
40953
41260
|
lastUpdated: isoDate,
|
|
40954
|
-
providers:
|
|
40955
|
-
models:
|
|
41261
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
41262
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
40956
41263
|
}).strict();
|
|
40957
|
-
var modelsCatalogRowInsertSchema =
|
|
40958
|
-
id:
|
|
40959
|
-
providerId:
|
|
40960
|
-
name:
|
|
40961
|
-
family:
|
|
40962
|
-
attachment:
|
|
40963
|
-
reasoning:
|
|
40964
|
-
temperature:
|
|
40965
|
-
interleaved:
|
|
40966
|
-
toolCall:
|
|
40967
|
-
modalities:
|
|
40968
|
-
cost:
|
|
40969
|
-
contextLimit:
|
|
40970
|
-
outputLimit:
|
|
40971
|
-
status:
|
|
41264
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
41265
|
+
id: z15.string(),
|
|
41266
|
+
providerId: z15.string(),
|
|
41267
|
+
name: z15.string(),
|
|
41268
|
+
family: z15.string(),
|
|
41269
|
+
attachment: z15.boolean(),
|
|
41270
|
+
reasoning: z15.boolean(),
|
|
41271
|
+
temperature: z15.boolean(),
|
|
41272
|
+
interleaved: z15.boolean(),
|
|
41273
|
+
toolCall: z15.boolean(),
|
|
41274
|
+
modalities: z15.string(),
|
|
41275
|
+
cost: z15.string(),
|
|
41276
|
+
contextLimit: z15.number().nullable().optional(),
|
|
41277
|
+
outputLimit: z15.number().nullable().optional(),
|
|
41278
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
40972
41279
|
releaseDate: isoDate,
|
|
40973
|
-
modelsDevId:
|
|
40974
|
-
source:
|
|
40975
|
-
seededAt:
|
|
41280
|
+
modelsDevId: z15.string(),
|
|
41281
|
+
source: z15.string(),
|
|
41282
|
+
seededAt: z15.string().optional()
|
|
40976
41283
|
}).strict();
|
|
40977
41284
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
40978
|
-
seededAt:
|
|
41285
|
+
seededAt: z15.string()
|
|
40979
41286
|
});
|
|
40980
41287
|
|
|
40981
41288
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -41023,7 +41330,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
41023
41330
|
];
|
|
41024
41331
|
|
|
41025
41332
|
// packages/contracts/src/workgraph.ts
|
|
41026
|
-
import { z as
|
|
41333
|
+
import { z as z16 } from "zod";
|
|
41027
41334
|
|
|
41028
41335
|
// packages/contracts/src/status-registry.ts
|
|
41029
41336
|
var TASK_STATUSES = [
|
|
@@ -41038,10 +41345,10 @@ var TASK_STATUSES = [
|
|
|
41038
41345
|
|
|
41039
41346
|
// packages/contracts/src/workgraph.ts
|
|
41040
41347
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
41041
|
-
var taskTypeSchema =
|
|
41042
|
-
var taskPrioritySchema =
|
|
41043
|
-
var taskStatusSchema =
|
|
41044
|
-
var verificationGateSchema =
|
|
41348
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
41349
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
41350
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
41351
|
+
var verificationGateSchema = z16.enum([
|
|
41045
41352
|
"implemented",
|
|
41046
41353
|
"testsPassed",
|
|
41047
41354
|
"qaPassed",
|
|
@@ -41050,7 +41357,7 @@ var verificationGateSchema = z15.enum([
|
|
|
41050
41357
|
"documented",
|
|
41051
41358
|
"nexusImpact"
|
|
41052
41359
|
]);
|
|
41053
|
-
var workGraphRelationKindSchema =
|
|
41360
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
41054
41361
|
"contains",
|
|
41055
41362
|
"depends_on",
|
|
41056
41363
|
"blocks",
|
|
@@ -41058,317 +41365,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
41058
41365
|
"groups",
|
|
41059
41366
|
"satisfies"
|
|
41060
41367
|
]);
|
|
41061
|
-
var workGraphTraversalDirectionSchema =
|
|
41368
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
41062
41369
|
"ancestors",
|
|
41063
41370
|
"descendants",
|
|
41064
41371
|
"upstream",
|
|
41065
41372
|
"downstream"
|
|
41066
41373
|
]);
|
|
41067
|
-
var workGraphEdgeDirectionSchema =
|
|
41068
|
-
var paginationParamsSchema =
|
|
41069
|
-
cursor:
|
|
41070
|
-
limit:
|
|
41374
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
41375
|
+
var paginationParamsSchema = z16.object({
|
|
41376
|
+
cursor: z16.string().min(1).optional(),
|
|
41377
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
41071
41378
|
});
|
|
41072
|
-
var workGraphNodeSchema =
|
|
41073
|
-
id:
|
|
41379
|
+
var workGraphNodeSchema = z16.object({
|
|
41380
|
+
id: z16.string().min(1),
|
|
41074
41381
|
type: taskTypeSchema,
|
|
41075
|
-
title:
|
|
41382
|
+
title: z16.string(),
|
|
41076
41383
|
status: taskStatusSchema,
|
|
41077
41384
|
priority: taskPrioritySchema,
|
|
41078
|
-
parentId:
|
|
41385
|
+
parentId: z16.string().min(1).optional()
|
|
41079
41386
|
});
|
|
41080
|
-
var workGraphEdgeSchema =
|
|
41081
|
-
fromId:
|
|
41082
|
-
toId:
|
|
41387
|
+
var workGraphEdgeSchema = z16.object({
|
|
41388
|
+
fromId: z16.string().min(1),
|
|
41389
|
+
toId: z16.string().min(1),
|
|
41083
41390
|
kind: workGraphRelationKindSchema
|
|
41084
41391
|
});
|
|
41085
|
-
var workGraphHierarchyEdgeSchema =
|
|
41086
|
-
fromId:
|
|
41087
|
-
toId:
|
|
41088
|
-
kind:
|
|
41392
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
41393
|
+
fromId: z16.string().min(1),
|
|
41394
|
+
toId: z16.string().min(1),
|
|
41395
|
+
kind: z16.literal("contains")
|
|
41089
41396
|
}).strict();
|
|
41090
|
-
var workGraphPageInfoSchema =
|
|
41091
|
-
nextCursor:
|
|
41092
|
-
hasMore:
|
|
41093
|
-
});
|
|
41094
|
-
var workGraphRollupCountsSchema =
|
|
41095
|
-
total:
|
|
41096
|
-
byStatus:
|
|
41097
|
-
byType:
|
|
41098
|
-
});
|
|
41099
|
-
var workGraphSubtreePercentagesSchema =
|
|
41100
|
-
done:
|
|
41101
|
-
active:
|
|
41102
|
-
blocked:
|
|
41103
|
-
pending:
|
|
41104
|
-
cancelled:
|
|
41105
|
-
});
|
|
41106
|
-
var workGraphProjectionMismatchSchema =
|
|
41107
|
-
field:
|
|
41108
|
-
expected:
|
|
41109
|
-
actual:
|
|
41397
|
+
var workGraphPageInfoSchema = z16.object({
|
|
41398
|
+
nextCursor: z16.string().min(1).optional(),
|
|
41399
|
+
hasMore: z16.boolean()
|
|
41400
|
+
});
|
|
41401
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
41402
|
+
total: z16.number().int().nonnegative(),
|
|
41403
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
41404
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
41405
|
+
});
|
|
41406
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
41407
|
+
done: z16.number().nonnegative(),
|
|
41408
|
+
active: z16.number().nonnegative(),
|
|
41409
|
+
blocked: z16.number().nonnegative(),
|
|
41410
|
+
pending: z16.number().nonnegative(),
|
|
41411
|
+
cancelled: z16.number().nonnegative()
|
|
41412
|
+
});
|
|
41413
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
41414
|
+
field: z16.string().min(1),
|
|
41415
|
+
expected: z16.number().int().nonnegative(),
|
|
41416
|
+
actual: z16.number().int().nonnegative()
|
|
41110
41417
|
});
|
|
41111
41418
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
41112
|
-
role:
|
|
41113
|
-
dependencyBlockers:
|
|
41114
|
-
gateBlockers:
|
|
41419
|
+
role: z16.string().min(1).optional(),
|
|
41420
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
41421
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
41115
41422
|
});
|
|
41116
41423
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
41117
|
-
source:
|
|
41118
|
-
relationType:
|
|
41119
|
-
reason:
|
|
41424
|
+
source: z16.literal("relation"),
|
|
41425
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
41426
|
+
reason: z16.string().min(1).optional()
|
|
41120
41427
|
});
|
|
41121
41428
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
41122
|
-
source:
|
|
41123
|
-
kind:
|
|
41429
|
+
source: z16.literal("dependency"),
|
|
41430
|
+
kind: z16.literal("depends_on")
|
|
41124
41431
|
});
|
|
41125
|
-
var workGraphOmissionReasonSchema =
|
|
41432
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
41126
41433
|
"budget_exceeded",
|
|
41127
41434
|
"not_requested",
|
|
41128
41435
|
"not_available",
|
|
41129
41436
|
"redacted",
|
|
41130
41437
|
"truncated"
|
|
41131
41438
|
]);
|
|
41132
|
-
var workGraphContextBudgetSchema =
|
|
41133
|
-
tokenBudget:
|
|
41134
|
-
estimatedTokens:
|
|
41135
|
-
remainingTokens:
|
|
41136
|
-
truncated:
|
|
41137
|
-
});
|
|
41138
|
-
var workGraphOmissionSchema =
|
|
41139
|
-
path:
|
|
41439
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
41440
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
41441
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
41442
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
41443
|
+
truncated: z16.boolean()
|
|
41444
|
+
});
|
|
41445
|
+
var workGraphOmissionSchema = z16.object({
|
|
41446
|
+
path: z16.string().min(1),
|
|
41140
41447
|
reason: workGraphOmissionReasonSchema,
|
|
41141
|
-
message:
|
|
41142
|
-
estimatedTokens:
|
|
41448
|
+
message: z16.string().min(1),
|
|
41449
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
41143
41450
|
});
|
|
41144
|
-
var workGraphDirectEdgeSchema =
|
|
41451
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
41145
41452
|
workGraphRelationEdgeSchema,
|
|
41146
41453
|
workGraphDependencyEdgeSchema
|
|
41147
41454
|
]);
|
|
41148
41455
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
41149
|
-
rootId:
|
|
41150
|
-
tokenBudget:
|
|
41151
|
-
includeRelations:
|
|
41152
|
-
includeReadiness:
|
|
41153
|
-
includeRollup:
|
|
41456
|
+
rootId: z16.string().min(1),
|
|
41457
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
41458
|
+
includeRelations: z16.boolean().optional(),
|
|
41459
|
+
includeReadiness: z16.boolean().optional(),
|
|
41460
|
+
includeRollup: z16.boolean().optional()
|
|
41154
41461
|
});
|
|
41155
41462
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
41156
|
-
rootId:
|
|
41463
|
+
rootId: z16.string().min(1),
|
|
41157
41464
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
41158
|
-
maxDepth:
|
|
41159
|
-
includeRelations:
|
|
41465
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41466
|
+
includeRelations: z16.boolean().optional()
|
|
41160
41467
|
});
|
|
41161
|
-
var workGraphSliceSchema =
|
|
41162
|
-
rootId:
|
|
41468
|
+
var workGraphSliceSchema = z16.object({
|
|
41469
|
+
rootId: z16.string().min(1),
|
|
41163
41470
|
direction: workGraphTraversalDirectionSchema,
|
|
41164
|
-
nodes:
|
|
41165
|
-
edges:
|
|
41471
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
41472
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
41166
41473
|
pageInfo: workGraphPageInfoSchema,
|
|
41167
|
-
omissions:
|
|
41168
|
-
});
|
|
41169
|
-
var workGraphReadinessParamsSchema =
|
|
41170
|
-
rootId:
|
|
41171
|
-
role:
|
|
41172
|
-
includeGateBlockers:
|
|
41173
|
-
});
|
|
41174
|
-
var workGraphReadinessResultSchema =
|
|
41175
|
-
rootId:
|
|
41176
|
-
role:
|
|
41177
|
-
ready:
|
|
41178
|
-
warnings:
|
|
41179
|
-
groups:
|
|
41180
|
-
ready:
|
|
41181
|
-
blocked:
|
|
41182
|
-
blockedBy:
|
|
41183
|
-
|
|
41184
|
-
|
|
41185
|
-
kind:
|
|
41186
|
-
blockerId:
|
|
41187
|
-
blocks:
|
|
41474
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
41475
|
+
});
|
|
41476
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
41477
|
+
rootId: z16.string().min(1),
|
|
41478
|
+
role: z16.string().min(1).optional(),
|
|
41479
|
+
includeGateBlockers: z16.boolean().optional()
|
|
41480
|
+
});
|
|
41481
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
41482
|
+
rootId: z16.string().min(1),
|
|
41483
|
+
role: z16.string().min(1).optional(),
|
|
41484
|
+
ready: z16.boolean(),
|
|
41485
|
+
warnings: z16.array(z16.string()),
|
|
41486
|
+
groups: z16.object({
|
|
41487
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41488
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41489
|
+
blockedBy: z16.array(
|
|
41490
|
+
z16.discriminatedUnion("kind", [
|
|
41491
|
+
z16.object({
|
|
41492
|
+
kind: z16.literal("dependency"),
|
|
41493
|
+
blockerId: z16.string().min(1),
|
|
41494
|
+
blocks: z16.array(z16.string().min(1))
|
|
41188
41495
|
}),
|
|
41189
|
-
|
|
41190
|
-
kind:
|
|
41496
|
+
z16.object({
|
|
41497
|
+
kind: z16.literal("gate"),
|
|
41191
41498
|
gate: verificationGateSchema,
|
|
41192
|
-
blocks:
|
|
41499
|
+
blocks: z16.array(z16.string().min(1))
|
|
41193
41500
|
})
|
|
41194
41501
|
])
|
|
41195
41502
|
)
|
|
41196
41503
|
})
|
|
41197
41504
|
});
|
|
41198
|
-
var workGraphContextPackSchema =
|
|
41199
|
-
rootId:
|
|
41200
|
-
generatedAt:
|
|
41505
|
+
var workGraphContextPackSchema = z16.object({
|
|
41506
|
+
rootId: z16.string().min(1),
|
|
41507
|
+
generatedAt: z16.string().min(1),
|
|
41201
41508
|
budget: workGraphContextBudgetSchema,
|
|
41202
41509
|
slice: workGraphSliceSchema,
|
|
41203
|
-
relationEdges:
|
|
41204
|
-
rootId:
|
|
41510
|
+
relationEdges: z16.object({
|
|
41511
|
+
rootId: z16.string().min(1),
|
|
41205
41512
|
direction: workGraphEdgeDirectionSchema,
|
|
41206
|
-
edges:
|
|
41513
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
41207
41514
|
}).optional(),
|
|
41208
41515
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
41209
|
-
rollup:
|
|
41210
|
-
omissions:
|
|
41211
|
-
});
|
|
41212
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
41213
|
-
rootId:
|
|
41214
|
-
nodes:
|
|
41215
|
-
|
|
41216
|
-
id:
|
|
41516
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
41517
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
41518
|
+
});
|
|
41519
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
41520
|
+
rootId: z16.string().min(1),
|
|
41521
|
+
nodes: z16.array(
|
|
41522
|
+
z16.object({
|
|
41523
|
+
id: z16.string().min(1),
|
|
41217
41524
|
type: taskTypeSchema,
|
|
41218
|
-
parentId:
|
|
41525
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
41219
41526
|
})
|
|
41220
41527
|
),
|
|
41221
|
-
edges:
|
|
41222
|
-
dryRun:
|
|
41223
|
-
});
|
|
41224
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
41225
|
-
code:
|
|
41226
|
-
message:
|
|
41227
|
-
taskId:
|
|
41228
|
-
severity:
|
|
41229
|
-
});
|
|
41230
|
-
var workGraphScaffoldValidateResultSchema =
|
|
41231
|
-
rootId:
|
|
41232
|
-
valid:
|
|
41233
|
-
dryRun:
|
|
41234
|
-
issues:
|
|
41235
|
-
hierarchy:
|
|
41236
|
-
valid:
|
|
41237
|
-
violations:
|
|
41238
|
-
|
|
41239
|
-
code:
|
|
41240
|
-
taskId:
|
|
41528
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
41529
|
+
dryRun: z16.boolean().optional()
|
|
41530
|
+
});
|
|
41531
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
41532
|
+
code: z16.string().min(1),
|
|
41533
|
+
message: z16.string().min(1),
|
|
41534
|
+
taskId: z16.string().min(1).optional(),
|
|
41535
|
+
severity: z16.enum(["error", "warning"])
|
|
41536
|
+
});
|
|
41537
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
41538
|
+
rootId: z16.string().min(1),
|
|
41539
|
+
valid: z16.boolean(),
|
|
41540
|
+
dryRun: z16.boolean(),
|
|
41541
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
41542
|
+
hierarchy: z16.object({
|
|
41543
|
+
valid: z16.boolean(),
|
|
41544
|
+
violations: z16.array(
|
|
41545
|
+
z16.object({
|
|
41546
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
41547
|
+
taskId: z16.string().min(1),
|
|
41241
41548
|
taskType: taskTypeSchema,
|
|
41242
|
-
parentId:
|
|
41549
|
+
parentId: z16.string().min(1).nullable(),
|
|
41243
41550
|
parentType: taskTypeSchema.optional(),
|
|
41244
|
-
message:
|
|
41551
|
+
message: z16.string().min(1)
|
|
41245
41552
|
})
|
|
41246
41553
|
)
|
|
41247
41554
|
})
|
|
41248
41555
|
});
|
|
41249
41556
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
41250
|
-
apply:
|
|
41557
|
+
apply: z16.boolean().optional()
|
|
41251
41558
|
});
|
|
41252
41559
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
41253
|
-
applied:
|
|
41254
|
-
nodesChanged:
|
|
41255
|
-
edgesChanged:
|
|
41256
|
-
});
|
|
41257
|
-
var workGraphPlanningDocParamsSchema =
|
|
41258
|
-
rootId:
|
|
41259
|
-
audience:
|
|
41260
|
-
tokenBudget:
|
|
41261
|
-
includeRelations:
|
|
41262
|
-
includeReadiness:
|
|
41263
|
-
includeRollup:
|
|
41264
|
-
});
|
|
41265
|
-
var workGraphPlanningDocSchema =
|
|
41266
|
-
rootId:
|
|
41267
|
-
generatedAt:
|
|
41268
|
-
audience:
|
|
41269
|
-
title:
|
|
41270
|
-
content:
|
|
41271
|
-
sections:
|
|
41272
|
-
estimatedTokens:
|
|
41273
|
-
budget:
|
|
41274
|
-
tokenBudget:
|
|
41275
|
-
truncated:
|
|
41560
|
+
applied: z16.boolean(),
|
|
41561
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
41562
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
41563
|
+
});
|
|
41564
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
41565
|
+
rootId: z16.string().min(1),
|
|
41566
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
41567
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
41568
|
+
includeRelations: z16.boolean().optional(),
|
|
41569
|
+
includeReadiness: z16.boolean().optional(),
|
|
41570
|
+
includeRollup: z16.boolean().optional()
|
|
41571
|
+
});
|
|
41572
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
41573
|
+
rootId: z16.string().min(1),
|
|
41574
|
+
generatedAt: z16.string().min(1),
|
|
41575
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
41576
|
+
title: z16.string().min(1),
|
|
41577
|
+
content: z16.string(),
|
|
41578
|
+
sections: z16.array(z16.string().min(1)),
|
|
41579
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
41580
|
+
budget: z16.object({
|
|
41581
|
+
tokenBudget: z16.number().int().positive(),
|
|
41582
|
+
truncated: z16.boolean()
|
|
41276
41583
|
}).optional()
|
|
41277
41584
|
});
|
|
41278
41585
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
41279
|
-
rootId:
|
|
41586
|
+
rootId: z16.string().min(1),
|
|
41280
41587
|
direction: workGraphTraversalDirectionSchema,
|
|
41281
|
-
maxDepth:
|
|
41282
|
-
includeRelations:
|
|
41588
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41589
|
+
includeRelations: z16.boolean().optional()
|
|
41283
41590
|
});
|
|
41284
|
-
var tasksTraverseResultSchema =
|
|
41285
|
-
rootId:
|
|
41591
|
+
var tasksTraverseResultSchema = z16.object({
|
|
41592
|
+
rootId: z16.string().min(1),
|
|
41286
41593
|
direction: workGraphTraversalDirectionSchema,
|
|
41287
|
-
nodes:
|
|
41288
|
-
edges:
|
|
41594
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
41595
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
41289
41596
|
pageInfo: workGraphPageInfoSchema
|
|
41290
41597
|
});
|
|
41291
41598
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
41292
|
-
rootId:
|
|
41293
|
-
maxDepth:
|
|
41599
|
+
rootId: z16.string().min(1),
|
|
41600
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
41294
41601
|
});
|
|
41295
|
-
var tasksTreeResultSchema =
|
|
41296
|
-
rootId:
|
|
41297
|
-
nodes:
|
|
41298
|
-
edges:
|
|
41602
|
+
var tasksTreeResultSchema = z16.object({
|
|
41603
|
+
rootId: z16.string().min(1),
|
|
41604
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
41605
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
41299
41606
|
pageInfo: workGraphPageInfoSchema
|
|
41300
41607
|
});
|
|
41301
|
-
var tasksRollupParamsSchema =
|
|
41302
|
-
rootId:
|
|
41608
|
+
var tasksRollupParamsSchema = z16.object({
|
|
41609
|
+
rootId: z16.string().min(1),
|
|
41303
41610
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
41304
41611
|
});
|
|
41305
|
-
var tasksRollupResultSchema =
|
|
41306
|
-
rootId:
|
|
41612
|
+
var tasksRollupResultSchema = z16.object({
|
|
41613
|
+
rootId: z16.string().min(1),
|
|
41307
41614
|
direct: workGraphRollupCountsSchema,
|
|
41308
41615
|
subtree: workGraphRollupCountsSchema,
|
|
41309
|
-
percentDenominator:
|
|
41310
|
-
basis:
|
|
41311
|
-
total:
|
|
41312
|
-
description:
|
|
41616
|
+
percentDenominator: z16.object({
|
|
41617
|
+
basis: z16.literal("subtree-total"),
|
|
41618
|
+
total: z16.number().int().nonnegative(),
|
|
41619
|
+
description: z16.string().min(1)
|
|
41313
41620
|
}),
|
|
41314
41621
|
percentages: workGraphSubtreePercentagesSchema,
|
|
41315
|
-
staleProjection:
|
|
41316
|
-
projectionMismatches:
|
|
41317
|
-
});
|
|
41318
|
-
var tasksFrontierParamsSchema =
|
|
41319
|
-
rootId:
|
|
41320
|
-
role:
|
|
41321
|
-
});
|
|
41322
|
-
var tasksFrontierResultSchema =
|
|
41323
|
-
rootId:
|
|
41324
|
-
role:
|
|
41325
|
-
groups:
|
|
41326
|
-
ready:
|
|
41327
|
-
blocked:
|
|
41328
|
-
blockedBy:
|
|
41329
|
-
|
|
41330
|
-
|
|
41331
|
-
kind:
|
|
41332
|
-
blockerId:
|
|
41333
|
-
blocks:
|
|
41622
|
+
staleProjection: z16.boolean(),
|
|
41623
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
41624
|
+
});
|
|
41625
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
41626
|
+
rootId: z16.string().min(1),
|
|
41627
|
+
role: z16.string().min(1).optional()
|
|
41628
|
+
});
|
|
41629
|
+
var tasksFrontierResultSchema = z16.object({
|
|
41630
|
+
rootId: z16.string().min(1),
|
|
41631
|
+
role: z16.string().min(1).optional(),
|
|
41632
|
+
groups: z16.object({
|
|
41633
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41634
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
41635
|
+
blockedBy: z16.array(
|
|
41636
|
+
z16.discriminatedUnion("kind", [
|
|
41637
|
+
z16.object({
|
|
41638
|
+
kind: z16.literal("dependency"),
|
|
41639
|
+
blockerId: z16.string().min(1),
|
|
41640
|
+
blocks: z16.array(z16.string().min(1))
|
|
41334
41641
|
}),
|
|
41335
|
-
|
|
41336
|
-
kind:
|
|
41642
|
+
z16.object({
|
|
41643
|
+
kind: z16.literal("gate"),
|
|
41337
41644
|
gate: verificationGateSchema,
|
|
41338
|
-
blocks:
|
|
41645
|
+
blocks: z16.array(z16.string().min(1))
|
|
41339
41646
|
})
|
|
41340
41647
|
])
|
|
41341
41648
|
)
|
|
41342
41649
|
})
|
|
41343
41650
|
});
|
|
41344
41651
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
41345
|
-
rootId:
|
|
41346
|
-
maxDepth:
|
|
41347
|
-
includeRelations:
|
|
41348
|
-
});
|
|
41349
|
-
var tasksWorkGraphAuditResultSchema =
|
|
41350
|
-
rootId:
|
|
41351
|
-
hierarchy:
|
|
41352
|
-
valid:
|
|
41353
|
-
violations:
|
|
41354
|
-
|
|
41355
|
-
code:
|
|
41356
|
-
taskId:
|
|
41652
|
+
rootId: z16.string().min(1),
|
|
41653
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
41654
|
+
includeRelations: z16.boolean().optional()
|
|
41655
|
+
});
|
|
41656
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
41657
|
+
rootId: z16.string().min(1),
|
|
41658
|
+
hierarchy: z16.object({
|
|
41659
|
+
valid: z16.boolean(),
|
|
41660
|
+
violations: z16.array(
|
|
41661
|
+
z16.object({
|
|
41662
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
41663
|
+
taskId: z16.string().min(1),
|
|
41357
41664
|
taskType: taskTypeSchema,
|
|
41358
|
-
parentId:
|
|
41665
|
+
parentId: z16.string().min(1).nullable(),
|
|
41359
41666
|
parentType: taskTypeSchema.optional(),
|
|
41360
|
-
message:
|
|
41667
|
+
message: z16.string().min(1)
|
|
41361
41668
|
})
|
|
41362
41669
|
)
|
|
41363
41670
|
}),
|
|
41364
41671
|
traversal: tasksTraverseResultSchema,
|
|
41365
41672
|
frontier: tasksFrontierResultSchema,
|
|
41366
41673
|
rollup: tasksRollupResultSchema,
|
|
41367
|
-
relationEdges:
|
|
41368
|
-
rootId:
|
|
41674
|
+
relationEdges: z16.object({
|
|
41675
|
+
rootId: z16.string().min(1),
|
|
41369
41676
|
direction: workGraphEdgeDirectionSchema,
|
|
41370
|
-
edges:
|
|
41371
|
-
|
|
41677
|
+
edges: z16.array(
|
|
41678
|
+
z16.discriminatedUnion("source", [
|
|
41372
41679
|
workGraphRelationEdgeSchema,
|
|
41373
41680
|
workGraphDependencyEdgeSchema
|
|
41374
41681
|
])
|
|
@@ -41377,60 +41684,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
41377
41684
|
});
|
|
41378
41685
|
|
|
41379
41686
|
// packages/contracts/src/operations/docs.ts
|
|
41380
|
-
import { z as
|
|
41381
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
41382
|
-
version:
|
|
41383
|
-
operation:
|
|
41384
|
-
identity:
|
|
41385
|
-
projectId:
|
|
41386
|
-
projectRoot:
|
|
41387
|
-
actor:
|
|
41388
|
-
operation:
|
|
41389
|
-
idempotencyKey:
|
|
41687
|
+
import { z as z17 } from "zod";
|
|
41688
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
41689
|
+
version: z17.literal(1),
|
|
41690
|
+
operation: z17.literal("docs.projection"),
|
|
41691
|
+
identity: z17.object({
|
|
41692
|
+
projectId: z17.string().min(1),
|
|
41693
|
+
projectRoot: z17.string().min(1),
|
|
41694
|
+
actor: z17.string().min(1),
|
|
41695
|
+
operation: z17.literal("docs.projection"),
|
|
41696
|
+
idempotencyKey: z17.string().min(1)
|
|
41390
41697
|
}).strict(),
|
|
41391
|
-
source:
|
|
41392
|
-
attachmentId:
|
|
41393
|
-
sha256:
|
|
41394
|
-
ownerId:
|
|
41395
|
-
ownerType:
|
|
41396
|
-
label:
|
|
41698
|
+
source: z17.object({
|
|
41699
|
+
attachmentId: z17.string().min(1),
|
|
41700
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
41701
|
+
ownerId: z17.string().min(1),
|
|
41702
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
41703
|
+
label: z17.string().min(1)
|
|
41397
41704
|
}).strict(),
|
|
41398
|
-
observation:
|
|
41399
|
-
kind:
|
|
41400
|
-
attachmentId:
|
|
41401
|
-
ownerId:
|
|
41402
|
-
addedAt:
|
|
41403
|
-
slug:
|
|
41404
|
-
type:
|
|
41705
|
+
observation: z17.object({
|
|
41706
|
+
kind: z17.literal("doc-attachment"),
|
|
41707
|
+
attachmentId: z17.string().min(1),
|
|
41708
|
+
ownerId: z17.string().min(1),
|
|
41709
|
+
addedAt: z17.string().min(1),
|
|
41710
|
+
slug: z17.string().optional(),
|
|
41711
|
+
type: z17.string().optional()
|
|
41405
41712
|
}).strict()
|
|
41406
41713
|
}).strict();
|
|
41407
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
41408
|
-
version:
|
|
41409
|
-
sourceHash:
|
|
41410
|
-
graph:
|
|
41714
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
41715
|
+
version: z17.literal(1),
|
|
41716
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
41717
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
41411
41718
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
41412
|
-
observationId:
|
|
41719
|
+
observationId: z17.string().min(1).optional(),
|
|
41413
41720
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
41414
|
-
documents:
|
|
41415
|
-
verifiedAt:
|
|
41416
|
-
actor:
|
|
41721
|
+
documents: z17.literal(true).optional(),
|
|
41722
|
+
verifiedAt: z17.string().min(1),
|
|
41723
|
+
actor: z17.string().min(1)
|
|
41417
41724
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
41418
41725
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
41419
41726
|
});
|
|
41420
41727
|
|
|
41421
41728
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
41422
|
-
import { z as
|
|
41423
|
-
var taskTreeEntrySchema =
|
|
41424
|
-
title:
|
|
41425
|
-
acceptance:
|
|
41729
|
+
import { z as z18 } from "zod";
|
|
41730
|
+
var taskTreeEntrySchema = z18.object({
|
|
41731
|
+
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" }),
|
|
41732
|
+
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), {
|
|
41426
41733
|
message: "acceptance array contains no non-empty strings"
|
|
41427
41734
|
}),
|
|
41428
|
-
id:
|
|
41429
|
-
parentId:
|
|
41430
|
-
depends:
|
|
41735
|
+
id: z18.string().optional(),
|
|
41736
|
+
parentId: z18.string().optional(),
|
|
41737
|
+
depends: z18.array(z18.string()).optional()
|
|
41431
41738
|
});
|
|
41432
|
-
var taskTreeSchema =
|
|
41433
|
-
var evidenceSchema =
|
|
41739
|
+
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" });
|
|
41740
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
41434
41741
|
if (value === null || value === void 0) {
|
|
41435
41742
|
ctx.addIssue({
|
|
41436
41743
|
code: "custom",
|
|
@@ -41464,7 +41771,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
41464
41771
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
41465
41772
|
});
|
|
41466
41773
|
});
|
|
41467
|
-
var passthroughSchema =
|
|
41774
|
+
var passthroughSchema = z18.unknown();
|
|
41468
41775
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
41469
41776
|
// release.cantbook
|
|
41470
41777
|
"version_bump_report",
|
|
@@ -41497,44 +41804,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
41497
41804
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
41498
41805
|
|
|
41499
41806
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
41500
|
-
import { z as
|
|
41501
|
-
var parsedPrEvidenceAtomSchema =
|
|
41502
|
-
kind:
|
|
41503
|
-
prNumber:
|
|
41504
|
-
});
|
|
41505
|
-
var prEvidenceStateModifierSchema =
|
|
41506
|
-
kind:
|
|
41507
|
-
value:
|
|
41508
|
-
});
|
|
41509
|
-
var ghPrViewSchema =
|
|
41510
|
-
state:
|
|
41511
|
-
mergedAt:
|
|
41512
|
-
headRefOid:
|
|
41513
|
-
mergeCommit:
|
|
41514
|
-
title:
|
|
41515
|
-
body:
|
|
41516
|
-
headRefName:
|
|
41517
|
-
files:
|
|
41518
|
-
changedFiles:
|
|
41519
|
-
mergeable:
|
|
41520
|
-
statusCheckRollup:
|
|
41521
|
-
|
|
41522
|
-
__typename:
|
|
41523
|
-
name:
|
|
41524
|
-
workflowName:
|
|
41525
|
-
conclusion:
|
|
41526
|
-
status:
|
|
41807
|
+
import { z as z19 } from "zod";
|
|
41808
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
41809
|
+
kind: z19.literal("pr"),
|
|
41810
|
+
prNumber: z19.number().int().positive()
|
|
41811
|
+
});
|
|
41812
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
41813
|
+
kind: z19.literal("state"),
|
|
41814
|
+
value: z19.literal("MERGED")
|
|
41815
|
+
});
|
|
41816
|
+
var ghPrViewSchema = z19.object({
|
|
41817
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
41818
|
+
mergedAt: z19.string().nullable(),
|
|
41819
|
+
headRefOid: z19.string().optional(),
|
|
41820
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
41821
|
+
title: z19.string().optional(),
|
|
41822
|
+
body: z19.string().optional(),
|
|
41823
|
+
headRefName: z19.string().optional(),
|
|
41824
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
41825
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
41826
|
+
mergeable: z19.string().optional(),
|
|
41827
|
+
statusCheckRollup: z19.array(
|
|
41828
|
+
z19.object({
|
|
41829
|
+
__typename: z19.string().optional(),
|
|
41830
|
+
name: z19.string().optional(),
|
|
41831
|
+
workflowName: z19.string().optional(),
|
|
41832
|
+
conclusion: z19.string().nullable().optional(),
|
|
41833
|
+
status: z19.string().optional(),
|
|
41527
41834
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
41528
|
-
startedAt:
|
|
41835
|
+
startedAt: z19.string().nullable().optional(),
|
|
41529
41836
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
41530
|
-
completedAt:
|
|
41837
|
+
completedAt: z19.string().nullable().optional()
|
|
41531
41838
|
}).passthrough()
|
|
41532
41839
|
).optional().default([])
|
|
41533
41840
|
}).passthrough();
|
|
41534
41841
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
41535
41842
|
|
|
41536
41843
|
// packages/contracts/src/release/plan.ts
|
|
41537
|
-
import { z as
|
|
41844
|
+
import { z as z20 } from "zod";
|
|
41538
41845
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
41539
41846
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
41540
41847
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -41578,20 +41885,20 @@ var RESOLVED_SOURCE = [
|
|
|
41578
41885
|
"language-default",
|
|
41579
41886
|
"legacy-alias"
|
|
41580
41887
|
];
|
|
41581
|
-
var ReleaseChannelSchema =
|
|
41582
|
-
var ReleaseSchemeSchema =
|
|
41583
|
-
var ReleaseKindSchema =
|
|
41584
|
-
var ReleaseStatusSchema =
|
|
41585
|
-
var GateStatusSchema =
|
|
41586
|
-
var GateNameSchema =
|
|
41587
|
-
var PlatformTupleSchema =
|
|
41588
|
-
var PublisherSchema =
|
|
41589
|
-
var TaskKindSchema =
|
|
41590
|
-
var ImpactSchema =
|
|
41591
|
-
var ResolvedSourceSchema =
|
|
41592
|
-
var Iso8601 =
|
|
41593
|
-
var NonEmptyString =
|
|
41594
|
-
var ReleasePlanTaskSchema =
|
|
41888
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
41889
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
41890
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
41891
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
41892
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
41893
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
41894
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
41895
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
41896
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
41897
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
41898
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
41899
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
41900
|
+
var NonEmptyString = z20.string().min(1);
|
|
41901
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
41595
41902
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
41596
41903
|
id: NonEmptyString,
|
|
41597
41904
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -41599,20 +41906,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
41599
41906
|
/** SemVer impact classification. */
|
|
41600
41907
|
impact: ImpactSchema,
|
|
41601
41908
|
/** Human-readable changelog line for this task. */
|
|
41602
|
-
userFacingSummary:
|
|
41909
|
+
userFacingSummary: z20.string(),
|
|
41603
41910
|
/**
|
|
41604
41911
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
41605
41912
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
41606
41913
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
41607
41914
|
* enforces non-empty via R-301.
|
|
41608
41915
|
*/
|
|
41609
|
-
evidenceAtoms:
|
|
41916
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
41610
41917
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
41611
|
-
ivtrPhaseAtPlan:
|
|
41918
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
41612
41919
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
41613
41920
|
epicAncestor: NonEmptyString
|
|
41614
41921
|
});
|
|
41615
|
-
var ReleaseGateSchema =
|
|
41922
|
+
var ReleaseGateSchema = z20.object({
|
|
41616
41923
|
/** Canonical gate name. */
|
|
41617
41924
|
name: GateNameSchema,
|
|
41618
41925
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -41622,11 +41929,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
41622
41929
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
41623
41930
|
lastVerifiedAt: Iso8601,
|
|
41624
41931
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
41625
|
-
resolvedCommand:
|
|
41932
|
+
resolvedCommand: z20.string().optional(),
|
|
41626
41933
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
41627
41934
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
41628
41935
|
});
|
|
41629
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
41936
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
41630
41937
|
/** Target platform tuple. */
|
|
41631
41938
|
platform: PlatformTupleSchema,
|
|
41632
41939
|
/** Distribution backend. */
|
|
@@ -41634,47 +41941,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
41634
41941
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
41635
41942
|
package: NonEmptyString,
|
|
41636
41943
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
41637
|
-
smoke:
|
|
41944
|
+
smoke: z20.boolean().default(true).optional()
|
|
41638
41945
|
});
|
|
41639
|
-
var ReleasePreflightSummarySchema =
|
|
41946
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
41640
41947
|
/** True if esbuild externals are out of sync with package.json. */
|
|
41641
|
-
esbuildExternalsDrift:
|
|
41948
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
41642
41949
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
41643
|
-
lockfileDrift:
|
|
41950
|
+
lockfileDrift: z20.boolean(),
|
|
41644
41951
|
/** True if all epic children are in terminal lifecycle states. */
|
|
41645
|
-
epicCompletenessClean:
|
|
41952
|
+
epicCompletenessClean: z20.boolean(),
|
|
41646
41953
|
/** True if no task appears in multiple in-flight release plans. */
|
|
41647
|
-
doubleListingClean:
|
|
41954
|
+
doubleListingClean: z20.boolean(),
|
|
41648
41955
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
41649
|
-
preflightWarnings:
|
|
41956
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
41650
41957
|
});
|
|
41651
|
-
var ReleasePlanChangelogSchema =
|
|
41958
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
41652
41959
|
/** `kind=feat` tasks. */
|
|
41653
|
-
features:
|
|
41960
|
+
features: z20.array(NonEmptyString).default([]),
|
|
41654
41961
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
41655
|
-
fixes:
|
|
41962
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
41656
41963
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
41657
|
-
chores:
|
|
41964
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
41658
41965
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
41659
|
-
breaking:
|
|
41966
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
41660
41967
|
});
|
|
41661
|
-
var ReleasePlanMetaSchema =
|
|
41968
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
41662
41969
|
/** True if this is the project's first ever release. */
|
|
41663
|
-
firstEverRelease:
|
|
41970
|
+
firstEverRelease: z20.boolean().optional(),
|
|
41664
41971
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
41665
|
-
unresolvedTools:
|
|
41972
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
41666
41973
|
/** Project archetype detected at plan time. */
|
|
41667
|
-
archetype:
|
|
41668
|
-
}).catchall(
|
|
41669
|
-
var ReleasePlanSchema =
|
|
41974
|
+
archetype: z20.string().optional()
|
|
41975
|
+
}).catchall(z20.unknown());
|
|
41976
|
+
var ReleasePlanSchema = z20.object({
|
|
41670
41977
|
/** Schema URL for this plan version. */
|
|
41671
|
-
$schema:
|
|
41978
|
+
$schema: z20.string().optional(),
|
|
41672
41979
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
41673
41980
|
version: NonEmptyString,
|
|
41674
41981
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
41675
41982
|
resolvedVersion: NonEmptyString,
|
|
41676
41983
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
41677
|
-
suffixApplied:
|
|
41984
|
+
suffixApplied: z20.boolean(),
|
|
41678
41985
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
41679
41986
|
scheme: ReleaseSchemeSchema,
|
|
41680
41987
|
/** npm dist-tag channel for this release. */
|
|
@@ -41688,7 +41995,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
41688
41995
|
/** Release-kind classification. */
|
|
41689
41996
|
releaseKind: ReleaseKindSchema,
|
|
41690
41997
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
41691
|
-
hooksV1Promotion:
|
|
41998
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
41692
41999
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
41693
42000
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
41694
42001
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -41699,27 +42006,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
41699
42006
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
41700
42007
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
41701
42008
|
*/
|
|
41702
|
-
previousVersion:
|
|
42009
|
+
previousVersion: z20.string().nullable(),
|
|
41703
42010
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
41704
|
-
previousTag:
|
|
42011
|
+
previousTag: z20.string().nullable(),
|
|
41705
42012
|
/** ISO-8601 timestamp the previous release was published. */
|
|
41706
42013
|
previousShippedAt: Iso8601.nullable(),
|
|
41707
42014
|
/** Tasks rolled into this release. */
|
|
41708
|
-
tasks:
|
|
42015
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
41709
42016
|
/** Bucketed changelog. */
|
|
41710
42017
|
changelog: ReleasePlanChangelogSchema,
|
|
41711
42018
|
/** Per-gate verification status. */
|
|
41712
|
-
gates:
|
|
42019
|
+
gates: z20.array(ReleaseGateSchema),
|
|
41713
42020
|
/** Platform / publisher matrix. */
|
|
41714
|
-
platformMatrix:
|
|
42021
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
41715
42022
|
/** Preflight summary from `cleo release plan`. */
|
|
41716
42023
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
41717
42024
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
41718
|
-
workflowRunUrl:
|
|
42025
|
+
workflowRunUrl: z20.string().nullable(),
|
|
41719
42026
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
41720
|
-
prUrl:
|
|
42027
|
+
prUrl: z20.string().nullable(),
|
|
41721
42028
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
41722
|
-
mergeCommitSha:
|
|
42029
|
+
mergeCommitSha: z20.string().nullable(),
|
|
41723
42030
|
/** Current FSM state per R-302. */
|
|
41724
42031
|
status: ReleaseStatusSchema,
|
|
41725
42032
|
/** Informational / forward-compat metadata. */
|
|
@@ -41749,48 +42056,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
41749
42056
|
]);
|
|
41750
42057
|
|
|
41751
42058
|
// packages/contracts/src/session-journal.ts
|
|
41752
|
-
import { z as
|
|
42059
|
+
import { z as z21 } from "zod";
|
|
41753
42060
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
41754
|
-
var sessionJournalDoctorSummarySchema =
|
|
42061
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
41755
42062
|
/** `true` when zero noise patterns were detected. */
|
|
41756
|
-
isClean:
|
|
42063
|
+
isClean: z21.boolean(),
|
|
41757
42064
|
/** Total number of noise findings across all patterns. */
|
|
41758
|
-
findingsCount:
|
|
42065
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
41759
42066
|
/** Pattern names that were detected (empty when isClean). */
|
|
41760
|
-
patterns:
|
|
42067
|
+
patterns: z21.array(z21.string()),
|
|
41761
42068
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
41762
|
-
totalScanned:
|
|
42069
|
+
totalScanned: z21.number().int().nonnegative()
|
|
41763
42070
|
});
|
|
41764
|
-
var sessionJournalDebriefSummarySchema =
|
|
42071
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
41765
42072
|
/** First 200 characters of the session end note (if provided). */
|
|
41766
|
-
noteExcerpt:
|
|
42073
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
41767
42074
|
/** Number of tasks completed during the session. */
|
|
41768
|
-
tasksCompletedCount:
|
|
42075
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
41769
42076
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
41770
|
-
tasksFocused:
|
|
42077
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
41771
42078
|
});
|
|
41772
|
-
var sessionJournalEntrySchema =
|
|
42079
|
+
var sessionJournalEntrySchema = z21.object({
|
|
41773
42080
|
// Identity
|
|
41774
42081
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
41775
|
-
schemaVersion:
|
|
42082
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
41776
42083
|
/** ISO 8601 timestamp when the entry was written. */
|
|
41777
|
-
timestamp:
|
|
42084
|
+
timestamp: z21.string(),
|
|
41778
42085
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
41779
|
-
sessionId:
|
|
42086
|
+
sessionId: z21.string(),
|
|
41780
42087
|
/** Event type that triggered this journal entry. */
|
|
41781
|
-
eventType:
|
|
42088
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
41782
42089
|
// Session metadata (set on session_start / session_end)
|
|
41783
42090
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
41784
|
-
agentIdentifier:
|
|
42091
|
+
agentIdentifier: z21.string().optional(),
|
|
41785
42092
|
/** Provider adapter ID active for this session. */
|
|
41786
|
-
providerId:
|
|
42093
|
+
providerId: z21.string().optional(),
|
|
41787
42094
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
41788
|
-
scope:
|
|
42095
|
+
scope: z21.string().optional(),
|
|
41789
42096
|
// Session-end fields
|
|
41790
42097
|
/** Duration of the session in seconds (session_end only). */
|
|
41791
|
-
duration:
|
|
42098
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
41792
42099
|
/** Task IDs (not titles) completed during the session. */
|
|
41793
|
-
tasksCompleted:
|
|
42100
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
41794
42101
|
// Doctor summary (T1262 absorbed)
|
|
41795
42102
|
/**
|
|
41796
42103
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -41805,52 +42112,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
41805
42112
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
41806
42113
|
// Optional hash chain
|
|
41807
42114
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
41808
|
-
prevEntryHash:
|
|
42115
|
+
prevEntryHash: z21.string().optional()
|
|
41809
42116
|
});
|
|
41810
42117
|
|
|
41811
42118
|
// packages/contracts/src/task-evidence.ts
|
|
41812
|
-
import { z as
|
|
41813
|
-
var fileEvidenceSchema =
|
|
41814
|
-
kind:
|
|
41815
|
-
sha256:
|
|
41816
|
-
timestamp:
|
|
41817
|
-
path:
|
|
41818
|
-
mime:
|
|
41819
|
-
description:
|
|
41820
|
-
});
|
|
41821
|
-
var logEvidenceSchema =
|
|
41822
|
-
kind:
|
|
41823
|
-
sha256:
|
|
41824
|
-
timestamp:
|
|
41825
|
-
source:
|
|
41826
|
-
description:
|
|
41827
|
-
});
|
|
41828
|
-
var screenshotEvidenceSchema =
|
|
41829
|
-
kind:
|
|
41830
|
-
sha256:
|
|
41831
|
-
timestamp:
|
|
41832
|
-
mime:
|
|
41833
|
-
description:
|
|
41834
|
-
});
|
|
41835
|
-
var testOutputEvidenceSchema =
|
|
41836
|
-
kind:
|
|
41837
|
-
sha256:
|
|
41838
|
-
timestamp:
|
|
41839
|
-
passed:
|
|
41840
|
-
failed:
|
|
41841
|
-
skipped:
|
|
41842
|
-
exitCode:
|
|
41843
|
-
description:
|
|
41844
|
-
});
|
|
41845
|
-
var commandOutputEvidenceSchema =
|
|
41846
|
-
kind:
|
|
41847
|
-
sha256:
|
|
41848
|
-
timestamp:
|
|
41849
|
-
cmd:
|
|
41850
|
-
exitCode:
|
|
41851
|
-
description:
|
|
41852
|
-
});
|
|
41853
|
-
var taskEvidenceSchema =
|
|
42119
|
+
import { z as z22 } from "zod";
|
|
42120
|
+
var fileEvidenceSchema = z22.object({
|
|
42121
|
+
kind: z22.literal("file"),
|
|
42122
|
+
sha256: z22.string().length(64),
|
|
42123
|
+
timestamp: z22.string().datetime(),
|
|
42124
|
+
path: z22.string().min(1),
|
|
42125
|
+
mime: z22.string().optional(),
|
|
42126
|
+
description: z22.string().optional()
|
|
42127
|
+
});
|
|
42128
|
+
var logEvidenceSchema = z22.object({
|
|
42129
|
+
kind: z22.literal("log"),
|
|
42130
|
+
sha256: z22.string().length(64),
|
|
42131
|
+
timestamp: z22.string().datetime(),
|
|
42132
|
+
source: z22.string().min(1),
|
|
42133
|
+
description: z22.string().optional()
|
|
42134
|
+
});
|
|
42135
|
+
var screenshotEvidenceSchema = z22.object({
|
|
42136
|
+
kind: z22.literal("screenshot"),
|
|
42137
|
+
sha256: z22.string().length(64),
|
|
42138
|
+
timestamp: z22.string().datetime(),
|
|
42139
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
42140
|
+
description: z22.string().optional()
|
|
42141
|
+
});
|
|
42142
|
+
var testOutputEvidenceSchema = z22.object({
|
|
42143
|
+
kind: z22.literal("test-output"),
|
|
42144
|
+
sha256: z22.string().length(64),
|
|
42145
|
+
timestamp: z22.string().datetime(),
|
|
42146
|
+
passed: z22.number().int().nonnegative(),
|
|
42147
|
+
failed: z22.number().int().nonnegative(),
|
|
42148
|
+
skipped: z22.number().int().nonnegative(),
|
|
42149
|
+
exitCode: z22.number().int(),
|
|
42150
|
+
description: z22.string().optional()
|
|
42151
|
+
});
|
|
42152
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
42153
|
+
kind: z22.literal("command-output"),
|
|
42154
|
+
sha256: z22.string().length(64),
|
|
42155
|
+
timestamp: z22.string().datetime(),
|
|
42156
|
+
cmd: z22.string().min(1),
|
|
42157
|
+
exitCode: z22.number().int(),
|
|
42158
|
+
description: z22.string().optional()
|
|
42159
|
+
});
|
|
42160
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
41854
42161
|
fileEvidenceSchema,
|
|
41855
42162
|
logEvidenceSchema,
|
|
41856
42163
|
screenshotEvidenceSchema,
|
|
@@ -41859,8 +42166,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
41859
42166
|
]);
|
|
41860
42167
|
|
|
41861
42168
|
// packages/contracts/src/tasks/archive.ts
|
|
41862
|
-
import { z as
|
|
41863
|
-
var ArchiveReason =
|
|
42169
|
+
import { z as z23 } from "zod";
|
|
42170
|
+
var ArchiveReason = z23.enum([
|
|
41864
42171
|
"verified",
|
|
41865
42172
|
"reconciled",
|
|
41866
42173
|
"superseded",
|
|
@@ -41871,42 +42178,42 @@ var ArchiveReason = z22.enum([
|
|
|
41871
42178
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
41872
42179
|
|
|
41873
42180
|
// packages/contracts/src/tasks/index.ts
|
|
41874
|
-
import { z as
|
|
41875
|
-
var taskMutationWarningSeveritySchema =
|
|
41876
|
-
var taskMutationWarningSchema =
|
|
41877
|
-
code:
|
|
41878
|
-
message:
|
|
42181
|
+
import { z as z24 } from "zod";
|
|
42182
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
42183
|
+
var taskMutationWarningSchema = z24.object({
|
|
42184
|
+
code: z24.string().min(1),
|
|
42185
|
+
message: z24.string().min(1),
|
|
41879
42186
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
41880
|
-
taskId:
|
|
41881
|
-
field:
|
|
41882
|
-
index:
|
|
41883
|
-
});
|
|
41884
|
-
var taskMutationDryRunSummarySchema =
|
|
41885
|
-
dryRun:
|
|
41886
|
-
wouldCreate:
|
|
41887
|
-
wouldUpdate:
|
|
41888
|
-
wouldDelete:
|
|
41889
|
-
wouldAffect:
|
|
41890
|
-
validatedCount:
|
|
41891
|
-
insertedCount:
|
|
41892
|
-
updatedCount:
|
|
41893
|
-
deletedCount:
|
|
41894
|
-
warnings:
|
|
41895
|
-
});
|
|
41896
|
-
var taskMutationTaskRecordSchema =
|
|
41897
|
-
var taskMutationEnvelopeSchema =
|
|
41898
|
-
dryRun:
|
|
41899
|
-
created:
|
|
41900
|
-
updated:
|
|
41901
|
-
deleted:
|
|
41902
|
-
affectedCount:
|
|
41903
|
-
mutationWarnings:
|
|
42187
|
+
taskId: z24.string().min(1).optional(),
|
|
42188
|
+
field: z24.string().min(1).optional(),
|
|
42189
|
+
index: z24.number().int().nonnegative().optional()
|
|
42190
|
+
});
|
|
42191
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
42192
|
+
dryRun: z24.literal(true),
|
|
42193
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
42194
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
42195
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
42196
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
42197
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
42198
|
+
insertedCount: z24.literal(0),
|
|
42199
|
+
updatedCount: z24.literal(0),
|
|
42200
|
+
deletedCount: z24.literal(0),
|
|
42201
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
42202
|
+
});
|
|
42203
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
42204
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
42205
|
+
dryRun: z24.boolean().optional(),
|
|
42206
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
42207
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
42208
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
42209
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
42210
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
41904
42211
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
41905
42212
|
});
|
|
41906
|
-
var completionTaskStatusSchema =
|
|
41907
|
-
var completionCriterionKindSchema =
|
|
41908
|
-
var completionCriterionStatusSchema =
|
|
41909
|
-
var completionBlockerReasonSchema =
|
|
42213
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
42214
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
42215
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
42216
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
41910
42217
|
"missing_evidence_binding",
|
|
41911
42218
|
"child_not_done",
|
|
41912
42219
|
"child_cancelled_requires_waiver",
|
|
@@ -41914,68 +42221,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
41914
42221
|
"child_missing",
|
|
41915
42222
|
"done_parent_stale"
|
|
41916
42223
|
]);
|
|
41917
|
-
var completionStaleReasonSchema =
|
|
41918
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
42224
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
42225
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
41919
42226
|
"projection_not_stale",
|
|
41920
42227
|
"criteria_missing",
|
|
41921
42228
|
"binding_target_missing",
|
|
41922
42229
|
"repair_conflict"
|
|
41923
42230
|
]);
|
|
41924
|
-
var completionCriterionWaiverSchema =
|
|
41925
|
-
criterionAcId:
|
|
41926
|
-
childTaskId:
|
|
41927
|
-
reason:
|
|
41928
|
-
actor:
|
|
41929
|
-
waivedAt:
|
|
41930
|
-
});
|
|
41931
|
-
var completionCriterionReplacementSchema =
|
|
41932
|
-
criterionAcId:
|
|
41933
|
-
originalChildTaskId:
|
|
41934
|
-
replacementChildTaskId:
|
|
41935
|
-
reason:
|
|
41936
|
-
actor:
|
|
41937
|
-
replacedAt:
|
|
41938
|
-
});
|
|
41939
|
-
var completionCriterionEvaluationSchema =
|
|
41940
|
-
acId:
|
|
41941
|
-
alias:
|
|
41942
|
-
text:
|
|
42231
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
42232
|
+
criterionAcId: z24.string().min(1),
|
|
42233
|
+
childTaskId: z24.string().min(1),
|
|
42234
|
+
reason: z24.string().min(1),
|
|
42235
|
+
actor: z24.string().min(1),
|
|
42236
|
+
waivedAt: z24.string().min(1)
|
|
42237
|
+
});
|
|
42238
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
42239
|
+
criterionAcId: z24.string().min(1),
|
|
42240
|
+
originalChildTaskId: z24.string().min(1),
|
|
42241
|
+
replacementChildTaskId: z24.string().min(1),
|
|
42242
|
+
reason: z24.string().min(1),
|
|
42243
|
+
actor: z24.string().min(1),
|
|
42244
|
+
replacedAt: z24.string().min(1)
|
|
42245
|
+
});
|
|
42246
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
42247
|
+
acId: z24.string().min(1),
|
|
42248
|
+
alias: z24.string().min(1),
|
|
42249
|
+
text: z24.string(),
|
|
41943
42250
|
kind: completionCriterionKindSchema,
|
|
41944
42251
|
status: completionCriterionStatusSchema,
|
|
41945
42252
|
reason: completionBlockerReasonSchema.optional(),
|
|
41946
|
-
targetTaskId:
|
|
42253
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
41947
42254
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
41948
42255
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
41949
42256
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
41950
42257
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
41951
|
-
evidenceBindings:
|
|
42258
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
41952
42259
|
});
|
|
41953
42260
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
41954
|
-
status:
|
|
42261
|
+
status: z24.literal("unsatisfied"),
|
|
41955
42262
|
reason: completionBlockerReasonSchema
|
|
41956
42263
|
});
|
|
41957
|
-
var completionTotalsSchema =
|
|
41958
|
-
criteria:
|
|
41959
|
-
satisfied:
|
|
41960
|
-
unsatisfied:
|
|
41961
|
-
waived:
|
|
41962
|
-
replaced:
|
|
41963
|
-
});
|
|
41964
|
-
var completionContextPackSchema =
|
|
41965
|
-
taskId:
|
|
41966
|
-
generatedAt:
|
|
41967
|
-
source:
|
|
41968
|
-
window:
|
|
41969
|
-
limit:
|
|
41970
|
-
since:
|
|
41971
|
-
relationDepth:
|
|
41972
|
-
relatedTaskIds:
|
|
42264
|
+
var completionTotalsSchema = z24.object({
|
|
42265
|
+
criteria: z24.number().int().nonnegative(),
|
|
42266
|
+
satisfied: z24.number().int().nonnegative(),
|
|
42267
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
42268
|
+
waived: z24.number().int().nonnegative(),
|
|
42269
|
+
replaced: z24.number().int().nonnegative()
|
|
42270
|
+
});
|
|
42271
|
+
var completionContextPackSchema = z24.object({
|
|
42272
|
+
taskId: z24.string().min(1),
|
|
42273
|
+
generatedAt: z24.string().min(1),
|
|
42274
|
+
source: z24.literal("audit_log"),
|
|
42275
|
+
window: z24.object({
|
|
42276
|
+
limit: z24.number().int().positive(),
|
|
42277
|
+
since: z24.string().min(1).optional(),
|
|
42278
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
42279
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
41973
42280
|
}),
|
|
41974
|
-
events:
|
|
41975
|
-
|
|
41976
|
-
id:
|
|
41977
|
-
timestamp:
|
|
41978
|
-
action:
|
|
42281
|
+
events: z24.array(
|
|
42282
|
+
z24.object({
|
|
42283
|
+
id: z24.string().min(1),
|
|
42284
|
+
timestamp: z24.string().min(1),
|
|
42285
|
+
action: z24.enum([
|
|
41979
42286
|
"task_completed",
|
|
41980
42287
|
"task_reopened",
|
|
41981
42288
|
"task_cancelled",
|
|
@@ -41983,77 +42290,77 @@ var completionContextPackSchema = z23.object({
|
|
|
41983
42290
|
"task_reparented",
|
|
41984
42291
|
"ac_projection_rebuilt"
|
|
41985
42292
|
]),
|
|
41986
|
-
taskId:
|
|
41987
|
-
relation:
|
|
41988
|
-
actor:
|
|
41989
|
-
details:
|
|
41990
|
-
before:
|
|
41991
|
-
after:
|
|
42293
|
+
taskId: z24.string().min(1),
|
|
42294
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
42295
|
+
actor: z24.string().min(1),
|
|
42296
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
42297
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
42298
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
41992
42299
|
})
|
|
41993
42300
|
),
|
|
41994
|
-
summary:
|
|
41995
|
-
totalEvents:
|
|
41996
|
-
byAction:
|
|
41997
|
-
byRelation:
|
|
41998
|
-
latestEventAt:
|
|
42301
|
+
summary: z24.object({
|
|
42302
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
42303
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
42304
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
42305
|
+
latestEventAt: z24.string().nullable()
|
|
41999
42306
|
})
|
|
42000
42307
|
});
|
|
42001
|
-
var completionEvaluationSchema =
|
|
42002
|
-
taskId:
|
|
42308
|
+
var completionEvaluationSchema = z24.object({
|
|
42309
|
+
taskId: z24.string().min(1),
|
|
42003
42310
|
taskStatus: completionTaskStatusSchema,
|
|
42004
|
-
ready:
|
|
42005
|
-
stale:
|
|
42006
|
-
staleReasons:
|
|
42311
|
+
ready: z24.boolean(),
|
|
42312
|
+
stale: z24.boolean(),
|
|
42313
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
42007
42314
|
contextPack: completionContextPackSchema.optional(),
|
|
42008
|
-
satisfied:
|
|
42009
|
-
unsatisfied:
|
|
42010
|
-
waived:
|
|
42011
|
-
replaced:
|
|
42315
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
42316
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
42317
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
42318
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
42012
42319
|
totals: completionTotalsSchema
|
|
42013
42320
|
});
|
|
42014
|
-
var completionExplanationSchema =
|
|
42015
|
-
taskId:
|
|
42016
|
-
ready:
|
|
42017
|
-
stale:
|
|
42018
|
-
summary:
|
|
42321
|
+
var completionExplanationSchema = z24.object({
|
|
42322
|
+
taskId: z24.string().min(1),
|
|
42323
|
+
ready: z24.boolean(),
|
|
42324
|
+
stale: z24.boolean(),
|
|
42325
|
+
summary: z24.string(),
|
|
42019
42326
|
contextPack: completionContextPackSchema.optional(),
|
|
42020
|
-
blockers:
|
|
42327
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
42021
42328
|
});
|
|
42022
|
-
var completionListParamsSchema =
|
|
42023
|
-
taskId:
|
|
42329
|
+
var completionListParamsSchema = z24.object({
|
|
42330
|
+
taskId: z24.string().min(1),
|
|
42024
42331
|
status: completionCriterionStatusSchema.optional(),
|
|
42025
42332
|
kind: completionCriterionKindSchema.optional()
|
|
42026
42333
|
});
|
|
42027
|
-
var completionListResultSchema =
|
|
42028
|
-
taskId:
|
|
42029
|
-
criteria:
|
|
42334
|
+
var completionListResultSchema = z24.object({
|
|
42335
|
+
taskId: z24.string().min(1),
|
|
42336
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
42030
42337
|
totals: completionTotalsSchema
|
|
42031
42338
|
});
|
|
42032
|
-
var completionEvaluateParamsSchema =
|
|
42033
|
-
taskId:
|
|
42034
|
-
includeContext:
|
|
42035
|
-
limit:
|
|
42036
|
-
since:
|
|
42037
|
-
relationDepth:
|
|
42339
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
42340
|
+
taskId: z24.string().min(1),
|
|
42341
|
+
includeContext: z24.boolean().optional(),
|
|
42342
|
+
limit: z24.number().int().positive().optional(),
|
|
42343
|
+
since: z24.string().min(1).optional(),
|
|
42344
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
42038
42345
|
});
|
|
42039
|
-
var completionProjectionRepairErrorSchema =
|
|
42346
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
42040
42347
|
code: completionProjectionRepairErrorCodeSchema,
|
|
42041
|
-
message:
|
|
42042
|
-
taskId:
|
|
42043
|
-
acId:
|
|
42044
|
-
evidenceAtomId:
|
|
42045
|
-
});
|
|
42046
|
-
var completionProjectionRepairParamsSchema =
|
|
42047
|
-
taskId:
|
|
42048
|
-
dryRun:
|
|
42049
|
-
});
|
|
42050
|
-
var completionProjectionRepairResultSchema =
|
|
42051
|
-
taskId:
|
|
42052
|
-
repaired:
|
|
42053
|
-
dryRun:
|
|
42054
|
-
staleBefore:
|
|
42055
|
-
staleAfter:
|
|
42056
|
-
errors:
|
|
42348
|
+
message: z24.string().min(1),
|
|
42349
|
+
taskId: z24.string().min(1),
|
|
42350
|
+
acId: z24.string().min(1).optional(),
|
|
42351
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
42352
|
+
});
|
|
42353
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
42354
|
+
taskId: z24.string().min(1),
|
|
42355
|
+
dryRun: z24.boolean().optional()
|
|
42356
|
+
});
|
|
42357
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
42358
|
+
taskId: z24.string().min(1),
|
|
42359
|
+
repaired: z24.boolean(),
|
|
42360
|
+
dryRun: z24.boolean(),
|
|
42361
|
+
staleBefore: z24.boolean(),
|
|
42362
|
+
staleAfter: z24.boolean(),
|
|
42363
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
42057
42364
|
});
|
|
42058
42365
|
|
|
42059
42366
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -42556,7 +42863,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
42556
42863
|
};
|
|
42557
42864
|
|
|
42558
42865
|
// packages/contracts/src/templates/manifest.ts
|
|
42559
|
-
import { z as
|
|
42866
|
+
import { z as z25 } from "zod";
|
|
42560
42867
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
42561
42868
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
42562
42869
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -42573,79 +42880,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
42573
42880
|
"tool-resolver",
|
|
42574
42881
|
"literal"
|
|
42575
42882
|
];
|
|
42576
|
-
var PlaceholderSpecSchema =
|
|
42883
|
+
var PlaceholderSpecSchema = z25.object({
|
|
42577
42884
|
/**
|
|
42578
42885
|
* Placeholder identifier as it appears in the template body
|
|
42579
42886
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
42580
42887
|
*/
|
|
42581
|
-
name:
|
|
42888
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
42582
42889
|
/** Resolver source the installer consults for this placeholder. */
|
|
42583
|
-
source:
|
|
42890
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
42584
42891
|
/**
|
|
42585
42892
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
42586
42893
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
42587
42894
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
42588
42895
|
*/
|
|
42589
|
-
sourcePath:
|
|
42896
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
42590
42897
|
/**
|
|
42591
42898
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
42592
42899
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
42593
42900
|
*/
|
|
42594
|
-
defaultValue:
|
|
42901
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
42595
42902
|
});
|
|
42596
|
-
var TemplateManifestEntrySchema =
|
|
42903
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
42597
42904
|
/** Stable identifier for this template entry. */
|
|
42598
|
-
id:
|
|
42905
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
42599
42906
|
/** Category of file this template represents. */
|
|
42600
|
-
kind:
|
|
42907
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
42601
42908
|
/** Repo-relative path of the template source file. */
|
|
42602
|
-
sourcePath:
|
|
42909
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
42603
42910
|
/** Project-relative path where the rendered template installs. */
|
|
42604
|
-
installPath:
|
|
42911
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
42605
42912
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
42606
|
-
substitution:
|
|
42913
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
42607
42914
|
/** Declared placeholders this template requires. May be empty. */
|
|
42608
|
-
placeholders:
|
|
42915
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
42609
42916
|
/** Reconciliation policy on upgrade. */
|
|
42610
|
-
updateStrategy:
|
|
42917
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
42611
42918
|
});
|
|
42612
42919
|
|
|
42613
42920
|
// packages/contracts/src/validator/index.ts
|
|
42614
|
-
import { z as
|
|
42921
|
+
import { z as z26 } from "zod";
|
|
42615
42922
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
42616
|
-
var validatorFindingSchema =
|
|
42617
|
-
acId:
|
|
42618
|
-
status:
|
|
42619
|
-
reasoning:
|
|
42620
|
-
evidenceRefs:
|
|
42621
|
-
checkedAt:
|
|
42622
|
-
});
|
|
42623
|
-
var validatorAttestationSchema =
|
|
42624
|
-
verdict:
|
|
42625
|
-
taskId:
|
|
42626
|
-
validatorId:
|
|
42627
|
-
findings:
|
|
42923
|
+
var validatorFindingSchema = z26.object({
|
|
42924
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
42925
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
42926
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
42927
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
42928
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
42929
|
+
});
|
|
42930
|
+
var validatorAttestationSchema = z26.object({
|
|
42931
|
+
verdict: z26.literal("attest"),
|
|
42932
|
+
taskId: z26.string().min(1),
|
|
42933
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
42934
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
42628
42935
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
42629
42936
|
'attestation requires every finding to have status="pass"'
|
|
42630
42937
|
),
|
|
42631
|
-
summary:
|
|
42632
|
-
attestedAt:
|
|
42633
|
-
schemaVersion:
|
|
42634
|
-
});
|
|
42635
|
-
var validatorRejectionSchema =
|
|
42636
|
-
verdict:
|
|
42637
|
-
taskId:
|
|
42638
|
-
validatorId:
|
|
42639
|
-
findings:
|
|
42938
|
+
summary: z26.string().optional(),
|
|
42939
|
+
attestedAt: z26.string().min(1),
|
|
42940
|
+
schemaVersion: z26.literal("1")
|
|
42941
|
+
});
|
|
42942
|
+
var validatorRejectionSchema = z26.object({
|
|
42943
|
+
verdict: z26.literal("reject"),
|
|
42944
|
+
taskId: z26.string().min(1),
|
|
42945
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
42946
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
42640
42947
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
42641
42948
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
42642
42949
|
),
|
|
42643
|
-
summary:
|
|
42644
|
-
remediationHints:
|
|
42645
|
-
rejectedAt:
|
|
42646
|
-
schemaVersion:
|
|
42950
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
42951
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
42952
|
+
rejectedAt: z26.string().min(1),
|
|
42953
|
+
schemaVersion: z26.literal("1")
|
|
42647
42954
|
});
|
|
42648
|
-
var validatorVerdictSchema =
|
|
42955
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
42649
42956
|
validatorAttestationSchema,
|
|
42650
42957
|
validatorRejectionSchema
|
|
42651
42958
|
]);
|
|
@@ -43395,7 +43702,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
43395
43702
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
43396
43703
|
|
|
43397
43704
|
// packages/contracts/src/decide.ts
|
|
43398
|
-
import { z as
|
|
43705
|
+
import { z as z27 } from "zod";
|
|
43399
43706
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
43400
43707
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
43401
43708
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -43417,11 +43724,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
43417
43724
|
maxScoreLevels: 10
|
|
43418
43725
|
};
|
|
43419
43726
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
43420
|
-
var decisionQuestionTypeSchema =
|
|
43421
|
-
var decisionOutcomeSourceSchema =
|
|
43422
|
-
var decisionInstructionsSchema =
|
|
43423
|
-
var unitIntervalSchema =
|
|
43424
|
-
var decisionStateSchema =
|
|
43727
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
43728
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
43729
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
43730
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
43731
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
43425
43732
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
43426
43733
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
43427
43734
|
context.addIssue({
|
|
@@ -43430,34 +43737,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
43430
43737
|
});
|
|
43431
43738
|
}
|
|
43432
43739
|
});
|
|
43433
|
-
var noulDecisionQuestionSchema =
|
|
43434
|
-
type:
|
|
43740
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
43741
|
+
type: z27.literal("noul"),
|
|
43435
43742
|
instructions: decisionInstructionsSchema.optional(),
|
|
43436
|
-
criteria:
|
|
43743
|
+
criteria: z27.string().min(1)
|
|
43437
43744
|
});
|
|
43438
|
-
var choiceDecisionQuestionSchema =
|
|
43439
|
-
type:
|
|
43745
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
43746
|
+
type: z27.literal("choice"),
|
|
43440
43747
|
instructions: decisionInstructionsSchema.optional(),
|
|
43441
|
-
criteria:
|
|
43748
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
43442
43749
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
43443
43750
|
})
|
|
43444
43751
|
});
|
|
43445
|
-
var scoreDecisionQuestionSchema =
|
|
43446
|
-
type:
|
|
43752
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
43753
|
+
type: z27.literal("score"),
|
|
43447
43754
|
instructions: decisionInstructionsSchema.optional(),
|
|
43448
|
-
criteria:
|
|
43755
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
43449
43756
|
});
|
|
43450
|
-
var decisionQuestionSchema =
|
|
43757
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
43451
43758
|
noulDecisionQuestionSchema,
|
|
43452
43759
|
choiceDecisionQuestionSchema,
|
|
43453
43760
|
scoreDecisionQuestionSchema
|
|
43454
43761
|
]);
|
|
43455
|
-
var decisionRequestSchema =
|
|
43456
|
-
model:
|
|
43457
|
-
lang:
|
|
43458
|
-
cache:
|
|
43762
|
+
var decisionRequestSchema = z27.object({
|
|
43763
|
+
model: z27.string().min(1).optional(),
|
|
43764
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
43765
|
+
cache: z27.boolean().optional(),
|
|
43459
43766
|
state: decisionStateSchema,
|
|
43460
|
-
questions:
|
|
43767
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
43461
43768
|
(questions) => {
|
|
43462
43769
|
const count = Object.keys(questions).length;
|
|
43463
43770
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -43467,139 +43774,139 @@ var decisionRequestSchema = z26.object({
|
|
|
43467
43774
|
}
|
|
43468
43775
|
)
|
|
43469
43776
|
});
|
|
43470
|
-
var noulDecisionAnswerSchema =
|
|
43471
|
-
type:
|
|
43472
|
-
value:
|
|
43777
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
43778
|
+
type: z27.literal("noul"),
|
|
43779
|
+
value: z27.boolean(),
|
|
43473
43780
|
probability: unitIntervalSchema,
|
|
43474
43781
|
confidence: unitIntervalSchema
|
|
43475
43782
|
});
|
|
43476
|
-
var choiceDecisionAnswerSchema =
|
|
43477
|
-
type:
|
|
43478
|
-
value:
|
|
43479
|
-
probabilities:
|
|
43783
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
43784
|
+
type: z27.literal("choice"),
|
|
43785
|
+
value: z27.string().min(1),
|
|
43786
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
43480
43787
|
confidence: unitIntervalSchema
|
|
43481
43788
|
});
|
|
43482
|
-
var scoreDecisionAnswerSchema =
|
|
43483
|
-
type:
|
|
43484
|
-
value:
|
|
43485
|
-
probabilities:
|
|
43789
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
43790
|
+
type: z27.literal("score"),
|
|
43791
|
+
value: z27.number().int().nonnegative(),
|
|
43792
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
43486
43793
|
confidence: unitIntervalSchema
|
|
43487
43794
|
});
|
|
43488
|
-
var decisionAnswerSchema =
|
|
43795
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
43489
43796
|
noulDecisionAnswerSchema,
|
|
43490
43797
|
choiceDecisionAnswerSchema,
|
|
43491
43798
|
scoreDecisionAnswerSchema
|
|
43492
43799
|
]);
|
|
43493
|
-
var decisionOutcomeSchema =
|
|
43494
|
-
answers:
|
|
43800
|
+
var decisionOutcomeSchema = z27.object({
|
|
43801
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
43495
43802
|
source: decisionOutcomeSourceSchema,
|
|
43496
|
-
requestId:
|
|
43497
|
-
latencyMs:
|
|
43498
|
-
costUsd:
|
|
43499
|
-
costMicros:
|
|
43500
|
-
balanceMicros:
|
|
43501
|
-
checkpoint:
|
|
43502
|
-
inputTokens:
|
|
43503
|
-
});
|
|
43504
|
-
var decisionProviderKindSchema =
|
|
43505
|
-
var decisionProviderConfigSchema =
|
|
43506
|
-
baseUrl:
|
|
43803
|
+
requestId: z27.string().min(1).optional(),
|
|
43804
|
+
latencyMs: z27.number().nonnegative(),
|
|
43805
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
43806
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
43807
|
+
balanceMicros: z27.number().int().optional(),
|
|
43808
|
+
checkpoint: z27.string().min(1).optional(),
|
|
43809
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
43810
|
+
});
|
|
43811
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
43812
|
+
var decisionProviderConfigSchema = z27.object({
|
|
43813
|
+
baseUrl: z27.url(),
|
|
43507
43814
|
provider: decisionProviderKindSchema.optional()
|
|
43508
43815
|
});
|
|
43509
43816
|
|
|
43510
43817
|
// packages/contracts/src/nexus-account.ts
|
|
43511
|
-
import { z as
|
|
43512
|
-
var nexusAccountUserSchema =
|
|
43513
|
-
id:
|
|
43514
|
-
email:
|
|
43515
|
-
name:
|
|
43516
|
-
});
|
|
43517
|
-
var nexusAccountOrganizationSchema =
|
|
43518
|
-
id:
|
|
43519
|
-
name:
|
|
43520
|
-
slug:
|
|
43521
|
-
role:
|
|
43818
|
+
import { z as z28 } from "zod";
|
|
43819
|
+
var nexusAccountUserSchema = z28.object({
|
|
43820
|
+
id: z28.string(),
|
|
43821
|
+
email: z28.string(),
|
|
43822
|
+
name: z28.string().nullable().optional()
|
|
43823
|
+
});
|
|
43824
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
43825
|
+
id: z28.string(),
|
|
43826
|
+
name: z28.string(),
|
|
43827
|
+
slug: z28.string().nullable().optional(),
|
|
43828
|
+
role: z28.string().optional(),
|
|
43522
43829
|
/** `true` for the personal organization created at sign-up. */
|
|
43523
|
-
personal:
|
|
43830
|
+
personal: z28.boolean().optional()
|
|
43524
43831
|
});
|
|
43525
|
-
var nexusAccountMeSchema =
|
|
43832
|
+
var nexusAccountMeSchema = z28.object({
|
|
43526
43833
|
user: nexusAccountUserSchema,
|
|
43527
|
-
organizations:
|
|
43834
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
43528
43835
|
});
|
|
43529
43836
|
|
|
43530
43837
|
// packages/contracts/src/nexus-cloud.ts
|
|
43531
|
-
import { z as
|
|
43838
|
+
import { z as z29 } from "zod";
|
|
43532
43839
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
43533
43840
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
43534
43841
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
43535
|
-
var isoTime =
|
|
43536
|
-
var profile =
|
|
43537
|
-
var deviceState =
|
|
43538
|
-
var nexusCloudCredentialSchema =
|
|
43539
|
-
kind:
|
|
43540
|
-
credentialId:
|
|
43842
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
43843
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
43844
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
43845
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
43846
|
+
kind: z29.enum(["device", "session"]),
|
|
43847
|
+
credentialId: z29.string().nullable().optional(),
|
|
43541
43848
|
profile: profile.optional(),
|
|
43542
|
-
scopes:
|
|
43849
|
+
scopes: z29.array(z29.string()).default([]),
|
|
43543
43850
|
createdAt: isoTime.nullable().optional(),
|
|
43544
43851
|
lastUsedAt: isoTime.nullable().optional(),
|
|
43545
43852
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
43546
43853
|
idleExpiresAt: isoTime.nullable().optional()
|
|
43547
43854
|
});
|
|
43548
|
-
var nexusCloudDeviceSchema =
|
|
43549
|
-
deviceId:
|
|
43550
|
-
name:
|
|
43551
|
-
platform:
|
|
43552
|
-
arch:
|
|
43553
|
-
cliVersion:
|
|
43855
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
43856
|
+
deviceId: z29.string(),
|
|
43857
|
+
name: z29.string(),
|
|
43858
|
+
platform: z29.string().optional(),
|
|
43859
|
+
arch: z29.string().nullable().optional(),
|
|
43860
|
+
cliVersion: z29.string().nullable().optional(),
|
|
43554
43861
|
createdAt: isoTime.optional(),
|
|
43555
43862
|
lastSeenAt: isoTime.nullable().optional(),
|
|
43556
43863
|
state: deviceState,
|
|
43557
43864
|
signedOutAt: isoTime.nullable().optional(),
|
|
43558
43865
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
43559
|
-
certificate:
|
|
43866
|
+
certificate: z29.string().nullable().optional(),
|
|
43560
43867
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
43561
43868
|
profile: profile.optional(),
|
|
43562
43869
|
/** True for the device whose credential made this request. */
|
|
43563
|
-
current:
|
|
43564
|
-
projects:
|
|
43565
|
-
replicas:
|
|
43870
|
+
current: z29.boolean().default(false),
|
|
43871
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
43872
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
43566
43873
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43567
43874
|
lastPresenceAt: isoTime.nullable().optional()
|
|
43568
43875
|
});
|
|
43569
|
-
var nexusCloudOrganizationSchema =
|
|
43570
|
-
id:
|
|
43571
|
-
name:
|
|
43572
|
-
slug:
|
|
43573
|
-
role:
|
|
43574
|
-
personal:
|
|
43876
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
43877
|
+
id: z29.string(),
|
|
43878
|
+
name: z29.string(),
|
|
43879
|
+
slug: z29.string().nullable().optional(),
|
|
43880
|
+
role: z29.string().optional(),
|
|
43881
|
+
personal: z29.boolean().optional()
|
|
43575
43882
|
});
|
|
43576
|
-
var nexusCloudUserSchema =
|
|
43577
|
-
id:
|
|
43578
|
-
email:
|
|
43579
|
-
name:
|
|
43883
|
+
var nexusCloudUserSchema = z29.object({
|
|
43884
|
+
id: z29.string(),
|
|
43885
|
+
email: z29.string(),
|
|
43886
|
+
name: z29.string().nullable().optional()
|
|
43580
43887
|
});
|
|
43581
|
-
var nexusCloudWhoamiSchema =
|
|
43888
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
43582
43889
|
serverTime: isoTime.optional(),
|
|
43583
43890
|
user: nexusCloudUserSchema,
|
|
43584
|
-
organizations:
|
|
43891
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
43585
43892
|
credential: nexusCloudCredentialSchema,
|
|
43586
43893
|
/** The calling device; null for a session caller. */
|
|
43587
43894
|
device: nexusCloudDeviceSchema.nullable()
|
|
43588
43895
|
});
|
|
43589
|
-
var nexusCloudDevicePageSchema =
|
|
43590
|
-
devices:
|
|
43591
|
-
nextCursor:
|
|
43592
|
-
truncated:
|
|
43896
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
43897
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
43898
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43899
|
+
truncated: z29.boolean().default(false)
|
|
43593
43900
|
});
|
|
43594
|
-
var nexusCloudPresenceSchema =
|
|
43901
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
43595
43902
|
observedAt: isoTime.optional(),
|
|
43596
|
-
sync:
|
|
43903
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
43597
43904
|
});
|
|
43598
|
-
var nexusCloudReplicaSchema =
|
|
43599
|
-
projectId:
|
|
43600
|
-
replicaId:
|
|
43601
|
-
deviceId:
|
|
43602
|
-
deviceName:
|
|
43905
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
43906
|
+
projectId: z29.string(),
|
|
43907
|
+
replicaId: z29.string(),
|
|
43908
|
+
deviceId: z29.string(),
|
|
43909
|
+
deviceName: z29.string(),
|
|
43603
43910
|
deviceState: deviceState.optional(),
|
|
43604
43911
|
attachedAt: isoTime.optional(),
|
|
43605
43912
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -43608,72 +43915,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
43608
43915
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
43609
43916
|
retiredAt: isoTime.nullable().optional(),
|
|
43610
43917
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
43611
|
-
successor:
|
|
43918
|
+
successor: z29.string().nullable().optional()
|
|
43612
43919
|
});
|
|
43613
|
-
var nexusCloudDeviceCountsSchema =
|
|
43614
|
-
active:
|
|
43615
|
-
total:
|
|
43920
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
43921
|
+
active: z29.number().int().nonnegative(),
|
|
43922
|
+
total: z29.number().int().nonnegative()
|
|
43616
43923
|
});
|
|
43617
43924
|
var projectFields = {
|
|
43618
|
-
projectId:
|
|
43619
|
-
label:
|
|
43620
|
-
organizationId:
|
|
43621
|
-
organizationName:
|
|
43622
|
-
remoteUrl:
|
|
43925
|
+
projectId: z29.string(),
|
|
43926
|
+
label: z29.string().nullable(),
|
|
43927
|
+
organizationId: z29.string(),
|
|
43928
|
+
organizationName: z29.string().optional(),
|
|
43929
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
43623
43930
|
createdAt: isoTime.optional()
|
|
43624
43931
|
};
|
|
43625
|
-
var nexusCloudProjectListItemSchema =
|
|
43932
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
43626
43933
|
...projectFields,
|
|
43627
|
-
role:
|
|
43934
|
+
role: z29.string(),
|
|
43628
43935
|
/**
|
|
43629
43936
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
43630
43937
|
* only a holder of the account key can open it (T13102).
|
|
43631
43938
|
*/
|
|
43632
|
-
encryptedName:
|
|
43633
|
-
streamId:
|
|
43634
|
-
headSeq:
|
|
43939
|
+
encryptedName: z29.string().nullable().optional(),
|
|
43940
|
+
streamId: z29.string().optional(),
|
|
43941
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
43635
43942
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
43636
|
-
headCheckpointId:
|
|
43637
|
-
openConflicts:
|
|
43638
|
-
replicas:
|
|
43943
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
43944
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
43945
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
43639
43946
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
43640
|
-
replicaCount:
|
|
43947
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
43641
43948
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43642
43949
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
43643
43950
|
/** This project's replica list was cut at 50 (T12858). */
|
|
43644
|
-
replicasTruncated:
|
|
43951
|
+
replicasTruncated: z29.boolean().default(false)
|
|
43645
43952
|
});
|
|
43646
|
-
var nexusCloudProjectPageSchema =
|
|
43647
|
-
projects:
|
|
43648
|
-
nextCursor:
|
|
43953
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
43954
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
43955
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43649
43956
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
43650
|
-
truncated:
|
|
43957
|
+
truncated: z29.boolean().default(false),
|
|
43651
43958
|
/** The project list itself was cut at 1000 (T12858). */
|
|
43652
|
-
projectsTruncated:
|
|
43959
|
+
projectsTruncated: z29.boolean().default(false)
|
|
43653
43960
|
});
|
|
43654
|
-
var nexusCloudProjectDetailSchema =
|
|
43655
|
-
project:
|
|
43656
|
-
role:
|
|
43657
|
-
canTrash:
|
|
43658
|
-
openConflicts:
|
|
43961
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
43962
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
43963
|
+
role: z29.string(),
|
|
43964
|
+
canTrash: z29.boolean().optional(),
|
|
43965
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
43659
43966
|
/** At most 50, oldest attachment first. */
|
|
43660
|
-
replicas:
|
|
43967
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
43661
43968
|
devices: nexusCloudDeviceCountsSchema,
|
|
43662
|
-
replicaCount:
|
|
43969
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
43663
43970
|
lastSyncAt: isoTime.nullable().optional(),
|
|
43664
43971
|
/** `replicas` was cut at 50. */
|
|
43665
|
-
truncated:
|
|
43666
|
-
stream:
|
|
43667
|
-
streamId:
|
|
43668
|
-
headSeq:
|
|
43669
|
-
headCheckpointId:
|
|
43972
|
+
truncated: z29.boolean().default(false),
|
|
43973
|
+
stream: z29.object({
|
|
43974
|
+
streamId: z29.string(),
|
|
43975
|
+
headSeq: z29.number().int().nonnegative(),
|
|
43976
|
+
headCheckpointId: z29.string().nullable()
|
|
43670
43977
|
}).nullable()
|
|
43671
43978
|
});
|
|
43672
|
-
var nexusCloudReplicaPageSchema =
|
|
43673
|
-
replicas:
|
|
43979
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
43980
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
43674
43981
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
43675
|
-
nextCursor:
|
|
43676
|
-
truncated:
|
|
43982
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
43983
|
+
truncated: z29.boolean().default(false)
|
|
43677
43984
|
});
|
|
43678
43985
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
43679
43986
|
"credential.valid",
|
|
@@ -43689,56 +43996,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
43689
43996
|
];
|
|
43690
43997
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
43691
43998
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
43692
|
-
var knownCheckId =
|
|
43693
|
-
var nexusCloudStatusCheckSchema =
|
|
43694
|
-
id:
|
|
43695
|
-
ok:
|
|
43696
|
-
required:
|
|
43697
|
-
detail:
|
|
43698
|
-
});
|
|
43699
|
-
var nexusCloudStatusSchema =
|
|
43999
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
44000
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
44001
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
44002
|
+
ok: z29.boolean(),
|
|
44003
|
+
required: z29.boolean(),
|
|
44004
|
+
detail: z29.string()
|
|
44005
|
+
});
|
|
44006
|
+
var nexusCloudStatusSchema = z29.object({
|
|
43700
44007
|
serverTime: isoTime.optional(),
|
|
43701
|
-
apiVersion:
|
|
44008
|
+
apiVersion: z29.string().optional(),
|
|
43702
44009
|
/**
|
|
43703
44010
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
43704
44011
|
* than the list, which therefore support none of them.
|
|
43705
44012
|
*/
|
|
43706
|
-
features:
|
|
44013
|
+
features: z29.array(z29.string()).optional(),
|
|
43707
44014
|
user: nexusCloudUserSchema,
|
|
43708
44015
|
credential: nexusCloudCredentialSchema,
|
|
43709
44016
|
device: nexusCloudDeviceSchema.nullable(),
|
|
43710
|
-
project:
|
|
43711
|
-
projectId:
|
|
43712
|
-
registered:
|
|
43713
|
-
organizationId:
|
|
43714
|
-
organizationName:
|
|
43715
|
-
role:
|
|
44017
|
+
project: z29.object({
|
|
44018
|
+
projectId: z29.string(),
|
|
44019
|
+
registered: z29.boolean(),
|
|
44020
|
+
organizationId: z29.string().nullable(),
|
|
44021
|
+
organizationName: z29.string().nullable(),
|
|
44022
|
+
role: z29.string().nullable()
|
|
43716
44023
|
}).nullable(),
|
|
43717
|
-
replica:
|
|
43718
|
-
replicaId:
|
|
43719
|
-
attached:
|
|
43720
|
-
attachedElsewhere:
|
|
44024
|
+
replica: z29.object({
|
|
44025
|
+
replicaId: z29.string(),
|
|
44026
|
+
attached: z29.boolean(),
|
|
44027
|
+
attachedElsewhere: z29.boolean(),
|
|
43721
44028
|
attachedAt: isoTime.nullable(),
|
|
43722
44029
|
lastSyncAt: isoTime.nullable(),
|
|
43723
44030
|
presenceAt: isoTime.nullable(),
|
|
43724
|
-
lastReplicaSeq:
|
|
44031
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
43725
44032
|
}).nullable(),
|
|
43726
|
-
stream:
|
|
43727
|
-
streamId:
|
|
43728
|
-
headSeq:
|
|
43729
|
-
headCheckpointId:
|
|
43730
|
-
openConflicts:
|
|
44033
|
+
stream: z29.object({
|
|
44034
|
+
streamId: z29.string(),
|
|
44035
|
+
headSeq: z29.number().int().nonnegative(),
|
|
44036
|
+
headCheckpointId: z29.string().nullable(),
|
|
44037
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
43731
44038
|
devices: nexusCloudDeviceCountsSchema
|
|
43732
44039
|
}).nullable(),
|
|
43733
44040
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
43734
|
-
checks:
|
|
44041
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
43735
44042
|
(list) => list.flatMap((c) => {
|
|
43736
44043
|
const id = knownCheckId.safeParse(c.id);
|
|
43737
44044
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
43738
44045
|
})
|
|
43739
44046
|
),
|
|
43740
44047
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
43741
|
-
verdict:
|
|
44048
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
43742
44049
|
});
|
|
43743
44050
|
var LOGIN = "run `cleo login nexus`";
|
|
43744
44051
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -43783,52 +44090,55 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
43783
44090
|
};
|
|
43784
44091
|
|
|
43785
44092
|
// packages/contracts/src/nexus-vault.ts
|
|
43786
|
-
import { z as
|
|
43787
|
-
var isoTime2 =
|
|
43788
|
-
var uuid =
|
|
43789
|
-
var nexusUserKeysSchema =
|
|
43790
|
-
keyVersion:
|
|
43791
|
-
masterKeyVerifier:
|
|
43792
|
-
});
|
|
43793
|
-
var nexusProjectKeysSchema =
|
|
43794
|
-
keys:
|
|
43795
|
-
|
|
44093
|
+
import { z as z30 } from "zod";
|
|
44094
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
44095
|
+
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);
|
|
44096
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
44097
|
+
keyVersion: z30.number().int().positive(),
|
|
44098
|
+
masterKeyVerifier: z30.string()
|
|
44099
|
+
});
|
|
44100
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
44101
|
+
keys: z30.array(
|
|
44102
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
43796
44103
|
)
|
|
43797
44104
|
});
|
|
43798
|
-
var nexusLeaseSchema =
|
|
43799
|
-
streamId:
|
|
43800
|
-
role:
|
|
44105
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
44106
|
+
streamId: z30.string(),
|
|
44107
|
+
role: z30.string(),
|
|
43801
44108
|
replicaId: uuid,
|
|
43802
44109
|
expiresAt: isoTime2,
|
|
43803
44110
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
43804
44111
|
});
|
|
43805
|
-
var nexusLeaseAcquireSchema =
|
|
43806
|
-
var nexusStreamHeadSchema =
|
|
43807
|
-
streamId:
|
|
43808
|
-
kind:
|
|
43809
|
-
headSeq:
|
|
43810
|
-
headCheckpointId:
|
|
44112
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
44113
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
44114
|
+
streamId: z30.string(),
|
|
44115
|
+
kind: z30.string().optional(),
|
|
44116
|
+
headSeq: z30.number().int().nonnegative(),
|
|
44117
|
+
headCheckpointId: z30.string().nullable(),
|
|
43811
44118
|
/**
|
|
43812
44119
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
43813
44120
|
* Absent from an older server.
|
|
43814
44121
|
*/
|
|
43815
|
-
maxSchemaVersion:
|
|
44122
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
43816
44123
|
});
|
|
43817
|
-
var nexusActivityEventSchema =
|
|
43818
|
-
id:
|
|
44124
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
44125
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
43819
44126
|
at: isoTime2,
|
|
43820
|
-
actorUserId:
|
|
43821
|
-
actorDeviceId:
|
|
43822
|
-
requestId:
|
|
43823
|
-
action:
|
|
43824
|
-
target:
|
|
43825
|
-
detail:
|
|
44127
|
+
actorUserId: z30.string().nullable().optional(),
|
|
44128
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
44129
|
+
requestId: z30.string().nullable().optional(),
|
|
44130
|
+
action: z30.string(),
|
|
44131
|
+
target: z30.string().nullable().optional(),
|
|
44132
|
+
detail: z30.unknown().optional()
|
|
43826
44133
|
});
|
|
43827
|
-
var nexusActivityPageSchema =
|
|
43828
|
-
events:
|
|
43829
|
-
nextBefore:
|
|
44134
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
44135
|
+
events: z30.array(nexusActivityEventSchema),
|
|
44136
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
43830
44137
|
});
|
|
43831
44138
|
|
|
44139
|
+
// packages/adapters/src/providers/claude-sdk/spawn.ts
|
|
44140
|
+
import { E_LEAD_NO_OWNER_CHANNEL as E_LEAD_NO_OWNER_CHANNEL2 } from "@cleocode/contracts/operations/orchestrate.js";
|
|
44141
|
+
|
|
43832
44142
|
// packages/adapters/src/providers/shared/credentials.ts
|
|
43833
44143
|
import { existsSync, readFileSync } from "node:fs";
|
|
43834
44144
|
import { homedir } from "node:os";
|
|
@@ -43980,6 +44290,18 @@ var ClaudeSDKSpawnProvider = class {
|
|
|
43980
44290
|
const instanceId = `sdk-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
43981
44291
|
const sessionId = `cleo-${instanceId}`;
|
|
43982
44292
|
const startTime = (/* @__PURE__ */ new Date()).toISOString();
|
|
44293
|
+
if (leadDeniedTools(context) !== null && context.options?.leadMode !== "detached") {
|
|
44294
|
+
return {
|
|
44295
|
+
instanceId,
|
|
44296
|
+
taskId: context.taskId,
|
|
44297
|
+
providerId: "claude-sdk",
|
|
44298
|
+
status: "failed",
|
|
44299
|
+
startTime,
|
|
44300
|
+
endTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
44301
|
+
exitCode: 1,
|
|
44302
|
+
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`
|
|
44303
|
+
};
|
|
44304
|
+
}
|
|
43983
44305
|
this.sessions.add({
|
|
43984
44306
|
instanceId,
|
|
43985
44307
|
sessionId,
|
|
@@ -45405,7 +45727,7 @@ var ClaudeCodeInstallProvider = class {
|
|
|
45405
45727
|
import { spawn as nodeSpawn2 } from "node:child_process";
|
|
45406
45728
|
import { writeFile as writeFile3 } from "node:fs/promises";
|
|
45407
45729
|
import { dirname as dirname7, join as join11 } from "node:path";
|
|
45408
|
-
import { E_LEAD_NO_OWNER_CHANNEL as
|
|
45730
|
+
import { E_LEAD_NO_OWNER_CHANNEL as E_LEAD_NO_OWNER_CHANNEL4 } from "@cleocode/contracts/operations/orchestrate.js";
|
|
45409
45731
|
import { findOnPath as findOnPath2 } from "@cleocode/paths";
|
|
45410
45732
|
|
|
45411
45733
|
// packages/adapters/src/providers/shared/agent-spawn-wrapper.ts
|
|
@@ -45625,7 +45947,10 @@ async function prepareLeadMcp(dir, projectDir, opts = {}) {
|
|
|
45625
45947
|
// packages/adapters/src/providers/claude-code/lead-session.ts
|
|
45626
45948
|
import { spawn as nodeSpawn } from "node:child_process";
|
|
45627
45949
|
import { isAbsolute as isAbsolute4 } from "node:path";
|
|
45628
|
-
import {
|
|
45950
|
+
import {
|
|
45951
|
+
E_LEAD_NO_OWNER_CHANNEL as E_LEAD_NO_OWNER_CHANNEL3,
|
|
45952
|
+
LEAD_ASK_TOOL as LEAD_ASK_TOOL2
|
|
45953
|
+
} from "@cleocode/contracts/operations/orchestrate.js";
|
|
45629
45954
|
import { findOnPath, pathDelimiterFor, pathEnvKey, splitPathEnv } from "@cleocode/paths";
|
|
45630
45955
|
var LEAD_KICKOFF_PROMPT = "You are the no-hands lead. Your full instructions are in your system prompt: follow them, using only your allowed tools.";
|
|
45631
45956
|
function leadSessionId(options) {
|
|
@@ -45676,12 +46001,12 @@ function buildLeadArgs(input) {
|
|
|
45676
46001
|
"--allowedTools",
|
|
45677
46002
|
allowed.join(","),
|
|
45678
46003
|
"--disallowedTools",
|
|
45679
|
-
input.denied.join(","),
|
|
46004
|
+
input.denied.filter((tool2) => tool2 !== "MultiEdit").join(","),
|
|
45680
46005
|
"--mcp-config",
|
|
45681
46006
|
input.leadMcp.config,
|
|
45682
46007
|
"--strict-mcp-config",
|
|
45683
46008
|
"--permission-mode",
|
|
45684
|
-
"dontAsk",
|
|
46009
|
+
interactive ? "default" : "dontAsk",
|
|
45685
46010
|
"--setting-sources",
|
|
45686
46011
|
"",
|
|
45687
46012
|
...input.sessionId !== void 0 ? ["--session-id", input.sessionId] : [],
|
|
@@ -45693,6 +46018,13 @@ function buildLeadArgs(input) {
|
|
|
45693
46018
|
];
|
|
45694
46019
|
}
|
|
45695
46020
|
function runInteractiveLead(command, args, opts) {
|
|
46021
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
46022
|
+
return Promise.reject(
|
|
46023
|
+
new Error(
|
|
46024
|
+
`${E_LEAD_NO_OWNER_CHANNEL3}: interactive AskUserQuestion needs terminal stdin and stdout; use --detached with --adapter claude-code and a configured mbx MCP server`
|
|
46025
|
+
)
|
|
46026
|
+
);
|
|
46027
|
+
}
|
|
45696
46028
|
return new Promise((resolve6, reject) => {
|
|
45697
46029
|
const child = nodeSpawn(command, [...args], {
|
|
45698
46030
|
stdio: "inherit",
|
|
@@ -45914,7 +46246,7 @@ var ClaudeCodeSpawnProvider = class {
|
|
|
45914
46246
|
status: "failed",
|
|
45915
46247
|
startTime,
|
|
45916
46248
|
endTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
45917
|
-
error: `${
|
|
46249
|
+
error: `${E_LEAD_NO_OWNER_CHANNEL4}: a detached lead needs the mbx MCP server to reach the owner (${leadMcp.report.warning ?? "none is configured"})`,
|
|
45918
46250
|
leadMcp: leadMcp.report
|
|
45919
46251
|
};
|
|
45920
46252
|
}
|