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