@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
|
@@ -1422,17 +1422,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
1422
1422
|
});
|
|
1423
1423
|
|
|
1424
1424
|
// packages/contracts/src/config/manifest.ts
|
|
1425
|
-
import { z as
|
|
1425
|
+
import { z as z6 } from "zod";
|
|
1426
1426
|
|
|
1427
|
-
// packages/contracts/src/
|
|
1427
|
+
// packages/contracts/src/orca-execution.ts
|
|
1428
1428
|
import { z as z4 } from "zod";
|
|
1429
|
-
var
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1429
|
+
var identifier = z4.string().min(1);
|
|
1430
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
1431
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
1432
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
1433
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
1434
|
+
});
|
|
1435
|
+
var orcaContextSchema = z4.object({
|
|
1436
|
+
runtimeId: identifier,
|
|
1437
|
+
coordinatorHandle: identifier,
|
|
1438
|
+
executionHostId: z4.literal("local")
|
|
1439
|
+
});
|
|
1440
|
+
var orcaRoutingRunSchema = z4.object({
|
|
1441
|
+
runId: identifier.nullable(),
|
|
1442
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
1443
|
+
});
|
|
1444
|
+
var orcaLaunchSchema = z4.object({
|
|
1445
|
+
projectId: identifier,
|
|
1446
|
+
projectRoot: identifier,
|
|
1447
|
+
taskId: identifier,
|
|
1448
|
+
instanceId: identifier,
|
|
1449
|
+
workerSessionId: identifier,
|
|
1450
|
+
agentId: identifier,
|
|
1451
|
+
role: z4.enum(["worker", "lead"]),
|
|
1452
|
+
protocol: identifier,
|
|
1453
|
+
worktreePath: identifier,
|
|
1454
|
+
worktreeBranch: identifier,
|
|
1455
|
+
projectHash: identifier,
|
|
1456
|
+
lockToken: identifier,
|
|
1457
|
+
prompt: identifier,
|
|
1458
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
1459
|
+
leadMailbox: identifier.nullable(),
|
|
1460
|
+
model: identifier.optional(),
|
|
1461
|
+
effort: identifier.optional(),
|
|
1462
|
+
accountId: identifier.optional()
|
|
1463
|
+
});
|
|
1464
|
+
var orcaStartBindingSchema = z4.object({
|
|
1465
|
+
runId: identifier.nullable(),
|
|
1466
|
+
orcaTaskId: identifier.nullable(),
|
|
1467
|
+
retryOf: identifier.nullable()
|
|
1468
|
+
});
|
|
1469
|
+
var orcaAttemptSchema = z4.object({
|
|
1470
|
+
backend: z4.literal("orca"),
|
|
1471
|
+
version: z4.literal(1),
|
|
1472
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
1473
|
+
revision: z4.number().int().nonnegative(),
|
|
1474
|
+
context: orcaContextSchema,
|
|
1475
|
+
launch: orcaLaunchSchema,
|
|
1476
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1477
|
+
workspaceId: identifier,
|
|
1478
|
+
workspaceSelector: identifier,
|
|
1479
|
+
state: z4.enum([
|
|
1480
|
+
"prepared",
|
|
1481
|
+
"launching",
|
|
1482
|
+
"ready",
|
|
1483
|
+
"turn_unobserved",
|
|
1484
|
+
"outcome_unknown",
|
|
1485
|
+
"stop_pending",
|
|
1486
|
+
"stop_unknown",
|
|
1487
|
+
"stopped",
|
|
1488
|
+
"failed",
|
|
1489
|
+
"circuit_broken"
|
|
1490
|
+
]),
|
|
1491
|
+
runId: identifier.nullable(),
|
|
1492
|
+
orcaTaskId: identifier.nullable(),
|
|
1493
|
+
dispatchId: identifier.nullable(),
|
|
1494
|
+
retryOf: identifier.nullable(),
|
|
1495
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
1496
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
1497
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
1498
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
1499
|
+
startRequestId: identifier.nullable(),
|
|
1500
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
1501
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
1502
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
1503
|
+
stopRequestId: identifier.nullable(),
|
|
1504
|
+
/**
|
|
1505
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
1506
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
1507
|
+
*/
|
|
1508
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
1509
|
+
failureCount: z4.number().int().nonnegative(),
|
|
1510
|
+
resourceState: z4.string(),
|
|
1511
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
1512
|
+
lastReceipt: z4.string().nullable(),
|
|
1513
|
+
lastError: z4.string().nullable(),
|
|
1514
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
1515
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
1516
|
+
observedAt: z4.string()
|
|
1517
|
+
});
|
|
1518
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
1519
|
+
messageId: identifier,
|
|
1520
|
+
runtimeId: identifier,
|
|
1521
|
+
runId: identifier,
|
|
1522
|
+
orcaTaskId: identifier,
|
|
1523
|
+
dispatchId: identifier,
|
|
1524
|
+
senderHandle: identifier,
|
|
1525
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1526
|
+
body: z4.string(),
|
|
1527
|
+
reportPath: identifier
|
|
1528
|
+
});
|
|
1529
|
+
var orcaWorkerReportSchema = z4.object({
|
|
1530
|
+
event: orcaWorkerDoneSchema,
|
|
1531
|
+
manifestId: identifier,
|
|
1532
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1533
|
+
reportText: z4.string().min(1).max(65536),
|
|
1534
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1535
|
+
ingestedAt: z4.string().datetime()
|
|
1536
|
+
});
|
|
1537
|
+
var orcaReportDeliverySchema = z4.object({
|
|
1538
|
+
key: identifier,
|
|
1539
|
+
mailbox: identifier.nullable(),
|
|
1540
|
+
state: z4.enum(["pending", "delivered"]),
|
|
1541
|
+
messageId: identifier.nullable(),
|
|
1542
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
1543
|
+
lastError: z4.string().nullable()
|
|
1544
|
+
});
|
|
1545
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
1546
|
+
resourceRelease: z4.object({
|
|
1547
|
+
dispatchId: identifier,
|
|
1548
|
+
releasedAt: z4.string().datetime(),
|
|
1549
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1550
|
+
receipt: identifier
|
|
1551
|
+
}).optional(),
|
|
1552
|
+
retiredAt: z4.string().datetime().optional(),
|
|
1553
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
1554
|
+
});
|
|
1555
|
+
var orcaReportMessageSchema = z4.object({
|
|
1556
|
+
id: identifier,
|
|
1557
|
+
run_id: z4.string().nullable(),
|
|
1558
|
+
delivery_contract: z4.string(),
|
|
1559
|
+
from_handle: z4.string(),
|
|
1560
|
+
to_handle: z4.string(),
|
|
1561
|
+
type: z4.string(),
|
|
1562
|
+
body: z4.string(),
|
|
1563
|
+
payload: z4.string().nullable(),
|
|
1564
|
+
sender_pane_key: z4.string().nullable()
|
|
1565
|
+
});
|
|
1566
|
+
var orcaReportSourceSchema = z4.object({
|
|
1567
|
+
ok: z4.literal(true),
|
|
1568
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
1569
|
+
result: z4.object({
|
|
1570
|
+
messages: z4.array(z4.json()).optional(),
|
|
1571
|
+
dispatch: z4.object({
|
|
1572
|
+
id: identifier,
|
|
1573
|
+
run_id: identifier,
|
|
1574
|
+
task_id: identifier,
|
|
1575
|
+
assignee_handle: identifier,
|
|
1576
|
+
assignee_pane_key: z4.string().nullable(),
|
|
1577
|
+
status: z4.string()
|
|
1578
|
+
}).optional()
|
|
1579
|
+
})
|
|
1580
|
+
});
|
|
1581
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
1582
|
+
taskId: identifier,
|
|
1583
|
+
dispatchId: identifier,
|
|
1584
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1585
|
+
reportPath: identifier
|
|
1586
|
+
});
|
|
1587
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
1588
|
+
action: z4.enum([
|
|
1589
|
+
"show",
|
|
1590
|
+
"read",
|
|
1591
|
+
"recover-start",
|
|
1592
|
+
"recover-stop",
|
|
1593
|
+
"retry",
|
|
1594
|
+
"stop",
|
|
1595
|
+
"ingest-report",
|
|
1596
|
+
"relay-report"
|
|
1597
|
+
]),
|
|
1598
|
+
recordId: identifier,
|
|
1599
|
+
cursor: identifier.optional(),
|
|
1600
|
+
messageId: identifier.optional()
|
|
1601
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
1602
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
1603
|
+
path: ["cursor"]
|
|
1604
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
1605
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
1606
|
+
path: ["messageId"]
|
|
1607
|
+
});
|
|
1608
|
+
var effectSchema = z4.object({
|
|
1609
|
+
kind: z4.string(),
|
|
1610
|
+
role: z4.string().optional(),
|
|
1611
|
+
action: z4.string().optional(),
|
|
1612
|
+
id: z4.string().optional()
|
|
1613
|
+
});
|
|
1614
|
+
var selectionSchema = z4.object({
|
|
1615
|
+
agent: z4.string().nullable().optional(),
|
|
1616
|
+
model: z4.string().nullable().optional(),
|
|
1617
|
+
effort: z4.string().nullable().optional()
|
|
1618
|
+
});
|
|
1619
|
+
var orcaReplySchema = z4.object({
|
|
1620
|
+
ok: z4.boolean(),
|
|
1621
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
1622
|
+
error: z4.object({
|
|
1623
|
+
code: z4.string(),
|
|
1624
|
+
message: z4.string(),
|
|
1625
|
+
data: z4.object({
|
|
1626
|
+
requestId: identifier.optional(),
|
|
1627
|
+
orchestrationRequestId: identifier.optional(),
|
|
1628
|
+
dispatchId: identifier.optional()
|
|
1629
|
+
}).optional()
|
|
1630
|
+
}).optional(),
|
|
1631
|
+
result: z4.object({
|
|
1632
|
+
state: z4.string().optional(),
|
|
1633
|
+
requestId: identifier.optional(),
|
|
1634
|
+
/**
|
|
1635
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
1636
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
1637
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
1638
|
+
* be bound to the request key this attempt issued.
|
|
1639
|
+
*/
|
|
1640
|
+
mutation: z4.object({
|
|
1641
|
+
requestId: identifier.optional(),
|
|
1642
|
+
replayed: z4.boolean().optional()
|
|
1643
|
+
}).optional(),
|
|
1644
|
+
stage: z4.string().optional(),
|
|
1645
|
+
turnStart: z4.string().optional(),
|
|
1646
|
+
runId: identifier.optional(),
|
|
1647
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
1648
|
+
taskId: identifier.optional(),
|
|
1649
|
+
dispatchId: identifier.optional(),
|
|
1650
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
1651
|
+
effects: z4.array(effectSchema).optional(),
|
|
1652
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
1653
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
1654
|
+
lastError: z4.string().nullable().optional(),
|
|
1655
|
+
processAction: z4.string().optional(),
|
|
1656
|
+
helpers: z4.array(
|
|
1657
|
+
z4.object({
|
|
1658
|
+
dispatchId: identifier.optional(),
|
|
1659
|
+
creatorDispatchId: identifier.optional(),
|
|
1660
|
+
outcome: z4.string(),
|
|
1661
|
+
keptOpenBy: identifier.optional(),
|
|
1662
|
+
state: z4.string().optional(),
|
|
1663
|
+
lastError: z4.string().nullable().optional()
|
|
1664
|
+
})
|
|
1665
|
+
).optional(),
|
|
1666
|
+
helperStopError: z4.string().nullable().optional(),
|
|
1667
|
+
status: z4.string().optional(),
|
|
1668
|
+
terminal: z4.object({
|
|
1669
|
+
handle: identifier,
|
|
1670
|
+
connected: z4.boolean(),
|
|
1671
|
+
writable: z4.boolean(),
|
|
1672
|
+
executionHostId: identifier
|
|
1673
|
+
}).optional(),
|
|
1674
|
+
runtime: z4.object({
|
|
1675
|
+
runtimeId: identifier,
|
|
1676
|
+
reachable: z4.boolean(),
|
|
1677
|
+
state: z4.string(),
|
|
1678
|
+
capabilities: z4.array(z4.string())
|
|
1679
|
+
}).optional(),
|
|
1680
|
+
worktree: z4.object({
|
|
1681
|
+
id: identifier,
|
|
1682
|
+
path: identifier,
|
|
1683
|
+
branch: identifier,
|
|
1684
|
+
hostId: identifier,
|
|
1685
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
1686
|
+
}).optional(),
|
|
1687
|
+
dispatch: z4.object({
|
|
1688
|
+
id: identifier,
|
|
1689
|
+
runId: identifier,
|
|
1690
|
+
taskId: identifier,
|
|
1691
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
1692
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
1693
|
+
failureCount: z4.number().int().nonnegative()
|
|
1694
|
+
}).optional(),
|
|
1695
|
+
worker: z4.object({
|
|
1696
|
+
dispatchId: identifier,
|
|
1697
|
+
runtimeEpoch: identifier,
|
|
1698
|
+
state: z4.string(),
|
|
1699
|
+
stage: z4.string(),
|
|
1700
|
+
worktreeId: identifier.nullable()
|
|
1701
|
+
}).optional(),
|
|
1702
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
1703
|
+
projection: z4.object({
|
|
1704
|
+
resource: z4.object({
|
|
1705
|
+
state: z4.string(),
|
|
1706
|
+
terminalState: z4.string(),
|
|
1707
|
+
ownerDispatchId: identifier.optional(),
|
|
1708
|
+
releaseState: z4.string().optional()
|
|
1709
|
+
}).optional()
|
|
1710
|
+
}).optional()
|
|
1711
|
+
}).optional()
|
|
1712
|
+
});
|
|
1713
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
1714
|
+
schemaVersion: z4.number().int().positive(),
|
|
1715
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
1716
|
+
});
|
|
1717
|
+
var accountProviderSchema = z4.object({
|
|
1718
|
+
accounts: z4.array(z4.object({})),
|
|
1719
|
+
activeAccountId: identifier.nullable()
|
|
1720
|
+
});
|
|
1721
|
+
var orcaAccountReplySchema = z4.object({
|
|
1722
|
+
ok: z4.literal(true),
|
|
1723
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
1724
|
+
result: z4.object({
|
|
1725
|
+
codex: accountProviderSchema,
|
|
1726
|
+
opencode: accountProviderSchema,
|
|
1727
|
+
claude: accountProviderSchema
|
|
1728
|
+
})
|
|
1729
|
+
});
|
|
1730
|
+
|
|
1731
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
1732
|
+
import { z as z5 } from "zod";
|
|
1733
|
+
var projectWorkerPolicySchema = z5.object({
|
|
1734
|
+
verification: z5.object({
|
|
1735
|
+
full: z5.enum(["local", "ci"]),
|
|
1736
|
+
local: z5.enum(["single-file", "affected"])
|
|
1433
1737
|
}).strict().optional(),
|
|
1434
|
-
instructions:
|
|
1435
|
-
|
|
1738
|
+
instructions: z5.array(
|
|
1739
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
1436
1740
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
1437
1741
|
"Instructions must be single-line text without control characters or a leading #"
|
|
1438
1742
|
)
|
|
@@ -1460,8 +1764,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
1460
1764
|
path: ".cleo/config.json",
|
|
1461
1765
|
mergePrecedence: 20,
|
|
1462
1766
|
driftDetection: "schema-validate",
|
|
1463
|
-
schema:
|
|
1464
|
-
orchestrate:
|
|
1767
|
+
schema: z6.object({
|
|
1768
|
+
orchestrate: z6.object({
|
|
1769
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
1770
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
1771
|
+
}).passthrough().optional()
|
|
1465
1772
|
}).passthrough()
|
|
1466
1773
|
};
|
|
1467
1774
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -1477,139 +1784,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
1477
1784
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
1478
1785
|
CLEO_CONFIG_MANIFEST
|
|
1479
1786
|
]);
|
|
1480
|
-
var configManifestEntrySchema =
|
|
1481
|
-
id:
|
|
1482
|
-
scope:
|
|
1483
|
-
path:
|
|
1484
|
-
schema:
|
|
1485
|
-
mergePrecedence:
|
|
1486
|
-
driftDetection:
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1787
|
+
var configManifestEntrySchema = z6.object({
|
|
1788
|
+
id: z6.string().min(1),
|
|
1789
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
1790
|
+
path: z6.string().min(1),
|
|
1791
|
+
schema: z6.unknown().optional(),
|
|
1792
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
1793
|
+
driftDetection: z6.union([
|
|
1794
|
+
z6.literal("schema-validate"),
|
|
1795
|
+
z6.literal("staleness-gate"),
|
|
1796
|
+
z6.literal("value-diff"),
|
|
1797
|
+
z6.literal("none")
|
|
1491
1798
|
]),
|
|
1492
|
-
defaults:
|
|
1799
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
1493
1800
|
});
|
|
1494
1801
|
|
|
1495
1802
|
// packages/contracts/src/daemon/health.ts
|
|
1496
|
-
import { z as
|
|
1803
|
+
import { z as z8 } from "zod";
|
|
1497
1804
|
|
|
1498
1805
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
1499
|
-
import { z as
|
|
1500
|
-
var EnvPairSchema =
|
|
1806
|
+
import { z as z7 } from "zod";
|
|
1807
|
+
var EnvPairSchema = z7.object({
|
|
1501
1808
|
/** Environment variable name. */
|
|
1502
|
-
key:
|
|
1809
|
+
key: z7.string().min(1),
|
|
1503
1810
|
/** Environment variable value. */
|
|
1504
|
-
value:
|
|
1811
|
+
value: z7.string()
|
|
1505
1812
|
}).strict();
|
|
1506
|
-
var ChildStateSchema =
|
|
1507
|
-
var ChildStatusSchema =
|
|
1813
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
1814
|
+
var ChildStatusSchema = z7.object({
|
|
1508
1815
|
/** Logical id of the child (stable across restarts). */
|
|
1509
|
-
child_id:
|
|
1816
|
+
child_id: z7.string().min(1),
|
|
1510
1817
|
/** Current OS pid (0 when not currently running). */
|
|
1511
|
-
pid:
|
|
1818
|
+
pid: z7.number().int().nonnegative(),
|
|
1512
1819
|
/** Current liveness state. */
|
|
1513
1820
|
state: ChildStateSchema,
|
|
1514
1821
|
/** Total restarts observed for this child. */
|
|
1515
|
-
restart_count:
|
|
1822
|
+
restart_count: z7.number().int().nonnegative()
|
|
1516
1823
|
}).strict();
|
|
1517
|
-
var SpawnRequestSchema =
|
|
1824
|
+
var SpawnRequestSchema = z7.object({
|
|
1518
1825
|
/** Tag discriminating this request variant. */
|
|
1519
|
-
kind:
|
|
1826
|
+
kind: z7.literal("spawn"),
|
|
1520
1827
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
1521
|
-
child_id:
|
|
1828
|
+
child_id: z7.string().min(1),
|
|
1522
1829
|
/** Absolute path to the program to execute. */
|
|
1523
|
-
program:
|
|
1830
|
+
program: z7.string().min(1),
|
|
1524
1831
|
/** Arguments passed to the program. */
|
|
1525
|
-
args:
|
|
1832
|
+
args: z7.array(z7.string()).default([]),
|
|
1526
1833
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
1527
|
-
env:
|
|
1834
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
1528
1835
|
/** Optional working directory for the child. */
|
|
1529
|
-
cwd:
|
|
1836
|
+
cwd: z7.string().optional()
|
|
1530
1837
|
}).strict();
|
|
1531
|
-
var RestartRequestSchema =
|
|
1838
|
+
var RestartRequestSchema = z7.object({
|
|
1532
1839
|
/** Tag discriminating this request variant. */
|
|
1533
|
-
kind:
|
|
1840
|
+
kind: z7.literal("restart"),
|
|
1534
1841
|
/** Logical id of the child to restart. */
|
|
1535
|
-
child_id:
|
|
1842
|
+
child_id: z7.string().min(1)
|
|
1536
1843
|
}).strict();
|
|
1537
|
-
var MonitorRequestSchema =
|
|
1844
|
+
var MonitorRequestSchema = z7.object({
|
|
1538
1845
|
/** Tag discriminating this request variant. */
|
|
1539
|
-
kind:
|
|
1846
|
+
kind: z7.literal("monitor"),
|
|
1540
1847
|
/** Specific child id to monitor; omit to request all children. */
|
|
1541
|
-
child_id:
|
|
1848
|
+
child_id: z7.string().optional()
|
|
1542
1849
|
}).strict();
|
|
1543
|
-
var HealthRequestSchema =
|
|
1850
|
+
var HealthRequestSchema = z7.object({
|
|
1544
1851
|
/** Tag discriminating this request variant. */
|
|
1545
|
-
kind:
|
|
1852
|
+
kind: z7.literal("health")
|
|
1546
1853
|
}).strict();
|
|
1547
|
-
var SupervisorIpcRequestSchema =
|
|
1854
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
1548
1855
|
SpawnRequestSchema,
|
|
1549
1856
|
RestartRequestSchema,
|
|
1550
1857
|
MonitorRequestSchema,
|
|
1551
1858
|
HealthRequestSchema
|
|
1552
1859
|
]);
|
|
1553
|
-
var SpawnedResponseSchema =
|
|
1860
|
+
var SpawnedResponseSchema = z7.object({
|
|
1554
1861
|
/** Tag discriminating this response variant. */
|
|
1555
|
-
kind:
|
|
1862
|
+
kind: z7.literal("spawned"),
|
|
1556
1863
|
/** Logical id of the spawned child. */
|
|
1557
|
-
child_id:
|
|
1864
|
+
child_id: z7.string().min(1),
|
|
1558
1865
|
/** OS pid assigned to the spawned child. */
|
|
1559
|
-
pid:
|
|
1866
|
+
pid: z7.number().int().nonnegative()
|
|
1560
1867
|
}).strict();
|
|
1561
|
-
var RestartedResponseSchema =
|
|
1868
|
+
var RestartedResponseSchema = z7.object({
|
|
1562
1869
|
/** Tag discriminating this response variant. */
|
|
1563
|
-
kind:
|
|
1870
|
+
kind: z7.literal("restarted"),
|
|
1564
1871
|
/** Logical id of the restarted child. */
|
|
1565
|
-
child_id:
|
|
1872
|
+
child_id: z7.string().min(1),
|
|
1566
1873
|
/** New OS pid after the restart. */
|
|
1567
|
-
pid:
|
|
1874
|
+
pid: z7.number().int().nonnegative(),
|
|
1568
1875
|
/** Number of times this child has been restarted in total. */
|
|
1569
|
-
restart_count:
|
|
1876
|
+
restart_count: z7.number().int().nonnegative()
|
|
1570
1877
|
}).strict();
|
|
1571
|
-
var MonitorResponseSchema =
|
|
1878
|
+
var MonitorResponseSchema = z7.object({
|
|
1572
1879
|
/** Tag discriminating this response variant. */
|
|
1573
|
-
kind:
|
|
1880
|
+
kind: z7.literal("monitor"),
|
|
1574
1881
|
/** One row per monitored child. */
|
|
1575
|
-
children:
|
|
1882
|
+
children: z7.array(ChildStatusSchema)
|
|
1576
1883
|
}).strict();
|
|
1577
|
-
var HealthResponseSchema =
|
|
1884
|
+
var HealthResponseSchema = z7.object({
|
|
1578
1885
|
/** Tag discriminating this response variant. */
|
|
1579
|
-
kind:
|
|
1886
|
+
kind: z7.literal("health"),
|
|
1580
1887
|
/** Supervisor process pid. */
|
|
1581
|
-
pid:
|
|
1888
|
+
pid: z7.number().int().nonnegative(),
|
|
1582
1889
|
/** Number of children currently tracked. */
|
|
1583
|
-
child_count:
|
|
1890
|
+
child_count: z7.number().int().nonnegative(),
|
|
1584
1891
|
/** Seconds the supervisor has been running. */
|
|
1585
|
-
uptime_secs:
|
|
1892
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
1586
1893
|
/** Frozen protocol version the supervisor speaks. */
|
|
1587
|
-
protocol_version:
|
|
1894
|
+
protocol_version: z7.string()
|
|
1588
1895
|
}).strict();
|
|
1589
|
-
var LifecycleEventKindSchema =
|
|
1590
|
-
var LifecycleEventResponseSchema =
|
|
1896
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
1897
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
1591
1898
|
/** Tag discriminating this response variant. */
|
|
1592
|
-
kind:
|
|
1899
|
+
kind: z7.literal("event"),
|
|
1593
1900
|
/** What happened. */
|
|
1594
1901
|
event: LifecycleEventKindSchema,
|
|
1595
1902
|
/** Logical id of the affected child. */
|
|
1596
|
-
child_id:
|
|
1903
|
+
child_id: z7.string().min(1),
|
|
1597
1904
|
/** Exit code, when the OS reported one. */
|
|
1598
|
-
exit_code:
|
|
1905
|
+
exit_code: z7.number().int().optional(),
|
|
1599
1906
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
1600
|
-
signal:
|
|
1907
|
+
signal: z7.string().optional(),
|
|
1601
1908
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
1602
|
-
restart_delay_ms:
|
|
1909
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
1603
1910
|
}).strict();
|
|
1604
|
-
var ErrorResponseSchema =
|
|
1911
|
+
var ErrorResponseSchema = z7.object({
|
|
1605
1912
|
/** Tag discriminating this response variant. */
|
|
1606
|
-
kind:
|
|
1913
|
+
kind: z7.literal("error"),
|
|
1607
1914
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
1608
|
-
code:
|
|
1915
|
+
code: z7.string().min(1),
|
|
1609
1916
|
/** Human-readable error message. */
|
|
1610
|
-
message:
|
|
1917
|
+
message: z7.string()
|
|
1611
1918
|
}).strict();
|
|
1612
|
-
var SupervisorIpcResponseSchema =
|
|
1919
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
1613
1920
|
SpawnedResponseSchema,
|
|
1614
1921
|
RestartedResponseSchema,
|
|
1615
1922
|
MonitorResponseSchema,
|
|
@@ -1617,27 +1924,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
1617
1924
|
LifecycleEventResponseSchema,
|
|
1618
1925
|
ErrorResponseSchema
|
|
1619
1926
|
]);
|
|
1620
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
1927
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
1621
1928
|
/** Frozen protocol version. */
|
|
1622
|
-
protocol_version:
|
|
1929
|
+
protocol_version: z7.string(),
|
|
1623
1930
|
/** Correlation id echoed back on the matching response. */
|
|
1624
|
-
id:
|
|
1931
|
+
id: z7.string().min(1),
|
|
1625
1932
|
/** Direction discriminator. */
|
|
1626
|
-
direction:
|
|
1933
|
+
direction: z7.literal("request"),
|
|
1627
1934
|
/** The request body. */
|
|
1628
1935
|
request: SupervisorIpcRequestSchema
|
|
1629
1936
|
}).strict();
|
|
1630
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
1937
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
1631
1938
|
/** Frozen protocol version. */
|
|
1632
|
-
protocol_version:
|
|
1939
|
+
protocol_version: z7.string(),
|
|
1633
1940
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
1634
|
-
id:
|
|
1941
|
+
id: z7.string().min(1),
|
|
1635
1942
|
/** Direction discriminator. */
|
|
1636
|
-
direction:
|
|
1943
|
+
direction: z7.literal("response"),
|
|
1637
1944
|
/** The response body. */
|
|
1638
1945
|
response: SupervisorIpcResponseSchema
|
|
1639
1946
|
}).strict();
|
|
1640
|
-
var SupervisorIpcEnvelopeSchema =
|
|
1947
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
1641
1948
|
SupervisorIpcRequestEnvelopeSchema,
|
|
1642
1949
|
SupervisorIpcResponseEnvelopeSchema
|
|
1643
1950
|
]);
|
|
@@ -1661,17 +1968,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
1661
1968
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
1662
1969
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
1663
1970
|
*/
|
|
1664
|
-
detail:
|
|
1971
|
+
detail: z8.string().optional()
|
|
1665
1972
|
}).strict();
|
|
1666
|
-
var HealthStatusSchema =
|
|
1973
|
+
var HealthStatusSchema = z8.object({
|
|
1667
1974
|
/** One health row per registered subsystem. */
|
|
1668
|
-
subsystems:
|
|
1975
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
1669
1976
|
/**
|
|
1670
1977
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
1671
1978
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
1672
1979
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
1673
1980
|
*/
|
|
1674
|
-
allHealthy:
|
|
1981
|
+
allHealthy: z8.boolean()
|
|
1675
1982
|
}).strict();
|
|
1676
1983
|
|
|
1677
1984
|
// packages/contracts/src/db-inventory.json
|
|
@@ -13600,7 +13907,7 @@ var OPERATIONS = [
|
|
|
13600
13907
|
];
|
|
13601
13908
|
|
|
13602
13909
|
// packages/contracts/src/docs/modernize.ts
|
|
13603
|
-
import { z as
|
|
13910
|
+
import { z as z9 } from "zod";
|
|
13604
13911
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
13605
13912
|
var DOCS_MODERNIZE_OPS = [
|
|
13606
13913
|
"ingest",
|
|
@@ -13614,105 +13921,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
13614
13921
|
"reslug",
|
|
13615
13922
|
"link-task"
|
|
13616
13923
|
];
|
|
13617
|
-
var judgmentSchema =
|
|
13618
|
-
question:
|
|
13619
|
-
site:
|
|
13620
|
-
mode:
|
|
13621
|
-
ruleAnswer:
|
|
13622
|
-
decidedAnswer:
|
|
13623
|
-
decidedConfidence:
|
|
13624
|
-
source:
|
|
13625
|
-
acted:
|
|
13924
|
+
var judgmentSchema = z9.object({
|
|
13925
|
+
question: z9.enum(["classify", "merge"]),
|
|
13926
|
+
site: z9.string(),
|
|
13927
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
13928
|
+
ruleAnswer: z9.string(),
|
|
13929
|
+
decidedAnswer: z9.string().nullable(),
|
|
13930
|
+
decidedConfidence: z9.number().nullable(),
|
|
13931
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
13932
|
+
acted: z9.string()
|
|
13626
13933
|
});
|
|
13627
|
-
var relPath =
|
|
13628
|
-
var docsModernizePlanSchema =
|
|
13629
|
-
root:
|
|
13630
|
-
generatedAt:
|
|
13631
|
-
mode:
|
|
13632
|
-
counts:
|
|
13633
|
-
rows:
|
|
13634
|
-
|
|
13934
|
+
var relPath = z9.string().min(1).max(1024);
|
|
13935
|
+
var docsModernizePlanSchema = z9.object({
|
|
13936
|
+
root: z9.string().min(1),
|
|
13937
|
+
generatedAt: z9.string(),
|
|
13938
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
13939
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
13940
|
+
rows: z9.array(
|
|
13941
|
+
z9.object({
|
|
13635
13942
|
path: relPath,
|
|
13636
|
-
sha256:
|
|
13637
|
-
kind:
|
|
13638
|
-
slug:
|
|
13639
|
-
title:
|
|
13640
|
-
disposition:
|
|
13641
|
-
target:
|
|
13642
|
-
reasons:
|
|
13643
|
-
judgments:
|
|
13644
|
-
ownerTasks:
|
|
13645
|
-
category:
|
|
13646
|
-
refs:
|
|
13647
|
-
overridden:
|
|
13648
|
-
covers:
|
|
13649
|
-
baselineRemove:
|
|
13943
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
13944
|
+
kind: z9.string().min(1),
|
|
13945
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
13946
|
+
title: z9.string(),
|
|
13947
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
13948
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
13949
|
+
reasons: z9.array(z9.string()),
|
|
13950
|
+
judgments: z9.array(judgmentSchema),
|
|
13951
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
13952
|
+
category: z9.string(),
|
|
13953
|
+
refs: z9.array(z9.string()),
|
|
13954
|
+
overridden: z9.boolean(),
|
|
13955
|
+
covers: z9.array(z9.string()),
|
|
13956
|
+
baselineRemove: z9.boolean()
|
|
13650
13957
|
})
|
|
13651
13958
|
),
|
|
13652
|
-
linkFixes:
|
|
13653
|
-
|
|
13654
|
-
kind:
|
|
13959
|
+
linkFixes: z9.array(
|
|
13960
|
+
z9.object({
|
|
13961
|
+
kind: z9.literal("link-fix"),
|
|
13655
13962
|
path: relPath,
|
|
13656
|
-
href:
|
|
13657
|
-
newHref:
|
|
13658
|
-
base:
|
|
13659
|
-
sha256:
|
|
13963
|
+
href: z9.string().min(1).max(2048),
|
|
13964
|
+
newHref: z9.string().min(1).max(2048),
|
|
13965
|
+
base: z9.literal("repo").optional(),
|
|
13966
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
13660
13967
|
})
|
|
13661
13968
|
).optional(),
|
|
13662
|
-
repoRoot:
|
|
13969
|
+
repoRoot: z9.string().min(1).optional()
|
|
13663
13970
|
});
|
|
13664
|
-
var docsModernizeOverridesSchema =
|
|
13971
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
13665
13972
|
relPath,
|
|
13666
|
-
|
|
13667
|
-
disposition:
|
|
13668
|
-
target:
|
|
13669
|
-
reason:
|
|
13670
|
-
kind:
|
|
13671
|
-
slug:
|
|
13672
|
-
covers:
|
|
13973
|
+
z9.object({
|
|
13974
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
13975
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
13976
|
+
reason: z9.string().min(1),
|
|
13977
|
+
kind: z9.string().min(1).optional(),
|
|
13978
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
13979
|
+
covers: z9.array(z9.string()).optional()
|
|
13673
13980
|
})
|
|
13674
13981
|
);
|
|
13675
|
-
var receiptOpSchema =
|
|
13676
|
-
op:
|
|
13677
|
-
state:
|
|
13678
|
-
slug:
|
|
13982
|
+
var receiptOpSchema = z9.object({
|
|
13983
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
13984
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
13985
|
+
slug: z9.string().nullable(),
|
|
13679
13986
|
path: relPath.nullable(),
|
|
13680
|
-
target:
|
|
13681
|
-
attachmentId:
|
|
13682
|
-
ownerId:
|
|
13683
|
-
beforeSha256:
|
|
13684
|
-
afterSha256:
|
|
13685
|
-
prior:
|
|
13686
|
-
lifecycleStatus:
|
|
13687
|
-
supersededBy:
|
|
13688
|
-
supersedes:
|
|
13689
|
-
previousAttachmentId:
|
|
13690
|
-
newAttachmentId:
|
|
13691
|
-
linkTargets:
|
|
13692
|
-
kind:
|
|
13987
|
+
target: z9.string().nullable(),
|
|
13988
|
+
attachmentId: z9.string().nullable(),
|
|
13989
|
+
ownerId: z9.string().nullable(),
|
|
13990
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
13991
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
13992
|
+
prior: z9.object({
|
|
13993
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
13994
|
+
supersededBy: z9.string().nullable().optional(),
|
|
13995
|
+
supersedes: z9.string().nullable().optional(),
|
|
13996
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
13997
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
13998
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
13999
|
+
kind: z9.string().nullable().optional()
|
|
13693
14000
|
}).optional(),
|
|
13694
|
-
base:
|
|
14001
|
+
base: z9.literal("repo").optional()
|
|
13695
14002
|
});
|
|
13696
14003
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
13697
|
-
i:
|
|
14004
|
+
i: z9.number().int().min(0)
|
|
13698
14005
|
});
|
|
13699
|
-
var docsModernizeReceiptSchema =
|
|
13700
|
-
runId:
|
|
13701
|
-
root:
|
|
13702
|
-
appliedAt:
|
|
13703
|
-
planSha256:
|
|
13704
|
-
edgeCount:
|
|
13705
|
-
rolledBackAt:
|
|
13706
|
-
blobs:
|
|
13707
|
-
moves:
|
|
13708
|
-
deleted:
|
|
13709
|
-
ops:
|
|
13710
|
-
durationMs:
|
|
13711
|
-
repoRoot:
|
|
14006
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
14007
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
14008
|
+
root: z9.string().min(1),
|
|
14009
|
+
appliedAt: z9.string(),
|
|
14010
|
+
planSha256: z9.string(),
|
|
14011
|
+
edgeCount: z9.number(),
|
|
14012
|
+
rolledBackAt: z9.string().nullable(),
|
|
14013
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
14014
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
14015
|
+
deleted: z9.array(relPath),
|
|
14016
|
+
ops: z9.array(receiptOpSchema),
|
|
14017
|
+
durationMs: z9.number().optional(),
|
|
14018
|
+
repoRoot: z9.string().min(1).optional()
|
|
13712
14019
|
});
|
|
13713
14020
|
|
|
13714
14021
|
// packages/contracts/src/docs/provenance.ts
|
|
13715
|
-
import { z as
|
|
14022
|
+
import { z as z10 } from "zod";
|
|
13716
14023
|
var PROVENANCE_NODE_KINDS = [
|
|
13717
14024
|
"doc",
|
|
13718
14025
|
"task",
|
|
@@ -13735,96 +14042,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
13735
14042
|
"archived",
|
|
13736
14043
|
"draft"
|
|
13737
14044
|
];
|
|
13738
|
-
var provenanceNodeKindSchema =
|
|
13739
|
-
var provenanceEdgeRelationSchema =
|
|
13740
|
-
var docLifecycleStatusSchema =
|
|
14045
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
14046
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
14047
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
13741
14048
|
var provenanceNodeBaseFields = {
|
|
13742
|
-
id:
|
|
13743
|
-
title:
|
|
13744
|
-
metadata:
|
|
14049
|
+
id: z10.string().min(1),
|
|
14050
|
+
title: z10.string().min(1),
|
|
14051
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
13745
14052
|
};
|
|
13746
|
-
var provenanceDocNodeSchema =
|
|
14053
|
+
var provenanceDocNodeSchema = z10.object({
|
|
13747
14054
|
...provenanceNodeBaseFields,
|
|
13748
|
-
kind:
|
|
13749
|
-
slug:
|
|
13750
|
-
docKind:
|
|
14055
|
+
kind: z10.literal("doc"),
|
|
14056
|
+
slug: z10.string().min(1),
|
|
14057
|
+
docKind: z10.string().min(1),
|
|
13751
14058
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
13752
|
-
publishedAt:
|
|
13753
|
-
supersededAt:
|
|
13754
|
-
summary:
|
|
14059
|
+
publishedAt: z10.string().min(1),
|
|
14060
|
+
supersededAt: z10.string().min(1).optional(),
|
|
14061
|
+
summary: z10.string().optional()
|
|
13755
14062
|
});
|
|
13756
|
-
var provenanceTaskNodeSchema =
|
|
14063
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
13757
14064
|
...provenanceNodeBaseFields,
|
|
13758
|
-
kind:
|
|
13759
|
-
taskType:
|
|
13760
|
-
status:
|
|
14065
|
+
kind: z10.literal("task"),
|
|
14066
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
14067
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
13761
14068
|
});
|
|
13762
|
-
var provenanceDecisionNodeSchema =
|
|
14069
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
13763
14070
|
...provenanceNodeBaseFields,
|
|
13764
|
-
kind:
|
|
13765
|
-
outcome:
|
|
13766
|
-
decidedAt:
|
|
14071
|
+
kind: z10.literal("decision"),
|
|
14072
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
14073
|
+
decidedAt: z10.string().min(1)
|
|
13767
14074
|
});
|
|
13768
|
-
var provenanceSessionNodeSchema =
|
|
14075
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
13769
14076
|
...provenanceNodeBaseFields,
|
|
13770
|
-
kind:
|
|
13771
|
-
startedAt:
|
|
13772
|
-
endedAt:
|
|
14077
|
+
kind: z10.literal("session"),
|
|
14078
|
+
startedAt: z10.string().min(1),
|
|
14079
|
+
endedAt: z10.string().min(1).optional()
|
|
13773
14080
|
});
|
|
13774
|
-
var provenanceMemoryNodeSchema =
|
|
14081
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
13775
14082
|
...provenanceNodeBaseFields,
|
|
13776
|
-
kind:
|
|
13777
|
-
memoryType:
|
|
13778
|
-
recordedAt:
|
|
14083
|
+
kind: z10.literal("memory"),
|
|
14084
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
14085
|
+
recordedAt: z10.string().min(1)
|
|
13779
14086
|
});
|
|
13780
|
-
var provenanceNodeSchema =
|
|
14087
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
13781
14088
|
provenanceDocNodeSchema,
|
|
13782
14089
|
provenanceTaskNodeSchema,
|
|
13783
14090
|
provenanceDecisionNodeSchema,
|
|
13784
14091
|
provenanceSessionNodeSchema,
|
|
13785
14092
|
provenanceMemoryNodeSchema
|
|
13786
14093
|
]);
|
|
13787
|
-
var provenanceEdgeSchema =
|
|
14094
|
+
var provenanceEdgeSchema = z10.object({
|
|
13788
14095
|
relation: provenanceEdgeRelationSchema,
|
|
13789
|
-
from:
|
|
14096
|
+
from: z10.string().min(1),
|
|
13790
14097
|
fromKind: provenanceNodeKindSchema,
|
|
13791
|
-
to:
|
|
14098
|
+
to: z10.string().min(1),
|
|
13792
14099
|
toKind: provenanceNodeKindSchema,
|
|
13793
|
-
addedAt:
|
|
13794
|
-
summary:
|
|
14100
|
+
addedAt: z10.string().min(1),
|
|
14101
|
+
summary: z10.string().optional()
|
|
13795
14102
|
});
|
|
13796
|
-
var docProvenanceResponseSchema =
|
|
13797
|
-
nodes:
|
|
13798
|
-
edges:
|
|
13799
|
-
totalNodes:
|
|
13800
|
-
totalEdges:
|
|
14103
|
+
var docProvenanceResponseSchema = z10.object({
|
|
14104
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
14105
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
14106
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
14107
|
+
totalEdges: z10.number().int().nonnegative()
|
|
13801
14108
|
});
|
|
13802
14109
|
|
|
13803
14110
|
// packages/contracts/src/docs/read.ts
|
|
13804
|
-
import { z as
|
|
13805
|
-
var docFrontmatterSchema =
|
|
13806
|
-
slug:
|
|
13807
|
-
kind:
|
|
13808
|
-
title:
|
|
13809
|
-
summary:
|
|
13810
|
-
lifecycleStatus:
|
|
13811
|
-
docVersion:
|
|
13812
|
-
ownerVersion:
|
|
13813
|
-
supersedes:
|
|
13814
|
-
supersededBy:
|
|
13815
|
-
topics:
|
|
13816
|
-
relatedTasks:
|
|
13817
|
-
sha256:
|
|
13818
|
-
createdAt:
|
|
14111
|
+
import { z as z11 } from "zod";
|
|
14112
|
+
var docFrontmatterSchema = z11.object({
|
|
14113
|
+
slug: z11.string(),
|
|
14114
|
+
kind: z11.string().nullable(),
|
|
14115
|
+
title: z11.string().nullable(),
|
|
14116
|
+
summary: z11.string().nullable(),
|
|
14117
|
+
lifecycleStatus: z11.string(),
|
|
14118
|
+
docVersion: z11.number().int(),
|
|
14119
|
+
ownerVersion: z11.string().nullable(),
|
|
14120
|
+
supersedes: z11.string().nullable(),
|
|
14121
|
+
supersededBy: z11.string().nullable(),
|
|
14122
|
+
topics: z11.array(z11.string()).readonly(),
|
|
14123
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
14124
|
+
sha256: z11.string(),
|
|
14125
|
+
createdAt: z11.string()
|
|
13819
14126
|
});
|
|
13820
|
-
var docBodySchema =
|
|
13821
|
-
encoding:
|
|
13822
|
-
text:
|
|
13823
|
-
base64:
|
|
13824
|
-
sizeBytes:
|
|
13825
|
-
mimeType:
|
|
14127
|
+
var docBodySchema = z11.object({
|
|
14128
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
14129
|
+
text: z11.string().optional(),
|
|
14130
|
+
base64: z11.string().optional(),
|
|
14131
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
14132
|
+
mimeType: z11.string().nullable()
|
|
13826
14133
|
});
|
|
13827
|
-
var docReadResponseSchema =
|
|
14134
|
+
var docReadResponseSchema = z11.object({
|
|
13828
14135
|
frontmatter: docFrontmatterSchema,
|
|
13829
14136
|
body: docBodySchema
|
|
13830
14137
|
});
|
|
@@ -13997,7 +14304,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
|
|
|
13997
14304
|
}
|
|
13998
14305
|
|
|
13999
14306
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
14000
|
-
import { z as
|
|
14307
|
+
import { z as z12 } from "zod";
|
|
14001
14308
|
var EVIDENCE_ATOM_KINDS = [
|
|
14002
14309
|
"commit",
|
|
14003
14310
|
"files",
|
|
@@ -14019,96 +14326,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
14019
14326
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
14020
14327
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
14021
14328
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
14022
|
-
var commitAtomSchema =
|
|
14023
|
-
kind:
|
|
14024
|
-
sha:
|
|
14329
|
+
var commitAtomSchema = z12.object({
|
|
14330
|
+
kind: z12.literal("commit"),
|
|
14331
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
14025
14332
|
});
|
|
14026
|
-
var filesAtomSchema =
|
|
14027
|
-
kind:
|
|
14028
|
-
paths:
|
|
14333
|
+
var filesAtomSchema = z12.object({
|
|
14334
|
+
kind: z12.literal("files"),
|
|
14335
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
14029
14336
|
});
|
|
14030
|
-
var testRunAtomSchema =
|
|
14031
|
-
kind:
|
|
14032
|
-
path:
|
|
14337
|
+
var testRunAtomSchema = z12.object({
|
|
14338
|
+
kind: z12.literal("test-run"),
|
|
14339
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
14033
14340
|
});
|
|
14034
|
-
var qaRunAtomSchema =
|
|
14035
|
-
kind:
|
|
14036
|
-
path:
|
|
14341
|
+
var qaRunAtomSchema = z12.object({
|
|
14342
|
+
kind: z12.literal("qa-run"),
|
|
14343
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
14037
14344
|
});
|
|
14038
|
-
var toolAtomSchema =
|
|
14039
|
-
kind:
|
|
14040
|
-
tool:
|
|
14345
|
+
var toolAtomSchema = z12.object({
|
|
14346
|
+
kind: z12.literal("tool"),
|
|
14347
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
14041
14348
|
});
|
|
14042
|
-
var urlAtomSchema =
|
|
14043
|
-
kind:
|
|
14044
|
-
url:
|
|
14349
|
+
var urlAtomSchema = z12.object({
|
|
14350
|
+
kind: z12.literal("url"),
|
|
14351
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
14045
14352
|
});
|
|
14046
|
-
var noteAtomSchema =
|
|
14047
|
-
kind:
|
|
14048
|
-
note:
|
|
14353
|
+
var noteAtomSchema = z12.object({
|
|
14354
|
+
kind: z12.literal("note"),
|
|
14355
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
14049
14356
|
});
|
|
14050
|
-
var decisionAtomSchema =
|
|
14051
|
-
kind:
|
|
14052
|
-
decisionId:
|
|
14357
|
+
var decisionAtomSchema = z12.object({
|
|
14358
|
+
kind: z12.literal("decision"),
|
|
14359
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
14053
14360
|
});
|
|
14054
|
-
var prAtomSchema =
|
|
14055
|
-
kind:
|
|
14056
|
-
prNumber:
|
|
14057
|
-
componentPrNumber:
|
|
14361
|
+
var prAtomSchema = z12.object({
|
|
14362
|
+
kind: z12.literal("pr"),
|
|
14363
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
14364
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
14058
14365
|
/**
|
|
14059
14366
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
14060
14367
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
14061
14368
|
* `origin`, since PR numbers are only unique per repository.
|
|
14062
14369
|
*/
|
|
14063
|
-
repo:
|
|
14370
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14064
14371
|
});
|
|
14065
|
-
var ciAtomSchema =
|
|
14066
|
-
kind:
|
|
14067
|
-
prNumber:
|
|
14068
|
-
componentPrNumber:
|
|
14372
|
+
var ciAtomSchema = z12.object({
|
|
14373
|
+
kind: z12.literal("ci"),
|
|
14374
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
14375
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
14069
14376
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
14070
|
-
repo:
|
|
14377
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14071
14378
|
});
|
|
14072
|
-
var ciRunAtomSchema =
|
|
14073
|
-
kind:
|
|
14074
|
-
runId:
|
|
14379
|
+
var ciRunAtomSchema = z12.object({
|
|
14380
|
+
kind: z12.literal("ci-run"),
|
|
14381
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
14075
14382
|
});
|
|
14076
|
-
var deployAtomSchema =
|
|
14077
|
-
kind:
|
|
14078
|
-
provider:
|
|
14079
|
-
deploymentId:
|
|
14080
|
-
sha:
|
|
14081
|
-
probeUrl:
|
|
14383
|
+
var deployAtomSchema = z12.object({
|
|
14384
|
+
kind: z12.literal("deploy"),
|
|
14385
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
14386
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
14387
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
14388
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
14082
14389
|
});
|
|
14083
|
-
var locDropAtomSchema =
|
|
14084
|
-
kind:
|
|
14085
|
-
fromLines:
|
|
14086
|
-
toLines:
|
|
14390
|
+
var locDropAtomSchema = z12.object({
|
|
14391
|
+
kind: z12.literal("loc-drop"),
|
|
14392
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
14393
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
14087
14394
|
});
|
|
14088
|
-
var callsiteCoverageAtomSchema =
|
|
14089
|
-
kind:
|
|
14090
|
-
symbolName:
|
|
14091
|
-
relativeSourcePath:
|
|
14395
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
14396
|
+
kind: z12.literal("callsite-coverage"),
|
|
14397
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
14398
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
14092
14399
|
});
|
|
14093
14400
|
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}$/;
|
|
14094
14401
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
14095
14402
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
14096
14403
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
14097
|
-
var satisfiesAtomSchema =
|
|
14098
|
-
kind:
|
|
14404
|
+
var satisfiesAtomSchema = z12.object({
|
|
14405
|
+
kind: z12.literal("satisfies"),
|
|
14099
14406
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
14100
|
-
targetTaskId:
|
|
14407
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
14101
14408
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
14102
|
-
targetAcId:
|
|
14409
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
14103
14410
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
14104
|
-
targetAcAlias:
|
|
14411
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
14105
14412
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
14106
|
-
versionPin:
|
|
14413
|
+
versionPin: z12.string().regex(
|
|
14107
14414
|
SATISFIES_VERSION_PIN_REGEX,
|
|
14108
14415
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
14109
14416
|
).optional()
|
|
14110
14417
|
});
|
|
14111
|
-
var EvidenceAtomSchema =
|
|
14418
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
14112
14419
|
commitAtomSchema,
|
|
14113
14420
|
filesAtomSchema,
|
|
14114
14421
|
testRunAtomSchema,
|
|
@@ -14170,54 +14477,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
14170
14477
|
});
|
|
14171
14478
|
|
|
14172
14479
|
// packages/contracts/src/evidence-record-schema.ts
|
|
14173
|
-
import { z as
|
|
14174
|
-
var evidenceBaseSchema =
|
|
14480
|
+
import { z as z13 } from "zod";
|
|
14481
|
+
var evidenceBaseSchema = z13.object({
|
|
14175
14482
|
/** Identity string of the agent that produced this record. */
|
|
14176
|
-
agentIdentity:
|
|
14483
|
+
agentIdentity: z13.string().min(1),
|
|
14177
14484
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
14178
|
-
attachmentSha256:
|
|
14485
|
+
attachmentSha256: z13.string().length(64),
|
|
14179
14486
|
/** ISO 8601 timestamp at which the action ran. */
|
|
14180
|
-
ranAt:
|
|
14487
|
+
ranAt: z13.string().datetime(),
|
|
14181
14488
|
/** Wall-clock duration of the action in milliseconds. */
|
|
14182
|
-
durationMs:
|
|
14489
|
+
durationMs: z13.number().nonnegative()
|
|
14183
14490
|
});
|
|
14184
14491
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
14185
|
-
kind:
|
|
14186
|
-
phase:
|
|
14187
|
-
filesChanged:
|
|
14188
|
-
linesAdded:
|
|
14189
|
-
linesRemoved:
|
|
14492
|
+
kind: z13.literal("impl-diff"),
|
|
14493
|
+
phase: z13.literal("implement"),
|
|
14494
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
14495
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
14496
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
14190
14497
|
});
|
|
14191
14498
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
14192
|
-
kind:
|
|
14193
|
-
phase:
|
|
14194
|
-
reqIdsChecked:
|
|
14195
|
-
passed:
|
|
14196
|
-
details:
|
|
14499
|
+
kind: z13.literal("validate-spec-check"),
|
|
14500
|
+
phase: z13.literal("validate"),
|
|
14501
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
14502
|
+
passed: z13.boolean(),
|
|
14503
|
+
details: z13.string().min(1)
|
|
14197
14504
|
});
|
|
14198
14505
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14199
|
-
kind:
|
|
14200
|
-
phase:
|
|
14201
|
-
command:
|
|
14202
|
-
exitCode:
|
|
14203
|
-
testsPassed:
|
|
14204
|
-
testsFailed:
|
|
14506
|
+
kind: z13.literal("test-output"),
|
|
14507
|
+
phase: z13.literal("test"),
|
|
14508
|
+
command: z13.string().min(1),
|
|
14509
|
+
exitCode: z13.number().int(),
|
|
14510
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
14511
|
+
testsFailed: z13.number().int().nonnegative()
|
|
14205
14512
|
});
|
|
14206
14513
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
14207
|
-
kind:
|
|
14208
|
-
phase:
|
|
14209
|
-
tool:
|
|
14210
|
-
passed:
|
|
14211
|
-
warnings:
|
|
14212
|
-
errors:
|
|
14514
|
+
kind: z13.literal("lint-report"),
|
|
14515
|
+
phase: z13.enum(["implement", "test"]),
|
|
14516
|
+
tool: z13.string().min(1),
|
|
14517
|
+
passed: z13.boolean(),
|
|
14518
|
+
warnings: z13.number().int().nonnegative(),
|
|
14519
|
+
errors: z13.number().int().nonnegative()
|
|
14213
14520
|
});
|
|
14214
14521
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14215
|
-
kind:
|
|
14216
|
-
phase:
|
|
14217
|
-
cmd:
|
|
14218
|
-
exitCode:
|
|
14522
|
+
kind: z13.literal("command-output"),
|
|
14523
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
14524
|
+
cmd: z13.string().min(1),
|
|
14525
|
+
exitCode: z13.number().int()
|
|
14219
14526
|
});
|
|
14220
|
-
var evidenceRecordSchema =
|
|
14527
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
14221
14528
|
implDiffRecordSchema,
|
|
14222
14529
|
validateSpecCheckRecordSchema,
|
|
14223
14530
|
testOutputRecordSchema,
|
|
@@ -15152,107 +15459,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
15152
15459
|
});
|
|
15153
15460
|
|
|
15154
15461
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
15155
|
-
import { z as
|
|
15156
|
-
var LeaseScopeSchema =
|
|
15157
|
-
var LeaseLaneSchema =
|
|
15158
|
-
var LeaseAcquireRequestSchema =
|
|
15462
|
+
import { z as z14 } from "zod";
|
|
15463
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
15464
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
15465
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
15159
15466
|
/** Tag discriminating this request variant. */
|
|
15160
|
-
kind:
|
|
15467
|
+
kind: z14.literal("lease_acquire"),
|
|
15161
15468
|
/** The cleo.db scope being arbitrated. */
|
|
15162
15469
|
scope: LeaseScopeSchema,
|
|
15163
15470
|
/** The write lane within the scope. */
|
|
15164
15471
|
lane: LeaseLaneSchema,
|
|
15165
15472
|
/** Process+lane holder identity. */
|
|
15166
|
-
holder_id:
|
|
15473
|
+
holder_id: z14.string().min(1),
|
|
15167
15474
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
15168
|
-
priority:
|
|
15475
|
+
priority: z14.number().int().min(0).max(255),
|
|
15169
15476
|
/** Lease time-to-live in milliseconds. */
|
|
15170
|
-
ttl_ms:
|
|
15477
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15171
15478
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
15172
|
-
reentrant:
|
|
15479
|
+
reentrant: z14.boolean()
|
|
15173
15480
|
}).strict();
|
|
15174
|
-
var LeaseReleaseRequestSchema =
|
|
15481
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
15175
15482
|
/** Tag discriminating this request variant. */
|
|
15176
|
-
kind:
|
|
15483
|
+
kind: z14.literal("lease_release"),
|
|
15177
15484
|
/** The cleo.db scope being arbitrated. */
|
|
15178
15485
|
scope: LeaseScopeSchema,
|
|
15179
15486
|
/** The write lane within the scope. */
|
|
15180
15487
|
lane: LeaseLaneSchema,
|
|
15181
15488
|
/** Process+lane holder identity. */
|
|
15182
|
-
holder_id:
|
|
15489
|
+
holder_id: z14.string().min(1),
|
|
15183
15490
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
15184
|
-
epoch:
|
|
15491
|
+
epoch: z14.number().int().nonnegative()
|
|
15185
15492
|
}).strict();
|
|
15186
|
-
var LeaseRenewRequestSchema =
|
|
15493
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
15187
15494
|
/** Tag discriminating this request variant. */
|
|
15188
|
-
kind:
|
|
15495
|
+
kind: z14.literal("lease_renew"),
|
|
15189
15496
|
/** The cleo.db scope being arbitrated. */
|
|
15190
15497
|
scope: LeaseScopeSchema,
|
|
15191
15498
|
/** The write lane within the scope. */
|
|
15192
15499
|
lane: LeaseLaneSchema,
|
|
15193
15500
|
/** Process+lane holder identity. */
|
|
15194
|
-
holder_id:
|
|
15501
|
+
holder_id: z14.string().min(1),
|
|
15195
15502
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
15196
|
-
epoch:
|
|
15503
|
+
epoch: z14.number().int().nonnegative()
|
|
15197
15504
|
}).strict();
|
|
15198
|
-
var RateCheckRequestSchema =
|
|
15505
|
+
var RateCheckRequestSchema = z14.object({
|
|
15199
15506
|
/** Tag discriminating this request variant. */
|
|
15200
|
-
kind:
|
|
15507
|
+
kind: z14.literal("rate_check"),
|
|
15201
15508
|
/** The cleo.db scope being checked. */
|
|
15202
15509
|
scope: LeaseScopeSchema,
|
|
15203
15510
|
/** The write lane within the scope. */
|
|
15204
15511
|
lane: LeaseLaneSchema,
|
|
15205
15512
|
/** Estimated bytes the caller intends to write. */
|
|
15206
|
-
est_bytes:
|
|
15513
|
+
est_bytes: z14.number().int().nonnegative()
|
|
15207
15514
|
}).strict();
|
|
15208
|
-
var ToolGrantRequestSchema =
|
|
15515
|
+
var ToolGrantRequestSchema = z14.object({
|
|
15209
15516
|
/** Tag discriminating this request variant. */
|
|
15210
|
-
kind:
|
|
15517
|
+
kind: z14.literal("tool_grant"),
|
|
15211
15518
|
/** The tool name being requested. */
|
|
15212
|
-
tool:
|
|
15519
|
+
tool: z14.string().min(1),
|
|
15213
15520
|
/** The requesting holder identity. */
|
|
15214
|
-
holder_id:
|
|
15521
|
+
holder_id: z14.string().min(1)
|
|
15215
15522
|
}).strict();
|
|
15216
|
-
var QueuePriorityClassSchema =
|
|
15217
|
-
var QueueAdmitRequestSchema =
|
|
15523
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
15524
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
15218
15525
|
/** Tag discriminating this request variant. */
|
|
15219
|
-
kind:
|
|
15526
|
+
kind: z14.literal("queue_admit"),
|
|
15220
15527
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
15221
|
-
provider:
|
|
15528
|
+
provider: z14.string().min(1),
|
|
15222
15529
|
/** The caller's priority class (lead > worker > background). */
|
|
15223
15530
|
priority_class: QueuePriorityClassSchema,
|
|
15224
15531
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
15225
|
-
est_tokens:
|
|
15532
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
15226
15533
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
15227
|
-
child_id:
|
|
15534
|
+
child_id: z14.string().min(1)
|
|
15228
15535
|
}).strict();
|
|
15229
|
-
var WorkerHeartbeatRequestSchema =
|
|
15536
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
15230
15537
|
/** Tag discriminating this request variant. */
|
|
15231
|
-
kind:
|
|
15538
|
+
kind: z14.literal("worker_heartbeat"),
|
|
15232
15539
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
15233
|
-
child_id:
|
|
15540
|
+
child_id: z14.string().min(1),
|
|
15234
15541
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
15235
|
-
in_flight_llm:
|
|
15542
|
+
in_flight_llm: z14.boolean()
|
|
15236
15543
|
}).strict();
|
|
15237
|
-
var ResourceAdmitRequestSchema =
|
|
15544
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
15238
15545
|
/** Tag discriminating this request variant. */
|
|
15239
|
-
kind:
|
|
15546
|
+
kind: z14.literal("resource_admit"),
|
|
15240
15547
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
15241
|
-
class:
|
|
15548
|
+
class: z14.string().min(1),
|
|
15242
15549
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
15243
|
-
holder_id:
|
|
15550
|
+
holder_id: z14.string().min(1),
|
|
15244
15551
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
15245
|
-
budget:
|
|
15552
|
+
budget: z14.number().int().nonnegative()
|
|
15246
15553
|
}).strict();
|
|
15247
|
-
var ResourceReleaseRequestSchema =
|
|
15554
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
15248
15555
|
/** Tag discriminating this request variant. */
|
|
15249
|
-
kind:
|
|
15556
|
+
kind: z14.literal("resource_release"),
|
|
15250
15557
|
/** The resource class the slot belongs to. */
|
|
15251
|
-
class:
|
|
15558
|
+
class: z14.string().min(1),
|
|
15252
15559
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
15253
|
-
holder_id:
|
|
15560
|
+
holder_id: z14.string().min(1)
|
|
15254
15561
|
}).strict();
|
|
15255
|
-
var LeaseIpcRequestSchema =
|
|
15562
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
15256
15563
|
LeaseAcquireRequestSchema,
|
|
15257
15564
|
LeaseReleaseRequestSchema,
|
|
15258
15565
|
LeaseRenewRequestSchema,
|
|
@@ -15263,133 +15570,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
15263
15570
|
ResourceAdmitRequestSchema,
|
|
15264
15571
|
ResourceReleaseRequestSchema
|
|
15265
15572
|
]);
|
|
15266
|
-
var LeaseGrantedResponseSchema =
|
|
15573
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
15267
15574
|
/** Tag discriminating this response variant. */
|
|
15268
|
-
kind:
|
|
15575
|
+
kind: z14.literal("lease_granted"),
|
|
15269
15576
|
/** The granted cleo.db scope. */
|
|
15270
15577
|
scope: LeaseScopeSchema,
|
|
15271
15578
|
/** The granted write lane. */
|
|
15272
15579
|
lane: LeaseLaneSchema,
|
|
15273
15580
|
/** The holder the lease was granted to. */
|
|
15274
|
-
holder_id:
|
|
15581
|
+
holder_id: z14.string().min(1),
|
|
15275
15582
|
/** The monotonic epoch fence assigned to this grant. */
|
|
15276
|
-
epoch:
|
|
15583
|
+
epoch: z14.number().int().nonnegative(),
|
|
15277
15584
|
/** The lease TTL in milliseconds. */
|
|
15278
|
-
ttl_ms:
|
|
15585
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15279
15586
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
15280
|
-
expires_at_ms:
|
|
15587
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
15281
15588
|
}).strict();
|
|
15282
|
-
var LeaseQueuedResponseSchema =
|
|
15589
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
15283
15590
|
/** Tag discriminating this response variant. */
|
|
15284
|
-
kind:
|
|
15591
|
+
kind: z14.literal("lease_queued"),
|
|
15285
15592
|
/** The queued cleo.db scope. */
|
|
15286
15593
|
scope: LeaseScopeSchema,
|
|
15287
15594
|
/** The queued write lane. */
|
|
15288
15595
|
lane: LeaseLaneSchema,
|
|
15289
15596
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
15290
|
-
ticket:
|
|
15597
|
+
ticket: z14.number().int().nonnegative(),
|
|
15291
15598
|
/** Number of waiters ahead of this one. */
|
|
15292
|
-
ahead:
|
|
15599
|
+
ahead: z14.number().int().nonnegative()
|
|
15293
15600
|
}).strict();
|
|
15294
|
-
var LeaseDeniedResponseSchema =
|
|
15601
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
15295
15602
|
/** Tag discriminating this response variant. */
|
|
15296
|
-
kind:
|
|
15603
|
+
kind: z14.literal("lease_denied"),
|
|
15297
15604
|
/** The denied cleo.db scope. */
|
|
15298
15605
|
scope: LeaseScopeSchema,
|
|
15299
15606
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
15300
|
-
code:
|
|
15607
|
+
code: z14.string().min(1),
|
|
15301
15608
|
/** Human-readable denial message. */
|
|
15302
|
-
message:
|
|
15609
|
+
message: z14.string()
|
|
15303
15610
|
}).strict();
|
|
15304
|
-
var RateResultResponseSchema =
|
|
15611
|
+
var RateResultResponseSchema = z14.object({
|
|
15305
15612
|
/** Tag discriminating this response variant. */
|
|
15306
|
-
kind:
|
|
15613
|
+
kind: z14.literal("rate_result"),
|
|
15307
15614
|
/** The checked cleo.db scope. */
|
|
15308
15615
|
scope: LeaseScopeSchema,
|
|
15309
15616
|
/** Whether the write is within budget. */
|
|
15310
|
-
ok:
|
|
15617
|
+
ok: z14.boolean(),
|
|
15311
15618
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
15312
|
-
retry_after_ms:
|
|
15619
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15313
15620
|
/** Remaining token budget for the scope. */
|
|
15314
|
-
tokens_remaining:
|
|
15621
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
15315
15622
|
}).strict();
|
|
15316
|
-
var ToolGrantedResponseSchema =
|
|
15623
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
15317
15624
|
/** Tag discriminating this response variant. */
|
|
15318
|
-
kind:
|
|
15625
|
+
kind: z14.literal("tool_granted"),
|
|
15319
15626
|
/** The granted tool name. */
|
|
15320
|
-
tool:
|
|
15627
|
+
tool: z14.string().min(1),
|
|
15321
15628
|
/** The holder the tool grant was issued to. */
|
|
15322
|
-
holder_id:
|
|
15629
|
+
holder_id: z14.string().min(1)
|
|
15323
15630
|
}).strict();
|
|
15324
|
-
var LeaseRevokedResponseSchema =
|
|
15631
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
15325
15632
|
/** Tag discriminating this response variant. */
|
|
15326
|
-
kind:
|
|
15633
|
+
kind: z14.literal("lease_revoked"),
|
|
15327
15634
|
/** The revoked cleo.db scope. */
|
|
15328
15635
|
scope: LeaseScopeSchema,
|
|
15329
15636
|
/** The revoked write lane. */
|
|
15330
15637
|
lane: LeaseLaneSchema,
|
|
15331
15638
|
/** The holder whose lease was revoked. */
|
|
15332
|
-
holder_id:
|
|
15639
|
+
holder_id: z14.string().min(1),
|
|
15333
15640
|
/** Human-readable reason for the revocation. */
|
|
15334
|
-
reason:
|
|
15641
|
+
reason: z14.string()
|
|
15335
15642
|
}).strict();
|
|
15336
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
15643
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
15337
15644
|
/** Tag discriminating this response variant. */
|
|
15338
|
-
kind:
|
|
15645
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
15339
15646
|
/** Logical id of the killed child. */
|
|
15340
|
-
child_id:
|
|
15647
|
+
child_id: z14.string().min(1),
|
|
15341
15648
|
/** The holder identity the killed child held the lease as. */
|
|
15342
|
-
holder_id:
|
|
15649
|
+
holder_id: z14.string().min(1),
|
|
15343
15650
|
/** The cleo.db scope the killed child held the lease in. */
|
|
15344
15651
|
scope: LeaseScopeSchema,
|
|
15345
15652
|
/** Human-readable reason for the kill. */
|
|
15346
|
-
reason:
|
|
15653
|
+
reason: z14.string()
|
|
15347
15654
|
}).strict();
|
|
15348
|
-
var QueueAdmitDispositionSchema =
|
|
15349
|
-
var QueueAdmitResultResponseSchema =
|
|
15655
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
15656
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
15350
15657
|
/** Tag discriminating this response variant. */
|
|
15351
|
-
kind:
|
|
15658
|
+
kind: z14.literal("queue_admit_result"),
|
|
15352
15659
|
/** Whether the LLM call was admitted or deferred. */
|
|
15353
15660
|
disposition: QueueAdmitDispositionSchema,
|
|
15354
15661
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15355
|
-
retry_after_ms:
|
|
15662
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15356
15663
|
/** Remaining provider token budget after this decision. */
|
|
15357
|
-
tokens_remaining:
|
|
15664
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
15358
15665
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
15359
|
-
queue_position:
|
|
15666
|
+
queue_position: z14.number().int().nonnegative()
|
|
15360
15667
|
}).strict();
|
|
15361
|
-
var HeartbeatAckResponseSchema =
|
|
15668
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
15362
15669
|
/** Tag discriminating this response variant. */
|
|
15363
|
-
kind:
|
|
15670
|
+
kind: z14.literal("heartbeat_ack")
|
|
15364
15671
|
}).strict();
|
|
15365
|
-
var ResourceAdmitDispositionSchema =
|
|
15366
|
-
var ResourceAdmitResultResponseSchema =
|
|
15672
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
15673
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
15367
15674
|
/** Tag discriminating this response variant. */
|
|
15368
|
-
kind:
|
|
15675
|
+
kind: z14.literal("resource_admit_result"),
|
|
15369
15676
|
/** Whether the heavy op was admitted or deferred. */
|
|
15370
15677
|
disposition: ResourceAdmitDispositionSchema,
|
|
15371
15678
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15372
|
-
retry_after_ms:
|
|
15679
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15373
15680
|
/** Remaining slots for the class after this decision. */
|
|
15374
|
-
slots_remaining:
|
|
15681
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15375
15682
|
}).strict();
|
|
15376
|
-
var ResourceReleaseResultResponseSchema =
|
|
15683
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
15377
15684
|
/** Tag discriminating this response variant. */
|
|
15378
|
-
kind:
|
|
15685
|
+
kind: z14.literal("resource_release_result"),
|
|
15379
15686
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
15380
|
-
released:
|
|
15687
|
+
released: z14.boolean(),
|
|
15381
15688
|
/** Remaining in-flight holders for the class after the release. */
|
|
15382
|
-
slots_remaining:
|
|
15689
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15383
15690
|
}).strict();
|
|
15384
|
-
var LeaseErrorResponseSchema =
|
|
15691
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
15385
15692
|
/** Tag discriminating this response variant. */
|
|
15386
|
-
kind:
|
|
15693
|
+
kind: z14.literal("error"),
|
|
15387
15694
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
15388
|
-
code:
|
|
15695
|
+
code: z14.string().min(1),
|
|
15389
15696
|
/** Human-readable error message. */
|
|
15390
|
-
message:
|
|
15697
|
+
message: z14.string()
|
|
15391
15698
|
}).strict();
|
|
15392
|
-
var LeaseIpcResponseSchema =
|
|
15699
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
15393
15700
|
LeaseGrantedResponseSchema,
|
|
15394
15701
|
LeaseQueuedResponseSchema,
|
|
15395
15702
|
LeaseDeniedResponseSchema,
|
|
@@ -15403,27 +15710,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
15403
15710
|
ResourceReleaseResultResponseSchema,
|
|
15404
15711
|
LeaseErrorResponseSchema
|
|
15405
15712
|
]);
|
|
15406
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
15713
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
15407
15714
|
/** Parallel protocol version. */
|
|
15408
|
-
protocol_version:
|
|
15715
|
+
protocol_version: z14.string(),
|
|
15409
15716
|
/** Correlation id echoed back on the matching response. */
|
|
15410
|
-
id:
|
|
15717
|
+
id: z14.string().min(1),
|
|
15411
15718
|
/** Direction discriminator. */
|
|
15412
|
-
direction:
|
|
15719
|
+
direction: z14.literal("request"),
|
|
15413
15720
|
/** The request body. */
|
|
15414
15721
|
request: LeaseIpcRequestSchema
|
|
15415
15722
|
}).strict();
|
|
15416
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
15723
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
15417
15724
|
/** Parallel protocol version. */
|
|
15418
|
-
protocol_version:
|
|
15725
|
+
protocol_version: z14.string(),
|
|
15419
15726
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
15420
|
-
id:
|
|
15727
|
+
id: z14.string().min(1),
|
|
15421
15728
|
/** Direction discriminator. */
|
|
15422
|
-
direction:
|
|
15729
|
+
direction: z14.literal("response"),
|
|
15423
15730
|
/** The response body. */
|
|
15424
15731
|
response: LeaseIpcResponseSchema
|
|
15425
15732
|
}).strict();
|
|
15426
|
-
var LeaseIpcEnvelopeSchema =
|
|
15733
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
15427
15734
|
LeaseIpcRequestEnvelopeSchema,
|
|
15428
15735
|
LeaseIpcResponseEnvelopeSchema
|
|
15429
15736
|
]);
|
|
@@ -15458,7 +15765,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
15458
15765
|
];
|
|
15459
15766
|
|
|
15460
15767
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
15461
|
-
import { z as
|
|
15768
|
+
import { z as z15 } from "zod";
|
|
15462
15769
|
var CATALOG_MODEL_STATUSES = [
|
|
15463
15770
|
"stable",
|
|
15464
15771
|
"beta",
|
|
@@ -15467,78 +15774,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
15467
15774
|
"retired"
|
|
15468
15775
|
];
|
|
15469
15776
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
15470
|
-
var isoDate =
|
|
15471
|
-
var semver =
|
|
15472
|
-
var catalogModalitiesSchema =
|
|
15473
|
-
input:
|
|
15474
|
-
output:
|
|
15777
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
15778
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
15779
|
+
var catalogModalitiesSchema = z15.object({
|
|
15780
|
+
input: z15.array(z15.string()),
|
|
15781
|
+
output: z15.array(z15.string())
|
|
15475
15782
|
}).strict();
|
|
15476
|
-
var catalogCostSchema =
|
|
15477
|
-
input:
|
|
15478
|
-
output:
|
|
15479
|
-
cache_read:
|
|
15480
|
-
cache_write:
|
|
15481
|
-
context_over_200k:
|
|
15783
|
+
var catalogCostSchema = z15.object({
|
|
15784
|
+
input: z15.number().optional(),
|
|
15785
|
+
output: z15.number().optional(),
|
|
15786
|
+
cache_read: z15.number().optional(),
|
|
15787
|
+
cache_write: z15.number().optional(),
|
|
15788
|
+
context_over_200k: z15.number().optional()
|
|
15482
15789
|
}).strict();
|
|
15483
|
-
var catalogLimitSchema =
|
|
15484
|
-
context:
|
|
15485
|
-
output:
|
|
15790
|
+
var catalogLimitSchema = z15.object({
|
|
15791
|
+
context: z15.number(),
|
|
15792
|
+
output: z15.number()
|
|
15486
15793
|
}).strict();
|
|
15487
|
-
var catalogModelProviderSchema =
|
|
15488
|
-
npm:
|
|
15489
|
-
api:
|
|
15794
|
+
var catalogModelProviderSchema = z15.object({
|
|
15795
|
+
npm: z15.string(),
|
|
15796
|
+
api: z15.string()
|
|
15490
15797
|
}).strict();
|
|
15491
|
-
var catalogModelEntrySchema =
|
|
15492
|
-
id:
|
|
15493
|
-
name:
|
|
15494
|
-
family:
|
|
15495
|
-
attachment:
|
|
15496
|
-
reasoning:
|
|
15497
|
-
temperature:
|
|
15498
|
-
interleaved:
|
|
15499
|
-
tool_call:
|
|
15798
|
+
var catalogModelEntrySchema = z15.object({
|
|
15799
|
+
id: z15.string(),
|
|
15800
|
+
name: z15.string(),
|
|
15801
|
+
family: z15.string(),
|
|
15802
|
+
attachment: z15.boolean(),
|
|
15803
|
+
reasoning: z15.boolean(),
|
|
15804
|
+
temperature: z15.boolean(),
|
|
15805
|
+
interleaved: z15.boolean(),
|
|
15806
|
+
tool_call: z15.boolean(),
|
|
15500
15807
|
modalities: catalogModalitiesSchema,
|
|
15501
15808
|
cost: catalogCostSchema,
|
|
15502
15809
|
limit: catalogLimitSchema,
|
|
15503
|
-
status:
|
|
15810
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15504
15811
|
release_date: isoDate,
|
|
15505
15812
|
provider: catalogModelProviderSchema
|
|
15506
15813
|
}).strict();
|
|
15507
|
-
var catalogProviderSchema =
|
|
15508
|
-
id:
|
|
15509
|
-
endpoint:
|
|
15510
|
-
authTypes:
|
|
15511
|
-
npm:
|
|
15814
|
+
var catalogProviderSchema = z15.object({
|
|
15815
|
+
id: z15.string(),
|
|
15816
|
+
endpoint: z15.string(),
|
|
15817
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
15818
|
+
npm: z15.string().optional()
|
|
15512
15819
|
}).strict();
|
|
15513
|
-
var curatedCatalogSchema =
|
|
15514
|
-
$schema:
|
|
15820
|
+
var curatedCatalogSchema = z15.object({
|
|
15821
|
+
$schema: z15.string().optional(),
|
|
15515
15822
|
version: semver,
|
|
15516
15823
|
lastUpdated: isoDate,
|
|
15517
|
-
providers:
|
|
15518
|
-
models:
|
|
15824
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
15825
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
15519
15826
|
}).strict();
|
|
15520
|
-
var modelsCatalogRowInsertSchema =
|
|
15521
|
-
id:
|
|
15522
|
-
providerId:
|
|
15523
|
-
name:
|
|
15524
|
-
family:
|
|
15525
|
-
attachment:
|
|
15526
|
-
reasoning:
|
|
15527
|
-
temperature:
|
|
15528
|
-
interleaved:
|
|
15529
|
-
toolCall:
|
|
15530
|
-
modalities:
|
|
15531
|
-
cost:
|
|
15532
|
-
contextLimit:
|
|
15533
|
-
outputLimit:
|
|
15534
|
-
status:
|
|
15827
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
15828
|
+
id: z15.string(),
|
|
15829
|
+
providerId: z15.string(),
|
|
15830
|
+
name: z15.string(),
|
|
15831
|
+
family: z15.string(),
|
|
15832
|
+
attachment: z15.boolean(),
|
|
15833
|
+
reasoning: z15.boolean(),
|
|
15834
|
+
temperature: z15.boolean(),
|
|
15835
|
+
interleaved: z15.boolean(),
|
|
15836
|
+
toolCall: z15.boolean(),
|
|
15837
|
+
modalities: z15.string(),
|
|
15838
|
+
cost: z15.string(),
|
|
15839
|
+
contextLimit: z15.number().nullable().optional(),
|
|
15840
|
+
outputLimit: z15.number().nullable().optional(),
|
|
15841
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15535
15842
|
releaseDate: isoDate,
|
|
15536
|
-
modelsDevId:
|
|
15537
|
-
source:
|
|
15538
|
-
seededAt:
|
|
15843
|
+
modelsDevId: z15.string(),
|
|
15844
|
+
source: z15.string(),
|
|
15845
|
+
seededAt: z15.string().optional()
|
|
15539
15846
|
}).strict();
|
|
15540
15847
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
15541
|
-
seededAt:
|
|
15848
|
+
seededAt: z15.string()
|
|
15542
15849
|
});
|
|
15543
15850
|
|
|
15544
15851
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -15586,7 +15893,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
15586
15893
|
];
|
|
15587
15894
|
|
|
15588
15895
|
// packages/contracts/src/workgraph.ts
|
|
15589
|
-
import { z as
|
|
15896
|
+
import { z as z16 } from "zod";
|
|
15590
15897
|
|
|
15591
15898
|
// packages/contracts/src/status-registry.ts
|
|
15592
15899
|
var TASK_STATUSES = [
|
|
@@ -15601,10 +15908,10 @@ var TASK_STATUSES = [
|
|
|
15601
15908
|
|
|
15602
15909
|
// packages/contracts/src/workgraph.ts
|
|
15603
15910
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
15604
|
-
var taskTypeSchema =
|
|
15605
|
-
var taskPrioritySchema =
|
|
15606
|
-
var taskStatusSchema =
|
|
15607
|
-
var verificationGateSchema =
|
|
15911
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
15912
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
15913
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
15914
|
+
var verificationGateSchema = z16.enum([
|
|
15608
15915
|
"implemented",
|
|
15609
15916
|
"testsPassed",
|
|
15610
15917
|
"qaPassed",
|
|
@@ -15613,7 +15920,7 @@ var verificationGateSchema = z15.enum([
|
|
|
15613
15920
|
"documented",
|
|
15614
15921
|
"nexusImpact"
|
|
15615
15922
|
]);
|
|
15616
|
-
var workGraphRelationKindSchema =
|
|
15923
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
15617
15924
|
"contains",
|
|
15618
15925
|
"depends_on",
|
|
15619
15926
|
"blocks",
|
|
@@ -15621,317 +15928,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
15621
15928
|
"groups",
|
|
15622
15929
|
"satisfies"
|
|
15623
15930
|
]);
|
|
15624
|
-
var workGraphTraversalDirectionSchema =
|
|
15931
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
15625
15932
|
"ancestors",
|
|
15626
15933
|
"descendants",
|
|
15627
15934
|
"upstream",
|
|
15628
15935
|
"downstream"
|
|
15629
15936
|
]);
|
|
15630
|
-
var workGraphEdgeDirectionSchema =
|
|
15631
|
-
var paginationParamsSchema =
|
|
15632
|
-
cursor:
|
|
15633
|
-
limit:
|
|
15937
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
15938
|
+
var paginationParamsSchema = z16.object({
|
|
15939
|
+
cursor: z16.string().min(1).optional(),
|
|
15940
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
15634
15941
|
});
|
|
15635
|
-
var workGraphNodeSchema =
|
|
15636
|
-
id:
|
|
15942
|
+
var workGraphNodeSchema = z16.object({
|
|
15943
|
+
id: z16.string().min(1),
|
|
15637
15944
|
type: taskTypeSchema,
|
|
15638
|
-
title:
|
|
15945
|
+
title: z16.string(),
|
|
15639
15946
|
status: taskStatusSchema,
|
|
15640
15947
|
priority: taskPrioritySchema,
|
|
15641
|
-
parentId:
|
|
15948
|
+
parentId: z16.string().min(1).optional()
|
|
15642
15949
|
});
|
|
15643
|
-
var workGraphEdgeSchema =
|
|
15644
|
-
fromId:
|
|
15645
|
-
toId:
|
|
15950
|
+
var workGraphEdgeSchema = z16.object({
|
|
15951
|
+
fromId: z16.string().min(1),
|
|
15952
|
+
toId: z16.string().min(1),
|
|
15646
15953
|
kind: workGraphRelationKindSchema
|
|
15647
15954
|
});
|
|
15648
|
-
var workGraphHierarchyEdgeSchema =
|
|
15649
|
-
fromId:
|
|
15650
|
-
toId:
|
|
15651
|
-
kind:
|
|
15955
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
15956
|
+
fromId: z16.string().min(1),
|
|
15957
|
+
toId: z16.string().min(1),
|
|
15958
|
+
kind: z16.literal("contains")
|
|
15652
15959
|
}).strict();
|
|
15653
|
-
var workGraphPageInfoSchema =
|
|
15654
|
-
nextCursor:
|
|
15655
|
-
hasMore:
|
|
15960
|
+
var workGraphPageInfoSchema = z16.object({
|
|
15961
|
+
nextCursor: z16.string().min(1).optional(),
|
|
15962
|
+
hasMore: z16.boolean()
|
|
15656
15963
|
});
|
|
15657
|
-
var workGraphRollupCountsSchema =
|
|
15658
|
-
total:
|
|
15659
|
-
byStatus:
|
|
15660
|
-
byType:
|
|
15964
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
15965
|
+
total: z16.number().int().nonnegative(),
|
|
15966
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
15967
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
15661
15968
|
});
|
|
15662
|
-
var workGraphSubtreePercentagesSchema =
|
|
15663
|
-
done:
|
|
15664
|
-
active:
|
|
15665
|
-
blocked:
|
|
15666
|
-
pending:
|
|
15667
|
-
cancelled:
|
|
15969
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
15970
|
+
done: z16.number().nonnegative(),
|
|
15971
|
+
active: z16.number().nonnegative(),
|
|
15972
|
+
blocked: z16.number().nonnegative(),
|
|
15973
|
+
pending: z16.number().nonnegative(),
|
|
15974
|
+
cancelled: z16.number().nonnegative()
|
|
15668
15975
|
});
|
|
15669
|
-
var workGraphProjectionMismatchSchema =
|
|
15670
|
-
field:
|
|
15671
|
-
expected:
|
|
15672
|
-
actual:
|
|
15976
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
15977
|
+
field: z16.string().min(1),
|
|
15978
|
+
expected: z16.number().int().nonnegative(),
|
|
15979
|
+
actual: z16.number().int().nonnegative()
|
|
15673
15980
|
});
|
|
15674
15981
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
15675
|
-
role:
|
|
15676
|
-
dependencyBlockers:
|
|
15677
|
-
gateBlockers:
|
|
15982
|
+
role: z16.string().min(1).optional(),
|
|
15983
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
15984
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
15678
15985
|
});
|
|
15679
15986
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
15680
|
-
source:
|
|
15681
|
-
relationType:
|
|
15682
|
-
reason:
|
|
15987
|
+
source: z16.literal("relation"),
|
|
15988
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
15989
|
+
reason: z16.string().min(1).optional()
|
|
15683
15990
|
});
|
|
15684
15991
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
15685
|
-
source:
|
|
15686
|
-
kind:
|
|
15992
|
+
source: z16.literal("dependency"),
|
|
15993
|
+
kind: z16.literal("depends_on")
|
|
15687
15994
|
});
|
|
15688
|
-
var workGraphOmissionReasonSchema =
|
|
15995
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
15689
15996
|
"budget_exceeded",
|
|
15690
15997
|
"not_requested",
|
|
15691
15998
|
"not_available",
|
|
15692
15999
|
"redacted",
|
|
15693
16000
|
"truncated"
|
|
15694
16001
|
]);
|
|
15695
|
-
var workGraphContextBudgetSchema =
|
|
15696
|
-
tokenBudget:
|
|
15697
|
-
estimatedTokens:
|
|
15698
|
-
remainingTokens:
|
|
15699
|
-
truncated:
|
|
16002
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
16003
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
16004
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16005
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
16006
|
+
truncated: z16.boolean()
|
|
15700
16007
|
});
|
|
15701
|
-
var workGraphOmissionSchema =
|
|
15702
|
-
path:
|
|
16008
|
+
var workGraphOmissionSchema = z16.object({
|
|
16009
|
+
path: z16.string().min(1),
|
|
15703
16010
|
reason: workGraphOmissionReasonSchema,
|
|
15704
|
-
message:
|
|
15705
|
-
estimatedTokens:
|
|
16011
|
+
message: z16.string().min(1),
|
|
16012
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
15706
16013
|
});
|
|
15707
|
-
var workGraphDirectEdgeSchema =
|
|
16014
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
15708
16015
|
workGraphRelationEdgeSchema,
|
|
15709
16016
|
workGraphDependencyEdgeSchema
|
|
15710
16017
|
]);
|
|
15711
16018
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
15712
|
-
rootId:
|
|
15713
|
-
tokenBudget:
|
|
15714
|
-
includeRelations:
|
|
15715
|
-
includeReadiness:
|
|
15716
|
-
includeRollup:
|
|
16019
|
+
rootId: z16.string().min(1),
|
|
16020
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16021
|
+
includeRelations: z16.boolean().optional(),
|
|
16022
|
+
includeReadiness: z16.boolean().optional(),
|
|
16023
|
+
includeRollup: z16.boolean().optional()
|
|
15717
16024
|
});
|
|
15718
16025
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
15719
|
-
rootId:
|
|
16026
|
+
rootId: z16.string().min(1),
|
|
15720
16027
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
15721
|
-
maxDepth:
|
|
15722
|
-
includeRelations:
|
|
16028
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16029
|
+
includeRelations: z16.boolean().optional()
|
|
15723
16030
|
});
|
|
15724
|
-
var workGraphSliceSchema =
|
|
15725
|
-
rootId:
|
|
16031
|
+
var workGraphSliceSchema = z16.object({
|
|
16032
|
+
rootId: z16.string().min(1),
|
|
15726
16033
|
direction: workGraphTraversalDirectionSchema,
|
|
15727
|
-
nodes:
|
|
15728
|
-
edges:
|
|
16034
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16035
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
15729
16036
|
pageInfo: workGraphPageInfoSchema,
|
|
15730
|
-
omissions:
|
|
16037
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
15731
16038
|
});
|
|
15732
|
-
var workGraphReadinessParamsSchema =
|
|
15733
|
-
rootId:
|
|
15734
|
-
role:
|
|
15735
|
-
includeGateBlockers:
|
|
16039
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
16040
|
+
rootId: z16.string().min(1),
|
|
16041
|
+
role: z16.string().min(1).optional(),
|
|
16042
|
+
includeGateBlockers: z16.boolean().optional()
|
|
15736
16043
|
});
|
|
15737
|
-
var workGraphReadinessResultSchema =
|
|
15738
|
-
rootId:
|
|
15739
|
-
role:
|
|
15740
|
-
ready:
|
|
15741
|
-
warnings:
|
|
15742
|
-
groups:
|
|
15743
|
-
ready:
|
|
15744
|
-
blocked:
|
|
15745
|
-
blockedBy:
|
|
15746
|
-
|
|
15747
|
-
|
|
15748
|
-
kind:
|
|
15749
|
-
blockerId:
|
|
15750
|
-
blocks:
|
|
16044
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
16045
|
+
rootId: z16.string().min(1),
|
|
16046
|
+
role: z16.string().min(1).optional(),
|
|
16047
|
+
ready: z16.boolean(),
|
|
16048
|
+
warnings: z16.array(z16.string()),
|
|
16049
|
+
groups: z16.object({
|
|
16050
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16051
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16052
|
+
blockedBy: z16.array(
|
|
16053
|
+
z16.discriminatedUnion("kind", [
|
|
16054
|
+
z16.object({
|
|
16055
|
+
kind: z16.literal("dependency"),
|
|
16056
|
+
blockerId: z16.string().min(1),
|
|
16057
|
+
blocks: z16.array(z16.string().min(1))
|
|
15751
16058
|
}),
|
|
15752
|
-
|
|
15753
|
-
kind:
|
|
16059
|
+
z16.object({
|
|
16060
|
+
kind: z16.literal("gate"),
|
|
15754
16061
|
gate: verificationGateSchema,
|
|
15755
|
-
blocks:
|
|
16062
|
+
blocks: z16.array(z16.string().min(1))
|
|
15756
16063
|
})
|
|
15757
16064
|
])
|
|
15758
16065
|
)
|
|
15759
16066
|
})
|
|
15760
16067
|
});
|
|
15761
|
-
var workGraphContextPackSchema =
|
|
15762
|
-
rootId:
|
|
15763
|
-
generatedAt:
|
|
16068
|
+
var workGraphContextPackSchema = z16.object({
|
|
16069
|
+
rootId: z16.string().min(1),
|
|
16070
|
+
generatedAt: z16.string().min(1),
|
|
15764
16071
|
budget: workGraphContextBudgetSchema,
|
|
15765
16072
|
slice: workGraphSliceSchema,
|
|
15766
|
-
relationEdges:
|
|
15767
|
-
rootId:
|
|
16073
|
+
relationEdges: z16.object({
|
|
16074
|
+
rootId: z16.string().min(1),
|
|
15768
16075
|
direction: workGraphEdgeDirectionSchema,
|
|
15769
|
-
edges:
|
|
16076
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
15770
16077
|
}).optional(),
|
|
15771
16078
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
15772
|
-
rollup:
|
|
15773
|
-
omissions:
|
|
16079
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
16080
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
15774
16081
|
});
|
|
15775
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
15776
|
-
rootId:
|
|
15777
|
-
nodes:
|
|
15778
|
-
|
|
15779
|
-
id:
|
|
16082
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
16083
|
+
rootId: z16.string().min(1),
|
|
16084
|
+
nodes: z16.array(
|
|
16085
|
+
z16.object({
|
|
16086
|
+
id: z16.string().min(1),
|
|
15780
16087
|
type: taskTypeSchema,
|
|
15781
|
-
parentId:
|
|
16088
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
15782
16089
|
})
|
|
15783
16090
|
),
|
|
15784
|
-
edges:
|
|
15785
|
-
dryRun:
|
|
16091
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
16092
|
+
dryRun: z16.boolean().optional()
|
|
15786
16093
|
});
|
|
15787
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
15788
|
-
code:
|
|
15789
|
-
message:
|
|
15790
|
-
taskId:
|
|
15791
|
-
severity:
|
|
16094
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
16095
|
+
code: z16.string().min(1),
|
|
16096
|
+
message: z16.string().min(1),
|
|
16097
|
+
taskId: z16.string().min(1).optional(),
|
|
16098
|
+
severity: z16.enum(["error", "warning"])
|
|
15792
16099
|
});
|
|
15793
|
-
var workGraphScaffoldValidateResultSchema =
|
|
15794
|
-
rootId:
|
|
15795
|
-
valid:
|
|
15796
|
-
dryRun:
|
|
15797
|
-
issues:
|
|
15798
|
-
hierarchy:
|
|
15799
|
-
valid:
|
|
15800
|
-
violations:
|
|
15801
|
-
|
|
15802
|
-
code:
|
|
15803
|
-
taskId:
|
|
16100
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
16101
|
+
rootId: z16.string().min(1),
|
|
16102
|
+
valid: z16.boolean(),
|
|
16103
|
+
dryRun: z16.boolean(),
|
|
16104
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
16105
|
+
hierarchy: z16.object({
|
|
16106
|
+
valid: z16.boolean(),
|
|
16107
|
+
violations: z16.array(
|
|
16108
|
+
z16.object({
|
|
16109
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16110
|
+
taskId: z16.string().min(1),
|
|
15804
16111
|
taskType: taskTypeSchema,
|
|
15805
|
-
parentId:
|
|
16112
|
+
parentId: z16.string().min(1).nullable(),
|
|
15806
16113
|
parentType: taskTypeSchema.optional(),
|
|
15807
|
-
message:
|
|
16114
|
+
message: z16.string().min(1)
|
|
15808
16115
|
})
|
|
15809
16116
|
)
|
|
15810
16117
|
})
|
|
15811
16118
|
});
|
|
15812
16119
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
15813
|
-
apply:
|
|
16120
|
+
apply: z16.boolean().optional()
|
|
15814
16121
|
});
|
|
15815
16122
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
15816
|
-
applied:
|
|
15817
|
-
nodesChanged:
|
|
15818
|
-
edgesChanged:
|
|
16123
|
+
applied: z16.boolean(),
|
|
16124
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
16125
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
15819
16126
|
});
|
|
15820
|
-
var workGraphPlanningDocParamsSchema =
|
|
15821
|
-
rootId:
|
|
15822
|
-
audience:
|
|
15823
|
-
tokenBudget:
|
|
15824
|
-
includeRelations:
|
|
15825
|
-
includeReadiness:
|
|
15826
|
-
includeRollup:
|
|
16127
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
16128
|
+
rootId: z16.string().min(1),
|
|
16129
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16130
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16131
|
+
includeRelations: z16.boolean().optional(),
|
|
16132
|
+
includeReadiness: z16.boolean().optional(),
|
|
16133
|
+
includeRollup: z16.boolean().optional()
|
|
15827
16134
|
});
|
|
15828
|
-
var workGraphPlanningDocSchema =
|
|
15829
|
-
rootId:
|
|
15830
|
-
generatedAt:
|
|
15831
|
-
audience:
|
|
15832
|
-
title:
|
|
15833
|
-
content:
|
|
15834
|
-
sections:
|
|
15835
|
-
estimatedTokens:
|
|
15836
|
-
budget:
|
|
15837
|
-
tokenBudget:
|
|
15838
|
-
truncated:
|
|
16135
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
16136
|
+
rootId: z16.string().min(1),
|
|
16137
|
+
generatedAt: z16.string().min(1),
|
|
16138
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16139
|
+
title: z16.string().min(1),
|
|
16140
|
+
content: z16.string(),
|
|
16141
|
+
sections: z16.array(z16.string().min(1)),
|
|
16142
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16143
|
+
budget: z16.object({
|
|
16144
|
+
tokenBudget: z16.number().int().positive(),
|
|
16145
|
+
truncated: z16.boolean()
|
|
15839
16146
|
}).optional()
|
|
15840
16147
|
});
|
|
15841
16148
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
15842
|
-
rootId:
|
|
16149
|
+
rootId: z16.string().min(1),
|
|
15843
16150
|
direction: workGraphTraversalDirectionSchema,
|
|
15844
|
-
maxDepth:
|
|
15845
|
-
includeRelations:
|
|
16151
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16152
|
+
includeRelations: z16.boolean().optional()
|
|
15846
16153
|
});
|
|
15847
|
-
var tasksTraverseResultSchema =
|
|
15848
|
-
rootId:
|
|
16154
|
+
var tasksTraverseResultSchema = z16.object({
|
|
16155
|
+
rootId: z16.string().min(1),
|
|
15849
16156
|
direction: workGraphTraversalDirectionSchema,
|
|
15850
|
-
nodes:
|
|
15851
|
-
edges:
|
|
16157
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16158
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
15852
16159
|
pageInfo: workGraphPageInfoSchema
|
|
15853
16160
|
});
|
|
15854
16161
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
15855
|
-
rootId:
|
|
15856
|
-
maxDepth:
|
|
16162
|
+
rootId: z16.string().min(1),
|
|
16163
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
15857
16164
|
});
|
|
15858
|
-
var tasksTreeResultSchema =
|
|
15859
|
-
rootId:
|
|
15860
|
-
nodes:
|
|
15861
|
-
edges:
|
|
16165
|
+
var tasksTreeResultSchema = z16.object({
|
|
16166
|
+
rootId: z16.string().min(1),
|
|
16167
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
16168
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
15862
16169
|
pageInfo: workGraphPageInfoSchema
|
|
15863
16170
|
});
|
|
15864
|
-
var tasksRollupParamsSchema =
|
|
15865
|
-
rootId:
|
|
16171
|
+
var tasksRollupParamsSchema = z16.object({
|
|
16172
|
+
rootId: z16.string().min(1),
|
|
15866
16173
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
15867
16174
|
});
|
|
15868
|
-
var tasksRollupResultSchema =
|
|
15869
|
-
rootId:
|
|
16175
|
+
var tasksRollupResultSchema = z16.object({
|
|
16176
|
+
rootId: z16.string().min(1),
|
|
15870
16177
|
direct: workGraphRollupCountsSchema,
|
|
15871
16178
|
subtree: workGraphRollupCountsSchema,
|
|
15872
|
-
percentDenominator:
|
|
15873
|
-
basis:
|
|
15874
|
-
total:
|
|
15875
|
-
description:
|
|
16179
|
+
percentDenominator: z16.object({
|
|
16180
|
+
basis: z16.literal("subtree-total"),
|
|
16181
|
+
total: z16.number().int().nonnegative(),
|
|
16182
|
+
description: z16.string().min(1)
|
|
15876
16183
|
}),
|
|
15877
16184
|
percentages: workGraphSubtreePercentagesSchema,
|
|
15878
|
-
staleProjection:
|
|
15879
|
-
projectionMismatches:
|
|
16185
|
+
staleProjection: z16.boolean(),
|
|
16186
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
15880
16187
|
});
|
|
15881
|
-
var tasksFrontierParamsSchema =
|
|
15882
|
-
rootId:
|
|
15883
|
-
role:
|
|
16188
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
16189
|
+
rootId: z16.string().min(1),
|
|
16190
|
+
role: z16.string().min(1).optional()
|
|
15884
16191
|
});
|
|
15885
|
-
var tasksFrontierResultSchema =
|
|
15886
|
-
rootId:
|
|
15887
|
-
role:
|
|
15888
|
-
groups:
|
|
15889
|
-
ready:
|
|
15890
|
-
blocked:
|
|
15891
|
-
blockedBy:
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
kind:
|
|
15895
|
-
blockerId:
|
|
15896
|
-
blocks:
|
|
16192
|
+
var tasksFrontierResultSchema = z16.object({
|
|
16193
|
+
rootId: z16.string().min(1),
|
|
16194
|
+
role: z16.string().min(1).optional(),
|
|
16195
|
+
groups: z16.object({
|
|
16196
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16197
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16198
|
+
blockedBy: z16.array(
|
|
16199
|
+
z16.discriminatedUnion("kind", [
|
|
16200
|
+
z16.object({
|
|
16201
|
+
kind: z16.literal("dependency"),
|
|
16202
|
+
blockerId: z16.string().min(1),
|
|
16203
|
+
blocks: z16.array(z16.string().min(1))
|
|
15897
16204
|
}),
|
|
15898
|
-
|
|
15899
|
-
kind:
|
|
16205
|
+
z16.object({
|
|
16206
|
+
kind: z16.literal("gate"),
|
|
15900
16207
|
gate: verificationGateSchema,
|
|
15901
|
-
blocks:
|
|
16208
|
+
blocks: z16.array(z16.string().min(1))
|
|
15902
16209
|
})
|
|
15903
16210
|
])
|
|
15904
16211
|
)
|
|
15905
16212
|
})
|
|
15906
16213
|
});
|
|
15907
16214
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
15908
|
-
rootId:
|
|
15909
|
-
maxDepth:
|
|
15910
|
-
includeRelations:
|
|
16215
|
+
rootId: z16.string().min(1),
|
|
16216
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16217
|
+
includeRelations: z16.boolean().optional()
|
|
15911
16218
|
});
|
|
15912
|
-
var tasksWorkGraphAuditResultSchema =
|
|
15913
|
-
rootId:
|
|
15914
|
-
hierarchy:
|
|
15915
|
-
valid:
|
|
15916
|
-
violations:
|
|
15917
|
-
|
|
15918
|
-
code:
|
|
15919
|
-
taskId:
|
|
16219
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
16220
|
+
rootId: z16.string().min(1),
|
|
16221
|
+
hierarchy: z16.object({
|
|
16222
|
+
valid: z16.boolean(),
|
|
16223
|
+
violations: z16.array(
|
|
16224
|
+
z16.object({
|
|
16225
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16226
|
+
taskId: z16.string().min(1),
|
|
15920
16227
|
taskType: taskTypeSchema,
|
|
15921
|
-
parentId:
|
|
16228
|
+
parentId: z16.string().min(1).nullable(),
|
|
15922
16229
|
parentType: taskTypeSchema.optional(),
|
|
15923
|
-
message:
|
|
16230
|
+
message: z16.string().min(1)
|
|
15924
16231
|
})
|
|
15925
16232
|
)
|
|
15926
16233
|
}),
|
|
15927
16234
|
traversal: tasksTraverseResultSchema,
|
|
15928
16235
|
frontier: tasksFrontierResultSchema,
|
|
15929
16236
|
rollup: tasksRollupResultSchema,
|
|
15930
|
-
relationEdges:
|
|
15931
|
-
rootId:
|
|
16237
|
+
relationEdges: z16.object({
|
|
16238
|
+
rootId: z16.string().min(1),
|
|
15932
16239
|
direction: workGraphEdgeDirectionSchema,
|
|
15933
|
-
edges:
|
|
15934
|
-
|
|
16240
|
+
edges: z16.array(
|
|
16241
|
+
z16.discriminatedUnion("source", [
|
|
15935
16242
|
workGraphRelationEdgeSchema,
|
|
15936
16243
|
workGraphDependencyEdgeSchema
|
|
15937
16244
|
])
|
|
@@ -15940,60 +16247,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
15940
16247
|
});
|
|
15941
16248
|
|
|
15942
16249
|
// packages/contracts/src/operations/docs.ts
|
|
15943
|
-
import { z as
|
|
15944
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
15945
|
-
version:
|
|
15946
|
-
operation:
|
|
15947
|
-
identity:
|
|
15948
|
-
projectId:
|
|
15949
|
-
projectRoot:
|
|
15950
|
-
actor:
|
|
15951
|
-
operation:
|
|
15952
|
-
idempotencyKey:
|
|
16250
|
+
import { z as z17 } from "zod";
|
|
16251
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
16252
|
+
version: z17.literal(1),
|
|
16253
|
+
operation: z17.literal("docs.projection"),
|
|
16254
|
+
identity: z17.object({
|
|
16255
|
+
projectId: z17.string().min(1),
|
|
16256
|
+
projectRoot: z17.string().min(1),
|
|
16257
|
+
actor: z17.string().min(1),
|
|
16258
|
+
operation: z17.literal("docs.projection"),
|
|
16259
|
+
idempotencyKey: z17.string().min(1)
|
|
15953
16260
|
}).strict(),
|
|
15954
|
-
source:
|
|
15955
|
-
attachmentId:
|
|
15956
|
-
sha256:
|
|
15957
|
-
ownerId:
|
|
15958
|
-
ownerType:
|
|
15959
|
-
label:
|
|
16261
|
+
source: z17.object({
|
|
16262
|
+
attachmentId: z17.string().min(1),
|
|
16263
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16264
|
+
ownerId: z17.string().min(1),
|
|
16265
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
16266
|
+
label: z17.string().min(1)
|
|
15960
16267
|
}).strict(),
|
|
15961
|
-
observation:
|
|
15962
|
-
kind:
|
|
15963
|
-
attachmentId:
|
|
15964
|
-
ownerId:
|
|
15965
|
-
addedAt:
|
|
15966
|
-
slug:
|
|
15967
|
-
type:
|
|
16268
|
+
observation: z17.object({
|
|
16269
|
+
kind: z17.literal("doc-attachment"),
|
|
16270
|
+
attachmentId: z17.string().min(1),
|
|
16271
|
+
ownerId: z17.string().min(1),
|
|
16272
|
+
addedAt: z17.string().min(1),
|
|
16273
|
+
slug: z17.string().optional(),
|
|
16274
|
+
type: z17.string().optional()
|
|
15968
16275
|
}).strict()
|
|
15969
16276
|
}).strict();
|
|
15970
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
15971
|
-
version:
|
|
15972
|
-
sourceHash:
|
|
15973
|
-
graph:
|
|
16277
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
16278
|
+
version: z17.literal(1),
|
|
16279
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16280
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
15974
16281
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
15975
|
-
observationId:
|
|
16282
|
+
observationId: z17.string().min(1).optional(),
|
|
15976
16283
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
15977
|
-
documents:
|
|
15978
|
-
verifiedAt:
|
|
15979
|
-
actor:
|
|
16284
|
+
documents: z17.literal(true).optional(),
|
|
16285
|
+
verifiedAt: z17.string().min(1),
|
|
16286
|
+
actor: z17.string().min(1)
|
|
15980
16287
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
15981
16288
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
15982
16289
|
});
|
|
15983
16290
|
|
|
15984
16291
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
15985
|
-
import { z as
|
|
15986
|
-
var taskTreeEntrySchema =
|
|
15987
|
-
title:
|
|
15988
|
-
acceptance:
|
|
16292
|
+
import { z as z18 } from "zod";
|
|
16293
|
+
var taskTreeEntrySchema = z18.object({
|
|
16294
|
+
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" }),
|
|
16295
|
+
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), {
|
|
15989
16296
|
message: "acceptance array contains no non-empty strings"
|
|
15990
16297
|
}),
|
|
15991
|
-
id:
|
|
15992
|
-
parentId:
|
|
15993
|
-
depends:
|
|
16298
|
+
id: z18.string().optional(),
|
|
16299
|
+
parentId: z18.string().optional(),
|
|
16300
|
+
depends: z18.array(z18.string()).optional()
|
|
15994
16301
|
});
|
|
15995
|
-
var taskTreeSchema =
|
|
15996
|
-
var evidenceSchema =
|
|
16302
|
+
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" });
|
|
16303
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
15997
16304
|
if (value === null || value === void 0) {
|
|
15998
16305
|
ctx.addIssue({
|
|
15999
16306
|
code: "custom",
|
|
@@ -16027,7 +16334,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
16027
16334
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
16028
16335
|
});
|
|
16029
16336
|
});
|
|
16030
|
-
var passthroughSchema =
|
|
16337
|
+
var passthroughSchema = z18.unknown();
|
|
16031
16338
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
16032
16339
|
// release.cantbook
|
|
16033
16340
|
"version_bump_report",
|
|
@@ -16060,44 +16367,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
16060
16367
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
16061
16368
|
|
|
16062
16369
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
16063
|
-
import { z as
|
|
16064
|
-
var parsedPrEvidenceAtomSchema =
|
|
16065
|
-
kind:
|
|
16066
|
-
prNumber:
|
|
16370
|
+
import { z as z19 } from "zod";
|
|
16371
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
16372
|
+
kind: z19.literal("pr"),
|
|
16373
|
+
prNumber: z19.number().int().positive()
|
|
16067
16374
|
});
|
|
16068
|
-
var prEvidenceStateModifierSchema =
|
|
16069
|
-
kind:
|
|
16070
|
-
value:
|
|
16375
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
16376
|
+
kind: z19.literal("state"),
|
|
16377
|
+
value: z19.literal("MERGED")
|
|
16071
16378
|
});
|
|
16072
|
-
var ghPrViewSchema =
|
|
16073
|
-
state:
|
|
16074
|
-
mergedAt:
|
|
16075
|
-
headRefOid:
|
|
16076
|
-
mergeCommit:
|
|
16077
|
-
title:
|
|
16078
|
-
body:
|
|
16079
|
-
headRefName:
|
|
16080
|
-
files:
|
|
16081
|
-
changedFiles:
|
|
16082
|
-
mergeable:
|
|
16083
|
-
statusCheckRollup:
|
|
16084
|
-
|
|
16085
|
-
__typename:
|
|
16086
|
-
name:
|
|
16087
|
-
workflowName:
|
|
16088
|
-
conclusion:
|
|
16089
|
-
status:
|
|
16379
|
+
var ghPrViewSchema = z19.object({
|
|
16380
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
16381
|
+
mergedAt: z19.string().nullable(),
|
|
16382
|
+
headRefOid: z19.string().optional(),
|
|
16383
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
16384
|
+
title: z19.string().optional(),
|
|
16385
|
+
body: z19.string().optional(),
|
|
16386
|
+
headRefName: z19.string().optional(),
|
|
16387
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
16388
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
16389
|
+
mergeable: z19.string().optional(),
|
|
16390
|
+
statusCheckRollup: z19.array(
|
|
16391
|
+
z19.object({
|
|
16392
|
+
__typename: z19.string().optional(),
|
|
16393
|
+
name: z19.string().optional(),
|
|
16394
|
+
workflowName: z19.string().optional(),
|
|
16395
|
+
conclusion: z19.string().nullable().optional(),
|
|
16396
|
+
status: z19.string().optional(),
|
|
16090
16397
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16091
|
-
startedAt:
|
|
16398
|
+
startedAt: z19.string().nullable().optional(),
|
|
16092
16399
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16093
|
-
completedAt:
|
|
16400
|
+
completedAt: z19.string().nullable().optional()
|
|
16094
16401
|
}).passthrough()
|
|
16095
16402
|
).optional().default([])
|
|
16096
16403
|
}).passthrough();
|
|
16097
16404
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
16098
16405
|
|
|
16099
16406
|
// packages/contracts/src/release/plan.ts
|
|
16100
|
-
import { z as
|
|
16407
|
+
import { z as z20 } from "zod";
|
|
16101
16408
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
16102
16409
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
16103
16410
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -16141,20 +16448,20 @@ var RESOLVED_SOURCE = [
|
|
|
16141
16448
|
"language-default",
|
|
16142
16449
|
"legacy-alias"
|
|
16143
16450
|
];
|
|
16144
|
-
var ReleaseChannelSchema =
|
|
16145
|
-
var ReleaseSchemeSchema =
|
|
16146
|
-
var ReleaseKindSchema =
|
|
16147
|
-
var ReleaseStatusSchema =
|
|
16148
|
-
var GateStatusSchema =
|
|
16149
|
-
var GateNameSchema =
|
|
16150
|
-
var PlatformTupleSchema =
|
|
16151
|
-
var PublisherSchema =
|
|
16152
|
-
var TaskKindSchema =
|
|
16153
|
-
var ImpactSchema =
|
|
16154
|
-
var ResolvedSourceSchema =
|
|
16155
|
-
var Iso8601 =
|
|
16156
|
-
var NonEmptyString =
|
|
16157
|
-
var ReleasePlanTaskSchema =
|
|
16451
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
16452
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
16453
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
16454
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
16455
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
16456
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
16457
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
16458
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
16459
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
16460
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
16461
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
16462
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
16463
|
+
var NonEmptyString = z20.string().min(1);
|
|
16464
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
16158
16465
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
16159
16466
|
id: NonEmptyString,
|
|
16160
16467
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -16162,20 +16469,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
16162
16469
|
/** SemVer impact classification. */
|
|
16163
16470
|
impact: ImpactSchema,
|
|
16164
16471
|
/** Human-readable changelog line for this task. */
|
|
16165
|
-
userFacingSummary:
|
|
16472
|
+
userFacingSummary: z20.string(),
|
|
16166
16473
|
/**
|
|
16167
16474
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
16168
16475
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
16169
16476
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
16170
16477
|
* enforces non-empty via R-301.
|
|
16171
16478
|
*/
|
|
16172
|
-
evidenceAtoms:
|
|
16479
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
16173
16480
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
16174
|
-
ivtrPhaseAtPlan:
|
|
16481
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
16175
16482
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
16176
16483
|
epicAncestor: NonEmptyString
|
|
16177
16484
|
});
|
|
16178
|
-
var ReleaseGateSchema =
|
|
16485
|
+
var ReleaseGateSchema = z20.object({
|
|
16179
16486
|
/** Canonical gate name. */
|
|
16180
16487
|
name: GateNameSchema,
|
|
16181
16488
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -16185,11 +16492,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
16185
16492
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
16186
16493
|
lastVerifiedAt: Iso8601,
|
|
16187
16494
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
16188
|
-
resolvedCommand:
|
|
16495
|
+
resolvedCommand: z20.string().optional(),
|
|
16189
16496
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
16190
16497
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
16191
16498
|
});
|
|
16192
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
16499
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
16193
16500
|
/** Target platform tuple. */
|
|
16194
16501
|
platform: PlatformTupleSchema,
|
|
16195
16502
|
/** Distribution backend. */
|
|
@@ -16197,47 +16504,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
16197
16504
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
16198
16505
|
package: NonEmptyString,
|
|
16199
16506
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
16200
|
-
smoke:
|
|
16507
|
+
smoke: z20.boolean().default(true).optional()
|
|
16201
16508
|
});
|
|
16202
|
-
var ReleasePreflightSummarySchema =
|
|
16509
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
16203
16510
|
/** True if esbuild externals are out of sync with package.json. */
|
|
16204
|
-
esbuildExternalsDrift:
|
|
16511
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
16205
16512
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
16206
|
-
lockfileDrift:
|
|
16513
|
+
lockfileDrift: z20.boolean(),
|
|
16207
16514
|
/** True if all epic children are in terminal lifecycle states. */
|
|
16208
|
-
epicCompletenessClean:
|
|
16515
|
+
epicCompletenessClean: z20.boolean(),
|
|
16209
16516
|
/** True if no task appears in multiple in-flight release plans. */
|
|
16210
|
-
doubleListingClean:
|
|
16517
|
+
doubleListingClean: z20.boolean(),
|
|
16211
16518
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
16212
|
-
preflightWarnings:
|
|
16519
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
16213
16520
|
});
|
|
16214
|
-
var ReleasePlanChangelogSchema =
|
|
16521
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
16215
16522
|
/** `kind=feat` tasks. */
|
|
16216
|
-
features:
|
|
16523
|
+
features: z20.array(NonEmptyString).default([]),
|
|
16217
16524
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
16218
|
-
fixes:
|
|
16525
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
16219
16526
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
16220
|
-
chores:
|
|
16527
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
16221
16528
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
16222
|
-
breaking:
|
|
16529
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
16223
16530
|
});
|
|
16224
|
-
var ReleasePlanMetaSchema =
|
|
16531
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
16225
16532
|
/** True if this is the project's first ever release. */
|
|
16226
|
-
firstEverRelease:
|
|
16533
|
+
firstEverRelease: z20.boolean().optional(),
|
|
16227
16534
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
16228
|
-
unresolvedTools:
|
|
16535
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
16229
16536
|
/** Project archetype detected at plan time. */
|
|
16230
|
-
archetype:
|
|
16231
|
-
}).catchall(
|
|
16232
|
-
var ReleasePlanSchema =
|
|
16537
|
+
archetype: z20.string().optional()
|
|
16538
|
+
}).catchall(z20.unknown());
|
|
16539
|
+
var ReleasePlanSchema = z20.object({
|
|
16233
16540
|
/** Schema URL for this plan version. */
|
|
16234
|
-
$schema:
|
|
16541
|
+
$schema: z20.string().optional(),
|
|
16235
16542
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
16236
16543
|
version: NonEmptyString,
|
|
16237
16544
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
16238
16545
|
resolvedVersion: NonEmptyString,
|
|
16239
16546
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
16240
|
-
suffixApplied:
|
|
16547
|
+
suffixApplied: z20.boolean(),
|
|
16241
16548
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
16242
16549
|
scheme: ReleaseSchemeSchema,
|
|
16243
16550
|
/** npm dist-tag channel for this release. */
|
|
@@ -16251,7 +16558,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
16251
16558
|
/** Release-kind classification. */
|
|
16252
16559
|
releaseKind: ReleaseKindSchema,
|
|
16253
16560
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
16254
|
-
hooksV1Promotion:
|
|
16561
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
16255
16562
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
16256
16563
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
16257
16564
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -16262,27 +16569,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
16262
16569
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
16263
16570
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
16264
16571
|
*/
|
|
16265
|
-
previousVersion:
|
|
16572
|
+
previousVersion: z20.string().nullable(),
|
|
16266
16573
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
16267
|
-
previousTag:
|
|
16574
|
+
previousTag: z20.string().nullable(),
|
|
16268
16575
|
/** ISO-8601 timestamp the previous release was published. */
|
|
16269
16576
|
previousShippedAt: Iso8601.nullable(),
|
|
16270
16577
|
/** Tasks rolled into this release. */
|
|
16271
|
-
tasks:
|
|
16578
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
16272
16579
|
/** Bucketed changelog. */
|
|
16273
16580
|
changelog: ReleasePlanChangelogSchema,
|
|
16274
16581
|
/** Per-gate verification status. */
|
|
16275
|
-
gates:
|
|
16582
|
+
gates: z20.array(ReleaseGateSchema),
|
|
16276
16583
|
/** Platform / publisher matrix. */
|
|
16277
|
-
platformMatrix:
|
|
16584
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
16278
16585
|
/** Preflight summary from `cleo release plan`. */
|
|
16279
16586
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
16280
16587
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
16281
|
-
workflowRunUrl:
|
|
16588
|
+
workflowRunUrl: z20.string().nullable(),
|
|
16282
16589
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
16283
|
-
prUrl:
|
|
16590
|
+
prUrl: z20.string().nullable(),
|
|
16284
16591
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
16285
|
-
mergeCommitSha:
|
|
16592
|
+
mergeCommitSha: z20.string().nullable(),
|
|
16286
16593
|
/** Current FSM state per R-302. */
|
|
16287
16594
|
status: ReleaseStatusSchema,
|
|
16288
16595
|
/** Informational / forward-compat metadata. */
|
|
@@ -16312,48 +16619,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
16312
16619
|
]);
|
|
16313
16620
|
|
|
16314
16621
|
// packages/contracts/src/session-journal.ts
|
|
16315
|
-
import { z as
|
|
16622
|
+
import { z as z21 } from "zod";
|
|
16316
16623
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
16317
|
-
var sessionJournalDoctorSummarySchema =
|
|
16624
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
16318
16625
|
/** `true` when zero noise patterns were detected. */
|
|
16319
|
-
isClean:
|
|
16626
|
+
isClean: z21.boolean(),
|
|
16320
16627
|
/** Total number of noise findings across all patterns. */
|
|
16321
|
-
findingsCount:
|
|
16628
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
16322
16629
|
/** Pattern names that were detected (empty when isClean). */
|
|
16323
|
-
patterns:
|
|
16630
|
+
patterns: z21.array(z21.string()),
|
|
16324
16631
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
16325
|
-
totalScanned:
|
|
16632
|
+
totalScanned: z21.number().int().nonnegative()
|
|
16326
16633
|
});
|
|
16327
|
-
var sessionJournalDebriefSummarySchema =
|
|
16634
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
16328
16635
|
/** First 200 characters of the session end note (if provided). */
|
|
16329
|
-
noteExcerpt:
|
|
16636
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
16330
16637
|
/** Number of tasks completed during the session. */
|
|
16331
|
-
tasksCompletedCount:
|
|
16638
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
16332
16639
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
16333
|
-
tasksFocused:
|
|
16640
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
16334
16641
|
});
|
|
16335
|
-
var sessionJournalEntrySchema =
|
|
16642
|
+
var sessionJournalEntrySchema = z21.object({
|
|
16336
16643
|
// Identity
|
|
16337
16644
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
16338
|
-
schemaVersion:
|
|
16645
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
16339
16646
|
/** ISO 8601 timestamp when the entry was written. */
|
|
16340
|
-
timestamp:
|
|
16647
|
+
timestamp: z21.string(),
|
|
16341
16648
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
16342
|
-
sessionId:
|
|
16649
|
+
sessionId: z21.string(),
|
|
16343
16650
|
/** Event type that triggered this journal entry. */
|
|
16344
|
-
eventType:
|
|
16651
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
16345
16652
|
// Session metadata (set on session_start / session_end)
|
|
16346
16653
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
16347
|
-
agentIdentifier:
|
|
16654
|
+
agentIdentifier: z21.string().optional(),
|
|
16348
16655
|
/** Provider adapter ID active for this session. */
|
|
16349
|
-
providerId:
|
|
16656
|
+
providerId: z21.string().optional(),
|
|
16350
16657
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
16351
|
-
scope:
|
|
16658
|
+
scope: z21.string().optional(),
|
|
16352
16659
|
// Session-end fields
|
|
16353
16660
|
/** Duration of the session in seconds (session_end only). */
|
|
16354
|
-
duration:
|
|
16661
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
16355
16662
|
/** Task IDs (not titles) completed during the session. */
|
|
16356
|
-
tasksCompleted:
|
|
16663
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
16357
16664
|
// Doctor summary (T1262 absorbed)
|
|
16358
16665
|
/**
|
|
16359
16666
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -16368,52 +16675,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
16368
16675
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
16369
16676
|
// Optional hash chain
|
|
16370
16677
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
16371
|
-
prevEntryHash:
|
|
16678
|
+
prevEntryHash: z21.string().optional()
|
|
16372
16679
|
});
|
|
16373
16680
|
|
|
16374
16681
|
// packages/contracts/src/task-evidence.ts
|
|
16375
|
-
import { z as
|
|
16376
|
-
var fileEvidenceSchema =
|
|
16377
|
-
kind:
|
|
16378
|
-
sha256:
|
|
16379
|
-
timestamp:
|
|
16380
|
-
path:
|
|
16381
|
-
mime:
|
|
16382
|
-
description:
|
|
16682
|
+
import { z as z22 } from "zod";
|
|
16683
|
+
var fileEvidenceSchema = z22.object({
|
|
16684
|
+
kind: z22.literal("file"),
|
|
16685
|
+
sha256: z22.string().length(64),
|
|
16686
|
+
timestamp: z22.string().datetime(),
|
|
16687
|
+
path: z22.string().min(1),
|
|
16688
|
+
mime: z22.string().optional(),
|
|
16689
|
+
description: z22.string().optional()
|
|
16383
16690
|
});
|
|
16384
|
-
var logEvidenceSchema =
|
|
16385
|
-
kind:
|
|
16386
|
-
sha256:
|
|
16387
|
-
timestamp:
|
|
16388
|
-
source:
|
|
16389
|
-
description:
|
|
16691
|
+
var logEvidenceSchema = z22.object({
|
|
16692
|
+
kind: z22.literal("log"),
|
|
16693
|
+
sha256: z22.string().length(64),
|
|
16694
|
+
timestamp: z22.string().datetime(),
|
|
16695
|
+
source: z22.string().min(1),
|
|
16696
|
+
description: z22.string().optional()
|
|
16390
16697
|
});
|
|
16391
|
-
var screenshotEvidenceSchema =
|
|
16392
|
-
kind:
|
|
16393
|
-
sha256:
|
|
16394
|
-
timestamp:
|
|
16395
|
-
mime:
|
|
16396
|
-
description:
|
|
16698
|
+
var screenshotEvidenceSchema = z22.object({
|
|
16699
|
+
kind: z22.literal("screenshot"),
|
|
16700
|
+
sha256: z22.string().length(64),
|
|
16701
|
+
timestamp: z22.string().datetime(),
|
|
16702
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
16703
|
+
description: z22.string().optional()
|
|
16397
16704
|
});
|
|
16398
|
-
var testOutputEvidenceSchema =
|
|
16399
|
-
kind:
|
|
16400
|
-
sha256:
|
|
16401
|
-
timestamp:
|
|
16402
|
-
passed:
|
|
16403
|
-
failed:
|
|
16404
|
-
skipped:
|
|
16405
|
-
exitCode:
|
|
16406
|
-
description:
|
|
16705
|
+
var testOutputEvidenceSchema = z22.object({
|
|
16706
|
+
kind: z22.literal("test-output"),
|
|
16707
|
+
sha256: z22.string().length(64),
|
|
16708
|
+
timestamp: z22.string().datetime(),
|
|
16709
|
+
passed: z22.number().int().nonnegative(),
|
|
16710
|
+
failed: z22.number().int().nonnegative(),
|
|
16711
|
+
skipped: z22.number().int().nonnegative(),
|
|
16712
|
+
exitCode: z22.number().int(),
|
|
16713
|
+
description: z22.string().optional()
|
|
16407
16714
|
});
|
|
16408
|
-
var commandOutputEvidenceSchema =
|
|
16409
|
-
kind:
|
|
16410
|
-
sha256:
|
|
16411
|
-
timestamp:
|
|
16412
|
-
cmd:
|
|
16413
|
-
exitCode:
|
|
16414
|
-
description:
|
|
16715
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
16716
|
+
kind: z22.literal("command-output"),
|
|
16717
|
+
sha256: z22.string().length(64),
|
|
16718
|
+
timestamp: z22.string().datetime(),
|
|
16719
|
+
cmd: z22.string().min(1),
|
|
16720
|
+
exitCode: z22.number().int(),
|
|
16721
|
+
description: z22.string().optional()
|
|
16415
16722
|
});
|
|
16416
|
-
var taskEvidenceSchema =
|
|
16723
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
16417
16724
|
fileEvidenceSchema,
|
|
16418
16725
|
logEvidenceSchema,
|
|
16419
16726
|
screenshotEvidenceSchema,
|
|
@@ -16422,8 +16729,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
16422
16729
|
]);
|
|
16423
16730
|
|
|
16424
16731
|
// packages/contracts/src/tasks/archive.ts
|
|
16425
|
-
import { z as
|
|
16426
|
-
var ArchiveReason =
|
|
16732
|
+
import { z as z23 } from "zod";
|
|
16733
|
+
var ArchiveReason = z23.enum([
|
|
16427
16734
|
"verified",
|
|
16428
16735
|
"reconciled",
|
|
16429
16736
|
"superseded",
|
|
@@ -16434,42 +16741,42 @@ var ArchiveReason = z22.enum([
|
|
|
16434
16741
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
16435
16742
|
|
|
16436
16743
|
// packages/contracts/src/tasks/index.ts
|
|
16437
|
-
import { z as
|
|
16438
|
-
var taskMutationWarningSeveritySchema =
|
|
16439
|
-
var taskMutationWarningSchema =
|
|
16440
|
-
code:
|
|
16441
|
-
message:
|
|
16744
|
+
import { z as z24 } from "zod";
|
|
16745
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
16746
|
+
var taskMutationWarningSchema = z24.object({
|
|
16747
|
+
code: z24.string().min(1),
|
|
16748
|
+
message: z24.string().min(1),
|
|
16442
16749
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
16443
|
-
taskId:
|
|
16444
|
-
field:
|
|
16445
|
-
index:
|
|
16750
|
+
taskId: z24.string().min(1).optional(),
|
|
16751
|
+
field: z24.string().min(1).optional(),
|
|
16752
|
+
index: z24.number().int().nonnegative().optional()
|
|
16446
16753
|
});
|
|
16447
|
-
var taskMutationDryRunSummarySchema =
|
|
16448
|
-
dryRun:
|
|
16449
|
-
wouldCreate:
|
|
16450
|
-
wouldUpdate:
|
|
16451
|
-
wouldDelete:
|
|
16452
|
-
wouldAffect:
|
|
16453
|
-
validatedCount:
|
|
16454
|
-
insertedCount:
|
|
16455
|
-
updatedCount:
|
|
16456
|
-
deletedCount:
|
|
16457
|
-
warnings:
|
|
16754
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
16755
|
+
dryRun: z24.literal(true),
|
|
16756
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
16757
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
16758
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
16759
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
16760
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
16761
|
+
insertedCount: z24.literal(0),
|
|
16762
|
+
updatedCount: z24.literal(0),
|
|
16763
|
+
deletedCount: z24.literal(0),
|
|
16764
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
16458
16765
|
});
|
|
16459
|
-
var taskMutationTaskRecordSchema =
|
|
16460
|
-
var taskMutationEnvelopeSchema =
|
|
16461
|
-
dryRun:
|
|
16462
|
-
created:
|
|
16463
|
-
updated:
|
|
16464
|
-
deleted:
|
|
16465
|
-
affectedCount:
|
|
16466
|
-
mutationWarnings:
|
|
16766
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
16767
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
16768
|
+
dryRun: z24.boolean().optional(),
|
|
16769
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
16770
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
16771
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
16772
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
16773
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
16467
16774
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
16468
16775
|
});
|
|
16469
|
-
var completionTaskStatusSchema =
|
|
16470
|
-
var completionCriterionKindSchema =
|
|
16471
|
-
var completionCriterionStatusSchema =
|
|
16472
|
-
var completionBlockerReasonSchema =
|
|
16776
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
16777
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
16778
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
16779
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
16473
16780
|
"missing_evidence_binding",
|
|
16474
16781
|
"child_not_done",
|
|
16475
16782
|
"child_cancelled_requires_waiver",
|
|
@@ -16477,68 +16784,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
16477
16784
|
"child_missing",
|
|
16478
16785
|
"done_parent_stale"
|
|
16479
16786
|
]);
|
|
16480
|
-
var completionStaleReasonSchema =
|
|
16481
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
16787
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
16788
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
16482
16789
|
"projection_not_stale",
|
|
16483
16790
|
"criteria_missing",
|
|
16484
16791
|
"binding_target_missing",
|
|
16485
16792
|
"repair_conflict"
|
|
16486
16793
|
]);
|
|
16487
|
-
var completionCriterionWaiverSchema =
|
|
16488
|
-
criterionAcId:
|
|
16489
|
-
childTaskId:
|
|
16490
|
-
reason:
|
|
16491
|
-
actor:
|
|
16492
|
-
waivedAt:
|
|
16794
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
16795
|
+
criterionAcId: z24.string().min(1),
|
|
16796
|
+
childTaskId: z24.string().min(1),
|
|
16797
|
+
reason: z24.string().min(1),
|
|
16798
|
+
actor: z24.string().min(1),
|
|
16799
|
+
waivedAt: z24.string().min(1)
|
|
16493
16800
|
});
|
|
16494
|
-
var completionCriterionReplacementSchema =
|
|
16495
|
-
criterionAcId:
|
|
16496
|
-
originalChildTaskId:
|
|
16497
|
-
replacementChildTaskId:
|
|
16498
|
-
reason:
|
|
16499
|
-
actor:
|
|
16500
|
-
replacedAt:
|
|
16801
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
16802
|
+
criterionAcId: z24.string().min(1),
|
|
16803
|
+
originalChildTaskId: z24.string().min(1),
|
|
16804
|
+
replacementChildTaskId: z24.string().min(1),
|
|
16805
|
+
reason: z24.string().min(1),
|
|
16806
|
+
actor: z24.string().min(1),
|
|
16807
|
+
replacedAt: z24.string().min(1)
|
|
16501
16808
|
});
|
|
16502
|
-
var completionCriterionEvaluationSchema =
|
|
16503
|
-
acId:
|
|
16504
|
-
alias:
|
|
16505
|
-
text:
|
|
16809
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
16810
|
+
acId: z24.string().min(1),
|
|
16811
|
+
alias: z24.string().min(1),
|
|
16812
|
+
text: z24.string(),
|
|
16506
16813
|
kind: completionCriterionKindSchema,
|
|
16507
16814
|
status: completionCriterionStatusSchema,
|
|
16508
16815
|
reason: completionBlockerReasonSchema.optional(),
|
|
16509
|
-
targetTaskId:
|
|
16816
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
16510
16817
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
16511
16818
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
16512
16819
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
16513
16820
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
16514
|
-
evidenceBindings:
|
|
16821
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
16515
16822
|
});
|
|
16516
16823
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
16517
|
-
status:
|
|
16824
|
+
status: z24.literal("unsatisfied"),
|
|
16518
16825
|
reason: completionBlockerReasonSchema
|
|
16519
16826
|
});
|
|
16520
|
-
var completionTotalsSchema =
|
|
16521
|
-
criteria:
|
|
16522
|
-
satisfied:
|
|
16523
|
-
unsatisfied:
|
|
16524
|
-
waived:
|
|
16525
|
-
replaced:
|
|
16827
|
+
var completionTotalsSchema = z24.object({
|
|
16828
|
+
criteria: z24.number().int().nonnegative(),
|
|
16829
|
+
satisfied: z24.number().int().nonnegative(),
|
|
16830
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
16831
|
+
waived: z24.number().int().nonnegative(),
|
|
16832
|
+
replaced: z24.number().int().nonnegative()
|
|
16526
16833
|
});
|
|
16527
|
-
var completionContextPackSchema =
|
|
16528
|
-
taskId:
|
|
16529
|
-
generatedAt:
|
|
16530
|
-
source:
|
|
16531
|
-
window:
|
|
16532
|
-
limit:
|
|
16533
|
-
since:
|
|
16534
|
-
relationDepth:
|
|
16535
|
-
relatedTaskIds:
|
|
16834
|
+
var completionContextPackSchema = z24.object({
|
|
16835
|
+
taskId: z24.string().min(1),
|
|
16836
|
+
generatedAt: z24.string().min(1),
|
|
16837
|
+
source: z24.literal("audit_log"),
|
|
16838
|
+
window: z24.object({
|
|
16839
|
+
limit: z24.number().int().positive(),
|
|
16840
|
+
since: z24.string().min(1).optional(),
|
|
16841
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
16842
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
16536
16843
|
}),
|
|
16537
|
-
events:
|
|
16538
|
-
|
|
16539
|
-
id:
|
|
16540
|
-
timestamp:
|
|
16541
|
-
action:
|
|
16844
|
+
events: z24.array(
|
|
16845
|
+
z24.object({
|
|
16846
|
+
id: z24.string().min(1),
|
|
16847
|
+
timestamp: z24.string().min(1),
|
|
16848
|
+
action: z24.enum([
|
|
16542
16849
|
"task_completed",
|
|
16543
16850
|
"task_reopened",
|
|
16544
16851
|
"task_cancelled",
|
|
@@ -16546,77 +16853,77 @@ var completionContextPackSchema = z23.object({
|
|
|
16546
16853
|
"task_reparented",
|
|
16547
16854
|
"ac_projection_rebuilt"
|
|
16548
16855
|
]),
|
|
16549
|
-
taskId:
|
|
16550
|
-
relation:
|
|
16551
|
-
actor:
|
|
16552
|
-
details:
|
|
16553
|
-
before:
|
|
16554
|
-
after:
|
|
16856
|
+
taskId: z24.string().min(1),
|
|
16857
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
16858
|
+
actor: z24.string().min(1),
|
|
16859
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
16860
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
16861
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
16555
16862
|
})
|
|
16556
16863
|
),
|
|
16557
|
-
summary:
|
|
16558
|
-
totalEvents:
|
|
16559
|
-
byAction:
|
|
16560
|
-
byRelation:
|
|
16561
|
-
latestEventAt:
|
|
16864
|
+
summary: z24.object({
|
|
16865
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
16866
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
16867
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
16868
|
+
latestEventAt: z24.string().nullable()
|
|
16562
16869
|
})
|
|
16563
16870
|
});
|
|
16564
|
-
var completionEvaluationSchema =
|
|
16565
|
-
taskId:
|
|
16871
|
+
var completionEvaluationSchema = z24.object({
|
|
16872
|
+
taskId: z24.string().min(1),
|
|
16566
16873
|
taskStatus: completionTaskStatusSchema,
|
|
16567
|
-
ready:
|
|
16568
|
-
stale:
|
|
16569
|
-
staleReasons:
|
|
16874
|
+
ready: z24.boolean(),
|
|
16875
|
+
stale: z24.boolean(),
|
|
16876
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
16570
16877
|
contextPack: completionContextPackSchema.optional(),
|
|
16571
|
-
satisfied:
|
|
16572
|
-
unsatisfied:
|
|
16573
|
-
waived:
|
|
16574
|
-
replaced:
|
|
16878
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
16879
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
16880
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
16881
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
16575
16882
|
totals: completionTotalsSchema
|
|
16576
16883
|
});
|
|
16577
|
-
var completionExplanationSchema =
|
|
16578
|
-
taskId:
|
|
16579
|
-
ready:
|
|
16580
|
-
stale:
|
|
16581
|
-
summary:
|
|
16884
|
+
var completionExplanationSchema = z24.object({
|
|
16885
|
+
taskId: z24.string().min(1),
|
|
16886
|
+
ready: z24.boolean(),
|
|
16887
|
+
stale: z24.boolean(),
|
|
16888
|
+
summary: z24.string(),
|
|
16582
16889
|
contextPack: completionContextPackSchema.optional(),
|
|
16583
|
-
blockers:
|
|
16890
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
16584
16891
|
});
|
|
16585
|
-
var completionListParamsSchema =
|
|
16586
|
-
taskId:
|
|
16892
|
+
var completionListParamsSchema = z24.object({
|
|
16893
|
+
taskId: z24.string().min(1),
|
|
16587
16894
|
status: completionCriterionStatusSchema.optional(),
|
|
16588
16895
|
kind: completionCriterionKindSchema.optional()
|
|
16589
16896
|
});
|
|
16590
|
-
var completionListResultSchema =
|
|
16591
|
-
taskId:
|
|
16592
|
-
criteria:
|
|
16897
|
+
var completionListResultSchema = z24.object({
|
|
16898
|
+
taskId: z24.string().min(1),
|
|
16899
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
16593
16900
|
totals: completionTotalsSchema
|
|
16594
16901
|
});
|
|
16595
|
-
var completionEvaluateParamsSchema =
|
|
16596
|
-
taskId:
|
|
16597
|
-
includeContext:
|
|
16598
|
-
limit:
|
|
16599
|
-
since:
|
|
16600
|
-
relationDepth:
|
|
16902
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
16903
|
+
taskId: z24.string().min(1),
|
|
16904
|
+
includeContext: z24.boolean().optional(),
|
|
16905
|
+
limit: z24.number().int().positive().optional(),
|
|
16906
|
+
since: z24.string().min(1).optional(),
|
|
16907
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
16601
16908
|
});
|
|
16602
|
-
var completionProjectionRepairErrorSchema =
|
|
16909
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
16603
16910
|
code: completionProjectionRepairErrorCodeSchema,
|
|
16604
|
-
message:
|
|
16605
|
-
taskId:
|
|
16606
|
-
acId:
|
|
16607
|
-
evidenceAtomId:
|
|
16911
|
+
message: z24.string().min(1),
|
|
16912
|
+
taskId: z24.string().min(1),
|
|
16913
|
+
acId: z24.string().min(1).optional(),
|
|
16914
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
16608
16915
|
});
|
|
16609
|
-
var completionProjectionRepairParamsSchema =
|
|
16610
|
-
taskId:
|
|
16611
|
-
dryRun:
|
|
16916
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
16917
|
+
taskId: z24.string().min(1),
|
|
16918
|
+
dryRun: z24.boolean().optional()
|
|
16612
16919
|
});
|
|
16613
|
-
var completionProjectionRepairResultSchema =
|
|
16614
|
-
taskId:
|
|
16615
|
-
repaired:
|
|
16616
|
-
dryRun:
|
|
16617
|
-
staleBefore:
|
|
16618
|
-
staleAfter:
|
|
16619
|
-
errors:
|
|
16920
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
16921
|
+
taskId: z24.string().min(1),
|
|
16922
|
+
repaired: z24.boolean(),
|
|
16923
|
+
dryRun: z24.boolean(),
|
|
16924
|
+
staleBefore: z24.boolean(),
|
|
16925
|
+
staleAfter: z24.boolean(),
|
|
16926
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
16620
16927
|
});
|
|
16621
16928
|
|
|
16622
16929
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -17119,7 +17426,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
17119
17426
|
};
|
|
17120
17427
|
|
|
17121
17428
|
// packages/contracts/src/templates/manifest.ts
|
|
17122
|
-
import { z as
|
|
17429
|
+
import { z as z25 } from "zod";
|
|
17123
17430
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
17124
17431
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
17125
17432
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -17136,79 +17443,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
17136
17443
|
"tool-resolver",
|
|
17137
17444
|
"literal"
|
|
17138
17445
|
];
|
|
17139
|
-
var PlaceholderSpecSchema =
|
|
17446
|
+
var PlaceholderSpecSchema = z25.object({
|
|
17140
17447
|
/**
|
|
17141
17448
|
* Placeholder identifier as it appears in the template body
|
|
17142
17449
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
17143
17450
|
*/
|
|
17144
|
-
name:
|
|
17451
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
17145
17452
|
/** Resolver source the installer consults for this placeholder. */
|
|
17146
|
-
source:
|
|
17453
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
17147
17454
|
/**
|
|
17148
17455
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
17149
17456
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
17150
17457
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
17151
17458
|
*/
|
|
17152
|
-
sourcePath:
|
|
17459
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
17153
17460
|
/**
|
|
17154
17461
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
17155
17462
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
17156
17463
|
*/
|
|
17157
|
-
defaultValue:
|
|
17464
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
17158
17465
|
});
|
|
17159
|
-
var TemplateManifestEntrySchema =
|
|
17466
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
17160
17467
|
/** Stable identifier for this template entry. */
|
|
17161
|
-
id:
|
|
17468
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
17162
17469
|
/** Category of file this template represents. */
|
|
17163
|
-
kind:
|
|
17470
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
17164
17471
|
/** Repo-relative path of the template source file. */
|
|
17165
|
-
sourcePath:
|
|
17472
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
17166
17473
|
/** Project-relative path where the rendered template installs. */
|
|
17167
|
-
installPath:
|
|
17474
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
17168
17475
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
17169
|
-
substitution:
|
|
17476
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
17170
17477
|
/** Declared placeholders this template requires. May be empty. */
|
|
17171
|
-
placeholders:
|
|
17478
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
17172
17479
|
/** Reconciliation policy on upgrade. */
|
|
17173
|
-
updateStrategy:
|
|
17480
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
17174
17481
|
});
|
|
17175
17482
|
|
|
17176
17483
|
// packages/contracts/src/validator/index.ts
|
|
17177
|
-
import { z as
|
|
17484
|
+
import { z as z26 } from "zod";
|
|
17178
17485
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
17179
|
-
var validatorFindingSchema =
|
|
17180
|
-
acId:
|
|
17181
|
-
status:
|
|
17182
|
-
reasoning:
|
|
17183
|
-
evidenceRefs:
|
|
17184
|
-
checkedAt:
|
|
17486
|
+
var validatorFindingSchema = z26.object({
|
|
17487
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
17488
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
17489
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
17490
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
17491
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
17185
17492
|
});
|
|
17186
|
-
var validatorAttestationSchema =
|
|
17187
|
-
verdict:
|
|
17188
|
-
taskId:
|
|
17189
|
-
validatorId:
|
|
17190
|
-
findings:
|
|
17493
|
+
var validatorAttestationSchema = z26.object({
|
|
17494
|
+
verdict: z26.literal("attest"),
|
|
17495
|
+
taskId: z26.string().min(1),
|
|
17496
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17497
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
17191
17498
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
17192
17499
|
'attestation requires every finding to have status="pass"'
|
|
17193
17500
|
),
|
|
17194
|
-
summary:
|
|
17195
|
-
attestedAt:
|
|
17196
|
-
schemaVersion:
|
|
17501
|
+
summary: z26.string().optional(),
|
|
17502
|
+
attestedAt: z26.string().min(1),
|
|
17503
|
+
schemaVersion: z26.literal("1")
|
|
17197
17504
|
});
|
|
17198
|
-
var validatorRejectionSchema =
|
|
17199
|
-
verdict:
|
|
17200
|
-
taskId:
|
|
17201
|
-
validatorId:
|
|
17202
|
-
findings:
|
|
17505
|
+
var validatorRejectionSchema = z26.object({
|
|
17506
|
+
verdict: z26.literal("reject"),
|
|
17507
|
+
taskId: z26.string().min(1),
|
|
17508
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17509
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
17203
17510
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
17204
17511
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
17205
17512
|
),
|
|
17206
|
-
summary:
|
|
17207
|
-
remediationHints:
|
|
17208
|
-
rejectedAt:
|
|
17209
|
-
schemaVersion:
|
|
17513
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
17514
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
17515
|
+
rejectedAt: z26.string().min(1),
|
|
17516
|
+
schemaVersion: z26.literal("1")
|
|
17210
17517
|
});
|
|
17211
|
-
var validatorVerdictSchema =
|
|
17518
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
17212
17519
|
validatorAttestationSchema,
|
|
17213
17520
|
validatorRejectionSchema
|
|
17214
17521
|
]);
|
|
@@ -17958,7 +18265,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
17958
18265
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
17959
18266
|
|
|
17960
18267
|
// packages/contracts/src/decide.ts
|
|
17961
|
-
import { z as
|
|
18268
|
+
import { z as z27 } from "zod";
|
|
17962
18269
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
17963
18270
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
17964
18271
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -17980,11 +18287,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
17980
18287
|
maxScoreLevels: 10
|
|
17981
18288
|
};
|
|
17982
18289
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
17983
|
-
var decisionQuestionTypeSchema =
|
|
17984
|
-
var decisionOutcomeSourceSchema =
|
|
17985
|
-
var decisionInstructionsSchema =
|
|
17986
|
-
var unitIntervalSchema =
|
|
17987
|
-
var decisionStateSchema =
|
|
18290
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
18291
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
18292
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
18293
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
18294
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
17988
18295
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
17989
18296
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
17990
18297
|
context.addIssue({
|
|
@@ -17993,34 +18300,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
17993
18300
|
});
|
|
17994
18301
|
}
|
|
17995
18302
|
});
|
|
17996
|
-
var noulDecisionQuestionSchema =
|
|
17997
|
-
type:
|
|
18303
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
18304
|
+
type: z27.literal("noul"),
|
|
17998
18305
|
instructions: decisionInstructionsSchema.optional(),
|
|
17999
|
-
criteria:
|
|
18306
|
+
criteria: z27.string().min(1)
|
|
18000
18307
|
});
|
|
18001
|
-
var choiceDecisionQuestionSchema =
|
|
18002
|
-
type:
|
|
18308
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
18309
|
+
type: z27.literal("choice"),
|
|
18003
18310
|
instructions: decisionInstructionsSchema.optional(),
|
|
18004
|
-
criteria:
|
|
18311
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
18005
18312
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
18006
18313
|
})
|
|
18007
18314
|
});
|
|
18008
|
-
var scoreDecisionQuestionSchema =
|
|
18009
|
-
type:
|
|
18315
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
18316
|
+
type: z27.literal("score"),
|
|
18010
18317
|
instructions: decisionInstructionsSchema.optional(),
|
|
18011
|
-
criteria:
|
|
18318
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
18012
18319
|
});
|
|
18013
|
-
var decisionQuestionSchema =
|
|
18320
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
18014
18321
|
noulDecisionQuestionSchema,
|
|
18015
18322
|
choiceDecisionQuestionSchema,
|
|
18016
18323
|
scoreDecisionQuestionSchema
|
|
18017
18324
|
]);
|
|
18018
|
-
var decisionRequestSchema =
|
|
18019
|
-
model:
|
|
18020
|
-
lang:
|
|
18021
|
-
cache:
|
|
18325
|
+
var decisionRequestSchema = z27.object({
|
|
18326
|
+
model: z27.string().min(1).optional(),
|
|
18327
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
18328
|
+
cache: z27.boolean().optional(),
|
|
18022
18329
|
state: decisionStateSchema,
|
|
18023
|
-
questions:
|
|
18330
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
18024
18331
|
(questions) => {
|
|
18025
18332
|
const count = Object.keys(questions).length;
|
|
18026
18333
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -18030,139 +18337,139 @@ var decisionRequestSchema = z26.object({
|
|
|
18030
18337
|
}
|
|
18031
18338
|
)
|
|
18032
18339
|
});
|
|
18033
|
-
var noulDecisionAnswerSchema =
|
|
18034
|
-
type:
|
|
18035
|
-
value:
|
|
18340
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
18341
|
+
type: z27.literal("noul"),
|
|
18342
|
+
value: z27.boolean(),
|
|
18036
18343
|
probability: unitIntervalSchema,
|
|
18037
18344
|
confidence: unitIntervalSchema
|
|
18038
18345
|
});
|
|
18039
|
-
var choiceDecisionAnswerSchema =
|
|
18040
|
-
type:
|
|
18041
|
-
value:
|
|
18042
|
-
probabilities:
|
|
18346
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
18347
|
+
type: z27.literal("choice"),
|
|
18348
|
+
value: z27.string().min(1),
|
|
18349
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
18043
18350
|
confidence: unitIntervalSchema
|
|
18044
18351
|
});
|
|
18045
|
-
var scoreDecisionAnswerSchema =
|
|
18046
|
-
type:
|
|
18047
|
-
value:
|
|
18048
|
-
probabilities:
|
|
18352
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
18353
|
+
type: z27.literal("score"),
|
|
18354
|
+
value: z27.number().int().nonnegative(),
|
|
18355
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
18049
18356
|
confidence: unitIntervalSchema
|
|
18050
18357
|
});
|
|
18051
|
-
var decisionAnswerSchema =
|
|
18358
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
18052
18359
|
noulDecisionAnswerSchema,
|
|
18053
18360
|
choiceDecisionAnswerSchema,
|
|
18054
18361
|
scoreDecisionAnswerSchema
|
|
18055
18362
|
]);
|
|
18056
|
-
var decisionOutcomeSchema =
|
|
18057
|
-
answers:
|
|
18363
|
+
var decisionOutcomeSchema = z27.object({
|
|
18364
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
18058
18365
|
source: decisionOutcomeSourceSchema,
|
|
18059
|
-
requestId:
|
|
18060
|
-
latencyMs:
|
|
18061
|
-
costUsd:
|
|
18062
|
-
costMicros:
|
|
18063
|
-
balanceMicros:
|
|
18064
|
-
checkpoint:
|
|
18065
|
-
inputTokens:
|
|
18366
|
+
requestId: z27.string().min(1).optional(),
|
|
18367
|
+
latencyMs: z27.number().nonnegative(),
|
|
18368
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
18369
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
18370
|
+
balanceMicros: z27.number().int().optional(),
|
|
18371
|
+
checkpoint: z27.string().min(1).optional(),
|
|
18372
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
18066
18373
|
});
|
|
18067
|
-
var decisionProviderKindSchema =
|
|
18068
|
-
var decisionProviderConfigSchema =
|
|
18069
|
-
baseUrl:
|
|
18374
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
18375
|
+
var decisionProviderConfigSchema = z27.object({
|
|
18376
|
+
baseUrl: z27.url(),
|
|
18070
18377
|
provider: decisionProviderKindSchema.optional()
|
|
18071
18378
|
});
|
|
18072
18379
|
|
|
18073
18380
|
// packages/contracts/src/nexus-account.ts
|
|
18074
|
-
import { z as
|
|
18075
|
-
var nexusAccountUserSchema =
|
|
18076
|
-
id:
|
|
18077
|
-
email:
|
|
18078
|
-
name:
|
|
18381
|
+
import { z as z28 } from "zod";
|
|
18382
|
+
var nexusAccountUserSchema = z28.object({
|
|
18383
|
+
id: z28.string(),
|
|
18384
|
+
email: z28.string(),
|
|
18385
|
+
name: z28.string().nullable().optional()
|
|
18079
18386
|
});
|
|
18080
|
-
var nexusAccountOrganizationSchema =
|
|
18081
|
-
id:
|
|
18082
|
-
name:
|
|
18083
|
-
slug:
|
|
18084
|
-
role:
|
|
18387
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
18388
|
+
id: z28.string(),
|
|
18389
|
+
name: z28.string(),
|
|
18390
|
+
slug: z28.string().nullable().optional(),
|
|
18391
|
+
role: z28.string().optional(),
|
|
18085
18392
|
/** `true` for the personal organization created at sign-up. */
|
|
18086
|
-
personal:
|
|
18393
|
+
personal: z28.boolean().optional()
|
|
18087
18394
|
});
|
|
18088
|
-
var nexusAccountMeSchema =
|
|
18395
|
+
var nexusAccountMeSchema = z28.object({
|
|
18089
18396
|
user: nexusAccountUserSchema,
|
|
18090
|
-
organizations:
|
|
18397
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
18091
18398
|
});
|
|
18092
18399
|
|
|
18093
18400
|
// packages/contracts/src/nexus-cloud.ts
|
|
18094
|
-
import { z as
|
|
18401
|
+
import { z as z29 } from "zod";
|
|
18095
18402
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
18096
18403
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
18097
18404
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
18098
|
-
var isoTime =
|
|
18099
|
-
var profile =
|
|
18100
|
-
var deviceState =
|
|
18101
|
-
var nexusCloudCredentialSchema =
|
|
18102
|
-
kind:
|
|
18103
|
-
credentialId:
|
|
18405
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
18406
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
18407
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
18408
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
18409
|
+
kind: z29.enum(["device", "session"]),
|
|
18410
|
+
credentialId: z29.string().nullable().optional(),
|
|
18104
18411
|
profile: profile.optional(),
|
|
18105
|
-
scopes:
|
|
18412
|
+
scopes: z29.array(z29.string()).default([]),
|
|
18106
18413
|
createdAt: isoTime.nullable().optional(),
|
|
18107
18414
|
lastUsedAt: isoTime.nullable().optional(),
|
|
18108
18415
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
18109
18416
|
idleExpiresAt: isoTime.nullable().optional()
|
|
18110
18417
|
});
|
|
18111
|
-
var nexusCloudDeviceSchema =
|
|
18112
|
-
deviceId:
|
|
18113
|
-
name:
|
|
18114
|
-
platform:
|
|
18115
|
-
arch:
|
|
18116
|
-
cliVersion:
|
|
18418
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
18419
|
+
deviceId: z29.string(),
|
|
18420
|
+
name: z29.string(),
|
|
18421
|
+
platform: z29.string().optional(),
|
|
18422
|
+
arch: z29.string().nullable().optional(),
|
|
18423
|
+
cliVersion: z29.string().nullable().optional(),
|
|
18117
18424
|
createdAt: isoTime.optional(),
|
|
18118
18425
|
lastSeenAt: isoTime.nullable().optional(),
|
|
18119
18426
|
state: deviceState,
|
|
18120
18427
|
signedOutAt: isoTime.nullable().optional(),
|
|
18121
18428
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
18122
|
-
certificate:
|
|
18429
|
+
certificate: z29.string().nullable().optional(),
|
|
18123
18430
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
18124
18431
|
profile: profile.optional(),
|
|
18125
18432
|
/** True for the device whose credential made this request. */
|
|
18126
|
-
current:
|
|
18127
|
-
projects:
|
|
18128
|
-
replicas:
|
|
18433
|
+
current: z29.boolean().default(false),
|
|
18434
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
18435
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
18129
18436
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18130
18437
|
lastPresenceAt: isoTime.nullable().optional()
|
|
18131
18438
|
});
|
|
18132
|
-
var nexusCloudOrganizationSchema =
|
|
18133
|
-
id:
|
|
18134
|
-
name:
|
|
18135
|
-
slug:
|
|
18136
|
-
role:
|
|
18137
|
-
personal:
|
|
18439
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
18440
|
+
id: z29.string(),
|
|
18441
|
+
name: z29.string(),
|
|
18442
|
+
slug: z29.string().nullable().optional(),
|
|
18443
|
+
role: z29.string().optional(),
|
|
18444
|
+
personal: z29.boolean().optional()
|
|
18138
18445
|
});
|
|
18139
|
-
var nexusCloudUserSchema =
|
|
18140
|
-
id:
|
|
18141
|
-
email:
|
|
18142
|
-
name:
|
|
18446
|
+
var nexusCloudUserSchema = z29.object({
|
|
18447
|
+
id: z29.string(),
|
|
18448
|
+
email: z29.string(),
|
|
18449
|
+
name: z29.string().nullable().optional()
|
|
18143
18450
|
});
|
|
18144
|
-
var nexusCloudWhoamiSchema =
|
|
18451
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
18145
18452
|
serverTime: isoTime.optional(),
|
|
18146
18453
|
user: nexusCloudUserSchema,
|
|
18147
|
-
organizations:
|
|
18454
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
18148
18455
|
credential: nexusCloudCredentialSchema,
|
|
18149
18456
|
/** The calling device; null for a session caller. */
|
|
18150
18457
|
device: nexusCloudDeviceSchema.nullable()
|
|
18151
18458
|
});
|
|
18152
|
-
var nexusCloudDevicePageSchema =
|
|
18153
|
-
devices:
|
|
18154
|
-
nextCursor:
|
|
18155
|
-
truncated:
|
|
18459
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
18460
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
18461
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18462
|
+
truncated: z29.boolean().default(false)
|
|
18156
18463
|
});
|
|
18157
|
-
var nexusCloudPresenceSchema =
|
|
18464
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
18158
18465
|
observedAt: isoTime.optional(),
|
|
18159
|
-
sync:
|
|
18466
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
18160
18467
|
});
|
|
18161
|
-
var nexusCloudReplicaSchema =
|
|
18162
|
-
projectId:
|
|
18163
|
-
replicaId:
|
|
18164
|
-
deviceId:
|
|
18165
|
-
deviceName:
|
|
18468
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
18469
|
+
projectId: z29.string(),
|
|
18470
|
+
replicaId: z29.string(),
|
|
18471
|
+
deviceId: z29.string(),
|
|
18472
|
+
deviceName: z29.string(),
|
|
18166
18473
|
deviceState: deviceState.optional(),
|
|
18167
18474
|
attachedAt: isoTime.optional(),
|
|
18168
18475
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -18171,72 +18478,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
18171
18478
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
18172
18479
|
retiredAt: isoTime.nullable().optional(),
|
|
18173
18480
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
18174
|
-
successor:
|
|
18481
|
+
successor: z29.string().nullable().optional()
|
|
18175
18482
|
});
|
|
18176
|
-
var nexusCloudDeviceCountsSchema =
|
|
18177
|
-
active:
|
|
18178
|
-
total:
|
|
18483
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
18484
|
+
active: z29.number().int().nonnegative(),
|
|
18485
|
+
total: z29.number().int().nonnegative()
|
|
18179
18486
|
});
|
|
18180
18487
|
var projectFields = {
|
|
18181
|
-
projectId:
|
|
18182
|
-
label:
|
|
18183
|
-
organizationId:
|
|
18184
|
-
organizationName:
|
|
18185
|
-
remoteUrl:
|
|
18488
|
+
projectId: z29.string(),
|
|
18489
|
+
label: z29.string().nullable(),
|
|
18490
|
+
organizationId: z29.string(),
|
|
18491
|
+
organizationName: z29.string().optional(),
|
|
18492
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
18186
18493
|
createdAt: isoTime.optional()
|
|
18187
18494
|
};
|
|
18188
|
-
var nexusCloudProjectListItemSchema =
|
|
18495
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
18189
18496
|
...projectFields,
|
|
18190
|
-
role:
|
|
18497
|
+
role: z29.string(),
|
|
18191
18498
|
/**
|
|
18192
18499
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
18193
18500
|
* only a holder of the account key can open it (T13102).
|
|
18194
18501
|
*/
|
|
18195
|
-
encryptedName:
|
|
18196
|
-
streamId:
|
|
18197
|
-
headSeq:
|
|
18502
|
+
encryptedName: z29.string().nullable().optional(),
|
|
18503
|
+
streamId: z29.string().optional(),
|
|
18504
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
18198
18505
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
18199
|
-
headCheckpointId:
|
|
18200
|
-
openConflicts:
|
|
18201
|
-
replicas:
|
|
18506
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
18507
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
18508
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
18202
18509
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18203
|
-
replicaCount:
|
|
18510
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18204
18511
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18205
18512
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
18206
18513
|
/** This project's replica list was cut at 50 (T12858). */
|
|
18207
|
-
replicasTruncated:
|
|
18514
|
+
replicasTruncated: z29.boolean().default(false)
|
|
18208
18515
|
});
|
|
18209
|
-
var nexusCloudProjectPageSchema =
|
|
18210
|
-
projects:
|
|
18211
|
-
nextCursor:
|
|
18516
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
18517
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
18518
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18212
18519
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
18213
|
-
truncated:
|
|
18520
|
+
truncated: z29.boolean().default(false),
|
|
18214
18521
|
/** The project list itself was cut at 1000 (T12858). */
|
|
18215
|
-
projectsTruncated:
|
|
18522
|
+
projectsTruncated: z29.boolean().default(false)
|
|
18216
18523
|
});
|
|
18217
|
-
var nexusCloudProjectDetailSchema =
|
|
18218
|
-
project:
|
|
18219
|
-
role:
|
|
18220
|
-
canTrash:
|
|
18221
|
-
openConflicts:
|
|
18524
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
18525
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
18526
|
+
role: z29.string(),
|
|
18527
|
+
canTrash: z29.boolean().optional(),
|
|
18528
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18222
18529
|
/** At most 50, oldest attachment first. */
|
|
18223
|
-
replicas:
|
|
18530
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18224
18531
|
devices: nexusCloudDeviceCountsSchema,
|
|
18225
|
-
replicaCount:
|
|
18532
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18226
18533
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18227
18534
|
/** `replicas` was cut at 50. */
|
|
18228
|
-
truncated:
|
|
18229
|
-
stream:
|
|
18230
|
-
streamId:
|
|
18231
|
-
headSeq:
|
|
18232
|
-
headCheckpointId:
|
|
18535
|
+
truncated: z29.boolean().default(false),
|
|
18536
|
+
stream: z29.object({
|
|
18537
|
+
streamId: z29.string(),
|
|
18538
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18539
|
+
headCheckpointId: z29.string().nullable()
|
|
18233
18540
|
}).nullable()
|
|
18234
18541
|
});
|
|
18235
|
-
var nexusCloudReplicaPageSchema =
|
|
18236
|
-
replicas:
|
|
18542
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
18543
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18237
18544
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18238
|
-
nextCursor:
|
|
18239
|
-
truncated:
|
|
18545
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18546
|
+
truncated: z29.boolean().default(false)
|
|
18240
18547
|
});
|
|
18241
18548
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
18242
18549
|
"credential.valid",
|
|
@@ -18252,56 +18559,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
18252
18559
|
];
|
|
18253
18560
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
18254
18561
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
18255
|
-
var knownCheckId =
|
|
18256
|
-
var nexusCloudStatusCheckSchema =
|
|
18257
|
-
id:
|
|
18258
|
-
ok:
|
|
18259
|
-
required:
|
|
18260
|
-
detail:
|
|
18562
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
18563
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
18564
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
18565
|
+
ok: z29.boolean(),
|
|
18566
|
+
required: z29.boolean(),
|
|
18567
|
+
detail: z29.string()
|
|
18261
18568
|
});
|
|
18262
|
-
var nexusCloudStatusSchema =
|
|
18569
|
+
var nexusCloudStatusSchema = z29.object({
|
|
18263
18570
|
serverTime: isoTime.optional(),
|
|
18264
|
-
apiVersion:
|
|
18571
|
+
apiVersion: z29.string().optional(),
|
|
18265
18572
|
/**
|
|
18266
18573
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
18267
18574
|
* than the list, which therefore support none of them.
|
|
18268
18575
|
*/
|
|
18269
|
-
features:
|
|
18576
|
+
features: z29.array(z29.string()).optional(),
|
|
18270
18577
|
user: nexusCloudUserSchema,
|
|
18271
18578
|
credential: nexusCloudCredentialSchema,
|
|
18272
18579
|
device: nexusCloudDeviceSchema.nullable(),
|
|
18273
|
-
project:
|
|
18274
|
-
projectId:
|
|
18275
|
-
registered:
|
|
18276
|
-
organizationId:
|
|
18277
|
-
organizationName:
|
|
18278
|
-
role:
|
|
18580
|
+
project: z29.object({
|
|
18581
|
+
projectId: z29.string(),
|
|
18582
|
+
registered: z29.boolean(),
|
|
18583
|
+
organizationId: z29.string().nullable(),
|
|
18584
|
+
organizationName: z29.string().nullable(),
|
|
18585
|
+
role: z29.string().nullable()
|
|
18279
18586
|
}).nullable(),
|
|
18280
|
-
replica:
|
|
18281
|
-
replicaId:
|
|
18282
|
-
attached:
|
|
18283
|
-
attachedElsewhere:
|
|
18587
|
+
replica: z29.object({
|
|
18588
|
+
replicaId: z29.string(),
|
|
18589
|
+
attached: z29.boolean(),
|
|
18590
|
+
attachedElsewhere: z29.boolean(),
|
|
18284
18591
|
attachedAt: isoTime.nullable(),
|
|
18285
18592
|
lastSyncAt: isoTime.nullable(),
|
|
18286
18593
|
presenceAt: isoTime.nullable(),
|
|
18287
|
-
lastReplicaSeq:
|
|
18594
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
18288
18595
|
}).nullable(),
|
|
18289
|
-
stream:
|
|
18290
|
-
streamId:
|
|
18291
|
-
headSeq:
|
|
18292
|
-
headCheckpointId:
|
|
18293
|
-
openConflicts:
|
|
18596
|
+
stream: z29.object({
|
|
18597
|
+
streamId: z29.string(),
|
|
18598
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18599
|
+
headCheckpointId: z29.string().nullable(),
|
|
18600
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18294
18601
|
devices: nexusCloudDeviceCountsSchema
|
|
18295
18602
|
}).nullable(),
|
|
18296
18603
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
18297
|
-
checks:
|
|
18604
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
18298
18605
|
(list) => list.flatMap((c) => {
|
|
18299
18606
|
const id = knownCheckId.safeParse(c.id);
|
|
18300
18607
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
18301
18608
|
})
|
|
18302
18609
|
),
|
|
18303
18610
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
18304
|
-
verdict:
|
|
18611
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
18305
18612
|
});
|
|
18306
18613
|
var LOGIN = "run `cleo login nexus`";
|
|
18307
18614
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -18346,50 +18653,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
18346
18653
|
};
|
|
18347
18654
|
|
|
18348
18655
|
// packages/contracts/src/nexus-vault.ts
|
|
18349
|
-
import { z as
|
|
18350
|
-
var isoTime2 =
|
|
18351
|
-
var uuid =
|
|
18352
|
-
var nexusUserKeysSchema =
|
|
18353
|
-
keyVersion:
|
|
18354
|
-
masterKeyVerifier:
|
|
18656
|
+
import { z as z30 } from "zod";
|
|
18657
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
18658
|
+
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);
|
|
18659
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
18660
|
+
keyVersion: z30.number().int().positive(),
|
|
18661
|
+
masterKeyVerifier: z30.string()
|
|
18355
18662
|
});
|
|
18356
|
-
var nexusProjectKeysSchema =
|
|
18357
|
-
keys:
|
|
18358
|
-
|
|
18663
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
18664
|
+
keys: z30.array(
|
|
18665
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
18359
18666
|
)
|
|
18360
18667
|
});
|
|
18361
|
-
var nexusLeaseSchema =
|
|
18362
|
-
streamId:
|
|
18363
|
-
role:
|
|
18668
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
18669
|
+
streamId: z30.string(),
|
|
18670
|
+
role: z30.string(),
|
|
18364
18671
|
replicaId: uuid,
|
|
18365
18672
|
expiresAt: isoTime2,
|
|
18366
18673
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
18367
18674
|
});
|
|
18368
|
-
var nexusLeaseAcquireSchema =
|
|
18369
|
-
var nexusStreamHeadSchema =
|
|
18370
|
-
streamId:
|
|
18371
|
-
kind:
|
|
18372
|
-
headSeq:
|
|
18373
|
-
headCheckpointId:
|
|
18675
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
18676
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
18677
|
+
streamId: z30.string(),
|
|
18678
|
+
kind: z30.string().optional(),
|
|
18679
|
+
headSeq: z30.number().int().nonnegative(),
|
|
18680
|
+
headCheckpointId: z30.string().nullable(),
|
|
18374
18681
|
/**
|
|
18375
18682
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
18376
18683
|
* Absent from an older server.
|
|
18377
18684
|
*/
|
|
18378
|
-
maxSchemaVersion:
|
|
18685
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
18379
18686
|
});
|
|
18380
|
-
var nexusActivityEventSchema =
|
|
18381
|
-
id:
|
|
18687
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
18688
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
18382
18689
|
at: isoTime2,
|
|
18383
|
-
actorUserId:
|
|
18384
|
-
actorDeviceId:
|
|
18385
|
-
requestId:
|
|
18386
|
-
action:
|
|
18387
|
-
target:
|
|
18388
|
-
detail:
|
|
18690
|
+
actorUserId: z30.string().nullable().optional(),
|
|
18691
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
18692
|
+
requestId: z30.string().nullable().optional(),
|
|
18693
|
+
action: z30.string(),
|
|
18694
|
+
target: z30.string().nullable().optional(),
|
|
18695
|
+
detail: z30.unknown().optional()
|
|
18389
18696
|
});
|
|
18390
|
-
var nexusActivityPageSchema =
|
|
18391
|
-
events:
|
|
18392
|
-
nextBefore:
|
|
18697
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
18698
|
+
events: z30.array(nexusActivityEventSchema),
|
|
18699
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
18393
18700
|
});
|
|
18394
18701
|
|
|
18395
18702
|
// packages/adapters/src/providers/gemini-cli/spawn.ts
|