@mrclrchtr/supi-review 1.8.1 → 1.9.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/review.ts +42 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-review",
3
- "version": "1.8.1",
3
+ "version": "1.9.1",
4
4
  "description": "SuPi Review extension — structured code review via /supi-review command",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/review.ts CHANGED
@@ -65,6 +65,8 @@ async function handleInteractive(ctx: CommandContext, pi: ExtensionAPI): Promise
65
65
  }),
66
66
  });
67
67
 
68
+ notifyBriefDone(pi, synthesis, snapshot, model.canonicalId);
69
+
68
70
  if (synthesis.kind !== "success") {
69
71
  notifySynthesisFailure(synthesis, ctx);
70
72
  return;
@@ -82,6 +84,8 @@ async function handleInteractive(ctx: CommandContext, pi: ExtensionAPI): Promise
82
84
  if (!approved) return;
83
85
 
84
86
  const result = await runReviewWithLoader(plan, ctx, pi);
87
+
88
+ notifyReviewDone(pi, result);
85
89
  injectReviewMessage(pi, result);
86
90
  }
87
91
 
@@ -223,6 +227,44 @@ function notifySynthesisFailure(
223
227
  }
224
228
  }
225
229
 
230
+ /** Ring the terminal bell so the user knows to check back. */
231
+ function ringBell(): void {
232
+ process.stdout.write("\x07");
233
+ }
234
+
235
+ /**
236
+ * Emit a `supi:review:brief-done` event and ring the terminal bell after
237
+ * brief synthesis completes (success, failure, cancel, or timeout).
238
+ */
239
+ function notifyBriefDone(
240
+ pi: ExtensionAPI,
241
+ result: BriefSynthesisRunResult,
242
+ snapshot: ReviewSnapshot,
243
+ modelId: string,
244
+ ): void {
245
+ pi.events.emit("supi:review:brief-done", {
246
+ kind: result.kind,
247
+ snapshot: snapshot.title,
248
+ modelId,
249
+ brief: result.kind === "success" ? result.brief : undefined,
250
+ });
251
+ ringBell();
252
+ }
253
+
254
+ /**
255
+ * Emit a `supi:review:review-done` event and ring the terminal bell after
256
+ * the review child session completes.
257
+ */
258
+ function notifyReviewDone(pi: ExtensionAPI, result: ReviewResult): void {
259
+ pi.events.emit("supi:review:review-done", {
260
+ kind: result.kind,
261
+ snapshot: result.snapshot.title,
262
+ modelId: result.modelId,
263
+ findingsCount: result.kind === "success" ? result.output.findings.length : 0,
264
+ });
265
+ ringBell();
266
+ }
267
+
226
268
  function injectReviewMessage(pi: ExtensionAPI, result: ReviewResult): void {
227
269
  pi.sendMessage({
228
270
  customType: "supi-review",