@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.
Files changed (37) hide show
  1. package/dist/.source-stamp.json +1 -1
  2. package/dist/index.js +1691 -1354
  3. package/dist/index.js.map +3 -3
  4. package/dist/orca-execution.d.ts +90 -0
  5. package/dist/orca-execution.d.ts.map +1 -0
  6. package/dist/orca-execution.js +843 -0
  7. package/dist/orca-execution.js.map +6 -0
  8. package/dist/providers/claude-code/index.js +1689 -1357
  9. package/dist/providers/claude-code/index.js.map +3 -3
  10. package/dist/providers/claude-code/lead-session.d.ts +8 -5
  11. package/dist/providers/claude-code/lead-session.d.ts.map +1 -1
  12. package/dist/providers/claude-sdk/index.js +1674 -1352
  13. package/dist/providers/claude-sdk/index.js.map +3 -3
  14. package/dist/providers/claude-sdk/spawn.d.ts.map +1 -1
  15. package/dist/providers/codex/index.js +1540 -1233
  16. package/dist/providers/codex/index.js.map +3 -3
  17. package/dist/providers/gemini-cli/index.js +1540 -1233
  18. package/dist/providers/gemini-cli/index.js.map +3 -3
  19. package/dist/providers/kimi/index.js +1540 -1233
  20. package/dist/providers/kimi/index.js.map +3 -3
  21. package/dist/providers/openai-sdk/index.js +1660 -1353
  22. package/dist/providers/openai-sdk/index.js.map +3 -3
  23. package/dist/providers/opencode/index.js +1540 -1233
  24. package/dist/providers/opencode/index.js.map +3 -3
  25. package/dist/providers/pi/index.js +1540 -1233
  26. package/dist/providers/pi/index.js.map +3 -3
  27. package/package.json +10 -6
  28. package/src/__tests__/orca-execution-fixture.ts +422 -0
  29. package/src/__tests__/orca-execution.test.ts +1357 -0
  30. package/src/__tests__/orca-plugin-panel.test.ts +661 -0
  31. package/src/__tests__/orca-plugin.test.ts +660 -0
  32. package/src/orca-execution.ts +1193 -0
  33. package/src/providers/claude-code/__tests__/lead-mcp.test.ts +27 -2
  34. package/src/providers/claude-code/lead-session.ts +21 -8
  35. package/src/providers/claude-sdk/__tests__/spawn.test.ts +19 -0
  36. package/src/providers/claude-sdk/spawn.ts +14 -0
  37. package/src/providers/shared/__tests__/lead-tool-strip.test.ts +1 -1
@@ -1722,17 +1722,321 @@ var ChangesetEntrySchema = z3.object({
1722
1722
  });
1723
1723
 
1724
1724
  // packages/contracts/src/config/manifest.ts
1725
- import { z as z5 } from "zod";
1725
+ import { z as z6 } from "zod";
1726
1726
 
1727
- // packages/contracts/src/config/worker-policy.ts
1727
+ // packages/contracts/src/orca-execution.ts
1728
1728
  import { z as z4 } from "zod";
1729
- var projectWorkerPolicySchema = z4.object({
1730
- verification: z4.object({
1731
- full: z4.enum(["local", "ci"]),
1732
- local: z4.enum(["single-file", "affected"])
1729
+ var identifier = z4.string().min(1);
1730
+ var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
1731
+ var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
1732
+ var orchestrateOrcaConfigSchema = z4.object({
1733
+ agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
1734
+ });
1735
+ var orcaContextSchema = z4.object({
1736
+ runtimeId: identifier,
1737
+ coordinatorHandle: identifier,
1738
+ executionHostId: z4.literal("local")
1739
+ });
1740
+ var orcaRoutingRunSchema = z4.object({
1741
+ runId: identifier.nullable(),
1742
+ unconfiguredAgents: z4.array(orcaAgentSchema)
1743
+ });
1744
+ var orcaLaunchSchema = z4.object({
1745
+ projectId: identifier,
1746
+ projectRoot: identifier,
1747
+ taskId: identifier,
1748
+ instanceId: identifier,
1749
+ workerSessionId: identifier,
1750
+ agentId: identifier,
1751
+ role: z4.enum(["worker", "lead"]),
1752
+ protocol: identifier,
1753
+ worktreePath: identifier,
1754
+ worktreeBranch: identifier,
1755
+ projectHash: identifier,
1756
+ lockToken: identifier,
1757
+ prompt: identifier,
1758
+ harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
1759
+ leadMailbox: identifier.nullable(),
1760
+ model: identifier.optional(),
1761
+ effort: identifier.optional(),
1762
+ accountId: identifier.optional()
1763
+ });
1764
+ var orcaStartBindingSchema = z4.object({
1765
+ runId: identifier.nullable(),
1766
+ orcaTaskId: identifier.nullable(),
1767
+ retryOf: identifier.nullable()
1768
+ });
1769
+ var orcaAttemptSchema = z4.object({
1770
+ backend: z4.literal("orca"),
1771
+ version: z4.literal(1),
1772
+ /** Monotonic local CAS revision; repeated identical observations still serialize. */
1773
+ revision: z4.number().int().nonnegative(),
1774
+ context: orcaContextSchema,
1775
+ launch: orcaLaunchSchema,
1776
+ promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1777
+ workspaceId: identifier,
1778
+ workspaceSelector: identifier,
1779
+ state: z4.enum([
1780
+ "prepared",
1781
+ "launching",
1782
+ "ready",
1783
+ "turn_unobserved",
1784
+ "outcome_unknown",
1785
+ "stop_pending",
1786
+ "stop_unknown",
1787
+ "stopped",
1788
+ "failed",
1789
+ "circuit_broken"
1790
+ ]),
1791
+ runId: identifier.nullable(),
1792
+ orcaTaskId: identifier.nullable(),
1793
+ dispatchId: identifier.nullable(),
1794
+ retryOf: identifier.nullable(),
1795
+ /** Absent on legacy records, whose original argv cannot safely be reconstructed. */
1796
+ startBinding: orcaStartBindingSchema.optional(),
1797
+ /** UUID reserved before committing a retry; its first send and every replay use this key. */
1798
+ startRequestKey: z4.string().uuid().optional(),
1799
+ startRequestId: identifier.nullable(),
1800
+ /** UUID reserved before committing a stop; its first send and every replay use this key. */
1801
+ stopRequestKey: z4.string().uuid().optional(),
1802
+ /** Orca-issued stop request id, retained only when the stop receipt was received. */
1803
+ stopRequestId: identifier.nullable(),
1804
+ /**
1805
+ * Set when the worker-stop reply came from a runtime that proved it enumerates
1806
+ * every helper it stopped, so an omitted helper list means the worker had none.
1807
+ */
1808
+ stopHelperEvidence: z4.literal("enumerated").optional(),
1809
+ failureCount: z4.number().int().nonnegative(),
1810
+ resourceState: z4.string(),
1811
+ /** Full receipts retain effects, residual resources and recovery advice. */
1812
+ lastReceipt: z4.string().nullable(),
1813
+ lastError: z4.string().nullable(),
1814
+ /** Confirmed pre-dispatch refusal; never inferred from a process exit. */
1815
+ startRefusal: z4.literal("agent_unconfigured").optional(),
1816
+ observedAt: z4.string()
1817
+ });
1818
+ var orcaWorkerDoneSchema = z4.object({
1819
+ messageId: identifier,
1820
+ runtimeId: identifier,
1821
+ runId: identifier,
1822
+ orcaTaskId: identifier,
1823
+ dispatchId: identifier,
1824
+ senderHandle: identifier,
1825
+ outcome: z4.enum(["succeeded", "failed"]),
1826
+ body: z4.string(),
1827
+ reportPath: identifier
1828
+ });
1829
+ var orcaWorkerReportSchema = z4.object({
1830
+ event: orcaWorkerDoneSchema,
1831
+ manifestId: identifier,
1832
+ manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1833
+ reportText: z4.string().min(1).max(65536),
1834
+ reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1835
+ ingestedAt: z4.string().datetime()
1836
+ });
1837
+ var orcaReportDeliverySchema = z4.object({
1838
+ key: identifier,
1839
+ mailbox: identifier.nullable(),
1840
+ state: z4.enum(["pending", "delivered"]),
1841
+ messageId: identifier.nullable(),
1842
+ deliveredAt: z4.string().datetime().nullable(),
1843
+ lastError: z4.string().nullable()
1844
+ });
1845
+ var orcaWorkerSettlementSchema = z4.object({
1846
+ resourceRelease: z4.object({
1847
+ dispatchId: identifier,
1848
+ releasedAt: z4.string().datetime(),
1849
+ receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1850
+ receipt: identifier
1851
+ }).optional(),
1852
+ retiredAt: z4.string().datetime().optional(),
1853
+ reportDelivery: orcaReportDeliverySchema.optional()
1854
+ });
1855
+ var orcaReportMessageSchema = z4.object({
1856
+ id: identifier,
1857
+ run_id: z4.string().nullable(),
1858
+ delivery_contract: z4.string(),
1859
+ from_handle: z4.string(),
1860
+ to_handle: z4.string(),
1861
+ type: z4.string(),
1862
+ body: z4.string(),
1863
+ payload: z4.string().nullable(),
1864
+ sender_pane_key: z4.string().nullable()
1865
+ });
1866
+ var orcaReportSourceSchema = z4.object({
1867
+ ok: z4.literal(true),
1868
+ _meta: z4.object({ runtimeId: identifier }),
1869
+ result: z4.object({
1870
+ messages: z4.array(z4.json()).optional(),
1871
+ dispatch: z4.object({
1872
+ id: identifier,
1873
+ run_id: identifier,
1874
+ task_id: identifier,
1875
+ assignee_handle: identifier,
1876
+ assignee_pane_key: z4.string().nullable(),
1877
+ status: z4.string()
1878
+ }).optional()
1879
+ })
1880
+ });
1881
+ var orcaWorkerDonePayloadSchema = z4.object({
1882
+ taskId: identifier,
1883
+ dispatchId: identifier,
1884
+ outcome: z4.enum(["succeeded", "failed"]),
1885
+ reportPath: identifier
1886
+ });
1887
+ var orcaWorkerRequestSchema = z4.object({
1888
+ action: z4.enum([
1889
+ "show",
1890
+ "read",
1891
+ "recover-start",
1892
+ "recover-stop",
1893
+ "retry",
1894
+ "stop",
1895
+ "ingest-report",
1896
+ "relay-report"
1897
+ ]),
1898
+ recordId: identifier,
1899
+ cursor: identifier.optional(),
1900
+ messageId: identifier.optional()
1901
+ }).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
1902
+ message: "A source-pinned cursor is accepted only for read.",
1903
+ path: ["cursor"]
1904
+ }).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
1905
+ message: "ingest-report requires an exact message id; other actions do not accept one.",
1906
+ path: ["messageId"]
1907
+ });
1908
+ var effectSchema = z4.object({
1909
+ kind: z4.string(),
1910
+ role: z4.string().optional(),
1911
+ action: z4.string().optional(),
1912
+ id: z4.string().optional()
1913
+ });
1914
+ var selectionSchema = z4.object({
1915
+ agent: z4.string().nullable().optional(),
1916
+ model: z4.string().nullable().optional(),
1917
+ effort: z4.string().nullable().optional()
1918
+ });
1919
+ var orcaReplySchema = z4.object({
1920
+ ok: z4.boolean(),
1921
+ _meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
1922
+ error: z4.object({
1923
+ code: z4.string(),
1924
+ message: z4.string(),
1925
+ data: z4.object({
1926
+ requestId: identifier.optional(),
1927
+ orchestrationRequestId: identifier.optional(),
1928
+ dispatchId: identifier.optional()
1929
+ }).optional()
1930
+ }).optional(),
1931
+ result: z4.object({
1932
+ state: z4.string().optional(),
1933
+ requestId: identifier.optional(),
1934
+ /**
1935
+ * Mutation ledger identity Orca stamps on every successful mutation result.
1936
+ * @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
1937
+ * result it records (`Jy` in the retained source), so a successful stop can
1938
+ * be bound to the request key this attempt issued.
1939
+ */
1940
+ mutation: z4.object({
1941
+ requestId: identifier.optional(),
1942
+ replayed: z4.boolean().optional()
1943
+ }).optional(),
1944
+ stage: z4.string().optional(),
1945
+ turnStart: z4.string().optional(),
1946
+ runId: identifier.optional(),
1947
+ run: z4.object({ id: identifier }).nullable().optional(),
1948
+ taskId: identifier.optional(),
1949
+ dispatchId: identifier.optional(),
1950
+ failureCount: z4.number().int().nonnegative().optional(),
1951
+ effects: z4.array(effectSchema).optional(),
1952
+ residualResources: z4.array(effectSchema).optional(),
1953
+ launch: z4.object({ effective: selectionSchema.optional() }).optional(),
1954
+ lastError: z4.string().nullable().optional(),
1955
+ processAction: z4.string().optional(),
1956
+ helpers: z4.array(
1957
+ z4.object({
1958
+ dispatchId: identifier.optional(),
1959
+ creatorDispatchId: identifier.optional(),
1960
+ outcome: z4.string(),
1961
+ keptOpenBy: identifier.optional(),
1962
+ state: z4.string().optional(),
1963
+ lastError: z4.string().nullable().optional()
1964
+ })
1965
+ ).optional(),
1966
+ helperStopError: z4.string().nullable().optional(),
1967
+ status: z4.string().optional(),
1968
+ terminal: z4.object({
1969
+ handle: identifier,
1970
+ connected: z4.boolean(),
1971
+ writable: z4.boolean(),
1972
+ executionHostId: identifier
1973
+ }).optional(),
1974
+ runtime: z4.object({
1975
+ runtimeId: identifier,
1976
+ reachable: z4.boolean(),
1977
+ state: z4.string(),
1978
+ capabilities: z4.array(z4.string())
1979
+ }).optional(),
1980
+ worktree: z4.object({
1981
+ id: identifier,
1982
+ path: identifier,
1983
+ branch: identifier,
1984
+ hostId: identifier,
1985
+ address: z4.object({ worktree: identifier }).optional()
1986
+ }).optional(),
1987
+ dispatch: z4.object({
1988
+ id: identifier,
1989
+ runId: identifier,
1990
+ taskId: identifier,
1991
+ /** Direct creator Dispatch that started this one; null for a Run root. */
1992
+ creatorDispatchId: identifier.nullable().optional(),
1993
+ failureCount: z4.number().int().nonnegative()
1994
+ }).optional(),
1995
+ worker: z4.object({
1996
+ dispatchId: identifier,
1997
+ runtimeEpoch: identifier,
1998
+ state: z4.string(),
1999
+ stage: z4.string(),
2000
+ worktreeId: identifier.nullable()
2001
+ }).optional(),
2002
+ observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
2003
+ projection: z4.object({
2004
+ resource: z4.object({
2005
+ state: z4.string(),
2006
+ terminalState: z4.string(),
2007
+ ownerDispatchId: identifier.optional(),
2008
+ releaseState: z4.string().optional()
2009
+ }).optional()
2010
+ }).optional()
2011
+ }).optional()
2012
+ });
2013
+ var orcaCommandRegistrySchema = z4.object({
2014
+ schemaVersion: z4.number().int().positive(),
2015
+ commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
2016
+ });
2017
+ var accountProviderSchema = z4.object({
2018
+ accounts: z4.array(z4.object({})),
2019
+ activeAccountId: identifier.nullable()
2020
+ });
2021
+ var orcaAccountReplySchema = z4.object({
2022
+ ok: z4.literal(true),
2023
+ _meta: z4.object({ runtimeId: identifier }),
2024
+ result: z4.object({
2025
+ codex: accountProviderSchema,
2026
+ opencode: accountProviderSchema,
2027
+ claude: accountProviderSchema
2028
+ })
2029
+ });
2030
+
2031
+ // packages/contracts/src/config/worker-policy.ts
2032
+ import { z as z5 } from "zod";
2033
+ var projectWorkerPolicySchema = z5.object({
2034
+ verification: z5.object({
2035
+ full: z5.enum(["local", "ci"]),
2036
+ local: z5.enum(["single-file", "affected"])
1733
2037
  }).strict().optional(),
1734
- instructions: z4.array(
1735
- z4.string().min(1).max(512).regex(/\S/).regex(
2038
+ instructions: z5.array(
2039
+ z5.string().min(1).max(512).regex(/\S/).regex(
1736
2040
  /^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
1737
2041
  "Instructions must be single-line text without control characters or a leading #"
1738
2042
  )
@@ -1760,8 +2064,11 @@ var CLEO_CONFIG_MANIFEST = {
1760
2064
  path: ".cleo/config.json",
1761
2065
  mergePrecedence: 20,
1762
2066
  driftDetection: "schema-validate",
1763
- schema: z5.object({
1764
- orchestrate: z5.object({ workerPolicy: projectWorkerPolicySchema.optional() }).passthrough().optional()
2067
+ schema: z6.object({
2068
+ orchestrate: z6.object({
2069
+ workerPolicy: projectWorkerPolicySchema.optional(),
2070
+ orca: orchestrateOrcaConfigSchema.optional()
2071
+ }).passthrough().optional()
1765
2072
  }).passthrough()
1766
2073
  };
1767
2074
  var GLOBAL_CLEO_CONFIG_MANIFEST = {
@@ -1777,139 +2084,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
1777
2084
  GLOBAL_CLEO_CONFIG_MANIFEST,
1778
2085
  CLEO_CONFIG_MANIFEST
1779
2086
  ]);
1780
- var configManifestEntrySchema = z5.object({
1781
- id: z5.string().min(1),
1782
- scope: z5.union([z5.literal("global"), z5.literal("project"), z5.literal("metadata")]),
1783
- path: z5.string().min(1),
1784
- schema: z5.unknown().optional(),
1785
- mergePrecedence: z5.number().int().nonnegative(),
1786
- driftDetection: z5.union([
1787
- z5.literal("schema-validate"),
1788
- z5.literal("staleness-gate"),
1789
- z5.literal("value-diff"),
1790
- z5.literal("none")
2087
+ var configManifestEntrySchema = z6.object({
2088
+ id: z6.string().min(1),
2089
+ scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
2090
+ path: z6.string().min(1),
2091
+ schema: z6.unknown().optional(),
2092
+ mergePrecedence: z6.number().int().nonnegative(),
2093
+ driftDetection: z6.union([
2094
+ z6.literal("schema-validate"),
2095
+ z6.literal("staleness-gate"),
2096
+ z6.literal("value-diff"),
2097
+ z6.literal("none")
1791
2098
  ]),
1792
- defaults: z5.record(z5.string(), z5.unknown()).optional()
2099
+ defaults: z6.record(z6.string(), z6.unknown()).optional()
1793
2100
  });
1794
2101
 
1795
2102
  // packages/contracts/src/daemon/health.ts
1796
- import { z as z7 } from "zod";
2103
+ import { z as z8 } from "zod";
1797
2104
 
1798
2105
  // packages/contracts/src/supervisor-ipc/messages.ts
1799
- import { z as z6 } from "zod";
1800
- var EnvPairSchema = z6.object({
2106
+ import { z as z7 } from "zod";
2107
+ var EnvPairSchema = z7.object({
1801
2108
  /** Environment variable name. */
1802
- key: z6.string().min(1),
2109
+ key: z7.string().min(1),
1803
2110
  /** Environment variable value. */
1804
- value: z6.string()
2111
+ value: z7.string()
1805
2112
  }).strict();
1806
- var ChildStateSchema = z6.enum(["running", "restarting", "stopped"]);
1807
- var ChildStatusSchema = z6.object({
2113
+ var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
2114
+ var ChildStatusSchema = z7.object({
1808
2115
  /** Logical id of the child (stable across restarts). */
1809
- child_id: z6.string().min(1),
2116
+ child_id: z7.string().min(1),
1810
2117
  /** Current OS pid (0 when not currently running). */
1811
- pid: z6.number().int().nonnegative(),
2118
+ pid: z7.number().int().nonnegative(),
1812
2119
  /** Current liveness state. */
1813
2120
  state: ChildStateSchema,
1814
2121
  /** Total restarts observed for this child. */
1815
- restart_count: z6.number().int().nonnegative()
2122
+ restart_count: z7.number().int().nonnegative()
1816
2123
  }).strict();
1817
- var SpawnRequestSchema = z6.object({
2124
+ var SpawnRequestSchema = z7.object({
1818
2125
  /** Tag discriminating this request variant. */
1819
- kind: z6.literal("spawn"),
2126
+ kind: z7.literal("spawn"),
1820
2127
  /** Caller-chosen logical id for the child (stable across restarts). */
1821
- child_id: z6.string().min(1),
2128
+ child_id: z7.string().min(1),
1822
2129
  /** Absolute path to the program to execute. */
1823
- program: z6.string().min(1),
2130
+ program: z7.string().min(1),
1824
2131
  /** Arguments passed to the program. */
1825
- args: z6.array(z6.string()).default([]),
2132
+ args: z7.array(z7.string()).default([]),
1826
2133
  /** Environment overrides applied on top of the supervisor's environment. */
1827
- env: z6.array(EnvPairSchema).default([]),
2134
+ env: z7.array(EnvPairSchema).default([]),
1828
2135
  /** Optional working directory for the child. */
1829
- cwd: z6.string().optional()
2136
+ cwd: z7.string().optional()
1830
2137
  }).strict();
1831
- var RestartRequestSchema = z6.object({
2138
+ var RestartRequestSchema = z7.object({
1832
2139
  /** Tag discriminating this request variant. */
1833
- kind: z6.literal("restart"),
2140
+ kind: z7.literal("restart"),
1834
2141
  /** Logical id of the child to restart. */
1835
- child_id: z6.string().min(1)
2142
+ child_id: z7.string().min(1)
1836
2143
  }).strict();
1837
- var MonitorRequestSchema = z6.object({
2144
+ var MonitorRequestSchema = z7.object({
1838
2145
  /** Tag discriminating this request variant. */
1839
- kind: z6.literal("monitor"),
2146
+ kind: z7.literal("monitor"),
1840
2147
  /** Specific child id to monitor; omit to request all children. */
1841
- child_id: z6.string().optional()
2148
+ child_id: z7.string().optional()
1842
2149
  }).strict();
1843
- var HealthRequestSchema = z6.object({
2150
+ var HealthRequestSchema = z7.object({
1844
2151
  /** Tag discriminating this request variant. */
1845
- kind: z6.literal("health")
2152
+ kind: z7.literal("health")
1846
2153
  }).strict();
1847
- var SupervisorIpcRequestSchema = z6.discriminatedUnion("kind", [
2154
+ var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
1848
2155
  SpawnRequestSchema,
1849
2156
  RestartRequestSchema,
1850
2157
  MonitorRequestSchema,
1851
2158
  HealthRequestSchema
1852
2159
  ]);
1853
- var SpawnedResponseSchema = z6.object({
2160
+ var SpawnedResponseSchema = z7.object({
1854
2161
  /** Tag discriminating this response variant. */
1855
- kind: z6.literal("spawned"),
2162
+ kind: z7.literal("spawned"),
1856
2163
  /** Logical id of the spawned child. */
1857
- child_id: z6.string().min(1),
2164
+ child_id: z7.string().min(1),
1858
2165
  /** OS pid assigned to the spawned child. */
1859
- pid: z6.number().int().nonnegative()
2166
+ pid: z7.number().int().nonnegative()
1860
2167
  }).strict();
1861
- var RestartedResponseSchema = z6.object({
2168
+ var RestartedResponseSchema = z7.object({
1862
2169
  /** Tag discriminating this response variant. */
1863
- kind: z6.literal("restarted"),
2170
+ kind: z7.literal("restarted"),
1864
2171
  /** Logical id of the restarted child. */
1865
- child_id: z6.string().min(1),
2172
+ child_id: z7.string().min(1),
1866
2173
  /** New OS pid after the restart. */
1867
- pid: z6.number().int().nonnegative(),
2174
+ pid: z7.number().int().nonnegative(),
1868
2175
  /** Number of times this child has been restarted in total. */
1869
- restart_count: z6.number().int().nonnegative()
2176
+ restart_count: z7.number().int().nonnegative()
1870
2177
  }).strict();
1871
- var MonitorResponseSchema = z6.object({
2178
+ var MonitorResponseSchema = z7.object({
1872
2179
  /** Tag discriminating this response variant. */
1873
- kind: z6.literal("monitor"),
2180
+ kind: z7.literal("monitor"),
1874
2181
  /** One row per monitored child. */
1875
- children: z6.array(ChildStatusSchema)
2182
+ children: z7.array(ChildStatusSchema)
1876
2183
  }).strict();
1877
- var HealthResponseSchema = z6.object({
2184
+ var HealthResponseSchema = z7.object({
1878
2185
  /** Tag discriminating this response variant. */
1879
- kind: z6.literal("health"),
2186
+ kind: z7.literal("health"),
1880
2187
  /** Supervisor process pid. */
1881
- pid: z6.number().int().nonnegative(),
2188
+ pid: z7.number().int().nonnegative(),
1882
2189
  /** Number of children currently tracked. */
1883
- child_count: z6.number().int().nonnegative(),
2190
+ child_count: z7.number().int().nonnegative(),
1884
2191
  /** Seconds the supervisor has been running. */
1885
- uptime_secs: z6.number().int().nonnegative(),
2192
+ uptime_secs: z7.number().int().nonnegative(),
1886
2193
  /** Frozen protocol version the supervisor speaks. */
1887
- protocol_version: z6.string()
2194
+ protocol_version: z7.string()
1888
2195
  }).strict();
1889
- var LifecycleEventKindSchema = z6.enum(["child_exited", "child_restarted"]);
1890
- var LifecycleEventResponseSchema = z6.object({
2196
+ var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
2197
+ var LifecycleEventResponseSchema = z7.object({
1891
2198
  /** Tag discriminating this response variant. */
1892
- kind: z6.literal("event"),
2199
+ kind: z7.literal("event"),
1893
2200
  /** What happened. */
1894
2201
  event: LifecycleEventKindSchema,
1895
2202
  /** Logical id of the affected child. */
1896
- child_id: z6.string().min(1),
2203
+ child_id: z7.string().min(1),
1897
2204
  /** Exit code, when the OS reported one. */
1898
- exit_code: z6.number().int().optional(),
2205
+ exit_code: z7.number().int().optional(),
1899
2206
  /** Terminating signal name, when the child was signalled (Unix). */
1900
- signal: z6.string().optional(),
2207
+ signal: z7.string().optional(),
1901
2208
  /** Backoff delay (ms) before the pending restart, when applicable. */
1902
- restart_delay_ms: z6.number().int().nonnegative().optional()
2209
+ restart_delay_ms: z7.number().int().nonnegative().optional()
1903
2210
  }).strict();
1904
- var ErrorResponseSchema = z6.object({
2211
+ var ErrorResponseSchema = z7.object({
1905
2212
  /** Tag discriminating this response variant. */
1906
- kind: z6.literal("error"),
2213
+ kind: z7.literal("error"),
1907
2214
  /** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
1908
- code: z6.string().min(1),
2215
+ code: z7.string().min(1),
1909
2216
  /** Human-readable error message. */
1910
- message: z6.string()
2217
+ message: z7.string()
1911
2218
  }).strict();
1912
- var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
2219
+ var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
1913
2220
  SpawnedResponseSchema,
1914
2221
  RestartedResponseSchema,
1915
2222
  MonitorResponseSchema,
@@ -1917,27 +2224,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1917
2224
  LifecycleEventResponseSchema,
1918
2225
  ErrorResponseSchema
1919
2226
  ]);
1920
- var SupervisorIpcRequestEnvelopeSchema = z6.object({
2227
+ var SupervisorIpcRequestEnvelopeSchema = z7.object({
1921
2228
  /** Frozen protocol version. */
1922
- protocol_version: z6.string(),
2229
+ protocol_version: z7.string(),
1923
2230
  /** Correlation id echoed back on the matching response. */
1924
- id: z6.string().min(1),
2231
+ id: z7.string().min(1),
1925
2232
  /** Direction discriminator. */
1926
- direction: z6.literal("request"),
2233
+ direction: z7.literal("request"),
1927
2234
  /** The request body. */
1928
2235
  request: SupervisorIpcRequestSchema
1929
2236
  }).strict();
1930
- var SupervisorIpcResponseEnvelopeSchema = z6.object({
2237
+ var SupervisorIpcResponseEnvelopeSchema = z7.object({
1931
2238
  /** Frozen protocol version. */
1932
- protocol_version: z6.string(),
2239
+ protocol_version: z7.string(),
1933
2240
  /** Correlation id echoed from the originating request (or a fresh id for events). */
1934
- id: z6.string().min(1),
2241
+ id: z7.string().min(1),
1935
2242
  /** Direction discriminator. */
1936
- direction: z6.literal("response"),
2243
+ direction: z7.literal("response"),
1937
2244
  /** The response body. */
1938
2245
  response: SupervisorIpcResponseSchema
1939
2246
  }).strict();
1940
- var SupervisorIpcEnvelopeSchema = z6.discriminatedUnion("direction", [
2247
+ var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
1941
2248
  SupervisorIpcRequestEnvelopeSchema,
1942
2249
  SupervisorIpcResponseEnvelopeSchema
1943
2250
  ]);
@@ -1961,17 +2268,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
1961
2268
  * Optional human-readable detail (e.g. last error message, queue depth).
1962
2269
  * Diagnostic only — not part of the supervisor wire contract.
1963
2270
  */
1964
- detail: z7.string().optional()
2271
+ detail: z8.string().optional()
1965
2272
  }).strict();
1966
- var HealthStatusSchema = z7.object({
2273
+ var HealthStatusSchema = z8.object({
1967
2274
  /** One health row per registered subsystem. */
1968
- subsystems: z7.array(SubsystemHealthSchema),
2275
+ subsystems: z8.array(SubsystemHealthSchema),
1969
2276
  /**
1970
2277
  * `true` iff every subsystem is in the `running` state. A convenience roll-up
1971
2278
  * derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
1972
2279
  * {@link summarizeHealth} so producers cannot desync it.
1973
2280
  */
1974
- allHealthy: z7.boolean()
2281
+ allHealthy: z8.boolean()
1975
2282
  }).strict();
1976
2283
 
1977
2284
  // packages/contracts/src/db-inventory.json
@@ -13900,7 +14207,7 @@ var OPERATIONS = [
13900
14207
  ];
13901
14208
 
13902
14209
  // packages/contracts/src/docs/modernize.ts
13903
- import { z as z8 } from "zod";
14210
+ import { z as z9 } from "zod";
13904
14211
  var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
13905
14212
  var DOCS_MODERNIZE_OPS = [
13906
14213
  "ingest",
@@ -13914,105 +14221,105 @@ var DOCS_MODERNIZE_OPS = [
13914
14221
  "reslug",
13915
14222
  "link-task"
13916
14223
  ];
13917
- var judgmentSchema = z8.object({
13918
- question: z8.enum(["classify", "merge"]),
13919
- site: z8.string(),
13920
- mode: z8.enum(["off", "shadow", "on"]),
13921
- ruleAnswer: z8.string(),
13922
- decidedAnswer: z8.string().nullable(),
13923
- decidedConfidence: z8.number().nullable(),
13924
- source: z8.enum(["provider", "cache", "fallback"]),
13925
- acted: z8.string()
14224
+ var judgmentSchema = z9.object({
14225
+ question: z9.enum(["classify", "merge"]),
14226
+ site: z9.string(),
14227
+ mode: z9.enum(["off", "shadow", "on"]),
14228
+ ruleAnswer: z9.string(),
14229
+ decidedAnswer: z9.string().nullable(),
14230
+ decidedConfidence: z9.number().nullable(),
14231
+ source: z9.enum(["provider", "cache", "fallback"]),
14232
+ acted: z9.string()
13926
14233
  });
13927
- var relPath = z8.string().min(1).max(1024);
13928
- var docsModernizePlanSchema = z8.object({
13929
- root: z8.string().min(1),
13930
- generatedAt: z8.string(),
13931
- mode: z8.enum(["tree", "store-only"]),
13932
- counts: z8.record(z8.enum(DOCS_MODERNIZE_DISPOSITIONS), z8.number()),
13933
- rows: z8.array(
13934
- z8.object({
14234
+ var relPath = z9.string().min(1).max(1024);
14235
+ var docsModernizePlanSchema = z9.object({
14236
+ root: z9.string().min(1),
14237
+ generatedAt: z9.string(),
14238
+ mode: z9.enum(["tree", "store-only"]),
14239
+ counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
14240
+ rows: z9.array(
14241
+ z9.object({
13935
14242
  path: relPath,
13936
- sha256: z8.string().regex(/^[0-9a-f]{64}$/),
13937
- kind: z8.string().min(1),
13938
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13939
- title: z8.string(),
13940
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13941
- target: z8.string().min(1).max(1024).nullable(),
13942
- reasons: z8.array(z8.string()),
13943
- judgments: z8.array(judgmentSchema),
13944
- ownerTasks: z8.array(z8.string().regex(/^[TD]\d+$/)),
13945
- category: z8.string(),
13946
- refs: z8.array(z8.string()),
13947
- overridden: z8.boolean(),
13948
- covers: z8.array(z8.string()),
13949
- baselineRemove: z8.boolean()
14243
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/),
14244
+ kind: z9.string().min(1),
14245
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
14246
+ title: z9.string(),
14247
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
14248
+ target: z9.string().min(1).max(1024).nullable(),
14249
+ reasons: z9.array(z9.string()),
14250
+ judgments: z9.array(judgmentSchema),
14251
+ ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
14252
+ category: z9.string(),
14253
+ refs: z9.array(z9.string()),
14254
+ overridden: z9.boolean(),
14255
+ covers: z9.array(z9.string()),
14256
+ baselineRemove: z9.boolean()
13950
14257
  })
13951
14258
  ),
13952
- linkFixes: z8.array(
13953
- z8.object({
13954
- kind: z8.literal("link-fix"),
14259
+ linkFixes: z9.array(
14260
+ z9.object({
14261
+ kind: z9.literal("link-fix"),
13955
14262
  path: relPath,
13956
- href: z8.string().min(1).max(2048),
13957
- newHref: z8.string().min(1).max(2048),
13958
- base: z8.literal("repo").optional(),
13959
- sha256: z8.string().regex(/^[0-9a-f]{64}$/).optional()
14263
+ href: z9.string().min(1).max(2048),
14264
+ newHref: z9.string().min(1).max(2048),
14265
+ base: z9.literal("repo").optional(),
14266
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
13960
14267
  })
13961
14268
  ).optional(),
13962
- repoRoot: z8.string().min(1).optional()
14269
+ repoRoot: z9.string().min(1).optional()
13963
14270
  });
13964
- var docsModernizeOverridesSchema = z8.record(
14271
+ var docsModernizeOverridesSchema = z9.record(
13965
14272
  relPath,
13966
- z8.object({
13967
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13968
- target: z8.string().min(1).max(1024).nullable().optional(),
13969
- reason: z8.string().min(1),
13970
- kind: z8.string().min(1).optional(),
13971
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13972
- covers: z8.array(z8.string()).optional()
14273
+ z9.object({
14274
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
14275
+ target: z9.string().min(1).max(1024).nullable().optional(),
14276
+ reason: z9.string().min(1),
14277
+ kind: z9.string().min(1).optional(),
14278
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
14279
+ covers: z9.array(z9.string()).optional()
13973
14280
  })
13974
14281
  );
13975
- var receiptOpSchema = z8.object({
13976
- op: z8.enum(DOCS_MODERNIZE_OPS),
13977
- state: z8.enum(["pending", "done", "reversed"]),
13978
- slug: z8.string().nullable(),
14282
+ var receiptOpSchema = z9.object({
14283
+ op: z9.enum(DOCS_MODERNIZE_OPS),
14284
+ state: z9.enum(["pending", "done", "reversed"]),
14285
+ slug: z9.string().nullable(),
13979
14286
  path: relPath.nullable(),
13980
- target: z8.string().nullable(),
13981
- attachmentId: z8.string().nullable(),
13982
- ownerId: z8.string().nullable(),
13983
- beforeSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13984
- afterSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13985
- prior: z8.object({
13986
- lifecycleStatus: z8.string().nullable().optional(),
13987
- supersededBy: z8.string().nullable().optional(),
13988
- supersedes: z8.string().nullable().optional(),
13989
- previousAttachmentId: z8.string().nullable().optional(),
13990
- newAttachmentId: z8.string().nullable().optional(),
13991
- linkTargets: z8.array(z8.string()).optional(),
13992
- kind: z8.string().nullable().optional()
14287
+ target: z9.string().nullable(),
14288
+ attachmentId: z9.string().nullable(),
14289
+ ownerId: z9.string().nullable(),
14290
+ beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
14291
+ afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
14292
+ prior: z9.object({
14293
+ lifecycleStatus: z9.string().nullable().optional(),
14294
+ supersededBy: z9.string().nullable().optional(),
14295
+ supersedes: z9.string().nullable().optional(),
14296
+ previousAttachmentId: z9.string().nullable().optional(),
14297
+ newAttachmentId: z9.string().nullable().optional(),
14298
+ linkTargets: z9.array(z9.string()).optional(),
14299
+ kind: z9.string().nullable().optional()
13993
14300
  }).optional(),
13994
- base: z8.literal("repo").optional()
14301
+ base: z9.literal("repo").optional()
13995
14302
  });
13996
14303
  var docsModernizeJournalLineSchema = receiptOpSchema.extend({
13997
- i: z8.number().int().min(0)
14304
+ i: z9.number().int().min(0)
13998
14305
  });
13999
- var docsModernizeReceiptSchema = z8.object({
14000
- runId: z8.string().regex(/^dm-[\w-]+$/),
14001
- root: z8.string().min(1),
14002
- appliedAt: z8.string(),
14003
- planSha256: z8.string(),
14004
- edgeCount: z8.number(),
14005
- rolledBackAt: z8.string().nullable(),
14006
- blobs: z8.array(z8.object({ path: relPath, sha256: z8.string() })),
14007
- moves: z8.array(z8.object({ from: relPath, to: relPath })),
14008
- deleted: z8.array(relPath),
14009
- ops: z8.array(receiptOpSchema),
14010
- durationMs: z8.number().optional(),
14011
- repoRoot: z8.string().min(1).optional()
14306
+ var docsModernizeReceiptSchema = z9.object({
14307
+ runId: z9.string().regex(/^dm-[\w-]+$/),
14308
+ root: z9.string().min(1),
14309
+ appliedAt: z9.string(),
14310
+ planSha256: z9.string(),
14311
+ edgeCount: z9.number(),
14312
+ rolledBackAt: z9.string().nullable(),
14313
+ blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
14314
+ moves: z9.array(z9.object({ from: relPath, to: relPath })),
14315
+ deleted: z9.array(relPath),
14316
+ ops: z9.array(receiptOpSchema),
14317
+ durationMs: z9.number().optional(),
14318
+ repoRoot: z9.string().min(1).optional()
14012
14319
  });
14013
14320
 
14014
14321
  // packages/contracts/src/docs/provenance.ts
14015
- import { z as z9 } from "zod";
14322
+ import { z as z10 } from "zod";
14016
14323
  var PROVENANCE_NODE_KINDS = [
14017
14324
  "doc",
14018
14325
  "task",
@@ -14035,96 +14342,96 @@ var DOC_LIFECYCLE_STATUSES = [
14035
14342
  "archived",
14036
14343
  "draft"
14037
14344
  ];
14038
- var provenanceNodeKindSchema = z9.enum(PROVENANCE_NODE_KINDS);
14039
- var provenanceEdgeRelationSchema = z9.enum(PROVENANCE_EDGE_RELATIONS);
14040
- var docLifecycleStatusSchema = z9.enum(DOC_LIFECYCLE_STATUSES);
14345
+ var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
14346
+ var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
14347
+ var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
14041
14348
  var provenanceNodeBaseFields = {
14042
- id: z9.string().min(1),
14043
- title: z9.string().min(1),
14044
- metadata: z9.record(z9.string(), z9.unknown()).optional()
14349
+ id: z10.string().min(1),
14350
+ title: z10.string().min(1),
14351
+ metadata: z10.record(z10.string(), z10.unknown()).optional()
14045
14352
  };
14046
- var provenanceDocNodeSchema = z9.object({
14353
+ var provenanceDocNodeSchema = z10.object({
14047
14354
  ...provenanceNodeBaseFields,
14048
- kind: z9.literal("doc"),
14049
- slug: z9.string().min(1),
14050
- docKind: z9.string().min(1),
14355
+ kind: z10.literal("doc"),
14356
+ slug: z10.string().min(1),
14357
+ docKind: z10.string().min(1),
14051
14358
  lifecycleStatus: docLifecycleStatusSchema,
14052
- publishedAt: z9.string().min(1),
14053
- supersededAt: z9.string().min(1).optional(),
14054
- summary: z9.string().optional()
14359
+ publishedAt: z10.string().min(1),
14360
+ supersededAt: z10.string().min(1).optional(),
14361
+ summary: z10.string().optional()
14055
14362
  });
14056
- var provenanceTaskNodeSchema = z9.object({
14363
+ var provenanceTaskNodeSchema = z10.object({
14057
14364
  ...provenanceNodeBaseFields,
14058
- kind: z9.literal("task"),
14059
- taskType: z9.enum(["saga", "epic", "task", "subtask"]),
14060
- status: z9.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
14365
+ kind: z10.literal("task"),
14366
+ taskType: z10.enum(["saga", "epic", "task", "subtask"]),
14367
+ status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
14061
14368
  });
14062
- var provenanceDecisionNodeSchema = z9.object({
14369
+ var provenanceDecisionNodeSchema = z10.object({
14063
14370
  ...provenanceNodeBaseFields,
14064
- kind: z9.literal("decision"),
14065
- outcome: z9.enum(["proposed", "accepted", "rejected", "superseded"]),
14066
- decidedAt: z9.string().min(1)
14371
+ kind: z10.literal("decision"),
14372
+ outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
14373
+ decidedAt: z10.string().min(1)
14067
14374
  });
14068
- var provenanceSessionNodeSchema = z9.object({
14375
+ var provenanceSessionNodeSchema = z10.object({
14069
14376
  ...provenanceNodeBaseFields,
14070
- kind: z9.literal("session"),
14071
- startedAt: z9.string().min(1),
14072
- endedAt: z9.string().min(1).optional()
14377
+ kind: z10.literal("session"),
14378
+ startedAt: z10.string().min(1),
14379
+ endedAt: z10.string().min(1).optional()
14073
14380
  });
14074
- var provenanceMemoryNodeSchema = z9.object({
14381
+ var provenanceMemoryNodeSchema = z10.object({
14075
14382
  ...provenanceNodeBaseFields,
14076
- kind: z9.literal("memory"),
14077
- memoryType: z9.enum(["observation", "pattern", "decision", "diary"]),
14078
- recordedAt: z9.string().min(1)
14383
+ kind: z10.literal("memory"),
14384
+ memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
14385
+ recordedAt: z10.string().min(1)
14079
14386
  });
14080
- var provenanceNodeSchema = z9.discriminatedUnion("kind", [
14387
+ var provenanceNodeSchema = z10.discriminatedUnion("kind", [
14081
14388
  provenanceDocNodeSchema,
14082
14389
  provenanceTaskNodeSchema,
14083
14390
  provenanceDecisionNodeSchema,
14084
14391
  provenanceSessionNodeSchema,
14085
14392
  provenanceMemoryNodeSchema
14086
14393
  ]);
14087
- var provenanceEdgeSchema = z9.object({
14394
+ var provenanceEdgeSchema = z10.object({
14088
14395
  relation: provenanceEdgeRelationSchema,
14089
- from: z9.string().min(1),
14396
+ from: z10.string().min(1),
14090
14397
  fromKind: provenanceNodeKindSchema,
14091
- to: z9.string().min(1),
14398
+ to: z10.string().min(1),
14092
14399
  toKind: provenanceNodeKindSchema,
14093
- addedAt: z9.string().min(1),
14094
- summary: z9.string().optional()
14400
+ addedAt: z10.string().min(1),
14401
+ summary: z10.string().optional()
14095
14402
  });
14096
- var docProvenanceResponseSchema = z9.object({
14097
- nodes: z9.array(provenanceNodeSchema).readonly(),
14098
- edges: z9.array(provenanceEdgeSchema).readonly(),
14099
- totalNodes: z9.number().int().nonnegative(),
14100
- totalEdges: z9.number().int().nonnegative()
14403
+ var docProvenanceResponseSchema = z10.object({
14404
+ nodes: z10.array(provenanceNodeSchema).readonly(),
14405
+ edges: z10.array(provenanceEdgeSchema).readonly(),
14406
+ totalNodes: z10.number().int().nonnegative(),
14407
+ totalEdges: z10.number().int().nonnegative()
14101
14408
  });
14102
14409
 
14103
14410
  // packages/contracts/src/docs/read.ts
14104
- import { z as z10 } from "zod";
14105
- var docFrontmatterSchema = z10.object({
14106
- slug: z10.string(),
14107
- kind: z10.string().nullable(),
14108
- title: z10.string().nullable(),
14109
- summary: z10.string().nullable(),
14110
- lifecycleStatus: z10.string(),
14111
- docVersion: z10.number().int(),
14112
- ownerVersion: z10.string().nullable(),
14113
- supersedes: z10.string().nullable(),
14114
- supersededBy: z10.string().nullable(),
14115
- topics: z10.array(z10.string()).readonly(),
14116
- relatedTasks: z10.array(z10.string()).readonly(),
14117
- sha256: z10.string(),
14118
- createdAt: z10.string()
14411
+ import { z as z11 } from "zod";
14412
+ var docFrontmatterSchema = z11.object({
14413
+ slug: z11.string(),
14414
+ kind: z11.string().nullable(),
14415
+ title: z11.string().nullable(),
14416
+ summary: z11.string().nullable(),
14417
+ lifecycleStatus: z11.string(),
14418
+ docVersion: z11.number().int(),
14419
+ ownerVersion: z11.string().nullable(),
14420
+ supersedes: z11.string().nullable(),
14421
+ supersededBy: z11.string().nullable(),
14422
+ topics: z11.array(z11.string()).readonly(),
14423
+ relatedTasks: z11.array(z11.string()).readonly(),
14424
+ sha256: z11.string(),
14425
+ createdAt: z11.string()
14119
14426
  });
14120
- var docBodySchema = z10.object({
14121
- encoding: z10.enum(["utf-8", "base64"]),
14122
- text: z10.string().optional(),
14123
- base64: z10.string().optional(),
14124
- sizeBytes: z10.number().int().nonnegative(),
14125
- mimeType: z10.string().nullable()
14427
+ var docBodySchema = z11.object({
14428
+ encoding: z11.enum(["utf-8", "base64"]),
14429
+ text: z11.string().optional(),
14430
+ base64: z11.string().optional(),
14431
+ sizeBytes: z11.number().int().nonnegative(),
14432
+ mimeType: z11.string().nullable()
14126
14433
  });
14127
- var docReadResponseSchema = z10.object({
14434
+ var docReadResponseSchema = z11.object({
14128
14435
  frontmatter: docFrontmatterSchema,
14129
14436
  body: docBodySchema
14130
14437
  });
@@ -14283,7 +14590,7 @@ var TASK_RELATION_TYPES = [
14283
14590
  var E_LEAD_TOOLS_UNSTRIPPED = "E_LEAD_TOOLS_UNSTRIPPED";
14284
14591
 
14285
14592
  // packages/contracts/src/evidence-atom-schema.ts
14286
- import { z as z11 } from "zod";
14593
+ import { z as z12 } from "zod";
14287
14594
  var EVIDENCE_ATOM_KINDS = [
14288
14595
  "commit",
14289
14596
  "files",
@@ -14305,96 +14612,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
14305
14612
  var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
14306
14613
  var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
14307
14614
  var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
14308
- var commitAtomSchema = z11.object({
14309
- kind: z11.literal("commit"),
14310
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14615
+ var commitAtomSchema = z12.object({
14616
+ kind: z12.literal("commit"),
14617
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14311
14618
  });
14312
- var filesAtomSchema = z11.object({
14313
- kind: z11.literal("files"),
14314
- paths: z11.array(z11.string().min(1)).min(1, "files atom requires at least one path")
14619
+ var filesAtomSchema = z12.object({
14620
+ kind: z12.literal("files"),
14621
+ paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
14315
14622
  });
14316
- var testRunAtomSchema = z11.object({
14317
- kind: z11.literal("test-run"),
14318
- path: z11.string().min(1, "test-run atom requires a non-empty path")
14623
+ var testRunAtomSchema = z12.object({
14624
+ kind: z12.literal("test-run"),
14625
+ path: z12.string().min(1, "test-run atom requires a non-empty path")
14319
14626
  });
14320
- var qaRunAtomSchema = z11.object({
14321
- kind: z11.literal("qa-run"),
14322
- path: z11.string().min(1, "qa-run atom requires a non-empty path")
14627
+ var qaRunAtomSchema = z12.object({
14628
+ kind: z12.literal("qa-run"),
14629
+ path: z12.string().min(1, "qa-run atom requires a non-empty path")
14323
14630
  });
14324
- var toolAtomSchema = z11.object({
14325
- kind: z11.literal("tool"),
14326
- tool: z11.string().min(1, "tool atom requires a non-empty tool name")
14631
+ var toolAtomSchema = z12.object({
14632
+ kind: z12.literal("tool"),
14633
+ tool: z12.string().min(1, "tool atom requires a non-empty tool name")
14327
14634
  });
14328
- var urlAtomSchema = z11.object({
14329
- kind: z11.literal("url"),
14330
- url: z11.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14635
+ var urlAtomSchema = z12.object({
14636
+ kind: z12.literal("url"),
14637
+ url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14331
14638
  });
14332
- var noteAtomSchema = z11.object({
14333
- kind: z11.literal("note"),
14334
- note: z11.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14639
+ var noteAtomSchema = z12.object({
14640
+ kind: z12.literal("note"),
14641
+ note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14335
14642
  });
14336
- var decisionAtomSchema = z11.object({
14337
- kind: z11.literal("decision"),
14338
- decisionId: z11.string().min(1, "decision atom requires a non-empty decision ID")
14643
+ var decisionAtomSchema = z12.object({
14644
+ kind: z12.literal("decision"),
14645
+ decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
14339
14646
  });
14340
- var prAtomSchema = z11.object({
14341
- kind: z11.literal("pr"),
14342
- prNumber: z11.number().int().positive("pr atom requires a positive integer PR number"),
14343
- componentPrNumber: z11.number().int().positive().optional(),
14647
+ var prAtomSchema = z12.object({
14648
+ kind: z12.literal("pr"),
14649
+ prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
14650
+ componentPrNumber: z12.number().int().positive().optional(),
14344
14651
  /**
14345
14652
  * `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
14346
14653
  * belongs to, lowercased. Validated against the evidence git root's
14347
14654
  * `origin`, since PR numbers are only unique per repository.
14348
14655
  */
14349
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14656
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14350
14657
  });
14351
- var ciAtomSchema = z11.object({
14352
- kind: z11.literal("ci"),
14353
- prNumber: z11.number().int().positive("ci atom requires a positive integer PR number"),
14354
- componentPrNumber: z11.number().int().positive().optional(),
14658
+ var ciAtomSchema = z12.object({
14659
+ kind: z12.literal("ci"),
14660
+ prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
14661
+ componentPrNumber: z12.number().int().positive().optional(),
14355
14662
  /** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
14356
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14663
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14357
14664
  });
14358
- var ciRunAtomSchema = z11.object({
14359
- kind: z11.literal("ci-run"),
14360
- runId: z11.number().int().positive("ci-run atom requires a positive integer run id")
14665
+ var ciRunAtomSchema = z12.object({
14666
+ kind: z12.literal("ci-run"),
14667
+ runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
14361
14668
  });
14362
- var deployAtomSchema = z11.object({
14363
- kind: z11.literal("deploy"),
14364
- provider: z11.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14365
- deploymentId: z11.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14366
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14367
- probeUrl: z11.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14669
+ var deployAtomSchema = z12.object({
14670
+ kind: z12.literal("deploy"),
14671
+ provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14672
+ deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14673
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14674
+ probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14368
14675
  });
14369
- var locDropAtomSchema = z11.object({
14370
- kind: z11.literal("loc-drop"),
14371
- fromLines: z11.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14372
- toLines: z11.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14676
+ var locDropAtomSchema = z12.object({
14677
+ kind: z12.literal("loc-drop"),
14678
+ fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14679
+ toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14373
14680
  });
14374
- var callsiteCoverageAtomSchema = z11.object({
14375
- kind: z11.literal("callsite-coverage"),
14376
- symbolName: z11.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14377
- relativeSourcePath: z11.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14681
+ var callsiteCoverageAtomSchema = z12.object({
14682
+ kind: z12.literal("callsite-coverage"),
14683
+ symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14684
+ relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14378
14685
  });
14379
14686
  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}$/;
14380
14687
  var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
14381
14688
  var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
14382
14689
  var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
14383
- var satisfiesAtomSchema = z11.object({
14384
- kind: z11.literal("satisfies"),
14690
+ var satisfiesAtomSchema = z12.object({
14691
+ kind: z12.literal("satisfies"),
14385
14692
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
14386
- targetTaskId: z11.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14693
+ targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14387
14694
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
14388
- targetAcId: z11.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14695
+ targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14389
14696
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
14390
- targetAcAlias: z11.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14697
+ targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14391
14698
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
14392
- versionPin: z11.string().regex(
14699
+ versionPin: z12.string().regex(
14393
14700
  SATISFIES_VERSION_PIN_REGEX,
14394
14701
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
14395
14702
  ).optional()
14396
14703
  });
14397
- var EvidenceAtomSchema = z11.discriminatedUnion("kind", [
14704
+ var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
14398
14705
  commitAtomSchema,
14399
14706
  filesAtomSchema,
14400
14707
  testRunAtomSchema,
@@ -14456,54 +14763,54 @@ var ATOM_EXAMPLES = Object.freeze({
14456
14763
  });
14457
14764
 
14458
14765
  // packages/contracts/src/evidence-record-schema.ts
14459
- import { z as z12 } from "zod";
14460
- var evidenceBaseSchema = z12.object({
14766
+ import { z as z13 } from "zod";
14767
+ var evidenceBaseSchema = z13.object({
14461
14768
  /** Identity string of the agent that produced this record. */
14462
- agentIdentity: z12.string().min(1),
14769
+ agentIdentity: z13.string().min(1),
14463
14770
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
14464
- attachmentSha256: z12.string().length(64),
14771
+ attachmentSha256: z13.string().length(64),
14465
14772
  /** ISO 8601 timestamp at which the action ran. */
14466
- ranAt: z12.string().datetime(),
14773
+ ranAt: z13.string().datetime(),
14467
14774
  /** Wall-clock duration of the action in milliseconds. */
14468
- durationMs: z12.number().nonnegative()
14775
+ durationMs: z13.number().nonnegative()
14469
14776
  });
14470
14777
  var implDiffRecordSchema = evidenceBaseSchema.extend({
14471
- kind: z12.literal("impl-diff"),
14472
- phase: z12.literal("implement"),
14473
- filesChanged: z12.array(z12.string().min(1)).min(1),
14474
- linesAdded: z12.number().int().nonnegative(),
14475
- linesRemoved: z12.number().int().nonnegative()
14778
+ kind: z13.literal("impl-diff"),
14779
+ phase: z13.literal("implement"),
14780
+ filesChanged: z13.array(z13.string().min(1)).min(1),
14781
+ linesAdded: z13.number().int().nonnegative(),
14782
+ linesRemoved: z13.number().int().nonnegative()
14476
14783
  });
14477
14784
  var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
14478
- kind: z12.literal("validate-spec-check"),
14479
- phase: z12.literal("validate"),
14480
- reqIdsChecked: z12.array(z12.string().min(1)).min(1),
14481
- passed: z12.boolean(),
14482
- details: z12.string().min(1)
14785
+ kind: z13.literal("validate-spec-check"),
14786
+ phase: z13.literal("validate"),
14787
+ reqIdsChecked: z13.array(z13.string().min(1)).min(1),
14788
+ passed: z13.boolean(),
14789
+ details: z13.string().min(1)
14483
14790
  });
14484
14791
  var testOutputRecordSchema = evidenceBaseSchema.extend({
14485
- kind: z12.literal("test-output"),
14486
- phase: z12.literal("test"),
14487
- command: z12.string().min(1),
14488
- exitCode: z12.number().int(),
14489
- testsPassed: z12.number().int().nonnegative(),
14490
- testsFailed: z12.number().int().nonnegative()
14792
+ kind: z13.literal("test-output"),
14793
+ phase: z13.literal("test"),
14794
+ command: z13.string().min(1),
14795
+ exitCode: z13.number().int(),
14796
+ testsPassed: z13.number().int().nonnegative(),
14797
+ testsFailed: z13.number().int().nonnegative()
14491
14798
  });
14492
14799
  var lintReportRecordSchema = evidenceBaseSchema.extend({
14493
- kind: z12.literal("lint-report"),
14494
- phase: z12.enum(["implement", "test"]),
14495
- tool: z12.string().min(1),
14496
- passed: z12.boolean(),
14497
- warnings: z12.number().int().nonnegative(),
14498
- errors: z12.number().int().nonnegative()
14800
+ kind: z13.literal("lint-report"),
14801
+ phase: z13.enum(["implement", "test"]),
14802
+ tool: z13.string().min(1),
14803
+ passed: z13.boolean(),
14804
+ warnings: z13.number().int().nonnegative(),
14805
+ errors: z13.number().int().nonnegative()
14499
14806
  });
14500
14807
  var commandOutputRecordSchema = evidenceBaseSchema.extend({
14501
- kind: z12.literal("command-output"),
14502
- phase: z12.enum(["implement", "validate", "test"]),
14503
- cmd: z12.string().min(1),
14504
- exitCode: z12.number().int()
14808
+ kind: z13.literal("command-output"),
14809
+ phase: z13.enum(["implement", "validate", "test"]),
14810
+ cmd: z13.string().min(1),
14811
+ exitCode: z13.number().int()
14505
14812
  });
14506
- var evidenceRecordSchema = z12.discriminatedUnion("kind", [
14813
+ var evidenceRecordSchema = z13.discriminatedUnion("kind", [
14507
14814
  implDiffRecordSchema,
14508
14815
  validateSpecCheckRecordSchema,
14509
14816
  testOutputRecordSchema,
@@ -15438,107 +15745,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
15438
15745
  });
15439
15746
 
15440
15747
  // packages/contracts/src/lease-ipc/messages.ts
15441
- import { z as z13 } from "zod";
15442
- var LeaseScopeSchema = z13.enum(["project", "global"]);
15443
- var LeaseLaneSchema = z13.enum(["tasks", "brain", "bulk"]);
15444
- var LeaseAcquireRequestSchema = z13.object({
15748
+ import { z as z14 } from "zod";
15749
+ var LeaseScopeSchema = z14.enum(["project", "global"]);
15750
+ var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
15751
+ var LeaseAcquireRequestSchema = z14.object({
15445
15752
  /** Tag discriminating this request variant. */
15446
- kind: z13.literal("lease_acquire"),
15753
+ kind: z14.literal("lease_acquire"),
15447
15754
  /** The cleo.db scope being arbitrated. */
15448
15755
  scope: LeaseScopeSchema,
15449
15756
  /** The write lane within the scope. */
15450
15757
  lane: LeaseLaneSchema,
15451
15758
  /** Process+lane holder identity. */
15452
- holder_id: z13.string().min(1),
15759
+ holder_id: z14.string().min(1),
15453
15760
  /** Advisory priority — lower acquires sooner. `0` = highest. */
15454
- priority: z13.number().int().min(0).max(255),
15761
+ priority: z14.number().int().min(0).max(255),
15455
15762
  /** Lease time-to-live in milliseconds. */
15456
- ttl_ms: z13.number().int().nonnegative(),
15763
+ ttl_ms: z14.number().int().nonnegative(),
15457
15764
  /** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
15458
- reentrant: z13.boolean()
15765
+ reentrant: z14.boolean()
15459
15766
  }).strict();
15460
- var LeaseReleaseRequestSchema = z13.object({
15767
+ var LeaseReleaseRequestSchema = z14.object({
15461
15768
  /** Tag discriminating this request variant. */
15462
- kind: z13.literal("lease_release"),
15769
+ kind: z14.literal("lease_release"),
15463
15770
  /** The cleo.db scope being arbitrated. */
15464
15771
  scope: LeaseScopeSchema,
15465
15772
  /** The write lane within the scope. */
15466
15773
  lane: LeaseLaneSchema,
15467
15774
  /** Process+lane holder identity. */
15468
- holder_id: z13.string().min(1),
15775
+ holder_id: z14.string().min(1),
15469
15776
  /** The epoch fence the holder acquired — a stale epoch no-ops. */
15470
- epoch: z13.number().int().nonnegative()
15777
+ epoch: z14.number().int().nonnegative()
15471
15778
  }).strict();
15472
- var LeaseRenewRequestSchema = z13.object({
15779
+ var LeaseRenewRequestSchema = z14.object({
15473
15780
  /** Tag discriminating this request variant. */
15474
- kind: z13.literal("lease_renew"),
15781
+ kind: z14.literal("lease_renew"),
15475
15782
  /** The cleo.db scope being arbitrated. */
15476
15783
  scope: LeaseScopeSchema,
15477
15784
  /** The write lane within the scope. */
15478
15785
  lane: LeaseLaneSchema,
15479
15786
  /** Process+lane holder identity. */
15480
- holder_id: z13.string().min(1),
15787
+ holder_id: z14.string().min(1),
15481
15788
  /** The epoch fence the holder acquired (epoch-guarded renew). */
15482
- epoch: z13.number().int().nonnegative()
15789
+ epoch: z14.number().int().nonnegative()
15483
15790
  }).strict();
15484
- var RateCheckRequestSchema = z13.object({
15791
+ var RateCheckRequestSchema = z14.object({
15485
15792
  /** Tag discriminating this request variant. */
15486
- kind: z13.literal("rate_check"),
15793
+ kind: z14.literal("rate_check"),
15487
15794
  /** The cleo.db scope being checked. */
15488
15795
  scope: LeaseScopeSchema,
15489
15796
  /** The write lane within the scope. */
15490
15797
  lane: LeaseLaneSchema,
15491
15798
  /** Estimated bytes the caller intends to write. */
15492
- est_bytes: z13.number().int().nonnegative()
15799
+ est_bytes: z14.number().int().nonnegative()
15493
15800
  }).strict();
15494
- var ToolGrantRequestSchema = z13.object({
15801
+ var ToolGrantRequestSchema = z14.object({
15495
15802
  /** Tag discriminating this request variant. */
15496
- kind: z13.literal("tool_grant"),
15803
+ kind: z14.literal("tool_grant"),
15497
15804
  /** The tool name being requested. */
15498
- tool: z13.string().min(1),
15805
+ tool: z14.string().min(1),
15499
15806
  /** The requesting holder identity. */
15500
- holder_id: z13.string().min(1)
15807
+ holder_id: z14.string().min(1)
15501
15808
  }).strict();
15502
- var QueuePriorityClassSchema = z13.enum(["lead", "worker", "background"]);
15503
- var QueueAdmitRequestSchema = z13.object({
15809
+ var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
15810
+ var QueueAdmitRequestSchema = z14.object({
15504
15811
  /** Tag discriminating this request variant. */
15505
- kind: z13.literal("queue_admit"),
15812
+ kind: z14.literal("queue_admit"),
15506
15813
  /** The LLM provider id the call targets (rate budget is per-provider). */
15507
- provider: z13.string().min(1),
15814
+ provider: z14.string().min(1),
15508
15815
  /** The caller's priority class (lead > worker > background). */
15509
15816
  priority_class: QueuePriorityClassSchema,
15510
15817
  /** The caller's estimate of the request's token cost (debited on admit). */
15511
- est_tokens: z13.number().int().nonnegative(),
15818
+ est_tokens: z14.number().int().nonnegative(),
15512
15819
  /** The child the call belongs to (in-flight tracking — the watchdog seam). */
15513
- child_id: z13.string().min(1)
15820
+ child_id: z14.string().min(1)
15514
15821
  }).strict();
15515
- var WorkerHeartbeatRequestSchema = z13.object({
15822
+ var WorkerHeartbeatRequestSchema = z14.object({
15516
15823
  /** Tag discriminating this request variant. */
15517
- kind: z13.literal("worker_heartbeat"),
15824
+ kind: z14.literal("worker_heartbeat"),
15518
15825
  /** The logical id of the heartbeating child (matches the registry key). */
15519
- child_id: z13.string().min(1),
15826
+ child_id: z14.string().min(1),
15520
15827
  /** The worker's own view of whether it is currently inside an LLM call. */
15521
- in_flight_llm: z13.boolean()
15828
+ in_flight_llm: z14.boolean()
15522
15829
  }).strict();
15523
- var ResourceAdmitRequestSchema = z13.object({
15830
+ var ResourceAdmitRequestSchema = z14.object({
15524
15831
  /** Tag discriminating this request variant. */
15525
- kind: z13.literal("resource_admit"),
15832
+ kind: z14.literal("resource_admit"),
15526
15833
  /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
15527
- class: z13.string().min(1),
15834
+ class: z14.string().min(1),
15528
15835
  /** The caller holding the slot — process/worktree-unique; the release key. */
15529
- holder_id: z13.string().min(1),
15836
+ holder_id: z14.string().min(1),
15530
15837
  /** The client-computed budget: the max concurrent holders for this class. */
15531
- budget: z13.number().int().nonnegative()
15838
+ budget: z14.number().int().nonnegative()
15532
15839
  }).strict();
15533
- var ResourceReleaseRequestSchema = z13.object({
15840
+ var ResourceReleaseRequestSchema = z14.object({
15534
15841
  /** Tag discriminating this request variant. */
15535
- kind: z13.literal("resource_release"),
15842
+ kind: z14.literal("resource_release"),
15536
15843
  /** The resource class the slot belongs to. */
15537
- class: z13.string().min(1),
15844
+ class: z14.string().min(1),
15538
15845
  /** The holder that was admitted (matches the admit `holder_id`). */
15539
- holder_id: z13.string().min(1)
15846
+ holder_id: z14.string().min(1)
15540
15847
  }).strict();
15541
- var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15848
+ var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
15542
15849
  LeaseAcquireRequestSchema,
15543
15850
  LeaseReleaseRequestSchema,
15544
15851
  LeaseRenewRequestSchema,
@@ -15549,133 +15856,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15549
15856
  ResourceAdmitRequestSchema,
15550
15857
  ResourceReleaseRequestSchema
15551
15858
  ]);
15552
- var LeaseGrantedResponseSchema = z13.object({
15859
+ var LeaseGrantedResponseSchema = z14.object({
15553
15860
  /** Tag discriminating this response variant. */
15554
- kind: z13.literal("lease_granted"),
15861
+ kind: z14.literal("lease_granted"),
15555
15862
  /** The granted cleo.db scope. */
15556
15863
  scope: LeaseScopeSchema,
15557
15864
  /** The granted write lane. */
15558
15865
  lane: LeaseLaneSchema,
15559
15866
  /** The holder the lease was granted to. */
15560
- holder_id: z13.string().min(1),
15867
+ holder_id: z14.string().min(1),
15561
15868
  /** The monotonic epoch fence assigned to this grant. */
15562
- epoch: z13.number().int().nonnegative(),
15869
+ epoch: z14.number().int().nonnegative(),
15563
15870
  /** The lease TTL in milliseconds. */
15564
- ttl_ms: z13.number().int().nonnegative(),
15871
+ ttl_ms: z14.number().int().nonnegative(),
15565
15872
  /** Absolute expiry timestamp (epoch ms) for this grant. */
15566
- expires_at_ms: z13.number().int().nonnegative()
15873
+ expires_at_ms: z14.number().int().nonnegative()
15567
15874
  }).strict();
15568
- var LeaseQueuedResponseSchema = z13.object({
15875
+ var LeaseQueuedResponseSchema = z14.object({
15569
15876
  /** Tag discriminating this response variant. */
15570
- kind: z13.literal("lease_queued"),
15877
+ kind: z14.literal("lease_queued"),
15571
15878
  /** The queued cleo.db scope. */
15572
15879
  scope: LeaseScopeSchema,
15573
15880
  /** The queued write lane. */
15574
15881
  lane: LeaseLaneSchema,
15575
15882
  /** The monotonic ticket assigned for FIFO tiebreak. */
15576
- ticket: z13.number().int().nonnegative(),
15883
+ ticket: z14.number().int().nonnegative(),
15577
15884
  /** Number of waiters ahead of this one. */
15578
- ahead: z13.number().int().nonnegative()
15885
+ ahead: z14.number().int().nonnegative()
15579
15886
  }).strict();
15580
- var LeaseDeniedResponseSchema = z13.object({
15887
+ var LeaseDeniedResponseSchema = z14.object({
15581
15888
  /** Tag discriminating this response variant. */
15582
- kind: z13.literal("lease_denied"),
15889
+ kind: z14.literal("lease_denied"),
15583
15890
  /** The denied cleo.db scope. */
15584
15891
  scope: LeaseScopeSchema,
15585
15892
  /** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
15586
- code: z13.string().min(1),
15893
+ code: z14.string().min(1),
15587
15894
  /** Human-readable denial message. */
15588
- message: z13.string()
15895
+ message: z14.string()
15589
15896
  }).strict();
15590
- var RateResultResponseSchema = z13.object({
15897
+ var RateResultResponseSchema = z14.object({
15591
15898
  /** Tag discriminating this response variant. */
15592
- kind: z13.literal("rate_result"),
15899
+ kind: z14.literal("rate_result"),
15593
15900
  /** The checked cleo.db scope. */
15594
15901
  scope: LeaseScopeSchema,
15595
15902
  /** Whether the write is within budget. */
15596
- ok: z13.boolean(),
15903
+ ok: z14.boolean(),
15597
15904
  /** Suggested back-off in milliseconds when `ok` is false. */
15598
- retry_after_ms: z13.number().int().nonnegative(),
15905
+ retry_after_ms: z14.number().int().nonnegative(),
15599
15906
  /** Remaining token budget for the scope. */
15600
- tokens_remaining: z13.number().int().nonnegative()
15907
+ tokens_remaining: z14.number().int().nonnegative()
15601
15908
  }).strict();
15602
- var ToolGrantedResponseSchema = z13.object({
15909
+ var ToolGrantedResponseSchema = z14.object({
15603
15910
  /** Tag discriminating this response variant. */
15604
- kind: z13.literal("tool_granted"),
15911
+ kind: z14.literal("tool_granted"),
15605
15912
  /** The granted tool name. */
15606
- tool: z13.string().min(1),
15913
+ tool: z14.string().min(1),
15607
15914
  /** The holder the tool grant was issued to. */
15608
- holder_id: z13.string().min(1)
15915
+ holder_id: z14.string().min(1)
15609
15916
  }).strict();
15610
- var LeaseRevokedResponseSchema = z13.object({
15917
+ var LeaseRevokedResponseSchema = z14.object({
15611
15918
  /** Tag discriminating this response variant. */
15612
- kind: z13.literal("lease_revoked"),
15919
+ kind: z14.literal("lease_revoked"),
15613
15920
  /** The revoked cleo.db scope. */
15614
15921
  scope: LeaseScopeSchema,
15615
15922
  /** The revoked write lane. */
15616
15923
  lane: LeaseLaneSchema,
15617
15924
  /** The holder whose lease was revoked. */
15618
- holder_id: z13.string().min(1),
15925
+ holder_id: z14.string().min(1),
15619
15926
  /** Human-readable reason for the revocation. */
15620
- reason: z13.string()
15927
+ reason: z14.string()
15621
15928
  }).strict();
15622
- var ChildKilledUnresponsiveResponseSchema = z13.object({
15929
+ var ChildKilledUnresponsiveResponseSchema = z14.object({
15623
15930
  /** Tag discriminating this response variant. */
15624
- kind: z13.literal("child_killed_unresponsive"),
15931
+ kind: z14.literal("child_killed_unresponsive"),
15625
15932
  /** Logical id of the killed child. */
15626
- child_id: z13.string().min(1),
15933
+ child_id: z14.string().min(1),
15627
15934
  /** The holder identity the killed child held the lease as. */
15628
- holder_id: z13.string().min(1),
15935
+ holder_id: z14.string().min(1),
15629
15936
  /** The cleo.db scope the killed child held the lease in. */
15630
15937
  scope: LeaseScopeSchema,
15631
15938
  /** Human-readable reason for the kill. */
15632
- reason: z13.string()
15939
+ reason: z14.string()
15633
15940
  }).strict();
15634
- var QueueAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15635
- var QueueAdmitResultResponseSchema = z13.object({
15941
+ var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15942
+ var QueueAdmitResultResponseSchema = z14.object({
15636
15943
  /** Tag discriminating this response variant. */
15637
- kind: z13.literal("queue_admit_result"),
15944
+ kind: z14.literal("queue_admit_result"),
15638
15945
  /** Whether the LLM call was admitted or deferred. */
15639
15946
  disposition: QueueAdmitDispositionSchema,
15640
15947
  /** Back-off in ms before re-requesting (0 when admitted). */
15641
- retry_after_ms: z13.number().int().nonnegative(),
15948
+ retry_after_ms: z14.number().int().nonnegative(),
15642
15949
  /** Remaining provider token budget after this decision. */
15643
- tokens_remaining: z13.number().int().nonnegative(),
15950
+ tokens_remaining: z14.number().int().nonnegative(),
15644
15951
  /** Number of higher/equal-priority waiters ahead (0 when admitted). */
15645
- queue_position: z13.number().int().nonnegative()
15952
+ queue_position: z14.number().int().nonnegative()
15646
15953
  }).strict();
15647
- var HeartbeatAckResponseSchema = z13.object({
15954
+ var HeartbeatAckResponseSchema = z14.object({
15648
15955
  /** Tag discriminating this response variant. */
15649
- kind: z13.literal("heartbeat_ack")
15956
+ kind: z14.literal("heartbeat_ack")
15650
15957
  }).strict();
15651
- var ResourceAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15652
- var ResourceAdmitResultResponseSchema = z13.object({
15958
+ var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15959
+ var ResourceAdmitResultResponseSchema = z14.object({
15653
15960
  /** Tag discriminating this response variant. */
15654
- kind: z13.literal("resource_admit_result"),
15961
+ kind: z14.literal("resource_admit_result"),
15655
15962
  /** Whether the heavy op was admitted or deferred. */
15656
15963
  disposition: ResourceAdmitDispositionSchema,
15657
15964
  /** Back-off in ms before re-requesting (0 when admitted). */
15658
- retry_after_ms: z13.number().int().nonnegative(),
15965
+ retry_after_ms: z14.number().int().nonnegative(),
15659
15966
  /** Remaining slots for the class after this decision. */
15660
- slots_remaining: z13.number().int().nonnegative()
15967
+ slots_remaining: z14.number().int().nonnegative()
15661
15968
  }).strict();
15662
- var ResourceReleaseResultResponseSchema = z13.object({
15969
+ var ResourceReleaseResultResponseSchema = z14.object({
15663
15970
  /** Tag discriminating this response variant. */
15664
- kind: z13.literal("resource_release_result"),
15971
+ kind: z14.literal("resource_release_result"),
15665
15972
  /** Whether a held slot was actually released (false = no such holder). */
15666
- released: z13.boolean(),
15973
+ released: z14.boolean(),
15667
15974
  /** Remaining in-flight holders for the class after the release. */
15668
- slots_remaining: z13.number().int().nonnegative()
15975
+ slots_remaining: z14.number().int().nonnegative()
15669
15976
  }).strict();
15670
- var LeaseErrorResponseSchema = z13.object({
15977
+ var LeaseErrorResponseSchema = z14.object({
15671
15978
  /** Tag discriminating this response variant. */
15672
- kind: z13.literal("error"),
15979
+ kind: z14.literal("error"),
15673
15980
  /** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
15674
- code: z13.string().min(1),
15981
+ code: z14.string().min(1),
15675
15982
  /** Human-readable error message. */
15676
- message: z13.string()
15983
+ message: z14.string()
15677
15984
  }).strict();
15678
- var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15985
+ var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
15679
15986
  LeaseGrantedResponseSchema,
15680
15987
  LeaseQueuedResponseSchema,
15681
15988
  LeaseDeniedResponseSchema,
@@ -15689,27 +15996,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15689
15996
  ResourceReleaseResultResponseSchema,
15690
15997
  LeaseErrorResponseSchema
15691
15998
  ]);
15692
- var LeaseIpcRequestEnvelopeSchema = z13.object({
15999
+ var LeaseIpcRequestEnvelopeSchema = z14.object({
15693
16000
  /** Parallel protocol version. */
15694
- protocol_version: z13.string(),
16001
+ protocol_version: z14.string(),
15695
16002
  /** Correlation id echoed back on the matching response. */
15696
- id: z13.string().min(1),
16003
+ id: z14.string().min(1),
15697
16004
  /** Direction discriminator. */
15698
- direction: z13.literal("request"),
16005
+ direction: z14.literal("request"),
15699
16006
  /** The request body. */
15700
16007
  request: LeaseIpcRequestSchema
15701
16008
  }).strict();
15702
- var LeaseIpcResponseEnvelopeSchema = z13.object({
16009
+ var LeaseIpcResponseEnvelopeSchema = z14.object({
15703
16010
  /** Parallel protocol version. */
15704
- protocol_version: z13.string(),
16011
+ protocol_version: z14.string(),
15705
16012
  /** Correlation id echoed from the originating request (or a fresh id for events). */
15706
- id: z13.string().min(1),
16013
+ id: z14.string().min(1),
15707
16014
  /** Direction discriminator. */
15708
- direction: z13.literal("response"),
16015
+ direction: z14.literal("response"),
15709
16016
  /** The response body. */
15710
16017
  response: LeaseIpcResponseSchema
15711
16018
  }).strict();
15712
- var LeaseIpcEnvelopeSchema = z13.discriminatedUnion("direction", [
16019
+ var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
15713
16020
  LeaseIpcRequestEnvelopeSchema,
15714
16021
  LeaseIpcResponseEnvelopeSchema
15715
16022
  ]);
@@ -15744,7 +16051,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
15744
16051
  ];
15745
16052
 
15746
16053
  // packages/contracts/src/llm/catalog-schema.ts
15747
- import { z as z14 } from "zod";
16054
+ import { z as z15 } from "zod";
15748
16055
  var CATALOG_MODEL_STATUSES = [
15749
16056
  "stable",
15750
16057
  "beta",
@@ -15753,78 +16060,78 @@ var CATALOG_MODEL_STATUSES = [
15753
16060
  "retired"
15754
16061
  ];
15755
16062
  var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
15756
- var isoDate = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15757
- var semver = z14.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15758
- var catalogModalitiesSchema = z14.object({
15759
- input: z14.array(z14.string()),
15760
- output: z14.array(z14.string())
16063
+ var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
16064
+ var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
16065
+ var catalogModalitiesSchema = z15.object({
16066
+ input: z15.array(z15.string()),
16067
+ output: z15.array(z15.string())
15761
16068
  }).strict();
15762
- var catalogCostSchema = z14.object({
15763
- input: z14.number().optional(),
15764
- output: z14.number().optional(),
15765
- cache_read: z14.number().optional(),
15766
- cache_write: z14.number().optional(),
15767
- context_over_200k: z14.number().optional()
16069
+ var catalogCostSchema = z15.object({
16070
+ input: z15.number().optional(),
16071
+ output: z15.number().optional(),
16072
+ cache_read: z15.number().optional(),
16073
+ cache_write: z15.number().optional(),
16074
+ context_over_200k: z15.number().optional()
15768
16075
  }).strict();
15769
- var catalogLimitSchema = z14.object({
15770
- context: z14.number(),
15771
- output: z14.number()
16076
+ var catalogLimitSchema = z15.object({
16077
+ context: z15.number(),
16078
+ output: z15.number()
15772
16079
  }).strict();
15773
- var catalogModelProviderSchema = z14.object({
15774
- npm: z14.string(),
15775
- api: z14.string()
16080
+ var catalogModelProviderSchema = z15.object({
16081
+ npm: z15.string(),
16082
+ api: z15.string()
15776
16083
  }).strict();
15777
- var catalogModelEntrySchema = z14.object({
15778
- id: z14.string(),
15779
- name: z14.string(),
15780
- family: z14.string(),
15781
- attachment: z14.boolean(),
15782
- reasoning: z14.boolean(),
15783
- temperature: z14.boolean(),
15784
- interleaved: z14.boolean(),
15785
- tool_call: z14.boolean(),
16084
+ var catalogModelEntrySchema = z15.object({
16085
+ id: z15.string(),
16086
+ name: z15.string(),
16087
+ family: z15.string(),
16088
+ attachment: z15.boolean(),
16089
+ reasoning: z15.boolean(),
16090
+ temperature: z15.boolean(),
16091
+ interleaved: z15.boolean(),
16092
+ tool_call: z15.boolean(),
15786
16093
  modalities: catalogModalitiesSchema,
15787
16094
  cost: catalogCostSchema,
15788
16095
  limit: catalogLimitSchema,
15789
- status: z14.enum(CATALOG_MODEL_STATUSES),
16096
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15790
16097
  release_date: isoDate,
15791
16098
  provider: catalogModelProviderSchema
15792
16099
  }).strict();
15793
- var catalogProviderSchema = z14.object({
15794
- id: z14.string(),
15795
- endpoint: z14.string(),
15796
- authTypes: z14.array(z14.enum(CATALOG_AUTH_TYPES)).min(1),
15797
- npm: z14.string().optional()
16100
+ var catalogProviderSchema = z15.object({
16101
+ id: z15.string(),
16102
+ endpoint: z15.string(),
16103
+ authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
16104
+ npm: z15.string().optional()
15798
16105
  }).strict();
15799
- var curatedCatalogSchema = z14.object({
15800
- $schema: z14.string().optional(),
16106
+ var curatedCatalogSchema = z15.object({
16107
+ $schema: z15.string().optional(),
15801
16108
  version: semver,
15802
16109
  lastUpdated: isoDate,
15803
- providers: z14.record(z14.string(), catalogProviderSchema),
15804
- models: z14.record(z14.string(), z14.record(z14.string(), catalogModelEntrySchema))
16110
+ providers: z15.record(z15.string(), catalogProviderSchema),
16111
+ models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
15805
16112
  }).strict();
15806
- var modelsCatalogRowInsertSchema = z14.object({
15807
- id: z14.string(),
15808
- providerId: z14.string(),
15809
- name: z14.string(),
15810
- family: z14.string(),
15811
- attachment: z14.boolean(),
15812
- reasoning: z14.boolean(),
15813
- temperature: z14.boolean(),
15814
- interleaved: z14.boolean(),
15815
- toolCall: z14.boolean(),
15816
- modalities: z14.string(),
15817
- cost: z14.string(),
15818
- contextLimit: z14.number().nullable().optional(),
15819
- outputLimit: z14.number().nullable().optional(),
15820
- status: z14.enum(CATALOG_MODEL_STATUSES),
16113
+ var modelsCatalogRowInsertSchema = z15.object({
16114
+ id: z15.string(),
16115
+ providerId: z15.string(),
16116
+ name: z15.string(),
16117
+ family: z15.string(),
16118
+ attachment: z15.boolean(),
16119
+ reasoning: z15.boolean(),
16120
+ temperature: z15.boolean(),
16121
+ interleaved: z15.boolean(),
16122
+ toolCall: z15.boolean(),
16123
+ modalities: z15.string(),
16124
+ cost: z15.string(),
16125
+ contextLimit: z15.number().nullable().optional(),
16126
+ outputLimit: z15.number().nullable().optional(),
16127
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15821
16128
  releaseDate: isoDate,
15822
- modelsDevId: z14.string(),
15823
- source: z14.string(),
15824
- seededAt: z14.string().optional()
16129
+ modelsDevId: z15.string(),
16130
+ source: z15.string(),
16131
+ seededAt: z15.string().optional()
15825
16132
  }).strict();
15826
16133
  var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
15827
- seededAt: z14.string()
16134
+ seededAt: z15.string()
15828
16135
  });
15829
16136
 
15830
16137
  // packages/contracts/src/llm/system-of-use.ts
@@ -15872,7 +16179,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
15872
16179
  ];
15873
16180
 
15874
16181
  // packages/contracts/src/workgraph.ts
15875
- import { z as z15 } from "zod";
16182
+ import { z as z16 } from "zod";
15876
16183
 
15877
16184
  // packages/contracts/src/status-registry.ts
15878
16185
  var TASK_STATUSES = [
@@ -15887,10 +16194,10 @@ var TASK_STATUSES = [
15887
16194
 
15888
16195
  // packages/contracts/src/workgraph.ts
15889
16196
  var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
15890
- var taskTypeSchema = z15.enum(["saga", "epic", "task", "subtask"]);
15891
- var taskPrioritySchema = z15.enum(["critical", "high", "medium", "low"]);
15892
- var taskStatusSchema = z15.enum(TASK_STATUSES);
15893
- var verificationGateSchema = z15.enum([
16197
+ var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
16198
+ var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
16199
+ var taskStatusSchema = z16.enum(TASK_STATUSES);
16200
+ var verificationGateSchema = z16.enum([
15894
16201
  "implemented",
15895
16202
  "testsPassed",
15896
16203
  "qaPassed",
@@ -15899,7 +16206,7 @@ var verificationGateSchema = z15.enum([
15899
16206
  "documented",
15900
16207
  "nexusImpact"
15901
16208
  ]);
15902
- var workGraphRelationKindSchema = z15.enum([
16209
+ var workGraphRelationKindSchema = z16.enum([
15903
16210
  "contains",
15904
16211
  "depends_on",
15905
16212
  "blocks",
@@ -15907,317 +16214,317 @@ var workGraphRelationKindSchema = z15.enum([
15907
16214
  "groups",
15908
16215
  "satisfies"
15909
16216
  ]);
15910
- var workGraphTraversalDirectionSchema = z15.enum([
16217
+ var workGraphTraversalDirectionSchema = z16.enum([
15911
16218
  "ancestors",
15912
16219
  "descendants",
15913
16220
  "upstream",
15914
16221
  "downstream"
15915
16222
  ]);
15916
- var workGraphEdgeDirectionSchema = z15.enum(["out", "in", "both"]);
15917
- var paginationParamsSchema = z15.object({
15918
- cursor: z15.string().min(1).optional(),
15919
- limit: z15.number().int().positive().max(500).optional()
16223
+ var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
16224
+ var paginationParamsSchema = z16.object({
16225
+ cursor: z16.string().min(1).optional(),
16226
+ limit: z16.number().int().positive().max(500).optional()
15920
16227
  });
15921
- var workGraphNodeSchema = z15.object({
15922
- id: z15.string().min(1),
16228
+ var workGraphNodeSchema = z16.object({
16229
+ id: z16.string().min(1),
15923
16230
  type: taskTypeSchema,
15924
- title: z15.string(),
16231
+ title: z16.string(),
15925
16232
  status: taskStatusSchema,
15926
16233
  priority: taskPrioritySchema,
15927
- parentId: z15.string().min(1).optional()
16234
+ parentId: z16.string().min(1).optional()
15928
16235
  });
15929
- var workGraphEdgeSchema = z15.object({
15930
- fromId: z15.string().min(1),
15931
- toId: z15.string().min(1),
16236
+ var workGraphEdgeSchema = z16.object({
16237
+ fromId: z16.string().min(1),
16238
+ toId: z16.string().min(1),
15932
16239
  kind: workGraphRelationKindSchema
15933
16240
  });
15934
- var workGraphHierarchyEdgeSchema = z15.object({
15935
- fromId: z15.string().min(1),
15936
- toId: z15.string().min(1),
15937
- kind: z15.literal("contains")
16241
+ var workGraphHierarchyEdgeSchema = z16.object({
16242
+ fromId: z16.string().min(1),
16243
+ toId: z16.string().min(1),
16244
+ kind: z16.literal("contains")
15938
16245
  }).strict();
15939
- var workGraphPageInfoSchema = z15.object({
15940
- nextCursor: z15.string().min(1).optional(),
15941
- hasMore: z15.boolean()
16246
+ var workGraphPageInfoSchema = z16.object({
16247
+ nextCursor: z16.string().min(1).optional(),
16248
+ hasMore: z16.boolean()
15942
16249
  });
15943
- var workGraphRollupCountsSchema = z15.object({
15944
- total: z15.number().int().nonnegative(),
15945
- byStatus: z15.partialRecord(taskStatusSchema, z15.number().int().nonnegative()),
15946
- byType: z15.partialRecord(taskTypeSchema, z15.number().int().nonnegative())
16250
+ var workGraphRollupCountsSchema = z16.object({
16251
+ total: z16.number().int().nonnegative(),
16252
+ byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
16253
+ byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
15947
16254
  });
15948
- var workGraphSubtreePercentagesSchema = z15.object({
15949
- done: z15.number().nonnegative(),
15950
- active: z15.number().nonnegative(),
15951
- blocked: z15.number().nonnegative(),
15952
- pending: z15.number().nonnegative(),
15953
- cancelled: z15.number().nonnegative()
16255
+ var workGraphSubtreePercentagesSchema = z16.object({
16256
+ done: z16.number().nonnegative(),
16257
+ active: z16.number().nonnegative(),
16258
+ blocked: z16.number().nonnegative(),
16259
+ pending: z16.number().nonnegative(),
16260
+ cancelled: z16.number().nonnegative()
15954
16261
  });
15955
- var workGraphProjectionMismatchSchema = z15.object({
15956
- field: z15.string().min(1),
15957
- expected: z15.number().int().nonnegative(),
15958
- actual: z15.number().int().nonnegative()
16262
+ var workGraphProjectionMismatchSchema = z16.object({
16263
+ field: z16.string().min(1),
16264
+ expected: z16.number().int().nonnegative(),
16265
+ actual: z16.number().int().nonnegative()
15959
16266
  });
15960
16267
  var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
15961
- role: z15.string().min(1).optional(),
15962
- dependencyBlockers: z15.array(z15.object({ taskId: z15.string().min(1), status: taskStatusSchema })),
15963
- gateBlockers: z15.array(z15.object({ gate: verificationGateSchema }))
16268
+ role: z16.string().min(1).optional(),
16269
+ dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
16270
+ gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
15964
16271
  });
15965
16272
  var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
15966
- source: z15.literal("relation"),
15967
- relationType: z15.enum(TASK_RELATION_TYPES),
15968
- reason: z15.string().min(1).optional()
16273
+ source: z16.literal("relation"),
16274
+ relationType: z16.enum(TASK_RELATION_TYPES),
16275
+ reason: z16.string().min(1).optional()
15969
16276
  });
15970
16277
  var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
15971
- source: z15.literal("dependency"),
15972
- kind: z15.literal("depends_on")
16278
+ source: z16.literal("dependency"),
16279
+ kind: z16.literal("depends_on")
15973
16280
  });
15974
- var workGraphOmissionReasonSchema = z15.enum([
16281
+ var workGraphOmissionReasonSchema = z16.enum([
15975
16282
  "budget_exceeded",
15976
16283
  "not_requested",
15977
16284
  "not_available",
15978
16285
  "redacted",
15979
16286
  "truncated"
15980
16287
  ]);
15981
- var workGraphContextBudgetSchema = z15.object({
15982
- tokenBudget: z15.number().int().nonnegative(),
15983
- estimatedTokens: z15.number().int().nonnegative(),
15984
- remainingTokens: z15.number().int().nonnegative(),
15985
- truncated: z15.boolean()
16288
+ var workGraphContextBudgetSchema = z16.object({
16289
+ tokenBudget: z16.number().int().nonnegative(),
16290
+ estimatedTokens: z16.number().int().nonnegative(),
16291
+ remainingTokens: z16.number().int().nonnegative(),
16292
+ truncated: z16.boolean()
15986
16293
  });
15987
- var workGraphOmissionSchema = z15.object({
15988
- path: z15.string().min(1),
16294
+ var workGraphOmissionSchema = z16.object({
16295
+ path: z16.string().min(1),
15989
16296
  reason: workGraphOmissionReasonSchema,
15990
- message: z15.string().min(1),
15991
- estimatedTokens: z15.number().int().nonnegative().optional()
16297
+ message: z16.string().min(1),
16298
+ estimatedTokens: z16.number().int().nonnegative().optional()
15992
16299
  });
15993
- var workGraphDirectEdgeSchema = z15.discriminatedUnion("source", [
16300
+ var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
15994
16301
  workGraphRelationEdgeSchema,
15995
16302
  workGraphDependencyEdgeSchema
15996
16303
  ]);
15997
16304
  var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
15998
- rootId: z15.string().min(1),
15999
- tokenBudget: z15.number().int().positive().optional(),
16000
- includeRelations: z15.boolean().optional(),
16001
- includeReadiness: z15.boolean().optional(),
16002
- includeRollup: z15.boolean().optional()
16305
+ rootId: z16.string().min(1),
16306
+ tokenBudget: z16.number().int().positive().optional(),
16307
+ includeRelations: z16.boolean().optional(),
16308
+ includeReadiness: z16.boolean().optional(),
16309
+ includeRollup: z16.boolean().optional()
16003
16310
  });
16004
16311
  var workGraphSliceParamsSchema = paginationParamsSchema.extend({
16005
- rootId: z15.string().min(1),
16312
+ rootId: z16.string().min(1),
16006
16313
  direction: workGraphTraversalDirectionSchema.optional(),
16007
- maxDepth: z15.number().int().nonnegative().optional(),
16008
- includeRelations: z15.boolean().optional()
16314
+ maxDepth: z16.number().int().nonnegative().optional(),
16315
+ includeRelations: z16.boolean().optional()
16009
16316
  });
16010
- var workGraphSliceSchema = z15.object({
16011
- rootId: z15.string().min(1),
16317
+ var workGraphSliceSchema = z16.object({
16318
+ rootId: z16.string().min(1),
16012
16319
  direction: workGraphTraversalDirectionSchema,
16013
- nodes: z15.array(workGraphNodeSchema),
16014
- edges: z15.array(workGraphEdgeSchema),
16320
+ nodes: z16.array(workGraphNodeSchema),
16321
+ edges: z16.array(workGraphEdgeSchema),
16015
16322
  pageInfo: workGraphPageInfoSchema,
16016
- omissions: z15.array(workGraphOmissionSchema).optional()
16323
+ omissions: z16.array(workGraphOmissionSchema).optional()
16017
16324
  });
16018
- var workGraphReadinessParamsSchema = z15.object({
16019
- rootId: z15.string().min(1),
16020
- role: z15.string().min(1).optional(),
16021
- includeGateBlockers: z15.boolean().optional()
16325
+ var workGraphReadinessParamsSchema = z16.object({
16326
+ rootId: z16.string().min(1),
16327
+ role: z16.string().min(1).optional(),
16328
+ includeGateBlockers: z16.boolean().optional()
16022
16329
  });
16023
- var workGraphReadinessResultSchema = z15.object({
16024
- rootId: z15.string().min(1),
16025
- role: z15.string().min(1).optional(),
16026
- ready: z15.boolean(),
16027
- warnings: z15.array(z15.string()),
16028
- groups: z15.object({
16029
- ready: z15.array(workGraphReadyFrontierTaskSchema),
16030
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
16031
- blockedBy: z15.array(
16032
- z15.discriminatedUnion("kind", [
16033
- z15.object({
16034
- kind: z15.literal("dependency"),
16035
- blockerId: z15.string().min(1),
16036
- blocks: z15.array(z15.string().min(1))
16330
+ var workGraphReadinessResultSchema = z16.object({
16331
+ rootId: z16.string().min(1),
16332
+ role: z16.string().min(1).optional(),
16333
+ ready: z16.boolean(),
16334
+ warnings: z16.array(z16.string()),
16335
+ groups: z16.object({
16336
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16337
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16338
+ blockedBy: z16.array(
16339
+ z16.discriminatedUnion("kind", [
16340
+ z16.object({
16341
+ kind: z16.literal("dependency"),
16342
+ blockerId: z16.string().min(1),
16343
+ blocks: z16.array(z16.string().min(1))
16037
16344
  }),
16038
- z15.object({
16039
- kind: z15.literal("gate"),
16345
+ z16.object({
16346
+ kind: z16.literal("gate"),
16040
16347
  gate: verificationGateSchema,
16041
- blocks: z15.array(z15.string().min(1))
16348
+ blocks: z16.array(z16.string().min(1))
16042
16349
  })
16043
16350
  ])
16044
16351
  )
16045
16352
  })
16046
16353
  });
16047
- var workGraphContextPackSchema = z15.object({
16048
- rootId: z15.string().min(1),
16049
- generatedAt: z15.string().min(1),
16354
+ var workGraphContextPackSchema = z16.object({
16355
+ rootId: z16.string().min(1),
16356
+ generatedAt: z16.string().min(1),
16050
16357
  budget: workGraphContextBudgetSchema,
16051
16358
  slice: workGraphSliceSchema,
16052
- relationEdges: z15.object({
16053
- rootId: z15.string().min(1),
16359
+ relationEdges: z16.object({
16360
+ rootId: z16.string().min(1),
16054
16361
  direction: workGraphEdgeDirectionSchema,
16055
- edges: z15.array(workGraphDirectEdgeSchema)
16362
+ edges: z16.array(workGraphDirectEdgeSchema)
16056
16363
  }).optional(),
16057
16364
  readiness: workGraphReadinessResultSchema.optional(),
16058
- rollup: z15.lazy(() => tasksRollupResultSchema).optional(),
16059
- omissions: z15.array(workGraphOmissionSchema)
16365
+ rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
16366
+ omissions: z16.array(workGraphOmissionSchema)
16060
16367
  });
16061
- var workGraphScaffoldValidateParamsSchema = z15.object({
16062
- rootId: z15.string().min(1),
16063
- nodes: z15.array(
16064
- z15.object({
16065
- id: z15.string().min(1),
16368
+ var workGraphScaffoldValidateParamsSchema = z16.object({
16369
+ rootId: z16.string().min(1),
16370
+ nodes: z16.array(
16371
+ z16.object({
16372
+ id: z16.string().min(1),
16066
16373
  type: taskTypeSchema,
16067
- parentId: z15.string().min(1).nullable().optional()
16374
+ parentId: z16.string().min(1).nullable().optional()
16068
16375
  })
16069
16376
  ),
16070
- edges: z15.array(workGraphDirectEdgeSchema).optional(),
16071
- dryRun: z15.boolean().optional()
16377
+ edges: z16.array(workGraphDirectEdgeSchema).optional(),
16378
+ dryRun: z16.boolean().optional()
16072
16379
  });
16073
- var workGraphScaffoldValidationIssueSchema = z15.object({
16074
- code: z15.string().min(1),
16075
- message: z15.string().min(1),
16076
- taskId: z15.string().min(1).optional(),
16077
- severity: z15.enum(["error", "warning"])
16380
+ var workGraphScaffoldValidationIssueSchema = z16.object({
16381
+ code: z16.string().min(1),
16382
+ message: z16.string().min(1),
16383
+ taskId: z16.string().min(1).optional(),
16384
+ severity: z16.enum(["error", "warning"])
16078
16385
  });
16079
- var workGraphScaffoldValidateResultSchema = z15.object({
16080
- rootId: z15.string().min(1),
16081
- valid: z15.boolean(),
16082
- dryRun: z15.boolean(),
16083
- issues: z15.array(workGraphScaffoldValidationIssueSchema),
16084
- hierarchy: z15.object({
16085
- valid: z15.boolean(),
16086
- violations: z15.array(
16087
- z15.object({
16088
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16089
- taskId: z15.string().min(1),
16386
+ var workGraphScaffoldValidateResultSchema = z16.object({
16387
+ rootId: z16.string().min(1),
16388
+ valid: z16.boolean(),
16389
+ dryRun: z16.boolean(),
16390
+ issues: z16.array(workGraphScaffoldValidationIssueSchema),
16391
+ hierarchy: z16.object({
16392
+ valid: z16.boolean(),
16393
+ violations: z16.array(
16394
+ z16.object({
16395
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16396
+ taskId: z16.string().min(1),
16090
16397
  taskType: taskTypeSchema,
16091
- parentId: z15.string().min(1).nullable(),
16398
+ parentId: z16.string().min(1).nullable(),
16092
16399
  parentType: taskTypeSchema.optional(),
16093
- message: z15.string().min(1)
16400
+ message: z16.string().min(1)
16094
16401
  })
16095
16402
  )
16096
16403
  })
16097
16404
  });
16098
16405
  var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
16099
- apply: z15.boolean().optional()
16406
+ apply: z16.boolean().optional()
16100
16407
  });
16101
16408
  var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
16102
- applied: z15.boolean(),
16103
- nodesChanged: z15.number().int().nonnegative(),
16104
- edgesChanged: z15.number().int().nonnegative()
16409
+ applied: z16.boolean(),
16410
+ nodesChanged: z16.number().int().nonnegative(),
16411
+ edgesChanged: z16.number().int().nonnegative()
16105
16412
  });
16106
- var workGraphPlanningDocParamsSchema = z15.object({
16107
- rootId: z15.string().min(1),
16108
- audience: z15.enum(["agent", "maintainer"]),
16109
- tokenBudget: z15.number().int().positive().optional(),
16110
- includeRelations: z15.boolean().optional(),
16111
- includeReadiness: z15.boolean().optional(),
16112
- includeRollup: z15.boolean().optional()
16413
+ var workGraphPlanningDocParamsSchema = z16.object({
16414
+ rootId: z16.string().min(1),
16415
+ audience: z16.enum(["agent", "maintainer"]),
16416
+ tokenBudget: z16.number().int().positive().optional(),
16417
+ includeRelations: z16.boolean().optional(),
16418
+ includeReadiness: z16.boolean().optional(),
16419
+ includeRollup: z16.boolean().optional()
16113
16420
  });
16114
- var workGraphPlanningDocSchema = z15.object({
16115
- rootId: z15.string().min(1),
16116
- generatedAt: z15.string().min(1),
16117
- audience: z15.enum(["agent", "maintainer"]),
16118
- title: z15.string().min(1),
16119
- content: z15.string(),
16120
- sections: z15.array(z15.string().min(1)),
16121
- estimatedTokens: z15.number().int().nonnegative(),
16122
- budget: z15.object({
16123
- tokenBudget: z15.number().int().positive(),
16124
- truncated: z15.boolean()
16421
+ var workGraphPlanningDocSchema = z16.object({
16422
+ rootId: z16.string().min(1),
16423
+ generatedAt: z16.string().min(1),
16424
+ audience: z16.enum(["agent", "maintainer"]),
16425
+ title: z16.string().min(1),
16426
+ content: z16.string(),
16427
+ sections: z16.array(z16.string().min(1)),
16428
+ estimatedTokens: z16.number().int().nonnegative(),
16429
+ budget: z16.object({
16430
+ tokenBudget: z16.number().int().positive(),
16431
+ truncated: z16.boolean()
16125
16432
  }).optional()
16126
16433
  });
16127
16434
  var tasksTraverseParamsSchema = paginationParamsSchema.extend({
16128
- rootId: z15.string().min(1),
16435
+ rootId: z16.string().min(1),
16129
16436
  direction: workGraphTraversalDirectionSchema,
16130
- maxDepth: z15.number().int().nonnegative().optional(),
16131
- includeRelations: z15.boolean().optional()
16437
+ maxDepth: z16.number().int().nonnegative().optional(),
16438
+ includeRelations: z16.boolean().optional()
16132
16439
  });
16133
- var tasksTraverseResultSchema = z15.object({
16134
- rootId: z15.string().min(1),
16440
+ var tasksTraverseResultSchema = z16.object({
16441
+ rootId: z16.string().min(1),
16135
16442
  direction: workGraphTraversalDirectionSchema,
16136
- nodes: z15.array(workGraphNodeSchema),
16137
- edges: z15.array(workGraphEdgeSchema),
16443
+ nodes: z16.array(workGraphNodeSchema),
16444
+ edges: z16.array(workGraphEdgeSchema),
16138
16445
  pageInfo: workGraphPageInfoSchema
16139
16446
  });
16140
16447
  var tasksTreeParamsSchema = paginationParamsSchema.extend({
16141
- rootId: z15.string().min(1),
16142
- maxDepth: z15.number().int().nonnegative().optional()
16448
+ rootId: z16.string().min(1),
16449
+ maxDepth: z16.number().int().nonnegative().optional()
16143
16450
  });
16144
- var tasksTreeResultSchema = z15.object({
16145
- rootId: z15.string().min(1),
16146
- nodes: z15.array(workGraphNodeSchema.extend({ depth: z15.number().int().positive() })),
16147
- edges: z15.array(workGraphHierarchyEdgeSchema),
16451
+ var tasksTreeResultSchema = z16.object({
16452
+ rootId: z16.string().min(1),
16453
+ nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
16454
+ edges: z16.array(workGraphHierarchyEdgeSchema),
16148
16455
  pageInfo: workGraphPageInfoSchema
16149
16456
  });
16150
- var tasksRollupParamsSchema = z15.object({
16151
- rootId: z15.string().min(1),
16457
+ var tasksRollupParamsSchema = z16.object({
16458
+ rootId: z16.string().min(1),
16152
16459
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
16153
16460
  });
16154
- var tasksRollupResultSchema = z15.object({
16155
- rootId: z15.string().min(1),
16461
+ var tasksRollupResultSchema = z16.object({
16462
+ rootId: z16.string().min(1),
16156
16463
  direct: workGraphRollupCountsSchema,
16157
16464
  subtree: workGraphRollupCountsSchema,
16158
- percentDenominator: z15.object({
16159
- basis: z15.literal("subtree-total"),
16160
- total: z15.number().int().nonnegative(),
16161
- description: z15.string().min(1)
16465
+ percentDenominator: z16.object({
16466
+ basis: z16.literal("subtree-total"),
16467
+ total: z16.number().int().nonnegative(),
16468
+ description: z16.string().min(1)
16162
16469
  }),
16163
16470
  percentages: workGraphSubtreePercentagesSchema,
16164
- staleProjection: z15.boolean(),
16165
- projectionMismatches: z15.array(workGraphProjectionMismatchSchema)
16471
+ staleProjection: z16.boolean(),
16472
+ projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
16166
16473
  });
16167
- var tasksFrontierParamsSchema = z15.object({
16168
- rootId: z15.string().min(1),
16169
- role: z15.string().min(1).optional()
16474
+ var tasksFrontierParamsSchema = z16.object({
16475
+ rootId: z16.string().min(1),
16476
+ role: z16.string().min(1).optional()
16170
16477
  });
16171
- var tasksFrontierResultSchema = z15.object({
16172
- rootId: z15.string().min(1),
16173
- role: z15.string().min(1).optional(),
16174
- groups: z15.object({
16175
- ready: z15.array(workGraphReadyFrontierTaskSchema),
16176
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
16177
- blockedBy: z15.array(
16178
- z15.discriminatedUnion("kind", [
16179
- z15.object({
16180
- kind: z15.literal("dependency"),
16181
- blockerId: z15.string().min(1),
16182
- blocks: z15.array(z15.string().min(1))
16478
+ var tasksFrontierResultSchema = z16.object({
16479
+ rootId: z16.string().min(1),
16480
+ role: z16.string().min(1).optional(),
16481
+ groups: z16.object({
16482
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16483
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16484
+ blockedBy: z16.array(
16485
+ z16.discriminatedUnion("kind", [
16486
+ z16.object({
16487
+ kind: z16.literal("dependency"),
16488
+ blockerId: z16.string().min(1),
16489
+ blocks: z16.array(z16.string().min(1))
16183
16490
  }),
16184
- z15.object({
16185
- kind: z15.literal("gate"),
16491
+ z16.object({
16492
+ kind: z16.literal("gate"),
16186
16493
  gate: verificationGateSchema,
16187
- blocks: z15.array(z15.string().min(1))
16494
+ blocks: z16.array(z16.string().min(1))
16188
16495
  })
16189
16496
  ])
16190
16497
  )
16191
16498
  })
16192
16499
  });
16193
16500
  var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
16194
- rootId: z15.string().min(1),
16195
- maxDepth: z15.number().int().nonnegative().optional(),
16196
- includeRelations: z15.boolean().optional()
16501
+ rootId: z16.string().min(1),
16502
+ maxDepth: z16.number().int().nonnegative().optional(),
16503
+ includeRelations: z16.boolean().optional()
16197
16504
  });
16198
- var tasksWorkGraphAuditResultSchema = z15.object({
16199
- rootId: z15.string().min(1),
16200
- hierarchy: z15.object({
16201
- valid: z15.boolean(),
16202
- violations: z15.array(
16203
- z15.object({
16204
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16205
- taskId: z15.string().min(1),
16505
+ var tasksWorkGraphAuditResultSchema = z16.object({
16506
+ rootId: z16.string().min(1),
16507
+ hierarchy: z16.object({
16508
+ valid: z16.boolean(),
16509
+ violations: z16.array(
16510
+ z16.object({
16511
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16512
+ taskId: z16.string().min(1),
16206
16513
  taskType: taskTypeSchema,
16207
- parentId: z15.string().min(1).nullable(),
16514
+ parentId: z16.string().min(1).nullable(),
16208
16515
  parentType: taskTypeSchema.optional(),
16209
- message: z15.string().min(1)
16516
+ message: z16.string().min(1)
16210
16517
  })
16211
16518
  )
16212
16519
  }),
16213
16520
  traversal: tasksTraverseResultSchema,
16214
16521
  frontier: tasksFrontierResultSchema,
16215
16522
  rollup: tasksRollupResultSchema,
16216
- relationEdges: z15.object({
16217
- rootId: z15.string().min(1),
16523
+ relationEdges: z16.object({
16524
+ rootId: z16.string().min(1),
16218
16525
  direction: workGraphEdgeDirectionSchema,
16219
- edges: z15.array(
16220
- z15.discriminatedUnion("source", [
16526
+ edges: z16.array(
16527
+ z16.discriminatedUnion("source", [
16221
16528
  workGraphRelationEdgeSchema,
16222
16529
  workGraphDependencyEdgeSchema
16223
16530
  ])
@@ -16226,60 +16533,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
16226
16533
  });
16227
16534
 
16228
16535
  // packages/contracts/src/operations/docs.ts
16229
- import { z as z16 } from "zod";
16230
- var DOCS_PROJECTION_PROPOSAL_SCHEMA = z16.object({
16231
- version: z16.literal(1),
16232
- operation: z16.literal("docs.projection"),
16233
- identity: z16.object({
16234
- projectId: z16.string().min(1),
16235
- projectRoot: z16.string().min(1),
16236
- actor: z16.string().min(1),
16237
- operation: z16.literal("docs.projection"),
16238
- idempotencyKey: z16.string().min(1)
16536
+ import { z as z17 } from "zod";
16537
+ var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
16538
+ version: z17.literal(1),
16539
+ operation: z17.literal("docs.projection"),
16540
+ identity: z17.object({
16541
+ projectId: z17.string().min(1),
16542
+ projectRoot: z17.string().min(1),
16543
+ actor: z17.string().min(1),
16544
+ operation: z17.literal("docs.projection"),
16545
+ idempotencyKey: z17.string().min(1)
16239
16546
  }).strict(),
16240
- source: z16.object({
16241
- attachmentId: z16.string().min(1),
16242
- sha256: z16.string().regex(/^[a-f0-9]{64}$/),
16243
- ownerId: z16.string().min(1),
16244
- ownerType: z16.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
16245
- label: z16.string().min(1)
16547
+ source: z17.object({
16548
+ attachmentId: z17.string().min(1),
16549
+ sha256: z17.string().regex(/^[a-f0-9]{64}$/),
16550
+ ownerId: z17.string().min(1),
16551
+ ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
16552
+ label: z17.string().min(1)
16246
16553
  }).strict(),
16247
- observation: z16.object({
16248
- kind: z16.literal("doc-attachment"),
16249
- attachmentId: z16.string().min(1),
16250
- ownerId: z16.string().min(1),
16251
- addedAt: z16.string().min(1),
16252
- slug: z16.string().optional(),
16253
- type: z16.string().optional()
16554
+ observation: z17.object({
16555
+ kind: z17.literal("doc-attachment"),
16556
+ attachmentId: z17.string().min(1),
16557
+ ownerId: z17.string().min(1),
16558
+ addedAt: z17.string().min(1),
16559
+ slug: z17.string().optional(),
16560
+ type: z17.string().optional()
16254
16561
  }).strict()
16255
16562
  }).strict();
16256
- var DOCS_PROJECTION_RECEIPT_SCHEMA = z16.object({
16257
- version: z16.literal(1),
16258
- sourceHash: z16.string().regex(/^[a-f0-9]{64}$/),
16259
- graph: z16.enum(["completed", "disabled"]),
16563
+ var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
16564
+ version: z17.literal(1),
16565
+ sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
16566
+ graph: z17.enum(["completed", "disabled"]),
16260
16567
  /** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
16261
- observationId: z16.string().min(1).optional(),
16568
+ observationId: z17.string().min(1).optional(),
16262
16569
  /** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
16263
- documents: z16.literal(true).optional(),
16264
- verifiedAt: z16.string().min(1),
16265
- actor: z16.string().min(1)
16570
+ documents: z17.literal(true).optional(),
16571
+ verifiedAt: z17.string().min(1),
16572
+ actor: z17.string().min(1)
16266
16573
  }).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
16267
16574
  message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
16268
16575
  });
16269
16576
 
16270
16577
  // packages/contracts/src/operations/ensures-schema-registry.ts
16271
- import { z as z17 } from "zod";
16272
- var taskTreeEntrySchema = z17.object({
16273
- title: z17.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
16274
- acceptance: z17.array(z17.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), {
16578
+ import { z as z18 } from "zod";
16579
+ var taskTreeEntrySchema = z18.object({
16580
+ 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" }),
16581
+ 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), {
16275
16582
  message: "acceptance array contains no non-empty strings"
16276
16583
  }),
16277
- id: z17.string().optional(),
16278
- parentId: z17.string().optional(),
16279
- depends: z17.array(z17.string()).optional()
16584
+ id: z18.string().optional(),
16585
+ parentId: z18.string().optional(),
16586
+ depends: z18.array(z18.string()).optional()
16280
16587
  });
16281
- var taskTreeSchema = z17.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" });
16282
- var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16588
+ 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" });
16589
+ var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
16283
16590
  if (value === null || value === void 0) {
16284
16591
  ctx.addIssue({
16285
16592
  code: "custom",
@@ -16313,7 +16620,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16313
16620
  message: `evidence must be a string, array, or object (got ${typeof value})`
16314
16621
  });
16315
16622
  });
16316
- var passthroughSchema = z17.unknown();
16623
+ var passthroughSchema = z18.unknown();
16317
16624
  var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
16318
16625
  // release.cantbook
16319
16626
  "version_bump_report",
@@ -16346,44 +16653,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
16346
16653
  var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
16347
16654
 
16348
16655
  // packages/contracts/src/release/evidence-atoms.ts
16349
- import { z as z18 } from "zod";
16350
- var parsedPrEvidenceAtomSchema = z18.object({
16351
- kind: z18.literal("pr"),
16352
- prNumber: z18.number().int().positive()
16656
+ import { z as z19 } from "zod";
16657
+ var parsedPrEvidenceAtomSchema = z19.object({
16658
+ kind: z19.literal("pr"),
16659
+ prNumber: z19.number().int().positive()
16353
16660
  });
16354
- var prEvidenceStateModifierSchema = z18.object({
16355
- kind: z18.literal("state"),
16356
- value: z18.literal("MERGED")
16661
+ var prEvidenceStateModifierSchema = z19.object({
16662
+ kind: z19.literal("state"),
16663
+ value: z19.literal("MERGED")
16357
16664
  });
16358
- var ghPrViewSchema = z18.object({
16359
- state: z18.enum(["OPEN", "CLOSED", "MERGED"]),
16360
- mergedAt: z18.string().nullable(),
16361
- headRefOid: z18.string().optional(),
16362
- mergeCommit: z18.object({ oid: z18.string() }).nullable().optional(),
16363
- title: z18.string().optional(),
16364
- body: z18.string().optional(),
16365
- headRefName: z18.string().optional(),
16366
- files: z18.array(z18.object({ path: z18.string() })).optional(),
16367
- changedFiles: z18.number().int().nonnegative().optional(),
16368
- mergeable: z18.string().optional(),
16369
- statusCheckRollup: z18.array(
16370
- z18.object({
16371
- __typename: z18.string().optional(),
16372
- name: z18.string().optional(),
16373
- workflowName: z18.string().optional(),
16374
- conclusion: z18.string().nullable().optional(),
16375
- status: z18.string().optional(),
16665
+ var ghPrViewSchema = z19.object({
16666
+ state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
16667
+ mergedAt: z19.string().nullable(),
16668
+ headRefOid: z19.string().optional(),
16669
+ mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
16670
+ title: z19.string().optional(),
16671
+ body: z19.string().optional(),
16672
+ headRefName: z19.string().optional(),
16673
+ files: z19.array(z19.object({ path: z19.string() })).optional(),
16674
+ changedFiles: z19.number().int().nonnegative().optional(),
16675
+ mergeable: z19.string().optional(),
16676
+ statusCheckRollup: z19.array(
16677
+ z19.object({
16678
+ __typename: z19.string().optional(),
16679
+ name: z19.string().optional(),
16680
+ workflowName: z19.string().optional(),
16681
+ conclusion: z19.string().nullable().optional(),
16682
+ status: z19.string().optional(),
16376
16683
  /** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
16377
- startedAt: z18.string().nullable().optional(),
16684
+ startedAt: z19.string().nullable().optional(),
16378
16685
  /** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
16379
- completedAt: z18.string().nullable().optional()
16686
+ completedAt: z19.string().nullable().optional()
16380
16687
  }).passthrough()
16381
16688
  ).optional().default([])
16382
16689
  }).passthrough();
16383
16690
  var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
16384
16691
 
16385
16692
  // packages/contracts/src/release/plan.ts
16386
- import { z as z19 } from "zod";
16693
+ import { z as z20 } from "zod";
16387
16694
  var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
16388
16695
  var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
16389
16696
  var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
@@ -16427,20 +16734,20 @@ var RESOLVED_SOURCE = [
16427
16734
  "language-default",
16428
16735
  "legacy-alias"
16429
16736
  ];
16430
- var ReleaseChannelSchema = z19.enum(RELEASE_CHANNEL);
16431
- var ReleaseSchemeSchema = z19.enum(RELEASE_SCHEME);
16432
- var ReleaseKindSchema = z19.enum(RELEASE_KIND);
16433
- var ReleaseStatusSchema = z19.enum(RELEASE_STATUS);
16434
- var GateStatusSchema = z19.enum(GATE_STATUS);
16435
- var GateNameSchema = z19.enum(GATE_NAME);
16436
- var PlatformTupleSchema = z19.enum(PLATFORM_TUPLE);
16437
- var PublisherSchema = z19.enum(PUBLISHER);
16438
- var TaskKindSchema = z19.enum(TASK_KIND);
16439
- var ImpactSchema = z19.enum(IMPACT);
16440
- var ResolvedSourceSchema = z19.enum(RESOLVED_SOURCE);
16441
- var Iso8601 = z19.iso.datetime({ offset: true });
16442
- var NonEmptyString = z19.string().min(1);
16443
- var ReleasePlanTaskSchema = z19.object({
16737
+ var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
16738
+ var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
16739
+ var ReleaseKindSchema = z20.enum(RELEASE_KIND);
16740
+ var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
16741
+ var GateStatusSchema = z20.enum(GATE_STATUS);
16742
+ var GateNameSchema = z20.enum(GATE_NAME);
16743
+ var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
16744
+ var PublisherSchema = z20.enum(PUBLISHER);
16745
+ var TaskKindSchema = z20.enum(TASK_KIND);
16746
+ var ImpactSchema = z20.enum(IMPACT);
16747
+ var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
16748
+ var Iso8601 = z20.iso.datetime({ offset: true });
16749
+ var NonEmptyString = z20.string().min(1);
16750
+ var ReleasePlanTaskSchema = z20.object({
16444
16751
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
16445
16752
  id: NonEmptyString,
16446
16753
  /** Conventional-commit-aligned task classification. */
@@ -16448,20 +16755,20 @@ var ReleasePlanTaskSchema = z19.object({
16448
16755
  /** SemVer impact classification. */
16449
16756
  impact: ImpactSchema,
16450
16757
  /** Human-readable changelog line for this task. */
16451
- userFacingSummary: z19.string(),
16758
+ userFacingSummary: z20.string(),
16452
16759
  /**
16453
16760
  * ADR-051 evidence atoms attesting the task's gate results. Format is
16454
16761
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
16455
16762
  * accepts empty arrays so legacy plans validate; `cleo release plan`
16456
16763
  * enforces non-empty via R-301.
16457
16764
  */
16458
- evidenceAtoms: z19.array(NonEmptyString),
16765
+ evidenceAtoms: z20.array(NonEmptyString),
16459
16766
  /** IVTR phase at plan time — informational only per R-316. */
16460
- ivtrPhaseAtPlan: z19.string().optional(),
16767
+ ivtrPhaseAtPlan: z20.string().optional(),
16461
16768
  /** Epic this task rolls up to, locked at plan time per R-303. */
16462
16769
  epicAncestor: NonEmptyString
16463
16770
  });
16464
- var ReleaseGateSchema = z19.object({
16771
+ var ReleaseGateSchema = z20.object({
16465
16772
  /** Canonical gate name. */
16466
16773
  name: GateNameSchema,
16467
16774
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -16471,11 +16778,11 @@ var ReleaseGateSchema = z19.object({
16471
16778
  /** ISO-8601 timestamp the gate was last verified. */
16472
16779
  lastVerifiedAt: Iso8601,
16473
16780
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
16474
- resolvedCommand: z19.string().optional(),
16781
+ resolvedCommand: z20.string().optional(),
16475
16782
  /** Provenance of the resolved command. Optional for unresolved gates. */
16476
16783
  resolvedSource: ResolvedSourceSchema.optional()
16477
16784
  });
16478
- var ReleasePlatformMatrixEntrySchema = z19.object({
16785
+ var ReleasePlatformMatrixEntrySchema = z20.object({
16479
16786
  /** Target platform tuple. */
16480
16787
  platform: PlatformTupleSchema,
16481
16788
  /** Distribution backend. */
@@ -16483,47 +16790,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
16483
16790
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
16484
16791
  package: NonEmptyString,
16485
16792
  /** Whether to run the GHA smoke job for this matrix entry. */
16486
- smoke: z19.boolean().default(true).optional()
16793
+ smoke: z20.boolean().default(true).optional()
16487
16794
  });
16488
- var ReleasePreflightSummarySchema = z19.object({
16795
+ var ReleasePreflightSummarySchema = z20.object({
16489
16796
  /** True if esbuild externals are out of sync with package.json. */
16490
- esbuildExternalsDrift: z19.boolean(),
16797
+ esbuildExternalsDrift: z20.boolean(),
16491
16798
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
16492
- lockfileDrift: z19.boolean(),
16799
+ lockfileDrift: z20.boolean(),
16493
16800
  /** True if all epic children are in terminal lifecycle states. */
16494
- epicCompletenessClean: z19.boolean(),
16801
+ epicCompletenessClean: z20.boolean(),
16495
16802
  /** True if no task appears in multiple in-flight release plans. */
16496
- doubleListingClean: z19.boolean(),
16803
+ doubleListingClean: z20.boolean(),
16497
16804
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
16498
- preflightWarnings: z19.array(z19.string()).default([]).optional()
16805
+ preflightWarnings: z20.array(z20.string()).default([]).optional()
16499
16806
  });
16500
- var ReleasePlanChangelogSchema = z19.object({
16807
+ var ReleasePlanChangelogSchema = z20.object({
16501
16808
  /** `kind=feat` tasks. */
16502
- features: z19.array(NonEmptyString).default([]),
16809
+ features: z20.array(NonEmptyString).default([]),
16503
16810
  /** `kind=fix` or `kind=hotfix` tasks. */
16504
- fixes: z19.array(NonEmptyString).default([]),
16811
+ fixes: z20.array(NonEmptyString).default([]),
16505
16812
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
16506
- chores: z19.array(NonEmptyString).default([]),
16813
+ chores: z20.array(NonEmptyString).default([]),
16507
16814
  /** `kind=breaking` or `kind=revert` tasks. */
16508
- breaking: z19.array(NonEmptyString).default([])
16815
+ breaking: z20.array(NonEmptyString).default([])
16509
16816
  });
16510
- var ReleasePlanMetaSchema = z19.object({
16817
+ var ReleasePlanMetaSchema = z20.object({
16511
16818
  /** True if this is the project's first ever release. */
16512
- firstEverRelease: z19.boolean().optional(),
16819
+ firstEverRelease: z20.boolean().optional(),
16513
16820
  /** Canonical tool names that could not be resolved at plan time. */
16514
- unresolvedTools: z19.array(z19.string()).optional(),
16821
+ unresolvedTools: z20.array(z20.string()).optional(),
16515
16822
  /** Project archetype detected at plan time. */
16516
- archetype: z19.string().optional()
16517
- }).catchall(z19.unknown());
16518
- var ReleasePlanSchema = z19.object({
16823
+ archetype: z20.string().optional()
16824
+ }).catchall(z20.unknown());
16825
+ var ReleasePlanSchema = z20.object({
16519
16826
  /** Schema URL for this plan version. */
16520
- $schema: z19.string().optional(),
16827
+ $schema: z20.string().optional(),
16521
16828
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
16522
16829
  version: NonEmptyString,
16523
16830
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
16524
16831
  resolvedVersion: NonEmptyString,
16525
16832
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
16526
- suffixApplied: z19.boolean(),
16833
+ suffixApplied: z20.boolean(),
16527
16834
  /** Versioning scheme governing `version` / `resolvedVersion`. */
16528
16835
  scheme: ReleaseSchemeSchema,
16529
16836
  /** npm dist-tag channel for this release. */
@@ -16537,7 +16844,7 @@ var ReleasePlanSchema = z19.object({
16537
16844
  /** Release-kind classification. */
16538
16845
  releaseKind: ReleaseKindSchema,
16539
16846
  /** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
16540
- hooksV1Promotion: z19.boolean().optional(),
16847
+ hooksV1Promotion: z20.boolean().optional(),
16541
16848
  /** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
16542
16849
  hooksV1Waiver: NonEmptyString.optional(),
16543
16850
  /** ISO-8601 timestamp the plan was written. */
@@ -16548,27 +16855,27 @@ var ReleasePlanSchema = z19.object({
16548
16855
  * Version of the previous release on the same channel. MUST be `null` only
16549
16856
  * for first-ever releases (R-300, enforced at the verb layer).
16550
16857
  */
16551
- previousVersion: z19.string().nullable(),
16858
+ previousVersion: z20.string().nullable(),
16552
16859
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
16553
- previousTag: z19.string().nullable(),
16860
+ previousTag: z20.string().nullable(),
16554
16861
  /** ISO-8601 timestamp the previous release was published. */
16555
16862
  previousShippedAt: Iso8601.nullable(),
16556
16863
  /** Tasks rolled into this release. */
16557
- tasks: z19.array(ReleasePlanTaskSchema),
16864
+ tasks: z20.array(ReleasePlanTaskSchema),
16558
16865
  /** Bucketed changelog. */
16559
16866
  changelog: ReleasePlanChangelogSchema,
16560
16867
  /** Per-gate verification status. */
16561
- gates: z19.array(ReleaseGateSchema),
16868
+ gates: z20.array(ReleaseGateSchema),
16562
16869
  /** Platform / publisher matrix. */
16563
- platformMatrix: z19.array(ReleasePlatformMatrixEntrySchema),
16870
+ platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
16564
16871
  /** Preflight summary from `cleo release plan`. */
16565
16872
  preflightSummary: ReleasePreflightSummarySchema,
16566
16873
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
16567
- workflowRunUrl: z19.string().nullable(),
16874
+ workflowRunUrl: z20.string().nullable(),
16568
16875
  /** URL of the bump PR (populated by `cleo release open`). */
16569
- prUrl: z19.string().nullable(),
16876
+ prUrl: z20.string().nullable(),
16570
16877
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
16571
- mergeCommitSha: z19.string().nullable(),
16878
+ mergeCommitSha: z20.string().nullable(),
16572
16879
  /** Current FSM state per R-302. */
16573
16880
  status: ReleaseStatusSchema,
16574
16881
  /** Informational / forward-compat metadata. */
@@ -16598,48 +16905,48 @@ var RESOURCE_CLASSES = Object.freeze([
16598
16905
  ]);
16599
16906
 
16600
16907
  // packages/contracts/src/session-journal.ts
16601
- import { z as z20 } from "zod";
16908
+ import { z as z21 } from "zod";
16602
16909
  var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
16603
- var sessionJournalDoctorSummarySchema = z20.object({
16910
+ var sessionJournalDoctorSummarySchema = z21.object({
16604
16911
  /** `true` when zero noise patterns were detected. */
16605
- isClean: z20.boolean(),
16912
+ isClean: z21.boolean(),
16606
16913
  /** Total number of noise findings across all patterns. */
16607
- findingsCount: z20.number().int().nonnegative(),
16914
+ findingsCount: z21.number().int().nonnegative(),
16608
16915
  /** Pattern names that were detected (empty when isClean). */
16609
- patterns: z20.array(z20.string()),
16916
+ patterns: z21.array(z21.string()),
16610
16917
  /** Total brain entries scanned. `0` = empty or unavailable. */
16611
- totalScanned: z20.number().int().nonnegative()
16918
+ totalScanned: z21.number().int().nonnegative()
16612
16919
  });
16613
- var sessionJournalDebriefSummarySchema = z20.object({
16920
+ var sessionJournalDebriefSummarySchema = z21.object({
16614
16921
  /** First 200 characters of the session end note (if provided). */
16615
- noteExcerpt: z20.string().max(200).optional(),
16922
+ noteExcerpt: z21.string().max(200).optional(),
16616
16923
  /** Number of tasks completed during the session. */
16617
- tasksCompletedCount: z20.number().int().nonnegative(),
16924
+ tasksCompletedCount: z21.number().int().nonnegative(),
16618
16925
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
16619
- tasksFocused: z20.array(z20.string()).max(5).optional()
16926
+ tasksFocused: z21.array(z21.string()).max(5).optional()
16620
16927
  });
16621
- var sessionJournalEntrySchema = z20.object({
16928
+ var sessionJournalEntrySchema = z21.object({
16622
16929
  // Identity
16623
16930
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
16624
- schemaVersion: z20.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16931
+ schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16625
16932
  /** ISO 8601 timestamp when the entry was written. */
16626
- timestamp: z20.string(),
16933
+ timestamp: z21.string(),
16627
16934
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
16628
- sessionId: z20.string(),
16935
+ sessionId: z21.string(),
16629
16936
  /** Event type that triggered this journal entry. */
16630
- eventType: z20.enum(["session_start", "session_end", "observation", "decision", "error"]),
16937
+ eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
16631
16938
  // Session metadata (set on session_start / session_end)
16632
16939
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
16633
- agentIdentifier: z20.string().optional(),
16940
+ agentIdentifier: z21.string().optional(),
16634
16941
  /** Provider adapter ID active for this session. */
16635
- providerId: z20.string().optional(),
16942
+ providerId: z21.string().optional(),
16636
16943
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
16637
- scope: z20.string().optional(),
16944
+ scope: z21.string().optional(),
16638
16945
  // Session-end fields
16639
16946
  /** Duration of the session in seconds (session_end only). */
16640
- duration: z20.number().int().nonnegative().optional(),
16947
+ duration: z21.number().int().nonnegative().optional(),
16641
16948
  /** Task IDs (not titles) completed during the session. */
16642
- tasksCompleted: z20.array(z20.string()).optional(),
16949
+ tasksCompleted: z21.array(z21.string()).optional(),
16643
16950
  // Doctor summary (T1262 absorbed)
16644
16951
  /**
16645
16952
  * Compact result of `scanBrainNoise` run at session-end.
@@ -16654,52 +16961,52 @@ var sessionJournalEntrySchema = z20.object({
16654
16961
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
16655
16962
  // Optional hash chain
16656
16963
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
16657
- prevEntryHash: z20.string().optional()
16964
+ prevEntryHash: z21.string().optional()
16658
16965
  });
16659
16966
 
16660
16967
  // packages/contracts/src/task-evidence.ts
16661
- import { z as z21 } from "zod";
16662
- var fileEvidenceSchema = z21.object({
16663
- kind: z21.literal("file"),
16664
- sha256: z21.string().length(64),
16665
- timestamp: z21.string().datetime(),
16666
- path: z21.string().min(1),
16667
- mime: z21.string().optional(),
16668
- description: z21.string().optional()
16968
+ import { z as z22 } from "zod";
16969
+ var fileEvidenceSchema = z22.object({
16970
+ kind: z22.literal("file"),
16971
+ sha256: z22.string().length(64),
16972
+ timestamp: z22.string().datetime(),
16973
+ path: z22.string().min(1),
16974
+ mime: z22.string().optional(),
16975
+ description: z22.string().optional()
16669
16976
  });
16670
- var logEvidenceSchema = z21.object({
16671
- kind: z21.literal("log"),
16672
- sha256: z21.string().length(64),
16673
- timestamp: z21.string().datetime(),
16674
- source: z21.string().min(1),
16675
- description: z21.string().optional()
16977
+ var logEvidenceSchema = z22.object({
16978
+ kind: z22.literal("log"),
16979
+ sha256: z22.string().length(64),
16980
+ timestamp: z22.string().datetime(),
16981
+ source: z22.string().min(1),
16982
+ description: z22.string().optional()
16676
16983
  });
16677
- var screenshotEvidenceSchema = z21.object({
16678
- kind: z21.literal("screenshot"),
16679
- sha256: z21.string().length(64),
16680
- timestamp: z21.string().datetime(),
16681
- mime: z21.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16682
- description: z21.string().optional()
16984
+ var screenshotEvidenceSchema = z22.object({
16985
+ kind: z22.literal("screenshot"),
16986
+ sha256: z22.string().length(64),
16987
+ timestamp: z22.string().datetime(),
16988
+ mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16989
+ description: z22.string().optional()
16683
16990
  });
16684
- var testOutputEvidenceSchema = z21.object({
16685
- kind: z21.literal("test-output"),
16686
- sha256: z21.string().length(64),
16687
- timestamp: z21.string().datetime(),
16688
- passed: z21.number().int().nonnegative(),
16689
- failed: z21.number().int().nonnegative(),
16690
- skipped: z21.number().int().nonnegative(),
16691
- exitCode: z21.number().int(),
16692
- description: z21.string().optional()
16991
+ var testOutputEvidenceSchema = z22.object({
16992
+ kind: z22.literal("test-output"),
16993
+ sha256: z22.string().length(64),
16994
+ timestamp: z22.string().datetime(),
16995
+ passed: z22.number().int().nonnegative(),
16996
+ failed: z22.number().int().nonnegative(),
16997
+ skipped: z22.number().int().nonnegative(),
16998
+ exitCode: z22.number().int(),
16999
+ description: z22.string().optional()
16693
17000
  });
16694
- var commandOutputEvidenceSchema = z21.object({
16695
- kind: z21.literal("command-output"),
16696
- sha256: z21.string().length(64),
16697
- timestamp: z21.string().datetime(),
16698
- cmd: z21.string().min(1),
16699
- exitCode: z21.number().int(),
16700
- description: z21.string().optional()
17001
+ var commandOutputEvidenceSchema = z22.object({
17002
+ kind: z22.literal("command-output"),
17003
+ sha256: z22.string().length(64),
17004
+ timestamp: z22.string().datetime(),
17005
+ cmd: z22.string().min(1),
17006
+ exitCode: z22.number().int(),
17007
+ description: z22.string().optional()
16701
17008
  });
16702
- var taskEvidenceSchema = z21.discriminatedUnion("kind", [
17009
+ var taskEvidenceSchema = z22.discriminatedUnion("kind", [
16703
17010
  fileEvidenceSchema,
16704
17011
  logEvidenceSchema,
16705
17012
  screenshotEvidenceSchema,
@@ -16708,8 +17015,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16708
17015
  ]);
16709
17016
 
16710
17017
  // packages/contracts/src/tasks/archive.ts
16711
- import { z as z22 } from "zod";
16712
- var ArchiveReason = z22.enum([
17018
+ import { z as z23 } from "zod";
17019
+ var ArchiveReason = z23.enum([
16713
17020
  "verified",
16714
17021
  "reconciled",
16715
17022
  "superseded",
@@ -16720,42 +17027,42 @@ var ArchiveReason = z22.enum([
16720
17027
  var ARCHIVE_REASON_VALUES = ArchiveReason.options;
16721
17028
 
16722
17029
  // packages/contracts/src/tasks/index.ts
16723
- import { z as z23 } from "zod";
16724
- var taskMutationWarningSeveritySchema = z23.enum(["info", "warning"]);
16725
- var taskMutationWarningSchema = z23.object({
16726
- code: z23.string().min(1),
16727
- message: z23.string().min(1),
17030
+ import { z as z24 } from "zod";
17031
+ var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
17032
+ var taskMutationWarningSchema = z24.object({
17033
+ code: z24.string().min(1),
17034
+ message: z24.string().min(1),
16728
17035
  severity: taskMutationWarningSeveritySchema.optional(),
16729
- taskId: z23.string().min(1).optional(),
16730
- field: z23.string().min(1).optional(),
16731
- index: z23.number().int().nonnegative().optional()
17036
+ taskId: z24.string().min(1).optional(),
17037
+ field: z24.string().min(1).optional(),
17038
+ index: z24.number().int().nonnegative().optional()
16732
17039
  });
16733
- var taskMutationDryRunSummarySchema = z23.object({
16734
- dryRun: z23.literal(true),
16735
- wouldCreate: z23.number().int().nonnegative(),
16736
- wouldUpdate: z23.number().int().nonnegative(),
16737
- wouldDelete: z23.number().int().nonnegative(),
16738
- wouldAffect: z23.number().int().nonnegative(),
16739
- validatedCount: z23.number().int().nonnegative(),
16740
- insertedCount: z23.literal(0),
16741
- updatedCount: z23.literal(0),
16742
- deletedCount: z23.literal(0),
16743
- warnings: z23.array(taskMutationWarningSchema)
17040
+ var taskMutationDryRunSummarySchema = z24.object({
17041
+ dryRun: z24.literal(true),
17042
+ wouldCreate: z24.number().int().nonnegative(),
17043
+ wouldUpdate: z24.number().int().nonnegative(),
17044
+ wouldDelete: z24.number().int().nonnegative(),
17045
+ wouldAffect: z24.number().int().nonnegative(),
17046
+ validatedCount: z24.number().int().nonnegative(),
17047
+ insertedCount: z24.literal(0),
17048
+ updatedCount: z24.literal(0),
17049
+ deletedCount: z24.literal(0),
17050
+ warnings: z24.array(taskMutationWarningSchema)
16744
17051
  });
16745
- var taskMutationTaskRecordSchema = z23.object({ id: z23.string().min(1) }).passthrough();
16746
- var taskMutationEnvelopeSchema = z23.object({
16747
- dryRun: z23.boolean().optional(),
16748
- created: z23.array(taskMutationTaskRecordSchema),
16749
- updated: z23.array(taskMutationTaskRecordSchema),
16750
- deleted: z23.array(taskMutationTaskRecordSchema),
16751
- affectedCount: z23.number().int().nonnegative(),
16752
- mutationWarnings: z23.array(taskMutationWarningSchema),
17052
+ var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
17053
+ var taskMutationEnvelopeSchema = z24.object({
17054
+ dryRun: z24.boolean().optional(),
17055
+ created: z24.array(taskMutationTaskRecordSchema),
17056
+ updated: z24.array(taskMutationTaskRecordSchema),
17057
+ deleted: z24.array(taskMutationTaskRecordSchema),
17058
+ affectedCount: z24.number().int().nonnegative(),
17059
+ mutationWarnings: z24.array(taskMutationWarningSchema),
16753
17060
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
16754
17061
  });
16755
- var completionTaskStatusSchema = z23.enum(TASK_STATUSES);
16756
- var completionCriterionKindSchema = z23.enum(["text", "evidence_bound", "child_task"]);
16757
- var completionCriterionStatusSchema = z23.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16758
- var completionBlockerReasonSchema = z23.enum([
17062
+ var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
17063
+ var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
17064
+ var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
17065
+ var completionBlockerReasonSchema = z24.enum([
16759
17066
  "missing_evidence_binding",
16760
17067
  "child_not_done",
16761
17068
  "child_cancelled_requires_waiver",
@@ -16763,68 +17070,68 @@ var completionBlockerReasonSchema = z23.enum([
16763
17070
  "child_missing",
16764
17071
  "done_parent_stale"
16765
17072
  ]);
16766
- var completionStaleReasonSchema = z23.enum(["done_parent_has_unsatisfied_criteria"]);
16767
- var completionProjectionRepairErrorCodeSchema = z23.enum([
17073
+ var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
17074
+ var completionProjectionRepairErrorCodeSchema = z24.enum([
16768
17075
  "projection_not_stale",
16769
17076
  "criteria_missing",
16770
17077
  "binding_target_missing",
16771
17078
  "repair_conflict"
16772
17079
  ]);
16773
- var completionCriterionWaiverSchema = z23.object({
16774
- criterionAcId: z23.string().min(1),
16775
- childTaskId: z23.string().min(1),
16776
- reason: z23.string().min(1),
16777
- actor: z23.string().min(1),
16778
- waivedAt: z23.string().min(1)
17080
+ var completionCriterionWaiverSchema = z24.object({
17081
+ criterionAcId: z24.string().min(1),
17082
+ childTaskId: z24.string().min(1),
17083
+ reason: z24.string().min(1),
17084
+ actor: z24.string().min(1),
17085
+ waivedAt: z24.string().min(1)
16779
17086
  });
16780
- var completionCriterionReplacementSchema = z23.object({
16781
- criterionAcId: z23.string().min(1),
16782
- originalChildTaskId: z23.string().min(1),
16783
- replacementChildTaskId: z23.string().min(1),
16784
- reason: z23.string().min(1),
16785
- actor: z23.string().min(1),
16786
- replacedAt: z23.string().min(1)
17087
+ var completionCriterionReplacementSchema = z24.object({
17088
+ criterionAcId: z24.string().min(1),
17089
+ originalChildTaskId: z24.string().min(1),
17090
+ replacementChildTaskId: z24.string().min(1),
17091
+ reason: z24.string().min(1),
17092
+ actor: z24.string().min(1),
17093
+ replacedAt: z24.string().min(1)
16787
17094
  });
16788
- var completionCriterionEvaluationSchema = z23.object({
16789
- acId: z23.string().min(1),
16790
- alias: z23.string().min(1),
16791
- text: z23.string(),
17095
+ var completionCriterionEvaluationSchema = z24.object({
17096
+ acId: z24.string().min(1),
17097
+ alias: z24.string().min(1),
17098
+ text: z24.string(),
16792
17099
  kind: completionCriterionKindSchema,
16793
17100
  status: completionCriterionStatusSchema,
16794
17101
  reason: completionBlockerReasonSchema.optional(),
16795
- targetTaskId: z23.string().min(1).optional(),
17102
+ targetTaskId: z24.string().min(1).optional(),
16796
17103
  targetTaskStatus: completionTaskStatusSchema.optional(),
16797
17104
  waiver: completionCriterionWaiverSchema.optional(),
16798
17105
  replacement: completionCriterionReplacementSchema.optional(),
16799
17106
  replacementTaskStatus: completionTaskStatusSchema.optional(),
16800
- evidenceBindings: z23.number().int().nonnegative()
17107
+ evidenceBindings: z24.number().int().nonnegative()
16801
17108
  });
16802
17109
  var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
16803
- status: z23.literal("unsatisfied"),
17110
+ status: z24.literal("unsatisfied"),
16804
17111
  reason: completionBlockerReasonSchema
16805
17112
  });
16806
- var completionTotalsSchema = z23.object({
16807
- criteria: z23.number().int().nonnegative(),
16808
- satisfied: z23.number().int().nonnegative(),
16809
- unsatisfied: z23.number().int().nonnegative(),
16810
- waived: z23.number().int().nonnegative(),
16811
- replaced: z23.number().int().nonnegative()
17113
+ var completionTotalsSchema = z24.object({
17114
+ criteria: z24.number().int().nonnegative(),
17115
+ satisfied: z24.number().int().nonnegative(),
17116
+ unsatisfied: z24.number().int().nonnegative(),
17117
+ waived: z24.number().int().nonnegative(),
17118
+ replaced: z24.number().int().nonnegative()
16812
17119
  });
16813
- var completionContextPackSchema = z23.object({
16814
- taskId: z23.string().min(1),
16815
- generatedAt: z23.string().min(1),
16816
- source: z23.literal("audit_log"),
16817
- window: z23.object({
16818
- limit: z23.number().int().positive(),
16819
- since: z23.string().min(1).optional(),
16820
- relationDepth: z23.number().int().nonnegative(),
16821
- relatedTaskIds: z23.array(z23.string().min(1))
17120
+ var completionContextPackSchema = z24.object({
17121
+ taskId: z24.string().min(1),
17122
+ generatedAt: z24.string().min(1),
17123
+ source: z24.literal("audit_log"),
17124
+ window: z24.object({
17125
+ limit: z24.number().int().positive(),
17126
+ since: z24.string().min(1).optional(),
17127
+ relationDepth: z24.number().int().nonnegative(),
17128
+ relatedTaskIds: z24.array(z24.string().min(1))
16822
17129
  }),
16823
- events: z23.array(
16824
- z23.object({
16825
- id: z23.string().min(1),
16826
- timestamp: z23.string().min(1),
16827
- action: z23.enum([
17130
+ events: z24.array(
17131
+ z24.object({
17132
+ id: z24.string().min(1),
17133
+ timestamp: z24.string().min(1),
17134
+ action: z24.enum([
16828
17135
  "task_completed",
16829
17136
  "task_reopened",
16830
17137
  "task_cancelled",
@@ -16832,77 +17139,77 @@ var completionContextPackSchema = z23.object({
16832
17139
  "task_reparented",
16833
17140
  "ac_projection_rebuilt"
16834
17141
  ]),
16835
- taskId: z23.string().min(1),
16836
- relation: z23.enum(["self", "parent", "child", "sibling", "related"]),
16837
- actor: z23.string().min(1),
16838
- details: z23.record(z23.string(), z23.unknown()).optional(),
16839
- before: z23.record(z23.string(), z23.unknown()).optional(),
16840
- after: z23.record(z23.string(), z23.unknown()).optional()
17142
+ taskId: z24.string().min(1),
17143
+ relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
17144
+ actor: z24.string().min(1),
17145
+ details: z24.record(z24.string(), z24.unknown()).optional(),
17146
+ before: z24.record(z24.string(), z24.unknown()).optional(),
17147
+ after: z24.record(z24.string(), z24.unknown()).optional()
16841
17148
  })
16842
17149
  ),
16843
- summary: z23.object({
16844
- totalEvents: z23.number().int().nonnegative(),
16845
- byAction: z23.record(z23.string(), z23.number().int().nonnegative()),
16846
- byRelation: z23.record(z23.string(), z23.number().int().nonnegative()),
16847
- latestEventAt: z23.string().nullable()
17150
+ summary: z24.object({
17151
+ totalEvents: z24.number().int().nonnegative(),
17152
+ byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
17153
+ byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
17154
+ latestEventAt: z24.string().nullable()
16848
17155
  })
16849
17156
  });
16850
- var completionEvaluationSchema = z23.object({
16851
- taskId: z23.string().min(1),
17157
+ var completionEvaluationSchema = z24.object({
17158
+ taskId: z24.string().min(1),
16852
17159
  taskStatus: completionTaskStatusSchema,
16853
- ready: z23.boolean(),
16854
- stale: z23.boolean(),
16855
- staleReasons: z23.array(completionStaleReasonSchema),
17160
+ ready: z24.boolean(),
17161
+ stale: z24.boolean(),
17162
+ staleReasons: z24.array(completionStaleReasonSchema),
16856
17163
  contextPack: completionContextPackSchema.optional(),
16857
- satisfied: z23.array(completionCriterionEvaluationSchema),
16858
- unsatisfied: z23.array(unsatisfiedCompletionCriterionSchema),
16859
- waived: z23.array(completionCriterionEvaluationSchema),
16860
- replaced: z23.array(completionCriterionEvaluationSchema),
17164
+ satisfied: z24.array(completionCriterionEvaluationSchema),
17165
+ unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
17166
+ waived: z24.array(completionCriterionEvaluationSchema),
17167
+ replaced: z24.array(completionCriterionEvaluationSchema),
16861
17168
  totals: completionTotalsSchema
16862
17169
  });
16863
- var completionExplanationSchema = z23.object({
16864
- taskId: z23.string().min(1),
16865
- ready: z23.boolean(),
16866
- stale: z23.boolean(),
16867
- summary: z23.string(),
17170
+ var completionExplanationSchema = z24.object({
17171
+ taskId: z24.string().min(1),
17172
+ ready: z24.boolean(),
17173
+ stale: z24.boolean(),
17174
+ summary: z24.string(),
16868
17175
  contextPack: completionContextPackSchema.optional(),
16869
- blockers: z23.array(completionCriterionEvaluationSchema)
17176
+ blockers: z24.array(completionCriterionEvaluationSchema)
16870
17177
  });
16871
- var completionListParamsSchema = z23.object({
16872
- taskId: z23.string().min(1),
17178
+ var completionListParamsSchema = z24.object({
17179
+ taskId: z24.string().min(1),
16873
17180
  status: completionCriterionStatusSchema.optional(),
16874
17181
  kind: completionCriterionKindSchema.optional()
16875
17182
  });
16876
- var completionListResultSchema = z23.object({
16877
- taskId: z23.string().min(1),
16878
- criteria: z23.array(completionCriterionEvaluationSchema),
17183
+ var completionListResultSchema = z24.object({
17184
+ taskId: z24.string().min(1),
17185
+ criteria: z24.array(completionCriterionEvaluationSchema),
16879
17186
  totals: completionTotalsSchema
16880
17187
  });
16881
- var completionEvaluateParamsSchema = z23.object({
16882
- taskId: z23.string().min(1),
16883
- includeContext: z23.boolean().optional(),
16884
- limit: z23.number().int().positive().optional(),
16885
- since: z23.string().min(1).optional(),
16886
- relationDepth: z23.number().int().nonnegative().optional()
17188
+ var completionEvaluateParamsSchema = z24.object({
17189
+ taskId: z24.string().min(1),
17190
+ includeContext: z24.boolean().optional(),
17191
+ limit: z24.number().int().positive().optional(),
17192
+ since: z24.string().min(1).optional(),
17193
+ relationDepth: z24.number().int().nonnegative().optional()
16887
17194
  });
16888
- var completionProjectionRepairErrorSchema = z23.object({
17195
+ var completionProjectionRepairErrorSchema = z24.object({
16889
17196
  code: completionProjectionRepairErrorCodeSchema,
16890
- message: z23.string().min(1),
16891
- taskId: z23.string().min(1),
16892
- acId: z23.string().min(1).optional(),
16893
- evidenceAtomId: z23.string().min(1).optional()
17197
+ message: z24.string().min(1),
17198
+ taskId: z24.string().min(1),
17199
+ acId: z24.string().min(1).optional(),
17200
+ evidenceAtomId: z24.string().min(1).optional()
16894
17201
  });
16895
- var completionProjectionRepairParamsSchema = z23.object({
16896
- taskId: z23.string().min(1),
16897
- dryRun: z23.boolean().optional()
17202
+ var completionProjectionRepairParamsSchema = z24.object({
17203
+ taskId: z24.string().min(1),
17204
+ dryRun: z24.boolean().optional()
16898
17205
  });
16899
- var completionProjectionRepairResultSchema = z23.object({
16900
- taskId: z23.string().min(1),
16901
- repaired: z23.boolean(),
16902
- dryRun: z23.boolean(),
16903
- staleBefore: z23.boolean(),
16904
- staleAfter: z23.boolean(),
16905
- errors: z23.array(completionProjectionRepairErrorSchema)
17206
+ var completionProjectionRepairResultSchema = z24.object({
17207
+ taskId: z24.string().min(1),
17208
+ repaired: z24.boolean(),
17209
+ dryRun: z24.boolean(),
17210
+ staleBefore: z24.boolean(),
17211
+ staleAfter: z24.boolean(),
17212
+ errors: z24.array(completionProjectionRepairErrorSchema)
16906
17213
  });
16907
17214
 
16908
17215
  // packages/contracts/src/taxonomy.ts
@@ -17405,7 +17712,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
17405
17712
  };
17406
17713
 
17407
17714
  // packages/contracts/src/templates/manifest.ts
17408
- import { z as z24 } from "zod";
17715
+ import { z as z25 } from "zod";
17409
17716
  var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
17410
17717
  var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
17411
17718
  var TEMPLATE_UPDATE_STRATEGIES = [
@@ -17422,79 +17729,79 @@ var PLACEHOLDER_SOURCES = [
17422
17729
  "tool-resolver",
17423
17730
  "literal"
17424
17731
  ];
17425
- var PlaceholderSpecSchema = z24.object({
17732
+ var PlaceholderSpecSchema = z25.object({
17426
17733
  /**
17427
17734
  * Placeholder identifier as it appears in the template body
17428
17735
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
17429
17736
  */
17430
- name: z24.string().min(1, "placeholder name must be non-empty"),
17737
+ name: z25.string().min(1, "placeholder name must be non-empty"),
17431
17738
  /** Resolver source the installer consults for this placeholder. */
17432
- source: z24.enum(PLACEHOLDER_SOURCES),
17739
+ source: z25.enum(PLACEHOLDER_SOURCES),
17433
17740
  /**
17434
17741
  * Path expression evaluated against `source` (e.g. `engines.node` against
17435
17742
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
17436
17743
  * For `literal` source, this MAY be the literal value's identifier.
17437
17744
  */
17438
- sourcePath: z24.string().min(1, "placeholder sourcePath must be non-empty"),
17745
+ sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
17439
17746
  /**
17440
17747
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
17441
17748
  * `null` is permitted to explicitly mark "no default — failure required".
17442
17749
  */
17443
- defaultValue: z24.union([z24.string(), z24.number(), z24.boolean(), z24.null()]).optional()
17750
+ defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
17444
17751
  });
17445
- var TemplateManifestEntrySchema = z24.object({
17752
+ var TemplateManifestEntrySchema = z25.object({
17446
17753
  /** Stable identifier for this template entry. */
17447
- id: z24.string().min(1, "id must be non-empty"),
17754
+ id: z25.string().min(1, "id must be non-empty"),
17448
17755
  /** Category of file this template represents. */
17449
- kind: z24.enum(TEMPLATE_KINDS),
17756
+ kind: z25.enum(TEMPLATE_KINDS),
17450
17757
  /** Repo-relative path of the template source file. */
17451
- sourcePath: z24.string().min(1, "sourcePath must be non-empty"),
17758
+ sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
17452
17759
  /** Project-relative path where the rendered template installs. */
17453
- installPath: z24.string().min(1, "installPath must be non-empty"),
17760
+ installPath: z25.string().min(1, "installPath must be non-empty"),
17454
17761
  /** Substitution strategy the installer applies to `sourcePath`. */
17455
- substitution: z24.enum(TEMPLATE_SUBSTITUTIONS),
17762
+ substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
17456
17763
  /** Declared placeholders this template requires. May be empty. */
17457
- placeholders: z24.array(PlaceholderSpecSchema),
17764
+ placeholders: z25.array(PlaceholderSpecSchema),
17458
17765
  /** Reconciliation policy on upgrade. */
17459
- updateStrategy: z24.enum(TEMPLATE_UPDATE_STRATEGIES)
17766
+ updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
17460
17767
  });
17461
17768
 
17462
17769
  // packages/contracts/src/validator/index.ts
17463
- import { z as z25 } from "zod";
17770
+ import { z as z26 } from "zod";
17464
17771
  var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
17465
- var validatorFindingSchema = z25.object({
17466
- acId: z25.string().min(1, "acId must be non-empty"),
17467
- status: z25.enum(["pass", "fail", "inconclusive"]),
17468
- reasoning: z25.string().min(1, "reasoning must be non-empty"),
17469
- evidenceRefs: z25.array(z25.string()).optional(),
17470
- checkedAt: z25.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17772
+ var validatorFindingSchema = z26.object({
17773
+ acId: z26.string().min(1, "acId must be non-empty"),
17774
+ status: z26.enum(["pass", "fail", "inconclusive"]),
17775
+ reasoning: z26.string().min(1, "reasoning must be non-empty"),
17776
+ evidenceRefs: z26.array(z26.string()).optional(),
17777
+ checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17471
17778
  });
17472
- var validatorAttestationSchema = z25.object({
17473
- verdict: z25.literal("attest"),
17474
- taskId: z25.string().min(1),
17475
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17476
- findings: z25.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17779
+ var validatorAttestationSchema = z26.object({
17780
+ verdict: z26.literal("attest"),
17781
+ taskId: z26.string().min(1),
17782
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17783
+ findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17477
17784
  (findings) => findings.every((f) => f.status === "pass"),
17478
17785
  'attestation requires every finding to have status="pass"'
17479
17786
  ),
17480
- summary: z25.string().optional(),
17481
- attestedAt: z25.string().min(1),
17482
- schemaVersion: z25.literal("1")
17787
+ summary: z26.string().optional(),
17788
+ attestedAt: z26.string().min(1),
17789
+ schemaVersion: z26.literal("1")
17483
17790
  });
17484
- var validatorRejectionSchema = z25.object({
17485
- verdict: z25.literal("reject"),
17486
- taskId: z25.string().min(1),
17487
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17488
- findings: z25.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17791
+ var validatorRejectionSchema = z26.object({
17792
+ verdict: z26.literal("reject"),
17793
+ taskId: z26.string().min(1),
17794
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17795
+ findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17489
17796
  (findings) => findings.some((f) => f.status !== "pass"),
17490
17797
  'rejection requires at least one finding with status "fail" or "inconclusive"'
17491
17798
  ),
17492
- summary: z25.string().min(1, "rejection summary must be non-empty"),
17493
- remediationHints: z25.array(z25.string()).optional(),
17494
- rejectedAt: z25.string().min(1),
17495
- schemaVersion: z25.literal("1")
17799
+ summary: z26.string().min(1, "rejection summary must be non-empty"),
17800
+ remediationHints: z26.array(z26.string()).optional(),
17801
+ rejectedAt: z26.string().min(1),
17802
+ schemaVersion: z26.literal("1")
17496
17803
  });
17497
- var validatorVerdictSchema = z25.discriminatedUnion("verdict", [
17804
+ var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
17498
17805
  validatorAttestationSchema,
17499
17806
  validatorRejectionSchema
17500
17807
  ]);
@@ -18244,7 +18551,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
18244
18551
  var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
18245
18552
 
18246
18553
  // packages/contracts/src/decide.ts
18247
- import { z as z26 } from "zod";
18554
+ import { z as z27 } from "zod";
18248
18555
  var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
18249
18556
  var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
18250
18557
  var DECISION_REQUEST_LIMITS = {
@@ -18266,11 +18573,11 @@ var DECISION_REQUEST_LIMITS = {
18266
18573
  maxScoreLevels: 10
18267
18574
  };
18268
18575
  var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
18269
- var decisionQuestionTypeSchema = z26.enum(DECISION_QUESTION_TYPES);
18270
- var decisionOutcomeSourceSchema = z26.enum(DECISION_OUTCOME_SOURCES);
18271
- var decisionInstructionsSchema = z26.union([z26.string(), z26.record(z26.string(), z26.json())]);
18272
- var unitIntervalSchema = z26.number().min(0).max(1);
18273
- var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.record(z26.string(), z26.json())]).superRefine((state, context) => {
18576
+ var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
18577
+ var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
18578
+ var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
18579
+ var unitIntervalSchema = z27.number().min(0).max(1);
18580
+ var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
18274
18581
  const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
18275
18582
  if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
18276
18583
  context.addIssue({
@@ -18279,34 +18586,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
18279
18586
  });
18280
18587
  }
18281
18588
  });
18282
- var noulDecisionQuestionSchema = z26.object({
18283
- type: z26.literal("noul"),
18589
+ var noulDecisionQuestionSchema = z27.object({
18590
+ type: z27.literal("noul"),
18284
18591
  instructions: decisionInstructionsSchema.optional(),
18285
- criteria: z26.string().min(1)
18592
+ criteria: z27.string().min(1)
18286
18593
  });
18287
- var choiceDecisionQuestionSchema = z26.object({
18288
- type: z26.literal("choice"),
18594
+ var choiceDecisionQuestionSchema = z27.object({
18595
+ type: z27.literal("choice"),
18289
18596
  instructions: decisionInstructionsSchema.optional(),
18290
- criteria: z26.record(z26.string().min(1), z26.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18597
+ criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18291
18598
  message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
18292
18599
  })
18293
18600
  });
18294
- var scoreDecisionQuestionSchema = z26.object({
18295
- type: z26.literal("score"),
18601
+ var scoreDecisionQuestionSchema = z27.object({
18602
+ type: z27.literal("score"),
18296
18603
  instructions: decisionInstructionsSchema.optional(),
18297
- criteria: z26.array(z26.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18604
+ criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18298
18605
  });
18299
- var decisionQuestionSchema = z26.discriminatedUnion("type", [
18606
+ var decisionQuestionSchema = z27.discriminatedUnion("type", [
18300
18607
  noulDecisionQuestionSchema,
18301
18608
  choiceDecisionQuestionSchema,
18302
18609
  scoreDecisionQuestionSchema
18303
18610
  ]);
18304
- var decisionRequestSchema = z26.object({
18305
- model: z26.string().min(1).optional(),
18306
- lang: z26.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18307
- cache: z26.boolean().optional(),
18611
+ var decisionRequestSchema = z27.object({
18612
+ model: z27.string().min(1).optional(),
18613
+ lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18614
+ cache: z27.boolean().optional(),
18308
18615
  state: decisionStateSchema,
18309
- questions: z26.record(z26.string().min(1), decisionQuestionSchema).refine(
18616
+ questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
18310
18617
  (questions) => {
18311
18618
  const count = Object.keys(questions).length;
18312
18619
  return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
@@ -18316,139 +18623,139 @@ var decisionRequestSchema = z26.object({
18316
18623
  }
18317
18624
  )
18318
18625
  });
18319
- var noulDecisionAnswerSchema = z26.object({
18320
- type: z26.literal("noul"),
18321
- value: z26.boolean(),
18626
+ var noulDecisionAnswerSchema = z27.object({
18627
+ type: z27.literal("noul"),
18628
+ value: z27.boolean(),
18322
18629
  probability: unitIntervalSchema,
18323
18630
  confidence: unitIntervalSchema
18324
18631
  });
18325
- var choiceDecisionAnswerSchema = z26.object({
18326
- type: z26.literal("choice"),
18327
- value: z26.string().min(1),
18328
- probabilities: z26.record(z26.string().min(1), unitIntervalSchema),
18632
+ var choiceDecisionAnswerSchema = z27.object({
18633
+ type: z27.literal("choice"),
18634
+ value: z27.string().min(1),
18635
+ probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
18329
18636
  confidence: unitIntervalSchema
18330
18637
  });
18331
- var scoreDecisionAnswerSchema = z26.object({
18332
- type: z26.literal("score"),
18333
- value: z26.number().int().nonnegative(),
18334
- probabilities: z26.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18638
+ var scoreDecisionAnswerSchema = z27.object({
18639
+ type: z27.literal("score"),
18640
+ value: z27.number().int().nonnegative(),
18641
+ probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18335
18642
  confidence: unitIntervalSchema
18336
18643
  });
18337
- var decisionAnswerSchema = z26.discriminatedUnion("type", [
18644
+ var decisionAnswerSchema = z27.discriminatedUnion("type", [
18338
18645
  noulDecisionAnswerSchema,
18339
18646
  choiceDecisionAnswerSchema,
18340
18647
  scoreDecisionAnswerSchema
18341
18648
  ]);
18342
- var decisionOutcomeSchema = z26.object({
18343
- answers: z26.record(z26.string().min(1), decisionAnswerSchema),
18649
+ var decisionOutcomeSchema = z27.object({
18650
+ answers: z27.record(z27.string().min(1), decisionAnswerSchema),
18344
18651
  source: decisionOutcomeSourceSchema,
18345
- requestId: z26.string().min(1).optional(),
18346
- latencyMs: z26.number().nonnegative(),
18347
- costUsd: z26.number().nonnegative().optional(),
18348
- costMicros: z26.number().int().nonnegative().optional(),
18349
- balanceMicros: z26.number().int().optional(),
18350
- checkpoint: z26.string().min(1).optional(),
18351
- inputTokens: z26.number().int().nonnegative().optional()
18652
+ requestId: z27.string().min(1).optional(),
18653
+ latencyMs: z27.number().nonnegative(),
18654
+ costUsd: z27.number().nonnegative().optional(),
18655
+ costMicros: z27.number().int().nonnegative().optional(),
18656
+ balanceMicros: z27.number().int().optional(),
18657
+ checkpoint: z27.string().min(1).optional(),
18658
+ inputTokens: z27.number().int().nonnegative().optional()
18352
18659
  });
18353
- var decisionProviderKindSchema = z26.enum(DECISION_PROVIDER_KINDS);
18354
- var decisionProviderConfigSchema = z26.object({
18355
- baseUrl: z26.url(),
18660
+ var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
18661
+ var decisionProviderConfigSchema = z27.object({
18662
+ baseUrl: z27.url(),
18356
18663
  provider: decisionProviderKindSchema.optional()
18357
18664
  });
18358
18665
 
18359
18666
  // packages/contracts/src/nexus-account.ts
18360
- import { z as z27 } from "zod";
18361
- var nexusAccountUserSchema = z27.object({
18362
- id: z27.string(),
18363
- email: z27.string(),
18364
- name: z27.string().nullable().optional()
18667
+ import { z as z28 } from "zod";
18668
+ var nexusAccountUserSchema = z28.object({
18669
+ id: z28.string(),
18670
+ email: z28.string(),
18671
+ name: z28.string().nullable().optional()
18365
18672
  });
18366
- var nexusAccountOrganizationSchema = z27.object({
18367
- id: z27.string(),
18368
- name: z27.string(),
18369
- slug: z27.string().nullable().optional(),
18370
- role: z27.string().optional(),
18673
+ var nexusAccountOrganizationSchema = z28.object({
18674
+ id: z28.string(),
18675
+ name: z28.string(),
18676
+ slug: z28.string().nullable().optional(),
18677
+ role: z28.string().optional(),
18371
18678
  /** `true` for the personal organization created at sign-up. */
18372
- personal: z27.boolean().optional()
18679
+ personal: z28.boolean().optional()
18373
18680
  });
18374
- var nexusAccountMeSchema = z27.object({
18681
+ var nexusAccountMeSchema = z28.object({
18375
18682
  user: nexusAccountUserSchema,
18376
- organizations: z27.array(nexusAccountOrganizationSchema).default([])
18683
+ organizations: z28.array(nexusAccountOrganizationSchema).default([])
18377
18684
  });
18378
18685
 
18379
18686
  // packages/contracts/src/nexus-cloud.ts
18380
- import { z as z28 } from "zod";
18687
+ import { z as z29 } from "zod";
18381
18688
  var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
18382
18689
  var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
18383
18690
  var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
18384
- var isoTime = z28.iso.datetime({ offset: true });
18385
- var profile = z28.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18386
- var deviceState = z28.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18387
- var nexusCloudCredentialSchema = z28.object({
18388
- kind: z28.enum(["device", "session"]),
18389
- credentialId: z28.string().nullable().optional(),
18691
+ var isoTime = z29.iso.datetime({ offset: true });
18692
+ var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18693
+ var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18694
+ var nexusCloudCredentialSchema = z29.object({
18695
+ kind: z29.enum(["device", "session"]),
18696
+ credentialId: z29.string().nullable().optional(),
18390
18697
  profile: profile.optional(),
18391
- scopes: z28.array(z28.string()).default([]),
18698
+ scopes: z29.array(z29.string()).default([]),
18392
18699
  createdAt: isoTime.nullable().optional(),
18393
18700
  lastUsedAt: isoTime.nullable().optional(),
18394
18701
  /** When the credential expires if it is not used again; null for sessions. */
18395
18702
  idleExpiresAt: isoTime.nullable().optional()
18396
18703
  });
18397
- var nexusCloudDeviceSchema = z28.object({
18398
- deviceId: z28.string(),
18399
- name: z28.string(),
18400
- platform: z28.string().optional(),
18401
- arch: z28.string().nullable().optional(),
18402
- cliVersion: z28.string().nullable().optional(),
18704
+ var nexusCloudDeviceSchema = z29.object({
18705
+ deviceId: z29.string(),
18706
+ name: z29.string(),
18707
+ platform: z29.string().optional(),
18708
+ arch: z29.string().nullable().optional(),
18709
+ cliVersion: z29.string().nullable().optional(),
18403
18710
  createdAt: isoTime.optional(),
18404
18711
  lastSeenAt: isoTime.nullable().optional(),
18405
18712
  state: deviceState,
18406
18713
  signedOutAt: isoTime.nullable().optional(),
18407
18714
  /** Base64 device certificate; null until the device holds a key grant. */
18408
- certificate: z28.string().nullable().optional(),
18715
+ certificate: z29.string().nullable().optional(),
18409
18716
  /** The current credential's profile, or null with none (signed out or revoked). */
18410
18717
  profile: profile.optional(),
18411
18718
  /** True for the device whose credential made this request. */
18412
- current: z28.boolean().default(false),
18413
- projects: z28.number().int().nonnegative().optional(),
18414
- replicas: z28.number().int().nonnegative().optional(),
18719
+ current: z29.boolean().default(false),
18720
+ projects: z29.number().int().nonnegative().optional(),
18721
+ replicas: z29.number().int().nonnegative().optional(),
18415
18722
  lastSyncAt: isoTime.nullable().optional(),
18416
18723
  lastPresenceAt: isoTime.nullable().optional()
18417
18724
  });
18418
- var nexusCloudOrganizationSchema = z28.object({
18419
- id: z28.string(),
18420
- name: z28.string(),
18421
- slug: z28.string().nullable().optional(),
18422
- role: z28.string().optional(),
18423
- personal: z28.boolean().optional()
18725
+ var nexusCloudOrganizationSchema = z29.object({
18726
+ id: z29.string(),
18727
+ name: z29.string(),
18728
+ slug: z29.string().nullable().optional(),
18729
+ role: z29.string().optional(),
18730
+ personal: z29.boolean().optional()
18424
18731
  });
18425
- var nexusCloudUserSchema = z28.object({
18426
- id: z28.string(),
18427
- email: z28.string(),
18428
- name: z28.string().nullable().optional()
18732
+ var nexusCloudUserSchema = z29.object({
18733
+ id: z29.string(),
18734
+ email: z29.string(),
18735
+ name: z29.string().nullable().optional()
18429
18736
  });
18430
- var nexusCloudWhoamiSchema = z28.object({
18737
+ var nexusCloudWhoamiSchema = z29.object({
18431
18738
  serverTime: isoTime.optional(),
18432
18739
  user: nexusCloudUserSchema,
18433
- organizations: z28.array(nexusCloudOrganizationSchema).default([]),
18740
+ organizations: z29.array(nexusCloudOrganizationSchema).default([]),
18434
18741
  credential: nexusCloudCredentialSchema,
18435
18742
  /** The calling device; null for a session caller. */
18436
18743
  device: nexusCloudDeviceSchema.nullable()
18437
18744
  });
18438
- var nexusCloudDevicePageSchema = z28.object({
18439
- devices: z28.array(nexusCloudDeviceSchema),
18440
- nextCursor: z28.string().max(512).nullable().default(null),
18441
- truncated: z28.boolean().default(false)
18745
+ var nexusCloudDevicePageSchema = z29.object({
18746
+ devices: z29.array(nexusCloudDeviceSchema),
18747
+ nextCursor: z29.string().max(512).nullable().default(null),
18748
+ truncated: z29.boolean().default(false)
18442
18749
  });
18443
- var nexusCloudPresenceSchema = z28.looseObject({
18750
+ var nexusCloudPresenceSchema = z29.looseObject({
18444
18751
  observedAt: isoTime.optional(),
18445
- sync: z28.object({ enabled: z28.boolean() }).optional()
18752
+ sync: z29.object({ enabled: z29.boolean() }).optional()
18446
18753
  });
18447
- var nexusCloudReplicaSchema = z28.object({
18448
- projectId: z28.string(),
18449
- replicaId: z28.string(),
18450
- deviceId: z28.string(),
18451
- deviceName: z28.string(),
18754
+ var nexusCloudReplicaSchema = z29.object({
18755
+ projectId: z29.string(),
18756
+ replicaId: z29.string(),
18757
+ deviceId: z29.string(),
18758
+ deviceName: z29.string(),
18452
18759
  deviceState: deviceState.optional(),
18453
18760
  attachedAt: isoTime.optional(),
18454
18761
  lastSyncAt: isoTime.nullable(),
@@ -18457,72 +18764,72 @@ var nexusCloudReplicaSchema = z28.object({
18457
18764
  /** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
18458
18765
  retiredAt: isoTime.nullable().optional(),
18459
18766
  /** The retired replica's named successor, else null (not retired, or retired with none). */
18460
- successor: z28.string().nullable().optional()
18767
+ successor: z29.string().nullable().optional()
18461
18768
  });
18462
- var nexusCloudDeviceCountsSchema = z28.object({
18463
- active: z28.number().int().nonnegative(),
18464
- total: z28.number().int().nonnegative()
18769
+ var nexusCloudDeviceCountsSchema = z29.object({
18770
+ active: z29.number().int().nonnegative(),
18771
+ total: z29.number().int().nonnegative()
18465
18772
  });
18466
18773
  var projectFields = {
18467
- projectId: z28.string(),
18468
- label: z28.string().nullable(),
18469
- organizationId: z28.string(),
18470
- organizationName: z28.string().optional(),
18471
- remoteUrl: z28.string().nullable().optional(),
18774
+ projectId: z29.string(),
18775
+ label: z29.string().nullable(),
18776
+ organizationId: z29.string(),
18777
+ organizationName: z29.string().optional(),
18778
+ remoteUrl: z29.string().nullable().optional(),
18472
18779
  createdAt: isoTime.optional()
18473
18780
  };
18474
- var nexusCloudProjectListItemSchema = z28.object({
18781
+ var nexusCloudProjectListItemSchema = z29.object({
18475
18782
  ...projectFields,
18476
- role: z28.string(),
18783
+ role: z29.string(),
18477
18784
  /**
18478
18785
  * The project name sealed with the project data key (`Project.encryptedName`), base64;
18479
18786
  * only a holder of the account key can open it (T13102).
18480
18787
  */
18481
- encryptedName: z28.string().nullable().optional(),
18482
- streamId: z28.string().optional(),
18483
- headSeq: z28.number().int().nonnegative().nullable().optional(),
18788
+ encryptedName: z29.string().nullable().optional(),
18789
+ streamId: z29.string().optional(),
18790
+ headSeq: z29.number().int().nonnegative().nullable().optional(),
18484
18791
  /** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
18485
- headCheckpointId: z28.string().nullable().optional(),
18486
- openConflicts: z28.number().int().nonnegative().optional(),
18487
- replicas: z28.array(nexusCloudReplicaSchema).default([]),
18792
+ headCheckpointId: z29.string().nullable().optional(),
18793
+ openConflicts: z29.number().int().nonnegative().optional(),
18794
+ replicas: z29.array(nexusCloudReplicaSchema).default([]),
18488
18795
  devices: nexusCloudDeviceCountsSchema.optional(),
18489
- replicaCount: z28.number().int().nonnegative().optional(),
18796
+ replicaCount: z29.number().int().nonnegative().optional(),
18490
18797
  lastSyncAt: isoTime.nullable().optional(),
18491
18798
  lastPresenceAt: isoTime.nullable().optional(),
18492
18799
  /** This project's replica list was cut at 50 (T12858). */
18493
- replicasTruncated: z28.boolean().default(false)
18800
+ replicasTruncated: z29.boolean().default(false)
18494
18801
  });
18495
- var nexusCloudProjectPageSchema = z28.object({
18496
- projects: z28.array(nexusCloudProjectListItemSchema),
18497
- nextCursor: z28.string().max(512).nullable().default(null),
18802
+ var nexusCloudProjectPageSchema = z29.object({
18803
+ projects: z29.array(nexusCloudProjectListItemSchema),
18804
+ nextCursor: z29.string().max(512).nullable().default(null),
18498
18805
  /** Anything in the page was cut (the project list or a replica list). */
18499
- truncated: z28.boolean().default(false),
18806
+ truncated: z29.boolean().default(false),
18500
18807
  /** The project list itself was cut at 1000 (T12858). */
18501
- projectsTruncated: z28.boolean().default(false)
18808
+ projectsTruncated: z29.boolean().default(false)
18502
18809
  });
18503
- var nexusCloudProjectDetailSchema = z28.object({
18504
- project: z28.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18505
- role: z28.string(),
18506
- canTrash: z28.boolean().optional(),
18507
- openConflicts: z28.number().int().nonnegative(),
18810
+ var nexusCloudProjectDetailSchema = z29.object({
18811
+ project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18812
+ role: z29.string(),
18813
+ canTrash: z29.boolean().optional(),
18814
+ openConflicts: z29.number().int().nonnegative(),
18508
18815
  /** At most 50, oldest attachment first. */
18509
- replicas: z28.array(nexusCloudReplicaSchema),
18816
+ replicas: z29.array(nexusCloudReplicaSchema),
18510
18817
  devices: nexusCloudDeviceCountsSchema,
18511
- replicaCount: z28.number().int().nonnegative().optional(),
18818
+ replicaCount: z29.number().int().nonnegative().optional(),
18512
18819
  lastSyncAt: isoTime.nullable().optional(),
18513
18820
  /** `replicas` was cut at 50. */
18514
- truncated: z28.boolean().default(false),
18515
- stream: z28.object({
18516
- streamId: z28.string(),
18517
- headSeq: z28.number().int().nonnegative(),
18518
- headCheckpointId: z28.string().nullable()
18821
+ truncated: z29.boolean().default(false),
18822
+ stream: z29.object({
18823
+ streamId: z29.string(),
18824
+ headSeq: z29.number().int().nonnegative(),
18825
+ headCheckpointId: z29.string().nullable()
18519
18826
  }).nullable()
18520
18827
  });
18521
- var nexusCloudReplicaPageSchema = z28.object({
18522
- replicas: z28.array(nexusCloudReplicaSchema),
18828
+ var nexusCloudReplicaPageSchema = z29.object({
18829
+ replicas: z29.array(nexusCloudReplicaSchema),
18523
18830
  devices: nexusCloudDeviceCountsSchema.optional(),
18524
- nextCursor: z28.string().max(512).nullable().default(null),
18525
- truncated: z28.boolean().default(false)
18831
+ nextCursor: z29.string().max(512).nullable().default(null),
18832
+ truncated: z29.boolean().default(false)
18526
18833
  });
18527
18834
  var NEXUS_STATUS_CHECK_IDS = [
18528
18835
  "credential.valid",
@@ -18538,56 +18845,56 @@ var NEXUS_STATUS_CHECK_IDS = [
18538
18845
  ];
18539
18846
  var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
18540
18847
  var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
18541
- var knownCheckId = z28.enum(NEXUS_STATUS_CHECK_IDS);
18542
- var nexusCloudStatusCheckSchema = z28.object({
18543
- id: z28.enum(NEXUS_STATUS_CHECK_IDS),
18544
- ok: z28.boolean(),
18545
- required: z28.boolean(),
18546
- detail: z28.string()
18848
+ var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
18849
+ var nexusCloudStatusCheckSchema = z29.object({
18850
+ id: z29.enum(NEXUS_STATUS_CHECK_IDS),
18851
+ ok: z29.boolean(),
18852
+ required: z29.boolean(),
18853
+ detail: z29.string()
18547
18854
  });
18548
- var nexusCloudStatusSchema = z28.object({
18855
+ var nexusCloudStatusSchema = z29.object({
18549
18856
  serverTime: isoTime.optional(),
18550
- apiVersion: z28.string().optional(),
18857
+ apiVersion: z29.string().optional(),
18551
18858
  /**
18552
18859
  * Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
18553
18860
  * than the list, which therefore support none of them.
18554
18861
  */
18555
- features: z28.array(z28.string()).optional(),
18862
+ features: z29.array(z29.string()).optional(),
18556
18863
  user: nexusCloudUserSchema,
18557
18864
  credential: nexusCloudCredentialSchema,
18558
18865
  device: nexusCloudDeviceSchema.nullable(),
18559
- project: z28.object({
18560
- projectId: z28.string(),
18561
- registered: z28.boolean(),
18562
- organizationId: z28.string().nullable(),
18563
- organizationName: z28.string().nullable(),
18564
- role: z28.string().nullable()
18866
+ project: z29.object({
18867
+ projectId: z29.string(),
18868
+ registered: z29.boolean(),
18869
+ organizationId: z29.string().nullable(),
18870
+ organizationName: z29.string().nullable(),
18871
+ role: z29.string().nullable()
18565
18872
  }).nullable(),
18566
- replica: z28.object({
18567
- replicaId: z28.string(),
18568
- attached: z28.boolean(),
18569
- attachedElsewhere: z28.boolean(),
18873
+ replica: z29.object({
18874
+ replicaId: z29.string(),
18875
+ attached: z29.boolean(),
18876
+ attachedElsewhere: z29.boolean(),
18570
18877
  attachedAt: isoTime.nullable(),
18571
18878
  lastSyncAt: isoTime.nullable(),
18572
18879
  presenceAt: isoTime.nullable(),
18573
- lastReplicaSeq: z28.number().int().nonnegative().nullable().optional()
18880
+ lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
18574
18881
  }).nullable(),
18575
- stream: z28.object({
18576
- streamId: z28.string(),
18577
- headSeq: z28.number().int().nonnegative(),
18578
- headCheckpointId: z28.string().nullable(),
18579
- openConflicts: z28.number().int().nonnegative(),
18882
+ stream: z29.object({
18883
+ streamId: z29.string(),
18884
+ headSeq: z29.number().int().nonnegative(),
18885
+ headCheckpointId: z29.string().nullable(),
18886
+ openConflicts: z29.number().int().nonnegative(),
18580
18887
  devices: nexusCloudDeviceCountsSchema
18581
18888
  }).nullable(),
18582
18889
  /** Check ids added by a newer server are dropped, never a parse failure. */
18583
- checks: z28.array(nexusCloudStatusCheckSchema.extend({ id: z28.string() })).transform(
18890
+ checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
18584
18891
  (list) => list.flatMap((c) => {
18585
18892
  const id = knownCheckId.safeParse(c.id);
18586
18893
  return id.success ? [{ ...c, id: id.data }] : [];
18587
18894
  })
18588
18895
  ),
18589
18896
  /** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
18590
- verdict: z28.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18897
+ verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18591
18898
  });
18592
18899
  var LOGIN = "run `cleo login nexus`";
18593
18900
  var SESSION_EXPIRED_LOGIN = {
@@ -18632,50 +18939,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
18632
18939
  };
18633
18940
 
18634
18941
  // packages/contracts/src/nexus-vault.ts
18635
- import { z as z29 } from "zod";
18636
- var isoTime2 = z29.iso.datetime({ offset: true });
18637
- var uuid = z29.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
18638
- var nexusUserKeysSchema = z29.looseObject({
18639
- keyVersion: z29.number().int().positive(),
18640
- masterKeyVerifier: z29.string()
18942
+ import { z as z30 } from "zod";
18943
+ var isoTime2 = z30.iso.datetime({ offset: true });
18944
+ 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);
18945
+ var nexusUserKeysSchema = z30.looseObject({
18946
+ keyVersion: z30.number().int().positive(),
18947
+ masterKeyVerifier: z30.string()
18641
18948
  });
18642
- var nexusProjectKeysSchema = z29.looseObject({
18643
- keys: z29.array(
18644
- z29.looseObject({ wrappedProjectKey: z29.string(), keyVersion: z29.number().int().positive() })
18949
+ var nexusProjectKeysSchema = z30.looseObject({
18950
+ keys: z30.array(
18951
+ z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
18645
18952
  )
18646
18953
  });
18647
- var nexusLeaseSchema = z29.looseObject({
18648
- streamId: z29.string(),
18649
- role: z29.string(),
18954
+ var nexusLeaseSchema = z30.looseObject({
18955
+ streamId: z30.string(),
18956
+ role: z30.string(),
18650
18957
  replicaId: uuid,
18651
18958
  expiresAt: isoTime2,
18652
18959
  forkedFromReplicaId: uuid.nullable().optional()
18653
18960
  });
18654
- var nexusLeaseAcquireSchema = z29.looseObject({ lease: nexusLeaseSchema });
18655
- var nexusStreamHeadSchema = z29.looseObject({
18656
- streamId: z29.string(),
18657
- kind: z29.string().optional(),
18658
- headSeq: z29.number().int().nonnegative(),
18659
- headCheckpointId: z29.string().nullable(),
18961
+ var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
18962
+ var nexusStreamHeadSchema = z30.looseObject({
18963
+ streamId: z30.string(),
18964
+ kind: z30.string().optional(),
18965
+ headSeq: z30.number().int().nonnegative(),
18966
+ headCheckpointId: z30.string().nullable(),
18660
18967
  /**
18661
18968
  * The highest segment `schemaVersion` the stream holds (the server raises it on every append).
18662
18969
  * Absent from an older server.
18663
18970
  */
18664
- maxSchemaVersion: z29.number().int().nonnegative().optional()
18971
+ maxSchemaVersion: z30.number().int().nonnegative().optional()
18665
18972
  });
18666
- var nexusActivityEventSchema = z29.looseObject({
18667
- id: z29.union([z29.string(), z29.number()]),
18973
+ var nexusActivityEventSchema = z30.looseObject({
18974
+ id: z30.union([z30.string(), z30.number()]),
18668
18975
  at: isoTime2,
18669
- actorUserId: z29.string().nullable().optional(),
18670
- actorDeviceId: z29.string().nullable().optional(),
18671
- requestId: z29.string().nullable().optional(),
18672
- action: z29.string(),
18673
- target: z29.string().nullable().optional(),
18674
- detail: z29.unknown().optional()
18976
+ actorUserId: z30.string().nullable().optional(),
18977
+ actorDeviceId: z30.string().nullable().optional(),
18978
+ requestId: z30.string().nullable().optional(),
18979
+ action: z30.string(),
18980
+ target: z30.string().nullable().optional(),
18981
+ detail: z30.unknown().optional()
18675
18982
  });
18676
- var nexusActivityPageSchema = z29.looseObject({
18677
- events: z29.array(nexusActivityEventSchema),
18678
- nextBefore: z29.union([z29.string(), z29.number()]).nullable().optional()
18983
+ var nexusActivityPageSchema = z30.looseObject({
18984
+ events: z30.array(nexusActivityEventSchema),
18985
+ nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
18679
18986
  });
18680
18987
 
18681
18988
  // packages/adapters/src/providers/shared/lead-tool-strip.ts