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.
Files changed (149) hide show
  1. package/README.md +18 -22
  2. package/dist/agents/launch/chat.d.ts +3 -1
  3. package/dist/agents/launch/chat.js +2 -0
  4. package/dist/bin.js +28 -7
  5. package/dist/cli/auto.js +1 -0
  6. package/dist/cli/contract.d.ts +26 -17
  7. package/dist/cli/contract.js +3 -1
  8. package/dist/cli/doctor.d.ts +12 -0
  9. package/dist/cli/doctor.js +115 -0
  10. package/dist/cli/list.js +4 -1
  11. package/dist/cli/operator-envelope.d.ts +19 -6
  12. package/dist/cli/operator-envelope.js +61 -1
  13. package/dist/cli/run.js +2 -0
  14. package/dist/cli/verify.d.ts +1 -1
  15. package/dist/cli/verify.js +48 -9
  16. package/dist/commands/auto/command.d.ts +1 -0
  17. package/dist/commands/auto/command.js +22 -12
  18. package/dist/commands/auto/errors.js +1 -1
  19. package/dist/commands/doctor/agents.d.ts +5 -0
  20. package/dist/commands/{init → doctor}/agents.js +37 -19
  21. package/dist/commands/doctor/command.d.ts +22 -0
  22. package/dist/commands/doctor/command.js +99 -0
  23. package/dist/commands/doctor/environment.d.ts +2 -0
  24. package/dist/commands/{init → doctor}/environment.js +38 -6
  25. package/dist/commands/{init/types.d.ts → doctor/fix-types.d.ts} +30 -9
  26. package/dist/commands/doctor/fix.d.ts +2 -0
  27. package/dist/commands/{init/command.js → doctor/fix.js} +106 -10
  28. package/dist/commands/doctor/reconcile.d.ts +2 -0
  29. package/dist/commands/doctor/reconcile.js +101 -0
  30. package/dist/commands/interactive/lifecycle.d.ts +2 -0
  31. package/dist/commands/interactive/lifecycle.js +8 -0
  32. package/dist/commands/list/command.d.ts +1 -0
  33. package/dist/commands/list/command.js +211 -352
  34. package/dist/commands/list/normalization.d.ts +56 -0
  35. package/dist/commands/list/normalization.js +317 -0
  36. package/dist/commands/message/command.d.ts +2 -1
  37. package/dist/commands/message/command.js +35 -14
  38. package/dist/commands/message/errors.d.ts +12 -3
  39. package/dist/commands/message/errors.js +19 -3
  40. package/dist/commands/reduce/command.js +16 -17
  41. package/dist/commands/reduce/errors.d.ts +2 -2
  42. package/dist/commands/reduce/errors.js +3 -3
  43. package/dist/commands/reduce/targets.js +11 -2
  44. package/dist/commands/root-launcher/command.js +12 -6
  45. package/dist/commands/run/command.d.ts +1 -0
  46. package/dist/commands/run/command.js +4 -1
  47. package/dist/commands/run/record-init.d.ts +2 -0
  48. package/dist/commands/run/record-init.js +2 -1
  49. package/dist/commands/run/spec-provenance.d.ts +37 -0
  50. package/dist/commands/run/spec-provenance.js +384 -0
  51. package/dist/commands/run/validation.d.ts +4 -0
  52. package/dist/commands/run/validation.js +25 -62
  53. package/dist/commands/spec/command.js +19 -6
  54. package/dist/commands/spec/errors.d.ts +5 -0
  55. package/dist/commands/spec/errors.js +9 -0
  56. package/dist/commands/verify/agents.d.ts +4 -2
  57. package/dist/commands/verify/agents.js +4 -11
  58. package/dist/commands/verify/command.js +15 -5
  59. package/dist/commands/verify/errors.d.ts +12 -0
  60. package/dist/commands/verify/errors.js +22 -0
  61. package/dist/commands/verify/targets.js +108 -12
  62. package/dist/competition/shared/preflight.d.ts +1 -1
  63. package/dist/competition/shared/preflight.js +15 -2
  64. package/dist/contracts/list.d.ts +129 -149
  65. package/dist/contracts/list.js +47 -99
  66. package/dist/domain/interactive/persistence/adapter.d.ts +23 -0
  67. package/dist/domain/interactive/persistence/adapter.js +42 -0
  68. package/dist/domain/message/model/types.d.ts +32 -0
  69. package/dist/domain/message/model/types.js +25 -0
  70. package/dist/domain/reduce/competition/adapter.js +21 -7
  71. package/dist/domain/reduce/competition/finalize.d.ts +7 -0
  72. package/dist/domain/reduce/competition/finalize.js +19 -0
  73. package/dist/domain/reduce/model/types.d.ts +3 -3
  74. package/dist/domain/run/competition/agents/artifacts.js +4 -2
  75. package/dist/domain/run/competition/errors.d.ts +1 -1
  76. package/dist/domain/run/competition/errors.js +4 -7
  77. package/dist/domain/run/model/types.d.ts +384 -0
  78. package/dist/domain/run/model/types.js +87 -0
  79. package/dist/domain/spec/competition/adapter.d.ts +1 -0
  80. package/dist/domain/spec/competition/adapter.js +6 -1
  81. package/dist/domain/spec/model/types.d.ts +3 -0
  82. package/dist/domain/spec/model/types.js +5 -0
  83. package/dist/domain/verify/competition/finalize.d.ts +9 -0
  84. package/dist/domain/verify/competition/finalize.js +22 -3
  85. package/dist/domain/verify/model/types.d.ts +2 -2
  86. package/dist/interactive/providers/mcp.d.ts +1 -0
  87. package/dist/interactive/providers/mcp.js +45 -7
  88. package/dist/interactive/substrate.js +20 -3
  89. package/dist/mcp/server.js +26 -9
  90. package/dist/policy/verification.js +18 -1
  91. package/dist/preflight/agents.d.ts +24 -0
  92. package/dist/preflight/agents.js +71 -0
  93. package/dist/preflight/environment.d.ts +6 -0
  94. package/dist/preflight/environment.js +17 -0
  95. package/dist/preflight/formatting.d.ts +5 -0
  96. package/dist/preflight/formatting.js +20 -0
  97. package/dist/preflight/index.d.ts +2 -0
  98. package/dist/preflight/index.js +5 -9
  99. package/dist/preflight/operator.d.ts +32 -0
  100. package/dist/preflight/operator.js +40 -0
  101. package/dist/preflight/settings.d.ts +2 -0
  102. package/dist/preflight/settings.js +17 -0
  103. package/dist/render/transcripts/interactive.d.ts +16 -0
  104. package/dist/render/transcripts/interactive.js +42 -0
  105. package/dist/render/transcripts/list.d.ts +41 -0
  106. package/dist/render/transcripts/list.js +152 -3
  107. package/dist/render/transcripts/message.d.ts +2 -1
  108. package/dist/render/transcripts/message.js +19 -20
  109. package/dist/render/transcripts/reduce.d.ts +1 -0
  110. package/dist/render/transcripts/reduce.js +21 -21
  111. package/dist/render/transcripts/root-launcher.js +2 -12
  112. package/dist/render/transcripts/run.d.ts +3 -0
  113. package/dist/render/transcripts/run.js +30 -4
  114. package/dist/render/transcripts/spec.js +5 -8
  115. package/dist/render/transcripts/verify.d.ts +5 -3
  116. package/dist/render/transcripts/verify.js +44 -31
  117. package/dist/render/utils/duration.d.ts +5 -0
  118. package/dist/render/utils/duration.js +6 -0
  119. package/dist/render/utils/runs.d.ts +1 -0
  120. package/dist/render/utils/runs.js +1 -0
  121. package/dist/render/utils/transcript-shell.d.ts +2 -1
  122. package/dist/render/utils/transcript-shell.js +19 -6
  123. package/dist/utils/errors.d.ts +2 -1
  124. package/dist/utils/errors.js +3 -1
  125. package/dist/utils/git.d.ts +1 -1
  126. package/dist/utils/git.js +25 -2
  127. package/dist/utils/list-target.d.ts +4 -0
  128. package/dist/utils/list-target.js +35 -0
  129. package/dist/utils/terminal.d.ts +1 -0
  130. package/dist/utils/terminal.js +11 -0
  131. package/dist/workspace/chat/artifacts.d.ts +7 -0
  132. package/dist/workspace/chat/artifacts.js +94 -3
  133. package/dist/workspace/errors.js +2 -2
  134. package/dist/workspace/managed-state.d.ts +32 -0
  135. package/dist/workspace/managed-state.js +103 -0
  136. package/dist/workspace/setup.js +66 -2
  137. package/dist/workspace/shim.d.ts +1 -0
  138. package/dist/workspace/shim.js +3 -3
  139. package/dist/workspace/structure.d.ts +1 -0
  140. package/dist/workspace/structure.js +1 -0
  141. package/package.json +2 -2
  142. package/dist/cli/init.d.ts +0 -15
  143. package/dist/cli/init.js +0 -70
  144. package/dist/commands/init/agents.d.ts +0 -4
  145. package/dist/commands/init/command.d.ts +0 -2
  146. package/dist/commands/init/environment.d.ts +0 -2
  147. package/dist/render/transcripts/init.d.ts +0 -7
  148. package/dist/render/transcripts/init.js +0 -83
  149. /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
- if (record.status === "running") {
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
- }) ?? DASH);
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: 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
- }),
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 formatRenderLifecycleDuration({
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: buildStandardSessionShellSection({
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
- if (record.status === "running") {
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
- }) ?? DASH);
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 (formatRenderLifecycleDuration({
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
- return renderStageFinalFrame({
57
- metadataLines: shell.metadataLines,
58
- statusTableLines: shell.statusTableLines,
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
- if (record.status === "running") {
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
- }) ?? DASH);
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 (formatRenderLifecycleDuration({
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
- }) ?? DASH);
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: "queued" | "running" | "succeeded" | "failed" | "aborted";
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?: VerifyProgressContext["status"], lifecycle?: {
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: "queued" | "running" | "succeeded" | "failed" | "aborted";
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: buildStandardSessionShellSection({
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
- if (record.status === "running") {
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
- }) ?? DASH);
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
- this.onProgressEvent({
325
- type: "stage.status",
326
- stage: "verify",
327
- status,
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: TERMINAL_VERIFICATION_STATUSES,
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;
@@ -6,5 +6,6 @@ export interface RunDisplayInfo {
6
6
  workspacePath?: string;
7
7
  elapsed?: string;
8
8
  createdAt?: string;
9
+ targetDisplay?: string;
9
10
  }
10
11
  export declare function buildRunMetadataSectionWithStyle(info: RunDisplayInfo, style?: TranscriptShellStyleOptions): string[];
@@ -13,6 +13,7 @@ export function buildRunMetadataSectionWithStyle(info, style = {}) {
13
13
  elapsed: info.elapsed,
14
14
  createdAt: info.createdAt,
15
15
  workspacePath: info.workspacePath,
16
+ targetDisplay: info.targetDisplay,
16
17
  style,
17
18
  });
18
19
  }
@@ -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 = "245;242;235";
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: buildStandardSessionDetailRows({
137
- elapsed: options.elapsed,
138
- createdAt: options.createdAt,
139
- workspacePath: options.workspacePath,
140
- }),
153
+ detailRows,
141
154
  style: options.style,
142
155
  });
143
156
  }
@@ -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
- constructor(message: string, reason: GitRepositoryErrorReason);
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);
@@ -1,9 +1,11 @@
1
1
  export class GitRepositoryError extends Error {
2
2
  reason;
3
- constructor(message, reason) {
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 {