@mrclrchtr/supi-review 7.3.0 → 7.4.0

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 (58) hide show
  1. package/README.md +4 -0
  2. package/node_modules/@mrclrchtr/supi-agent-runtime/README.md +10 -0
  3. package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-agent-runtime/package.json +7 -3
  5. package/node_modules/@mrclrchtr/supi-agent-runtime/src/api.ts +37 -1
  6. package/node_modules/@mrclrchtr/supi-agent-runtime/src/run.ts +151 -21
  7. package/node_modules/@mrclrchtr/supi-agent-runtime/src/session/agent-run-registry-types.ts +95 -0
  8. package/node_modules/@mrclrchtr/supi-agent-runtime/src/session/agent-run-registry.ts +372 -0
  9. package/node_modules/@mrclrchtr/supi-agent-runtime/src/session/transcript-format.ts +184 -0
  10. package/node_modules/@mrclrchtr/supi-agent-runtime/src/session/transcript-store.ts +284 -0
  11. package/node_modules/@mrclrchtr/supi-agent-runtime/src/types.ts +22 -0
  12. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-command.ts +206 -0
  13. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-overlay-data.ts +78 -0
  14. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-overlay-render.ts +167 -0
  15. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-overlay.ts +400 -0
  16. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-run-list.ts +95 -0
  17. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-run-switcher.ts +29 -0
  18. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-run-viewer-input.ts +69 -0
  19. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-run-viewer-render.ts +246 -0
  20. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-run-viewer.ts +400 -0
  21. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-run-viewport.ts +112 -0
  22. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-steering-input.ts +50 -0
  23. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-transcript-context.ts +56 -0
  24. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-transcript-pane.ts +386 -0
  25. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-transcript-payload.ts +66 -0
  26. package/node_modules/@mrclrchtr/supi-agent-runtime/src/ui/agents-transcript.ts +380 -0
  27. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  28. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  29. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  30. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  31. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.js +25 -6
  32. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/legacy.js +22 -6
  33. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/package.json +1 -1
  34. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/connection.js +2 -2
  35. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.d.ts +1 -0
  36. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.js +7 -0
  37. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/package.json +2 -2
  38. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.d.ts +2 -2
  39. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.d.ts +2 -2
  40. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.d.ts +2 -2
  41. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/package.json +4 -4
  42. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/package.json +2 -2
  43. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
  44. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  45. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  46. package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
  47. package/node_modules/@mrclrchtr/supi-code-intelligence/package.json +5 -5
  48. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  49. package/package.json +4 -4
  50. package/src/review.ts +5 -2
  51. package/src/tool/review_run/child-session.ts +29 -7
  52. package/src/tool/review_run/execute.ts +6 -1
  53. package/src/tool/review_run/execution.ts +6 -0
  54. package/src/tool/review_run/register.ts +3 -1
  55. package/src/tool/review_run/runner.ts +40 -0
  56. package/src/tool/review_run/workflow.ts +7 -1
  57. package/src/tui/review-command.ts +74 -3
  58. package/src/types.ts +5 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vscode-languageserver-types",
3
3
  "description": "Types used by the Language server for node",
4
- "version": "3.18.3",
4
+ "version": "3.18.4",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -23,7 +23,7 @@
23
23
  }
24
24
  },
25
25
  "scripts": {
26
- "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail",
26
+ "prepublishOnly": "npm run all:publish",
27
27
  "prepack": "npm run all:publish",
28
28
  "compile": "tsc -b ./tsconfig.json",
29
29
  "clean": "rimraf lib",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-lsp",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Language Server Protocol runtime for SuPi code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "vscode-jsonrpc": "^9.0.0",
38
38
  "vscode-languageserver-protocol": "^3.18.0",
39
39
  "vscode-languageserver-types": "^3.18.0",
40
- "@mrclrchtr/supi-code-runtime": "7.3.0",
41
- "@mrclrchtr/supi-core": "7.3.0"
40
+ "@mrclrchtr/supi-core": "7.4.0",
41
+ "@mrclrchtr/supi-code-runtime": "7.4.0"
42
42
  },
43
43
  "bundledDependencies": [
44
44
  "@mrclrchtr/supi-code-runtime",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-tree-sitter",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Structural AST analysis for SuPi code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "dependencies": {
37
37
  "jiti": "^2.7.0",
38
38
  "web-tree-sitter": "^0.27.0",
39
- "@mrclrchtr/supi-code-runtime": "7.3.0",
40
- "@mrclrchtr/supi-core": "7.3.0"
39
+ "@mrclrchtr/supi-code-runtime": "7.4.0",
40
+ "@mrclrchtr/supi-core": "7.4.0"
41
41
  },
42
42
  "bundledDependencies": [
43
43
  "@mrclrchtr/supi-code-runtime",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-intelligence",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "LSP and AST navigation, search, diagnostics, and refactoring",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,10 +35,10 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "yaml": "^2.9.0",
38
- "@mrclrchtr/supi-code-runtime": "7.3.0",
39
- "@mrclrchtr/supi-core": "7.3.0",
40
- "@mrclrchtr/supi-lsp": "7.3.0",
41
- "@mrclrchtr/supi-tree-sitter": "7.3.0"
38
+ "@mrclrchtr/supi-code-runtime": "7.4.0",
39
+ "@mrclrchtr/supi-core": "7.4.0",
40
+ "@mrclrchtr/supi-lsp": "7.4.0",
41
+ "@mrclrchtr/supi-tree-sitter": "7.4.0"
42
42
  },
43
43
  "bundledDependencies": [
44
44
  "@mrclrchtr/supi-code-runtime",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-review",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Parallel inspection-only reviews of exact Git targets",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "README.md"
32
32
  ],
33
33
  "dependencies": {
34
- "@mrclrchtr/supi-agent-runtime": "7.3.0",
35
- "@mrclrchtr/supi-code-intelligence": "7.3.0",
36
- "@mrclrchtr/supi-core": "7.3.0"
34
+ "@mrclrchtr/supi-code-intelligence": "7.4.0",
35
+ "@mrclrchtr/supi-core": "7.4.0",
36
+ "@mrclrchtr/supi-agent-runtime": "7.4.0"
37
37
  },
38
38
  "bundledDependencies": [
39
39
  "@mrclrchtr/supi-agent-runtime",
package/src/review.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { type ExtensionAPI, getAgentDir } from "@earendil-works/pi-coding-agent";
2
2
  import { Box } from "@earendil-works/pi-tui";
3
+ import { registerAgentsCommand } from "@mrclrchtr/supi-agent-runtime/api";
3
4
  import { LocalReviewAuditStore } from "./audit/local-review-audit-store.ts";
4
5
  import { registerReviewSettings, syncReviewAgentTools } from "./config.ts";
5
6
  import { ReviewArtifactStore } from "./session/review-artifact-store.ts";
@@ -16,9 +17,10 @@ export default function reviewExtension(pi: ExtensionAPI): void {
16
17
  const auditStore = new LocalReviewAuditStore({
17
18
  agentDir: process.env.PI_CODING_AGENT_DIR || getAgentDir(),
18
19
  });
20
+ const registry = registerAgentsCommand(pi);
19
21
  registerReviewSettings(pi);
20
22
  registerReviewOutputTool(pi, artifactStore);
21
- registerReviewRunTool(pi, artifactStore, auditStore);
23
+ registerReviewRunTool(pi, artifactStore, auditStore, registry);
22
24
  registerReviewAuditTool(pi, auditStore);
23
25
  pi.on("session_start", (_event, ctx) => syncReviewAgentTools(pi, ctx.cwd));
24
26
  registerReviewWorkspaceCleanupCommand(pi);
@@ -39,6 +41,7 @@ export default function reviewExtension(pi: ExtensionAPI): void {
39
41
 
40
42
  pi.registerCommand("supi-review", {
41
43
  description: "Run one or more caller-defined Inspection-only review tasks",
42
- handler: async (_args, ctx) => runReviewCommand(ctx, { pi, artifactStore, auditStore }),
44
+ handler: async (_args, ctx) =>
45
+ runReviewCommand(ctx, { pi, artifactStore, auditStore, registry }),
43
46
  });
44
47
  }
@@ -3,11 +3,16 @@ import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
3
3
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
4
4
  import {
5
5
  type AgentRunContinuation,
6
+ type AgentRunDisplayMetadata,
7
+ type AgentRunDisplayResult,
6
8
  type AgentRunOutcome,
7
9
  type AgentRunProgress,
8
10
  type AgentRunProviderAuthority,
11
+ type AgentRunRegistry,
9
12
  type AgentRunSessionView,
13
+ type StartAgentRunOptions,
10
14
  startAgentRun,
15
+ startRegisteredAgentRun,
11
16
  } from "@mrclrchtr/supi-agent-runtime/api";
12
17
  import type { ChildRunOutcome, ReviewProgress } from "../../types.ts";
13
18
  import { createIsolatedChildResources } from "./child-resources.ts";
@@ -38,6 +43,9 @@ export interface IsolatedRunConfig<T> {
38
43
  headlessInspection?: boolean;
39
44
  projectTrusted?: boolean;
40
45
  onSessionCreated?: (session: AgentRunSessionView) => undefined | (() => void);
46
+ runDisplay?: AgentRunDisplayMetadata & { readonly runKey: string; readonly batchId: string };
47
+ registry?: AgentRunRegistry;
48
+ displayResult?: (outcome: ChildRunOutcome<T>) => AgentRunDisplayResult;
41
49
  onProgress?: (progress: ReviewProgress) => void;
42
50
  }
43
51
 
@@ -114,7 +122,7 @@ export async function runIsolatedChild<T>(
114
122
  projectTrusted: config.projectTrusted,
115
123
  },
116
124
  );
117
- const run = startAgentRun<T>({
125
+ const runOptions: StartAgentRunOptions<T> = {
118
126
  inputs: {
119
127
  cwd: config.cwd,
120
128
  model: config.model,
@@ -138,11 +146,17 @@ export async function runIsolatedChild<T>(
138
146
  ? undefined
139
147
  : config.holder.value,
140
148
  ...(config.continuation ? { continuation: config.continuation } : {}),
141
- observer: (session) => {
142
- const cleanup = config.onSessionCreated?.(session);
143
- return typeof cleanup === "function" ? cleanup : undefined;
144
- },
145
- });
149
+ observer: config.onSessionCreated,
150
+ };
151
+ const registeredRun = config.runDisplay
152
+ ? startRegisteredAgentRun<T>({
153
+ ...runOptions,
154
+ registry: config.registry,
155
+ registration: { metadata: config.runDisplay },
156
+ transcriptSystemPrompt: config.protocolPrompt,
157
+ })
158
+ : undefined;
159
+ const run = registeredRun ?? startAgentRun<T>(runOptions);
146
160
  const unsubscribe = config.onProgress
147
161
  ? run.subscribe((progress) => {
148
162
  if (
@@ -155,7 +169,15 @@ export async function runIsolatedChild<T>(
155
169
  })
156
170
  : undefined;
157
171
  try {
158
- return mapOutcome(await run.result);
172
+ const outcome = mapOutcome(await run.result);
173
+ if (registeredRun) {
174
+ config.registry?.setDisplayResult(
175
+ registeredRun.runKey,
176
+ config.displayResult?.(outcome) ??
177
+ (outcome.kind === "failed" ? { failureCode: outcome.failureCode } : {}),
178
+ );
179
+ }
180
+ return outcome;
159
181
  } finally {
160
182
  unsubscribe?.();
161
183
  }
@@ -1,5 +1,8 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
- import { createAgentRunProviderAuthority } from "@mrclrchtr/supi-agent-runtime/api";
2
+ import {
3
+ type AgentRunRegistry,
4
+ createAgentRunProviderAuthority,
5
+ } from "@mrclrchtr/supi-agent-runtime/api";
3
6
  import { StatusSpinner } from "@mrclrchtr/supi-core/status-spinner";
4
7
  import type { LocalReviewAuditStore } from "../../audit/local-review-audit-store.ts";
5
8
  import { loadReviewConfig } from "../../config.ts";
@@ -78,6 +81,7 @@ function initialReviewProgress(input: ReturnType<typeof parseRunReviewToolInput>
78
81
  export function makeRunReviewExecute(
79
82
  artifactStore: ReviewArtifactStore,
80
83
  localAuditStore?: LocalReviewAuditStore,
84
+ registry?: AgentRunRegistry,
81
85
  ): NonNullable<Parameters<ExtensionAPI["registerTool"]>[0]["execute"]> {
82
86
  // biome-ignore lint/complexity/useMaxParams: Pi ToolDefinition execute signature
83
87
  return async (_id, params, signal, onUpdate, ctx) => {
@@ -115,6 +119,7 @@ export function makeRunReviewExecute(
115
119
  bootstrapCommand: config.bootstrapCommand,
116
120
  projectTrusted: ctx.isProjectTrusted(),
117
121
  ...(auditStore ? { auditStore } : {}),
122
+ ...(registry ? { registry } : {}),
118
123
  signal,
119
124
  onUpdate: wrappedUpdate,
120
125
  });
@@ -1,5 +1,7 @@
1
+ import { randomUUID } from "node:crypto";
1
2
  import {
2
3
  type AgentRunProviderAuthority,
4
+ type AgentRunRegistry,
3
5
  createUnobservedAgentRunDiagnostics,
4
6
  } from "@mrclrchtr/supi-agent-runtime/api";
5
7
  import { normalizeReviewInput } from "../../review-input.ts";
@@ -126,11 +128,13 @@ export async function executeReviewTasks(
126
128
  providerAuthority?: AgentRunProviderAuthority,
127
129
  recoveryModel?: ReviewModelSelection,
128
130
  recoveryModelId?: string,
131
+ registry?: AgentRunRegistry,
129
132
  ): Promise<ReviewTaskResult[]> {
130
133
  const review = normalizeReviewInput(reviewInput);
131
134
  let completedCount = 0;
132
135
  const totalCount = review.tasks.length;
133
136
  const effectiveThinkingLevel = clampReviewThinkingLevel(model.model, reviewerThinkingLevel);
137
+ const runGroupId = randomUUID();
134
138
  // Partial tool output is replaced repeatedly; retain the review context and task state for expanded views.
135
139
  const presentation = {
136
140
  targetTitle: snapshot.title,
@@ -191,11 +195,13 @@ export async function executeReviewTasks(
191
195
  requestedThinkingLevel: reviewerThinkingLevel,
192
196
  ...(recoveryModel ? { recoveryModel } : {}),
193
197
  ...(recoveryModelId ? { recoveryModelId } : {}),
198
+ ...(registry ? { registry } : {}),
194
199
  providerAuthority,
195
200
  projectTrusted,
196
201
  ...(audit ? { audit } : {}),
197
202
  ...(dependencyBootstrapConfigured ? { dependencyBootstrapConfigured } : {}),
198
203
  signal,
204
+ runGroupId,
199
205
  onProgress: (progress) => {
200
206
  taskStates[task.id] = { status: "running", progress };
201
207
  emitUpdate(onUpdate, {
@@ -1,4 +1,5 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ import type { AgentRunRegistry } from "@mrclrchtr/supi-agent-runtime/api";
2
3
  import type { LocalReviewAuditStore } from "../../audit/local-review-audit-store.ts";
3
4
  import type { ReviewArtifactStore } from "../../session/review-artifact-store.ts";
4
5
  import { makeRunReviewExecute } from "./execute.ts";
@@ -11,6 +12,7 @@ export function registerReviewRunTool(
11
12
  pi: ExtensionAPI,
12
13
  artifactStore: ReviewArtifactStore,
13
14
  localAuditStore?: LocalReviewAuditStore,
15
+ registry?: AgentRunRegistry,
14
16
  ): void {
15
17
  pi.registerTool({
16
18
  ...reviewRunSpec,
@@ -19,6 +21,6 @@ export function registerReviewRunTool(
19
21
  promptGuidelines: [...promptGuidelines],
20
22
  renderCall: renderRunCall,
21
23
  renderResult: renderRunResult,
22
- execute: makeRunReviewExecute(artifactStore, localAuditStore),
24
+ execute: makeRunReviewExecute(artifactStore, localAuditStore, registry),
23
25
  });
24
26
  }
@@ -1,4 +1,6 @@
1
+ import { randomUUID } from "node:crypto";
1
2
  import {
3
+ type AgentRunDisplayMetadata,
2
4
  type AgentRunSessionView,
3
5
  createEarlyCancellationDiagnostics,
4
6
  } from "@mrclrchtr/supi-agent-runtime/api";
@@ -16,8 +18,30 @@ import type {
16
18
  import { runIsolatedChild } from "./child-session.ts";
17
19
  import { createReviewRecoveryDeclineTool, createReviewSubmissionTool } from "./child-tools.ts";
18
20
  import { ReviewRecoveryPolicy } from "./recovery.ts";
21
+ import { normalizeReviewSubmission } from "./submission.ts";
19
22
  import { buildReviewerSystemPrompt } from "./system-prompt.ts";
20
23
 
24
+ function reviewerRunDisplay(
25
+ invocation: ReviewerInvocation,
26
+ thinkingLevel: AgentRunDisplayMetadata["thinkingLevel"],
27
+ tools: readonly string[],
28
+ ): AgentRunDisplayMetadata & { readonly runKey: string; readonly batchId: string } {
29
+ return {
30
+ runKey: randomUUID(),
31
+ batchId: invocation.runGroupId ?? randomUUID(),
32
+ taskId: invocation.task.id,
33
+ kind: "Reviewer",
34
+ label: `${invocation.task.mode} review`,
35
+ cwd: invocation.cwd,
36
+ modelId: invocation.model.canonicalId,
37
+ thinkingLevel,
38
+ tools,
39
+ taskDescription: `Inspection-only Review Task in ${invocation.task.mode} mode.`,
40
+ display: { target: invocation.snapshot.title },
41
+ startedAt: Date.now(),
42
+ };
43
+ }
44
+
21
45
  function auditOutcome(result: ReviewerRunResult): {
22
46
  kind: string;
23
47
  failureCode?: string;
@@ -89,8 +113,24 @@ export async function runReviewer(invocation: ReviewerInvocation): Promise<Revie
89
113
  ...(invocation.recoveryModel
90
114
  ? { authorizedContinuationModels: [invocation.recoveryModel.model] }
91
115
  : {}),
116
+ ...(invocation.registry ? { registry: invocation.registry } : {}),
92
117
  headlessInspection: true,
93
118
  projectTrusted: invocation.projectTrusted ?? false,
119
+ runDisplay: reviewerRunDisplay(invocation, effectiveThinkingLevel, originalTools),
120
+ displayResult: (result) => {
121
+ if (result.kind === "failed") return { failureCode: result.failureCode };
122
+ if (result.kind !== "success") return {};
123
+ const submission = normalizeReviewSubmission(result.value);
124
+ return {
125
+ finalText: submission.summary,
126
+ display: {
127
+ target: invocation.snapshot.title,
128
+ verdict: submission.verdict,
129
+ findingCount: submission.findingCounts.total,
130
+ blockingFindingCount: submission.findingCounts.blocking,
131
+ },
132
+ };
133
+ },
94
134
  onSessionCreated: (created) => {
95
135
  session = created;
96
136
  if (invocation.audit) {
@@ -1,5 +1,8 @@
1
1
  // biome-ignore lint/style/noExcessiveLinesPerFile: Review Target and Workspace lifecycle remain in one workflow module.
2
- import type { AgentRunProviderAuthority } from "@mrclrchtr/supi-agent-runtime/api";
2
+ import type {
3
+ AgentRunProviderAuthority,
4
+ AgentRunRegistry,
5
+ } from "@mrclrchtr/supi-agent-runtime/api";
3
6
  import {
4
7
  combineAgentRunUsage,
5
8
  createEarlyCancellationDiagnostics,
@@ -75,6 +78,8 @@ export interface RunReviewInput {
75
78
  projectTrusted?: boolean;
76
79
  /** Present when local reviewer replay is enabled. */
77
80
  auditStore?: LocalReviewAuditStore;
81
+ /** Registry for the Pi runtime that owns the Review request. */
82
+ registry?: AgentRunRegistry;
78
83
  signal?: AbortSignal;
79
84
  onUpdate?: OnUpdate;
80
85
  }
@@ -395,6 +400,7 @@ export async function runReview(input: RunReviewInput) {
395
400
  input.providerAuthority,
396
401
  input.recoveryModel,
397
402
  input.recoveryModelId,
403
+ input.registry,
398
404
  );
399
405
  } finally {
400
406
  cleanupWarning = await workspace.cleanup();
@@ -3,8 +3,14 @@ import {
3
3
  BorderedLoader,
4
4
  buildSessionContext,
5
5
  type ExtensionAPI,
6
+ type Theme,
6
7
  } from "@earendil-works/pi-coding-agent";
7
- import { createAgentRunProviderAuthority } from "@mrclrchtr/supi-agent-runtime/api";
8
+ import { Container, Key, matchesKey, Spacer, Text } from "@earendil-works/pi-tui";
9
+ import {
10
+ type AgentRunRegistry,
11
+ createAgentRunProviderAuthority,
12
+ openAgentsViewer,
13
+ } from "@mrclrchtr/supi-agent-runtime/api";
8
14
  import type { LocalReviewAuditStore } from "../audit/local-review-audit-store.ts";
9
15
  import { loadReviewConfig } from "../config.ts";
10
16
  import { collectPlannerContext } from "../history/collect.ts";
@@ -153,6 +159,56 @@ async function editReviewInteractive(
153
159
  interface CancellableLoaderOptions {
154
160
  /** Finish at once on Escape only when the operation has no cleanup work. */
155
161
  finishOnAbort?: boolean;
162
+ /** Open the shared run viewer without stopping the current operation. */
163
+ openAgents?: () => Promise<void>;
164
+ }
165
+
166
+ class ReviewRunLoader extends Container {
167
+ readonly #loader: BorderedLoader;
168
+ readonly #openAgents: () => Promise<void>;
169
+ readonly #onOpenError: (error: unknown) => void;
170
+ #openingAgents = false;
171
+
172
+ constructor(
173
+ loader: BorderedLoader,
174
+ theme: Theme,
175
+ openAgents: () => Promise<void>,
176
+ onOpenError: (error: unknown) => void,
177
+ ) {
178
+ super();
179
+ this.#loader = loader;
180
+ this.#openAgents = openAgents;
181
+ this.#onOpenError = onOpenError;
182
+ this.addChild(loader);
183
+ this.addChild(new Spacer(1));
184
+ this.addChild(new Text(theme.fg("dim", "Ctrl+O opens /agents"), 1, 0));
185
+ }
186
+
187
+ get signal(): AbortSignal {
188
+ return this.#loader.signal;
189
+ }
190
+
191
+ set onAbort(handler: (() => void) | undefined) {
192
+ this.#loader.onAbort = handler;
193
+ }
194
+
195
+ handleInput(data: string): void {
196
+ if (matchesKey(data, Key.ctrl("o"))) {
197
+ if (this.#openingAgents) return;
198
+ this.#openingAgents = true;
199
+ void this.#openAgents()
200
+ .catch(this.#onOpenError)
201
+ .finally(() => {
202
+ this.#openingAgents = false;
203
+ });
204
+ return;
205
+ }
206
+ this.#loader.handleInput(data);
207
+ }
208
+
209
+ dispose(): void {
210
+ this.#loader.dispose();
211
+ }
156
212
  }
157
213
 
158
214
  /** Run command-owned child work behind an Escape-cancellable Pi loader. */
@@ -164,6 +220,14 @@ async function withCancellableLoader<T>(
164
220
  ): Promise<T | undefined> {
165
221
  return ctx.ui.custom<T | undefined>((tui, theme, _keybindings, done) => {
166
222
  const loader = new BorderedLoader(tui, theme, message);
223
+ const component = options.openAgents
224
+ ? new ReviewRunLoader(loader, theme, options.openAgents, (error) =>
225
+ ctx.ui.notify(
226
+ error instanceof Error ? error.message : "Could not open /agents.",
227
+ "error",
228
+ ),
229
+ )
230
+ : loader;
167
231
  let settled = false;
168
232
  const finish = (value: T | undefined) => {
169
233
  if (settled) return;
@@ -183,7 +247,7 @@ async function withCancellableLoader<T>(
183
247
  finish(undefined);
184
248
  },
185
249
  );
186
- return loader;
250
+ return component;
187
251
  });
188
252
  }
189
253
 
@@ -257,6 +321,7 @@ async function draftInteractiveReview(
257
321
  async function executeInteractiveReview(
258
322
  ctx: CommandContext,
259
323
  input: {
324
+ pi: ExtensionAPI;
260
325
  target: ReviewTargetSpec;
261
326
  review: ReviewInput;
262
327
  scope: ReviewScope;
@@ -267,6 +332,7 @@ async function executeInteractiveReview(
267
332
  planning?: PlanningRecord;
268
333
  provenance: "caller-supplied" | "planner-assisted";
269
334
  auditStore?: LocalReviewAuditStore;
335
+ registry?: AgentRunRegistry;
270
336
  },
271
337
  ) {
272
338
  const config = loadReviewConfig(ctx.cwd);
@@ -297,8 +363,10 @@ async function executeInteractiveReview(
297
363
  bootstrapCommand: config.bootstrapCommand,
298
364
  projectTrusted: ctx.isProjectTrusted(),
299
365
  ...(auditStore ? { auditStore } : {}),
366
+ ...(input.registry ? { registry: input.registry } : {}),
300
367
  signal,
301
368
  }),
369
+ { openAgents: () => openAgentsViewer(input.pi, ctx) },
302
370
  );
303
371
  }
304
372
 
@@ -306,6 +374,7 @@ interface ReviewCommandServices {
306
374
  pi: ExtensionAPI;
307
375
  artifactStore: ReviewArtifactStore;
308
376
  auditStore: LocalReviewAuditStore;
377
+ registry?: AgentRunRegistry;
309
378
  }
310
379
 
311
380
  /** Select the target after Review Modes are edited. State batches never pass a before endpoint. */
@@ -322,7 +391,7 @@ export async function runReviewCommand(
322
391
  ctx: CommandContext,
323
392
  services: ReviewCommandServices,
324
393
  ): Promise<void> {
325
- const { pi, artifactStore, auditStore } = services;
394
+ const { pi, artifactStore, auditStore, registry } = services;
326
395
  if (!ctx.hasUI) return;
327
396
  let selectedTarget: InteractiveTarget | undefined;
328
397
  try {
@@ -403,6 +472,7 @@ export async function runReviewCommand(
403
472
  );
404
473
  if (!approved) return;
405
474
  const outcome = await executeInteractiveReview(ctx, {
475
+ pi,
406
476
  target,
407
477
  review: edited,
408
478
  scope,
@@ -413,6 +483,7 @@ export async function runReviewCommand(
413
483
  ...(usePlannerDraft && plannerDraft ? { planning: plannerDraft.planning } : {}),
414
484
  provenance: usePlannerDraft ? "planner-assisted" : "caller-supplied",
415
485
  auditStore,
486
+ ...(registry ? { registry } : {}),
416
487
  });
417
488
  if (!outcome) return;
418
489
  if (outcome.kind !== "completed") {
package/src/types.ts CHANGED
@@ -2,6 +2,7 @@ import type { Model, ModelThinkingLevel, Usage } from "@earendil-works/pi-ai";
2
2
  import type {
3
3
  AgentRunDiagnostics,
4
4
  AgentRunProviderAuthority,
5
+ AgentRunRegistry,
5
6
  } from "@mrclrchtr/supi-agent-runtime/api";
6
7
  import type { LocalReviewAuditStore } from "./audit/local-review-audit-store.ts";
7
8
  import type { ReviewThinkingLevel } from "./thinking.ts";
@@ -278,6 +279,10 @@ export interface ReviewerInvocation {
278
279
  signal?: AbortSignal;
279
280
  projectTrusted?: boolean;
280
281
  onProgress?: (progress: ReviewProgress) => void;
282
+ /** Shared viewer group for the independent Reviewer Sessions in one Review. */
283
+ runGroupId?: string;
284
+ /** Registry for the Pi runtime that owns this Reviewer. */
285
+ registry?: AgentRunRegistry;
281
286
  }
282
287
 
283
288
  export type ReviewerExtensionSetStatus = "active" | "degraded" | "unobserved";