@cleocode/adapters 2026.5.130 → 2026.5.132
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 +1125 -723
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
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/
|
|
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
|
|
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 =
|
|
9732
|
-
provenanceEdgeRelationSchema =
|
|
9733
|
-
docLifecycleStatusSchema =
|
|
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:
|
|
9736
|
-
title:
|
|
9737
|
-
metadata:
|
|
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 =
|
|
10101
|
+
provenanceDocNodeSchema = z7.object({
|
|
9740
10102
|
...provenanceNodeBaseFields,
|
|
9741
|
-
kind:
|
|
9742
|
-
slug:
|
|
9743
|
-
docKind:
|
|
10103
|
+
kind: z7.literal("doc"),
|
|
10104
|
+
slug: z7.string().min(1),
|
|
10105
|
+
docKind: z7.string().min(1),
|
|
9744
10106
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
9745
|
-
publishedAt:
|
|
9746
|
-
supersededAt:
|
|
9747
|
-
summary:
|
|
10107
|
+
publishedAt: z7.string().min(1),
|
|
10108
|
+
supersededAt: z7.string().min(1).optional(),
|
|
10109
|
+
summary: z7.string().optional()
|
|
9748
10110
|
});
|
|
9749
|
-
provenanceTaskNodeSchema =
|
|
10111
|
+
provenanceTaskNodeSchema = z7.object({
|
|
9750
10112
|
...provenanceNodeBaseFields,
|
|
9751
|
-
kind:
|
|
9752
|
-
taskType:
|
|
9753
|
-
status:
|
|
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 =
|
|
10117
|
+
provenanceDecisionNodeSchema = z7.object({
|
|
9756
10118
|
...provenanceNodeBaseFields,
|
|
9757
|
-
kind:
|
|
9758
|
-
outcome:
|
|
9759
|
-
decidedAt:
|
|
10119
|
+
kind: z7.literal("decision"),
|
|
10120
|
+
outcome: z7.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
10121
|
+
decidedAt: z7.string().min(1)
|
|
9760
10122
|
});
|
|
9761
|
-
provenanceSessionNodeSchema =
|
|
10123
|
+
provenanceSessionNodeSchema = z7.object({
|
|
9762
10124
|
...provenanceNodeBaseFields,
|
|
9763
|
-
kind:
|
|
9764
|
-
startedAt:
|
|
9765
|
-
endedAt:
|
|
10125
|
+
kind: z7.literal("session"),
|
|
10126
|
+
startedAt: z7.string().min(1),
|
|
10127
|
+
endedAt: z7.string().min(1).optional()
|
|
9766
10128
|
});
|
|
9767
|
-
provenanceMemoryNodeSchema =
|
|
10129
|
+
provenanceMemoryNodeSchema = z7.object({
|
|
9768
10130
|
...provenanceNodeBaseFields,
|
|
9769
|
-
kind:
|
|
9770
|
-
memoryType:
|
|
9771
|
-
recordedAt:
|
|
10131
|
+
kind: z7.literal("memory"),
|
|
10132
|
+
memoryType: z7.enum(["observation", "pattern", "decision", "diary"]),
|
|
10133
|
+
recordedAt: z7.string().min(1)
|
|
9772
10134
|
});
|
|
9773
|
-
provenanceNodeSchema =
|
|
10135
|
+
provenanceNodeSchema = z7.discriminatedUnion("kind", [
|
|
9774
10136
|
provenanceDocNodeSchema,
|
|
9775
10137
|
provenanceTaskNodeSchema,
|
|
9776
10138
|
provenanceDecisionNodeSchema,
|
|
9777
10139
|
provenanceSessionNodeSchema,
|
|
9778
10140
|
provenanceMemoryNodeSchema
|
|
9779
10141
|
]);
|
|
9780
|
-
provenanceEdgeSchema =
|
|
10142
|
+
provenanceEdgeSchema = z7.object({
|
|
9781
10143
|
relation: provenanceEdgeRelationSchema,
|
|
9782
|
-
from:
|
|
10144
|
+
from: z7.string().min(1),
|
|
9783
10145
|
fromKind: provenanceNodeKindSchema,
|
|
9784
|
-
to:
|
|
10146
|
+
to: z7.string().min(1),
|
|
9785
10147
|
toKind: provenanceNodeKindSchema,
|
|
9786
|
-
addedAt:
|
|
9787
|
-
summary:
|
|
10148
|
+
addedAt: z7.string().min(1),
|
|
10149
|
+
summary: z7.string().optional()
|
|
9788
10150
|
});
|
|
9789
|
-
docProvenanceResponseSchema =
|
|
9790
|
-
nodes:
|
|
9791
|
-
edges:
|
|
9792
|
-
totalNodes:
|
|
9793
|
-
totalEdges:
|
|
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
|
|
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 =
|
|
9857
|
-
kind:
|
|
9858
|
-
sha:
|
|
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 =
|
|
9861
|
-
kind:
|
|
9862
|
-
paths:
|
|
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 =
|
|
9865
|
-
kind:
|
|
9866
|
-
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 =
|
|
9869
|
-
kind:
|
|
9870
|
-
tool:
|
|
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 =
|
|
9873
|
-
kind:
|
|
9874
|
-
url:
|
|
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 =
|
|
9877
|
-
kind:
|
|
9878
|
-
note:
|
|
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 =
|
|
9881
|
-
kind:
|
|
9882
|
-
decisionId:
|
|
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 =
|
|
9885
|
-
kind:
|
|
9886
|
-
prNumber:
|
|
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 =
|
|
9889
|
-
kind:
|
|
9890
|
-
fromLines:
|
|
9891
|
-
toLines:
|
|
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 =
|
|
9894
|
-
kind:
|
|
9895
|
-
symbolName:
|
|
9896
|
-
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 =
|
|
9903
|
-
kind:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 =
|
|
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
|
|
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 =
|
|
10330
|
+
evidenceBaseSchema = z9.object({
|
|
9969
10331
|
/** Identity string of the agent that produced this record. */
|
|
9970
|
-
agentIdentity:
|
|
10332
|
+
agentIdentity: z9.string().min(1),
|
|
9971
10333
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
9972
|
-
attachmentSha256:
|
|
10334
|
+
attachmentSha256: z9.string().length(64),
|
|
9973
10335
|
/** ISO 8601 timestamp at which the action ran. */
|
|
9974
|
-
ranAt:
|
|
10336
|
+
ranAt: z9.string().datetime(),
|
|
9975
10337
|
/** Wall-clock duration of the action in milliseconds. */
|
|
9976
|
-
durationMs:
|
|
10338
|
+
durationMs: z9.number().nonnegative()
|
|
9977
10339
|
});
|
|
9978
10340
|
implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
9979
|
-
kind:
|
|
9980
|
-
phase:
|
|
9981
|
-
filesChanged:
|
|
9982
|
-
linesAdded:
|
|
9983
|
-
linesRemoved:
|
|
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:
|
|
9987
|
-
phase:
|
|
9988
|
-
reqIdsChecked:
|
|
9989
|
-
passed:
|
|
9990
|
-
details:
|
|
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:
|
|
9994
|
-
phase:
|
|
9995
|
-
command:
|
|
9996
|
-
exitCode:
|
|
9997
|
-
testsPassed:
|
|
9998
|
-
testsFailed:
|
|
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:
|
|
10002
|
-
phase:
|
|
10003
|
-
tool:
|
|
10004
|
-
passed:
|
|
10005
|
-
warnings:
|
|
10006
|
-
errors:
|
|
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:
|
|
10010
|
-
phase:
|
|
10011
|
-
cmd:
|
|
10012
|
-
exitCode:
|
|
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 =
|
|
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
|
|
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 =
|
|
10538
|
-
taskPrioritySchema =
|
|
10539
|
-
taskStatusSchema =
|
|
10540
|
-
verificationGateSchema =
|
|
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 =
|
|
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 =
|
|
10946
|
+
workGraphTraversalDirectionSchema = z10.enum([
|
|
10558
10947
|
"ancestors",
|
|
10559
10948
|
"descendants",
|
|
10560
10949
|
"upstream",
|
|
10561
10950
|
"downstream"
|
|
10562
10951
|
]);
|
|
10563
|
-
workGraphEdgeDirectionSchema =
|
|
10564
|
-
paginationParamsSchema =
|
|
10565
|
-
cursor:
|
|
10566
|
-
limit:
|
|
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 =
|
|
10569
|
-
id:
|
|
10957
|
+
workGraphNodeSchema = z10.object({
|
|
10958
|
+
id: z10.string().min(1),
|
|
10570
10959
|
type: taskTypeSchema,
|
|
10571
|
-
title:
|
|
10960
|
+
title: z10.string(),
|
|
10572
10961
|
status: taskStatusSchema,
|
|
10573
10962
|
priority: taskPrioritySchema,
|
|
10574
|
-
parentId:
|
|
10963
|
+
parentId: z10.string().min(1).optional()
|
|
10575
10964
|
});
|
|
10576
|
-
workGraphEdgeSchema =
|
|
10577
|
-
fromId:
|
|
10578
|
-
toId:
|
|
10965
|
+
workGraphEdgeSchema = z10.object({
|
|
10966
|
+
fromId: z10.string().min(1),
|
|
10967
|
+
toId: z10.string().min(1),
|
|
10579
10968
|
kind: workGraphRelationKindSchema
|
|
10580
10969
|
});
|
|
10581
|
-
workGraphHierarchyEdgeSchema =
|
|
10582
|
-
fromId:
|
|
10583
|
-
toId:
|
|
10584
|
-
kind:
|
|
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 =
|
|
10587
|
-
nextCursor:
|
|
10588
|
-
hasMore:
|
|
10589
|
-
});
|
|
10590
|
-
workGraphRollupCountsSchema =
|
|
10591
|
-
total:
|
|
10592
|
-
byStatus:
|
|
10593
|
-
byType:
|
|
10594
|
-
});
|
|
10595
|
-
workGraphSubtreePercentagesSchema =
|
|
10596
|
-
done:
|
|
10597
|
-
active:
|
|
10598
|
-
blocked:
|
|
10599
|
-
pending:
|
|
10600
|
-
cancelled:
|
|
10601
|
-
});
|
|
10602
|
-
workGraphProjectionMismatchSchema =
|
|
10603
|
-
field:
|
|
10604
|
-
expected:
|
|
10605
|
-
actual:
|
|
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:
|
|
10609
|
-
dependencyBlockers:
|
|
10610
|
-
gateBlockers:
|
|
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:
|
|
10614
|
-
relationType:
|
|
10615
|
-
reason:
|
|
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:
|
|
10619
|
-
kind:
|
|
11007
|
+
source: z10.literal("dependency"),
|
|
11008
|
+
kind: z10.literal("depends_on")
|
|
10620
11009
|
});
|
|
10621
|
-
workGraphOmissionReasonSchema =
|
|
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 =
|
|
10629
|
-
tokenBudget:
|
|
10630
|
-
estimatedTokens:
|
|
10631
|
-
remainingTokens:
|
|
10632
|
-
truncated:
|
|
10633
|
-
});
|
|
10634
|
-
workGraphOmissionSchema =
|
|
10635
|
-
path:
|
|
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:
|
|
10638
|
-
estimatedTokens:
|
|
11026
|
+
message: z10.string().min(1),
|
|
11027
|
+
estimatedTokens: z10.number().int().nonnegative().optional()
|
|
10639
11028
|
});
|
|
10640
|
-
workGraphDirectEdgeSchema =
|
|
11029
|
+
workGraphDirectEdgeSchema = z10.discriminatedUnion("source", [
|
|
10641
11030
|
workGraphRelationEdgeSchema,
|
|
10642
11031
|
workGraphDependencyEdgeSchema
|
|
10643
11032
|
]);
|
|
10644
11033
|
workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
10645
|
-
rootId:
|
|
10646
|
-
tokenBudget:
|
|
10647
|
-
includeRelations:
|
|
10648
|
-
includeReadiness:
|
|
10649
|
-
includeRollup:
|
|
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:
|
|
11041
|
+
rootId: z10.string().min(1),
|
|
10653
11042
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
10654
|
-
maxDepth:
|
|
10655
|
-
includeRelations:
|
|
11043
|
+
maxDepth: z10.number().int().nonnegative().optional(),
|
|
11044
|
+
includeRelations: z10.boolean().optional()
|
|
10656
11045
|
});
|
|
10657
|
-
workGraphSliceSchema =
|
|
10658
|
-
rootId:
|
|
11046
|
+
workGraphSliceSchema = z10.object({
|
|
11047
|
+
rootId: z10.string().min(1),
|
|
10659
11048
|
direction: workGraphTraversalDirectionSchema,
|
|
10660
|
-
nodes:
|
|
10661
|
-
edges:
|
|
11049
|
+
nodes: z10.array(workGraphNodeSchema),
|
|
11050
|
+
edges: z10.array(workGraphEdgeSchema),
|
|
10662
11051
|
pageInfo: workGraphPageInfoSchema,
|
|
10663
|
-
omissions:
|
|
10664
|
-
});
|
|
10665
|
-
workGraphReadinessParamsSchema =
|
|
10666
|
-
rootId:
|
|
10667
|
-
role:
|
|
10668
|
-
includeGateBlockers:
|
|
10669
|
-
});
|
|
10670
|
-
workGraphReadinessResultSchema =
|
|
10671
|
-
rootId:
|
|
10672
|
-
role:
|
|
10673
|
-
ready:
|
|
10674
|
-
warnings:
|
|
10675
|
-
groups:
|
|
10676
|
-
ready:
|
|
10677
|
-
blocked:
|
|
10678
|
-
blockedBy:
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
kind:
|
|
10682
|
-
blockerId:
|
|
10683
|
-
blocks:
|
|
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
|
-
|
|
10686
|
-
kind:
|
|
11074
|
+
z10.object({
|
|
11075
|
+
kind: z10.literal("gate"),
|
|
10687
11076
|
gate: verificationGateSchema,
|
|
10688
|
-
blocks:
|
|
11077
|
+
blocks: z10.array(z10.string().min(1))
|
|
10689
11078
|
})
|
|
10690
11079
|
])
|
|
10691
11080
|
)
|
|
10692
11081
|
})
|
|
10693
11082
|
});
|
|
10694
|
-
workGraphContextPackSchema =
|
|
10695
|
-
rootId:
|
|
10696
|
-
generatedAt:
|
|
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:
|
|
10700
|
-
rootId:
|
|
11088
|
+
relationEdges: z10.object({
|
|
11089
|
+
rootId: z10.string().min(1),
|
|
10701
11090
|
direction: workGraphEdgeDirectionSchema,
|
|
10702
|
-
edges:
|
|
11091
|
+
edges: z10.array(workGraphDirectEdgeSchema)
|
|
10703
11092
|
}).optional(),
|
|
10704
11093
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
10705
|
-
rollup:
|
|
10706
|
-
omissions:
|
|
10707
|
-
});
|
|
10708
|
-
workGraphScaffoldValidateParamsSchema =
|
|
10709
|
-
rootId:
|
|
10710
|
-
nodes:
|
|
10711
|
-
|
|
10712
|
-
id:
|
|
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:
|
|
11103
|
+
parentId: z10.string().min(1).nullable().optional()
|
|
10715
11104
|
})
|
|
10716
11105
|
),
|
|
10717
|
-
edges:
|
|
10718
|
-
dryRun:
|
|
10719
|
-
});
|
|
10720
|
-
workGraphScaffoldValidationIssueSchema =
|
|
10721
|
-
code:
|
|
10722
|
-
message:
|
|
10723
|
-
taskId:
|
|
10724
|
-
severity:
|
|
10725
|
-
});
|
|
10726
|
-
workGraphScaffoldValidateResultSchema =
|
|
10727
|
-
rootId:
|
|
10728
|
-
valid:
|
|
10729
|
-
dryRun:
|
|
10730
|
-
issues:
|
|
10731
|
-
hierarchy:
|
|
10732
|
-
valid:
|
|
10733
|
-
violations:
|
|
10734
|
-
|
|
10735
|
-
code:
|
|
10736
|
-
taskId:
|
|
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:
|
|
11127
|
+
parentId: z10.string().min(1).nullable(),
|
|
10739
11128
|
parentType: taskTypeSchema.optional(),
|
|
10740
|
-
message:
|
|
11129
|
+
message: z10.string().min(1)
|
|
10741
11130
|
})
|
|
10742
11131
|
)
|
|
10743
11132
|
})
|
|
10744
11133
|
});
|
|
10745
11134
|
workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
10746
|
-
apply:
|
|
11135
|
+
apply: z10.boolean().optional()
|
|
10747
11136
|
});
|
|
10748
11137
|
workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
10749
|
-
applied:
|
|
10750
|
-
nodesChanged:
|
|
10751
|
-
edgesChanged:
|
|
10752
|
-
});
|
|
10753
|
-
workGraphPlanningDocParamsSchema =
|
|
10754
|
-
rootId:
|
|
10755
|
-
audience:
|
|
10756
|
-
tokenBudget:
|
|
10757
|
-
includeRelations:
|
|
10758
|
-
includeReadiness:
|
|
10759
|
-
includeRollup:
|
|
10760
|
-
});
|
|
10761
|
-
workGraphPlanningDocSchema =
|
|
10762
|
-
rootId:
|
|
10763
|
-
generatedAt:
|
|
10764
|
-
audience:
|
|
10765
|
-
title:
|
|
10766
|
-
content:
|
|
10767
|
-
sections:
|
|
10768
|
-
estimatedTokens:
|
|
10769
|
-
budget:
|
|
10770
|
-
tokenBudget:
|
|
10771
|
-
truncated:
|
|
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:
|
|
11164
|
+
rootId: z10.string().min(1),
|
|
10776
11165
|
direction: workGraphTraversalDirectionSchema,
|
|
10777
|
-
maxDepth:
|
|
10778
|
-
includeRelations:
|
|
11166
|
+
maxDepth: z10.number().int().nonnegative().optional(),
|
|
11167
|
+
includeRelations: z10.boolean().optional()
|
|
10779
11168
|
});
|
|
10780
|
-
tasksTraverseResultSchema =
|
|
10781
|
-
rootId:
|
|
11169
|
+
tasksTraverseResultSchema = z10.object({
|
|
11170
|
+
rootId: z10.string().min(1),
|
|
10782
11171
|
direction: workGraphTraversalDirectionSchema,
|
|
10783
|
-
nodes:
|
|
10784
|
-
edges:
|
|
11172
|
+
nodes: z10.array(workGraphNodeSchema),
|
|
11173
|
+
edges: z10.array(workGraphEdgeSchema),
|
|
10785
11174
|
pageInfo: workGraphPageInfoSchema
|
|
10786
11175
|
});
|
|
10787
11176
|
tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
10788
|
-
rootId:
|
|
10789
|
-
maxDepth:
|
|
11177
|
+
rootId: z10.string().min(1),
|
|
11178
|
+
maxDepth: z10.number().int().nonnegative().optional()
|
|
10790
11179
|
});
|
|
10791
|
-
tasksTreeResultSchema =
|
|
10792
|
-
rootId:
|
|
10793
|
-
nodes:
|
|
10794
|
-
edges:
|
|
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 =
|
|
10798
|
-
rootId:
|
|
11186
|
+
tasksRollupParamsSchema = z10.object({
|
|
11187
|
+
rootId: z10.string().min(1),
|
|
10799
11188
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
10800
11189
|
});
|
|
10801
|
-
tasksRollupResultSchema =
|
|
10802
|
-
rootId:
|
|
11190
|
+
tasksRollupResultSchema = z10.object({
|
|
11191
|
+
rootId: z10.string().min(1),
|
|
10803
11192
|
direct: workGraphRollupCountsSchema,
|
|
10804
11193
|
subtree: workGraphRollupCountsSchema,
|
|
10805
|
-
percentDenominator:
|
|
10806
|
-
basis:
|
|
10807
|
-
total:
|
|
10808
|
-
description:
|
|
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:
|
|
10812
|
-
projectionMismatches:
|
|
10813
|
-
});
|
|
10814
|
-
tasksFrontierParamsSchema =
|
|
10815
|
-
rootId:
|
|
10816
|
-
role:
|
|
10817
|
-
});
|
|
10818
|
-
tasksFrontierResultSchema =
|
|
10819
|
-
rootId:
|
|
10820
|
-
role:
|
|
10821
|
-
groups:
|
|
10822
|
-
ready:
|
|
10823
|
-
blocked:
|
|
10824
|
-
blockedBy:
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
kind:
|
|
10828
|
-
blockerId:
|
|
10829
|
-
blocks:
|
|
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
|
-
|
|
10832
|
-
kind:
|
|
11220
|
+
z10.object({
|
|
11221
|
+
kind: z10.literal("gate"),
|
|
10833
11222
|
gate: verificationGateSchema,
|
|
10834
|
-
blocks:
|
|
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:
|
|
10842
|
-
maxDepth:
|
|
10843
|
-
includeRelations:
|
|
10844
|
-
});
|
|
10845
|
-
tasksWorkGraphAuditResultSchema =
|
|
10846
|
-
rootId:
|
|
10847
|
-
hierarchy:
|
|
10848
|
-
valid:
|
|
10849
|
-
violations:
|
|
10850
|
-
|
|
10851
|
-
code:
|
|
10852
|
-
taskId:
|
|
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:
|
|
11243
|
+
parentId: z10.string().min(1).nullable(),
|
|
10855
11244
|
parentType: taskTypeSchema.optional(),
|
|
10856
|
-
message:
|
|
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:
|
|
10864
|
-
rootId:
|
|
11252
|
+
relationEdges: z10.object({
|
|
11253
|
+
rootId: z10.string().min(1),
|
|
10865
11254
|
direction: workGraphEdgeDirectionSchema,
|
|
10866
|
-
edges:
|
|
10867
|
-
|
|
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
|
|
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 =
|
|
11139
|
-
kind:
|
|
11140
|
-
prNumber:
|
|
11141
|
-
});
|
|
11142
|
-
prEvidenceStateModifierSchema =
|
|
11143
|
-
kind:
|
|
11144
|
-
value:
|
|
11145
|
-
});
|
|
11146
|
-
ghPrViewSchema =
|
|
11147
|
-
state:
|
|
11148
|
-
mergedAt:
|
|
11149
|
-
headRefOid:
|
|
11150
|
-
mergeable:
|
|
11151
|
-
statusCheckRollup:
|
|
11152
|
-
|
|
11153
|
-
__typename:
|
|
11154
|
-
name:
|
|
11155
|
-
workflowName:
|
|
11156
|
-
conclusion:
|
|
11157
|
-
status:
|
|
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
|
|
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 =
|
|
11214
|
-
ReleaseSchemeSchema =
|
|
11215
|
-
ReleaseKindSchema =
|
|
11216
|
-
ReleaseStatusSchema =
|
|
11217
|
-
GateStatusSchema =
|
|
11218
|
-
GateNameSchema =
|
|
11219
|
-
PlatformTupleSchema =
|
|
11220
|
-
PublisherSchema =
|
|
11221
|
-
TaskKindSchema =
|
|
11222
|
-
ImpactSchema =
|
|
11223
|
-
ResolvedSourceSchema =
|
|
11224
|
-
Iso8601 =
|
|
11225
|
-
NonEmptyString =
|
|
11226
|
-
ReleasePlanTaskSchema =
|
|
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:
|
|
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:
|
|
11638
|
+
evidenceAtoms: z12.array(NonEmptyString),
|
|
11242
11639
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
11243
|
-
ivtrPhaseAtPlan:
|
|
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 =
|
|
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:
|
|
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 =
|
|
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:
|
|
11666
|
+
smoke: z12.boolean().default(true).optional()
|
|
11270
11667
|
});
|
|
11271
|
-
ReleasePreflightSummarySchema =
|
|
11668
|
+
ReleasePreflightSummarySchema = z12.object({
|
|
11272
11669
|
/** True if esbuild externals are out of sync with package.json. */
|
|
11273
|
-
esbuildExternalsDrift:
|
|
11670
|
+
esbuildExternalsDrift: z12.boolean(),
|
|
11274
11671
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
11275
|
-
lockfileDrift:
|
|
11672
|
+
lockfileDrift: z12.boolean(),
|
|
11276
11673
|
/** True if all epic children are in terminal lifecycle states. */
|
|
11277
|
-
epicCompletenessClean:
|
|
11674
|
+
epicCompletenessClean: z12.boolean(),
|
|
11278
11675
|
/** True if no task appears in multiple in-flight release plans. */
|
|
11279
|
-
doubleListingClean:
|
|
11676
|
+
doubleListingClean: z12.boolean(),
|
|
11280
11677
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
11281
|
-
preflightWarnings:
|
|
11678
|
+
preflightWarnings: z12.array(z12.string()).default([]).optional()
|
|
11282
11679
|
});
|
|
11283
|
-
ReleasePlanChangelogSchema =
|
|
11680
|
+
ReleasePlanChangelogSchema = z12.object({
|
|
11284
11681
|
/** `kind=feat` tasks. */
|
|
11285
|
-
features:
|
|
11682
|
+
features: z12.array(NonEmptyString).default([]),
|
|
11286
11683
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
11287
|
-
fixes:
|
|
11684
|
+
fixes: z12.array(NonEmptyString).default([]),
|
|
11288
11685
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
11289
|
-
chores:
|
|
11686
|
+
chores: z12.array(NonEmptyString).default([]),
|
|
11290
11687
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
11291
|
-
breaking:
|
|
11688
|
+
breaking: z12.array(NonEmptyString).default([])
|
|
11292
11689
|
});
|
|
11293
|
-
ReleasePlanMetaSchema =
|
|
11690
|
+
ReleasePlanMetaSchema = z12.object({
|
|
11294
11691
|
/** True if this is the project's first ever release. */
|
|
11295
|
-
firstEverRelease:
|
|
11692
|
+
firstEverRelease: z12.boolean().optional(),
|
|
11296
11693
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
11297
|
-
unresolvedTools:
|
|
11694
|
+
unresolvedTools: z12.array(z12.string()).optional(),
|
|
11298
11695
|
/** Project archetype detected at plan time. */
|
|
11299
|
-
archetype:
|
|
11300
|
-
}).catchall(
|
|
11301
|
-
ReleasePlanSchema =
|
|
11696
|
+
archetype: z12.string().optional()
|
|
11697
|
+
}).catchall(z12.unknown());
|
|
11698
|
+
ReleasePlanSchema = z12.object({
|
|
11302
11699
|
/** Schema URL for this plan version. */
|
|
11303
|
-
$schema:
|
|
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:
|
|
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:
|
|
11723
|
+
previousVersion: z12.string().nullable(),
|
|
11327
11724
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
11328
|
-
previousTag:
|
|
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:
|
|
11729
|
+
tasks: z12.array(ReleasePlanTaskSchema),
|
|
11333
11730
|
/** Bucketed changelog. */
|
|
11334
11731
|
changelog: ReleasePlanChangelogSchema,
|
|
11335
11732
|
/** Per-gate verification status. */
|
|
11336
|
-
gates:
|
|
11733
|
+
gates: z12.array(ReleaseGateSchema),
|
|
11337
11734
|
/** Platform / publisher matrix. */
|
|
11338
|
-
platformMatrix:
|
|
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:
|
|
11739
|
+
workflowRunUrl: z12.string().nullable(),
|
|
11343
11740
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
11344
|
-
prUrl:
|
|
11741
|
+
prUrl: z12.string().nullable(),
|
|
11345
11742
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
11346
|
-
mergeCommitSha:
|
|
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
|
|
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 =
|
|
11805
|
+
sessionJournalDoctorSummarySchema = z13.object({
|
|
11409
11806
|
/** `true` when zero noise patterns were detected. */
|
|
11410
|
-
isClean:
|
|
11807
|
+
isClean: z13.boolean(),
|
|
11411
11808
|
/** Total number of noise findings across all patterns. */
|
|
11412
|
-
findingsCount:
|
|
11809
|
+
findingsCount: z13.number().int().nonnegative(),
|
|
11413
11810
|
/** Pattern names that were detected (empty when isClean). */
|
|
11414
|
-
patterns:
|
|
11811
|
+
patterns: z13.array(z13.string()),
|
|
11415
11812
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
11416
|
-
totalScanned:
|
|
11813
|
+
totalScanned: z13.number().int().nonnegative()
|
|
11417
11814
|
});
|
|
11418
|
-
sessionJournalDebriefSummarySchema =
|
|
11815
|
+
sessionJournalDebriefSummarySchema = z13.object({
|
|
11419
11816
|
/** First 200 characters of the session end note (if provided). */
|
|
11420
|
-
noteExcerpt:
|
|
11817
|
+
noteExcerpt: z13.string().max(200).optional(),
|
|
11421
11818
|
/** Number of tasks completed during the session. */
|
|
11422
|
-
tasksCompletedCount:
|
|
11819
|
+
tasksCompletedCount: z13.number().int().nonnegative(),
|
|
11423
11820
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
11424
|
-
tasksFocused:
|
|
11821
|
+
tasksFocused: z13.array(z13.string()).max(5).optional()
|
|
11425
11822
|
});
|
|
11426
|
-
sessionJournalEntrySchema =
|
|
11823
|
+
sessionJournalEntrySchema = z13.object({
|
|
11427
11824
|
// Identity
|
|
11428
11825
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
11429
|
-
schemaVersion:
|
|
11826
|
+
schemaVersion: z13.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
11430
11827
|
/** ISO 8601 timestamp when the entry was written. */
|
|
11431
|
-
timestamp:
|
|
11828
|
+
timestamp: z13.string(),
|
|
11432
11829
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
11433
|
-
sessionId:
|
|
11830
|
+
sessionId: z13.string(),
|
|
11434
11831
|
/** Event type that triggered this journal entry. */
|
|
11435
|
-
eventType:
|
|
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:
|
|
11835
|
+
agentIdentifier: z13.string().optional(),
|
|
11439
11836
|
/** Provider adapter ID active for this session. */
|
|
11440
|
-
providerId:
|
|
11837
|
+
providerId: z13.string().optional(),
|
|
11441
11838
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
11442
|
-
scope:
|
|
11839
|
+
scope: z13.string().optional(),
|
|
11443
11840
|
// Session-end fields
|
|
11444
11841
|
/** Duration of the session in seconds (session_end only). */
|
|
11445
|
-
duration:
|
|
11842
|
+
duration: z13.number().int().nonnegative().optional(),
|
|
11446
11843
|
/** Task IDs (not titles) completed during the session. */
|
|
11447
|
-
tasksCompleted:
|
|
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:
|
|
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
|
|
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 =
|
|
11475
|
-
kind:
|
|
11476
|
-
sha256:
|
|
11477
|
-
timestamp:
|
|
11478
|
-
path:
|
|
11479
|
-
mime:
|
|
11480
|
-
description:
|
|
11481
|
-
});
|
|
11482
|
-
logEvidenceSchema =
|
|
11483
|
-
kind:
|
|
11484
|
-
sha256:
|
|
11485
|
-
timestamp:
|
|
11486
|
-
source:
|
|
11487
|
-
description:
|
|
11488
|
-
});
|
|
11489
|
-
screenshotEvidenceSchema =
|
|
11490
|
-
kind:
|
|
11491
|
-
sha256:
|
|
11492
|
-
timestamp:
|
|
11493
|
-
mime:
|
|
11494
|
-
description:
|
|
11495
|
-
});
|
|
11496
|
-
testOutputEvidenceSchema =
|
|
11497
|
-
kind:
|
|
11498
|
-
sha256:
|
|
11499
|
-
timestamp:
|
|
11500
|
-
passed:
|
|
11501
|
-
failed:
|
|
11502
|
-
skipped:
|
|
11503
|
-
exitCode:
|
|
11504
|
-
description:
|
|
11505
|
-
});
|
|
11506
|
-
commandOutputEvidenceSchema =
|
|
11507
|
-
kind:
|
|
11508
|
-
sha256:
|
|
11509
|
-
timestamp:
|
|
11510
|
-
cmd:
|
|
11511
|
-
exitCode:
|
|
11512
|
-
description:
|
|
11513
|
-
});
|
|
11514
|
-
taskEvidenceSchema =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
11550
|
-
taskMutationWarningSchema =
|
|
11551
|
-
code:
|
|
11552
|
-
message:
|
|
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:
|
|
11555
|
-
field:
|
|
11556
|
-
index:
|
|
11557
|
-
});
|
|
11558
|
-
taskMutationDryRunSummarySchema =
|
|
11559
|
-
dryRun:
|
|
11560
|
-
wouldCreate:
|
|
11561
|
-
wouldUpdate:
|
|
11562
|
-
wouldDelete:
|
|
11563
|
-
wouldAffect:
|
|
11564
|
-
validatedCount:
|
|
11565
|
-
insertedCount:
|
|
11566
|
-
updatedCount:
|
|
11567
|
-
deletedCount:
|
|
11568
|
-
warnings:
|
|
11569
|
-
});
|
|
11570
|
-
taskMutationTaskRecordSchema =
|
|
11571
|
-
taskMutationEnvelopeSchema =
|
|
11572
|
-
dryRun:
|
|
11573
|
-
created:
|
|
11574
|
-
updated:
|
|
11575
|
-
deleted:
|
|
11576
|
-
affectedCount:
|
|
11577
|
-
mutationWarnings:
|
|
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 =
|
|
11581
|
-
completionCriterionKindSchema =
|
|
11582
|
-
completionCriterionStatusSchema =
|
|
11583
|
-
completionBlockerReasonSchema =
|
|
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 =
|
|
11592
|
-
completionProjectionRepairErrorCodeSchema =
|
|
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 =
|
|
11599
|
-
criterionAcId:
|
|
11600
|
-
childTaskId:
|
|
11601
|
-
reason:
|
|
11602
|
-
actor:
|
|
11603
|
-
waivedAt:
|
|
11604
|
-
});
|
|
11605
|
-
completionCriterionReplacementSchema =
|
|
11606
|
-
criterionAcId:
|
|
11607
|
-
originalChildTaskId:
|
|
11608
|
-
replacementChildTaskId:
|
|
11609
|
-
reason:
|
|
11610
|
-
actor:
|
|
11611
|
-
replacedAt:
|
|
11612
|
-
});
|
|
11613
|
-
completionCriterionEvaluationSchema =
|
|
11614
|
-
acId:
|
|
11615
|
-
alias:
|
|
11616
|
-
text:
|
|
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:
|
|
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:
|
|
12022
|
+
evidenceBindings: z16.number().int().nonnegative()
|
|
11626
12023
|
});
|
|
11627
12024
|
unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
11628
|
-
status:
|
|
12025
|
+
status: z16.literal("unsatisfied"),
|
|
11629
12026
|
reason: completionBlockerReasonSchema
|
|
11630
12027
|
});
|
|
11631
|
-
completionTotalsSchema =
|
|
11632
|
-
criteria:
|
|
11633
|
-
satisfied:
|
|
11634
|
-
unsatisfied:
|
|
11635
|
-
waived:
|
|
11636
|
-
replaced:
|
|
11637
|
-
});
|
|
11638
|
-
completionContextPackSchema =
|
|
11639
|
-
taskId:
|
|
11640
|
-
generatedAt:
|
|
11641
|
-
source:
|
|
11642
|
-
window:
|
|
11643
|
-
limit:
|
|
11644
|
-
since:
|
|
11645
|
-
relationDepth:
|
|
11646
|
-
relatedTaskIds:
|
|
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:
|
|
11649
|
-
|
|
11650
|
-
id:
|
|
11651
|
-
timestamp:
|
|
11652
|
-
action:
|
|
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:
|
|
11661
|
-
relation:
|
|
11662
|
-
actor:
|
|
11663
|
-
details:
|
|
11664
|
-
before:
|
|
11665
|
-
after:
|
|
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:
|
|
11669
|
-
totalEvents:
|
|
11670
|
-
byAction:
|
|
11671
|
-
byRelation:
|
|
11672
|
-
latestEventAt:
|
|
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 =
|
|
11676
|
-
taskId:
|
|
12072
|
+
completionEvaluationSchema = z16.object({
|
|
12073
|
+
taskId: z16.string().min(1),
|
|
11677
12074
|
taskStatus: completionTaskStatusSchema,
|
|
11678
|
-
ready:
|
|
11679
|
-
stale:
|
|
11680
|
-
staleReasons:
|
|
12075
|
+
ready: z16.boolean(),
|
|
12076
|
+
stale: z16.boolean(),
|
|
12077
|
+
staleReasons: z16.array(completionStaleReasonSchema),
|
|
11681
12078
|
contextPack: completionContextPackSchema.optional(),
|
|
11682
|
-
satisfied:
|
|
11683
|
-
unsatisfied:
|
|
11684
|
-
waived:
|
|
11685
|
-
replaced:
|
|
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 =
|
|
11689
|
-
taskId:
|
|
11690
|
-
ready:
|
|
11691
|
-
stale:
|
|
11692
|
-
summary:
|
|
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:
|
|
12091
|
+
blockers: z16.array(completionCriterionEvaluationSchema)
|
|
11695
12092
|
});
|
|
11696
|
-
completionListParamsSchema =
|
|
11697
|
-
taskId:
|
|
12093
|
+
completionListParamsSchema = z16.object({
|
|
12094
|
+
taskId: z16.string().min(1),
|
|
11698
12095
|
status: completionCriterionStatusSchema.optional(),
|
|
11699
12096
|
kind: completionCriterionKindSchema.optional()
|
|
11700
12097
|
});
|
|
11701
|
-
completionListResultSchema =
|
|
11702
|
-
taskId:
|
|
11703
|
-
criteria:
|
|
12098
|
+
completionListResultSchema = z16.object({
|
|
12099
|
+
taskId: z16.string().min(1),
|
|
12100
|
+
criteria: z16.array(completionCriterionEvaluationSchema),
|
|
11704
12101
|
totals: completionTotalsSchema
|
|
11705
12102
|
});
|
|
11706
|
-
completionEvaluateParamsSchema =
|
|
11707
|
-
taskId:
|
|
11708
|
-
includeContext:
|
|
11709
|
-
limit:
|
|
11710
|
-
since:
|
|
11711
|
-
relationDepth:
|
|
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 =
|
|
12110
|
+
completionProjectionRepairErrorSchema = z16.object({
|
|
11714
12111
|
code: completionProjectionRepairErrorCodeSchema,
|
|
11715
|
-
message:
|
|
11716
|
-
taskId:
|
|
11717
|
-
acId:
|
|
11718
|
-
evidenceAtomId:
|
|
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 =
|
|
11721
|
-
taskId:
|
|
11722
|
-
dryRun:
|
|
12117
|
+
completionProjectionRepairParamsSchema = z16.object({
|
|
12118
|
+
taskId: z16.string().min(1),
|
|
12119
|
+
dryRun: z16.boolean().optional()
|
|
11723
12120
|
});
|
|
11724
|
-
completionProjectionRepairResultSchema =
|
|
11725
|
-
taskId:
|
|
11726
|
-
repaired:
|
|
11727
|
-
dryRun:
|
|
11728
|
-
staleBefore:
|
|
11729
|
-
staleAfter:
|
|
11730
|
-
errors:
|
|
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
|
|
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 =
|
|
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:
|
|
12664
|
+
name: z17.string().min(1, "placeholder name must be non-empty"),
|
|
12268
12665
|
/** Resolver source the installer consults for this placeholder. */
|
|
12269
|
-
source:
|
|
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:
|
|
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:
|
|
12677
|
+
defaultValue: z17.union([z17.string(), z17.number(), z17.boolean(), z17.null()]).optional()
|
|
12281
12678
|
});
|
|
12282
|
-
TemplateManifestEntrySchema =
|
|
12679
|
+
TemplateManifestEntrySchema = z17.object({
|
|
12283
12680
|
/** Stable identifier for this template entry. */
|
|
12284
|
-
id:
|
|
12681
|
+
id: z17.string().min(1, "id must be non-empty"),
|
|
12285
12682
|
/** Category of file this template represents. */
|
|
12286
|
-
kind:
|
|
12683
|
+
kind: z17.enum(TEMPLATE_KINDS),
|
|
12287
12684
|
/** Repo-relative path of the template source file. */
|
|
12288
|
-
sourcePath:
|
|
12685
|
+
sourcePath: z17.string().min(1, "sourcePath must be non-empty"),
|
|
12289
12686
|
/** Project-relative path where the rendered template installs. */
|
|
12290
|
-
installPath:
|
|
12687
|
+
installPath: z17.string().min(1, "installPath must be non-empty"),
|
|
12291
12688
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
12292
|
-
substitution:
|
|
12689
|
+
substitution: z17.enum(TEMPLATE_SUBSTITUTIONS),
|
|
12293
12690
|
/** Declared placeholders this template requires. May be empty. */
|
|
12294
|
-
placeholders:
|
|
12691
|
+
placeholders: z17.array(PlaceholderSpecSchema),
|
|
12295
12692
|
/** Reconciliation policy on upgrade. */
|
|
12296
|
-
updateStrategy:
|
|
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
|
|
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 =
|
|
12309
|
-
acId:
|
|
12310
|
-
status:
|
|
12311
|
-
reasoning:
|
|
12312
|
-
evidenceRefs:
|
|
12313
|
-
checkedAt:
|
|
12314
|
-
});
|
|
12315
|
-
validatorAttestationSchema =
|
|
12316
|
-
verdict:
|
|
12317
|
-
taskId:
|
|
12318
|
-
validatorId:
|
|
12319
|
-
findings:
|
|
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:
|
|
12324
|
-
attestedAt:
|
|
12325
|
-
schemaVersion:
|
|
12326
|
-
});
|
|
12327
|
-
validatorRejectionSchema =
|
|
12328
|
-
verdict:
|
|
12329
|
-
taskId:
|
|
12330
|
-
validatorId:
|
|
12331
|
-
findings:
|
|
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:
|
|
12336
|
-
remediationHints:
|
|
12337
|
-
rejectedAt:
|
|
12338
|
-
schemaVersion:
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
26856
|
+
return z19.null();
|
|
26455
26857
|
}
|
|
26456
26858
|
if (enumValues.length === 0) {
|
|
26457
|
-
return
|
|
26859
|
+
return z19.never();
|
|
26458
26860
|
}
|
|
26459
26861
|
if (enumValues.length === 1) {
|
|
26460
|
-
return
|
|
26862
|
+
return z19.literal(enumValues[0]);
|
|
26461
26863
|
}
|
|
26462
26864
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
26463
|
-
return
|
|
26865
|
+
return z19.enum(enumValues);
|
|
26464
26866
|
}
|
|
26465
|
-
const literalSchemas = enumValues.map((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
|
|
26871
|
+
return z19.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
26470
26872
|
}
|
|
26471
26873
|
if (schema.const !== void 0) {
|
|
26472
|
-
return
|
|
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
|
|
26883
|
+
return z19.never();
|
|
26482
26884
|
}
|
|
26483
26885
|
if (typeSchemas.length === 1) {
|
|
26484
26886
|
return typeSchemas[0];
|
|
26485
26887
|
}
|
|
26486
|
-
return
|
|
26888
|
+
return z19.union(typeSchemas);
|
|
26487
26889
|
}
|
|
26488
26890
|
if (!type) {
|
|
26489
|
-
return
|
|
26891
|
+
return z19.any();
|
|
26490
26892
|
}
|
|
26491
26893
|
let zodSchema2;
|
|
26492
26894
|
switch (type) {
|
|
26493
26895
|
case "string": {
|
|
26494
|
-
let stringSchema =
|
|
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(
|
|
26900
|
+
stringSchema = stringSchema.check(z19.email());
|
|
26499
26901
|
} else if (format === "uri" || format === "uri-reference") {
|
|
26500
|
-
stringSchema = stringSchema.check(
|
|
26902
|
+
stringSchema = stringSchema.check(z19.url());
|
|
26501
26903
|
} else if (format === "uuid" || format === "guid") {
|
|
26502
|
-
stringSchema = stringSchema.check(
|
|
26904
|
+
stringSchema = stringSchema.check(z19.uuid());
|
|
26503
26905
|
} else if (format === "date-time") {
|
|
26504
|
-
stringSchema = stringSchema.check(
|
|
26906
|
+
stringSchema = stringSchema.check(z19.iso.datetime());
|
|
26505
26907
|
} else if (format === "date") {
|
|
26506
|
-
stringSchema = stringSchema.check(
|
|
26908
|
+
stringSchema = stringSchema.check(z19.iso.date());
|
|
26507
26909
|
} else if (format === "time") {
|
|
26508
|
-
stringSchema = stringSchema.check(
|
|
26910
|
+
stringSchema = stringSchema.check(z19.iso.time());
|
|
26509
26911
|
} else if (format === "duration") {
|
|
26510
|
-
stringSchema = stringSchema.check(
|
|
26912
|
+
stringSchema = stringSchema.check(z19.iso.duration());
|
|
26511
26913
|
} else if (format === "ipv4") {
|
|
26512
|
-
stringSchema = stringSchema.check(
|
|
26914
|
+
stringSchema = stringSchema.check(z19.ipv4());
|
|
26513
26915
|
} else if (format === "ipv6") {
|
|
26514
|
-
stringSchema = stringSchema.check(
|
|
26916
|
+
stringSchema = stringSchema.check(z19.ipv6());
|
|
26515
26917
|
} else if (format === "mac") {
|
|
26516
|
-
stringSchema = stringSchema.check(
|
|
26918
|
+
stringSchema = stringSchema.check(z19.mac());
|
|
26517
26919
|
} else if (format === "cidr") {
|
|
26518
|
-
stringSchema = stringSchema.check(
|
|
26920
|
+
stringSchema = stringSchema.check(z19.cidrv4());
|
|
26519
26921
|
} else if (format === "cidr-v6") {
|
|
26520
|
-
stringSchema = stringSchema.check(
|
|
26922
|
+
stringSchema = stringSchema.check(z19.cidrv6());
|
|
26521
26923
|
} else if (format === "base64") {
|
|
26522
|
-
stringSchema = stringSchema.check(
|
|
26924
|
+
stringSchema = stringSchema.check(z19.base64());
|
|
26523
26925
|
} else if (format === "base64url") {
|
|
26524
|
-
stringSchema = stringSchema.check(
|
|
26926
|
+
stringSchema = stringSchema.check(z19.base64url());
|
|
26525
26927
|
} else if (format === "e164") {
|
|
26526
|
-
stringSchema = stringSchema.check(
|
|
26928
|
+
stringSchema = stringSchema.check(z19.e164());
|
|
26527
26929
|
} else if (format === "jwt") {
|
|
26528
|
-
stringSchema = stringSchema.check(
|
|
26930
|
+
stringSchema = stringSchema.check(z19.jwt());
|
|
26529
26931
|
} else if (format === "emoji") {
|
|
26530
|
-
stringSchema = stringSchema.check(
|
|
26932
|
+
stringSchema = stringSchema.check(z19.emoji());
|
|
26531
26933
|
} else if (format === "nanoid") {
|
|
26532
|
-
stringSchema = stringSchema.check(
|
|
26934
|
+
stringSchema = stringSchema.check(z19.nanoid());
|
|
26533
26935
|
} else if (format === "cuid") {
|
|
26534
|
-
stringSchema = stringSchema.check(
|
|
26936
|
+
stringSchema = stringSchema.check(z19.cuid());
|
|
26535
26937
|
} else if (format === "cuid2") {
|
|
26536
|
-
stringSchema = stringSchema.check(
|
|
26938
|
+
stringSchema = stringSchema.check(z19.cuid2());
|
|
26537
26939
|
} else if (format === "ulid") {
|
|
26538
|
-
stringSchema = stringSchema.check(
|
|
26940
|
+
stringSchema = stringSchema.check(z19.ulid());
|
|
26539
26941
|
} else if (format === "xid") {
|
|
26540
|
-
stringSchema = stringSchema.check(
|
|
26942
|
+
stringSchema = stringSchema.check(z19.xid());
|
|
26541
26943
|
} else if (format === "ksuid") {
|
|
26542
|
-
stringSchema = stringSchema.check(
|
|
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" ?
|
|
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 =
|
|
26985
|
+
zodSchema2 = z19.boolean();
|
|
26584
26986
|
break;
|
|
26585
26987
|
}
|
|
26586
26988
|
case "null": {
|
|
26587
|
-
zodSchema2 =
|
|
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) :
|
|
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 =
|
|
27004
|
+
zodSchema2 = z19.record(keySchema, valueSchema);
|
|
26603
27005
|
break;
|
|
26604
27006
|
}
|
|
26605
|
-
const objectSchema2 =
|
|
26606
|
-
const recordSchema =
|
|
26607
|
-
zodSchema2 =
|
|
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 =
|
|
26617
|
-
looseRecords.push(
|
|
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(
|
|
27023
|
+
schemasToIntersect.push(z19.object(shape).passthrough());
|
|
26622
27024
|
}
|
|
26623
27025
|
schemasToIntersect.push(...looseRecords);
|
|
26624
27026
|
if (schemasToIntersect.length === 0) {
|
|
26625
|
-
zodSchema2 =
|
|
27027
|
+
zodSchema2 = z19.object({}).passthrough();
|
|
26626
27028
|
} else if (schemasToIntersect.length === 1) {
|
|
26627
27029
|
zodSchema2 = schemasToIntersect[0];
|
|
26628
27030
|
} else {
|
|
26629
|
-
let result =
|
|
27031
|
+
let result = z19.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
26630
27032
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
26631
|
-
result =
|
|
27033
|
+
result = z19.intersection(result, schemasToIntersect[i]);
|
|
26632
27034
|
}
|
|
26633
27035
|
zodSchema2 = result;
|
|
26634
27036
|
}
|
|
26635
27037
|
break;
|
|
26636
27038
|
}
|
|
26637
|
-
const objectSchema =
|
|
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 =
|
|
27056
|
+
zodSchema2 = z19.tuple(tupleItems).rest(rest);
|
|
26655
27057
|
} else {
|
|
26656
|
-
zodSchema2 =
|
|
27058
|
+
zodSchema2 = z19.tuple(tupleItems);
|
|
26657
27059
|
}
|
|
26658
27060
|
if (typeof schema.minItems === "number") {
|
|
26659
|
-
zodSchema2 = zodSchema2.check(
|
|
27061
|
+
zodSchema2 = zodSchema2.check(z19.minLength(schema.minItems));
|
|
26660
27062
|
}
|
|
26661
27063
|
if (typeof schema.maxItems === "number") {
|
|
26662
|
-
zodSchema2 = zodSchema2.check(
|
|
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 =
|
|
27070
|
+
zodSchema2 = z19.tuple(tupleItems).rest(rest);
|
|
26669
27071
|
} else {
|
|
26670
|
-
zodSchema2 =
|
|
27072
|
+
zodSchema2 = z19.tuple(tupleItems);
|
|
26671
27073
|
}
|
|
26672
27074
|
if (typeof schema.minItems === "number") {
|
|
26673
|
-
zodSchema2 = zodSchema2.check(
|
|
27075
|
+
zodSchema2 = zodSchema2.check(z19.minLength(schema.minItems));
|
|
26674
27076
|
}
|
|
26675
27077
|
if (typeof schema.maxItems === "number") {
|
|
26676
|
-
zodSchema2 = zodSchema2.check(
|
|
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 =
|
|
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 =
|
|
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 ?
|
|
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 =
|
|
26713
|
-
baseSchema = hasExplicitType ?
|
|
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 =
|
|
26718
|
-
baseSchema = hasExplicitType ?
|
|
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 :
|
|
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 =
|
|
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 =
|
|
27135
|
+
baseSchema = z19.nullable(baseSchema);
|
|
26734
27136
|
}
|
|
26735
27137
|
if (schema.readOnly === true) {
|
|
26736
|
-
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 ?
|
|
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
|
|
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
|
-
|
|
27186
|
+
z19 = {
|
|
26785
27187
|
...schemas_exports2,
|
|
26786
27188
|
...checks_exports2,
|
|
26787
27189
|
iso: iso_exports
|