@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
@@ -1845,17 +1845,321 @@ var ChangesetEntrySchema = z3.object({
1845
1845
  });
1846
1846
 
1847
1847
  // packages/contracts/src/config/manifest.ts
1848
- import { z as z5 } from "zod";
1848
+ import { z as z6 } from "zod";
1849
1849
 
1850
- // packages/contracts/src/config/worker-policy.ts
1850
+ // packages/contracts/src/orca-execution.ts
1851
1851
  import { z as z4 } from "zod";
1852
- var projectWorkerPolicySchema = z4.object({
1853
- verification: z4.object({
1854
- full: z4.enum(["local", "ci"]),
1855
- local: z4.enum(["single-file", "affected"])
1852
+ var identifier = z4.string().min(1);
1853
+ var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
1854
+ var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
1855
+ var orchestrateOrcaConfigSchema = z4.object({
1856
+ agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
1857
+ });
1858
+ var orcaContextSchema = z4.object({
1859
+ runtimeId: identifier,
1860
+ coordinatorHandle: identifier,
1861
+ executionHostId: z4.literal("local")
1862
+ });
1863
+ var orcaRoutingRunSchema = z4.object({
1864
+ runId: identifier.nullable(),
1865
+ unconfiguredAgents: z4.array(orcaAgentSchema)
1866
+ });
1867
+ var orcaLaunchSchema = z4.object({
1868
+ projectId: identifier,
1869
+ projectRoot: identifier,
1870
+ taskId: identifier,
1871
+ instanceId: identifier,
1872
+ workerSessionId: identifier,
1873
+ agentId: identifier,
1874
+ role: z4.enum(["worker", "lead"]),
1875
+ protocol: identifier,
1876
+ worktreePath: identifier,
1877
+ worktreeBranch: identifier,
1878
+ projectHash: identifier,
1879
+ lockToken: identifier,
1880
+ prompt: identifier,
1881
+ harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
1882
+ leadMailbox: identifier.nullable(),
1883
+ model: identifier.optional(),
1884
+ effort: identifier.optional(),
1885
+ accountId: identifier.optional()
1886
+ });
1887
+ var orcaStartBindingSchema = z4.object({
1888
+ runId: identifier.nullable(),
1889
+ orcaTaskId: identifier.nullable(),
1890
+ retryOf: identifier.nullable()
1891
+ });
1892
+ var orcaAttemptSchema = z4.object({
1893
+ backend: z4.literal("orca"),
1894
+ version: z4.literal(1),
1895
+ /** Monotonic local CAS revision; repeated identical observations still serialize. */
1896
+ revision: z4.number().int().nonnegative(),
1897
+ context: orcaContextSchema,
1898
+ launch: orcaLaunchSchema,
1899
+ promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1900
+ workspaceId: identifier,
1901
+ workspaceSelector: identifier,
1902
+ state: z4.enum([
1903
+ "prepared",
1904
+ "launching",
1905
+ "ready",
1906
+ "turn_unobserved",
1907
+ "outcome_unknown",
1908
+ "stop_pending",
1909
+ "stop_unknown",
1910
+ "stopped",
1911
+ "failed",
1912
+ "circuit_broken"
1913
+ ]),
1914
+ runId: identifier.nullable(),
1915
+ orcaTaskId: identifier.nullable(),
1916
+ dispatchId: identifier.nullable(),
1917
+ retryOf: identifier.nullable(),
1918
+ /** Absent on legacy records, whose original argv cannot safely be reconstructed. */
1919
+ startBinding: orcaStartBindingSchema.optional(),
1920
+ /** UUID reserved before committing a retry; its first send and every replay use this key. */
1921
+ startRequestKey: z4.string().uuid().optional(),
1922
+ startRequestId: identifier.nullable(),
1923
+ /** UUID reserved before committing a stop; its first send and every replay use this key. */
1924
+ stopRequestKey: z4.string().uuid().optional(),
1925
+ /** Orca-issued stop request id, retained only when the stop receipt was received. */
1926
+ stopRequestId: identifier.nullable(),
1927
+ /**
1928
+ * Set when the worker-stop reply came from a runtime that proved it enumerates
1929
+ * every helper it stopped, so an omitted helper list means the worker had none.
1930
+ */
1931
+ stopHelperEvidence: z4.literal("enumerated").optional(),
1932
+ failureCount: z4.number().int().nonnegative(),
1933
+ resourceState: z4.string(),
1934
+ /** Full receipts retain effects, residual resources and recovery advice. */
1935
+ lastReceipt: z4.string().nullable(),
1936
+ lastError: z4.string().nullable(),
1937
+ /** Confirmed pre-dispatch refusal; never inferred from a process exit. */
1938
+ startRefusal: z4.literal("agent_unconfigured").optional(),
1939
+ observedAt: z4.string()
1940
+ });
1941
+ var orcaWorkerDoneSchema = z4.object({
1942
+ messageId: identifier,
1943
+ runtimeId: identifier,
1944
+ runId: identifier,
1945
+ orcaTaskId: identifier,
1946
+ dispatchId: identifier,
1947
+ senderHandle: identifier,
1948
+ outcome: z4.enum(["succeeded", "failed"]),
1949
+ body: z4.string(),
1950
+ reportPath: identifier
1951
+ });
1952
+ var orcaWorkerReportSchema = z4.object({
1953
+ event: orcaWorkerDoneSchema,
1954
+ manifestId: identifier,
1955
+ manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1956
+ reportText: z4.string().min(1).max(65536),
1957
+ reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1958
+ ingestedAt: z4.string().datetime()
1959
+ });
1960
+ var orcaReportDeliverySchema = z4.object({
1961
+ key: identifier,
1962
+ mailbox: identifier.nullable(),
1963
+ state: z4.enum(["pending", "delivered"]),
1964
+ messageId: identifier.nullable(),
1965
+ deliveredAt: z4.string().datetime().nullable(),
1966
+ lastError: z4.string().nullable()
1967
+ });
1968
+ var orcaWorkerSettlementSchema = z4.object({
1969
+ resourceRelease: z4.object({
1970
+ dispatchId: identifier,
1971
+ releasedAt: z4.string().datetime(),
1972
+ receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1973
+ receipt: identifier
1974
+ }).optional(),
1975
+ retiredAt: z4.string().datetime().optional(),
1976
+ reportDelivery: orcaReportDeliverySchema.optional()
1977
+ });
1978
+ var orcaReportMessageSchema = z4.object({
1979
+ id: identifier,
1980
+ run_id: z4.string().nullable(),
1981
+ delivery_contract: z4.string(),
1982
+ from_handle: z4.string(),
1983
+ to_handle: z4.string(),
1984
+ type: z4.string(),
1985
+ body: z4.string(),
1986
+ payload: z4.string().nullable(),
1987
+ sender_pane_key: z4.string().nullable()
1988
+ });
1989
+ var orcaReportSourceSchema = z4.object({
1990
+ ok: z4.literal(true),
1991
+ _meta: z4.object({ runtimeId: identifier }),
1992
+ result: z4.object({
1993
+ messages: z4.array(z4.json()).optional(),
1994
+ dispatch: z4.object({
1995
+ id: identifier,
1996
+ run_id: identifier,
1997
+ task_id: identifier,
1998
+ assignee_handle: identifier,
1999
+ assignee_pane_key: z4.string().nullable(),
2000
+ status: z4.string()
2001
+ }).optional()
2002
+ })
2003
+ });
2004
+ var orcaWorkerDonePayloadSchema = z4.object({
2005
+ taskId: identifier,
2006
+ dispatchId: identifier,
2007
+ outcome: z4.enum(["succeeded", "failed"]),
2008
+ reportPath: identifier
2009
+ });
2010
+ var orcaWorkerRequestSchema = z4.object({
2011
+ action: z4.enum([
2012
+ "show",
2013
+ "read",
2014
+ "recover-start",
2015
+ "recover-stop",
2016
+ "retry",
2017
+ "stop",
2018
+ "ingest-report",
2019
+ "relay-report"
2020
+ ]),
2021
+ recordId: identifier,
2022
+ cursor: identifier.optional(),
2023
+ messageId: identifier.optional()
2024
+ }).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
2025
+ message: "A source-pinned cursor is accepted only for read.",
2026
+ path: ["cursor"]
2027
+ }).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
2028
+ message: "ingest-report requires an exact message id; other actions do not accept one.",
2029
+ path: ["messageId"]
2030
+ });
2031
+ var effectSchema = z4.object({
2032
+ kind: z4.string(),
2033
+ role: z4.string().optional(),
2034
+ action: z4.string().optional(),
2035
+ id: z4.string().optional()
2036
+ });
2037
+ var selectionSchema = z4.object({
2038
+ agent: z4.string().nullable().optional(),
2039
+ model: z4.string().nullable().optional(),
2040
+ effort: z4.string().nullable().optional()
2041
+ });
2042
+ var orcaReplySchema = z4.object({
2043
+ ok: z4.boolean(),
2044
+ _meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
2045
+ error: z4.object({
2046
+ code: z4.string(),
2047
+ message: z4.string(),
2048
+ data: z4.object({
2049
+ requestId: identifier.optional(),
2050
+ orchestrationRequestId: identifier.optional(),
2051
+ dispatchId: identifier.optional()
2052
+ }).optional()
2053
+ }).optional(),
2054
+ result: z4.object({
2055
+ state: z4.string().optional(),
2056
+ requestId: identifier.optional(),
2057
+ /**
2058
+ * Mutation ledger identity Orca stamps on every successful mutation result.
2059
+ * @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
2060
+ * result it records (`Jy` in the retained source), so a successful stop can
2061
+ * be bound to the request key this attempt issued.
2062
+ */
2063
+ mutation: z4.object({
2064
+ requestId: identifier.optional(),
2065
+ replayed: z4.boolean().optional()
2066
+ }).optional(),
2067
+ stage: z4.string().optional(),
2068
+ turnStart: z4.string().optional(),
2069
+ runId: identifier.optional(),
2070
+ run: z4.object({ id: identifier }).nullable().optional(),
2071
+ taskId: identifier.optional(),
2072
+ dispatchId: identifier.optional(),
2073
+ failureCount: z4.number().int().nonnegative().optional(),
2074
+ effects: z4.array(effectSchema).optional(),
2075
+ residualResources: z4.array(effectSchema).optional(),
2076
+ launch: z4.object({ effective: selectionSchema.optional() }).optional(),
2077
+ lastError: z4.string().nullable().optional(),
2078
+ processAction: z4.string().optional(),
2079
+ helpers: z4.array(
2080
+ z4.object({
2081
+ dispatchId: identifier.optional(),
2082
+ creatorDispatchId: identifier.optional(),
2083
+ outcome: z4.string(),
2084
+ keptOpenBy: identifier.optional(),
2085
+ state: z4.string().optional(),
2086
+ lastError: z4.string().nullable().optional()
2087
+ })
2088
+ ).optional(),
2089
+ helperStopError: z4.string().nullable().optional(),
2090
+ status: z4.string().optional(),
2091
+ terminal: z4.object({
2092
+ handle: identifier,
2093
+ connected: z4.boolean(),
2094
+ writable: z4.boolean(),
2095
+ executionHostId: identifier
2096
+ }).optional(),
2097
+ runtime: z4.object({
2098
+ runtimeId: identifier,
2099
+ reachable: z4.boolean(),
2100
+ state: z4.string(),
2101
+ capabilities: z4.array(z4.string())
2102
+ }).optional(),
2103
+ worktree: z4.object({
2104
+ id: identifier,
2105
+ path: identifier,
2106
+ branch: identifier,
2107
+ hostId: identifier,
2108
+ address: z4.object({ worktree: identifier }).optional()
2109
+ }).optional(),
2110
+ dispatch: z4.object({
2111
+ id: identifier,
2112
+ runId: identifier,
2113
+ taskId: identifier,
2114
+ /** Direct creator Dispatch that started this one; null for a Run root. */
2115
+ creatorDispatchId: identifier.nullable().optional(),
2116
+ failureCount: z4.number().int().nonnegative()
2117
+ }).optional(),
2118
+ worker: z4.object({
2119
+ dispatchId: identifier,
2120
+ runtimeEpoch: identifier,
2121
+ state: z4.string(),
2122
+ stage: z4.string(),
2123
+ worktreeId: identifier.nullable()
2124
+ }).optional(),
2125
+ observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
2126
+ projection: z4.object({
2127
+ resource: z4.object({
2128
+ state: z4.string(),
2129
+ terminalState: z4.string(),
2130
+ ownerDispatchId: identifier.optional(),
2131
+ releaseState: z4.string().optional()
2132
+ }).optional()
2133
+ }).optional()
2134
+ }).optional()
2135
+ });
2136
+ var orcaCommandRegistrySchema = z4.object({
2137
+ schemaVersion: z4.number().int().positive(),
2138
+ commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
2139
+ });
2140
+ var accountProviderSchema = z4.object({
2141
+ accounts: z4.array(z4.object({})),
2142
+ activeAccountId: identifier.nullable()
2143
+ });
2144
+ var orcaAccountReplySchema = z4.object({
2145
+ ok: z4.literal(true),
2146
+ _meta: z4.object({ runtimeId: identifier }),
2147
+ result: z4.object({
2148
+ codex: accountProviderSchema,
2149
+ opencode: accountProviderSchema,
2150
+ claude: accountProviderSchema
2151
+ })
2152
+ });
2153
+
2154
+ // packages/contracts/src/config/worker-policy.ts
2155
+ import { z as z5 } from "zod";
2156
+ var projectWorkerPolicySchema = z5.object({
2157
+ verification: z5.object({
2158
+ full: z5.enum(["local", "ci"]),
2159
+ local: z5.enum(["single-file", "affected"])
1856
2160
  }).strict().optional(),
1857
- instructions: z4.array(
1858
- z4.string().min(1).max(512).regex(/\S/).regex(
2161
+ instructions: z5.array(
2162
+ z5.string().min(1).max(512).regex(/\S/).regex(
1859
2163
  /^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
1860
2164
  "Instructions must be single-line text without control characters or a leading #"
1861
2165
  )
@@ -1883,8 +2187,11 @@ var CLEO_CONFIG_MANIFEST = {
1883
2187
  path: ".cleo/config.json",
1884
2188
  mergePrecedence: 20,
1885
2189
  driftDetection: "schema-validate",
1886
- schema: z5.object({
1887
- orchestrate: z5.object({ workerPolicy: projectWorkerPolicySchema.optional() }).passthrough().optional()
2190
+ schema: z6.object({
2191
+ orchestrate: z6.object({
2192
+ workerPolicy: projectWorkerPolicySchema.optional(),
2193
+ orca: orchestrateOrcaConfigSchema.optional()
2194
+ }).passthrough().optional()
1888
2195
  }).passthrough()
1889
2196
  };
1890
2197
  var GLOBAL_CLEO_CONFIG_MANIFEST = {
@@ -1900,139 +2207,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
1900
2207
  GLOBAL_CLEO_CONFIG_MANIFEST,
1901
2208
  CLEO_CONFIG_MANIFEST
1902
2209
  ]);
1903
- var configManifestEntrySchema = z5.object({
1904
- id: z5.string().min(1),
1905
- scope: z5.union([z5.literal("global"), z5.literal("project"), z5.literal("metadata")]),
1906
- path: z5.string().min(1),
1907
- schema: z5.unknown().optional(),
1908
- mergePrecedence: z5.number().int().nonnegative(),
1909
- driftDetection: z5.union([
1910
- z5.literal("schema-validate"),
1911
- z5.literal("staleness-gate"),
1912
- z5.literal("value-diff"),
1913
- z5.literal("none")
2210
+ var configManifestEntrySchema = z6.object({
2211
+ id: z6.string().min(1),
2212
+ scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
2213
+ path: z6.string().min(1),
2214
+ schema: z6.unknown().optional(),
2215
+ mergePrecedence: z6.number().int().nonnegative(),
2216
+ driftDetection: z6.union([
2217
+ z6.literal("schema-validate"),
2218
+ z6.literal("staleness-gate"),
2219
+ z6.literal("value-diff"),
2220
+ z6.literal("none")
1914
2221
  ]),
1915
- defaults: z5.record(z5.string(), z5.unknown()).optional()
2222
+ defaults: z6.record(z6.string(), z6.unknown()).optional()
1916
2223
  });
1917
2224
 
1918
2225
  // packages/contracts/src/daemon/health.ts
1919
- import { z as z7 } from "zod";
2226
+ import { z as z8 } from "zod";
1920
2227
 
1921
2228
  // packages/contracts/src/supervisor-ipc/messages.ts
1922
- import { z as z6 } from "zod";
1923
- var EnvPairSchema = z6.object({
2229
+ import { z as z7 } from "zod";
2230
+ var EnvPairSchema = z7.object({
1924
2231
  /** Environment variable name. */
1925
- key: z6.string().min(1),
2232
+ key: z7.string().min(1),
1926
2233
  /** Environment variable value. */
1927
- value: z6.string()
2234
+ value: z7.string()
1928
2235
  }).strict();
1929
- var ChildStateSchema = z6.enum(["running", "restarting", "stopped"]);
1930
- var ChildStatusSchema = z6.object({
2236
+ var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
2237
+ var ChildStatusSchema = z7.object({
1931
2238
  /** Logical id of the child (stable across restarts). */
1932
- child_id: z6.string().min(1),
2239
+ child_id: z7.string().min(1),
1933
2240
  /** Current OS pid (0 when not currently running). */
1934
- pid: z6.number().int().nonnegative(),
2241
+ pid: z7.number().int().nonnegative(),
1935
2242
  /** Current liveness state. */
1936
2243
  state: ChildStateSchema,
1937
2244
  /** Total restarts observed for this child. */
1938
- restart_count: z6.number().int().nonnegative()
2245
+ restart_count: z7.number().int().nonnegative()
1939
2246
  }).strict();
1940
- var SpawnRequestSchema = z6.object({
2247
+ var SpawnRequestSchema = z7.object({
1941
2248
  /** Tag discriminating this request variant. */
1942
- kind: z6.literal("spawn"),
2249
+ kind: z7.literal("spawn"),
1943
2250
  /** Caller-chosen logical id for the child (stable across restarts). */
1944
- child_id: z6.string().min(1),
2251
+ child_id: z7.string().min(1),
1945
2252
  /** Absolute path to the program to execute. */
1946
- program: z6.string().min(1),
2253
+ program: z7.string().min(1),
1947
2254
  /** Arguments passed to the program. */
1948
- args: z6.array(z6.string()).default([]),
2255
+ args: z7.array(z7.string()).default([]),
1949
2256
  /** Environment overrides applied on top of the supervisor's environment. */
1950
- env: z6.array(EnvPairSchema).default([]),
2257
+ env: z7.array(EnvPairSchema).default([]),
1951
2258
  /** Optional working directory for the child. */
1952
- cwd: z6.string().optional()
2259
+ cwd: z7.string().optional()
1953
2260
  }).strict();
1954
- var RestartRequestSchema = z6.object({
2261
+ var RestartRequestSchema = z7.object({
1955
2262
  /** Tag discriminating this request variant. */
1956
- kind: z6.literal("restart"),
2263
+ kind: z7.literal("restart"),
1957
2264
  /** Logical id of the child to restart. */
1958
- child_id: z6.string().min(1)
2265
+ child_id: z7.string().min(1)
1959
2266
  }).strict();
1960
- var MonitorRequestSchema = z6.object({
2267
+ var MonitorRequestSchema = z7.object({
1961
2268
  /** Tag discriminating this request variant. */
1962
- kind: z6.literal("monitor"),
2269
+ kind: z7.literal("monitor"),
1963
2270
  /** Specific child id to monitor; omit to request all children. */
1964
- child_id: z6.string().optional()
2271
+ child_id: z7.string().optional()
1965
2272
  }).strict();
1966
- var HealthRequestSchema = z6.object({
2273
+ var HealthRequestSchema = z7.object({
1967
2274
  /** Tag discriminating this request variant. */
1968
- kind: z6.literal("health")
2275
+ kind: z7.literal("health")
1969
2276
  }).strict();
1970
- var SupervisorIpcRequestSchema = z6.discriminatedUnion("kind", [
2277
+ var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
1971
2278
  SpawnRequestSchema,
1972
2279
  RestartRequestSchema,
1973
2280
  MonitorRequestSchema,
1974
2281
  HealthRequestSchema
1975
2282
  ]);
1976
- var SpawnedResponseSchema = z6.object({
2283
+ var SpawnedResponseSchema = z7.object({
1977
2284
  /** Tag discriminating this response variant. */
1978
- kind: z6.literal("spawned"),
2285
+ kind: z7.literal("spawned"),
1979
2286
  /** Logical id of the spawned child. */
1980
- child_id: z6.string().min(1),
2287
+ child_id: z7.string().min(1),
1981
2288
  /** OS pid assigned to the spawned child. */
1982
- pid: z6.number().int().nonnegative()
2289
+ pid: z7.number().int().nonnegative()
1983
2290
  }).strict();
1984
- var RestartedResponseSchema = z6.object({
2291
+ var RestartedResponseSchema = z7.object({
1985
2292
  /** Tag discriminating this response variant. */
1986
- kind: z6.literal("restarted"),
2293
+ kind: z7.literal("restarted"),
1987
2294
  /** Logical id of the restarted child. */
1988
- child_id: z6.string().min(1),
2295
+ child_id: z7.string().min(1),
1989
2296
  /** New OS pid after the restart. */
1990
- pid: z6.number().int().nonnegative(),
2297
+ pid: z7.number().int().nonnegative(),
1991
2298
  /** Number of times this child has been restarted in total. */
1992
- restart_count: z6.number().int().nonnegative()
2299
+ restart_count: z7.number().int().nonnegative()
1993
2300
  }).strict();
1994
- var MonitorResponseSchema = z6.object({
2301
+ var MonitorResponseSchema = z7.object({
1995
2302
  /** Tag discriminating this response variant. */
1996
- kind: z6.literal("monitor"),
2303
+ kind: z7.literal("monitor"),
1997
2304
  /** One row per monitored child. */
1998
- children: z6.array(ChildStatusSchema)
2305
+ children: z7.array(ChildStatusSchema)
1999
2306
  }).strict();
2000
- var HealthResponseSchema = z6.object({
2307
+ var HealthResponseSchema = z7.object({
2001
2308
  /** Tag discriminating this response variant. */
2002
- kind: z6.literal("health"),
2309
+ kind: z7.literal("health"),
2003
2310
  /** Supervisor process pid. */
2004
- pid: z6.number().int().nonnegative(),
2311
+ pid: z7.number().int().nonnegative(),
2005
2312
  /** Number of children currently tracked. */
2006
- child_count: z6.number().int().nonnegative(),
2313
+ child_count: z7.number().int().nonnegative(),
2007
2314
  /** Seconds the supervisor has been running. */
2008
- uptime_secs: z6.number().int().nonnegative(),
2315
+ uptime_secs: z7.number().int().nonnegative(),
2009
2316
  /** Frozen protocol version the supervisor speaks. */
2010
- protocol_version: z6.string()
2317
+ protocol_version: z7.string()
2011
2318
  }).strict();
2012
- var LifecycleEventKindSchema = z6.enum(["child_exited", "child_restarted"]);
2013
- var LifecycleEventResponseSchema = z6.object({
2319
+ var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
2320
+ var LifecycleEventResponseSchema = z7.object({
2014
2321
  /** Tag discriminating this response variant. */
2015
- kind: z6.literal("event"),
2322
+ kind: z7.literal("event"),
2016
2323
  /** What happened. */
2017
2324
  event: LifecycleEventKindSchema,
2018
2325
  /** Logical id of the affected child. */
2019
- child_id: z6.string().min(1),
2326
+ child_id: z7.string().min(1),
2020
2327
  /** Exit code, when the OS reported one. */
2021
- exit_code: z6.number().int().optional(),
2328
+ exit_code: z7.number().int().optional(),
2022
2329
  /** Terminating signal name, when the child was signalled (Unix). */
2023
- signal: z6.string().optional(),
2330
+ signal: z7.string().optional(),
2024
2331
  /** Backoff delay (ms) before the pending restart, when applicable. */
2025
- restart_delay_ms: z6.number().int().nonnegative().optional()
2332
+ restart_delay_ms: z7.number().int().nonnegative().optional()
2026
2333
  }).strict();
2027
- var ErrorResponseSchema = z6.object({
2334
+ var ErrorResponseSchema = z7.object({
2028
2335
  /** Tag discriminating this response variant. */
2029
- kind: z6.literal("error"),
2336
+ kind: z7.literal("error"),
2030
2337
  /** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
2031
- code: z6.string().min(1),
2338
+ code: z7.string().min(1),
2032
2339
  /** Human-readable error message. */
2033
- message: z6.string()
2340
+ message: z7.string()
2034
2341
  }).strict();
2035
- var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
2342
+ var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
2036
2343
  SpawnedResponseSchema,
2037
2344
  RestartedResponseSchema,
2038
2345
  MonitorResponseSchema,
@@ -2040,27 +2347,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
2040
2347
  LifecycleEventResponseSchema,
2041
2348
  ErrorResponseSchema
2042
2349
  ]);
2043
- var SupervisorIpcRequestEnvelopeSchema = z6.object({
2350
+ var SupervisorIpcRequestEnvelopeSchema = z7.object({
2044
2351
  /** Frozen protocol version. */
2045
- protocol_version: z6.string(),
2352
+ protocol_version: z7.string(),
2046
2353
  /** Correlation id echoed back on the matching response. */
2047
- id: z6.string().min(1),
2354
+ id: z7.string().min(1),
2048
2355
  /** Direction discriminator. */
2049
- direction: z6.literal("request"),
2356
+ direction: z7.literal("request"),
2050
2357
  /** The request body. */
2051
2358
  request: SupervisorIpcRequestSchema
2052
2359
  }).strict();
2053
- var SupervisorIpcResponseEnvelopeSchema = z6.object({
2360
+ var SupervisorIpcResponseEnvelopeSchema = z7.object({
2054
2361
  /** Frozen protocol version. */
2055
- protocol_version: z6.string(),
2362
+ protocol_version: z7.string(),
2056
2363
  /** Correlation id echoed from the originating request (or a fresh id for events). */
2057
- id: z6.string().min(1),
2364
+ id: z7.string().min(1),
2058
2365
  /** Direction discriminator. */
2059
- direction: z6.literal("response"),
2366
+ direction: z7.literal("response"),
2060
2367
  /** The response body. */
2061
2368
  response: SupervisorIpcResponseSchema
2062
2369
  }).strict();
2063
- var SupervisorIpcEnvelopeSchema = z6.discriminatedUnion("direction", [
2370
+ var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
2064
2371
  SupervisorIpcRequestEnvelopeSchema,
2065
2372
  SupervisorIpcResponseEnvelopeSchema
2066
2373
  ]);
@@ -2084,17 +2391,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
2084
2391
  * Optional human-readable detail (e.g. last error message, queue depth).
2085
2392
  * Diagnostic only — not part of the supervisor wire contract.
2086
2393
  */
2087
- detail: z7.string().optional()
2394
+ detail: z8.string().optional()
2088
2395
  }).strict();
2089
- var HealthStatusSchema = z7.object({
2396
+ var HealthStatusSchema = z8.object({
2090
2397
  /** One health row per registered subsystem. */
2091
- subsystems: z7.array(SubsystemHealthSchema),
2398
+ subsystems: z8.array(SubsystemHealthSchema),
2092
2399
  /**
2093
2400
  * `true` iff every subsystem is in the `running` state. A convenience roll-up
2094
2401
  * derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
2095
2402
  * {@link summarizeHealth} so producers cannot desync it.
2096
2403
  */
2097
- allHealthy: z7.boolean()
2404
+ allHealthy: z8.boolean()
2098
2405
  }).strict();
2099
2406
 
2100
2407
  // packages/contracts/src/db-inventory.json
@@ -14023,7 +14330,7 @@ var OPERATIONS = [
14023
14330
  ];
14024
14331
 
14025
14332
  // packages/contracts/src/docs/modernize.ts
14026
- import { z as z8 } from "zod";
14333
+ import { z as z9 } from "zod";
14027
14334
  var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
14028
14335
  var DOCS_MODERNIZE_OPS = [
14029
14336
  "ingest",
@@ -14037,105 +14344,105 @@ var DOCS_MODERNIZE_OPS = [
14037
14344
  "reslug",
14038
14345
  "link-task"
14039
14346
  ];
14040
- var judgmentSchema = z8.object({
14041
- question: z8.enum(["classify", "merge"]),
14042
- site: z8.string(),
14043
- mode: z8.enum(["off", "shadow", "on"]),
14044
- ruleAnswer: z8.string(),
14045
- decidedAnswer: z8.string().nullable(),
14046
- decidedConfidence: z8.number().nullable(),
14047
- source: z8.enum(["provider", "cache", "fallback"]),
14048
- acted: z8.string()
14347
+ var judgmentSchema = z9.object({
14348
+ question: z9.enum(["classify", "merge"]),
14349
+ site: z9.string(),
14350
+ mode: z9.enum(["off", "shadow", "on"]),
14351
+ ruleAnswer: z9.string(),
14352
+ decidedAnswer: z9.string().nullable(),
14353
+ decidedConfidence: z9.number().nullable(),
14354
+ source: z9.enum(["provider", "cache", "fallback"]),
14355
+ acted: z9.string()
14049
14356
  });
14050
- var relPath = z8.string().min(1).max(1024);
14051
- var docsModernizePlanSchema = z8.object({
14052
- root: z8.string().min(1),
14053
- generatedAt: z8.string(),
14054
- mode: z8.enum(["tree", "store-only"]),
14055
- counts: z8.record(z8.enum(DOCS_MODERNIZE_DISPOSITIONS), z8.number()),
14056
- rows: z8.array(
14057
- z8.object({
14357
+ var relPath = z9.string().min(1).max(1024);
14358
+ var docsModernizePlanSchema = z9.object({
14359
+ root: z9.string().min(1),
14360
+ generatedAt: z9.string(),
14361
+ mode: z9.enum(["tree", "store-only"]),
14362
+ counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
14363
+ rows: z9.array(
14364
+ z9.object({
14058
14365
  path: relPath,
14059
- sha256: z8.string().regex(/^[0-9a-f]{64}$/),
14060
- kind: z8.string().min(1),
14061
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/),
14062
- title: z8.string(),
14063
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
14064
- target: z8.string().min(1).max(1024).nullable(),
14065
- reasons: z8.array(z8.string()),
14066
- judgments: z8.array(judgmentSchema),
14067
- ownerTasks: z8.array(z8.string().regex(/^[TD]\d+$/)),
14068
- category: z8.string(),
14069
- refs: z8.array(z8.string()),
14070
- overridden: z8.boolean(),
14071
- covers: z8.array(z8.string()),
14072
- baselineRemove: z8.boolean()
14366
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/),
14367
+ kind: z9.string().min(1),
14368
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
14369
+ title: z9.string(),
14370
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
14371
+ target: z9.string().min(1).max(1024).nullable(),
14372
+ reasons: z9.array(z9.string()),
14373
+ judgments: z9.array(judgmentSchema),
14374
+ ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
14375
+ category: z9.string(),
14376
+ refs: z9.array(z9.string()),
14377
+ overridden: z9.boolean(),
14378
+ covers: z9.array(z9.string()),
14379
+ baselineRemove: z9.boolean()
14073
14380
  })
14074
14381
  ),
14075
- linkFixes: z8.array(
14076
- z8.object({
14077
- kind: z8.literal("link-fix"),
14382
+ linkFixes: z9.array(
14383
+ z9.object({
14384
+ kind: z9.literal("link-fix"),
14078
14385
  path: relPath,
14079
- href: z8.string().min(1).max(2048),
14080
- newHref: z8.string().min(1).max(2048),
14081
- base: z8.literal("repo").optional(),
14082
- sha256: z8.string().regex(/^[0-9a-f]{64}$/).optional()
14386
+ href: z9.string().min(1).max(2048),
14387
+ newHref: z9.string().min(1).max(2048),
14388
+ base: z9.literal("repo").optional(),
14389
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
14083
14390
  })
14084
14391
  ).optional(),
14085
- repoRoot: z8.string().min(1).optional()
14392
+ repoRoot: z9.string().min(1).optional()
14086
14393
  });
14087
- var docsModernizeOverridesSchema = z8.record(
14394
+ var docsModernizeOverridesSchema = z9.record(
14088
14395
  relPath,
14089
- z8.object({
14090
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
14091
- target: z8.string().min(1).max(1024).nullable().optional(),
14092
- reason: z8.string().min(1),
14093
- kind: z8.string().min(1).optional(),
14094
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
14095
- covers: z8.array(z8.string()).optional()
14396
+ z9.object({
14397
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
14398
+ target: z9.string().min(1).max(1024).nullable().optional(),
14399
+ reason: z9.string().min(1),
14400
+ kind: z9.string().min(1).optional(),
14401
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
14402
+ covers: z9.array(z9.string()).optional()
14096
14403
  })
14097
14404
  );
14098
- var receiptOpSchema = z8.object({
14099
- op: z8.enum(DOCS_MODERNIZE_OPS),
14100
- state: z8.enum(["pending", "done", "reversed"]),
14101
- slug: z8.string().nullable(),
14405
+ var receiptOpSchema = z9.object({
14406
+ op: z9.enum(DOCS_MODERNIZE_OPS),
14407
+ state: z9.enum(["pending", "done", "reversed"]),
14408
+ slug: z9.string().nullable(),
14102
14409
  path: relPath.nullable(),
14103
- target: z8.string().nullable(),
14104
- attachmentId: z8.string().nullable(),
14105
- ownerId: z8.string().nullable(),
14106
- beforeSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
14107
- afterSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
14108
- prior: z8.object({
14109
- lifecycleStatus: z8.string().nullable().optional(),
14110
- supersededBy: z8.string().nullable().optional(),
14111
- supersedes: z8.string().nullable().optional(),
14112
- previousAttachmentId: z8.string().nullable().optional(),
14113
- newAttachmentId: z8.string().nullable().optional(),
14114
- linkTargets: z8.array(z8.string()).optional(),
14115
- kind: z8.string().nullable().optional()
14410
+ target: z9.string().nullable(),
14411
+ attachmentId: z9.string().nullable(),
14412
+ ownerId: z9.string().nullable(),
14413
+ beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
14414
+ afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
14415
+ prior: z9.object({
14416
+ lifecycleStatus: z9.string().nullable().optional(),
14417
+ supersededBy: z9.string().nullable().optional(),
14418
+ supersedes: z9.string().nullable().optional(),
14419
+ previousAttachmentId: z9.string().nullable().optional(),
14420
+ newAttachmentId: z9.string().nullable().optional(),
14421
+ linkTargets: z9.array(z9.string()).optional(),
14422
+ kind: z9.string().nullable().optional()
14116
14423
  }).optional(),
14117
- base: z8.literal("repo").optional()
14424
+ base: z9.literal("repo").optional()
14118
14425
  });
14119
14426
  var docsModernizeJournalLineSchema = receiptOpSchema.extend({
14120
- i: z8.number().int().min(0)
14427
+ i: z9.number().int().min(0)
14121
14428
  });
14122
- var docsModernizeReceiptSchema = z8.object({
14123
- runId: z8.string().regex(/^dm-[\w-]+$/),
14124
- root: z8.string().min(1),
14125
- appliedAt: z8.string(),
14126
- planSha256: z8.string(),
14127
- edgeCount: z8.number(),
14128
- rolledBackAt: z8.string().nullable(),
14129
- blobs: z8.array(z8.object({ path: relPath, sha256: z8.string() })),
14130
- moves: z8.array(z8.object({ from: relPath, to: relPath })),
14131
- deleted: z8.array(relPath),
14132
- ops: z8.array(receiptOpSchema),
14133
- durationMs: z8.number().optional(),
14134
- repoRoot: z8.string().min(1).optional()
14429
+ var docsModernizeReceiptSchema = z9.object({
14430
+ runId: z9.string().regex(/^dm-[\w-]+$/),
14431
+ root: z9.string().min(1),
14432
+ appliedAt: z9.string(),
14433
+ planSha256: z9.string(),
14434
+ edgeCount: z9.number(),
14435
+ rolledBackAt: z9.string().nullable(),
14436
+ blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
14437
+ moves: z9.array(z9.object({ from: relPath, to: relPath })),
14438
+ deleted: z9.array(relPath),
14439
+ ops: z9.array(receiptOpSchema),
14440
+ durationMs: z9.number().optional(),
14441
+ repoRoot: z9.string().min(1).optional()
14135
14442
  });
14136
14443
 
14137
14444
  // packages/contracts/src/docs/provenance.ts
14138
- import { z as z9 } from "zod";
14445
+ import { z as z10 } from "zod";
14139
14446
  var PROVENANCE_NODE_KINDS = [
14140
14447
  "doc",
14141
14448
  "task",
@@ -14158,96 +14465,96 @@ var DOC_LIFECYCLE_STATUSES = [
14158
14465
  "archived",
14159
14466
  "draft"
14160
14467
  ];
14161
- var provenanceNodeKindSchema = z9.enum(PROVENANCE_NODE_KINDS);
14162
- var provenanceEdgeRelationSchema = z9.enum(PROVENANCE_EDGE_RELATIONS);
14163
- var docLifecycleStatusSchema = z9.enum(DOC_LIFECYCLE_STATUSES);
14468
+ var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
14469
+ var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
14470
+ var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
14164
14471
  var provenanceNodeBaseFields = {
14165
- id: z9.string().min(1),
14166
- title: z9.string().min(1),
14167
- metadata: z9.record(z9.string(), z9.unknown()).optional()
14472
+ id: z10.string().min(1),
14473
+ title: z10.string().min(1),
14474
+ metadata: z10.record(z10.string(), z10.unknown()).optional()
14168
14475
  };
14169
- var provenanceDocNodeSchema = z9.object({
14476
+ var provenanceDocNodeSchema = z10.object({
14170
14477
  ...provenanceNodeBaseFields,
14171
- kind: z9.literal("doc"),
14172
- slug: z9.string().min(1),
14173
- docKind: z9.string().min(1),
14478
+ kind: z10.literal("doc"),
14479
+ slug: z10.string().min(1),
14480
+ docKind: z10.string().min(1),
14174
14481
  lifecycleStatus: docLifecycleStatusSchema,
14175
- publishedAt: z9.string().min(1),
14176
- supersededAt: z9.string().min(1).optional(),
14177
- summary: z9.string().optional()
14482
+ publishedAt: z10.string().min(1),
14483
+ supersededAt: z10.string().min(1).optional(),
14484
+ summary: z10.string().optional()
14178
14485
  });
14179
- var provenanceTaskNodeSchema = z9.object({
14486
+ var provenanceTaskNodeSchema = z10.object({
14180
14487
  ...provenanceNodeBaseFields,
14181
- kind: z9.literal("task"),
14182
- taskType: z9.enum(["saga", "epic", "task", "subtask"]),
14183
- status: z9.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
14488
+ kind: z10.literal("task"),
14489
+ taskType: z10.enum(["saga", "epic", "task", "subtask"]),
14490
+ status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
14184
14491
  });
14185
- var provenanceDecisionNodeSchema = z9.object({
14492
+ var provenanceDecisionNodeSchema = z10.object({
14186
14493
  ...provenanceNodeBaseFields,
14187
- kind: z9.literal("decision"),
14188
- outcome: z9.enum(["proposed", "accepted", "rejected", "superseded"]),
14189
- decidedAt: z9.string().min(1)
14494
+ kind: z10.literal("decision"),
14495
+ outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
14496
+ decidedAt: z10.string().min(1)
14190
14497
  });
14191
- var provenanceSessionNodeSchema = z9.object({
14498
+ var provenanceSessionNodeSchema = z10.object({
14192
14499
  ...provenanceNodeBaseFields,
14193
- kind: z9.literal("session"),
14194
- startedAt: z9.string().min(1),
14195
- endedAt: z9.string().min(1).optional()
14500
+ kind: z10.literal("session"),
14501
+ startedAt: z10.string().min(1),
14502
+ endedAt: z10.string().min(1).optional()
14196
14503
  });
14197
- var provenanceMemoryNodeSchema = z9.object({
14504
+ var provenanceMemoryNodeSchema = z10.object({
14198
14505
  ...provenanceNodeBaseFields,
14199
- kind: z9.literal("memory"),
14200
- memoryType: z9.enum(["observation", "pattern", "decision", "diary"]),
14201
- recordedAt: z9.string().min(1)
14506
+ kind: z10.literal("memory"),
14507
+ memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
14508
+ recordedAt: z10.string().min(1)
14202
14509
  });
14203
- var provenanceNodeSchema = z9.discriminatedUnion("kind", [
14510
+ var provenanceNodeSchema = z10.discriminatedUnion("kind", [
14204
14511
  provenanceDocNodeSchema,
14205
14512
  provenanceTaskNodeSchema,
14206
14513
  provenanceDecisionNodeSchema,
14207
14514
  provenanceSessionNodeSchema,
14208
14515
  provenanceMemoryNodeSchema
14209
14516
  ]);
14210
- var provenanceEdgeSchema = z9.object({
14517
+ var provenanceEdgeSchema = z10.object({
14211
14518
  relation: provenanceEdgeRelationSchema,
14212
- from: z9.string().min(1),
14519
+ from: z10.string().min(1),
14213
14520
  fromKind: provenanceNodeKindSchema,
14214
- to: z9.string().min(1),
14521
+ to: z10.string().min(1),
14215
14522
  toKind: provenanceNodeKindSchema,
14216
- addedAt: z9.string().min(1),
14217
- summary: z9.string().optional()
14523
+ addedAt: z10.string().min(1),
14524
+ summary: z10.string().optional()
14218
14525
  });
14219
- var docProvenanceResponseSchema = z9.object({
14220
- nodes: z9.array(provenanceNodeSchema).readonly(),
14221
- edges: z9.array(provenanceEdgeSchema).readonly(),
14222
- totalNodes: z9.number().int().nonnegative(),
14223
- totalEdges: z9.number().int().nonnegative()
14526
+ var docProvenanceResponseSchema = z10.object({
14527
+ nodes: z10.array(provenanceNodeSchema).readonly(),
14528
+ edges: z10.array(provenanceEdgeSchema).readonly(),
14529
+ totalNodes: z10.number().int().nonnegative(),
14530
+ totalEdges: z10.number().int().nonnegative()
14224
14531
  });
14225
14532
 
14226
14533
  // packages/contracts/src/docs/read.ts
14227
- import { z as z10 } from "zod";
14228
- var docFrontmatterSchema = z10.object({
14229
- slug: z10.string(),
14230
- kind: z10.string().nullable(),
14231
- title: z10.string().nullable(),
14232
- summary: z10.string().nullable(),
14233
- lifecycleStatus: z10.string(),
14234
- docVersion: z10.number().int(),
14235
- ownerVersion: z10.string().nullable(),
14236
- supersedes: z10.string().nullable(),
14237
- supersededBy: z10.string().nullable(),
14238
- topics: z10.array(z10.string()).readonly(),
14239
- relatedTasks: z10.array(z10.string()).readonly(),
14240
- sha256: z10.string(),
14241
- createdAt: z10.string()
14534
+ import { z as z11 } from "zod";
14535
+ var docFrontmatterSchema = z11.object({
14536
+ slug: z11.string(),
14537
+ kind: z11.string().nullable(),
14538
+ title: z11.string().nullable(),
14539
+ summary: z11.string().nullable(),
14540
+ lifecycleStatus: z11.string(),
14541
+ docVersion: z11.number().int(),
14542
+ ownerVersion: z11.string().nullable(),
14543
+ supersedes: z11.string().nullable(),
14544
+ supersededBy: z11.string().nullable(),
14545
+ topics: z11.array(z11.string()).readonly(),
14546
+ relatedTasks: z11.array(z11.string()).readonly(),
14547
+ sha256: z11.string(),
14548
+ createdAt: z11.string()
14242
14549
  });
14243
- var docBodySchema = z10.object({
14244
- encoding: z10.enum(["utf-8", "base64"]),
14245
- text: z10.string().optional(),
14246
- base64: z10.string().optional(),
14247
- sizeBytes: z10.number().int().nonnegative(),
14248
- mimeType: z10.string().nullable()
14550
+ var docBodySchema = z11.object({
14551
+ encoding: z11.enum(["utf-8", "base64"]),
14552
+ text: z11.string().optional(),
14553
+ base64: z11.string().optional(),
14554
+ sizeBytes: z11.number().int().nonnegative(),
14555
+ mimeType: z11.string().nullable()
14249
14556
  });
14250
- var docReadResponseSchema = z10.object({
14557
+ var docReadResponseSchema = z11.object({
14251
14558
  frontmatter: docFrontmatterSchema,
14252
14559
  body: docBodySchema
14253
14560
  });
@@ -14420,7 +14727,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
14420
14727
  }
14421
14728
 
14422
14729
  // packages/contracts/src/evidence-atom-schema.ts
14423
- import { z as z11 } from "zod";
14730
+ import { z as z12 } from "zod";
14424
14731
  var EVIDENCE_ATOM_KINDS = [
14425
14732
  "commit",
14426
14733
  "files",
@@ -14442,96 +14749,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
14442
14749
  var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
14443
14750
  var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
14444
14751
  var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
14445
- var commitAtomSchema = z11.object({
14446
- kind: z11.literal("commit"),
14447
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14752
+ var commitAtomSchema = z12.object({
14753
+ kind: z12.literal("commit"),
14754
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14448
14755
  });
14449
- var filesAtomSchema = z11.object({
14450
- kind: z11.literal("files"),
14451
- paths: z11.array(z11.string().min(1)).min(1, "files atom requires at least one path")
14756
+ var filesAtomSchema = z12.object({
14757
+ kind: z12.literal("files"),
14758
+ paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
14452
14759
  });
14453
- var testRunAtomSchema = z11.object({
14454
- kind: z11.literal("test-run"),
14455
- path: z11.string().min(1, "test-run atom requires a non-empty path")
14760
+ var testRunAtomSchema = z12.object({
14761
+ kind: z12.literal("test-run"),
14762
+ path: z12.string().min(1, "test-run atom requires a non-empty path")
14456
14763
  });
14457
- var qaRunAtomSchema = z11.object({
14458
- kind: z11.literal("qa-run"),
14459
- path: z11.string().min(1, "qa-run atom requires a non-empty path")
14764
+ var qaRunAtomSchema = z12.object({
14765
+ kind: z12.literal("qa-run"),
14766
+ path: z12.string().min(1, "qa-run atom requires a non-empty path")
14460
14767
  });
14461
- var toolAtomSchema = z11.object({
14462
- kind: z11.literal("tool"),
14463
- tool: z11.string().min(1, "tool atom requires a non-empty tool name")
14768
+ var toolAtomSchema = z12.object({
14769
+ kind: z12.literal("tool"),
14770
+ tool: z12.string().min(1, "tool atom requires a non-empty tool name")
14464
14771
  });
14465
- var urlAtomSchema = z11.object({
14466
- kind: z11.literal("url"),
14467
- url: z11.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14772
+ var urlAtomSchema = z12.object({
14773
+ kind: z12.literal("url"),
14774
+ url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14468
14775
  });
14469
- var noteAtomSchema = z11.object({
14470
- kind: z11.literal("note"),
14471
- note: z11.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14776
+ var noteAtomSchema = z12.object({
14777
+ kind: z12.literal("note"),
14778
+ note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14472
14779
  });
14473
- var decisionAtomSchema = z11.object({
14474
- kind: z11.literal("decision"),
14475
- decisionId: z11.string().min(1, "decision atom requires a non-empty decision ID")
14780
+ var decisionAtomSchema = z12.object({
14781
+ kind: z12.literal("decision"),
14782
+ decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
14476
14783
  });
14477
- var prAtomSchema = z11.object({
14478
- kind: z11.literal("pr"),
14479
- prNumber: z11.number().int().positive("pr atom requires a positive integer PR number"),
14480
- componentPrNumber: z11.number().int().positive().optional(),
14784
+ var prAtomSchema = z12.object({
14785
+ kind: z12.literal("pr"),
14786
+ prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
14787
+ componentPrNumber: z12.number().int().positive().optional(),
14481
14788
  /**
14482
14789
  * `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
14483
14790
  * belongs to, lowercased. Validated against the evidence git root's
14484
14791
  * `origin`, since PR numbers are only unique per repository.
14485
14792
  */
14486
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14793
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14487
14794
  });
14488
- var ciAtomSchema = z11.object({
14489
- kind: z11.literal("ci"),
14490
- prNumber: z11.number().int().positive("ci atom requires a positive integer PR number"),
14491
- componentPrNumber: z11.number().int().positive().optional(),
14795
+ var ciAtomSchema = z12.object({
14796
+ kind: z12.literal("ci"),
14797
+ prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
14798
+ componentPrNumber: z12.number().int().positive().optional(),
14492
14799
  /** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
14493
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14800
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14494
14801
  });
14495
- var ciRunAtomSchema = z11.object({
14496
- kind: z11.literal("ci-run"),
14497
- runId: z11.number().int().positive("ci-run atom requires a positive integer run id")
14802
+ var ciRunAtomSchema = z12.object({
14803
+ kind: z12.literal("ci-run"),
14804
+ runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
14498
14805
  });
14499
- var deployAtomSchema = z11.object({
14500
- kind: z11.literal("deploy"),
14501
- provider: z11.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14502
- deploymentId: z11.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14503
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14504
- probeUrl: z11.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14806
+ var deployAtomSchema = z12.object({
14807
+ kind: z12.literal("deploy"),
14808
+ provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14809
+ deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14810
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14811
+ probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14505
14812
  });
14506
- var locDropAtomSchema = z11.object({
14507
- kind: z11.literal("loc-drop"),
14508
- fromLines: z11.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14509
- toLines: z11.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14813
+ var locDropAtomSchema = z12.object({
14814
+ kind: z12.literal("loc-drop"),
14815
+ fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14816
+ toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14510
14817
  });
14511
- var callsiteCoverageAtomSchema = z11.object({
14512
- kind: z11.literal("callsite-coverage"),
14513
- symbolName: z11.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14514
- relativeSourcePath: z11.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14818
+ var callsiteCoverageAtomSchema = z12.object({
14819
+ kind: z12.literal("callsite-coverage"),
14820
+ symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14821
+ relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14515
14822
  });
14516
14823
  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}$/;
14517
14824
  var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
14518
14825
  var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
14519
14826
  var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
14520
- var satisfiesAtomSchema = z11.object({
14521
- kind: z11.literal("satisfies"),
14827
+ var satisfiesAtomSchema = z12.object({
14828
+ kind: z12.literal("satisfies"),
14522
14829
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
14523
- targetTaskId: z11.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14830
+ targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14524
14831
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
14525
- targetAcId: z11.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14832
+ targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14526
14833
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
14527
- targetAcAlias: z11.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14834
+ targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14528
14835
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
14529
- versionPin: z11.string().regex(
14836
+ versionPin: z12.string().regex(
14530
14837
  SATISFIES_VERSION_PIN_REGEX,
14531
14838
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
14532
14839
  ).optional()
14533
14840
  });
14534
- var EvidenceAtomSchema = z11.discriminatedUnion("kind", [
14841
+ var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
14535
14842
  commitAtomSchema,
14536
14843
  filesAtomSchema,
14537
14844
  testRunAtomSchema,
@@ -14593,54 +14900,54 @@ var ATOM_EXAMPLES = Object.freeze({
14593
14900
  });
14594
14901
 
14595
14902
  // packages/contracts/src/evidence-record-schema.ts
14596
- import { z as z12 } from "zod";
14597
- var evidenceBaseSchema = z12.object({
14903
+ import { z as z13 } from "zod";
14904
+ var evidenceBaseSchema = z13.object({
14598
14905
  /** Identity string of the agent that produced this record. */
14599
- agentIdentity: z12.string().min(1),
14906
+ agentIdentity: z13.string().min(1),
14600
14907
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
14601
- attachmentSha256: z12.string().length(64),
14908
+ attachmentSha256: z13.string().length(64),
14602
14909
  /** ISO 8601 timestamp at which the action ran. */
14603
- ranAt: z12.string().datetime(),
14910
+ ranAt: z13.string().datetime(),
14604
14911
  /** Wall-clock duration of the action in milliseconds. */
14605
- durationMs: z12.number().nonnegative()
14912
+ durationMs: z13.number().nonnegative()
14606
14913
  });
14607
14914
  var implDiffRecordSchema = evidenceBaseSchema.extend({
14608
- kind: z12.literal("impl-diff"),
14609
- phase: z12.literal("implement"),
14610
- filesChanged: z12.array(z12.string().min(1)).min(1),
14611
- linesAdded: z12.number().int().nonnegative(),
14612
- linesRemoved: z12.number().int().nonnegative()
14915
+ kind: z13.literal("impl-diff"),
14916
+ phase: z13.literal("implement"),
14917
+ filesChanged: z13.array(z13.string().min(1)).min(1),
14918
+ linesAdded: z13.number().int().nonnegative(),
14919
+ linesRemoved: z13.number().int().nonnegative()
14613
14920
  });
14614
14921
  var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
14615
- kind: z12.literal("validate-spec-check"),
14616
- phase: z12.literal("validate"),
14617
- reqIdsChecked: z12.array(z12.string().min(1)).min(1),
14618
- passed: z12.boolean(),
14619
- details: z12.string().min(1)
14922
+ kind: z13.literal("validate-spec-check"),
14923
+ phase: z13.literal("validate"),
14924
+ reqIdsChecked: z13.array(z13.string().min(1)).min(1),
14925
+ passed: z13.boolean(),
14926
+ details: z13.string().min(1)
14620
14927
  });
14621
14928
  var testOutputRecordSchema = evidenceBaseSchema.extend({
14622
- kind: z12.literal("test-output"),
14623
- phase: z12.literal("test"),
14624
- command: z12.string().min(1),
14625
- exitCode: z12.number().int(),
14626
- testsPassed: z12.number().int().nonnegative(),
14627
- testsFailed: z12.number().int().nonnegative()
14929
+ kind: z13.literal("test-output"),
14930
+ phase: z13.literal("test"),
14931
+ command: z13.string().min(1),
14932
+ exitCode: z13.number().int(),
14933
+ testsPassed: z13.number().int().nonnegative(),
14934
+ testsFailed: z13.number().int().nonnegative()
14628
14935
  });
14629
14936
  var lintReportRecordSchema = evidenceBaseSchema.extend({
14630
- kind: z12.literal("lint-report"),
14631
- phase: z12.enum(["implement", "test"]),
14632
- tool: z12.string().min(1),
14633
- passed: z12.boolean(),
14634
- warnings: z12.number().int().nonnegative(),
14635
- errors: z12.number().int().nonnegative()
14937
+ kind: z13.literal("lint-report"),
14938
+ phase: z13.enum(["implement", "test"]),
14939
+ tool: z13.string().min(1),
14940
+ passed: z13.boolean(),
14941
+ warnings: z13.number().int().nonnegative(),
14942
+ errors: z13.number().int().nonnegative()
14636
14943
  });
14637
14944
  var commandOutputRecordSchema = evidenceBaseSchema.extend({
14638
- kind: z12.literal("command-output"),
14639
- phase: z12.enum(["implement", "validate", "test"]),
14640
- cmd: z12.string().min(1),
14641
- exitCode: z12.number().int()
14945
+ kind: z13.literal("command-output"),
14946
+ phase: z13.enum(["implement", "validate", "test"]),
14947
+ cmd: z13.string().min(1),
14948
+ exitCode: z13.number().int()
14642
14949
  });
14643
- var evidenceRecordSchema = z12.discriminatedUnion("kind", [
14950
+ var evidenceRecordSchema = z13.discriminatedUnion("kind", [
14644
14951
  implDiffRecordSchema,
14645
14952
  validateSpecCheckRecordSchema,
14646
14953
  testOutputRecordSchema,
@@ -15575,107 +15882,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
15575
15882
  });
15576
15883
 
15577
15884
  // packages/contracts/src/lease-ipc/messages.ts
15578
- import { z as z13 } from "zod";
15579
- var LeaseScopeSchema = z13.enum(["project", "global"]);
15580
- var LeaseLaneSchema = z13.enum(["tasks", "brain", "bulk"]);
15581
- var LeaseAcquireRequestSchema = z13.object({
15885
+ import { z as z14 } from "zod";
15886
+ var LeaseScopeSchema = z14.enum(["project", "global"]);
15887
+ var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
15888
+ var LeaseAcquireRequestSchema = z14.object({
15582
15889
  /** Tag discriminating this request variant. */
15583
- kind: z13.literal("lease_acquire"),
15890
+ kind: z14.literal("lease_acquire"),
15584
15891
  /** The cleo.db scope being arbitrated. */
15585
15892
  scope: LeaseScopeSchema,
15586
15893
  /** The write lane within the scope. */
15587
15894
  lane: LeaseLaneSchema,
15588
15895
  /** Process+lane holder identity. */
15589
- holder_id: z13.string().min(1),
15896
+ holder_id: z14.string().min(1),
15590
15897
  /** Advisory priority — lower acquires sooner. `0` = highest. */
15591
- priority: z13.number().int().min(0).max(255),
15898
+ priority: z14.number().int().min(0).max(255),
15592
15899
  /** Lease time-to-live in milliseconds. */
15593
- ttl_ms: z13.number().int().nonnegative(),
15900
+ ttl_ms: z14.number().int().nonnegative(),
15594
15901
  /** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
15595
- reentrant: z13.boolean()
15902
+ reentrant: z14.boolean()
15596
15903
  }).strict();
15597
- var LeaseReleaseRequestSchema = z13.object({
15904
+ var LeaseReleaseRequestSchema = z14.object({
15598
15905
  /** Tag discriminating this request variant. */
15599
- kind: z13.literal("lease_release"),
15906
+ kind: z14.literal("lease_release"),
15600
15907
  /** The cleo.db scope being arbitrated. */
15601
15908
  scope: LeaseScopeSchema,
15602
15909
  /** The write lane within the scope. */
15603
15910
  lane: LeaseLaneSchema,
15604
15911
  /** Process+lane holder identity. */
15605
- holder_id: z13.string().min(1),
15912
+ holder_id: z14.string().min(1),
15606
15913
  /** The epoch fence the holder acquired — a stale epoch no-ops. */
15607
- epoch: z13.number().int().nonnegative()
15914
+ epoch: z14.number().int().nonnegative()
15608
15915
  }).strict();
15609
- var LeaseRenewRequestSchema = z13.object({
15916
+ var LeaseRenewRequestSchema = z14.object({
15610
15917
  /** Tag discriminating this request variant. */
15611
- kind: z13.literal("lease_renew"),
15918
+ kind: z14.literal("lease_renew"),
15612
15919
  /** The cleo.db scope being arbitrated. */
15613
15920
  scope: LeaseScopeSchema,
15614
15921
  /** The write lane within the scope. */
15615
15922
  lane: LeaseLaneSchema,
15616
15923
  /** Process+lane holder identity. */
15617
- holder_id: z13.string().min(1),
15924
+ holder_id: z14.string().min(1),
15618
15925
  /** The epoch fence the holder acquired (epoch-guarded renew). */
15619
- epoch: z13.number().int().nonnegative()
15926
+ epoch: z14.number().int().nonnegative()
15620
15927
  }).strict();
15621
- var RateCheckRequestSchema = z13.object({
15928
+ var RateCheckRequestSchema = z14.object({
15622
15929
  /** Tag discriminating this request variant. */
15623
- kind: z13.literal("rate_check"),
15930
+ kind: z14.literal("rate_check"),
15624
15931
  /** The cleo.db scope being checked. */
15625
15932
  scope: LeaseScopeSchema,
15626
15933
  /** The write lane within the scope. */
15627
15934
  lane: LeaseLaneSchema,
15628
15935
  /** Estimated bytes the caller intends to write. */
15629
- est_bytes: z13.number().int().nonnegative()
15936
+ est_bytes: z14.number().int().nonnegative()
15630
15937
  }).strict();
15631
- var ToolGrantRequestSchema = z13.object({
15938
+ var ToolGrantRequestSchema = z14.object({
15632
15939
  /** Tag discriminating this request variant. */
15633
- kind: z13.literal("tool_grant"),
15940
+ kind: z14.literal("tool_grant"),
15634
15941
  /** The tool name being requested. */
15635
- tool: z13.string().min(1),
15942
+ tool: z14.string().min(1),
15636
15943
  /** The requesting holder identity. */
15637
- holder_id: z13.string().min(1)
15944
+ holder_id: z14.string().min(1)
15638
15945
  }).strict();
15639
- var QueuePriorityClassSchema = z13.enum(["lead", "worker", "background"]);
15640
- var QueueAdmitRequestSchema = z13.object({
15946
+ var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
15947
+ var QueueAdmitRequestSchema = z14.object({
15641
15948
  /** Tag discriminating this request variant. */
15642
- kind: z13.literal("queue_admit"),
15949
+ kind: z14.literal("queue_admit"),
15643
15950
  /** The LLM provider id the call targets (rate budget is per-provider). */
15644
- provider: z13.string().min(1),
15951
+ provider: z14.string().min(1),
15645
15952
  /** The caller's priority class (lead > worker > background). */
15646
15953
  priority_class: QueuePriorityClassSchema,
15647
15954
  /** The caller's estimate of the request's token cost (debited on admit). */
15648
- est_tokens: z13.number().int().nonnegative(),
15955
+ est_tokens: z14.number().int().nonnegative(),
15649
15956
  /** The child the call belongs to (in-flight tracking — the watchdog seam). */
15650
- child_id: z13.string().min(1)
15957
+ child_id: z14.string().min(1)
15651
15958
  }).strict();
15652
- var WorkerHeartbeatRequestSchema = z13.object({
15959
+ var WorkerHeartbeatRequestSchema = z14.object({
15653
15960
  /** Tag discriminating this request variant. */
15654
- kind: z13.literal("worker_heartbeat"),
15961
+ kind: z14.literal("worker_heartbeat"),
15655
15962
  /** The logical id of the heartbeating child (matches the registry key). */
15656
- child_id: z13.string().min(1),
15963
+ child_id: z14.string().min(1),
15657
15964
  /** The worker's own view of whether it is currently inside an LLM call. */
15658
- in_flight_llm: z13.boolean()
15965
+ in_flight_llm: z14.boolean()
15659
15966
  }).strict();
15660
- var ResourceAdmitRequestSchema = z13.object({
15967
+ var ResourceAdmitRequestSchema = z14.object({
15661
15968
  /** Tag discriminating this request variant. */
15662
- kind: z13.literal("resource_admit"),
15969
+ kind: z14.literal("resource_admit"),
15663
15970
  /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
15664
- class: z13.string().min(1),
15971
+ class: z14.string().min(1),
15665
15972
  /** The caller holding the slot — process/worktree-unique; the release key. */
15666
- holder_id: z13.string().min(1),
15973
+ holder_id: z14.string().min(1),
15667
15974
  /** The client-computed budget: the max concurrent holders for this class. */
15668
- budget: z13.number().int().nonnegative()
15975
+ budget: z14.number().int().nonnegative()
15669
15976
  }).strict();
15670
- var ResourceReleaseRequestSchema = z13.object({
15977
+ var ResourceReleaseRequestSchema = z14.object({
15671
15978
  /** Tag discriminating this request variant. */
15672
- kind: z13.literal("resource_release"),
15979
+ kind: z14.literal("resource_release"),
15673
15980
  /** The resource class the slot belongs to. */
15674
- class: z13.string().min(1),
15981
+ class: z14.string().min(1),
15675
15982
  /** The holder that was admitted (matches the admit `holder_id`). */
15676
- holder_id: z13.string().min(1)
15983
+ holder_id: z14.string().min(1)
15677
15984
  }).strict();
15678
- var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15985
+ var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
15679
15986
  LeaseAcquireRequestSchema,
15680
15987
  LeaseReleaseRequestSchema,
15681
15988
  LeaseRenewRequestSchema,
@@ -15686,133 +15993,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15686
15993
  ResourceAdmitRequestSchema,
15687
15994
  ResourceReleaseRequestSchema
15688
15995
  ]);
15689
- var LeaseGrantedResponseSchema = z13.object({
15996
+ var LeaseGrantedResponseSchema = z14.object({
15690
15997
  /** Tag discriminating this response variant. */
15691
- kind: z13.literal("lease_granted"),
15998
+ kind: z14.literal("lease_granted"),
15692
15999
  /** The granted cleo.db scope. */
15693
16000
  scope: LeaseScopeSchema,
15694
16001
  /** The granted write lane. */
15695
16002
  lane: LeaseLaneSchema,
15696
16003
  /** The holder the lease was granted to. */
15697
- holder_id: z13.string().min(1),
16004
+ holder_id: z14.string().min(1),
15698
16005
  /** The monotonic epoch fence assigned to this grant. */
15699
- epoch: z13.number().int().nonnegative(),
16006
+ epoch: z14.number().int().nonnegative(),
15700
16007
  /** The lease TTL in milliseconds. */
15701
- ttl_ms: z13.number().int().nonnegative(),
16008
+ ttl_ms: z14.number().int().nonnegative(),
15702
16009
  /** Absolute expiry timestamp (epoch ms) for this grant. */
15703
- expires_at_ms: z13.number().int().nonnegative()
16010
+ expires_at_ms: z14.number().int().nonnegative()
15704
16011
  }).strict();
15705
- var LeaseQueuedResponseSchema = z13.object({
16012
+ var LeaseQueuedResponseSchema = z14.object({
15706
16013
  /** Tag discriminating this response variant. */
15707
- kind: z13.literal("lease_queued"),
16014
+ kind: z14.literal("lease_queued"),
15708
16015
  /** The queued cleo.db scope. */
15709
16016
  scope: LeaseScopeSchema,
15710
16017
  /** The queued write lane. */
15711
16018
  lane: LeaseLaneSchema,
15712
16019
  /** The monotonic ticket assigned for FIFO tiebreak. */
15713
- ticket: z13.number().int().nonnegative(),
16020
+ ticket: z14.number().int().nonnegative(),
15714
16021
  /** Number of waiters ahead of this one. */
15715
- ahead: z13.number().int().nonnegative()
16022
+ ahead: z14.number().int().nonnegative()
15716
16023
  }).strict();
15717
- var LeaseDeniedResponseSchema = z13.object({
16024
+ var LeaseDeniedResponseSchema = z14.object({
15718
16025
  /** Tag discriminating this response variant. */
15719
- kind: z13.literal("lease_denied"),
16026
+ kind: z14.literal("lease_denied"),
15720
16027
  /** The denied cleo.db scope. */
15721
16028
  scope: LeaseScopeSchema,
15722
16029
  /** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
15723
- code: z13.string().min(1),
16030
+ code: z14.string().min(1),
15724
16031
  /** Human-readable denial message. */
15725
- message: z13.string()
16032
+ message: z14.string()
15726
16033
  }).strict();
15727
- var RateResultResponseSchema = z13.object({
16034
+ var RateResultResponseSchema = z14.object({
15728
16035
  /** Tag discriminating this response variant. */
15729
- kind: z13.literal("rate_result"),
16036
+ kind: z14.literal("rate_result"),
15730
16037
  /** The checked cleo.db scope. */
15731
16038
  scope: LeaseScopeSchema,
15732
16039
  /** Whether the write is within budget. */
15733
- ok: z13.boolean(),
16040
+ ok: z14.boolean(),
15734
16041
  /** Suggested back-off in milliseconds when `ok` is false. */
15735
- retry_after_ms: z13.number().int().nonnegative(),
16042
+ retry_after_ms: z14.number().int().nonnegative(),
15736
16043
  /** Remaining token budget for the scope. */
15737
- tokens_remaining: z13.number().int().nonnegative()
16044
+ tokens_remaining: z14.number().int().nonnegative()
15738
16045
  }).strict();
15739
- var ToolGrantedResponseSchema = z13.object({
16046
+ var ToolGrantedResponseSchema = z14.object({
15740
16047
  /** Tag discriminating this response variant. */
15741
- kind: z13.literal("tool_granted"),
16048
+ kind: z14.literal("tool_granted"),
15742
16049
  /** The granted tool name. */
15743
- tool: z13.string().min(1),
16050
+ tool: z14.string().min(1),
15744
16051
  /** The holder the tool grant was issued to. */
15745
- holder_id: z13.string().min(1)
16052
+ holder_id: z14.string().min(1)
15746
16053
  }).strict();
15747
- var LeaseRevokedResponseSchema = z13.object({
16054
+ var LeaseRevokedResponseSchema = z14.object({
15748
16055
  /** Tag discriminating this response variant. */
15749
- kind: z13.literal("lease_revoked"),
16056
+ kind: z14.literal("lease_revoked"),
15750
16057
  /** The revoked cleo.db scope. */
15751
16058
  scope: LeaseScopeSchema,
15752
16059
  /** The revoked write lane. */
15753
16060
  lane: LeaseLaneSchema,
15754
16061
  /** The holder whose lease was revoked. */
15755
- holder_id: z13.string().min(1),
16062
+ holder_id: z14.string().min(1),
15756
16063
  /** Human-readable reason for the revocation. */
15757
- reason: z13.string()
16064
+ reason: z14.string()
15758
16065
  }).strict();
15759
- var ChildKilledUnresponsiveResponseSchema = z13.object({
16066
+ var ChildKilledUnresponsiveResponseSchema = z14.object({
15760
16067
  /** Tag discriminating this response variant. */
15761
- kind: z13.literal("child_killed_unresponsive"),
16068
+ kind: z14.literal("child_killed_unresponsive"),
15762
16069
  /** Logical id of the killed child. */
15763
- child_id: z13.string().min(1),
16070
+ child_id: z14.string().min(1),
15764
16071
  /** The holder identity the killed child held the lease as. */
15765
- holder_id: z13.string().min(1),
16072
+ holder_id: z14.string().min(1),
15766
16073
  /** The cleo.db scope the killed child held the lease in. */
15767
16074
  scope: LeaseScopeSchema,
15768
16075
  /** Human-readable reason for the kill. */
15769
- reason: z13.string()
16076
+ reason: z14.string()
15770
16077
  }).strict();
15771
- var QueueAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15772
- var QueueAdmitResultResponseSchema = z13.object({
16078
+ var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
16079
+ var QueueAdmitResultResponseSchema = z14.object({
15773
16080
  /** Tag discriminating this response variant. */
15774
- kind: z13.literal("queue_admit_result"),
16081
+ kind: z14.literal("queue_admit_result"),
15775
16082
  /** Whether the LLM call was admitted or deferred. */
15776
16083
  disposition: QueueAdmitDispositionSchema,
15777
16084
  /** Back-off in ms before re-requesting (0 when admitted). */
15778
- retry_after_ms: z13.number().int().nonnegative(),
16085
+ retry_after_ms: z14.number().int().nonnegative(),
15779
16086
  /** Remaining provider token budget after this decision. */
15780
- tokens_remaining: z13.number().int().nonnegative(),
16087
+ tokens_remaining: z14.number().int().nonnegative(),
15781
16088
  /** Number of higher/equal-priority waiters ahead (0 when admitted). */
15782
- queue_position: z13.number().int().nonnegative()
16089
+ queue_position: z14.number().int().nonnegative()
15783
16090
  }).strict();
15784
- var HeartbeatAckResponseSchema = z13.object({
16091
+ var HeartbeatAckResponseSchema = z14.object({
15785
16092
  /** Tag discriminating this response variant. */
15786
- kind: z13.literal("heartbeat_ack")
16093
+ kind: z14.literal("heartbeat_ack")
15787
16094
  }).strict();
15788
- var ResourceAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15789
- var ResourceAdmitResultResponseSchema = z13.object({
16095
+ var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
16096
+ var ResourceAdmitResultResponseSchema = z14.object({
15790
16097
  /** Tag discriminating this response variant. */
15791
- kind: z13.literal("resource_admit_result"),
16098
+ kind: z14.literal("resource_admit_result"),
15792
16099
  /** Whether the heavy op was admitted or deferred. */
15793
16100
  disposition: ResourceAdmitDispositionSchema,
15794
16101
  /** Back-off in ms before re-requesting (0 when admitted). */
15795
- retry_after_ms: z13.number().int().nonnegative(),
16102
+ retry_after_ms: z14.number().int().nonnegative(),
15796
16103
  /** Remaining slots for the class after this decision. */
15797
- slots_remaining: z13.number().int().nonnegative()
16104
+ slots_remaining: z14.number().int().nonnegative()
15798
16105
  }).strict();
15799
- var ResourceReleaseResultResponseSchema = z13.object({
16106
+ var ResourceReleaseResultResponseSchema = z14.object({
15800
16107
  /** Tag discriminating this response variant. */
15801
- kind: z13.literal("resource_release_result"),
16108
+ kind: z14.literal("resource_release_result"),
15802
16109
  /** Whether a held slot was actually released (false = no such holder). */
15803
- released: z13.boolean(),
16110
+ released: z14.boolean(),
15804
16111
  /** Remaining in-flight holders for the class after the release. */
15805
- slots_remaining: z13.number().int().nonnegative()
16112
+ slots_remaining: z14.number().int().nonnegative()
15806
16113
  }).strict();
15807
- var LeaseErrorResponseSchema = z13.object({
16114
+ var LeaseErrorResponseSchema = z14.object({
15808
16115
  /** Tag discriminating this response variant. */
15809
- kind: z13.literal("error"),
16116
+ kind: z14.literal("error"),
15810
16117
  /** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
15811
- code: z13.string().min(1),
16118
+ code: z14.string().min(1),
15812
16119
  /** Human-readable error message. */
15813
- message: z13.string()
16120
+ message: z14.string()
15814
16121
  }).strict();
15815
- var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
16122
+ var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
15816
16123
  LeaseGrantedResponseSchema,
15817
16124
  LeaseQueuedResponseSchema,
15818
16125
  LeaseDeniedResponseSchema,
@@ -15826,27 +16133,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15826
16133
  ResourceReleaseResultResponseSchema,
15827
16134
  LeaseErrorResponseSchema
15828
16135
  ]);
15829
- var LeaseIpcRequestEnvelopeSchema = z13.object({
16136
+ var LeaseIpcRequestEnvelopeSchema = z14.object({
15830
16137
  /** Parallel protocol version. */
15831
- protocol_version: z13.string(),
16138
+ protocol_version: z14.string(),
15832
16139
  /** Correlation id echoed back on the matching response. */
15833
- id: z13.string().min(1),
16140
+ id: z14.string().min(1),
15834
16141
  /** Direction discriminator. */
15835
- direction: z13.literal("request"),
16142
+ direction: z14.literal("request"),
15836
16143
  /** The request body. */
15837
16144
  request: LeaseIpcRequestSchema
15838
16145
  }).strict();
15839
- var LeaseIpcResponseEnvelopeSchema = z13.object({
16146
+ var LeaseIpcResponseEnvelopeSchema = z14.object({
15840
16147
  /** Parallel protocol version. */
15841
- protocol_version: z13.string(),
16148
+ protocol_version: z14.string(),
15842
16149
  /** Correlation id echoed from the originating request (or a fresh id for events). */
15843
- id: z13.string().min(1),
16150
+ id: z14.string().min(1),
15844
16151
  /** Direction discriminator. */
15845
- direction: z13.literal("response"),
16152
+ direction: z14.literal("response"),
15846
16153
  /** The response body. */
15847
16154
  response: LeaseIpcResponseSchema
15848
16155
  }).strict();
15849
- var LeaseIpcEnvelopeSchema = z13.discriminatedUnion("direction", [
16156
+ var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
15850
16157
  LeaseIpcRequestEnvelopeSchema,
15851
16158
  LeaseIpcResponseEnvelopeSchema
15852
16159
  ]);
@@ -15881,7 +16188,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
15881
16188
  ];
15882
16189
 
15883
16190
  // packages/contracts/src/llm/catalog-schema.ts
15884
- import { z as z14 } from "zod";
16191
+ import { z as z15 } from "zod";
15885
16192
  var CATALOG_MODEL_STATUSES = [
15886
16193
  "stable",
15887
16194
  "beta",
@@ -15890,78 +16197,78 @@ var CATALOG_MODEL_STATUSES = [
15890
16197
  "retired"
15891
16198
  ];
15892
16199
  var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
15893
- var isoDate = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15894
- var semver = z14.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15895
- var catalogModalitiesSchema = z14.object({
15896
- input: z14.array(z14.string()),
15897
- output: z14.array(z14.string())
16200
+ var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
16201
+ var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
16202
+ var catalogModalitiesSchema = z15.object({
16203
+ input: z15.array(z15.string()),
16204
+ output: z15.array(z15.string())
15898
16205
  }).strict();
15899
- var catalogCostSchema = z14.object({
15900
- input: z14.number().optional(),
15901
- output: z14.number().optional(),
15902
- cache_read: z14.number().optional(),
15903
- cache_write: z14.number().optional(),
15904
- context_over_200k: z14.number().optional()
16206
+ var catalogCostSchema = z15.object({
16207
+ input: z15.number().optional(),
16208
+ output: z15.number().optional(),
16209
+ cache_read: z15.number().optional(),
16210
+ cache_write: z15.number().optional(),
16211
+ context_over_200k: z15.number().optional()
15905
16212
  }).strict();
15906
- var catalogLimitSchema = z14.object({
15907
- context: z14.number(),
15908
- output: z14.number()
16213
+ var catalogLimitSchema = z15.object({
16214
+ context: z15.number(),
16215
+ output: z15.number()
15909
16216
  }).strict();
15910
- var catalogModelProviderSchema = z14.object({
15911
- npm: z14.string(),
15912
- api: z14.string()
16217
+ var catalogModelProviderSchema = z15.object({
16218
+ npm: z15.string(),
16219
+ api: z15.string()
15913
16220
  }).strict();
15914
- var catalogModelEntrySchema = z14.object({
15915
- id: z14.string(),
15916
- name: z14.string(),
15917
- family: z14.string(),
15918
- attachment: z14.boolean(),
15919
- reasoning: z14.boolean(),
15920
- temperature: z14.boolean(),
15921
- interleaved: z14.boolean(),
15922
- tool_call: z14.boolean(),
16221
+ var catalogModelEntrySchema = z15.object({
16222
+ id: z15.string(),
16223
+ name: z15.string(),
16224
+ family: z15.string(),
16225
+ attachment: z15.boolean(),
16226
+ reasoning: z15.boolean(),
16227
+ temperature: z15.boolean(),
16228
+ interleaved: z15.boolean(),
16229
+ tool_call: z15.boolean(),
15923
16230
  modalities: catalogModalitiesSchema,
15924
16231
  cost: catalogCostSchema,
15925
16232
  limit: catalogLimitSchema,
15926
- status: z14.enum(CATALOG_MODEL_STATUSES),
16233
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15927
16234
  release_date: isoDate,
15928
16235
  provider: catalogModelProviderSchema
15929
16236
  }).strict();
15930
- var catalogProviderSchema = z14.object({
15931
- id: z14.string(),
15932
- endpoint: z14.string(),
15933
- authTypes: z14.array(z14.enum(CATALOG_AUTH_TYPES)).min(1),
15934
- npm: z14.string().optional()
16237
+ var catalogProviderSchema = z15.object({
16238
+ id: z15.string(),
16239
+ endpoint: z15.string(),
16240
+ authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
16241
+ npm: z15.string().optional()
15935
16242
  }).strict();
15936
- var curatedCatalogSchema = z14.object({
15937
- $schema: z14.string().optional(),
16243
+ var curatedCatalogSchema = z15.object({
16244
+ $schema: z15.string().optional(),
15938
16245
  version: semver,
15939
16246
  lastUpdated: isoDate,
15940
- providers: z14.record(z14.string(), catalogProviderSchema),
15941
- models: z14.record(z14.string(), z14.record(z14.string(), catalogModelEntrySchema))
16247
+ providers: z15.record(z15.string(), catalogProviderSchema),
16248
+ models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
15942
16249
  }).strict();
15943
- var modelsCatalogRowInsertSchema = z14.object({
15944
- id: z14.string(),
15945
- providerId: z14.string(),
15946
- name: z14.string(),
15947
- family: z14.string(),
15948
- attachment: z14.boolean(),
15949
- reasoning: z14.boolean(),
15950
- temperature: z14.boolean(),
15951
- interleaved: z14.boolean(),
15952
- toolCall: z14.boolean(),
15953
- modalities: z14.string(),
15954
- cost: z14.string(),
15955
- contextLimit: z14.number().nullable().optional(),
15956
- outputLimit: z14.number().nullable().optional(),
15957
- status: z14.enum(CATALOG_MODEL_STATUSES),
16250
+ var modelsCatalogRowInsertSchema = z15.object({
16251
+ id: z15.string(),
16252
+ providerId: z15.string(),
16253
+ name: z15.string(),
16254
+ family: z15.string(),
16255
+ attachment: z15.boolean(),
16256
+ reasoning: z15.boolean(),
16257
+ temperature: z15.boolean(),
16258
+ interleaved: z15.boolean(),
16259
+ toolCall: z15.boolean(),
16260
+ modalities: z15.string(),
16261
+ cost: z15.string(),
16262
+ contextLimit: z15.number().nullable().optional(),
16263
+ outputLimit: z15.number().nullable().optional(),
16264
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15958
16265
  releaseDate: isoDate,
15959
- modelsDevId: z14.string(),
15960
- source: z14.string(),
15961
- seededAt: z14.string().optional()
16266
+ modelsDevId: z15.string(),
16267
+ source: z15.string(),
16268
+ seededAt: z15.string().optional()
15962
16269
  }).strict();
15963
16270
  var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
15964
- seededAt: z14.string()
16271
+ seededAt: z15.string()
15965
16272
  });
15966
16273
 
15967
16274
  // packages/contracts/src/llm/system-of-use.ts
@@ -16009,7 +16316,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
16009
16316
  ];
16010
16317
 
16011
16318
  // packages/contracts/src/workgraph.ts
16012
- import { z as z15 } from "zod";
16319
+ import { z as z16 } from "zod";
16013
16320
 
16014
16321
  // packages/contracts/src/status-registry.ts
16015
16322
  var TASK_STATUSES = [
@@ -16024,10 +16331,10 @@ var TASK_STATUSES = [
16024
16331
 
16025
16332
  // packages/contracts/src/workgraph.ts
16026
16333
  var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
16027
- var taskTypeSchema = z15.enum(["saga", "epic", "task", "subtask"]);
16028
- var taskPrioritySchema = z15.enum(["critical", "high", "medium", "low"]);
16029
- var taskStatusSchema = z15.enum(TASK_STATUSES);
16030
- var verificationGateSchema = z15.enum([
16334
+ var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
16335
+ var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
16336
+ var taskStatusSchema = z16.enum(TASK_STATUSES);
16337
+ var verificationGateSchema = z16.enum([
16031
16338
  "implemented",
16032
16339
  "testsPassed",
16033
16340
  "qaPassed",
@@ -16036,7 +16343,7 @@ var verificationGateSchema = z15.enum([
16036
16343
  "documented",
16037
16344
  "nexusImpact"
16038
16345
  ]);
16039
- var workGraphRelationKindSchema = z15.enum([
16346
+ var workGraphRelationKindSchema = z16.enum([
16040
16347
  "contains",
16041
16348
  "depends_on",
16042
16349
  "blocks",
@@ -16044,317 +16351,317 @@ var workGraphRelationKindSchema = z15.enum([
16044
16351
  "groups",
16045
16352
  "satisfies"
16046
16353
  ]);
16047
- var workGraphTraversalDirectionSchema = z15.enum([
16354
+ var workGraphTraversalDirectionSchema = z16.enum([
16048
16355
  "ancestors",
16049
16356
  "descendants",
16050
16357
  "upstream",
16051
16358
  "downstream"
16052
16359
  ]);
16053
- var workGraphEdgeDirectionSchema = z15.enum(["out", "in", "both"]);
16054
- var paginationParamsSchema = z15.object({
16055
- cursor: z15.string().min(1).optional(),
16056
- limit: z15.number().int().positive().max(500).optional()
16360
+ var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
16361
+ var paginationParamsSchema = z16.object({
16362
+ cursor: z16.string().min(1).optional(),
16363
+ limit: z16.number().int().positive().max(500).optional()
16057
16364
  });
16058
- var workGraphNodeSchema = z15.object({
16059
- id: z15.string().min(1),
16365
+ var workGraphNodeSchema = z16.object({
16366
+ id: z16.string().min(1),
16060
16367
  type: taskTypeSchema,
16061
- title: z15.string(),
16368
+ title: z16.string(),
16062
16369
  status: taskStatusSchema,
16063
16370
  priority: taskPrioritySchema,
16064
- parentId: z15.string().min(1).optional()
16371
+ parentId: z16.string().min(1).optional()
16065
16372
  });
16066
- var workGraphEdgeSchema = z15.object({
16067
- fromId: z15.string().min(1),
16068
- toId: z15.string().min(1),
16373
+ var workGraphEdgeSchema = z16.object({
16374
+ fromId: z16.string().min(1),
16375
+ toId: z16.string().min(1),
16069
16376
  kind: workGraphRelationKindSchema
16070
16377
  });
16071
- var workGraphHierarchyEdgeSchema = z15.object({
16072
- fromId: z15.string().min(1),
16073
- toId: z15.string().min(1),
16074
- kind: z15.literal("contains")
16378
+ var workGraphHierarchyEdgeSchema = z16.object({
16379
+ fromId: z16.string().min(1),
16380
+ toId: z16.string().min(1),
16381
+ kind: z16.literal("contains")
16075
16382
  }).strict();
16076
- var workGraphPageInfoSchema = z15.object({
16077
- nextCursor: z15.string().min(1).optional(),
16078
- hasMore: z15.boolean()
16383
+ var workGraphPageInfoSchema = z16.object({
16384
+ nextCursor: z16.string().min(1).optional(),
16385
+ hasMore: z16.boolean()
16079
16386
  });
16080
- var workGraphRollupCountsSchema = z15.object({
16081
- total: z15.number().int().nonnegative(),
16082
- byStatus: z15.partialRecord(taskStatusSchema, z15.number().int().nonnegative()),
16083
- byType: z15.partialRecord(taskTypeSchema, z15.number().int().nonnegative())
16387
+ var workGraphRollupCountsSchema = z16.object({
16388
+ total: z16.number().int().nonnegative(),
16389
+ byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
16390
+ byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
16084
16391
  });
16085
- var workGraphSubtreePercentagesSchema = z15.object({
16086
- done: z15.number().nonnegative(),
16087
- active: z15.number().nonnegative(),
16088
- blocked: z15.number().nonnegative(),
16089
- pending: z15.number().nonnegative(),
16090
- cancelled: z15.number().nonnegative()
16392
+ var workGraphSubtreePercentagesSchema = z16.object({
16393
+ done: z16.number().nonnegative(),
16394
+ active: z16.number().nonnegative(),
16395
+ blocked: z16.number().nonnegative(),
16396
+ pending: z16.number().nonnegative(),
16397
+ cancelled: z16.number().nonnegative()
16091
16398
  });
16092
- var workGraphProjectionMismatchSchema = z15.object({
16093
- field: z15.string().min(1),
16094
- expected: z15.number().int().nonnegative(),
16095
- actual: z15.number().int().nonnegative()
16399
+ var workGraphProjectionMismatchSchema = z16.object({
16400
+ field: z16.string().min(1),
16401
+ expected: z16.number().int().nonnegative(),
16402
+ actual: z16.number().int().nonnegative()
16096
16403
  });
16097
16404
  var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
16098
- role: z15.string().min(1).optional(),
16099
- dependencyBlockers: z15.array(z15.object({ taskId: z15.string().min(1), status: taskStatusSchema })),
16100
- gateBlockers: z15.array(z15.object({ gate: verificationGateSchema }))
16405
+ role: z16.string().min(1).optional(),
16406
+ dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
16407
+ gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
16101
16408
  });
16102
16409
  var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
16103
- source: z15.literal("relation"),
16104
- relationType: z15.enum(TASK_RELATION_TYPES),
16105
- reason: z15.string().min(1).optional()
16410
+ source: z16.literal("relation"),
16411
+ relationType: z16.enum(TASK_RELATION_TYPES),
16412
+ reason: z16.string().min(1).optional()
16106
16413
  });
16107
16414
  var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
16108
- source: z15.literal("dependency"),
16109
- kind: z15.literal("depends_on")
16415
+ source: z16.literal("dependency"),
16416
+ kind: z16.literal("depends_on")
16110
16417
  });
16111
- var workGraphOmissionReasonSchema = z15.enum([
16418
+ var workGraphOmissionReasonSchema = z16.enum([
16112
16419
  "budget_exceeded",
16113
16420
  "not_requested",
16114
16421
  "not_available",
16115
16422
  "redacted",
16116
16423
  "truncated"
16117
16424
  ]);
16118
- var workGraphContextBudgetSchema = z15.object({
16119
- tokenBudget: z15.number().int().nonnegative(),
16120
- estimatedTokens: z15.number().int().nonnegative(),
16121
- remainingTokens: z15.number().int().nonnegative(),
16122
- truncated: z15.boolean()
16425
+ var workGraphContextBudgetSchema = z16.object({
16426
+ tokenBudget: z16.number().int().nonnegative(),
16427
+ estimatedTokens: z16.number().int().nonnegative(),
16428
+ remainingTokens: z16.number().int().nonnegative(),
16429
+ truncated: z16.boolean()
16123
16430
  });
16124
- var workGraphOmissionSchema = z15.object({
16125
- path: z15.string().min(1),
16431
+ var workGraphOmissionSchema = z16.object({
16432
+ path: z16.string().min(1),
16126
16433
  reason: workGraphOmissionReasonSchema,
16127
- message: z15.string().min(1),
16128
- estimatedTokens: z15.number().int().nonnegative().optional()
16434
+ message: z16.string().min(1),
16435
+ estimatedTokens: z16.number().int().nonnegative().optional()
16129
16436
  });
16130
- var workGraphDirectEdgeSchema = z15.discriminatedUnion("source", [
16437
+ var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
16131
16438
  workGraphRelationEdgeSchema,
16132
16439
  workGraphDependencyEdgeSchema
16133
16440
  ]);
16134
16441
  var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
16135
- rootId: z15.string().min(1),
16136
- tokenBudget: z15.number().int().positive().optional(),
16137
- includeRelations: z15.boolean().optional(),
16138
- includeReadiness: z15.boolean().optional(),
16139
- includeRollup: z15.boolean().optional()
16442
+ rootId: z16.string().min(1),
16443
+ tokenBudget: z16.number().int().positive().optional(),
16444
+ includeRelations: z16.boolean().optional(),
16445
+ includeReadiness: z16.boolean().optional(),
16446
+ includeRollup: z16.boolean().optional()
16140
16447
  });
16141
16448
  var workGraphSliceParamsSchema = paginationParamsSchema.extend({
16142
- rootId: z15.string().min(1),
16449
+ rootId: z16.string().min(1),
16143
16450
  direction: workGraphTraversalDirectionSchema.optional(),
16144
- maxDepth: z15.number().int().nonnegative().optional(),
16145
- includeRelations: z15.boolean().optional()
16451
+ maxDepth: z16.number().int().nonnegative().optional(),
16452
+ includeRelations: z16.boolean().optional()
16146
16453
  });
16147
- var workGraphSliceSchema = z15.object({
16148
- rootId: z15.string().min(1),
16454
+ var workGraphSliceSchema = z16.object({
16455
+ rootId: z16.string().min(1),
16149
16456
  direction: workGraphTraversalDirectionSchema,
16150
- nodes: z15.array(workGraphNodeSchema),
16151
- edges: z15.array(workGraphEdgeSchema),
16457
+ nodes: z16.array(workGraphNodeSchema),
16458
+ edges: z16.array(workGraphEdgeSchema),
16152
16459
  pageInfo: workGraphPageInfoSchema,
16153
- omissions: z15.array(workGraphOmissionSchema).optional()
16460
+ omissions: z16.array(workGraphOmissionSchema).optional()
16154
16461
  });
16155
- var workGraphReadinessParamsSchema = z15.object({
16156
- rootId: z15.string().min(1),
16157
- role: z15.string().min(1).optional(),
16158
- includeGateBlockers: z15.boolean().optional()
16462
+ var workGraphReadinessParamsSchema = z16.object({
16463
+ rootId: z16.string().min(1),
16464
+ role: z16.string().min(1).optional(),
16465
+ includeGateBlockers: z16.boolean().optional()
16159
16466
  });
16160
- var workGraphReadinessResultSchema = z15.object({
16161
- rootId: z15.string().min(1),
16162
- role: z15.string().min(1).optional(),
16163
- ready: z15.boolean(),
16164
- warnings: z15.array(z15.string()),
16165
- groups: z15.object({
16166
- ready: z15.array(workGraphReadyFrontierTaskSchema),
16167
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
16168
- blockedBy: z15.array(
16169
- z15.discriminatedUnion("kind", [
16170
- z15.object({
16171
- kind: z15.literal("dependency"),
16172
- blockerId: z15.string().min(1),
16173
- blocks: z15.array(z15.string().min(1))
16467
+ var workGraphReadinessResultSchema = z16.object({
16468
+ rootId: z16.string().min(1),
16469
+ role: z16.string().min(1).optional(),
16470
+ ready: z16.boolean(),
16471
+ warnings: z16.array(z16.string()),
16472
+ groups: z16.object({
16473
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16474
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16475
+ blockedBy: z16.array(
16476
+ z16.discriminatedUnion("kind", [
16477
+ z16.object({
16478
+ kind: z16.literal("dependency"),
16479
+ blockerId: z16.string().min(1),
16480
+ blocks: z16.array(z16.string().min(1))
16174
16481
  }),
16175
- z15.object({
16176
- kind: z15.literal("gate"),
16482
+ z16.object({
16483
+ kind: z16.literal("gate"),
16177
16484
  gate: verificationGateSchema,
16178
- blocks: z15.array(z15.string().min(1))
16485
+ blocks: z16.array(z16.string().min(1))
16179
16486
  })
16180
16487
  ])
16181
16488
  )
16182
16489
  })
16183
16490
  });
16184
- var workGraphContextPackSchema = z15.object({
16185
- rootId: z15.string().min(1),
16186
- generatedAt: z15.string().min(1),
16491
+ var workGraphContextPackSchema = z16.object({
16492
+ rootId: z16.string().min(1),
16493
+ generatedAt: z16.string().min(1),
16187
16494
  budget: workGraphContextBudgetSchema,
16188
16495
  slice: workGraphSliceSchema,
16189
- relationEdges: z15.object({
16190
- rootId: z15.string().min(1),
16496
+ relationEdges: z16.object({
16497
+ rootId: z16.string().min(1),
16191
16498
  direction: workGraphEdgeDirectionSchema,
16192
- edges: z15.array(workGraphDirectEdgeSchema)
16499
+ edges: z16.array(workGraphDirectEdgeSchema)
16193
16500
  }).optional(),
16194
16501
  readiness: workGraphReadinessResultSchema.optional(),
16195
- rollup: z15.lazy(() => tasksRollupResultSchema).optional(),
16196
- omissions: z15.array(workGraphOmissionSchema)
16502
+ rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
16503
+ omissions: z16.array(workGraphOmissionSchema)
16197
16504
  });
16198
- var workGraphScaffoldValidateParamsSchema = z15.object({
16199
- rootId: z15.string().min(1),
16200
- nodes: z15.array(
16201
- z15.object({
16202
- id: z15.string().min(1),
16505
+ var workGraphScaffoldValidateParamsSchema = z16.object({
16506
+ rootId: z16.string().min(1),
16507
+ nodes: z16.array(
16508
+ z16.object({
16509
+ id: z16.string().min(1),
16203
16510
  type: taskTypeSchema,
16204
- parentId: z15.string().min(1).nullable().optional()
16511
+ parentId: z16.string().min(1).nullable().optional()
16205
16512
  })
16206
16513
  ),
16207
- edges: z15.array(workGraphDirectEdgeSchema).optional(),
16208
- dryRun: z15.boolean().optional()
16514
+ edges: z16.array(workGraphDirectEdgeSchema).optional(),
16515
+ dryRun: z16.boolean().optional()
16209
16516
  });
16210
- var workGraphScaffoldValidationIssueSchema = z15.object({
16211
- code: z15.string().min(1),
16212
- message: z15.string().min(1),
16213
- taskId: z15.string().min(1).optional(),
16214
- severity: z15.enum(["error", "warning"])
16517
+ var workGraphScaffoldValidationIssueSchema = z16.object({
16518
+ code: z16.string().min(1),
16519
+ message: z16.string().min(1),
16520
+ taskId: z16.string().min(1).optional(),
16521
+ severity: z16.enum(["error", "warning"])
16215
16522
  });
16216
- var workGraphScaffoldValidateResultSchema = z15.object({
16217
- rootId: z15.string().min(1),
16218
- valid: z15.boolean(),
16219
- dryRun: z15.boolean(),
16220
- issues: z15.array(workGraphScaffoldValidationIssueSchema),
16221
- hierarchy: z15.object({
16222
- valid: z15.boolean(),
16223
- violations: z15.array(
16224
- z15.object({
16225
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16226
- taskId: z15.string().min(1),
16523
+ var workGraphScaffoldValidateResultSchema = z16.object({
16524
+ rootId: z16.string().min(1),
16525
+ valid: z16.boolean(),
16526
+ dryRun: z16.boolean(),
16527
+ issues: z16.array(workGraphScaffoldValidationIssueSchema),
16528
+ hierarchy: z16.object({
16529
+ valid: z16.boolean(),
16530
+ violations: z16.array(
16531
+ z16.object({
16532
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16533
+ taskId: z16.string().min(1),
16227
16534
  taskType: taskTypeSchema,
16228
- parentId: z15.string().min(1).nullable(),
16535
+ parentId: z16.string().min(1).nullable(),
16229
16536
  parentType: taskTypeSchema.optional(),
16230
- message: z15.string().min(1)
16537
+ message: z16.string().min(1)
16231
16538
  })
16232
16539
  )
16233
16540
  })
16234
16541
  });
16235
16542
  var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
16236
- apply: z15.boolean().optional()
16543
+ apply: z16.boolean().optional()
16237
16544
  });
16238
16545
  var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
16239
- applied: z15.boolean(),
16240
- nodesChanged: z15.number().int().nonnegative(),
16241
- edgesChanged: z15.number().int().nonnegative()
16546
+ applied: z16.boolean(),
16547
+ nodesChanged: z16.number().int().nonnegative(),
16548
+ edgesChanged: z16.number().int().nonnegative()
16242
16549
  });
16243
- var workGraphPlanningDocParamsSchema = z15.object({
16244
- rootId: z15.string().min(1),
16245
- audience: z15.enum(["agent", "maintainer"]),
16246
- tokenBudget: z15.number().int().positive().optional(),
16247
- includeRelations: z15.boolean().optional(),
16248
- includeReadiness: z15.boolean().optional(),
16249
- includeRollup: z15.boolean().optional()
16550
+ var workGraphPlanningDocParamsSchema = z16.object({
16551
+ rootId: z16.string().min(1),
16552
+ audience: z16.enum(["agent", "maintainer"]),
16553
+ tokenBudget: z16.number().int().positive().optional(),
16554
+ includeRelations: z16.boolean().optional(),
16555
+ includeReadiness: z16.boolean().optional(),
16556
+ includeRollup: z16.boolean().optional()
16250
16557
  });
16251
- var workGraphPlanningDocSchema = z15.object({
16252
- rootId: z15.string().min(1),
16253
- generatedAt: z15.string().min(1),
16254
- audience: z15.enum(["agent", "maintainer"]),
16255
- title: z15.string().min(1),
16256
- content: z15.string(),
16257
- sections: z15.array(z15.string().min(1)),
16258
- estimatedTokens: z15.number().int().nonnegative(),
16259
- budget: z15.object({
16260
- tokenBudget: z15.number().int().positive(),
16261
- truncated: z15.boolean()
16558
+ var workGraphPlanningDocSchema = z16.object({
16559
+ rootId: z16.string().min(1),
16560
+ generatedAt: z16.string().min(1),
16561
+ audience: z16.enum(["agent", "maintainer"]),
16562
+ title: z16.string().min(1),
16563
+ content: z16.string(),
16564
+ sections: z16.array(z16.string().min(1)),
16565
+ estimatedTokens: z16.number().int().nonnegative(),
16566
+ budget: z16.object({
16567
+ tokenBudget: z16.number().int().positive(),
16568
+ truncated: z16.boolean()
16262
16569
  }).optional()
16263
16570
  });
16264
16571
  var tasksTraverseParamsSchema = paginationParamsSchema.extend({
16265
- rootId: z15.string().min(1),
16572
+ rootId: z16.string().min(1),
16266
16573
  direction: workGraphTraversalDirectionSchema,
16267
- maxDepth: z15.number().int().nonnegative().optional(),
16268
- includeRelations: z15.boolean().optional()
16574
+ maxDepth: z16.number().int().nonnegative().optional(),
16575
+ includeRelations: z16.boolean().optional()
16269
16576
  });
16270
- var tasksTraverseResultSchema = z15.object({
16271
- rootId: z15.string().min(1),
16577
+ var tasksTraverseResultSchema = z16.object({
16578
+ rootId: z16.string().min(1),
16272
16579
  direction: workGraphTraversalDirectionSchema,
16273
- nodes: z15.array(workGraphNodeSchema),
16274
- edges: z15.array(workGraphEdgeSchema),
16580
+ nodes: z16.array(workGraphNodeSchema),
16581
+ edges: z16.array(workGraphEdgeSchema),
16275
16582
  pageInfo: workGraphPageInfoSchema
16276
16583
  });
16277
16584
  var tasksTreeParamsSchema = paginationParamsSchema.extend({
16278
- rootId: z15.string().min(1),
16279
- maxDepth: z15.number().int().nonnegative().optional()
16585
+ rootId: z16.string().min(1),
16586
+ maxDepth: z16.number().int().nonnegative().optional()
16280
16587
  });
16281
- var tasksTreeResultSchema = z15.object({
16282
- rootId: z15.string().min(1),
16283
- nodes: z15.array(workGraphNodeSchema.extend({ depth: z15.number().int().positive() })),
16284
- edges: z15.array(workGraphHierarchyEdgeSchema),
16588
+ var tasksTreeResultSchema = z16.object({
16589
+ rootId: z16.string().min(1),
16590
+ nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
16591
+ edges: z16.array(workGraphHierarchyEdgeSchema),
16285
16592
  pageInfo: workGraphPageInfoSchema
16286
16593
  });
16287
- var tasksRollupParamsSchema = z15.object({
16288
- rootId: z15.string().min(1),
16594
+ var tasksRollupParamsSchema = z16.object({
16595
+ rootId: z16.string().min(1),
16289
16596
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
16290
16597
  });
16291
- var tasksRollupResultSchema = z15.object({
16292
- rootId: z15.string().min(1),
16598
+ var tasksRollupResultSchema = z16.object({
16599
+ rootId: z16.string().min(1),
16293
16600
  direct: workGraphRollupCountsSchema,
16294
16601
  subtree: workGraphRollupCountsSchema,
16295
- percentDenominator: z15.object({
16296
- basis: z15.literal("subtree-total"),
16297
- total: z15.number().int().nonnegative(),
16298
- description: z15.string().min(1)
16602
+ percentDenominator: z16.object({
16603
+ basis: z16.literal("subtree-total"),
16604
+ total: z16.number().int().nonnegative(),
16605
+ description: z16.string().min(1)
16299
16606
  }),
16300
16607
  percentages: workGraphSubtreePercentagesSchema,
16301
- staleProjection: z15.boolean(),
16302
- projectionMismatches: z15.array(workGraphProjectionMismatchSchema)
16608
+ staleProjection: z16.boolean(),
16609
+ projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
16303
16610
  });
16304
- var tasksFrontierParamsSchema = z15.object({
16305
- rootId: z15.string().min(1),
16306
- role: z15.string().min(1).optional()
16611
+ var tasksFrontierParamsSchema = z16.object({
16612
+ rootId: z16.string().min(1),
16613
+ role: z16.string().min(1).optional()
16307
16614
  });
16308
- var tasksFrontierResultSchema = z15.object({
16309
- rootId: z15.string().min(1),
16310
- role: z15.string().min(1).optional(),
16311
- groups: z15.object({
16312
- ready: z15.array(workGraphReadyFrontierTaskSchema),
16313
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
16314
- blockedBy: z15.array(
16315
- z15.discriminatedUnion("kind", [
16316
- z15.object({
16317
- kind: z15.literal("dependency"),
16318
- blockerId: z15.string().min(1),
16319
- blocks: z15.array(z15.string().min(1))
16615
+ var tasksFrontierResultSchema = z16.object({
16616
+ rootId: z16.string().min(1),
16617
+ role: z16.string().min(1).optional(),
16618
+ groups: z16.object({
16619
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16620
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16621
+ blockedBy: z16.array(
16622
+ z16.discriminatedUnion("kind", [
16623
+ z16.object({
16624
+ kind: z16.literal("dependency"),
16625
+ blockerId: z16.string().min(1),
16626
+ blocks: z16.array(z16.string().min(1))
16320
16627
  }),
16321
- z15.object({
16322
- kind: z15.literal("gate"),
16628
+ z16.object({
16629
+ kind: z16.literal("gate"),
16323
16630
  gate: verificationGateSchema,
16324
- blocks: z15.array(z15.string().min(1))
16631
+ blocks: z16.array(z16.string().min(1))
16325
16632
  })
16326
16633
  ])
16327
16634
  )
16328
16635
  })
16329
16636
  });
16330
16637
  var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
16331
- rootId: z15.string().min(1),
16332
- maxDepth: z15.number().int().nonnegative().optional(),
16333
- includeRelations: z15.boolean().optional()
16638
+ rootId: z16.string().min(1),
16639
+ maxDepth: z16.number().int().nonnegative().optional(),
16640
+ includeRelations: z16.boolean().optional()
16334
16641
  });
16335
- var tasksWorkGraphAuditResultSchema = z15.object({
16336
- rootId: z15.string().min(1),
16337
- hierarchy: z15.object({
16338
- valid: z15.boolean(),
16339
- violations: z15.array(
16340
- z15.object({
16341
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16342
- taskId: z15.string().min(1),
16642
+ var tasksWorkGraphAuditResultSchema = z16.object({
16643
+ rootId: z16.string().min(1),
16644
+ hierarchy: z16.object({
16645
+ valid: z16.boolean(),
16646
+ violations: z16.array(
16647
+ z16.object({
16648
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16649
+ taskId: z16.string().min(1),
16343
16650
  taskType: taskTypeSchema,
16344
- parentId: z15.string().min(1).nullable(),
16651
+ parentId: z16.string().min(1).nullable(),
16345
16652
  parentType: taskTypeSchema.optional(),
16346
- message: z15.string().min(1)
16653
+ message: z16.string().min(1)
16347
16654
  })
16348
16655
  )
16349
16656
  }),
16350
16657
  traversal: tasksTraverseResultSchema,
16351
16658
  frontier: tasksFrontierResultSchema,
16352
16659
  rollup: tasksRollupResultSchema,
16353
- relationEdges: z15.object({
16354
- rootId: z15.string().min(1),
16660
+ relationEdges: z16.object({
16661
+ rootId: z16.string().min(1),
16355
16662
  direction: workGraphEdgeDirectionSchema,
16356
- edges: z15.array(
16357
- z15.discriminatedUnion("source", [
16663
+ edges: z16.array(
16664
+ z16.discriminatedUnion("source", [
16358
16665
  workGraphRelationEdgeSchema,
16359
16666
  workGraphDependencyEdgeSchema
16360
16667
  ])
@@ -16363,60 +16670,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
16363
16670
  });
16364
16671
 
16365
16672
  // packages/contracts/src/operations/docs.ts
16366
- import { z as z16 } from "zod";
16367
- var DOCS_PROJECTION_PROPOSAL_SCHEMA = z16.object({
16368
- version: z16.literal(1),
16369
- operation: z16.literal("docs.projection"),
16370
- identity: z16.object({
16371
- projectId: z16.string().min(1),
16372
- projectRoot: z16.string().min(1),
16373
- actor: z16.string().min(1),
16374
- operation: z16.literal("docs.projection"),
16375
- idempotencyKey: z16.string().min(1)
16673
+ import { z as z17 } from "zod";
16674
+ var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
16675
+ version: z17.literal(1),
16676
+ operation: z17.literal("docs.projection"),
16677
+ identity: z17.object({
16678
+ projectId: z17.string().min(1),
16679
+ projectRoot: z17.string().min(1),
16680
+ actor: z17.string().min(1),
16681
+ operation: z17.literal("docs.projection"),
16682
+ idempotencyKey: z17.string().min(1)
16376
16683
  }).strict(),
16377
- source: z16.object({
16378
- attachmentId: z16.string().min(1),
16379
- sha256: z16.string().regex(/^[a-f0-9]{64}$/),
16380
- ownerId: z16.string().min(1),
16381
- ownerType: z16.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
16382
- label: z16.string().min(1)
16684
+ source: z17.object({
16685
+ attachmentId: z17.string().min(1),
16686
+ sha256: z17.string().regex(/^[a-f0-9]{64}$/),
16687
+ ownerId: z17.string().min(1),
16688
+ ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
16689
+ label: z17.string().min(1)
16383
16690
  }).strict(),
16384
- observation: z16.object({
16385
- kind: z16.literal("doc-attachment"),
16386
- attachmentId: z16.string().min(1),
16387
- ownerId: z16.string().min(1),
16388
- addedAt: z16.string().min(1),
16389
- slug: z16.string().optional(),
16390
- type: z16.string().optional()
16691
+ observation: z17.object({
16692
+ kind: z17.literal("doc-attachment"),
16693
+ attachmentId: z17.string().min(1),
16694
+ ownerId: z17.string().min(1),
16695
+ addedAt: z17.string().min(1),
16696
+ slug: z17.string().optional(),
16697
+ type: z17.string().optional()
16391
16698
  }).strict()
16392
16699
  }).strict();
16393
- var DOCS_PROJECTION_RECEIPT_SCHEMA = z16.object({
16394
- version: z16.literal(1),
16395
- sourceHash: z16.string().regex(/^[a-f0-9]{64}$/),
16396
- graph: z16.enum(["completed", "disabled"]),
16700
+ var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
16701
+ version: z17.literal(1),
16702
+ sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
16703
+ graph: z17.enum(["completed", "disabled"]),
16397
16704
  /** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
16398
- observationId: z16.string().min(1).optional(),
16705
+ observationId: z17.string().min(1).optional(),
16399
16706
  /** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
16400
- documents: z16.literal(true).optional(),
16401
- verifiedAt: z16.string().min(1),
16402
- actor: z16.string().min(1)
16707
+ documents: z17.literal(true).optional(),
16708
+ verifiedAt: z17.string().min(1),
16709
+ actor: z17.string().min(1)
16403
16710
  }).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
16404
16711
  message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
16405
16712
  });
16406
16713
 
16407
16714
  // packages/contracts/src/operations/ensures-schema-registry.ts
16408
- import { z as z17 } from "zod";
16409
- var taskTreeEntrySchema = z17.object({
16410
- 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" }),
16411
- 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), {
16715
+ import { z as z18 } from "zod";
16716
+ var taskTreeEntrySchema = z18.object({
16717
+ 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" }),
16718
+ 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), {
16412
16719
  message: "acceptance array contains no non-empty strings"
16413
16720
  }),
16414
- id: z17.string().optional(),
16415
- parentId: z17.string().optional(),
16416
- depends: z17.array(z17.string()).optional()
16721
+ id: z18.string().optional(),
16722
+ parentId: z18.string().optional(),
16723
+ depends: z18.array(z18.string()).optional()
16417
16724
  });
16418
- 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" });
16419
- var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16725
+ 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" });
16726
+ var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
16420
16727
  if (value === null || value === void 0) {
16421
16728
  ctx.addIssue({
16422
16729
  code: "custom",
@@ -16450,7 +16757,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16450
16757
  message: `evidence must be a string, array, or object (got ${typeof value})`
16451
16758
  });
16452
16759
  });
16453
- var passthroughSchema = z17.unknown();
16760
+ var passthroughSchema = z18.unknown();
16454
16761
  var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
16455
16762
  // release.cantbook
16456
16763
  "version_bump_report",
@@ -16483,44 +16790,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
16483
16790
  var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
16484
16791
 
16485
16792
  // packages/contracts/src/release/evidence-atoms.ts
16486
- import { z as z18 } from "zod";
16487
- var parsedPrEvidenceAtomSchema = z18.object({
16488
- kind: z18.literal("pr"),
16489
- prNumber: z18.number().int().positive()
16793
+ import { z as z19 } from "zod";
16794
+ var parsedPrEvidenceAtomSchema = z19.object({
16795
+ kind: z19.literal("pr"),
16796
+ prNumber: z19.number().int().positive()
16490
16797
  });
16491
- var prEvidenceStateModifierSchema = z18.object({
16492
- kind: z18.literal("state"),
16493
- value: z18.literal("MERGED")
16798
+ var prEvidenceStateModifierSchema = z19.object({
16799
+ kind: z19.literal("state"),
16800
+ value: z19.literal("MERGED")
16494
16801
  });
16495
- var ghPrViewSchema = z18.object({
16496
- state: z18.enum(["OPEN", "CLOSED", "MERGED"]),
16497
- mergedAt: z18.string().nullable(),
16498
- headRefOid: z18.string().optional(),
16499
- mergeCommit: z18.object({ oid: z18.string() }).nullable().optional(),
16500
- title: z18.string().optional(),
16501
- body: z18.string().optional(),
16502
- headRefName: z18.string().optional(),
16503
- files: z18.array(z18.object({ path: z18.string() })).optional(),
16504
- changedFiles: z18.number().int().nonnegative().optional(),
16505
- mergeable: z18.string().optional(),
16506
- statusCheckRollup: z18.array(
16507
- z18.object({
16508
- __typename: z18.string().optional(),
16509
- name: z18.string().optional(),
16510
- workflowName: z18.string().optional(),
16511
- conclusion: z18.string().nullable().optional(),
16512
- status: z18.string().optional(),
16802
+ var ghPrViewSchema = z19.object({
16803
+ state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
16804
+ mergedAt: z19.string().nullable(),
16805
+ headRefOid: z19.string().optional(),
16806
+ mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
16807
+ title: z19.string().optional(),
16808
+ body: z19.string().optional(),
16809
+ headRefName: z19.string().optional(),
16810
+ files: z19.array(z19.object({ path: z19.string() })).optional(),
16811
+ changedFiles: z19.number().int().nonnegative().optional(),
16812
+ mergeable: z19.string().optional(),
16813
+ statusCheckRollup: z19.array(
16814
+ z19.object({
16815
+ __typename: z19.string().optional(),
16816
+ name: z19.string().optional(),
16817
+ workflowName: z19.string().optional(),
16818
+ conclusion: z19.string().nullable().optional(),
16819
+ status: z19.string().optional(),
16513
16820
  /** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
16514
- startedAt: z18.string().nullable().optional(),
16821
+ startedAt: z19.string().nullable().optional(),
16515
16822
  /** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
16516
- completedAt: z18.string().nullable().optional()
16823
+ completedAt: z19.string().nullable().optional()
16517
16824
  }).passthrough()
16518
16825
  ).optional().default([])
16519
16826
  }).passthrough();
16520
16827
  var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
16521
16828
 
16522
16829
  // packages/contracts/src/release/plan.ts
16523
- import { z as z19 } from "zod";
16830
+ import { z as z20 } from "zod";
16524
16831
  var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
16525
16832
  var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
16526
16833
  var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
@@ -16564,20 +16871,20 @@ var RESOLVED_SOURCE = [
16564
16871
  "language-default",
16565
16872
  "legacy-alias"
16566
16873
  ];
16567
- var ReleaseChannelSchema = z19.enum(RELEASE_CHANNEL);
16568
- var ReleaseSchemeSchema = z19.enum(RELEASE_SCHEME);
16569
- var ReleaseKindSchema = z19.enum(RELEASE_KIND);
16570
- var ReleaseStatusSchema = z19.enum(RELEASE_STATUS);
16571
- var GateStatusSchema = z19.enum(GATE_STATUS);
16572
- var GateNameSchema = z19.enum(GATE_NAME);
16573
- var PlatformTupleSchema = z19.enum(PLATFORM_TUPLE);
16574
- var PublisherSchema = z19.enum(PUBLISHER);
16575
- var TaskKindSchema = z19.enum(TASK_KIND);
16576
- var ImpactSchema = z19.enum(IMPACT);
16577
- var ResolvedSourceSchema = z19.enum(RESOLVED_SOURCE);
16578
- var Iso8601 = z19.iso.datetime({ offset: true });
16579
- var NonEmptyString = z19.string().min(1);
16580
- var ReleasePlanTaskSchema = z19.object({
16874
+ var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
16875
+ var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
16876
+ var ReleaseKindSchema = z20.enum(RELEASE_KIND);
16877
+ var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
16878
+ var GateStatusSchema = z20.enum(GATE_STATUS);
16879
+ var GateNameSchema = z20.enum(GATE_NAME);
16880
+ var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
16881
+ var PublisherSchema = z20.enum(PUBLISHER);
16882
+ var TaskKindSchema = z20.enum(TASK_KIND);
16883
+ var ImpactSchema = z20.enum(IMPACT);
16884
+ var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
16885
+ var Iso8601 = z20.iso.datetime({ offset: true });
16886
+ var NonEmptyString = z20.string().min(1);
16887
+ var ReleasePlanTaskSchema = z20.object({
16581
16888
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
16582
16889
  id: NonEmptyString,
16583
16890
  /** Conventional-commit-aligned task classification. */
@@ -16585,20 +16892,20 @@ var ReleasePlanTaskSchema = z19.object({
16585
16892
  /** SemVer impact classification. */
16586
16893
  impact: ImpactSchema,
16587
16894
  /** Human-readable changelog line for this task. */
16588
- userFacingSummary: z19.string(),
16895
+ userFacingSummary: z20.string(),
16589
16896
  /**
16590
16897
  * ADR-051 evidence atoms attesting the task's gate results. Format is
16591
16898
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
16592
16899
  * accepts empty arrays so legacy plans validate; `cleo release plan`
16593
16900
  * enforces non-empty via R-301.
16594
16901
  */
16595
- evidenceAtoms: z19.array(NonEmptyString),
16902
+ evidenceAtoms: z20.array(NonEmptyString),
16596
16903
  /** IVTR phase at plan time — informational only per R-316. */
16597
- ivtrPhaseAtPlan: z19.string().optional(),
16904
+ ivtrPhaseAtPlan: z20.string().optional(),
16598
16905
  /** Epic this task rolls up to, locked at plan time per R-303. */
16599
16906
  epicAncestor: NonEmptyString
16600
16907
  });
16601
- var ReleaseGateSchema = z19.object({
16908
+ var ReleaseGateSchema = z20.object({
16602
16909
  /** Canonical gate name. */
16603
16910
  name: GateNameSchema,
16604
16911
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -16608,11 +16915,11 @@ var ReleaseGateSchema = z19.object({
16608
16915
  /** ISO-8601 timestamp the gate was last verified. */
16609
16916
  lastVerifiedAt: Iso8601,
16610
16917
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
16611
- resolvedCommand: z19.string().optional(),
16918
+ resolvedCommand: z20.string().optional(),
16612
16919
  /** Provenance of the resolved command. Optional for unresolved gates. */
16613
16920
  resolvedSource: ResolvedSourceSchema.optional()
16614
16921
  });
16615
- var ReleasePlatformMatrixEntrySchema = z19.object({
16922
+ var ReleasePlatformMatrixEntrySchema = z20.object({
16616
16923
  /** Target platform tuple. */
16617
16924
  platform: PlatformTupleSchema,
16618
16925
  /** Distribution backend. */
@@ -16620,47 +16927,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
16620
16927
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
16621
16928
  package: NonEmptyString,
16622
16929
  /** Whether to run the GHA smoke job for this matrix entry. */
16623
- smoke: z19.boolean().default(true).optional()
16930
+ smoke: z20.boolean().default(true).optional()
16624
16931
  });
16625
- var ReleasePreflightSummarySchema = z19.object({
16932
+ var ReleasePreflightSummarySchema = z20.object({
16626
16933
  /** True if esbuild externals are out of sync with package.json. */
16627
- esbuildExternalsDrift: z19.boolean(),
16934
+ esbuildExternalsDrift: z20.boolean(),
16628
16935
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
16629
- lockfileDrift: z19.boolean(),
16936
+ lockfileDrift: z20.boolean(),
16630
16937
  /** True if all epic children are in terminal lifecycle states. */
16631
- epicCompletenessClean: z19.boolean(),
16938
+ epicCompletenessClean: z20.boolean(),
16632
16939
  /** True if no task appears in multiple in-flight release plans. */
16633
- doubleListingClean: z19.boolean(),
16940
+ doubleListingClean: z20.boolean(),
16634
16941
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
16635
- preflightWarnings: z19.array(z19.string()).default([]).optional()
16942
+ preflightWarnings: z20.array(z20.string()).default([]).optional()
16636
16943
  });
16637
- var ReleasePlanChangelogSchema = z19.object({
16944
+ var ReleasePlanChangelogSchema = z20.object({
16638
16945
  /** `kind=feat` tasks. */
16639
- features: z19.array(NonEmptyString).default([]),
16946
+ features: z20.array(NonEmptyString).default([]),
16640
16947
  /** `kind=fix` or `kind=hotfix` tasks. */
16641
- fixes: z19.array(NonEmptyString).default([]),
16948
+ fixes: z20.array(NonEmptyString).default([]),
16642
16949
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
16643
- chores: z19.array(NonEmptyString).default([]),
16950
+ chores: z20.array(NonEmptyString).default([]),
16644
16951
  /** `kind=breaking` or `kind=revert` tasks. */
16645
- breaking: z19.array(NonEmptyString).default([])
16952
+ breaking: z20.array(NonEmptyString).default([])
16646
16953
  });
16647
- var ReleasePlanMetaSchema = z19.object({
16954
+ var ReleasePlanMetaSchema = z20.object({
16648
16955
  /** True if this is the project's first ever release. */
16649
- firstEverRelease: z19.boolean().optional(),
16956
+ firstEverRelease: z20.boolean().optional(),
16650
16957
  /** Canonical tool names that could not be resolved at plan time. */
16651
- unresolvedTools: z19.array(z19.string()).optional(),
16958
+ unresolvedTools: z20.array(z20.string()).optional(),
16652
16959
  /** Project archetype detected at plan time. */
16653
- archetype: z19.string().optional()
16654
- }).catchall(z19.unknown());
16655
- var ReleasePlanSchema = z19.object({
16960
+ archetype: z20.string().optional()
16961
+ }).catchall(z20.unknown());
16962
+ var ReleasePlanSchema = z20.object({
16656
16963
  /** Schema URL for this plan version. */
16657
- $schema: z19.string().optional(),
16964
+ $schema: z20.string().optional(),
16658
16965
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
16659
16966
  version: NonEmptyString,
16660
16967
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
16661
16968
  resolvedVersion: NonEmptyString,
16662
16969
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
16663
- suffixApplied: z19.boolean(),
16970
+ suffixApplied: z20.boolean(),
16664
16971
  /** Versioning scheme governing `version` / `resolvedVersion`. */
16665
16972
  scheme: ReleaseSchemeSchema,
16666
16973
  /** npm dist-tag channel for this release. */
@@ -16674,7 +16981,7 @@ var ReleasePlanSchema = z19.object({
16674
16981
  /** Release-kind classification. */
16675
16982
  releaseKind: ReleaseKindSchema,
16676
16983
  /** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
16677
- hooksV1Promotion: z19.boolean().optional(),
16984
+ hooksV1Promotion: z20.boolean().optional(),
16678
16985
  /** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
16679
16986
  hooksV1Waiver: NonEmptyString.optional(),
16680
16987
  /** ISO-8601 timestamp the plan was written. */
@@ -16685,27 +16992,27 @@ var ReleasePlanSchema = z19.object({
16685
16992
  * Version of the previous release on the same channel. MUST be `null` only
16686
16993
  * for first-ever releases (R-300, enforced at the verb layer).
16687
16994
  */
16688
- previousVersion: z19.string().nullable(),
16995
+ previousVersion: z20.string().nullable(),
16689
16996
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
16690
- previousTag: z19.string().nullable(),
16997
+ previousTag: z20.string().nullable(),
16691
16998
  /** ISO-8601 timestamp the previous release was published. */
16692
16999
  previousShippedAt: Iso8601.nullable(),
16693
17000
  /** Tasks rolled into this release. */
16694
- tasks: z19.array(ReleasePlanTaskSchema),
17001
+ tasks: z20.array(ReleasePlanTaskSchema),
16695
17002
  /** Bucketed changelog. */
16696
17003
  changelog: ReleasePlanChangelogSchema,
16697
17004
  /** Per-gate verification status. */
16698
- gates: z19.array(ReleaseGateSchema),
17005
+ gates: z20.array(ReleaseGateSchema),
16699
17006
  /** Platform / publisher matrix. */
16700
- platformMatrix: z19.array(ReleasePlatformMatrixEntrySchema),
17007
+ platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
16701
17008
  /** Preflight summary from `cleo release plan`. */
16702
17009
  preflightSummary: ReleasePreflightSummarySchema,
16703
17010
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
16704
- workflowRunUrl: z19.string().nullable(),
17011
+ workflowRunUrl: z20.string().nullable(),
16705
17012
  /** URL of the bump PR (populated by `cleo release open`). */
16706
- prUrl: z19.string().nullable(),
17013
+ prUrl: z20.string().nullable(),
16707
17014
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
16708
- mergeCommitSha: z19.string().nullable(),
17015
+ mergeCommitSha: z20.string().nullable(),
16709
17016
  /** Current FSM state per R-302. */
16710
17017
  status: ReleaseStatusSchema,
16711
17018
  /** Informational / forward-compat metadata. */
@@ -16735,48 +17042,48 @@ var RESOURCE_CLASSES = Object.freeze([
16735
17042
  ]);
16736
17043
 
16737
17044
  // packages/contracts/src/session-journal.ts
16738
- import { z as z20 } from "zod";
17045
+ import { z as z21 } from "zod";
16739
17046
  var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
16740
- var sessionJournalDoctorSummarySchema = z20.object({
17047
+ var sessionJournalDoctorSummarySchema = z21.object({
16741
17048
  /** `true` when zero noise patterns were detected. */
16742
- isClean: z20.boolean(),
17049
+ isClean: z21.boolean(),
16743
17050
  /** Total number of noise findings across all patterns. */
16744
- findingsCount: z20.number().int().nonnegative(),
17051
+ findingsCount: z21.number().int().nonnegative(),
16745
17052
  /** Pattern names that were detected (empty when isClean). */
16746
- patterns: z20.array(z20.string()),
17053
+ patterns: z21.array(z21.string()),
16747
17054
  /** Total brain entries scanned. `0` = empty or unavailable. */
16748
- totalScanned: z20.number().int().nonnegative()
17055
+ totalScanned: z21.number().int().nonnegative()
16749
17056
  });
16750
- var sessionJournalDebriefSummarySchema = z20.object({
17057
+ var sessionJournalDebriefSummarySchema = z21.object({
16751
17058
  /** First 200 characters of the session end note (if provided). */
16752
- noteExcerpt: z20.string().max(200).optional(),
17059
+ noteExcerpt: z21.string().max(200).optional(),
16753
17060
  /** Number of tasks completed during the session. */
16754
- tasksCompletedCount: z20.number().int().nonnegative(),
17061
+ tasksCompletedCount: z21.number().int().nonnegative(),
16755
17062
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
16756
- tasksFocused: z20.array(z20.string()).max(5).optional()
17063
+ tasksFocused: z21.array(z21.string()).max(5).optional()
16757
17064
  });
16758
- var sessionJournalEntrySchema = z20.object({
17065
+ var sessionJournalEntrySchema = z21.object({
16759
17066
  // Identity
16760
17067
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
16761
- schemaVersion: z20.literal(SESSION_JOURNAL_SCHEMA_VERSION),
17068
+ schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16762
17069
  /** ISO 8601 timestamp when the entry was written. */
16763
- timestamp: z20.string(),
17070
+ timestamp: z21.string(),
16764
17071
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
16765
- sessionId: z20.string(),
17072
+ sessionId: z21.string(),
16766
17073
  /** Event type that triggered this journal entry. */
16767
- eventType: z20.enum(["session_start", "session_end", "observation", "decision", "error"]),
17074
+ eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
16768
17075
  // Session metadata (set on session_start / session_end)
16769
17076
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
16770
- agentIdentifier: z20.string().optional(),
17077
+ agentIdentifier: z21.string().optional(),
16771
17078
  /** Provider adapter ID active for this session. */
16772
- providerId: z20.string().optional(),
17079
+ providerId: z21.string().optional(),
16773
17080
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
16774
- scope: z20.string().optional(),
17081
+ scope: z21.string().optional(),
16775
17082
  // Session-end fields
16776
17083
  /** Duration of the session in seconds (session_end only). */
16777
- duration: z20.number().int().nonnegative().optional(),
17084
+ duration: z21.number().int().nonnegative().optional(),
16778
17085
  /** Task IDs (not titles) completed during the session. */
16779
- tasksCompleted: z20.array(z20.string()).optional(),
17086
+ tasksCompleted: z21.array(z21.string()).optional(),
16780
17087
  // Doctor summary (T1262 absorbed)
16781
17088
  /**
16782
17089
  * Compact result of `scanBrainNoise` run at session-end.
@@ -16791,52 +17098,52 @@ var sessionJournalEntrySchema = z20.object({
16791
17098
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
16792
17099
  // Optional hash chain
16793
17100
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
16794
- prevEntryHash: z20.string().optional()
17101
+ prevEntryHash: z21.string().optional()
16795
17102
  });
16796
17103
 
16797
17104
  // packages/contracts/src/task-evidence.ts
16798
- import { z as z21 } from "zod";
16799
- var fileEvidenceSchema = z21.object({
16800
- kind: z21.literal("file"),
16801
- sha256: z21.string().length(64),
16802
- timestamp: z21.string().datetime(),
16803
- path: z21.string().min(1),
16804
- mime: z21.string().optional(),
16805
- description: z21.string().optional()
17105
+ import { z as z22 } from "zod";
17106
+ var fileEvidenceSchema = z22.object({
17107
+ kind: z22.literal("file"),
17108
+ sha256: z22.string().length(64),
17109
+ timestamp: z22.string().datetime(),
17110
+ path: z22.string().min(1),
17111
+ mime: z22.string().optional(),
17112
+ description: z22.string().optional()
16806
17113
  });
16807
- var logEvidenceSchema = z21.object({
16808
- kind: z21.literal("log"),
16809
- sha256: z21.string().length(64),
16810
- timestamp: z21.string().datetime(),
16811
- source: z21.string().min(1),
16812
- description: z21.string().optional()
17114
+ var logEvidenceSchema = z22.object({
17115
+ kind: z22.literal("log"),
17116
+ sha256: z22.string().length(64),
17117
+ timestamp: z22.string().datetime(),
17118
+ source: z22.string().min(1),
17119
+ description: z22.string().optional()
16813
17120
  });
16814
- var screenshotEvidenceSchema = z21.object({
16815
- kind: z21.literal("screenshot"),
16816
- sha256: z21.string().length(64),
16817
- timestamp: z21.string().datetime(),
16818
- mime: z21.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16819
- description: z21.string().optional()
17121
+ var screenshotEvidenceSchema = z22.object({
17122
+ kind: z22.literal("screenshot"),
17123
+ sha256: z22.string().length(64),
17124
+ timestamp: z22.string().datetime(),
17125
+ mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
17126
+ description: z22.string().optional()
16820
17127
  });
16821
- var testOutputEvidenceSchema = z21.object({
16822
- kind: z21.literal("test-output"),
16823
- sha256: z21.string().length(64),
16824
- timestamp: z21.string().datetime(),
16825
- passed: z21.number().int().nonnegative(),
16826
- failed: z21.number().int().nonnegative(),
16827
- skipped: z21.number().int().nonnegative(),
16828
- exitCode: z21.number().int(),
16829
- description: z21.string().optional()
17128
+ var testOutputEvidenceSchema = z22.object({
17129
+ kind: z22.literal("test-output"),
17130
+ sha256: z22.string().length(64),
17131
+ timestamp: z22.string().datetime(),
17132
+ passed: z22.number().int().nonnegative(),
17133
+ failed: z22.number().int().nonnegative(),
17134
+ skipped: z22.number().int().nonnegative(),
17135
+ exitCode: z22.number().int(),
17136
+ description: z22.string().optional()
16830
17137
  });
16831
- var commandOutputEvidenceSchema = z21.object({
16832
- kind: z21.literal("command-output"),
16833
- sha256: z21.string().length(64),
16834
- timestamp: z21.string().datetime(),
16835
- cmd: z21.string().min(1),
16836
- exitCode: z21.number().int(),
16837
- description: z21.string().optional()
17138
+ var commandOutputEvidenceSchema = z22.object({
17139
+ kind: z22.literal("command-output"),
17140
+ sha256: z22.string().length(64),
17141
+ timestamp: z22.string().datetime(),
17142
+ cmd: z22.string().min(1),
17143
+ exitCode: z22.number().int(),
17144
+ description: z22.string().optional()
16838
17145
  });
16839
- var taskEvidenceSchema = z21.discriminatedUnion("kind", [
17146
+ var taskEvidenceSchema = z22.discriminatedUnion("kind", [
16840
17147
  fileEvidenceSchema,
16841
17148
  logEvidenceSchema,
16842
17149
  screenshotEvidenceSchema,
@@ -16845,8 +17152,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16845
17152
  ]);
16846
17153
 
16847
17154
  // packages/contracts/src/tasks/archive.ts
16848
- import { z as z22 } from "zod";
16849
- var ArchiveReason = z22.enum([
17155
+ import { z as z23 } from "zod";
17156
+ var ArchiveReason = z23.enum([
16850
17157
  "verified",
16851
17158
  "reconciled",
16852
17159
  "superseded",
@@ -16857,42 +17164,42 @@ var ArchiveReason = z22.enum([
16857
17164
  var ARCHIVE_REASON_VALUES = ArchiveReason.options;
16858
17165
 
16859
17166
  // packages/contracts/src/tasks/index.ts
16860
- import { z as z23 } from "zod";
16861
- var taskMutationWarningSeveritySchema = z23.enum(["info", "warning"]);
16862
- var taskMutationWarningSchema = z23.object({
16863
- code: z23.string().min(1),
16864
- message: z23.string().min(1),
17167
+ import { z as z24 } from "zod";
17168
+ var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
17169
+ var taskMutationWarningSchema = z24.object({
17170
+ code: z24.string().min(1),
17171
+ message: z24.string().min(1),
16865
17172
  severity: taskMutationWarningSeveritySchema.optional(),
16866
- taskId: z23.string().min(1).optional(),
16867
- field: z23.string().min(1).optional(),
16868
- index: z23.number().int().nonnegative().optional()
17173
+ taskId: z24.string().min(1).optional(),
17174
+ field: z24.string().min(1).optional(),
17175
+ index: z24.number().int().nonnegative().optional()
16869
17176
  });
16870
- var taskMutationDryRunSummarySchema = z23.object({
16871
- dryRun: z23.literal(true),
16872
- wouldCreate: z23.number().int().nonnegative(),
16873
- wouldUpdate: z23.number().int().nonnegative(),
16874
- wouldDelete: z23.number().int().nonnegative(),
16875
- wouldAffect: z23.number().int().nonnegative(),
16876
- validatedCount: z23.number().int().nonnegative(),
16877
- insertedCount: z23.literal(0),
16878
- updatedCount: z23.literal(0),
16879
- deletedCount: z23.literal(0),
16880
- warnings: z23.array(taskMutationWarningSchema)
17177
+ var taskMutationDryRunSummarySchema = z24.object({
17178
+ dryRun: z24.literal(true),
17179
+ wouldCreate: z24.number().int().nonnegative(),
17180
+ wouldUpdate: z24.number().int().nonnegative(),
17181
+ wouldDelete: z24.number().int().nonnegative(),
17182
+ wouldAffect: z24.number().int().nonnegative(),
17183
+ validatedCount: z24.number().int().nonnegative(),
17184
+ insertedCount: z24.literal(0),
17185
+ updatedCount: z24.literal(0),
17186
+ deletedCount: z24.literal(0),
17187
+ warnings: z24.array(taskMutationWarningSchema)
16881
17188
  });
16882
- var taskMutationTaskRecordSchema = z23.object({ id: z23.string().min(1) }).passthrough();
16883
- var taskMutationEnvelopeSchema = z23.object({
16884
- dryRun: z23.boolean().optional(),
16885
- created: z23.array(taskMutationTaskRecordSchema),
16886
- updated: z23.array(taskMutationTaskRecordSchema),
16887
- deleted: z23.array(taskMutationTaskRecordSchema),
16888
- affectedCount: z23.number().int().nonnegative(),
16889
- mutationWarnings: z23.array(taskMutationWarningSchema),
17189
+ var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
17190
+ var taskMutationEnvelopeSchema = z24.object({
17191
+ dryRun: z24.boolean().optional(),
17192
+ created: z24.array(taskMutationTaskRecordSchema),
17193
+ updated: z24.array(taskMutationTaskRecordSchema),
17194
+ deleted: z24.array(taskMutationTaskRecordSchema),
17195
+ affectedCount: z24.number().int().nonnegative(),
17196
+ mutationWarnings: z24.array(taskMutationWarningSchema),
16890
17197
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
16891
17198
  });
16892
- var completionTaskStatusSchema = z23.enum(TASK_STATUSES);
16893
- var completionCriterionKindSchema = z23.enum(["text", "evidence_bound", "child_task"]);
16894
- var completionCriterionStatusSchema = z23.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16895
- var completionBlockerReasonSchema = z23.enum([
17199
+ var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
17200
+ var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
17201
+ var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
17202
+ var completionBlockerReasonSchema = z24.enum([
16896
17203
  "missing_evidence_binding",
16897
17204
  "child_not_done",
16898
17205
  "child_cancelled_requires_waiver",
@@ -16900,68 +17207,68 @@ var completionBlockerReasonSchema = z23.enum([
16900
17207
  "child_missing",
16901
17208
  "done_parent_stale"
16902
17209
  ]);
16903
- var completionStaleReasonSchema = z23.enum(["done_parent_has_unsatisfied_criteria"]);
16904
- var completionProjectionRepairErrorCodeSchema = z23.enum([
17210
+ var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
17211
+ var completionProjectionRepairErrorCodeSchema = z24.enum([
16905
17212
  "projection_not_stale",
16906
17213
  "criteria_missing",
16907
17214
  "binding_target_missing",
16908
17215
  "repair_conflict"
16909
17216
  ]);
16910
- var completionCriterionWaiverSchema = z23.object({
16911
- criterionAcId: z23.string().min(1),
16912
- childTaskId: z23.string().min(1),
16913
- reason: z23.string().min(1),
16914
- actor: z23.string().min(1),
16915
- waivedAt: z23.string().min(1)
17217
+ var completionCriterionWaiverSchema = z24.object({
17218
+ criterionAcId: z24.string().min(1),
17219
+ childTaskId: z24.string().min(1),
17220
+ reason: z24.string().min(1),
17221
+ actor: z24.string().min(1),
17222
+ waivedAt: z24.string().min(1)
16916
17223
  });
16917
- var completionCriterionReplacementSchema = z23.object({
16918
- criterionAcId: z23.string().min(1),
16919
- originalChildTaskId: z23.string().min(1),
16920
- replacementChildTaskId: z23.string().min(1),
16921
- reason: z23.string().min(1),
16922
- actor: z23.string().min(1),
16923
- replacedAt: z23.string().min(1)
17224
+ var completionCriterionReplacementSchema = z24.object({
17225
+ criterionAcId: z24.string().min(1),
17226
+ originalChildTaskId: z24.string().min(1),
17227
+ replacementChildTaskId: z24.string().min(1),
17228
+ reason: z24.string().min(1),
17229
+ actor: z24.string().min(1),
17230
+ replacedAt: z24.string().min(1)
16924
17231
  });
16925
- var completionCriterionEvaluationSchema = z23.object({
16926
- acId: z23.string().min(1),
16927
- alias: z23.string().min(1),
16928
- text: z23.string(),
17232
+ var completionCriterionEvaluationSchema = z24.object({
17233
+ acId: z24.string().min(1),
17234
+ alias: z24.string().min(1),
17235
+ text: z24.string(),
16929
17236
  kind: completionCriterionKindSchema,
16930
17237
  status: completionCriterionStatusSchema,
16931
17238
  reason: completionBlockerReasonSchema.optional(),
16932
- targetTaskId: z23.string().min(1).optional(),
17239
+ targetTaskId: z24.string().min(1).optional(),
16933
17240
  targetTaskStatus: completionTaskStatusSchema.optional(),
16934
17241
  waiver: completionCriterionWaiverSchema.optional(),
16935
17242
  replacement: completionCriterionReplacementSchema.optional(),
16936
17243
  replacementTaskStatus: completionTaskStatusSchema.optional(),
16937
- evidenceBindings: z23.number().int().nonnegative()
17244
+ evidenceBindings: z24.number().int().nonnegative()
16938
17245
  });
16939
17246
  var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
16940
- status: z23.literal("unsatisfied"),
17247
+ status: z24.literal("unsatisfied"),
16941
17248
  reason: completionBlockerReasonSchema
16942
17249
  });
16943
- var completionTotalsSchema = z23.object({
16944
- criteria: z23.number().int().nonnegative(),
16945
- satisfied: z23.number().int().nonnegative(),
16946
- unsatisfied: z23.number().int().nonnegative(),
16947
- waived: z23.number().int().nonnegative(),
16948
- replaced: z23.number().int().nonnegative()
17250
+ var completionTotalsSchema = z24.object({
17251
+ criteria: z24.number().int().nonnegative(),
17252
+ satisfied: z24.number().int().nonnegative(),
17253
+ unsatisfied: z24.number().int().nonnegative(),
17254
+ waived: z24.number().int().nonnegative(),
17255
+ replaced: z24.number().int().nonnegative()
16949
17256
  });
16950
- var completionContextPackSchema = z23.object({
16951
- taskId: z23.string().min(1),
16952
- generatedAt: z23.string().min(1),
16953
- source: z23.literal("audit_log"),
16954
- window: z23.object({
16955
- limit: z23.number().int().positive(),
16956
- since: z23.string().min(1).optional(),
16957
- relationDepth: z23.number().int().nonnegative(),
16958
- relatedTaskIds: z23.array(z23.string().min(1))
17257
+ var completionContextPackSchema = z24.object({
17258
+ taskId: z24.string().min(1),
17259
+ generatedAt: z24.string().min(1),
17260
+ source: z24.literal("audit_log"),
17261
+ window: z24.object({
17262
+ limit: z24.number().int().positive(),
17263
+ since: z24.string().min(1).optional(),
17264
+ relationDepth: z24.number().int().nonnegative(),
17265
+ relatedTaskIds: z24.array(z24.string().min(1))
16959
17266
  }),
16960
- events: z23.array(
16961
- z23.object({
16962
- id: z23.string().min(1),
16963
- timestamp: z23.string().min(1),
16964
- action: z23.enum([
17267
+ events: z24.array(
17268
+ z24.object({
17269
+ id: z24.string().min(1),
17270
+ timestamp: z24.string().min(1),
17271
+ action: z24.enum([
16965
17272
  "task_completed",
16966
17273
  "task_reopened",
16967
17274
  "task_cancelled",
@@ -16969,77 +17276,77 @@ var completionContextPackSchema = z23.object({
16969
17276
  "task_reparented",
16970
17277
  "ac_projection_rebuilt"
16971
17278
  ]),
16972
- taskId: z23.string().min(1),
16973
- relation: z23.enum(["self", "parent", "child", "sibling", "related"]),
16974
- actor: z23.string().min(1),
16975
- details: z23.record(z23.string(), z23.unknown()).optional(),
16976
- before: z23.record(z23.string(), z23.unknown()).optional(),
16977
- after: z23.record(z23.string(), z23.unknown()).optional()
17279
+ taskId: z24.string().min(1),
17280
+ relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
17281
+ actor: z24.string().min(1),
17282
+ details: z24.record(z24.string(), z24.unknown()).optional(),
17283
+ before: z24.record(z24.string(), z24.unknown()).optional(),
17284
+ after: z24.record(z24.string(), z24.unknown()).optional()
16978
17285
  })
16979
17286
  ),
16980
- summary: z23.object({
16981
- totalEvents: z23.number().int().nonnegative(),
16982
- byAction: z23.record(z23.string(), z23.number().int().nonnegative()),
16983
- byRelation: z23.record(z23.string(), z23.number().int().nonnegative()),
16984
- latestEventAt: z23.string().nullable()
17287
+ summary: z24.object({
17288
+ totalEvents: z24.number().int().nonnegative(),
17289
+ byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
17290
+ byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
17291
+ latestEventAt: z24.string().nullable()
16985
17292
  })
16986
17293
  });
16987
- var completionEvaluationSchema = z23.object({
16988
- taskId: z23.string().min(1),
17294
+ var completionEvaluationSchema = z24.object({
17295
+ taskId: z24.string().min(1),
16989
17296
  taskStatus: completionTaskStatusSchema,
16990
- ready: z23.boolean(),
16991
- stale: z23.boolean(),
16992
- staleReasons: z23.array(completionStaleReasonSchema),
17297
+ ready: z24.boolean(),
17298
+ stale: z24.boolean(),
17299
+ staleReasons: z24.array(completionStaleReasonSchema),
16993
17300
  contextPack: completionContextPackSchema.optional(),
16994
- satisfied: z23.array(completionCriterionEvaluationSchema),
16995
- unsatisfied: z23.array(unsatisfiedCompletionCriterionSchema),
16996
- waived: z23.array(completionCriterionEvaluationSchema),
16997
- replaced: z23.array(completionCriterionEvaluationSchema),
17301
+ satisfied: z24.array(completionCriterionEvaluationSchema),
17302
+ unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
17303
+ waived: z24.array(completionCriterionEvaluationSchema),
17304
+ replaced: z24.array(completionCriterionEvaluationSchema),
16998
17305
  totals: completionTotalsSchema
16999
17306
  });
17000
- var completionExplanationSchema = z23.object({
17001
- taskId: z23.string().min(1),
17002
- ready: z23.boolean(),
17003
- stale: z23.boolean(),
17004
- summary: z23.string(),
17307
+ var completionExplanationSchema = z24.object({
17308
+ taskId: z24.string().min(1),
17309
+ ready: z24.boolean(),
17310
+ stale: z24.boolean(),
17311
+ summary: z24.string(),
17005
17312
  contextPack: completionContextPackSchema.optional(),
17006
- blockers: z23.array(completionCriterionEvaluationSchema)
17313
+ blockers: z24.array(completionCriterionEvaluationSchema)
17007
17314
  });
17008
- var completionListParamsSchema = z23.object({
17009
- taskId: z23.string().min(1),
17315
+ var completionListParamsSchema = z24.object({
17316
+ taskId: z24.string().min(1),
17010
17317
  status: completionCriterionStatusSchema.optional(),
17011
17318
  kind: completionCriterionKindSchema.optional()
17012
17319
  });
17013
- var completionListResultSchema = z23.object({
17014
- taskId: z23.string().min(1),
17015
- criteria: z23.array(completionCriterionEvaluationSchema),
17320
+ var completionListResultSchema = z24.object({
17321
+ taskId: z24.string().min(1),
17322
+ criteria: z24.array(completionCriterionEvaluationSchema),
17016
17323
  totals: completionTotalsSchema
17017
17324
  });
17018
- var completionEvaluateParamsSchema = z23.object({
17019
- taskId: z23.string().min(1),
17020
- includeContext: z23.boolean().optional(),
17021
- limit: z23.number().int().positive().optional(),
17022
- since: z23.string().min(1).optional(),
17023
- relationDepth: z23.number().int().nonnegative().optional()
17325
+ var completionEvaluateParamsSchema = z24.object({
17326
+ taskId: z24.string().min(1),
17327
+ includeContext: z24.boolean().optional(),
17328
+ limit: z24.number().int().positive().optional(),
17329
+ since: z24.string().min(1).optional(),
17330
+ relationDepth: z24.number().int().nonnegative().optional()
17024
17331
  });
17025
- var completionProjectionRepairErrorSchema = z23.object({
17332
+ var completionProjectionRepairErrorSchema = z24.object({
17026
17333
  code: completionProjectionRepairErrorCodeSchema,
17027
- message: z23.string().min(1),
17028
- taskId: z23.string().min(1),
17029
- acId: z23.string().min(1).optional(),
17030
- evidenceAtomId: z23.string().min(1).optional()
17334
+ message: z24.string().min(1),
17335
+ taskId: z24.string().min(1),
17336
+ acId: z24.string().min(1).optional(),
17337
+ evidenceAtomId: z24.string().min(1).optional()
17031
17338
  });
17032
- var completionProjectionRepairParamsSchema = z23.object({
17033
- taskId: z23.string().min(1),
17034
- dryRun: z23.boolean().optional()
17339
+ var completionProjectionRepairParamsSchema = z24.object({
17340
+ taskId: z24.string().min(1),
17341
+ dryRun: z24.boolean().optional()
17035
17342
  });
17036
- var completionProjectionRepairResultSchema = z23.object({
17037
- taskId: z23.string().min(1),
17038
- repaired: z23.boolean(),
17039
- dryRun: z23.boolean(),
17040
- staleBefore: z23.boolean(),
17041
- staleAfter: z23.boolean(),
17042
- errors: z23.array(completionProjectionRepairErrorSchema)
17343
+ var completionProjectionRepairResultSchema = z24.object({
17344
+ taskId: z24.string().min(1),
17345
+ repaired: z24.boolean(),
17346
+ dryRun: z24.boolean(),
17347
+ staleBefore: z24.boolean(),
17348
+ staleAfter: z24.boolean(),
17349
+ errors: z24.array(completionProjectionRepairErrorSchema)
17043
17350
  });
17044
17351
 
17045
17352
  // packages/contracts/src/taxonomy.ts
@@ -17542,7 +17849,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
17542
17849
  };
17543
17850
 
17544
17851
  // packages/contracts/src/templates/manifest.ts
17545
- import { z as z24 } from "zod";
17852
+ import { z as z25 } from "zod";
17546
17853
  var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
17547
17854
  var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
17548
17855
  var TEMPLATE_UPDATE_STRATEGIES = [
@@ -17559,79 +17866,79 @@ var PLACEHOLDER_SOURCES = [
17559
17866
  "tool-resolver",
17560
17867
  "literal"
17561
17868
  ];
17562
- var PlaceholderSpecSchema = z24.object({
17869
+ var PlaceholderSpecSchema = z25.object({
17563
17870
  /**
17564
17871
  * Placeholder identifier as it appears in the template body
17565
17872
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
17566
17873
  */
17567
- name: z24.string().min(1, "placeholder name must be non-empty"),
17874
+ name: z25.string().min(1, "placeholder name must be non-empty"),
17568
17875
  /** Resolver source the installer consults for this placeholder. */
17569
- source: z24.enum(PLACEHOLDER_SOURCES),
17876
+ source: z25.enum(PLACEHOLDER_SOURCES),
17570
17877
  /**
17571
17878
  * Path expression evaluated against `source` (e.g. `engines.node` against
17572
17879
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
17573
17880
  * For `literal` source, this MAY be the literal value's identifier.
17574
17881
  */
17575
- sourcePath: z24.string().min(1, "placeholder sourcePath must be non-empty"),
17882
+ sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
17576
17883
  /**
17577
17884
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
17578
17885
  * `null` is permitted to explicitly mark "no default — failure required".
17579
17886
  */
17580
- defaultValue: z24.union([z24.string(), z24.number(), z24.boolean(), z24.null()]).optional()
17887
+ defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
17581
17888
  });
17582
- var TemplateManifestEntrySchema = z24.object({
17889
+ var TemplateManifestEntrySchema = z25.object({
17583
17890
  /** Stable identifier for this template entry. */
17584
- id: z24.string().min(1, "id must be non-empty"),
17891
+ id: z25.string().min(1, "id must be non-empty"),
17585
17892
  /** Category of file this template represents. */
17586
- kind: z24.enum(TEMPLATE_KINDS),
17893
+ kind: z25.enum(TEMPLATE_KINDS),
17587
17894
  /** Repo-relative path of the template source file. */
17588
- sourcePath: z24.string().min(1, "sourcePath must be non-empty"),
17895
+ sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
17589
17896
  /** Project-relative path where the rendered template installs. */
17590
- installPath: z24.string().min(1, "installPath must be non-empty"),
17897
+ installPath: z25.string().min(1, "installPath must be non-empty"),
17591
17898
  /** Substitution strategy the installer applies to `sourcePath`. */
17592
- substitution: z24.enum(TEMPLATE_SUBSTITUTIONS),
17899
+ substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
17593
17900
  /** Declared placeholders this template requires. May be empty. */
17594
- placeholders: z24.array(PlaceholderSpecSchema),
17901
+ placeholders: z25.array(PlaceholderSpecSchema),
17595
17902
  /** Reconciliation policy on upgrade. */
17596
- updateStrategy: z24.enum(TEMPLATE_UPDATE_STRATEGIES)
17903
+ updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
17597
17904
  });
17598
17905
 
17599
17906
  // packages/contracts/src/validator/index.ts
17600
- import { z as z25 } from "zod";
17907
+ import { z as z26 } from "zod";
17601
17908
  var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
17602
- var validatorFindingSchema = z25.object({
17603
- acId: z25.string().min(1, "acId must be non-empty"),
17604
- status: z25.enum(["pass", "fail", "inconclusive"]),
17605
- reasoning: z25.string().min(1, "reasoning must be non-empty"),
17606
- evidenceRefs: z25.array(z25.string()).optional(),
17607
- checkedAt: z25.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17909
+ var validatorFindingSchema = z26.object({
17910
+ acId: z26.string().min(1, "acId must be non-empty"),
17911
+ status: z26.enum(["pass", "fail", "inconclusive"]),
17912
+ reasoning: z26.string().min(1, "reasoning must be non-empty"),
17913
+ evidenceRefs: z26.array(z26.string()).optional(),
17914
+ checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17608
17915
  });
17609
- var validatorAttestationSchema = z25.object({
17610
- verdict: z25.literal("attest"),
17611
- taskId: z25.string().min(1),
17612
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17613
- findings: z25.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17916
+ var validatorAttestationSchema = z26.object({
17917
+ verdict: z26.literal("attest"),
17918
+ taskId: z26.string().min(1),
17919
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17920
+ findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17614
17921
  (findings) => findings.every((f) => f.status === "pass"),
17615
17922
  'attestation requires every finding to have status="pass"'
17616
17923
  ),
17617
- summary: z25.string().optional(),
17618
- attestedAt: z25.string().min(1),
17619
- schemaVersion: z25.literal("1")
17924
+ summary: z26.string().optional(),
17925
+ attestedAt: z26.string().min(1),
17926
+ schemaVersion: z26.literal("1")
17620
17927
  });
17621
- var validatorRejectionSchema = z25.object({
17622
- verdict: z25.literal("reject"),
17623
- taskId: z25.string().min(1),
17624
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17625
- findings: z25.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17928
+ var validatorRejectionSchema = z26.object({
17929
+ verdict: z26.literal("reject"),
17930
+ taskId: z26.string().min(1),
17931
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17932
+ findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17626
17933
  (findings) => findings.some((f) => f.status !== "pass"),
17627
17934
  'rejection requires at least one finding with status "fail" or "inconclusive"'
17628
17935
  ),
17629
- summary: z25.string().min(1, "rejection summary must be non-empty"),
17630
- remediationHints: z25.array(z25.string()).optional(),
17631
- rejectedAt: z25.string().min(1),
17632
- schemaVersion: z25.literal("1")
17936
+ summary: z26.string().min(1, "rejection summary must be non-empty"),
17937
+ remediationHints: z26.array(z26.string()).optional(),
17938
+ rejectedAt: z26.string().min(1),
17939
+ schemaVersion: z26.literal("1")
17633
17940
  });
17634
- var validatorVerdictSchema = z25.discriminatedUnion("verdict", [
17941
+ var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
17635
17942
  validatorAttestationSchema,
17636
17943
  validatorRejectionSchema
17637
17944
  ]);
@@ -18381,7 +18688,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
18381
18688
  var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
18382
18689
 
18383
18690
  // packages/contracts/src/decide.ts
18384
- import { z as z26 } from "zod";
18691
+ import { z as z27 } from "zod";
18385
18692
  var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
18386
18693
  var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
18387
18694
  var DECISION_REQUEST_LIMITS = {
@@ -18403,11 +18710,11 @@ var DECISION_REQUEST_LIMITS = {
18403
18710
  maxScoreLevels: 10
18404
18711
  };
18405
18712
  var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
18406
- var decisionQuestionTypeSchema = z26.enum(DECISION_QUESTION_TYPES);
18407
- var decisionOutcomeSourceSchema = z26.enum(DECISION_OUTCOME_SOURCES);
18408
- var decisionInstructionsSchema = z26.union([z26.string(), z26.record(z26.string(), z26.json())]);
18409
- var unitIntervalSchema = z26.number().min(0).max(1);
18410
- var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.record(z26.string(), z26.json())]).superRefine((state, context) => {
18713
+ var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
18714
+ var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
18715
+ var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
18716
+ var unitIntervalSchema = z27.number().min(0).max(1);
18717
+ var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
18411
18718
  const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
18412
18719
  if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
18413
18720
  context.addIssue({
@@ -18416,34 +18723,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
18416
18723
  });
18417
18724
  }
18418
18725
  });
18419
- var noulDecisionQuestionSchema = z26.object({
18420
- type: z26.literal("noul"),
18726
+ var noulDecisionQuestionSchema = z27.object({
18727
+ type: z27.literal("noul"),
18421
18728
  instructions: decisionInstructionsSchema.optional(),
18422
- criteria: z26.string().min(1)
18729
+ criteria: z27.string().min(1)
18423
18730
  });
18424
- var choiceDecisionQuestionSchema = z26.object({
18425
- type: z26.literal("choice"),
18731
+ var choiceDecisionQuestionSchema = z27.object({
18732
+ type: z27.literal("choice"),
18426
18733
  instructions: decisionInstructionsSchema.optional(),
18427
- criteria: z26.record(z26.string().min(1), z26.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18734
+ criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18428
18735
  message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
18429
18736
  })
18430
18737
  });
18431
- var scoreDecisionQuestionSchema = z26.object({
18432
- type: z26.literal("score"),
18738
+ var scoreDecisionQuestionSchema = z27.object({
18739
+ type: z27.literal("score"),
18433
18740
  instructions: decisionInstructionsSchema.optional(),
18434
- criteria: z26.array(z26.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18741
+ criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18435
18742
  });
18436
- var decisionQuestionSchema = z26.discriminatedUnion("type", [
18743
+ var decisionQuestionSchema = z27.discriminatedUnion("type", [
18437
18744
  noulDecisionQuestionSchema,
18438
18745
  choiceDecisionQuestionSchema,
18439
18746
  scoreDecisionQuestionSchema
18440
18747
  ]);
18441
- var decisionRequestSchema = z26.object({
18442
- model: z26.string().min(1).optional(),
18443
- lang: z26.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18444
- cache: z26.boolean().optional(),
18748
+ var decisionRequestSchema = z27.object({
18749
+ model: z27.string().min(1).optional(),
18750
+ lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18751
+ cache: z27.boolean().optional(),
18445
18752
  state: decisionStateSchema,
18446
- questions: z26.record(z26.string().min(1), decisionQuestionSchema).refine(
18753
+ questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
18447
18754
  (questions) => {
18448
18755
  const count = Object.keys(questions).length;
18449
18756
  return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
@@ -18453,139 +18760,139 @@ var decisionRequestSchema = z26.object({
18453
18760
  }
18454
18761
  )
18455
18762
  });
18456
- var noulDecisionAnswerSchema = z26.object({
18457
- type: z26.literal("noul"),
18458
- value: z26.boolean(),
18763
+ var noulDecisionAnswerSchema = z27.object({
18764
+ type: z27.literal("noul"),
18765
+ value: z27.boolean(),
18459
18766
  probability: unitIntervalSchema,
18460
18767
  confidence: unitIntervalSchema
18461
18768
  });
18462
- var choiceDecisionAnswerSchema = z26.object({
18463
- type: z26.literal("choice"),
18464
- value: z26.string().min(1),
18465
- probabilities: z26.record(z26.string().min(1), unitIntervalSchema),
18769
+ var choiceDecisionAnswerSchema = z27.object({
18770
+ type: z27.literal("choice"),
18771
+ value: z27.string().min(1),
18772
+ probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
18466
18773
  confidence: unitIntervalSchema
18467
18774
  });
18468
- var scoreDecisionAnswerSchema = z26.object({
18469
- type: z26.literal("score"),
18470
- value: z26.number().int().nonnegative(),
18471
- probabilities: z26.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18775
+ var scoreDecisionAnswerSchema = z27.object({
18776
+ type: z27.literal("score"),
18777
+ value: z27.number().int().nonnegative(),
18778
+ probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18472
18779
  confidence: unitIntervalSchema
18473
18780
  });
18474
- var decisionAnswerSchema = z26.discriminatedUnion("type", [
18781
+ var decisionAnswerSchema = z27.discriminatedUnion("type", [
18475
18782
  noulDecisionAnswerSchema,
18476
18783
  choiceDecisionAnswerSchema,
18477
18784
  scoreDecisionAnswerSchema
18478
18785
  ]);
18479
- var decisionOutcomeSchema = z26.object({
18480
- answers: z26.record(z26.string().min(1), decisionAnswerSchema),
18786
+ var decisionOutcomeSchema = z27.object({
18787
+ answers: z27.record(z27.string().min(1), decisionAnswerSchema),
18481
18788
  source: decisionOutcomeSourceSchema,
18482
- requestId: z26.string().min(1).optional(),
18483
- latencyMs: z26.number().nonnegative(),
18484
- costUsd: z26.number().nonnegative().optional(),
18485
- costMicros: z26.number().int().nonnegative().optional(),
18486
- balanceMicros: z26.number().int().optional(),
18487
- checkpoint: z26.string().min(1).optional(),
18488
- inputTokens: z26.number().int().nonnegative().optional()
18789
+ requestId: z27.string().min(1).optional(),
18790
+ latencyMs: z27.number().nonnegative(),
18791
+ costUsd: z27.number().nonnegative().optional(),
18792
+ costMicros: z27.number().int().nonnegative().optional(),
18793
+ balanceMicros: z27.number().int().optional(),
18794
+ checkpoint: z27.string().min(1).optional(),
18795
+ inputTokens: z27.number().int().nonnegative().optional()
18489
18796
  });
18490
- var decisionProviderKindSchema = z26.enum(DECISION_PROVIDER_KINDS);
18491
- var decisionProviderConfigSchema = z26.object({
18492
- baseUrl: z26.url(),
18797
+ var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
18798
+ var decisionProviderConfigSchema = z27.object({
18799
+ baseUrl: z27.url(),
18493
18800
  provider: decisionProviderKindSchema.optional()
18494
18801
  });
18495
18802
 
18496
18803
  // packages/contracts/src/nexus-account.ts
18497
- import { z as z27 } from "zod";
18498
- var nexusAccountUserSchema = z27.object({
18499
- id: z27.string(),
18500
- email: z27.string(),
18501
- name: z27.string().nullable().optional()
18804
+ import { z as z28 } from "zod";
18805
+ var nexusAccountUserSchema = z28.object({
18806
+ id: z28.string(),
18807
+ email: z28.string(),
18808
+ name: z28.string().nullable().optional()
18502
18809
  });
18503
- var nexusAccountOrganizationSchema = z27.object({
18504
- id: z27.string(),
18505
- name: z27.string(),
18506
- slug: z27.string().nullable().optional(),
18507
- role: z27.string().optional(),
18810
+ var nexusAccountOrganizationSchema = z28.object({
18811
+ id: z28.string(),
18812
+ name: z28.string(),
18813
+ slug: z28.string().nullable().optional(),
18814
+ role: z28.string().optional(),
18508
18815
  /** `true` for the personal organization created at sign-up. */
18509
- personal: z27.boolean().optional()
18816
+ personal: z28.boolean().optional()
18510
18817
  });
18511
- var nexusAccountMeSchema = z27.object({
18818
+ var nexusAccountMeSchema = z28.object({
18512
18819
  user: nexusAccountUserSchema,
18513
- organizations: z27.array(nexusAccountOrganizationSchema).default([])
18820
+ organizations: z28.array(nexusAccountOrganizationSchema).default([])
18514
18821
  });
18515
18822
 
18516
18823
  // packages/contracts/src/nexus-cloud.ts
18517
- import { z as z28 } from "zod";
18824
+ import { z as z29 } from "zod";
18518
18825
  var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
18519
18826
  var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
18520
18827
  var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
18521
- var isoTime = z28.iso.datetime({ offset: true });
18522
- var profile = z28.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18523
- var deviceState = z28.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18524
- var nexusCloudCredentialSchema = z28.object({
18525
- kind: z28.enum(["device", "session"]),
18526
- credentialId: z28.string().nullable().optional(),
18828
+ var isoTime = z29.iso.datetime({ offset: true });
18829
+ var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18830
+ var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18831
+ var nexusCloudCredentialSchema = z29.object({
18832
+ kind: z29.enum(["device", "session"]),
18833
+ credentialId: z29.string().nullable().optional(),
18527
18834
  profile: profile.optional(),
18528
- scopes: z28.array(z28.string()).default([]),
18835
+ scopes: z29.array(z29.string()).default([]),
18529
18836
  createdAt: isoTime.nullable().optional(),
18530
18837
  lastUsedAt: isoTime.nullable().optional(),
18531
18838
  /** When the credential expires if it is not used again; null for sessions. */
18532
18839
  idleExpiresAt: isoTime.nullable().optional()
18533
18840
  });
18534
- var nexusCloudDeviceSchema = z28.object({
18535
- deviceId: z28.string(),
18536
- name: z28.string(),
18537
- platform: z28.string().optional(),
18538
- arch: z28.string().nullable().optional(),
18539
- cliVersion: z28.string().nullable().optional(),
18841
+ var nexusCloudDeviceSchema = z29.object({
18842
+ deviceId: z29.string(),
18843
+ name: z29.string(),
18844
+ platform: z29.string().optional(),
18845
+ arch: z29.string().nullable().optional(),
18846
+ cliVersion: z29.string().nullable().optional(),
18540
18847
  createdAt: isoTime.optional(),
18541
18848
  lastSeenAt: isoTime.nullable().optional(),
18542
18849
  state: deviceState,
18543
18850
  signedOutAt: isoTime.nullable().optional(),
18544
18851
  /** Base64 device certificate; null until the device holds a key grant. */
18545
- certificate: z28.string().nullable().optional(),
18852
+ certificate: z29.string().nullable().optional(),
18546
18853
  /** The current credential's profile, or null with none (signed out or revoked). */
18547
18854
  profile: profile.optional(),
18548
18855
  /** True for the device whose credential made this request. */
18549
- current: z28.boolean().default(false),
18550
- projects: z28.number().int().nonnegative().optional(),
18551
- replicas: z28.number().int().nonnegative().optional(),
18856
+ current: z29.boolean().default(false),
18857
+ projects: z29.number().int().nonnegative().optional(),
18858
+ replicas: z29.number().int().nonnegative().optional(),
18552
18859
  lastSyncAt: isoTime.nullable().optional(),
18553
18860
  lastPresenceAt: isoTime.nullable().optional()
18554
18861
  });
18555
- var nexusCloudOrganizationSchema = z28.object({
18556
- id: z28.string(),
18557
- name: z28.string(),
18558
- slug: z28.string().nullable().optional(),
18559
- role: z28.string().optional(),
18560
- personal: z28.boolean().optional()
18862
+ var nexusCloudOrganizationSchema = z29.object({
18863
+ id: z29.string(),
18864
+ name: z29.string(),
18865
+ slug: z29.string().nullable().optional(),
18866
+ role: z29.string().optional(),
18867
+ personal: z29.boolean().optional()
18561
18868
  });
18562
- var nexusCloudUserSchema = z28.object({
18563
- id: z28.string(),
18564
- email: z28.string(),
18565
- name: z28.string().nullable().optional()
18869
+ var nexusCloudUserSchema = z29.object({
18870
+ id: z29.string(),
18871
+ email: z29.string(),
18872
+ name: z29.string().nullable().optional()
18566
18873
  });
18567
- var nexusCloudWhoamiSchema = z28.object({
18874
+ var nexusCloudWhoamiSchema = z29.object({
18568
18875
  serverTime: isoTime.optional(),
18569
18876
  user: nexusCloudUserSchema,
18570
- organizations: z28.array(nexusCloudOrganizationSchema).default([]),
18877
+ organizations: z29.array(nexusCloudOrganizationSchema).default([]),
18571
18878
  credential: nexusCloudCredentialSchema,
18572
18879
  /** The calling device; null for a session caller. */
18573
18880
  device: nexusCloudDeviceSchema.nullable()
18574
18881
  });
18575
- var nexusCloudDevicePageSchema = z28.object({
18576
- devices: z28.array(nexusCloudDeviceSchema),
18577
- nextCursor: z28.string().max(512).nullable().default(null),
18578
- truncated: z28.boolean().default(false)
18882
+ var nexusCloudDevicePageSchema = z29.object({
18883
+ devices: z29.array(nexusCloudDeviceSchema),
18884
+ nextCursor: z29.string().max(512).nullable().default(null),
18885
+ truncated: z29.boolean().default(false)
18579
18886
  });
18580
- var nexusCloudPresenceSchema = z28.looseObject({
18887
+ var nexusCloudPresenceSchema = z29.looseObject({
18581
18888
  observedAt: isoTime.optional(),
18582
- sync: z28.object({ enabled: z28.boolean() }).optional()
18889
+ sync: z29.object({ enabled: z29.boolean() }).optional()
18583
18890
  });
18584
- var nexusCloudReplicaSchema = z28.object({
18585
- projectId: z28.string(),
18586
- replicaId: z28.string(),
18587
- deviceId: z28.string(),
18588
- deviceName: z28.string(),
18891
+ var nexusCloudReplicaSchema = z29.object({
18892
+ projectId: z29.string(),
18893
+ replicaId: z29.string(),
18894
+ deviceId: z29.string(),
18895
+ deviceName: z29.string(),
18589
18896
  deviceState: deviceState.optional(),
18590
18897
  attachedAt: isoTime.optional(),
18591
18898
  lastSyncAt: isoTime.nullable(),
@@ -18594,72 +18901,72 @@ var nexusCloudReplicaSchema = z28.object({
18594
18901
  /** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
18595
18902
  retiredAt: isoTime.nullable().optional(),
18596
18903
  /** The retired replica's named successor, else null (not retired, or retired with none). */
18597
- successor: z28.string().nullable().optional()
18904
+ successor: z29.string().nullable().optional()
18598
18905
  });
18599
- var nexusCloudDeviceCountsSchema = z28.object({
18600
- active: z28.number().int().nonnegative(),
18601
- total: z28.number().int().nonnegative()
18906
+ var nexusCloudDeviceCountsSchema = z29.object({
18907
+ active: z29.number().int().nonnegative(),
18908
+ total: z29.number().int().nonnegative()
18602
18909
  });
18603
18910
  var projectFields = {
18604
- projectId: z28.string(),
18605
- label: z28.string().nullable(),
18606
- organizationId: z28.string(),
18607
- organizationName: z28.string().optional(),
18608
- remoteUrl: z28.string().nullable().optional(),
18911
+ projectId: z29.string(),
18912
+ label: z29.string().nullable(),
18913
+ organizationId: z29.string(),
18914
+ organizationName: z29.string().optional(),
18915
+ remoteUrl: z29.string().nullable().optional(),
18609
18916
  createdAt: isoTime.optional()
18610
18917
  };
18611
- var nexusCloudProjectListItemSchema = z28.object({
18918
+ var nexusCloudProjectListItemSchema = z29.object({
18612
18919
  ...projectFields,
18613
- role: z28.string(),
18920
+ role: z29.string(),
18614
18921
  /**
18615
18922
  * The project name sealed with the project data key (`Project.encryptedName`), base64;
18616
18923
  * only a holder of the account key can open it (T13102).
18617
18924
  */
18618
- encryptedName: z28.string().nullable().optional(),
18619
- streamId: z28.string().optional(),
18620
- headSeq: z28.number().int().nonnegative().nullable().optional(),
18925
+ encryptedName: z29.string().nullable().optional(),
18926
+ streamId: z29.string().optional(),
18927
+ headSeq: z29.number().int().nonnegative().nullable().optional(),
18621
18928
  /** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
18622
- headCheckpointId: z28.string().nullable().optional(),
18623
- openConflicts: z28.number().int().nonnegative().optional(),
18624
- replicas: z28.array(nexusCloudReplicaSchema).default([]),
18929
+ headCheckpointId: z29.string().nullable().optional(),
18930
+ openConflicts: z29.number().int().nonnegative().optional(),
18931
+ replicas: z29.array(nexusCloudReplicaSchema).default([]),
18625
18932
  devices: nexusCloudDeviceCountsSchema.optional(),
18626
- replicaCount: z28.number().int().nonnegative().optional(),
18933
+ replicaCount: z29.number().int().nonnegative().optional(),
18627
18934
  lastSyncAt: isoTime.nullable().optional(),
18628
18935
  lastPresenceAt: isoTime.nullable().optional(),
18629
18936
  /** This project's replica list was cut at 50 (T12858). */
18630
- replicasTruncated: z28.boolean().default(false)
18937
+ replicasTruncated: z29.boolean().default(false)
18631
18938
  });
18632
- var nexusCloudProjectPageSchema = z28.object({
18633
- projects: z28.array(nexusCloudProjectListItemSchema),
18634
- nextCursor: z28.string().max(512).nullable().default(null),
18939
+ var nexusCloudProjectPageSchema = z29.object({
18940
+ projects: z29.array(nexusCloudProjectListItemSchema),
18941
+ nextCursor: z29.string().max(512).nullable().default(null),
18635
18942
  /** Anything in the page was cut (the project list or a replica list). */
18636
- truncated: z28.boolean().default(false),
18943
+ truncated: z29.boolean().default(false),
18637
18944
  /** The project list itself was cut at 1000 (T12858). */
18638
- projectsTruncated: z28.boolean().default(false)
18945
+ projectsTruncated: z29.boolean().default(false)
18639
18946
  });
18640
- var nexusCloudProjectDetailSchema = z28.object({
18641
- project: z28.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18642
- role: z28.string(),
18643
- canTrash: z28.boolean().optional(),
18644
- openConflicts: z28.number().int().nonnegative(),
18947
+ var nexusCloudProjectDetailSchema = z29.object({
18948
+ project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18949
+ role: z29.string(),
18950
+ canTrash: z29.boolean().optional(),
18951
+ openConflicts: z29.number().int().nonnegative(),
18645
18952
  /** At most 50, oldest attachment first. */
18646
- replicas: z28.array(nexusCloudReplicaSchema),
18953
+ replicas: z29.array(nexusCloudReplicaSchema),
18647
18954
  devices: nexusCloudDeviceCountsSchema,
18648
- replicaCount: z28.number().int().nonnegative().optional(),
18955
+ replicaCount: z29.number().int().nonnegative().optional(),
18649
18956
  lastSyncAt: isoTime.nullable().optional(),
18650
18957
  /** `replicas` was cut at 50. */
18651
- truncated: z28.boolean().default(false),
18652
- stream: z28.object({
18653
- streamId: z28.string(),
18654
- headSeq: z28.number().int().nonnegative(),
18655
- headCheckpointId: z28.string().nullable()
18958
+ truncated: z29.boolean().default(false),
18959
+ stream: z29.object({
18960
+ streamId: z29.string(),
18961
+ headSeq: z29.number().int().nonnegative(),
18962
+ headCheckpointId: z29.string().nullable()
18656
18963
  }).nullable()
18657
18964
  });
18658
- var nexusCloudReplicaPageSchema = z28.object({
18659
- replicas: z28.array(nexusCloudReplicaSchema),
18965
+ var nexusCloudReplicaPageSchema = z29.object({
18966
+ replicas: z29.array(nexusCloudReplicaSchema),
18660
18967
  devices: nexusCloudDeviceCountsSchema.optional(),
18661
- nextCursor: z28.string().max(512).nullable().default(null),
18662
- truncated: z28.boolean().default(false)
18968
+ nextCursor: z29.string().max(512).nullable().default(null),
18969
+ truncated: z29.boolean().default(false)
18663
18970
  });
18664
18971
  var NEXUS_STATUS_CHECK_IDS = [
18665
18972
  "credential.valid",
@@ -18675,56 +18982,56 @@ var NEXUS_STATUS_CHECK_IDS = [
18675
18982
  ];
18676
18983
  var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
18677
18984
  var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
18678
- var knownCheckId = z28.enum(NEXUS_STATUS_CHECK_IDS);
18679
- var nexusCloudStatusCheckSchema = z28.object({
18680
- id: z28.enum(NEXUS_STATUS_CHECK_IDS),
18681
- ok: z28.boolean(),
18682
- required: z28.boolean(),
18683
- detail: z28.string()
18985
+ var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
18986
+ var nexusCloudStatusCheckSchema = z29.object({
18987
+ id: z29.enum(NEXUS_STATUS_CHECK_IDS),
18988
+ ok: z29.boolean(),
18989
+ required: z29.boolean(),
18990
+ detail: z29.string()
18684
18991
  });
18685
- var nexusCloudStatusSchema = z28.object({
18992
+ var nexusCloudStatusSchema = z29.object({
18686
18993
  serverTime: isoTime.optional(),
18687
- apiVersion: z28.string().optional(),
18994
+ apiVersion: z29.string().optional(),
18688
18995
  /**
18689
18996
  * Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
18690
18997
  * than the list, which therefore support none of them.
18691
18998
  */
18692
- features: z28.array(z28.string()).optional(),
18999
+ features: z29.array(z29.string()).optional(),
18693
19000
  user: nexusCloudUserSchema,
18694
19001
  credential: nexusCloudCredentialSchema,
18695
19002
  device: nexusCloudDeviceSchema.nullable(),
18696
- project: z28.object({
18697
- projectId: z28.string(),
18698
- registered: z28.boolean(),
18699
- organizationId: z28.string().nullable(),
18700
- organizationName: z28.string().nullable(),
18701
- role: z28.string().nullable()
19003
+ project: z29.object({
19004
+ projectId: z29.string(),
19005
+ registered: z29.boolean(),
19006
+ organizationId: z29.string().nullable(),
19007
+ organizationName: z29.string().nullable(),
19008
+ role: z29.string().nullable()
18702
19009
  }).nullable(),
18703
- replica: z28.object({
18704
- replicaId: z28.string(),
18705
- attached: z28.boolean(),
18706
- attachedElsewhere: z28.boolean(),
19010
+ replica: z29.object({
19011
+ replicaId: z29.string(),
19012
+ attached: z29.boolean(),
19013
+ attachedElsewhere: z29.boolean(),
18707
19014
  attachedAt: isoTime.nullable(),
18708
19015
  lastSyncAt: isoTime.nullable(),
18709
19016
  presenceAt: isoTime.nullable(),
18710
- lastReplicaSeq: z28.number().int().nonnegative().nullable().optional()
19017
+ lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
18711
19018
  }).nullable(),
18712
- stream: z28.object({
18713
- streamId: z28.string(),
18714
- headSeq: z28.number().int().nonnegative(),
18715
- headCheckpointId: z28.string().nullable(),
18716
- openConflicts: z28.number().int().nonnegative(),
19019
+ stream: z29.object({
19020
+ streamId: z29.string(),
19021
+ headSeq: z29.number().int().nonnegative(),
19022
+ headCheckpointId: z29.string().nullable(),
19023
+ openConflicts: z29.number().int().nonnegative(),
18717
19024
  devices: nexusCloudDeviceCountsSchema
18718
19025
  }).nullable(),
18719
19026
  /** Check ids added by a newer server are dropped, never a parse failure. */
18720
- checks: z28.array(nexusCloudStatusCheckSchema.extend({ id: z28.string() })).transform(
19027
+ checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
18721
19028
  (list) => list.flatMap((c) => {
18722
19029
  const id = knownCheckId.safeParse(c.id);
18723
19030
  return id.success ? [{ ...c, id: id.data }] : [];
18724
19031
  })
18725
19032
  ),
18726
19033
  /** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
18727
- verdict: z28.enum(NEXUS_STATUS_VERDICTS).catch("attention")
19034
+ verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18728
19035
  });
18729
19036
  var LOGIN = "run `cleo login nexus`";
18730
19037
  var SESSION_EXPIRED_LOGIN = {
@@ -18769,50 +19076,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
18769
19076
  };
18770
19077
 
18771
19078
  // packages/contracts/src/nexus-vault.ts
18772
- import { z as z29 } from "zod";
18773
- var isoTime2 = z29.iso.datetime({ offset: true });
18774
- 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);
18775
- var nexusUserKeysSchema = z29.looseObject({
18776
- keyVersion: z29.number().int().positive(),
18777
- masterKeyVerifier: z29.string()
19079
+ import { z as z30 } from "zod";
19080
+ var isoTime2 = z30.iso.datetime({ offset: true });
19081
+ 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);
19082
+ var nexusUserKeysSchema = z30.looseObject({
19083
+ keyVersion: z30.number().int().positive(),
19084
+ masterKeyVerifier: z30.string()
18778
19085
  });
18779
- var nexusProjectKeysSchema = z29.looseObject({
18780
- keys: z29.array(
18781
- z29.looseObject({ wrappedProjectKey: z29.string(), keyVersion: z29.number().int().positive() })
19086
+ var nexusProjectKeysSchema = z30.looseObject({
19087
+ keys: z30.array(
19088
+ z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
18782
19089
  )
18783
19090
  });
18784
- var nexusLeaseSchema = z29.looseObject({
18785
- streamId: z29.string(),
18786
- role: z29.string(),
19091
+ var nexusLeaseSchema = z30.looseObject({
19092
+ streamId: z30.string(),
19093
+ role: z30.string(),
18787
19094
  replicaId: uuid,
18788
19095
  expiresAt: isoTime2,
18789
19096
  forkedFromReplicaId: uuid.nullable().optional()
18790
19097
  });
18791
- var nexusLeaseAcquireSchema = z29.looseObject({ lease: nexusLeaseSchema });
18792
- var nexusStreamHeadSchema = z29.looseObject({
18793
- streamId: z29.string(),
18794
- kind: z29.string().optional(),
18795
- headSeq: z29.number().int().nonnegative(),
18796
- headCheckpointId: z29.string().nullable(),
19098
+ var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
19099
+ var nexusStreamHeadSchema = z30.looseObject({
19100
+ streamId: z30.string(),
19101
+ kind: z30.string().optional(),
19102
+ headSeq: z30.number().int().nonnegative(),
19103
+ headCheckpointId: z30.string().nullable(),
18797
19104
  /**
18798
19105
  * The highest segment `schemaVersion` the stream holds (the server raises it on every append).
18799
19106
  * Absent from an older server.
18800
19107
  */
18801
- maxSchemaVersion: z29.number().int().nonnegative().optional()
19108
+ maxSchemaVersion: z30.number().int().nonnegative().optional()
18802
19109
  });
18803
- var nexusActivityEventSchema = z29.looseObject({
18804
- id: z29.union([z29.string(), z29.number()]),
19110
+ var nexusActivityEventSchema = z30.looseObject({
19111
+ id: z30.union([z30.string(), z30.number()]),
18805
19112
  at: isoTime2,
18806
- actorUserId: z29.string().nullable().optional(),
18807
- actorDeviceId: z29.string().nullable().optional(),
18808
- requestId: z29.string().nullable().optional(),
18809
- action: z29.string(),
18810
- target: z29.string().nullable().optional(),
18811
- detail: z29.unknown().optional()
19113
+ actorUserId: z30.string().nullable().optional(),
19114
+ actorDeviceId: z30.string().nullable().optional(),
19115
+ requestId: z30.string().nullable().optional(),
19116
+ action: z30.string(),
19117
+ target: z30.string().nullable().optional(),
19118
+ detail: z30.unknown().optional()
18812
19119
  });
18813
- var nexusActivityPageSchema = z29.looseObject({
18814
- events: z29.array(nexusActivityEventSchema),
18815
- nextBefore: z29.union([z29.string(), z29.number()]).nullable().optional()
19120
+ var nexusActivityPageSchema = z30.looseObject({
19121
+ events: z30.array(nexusActivityEventSchema),
19122
+ nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
18816
19123
  });
18817
19124
 
18818
19125
  // packages/adapters/src/providers/codex/spawn.ts