@zephyrdeng/pi-review 0.12.1 → 0.13.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.
- package/README.md +16 -8
- package/README.zh-CN.md +11 -3
- package/dist/args.d.ts +12 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +18 -5
- package/dist/args.js.map +1 -1
- package/dist/args.test.js +4 -2
- package/dist/args.test.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/skill-update.test.js +61 -3
- package/dist/skill-update.test.js.map +1 -1
- package/dist/skill.d.ts +28 -0
- package/dist/skill.d.ts.map +1 -1
- package/dist/skill.js +155 -31
- package/dist/skill.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/extensions/panel-tool.test.ts +15 -1
- package/extensions/panel-tool.ts +49 -19
- package/extensions/rv-completions.ts +1 -1
- package/extensions/rv-prompts.test.ts +13 -3
- package/extensions/rv-prompts.ts +28 -15
- package/package.json +1 -1
- package/skills/pi-review/SKILL.md +1 -1
- package/skills/pi-review/references/codex-tools.md +5 -5
- package/skills/pi-review/references/model-selection.md +1 -1
package/extensions/rv-prompts.ts
CHANGED
|
@@ -52,7 +52,7 @@ export type RvParsed = {
|
|
|
52
52
|
/** Panel width: independent reviewers for one gate (and each loop round). */
|
|
53
53
|
reviewers?: number;
|
|
54
54
|
reviewersError?: string;
|
|
55
|
-
/** Named panel preset (e.g. code-experts).
|
|
55
|
+
/** Named panel preset (e.g. code-experts). If both panel and reviewers are set, panel wins. */
|
|
56
56
|
panel?: string;
|
|
57
57
|
/** Per-reviewer model overrides: id=provider/model (repeatable). */
|
|
58
58
|
reviewerModels?: string[];
|
|
@@ -403,31 +403,31 @@ export function validateRvParsed(parsed: RvParsed): RvValidation {
|
|
|
403
403
|
if (parsed.until !== undefined && parsed.strategy !== "loop") {
|
|
404
404
|
return { ok: false, message: "--until is only valid with /rv-loop." };
|
|
405
405
|
}
|
|
406
|
-
|
|
407
|
-
return { ok: false, message: "--reviewers cannot be used with --panel" };
|
|
408
|
-
}
|
|
406
|
+
// panel + reviewers is allowed at parse time; builders prefer panel (see preferPanelShape).
|
|
409
407
|
if (parsed.reviewers !== undefined && (parsed.reviewers < 1 || parsed.reviewers > RV_MAX_REVIEWERS)) {
|
|
410
408
|
return { ok: false, message: `--reviewers must be between 1 and ${RV_MAX_REVIEWERS}` };
|
|
411
409
|
}
|
|
410
|
+
const shape = preferPanelShape(parsed);
|
|
412
411
|
const hasPanelOnlyOptions =
|
|
413
412
|
parsed.consensus !== undefined ||
|
|
414
413
|
parsed.minAgree !== undefined ||
|
|
415
414
|
parsed.consensusModel !== undefined ||
|
|
416
415
|
parsed.concurrency !== undefined ||
|
|
417
416
|
(parsed.reviewerModels?.length ?? 0) > 0;
|
|
418
|
-
if (
|
|
417
|
+
if (shape.reviewers === 1 && !shape.panel && hasPanelOnlyOptions) {
|
|
419
418
|
return { ok: false, message: "panel options require --reviewers > 1 or --panel" };
|
|
420
419
|
}
|
|
421
420
|
if (parsed.minAgree !== undefined) {
|
|
422
421
|
if (parsed.consensus && parsed.consensus !== "quorum") {
|
|
423
422
|
return { ok: false, message: "--min-agree is only valid with --consensus quorum" };
|
|
424
423
|
}
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
// Named panels resolve width later; only compare against explicit numeric width.
|
|
425
|
+
if (shape.reviewers !== undefined && parsed.minAgree > shape.reviewers) {
|
|
426
|
+
return { ok: false, message: `--min-agree ${parsed.minAgree} cannot exceed reviewers ${shape.reviewers}` };
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
if (parsed.concurrency !== undefined &&
|
|
430
|
-
return { ok: false, message: `--concurrency ${parsed.concurrency} cannot exceed reviewers ${
|
|
429
|
+
if (parsed.concurrency !== undefined && shape.reviewers !== undefined && parsed.concurrency > shape.reviewers) {
|
|
430
|
+
return { ok: false, message: `--concurrency ${parsed.concurrency} cannot exceed reviewers ${shape.reviewers}` };
|
|
431
431
|
}
|
|
432
432
|
for (const flag of FLAGS_REQUIRING_VALUE) {
|
|
433
433
|
if (parsed.target === flag) {
|
|
@@ -445,6 +445,17 @@ export function shellQuote(value: string): string {
|
|
|
445
445
|
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
+
/** Prefer named panel over numeric width when both appear (matches CLI/tool soft-resolve). */
|
|
449
|
+
export function preferPanelShape(parsed: Pick<RvParsed, "panel" | "reviewers">): {
|
|
450
|
+
panel?: string;
|
|
451
|
+
reviewers?: number;
|
|
452
|
+
} {
|
|
453
|
+
if (parsed.panel !== undefined && parsed.reviewers !== undefined) {
|
|
454
|
+
return { panel: parsed.panel };
|
|
455
|
+
}
|
|
456
|
+
return { panel: parsed.panel, reviewers: parsed.reviewers };
|
|
457
|
+
}
|
|
458
|
+
|
|
448
459
|
/** Same optional flags for initial review and --continue follow-up (all optional). */
|
|
449
460
|
export function buildPiReviewArgv(parsed: RvParsed, target: string): string[] {
|
|
450
461
|
const parts = ["pi-review"];
|
|
@@ -470,8 +481,9 @@ export function buildPiReviewArgv(parsed: RvParsed, target: string): string[] {
|
|
|
470
481
|
if (parsed.model) parts.push("--model", parsed.model);
|
|
471
482
|
if (parsed.thinking) parts.push("--thinking", parsed.thinking);
|
|
472
483
|
if (parsed.noStream) parts.push("--no-stream");
|
|
473
|
-
|
|
474
|
-
if (
|
|
484
|
+
const shape = preferPanelShape(parsed);
|
|
485
|
+
if (shape.panel) parts.push("--panel", shape.panel);
|
|
486
|
+
if (shape.reviewers !== undefined) parts.push("--reviewers", String(shape.reviewers));
|
|
475
487
|
for (const mapping of parsed.reviewerModels ?? []) parts.push("--reviewer-model", mapping);
|
|
476
488
|
if (parsed.consensus) parts.push("--consensus", parsed.consensus);
|
|
477
489
|
if (parsed.minAgree !== undefined) parts.push("--min-agree", String(parsed.minAgree));
|
|
@@ -488,12 +500,13 @@ export function formatPiReviewCommandLine(parsed: RvParsed, target: string): str
|
|
|
488
500
|
|
|
489
501
|
/** Build the native pi_review tool call instruction without dropping panel config. */
|
|
490
502
|
export function buildPiReviewToolCallInstruction(parsed: RvParsed, target: string): string {
|
|
503
|
+
const shape = preferPanelShape(parsed);
|
|
491
504
|
const fields: string[] = [
|
|
492
505
|
`target=${JSON.stringify(target)}`,
|
|
493
506
|
`mode=${JSON.stringify(parsed.mode)}`,
|
|
494
507
|
];
|
|
495
|
-
if (
|
|
496
|
-
if (
|
|
508
|
+
if (shape.panel) fields.push(`panel=${JSON.stringify(shape.panel)}`);
|
|
509
|
+
if (shape.reviewers !== undefined) fields.push(`reviewers=${shape.reviewers}`);
|
|
497
510
|
if (parsed.reviewerModels?.length) fields.push(`reviewerModels=${JSON.stringify(parsed.reviewerModels)}`);
|
|
498
511
|
if (parsed.consensus) fields.push(`consensus=${JSON.stringify(parsed.consensus)}`);
|
|
499
512
|
if (parsed.minAgree !== undefined) fields.push(`minAgree=${parsed.minAgree}`);
|
|
@@ -502,10 +515,10 @@ export function buildPiReviewToolCallInstruction(parsed: RvParsed, target: strin
|
|
|
502
515
|
if (parsed.model) fields.push(`model=${JSON.stringify(parsed.model)}`);
|
|
503
516
|
if (parsed.thinking) fields.push(`thinking=${JSON.stringify(parsed.thinking)}`);
|
|
504
517
|
// Default panel when /rv has no explicit width/preset: keep code-experts.
|
|
505
|
-
if (parsed.strategy === "panel" && !
|
|
518
|
+
if (parsed.strategy === "panel" && !shape.panel && shape.reviewers === undefined) {
|
|
506
519
|
fields.push(`panel=${JSON.stringify("code-experts")}`);
|
|
507
520
|
}
|
|
508
|
-
return `Call pi_review with ${fields.join(", ")}. Treat target as a natural-language review request. Do not expand directory targets into multi-file lists.
|
|
521
|
+
return `Call pi_review with ${fields.join(", ")}. Treat target as a natural-language review request. Do not expand directory targets into multi-file lists. Pass only one of panel or reviewers (if both appear, panel wins). Keep reviewerModels/consensus/minAgree when provided.`;
|
|
509
522
|
}
|
|
510
523
|
|
|
511
524
|
export function orchestrationLocaleNote(locale: RvLocale = "en"): string {
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ node ../../bin/pi-review.js --help
|
|
|
27
27
|
|------|-------------------------|
|
|
28
28
|
| **Pi** (`/rv`) | New panel reviews call the native `pi_review` API tool, shown to users as **Pi Review Panel**, which launches the packaged CLI in event mode and renders live reviewer state. Continuations, kept sessions, `/rv-loop`, and explicit `--no-stream` use the shell CLI. |
|
|
29
29
|
| **Pi terminal** | Foreground `pi-review`; text deltas stream live by default. |
|
|
30
|
-
| **Claude Code / Codex / Cursor** and similar agent hosts | These hosts buffer a shell tool's output until the command exits, so a foreground run looks like a silent wait. **Panel review (`--reviewers`/`--panel`) default: `--ui web --ui-url-file <path>` + background run** — get the dashboard in front of the user: on Claude Code the CLI auto-open lands in the system default browser; on Codex open the `--ui-url-file` URL in the host's built-in browser (the CLI cannot reach a GUI there); hand over the URL as fallback either way. **Single review / `loop` default: `--progress-log <path>` + background run + tail the log** (`--ui web` requires an active panel and rejects `loop`). See [references/codex-tools.md](./references/codex-tools.md). Map skill mentions of `Bash` to your host shell tool. |
|
|
30
|
+
| **Claude Code / Codex / Cursor / agy (Antigravity)** and similar agent hosts | These hosts buffer a shell tool's output until the command exits, so a foreground run looks like a silent wait. **Panel review (`--reviewers`/`--panel`) default: `--ui web --ui-url-file <path>` + background run** — get the dashboard in front of the user: on Claude Code the CLI auto-open lands in the system default browser; on Codex open the `--ui-url-file` URL in the host's built-in browser (the CLI cannot reach a GUI there); on agy prefer the host browser / share the URL the same way; hand over the URL as fallback either way. **Single review / `loop` default: `--progress-log <path>` + background run + tail the log** (`--ui web` requires an active panel and rejects `loop`). See [references/codex-tools.md](./references/codex-tools.md). Map skill mentions of `Bash` to your host shell tool. |
|
|
31
31
|
| Scripts / CI | Foreground is fine; add `--no-stream` only when the caller must buffer until exit (cannot combine with `--progress-log`). |
|
|
32
32
|
|
|
33
33
|
`--progress-log <path>` tees a compact `--mode json` event stream to a file for outside observation and debugging (each `message_update` reduces its cumulative message snapshots to `usage` to keep the file small; add `--progress-log-raw` for the verbatim stream); it is never a prerequisite for metrics. Token usage accumulates by default, and `pi-review` writes milestone notices (`pi-review: review started`, `pi-review: tool <name> started/finished`, `pi-review: review finished`) to stderr.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Agent host tool notes (Codex / Claude Code)
|
|
1
|
+
# Agent host tool notes (Codex / Claude Code / Cursor / agy)
|
|
2
2
|
|
|
3
|
-
Skills may use Claude Code tool names. On **Codex** or **
|
|
3
|
+
Skills may use Claude Code tool names. On **Codex**, **Claude Code**, **Cursor**, or **agy (Antigravity)**, map them to your native tools:
|
|
4
4
|
|
|
5
5
|
| Skill references | Typical host equivalent |
|
|
6
6
|
|-----------------|-------------------------|
|
|
@@ -10,13 +10,13 @@ Skills may use Claude Code tool names. On **Codex** or **Claude Code**, map them
|
|
|
10
10
|
|
|
11
11
|
This file is **pi-review–specific** and ships with the pi-review package.
|
|
12
12
|
|
|
13
|
-
## Long-running `pi-review` (default on Codex / Claude Code)
|
|
13
|
+
## Long-running `pi-review` (default on Codex / Claude Code / Cursor / agy)
|
|
14
14
|
|
|
15
15
|
Native shell tools on these hosts **buffer stdout/stderr until the command exits**. A multi-minute foreground `pi-review` run looks like a silent wait, then one large dump — never promise live foreground streaming. Which side channel to use depends on the run type: panel review gets the browser dashboard; single review and `loop` get the tailed progress log.
|
|
16
16
|
|
|
17
17
|
### Panel review: browser dashboard (default)
|
|
18
18
|
|
|
19
|
-
`--reviewers <n>` or `--panel <name>` activates panel review. On Codex, Claude Code, or
|
|
19
|
+
`--reviewers <n>` or `--panel <name>` activates panel review. On Codex, Claude Code, Cursor, or agy, default to the dashboard instead of a tailed log:
|
|
20
20
|
|
|
21
21
|
1. Run `pi-review --reviewers <n> --ui web --ui-url-file <path> -- <target>` (or `--panel <name>`) in the **background**. Pass `--no-ui-open` only when the user asked not to open a browser (CI, remote shells).
|
|
22
22
|
2. Read `<path>` shortly after launch — it is written atomically as soon as the dashboard server is ready, well before reviewers finish (poll a few times a second for a couple of seconds if the file is not there yet). Then get the dashboard in front of the user: on **Claude Code** the CLI auto-open already lands in the system default browser; on **Codex** the CLI cannot reach a GUI browser, so open the URL from `<path>` in the host's built-in browser yourself. Share the URL either way as a fallback: *"Dashboard opened in your browser (URL: `<url>`). I'll report back when the review completes."*
|
|
@@ -32,7 +32,7 @@ Native shell tools on these hosts **buffer stdout/stderr until the command exits
|
|
|
32
32
|
|
|
33
33
|
**Pi interactive (`/rv`)**: foreground `pi-review`, default streaming. Text deltas appear live on the terminal; no `--progress-log`/`--ui web` unless the user asked — Pi already renders panel progress natively.
|
|
34
34
|
|
|
35
|
-
See the parent skill
|
|
35
|
+
See the parent skill section *Default workflow by host* (Claude Code / Codex / Cursor / agy row).
|
|
36
36
|
|
|
37
37
|
### Loop closeout
|
|
38
38
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Use this after `pi-review models` (or `pi-review models <search>`). **Never invent** `provider/model` IDs—only IDs that appear in that output.
|
|
4
4
|
|
|
5
|
-
## Workflow (Claude Code, Codex, Cursor, Pi parent agent)
|
|
5
|
+
## Workflow (Claude Code, Codex, Cursor, agy, Pi parent agent)
|
|
6
6
|
|
|
7
7
|
1. Run `pi-review models` (narrow with search if the user named a vendor or model family).
|
|
8
8
|
2. Infer **review profile** from the target (see table below).
|