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
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { getAgentStatusStyle, getRunStatusStyle } from "../../status/colors.js";
|
|
2
|
+
import { TERMINAL_MESSAGE_STATUSES } from "../../status/index.js";
|
|
3
|
+
import { formatAgentErrorLine } from "../utils/agents.js";
|
|
4
|
+
import { formatRenderLifecycleDuration } from "../utils/duration.js";
|
|
5
|
+
import { createInteractiveFrameRenderer } from "../utils/interactive-frame.js";
|
|
6
|
+
import { buildStageFrameLines, buildStageFrameSections, } from "../utils/stage-output.js";
|
|
7
|
+
import { renderTranscript } from "../utils/transcript.js";
|
|
8
|
+
import { buildStandardSessionShellSection, formatTranscriptStatusLabel, renderTranscriptStatusTable, resolveTranscriptShellStyle, resolveTranscriptShellStyleFromWriter, } from "../utils/transcript-shell.js";
|
|
9
|
+
const DASH = "—";
|
|
10
|
+
function formatErrorDetail(error) {
|
|
11
|
+
if (error instanceof Error) {
|
|
12
|
+
return error.message;
|
|
13
|
+
}
|
|
14
|
+
if (typeof error === "string") {
|
|
15
|
+
return error;
|
|
16
|
+
}
|
|
17
|
+
if (error === null || error === undefined) {
|
|
18
|
+
return "unknown error";
|
|
19
|
+
}
|
|
20
|
+
if (typeof error === "number" ||
|
|
21
|
+
typeof error === "boolean" ||
|
|
22
|
+
typeof error === "bigint") {
|
|
23
|
+
return `${error}`;
|
|
24
|
+
}
|
|
25
|
+
if (typeof error === "symbol") {
|
|
26
|
+
return error.description ?? error.toString();
|
|
27
|
+
}
|
|
28
|
+
if (typeof error === "object") {
|
|
29
|
+
try {
|
|
30
|
+
const serialized = JSON.stringify(error);
|
|
31
|
+
if (serialized) {
|
|
32
|
+
return serialized;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Ignore serialization errors and fall back.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return "unknown error";
|
|
40
|
+
}
|
|
41
|
+
function buildMessageStageShell(options) {
|
|
42
|
+
return {
|
|
43
|
+
metadataLines: buildStandardSessionShellSection({
|
|
44
|
+
badgeText: options.messageId,
|
|
45
|
+
badgeVariant: "message",
|
|
46
|
+
status: {
|
|
47
|
+
value: options.status,
|
|
48
|
+
color: getRunStatusStyle(options.status).cli,
|
|
49
|
+
},
|
|
50
|
+
elapsed: options.elapsed,
|
|
51
|
+
createdAt: options.createdAt,
|
|
52
|
+
workspacePath: options.workspacePath,
|
|
53
|
+
style: options.style,
|
|
54
|
+
}),
|
|
55
|
+
statusTableLines: options.tableLines ?? [],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function createMessageRenderer(options = {}) {
|
|
59
|
+
const stdout = options.stdout ?? process.stdout;
|
|
60
|
+
const stderr = options.stderr ?? process.stderr;
|
|
61
|
+
const now = options.now ?? Date.now.bind(Date);
|
|
62
|
+
const suppressLeadingBlankLine = options.suppressLeadingBlankLine === true;
|
|
63
|
+
const suppressTrailingBlankLine = options.suppressTrailingBlankLine === true;
|
|
64
|
+
let context;
|
|
65
|
+
let disabled = false;
|
|
66
|
+
let warningLogged = false;
|
|
67
|
+
let refreshInterval;
|
|
68
|
+
let lastElapsedLabel = null;
|
|
69
|
+
const interactiveFrameRenderer = createInteractiveFrameRenderer(stdout);
|
|
70
|
+
const recipientOrder = [];
|
|
71
|
+
const recipientRecords = new Map();
|
|
72
|
+
function stopRefreshLoop() {
|
|
73
|
+
if (!refreshInterval) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
clearInterval(refreshInterval);
|
|
77
|
+
refreshInterval = undefined;
|
|
78
|
+
}
|
|
79
|
+
function hasRunningRecipients() {
|
|
80
|
+
for (const recipient of recipientRecords.values()) {
|
|
81
|
+
if (recipient.status === "running") {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
function syncRefreshLoop() {
|
|
88
|
+
if (!stdout.isTTY || disabled || !context || !hasRunningRecipients()) {
|
|
89
|
+
stopRefreshLoop();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (refreshInterval) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
refreshInterval = setInterval(() => {
|
|
96
|
+
guard(() => {
|
|
97
|
+
if (!stdout.isTTY || disabled || !context || !hasRunningRecipients()) {
|
|
98
|
+
stopRefreshLoop();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const nextElapsed = formatMessageProgressElapsed(context, now());
|
|
102
|
+
if (nextElapsed === lastElapsedLabel) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
render();
|
|
106
|
+
});
|
|
107
|
+
}, 1000);
|
|
108
|
+
refreshInterval.unref?.();
|
|
109
|
+
}
|
|
110
|
+
function guard(action) {
|
|
111
|
+
if (disabled) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
action();
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
disabled = true;
|
|
119
|
+
stopRefreshLoop();
|
|
120
|
+
if (!warningLogged) {
|
|
121
|
+
warningLogged = true;
|
|
122
|
+
stderr.write(`[voratiq] Progressive message output disabled: ${formatErrorDetail(error)}\n`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function safeParse(value) {
|
|
127
|
+
if (!value) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
const parsed = Date.parse(value);
|
|
131
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
132
|
+
}
|
|
133
|
+
function formatDuration(record) {
|
|
134
|
+
if (record.status === "running") {
|
|
135
|
+
return DASH;
|
|
136
|
+
}
|
|
137
|
+
return (formatRenderLifecycleDuration({
|
|
138
|
+
lifecycle: {
|
|
139
|
+
status: record.status,
|
|
140
|
+
startedAt: record.startedAt,
|
|
141
|
+
completedAt: record.completedAt,
|
|
142
|
+
},
|
|
143
|
+
terminalStatuses: TERMINAL_MESSAGE_STATUSES,
|
|
144
|
+
now: now(),
|
|
145
|
+
}) ?? DASH);
|
|
146
|
+
}
|
|
147
|
+
function syncContextLifecycleFromRecipientRecords() {
|
|
148
|
+
if (!context) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
let earliestStartedAt = safeParse(context.startedAt);
|
|
152
|
+
let latestCompletedAt = safeParse(context.completedAt);
|
|
153
|
+
for (const recipient of recipientRecords.values()) {
|
|
154
|
+
const startedAt = safeParse(recipient.startedAt);
|
|
155
|
+
if (startedAt !== undefined &&
|
|
156
|
+
(earliestStartedAt === undefined || startedAt < earliestStartedAt)) {
|
|
157
|
+
earliestStartedAt = startedAt;
|
|
158
|
+
}
|
|
159
|
+
const completedAt = safeParse(recipient.completedAt);
|
|
160
|
+
if (completedAt !== undefined &&
|
|
161
|
+
(latestCompletedAt === undefined || completedAt > latestCompletedAt)) {
|
|
162
|
+
latestCompletedAt = completedAt;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
context = {
|
|
166
|
+
...context,
|
|
167
|
+
startedAt: earliestStartedAt === undefined
|
|
168
|
+
? undefined
|
|
169
|
+
: new Date(earliestStartedAt).toISOString(),
|
|
170
|
+
completedAt: latestCompletedAt === undefined
|
|
171
|
+
? undefined
|
|
172
|
+
: new Date(latestCompletedAt).toISOString(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function buildRecipientTable(style) {
|
|
176
|
+
if (recipientRecords.size === 0) {
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
180
|
+
const rows = recipientOrder
|
|
181
|
+
.filter((agentId) => recipientRecords.has(agentId))
|
|
182
|
+
.map((agentId) => {
|
|
183
|
+
const recipient = recipientRecords.get(agentId);
|
|
184
|
+
return {
|
|
185
|
+
agentId: recipient.agentId,
|
|
186
|
+
status: formatTranscriptStatusLabel(recipient.status, getAgentStatusStyle(recipient.status).cli, resolvedStyle),
|
|
187
|
+
duration: formatDuration(recipient),
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
return renderTranscriptStatusTable({
|
|
191
|
+
rows,
|
|
192
|
+
agent: (row) => row.agentId,
|
|
193
|
+
status: (row) => row.status,
|
|
194
|
+
duration: (row) => row.duration,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function render() {
|
|
198
|
+
if (!context || disabled || !stdout.isTTY) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
syncContextLifecycleFromRecipientRecords();
|
|
202
|
+
const style = resolveTranscriptShellStyleFromWriter(stdout, { forceTty: true });
|
|
203
|
+
const elapsed = formatMessageProgressElapsed(context, now());
|
|
204
|
+
lastElapsedLabel = elapsed ?? null;
|
|
205
|
+
const shell = buildMessageStageShell({
|
|
206
|
+
messageId: context.messageId,
|
|
207
|
+
createdAt: context.createdAt,
|
|
208
|
+
elapsed: elapsed ?? DASH,
|
|
209
|
+
workspacePath: context.workspacePath,
|
|
210
|
+
status: context.status,
|
|
211
|
+
tableLines: buildRecipientTable(style),
|
|
212
|
+
style,
|
|
213
|
+
});
|
|
214
|
+
const interactiveLines = buildStageFrameLines({
|
|
215
|
+
metadataLines: shell.metadataLines,
|
|
216
|
+
statusTableLines: shell.statusTableLines,
|
|
217
|
+
leadingBlankLine: !suppressLeadingBlankLine,
|
|
218
|
+
trailingBlankLine: !suppressTrailingBlankLine,
|
|
219
|
+
});
|
|
220
|
+
if (interactiveLines.length === 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
interactiveFrameRenderer.render(interactiveLines);
|
|
224
|
+
}
|
|
225
|
+
function upsertRecipient(record) {
|
|
226
|
+
if (!recipientOrder.includes(record.agentId)) {
|
|
227
|
+
recipientOrder.push(record.agentId);
|
|
228
|
+
}
|
|
229
|
+
const existing = recipientRecords.get(record.agentId);
|
|
230
|
+
recipientRecords.set(record.agentId, {
|
|
231
|
+
...existing,
|
|
232
|
+
...record,
|
|
233
|
+
startedAt: record.startedAt ?? existing?.startedAt,
|
|
234
|
+
completedAt: record.completedAt ?? existing?.completedAt,
|
|
235
|
+
outputPath: record.outputPath ?? existing?.outputPath,
|
|
236
|
+
tokenUsage: record.tokenUsage ?? existing?.tokenUsage,
|
|
237
|
+
tokenUsageResult: record.tokenUsageResult ?? existing?.tokenUsageResult,
|
|
238
|
+
error: record.error ?? existing?.error,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
begin(nextContext) {
|
|
243
|
+
guard(() => {
|
|
244
|
+
if (!nextContext) {
|
|
245
|
+
render();
|
|
246
|
+
syncRefreshLoop();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
context = { ...nextContext };
|
|
250
|
+
render();
|
|
251
|
+
syncRefreshLoop();
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
update(record) {
|
|
255
|
+
guard(() => {
|
|
256
|
+
upsertRecipient(record);
|
|
257
|
+
render();
|
|
258
|
+
syncRefreshLoop();
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
complete(status, lifecycle) {
|
|
262
|
+
stopRefreshLoop();
|
|
263
|
+
guard(() => {
|
|
264
|
+
if (context && lifecycle) {
|
|
265
|
+
context = {
|
|
266
|
+
...context,
|
|
267
|
+
startedAt: lifecycle.startedAt ?? context.startedAt,
|
|
268
|
+
completedAt: lifecycle.completedAt ?? context.completedAt,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (context && status) {
|
|
272
|
+
context = {
|
|
273
|
+
...context,
|
|
274
|
+
status,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
render();
|
|
278
|
+
disabled = true;
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
export function renderMessageTranscript(options) {
|
|
284
|
+
const { recipients, isTty, includeSummarySection = true } = options;
|
|
285
|
+
const style = { isTty };
|
|
286
|
+
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
287
|
+
const sections = [];
|
|
288
|
+
if (includeSummarySection) {
|
|
289
|
+
const shell = {
|
|
290
|
+
metadataLines: buildStandardSessionShellSection({
|
|
291
|
+
badgeText: options.messageId,
|
|
292
|
+
badgeVariant: "message",
|
|
293
|
+
status: {
|
|
294
|
+
value: options.status,
|
|
295
|
+
color: getRunStatusStyle(options.status).cli,
|
|
296
|
+
},
|
|
297
|
+
elapsed: options.elapsed,
|
|
298
|
+
createdAt: options.createdAt,
|
|
299
|
+
workspacePath: options.workspacePath,
|
|
300
|
+
style,
|
|
301
|
+
}),
|
|
302
|
+
statusTableLines: recipients.length > 0
|
|
303
|
+
? renderTranscriptStatusTable({
|
|
304
|
+
rows: recipients,
|
|
305
|
+
agent: (row) => row.agentId,
|
|
306
|
+
status: (row) => formatTranscriptStatusLabel(row.status, getAgentStatusStyle(row.status).cli, resolvedStyle),
|
|
307
|
+
duration: (row) => row.duration,
|
|
308
|
+
})
|
|
309
|
+
: [],
|
|
310
|
+
};
|
|
311
|
+
sections.push(...buildStageFrameSections(shell));
|
|
312
|
+
}
|
|
313
|
+
if (recipients.length > 0) {
|
|
314
|
+
sections.push(["---"]);
|
|
315
|
+
}
|
|
316
|
+
recipients.forEach((recipient, index) => {
|
|
317
|
+
const block = [`Agent: ${recipient.agentId}`];
|
|
318
|
+
if (recipient.previewLines && recipient.previewLines.length > 0) {
|
|
319
|
+
block.push("", ...recipient.previewLines);
|
|
320
|
+
}
|
|
321
|
+
if (recipient.errorLine) {
|
|
322
|
+
const inlineError = recipient.errorLine.replace(/\s+/gu, " ").trim();
|
|
323
|
+
block.push("", formatAgentErrorLine(inlineError, style));
|
|
324
|
+
}
|
|
325
|
+
block.push("", `Output: ${recipient.outputPath ?? DASH}`);
|
|
326
|
+
if (index < recipients.length - 1) {
|
|
327
|
+
block.push("", "---");
|
|
328
|
+
}
|
|
329
|
+
sections.push(block);
|
|
330
|
+
});
|
|
331
|
+
return renderTranscript({ sections });
|
|
332
|
+
}
|
|
333
|
+
export function formatMessageElapsed(input) {
|
|
334
|
+
return formatRenderLifecycleDuration({
|
|
335
|
+
lifecycle: {
|
|
336
|
+
status: input.status,
|
|
337
|
+
startedAt: input.startedAt,
|
|
338
|
+
completedAt: input.completedAt,
|
|
339
|
+
},
|
|
340
|
+
terminalStatuses: TERMINAL_MESSAGE_STATUSES,
|
|
341
|
+
now: input.now,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
export function formatMessageRecipientDuration(input) {
|
|
345
|
+
return formatRenderLifecycleDuration({
|
|
346
|
+
lifecycle: {
|
|
347
|
+
status: input.status,
|
|
348
|
+
startedAt: input.startedAt,
|
|
349
|
+
completedAt: input.completedAt,
|
|
350
|
+
},
|
|
351
|
+
terminalStatuses: ["succeeded", "failed", "aborted"],
|
|
352
|
+
now: input.now,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
function formatMessageProgressElapsed(source, now) {
|
|
356
|
+
return formatMessageElapsed({
|
|
357
|
+
status: source.status,
|
|
358
|
+
startedAt: source.startedAt,
|
|
359
|
+
completedAt: source.completedAt,
|
|
360
|
+
now,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type StageRendererId = "spec" | "run" | "reduce" | "verify";
|
|
1
|
+
export type StageRendererId = "spec" | "run" | "reduce" | "verify" | "message";
|
|
2
2
|
export type StageProgressStatus = "queued" | "running" | "succeeded" | "failed" | "errored" | "aborted" | "skipped" | "pruned";
|
|
3
3
|
export interface StageProgressBeginEvent<TContext extends object> {
|
|
4
4
|
type: "stage.begin";
|
|
@@ -54,6 +54,10 @@ export declare function renderVerifyTranscript(options: {
|
|
|
54
54
|
createdAt: string;
|
|
55
55
|
elapsed: string;
|
|
56
56
|
workspacePath: string;
|
|
57
|
+
target?: {
|
|
58
|
+
kind: string;
|
|
59
|
+
sessionId: string;
|
|
60
|
+
};
|
|
57
61
|
status: "queued" | "running" | "succeeded" | "failed" | "aborted";
|
|
58
62
|
methods: readonly VerifyTranscriptMethodBlock[];
|
|
59
63
|
suppressHint?: boolean;
|
|
@@ -336,7 +336,7 @@ export function createVerifyRenderer(options = {}) {
|
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
export function renderVerifyTranscript(options) {
|
|
339
|
-
const { verificationId, createdAt, elapsed, workspacePath, status, methods, suppressHint, warningMessage, hintMessage, isTty, includeSummarySection = true, } = options;
|
|
339
|
+
const { verificationId, createdAt, elapsed, workspacePath, target, status, methods, suppressHint, warningMessage, hintMessage, isTty, includeSummarySection = true, } = options;
|
|
340
340
|
const style = { isTty };
|
|
341
341
|
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
342
342
|
const sections = [];
|
|
@@ -363,6 +363,12 @@ export function renderVerifyTranscript(options) {
|
|
|
363
363
|
if (methods.length > 0) {
|
|
364
364
|
sections.push(["---"]);
|
|
365
365
|
}
|
|
366
|
+
if (target) {
|
|
367
|
+
sections.push([`Target: ${target.kind}:${target.sessionId}`]);
|
|
368
|
+
if (methods.length > 0) {
|
|
369
|
+
sections.push(["---"]);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
366
372
|
methods.forEach((method, index) => {
|
|
367
373
|
const block = [`Agent: ${method.agentLabel ?? DASH}`];
|
|
368
374
|
block.push("", `Verifier: ${method.verifierLabel}`);
|
|
@@ -15,7 +15,7 @@ export declare function resolveTranscriptShellStyle(options?: TranscriptShellSty
|
|
|
15
15
|
export declare function resolveTranscriptShellStyleFromWriter(writer: TerminalLikeWriter, options?: {
|
|
16
16
|
forceTty?: boolean;
|
|
17
17
|
}): TranscriptShellStyleOptions;
|
|
18
|
-
export type TranscriptBadgeVariant = "run" | "verify" | "reduce" | "spec" | "agent";
|
|
18
|
+
export type TranscriptBadgeVariant = "run" | "verify" | "reduce" | "spec" | "message" | "agent";
|
|
19
19
|
export declare function formatTranscriptBadge(text: string, variant: TranscriptBadgeVariant, style: TranscriptShellStyle): string;
|
|
20
20
|
export declare function formatTranscriptStatusLabel(status: string, color: TerminalColor, style: TranscriptShellStyle): string;
|
|
21
21
|
export declare function formatTranscriptErrorLine(message: string, style: TranscriptShellStyle): string;
|
|
@@ -21,6 +21,7 @@ const BRAND_COLOR = "164;203;153";
|
|
|
21
21
|
const VERIFY_COLOR = "255;238;140";
|
|
22
22
|
const REDUCE_COLOR = "226;159;115";
|
|
23
23
|
const SPEC_COLOR = "144;190;228";
|
|
24
|
+
const MESSAGE_COLOR = "245;242;235";
|
|
24
25
|
const BADGE_STYLES = {
|
|
25
26
|
run: {
|
|
26
27
|
foreground: `${ESC}38;2;0;0;0m`,
|
|
@@ -42,6 +43,11 @@ const BADGE_STYLES = {
|
|
|
42
43
|
background: `${ESC}48;2;${SPEC_COLOR}m`,
|
|
43
44
|
bold: true,
|
|
44
45
|
},
|
|
46
|
+
message: {
|
|
47
|
+
foreground: `${ESC}38;2;0;0;0m`,
|
|
48
|
+
background: `${ESC}48;2;${MESSAGE_COLOR}m`,
|
|
49
|
+
bold: true,
|
|
50
|
+
},
|
|
45
51
|
agent: {
|
|
46
52
|
bold: true,
|
|
47
53
|
},
|
package/dist/status/index.d.ts
CHANGED
|
@@ -90,6 +90,27 @@ export declare const reductionStatusSchema: z.ZodEnum<{
|
|
|
90
90
|
*/
|
|
91
91
|
export declare const TERMINAL_REDUCTION_STATUSES: readonly ReductionStatus[];
|
|
92
92
|
export declare const IN_PROGRESS_REDUCTION_STATUSES: readonly ReductionStatus[];
|
|
93
|
+
export declare const MESSAGE_STATUS_VALUES: readonly ["queued", "running", "succeeded", "failed", "aborted"];
|
|
94
|
+
export type MessageStatus = (typeof MESSAGE_STATUS_VALUES)[number];
|
|
95
|
+
export declare const messageStatusSchema: z.ZodEnum<{
|
|
96
|
+
queued: "queued";
|
|
97
|
+
running: "running";
|
|
98
|
+
succeeded: "succeeded";
|
|
99
|
+
failed: "failed";
|
|
100
|
+
aborted: "aborted";
|
|
101
|
+
}>;
|
|
102
|
+
export declare const TERMINAL_MESSAGE_STATUSES: readonly MessageStatus[];
|
|
103
|
+
export declare const IN_PROGRESS_MESSAGE_STATUSES: readonly MessageStatus[];
|
|
104
|
+
export declare const MESSAGE_RECIPIENT_STATUS_VALUES: readonly ["queued", "running", "succeeded", "failed", "aborted"];
|
|
105
|
+
export type MessageRecipientStatus = (typeof MESSAGE_RECIPIENT_STATUS_VALUES)[number];
|
|
106
|
+
export declare const messageRecipientStatusSchema: z.ZodEnum<{
|
|
107
|
+
queued: "queued";
|
|
108
|
+
running: "running";
|
|
109
|
+
succeeded: "succeeded";
|
|
110
|
+
failed: "failed";
|
|
111
|
+
aborted: "aborted";
|
|
112
|
+
}>;
|
|
113
|
+
export declare const TERMINAL_MESSAGE_RECIPIENT_STATUSES: readonly MessageRecipientStatus[];
|
|
93
114
|
export declare const SPEC_RECORD_STATUS_VALUES: readonly ["running", "succeeded", "aborted", "failed"];
|
|
94
115
|
export type SpecRecordStatus = (typeof SPEC_RECORD_STATUS_VALUES)[number];
|
|
95
116
|
export declare const specRecordStatusSchema: z.ZodEnum<{
|
package/dist/status/index.js
CHANGED
|
@@ -128,6 +128,36 @@ export const IN_PROGRESS_REDUCTION_STATUSES = [
|
|
|
128
128
|
"queued",
|
|
129
129
|
"running",
|
|
130
130
|
];
|
|
131
|
+
export const MESSAGE_STATUS_VALUES = [
|
|
132
|
+
"queued",
|
|
133
|
+
"running",
|
|
134
|
+
"succeeded",
|
|
135
|
+
"failed",
|
|
136
|
+
"aborted",
|
|
137
|
+
];
|
|
138
|
+
export const messageStatusSchema = z.enum(MESSAGE_STATUS_VALUES);
|
|
139
|
+
export const TERMINAL_MESSAGE_STATUSES = [
|
|
140
|
+
"succeeded",
|
|
141
|
+
"failed",
|
|
142
|
+
"aborted",
|
|
143
|
+
];
|
|
144
|
+
export const IN_PROGRESS_MESSAGE_STATUSES = [
|
|
145
|
+
"queued",
|
|
146
|
+
"running",
|
|
147
|
+
];
|
|
148
|
+
export const MESSAGE_RECIPIENT_STATUS_VALUES = [
|
|
149
|
+
"queued",
|
|
150
|
+
"running",
|
|
151
|
+
"succeeded",
|
|
152
|
+
"failed",
|
|
153
|
+
"aborted",
|
|
154
|
+
];
|
|
155
|
+
export const messageRecipientStatusSchema = z.enum(MESSAGE_RECIPIENT_STATUS_VALUES);
|
|
156
|
+
export const TERMINAL_MESSAGE_RECIPIENT_STATUSES = [
|
|
157
|
+
"succeeded",
|
|
158
|
+
"failed",
|
|
159
|
+
"aborted",
|
|
160
|
+
];
|
|
131
161
|
export const SPEC_RECORD_STATUS_VALUES = [
|
|
132
162
|
"running",
|
|
133
163
|
"succeeded",
|
package/dist/workspace/setup.js
CHANGED
|
@@ -7,7 +7,7 @@ import { toErrorMessage } from "../utils/errors.js";
|
|
|
7
7
|
import { isDirectory, isFile, pathExists } from "../utils/fs.js";
|
|
8
8
|
import { relativeToRoot } from "../utils/path.js";
|
|
9
9
|
import { WorkspaceMissingEntryError, WorkspaceNotInitializedError, WorkspaceSetupError, WorkspaceWrongTypeEntryError, } from "./errors.js";
|
|
10
|
-
import { resolveWorkspacePath, VORATIQ_AGENTS_FILE, VORATIQ_ENVIRONMENT_FILE, VORATIQ_INTERACTIVE_DIR, VORATIQ_INTERACTIVE_FILE, VORATIQ_INTERACTIVE_SESSIONS_DIR, VORATIQ_ORCHESTRATION_FILE, VORATIQ_REDUCTION_DIR, VORATIQ_REDUCTION_FILE, VORATIQ_REDUCTION_SESSIONS_DIR, VORATIQ_RUN_DIR, VORATIQ_RUN_FILE, VORATIQ_RUN_SESSIONS_DIR, VORATIQ_SANDBOX_FILE, VORATIQ_SPEC_DIR, VORATIQ_SPEC_FILE, VORATIQ_SPEC_SESSIONS_DIR, VORATIQ_VERIFICATION_CONFIG_FILE, VORATIQ_VERIFICATION_DIR, VORATIQ_VERIFICATION_FILE, VORATIQ_VERIFICATION_SESSIONS_DIR, VORATIQ_VERIFICATION_TEMPLATES_DIR, } from "./structure.js";
|
|
10
|
+
import { resolveWorkspacePath, VORATIQ_AGENTS_FILE, VORATIQ_ENVIRONMENT_FILE, VORATIQ_INTERACTIVE_DIR, VORATIQ_INTERACTIVE_FILE, VORATIQ_INTERACTIVE_SESSIONS_DIR, VORATIQ_MESSAGE_DIR, VORATIQ_MESSAGE_FILE, VORATIQ_MESSAGE_SESSIONS_DIR, VORATIQ_ORCHESTRATION_FILE, VORATIQ_REDUCTION_DIR, VORATIQ_REDUCTION_FILE, VORATIQ_REDUCTION_SESSIONS_DIR, VORATIQ_RUN_DIR, VORATIQ_RUN_FILE, VORATIQ_RUN_SESSIONS_DIR, VORATIQ_SANDBOX_FILE, VORATIQ_SPEC_DIR, VORATIQ_SPEC_FILE, VORATIQ_SPEC_SESSIONS_DIR, VORATIQ_VERIFICATION_CONFIG_FILE, VORATIQ_VERIFICATION_DIR, VORATIQ_VERIFICATION_FILE, VORATIQ_VERIFICATION_SESSIONS_DIR, VORATIQ_VERIFICATION_TEMPLATES_DIR, } from "./structure.js";
|
|
11
11
|
import { buildDefaultAgentsTemplate, buildDefaultEnvironmentTemplate, buildDefaultSandboxTemplate, } from "./templates.js";
|
|
12
12
|
import { buildDefaultVerificationConfigYaml, SHIPPED_VERIFICATION_TEMPLATES, } from "./verification-defaults.js";
|
|
13
13
|
async function seedVerificationSurface(root, options = {}) {
|
|
@@ -55,6 +55,12 @@ async function seedVerificationSurface(root, options = {}) {
|
|
|
55
55
|
return { createdDirectories, createdFiles };
|
|
56
56
|
}
|
|
57
57
|
const DOMAIN_STRUCTURE_DEFINITIONS = [
|
|
58
|
+
{
|
|
59
|
+
directorySegment: VORATIQ_SPEC_DIR,
|
|
60
|
+
sessionsSegment: VORATIQ_SPEC_SESSIONS_DIR,
|
|
61
|
+
indexSegment: VORATIQ_SPEC_FILE,
|
|
62
|
+
indexVersion: 1,
|
|
63
|
+
},
|
|
58
64
|
{
|
|
59
65
|
directorySegment: VORATIQ_RUN_DIR,
|
|
60
66
|
sessionsSegment: VORATIQ_RUN_SESSIONS_DIR,
|
|
@@ -67,18 +73,18 @@ const DOMAIN_STRUCTURE_DEFINITIONS = [
|
|
|
67
73
|
indexSegment: VORATIQ_REDUCTION_FILE,
|
|
68
74
|
indexVersion: 1,
|
|
69
75
|
},
|
|
70
|
-
{
|
|
71
|
-
directorySegment: VORATIQ_SPEC_DIR,
|
|
72
|
-
sessionsSegment: VORATIQ_SPEC_SESSIONS_DIR,
|
|
73
|
-
indexSegment: VORATIQ_SPEC_FILE,
|
|
74
|
-
indexVersion: 1,
|
|
75
|
-
},
|
|
76
76
|
{
|
|
77
77
|
directorySegment: VORATIQ_VERIFICATION_DIR,
|
|
78
78
|
sessionsSegment: VORATIQ_VERIFICATION_SESSIONS_DIR,
|
|
79
79
|
indexSegment: VORATIQ_VERIFICATION_FILE,
|
|
80
80
|
indexVersion: 1,
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
directorySegment: VORATIQ_MESSAGE_DIR,
|
|
84
|
+
sessionsSegment: VORATIQ_MESSAGE_SESSIONS_DIR,
|
|
85
|
+
indexSegment: VORATIQ_MESSAGE_FILE,
|
|
86
|
+
indexVersion: 1,
|
|
87
|
+
},
|
|
82
88
|
{
|
|
83
89
|
directorySegment: VORATIQ_INTERACTIVE_DIR,
|
|
84
90
|
sessionsSegment: VORATIQ_INTERACTIVE_SESSIONS_DIR,
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import type { ChatArtifactFormat } from "./chat/types.js";
|
|
2
2
|
export declare const VORATIQ_DIR = ".voratiq";
|
|
3
|
+
export declare const VORATIQ_SPEC_DIR = "spec";
|
|
4
|
+
export declare const VORATIQ_SPEC_FILE = "spec/index.json";
|
|
5
|
+
export declare const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
|
|
3
6
|
export declare const VORATIQ_RUN_DIR = "run";
|
|
4
7
|
export declare const VORATIQ_RUN_FILE = "run/index.json";
|
|
5
8
|
export declare const VORATIQ_RUN_SESSIONS_DIR = "run/sessions";
|
|
6
9
|
export declare const VORATIQ_REDUCTION_DIR = "reduce";
|
|
7
10
|
export declare const VORATIQ_REDUCTION_FILE = "reduce/index.json";
|
|
8
11
|
export declare const VORATIQ_REDUCTION_SESSIONS_DIR = "reduce/sessions";
|
|
9
|
-
export declare const VORATIQ_SPEC_DIR = "spec";
|
|
10
|
-
export declare const VORATIQ_SPEC_FILE = "spec/index.json";
|
|
11
|
-
export declare const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
|
|
12
12
|
export declare const VORATIQ_VERIFICATION_DIR = "verify";
|
|
13
13
|
export declare const VORATIQ_VERIFICATION_FILE = "verify/index.json";
|
|
14
14
|
export declare const VORATIQ_VERIFICATION_SESSIONS_DIR = "verify/sessions";
|
|
15
15
|
export declare const VORATIQ_VERIFICATION_TEMPLATES_DIR = "verify/templates";
|
|
16
|
+
export declare const VORATIQ_MESSAGE_DIR = "message";
|
|
17
|
+
export declare const VORATIQ_MESSAGE_FILE = "message/index.json";
|
|
18
|
+
export declare const VORATIQ_MESSAGE_SESSIONS_DIR = "message/sessions";
|
|
16
19
|
export declare const VORATIQ_INTERACTIVE_DIR = "interactive";
|
|
17
20
|
export declare const VORATIQ_INTERACTIVE_FILE = "interactive/index.json";
|
|
18
21
|
export declare const VORATIQ_INTERACTIVE_SESSIONS_DIR = "interactive/sessions";
|
|
@@ -34,6 +37,7 @@ export declare const CHAT_JSON_FILENAME = "chat.json";
|
|
|
34
37
|
export declare const CHAT_JSONL_FILENAME = "chat.jsonl";
|
|
35
38
|
export declare const REDUCTION_FILENAME = "reduction.md";
|
|
36
39
|
export declare const REDUCTION_DATA_FILENAME = "reduction.json";
|
|
40
|
+
export declare const MESSAGE_RESPONSE_FILENAME = "response.md";
|
|
37
41
|
export declare const RUNTIME_DIRNAME = "runtime";
|
|
38
42
|
export declare const ARTIFACTS_DIRNAME = "artifacts";
|
|
39
43
|
export declare const MANIFEST_FILENAME = "manifest.json";
|
|
@@ -50,12 +54,15 @@ export declare function getSpecDirectoryPath(): string;
|
|
|
50
54
|
export declare function getSpecIndexPath(): string;
|
|
51
55
|
export declare function getSpecHistoryLockPath(): string;
|
|
52
56
|
export declare function getSpecSessionsDirectoryPath(): string;
|
|
53
|
-
export declare function getVerificationDirectoryPath(): string;
|
|
54
|
-
export declare function getVerificationIndexPath(): string;
|
|
55
|
-
export declare function getVerificationSessionsDirectoryPath(): string;
|
|
56
57
|
export declare function getReductionDirectoryPath(): string;
|
|
57
58
|
export declare function getReductionIndexPath(): string;
|
|
58
59
|
export declare function getReductionSessionsDirectoryPath(): string;
|
|
60
|
+
export declare function getVerificationDirectoryPath(): string;
|
|
61
|
+
export declare function getVerificationIndexPath(): string;
|
|
62
|
+
export declare function getVerificationSessionsDirectoryPath(): string;
|
|
63
|
+
export declare function getMessageDirectoryPath(): string;
|
|
64
|
+
export declare function getMessageIndexPath(): string;
|
|
65
|
+
export declare function getMessageSessionsDirectoryPath(): string;
|
|
59
66
|
export declare function getInteractiveDirectoryPath(): string;
|
|
60
67
|
export declare function getInteractiveIndexPath(): string;
|
|
61
68
|
export declare function getInteractiveHistoryLockPath(): string;
|
|
@@ -67,6 +74,7 @@ export declare function getDomainSessionsDirectoryPath(domain: string): string;
|
|
|
67
74
|
export declare function getSessionDirectoryPath(domain: string, sessionId: string): string;
|
|
68
75
|
export declare function getSpecSessionDirectoryPath(sessionId: string): string;
|
|
69
76
|
export declare function getReductionSessionDirectoryPath(sessionId: string): string;
|
|
77
|
+
export declare function getMessageSessionDirectoryPath(sessionId: string): string;
|
|
70
78
|
export declare function getVerificationSessionDirectoryPath(sessionId: string): string;
|
|
71
79
|
export declare function getVerificationSessionArtifactsDirectoryPath(sessionId: string): string;
|
|
72
80
|
export declare function getVerificationSessionRecordPath(sessionId: string): string;
|