@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
@@ -845,17 +845,321 @@ var ChangesetEntrySchema = z3.object({
845
845
  });
846
846
 
847
847
  // packages/contracts/src/config/manifest.ts
848
- import { z as z5 } from "zod";
848
+ import { z as z6 } from "zod";
849
849
 
850
- // packages/contracts/src/config/worker-policy.ts
850
+ // packages/contracts/src/orca-execution.ts
851
851
  import { z as z4 } from "zod";
852
- var projectWorkerPolicySchema = z4.object({
853
- verification: z4.object({
854
- full: z4.enum(["local", "ci"]),
855
- local: z4.enum(["single-file", "affected"])
852
+ var identifier = z4.string().min(1);
853
+ var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
854
+ var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
855
+ var orchestrateOrcaConfigSchema = z4.object({
856
+ agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
857
+ });
858
+ var orcaContextSchema = z4.object({
859
+ runtimeId: identifier,
860
+ coordinatorHandle: identifier,
861
+ executionHostId: z4.literal("local")
862
+ });
863
+ var orcaRoutingRunSchema = z4.object({
864
+ runId: identifier.nullable(),
865
+ unconfiguredAgents: z4.array(orcaAgentSchema)
866
+ });
867
+ var orcaLaunchSchema = z4.object({
868
+ projectId: identifier,
869
+ projectRoot: identifier,
870
+ taskId: identifier,
871
+ instanceId: identifier,
872
+ workerSessionId: identifier,
873
+ agentId: identifier,
874
+ role: z4.enum(["worker", "lead"]),
875
+ protocol: identifier,
876
+ worktreePath: identifier,
877
+ worktreeBranch: identifier,
878
+ projectHash: identifier,
879
+ lockToken: identifier,
880
+ prompt: identifier,
881
+ harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
882
+ leadMailbox: identifier.nullable(),
883
+ model: identifier.optional(),
884
+ effort: identifier.optional(),
885
+ accountId: identifier.optional()
886
+ });
887
+ var orcaStartBindingSchema = z4.object({
888
+ runId: identifier.nullable(),
889
+ orcaTaskId: identifier.nullable(),
890
+ retryOf: identifier.nullable()
891
+ });
892
+ var orcaAttemptSchema = z4.object({
893
+ backend: z4.literal("orca"),
894
+ version: z4.literal(1),
895
+ /** Monotonic local CAS revision; repeated identical observations still serialize. */
896
+ revision: z4.number().int().nonnegative(),
897
+ context: orcaContextSchema,
898
+ launch: orcaLaunchSchema,
899
+ promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
900
+ workspaceId: identifier,
901
+ workspaceSelector: identifier,
902
+ state: z4.enum([
903
+ "prepared",
904
+ "launching",
905
+ "ready",
906
+ "turn_unobserved",
907
+ "outcome_unknown",
908
+ "stop_pending",
909
+ "stop_unknown",
910
+ "stopped",
911
+ "failed",
912
+ "circuit_broken"
913
+ ]),
914
+ runId: identifier.nullable(),
915
+ orcaTaskId: identifier.nullable(),
916
+ dispatchId: identifier.nullable(),
917
+ retryOf: identifier.nullable(),
918
+ /** Absent on legacy records, whose original argv cannot safely be reconstructed. */
919
+ startBinding: orcaStartBindingSchema.optional(),
920
+ /** UUID reserved before committing a retry; its first send and every replay use this key. */
921
+ startRequestKey: z4.string().uuid().optional(),
922
+ startRequestId: identifier.nullable(),
923
+ /** UUID reserved before committing a stop; its first send and every replay use this key. */
924
+ stopRequestKey: z4.string().uuid().optional(),
925
+ /** Orca-issued stop request id, retained only when the stop receipt was received. */
926
+ stopRequestId: identifier.nullable(),
927
+ /**
928
+ * Set when the worker-stop reply came from a runtime that proved it enumerates
929
+ * every helper it stopped, so an omitted helper list means the worker had none.
930
+ */
931
+ stopHelperEvidence: z4.literal("enumerated").optional(),
932
+ failureCount: z4.number().int().nonnegative(),
933
+ resourceState: z4.string(),
934
+ /** Full receipts retain effects, residual resources and recovery advice. */
935
+ lastReceipt: z4.string().nullable(),
936
+ lastError: z4.string().nullable(),
937
+ /** Confirmed pre-dispatch refusal; never inferred from a process exit. */
938
+ startRefusal: z4.literal("agent_unconfigured").optional(),
939
+ observedAt: z4.string()
940
+ });
941
+ var orcaWorkerDoneSchema = z4.object({
942
+ messageId: identifier,
943
+ runtimeId: identifier,
944
+ runId: identifier,
945
+ orcaTaskId: identifier,
946
+ dispatchId: identifier,
947
+ senderHandle: identifier,
948
+ outcome: z4.enum(["succeeded", "failed"]),
949
+ body: z4.string(),
950
+ reportPath: identifier
951
+ });
952
+ var orcaWorkerReportSchema = z4.object({
953
+ event: orcaWorkerDoneSchema,
954
+ manifestId: identifier,
955
+ manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
956
+ reportText: z4.string().min(1).max(65536),
957
+ reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
958
+ ingestedAt: z4.string().datetime()
959
+ });
960
+ var orcaReportDeliverySchema = z4.object({
961
+ key: identifier,
962
+ mailbox: identifier.nullable(),
963
+ state: z4.enum(["pending", "delivered"]),
964
+ messageId: identifier.nullable(),
965
+ deliveredAt: z4.string().datetime().nullable(),
966
+ lastError: z4.string().nullable()
967
+ });
968
+ var orcaWorkerSettlementSchema = z4.object({
969
+ resourceRelease: z4.object({
970
+ dispatchId: identifier,
971
+ releasedAt: z4.string().datetime(),
972
+ receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
973
+ receipt: identifier
974
+ }).optional(),
975
+ retiredAt: z4.string().datetime().optional(),
976
+ reportDelivery: orcaReportDeliverySchema.optional()
977
+ });
978
+ var orcaReportMessageSchema = z4.object({
979
+ id: identifier,
980
+ run_id: z4.string().nullable(),
981
+ delivery_contract: z4.string(),
982
+ from_handle: z4.string(),
983
+ to_handle: z4.string(),
984
+ type: z4.string(),
985
+ body: z4.string(),
986
+ payload: z4.string().nullable(),
987
+ sender_pane_key: z4.string().nullable()
988
+ });
989
+ var orcaReportSourceSchema = z4.object({
990
+ ok: z4.literal(true),
991
+ _meta: z4.object({ runtimeId: identifier }),
992
+ result: z4.object({
993
+ messages: z4.array(z4.json()).optional(),
994
+ dispatch: z4.object({
995
+ id: identifier,
996
+ run_id: identifier,
997
+ task_id: identifier,
998
+ assignee_handle: identifier,
999
+ assignee_pane_key: z4.string().nullable(),
1000
+ status: z4.string()
1001
+ }).optional()
1002
+ })
1003
+ });
1004
+ var orcaWorkerDonePayloadSchema = z4.object({
1005
+ taskId: identifier,
1006
+ dispatchId: identifier,
1007
+ outcome: z4.enum(["succeeded", "failed"]),
1008
+ reportPath: identifier
1009
+ });
1010
+ var orcaWorkerRequestSchema = z4.object({
1011
+ action: z4.enum([
1012
+ "show",
1013
+ "read",
1014
+ "recover-start",
1015
+ "recover-stop",
1016
+ "retry",
1017
+ "stop",
1018
+ "ingest-report",
1019
+ "relay-report"
1020
+ ]),
1021
+ recordId: identifier,
1022
+ cursor: identifier.optional(),
1023
+ messageId: identifier.optional()
1024
+ }).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
1025
+ message: "A source-pinned cursor is accepted only for read.",
1026
+ path: ["cursor"]
1027
+ }).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
1028
+ message: "ingest-report requires an exact message id; other actions do not accept one.",
1029
+ path: ["messageId"]
1030
+ });
1031
+ var effectSchema = z4.object({
1032
+ kind: z4.string(),
1033
+ role: z4.string().optional(),
1034
+ action: z4.string().optional(),
1035
+ id: z4.string().optional()
1036
+ });
1037
+ var selectionSchema = z4.object({
1038
+ agent: z4.string().nullable().optional(),
1039
+ model: z4.string().nullable().optional(),
1040
+ effort: z4.string().nullable().optional()
1041
+ });
1042
+ var orcaReplySchema = z4.object({
1043
+ ok: z4.boolean(),
1044
+ _meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
1045
+ error: z4.object({
1046
+ code: z4.string(),
1047
+ message: z4.string(),
1048
+ data: z4.object({
1049
+ requestId: identifier.optional(),
1050
+ orchestrationRequestId: identifier.optional(),
1051
+ dispatchId: identifier.optional()
1052
+ }).optional()
1053
+ }).optional(),
1054
+ result: z4.object({
1055
+ state: z4.string().optional(),
1056
+ requestId: identifier.optional(),
1057
+ /**
1058
+ * Mutation ledger identity Orca stamps on every successful mutation result.
1059
+ * @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
1060
+ * result it records (`Jy` in the retained source), so a successful stop can
1061
+ * be bound to the request key this attempt issued.
1062
+ */
1063
+ mutation: z4.object({
1064
+ requestId: identifier.optional(),
1065
+ replayed: z4.boolean().optional()
1066
+ }).optional(),
1067
+ stage: z4.string().optional(),
1068
+ turnStart: z4.string().optional(),
1069
+ runId: identifier.optional(),
1070
+ run: z4.object({ id: identifier }).nullable().optional(),
1071
+ taskId: identifier.optional(),
1072
+ dispatchId: identifier.optional(),
1073
+ failureCount: z4.number().int().nonnegative().optional(),
1074
+ effects: z4.array(effectSchema).optional(),
1075
+ residualResources: z4.array(effectSchema).optional(),
1076
+ launch: z4.object({ effective: selectionSchema.optional() }).optional(),
1077
+ lastError: z4.string().nullable().optional(),
1078
+ processAction: z4.string().optional(),
1079
+ helpers: z4.array(
1080
+ z4.object({
1081
+ dispatchId: identifier.optional(),
1082
+ creatorDispatchId: identifier.optional(),
1083
+ outcome: z4.string(),
1084
+ keptOpenBy: identifier.optional(),
1085
+ state: z4.string().optional(),
1086
+ lastError: z4.string().nullable().optional()
1087
+ })
1088
+ ).optional(),
1089
+ helperStopError: z4.string().nullable().optional(),
1090
+ status: z4.string().optional(),
1091
+ terminal: z4.object({
1092
+ handle: identifier,
1093
+ connected: z4.boolean(),
1094
+ writable: z4.boolean(),
1095
+ executionHostId: identifier
1096
+ }).optional(),
1097
+ runtime: z4.object({
1098
+ runtimeId: identifier,
1099
+ reachable: z4.boolean(),
1100
+ state: z4.string(),
1101
+ capabilities: z4.array(z4.string())
1102
+ }).optional(),
1103
+ worktree: z4.object({
1104
+ id: identifier,
1105
+ path: identifier,
1106
+ branch: identifier,
1107
+ hostId: identifier,
1108
+ address: z4.object({ worktree: identifier }).optional()
1109
+ }).optional(),
1110
+ dispatch: z4.object({
1111
+ id: identifier,
1112
+ runId: identifier,
1113
+ taskId: identifier,
1114
+ /** Direct creator Dispatch that started this one; null for a Run root. */
1115
+ creatorDispatchId: identifier.nullable().optional(),
1116
+ failureCount: z4.number().int().nonnegative()
1117
+ }).optional(),
1118
+ worker: z4.object({
1119
+ dispatchId: identifier,
1120
+ runtimeEpoch: identifier,
1121
+ state: z4.string(),
1122
+ stage: z4.string(),
1123
+ worktreeId: identifier.nullable()
1124
+ }).optional(),
1125
+ observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
1126
+ projection: z4.object({
1127
+ resource: z4.object({
1128
+ state: z4.string(),
1129
+ terminalState: z4.string(),
1130
+ ownerDispatchId: identifier.optional(),
1131
+ releaseState: z4.string().optional()
1132
+ }).optional()
1133
+ }).optional()
1134
+ }).optional()
1135
+ });
1136
+ var orcaCommandRegistrySchema = z4.object({
1137
+ schemaVersion: z4.number().int().positive(),
1138
+ commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
1139
+ });
1140
+ var accountProviderSchema = z4.object({
1141
+ accounts: z4.array(z4.object({})),
1142
+ activeAccountId: identifier.nullable()
1143
+ });
1144
+ var orcaAccountReplySchema = z4.object({
1145
+ ok: z4.literal(true),
1146
+ _meta: z4.object({ runtimeId: identifier }),
1147
+ result: z4.object({
1148
+ codex: accountProviderSchema,
1149
+ opencode: accountProviderSchema,
1150
+ claude: accountProviderSchema
1151
+ })
1152
+ });
1153
+
1154
+ // packages/contracts/src/config/worker-policy.ts
1155
+ import { z as z5 } from "zod";
1156
+ var projectWorkerPolicySchema = z5.object({
1157
+ verification: z5.object({
1158
+ full: z5.enum(["local", "ci"]),
1159
+ local: z5.enum(["single-file", "affected"])
856
1160
  }).strict().optional(),
857
- instructions: z4.array(
858
- z4.string().min(1).max(512).regex(/\S/).regex(
1161
+ instructions: z5.array(
1162
+ z5.string().min(1).max(512).regex(/\S/).regex(
859
1163
  /^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
860
1164
  "Instructions must be single-line text without control characters or a leading #"
861
1165
  )
@@ -883,8 +1187,11 @@ var CLEO_CONFIG_MANIFEST = {
883
1187
  path: ".cleo/config.json",
884
1188
  mergePrecedence: 20,
885
1189
  driftDetection: "schema-validate",
886
- schema: z5.object({
887
- orchestrate: z5.object({ workerPolicy: projectWorkerPolicySchema.optional() }).passthrough().optional()
1190
+ schema: z6.object({
1191
+ orchestrate: z6.object({
1192
+ workerPolicy: projectWorkerPolicySchema.optional(),
1193
+ orca: orchestrateOrcaConfigSchema.optional()
1194
+ }).passthrough().optional()
888
1195
  }).passthrough()
889
1196
  };
890
1197
  var GLOBAL_CLEO_CONFIG_MANIFEST = {
@@ -900,139 +1207,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
900
1207
  GLOBAL_CLEO_CONFIG_MANIFEST,
901
1208
  CLEO_CONFIG_MANIFEST
902
1209
  ]);
903
- var configManifestEntrySchema = z5.object({
904
- id: z5.string().min(1),
905
- scope: z5.union([z5.literal("global"), z5.literal("project"), z5.literal("metadata")]),
906
- path: z5.string().min(1),
907
- schema: z5.unknown().optional(),
908
- mergePrecedence: z5.number().int().nonnegative(),
909
- driftDetection: z5.union([
910
- z5.literal("schema-validate"),
911
- z5.literal("staleness-gate"),
912
- z5.literal("value-diff"),
913
- z5.literal("none")
1210
+ var configManifestEntrySchema = z6.object({
1211
+ id: z6.string().min(1),
1212
+ scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
1213
+ path: z6.string().min(1),
1214
+ schema: z6.unknown().optional(),
1215
+ mergePrecedence: z6.number().int().nonnegative(),
1216
+ driftDetection: z6.union([
1217
+ z6.literal("schema-validate"),
1218
+ z6.literal("staleness-gate"),
1219
+ z6.literal("value-diff"),
1220
+ z6.literal("none")
914
1221
  ]),
915
- defaults: z5.record(z5.string(), z5.unknown()).optional()
1222
+ defaults: z6.record(z6.string(), z6.unknown()).optional()
916
1223
  });
917
1224
 
918
1225
  // packages/contracts/src/daemon/health.ts
919
- import { z as z7 } from "zod";
1226
+ import { z as z8 } from "zod";
920
1227
 
921
1228
  // packages/contracts/src/supervisor-ipc/messages.ts
922
- import { z as z6 } from "zod";
923
- var EnvPairSchema = z6.object({
1229
+ import { z as z7 } from "zod";
1230
+ var EnvPairSchema = z7.object({
924
1231
  /** Environment variable name. */
925
- key: z6.string().min(1),
1232
+ key: z7.string().min(1),
926
1233
  /** Environment variable value. */
927
- value: z6.string()
1234
+ value: z7.string()
928
1235
  }).strict();
929
- var ChildStateSchema = z6.enum(["running", "restarting", "stopped"]);
930
- var ChildStatusSchema = z6.object({
1236
+ var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
1237
+ var ChildStatusSchema = z7.object({
931
1238
  /** Logical id of the child (stable across restarts). */
932
- child_id: z6.string().min(1),
1239
+ child_id: z7.string().min(1),
933
1240
  /** Current OS pid (0 when not currently running). */
934
- pid: z6.number().int().nonnegative(),
1241
+ pid: z7.number().int().nonnegative(),
935
1242
  /** Current liveness state. */
936
1243
  state: ChildStateSchema,
937
1244
  /** Total restarts observed for this child. */
938
- restart_count: z6.number().int().nonnegative()
1245
+ restart_count: z7.number().int().nonnegative()
939
1246
  }).strict();
940
- var SpawnRequestSchema = z6.object({
1247
+ var SpawnRequestSchema = z7.object({
941
1248
  /** Tag discriminating this request variant. */
942
- kind: z6.literal("spawn"),
1249
+ kind: z7.literal("spawn"),
943
1250
  /** Caller-chosen logical id for the child (stable across restarts). */
944
- child_id: z6.string().min(1),
1251
+ child_id: z7.string().min(1),
945
1252
  /** Absolute path to the program to execute. */
946
- program: z6.string().min(1),
1253
+ program: z7.string().min(1),
947
1254
  /** Arguments passed to the program. */
948
- args: z6.array(z6.string()).default([]),
1255
+ args: z7.array(z7.string()).default([]),
949
1256
  /** Environment overrides applied on top of the supervisor's environment. */
950
- env: z6.array(EnvPairSchema).default([]),
1257
+ env: z7.array(EnvPairSchema).default([]),
951
1258
  /** Optional working directory for the child. */
952
- cwd: z6.string().optional()
1259
+ cwd: z7.string().optional()
953
1260
  }).strict();
954
- var RestartRequestSchema = z6.object({
1261
+ var RestartRequestSchema = z7.object({
955
1262
  /** Tag discriminating this request variant. */
956
- kind: z6.literal("restart"),
1263
+ kind: z7.literal("restart"),
957
1264
  /** Logical id of the child to restart. */
958
- child_id: z6.string().min(1)
1265
+ child_id: z7.string().min(1)
959
1266
  }).strict();
960
- var MonitorRequestSchema = z6.object({
1267
+ var MonitorRequestSchema = z7.object({
961
1268
  /** Tag discriminating this request variant. */
962
- kind: z6.literal("monitor"),
1269
+ kind: z7.literal("monitor"),
963
1270
  /** Specific child id to monitor; omit to request all children. */
964
- child_id: z6.string().optional()
1271
+ child_id: z7.string().optional()
965
1272
  }).strict();
966
- var HealthRequestSchema = z6.object({
1273
+ var HealthRequestSchema = z7.object({
967
1274
  /** Tag discriminating this request variant. */
968
- kind: z6.literal("health")
1275
+ kind: z7.literal("health")
969
1276
  }).strict();
970
- var SupervisorIpcRequestSchema = z6.discriminatedUnion("kind", [
1277
+ var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
971
1278
  SpawnRequestSchema,
972
1279
  RestartRequestSchema,
973
1280
  MonitorRequestSchema,
974
1281
  HealthRequestSchema
975
1282
  ]);
976
- var SpawnedResponseSchema = z6.object({
1283
+ var SpawnedResponseSchema = z7.object({
977
1284
  /** Tag discriminating this response variant. */
978
- kind: z6.literal("spawned"),
1285
+ kind: z7.literal("spawned"),
979
1286
  /** Logical id of the spawned child. */
980
- child_id: z6.string().min(1),
1287
+ child_id: z7.string().min(1),
981
1288
  /** OS pid assigned to the spawned child. */
982
- pid: z6.number().int().nonnegative()
1289
+ pid: z7.number().int().nonnegative()
983
1290
  }).strict();
984
- var RestartedResponseSchema = z6.object({
1291
+ var RestartedResponseSchema = z7.object({
985
1292
  /** Tag discriminating this response variant. */
986
- kind: z6.literal("restarted"),
1293
+ kind: z7.literal("restarted"),
987
1294
  /** Logical id of the restarted child. */
988
- child_id: z6.string().min(1),
1295
+ child_id: z7.string().min(1),
989
1296
  /** New OS pid after the restart. */
990
- pid: z6.number().int().nonnegative(),
1297
+ pid: z7.number().int().nonnegative(),
991
1298
  /** Number of times this child has been restarted in total. */
992
- restart_count: z6.number().int().nonnegative()
1299
+ restart_count: z7.number().int().nonnegative()
993
1300
  }).strict();
994
- var MonitorResponseSchema = z6.object({
1301
+ var MonitorResponseSchema = z7.object({
995
1302
  /** Tag discriminating this response variant. */
996
- kind: z6.literal("monitor"),
1303
+ kind: z7.literal("monitor"),
997
1304
  /** One row per monitored child. */
998
- children: z6.array(ChildStatusSchema)
1305
+ children: z7.array(ChildStatusSchema)
999
1306
  }).strict();
1000
- var HealthResponseSchema = z6.object({
1307
+ var HealthResponseSchema = z7.object({
1001
1308
  /** Tag discriminating this response variant. */
1002
- kind: z6.literal("health"),
1309
+ kind: z7.literal("health"),
1003
1310
  /** Supervisor process pid. */
1004
- pid: z6.number().int().nonnegative(),
1311
+ pid: z7.number().int().nonnegative(),
1005
1312
  /** Number of children currently tracked. */
1006
- child_count: z6.number().int().nonnegative(),
1313
+ child_count: z7.number().int().nonnegative(),
1007
1314
  /** Seconds the supervisor has been running. */
1008
- uptime_secs: z6.number().int().nonnegative(),
1315
+ uptime_secs: z7.number().int().nonnegative(),
1009
1316
  /** Frozen protocol version the supervisor speaks. */
1010
- protocol_version: z6.string()
1317
+ protocol_version: z7.string()
1011
1318
  }).strict();
1012
- var LifecycleEventKindSchema = z6.enum(["child_exited", "child_restarted"]);
1013
- var LifecycleEventResponseSchema = z6.object({
1319
+ var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
1320
+ var LifecycleEventResponseSchema = z7.object({
1014
1321
  /** Tag discriminating this response variant. */
1015
- kind: z6.literal("event"),
1322
+ kind: z7.literal("event"),
1016
1323
  /** What happened. */
1017
1324
  event: LifecycleEventKindSchema,
1018
1325
  /** Logical id of the affected child. */
1019
- child_id: z6.string().min(1),
1326
+ child_id: z7.string().min(1),
1020
1327
  /** Exit code, when the OS reported one. */
1021
- exit_code: z6.number().int().optional(),
1328
+ exit_code: z7.number().int().optional(),
1022
1329
  /** Terminating signal name, when the child was signalled (Unix). */
1023
- signal: z6.string().optional(),
1330
+ signal: z7.string().optional(),
1024
1331
  /** Backoff delay (ms) before the pending restart, when applicable. */
1025
- restart_delay_ms: z6.number().int().nonnegative().optional()
1332
+ restart_delay_ms: z7.number().int().nonnegative().optional()
1026
1333
  }).strict();
1027
- var ErrorResponseSchema = z6.object({
1334
+ var ErrorResponseSchema = z7.object({
1028
1335
  /** Tag discriminating this response variant. */
1029
- kind: z6.literal("error"),
1336
+ kind: z7.literal("error"),
1030
1337
  /** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
1031
- code: z6.string().min(1),
1338
+ code: z7.string().min(1),
1032
1339
  /** Human-readable error message. */
1033
- message: z6.string()
1340
+ message: z7.string()
1034
1341
  }).strict();
1035
- var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1342
+ var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
1036
1343
  SpawnedResponseSchema,
1037
1344
  RestartedResponseSchema,
1038
1345
  MonitorResponseSchema,
@@ -1040,27 +1347,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1040
1347
  LifecycleEventResponseSchema,
1041
1348
  ErrorResponseSchema
1042
1349
  ]);
1043
- var SupervisorIpcRequestEnvelopeSchema = z6.object({
1350
+ var SupervisorIpcRequestEnvelopeSchema = z7.object({
1044
1351
  /** Frozen protocol version. */
1045
- protocol_version: z6.string(),
1352
+ protocol_version: z7.string(),
1046
1353
  /** Correlation id echoed back on the matching response. */
1047
- id: z6.string().min(1),
1354
+ id: z7.string().min(1),
1048
1355
  /** Direction discriminator. */
1049
- direction: z6.literal("request"),
1356
+ direction: z7.literal("request"),
1050
1357
  /** The request body. */
1051
1358
  request: SupervisorIpcRequestSchema
1052
1359
  }).strict();
1053
- var SupervisorIpcResponseEnvelopeSchema = z6.object({
1360
+ var SupervisorIpcResponseEnvelopeSchema = z7.object({
1054
1361
  /** Frozen protocol version. */
1055
- protocol_version: z6.string(),
1362
+ protocol_version: z7.string(),
1056
1363
  /** Correlation id echoed from the originating request (or a fresh id for events). */
1057
- id: z6.string().min(1),
1364
+ id: z7.string().min(1),
1058
1365
  /** Direction discriminator. */
1059
- direction: z6.literal("response"),
1366
+ direction: z7.literal("response"),
1060
1367
  /** The response body. */
1061
1368
  response: SupervisorIpcResponseSchema
1062
1369
  }).strict();
1063
- var SupervisorIpcEnvelopeSchema = z6.discriminatedUnion("direction", [
1370
+ var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
1064
1371
  SupervisorIpcRequestEnvelopeSchema,
1065
1372
  SupervisorIpcResponseEnvelopeSchema
1066
1373
  ]);
@@ -1084,17 +1391,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
1084
1391
  * Optional human-readable detail (e.g. last error message, queue depth).
1085
1392
  * Diagnostic only — not part of the supervisor wire contract.
1086
1393
  */
1087
- detail: z7.string().optional()
1394
+ detail: z8.string().optional()
1088
1395
  }).strict();
1089
- var HealthStatusSchema = z7.object({
1396
+ var HealthStatusSchema = z8.object({
1090
1397
  /** One health row per registered subsystem. */
1091
- subsystems: z7.array(SubsystemHealthSchema),
1398
+ subsystems: z8.array(SubsystemHealthSchema),
1092
1399
  /**
1093
1400
  * `true` iff every subsystem is in the `running` state. A convenience roll-up
1094
1401
  * derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
1095
1402
  * {@link summarizeHealth} so producers cannot desync it.
1096
1403
  */
1097
- allHealthy: z7.boolean()
1404
+ allHealthy: z8.boolean()
1098
1405
  }).strict();
1099
1406
 
1100
1407
  // packages/contracts/src/db-inventory.json
@@ -13023,7 +13330,7 @@ var OPERATIONS = [
13023
13330
  ];
13024
13331
 
13025
13332
  // packages/contracts/src/docs/modernize.ts
13026
- import { z as z8 } from "zod";
13333
+ import { z as z9 } from "zod";
13027
13334
  var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
13028
13335
  var DOCS_MODERNIZE_OPS = [
13029
13336
  "ingest",
@@ -13037,105 +13344,105 @@ var DOCS_MODERNIZE_OPS = [
13037
13344
  "reslug",
13038
13345
  "link-task"
13039
13346
  ];
13040
- var judgmentSchema = z8.object({
13041
- question: z8.enum(["classify", "merge"]),
13042
- site: z8.string(),
13043
- mode: z8.enum(["off", "shadow", "on"]),
13044
- ruleAnswer: z8.string(),
13045
- decidedAnswer: z8.string().nullable(),
13046
- decidedConfidence: z8.number().nullable(),
13047
- source: z8.enum(["provider", "cache", "fallback"]),
13048
- acted: z8.string()
13347
+ var judgmentSchema = z9.object({
13348
+ question: z9.enum(["classify", "merge"]),
13349
+ site: z9.string(),
13350
+ mode: z9.enum(["off", "shadow", "on"]),
13351
+ ruleAnswer: z9.string(),
13352
+ decidedAnswer: z9.string().nullable(),
13353
+ decidedConfidence: z9.number().nullable(),
13354
+ source: z9.enum(["provider", "cache", "fallback"]),
13355
+ acted: z9.string()
13049
13356
  });
13050
- var relPath = z8.string().min(1).max(1024);
13051
- var docsModernizePlanSchema = z8.object({
13052
- root: z8.string().min(1),
13053
- generatedAt: z8.string(),
13054
- mode: z8.enum(["tree", "store-only"]),
13055
- counts: z8.record(z8.enum(DOCS_MODERNIZE_DISPOSITIONS), z8.number()),
13056
- rows: z8.array(
13057
- z8.object({
13357
+ var relPath = z9.string().min(1).max(1024);
13358
+ var docsModernizePlanSchema = z9.object({
13359
+ root: z9.string().min(1),
13360
+ generatedAt: z9.string(),
13361
+ mode: z9.enum(["tree", "store-only"]),
13362
+ counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
13363
+ rows: z9.array(
13364
+ z9.object({
13058
13365
  path: relPath,
13059
- sha256: z8.string().regex(/^[0-9a-f]{64}$/),
13060
- kind: z8.string().min(1),
13061
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13062
- title: z8.string(),
13063
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13064
- target: z8.string().min(1).max(1024).nullable(),
13065
- reasons: z8.array(z8.string()),
13066
- judgments: z8.array(judgmentSchema),
13067
- ownerTasks: z8.array(z8.string().regex(/^[TD]\d+$/)),
13068
- category: z8.string(),
13069
- refs: z8.array(z8.string()),
13070
- overridden: z8.boolean(),
13071
- covers: z8.array(z8.string()),
13072
- baselineRemove: z8.boolean()
13366
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/),
13367
+ kind: z9.string().min(1),
13368
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13369
+ title: z9.string(),
13370
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
13371
+ target: z9.string().min(1).max(1024).nullable(),
13372
+ reasons: z9.array(z9.string()),
13373
+ judgments: z9.array(judgmentSchema),
13374
+ ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
13375
+ category: z9.string(),
13376
+ refs: z9.array(z9.string()),
13377
+ overridden: z9.boolean(),
13378
+ covers: z9.array(z9.string()),
13379
+ baselineRemove: z9.boolean()
13073
13380
  })
13074
13381
  ),
13075
- linkFixes: z8.array(
13076
- z8.object({
13077
- kind: z8.literal("link-fix"),
13382
+ linkFixes: z9.array(
13383
+ z9.object({
13384
+ kind: z9.literal("link-fix"),
13078
13385
  path: relPath,
13079
- href: z8.string().min(1).max(2048),
13080
- newHref: z8.string().min(1).max(2048),
13081
- base: z8.literal("repo").optional(),
13082
- sha256: z8.string().regex(/^[0-9a-f]{64}$/).optional()
13386
+ href: z9.string().min(1).max(2048),
13387
+ newHref: z9.string().min(1).max(2048),
13388
+ base: z9.literal("repo").optional(),
13389
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
13083
13390
  })
13084
13391
  ).optional(),
13085
- repoRoot: z8.string().min(1).optional()
13392
+ repoRoot: z9.string().min(1).optional()
13086
13393
  });
13087
- var docsModernizeOverridesSchema = z8.record(
13394
+ var docsModernizeOverridesSchema = z9.record(
13088
13395
  relPath,
13089
- z8.object({
13090
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13091
- target: z8.string().min(1).max(1024).nullable().optional(),
13092
- reason: z8.string().min(1),
13093
- kind: z8.string().min(1).optional(),
13094
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13095
- covers: z8.array(z8.string()).optional()
13396
+ z9.object({
13397
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
13398
+ target: z9.string().min(1).max(1024).nullable().optional(),
13399
+ reason: z9.string().min(1),
13400
+ kind: z9.string().min(1).optional(),
13401
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13402
+ covers: z9.array(z9.string()).optional()
13096
13403
  })
13097
13404
  );
13098
- var receiptOpSchema = z8.object({
13099
- op: z8.enum(DOCS_MODERNIZE_OPS),
13100
- state: z8.enum(["pending", "done", "reversed"]),
13101
- slug: z8.string().nullable(),
13405
+ var receiptOpSchema = z9.object({
13406
+ op: z9.enum(DOCS_MODERNIZE_OPS),
13407
+ state: z9.enum(["pending", "done", "reversed"]),
13408
+ slug: z9.string().nullable(),
13102
13409
  path: relPath.nullable(),
13103
- target: z8.string().nullable(),
13104
- attachmentId: z8.string().nullable(),
13105
- ownerId: z8.string().nullable(),
13106
- beforeSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13107
- afterSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13108
- prior: z8.object({
13109
- lifecycleStatus: z8.string().nullable().optional(),
13110
- supersededBy: z8.string().nullable().optional(),
13111
- supersedes: z8.string().nullable().optional(),
13112
- previousAttachmentId: z8.string().nullable().optional(),
13113
- newAttachmentId: z8.string().nullable().optional(),
13114
- linkTargets: z8.array(z8.string()).optional(),
13115
- kind: z8.string().nullable().optional()
13410
+ target: z9.string().nullable(),
13411
+ attachmentId: z9.string().nullable(),
13412
+ ownerId: z9.string().nullable(),
13413
+ beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
13414
+ afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
13415
+ prior: z9.object({
13416
+ lifecycleStatus: z9.string().nullable().optional(),
13417
+ supersededBy: z9.string().nullable().optional(),
13418
+ supersedes: z9.string().nullable().optional(),
13419
+ previousAttachmentId: z9.string().nullable().optional(),
13420
+ newAttachmentId: z9.string().nullable().optional(),
13421
+ linkTargets: z9.array(z9.string()).optional(),
13422
+ kind: z9.string().nullable().optional()
13116
13423
  }).optional(),
13117
- base: z8.literal("repo").optional()
13424
+ base: z9.literal("repo").optional()
13118
13425
  });
13119
13426
  var docsModernizeJournalLineSchema = receiptOpSchema.extend({
13120
- i: z8.number().int().min(0)
13427
+ i: z9.number().int().min(0)
13121
13428
  });
13122
- var docsModernizeReceiptSchema = z8.object({
13123
- runId: z8.string().regex(/^dm-[\w-]+$/),
13124
- root: z8.string().min(1),
13125
- appliedAt: z8.string(),
13126
- planSha256: z8.string(),
13127
- edgeCount: z8.number(),
13128
- rolledBackAt: z8.string().nullable(),
13129
- blobs: z8.array(z8.object({ path: relPath, sha256: z8.string() })),
13130
- moves: z8.array(z8.object({ from: relPath, to: relPath })),
13131
- deleted: z8.array(relPath),
13132
- ops: z8.array(receiptOpSchema),
13133
- durationMs: z8.number().optional(),
13134
- repoRoot: z8.string().min(1).optional()
13429
+ var docsModernizeReceiptSchema = z9.object({
13430
+ runId: z9.string().regex(/^dm-[\w-]+$/),
13431
+ root: z9.string().min(1),
13432
+ appliedAt: z9.string(),
13433
+ planSha256: z9.string(),
13434
+ edgeCount: z9.number(),
13435
+ rolledBackAt: z9.string().nullable(),
13436
+ blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
13437
+ moves: z9.array(z9.object({ from: relPath, to: relPath })),
13438
+ deleted: z9.array(relPath),
13439
+ ops: z9.array(receiptOpSchema),
13440
+ durationMs: z9.number().optional(),
13441
+ repoRoot: z9.string().min(1).optional()
13135
13442
  });
13136
13443
 
13137
13444
  // packages/contracts/src/docs/provenance.ts
13138
- import { z as z9 } from "zod";
13445
+ import { z as z10 } from "zod";
13139
13446
  var PROVENANCE_NODE_KINDS = [
13140
13447
  "doc",
13141
13448
  "task",
@@ -13158,96 +13465,96 @@ var DOC_LIFECYCLE_STATUSES = [
13158
13465
  "archived",
13159
13466
  "draft"
13160
13467
  ];
13161
- var provenanceNodeKindSchema = z9.enum(PROVENANCE_NODE_KINDS);
13162
- var provenanceEdgeRelationSchema = z9.enum(PROVENANCE_EDGE_RELATIONS);
13163
- var docLifecycleStatusSchema = z9.enum(DOC_LIFECYCLE_STATUSES);
13468
+ var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
13469
+ var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
13470
+ var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
13164
13471
  var provenanceNodeBaseFields = {
13165
- id: z9.string().min(1),
13166
- title: z9.string().min(1),
13167
- metadata: z9.record(z9.string(), z9.unknown()).optional()
13472
+ id: z10.string().min(1),
13473
+ title: z10.string().min(1),
13474
+ metadata: z10.record(z10.string(), z10.unknown()).optional()
13168
13475
  };
13169
- var provenanceDocNodeSchema = z9.object({
13476
+ var provenanceDocNodeSchema = z10.object({
13170
13477
  ...provenanceNodeBaseFields,
13171
- kind: z9.literal("doc"),
13172
- slug: z9.string().min(1),
13173
- docKind: z9.string().min(1),
13478
+ kind: z10.literal("doc"),
13479
+ slug: z10.string().min(1),
13480
+ docKind: z10.string().min(1),
13174
13481
  lifecycleStatus: docLifecycleStatusSchema,
13175
- publishedAt: z9.string().min(1),
13176
- supersededAt: z9.string().min(1).optional(),
13177
- summary: z9.string().optional()
13482
+ publishedAt: z10.string().min(1),
13483
+ supersededAt: z10.string().min(1).optional(),
13484
+ summary: z10.string().optional()
13178
13485
  });
13179
- var provenanceTaskNodeSchema = z9.object({
13486
+ var provenanceTaskNodeSchema = z10.object({
13180
13487
  ...provenanceNodeBaseFields,
13181
- kind: z9.literal("task"),
13182
- taskType: z9.enum(["saga", "epic", "task", "subtask"]),
13183
- status: z9.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
13488
+ kind: z10.literal("task"),
13489
+ taskType: z10.enum(["saga", "epic", "task", "subtask"]),
13490
+ status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
13184
13491
  });
13185
- var provenanceDecisionNodeSchema = z9.object({
13492
+ var provenanceDecisionNodeSchema = z10.object({
13186
13493
  ...provenanceNodeBaseFields,
13187
- kind: z9.literal("decision"),
13188
- outcome: z9.enum(["proposed", "accepted", "rejected", "superseded"]),
13189
- decidedAt: z9.string().min(1)
13494
+ kind: z10.literal("decision"),
13495
+ outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
13496
+ decidedAt: z10.string().min(1)
13190
13497
  });
13191
- var provenanceSessionNodeSchema = z9.object({
13498
+ var provenanceSessionNodeSchema = z10.object({
13192
13499
  ...provenanceNodeBaseFields,
13193
- kind: z9.literal("session"),
13194
- startedAt: z9.string().min(1),
13195
- endedAt: z9.string().min(1).optional()
13500
+ kind: z10.literal("session"),
13501
+ startedAt: z10.string().min(1),
13502
+ endedAt: z10.string().min(1).optional()
13196
13503
  });
13197
- var provenanceMemoryNodeSchema = z9.object({
13504
+ var provenanceMemoryNodeSchema = z10.object({
13198
13505
  ...provenanceNodeBaseFields,
13199
- kind: z9.literal("memory"),
13200
- memoryType: z9.enum(["observation", "pattern", "decision", "diary"]),
13201
- recordedAt: z9.string().min(1)
13506
+ kind: z10.literal("memory"),
13507
+ memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
13508
+ recordedAt: z10.string().min(1)
13202
13509
  });
13203
- var provenanceNodeSchema = z9.discriminatedUnion("kind", [
13510
+ var provenanceNodeSchema = z10.discriminatedUnion("kind", [
13204
13511
  provenanceDocNodeSchema,
13205
13512
  provenanceTaskNodeSchema,
13206
13513
  provenanceDecisionNodeSchema,
13207
13514
  provenanceSessionNodeSchema,
13208
13515
  provenanceMemoryNodeSchema
13209
13516
  ]);
13210
- var provenanceEdgeSchema = z9.object({
13517
+ var provenanceEdgeSchema = z10.object({
13211
13518
  relation: provenanceEdgeRelationSchema,
13212
- from: z9.string().min(1),
13519
+ from: z10.string().min(1),
13213
13520
  fromKind: provenanceNodeKindSchema,
13214
- to: z9.string().min(1),
13521
+ to: z10.string().min(1),
13215
13522
  toKind: provenanceNodeKindSchema,
13216
- addedAt: z9.string().min(1),
13217
- summary: z9.string().optional()
13523
+ addedAt: z10.string().min(1),
13524
+ summary: z10.string().optional()
13218
13525
  });
13219
- var docProvenanceResponseSchema = z9.object({
13220
- nodes: z9.array(provenanceNodeSchema).readonly(),
13221
- edges: z9.array(provenanceEdgeSchema).readonly(),
13222
- totalNodes: z9.number().int().nonnegative(),
13223
- totalEdges: z9.number().int().nonnegative()
13526
+ var docProvenanceResponseSchema = z10.object({
13527
+ nodes: z10.array(provenanceNodeSchema).readonly(),
13528
+ edges: z10.array(provenanceEdgeSchema).readonly(),
13529
+ totalNodes: z10.number().int().nonnegative(),
13530
+ totalEdges: z10.number().int().nonnegative()
13224
13531
  });
13225
13532
 
13226
13533
  // packages/contracts/src/docs/read.ts
13227
- import { z as z10 } from "zod";
13228
- var docFrontmatterSchema = z10.object({
13229
- slug: z10.string(),
13230
- kind: z10.string().nullable(),
13231
- title: z10.string().nullable(),
13232
- summary: z10.string().nullable(),
13233
- lifecycleStatus: z10.string(),
13234
- docVersion: z10.number().int(),
13235
- ownerVersion: z10.string().nullable(),
13236
- supersedes: z10.string().nullable(),
13237
- supersededBy: z10.string().nullable(),
13238
- topics: z10.array(z10.string()).readonly(),
13239
- relatedTasks: z10.array(z10.string()).readonly(),
13240
- sha256: z10.string(),
13241
- createdAt: z10.string()
13534
+ import { z as z11 } from "zod";
13535
+ var docFrontmatterSchema = z11.object({
13536
+ slug: z11.string(),
13537
+ kind: z11.string().nullable(),
13538
+ title: z11.string().nullable(),
13539
+ summary: z11.string().nullable(),
13540
+ lifecycleStatus: z11.string(),
13541
+ docVersion: z11.number().int(),
13542
+ ownerVersion: z11.string().nullable(),
13543
+ supersedes: z11.string().nullable(),
13544
+ supersededBy: z11.string().nullable(),
13545
+ topics: z11.array(z11.string()).readonly(),
13546
+ relatedTasks: z11.array(z11.string()).readonly(),
13547
+ sha256: z11.string(),
13548
+ createdAt: z11.string()
13242
13549
  });
13243
- var docBodySchema = z10.object({
13244
- encoding: z10.enum(["utf-8", "base64"]),
13245
- text: z10.string().optional(),
13246
- base64: z10.string().optional(),
13247
- sizeBytes: z10.number().int().nonnegative(),
13248
- mimeType: z10.string().nullable()
13550
+ var docBodySchema = z11.object({
13551
+ encoding: z11.enum(["utf-8", "base64"]),
13552
+ text: z11.string().optional(),
13553
+ base64: z11.string().optional(),
13554
+ sizeBytes: z11.number().int().nonnegative(),
13555
+ mimeType: z11.string().nullable()
13249
13556
  });
13250
- var docReadResponseSchema = z10.object({
13557
+ var docReadResponseSchema = z11.object({
13251
13558
  frontmatter: docFrontmatterSchema,
13252
13559
  body: docBodySchema
13253
13560
  });
@@ -13420,7 +13727,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
13420
13727
  }
13421
13728
 
13422
13729
  // packages/contracts/src/evidence-atom-schema.ts
13423
- import { z as z11 } from "zod";
13730
+ import { z as z12 } from "zod";
13424
13731
  var EVIDENCE_ATOM_KINDS = [
13425
13732
  "commit",
13426
13733
  "files",
@@ -13442,96 +13749,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
13442
13749
  var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
13443
13750
  var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
13444
13751
  var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
13445
- var commitAtomSchema = z11.object({
13446
- kind: z11.literal("commit"),
13447
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
13752
+ var commitAtomSchema = z12.object({
13753
+ kind: z12.literal("commit"),
13754
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
13448
13755
  });
13449
- var filesAtomSchema = z11.object({
13450
- kind: z11.literal("files"),
13451
- paths: z11.array(z11.string().min(1)).min(1, "files atom requires at least one path")
13756
+ var filesAtomSchema = z12.object({
13757
+ kind: z12.literal("files"),
13758
+ paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
13452
13759
  });
13453
- var testRunAtomSchema = z11.object({
13454
- kind: z11.literal("test-run"),
13455
- path: z11.string().min(1, "test-run atom requires a non-empty path")
13760
+ var testRunAtomSchema = z12.object({
13761
+ kind: z12.literal("test-run"),
13762
+ path: z12.string().min(1, "test-run atom requires a non-empty path")
13456
13763
  });
13457
- var qaRunAtomSchema = z11.object({
13458
- kind: z11.literal("qa-run"),
13459
- path: z11.string().min(1, "qa-run atom requires a non-empty path")
13764
+ var qaRunAtomSchema = z12.object({
13765
+ kind: z12.literal("qa-run"),
13766
+ path: z12.string().min(1, "qa-run atom requires a non-empty path")
13460
13767
  });
13461
- var toolAtomSchema = z11.object({
13462
- kind: z11.literal("tool"),
13463
- tool: z11.string().min(1, "tool atom requires a non-empty tool name")
13768
+ var toolAtomSchema = z12.object({
13769
+ kind: z12.literal("tool"),
13770
+ tool: z12.string().min(1, "tool atom requires a non-empty tool name")
13464
13771
  });
13465
- var urlAtomSchema = z11.object({
13466
- kind: z11.literal("url"),
13467
- url: z11.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
13772
+ var urlAtomSchema = z12.object({
13773
+ kind: z12.literal("url"),
13774
+ url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
13468
13775
  });
13469
- var noteAtomSchema = z11.object({
13470
- kind: z11.literal("note"),
13471
- note: z11.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
13776
+ var noteAtomSchema = z12.object({
13777
+ kind: z12.literal("note"),
13778
+ note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
13472
13779
  });
13473
- var decisionAtomSchema = z11.object({
13474
- kind: z11.literal("decision"),
13475
- decisionId: z11.string().min(1, "decision atom requires a non-empty decision ID")
13780
+ var decisionAtomSchema = z12.object({
13781
+ kind: z12.literal("decision"),
13782
+ decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
13476
13783
  });
13477
- var prAtomSchema = z11.object({
13478
- kind: z11.literal("pr"),
13479
- prNumber: z11.number().int().positive("pr atom requires a positive integer PR number"),
13480
- componentPrNumber: z11.number().int().positive().optional(),
13784
+ var prAtomSchema = z12.object({
13785
+ kind: z12.literal("pr"),
13786
+ prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
13787
+ componentPrNumber: z12.number().int().positive().optional(),
13481
13788
  /**
13482
13789
  * `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
13483
13790
  * belongs to, lowercased. Validated against the evidence git root's
13484
13791
  * `origin`, since PR numbers are only unique per repository.
13485
13792
  */
13486
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13793
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13487
13794
  });
13488
- var ciAtomSchema = z11.object({
13489
- kind: z11.literal("ci"),
13490
- prNumber: z11.number().int().positive("ci atom requires a positive integer PR number"),
13491
- componentPrNumber: z11.number().int().positive().optional(),
13795
+ var ciAtomSchema = z12.object({
13796
+ kind: z12.literal("ci"),
13797
+ prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
13798
+ componentPrNumber: z12.number().int().positive().optional(),
13492
13799
  /** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
13493
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13800
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13494
13801
  });
13495
- var ciRunAtomSchema = z11.object({
13496
- kind: z11.literal("ci-run"),
13497
- runId: z11.number().int().positive("ci-run atom requires a positive integer run id")
13802
+ var ciRunAtomSchema = z12.object({
13803
+ kind: z12.literal("ci-run"),
13804
+ runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
13498
13805
  });
13499
- var deployAtomSchema = z11.object({
13500
- kind: z11.literal("deploy"),
13501
- provider: z11.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
13502
- deploymentId: z11.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
13503
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
13504
- probeUrl: z11.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
13806
+ var deployAtomSchema = z12.object({
13807
+ kind: z12.literal("deploy"),
13808
+ provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
13809
+ deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
13810
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
13811
+ probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
13505
13812
  });
13506
- var locDropAtomSchema = z11.object({
13507
- kind: z11.literal("loc-drop"),
13508
- fromLines: z11.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
13509
- toLines: z11.number().int().nonnegative("loc-drop toLines must be \u2265 0")
13813
+ var locDropAtomSchema = z12.object({
13814
+ kind: z12.literal("loc-drop"),
13815
+ fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
13816
+ toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
13510
13817
  });
13511
- var callsiteCoverageAtomSchema = z11.object({
13512
- kind: z11.literal("callsite-coverage"),
13513
- symbolName: z11.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
13514
- relativeSourcePath: z11.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
13818
+ var callsiteCoverageAtomSchema = z12.object({
13819
+ kind: z12.literal("callsite-coverage"),
13820
+ symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
13821
+ relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
13515
13822
  });
13516
13823
  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}$/;
13517
13824
  var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
13518
13825
  var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
13519
13826
  var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
13520
- var satisfiesAtomSchema = z11.object({
13521
- kind: z11.literal("satisfies"),
13827
+ var satisfiesAtomSchema = z12.object({
13828
+ kind: z12.literal("satisfies"),
13522
13829
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
13523
- targetTaskId: z11.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
13830
+ targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
13524
13831
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
13525
- targetAcId: z11.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
13832
+ targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
13526
13833
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
13527
- targetAcAlias: z11.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
13834
+ targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
13528
13835
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
13529
- versionPin: z11.string().regex(
13836
+ versionPin: z12.string().regex(
13530
13837
  SATISFIES_VERSION_PIN_REGEX,
13531
13838
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
13532
13839
  ).optional()
13533
13840
  });
13534
- var EvidenceAtomSchema = z11.discriminatedUnion("kind", [
13841
+ var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
13535
13842
  commitAtomSchema,
13536
13843
  filesAtomSchema,
13537
13844
  testRunAtomSchema,
@@ -13593,54 +13900,54 @@ var ATOM_EXAMPLES = Object.freeze({
13593
13900
  });
13594
13901
 
13595
13902
  // packages/contracts/src/evidence-record-schema.ts
13596
- import { z as z12 } from "zod";
13597
- var evidenceBaseSchema = z12.object({
13903
+ import { z as z13 } from "zod";
13904
+ var evidenceBaseSchema = z13.object({
13598
13905
  /** Identity string of the agent that produced this record. */
13599
- agentIdentity: z12.string().min(1),
13906
+ agentIdentity: z13.string().min(1),
13600
13907
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
13601
- attachmentSha256: z12.string().length(64),
13908
+ attachmentSha256: z13.string().length(64),
13602
13909
  /** ISO 8601 timestamp at which the action ran. */
13603
- ranAt: z12.string().datetime(),
13910
+ ranAt: z13.string().datetime(),
13604
13911
  /** Wall-clock duration of the action in milliseconds. */
13605
- durationMs: z12.number().nonnegative()
13912
+ durationMs: z13.number().nonnegative()
13606
13913
  });
13607
13914
  var implDiffRecordSchema = evidenceBaseSchema.extend({
13608
- kind: z12.literal("impl-diff"),
13609
- phase: z12.literal("implement"),
13610
- filesChanged: z12.array(z12.string().min(1)).min(1),
13611
- linesAdded: z12.number().int().nonnegative(),
13612
- linesRemoved: z12.number().int().nonnegative()
13915
+ kind: z13.literal("impl-diff"),
13916
+ phase: z13.literal("implement"),
13917
+ filesChanged: z13.array(z13.string().min(1)).min(1),
13918
+ linesAdded: z13.number().int().nonnegative(),
13919
+ linesRemoved: z13.number().int().nonnegative()
13613
13920
  });
13614
13921
  var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
13615
- kind: z12.literal("validate-spec-check"),
13616
- phase: z12.literal("validate"),
13617
- reqIdsChecked: z12.array(z12.string().min(1)).min(1),
13618
- passed: z12.boolean(),
13619
- details: z12.string().min(1)
13922
+ kind: z13.literal("validate-spec-check"),
13923
+ phase: z13.literal("validate"),
13924
+ reqIdsChecked: z13.array(z13.string().min(1)).min(1),
13925
+ passed: z13.boolean(),
13926
+ details: z13.string().min(1)
13620
13927
  });
13621
13928
  var testOutputRecordSchema = evidenceBaseSchema.extend({
13622
- kind: z12.literal("test-output"),
13623
- phase: z12.literal("test"),
13624
- command: z12.string().min(1),
13625
- exitCode: z12.number().int(),
13626
- testsPassed: z12.number().int().nonnegative(),
13627
- testsFailed: z12.number().int().nonnegative()
13929
+ kind: z13.literal("test-output"),
13930
+ phase: z13.literal("test"),
13931
+ command: z13.string().min(1),
13932
+ exitCode: z13.number().int(),
13933
+ testsPassed: z13.number().int().nonnegative(),
13934
+ testsFailed: z13.number().int().nonnegative()
13628
13935
  });
13629
13936
  var lintReportRecordSchema = evidenceBaseSchema.extend({
13630
- kind: z12.literal("lint-report"),
13631
- phase: z12.enum(["implement", "test"]),
13632
- tool: z12.string().min(1),
13633
- passed: z12.boolean(),
13634
- warnings: z12.number().int().nonnegative(),
13635
- errors: z12.number().int().nonnegative()
13937
+ kind: z13.literal("lint-report"),
13938
+ phase: z13.enum(["implement", "test"]),
13939
+ tool: z13.string().min(1),
13940
+ passed: z13.boolean(),
13941
+ warnings: z13.number().int().nonnegative(),
13942
+ errors: z13.number().int().nonnegative()
13636
13943
  });
13637
13944
  var commandOutputRecordSchema = evidenceBaseSchema.extend({
13638
- kind: z12.literal("command-output"),
13639
- phase: z12.enum(["implement", "validate", "test"]),
13640
- cmd: z12.string().min(1),
13641
- exitCode: z12.number().int()
13945
+ kind: z13.literal("command-output"),
13946
+ phase: z13.enum(["implement", "validate", "test"]),
13947
+ cmd: z13.string().min(1),
13948
+ exitCode: z13.number().int()
13642
13949
  });
13643
- var evidenceRecordSchema = z12.discriminatedUnion("kind", [
13950
+ var evidenceRecordSchema = z13.discriminatedUnion("kind", [
13644
13951
  implDiffRecordSchema,
13645
13952
  validateSpecCheckRecordSchema,
13646
13953
  testOutputRecordSchema,
@@ -14575,107 +14882,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
14575
14882
  });
14576
14883
 
14577
14884
  // packages/contracts/src/lease-ipc/messages.ts
14578
- import { z as z13 } from "zod";
14579
- var LeaseScopeSchema = z13.enum(["project", "global"]);
14580
- var LeaseLaneSchema = z13.enum(["tasks", "brain", "bulk"]);
14581
- var LeaseAcquireRequestSchema = z13.object({
14885
+ import { z as z14 } from "zod";
14886
+ var LeaseScopeSchema = z14.enum(["project", "global"]);
14887
+ var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
14888
+ var LeaseAcquireRequestSchema = z14.object({
14582
14889
  /** Tag discriminating this request variant. */
14583
- kind: z13.literal("lease_acquire"),
14890
+ kind: z14.literal("lease_acquire"),
14584
14891
  /** The cleo.db scope being arbitrated. */
14585
14892
  scope: LeaseScopeSchema,
14586
14893
  /** The write lane within the scope. */
14587
14894
  lane: LeaseLaneSchema,
14588
14895
  /** Process+lane holder identity. */
14589
- holder_id: z13.string().min(1),
14896
+ holder_id: z14.string().min(1),
14590
14897
  /** Advisory priority — lower acquires sooner. `0` = highest. */
14591
- priority: z13.number().int().min(0).max(255),
14898
+ priority: z14.number().int().min(0).max(255),
14592
14899
  /** Lease time-to-live in milliseconds. */
14593
- ttl_ms: z13.number().int().nonnegative(),
14900
+ ttl_ms: z14.number().int().nonnegative(),
14594
14901
  /** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
14595
- reentrant: z13.boolean()
14902
+ reentrant: z14.boolean()
14596
14903
  }).strict();
14597
- var LeaseReleaseRequestSchema = z13.object({
14904
+ var LeaseReleaseRequestSchema = z14.object({
14598
14905
  /** Tag discriminating this request variant. */
14599
- kind: z13.literal("lease_release"),
14906
+ kind: z14.literal("lease_release"),
14600
14907
  /** The cleo.db scope being arbitrated. */
14601
14908
  scope: LeaseScopeSchema,
14602
14909
  /** The write lane within the scope. */
14603
14910
  lane: LeaseLaneSchema,
14604
14911
  /** Process+lane holder identity. */
14605
- holder_id: z13.string().min(1),
14912
+ holder_id: z14.string().min(1),
14606
14913
  /** The epoch fence the holder acquired — a stale epoch no-ops. */
14607
- epoch: z13.number().int().nonnegative()
14914
+ epoch: z14.number().int().nonnegative()
14608
14915
  }).strict();
14609
- var LeaseRenewRequestSchema = z13.object({
14916
+ var LeaseRenewRequestSchema = z14.object({
14610
14917
  /** Tag discriminating this request variant. */
14611
- kind: z13.literal("lease_renew"),
14918
+ kind: z14.literal("lease_renew"),
14612
14919
  /** The cleo.db scope being arbitrated. */
14613
14920
  scope: LeaseScopeSchema,
14614
14921
  /** The write lane within the scope. */
14615
14922
  lane: LeaseLaneSchema,
14616
14923
  /** Process+lane holder identity. */
14617
- holder_id: z13.string().min(1),
14924
+ holder_id: z14.string().min(1),
14618
14925
  /** The epoch fence the holder acquired (epoch-guarded renew). */
14619
- epoch: z13.number().int().nonnegative()
14926
+ epoch: z14.number().int().nonnegative()
14620
14927
  }).strict();
14621
- var RateCheckRequestSchema = z13.object({
14928
+ var RateCheckRequestSchema = z14.object({
14622
14929
  /** Tag discriminating this request variant. */
14623
- kind: z13.literal("rate_check"),
14930
+ kind: z14.literal("rate_check"),
14624
14931
  /** The cleo.db scope being checked. */
14625
14932
  scope: LeaseScopeSchema,
14626
14933
  /** The write lane within the scope. */
14627
14934
  lane: LeaseLaneSchema,
14628
14935
  /** Estimated bytes the caller intends to write. */
14629
- est_bytes: z13.number().int().nonnegative()
14936
+ est_bytes: z14.number().int().nonnegative()
14630
14937
  }).strict();
14631
- var ToolGrantRequestSchema = z13.object({
14938
+ var ToolGrantRequestSchema = z14.object({
14632
14939
  /** Tag discriminating this request variant. */
14633
- kind: z13.literal("tool_grant"),
14940
+ kind: z14.literal("tool_grant"),
14634
14941
  /** The tool name being requested. */
14635
- tool: z13.string().min(1),
14942
+ tool: z14.string().min(1),
14636
14943
  /** The requesting holder identity. */
14637
- holder_id: z13.string().min(1)
14944
+ holder_id: z14.string().min(1)
14638
14945
  }).strict();
14639
- var QueuePriorityClassSchema = z13.enum(["lead", "worker", "background"]);
14640
- var QueueAdmitRequestSchema = z13.object({
14946
+ var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
14947
+ var QueueAdmitRequestSchema = z14.object({
14641
14948
  /** Tag discriminating this request variant. */
14642
- kind: z13.literal("queue_admit"),
14949
+ kind: z14.literal("queue_admit"),
14643
14950
  /** The LLM provider id the call targets (rate budget is per-provider). */
14644
- provider: z13.string().min(1),
14951
+ provider: z14.string().min(1),
14645
14952
  /** The caller's priority class (lead > worker > background). */
14646
14953
  priority_class: QueuePriorityClassSchema,
14647
14954
  /** The caller's estimate of the request's token cost (debited on admit). */
14648
- est_tokens: z13.number().int().nonnegative(),
14955
+ est_tokens: z14.number().int().nonnegative(),
14649
14956
  /** The child the call belongs to (in-flight tracking — the watchdog seam). */
14650
- child_id: z13.string().min(1)
14957
+ child_id: z14.string().min(1)
14651
14958
  }).strict();
14652
- var WorkerHeartbeatRequestSchema = z13.object({
14959
+ var WorkerHeartbeatRequestSchema = z14.object({
14653
14960
  /** Tag discriminating this request variant. */
14654
- kind: z13.literal("worker_heartbeat"),
14961
+ kind: z14.literal("worker_heartbeat"),
14655
14962
  /** The logical id of the heartbeating child (matches the registry key). */
14656
- child_id: z13.string().min(1),
14963
+ child_id: z14.string().min(1),
14657
14964
  /** The worker's own view of whether it is currently inside an LLM call. */
14658
- in_flight_llm: z13.boolean()
14965
+ in_flight_llm: z14.boolean()
14659
14966
  }).strict();
14660
- var ResourceAdmitRequestSchema = z13.object({
14967
+ var ResourceAdmitRequestSchema = z14.object({
14661
14968
  /** Tag discriminating this request variant. */
14662
- kind: z13.literal("resource_admit"),
14969
+ kind: z14.literal("resource_admit"),
14663
14970
  /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
14664
- class: z13.string().min(1),
14971
+ class: z14.string().min(1),
14665
14972
  /** The caller holding the slot — process/worktree-unique; the release key. */
14666
- holder_id: z13.string().min(1),
14973
+ holder_id: z14.string().min(1),
14667
14974
  /** The client-computed budget: the max concurrent holders for this class. */
14668
- budget: z13.number().int().nonnegative()
14975
+ budget: z14.number().int().nonnegative()
14669
14976
  }).strict();
14670
- var ResourceReleaseRequestSchema = z13.object({
14977
+ var ResourceReleaseRequestSchema = z14.object({
14671
14978
  /** Tag discriminating this request variant. */
14672
- kind: z13.literal("resource_release"),
14979
+ kind: z14.literal("resource_release"),
14673
14980
  /** The resource class the slot belongs to. */
14674
- class: z13.string().min(1),
14981
+ class: z14.string().min(1),
14675
14982
  /** The holder that was admitted (matches the admit `holder_id`). */
14676
- holder_id: z13.string().min(1)
14983
+ holder_id: z14.string().min(1)
14677
14984
  }).strict();
14678
- var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
14985
+ var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
14679
14986
  LeaseAcquireRequestSchema,
14680
14987
  LeaseReleaseRequestSchema,
14681
14988
  LeaseRenewRequestSchema,
@@ -14686,133 +14993,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
14686
14993
  ResourceAdmitRequestSchema,
14687
14994
  ResourceReleaseRequestSchema
14688
14995
  ]);
14689
- var LeaseGrantedResponseSchema = z13.object({
14996
+ var LeaseGrantedResponseSchema = z14.object({
14690
14997
  /** Tag discriminating this response variant. */
14691
- kind: z13.literal("lease_granted"),
14998
+ kind: z14.literal("lease_granted"),
14692
14999
  /** The granted cleo.db scope. */
14693
15000
  scope: LeaseScopeSchema,
14694
15001
  /** The granted write lane. */
14695
15002
  lane: LeaseLaneSchema,
14696
15003
  /** The holder the lease was granted to. */
14697
- holder_id: z13.string().min(1),
15004
+ holder_id: z14.string().min(1),
14698
15005
  /** The monotonic epoch fence assigned to this grant. */
14699
- epoch: z13.number().int().nonnegative(),
15006
+ epoch: z14.number().int().nonnegative(),
14700
15007
  /** The lease TTL in milliseconds. */
14701
- ttl_ms: z13.number().int().nonnegative(),
15008
+ ttl_ms: z14.number().int().nonnegative(),
14702
15009
  /** Absolute expiry timestamp (epoch ms) for this grant. */
14703
- expires_at_ms: z13.number().int().nonnegative()
15010
+ expires_at_ms: z14.number().int().nonnegative()
14704
15011
  }).strict();
14705
- var LeaseQueuedResponseSchema = z13.object({
15012
+ var LeaseQueuedResponseSchema = z14.object({
14706
15013
  /** Tag discriminating this response variant. */
14707
- kind: z13.literal("lease_queued"),
15014
+ kind: z14.literal("lease_queued"),
14708
15015
  /** The queued cleo.db scope. */
14709
15016
  scope: LeaseScopeSchema,
14710
15017
  /** The queued write lane. */
14711
15018
  lane: LeaseLaneSchema,
14712
15019
  /** The monotonic ticket assigned for FIFO tiebreak. */
14713
- ticket: z13.number().int().nonnegative(),
15020
+ ticket: z14.number().int().nonnegative(),
14714
15021
  /** Number of waiters ahead of this one. */
14715
- ahead: z13.number().int().nonnegative()
15022
+ ahead: z14.number().int().nonnegative()
14716
15023
  }).strict();
14717
- var LeaseDeniedResponseSchema = z13.object({
15024
+ var LeaseDeniedResponseSchema = z14.object({
14718
15025
  /** Tag discriminating this response variant. */
14719
- kind: z13.literal("lease_denied"),
15026
+ kind: z14.literal("lease_denied"),
14720
15027
  /** The denied cleo.db scope. */
14721
15028
  scope: LeaseScopeSchema,
14722
15029
  /** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
14723
- code: z13.string().min(1),
15030
+ code: z14.string().min(1),
14724
15031
  /** Human-readable denial message. */
14725
- message: z13.string()
15032
+ message: z14.string()
14726
15033
  }).strict();
14727
- var RateResultResponseSchema = z13.object({
15034
+ var RateResultResponseSchema = z14.object({
14728
15035
  /** Tag discriminating this response variant. */
14729
- kind: z13.literal("rate_result"),
15036
+ kind: z14.literal("rate_result"),
14730
15037
  /** The checked cleo.db scope. */
14731
15038
  scope: LeaseScopeSchema,
14732
15039
  /** Whether the write is within budget. */
14733
- ok: z13.boolean(),
15040
+ ok: z14.boolean(),
14734
15041
  /** Suggested back-off in milliseconds when `ok` is false. */
14735
- retry_after_ms: z13.number().int().nonnegative(),
15042
+ retry_after_ms: z14.number().int().nonnegative(),
14736
15043
  /** Remaining token budget for the scope. */
14737
- tokens_remaining: z13.number().int().nonnegative()
15044
+ tokens_remaining: z14.number().int().nonnegative()
14738
15045
  }).strict();
14739
- var ToolGrantedResponseSchema = z13.object({
15046
+ var ToolGrantedResponseSchema = z14.object({
14740
15047
  /** Tag discriminating this response variant. */
14741
- kind: z13.literal("tool_granted"),
15048
+ kind: z14.literal("tool_granted"),
14742
15049
  /** The granted tool name. */
14743
- tool: z13.string().min(1),
15050
+ tool: z14.string().min(1),
14744
15051
  /** The holder the tool grant was issued to. */
14745
- holder_id: z13.string().min(1)
15052
+ holder_id: z14.string().min(1)
14746
15053
  }).strict();
14747
- var LeaseRevokedResponseSchema = z13.object({
15054
+ var LeaseRevokedResponseSchema = z14.object({
14748
15055
  /** Tag discriminating this response variant. */
14749
- kind: z13.literal("lease_revoked"),
15056
+ kind: z14.literal("lease_revoked"),
14750
15057
  /** The revoked cleo.db scope. */
14751
15058
  scope: LeaseScopeSchema,
14752
15059
  /** The revoked write lane. */
14753
15060
  lane: LeaseLaneSchema,
14754
15061
  /** The holder whose lease was revoked. */
14755
- holder_id: z13.string().min(1),
15062
+ holder_id: z14.string().min(1),
14756
15063
  /** Human-readable reason for the revocation. */
14757
- reason: z13.string()
15064
+ reason: z14.string()
14758
15065
  }).strict();
14759
- var ChildKilledUnresponsiveResponseSchema = z13.object({
15066
+ var ChildKilledUnresponsiveResponseSchema = z14.object({
14760
15067
  /** Tag discriminating this response variant. */
14761
- kind: z13.literal("child_killed_unresponsive"),
15068
+ kind: z14.literal("child_killed_unresponsive"),
14762
15069
  /** Logical id of the killed child. */
14763
- child_id: z13.string().min(1),
15070
+ child_id: z14.string().min(1),
14764
15071
  /** The holder identity the killed child held the lease as. */
14765
- holder_id: z13.string().min(1),
15072
+ holder_id: z14.string().min(1),
14766
15073
  /** The cleo.db scope the killed child held the lease in. */
14767
15074
  scope: LeaseScopeSchema,
14768
15075
  /** Human-readable reason for the kill. */
14769
- reason: z13.string()
15076
+ reason: z14.string()
14770
15077
  }).strict();
14771
- var QueueAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
14772
- var QueueAdmitResultResponseSchema = z13.object({
15078
+ var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15079
+ var QueueAdmitResultResponseSchema = z14.object({
14773
15080
  /** Tag discriminating this response variant. */
14774
- kind: z13.literal("queue_admit_result"),
15081
+ kind: z14.literal("queue_admit_result"),
14775
15082
  /** Whether the LLM call was admitted or deferred. */
14776
15083
  disposition: QueueAdmitDispositionSchema,
14777
15084
  /** Back-off in ms before re-requesting (0 when admitted). */
14778
- retry_after_ms: z13.number().int().nonnegative(),
15085
+ retry_after_ms: z14.number().int().nonnegative(),
14779
15086
  /** Remaining provider token budget after this decision. */
14780
- tokens_remaining: z13.number().int().nonnegative(),
15087
+ tokens_remaining: z14.number().int().nonnegative(),
14781
15088
  /** Number of higher/equal-priority waiters ahead (0 when admitted). */
14782
- queue_position: z13.number().int().nonnegative()
15089
+ queue_position: z14.number().int().nonnegative()
14783
15090
  }).strict();
14784
- var HeartbeatAckResponseSchema = z13.object({
15091
+ var HeartbeatAckResponseSchema = z14.object({
14785
15092
  /** Tag discriminating this response variant. */
14786
- kind: z13.literal("heartbeat_ack")
15093
+ kind: z14.literal("heartbeat_ack")
14787
15094
  }).strict();
14788
- var ResourceAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
14789
- var ResourceAdmitResultResponseSchema = z13.object({
15095
+ var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15096
+ var ResourceAdmitResultResponseSchema = z14.object({
14790
15097
  /** Tag discriminating this response variant. */
14791
- kind: z13.literal("resource_admit_result"),
15098
+ kind: z14.literal("resource_admit_result"),
14792
15099
  /** Whether the heavy op was admitted or deferred. */
14793
15100
  disposition: ResourceAdmitDispositionSchema,
14794
15101
  /** Back-off in ms before re-requesting (0 when admitted). */
14795
- retry_after_ms: z13.number().int().nonnegative(),
15102
+ retry_after_ms: z14.number().int().nonnegative(),
14796
15103
  /** Remaining slots for the class after this decision. */
14797
- slots_remaining: z13.number().int().nonnegative()
15104
+ slots_remaining: z14.number().int().nonnegative()
14798
15105
  }).strict();
14799
- var ResourceReleaseResultResponseSchema = z13.object({
15106
+ var ResourceReleaseResultResponseSchema = z14.object({
14800
15107
  /** Tag discriminating this response variant. */
14801
- kind: z13.literal("resource_release_result"),
15108
+ kind: z14.literal("resource_release_result"),
14802
15109
  /** Whether a held slot was actually released (false = no such holder). */
14803
- released: z13.boolean(),
15110
+ released: z14.boolean(),
14804
15111
  /** Remaining in-flight holders for the class after the release. */
14805
- slots_remaining: z13.number().int().nonnegative()
15112
+ slots_remaining: z14.number().int().nonnegative()
14806
15113
  }).strict();
14807
- var LeaseErrorResponseSchema = z13.object({
15114
+ var LeaseErrorResponseSchema = z14.object({
14808
15115
  /** Tag discriminating this response variant. */
14809
- kind: z13.literal("error"),
15116
+ kind: z14.literal("error"),
14810
15117
  /** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
14811
- code: z13.string().min(1),
15118
+ code: z14.string().min(1),
14812
15119
  /** Human-readable error message. */
14813
- message: z13.string()
15120
+ message: z14.string()
14814
15121
  }).strict();
14815
- var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15122
+ var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
14816
15123
  LeaseGrantedResponseSchema,
14817
15124
  LeaseQueuedResponseSchema,
14818
15125
  LeaseDeniedResponseSchema,
@@ -14826,27 +15133,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
14826
15133
  ResourceReleaseResultResponseSchema,
14827
15134
  LeaseErrorResponseSchema
14828
15135
  ]);
14829
- var LeaseIpcRequestEnvelopeSchema = z13.object({
15136
+ var LeaseIpcRequestEnvelopeSchema = z14.object({
14830
15137
  /** Parallel protocol version. */
14831
- protocol_version: z13.string(),
15138
+ protocol_version: z14.string(),
14832
15139
  /** Correlation id echoed back on the matching response. */
14833
- id: z13.string().min(1),
15140
+ id: z14.string().min(1),
14834
15141
  /** Direction discriminator. */
14835
- direction: z13.literal("request"),
15142
+ direction: z14.literal("request"),
14836
15143
  /** The request body. */
14837
15144
  request: LeaseIpcRequestSchema
14838
15145
  }).strict();
14839
- var LeaseIpcResponseEnvelopeSchema = z13.object({
15146
+ var LeaseIpcResponseEnvelopeSchema = z14.object({
14840
15147
  /** Parallel protocol version. */
14841
- protocol_version: z13.string(),
15148
+ protocol_version: z14.string(),
14842
15149
  /** Correlation id echoed from the originating request (or a fresh id for events). */
14843
- id: z13.string().min(1),
15150
+ id: z14.string().min(1),
14844
15151
  /** Direction discriminator. */
14845
- direction: z13.literal("response"),
15152
+ direction: z14.literal("response"),
14846
15153
  /** The response body. */
14847
15154
  response: LeaseIpcResponseSchema
14848
15155
  }).strict();
14849
- var LeaseIpcEnvelopeSchema = z13.discriminatedUnion("direction", [
15156
+ var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
14850
15157
  LeaseIpcRequestEnvelopeSchema,
14851
15158
  LeaseIpcResponseEnvelopeSchema
14852
15159
  ]);
@@ -14881,7 +15188,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
14881
15188
  ];
14882
15189
 
14883
15190
  // packages/contracts/src/llm/catalog-schema.ts
14884
- import { z as z14 } from "zod";
15191
+ import { z as z15 } from "zod";
14885
15192
  var CATALOG_MODEL_STATUSES = [
14886
15193
  "stable",
14887
15194
  "beta",
@@ -14890,78 +15197,78 @@ var CATALOG_MODEL_STATUSES = [
14890
15197
  "retired"
14891
15198
  ];
14892
15199
  var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
14893
- var isoDate = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
14894
- var semver = z14.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
14895
- var catalogModalitiesSchema = z14.object({
14896
- input: z14.array(z14.string()),
14897
- output: z14.array(z14.string())
15200
+ var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15201
+ var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15202
+ var catalogModalitiesSchema = z15.object({
15203
+ input: z15.array(z15.string()),
15204
+ output: z15.array(z15.string())
14898
15205
  }).strict();
14899
- var catalogCostSchema = z14.object({
14900
- input: z14.number().optional(),
14901
- output: z14.number().optional(),
14902
- cache_read: z14.number().optional(),
14903
- cache_write: z14.number().optional(),
14904
- context_over_200k: z14.number().optional()
15206
+ var catalogCostSchema = z15.object({
15207
+ input: z15.number().optional(),
15208
+ output: z15.number().optional(),
15209
+ cache_read: z15.number().optional(),
15210
+ cache_write: z15.number().optional(),
15211
+ context_over_200k: z15.number().optional()
14905
15212
  }).strict();
14906
- var catalogLimitSchema = z14.object({
14907
- context: z14.number(),
14908
- output: z14.number()
15213
+ var catalogLimitSchema = z15.object({
15214
+ context: z15.number(),
15215
+ output: z15.number()
14909
15216
  }).strict();
14910
- var catalogModelProviderSchema = z14.object({
14911
- npm: z14.string(),
14912
- api: z14.string()
15217
+ var catalogModelProviderSchema = z15.object({
15218
+ npm: z15.string(),
15219
+ api: z15.string()
14913
15220
  }).strict();
14914
- var catalogModelEntrySchema = z14.object({
14915
- id: z14.string(),
14916
- name: z14.string(),
14917
- family: z14.string(),
14918
- attachment: z14.boolean(),
14919
- reasoning: z14.boolean(),
14920
- temperature: z14.boolean(),
14921
- interleaved: z14.boolean(),
14922
- tool_call: z14.boolean(),
15221
+ var catalogModelEntrySchema = z15.object({
15222
+ id: z15.string(),
15223
+ name: z15.string(),
15224
+ family: z15.string(),
15225
+ attachment: z15.boolean(),
15226
+ reasoning: z15.boolean(),
15227
+ temperature: z15.boolean(),
15228
+ interleaved: z15.boolean(),
15229
+ tool_call: z15.boolean(),
14923
15230
  modalities: catalogModalitiesSchema,
14924
15231
  cost: catalogCostSchema,
14925
15232
  limit: catalogLimitSchema,
14926
- status: z14.enum(CATALOG_MODEL_STATUSES),
15233
+ status: z15.enum(CATALOG_MODEL_STATUSES),
14927
15234
  release_date: isoDate,
14928
15235
  provider: catalogModelProviderSchema
14929
15236
  }).strict();
14930
- var catalogProviderSchema = z14.object({
14931
- id: z14.string(),
14932
- endpoint: z14.string(),
14933
- authTypes: z14.array(z14.enum(CATALOG_AUTH_TYPES)).min(1),
14934
- npm: z14.string().optional()
15237
+ var catalogProviderSchema = z15.object({
15238
+ id: z15.string(),
15239
+ endpoint: z15.string(),
15240
+ authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
15241
+ npm: z15.string().optional()
14935
15242
  }).strict();
14936
- var curatedCatalogSchema = z14.object({
14937
- $schema: z14.string().optional(),
15243
+ var curatedCatalogSchema = z15.object({
15244
+ $schema: z15.string().optional(),
14938
15245
  version: semver,
14939
15246
  lastUpdated: isoDate,
14940
- providers: z14.record(z14.string(), catalogProviderSchema),
14941
- models: z14.record(z14.string(), z14.record(z14.string(), catalogModelEntrySchema))
15247
+ providers: z15.record(z15.string(), catalogProviderSchema),
15248
+ models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
14942
15249
  }).strict();
14943
- var modelsCatalogRowInsertSchema = z14.object({
14944
- id: z14.string(),
14945
- providerId: z14.string(),
14946
- name: z14.string(),
14947
- family: z14.string(),
14948
- attachment: z14.boolean(),
14949
- reasoning: z14.boolean(),
14950
- temperature: z14.boolean(),
14951
- interleaved: z14.boolean(),
14952
- toolCall: z14.boolean(),
14953
- modalities: z14.string(),
14954
- cost: z14.string(),
14955
- contextLimit: z14.number().nullable().optional(),
14956
- outputLimit: z14.number().nullable().optional(),
14957
- status: z14.enum(CATALOG_MODEL_STATUSES),
15250
+ var modelsCatalogRowInsertSchema = z15.object({
15251
+ id: z15.string(),
15252
+ providerId: z15.string(),
15253
+ name: z15.string(),
15254
+ family: z15.string(),
15255
+ attachment: z15.boolean(),
15256
+ reasoning: z15.boolean(),
15257
+ temperature: z15.boolean(),
15258
+ interleaved: z15.boolean(),
15259
+ toolCall: z15.boolean(),
15260
+ modalities: z15.string(),
15261
+ cost: z15.string(),
15262
+ contextLimit: z15.number().nullable().optional(),
15263
+ outputLimit: z15.number().nullable().optional(),
15264
+ status: z15.enum(CATALOG_MODEL_STATUSES),
14958
15265
  releaseDate: isoDate,
14959
- modelsDevId: z14.string(),
14960
- source: z14.string(),
14961
- seededAt: z14.string().optional()
15266
+ modelsDevId: z15.string(),
15267
+ source: z15.string(),
15268
+ seededAt: z15.string().optional()
14962
15269
  }).strict();
14963
15270
  var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
14964
- seededAt: z14.string()
15271
+ seededAt: z15.string()
14965
15272
  });
14966
15273
 
14967
15274
  // packages/contracts/src/llm/system-of-use.ts
@@ -15009,7 +15316,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
15009
15316
  ];
15010
15317
 
15011
15318
  // packages/contracts/src/workgraph.ts
15012
- import { z as z15 } from "zod";
15319
+ import { z as z16 } from "zod";
15013
15320
 
15014
15321
  // packages/contracts/src/status-registry.ts
15015
15322
  var TASK_STATUSES = [
@@ -15024,10 +15331,10 @@ var TASK_STATUSES = [
15024
15331
 
15025
15332
  // packages/contracts/src/workgraph.ts
15026
15333
  var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
15027
- var taskTypeSchema = z15.enum(["saga", "epic", "task", "subtask"]);
15028
- var taskPrioritySchema = z15.enum(["critical", "high", "medium", "low"]);
15029
- var taskStatusSchema = z15.enum(TASK_STATUSES);
15030
- var verificationGateSchema = z15.enum([
15334
+ var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
15335
+ var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
15336
+ var taskStatusSchema = z16.enum(TASK_STATUSES);
15337
+ var verificationGateSchema = z16.enum([
15031
15338
  "implemented",
15032
15339
  "testsPassed",
15033
15340
  "qaPassed",
@@ -15036,7 +15343,7 @@ var verificationGateSchema = z15.enum([
15036
15343
  "documented",
15037
15344
  "nexusImpact"
15038
15345
  ]);
15039
- var workGraphRelationKindSchema = z15.enum([
15346
+ var workGraphRelationKindSchema = z16.enum([
15040
15347
  "contains",
15041
15348
  "depends_on",
15042
15349
  "blocks",
@@ -15044,317 +15351,317 @@ var workGraphRelationKindSchema = z15.enum([
15044
15351
  "groups",
15045
15352
  "satisfies"
15046
15353
  ]);
15047
- var workGraphTraversalDirectionSchema = z15.enum([
15354
+ var workGraphTraversalDirectionSchema = z16.enum([
15048
15355
  "ancestors",
15049
15356
  "descendants",
15050
15357
  "upstream",
15051
15358
  "downstream"
15052
15359
  ]);
15053
- var workGraphEdgeDirectionSchema = z15.enum(["out", "in", "both"]);
15054
- var paginationParamsSchema = z15.object({
15055
- cursor: z15.string().min(1).optional(),
15056
- limit: z15.number().int().positive().max(500).optional()
15360
+ var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
15361
+ var paginationParamsSchema = z16.object({
15362
+ cursor: z16.string().min(1).optional(),
15363
+ limit: z16.number().int().positive().max(500).optional()
15057
15364
  });
15058
- var workGraphNodeSchema = z15.object({
15059
- id: z15.string().min(1),
15365
+ var workGraphNodeSchema = z16.object({
15366
+ id: z16.string().min(1),
15060
15367
  type: taskTypeSchema,
15061
- title: z15.string(),
15368
+ title: z16.string(),
15062
15369
  status: taskStatusSchema,
15063
15370
  priority: taskPrioritySchema,
15064
- parentId: z15.string().min(1).optional()
15371
+ parentId: z16.string().min(1).optional()
15065
15372
  });
15066
- var workGraphEdgeSchema = z15.object({
15067
- fromId: z15.string().min(1),
15068
- toId: z15.string().min(1),
15373
+ var workGraphEdgeSchema = z16.object({
15374
+ fromId: z16.string().min(1),
15375
+ toId: z16.string().min(1),
15069
15376
  kind: workGraphRelationKindSchema
15070
15377
  });
15071
- var workGraphHierarchyEdgeSchema = z15.object({
15072
- fromId: z15.string().min(1),
15073
- toId: z15.string().min(1),
15074
- kind: z15.literal("contains")
15378
+ var workGraphHierarchyEdgeSchema = z16.object({
15379
+ fromId: z16.string().min(1),
15380
+ toId: z16.string().min(1),
15381
+ kind: z16.literal("contains")
15075
15382
  }).strict();
15076
- var workGraphPageInfoSchema = z15.object({
15077
- nextCursor: z15.string().min(1).optional(),
15078
- hasMore: z15.boolean()
15383
+ var workGraphPageInfoSchema = z16.object({
15384
+ nextCursor: z16.string().min(1).optional(),
15385
+ hasMore: z16.boolean()
15079
15386
  });
15080
- var workGraphRollupCountsSchema = z15.object({
15081
- total: z15.number().int().nonnegative(),
15082
- byStatus: z15.partialRecord(taskStatusSchema, z15.number().int().nonnegative()),
15083
- byType: z15.partialRecord(taskTypeSchema, z15.number().int().nonnegative())
15387
+ var workGraphRollupCountsSchema = z16.object({
15388
+ total: z16.number().int().nonnegative(),
15389
+ byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
15390
+ byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
15084
15391
  });
15085
- var workGraphSubtreePercentagesSchema = z15.object({
15086
- done: z15.number().nonnegative(),
15087
- active: z15.number().nonnegative(),
15088
- blocked: z15.number().nonnegative(),
15089
- pending: z15.number().nonnegative(),
15090
- cancelled: z15.number().nonnegative()
15392
+ var workGraphSubtreePercentagesSchema = z16.object({
15393
+ done: z16.number().nonnegative(),
15394
+ active: z16.number().nonnegative(),
15395
+ blocked: z16.number().nonnegative(),
15396
+ pending: z16.number().nonnegative(),
15397
+ cancelled: z16.number().nonnegative()
15091
15398
  });
15092
- var workGraphProjectionMismatchSchema = z15.object({
15093
- field: z15.string().min(1),
15094
- expected: z15.number().int().nonnegative(),
15095
- actual: z15.number().int().nonnegative()
15399
+ var workGraphProjectionMismatchSchema = z16.object({
15400
+ field: z16.string().min(1),
15401
+ expected: z16.number().int().nonnegative(),
15402
+ actual: z16.number().int().nonnegative()
15096
15403
  });
15097
15404
  var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
15098
- role: z15.string().min(1).optional(),
15099
- dependencyBlockers: z15.array(z15.object({ taskId: z15.string().min(1), status: taskStatusSchema })),
15100
- gateBlockers: z15.array(z15.object({ gate: verificationGateSchema }))
15405
+ role: z16.string().min(1).optional(),
15406
+ dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
15407
+ gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
15101
15408
  });
15102
15409
  var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
15103
- source: z15.literal("relation"),
15104
- relationType: z15.enum(TASK_RELATION_TYPES),
15105
- reason: z15.string().min(1).optional()
15410
+ source: z16.literal("relation"),
15411
+ relationType: z16.enum(TASK_RELATION_TYPES),
15412
+ reason: z16.string().min(1).optional()
15106
15413
  });
15107
15414
  var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
15108
- source: z15.literal("dependency"),
15109
- kind: z15.literal("depends_on")
15415
+ source: z16.literal("dependency"),
15416
+ kind: z16.literal("depends_on")
15110
15417
  });
15111
- var workGraphOmissionReasonSchema = z15.enum([
15418
+ var workGraphOmissionReasonSchema = z16.enum([
15112
15419
  "budget_exceeded",
15113
15420
  "not_requested",
15114
15421
  "not_available",
15115
15422
  "redacted",
15116
15423
  "truncated"
15117
15424
  ]);
15118
- var workGraphContextBudgetSchema = z15.object({
15119
- tokenBudget: z15.number().int().nonnegative(),
15120
- estimatedTokens: z15.number().int().nonnegative(),
15121
- remainingTokens: z15.number().int().nonnegative(),
15122
- truncated: z15.boolean()
15425
+ var workGraphContextBudgetSchema = z16.object({
15426
+ tokenBudget: z16.number().int().nonnegative(),
15427
+ estimatedTokens: z16.number().int().nonnegative(),
15428
+ remainingTokens: z16.number().int().nonnegative(),
15429
+ truncated: z16.boolean()
15123
15430
  });
15124
- var workGraphOmissionSchema = z15.object({
15125
- path: z15.string().min(1),
15431
+ var workGraphOmissionSchema = z16.object({
15432
+ path: z16.string().min(1),
15126
15433
  reason: workGraphOmissionReasonSchema,
15127
- message: z15.string().min(1),
15128
- estimatedTokens: z15.number().int().nonnegative().optional()
15434
+ message: z16.string().min(1),
15435
+ estimatedTokens: z16.number().int().nonnegative().optional()
15129
15436
  });
15130
- var workGraphDirectEdgeSchema = z15.discriminatedUnion("source", [
15437
+ var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
15131
15438
  workGraphRelationEdgeSchema,
15132
15439
  workGraphDependencyEdgeSchema
15133
15440
  ]);
15134
15441
  var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
15135
- rootId: z15.string().min(1),
15136
- tokenBudget: z15.number().int().positive().optional(),
15137
- includeRelations: z15.boolean().optional(),
15138
- includeReadiness: z15.boolean().optional(),
15139
- includeRollup: z15.boolean().optional()
15442
+ rootId: z16.string().min(1),
15443
+ tokenBudget: z16.number().int().positive().optional(),
15444
+ includeRelations: z16.boolean().optional(),
15445
+ includeReadiness: z16.boolean().optional(),
15446
+ includeRollup: z16.boolean().optional()
15140
15447
  });
15141
15448
  var workGraphSliceParamsSchema = paginationParamsSchema.extend({
15142
- rootId: z15.string().min(1),
15449
+ rootId: z16.string().min(1),
15143
15450
  direction: workGraphTraversalDirectionSchema.optional(),
15144
- maxDepth: z15.number().int().nonnegative().optional(),
15145
- includeRelations: z15.boolean().optional()
15451
+ maxDepth: z16.number().int().nonnegative().optional(),
15452
+ includeRelations: z16.boolean().optional()
15146
15453
  });
15147
- var workGraphSliceSchema = z15.object({
15148
- rootId: z15.string().min(1),
15454
+ var workGraphSliceSchema = z16.object({
15455
+ rootId: z16.string().min(1),
15149
15456
  direction: workGraphTraversalDirectionSchema,
15150
- nodes: z15.array(workGraphNodeSchema),
15151
- edges: z15.array(workGraphEdgeSchema),
15457
+ nodes: z16.array(workGraphNodeSchema),
15458
+ edges: z16.array(workGraphEdgeSchema),
15152
15459
  pageInfo: workGraphPageInfoSchema,
15153
- omissions: z15.array(workGraphOmissionSchema).optional()
15460
+ omissions: z16.array(workGraphOmissionSchema).optional()
15154
15461
  });
15155
- var workGraphReadinessParamsSchema = z15.object({
15156
- rootId: z15.string().min(1),
15157
- role: z15.string().min(1).optional(),
15158
- includeGateBlockers: z15.boolean().optional()
15462
+ var workGraphReadinessParamsSchema = z16.object({
15463
+ rootId: z16.string().min(1),
15464
+ role: z16.string().min(1).optional(),
15465
+ includeGateBlockers: z16.boolean().optional()
15159
15466
  });
15160
- var workGraphReadinessResultSchema = z15.object({
15161
- rootId: z15.string().min(1),
15162
- role: z15.string().min(1).optional(),
15163
- ready: z15.boolean(),
15164
- warnings: z15.array(z15.string()),
15165
- groups: z15.object({
15166
- ready: z15.array(workGraphReadyFrontierTaskSchema),
15167
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
15168
- blockedBy: z15.array(
15169
- z15.discriminatedUnion("kind", [
15170
- z15.object({
15171
- kind: z15.literal("dependency"),
15172
- blockerId: z15.string().min(1),
15173
- blocks: z15.array(z15.string().min(1))
15467
+ var workGraphReadinessResultSchema = z16.object({
15468
+ rootId: z16.string().min(1),
15469
+ role: z16.string().min(1).optional(),
15470
+ ready: z16.boolean(),
15471
+ warnings: z16.array(z16.string()),
15472
+ groups: z16.object({
15473
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
15474
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
15475
+ blockedBy: z16.array(
15476
+ z16.discriminatedUnion("kind", [
15477
+ z16.object({
15478
+ kind: z16.literal("dependency"),
15479
+ blockerId: z16.string().min(1),
15480
+ blocks: z16.array(z16.string().min(1))
15174
15481
  }),
15175
- z15.object({
15176
- kind: z15.literal("gate"),
15482
+ z16.object({
15483
+ kind: z16.literal("gate"),
15177
15484
  gate: verificationGateSchema,
15178
- blocks: z15.array(z15.string().min(1))
15485
+ blocks: z16.array(z16.string().min(1))
15179
15486
  })
15180
15487
  ])
15181
15488
  )
15182
15489
  })
15183
15490
  });
15184
- var workGraphContextPackSchema = z15.object({
15185
- rootId: z15.string().min(1),
15186
- generatedAt: z15.string().min(1),
15491
+ var workGraphContextPackSchema = z16.object({
15492
+ rootId: z16.string().min(1),
15493
+ generatedAt: z16.string().min(1),
15187
15494
  budget: workGraphContextBudgetSchema,
15188
15495
  slice: workGraphSliceSchema,
15189
- relationEdges: z15.object({
15190
- rootId: z15.string().min(1),
15496
+ relationEdges: z16.object({
15497
+ rootId: z16.string().min(1),
15191
15498
  direction: workGraphEdgeDirectionSchema,
15192
- edges: z15.array(workGraphDirectEdgeSchema)
15499
+ edges: z16.array(workGraphDirectEdgeSchema)
15193
15500
  }).optional(),
15194
15501
  readiness: workGraphReadinessResultSchema.optional(),
15195
- rollup: z15.lazy(() => tasksRollupResultSchema).optional(),
15196
- omissions: z15.array(workGraphOmissionSchema)
15502
+ rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
15503
+ omissions: z16.array(workGraphOmissionSchema)
15197
15504
  });
15198
- var workGraphScaffoldValidateParamsSchema = z15.object({
15199
- rootId: z15.string().min(1),
15200
- nodes: z15.array(
15201
- z15.object({
15202
- id: z15.string().min(1),
15505
+ var workGraphScaffoldValidateParamsSchema = z16.object({
15506
+ rootId: z16.string().min(1),
15507
+ nodes: z16.array(
15508
+ z16.object({
15509
+ id: z16.string().min(1),
15203
15510
  type: taskTypeSchema,
15204
- parentId: z15.string().min(1).nullable().optional()
15511
+ parentId: z16.string().min(1).nullable().optional()
15205
15512
  })
15206
15513
  ),
15207
- edges: z15.array(workGraphDirectEdgeSchema).optional(),
15208
- dryRun: z15.boolean().optional()
15514
+ edges: z16.array(workGraphDirectEdgeSchema).optional(),
15515
+ dryRun: z16.boolean().optional()
15209
15516
  });
15210
- var workGraphScaffoldValidationIssueSchema = z15.object({
15211
- code: z15.string().min(1),
15212
- message: z15.string().min(1),
15213
- taskId: z15.string().min(1).optional(),
15214
- severity: z15.enum(["error", "warning"])
15517
+ var workGraphScaffoldValidationIssueSchema = z16.object({
15518
+ code: z16.string().min(1),
15519
+ message: z16.string().min(1),
15520
+ taskId: z16.string().min(1).optional(),
15521
+ severity: z16.enum(["error", "warning"])
15215
15522
  });
15216
- var workGraphScaffoldValidateResultSchema = z15.object({
15217
- rootId: z15.string().min(1),
15218
- valid: z15.boolean(),
15219
- dryRun: z15.boolean(),
15220
- issues: z15.array(workGraphScaffoldValidationIssueSchema),
15221
- hierarchy: z15.object({
15222
- valid: z15.boolean(),
15223
- violations: z15.array(
15224
- z15.object({
15225
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15226
- taskId: z15.string().min(1),
15523
+ var workGraphScaffoldValidateResultSchema = z16.object({
15524
+ rootId: z16.string().min(1),
15525
+ valid: z16.boolean(),
15526
+ dryRun: z16.boolean(),
15527
+ issues: z16.array(workGraphScaffoldValidationIssueSchema),
15528
+ hierarchy: z16.object({
15529
+ valid: z16.boolean(),
15530
+ violations: z16.array(
15531
+ z16.object({
15532
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15533
+ taskId: z16.string().min(1),
15227
15534
  taskType: taskTypeSchema,
15228
- parentId: z15.string().min(1).nullable(),
15535
+ parentId: z16.string().min(1).nullable(),
15229
15536
  parentType: taskTypeSchema.optional(),
15230
- message: z15.string().min(1)
15537
+ message: z16.string().min(1)
15231
15538
  })
15232
15539
  )
15233
15540
  })
15234
15541
  });
15235
15542
  var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
15236
- apply: z15.boolean().optional()
15543
+ apply: z16.boolean().optional()
15237
15544
  });
15238
15545
  var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
15239
- applied: z15.boolean(),
15240
- nodesChanged: z15.number().int().nonnegative(),
15241
- edgesChanged: z15.number().int().nonnegative()
15546
+ applied: z16.boolean(),
15547
+ nodesChanged: z16.number().int().nonnegative(),
15548
+ edgesChanged: z16.number().int().nonnegative()
15242
15549
  });
15243
- var workGraphPlanningDocParamsSchema = z15.object({
15244
- rootId: z15.string().min(1),
15245
- audience: z15.enum(["agent", "maintainer"]),
15246
- tokenBudget: z15.number().int().positive().optional(),
15247
- includeRelations: z15.boolean().optional(),
15248
- includeReadiness: z15.boolean().optional(),
15249
- includeRollup: z15.boolean().optional()
15550
+ var workGraphPlanningDocParamsSchema = z16.object({
15551
+ rootId: z16.string().min(1),
15552
+ audience: z16.enum(["agent", "maintainer"]),
15553
+ tokenBudget: z16.number().int().positive().optional(),
15554
+ includeRelations: z16.boolean().optional(),
15555
+ includeReadiness: z16.boolean().optional(),
15556
+ includeRollup: z16.boolean().optional()
15250
15557
  });
15251
- var workGraphPlanningDocSchema = z15.object({
15252
- rootId: z15.string().min(1),
15253
- generatedAt: z15.string().min(1),
15254
- audience: z15.enum(["agent", "maintainer"]),
15255
- title: z15.string().min(1),
15256
- content: z15.string(),
15257
- sections: z15.array(z15.string().min(1)),
15258
- estimatedTokens: z15.number().int().nonnegative(),
15259
- budget: z15.object({
15260
- tokenBudget: z15.number().int().positive(),
15261
- truncated: z15.boolean()
15558
+ var workGraphPlanningDocSchema = z16.object({
15559
+ rootId: z16.string().min(1),
15560
+ generatedAt: z16.string().min(1),
15561
+ audience: z16.enum(["agent", "maintainer"]),
15562
+ title: z16.string().min(1),
15563
+ content: z16.string(),
15564
+ sections: z16.array(z16.string().min(1)),
15565
+ estimatedTokens: z16.number().int().nonnegative(),
15566
+ budget: z16.object({
15567
+ tokenBudget: z16.number().int().positive(),
15568
+ truncated: z16.boolean()
15262
15569
  }).optional()
15263
15570
  });
15264
15571
  var tasksTraverseParamsSchema = paginationParamsSchema.extend({
15265
- rootId: z15.string().min(1),
15572
+ rootId: z16.string().min(1),
15266
15573
  direction: workGraphTraversalDirectionSchema,
15267
- maxDepth: z15.number().int().nonnegative().optional(),
15268
- includeRelations: z15.boolean().optional()
15574
+ maxDepth: z16.number().int().nonnegative().optional(),
15575
+ includeRelations: z16.boolean().optional()
15269
15576
  });
15270
- var tasksTraverseResultSchema = z15.object({
15271
- rootId: z15.string().min(1),
15577
+ var tasksTraverseResultSchema = z16.object({
15578
+ rootId: z16.string().min(1),
15272
15579
  direction: workGraphTraversalDirectionSchema,
15273
- nodes: z15.array(workGraphNodeSchema),
15274
- edges: z15.array(workGraphEdgeSchema),
15580
+ nodes: z16.array(workGraphNodeSchema),
15581
+ edges: z16.array(workGraphEdgeSchema),
15275
15582
  pageInfo: workGraphPageInfoSchema
15276
15583
  });
15277
15584
  var tasksTreeParamsSchema = paginationParamsSchema.extend({
15278
- rootId: z15.string().min(1),
15279
- maxDepth: z15.number().int().nonnegative().optional()
15585
+ rootId: z16.string().min(1),
15586
+ maxDepth: z16.number().int().nonnegative().optional()
15280
15587
  });
15281
- var tasksTreeResultSchema = z15.object({
15282
- rootId: z15.string().min(1),
15283
- nodes: z15.array(workGraphNodeSchema.extend({ depth: z15.number().int().positive() })),
15284
- edges: z15.array(workGraphHierarchyEdgeSchema),
15588
+ var tasksTreeResultSchema = z16.object({
15589
+ rootId: z16.string().min(1),
15590
+ nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
15591
+ edges: z16.array(workGraphHierarchyEdgeSchema),
15285
15592
  pageInfo: workGraphPageInfoSchema
15286
15593
  });
15287
- var tasksRollupParamsSchema = z15.object({
15288
- rootId: z15.string().min(1),
15594
+ var tasksRollupParamsSchema = z16.object({
15595
+ rootId: z16.string().min(1),
15289
15596
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
15290
15597
  });
15291
- var tasksRollupResultSchema = z15.object({
15292
- rootId: z15.string().min(1),
15598
+ var tasksRollupResultSchema = z16.object({
15599
+ rootId: z16.string().min(1),
15293
15600
  direct: workGraphRollupCountsSchema,
15294
15601
  subtree: workGraphRollupCountsSchema,
15295
- percentDenominator: z15.object({
15296
- basis: z15.literal("subtree-total"),
15297
- total: z15.number().int().nonnegative(),
15298
- description: z15.string().min(1)
15602
+ percentDenominator: z16.object({
15603
+ basis: z16.literal("subtree-total"),
15604
+ total: z16.number().int().nonnegative(),
15605
+ description: z16.string().min(1)
15299
15606
  }),
15300
15607
  percentages: workGraphSubtreePercentagesSchema,
15301
- staleProjection: z15.boolean(),
15302
- projectionMismatches: z15.array(workGraphProjectionMismatchSchema)
15608
+ staleProjection: z16.boolean(),
15609
+ projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
15303
15610
  });
15304
- var tasksFrontierParamsSchema = z15.object({
15305
- rootId: z15.string().min(1),
15306
- role: z15.string().min(1).optional()
15611
+ var tasksFrontierParamsSchema = z16.object({
15612
+ rootId: z16.string().min(1),
15613
+ role: z16.string().min(1).optional()
15307
15614
  });
15308
- var tasksFrontierResultSchema = z15.object({
15309
- rootId: z15.string().min(1),
15310
- role: z15.string().min(1).optional(),
15311
- groups: z15.object({
15312
- ready: z15.array(workGraphReadyFrontierTaskSchema),
15313
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
15314
- blockedBy: z15.array(
15315
- z15.discriminatedUnion("kind", [
15316
- z15.object({
15317
- kind: z15.literal("dependency"),
15318
- blockerId: z15.string().min(1),
15319
- blocks: z15.array(z15.string().min(1))
15615
+ var tasksFrontierResultSchema = z16.object({
15616
+ rootId: z16.string().min(1),
15617
+ role: z16.string().min(1).optional(),
15618
+ groups: z16.object({
15619
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
15620
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
15621
+ blockedBy: z16.array(
15622
+ z16.discriminatedUnion("kind", [
15623
+ z16.object({
15624
+ kind: z16.literal("dependency"),
15625
+ blockerId: z16.string().min(1),
15626
+ blocks: z16.array(z16.string().min(1))
15320
15627
  }),
15321
- z15.object({
15322
- kind: z15.literal("gate"),
15628
+ z16.object({
15629
+ kind: z16.literal("gate"),
15323
15630
  gate: verificationGateSchema,
15324
- blocks: z15.array(z15.string().min(1))
15631
+ blocks: z16.array(z16.string().min(1))
15325
15632
  })
15326
15633
  ])
15327
15634
  )
15328
15635
  })
15329
15636
  });
15330
15637
  var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
15331
- rootId: z15.string().min(1),
15332
- maxDepth: z15.number().int().nonnegative().optional(),
15333
- includeRelations: z15.boolean().optional()
15638
+ rootId: z16.string().min(1),
15639
+ maxDepth: z16.number().int().nonnegative().optional(),
15640
+ includeRelations: z16.boolean().optional()
15334
15641
  });
15335
- var tasksWorkGraphAuditResultSchema = z15.object({
15336
- rootId: z15.string().min(1),
15337
- hierarchy: z15.object({
15338
- valid: z15.boolean(),
15339
- violations: z15.array(
15340
- z15.object({
15341
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15342
- taskId: z15.string().min(1),
15642
+ var tasksWorkGraphAuditResultSchema = z16.object({
15643
+ rootId: z16.string().min(1),
15644
+ hierarchy: z16.object({
15645
+ valid: z16.boolean(),
15646
+ violations: z16.array(
15647
+ z16.object({
15648
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15649
+ taskId: z16.string().min(1),
15343
15650
  taskType: taskTypeSchema,
15344
- parentId: z15.string().min(1).nullable(),
15651
+ parentId: z16.string().min(1).nullable(),
15345
15652
  parentType: taskTypeSchema.optional(),
15346
- message: z15.string().min(1)
15653
+ message: z16.string().min(1)
15347
15654
  })
15348
15655
  )
15349
15656
  }),
15350
15657
  traversal: tasksTraverseResultSchema,
15351
15658
  frontier: tasksFrontierResultSchema,
15352
15659
  rollup: tasksRollupResultSchema,
15353
- relationEdges: z15.object({
15354
- rootId: z15.string().min(1),
15660
+ relationEdges: z16.object({
15661
+ rootId: z16.string().min(1),
15355
15662
  direction: workGraphEdgeDirectionSchema,
15356
- edges: z15.array(
15357
- z15.discriminatedUnion("source", [
15663
+ edges: z16.array(
15664
+ z16.discriminatedUnion("source", [
15358
15665
  workGraphRelationEdgeSchema,
15359
15666
  workGraphDependencyEdgeSchema
15360
15667
  ])
@@ -15363,60 +15670,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
15363
15670
  });
15364
15671
 
15365
15672
  // packages/contracts/src/operations/docs.ts
15366
- import { z as z16 } from "zod";
15367
- var DOCS_PROJECTION_PROPOSAL_SCHEMA = z16.object({
15368
- version: z16.literal(1),
15369
- operation: z16.literal("docs.projection"),
15370
- identity: z16.object({
15371
- projectId: z16.string().min(1),
15372
- projectRoot: z16.string().min(1),
15373
- actor: z16.string().min(1),
15374
- operation: z16.literal("docs.projection"),
15375
- idempotencyKey: z16.string().min(1)
15673
+ import { z as z17 } from "zod";
15674
+ var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
15675
+ version: z17.literal(1),
15676
+ operation: z17.literal("docs.projection"),
15677
+ identity: z17.object({
15678
+ projectId: z17.string().min(1),
15679
+ projectRoot: z17.string().min(1),
15680
+ actor: z17.string().min(1),
15681
+ operation: z17.literal("docs.projection"),
15682
+ idempotencyKey: z17.string().min(1)
15376
15683
  }).strict(),
15377
- source: z16.object({
15378
- attachmentId: z16.string().min(1),
15379
- sha256: z16.string().regex(/^[a-f0-9]{64}$/),
15380
- ownerId: z16.string().min(1),
15381
- ownerType: z16.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
15382
- label: z16.string().min(1)
15684
+ source: z17.object({
15685
+ attachmentId: z17.string().min(1),
15686
+ sha256: z17.string().regex(/^[a-f0-9]{64}$/),
15687
+ ownerId: z17.string().min(1),
15688
+ ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
15689
+ label: z17.string().min(1)
15383
15690
  }).strict(),
15384
- observation: z16.object({
15385
- kind: z16.literal("doc-attachment"),
15386
- attachmentId: z16.string().min(1),
15387
- ownerId: z16.string().min(1),
15388
- addedAt: z16.string().min(1),
15389
- slug: z16.string().optional(),
15390
- type: z16.string().optional()
15691
+ observation: z17.object({
15692
+ kind: z17.literal("doc-attachment"),
15693
+ attachmentId: z17.string().min(1),
15694
+ ownerId: z17.string().min(1),
15695
+ addedAt: z17.string().min(1),
15696
+ slug: z17.string().optional(),
15697
+ type: z17.string().optional()
15391
15698
  }).strict()
15392
15699
  }).strict();
15393
- var DOCS_PROJECTION_RECEIPT_SCHEMA = z16.object({
15394
- version: z16.literal(1),
15395
- sourceHash: z16.string().regex(/^[a-f0-9]{64}$/),
15396
- graph: z16.enum(["completed", "disabled"]),
15700
+ var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
15701
+ version: z17.literal(1),
15702
+ sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
15703
+ graph: z17.enum(["completed", "disabled"]),
15397
15704
  /** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
15398
- observationId: z16.string().min(1).optional(),
15705
+ observationId: z17.string().min(1).optional(),
15399
15706
  /** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
15400
- documents: z16.literal(true).optional(),
15401
- verifiedAt: z16.string().min(1),
15402
- actor: z16.string().min(1)
15707
+ documents: z17.literal(true).optional(),
15708
+ verifiedAt: z17.string().min(1),
15709
+ actor: z17.string().min(1)
15403
15710
  }).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
15404
15711
  message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
15405
15712
  });
15406
15713
 
15407
15714
  // packages/contracts/src/operations/ensures-schema-registry.ts
15408
- import { z as z17 } from "zod";
15409
- var taskTreeEntrySchema = z17.object({
15410
- 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" }),
15411
- 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), {
15715
+ import { z as z18 } from "zod";
15716
+ var taskTreeEntrySchema = z18.object({
15717
+ 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" }),
15718
+ 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), {
15412
15719
  message: "acceptance array contains no non-empty strings"
15413
15720
  }),
15414
- id: z17.string().optional(),
15415
- parentId: z17.string().optional(),
15416
- depends: z17.array(z17.string()).optional()
15721
+ id: z18.string().optional(),
15722
+ parentId: z18.string().optional(),
15723
+ depends: z18.array(z18.string()).optional()
15417
15724
  });
15418
- 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" });
15419
- var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
15725
+ 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" });
15726
+ var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
15420
15727
  if (value === null || value === void 0) {
15421
15728
  ctx.addIssue({
15422
15729
  code: "custom",
@@ -15450,7 +15757,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
15450
15757
  message: `evidence must be a string, array, or object (got ${typeof value})`
15451
15758
  });
15452
15759
  });
15453
- var passthroughSchema = z17.unknown();
15760
+ var passthroughSchema = z18.unknown();
15454
15761
  var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
15455
15762
  // release.cantbook
15456
15763
  "version_bump_report",
@@ -15483,44 +15790,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
15483
15790
  var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
15484
15791
 
15485
15792
  // packages/contracts/src/release/evidence-atoms.ts
15486
- import { z as z18 } from "zod";
15487
- var parsedPrEvidenceAtomSchema = z18.object({
15488
- kind: z18.literal("pr"),
15489
- prNumber: z18.number().int().positive()
15793
+ import { z as z19 } from "zod";
15794
+ var parsedPrEvidenceAtomSchema = z19.object({
15795
+ kind: z19.literal("pr"),
15796
+ prNumber: z19.number().int().positive()
15490
15797
  });
15491
- var prEvidenceStateModifierSchema = z18.object({
15492
- kind: z18.literal("state"),
15493
- value: z18.literal("MERGED")
15798
+ var prEvidenceStateModifierSchema = z19.object({
15799
+ kind: z19.literal("state"),
15800
+ value: z19.literal("MERGED")
15494
15801
  });
15495
- var ghPrViewSchema = z18.object({
15496
- state: z18.enum(["OPEN", "CLOSED", "MERGED"]),
15497
- mergedAt: z18.string().nullable(),
15498
- headRefOid: z18.string().optional(),
15499
- mergeCommit: z18.object({ oid: z18.string() }).nullable().optional(),
15500
- title: z18.string().optional(),
15501
- body: z18.string().optional(),
15502
- headRefName: z18.string().optional(),
15503
- files: z18.array(z18.object({ path: z18.string() })).optional(),
15504
- changedFiles: z18.number().int().nonnegative().optional(),
15505
- mergeable: z18.string().optional(),
15506
- statusCheckRollup: z18.array(
15507
- z18.object({
15508
- __typename: z18.string().optional(),
15509
- name: z18.string().optional(),
15510
- workflowName: z18.string().optional(),
15511
- conclusion: z18.string().nullable().optional(),
15512
- status: z18.string().optional(),
15802
+ var ghPrViewSchema = z19.object({
15803
+ state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
15804
+ mergedAt: z19.string().nullable(),
15805
+ headRefOid: z19.string().optional(),
15806
+ mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
15807
+ title: z19.string().optional(),
15808
+ body: z19.string().optional(),
15809
+ headRefName: z19.string().optional(),
15810
+ files: z19.array(z19.object({ path: z19.string() })).optional(),
15811
+ changedFiles: z19.number().int().nonnegative().optional(),
15812
+ mergeable: z19.string().optional(),
15813
+ statusCheckRollup: z19.array(
15814
+ z19.object({
15815
+ __typename: z19.string().optional(),
15816
+ name: z19.string().optional(),
15817
+ workflowName: z19.string().optional(),
15818
+ conclusion: z19.string().nullable().optional(),
15819
+ status: z19.string().optional(),
15513
15820
  /** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
15514
- startedAt: z18.string().nullable().optional(),
15821
+ startedAt: z19.string().nullable().optional(),
15515
15822
  /** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
15516
- completedAt: z18.string().nullable().optional()
15823
+ completedAt: z19.string().nullable().optional()
15517
15824
  }).passthrough()
15518
15825
  ).optional().default([])
15519
15826
  }).passthrough();
15520
15827
  var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
15521
15828
 
15522
15829
  // packages/contracts/src/release/plan.ts
15523
- import { z as z19 } from "zod";
15830
+ import { z as z20 } from "zod";
15524
15831
  var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
15525
15832
  var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
15526
15833
  var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
@@ -15564,20 +15871,20 @@ var RESOLVED_SOURCE = [
15564
15871
  "language-default",
15565
15872
  "legacy-alias"
15566
15873
  ];
15567
- var ReleaseChannelSchema = z19.enum(RELEASE_CHANNEL);
15568
- var ReleaseSchemeSchema = z19.enum(RELEASE_SCHEME);
15569
- var ReleaseKindSchema = z19.enum(RELEASE_KIND);
15570
- var ReleaseStatusSchema = z19.enum(RELEASE_STATUS);
15571
- var GateStatusSchema = z19.enum(GATE_STATUS);
15572
- var GateNameSchema = z19.enum(GATE_NAME);
15573
- var PlatformTupleSchema = z19.enum(PLATFORM_TUPLE);
15574
- var PublisherSchema = z19.enum(PUBLISHER);
15575
- var TaskKindSchema = z19.enum(TASK_KIND);
15576
- var ImpactSchema = z19.enum(IMPACT);
15577
- var ResolvedSourceSchema = z19.enum(RESOLVED_SOURCE);
15578
- var Iso8601 = z19.iso.datetime({ offset: true });
15579
- var NonEmptyString = z19.string().min(1);
15580
- var ReleasePlanTaskSchema = z19.object({
15874
+ var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
15875
+ var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
15876
+ var ReleaseKindSchema = z20.enum(RELEASE_KIND);
15877
+ var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
15878
+ var GateStatusSchema = z20.enum(GATE_STATUS);
15879
+ var GateNameSchema = z20.enum(GATE_NAME);
15880
+ var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
15881
+ var PublisherSchema = z20.enum(PUBLISHER);
15882
+ var TaskKindSchema = z20.enum(TASK_KIND);
15883
+ var ImpactSchema = z20.enum(IMPACT);
15884
+ var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
15885
+ var Iso8601 = z20.iso.datetime({ offset: true });
15886
+ var NonEmptyString = z20.string().min(1);
15887
+ var ReleasePlanTaskSchema = z20.object({
15581
15888
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
15582
15889
  id: NonEmptyString,
15583
15890
  /** Conventional-commit-aligned task classification. */
@@ -15585,20 +15892,20 @@ var ReleasePlanTaskSchema = z19.object({
15585
15892
  /** SemVer impact classification. */
15586
15893
  impact: ImpactSchema,
15587
15894
  /** Human-readable changelog line for this task. */
15588
- userFacingSummary: z19.string(),
15895
+ userFacingSummary: z20.string(),
15589
15896
  /**
15590
15897
  * ADR-051 evidence atoms attesting the task's gate results. Format is
15591
15898
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
15592
15899
  * accepts empty arrays so legacy plans validate; `cleo release plan`
15593
15900
  * enforces non-empty via R-301.
15594
15901
  */
15595
- evidenceAtoms: z19.array(NonEmptyString),
15902
+ evidenceAtoms: z20.array(NonEmptyString),
15596
15903
  /** IVTR phase at plan time — informational only per R-316. */
15597
- ivtrPhaseAtPlan: z19.string().optional(),
15904
+ ivtrPhaseAtPlan: z20.string().optional(),
15598
15905
  /** Epic this task rolls up to, locked at plan time per R-303. */
15599
15906
  epicAncestor: NonEmptyString
15600
15907
  });
15601
- var ReleaseGateSchema = z19.object({
15908
+ var ReleaseGateSchema = z20.object({
15602
15909
  /** Canonical gate name. */
15603
15910
  name: GateNameSchema,
15604
15911
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -15608,11 +15915,11 @@ var ReleaseGateSchema = z19.object({
15608
15915
  /** ISO-8601 timestamp the gate was last verified. */
15609
15916
  lastVerifiedAt: Iso8601,
15610
15917
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
15611
- resolvedCommand: z19.string().optional(),
15918
+ resolvedCommand: z20.string().optional(),
15612
15919
  /** Provenance of the resolved command. Optional for unresolved gates. */
15613
15920
  resolvedSource: ResolvedSourceSchema.optional()
15614
15921
  });
15615
- var ReleasePlatformMatrixEntrySchema = z19.object({
15922
+ var ReleasePlatformMatrixEntrySchema = z20.object({
15616
15923
  /** Target platform tuple. */
15617
15924
  platform: PlatformTupleSchema,
15618
15925
  /** Distribution backend. */
@@ -15620,47 +15927,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
15620
15927
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
15621
15928
  package: NonEmptyString,
15622
15929
  /** Whether to run the GHA smoke job for this matrix entry. */
15623
- smoke: z19.boolean().default(true).optional()
15930
+ smoke: z20.boolean().default(true).optional()
15624
15931
  });
15625
- var ReleasePreflightSummarySchema = z19.object({
15932
+ var ReleasePreflightSummarySchema = z20.object({
15626
15933
  /** True if esbuild externals are out of sync with package.json. */
15627
- esbuildExternalsDrift: z19.boolean(),
15934
+ esbuildExternalsDrift: z20.boolean(),
15628
15935
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
15629
- lockfileDrift: z19.boolean(),
15936
+ lockfileDrift: z20.boolean(),
15630
15937
  /** True if all epic children are in terminal lifecycle states. */
15631
- epicCompletenessClean: z19.boolean(),
15938
+ epicCompletenessClean: z20.boolean(),
15632
15939
  /** True if no task appears in multiple in-flight release plans. */
15633
- doubleListingClean: z19.boolean(),
15940
+ doubleListingClean: z20.boolean(),
15634
15941
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
15635
- preflightWarnings: z19.array(z19.string()).default([]).optional()
15942
+ preflightWarnings: z20.array(z20.string()).default([]).optional()
15636
15943
  });
15637
- var ReleasePlanChangelogSchema = z19.object({
15944
+ var ReleasePlanChangelogSchema = z20.object({
15638
15945
  /** `kind=feat` tasks. */
15639
- features: z19.array(NonEmptyString).default([]),
15946
+ features: z20.array(NonEmptyString).default([]),
15640
15947
  /** `kind=fix` or `kind=hotfix` tasks. */
15641
- fixes: z19.array(NonEmptyString).default([]),
15948
+ fixes: z20.array(NonEmptyString).default([]),
15642
15949
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
15643
- chores: z19.array(NonEmptyString).default([]),
15950
+ chores: z20.array(NonEmptyString).default([]),
15644
15951
  /** `kind=breaking` or `kind=revert` tasks. */
15645
- breaking: z19.array(NonEmptyString).default([])
15952
+ breaking: z20.array(NonEmptyString).default([])
15646
15953
  });
15647
- var ReleasePlanMetaSchema = z19.object({
15954
+ var ReleasePlanMetaSchema = z20.object({
15648
15955
  /** True if this is the project's first ever release. */
15649
- firstEverRelease: z19.boolean().optional(),
15956
+ firstEverRelease: z20.boolean().optional(),
15650
15957
  /** Canonical tool names that could not be resolved at plan time. */
15651
- unresolvedTools: z19.array(z19.string()).optional(),
15958
+ unresolvedTools: z20.array(z20.string()).optional(),
15652
15959
  /** Project archetype detected at plan time. */
15653
- archetype: z19.string().optional()
15654
- }).catchall(z19.unknown());
15655
- var ReleasePlanSchema = z19.object({
15960
+ archetype: z20.string().optional()
15961
+ }).catchall(z20.unknown());
15962
+ var ReleasePlanSchema = z20.object({
15656
15963
  /** Schema URL for this plan version. */
15657
- $schema: z19.string().optional(),
15964
+ $schema: z20.string().optional(),
15658
15965
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
15659
15966
  version: NonEmptyString,
15660
15967
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
15661
15968
  resolvedVersion: NonEmptyString,
15662
15969
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
15663
- suffixApplied: z19.boolean(),
15970
+ suffixApplied: z20.boolean(),
15664
15971
  /** Versioning scheme governing `version` / `resolvedVersion`. */
15665
15972
  scheme: ReleaseSchemeSchema,
15666
15973
  /** npm dist-tag channel for this release. */
@@ -15674,7 +15981,7 @@ var ReleasePlanSchema = z19.object({
15674
15981
  /** Release-kind classification. */
15675
15982
  releaseKind: ReleaseKindSchema,
15676
15983
  /** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
15677
- hooksV1Promotion: z19.boolean().optional(),
15984
+ hooksV1Promotion: z20.boolean().optional(),
15678
15985
  /** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
15679
15986
  hooksV1Waiver: NonEmptyString.optional(),
15680
15987
  /** ISO-8601 timestamp the plan was written. */
@@ -15685,27 +15992,27 @@ var ReleasePlanSchema = z19.object({
15685
15992
  * Version of the previous release on the same channel. MUST be `null` only
15686
15993
  * for first-ever releases (R-300, enforced at the verb layer).
15687
15994
  */
15688
- previousVersion: z19.string().nullable(),
15995
+ previousVersion: z20.string().nullable(),
15689
15996
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
15690
- previousTag: z19.string().nullable(),
15997
+ previousTag: z20.string().nullable(),
15691
15998
  /** ISO-8601 timestamp the previous release was published. */
15692
15999
  previousShippedAt: Iso8601.nullable(),
15693
16000
  /** Tasks rolled into this release. */
15694
- tasks: z19.array(ReleasePlanTaskSchema),
16001
+ tasks: z20.array(ReleasePlanTaskSchema),
15695
16002
  /** Bucketed changelog. */
15696
16003
  changelog: ReleasePlanChangelogSchema,
15697
16004
  /** Per-gate verification status. */
15698
- gates: z19.array(ReleaseGateSchema),
16005
+ gates: z20.array(ReleaseGateSchema),
15699
16006
  /** Platform / publisher matrix. */
15700
- platformMatrix: z19.array(ReleasePlatformMatrixEntrySchema),
16007
+ platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
15701
16008
  /** Preflight summary from `cleo release plan`. */
15702
16009
  preflightSummary: ReleasePreflightSummarySchema,
15703
16010
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
15704
- workflowRunUrl: z19.string().nullable(),
16011
+ workflowRunUrl: z20.string().nullable(),
15705
16012
  /** URL of the bump PR (populated by `cleo release open`). */
15706
- prUrl: z19.string().nullable(),
16013
+ prUrl: z20.string().nullable(),
15707
16014
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
15708
- mergeCommitSha: z19.string().nullable(),
16015
+ mergeCommitSha: z20.string().nullable(),
15709
16016
  /** Current FSM state per R-302. */
15710
16017
  status: ReleaseStatusSchema,
15711
16018
  /** Informational / forward-compat metadata. */
@@ -15735,48 +16042,48 @@ var RESOURCE_CLASSES = Object.freeze([
15735
16042
  ]);
15736
16043
 
15737
16044
  // packages/contracts/src/session-journal.ts
15738
- import { z as z20 } from "zod";
16045
+ import { z as z21 } from "zod";
15739
16046
  var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
15740
- var sessionJournalDoctorSummarySchema = z20.object({
16047
+ var sessionJournalDoctorSummarySchema = z21.object({
15741
16048
  /** `true` when zero noise patterns were detected. */
15742
- isClean: z20.boolean(),
16049
+ isClean: z21.boolean(),
15743
16050
  /** Total number of noise findings across all patterns. */
15744
- findingsCount: z20.number().int().nonnegative(),
16051
+ findingsCount: z21.number().int().nonnegative(),
15745
16052
  /** Pattern names that were detected (empty when isClean). */
15746
- patterns: z20.array(z20.string()),
16053
+ patterns: z21.array(z21.string()),
15747
16054
  /** Total brain entries scanned. `0` = empty or unavailable. */
15748
- totalScanned: z20.number().int().nonnegative()
16055
+ totalScanned: z21.number().int().nonnegative()
15749
16056
  });
15750
- var sessionJournalDebriefSummarySchema = z20.object({
16057
+ var sessionJournalDebriefSummarySchema = z21.object({
15751
16058
  /** First 200 characters of the session end note (if provided). */
15752
- noteExcerpt: z20.string().max(200).optional(),
16059
+ noteExcerpt: z21.string().max(200).optional(),
15753
16060
  /** Number of tasks completed during the session. */
15754
- tasksCompletedCount: z20.number().int().nonnegative(),
16061
+ tasksCompletedCount: z21.number().int().nonnegative(),
15755
16062
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
15756
- tasksFocused: z20.array(z20.string()).max(5).optional()
16063
+ tasksFocused: z21.array(z21.string()).max(5).optional()
15757
16064
  });
15758
- var sessionJournalEntrySchema = z20.object({
16065
+ var sessionJournalEntrySchema = z21.object({
15759
16066
  // Identity
15760
16067
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
15761
- schemaVersion: z20.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16068
+ schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
15762
16069
  /** ISO 8601 timestamp when the entry was written. */
15763
- timestamp: z20.string(),
16070
+ timestamp: z21.string(),
15764
16071
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
15765
- sessionId: z20.string(),
16072
+ sessionId: z21.string(),
15766
16073
  /** Event type that triggered this journal entry. */
15767
- eventType: z20.enum(["session_start", "session_end", "observation", "decision", "error"]),
16074
+ eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
15768
16075
  // Session metadata (set on session_start / session_end)
15769
16076
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
15770
- agentIdentifier: z20.string().optional(),
16077
+ agentIdentifier: z21.string().optional(),
15771
16078
  /** Provider adapter ID active for this session. */
15772
- providerId: z20.string().optional(),
16079
+ providerId: z21.string().optional(),
15773
16080
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
15774
- scope: z20.string().optional(),
16081
+ scope: z21.string().optional(),
15775
16082
  // Session-end fields
15776
16083
  /** Duration of the session in seconds (session_end only). */
15777
- duration: z20.number().int().nonnegative().optional(),
16084
+ duration: z21.number().int().nonnegative().optional(),
15778
16085
  /** Task IDs (not titles) completed during the session. */
15779
- tasksCompleted: z20.array(z20.string()).optional(),
16086
+ tasksCompleted: z21.array(z21.string()).optional(),
15780
16087
  // Doctor summary (T1262 absorbed)
15781
16088
  /**
15782
16089
  * Compact result of `scanBrainNoise` run at session-end.
@@ -15791,52 +16098,52 @@ var sessionJournalEntrySchema = z20.object({
15791
16098
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
15792
16099
  // Optional hash chain
15793
16100
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
15794
- prevEntryHash: z20.string().optional()
16101
+ prevEntryHash: z21.string().optional()
15795
16102
  });
15796
16103
 
15797
16104
  // packages/contracts/src/task-evidence.ts
15798
- import { z as z21 } from "zod";
15799
- var fileEvidenceSchema = z21.object({
15800
- kind: z21.literal("file"),
15801
- sha256: z21.string().length(64),
15802
- timestamp: z21.string().datetime(),
15803
- path: z21.string().min(1),
15804
- mime: z21.string().optional(),
15805
- description: z21.string().optional()
16105
+ import { z as z22 } from "zod";
16106
+ var fileEvidenceSchema = z22.object({
16107
+ kind: z22.literal("file"),
16108
+ sha256: z22.string().length(64),
16109
+ timestamp: z22.string().datetime(),
16110
+ path: z22.string().min(1),
16111
+ mime: z22.string().optional(),
16112
+ description: z22.string().optional()
15806
16113
  });
15807
- var logEvidenceSchema = z21.object({
15808
- kind: z21.literal("log"),
15809
- sha256: z21.string().length(64),
15810
- timestamp: z21.string().datetime(),
15811
- source: z21.string().min(1),
15812
- description: z21.string().optional()
16114
+ var logEvidenceSchema = z22.object({
16115
+ kind: z22.literal("log"),
16116
+ sha256: z22.string().length(64),
16117
+ timestamp: z22.string().datetime(),
16118
+ source: z22.string().min(1),
16119
+ description: z22.string().optional()
15813
16120
  });
15814
- var screenshotEvidenceSchema = z21.object({
15815
- kind: z21.literal("screenshot"),
15816
- sha256: z21.string().length(64),
15817
- timestamp: z21.string().datetime(),
15818
- mime: z21.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
15819
- description: z21.string().optional()
16121
+ var screenshotEvidenceSchema = z22.object({
16122
+ kind: z22.literal("screenshot"),
16123
+ sha256: z22.string().length(64),
16124
+ timestamp: z22.string().datetime(),
16125
+ mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16126
+ description: z22.string().optional()
15820
16127
  });
15821
- var testOutputEvidenceSchema = z21.object({
15822
- kind: z21.literal("test-output"),
15823
- sha256: z21.string().length(64),
15824
- timestamp: z21.string().datetime(),
15825
- passed: z21.number().int().nonnegative(),
15826
- failed: z21.number().int().nonnegative(),
15827
- skipped: z21.number().int().nonnegative(),
15828
- exitCode: z21.number().int(),
15829
- description: z21.string().optional()
16128
+ var testOutputEvidenceSchema = z22.object({
16129
+ kind: z22.literal("test-output"),
16130
+ sha256: z22.string().length(64),
16131
+ timestamp: z22.string().datetime(),
16132
+ passed: z22.number().int().nonnegative(),
16133
+ failed: z22.number().int().nonnegative(),
16134
+ skipped: z22.number().int().nonnegative(),
16135
+ exitCode: z22.number().int(),
16136
+ description: z22.string().optional()
15830
16137
  });
15831
- var commandOutputEvidenceSchema = z21.object({
15832
- kind: z21.literal("command-output"),
15833
- sha256: z21.string().length(64),
15834
- timestamp: z21.string().datetime(),
15835
- cmd: z21.string().min(1),
15836
- exitCode: z21.number().int(),
15837
- description: z21.string().optional()
16138
+ var commandOutputEvidenceSchema = z22.object({
16139
+ kind: z22.literal("command-output"),
16140
+ sha256: z22.string().length(64),
16141
+ timestamp: z22.string().datetime(),
16142
+ cmd: z22.string().min(1),
16143
+ exitCode: z22.number().int(),
16144
+ description: z22.string().optional()
15838
16145
  });
15839
- var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16146
+ var taskEvidenceSchema = z22.discriminatedUnion("kind", [
15840
16147
  fileEvidenceSchema,
15841
16148
  logEvidenceSchema,
15842
16149
  screenshotEvidenceSchema,
@@ -15845,8 +16152,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
15845
16152
  ]);
15846
16153
 
15847
16154
  // packages/contracts/src/tasks/archive.ts
15848
- import { z as z22 } from "zod";
15849
- var ArchiveReason = z22.enum([
16155
+ import { z as z23 } from "zod";
16156
+ var ArchiveReason = z23.enum([
15850
16157
  "verified",
15851
16158
  "reconciled",
15852
16159
  "superseded",
@@ -15857,42 +16164,42 @@ var ArchiveReason = z22.enum([
15857
16164
  var ARCHIVE_REASON_VALUES = ArchiveReason.options;
15858
16165
 
15859
16166
  // packages/contracts/src/tasks/index.ts
15860
- import { z as z23 } from "zod";
15861
- var taskMutationWarningSeveritySchema = z23.enum(["info", "warning"]);
15862
- var taskMutationWarningSchema = z23.object({
15863
- code: z23.string().min(1),
15864
- message: z23.string().min(1),
16167
+ import { z as z24 } from "zod";
16168
+ var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
16169
+ var taskMutationWarningSchema = z24.object({
16170
+ code: z24.string().min(1),
16171
+ message: z24.string().min(1),
15865
16172
  severity: taskMutationWarningSeveritySchema.optional(),
15866
- taskId: z23.string().min(1).optional(),
15867
- field: z23.string().min(1).optional(),
15868
- index: z23.number().int().nonnegative().optional()
16173
+ taskId: z24.string().min(1).optional(),
16174
+ field: z24.string().min(1).optional(),
16175
+ index: z24.number().int().nonnegative().optional()
15869
16176
  });
15870
- var taskMutationDryRunSummarySchema = z23.object({
15871
- dryRun: z23.literal(true),
15872
- wouldCreate: z23.number().int().nonnegative(),
15873
- wouldUpdate: z23.number().int().nonnegative(),
15874
- wouldDelete: z23.number().int().nonnegative(),
15875
- wouldAffect: z23.number().int().nonnegative(),
15876
- validatedCount: z23.number().int().nonnegative(),
15877
- insertedCount: z23.literal(0),
15878
- updatedCount: z23.literal(0),
15879
- deletedCount: z23.literal(0),
15880
- warnings: z23.array(taskMutationWarningSchema)
16177
+ var taskMutationDryRunSummarySchema = z24.object({
16178
+ dryRun: z24.literal(true),
16179
+ wouldCreate: z24.number().int().nonnegative(),
16180
+ wouldUpdate: z24.number().int().nonnegative(),
16181
+ wouldDelete: z24.number().int().nonnegative(),
16182
+ wouldAffect: z24.number().int().nonnegative(),
16183
+ validatedCount: z24.number().int().nonnegative(),
16184
+ insertedCount: z24.literal(0),
16185
+ updatedCount: z24.literal(0),
16186
+ deletedCount: z24.literal(0),
16187
+ warnings: z24.array(taskMutationWarningSchema)
15881
16188
  });
15882
- var taskMutationTaskRecordSchema = z23.object({ id: z23.string().min(1) }).passthrough();
15883
- var taskMutationEnvelopeSchema = z23.object({
15884
- dryRun: z23.boolean().optional(),
15885
- created: z23.array(taskMutationTaskRecordSchema),
15886
- updated: z23.array(taskMutationTaskRecordSchema),
15887
- deleted: z23.array(taskMutationTaskRecordSchema),
15888
- affectedCount: z23.number().int().nonnegative(),
15889
- mutationWarnings: z23.array(taskMutationWarningSchema),
16189
+ var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
16190
+ var taskMutationEnvelopeSchema = z24.object({
16191
+ dryRun: z24.boolean().optional(),
16192
+ created: z24.array(taskMutationTaskRecordSchema),
16193
+ updated: z24.array(taskMutationTaskRecordSchema),
16194
+ deleted: z24.array(taskMutationTaskRecordSchema),
16195
+ affectedCount: z24.number().int().nonnegative(),
16196
+ mutationWarnings: z24.array(taskMutationWarningSchema),
15890
16197
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
15891
16198
  });
15892
- var completionTaskStatusSchema = z23.enum(TASK_STATUSES);
15893
- var completionCriterionKindSchema = z23.enum(["text", "evidence_bound", "child_task"]);
15894
- var completionCriterionStatusSchema = z23.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
15895
- var completionBlockerReasonSchema = z23.enum([
16199
+ var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
16200
+ var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
16201
+ var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16202
+ var completionBlockerReasonSchema = z24.enum([
15896
16203
  "missing_evidence_binding",
15897
16204
  "child_not_done",
15898
16205
  "child_cancelled_requires_waiver",
@@ -15900,68 +16207,68 @@ var completionBlockerReasonSchema = z23.enum([
15900
16207
  "child_missing",
15901
16208
  "done_parent_stale"
15902
16209
  ]);
15903
- var completionStaleReasonSchema = z23.enum(["done_parent_has_unsatisfied_criteria"]);
15904
- var completionProjectionRepairErrorCodeSchema = z23.enum([
16210
+ var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
16211
+ var completionProjectionRepairErrorCodeSchema = z24.enum([
15905
16212
  "projection_not_stale",
15906
16213
  "criteria_missing",
15907
16214
  "binding_target_missing",
15908
16215
  "repair_conflict"
15909
16216
  ]);
15910
- var completionCriterionWaiverSchema = z23.object({
15911
- criterionAcId: z23.string().min(1),
15912
- childTaskId: z23.string().min(1),
15913
- reason: z23.string().min(1),
15914
- actor: z23.string().min(1),
15915
- waivedAt: z23.string().min(1)
16217
+ var completionCriterionWaiverSchema = z24.object({
16218
+ criterionAcId: z24.string().min(1),
16219
+ childTaskId: z24.string().min(1),
16220
+ reason: z24.string().min(1),
16221
+ actor: z24.string().min(1),
16222
+ waivedAt: z24.string().min(1)
15916
16223
  });
15917
- var completionCriterionReplacementSchema = z23.object({
15918
- criterionAcId: z23.string().min(1),
15919
- originalChildTaskId: z23.string().min(1),
15920
- replacementChildTaskId: z23.string().min(1),
15921
- reason: z23.string().min(1),
15922
- actor: z23.string().min(1),
15923
- replacedAt: z23.string().min(1)
16224
+ var completionCriterionReplacementSchema = z24.object({
16225
+ criterionAcId: z24.string().min(1),
16226
+ originalChildTaskId: z24.string().min(1),
16227
+ replacementChildTaskId: z24.string().min(1),
16228
+ reason: z24.string().min(1),
16229
+ actor: z24.string().min(1),
16230
+ replacedAt: z24.string().min(1)
15924
16231
  });
15925
- var completionCriterionEvaluationSchema = z23.object({
15926
- acId: z23.string().min(1),
15927
- alias: z23.string().min(1),
15928
- text: z23.string(),
16232
+ var completionCriterionEvaluationSchema = z24.object({
16233
+ acId: z24.string().min(1),
16234
+ alias: z24.string().min(1),
16235
+ text: z24.string(),
15929
16236
  kind: completionCriterionKindSchema,
15930
16237
  status: completionCriterionStatusSchema,
15931
16238
  reason: completionBlockerReasonSchema.optional(),
15932
- targetTaskId: z23.string().min(1).optional(),
16239
+ targetTaskId: z24.string().min(1).optional(),
15933
16240
  targetTaskStatus: completionTaskStatusSchema.optional(),
15934
16241
  waiver: completionCriterionWaiverSchema.optional(),
15935
16242
  replacement: completionCriterionReplacementSchema.optional(),
15936
16243
  replacementTaskStatus: completionTaskStatusSchema.optional(),
15937
- evidenceBindings: z23.number().int().nonnegative()
16244
+ evidenceBindings: z24.number().int().nonnegative()
15938
16245
  });
15939
16246
  var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
15940
- status: z23.literal("unsatisfied"),
16247
+ status: z24.literal("unsatisfied"),
15941
16248
  reason: completionBlockerReasonSchema
15942
16249
  });
15943
- var completionTotalsSchema = z23.object({
15944
- criteria: z23.number().int().nonnegative(),
15945
- satisfied: z23.number().int().nonnegative(),
15946
- unsatisfied: z23.number().int().nonnegative(),
15947
- waived: z23.number().int().nonnegative(),
15948
- replaced: z23.number().int().nonnegative()
16250
+ var completionTotalsSchema = z24.object({
16251
+ criteria: z24.number().int().nonnegative(),
16252
+ satisfied: z24.number().int().nonnegative(),
16253
+ unsatisfied: z24.number().int().nonnegative(),
16254
+ waived: z24.number().int().nonnegative(),
16255
+ replaced: z24.number().int().nonnegative()
15949
16256
  });
15950
- var completionContextPackSchema = z23.object({
15951
- taskId: z23.string().min(1),
15952
- generatedAt: z23.string().min(1),
15953
- source: z23.literal("audit_log"),
15954
- window: z23.object({
15955
- limit: z23.number().int().positive(),
15956
- since: z23.string().min(1).optional(),
15957
- relationDepth: z23.number().int().nonnegative(),
15958
- relatedTaskIds: z23.array(z23.string().min(1))
16257
+ var completionContextPackSchema = z24.object({
16258
+ taskId: z24.string().min(1),
16259
+ generatedAt: z24.string().min(1),
16260
+ source: z24.literal("audit_log"),
16261
+ window: z24.object({
16262
+ limit: z24.number().int().positive(),
16263
+ since: z24.string().min(1).optional(),
16264
+ relationDepth: z24.number().int().nonnegative(),
16265
+ relatedTaskIds: z24.array(z24.string().min(1))
15959
16266
  }),
15960
- events: z23.array(
15961
- z23.object({
15962
- id: z23.string().min(1),
15963
- timestamp: z23.string().min(1),
15964
- action: z23.enum([
16267
+ events: z24.array(
16268
+ z24.object({
16269
+ id: z24.string().min(1),
16270
+ timestamp: z24.string().min(1),
16271
+ action: z24.enum([
15965
16272
  "task_completed",
15966
16273
  "task_reopened",
15967
16274
  "task_cancelled",
@@ -15969,77 +16276,77 @@ var completionContextPackSchema = z23.object({
15969
16276
  "task_reparented",
15970
16277
  "ac_projection_rebuilt"
15971
16278
  ]),
15972
- taskId: z23.string().min(1),
15973
- relation: z23.enum(["self", "parent", "child", "sibling", "related"]),
15974
- actor: z23.string().min(1),
15975
- details: z23.record(z23.string(), z23.unknown()).optional(),
15976
- before: z23.record(z23.string(), z23.unknown()).optional(),
15977
- after: z23.record(z23.string(), z23.unknown()).optional()
16279
+ taskId: z24.string().min(1),
16280
+ relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
16281
+ actor: z24.string().min(1),
16282
+ details: z24.record(z24.string(), z24.unknown()).optional(),
16283
+ before: z24.record(z24.string(), z24.unknown()).optional(),
16284
+ after: z24.record(z24.string(), z24.unknown()).optional()
15978
16285
  })
15979
16286
  ),
15980
- summary: z23.object({
15981
- totalEvents: z23.number().int().nonnegative(),
15982
- byAction: z23.record(z23.string(), z23.number().int().nonnegative()),
15983
- byRelation: z23.record(z23.string(), z23.number().int().nonnegative()),
15984
- latestEventAt: z23.string().nullable()
16287
+ summary: z24.object({
16288
+ totalEvents: z24.number().int().nonnegative(),
16289
+ byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
16290
+ byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
16291
+ latestEventAt: z24.string().nullable()
15985
16292
  })
15986
16293
  });
15987
- var completionEvaluationSchema = z23.object({
15988
- taskId: z23.string().min(1),
16294
+ var completionEvaluationSchema = z24.object({
16295
+ taskId: z24.string().min(1),
15989
16296
  taskStatus: completionTaskStatusSchema,
15990
- ready: z23.boolean(),
15991
- stale: z23.boolean(),
15992
- staleReasons: z23.array(completionStaleReasonSchema),
16297
+ ready: z24.boolean(),
16298
+ stale: z24.boolean(),
16299
+ staleReasons: z24.array(completionStaleReasonSchema),
15993
16300
  contextPack: completionContextPackSchema.optional(),
15994
- satisfied: z23.array(completionCriterionEvaluationSchema),
15995
- unsatisfied: z23.array(unsatisfiedCompletionCriterionSchema),
15996
- waived: z23.array(completionCriterionEvaluationSchema),
15997
- replaced: z23.array(completionCriterionEvaluationSchema),
16301
+ satisfied: z24.array(completionCriterionEvaluationSchema),
16302
+ unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
16303
+ waived: z24.array(completionCriterionEvaluationSchema),
16304
+ replaced: z24.array(completionCriterionEvaluationSchema),
15998
16305
  totals: completionTotalsSchema
15999
16306
  });
16000
- var completionExplanationSchema = z23.object({
16001
- taskId: z23.string().min(1),
16002
- ready: z23.boolean(),
16003
- stale: z23.boolean(),
16004
- summary: z23.string(),
16307
+ var completionExplanationSchema = z24.object({
16308
+ taskId: z24.string().min(1),
16309
+ ready: z24.boolean(),
16310
+ stale: z24.boolean(),
16311
+ summary: z24.string(),
16005
16312
  contextPack: completionContextPackSchema.optional(),
16006
- blockers: z23.array(completionCriterionEvaluationSchema)
16313
+ blockers: z24.array(completionCriterionEvaluationSchema)
16007
16314
  });
16008
- var completionListParamsSchema = z23.object({
16009
- taskId: z23.string().min(1),
16315
+ var completionListParamsSchema = z24.object({
16316
+ taskId: z24.string().min(1),
16010
16317
  status: completionCriterionStatusSchema.optional(),
16011
16318
  kind: completionCriterionKindSchema.optional()
16012
16319
  });
16013
- var completionListResultSchema = z23.object({
16014
- taskId: z23.string().min(1),
16015
- criteria: z23.array(completionCriterionEvaluationSchema),
16320
+ var completionListResultSchema = z24.object({
16321
+ taskId: z24.string().min(1),
16322
+ criteria: z24.array(completionCriterionEvaluationSchema),
16016
16323
  totals: completionTotalsSchema
16017
16324
  });
16018
- var completionEvaluateParamsSchema = z23.object({
16019
- taskId: z23.string().min(1),
16020
- includeContext: z23.boolean().optional(),
16021
- limit: z23.number().int().positive().optional(),
16022
- since: z23.string().min(1).optional(),
16023
- relationDepth: z23.number().int().nonnegative().optional()
16325
+ var completionEvaluateParamsSchema = z24.object({
16326
+ taskId: z24.string().min(1),
16327
+ includeContext: z24.boolean().optional(),
16328
+ limit: z24.number().int().positive().optional(),
16329
+ since: z24.string().min(1).optional(),
16330
+ relationDepth: z24.number().int().nonnegative().optional()
16024
16331
  });
16025
- var completionProjectionRepairErrorSchema = z23.object({
16332
+ var completionProjectionRepairErrorSchema = z24.object({
16026
16333
  code: completionProjectionRepairErrorCodeSchema,
16027
- message: z23.string().min(1),
16028
- taskId: z23.string().min(1),
16029
- acId: z23.string().min(1).optional(),
16030
- evidenceAtomId: z23.string().min(1).optional()
16334
+ message: z24.string().min(1),
16335
+ taskId: z24.string().min(1),
16336
+ acId: z24.string().min(1).optional(),
16337
+ evidenceAtomId: z24.string().min(1).optional()
16031
16338
  });
16032
- var completionProjectionRepairParamsSchema = z23.object({
16033
- taskId: z23.string().min(1),
16034
- dryRun: z23.boolean().optional()
16339
+ var completionProjectionRepairParamsSchema = z24.object({
16340
+ taskId: z24.string().min(1),
16341
+ dryRun: z24.boolean().optional()
16035
16342
  });
16036
- var completionProjectionRepairResultSchema = z23.object({
16037
- taskId: z23.string().min(1),
16038
- repaired: z23.boolean(),
16039
- dryRun: z23.boolean(),
16040
- staleBefore: z23.boolean(),
16041
- staleAfter: z23.boolean(),
16042
- errors: z23.array(completionProjectionRepairErrorSchema)
16343
+ var completionProjectionRepairResultSchema = z24.object({
16344
+ taskId: z24.string().min(1),
16345
+ repaired: z24.boolean(),
16346
+ dryRun: z24.boolean(),
16347
+ staleBefore: z24.boolean(),
16348
+ staleAfter: z24.boolean(),
16349
+ errors: z24.array(completionProjectionRepairErrorSchema)
16043
16350
  });
16044
16351
 
16045
16352
  // packages/contracts/src/taxonomy.ts
@@ -16542,7 +16849,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
16542
16849
  };
16543
16850
 
16544
16851
  // packages/contracts/src/templates/manifest.ts
16545
- import { z as z24 } from "zod";
16852
+ import { z as z25 } from "zod";
16546
16853
  var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
16547
16854
  var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
16548
16855
  var TEMPLATE_UPDATE_STRATEGIES = [
@@ -16559,79 +16866,79 @@ var PLACEHOLDER_SOURCES = [
16559
16866
  "tool-resolver",
16560
16867
  "literal"
16561
16868
  ];
16562
- var PlaceholderSpecSchema = z24.object({
16869
+ var PlaceholderSpecSchema = z25.object({
16563
16870
  /**
16564
16871
  * Placeholder identifier as it appears in the template body
16565
16872
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
16566
16873
  */
16567
- name: z24.string().min(1, "placeholder name must be non-empty"),
16874
+ name: z25.string().min(1, "placeholder name must be non-empty"),
16568
16875
  /** Resolver source the installer consults for this placeholder. */
16569
- source: z24.enum(PLACEHOLDER_SOURCES),
16876
+ source: z25.enum(PLACEHOLDER_SOURCES),
16570
16877
  /**
16571
16878
  * Path expression evaluated against `source` (e.g. `engines.node` against
16572
16879
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
16573
16880
  * For `literal` source, this MAY be the literal value's identifier.
16574
16881
  */
16575
- sourcePath: z24.string().min(1, "placeholder sourcePath must be non-empty"),
16882
+ sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
16576
16883
  /**
16577
16884
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
16578
16885
  * `null` is permitted to explicitly mark "no default — failure required".
16579
16886
  */
16580
- defaultValue: z24.union([z24.string(), z24.number(), z24.boolean(), z24.null()]).optional()
16887
+ defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
16581
16888
  });
16582
- var TemplateManifestEntrySchema = z24.object({
16889
+ var TemplateManifestEntrySchema = z25.object({
16583
16890
  /** Stable identifier for this template entry. */
16584
- id: z24.string().min(1, "id must be non-empty"),
16891
+ id: z25.string().min(1, "id must be non-empty"),
16585
16892
  /** Category of file this template represents. */
16586
- kind: z24.enum(TEMPLATE_KINDS),
16893
+ kind: z25.enum(TEMPLATE_KINDS),
16587
16894
  /** Repo-relative path of the template source file. */
16588
- sourcePath: z24.string().min(1, "sourcePath must be non-empty"),
16895
+ sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
16589
16896
  /** Project-relative path where the rendered template installs. */
16590
- installPath: z24.string().min(1, "installPath must be non-empty"),
16897
+ installPath: z25.string().min(1, "installPath must be non-empty"),
16591
16898
  /** Substitution strategy the installer applies to `sourcePath`. */
16592
- substitution: z24.enum(TEMPLATE_SUBSTITUTIONS),
16899
+ substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
16593
16900
  /** Declared placeholders this template requires. May be empty. */
16594
- placeholders: z24.array(PlaceholderSpecSchema),
16901
+ placeholders: z25.array(PlaceholderSpecSchema),
16595
16902
  /** Reconciliation policy on upgrade. */
16596
- updateStrategy: z24.enum(TEMPLATE_UPDATE_STRATEGIES)
16903
+ updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
16597
16904
  });
16598
16905
 
16599
16906
  // packages/contracts/src/validator/index.ts
16600
- import { z as z25 } from "zod";
16907
+ import { z as z26 } from "zod";
16601
16908
  var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
16602
- var validatorFindingSchema = z25.object({
16603
- acId: z25.string().min(1, "acId must be non-empty"),
16604
- status: z25.enum(["pass", "fail", "inconclusive"]),
16605
- reasoning: z25.string().min(1, "reasoning must be non-empty"),
16606
- evidenceRefs: z25.array(z25.string()).optional(),
16607
- checkedAt: z25.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
16909
+ var validatorFindingSchema = z26.object({
16910
+ acId: z26.string().min(1, "acId must be non-empty"),
16911
+ status: z26.enum(["pass", "fail", "inconclusive"]),
16912
+ reasoning: z26.string().min(1, "reasoning must be non-empty"),
16913
+ evidenceRefs: z26.array(z26.string()).optional(),
16914
+ checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
16608
16915
  });
16609
- var validatorAttestationSchema = z25.object({
16610
- verdict: z25.literal("attest"),
16611
- taskId: z25.string().min(1),
16612
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
16613
- findings: z25.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
16916
+ var validatorAttestationSchema = z26.object({
16917
+ verdict: z26.literal("attest"),
16918
+ taskId: z26.string().min(1),
16919
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
16920
+ findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
16614
16921
  (findings) => findings.every((f) => f.status === "pass"),
16615
16922
  'attestation requires every finding to have status="pass"'
16616
16923
  ),
16617
- summary: z25.string().optional(),
16618
- attestedAt: z25.string().min(1),
16619
- schemaVersion: z25.literal("1")
16924
+ summary: z26.string().optional(),
16925
+ attestedAt: z26.string().min(1),
16926
+ schemaVersion: z26.literal("1")
16620
16927
  });
16621
- var validatorRejectionSchema = z25.object({
16622
- verdict: z25.literal("reject"),
16623
- taskId: z25.string().min(1),
16624
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
16625
- findings: z25.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
16928
+ var validatorRejectionSchema = z26.object({
16929
+ verdict: z26.literal("reject"),
16930
+ taskId: z26.string().min(1),
16931
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
16932
+ findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
16626
16933
  (findings) => findings.some((f) => f.status !== "pass"),
16627
16934
  'rejection requires at least one finding with status "fail" or "inconclusive"'
16628
16935
  ),
16629
- summary: z25.string().min(1, "rejection summary must be non-empty"),
16630
- remediationHints: z25.array(z25.string()).optional(),
16631
- rejectedAt: z25.string().min(1),
16632
- schemaVersion: z25.literal("1")
16936
+ summary: z26.string().min(1, "rejection summary must be non-empty"),
16937
+ remediationHints: z26.array(z26.string()).optional(),
16938
+ rejectedAt: z26.string().min(1),
16939
+ schemaVersion: z26.literal("1")
16633
16940
  });
16634
- var validatorVerdictSchema = z25.discriminatedUnion("verdict", [
16941
+ var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
16635
16942
  validatorAttestationSchema,
16636
16943
  validatorRejectionSchema
16637
16944
  ]);
@@ -17381,7 +17688,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
17381
17688
  var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
17382
17689
 
17383
17690
  // packages/contracts/src/decide.ts
17384
- import { z as z26 } from "zod";
17691
+ import { z as z27 } from "zod";
17385
17692
  var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
17386
17693
  var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
17387
17694
  var DECISION_REQUEST_LIMITS = {
@@ -17403,11 +17710,11 @@ var DECISION_REQUEST_LIMITS = {
17403
17710
  maxScoreLevels: 10
17404
17711
  };
17405
17712
  var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
17406
- var decisionQuestionTypeSchema = z26.enum(DECISION_QUESTION_TYPES);
17407
- var decisionOutcomeSourceSchema = z26.enum(DECISION_OUTCOME_SOURCES);
17408
- var decisionInstructionsSchema = z26.union([z26.string(), z26.record(z26.string(), z26.json())]);
17409
- var unitIntervalSchema = z26.number().min(0).max(1);
17410
- var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.record(z26.string(), z26.json())]).superRefine((state, context) => {
17713
+ var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
17714
+ var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
17715
+ var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
17716
+ var unitIntervalSchema = z27.number().min(0).max(1);
17717
+ var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
17411
17718
  const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
17412
17719
  if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
17413
17720
  context.addIssue({
@@ -17416,34 +17723,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
17416
17723
  });
17417
17724
  }
17418
17725
  });
17419
- var noulDecisionQuestionSchema = z26.object({
17420
- type: z26.literal("noul"),
17726
+ var noulDecisionQuestionSchema = z27.object({
17727
+ type: z27.literal("noul"),
17421
17728
  instructions: decisionInstructionsSchema.optional(),
17422
- criteria: z26.string().min(1)
17729
+ criteria: z27.string().min(1)
17423
17730
  });
17424
- var choiceDecisionQuestionSchema = z26.object({
17425
- type: z26.literal("choice"),
17731
+ var choiceDecisionQuestionSchema = z27.object({
17732
+ type: z27.literal("choice"),
17426
17733
  instructions: decisionInstructionsSchema.optional(),
17427
- criteria: z26.record(z26.string().min(1), z26.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
17734
+ criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
17428
17735
  message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
17429
17736
  })
17430
17737
  });
17431
- var scoreDecisionQuestionSchema = z26.object({
17432
- type: z26.literal("score"),
17738
+ var scoreDecisionQuestionSchema = z27.object({
17739
+ type: z27.literal("score"),
17433
17740
  instructions: decisionInstructionsSchema.optional(),
17434
- criteria: z26.array(z26.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
17741
+ criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
17435
17742
  });
17436
- var decisionQuestionSchema = z26.discriminatedUnion("type", [
17743
+ var decisionQuestionSchema = z27.discriminatedUnion("type", [
17437
17744
  noulDecisionQuestionSchema,
17438
17745
  choiceDecisionQuestionSchema,
17439
17746
  scoreDecisionQuestionSchema
17440
17747
  ]);
17441
- var decisionRequestSchema = z26.object({
17442
- model: z26.string().min(1).optional(),
17443
- lang: z26.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
17444
- cache: z26.boolean().optional(),
17748
+ var decisionRequestSchema = z27.object({
17749
+ model: z27.string().min(1).optional(),
17750
+ lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
17751
+ cache: z27.boolean().optional(),
17445
17752
  state: decisionStateSchema,
17446
- questions: z26.record(z26.string().min(1), decisionQuestionSchema).refine(
17753
+ questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
17447
17754
  (questions) => {
17448
17755
  const count = Object.keys(questions).length;
17449
17756
  return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
@@ -17453,139 +17760,139 @@ var decisionRequestSchema = z26.object({
17453
17760
  }
17454
17761
  )
17455
17762
  });
17456
- var noulDecisionAnswerSchema = z26.object({
17457
- type: z26.literal("noul"),
17458
- value: z26.boolean(),
17763
+ var noulDecisionAnswerSchema = z27.object({
17764
+ type: z27.literal("noul"),
17765
+ value: z27.boolean(),
17459
17766
  probability: unitIntervalSchema,
17460
17767
  confidence: unitIntervalSchema
17461
17768
  });
17462
- var choiceDecisionAnswerSchema = z26.object({
17463
- type: z26.literal("choice"),
17464
- value: z26.string().min(1),
17465
- probabilities: z26.record(z26.string().min(1), unitIntervalSchema),
17769
+ var choiceDecisionAnswerSchema = z27.object({
17770
+ type: z27.literal("choice"),
17771
+ value: z27.string().min(1),
17772
+ probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
17466
17773
  confidence: unitIntervalSchema
17467
17774
  });
17468
- var scoreDecisionAnswerSchema = z26.object({
17469
- type: z26.literal("score"),
17470
- value: z26.number().int().nonnegative(),
17471
- probabilities: z26.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
17775
+ var scoreDecisionAnswerSchema = z27.object({
17776
+ type: z27.literal("score"),
17777
+ value: z27.number().int().nonnegative(),
17778
+ probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
17472
17779
  confidence: unitIntervalSchema
17473
17780
  });
17474
- var decisionAnswerSchema = z26.discriminatedUnion("type", [
17781
+ var decisionAnswerSchema = z27.discriminatedUnion("type", [
17475
17782
  noulDecisionAnswerSchema,
17476
17783
  choiceDecisionAnswerSchema,
17477
17784
  scoreDecisionAnswerSchema
17478
17785
  ]);
17479
- var decisionOutcomeSchema = z26.object({
17480
- answers: z26.record(z26.string().min(1), decisionAnswerSchema),
17786
+ var decisionOutcomeSchema = z27.object({
17787
+ answers: z27.record(z27.string().min(1), decisionAnswerSchema),
17481
17788
  source: decisionOutcomeSourceSchema,
17482
- requestId: z26.string().min(1).optional(),
17483
- latencyMs: z26.number().nonnegative(),
17484
- costUsd: z26.number().nonnegative().optional(),
17485
- costMicros: z26.number().int().nonnegative().optional(),
17486
- balanceMicros: z26.number().int().optional(),
17487
- checkpoint: z26.string().min(1).optional(),
17488
- inputTokens: z26.number().int().nonnegative().optional()
17789
+ requestId: z27.string().min(1).optional(),
17790
+ latencyMs: z27.number().nonnegative(),
17791
+ costUsd: z27.number().nonnegative().optional(),
17792
+ costMicros: z27.number().int().nonnegative().optional(),
17793
+ balanceMicros: z27.number().int().optional(),
17794
+ checkpoint: z27.string().min(1).optional(),
17795
+ inputTokens: z27.number().int().nonnegative().optional()
17489
17796
  });
17490
- var decisionProviderKindSchema = z26.enum(DECISION_PROVIDER_KINDS);
17491
- var decisionProviderConfigSchema = z26.object({
17492
- baseUrl: z26.url(),
17797
+ var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
17798
+ var decisionProviderConfigSchema = z27.object({
17799
+ baseUrl: z27.url(),
17493
17800
  provider: decisionProviderKindSchema.optional()
17494
17801
  });
17495
17802
 
17496
17803
  // packages/contracts/src/nexus-account.ts
17497
- import { z as z27 } from "zod";
17498
- var nexusAccountUserSchema = z27.object({
17499
- id: z27.string(),
17500
- email: z27.string(),
17501
- name: z27.string().nullable().optional()
17804
+ import { z as z28 } from "zod";
17805
+ var nexusAccountUserSchema = z28.object({
17806
+ id: z28.string(),
17807
+ email: z28.string(),
17808
+ name: z28.string().nullable().optional()
17502
17809
  });
17503
- var nexusAccountOrganizationSchema = z27.object({
17504
- id: z27.string(),
17505
- name: z27.string(),
17506
- slug: z27.string().nullable().optional(),
17507
- role: z27.string().optional(),
17810
+ var nexusAccountOrganizationSchema = z28.object({
17811
+ id: z28.string(),
17812
+ name: z28.string(),
17813
+ slug: z28.string().nullable().optional(),
17814
+ role: z28.string().optional(),
17508
17815
  /** `true` for the personal organization created at sign-up. */
17509
- personal: z27.boolean().optional()
17816
+ personal: z28.boolean().optional()
17510
17817
  });
17511
- var nexusAccountMeSchema = z27.object({
17818
+ var nexusAccountMeSchema = z28.object({
17512
17819
  user: nexusAccountUserSchema,
17513
- organizations: z27.array(nexusAccountOrganizationSchema).default([])
17820
+ organizations: z28.array(nexusAccountOrganizationSchema).default([])
17514
17821
  });
17515
17822
 
17516
17823
  // packages/contracts/src/nexus-cloud.ts
17517
- import { z as z28 } from "zod";
17824
+ import { z as z29 } from "zod";
17518
17825
  var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
17519
17826
  var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
17520
17827
  var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
17521
- var isoTime = z28.iso.datetime({ offset: true });
17522
- var profile = z28.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
17523
- var deviceState = z28.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
17524
- var nexusCloudCredentialSchema = z28.object({
17525
- kind: z28.enum(["device", "session"]),
17526
- credentialId: z28.string().nullable().optional(),
17828
+ var isoTime = z29.iso.datetime({ offset: true });
17829
+ var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
17830
+ var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
17831
+ var nexusCloudCredentialSchema = z29.object({
17832
+ kind: z29.enum(["device", "session"]),
17833
+ credentialId: z29.string().nullable().optional(),
17527
17834
  profile: profile.optional(),
17528
- scopes: z28.array(z28.string()).default([]),
17835
+ scopes: z29.array(z29.string()).default([]),
17529
17836
  createdAt: isoTime.nullable().optional(),
17530
17837
  lastUsedAt: isoTime.nullable().optional(),
17531
17838
  /** When the credential expires if it is not used again; null for sessions. */
17532
17839
  idleExpiresAt: isoTime.nullable().optional()
17533
17840
  });
17534
- var nexusCloudDeviceSchema = z28.object({
17535
- deviceId: z28.string(),
17536
- name: z28.string(),
17537
- platform: z28.string().optional(),
17538
- arch: z28.string().nullable().optional(),
17539
- cliVersion: z28.string().nullable().optional(),
17841
+ var nexusCloudDeviceSchema = z29.object({
17842
+ deviceId: z29.string(),
17843
+ name: z29.string(),
17844
+ platform: z29.string().optional(),
17845
+ arch: z29.string().nullable().optional(),
17846
+ cliVersion: z29.string().nullable().optional(),
17540
17847
  createdAt: isoTime.optional(),
17541
17848
  lastSeenAt: isoTime.nullable().optional(),
17542
17849
  state: deviceState,
17543
17850
  signedOutAt: isoTime.nullable().optional(),
17544
17851
  /** Base64 device certificate; null until the device holds a key grant. */
17545
- certificate: z28.string().nullable().optional(),
17852
+ certificate: z29.string().nullable().optional(),
17546
17853
  /** The current credential's profile, or null with none (signed out or revoked). */
17547
17854
  profile: profile.optional(),
17548
17855
  /** True for the device whose credential made this request. */
17549
- current: z28.boolean().default(false),
17550
- projects: z28.number().int().nonnegative().optional(),
17551
- replicas: z28.number().int().nonnegative().optional(),
17856
+ current: z29.boolean().default(false),
17857
+ projects: z29.number().int().nonnegative().optional(),
17858
+ replicas: z29.number().int().nonnegative().optional(),
17552
17859
  lastSyncAt: isoTime.nullable().optional(),
17553
17860
  lastPresenceAt: isoTime.nullable().optional()
17554
17861
  });
17555
- var nexusCloudOrganizationSchema = z28.object({
17556
- id: z28.string(),
17557
- name: z28.string(),
17558
- slug: z28.string().nullable().optional(),
17559
- role: z28.string().optional(),
17560
- personal: z28.boolean().optional()
17862
+ var nexusCloudOrganizationSchema = z29.object({
17863
+ id: z29.string(),
17864
+ name: z29.string(),
17865
+ slug: z29.string().nullable().optional(),
17866
+ role: z29.string().optional(),
17867
+ personal: z29.boolean().optional()
17561
17868
  });
17562
- var nexusCloudUserSchema = z28.object({
17563
- id: z28.string(),
17564
- email: z28.string(),
17565
- name: z28.string().nullable().optional()
17869
+ var nexusCloudUserSchema = z29.object({
17870
+ id: z29.string(),
17871
+ email: z29.string(),
17872
+ name: z29.string().nullable().optional()
17566
17873
  });
17567
- var nexusCloudWhoamiSchema = z28.object({
17874
+ var nexusCloudWhoamiSchema = z29.object({
17568
17875
  serverTime: isoTime.optional(),
17569
17876
  user: nexusCloudUserSchema,
17570
- organizations: z28.array(nexusCloudOrganizationSchema).default([]),
17877
+ organizations: z29.array(nexusCloudOrganizationSchema).default([]),
17571
17878
  credential: nexusCloudCredentialSchema,
17572
17879
  /** The calling device; null for a session caller. */
17573
17880
  device: nexusCloudDeviceSchema.nullable()
17574
17881
  });
17575
- var nexusCloudDevicePageSchema = z28.object({
17576
- devices: z28.array(nexusCloudDeviceSchema),
17577
- nextCursor: z28.string().max(512).nullable().default(null),
17578
- truncated: z28.boolean().default(false)
17882
+ var nexusCloudDevicePageSchema = z29.object({
17883
+ devices: z29.array(nexusCloudDeviceSchema),
17884
+ nextCursor: z29.string().max(512).nullable().default(null),
17885
+ truncated: z29.boolean().default(false)
17579
17886
  });
17580
- var nexusCloudPresenceSchema = z28.looseObject({
17887
+ var nexusCloudPresenceSchema = z29.looseObject({
17581
17888
  observedAt: isoTime.optional(),
17582
- sync: z28.object({ enabled: z28.boolean() }).optional()
17889
+ sync: z29.object({ enabled: z29.boolean() }).optional()
17583
17890
  });
17584
- var nexusCloudReplicaSchema = z28.object({
17585
- projectId: z28.string(),
17586
- replicaId: z28.string(),
17587
- deviceId: z28.string(),
17588
- deviceName: z28.string(),
17891
+ var nexusCloudReplicaSchema = z29.object({
17892
+ projectId: z29.string(),
17893
+ replicaId: z29.string(),
17894
+ deviceId: z29.string(),
17895
+ deviceName: z29.string(),
17589
17896
  deviceState: deviceState.optional(),
17590
17897
  attachedAt: isoTime.optional(),
17591
17898
  lastSyncAt: isoTime.nullable(),
@@ -17594,72 +17901,72 @@ var nexusCloudReplicaSchema = z28.object({
17594
17901
  /** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
17595
17902
  retiredAt: isoTime.nullable().optional(),
17596
17903
  /** The retired replica's named successor, else null (not retired, or retired with none). */
17597
- successor: z28.string().nullable().optional()
17904
+ successor: z29.string().nullable().optional()
17598
17905
  });
17599
- var nexusCloudDeviceCountsSchema = z28.object({
17600
- active: z28.number().int().nonnegative(),
17601
- total: z28.number().int().nonnegative()
17906
+ var nexusCloudDeviceCountsSchema = z29.object({
17907
+ active: z29.number().int().nonnegative(),
17908
+ total: z29.number().int().nonnegative()
17602
17909
  });
17603
17910
  var projectFields = {
17604
- projectId: z28.string(),
17605
- label: z28.string().nullable(),
17606
- organizationId: z28.string(),
17607
- organizationName: z28.string().optional(),
17608
- remoteUrl: z28.string().nullable().optional(),
17911
+ projectId: z29.string(),
17912
+ label: z29.string().nullable(),
17913
+ organizationId: z29.string(),
17914
+ organizationName: z29.string().optional(),
17915
+ remoteUrl: z29.string().nullable().optional(),
17609
17916
  createdAt: isoTime.optional()
17610
17917
  };
17611
- var nexusCloudProjectListItemSchema = z28.object({
17918
+ var nexusCloudProjectListItemSchema = z29.object({
17612
17919
  ...projectFields,
17613
- role: z28.string(),
17920
+ role: z29.string(),
17614
17921
  /**
17615
17922
  * The project name sealed with the project data key (`Project.encryptedName`), base64;
17616
17923
  * only a holder of the account key can open it (T13102).
17617
17924
  */
17618
- encryptedName: z28.string().nullable().optional(),
17619
- streamId: z28.string().optional(),
17620
- headSeq: z28.number().int().nonnegative().nullable().optional(),
17925
+ encryptedName: z29.string().nullable().optional(),
17926
+ streamId: z29.string().optional(),
17927
+ headSeq: z29.number().int().nonnegative().nullable().optional(),
17621
17928
  /** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
17622
- headCheckpointId: z28.string().nullable().optional(),
17623
- openConflicts: z28.number().int().nonnegative().optional(),
17624
- replicas: z28.array(nexusCloudReplicaSchema).default([]),
17929
+ headCheckpointId: z29.string().nullable().optional(),
17930
+ openConflicts: z29.number().int().nonnegative().optional(),
17931
+ replicas: z29.array(nexusCloudReplicaSchema).default([]),
17625
17932
  devices: nexusCloudDeviceCountsSchema.optional(),
17626
- replicaCount: z28.number().int().nonnegative().optional(),
17933
+ replicaCount: z29.number().int().nonnegative().optional(),
17627
17934
  lastSyncAt: isoTime.nullable().optional(),
17628
17935
  lastPresenceAt: isoTime.nullable().optional(),
17629
17936
  /** This project's replica list was cut at 50 (T12858). */
17630
- replicasTruncated: z28.boolean().default(false)
17937
+ replicasTruncated: z29.boolean().default(false)
17631
17938
  });
17632
- var nexusCloudProjectPageSchema = z28.object({
17633
- projects: z28.array(nexusCloudProjectListItemSchema),
17634
- nextCursor: z28.string().max(512).nullable().default(null),
17939
+ var nexusCloudProjectPageSchema = z29.object({
17940
+ projects: z29.array(nexusCloudProjectListItemSchema),
17941
+ nextCursor: z29.string().max(512).nullable().default(null),
17635
17942
  /** Anything in the page was cut (the project list or a replica list). */
17636
- truncated: z28.boolean().default(false),
17943
+ truncated: z29.boolean().default(false),
17637
17944
  /** The project list itself was cut at 1000 (T12858). */
17638
- projectsTruncated: z28.boolean().default(false)
17945
+ projectsTruncated: z29.boolean().default(false)
17639
17946
  });
17640
- var nexusCloudProjectDetailSchema = z28.object({
17641
- project: z28.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
17642
- role: z28.string(),
17643
- canTrash: z28.boolean().optional(),
17644
- openConflicts: z28.number().int().nonnegative(),
17947
+ var nexusCloudProjectDetailSchema = z29.object({
17948
+ project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
17949
+ role: z29.string(),
17950
+ canTrash: z29.boolean().optional(),
17951
+ openConflicts: z29.number().int().nonnegative(),
17645
17952
  /** At most 50, oldest attachment first. */
17646
- replicas: z28.array(nexusCloudReplicaSchema),
17953
+ replicas: z29.array(nexusCloudReplicaSchema),
17647
17954
  devices: nexusCloudDeviceCountsSchema,
17648
- replicaCount: z28.number().int().nonnegative().optional(),
17955
+ replicaCount: z29.number().int().nonnegative().optional(),
17649
17956
  lastSyncAt: isoTime.nullable().optional(),
17650
17957
  /** `replicas` was cut at 50. */
17651
- truncated: z28.boolean().default(false),
17652
- stream: z28.object({
17653
- streamId: z28.string(),
17654
- headSeq: z28.number().int().nonnegative(),
17655
- headCheckpointId: z28.string().nullable()
17958
+ truncated: z29.boolean().default(false),
17959
+ stream: z29.object({
17960
+ streamId: z29.string(),
17961
+ headSeq: z29.number().int().nonnegative(),
17962
+ headCheckpointId: z29.string().nullable()
17656
17963
  }).nullable()
17657
17964
  });
17658
- var nexusCloudReplicaPageSchema = z28.object({
17659
- replicas: z28.array(nexusCloudReplicaSchema),
17965
+ var nexusCloudReplicaPageSchema = z29.object({
17966
+ replicas: z29.array(nexusCloudReplicaSchema),
17660
17967
  devices: nexusCloudDeviceCountsSchema.optional(),
17661
- nextCursor: z28.string().max(512).nullable().default(null),
17662
- truncated: z28.boolean().default(false)
17968
+ nextCursor: z29.string().max(512).nullable().default(null),
17969
+ truncated: z29.boolean().default(false)
17663
17970
  });
17664
17971
  var NEXUS_STATUS_CHECK_IDS = [
17665
17972
  "credential.valid",
@@ -17675,56 +17982,56 @@ var NEXUS_STATUS_CHECK_IDS = [
17675
17982
  ];
17676
17983
  var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
17677
17984
  var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
17678
- var knownCheckId = z28.enum(NEXUS_STATUS_CHECK_IDS);
17679
- var nexusCloudStatusCheckSchema = z28.object({
17680
- id: z28.enum(NEXUS_STATUS_CHECK_IDS),
17681
- ok: z28.boolean(),
17682
- required: z28.boolean(),
17683
- detail: z28.string()
17985
+ var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
17986
+ var nexusCloudStatusCheckSchema = z29.object({
17987
+ id: z29.enum(NEXUS_STATUS_CHECK_IDS),
17988
+ ok: z29.boolean(),
17989
+ required: z29.boolean(),
17990
+ detail: z29.string()
17684
17991
  });
17685
- var nexusCloudStatusSchema = z28.object({
17992
+ var nexusCloudStatusSchema = z29.object({
17686
17993
  serverTime: isoTime.optional(),
17687
- apiVersion: z28.string().optional(),
17994
+ apiVersion: z29.string().optional(),
17688
17995
  /**
17689
17996
  * Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
17690
17997
  * than the list, which therefore support none of them.
17691
17998
  */
17692
- features: z28.array(z28.string()).optional(),
17999
+ features: z29.array(z29.string()).optional(),
17693
18000
  user: nexusCloudUserSchema,
17694
18001
  credential: nexusCloudCredentialSchema,
17695
18002
  device: nexusCloudDeviceSchema.nullable(),
17696
- project: z28.object({
17697
- projectId: z28.string(),
17698
- registered: z28.boolean(),
17699
- organizationId: z28.string().nullable(),
17700
- organizationName: z28.string().nullable(),
17701
- role: z28.string().nullable()
18003
+ project: z29.object({
18004
+ projectId: z29.string(),
18005
+ registered: z29.boolean(),
18006
+ organizationId: z29.string().nullable(),
18007
+ organizationName: z29.string().nullable(),
18008
+ role: z29.string().nullable()
17702
18009
  }).nullable(),
17703
- replica: z28.object({
17704
- replicaId: z28.string(),
17705
- attached: z28.boolean(),
17706
- attachedElsewhere: z28.boolean(),
18010
+ replica: z29.object({
18011
+ replicaId: z29.string(),
18012
+ attached: z29.boolean(),
18013
+ attachedElsewhere: z29.boolean(),
17707
18014
  attachedAt: isoTime.nullable(),
17708
18015
  lastSyncAt: isoTime.nullable(),
17709
18016
  presenceAt: isoTime.nullable(),
17710
- lastReplicaSeq: z28.number().int().nonnegative().nullable().optional()
18017
+ lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
17711
18018
  }).nullable(),
17712
- stream: z28.object({
17713
- streamId: z28.string(),
17714
- headSeq: z28.number().int().nonnegative(),
17715
- headCheckpointId: z28.string().nullable(),
17716
- openConflicts: z28.number().int().nonnegative(),
18019
+ stream: z29.object({
18020
+ streamId: z29.string(),
18021
+ headSeq: z29.number().int().nonnegative(),
18022
+ headCheckpointId: z29.string().nullable(),
18023
+ openConflicts: z29.number().int().nonnegative(),
17717
18024
  devices: nexusCloudDeviceCountsSchema
17718
18025
  }).nullable(),
17719
18026
  /** Check ids added by a newer server are dropped, never a parse failure. */
17720
- checks: z28.array(nexusCloudStatusCheckSchema.extend({ id: z28.string() })).transform(
18027
+ checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
17721
18028
  (list) => list.flatMap((c) => {
17722
18029
  const id = knownCheckId.safeParse(c.id);
17723
18030
  return id.success ? [{ ...c, id: id.data }] : [];
17724
18031
  })
17725
18032
  ),
17726
18033
  /** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
17727
- verdict: z28.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18034
+ verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
17728
18035
  });
17729
18036
  var LOGIN = "run `cleo login nexus`";
17730
18037
  var SESSION_EXPIRED_LOGIN = {
@@ -17769,50 +18076,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
17769
18076
  };
17770
18077
 
17771
18078
  // packages/contracts/src/nexus-vault.ts
17772
- import { z as z29 } from "zod";
17773
- var isoTime2 = z29.iso.datetime({ offset: true });
17774
- 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);
17775
- var nexusUserKeysSchema = z29.looseObject({
17776
- keyVersion: z29.number().int().positive(),
17777
- masterKeyVerifier: z29.string()
18079
+ import { z as z30 } from "zod";
18080
+ var isoTime2 = z30.iso.datetime({ offset: true });
18081
+ 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);
18082
+ var nexusUserKeysSchema = z30.looseObject({
18083
+ keyVersion: z30.number().int().positive(),
18084
+ masterKeyVerifier: z30.string()
17778
18085
  });
17779
- var nexusProjectKeysSchema = z29.looseObject({
17780
- keys: z29.array(
17781
- z29.looseObject({ wrappedProjectKey: z29.string(), keyVersion: z29.number().int().positive() })
18086
+ var nexusProjectKeysSchema = z30.looseObject({
18087
+ keys: z30.array(
18088
+ z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
17782
18089
  )
17783
18090
  });
17784
- var nexusLeaseSchema = z29.looseObject({
17785
- streamId: z29.string(),
17786
- role: z29.string(),
18091
+ var nexusLeaseSchema = z30.looseObject({
18092
+ streamId: z30.string(),
18093
+ role: z30.string(),
17787
18094
  replicaId: uuid,
17788
18095
  expiresAt: isoTime2,
17789
18096
  forkedFromReplicaId: uuid.nullable().optional()
17790
18097
  });
17791
- var nexusLeaseAcquireSchema = z29.looseObject({ lease: nexusLeaseSchema });
17792
- var nexusStreamHeadSchema = z29.looseObject({
17793
- streamId: z29.string(),
17794
- kind: z29.string().optional(),
17795
- headSeq: z29.number().int().nonnegative(),
17796
- headCheckpointId: z29.string().nullable(),
18098
+ var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
18099
+ var nexusStreamHeadSchema = z30.looseObject({
18100
+ streamId: z30.string(),
18101
+ kind: z30.string().optional(),
18102
+ headSeq: z30.number().int().nonnegative(),
18103
+ headCheckpointId: z30.string().nullable(),
17797
18104
  /**
17798
18105
  * The highest segment `schemaVersion` the stream holds (the server raises it on every append).
17799
18106
  * Absent from an older server.
17800
18107
  */
17801
- maxSchemaVersion: z29.number().int().nonnegative().optional()
18108
+ maxSchemaVersion: z30.number().int().nonnegative().optional()
17802
18109
  });
17803
- var nexusActivityEventSchema = z29.looseObject({
17804
- id: z29.union([z29.string(), z29.number()]),
18110
+ var nexusActivityEventSchema = z30.looseObject({
18111
+ id: z30.union([z30.string(), z30.number()]),
17805
18112
  at: isoTime2,
17806
- actorUserId: z29.string().nullable().optional(),
17807
- actorDeviceId: z29.string().nullable().optional(),
17808
- requestId: z29.string().nullable().optional(),
17809
- action: z29.string(),
17810
- target: z29.string().nullable().optional(),
17811
- detail: z29.unknown().optional()
18113
+ actorUserId: z30.string().nullable().optional(),
18114
+ actorDeviceId: z30.string().nullable().optional(),
18115
+ requestId: z30.string().nullable().optional(),
18116
+ action: z30.string(),
18117
+ target: z30.string().nullable().optional(),
18118
+ detail: z30.unknown().optional()
17812
18119
  });
17813
- var nexusActivityPageSchema = z29.looseObject({
17814
- events: z29.array(nexusActivityEventSchema),
17815
- nextBefore: z29.union([z29.string(), z29.number()]).nullable().optional()
18120
+ var nexusActivityPageSchema = z30.looseObject({
18121
+ events: z30.array(nexusActivityEventSchema),
18122
+ nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
17816
18123
  });
17817
18124
 
17818
18125
  // packages/adapters/src/providers/pi/spawn.ts