@difflab/pi 0.5.0-rc.202609231313.eaf7fa0 → 0.5.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 (53) hide show
  1. package/README.md +5 -5
  2. package/agents/diffpi-copilot.md +3 -6
  3. package/agents/diffpi-reviewer.md +3 -3
  4. package/dist/commands/review.d.ts +1 -0
  5. package/dist/commands/review.d.ts.map +1 -1
  6. package/dist/extensions/index.js +810 -344
  7. package/dist/extensions/tuicrx.d.ts +8 -1
  8. package/dist/extensions/tuicrx.d.ts.map +1 -1
  9. package/dist/index.d.ts +8 -7
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +458 -197
  12. package/dist/review/github-review-backend.d.ts.map +1 -1
  13. package/dist/review/gitlab-review-backend.d.ts.map +1 -1
  14. package/dist/review/index.d.ts +6 -6
  15. package/dist/review/index.d.ts.map +1 -1
  16. package/dist/review/local-review-backend.d.ts +3 -0
  17. package/dist/review/local-review-backend.d.ts.map +1 -0
  18. package/dist/review/review-backend.d.ts +3 -2
  19. package/dist/review/review-backend.d.ts.map +1 -1
  20. package/dist/review/review-markdown.d.ts +4 -1
  21. package/dist/review/review-markdown.d.ts.map +1 -1
  22. package/dist/review/review-state.d.ts +20 -0
  23. package/dist/review/review-state.d.ts.map +1 -0
  24. package/dist/review/types.d.ts +28 -0
  25. package/dist/review/types.d.ts.map +1 -1
  26. package/dist/store.d.ts +2 -0
  27. package/dist/store.d.ts.map +1 -1
  28. package/dist/tools/index.js +783 -185
  29. package/dist/tools/review.d.ts +30 -0
  30. package/dist/tools/review.d.ts.map +1 -1
  31. package/dist/workflow.d.ts +0 -47
  32. package/dist/workflow.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/skills/review/SKILL.md +8 -6
  35. package/skills/review/references/workflows/address.md +11 -0
  36. package/skills/review/references/workflows/auto.md +18 -0
  37. package/skills/review/references/workflows/complete.md +7 -0
  38. package/skills/review/references/workflows/edit.md +7 -0
  39. package/skills/review/references/workflows/help.md +30 -0
  40. package/skills/review/references/workflows/merge.md +6 -0
  41. package/skills/review/references/workflows/new.md +19 -0
  42. package/skills/review/references/workflows/open.md +3 -0
  43. package/skills/review/references/workflows/publish.md +8 -0
  44. package/dist/review/local-reviews.d.ts +0 -31
  45. package/dist/review/local-reviews.d.ts.map +0 -1
  46. package/workflows/review/address.md +0 -8
  47. package/workflows/review/auto.md +0 -8
  48. package/workflows/review/complete.md +0 -7
  49. package/workflows/review/edit.md +0 -7
  50. package/workflows/review/help.md +0 -14
  51. package/workflows/review/merge.md +0 -6
  52. package/workflows/review/new.md +0 -7
  53. package/workflows/review/publish.md +0 -6
package/README.md CHANGED
@@ -51,19 +51,19 @@ Plan tools cover context, initialization, overview and phase changes, validation
51
51
  /review new [--local] [--base branch] [--bg]
52
52
  /review edit [pr-number|pr-url|branch] [--local] [--bg]
53
53
  /review address [target] [--local] [--bg]
54
- /review publish [target] [--comment|--approve|--request-changes|--close] [--bg]
54
+ /review publish [target] [--local] [--comment|--approve|--request-changes|--close] [--bg]
55
55
  /review complete [target] [--local|--approve|--reject|--abandon] [--bg]
56
56
  /review merge [target] [--bg]
57
57
  ```
58
58
 
59
- The package-owned workflows delegate mechanics to `review_context`, `review_new`, `review_edit`, `review_diff`, `review_gates`, `review_submit`, `review_add_comment`, `review_comments`, `review_dump`, `review_respond`, `review_publish`, `review_complete`, `review_merge`, and `review_launch_ui`. Inline `auto` and `address` activate Reviewer on Sol; lifecycle verbs activate Orchestrator on Luna. Reviewer classifies address threads and delegates bounded edits to lightweight workers. `--bg` leaves the current chat mode unchanged and launches a tracked Orchestrator child. The generic `diffpi_template` tool loads bundled templates or user overrides. GitHub and GitLab support review creation and publication. Merge is intentionally GitHub-only and remains separate from publish and complete.
59
+ The skill delegates mechanics to `review_context`, `review_new`, `review_edit`, `review_diff`, `review_gates`, `review_submit`, `review_add_comment`, `review_comments`, `review_respond`, `review_publish`, `review_complete`, `review_merge`, and `review_launch_ui`. Inline `auto` and `address` activate Reviewer on Sol; lifecycle verbs activate Orchestrator on Luna. Reviewer classifies address threads and delegates bounded edits to lightweight workers. `--bg` leaves the current chat mode unchanged and launches a tracked Orchestrator child. The generic `diffpi_template` tool loads bundled templates or user overrides. GitHub and GitLab support review creation and publication. Merge is intentionally GitHub-only and remains separate from publish and complete.
60
60
 
61
- `--local` selects a `tuicr` working-tree review. Addressing it saves one immutable dump, applies the feedback, and opens a new review revision. Local reviews have no replies, resolution state, publication, or remote promotion. Dumps live at `.diffpi/review/<branch-slug>/<revision>.json`. Without `--local`, GitHub or GitLab owns comments, replies, publication, and lifecycle state directly. Remote address flows use the upstream `/git commit --no-push` workflow when code changes.
61
+ `--local` selects the `tuicr` working-tree review backend. Without it, targets are a PR/MR number, URL, or branch; no target uses the current branch. Local address flows apply fixes without commits; remote address flows use the upstream `/git commit --no-push` workflow before posting draft responses for changed threads. Local reply overlays preserve remote thread IDs until `publish --local` promotes comments and replies to the forge. Remote comments carry a generated-review notice with the exact provider/model route; local comments use `Agent: <provider/model>` as the author.
62
62
 
63
- Remote review artifacts use `YYMMDD-<short-head-sha>.md` or `YYMMDD-uncommitted.md` names. `.diffpi` links to `~/.difflab/diffpi/projects/<repository-name>-<identity-hash>/`, so all worktrees for one remote share records while unrelated same-named repositories remain isolated. The launcher opens a repository-scoped mux tab when zellij, tmux, or screen is detected. Without a mux, Zed lazily gets separate exact-argv tasks for full-branch local reviews and remote PR reviews; other environments receive the command to run.
63
+ Local artifacts live in `.diffpi/review/` and use `YYMMDD-<short-head-sha>.md` or `YYMMDD-uncommitted.md` names. `.diffpi` links to `~/.difflab/diffpi/projects/<repository-name>-<identity-hash>/`, so all worktrees for one remote share records while unrelated same-named repositories remain isolated. The launcher opens a repository-scoped mux tab when zellij, tmux, or screen is detected. Without a mux, Zed lazily gets separate exact-argv tasks for full-branch local reviews and remote PR reviews; other environments receive the command to run.
64
64
 
65
65
  Draft PR bodies use the bundled `review/draft-pr.md` template. Override it at `~/.difflab/diffpi/templates/review/draft-pr.md`. Setup installs the upstream Codevoyant `/git` skill for conventional commit and safe rebase workflows. During package development, run `mise watch //packages/pi:dev`; the task builds and installs the package when its sources change. Run `/reload` in Pi after each successful install.
66
66
 
67
- The package root exports environment and forge lifecycle adapters, remote review backends, immutable local review dumps, plan storage contracts, gate checks, template helpers, tuicr helpers, setup operations, and inline-mode control. `@difflab/pi/tools` exports `createPlanTools`, `createReviewTools`, and the complete tool catalog.
67
+ The package root exports environment and forge lifecycle adapters, review backends, the plan controller and consumer contracts, gate checks, template helpers, tuicr helpers, setup operations, and inline-mode control. Plan storage, Markdown codecs, locks, and transitions remain internal behind the controller. `@difflab/pi/tools` exports `createPlanTools`, `createReviewTools`, and the complete tool catalog.
68
68
 
69
69
  See the [repository](https://github.com/difflab-io/diffpi) for details.
@@ -6,7 +6,7 @@ prompt_mode: append
6
6
  model: openai-codex/gpt-5.6-luna
7
7
  model_fallbacks: meridian/claude-haiku-4-5, openrouter/qwen/qwen3-coder-flash, deepseek/deepseek-v4-flash
8
8
  thinking: low
9
- tools: read, grep, find, bash, edit, write, mcp, mcp__docs_mcp_server, ctx_execute, ctx_execute_file, ctx_search, ctx_fetch_and_index, web_search, fetch_content, ask_user_question
9
+ tools: read, grep, find, bash, edit, write, mcp, mcp__docs_mcp_server, ctx_execute, ctx_execute_file, ctx_search, ctx_fetch_and_index, web_search, fetch_content
10
10
  ---
11
11
 
12
12
  Work as a tandem coding partner. Assume the user is actively co-editing the same files. Follow their instructions and make small, reviewable edits while they direct the work.
@@ -16,10 +16,7 @@ Work as a tandem coding partner. Assume the user is actively co-editing the same
16
16
  - Never overwrite or rewrite a file from a stale copy. Preserve user changes and prefer targeted edits over full-file writes.
17
17
  - If content changed since the last read, reconcile with the current version instead of reapplying old text or squashing the user's edits.
18
18
  - Search indexed documentation first, index reusable documentation when needed, and use web search only for a focused missing fact.
19
- - Do not launch extended research, create plans, or take ownership of product scope and trade-offs.
20
- - Treat open-ended questions that require exploration, architecture, or broad trade-offs as work for a heavier Sol- or Opus-class agent. Do not improvise that exploration in Copilot mode; offer a concise handoff or mode-change option.
21
- - Ask only when missing information blocks the next edit. Use `ask_user_question` to present concise action options when the user must choose.
22
- - Do not end a turn with only a status update, intention, or promise. Execute the user's directive and report the result, or give the user concrete action options when execution cannot continue.
23
- - The only exception is an active discussion where the user is asking questions. In that case, answer directly and let the user continue the discussion without forcing an action.
19
+ - Do not launch extended research, delegate work, create plans, or take ownership of product scope and trade-offs.
20
+ - Ask only when missing information blocks the next edit.
24
21
  - Run focused checks after changes and review the resulting diff for accidental overwrites.
25
22
  - Keep explanations short so the user can stay in the editing loop.
@@ -12,9 +12,9 @@ metadata:
12
12
  model-tier: frontier
13
13
  ---
14
14
 
15
- You review code changes. Use `Agent`, `get_subagent_result`, and `steer_subagent` through pi-subagents for bounded delegation; use `SubagentWorkflow` for deterministic multi-stage orchestration. Direct agent delegation must use pi-subagents. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. The `review_*` tools handle diff fetching, gates, immutable local review dumps, forge calls, tuicr sessions, and launching.
15
+ You review code changes. Use `Agent`, `get_subagent_result`, and `steer_subagent` through pi-subagents for bounded delegation; use `SubagentWorkflow` for deterministic multi-stage orchestration. Direct agent delegation must use pi-subagents. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. The `review_*` tools handle diff fetching, gates, session parsing, comment mapping, forge/tuicr calls, and launching.
16
16
 
17
- For `auto`, own review judgment and use the review tools required by the workflow. For remote `address`, classify threads, delegate bounded edits, collect outcomes, then call `review_respond` with `resolve: false`. For local `address`, call `review_dump`, apply that immutable revision's feedback, and launch the next tuicr revision. Local reviews have no replies or resolution state. Never resolve or delete a remote thread; the user owns resolution. Do not publish, complete, or merge. Read `skills/review/references/review-standards.md` before classifying threads.
17
+ For `auto`, own review judgment and use the review tools required by the workflow. For `address`, act as the review coordinator: classify threads, form non-overlapping bounded implementation tasks, delegate routine edits to `worker`, collect verification and outcomes, then call `review_respond` for every thread with `resolve: false`. Never resolve or delete a thread; the user owns resolution. Do not publish, complete, or merge. Read `skills/review/references/review-standards.md` before classifying threads.
18
18
 
19
19
  ## Rules
20
20
 
@@ -34,4 +34,4 @@ For `auto`, own review judgment and use the review tools required by the workflo
34
34
 
35
35
  For `auto`, return findings for `review_submit` as `{ file, line, severity, body, reference }`, with severity `BLOCKING`, `CONSIDER`, or `NOTE`. Put un-anchorable BLOCKING issues in `overallIssues`. Return `[]` when clean.
36
36
 
37
- For remote `address`, return one outcome per source thread: `fixed`, `answered`, `unresolved`, or `deferred`; include response text and verification evidence. For local `address`, report the saved revision, applied changes, checks, and next review launch.
37
+ For `address`, return one outcome per source thread: `fixed`, `answered`, `unresolved`, or `deferred`; include its exact response text and verification evidence. Questions and all addressed threads stay open because the user owns resolution. Never report a thread as resolved during address.
@@ -1,4 +1,5 @@
1
1
  import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
2
2
  import type { ModeController } from '../modes';
3
+ /** Register the review workflow command. */
3
4
  export declare function registerReviewCommand(pi: ExtensionAPI, modes: ModeController): void;
4
5
  //# sourceMappingURL=review.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAcpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAgB/C,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAKnF"}
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK/C,4CAA4C;AAC5C,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAKnF"}