@cleocode/adapters 2026.5.130 → 2026.5.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -970,6 +970,240 @@ var init_credentials = __esm({
970
970
  }
971
971
  });
972
972
 
973
+ // packages/contracts/src/supervisor-ipc/messages.ts
974
+ import { z as z5 } from "zod";
975
+ var EnvPairSchema, ChildStateSchema, ChildStatusSchema, SpawnRequestSchema, RestartRequestSchema, MonitorRequestSchema, HealthRequestSchema, SupervisorIpcRequestSchema, SpawnedResponseSchema, RestartedResponseSchema, MonitorResponseSchema, HealthResponseSchema, LifecycleEventKindSchema, LifecycleEventResponseSchema, ErrorResponseSchema, SupervisorIpcResponseSchema, SupervisorIpcRequestEnvelopeSchema, SupervisorIpcResponseEnvelopeSchema, SupervisorIpcEnvelopeSchema, SUPERVISOR_IPC_REQUEST_KINDS, SUPERVISOR_IPC_RESPONSE_KINDS, SUPERVISOR_IPC_MESSAGE_KINDS;
976
+ var init_messages = __esm({
977
+ "packages/contracts/src/supervisor-ipc/messages.ts"() {
978
+ "use strict";
979
+ EnvPairSchema = z5.object({
980
+ /** Environment variable name. */
981
+ key: z5.string().min(1),
982
+ /** Environment variable value. */
983
+ value: z5.string()
984
+ }).strict();
985
+ ChildStateSchema = z5.enum(["running", "restarting", "stopped"]);
986
+ ChildStatusSchema = z5.object({
987
+ /** Logical id of the child (stable across restarts). */
988
+ child_id: z5.string().min(1),
989
+ /** Current OS pid (0 when not currently running). */
990
+ pid: z5.number().int().nonnegative(),
991
+ /** Current liveness state. */
992
+ state: ChildStateSchema,
993
+ /** Total restarts observed for this child. */
994
+ restart_count: z5.number().int().nonnegative()
995
+ }).strict();
996
+ SpawnRequestSchema = z5.object({
997
+ /** Tag discriminating this request variant. */
998
+ kind: z5.literal("spawn"),
999
+ /** Caller-chosen logical id for the child (stable across restarts). */
1000
+ child_id: z5.string().min(1),
1001
+ /** Absolute path to the program to execute. */
1002
+ program: z5.string().min(1),
1003
+ /** Arguments passed to the program. */
1004
+ args: z5.array(z5.string()).default([]),
1005
+ /** Environment overrides applied on top of the supervisor's environment. */
1006
+ env: z5.array(EnvPairSchema).default([]),
1007
+ /** Optional working directory for the child. */
1008
+ cwd: z5.string().optional()
1009
+ }).strict();
1010
+ RestartRequestSchema = z5.object({
1011
+ /** Tag discriminating this request variant. */
1012
+ kind: z5.literal("restart"),
1013
+ /** Logical id of the child to restart. */
1014
+ child_id: z5.string().min(1)
1015
+ }).strict();
1016
+ MonitorRequestSchema = z5.object({
1017
+ /** Tag discriminating this request variant. */
1018
+ kind: z5.literal("monitor"),
1019
+ /** Specific child id to monitor; omit to request all children. */
1020
+ child_id: z5.string().optional()
1021
+ }).strict();
1022
+ HealthRequestSchema = z5.object({
1023
+ /** Tag discriminating this request variant. */
1024
+ kind: z5.literal("health")
1025
+ }).strict();
1026
+ SupervisorIpcRequestSchema = z5.discriminatedUnion("kind", [
1027
+ SpawnRequestSchema,
1028
+ RestartRequestSchema,
1029
+ MonitorRequestSchema,
1030
+ HealthRequestSchema
1031
+ ]);
1032
+ SpawnedResponseSchema = z5.object({
1033
+ /** Tag discriminating this response variant. */
1034
+ kind: z5.literal("spawned"),
1035
+ /** Logical id of the spawned child. */
1036
+ child_id: z5.string().min(1),
1037
+ /** OS pid assigned to the spawned child. */
1038
+ pid: z5.number().int().nonnegative()
1039
+ }).strict();
1040
+ RestartedResponseSchema = z5.object({
1041
+ /** Tag discriminating this response variant. */
1042
+ kind: z5.literal("restarted"),
1043
+ /** Logical id of the restarted child. */
1044
+ child_id: z5.string().min(1),
1045
+ /** New OS pid after the restart. */
1046
+ pid: z5.number().int().nonnegative(),
1047
+ /** Number of times this child has been restarted in total. */
1048
+ restart_count: z5.number().int().nonnegative()
1049
+ }).strict();
1050
+ MonitorResponseSchema = z5.object({
1051
+ /** Tag discriminating this response variant. */
1052
+ kind: z5.literal("monitor"),
1053
+ /** One row per monitored child. */
1054
+ children: z5.array(ChildStatusSchema)
1055
+ }).strict();
1056
+ HealthResponseSchema = z5.object({
1057
+ /** Tag discriminating this response variant. */
1058
+ kind: z5.literal("health"),
1059
+ /** Supervisor process pid. */
1060
+ pid: z5.number().int().nonnegative(),
1061
+ /** Number of children currently tracked. */
1062
+ child_count: z5.number().int().nonnegative(),
1063
+ /** Seconds the supervisor has been running. */
1064
+ uptime_secs: z5.number().int().nonnegative(),
1065
+ /** Frozen protocol version the supervisor speaks. */
1066
+ protocol_version: z5.string()
1067
+ }).strict();
1068
+ LifecycleEventKindSchema = z5.enum(["child_exited", "child_restarted"]);
1069
+ LifecycleEventResponseSchema = z5.object({
1070
+ /** Tag discriminating this response variant. */
1071
+ kind: z5.literal("event"),
1072
+ /** What happened. */
1073
+ event: LifecycleEventKindSchema,
1074
+ /** Logical id of the affected child. */
1075
+ child_id: z5.string().min(1),
1076
+ /** Exit code, when the OS reported one. */
1077
+ exit_code: z5.number().int().optional(),
1078
+ /** Terminating signal name, when the child was signalled (Unix). */
1079
+ signal: z5.string().optional(),
1080
+ /** Backoff delay (ms) before the pending restart, when applicable. */
1081
+ restart_delay_ms: z5.number().int().nonnegative().optional()
1082
+ }).strict();
1083
+ ErrorResponseSchema = z5.object({
1084
+ /** Tag discriminating this response variant. */
1085
+ kind: z5.literal("error"),
1086
+ /** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
1087
+ code: z5.string().min(1),
1088
+ /** Human-readable error message. */
1089
+ message: z5.string()
1090
+ }).strict();
1091
+ SupervisorIpcResponseSchema = z5.discriminatedUnion("kind", [
1092
+ SpawnedResponseSchema,
1093
+ RestartedResponseSchema,
1094
+ MonitorResponseSchema,
1095
+ HealthResponseSchema,
1096
+ LifecycleEventResponseSchema,
1097
+ ErrorResponseSchema
1098
+ ]);
1099
+ SupervisorIpcRequestEnvelopeSchema = z5.object({
1100
+ /** Frozen protocol version. */
1101
+ protocol_version: z5.string(),
1102
+ /** Correlation id echoed back on the matching response. */
1103
+ id: z5.string().min(1),
1104
+ /** Direction discriminator. */
1105
+ direction: z5.literal("request"),
1106
+ /** The request body. */
1107
+ request: SupervisorIpcRequestSchema
1108
+ }).strict();
1109
+ SupervisorIpcResponseEnvelopeSchema = z5.object({
1110
+ /** Frozen protocol version. */
1111
+ protocol_version: z5.string(),
1112
+ /** Correlation id echoed from the originating request (or a fresh id for events). */
1113
+ id: z5.string().min(1),
1114
+ /** Direction discriminator. */
1115
+ direction: z5.literal("response"),
1116
+ /** The response body. */
1117
+ response: SupervisorIpcResponseSchema
1118
+ }).strict();
1119
+ SupervisorIpcEnvelopeSchema = z5.discriminatedUnion("direction", [
1120
+ SupervisorIpcRequestEnvelopeSchema,
1121
+ SupervisorIpcResponseEnvelopeSchema
1122
+ ]);
1123
+ SUPERVISOR_IPC_REQUEST_KINDS = ["spawn", "restart", "monitor", "health"];
1124
+ SUPERVISOR_IPC_RESPONSE_KINDS = [
1125
+ "spawned",
1126
+ "restarted",
1127
+ "monitor",
1128
+ "health",
1129
+ "event",
1130
+ "error"
1131
+ ];
1132
+ SUPERVISOR_IPC_MESSAGE_KINDS = [
1133
+ ...SUPERVISOR_IPC_REQUEST_KINDS,
1134
+ ...SUPERVISOR_IPC_RESPONSE_KINDS
1135
+ ];
1136
+ }
1137
+ });
1138
+
1139
+ // packages/contracts/src/daemon/health.ts
1140
+ import { z as z6 } from "zod";
1141
+ var SubsystemHealthSchema, HealthStatusSchema;
1142
+ var init_health = __esm({
1143
+ "packages/contracts/src/daemon/health.ts"() {
1144
+ "use strict";
1145
+ init_messages();
1146
+ SubsystemHealthSchema = ChildStatusSchema.extend({
1147
+ /**
1148
+ * Optional human-readable detail (e.g. last error message, queue depth).
1149
+ * Diagnostic only — not part of the supervisor wire contract.
1150
+ */
1151
+ detail: z6.string().optional()
1152
+ }).strict();
1153
+ HealthStatusSchema = z6.object({
1154
+ /** One health row per registered subsystem. */
1155
+ subsystems: z6.array(SubsystemHealthSchema),
1156
+ /**
1157
+ * `true` iff every subsystem is in the `running` state. A convenience roll-up
1158
+ * derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
1159
+ * {@link summarizeHealth} so producers cannot desync it.
1160
+ */
1161
+ allHealthy: z6.boolean()
1162
+ }).strict();
1163
+ }
1164
+ });
1165
+
1166
+ // packages/contracts/src/daemon/subsystem.ts
1167
+ var init_subsystem = __esm({
1168
+ "packages/contracts/src/daemon/subsystem.ts"() {
1169
+ "use strict";
1170
+ }
1171
+ });
1172
+
1173
+ // packages/contracts/src/daemon/index.ts
1174
+ var init_daemon = __esm({
1175
+ "packages/contracts/src/daemon/index.ts"() {
1176
+ "use strict";
1177
+ init_health();
1178
+ init_subsystem();
1179
+ }
1180
+ });
1181
+
1182
+ // packages/contracts/src/supervisor-ipc/version.ts
1183
+ var init_version = __esm({
1184
+ "packages/contracts/src/supervisor-ipc/version.ts"() {
1185
+ "use strict";
1186
+ }
1187
+ });
1188
+
1189
+ // packages/contracts/src/supervisor-ipc/index.ts
1190
+ var init_supervisor_ipc = __esm({
1191
+ "packages/contracts/src/supervisor-ipc/index.ts"() {
1192
+ "use strict";
1193
+ init_messages();
1194
+ init_version();
1195
+ }
1196
+ });
1197
+
1198
+ // packages/contracts/src/daemon-ipc/index.ts
1199
+ var init_daemon_ipc = __esm({
1200
+ "packages/contracts/src/daemon-ipc/index.ts"() {
1201
+ "use strict";
1202
+ init_supervisor_ipc();
1203
+ init_version();
1204
+ }
1205
+ });
1206
+
973
1207
  // packages/contracts/src/db-inventory.json
974
1208
  var db_inventory_default;
975
1209
  var init_db_inventory = __esm({
@@ -998,7 +1232,7 @@ var init_db_inventory = __esm({
998
1232
  role: "brain",
999
1233
  tier: "project",
1000
1234
  filePathTemplate: "<projectRoot>/.cleo/brain.db",
1001
- drizzleSchemaPath: "packages/core/src/store/memory-schema.ts",
1235
+ drizzleSchemaPath: "packages/core/src/store/schema/memory-schema.ts",
1002
1236
  migrationsDir: "packages/core/migrations/drizzle-brain/",
1003
1237
  ownerPackage: "@cleocode/brain",
1004
1238
  openedVia: "openCleoDb('brain', cwd)",
@@ -1011,7 +1245,7 @@ var init_db_inventory = __esm({
1011
1245
  role: "conduit",
1012
1246
  tier: "project",
1013
1247
  filePathTemplate: "<projectRoot>/.cleo/conduit.db",
1014
- drizzleSchemaPath: "packages/core/src/store/conduit-schema.ts",
1248
+ drizzleSchemaPath: "packages/core/src/store/schema/conduit-schema.ts",
1015
1249
  migrationsDir: "packages/core/migrations/drizzle-conduit/",
1016
1250
  ownerPackage: "@cleocode/core",
1017
1251
  openedVia: "openCleoDb('conduit', cwd)",
@@ -1050,7 +1284,7 @@ var init_db_inventory = __esm({
1050
1284
  role: "nexus",
1051
1285
  tier: "global",
1052
1286
  filePathTemplate: "$XDG_DATA_HOME/cleo/nexus.db",
1053
- drizzleSchemaPath: "packages/core/src/store/nexus-schema.ts",
1287
+ drizzleSchemaPath: "packages/core/src/store/schema/nexus-schema.ts",
1054
1288
  migrationsDir: "packages/core/migrations/drizzle-nexus/",
1055
1289
  ownerPackage: "@cleocode/core",
1056
1290
  openedVia: "openCleoDb('nexus')",
@@ -1063,7 +1297,7 @@ var init_db_inventory = __esm({
1063
1297
  role: "signaldock-project",
1064
1298
  tier: "project",
1065
1299
  filePathTemplate: "<projectRoot>/.cleo/signaldock.db",
1066
- drizzleSchemaPath: "packages/core/src/store/signaldock-schema.ts",
1300
+ drizzleSchemaPath: "packages/core/src/store/schema/signaldock-schema.ts",
1067
1301
  migrationsDir: "packages/core/migrations/drizzle-signaldock/",
1068
1302
  ownerPackage: "@cleocode/core",
1069
1303
  openedVia: "HISTORICAL \u2014 project-tier signaldock.db was migrated into conduit.db post-T310/ADR-037. No live opener; charter row retained for migration provenance and legacy backup detection.",
@@ -1076,7 +1310,7 @@ var init_db_inventory = __esm({
1076
1310
  role: "signaldock-global",
1077
1311
  tier: "global",
1078
1312
  filePathTemplate: "$XDG_DATA_HOME/cleo/signaldock.db",
1079
- drizzleSchemaPath: "packages/core/src/store/signaldock-schema.ts",
1313
+ drizzleSchemaPath: "packages/core/src/store/schema/signaldock-schema.ts",
1080
1314
  migrationsDir: "packages/core/migrations/drizzle-signaldock/",
1081
1315
  ownerPackage: "@cleocode/core",
1082
1316
  openedVia: "openCleoDb('signaldock')",
@@ -1089,7 +1323,7 @@ var init_db_inventory = __esm({
1089
1323
  role: "telemetry",
1090
1324
  tier: "global",
1091
1325
  filePathTemplate: "$XDG_DATA_HOME/cleo/telemetry.db",
1092
- drizzleSchemaPath: "packages/core/src/telemetry/schema.ts",
1326
+ drizzleSchemaPath: "packages/core/src/store/schema/telemetry-schema.ts",
1093
1327
  migrationsDir: "packages/core/migrations/drizzle-telemetry/",
1094
1328
  ownerPackage: "@cleocode/core",
1095
1329
  openedVia: "@cleocode/core telemetry/sqlite.ts \u2014 lazy open on first event when opted-in; not yet registered as openCleoDb role",
@@ -1102,7 +1336,7 @@ var init_db_inventory = __esm({
1102
1336
  role: "skills",
1103
1337
  tier: "global",
1104
1338
  filePathTemplate: "$XDG_DATA_HOME/cleo/skills.db",
1105
- drizzleSchemaPath: "packages/core/src/store/skills-schema.ts",
1339
+ drizzleSchemaPath: "packages/core/src/store/schema/skills-schema.ts",
1106
1340
  migrationsDir: "packages/core/migrations/drizzle-skills/",
1107
1341
  ownerPackage: "@cleocode/core",
1108
1342
  openedVia: "openCleoDb('skills')",
@@ -1115,7 +1349,7 @@ var init_db_inventory = __esm({
1115
1349
  role: "global-brain",
1116
1350
  tier: "global",
1117
1351
  filePathTemplate: "$XDG_DATA_HOME/cleo/brain.db",
1118
- drizzleSchemaPath: "packages/core/src/store/memory-schema.ts",
1352
+ drizzleSchemaPath: "packages/core/src/store/schema/memory-schema.ts",
1119
1353
  migrationsDir: "packages/core/migrations/drizzle-brain/",
1120
1354
  ownerPackage: "@cleocode/brain",
1121
1355
  openedVia: "UNREGISTERED \u2014 file exists on disk (audit \xA71.2 row 3) but no live opener. Provenance unclear; likely orphan from a getCleoHome()-vs-project-resolution path bug. Tracked for cleanup decision under T10282/T10307.",
@@ -8671,6 +8905,20 @@ var init_operations_registry = __esm({
8671
8905
  // in the DomainHandler map) but absent from OPERATIONS, making them invisible
8672
8906
  // to public SDK consumers using @cleocode/core. Adding all 10 ops here.
8673
8907
  // ---------------------------------------------------------------------------
8908
+ // sentient query: status (T11448 — exposed over MCP; mirrors the standalone
8909
+ // mcp-adapter `cleo_sentient_status` tool + the `cleo sentient status` CLI op).
8910
+ {
8911
+ gateway: "query",
8912
+ domain: "sentient",
8913
+ operation: "status",
8914
+ description: "sentient.status (query) \u2014 daemon state, kill-switch status, Tier-2 enabled flag, and proposal statistics",
8915
+ tier: 2,
8916
+ idempotent: true,
8917
+ sessionRequired: false,
8918
+ requiredParams: [],
8919
+ params: [],
8920
+ mcpExposed: true
8921
+ },
8674
8922
  // sentient query: propose.list
8675
8923
  {
8676
8924
  gateway: "query",
@@ -8688,7 +8936,8 @@ var init_operations_registry = __esm({
8688
8936
  required: false,
8689
8937
  description: "Maximum number of proposals to return (default: 50)"
8690
8938
  }
8691
- ]
8939
+ ],
8940
+ mcpExposed: true
8692
8941
  },
8693
8942
  // sentient query: propose.diff
8694
8943
  {
@@ -8790,7 +9039,8 @@ var init_operations_registry = __esm({
8790
9039
  idempotent: true,
8791
9040
  sessionRequired: false,
8792
9041
  requiredParams: [],
8793
- params: []
9042
+ params: [],
9043
+ mcpExposed: true
8794
9044
  },
8795
9045
  // sentient mutate: propose.disable
8796
9046
  {
@@ -9628,6 +9878,118 @@ var init_operations_registry = __esm({
9628
9878
  ]
9629
9879
  },
9630
9880
  // ---------------------------------------------------------------------------
9881
+ // T11373 — attention domain: Tier-2 scope-keyed working-memory jots (E2)
9882
+ // ---------------------------------------------------------------------------
9883
+ {
9884
+ gateway: "mutate",
9885
+ domain: "attention",
9886
+ operation: "add",
9887
+ description: "attention.add (mutate \xB7 alias jot) \u2014 record a scope-keyed working-memory jot. Session/agent identity + current task are auto-resolved from the environment (E0); the item keys to the narrowest scope (agent>task>epic>saga>session>global). No session/agent/task flags by default.",
9888
+ tier: 1,
9889
+ idempotent: false,
9890
+ sessionRequired: false,
9891
+ requiredParams: ["content"],
9892
+ params: [
9893
+ {
9894
+ name: "content",
9895
+ type: "string",
9896
+ required: true,
9897
+ description: "The jot content",
9898
+ cli: { positional: true }
9899
+ },
9900
+ {
9901
+ name: "tags",
9902
+ type: "array",
9903
+ required: false,
9904
+ description: "Tags to attach (comma-separated on the CLI)"
9905
+ },
9906
+ {
9907
+ name: "scope",
9908
+ type: "string",
9909
+ required: false,
9910
+ description: "Explicit scope escalation: agent|task|epic|saga|session|global (default: narrowest)"
9911
+ },
9912
+ {
9913
+ name: "ttlSeconds",
9914
+ type: "number",
9915
+ required: false,
9916
+ description: "Optional time-to-live in seconds (sets expires_at)"
9917
+ }
9918
+ ]
9919
+ },
9920
+ {
9921
+ gateway: "query",
9922
+ domain: "attention",
9923
+ operation: "list",
9924
+ description: "attention.list (query) \u2014 list open working-memory jots visible to the calling agent across its resolved scope chain. Optional --scope / --tag filters.",
9925
+ tier: 1,
9926
+ idempotent: true,
9927
+ sessionRequired: false,
9928
+ requiredParams: [],
9929
+ params: [
9930
+ {
9931
+ name: "scope",
9932
+ type: "string",
9933
+ required: false,
9934
+ description: "Restrict to one scope kind: agent|task|epic|saga|session|global"
9935
+ },
9936
+ {
9937
+ name: "tags",
9938
+ type: "array",
9939
+ required: false,
9940
+ description: "Filter by tags (contains-ALL; comma-separated on the CLI)"
9941
+ },
9942
+ {
9943
+ name: "includeAll",
9944
+ type: "boolean",
9945
+ required: false,
9946
+ description: "Include non-open (consolidated/discarded) items too. Default: false"
9947
+ },
9948
+ {
9949
+ name: "limit",
9950
+ type: "number",
9951
+ required: false,
9952
+ description: "Maximum rows. Default: 50"
9953
+ }
9954
+ ]
9955
+ },
9956
+ {
9957
+ gateway: "query",
9958
+ domain: "attention",
9959
+ operation: "show",
9960
+ description: "attention.show (query) \u2014 synonym for attention.list; emits the open working-memory jots for the calling agent within token budget.",
9961
+ tier: 1,
9962
+ idempotent: true,
9963
+ sessionRequired: false,
9964
+ requiredParams: [],
9965
+ params: [
9966
+ {
9967
+ name: "scope",
9968
+ type: "string",
9969
+ required: false,
9970
+ description: "Restrict to one scope kind: agent|task|epic|saga|session|global"
9971
+ },
9972
+ {
9973
+ name: "tags",
9974
+ type: "array",
9975
+ required: false,
9976
+ description: "Filter by tags (contains-ALL; comma-separated on the CLI)"
9977
+ },
9978
+ {
9979
+ name: "includeAll",
9980
+ type: "boolean",
9981
+ required: false,
9982
+ description: "Include non-open items too. Default: false"
9983
+ },
9984
+ {
9985
+ name: "limit",
9986
+ type: "number",
9987
+ required: false,
9988
+ description: "Maximum rows. Default: 50"
9989
+ }
9990
+ ]
9991
+ },
9992
+ // ---------------------------------------------------------------------------
9631
9993
  // T10629 — tasks.context: bounded task-scoped context pack with token budget
9632
9994
  // ---------------------------------------------------------------------------
9633
9995
  {
@@ -9702,7 +10064,7 @@ var init_operations_registry = __esm({
9702
10064
  });
9703
10065
 
9704
10066
  // packages/contracts/src/docs/provenance.ts
9705
- import { z as z5 } from "zod";
10067
+ import { z as z7 } from "zod";
9706
10068
  var PROVENANCE_NODE_KINDS, PROVENANCE_EDGE_RELATIONS, DOC_LIFECYCLE_STATUSES, provenanceNodeKindSchema, provenanceEdgeRelationSchema, docLifecycleStatusSchema, provenanceNodeBaseFields, provenanceDocNodeSchema, provenanceTaskNodeSchema, provenanceDecisionNodeSchema, provenanceSessionNodeSchema, provenanceMemoryNodeSchema, provenanceNodeSchema, provenanceEdgeSchema, docProvenanceResponseSchema;
9707
10069
  var init_provenance = __esm({
9708
10070
  "packages/contracts/src/docs/provenance.ts"() {
@@ -9728,69 +10090,69 @@ var init_provenance = __esm({
9728
10090
  "archived",
9729
10091
  "draft"
9730
10092
  ];
9731
- provenanceNodeKindSchema = z5.enum(PROVENANCE_NODE_KINDS);
9732
- provenanceEdgeRelationSchema = z5.enum(PROVENANCE_EDGE_RELATIONS);
9733
- docLifecycleStatusSchema = z5.enum(DOC_LIFECYCLE_STATUSES);
10093
+ provenanceNodeKindSchema = z7.enum(PROVENANCE_NODE_KINDS);
10094
+ provenanceEdgeRelationSchema = z7.enum(PROVENANCE_EDGE_RELATIONS);
10095
+ docLifecycleStatusSchema = z7.enum(DOC_LIFECYCLE_STATUSES);
9734
10096
  provenanceNodeBaseFields = {
9735
- id: z5.string().min(1),
9736
- title: z5.string().min(1),
9737
- metadata: z5.record(z5.string(), z5.unknown()).optional()
10097
+ id: z7.string().min(1),
10098
+ title: z7.string().min(1),
10099
+ metadata: z7.record(z7.string(), z7.unknown()).optional()
9738
10100
  };
9739
- provenanceDocNodeSchema = z5.object({
10101
+ provenanceDocNodeSchema = z7.object({
9740
10102
  ...provenanceNodeBaseFields,
9741
- kind: z5.literal("doc"),
9742
- slug: z5.string().min(1),
9743
- docKind: z5.string().min(1),
10103
+ kind: z7.literal("doc"),
10104
+ slug: z7.string().min(1),
10105
+ docKind: z7.string().min(1),
9744
10106
  lifecycleStatus: docLifecycleStatusSchema,
9745
- publishedAt: z5.string().min(1),
9746
- supersededAt: z5.string().min(1).optional(),
9747
- summary: z5.string().optional()
10107
+ publishedAt: z7.string().min(1),
10108
+ supersededAt: z7.string().min(1).optional(),
10109
+ summary: z7.string().optional()
9748
10110
  });
9749
- provenanceTaskNodeSchema = z5.object({
10111
+ provenanceTaskNodeSchema = z7.object({
9750
10112
  ...provenanceNodeBaseFields,
9751
- kind: z5.literal("task"),
9752
- taskType: z5.enum(["saga", "epic", "task", "subtask"]),
9753
- status: z5.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
10113
+ kind: z7.literal("task"),
10114
+ taskType: z7.enum(["saga", "epic", "task", "subtask"]),
10115
+ status: z7.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
9754
10116
  });
9755
- provenanceDecisionNodeSchema = z5.object({
10117
+ provenanceDecisionNodeSchema = z7.object({
9756
10118
  ...provenanceNodeBaseFields,
9757
- kind: z5.literal("decision"),
9758
- outcome: z5.enum(["proposed", "accepted", "rejected", "superseded"]),
9759
- decidedAt: z5.string().min(1)
10119
+ kind: z7.literal("decision"),
10120
+ outcome: z7.enum(["proposed", "accepted", "rejected", "superseded"]),
10121
+ decidedAt: z7.string().min(1)
9760
10122
  });
9761
- provenanceSessionNodeSchema = z5.object({
10123
+ provenanceSessionNodeSchema = z7.object({
9762
10124
  ...provenanceNodeBaseFields,
9763
- kind: z5.literal("session"),
9764
- startedAt: z5.string().min(1),
9765
- endedAt: z5.string().min(1).optional()
10125
+ kind: z7.literal("session"),
10126
+ startedAt: z7.string().min(1),
10127
+ endedAt: z7.string().min(1).optional()
9766
10128
  });
9767
- provenanceMemoryNodeSchema = z5.object({
10129
+ provenanceMemoryNodeSchema = z7.object({
9768
10130
  ...provenanceNodeBaseFields,
9769
- kind: z5.literal("memory"),
9770
- memoryType: z5.enum(["observation", "pattern", "decision", "diary"]),
9771
- recordedAt: z5.string().min(1)
10131
+ kind: z7.literal("memory"),
10132
+ memoryType: z7.enum(["observation", "pattern", "decision", "diary"]),
10133
+ recordedAt: z7.string().min(1)
9772
10134
  });
9773
- provenanceNodeSchema = z5.discriminatedUnion("kind", [
10135
+ provenanceNodeSchema = z7.discriminatedUnion("kind", [
9774
10136
  provenanceDocNodeSchema,
9775
10137
  provenanceTaskNodeSchema,
9776
10138
  provenanceDecisionNodeSchema,
9777
10139
  provenanceSessionNodeSchema,
9778
10140
  provenanceMemoryNodeSchema
9779
10141
  ]);
9780
- provenanceEdgeSchema = z5.object({
10142
+ provenanceEdgeSchema = z7.object({
9781
10143
  relation: provenanceEdgeRelationSchema,
9782
- from: z5.string().min(1),
10144
+ from: z7.string().min(1),
9783
10145
  fromKind: provenanceNodeKindSchema,
9784
- to: z5.string().min(1),
10146
+ to: z7.string().min(1),
9785
10147
  toKind: provenanceNodeKindSchema,
9786
- addedAt: z5.string().min(1),
9787
- summary: z5.string().optional()
10148
+ addedAt: z7.string().min(1),
10149
+ summary: z7.string().optional()
9788
10150
  });
9789
- docProvenanceResponseSchema = z5.object({
9790
- nodes: z5.array(provenanceNodeSchema).readonly(),
9791
- edges: z5.array(provenanceEdgeSchema).readonly(),
9792
- totalNodes: z5.number().int().nonnegative(),
9793
- totalEdges: z5.number().int().nonnegative()
10151
+ docProvenanceResponseSchema = z7.object({
10152
+ nodes: z7.array(provenanceNodeSchema).readonly(),
10153
+ edges: z7.array(provenanceEdgeSchema).readonly(),
10154
+ totalNodes: z7.number().int().nonnegative(),
10155
+ totalEdges: z7.number().int().nonnegative()
9794
10156
  });
9795
10157
  }
9796
10158
  });
@@ -9848,72 +10210,72 @@ var init_errors = __esm({
9848
10210
  });
9849
10211
 
9850
10212
  // packages/contracts/src/evidence-atom-schema.ts
9851
- import { z as z6 } from "zod";
10213
+ import { z as z8 } from "zod";
9852
10214
  var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, AC_UUID_REGEX, AC_ALIAS_REGEX, SATISFIES_TASK_ID_REGEX, SATISFIES_VERSION_PIN_REGEX, satisfiesAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, ATOM_EXAMPLES;
9853
10215
  var init_evidence_atom_schema = __esm({
9854
10216
  "packages/contracts/src/evidence-atom-schema.ts"() {
9855
10217
  "use strict";
9856
- commitAtomSchema = z6.object({
9857
- kind: z6.literal("commit"),
9858
- sha: z6.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
10218
+ commitAtomSchema = z8.object({
10219
+ kind: z8.literal("commit"),
10220
+ sha: z8.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
9859
10221
  });
9860
- filesAtomSchema = z6.object({
9861
- kind: z6.literal("files"),
9862
- paths: z6.array(z6.string().min(1)).min(1, "files atom requires at least one path")
10222
+ filesAtomSchema = z8.object({
10223
+ kind: z8.literal("files"),
10224
+ paths: z8.array(z8.string().min(1)).min(1, "files atom requires at least one path")
9863
10225
  });
9864
- testRunAtomSchema = z6.object({
9865
- kind: z6.literal("test-run"),
9866
- path: z6.string().min(1, "test-run atom requires a non-empty path")
10226
+ testRunAtomSchema = z8.object({
10227
+ kind: z8.literal("test-run"),
10228
+ path: z8.string().min(1, "test-run atom requires a non-empty path")
9867
10229
  });
9868
- toolAtomSchema = z6.object({
9869
- kind: z6.literal("tool"),
9870
- tool: z6.string().min(1, "tool atom requires a non-empty tool name")
10230
+ toolAtomSchema = z8.object({
10231
+ kind: z8.literal("tool"),
10232
+ tool: z8.string().min(1, "tool atom requires a non-empty tool name")
9871
10233
  });
9872
- urlAtomSchema = z6.object({
9873
- kind: z6.literal("url"),
9874
- url: z6.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
10234
+ urlAtomSchema = z8.object({
10235
+ kind: z8.literal("url"),
10236
+ url: z8.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
9875
10237
  });
9876
- noteAtomSchema = z6.object({
9877
- kind: z6.literal("note"),
9878
- note: z6.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
10238
+ noteAtomSchema = z8.object({
10239
+ kind: z8.literal("note"),
10240
+ note: z8.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
9879
10241
  });
9880
- decisionAtomSchema = z6.object({
9881
- kind: z6.literal("decision"),
9882
- decisionId: z6.string().min(1, "decision atom requires a non-empty decision ID")
10242
+ decisionAtomSchema = z8.object({
10243
+ kind: z8.literal("decision"),
10244
+ decisionId: z8.string().min(1, "decision atom requires a non-empty decision ID")
9883
10245
  });
9884
- prAtomSchema = z6.object({
9885
- kind: z6.literal("pr"),
9886
- prNumber: z6.number().int().positive("pr atom requires a positive integer PR number")
10246
+ prAtomSchema = z8.object({
10247
+ kind: z8.literal("pr"),
10248
+ prNumber: z8.number().int().positive("pr atom requires a positive integer PR number")
9887
10249
  });
9888
- locDropAtomSchema = z6.object({
9889
- kind: z6.literal("loc-drop"),
9890
- fromLines: z6.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
9891
- toLines: z6.number().int().nonnegative("loc-drop toLines must be \u2265 0")
10250
+ locDropAtomSchema = z8.object({
10251
+ kind: z8.literal("loc-drop"),
10252
+ fromLines: z8.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
10253
+ toLines: z8.number().int().nonnegative("loc-drop toLines must be \u2265 0")
9892
10254
  });
9893
- callsiteCoverageAtomSchema = z6.object({
9894
- kind: z6.literal("callsite-coverage"),
9895
- symbolName: z6.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
9896
- relativeSourcePath: z6.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
10255
+ callsiteCoverageAtomSchema = z8.object({
10256
+ kind: z8.literal("callsite-coverage"),
10257
+ symbolName: z8.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
10258
+ relativeSourcePath: z8.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
9897
10259
  });
9898
10260
  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}$/;
9899
10261
  AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
9900
10262
  SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
9901
10263
  SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
9902
- satisfiesAtomSchema = z6.object({
9903
- kind: z6.literal("satisfies"),
10264
+ satisfiesAtomSchema = z8.object({
10265
+ kind: z8.literal("satisfies"),
9904
10266
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
9905
- targetTaskId: z6.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
10267
+ targetTaskId: z8.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
9906
10268
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
9907
- targetAcId: z6.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
10269
+ targetAcId: z8.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
9908
10270
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
9909
- targetAcAlias: z6.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
10271
+ targetAcAlias: z8.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
9910
10272
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
9911
- versionPin: z6.string().regex(
10273
+ versionPin: z8.string().regex(
9912
10274
  SATISFIES_VERSION_PIN_REGEX,
9913
10275
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
9914
10276
  ).optional()
9915
10277
  });
9916
- EvidenceAtomSchema = z6.discriminatedUnion("kind", [
10278
+ EvidenceAtomSchema = z8.discriminatedUnion("kind", [
9917
10279
  commitAtomSchema,
9918
10280
  filesAtomSchema,
9919
10281
  testRunAtomSchema,
@@ -9960,58 +10322,58 @@ var init_evidence_atom_schema = __esm({
9960
10322
  });
9961
10323
 
9962
10324
  // packages/contracts/src/evidence-record-schema.ts
9963
- import { z as z7 } from "zod";
10325
+ import { z as z9 } from "zod";
9964
10326
  var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
9965
10327
  var init_evidence_record_schema = __esm({
9966
10328
  "packages/contracts/src/evidence-record-schema.ts"() {
9967
10329
  "use strict";
9968
- evidenceBaseSchema = z7.object({
10330
+ evidenceBaseSchema = z9.object({
9969
10331
  /** Identity string of the agent that produced this record. */
9970
- agentIdentity: z7.string().min(1),
10332
+ agentIdentity: z9.string().min(1),
9971
10333
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
9972
- attachmentSha256: z7.string().length(64),
10334
+ attachmentSha256: z9.string().length(64),
9973
10335
  /** ISO 8601 timestamp at which the action ran. */
9974
- ranAt: z7.string().datetime(),
10336
+ ranAt: z9.string().datetime(),
9975
10337
  /** Wall-clock duration of the action in milliseconds. */
9976
- durationMs: z7.number().nonnegative()
10338
+ durationMs: z9.number().nonnegative()
9977
10339
  });
9978
10340
  implDiffRecordSchema = evidenceBaseSchema.extend({
9979
- kind: z7.literal("impl-diff"),
9980
- phase: z7.literal("implement"),
9981
- filesChanged: z7.array(z7.string().min(1)).min(1),
9982
- linesAdded: z7.number().int().nonnegative(),
9983
- linesRemoved: z7.number().int().nonnegative()
10341
+ kind: z9.literal("impl-diff"),
10342
+ phase: z9.literal("implement"),
10343
+ filesChanged: z9.array(z9.string().min(1)).min(1),
10344
+ linesAdded: z9.number().int().nonnegative(),
10345
+ linesRemoved: z9.number().int().nonnegative()
9984
10346
  });
9985
10347
  validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
9986
- kind: z7.literal("validate-spec-check"),
9987
- phase: z7.literal("validate"),
9988
- reqIdsChecked: z7.array(z7.string().min(1)).min(1),
9989
- passed: z7.boolean(),
9990
- details: z7.string().min(1)
10348
+ kind: z9.literal("validate-spec-check"),
10349
+ phase: z9.literal("validate"),
10350
+ reqIdsChecked: z9.array(z9.string().min(1)).min(1),
10351
+ passed: z9.boolean(),
10352
+ details: z9.string().min(1)
9991
10353
  });
9992
10354
  testOutputRecordSchema = evidenceBaseSchema.extend({
9993
- kind: z7.literal("test-output"),
9994
- phase: z7.literal("test"),
9995
- command: z7.string().min(1),
9996
- exitCode: z7.number().int(),
9997
- testsPassed: z7.number().int().nonnegative(),
9998
- testsFailed: z7.number().int().nonnegative()
10355
+ kind: z9.literal("test-output"),
10356
+ phase: z9.literal("test"),
10357
+ command: z9.string().min(1),
10358
+ exitCode: z9.number().int(),
10359
+ testsPassed: z9.number().int().nonnegative(),
10360
+ testsFailed: z9.number().int().nonnegative()
9999
10361
  });
10000
10362
  lintReportRecordSchema = evidenceBaseSchema.extend({
10001
- kind: z7.literal("lint-report"),
10002
- phase: z7.enum(["implement", "test"]),
10003
- tool: z7.string().min(1),
10004
- passed: z7.boolean(),
10005
- warnings: z7.number().int().nonnegative(),
10006
- errors: z7.number().int().nonnegative()
10363
+ kind: z9.literal("lint-report"),
10364
+ phase: z9.enum(["implement", "test"]),
10365
+ tool: z9.string().min(1),
10366
+ passed: z9.boolean(),
10367
+ warnings: z9.number().int().nonnegative(),
10368
+ errors: z9.number().int().nonnegative()
10007
10369
  });
10008
10370
  commandOutputRecordSchema = evidenceBaseSchema.extend({
10009
- kind: z7.literal("command-output"),
10010
- phase: z7.enum(["implement", "validate", "test"]),
10011
- cmd: z7.string().min(1),
10012
- exitCode: z7.number().int()
10371
+ kind: z9.literal("command-output"),
10372
+ phase: z9.enum(["implement", "validate", "test"]),
10373
+ cmd: z9.string().min(1),
10374
+ exitCode: z9.number().int()
10013
10375
  });
10014
- evidenceRecordSchema = z7.discriminatedUnion("kind", [
10376
+ evidenceRecordSchema = z9.discriminatedUnion("kind", [
10015
10377
  implDiffRecordSchema,
10016
10378
  validateSpecCheckRecordSchema,
10017
10379
  testOutputRecordSchema,
@@ -10028,6 +10390,26 @@ var init_facade = __esm({
10028
10390
  }
10029
10391
  });
10030
10392
 
10393
+ // packages/contracts/src/goal.ts
10394
+ var GOAL_STATUSES, GOAL_TERMINAL_STATUSES;
10395
+ var init_goal = __esm({
10396
+ "packages/contracts/src/goal.ts"() {
10397
+ "use strict";
10398
+ GOAL_STATUSES = Object.freeze([
10399
+ "active",
10400
+ "paused",
10401
+ "satisfied",
10402
+ "abandoned",
10403
+ "impossible"
10404
+ ]);
10405
+ GOAL_TERMINAL_STATUSES = Object.freeze([
10406
+ "satisfied",
10407
+ "abandoned",
10408
+ "impossible"
10409
+ ]);
10410
+ }
10411
+ });
10412
+
10031
10413
  // packages/contracts/src/graph.ts
10032
10414
  var init_graph = __esm({
10033
10415
  "packages/contracts/src/graph.ts"() {
@@ -10508,6 +10890,13 @@ var init_observe = __esm({
10508
10890
  }
10509
10891
  });
10510
10892
 
10893
+ // packages/contracts/src/mvi.ts
10894
+ var init_mvi = __esm({
10895
+ "packages/contracts/src/mvi.ts"() {
10896
+ "use strict";
10897
+ }
10898
+ });
10899
+
10511
10900
  // packages/contracts/src/status-registry.ts
10512
10901
  var TASK_STATUSES;
10513
10902
  var init_status_registry = __esm({
@@ -10526,7 +10915,7 @@ var init_status_registry = __esm({
10526
10915
  });
10527
10916
 
10528
10917
  // packages/contracts/src/workgraph.ts
10529
- import { z as z8 } from "zod";
10918
+ import { z as z10 } from "zod";
10530
10919
  var E_WORKGRAPH_PARENT_TYPE_MATRIX, taskTypeSchema, taskPrioritySchema, taskStatusSchema, verificationGateSchema, workGraphRelationKindSchema, workGraphTraversalDirectionSchema, workGraphEdgeDirectionSchema, paginationParamsSchema, workGraphNodeSchema, workGraphEdgeSchema, workGraphHierarchyEdgeSchema, workGraphPageInfoSchema, workGraphRollupCountsSchema, workGraphSubtreePercentagesSchema, workGraphProjectionMismatchSchema, workGraphReadyFrontierTaskSchema, workGraphRelationEdgeSchema, workGraphDependencyEdgeSchema, workGraphOmissionReasonSchema, workGraphContextBudgetSchema, workGraphOmissionSchema, workGraphDirectEdgeSchema, workGraphContextPackParamsSchema, workGraphSliceParamsSchema, workGraphSliceSchema, workGraphReadinessParamsSchema, workGraphReadinessResultSchema, workGraphContextPackSchema, workGraphScaffoldValidateParamsSchema, workGraphScaffoldValidationIssueSchema, workGraphScaffoldValidateResultSchema, workGraphScaffoldApplyParamsSchema, workGraphScaffoldApplyResultSchema, workGraphPlanningDocParamsSchema, workGraphPlanningDocSchema, tasksTraverseParamsSchema, tasksTraverseResultSchema, tasksTreeParamsSchema, tasksTreeResultSchema, tasksRollupParamsSchema, tasksRollupResultSchema, tasksFrontierParamsSchema, tasksFrontierResultSchema, tasksWorkGraphAuditParamsSchema, tasksWorkGraphAuditResultSchema;
10531
10920
  var init_workgraph = __esm({
10532
10921
  "packages/contracts/src/workgraph.ts"() {
@@ -10534,10 +10923,10 @@ var init_workgraph = __esm({
10534
10923
  init_enums();
10535
10924
  init_status_registry();
10536
10925
  E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
10537
- taskTypeSchema = z8.enum(["saga", "epic", "task", "subtask"]);
10538
- taskPrioritySchema = z8.enum(["critical", "high", "medium", "low"]);
10539
- taskStatusSchema = z8.enum(TASK_STATUSES);
10540
- verificationGateSchema = z8.enum([
10926
+ taskTypeSchema = z10.enum(["saga", "epic", "task", "subtask"]);
10927
+ taskPrioritySchema = z10.enum(["critical", "high", "medium", "low"]);
10928
+ taskStatusSchema = z10.enum(TASK_STATUSES);
10929
+ verificationGateSchema = z10.enum([
10541
10930
  "implemented",
10542
10931
  "testsPassed",
10543
10932
  "qaPassed",
@@ -10546,7 +10935,7 @@ var init_workgraph = __esm({
10546
10935
  "documented",
10547
10936
  "nexusImpact"
10548
10937
  ]);
10549
- workGraphRelationKindSchema = z8.enum([
10938
+ workGraphRelationKindSchema = z10.enum([
10550
10939
  "contains",
10551
10940
  "depends_on",
10552
10941
  "blocks",
@@ -10554,317 +10943,317 @@ var init_workgraph = __esm({
10554
10943
  "groups",
10555
10944
  "satisfies"
10556
10945
  ]);
10557
- workGraphTraversalDirectionSchema = z8.enum([
10946
+ workGraphTraversalDirectionSchema = z10.enum([
10558
10947
  "ancestors",
10559
10948
  "descendants",
10560
10949
  "upstream",
10561
10950
  "downstream"
10562
10951
  ]);
10563
- workGraphEdgeDirectionSchema = z8.enum(["out", "in", "both"]);
10564
- paginationParamsSchema = z8.object({
10565
- cursor: z8.string().min(1).optional(),
10566
- limit: z8.number().int().positive().max(500).optional()
10952
+ workGraphEdgeDirectionSchema = z10.enum(["out", "in", "both"]);
10953
+ paginationParamsSchema = z10.object({
10954
+ cursor: z10.string().min(1).optional(),
10955
+ limit: z10.number().int().positive().max(500).optional()
10567
10956
  });
10568
- workGraphNodeSchema = z8.object({
10569
- id: z8.string().min(1),
10957
+ workGraphNodeSchema = z10.object({
10958
+ id: z10.string().min(1),
10570
10959
  type: taskTypeSchema,
10571
- title: z8.string(),
10960
+ title: z10.string(),
10572
10961
  status: taskStatusSchema,
10573
10962
  priority: taskPrioritySchema,
10574
- parentId: z8.string().min(1).optional()
10963
+ parentId: z10.string().min(1).optional()
10575
10964
  });
10576
- workGraphEdgeSchema = z8.object({
10577
- fromId: z8.string().min(1),
10578
- toId: z8.string().min(1),
10965
+ workGraphEdgeSchema = z10.object({
10966
+ fromId: z10.string().min(1),
10967
+ toId: z10.string().min(1),
10579
10968
  kind: workGraphRelationKindSchema
10580
10969
  });
10581
- workGraphHierarchyEdgeSchema = z8.object({
10582
- fromId: z8.string().min(1),
10583
- toId: z8.string().min(1),
10584
- kind: z8.literal("contains")
10970
+ workGraphHierarchyEdgeSchema = z10.object({
10971
+ fromId: z10.string().min(1),
10972
+ toId: z10.string().min(1),
10973
+ kind: z10.literal("contains")
10585
10974
  }).strict();
10586
- workGraphPageInfoSchema = z8.object({
10587
- nextCursor: z8.string().min(1).optional(),
10588
- hasMore: z8.boolean()
10589
- });
10590
- workGraphRollupCountsSchema = z8.object({
10591
- total: z8.number().int().nonnegative(),
10592
- byStatus: z8.partialRecord(taskStatusSchema, z8.number().int().nonnegative()),
10593
- byType: z8.partialRecord(taskTypeSchema, z8.number().int().nonnegative())
10594
- });
10595
- workGraphSubtreePercentagesSchema = z8.object({
10596
- done: z8.number().nonnegative(),
10597
- active: z8.number().nonnegative(),
10598
- blocked: z8.number().nonnegative(),
10599
- pending: z8.number().nonnegative(),
10600
- cancelled: z8.number().nonnegative()
10601
- });
10602
- workGraphProjectionMismatchSchema = z8.object({
10603
- field: z8.string().min(1),
10604
- expected: z8.number().int().nonnegative(),
10605
- actual: z8.number().int().nonnegative()
10975
+ workGraphPageInfoSchema = z10.object({
10976
+ nextCursor: z10.string().min(1).optional(),
10977
+ hasMore: z10.boolean()
10978
+ });
10979
+ workGraphRollupCountsSchema = z10.object({
10980
+ total: z10.number().int().nonnegative(),
10981
+ byStatus: z10.partialRecord(taskStatusSchema, z10.number().int().nonnegative()),
10982
+ byType: z10.partialRecord(taskTypeSchema, z10.number().int().nonnegative())
10983
+ });
10984
+ workGraphSubtreePercentagesSchema = z10.object({
10985
+ done: z10.number().nonnegative(),
10986
+ active: z10.number().nonnegative(),
10987
+ blocked: z10.number().nonnegative(),
10988
+ pending: z10.number().nonnegative(),
10989
+ cancelled: z10.number().nonnegative()
10990
+ });
10991
+ workGraphProjectionMismatchSchema = z10.object({
10992
+ field: z10.string().min(1),
10993
+ expected: z10.number().int().nonnegative(),
10994
+ actual: z10.number().int().nonnegative()
10606
10995
  });
10607
10996
  workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
10608
- role: z8.string().min(1).optional(),
10609
- dependencyBlockers: z8.array(z8.object({ taskId: z8.string().min(1), status: taskStatusSchema })),
10610
- gateBlockers: z8.array(z8.object({ gate: verificationGateSchema }))
10997
+ role: z10.string().min(1).optional(),
10998
+ dependencyBlockers: z10.array(z10.object({ taskId: z10.string().min(1), status: taskStatusSchema })),
10999
+ gateBlockers: z10.array(z10.object({ gate: verificationGateSchema }))
10611
11000
  });
10612
11001
  workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
10613
- source: z8.literal("relation"),
10614
- relationType: z8.enum(TASK_RELATION_TYPES),
10615
- reason: z8.string().min(1).optional()
11002
+ source: z10.literal("relation"),
11003
+ relationType: z10.enum(TASK_RELATION_TYPES),
11004
+ reason: z10.string().min(1).optional()
10616
11005
  });
10617
11006
  workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
10618
- source: z8.literal("dependency"),
10619
- kind: z8.literal("depends_on")
11007
+ source: z10.literal("dependency"),
11008
+ kind: z10.literal("depends_on")
10620
11009
  });
10621
- workGraphOmissionReasonSchema = z8.enum([
11010
+ workGraphOmissionReasonSchema = z10.enum([
10622
11011
  "budget_exceeded",
10623
11012
  "not_requested",
10624
11013
  "not_available",
10625
11014
  "redacted",
10626
11015
  "truncated"
10627
11016
  ]);
10628
- workGraphContextBudgetSchema = z8.object({
10629
- tokenBudget: z8.number().int().nonnegative(),
10630
- estimatedTokens: z8.number().int().nonnegative(),
10631
- remainingTokens: z8.number().int().nonnegative(),
10632
- truncated: z8.boolean()
10633
- });
10634
- workGraphOmissionSchema = z8.object({
10635
- path: z8.string().min(1),
11017
+ workGraphContextBudgetSchema = z10.object({
11018
+ tokenBudget: z10.number().int().nonnegative(),
11019
+ estimatedTokens: z10.number().int().nonnegative(),
11020
+ remainingTokens: z10.number().int().nonnegative(),
11021
+ truncated: z10.boolean()
11022
+ });
11023
+ workGraphOmissionSchema = z10.object({
11024
+ path: z10.string().min(1),
10636
11025
  reason: workGraphOmissionReasonSchema,
10637
- message: z8.string().min(1),
10638
- estimatedTokens: z8.number().int().nonnegative().optional()
11026
+ message: z10.string().min(1),
11027
+ estimatedTokens: z10.number().int().nonnegative().optional()
10639
11028
  });
10640
- workGraphDirectEdgeSchema = z8.discriminatedUnion("source", [
11029
+ workGraphDirectEdgeSchema = z10.discriminatedUnion("source", [
10641
11030
  workGraphRelationEdgeSchema,
10642
11031
  workGraphDependencyEdgeSchema
10643
11032
  ]);
10644
11033
  workGraphContextPackParamsSchema = paginationParamsSchema.extend({
10645
- rootId: z8.string().min(1),
10646
- tokenBudget: z8.number().int().positive().optional(),
10647
- includeRelations: z8.boolean().optional(),
10648
- includeReadiness: z8.boolean().optional(),
10649
- includeRollup: z8.boolean().optional()
11034
+ rootId: z10.string().min(1),
11035
+ tokenBudget: z10.number().int().positive().optional(),
11036
+ includeRelations: z10.boolean().optional(),
11037
+ includeReadiness: z10.boolean().optional(),
11038
+ includeRollup: z10.boolean().optional()
10650
11039
  });
10651
11040
  workGraphSliceParamsSchema = paginationParamsSchema.extend({
10652
- rootId: z8.string().min(1),
11041
+ rootId: z10.string().min(1),
10653
11042
  direction: workGraphTraversalDirectionSchema.optional(),
10654
- maxDepth: z8.number().int().nonnegative().optional(),
10655
- includeRelations: z8.boolean().optional()
11043
+ maxDepth: z10.number().int().nonnegative().optional(),
11044
+ includeRelations: z10.boolean().optional()
10656
11045
  });
10657
- workGraphSliceSchema = z8.object({
10658
- rootId: z8.string().min(1),
11046
+ workGraphSliceSchema = z10.object({
11047
+ rootId: z10.string().min(1),
10659
11048
  direction: workGraphTraversalDirectionSchema,
10660
- nodes: z8.array(workGraphNodeSchema),
10661
- edges: z8.array(workGraphEdgeSchema),
11049
+ nodes: z10.array(workGraphNodeSchema),
11050
+ edges: z10.array(workGraphEdgeSchema),
10662
11051
  pageInfo: workGraphPageInfoSchema,
10663
- omissions: z8.array(workGraphOmissionSchema).optional()
10664
- });
10665
- workGraphReadinessParamsSchema = z8.object({
10666
- rootId: z8.string().min(1),
10667
- role: z8.string().min(1).optional(),
10668
- includeGateBlockers: z8.boolean().optional()
10669
- });
10670
- workGraphReadinessResultSchema = z8.object({
10671
- rootId: z8.string().min(1),
10672
- role: z8.string().min(1).optional(),
10673
- ready: z8.boolean(),
10674
- warnings: z8.array(z8.string()),
10675
- groups: z8.object({
10676
- ready: z8.array(workGraphReadyFrontierTaskSchema),
10677
- blocked: z8.array(workGraphReadyFrontierTaskSchema),
10678
- blockedBy: z8.array(
10679
- z8.discriminatedUnion("kind", [
10680
- z8.object({
10681
- kind: z8.literal("dependency"),
10682
- blockerId: z8.string().min(1),
10683
- blocks: z8.array(z8.string().min(1))
11052
+ omissions: z10.array(workGraphOmissionSchema).optional()
11053
+ });
11054
+ workGraphReadinessParamsSchema = z10.object({
11055
+ rootId: z10.string().min(1),
11056
+ role: z10.string().min(1).optional(),
11057
+ includeGateBlockers: z10.boolean().optional()
11058
+ });
11059
+ workGraphReadinessResultSchema = z10.object({
11060
+ rootId: z10.string().min(1),
11061
+ role: z10.string().min(1).optional(),
11062
+ ready: z10.boolean(),
11063
+ warnings: z10.array(z10.string()),
11064
+ groups: z10.object({
11065
+ ready: z10.array(workGraphReadyFrontierTaskSchema),
11066
+ blocked: z10.array(workGraphReadyFrontierTaskSchema),
11067
+ blockedBy: z10.array(
11068
+ z10.discriminatedUnion("kind", [
11069
+ z10.object({
11070
+ kind: z10.literal("dependency"),
11071
+ blockerId: z10.string().min(1),
11072
+ blocks: z10.array(z10.string().min(1))
10684
11073
  }),
10685
- z8.object({
10686
- kind: z8.literal("gate"),
11074
+ z10.object({
11075
+ kind: z10.literal("gate"),
10687
11076
  gate: verificationGateSchema,
10688
- blocks: z8.array(z8.string().min(1))
11077
+ blocks: z10.array(z10.string().min(1))
10689
11078
  })
10690
11079
  ])
10691
11080
  )
10692
11081
  })
10693
11082
  });
10694
- workGraphContextPackSchema = z8.object({
10695
- rootId: z8.string().min(1),
10696
- generatedAt: z8.string().min(1),
11083
+ workGraphContextPackSchema = z10.object({
11084
+ rootId: z10.string().min(1),
11085
+ generatedAt: z10.string().min(1),
10697
11086
  budget: workGraphContextBudgetSchema,
10698
11087
  slice: workGraphSliceSchema,
10699
- relationEdges: z8.object({
10700
- rootId: z8.string().min(1),
11088
+ relationEdges: z10.object({
11089
+ rootId: z10.string().min(1),
10701
11090
  direction: workGraphEdgeDirectionSchema,
10702
- edges: z8.array(workGraphDirectEdgeSchema)
11091
+ edges: z10.array(workGraphDirectEdgeSchema)
10703
11092
  }).optional(),
10704
11093
  readiness: workGraphReadinessResultSchema.optional(),
10705
- rollup: z8.lazy(() => tasksRollupResultSchema).optional(),
10706
- omissions: z8.array(workGraphOmissionSchema)
10707
- });
10708
- workGraphScaffoldValidateParamsSchema = z8.object({
10709
- rootId: z8.string().min(1),
10710
- nodes: z8.array(
10711
- z8.object({
10712
- id: z8.string().min(1),
11094
+ rollup: z10.lazy(() => tasksRollupResultSchema).optional(),
11095
+ omissions: z10.array(workGraphOmissionSchema)
11096
+ });
11097
+ workGraphScaffoldValidateParamsSchema = z10.object({
11098
+ rootId: z10.string().min(1),
11099
+ nodes: z10.array(
11100
+ z10.object({
11101
+ id: z10.string().min(1),
10713
11102
  type: taskTypeSchema,
10714
- parentId: z8.string().min(1).nullable().optional()
11103
+ parentId: z10.string().min(1).nullable().optional()
10715
11104
  })
10716
11105
  ),
10717
- edges: z8.array(workGraphDirectEdgeSchema).optional(),
10718
- dryRun: z8.boolean().optional()
10719
- });
10720
- workGraphScaffoldValidationIssueSchema = z8.object({
10721
- code: z8.string().min(1),
10722
- message: z8.string().min(1),
10723
- taskId: z8.string().min(1).optional(),
10724
- severity: z8.enum(["error", "warning"])
10725
- });
10726
- workGraphScaffoldValidateResultSchema = z8.object({
10727
- rootId: z8.string().min(1),
10728
- valid: z8.boolean(),
10729
- dryRun: z8.boolean(),
10730
- issues: z8.array(workGraphScaffoldValidationIssueSchema),
10731
- hierarchy: z8.object({
10732
- valid: z8.boolean(),
10733
- violations: z8.array(
10734
- z8.object({
10735
- code: z8.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
10736
- taskId: z8.string().min(1),
11106
+ edges: z10.array(workGraphDirectEdgeSchema).optional(),
11107
+ dryRun: z10.boolean().optional()
11108
+ });
11109
+ workGraphScaffoldValidationIssueSchema = z10.object({
11110
+ code: z10.string().min(1),
11111
+ message: z10.string().min(1),
11112
+ taskId: z10.string().min(1).optional(),
11113
+ severity: z10.enum(["error", "warning"])
11114
+ });
11115
+ workGraphScaffoldValidateResultSchema = z10.object({
11116
+ rootId: z10.string().min(1),
11117
+ valid: z10.boolean(),
11118
+ dryRun: z10.boolean(),
11119
+ issues: z10.array(workGraphScaffoldValidationIssueSchema),
11120
+ hierarchy: z10.object({
11121
+ valid: z10.boolean(),
11122
+ violations: z10.array(
11123
+ z10.object({
11124
+ code: z10.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
11125
+ taskId: z10.string().min(1),
10737
11126
  taskType: taskTypeSchema,
10738
- parentId: z8.string().min(1).nullable(),
11127
+ parentId: z10.string().min(1).nullable(),
10739
11128
  parentType: taskTypeSchema.optional(),
10740
- message: z8.string().min(1)
11129
+ message: z10.string().min(1)
10741
11130
  })
10742
11131
  )
10743
11132
  })
10744
11133
  });
10745
11134
  workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
10746
- apply: z8.boolean().optional()
11135
+ apply: z10.boolean().optional()
10747
11136
  });
10748
11137
  workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
10749
- applied: z8.boolean(),
10750
- nodesChanged: z8.number().int().nonnegative(),
10751
- edgesChanged: z8.number().int().nonnegative()
10752
- });
10753
- workGraphPlanningDocParamsSchema = z8.object({
10754
- rootId: z8.string().min(1),
10755
- audience: z8.enum(["agent", "maintainer"]),
10756
- tokenBudget: z8.number().int().positive().optional(),
10757
- includeRelations: z8.boolean().optional(),
10758
- includeReadiness: z8.boolean().optional(),
10759
- includeRollup: z8.boolean().optional()
10760
- });
10761
- workGraphPlanningDocSchema = z8.object({
10762
- rootId: z8.string().min(1),
10763
- generatedAt: z8.string().min(1),
10764
- audience: z8.enum(["agent", "maintainer"]),
10765
- title: z8.string().min(1),
10766
- content: z8.string(),
10767
- sections: z8.array(z8.string().min(1)),
10768
- estimatedTokens: z8.number().int().nonnegative(),
10769
- budget: z8.object({
10770
- tokenBudget: z8.number().int().positive(),
10771
- truncated: z8.boolean()
11138
+ applied: z10.boolean(),
11139
+ nodesChanged: z10.number().int().nonnegative(),
11140
+ edgesChanged: z10.number().int().nonnegative()
11141
+ });
11142
+ workGraphPlanningDocParamsSchema = z10.object({
11143
+ rootId: z10.string().min(1),
11144
+ audience: z10.enum(["agent", "maintainer"]),
11145
+ tokenBudget: z10.number().int().positive().optional(),
11146
+ includeRelations: z10.boolean().optional(),
11147
+ includeReadiness: z10.boolean().optional(),
11148
+ includeRollup: z10.boolean().optional()
11149
+ });
11150
+ workGraphPlanningDocSchema = z10.object({
11151
+ rootId: z10.string().min(1),
11152
+ generatedAt: z10.string().min(1),
11153
+ audience: z10.enum(["agent", "maintainer"]),
11154
+ title: z10.string().min(1),
11155
+ content: z10.string(),
11156
+ sections: z10.array(z10.string().min(1)),
11157
+ estimatedTokens: z10.number().int().nonnegative(),
11158
+ budget: z10.object({
11159
+ tokenBudget: z10.number().int().positive(),
11160
+ truncated: z10.boolean()
10772
11161
  }).optional()
10773
11162
  });
10774
11163
  tasksTraverseParamsSchema = paginationParamsSchema.extend({
10775
- rootId: z8.string().min(1),
11164
+ rootId: z10.string().min(1),
10776
11165
  direction: workGraphTraversalDirectionSchema,
10777
- maxDepth: z8.number().int().nonnegative().optional(),
10778
- includeRelations: z8.boolean().optional()
11166
+ maxDepth: z10.number().int().nonnegative().optional(),
11167
+ includeRelations: z10.boolean().optional()
10779
11168
  });
10780
- tasksTraverseResultSchema = z8.object({
10781
- rootId: z8.string().min(1),
11169
+ tasksTraverseResultSchema = z10.object({
11170
+ rootId: z10.string().min(1),
10782
11171
  direction: workGraphTraversalDirectionSchema,
10783
- nodes: z8.array(workGraphNodeSchema),
10784
- edges: z8.array(workGraphEdgeSchema),
11172
+ nodes: z10.array(workGraphNodeSchema),
11173
+ edges: z10.array(workGraphEdgeSchema),
10785
11174
  pageInfo: workGraphPageInfoSchema
10786
11175
  });
10787
11176
  tasksTreeParamsSchema = paginationParamsSchema.extend({
10788
- rootId: z8.string().min(1),
10789
- maxDepth: z8.number().int().nonnegative().optional()
11177
+ rootId: z10.string().min(1),
11178
+ maxDepth: z10.number().int().nonnegative().optional()
10790
11179
  });
10791
- tasksTreeResultSchema = z8.object({
10792
- rootId: z8.string().min(1),
10793
- nodes: z8.array(workGraphNodeSchema.extend({ depth: z8.number().int().positive() })),
10794
- edges: z8.array(workGraphHierarchyEdgeSchema),
11180
+ tasksTreeResultSchema = z10.object({
11181
+ rootId: z10.string().min(1),
11182
+ nodes: z10.array(workGraphNodeSchema.extend({ depth: z10.number().int().positive() })),
11183
+ edges: z10.array(workGraphHierarchyEdgeSchema),
10795
11184
  pageInfo: workGraphPageInfoSchema
10796
11185
  });
10797
- tasksRollupParamsSchema = z8.object({
10798
- rootId: z8.string().min(1),
11186
+ tasksRollupParamsSchema = z10.object({
11187
+ rootId: z10.string().min(1),
10799
11188
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
10800
11189
  });
10801
- tasksRollupResultSchema = z8.object({
10802
- rootId: z8.string().min(1),
11190
+ tasksRollupResultSchema = z10.object({
11191
+ rootId: z10.string().min(1),
10803
11192
  direct: workGraphRollupCountsSchema,
10804
11193
  subtree: workGraphRollupCountsSchema,
10805
- percentDenominator: z8.object({
10806
- basis: z8.literal("subtree-total"),
10807
- total: z8.number().int().nonnegative(),
10808
- description: z8.string().min(1)
11194
+ percentDenominator: z10.object({
11195
+ basis: z10.literal("subtree-total"),
11196
+ total: z10.number().int().nonnegative(),
11197
+ description: z10.string().min(1)
10809
11198
  }),
10810
11199
  percentages: workGraphSubtreePercentagesSchema,
10811
- staleProjection: z8.boolean(),
10812
- projectionMismatches: z8.array(workGraphProjectionMismatchSchema)
10813
- });
10814
- tasksFrontierParamsSchema = z8.object({
10815
- rootId: z8.string().min(1),
10816
- role: z8.string().min(1).optional()
10817
- });
10818
- tasksFrontierResultSchema = z8.object({
10819
- rootId: z8.string().min(1),
10820
- role: z8.string().min(1).optional(),
10821
- groups: z8.object({
10822
- ready: z8.array(workGraphReadyFrontierTaskSchema),
10823
- blocked: z8.array(workGraphReadyFrontierTaskSchema),
10824
- blockedBy: z8.array(
10825
- z8.discriminatedUnion("kind", [
10826
- z8.object({
10827
- kind: z8.literal("dependency"),
10828
- blockerId: z8.string().min(1),
10829
- blocks: z8.array(z8.string().min(1))
11200
+ staleProjection: z10.boolean(),
11201
+ projectionMismatches: z10.array(workGraphProjectionMismatchSchema)
11202
+ });
11203
+ tasksFrontierParamsSchema = z10.object({
11204
+ rootId: z10.string().min(1),
11205
+ role: z10.string().min(1).optional()
11206
+ });
11207
+ tasksFrontierResultSchema = z10.object({
11208
+ rootId: z10.string().min(1),
11209
+ role: z10.string().min(1).optional(),
11210
+ groups: z10.object({
11211
+ ready: z10.array(workGraphReadyFrontierTaskSchema),
11212
+ blocked: z10.array(workGraphReadyFrontierTaskSchema),
11213
+ blockedBy: z10.array(
11214
+ z10.discriminatedUnion("kind", [
11215
+ z10.object({
11216
+ kind: z10.literal("dependency"),
11217
+ blockerId: z10.string().min(1),
11218
+ blocks: z10.array(z10.string().min(1))
10830
11219
  }),
10831
- z8.object({
10832
- kind: z8.literal("gate"),
11220
+ z10.object({
11221
+ kind: z10.literal("gate"),
10833
11222
  gate: verificationGateSchema,
10834
- blocks: z8.array(z8.string().min(1))
11223
+ blocks: z10.array(z10.string().min(1))
10835
11224
  })
10836
11225
  ])
10837
11226
  )
10838
11227
  })
10839
11228
  });
10840
11229
  tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
10841
- rootId: z8.string().min(1),
10842
- maxDepth: z8.number().int().nonnegative().optional(),
10843
- includeRelations: z8.boolean().optional()
10844
- });
10845
- tasksWorkGraphAuditResultSchema = z8.object({
10846
- rootId: z8.string().min(1),
10847
- hierarchy: z8.object({
10848
- valid: z8.boolean(),
10849
- violations: z8.array(
10850
- z8.object({
10851
- code: z8.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
10852
- taskId: z8.string().min(1),
11230
+ rootId: z10.string().min(1),
11231
+ maxDepth: z10.number().int().nonnegative().optional(),
11232
+ includeRelations: z10.boolean().optional()
11233
+ });
11234
+ tasksWorkGraphAuditResultSchema = z10.object({
11235
+ rootId: z10.string().min(1),
11236
+ hierarchy: z10.object({
11237
+ valid: z10.boolean(),
11238
+ violations: z10.array(
11239
+ z10.object({
11240
+ code: z10.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
11241
+ taskId: z10.string().min(1),
10853
11242
  taskType: taskTypeSchema,
10854
- parentId: z8.string().min(1).nullable(),
11243
+ parentId: z10.string().min(1).nullable(),
10855
11244
  parentType: taskTypeSchema.optional(),
10856
- message: z8.string().min(1)
11245
+ message: z10.string().min(1)
10857
11246
  })
10858
11247
  )
10859
11248
  }),
10860
11249
  traversal: tasksTraverseResultSchema,
10861
11250
  frontier: tasksFrontierResultSchema,
10862
11251
  rollup: tasksRollupResultSchema,
10863
- relationEdges: z8.object({
10864
- rootId: z8.string().min(1),
11252
+ relationEdges: z10.object({
11253
+ rootId: z10.string().min(1),
10865
11254
  direction: workGraphEdgeDirectionSchema,
10866
- edges: z8.array(
10867
- z8.discriminatedUnion("source", [
11255
+ edges: z10.array(
11256
+ z10.discriminatedUnion("source", [
10868
11257
  workGraphRelationEdgeSchema,
10869
11258
  workGraphDependencyEdgeSchema
10870
11259
  ])
@@ -10897,6 +11286,13 @@ var init_agent_operation_contract = __esm({
10897
11286
  }
10898
11287
  });
10899
11288
 
11289
+ // packages/contracts/src/operations/attention.ts
11290
+ var init_attention = __esm({
11291
+ "packages/contracts/src/operations/attention.ts"() {
11292
+ "use strict";
11293
+ }
11294
+ });
11295
+
10900
11296
  // packages/contracts/src/operations/brain.ts
10901
11297
  var init_brain = __esm({
10902
11298
  "packages/contracts/src/operations/brain.ts"() {
@@ -11085,6 +11481,7 @@ var init_operations = __esm({
11085
11481
  "use strict";
11086
11482
  init_admin();
11087
11483
  init_agent_operation_contract();
11484
+ init_attention();
11088
11485
  init_brain();
11089
11486
  init_conduit();
11090
11487
  init_dialectic();
@@ -11130,31 +11527,31 @@ var init_peer = __esm({
11130
11527
  });
11131
11528
 
11132
11529
  // packages/contracts/src/release/evidence-atoms.ts
11133
- import { z as z9 } from "zod";
11530
+ import { z as z11 } from "zod";
11134
11531
  var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
11135
11532
  var init_evidence_atoms = __esm({
11136
11533
  "packages/contracts/src/release/evidence-atoms.ts"() {
11137
11534
  "use strict";
11138
- parsedPrEvidenceAtomSchema = z9.object({
11139
- kind: z9.literal("pr"),
11140
- prNumber: z9.number().int().positive()
11141
- });
11142
- prEvidenceStateModifierSchema = z9.object({
11143
- kind: z9.literal("state"),
11144
- value: z9.literal("MERGED")
11145
- });
11146
- ghPrViewSchema = z9.object({
11147
- state: z9.enum(["OPEN", "CLOSED", "MERGED"]),
11148
- mergedAt: z9.string().nullable(),
11149
- headRefOid: z9.string().optional(),
11150
- mergeable: z9.string().optional(),
11151
- statusCheckRollup: z9.array(
11152
- z9.object({
11153
- __typename: z9.string().optional(),
11154
- name: z9.string().optional(),
11155
- workflowName: z9.string().optional(),
11156
- conclusion: z9.string().nullable().optional(),
11157
- status: z9.string().optional()
11535
+ parsedPrEvidenceAtomSchema = z11.object({
11536
+ kind: z11.literal("pr"),
11537
+ prNumber: z11.number().int().positive()
11538
+ });
11539
+ prEvidenceStateModifierSchema = z11.object({
11540
+ kind: z11.literal("state"),
11541
+ value: z11.literal("MERGED")
11542
+ });
11543
+ ghPrViewSchema = z11.object({
11544
+ state: z11.enum(["OPEN", "CLOSED", "MERGED"]),
11545
+ mergedAt: z11.string().nullable(),
11546
+ headRefOid: z11.string().optional(),
11547
+ mergeable: z11.string().optional(),
11548
+ statusCheckRollup: z11.array(
11549
+ z11.object({
11550
+ __typename: z11.string().optional(),
11551
+ name: z11.string().optional(),
11552
+ workflowName: z11.string().optional(),
11553
+ conclusion: z11.string().nullable().optional(),
11554
+ status: z11.string().optional()
11158
11555
  }).passthrough()
11159
11556
  ).optional().default([])
11160
11557
  }).passthrough();
@@ -11167,7 +11564,7 @@ var init_evidence_atoms = __esm({
11167
11564
  });
11168
11565
 
11169
11566
  // packages/contracts/src/release/plan.ts
11170
- import { z as z10 } from "zod";
11567
+ import { z as z12 } from "zod";
11171
11568
  var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
11172
11569
  var init_plan = __esm({
11173
11570
  "packages/contracts/src/release/plan.ts"() {
@@ -11210,20 +11607,20 @@ var init_plan = __esm({
11210
11607
  ];
11211
11608
  IMPACT = ["major", "minor", "patch"];
11212
11609
  RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
11213
- ReleaseChannelSchema = z10.enum(RELEASE_CHANNEL);
11214
- ReleaseSchemeSchema = z10.enum(RELEASE_SCHEME);
11215
- ReleaseKindSchema = z10.enum(RELEASE_KIND);
11216
- ReleaseStatusSchema = z10.enum(RELEASE_STATUS);
11217
- GateStatusSchema = z10.enum(GATE_STATUS);
11218
- GateNameSchema = z10.enum(GATE_NAME);
11219
- PlatformTupleSchema = z10.enum(PLATFORM_TUPLE);
11220
- PublisherSchema = z10.enum(PUBLISHER);
11221
- TaskKindSchema = z10.enum(TASK_KIND);
11222
- ImpactSchema = z10.enum(IMPACT);
11223
- ResolvedSourceSchema = z10.enum(RESOLVED_SOURCE);
11224
- Iso8601 = z10.iso.datetime({ offset: true });
11225
- NonEmptyString = z10.string().min(1);
11226
- ReleasePlanTaskSchema = z10.object({
11610
+ ReleaseChannelSchema = z12.enum(RELEASE_CHANNEL);
11611
+ ReleaseSchemeSchema = z12.enum(RELEASE_SCHEME);
11612
+ ReleaseKindSchema = z12.enum(RELEASE_KIND);
11613
+ ReleaseStatusSchema = z12.enum(RELEASE_STATUS);
11614
+ GateStatusSchema = z12.enum(GATE_STATUS);
11615
+ GateNameSchema = z12.enum(GATE_NAME);
11616
+ PlatformTupleSchema = z12.enum(PLATFORM_TUPLE);
11617
+ PublisherSchema = z12.enum(PUBLISHER);
11618
+ TaskKindSchema = z12.enum(TASK_KIND);
11619
+ ImpactSchema = z12.enum(IMPACT);
11620
+ ResolvedSourceSchema = z12.enum(RESOLVED_SOURCE);
11621
+ Iso8601 = z12.iso.datetime({ offset: true });
11622
+ NonEmptyString = z12.string().min(1);
11623
+ ReleasePlanTaskSchema = z12.object({
11227
11624
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
11228
11625
  id: NonEmptyString,
11229
11626
  /** Conventional-commit-aligned task classification. */
@@ -11231,20 +11628,20 @@ var init_plan = __esm({
11231
11628
  /** SemVer impact classification. */
11232
11629
  impact: ImpactSchema,
11233
11630
  /** Human-readable changelog line for this task. */
11234
- userFacingSummary: z10.string(),
11631
+ userFacingSummary: z12.string(),
11235
11632
  /**
11236
11633
  * ADR-051 evidence atoms attesting the task's gate results. Format is
11237
11634
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
11238
11635
  * accepts empty arrays so legacy plans validate; `cleo release plan`
11239
11636
  * enforces non-empty via R-301.
11240
11637
  */
11241
- evidenceAtoms: z10.array(NonEmptyString),
11638
+ evidenceAtoms: z12.array(NonEmptyString),
11242
11639
  /** IVTR phase at plan time — informational only per R-316. */
11243
- ivtrPhaseAtPlan: z10.string().optional(),
11640
+ ivtrPhaseAtPlan: z12.string().optional(),
11244
11641
  /** Epic this task rolls up to, locked at plan time per R-303. */
11245
11642
  epicAncestor: NonEmptyString
11246
11643
  });
11247
- ReleaseGateSchema = z10.object({
11644
+ ReleaseGateSchema = z12.object({
11248
11645
  /** Canonical gate name. */
11249
11646
  name: GateNameSchema,
11250
11647
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -11254,11 +11651,11 @@ var init_plan = __esm({
11254
11651
  /** ISO-8601 timestamp the gate was last verified. */
11255
11652
  lastVerifiedAt: Iso8601,
11256
11653
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
11257
- resolvedCommand: z10.string().optional(),
11654
+ resolvedCommand: z12.string().optional(),
11258
11655
  /** Provenance of the resolved command. Optional for unresolved gates. */
11259
11656
  resolvedSource: ResolvedSourceSchema.optional()
11260
11657
  });
11261
- ReleasePlatformMatrixEntrySchema = z10.object({
11658
+ ReleasePlatformMatrixEntrySchema = z12.object({
11262
11659
  /** Target platform tuple. */
11263
11660
  platform: PlatformTupleSchema,
11264
11661
  /** Distribution backend. */
@@ -11266,47 +11663,47 @@ var init_plan = __esm({
11266
11663
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
11267
11664
  package: NonEmptyString,
11268
11665
  /** Whether to run the GHA smoke job for this matrix entry. */
11269
- smoke: z10.boolean().default(true).optional()
11666
+ smoke: z12.boolean().default(true).optional()
11270
11667
  });
11271
- ReleasePreflightSummarySchema = z10.object({
11668
+ ReleasePreflightSummarySchema = z12.object({
11272
11669
  /** True if esbuild externals are out of sync with package.json. */
11273
- esbuildExternalsDrift: z10.boolean(),
11670
+ esbuildExternalsDrift: z12.boolean(),
11274
11671
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
11275
- lockfileDrift: z10.boolean(),
11672
+ lockfileDrift: z12.boolean(),
11276
11673
  /** True if all epic children are in terminal lifecycle states. */
11277
- epicCompletenessClean: z10.boolean(),
11674
+ epicCompletenessClean: z12.boolean(),
11278
11675
  /** True if no task appears in multiple in-flight release plans. */
11279
- doubleListingClean: z10.boolean(),
11676
+ doubleListingClean: z12.boolean(),
11280
11677
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
11281
- preflightWarnings: z10.array(z10.string()).default([]).optional()
11678
+ preflightWarnings: z12.array(z12.string()).default([]).optional()
11282
11679
  });
11283
- ReleasePlanChangelogSchema = z10.object({
11680
+ ReleasePlanChangelogSchema = z12.object({
11284
11681
  /** `kind=feat` tasks. */
11285
- features: z10.array(NonEmptyString).default([]),
11682
+ features: z12.array(NonEmptyString).default([]),
11286
11683
  /** `kind=fix` or `kind=hotfix` tasks. */
11287
- fixes: z10.array(NonEmptyString).default([]),
11684
+ fixes: z12.array(NonEmptyString).default([]),
11288
11685
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
11289
- chores: z10.array(NonEmptyString).default([]),
11686
+ chores: z12.array(NonEmptyString).default([]),
11290
11687
  /** `kind=breaking` or `kind=revert` tasks. */
11291
- breaking: z10.array(NonEmptyString).default([])
11688
+ breaking: z12.array(NonEmptyString).default([])
11292
11689
  });
11293
- ReleasePlanMetaSchema = z10.object({
11690
+ ReleasePlanMetaSchema = z12.object({
11294
11691
  /** True if this is the project's first ever release. */
11295
- firstEverRelease: z10.boolean().optional(),
11692
+ firstEverRelease: z12.boolean().optional(),
11296
11693
  /** Canonical tool names that could not be resolved at plan time. */
11297
- unresolvedTools: z10.array(z10.string()).optional(),
11694
+ unresolvedTools: z12.array(z12.string()).optional(),
11298
11695
  /** Project archetype detected at plan time. */
11299
- archetype: z10.string().optional()
11300
- }).catchall(z10.unknown());
11301
- ReleasePlanSchema = z10.object({
11696
+ archetype: z12.string().optional()
11697
+ }).catchall(z12.unknown());
11698
+ ReleasePlanSchema = z12.object({
11302
11699
  /** Schema URL for this plan version. */
11303
- $schema: z10.string().optional(),
11700
+ $schema: z12.string().optional(),
11304
11701
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
11305
11702
  version: NonEmptyString,
11306
11703
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
11307
11704
  resolvedVersion: NonEmptyString,
11308
11705
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
11309
- suffixApplied: z10.boolean(),
11706
+ suffixApplied: z12.boolean(),
11310
11707
  /** Versioning scheme governing `version` / `resolvedVersion`. */
11311
11708
  scheme: ReleaseSchemeSchema,
11312
11709
  /** npm dist-tag channel for this release. */
@@ -11323,27 +11720,27 @@ var init_plan = __esm({
11323
11720
  * Version of the previous release on the same channel. MUST be `null` only
11324
11721
  * for first-ever releases (R-300, enforced at the verb layer).
11325
11722
  */
11326
- previousVersion: z10.string().nullable(),
11723
+ previousVersion: z12.string().nullable(),
11327
11724
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
11328
- previousTag: z10.string().nullable(),
11725
+ previousTag: z12.string().nullable(),
11329
11726
  /** ISO-8601 timestamp the previous release was published. */
11330
11727
  previousShippedAt: Iso8601.nullable(),
11331
11728
  /** Tasks rolled into this release. */
11332
- tasks: z10.array(ReleasePlanTaskSchema),
11729
+ tasks: z12.array(ReleasePlanTaskSchema),
11333
11730
  /** Bucketed changelog. */
11334
11731
  changelog: ReleasePlanChangelogSchema,
11335
11732
  /** Per-gate verification status. */
11336
- gates: z10.array(ReleaseGateSchema),
11733
+ gates: z12.array(ReleaseGateSchema),
11337
11734
  /** Platform / publisher matrix. */
11338
- platformMatrix: z10.array(ReleasePlatformMatrixEntrySchema),
11735
+ platformMatrix: z12.array(ReleasePlatformMatrixEntrySchema),
11339
11736
  /** Preflight summary from `cleo release plan`. */
11340
11737
  preflightSummary: ReleasePreflightSummarySchema,
11341
11738
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
11342
- workflowRunUrl: z10.string().nullable(),
11739
+ workflowRunUrl: z12.string().nullable(),
11343
11740
  /** URL of the bump PR (populated by `cleo release open`). */
11344
- prUrl: z10.string().nullable(),
11741
+ prUrl: z12.string().nullable(),
11345
11742
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
11346
- mergeCommitSha: z10.string().nullable(),
11743
+ mergeCommitSha: z12.string().nullable(),
11347
11744
  /** Current FSM state per R-302. */
11348
11745
  status: ReleaseStatusSchema,
11349
11746
  /** Informational / forward-compat metadata. */
@@ -11399,52 +11796,52 @@ var init_session2 = __esm({
11399
11796
  });
11400
11797
 
11401
11798
  // packages/contracts/src/session-journal.ts
11402
- import { z as z11 } from "zod";
11799
+ import { z as z13 } from "zod";
11403
11800
  var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
11404
11801
  var init_session_journal = __esm({
11405
11802
  "packages/contracts/src/session-journal.ts"() {
11406
11803
  "use strict";
11407
11804
  SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
11408
- sessionJournalDoctorSummarySchema = z11.object({
11805
+ sessionJournalDoctorSummarySchema = z13.object({
11409
11806
  /** `true` when zero noise patterns were detected. */
11410
- isClean: z11.boolean(),
11807
+ isClean: z13.boolean(),
11411
11808
  /** Total number of noise findings across all patterns. */
11412
- findingsCount: z11.number().int().nonnegative(),
11809
+ findingsCount: z13.number().int().nonnegative(),
11413
11810
  /** Pattern names that were detected (empty when isClean). */
11414
- patterns: z11.array(z11.string()),
11811
+ patterns: z13.array(z13.string()),
11415
11812
  /** Total brain entries scanned. `0` = empty or unavailable. */
11416
- totalScanned: z11.number().int().nonnegative()
11813
+ totalScanned: z13.number().int().nonnegative()
11417
11814
  });
11418
- sessionJournalDebriefSummarySchema = z11.object({
11815
+ sessionJournalDebriefSummarySchema = z13.object({
11419
11816
  /** First 200 characters of the session end note (if provided). */
11420
- noteExcerpt: z11.string().max(200).optional(),
11817
+ noteExcerpt: z13.string().max(200).optional(),
11421
11818
  /** Number of tasks completed during the session. */
11422
- tasksCompletedCount: z11.number().int().nonnegative(),
11819
+ tasksCompletedCount: z13.number().int().nonnegative(),
11423
11820
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
11424
- tasksFocused: z11.array(z11.string()).max(5).optional()
11821
+ tasksFocused: z13.array(z13.string()).max(5).optional()
11425
11822
  });
11426
- sessionJournalEntrySchema = z11.object({
11823
+ sessionJournalEntrySchema = z13.object({
11427
11824
  // Identity
11428
11825
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
11429
- schemaVersion: z11.literal(SESSION_JOURNAL_SCHEMA_VERSION),
11826
+ schemaVersion: z13.literal(SESSION_JOURNAL_SCHEMA_VERSION),
11430
11827
  /** ISO 8601 timestamp when the entry was written. */
11431
- timestamp: z11.string(),
11828
+ timestamp: z13.string(),
11432
11829
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
11433
- sessionId: z11.string(),
11830
+ sessionId: z13.string(),
11434
11831
  /** Event type that triggered this journal entry. */
11435
- eventType: z11.enum(["session_start", "session_end", "observation", "decision", "error"]),
11832
+ eventType: z13.enum(["session_start", "session_end", "observation", "decision", "error"]),
11436
11833
  // Session metadata (set on session_start / session_end)
11437
11834
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
11438
- agentIdentifier: z11.string().optional(),
11835
+ agentIdentifier: z13.string().optional(),
11439
11836
  /** Provider adapter ID active for this session. */
11440
- providerId: z11.string().optional(),
11837
+ providerId: z13.string().optional(),
11441
11838
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
11442
- scope: z11.string().optional(),
11839
+ scope: z13.string().optional(),
11443
11840
  // Session-end fields
11444
11841
  /** Duration of the session in seconds (session_end only). */
11445
- duration: z11.number().int().nonnegative().optional(),
11842
+ duration: z13.number().int().nonnegative().optional(),
11446
11843
  /** Task IDs (not titles) completed during the session. */
11447
- tasksCompleted: z11.array(z11.string()).optional(),
11844
+ tasksCompleted: z13.array(z13.string()).optional(),
11448
11845
  // Doctor summary (T1262 absorbed)
11449
11846
  /** Compact result of `scanBrainNoise` run at session-end. */
11450
11847
  doctorSummary: sessionJournalDoctorSummarySchema.optional(),
@@ -11453,7 +11850,7 @@ var init_session_journal = __esm({
11453
11850
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
11454
11851
  // Optional hash chain
11455
11852
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
11456
- prevEntryHash: z11.string().optional()
11853
+ prevEntryHash: z13.string().optional()
11457
11854
  });
11458
11855
  }
11459
11856
  });
@@ -11466,52 +11863,52 @@ var init_task = __esm({
11466
11863
  });
11467
11864
 
11468
11865
  // packages/contracts/src/task-evidence.ts
11469
- import { z as z12 } from "zod";
11866
+ import { z as z14 } from "zod";
11470
11867
  var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
11471
11868
  var init_task_evidence = __esm({
11472
11869
  "packages/contracts/src/task-evidence.ts"() {
11473
11870
  "use strict";
11474
- fileEvidenceSchema = z12.object({
11475
- kind: z12.literal("file"),
11476
- sha256: z12.string().length(64),
11477
- timestamp: z12.string().datetime(),
11478
- path: z12.string().min(1),
11479
- mime: z12.string().optional(),
11480
- description: z12.string().optional()
11481
- });
11482
- logEvidenceSchema = z12.object({
11483
- kind: z12.literal("log"),
11484
- sha256: z12.string().length(64),
11485
- timestamp: z12.string().datetime(),
11486
- source: z12.string().min(1),
11487
- description: z12.string().optional()
11488
- });
11489
- screenshotEvidenceSchema = z12.object({
11490
- kind: z12.literal("screenshot"),
11491
- sha256: z12.string().length(64),
11492
- timestamp: z12.string().datetime(),
11493
- mime: z12.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
11494
- description: z12.string().optional()
11495
- });
11496
- testOutputEvidenceSchema = z12.object({
11497
- kind: z12.literal("test-output"),
11498
- sha256: z12.string().length(64),
11499
- timestamp: z12.string().datetime(),
11500
- passed: z12.number().int().nonnegative(),
11501
- failed: z12.number().int().nonnegative(),
11502
- skipped: z12.number().int().nonnegative(),
11503
- exitCode: z12.number().int(),
11504
- description: z12.string().optional()
11505
- });
11506
- commandOutputEvidenceSchema = z12.object({
11507
- kind: z12.literal("command-output"),
11508
- sha256: z12.string().length(64),
11509
- timestamp: z12.string().datetime(),
11510
- cmd: z12.string().min(1),
11511
- exitCode: z12.number().int(),
11512
- description: z12.string().optional()
11513
- });
11514
- taskEvidenceSchema = z12.discriminatedUnion("kind", [
11871
+ fileEvidenceSchema = z14.object({
11872
+ kind: z14.literal("file"),
11873
+ sha256: z14.string().length(64),
11874
+ timestamp: z14.string().datetime(),
11875
+ path: z14.string().min(1),
11876
+ mime: z14.string().optional(),
11877
+ description: z14.string().optional()
11878
+ });
11879
+ logEvidenceSchema = z14.object({
11880
+ kind: z14.literal("log"),
11881
+ sha256: z14.string().length(64),
11882
+ timestamp: z14.string().datetime(),
11883
+ source: z14.string().min(1),
11884
+ description: z14.string().optional()
11885
+ });
11886
+ screenshotEvidenceSchema = z14.object({
11887
+ kind: z14.literal("screenshot"),
11888
+ sha256: z14.string().length(64),
11889
+ timestamp: z14.string().datetime(),
11890
+ mime: z14.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
11891
+ description: z14.string().optional()
11892
+ });
11893
+ testOutputEvidenceSchema = z14.object({
11894
+ kind: z14.literal("test-output"),
11895
+ sha256: z14.string().length(64),
11896
+ timestamp: z14.string().datetime(),
11897
+ passed: z14.number().int().nonnegative(),
11898
+ failed: z14.number().int().nonnegative(),
11899
+ skipped: z14.number().int().nonnegative(),
11900
+ exitCode: z14.number().int(),
11901
+ description: z14.string().optional()
11902
+ });
11903
+ commandOutputEvidenceSchema = z14.object({
11904
+ kind: z14.literal("command-output"),
11905
+ sha256: z14.string().length(64),
11906
+ timestamp: z14.string().datetime(),
11907
+ cmd: z14.string().min(1),
11908
+ exitCode: z14.number().int(),
11909
+ description: z14.string().optional()
11910
+ });
11911
+ taskEvidenceSchema = z14.discriminatedUnion("kind", [
11515
11912
  fileEvidenceSchema,
11516
11913
  logEvidenceSchema,
11517
11914
  screenshotEvidenceSchema,
@@ -11522,12 +11919,12 @@ var init_task_evidence = __esm({
11522
11919
  });
11523
11920
 
11524
11921
  // packages/contracts/src/tasks/archive.ts
11525
- import { z as z13 } from "zod";
11922
+ import { z as z15 } from "zod";
11526
11923
  var ArchiveReason, ARCHIVE_REASON_VALUES;
11527
11924
  var init_archive = __esm({
11528
11925
  "packages/contracts/src/tasks/archive.ts"() {
11529
11926
  "use strict";
11530
- ArchiveReason = z13.enum([
11927
+ ArchiveReason = z15.enum([
11531
11928
  "verified",
11532
11929
  "reconciled",
11533
11930
  "superseded",
@@ -11540,47 +11937,47 @@ var init_archive = __esm({
11540
11937
  });
11541
11938
 
11542
11939
  // packages/contracts/src/tasks.ts
11543
- import { z as z14 } from "zod";
11940
+ import { z as z16 } from "zod";
11544
11941
  var taskMutationWarningSeveritySchema, taskMutationWarningSchema, taskMutationDryRunSummarySchema, taskMutationTaskRecordSchema, taskMutationEnvelopeSchema, completionTaskStatusSchema, completionCriterionKindSchema, completionCriterionStatusSchema, completionBlockerReasonSchema, completionStaleReasonSchema, completionProjectionRepairErrorCodeSchema, completionCriterionWaiverSchema, completionCriterionReplacementSchema, completionCriterionEvaluationSchema, unsatisfiedCompletionCriterionSchema, completionTotalsSchema, completionContextPackSchema, completionEvaluationSchema, completionExplanationSchema, completionListParamsSchema, completionListResultSchema, completionEvaluateParamsSchema, completionProjectionRepairErrorSchema, completionProjectionRepairParamsSchema, completionProjectionRepairResultSchema;
11545
11942
  var init_tasks2 = __esm({
11546
11943
  "packages/contracts/src/tasks.ts"() {
11547
11944
  "use strict";
11548
11945
  init_status_registry();
11549
- taskMutationWarningSeveritySchema = z14.enum(["info", "warning"]);
11550
- taskMutationWarningSchema = z14.object({
11551
- code: z14.string().min(1),
11552
- message: z14.string().min(1),
11946
+ taskMutationWarningSeveritySchema = z16.enum(["info", "warning"]);
11947
+ taskMutationWarningSchema = z16.object({
11948
+ code: z16.string().min(1),
11949
+ message: z16.string().min(1),
11553
11950
  severity: taskMutationWarningSeveritySchema.optional(),
11554
- taskId: z14.string().min(1).optional(),
11555
- field: z14.string().min(1).optional(),
11556
- index: z14.number().int().nonnegative().optional()
11557
- });
11558
- taskMutationDryRunSummarySchema = z14.object({
11559
- dryRun: z14.literal(true),
11560
- wouldCreate: z14.number().int().nonnegative(),
11561
- wouldUpdate: z14.number().int().nonnegative(),
11562
- wouldDelete: z14.number().int().nonnegative(),
11563
- wouldAffect: z14.number().int().nonnegative(),
11564
- validatedCount: z14.number().int().nonnegative(),
11565
- insertedCount: z14.literal(0),
11566
- updatedCount: z14.literal(0),
11567
- deletedCount: z14.literal(0),
11568
- warnings: z14.array(taskMutationWarningSchema)
11569
- });
11570
- taskMutationTaskRecordSchema = z14.object({ id: z14.string().min(1) }).passthrough();
11571
- taskMutationEnvelopeSchema = z14.object({
11572
- dryRun: z14.boolean().optional(),
11573
- created: z14.array(taskMutationTaskRecordSchema),
11574
- updated: z14.array(taskMutationTaskRecordSchema),
11575
- deleted: z14.array(taskMutationTaskRecordSchema),
11576
- affectedCount: z14.number().int().nonnegative(),
11577
- mutationWarnings: z14.array(taskMutationWarningSchema),
11951
+ taskId: z16.string().min(1).optional(),
11952
+ field: z16.string().min(1).optional(),
11953
+ index: z16.number().int().nonnegative().optional()
11954
+ });
11955
+ taskMutationDryRunSummarySchema = z16.object({
11956
+ dryRun: z16.literal(true),
11957
+ wouldCreate: z16.number().int().nonnegative(),
11958
+ wouldUpdate: z16.number().int().nonnegative(),
11959
+ wouldDelete: z16.number().int().nonnegative(),
11960
+ wouldAffect: z16.number().int().nonnegative(),
11961
+ validatedCount: z16.number().int().nonnegative(),
11962
+ insertedCount: z16.literal(0),
11963
+ updatedCount: z16.literal(0),
11964
+ deletedCount: z16.literal(0),
11965
+ warnings: z16.array(taskMutationWarningSchema)
11966
+ });
11967
+ taskMutationTaskRecordSchema = z16.object({ id: z16.string().min(1) }).passthrough();
11968
+ taskMutationEnvelopeSchema = z16.object({
11969
+ dryRun: z16.boolean().optional(),
11970
+ created: z16.array(taskMutationTaskRecordSchema),
11971
+ updated: z16.array(taskMutationTaskRecordSchema),
11972
+ deleted: z16.array(taskMutationTaskRecordSchema),
11973
+ affectedCount: z16.number().int().nonnegative(),
11974
+ mutationWarnings: z16.array(taskMutationWarningSchema),
11578
11975
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
11579
11976
  });
11580
- completionTaskStatusSchema = z14.enum(TASK_STATUSES);
11581
- completionCriterionKindSchema = z14.enum(["text", "evidence_bound", "child_task"]);
11582
- completionCriterionStatusSchema = z14.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
11583
- completionBlockerReasonSchema = z14.enum([
11977
+ completionTaskStatusSchema = z16.enum(TASK_STATUSES);
11978
+ completionCriterionKindSchema = z16.enum(["text", "evidence_bound", "child_task"]);
11979
+ completionCriterionStatusSchema = z16.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
11980
+ completionBlockerReasonSchema = z16.enum([
11584
11981
  "missing_evidence_binding",
11585
11982
  "child_not_done",
11586
11983
  "child_cancelled_requires_waiver",
@@ -11588,68 +11985,68 @@ var init_tasks2 = __esm({
11588
11985
  "child_missing",
11589
11986
  "done_parent_stale"
11590
11987
  ]);
11591
- completionStaleReasonSchema = z14.enum(["done_parent_has_unsatisfied_criteria"]);
11592
- completionProjectionRepairErrorCodeSchema = z14.enum([
11988
+ completionStaleReasonSchema = z16.enum(["done_parent_has_unsatisfied_criteria"]);
11989
+ completionProjectionRepairErrorCodeSchema = z16.enum([
11593
11990
  "projection_not_stale",
11594
11991
  "criteria_missing",
11595
11992
  "binding_target_missing",
11596
11993
  "repair_conflict"
11597
11994
  ]);
11598
- completionCriterionWaiverSchema = z14.object({
11599
- criterionAcId: z14.string().min(1),
11600
- childTaskId: z14.string().min(1),
11601
- reason: z14.string().min(1),
11602
- actor: z14.string().min(1),
11603
- waivedAt: z14.string().min(1)
11604
- });
11605
- completionCriterionReplacementSchema = z14.object({
11606
- criterionAcId: z14.string().min(1),
11607
- originalChildTaskId: z14.string().min(1),
11608
- replacementChildTaskId: z14.string().min(1),
11609
- reason: z14.string().min(1),
11610
- actor: z14.string().min(1),
11611
- replacedAt: z14.string().min(1)
11612
- });
11613
- completionCriterionEvaluationSchema = z14.object({
11614
- acId: z14.string().min(1),
11615
- alias: z14.string().min(1),
11616
- text: z14.string(),
11995
+ completionCriterionWaiverSchema = z16.object({
11996
+ criterionAcId: z16.string().min(1),
11997
+ childTaskId: z16.string().min(1),
11998
+ reason: z16.string().min(1),
11999
+ actor: z16.string().min(1),
12000
+ waivedAt: z16.string().min(1)
12001
+ });
12002
+ completionCriterionReplacementSchema = z16.object({
12003
+ criterionAcId: z16.string().min(1),
12004
+ originalChildTaskId: z16.string().min(1),
12005
+ replacementChildTaskId: z16.string().min(1),
12006
+ reason: z16.string().min(1),
12007
+ actor: z16.string().min(1),
12008
+ replacedAt: z16.string().min(1)
12009
+ });
12010
+ completionCriterionEvaluationSchema = z16.object({
12011
+ acId: z16.string().min(1),
12012
+ alias: z16.string().min(1),
12013
+ text: z16.string(),
11617
12014
  kind: completionCriterionKindSchema,
11618
12015
  status: completionCriterionStatusSchema,
11619
12016
  reason: completionBlockerReasonSchema.optional(),
11620
- targetTaskId: z14.string().min(1).optional(),
12017
+ targetTaskId: z16.string().min(1).optional(),
11621
12018
  targetTaskStatus: completionTaskStatusSchema.optional(),
11622
12019
  waiver: completionCriterionWaiverSchema.optional(),
11623
12020
  replacement: completionCriterionReplacementSchema.optional(),
11624
12021
  replacementTaskStatus: completionTaskStatusSchema.optional(),
11625
- evidenceBindings: z14.number().int().nonnegative()
12022
+ evidenceBindings: z16.number().int().nonnegative()
11626
12023
  });
11627
12024
  unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
11628
- status: z14.literal("unsatisfied"),
12025
+ status: z16.literal("unsatisfied"),
11629
12026
  reason: completionBlockerReasonSchema
11630
12027
  });
11631
- completionTotalsSchema = z14.object({
11632
- criteria: z14.number().int().nonnegative(),
11633
- satisfied: z14.number().int().nonnegative(),
11634
- unsatisfied: z14.number().int().nonnegative(),
11635
- waived: z14.number().int().nonnegative(),
11636
- replaced: z14.number().int().nonnegative()
11637
- });
11638
- completionContextPackSchema = z14.object({
11639
- taskId: z14.string().min(1),
11640
- generatedAt: z14.string().min(1),
11641
- source: z14.literal("audit_log"),
11642
- window: z14.object({
11643
- limit: z14.number().int().positive(),
11644
- since: z14.string().min(1).optional(),
11645
- relationDepth: z14.number().int().nonnegative(),
11646
- relatedTaskIds: z14.array(z14.string().min(1))
12028
+ completionTotalsSchema = z16.object({
12029
+ criteria: z16.number().int().nonnegative(),
12030
+ satisfied: z16.number().int().nonnegative(),
12031
+ unsatisfied: z16.number().int().nonnegative(),
12032
+ waived: z16.number().int().nonnegative(),
12033
+ replaced: z16.number().int().nonnegative()
12034
+ });
12035
+ completionContextPackSchema = z16.object({
12036
+ taskId: z16.string().min(1),
12037
+ generatedAt: z16.string().min(1),
12038
+ source: z16.literal("audit_log"),
12039
+ window: z16.object({
12040
+ limit: z16.number().int().positive(),
12041
+ since: z16.string().min(1).optional(),
12042
+ relationDepth: z16.number().int().nonnegative(),
12043
+ relatedTaskIds: z16.array(z16.string().min(1))
11647
12044
  }),
11648
- events: z14.array(
11649
- z14.object({
11650
- id: z14.string().min(1),
11651
- timestamp: z14.string().min(1),
11652
- action: z14.enum([
12045
+ events: z16.array(
12046
+ z16.object({
12047
+ id: z16.string().min(1),
12048
+ timestamp: z16.string().min(1),
12049
+ action: z16.enum([
11653
12050
  "task_completed",
11654
12051
  "task_reopened",
11655
12052
  "task_cancelled",
@@ -11657,77 +12054,77 @@ var init_tasks2 = __esm({
11657
12054
  "task_reparented",
11658
12055
  "ac_projection_rebuilt"
11659
12056
  ]),
11660
- taskId: z14.string().min(1),
11661
- relation: z14.enum(["self", "parent", "child", "sibling", "related"]),
11662
- actor: z14.string().min(1),
11663
- details: z14.record(z14.string(), z14.unknown()).optional(),
11664
- before: z14.record(z14.string(), z14.unknown()).optional(),
11665
- after: z14.record(z14.string(), z14.unknown()).optional()
12057
+ taskId: z16.string().min(1),
12058
+ relation: z16.enum(["self", "parent", "child", "sibling", "related"]),
12059
+ actor: z16.string().min(1),
12060
+ details: z16.record(z16.string(), z16.unknown()).optional(),
12061
+ before: z16.record(z16.string(), z16.unknown()).optional(),
12062
+ after: z16.record(z16.string(), z16.unknown()).optional()
11666
12063
  })
11667
12064
  ),
11668
- summary: z14.object({
11669
- totalEvents: z14.number().int().nonnegative(),
11670
- byAction: z14.record(z14.string(), z14.number().int().nonnegative()),
11671
- byRelation: z14.record(z14.string(), z14.number().int().nonnegative()),
11672
- latestEventAt: z14.string().nullable()
12065
+ summary: z16.object({
12066
+ totalEvents: z16.number().int().nonnegative(),
12067
+ byAction: z16.record(z16.string(), z16.number().int().nonnegative()),
12068
+ byRelation: z16.record(z16.string(), z16.number().int().nonnegative()),
12069
+ latestEventAt: z16.string().nullable()
11673
12070
  })
11674
12071
  });
11675
- completionEvaluationSchema = z14.object({
11676
- taskId: z14.string().min(1),
12072
+ completionEvaluationSchema = z16.object({
12073
+ taskId: z16.string().min(1),
11677
12074
  taskStatus: completionTaskStatusSchema,
11678
- ready: z14.boolean(),
11679
- stale: z14.boolean(),
11680
- staleReasons: z14.array(completionStaleReasonSchema),
12075
+ ready: z16.boolean(),
12076
+ stale: z16.boolean(),
12077
+ staleReasons: z16.array(completionStaleReasonSchema),
11681
12078
  contextPack: completionContextPackSchema.optional(),
11682
- satisfied: z14.array(completionCriterionEvaluationSchema),
11683
- unsatisfied: z14.array(unsatisfiedCompletionCriterionSchema),
11684
- waived: z14.array(completionCriterionEvaluationSchema),
11685
- replaced: z14.array(completionCriterionEvaluationSchema),
12079
+ satisfied: z16.array(completionCriterionEvaluationSchema),
12080
+ unsatisfied: z16.array(unsatisfiedCompletionCriterionSchema),
12081
+ waived: z16.array(completionCriterionEvaluationSchema),
12082
+ replaced: z16.array(completionCriterionEvaluationSchema),
11686
12083
  totals: completionTotalsSchema
11687
12084
  });
11688
- completionExplanationSchema = z14.object({
11689
- taskId: z14.string().min(1),
11690
- ready: z14.boolean(),
11691
- stale: z14.boolean(),
11692
- summary: z14.string(),
12085
+ completionExplanationSchema = z16.object({
12086
+ taskId: z16.string().min(1),
12087
+ ready: z16.boolean(),
12088
+ stale: z16.boolean(),
12089
+ summary: z16.string(),
11693
12090
  contextPack: completionContextPackSchema.optional(),
11694
- blockers: z14.array(completionCriterionEvaluationSchema)
12091
+ blockers: z16.array(completionCriterionEvaluationSchema)
11695
12092
  });
11696
- completionListParamsSchema = z14.object({
11697
- taskId: z14.string().min(1),
12093
+ completionListParamsSchema = z16.object({
12094
+ taskId: z16.string().min(1),
11698
12095
  status: completionCriterionStatusSchema.optional(),
11699
12096
  kind: completionCriterionKindSchema.optional()
11700
12097
  });
11701
- completionListResultSchema = z14.object({
11702
- taskId: z14.string().min(1),
11703
- criteria: z14.array(completionCriterionEvaluationSchema),
12098
+ completionListResultSchema = z16.object({
12099
+ taskId: z16.string().min(1),
12100
+ criteria: z16.array(completionCriterionEvaluationSchema),
11704
12101
  totals: completionTotalsSchema
11705
12102
  });
11706
- completionEvaluateParamsSchema = z14.object({
11707
- taskId: z14.string().min(1),
11708
- includeContext: z14.boolean().optional(),
11709
- limit: z14.number().int().positive().optional(),
11710
- since: z14.string().min(1).optional(),
11711
- relationDepth: z14.number().int().nonnegative().optional()
12103
+ completionEvaluateParamsSchema = z16.object({
12104
+ taskId: z16.string().min(1),
12105
+ includeContext: z16.boolean().optional(),
12106
+ limit: z16.number().int().positive().optional(),
12107
+ since: z16.string().min(1).optional(),
12108
+ relationDepth: z16.number().int().nonnegative().optional()
11712
12109
  });
11713
- completionProjectionRepairErrorSchema = z14.object({
12110
+ completionProjectionRepairErrorSchema = z16.object({
11714
12111
  code: completionProjectionRepairErrorCodeSchema,
11715
- message: z14.string().min(1),
11716
- taskId: z14.string().min(1),
11717
- acId: z14.string().min(1).optional(),
11718
- evidenceAtomId: z14.string().min(1).optional()
12112
+ message: z16.string().min(1),
12113
+ taskId: z16.string().min(1),
12114
+ acId: z16.string().min(1).optional(),
12115
+ evidenceAtomId: z16.string().min(1).optional()
11719
12116
  });
11720
- completionProjectionRepairParamsSchema = z14.object({
11721
- taskId: z14.string().min(1),
11722
- dryRun: z14.boolean().optional()
12117
+ completionProjectionRepairParamsSchema = z16.object({
12118
+ taskId: z16.string().min(1),
12119
+ dryRun: z16.boolean().optional()
11723
12120
  });
11724
- completionProjectionRepairResultSchema = z14.object({
11725
- taskId: z14.string().min(1),
11726
- repaired: z14.boolean(),
11727
- dryRun: z14.boolean(),
11728
- staleBefore: z14.boolean(),
11729
- staleAfter: z14.boolean(),
11730
- errors: z14.array(completionProjectionRepairErrorSchema)
12121
+ completionProjectionRepairResultSchema = z16.object({
12122
+ taskId: z16.string().min(1),
12123
+ repaired: z16.boolean(),
12124
+ dryRun: z16.boolean(),
12125
+ staleBefore: z16.boolean(),
12126
+ staleAfter: z16.boolean(),
12127
+ errors: z16.array(completionProjectionRepairErrorSchema)
11731
12128
  });
11732
12129
  }
11733
12130
  });
@@ -12238,7 +12635,7 @@ var init_taxonomy = __esm({
12238
12635
  });
12239
12636
 
12240
12637
  // packages/contracts/src/templates/manifest.ts
12241
- import { z as z15 } from "zod";
12638
+ import { z as z17 } from "zod";
12242
12639
  var TEMPLATE_KINDS, TEMPLATE_SUBSTITUTIONS, TEMPLATE_UPDATE_STRATEGIES, PLACEHOLDER_SOURCES, PlaceholderSpecSchema, TemplateManifestEntrySchema;
12243
12640
  var init_manifest2 = __esm({
12244
12641
  "packages/contracts/src/templates/manifest.ts"() {
@@ -12259,85 +12656,85 @@ var init_manifest2 = __esm({
12259
12656
  "tool-resolver",
12260
12657
  "literal"
12261
12658
  ];
12262
- PlaceholderSpecSchema = z15.object({
12659
+ PlaceholderSpecSchema = z17.object({
12263
12660
  /**
12264
12661
  * Placeholder identifier as it appears in the template body
12265
12662
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
12266
12663
  */
12267
- name: z15.string().min(1, "placeholder name must be non-empty"),
12664
+ name: z17.string().min(1, "placeholder name must be non-empty"),
12268
12665
  /** Resolver source the installer consults for this placeholder. */
12269
- source: z15.enum(PLACEHOLDER_SOURCES),
12666
+ source: z17.enum(PLACEHOLDER_SOURCES),
12270
12667
  /**
12271
12668
  * Path expression evaluated against `source` (e.g. `engines.node` against
12272
12669
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
12273
12670
  * For `literal` source, this MAY be the literal value's identifier.
12274
12671
  */
12275
- sourcePath: z15.string().min(1, "placeholder sourcePath must be non-empty"),
12672
+ sourcePath: z17.string().min(1, "placeholder sourcePath must be non-empty"),
12276
12673
  /**
12277
12674
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
12278
12675
  * `null` is permitted to explicitly mark "no default — failure required".
12279
12676
  */
12280
- defaultValue: z15.union([z15.string(), z15.number(), z15.boolean(), z15.null()]).optional()
12677
+ defaultValue: z17.union([z17.string(), z17.number(), z17.boolean(), z17.null()]).optional()
12281
12678
  });
12282
- TemplateManifestEntrySchema = z15.object({
12679
+ TemplateManifestEntrySchema = z17.object({
12283
12680
  /** Stable identifier for this template entry. */
12284
- id: z15.string().min(1, "id must be non-empty"),
12681
+ id: z17.string().min(1, "id must be non-empty"),
12285
12682
  /** Category of file this template represents. */
12286
- kind: z15.enum(TEMPLATE_KINDS),
12683
+ kind: z17.enum(TEMPLATE_KINDS),
12287
12684
  /** Repo-relative path of the template source file. */
12288
- sourcePath: z15.string().min(1, "sourcePath must be non-empty"),
12685
+ sourcePath: z17.string().min(1, "sourcePath must be non-empty"),
12289
12686
  /** Project-relative path where the rendered template installs. */
12290
- installPath: z15.string().min(1, "installPath must be non-empty"),
12687
+ installPath: z17.string().min(1, "installPath must be non-empty"),
12291
12688
  /** Substitution strategy the installer applies to `sourcePath`. */
12292
- substitution: z15.enum(TEMPLATE_SUBSTITUTIONS),
12689
+ substitution: z17.enum(TEMPLATE_SUBSTITUTIONS),
12293
12690
  /** Declared placeholders this template requires. May be empty. */
12294
- placeholders: z15.array(PlaceholderSpecSchema),
12691
+ placeholders: z17.array(PlaceholderSpecSchema),
12295
12692
  /** Reconciliation policy on upgrade. */
12296
- updateStrategy: z15.enum(TEMPLATE_UPDATE_STRATEGIES)
12693
+ updateStrategy: z17.enum(TEMPLATE_UPDATE_STRATEGIES)
12297
12694
  });
12298
12695
  }
12299
12696
  });
12300
12697
 
12301
12698
  // packages/contracts/src/validator/index.ts
12302
- import { z as z16 } from "zod";
12699
+ import { z as z18 } from "zod";
12303
12700
  var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
12304
12701
  var init_validator = __esm({
12305
12702
  "packages/contracts/src/validator/index.ts"() {
12306
12703
  "use strict";
12307
12704
  VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
12308
- validatorFindingSchema = z16.object({
12309
- acId: z16.string().min(1, "acId must be non-empty"),
12310
- status: z16.enum(["pass", "fail", "inconclusive"]),
12311
- reasoning: z16.string().min(1, "reasoning must be non-empty"),
12312
- evidenceRefs: z16.array(z16.string()).optional(),
12313
- checkedAt: z16.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
12314
- });
12315
- validatorAttestationSchema = z16.object({
12316
- verdict: z16.literal("attest"),
12317
- taskId: z16.string().min(1),
12318
- validatorId: z16.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12319
- findings: z16.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
12705
+ validatorFindingSchema = z18.object({
12706
+ acId: z18.string().min(1, "acId must be non-empty"),
12707
+ status: z18.enum(["pass", "fail", "inconclusive"]),
12708
+ reasoning: z18.string().min(1, "reasoning must be non-empty"),
12709
+ evidenceRefs: z18.array(z18.string()).optional(),
12710
+ checkedAt: z18.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
12711
+ });
12712
+ validatorAttestationSchema = z18.object({
12713
+ verdict: z18.literal("attest"),
12714
+ taskId: z18.string().min(1),
12715
+ validatorId: z18.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12716
+ findings: z18.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
12320
12717
  (findings) => findings.every((f) => f.status === "pass"),
12321
12718
  'attestation requires every finding to have status="pass"'
12322
12719
  ),
12323
- summary: z16.string().optional(),
12324
- attestedAt: z16.string().min(1),
12325
- schemaVersion: z16.literal("1")
12326
- });
12327
- validatorRejectionSchema = z16.object({
12328
- verdict: z16.literal("reject"),
12329
- taskId: z16.string().min(1),
12330
- validatorId: z16.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12331
- findings: z16.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
12720
+ summary: z18.string().optional(),
12721
+ attestedAt: z18.string().min(1),
12722
+ schemaVersion: z18.literal("1")
12723
+ });
12724
+ validatorRejectionSchema = z18.object({
12725
+ verdict: z18.literal("reject"),
12726
+ taskId: z18.string().min(1),
12727
+ validatorId: z18.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12728
+ findings: z18.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
12332
12729
  (findings) => findings.some((f) => f.status !== "pass"),
12333
12730
  'rejection requires at least one finding with status "fail" or "inconclusive"'
12334
12731
  ),
12335
- summary: z16.string().min(1, "rejection summary must be non-empty"),
12336
- remediationHints: z16.array(z16.string()).optional(),
12337
- rejectedAt: z16.string().min(1),
12338
- schemaVersion: z16.literal("1")
12732
+ summary: z18.string().min(1, "rejection summary must be non-empty"),
12733
+ remediationHints: z18.array(z18.string()).optional(),
12734
+ rejectedAt: z18.string().min(1),
12735
+ schemaVersion: z18.literal("1")
12339
12736
  });
12340
- validatorVerdictSchema = z16.discriminatedUnion("verdict", [
12737
+ validatorVerdictSchema = z18.discriminatedUnion("verdict", [
12341
12738
  validatorAttestationSchema,
12342
12739
  validatorRejectionSchema
12343
12740
  ]);
@@ -12355,6 +12752,8 @@ var init_src = __esm({
12355
12752
  init_cli_category();
12356
12753
  init_manifest();
12357
12754
  init_credentials();
12755
+ init_daemon();
12756
+ init_daemon_ipc();
12358
12757
  init_db_inventory2();
12359
12758
  init_identity();
12360
12759
  init_operations_registry();
@@ -12367,11 +12766,13 @@ var init_src = __esm({
12367
12766
  init_evidence_record_schema();
12368
12767
  init_exit_codes();
12369
12768
  init_facade();
12769
+ init_goal();
12370
12770
  init_graph();
12371
12771
  init_invariants();
12372
12772
  init_lafs();
12373
12773
  init_plugin_llm();
12374
12774
  init_observe();
12775
+ init_mvi();
12375
12776
  init_operation_envelope_validation();
12376
12777
  init_docs();
12377
12778
  init_operations();
@@ -12385,6 +12786,7 @@ var init_src = __esm({
12385
12786
  init_session2();
12386
12787
  init_session_journal();
12387
12788
  init_status_registry();
12789
+ init_supervisor_ipc();
12388
12790
  init_task();
12389
12791
  init_task_evidence();
12390
12792
  init_archive();
@@ -26412,7 +26814,7 @@ function resolveRef(ref, ctx) {
26412
26814
  function convertBaseSchema(schema, ctx) {
26413
26815
  if (schema.not !== void 0) {
26414
26816
  if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
26415
- return z17.never();
26817
+ return z19.never();
26416
26818
  }
26417
26819
  throw new Error("not is not supported in Zod (except { not: {} } for never)");
26418
26820
  }
@@ -26434,7 +26836,7 @@ function convertBaseSchema(schema, ctx) {
26434
26836
  return ctx.refs.get(refPath);
26435
26837
  }
26436
26838
  if (ctx.processing.has(refPath)) {
26437
- return z17.lazy(() => {
26839
+ return z19.lazy(() => {
26438
26840
  if (!ctx.refs.has(refPath)) {
26439
26841
  throw new Error(`Circular reference not resolved: ${refPath}`);
26440
26842
  }
@@ -26451,25 +26853,25 @@ function convertBaseSchema(schema, ctx) {
26451
26853
  if (schema.enum !== void 0) {
26452
26854
  const enumValues = schema.enum;
26453
26855
  if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
26454
- return z17.null();
26856
+ return z19.null();
26455
26857
  }
26456
26858
  if (enumValues.length === 0) {
26457
- return z17.never();
26859
+ return z19.never();
26458
26860
  }
26459
26861
  if (enumValues.length === 1) {
26460
- return z17.literal(enumValues[0]);
26862
+ return z19.literal(enumValues[0]);
26461
26863
  }
26462
26864
  if (enumValues.every((v) => typeof v === "string")) {
26463
- return z17.enum(enumValues);
26865
+ return z19.enum(enumValues);
26464
26866
  }
26465
- const literalSchemas = enumValues.map((v) => z17.literal(v));
26867
+ const literalSchemas = enumValues.map((v) => z19.literal(v));
26466
26868
  if (literalSchemas.length < 2) {
26467
26869
  return literalSchemas[0];
26468
26870
  }
26469
- return z17.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
26871
+ return z19.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
26470
26872
  }
26471
26873
  if (schema.const !== void 0) {
26472
- return z17.literal(schema.const);
26874
+ return z19.literal(schema.const);
26473
26875
  }
26474
26876
  const type = schema.type;
26475
26877
  if (Array.isArray(type)) {
@@ -26478,68 +26880,68 @@ function convertBaseSchema(schema, ctx) {
26478
26880
  return convertBaseSchema(typeSchema, ctx);
26479
26881
  });
26480
26882
  if (typeSchemas.length === 0) {
26481
- return z17.never();
26883
+ return z19.never();
26482
26884
  }
26483
26885
  if (typeSchemas.length === 1) {
26484
26886
  return typeSchemas[0];
26485
26887
  }
26486
- return z17.union(typeSchemas);
26888
+ return z19.union(typeSchemas);
26487
26889
  }
26488
26890
  if (!type) {
26489
- return z17.any();
26891
+ return z19.any();
26490
26892
  }
26491
26893
  let zodSchema2;
26492
26894
  switch (type) {
26493
26895
  case "string": {
26494
- let stringSchema = z17.string();
26896
+ let stringSchema = z19.string();
26495
26897
  if (schema.format) {
26496
26898
  const format = schema.format;
26497
26899
  if (format === "email") {
26498
- stringSchema = stringSchema.check(z17.email());
26900
+ stringSchema = stringSchema.check(z19.email());
26499
26901
  } else if (format === "uri" || format === "uri-reference") {
26500
- stringSchema = stringSchema.check(z17.url());
26902
+ stringSchema = stringSchema.check(z19.url());
26501
26903
  } else if (format === "uuid" || format === "guid") {
26502
- stringSchema = stringSchema.check(z17.uuid());
26904
+ stringSchema = stringSchema.check(z19.uuid());
26503
26905
  } else if (format === "date-time") {
26504
- stringSchema = stringSchema.check(z17.iso.datetime());
26906
+ stringSchema = stringSchema.check(z19.iso.datetime());
26505
26907
  } else if (format === "date") {
26506
- stringSchema = stringSchema.check(z17.iso.date());
26908
+ stringSchema = stringSchema.check(z19.iso.date());
26507
26909
  } else if (format === "time") {
26508
- stringSchema = stringSchema.check(z17.iso.time());
26910
+ stringSchema = stringSchema.check(z19.iso.time());
26509
26911
  } else if (format === "duration") {
26510
- stringSchema = stringSchema.check(z17.iso.duration());
26912
+ stringSchema = stringSchema.check(z19.iso.duration());
26511
26913
  } else if (format === "ipv4") {
26512
- stringSchema = stringSchema.check(z17.ipv4());
26914
+ stringSchema = stringSchema.check(z19.ipv4());
26513
26915
  } else if (format === "ipv6") {
26514
- stringSchema = stringSchema.check(z17.ipv6());
26916
+ stringSchema = stringSchema.check(z19.ipv6());
26515
26917
  } else if (format === "mac") {
26516
- stringSchema = stringSchema.check(z17.mac());
26918
+ stringSchema = stringSchema.check(z19.mac());
26517
26919
  } else if (format === "cidr") {
26518
- stringSchema = stringSchema.check(z17.cidrv4());
26920
+ stringSchema = stringSchema.check(z19.cidrv4());
26519
26921
  } else if (format === "cidr-v6") {
26520
- stringSchema = stringSchema.check(z17.cidrv6());
26922
+ stringSchema = stringSchema.check(z19.cidrv6());
26521
26923
  } else if (format === "base64") {
26522
- stringSchema = stringSchema.check(z17.base64());
26924
+ stringSchema = stringSchema.check(z19.base64());
26523
26925
  } else if (format === "base64url") {
26524
- stringSchema = stringSchema.check(z17.base64url());
26926
+ stringSchema = stringSchema.check(z19.base64url());
26525
26927
  } else if (format === "e164") {
26526
- stringSchema = stringSchema.check(z17.e164());
26928
+ stringSchema = stringSchema.check(z19.e164());
26527
26929
  } else if (format === "jwt") {
26528
- stringSchema = stringSchema.check(z17.jwt());
26930
+ stringSchema = stringSchema.check(z19.jwt());
26529
26931
  } else if (format === "emoji") {
26530
- stringSchema = stringSchema.check(z17.emoji());
26932
+ stringSchema = stringSchema.check(z19.emoji());
26531
26933
  } else if (format === "nanoid") {
26532
- stringSchema = stringSchema.check(z17.nanoid());
26934
+ stringSchema = stringSchema.check(z19.nanoid());
26533
26935
  } else if (format === "cuid") {
26534
- stringSchema = stringSchema.check(z17.cuid());
26936
+ stringSchema = stringSchema.check(z19.cuid());
26535
26937
  } else if (format === "cuid2") {
26536
- stringSchema = stringSchema.check(z17.cuid2());
26938
+ stringSchema = stringSchema.check(z19.cuid2());
26537
26939
  } else if (format === "ulid") {
26538
- stringSchema = stringSchema.check(z17.ulid());
26940
+ stringSchema = stringSchema.check(z19.ulid());
26539
26941
  } else if (format === "xid") {
26540
- stringSchema = stringSchema.check(z17.xid());
26942
+ stringSchema = stringSchema.check(z19.xid());
26541
26943
  } else if (format === "ksuid") {
26542
- stringSchema = stringSchema.check(z17.ksuid());
26944
+ stringSchema = stringSchema.check(z19.ksuid());
26543
26945
  }
26544
26946
  }
26545
26947
  if (typeof schema.minLength === "number") {
@@ -26556,7 +26958,7 @@ function convertBaseSchema(schema, ctx) {
26556
26958
  }
26557
26959
  case "number":
26558
26960
  case "integer": {
26559
- let numberSchema = type === "integer" ? z17.number().int() : z17.number();
26961
+ let numberSchema = type === "integer" ? z19.number().int() : z19.number();
26560
26962
  if (typeof schema.minimum === "number") {
26561
26963
  numberSchema = numberSchema.min(schema.minimum);
26562
26964
  }
@@ -26580,11 +26982,11 @@ function convertBaseSchema(schema, ctx) {
26580
26982
  break;
26581
26983
  }
26582
26984
  case "boolean": {
26583
- zodSchema2 = z17.boolean();
26985
+ zodSchema2 = z19.boolean();
26584
26986
  break;
26585
26987
  }
26586
26988
  case "null": {
26587
- zodSchema2 = z17.null();
26989
+ zodSchema2 = z19.null();
26588
26990
  break;
26589
26991
  }
26590
26992
  case "object": {
@@ -26597,14 +26999,14 @@ function convertBaseSchema(schema, ctx) {
26597
26999
  }
26598
27000
  if (schema.propertyNames) {
26599
27001
  const keySchema = convertSchema(schema.propertyNames, ctx);
26600
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z17.any();
27002
+ const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z19.any();
26601
27003
  if (Object.keys(shape).length === 0) {
26602
- zodSchema2 = z17.record(keySchema, valueSchema);
27004
+ zodSchema2 = z19.record(keySchema, valueSchema);
26603
27005
  break;
26604
27006
  }
26605
- const objectSchema2 = z17.object(shape).passthrough();
26606
- const recordSchema = z17.looseRecord(keySchema, valueSchema);
26607
- zodSchema2 = z17.intersection(objectSchema2, recordSchema);
27007
+ const objectSchema2 = z19.object(shape).passthrough();
27008
+ const recordSchema = z19.looseRecord(keySchema, valueSchema);
27009
+ zodSchema2 = z19.intersection(objectSchema2, recordSchema);
26608
27010
  break;
26609
27011
  }
26610
27012
  if (schema.patternProperties) {
@@ -26613,28 +27015,28 @@ function convertBaseSchema(schema, ctx) {
26613
27015
  const looseRecords = [];
26614
27016
  for (const pattern of patternKeys) {
26615
27017
  const patternValue = convertSchema(patternProps[pattern], ctx);
26616
- const keySchema = z17.string().regex(new RegExp(pattern));
26617
- looseRecords.push(z17.looseRecord(keySchema, patternValue));
27018
+ const keySchema = z19.string().regex(new RegExp(pattern));
27019
+ looseRecords.push(z19.looseRecord(keySchema, patternValue));
26618
27020
  }
26619
27021
  const schemasToIntersect = [];
26620
27022
  if (Object.keys(shape).length > 0) {
26621
- schemasToIntersect.push(z17.object(shape).passthrough());
27023
+ schemasToIntersect.push(z19.object(shape).passthrough());
26622
27024
  }
26623
27025
  schemasToIntersect.push(...looseRecords);
26624
27026
  if (schemasToIntersect.length === 0) {
26625
- zodSchema2 = z17.object({}).passthrough();
27027
+ zodSchema2 = z19.object({}).passthrough();
26626
27028
  } else if (schemasToIntersect.length === 1) {
26627
27029
  zodSchema2 = schemasToIntersect[0];
26628
27030
  } else {
26629
- let result = z17.intersection(schemasToIntersect[0], schemasToIntersect[1]);
27031
+ let result = z19.intersection(schemasToIntersect[0], schemasToIntersect[1]);
26630
27032
  for (let i = 2; i < schemasToIntersect.length; i++) {
26631
- result = z17.intersection(result, schemasToIntersect[i]);
27033
+ result = z19.intersection(result, schemasToIntersect[i]);
26632
27034
  }
26633
27035
  zodSchema2 = result;
26634
27036
  }
26635
27037
  break;
26636
27038
  }
26637
- const objectSchema = z17.object(shape);
27039
+ const objectSchema = z19.object(shape);
26638
27040
  if (schema.additionalProperties === false) {
26639
27041
  zodSchema2 = objectSchema.strict();
26640
27042
  } else if (typeof schema.additionalProperties === "object") {
@@ -26651,33 +27053,33 @@ function convertBaseSchema(schema, ctx) {
26651
27053
  const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
26652
27054
  const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
26653
27055
  if (rest) {
26654
- zodSchema2 = z17.tuple(tupleItems).rest(rest);
27056
+ zodSchema2 = z19.tuple(tupleItems).rest(rest);
26655
27057
  } else {
26656
- zodSchema2 = z17.tuple(tupleItems);
27058
+ zodSchema2 = z19.tuple(tupleItems);
26657
27059
  }
26658
27060
  if (typeof schema.minItems === "number") {
26659
- zodSchema2 = zodSchema2.check(z17.minLength(schema.minItems));
27061
+ zodSchema2 = zodSchema2.check(z19.minLength(schema.minItems));
26660
27062
  }
26661
27063
  if (typeof schema.maxItems === "number") {
26662
- zodSchema2 = zodSchema2.check(z17.maxLength(schema.maxItems));
27064
+ zodSchema2 = zodSchema2.check(z19.maxLength(schema.maxItems));
26663
27065
  }
26664
27066
  } else if (Array.isArray(items)) {
26665
27067
  const tupleItems = items.map((item) => convertSchema(item, ctx));
26666
27068
  const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
26667
27069
  if (rest) {
26668
- zodSchema2 = z17.tuple(tupleItems).rest(rest);
27070
+ zodSchema2 = z19.tuple(tupleItems).rest(rest);
26669
27071
  } else {
26670
- zodSchema2 = z17.tuple(tupleItems);
27072
+ zodSchema2 = z19.tuple(tupleItems);
26671
27073
  }
26672
27074
  if (typeof schema.minItems === "number") {
26673
- zodSchema2 = zodSchema2.check(z17.minLength(schema.minItems));
27075
+ zodSchema2 = zodSchema2.check(z19.minLength(schema.minItems));
26674
27076
  }
26675
27077
  if (typeof schema.maxItems === "number") {
26676
- zodSchema2 = zodSchema2.check(z17.maxLength(schema.maxItems));
27078
+ zodSchema2 = zodSchema2.check(z19.maxLength(schema.maxItems));
26677
27079
  }
26678
27080
  } else if (items !== void 0) {
26679
27081
  const element = convertSchema(items, ctx);
26680
- let arraySchema = z17.array(element);
27082
+ let arraySchema = z19.array(element);
26681
27083
  if (typeof schema.minItems === "number") {
26682
27084
  arraySchema = arraySchema.min(schema.minItems);
26683
27085
  }
@@ -26686,7 +27088,7 @@ function convertBaseSchema(schema, ctx) {
26686
27088
  }
26687
27089
  zodSchema2 = arraySchema;
26688
27090
  } else {
26689
- zodSchema2 = z17.array(z17.any());
27091
+ zodSchema2 = z19.array(z19.any());
26690
27092
  }
26691
27093
  break;
26692
27094
  }
@@ -26703,37 +27105,37 @@ function convertBaseSchema(schema, ctx) {
26703
27105
  }
26704
27106
  function convertSchema(schema, ctx) {
26705
27107
  if (typeof schema === "boolean") {
26706
- return schema ? z17.any() : z17.never();
27108
+ return schema ? z19.any() : z19.never();
26707
27109
  }
26708
27110
  let baseSchema = convertBaseSchema(schema, ctx);
26709
27111
  const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
26710
27112
  if (schema.anyOf && Array.isArray(schema.anyOf)) {
26711
27113
  const options = schema.anyOf.map((s) => convertSchema(s, ctx));
26712
- const anyOfUnion = z17.union(options);
26713
- baseSchema = hasExplicitType ? z17.intersection(baseSchema, anyOfUnion) : anyOfUnion;
27114
+ const anyOfUnion = z19.union(options);
27115
+ baseSchema = hasExplicitType ? z19.intersection(baseSchema, anyOfUnion) : anyOfUnion;
26714
27116
  }
26715
27117
  if (schema.oneOf && Array.isArray(schema.oneOf)) {
26716
27118
  const options = schema.oneOf.map((s) => convertSchema(s, ctx));
26717
- const oneOfUnion = z17.xor(options);
26718
- baseSchema = hasExplicitType ? z17.intersection(baseSchema, oneOfUnion) : oneOfUnion;
27119
+ const oneOfUnion = z19.xor(options);
27120
+ baseSchema = hasExplicitType ? z19.intersection(baseSchema, oneOfUnion) : oneOfUnion;
26719
27121
  }
26720
27122
  if (schema.allOf && Array.isArray(schema.allOf)) {
26721
27123
  if (schema.allOf.length === 0) {
26722
- baseSchema = hasExplicitType ? baseSchema : z17.any();
27124
+ baseSchema = hasExplicitType ? baseSchema : z19.any();
26723
27125
  } else {
26724
27126
  let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
26725
27127
  const startIdx = hasExplicitType ? 0 : 1;
26726
27128
  for (let i = startIdx; i < schema.allOf.length; i++) {
26727
- result = z17.intersection(result, convertSchema(schema.allOf[i], ctx));
27129
+ result = z19.intersection(result, convertSchema(schema.allOf[i], ctx));
26728
27130
  }
26729
27131
  baseSchema = result;
26730
27132
  }
26731
27133
  }
26732
27134
  if (schema.nullable === true && ctx.version === "openapi-3.0") {
26733
- baseSchema = z17.nullable(baseSchema);
27135
+ baseSchema = z19.nullable(baseSchema);
26734
27136
  }
26735
27137
  if (schema.readOnly === true) {
26736
- baseSchema = z17.readonly(baseSchema);
27138
+ baseSchema = z19.readonly(baseSchema);
26737
27139
  }
26738
27140
  const extraMeta = {};
26739
27141
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
@@ -26760,7 +27162,7 @@ function convertSchema(schema, ctx) {
26760
27162
  }
26761
27163
  function fromJSONSchema(schema, params) {
26762
27164
  if (typeof schema === "boolean") {
26763
- return schema ? z17.any() : z17.never();
27165
+ return schema ? z19.any() : z19.never();
26764
27166
  }
26765
27167
  const version2 = detectVersion(schema, params?.defaultTarget);
26766
27168
  const defs = schema.$defs || schema.definitions || {};
@@ -26774,14 +27176,14 @@ function fromJSONSchema(schema, params) {
26774
27176
  };
26775
27177
  return convertSchema(schema, ctx);
26776
27178
  }
26777
- var z17, RECOGNIZED_KEYS;
27179
+ var z19, RECOGNIZED_KEYS;
26778
27180
  var init_from_json_schema = __esm({
26779
27181
  "node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
26780
27182
  init_registries();
26781
27183
  init_checks2();
26782
27184
  init_iso();
26783
27185
  init_schemas2();
26784
- z17 = {
27186
+ z19 = {
26785
27187
  ...schemas_exports2,
26786
27188
  ...checks_exports2,
26787
27189
  iso: iso_exports