voratiq 0.1.0-beta.21 → 0.1.0-beta.22
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/README.md +18 -22
- package/dist/agents/launch/chat.d.ts +3 -1
- package/dist/agents/launch/chat.js +2 -0
- package/dist/bin.js +28 -7
- package/dist/cli/auto.js +1 -0
- package/dist/cli/contract.d.ts +26 -17
- package/dist/cli/contract.js +3 -1
- package/dist/cli/doctor.d.ts +12 -0
- package/dist/cli/doctor.js +115 -0
- package/dist/cli/list.js +4 -1
- package/dist/cli/operator-envelope.d.ts +19 -6
- package/dist/cli/operator-envelope.js +61 -1
- package/dist/cli/run.js +2 -0
- package/dist/cli/verify.d.ts +1 -1
- package/dist/cli/verify.js +48 -9
- package/dist/commands/auto/command.d.ts +1 -0
- package/dist/commands/auto/command.js +22 -12
- package/dist/commands/auto/errors.js +1 -1
- package/dist/commands/doctor/agents.d.ts +5 -0
- package/dist/commands/{init → doctor}/agents.js +37 -19
- package/dist/commands/doctor/command.d.ts +22 -0
- package/dist/commands/doctor/command.js +99 -0
- package/dist/commands/doctor/environment.d.ts +2 -0
- package/dist/commands/{init → doctor}/environment.js +38 -6
- package/dist/commands/{init/types.d.ts → doctor/fix-types.d.ts} +30 -9
- package/dist/commands/doctor/fix.d.ts +2 -0
- package/dist/commands/{init/command.js → doctor/fix.js} +106 -10
- package/dist/commands/doctor/reconcile.d.ts +2 -0
- package/dist/commands/doctor/reconcile.js +101 -0
- package/dist/commands/interactive/lifecycle.d.ts +2 -0
- package/dist/commands/interactive/lifecycle.js +8 -0
- package/dist/commands/list/command.d.ts +1 -0
- package/dist/commands/list/command.js +211 -352
- package/dist/commands/list/normalization.d.ts +56 -0
- package/dist/commands/list/normalization.js +317 -0
- package/dist/commands/message/command.d.ts +2 -1
- package/dist/commands/message/command.js +35 -14
- package/dist/commands/message/errors.d.ts +12 -3
- package/dist/commands/message/errors.js +19 -3
- package/dist/commands/reduce/command.js +16 -17
- package/dist/commands/reduce/errors.d.ts +2 -2
- package/dist/commands/reduce/errors.js +3 -3
- package/dist/commands/reduce/targets.js +11 -2
- package/dist/commands/root-launcher/command.js +12 -6
- package/dist/commands/run/command.d.ts +1 -0
- package/dist/commands/run/command.js +4 -1
- package/dist/commands/run/record-init.d.ts +2 -0
- package/dist/commands/run/record-init.js +2 -1
- package/dist/commands/run/spec-provenance.d.ts +37 -0
- package/dist/commands/run/spec-provenance.js +384 -0
- package/dist/commands/run/validation.d.ts +4 -0
- package/dist/commands/run/validation.js +25 -62
- package/dist/commands/spec/command.js +19 -6
- package/dist/commands/spec/errors.d.ts +5 -0
- package/dist/commands/spec/errors.js +9 -0
- package/dist/commands/verify/agents.d.ts +4 -2
- package/dist/commands/verify/agents.js +4 -11
- package/dist/commands/verify/command.js +15 -5
- package/dist/commands/verify/errors.d.ts +12 -0
- package/dist/commands/verify/errors.js +22 -0
- package/dist/commands/verify/targets.js +108 -12
- package/dist/competition/shared/preflight.d.ts +1 -1
- package/dist/competition/shared/preflight.js +15 -2
- package/dist/contracts/list.d.ts +129 -149
- package/dist/contracts/list.js +47 -99
- package/dist/domain/interactive/persistence/adapter.d.ts +23 -0
- package/dist/domain/interactive/persistence/adapter.js +42 -0
- package/dist/domain/message/model/types.d.ts +32 -0
- package/dist/domain/message/model/types.js +25 -0
- package/dist/domain/reduce/competition/adapter.js +21 -7
- package/dist/domain/reduce/competition/finalize.d.ts +7 -0
- package/dist/domain/reduce/competition/finalize.js +19 -0
- package/dist/domain/reduce/model/types.d.ts +3 -3
- package/dist/domain/run/competition/agents/artifacts.js +4 -2
- package/dist/domain/run/competition/errors.d.ts +1 -1
- package/dist/domain/run/competition/errors.js +4 -7
- package/dist/domain/run/model/types.d.ts +384 -0
- package/dist/domain/run/model/types.js +87 -0
- package/dist/domain/spec/competition/adapter.d.ts +1 -0
- package/dist/domain/spec/competition/adapter.js +6 -1
- package/dist/domain/spec/model/types.d.ts +3 -0
- package/dist/domain/spec/model/types.js +5 -0
- package/dist/domain/verify/competition/finalize.d.ts +9 -0
- package/dist/domain/verify/competition/finalize.js +22 -3
- package/dist/domain/verify/model/types.d.ts +2 -2
- package/dist/interactive/providers/mcp.d.ts +1 -0
- package/dist/interactive/providers/mcp.js +45 -7
- package/dist/interactive/substrate.js +20 -3
- package/dist/mcp/server.js +26 -9
- package/dist/policy/verification.js +18 -1
- package/dist/preflight/agents.d.ts +24 -0
- package/dist/preflight/agents.js +71 -0
- package/dist/preflight/environment.d.ts +6 -0
- package/dist/preflight/environment.js +17 -0
- package/dist/preflight/formatting.d.ts +5 -0
- package/dist/preflight/formatting.js +20 -0
- package/dist/preflight/index.d.ts +2 -0
- package/dist/preflight/index.js +5 -9
- package/dist/preflight/operator.d.ts +32 -0
- package/dist/preflight/operator.js +40 -0
- package/dist/preflight/settings.d.ts +2 -0
- package/dist/preflight/settings.js +17 -0
- package/dist/render/transcripts/interactive.d.ts +16 -0
- package/dist/render/transcripts/interactive.js +42 -0
- package/dist/render/transcripts/list.d.ts +41 -0
- package/dist/render/transcripts/list.js +152 -3
- package/dist/render/transcripts/message.d.ts +2 -1
- package/dist/render/transcripts/message.js +19 -20
- package/dist/render/transcripts/reduce.d.ts +1 -0
- package/dist/render/transcripts/reduce.js +21 -21
- package/dist/render/transcripts/root-launcher.js +2 -12
- package/dist/render/transcripts/run.d.ts +3 -0
- package/dist/render/transcripts/run.js +30 -4
- package/dist/render/transcripts/spec.js +5 -8
- package/dist/render/transcripts/verify.d.ts +5 -3
- package/dist/render/transcripts/verify.js +44 -31
- package/dist/render/utils/duration.d.ts +5 -0
- package/dist/render/utils/duration.js +6 -0
- package/dist/render/utils/runs.d.ts +1 -0
- package/dist/render/utils/runs.js +1 -0
- package/dist/render/utils/transcript-shell.d.ts +2 -1
- package/dist/render/utils/transcript-shell.js +19 -6
- package/dist/utils/errors.d.ts +2 -1
- package/dist/utils/errors.js +3 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.js +25 -2
- package/dist/utils/list-target.d.ts +4 -0
- package/dist/utils/list-target.js +35 -0
- package/dist/utils/terminal.d.ts +1 -0
- package/dist/utils/terminal.js +11 -0
- package/dist/workspace/chat/artifacts.d.ts +7 -0
- package/dist/workspace/chat/artifacts.js +94 -3
- package/dist/workspace/errors.js +2 -2
- package/dist/workspace/managed-state.d.ts +32 -0
- package/dist/workspace/managed-state.js +103 -0
- package/dist/workspace/setup.js +66 -2
- package/dist/workspace/shim.d.ts +1 -0
- package/dist/workspace/shim.js +3 -3
- package/dist/workspace/structure.d.ts +1 -0
- package/dist/workspace/structure.js +1 -0
- package/package.json +2 -2
- package/dist/cli/init.d.ts +0 -15
- package/dist/cli/init.js +0 -70
- package/dist/commands/init/agents.d.ts +0 -4
- package/dist/commands/init/command.d.ts +0 -2
- package/dist/commands/init/environment.d.ts +0 -2
- package/dist/render/transcripts/init.d.ts +0 -7
- package/dist/render/transcripts/init.js +0 -83
- /package/dist/commands/{init/types.js → doctor/fix-types.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAgentStatusStyle, getRunStatusStyle } from "../../status/colors.js";
|
|
2
2
|
import { TERMINAL_MESSAGE_STATUSES } from "../../status/index.js";
|
|
3
3
|
import { formatAgentErrorLine } from "../utils/agents.js";
|
|
4
|
-
import { formatRenderLifecycleDuration } from "../utils/duration.js";
|
|
4
|
+
import { formatRenderLifecycleDuration, formatRenderLifecycleRowDuration, } from "../utils/duration.js";
|
|
5
5
|
import { createInteractiveFrameRenderer } from "../utils/interactive-frame.js";
|
|
6
6
|
import { buildStageFrameLines, buildStageFrameSections, } from "../utils/stage-output.js";
|
|
7
7
|
import { renderTranscript } from "../utils/transcript.js";
|
|
@@ -131,10 +131,7 @@ export function createMessageRenderer(options = {}) {
|
|
|
131
131
|
return Number.isNaN(parsed) ? undefined : parsed;
|
|
132
132
|
}
|
|
133
133
|
function formatDuration(record) {
|
|
134
|
-
|
|
135
|
-
return DASH;
|
|
136
|
-
}
|
|
137
|
-
return (formatRenderLifecycleDuration({
|
|
134
|
+
return formatRenderLifecycleRowDuration({
|
|
138
135
|
lifecycle: {
|
|
139
136
|
status: record.status,
|
|
140
137
|
startedAt: record.startedAt,
|
|
@@ -142,7 +139,7 @@ export function createMessageRenderer(options = {}) {
|
|
|
142
139
|
},
|
|
143
140
|
terminalStatuses: TERMINAL_MESSAGE_STATUSES,
|
|
144
141
|
now: now(),
|
|
145
|
-
})
|
|
142
|
+
});
|
|
146
143
|
}
|
|
147
144
|
function syncContextLifecycleFromRecipientRecords() {
|
|
148
145
|
if (!context) {
|
|
@@ -281,24 +278,26 @@ export function createMessageRenderer(options = {}) {
|
|
|
281
278
|
};
|
|
282
279
|
}
|
|
283
280
|
export function renderMessageTranscript(options) {
|
|
284
|
-
const { recipients, isTty, includeSummarySection = true } = options;
|
|
281
|
+
const { recipients, isTty, includeSummarySection = true, targetDisplay, } = options;
|
|
285
282
|
const style = { isTty };
|
|
286
283
|
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
287
284
|
const sections = [];
|
|
288
285
|
if (includeSummarySection) {
|
|
286
|
+
const metadataLines = buildStandardSessionShellSection({
|
|
287
|
+
badgeText: options.messageId,
|
|
288
|
+
badgeVariant: "message",
|
|
289
|
+
status: {
|
|
290
|
+
value: options.status,
|
|
291
|
+
color: getRunStatusStyle(options.status).cli,
|
|
292
|
+
},
|
|
293
|
+
elapsed: options.elapsed,
|
|
294
|
+
createdAt: options.createdAt,
|
|
295
|
+
workspacePath: options.workspacePath,
|
|
296
|
+
targetDisplay,
|
|
297
|
+
style,
|
|
298
|
+
});
|
|
289
299
|
const shell = {
|
|
290
|
-
metadataLines
|
|
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
|
-
}),
|
|
300
|
+
metadataLines,
|
|
302
301
|
statusTableLines: recipients.length > 0
|
|
303
302
|
? renderTranscriptStatusTable({
|
|
304
303
|
rows: recipients,
|
|
@@ -342,7 +341,7 @@ export function formatMessageElapsed(input) {
|
|
|
342
341
|
});
|
|
343
342
|
}
|
|
344
343
|
export function formatMessageRecipientDuration(input) {
|
|
345
|
-
return
|
|
344
|
+
return formatRenderLifecycleRowDuration({
|
|
346
345
|
lifecycle: {
|
|
347
346
|
status: input.status,
|
|
348
347
|
startedAt: input.startedAt,
|
|
@@ -51,6 +51,7 @@ export interface ReduceTranscriptOptions {
|
|
|
51
51
|
elapsed: string;
|
|
52
52
|
workspacePath: string;
|
|
53
53
|
status: "queued" | "succeeded" | "failed" | "aborted" | "running";
|
|
54
|
+
targetDisplay?: string;
|
|
54
55
|
reducers: readonly ReduceTranscriptReducerBlock[];
|
|
55
56
|
nextCommandLines?: readonly string[];
|
|
56
57
|
suppressHint?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAgentStatusStyle, getRunStatusStyle } from "../../status/colors.js";
|
|
2
2
|
import { TERMINAL_REDUCTION_STATUSES } from "../../status/index.js";
|
|
3
3
|
import { formatAgentErrorLine } from "../utils/agents.js";
|
|
4
|
-
import { formatRenderLifecycleDuration } from "../utils/duration.js";
|
|
4
|
+
import { formatRenderLifecycleDuration, formatRenderLifecycleRowDuration, } from "../utils/duration.js";
|
|
5
5
|
import { createInteractiveFrameRenderer } from "../utils/interactive-frame.js";
|
|
6
6
|
import { buildStageFrameLines, buildStageFrameSections, } from "../utils/stage-output.js";
|
|
7
7
|
import { renderTranscript } from "../utils/transcript.js";
|
|
@@ -39,19 +39,21 @@ function formatErrorDetail(error) {
|
|
|
39
39
|
return "unknown error";
|
|
40
40
|
}
|
|
41
41
|
function buildReduceStageShell(options) {
|
|
42
|
+
const metadataLines = buildStandardSessionShellSection({
|
|
43
|
+
badgeText: options.reductionId,
|
|
44
|
+
badgeVariant: "reduce",
|
|
45
|
+
status: {
|
|
46
|
+
value: options.status,
|
|
47
|
+
color: getRunStatusStyle(options.status).cli,
|
|
48
|
+
},
|
|
49
|
+
elapsed: options.elapsed,
|
|
50
|
+
createdAt: options.createdAt,
|
|
51
|
+
workspacePath: options.workspacePath,
|
|
52
|
+
targetDisplay: options.targetDisplay,
|
|
53
|
+
style: options.style,
|
|
54
|
+
});
|
|
42
55
|
return {
|
|
43
|
-
metadataLines
|
|
44
|
-
badgeText: options.reductionId,
|
|
45
|
-
badgeVariant: "reduce",
|
|
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
|
-
}),
|
|
56
|
+
metadataLines,
|
|
55
57
|
statusTableLines: options.tableLines ?? [],
|
|
56
58
|
};
|
|
57
59
|
}
|
|
@@ -142,10 +144,7 @@ export function createReduceRenderer(options = {}) {
|
|
|
142
144
|
return Number.isNaN(parsed) ? undefined : parsed;
|
|
143
145
|
}
|
|
144
146
|
function formatDuration(record) {
|
|
145
|
-
|
|
146
|
-
return DASH;
|
|
147
|
-
}
|
|
148
|
-
return (formatRenderLifecycleDuration({
|
|
147
|
+
return formatRenderLifecycleRowDuration({
|
|
149
148
|
lifecycle: {
|
|
150
149
|
status: record.status,
|
|
151
150
|
startedAt: record.startedAt,
|
|
@@ -153,7 +152,7 @@ export function createReduceRenderer(options = {}) {
|
|
|
153
152
|
},
|
|
154
153
|
terminalStatuses: TERMINAL_REDUCTION_STATUSES,
|
|
155
154
|
now: now(),
|
|
156
|
-
})
|
|
155
|
+
});
|
|
157
156
|
}
|
|
158
157
|
function syncContextLifecycleFromReducerRecords() {
|
|
159
158
|
if (!context) {
|
|
@@ -321,7 +320,7 @@ export function createReduceRenderer(options = {}) {
|
|
|
321
320
|
};
|
|
322
321
|
}
|
|
323
322
|
export function renderReduceTranscript(options) {
|
|
324
|
-
const { reductionId, createdAt, elapsed, workspacePath, status, reducers, nextCommandLines, suppressHint, isTty, includeSummarySection = true, } = options;
|
|
323
|
+
const { reductionId, createdAt, elapsed, workspacePath, status, targetDisplay, reducers, nextCommandLines, suppressHint, isTty, includeSummarySection = true, } = options;
|
|
325
324
|
const style = { isTty };
|
|
326
325
|
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
327
326
|
const sections = [];
|
|
@@ -332,6 +331,7 @@ export function renderReduceTranscript(options) {
|
|
|
332
331
|
elapsed,
|
|
333
332
|
workspacePath,
|
|
334
333
|
status,
|
|
334
|
+
targetDisplay,
|
|
335
335
|
tableLines: reducers.length > 0
|
|
336
336
|
? renderTranscriptStatusTable({
|
|
337
337
|
rows: reducers,
|
|
@@ -372,7 +372,7 @@ export function renderReduceTranscript(options) {
|
|
|
372
372
|
return renderTranscript({ sections, hint });
|
|
373
373
|
}
|
|
374
374
|
export function formatReducerDuration(options) {
|
|
375
|
-
return (
|
|
375
|
+
return formatRenderLifecycleRowDuration({
|
|
376
376
|
lifecycle: {
|
|
377
377
|
status: options.status,
|
|
378
378
|
startedAt: options.startedAt,
|
|
@@ -380,7 +380,7 @@ export function formatReducerDuration(options) {
|
|
|
380
380
|
},
|
|
381
381
|
terminalStatuses: TERMINAL_REDUCTION_STATUSES,
|
|
382
382
|
now: options.now,
|
|
383
|
-
})
|
|
383
|
+
});
|
|
384
384
|
}
|
|
385
385
|
export function formatReduceElapsed(options) {
|
|
386
386
|
return formatRenderLifecycleDuration({
|
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import { colorize } from "../../utils/colors.js";
|
|
2
2
|
export function renderRootLauncherSelectionScreen(options) {
|
|
3
|
+
void options.unavailable;
|
|
3
4
|
const lines = [
|
|
4
5
|
"Start a native agent session from this repository.",
|
|
5
6
|
"",
|
|
6
7
|
"Enabled agents:",
|
|
7
8
|
...options.launchable.map((agent, index) => ` ${index + 1}. ${agent.label}`),
|
|
8
9
|
];
|
|
9
|
-
if (options.unavailable.length > 0) {
|
|
10
|
-
lines.push("", "Unavailable enabled agents:");
|
|
11
|
-
for (const agent of options.unavailable) {
|
|
12
|
-
lines.push(` - ${agent.label}: ${agent.reasons.join("; ")}`);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
10
|
lines.push("", "Choose one agent to launch.");
|
|
16
11
|
return lines.join("\n");
|
|
17
12
|
}
|
|
18
13
|
export function renderRootLauncherSingleAgentScreen(options) {
|
|
14
|
+
void options.unavailable;
|
|
19
15
|
const lines = ["Start a native agent session from this repository.", ""];
|
|
20
|
-
if (options.unavailable.length > 0) {
|
|
21
|
-
lines.push("", "Unavailable enabled agents:");
|
|
22
|
-
for (const agent of options.unavailable) {
|
|
23
|
-
lines.push(` - ${agent.label}: ${agent.reasons.join("; ")}`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
16
|
lines.push(`Using agent: ${options.selected}`);
|
|
27
17
|
return lines.join("\n");
|
|
28
18
|
}
|
|
@@ -32,6 +32,8 @@ export interface RunTranscriptAgentRecord {
|
|
|
32
32
|
startedAt?: string;
|
|
33
33
|
completedAt?: string;
|
|
34
34
|
diffStatistics?: string;
|
|
35
|
+
outputPath?: string;
|
|
36
|
+
errorLine?: string;
|
|
35
37
|
}
|
|
36
38
|
export interface RunTranscriptOptions {
|
|
37
39
|
runId: string;
|
|
@@ -40,6 +42,7 @@ export interface RunTranscriptOptions {
|
|
|
40
42
|
createdAt: string;
|
|
41
43
|
startedAt?: string;
|
|
42
44
|
completedAt?: string;
|
|
45
|
+
targetDisplay?: string;
|
|
43
46
|
agents: readonly RunTranscriptAgentRecord[];
|
|
44
47
|
isTty?: boolean;
|
|
45
48
|
now?: number;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TERMINAL_RUN_STATUSES } from "../../status/index.js";
|
|
2
2
|
import { formatCompactDiffStatistics } from "../../utils/diff.js";
|
|
3
|
-
import { formatAgentDuration, formatAgentStatusLabelWithStyle, } from "../utils/agents.js";
|
|
3
|
+
import { formatAgentDuration, formatAgentErrorLine, formatAgentStatusLabelWithStyle, } from "../utils/agents.js";
|
|
4
4
|
import { formatAgentBadge } from "../utils/badges.js";
|
|
5
5
|
import { formatRenderLifecycleDuration } from "../utils/duration.js";
|
|
6
6
|
import { createInteractiveFrameRenderer } from "../utils/interactive-frame.js";
|
|
7
7
|
import { formatRunTimestamp } from "../utils/records.js";
|
|
8
8
|
import { buildRunMetadataSectionWithStyle } from "../utils/runs.js";
|
|
9
9
|
import { buildStageFrameLines, renderStageFinalFrame, } from "../utils/stage-output.js";
|
|
10
|
+
import { renderTranscript } from "../utils/transcript.js";
|
|
10
11
|
import { renderTranscriptStatusTable, resolveTranscriptShellStyle, resolveTranscriptShellStyleFromWriter, } from "../utils/transcript-shell.js";
|
|
11
12
|
const DASH = "—";
|
|
12
13
|
export function formatRunElapsed(source, now) {
|
|
@@ -33,6 +34,7 @@ export function renderRunTranscript(options) {
|
|
|
33
34
|
completedAt: options.completedAt,
|
|
34
35
|
}, options.now) ?? DASH,
|
|
35
36
|
createdAt: formatRunTimestamp(options.createdAt),
|
|
37
|
+
targetDisplay: options.targetDisplay,
|
|
36
38
|
}, style),
|
|
37
39
|
statusTableLines: options.agents.length === 0
|
|
38
40
|
? []
|
|
@@ -53,10 +55,34 @@ export function renderRunTranscript(options) {
|
|
|
53
55
|
extras: [{ header: "CHANGES", accessor: (row) => row.diff }],
|
|
54
56
|
}),
|
|
55
57
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
if (options.agents.length === 0) {
|
|
59
|
+
return renderStageFinalFrame({
|
|
60
|
+
metadataLines: shell.metadataLines,
|
|
61
|
+
statusTableLines: shell.statusTableLines,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const sections = [
|
|
65
|
+
[
|
|
66
|
+
...shell.metadataLines,
|
|
67
|
+
...(shell.statusTableLines.length > 0
|
|
68
|
+
? ["", ...shell.statusTableLines]
|
|
69
|
+
: []),
|
|
70
|
+
],
|
|
71
|
+
["---"],
|
|
72
|
+
];
|
|
73
|
+
options.agents.forEach((agent, index) => {
|
|
74
|
+
const block = [`Agent: ${agent.agentId}`];
|
|
75
|
+
if (agent.errorLine) {
|
|
76
|
+
const inlineError = agent.errorLine.replace(/\s+/gu, " ").trim();
|
|
77
|
+
block.push("", formatAgentErrorLine(inlineError, style));
|
|
78
|
+
}
|
|
79
|
+
block.push("", `Output: ${agent.outputPath ?? DASH}`);
|
|
80
|
+
if (index < options.agents.length - 1) {
|
|
81
|
+
block.push("", "---");
|
|
82
|
+
}
|
|
83
|
+
sections.push(block);
|
|
59
84
|
});
|
|
85
|
+
return renderTranscript({ sections });
|
|
60
86
|
}
|
|
61
87
|
function formatErrorDetail(error) {
|
|
62
88
|
if (error instanceof Error) {
|
|
@@ -2,7 +2,7 @@ import { getAgentStatusStyle, getRunStatusStyle } from "../../status/colors.js";
|
|
|
2
2
|
import { TERMINAL_SPEC_STATUSES } from "../../status/index.js";
|
|
3
3
|
import { formatAgentErrorLine } from "../utils/agents.js";
|
|
4
4
|
import { formatAgentBadge } from "../utils/badges.js";
|
|
5
|
-
import { formatRenderLifecycleDuration } from "../utils/duration.js";
|
|
5
|
+
import { formatRenderLifecycleDuration, formatRenderLifecycleRowDuration, } from "../utils/duration.js";
|
|
6
6
|
import { createInteractiveFrameRenderer } from "../utils/interactive-frame.js";
|
|
7
7
|
import { buildStageFrameLines, buildStageFrameSections, renderStageFinalFrame, } from "../utils/stage-output.js";
|
|
8
8
|
import { renderTranscript } from "../utils/transcript.js";
|
|
@@ -132,10 +132,7 @@ export function createSpecRenderer(options = {}) {
|
|
|
132
132
|
return Number.isNaN(parsed) ? undefined : parsed;
|
|
133
133
|
}
|
|
134
134
|
function formatDuration(record) {
|
|
135
|
-
|
|
136
|
-
return DASH;
|
|
137
|
-
}
|
|
138
|
-
return (formatRenderLifecycleDuration({
|
|
135
|
+
return formatRenderLifecycleRowDuration({
|
|
139
136
|
lifecycle: {
|
|
140
137
|
status: record.status,
|
|
141
138
|
startedAt: record.startedAt,
|
|
@@ -143,7 +140,7 @@ export function createSpecRenderer(options = {}) {
|
|
|
143
140
|
},
|
|
144
141
|
terminalStatuses: ["succeeded", "failed"],
|
|
145
142
|
now: now(),
|
|
146
|
-
})
|
|
143
|
+
});
|
|
147
144
|
}
|
|
148
145
|
function syncContextLifecycleFromAgentRecords() {
|
|
149
146
|
if (!context) {
|
|
@@ -325,7 +322,7 @@ export function formatSpecElapsed(options, now) {
|
|
|
325
322
|
});
|
|
326
323
|
}
|
|
327
324
|
export function formatSpecAgentDuration(options) {
|
|
328
|
-
return (
|
|
325
|
+
return formatRenderLifecycleRowDuration({
|
|
329
326
|
lifecycle: {
|
|
330
327
|
status: options.status,
|
|
331
328
|
startedAt: options.startedAt,
|
|
@@ -333,7 +330,7 @@ export function formatSpecAgentDuration(options) {
|
|
|
333
330
|
},
|
|
334
331
|
terminalStatuses: ["succeeded", "failed"],
|
|
335
332
|
now: options.now,
|
|
336
|
-
})
|
|
333
|
+
});
|
|
337
334
|
}
|
|
338
335
|
export function renderSpecTranscript(input, options = {}) {
|
|
339
336
|
const { suppressHint } = options;
|
|
@@ -5,13 +5,14 @@ type CliWriter = Pick<NodeJS.WriteStream, "write"> & {
|
|
|
5
5
|
isTTY?: boolean;
|
|
6
6
|
columns?: number;
|
|
7
7
|
};
|
|
8
|
+
type VerifyTranscriptStatus = "queued" | "running" | "succeeded" | "failed" | "aborted" | "unresolved";
|
|
8
9
|
export interface VerifyProgressContext {
|
|
9
10
|
verificationId: string;
|
|
10
11
|
createdAt: string;
|
|
11
12
|
startedAt?: string;
|
|
12
13
|
completedAt?: string;
|
|
13
14
|
workspacePath: string;
|
|
14
|
-
status:
|
|
15
|
+
status: VerifyTranscriptStatus;
|
|
15
16
|
}
|
|
16
17
|
export interface VerifyProgressMethodRecord {
|
|
17
18
|
methodKey: string;
|
|
@@ -34,7 +35,7 @@ interface VerifyRendererOptions {
|
|
|
34
35
|
export interface VerifyProgressRenderer extends StageProgressEventConsumer<VerifyProgressContext, VerifyProgressMethodRecord> {
|
|
35
36
|
begin(context?: VerifyProgressContext): void;
|
|
36
37
|
update(record: VerifyProgressMethodRecord): void;
|
|
37
|
-
complete(status?:
|
|
38
|
+
complete(status?: VerifyTranscriptStatus, lifecycle?: {
|
|
38
39
|
startedAt?: string;
|
|
39
40
|
completedAt?: string;
|
|
40
41
|
}): void;
|
|
@@ -54,11 +55,12 @@ export declare function renderVerifyTranscript(options: {
|
|
|
54
55
|
createdAt: string;
|
|
55
56
|
elapsed: string;
|
|
56
57
|
workspacePath: string;
|
|
58
|
+
targetDisplay?: string;
|
|
57
59
|
target?: {
|
|
58
60
|
kind: string;
|
|
59
61
|
sessionId: string;
|
|
60
62
|
};
|
|
61
|
-
status:
|
|
63
|
+
status: VerifyTranscriptStatus;
|
|
62
64
|
methods: readonly VerifyTranscriptMethodBlock[];
|
|
63
65
|
suppressHint?: boolean;
|
|
64
66
|
warningMessage?: string;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { getRunStatusStyle } from "../../status/colors.js";
|
|
2
2
|
import { TERMINAL_VERIFICATION_STATUSES } from "../../status/index.js";
|
|
3
|
-
import { formatRenderLifecycleDuration } from "../utils/duration.js";
|
|
3
|
+
import { formatRenderLifecycleDuration, formatRenderLifecycleRowDuration, } from "../utils/duration.js";
|
|
4
4
|
import { createInteractiveFrameRenderer } from "../utils/interactive-frame.js";
|
|
5
5
|
import { buildStageFrameLines, buildStageFrameSections, } from "../utils/stage-output.js";
|
|
6
6
|
import { renderTable } from "../utils/table.js";
|
|
7
7
|
import { renderTranscript } from "../utils/transcript.js";
|
|
8
8
|
import { buildStandardSessionShellSection, formatTranscriptErrorLine, formatTranscriptStatusLabel, resolveTranscriptShellStyle, resolveTranscriptShellStyleFromWriter, } from "../utils/transcript-shell.js";
|
|
9
9
|
const DASH = "—";
|
|
10
|
+
const VERIFY_TRANSCRIPT_TERMINAL_STATUSES = [
|
|
11
|
+
...TERMINAL_VERIFICATION_STATUSES,
|
|
12
|
+
"unresolved",
|
|
13
|
+
];
|
|
10
14
|
function formatErrorDetail(error) {
|
|
11
15
|
if (error instanceof Error) {
|
|
12
16
|
return error.message;
|
|
@@ -39,19 +43,23 @@ function formatErrorDetail(error) {
|
|
|
39
43
|
return "unknown error";
|
|
40
44
|
}
|
|
41
45
|
function buildVerifyStageShell(options) {
|
|
46
|
+
const metadataLines = buildStandardSessionShellSection({
|
|
47
|
+
badgeText: options.verificationId,
|
|
48
|
+
badgeVariant: "verify",
|
|
49
|
+
status: {
|
|
50
|
+
value: options.status,
|
|
51
|
+
color: options.status === "unresolved"
|
|
52
|
+
? "yellow"
|
|
53
|
+
: getRunStatusStyle(options.status).cli,
|
|
54
|
+
},
|
|
55
|
+
elapsed: options.elapsed,
|
|
56
|
+
createdAt: options.createdAt,
|
|
57
|
+
workspacePath: options.workspacePath,
|
|
58
|
+
targetDisplay: options.targetDisplay,
|
|
59
|
+
style: options.style,
|
|
60
|
+
});
|
|
42
61
|
return {
|
|
43
|
-
metadataLines
|
|
44
|
-
badgeText: options.verificationId,
|
|
45
|
-
badgeVariant: "verify",
|
|
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
|
-
}),
|
|
62
|
+
metadataLines,
|
|
55
63
|
statusTableLines: options.tableLines ?? [],
|
|
56
64
|
};
|
|
57
65
|
}
|
|
@@ -159,10 +167,7 @@ export function createVerifyRenderer(options = {}) {
|
|
|
159
167
|
return Number.isNaN(parsed) ? undefined : parsed;
|
|
160
168
|
}
|
|
161
169
|
function formatDuration(record) {
|
|
162
|
-
|
|
163
|
-
return DASH;
|
|
164
|
-
}
|
|
165
|
-
return (formatRenderLifecycleDuration({
|
|
170
|
+
return formatRenderLifecycleRowDuration({
|
|
166
171
|
lifecycle: {
|
|
167
172
|
status: record.status,
|
|
168
173
|
startedAt: record.startedAt,
|
|
@@ -170,7 +175,7 @@ export function createVerifyRenderer(options = {}) {
|
|
|
170
175
|
},
|
|
171
176
|
terminalStatuses: TERMINAL_VERIFICATION_STATUSES,
|
|
172
177
|
now: now(),
|
|
173
|
-
})
|
|
178
|
+
});
|
|
174
179
|
}
|
|
175
180
|
function syncContextLifecycleFromMethods() {
|
|
176
181
|
if (!context) {
|
|
@@ -312,6 +317,17 @@ export function createVerifyRenderer(options = {}) {
|
|
|
312
317
|
},
|
|
313
318
|
complete(status, lifecycle) {
|
|
314
319
|
stopRefreshLoop();
|
|
320
|
+
const allowTerminalOverride = disabled &&
|
|
321
|
+
stdout.isTTY === true &&
|
|
322
|
+
context !== undefined &&
|
|
323
|
+
status !== undefined &&
|
|
324
|
+
context.status !== status;
|
|
325
|
+
if (disabled && !allowTerminalOverride) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (allowTerminalOverride) {
|
|
329
|
+
disabled = false;
|
|
330
|
+
}
|
|
315
331
|
guard(() => {
|
|
316
332
|
if (context && lifecycle) {
|
|
317
333
|
context = {
|
|
@@ -321,11 +337,11 @@ export function createVerifyRenderer(options = {}) {
|
|
|
321
337
|
};
|
|
322
338
|
}
|
|
323
339
|
if (status) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
340
|
+
if (context) {
|
|
341
|
+
context = { ...context, status };
|
|
342
|
+
}
|
|
343
|
+
render();
|
|
344
|
+
syncRefreshLoop();
|
|
329
345
|
}
|
|
330
346
|
else {
|
|
331
347
|
render();
|
|
@@ -336,10 +352,12 @@ export function createVerifyRenderer(options = {}) {
|
|
|
336
352
|
};
|
|
337
353
|
}
|
|
338
354
|
export function renderVerifyTranscript(options) {
|
|
339
|
-
const { verificationId, createdAt, elapsed, workspacePath, target, status, methods, suppressHint, warningMessage, hintMessage, isTty, includeSummarySection = true, } = options;
|
|
355
|
+
const { verificationId, createdAt, elapsed, workspacePath, targetDisplay, target, status, methods, suppressHint, warningMessage, hintMessage, isTty, includeSummarySection = true, } = options;
|
|
340
356
|
const style = { isTty };
|
|
341
357
|
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
342
358
|
const sections = [];
|
|
359
|
+
const resolvedTargetDisplay = targetDisplay ??
|
|
360
|
+
(target ? `${target.kind}:${target.sessionId}` : undefined);
|
|
343
361
|
if (includeSummarySection) {
|
|
344
362
|
const metadataLines = buildVerifyStageShell({
|
|
345
363
|
verificationId,
|
|
@@ -347,6 +365,7 @@ export function renderVerifyTranscript(options) {
|
|
|
347
365
|
elapsed,
|
|
348
366
|
workspacePath,
|
|
349
367
|
status,
|
|
368
|
+
targetDisplay: resolvedTargetDisplay,
|
|
350
369
|
tableLines: methods.length === 0
|
|
351
370
|
? []
|
|
352
371
|
: buildVerifyMethodTable(methods.map((method) => ({
|
|
@@ -363,12 +382,6 @@ export function renderVerifyTranscript(options) {
|
|
|
363
382
|
if (methods.length > 0) {
|
|
364
383
|
sections.push(["---"]);
|
|
365
384
|
}
|
|
366
|
-
if (target) {
|
|
367
|
-
sections.push([`Target: ${target.kind}:${target.sessionId}`]);
|
|
368
|
-
if (methods.length > 0) {
|
|
369
|
-
sections.push(["---"]);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
385
|
methods.forEach((method, index) => {
|
|
373
386
|
const block = [`Agent: ${method.agentLabel ?? DASH}`];
|
|
374
387
|
block.push("", `Verifier: ${method.verifierLabel}`);
|
|
@@ -403,7 +416,7 @@ export function formatVerifyElapsed(source, now) {
|
|
|
403
416
|
startedAt: source.startedAt,
|
|
404
417
|
completedAt: source.completedAt,
|
|
405
418
|
},
|
|
406
|
-
terminalStatuses:
|
|
419
|
+
terminalStatuses: VERIFY_TRANSCRIPT_TERMINAL_STATUSES,
|
|
407
420
|
now,
|
|
408
421
|
});
|
|
409
422
|
}
|
|
@@ -9,4 +9,9 @@ export declare function formatRenderLifecycleDuration<TStatus extends string>(op
|
|
|
9
9
|
terminalStatuses: readonly TStatus[];
|
|
10
10
|
now?: number;
|
|
11
11
|
}): string | undefined;
|
|
12
|
+
export declare function formatRenderLifecycleRowDuration<TStatus extends string>(options: {
|
|
13
|
+
lifecycle: LifecycleExecutionDurationInput<TStatus>;
|
|
14
|
+
terminalStatuses: readonly TStatus[];
|
|
15
|
+
now?: number;
|
|
16
|
+
}): string;
|
|
12
17
|
export declare function formatDurationLabel(durationMs: number): string | undefined;
|
|
@@ -15,6 +15,12 @@ export function formatRenderLifecycleDuration(options) {
|
|
|
15
15
|
}
|
|
16
16
|
return formatDurationLabel(durationMs);
|
|
17
17
|
}
|
|
18
|
+
export function formatRenderLifecycleRowDuration(options) {
|
|
19
|
+
if (!options.terminalStatuses.includes(options.lifecycle.status)) {
|
|
20
|
+
return "—";
|
|
21
|
+
}
|
|
22
|
+
return formatRenderLifecycleDuration(options) ?? "—";
|
|
23
|
+
}
|
|
18
24
|
export function formatDurationLabel(durationMs) {
|
|
19
25
|
if (!Number.isFinite(durationMs) || durationMs < 0) {
|
|
20
26
|
return undefined;
|
|
@@ -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" | "message" | "agent";
|
|
18
|
+
export type TranscriptBadgeVariant = "run" | "verify" | "reduce" | "spec" | "message" | "interactive" | "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;
|
|
@@ -49,6 +49,7 @@ export declare function buildStandardSessionShellSection(options: {
|
|
|
49
49
|
elapsed?: string;
|
|
50
50
|
createdAt?: string;
|
|
51
51
|
workspacePath?: string;
|
|
52
|
+
targetDisplay?: string;
|
|
52
53
|
style?: TranscriptShellStyleOptions;
|
|
53
54
|
}): string[];
|
|
54
55
|
export interface TranscriptStatusTableColumn<Row> {
|
|
@@ -21,7 +21,8 @@ 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 = "
|
|
24
|
+
const MESSAGE_COLOR = "252;251;248";
|
|
25
|
+
const INTERACTIVE_COLOR = "219;221;224";
|
|
25
26
|
const BADGE_STYLES = {
|
|
26
27
|
run: {
|
|
27
28
|
foreground: `${ESC}38;2;0;0;0m`,
|
|
@@ -48,6 +49,11 @@ const BADGE_STYLES = {
|
|
|
48
49
|
background: `${ESC}48;2;${MESSAGE_COLOR}m`,
|
|
49
50
|
bold: true,
|
|
50
51
|
},
|
|
52
|
+
interactive: {
|
|
53
|
+
foreground: `${ESC}38;2;0;0;0m`,
|
|
54
|
+
background: `${ESC}48;2;${INTERACTIVE_COLOR}m`,
|
|
55
|
+
bold: true,
|
|
56
|
+
},
|
|
51
57
|
agent: {
|
|
52
58
|
bold: true,
|
|
53
59
|
},
|
|
@@ -129,15 +135,22 @@ export function buildTranscriptShellSection(options) {
|
|
|
129
135
|
return lines;
|
|
130
136
|
}
|
|
131
137
|
export function buildStandardSessionShellSection(options) {
|
|
138
|
+
const detailRows = buildStandardSessionDetailRows({
|
|
139
|
+
elapsed: options.elapsed,
|
|
140
|
+
createdAt: options.createdAt,
|
|
141
|
+
workspacePath: options.workspacePath,
|
|
142
|
+
});
|
|
143
|
+
if (options.targetDisplay) {
|
|
144
|
+
detailRows.push({
|
|
145
|
+
label: "Target",
|
|
146
|
+
value: options.targetDisplay,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
132
149
|
return buildTranscriptShellSection({
|
|
133
150
|
badgeText: options.badgeText,
|
|
134
151
|
badgeVariant: options.badgeVariant,
|
|
135
152
|
status: options.status,
|
|
136
|
-
detailRows
|
|
137
|
-
elapsed: options.elapsed,
|
|
138
|
-
createdAt: options.createdAt,
|
|
139
|
-
workspacePath: options.workspacePath,
|
|
140
|
-
}),
|
|
153
|
+
detailRows,
|
|
141
154
|
style: options.style,
|
|
142
155
|
});
|
|
143
156
|
}
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type GitRepositoryErrorReason = "no_repository" | "not_repository_root";
|
|
2
2
|
export declare class GitRepositoryError extends Error {
|
|
3
3
|
readonly reason: GitRepositoryErrorReason;
|
|
4
|
-
|
|
4
|
+
readonly repositoryRoot?: string;
|
|
5
|
+
constructor(message: string, reason: GitRepositoryErrorReason, repositoryRoot?: string);
|
|
5
6
|
}
|
|
6
7
|
export declare class ValidationError extends Error {
|
|
7
8
|
constructor(message: string);
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export class GitRepositoryError extends Error {
|
|
2
2
|
reason;
|
|
3
|
-
|
|
3
|
+
repositoryRoot;
|
|
4
|
+
constructor(message, reason, repositoryRoot) {
|
|
4
5
|
super(message);
|
|
5
6
|
this.name = "GitRepositoryError";
|
|
6
7
|
this.reason = reason;
|
|
8
|
+
this.repositoryRoot = repositoryRoot;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
11
|
export class ValidationError extends Error {
|