@difflab/pi 0.3.0-rc.202609201843.9cb5906 → 0.3.0-rc.202609210558.3daa874
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 +3 -3
- package/agents/diffpi-orchestrator.md +3 -3
- package/agents/diffpi-reviewer.md +1 -1
- package/agents/diffpi-worker.md +3 -3
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli.js +5582 -162
- package/dist/commands/plan.d.ts +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/environment.d.ts +1 -0
- package/dist/environment.d.ts.map +1 -1
- package/dist/extensions/index.js +2611 -2300
- package/dist/extensions/subagentx.d.ts +31 -0
- package/dist/extensions/subagentx.d.ts.map +1 -0
- package/dist/extensions/tuicrx.d.ts +1 -1
- package/dist/extensions/tuicrx.d.ts.map +1 -1
- package/dist/gates.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +453 -232
- package/dist/log.d.ts +15 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/plan/annotations.d.ts.map +1 -1
- package/dist/plan/controller.d.ts +50 -5
- package/dist/plan/controller.d.ts.map +1 -1
- package/dist/plan/execution.d.ts +1 -7
- package/dist/plan/execution.d.ts.map +1 -1
- package/dist/plan/ids.d.ts +5 -0
- package/dist/plan/ids.d.ts.map +1 -0
- package/dist/plan/index.d.ts +3 -12
- package/dist/plan/index.d.ts.map +1 -1
- package/dist/plan/lock.d.ts +4 -0
- package/dist/plan/lock.d.ts.map +1 -1
- package/dist/plan/log.d.ts +2 -1
- package/dist/plan/log.d.ts.map +1 -1
- package/dist/{commands/plan-parser.d.ts → plan/parser.d.ts} +1 -1
- package/dist/plan/parser.d.ts.map +1 -0
- package/dist/plan/types.d.ts +9 -10
- package/dist/plan/types.d.ts.map +1 -1
- package/dist/review/github-review-backend.d.ts.map +1 -1
- package/dist/review/review-markdown.d.ts.map +1 -1
- package/dist/store.d.ts +1 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1871 -1482
- package/dist/tools/log.d.ts +3 -0
- package/dist/tools/log.d.ts.map +1 -0
- package/dist/tools/plan.d.ts +1 -1
- package/dist/tools/plan.d.ts.map +1 -1
- package/dist/vcs/github.d.ts +1 -0
- package/dist/vcs/github.d.ts.map +1 -1
- package/dist/vcs/gitlab.d.ts +1 -0
- package/dist/vcs/gitlab.d.ts.map +1 -1
- package/dist/vcs/types.d.ts +1 -0
- package/dist/vcs/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/plan/SKILL.md +4 -2
- package/skills/plan/references/workflows/finalize.md +1 -1
- package/skills/plan/references/workflows/go.md +2 -2
- package/skills/plan/references/workflows/new.md +1 -1
- package/skills/review/SKILL.md +1 -1
- package/templates/plan/implementation.md +1 -1
- package/dist/commands/background.d.ts +0 -40
- package/dist/commands/background.d.ts.map +0 -1
- package/dist/commands/plan-parser.d.ts.map +0 -1
- package/dist/plan/escalation.d.ts +0 -4
- package/dist/plan/escalation.d.ts.map +0 -1
- package/dist/plan/transitions.d.ts +0 -9
- package/dist/plan/transitions.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -36,11 +36,11 @@ Standard agents come from the same global and trusted-project directories used b
|
|
|
36
36
|
/plan help
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Foreground `init`, `new`, and `update` select Planner. Foreground `annotate`, `finalize`, `go`, and `help` select Worker. Deferring implementation during finalize restores the default mode, as does completing an inline plan execution. Orchestrator owns background coordination and phase commits. Background work does not change the foreground mode and does not ask questions.
|
|
40
40
|
|
|
41
41
|
`/plan annotate` uses `tuicr --file PLAN.md`. Run `npx --yes @difflab/pi@<version> plan annotate --cwd <repo>` for direct use. Zed setup installs the pinned `diffpi: annotate plan` task. Override the plan template at `~/.difflab/diffpi/templates/plan/PLAN.md`.
|
|
42
42
|
|
|
43
|
-
Plan tools cover context, initialization, overview and phase changes, validation, annotations, progress, status, gates, and execution dispatch. Phase gates run `format:check`, `lint`, and `test`. `--commit` creates one
|
|
43
|
+
Plan tools cover context, initialization, overview and phase changes, validation, annotations, progress, status, gates, hosted CI monitoring, and execution dispatch. Phase gates run `format:check`, `lint`, and `test`. `--commit` creates and pushes one conventional commit per completed phase, then a bounded background Worker monitors CI for that SHA while the next phase executes. Plan completion waits for every monitor.
|
|
44
44
|
|
|
45
45
|
## Review
|
|
46
46
|
|
|
@@ -64,6 +64,6 @@ Local artifacts live in `.diffpi/review/` and use `YYMMDD-<short-head-sha>.md` o
|
|
|
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, review backends, plan
|
|
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.
|
|
@@ -11,7 +11,7 @@ run_in_background: true
|
|
|
11
11
|
allowed_subagents: all
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
Work only as an execution orchestrator through the pi-subagents tools. Optimize scheduling, routing, speed, cost, and recovery; do not implement tasks yourself.
|
|
14
|
+
Work only as an execution orchestrator through the pi-subagents tools. Use `Agent`, `get_subagent_result`, and `steer_subagent` for delegation; use `SubagentWorkflow` for deterministic multi-stage orchestration. Direct delegation must use pi-subagents. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. Optimize scheduling, routing, speed, cost, and recovery; do not implement tasks yourself.
|
|
15
15
|
|
|
16
16
|
- Build a dependency graph of bounded, non-overlapping tasks before launching agents.
|
|
17
17
|
- Launch independent work in parallel and dependent work only after its prerequisites complete.
|
|
@@ -29,8 +29,8 @@ Work only as an execution orchestrator through the pi-subagents tools. Optimize
|
|
|
29
29
|
|
|
30
30
|
For background plan execution, call `plan_context` and honor the active execution ID. Process phases in dependency order. Delegate one bounded task at a time to Worker unless all dependencies are complete and declared file scopes are disjoint; missing or uncertain scopes serialize. Delegated workers never commit or restructure the plan. Reload plan state and persist each result before scheduling more work.
|
|
31
31
|
|
|
32
|
-
After all phase tasks complete or skip, run `plan_run_gates`. A failure or warning blocks the phase. When the execution policy requires commits, only you may invoke `/git commit --yes --no-push`, exactly once after gates pass, then
|
|
32
|
+
After all phase tasks complete or skip, run `plan_run_gates`. A failure or warning blocks the phase. When the execution policy requires commits, only you may invoke `/git commit --yes --no-push`, exactly once after gates pass, then immediately push the current branch. Complete the phase with the observed SHA, push timestamp, and pending CI metadata. Launch one bounded background Worker with `Agent` to call `plan_watch_ci` for that exact phase and SHA, then begin executing the next phase while it watches. Collect the monitor before committing or pushing the next phase, and collect every outstanding monitor before completing the plan. A failed or timed-out monitor blocks execution; skipped CI is acceptable only when the tool confirms that the forge or commit checks are unavailable.
|
|
33
33
|
|
|
34
|
-
Parse `<diffpi-
|
|
34
|
+
Parse `<diffpi-subagent-escalation>` payloads strictly. Read plan, phase, and task identifiers from `correlation` rather than from a plan-only transport. If `needsUserDecision` is false, delegate the blocked amendment to Planner, reload and validate the plan, and retry at most twice for that task. Planner may revise only pending or blocked work. If a human decision is needed, the payload is malformed, or retries are exhausted, preserve blocked state and return the correlation metadata, evidence, and `/plan update <slug>` then `/plan go <slug>` commands. Background agents never ask users questions.
|
|
35
35
|
|
|
36
36
|
Keep review orchestration behavior unchanged when no plan execution packet is present.
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
model-tier: frontier
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
You review code changes. The `review_*` tools handle diff fetching, gates, session parsing, comment mapping, forge/tuicr calls, 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
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
|
|
package/agents/diffpi-worker.md
CHANGED
|
@@ -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, ctx_execute, ctx_execute_file, plan_context, plan_log_progress, plan_update_status, plan_run_gates
|
|
9
|
+
tools: read, grep, find, bash, edit, write, ctx_execute, ctx_execute_file, Agent, get_subagent_result, steer_subagent, ask_user_question, diffpi_log, diffpi_modes_unset, plan_context, plan_update_overview, plan_add_phase, plan_remove_phase, plan_update_phase, plan_validate, plan_log_progress, plan_update_status, plan_run_gates, plan_watch_ci, plan_annotate, plan_annotations, plan_ack_annotations, plan_start_execution
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
Work as a focused implementation worker. Execute the bounded plan supplied by an orchestrator or user.
|
|
@@ -22,6 +22,6 @@ Work as a focused implementation worker. Execute the bounded plan supplied by an
|
|
|
22
22
|
|
|
23
23
|
When given a plan execution packet, use plan tools instead of editing `PLAN.md` directly. Claim an eligible task with `plan_update_status`, implement only its declared scope, validate it, log progress immediately, and complete or block the task before selecting more work. Reload `plan_context` after every delegated result.
|
|
24
24
|
|
|
25
|
-
An inline coordinator may process sequential tasks and run phase gates after every task is complete or skipped. It
|
|
25
|
+
An inline coordinator may process sequential tasks and run phase gates after every task is complete or skipped. With commit-per-phase policy, it invokes `/git commit --yes --no-push` once after gates pass, immediately pushes the current branch, and completes the phase with pending CI metadata. It then launches one bounded background Worker with `Agent` to call `plan_watch_ci` for that phase and SHA while it executes the next phase. Collect the monitor before committing or pushing the next phase and collect every monitor before completing the plan; failed or timed-out CI blocks execution. A delegated implementation worker handles only its assigned task and never commits, changes phases, or launches CI monitors.
|
|
26
26
|
|
|
27
|
-
When blocked, persist the blocked status with attempted fixes and evidence.
|
|
27
|
+
When blocked, persist the blocked status with attempted fixes and evidence. Return a generic subagent escalation with `correlation`, `blocker`, `attempts`, `evidence`, and `needsUserDecision` inside `<diffpi-subagent-escalation>` tags, then stop. Put plan, phase, and task IDs in `correlation` metadata rather than inventing a plan-only transport. Never invent a replacement design or erase completed evidence.
|
package/dist/cli/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/cli/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/cli/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;AAOpD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,wBAAgB,oBAAoB,CAAC,EAAE,GAAE,SAAmB,GAAG,OAAO,CAcrE;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,SAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CASzF;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|