@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
|
@@ -1342,17 +1342,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
1342
1342
|
});
|
|
1343
1343
|
|
|
1344
1344
|
// packages/contracts/src/config/manifest.ts
|
|
1345
|
-
import { z as
|
|
1345
|
+
import { z as z6 } from "zod";
|
|
1346
1346
|
|
|
1347
|
-
// packages/contracts/src/
|
|
1347
|
+
// packages/contracts/src/orca-execution.ts
|
|
1348
1348
|
import { z as z4 } from "zod";
|
|
1349
|
-
var
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1349
|
+
var identifier = z4.string().min(1);
|
|
1350
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
1351
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
1352
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
1353
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
1354
|
+
});
|
|
1355
|
+
var orcaContextSchema = z4.object({
|
|
1356
|
+
runtimeId: identifier,
|
|
1357
|
+
coordinatorHandle: identifier,
|
|
1358
|
+
executionHostId: z4.literal("local")
|
|
1359
|
+
});
|
|
1360
|
+
var orcaRoutingRunSchema = z4.object({
|
|
1361
|
+
runId: identifier.nullable(),
|
|
1362
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
1363
|
+
});
|
|
1364
|
+
var orcaLaunchSchema = z4.object({
|
|
1365
|
+
projectId: identifier,
|
|
1366
|
+
projectRoot: identifier,
|
|
1367
|
+
taskId: identifier,
|
|
1368
|
+
instanceId: identifier,
|
|
1369
|
+
workerSessionId: identifier,
|
|
1370
|
+
agentId: identifier,
|
|
1371
|
+
role: z4.enum(["worker", "lead"]),
|
|
1372
|
+
protocol: identifier,
|
|
1373
|
+
worktreePath: identifier,
|
|
1374
|
+
worktreeBranch: identifier,
|
|
1375
|
+
projectHash: identifier,
|
|
1376
|
+
lockToken: identifier,
|
|
1377
|
+
prompt: identifier,
|
|
1378
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
1379
|
+
leadMailbox: identifier.nullable(),
|
|
1380
|
+
model: identifier.optional(),
|
|
1381
|
+
effort: identifier.optional(),
|
|
1382
|
+
accountId: identifier.optional()
|
|
1383
|
+
});
|
|
1384
|
+
var orcaStartBindingSchema = z4.object({
|
|
1385
|
+
runId: identifier.nullable(),
|
|
1386
|
+
orcaTaskId: identifier.nullable(),
|
|
1387
|
+
retryOf: identifier.nullable()
|
|
1388
|
+
});
|
|
1389
|
+
var orcaAttemptSchema = z4.object({
|
|
1390
|
+
backend: z4.literal("orca"),
|
|
1391
|
+
version: z4.literal(1),
|
|
1392
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
1393
|
+
revision: z4.number().int().nonnegative(),
|
|
1394
|
+
context: orcaContextSchema,
|
|
1395
|
+
launch: orcaLaunchSchema,
|
|
1396
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1397
|
+
workspaceId: identifier,
|
|
1398
|
+
workspaceSelector: identifier,
|
|
1399
|
+
state: z4.enum([
|
|
1400
|
+
"prepared",
|
|
1401
|
+
"launching",
|
|
1402
|
+
"ready",
|
|
1403
|
+
"turn_unobserved",
|
|
1404
|
+
"outcome_unknown",
|
|
1405
|
+
"stop_pending",
|
|
1406
|
+
"stop_unknown",
|
|
1407
|
+
"stopped",
|
|
1408
|
+
"failed",
|
|
1409
|
+
"circuit_broken"
|
|
1410
|
+
]),
|
|
1411
|
+
runId: identifier.nullable(),
|
|
1412
|
+
orcaTaskId: identifier.nullable(),
|
|
1413
|
+
dispatchId: identifier.nullable(),
|
|
1414
|
+
retryOf: identifier.nullable(),
|
|
1415
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
1416
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
1417
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
1418
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
1419
|
+
startRequestId: identifier.nullable(),
|
|
1420
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
1421
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
1422
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
1423
|
+
stopRequestId: identifier.nullable(),
|
|
1424
|
+
/**
|
|
1425
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
1426
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
1427
|
+
*/
|
|
1428
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
1429
|
+
failureCount: z4.number().int().nonnegative(),
|
|
1430
|
+
resourceState: z4.string(),
|
|
1431
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
1432
|
+
lastReceipt: z4.string().nullable(),
|
|
1433
|
+
lastError: z4.string().nullable(),
|
|
1434
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
1435
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
1436
|
+
observedAt: z4.string()
|
|
1437
|
+
});
|
|
1438
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
1439
|
+
messageId: identifier,
|
|
1440
|
+
runtimeId: identifier,
|
|
1441
|
+
runId: identifier,
|
|
1442
|
+
orcaTaskId: identifier,
|
|
1443
|
+
dispatchId: identifier,
|
|
1444
|
+
senderHandle: identifier,
|
|
1445
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1446
|
+
body: z4.string(),
|
|
1447
|
+
reportPath: identifier
|
|
1448
|
+
});
|
|
1449
|
+
var orcaWorkerReportSchema = z4.object({
|
|
1450
|
+
event: orcaWorkerDoneSchema,
|
|
1451
|
+
manifestId: identifier,
|
|
1452
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1453
|
+
reportText: z4.string().min(1).max(65536),
|
|
1454
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1455
|
+
ingestedAt: z4.string().datetime()
|
|
1456
|
+
});
|
|
1457
|
+
var orcaReportDeliverySchema = z4.object({
|
|
1458
|
+
key: identifier,
|
|
1459
|
+
mailbox: identifier.nullable(),
|
|
1460
|
+
state: z4.enum(["pending", "delivered"]),
|
|
1461
|
+
messageId: identifier.nullable(),
|
|
1462
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
1463
|
+
lastError: z4.string().nullable()
|
|
1464
|
+
});
|
|
1465
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
1466
|
+
resourceRelease: z4.object({
|
|
1467
|
+
dispatchId: identifier,
|
|
1468
|
+
releasedAt: z4.string().datetime(),
|
|
1469
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1470
|
+
receipt: identifier
|
|
1471
|
+
}).optional(),
|
|
1472
|
+
retiredAt: z4.string().datetime().optional(),
|
|
1473
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
1474
|
+
});
|
|
1475
|
+
var orcaReportMessageSchema = z4.object({
|
|
1476
|
+
id: identifier,
|
|
1477
|
+
run_id: z4.string().nullable(),
|
|
1478
|
+
delivery_contract: z4.string(),
|
|
1479
|
+
from_handle: z4.string(),
|
|
1480
|
+
to_handle: z4.string(),
|
|
1481
|
+
type: z4.string(),
|
|
1482
|
+
body: z4.string(),
|
|
1483
|
+
payload: z4.string().nullable(),
|
|
1484
|
+
sender_pane_key: z4.string().nullable()
|
|
1485
|
+
});
|
|
1486
|
+
var orcaReportSourceSchema = z4.object({
|
|
1487
|
+
ok: z4.literal(true),
|
|
1488
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
1489
|
+
result: z4.object({
|
|
1490
|
+
messages: z4.array(z4.json()).optional(),
|
|
1491
|
+
dispatch: z4.object({
|
|
1492
|
+
id: identifier,
|
|
1493
|
+
run_id: identifier,
|
|
1494
|
+
task_id: identifier,
|
|
1495
|
+
assignee_handle: identifier,
|
|
1496
|
+
assignee_pane_key: z4.string().nullable(),
|
|
1497
|
+
status: z4.string()
|
|
1498
|
+
}).optional()
|
|
1499
|
+
})
|
|
1500
|
+
});
|
|
1501
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
1502
|
+
taskId: identifier,
|
|
1503
|
+
dispatchId: identifier,
|
|
1504
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1505
|
+
reportPath: identifier
|
|
1506
|
+
});
|
|
1507
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
1508
|
+
action: z4.enum([
|
|
1509
|
+
"show",
|
|
1510
|
+
"read",
|
|
1511
|
+
"recover-start",
|
|
1512
|
+
"recover-stop",
|
|
1513
|
+
"retry",
|
|
1514
|
+
"stop",
|
|
1515
|
+
"ingest-report",
|
|
1516
|
+
"relay-report"
|
|
1517
|
+
]),
|
|
1518
|
+
recordId: identifier,
|
|
1519
|
+
cursor: identifier.optional(),
|
|
1520
|
+
messageId: identifier.optional()
|
|
1521
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
1522
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
1523
|
+
path: ["cursor"]
|
|
1524
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
1525
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
1526
|
+
path: ["messageId"]
|
|
1527
|
+
});
|
|
1528
|
+
var effectSchema = z4.object({
|
|
1529
|
+
kind: z4.string(),
|
|
1530
|
+
role: z4.string().optional(),
|
|
1531
|
+
action: z4.string().optional(),
|
|
1532
|
+
id: z4.string().optional()
|
|
1533
|
+
});
|
|
1534
|
+
var selectionSchema = z4.object({
|
|
1535
|
+
agent: z4.string().nullable().optional(),
|
|
1536
|
+
model: z4.string().nullable().optional(),
|
|
1537
|
+
effort: z4.string().nullable().optional()
|
|
1538
|
+
});
|
|
1539
|
+
var orcaReplySchema = z4.object({
|
|
1540
|
+
ok: z4.boolean(),
|
|
1541
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
1542
|
+
error: z4.object({
|
|
1543
|
+
code: z4.string(),
|
|
1544
|
+
message: z4.string(),
|
|
1545
|
+
data: z4.object({
|
|
1546
|
+
requestId: identifier.optional(),
|
|
1547
|
+
orchestrationRequestId: identifier.optional(),
|
|
1548
|
+
dispatchId: identifier.optional()
|
|
1549
|
+
}).optional()
|
|
1550
|
+
}).optional(),
|
|
1551
|
+
result: z4.object({
|
|
1552
|
+
state: z4.string().optional(),
|
|
1553
|
+
requestId: identifier.optional(),
|
|
1554
|
+
/**
|
|
1555
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
1556
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
1557
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
1558
|
+
* be bound to the request key this attempt issued.
|
|
1559
|
+
*/
|
|
1560
|
+
mutation: z4.object({
|
|
1561
|
+
requestId: identifier.optional(),
|
|
1562
|
+
replayed: z4.boolean().optional()
|
|
1563
|
+
}).optional(),
|
|
1564
|
+
stage: z4.string().optional(),
|
|
1565
|
+
turnStart: z4.string().optional(),
|
|
1566
|
+
runId: identifier.optional(),
|
|
1567
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
1568
|
+
taskId: identifier.optional(),
|
|
1569
|
+
dispatchId: identifier.optional(),
|
|
1570
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
1571
|
+
effects: z4.array(effectSchema).optional(),
|
|
1572
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
1573
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
1574
|
+
lastError: z4.string().nullable().optional(),
|
|
1575
|
+
processAction: z4.string().optional(),
|
|
1576
|
+
helpers: z4.array(
|
|
1577
|
+
z4.object({
|
|
1578
|
+
dispatchId: identifier.optional(),
|
|
1579
|
+
creatorDispatchId: identifier.optional(),
|
|
1580
|
+
outcome: z4.string(),
|
|
1581
|
+
keptOpenBy: identifier.optional(),
|
|
1582
|
+
state: z4.string().optional(),
|
|
1583
|
+
lastError: z4.string().nullable().optional()
|
|
1584
|
+
})
|
|
1585
|
+
).optional(),
|
|
1586
|
+
helperStopError: z4.string().nullable().optional(),
|
|
1587
|
+
status: z4.string().optional(),
|
|
1588
|
+
terminal: z4.object({
|
|
1589
|
+
handle: identifier,
|
|
1590
|
+
connected: z4.boolean(),
|
|
1591
|
+
writable: z4.boolean(),
|
|
1592
|
+
executionHostId: identifier
|
|
1593
|
+
}).optional(),
|
|
1594
|
+
runtime: z4.object({
|
|
1595
|
+
runtimeId: identifier,
|
|
1596
|
+
reachable: z4.boolean(),
|
|
1597
|
+
state: z4.string(),
|
|
1598
|
+
capabilities: z4.array(z4.string())
|
|
1599
|
+
}).optional(),
|
|
1600
|
+
worktree: z4.object({
|
|
1601
|
+
id: identifier,
|
|
1602
|
+
path: identifier,
|
|
1603
|
+
branch: identifier,
|
|
1604
|
+
hostId: identifier,
|
|
1605
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
1606
|
+
}).optional(),
|
|
1607
|
+
dispatch: z4.object({
|
|
1608
|
+
id: identifier,
|
|
1609
|
+
runId: identifier,
|
|
1610
|
+
taskId: identifier,
|
|
1611
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
1612
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
1613
|
+
failureCount: z4.number().int().nonnegative()
|
|
1614
|
+
}).optional(),
|
|
1615
|
+
worker: z4.object({
|
|
1616
|
+
dispatchId: identifier,
|
|
1617
|
+
runtimeEpoch: identifier,
|
|
1618
|
+
state: z4.string(),
|
|
1619
|
+
stage: z4.string(),
|
|
1620
|
+
worktreeId: identifier.nullable()
|
|
1621
|
+
}).optional(),
|
|
1622
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
1623
|
+
projection: z4.object({
|
|
1624
|
+
resource: z4.object({
|
|
1625
|
+
state: z4.string(),
|
|
1626
|
+
terminalState: z4.string(),
|
|
1627
|
+
ownerDispatchId: identifier.optional(),
|
|
1628
|
+
releaseState: z4.string().optional()
|
|
1629
|
+
}).optional()
|
|
1630
|
+
}).optional()
|
|
1631
|
+
}).optional()
|
|
1632
|
+
});
|
|
1633
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
1634
|
+
schemaVersion: z4.number().int().positive(),
|
|
1635
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
1636
|
+
});
|
|
1637
|
+
var accountProviderSchema = z4.object({
|
|
1638
|
+
accounts: z4.array(z4.object({})),
|
|
1639
|
+
activeAccountId: identifier.nullable()
|
|
1640
|
+
});
|
|
1641
|
+
var orcaAccountReplySchema = z4.object({
|
|
1642
|
+
ok: z4.literal(true),
|
|
1643
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
1644
|
+
result: z4.object({
|
|
1645
|
+
codex: accountProviderSchema,
|
|
1646
|
+
opencode: accountProviderSchema,
|
|
1647
|
+
claude: accountProviderSchema
|
|
1648
|
+
})
|
|
1649
|
+
});
|
|
1650
|
+
|
|
1651
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
1652
|
+
import { z as z5 } from "zod";
|
|
1653
|
+
var projectWorkerPolicySchema = z5.object({
|
|
1654
|
+
verification: z5.object({
|
|
1655
|
+
full: z5.enum(["local", "ci"]),
|
|
1656
|
+
local: z5.enum(["single-file", "affected"])
|
|
1353
1657
|
}).strict().optional(),
|
|
1354
|
-
instructions:
|
|
1355
|
-
|
|
1658
|
+
instructions: z5.array(
|
|
1659
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
1356
1660
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
1357
1661
|
"Instructions must be single-line text without control characters or a leading #"
|
|
1358
1662
|
)
|
|
@@ -1380,8 +1684,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
1380
1684
|
path: ".cleo/config.json",
|
|
1381
1685
|
mergePrecedence: 20,
|
|
1382
1686
|
driftDetection: "schema-validate",
|
|
1383
|
-
schema:
|
|
1384
|
-
orchestrate:
|
|
1687
|
+
schema: z6.object({
|
|
1688
|
+
orchestrate: z6.object({
|
|
1689
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
1690
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
1691
|
+
}).passthrough().optional()
|
|
1385
1692
|
}).passthrough()
|
|
1386
1693
|
};
|
|
1387
1694
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -1397,139 +1704,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
1397
1704
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
1398
1705
|
CLEO_CONFIG_MANIFEST
|
|
1399
1706
|
]);
|
|
1400
|
-
var configManifestEntrySchema =
|
|
1401
|
-
id:
|
|
1402
|
-
scope:
|
|
1403
|
-
path:
|
|
1404
|
-
schema:
|
|
1405
|
-
mergePrecedence:
|
|
1406
|
-
driftDetection:
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1707
|
+
var configManifestEntrySchema = z6.object({
|
|
1708
|
+
id: z6.string().min(1),
|
|
1709
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
1710
|
+
path: z6.string().min(1),
|
|
1711
|
+
schema: z6.unknown().optional(),
|
|
1712
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
1713
|
+
driftDetection: z6.union([
|
|
1714
|
+
z6.literal("schema-validate"),
|
|
1715
|
+
z6.literal("staleness-gate"),
|
|
1716
|
+
z6.literal("value-diff"),
|
|
1717
|
+
z6.literal("none")
|
|
1411
1718
|
]),
|
|
1412
|
-
defaults:
|
|
1719
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
1413
1720
|
});
|
|
1414
1721
|
|
|
1415
1722
|
// packages/contracts/src/daemon/health.ts
|
|
1416
|
-
import { z as
|
|
1723
|
+
import { z as z8 } from "zod";
|
|
1417
1724
|
|
|
1418
1725
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
1419
|
-
import { z as
|
|
1420
|
-
var EnvPairSchema =
|
|
1726
|
+
import { z as z7 } from "zod";
|
|
1727
|
+
var EnvPairSchema = z7.object({
|
|
1421
1728
|
/** Environment variable name. */
|
|
1422
|
-
key:
|
|
1729
|
+
key: z7.string().min(1),
|
|
1423
1730
|
/** Environment variable value. */
|
|
1424
|
-
value:
|
|
1731
|
+
value: z7.string()
|
|
1425
1732
|
}).strict();
|
|
1426
|
-
var ChildStateSchema =
|
|
1427
|
-
var ChildStatusSchema =
|
|
1733
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
1734
|
+
var ChildStatusSchema = z7.object({
|
|
1428
1735
|
/** Logical id of the child (stable across restarts). */
|
|
1429
|
-
child_id:
|
|
1736
|
+
child_id: z7.string().min(1),
|
|
1430
1737
|
/** Current OS pid (0 when not currently running). */
|
|
1431
|
-
pid:
|
|
1738
|
+
pid: z7.number().int().nonnegative(),
|
|
1432
1739
|
/** Current liveness state. */
|
|
1433
1740
|
state: ChildStateSchema,
|
|
1434
1741
|
/** Total restarts observed for this child. */
|
|
1435
|
-
restart_count:
|
|
1742
|
+
restart_count: z7.number().int().nonnegative()
|
|
1436
1743
|
}).strict();
|
|
1437
|
-
var SpawnRequestSchema =
|
|
1744
|
+
var SpawnRequestSchema = z7.object({
|
|
1438
1745
|
/** Tag discriminating this request variant. */
|
|
1439
|
-
kind:
|
|
1746
|
+
kind: z7.literal("spawn"),
|
|
1440
1747
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
1441
|
-
child_id:
|
|
1748
|
+
child_id: z7.string().min(1),
|
|
1442
1749
|
/** Absolute path to the program to execute. */
|
|
1443
|
-
program:
|
|
1750
|
+
program: z7.string().min(1),
|
|
1444
1751
|
/** Arguments passed to the program. */
|
|
1445
|
-
args:
|
|
1752
|
+
args: z7.array(z7.string()).default([]),
|
|
1446
1753
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
1447
|
-
env:
|
|
1754
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
1448
1755
|
/** Optional working directory for the child. */
|
|
1449
|
-
cwd:
|
|
1756
|
+
cwd: z7.string().optional()
|
|
1450
1757
|
}).strict();
|
|
1451
|
-
var RestartRequestSchema =
|
|
1758
|
+
var RestartRequestSchema = z7.object({
|
|
1452
1759
|
/** Tag discriminating this request variant. */
|
|
1453
|
-
kind:
|
|
1760
|
+
kind: z7.literal("restart"),
|
|
1454
1761
|
/** Logical id of the child to restart. */
|
|
1455
|
-
child_id:
|
|
1762
|
+
child_id: z7.string().min(1)
|
|
1456
1763
|
}).strict();
|
|
1457
|
-
var MonitorRequestSchema =
|
|
1764
|
+
var MonitorRequestSchema = z7.object({
|
|
1458
1765
|
/** Tag discriminating this request variant. */
|
|
1459
|
-
kind:
|
|
1766
|
+
kind: z7.literal("monitor"),
|
|
1460
1767
|
/** Specific child id to monitor; omit to request all children. */
|
|
1461
|
-
child_id:
|
|
1768
|
+
child_id: z7.string().optional()
|
|
1462
1769
|
}).strict();
|
|
1463
|
-
var HealthRequestSchema =
|
|
1770
|
+
var HealthRequestSchema = z7.object({
|
|
1464
1771
|
/** Tag discriminating this request variant. */
|
|
1465
|
-
kind:
|
|
1772
|
+
kind: z7.literal("health")
|
|
1466
1773
|
}).strict();
|
|
1467
|
-
var SupervisorIpcRequestSchema =
|
|
1774
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
1468
1775
|
SpawnRequestSchema,
|
|
1469
1776
|
RestartRequestSchema,
|
|
1470
1777
|
MonitorRequestSchema,
|
|
1471
1778
|
HealthRequestSchema
|
|
1472
1779
|
]);
|
|
1473
|
-
var SpawnedResponseSchema =
|
|
1780
|
+
var SpawnedResponseSchema = z7.object({
|
|
1474
1781
|
/** Tag discriminating this response variant. */
|
|
1475
|
-
kind:
|
|
1782
|
+
kind: z7.literal("spawned"),
|
|
1476
1783
|
/** Logical id of the spawned child. */
|
|
1477
|
-
child_id:
|
|
1784
|
+
child_id: z7.string().min(1),
|
|
1478
1785
|
/** OS pid assigned to the spawned child. */
|
|
1479
|
-
pid:
|
|
1786
|
+
pid: z7.number().int().nonnegative()
|
|
1480
1787
|
}).strict();
|
|
1481
|
-
var RestartedResponseSchema =
|
|
1788
|
+
var RestartedResponseSchema = z7.object({
|
|
1482
1789
|
/** Tag discriminating this response variant. */
|
|
1483
|
-
kind:
|
|
1790
|
+
kind: z7.literal("restarted"),
|
|
1484
1791
|
/** Logical id of the restarted child. */
|
|
1485
|
-
child_id:
|
|
1792
|
+
child_id: z7.string().min(1),
|
|
1486
1793
|
/** New OS pid after the restart. */
|
|
1487
|
-
pid:
|
|
1794
|
+
pid: z7.number().int().nonnegative(),
|
|
1488
1795
|
/** Number of times this child has been restarted in total. */
|
|
1489
|
-
restart_count:
|
|
1796
|
+
restart_count: z7.number().int().nonnegative()
|
|
1490
1797
|
}).strict();
|
|
1491
|
-
var MonitorResponseSchema =
|
|
1798
|
+
var MonitorResponseSchema = z7.object({
|
|
1492
1799
|
/** Tag discriminating this response variant. */
|
|
1493
|
-
kind:
|
|
1800
|
+
kind: z7.literal("monitor"),
|
|
1494
1801
|
/** One row per monitored child. */
|
|
1495
|
-
children:
|
|
1802
|
+
children: z7.array(ChildStatusSchema)
|
|
1496
1803
|
}).strict();
|
|
1497
|
-
var HealthResponseSchema =
|
|
1804
|
+
var HealthResponseSchema = z7.object({
|
|
1498
1805
|
/** Tag discriminating this response variant. */
|
|
1499
|
-
kind:
|
|
1806
|
+
kind: z7.literal("health"),
|
|
1500
1807
|
/** Supervisor process pid. */
|
|
1501
|
-
pid:
|
|
1808
|
+
pid: z7.number().int().nonnegative(),
|
|
1502
1809
|
/** Number of children currently tracked. */
|
|
1503
|
-
child_count:
|
|
1810
|
+
child_count: z7.number().int().nonnegative(),
|
|
1504
1811
|
/** Seconds the supervisor has been running. */
|
|
1505
|
-
uptime_secs:
|
|
1812
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
1506
1813
|
/** Frozen protocol version the supervisor speaks. */
|
|
1507
|
-
protocol_version:
|
|
1814
|
+
protocol_version: z7.string()
|
|
1508
1815
|
}).strict();
|
|
1509
|
-
var LifecycleEventKindSchema =
|
|
1510
|
-
var LifecycleEventResponseSchema =
|
|
1816
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
1817
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
1511
1818
|
/** Tag discriminating this response variant. */
|
|
1512
|
-
kind:
|
|
1819
|
+
kind: z7.literal("event"),
|
|
1513
1820
|
/** What happened. */
|
|
1514
1821
|
event: LifecycleEventKindSchema,
|
|
1515
1822
|
/** Logical id of the affected child. */
|
|
1516
|
-
child_id:
|
|
1823
|
+
child_id: z7.string().min(1),
|
|
1517
1824
|
/** Exit code, when the OS reported one. */
|
|
1518
|
-
exit_code:
|
|
1825
|
+
exit_code: z7.number().int().optional(),
|
|
1519
1826
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
1520
|
-
signal:
|
|
1827
|
+
signal: z7.string().optional(),
|
|
1521
1828
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
1522
|
-
restart_delay_ms:
|
|
1829
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
1523
1830
|
}).strict();
|
|
1524
|
-
var ErrorResponseSchema =
|
|
1831
|
+
var ErrorResponseSchema = z7.object({
|
|
1525
1832
|
/** Tag discriminating this response variant. */
|
|
1526
|
-
kind:
|
|
1833
|
+
kind: z7.literal("error"),
|
|
1527
1834
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
1528
|
-
code:
|
|
1835
|
+
code: z7.string().min(1),
|
|
1529
1836
|
/** Human-readable error message. */
|
|
1530
|
-
message:
|
|
1837
|
+
message: z7.string()
|
|
1531
1838
|
}).strict();
|
|
1532
|
-
var SupervisorIpcResponseSchema =
|
|
1839
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
1533
1840
|
SpawnedResponseSchema,
|
|
1534
1841
|
RestartedResponseSchema,
|
|
1535
1842
|
MonitorResponseSchema,
|
|
@@ -1537,27 +1844,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
1537
1844
|
LifecycleEventResponseSchema,
|
|
1538
1845
|
ErrorResponseSchema
|
|
1539
1846
|
]);
|
|
1540
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
1847
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
1541
1848
|
/** Frozen protocol version. */
|
|
1542
|
-
protocol_version:
|
|
1849
|
+
protocol_version: z7.string(),
|
|
1543
1850
|
/** Correlation id echoed back on the matching response. */
|
|
1544
|
-
id:
|
|
1851
|
+
id: z7.string().min(1),
|
|
1545
1852
|
/** Direction discriminator. */
|
|
1546
|
-
direction:
|
|
1853
|
+
direction: z7.literal("request"),
|
|
1547
1854
|
/** The request body. */
|
|
1548
1855
|
request: SupervisorIpcRequestSchema
|
|
1549
1856
|
}).strict();
|
|
1550
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
1857
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
1551
1858
|
/** Frozen protocol version. */
|
|
1552
|
-
protocol_version:
|
|
1859
|
+
protocol_version: z7.string(),
|
|
1553
1860
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
1554
|
-
id:
|
|
1861
|
+
id: z7.string().min(1),
|
|
1555
1862
|
/** Direction discriminator. */
|
|
1556
|
-
direction:
|
|
1863
|
+
direction: z7.literal("response"),
|
|
1557
1864
|
/** The response body. */
|
|
1558
1865
|
response: SupervisorIpcResponseSchema
|
|
1559
1866
|
}).strict();
|
|
1560
|
-
var SupervisorIpcEnvelopeSchema =
|
|
1867
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
1561
1868
|
SupervisorIpcRequestEnvelopeSchema,
|
|
1562
1869
|
SupervisorIpcResponseEnvelopeSchema
|
|
1563
1870
|
]);
|
|
@@ -1581,17 +1888,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
1581
1888
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
1582
1889
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
1583
1890
|
*/
|
|
1584
|
-
detail:
|
|
1891
|
+
detail: z8.string().optional()
|
|
1585
1892
|
}).strict();
|
|
1586
|
-
var HealthStatusSchema =
|
|
1893
|
+
var HealthStatusSchema = z8.object({
|
|
1587
1894
|
/** One health row per registered subsystem. */
|
|
1588
|
-
subsystems:
|
|
1895
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
1589
1896
|
/**
|
|
1590
1897
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
1591
1898
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
1592
1899
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
1593
1900
|
*/
|
|
1594
|
-
allHealthy:
|
|
1901
|
+
allHealthy: z8.boolean()
|
|
1595
1902
|
}).strict();
|
|
1596
1903
|
|
|
1597
1904
|
// packages/contracts/src/db-inventory.json
|
|
@@ -13520,7 +13827,7 @@ var OPERATIONS = [
|
|
|
13520
13827
|
];
|
|
13521
13828
|
|
|
13522
13829
|
// packages/contracts/src/docs/modernize.ts
|
|
13523
|
-
import { z as
|
|
13830
|
+
import { z as z9 } from "zod";
|
|
13524
13831
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
13525
13832
|
var DOCS_MODERNIZE_OPS = [
|
|
13526
13833
|
"ingest",
|
|
@@ -13534,105 +13841,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
13534
13841
|
"reslug",
|
|
13535
13842
|
"link-task"
|
|
13536
13843
|
];
|
|
13537
|
-
var judgmentSchema =
|
|
13538
|
-
question:
|
|
13539
|
-
site:
|
|
13540
|
-
mode:
|
|
13541
|
-
ruleAnswer:
|
|
13542
|
-
decidedAnswer:
|
|
13543
|
-
decidedConfidence:
|
|
13544
|
-
source:
|
|
13545
|
-
acted:
|
|
13844
|
+
var judgmentSchema = z9.object({
|
|
13845
|
+
question: z9.enum(["classify", "merge"]),
|
|
13846
|
+
site: z9.string(),
|
|
13847
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
13848
|
+
ruleAnswer: z9.string(),
|
|
13849
|
+
decidedAnswer: z9.string().nullable(),
|
|
13850
|
+
decidedConfidence: z9.number().nullable(),
|
|
13851
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
13852
|
+
acted: z9.string()
|
|
13546
13853
|
});
|
|
13547
|
-
var relPath =
|
|
13548
|
-
var docsModernizePlanSchema =
|
|
13549
|
-
root:
|
|
13550
|
-
generatedAt:
|
|
13551
|
-
mode:
|
|
13552
|
-
counts:
|
|
13553
|
-
rows:
|
|
13554
|
-
|
|
13854
|
+
var relPath = z9.string().min(1).max(1024);
|
|
13855
|
+
var docsModernizePlanSchema = z9.object({
|
|
13856
|
+
root: z9.string().min(1),
|
|
13857
|
+
generatedAt: z9.string(),
|
|
13858
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
13859
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
13860
|
+
rows: z9.array(
|
|
13861
|
+
z9.object({
|
|
13555
13862
|
path: relPath,
|
|
13556
|
-
sha256:
|
|
13557
|
-
kind:
|
|
13558
|
-
slug:
|
|
13559
|
-
title:
|
|
13560
|
-
disposition:
|
|
13561
|
-
target:
|
|
13562
|
-
reasons:
|
|
13563
|
-
judgments:
|
|
13564
|
-
ownerTasks:
|
|
13565
|
-
category:
|
|
13566
|
-
refs:
|
|
13567
|
-
overridden:
|
|
13568
|
-
covers:
|
|
13569
|
-
baselineRemove:
|
|
13863
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
13864
|
+
kind: z9.string().min(1),
|
|
13865
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
13866
|
+
title: z9.string(),
|
|
13867
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
13868
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
13869
|
+
reasons: z9.array(z9.string()),
|
|
13870
|
+
judgments: z9.array(judgmentSchema),
|
|
13871
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
13872
|
+
category: z9.string(),
|
|
13873
|
+
refs: z9.array(z9.string()),
|
|
13874
|
+
overridden: z9.boolean(),
|
|
13875
|
+
covers: z9.array(z9.string()),
|
|
13876
|
+
baselineRemove: z9.boolean()
|
|
13570
13877
|
})
|
|
13571
13878
|
),
|
|
13572
|
-
linkFixes:
|
|
13573
|
-
|
|
13574
|
-
kind:
|
|
13879
|
+
linkFixes: z9.array(
|
|
13880
|
+
z9.object({
|
|
13881
|
+
kind: z9.literal("link-fix"),
|
|
13575
13882
|
path: relPath,
|
|
13576
|
-
href:
|
|
13577
|
-
newHref:
|
|
13578
|
-
base:
|
|
13579
|
-
sha256:
|
|
13883
|
+
href: z9.string().min(1).max(2048),
|
|
13884
|
+
newHref: z9.string().min(1).max(2048),
|
|
13885
|
+
base: z9.literal("repo").optional(),
|
|
13886
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
13580
13887
|
})
|
|
13581
13888
|
).optional(),
|
|
13582
|
-
repoRoot:
|
|
13889
|
+
repoRoot: z9.string().min(1).optional()
|
|
13583
13890
|
});
|
|
13584
|
-
var docsModernizeOverridesSchema =
|
|
13891
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
13585
13892
|
relPath,
|
|
13586
|
-
|
|
13587
|
-
disposition:
|
|
13588
|
-
target:
|
|
13589
|
-
reason:
|
|
13590
|
-
kind:
|
|
13591
|
-
slug:
|
|
13592
|
-
covers:
|
|
13893
|
+
z9.object({
|
|
13894
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
13895
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
13896
|
+
reason: z9.string().min(1),
|
|
13897
|
+
kind: z9.string().min(1).optional(),
|
|
13898
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
13899
|
+
covers: z9.array(z9.string()).optional()
|
|
13593
13900
|
})
|
|
13594
13901
|
);
|
|
13595
|
-
var receiptOpSchema =
|
|
13596
|
-
op:
|
|
13597
|
-
state:
|
|
13598
|
-
slug:
|
|
13902
|
+
var receiptOpSchema = z9.object({
|
|
13903
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
13904
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
13905
|
+
slug: z9.string().nullable(),
|
|
13599
13906
|
path: relPath.nullable(),
|
|
13600
|
-
target:
|
|
13601
|
-
attachmentId:
|
|
13602
|
-
ownerId:
|
|
13603
|
-
beforeSha256:
|
|
13604
|
-
afterSha256:
|
|
13605
|
-
prior:
|
|
13606
|
-
lifecycleStatus:
|
|
13607
|
-
supersededBy:
|
|
13608
|
-
supersedes:
|
|
13609
|
-
previousAttachmentId:
|
|
13610
|
-
newAttachmentId:
|
|
13611
|
-
linkTargets:
|
|
13612
|
-
kind:
|
|
13907
|
+
target: z9.string().nullable(),
|
|
13908
|
+
attachmentId: z9.string().nullable(),
|
|
13909
|
+
ownerId: z9.string().nullable(),
|
|
13910
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
13911
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
13912
|
+
prior: z9.object({
|
|
13913
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
13914
|
+
supersededBy: z9.string().nullable().optional(),
|
|
13915
|
+
supersedes: z9.string().nullable().optional(),
|
|
13916
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
13917
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
13918
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
13919
|
+
kind: z9.string().nullable().optional()
|
|
13613
13920
|
}).optional(),
|
|
13614
|
-
base:
|
|
13921
|
+
base: z9.literal("repo").optional()
|
|
13615
13922
|
});
|
|
13616
13923
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
13617
|
-
i:
|
|
13924
|
+
i: z9.number().int().min(0)
|
|
13618
13925
|
});
|
|
13619
|
-
var docsModernizeReceiptSchema =
|
|
13620
|
-
runId:
|
|
13621
|
-
root:
|
|
13622
|
-
appliedAt:
|
|
13623
|
-
planSha256:
|
|
13624
|
-
edgeCount:
|
|
13625
|
-
rolledBackAt:
|
|
13626
|
-
blobs:
|
|
13627
|
-
moves:
|
|
13628
|
-
deleted:
|
|
13629
|
-
ops:
|
|
13630
|
-
durationMs:
|
|
13631
|
-
repoRoot:
|
|
13926
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
13927
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
13928
|
+
root: z9.string().min(1),
|
|
13929
|
+
appliedAt: z9.string(),
|
|
13930
|
+
planSha256: z9.string(),
|
|
13931
|
+
edgeCount: z9.number(),
|
|
13932
|
+
rolledBackAt: z9.string().nullable(),
|
|
13933
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
13934
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
13935
|
+
deleted: z9.array(relPath),
|
|
13936
|
+
ops: z9.array(receiptOpSchema),
|
|
13937
|
+
durationMs: z9.number().optional(),
|
|
13938
|
+
repoRoot: z9.string().min(1).optional()
|
|
13632
13939
|
});
|
|
13633
13940
|
|
|
13634
13941
|
// packages/contracts/src/docs/provenance.ts
|
|
13635
|
-
import { z as
|
|
13942
|
+
import { z as z10 } from "zod";
|
|
13636
13943
|
var PROVENANCE_NODE_KINDS = [
|
|
13637
13944
|
"doc",
|
|
13638
13945
|
"task",
|
|
@@ -13655,96 +13962,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
13655
13962
|
"archived",
|
|
13656
13963
|
"draft"
|
|
13657
13964
|
];
|
|
13658
|
-
var provenanceNodeKindSchema =
|
|
13659
|
-
var provenanceEdgeRelationSchema =
|
|
13660
|
-
var docLifecycleStatusSchema =
|
|
13965
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
13966
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
13967
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
13661
13968
|
var provenanceNodeBaseFields = {
|
|
13662
|
-
id:
|
|
13663
|
-
title:
|
|
13664
|
-
metadata:
|
|
13969
|
+
id: z10.string().min(1),
|
|
13970
|
+
title: z10.string().min(1),
|
|
13971
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
13665
13972
|
};
|
|
13666
|
-
var provenanceDocNodeSchema =
|
|
13973
|
+
var provenanceDocNodeSchema = z10.object({
|
|
13667
13974
|
...provenanceNodeBaseFields,
|
|
13668
|
-
kind:
|
|
13669
|
-
slug:
|
|
13670
|
-
docKind:
|
|
13975
|
+
kind: z10.literal("doc"),
|
|
13976
|
+
slug: z10.string().min(1),
|
|
13977
|
+
docKind: z10.string().min(1),
|
|
13671
13978
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
13672
|
-
publishedAt:
|
|
13673
|
-
supersededAt:
|
|
13674
|
-
summary:
|
|
13979
|
+
publishedAt: z10.string().min(1),
|
|
13980
|
+
supersededAt: z10.string().min(1).optional(),
|
|
13981
|
+
summary: z10.string().optional()
|
|
13675
13982
|
});
|
|
13676
|
-
var provenanceTaskNodeSchema =
|
|
13983
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
13677
13984
|
...provenanceNodeBaseFields,
|
|
13678
|
-
kind:
|
|
13679
|
-
taskType:
|
|
13680
|
-
status:
|
|
13985
|
+
kind: z10.literal("task"),
|
|
13986
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
13987
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
13681
13988
|
});
|
|
13682
|
-
var provenanceDecisionNodeSchema =
|
|
13989
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
13683
13990
|
...provenanceNodeBaseFields,
|
|
13684
|
-
kind:
|
|
13685
|
-
outcome:
|
|
13686
|
-
decidedAt:
|
|
13991
|
+
kind: z10.literal("decision"),
|
|
13992
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
13993
|
+
decidedAt: z10.string().min(1)
|
|
13687
13994
|
});
|
|
13688
|
-
var provenanceSessionNodeSchema =
|
|
13995
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
13689
13996
|
...provenanceNodeBaseFields,
|
|
13690
|
-
kind:
|
|
13691
|
-
startedAt:
|
|
13692
|
-
endedAt:
|
|
13997
|
+
kind: z10.literal("session"),
|
|
13998
|
+
startedAt: z10.string().min(1),
|
|
13999
|
+
endedAt: z10.string().min(1).optional()
|
|
13693
14000
|
});
|
|
13694
|
-
var provenanceMemoryNodeSchema =
|
|
14001
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
13695
14002
|
...provenanceNodeBaseFields,
|
|
13696
|
-
kind:
|
|
13697
|
-
memoryType:
|
|
13698
|
-
recordedAt:
|
|
14003
|
+
kind: z10.literal("memory"),
|
|
14004
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
14005
|
+
recordedAt: z10.string().min(1)
|
|
13699
14006
|
});
|
|
13700
|
-
var provenanceNodeSchema =
|
|
14007
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
13701
14008
|
provenanceDocNodeSchema,
|
|
13702
14009
|
provenanceTaskNodeSchema,
|
|
13703
14010
|
provenanceDecisionNodeSchema,
|
|
13704
14011
|
provenanceSessionNodeSchema,
|
|
13705
14012
|
provenanceMemoryNodeSchema
|
|
13706
14013
|
]);
|
|
13707
|
-
var provenanceEdgeSchema =
|
|
14014
|
+
var provenanceEdgeSchema = z10.object({
|
|
13708
14015
|
relation: provenanceEdgeRelationSchema,
|
|
13709
|
-
from:
|
|
14016
|
+
from: z10.string().min(1),
|
|
13710
14017
|
fromKind: provenanceNodeKindSchema,
|
|
13711
|
-
to:
|
|
14018
|
+
to: z10.string().min(1),
|
|
13712
14019
|
toKind: provenanceNodeKindSchema,
|
|
13713
|
-
addedAt:
|
|
13714
|
-
summary:
|
|
14020
|
+
addedAt: z10.string().min(1),
|
|
14021
|
+
summary: z10.string().optional()
|
|
13715
14022
|
});
|
|
13716
|
-
var docProvenanceResponseSchema =
|
|
13717
|
-
nodes:
|
|
13718
|
-
edges:
|
|
13719
|
-
totalNodes:
|
|
13720
|
-
totalEdges:
|
|
14023
|
+
var docProvenanceResponseSchema = z10.object({
|
|
14024
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
14025
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
14026
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
14027
|
+
totalEdges: z10.number().int().nonnegative()
|
|
13721
14028
|
});
|
|
13722
14029
|
|
|
13723
14030
|
// packages/contracts/src/docs/read.ts
|
|
13724
|
-
import { z as
|
|
13725
|
-
var docFrontmatterSchema =
|
|
13726
|
-
slug:
|
|
13727
|
-
kind:
|
|
13728
|
-
title:
|
|
13729
|
-
summary:
|
|
13730
|
-
lifecycleStatus:
|
|
13731
|
-
docVersion:
|
|
13732
|
-
ownerVersion:
|
|
13733
|
-
supersedes:
|
|
13734
|
-
supersededBy:
|
|
13735
|
-
topics:
|
|
13736
|
-
relatedTasks:
|
|
13737
|
-
sha256:
|
|
13738
|
-
createdAt:
|
|
14031
|
+
import { z as z11 } from "zod";
|
|
14032
|
+
var docFrontmatterSchema = z11.object({
|
|
14033
|
+
slug: z11.string(),
|
|
14034
|
+
kind: z11.string().nullable(),
|
|
14035
|
+
title: z11.string().nullable(),
|
|
14036
|
+
summary: z11.string().nullable(),
|
|
14037
|
+
lifecycleStatus: z11.string(),
|
|
14038
|
+
docVersion: z11.number().int(),
|
|
14039
|
+
ownerVersion: z11.string().nullable(),
|
|
14040
|
+
supersedes: z11.string().nullable(),
|
|
14041
|
+
supersededBy: z11.string().nullable(),
|
|
14042
|
+
topics: z11.array(z11.string()).readonly(),
|
|
14043
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
14044
|
+
sha256: z11.string(),
|
|
14045
|
+
createdAt: z11.string()
|
|
13739
14046
|
});
|
|
13740
|
-
var docBodySchema =
|
|
13741
|
-
encoding:
|
|
13742
|
-
text:
|
|
13743
|
-
base64:
|
|
13744
|
-
sizeBytes:
|
|
13745
|
-
mimeType:
|
|
14047
|
+
var docBodySchema = z11.object({
|
|
14048
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
14049
|
+
text: z11.string().optional(),
|
|
14050
|
+
base64: z11.string().optional(),
|
|
14051
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
14052
|
+
mimeType: z11.string().nullable()
|
|
13746
14053
|
});
|
|
13747
|
-
var docReadResponseSchema =
|
|
14054
|
+
var docReadResponseSchema = z11.object({
|
|
13748
14055
|
frontmatter: docFrontmatterSchema,
|
|
13749
14056
|
body: docBodySchema
|
|
13750
14057
|
});
|
|
@@ -13917,7 +14224,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
|
|
|
13917
14224
|
}
|
|
13918
14225
|
|
|
13919
14226
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
13920
|
-
import { z as
|
|
14227
|
+
import { z as z12 } from "zod";
|
|
13921
14228
|
var EVIDENCE_ATOM_KINDS = [
|
|
13922
14229
|
"commit",
|
|
13923
14230
|
"files",
|
|
@@ -13939,96 +14246,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
13939
14246
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
13940
14247
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
13941
14248
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
13942
|
-
var commitAtomSchema =
|
|
13943
|
-
kind:
|
|
13944
|
-
sha:
|
|
14249
|
+
var commitAtomSchema = z12.object({
|
|
14250
|
+
kind: z12.literal("commit"),
|
|
14251
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
13945
14252
|
});
|
|
13946
|
-
var filesAtomSchema =
|
|
13947
|
-
kind:
|
|
13948
|
-
paths:
|
|
14253
|
+
var filesAtomSchema = z12.object({
|
|
14254
|
+
kind: z12.literal("files"),
|
|
14255
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
13949
14256
|
});
|
|
13950
|
-
var testRunAtomSchema =
|
|
13951
|
-
kind:
|
|
13952
|
-
path:
|
|
14257
|
+
var testRunAtomSchema = z12.object({
|
|
14258
|
+
kind: z12.literal("test-run"),
|
|
14259
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
13953
14260
|
});
|
|
13954
|
-
var qaRunAtomSchema =
|
|
13955
|
-
kind:
|
|
13956
|
-
path:
|
|
14261
|
+
var qaRunAtomSchema = z12.object({
|
|
14262
|
+
kind: z12.literal("qa-run"),
|
|
14263
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
13957
14264
|
});
|
|
13958
|
-
var toolAtomSchema =
|
|
13959
|
-
kind:
|
|
13960
|
-
tool:
|
|
14265
|
+
var toolAtomSchema = z12.object({
|
|
14266
|
+
kind: z12.literal("tool"),
|
|
14267
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
13961
14268
|
});
|
|
13962
|
-
var urlAtomSchema =
|
|
13963
|
-
kind:
|
|
13964
|
-
url:
|
|
14269
|
+
var urlAtomSchema = z12.object({
|
|
14270
|
+
kind: z12.literal("url"),
|
|
14271
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
13965
14272
|
});
|
|
13966
|
-
var noteAtomSchema =
|
|
13967
|
-
kind:
|
|
13968
|
-
note:
|
|
14273
|
+
var noteAtomSchema = z12.object({
|
|
14274
|
+
kind: z12.literal("note"),
|
|
14275
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
13969
14276
|
});
|
|
13970
|
-
var decisionAtomSchema =
|
|
13971
|
-
kind:
|
|
13972
|
-
decisionId:
|
|
14277
|
+
var decisionAtomSchema = z12.object({
|
|
14278
|
+
kind: z12.literal("decision"),
|
|
14279
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
13973
14280
|
});
|
|
13974
|
-
var prAtomSchema =
|
|
13975
|
-
kind:
|
|
13976
|
-
prNumber:
|
|
13977
|
-
componentPrNumber:
|
|
14281
|
+
var prAtomSchema = z12.object({
|
|
14282
|
+
kind: z12.literal("pr"),
|
|
14283
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
14284
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
13978
14285
|
/**
|
|
13979
14286
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
13980
14287
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
13981
14288
|
* `origin`, since PR numbers are only unique per repository.
|
|
13982
14289
|
*/
|
|
13983
|
-
repo:
|
|
14290
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
13984
14291
|
});
|
|
13985
|
-
var ciAtomSchema =
|
|
13986
|
-
kind:
|
|
13987
|
-
prNumber:
|
|
13988
|
-
componentPrNumber:
|
|
14292
|
+
var ciAtomSchema = z12.object({
|
|
14293
|
+
kind: z12.literal("ci"),
|
|
14294
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
14295
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
13989
14296
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
13990
|
-
repo:
|
|
14297
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
13991
14298
|
});
|
|
13992
|
-
var ciRunAtomSchema =
|
|
13993
|
-
kind:
|
|
13994
|
-
runId:
|
|
14299
|
+
var ciRunAtomSchema = z12.object({
|
|
14300
|
+
kind: z12.literal("ci-run"),
|
|
14301
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
13995
14302
|
});
|
|
13996
|
-
var deployAtomSchema =
|
|
13997
|
-
kind:
|
|
13998
|
-
provider:
|
|
13999
|
-
deploymentId:
|
|
14000
|
-
sha:
|
|
14001
|
-
probeUrl:
|
|
14303
|
+
var deployAtomSchema = z12.object({
|
|
14304
|
+
kind: z12.literal("deploy"),
|
|
14305
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
14306
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
14307
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
14308
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
14002
14309
|
});
|
|
14003
|
-
var locDropAtomSchema =
|
|
14004
|
-
kind:
|
|
14005
|
-
fromLines:
|
|
14006
|
-
toLines:
|
|
14310
|
+
var locDropAtomSchema = z12.object({
|
|
14311
|
+
kind: z12.literal("loc-drop"),
|
|
14312
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
14313
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
14007
14314
|
});
|
|
14008
|
-
var callsiteCoverageAtomSchema =
|
|
14009
|
-
kind:
|
|
14010
|
-
symbolName:
|
|
14011
|
-
relativeSourcePath:
|
|
14315
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
14316
|
+
kind: z12.literal("callsite-coverage"),
|
|
14317
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
14318
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
14012
14319
|
});
|
|
14013
14320
|
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}$/;
|
|
14014
14321
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
14015
14322
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
14016
14323
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
14017
|
-
var satisfiesAtomSchema =
|
|
14018
|
-
kind:
|
|
14324
|
+
var satisfiesAtomSchema = z12.object({
|
|
14325
|
+
kind: z12.literal("satisfies"),
|
|
14019
14326
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
14020
|
-
targetTaskId:
|
|
14327
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
14021
14328
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
14022
|
-
targetAcId:
|
|
14329
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
14023
14330
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
14024
|
-
targetAcAlias:
|
|
14331
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
14025
14332
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
14026
|
-
versionPin:
|
|
14333
|
+
versionPin: z12.string().regex(
|
|
14027
14334
|
SATISFIES_VERSION_PIN_REGEX,
|
|
14028
14335
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
14029
14336
|
).optional()
|
|
14030
14337
|
});
|
|
14031
|
-
var EvidenceAtomSchema =
|
|
14338
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
14032
14339
|
commitAtomSchema,
|
|
14033
14340
|
filesAtomSchema,
|
|
14034
14341
|
testRunAtomSchema,
|
|
@@ -14090,54 +14397,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
14090
14397
|
});
|
|
14091
14398
|
|
|
14092
14399
|
// packages/contracts/src/evidence-record-schema.ts
|
|
14093
|
-
import { z as
|
|
14094
|
-
var evidenceBaseSchema =
|
|
14400
|
+
import { z as z13 } from "zod";
|
|
14401
|
+
var evidenceBaseSchema = z13.object({
|
|
14095
14402
|
/** Identity string of the agent that produced this record. */
|
|
14096
|
-
agentIdentity:
|
|
14403
|
+
agentIdentity: z13.string().min(1),
|
|
14097
14404
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
14098
|
-
attachmentSha256:
|
|
14405
|
+
attachmentSha256: z13.string().length(64),
|
|
14099
14406
|
/** ISO 8601 timestamp at which the action ran. */
|
|
14100
|
-
ranAt:
|
|
14407
|
+
ranAt: z13.string().datetime(),
|
|
14101
14408
|
/** Wall-clock duration of the action in milliseconds. */
|
|
14102
|
-
durationMs:
|
|
14409
|
+
durationMs: z13.number().nonnegative()
|
|
14103
14410
|
});
|
|
14104
14411
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
14105
|
-
kind:
|
|
14106
|
-
phase:
|
|
14107
|
-
filesChanged:
|
|
14108
|
-
linesAdded:
|
|
14109
|
-
linesRemoved:
|
|
14412
|
+
kind: z13.literal("impl-diff"),
|
|
14413
|
+
phase: z13.literal("implement"),
|
|
14414
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
14415
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
14416
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
14110
14417
|
});
|
|
14111
14418
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
14112
|
-
kind:
|
|
14113
|
-
phase:
|
|
14114
|
-
reqIdsChecked:
|
|
14115
|
-
passed:
|
|
14116
|
-
details:
|
|
14419
|
+
kind: z13.literal("validate-spec-check"),
|
|
14420
|
+
phase: z13.literal("validate"),
|
|
14421
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
14422
|
+
passed: z13.boolean(),
|
|
14423
|
+
details: z13.string().min(1)
|
|
14117
14424
|
});
|
|
14118
14425
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14119
|
-
kind:
|
|
14120
|
-
phase:
|
|
14121
|
-
command:
|
|
14122
|
-
exitCode:
|
|
14123
|
-
testsPassed:
|
|
14124
|
-
testsFailed:
|
|
14426
|
+
kind: z13.literal("test-output"),
|
|
14427
|
+
phase: z13.literal("test"),
|
|
14428
|
+
command: z13.string().min(1),
|
|
14429
|
+
exitCode: z13.number().int(),
|
|
14430
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
14431
|
+
testsFailed: z13.number().int().nonnegative()
|
|
14125
14432
|
});
|
|
14126
14433
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
14127
|
-
kind:
|
|
14128
|
-
phase:
|
|
14129
|
-
tool:
|
|
14130
|
-
passed:
|
|
14131
|
-
warnings:
|
|
14132
|
-
errors:
|
|
14434
|
+
kind: z13.literal("lint-report"),
|
|
14435
|
+
phase: z13.enum(["implement", "test"]),
|
|
14436
|
+
tool: z13.string().min(1),
|
|
14437
|
+
passed: z13.boolean(),
|
|
14438
|
+
warnings: z13.number().int().nonnegative(),
|
|
14439
|
+
errors: z13.number().int().nonnegative()
|
|
14133
14440
|
});
|
|
14134
14441
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14135
|
-
kind:
|
|
14136
|
-
phase:
|
|
14137
|
-
cmd:
|
|
14138
|
-
exitCode:
|
|
14442
|
+
kind: z13.literal("command-output"),
|
|
14443
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
14444
|
+
cmd: z13.string().min(1),
|
|
14445
|
+
exitCode: z13.number().int()
|
|
14139
14446
|
});
|
|
14140
|
-
var evidenceRecordSchema =
|
|
14447
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
14141
14448
|
implDiffRecordSchema,
|
|
14142
14449
|
validateSpecCheckRecordSchema,
|
|
14143
14450
|
testOutputRecordSchema,
|
|
@@ -15072,107 +15379,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
15072
15379
|
});
|
|
15073
15380
|
|
|
15074
15381
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
15075
|
-
import { z as
|
|
15076
|
-
var LeaseScopeSchema =
|
|
15077
|
-
var LeaseLaneSchema =
|
|
15078
|
-
var LeaseAcquireRequestSchema =
|
|
15382
|
+
import { z as z14 } from "zod";
|
|
15383
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
15384
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
15385
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
15079
15386
|
/** Tag discriminating this request variant. */
|
|
15080
|
-
kind:
|
|
15387
|
+
kind: z14.literal("lease_acquire"),
|
|
15081
15388
|
/** The cleo.db scope being arbitrated. */
|
|
15082
15389
|
scope: LeaseScopeSchema,
|
|
15083
15390
|
/** The write lane within the scope. */
|
|
15084
15391
|
lane: LeaseLaneSchema,
|
|
15085
15392
|
/** Process+lane holder identity. */
|
|
15086
|
-
holder_id:
|
|
15393
|
+
holder_id: z14.string().min(1),
|
|
15087
15394
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
15088
|
-
priority:
|
|
15395
|
+
priority: z14.number().int().min(0).max(255),
|
|
15089
15396
|
/** Lease time-to-live in milliseconds. */
|
|
15090
|
-
ttl_ms:
|
|
15397
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15091
15398
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
15092
|
-
reentrant:
|
|
15399
|
+
reentrant: z14.boolean()
|
|
15093
15400
|
}).strict();
|
|
15094
|
-
var LeaseReleaseRequestSchema =
|
|
15401
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
15095
15402
|
/** Tag discriminating this request variant. */
|
|
15096
|
-
kind:
|
|
15403
|
+
kind: z14.literal("lease_release"),
|
|
15097
15404
|
/** The cleo.db scope being arbitrated. */
|
|
15098
15405
|
scope: LeaseScopeSchema,
|
|
15099
15406
|
/** The write lane within the scope. */
|
|
15100
15407
|
lane: LeaseLaneSchema,
|
|
15101
15408
|
/** Process+lane holder identity. */
|
|
15102
|
-
holder_id:
|
|
15409
|
+
holder_id: z14.string().min(1),
|
|
15103
15410
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
15104
|
-
epoch:
|
|
15411
|
+
epoch: z14.number().int().nonnegative()
|
|
15105
15412
|
}).strict();
|
|
15106
|
-
var LeaseRenewRequestSchema =
|
|
15413
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
15107
15414
|
/** Tag discriminating this request variant. */
|
|
15108
|
-
kind:
|
|
15415
|
+
kind: z14.literal("lease_renew"),
|
|
15109
15416
|
/** The cleo.db scope being arbitrated. */
|
|
15110
15417
|
scope: LeaseScopeSchema,
|
|
15111
15418
|
/** The write lane within the scope. */
|
|
15112
15419
|
lane: LeaseLaneSchema,
|
|
15113
15420
|
/** Process+lane holder identity. */
|
|
15114
|
-
holder_id:
|
|
15421
|
+
holder_id: z14.string().min(1),
|
|
15115
15422
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
15116
|
-
epoch:
|
|
15423
|
+
epoch: z14.number().int().nonnegative()
|
|
15117
15424
|
}).strict();
|
|
15118
|
-
var RateCheckRequestSchema =
|
|
15425
|
+
var RateCheckRequestSchema = z14.object({
|
|
15119
15426
|
/** Tag discriminating this request variant. */
|
|
15120
|
-
kind:
|
|
15427
|
+
kind: z14.literal("rate_check"),
|
|
15121
15428
|
/** The cleo.db scope being checked. */
|
|
15122
15429
|
scope: LeaseScopeSchema,
|
|
15123
15430
|
/** The write lane within the scope. */
|
|
15124
15431
|
lane: LeaseLaneSchema,
|
|
15125
15432
|
/** Estimated bytes the caller intends to write. */
|
|
15126
|
-
est_bytes:
|
|
15433
|
+
est_bytes: z14.number().int().nonnegative()
|
|
15127
15434
|
}).strict();
|
|
15128
|
-
var ToolGrantRequestSchema =
|
|
15435
|
+
var ToolGrantRequestSchema = z14.object({
|
|
15129
15436
|
/** Tag discriminating this request variant. */
|
|
15130
|
-
kind:
|
|
15437
|
+
kind: z14.literal("tool_grant"),
|
|
15131
15438
|
/** The tool name being requested. */
|
|
15132
|
-
tool:
|
|
15439
|
+
tool: z14.string().min(1),
|
|
15133
15440
|
/** The requesting holder identity. */
|
|
15134
|
-
holder_id:
|
|
15441
|
+
holder_id: z14.string().min(1)
|
|
15135
15442
|
}).strict();
|
|
15136
|
-
var QueuePriorityClassSchema =
|
|
15137
|
-
var QueueAdmitRequestSchema =
|
|
15443
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
15444
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
15138
15445
|
/** Tag discriminating this request variant. */
|
|
15139
|
-
kind:
|
|
15446
|
+
kind: z14.literal("queue_admit"),
|
|
15140
15447
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
15141
|
-
provider:
|
|
15448
|
+
provider: z14.string().min(1),
|
|
15142
15449
|
/** The caller's priority class (lead > worker > background). */
|
|
15143
15450
|
priority_class: QueuePriorityClassSchema,
|
|
15144
15451
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
15145
|
-
est_tokens:
|
|
15452
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
15146
15453
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
15147
|
-
child_id:
|
|
15454
|
+
child_id: z14.string().min(1)
|
|
15148
15455
|
}).strict();
|
|
15149
|
-
var WorkerHeartbeatRequestSchema =
|
|
15456
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
15150
15457
|
/** Tag discriminating this request variant. */
|
|
15151
|
-
kind:
|
|
15458
|
+
kind: z14.literal("worker_heartbeat"),
|
|
15152
15459
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
15153
|
-
child_id:
|
|
15460
|
+
child_id: z14.string().min(1),
|
|
15154
15461
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
15155
|
-
in_flight_llm:
|
|
15462
|
+
in_flight_llm: z14.boolean()
|
|
15156
15463
|
}).strict();
|
|
15157
|
-
var ResourceAdmitRequestSchema =
|
|
15464
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
15158
15465
|
/** Tag discriminating this request variant. */
|
|
15159
|
-
kind:
|
|
15466
|
+
kind: z14.literal("resource_admit"),
|
|
15160
15467
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
15161
|
-
class:
|
|
15468
|
+
class: z14.string().min(1),
|
|
15162
15469
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
15163
|
-
holder_id:
|
|
15470
|
+
holder_id: z14.string().min(1),
|
|
15164
15471
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
15165
|
-
budget:
|
|
15472
|
+
budget: z14.number().int().nonnegative()
|
|
15166
15473
|
}).strict();
|
|
15167
|
-
var ResourceReleaseRequestSchema =
|
|
15474
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
15168
15475
|
/** Tag discriminating this request variant. */
|
|
15169
|
-
kind:
|
|
15476
|
+
kind: z14.literal("resource_release"),
|
|
15170
15477
|
/** The resource class the slot belongs to. */
|
|
15171
|
-
class:
|
|
15478
|
+
class: z14.string().min(1),
|
|
15172
15479
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
15173
|
-
holder_id:
|
|
15480
|
+
holder_id: z14.string().min(1)
|
|
15174
15481
|
}).strict();
|
|
15175
|
-
var LeaseIpcRequestSchema =
|
|
15482
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
15176
15483
|
LeaseAcquireRequestSchema,
|
|
15177
15484
|
LeaseReleaseRequestSchema,
|
|
15178
15485
|
LeaseRenewRequestSchema,
|
|
@@ -15183,133 +15490,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
15183
15490
|
ResourceAdmitRequestSchema,
|
|
15184
15491
|
ResourceReleaseRequestSchema
|
|
15185
15492
|
]);
|
|
15186
|
-
var LeaseGrantedResponseSchema =
|
|
15493
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
15187
15494
|
/** Tag discriminating this response variant. */
|
|
15188
|
-
kind:
|
|
15495
|
+
kind: z14.literal("lease_granted"),
|
|
15189
15496
|
/** The granted cleo.db scope. */
|
|
15190
15497
|
scope: LeaseScopeSchema,
|
|
15191
15498
|
/** The granted write lane. */
|
|
15192
15499
|
lane: LeaseLaneSchema,
|
|
15193
15500
|
/** The holder the lease was granted to. */
|
|
15194
|
-
holder_id:
|
|
15501
|
+
holder_id: z14.string().min(1),
|
|
15195
15502
|
/** The monotonic epoch fence assigned to this grant. */
|
|
15196
|
-
epoch:
|
|
15503
|
+
epoch: z14.number().int().nonnegative(),
|
|
15197
15504
|
/** The lease TTL in milliseconds. */
|
|
15198
|
-
ttl_ms:
|
|
15505
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15199
15506
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
15200
|
-
expires_at_ms:
|
|
15507
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
15201
15508
|
}).strict();
|
|
15202
|
-
var LeaseQueuedResponseSchema =
|
|
15509
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
15203
15510
|
/** Tag discriminating this response variant. */
|
|
15204
|
-
kind:
|
|
15511
|
+
kind: z14.literal("lease_queued"),
|
|
15205
15512
|
/** The queued cleo.db scope. */
|
|
15206
15513
|
scope: LeaseScopeSchema,
|
|
15207
15514
|
/** The queued write lane. */
|
|
15208
15515
|
lane: LeaseLaneSchema,
|
|
15209
15516
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
15210
|
-
ticket:
|
|
15517
|
+
ticket: z14.number().int().nonnegative(),
|
|
15211
15518
|
/** Number of waiters ahead of this one. */
|
|
15212
|
-
ahead:
|
|
15519
|
+
ahead: z14.number().int().nonnegative()
|
|
15213
15520
|
}).strict();
|
|
15214
|
-
var LeaseDeniedResponseSchema =
|
|
15521
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
15215
15522
|
/** Tag discriminating this response variant. */
|
|
15216
|
-
kind:
|
|
15523
|
+
kind: z14.literal("lease_denied"),
|
|
15217
15524
|
/** The denied cleo.db scope. */
|
|
15218
15525
|
scope: LeaseScopeSchema,
|
|
15219
15526
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
15220
|
-
code:
|
|
15527
|
+
code: z14.string().min(1),
|
|
15221
15528
|
/** Human-readable denial message. */
|
|
15222
|
-
message:
|
|
15529
|
+
message: z14.string()
|
|
15223
15530
|
}).strict();
|
|
15224
|
-
var RateResultResponseSchema =
|
|
15531
|
+
var RateResultResponseSchema = z14.object({
|
|
15225
15532
|
/** Tag discriminating this response variant. */
|
|
15226
|
-
kind:
|
|
15533
|
+
kind: z14.literal("rate_result"),
|
|
15227
15534
|
/** The checked cleo.db scope. */
|
|
15228
15535
|
scope: LeaseScopeSchema,
|
|
15229
15536
|
/** Whether the write is within budget. */
|
|
15230
|
-
ok:
|
|
15537
|
+
ok: z14.boolean(),
|
|
15231
15538
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
15232
|
-
retry_after_ms:
|
|
15539
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15233
15540
|
/** Remaining token budget for the scope. */
|
|
15234
|
-
tokens_remaining:
|
|
15541
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
15235
15542
|
}).strict();
|
|
15236
|
-
var ToolGrantedResponseSchema =
|
|
15543
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
15237
15544
|
/** Tag discriminating this response variant. */
|
|
15238
|
-
kind:
|
|
15545
|
+
kind: z14.literal("tool_granted"),
|
|
15239
15546
|
/** The granted tool name. */
|
|
15240
|
-
tool:
|
|
15547
|
+
tool: z14.string().min(1),
|
|
15241
15548
|
/** The holder the tool grant was issued to. */
|
|
15242
|
-
holder_id:
|
|
15549
|
+
holder_id: z14.string().min(1)
|
|
15243
15550
|
}).strict();
|
|
15244
|
-
var LeaseRevokedResponseSchema =
|
|
15551
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
15245
15552
|
/** Tag discriminating this response variant. */
|
|
15246
|
-
kind:
|
|
15553
|
+
kind: z14.literal("lease_revoked"),
|
|
15247
15554
|
/** The revoked cleo.db scope. */
|
|
15248
15555
|
scope: LeaseScopeSchema,
|
|
15249
15556
|
/** The revoked write lane. */
|
|
15250
15557
|
lane: LeaseLaneSchema,
|
|
15251
15558
|
/** The holder whose lease was revoked. */
|
|
15252
|
-
holder_id:
|
|
15559
|
+
holder_id: z14.string().min(1),
|
|
15253
15560
|
/** Human-readable reason for the revocation. */
|
|
15254
|
-
reason:
|
|
15561
|
+
reason: z14.string()
|
|
15255
15562
|
}).strict();
|
|
15256
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
15563
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
15257
15564
|
/** Tag discriminating this response variant. */
|
|
15258
|
-
kind:
|
|
15565
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
15259
15566
|
/** Logical id of the killed child. */
|
|
15260
|
-
child_id:
|
|
15567
|
+
child_id: z14.string().min(1),
|
|
15261
15568
|
/** The holder identity the killed child held the lease as. */
|
|
15262
|
-
holder_id:
|
|
15569
|
+
holder_id: z14.string().min(1),
|
|
15263
15570
|
/** The cleo.db scope the killed child held the lease in. */
|
|
15264
15571
|
scope: LeaseScopeSchema,
|
|
15265
15572
|
/** Human-readable reason for the kill. */
|
|
15266
|
-
reason:
|
|
15573
|
+
reason: z14.string()
|
|
15267
15574
|
}).strict();
|
|
15268
|
-
var QueueAdmitDispositionSchema =
|
|
15269
|
-
var QueueAdmitResultResponseSchema =
|
|
15575
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
15576
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
15270
15577
|
/** Tag discriminating this response variant. */
|
|
15271
|
-
kind:
|
|
15578
|
+
kind: z14.literal("queue_admit_result"),
|
|
15272
15579
|
/** Whether the LLM call was admitted or deferred. */
|
|
15273
15580
|
disposition: QueueAdmitDispositionSchema,
|
|
15274
15581
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15275
|
-
retry_after_ms:
|
|
15582
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15276
15583
|
/** Remaining provider token budget after this decision. */
|
|
15277
|
-
tokens_remaining:
|
|
15584
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
15278
15585
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
15279
|
-
queue_position:
|
|
15586
|
+
queue_position: z14.number().int().nonnegative()
|
|
15280
15587
|
}).strict();
|
|
15281
|
-
var HeartbeatAckResponseSchema =
|
|
15588
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
15282
15589
|
/** Tag discriminating this response variant. */
|
|
15283
|
-
kind:
|
|
15590
|
+
kind: z14.literal("heartbeat_ack")
|
|
15284
15591
|
}).strict();
|
|
15285
|
-
var ResourceAdmitDispositionSchema =
|
|
15286
|
-
var ResourceAdmitResultResponseSchema =
|
|
15592
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
15593
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
15287
15594
|
/** Tag discriminating this response variant. */
|
|
15288
|
-
kind:
|
|
15595
|
+
kind: z14.literal("resource_admit_result"),
|
|
15289
15596
|
/** Whether the heavy op was admitted or deferred. */
|
|
15290
15597
|
disposition: ResourceAdmitDispositionSchema,
|
|
15291
15598
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15292
|
-
retry_after_ms:
|
|
15599
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15293
15600
|
/** Remaining slots for the class after this decision. */
|
|
15294
|
-
slots_remaining:
|
|
15601
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15295
15602
|
}).strict();
|
|
15296
|
-
var ResourceReleaseResultResponseSchema =
|
|
15603
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
15297
15604
|
/** Tag discriminating this response variant. */
|
|
15298
|
-
kind:
|
|
15605
|
+
kind: z14.literal("resource_release_result"),
|
|
15299
15606
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
15300
|
-
released:
|
|
15607
|
+
released: z14.boolean(),
|
|
15301
15608
|
/** Remaining in-flight holders for the class after the release. */
|
|
15302
|
-
slots_remaining:
|
|
15609
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15303
15610
|
}).strict();
|
|
15304
|
-
var LeaseErrorResponseSchema =
|
|
15611
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
15305
15612
|
/** Tag discriminating this response variant. */
|
|
15306
|
-
kind:
|
|
15613
|
+
kind: z14.literal("error"),
|
|
15307
15614
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
15308
|
-
code:
|
|
15615
|
+
code: z14.string().min(1),
|
|
15309
15616
|
/** Human-readable error message. */
|
|
15310
|
-
message:
|
|
15617
|
+
message: z14.string()
|
|
15311
15618
|
}).strict();
|
|
15312
|
-
var LeaseIpcResponseSchema =
|
|
15619
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
15313
15620
|
LeaseGrantedResponseSchema,
|
|
15314
15621
|
LeaseQueuedResponseSchema,
|
|
15315
15622
|
LeaseDeniedResponseSchema,
|
|
@@ -15323,27 +15630,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
15323
15630
|
ResourceReleaseResultResponseSchema,
|
|
15324
15631
|
LeaseErrorResponseSchema
|
|
15325
15632
|
]);
|
|
15326
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
15633
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
15327
15634
|
/** Parallel protocol version. */
|
|
15328
|
-
protocol_version:
|
|
15635
|
+
protocol_version: z14.string(),
|
|
15329
15636
|
/** Correlation id echoed back on the matching response. */
|
|
15330
|
-
id:
|
|
15637
|
+
id: z14.string().min(1),
|
|
15331
15638
|
/** Direction discriminator. */
|
|
15332
|
-
direction:
|
|
15639
|
+
direction: z14.literal("request"),
|
|
15333
15640
|
/** The request body. */
|
|
15334
15641
|
request: LeaseIpcRequestSchema
|
|
15335
15642
|
}).strict();
|
|
15336
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
15643
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
15337
15644
|
/** Parallel protocol version. */
|
|
15338
|
-
protocol_version:
|
|
15645
|
+
protocol_version: z14.string(),
|
|
15339
15646
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
15340
|
-
id:
|
|
15647
|
+
id: z14.string().min(1),
|
|
15341
15648
|
/** Direction discriminator. */
|
|
15342
|
-
direction:
|
|
15649
|
+
direction: z14.literal("response"),
|
|
15343
15650
|
/** The response body. */
|
|
15344
15651
|
response: LeaseIpcResponseSchema
|
|
15345
15652
|
}).strict();
|
|
15346
|
-
var LeaseIpcEnvelopeSchema =
|
|
15653
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
15347
15654
|
LeaseIpcRequestEnvelopeSchema,
|
|
15348
15655
|
LeaseIpcResponseEnvelopeSchema
|
|
15349
15656
|
]);
|
|
@@ -15378,7 +15685,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
15378
15685
|
];
|
|
15379
15686
|
|
|
15380
15687
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
15381
|
-
import { z as
|
|
15688
|
+
import { z as z15 } from "zod";
|
|
15382
15689
|
var CATALOG_MODEL_STATUSES = [
|
|
15383
15690
|
"stable",
|
|
15384
15691
|
"beta",
|
|
@@ -15387,78 +15694,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
15387
15694
|
"retired"
|
|
15388
15695
|
];
|
|
15389
15696
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
15390
|
-
var isoDate =
|
|
15391
|
-
var semver =
|
|
15392
|
-
var catalogModalitiesSchema =
|
|
15393
|
-
input:
|
|
15394
|
-
output:
|
|
15697
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
15698
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
15699
|
+
var catalogModalitiesSchema = z15.object({
|
|
15700
|
+
input: z15.array(z15.string()),
|
|
15701
|
+
output: z15.array(z15.string())
|
|
15395
15702
|
}).strict();
|
|
15396
|
-
var catalogCostSchema =
|
|
15397
|
-
input:
|
|
15398
|
-
output:
|
|
15399
|
-
cache_read:
|
|
15400
|
-
cache_write:
|
|
15401
|
-
context_over_200k:
|
|
15703
|
+
var catalogCostSchema = z15.object({
|
|
15704
|
+
input: z15.number().optional(),
|
|
15705
|
+
output: z15.number().optional(),
|
|
15706
|
+
cache_read: z15.number().optional(),
|
|
15707
|
+
cache_write: z15.number().optional(),
|
|
15708
|
+
context_over_200k: z15.number().optional()
|
|
15402
15709
|
}).strict();
|
|
15403
|
-
var catalogLimitSchema =
|
|
15404
|
-
context:
|
|
15405
|
-
output:
|
|
15710
|
+
var catalogLimitSchema = z15.object({
|
|
15711
|
+
context: z15.number(),
|
|
15712
|
+
output: z15.number()
|
|
15406
15713
|
}).strict();
|
|
15407
|
-
var catalogModelProviderSchema =
|
|
15408
|
-
npm:
|
|
15409
|
-
api:
|
|
15714
|
+
var catalogModelProviderSchema = z15.object({
|
|
15715
|
+
npm: z15.string(),
|
|
15716
|
+
api: z15.string()
|
|
15410
15717
|
}).strict();
|
|
15411
|
-
var catalogModelEntrySchema =
|
|
15412
|
-
id:
|
|
15413
|
-
name:
|
|
15414
|
-
family:
|
|
15415
|
-
attachment:
|
|
15416
|
-
reasoning:
|
|
15417
|
-
temperature:
|
|
15418
|
-
interleaved:
|
|
15419
|
-
tool_call:
|
|
15718
|
+
var catalogModelEntrySchema = z15.object({
|
|
15719
|
+
id: z15.string(),
|
|
15720
|
+
name: z15.string(),
|
|
15721
|
+
family: z15.string(),
|
|
15722
|
+
attachment: z15.boolean(),
|
|
15723
|
+
reasoning: z15.boolean(),
|
|
15724
|
+
temperature: z15.boolean(),
|
|
15725
|
+
interleaved: z15.boolean(),
|
|
15726
|
+
tool_call: z15.boolean(),
|
|
15420
15727
|
modalities: catalogModalitiesSchema,
|
|
15421
15728
|
cost: catalogCostSchema,
|
|
15422
15729
|
limit: catalogLimitSchema,
|
|
15423
|
-
status:
|
|
15730
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15424
15731
|
release_date: isoDate,
|
|
15425
15732
|
provider: catalogModelProviderSchema
|
|
15426
15733
|
}).strict();
|
|
15427
|
-
var catalogProviderSchema =
|
|
15428
|
-
id:
|
|
15429
|
-
endpoint:
|
|
15430
|
-
authTypes:
|
|
15431
|
-
npm:
|
|
15734
|
+
var catalogProviderSchema = z15.object({
|
|
15735
|
+
id: z15.string(),
|
|
15736
|
+
endpoint: z15.string(),
|
|
15737
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
15738
|
+
npm: z15.string().optional()
|
|
15432
15739
|
}).strict();
|
|
15433
|
-
var curatedCatalogSchema =
|
|
15434
|
-
$schema:
|
|
15740
|
+
var curatedCatalogSchema = z15.object({
|
|
15741
|
+
$schema: z15.string().optional(),
|
|
15435
15742
|
version: semver,
|
|
15436
15743
|
lastUpdated: isoDate,
|
|
15437
|
-
providers:
|
|
15438
|
-
models:
|
|
15744
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
15745
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
15439
15746
|
}).strict();
|
|
15440
|
-
var modelsCatalogRowInsertSchema =
|
|
15441
|
-
id:
|
|
15442
|
-
providerId:
|
|
15443
|
-
name:
|
|
15444
|
-
family:
|
|
15445
|
-
attachment:
|
|
15446
|
-
reasoning:
|
|
15447
|
-
temperature:
|
|
15448
|
-
interleaved:
|
|
15449
|
-
toolCall:
|
|
15450
|
-
modalities:
|
|
15451
|
-
cost:
|
|
15452
|
-
contextLimit:
|
|
15453
|
-
outputLimit:
|
|
15454
|
-
status:
|
|
15747
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
15748
|
+
id: z15.string(),
|
|
15749
|
+
providerId: z15.string(),
|
|
15750
|
+
name: z15.string(),
|
|
15751
|
+
family: z15.string(),
|
|
15752
|
+
attachment: z15.boolean(),
|
|
15753
|
+
reasoning: z15.boolean(),
|
|
15754
|
+
temperature: z15.boolean(),
|
|
15755
|
+
interleaved: z15.boolean(),
|
|
15756
|
+
toolCall: z15.boolean(),
|
|
15757
|
+
modalities: z15.string(),
|
|
15758
|
+
cost: z15.string(),
|
|
15759
|
+
contextLimit: z15.number().nullable().optional(),
|
|
15760
|
+
outputLimit: z15.number().nullable().optional(),
|
|
15761
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15455
15762
|
releaseDate: isoDate,
|
|
15456
|
-
modelsDevId:
|
|
15457
|
-
source:
|
|
15458
|
-
seededAt:
|
|
15763
|
+
modelsDevId: z15.string(),
|
|
15764
|
+
source: z15.string(),
|
|
15765
|
+
seededAt: z15.string().optional()
|
|
15459
15766
|
}).strict();
|
|
15460
15767
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
15461
|
-
seededAt:
|
|
15768
|
+
seededAt: z15.string()
|
|
15462
15769
|
});
|
|
15463
15770
|
|
|
15464
15771
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -15506,7 +15813,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
15506
15813
|
];
|
|
15507
15814
|
|
|
15508
15815
|
// packages/contracts/src/workgraph.ts
|
|
15509
|
-
import { z as
|
|
15816
|
+
import { z as z16 } from "zod";
|
|
15510
15817
|
|
|
15511
15818
|
// packages/contracts/src/status-registry.ts
|
|
15512
15819
|
var TASK_STATUSES = [
|
|
@@ -15521,10 +15828,10 @@ var TASK_STATUSES = [
|
|
|
15521
15828
|
|
|
15522
15829
|
// packages/contracts/src/workgraph.ts
|
|
15523
15830
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
15524
|
-
var taskTypeSchema =
|
|
15525
|
-
var taskPrioritySchema =
|
|
15526
|
-
var taskStatusSchema =
|
|
15527
|
-
var verificationGateSchema =
|
|
15831
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
15832
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
15833
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
15834
|
+
var verificationGateSchema = z16.enum([
|
|
15528
15835
|
"implemented",
|
|
15529
15836
|
"testsPassed",
|
|
15530
15837
|
"qaPassed",
|
|
@@ -15533,7 +15840,7 @@ var verificationGateSchema = z15.enum([
|
|
|
15533
15840
|
"documented",
|
|
15534
15841
|
"nexusImpact"
|
|
15535
15842
|
]);
|
|
15536
|
-
var workGraphRelationKindSchema =
|
|
15843
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
15537
15844
|
"contains",
|
|
15538
15845
|
"depends_on",
|
|
15539
15846
|
"blocks",
|
|
@@ -15541,317 +15848,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
15541
15848
|
"groups",
|
|
15542
15849
|
"satisfies"
|
|
15543
15850
|
]);
|
|
15544
|
-
var workGraphTraversalDirectionSchema =
|
|
15851
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
15545
15852
|
"ancestors",
|
|
15546
15853
|
"descendants",
|
|
15547
15854
|
"upstream",
|
|
15548
15855
|
"downstream"
|
|
15549
15856
|
]);
|
|
15550
|
-
var workGraphEdgeDirectionSchema =
|
|
15551
|
-
var paginationParamsSchema =
|
|
15552
|
-
cursor:
|
|
15553
|
-
limit:
|
|
15857
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
15858
|
+
var paginationParamsSchema = z16.object({
|
|
15859
|
+
cursor: z16.string().min(1).optional(),
|
|
15860
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
15554
15861
|
});
|
|
15555
|
-
var workGraphNodeSchema =
|
|
15556
|
-
id:
|
|
15862
|
+
var workGraphNodeSchema = z16.object({
|
|
15863
|
+
id: z16.string().min(1),
|
|
15557
15864
|
type: taskTypeSchema,
|
|
15558
|
-
title:
|
|
15865
|
+
title: z16.string(),
|
|
15559
15866
|
status: taskStatusSchema,
|
|
15560
15867
|
priority: taskPrioritySchema,
|
|
15561
|
-
parentId:
|
|
15868
|
+
parentId: z16.string().min(1).optional()
|
|
15562
15869
|
});
|
|
15563
|
-
var workGraphEdgeSchema =
|
|
15564
|
-
fromId:
|
|
15565
|
-
toId:
|
|
15870
|
+
var workGraphEdgeSchema = z16.object({
|
|
15871
|
+
fromId: z16.string().min(1),
|
|
15872
|
+
toId: z16.string().min(1),
|
|
15566
15873
|
kind: workGraphRelationKindSchema
|
|
15567
15874
|
});
|
|
15568
|
-
var workGraphHierarchyEdgeSchema =
|
|
15569
|
-
fromId:
|
|
15570
|
-
toId:
|
|
15571
|
-
kind:
|
|
15875
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
15876
|
+
fromId: z16.string().min(1),
|
|
15877
|
+
toId: z16.string().min(1),
|
|
15878
|
+
kind: z16.literal("contains")
|
|
15572
15879
|
}).strict();
|
|
15573
|
-
var workGraphPageInfoSchema =
|
|
15574
|
-
nextCursor:
|
|
15575
|
-
hasMore:
|
|
15880
|
+
var workGraphPageInfoSchema = z16.object({
|
|
15881
|
+
nextCursor: z16.string().min(1).optional(),
|
|
15882
|
+
hasMore: z16.boolean()
|
|
15576
15883
|
});
|
|
15577
|
-
var workGraphRollupCountsSchema =
|
|
15578
|
-
total:
|
|
15579
|
-
byStatus:
|
|
15580
|
-
byType:
|
|
15884
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
15885
|
+
total: z16.number().int().nonnegative(),
|
|
15886
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
15887
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
15581
15888
|
});
|
|
15582
|
-
var workGraphSubtreePercentagesSchema =
|
|
15583
|
-
done:
|
|
15584
|
-
active:
|
|
15585
|
-
blocked:
|
|
15586
|
-
pending:
|
|
15587
|
-
cancelled:
|
|
15889
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
15890
|
+
done: z16.number().nonnegative(),
|
|
15891
|
+
active: z16.number().nonnegative(),
|
|
15892
|
+
blocked: z16.number().nonnegative(),
|
|
15893
|
+
pending: z16.number().nonnegative(),
|
|
15894
|
+
cancelled: z16.number().nonnegative()
|
|
15588
15895
|
});
|
|
15589
|
-
var workGraphProjectionMismatchSchema =
|
|
15590
|
-
field:
|
|
15591
|
-
expected:
|
|
15592
|
-
actual:
|
|
15896
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
15897
|
+
field: z16.string().min(1),
|
|
15898
|
+
expected: z16.number().int().nonnegative(),
|
|
15899
|
+
actual: z16.number().int().nonnegative()
|
|
15593
15900
|
});
|
|
15594
15901
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
15595
|
-
role:
|
|
15596
|
-
dependencyBlockers:
|
|
15597
|
-
gateBlockers:
|
|
15902
|
+
role: z16.string().min(1).optional(),
|
|
15903
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
15904
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
15598
15905
|
});
|
|
15599
15906
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
15600
|
-
source:
|
|
15601
|
-
relationType:
|
|
15602
|
-
reason:
|
|
15907
|
+
source: z16.literal("relation"),
|
|
15908
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
15909
|
+
reason: z16.string().min(1).optional()
|
|
15603
15910
|
});
|
|
15604
15911
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
15605
|
-
source:
|
|
15606
|
-
kind:
|
|
15912
|
+
source: z16.literal("dependency"),
|
|
15913
|
+
kind: z16.literal("depends_on")
|
|
15607
15914
|
});
|
|
15608
|
-
var workGraphOmissionReasonSchema =
|
|
15915
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
15609
15916
|
"budget_exceeded",
|
|
15610
15917
|
"not_requested",
|
|
15611
15918
|
"not_available",
|
|
15612
15919
|
"redacted",
|
|
15613
15920
|
"truncated"
|
|
15614
15921
|
]);
|
|
15615
|
-
var workGraphContextBudgetSchema =
|
|
15616
|
-
tokenBudget:
|
|
15617
|
-
estimatedTokens:
|
|
15618
|
-
remainingTokens:
|
|
15619
|
-
truncated:
|
|
15922
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
15923
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
15924
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
15925
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
15926
|
+
truncated: z16.boolean()
|
|
15620
15927
|
});
|
|
15621
|
-
var workGraphOmissionSchema =
|
|
15622
|
-
path:
|
|
15928
|
+
var workGraphOmissionSchema = z16.object({
|
|
15929
|
+
path: z16.string().min(1),
|
|
15623
15930
|
reason: workGraphOmissionReasonSchema,
|
|
15624
|
-
message:
|
|
15625
|
-
estimatedTokens:
|
|
15931
|
+
message: z16.string().min(1),
|
|
15932
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
15626
15933
|
});
|
|
15627
|
-
var workGraphDirectEdgeSchema =
|
|
15934
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
15628
15935
|
workGraphRelationEdgeSchema,
|
|
15629
15936
|
workGraphDependencyEdgeSchema
|
|
15630
15937
|
]);
|
|
15631
15938
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
15632
|
-
rootId:
|
|
15633
|
-
tokenBudget:
|
|
15634
|
-
includeRelations:
|
|
15635
|
-
includeReadiness:
|
|
15636
|
-
includeRollup:
|
|
15939
|
+
rootId: z16.string().min(1),
|
|
15940
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
15941
|
+
includeRelations: z16.boolean().optional(),
|
|
15942
|
+
includeReadiness: z16.boolean().optional(),
|
|
15943
|
+
includeRollup: z16.boolean().optional()
|
|
15637
15944
|
});
|
|
15638
15945
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
15639
|
-
rootId:
|
|
15946
|
+
rootId: z16.string().min(1),
|
|
15640
15947
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
15641
|
-
maxDepth:
|
|
15642
|
-
includeRelations:
|
|
15948
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
15949
|
+
includeRelations: z16.boolean().optional()
|
|
15643
15950
|
});
|
|
15644
|
-
var workGraphSliceSchema =
|
|
15645
|
-
rootId:
|
|
15951
|
+
var workGraphSliceSchema = z16.object({
|
|
15952
|
+
rootId: z16.string().min(1),
|
|
15646
15953
|
direction: workGraphTraversalDirectionSchema,
|
|
15647
|
-
nodes:
|
|
15648
|
-
edges:
|
|
15954
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
15955
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
15649
15956
|
pageInfo: workGraphPageInfoSchema,
|
|
15650
|
-
omissions:
|
|
15957
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
15651
15958
|
});
|
|
15652
|
-
var workGraphReadinessParamsSchema =
|
|
15653
|
-
rootId:
|
|
15654
|
-
role:
|
|
15655
|
-
includeGateBlockers:
|
|
15959
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
15960
|
+
rootId: z16.string().min(1),
|
|
15961
|
+
role: z16.string().min(1).optional(),
|
|
15962
|
+
includeGateBlockers: z16.boolean().optional()
|
|
15656
15963
|
});
|
|
15657
|
-
var workGraphReadinessResultSchema =
|
|
15658
|
-
rootId:
|
|
15659
|
-
role:
|
|
15660
|
-
ready:
|
|
15661
|
-
warnings:
|
|
15662
|
-
groups:
|
|
15663
|
-
ready:
|
|
15664
|
-
blocked:
|
|
15665
|
-
blockedBy:
|
|
15666
|
-
|
|
15667
|
-
|
|
15668
|
-
kind:
|
|
15669
|
-
blockerId:
|
|
15670
|
-
blocks:
|
|
15964
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
15965
|
+
rootId: z16.string().min(1),
|
|
15966
|
+
role: z16.string().min(1).optional(),
|
|
15967
|
+
ready: z16.boolean(),
|
|
15968
|
+
warnings: z16.array(z16.string()),
|
|
15969
|
+
groups: z16.object({
|
|
15970
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
15971
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
15972
|
+
blockedBy: z16.array(
|
|
15973
|
+
z16.discriminatedUnion("kind", [
|
|
15974
|
+
z16.object({
|
|
15975
|
+
kind: z16.literal("dependency"),
|
|
15976
|
+
blockerId: z16.string().min(1),
|
|
15977
|
+
blocks: z16.array(z16.string().min(1))
|
|
15671
15978
|
}),
|
|
15672
|
-
|
|
15673
|
-
kind:
|
|
15979
|
+
z16.object({
|
|
15980
|
+
kind: z16.literal("gate"),
|
|
15674
15981
|
gate: verificationGateSchema,
|
|
15675
|
-
blocks:
|
|
15982
|
+
blocks: z16.array(z16.string().min(1))
|
|
15676
15983
|
})
|
|
15677
15984
|
])
|
|
15678
15985
|
)
|
|
15679
15986
|
})
|
|
15680
15987
|
});
|
|
15681
|
-
var workGraphContextPackSchema =
|
|
15682
|
-
rootId:
|
|
15683
|
-
generatedAt:
|
|
15988
|
+
var workGraphContextPackSchema = z16.object({
|
|
15989
|
+
rootId: z16.string().min(1),
|
|
15990
|
+
generatedAt: z16.string().min(1),
|
|
15684
15991
|
budget: workGraphContextBudgetSchema,
|
|
15685
15992
|
slice: workGraphSliceSchema,
|
|
15686
|
-
relationEdges:
|
|
15687
|
-
rootId:
|
|
15993
|
+
relationEdges: z16.object({
|
|
15994
|
+
rootId: z16.string().min(1),
|
|
15688
15995
|
direction: workGraphEdgeDirectionSchema,
|
|
15689
|
-
edges:
|
|
15996
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
15690
15997
|
}).optional(),
|
|
15691
15998
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
15692
|
-
rollup:
|
|
15693
|
-
omissions:
|
|
15999
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
16000
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
15694
16001
|
});
|
|
15695
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
15696
|
-
rootId:
|
|
15697
|
-
nodes:
|
|
15698
|
-
|
|
15699
|
-
id:
|
|
16002
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
16003
|
+
rootId: z16.string().min(1),
|
|
16004
|
+
nodes: z16.array(
|
|
16005
|
+
z16.object({
|
|
16006
|
+
id: z16.string().min(1),
|
|
15700
16007
|
type: taskTypeSchema,
|
|
15701
|
-
parentId:
|
|
16008
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
15702
16009
|
})
|
|
15703
16010
|
),
|
|
15704
|
-
edges:
|
|
15705
|
-
dryRun:
|
|
16011
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
16012
|
+
dryRun: z16.boolean().optional()
|
|
15706
16013
|
});
|
|
15707
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
15708
|
-
code:
|
|
15709
|
-
message:
|
|
15710
|
-
taskId:
|
|
15711
|
-
severity:
|
|
16014
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
16015
|
+
code: z16.string().min(1),
|
|
16016
|
+
message: z16.string().min(1),
|
|
16017
|
+
taskId: z16.string().min(1).optional(),
|
|
16018
|
+
severity: z16.enum(["error", "warning"])
|
|
15712
16019
|
});
|
|
15713
|
-
var workGraphScaffoldValidateResultSchema =
|
|
15714
|
-
rootId:
|
|
15715
|
-
valid:
|
|
15716
|
-
dryRun:
|
|
15717
|
-
issues:
|
|
15718
|
-
hierarchy:
|
|
15719
|
-
valid:
|
|
15720
|
-
violations:
|
|
15721
|
-
|
|
15722
|
-
code:
|
|
15723
|
-
taskId:
|
|
16020
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
16021
|
+
rootId: z16.string().min(1),
|
|
16022
|
+
valid: z16.boolean(),
|
|
16023
|
+
dryRun: z16.boolean(),
|
|
16024
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
16025
|
+
hierarchy: z16.object({
|
|
16026
|
+
valid: z16.boolean(),
|
|
16027
|
+
violations: z16.array(
|
|
16028
|
+
z16.object({
|
|
16029
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16030
|
+
taskId: z16.string().min(1),
|
|
15724
16031
|
taskType: taskTypeSchema,
|
|
15725
|
-
parentId:
|
|
16032
|
+
parentId: z16.string().min(1).nullable(),
|
|
15726
16033
|
parentType: taskTypeSchema.optional(),
|
|
15727
|
-
message:
|
|
16034
|
+
message: z16.string().min(1)
|
|
15728
16035
|
})
|
|
15729
16036
|
)
|
|
15730
16037
|
})
|
|
15731
16038
|
});
|
|
15732
16039
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
15733
|
-
apply:
|
|
16040
|
+
apply: z16.boolean().optional()
|
|
15734
16041
|
});
|
|
15735
16042
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
15736
|
-
applied:
|
|
15737
|
-
nodesChanged:
|
|
15738
|
-
edgesChanged:
|
|
16043
|
+
applied: z16.boolean(),
|
|
16044
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
16045
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
15739
16046
|
});
|
|
15740
|
-
var workGraphPlanningDocParamsSchema =
|
|
15741
|
-
rootId:
|
|
15742
|
-
audience:
|
|
15743
|
-
tokenBudget:
|
|
15744
|
-
includeRelations:
|
|
15745
|
-
includeReadiness:
|
|
15746
|
-
includeRollup:
|
|
16047
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
16048
|
+
rootId: z16.string().min(1),
|
|
16049
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16050
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16051
|
+
includeRelations: z16.boolean().optional(),
|
|
16052
|
+
includeReadiness: z16.boolean().optional(),
|
|
16053
|
+
includeRollup: z16.boolean().optional()
|
|
15747
16054
|
});
|
|
15748
|
-
var workGraphPlanningDocSchema =
|
|
15749
|
-
rootId:
|
|
15750
|
-
generatedAt:
|
|
15751
|
-
audience:
|
|
15752
|
-
title:
|
|
15753
|
-
content:
|
|
15754
|
-
sections:
|
|
15755
|
-
estimatedTokens:
|
|
15756
|
-
budget:
|
|
15757
|
-
tokenBudget:
|
|
15758
|
-
truncated:
|
|
16055
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
16056
|
+
rootId: z16.string().min(1),
|
|
16057
|
+
generatedAt: z16.string().min(1),
|
|
16058
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16059
|
+
title: z16.string().min(1),
|
|
16060
|
+
content: z16.string(),
|
|
16061
|
+
sections: z16.array(z16.string().min(1)),
|
|
16062
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16063
|
+
budget: z16.object({
|
|
16064
|
+
tokenBudget: z16.number().int().positive(),
|
|
16065
|
+
truncated: z16.boolean()
|
|
15759
16066
|
}).optional()
|
|
15760
16067
|
});
|
|
15761
16068
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
15762
|
-
rootId:
|
|
16069
|
+
rootId: z16.string().min(1),
|
|
15763
16070
|
direction: workGraphTraversalDirectionSchema,
|
|
15764
|
-
maxDepth:
|
|
15765
|
-
includeRelations:
|
|
16071
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16072
|
+
includeRelations: z16.boolean().optional()
|
|
15766
16073
|
});
|
|
15767
|
-
var tasksTraverseResultSchema =
|
|
15768
|
-
rootId:
|
|
16074
|
+
var tasksTraverseResultSchema = z16.object({
|
|
16075
|
+
rootId: z16.string().min(1),
|
|
15769
16076
|
direction: workGraphTraversalDirectionSchema,
|
|
15770
|
-
nodes:
|
|
15771
|
-
edges:
|
|
16077
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16078
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
15772
16079
|
pageInfo: workGraphPageInfoSchema
|
|
15773
16080
|
});
|
|
15774
16081
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
15775
|
-
rootId:
|
|
15776
|
-
maxDepth:
|
|
16082
|
+
rootId: z16.string().min(1),
|
|
16083
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
15777
16084
|
});
|
|
15778
|
-
var tasksTreeResultSchema =
|
|
15779
|
-
rootId:
|
|
15780
|
-
nodes:
|
|
15781
|
-
edges:
|
|
16085
|
+
var tasksTreeResultSchema = z16.object({
|
|
16086
|
+
rootId: z16.string().min(1),
|
|
16087
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
16088
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
15782
16089
|
pageInfo: workGraphPageInfoSchema
|
|
15783
16090
|
});
|
|
15784
|
-
var tasksRollupParamsSchema =
|
|
15785
|
-
rootId:
|
|
16091
|
+
var tasksRollupParamsSchema = z16.object({
|
|
16092
|
+
rootId: z16.string().min(1),
|
|
15786
16093
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
15787
16094
|
});
|
|
15788
|
-
var tasksRollupResultSchema =
|
|
15789
|
-
rootId:
|
|
16095
|
+
var tasksRollupResultSchema = z16.object({
|
|
16096
|
+
rootId: z16.string().min(1),
|
|
15790
16097
|
direct: workGraphRollupCountsSchema,
|
|
15791
16098
|
subtree: workGraphRollupCountsSchema,
|
|
15792
|
-
percentDenominator:
|
|
15793
|
-
basis:
|
|
15794
|
-
total:
|
|
15795
|
-
description:
|
|
16099
|
+
percentDenominator: z16.object({
|
|
16100
|
+
basis: z16.literal("subtree-total"),
|
|
16101
|
+
total: z16.number().int().nonnegative(),
|
|
16102
|
+
description: z16.string().min(1)
|
|
15796
16103
|
}),
|
|
15797
16104
|
percentages: workGraphSubtreePercentagesSchema,
|
|
15798
|
-
staleProjection:
|
|
15799
|
-
projectionMismatches:
|
|
16105
|
+
staleProjection: z16.boolean(),
|
|
16106
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
15800
16107
|
});
|
|
15801
|
-
var tasksFrontierParamsSchema =
|
|
15802
|
-
rootId:
|
|
15803
|
-
role:
|
|
16108
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
16109
|
+
rootId: z16.string().min(1),
|
|
16110
|
+
role: z16.string().min(1).optional()
|
|
15804
16111
|
});
|
|
15805
|
-
var tasksFrontierResultSchema =
|
|
15806
|
-
rootId:
|
|
15807
|
-
role:
|
|
15808
|
-
groups:
|
|
15809
|
-
ready:
|
|
15810
|
-
blocked:
|
|
15811
|
-
blockedBy:
|
|
15812
|
-
|
|
15813
|
-
|
|
15814
|
-
kind:
|
|
15815
|
-
blockerId:
|
|
15816
|
-
blocks:
|
|
16112
|
+
var tasksFrontierResultSchema = z16.object({
|
|
16113
|
+
rootId: z16.string().min(1),
|
|
16114
|
+
role: z16.string().min(1).optional(),
|
|
16115
|
+
groups: z16.object({
|
|
16116
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16117
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16118
|
+
blockedBy: z16.array(
|
|
16119
|
+
z16.discriminatedUnion("kind", [
|
|
16120
|
+
z16.object({
|
|
16121
|
+
kind: z16.literal("dependency"),
|
|
16122
|
+
blockerId: z16.string().min(1),
|
|
16123
|
+
blocks: z16.array(z16.string().min(1))
|
|
15817
16124
|
}),
|
|
15818
|
-
|
|
15819
|
-
kind:
|
|
16125
|
+
z16.object({
|
|
16126
|
+
kind: z16.literal("gate"),
|
|
15820
16127
|
gate: verificationGateSchema,
|
|
15821
|
-
blocks:
|
|
16128
|
+
blocks: z16.array(z16.string().min(1))
|
|
15822
16129
|
})
|
|
15823
16130
|
])
|
|
15824
16131
|
)
|
|
15825
16132
|
})
|
|
15826
16133
|
});
|
|
15827
16134
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
15828
|
-
rootId:
|
|
15829
|
-
maxDepth:
|
|
15830
|
-
includeRelations:
|
|
16135
|
+
rootId: z16.string().min(1),
|
|
16136
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16137
|
+
includeRelations: z16.boolean().optional()
|
|
15831
16138
|
});
|
|
15832
|
-
var tasksWorkGraphAuditResultSchema =
|
|
15833
|
-
rootId:
|
|
15834
|
-
hierarchy:
|
|
15835
|
-
valid:
|
|
15836
|
-
violations:
|
|
15837
|
-
|
|
15838
|
-
code:
|
|
15839
|
-
taskId:
|
|
16139
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
16140
|
+
rootId: z16.string().min(1),
|
|
16141
|
+
hierarchy: z16.object({
|
|
16142
|
+
valid: z16.boolean(),
|
|
16143
|
+
violations: z16.array(
|
|
16144
|
+
z16.object({
|
|
16145
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16146
|
+
taskId: z16.string().min(1),
|
|
15840
16147
|
taskType: taskTypeSchema,
|
|
15841
|
-
parentId:
|
|
16148
|
+
parentId: z16.string().min(1).nullable(),
|
|
15842
16149
|
parentType: taskTypeSchema.optional(),
|
|
15843
|
-
message:
|
|
16150
|
+
message: z16.string().min(1)
|
|
15844
16151
|
})
|
|
15845
16152
|
)
|
|
15846
16153
|
}),
|
|
15847
16154
|
traversal: tasksTraverseResultSchema,
|
|
15848
16155
|
frontier: tasksFrontierResultSchema,
|
|
15849
16156
|
rollup: tasksRollupResultSchema,
|
|
15850
|
-
relationEdges:
|
|
15851
|
-
rootId:
|
|
16157
|
+
relationEdges: z16.object({
|
|
16158
|
+
rootId: z16.string().min(1),
|
|
15852
16159
|
direction: workGraphEdgeDirectionSchema,
|
|
15853
|
-
edges:
|
|
15854
|
-
|
|
16160
|
+
edges: z16.array(
|
|
16161
|
+
z16.discriminatedUnion("source", [
|
|
15855
16162
|
workGraphRelationEdgeSchema,
|
|
15856
16163
|
workGraphDependencyEdgeSchema
|
|
15857
16164
|
])
|
|
@@ -15860,60 +16167,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
15860
16167
|
});
|
|
15861
16168
|
|
|
15862
16169
|
// packages/contracts/src/operations/docs.ts
|
|
15863
|
-
import { z as
|
|
15864
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
15865
|
-
version:
|
|
15866
|
-
operation:
|
|
15867
|
-
identity:
|
|
15868
|
-
projectId:
|
|
15869
|
-
projectRoot:
|
|
15870
|
-
actor:
|
|
15871
|
-
operation:
|
|
15872
|
-
idempotencyKey:
|
|
16170
|
+
import { z as z17 } from "zod";
|
|
16171
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
16172
|
+
version: z17.literal(1),
|
|
16173
|
+
operation: z17.literal("docs.projection"),
|
|
16174
|
+
identity: z17.object({
|
|
16175
|
+
projectId: z17.string().min(1),
|
|
16176
|
+
projectRoot: z17.string().min(1),
|
|
16177
|
+
actor: z17.string().min(1),
|
|
16178
|
+
operation: z17.literal("docs.projection"),
|
|
16179
|
+
idempotencyKey: z17.string().min(1)
|
|
15873
16180
|
}).strict(),
|
|
15874
|
-
source:
|
|
15875
|
-
attachmentId:
|
|
15876
|
-
sha256:
|
|
15877
|
-
ownerId:
|
|
15878
|
-
ownerType:
|
|
15879
|
-
label:
|
|
16181
|
+
source: z17.object({
|
|
16182
|
+
attachmentId: z17.string().min(1),
|
|
16183
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16184
|
+
ownerId: z17.string().min(1),
|
|
16185
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
16186
|
+
label: z17.string().min(1)
|
|
15880
16187
|
}).strict(),
|
|
15881
|
-
observation:
|
|
15882
|
-
kind:
|
|
15883
|
-
attachmentId:
|
|
15884
|
-
ownerId:
|
|
15885
|
-
addedAt:
|
|
15886
|
-
slug:
|
|
15887
|
-
type:
|
|
16188
|
+
observation: z17.object({
|
|
16189
|
+
kind: z17.literal("doc-attachment"),
|
|
16190
|
+
attachmentId: z17.string().min(1),
|
|
16191
|
+
ownerId: z17.string().min(1),
|
|
16192
|
+
addedAt: z17.string().min(1),
|
|
16193
|
+
slug: z17.string().optional(),
|
|
16194
|
+
type: z17.string().optional()
|
|
15888
16195
|
}).strict()
|
|
15889
16196
|
}).strict();
|
|
15890
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
15891
|
-
version:
|
|
15892
|
-
sourceHash:
|
|
15893
|
-
graph:
|
|
16197
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
16198
|
+
version: z17.literal(1),
|
|
16199
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16200
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
15894
16201
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
15895
|
-
observationId:
|
|
16202
|
+
observationId: z17.string().min(1).optional(),
|
|
15896
16203
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
15897
|
-
documents:
|
|
15898
|
-
verifiedAt:
|
|
15899
|
-
actor:
|
|
16204
|
+
documents: z17.literal(true).optional(),
|
|
16205
|
+
verifiedAt: z17.string().min(1),
|
|
16206
|
+
actor: z17.string().min(1)
|
|
15900
16207
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
15901
16208
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
15902
16209
|
});
|
|
15903
16210
|
|
|
15904
16211
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
15905
|
-
import { z as
|
|
15906
|
-
var taskTreeEntrySchema =
|
|
15907
|
-
title:
|
|
15908
|
-
acceptance:
|
|
16212
|
+
import { z as z18 } from "zod";
|
|
16213
|
+
var taskTreeEntrySchema = z18.object({
|
|
16214
|
+
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" }),
|
|
16215
|
+
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), {
|
|
15909
16216
|
message: "acceptance array contains no non-empty strings"
|
|
15910
16217
|
}),
|
|
15911
|
-
id:
|
|
15912
|
-
parentId:
|
|
15913
|
-
depends:
|
|
16218
|
+
id: z18.string().optional(),
|
|
16219
|
+
parentId: z18.string().optional(),
|
|
16220
|
+
depends: z18.array(z18.string()).optional()
|
|
15914
16221
|
});
|
|
15915
|
-
var taskTreeSchema =
|
|
15916
|
-
var evidenceSchema =
|
|
16222
|
+
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" });
|
|
16223
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
15917
16224
|
if (value === null || value === void 0) {
|
|
15918
16225
|
ctx.addIssue({
|
|
15919
16226
|
code: "custom",
|
|
@@ -15947,7 +16254,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
15947
16254
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
15948
16255
|
});
|
|
15949
16256
|
});
|
|
15950
|
-
var passthroughSchema =
|
|
16257
|
+
var passthroughSchema = z18.unknown();
|
|
15951
16258
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
15952
16259
|
// release.cantbook
|
|
15953
16260
|
"version_bump_report",
|
|
@@ -15980,44 +16287,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
15980
16287
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
15981
16288
|
|
|
15982
16289
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
15983
|
-
import { z as
|
|
15984
|
-
var parsedPrEvidenceAtomSchema =
|
|
15985
|
-
kind:
|
|
15986
|
-
prNumber:
|
|
16290
|
+
import { z as z19 } from "zod";
|
|
16291
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
16292
|
+
kind: z19.literal("pr"),
|
|
16293
|
+
prNumber: z19.number().int().positive()
|
|
15987
16294
|
});
|
|
15988
|
-
var prEvidenceStateModifierSchema =
|
|
15989
|
-
kind:
|
|
15990
|
-
value:
|
|
16295
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
16296
|
+
kind: z19.literal("state"),
|
|
16297
|
+
value: z19.literal("MERGED")
|
|
15991
16298
|
});
|
|
15992
|
-
var ghPrViewSchema =
|
|
15993
|
-
state:
|
|
15994
|
-
mergedAt:
|
|
15995
|
-
headRefOid:
|
|
15996
|
-
mergeCommit:
|
|
15997
|
-
title:
|
|
15998
|
-
body:
|
|
15999
|
-
headRefName:
|
|
16000
|
-
files:
|
|
16001
|
-
changedFiles:
|
|
16002
|
-
mergeable:
|
|
16003
|
-
statusCheckRollup:
|
|
16004
|
-
|
|
16005
|
-
__typename:
|
|
16006
|
-
name:
|
|
16007
|
-
workflowName:
|
|
16008
|
-
conclusion:
|
|
16009
|
-
status:
|
|
16299
|
+
var ghPrViewSchema = z19.object({
|
|
16300
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
16301
|
+
mergedAt: z19.string().nullable(),
|
|
16302
|
+
headRefOid: z19.string().optional(),
|
|
16303
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
16304
|
+
title: z19.string().optional(),
|
|
16305
|
+
body: z19.string().optional(),
|
|
16306
|
+
headRefName: z19.string().optional(),
|
|
16307
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
16308
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
16309
|
+
mergeable: z19.string().optional(),
|
|
16310
|
+
statusCheckRollup: z19.array(
|
|
16311
|
+
z19.object({
|
|
16312
|
+
__typename: z19.string().optional(),
|
|
16313
|
+
name: z19.string().optional(),
|
|
16314
|
+
workflowName: z19.string().optional(),
|
|
16315
|
+
conclusion: z19.string().nullable().optional(),
|
|
16316
|
+
status: z19.string().optional(),
|
|
16010
16317
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16011
|
-
startedAt:
|
|
16318
|
+
startedAt: z19.string().nullable().optional(),
|
|
16012
16319
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16013
|
-
completedAt:
|
|
16320
|
+
completedAt: z19.string().nullable().optional()
|
|
16014
16321
|
}).passthrough()
|
|
16015
16322
|
).optional().default([])
|
|
16016
16323
|
}).passthrough();
|
|
16017
16324
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
16018
16325
|
|
|
16019
16326
|
// packages/contracts/src/release/plan.ts
|
|
16020
|
-
import { z as
|
|
16327
|
+
import { z as z20 } from "zod";
|
|
16021
16328
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
16022
16329
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
16023
16330
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -16061,20 +16368,20 @@ var RESOLVED_SOURCE = [
|
|
|
16061
16368
|
"language-default",
|
|
16062
16369
|
"legacy-alias"
|
|
16063
16370
|
];
|
|
16064
|
-
var ReleaseChannelSchema =
|
|
16065
|
-
var ReleaseSchemeSchema =
|
|
16066
|
-
var ReleaseKindSchema =
|
|
16067
|
-
var ReleaseStatusSchema =
|
|
16068
|
-
var GateStatusSchema =
|
|
16069
|
-
var GateNameSchema =
|
|
16070
|
-
var PlatformTupleSchema =
|
|
16071
|
-
var PublisherSchema =
|
|
16072
|
-
var TaskKindSchema =
|
|
16073
|
-
var ImpactSchema =
|
|
16074
|
-
var ResolvedSourceSchema =
|
|
16075
|
-
var Iso8601 =
|
|
16076
|
-
var NonEmptyString =
|
|
16077
|
-
var ReleasePlanTaskSchema =
|
|
16371
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
16372
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
16373
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
16374
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
16375
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
16376
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
16377
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
16378
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
16379
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
16380
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
16381
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
16382
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
16383
|
+
var NonEmptyString = z20.string().min(1);
|
|
16384
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
16078
16385
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
16079
16386
|
id: NonEmptyString,
|
|
16080
16387
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -16082,20 +16389,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
16082
16389
|
/** SemVer impact classification. */
|
|
16083
16390
|
impact: ImpactSchema,
|
|
16084
16391
|
/** Human-readable changelog line for this task. */
|
|
16085
|
-
userFacingSummary:
|
|
16392
|
+
userFacingSummary: z20.string(),
|
|
16086
16393
|
/**
|
|
16087
16394
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
16088
16395
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
16089
16396
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
16090
16397
|
* enforces non-empty via R-301.
|
|
16091
16398
|
*/
|
|
16092
|
-
evidenceAtoms:
|
|
16399
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
16093
16400
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
16094
|
-
ivtrPhaseAtPlan:
|
|
16401
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
16095
16402
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
16096
16403
|
epicAncestor: NonEmptyString
|
|
16097
16404
|
});
|
|
16098
|
-
var ReleaseGateSchema =
|
|
16405
|
+
var ReleaseGateSchema = z20.object({
|
|
16099
16406
|
/** Canonical gate name. */
|
|
16100
16407
|
name: GateNameSchema,
|
|
16101
16408
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -16105,11 +16412,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
16105
16412
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
16106
16413
|
lastVerifiedAt: Iso8601,
|
|
16107
16414
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
16108
|
-
resolvedCommand:
|
|
16415
|
+
resolvedCommand: z20.string().optional(),
|
|
16109
16416
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
16110
16417
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
16111
16418
|
});
|
|
16112
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
16419
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
16113
16420
|
/** Target platform tuple. */
|
|
16114
16421
|
platform: PlatformTupleSchema,
|
|
16115
16422
|
/** Distribution backend. */
|
|
@@ -16117,47 +16424,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
16117
16424
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
16118
16425
|
package: NonEmptyString,
|
|
16119
16426
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
16120
|
-
smoke:
|
|
16427
|
+
smoke: z20.boolean().default(true).optional()
|
|
16121
16428
|
});
|
|
16122
|
-
var ReleasePreflightSummarySchema =
|
|
16429
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
16123
16430
|
/** True if esbuild externals are out of sync with package.json. */
|
|
16124
|
-
esbuildExternalsDrift:
|
|
16431
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
16125
16432
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
16126
|
-
lockfileDrift:
|
|
16433
|
+
lockfileDrift: z20.boolean(),
|
|
16127
16434
|
/** True if all epic children are in terminal lifecycle states. */
|
|
16128
|
-
epicCompletenessClean:
|
|
16435
|
+
epicCompletenessClean: z20.boolean(),
|
|
16129
16436
|
/** True if no task appears in multiple in-flight release plans. */
|
|
16130
|
-
doubleListingClean:
|
|
16437
|
+
doubleListingClean: z20.boolean(),
|
|
16131
16438
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
16132
|
-
preflightWarnings:
|
|
16439
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
16133
16440
|
});
|
|
16134
|
-
var ReleasePlanChangelogSchema =
|
|
16441
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
16135
16442
|
/** `kind=feat` tasks. */
|
|
16136
|
-
features:
|
|
16443
|
+
features: z20.array(NonEmptyString).default([]),
|
|
16137
16444
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
16138
|
-
fixes:
|
|
16445
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
16139
16446
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
16140
|
-
chores:
|
|
16447
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
16141
16448
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
16142
|
-
breaking:
|
|
16449
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
16143
16450
|
});
|
|
16144
|
-
var ReleasePlanMetaSchema =
|
|
16451
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
16145
16452
|
/** True if this is the project's first ever release. */
|
|
16146
|
-
firstEverRelease:
|
|
16453
|
+
firstEverRelease: z20.boolean().optional(),
|
|
16147
16454
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
16148
|
-
unresolvedTools:
|
|
16455
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
16149
16456
|
/** Project archetype detected at plan time. */
|
|
16150
|
-
archetype:
|
|
16151
|
-
}).catchall(
|
|
16152
|
-
var ReleasePlanSchema =
|
|
16457
|
+
archetype: z20.string().optional()
|
|
16458
|
+
}).catchall(z20.unknown());
|
|
16459
|
+
var ReleasePlanSchema = z20.object({
|
|
16153
16460
|
/** Schema URL for this plan version. */
|
|
16154
|
-
$schema:
|
|
16461
|
+
$schema: z20.string().optional(),
|
|
16155
16462
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
16156
16463
|
version: NonEmptyString,
|
|
16157
16464
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
16158
16465
|
resolvedVersion: NonEmptyString,
|
|
16159
16466
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
16160
|
-
suffixApplied:
|
|
16467
|
+
suffixApplied: z20.boolean(),
|
|
16161
16468
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
16162
16469
|
scheme: ReleaseSchemeSchema,
|
|
16163
16470
|
/** npm dist-tag channel for this release. */
|
|
@@ -16171,7 +16478,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
16171
16478
|
/** Release-kind classification. */
|
|
16172
16479
|
releaseKind: ReleaseKindSchema,
|
|
16173
16480
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
16174
|
-
hooksV1Promotion:
|
|
16481
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
16175
16482
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
16176
16483
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
16177
16484
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -16182,27 +16489,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
16182
16489
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
16183
16490
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
16184
16491
|
*/
|
|
16185
|
-
previousVersion:
|
|
16492
|
+
previousVersion: z20.string().nullable(),
|
|
16186
16493
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
16187
|
-
previousTag:
|
|
16494
|
+
previousTag: z20.string().nullable(),
|
|
16188
16495
|
/** ISO-8601 timestamp the previous release was published. */
|
|
16189
16496
|
previousShippedAt: Iso8601.nullable(),
|
|
16190
16497
|
/** Tasks rolled into this release. */
|
|
16191
|
-
tasks:
|
|
16498
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
16192
16499
|
/** Bucketed changelog. */
|
|
16193
16500
|
changelog: ReleasePlanChangelogSchema,
|
|
16194
16501
|
/** Per-gate verification status. */
|
|
16195
|
-
gates:
|
|
16502
|
+
gates: z20.array(ReleaseGateSchema),
|
|
16196
16503
|
/** Platform / publisher matrix. */
|
|
16197
|
-
platformMatrix:
|
|
16504
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
16198
16505
|
/** Preflight summary from `cleo release plan`. */
|
|
16199
16506
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
16200
16507
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
16201
|
-
workflowRunUrl:
|
|
16508
|
+
workflowRunUrl: z20.string().nullable(),
|
|
16202
16509
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
16203
|
-
prUrl:
|
|
16510
|
+
prUrl: z20.string().nullable(),
|
|
16204
16511
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
16205
|
-
mergeCommitSha:
|
|
16512
|
+
mergeCommitSha: z20.string().nullable(),
|
|
16206
16513
|
/** Current FSM state per R-302. */
|
|
16207
16514
|
status: ReleaseStatusSchema,
|
|
16208
16515
|
/** Informational / forward-compat metadata. */
|
|
@@ -16232,48 +16539,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
16232
16539
|
]);
|
|
16233
16540
|
|
|
16234
16541
|
// packages/contracts/src/session-journal.ts
|
|
16235
|
-
import { z as
|
|
16542
|
+
import { z as z21 } from "zod";
|
|
16236
16543
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
16237
|
-
var sessionJournalDoctorSummarySchema =
|
|
16544
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
16238
16545
|
/** `true` when zero noise patterns were detected. */
|
|
16239
|
-
isClean:
|
|
16546
|
+
isClean: z21.boolean(),
|
|
16240
16547
|
/** Total number of noise findings across all patterns. */
|
|
16241
|
-
findingsCount:
|
|
16548
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
16242
16549
|
/** Pattern names that were detected (empty when isClean). */
|
|
16243
|
-
patterns:
|
|
16550
|
+
patterns: z21.array(z21.string()),
|
|
16244
16551
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
16245
|
-
totalScanned:
|
|
16552
|
+
totalScanned: z21.number().int().nonnegative()
|
|
16246
16553
|
});
|
|
16247
|
-
var sessionJournalDebriefSummarySchema =
|
|
16554
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
16248
16555
|
/** First 200 characters of the session end note (if provided). */
|
|
16249
|
-
noteExcerpt:
|
|
16556
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
16250
16557
|
/** Number of tasks completed during the session. */
|
|
16251
|
-
tasksCompletedCount:
|
|
16558
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
16252
16559
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
16253
|
-
tasksFocused:
|
|
16560
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
16254
16561
|
});
|
|
16255
|
-
var sessionJournalEntrySchema =
|
|
16562
|
+
var sessionJournalEntrySchema = z21.object({
|
|
16256
16563
|
// Identity
|
|
16257
16564
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
16258
|
-
schemaVersion:
|
|
16565
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
16259
16566
|
/** ISO 8601 timestamp when the entry was written. */
|
|
16260
|
-
timestamp:
|
|
16567
|
+
timestamp: z21.string(),
|
|
16261
16568
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
16262
|
-
sessionId:
|
|
16569
|
+
sessionId: z21.string(),
|
|
16263
16570
|
/** Event type that triggered this journal entry. */
|
|
16264
|
-
eventType:
|
|
16571
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
16265
16572
|
// Session metadata (set on session_start / session_end)
|
|
16266
16573
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
16267
|
-
agentIdentifier:
|
|
16574
|
+
agentIdentifier: z21.string().optional(),
|
|
16268
16575
|
/** Provider adapter ID active for this session. */
|
|
16269
|
-
providerId:
|
|
16576
|
+
providerId: z21.string().optional(),
|
|
16270
16577
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
16271
|
-
scope:
|
|
16578
|
+
scope: z21.string().optional(),
|
|
16272
16579
|
// Session-end fields
|
|
16273
16580
|
/** Duration of the session in seconds (session_end only). */
|
|
16274
|
-
duration:
|
|
16581
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
16275
16582
|
/** Task IDs (not titles) completed during the session. */
|
|
16276
|
-
tasksCompleted:
|
|
16583
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
16277
16584
|
// Doctor summary (T1262 absorbed)
|
|
16278
16585
|
/**
|
|
16279
16586
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -16288,52 +16595,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
16288
16595
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
16289
16596
|
// Optional hash chain
|
|
16290
16597
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
16291
|
-
prevEntryHash:
|
|
16598
|
+
prevEntryHash: z21.string().optional()
|
|
16292
16599
|
});
|
|
16293
16600
|
|
|
16294
16601
|
// packages/contracts/src/task-evidence.ts
|
|
16295
|
-
import { z as
|
|
16296
|
-
var fileEvidenceSchema =
|
|
16297
|
-
kind:
|
|
16298
|
-
sha256:
|
|
16299
|
-
timestamp:
|
|
16300
|
-
path:
|
|
16301
|
-
mime:
|
|
16302
|
-
description:
|
|
16602
|
+
import { z as z22 } from "zod";
|
|
16603
|
+
var fileEvidenceSchema = z22.object({
|
|
16604
|
+
kind: z22.literal("file"),
|
|
16605
|
+
sha256: z22.string().length(64),
|
|
16606
|
+
timestamp: z22.string().datetime(),
|
|
16607
|
+
path: z22.string().min(1),
|
|
16608
|
+
mime: z22.string().optional(),
|
|
16609
|
+
description: z22.string().optional()
|
|
16303
16610
|
});
|
|
16304
|
-
var logEvidenceSchema =
|
|
16305
|
-
kind:
|
|
16306
|
-
sha256:
|
|
16307
|
-
timestamp:
|
|
16308
|
-
source:
|
|
16309
|
-
description:
|
|
16611
|
+
var logEvidenceSchema = z22.object({
|
|
16612
|
+
kind: z22.literal("log"),
|
|
16613
|
+
sha256: z22.string().length(64),
|
|
16614
|
+
timestamp: z22.string().datetime(),
|
|
16615
|
+
source: z22.string().min(1),
|
|
16616
|
+
description: z22.string().optional()
|
|
16310
16617
|
});
|
|
16311
|
-
var screenshotEvidenceSchema =
|
|
16312
|
-
kind:
|
|
16313
|
-
sha256:
|
|
16314
|
-
timestamp:
|
|
16315
|
-
mime:
|
|
16316
|
-
description:
|
|
16618
|
+
var screenshotEvidenceSchema = z22.object({
|
|
16619
|
+
kind: z22.literal("screenshot"),
|
|
16620
|
+
sha256: z22.string().length(64),
|
|
16621
|
+
timestamp: z22.string().datetime(),
|
|
16622
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
16623
|
+
description: z22.string().optional()
|
|
16317
16624
|
});
|
|
16318
|
-
var testOutputEvidenceSchema =
|
|
16319
|
-
kind:
|
|
16320
|
-
sha256:
|
|
16321
|
-
timestamp:
|
|
16322
|
-
passed:
|
|
16323
|
-
failed:
|
|
16324
|
-
skipped:
|
|
16325
|
-
exitCode:
|
|
16326
|
-
description:
|
|
16625
|
+
var testOutputEvidenceSchema = z22.object({
|
|
16626
|
+
kind: z22.literal("test-output"),
|
|
16627
|
+
sha256: z22.string().length(64),
|
|
16628
|
+
timestamp: z22.string().datetime(),
|
|
16629
|
+
passed: z22.number().int().nonnegative(),
|
|
16630
|
+
failed: z22.number().int().nonnegative(),
|
|
16631
|
+
skipped: z22.number().int().nonnegative(),
|
|
16632
|
+
exitCode: z22.number().int(),
|
|
16633
|
+
description: z22.string().optional()
|
|
16327
16634
|
});
|
|
16328
|
-
var commandOutputEvidenceSchema =
|
|
16329
|
-
kind:
|
|
16330
|
-
sha256:
|
|
16331
|
-
timestamp:
|
|
16332
|
-
cmd:
|
|
16333
|
-
exitCode:
|
|
16334
|
-
description:
|
|
16635
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
16636
|
+
kind: z22.literal("command-output"),
|
|
16637
|
+
sha256: z22.string().length(64),
|
|
16638
|
+
timestamp: z22.string().datetime(),
|
|
16639
|
+
cmd: z22.string().min(1),
|
|
16640
|
+
exitCode: z22.number().int(),
|
|
16641
|
+
description: z22.string().optional()
|
|
16335
16642
|
});
|
|
16336
|
-
var taskEvidenceSchema =
|
|
16643
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
16337
16644
|
fileEvidenceSchema,
|
|
16338
16645
|
logEvidenceSchema,
|
|
16339
16646
|
screenshotEvidenceSchema,
|
|
@@ -16342,8 +16649,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
16342
16649
|
]);
|
|
16343
16650
|
|
|
16344
16651
|
// packages/contracts/src/tasks/archive.ts
|
|
16345
|
-
import { z as
|
|
16346
|
-
var ArchiveReason =
|
|
16652
|
+
import { z as z23 } from "zod";
|
|
16653
|
+
var ArchiveReason = z23.enum([
|
|
16347
16654
|
"verified",
|
|
16348
16655
|
"reconciled",
|
|
16349
16656
|
"superseded",
|
|
@@ -16354,42 +16661,42 @@ var ArchiveReason = z22.enum([
|
|
|
16354
16661
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
16355
16662
|
|
|
16356
16663
|
// packages/contracts/src/tasks/index.ts
|
|
16357
|
-
import { z as
|
|
16358
|
-
var taskMutationWarningSeveritySchema =
|
|
16359
|
-
var taskMutationWarningSchema =
|
|
16360
|
-
code:
|
|
16361
|
-
message:
|
|
16664
|
+
import { z as z24 } from "zod";
|
|
16665
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
16666
|
+
var taskMutationWarningSchema = z24.object({
|
|
16667
|
+
code: z24.string().min(1),
|
|
16668
|
+
message: z24.string().min(1),
|
|
16362
16669
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
16363
|
-
taskId:
|
|
16364
|
-
field:
|
|
16365
|
-
index:
|
|
16670
|
+
taskId: z24.string().min(1).optional(),
|
|
16671
|
+
field: z24.string().min(1).optional(),
|
|
16672
|
+
index: z24.number().int().nonnegative().optional()
|
|
16366
16673
|
});
|
|
16367
|
-
var taskMutationDryRunSummarySchema =
|
|
16368
|
-
dryRun:
|
|
16369
|
-
wouldCreate:
|
|
16370
|
-
wouldUpdate:
|
|
16371
|
-
wouldDelete:
|
|
16372
|
-
wouldAffect:
|
|
16373
|
-
validatedCount:
|
|
16374
|
-
insertedCount:
|
|
16375
|
-
updatedCount:
|
|
16376
|
-
deletedCount:
|
|
16377
|
-
warnings:
|
|
16674
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
16675
|
+
dryRun: z24.literal(true),
|
|
16676
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
16677
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
16678
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
16679
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
16680
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
16681
|
+
insertedCount: z24.literal(0),
|
|
16682
|
+
updatedCount: z24.literal(0),
|
|
16683
|
+
deletedCount: z24.literal(0),
|
|
16684
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
16378
16685
|
});
|
|
16379
|
-
var taskMutationTaskRecordSchema =
|
|
16380
|
-
var taskMutationEnvelopeSchema =
|
|
16381
|
-
dryRun:
|
|
16382
|
-
created:
|
|
16383
|
-
updated:
|
|
16384
|
-
deleted:
|
|
16385
|
-
affectedCount:
|
|
16386
|
-
mutationWarnings:
|
|
16686
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
16687
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
16688
|
+
dryRun: z24.boolean().optional(),
|
|
16689
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
16690
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
16691
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
16692
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
16693
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
16387
16694
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
16388
16695
|
});
|
|
16389
|
-
var completionTaskStatusSchema =
|
|
16390
|
-
var completionCriterionKindSchema =
|
|
16391
|
-
var completionCriterionStatusSchema =
|
|
16392
|
-
var completionBlockerReasonSchema =
|
|
16696
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
16697
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
16698
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
16699
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
16393
16700
|
"missing_evidence_binding",
|
|
16394
16701
|
"child_not_done",
|
|
16395
16702
|
"child_cancelled_requires_waiver",
|
|
@@ -16397,68 +16704,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
16397
16704
|
"child_missing",
|
|
16398
16705
|
"done_parent_stale"
|
|
16399
16706
|
]);
|
|
16400
|
-
var completionStaleReasonSchema =
|
|
16401
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
16707
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
16708
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
16402
16709
|
"projection_not_stale",
|
|
16403
16710
|
"criteria_missing",
|
|
16404
16711
|
"binding_target_missing",
|
|
16405
16712
|
"repair_conflict"
|
|
16406
16713
|
]);
|
|
16407
|
-
var completionCriterionWaiverSchema =
|
|
16408
|
-
criterionAcId:
|
|
16409
|
-
childTaskId:
|
|
16410
|
-
reason:
|
|
16411
|
-
actor:
|
|
16412
|
-
waivedAt:
|
|
16714
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
16715
|
+
criterionAcId: z24.string().min(1),
|
|
16716
|
+
childTaskId: z24.string().min(1),
|
|
16717
|
+
reason: z24.string().min(1),
|
|
16718
|
+
actor: z24.string().min(1),
|
|
16719
|
+
waivedAt: z24.string().min(1)
|
|
16413
16720
|
});
|
|
16414
|
-
var completionCriterionReplacementSchema =
|
|
16415
|
-
criterionAcId:
|
|
16416
|
-
originalChildTaskId:
|
|
16417
|
-
replacementChildTaskId:
|
|
16418
|
-
reason:
|
|
16419
|
-
actor:
|
|
16420
|
-
replacedAt:
|
|
16721
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
16722
|
+
criterionAcId: z24.string().min(1),
|
|
16723
|
+
originalChildTaskId: z24.string().min(1),
|
|
16724
|
+
replacementChildTaskId: z24.string().min(1),
|
|
16725
|
+
reason: z24.string().min(1),
|
|
16726
|
+
actor: z24.string().min(1),
|
|
16727
|
+
replacedAt: z24.string().min(1)
|
|
16421
16728
|
});
|
|
16422
|
-
var completionCriterionEvaluationSchema =
|
|
16423
|
-
acId:
|
|
16424
|
-
alias:
|
|
16425
|
-
text:
|
|
16729
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
16730
|
+
acId: z24.string().min(1),
|
|
16731
|
+
alias: z24.string().min(1),
|
|
16732
|
+
text: z24.string(),
|
|
16426
16733
|
kind: completionCriterionKindSchema,
|
|
16427
16734
|
status: completionCriterionStatusSchema,
|
|
16428
16735
|
reason: completionBlockerReasonSchema.optional(),
|
|
16429
|
-
targetTaskId:
|
|
16736
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
16430
16737
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
16431
16738
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
16432
16739
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
16433
16740
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
16434
|
-
evidenceBindings:
|
|
16741
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
16435
16742
|
});
|
|
16436
16743
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
16437
|
-
status:
|
|
16744
|
+
status: z24.literal("unsatisfied"),
|
|
16438
16745
|
reason: completionBlockerReasonSchema
|
|
16439
16746
|
});
|
|
16440
|
-
var completionTotalsSchema =
|
|
16441
|
-
criteria:
|
|
16442
|
-
satisfied:
|
|
16443
|
-
unsatisfied:
|
|
16444
|
-
waived:
|
|
16445
|
-
replaced:
|
|
16747
|
+
var completionTotalsSchema = z24.object({
|
|
16748
|
+
criteria: z24.number().int().nonnegative(),
|
|
16749
|
+
satisfied: z24.number().int().nonnegative(),
|
|
16750
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
16751
|
+
waived: z24.number().int().nonnegative(),
|
|
16752
|
+
replaced: z24.number().int().nonnegative()
|
|
16446
16753
|
});
|
|
16447
|
-
var completionContextPackSchema =
|
|
16448
|
-
taskId:
|
|
16449
|
-
generatedAt:
|
|
16450
|
-
source:
|
|
16451
|
-
window:
|
|
16452
|
-
limit:
|
|
16453
|
-
since:
|
|
16454
|
-
relationDepth:
|
|
16455
|
-
relatedTaskIds:
|
|
16754
|
+
var completionContextPackSchema = z24.object({
|
|
16755
|
+
taskId: z24.string().min(1),
|
|
16756
|
+
generatedAt: z24.string().min(1),
|
|
16757
|
+
source: z24.literal("audit_log"),
|
|
16758
|
+
window: z24.object({
|
|
16759
|
+
limit: z24.number().int().positive(),
|
|
16760
|
+
since: z24.string().min(1).optional(),
|
|
16761
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
16762
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
16456
16763
|
}),
|
|
16457
|
-
events:
|
|
16458
|
-
|
|
16459
|
-
id:
|
|
16460
|
-
timestamp:
|
|
16461
|
-
action:
|
|
16764
|
+
events: z24.array(
|
|
16765
|
+
z24.object({
|
|
16766
|
+
id: z24.string().min(1),
|
|
16767
|
+
timestamp: z24.string().min(1),
|
|
16768
|
+
action: z24.enum([
|
|
16462
16769
|
"task_completed",
|
|
16463
16770
|
"task_reopened",
|
|
16464
16771
|
"task_cancelled",
|
|
@@ -16466,77 +16773,77 @@ var completionContextPackSchema = z23.object({
|
|
|
16466
16773
|
"task_reparented",
|
|
16467
16774
|
"ac_projection_rebuilt"
|
|
16468
16775
|
]),
|
|
16469
|
-
taskId:
|
|
16470
|
-
relation:
|
|
16471
|
-
actor:
|
|
16472
|
-
details:
|
|
16473
|
-
before:
|
|
16474
|
-
after:
|
|
16776
|
+
taskId: z24.string().min(1),
|
|
16777
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
16778
|
+
actor: z24.string().min(1),
|
|
16779
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
16780
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
16781
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
16475
16782
|
})
|
|
16476
16783
|
),
|
|
16477
|
-
summary:
|
|
16478
|
-
totalEvents:
|
|
16479
|
-
byAction:
|
|
16480
|
-
byRelation:
|
|
16481
|
-
latestEventAt:
|
|
16784
|
+
summary: z24.object({
|
|
16785
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
16786
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
16787
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
16788
|
+
latestEventAt: z24.string().nullable()
|
|
16482
16789
|
})
|
|
16483
16790
|
});
|
|
16484
|
-
var completionEvaluationSchema =
|
|
16485
|
-
taskId:
|
|
16791
|
+
var completionEvaluationSchema = z24.object({
|
|
16792
|
+
taskId: z24.string().min(1),
|
|
16486
16793
|
taskStatus: completionTaskStatusSchema,
|
|
16487
|
-
ready:
|
|
16488
|
-
stale:
|
|
16489
|
-
staleReasons:
|
|
16794
|
+
ready: z24.boolean(),
|
|
16795
|
+
stale: z24.boolean(),
|
|
16796
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
16490
16797
|
contextPack: completionContextPackSchema.optional(),
|
|
16491
|
-
satisfied:
|
|
16492
|
-
unsatisfied:
|
|
16493
|
-
waived:
|
|
16494
|
-
replaced:
|
|
16798
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
16799
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
16800
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
16801
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
16495
16802
|
totals: completionTotalsSchema
|
|
16496
16803
|
});
|
|
16497
|
-
var completionExplanationSchema =
|
|
16498
|
-
taskId:
|
|
16499
|
-
ready:
|
|
16500
|
-
stale:
|
|
16501
|
-
summary:
|
|
16804
|
+
var completionExplanationSchema = z24.object({
|
|
16805
|
+
taskId: z24.string().min(1),
|
|
16806
|
+
ready: z24.boolean(),
|
|
16807
|
+
stale: z24.boolean(),
|
|
16808
|
+
summary: z24.string(),
|
|
16502
16809
|
contextPack: completionContextPackSchema.optional(),
|
|
16503
|
-
blockers:
|
|
16810
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
16504
16811
|
});
|
|
16505
|
-
var completionListParamsSchema =
|
|
16506
|
-
taskId:
|
|
16812
|
+
var completionListParamsSchema = z24.object({
|
|
16813
|
+
taskId: z24.string().min(1),
|
|
16507
16814
|
status: completionCriterionStatusSchema.optional(),
|
|
16508
16815
|
kind: completionCriterionKindSchema.optional()
|
|
16509
16816
|
});
|
|
16510
|
-
var completionListResultSchema =
|
|
16511
|
-
taskId:
|
|
16512
|
-
criteria:
|
|
16817
|
+
var completionListResultSchema = z24.object({
|
|
16818
|
+
taskId: z24.string().min(1),
|
|
16819
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
16513
16820
|
totals: completionTotalsSchema
|
|
16514
16821
|
});
|
|
16515
|
-
var completionEvaluateParamsSchema =
|
|
16516
|
-
taskId:
|
|
16517
|
-
includeContext:
|
|
16518
|
-
limit:
|
|
16519
|
-
since:
|
|
16520
|
-
relationDepth:
|
|
16822
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
16823
|
+
taskId: z24.string().min(1),
|
|
16824
|
+
includeContext: z24.boolean().optional(),
|
|
16825
|
+
limit: z24.number().int().positive().optional(),
|
|
16826
|
+
since: z24.string().min(1).optional(),
|
|
16827
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
16521
16828
|
});
|
|
16522
|
-
var completionProjectionRepairErrorSchema =
|
|
16829
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
16523
16830
|
code: completionProjectionRepairErrorCodeSchema,
|
|
16524
|
-
message:
|
|
16525
|
-
taskId:
|
|
16526
|
-
acId:
|
|
16527
|
-
evidenceAtomId:
|
|
16831
|
+
message: z24.string().min(1),
|
|
16832
|
+
taskId: z24.string().min(1),
|
|
16833
|
+
acId: z24.string().min(1).optional(),
|
|
16834
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
16528
16835
|
});
|
|
16529
|
-
var completionProjectionRepairParamsSchema =
|
|
16530
|
-
taskId:
|
|
16531
|
-
dryRun:
|
|
16836
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
16837
|
+
taskId: z24.string().min(1),
|
|
16838
|
+
dryRun: z24.boolean().optional()
|
|
16532
16839
|
});
|
|
16533
|
-
var completionProjectionRepairResultSchema =
|
|
16534
|
-
taskId:
|
|
16535
|
-
repaired:
|
|
16536
|
-
dryRun:
|
|
16537
|
-
staleBefore:
|
|
16538
|
-
staleAfter:
|
|
16539
|
-
errors:
|
|
16840
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
16841
|
+
taskId: z24.string().min(1),
|
|
16842
|
+
repaired: z24.boolean(),
|
|
16843
|
+
dryRun: z24.boolean(),
|
|
16844
|
+
staleBefore: z24.boolean(),
|
|
16845
|
+
staleAfter: z24.boolean(),
|
|
16846
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
16540
16847
|
});
|
|
16541
16848
|
|
|
16542
16849
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -17039,7 +17346,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
17039
17346
|
};
|
|
17040
17347
|
|
|
17041
17348
|
// packages/contracts/src/templates/manifest.ts
|
|
17042
|
-
import { z as
|
|
17349
|
+
import { z as z25 } from "zod";
|
|
17043
17350
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
17044
17351
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
17045
17352
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -17056,79 +17363,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
17056
17363
|
"tool-resolver",
|
|
17057
17364
|
"literal"
|
|
17058
17365
|
];
|
|
17059
|
-
var PlaceholderSpecSchema =
|
|
17366
|
+
var PlaceholderSpecSchema = z25.object({
|
|
17060
17367
|
/**
|
|
17061
17368
|
* Placeholder identifier as it appears in the template body
|
|
17062
17369
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
17063
17370
|
*/
|
|
17064
|
-
name:
|
|
17371
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
17065
17372
|
/** Resolver source the installer consults for this placeholder. */
|
|
17066
|
-
source:
|
|
17373
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
17067
17374
|
/**
|
|
17068
17375
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
17069
17376
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
17070
17377
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
17071
17378
|
*/
|
|
17072
|
-
sourcePath:
|
|
17379
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
17073
17380
|
/**
|
|
17074
17381
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
17075
17382
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
17076
17383
|
*/
|
|
17077
|
-
defaultValue:
|
|
17384
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
17078
17385
|
});
|
|
17079
|
-
var TemplateManifestEntrySchema =
|
|
17386
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
17080
17387
|
/** Stable identifier for this template entry. */
|
|
17081
|
-
id:
|
|
17388
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
17082
17389
|
/** Category of file this template represents. */
|
|
17083
|
-
kind:
|
|
17390
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
17084
17391
|
/** Repo-relative path of the template source file. */
|
|
17085
|
-
sourcePath:
|
|
17392
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
17086
17393
|
/** Project-relative path where the rendered template installs. */
|
|
17087
|
-
installPath:
|
|
17394
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
17088
17395
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
17089
|
-
substitution:
|
|
17396
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
17090
17397
|
/** Declared placeholders this template requires. May be empty. */
|
|
17091
|
-
placeholders:
|
|
17398
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
17092
17399
|
/** Reconciliation policy on upgrade. */
|
|
17093
|
-
updateStrategy:
|
|
17400
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
17094
17401
|
});
|
|
17095
17402
|
|
|
17096
17403
|
// packages/contracts/src/validator/index.ts
|
|
17097
|
-
import { z as
|
|
17404
|
+
import { z as z26 } from "zod";
|
|
17098
17405
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
17099
|
-
var validatorFindingSchema =
|
|
17100
|
-
acId:
|
|
17101
|
-
status:
|
|
17102
|
-
reasoning:
|
|
17103
|
-
evidenceRefs:
|
|
17104
|
-
checkedAt:
|
|
17406
|
+
var validatorFindingSchema = z26.object({
|
|
17407
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
17408
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
17409
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
17410
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
17411
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
17105
17412
|
});
|
|
17106
|
-
var validatorAttestationSchema =
|
|
17107
|
-
verdict:
|
|
17108
|
-
taskId:
|
|
17109
|
-
validatorId:
|
|
17110
|
-
findings:
|
|
17413
|
+
var validatorAttestationSchema = z26.object({
|
|
17414
|
+
verdict: z26.literal("attest"),
|
|
17415
|
+
taskId: z26.string().min(1),
|
|
17416
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17417
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
17111
17418
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
17112
17419
|
'attestation requires every finding to have status="pass"'
|
|
17113
17420
|
),
|
|
17114
|
-
summary:
|
|
17115
|
-
attestedAt:
|
|
17116
|
-
schemaVersion:
|
|
17421
|
+
summary: z26.string().optional(),
|
|
17422
|
+
attestedAt: z26.string().min(1),
|
|
17423
|
+
schemaVersion: z26.literal("1")
|
|
17117
17424
|
});
|
|
17118
|
-
var validatorRejectionSchema =
|
|
17119
|
-
verdict:
|
|
17120
|
-
taskId:
|
|
17121
|
-
validatorId:
|
|
17122
|
-
findings:
|
|
17425
|
+
var validatorRejectionSchema = z26.object({
|
|
17426
|
+
verdict: z26.literal("reject"),
|
|
17427
|
+
taskId: z26.string().min(1),
|
|
17428
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17429
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
17123
17430
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
17124
17431
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
17125
17432
|
),
|
|
17126
|
-
summary:
|
|
17127
|
-
remediationHints:
|
|
17128
|
-
rejectedAt:
|
|
17129
|
-
schemaVersion:
|
|
17433
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
17434
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
17435
|
+
rejectedAt: z26.string().min(1),
|
|
17436
|
+
schemaVersion: z26.literal("1")
|
|
17130
17437
|
});
|
|
17131
|
-
var validatorVerdictSchema =
|
|
17438
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
17132
17439
|
validatorAttestationSchema,
|
|
17133
17440
|
validatorRejectionSchema
|
|
17134
17441
|
]);
|
|
@@ -17878,7 +18185,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
17878
18185
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
17879
18186
|
|
|
17880
18187
|
// packages/contracts/src/decide.ts
|
|
17881
|
-
import { z as
|
|
18188
|
+
import { z as z27 } from "zod";
|
|
17882
18189
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
17883
18190
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
17884
18191
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -17900,11 +18207,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
17900
18207
|
maxScoreLevels: 10
|
|
17901
18208
|
};
|
|
17902
18209
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
17903
|
-
var decisionQuestionTypeSchema =
|
|
17904
|
-
var decisionOutcomeSourceSchema =
|
|
17905
|
-
var decisionInstructionsSchema =
|
|
17906
|
-
var unitIntervalSchema =
|
|
17907
|
-
var decisionStateSchema =
|
|
18210
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
18211
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
18212
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
18213
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
18214
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
17908
18215
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
17909
18216
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
17910
18217
|
context.addIssue({
|
|
@@ -17913,34 +18220,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
17913
18220
|
});
|
|
17914
18221
|
}
|
|
17915
18222
|
});
|
|
17916
|
-
var noulDecisionQuestionSchema =
|
|
17917
|
-
type:
|
|
18223
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
18224
|
+
type: z27.literal("noul"),
|
|
17918
18225
|
instructions: decisionInstructionsSchema.optional(),
|
|
17919
|
-
criteria:
|
|
18226
|
+
criteria: z27.string().min(1)
|
|
17920
18227
|
});
|
|
17921
|
-
var choiceDecisionQuestionSchema =
|
|
17922
|
-
type:
|
|
18228
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
18229
|
+
type: z27.literal("choice"),
|
|
17923
18230
|
instructions: decisionInstructionsSchema.optional(),
|
|
17924
|
-
criteria:
|
|
18231
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
17925
18232
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
17926
18233
|
})
|
|
17927
18234
|
});
|
|
17928
|
-
var scoreDecisionQuestionSchema =
|
|
17929
|
-
type:
|
|
18235
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
18236
|
+
type: z27.literal("score"),
|
|
17930
18237
|
instructions: decisionInstructionsSchema.optional(),
|
|
17931
|
-
criteria:
|
|
18238
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
17932
18239
|
});
|
|
17933
|
-
var decisionQuestionSchema =
|
|
18240
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
17934
18241
|
noulDecisionQuestionSchema,
|
|
17935
18242
|
choiceDecisionQuestionSchema,
|
|
17936
18243
|
scoreDecisionQuestionSchema
|
|
17937
18244
|
]);
|
|
17938
|
-
var decisionRequestSchema =
|
|
17939
|
-
model:
|
|
17940
|
-
lang:
|
|
17941
|
-
cache:
|
|
18245
|
+
var decisionRequestSchema = z27.object({
|
|
18246
|
+
model: z27.string().min(1).optional(),
|
|
18247
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
18248
|
+
cache: z27.boolean().optional(),
|
|
17942
18249
|
state: decisionStateSchema,
|
|
17943
|
-
questions:
|
|
18250
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
17944
18251
|
(questions) => {
|
|
17945
18252
|
const count = Object.keys(questions).length;
|
|
17946
18253
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -17950,139 +18257,139 @@ var decisionRequestSchema = z26.object({
|
|
|
17950
18257
|
}
|
|
17951
18258
|
)
|
|
17952
18259
|
});
|
|
17953
|
-
var noulDecisionAnswerSchema =
|
|
17954
|
-
type:
|
|
17955
|
-
value:
|
|
18260
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
18261
|
+
type: z27.literal("noul"),
|
|
18262
|
+
value: z27.boolean(),
|
|
17956
18263
|
probability: unitIntervalSchema,
|
|
17957
18264
|
confidence: unitIntervalSchema
|
|
17958
18265
|
});
|
|
17959
|
-
var choiceDecisionAnswerSchema =
|
|
17960
|
-
type:
|
|
17961
|
-
value:
|
|
17962
|
-
probabilities:
|
|
18266
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
18267
|
+
type: z27.literal("choice"),
|
|
18268
|
+
value: z27.string().min(1),
|
|
18269
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
17963
18270
|
confidence: unitIntervalSchema
|
|
17964
18271
|
});
|
|
17965
|
-
var scoreDecisionAnswerSchema =
|
|
17966
|
-
type:
|
|
17967
|
-
value:
|
|
17968
|
-
probabilities:
|
|
18272
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
18273
|
+
type: z27.literal("score"),
|
|
18274
|
+
value: z27.number().int().nonnegative(),
|
|
18275
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
17969
18276
|
confidence: unitIntervalSchema
|
|
17970
18277
|
});
|
|
17971
|
-
var decisionAnswerSchema =
|
|
18278
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
17972
18279
|
noulDecisionAnswerSchema,
|
|
17973
18280
|
choiceDecisionAnswerSchema,
|
|
17974
18281
|
scoreDecisionAnswerSchema
|
|
17975
18282
|
]);
|
|
17976
|
-
var decisionOutcomeSchema =
|
|
17977
|
-
answers:
|
|
18283
|
+
var decisionOutcomeSchema = z27.object({
|
|
18284
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
17978
18285
|
source: decisionOutcomeSourceSchema,
|
|
17979
|
-
requestId:
|
|
17980
|
-
latencyMs:
|
|
17981
|
-
costUsd:
|
|
17982
|
-
costMicros:
|
|
17983
|
-
balanceMicros:
|
|
17984
|
-
checkpoint:
|
|
17985
|
-
inputTokens:
|
|
18286
|
+
requestId: z27.string().min(1).optional(),
|
|
18287
|
+
latencyMs: z27.number().nonnegative(),
|
|
18288
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
18289
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
18290
|
+
balanceMicros: z27.number().int().optional(),
|
|
18291
|
+
checkpoint: z27.string().min(1).optional(),
|
|
18292
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
17986
18293
|
});
|
|
17987
|
-
var decisionProviderKindSchema =
|
|
17988
|
-
var decisionProviderConfigSchema =
|
|
17989
|
-
baseUrl:
|
|
18294
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
18295
|
+
var decisionProviderConfigSchema = z27.object({
|
|
18296
|
+
baseUrl: z27.url(),
|
|
17990
18297
|
provider: decisionProviderKindSchema.optional()
|
|
17991
18298
|
});
|
|
17992
18299
|
|
|
17993
18300
|
// packages/contracts/src/nexus-account.ts
|
|
17994
|
-
import { z as
|
|
17995
|
-
var nexusAccountUserSchema =
|
|
17996
|
-
id:
|
|
17997
|
-
email:
|
|
17998
|
-
name:
|
|
18301
|
+
import { z as z28 } from "zod";
|
|
18302
|
+
var nexusAccountUserSchema = z28.object({
|
|
18303
|
+
id: z28.string(),
|
|
18304
|
+
email: z28.string(),
|
|
18305
|
+
name: z28.string().nullable().optional()
|
|
17999
18306
|
});
|
|
18000
|
-
var nexusAccountOrganizationSchema =
|
|
18001
|
-
id:
|
|
18002
|
-
name:
|
|
18003
|
-
slug:
|
|
18004
|
-
role:
|
|
18307
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
18308
|
+
id: z28.string(),
|
|
18309
|
+
name: z28.string(),
|
|
18310
|
+
slug: z28.string().nullable().optional(),
|
|
18311
|
+
role: z28.string().optional(),
|
|
18005
18312
|
/** `true` for the personal organization created at sign-up. */
|
|
18006
|
-
personal:
|
|
18313
|
+
personal: z28.boolean().optional()
|
|
18007
18314
|
});
|
|
18008
|
-
var nexusAccountMeSchema =
|
|
18315
|
+
var nexusAccountMeSchema = z28.object({
|
|
18009
18316
|
user: nexusAccountUserSchema,
|
|
18010
|
-
organizations:
|
|
18317
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
18011
18318
|
});
|
|
18012
18319
|
|
|
18013
18320
|
// packages/contracts/src/nexus-cloud.ts
|
|
18014
|
-
import { z as
|
|
18321
|
+
import { z as z29 } from "zod";
|
|
18015
18322
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
18016
18323
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
18017
18324
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
18018
|
-
var isoTime =
|
|
18019
|
-
var profile =
|
|
18020
|
-
var deviceState =
|
|
18021
|
-
var nexusCloudCredentialSchema =
|
|
18022
|
-
kind:
|
|
18023
|
-
credentialId:
|
|
18325
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
18326
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
18327
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
18328
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
18329
|
+
kind: z29.enum(["device", "session"]),
|
|
18330
|
+
credentialId: z29.string().nullable().optional(),
|
|
18024
18331
|
profile: profile.optional(),
|
|
18025
|
-
scopes:
|
|
18332
|
+
scopes: z29.array(z29.string()).default([]),
|
|
18026
18333
|
createdAt: isoTime.nullable().optional(),
|
|
18027
18334
|
lastUsedAt: isoTime.nullable().optional(),
|
|
18028
18335
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
18029
18336
|
idleExpiresAt: isoTime.nullable().optional()
|
|
18030
18337
|
});
|
|
18031
|
-
var nexusCloudDeviceSchema =
|
|
18032
|
-
deviceId:
|
|
18033
|
-
name:
|
|
18034
|
-
platform:
|
|
18035
|
-
arch:
|
|
18036
|
-
cliVersion:
|
|
18338
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
18339
|
+
deviceId: z29.string(),
|
|
18340
|
+
name: z29.string(),
|
|
18341
|
+
platform: z29.string().optional(),
|
|
18342
|
+
arch: z29.string().nullable().optional(),
|
|
18343
|
+
cliVersion: z29.string().nullable().optional(),
|
|
18037
18344
|
createdAt: isoTime.optional(),
|
|
18038
18345
|
lastSeenAt: isoTime.nullable().optional(),
|
|
18039
18346
|
state: deviceState,
|
|
18040
18347
|
signedOutAt: isoTime.nullable().optional(),
|
|
18041
18348
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
18042
|
-
certificate:
|
|
18349
|
+
certificate: z29.string().nullable().optional(),
|
|
18043
18350
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
18044
18351
|
profile: profile.optional(),
|
|
18045
18352
|
/** True for the device whose credential made this request. */
|
|
18046
|
-
current:
|
|
18047
|
-
projects:
|
|
18048
|
-
replicas:
|
|
18353
|
+
current: z29.boolean().default(false),
|
|
18354
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
18355
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
18049
18356
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18050
18357
|
lastPresenceAt: isoTime.nullable().optional()
|
|
18051
18358
|
});
|
|
18052
|
-
var nexusCloudOrganizationSchema =
|
|
18053
|
-
id:
|
|
18054
|
-
name:
|
|
18055
|
-
slug:
|
|
18056
|
-
role:
|
|
18057
|
-
personal:
|
|
18359
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
18360
|
+
id: z29.string(),
|
|
18361
|
+
name: z29.string(),
|
|
18362
|
+
slug: z29.string().nullable().optional(),
|
|
18363
|
+
role: z29.string().optional(),
|
|
18364
|
+
personal: z29.boolean().optional()
|
|
18058
18365
|
});
|
|
18059
|
-
var nexusCloudUserSchema =
|
|
18060
|
-
id:
|
|
18061
|
-
email:
|
|
18062
|
-
name:
|
|
18366
|
+
var nexusCloudUserSchema = z29.object({
|
|
18367
|
+
id: z29.string(),
|
|
18368
|
+
email: z29.string(),
|
|
18369
|
+
name: z29.string().nullable().optional()
|
|
18063
18370
|
});
|
|
18064
|
-
var nexusCloudWhoamiSchema =
|
|
18371
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
18065
18372
|
serverTime: isoTime.optional(),
|
|
18066
18373
|
user: nexusCloudUserSchema,
|
|
18067
|
-
organizations:
|
|
18374
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
18068
18375
|
credential: nexusCloudCredentialSchema,
|
|
18069
18376
|
/** The calling device; null for a session caller. */
|
|
18070
18377
|
device: nexusCloudDeviceSchema.nullable()
|
|
18071
18378
|
});
|
|
18072
|
-
var nexusCloudDevicePageSchema =
|
|
18073
|
-
devices:
|
|
18074
|
-
nextCursor:
|
|
18075
|
-
truncated:
|
|
18379
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
18380
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
18381
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18382
|
+
truncated: z29.boolean().default(false)
|
|
18076
18383
|
});
|
|
18077
|
-
var nexusCloudPresenceSchema =
|
|
18384
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
18078
18385
|
observedAt: isoTime.optional(),
|
|
18079
|
-
sync:
|
|
18386
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
18080
18387
|
});
|
|
18081
|
-
var nexusCloudReplicaSchema =
|
|
18082
|
-
projectId:
|
|
18083
|
-
replicaId:
|
|
18084
|
-
deviceId:
|
|
18085
|
-
deviceName:
|
|
18388
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
18389
|
+
projectId: z29.string(),
|
|
18390
|
+
replicaId: z29.string(),
|
|
18391
|
+
deviceId: z29.string(),
|
|
18392
|
+
deviceName: z29.string(),
|
|
18086
18393
|
deviceState: deviceState.optional(),
|
|
18087
18394
|
attachedAt: isoTime.optional(),
|
|
18088
18395
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -18091,72 +18398,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
18091
18398
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
18092
18399
|
retiredAt: isoTime.nullable().optional(),
|
|
18093
18400
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
18094
|
-
successor:
|
|
18401
|
+
successor: z29.string().nullable().optional()
|
|
18095
18402
|
});
|
|
18096
|
-
var nexusCloudDeviceCountsSchema =
|
|
18097
|
-
active:
|
|
18098
|
-
total:
|
|
18403
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
18404
|
+
active: z29.number().int().nonnegative(),
|
|
18405
|
+
total: z29.number().int().nonnegative()
|
|
18099
18406
|
});
|
|
18100
18407
|
var projectFields = {
|
|
18101
|
-
projectId:
|
|
18102
|
-
label:
|
|
18103
|
-
organizationId:
|
|
18104
|
-
organizationName:
|
|
18105
|
-
remoteUrl:
|
|
18408
|
+
projectId: z29.string(),
|
|
18409
|
+
label: z29.string().nullable(),
|
|
18410
|
+
organizationId: z29.string(),
|
|
18411
|
+
organizationName: z29.string().optional(),
|
|
18412
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
18106
18413
|
createdAt: isoTime.optional()
|
|
18107
18414
|
};
|
|
18108
|
-
var nexusCloudProjectListItemSchema =
|
|
18415
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
18109
18416
|
...projectFields,
|
|
18110
|
-
role:
|
|
18417
|
+
role: z29.string(),
|
|
18111
18418
|
/**
|
|
18112
18419
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
18113
18420
|
* only a holder of the account key can open it (T13102).
|
|
18114
18421
|
*/
|
|
18115
|
-
encryptedName:
|
|
18116
|
-
streamId:
|
|
18117
|
-
headSeq:
|
|
18422
|
+
encryptedName: z29.string().nullable().optional(),
|
|
18423
|
+
streamId: z29.string().optional(),
|
|
18424
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
18118
18425
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
18119
|
-
headCheckpointId:
|
|
18120
|
-
openConflicts:
|
|
18121
|
-
replicas:
|
|
18426
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
18427
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
18428
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
18122
18429
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18123
|
-
replicaCount:
|
|
18430
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18124
18431
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18125
18432
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
18126
18433
|
/** This project's replica list was cut at 50 (T12858). */
|
|
18127
|
-
replicasTruncated:
|
|
18434
|
+
replicasTruncated: z29.boolean().default(false)
|
|
18128
18435
|
});
|
|
18129
|
-
var nexusCloudProjectPageSchema =
|
|
18130
|
-
projects:
|
|
18131
|
-
nextCursor:
|
|
18436
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
18437
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
18438
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18132
18439
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
18133
|
-
truncated:
|
|
18440
|
+
truncated: z29.boolean().default(false),
|
|
18134
18441
|
/** The project list itself was cut at 1000 (T12858). */
|
|
18135
|
-
projectsTruncated:
|
|
18442
|
+
projectsTruncated: z29.boolean().default(false)
|
|
18136
18443
|
});
|
|
18137
|
-
var nexusCloudProjectDetailSchema =
|
|
18138
|
-
project:
|
|
18139
|
-
role:
|
|
18140
|
-
canTrash:
|
|
18141
|
-
openConflicts:
|
|
18444
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
18445
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
18446
|
+
role: z29.string(),
|
|
18447
|
+
canTrash: z29.boolean().optional(),
|
|
18448
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18142
18449
|
/** At most 50, oldest attachment first. */
|
|
18143
|
-
replicas:
|
|
18450
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18144
18451
|
devices: nexusCloudDeviceCountsSchema,
|
|
18145
|
-
replicaCount:
|
|
18452
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18146
18453
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18147
18454
|
/** `replicas` was cut at 50. */
|
|
18148
|
-
truncated:
|
|
18149
|
-
stream:
|
|
18150
|
-
streamId:
|
|
18151
|
-
headSeq:
|
|
18152
|
-
headCheckpointId:
|
|
18455
|
+
truncated: z29.boolean().default(false),
|
|
18456
|
+
stream: z29.object({
|
|
18457
|
+
streamId: z29.string(),
|
|
18458
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18459
|
+
headCheckpointId: z29.string().nullable()
|
|
18153
18460
|
}).nullable()
|
|
18154
18461
|
});
|
|
18155
|
-
var nexusCloudReplicaPageSchema =
|
|
18156
|
-
replicas:
|
|
18462
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
18463
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18157
18464
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18158
|
-
nextCursor:
|
|
18159
|
-
truncated:
|
|
18465
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18466
|
+
truncated: z29.boolean().default(false)
|
|
18160
18467
|
});
|
|
18161
18468
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
18162
18469
|
"credential.valid",
|
|
@@ -18172,56 +18479,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
18172
18479
|
];
|
|
18173
18480
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
18174
18481
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
18175
|
-
var knownCheckId =
|
|
18176
|
-
var nexusCloudStatusCheckSchema =
|
|
18177
|
-
id:
|
|
18178
|
-
ok:
|
|
18179
|
-
required:
|
|
18180
|
-
detail:
|
|
18482
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
18483
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
18484
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
18485
|
+
ok: z29.boolean(),
|
|
18486
|
+
required: z29.boolean(),
|
|
18487
|
+
detail: z29.string()
|
|
18181
18488
|
});
|
|
18182
|
-
var nexusCloudStatusSchema =
|
|
18489
|
+
var nexusCloudStatusSchema = z29.object({
|
|
18183
18490
|
serverTime: isoTime.optional(),
|
|
18184
|
-
apiVersion:
|
|
18491
|
+
apiVersion: z29.string().optional(),
|
|
18185
18492
|
/**
|
|
18186
18493
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
18187
18494
|
* than the list, which therefore support none of them.
|
|
18188
18495
|
*/
|
|
18189
|
-
features:
|
|
18496
|
+
features: z29.array(z29.string()).optional(),
|
|
18190
18497
|
user: nexusCloudUserSchema,
|
|
18191
18498
|
credential: nexusCloudCredentialSchema,
|
|
18192
18499
|
device: nexusCloudDeviceSchema.nullable(),
|
|
18193
|
-
project:
|
|
18194
|
-
projectId:
|
|
18195
|
-
registered:
|
|
18196
|
-
organizationId:
|
|
18197
|
-
organizationName:
|
|
18198
|
-
role:
|
|
18500
|
+
project: z29.object({
|
|
18501
|
+
projectId: z29.string(),
|
|
18502
|
+
registered: z29.boolean(),
|
|
18503
|
+
organizationId: z29.string().nullable(),
|
|
18504
|
+
organizationName: z29.string().nullable(),
|
|
18505
|
+
role: z29.string().nullable()
|
|
18199
18506
|
}).nullable(),
|
|
18200
|
-
replica:
|
|
18201
|
-
replicaId:
|
|
18202
|
-
attached:
|
|
18203
|
-
attachedElsewhere:
|
|
18507
|
+
replica: z29.object({
|
|
18508
|
+
replicaId: z29.string(),
|
|
18509
|
+
attached: z29.boolean(),
|
|
18510
|
+
attachedElsewhere: z29.boolean(),
|
|
18204
18511
|
attachedAt: isoTime.nullable(),
|
|
18205
18512
|
lastSyncAt: isoTime.nullable(),
|
|
18206
18513
|
presenceAt: isoTime.nullable(),
|
|
18207
|
-
lastReplicaSeq:
|
|
18514
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
18208
18515
|
}).nullable(),
|
|
18209
|
-
stream:
|
|
18210
|
-
streamId:
|
|
18211
|
-
headSeq:
|
|
18212
|
-
headCheckpointId:
|
|
18213
|
-
openConflicts:
|
|
18516
|
+
stream: z29.object({
|
|
18517
|
+
streamId: z29.string(),
|
|
18518
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18519
|
+
headCheckpointId: z29.string().nullable(),
|
|
18520
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18214
18521
|
devices: nexusCloudDeviceCountsSchema
|
|
18215
18522
|
}).nullable(),
|
|
18216
18523
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
18217
|
-
checks:
|
|
18524
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
18218
18525
|
(list) => list.flatMap((c) => {
|
|
18219
18526
|
const id = knownCheckId.safeParse(c.id);
|
|
18220
18527
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
18221
18528
|
})
|
|
18222
18529
|
),
|
|
18223
18530
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
18224
|
-
verdict:
|
|
18531
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
18225
18532
|
});
|
|
18226
18533
|
var LOGIN = "run `cleo login nexus`";
|
|
18227
18534
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -18266,50 +18573,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
18266
18573
|
};
|
|
18267
18574
|
|
|
18268
18575
|
// packages/contracts/src/nexus-vault.ts
|
|
18269
|
-
import { z as
|
|
18270
|
-
var isoTime2 =
|
|
18271
|
-
var uuid =
|
|
18272
|
-
var nexusUserKeysSchema =
|
|
18273
|
-
keyVersion:
|
|
18274
|
-
masterKeyVerifier:
|
|
18576
|
+
import { z as z30 } from "zod";
|
|
18577
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
18578
|
+
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);
|
|
18579
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
18580
|
+
keyVersion: z30.number().int().positive(),
|
|
18581
|
+
masterKeyVerifier: z30.string()
|
|
18275
18582
|
});
|
|
18276
|
-
var nexusProjectKeysSchema =
|
|
18277
|
-
keys:
|
|
18278
|
-
|
|
18583
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
18584
|
+
keys: z30.array(
|
|
18585
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
18279
18586
|
)
|
|
18280
18587
|
});
|
|
18281
|
-
var nexusLeaseSchema =
|
|
18282
|
-
streamId:
|
|
18283
|
-
role:
|
|
18588
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
18589
|
+
streamId: z30.string(),
|
|
18590
|
+
role: z30.string(),
|
|
18284
18591
|
replicaId: uuid,
|
|
18285
18592
|
expiresAt: isoTime2,
|
|
18286
18593
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
18287
18594
|
});
|
|
18288
|
-
var nexusLeaseAcquireSchema =
|
|
18289
|
-
var nexusStreamHeadSchema =
|
|
18290
|
-
streamId:
|
|
18291
|
-
kind:
|
|
18292
|
-
headSeq:
|
|
18293
|
-
headCheckpointId:
|
|
18595
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
18596
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
18597
|
+
streamId: z30.string(),
|
|
18598
|
+
kind: z30.string().optional(),
|
|
18599
|
+
headSeq: z30.number().int().nonnegative(),
|
|
18600
|
+
headCheckpointId: z30.string().nullable(),
|
|
18294
18601
|
/**
|
|
18295
18602
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
18296
18603
|
* Absent from an older server.
|
|
18297
18604
|
*/
|
|
18298
|
-
maxSchemaVersion:
|
|
18605
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
18299
18606
|
});
|
|
18300
|
-
var nexusActivityEventSchema =
|
|
18301
|
-
id:
|
|
18607
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
18608
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
18302
18609
|
at: isoTime2,
|
|
18303
|
-
actorUserId:
|
|
18304
|
-
actorDeviceId:
|
|
18305
|
-
requestId:
|
|
18306
|
-
action:
|
|
18307
|
-
target:
|
|
18308
|
-
detail:
|
|
18610
|
+
actorUserId: z30.string().nullable().optional(),
|
|
18611
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
18612
|
+
requestId: z30.string().nullable().optional(),
|
|
18613
|
+
action: z30.string(),
|
|
18614
|
+
target: z30.string().nullable().optional(),
|
|
18615
|
+
detail: z30.unknown().optional()
|
|
18309
18616
|
});
|
|
18310
|
-
var nexusActivityPageSchema =
|
|
18311
|
-
events:
|
|
18312
|
-
nextBefore:
|
|
18617
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
18618
|
+
events: z30.array(nexusActivityEventSchema),
|
|
18619
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
18313
18620
|
});
|
|
18314
18621
|
|
|
18315
18622
|
// packages/adapters/src/providers/kimi/spawn.ts
|