voratiq 0.1.0-beta.20 → 0.1.0-beta.21
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/agents/runtime/policy.d.ts +1 -1
- package/dist/bin.js +50 -19
- package/dist/cli/contract.d.ts +35 -5
- package/dist/cli/contract.js +42 -5
- package/dist/cli/list.js +4 -1
- package/dist/cli/message.d.ts +28 -0
- package/dist/cli/message.js +147 -0
- package/dist/cli/operator-envelope.d.ts +22 -1
- package/dist/cli/operator-envelope.js +48 -3
- package/dist/cli/reduce.js +5 -2
- package/dist/cli/verify.js +6 -2
- package/dist/commands/list/command.d.ts +1 -0
- package/dist/commands/list/command.js +117 -7
- package/dist/commands/message/command.d.ts +23 -0
- package/dist/commands/message/command.js +215 -0
- package/dist/commands/message/errors.d.ts +9 -0
- package/dist/commands/message/errors.js +20 -0
- package/dist/commands/message/lifecycle.d.ts +14 -0
- package/dist/commands/message/lifecycle.js +128 -0
- package/dist/commands/reduce/command.d.ts +1 -0
- package/dist/commands/reduce/command.js +3 -1
- package/dist/commands/reduce/targets.d.ts +1 -0
- package/dist/commands/reduce/targets.js +48 -2
- package/dist/commands/shared/resolve-stage-competitors.js +4 -1
- package/dist/commands/verify/command.d.ts +1 -0
- package/dist/commands/verify/command.js +2 -1
- package/dist/commands/verify/max-parallel.d.ts +1 -1
- package/dist/commands/verify/max-parallel.js +3 -1
- package/dist/commands/verify/targets.d.ts +2 -1
- package/dist/commands/verify/targets.js +154 -22
- package/dist/configs/agents/defaults.js +25 -25
- package/dist/configs/orchestration/bootstrap.d.ts +6 -1
- package/dist/configs/orchestration/bootstrap.js +27 -6
- package/dist/configs/orchestration/types.d.ts +25 -10
- package/dist/configs/orchestration/types.js +10 -6
- package/dist/configs/verification/types.d.ts +5 -0
- package/dist/configs/verification/types.js +3 -0
- package/dist/contracts/list.d.ts +38 -4
- package/dist/contracts/list.js +30 -1
- package/dist/domain/message/competition/adapter.d.ts +36 -0
- package/dist/domain/message/competition/adapter.js +197 -0
- package/dist/domain/message/competition/prompt.d.ts +8 -0
- package/dist/domain/message/competition/prompt.js +29 -0
- package/dist/domain/message/model/mutators.d.ts +17 -0
- package/dist/domain/message/model/mutators.js +107 -0
- package/dist/domain/message/model/types.d.ts +100 -0
- package/dist/domain/message/model/types.js +87 -0
- package/dist/domain/message/persistence/adapter.d.ts +43 -0
- package/dist/domain/message/persistence/adapter.js +124 -0
- package/dist/domain/reduce/competition/adapter.d.ts +1 -0
- package/dist/domain/reduce/competition/adapter.js +57 -4
- package/dist/domain/reduce/competition/prompt.d.ts +1 -1
- package/dist/domain/reduce/model/types.d.ts +3 -0
- package/dist/domain/reduce/model/types.js +2 -1
- package/dist/domain/verify/competition/adapter.js +8 -5
- package/dist/domain/verify/competition/programmatic.js +3 -0
- package/dist/domain/verify/competition/prompt.js +6 -0
- package/dist/domain/verify/competition/rubric.js +7 -1
- package/dist/domain/verify/competition/shared-layout.d.ts +42 -2
- package/dist/domain/verify/competition/shared-layout.js +92 -21
- package/dist/domain/verify/competition/target.d.ts +17 -0
- package/dist/domain/verify/model/types.d.ts +20 -2
- package/dist/domain/verify/model/types.js +15 -2
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.js +30 -13
- package/dist/policy/verification.js +2 -0
- package/dist/preflight/index.d.ts +2 -0
- package/dist/preflight/index.js +3 -1
- package/dist/render/transcripts/list.d.ts +2 -0
- package/dist/render/transcripts/list.js +24 -0
- package/dist/render/transcripts/message.d.ts +72 -0
- package/dist/render/transcripts/message.js +362 -0
- package/dist/render/transcripts/stage-progress.d.ts +1 -1
- package/dist/render/transcripts/verify.d.ts +4 -0
- package/dist/render/transcripts/verify.js +7 -1
- package/dist/render/utils/transcript-shell.d.ts +1 -1
- package/dist/render/utils/transcript-shell.js +6 -0
- package/dist/status/index.d.ts +21 -0
- package/dist/status/index.js +30 -0
- package/dist/workspace/setup.js +13 -7
- package/dist/workspace/structure.d.ts +14 -6
- package/dist/workspace/structure.js +25 -9
- package/dist/workspace/verification-defaults.d.ts +1 -1
- package/dist/workspace/verification-defaults.js +255 -0
- package/package.json +15 -16
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
1
2
|
import { CliError, RunNotFoundCliError } from "../../cli/errors.js";
|
|
3
|
+
import { TERMINAL_MESSAGE_STATUSES } from "../../domain/message/model/types.js";
|
|
4
|
+
import { readMessageRecords } from "../../domain/message/persistence/adapter.js";
|
|
2
5
|
import { TERMINAL_REDUCTION_STATUSES } from "../../domain/reduce/model/types.js";
|
|
3
6
|
import { readReductionRecords } from "../../domain/reduce/persistence/adapter.js";
|
|
4
7
|
import { RunRecordNotFoundError } from "../../domain/run/model/errors.js";
|
|
@@ -7,6 +10,7 @@ import { TERMINAL_SPEC_STATUSES } from "../../domain/spec/model/types.js";
|
|
|
7
10
|
import { readSpecRecords } from "../../domain/spec/persistence/adapter.js";
|
|
8
11
|
import { readVerificationRecords } from "../../domain/verify/persistence/adapter.js";
|
|
9
12
|
import { TERMINAL_RUN_STATUSES } from "../../status/index.js";
|
|
13
|
+
import { MESSAGE_RESPONSE_FILENAME } from "../../workspace/structure.js";
|
|
10
14
|
export async function resolveVerifyTarget(input) {
|
|
11
15
|
const { target } = input;
|
|
12
16
|
switch (target.kind) {
|
|
@@ -16,6 +20,8 @@ export async function resolveVerifyTarget(input) {
|
|
|
16
20
|
return resolveRunVerifyTarget(input);
|
|
17
21
|
case "reduce":
|
|
18
22
|
return resolveReductionVerifyTarget(input);
|
|
23
|
+
case "message":
|
|
24
|
+
return resolveMessageVerifyTarget(input);
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
async function resolveSpecVerifyTarget(input) {
|
|
@@ -111,22 +117,76 @@ async function resolveReductionVerifyTarget(input) {
|
|
|
111
117
|
if (!TERMINAL_REDUCTION_STATUSES.includes(record.status)) {
|
|
112
118
|
throw new CliError(`Reduction session \`${target.sessionId}\` is not complete.`, [`Status: \`${record.status}\`.`], ["Wait for the reduction to finish before running `voratiq verify`."]);
|
|
113
119
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
const referenceRepo = await resolveReductionReferenceRepo({
|
|
121
|
+
...input,
|
|
122
|
+
reductionRecord: record,
|
|
123
|
+
});
|
|
124
|
+
const competitiveCandidates = record.reducers
|
|
125
|
+
.filter((reducer) => reducer.status === "succeeded" && reducer.outputPath)
|
|
126
|
+
.map((reducer) => ({
|
|
127
|
+
canonicalId: reducer.agentId,
|
|
128
|
+
forbiddenIdentityTokens: [reducer.agentId],
|
|
129
|
+
}));
|
|
130
|
+
if (referenceRepo.kind === "git") {
|
|
131
|
+
return {
|
|
132
|
+
baseRevisionSha: referenceRepo.baseRevisionSha,
|
|
133
|
+
competitiveCandidates,
|
|
134
|
+
target: {
|
|
135
|
+
kind: "reduce",
|
|
136
|
+
sessionId: record.sessionId,
|
|
137
|
+
},
|
|
117
138
|
reductionRecord: record,
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
canonicalId: reducer.agentId,
|
|
123
|
-
forbiddenIdentityTokens: [reducer.agentId],
|
|
124
|
-
})),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
competitiveCandidates,
|
|
125
143
|
target: {
|
|
126
144
|
kind: "reduce",
|
|
127
145
|
sessionId: record.sessionId,
|
|
128
146
|
},
|
|
129
147
|
reductionRecord: record,
|
|
148
|
+
referenceRepoUnavailable: {
|
|
149
|
+
reason: "message-lineage",
|
|
150
|
+
messageSessionId: referenceRepo.messageSessionId,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async function resolveMessageVerifyTarget(input) {
|
|
155
|
+
const { root, messagesFilePath, target } = input;
|
|
156
|
+
const [record] = await readMessageRecords({
|
|
157
|
+
root,
|
|
158
|
+
messagesFilePath,
|
|
159
|
+
limit: 1,
|
|
160
|
+
predicate: (entry) => entry.sessionId === target.sessionId,
|
|
161
|
+
});
|
|
162
|
+
if (!record) {
|
|
163
|
+
throw new CliError(`Message session \`${target.sessionId}\` not found.`, [], [
|
|
164
|
+
"Re-run `voratiq message` or confirm the session id in `.voratiq/message/index.json`.",
|
|
165
|
+
]);
|
|
166
|
+
}
|
|
167
|
+
if (!TERMINAL_MESSAGE_STATUSES.includes(record.status)) {
|
|
168
|
+
throw new CliError(`Message session \`${target.sessionId}\` is not complete.`, [`Status: \`${record.status}\`.`], [
|
|
169
|
+
"Wait for the message session to finish before running `voratiq verify`.",
|
|
170
|
+
]);
|
|
171
|
+
}
|
|
172
|
+
const recipients = resolveVerifiableMessageRecipients(record);
|
|
173
|
+
if (recipients.length === 0) {
|
|
174
|
+
throw new CliError(`Message session \`${target.sessionId}\` has no verifiable message responses.`, [
|
|
175
|
+
"Verification requires at least one succeeded recipient with a durable `response.md` artifact.",
|
|
176
|
+
], [
|
|
177
|
+
"Re-run `voratiq message` to capture at least one succeeded response before running `voratiq verify`.",
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
competitiveCandidates: recipients.map((recipient) => ({
|
|
182
|
+
canonicalId: recipient.agentId,
|
|
183
|
+
forbiddenIdentityTokens: [recipient.agentId],
|
|
184
|
+
})),
|
|
185
|
+
target: {
|
|
186
|
+
kind: "message",
|
|
187
|
+
sessionId: record.sessionId,
|
|
188
|
+
},
|
|
189
|
+
messageRecord: record,
|
|
130
190
|
};
|
|
131
191
|
}
|
|
132
192
|
function collectRunCandidateIdentityTokens(options) {
|
|
@@ -144,8 +204,8 @@ function collectRunCandidateIdentityTokens(options) {
|
|
|
144
204
|
}
|
|
145
205
|
return Array.from(tokens);
|
|
146
206
|
}
|
|
147
|
-
async function
|
|
148
|
-
const { root, specsFilePath, runsFilePath, reductionsFilePath, verificationsFilePath, reductionRecord, seenReductionIds = new Set(), } = options;
|
|
207
|
+
async function resolveReductionReferenceRepo(options) {
|
|
208
|
+
const { root, specsFilePath, runsFilePath, reductionsFilePath, messagesFilePath, verificationsFilePath, reductionRecord, seenReductionIds = new Set(), } = options;
|
|
149
209
|
if (seenReductionIds.has(reductionRecord.sessionId)) {
|
|
150
210
|
throw new CliError(`Reduction session \`${reductionRecord.sessionId}\` has a recursive target chain.`, [], [
|
|
151
211
|
"Inspect `.voratiq/reduce/index.json` and repair the reduction target metadata.",
|
|
@@ -163,9 +223,12 @@ async function resolveReductionBaseRevisionSha(options) {
|
|
|
163
223
|
if (!record) {
|
|
164
224
|
throw new CliError(`Spec session \`${reductionRecord.target.id}\` referenced by reduction \`${reductionRecord.sessionId}\` was not found.`);
|
|
165
225
|
}
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
|
|
226
|
+
return {
|
|
227
|
+
kind: "git",
|
|
228
|
+
baseRevisionSha: resolveSpecBaseRevisionSha(record, {
|
|
229
|
+
ownerLabel: `reduction \`${reductionRecord.sessionId}\``,
|
|
230
|
+
}),
|
|
231
|
+
};
|
|
169
232
|
}
|
|
170
233
|
case "run": {
|
|
171
234
|
const { records } = await fetchRunsSafely({
|
|
@@ -183,7 +246,10 @@ async function resolveReductionBaseRevisionSha(options) {
|
|
|
183
246
|
if (!runRecord) {
|
|
184
247
|
throw new RunNotFoundCliError(reductionRecord.target.id);
|
|
185
248
|
}
|
|
186
|
-
return
|
|
249
|
+
return {
|
|
250
|
+
kind: "git",
|
|
251
|
+
baseRevisionSha: runRecord.baseRevisionSha,
|
|
252
|
+
};
|
|
187
253
|
}
|
|
188
254
|
case "verify": {
|
|
189
255
|
const [verificationRecord] = await readVerificationRecords({
|
|
@@ -212,7 +278,10 @@ async function resolveReductionBaseRevisionSha(options) {
|
|
|
212
278
|
if (!runRecord) {
|
|
213
279
|
throw new RunNotFoundCliError(verificationRecord.target.sessionId);
|
|
214
280
|
}
|
|
215
|
-
return
|
|
281
|
+
return {
|
|
282
|
+
kind: "git",
|
|
283
|
+
baseRevisionSha: runRecord.baseRevisionSha,
|
|
284
|
+
};
|
|
216
285
|
}
|
|
217
286
|
case "spec": {
|
|
218
287
|
const [record] = await readSpecRecords({
|
|
@@ -224,9 +293,12 @@ async function resolveReductionBaseRevisionSha(options) {
|
|
|
224
293
|
if (!record) {
|
|
225
294
|
throw new CliError(`Spec session \`${verificationRecord.target.sessionId}\` referenced by verification \`${verificationRecord.sessionId}\` was not found.`);
|
|
226
295
|
}
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
296
|
+
return {
|
|
297
|
+
kind: "git",
|
|
298
|
+
baseRevisionSha: resolveSpecBaseRevisionSha(record, {
|
|
299
|
+
ownerLabel: `verification \`${verificationRecord.sessionId}\``,
|
|
300
|
+
}),
|
|
301
|
+
};
|
|
230
302
|
}
|
|
231
303
|
case "reduce": {
|
|
232
304
|
const [parentReduction] = await readReductionRecords({
|
|
@@ -238,16 +310,37 @@ async function resolveReductionBaseRevisionSha(options) {
|
|
|
238
310
|
if (!parentReduction) {
|
|
239
311
|
throw new CliError(`Reduction session \`${verificationRecord.target.sessionId}\` referenced by verification \`${verificationRecord.sessionId}\` was not found.`);
|
|
240
312
|
}
|
|
241
|
-
return await
|
|
313
|
+
return await resolveReductionReferenceRepo({
|
|
242
314
|
root,
|
|
243
315
|
specsFilePath,
|
|
244
316
|
runsFilePath,
|
|
245
317
|
reductionsFilePath,
|
|
318
|
+
messagesFilePath,
|
|
246
319
|
verificationsFilePath,
|
|
247
320
|
reductionRecord: parentReduction,
|
|
248
321
|
seenReductionIds,
|
|
249
322
|
});
|
|
250
323
|
}
|
|
324
|
+
case "message": {
|
|
325
|
+
const [messageRecord] = await readMessageRecords({
|
|
326
|
+
root,
|
|
327
|
+
messagesFilePath,
|
|
328
|
+
limit: 1,
|
|
329
|
+
predicate: (entry) => entry.sessionId === verificationRecord.target.sessionId,
|
|
330
|
+
});
|
|
331
|
+
if (!messageRecord) {
|
|
332
|
+
throw new CliError(`Message session \`${verificationRecord.target.sessionId}\` referenced by verification \`${verificationRecord.sessionId}\` was not found.`);
|
|
333
|
+
}
|
|
334
|
+
return messageRecord.baseRevisionSha
|
|
335
|
+
? {
|
|
336
|
+
kind: "git",
|
|
337
|
+
baseRevisionSha: messageRecord.baseRevisionSha,
|
|
338
|
+
}
|
|
339
|
+
: {
|
|
340
|
+
kind: "none",
|
|
341
|
+
messageSessionId: messageRecord.sessionId,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
251
344
|
}
|
|
252
345
|
throw new CliError(`Verification session \`${verificationRecord.sessionId}\` references an unsupported target kind.`);
|
|
253
346
|
}
|
|
@@ -261,18 +354,57 @@ async function resolveReductionBaseRevisionSha(options) {
|
|
|
261
354
|
if (!parentReduction) {
|
|
262
355
|
throw new CliError(`Reduction session \`${reductionRecord.target.id}\` referenced by reduction \`${reductionRecord.sessionId}\` was not found.`);
|
|
263
356
|
}
|
|
264
|
-
return await
|
|
357
|
+
return await resolveReductionReferenceRepo({
|
|
265
358
|
root,
|
|
266
359
|
specsFilePath,
|
|
267
360
|
runsFilePath,
|
|
268
361
|
reductionsFilePath,
|
|
362
|
+
messagesFilePath,
|
|
269
363
|
verificationsFilePath,
|
|
270
364
|
reductionRecord: parentReduction,
|
|
271
365
|
seenReductionIds,
|
|
272
366
|
});
|
|
273
367
|
}
|
|
368
|
+
case "message": {
|
|
369
|
+
const [messageRecord] = await readMessageRecords({
|
|
370
|
+
root,
|
|
371
|
+
messagesFilePath,
|
|
372
|
+
limit: 1,
|
|
373
|
+
predicate: (entry) => entry.sessionId === reductionRecord.target.id,
|
|
374
|
+
});
|
|
375
|
+
if (!messageRecord) {
|
|
376
|
+
throw new CliError(`Message session \`${reductionRecord.target.id}\` referenced by reduction \`${reductionRecord.sessionId}\` was not found.`);
|
|
377
|
+
}
|
|
378
|
+
return messageRecord.baseRevisionSha
|
|
379
|
+
? {
|
|
380
|
+
kind: "git",
|
|
381
|
+
baseRevisionSha: messageRecord.baseRevisionSha,
|
|
382
|
+
}
|
|
383
|
+
: {
|
|
384
|
+
kind: "none",
|
|
385
|
+
messageSessionId: messageRecord.sessionId,
|
|
386
|
+
};
|
|
387
|
+
}
|
|
274
388
|
}
|
|
275
389
|
}
|
|
390
|
+
function resolveVerifiableMessageRecipients(record) {
|
|
391
|
+
return record.recipients.flatMap((recipient) => {
|
|
392
|
+
if (recipient.status !== "succeeded" ||
|
|
393
|
+
typeof recipient.outputPath !== "string" ||
|
|
394
|
+
!isCanonicalMessageResponseArtifact(recipient.outputPath)) {
|
|
395
|
+
return [];
|
|
396
|
+
}
|
|
397
|
+
return [
|
|
398
|
+
{
|
|
399
|
+
agentId: recipient.agentId,
|
|
400
|
+
outputPath: recipient.outputPath,
|
|
401
|
+
},
|
|
402
|
+
];
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
function isCanonicalMessageResponseArtifact(outputPath) {
|
|
406
|
+
return basename(outputPath) === MESSAGE_RESPONSE_FILENAME;
|
|
407
|
+
}
|
|
276
408
|
function resolveSpecBaseRevisionSha(record, options = {}) {
|
|
277
409
|
if (record.baseRevisionSha) {
|
|
278
410
|
return record.baseRevisionSha;
|
|
@@ -129,28 +129,6 @@ const DEFAULT_AGENT_CATALOG_ENTRIES = [
|
|
|
129
129
|
model: "gpt-5.2",
|
|
130
130
|
extraArgs: ["--config", "model_reasoning_effort=xhigh"],
|
|
131
131
|
},
|
|
132
|
-
{
|
|
133
|
-
id: "gpt-5-4-mini",
|
|
134
|
-
provider: "codex",
|
|
135
|
-
model: "gpt-5.4-mini",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
id: "gpt-5-4",
|
|
139
|
-
provider: "codex",
|
|
140
|
-
model: "gpt-5.4",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: "gpt-5-4-high",
|
|
144
|
-
provider: "codex",
|
|
145
|
-
model: "gpt-5.4",
|
|
146
|
-
extraArgs: ["--config", "model_reasoning_effort=high"],
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
id: "gpt-5-4-xhigh",
|
|
150
|
-
provider: "codex",
|
|
151
|
-
model: "gpt-5.4",
|
|
152
|
-
extraArgs: ["--config", "model_reasoning_effort=xhigh"],
|
|
153
|
-
},
|
|
154
132
|
{
|
|
155
133
|
id: "gpt-5-2-codex",
|
|
156
134
|
provider: "codex",
|
|
@@ -191,15 +169,37 @@ const DEFAULT_AGENT_CATALOG_ENTRIES = [
|
|
|
191
169
|
extraArgs: ["--config", "model_reasoning_effort=xhigh"],
|
|
192
170
|
},
|
|
193
171
|
{
|
|
194
|
-
id: "
|
|
195
|
-
provider: "
|
|
196
|
-
model: "
|
|
172
|
+
id: "gpt-5-4-mini",
|
|
173
|
+
provider: "codex",
|
|
174
|
+
model: "gpt-5.4-mini",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "gpt-5-4",
|
|
178
|
+
provider: "codex",
|
|
179
|
+
model: "gpt-5.4",
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: "gpt-5-4-high",
|
|
183
|
+
provider: "codex",
|
|
184
|
+
model: "gpt-5.4",
|
|
185
|
+
extraArgs: ["--config", "model_reasoning_effort=high"],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: "gpt-5-4-xhigh",
|
|
189
|
+
provider: "codex",
|
|
190
|
+
model: "gpt-5.4",
|
|
191
|
+
extraArgs: ["--config", "model_reasoning_effort=xhigh"],
|
|
197
192
|
},
|
|
198
193
|
{
|
|
199
194
|
id: "gemini-2-5-flash",
|
|
200
195
|
provider: "gemini",
|
|
201
196
|
model: "gemini-2.5-flash",
|
|
202
197
|
},
|
|
198
|
+
{
|
|
199
|
+
id: "gemini-2-5-flash-lite",
|
|
200
|
+
provider: "gemini",
|
|
201
|
+
model: "gemini-2.5-flash-lite",
|
|
202
|
+
},
|
|
203
203
|
{
|
|
204
204
|
id: "gemini-3-flash-preview",
|
|
205
205
|
provider: "gemini",
|
|
@@ -4,8 +4,13 @@ export interface ResolvedPresetAgent {
|
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly runOnly?: true;
|
|
6
6
|
}
|
|
7
|
+
export interface BootstrapOrchestrationProfiles {
|
|
8
|
+
readonly default: readonly ResolvedPresetAgent[];
|
|
9
|
+
readonly pro: readonly ResolvedPresetAgent[];
|
|
10
|
+
readonly lite: readonly ResolvedPresetAgent[];
|
|
11
|
+
}
|
|
7
12
|
export declare function collectEnabledAgentIdsForBootstrap(agents: readonly Pick<AgentConfigEntry, "id" | "enabled">[]): string[];
|
|
8
|
-
export declare function serializeDefaultOrchestrationYaml(
|
|
13
|
+
export declare function serializeDefaultOrchestrationYaml(profiles: BootstrapOrchestrationProfiles): string;
|
|
9
14
|
export declare function listEnabledAgentIdsForOrchestrationBootstrap(config: AgentsConfig): string[];
|
|
10
15
|
export declare function listPresetStageAgentsForOrchestrationBootstrap(config: AgentsConfig, preset: AgentPreset): ResolvedPresetAgent[];
|
|
11
16
|
export declare function buildDefaultOrchestrationTemplate(config: AgentsConfig, preset?: AgentPreset): string;
|
|
@@ -4,7 +4,9 @@ const ORCHESTRATION_BOOTSTRAP_STAGE_IDS = [
|
|
|
4
4
|
"run",
|
|
5
5
|
"reduce",
|
|
6
6
|
"verify",
|
|
7
|
+
"message",
|
|
7
8
|
];
|
|
9
|
+
const ORCHESTRATION_BOOTSTRAP_PRESET_PROFILES = ["pro", "lite"];
|
|
8
10
|
export function collectEnabledAgentIdsForBootstrap(agents) {
|
|
9
11
|
const seen = new Set();
|
|
10
12
|
const enabledAgentIds = [];
|
|
@@ -20,8 +22,23 @@ export function collectEnabledAgentIdsForBootstrap(agents) {
|
|
|
20
22
|
}
|
|
21
23
|
return enabledAgentIds;
|
|
22
24
|
}
|
|
23
|
-
export function serializeDefaultOrchestrationYaml(
|
|
24
|
-
const lines = ["profiles:"
|
|
25
|
+
export function serializeDefaultOrchestrationYaml(profiles) {
|
|
26
|
+
const lines = ["profiles:"];
|
|
27
|
+
const profileNames = [
|
|
28
|
+
"default",
|
|
29
|
+
...ORCHESTRATION_BOOTSTRAP_PRESET_PROFILES,
|
|
30
|
+
];
|
|
31
|
+
for (const [index, profileName] of profileNames.entries()) {
|
|
32
|
+
if (index > 0) {
|
|
33
|
+
lines.push("");
|
|
34
|
+
}
|
|
35
|
+
appendProfileYaml(lines, profileName, profiles[profileName]);
|
|
36
|
+
}
|
|
37
|
+
lines.push("");
|
|
38
|
+
return lines.join("\n");
|
|
39
|
+
}
|
|
40
|
+
function appendProfileYaml(lines, profileName, presetAgents) {
|
|
41
|
+
lines.push(` ${profileName}:`);
|
|
25
42
|
for (const stageId of ORCHESTRATION_BOOTSTRAP_STAGE_IDS) {
|
|
26
43
|
lines.push(` ${stageId}:`);
|
|
27
44
|
const agents = stageId === "run" ? presetAgents : presetAgents.filter((a) => !a.runOnly);
|
|
@@ -35,8 +52,6 @@ export function serializeDefaultOrchestrationYaml(presetAgents) {
|
|
|
35
52
|
}
|
|
36
53
|
}
|
|
37
54
|
}
|
|
38
|
-
lines.push("");
|
|
39
|
-
return lines.join("\n");
|
|
40
55
|
}
|
|
41
56
|
function formatYamlScalar(value) {
|
|
42
57
|
if (/^[a-z0-9_-]{1,64}$/u.test(value)) {
|
|
@@ -96,6 +111,12 @@ function hasBinary(binary) {
|
|
|
96
111
|
return typeof binary === "string" && binary.trim().length > 0;
|
|
97
112
|
}
|
|
98
113
|
export function buildDefaultOrchestrationTemplate(config, preset = "pro") {
|
|
99
|
-
const
|
|
100
|
-
|
|
114
|
+
const proAgents = listPresetStageAgentsForOrchestrationBootstrap(config, "pro");
|
|
115
|
+
const liteAgents = listPresetStageAgentsForOrchestrationBootstrap(config, "lite");
|
|
116
|
+
const defaultAgents = preset === "lite" ? liteAgents : preset === "manual" ? [] : proAgents;
|
|
117
|
+
return serializeDefaultOrchestrationYaml({
|
|
118
|
+
default: defaultAgents,
|
|
119
|
+
pro: proAgents,
|
|
120
|
+
lite: liteAgents,
|
|
121
|
+
});
|
|
101
122
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ORCHESTRATION_STAGE_IDS: readonly ["run", "
|
|
2
|
+
export declare const ORCHESTRATION_STAGE_IDS: readonly ["spec", "run", "reduce", "verify", "message"];
|
|
3
3
|
export type OrchestrationStageId = (typeof ORCHESTRATION_STAGE_IDS)[number];
|
|
4
4
|
export declare const orchestrationStageAgentSchema: z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
@@ -12,17 +12,17 @@ export declare const orchestrationStageSchema: z.ZodObject<{
|
|
|
12
12
|
}, z.core.$strict>;
|
|
13
13
|
export type OrchestrationStageConfig = z.infer<typeof orchestrationStageSchema>;
|
|
14
14
|
export declare const orchestrationProfileSchema: z.ZodObject<{
|
|
15
|
-
|
|
15
|
+
spec: z.ZodObject<{
|
|
16
16
|
agents: z.ZodArray<z.ZodObject<{
|
|
17
17
|
id: z.ZodString;
|
|
18
18
|
}, z.core.$strict>>;
|
|
19
19
|
}, z.core.$strict>;
|
|
20
|
-
|
|
20
|
+
run: z.ZodObject<{
|
|
21
21
|
agents: z.ZodArray<z.ZodObject<{
|
|
22
22
|
id: z.ZodString;
|
|
23
23
|
}, z.core.$strict>>;
|
|
24
24
|
}, z.core.$strict>;
|
|
25
|
-
|
|
25
|
+
reduce: z.ZodObject<{
|
|
26
26
|
agents: z.ZodArray<z.ZodObject<{
|
|
27
27
|
id: z.ZodString;
|
|
28
28
|
}, z.core.$strict>>;
|
|
@@ -32,23 +32,28 @@ export declare const orchestrationProfileSchema: z.ZodObject<{
|
|
|
32
32
|
id: z.ZodString;
|
|
33
33
|
}, z.core.$strict>>;
|
|
34
34
|
}, z.core.$strict>;
|
|
35
|
+
message: z.ZodDefault<z.ZodObject<{
|
|
36
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
}, z.core.$strict>>;
|
|
39
|
+
}, z.core.$strict>>;
|
|
35
40
|
}, z.core.$strict>;
|
|
36
41
|
export type OrchestrationProfile = z.infer<typeof orchestrationProfileSchema>;
|
|
37
42
|
export declare const ORCHESTRATION_PROFILE_NAME_PATTERN: RegExp;
|
|
38
43
|
export declare const ORCHESTRATION_PROFILE_NAME_MAX_LENGTH = 64;
|
|
39
44
|
export declare const orchestrationProfileNameSchema: z.ZodString;
|
|
40
45
|
export declare const orchestrationProfilesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
41
|
-
|
|
46
|
+
spec: z.ZodObject<{
|
|
42
47
|
agents: z.ZodArray<z.ZodObject<{
|
|
43
48
|
id: z.ZodString;
|
|
44
49
|
}, z.core.$strict>>;
|
|
45
50
|
}, z.core.$strict>;
|
|
46
|
-
|
|
51
|
+
run: z.ZodObject<{
|
|
47
52
|
agents: z.ZodArray<z.ZodObject<{
|
|
48
53
|
id: z.ZodString;
|
|
49
54
|
}, z.core.$strict>>;
|
|
50
55
|
}, z.core.$strict>;
|
|
51
|
-
|
|
56
|
+
reduce: z.ZodObject<{
|
|
52
57
|
agents: z.ZodArray<z.ZodObject<{
|
|
53
58
|
id: z.ZodString;
|
|
54
59
|
}, z.core.$strict>>;
|
|
@@ -58,21 +63,26 @@ export declare const orchestrationProfilesSchema: z.ZodRecord<z.ZodString, z.Zod
|
|
|
58
63
|
id: z.ZodString;
|
|
59
64
|
}, z.core.$strict>>;
|
|
60
65
|
}, z.core.$strict>;
|
|
66
|
+
message: z.ZodDefault<z.ZodObject<{
|
|
67
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
}, z.core.$strict>>;
|
|
61
71
|
}, z.core.$strict>>;
|
|
62
72
|
export type OrchestrationProfiles = z.infer<typeof orchestrationProfilesSchema>;
|
|
63
73
|
export declare const orchestrationConfigSchema: z.ZodObject<{
|
|
64
74
|
profiles: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
65
|
-
|
|
75
|
+
spec: z.ZodObject<{
|
|
66
76
|
agents: z.ZodArray<z.ZodObject<{
|
|
67
77
|
id: z.ZodString;
|
|
68
78
|
}, z.core.$strict>>;
|
|
69
79
|
}, z.core.$strict>;
|
|
70
|
-
|
|
80
|
+
run: z.ZodObject<{
|
|
71
81
|
agents: z.ZodArray<z.ZodObject<{
|
|
72
82
|
id: z.ZodString;
|
|
73
83
|
}, z.core.$strict>>;
|
|
74
84
|
}, z.core.$strict>;
|
|
75
|
-
|
|
85
|
+
reduce: z.ZodObject<{
|
|
76
86
|
agents: z.ZodArray<z.ZodObject<{
|
|
77
87
|
id: z.ZodString;
|
|
78
88
|
}, z.core.$strict>>;
|
|
@@ -82,6 +92,11 @@ export declare const orchestrationConfigSchema: z.ZodObject<{
|
|
|
82
92
|
id: z.ZodString;
|
|
83
93
|
}, z.core.$strict>>;
|
|
84
94
|
}, z.core.$strict>;
|
|
95
|
+
message: z.ZodDefault<z.ZodObject<{
|
|
96
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
97
|
+
id: z.ZodString;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
}, z.core.$strict>>;
|
|
85
100
|
}, z.core.$strict>>;
|
|
86
101
|
}, z.core.$strict>;
|
|
87
102
|
export type OrchestrationConfig = z.infer<typeof orchestrationConfigSchema>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { agentIdSchema } from "../agents/types.js";
|
|
3
3
|
export const ORCHESTRATION_STAGE_IDS = [
|
|
4
|
-
"run",
|
|
5
|
-
"verify",
|
|
6
4
|
"spec",
|
|
5
|
+
"run",
|
|
7
6
|
"reduce",
|
|
7
|
+
"verify",
|
|
8
|
+
"message",
|
|
8
9
|
];
|
|
9
10
|
export const orchestrationStageAgentSchema = z
|
|
10
11
|
.object({
|
|
@@ -30,10 +31,13 @@ export const orchestrationStageSchema = z
|
|
|
30
31
|
seen.add(agent.id);
|
|
31
32
|
});
|
|
32
33
|
});
|
|
33
|
-
const orchestrationProfileShape = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const orchestrationProfileShape = {
|
|
35
|
+
spec: orchestrationStageSchema,
|
|
36
|
+
run: orchestrationStageSchema,
|
|
37
|
+
reduce: orchestrationStageSchema,
|
|
38
|
+
verify: orchestrationStageSchema,
|
|
39
|
+
message: orchestrationStageSchema.default({ agents: [] }),
|
|
40
|
+
};
|
|
37
41
|
export const orchestrationProfileSchema = z
|
|
38
42
|
.object(orchestrationProfileShape)
|
|
39
43
|
.strict();
|
|
@@ -39,6 +39,11 @@ export declare const verificationConfigSchema: z.ZodObject<{
|
|
|
39
39
|
template: z.ZodString;
|
|
40
40
|
}, z.core.$strict>>>>;
|
|
41
41
|
}, z.core.$strict>>>;
|
|
42
|
+
message: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
43
|
+
rubric: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
template: z.ZodString;
|
|
45
|
+
}, z.core.$strict>>>>;
|
|
46
|
+
}, z.core.$strict>>>;
|
|
42
47
|
}, z.core.$strict>;
|
|
43
48
|
export type VerificationConfig = z.infer<typeof verificationConfigSchema>;
|
|
44
49
|
export {};
|