omnius 1.0.813 → 1.0.816
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/api/py-embed.js +4277 -2406
- package/dist/index.js +2 -2
- package/dist/library.js +1964 -1792
- package/dist/memory-maintenance-worker.js +1799 -68
- package/dist/update-worker.js +4302 -2431
- package/docs/DISCOVERY.json +36 -0
- package/docs/DISCOVERY.md +1 -0
- package/docs/engineering/kolibri-placement-and-empty-response-20261007.md +113 -0
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -55,10 +55,1878 @@ var init_jetson_monitor = __esm({
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
// packages/
|
|
58
|
+
// packages/schemas/dist/gpu-selection.js
|
|
59
59
|
var init_gpu_selection = __esm({
|
|
60
|
+
"packages/schemas/dist/gpu-selection.js"() {
|
|
61
|
+
"use strict";
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// packages/schemas/dist/feature-workflow.js
|
|
66
|
+
import { z } from "zod";
|
|
67
|
+
var FEATURE_WORKFLOW_PLAN_SCHEMA, FEATURE_WORKFLOW_PHASES, FeatureWorkflowPhaseSchema, id, text, FeatureWorkflowArtifactReferenceSchema, path, FeatureWorkflowCardSchema, FeatureWorkflowPlanSchema, FeatureWorkflowChildReportSchema, FeatureWorkflowToolInputSchema, FeatureWorkflowToolJsonSchema;
|
|
68
|
+
var init_feature_workflow = __esm({
|
|
69
|
+
"packages/schemas/dist/feature-workflow.js"() {
|
|
70
|
+
"use strict";
|
|
71
|
+
FEATURE_WORKFLOW_PLAN_SCHEMA = "omnius.feature-workflow-plan.v1";
|
|
72
|
+
FEATURE_WORKFLOW_PHASES = [
|
|
73
|
+
"research",
|
|
74
|
+
"specification",
|
|
75
|
+
"implementation",
|
|
76
|
+
"integration",
|
|
77
|
+
"acceptance",
|
|
78
|
+
"handoff"
|
|
79
|
+
];
|
|
80
|
+
FeatureWorkflowPhaseSchema = z.enum(FEATURE_WORKFLOW_PHASES);
|
|
81
|
+
id = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}$/);
|
|
82
|
+
text = z.string().trim().min(1).max(4e3);
|
|
83
|
+
FeatureWorkflowArtifactReferenceSchema = z.string().regex(/^omnius-artifact:\/\/sha256\/[a-f0-9]{64}$/);
|
|
84
|
+
path = z.string().trim().min(1).max(1e3);
|
|
85
|
+
FeatureWorkflowCardSchema = z.object({
|
|
86
|
+
id,
|
|
87
|
+
title: text,
|
|
88
|
+
phase: FeatureWorkflowPhaseSchema,
|
|
89
|
+
role: z.enum([
|
|
90
|
+
"researcher",
|
|
91
|
+
"author",
|
|
92
|
+
"reviewer",
|
|
93
|
+
"implementer",
|
|
94
|
+
"integrator",
|
|
95
|
+
"verifier",
|
|
96
|
+
"synthesizer"
|
|
97
|
+
]),
|
|
98
|
+
dependsOn: z.array(id).max(128).default([]),
|
|
99
|
+
sourceIds: z.array(id).max(256).default([]),
|
|
100
|
+
inputSlots: z.array(id).max(256).default([]),
|
|
101
|
+
reviewSlots: z.array(id).max(32).default([]),
|
|
102
|
+
ownedFiles: z.array(path).max(128).default([]),
|
|
103
|
+
acceptanceIds: z.array(id).max(256).default([]),
|
|
104
|
+
verifier: z.object({
|
|
105
|
+
command: z.string().trim().min(1).max(4e3),
|
|
106
|
+
cwd: path.optional(),
|
|
107
|
+
targetPaths: z.array(path).min(1).max(128)
|
|
108
|
+
}).strict().optional()
|
|
109
|
+
}).strict();
|
|
110
|
+
FeatureWorkflowPlanSchema = z.object({
|
|
111
|
+
schema: z.literal(FEATURE_WORKFLOW_PLAN_SCHEMA),
|
|
112
|
+
id,
|
|
113
|
+
revision: z.number().int().min(1).max(Number.MAX_SAFE_INTEGER),
|
|
114
|
+
objective: text,
|
|
115
|
+
requirements: z.array(z.object({ id, description: text }).strict()).min(1).max(256),
|
|
116
|
+
sources: z.array(z.object({ id, reference: FeatureWorkflowArtifactReferenceSchema }).strict()).max(256).default([]),
|
|
117
|
+
slots: z.array(z.object({
|
|
118
|
+
id,
|
|
119
|
+
kind: z.enum([
|
|
120
|
+
"research",
|
|
121
|
+
"specification",
|
|
122
|
+
"implementation",
|
|
123
|
+
"integration",
|
|
124
|
+
"review",
|
|
125
|
+
"handoff"
|
|
126
|
+
]),
|
|
127
|
+
cardId: id,
|
|
128
|
+
requiresReview: z.boolean().default(false)
|
|
129
|
+
}).strict()).min(4).max(256),
|
|
130
|
+
cards: z.array(FeatureWorkflowCardSchema).min(6).max(128)
|
|
131
|
+
}).strict().superRefine((plan, ctx) => {
|
|
132
|
+
const fail = (message) => ctx.addIssue({ code: "custom", message });
|
|
133
|
+
const unique = (values, label) => {
|
|
134
|
+
if (new Set(values).size !== values.length)
|
|
135
|
+
fail(`duplicate ${label}`);
|
|
136
|
+
};
|
|
137
|
+
unique(plan.cards.map((c) => c.id), "card id");
|
|
138
|
+
unique(plan.slots.map((s) => s.id), "slot id");
|
|
139
|
+
unique(plan.sources.map((s) => s.id), "source id");
|
|
140
|
+
unique(plan.requirements.map((r) => r.id), "requirement id");
|
|
141
|
+
const cards = new Map(plan.cards.map((c) => [c.id, c]));
|
|
142
|
+
const slots = new Map(plan.slots.map((s) => [s.id, s]));
|
|
143
|
+
const sources = new Set(plan.sources.map((s) => s.id));
|
|
144
|
+
const assertions = new Map(plan.requirements.map((r) => [r.id, 0]));
|
|
145
|
+
for (const phase of FEATURE_WORKFLOW_PHASES)
|
|
146
|
+
if (!plan.cards.some((c) => c.phase === phase))
|
|
147
|
+
fail(`missing phase ${phase}`);
|
|
148
|
+
for (const slot of plan.slots) {
|
|
149
|
+
if (slot.id.startsWith("source:"))
|
|
150
|
+
fail(`reserved source namespace ${slot.id}`);
|
|
151
|
+
const producer = cards.get(slot.cardId);
|
|
152
|
+
if (!producer)
|
|
153
|
+
fail(`unknown producer ${slot.cardId}`);
|
|
154
|
+
if (slot.requiresReview && !plan.cards.some((c) => c.role === "reviewer" && c.reviewSlots.includes(slot.id)))
|
|
155
|
+
fail(`missing independent review for ${slot.id}`);
|
|
156
|
+
if (slot.requiresReview && producer && plan.cards.some((c) => c.reviewSlots.includes(slot.id) && c.phase !== producer.phase))
|
|
157
|
+
fail(`review must occur in producer phase ${slot.id}`);
|
|
158
|
+
}
|
|
159
|
+
for (const kind of [
|
|
160
|
+
"research",
|
|
161
|
+
"specification",
|
|
162
|
+
"integration",
|
|
163
|
+
"handoff"
|
|
164
|
+
]) {
|
|
165
|
+
if (!plan.slots.some((s) => s.kind === kind && cards.get(s.cardId)?.phase === kind))
|
|
166
|
+
fail(`missing ${kind} artifact`);
|
|
167
|
+
}
|
|
168
|
+
if (!plan.slots.some((s) => s.kind === "specification" && s.requiresReview))
|
|
169
|
+
fail("specification requires independent review");
|
|
170
|
+
for (const card of plan.cards) {
|
|
171
|
+
if (card.role !== "reviewer" && card.role !== "verifier" && !plan.slots.some((slot) => slot.cardId === card.id))
|
|
172
|
+
fail(`work card requires an artifact slot ${card.id}`);
|
|
173
|
+
for (const [label, values] of Object.entries({
|
|
174
|
+
dependency: card.dependsOn,
|
|
175
|
+
source: card.sourceIds,
|
|
176
|
+
input: card.inputSlots,
|
|
177
|
+
review: card.reviewSlots,
|
|
178
|
+
acceptance: card.acceptanceIds
|
|
179
|
+
}))
|
|
180
|
+
unique(values, `${label} in ${card.id}`);
|
|
181
|
+
for (const dep of card.dependsOn)
|
|
182
|
+
if (!cards.has(dep))
|
|
183
|
+
fail(`unknown dependency ${dep}`);
|
|
184
|
+
for (const source of card.sourceIds)
|
|
185
|
+
if (!sources.has(source))
|
|
186
|
+
fail(`unknown source ${source}`);
|
|
187
|
+
for (const slotId of [...card.inputSlots, ...card.reviewSlots]) {
|
|
188
|
+
const slot = slots.get(slotId);
|
|
189
|
+
if (!slot) {
|
|
190
|
+
fail(`unknown slot ${slotId}`);
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const producer = cards.get(slot.cardId);
|
|
194
|
+
if (slot.cardId === card.id)
|
|
195
|
+
fail(`self-dependent slot ${slotId}`);
|
|
196
|
+
if (producer && FEATURE_WORKFLOW_PHASES.indexOf(producer.phase) > FEATURE_WORKFLOW_PHASES.indexOf(card.phase))
|
|
197
|
+
fail(`future slot ${slotId}`);
|
|
198
|
+
}
|
|
199
|
+
for (const dep of card.dependsOn) {
|
|
200
|
+
const source = cards.get(dep);
|
|
201
|
+
if (source && FEATURE_WORKFLOW_PHASES.indexOf(source.phase) > FEATURE_WORKFLOW_PHASES.indexOf(card.phase))
|
|
202
|
+
fail(`future dependency ${dep}`);
|
|
203
|
+
}
|
|
204
|
+
if (card.role === "reviewer" !== card.reviewSlots.length > 0)
|
|
205
|
+
fail(`review role/slots mismatch ${card.id}`);
|
|
206
|
+
if (card.phase === "acceptance" && (card.role !== "verifier" || !card.verifier || card.acceptanceIds.length === 0))
|
|
207
|
+
fail(`acceptance needs explicit verifier ${card.id}`);
|
|
208
|
+
if (card.phase !== "acceptance" && (card.verifier || card.acceptanceIds.length))
|
|
209
|
+
fail(`acceptance authority outside acceptance phase ${card.id}`);
|
|
210
|
+
if (card.phase === "implementation" && card.role !== "reviewer" && (card.role !== "implementer" || card.ownedFiles.length === 0))
|
|
211
|
+
fail(`implementation needs owned files ${card.id}`);
|
|
212
|
+
for (const assertion of card.acceptanceIds) {
|
|
213
|
+
if (!assertions.has(assertion))
|
|
214
|
+
fail(`unknown acceptance ${assertion}`);
|
|
215
|
+
else
|
|
216
|
+
assertions.set(assertion, assertions.get(assertion) + 1);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
for (const [assertion, count] of assertions)
|
|
220
|
+
if (count !== 1)
|
|
221
|
+
fail(`acceptance ${assertion} must have exactly one owner`);
|
|
222
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
223
|
+
const visited = /* @__PURE__ */ new Set();
|
|
224
|
+
const visit = (cardId) => {
|
|
225
|
+
if (visiting.has(cardId)) {
|
|
226
|
+
fail(`dependency cycle ${cardId}`);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (visited.has(cardId))
|
|
230
|
+
return;
|
|
231
|
+
const card = cards.get(cardId);
|
|
232
|
+
if (!card)
|
|
233
|
+
return;
|
|
234
|
+
visiting.add(cardId);
|
|
235
|
+
for (const dependency of [
|
|
236
|
+
...card.dependsOn,
|
|
237
|
+
...[...card.inputSlots, ...card.reviewSlots].map((s) => slots.get(s)?.cardId).filter((s) => !!s)
|
|
238
|
+
])
|
|
239
|
+
visit(dependency);
|
|
240
|
+
visiting.delete(cardId);
|
|
241
|
+
visited.add(cardId);
|
|
242
|
+
};
|
|
243
|
+
for (const card of plan.cards)
|
|
244
|
+
visit(card.id);
|
|
245
|
+
});
|
|
246
|
+
FeatureWorkflowChildReportSchema = z.object({
|
|
247
|
+
schema: z.literal("omnius.feature-workflow-child-report.v1"),
|
|
248
|
+
cardId: id,
|
|
249
|
+
status: z.enum(["completed", "partial", "blocked", "failed"]),
|
|
250
|
+
inputSlots: z.record(z.string().min(1).max(256), FeatureWorkflowArtifactReferenceSchema),
|
|
251
|
+
artifacts: z.array(z.object({ slotId: id, content: z.string().min(1).max(1e5) }).strict()).max(32).default([]),
|
|
252
|
+
review: z.object({
|
|
253
|
+
disposition: z.enum(["approved", "changes_requested"]),
|
|
254
|
+
reviewedSlots: z.record(id, FeatureWorkflowArtifactReferenceSchema),
|
|
255
|
+
findings: z.array(z.object({
|
|
256
|
+
id,
|
|
257
|
+
severity: z.enum(["info", "blocking"]),
|
|
258
|
+
detail: text
|
|
259
|
+
}).strict()).max(64)
|
|
260
|
+
}).strict().optional(),
|
|
261
|
+
blockers: z.array(text).max(32),
|
|
262
|
+
unresolvedQuestions: z.array(text).max(32)
|
|
263
|
+
}).strict();
|
|
264
|
+
FeatureWorkflowToolInputSchema = z.discriminatedUnion("action", [
|
|
265
|
+
z.object({
|
|
266
|
+
action: z.enum(["create", "revise"]),
|
|
267
|
+
plan: FeatureWorkflowPlanSchema
|
|
268
|
+
}).strict(),
|
|
269
|
+
z.object({ action: z.literal("status") }).strict(),
|
|
270
|
+
z.object({ action: z.literal("discover") }).strict(),
|
|
271
|
+
z.object({
|
|
272
|
+
action: z.literal("resume"),
|
|
273
|
+
runId: id,
|
|
274
|
+
planReference: FeatureWorkflowArtifactReferenceSchema,
|
|
275
|
+
objectiveId: id
|
|
276
|
+
}).strict(),
|
|
277
|
+
z.object({
|
|
278
|
+
action: z.literal("repair"),
|
|
279
|
+
cardId: id,
|
|
280
|
+
failedCardId: id,
|
|
281
|
+
reason: text
|
|
282
|
+
}).strict(),
|
|
283
|
+
z.object({
|
|
284
|
+
action: z.literal("record_artifact"),
|
|
285
|
+
cardId: id,
|
|
286
|
+
slotId: id,
|
|
287
|
+
path
|
|
288
|
+
}).strict()
|
|
289
|
+
]);
|
|
290
|
+
FeatureWorkflowToolJsonSchema = z.toJSONSchema(FeatureWorkflowToolInputSchema, { reused: "ref", unrepresentable: "any" });
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
// packages/schemas/dist/messages.js
|
|
295
|
+
import { z as z2 } from "zod";
|
|
296
|
+
var AgentMessageSchema;
|
|
297
|
+
var init_messages = __esm({
|
|
298
|
+
"packages/schemas/dist/messages.js"() {
|
|
299
|
+
"use strict";
|
|
300
|
+
AgentMessageSchema = z2.object({
|
|
301
|
+
id: z2.string().uuid(),
|
|
302
|
+
sessionId: z2.string().uuid(),
|
|
303
|
+
role: z2.enum(["user", "assistant", "system", "tool"]),
|
|
304
|
+
content: z2.string(),
|
|
305
|
+
timestamp: z2.string().datetime(),
|
|
306
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// packages/schemas/dist/tools.js
|
|
312
|
+
import { z as z3 } from "zod";
|
|
313
|
+
var ToolCallSchema;
|
|
314
|
+
var init_tools = __esm({
|
|
315
|
+
"packages/schemas/dist/tools.js"() {
|
|
316
|
+
"use strict";
|
|
317
|
+
ToolCallSchema = z3.object({
|
|
318
|
+
id: z3.string().uuid(),
|
|
319
|
+
name: z3.string(),
|
|
320
|
+
arguments: z3.record(z3.string(), z3.unknown()),
|
|
321
|
+
result: z3.unknown().optional(),
|
|
322
|
+
status: z3.enum(["pending", "running", "completed", "failed"]),
|
|
323
|
+
startedAt: z3.string().datetime().optional(),
|
|
324
|
+
completedAt: z3.string().datetime().optional()
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// packages/schemas/dist/session.js
|
|
330
|
+
import { z as z4 } from "zod";
|
|
331
|
+
var SessionSchema;
|
|
332
|
+
var init_session = __esm({
|
|
333
|
+
"packages/schemas/dist/session.js"() {
|
|
334
|
+
"use strict";
|
|
335
|
+
SessionSchema = z4.object({
|
|
336
|
+
id: z4.string().uuid(),
|
|
337
|
+
projectRoot: z4.string(),
|
|
338
|
+
model: z4.string(),
|
|
339
|
+
createdAt: z4.string().datetime(),
|
|
340
|
+
updatedAt: z4.string().datetime(),
|
|
341
|
+
status: z4.enum(["active", "paused", "completed", "error"]),
|
|
342
|
+
config: z4.record(z4.string(), z4.unknown()).optional()
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// packages/schemas/dist/task.js
|
|
348
|
+
import { z as z5 } from "zod";
|
|
349
|
+
var TaskClassSchema, UrgencySchema, NormalizedTaskSchema, TaskStatusSchema;
|
|
350
|
+
var init_task = __esm({
|
|
351
|
+
"packages/schemas/dist/task.js"() {
|
|
352
|
+
"use strict";
|
|
353
|
+
TaskClassSchema = z5.enum([
|
|
354
|
+
"bugfix",
|
|
355
|
+
"feature",
|
|
356
|
+
"refactor",
|
|
357
|
+
"migration",
|
|
358
|
+
"dependency-upgrade",
|
|
359
|
+
"test",
|
|
360
|
+
"docs",
|
|
361
|
+
"infra"
|
|
362
|
+
]);
|
|
363
|
+
UrgencySchema = z5.enum(["low", "medium", "high", "critical"]);
|
|
364
|
+
NormalizedTaskSchema = z5.object({
|
|
365
|
+
/** Stable unique identifier for this task instance */
|
|
366
|
+
id: z5.string(),
|
|
367
|
+
/** Human-readable goal description */
|
|
368
|
+
goal: z5.string().min(1),
|
|
369
|
+
/** Constraints the solution must satisfy */
|
|
370
|
+
constraints: z5.array(z5.string()),
|
|
371
|
+
/** Criteria that must pass for the task to be considered done */
|
|
372
|
+
successCriteria: z5.array(z5.string()),
|
|
373
|
+
/** Absolute path to the repo root */
|
|
374
|
+
repoRoot: z5.string(),
|
|
375
|
+
urgency: UrgencySchema,
|
|
376
|
+
taskClass: TaskClassSchema,
|
|
377
|
+
/** Original raw user request before normalization */
|
|
378
|
+
rawRequest: z5.string().optional(),
|
|
379
|
+
/** Timestamp when the task was created (ISO-8601) */
|
|
380
|
+
createdAt: z5.string().datetime()
|
|
381
|
+
});
|
|
382
|
+
TaskStatusSchema = z5.enum([
|
|
383
|
+
"pending",
|
|
384
|
+
"dispatched",
|
|
385
|
+
"in_progress",
|
|
386
|
+
"success",
|
|
387
|
+
"partial_success",
|
|
388
|
+
"needs_human_decision",
|
|
389
|
+
"blocked_missing_context",
|
|
390
|
+
"rollback_required",
|
|
391
|
+
"failed"
|
|
392
|
+
]);
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
// packages/schemas/dist/plan.js
|
|
397
|
+
import { z as z6 } from "zod";
|
|
398
|
+
var SubtaskKindSchema, SubtaskSchema, PlanSchema;
|
|
399
|
+
var init_plan = __esm({
|
|
400
|
+
"packages/schemas/dist/plan.js"() {
|
|
401
|
+
"use strict";
|
|
402
|
+
SubtaskKindSchema = z6.enum([
|
|
403
|
+
"inspect",
|
|
404
|
+
"patch",
|
|
405
|
+
"test",
|
|
406
|
+
"migrate",
|
|
407
|
+
"verify",
|
|
408
|
+
"merge"
|
|
409
|
+
]);
|
|
410
|
+
SubtaskSchema = z6.object({
|
|
411
|
+
/** Stable identifier used for dependency references */
|
|
412
|
+
id: z6.string().min(1),
|
|
413
|
+
kind: SubtaskKindSchema,
|
|
414
|
+
/** File paths or symbol names that this subtask targets */
|
|
415
|
+
targets: z6.array(z6.string()),
|
|
416
|
+
/** IDs of subtasks that must complete before this one starts */
|
|
417
|
+
dependsOn: z6.array(z6.string()).optional(),
|
|
418
|
+
/** Why this subtask is necessary */
|
|
419
|
+
reason: z6.string().min(1),
|
|
420
|
+
/** Shell commands or assertions that confirm success */
|
|
421
|
+
validation: z6.array(z6.string())
|
|
422
|
+
});
|
|
423
|
+
PlanSchema = z6.object({
|
|
424
|
+
goal: z6.string().min(1),
|
|
425
|
+
subtasks: z6.array(SubtaskSchema),
|
|
426
|
+
/** Files/modules at elevated risk of breakage */
|
|
427
|
+
riskAreas: z6.array(z6.string()),
|
|
428
|
+
/** Aspects of the codebase that are unclear or ambiguous */
|
|
429
|
+
unknowns: z6.array(z6.string())
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
// packages/schemas/dist/patch.js
|
|
435
|
+
import { z as z7 } from "zod";
|
|
436
|
+
var EditOperationSchema, FileEditSchema, NeedsMoreContextSchema, PatchProposalSchema;
|
|
437
|
+
var init_patch = __esm({
|
|
438
|
+
"packages/schemas/dist/patch.js"() {
|
|
439
|
+
"use strict";
|
|
440
|
+
EditOperationSchema = z7.enum([
|
|
441
|
+
"diff",
|
|
442
|
+
"rewrite",
|
|
443
|
+
"append",
|
|
444
|
+
"create"
|
|
445
|
+
]);
|
|
446
|
+
FileEditSchema = z7.object({
|
|
447
|
+
/** Repo-relative or absolute path to the file being edited */
|
|
448
|
+
file: z7.string().min(1),
|
|
449
|
+
operation: EditOperationSchema,
|
|
450
|
+
/** Unified diff, full file content, appended text, or new file content */
|
|
451
|
+
content: z7.string()
|
|
452
|
+
});
|
|
453
|
+
NeedsMoreContextSchema = z7.object({
|
|
454
|
+
reason: z7.string().min(1),
|
|
455
|
+
requestedPaths: z7.array(z7.string()).optional(),
|
|
456
|
+
requestedSymbols: z7.array(z7.string()).optional()
|
|
457
|
+
});
|
|
458
|
+
PatchProposalSchema = z7.object({
|
|
459
|
+
/** One-paragraph description of what changed and why */
|
|
460
|
+
summary: z7.string().min(1),
|
|
461
|
+
edits: z7.array(FileEditSchema),
|
|
462
|
+
/** Test commands or test file paths that should be executed to validate */
|
|
463
|
+
testsToRun: z7.array(z7.string()),
|
|
464
|
+
/** Assumptions the editor made that the verifier should check */
|
|
465
|
+
assumptions: z7.array(z7.string()),
|
|
466
|
+
/** Known risks introduced by this patch */
|
|
467
|
+
risks: z7.array(z7.string()),
|
|
468
|
+
/**
|
|
469
|
+
* When the editor cannot safely produce a patch without more information.
|
|
470
|
+
* The presence of this field indicates the patch is incomplete.
|
|
471
|
+
*/
|
|
472
|
+
needsMoreContext: NeedsMoreContextSchema.optional()
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// packages/schemas/dist/verification.js
|
|
478
|
+
import { z as z8 } from "zod";
|
|
479
|
+
var VerificationStatusSchema, VerificationNextActionSchema, VerificationDecisionSchema;
|
|
480
|
+
var init_verification = __esm({
|
|
481
|
+
"packages/schemas/dist/verification.js"() {
|
|
482
|
+
"use strict";
|
|
483
|
+
VerificationStatusSchema = z8.enum(["pass", "fail", "partial"]);
|
|
484
|
+
VerificationNextActionSchema = z8.enum([
|
|
485
|
+
"finish",
|
|
486
|
+
"retry",
|
|
487
|
+
"rollback",
|
|
488
|
+
"inspect_more"
|
|
489
|
+
]);
|
|
490
|
+
VerificationDecisionSchema = z8.object({
|
|
491
|
+
status: VerificationStatusSchema,
|
|
492
|
+
/** Concrete evidence lines from logs, test output, or type-checker output */
|
|
493
|
+
evidence: z8.array(z8.string()),
|
|
494
|
+
nextAction: VerificationNextActionSchema,
|
|
495
|
+
/** Files that should be prioritised in the next retrieval/editing round */
|
|
496
|
+
focusFiles: z8.array(z8.string()),
|
|
497
|
+
/**
|
|
498
|
+
* Short fingerprint string identifying the failure category.
|
|
499
|
+
* Used to detect repeat failure loops. Only present when status !== "pass".
|
|
500
|
+
*/
|
|
501
|
+
failureFingerprint: z8.string().optional()
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
// packages/schemas/dist/repoProfile.js
|
|
507
|
+
import { z as z9 } from "zod";
|
|
508
|
+
var LanguageSchema, PackageManagerSchema, BuildSystemSchema, MigrationSystemSchema, RepoProfileSchema;
|
|
509
|
+
var init_repoProfile = __esm({
|
|
510
|
+
"packages/schemas/dist/repoProfile.js"() {
|
|
511
|
+
"use strict";
|
|
512
|
+
LanguageSchema = z9.enum([
|
|
513
|
+
"typescript",
|
|
514
|
+
"javascript",
|
|
515
|
+
"python",
|
|
516
|
+
"go",
|
|
517
|
+
"rust",
|
|
518
|
+
"java",
|
|
519
|
+
"csharp",
|
|
520
|
+
"sql",
|
|
521
|
+
"other"
|
|
522
|
+
]);
|
|
523
|
+
PackageManagerSchema = z9.enum([
|
|
524
|
+
"npm",
|
|
525
|
+
"pnpm",
|
|
526
|
+
"yarn",
|
|
527
|
+
"bun",
|
|
528
|
+
"pip",
|
|
529
|
+
"poetry",
|
|
530
|
+
"cargo",
|
|
531
|
+
"go-modules",
|
|
532
|
+
"maven",
|
|
533
|
+
"gradle",
|
|
534
|
+
"other"
|
|
535
|
+
]);
|
|
536
|
+
BuildSystemSchema = z9.enum([
|
|
537
|
+
"tsc",
|
|
538
|
+
"vite",
|
|
539
|
+
"webpack",
|
|
540
|
+
"esbuild",
|
|
541
|
+
"turbo",
|
|
542
|
+
"nx",
|
|
543
|
+
"make",
|
|
544
|
+
"cmake",
|
|
545
|
+
"cargo",
|
|
546
|
+
"gradle",
|
|
547
|
+
"maven",
|
|
548
|
+
"other"
|
|
549
|
+
]);
|
|
550
|
+
MigrationSystemSchema = z9.enum([
|
|
551
|
+
"prisma",
|
|
552
|
+
"drizzle",
|
|
553
|
+
"knex",
|
|
554
|
+
"alembic",
|
|
555
|
+
"flyway",
|
|
556
|
+
"liquibase",
|
|
557
|
+
"typeorm",
|
|
558
|
+
"sequelize",
|
|
559
|
+
"other",
|
|
560
|
+
"none"
|
|
561
|
+
]);
|
|
562
|
+
RepoProfileSchema = z9.object({
|
|
563
|
+
/** Languages present in the repo, ordered by prevalence */
|
|
564
|
+
languages: z9.array(LanguageSchema),
|
|
565
|
+
/** Frameworks detected (e.g. "nextjs", "fastapi", "express") */
|
|
566
|
+
frameworks: z9.array(z9.string()),
|
|
567
|
+
packageManager: PackageManagerSchema.optional(),
|
|
568
|
+
buildSystem: BuildSystemSchema.optional(),
|
|
569
|
+
/** Shell commands known to run the test suite */
|
|
570
|
+
testCommands: z9.array(z9.string()),
|
|
571
|
+
/** Shell commands known to run the linter */
|
|
572
|
+
lintCommands: z9.array(z9.string()),
|
|
573
|
+
migrationSystem: MigrationSystemSchema.optional(),
|
|
574
|
+
/** Runtime assumptions such as Node version, Python version, etc. */
|
|
575
|
+
runtimeAssumptions: z9.array(z9.string()),
|
|
576
|
+
/** Names of environment variables the repo consumes */
|
|
577
|
+
envVarNames: z9.array(z9.string()),
|
|
578
|
+
/** Deployment-related notes (e.g. Docker, Kubernetes, serverless) */
|
|
579
|
+
deploymentNotes: z9.array(z9.string()),
|
|
580
|
+
/** Absolute path to the repo root on the agent's filesystem */
|
|
581
|
+
repoRoot: z9.string(),
|
|
582
|
+
/** ISO-8601 timestamp of the last profile update */
|
|
583
|
+
lastIndexed: z9.string().datetime()
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// packages/schemas/dist/retrieval.js
|
|
589
|
+
import { z as z10 } from "zod";
|
|
590
|
+
var RetrievalRequestSchema, SnippetSchema, RetrievalPacketSchema;
|
|
591
|
+
var init_retrieval = __esm({
|
|
592
|
+
"packages/schemas/dist/retrieval.js"() {
|
|
593
|
+
"use strict";
|
|
594
|
+
RetrievalRequestSchema = z10.object({
|
|
595
|
+
/** Natural language description of what information is needed */
|
|
596
|
+
query: z10.string().min(1),
|
|
597
|
+
/** File path hints that the retrieval system should prioritise */
|
|
598
|
+
pathsHint: z10.array(z10.string()),
|
|
599
|
+
/** Symbol names (functions, classes, types) to look up */
|
|
600
|
+
symbolHint: z10.array(z10.string()),
|
|
601
|
+
/** Error message fragments to search for in logs and source */
|
|
602
|
+
errorHint: z10.array(z10.string()),
|
|
603
|
+
/** Maximum number of files to include in the retrieval packet */
|
|
604
|
+
maxFiles: z10.number().int().positive(),
|
|
605
|
+
/** Maximum number of code snippets to include */
|
|
606
|
+
maxSnippets: z10.number().int().positive(),
|
|
607
|
+
/** Whether test files should be included in results */
|
|
608
|
+
includeTests: z10.boolean(),
|
|
609
|
+
/** Whether config files (tsconfig, package.json, .env.example …) should be included */
|
|
610
|
+
includeConfigs: z10.boolean()
|
|
611
|
+
});
|
|
612
|
+
SnippetSchema = z10.object({
|
|
613
|
+
/** Repo-relative path of the source file */
|
|
614
|
+
file: z10.string(),
|
|
615
|
+
/** 1-based start line */
|
|
616
|
+
startLine: z10.number().int().positive(),
|
|
617
|
+
/** 1-based end line (inclusive) */
|
|
618
|
+
endLine: z10.number().int().positive(),
|
|
619
|
+
/** The actual source text */
|
|
620
|
+
content: z10.string(),
|
|
621
|
+
/** Why this snippet was selected */
|
|
622
|
+
relevanceNote: z10.string().optional()
|
|
623
|
+
});
|
|
624
|
+
RetrievalPacketSchema = z10.object({
|
|
625
|
+
/** Echo of the original request that produced this packet */
|
|
626
|
+
request: RetrievalRequestSchema,
|
|
627
|
+
/** Full file contents or extracts, keyed by repo-relative path */
|
|
628
|
+
files: z10.record(z10.string(), z10.string()),
|
|
629
|
+
snippets: z10.array(SnippetSchema),
|
|
630
|
+
/** One-line architecture note for orientation */
|
|
631
|
+
architectureNote: z10.string().optional(),
|
|
632
|
+
/** Note summarising relevant prior attempts at related tasks */
|
|
633
|
+
priorAttemptNote: z10.string().optional(),
|
|
634
|
+
/** ISO-8601 timestamp when the packet was assembled */
|
|
635
|
+
assembledAt: z10.string().datetime()
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
// packages/schemas/dist/dispatch.js
|
|
641
|
+
import { z as z11 } from "zod";
|
|
642
|
+
var DispatchModeSchema, TaskComplexitySchema, AgentRoleSchema, BudgetsSchema, DispatchDecisionSchema;
|
|
643
|
+
var init_dispatch = __esm({
|
|
644
|
+
"packages/schemas/dist/dispatch.js"() {
|
|
645
|
+
"use strict";
|
|
646
|
+
DispatchModeSchema = z11.enum([
|
|
647
|
+
"single_pass",
|
|
648
|
+
"multi_agent",
|
|
649
|
+
"hybrid"
|
|
650
|
+
]);
|
|
651
|
+
TaskComplexitySchema = z11.enum(["low", "medium", "high"]);
|
|
652
|
+
AgentRoleSchema = z11.enum([
|
|
653
|
+
"planner",
|
|
654
|
+
"scout",
|
|
655
|
+
"editor",
|
|
656
|
+
"verifier",
|
|
657
|
+
"researcher"
|
|
658
|
+
]);
|
|
659
|
+
BudgetsSchema = z11.object({
|
|
660
|
+
/** Maximum prompt tokens across all model calls for this task */
|
|
661
|
+
promptTokens: z11.number().int().positive(),
|
|
662
|
+
/** Maximum number of retry cycles allowed per subtask */
|
|
663
|
+
retries: z11.number().int().nonnegative(),
|
|
664
|
+
/** Maximum wall-clock seconds before the task is considered timed out */
|
|
665
|
+
wallClockSec: z11.number().positive()
|
|
666
|
+
});
|
|
667
|
+
DispatchDecisionSchema = z11.object({
|
|
668
|
+
mode: DispatchModeSchema,
|
|
669
|
+
taskComplexity: TaskComplexitySchema,
|
|
670
|
+
splitRecommended: z11.boolean(),
|
|
671
|
+
/** Agent roles that should be spun up for the first wave of execution */
|
|
672
|
+
initialAgents: z11.array(AgentRoleSchema),
|
|
673
|
+
budgets: BudgetsSchema
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
// packages/schemas/dist/memory.js
|
|
679
|
+
import { z as z12 } from "zod";
|
|
680
|
+
var RiskLevelSchema, FileSummarySchema, FailureCategorySchema, FailureFingerprintSchema, TaskMemorySchema;
|
|
681
|
+
var init_memory = __esm({
|
|
682
|
+
"packages/schemas/dist/memory.js"() {
|
|
683
|
+
"use strict";
|
|
684
|
+
RiskLevelSchema = z12.enum(["low", "medium", "high", "critical"]);
|
|
685
|
+
FileSummarySchema = z12.object({
|
|
686
|
+
/** Repo-relative path of the file */
|
|
687
|
+
path: z12.string().min(1),
|
|
688
|
+
/** One-sentence description of the file's role */
|
|
689
|
+
purpose: z12.string(),
|
|
690
|
+
/** Primary exported symbols (functions, classes, constants) */
|
|
691
|
+
mainExports: z12.array(z12.string()),
|
|
692
|
+
/** Key import paths this file depends on */
|
|
693
|
+
keyImports: z12.array(z12.string()),
|
|
694
|
+
/** Logical ownership area (e.g. "auth", "api", "db", "frontend") */
|
|
695
|
+
ownershipDomain: z12.string(),
|
|
696
|
+
riskLevel: RiskLevelSchema,
|
|
697
|
+
/** Paths of test files that cover this file */
|
|
698
|
+
relatedTests: z12.array(z12.string()),
|
|
699
|
+
/** SHA-256 or similar hash of the file content at last index time */
|
|
700
|
+
summaryHash: z12.string(),
|
|
701
|
+
/** ISO-8601 timestamp of the last indexing pass */
|
|
702
|
+
lastIndexed: z12.string().datetime()
|
|
703
|
+
});
|
|
704
|
+
FailureCategorySchema = z12.enum([
|
|
705
|
+
"ts_type_drift",
|
|
706
|
+
"import_path_mismatch",
|
|
707
|
+
"route_not_registered",
|
|
708
|
+
"env_var_absent",
|
|
709
|
+
"schema_runtime_mismatch",
|
|
710
|
+
"migration_missing",
|
|
711
|
+
"circular_dependency",
|
|
712
|
+
"stale_snapshot",
|
|
713
|
+
"build_error",
|
|
714
|
+
"test_error",
|
|
715
|
+
"other"
|
|
716
|
+
]);
|
|
717
|
+
FailureFingerprintSchema = z12.object({
|
|
718
|
+
/** Short stable identifier (e.g. "ts_type_drift:UserSchema") */
|
|
719
|
+
fingerprint: z12.string().min(1),
|
|
720
|
+
category: FailureCategorySchema,
|
|
721
|
+
/** Human-readable summary of what went wrong */
|
|
722
|
+
description: z12.string(),
|
|
723
|
+
/** Files involved in or triggering the failure */
|
|
724
|
+
affectedFiles: z12.array(z12.string()),
|
|
725
|
+
/** How many times this fingerprint has been seen */
|
|
726
|
+
occurrenceCount: z12.number().int().nonnegative(),
|
|
727
|
+
/** ISO-8601 timestamp of first occurrence */
|
|
728
|
+
firstSeen: z12.string().datetime(),
|
|
729
|
+
/** ISO-8601 timestamp of most recent occurrence */
|
|
730
|
+
lastSeen: z12.string().datetime()
|
|
731
|
+
});
|
|
732
|
+
TaskMemorySchema = z12.object({
|
|
733
|
+
taskId: z12.string().min(1),
|
|
734
|
+
goal: z12.string(),
|
|
735
|
+
/** Normalised constraints carried into the task */
|
|
736
|
+
normalizedConstraints: z12.array(z12.string()),
|
|
737
|
+
/** Files that were read or modified during the task */
|
|
738
|
+
filesTouched: z12.array(z12.string()),
|
|
739
|
+
/** Summary of patches applied (not the full diff) */
|
|
740
|
+
patchesApplied: z12.array(z12.string()),
|
|
741
|
+
/** Final validation outcome ("pass" | "fail" | "partial") */
|
|
742
|
+
validationOutcome: z12.enum(["pass", "fail", "partial"]),
|
|
743
|
+
/** Human-readable reasons for any failures */
|
|
744
|
+
failureReasons: z12.array(z12.string()),
|
|
745
|
+
/** Follow-up tasks or open questions left behind */
|
|
746
|
+
followUpTodos: z12.array(z12.string()),
|
|
747
|
+
/**
|
|
748
|
+
* Subjective quality score 0–100 assigned by the verifier
|
|
749
|
+
* (100 = perfect, 0 = complete failure)
|
|
750
|
+
*/
|
|
751
|
+
qualityScore: z12.number().int().min(0).max(100),
|
|
752
|
+
/** ISO-8601 timestamp when the task completed */
|
|
753
|
+
completedAt: z12.string().datetime()
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
// packages/schemas/dist/backend.js
|
|
759
|
+
import { z as z13 } from "zod";
|
|
760
|
+
var MessageRoleSchema, ChatMessageSchema, CompletionRequestSchema, TokenUsageSchema, CompletionResponseSchema, StructuredCompletionRequestSchema, BackendHealthSchema, BackendMetricsSchema;
|
|
761
|
+
var init_backend = __esm({
|
|
762
|
+
"packages/schemas/dist/backend.js"() {
|
|
763
|
+
"use strict";
|
|
764
|
+
MessageRoleSchema = z13.enum([
|
|
765
|
+
"system",
|
|
766
|
+
"user",
|
|
767
|
+
"assistant",
|
|
768
|
+
"tool"
|
|
769
|
+
]);
|
|
770
|
+
ChatMessageSchema = z13.object({
|
|
771
|
+
role: MessageRoleSchema,
|
|
772
|
+
content: z13.string(),
|
|
773
|
+
/** Tool call ID, required when role === "tool" */
|
|
774
|
+
toolCallId: z13.string().optional(),
|
|
775
|
+
/** Tool name, required when role === "tool" */
|
|
776
|
+
name: z13.string().optional()
|
|
777
|
+
});
|
|
778
|
+
CompletionRequestSchema = z13.object({
|
|
779
|
+
messages: z13.array(ChatMessageSchema),
|
|
780
|
+
/** Override the model used by the backend for this request */
|
|
781
|
+
model: z13.string().optional(),
|
|
782
|
+
maxTokens: z13.number().int().positive().optional(),
|
|
783
|
+
temperature: z13.number().min(0).max(2).optional(),
|
|
784
|
+
/** Request class for queue routing */
|
|
785
|
+
queueClass: z13.string().optional(),
|
|
786
|
+
/** Prefix hash for cache-aware routing */
|
|
787
|
+
prefixHash: z13.string().optional(),
|
|
788
|
+
stopSequences: z13.array(z13.string()).optional()
|
|
789
|
+
});
|
|
790
|
+
TokenUsageSchema = z13.object({
|
|
791
|
+
promptTokens: z13.number().int().nonnegative(),
|
|
792
|
+
completionTokens: z13.number().int().nonnegative(),
|
|
793
|
+
totalTokens: z13.number().int().nonnegative(),
|
|
794
|
+
cacheCreationInputTokens: z13.number().int().nonnegative().optional(),
|
|
795
|
+
cacheReadInputTokens: z13.number().int().nonnegative().optional(),
|
|
796
|
+
promptEvalCount: z13.number().int().nonnegative().optional()
|
|
797
|
+
});
|
|
798
|
+
CompletionResponseSchema = z13.object({
|
|
799
|
+
content: z13.string(),
|
|
800
|
+
usage: TokenUsageSchema.optional(),
|
|
801
|
+
/** Which model actually served the request */
|
|
802
|
+
model: z13.string().optional(),
|
|
803
|
+
finishReason: z13.enum(["stop", "length", "tool_calls", "content_filter", "error"]).optional()
|
|
804
|
+
});
|
|
805
|
+
StructuredCompletionRequestSchema = CompletionRequestSchema.extend({
|
|
806
|
+
/**
|
|
807
|
+
* The Zod schema used to constrain and validate the output.
|
|
808
|
+
* Stored as unknown here because Zod schemas are not themselves
|
|
809
|
+
* serialisable — callers pass the live schema object.
|
|
810
|
+
*/
|
|
811
|
+
outputSchema: z13.unknown(),
|
|
812
|
+
/** Human-readable label used in prompt injection for the schema */
|
|
813
|
+
schemaLabel: z13.string().optional()
|
|
814
|
+
});
|
|
815
|
+
BackendHealthSchema = z13.object({
|
|
816
|
+
status: z13.enum(["ok", "degraded", "down"]),
|
|
817
|
+
latencyMs: z13.number().nonnegative().optional(),
|
|
818
|
+
/** Fraction of GPU memory currently in use (0–1) */
|
|
819
|
+
gpuMemoryUsed: z13.number().min(0).max(1).optional(),
|
|
820
|
+
/** Fraction of KV cache currently in use (0–1) */
|
|
821
|
+
kvCacheUsed: z13.number().min(0).max(1).optional(),
|
|
822
|
+
/** Number of requests currently waiting in the queue */
|
|
823
|
+
queueDepth: z13.number().int().nonnegative().optional(),
|
|
824
|
+
/** Human-readable note about any degraded state */
|
|
825
|
+
note: z13.string().optional()
|
|
826
|
+
});
|
|
827
|
+
BackendMetricsSchema = z13.object({
|
|
828
|
+
/** Total requests handled since startup */
|
|
829
|
+
totalRequests: z13.number().int().nonnegative(),
|
|
830
|
+
/** Requests that completed successfully */
|
|
831
|
+
successfulRequests: z13.number().int().nonnegative(),
|
|
832
|
+
/** Requests that failed */
|
|
833
|
+
failedRequests: z13.number().int().nonnegative(),
|
|
834
|
+
/** Average time-to-first-token across recent requests (ms) */
|
|
835
|
+
avgTtftMs: z13.number().nonnegative().optional(),
|
|
836
|
+
/** Average end-to-end latency across recent requests (ms) */
|
|
837
|
+
avgLatencyMs: z13.number().nonnegative().optional(),
|
|
838
|
+
/** Approximate prefix cache hit rate (0–1) */
|
|
839
|
+
prefixCacheHitRate: z13.number().min(0).max(1).optional(),
|
|
840
|
+
/** Number of sleep/wake cycles since startup */
|
|
841
|
+
sleepWakeCycles: z13.number().int().nonnegative().optional(),
|
|
842
|
+
/** Number of OOM / preemption / offload events */
|
|
843
|
+
oomEvents: z13.number().int().nonnegative().optional(),
|
|
844
|
+
/** ISO-8601 timestamp of when the backend service started */
|
|
845
|
+
uptimeSince: z13.string().datetime().optional()
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// packages/schemas/dist/config.js
|
|
851
|
+
import { z as z14 } from "zod";
|
|
852
|
+
var AgentConfigSchema;
|
|
853
|
+
var init_config = __esm({
|
|
854
|
+
"packages/schemas/dist/config.js"() {
|
|
855
|
+
"use strict";
|
|
856
|
+
AgentConfigSchema = z14.object({
|
|
857
|
+
// -----------------------------------------------------------------------
|
|
858
|
+
// Model / backend
|
|
859
|
+
// -----------------------------------------------------------------------
|
|
860
|
+
/** HuggingFace model ID, e.g. "Qwen/Qwen3.5-122B-A10B" */
|
|
861
|
+
MODEL_ID: z14.string().min(1),
|
|
862
|
+
/** Base URL of the primary vLLM OpenAI-compatible endpoint */
|
|
863
|
+
VLLM_BASE_URL: z14.string().url(),
|
|
864
|
+
/** API key sent to the vLLM service (often the literal string "EMPTY") */
|
|
865
|
+
VLLM_API_KEY: z14.string().default("EMPTY"),
|
|
866
|
+
// -----------------------------------------------------------------------
|
|
867
|
+
// Context / memory tuning
|
|
868
|
+
// -----------------------------------------------------------------------
|
|
869
|
+
/**
|
|
870
|
+
* Maximum context length for the model.
|
|
871
|
+
* Should be discovered by startup probing rather than hard-coded.
|
|
872
|
+
*/
|
|
873
|
+
AGENT_MAX_MODEL_LEN: z14.string().transform((v) => parseInt(v, 10)).pipe(z14.number().int().positive()).default(65536),
|
|
874
|
+
/** Enable vLLM automatic prefix caching (1 = enabled) */
|
|
875
|
+
AGENT_ENABLE_PREFIX_CACHING: z14.string().transform((v) => v === "1" || v.toLowerCase() === "true").pipe(z14.boolean()).default(true),
|
|
876
|
+
/** Enable vLLM sleep mode when idle (1 = enabled) */
|
|
877
|
+
AGENT_ENABLE_SLEEP_MODE: z14.string().transform((v) => v === "1" || v.toLowerCase() === "true").pipe(z14.boolean()).default(true),
|
|
878
|
+
// -----------------------------------------------------------------------
|
|
879
|
+
// Agent behaviour
|
|
880
|
+
// -----------------------------------------------------------------------
|
|
881
|
+
/** Maximum retry cycles per subtask */
|
|
882
|
+
AGENT_MAX_RETRIES: z14.string().transform((v) => parseInt(v, 10)).pipe(z14.number().int().nonnegative()).default(3),
|
|
883
|
+
/** Maximum number of parallel subagents that may run simultaneously */
|
|
884
|
+
AGENT_MAX_PARALLEL_SUBAGENTS: z14.string().transform((v) => parseInt(v, 10)).pipe(z14.number().int().positive()).default(4),
|
|
885
|
+
// -----------------------------------------------------------------------
|
|
886
|
+
// Retrieval limits
|
|
887
|
+
// -----------------------------------------------------------------------
|
|
888
|
+
/** Maximum files included in a single retrieval packet */
|
|
889
|
+
AGENT_RETRIEVAL_MAX_FILES: z14.string().transform((v) => parseInt(v, 10)).pipe(z14.number().int().positive()).default(8),
|
|
890
|
+
/** Maximum snippets included in a single retrieval packet */
|
|
891
|
+
AGENT_RETRIEVAL_MAX_SNIPPETS: z14.string().transform((v) => parseInt(v, 10)).pipe(z14.number().int().positive()).default(16),
|
|
892
|
+
// -----------------------------------------------------------------------
|
|
893
|
+
// File paths
|
|
894
|
+
// -----------------------------------------------------------------------
|
|
895
|
+
/** Directory where agent working trees and artefacts are written */
|
|
896
|
+
AGENT_WORK_ROOT: z14.string().min(1),
|
|
897
|
+
/** Directory where the indexer stores its indexes and embeddings */
|
|
898
|
+
AGENT_INDEX_ROOT: z14.string().min(1),
|
|
899
|
+
// -----------------------------------------------------------------------
|
|
900
|
+
// Optional models
|
|
901
|
+
// -----------------------------------------------------------------------
|
|
902
|
+
/** Model ID or endpoint for the embedding model (optional) */
|
|
903
|
+
AGENT_EMBEDDING_MODEL: z14.string().optional(),
|
|
904
|
+
/**
|
|
905
|
+
* Optional smaller local model for triage/summarisation tasks.
|
|
906
|
+
* When set, used in Profile C (hybrid mode).
|
|
907
|
+
*/
|
|
908
|
+
AGENT_SMALL_MODEL: z14.string().optional()
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
// packages/schemas/dist/queue.js
|
|
914
|
+
import { z as z15 } from "zod";
|
|
915
|
+
var QueueClassSchema;
|
|
916
|
+
var init_queue = __esm({
|
|
917
|
+
"packages/schemas/dist/queue.js"() {
|
|
918
|
+
"use strict";
|
|
919
|
+
QueueClassSchema = z15.enum([
|
|
920
|
+
/** CLI and direct user-facing requests; lowest latency target */
|
|
921
|
+
"interactive-high",
|
|
922
|
+
/** Planner role requests; moderate priority */
|
|
923
|
+
"planner-medium",
|
|
924
|
+
/** Editor role patch generation; high priority, may be long-running */
|
|
925
|
+
"editor-high",
|
|
926
|
+
/** Verifier role review; high priority, usually short */
|
|
927
|
+
"verifier-high",
|
|
928
|
+
/** Memory write-back and summarisation; background, low priority */
|
|
929
|
+
"memory-low",
|
|
930
|
+
/** Bulk indexing and embedding; lowest priority, best-effort */
|
|
931
|
+
"batch-indexing-low"
|
|
932
|
+
]);
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
|
|
936
|
+
// packages/schemas/dist/operational-world.js
|
|
937
|
+
import { z as z16 } from "zod";
|
|
938
|
+
function addDuplicateIdIssues(values, path3, ctx) {
|
|
939
|
+
const seen = /* @__PURE__ */ new Set();
|
|
940
|
+
for (let index = 0; index < values.length; index++) {
|
|
941
|
+
const value = values[index];
|
|
942
|
+
if (seen.has(value)) {
|
|
943
|
+
ctx.addIssue({
|
|
944
|
+
code: "custom",
|
|
945
|
+
path: [path3, index],
|
|
946
|
+
message: `duplicate identifier: ${value}`
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
seen.add(value);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
function validateGraphCollections(value, ctx) {
|
|
953
|
+
addDuplicateIdIssues(value.nodes.map((item) => item.nodeId), "nodes", ctx);
|
|
954
|
+
addDuplicateIdIssues(value.edges.map((item) => item.edgeId), "edges", ctx);
|
|
955
|
+
addDuplicateIdIssues(value.sourceBindings.map((item) => item.bindingId), "sourceBindings", ctx);
|
|
956
|
+
addDuplicateIdIssues(value.evidenceRefs.map((item) => item.evidenceId), "evidenceRefs", ctx);
|
|
957
|
+
addDuplicateIdIssues(value.claims.map((item) => item.claimId), "claims", ctx);
|
|
958
|
+
addDuplicateIdIssues(value.conflicts.map((item) => item.conflictId), "conflicts", ctx);
|
|
959
|
+
const nodeIds = new Set(value.nodes.map((item) => item.nodeId));
|
|
960
|
+
const bindingIds = new Set(value.sourceBindings.map((item) => item.bindingId));
|
|
961
|
+
const evidenceIds = new Set(value.evidenceRefs.map((item) => item.evidenceId));
|
|
962
|
+
const claimIds = new Set(value.claims.map((item) => item.claimId));
|
|
963
|
+
const conflictIds = new Set(value.conflicts.map((item) => item.conflictId));
|
|
964
|
+
value.nodes.forEach((node, index) => {
|
|
965
|
+
if (node.parentNodeId && !nodeIds.has(node.parentNodeId)) {
|
|
966
|
+
ctx.addIssue({
|
|
967
|
+
code: "custom",
|
|
968
|
+
path: ["nodes", index, "parentNodeId"],
|
|
969
|
+
message: `unknown parent node: ${node.parentNodeId}`
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
node.bindingIds.forEach((id2) => {
|
|
973
|
+
if (!bindingIds.has(id2)) {
|
|
974
|
+
ctx.addIssue({
|
|
975
|
+
code: "custom",
|
|
976
|
+
path: ["nodes", index, "bindingIds"],
|
|
977
|
+
message: `unknown source binding: ${id2}`
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
node.evidenceRefIds.forEach((id2) => {
|
|
982
|
+
if (!evidenceIds.has(id2)) {
|
|
983
|
+
ctx.addIssue({
|
|
984
|
+
code: "custom",
|
|
985
|
+
path: ["nodes", index, "evidenceRefIds"],
|
|
986
|
+
message: `unknown evidence reference: ${id2}`
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
if (node.reference?.type === "claim" && !claimIds.has(node.reference.claimId)) {
|
|
991
|
+
ctx.addIssue({
|
|
992
|
+
code: "custom",
|
|
993
|
+
path: ["nodes", index, "reference", "claimId"],
|
|
994
|
+
message: `unknown claim: ${node.reference.claimId}`
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
if (node.reference?.type === "conflict" && !conflictIds.has(node.reference.conflictId)) {
|
|
998
|
+
ctx.addIssue({
|
|
999
|
+
code: "custom",
|
|
1000
|
+
path: ["nodes", index, "reference", "conflictId"],
|
|
1001
|
+
message: `unknown conflict: ${node.reference.conflictId}`
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
if (node.reference?.type === "evidence" && !evidenceIds.has(node.reference.evidenceId)) {
|
|
1005
|
+
ctx.addIssue({
|
|
1006
|
+
code: "custom",
|
|
1007
|
+
path: ["nodes", index, "reference", "evidenceId"],
|
|
1008
|
+
message: `unknown evidence reference: ${node.reference.evidenceId}`
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
if (node.reference?.type === "source" && !bindingIds.has(node.reference.bindingId)) {
|
|
1012
|
+
ctx.addIssue({
|
|
1013
|
+
code: "custom",
|
|
1014
|
+
path: ["nodes", index, "reference", "bindingId"],
|
|
1015
|
+
message: `unknown source binding: ${node.reference.bindingId}`
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
node.actionContract?.preconditions.forEach((precondition) => {
|
|
1019
|
+
precondition.evidenceRefIds.forEach((id2) => {
|
|
1020
|
+
if (!evidenceIds.has(id2)) {
|
|
1021
|
+
ctx.addIssue({
|
|
1022
|
+
code: "custom",
|
|
1023
|
+
path: ["nodes", index, "actionContract", "preconditions"],
|
|
1024
|
+
message: `unknown precondition evidence reference: ${id2}`
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
});
|
|
1029
|
+
node.actionContract?.mutations.forEach((mutation, mutationIndex) => {
|
|
1030
|
+
const target = mutation.target;
|
|
1031
|
+
const targetExists = target.type === "artifact" || target.type === "node" && nodeIds.has(target.nodeId) || target.type === "claim" && claimIds.has(target.claimId) || target.type === "conflict" && conflictIds.has(target.conflictId) || target.type === "evidence" && evidenceIds.has(target.evidenceId) || target.type === "source" && bindingIds.has(target.bindingId);
|
|
1032
|
+
if (!targetExists) {
|
|
1033
|
+
ctx.addIssue({
|
|
1034
|
+
code: "custom",
|
|
1035
|
+
path: [
|
|
1036
|
+
"nodes",
|
|
1037
|
+
index,
|
|
1038
|
+
"actionContract",
|
|
1039
|
+
"mutations",
|
|
1040
|
+
mutationIndex,
|
|
1041
|
+
"target"
|
|
1042
|
+
],
|
|
1043
|
+
message: "action mutation target is absent from the graph"
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
});
|
|
1048
|
+
value.edges.forEach((edge, index) => {
|
|
1049
|
+
if (!nodeIds.has(edge.sourceNodeId)) {
|
|
1050
|
+
ctx.addIssue({
|
|
1051
|
+
code: "custom",
|
|
1052
|
+
path: ["edges", index, "sourceNodeId"],
|
|
1053
|
+
message: `unknown source node: ${edge.sourceNodeId}`
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
if (!nodeIds.has(edge.targetNodeId)) {
|
|
1057
|
+
ctx.addIssue({
|
|
1058
|
+
code: "custom",
|
|
1059
|
+
path: ["edges", index, "targetNodeId"],
|
|
1060
|
+
message: `unknown target node: ${edge.targetNodeId}`
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
edge.evidenceRefIds.forEach((id2) => {
|
|
1064
|
+
if (!evidenceIds.has(id2)) {
|
|
1065
|
+
ctx.addIssue({
|
|
1066
|
+
code: "custom",
|
|
1067
|
+
path: ["edges", index, "evidenceRefIds"],
|
|
1068
|
+
message: `unknown evidence reference: ${id2}`
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
value.evidenceRefs.forEach((evidence, index) => {
|
|
1074
|
+
if (!bindingIds.has(evidence.bindingId)) {
|
|
1075
|
+
ctx.addIssue({
|
|
1076
|
+
code: "custom",
|
|
1077
|
+
path: ["evidenceRefs", index, "bindingId"],
|
|
1078
|
+
message: `unknown source binding: ${evidence.bindingId}`
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
value.claims.forEach((claim, index) => {
|
|
1083
|
+
if (claim.subjectNodeId && !nodeIds.has(claim.subjectNodeId)) {
|
|
1084
|
+
ctx.addIssue({
|
|
1085
|
+
code: "custom",
|
|
1086
|
+
path: ["claims", index, "subjectNodeId"],
|
|
1087
|
+
message: `unknown claim subject node: ${claim.subjectNodeId}`
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
claim.evidenceRefIds.forEach((id2) => {
|
|
1091
|
+
if (!evidenceIds.has(id2)) {
|
|
1092
|
+
ctx.addIssue({
|
|
1093
|
+
code: "custom",
|
|
1094
|
+
path: ["claims", index, "evidenceRefIds"],
|
|
1095
|
+
message: `unknown evidence reference: ${id2}`
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
claim.dependsOnClaimIds.forEach((id2) => {
|
|
1100
|
+
if (!claimIds.has(id2)) {
|
|
1101
|
+
ctx.addIssue({
|
|
1102
|
+
code: "custom",
|
|
1103
|
+
path: ["claims", index, "dependsOnClaimIds"],
|
|
1104
|
+
message: `unknown claim dependency: ${id2}`
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
});
|
|
1109
|
+
value.conflicts.forEach((conflict, index) => {
|
|
1110
|
+
conflict.claimIds.forEach((id2) => {
|
|
1111
|
+
if (!claimIds.has(id2)) {
|
|
1112
|
+
ctx.addIssue({
|
|
1113
|
+
code: "custom",
|
|
1114
|
+
path: ["conflicts", index, "claimIds"],
|
|
1115
|
+
message: `unknown conflict claim: ${id2}`
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
conflict.evidenceRefIds.forEach((id2) => {
|
|
1120
|
+
if (!evidenceIds.has(id2)) {
|
|
1121
|
+
ctx.addIssue({
|
|
1122
|
+
code: "custom",
|
|
1123
|
+
path: ["conflicts", index, "evidenceRefIds"],
|
|
1124
|
+
message: `unknown evidence reference: ${id2}`
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
conflict.resolution?.evidenceRefIds.forEach((id2) => {
|
|
1129
|
+
if (!evidenceIds.has(id2)) {
|
|
1130
|
+
ctx.addIssue({
|
|
1131
|
+
code: "custom",
|
|
1132
|
+
path: ["conflicts", index, "resolution", "evidenceRefIds"],
|
|
1133
|
+
message: `unknown resolution evidence reference: ${id2}`
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
var OPERATIONAL_WORLD_SCHEMA_VERSION, OperationalWorldSchemaVersionSchema, OperationalWorldIdSchema, OperationalWorldRevisionSchema, ConfidenceSchema, OperationalFactScopeSchema, OperationalMetadataDerivedFieldSchema, OperationalMetadataProvenanceSchema, JsonValueSchema, LineRangeLocatorSchema, CharacterRangeLocatorSchema, PageRangeLocatorSchema, SheetRangeLocatorSchema, TableRangeLocatorSchema, JsonPathLocatorSchema, HeadingLocatorSchema, FieldLocatorSchema, UriFragmentLocatorSchema, EvidenceLocatorSchema, SourceAuthoritySchema, SourceFreshnessSchema, SourceReadPolicySchema, SourceBindingSchema, EvidenceRoleSchema, EvidenceRefSchema, ClaimKindSchema, ClaimPolaritySchema, ClaimStatusSchema, WorkGraphNodeAuthoritySchema, ClaimSchema, ConflictKindSchema, ConflictStatusSchema, ConflictResolutionSchema, ConflictSchema, WorkGraphNodeKindSchema, WorkGraphNodeStatusSchema, WorkGraphTargetRefSchema, WorkActionPreconditionSchema, WorkActionMutationSchema, WorkActionApprovalSchema, WorkActionContractSchema, WorkGraphNodeReferenceSchema, WorkGraphNodeSchema, WorkGraphEdgeKindSchema, WorkGraphEdgeSchema, WorkGraphSchema, WorldPatchOperationSchema, WorldPatchSchema, ValidationIssueSeveritySchema, OperationalValidationIssueSchema, OperationalValidationStatusSchema, OperationalValidationResultSchema, ValidationArtifactHashSchema, OperationalValidationReceiptSchema, ReasoningSliceSelectionSchema, ReasoningSliceSchema;
|
|
1140
|
+
var init_operational_world = __esm({
|
|
1141
|
+
"packages/schemas/dist/operational-world.js"() {
|
|
1142
|
+
"use strict";
|
|
1143
|
+
OPERATIONAL_WORLD_SCHEMA_VERSION = "omnius.operational-world.v1";
|
|
1144
|
+
OperationalWorldSchemaVersionSchema = z16.literal(OPERATIONAL_WORLD_SCHEMA_VERSION);
|
|
1145
|
+
OperationalWorldIdSchema = z16.string().trim().min(1).max(256);
|
|
1146
|
+
OperationalWorldRevisionSchema = z16.string().trim().min(1).max(256);
|
|
1147
|
+
ConfidenceSchema = z16.number().finite().min(0).max(1);
|
|
1148
|
+
OperationalFactScopeSchema = z16.object({
|
|
1149
|
+
kind: z16.enum([
|
|
1150
|
+
"global",
|
|
1151
|
+
"run",
|
|
1152
|
+
"task",
|
|
1153
|
+
"session",
|
|
1154
|
+
"chat",
|
|
1155
|
+
"thread",
|
|
1156
|
+
"conversation",
|
|
1157
|
+
"legacy_unscoped"
|
|
1158
|
+
]),
|
|
1159
|
+
scopeId: OperationalWorldIdSchema,
|
|
1160
|
+
taskEpoch: z16.number().int().nonnegative().optional()
|
|
1161
|
+
}).strict();
|
|
1162
|
+
OperationalMetadataDerivedFieldSchema = z16.enum([
|
|
1163
|
+
"source_evidence",
|
|
1164
|
+
"confidence",
|
|
1165
|
+
"revision",
|
|
1166
|
+
"temporal_validity",
|
|
1167
|
+
"scope",
|
|
1168
|
+
"metadata_provenance"
|
|
1169
|
+
]);
|
|
1170
|
+
OperationalMetadataProvenanceSchema = z16.discriminatedUnion("kind", [
|
|
1171
|
+
z16.object({ kind: z16.literal("native") }).strict(),
|
|
1172
|
+
z16.object({
|
|
1173
|
+
kind: z16.literal("legacy_derived"),
|
|
1174
|
+
marker: z16.literal("metadata-only-no-semantic-assertion"),
|
|
1175
|
+
sourceRecordId: OperationalWorldIdSchema,
|
|
1176
|
+
derivedFields: z16.array(OperationalMetadataDerivedFieldSchema).min(1).max(6)
|
|
1177
|
+
}).strict()
|
|
1178
|
+
]);
|
|
1179
|
+
JsonValueSchema = z16.lazy(() => z16.union([
|
|
1180
|
+
z16.string(),
|
|
1181
|
+
z16.number().finite(),
|
|
1182
|
+
z16.boolean(),
|
|
1183
|
+
z16.null(),
|
|
1184
|
+
z16.array(JsonValueSchema),
|
|
1185
|
+
z16.record(z16.string(), JsonValueSchema)
|
|
1186
|
+
]));
|
|
1187
|
+
LineRangeLocatorSchema = z16.object({
|
|
1188
|
+
type: z16.literal("line_range"),
|
|
1189
|
+
startLine: z16.number().int().positive(),
|
|
1190
|
+
endLine: z16.number().int().positive()
|
|
1191
|
+
}).strict();
|
|
1192
|
+
CharacterRangeLocatorSchema = z16.object({
|
|
1193
|
+
type: z16.literal("character_range"),
|
|
1194
|
+
startOffset: z16.number().int().nonnegative(),
|
|
1195
|
+
/** Exclusive end offset. */
|
|
1196
|
+
endOffset: z16.number().int().positive()
|
|
1197
|
+
}).strict();
|
|
1198
|
+
PageRangeLocatorSchema = z16.object({
|
|
1199
|
+
type: z16.literal("page_range"),
|
|
1200
|
+
startPage: z16.number().int().positive(),
|
|
1201
|
+
endPage: z16.number().int().positive()
|
|
1202
|
+
}).strict();
|
|
1203
|
+
SheetRangeLocatorSchema = z16.object({
|
|
1204
|
+
type: z16.literal("sheet_range"),
|
|
1205
|
+
sheetName: z16.string().trim().min(1).max(256),
|
|
1206
|
+
startRow: z16.number().int().positive().optional(),
|
|
1207
|
+
endRow: z16.number().int().positive().optional(),
|
|
1208
|
+
startColumn: z16.number().int().positive().optional(),
|
|
1209
|
+
endColumn: z16.number().int().positive().optional()
|
|
1210
|
+
}).strict();
|
|
1211
|
+
TableRangeLocatorSchema = z16.object({
|
|
1212
|
+
type: z16.literal("table_range"),
|
|
1213
|
+
table: z16.string().trim().min(1).max(256),
|
|
1214
|
+
startRow: z16.number().int().nonnegative(),
|
|
1215
|
+
endRow: z16.number().int().nonnegative(),
|
|
1216
|
+
columns: z16.array(z16.string().trim().min(1).max(256)).max(128).optional()
|
|
1217
|
+
}).strict();
|
|
1218
|
+
JsonPathLocatorSchema = z16.object({
|
|
1219
|
+
type: z16.literal("json_path"),
|
|
1220
|
+
path: z16.string().trim().min(1).max(2048)
|
|
1221
|
+
}).strict();
|
|
1222
|
+
HeadingLocatorSchema = z16.object({
|
|
1223
|
+
type: z16.literal("heading"),
|
|
1224
|
+
heading: z16.string().trim().min(1).max(1024),
|
|
1225
|
+
occurrence: z16.number().int().positive().optional()
|
|
1226
|
+
}).strict();
|
|
1227
|
+
FieldLocatorSchema = z16.object({
|
|
1228
|
+
type: z16.literal("field"),
|
|
1229
|
+
path: z16.array(z16.string().trim().min(1).max(256)).min(1).max(64),
|
|
1230
|
+
recordKey: z16.string().trim().min(1).max(512).optional()
|
|
1231
|
+
}).strict();
|
|
1232
|
+
UriFragmentLocatorSchema = z16.object({
|
|
1233
|
+
type: z16.literal("uri_fragment"),
|
|
1234
|
+
fragment: z16.string().trim().min(1).max(2048)
|
|
1235
|
+
}).strict();
|
|
1236
|
+
EvidenceLocatorSchema = z16.discriminatedUnion("type", [
|
|
1237
|
+
LineRangeLocatorSchema,
|
|
1238
|
+
CharacterRangeLocatorSchema,
|
|
1239
|
+
PageRangeLocatorSchema,
|
|
1240
|
+
SheetRangeLocatorSchema,
|
|
1241
|
+
TableRangeLocatorSchema,
|
|
1242
|
+
JsonPathLocatorSchema,
|
|
1243
|
+
HeadingLocatorSchema,
|
|
1244
|
+
FieldLocatorSchema,
|
|
1245
|
+
UriFragmentLocatorSchema
|
|
1246
|
+
]).superRefine((locator, ctx) => {
|
|
1247
|
+
if (locator.type === "line_range" && locator.endLine < locator.startLine) {
|
|
1248
|
+
ctx.addIssue({
|
|
1249
|
+
code: "custom",
|
|
1250
|
+
path: ["endLine"],
|
|
1251
|
+
message: "endLine must be greater than or equal to startLine"
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
if (locator.type === "character_range" && locator.endOffset <= locator.startOffset) {
|
|
1255
|
+
ctx.addIssue({
|
|
1256
|
+
code: "custom",
|
|
1257
|
+
path: ["endOffset"],
|
|
1258
|
+
message: "endOffset must be greater than startOffset"
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
if (locator.type === "page_range" && locator.endPage < locator.startPage) {
|
|
1262
|
+
ctx.addIssue({
|
|
1263
|
+
code: "custom",
|
|
1264
|
+
path: ["endPage"],
|
|
1265
|
+
message: "endPage must be greater than or equal to startPage"
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
if (locator.type === "sheet_range") {
|
|
1269
|
+
if (locator.endRow !== void 0 && locator.startRow === void 0) {
|
|
1270
|
+
ctx.addIssue({
|
|
1271
|
+
code: "custom",
|
|
1272
|
+
path: ["startRow"],
|
|
1273
|
+
message: "startRow is required when endRow is present"
|
|
1274
|
+
});
|
|
1275
|
+
} else if (locator.startRow !== void 0 && locator.endRow !== void 0 && locator.endRow < locator.startRow) {
|
|
1276
|
+
ctx.addIssue({
|
|
1277
|
+
code: "custom",
|
|
1278
|
+
path: ["endRow"],
|
|
1279
|
+
message: "endRow must be greater than or equal to startRow"
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
if (locator.endColumn !== void 0 && locator.startColumn === void 0) {
|
|
1283
|
+
ctx.addIssue({
|
|
1284
|
+
code: "custom",
|
|
1285
|
+
path: ["startColumn"],
|
|
1286
|
+
message: "startColumn is required when endColumn is present"
|
|
1287
|
+
});
|
|
1288
|
+
} else if (locator.startColumn !== void 0 && locator.endColumn !== void 0 && locator.endColumn < locator.startColumn) {
|
|
1289
|
+
ctx.addIssue({
|
|
1290
|
+
code: "custom",
|
|
1291
|
+
path: ["endColumn"],
|
|
1292
|
+
message: "endColumn must be greater than or equal to startColumn"
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
if (locator.type === "table_range" && locator.endRow < locator.startRow) {
|
|
1297
|
+
ctx.addIssue({
|
|
1298
|
+
code: "custom",
|
|
1299
|
+
path: ["endRow"],
|
|
1300
|
+
message: "endRow must be greater than or equal to startRow"
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
});
|
|
1304
|
+
SourceAuthoritySchema = z16.enum([
|
|
1305
|
+
"authoritative",
|
|
1306
|
+
"primary",
|
|
1307
|
+
"secondary",
|
|
1308
|
+
"derived",
|
|
1309
|
+
"unknown"
|
|
1310
|
+
]);
|
|
1311
|
+
SourceFreshnessSchema = z16.enum(["fresh", "stale", "unknown"]);
|
|
1312
|
+
SourceReadPolicySchema = z16.enum([
|
|
1313
|
+
"immutable",
|
|
1314
|
+
"snapshot",
|
|
1315
|
+
"refresh_before_use",
|
|
1316
|
+
"live"
|
|
1317
|
+
]);
|
|
1318
|
+
SourceBindingSchema = z16.object({
|
|
1319
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1320
|
+
bindingId: OperationalWorldIdSchema,
|
|
1321
|
+
sourceId: OperationalWorldIdSchema,
|
|
1322
|
+
/** URI, repo-relative path, or external source identifier. */
|
|
1323
|
+
sourceUri: z16.string().trim().min(1).max(4096),
|
|
1324
|
+
sourceRevision: OperationalWorldRevisionSchema,
|
|
1325
|
+
sourceHash: z16.string().trim().min(1).max(512).optional(),
|
|
1326
|
+
locator: EvidenceLocatorSchema,
|
|
1327
|
+
authority: SourceAuthoritySchema,
|
|
1328
|
+
freshness: SourceFreshnessSchema,
|
|
1329
|
+
readPolicy: SourceReadPolicySchema,
|
|
1330
|
+
observedAt: z16.string().datetime(),
|
|
1331
|
+
confidence: ConfidenceSchema,
|
|
1332
|
+
notes: z16.string().trim().max(2e3).optional()
|
|
1333
|
+
}).strict();
|
|
1334
|
+
EvidenceRoleSchema = z16.enum([
|
|
1335
|
+
"supports",
|
|
1336
|
+
"refutes",
|
|
1337
|
+
"context",
|
|
1338
|
+
"verification",
|
|
1339
|
+
"blocker"
|
|
1340
|
+
]);
|
|
1341
|
+
EvidenceRefSchema = z16.object({
|
|
1342
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1343
|
+
evidenceId: OperationalWorldIdSchema,
|
|
1344
|
+
bindingId: OperationalWorldIdSchema,
|
|
1345
|
+
role: EvidenceRoleSchema,
|
|
1346
|
+
excerpt: z16.string().max(4e3).optional(),
|
|
1347
|
+
excerptHash: z16.string().trim().min(1).max(512).optional(),
|
|
1348
|
+
observedAt: z16.string().datetime(),
|
|
1349
|
+
confidence: ConfidenceSchema,
|
|
1350
|
+
tags: z16.array(z16.string().trim().min(1).max(128)).max(64)
|
|
1351
|
+
}).strict();
|
|
1352
|
+
ClaimKindSchema = z16.enum([
|
|
1353
|
+
"fact",
|
|
1354
|
+
"inference",
|
|
1355
|
+
"requirement",
|
|
1356
|
+
"constraint",
|
|
1357
|
+
"outcome"
|
|
1358
|
+
]);
|
|
1359
|
+
ClaimPolaritySchema = z16.enum(["positive", "negative"]);
|
|
1360
|
+
ClaimStatusSchema = z16.enum([
|
|
1361
|
+
"proposed",
|
|
1362
|
+
"supported",
|
|
1363
|
+
"refuted",
|
|
1364
|
+
"contested",
|
|
1365
|
+
"unverified",
|
|
1366
|
+
"blocked"
|
|
1367
|
+
]);
|
|
1368
|
+
WorkGraphNodeAuthoritySchema = z16.enum([
|
|
1369
|
+
"explicit",
|
|
1370
|
+
"inferred",
|
|
1371
|
+
"adopted"
|
|
1372
|
+
]);
|
|
1373
|
+
ClaimSchema = z16.object({
|
|
1374
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1375
|
+
claimId: OperationalWorldIdSchema,
|
|
1376
|
+
statement: z16.string().trim().min(1).max(4e3),
|
|
1377
|
+
kind: ClaimKindSchema,
|
|
1378
|
+
polarity: ClaimPolaritySchema,
|
|
1379
|
+
status: ClaimStatusSchema,
|
|
1380
|
+
confidence: ConfidenceSchema,
|
|
1381
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).max(256),
|
|
1382
|
+
dependsOnClaimIds: z16.array(OperationalWorldIdSchema).max(256),
|
|
1383
|
+
tags: z16.array(z16.string().trim().min(1).max(128)).max(64),
|
|
1384
|
+
/** Structured proposition fields used to group competing claims. */
|
|
1385
|
+
subjectNodeId: OperationalWorldIdSchema.optional(),
|
|
1386
|
+
predicate: z16.string().trim().min(1).max(512).optional(),
|
|
1387
|
+
objectValue: JsonValueSchema.optional(),
|
|
1388
|
+
validFrom: z16.string().datetime().optional(),
|
|
1389
|
+
validTo: z16.string().datetime().optional(),
|
|
1390
|
+
authority: WorkGraphNodeAuthoritySchema.optional()
|
|
1391
|
+
}).strict().superRefine((claim, ctx) => {
|
|
1392
|
+
if (claim.validFrom !== void 0 && claim.validTo !== void 0 && Date.parse(claim.validTo) < Date.parse(claim.validFrom)) {
|
|
1393
|
+
ctx.addIssue({
|
|
1394
|
+
code: "custom",
|
|
1395
|
+
path: ["validTo"],
|
|
1396
|
+
message: "validTo must not precede validFrom"
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
});
|
|
1400
|
+
ConflictKindSchema = z16.enum([
|
|
1401
|
+
"contradiction",
|
|
1402
|
+
"source_disagreement",
|
|
1403
|
+
"temporal",
|
|
1404
|
+
"schema",
|
|
1405
|
+
"authority"
|
|
1406
|
+
]);
|
|
1407
|
+
ConflictStatusSchema = z16.enum([
|
|
1408
|
+
"open",
|
|
1409
|
+
"resolved",
|
|
1410
|
+
"accepted_uncertainty"
|
|
1411
|
+
]);
|
|
1412
|
+
ConflictResolutionSchema = z16.object({
|
|
1413
|
+
decision: z16.string().trim().min(1).max(2e3),
|
|
1414
|
+
rationale: z16.string().trim().min(1).max(4e3),
|
|
1415
|
+
resolvedBy: z16.string().trim().min(1).max(256),
|
|
1416
|
+
resolvedAt: z16.string().datetime(),
|
|
1417
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).max(256)
|
|
1418
|
+
}).strict();
|
|
1419
|
+
ConflictSchema = z16.object({
|
|
1420
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1421
|
+
conflictId: OperationalWorldIdSchema,
|
|
1422
|
+
kind: ConflictKindSchema,
|
|
1423
|
+
summary: z16.string().trim().min(1).max(4e3),
|
|
1424
|
+
claimIds: z16.array(OperationalWorldIdSchema).min(2).max(64),
|
|
1425
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).max(256),
|
|
1426
|
+
status: ConflictStatusSchema,
|
|
1427
|
+
resolution: ConflictResolutionSchema.optional()
|
|
1428
|
+
}).strict().superRefine((conflict, ctx) => {
|
|
1429
|
+
if (new Set(conflict.claimIds).size !== conflict.claimIds.length) {
|
|
1430
|
+
ctx.addIssue({
|
|
1431
|
+
code: "custom",
|
|
1432
|
+
path: ["claimIds"],
|
|
1433
|
+
message: "claimIds must contain at least two distinct claims"
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
if (conflict.status !== "open" && !conflict.resolution) {
|
|
1437
|
+
ctx.addIssue({
|
|
1438
|
+
code: "custom",
|
|
1439
|
+
path: ["resolution"],
|
|
1440
|
+
message: "a non-open conflict requires a resolution record"
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
WorkGraphNodeKindSchema = z16.enum([
|
|
1445
|
+
"objective",
|
|
1446
|
+
"requirement",
|
|
1447
|
+
"document",
|
|
1448
|
+
"section",
|
|
1449
|
+
"task",
|
|
1450
|
+
"feature",
|
|
1451
|
+
"component",
|
|
1452
|
+
"module",
|
|
1453
|
+
"acceptance",
|
|
1454
|
+
"symbol",
|
|
1455
|
+
"entity",
|
|
1456
|
+
"event",
|
|
1457
|
+
"action",
|
|
1458
|
+
"mutation",
|
|
1459
|
+
"verification",
|
|
1460
|
+
"blocker",
|
|
1461
|
+
"policy",
|
|
1462
|
+
"artifact",
|
|
1463
|
+
"decision",
|
|
1464
|
+
"claim",
|
|
1465
|
+
"evidence",
|
|
1466
|
+
"conflict",
|
|
1467
|
+
"validation",
|
|
1468
|
+
"actor",
|
|
1469
|
+
"conversation",
|
|
1470
|
+
"relationship"
|
|
1471
|
+
]);
|
|
1472
|
+
WorkGraphNodeStatusSchema = z16.enum([
|
|
1473
|
+
"proposed",
|
|
1474
|
+
"active",
|
|
1475
|
+
"blocked",
|
|
1476
|
+
"complete",
|
|
1477
|
+
"invalid",
|
|
1478
|
+
"superseded"
|
|
1479
|
+
]);
|
|
1480
|
+
WorkGraphTargetRefSchema = z16.discriminatedUnion("type", [
|
|
1481
|
+
z16.object({ type: z16.literal("node"), nodeId: OperationalWorldIdSchema }).strict(),
|
|
1482
|
+
z16.object({ type: z16.literal("claim"), claimId: OperationalWorldIdSchema }).strict(),
|
|
1483
|
+
z16.object({
|
|
1484
|
+
type: z16.literal("conflict"),
|
|
1485
|
+
conflictId: OperationalWorldIdSchema
|
|
1486
|
+
}).strict(),
|
|
1487
|
+
z16.object({
|
|
1488
|
+
type: z16.literal("evidence"),
|
|
1489
|
+
evidenceId: OperationalWorldIdSchema
|
|
1490
|
+
}).strict(),
|
|
1491
|
+
z16.object({ type: z16.literal("source"), bindingId: OperationalWorldIdSchema }).strict(),
|
|
1492
|
+
z16.object({
|
|
1493
|
+
type: z16.literal("artifact"),
|
|
1494
|
+
uri: z16.string().trim().min(1).max(4096),
|
|
1495
|
+
revision: OperationalWorldRevisionSchema.optional()
|
|
1496
|
+
}).strict()
|
|
1497
|
+
]);
|
|
1498
|
+
WorkActionPreconditionSchema = z16.object({
|
|
1499
|
+
preconditionId: OperationalWorldIdSchema,
|
|
1500
|
+
description: z16.string().trim().min(1).max(2e3),
|
|
1501
|
+
status: z16.enum(["unknown", "satisfied", "unsatisfied", "waived"]),
|
|
1502
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).max(256)
|
|
1503
|
+
}).strict();
|
|
1504
|
+
WorkActionMutationSchema = z16.object({
|
|
1505
|
+
mutationId: OperationalWorldIdSchema,
|
|
1506
|
+
kind: z16.enum(["create", "update", "delete", "execute", "deliver"]),
|
|
1507
|
+
target: WorkGraphTargetRefSchema,
|
|
1508
|
+
description: z16.string().trim().min(1).max(2e3),
|
|
1509
|
+
reversible: z16.boolean()
|
|
1510
|
+
}).strict();
|
|
1511
|
+
WorkActionApprovalSchema = z16.object({
|
|
1512
|
+
required: z16.boolean(),
|
|
1513
|
+
status: z16.enum(["not_required", "pending", "approved", "rejected"]),
|
|
1514
|
+
approvedBy: z16.string().trim().min(1).max(256).optional(),
|
|
1515
|
+
approvedAt: z16.string().datetime().optional()
|
|
1516
|
+
}).strict().superRefine((approval, ctx) => {
|
|
1517
|
+
if (!approval.required && approval.status !== "not_required") {
|
|
1518
|
+
ctx.addIssue({
|
|
1519
|
+
code: "custom",
|
|
1520
|
+
path: ["status"],
|
|
1521
|
+
message: "approval status must be not_required when approval is not required"
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
if (approval.required && approval.status === "not_required") {
|
|
1525
|
+
ctx.addIssue({
|
|
1526
|
+
code: "custom",
|
|
1527
|
+
path: ["status"],
|
|
1528
|
+
message: "required approval cannot have not_required status"
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
if (approval.status === "approved" && (!approval.approvedBy || !approval.approvedAt)) {
|
|
1532
|
+
ctx.addIssue({
|
|
1533
|
+
code: "custom",
|
|
1534
|
+
path: ["approvedBy"],
|
|
1535
|
+
message: "approved actions require approvedBy and approvedAt"
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
WorkActionContractSchema = z16.object({
|
|
1540
|
+
preconditions: z16.array(WorkActionPreconditionSchema).max(256),
|
|
1541
|
+
mutations: z16.array(WorkActionMutationSchema).max(256),
|
|
1542
|
+
sideEffects: z16.array(z16.string().trim().min(1).max(2e3)).max(256),
|
|
1543
|
+
approval: WorkActionApprovalSchema,
|
|
1544
|
+
authority: z16.enum([
|
|
1545
|
+
"operator_explicit",
|
|
1546
|
+
"delegated_scope",
|
|
1547
|
+
"policy",
|
|
1548
|
+
"none"
|
|
1549
|
+
]),
|
|
1550
|
+
risk: z16.enum(["none", "low", "medium", "high", "critical"])
|
|
1551
|
+
}).strict();
|
|
1552
|
+
WorkGraphNodeReferenceSchema = z16.discriminatedUnion("type", [
|
|
1553
|
+
z16.object({ type: z16.literal("claim"), claimId: OperationalWorldIdSchema }).strict(),
|
|
1554
|
+
z16.object({
|
|
1555
|
+
type: z16.literal("conflict"),
|
|
1556
|
+
conflictId: OperationalWorldIdSchema
|
|
1557
|
+
}).strict(),
|
|
1558
|
+
z16.object({
|
|
1559
|
+
type: z16.literal("evidence"),
|
|
1560
|
+
evidenceId: OperationalWorldIdSchema
|
|
1561
|
+
}).strict(),
|
|
1562
|
+
z16.object({ type: z16.literal("source"), bindingId: OperationalWorldIdSchema }).strict()
|
|
1563
|
+
]);
|
|
1564
|
+
WorkGraphNodeSchema = z16.object({
|
|
1565
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1566
|
+
nodeId: OperationalWorldIdSchema,
|
|
1567
|
+
kind: WorkGraphNodeKindSchema,
|
|
1568
|
+
label: z16.string().trim().min(1).max(1e3),
|
|
1569
|
+
description: z16.string().trim().max(4e3).optional(),
|
|
1570
|
+
status: WorkGraphNodeStatusSchema,
|
|
1571
|
+
authority: WorkGraphNodeAuthoritySchema,
|
|
1572
|
+
parentNodeId: OperationalWorldIdSchema.optional(),
|
|
1573
|
+
bindingIds: z16.array(OperationalWorldIdSchema).min(1).max(256),
|
|
1574
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).min(1).max(256),
|
|
1575
|
+
confidence: ConfidenceSchema,
|
|
1576
|
+
revision: OperationalWorldRevisionSchema,
|
|
1577
|
+
validFrom: z16.string().datetime(),
|
|
1578
|
+
validTo: z16.string().datetime().optional(),
|
|
1579
|
+
scope: OperationalFactScopeSchema,
|
|
1580
|
+
taskEpoch: z16.number().int().nonnegative().optional(),
|
|
1581
|
+
metadataProvenance: OperationalMetadataProvenanceSchema,
|
|
1582
|
+
reference: WorkGraphNodeReferenceSchema.optional(),
|
|
1583
|
+
actionContract: WorkActionContractSchema.optional(),
|
|
1584
|
+
attributes: z16.record(z16.string(), JsonValueSchema)
|
|
1585
|
+
}).strict().superRefine((node, ctx) => {
|
|
1586
|
+
const expectedReference = node.kind === "claim" ? "claim" : node.kind === "conflict" ? "conflict" : node.kind === "evidence" ? "evidence" : null;
|
|
1587
|
+
if (expectedReference && node.reference?.type !== expectedReference) {
|
|
1588
|
+
ctx.addIssue({
|
|
1589
|
+
code: "custom",
|
|
1590
|
+
path: ["reference"],
|
|
1591
|
+
message: `${node.kind} nodes require a matching ${expectedReference} reference`
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
if (node.parentNodeId === node.nodeId) {
|
|
1595
|
+
ctx.addIssue({
|
|
1596
|
+
code: "custom",
|
|
1597
|
+
path: ["parentNodeId"],
|
|
1598
|
+
message: "a node cannot be its own parent"
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
if ((node.kind === "action" || node.kind === "mutation") && !node.actionContract) {
|
|
1602
|
+
ctx.addIssue({
|
|
1603
|
+
code: "custom",
|
|
1604
|
+
path: ["actionContract"],
|
|
1605
|
+
message: `${node.kind} nodes require an action contract`
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
if (node.validFrom && node.validTo && Date.parse(node.validTo) < Date.parse(node.validFrom)) {
|
|
1609
|
+
ctx.addIssue({
|
|
1610
|
+
code: "custom",
|
|
1611
|
+
path: ["validTo"],
|
|
1612
|
+
message: "validTo must not precede validFrom"
|
|
1613
|
+
});
|
|
1614
|
+
}
|
|
1615
|
+
if (node.scope?.taskEpoch !== void 0 && node.taskEpoch !== void 0 && node.scope.taskEpoch !== node.taskEpoch) {
|
|
1616
|
+
ctx.addIssue({
|
|
1617
|
+
code: "custom",
|
|
1618
|
+
path: ["taskEpoch"],
|
|
1619
|
+
message: "taskEpoch must match scope.taskEpoch"
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
WorkGraphEdgeKindSchema = z16.enum([
|
|
1624
|
+
"contains",
|
|
1625
|
+
"part_of",
|
|
1626
|
+
"decomposes_to",
|
|
1627
|
+
"depends_on",
|
|
1628
|
+
"satisfies",
|
|
1629
|
+
"produces",
|
|
1630
|
+
"supports",
|
|
1631
|
+
"refutes",
|
|
1632
|
+
"evidences",
|
|
1633
|
+
"verified_by",
|
|
1634
|
+
"evidenced_by",
|
|
1635
|
+
"contradicted_by",
|
|
1636
|
+
"blocked_by",
|
|
1637
|
+
"derived_from",
|
|
1638
|
+
"implements",
|
|
1639
|
+
"modifies",
|
|
1640
|
+
"validates",
|
|
1641
|
+
"conflicts_with",
|
|
1642
|
+
"supersedes",
|
|
1643
|
+
"mentions",
|
|
1644
|
+
"governs",
|
|
1645
|
+
"blocks",
|
|
1646
|
+
"assigned_to",
|
|
1647
|
+
"attempts",
|
|
1648
|
+
"invalidates",
|
|
1649
|
+
"resolves",
|
|
1650
|
+
"synthesizes",
|
|
1651
|
+
"replied_to",
|
|
1652
|
+
"reacted_to",
|
|
1653
|
+
"delivered_to",
|
|
1654
|
+
"owned_by",
|
|
1655
|
+
"relates_to"
|
|
1656
|
+
]);
|
|
1657
|
+
WorkGraphEdgeSchema = z16.object({
|
|
1658
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1659
|
+
edgeId: OperationalWorldIdSchema,
|
|
1660
|
+
sourceNodeId: OperationalWorldIdSchema,
|
|
1661
|
+
targetNodeId: OperationalWorldIdSchema,
|
|
1662
|
+
kind: WorkGraphEdgeKindSchema,
|
|
1663
|
+
directed: z16.boolean(),
|
|
1664
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).min(1).max(256),
|
|
1665
|
+
confidence: ConfidenceSchema,
|
|
1666
|
+
revision: OperationalWorldRevisionSchema,
|
|
1667
|
+
validFrom: z16.string().datetime(),
|
|
1668
|
+
validTo: z16.string().datetime().optional(),
|
|
1669
|
+
scope: OperationalFactScopeSchema,
|
|
1670
|
+
taskEpoch: z16.number().int().nonnegative().optional(),
|
|
1671
|
+
metadataProvenance: OperationalMetadataProvenanceSchema,
|
|
1672
|
+
attributes: z16.record(z16.string(), JsonValueSchema)
|
|
1673
|
+
}).strict().superRefine((edge, ctx) => {
|
|
1674
|
+
if (edge.sourceNodeId === edge.targetNodeId) {
|
|
1675
|
+
ctx.addIssue({
|
|
1676
|
+
code: "custom",
|
|
1677
|
+
path: ["targetNodeId"],
|
|
1678
|
+
message: "self-referential edges are not permitted"
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
if (edge.validFrom && edge.validTo && Date.parse(edge.validTo) < Date.parse(edge.validFrom)) {
|
|
1682
|
+
ctx.addIssue({
|
|
1683
|
+
code: "custom",
|
|
1684
|
+
path: ["validTo"],
|
|
1685
|
+
message: "validTo must not precede validFrom"
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
if (edge.scope?.taskEpoch !== void 0 && edge.taskEpoch !== void 0 && edge.scope.taskEpoch !== edge.taskEpoch) {
|
|
1689
|
+
ctx.addIssue({
|
|
1690
|
+
code: "custom",
|
|
1691
|
+
path: ["taskEpoch"],
|
|
1692
|
+
message: "taskEpoch must match scope.taskEpoch"
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
WorkGraphSchema = z16.object({
|
|
1697
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1698
|
+
graphId: OperationalWorldIdSchema,
|
|
1699
|
+
revision: OperationalWorldRevisionSchema,
|
|
1700
|
+
previousRevision: OperationalWorldRevisionSchema.optional(),
|
|
1701
|
+
title: z16.string().trim().min(1).max(1e3),
|
|
1702
|
+
nodes: z16.array(WorkGraphNodeSchema).max(1e5),
|
|
1703
|
+
edges: z16.array(WorkGraphEdgeSchema).max(25e4),
|
|
1704
|
+
sourceBindings: z16.array(SourceBindingSchema).max(1e5),
|
|
1705
|
+
evidenceRefs: z16.array(EvidenceRefSchema).max(25e4),
|
|
1706
|
+
claims: z16.array(ClaimSchema).max(1e5),
|
|
1707
|
+
conflicts: z16.array(ConflictSchema).max(1e5),
|
|
1708
|
+
createdAt: z16.string().datetime(),
|
|
1709
|
+
updatedAt: z16.string().datetime()
|
|
1710
|
+
}).strict().superRefine(validateGraphCollections);
|
|
1711
|
+
WorldPatchOperationSchema = z16.discriminatedUnion("op", [
|
|
1712
|
+
z16.object({ op: z16.literal("upsert_node"), node: WorkGraphNodeSchema }).strict(),
|
|
1713
|
+
z16.object({
|
|
1714
|
+
op: z16.literal("remove_node"),
|
|
1715
|
+
nodeId: OperationalWorldIdSchema,
|
|
1716
|
+
cascade: z16.boolean()
|
|
1717
|
+
}).strict(),
|
|
1718
|
+
z16.object({ op: z16.literal("upsert_edge"), edge: WorkGraphEdgeSchema }).strict(),
|
|
1719
|
+
z16.object({ op: z16.literal("remove_edge"), edgeId: OperationalWorldIdSchema }).strict(),
|
|
1720
|
+
z16.object({
|
|
1721
|
+
op: z16.literal("upsert_source_binding"),
|
|
1722
|
+
sourceBinding: SourceBindingSchema
|
|
1723
|
+
}).strict(),
|
|
1724
|
+
z16.object({
|
|
1725
|
+
op: z16.literal("remove_source_binding"),
|
|
1726
|
+
bindingId: OperationalWorldIdSchema
|
|
1727
|
+
}).strict(),
|
|
1728
|
+
z16.object({
|
|
1729
|
+
op: z16.literal("upsert_evidence_ref"),
|
|
1730
|
+
evidenceRef: EvidenceRefSchema
|
|
1731
|
+
}).strict(),
|
|
1732
|
+
z16.object({
|
|
1733
|
+
op: z16.literal("remove_evidence_ref"),
|
|
1734
|
+
evidenceId: OperationalWorldIdSchema
|
|
1735
|
+
}).strict(),
|
|
1736
|
+
z16.object({ op: z16.literal("upsert_claim"), claim: ClaimSchema }).strict(),
|
|
1737
|
+
z16.object({
|
|
1738
|
+
op: z16.literal("remove_claim"),
|
|
1739
|
+
claimId: OperationalWorldIdSchema
|
|
1740
|
+
}).strict(),
|
|
1741
|
+
z16.object({ op: z16.literal("upsert_conflict"), conflict: ConflictSchema }).strict(),
|
|
1742
|
+
z16.object({
|
|
1743
|
+
op: z16.literal("remove_conflict"),
|
|
1744
|
+
conflictId: OperationalWorldIdSchema
|
|
1745
|
+
}).strict()
|
|
1746
|
+
]);
|
|
1747
|
+
WorldPatchSchema = z16.object({
|
|
1748
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1749
|
+
patchId: OperationalWorldIdSchema,
|
|
1750
|
+
graphId: OperationalWorldIdSchema,
|
|
1751
|
+
/** Optimistic-concurrency precondition. */
|
|
1752
|
+
baseRevision: OperationalWorldRevisionSchema,
|
|
1753
|
+
targetRevision: OperationalWorldRevisionSchema,
|
|
1754
|
+
operations: z16.array(WorldPatchOperationSchema).min(1).max(1e4),
|
|
1755
|
+
rationale: z16.string().trim().min(1).max(4e3),
|
|
1756
|
+
createdBy: z16.string().trim().min(1).max(256),
|
|
1757
|
+
createdAt: z16.string().datetime()
|
|
1758
|
+
}).strict().superRefine((patch, ctx) => {
|
|
1759
|
+
if (patch.baseRevision === patch.targetRevision) {
|
|
1760
|
+
ctx.addIssue({
|
|
1761
|
+
code: "custom",
|
|
1762
|
+
path: ["targetRevision"],
|
|
1763
|
+
message: "targetRevision must differ from baseRevision"
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
ValidationIssueSeveritySchema = z16.enum([
|
|
1768
|
+
"info",
|
|
1769
|
+
"warning",
|
|
1770
|
+
"error"
|
|
1771
|
+
]);
|
|
1772
|
+
OperationalValidationIssueSchema = z16.object({
|
|
1773
|
+
code: z16.string().trim().min(1).max(128),
|
|
1774
|
+
severity: ValidationIssueSeveritySchema,
|
|
1775
|
+
message: z16.string().trim().min(1).max(4e3),
|
|
1776
|
+
path: z16.array(z16.union([z16.string(), z16.number().int().nonnegative()])).max(64),
|
|
1777
|
+
nodeId: OperationalWorldIdSchema.optional(),
|
|
1778
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).max(256)
|
|
1779
|
+
}).strict();
|
|
1780
|
+
OperationalValidationStatusSchema = z16.enum([
|
|
1781
|
+
"pass",
|
|
1782
|
+
"fail",
|
|
1783
|
+
"partial"
|
|
1784
|
+
]);
|
|
1785
|
+
OperationalValidationResultSchema = z16.object({
|
|
1786
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1787
|
+
valid: z16.boolean(),
|
|
1788
|
+
status: OperationalValidationStatusSchema,
|
|
1789
|
+
checkedRevision: OperationalWorldRevisionSchema,
|
|
1790
|
+
issues: z16.array(OperationalValidationIssueSchema).max(1e4),
|
|
1791
|
+
checkedAt: z16.string().datetime()
|
|
1792
|
+
}).strict().superRefine((result, ctx) => {
|
|
1793
|
+
const hasErrors = result.issues.some((issue2) => issue2.severity === "error");
|
|
1794
|
+
if (result.valid !== (result.status === "pass")) {
|
|
1795
|
+
ctx.addIssue({
|
|
1796
|
+
code: "custom",
|
|
1797
|
+
path: ["valid"],
|
|
1798
|
+
message: "valid must be true exactly when status is pass"
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
if (result.status === "pass" && hasErrors) {
|
|
1802
|
+
ctx.addIssue({
|
|
1803
|
+
code: "custom",
|
|
1804
|
+
path: ["issues"],
|
|
1805
|
+
message: "a passing result cannot contain error issues"
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
if (result.status === "fail" && !hasErrors) {
|
|
1809
|
+
ctx.addIssue({
|
|
1810
|
+
code: "custom",
|
|
1811
|
+
path: ["issues"],
|
|
1812
|
+
message: "a failing result must contain at least one error issue"
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1816
|
+
ValidationArtifactHashSchema = z16.object({
|
|
1817
|
+
uri: z16.string().trim().min(1).max(4096),
|
|
1818
|
+
algorithm: z16.enum(["sha256", "sha512", "blake3"]),
|
|
1819
|
+
digest: z16.string().trim().min(1).max(512)
|
|
1820
|
+
}).strict();
|
|
1821
|
+
OperationalValidationReceiptSchema = z16.object({
|
|
1822
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1823
|
+
receiptId: OperationalWorldIdSchema,
|
|
1824
|
+
graphId: OperationalWorldIdSchema,
|
|
1825
|
+
patchId: OperationalWorldIdSchema.optional(),
|
|
1826
|
+
baseRevision: OperationalWorldRevisionSchema,
|
|
1827
|
+
resultRevision: OperationalWorldRevisionSchema,
|
|
1828
|
+
validator: z16.object({
|
|
1829
|
+
name: z16.string().trim().min(1).max(256),
|
|
1830
|
+
version: z16.string().trim().min(1).max(128)
|
|
1831
|
+
}).strict(),
|
|
1832
|
+
startedAt: z16.string().datetime(),
|
|
1833
|
+
finishedAt: z16.string().datetime(),
|
|
1834
|
+
result: OperationalValidationResultSchema,
|
|
1835
|
+
evidenceRefIds: z16.array(OperationalWorldIdSchema).max(1e4),
|
|
1836
|
+
artifactHashes: z16.array(ValidationArtifactHashSchema).max(1e4)
|
|
1837
|
+
}).strict().superRefine((receipt, ctx) => {
|
|
1838
|
+
if (receipt.result.checkedRevision !== receipt.resultRevision) {
|
|
1839
|
+
ctx.addIssue({
|
|
1840
|
+
code: "custom",
|
|
1841
|
+
path: ["result", "checkedRevision"],
|
|
1842
|
+
message: "checkedRevision must equal resultRevision"
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
if (Date.parse(receipt.finishedAt) < Date.parse(receipt.startedAt)) {
|
|
1846
|
+
ctx.addIssue({
|
|
1847
|
+
code: "custom",
|
|
1848
|
+
path: ["finishedAt"],
|
|
1849
|
+
message: "finishedAt must not precede startedAt"
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1853
|
+
ReasoningSliceSelectionSchema = z16.object({
|
|
1854
|
+
strategy: z16.enum(["exact", "lexical", "semantic", "graph", "hybrid"]),
|
|
1855
|
+
graphHops: z16.number().int().nonnegative().max(32),
|
|
1856
|
+
maxCharacters: z16.number().int().positive(),
|
|
1857
|
+
truncated: z16.boolean(),
|
|
1858
|
+
omissions: z16.array(z16.string().trim().min(1).max(1e3)).max(256),
|
|
1859
|
+
evidenceRoles: z16.array(EvidenceRoleSchema).max(5)
|
|
1860
|
+
}).strict();
|
|
1861
|
+
ReasoningSliceSchema = z16.object({
|
|
1862
|
+
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
1863
|
+
sliceId: OperationalWorldIdSchema,
|
|
1864
|
+
graphId: OperationalWorldIdSchema,
|
|
1865
|
+
revision: OperationalWorldRevisionSchema,
|
|
1866
|
+
objective: z16.string().trim().min(1).max(4e3),
|
|
1867
|
+
focusNodeIds: z16.array(OperationalWorldIdSchema).min(1).max(256),
|
|
1868
|
+
nodes: z16.array(WorkGraphNodeSchema).max(1e4),
|
|
1869
|
+
edges: z16.array(WorkGraphEdgeSchema).max(25e3),
|
|
1870
|
+
sourceBindings: z16.array(SourceBindingSchema).max(1e4),
|
|
1871
|
+
evidenceRefs: z16.array(EvidenceRefSchema).max(25e3),
|
|
1872
|
+
claims: z16.array(ClaimSchema).max(1e4),
|
|
1873
|
+
conflicts: z16.array(ConflictSchema).max(1e4),
|
|
1874
|
+
selection: ReasoningSliceSelectionSchema,
|
|
1875
|
+
generatedAt: z16.string().datetime()
|
|
1876
|
+
}).strict().superRefine((slice, ctx) => {
|
|
1877
|
+
validateGraphCollections(slice, ctx);
|
|
1878
|
+
const nodeIds = new Set(slice.nodes.map((node) => node.nodeId));
|
|
1879
|
+
slice.focusNodeIds.forEach((nodeId, index) => {
|
|
1880
|
+
if (!nodeIds.has(nodeId)) {
|
|
1881
|
+
ctx.addIssue({
|
|
1882
|
+
code: "custom",
|
|
1883
|
+
path: ["focusNodeIds", index],
|
|
1884
|
+
message: `focus node is absent from the reasoning slice: ${nodeId}`
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
});
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
|
|
1892
|
+
// packages/schemas/dist/operational-world-migration.js
|
|
1893
|
+
var init_operational_world_migration = __esm({
|
|
1894
|
+
"packages/schemas/dist/operational-world-migration.js"() {
|
|
1895
|
+
"use strict";
|
|
1896
|
+
init_operational_world();
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
|
|
1900
|
+
// packages/schemas/dist/index.js
|
|
1901
|
+
var init_dist = __esm({
|
|
1902
|
+
"packages/schemas/dist/index.js"() {
|
|
1903
|
+
"use strict";
|
|
1904
|
+
init_gpu_selection();
|
|
1905
|
+
init_feature_workflow();
|
|
1906
|
+
init_messages();
|
|
1907
|
+
init_tools();
|
|
1908
|
+
init_session();
|
|
1909
|
+
init_task();
|
|
1910
|
+
init_plan();
|
|
1911
|
+
init_patch();
|
|
1912
|
+
init_verification();
|
|
1913
|
+
init_repoProfile();
|
|
1914
|
+
init_retrieval();
|
|
1915
|
+
init_dispatch();
|
|
1916
|
+
init_memory();
|
|
1917
|
+
init_backend();
|
|
1918
|
+
init_config();
|
|
1919
|
+
init_queue();
|
|
1920
|
+
init_operational_world();
|
|
1921
|
+
init_operational_world_migration();
|
|
1922
|
+
}
|
|
1923
|
+
});
|
|
1924
|
+
|
|
1925
|
+
// packages/execution/dist/gpu-selection.js
|
|
1926
|
+
var init_gpu_selection2 = __esm({
|
|
60
1927
|
"packages/execution/dist/gpu-selection.js"() {
|
|
61
1928
|
"use strict";
|
|
1929
|
+
init_dist();
|
|
62
1930
|
}
|
|
63
1931
|
});
|
|
64
1932
|
|
|
@@ -68,7 +1936,7 @@ var init_model_broker = __esm({
|
|
|
68
1936
|
"packages/execution/dist/model-broker.js"() {
|
|
69
1937
|
"use strict";
|
|
70
1938
|
init_jetson_monitor();
|
|
71
|
-
|
|
1939
|
+
init_gpu_selection2();
|
|
72
1940
|
DEFAULT_IDLE_EVICT_MS = 5 * 60 * 1e3;
|
|
73
1941
|
STUCK_INFLIGHT_DIAGNOSTIC_MS = 5 * 60 * 1e3;
|
|
74
1942
|
}
|
|
@@ -1653,7 +3521,7 @@ var init_escape = __esm({
|
|
|
1653
3521
|
});
|
|
1654
3522
|
|
|
1655
3523
|
// node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js
|
|
1656
|
-
var minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform,
|
|
3524
|
+
var minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path2, sep, GLOBSTAR, qmark2, star2, twoStarDot, twoStarNoDot, filter, ext, defaults, braceExpand, makeRe, match, globMagic, regExpEscape2, Minimatch;
|
|
1657
3525
|
var init_esm3 = __esm({
|
|
1658
3526
|
"node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js"() {
|
|
1659
3527
|
init_esm2();
|
|
@@ -1722,11 +3590,11 @@ var init_esm3 = __esm({
|
|
|
1722
3590
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
1723
3591
|
};
|
|
1724
3592
|
defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1725
|
-
|
|
3593
|
+
path2 = {
|
|
1726
3594
|
win32: { sep: "\\" },
|
|
1727
3595
|
posix: { sep: "/" }
|
|
1728
3596
|
};
|
|
1729
|
-
sep = defaultPlatform === "win32" ?
|
|
3597
|
+
sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep;
|
|
1730
3598
|
minimatch.sep = sep;
|
|
1731
3599
|
GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
1732
3600
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -47505,7 +49373,7 @@ var init_cuda_device_filter = __esm({
|
|
|
47505
49373
|
"packages/execution/dist/tools/cuda-device-filter.js"() {
|
|
47506
49374
|
"use strict";
|
|
47507
49375
|
init_process_async();
|
|
47508
|
-
|
|
49376
|
+
init_gpu_selection2();
|
|
47509
49377
|
}
|
|
47510
49378
|
});
|
|
47511
49379
|
|
|
@@ -47853,6 +49721,7 @@ var init_memoryGraph = __esm({
|
|
|
47853
49721
|
var init_embeddings = __esm({
|
|
47854
49722
|
"packages/memory/dist/embeddings.js"() {
|
|
47855
49723
|
"use strict";
|
|
49724
|
+
init_dist();
|
|
47856
49725
|
}
|
|
47857
49726
|
});
|
|
47858
49727
|
|
|
@@ -48074,7 +49943,7 @@ var init_embeddingAligner = __esm({
|
|
|
48074
49943
|
});
|
|
48075
49944
|
|
|
48076
49945
|
// packages/memory/dist/crl/memory.js
|
|
48077
|
-
var
|
|
49946
|
+
var init_memory2 = __esm({
|
|
48078
49947
|
"packages/memory/dist/crl/memory.js"() {
|
|
48079
49948
|
"use strict";
|
|
48080
49949
|
init_episodeStore();
|
|
@@ -48083,7 +49952,7 @@ var init_memory = __esm({
|
|
|
48083
49952
|
});
|
|
48084
49953
|
|
|
48085
49954
|
// packages/memory/dist/crl/config.js
|
|
48086
|
-
var
|
|
49955
|
+
var init_config2 = __esm({
|
|
48087
49956
|
"packages/memory/dist/crl/config.js"() {
|
|
48088
49957
|
"use strict";
|
|
48089
49958
|
}
|
|
@@ -48103,8 +49972,8 @@ var CRL_SYMBOLS, SYMBOL_MEANINGS, CRLParser, CRLEncoder, CRLDecoder, CRLTemplate
|
|
|
48103
49972
|
var init_crl = __esm({
|
|
48104
49973
|
"packages/memory/dist/crl/index.js"() {
|
|
48105
49974
|
"use strict";
|
|
48106
|
-
|
|
48107
|
-
|
|
49975
|
+
init_memory2();
|
|
49976
|
+
init_config2();
|
|
48108
49977
|
init_converter();
|
|
48109
49978
|
CRL_SYMBOLS = {
|
|
48110
49979
|
// Logical operators (Core)
|
|
@@ -49101,7 +50970,7 @@ var init_evidence_retirement = __esm({
|
|
|
49101
50970
|
});
|
|
49102
50971
|
|
|
49103
50972
|
// packages/memory/dist/index.js
|
|
49104
|
-
var
|
|
50973
|
+
var init_dist2 = __esm({
|
|
49105
50974
|
"packages/memory/dist/index.js"() {
|
|
49106
50975
|
"use strict";
|
|
49107
50976
|
init_db();
|
|
@@ -49175,7 +51044,7 @@ var init_dist = __esm({
|
|
|
49175
51044
|
var init_memory_read = __esm({
|
|
49176
51045
|
"packages/execution/dist/tools/memory-read.js"() {
|
|
49177
51046
|
"use strict";
|
|
49178
|
-
|
|
51047
|
+
init_dist2();
|
|
49179
51048
|
}
|
|
49180
51049
|
});
|
|
49181
51050
|
|
|
@@ -49183,7 +51052,7 @@ var init_memory_read = __esm({
|
|
|
49183
51052
|
var init_memory_write = __esm({
|
|
49184
51053
|
"packages/execution/dist/tools/memory-write.js"() {
|
|
49185
51054
|
"use strict";
|
|
49186
|
-
|
|
51055
|
+
init_dist2();
|
|
49187
51056
|
}
|
|
49188
51057
|
});
|
|
49189
51058
|
|
|
@@ -49192,7 +51061,7 @@ var DEFAULT_INLINE_KG_MAX_BYTES, DEFAULT_INLINE_EPISODES_MAX_BYTES;
|
|
|
49192
51061
|
var init_memory_search = __esm({
|
|
49193
51062
|
"packages/execution/dist/tools/memory-search.js"() {
|
|
49194
51063
|
"use strict";
|
|
49195
|
-
|
|
51064
|
+
init_dist2();
|
|
49196
51065
|
DEFAULT_INLINE_KG_MAX_BYTES = 512 * 1024 * 1024;
|
|
49197
51066
|
DEFAULT_INLINE_EPISODES_MAX_BYTES = 1024 * 1024 * 1024;
|
|
49198
51067
|
}
|
|
@@ -49202,7 +51071,7 @@ var init_memory_search = __esm({
|
|
|
49202
51071
|
var init_memory_ops = __esm({
|
|
49203
51072
|
"packages/execution/dist/tools/memory-ops.js"() {
|
|
49204
51073
|
"use strict";
|
|
49205
|
-
|
|
51074
|
+
init_dist2();
|
|
49206
51075
|
}
|
|
49207
51076
|
});
|
|
49208
51077
|
|
|
@@ -51922,7 +53791,7 @@ var init_pdf_transform = __esm({
|
|
|
51922
53791
|
var init_source_corpus_ocr = __esm({
|
|
51923
53792
|
"packages/execution/dist/tools/source-corpus-ocr.js"() {
|
|
51924
53793
|
"use strict";
|
|
51925
|
-
|
|
53794
|
+
init_dist2();
|
|
51926
53795
|
init_pdf_corpus_archive();
|
|
51927
53796
|
}
|
|
51928
53797
|
});
|
|
@@ -51940,7 +53809,7 @@ var SEGMENT_CHARS, RECORD_BYTES, ACTIONS, SOURCE_CORPUS_TOOL_DEFINITION;
|
|
|
51940
53809
|
var init_source_corpus = __esm({
|
|
51941
53810
|
"packages/execution/dist/tools/source-corpus.js"() {
|
|
51942
53811
|
"use strict";
|
|
51943
|
-
|
|
53812
|
+
init_dist2();
|
|
51944
53813
|
init_pdf_corpus_archive();
|
|
51945
53814
|
init_source_corpus_ocr();
|
|
51946
53815
|
init_corpus_directory_manifest();
|
|
@@ -51987,7 +53856,7 @@ var init_corpus_population = __esm({
|
|
|
51987
53856
|
var init_source_corpus_workspace = __esm({
|
|
51988
53857
|
"packages/execution/dist/tools/source-corpus-workspace.js"() {
|
|
51989
53858
|
"use strict";
|
|
51990
|
-
|
|
53859
|
+
init_dist2();
|
|
51991
53860
|
init_source_corpus();
|
|
51992
53861
|
init_corpus_population();
|
|
51993
53862
|
}
|
|
@@ -52005,7 +53874,7 @@ var ACTIONS2, CORPUS_WORK_TOOL_DEFINITION;
|
|
|
52005
53874
|
var init_corpus_work = __esm({
|
|
52006
53875
|
"packages/execution/dist/tools/corpus-work.js"() {
|
|
52007
53876
|
"use strict";
|
|
52008
|
-
|
|
53877
|
+
init_dist2();
|
|
52009
53878
|
init_pdf_corpus_archive();
|
|
52010
53879
|
init_corpus_derived_order();
|
|
52011
53880
|
ACTIONS2 = ["begin", "next", "read", "commit", "status", "complete", "cancel", "export", "aggregate", "order"];
|
|
@@ -296425,7 +298294,7 @@ var init_community_detection = __esm({
|
|
|
296425
298294
|
});
|
|
296426
298295
|
|
|
296427
298296
|
// packages/indexer/dist/index.js
|
|
296428
|
-
var
|
|
298297
|
+
var init_dist3 = __esm({
|
|
296429
298298
|
"packages/indexer/dist/index.js"() {
|
|
296430
298299
|
"use strict";
|
|
296431
298300
|
init_codebase_indexer();
|
|
@@ -296483,7 +298352,7 @@ var init_code_graph_events = __esm({
|
|
|
296483
298352
|
var init_code_graph_client = __esm({
|
|
296484
298353
|
"packages/execution/dist/tools/code-graph-client.js"() {
|
|
296485
298354
|
"use strict";
|
|
296486
|
-
|
|
298355
|
+
init_dist3();
|
|
296487
298356
|
init_code_graph_events();
|
|
296488
298357
|
}
|
|
296489
298358
|
});
|
|
@@ -297458,13 +299327,13 @@ var init_harness_plan = __esm({
|
|
|
297458
299327
|
});
|
|
297459
299328
|
|
|
297460
299329
|
// packages/execution/dist/index.js
|
|
297461
|
-
var
|
|
299330
|
+
var init_dist4 = __esm({
|
|
297462
299331
|
"packages/execution/dist/index.js"() {
|
|
297463
299332
|
"use strict";
|
|
297464
299333
|
init_feature_workflow_child();
|
|
297465
299334
|
init_tool_executor();
|
|
297466
299335
|
init_model_broker();
|
|
297467
|
-
|
|
299336
|
+
init_gpu_selection2();
|
|
297468
299337
|
init_jetson_monitor();
|
|
297469
299338
|
init_audio_classifier_runtime();
|
|
297470
299339
|
init_audio_input_conditioning();
|
|
@@ -297677,7 +299546,7 @@ var DEFAULT_MIN_GPU_VRAM_MB;
|
|
|
297677
299546
|
var init_ollama_pool = __esm({
|
|
297678
299547
|
"packages/orchestrator/dist/ollama-pool.js"() {
|
|
297679
299548
|
"use strict";
|
|
297680
|
-
|
|
299549
|
+
init_dist4();
|
|
297681
299550
|
DEFAULT_MIN_GPU_VRAM_MB = 16 * 1024;
|
|
297682
299551
|
}
|
|
297683
299552
|
});
|
|
@@ -299021,8 +300890,8 @@ var PROVIDER_PRESETS = [
|
|
|
299021
300890
|
];
|
|
299022
300891
|
|
|
299023
300892
|
// packages/orchestrator/dist/agent-loop.js
|
|
299024
|
-
|
|
299025
|
-
|
|
300893
|
+
init_dist4();
|
|
300894
|
+
init_dist4();
|
|
299026
300895
|
|
|
299027
300896
|
// packages/orchestrator/dist/plugins/types.js
|
|
299028
300897
|
var PluginHook;
|
|
@@ -299036,1750 +300905,22 @@ var PluginHook;
|
|
|
299036
300905
|
})(PluginHook || (PluginHook = {}));
|
|
299037
300906
|
|
|
299038
300907
|
// packages/orchestrator/dist/plugins/manifest.js
|
|
299039
|
-
import { z } from "zod";
|
|
299040
|
-
var hookSchema = z.nativeEnum(PluginHook);
|
|
299041
|
-
var manifestSchema = z.object({
|
|
299042
|
-
name: z.string().min(1, "Plugin name is required").regex(/^[a-z0-9_-]+$/, "Plugin name must be lowercase alphanumeric with hyphens/underscores"),
|
|
299043
|
-
version: z.string().min(1, "Plugin version is required"),
|
|
299044
|
-
description: z.string().default(""),
|
|
299045
|
-
author: z.string().default(""),
|
|
299046
|
-
hooks: z.array(hookSchema).default([]),
|
|
299047
|
-
dependencies: z.array(z.string()).default([]),
|
|
299048
|
-
source: z.enum(["user", "project", "npm"]),
|
|
299049
|
-
path: z.string().optional()
|
|
299050
|
-
});
|
|
299051
|
-
|
|
299052
|
-
// packages/schemas/dist/feature-workflow.js
|
|
299053
|
-
import { z as z2 } from "zod";
|
|
299054
|
-
var FEATURE_WORKFLOW_PLAN_SCHEMA = "omnius.feature-workflow-plan.v1";
|
|
299055
|
-
var FEATURE_WORKFLOW_PHASES = [
|
|
299056
|
-
"research",
|
|
299057
|
-
"specification",
|
|
299058
|
-
"implementation",
|
|
299059
|
-
"integration",
|
|
299060
|
-
"acceptance",
|
|
299061
|
-
"handoff"
|
|
299062
|
-
];
|
|
299063
|
-
var FeatureWorkflowPhaseSchema = z2.enum(FEATURE_WORKFLOW_PHASES);
|
|
299064
|
-
var id = z2.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}$/);
|
|
299065
|
-
var text = z2.string().trim().min(1).max(4e3);
|
|
299066
|
-
var FeatureWorkflowArtifactReferenceSchema = z2.string().regex(/^omnius-artifact:\/\/sha256\/[a-f0-9]{64}$/);
|
|
299067
|
-
var path2 = z2.string().trim().min(1).max(1e3);
|
|
299068
|
-
var FeatureWorkflowCardSchema = z2.object({
|
|
299069
|
-
id,
|
|
299070
|
-
title: text,
|
|
299071
|
-
phase: FeatureWorkflowPhaseSchema,
|
|
299072
|
-
role: z2.enum([
|
|
299073
|
-
"researcher",
|
|
299074
|
-
"author",
|
|
299075
|
-
"reviewer",
|
|
299076
|
-
"implementer",
|
|
299077
|
-
"integrator",
|
|
299078
|
-
"verifier",
|
|
299079
|
-
"synthesizer"
|
|
299080
|
-
]),
|
|
299081
|
-
dependsOn: z2.array(id).max(128).default([]),
|
|
299082
|
-
sourceIds: z2.array(id).max(256).default([]),
|
|
299083
|
-
inputSlots: z2.array(id).max(256).default([]),
|
|
299084
|
-
reviewSlots: z2.array(id).max(32).default([]),
|
|
299085
|
-
ownedFiles: z2.array(path2).max(128).default([]),
|
|
299086
|
-
acceptanceIds: z2.array(id).max(256).default([]),
|
|
299087
|
-
verifier: z2.object({
|
|
299088
|
-
command: z2.string().trim().min(1).max(4e3),
|
|
299089
|
-
cwd: path2.optional(),
|
|
299090
|
-
targetPaths: z2.array(path2).min(1).max(128)
|
|
299091
|
-
}).strict().optional()
|
|
299092
|
-
}).strict();
|
|
299093
|
-
var FeatureWorkflowPlanSchema = z2.object({
|
|
299094
|
-
schema: z2.literal(FEATURE_WORKFLOW_PLAN_SCHEMA),
|
|
299095
|
-
id,
|
|
299096
|
-
revision: z2.number().int().min(1).max(Number.MAX_SAFE_INTEGER),
|
|
299097
|
-
objective: text,
|
|
299098
|
-
requirements: z2.array(z2.object({ id, description: text }).strict()).min(1).max(256),
|
|
299099
|
-
sources: z2.array(z2.object({ id, reference: FeatureWorkflowArtifactReferenceSchema }).strict()).max(256).default([]),
|
|
299100
|
-
slots: z2.array(z2.object({
|
|
299101
|
-
id,
|
|
299102
|
-
kind: z2.enum([
|
|
299103
|
-
"research",
|
|
299104
|
-
"specification",
|
|
299105
|
-
"implementation",
|
|
299106
|
-
"integration",
|
|
299107
|
-
"review",
|
|
299108
|
-
"handoff"
|
|
299109
|
-
]),
|
|
299110
|
-
cardId: id,
|
|
299111
|
-
requiresReview: z2.boolean().default(false)
|
|
299112
|
-
}).strict()).min(4).max(256),
|
|
299113
|
-
cards: z2.array(FeatureWorkflowCardSchema).min(6).max(128)
|
|
299114
|
-
}).strict().superRefine((plan, ctx) => {
|
|
299115
|
-
const fail = (message) => ctx.addIssue({ code: "custom", message });
|
|
299116
|
-
const unique = (values, label) => {
|
|
299117
|
-
if (new Set(values).size !== values.length)
|
|
299118
|
-
fail(`duplicate ${label}`);
|
|
299119
|
-
};
|
|
299120
|
-
unique(plan.cards.map((c) => c.id), "card id");
|
|
299121
|
-
unique(plan.slots.map((s) => s.id), "slot id");
|
|
299122
|
-
unique(plan.sources.map((s) => s.id), "source id");
|
|
299123
|
-
unique(plan.requirements.map((r) => r.id), "requirement id");
|
|
299124
|
-
const cards = new Map(plan.cards.map((c) => [c.id, c]));
|
|
299125
|
-
const slots = new Map(plan.slots.map((s) => [s.id, s]));
|
|
299126
|
-
const sources = new Set(plan.sources.map((s) => s.id));
|
|
299127
|
-
const assertions = new Map(plan.requirements.map((r) => [r.id, 0]));
|
|
299128
|
-
for (const phase of FEATURE_WORKFLOW_PHASES)
|
|
299129
|
-
if (!plan.cards.some((c) => c.phase === phase))
|
|
299130
|
-
fail(`missing phase ${phase}`);
|
|
299131
|
-
for (const slot of plan.slots) {
|
|
299132
|
-
if (slot.id.startsWith("source:"))
|
|
299133
|
-
fail(`reserved source namespace ${slot.id}`);
|
|
299134
|
-
const producer = cards.get(slot.cardId);
|
|
299135
|
-
if (!producer)
|
|
299136
|
-
fail(`unknown producer ${slot.cardId}`);
|
|
299137
|
-
if (slot.requiresReview && !plan.cards.some((c) => c.role === "reviewer" && c.reviewSlots.includes(slot.id)))
|
|
299138
|
-
fail(`missing independent review for ${slot.id}`);
|
|
299139
|
-
if (slot.requiresReview && producer && plan.cards.some((c) => c.reviewSlots.includes(slot.id) && c.phase !== producer.phase))
|
|
299140
|
-
fail(`review must occur in producer phase ${slot.id}`);
|
|
299141
|
-
}
|
|
299142
|
-
for (const kind of [
|
|
299143
|
-
"research",
|
|
299144
|
-
"specification",
|
|
299145
|
-
"integration",
|
|
299146
|
-
"handoff"
|
|
299147
|
-
]) {
|
|
299148
|
-
if (!plan.slots.some((s) => s.kind === kind && cards.get(s.cardId)?.phase === kind))
|
|
299149
|
-
fail(`missing ${kind} artifact`);
|
|
299150
|
-
}
|
|
299151
|
-
if (!plan.slots.some((s) => s.kind === "specification" && s.requiresReview))
|
|
299152
|
-
fail("specification requires independent review");
|
|
299153
|
-
for (const card of plan.cards) {
|
|
299154
|
-
if (card.role !== "reviewer" && card.role !== "verifier" && !plan.slots.some((slot) => slot.cardId === card.id))
|
|
299155
|
-
fail(`work card requires an artifact slot ${card.id}`);
|
|
299156
|
-
for (const [label, values] of Object.entries({
|
|
299157
|
-
dependency: card.dependsOn,
|
|
299158
|
-
source: card.sourceIds,
|
|
299159
|
-
input: card.inputSlots,
|
|
299160
|
-
review: card.reviewSlots,
|
|
299161
|
-
acceptance: card.acceptanceIds
|
|
299162
|
-
}))
|
|
299163
|
-
unique(values, `${label} in ${card.id}`);
|
|
299164
|
-
for (const dep of card.dependsOn)
|
|
299165
|
-
if (!cards.has(dep))
|
|
299166
|
-
fail(`unknown dependency ${dep}`);
|
|
299167
|
-
for (const source of card.sourceIds)
|
|
299168
|
-
if (!sources.has(source))
|
|
299169
|
-
fail(`unknown source ${source}`);
|
|
299170
|
-
for (const slotId of [...card.inputSlots, ...card.reviewSlots]) {
|
|
299171
|
-
const slot = slots.get(slotId);
|
|
299172
|
-
if (!slot) {
|
|
299173
|
-
fail(`unknown slot ${slotId}`);
|
|
299174
|
-
continue;
|
|
299175
|
-
}
|
|
299176
|
-
const producer = cards.get(slot.cardId);
|
|
299177
|
-
if (slot.cardId === card.id)
|
|
299178
|
-
fail(`self-dependent slot ${slotId}`);
|
|
299179
|
-
if (producer && FEATURE_WORKFLOW_PHASES.indexOf(producer.phase) > FEATURE_WORKFLOW_PHASES.indexOf(card.phase))
|
|
299180
|
-
fail(`future slot ${slotId}`);
|
|
299181
|
-
}
|
|
299182
|
-
for (const dep of card.dependsOn) {
|
|
299183
|
-
const source = cards.get(dep);
|
|
299184
|
-
if (source && FEATURE_WORKFLOW_PHASES.indexOf(source.phase) > FEATURE_WORKFLOW_PHASES.indexOf(card.phase))
|
|
299185
|
-
fail(`future dependency ${dep}`);
|
|
299186
|
-
}
|
|
299187
|
-
if (card.role === "reviewer" !== card.reviewSlots.length > 0)
|
|
299188
|
-
fail(`review role/slots mismatch ${card.id}`);
|
|
299189
|
-
if (card.phase === "acceptance" && (card.role !== "verifier" || !card.verifier || card.acceptanceIds.length === 0))
|
|
299190
|
-
fail(`acceptance needs explicit verifier ${card.id}`);
|
|
299191
|
-
if (card.phase !== "acceptance" && (card.verifier || card.acceptanceIds.length))
|
|
299192
|
-
fail(`acceptance authority outside acceptance phase ${card.id}`);
|
|
299193
|
-
if (card.phase === "implementation" && card.role !== "reviewer" && (card.role !== "implementer" || card.ownedFiles.length === 0))
|
|
299194
|
-
fail(`implementation needs owned files ${card.id}`);
|
|
299195
|
-
for (const assertion of card.acceptanceIds) {
|
|
299196
|
-
if (!assertions.has(assertion))
|
|
299197
|
-
fail(`unknown acceptance ${assertion}`);
|
|
299198
|
-
else
|
|
299199
|
-
assertions.set(assertion, assertions.get(assertion) + 1);
|
|
299200
|
-
}
|
|
299201
|
-
}
|
|
299202
|
-
for (const [assertion, count] of assertions)
|
|
299203
|
-
if (count !== 1)
|
|
299204
|
-
fail(`acceptance ${assertion} must have exactly one owner`);
|
|
299205
|
-
const visiting = /* @__PURE__ */ new Set();
|
|
299206
|
-
const visited = /* @__PURE__ */ new Set();
|
|
299207
|
-
const visit = (cardId) => {
|
|
299208
|
-
if (visiting.has(cardId)) {
|
|
299209
|
-
fail(`dependency cycle ${cardId}`);
|
|
299210
|
-
return;
|
|
299211
|
-
}
|
|
299212
|
-
if (visited.has(cardId))
|
|
299213
|
-
return;
|
|
299214
|
-
const card = cards.get(cardId);
|
|
299215
|
-
if (!card)
|
|
299216
|
-
return;
|
|
299217
|
-
visiting.add(cardId);
|
|
299218
|
-
for (const dependency of [
|
|
299219
|
-
...card.dependsOn,
|
|
299220
|
-
...[...card.inputSlots, ...card.reviewSlots].map((s) => slots.get(s)?.cardId).filter((s) => !!s)
|
|
299221
|
-
])
|
|
299222
|
-
visit(dependency);
|
|
299223
|
-
visiting.delete(cardId);
|
|
299224
|
-
visited.add(cardId);
|
|
299225
|
-
};
|
|
299226
|
-
for (const card of plan.cards)
|
|
299227
|
-
visit(card.id);
|
|
299228
|
-
});
|
|
299229
|
-
var FeatureWorkflowChildReportSchema = z2.object({
|
|
299230
|
-
schema: z2.literal("omnius.feature-workflow-child-report.v1"),
|
|
299231
|
-
cardId: id,
|
|
299232
|
-
status: z2.enum(["completed", "partial", "blocked", "failed"]),
|
|
299233
|
-
inputSlots: z2.record(z2.string().min(1).max(256), FeatureWorkflowArtifactReferenceSchema),
|
|
299234
|
-
artifacts: z2.array(z2.object({ slotId: id, content: z2.string().min(1).max(1e5) }).strict()).max(32).default([]),
|
|
299235
|
-
review: z2.object({
|
|
299236
|
-
disposition: z2.enum(["approved", "changes_requested"]),
|
|
299237
|
-
reviewedSlots: z2.record(id, FeatureWorkflowArtifactReferenceSchema),
|
|
299238
|
-
findings: z2.array(z2.object({
|
|
299239
|
-
id,
|
|
299240
|
-
severity: z2.enum(["info", "blocking"]),
|
|
299241
|
-
detail: text
|
|
299242
|
-
}).strict()).max(64)
|
|
299243
|
-
}).strict().optional(),
|
|
299244
|
-
blockers: z2.array(text).max(32),
|
|
299245
|
-
unresolvedQuestions: z2.array(text).max(32)
|
|
299246
|
-
}).strict();
|
|
299247
|
-
var FeatureWorkflowToolInputSchema = z2.discriminatedUnion("action", [
|
|
299248
|
-
z2.object({
|
|
299249
|
-
action: z2.enum(["create", "revise"]),
|
|
299250
|
-
plan: FeatureWorkflowPlanSchema
|
|
299251
|
-
}).strict(),
|
|
299252
|
-
z2.object({ action: z2.literal("status") }).strict(),
|
|
299253
|
-
z2.object({ action: z2.literal("discover") }).strict(),
|
|
299254
|
-
z2.object({
|
|
299255
|
-
action: z2.literal("resume"),
|
|
299256
|
-
runId: id,
|
|
299257
|
-
planReference: FeatureWorkflowArtifactReferenceSchema,
|
|
299258
|
-
objectiveId: id
|
|
299259
|
-
}).strict(),
|
|
299260
|
-
z2.object({
|
|
299261
|
-
action: z2.literal("repair"),
|
|
299262
|
-
cardId: id,
|
|
299263
|
-
failedCardId: id,
|
|
299264
|
-
reason: text
|
|
299265
|
-
}).strict(),
|
|
299266
|
-
z2.object({
|
|
299267
|
-
action: z2.literal("record_artifact"),
|
|
299268
|
-
cardId: id,
|
|
299269
|
-
slotId: id,
|
|
299270
|
-
path: path2
|
|
299271
|
-
}).strict()
|
|
299272
|
-
]);
|
|
299273
|
-
var FeatureWorkflowToolJsonSchema = z2.toJSONSchema(FeatureWorkflowToolInputSchema, { reused: "ref", unrepresentable: "any" });
|
|
299274
|
-
|
|
299275
|
-
// packages/schemas/dist/messages.js
|
|
299276
|
-
import { z as z3 } from "zod";
|
|
299277
|
-
var AgentMessageSchema = z3.object({
|
|
299278
|
-
id: z3.string().uuid(),
|
|
299279
|
-
sessionId: z3.string().uuid(),
|
|
299280
|
-
role: z3.enum(["user", "assistant", "system", "tool"]),
|
|
299281
|
-
content: z3.string(),
|
|
299282
|
-
timestamp: z3.string().datetime(),
|
|
299283
|
-
metadata: z3.record(z3.string(), z3.unknown()).optional()
|
|
299284
|
-
});
|
|
299285
|
-
|
|
299286
|
-
// packages/schemas/dist/tools.js
|
|
299287
|
-
import { z as z4 } from "zod";
|
|
299288
|
-
var ToolCallSchema = z4.object({
|
|
299289
|
-
id: z4.string().uuid(),
|
|
299290
|
-
name: z4.string(),
|
|
299291
|
-
arguments: z4.record(z4.string(), z4.unknown()),
|
|
299292
|
-
result: z4.unknown().optional(),
|
|
299293
|
-
status: z4.enum(["pending", "running", "completed", "failed"]),
|
|
299294
|
-
startedAt: z4.string().datetime().optional(),
|
|
299295
|
-
completedAt: z4.string().datetime().optional()
|
|
299296
|
-
});
|
|
299297
|
-
|
|
299298
|
-
// packages/schemas/dist/session.js
|
|
299299
|
-
import { z as z5 } from "zod";
|
|
299300
|
-
var SessionSchema = z5.object({
|
|
299301
|
-
id: z5.string().uuid(),
|
|
299302
|
-
projectRoot: z5.string(),
|
|
299303
|
-
model: z5.string(),
|
|
299304
|
-
createdAt: z5.string().datetime(),
|
|
299305
|
-
updatedAt: z5.string().datetime(),
|
|
299306
|
-
status: z5.enum(["active", "paused", "completed", "error"]),
|
|
299307
|
-
config: z5.record(z5.string(), z5.unknown()).optional()
|
|
299308
|
-
});
|
|
299309
|
-
|
|
299310
|
-
// packages/schemas/dist/task.js
|
|
299311
|
-
import { z as z6 } from "zod";
|
|
299312
|
-
var TaskClassSchema = z6.enum([
|
|
299313
|
-
"bugfix",
|
|
299314
|
-
"feature",
|
|
299315
|
-
"refactor",
|
|
299316
|
-
"migration",
|
|
299317
|
-
"dependency-upgrade",
|
|
299318
|
-
"test",
|
|
299319
|
-
"docs",
|
|
299320
|
-
"infra"
|
|
299321
|
-
]);
|
|
299322
|
-
var UrgencySchema = z6.enum(["low", "medium", "high", "critical"]);
|
|
299323
|
-
var NormalizedTaskSchema = z6.object({
|
|
299324
|
-
/** Stable unique identifier for this task instance */
|
|
299325
|
-
id: z6.string(),
|
|
299326
|
-
/** Human-readable goal description */
|
|
299327
|
-
goal: z6.string().min(1),
|
|
299328
|
-
/** Constraints the solution must satisfy */
|
|
299329
|
-
constraints: z6.array(z6.string()),
|
|
299330
|
-
/** Criteria that must pass for the task to be considered done */
|
|
299331
|
-
successCriteria: z6.array(z6.string()),
|
|
299332
|
-
/** Absolute path to the repo root */
|
|
299333
|
-
repoRoot: z6.string(),
|
|
299334
|
-
urgency: UrgencySchema,
|
|
299335
|
-
taskClass: TaskClassSchema,
|
|
299336
|
-
/** Original raw user request before normalization */
|
|
299337
|
-
rawRequest: z6.string().optional(),
|
|
299338
|
-
/** Timestamp when the task was created (ISO-8601) */
|
|
299339
|
-
createdAt: z6.string().datetime()
|
|
299340
|
-
});
|
|
299341
|
-
var TaskStatusSchema = z6.enum([
|
|
299342
|
-
"pending",
|
|
299343
|
-
"dispatched",
|
|
299344
|
-
"in_progress",
|
|
299345
|
-
"success",
|
|
299346
|
-
"partial_success",
|
|
299347
|
-
"needs_human_decision",
|
|
299348
|
-
"blocked_missing_context",
|
|
299349
|
-
"rollback_required",
|
|
299350
|
-
"failed"
|
|
299351
|
-
]);
|
|
299352
|
-
|
|
299353
|
-
// packages/schemas/dist/plan.js
|
|
299354
|
-
import { z as z7 } from "zod";
|
|
299355
|
-
var SubtaskKindSchema = z7.enum([
|
|
299356
|
-
"inspect",
|
|
299357
|
-
"patch",
|
|
299358
|
-
"test",
|
|
299359
|
-
"migrate",
|
|
299360
|
-
"verify",
|
|
299361
|
-
"merge"
|
|
299362
|
-
]);
|
|
299363
|
-
var SubtaskSchema = z7.object({
|
|
299364
|
-
/** Stable identifier used for dependency references */
|
|
299365
|
-
id: z7.string().min(1),
|
|
299366
|
-
kind: SubtaskKindSchema,
|
|
299367
|
-
/** File paths or symbol names that this subtask targets */
|
|
299368
|
-
targets: z7.array(z7.string()),
|
|
299369
|
-
/** IDs of subtasks that must complete before this one starts */
|
|
299370
|
-
dependsOn: z7.array(z7.string()).optional(),
|
|
299371
|
-
/** Why this subtask is necessary */
|
|
299372
|
-
reason: z7.string().min(1),
|
|
299373
|
-
/** Shell commands or assertions that confirm success */
|
|
299374
|
-
validation: z7.array(z7.string())
|
|
299375
|
-
});
|
|
299376
|
-
var PlanSchema = z7.object({
|
|
299377
|
-
goal: z7.string().min(1),
|
|
299378
|
-
subtasks: z7.array(SubtaskSchema),
|
|
299379
|
-
/** Files/modules at elevated risk of breakage */
|
|
299380
|
-
riskAreas: z7.array(z7.string()),
|
|
299381
|
-
/** Aspects of the codebase that are unclear or ambiguous */
|
|
299382
|
-
unknowns: z7.array(z7.string())
|
|
299383
|
-
});
|
|
299384
|
-
|
|
299385
|
-
// packages/schemas/dist/patch.js
|
|
299386
|
-
import { z as z8 } from "zod";
|
|
299387
|
-
var EditOperationSchema = z8.enum([
|
|
299388
|
-
"diff",
|
|
299389
|
-
"rewrite",
|
|
299390
|
-
"append",
|
|
299391
|
-
"create"
|
|
299392
|
-
]);
|
|
299393
|
-
var FileEditSchema = z8.object({
|
|
299394
|
-
/** Repo-relative or absolute path to the file being edited */
|
|
299395
|
-
file: z8.string().min(1),
|
|
299396
|
-
operation: EditOperationSchema,
|
|
299397
|
-
/** Unified diff, full file content, appended text, or new file content */
|
|
299398
|
-
content: z8.string()
|
|
299399
|
-
});
|
|
299400
|
-
var NeedsMoreContextSchema = z8.object({
|
|
299401
|
-
reason: z8.string().min(1),
|
|
299402
|
-
requestedPaths: z8.array(z8.string()).optional(),
|
|
299403
|
-
requestedSymbols: z8.array(z8.string()).optional()
|
|
299404
|
-
});
|
|
299405
|
-
var PatchProposalSchema = z8.object({
|
|
299406
|
-
/** One-paragraph description of what changed and why */
|
|
299407
|
-
summary: z8.string().min(1),
|
|
299408
|
-
edits: z8.array(FileEditSchema),
|
|
299409
|
-
/** Test commands or test file paths that should be executed to validate */
|
|
299410
|
-
testsToRun: z8.array(z8.string()),
|
|
299411
|
-
/** Assumptions the editor made that the verifier should check */
|
|
299412
|
-
assumptions: z8.array(z8.string()),
|
|
299413
|
-
/** Known risks introduced by this patch */
|
|
299414
|
-
risks: z8.array(z8.string()),
|
|
299415
|
-
/**
|
|
299416
|
-
* When the editor cannot safely produce a patch without more information.
|
|
299417
|
-
* The presence of this field indicates the patch is incomplete.
|
|
299418
|
-
*/
|
|
299419
|
-
needsMoreContext: NeedsMoreContextSchema.optional()
|
|
299420
|
-
});
|
|
299421
|
-
|
|
299422
|
-
// packages/schemas/dist/verification.js
|
|
299423
|
-
import { z as z9 } from "zod";
|
|
299424
|
-
var VerificationStatusSchema = z9.enum(["pass", "fail", "partial"]);
|
|
299425
|
-
var VerificationNextActionSchema = z9.enum([
|
|
299426
|
-
"finish",
|
|
299427
|
-
"retry",
|
|
299428
|
-
"rollback",
|
|
299429
|
-
"inspect_more"
|
|
299430
|
-
]);
|
|
299431
|
-
var VerificationDecisionSchema = z9.object({
|
|
299432
|
-
status: VerificationStatusSchema,
|
|
299433
|
-
/** Concrete evidence lines from logs, test output, or type-checker output */
|
|
299434
|
-
evidence: z9.array(z9.string()),
|
|
299435
|
-
nextAction: VerificationNextActionSchema,
|
|
299436
|
-
/** Files that should be prioritised in the next retrieval/editing round */
|
|
299437
|
-
focusFiles: z9.array(z9.string()),
|
|
299438
|
-
/**
|
|
299439
|
-
* Short fingerprint string identifying the failure category.
|
|
299440
|
-
* Used to detect repeat failure loops. Only present when status !== "pass".
|
|
299441
|
-
*/
|
|
299442
|
-
failureFingerprint: z9.string().optional()
|
|
299443
|
-
});
|
|
299444
|
-
|
|
299445
|
-
// packages/schemas/dist/repoProfile.js
|
|
299446
|
-
import { z as z10 } from "zod";
|
|
299447
|
-
var LanguageSchema = z10.enum([
|
|
299448
|
-
"typescript",
|
|
299449
|
-
"javascript",
|
|
299450
|
-
"python",
|
|
299451
|
-
"go",
|
|
299452
|
-
"rust",
|
|
299453
|
-
"java",
|
|
299454
|
-
"csharp",
|
|
299455
|
-
"sql",
|
|
299456
|
-
"other"
|
|
299457
|
-
]);
|
|
299458
|
-
var PackageManagerSchema = z10.enum([
|
|
299459
|
-
"npm",
|
|
299460
|
-
"pnpm",
|
|
299461
|
-
"yarn",
|
|
299462
|
-
"bun",
|
|
299463
|
-
"pip",
|
|
299464
|
-
"poetry",
|
|
299465
|
-
"cargo",
|
|
299466
|
-
"go-modules",
|
|
299467
|
-
"maven",
|
|
299468
|
-
"gradle",
|
|
299469
|
-
"other"
|
|
299470
|
-
]);
|
|
299471
|
-
var BuildSystemSchema = z10.enum([
|
|
299472
|
-
"tsc",
|
|
299473
|
-
"vite",
|
|
299474
|
-
"webpack",
|
|
299475
|
-
"esbuild",
|
|
299476
|
-
"turbo",
|
|
299477
|
-
"nx",
|
|
299478
|
-
"make",
|
|
299479
|
-
"cmake",
|
|
299480
|
-
"cargo",
|
|
299481
|
-
"gradle",
|
|
299482
|
-
"maven",
|
|
299483
|
-
"other"
|
|
299484
|
-
]);
|
|
299485
|
-
var MigrationSystemSchema = z10.enum([
|
|
299486
|
-
"prisma",
|
|
299487
|
-
"drizzle",
|
|
299488
|
-
"knex",
|
|
299489
|
-
"alembic",
|
|
299490
|
-
"flyway",
|
|
299491
|
-
"liquibase",
|
|
299492
|
-
"typeorm",
|
|
299493
|
-
"sequelize",
|
|
299494
|
-
"other",
|
|
299495
|
-
"none"
|
|
299496
|
-
]);
|
|
299497
|
-
var RepoProfileSchema = z10.object({
|
|
299498
|
-
/** Languages present in the repo, ordered by prevalence */
|
|
299499
|
-
languages: z10.array(LanguageSchema),
|
|
299500
|
-
/** Frameworks detected (e.g. "nextjs", "fastapi", "express") */
|
|
299501
|
-
frameworks: z10.array(z10.string()),
|
|
299502
|
-
packageManager: PackageManagerSchema.optional(),
|
|
299503
|
-
buildSystem: BuildSystemSchema.optional(),
|
|
299504
|
-
/** Shell commands known to run the test suite */
|
|
299505
|
-
testCommands: z10.array(z10.string()),
|
|
299506
|
-
/** Shell commands known to run the linter */
|
|
299507
|
-
lintCommands: z10.array(z10.string()),
|
|
299508
|
-
migrationSystem: MigrationSystemSchema.optional(),
|
|
299509
|
-
/** Runtime assumptions such as Node version, Python version, etc. */
|
|
299510
|
-
runtimeAssumptions: z10.array(z10.string()),
|
|
299511
|
-
/** Names of environment variables the repo consumes */
|
|
299512
|
-
envVarNames: z10.array(z10.string()),
|
|
299513
|
-
/** Deployment-related notes (e.g. Docker, Kubernetes, serverless) */
|
|
299514
|
-
deploymentNotes: z10.array(z10.string()),
|
|
299515
|
-
/** Absolute path to the repo root on the agent's filesystem */
|
|
299516
|
-
repoRoot: z10.string(),
|
|
299517
|
-
/** ISO-8601 timestamp of the last profile update */
|
|
299518
|
-
lastIndexed: z10.string().datetime()
|
|
299519
|
-
});
|
|
299520
|
-
|
|
299521
|
-
// packages/schemas/dist/retrieval.js
|
|
299522
|
-
import { z as z11 } from "zod";
|
|
299523
|
-
var RetrievalRequestSchema = z11.object({
|
|
299524
|
-
/** Natural language description of what information is needed */
|
|
299525
|
-
query: z11.string().min(1),
|
|
299526
|
-
/** File path hints that the retrieval system should prioritise */
|
|
299527
|
-
pathsHint: z11.array(z11.string()),
|
|
299528
|
-
/** Symbol names (functions, classes, types) to look up */
|
|
299529
|
-
symbolHint: z11.array(z11.string()),
|
|
299530
|
-
/** Error message fragments to search for in logs and source */
|
|
299531
|
-
errorHint: z11.array(z11.string()),
|
|
299532
|
-
/** Maximum number of files to include in the retrieval packet */
|
|
299533
|
-
maxFiles: z11.number().int().positive(),
|
|
299534
|
-
/** Maximum number of code snippets to include */
|
|
299535
|
-
maxSnippets: z11.number().int().positive(),
|
|
299536
|
-
/** Whether test files should be included in results */
|
|
299537
|
-
includeTests: z11.boolean(),
|
|
299538
|
-
/** Whether config files (tsconfig, package.json, .env.example …) should be included */
|
|
299539
|
-
includeConfigs: z11.boolean()
|
|
299540
|
-
});
|
|
299541
|
-
var SnippetSchema = z11.object({
|
|
299542
|
-
/** Repo-relative path of the source file */
|
|
299543
|
-
file: z11.string(),
|
|
299544
|
-
/** 1-based start line */
|
|
299545
|
-
startLine: z11.number().int().positive(),
|
|
299546
|
-
/** 1-based end line (inclusive) */
|
|
299547
|
-
endLine: z11.number().int().positive(),
|
|
299548
|
-
/** The actual source text */
|
|
299549
|
-
content: z11.string(),
|
|
299550
|
-
/** Why this snippet was selected */
|
|
299551
|
-
relevanceNote: z11.string().optional()
|
|
299552
|
-
});
|
|
299553
|
-
var RetrievalPacketSchema = z11.object({
|
|
299554
|
-
/** Echo of the original request that produced this packet */
|
|
299555
|
-
request: RetrievalRequestSchema,
|
|
299556
|
-
/** Full file contents or extracts, keyed by repo-relative path */
|
|
299557
|
-
files: z11.record(z11.string(), z11.string()),
|
|
299558
|
-
snippets: z11.array(SnippetSchema),
|
|
299559
|
-
/** One-line architecture note for orientation */
|
|
299560
|
-
architectureNote: z11.string().optional(),
|
|
299561
|
-
/** Note summarising relevant prior attempts at related tasks */
|
|
299562
|
-
priorAttemptNote: z11.string().optional(),
|
|
299563
|
-
/** ISO-8601 timestamp when the packet was assembled */
|
|
299564
|
-
assembledAt: z11.string().datetime()
|
|
299565
|
-
});
|
|
299566
|
-
|
|
299567
|
-
// packages/schemas/dist/dispatch.js
|
|
299568
|
-
import { z as z12 } from "zod";
|
|
299569
|
-
var DispatchModeSchema = z12.enum([
|
|
299570
|
-
"single_pass",
|
|
299571
|
-
"multi_agent",
|
|
299572
|
-
"hybrid"
|
|
299573
|
-
]);
|
|
299574
|
-
var TaskComplexitySchema = z12.enum(["low", "medium", "high"]);
|
|
299575
|
-
var AgentRoleSchema = z12.enum([
|
|
299576
|
-
"planner",
|
|
299577
|
-
"scout",
|
|
299578
|
-
"editor",
|
|
299579
|
-
"verifier",
|
|
299580
|
-
"researcher"
|
|
299581
|
-
]);
|
|
299582
|
-
var BudgetsSchema = z12.object({
|
|
299583
|
-
/** Maximum prompt tokens across all model calls for this task */
|
|
299584
|
-
promptTokens: z12.number().int().positive(),
|
|
299585
|
-
/** Maximum number of retry cycles allowed per subtask */
|
|
299586
|
-
retries: z12.number().int().nonnegative(),
|
|
299587
|
-
/** Maximum wall-clock seconds before the task is considered timed out */
|
|
299588
|
-
wallClockSec: z12.number().positive()
|
|
299589
|
-
});
|
|
299590
|
-
var DispatchDecisionSchema = z12.object({
|
|
299591
|
-
mode: DispatchModeSchema,
|
|
299592
|
-
taskComplexity: TaskComplexitySchema,
|
|
299593
|
-
splitRecommended: z12.boolean(),
|
|
299594
|
-
/** Agent roles that should be spun up for the first wave of execution */
|
|
299595
|
-
initialAgents: z12.array(AgentRoleSchema),
|
|
299596
|
-
budgets: BudgetsSchema
|
|
299597
|
-
});
|
|
299598
|
-
|
|
299599
|
-
// packages/schemas/dist/memory.js
|
|
299600
|
-
import { z as z13 } from "zod";
|
|
299601
|
-
var RiskLevelSchema = z13.enum(["low", "medium", "high", "critical"]);
|
|
299602
|
-
var FileSummarySchema = z13.object({
|
|
299603
|
-
/** Repo-relative path of the file */
|
|
299604
|
-
path: z13.string().min(1),
|
|
299605
|
-
/** One-sentence description of the file's role */
|
|
299606
|
-
purpose: z13.string(),
|
|
299607
|
-
/** Primary exported symbols (functions, classes, constants) */
|
|
299608
|
-
mainExports: z13.array(z13.string()),
|
|
299609
|
-
/** Key import paths this file depends on */
|
|
299610
|
-
keyImports: z13.array(z13.string()),
|
|
299611
|
-
/** Logical ownership area (e.g. "auth", "api", "db", "frontend") */
|
|
299612
|
-
ownershipDomain: z13.string(),
|
|
299613
|
-
riskLevel: RiskLevelSchema,
|
|
299614
|
-
/** Paths of test files that cover this file */
|
|
299615
|
-
relatedTests: z13.array(z13.string()),
|
|
299616
|
-
/** SHA-256 or similar hash of the file content at last index time */
|
|
299617
|
-
summaryHash: z13.string(),
|
|
299618
|
-
/** ISO-8601 timestamp of the last indexing pass */
|
|
299619
|
-
lastIndexed: z13.string().datetime()
|
|
299620
|
-
});
|
|
299621
|
-
var FailureCategorySchema = z13.enum([
|
|
299622
|
-
"ts_type_drift",
|
|
299623
|
-
"import_path_mismatch",
|
|
299624
|
-
"route_not_registered",
|
|
299625
|
-
"env_var_absent",
|
|
299626
|
-
"schema_runtime_mismatch",
|
|
299627
|
-
"migration_missing",
|
|
299628
|
-
"circular_dependency",
|
|
299629
|
-
"stale_snapshot",
|
|
299630
|
-
"build_error",
|
|
299631
|
-
"test_error",
|
|
299632
|
-
"other"
|
|
299633
|
-
]);
|
|
299634
|
-
var FailureFingerprintSchema = z13.object({
|
|
299635
|
-
/** Short stable identifier (e.g. "ts_type_drift:UserSchema") */
|
|
299636
|
-
fingerprint: z13.string().min(1),
|
|
299637
|
-
category: FailureCategorySchema,
|
|
299638
|
-
/** Human-readable summary of what went wrong */
|
|
299639
|
-
description: z13.string(),
|
|
299640
|
-
/** Files involved in or triggering the failure */
|
|
299641
|
-
affectedFiles: z13.array(z13.string()),
|
|
299642
|
-
/** How many times this fingerprint has been seen */
|
|
299643
|
-
occurrenceCount: z13.number().int().nonnegative(),
|
|
299644
|
-
/** ISO-8601 timestamp of first occurrence */
|
|
299645
|
-
firstSeen: z13.string().datetime(),
|
|
299646
|
-
/** ISO-8601 timestamp of most recent occurrence */
|
|
299647
|
-
lastSeen: z13.string().datetime()
|
|
299648
|
-
});
|
|
299649
|
-
var TaskMemorySchema = z13.object({
|
|
299650
|
-
taskId: z13.string().min(1),
|
|
299651
|
-
goal: z13.string(),
|
|
299652
|
-
/** Normalised constraints carried into the task */
|
|
299653
|
-
normalizedConstraints: z13.array(z13.string()),
|
|
299654
|
-
/** Files that were read or modified during the task */
|
|
299655
|
-
filesTouched: z13.array(z13.string()),
|
|
299656
|
-
/** Summary of patches applied (not the full diff) */
|
|
299657
|
-
patchesApplied: z13.array(z13.string()),
|
|
299658
|
-
/** Final validation outcome ("pass" | "fail" | "partial") */
|
|
299659
|
-
validationOutcome: z13.enum(["pass", "fail", "partial"]),
|
|
299660
|
-
/** Human-readable reasons for any failures */
|
|
299661
|
-
failureReasons: z13.array(z13.string()),
|
|
299662
|
-
/** Follow-up tasks or open questions left behind */
|
|
299663
|
-
followUpTodos: z13.array(z13.string()),
|
|
299664
|
-
/**
|
|
299665
|
-
* Subjective quality score 0–100 assigned by the verifier
|
|
299666
|
-
* (100 = perfect, 0 = complete failure)
|
|
299667
|
-
*/
|
|
299668
|
-
qualityScore: z13.number().int().min(0).max(100),
|
|
299669
|
-
/** ISO-8601 timestamp when the task completed */
|
|
299670
|
-
completedAt: z13.string().datetime()
|
|
299671
|
-
});
|
|
299672
|
-
|
|
299673
|
-
// packages/schemas/dist/backend.js
|
|
299674
|
-
import { z as z14 } from "zod";
|
|
299675
|
-
var MessageRoleSchema = z14.enum([
|
|
299676
|
-
"system",
|
|
299677
|
-
"user",
|
|
299678
|
-
"assistant",
|
|
299679
|
-
"tool"
|
|
299680
|
-
]);
|
|
299681
|
-
var ChatMessageSchema = z14.object({
|
|
299682
|
-
role: MessageRoleSchema,
|
|
299683
|
-
content: z14.string(),
|
|
299684
|
-
/** Tool call ID, required when role === "tool" */
|
|
299685
|
-
toolCallId: z14.string().optional(),
|
|
299686
|
-
/** Tool name, required when role === "tool" */
|
|
299687
|
-
name: z14.string().optional()
|
|
299688
|
-
});
|
|
299689
|
-
var CompletionRequestSchema = z14.object({
|
|
299690
|
-
messages: z14.array(ChatMessageSchema),
|
|
299691
|
-
/** Override the model used by the backend for this request */
|
|
299692
|
-
model: z14.string().optional(),
|
|
299693
|
-
maxTokens: z14.number().int().positive().optional(),
|
|
299694
|
-
temperature: z14.number().min(0).max(2).optional(),
|
|
299695
|
-
/** Request class for queue routing */
|
|
299696
|
-
queueClass: z14.string().optional(),
|
|
299697
|
-
/** Prefix hash for cache-aware routing */
|
|
299698
|
-
prefixHash: z14.string().optional(),
|
|
299699
|
-
stopSequences: z14.array(z14.string()).optional()
|
|
299700
|
-
});
|
|
299701
|
-
var TokenUsageSchema = z14.object({
|
|
299702
|
-
promptTokens: z14.number().int().nonnegative(),
|
|
299703
|
-
completionTokens: z14.number().int().nonnegative(),
|
|
299704
|
-
totalTokens: z14.number().int().nonnegative(),
|
|
299705
|
-
cacheCreationInputTokens: z14.number().int().nonnegative().optional(),
|
|
299706
|
-
cacheReadInputTokens: z14.number().int().nonnegative().optional(),
|
|
299707
|
-
promptEvalCount: z14.number().int().nonnegative().optional()
|
|
299708
|
-
});
|
|
299709
|
-
var CompletionResponseSchema = z14.object({
|
|
299710
|
-
content: z14.string(),
|
|
299711
|
-
usage: TokenUsageSchema.optional(),
|
|
299712
|
-
/** Which model actually served the request */
|
|
299713
|
-
model: z14.string().optional(),
|
|
299714
|
-
finishReason: z14.enum(["stop", "length", "tool_calls", "content_filter", "error"]).optional()
|
|
299715
|
-
});
|
|
299716
|
-
var StructuredCompletionRequestSchema = CompletionRequestSchema.extend({
|
|
299717
|
-
/**
|
|
299718
|
-
* The Zod schema used to constrain and validate the output.
|
|
299719
|
-
* Stored as unknown here because Zod schemas are not themselves
|
|
299720
|
-
* serialisable — callers pass the live schema object.
|
|
299721
|
-
*/
|
|
299722
|
-
outputSchema: z14.unknown(),
|
|
299723
|
-
/** Human-readable label used in prompt injection for the schema */
|
|
299724
|
-
schemaLabel: z14.string().optional()
|
|
299725
|
-
});
|
|
299726
|
-
var BackendHealthSchema = z14.object({
|
|
299727
|
-
status: z14.enum(["ok", "degraded", "down"]),
|
|
299728
|
-
latencyMs: z14.number().nonnegative().optional(),
|
|
299729
|
-
/** Fraction of GPU memory currently in use (0–1) */
|
|
299730
|
-
gpuMemoryUsed: z14.number().min(0).max(1).optional(),
|
|
299731
|
-
/** Fraction of KV cache currently in use (0–1) */
|
|
299732
|
-
kvCacheUsed: z14.number().min(0).max(1).optional(),
|
|
299733
|
-
/** Number of requests currently waiting in the queue */
|
|
299734
|
-
queueDepth: z14.number().int().nonnegative().optional(),
|
|
299735
|
-
/** Human-readable note about any degraded state */
|
|
299736
|
-
note: z14.string().optional()
|
|
299737
|
-
});
|
|
299738
|
-
var BackendMetricsSchema = z14.object({
|
|
299739
|
-
/** Total requests handled since startup */
|
|
299740
|
-
totalRequests: z14.number().int().nonnegative(),
|
|
299741
|
-
/** Requests that completed successfully */
|
|
299742
|
-
successfulRequests: z14.number().int().nonnegative(),
|
|
299743
|
-
/** Requests that failed */
|
|
299744
|
-
failedRequests: z14.number().int().nonnegative(),
|
|
299745
|
-
/** Average time-to-first-token across recent requests (ms) */
|
|
299746
|
-
avgTtftMs: z14.number().nonnegative().optional(),
|
|
299747
|
-
/** Average end-to-end latency across recent requests (ms) */
|
|
299748
|
-
avgLatencyMs: z14.number().nonnegative().optional(),
|
|
299749
|
-
/** Approximate prefix cache hit rate (0–1) */
|
|
299750
|
-
prefixCacheHitRate: z14.number().min(0).max(1).optional(),
|
|
299751
|
-
/** Number of sleep/wake cycles since startup */
|
|
299752
|
-
sleepWakeCycles: z14.number().int().nonnegative().optional(),
|
|
299753
|
-
/** Number of OOM / preemption / offload events */
|
|
299754
|
-
oomEvents: z14.number().int().nonnegative().optional(),
|
|
299755
|
-
/** ISO-8601 timestamp of when the backend service started */
|
|
299756
|
-
uptimeSince: z14.string().datetime().optional()
|
|
299757
|
-
});
|
|
299758
|
-
|
|
299759
|
-
// packages/schemas/dist/config.js
|
|
299760
|
-
import { z as z15 } from "zod";
|
|
299761
|
-
var AgentConfigSchema = z15.object({
|
|
299762
|
-
// -----------------------------------------------------------------------
|
|
299763
|
-
// Model / backend
|
|
299764
|
-
// -----------------------------------------------------------------------
|
|
299765
|
-
/** HuggingFace model ID, e.g. "Qwen/Qwen3.5-122B-A10B" */
|
|
299766
|
-
MODEL_ID: z15.string().min(1),
|
|
299767
|
-
/** Base URL of the primary vLLM OpenAI-compatible endpoint */
|
|
299768
|
-
VLLM_BASE_URL: z15.string().url(),
|
|
299769
|
-
/** API key sent to the vLLM service (often the literal string "EMPTY") */
|
|
299770
|
-
VLLM_API_KEY: z15.string().default("EMPTY"),
|
|
299771
|
-
// -----------------------------------------------------------------------
|
|
299772
|
-
// Context / memory tuning
|
|
299773
|
-
// -----------------------------------------------------------------------
|
|
299774
|
-
/**
|
|
299775
|
-
* Maximum context length for the model.
|
|
299776
|
-
* Should be discovered by startup probing rather than hard-coded.
|
|
299777
|
-
*/
|
|
299778
|
-
AGENT_MAX_MODEL_LEN: z15.string().transform((v) => parseInt(v, 10)).pipe(z15.number().int().positive()).default(65536),
|
|
299779
|
-
/** Enable vLLM automatic prefix caching (1 = enabled) */
|
|
299780
|
-
AGENT_ENABLE_PREFIX_CACHING: z15.string().transform((v) => v === "1" || v.toLowerCase() === "true").pipe(z15.boolean()).default(true),
|
|
299781
|
-
/** Enable vLLM sleep mode when idle (1 = enabled) */
|
|
299782
|
-
AGENT_ENABLE_SLEEP_MODE: z15.string().transform((v) => v === "1" || v.toLowerCase() === "true").pipe(z15.boolean()).default(true),
|
|
299783
|
-
// -----------------------------------------------------------------------
|
|
299784
|
-
// Agent behaviour
|
|
299785
|
-
// -----------------------------------------------------------------------
|
|
299786
|
-
/** Maximum retry cycles per subtask */
|
|
299787
|
-
AGENT_MAX_RETRIES: z15.string().transform((v) => parseInt(v, 10)).pipe(z15.number().int().nonnegative()).default(3),
|
|
299788
|
-
/** Maximum number of parallel subagents that may run simultaneously */
|
|
299789
|
-
AGENT_MAX_PARALLEL_SUBAGENTS: z15.string().transform((v) => parseInt(v, 10)).pipe(z15.number().int().positive()).default(4),
|
|
299790
|
-
// -----------------------------------------------------------------------
|
|
299791
|
-
// Retrieval limits
|
|
299792
|
-
// -----------------------------------------------------------------------
|
|
299793
|
-
/** Maximum files included in a single retrieval packet */
|
|
299794
|
-
AGENT_RETRIEVAL_MAX_FILES: z15.string().transform((v) => parseInt(v, 10)).pipe(z15.number().int().positive()).default(8),
|
|
299795
|
-
/** Maximum snippets included in a single retrieval packet */
|
|
299796
|
-
AGENT_RETRIEVAL_MAX_SNIPPETS: z15.string().transform((v) => parseInt(v, 10)).pipe(z15.number().int().positive()).default(16),
|
|
299797
|
-
// -----------------------------------------------------------------------
|
|
299798
|
-
// File paths
|
|
299799
|
-
// -----------------------------------------------------------------------
|
|
299800
|
-
/** Directory where agent working trees and artefacts are written */
|
|
299801
|
-
AGENT_WORK_ROOT: z15.string().min(1),
|
|
299802
|
-
/** Directory where the indexer stores its indexes and embeddings */
|
|
299803
|
-
AGENT_INDEX_ROOT: z15.string().min(1),
|
|
299804
|
-
// -----------------------------------------------------------------------
|
|
299805
|
-
// Optional models
|
|
299806
|
-
// -----------------------------------------------------------------------
|
|
299807
|
-
/** Model ID or endpoint for the embedding model (optional) */
|
|
299808
|
-
AGENT_EMBEDDING_MODEL: z15.string().optional(),
|
|
299809
|
-
/**
|
|
299810
|
-
* Optional smaller local model for triage/summarisation tasks.
|
|
299811
|
-
* When set, used in Profile C (hybrid mode).
|
|
299812
|
-
*/
|
|
299813
|
-
AGENT_SMALL_MODEL: z15.string().optional()
|
|
299814
|
-
});
|
|
299815
|
-
|
|
299816
|
-
// packages/schemas/dist/queue.js
|
|
299817
|
-
import { z as z16 } from "zod";
|
|
299818
|
-
var QueueClassSchema = z16.enum([
|
|
299819
|
-
/** CLI and direct user-facing requests; lowest latency target */
|
|
299820
|
-
"interactive-high",
|
|
299821
|
-
/** Planner role requests; moderate priority */
|
|
299822
|
-
"planner-medium",
|
|
299823
|
-
/** Editor role patch generation; high priority, may be long-running */
|
|
299824
|
-
"editor-high",
|
|
299825
|
-
/** Verifier role review; high priority, usually short */
|
|
299826
|
-
"verifier-high",
|
|
299827
|
-
/** Memory write-back and summarisation; background, low priority */
|
|
299828
|
-
"memory-low",
|
|
299829
|
-
/** Bulk indexing and embedding; lowest priority, best-effort */
|
|
299830
|
-
"batch-indexing-low"
|
|
299831
|
-
]);
|
|
299832
|
-
|
|
299833
|
-
// packages/schemas/dist/operational-world.js
|
|
299834
300908
|
import { z as z17 } from "zod";
|
|
299835
|
-
var
|
|
299836
|
-
var
|
|
299837
|
-
|
|
299838
|
-
|
|
299839
|
-
|
|
299840
|
-
|
|
299841
|
-
|
|
299842
|
-
|
|
299843
|
-
|
|
299844
|
-
|
|
299845
|
-
"session",
|
|
299846
|
-
"chat",
|
|
299847
|
-
"thread",
|
|
299848
|
-
"conversation",
|
|
299849
|
-
"legacy_unscoped"
|
|
299850
|
-
]),
|
|
299851
|
-
scopeId: OperationalWorldIdSchema,
|
|
299852
|
-
taskEpoch: z17.number().int().nonnegative().optional()
|
|
299853
|
-
}).strict();
|
|
299854
|
-
var OperationalMetadataDerivedFieldSchema = z17.enum([
|
|
299855
|
-
"source_evidence",
|
|
299856
|
-
"confidence",
|
|
299857
|
-
"revision",
|
|
299858
|
-
"temporal_validity",
|
|
299859
|
-
"scope",
|
|
299860
|
-
"metadata_provenance"
|
|
299861
|
-
]);
|
|
299862
|
-
var OperationalMetadataProvenanceSchema = z17.discriminatedUnion("kind", [
|
|
299863
|
-
z17.object({ kind: z17.literal("native") }).strict(),
|
|
299864
|
-
z17.object({
|
|
299865
|
-
kind: z17.literal("legacy_derived"),
|
|
299866
|
-
marker: z17.literal("metadata-only-no-semantic-assertion"),
|
|
299867
|
-
sourceRecordId: OperationalWorldIdSchema,
|
|
299868
|
-
derivedFields: z17.array(OperationalMetadataDerivedFieldSchema).min(1).max(6)
|
|
299869
|
-
}).strict()
|
|
299870
|
-
]);
|
|
299871
|
-
var JsonValueSchema = z17.lazy(() => z17.union([
|
|
299872
|
-
z17.string(),
|
|
299873
|
-
z17.number().finite(),
|
|
299874
|
-
z17.boolean(),
|
|
299875
|
-
z17.null(),
|
|
299876
|
-
z17.array(JsonValueSchema),
|
|
299877
|
-
z17.record(z17.string(), JsonValueSchema)
|
|
299878
|
-
]));
|
|
299879
|
-
var LineRangeLocatorSchema = z17.object({
|
|
299880
|
-
type: z17.literal("line_range"),
|
|
299881
|
-
startLine: z17.number().int().positive(),
|
|
299882
|
-
endLine: z17.number().int().positive()
|
|
299883
|
-
}).strict();
|
|
299884
|
-
var CharacterRangeLocatorSchema = z17.object({
|
|
299885
|
-
type: z17.literal("character_range"),
|
|
299886
|
-
startOffset: z17.number().int().nonnegative(),
|
|
299887
|
-
/** Exclusive end offset. */
|
|
299888
|
-
endOffset: z17.number().int().positive()
|
|
299889
|
-
}).strict();
|
|
299890
|
-
var PageRangeLocatorSchema = z17.object({
|
|
299891
|
-
type: z17.literal("page_range"),
|
|
299892
|
-
startPage: z17.number().int().positive(),
|
|
299893
|
-
endPage: z17.number().int().positive()
|
|
299894
|
-
}).strict();
|
|
299895
|
-
var SheetRangeLocatorSchema = z17.object({
|
|
299896
|
-
type: z17.literal("sheet_range"),
|
|
299897
|
-
sheetName: z17.string().trim().min(1).max(256),
|
|
299898
|
-
startRow: z17.number().int().positive().optional(),
|
|
299899
|
-
endRow: z17.number().int().positive().optional(),
|
|
299900
|
-
startColumn: z17.number().int().positive().optional(),
|
|
299901
|
-
endColumn: z17.number().int().positive().optional()
|
|
299902
|
-
}).strict();
|
|
299903
|
-
var TableRangeLocatorSchema = z17.object({
|
|
299904
|
-
type: z17.literal("table_range"),
|
|
299905
|
-
table: z17.string().trim().min(1).max(256),
|
|
299906
|
-
startRow: z17.number().int().nonnegative(),
|
|
299907
|
-
endRow: z17.number().int().nonnegative(),
|
|
299908
|
-
columns: z17.array(z17.string().trim().min(1).max(256)).max(128).optional()
|
|
299909
|
-
}).strict();
|
|
299910
|
-
var JsonPathLocatorSchema = z17.object({
|
|
299911
|
-
type: z17.literal("json_path"),
|
|
299912
|
-
path: z17.string().trim().min(1).max(2048)
|
|
299913
|
-
}).strict();
|
|
299914
|
-
var HeadingLocatorSchema = z17.object({
|
|
299915
|
-
type: z17.literal("heading"),
|
|
299916
|
-
heading: z17.string().trim().min(1).max(1024),
|
|
299917
|
-
occurrence: z17.number().int().positive().optional()
|
|
299918
|
-
}).strict();
|
|
299919
|
-
var FieldLocatorSchema = z17.object({
|
|
299920
|
-
type: z17.literal("field"),
|
|
299921
|
-
path: z17.array(z17.string().trim().min(1).max(256)).min(1).max(64),
|
|
299922
|
-
recordKey: z17.string().trim().min(1).max(512).optional()
|
|
299923
|
-
}).strict();
|
|
299924
|
-
var UriFragmentLocatorSchema = z17.object({
|
|
299925
|
-
type: z17.literal("uri_fragment"),
|
|
299926
|
-
fragment: z17.string().trim().min(1).max(2048)
|
|
299927
|
-
}).strict();
|
|
299928
|
-
var EvidenceLocatorSchema = z17.discriminatedUnion("type", [
|
|
299929
|
-
LineRangeLocatorSchema,
|
|
299930
|
-
CharacterRangeLocatorSchema,
|
|
299931
|
-
PageRangeLocatorSchema,
|
|
299932
|
-
SheetRangeLocatorSchema,
|
|
299933
|
-
TableRangeLocatorSchema,
|
|
299934
|
-
JsonPathLocatorSchema,
|
|
299935
|
-
HeadingLocatorSchema,
|
|
299936
|
-
FieldLocatorSchema,
|
|
299937
|
-
UriFragmentLocatorSchema
|
|
299938
|
-
]).superRefine((locator, ctx) => {
|
|
299939
|
-
if (locator.type === "line_range" && locator.endLine < locator.startLine) {
|
|
299940
|
-
ctx.addIssue({
|
|
299941
|
-
code: "custom",
|
|
299942
|
-
path: ["endLine"],
|
|
299943
|
-
message: "endLine must be greater than or equal to startLine"
|
|
299944
|
-
});
|
|
299945
|
-
}
|
|
299946
|
-
if (locator.type === "character_range" && locator.endOffset <= locator.startOffset) {
|
|
299947
|
-
ctx.addIssue({
|
|
299948
|
-
code: "custom",
|
|
299949
|
-
path: ["endOffset"],
|
|
299950
|
-
message: "endOffset must be greater than startOffset"
|
|
299951
|
-
});
|
|
299952
|
-
}
|
|
299953
|
-
if (locator.type === "page_range" && locator.endPage < locator.startPage) {
|
|
299954
|
-
ctx.addIssue({
|
|
299955
|
-
code: "custom",
|
|
299956
|
-
path: ["endPage"],
|
|
299957
|
-
message: "endPage must be greater than or equal to startPage"
|
|
299958
|
-
});
|
|
299959
|
-
}
|
|
299960
|
-
if (locator.type === "sheet_range") {
|
|
299961
|
-
if (locator.endRow !== void 0 && locator.startRow === void 0) {
|
|
299962
|
-
ctx.addIssue({
|
|
299963
|
-
code: "custom",
|
|
299964
|
-
path: ["startRow"],
|
|
299965
|
-
message: "startRow is required when endRow is present"
|
|
299966
|
-
});
|
|
299967
|
-
} else if (locator.startRow !== void 0 && locator.endRow !== void 0 && locator.endRow < locator.startRow) {
|
|
299968
|
-
ctx.addIssue({
|
|
299969
|
-
code: "custom",
|
|
299970
|
-
path: ["endRow"],
|
|
299971
|
-
message: "endRow must be greater than or equal to startRow"
|
|
299972
|
-
});
|
|
299973
|
-
}
|
|
299974
|
-
if (locator.endColumn !== void 0 && locator.startColumn === void 0) {
|
|
299975
|
-
ctx.addIssue({
|
|
299976
|
-
code: "custom",
|
|
299977
|
-
path: ["startColumn"],
|
|
299978
|
-
message: "startColumn is required when endColumn is present"
|
|
299979
|
-
});
|
|
299980
|
-
} else if (locator.startColumn !== void 0 && locator.endColumn !== void 0 && locator.endColumn < locator.startColumn) {
|
|
299981
|
-
ctx.addIssue({
|
|
299982
|
-
code: "custom",
|
|
299983
|
-
path: ["endColumn"],
|
|
299984
|
-
message: "endColumn must be greater than or equal to startColumn"
|
|
299985
|
-
});
|
|
299986
|
-
}
|
|
299987
|
-
}
|
|
299988
|
-
if (locator.type === "table_range" && locator.endRow < locator.startRow) {
|
|
299989
|
-
ctx.addIssue({
|
|
299990
|
-
code: "custom",
|
|
299991
|
-
path: ["endRow"],
|
|
299992
|
-
message: "endRow must be greater than or equal to startRow"
|
|
299993
|
-
});
|
|
299994
|
-
}
|
|
299995
|
-
});
|
|
299996
|
-
var SourceAuthoritySchema = z17.enum([
|
|
299997
|
-
"authoritative",
|
|
299998
|
-
"primary",
|
|
299999
|
-
"secondary",
|
|
300000
|
-
"derived",
|
|
300001
|
-
"unknown"
|
|
300002
|
-
]);
|
|
300003
|
-
var SourceFreshnessSchema = z17.enum(["fresh", "stale", "unknown"]);
|
|
300004
|
-
var SourceReadPolicySchema = z17.enum([
|
|
300005
|
-
"immutable",
|
|
300006
|
-
"snapshot",
|
|
300007
|
-
"refresh_before_use",
|
|
300008
|
-
"live"
|
|
300009
|
-
]);
|
|
300010
|
-
var SourceBindingSchema = z17.object({
|
|
300011
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300012
|
-
bindingId: OperationalWorldIdSchema,
|
|
300013
|
-
sourceId: OperationalWorldIdSchema,
|
|
300014
|
-
/** URI, repo-relative path, or external source identifier. */
|
|
300015
|
-
sourceUri: z17.string().trim().min(1).max(4096),
|
|
300016
|
-
sourceRevision: OperationalWorldRevisionSchema,
|
|
300017
|
-
sourceHash: z17.string().trim().min(1).max(512).optional(),
|
|
300018
|
-
locator: EvidenceLocatorSchema,
|
|
300019
|
-
authority: SourceAuthoritySchema,
|
|
300020
|
-
freshness: SourceFreshnessSchema,
|
|
300021
|
-
readPolicy: SourceReadPolicySchema,
|
|
300022
|
-
observedAt: z17.string().datetime(),
|
|
300023
|
-
confidence: ConfidenceSchema,
|
|
300024
|
-
notes: z17.string().trim().max(2e3).optional()
|
|
300025
|
-
}).strict();
|
|
300026
|
-
var EvidenceRoleSchema = z17.enum([
|
|
300027
|
-
"supports",
|
|
300028
|
-
"refutes",
|
|
300029
|
-
"context",
|
|
300030
|
-
"verification",
|
|
300031
|
-
"blocker"
|
|
300032
|
-
]);
|
|
300033
|
-
var EvidenceRefSchema = z17.object({
|
|
300034
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300035
|
-
evidenceId: OperationalWorldIdSchema,
|
|
300036
|
-
bindingId: OperationalWorldIdSchema,
|
|
300037
|
-
role: EvidenceRoleSchema,
|
|
300038
|
-
excerpt: z17.string().max(4e3).optional(),
|
|
300039
|
-
excerptHash: z17.string().trim().min(1).max(512).optional(),
|
|
300040
|
-
observedAt: z17.string().datetime(),
|
|
300041
|
-
confidence: ConfidenceSchema,
|
|
300042
|
-
tags: z17.array(z17.string().trim().min(1).max(128)).max(64)
|
|
300043
|
-
}).strict();
|
|
300044
|
-
var ClaimKindSchema = z17.enum([
|
|
300045
|
-
"fact",
|
|
300046
|
-
"inference",
|
|
300047
|
-
"requirement",
|
|
300048
|
-
"constraint",
|
|
300049
|
-
"outcome"
|
|
300050
|
-
]);
|
|
300051
|
-
var ClaimPolaritySchema = z17.enum(["positive", "negative"]);
|
|
300052
|
-
var ClaimStatusSchema = z17.enum([
|
|
300053
|
-
"proposed",
|
|
300054
|
-
"supported",
|
|
300055
|
-
"refuted",
|
|
300056
|
-
"contested",
|
|
300057
|
-
"unverified",
|
|
300058
|
-
"blocked"
|
|
300059
|
-
]);
|
|
300060
|
-
var WorkGraphNodeAuthoritySchema = z17.enum([
|
|
300061
|
-
"explicit",
|
|
300062
|
-
"inferred",
|
|
300063
|
-
"adopted"
|
|
300064
|
-
]);
|
|
300065
|
-
var ClaimSchema = z17.object({
|
|
300066
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300067
|
-
claimId: OperationalWorldIdSchema,
|
|
300068
|
-
statement: z17.string().trim().min(1).max(4e3),
|
|
300069
|
-
kind: ClaimKindSchema,
|
|
300070
|
-
polarity: ClaimPolaritySchema,
|
|
300071
|
-
status: ClaimStatusSchema,
|
|
300072
|
-
confidence: ConfidenceSchema,
|
|
300073
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).max(256),
|
|
300074
|
-
dependsOnClaimIds: z17.array(OperationalWorldIdSchema).max(256),
|
|
300075
|
-
tags: z17.array(z17.string().trim().min(1).max(128)).max(64),
|
|
300076
|
-
/** Structured proposition fields used to group competing claims. */
|
|
300077
|
-
subjectNodeId: OperationalWorldIdSchema.optional(),
|
|
300078
|
-
predicate: z17.string().trim().min(1).max(512).optional(),
|
|
300079
|
-
objectValue: JsonValueSchema.optional(),
|
|
300080
|
-
validFrom: z17.string().datetime().optional(),
|
|
300081
|
-
validTo: z17.string().datetime().optional(),
|
|
300082
|
-
authority: WorkGraphNodeAuthoritySchema.optional()
|
|
300083
|
-
}).strict().superRefine((claim, ctx) => {
|
|
300084
|
-
if (claim.validFrom !== void 0 && claim.validTo !== void 0 && Date.parse(claim.validTo) < Date.parse(claim.validFrom)) {
|
|
300085
|
-
ctx.addIssue({
|
|
300086
|
-
code: "custom",
|
|
300087
|
-
path: ["validTo"],
|
|
300088
|
-
message: "validTo must not precede validFrom"
|
|
300089
|
-
});
|
|
300090
|
-
}
|
|
300091
|
-
});
|
|
300092
|
-
var ConflictKindSchema = z17.enum([
|
|
300093
|
-
"contradiction",
|
|
300094
|
-
"source_disagreement",
|
|
300095
|
-
"temporal",
|
|
300096
|
-
"schema",
|
|
300097
|
-
"authority"
|
|
300098
|
-
]);
|
|
300099
|
-
var ConflictStatusSchema = z17.enum([
|
|
300100
|
-
"open",
|
|
300101
|
-
"resolved",
|
|
300102
|
-
"accepted_uncertainty"
|
|
300103
|
-
]);
|
|
300104
|
-
var ConflictResolutionSchema = z17.object({
|
|
300105
|
-
decision: z17.string().trim().min(1).max(2e3),
|
|
300106
|
-
rationale: z17.string().trim().min(1).max(4e3),
|
|
300107
|
-
resolvedBy: z17.string().trim().min(1).max(256),
|
|
300108
|
-
resolvedAt: z17.string().datetime(),
|
|
300109
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).max(256)
|
|
300110
|
-
}).strict();
|
|
300111
|
-
var ConflictSchema = z17.object({
|
|
300112
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300113
|
-
conflictId: OperationalWorldIdSchema,
|
|
300114
|
-
kind: ConflictKindSchema,
|
|
300115
|
-
summary: z17.string().trim().min(1).max(4e3),
|
|
300116
|
-
claimIds: z17.array(OperationalWorldIdSchema).min(2).max(64),
|
|
300117
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).max(256),
|
|
300118
|
-
status: ConflictStatusSchema,
|
|
300119
|
-
resolution: ConflictResolutionSchema.optional()
|
|
300120
|
-
}).strict().superRefine((conflict, ctx) => {
|
|
300121
|
-
if (new Set(conflict.claimIds).size !== conflict.claimIds.length) {
|
|
300122
|
-
ctx.addIssue({
|
|
300123
|
-
code: "custom",
|
|
300124
|
-
path: ["claimIds"],
|
|
300125
|
-
message: "claimIds must contain at least two distinct claims"
|
|
300126
|
-
});
|
|
300127
|
-
}
|
|
300128
|
-
if (conflict.status !== "open" && !conflict.resolution) {
|
|
300129
|
-
ctx.addIssue({
|
|
300130
|
-
code: "custom",
|
|
300131
|
-
path: ["resolution"],
|
|
300132
|
-
message: "a non-open conflict requires a resolution record"
|
|
300133
|
-
});
|
|
300134
|
-
}
|
|
300135
|
-
});
|
|
300136
|
-
var WorkGraphNodeKindSchema = z17.enum([
|
|
300137
|
-
"objective",
|
|
300138
|
-
"requirement",
|
|
300139
|
-
"document",
|
|
300140
|
-
"section",
|
|
300141
|
-
"task",
|
|
300142
|
-
"feature",
|
|
300143
|
-
"component",
|
|
300144
|
-
"module",
|
|
300145
|
-
"acceptance",
|
|
300146
|
-
"symbol",
|
|
300147
|
-
"entity",
|
|
300148
|
-
"event",
|
|
300149
|
-
"action",
|
|
300150
|
-
"mutation",
|
|
300151
|
-
"verification",
|
|
300152
|
-
"blocker",
|
|
300153
|
-
"policy",
|
|
300154
|
-
"artifact",
|
|
300155
|
-
"decision",
|
|
300156
|
-
"claim",
|
|
300157
|
-
"evidence",
|
|
300158
|
-
"conflict",
|
|
300159
|
-
"validation",
|
|
300160
|
-
"actor",
|
|
300161
|
-
"conversation",
|
|
300162
|
-
"relationship"
|
|
300163
|
-
]);
|
|
300164
|
-
var WorkGraphNodeStatusSchema = z17.enum([
|
|
300165
|
-
"proposed",
|
|
300166
|
-
"active",
|
|
300167
|
-
"blocked",
|
|
300168
|
-
"complete",
|
|
300169
|
-
"invalid",
|
|
300170
|
-
"superseded"
|
|
300171
|
-
]);
|
|
300172
|
-
var WorkGraphTargetRefSchema = z17.discriminatedUnion("type", [
|
|
300173
|
-
z17.object({ type: z17.literal("node"), nodeId: OperationalWorldIdSchema }).strict(),
|
|
300174
|
-
z17.object({ type: z17.literal("claim"), claimId: OperationalWorldIdSchema }).strict(),
|
|
300175
|
-
z17.object({
|
|
300176
|
-
type: z17.literal("conflict"),
|
|
300177
|
-
conflictId: OperationalWorldIdSchema
|
|
300178
|
-
}).strict(),
|
|
300179
|
-
z17.object({
|
|
300180
|
-
type: z17.literal("evidence"),
|
|
300181
|
-
evidenceId: OperationalWorldIdSchema
|
|
300182
|
-
}).strict(),
|
|
300183
|
-
z17.object({ type: z17.literal("source"), bindingId: OperationalWorldIdSchema }).strict(),
|
|
300184
|
-
z17.object({
|
|
300185
|
-
type: z17.literal("artifact"),
|
|
300186
|
-
uri: z17.string().trim().min(1).max(4096),
|
|
300187
|
-
revision: OperationalWorldRevisionSchema.optional()
|
|
300188
|
-
}).strict()
|
|
300189
|
-
]);
|
|
300190
|
-
var WorkActionPreconditionSchema = z17.object({
|
|
300191
|
-
preconditionId: OperationalWorldIdSchema,
|
|
300192
|
-
description: z17.string().trim().min(1).max(2e3),
|
|
300193
|
-
status: z17.enum(["unknown", "satisfied", "unsatisfied", "waived"]),
|
|
300194
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).max(256)
|
|
300195
|
-
}).strict();
|
|
300196
|
-
var WorkActionMutationSchema = z17.object({
|
|
300197
|
-
mutationId: OperationalWorldIdSchema,
|
|
300198
|
-
kind: z17.enum(["create", "update", "delete", "execute", "deliver"]),
|
|
300199
|
-
target: WorkGraphTargetRefSchema,
|
|
300200
|
-
description: z17.string().trim().min(1).max(2e3),
|
|
300201
|
-
reversible: z17.boolean()
|
|
300202
|
-
}).strict();
|
|
300203
|
-
var WorkActionApprovalSchema = z17.object({
|
|
300204
|
-
required: z17.boolean(),
|
|
300205
|
-
status: z17.enum(["not_required", "pending", "approved", "rejected"]),
|
|
300206
|
-
approvedBy: z17.string().trim().min(1).max(256).optional(),
|
|
300207
|
-
approvedAt: z17.string().datetime().optional()
|
|
300208
|
-
}).strict().superRefine((approval, ctx) => {
|
|
300209
|
-
if (!approval.required && approval.status !== "not_required") {
|
|
300210
|
-
ctx.addIssue({
|
|
300211
|
-
code: "custom",
|
|
300212
|
-
path: ["status"],
|
|
300213
|
-
message: "approval status must be not_required when approval is not required"
|
|
300214
|
-
});
|
|
300215
|
-
}
|
|
300216
|
-
if (approval.required && approval.status === "not_required") {
|
|
300217
|
-
ctx.addIssue({
|
|
300218
|
-
code: "custom",
|
|
300219
|
-
path: ["status"],
|
|
300220
|
-
message: "required approval cannot have not_required status"
|
|
300221
|
-
});
|
|
300222
|
-
}
|
|
300223
|
-
if (approval.status === "approved" && (!approval.approvedBy || !approval.approvedAt)) {
|
|
300224
|
-
ctx.addIssue({
|
|
300225
|
-
code: "custom",
|
|
300226
|
-
path: ["approvedBy"],
|
|
300227
|
-
message: "approved actions require approvedBy and approvedAt"
|
|
300228
|
-
});
|
|
300229
|
-
}
|
|
300230
|
-
});
|
|
300231
|
-
var WorkActionContractSchema = z17.object({
|
|
300232
|
-
preconditions: z17.array(WorkActionPreconditionSchema).max(256),
|
|
300233
|
-
mutations: z17.array(WorkActionMutationSchema).max(256),
|
|
300234
|
-
sideEffects: z17.array(z17.string().trim().min(1).max(2e3)).max(256),
|
|
300235
|
-
approval: WorkActionApprovalSchema,
|
|
300236
|
-
authority: z17.enum([
|
|
300237
|
-
"operator_explicit",
|
|
300238
|
-
"delegated_scope",
|
|
300239
|
-
"policy",
|
|
300240
|
-
"none"
|
|
300241
|
-
]),
|
|
300242
|
-
risk: z17.enum(["none", "low", "medium", "high", "critical"])
|
|
300243
|
-
}).strict();
|
|
300244
|
-
var WorkGraphNodeReferenceSchema = z17.discriminatedUnion("type", [
|
|
300245
|
-
z17.object({ type: z17.literal("claim"), claimId: OperationalWorldIdSchema }).strict(),
|
|
300246
|
-
z17.object({
|
|
300247
|
-
type: z17.literal("conflict"),
|
|
300248
|
-
conflictId: OperationalWorldIdSchema
|
|
300249
|
-
}).strict(),
|
|
300250
|
-
z17.object({
|
|
300251
|
-
type: z17.literal("evidence"),
|
|
300252
|
-
evidenceId: OperationalWorldIdSchema
|
|
300253
|
-
}).strict(),
|
|
300254
|
-
z17.object({ type: z17.literal("source"), bindingId: OperationalWorldIdSchema }).strict()
|
|
300255
|
-
]);
|
|
300256
|
-
var WorkGraphNodeSchema = z17.object({
|
|
300257
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300258
|
-
nodeId: OperationalWorldIdSchema,
|
|
300259
|
-
kind: WorkGraphNodeKindSchema,
|
|
300260
|
-
label: z17.string().trim().min(1).max(1e3),
|
|
300261
|
-
description: z17.string().trim().max(4e3).optional(),
|
|
300262
|
-
status: WorkGraphNodeStatusSchema,
|
|
300263
|
-
authority: WorkGraphNodeAuthoritySchema,
|
|
300264
|
-
parentNodeId: OperationalWorldIdSchema.optional(),
|
|
300265
|
-
bindingIds: z17.array(OperationalWorldIdSchema).min(1).max(256),
|
|
300266
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).min(1).max(256),
|
|
300267
|
-
confidence: ConfidenceSchema,
|
|
300268
|
-
revision: OperationalWorldRevisionSchema,
|
|
300269
|
-
validFrom: z17.string().datetime(),
|
|
300270
|
-
validTo: z17.string().datetime().optional(),
|
|
300271
|
-
scope: OperationalFactScopeSchema,
|
|
300272
|
-
taskEpoch: z17.number().int().nonnegative().optional(),
|
|
300273
|
-
metadataProvenance: OperationalMetadataProvenanceSchema,
|
|
300274
|
-
reference: WorkGraphNodeReferenceSchema.optional(),
|
|
300275
|
-
actionContract: WorkActionContractSchema.optional(),
|
|
300276
|
-
attributes: z17.record(z17.string(), JsonValueSchema)
|
|
300277
|
-
}).strict().superRefine((node, ctx) => {
|
|
300278
|
-
const expectedReference = node.kind === "claim" ? "claim" : node.kind === "conflict" ? "conflict" : node.kind === "evidence" ? "evidence" : null;
|
|
300279
|
-
if (expectedReference && node.reference?.type !== expectedReference) {
|
|
300280
|
-
ctx.addIssue({
|
|
300281
|
-
code: "custom",
|
|
300282
|
-
path: ["reference"],
|
|
300283
|
-
message: `${node.kind} nodes require a matching ${expectedReference} reference`
|
|
300284
|
-
});
|
|
300285
|
-
}
|
|
300286
|
-
if (node.parentNodeId === node.nodeId) {
|
|
300287
|
-
ctx.addIssue({
|
|
300288
|
-
code: "custom",
|
|
300289
|
-
path: ["parentNodeId"],
|
|
300290
|
-
message: "a node cannot be its own parent"
|
|
300291
|
-
});
|
|
300292
|
-
}
|
|
300293
|
-
if ((node.kind === "action" || node.kind === "mutation") && !node.actionContract) {
|
|
300294
|
-
ctx.addIssue({
|
|
300295
|
-
code: "custom",
|
|
300296
|
-
path: ["actionContract"],
|
|
300297
|
-
message: `${node.kind} nodes require an action contract`
|
|
300298
|
-
});
|
|
300299
|
-
}
|
|
300300
|
-
if (node.validFrom && node.validTo && Date.parse(node.validTo) < Date.parse(node.validFrom)) {
|
|
300301
|
-
ctx.addIssue({
|
|
300302
|
-
code: "custom",
|
|
300303
|
-
path: ["validTo"],
|
|
300304
|
-
message: "validTo must not precede validFrom"
|
|
300305
|
-
});
|
|
300306
|
-
}
|
|
300307
|
-
if (node.scope?.taskEpoch !== void 0 && node.taskEpoch !== void 0 && node.scope.taskEpoch !== node.taskEpoch) {
|
|
300308
|
-
ctx.addIssue({
|
|
300309
|
-
code: "custom",
|
|
300310
|
-
path: ["taskEpoch"],
|
|
300311
|
-
message: "taskEpoch must match scope.taskEpoch"
|
|
300312
|
-
});
|
|
300313
|
-
}
|
|
300314
|
-
});
|
|
300315
|
-
var WorkGraphEdgeKindSchema = z17.enum([
|
|
300316
|
-
"contains",
|
|
300317
|
-
"part_of",
|
|
300318
|
-
"decomposes_to",
|
|
300319
|
-
"depends_on",
|
|
300320
|
-
"satisfies",
|
|
300321
|
-
"produces",
|
|
300322
|
-
"supports",
|
|
300323
|
-
"refutes",
|
|
300324
|
-
"evidences",
|
|
300325
|
-
"verified_by",
|
|
300326
|
-
"evidenced_by",
|
|
300327
|
-
"contradicted_by",
|
|
300328
|
-
"blocked_by",
|
|
300329
|
-
"derived_from",
|
|
300330
|
-
"implements",
|
|
300331
|
-
"modifies",
|
|
300332
|
-
"validates",
|
|
300333
|
-
"conflicts_with",
|
|
300334
|
-
"supersedes",
|
|
300335
|
-
"mentions",
|
|
300336
|
-
"governs",
|
|
300337
|
-
"blocks",
|
|
300338
|
-
"assigned_to",
|
|
300339
|
-
"attempts",
|
|
300340
|
-
"invalidates",
|
|
300341
|
-
"resolves",
|
|
300342
|
-
"synthesizes",
|
|
300343
|
-
"replied_to",
|
|
300344
|
-
"reacted_to",
|
|
300345
|
-
"delivered_to",
|
|
300346
|
-
"owned_by",
|
|
300347
|
-
"relates_to"
|
|
300348
|
-
]);
|
|
300349
|
-
var WorkGraphEdgeSchema = z17.object({
|
|
300350
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300351
|
-
edgeId: OperationalWorldIdSchema,
|
|
300352
|
-
sourceNodeId: OperationalWorldIdSchema,
|
|
300353
|
-
targetNodeId: OperationalWorldIdSchema,
|
|
300354
|
-
kind: WorkGraphEdgeKindSchema,
|
|
300355
|
-
directed: z17.boolean(),
|
|
300356
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).min(1).max(256),
|
|
300357
|
-
confidence: ConfidenceSchema,
|
|
300358
|
-
revision: OperationalWorldRevisionSchema,
|
|
300359
|
-
validFrom: z17.string().datetime(),
|
|
300360
|
-
validTo: z17.string().datetime().optional(),
|
|
300361
|
-
scope: OperationalFactScopeSchema,
|
|
300362
|
-
taskEpoch: z17.number().int().nonnegative().optional(),
|
|
300363
|
-
metadataProvenance: OperationalMetadataProvenanceSchema,
|
|
300364
|
-
attributes: z17.record(z17.string(), JsonValueSchema)
|
|
300365
|
-
}).strict().superRefine((edge, ctx) => {
|
|
300366
|
-
if (edge.sourceNodeId === edge.targetNodeId) {
|
|
300367
|
-
ctx.addIssue({
|
|
300368
|
-
code: "custom",
|
|
300369
|
-
path: ["targetNodeId"],
|
|
300370
|
-
message: "self-referential edges are not permitted"
|
|
300371
|
-
});
|
|
300372
|
-
}
|
|
300373
|
-
if (edge.validFrom && edge.validTo && Date.parse(edge.validTo) < Date.parse(edge.validFrom)) {
|
|
300374
|
-
ctx.addIssue({
|
|
300375
|
-
code: "custom",
|
|
300376
|
-
path: ["validTo"],
|
|
300377
|
-
message: "validTo must not precede validFrom"
|
|
300378
|
-
});
|
|
300379
|
-
}
|
|
300380
|
-
if (edge.scope?.taskEpoch !== void 0 && edge.taskEpoch !== void 0 && edge.scope.taskEpoch !== edge.taskEpoch) {
|
|
300381
|
-
ctx.addIssue({
|
|
300382
|
-
code: "custom",
|
|
300383
|
-
path: ["taskEpoch"],
|
|
300384
|
-
message: "taskEpoch must match scope.taskEpoch"
|
|
300385
|
-
});
|
|
300386
|
-
}
|
|
300387
|
-
});
|
|
300388
|
-
function addDuplicateIdIssues(values, path3, ctx) {
|
|
300389
|
-
const seen = /* @__PURE__ */ new Set();
|
|
300390
|
-
for (let index = 0; index < values.length; index++) {
|
|
300391
|
-
const value = values[index];
|
|
300392
|
-
if (seen.has(value)) {
|
|
300393
|
-
ctx.addIssue({
|
|
300394
|
-
code: "custom",
|
|
300395
|
-
path: [path3, index],
|
|
300396
|
-
message: `duplicate identifier: ${value}`
|
|
300397
|
-
});
|
|
300398
|
-
}
|
|
300399
|
-
seen.add(value);
|
|
300400
|
-
}
|
|
300401
|
-
}
|
|
300402
|
-
function validateGraphCollections(value, ctx) {
|
|
300403
|
-
addDuplicateIdIssues(value.nodes.map((item) => item.nodeId), "nodes", ctx);
|
|
300404
|
-
addDuplicateIdIssues(value.edges.map((item) => item.edgeId), "edges", ctx);
|
|
300405
|
-
addDuplicateIdIssues(value.sourceBindings.map((item) => item.bindingId), "sourceBindings", ctx);
|
|
300406
|
-
addDuplicateIdIssues(value.evidenceRefs.map((item) => item.evidenceId), "evidenceRefs", ctx);
|
|
300407
|
-
addDuplicateIdIssues(value.claims.map((item) => item.claimId), "claims", ctx);
|
|
300408
|
-
addDuplicateIdIssues(value.conflicts.map((item) => item.conflictId), "conflicts", ctx);
|
|
300409
|
-
const nodeIds = new Set(value.nodes.map((item) => item.nodeId));
|
|
300410
|
-
const bindingIds = new Set(value.sourceBindings.map((item) => item.bindingId));
|
|
300411
|
-
const evidenceIds = new Set(value.evidenceRefs.map((item) => item.evidenceId));
|
|
300412
|
-
const claimIds = new Set(value.claims.map((item) => item.claimId));
|
|
300413
|
-
const conflictIds = new Set(value.conflicts.map((item) => item.conflictId));
|
|
300414
|
-
value.nodes.forEach((node, index) => {
|
|
300415
|
-
if (node.parentNodeId && !nodeIds.has(node.parentNodeId)) {
|
|
300416
|
-
ctx.addIssue({
|
|
300417
|
-
code: "custom",
|
|
300418
|
-
path: ["nodes", index, "parentNodeId"],
|
|
300419
|
-
message: `unknown parent node: ${node.parentNodeId}`
|
|
300420
|
-
});
|
|
300421
|
-
}
|
|
300422
|
-
node.bindingIds.forEach((id2) => {
|
|
300423
|
-
if (!bindingIds.has(id2)) {
|
|
300424
|
-
ctx.addIssue({
|
|
300425
|
-
code: "custom",
|
|
300426
|
-
path: ["nodes", index, "bindingIds"],
|
|
300427
|
-
message: `unknown source binding: ${id2}`
|
|
300428
|
-
});
|
|
300429
|
-
}
|
|
300430
|
-
});
|
|
300431
|
-
node.evidenceRefIds.forEach((id2) => {
|
|
300432
|
-
if (!evidenceIds.has(id2)) {
|
|
300433
|
-
ctx.addIssue({
|
|
300434
|
-
code: "custom",
|
|
300435
|
-
path: ["nodes", index, "evidenceRefIds"],
|
|
300436
|
-
message: `unknown evidence reference: ${id2}`
|
|
300437
|
-
});
|
|
300438
|
-
}
|
|
300439
|
-
});
|
|
300440
|
-
if (node.reference?.type === "claim" && !claimIds.has(node.reference.claimId)) {
|
|
300441
|
-
ctx.addIssue({
|
|
300442
|
-
code: "custom",
|
|
300443
|
-
path: ["nodes", index, "reference", "claimId"],
|
|
300444
|
-
message: `unknown claim: ${node.reference.claimId}`
|
|
300445
|
-
});
|
|
300446
|
-
}
|
|
300447
|
-
if (node.reference?.type === "conflict" && !conflictIds.has(node.reference.conflictId)) {
|
|
300448
|
-
ctx.addIssue({
|
|
300449
|
-
code: "custom",
|
|
300450
|
-
path: ["nodes", index, "reference", "conflictId"],
|
|
300451
|
-
message: `unknown conflict: ${node.reference.conflictId}`
|
|
300452
|
-
});
|
|
300453
|
-
}
|
|
300454
|
-
if (node.reference?.type === "evidence" && !evidenceIds.has(node.reference.evidenceId)) {
|
|
300455
|
-
ctx.addIssue({
|
|
300456
|
-
code: "custom",
|
|
300457
|
-
path: ["nodes", index, "reference", "evidenceId"],
|
|
300458
|
-
message: `unknown evidence reference: ${node.reference.evidenceId}`
|
|
300459
|
-
});
|
|
300460
|
-
}
|
|
300461
|
-
if (node.reference?.type === "source" && !bindingIds.has(node.reference.bindingId)) {
|
|
300462
|
-
ctx.addIssue({
|
|
300463
|
-
code: "custom",
|
|
300464
|
-
path: ["nodes", index, "reference", "bindingId"],
|
|
300465
|
-
message: `unknown source binding: ${node.reference.bindingId}`
|
|
300466
|
-
});
|
|
300467
|
-
}
|
|
300468
|
-
node.actionContract?.preconditions.forEach((precondition) => {
|
|
300469
|
-
precondition.evidenceRefIds.forEach((id2) => {
|
|
300470
|
-
if (!evidenceIds.has(id2)) {
|
|
300471
|
-
ctx.addIssue({
|
|
300472
|
-
code: "custom",
|
|
300473
|
-
path: ["nodes", index, "actionContract", "preconditions"],
|
|
300474
|
-
message: `unknown precondition evidence reference: ${id2}`
|
|
300475
|
-
});
|
|
300476
|
-
}
|
|
300477
|
-
});
|
|
300478
|
-
});
|
|
300479
|
-
node.actionContract?.mutations.forEach((mutation, mutationIndex) => {
|
|
300480
|
-
const target = mutation.target;
|
|
300481
|
-
const targetExists = target.type === "artifact" || target.type === "node" && nodeIds.has(target.nodeId) || target.type === "claim" && claimIds.has(target.claimId) || target.type === "conflict" && conflictIds.has(target.conflictId) || target.type === "evidence" && evidenceIds.has(target.evidenceId) || target.type === "source" && bindingIds.has(target.bindingId);
|
|
300482
|
-
if (!targetExists) {
|
|
300483
|
-
ctx.addIssue({
|
|
300484
|
-
code: "custom",
|
|
300485
|
-
path: [
|
|
300486
|
-
"nodes",
|
|
300487
|
-
index,
|
|
300488
|
-
"actionContract",
|
|
300489
|
-
"mutations",
|
|
300490
|
-
mutationIndex,
|
|
300491
|
-
"target"
|
|
300492
|
-
],
|
|
300493
|
-
message: "action mutation target is absent from the graph"
|
|
300494
|
-
});
|
|
300495
|
-
}
|
|
300496
|
-
});
|
|
300497
|
-
});
|
|
300498
|
-
value.edges.forEach((edge, index) => {
|
|
300499
|
-
if (!nodeIds.has(edge.sourceNodeId)) {
|
|
300500
|
-
ctx.addIssue({
|
|
300501
|
-
code: "custom",
|
|
300502
|
-
path: ["edges", index, "sourceNodeId"],
|
|
300503
|
-
message: `unknown source node: ${edge.sourceNodeId}`
|
|
300504
|
-
});
|
|
300505
|
-
}
|
|
300506
|
-
if (!nodeIds.has(edge.targetNodeId)) {
|
|
300507
|
-
ctx.addIssue({
|
|
300508
|
-
code: "custom",
|
|
300509
|
-
path: ["edges", index, "targetNodeId"],
|
|
300510
|
-
message: `unknown target node: ${edge.targetNodeId}`
|
|
300511
|
-
});
|
|
300512
|
-
}
|
|
300513
|
-
edge.evidenceRefIds.forEach((id2) => {
|
|
300514
|
-
if (!evidenceIds.has(id2)) {
|
|
300515
|
-
ctx.addIssue({
|
|
300516
|
-
code: "custom",
|
|
300517
|
-
path: ["edges", index, "evidenceRefIds"],
|
|
300518
|
-
message: `unknown evidence reference: ${id2}`
|
|
300519
|
-
});
|
|
300520
|
-
}
|
|
300521
|
-
});
|
|
300522
|
-
});
|
|
300523
|
-
value.evidenceRefs.forEach((evidence, index) => {
|
|
300524
|
-
if (!bindingIds.has(evidence.bindingId)) {
|
|
300525
|
-
ctx.addIssue({
|
|
300526
|
-
code: "custom",
|
|
300527
|
-
path: ["evidenceRefs", index, "bindingId"],
|
|
300528
|
-
message: `unknown source binding: ${evidence.bindingId}`
|
|
300529
|
-
});
|
|
300530
|
-
}
|
|
300531
|
-
});
|
|
300532
|
-
value.claims.forEach((claim, index) => {
|
|
300533
|
-
if (claim.subjectNodeId && !nodeIds.has(claim.subjectNodeId)) {
|
|
300534
|
-
ctx.addIssue({
|
|
300535
|
-
code: "custom",
|
|
300536
|
-
path: ["claims", index, "subjectNodeId"],
|
|
300537
|
-
message: `unknown claim subject node: ${claim.subjectNodeId}`
|
|
300538
|
-
});
|
|
300539
|
-
}
|
|
300540
|
-
claim.evidenceRefIds.forEach((id2) => {
|
|
300541
|
-
if (!evidenceIds.has(id2)) {
|
|
300542
|
-
ctx.addIssue({
|
|
300543
|
-
code: "custom",
|
|
300544
|
-
path: ["claims", index, "evidenceRefIds"],
|
|
300545
|
-
message: `unknown evidence reference: ${id2}`
|
|
300546
|
-
});
|
|
300547
|
-
}
|
|
300548
|
-
});
|
|
300549
|
-
claim.dependsOnClaimIds.forEach((id2) => {
|
|
300550
|
-
if (!claimIds.has(id2)) {
|
|
300551
|
-
ctx.addIssue({
|
|
300552
|
-
code: "custom",
|
|
300553
|
-
path: ["claims", index, "dependsOnClaimIds"],
|
|
300554
|
-
message: `unknown claim dependency: ${id2}`
|
|
300555
|
-
});
|
|
300556
|
-
}
|
|
300557
|
-
});
|
|
300558
|
-
});
|
|
300559
|
-
value.conflicts.forEach((conflict, index) => {
|
|
300560
|
-
conflict.claimIds.forEach((id2) => {
|
|
300561
|
-
if (!claimIds.has(id2)) {
|
|
300562
|
-
ctx.addIssue({
|
|
300563
|
-
code: "custom",
|
|
300564
|
-
path: ["conflicts", index, "claimIds"],
|
|
300565
|
-
message: `unknown conflict claim: ${id2}`
|
|
300566
|
-
});
|
|
300567
|
-
}
|
|
300568
|
-
});
|
|
300569
|
-
conflict.evidenceRefIds.forEach((id2) => {
|
|
300570
|
-
if (!evidenceIds.has(id2)) {
|
|
300571
|
-
ctx.addIssue({
|
|
300572
|
-
code: "custom",
|
|
300573
|
-
path: ["conflicts", index, "evidenceRefIds"],
|
|
300574
|
-
message: `unknown evidence reference: ${id2}`
|
|
300575
|
-
});
|
|
300576
|
-
}
|
|
300577
|
-
});
|
|
300578
|
-
conflict.resolution?.evidenceRefIds.forEach((id2) => {
|
|
300579
|
-
if (!evidenceIds.has(id2)) {
|
|
300580
|
-
ctx.addIssue({
|
|
300581
|
-
code: "custom",
|
|
300582
|
-
path: ["conflicts", index, "resolution", "evidenceRefIds"],
|
|
300583
|
-
message: `unknown resolution evidence reference: ${id2}`
|
|
300584
|
-
});
|
|
300585
|
-
}
|
|
300586
|
-
});
|
|
300587
|
-
});
|
|
300588
|
-
}
|
|
300589
|
-
var WorkGraphSchema = z17.object({
|
|
300590
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300591
|
-
graphId: OperationalWorldIdSchema,
|
|
300592
|
-
revision: OperationalWorldRevisionSchema,
|
|
300593
|
-
previousRevision: OperationalWorldRevisionSchema.optional(),
|
|
300594
|
-
title: z17.string().trim().min(1).max(1e3),
|
|
300595
|
-
nodes: z17.array(WorkGraphNodeSchema).max(1e5),
|
|
300596
|
-
edges: z17.array(WorkGraphEdgeSchema).max(25e4),
|
|
300597
|
-
sourceBindings: z17.array(SourceBindingSchema).max(1e5),
|
|
300598
|
-
evidenceRefs: z17.array(EvidenceRefSchema).max(25e4),
|
|
300599
|
-
claims: z17.array(ClaimSchema).max(1e5),
|
|
300600
|
-
conflicts: z17.array(ConflictSchema).max(1e5),
|
|
300601
|
-
createdAt: z17.string().datetime(),
|
|
300602
|
-
updatedAt: z17.string().datetime()
|
|
300603
|
-
}).strict().superRefine(validateGraphCollections);
|
|
300604
|
-
var WorldPatchOperationSchema = z17.discriminatedUnion("op", [
|
|
300605
|
-
z17.object({ op: z17.literal("upsert_node"), node: WorkGraphNodeSchema }).strict(),
|
|
300606
|
-
z17.object({
|
|
300607
|
-
op: z17.literal("remove_node"),
|
|
300608
|
-
nodeId: OperationalWorldIdSchema,
|
|
300609
|
-
cascade: z17.boolean()
|
|
300610
|
-
}).strict(),
|
|
300611
|
-
z17.object({ op: z17.literal("upsert_edge"), edge: WorkGraphEdgeSchema }).strict(),
|
|
300612
|
-
z17.object({ op: z17.literal("remove_edge"), edgeId: OperationalWorldIdSchema }).strict(),
|
|
300613
|
-
z17.object({
|
|
300614
|
-
op: z17.literal("upsert_source_binding"),
|
|
300615
|
-
sourceBinding: SourceBindingSchema
|
|
300616
|
-
}).strict(),
|
|
300617
|
-
z17.object({
|
|
300618
|
-
op: z17.literal("remove_source_binding"),
|
|
300619
|
-
bindingId: OperationalWorldIdSchema
|
|
300620
|
-
}).strict(),
|
|
300621
|
-
z17.object({
|
|
300622
|
-
op: z17.literal("upsert_evidence_ref"),
|
|
300623
|
-
evidenceRef: EvidenceRefSchema
|
|
300624
|
-
}).strict(),
|
|
300625
|
-
z17.object({
|
|
300626
|
-
op: z17.literal("remove_evidence_ref"),
|
|
300627
|
-
evidenceId: OperationalWorldIdSchema
|
|
300628
|
-
}).strict(),
|
|
300629
|
-
z17.object({ op: z17.literal("upsert_claim"), claim: ClaimSchema }).strict(),
|
|
300630
|
-
z17.object({
|
|
300631
|
-
op: z17.literal("remove_claim"),
|
|
300632
|
-
claimId: OperationalWorldIdSchema
|
|
300633
|
-
}).strict(),
|
|
300634
|
-
z17.object({ op: z17.literal("upsert_conflict"), conflict: ConflictSchema }).strict(),
|
|
300635
|
-
z17.object({
|
|
300636
|
-
op: z17.literal("remove_conflict"),
|
|
300637
|
-
conflictId: OperationalWorldIdSchema
|
|
300638
|
-
}).strict()
|
|
300639
|
-
]);
|
|
300640
|
-
var WorldPatchSchema = z17.object({
|
|
300641
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300642
|
-
patchId: OperationalWorldIdSchema,
|
|
300643
|
-
graphId: OperationalWorldIdSchema,
|
|
300644
|
-
/** Optimistic-concurrency precondition. */
|
|
300645
|
-
baseRevision: OperationalWorldRevisionSchema,
|
|
300646
|
-
targetRevision: OperationalWorldRevisionSchema,
|
|
300647
|
-
operations: z17.array(WorldPatchOperationSchema).min(1).max(1e4),
|
|
300648
|
-
rationale: z17.string().trim().min(1).max(4e3),
|
|
300649
|
-
createdBy: z17.string().trim().min(1).max(256),
|
|
300650
|
-
createdAt: z17.string().datetime()
|
|
300651
|
-
}).strict().superRefine((patch, ctx) => {
|
|
300652
|
-
if (patch.baseRevision === patch.targetRevision) {
|
|
300653
|
-
ctx.addIssue({
|
|
300654
|
-
code: "custom",
|
|
300655
|
-
path: ["targetRevision"],
|
|
300656
|
-
message: "targetRevision must differ from baseRevision"
|
|
300657
|
-
});
|
|
300658
|
-
}
|
|
300659
|
-
});
|
|
300660
|
-
var ValidationIssueSeveritySchema = z17.enum([
|
|
300661
|
-
"info",
|
|
300662
|
-
"warning",
|
|
300663
|
-
"error"
|
|
300664
|
-
]);
|
|
300665
|
-
var OperationalValidationIssueSchema = z17.object({
|
|
300666
|
-
code: z17.string().trim().min(1).max(128),
|
|
300667
|
-
severity: ValidationIssueSeveritySchema,
|
|
300668
|
-
message: z17.string().trim().min(1).max(4e3),
|
|
300669
|
-
path: z17.array(z17.union([z17.string(), z17.number().int().nonnegative()])).max(64),
|
|
300670
|
-
nodeId: OperationalWorldIdSchema.optional(),
|
|
300671
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).max(256)
|
|
300672
|
-
}).strict();
|
|
300673
|
-
var OperationalValidationStatusSchema = z17.enum([
|
|
300674
|
-
"pass",
|
|
300675
|
-
"fail",
|
|
300676
|
-
"partial"
|
|
300677
|
-
]);
|
|
300678
|
-
var OperationalValidationResultSchema = z17.object({
|
|
300679
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300680
|
-
valid: z17.boolean(),
|
|
300681
|
-
status: OperationalValidationStatusSchema,
|
|
300682
|
-
checkedRevision: OperationalWorldRevisionSchema,
|
|
300683
|
-
issues: z17.array(OperationalValidationIssueSchema).max(1e4),
|
|
300684
|
-
checkedAt: z17.string().datetime()
|
|
300685
|
-
}).strict().superRefine((result, ctx) => {
|
|
300686
|
-
const hasErrors = result.issues.some((issue2) => issue2.severity === "error");
|
|
300687
|
-
if (result.valid !== (result.status === "pass")) {
|
|
300688
|
-
ctx.addIssue({
|
|
300689
|
-
code: "custom",
|
|
300690
|
-
path: ["valid"],
|
|
300691
|
-
message: "valid must be true exactly when status is pass"
|
|
300692
|
-
});
|
|
300693
|
-
}
|
|
300694
|
-
if (result.status === "pass" && hasErrors) {
|
|
300695
|
-
ctx.addIssue({
|
|
300696
|
-
code: "custom",
|
|
300697
|
-
path: ["issues"],
|
|
300698
|
-
message: "a passing result cannot contain error issues"
|
|
300699
|
-
});
|
|
300700
|
-
}
|
|
300701
|
-
if (result.status === "fail" && !hasErrors) {
|
|
300702
|
-
ctx.addIssue({
|
|
300703
|
-
code: "custom",
|
|
300704
|
-
path: ["issues"],
|
|
300705
|
-
message: "a failing result must contain at least one error issue"
|
|
300706
|
-
});
|
|
300707
|
-
}
|
|
300708
|
-
});
|
|
300709
|
-
var ValidationArtifactHashSchema = z17.object({
|
|
300710
|
-
uri: z17.string().trim().min(1).max(4096),
|
|
300711
|
-
algorithm: z17.enum(["sha256", "sha512", "blake3"]),
|
|
300712
|
-
digest: z17.string().trim().min(1).max(512)
|
|
300713
|
-
}).strict();
|
|
300714
|
-
var OperationalValidationReceiptSchema = z17.object({
|
|
300715
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300716
|
-
receiptId: OperationalWorldIdSchema,
|
|
300717
|
-
graphId: OperationalWorldIdSchema,
|
|
300718
|
-
patchId: OperationalWorldIdSchema.optional(),
|
|
300719
|
-
baseRevision: OperationalWorldRevisionSchema,
|
|
300720
|
-
resultRevision: OperationalWorldRevisionSchema,
|
|
300721
|
-
validator: z17.object({
|
|
300722
|
-
name: z17.string().trim().min(1).max(256),
|
|
300723
|
-
version: z17.string().trim().min(1).max(128)
|
|
300724
|
-
}).strict(),
|
|
300725
|
-
startedAt: z17.string().datetime(),
|
|
300726
|
-
finishedAt: z17.string().datetime(),
|
|
300727
|
-
result: OperationalValidationResultSchema,
|
|
300728
|
-
evidenceRefIds: z17.array(OperationalWorldIdSchema).max(1e4),
|
|
300729
|
-
artifactHashes: z17.array(ValidationArtifactHashSchema).max(1e4)
|
|
300730
|
-
}).strict().superRefine((receipt, ctx) => {
|
|
300731
|
-
if (receipt.result.checkedRevision !== receipt.resultRevision) {
|
|
300732
|
-
ctx.addIssue({
|
|
300733
|
-
code: "custom",
|
|
300734
|
-
path: ["result", "checkedRevision"],
|
|
300735
|
-
message: "checkedRevision must equal resultRevision"
|
|
300736
|
-
});
|
|
300737
|
-
}
|
|
300738
|
-
if (Date.parse(receipt.finishedAt) < Date.parse(receipt.startedAt)) {
|
|
300739
|
-
ctx.addIssue({
|
|
300740
|
-
code: "custom",
|
|
300741
|
-
path: ["finishedAt"],
|
|
300742
|
-
message: "finishedAt must not precede startedAt"
|
|
300743
|
-
});
|
|
300744
|
-
}
|
|
300745
|
-
});
|
|
300746
|
-
var ReasoningSliceSelectionSchema = z17.object({
|
|
300747
|
-
strategy: z17.enum(["exact", "lexical", "semantic", "graph", "hybrid"]),
|
|
300748
|
-
graphHops: z17.number().int().nonnegative().max(32),
|
|
300749
|
-
maxCharacters: z17.number().int().positive(),
|
|
300750
|
-
truncated: z17.boolean(),
|
|
300751
|
-
omissions: z17.array(z17.string().trim().min(1).max(1e3)).max(256),
|
|
300752
|
-
evidenceRoles: z17.array(EvidenceRoleSchema).max(5)
|
|
300753
|
-
}).strict();
|
|
300754
|
-
var ReasoningSliceSchema = z17.object({
|
|
300755
|
-
schemaVersion: OperationalWorldSchemaVersionSchema,
|
|
300756
|
-
sliceId: OperationalWorldIdSchema,
|
|
300757
|
-
graphId: OperationalWorldIdSchema,
|
|
300758
|
-
revision: OperationalWorldRevisionSchema,
|
|
300759
|
-
objective: z17.string().trim().min(1).max(4e3),
|
|
300760
|
-
focusNodeIds: z17.array(OperationalWorldIdSchema).min(1).max(256),
|
|
300761
|
-
nodes: z17.array(WorkGraphNodeSchema).max(1e4),
|
|
300762
|
-
edges: z17.array(WorkGraphEdgeSchema).max(25e3),
|
|
300763
|
-
sourceBindings: z17.array(SourceBindingSchema).max(1e4),
|
|
300764
|
-
evidenceRefs: z17.array(EvidenceRefSchema).max(25e3),
|
|
300765
|
-
claims: z17.array(ClaimSchema).max(1e4),
|
|
300766
|
-
conflicts: z17.array(ConflictSchema).max(1e4),
|
|
300767
|
-
selection: ReasoningSliceSelectionSchema,
|
|
300768
|
-
generatedAt: z17.string().datetime()
|
|
300769
|
-
}).strict().superRefine((slice, ctx) => {
|
|
300770
|
-
validateGraphCollections(slice, ctx);
|
|
300771
|
-
const nodeIds = new Set(slice.nodes.map((node) => node.nodeId));
|
|
300772
|
-
slice.focusNodeIds.forEach((nodeId, index) => {
|
|
300773
|
-
if (!nodeIds.has(nodeId)) {
|
|
300774
|
-
ctx.addIssue({
|
|
300775
|
-
code: "custom",
|
|
300776
|
-
path: ["focusNodeIds", index],
|
|
300777
|
-
message: `focus node is absent from the reasoning slice: ${nodeId}`
|
|
300778
|
-
});
|
|
300779
|
-
}
|
|
300780
|
-
});
|
|
300909
|
+
var hookSchema = z17.nativeEnum(PluginHook);
|
|
300910
|
+
var manifestSchema = z17.object({
|
|
300911
|
+
name: z17.string().min(1, "Plugin name is required").regex(/^[a-z0-9_-]+$/, "Plugin name must be lowercase alphanumeric with hyphens/underscores"),
|
|
300912
|
+
version: z17.string().min(1, "Plugin version is required"),
|
|
300913
|
+
description: z17.string().default(""),
|
|
300914
|
+
author: z17.string().default(""),
|
|
300915
|
+
hooks: z17.array(hookSchema).default([]),
|
|
300916
|
+
dependencies: z17.array(z17.string()).default([]),
|
|
300917
|
+
source: z17.enum(["user", "project", "npm"]),
|
|
300918
|
+
path: z17.string().optional()
|
|
300781
300919
|
});
|
|
300782
300920
|
|
|
300921
|
+
// packages/orchestrator/dist/taskNormalizer.js
|
|
300922
|
+
init_dist();
|
|
300923
|
+
|
|
300783
300924
|
// packages/orchestrator/dist/promptLoader.js
|
|
300784
300925
|
import { readFileSync as readFileSync4, existsSync as existsSync4 } from "node:fs";
|
|
300785
300926
|
import { join as join13, dirname as dirname7, resolve as resolve10, sep as sep2 } from "node:path";
|
|
@@ -300817,11 +300958,26 @@ function loadPrompt(promptPath, vars) {
|
|
|
300817
300958
|
return content.replace(/\{\{(\w+)\}\}/g, (_, key) => vars[key] ?? `{{${key}}}`);
|
|
300818
300959
|
}
|
|
300819
300960
|
|
|
300961
|
+
// packages/orchestrator/dist/dispatcher.js
|
|
300962
|
+
init_dist();
|
|
300963
|
+
|
|
300964
|
+
// packages/orchestrator/dist/plannerRunner.js
|
|
300965
|
+
init_dist();
|
|
300966
|
+
|
|
300967
|
+
// packages/orchestrator/dist/scoutRunner.js
|
|
300968
|
+
init_dist();
|
|
300969
|
+
|
|
300970
|
+
// packages/orchestrator/dist/editorRunner.js
|
|
300971
|
+
init_dist();
|
|
300972
|
+
|
|
300973
|
+
// packages/orchestrator/dist/verifierRunner.js
|
|
300974
|
+
init_dist();
|
|
300975
|
+
|
|
300820
300976
|
// packages/orchestrator/dist/terminalTaskReport.js
|
|
300821
|
-
|
|
300977
|
+
init_dist4();
|
|
300822
300978
|
|
|
300823
300979
|
// packages/orchestrator/dist/liveVirtualContext.js
|
|
300824
|
-
|
|
300980
|
+
init_dist2();
|
|
300825
300981
|
|
|
300826
300982
|
// packages/orchestrator/dist/live-memory-passages.js
|
|
300827
300983
|
var stopWords = new Set("a an and are as at be by can do for from has have how i in is it its me my of on or our please that the their them these they this those to us was we what when where which who will with you your".split(" "));
|
|
@@ -300891,7 +301047,7 @@ var RERANK_SYSTEM = [
|
|
|
300891
301047
|
].join(" ");
|
|
300892
301048
|
|
|
300893
301049
|
// packages/orchestrator/dist/structuredMemoryInference.js
|
|
300894
|
-
|
|
301050
|
+
init_dist2();
|
|
300895
301051
|
var EXTRACTION_SYSTEM = [
|
|
300896
301052
|
"You classify durable structured memory from exact user-authored source chunks.",
|
|
300897
301053
|
"This is a semantic inference task: extract only information that will matter beyond the immediate wording.",
|
|
@@ -301039,16 +301195,23 @@ var pendingSchema = z19.object({
|
|
|
301039
301195
|
expectedEntryCount: integer2.nonnegative()
|
|
301040
301196
|
}).strict();
|
|
301041
301197
|
|
|
301198
|
+
// packages/orchestrator/dist/agenticRunner.js
|
|
301199
|
+
init_dist();
|
|
301200
|
+
|
|
301201
|
+
// packages/orchestrator/dist/featureWorkflowRunnerBoundary.js
|
|
301202
|
+
init_dist();
|
|
301203
|
+
|
|
301042
301204
|
// packages/orchestrator/dist/featureWorkflow.js
|
|
301205
|
+
init_dist();
|
|
301206
|
+
init_dist4();
|
|
301043
301207
|
import { z as z20 } from "zod";
|
|
301044
|
-
init_dist3();
|
|
301045
301208
|
|
|
301046
301209
|
// packages/orchestrator/dist/contentAddressedArtifactStore.js
|
|
301047
301210
|
var DEFAULT_MAX_ARTIFACT_BYTES = 32 * 1024 * 1024;
|
|
301048
301211
|
var DEFAULT_MAX_STORE_BYTES = 512 * 1024 * 1024;
|
|
301049
301212
|
|
|
301050
301213
|
// packages/orchestrator/dist/verificationCommand.js
|
|
301051
|
-
|
|
301214
|
+
init_dist4();
|
|
301052
301215
|
|
|
301053
301216
|
// packages/orchestrator/dist/featureWorkflow.js
|
|
301054
301217
|
var SCHEMA2 = "omnius.feature-workflow-checkpoint.v1";
|
|
@@ -301332,8 +301495,17 @@ var activeSchema = z22.object({
|
|
|
301332
301495
|
evidence: z22.object({ phases: z22.number().int().min(1).max(3), calls: z22.array(call).min(1).max(12) }).optional()
|
|
301333
301496
|
});
|
|
301334
301497
|
|
|
301498
|
+
// packages/orchestrator/dist/operational-world/reducer.js
|
|
301499
|
+
init_dist();
|
|
301500
|
+
|
|
301501
|
+
// packages/orchestrator/dist/operational-world/persistence.js
|
|
301502
|
+
init_dist();
|
|
301503
|
+
|
|
301504
|
+
// packages/orchestrator/dist/operational-world/reasoningSlice.js
|
|
301505
|
+
init_dist();
|
|
301506
|
+
|
|
301335
301507
|
// packages/orchestrator/dist/verificationInvocation.js
|
|
301336
|
-
|
|
301508
|
+
init_dist4();
|
|
301337
301509
|
|
|
301338
301510
|
// packages/orchestrator/dist/agenticRunner.js
|
|
301339
301511
|
import { z as z24 } from "zod";
|
|
@@ -301357,7 +301529,7 @@ var PERSONALITY_PRESETS = {
|
|
|
301357
301529
|
var PRESET_NAMES = Object.keys(PERSONALITY_PRESETS);
|
|
301358
301530
|
|
|
301359
301531
|
// packages/orchestrator/dist/phase-skill-guidance.js
|
|
301360
|
-
|
|
301532
|
+
init_dist4();
|
|
301361
301533
|
|
|
301362
301534
|
// packages/orchestrator/dist/deliveryCoverage.js
|
|
301363
301535
|
import { z as z23 } from "zod";
|
|
@@ -301443,19 +301615,19 @@ var deliveryCoverageManifestSchema = z23.object({
|
|
|
301443
301615
|
});
|
|
301444
301616
|
|
|
301445
301617
|
// packages/orchestrator/dist/agenticRunner.js
|
|
301446
|
-
|
|
301447
|
-
|
|
301618
|
+
init_dist4();
|
|
301619
|
+
init_dist2();
|
|
301448
301620
|
|
|
301449
301621
|
// packages/orchestrator/dist/taskHandoff.js
|
|
301450
|
-
|
|
301622
|
+
init_dist4();
|
|
301451
301623
|
var DEFAULT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
301452
301624
|
|
|
301453
301625
|
// packages/orchestrator/dist/codeGraphLink.js
|
|
301454
|
-
|
|
301626
|
+
init_dist4();
|
|
301455
301627
|
|
|
301456
301628
|
// packages/orchestrator/dist/agenticRunner.js
|
|
301457
|
-
|
|
301458
|
-
|
|
301629
|
+
init_dist4();
|
|
301630
|
+
init_dist4();
|
|
301459
301631
|
|
|
301460
301632
|
// packages/orchestrator/dist/backend-stall-policy.js
|
|
301461
301633
|
var DEFAULT_BACKEND_STALL_LIMITS = {
|
|
@@ -301464,31 +301636,31 @@ var DEFAULT_BACKEND_STALL_LIMITS = {
|
|
|
301464
301636
|
};
|
|
301465
301637
|
|
|
301466
301638
|
// packages/orchestrator/dist/failure-resolution-transaction.js
|
|
301467
|
-
|
|
301639
|
+
init_dist4();
|
|
301468
301640
|
|
|
301469
301641
|
// packages/orchestrator/dist/contextWindowDump.js
|
|
301470
|
-
|
|
301642
|
+
init_dist2();
|
|
301471
301643
|
var DEFAULT_INDEX_MAX_BYTES = 2 * 1024 * 1024;
|
|
301472
301644
|
|
|
301473
301645
|
// packages/orchestrator/dist/decomposition-orchestrator.js
|
|
301474
|
-
|
|
301646
|
+
init_dist4();
|
|
301475
301647
|
|
|
301476
301648
|
// packages/orchestrator/dist/longhaul-integration.js
|
|
301477
|
-
|
|
301478
|
-
|
|
301479
|
-
|
|
301649
|
+
init_dist4();
|
|
301650
|
+
init_dist2();
|
|
301651
|
+
init_dist2();
|
|
301480
301652
|
|
|
301481
301653
|
// packages/orchestrator/dist/contextSNR.js
|
|
301482
|
-
|
|
301654
|
+
init_dist2();
|
|
301483
301655
|
|
|
301484
301656
|
// packages/orchestrator/dist/corpus-native-source-proof-memo.js
|
|
301485
|
-
|
|
301657
|
+
init_dist2();
|
|
301486
301658
|
|
|
301487
301659
|
// packages/orchestrator/dist/corpus-page-review-source.js
|
|
301488
|
-
|
|
301660
|
+
init_dist2();
|
|
301489
301661
|
|
|
301490
301662
|
// packages/orchestrator/dist/contextEngine.js
|
|
301491
|
-
|
|
301663
|
+
init_dist2();
|
|
301492
301664
|
|
|
301493
301665
|
// packages/orchestrator/dist/agenticRunner.js
|
|
301494
301666
|
var SYSTEM_PROMPT_COMMON = `${STE_COMMUNICATION_POLICY}
|
|
@@ -301599,7 +301771,7 @@ function brokerAdmissionFailureResponse(err) {
|
|
|
301599
301771
|
}
|
|
301600
301772
|
|
|
301601
301773
|
// packages/orchestrator/dist/memory-compiler-replay.js
|
|
301602
|
-
|
|
301774
|
+
init_dist2();
|
|
301603
301775
|
|
|
301604
301776
|
// packages/orchestrator/dist/index.js
|
|
301605
301777
|
init_ollama_pool();
|
|
@@ -302733,7 +302905,7 @@ var SENSITIVE_HOME_FILES = [
|
|
|
302733
302905
|
];
|
|
302734
302906
|
|
|
302735
302907
|
// packages/orchestrator/dist/subagent-prompt.js
|
|
302736
|
-
|
|
302908
|
+
init_dist4();
|
|
302737
302909
|
var WORKER_PREAMBLE = [
|
|
302738
302910
|
"You are an isolated sub-agent with a deliberately small context and a single,",
|
|
302739
302911
|
"bounded purpose. You were spawned by an orchestrator that holds the overall",
|