@astralyn/pi 0.84.1 → 0.84.2

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 (88) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/extensions/index.d.ts.map +1 -1
  3. package/dist/extensions/index.js +0 -4
  4. package/dist/extensions/index.js.map +1 -1
  5. package/dist/extensions/todo/schema.d.ts +1 -1
  6. package/dist/extensions/todo/state.js +5 -5
  7. package/dist/extensions/todo/state.js.map +1 -1
  8. package/docs/bundled/README.md +0 -2
  9. package/docs/docs.json +0 -8
  10. package/docs/usage.md +0 -1
  11. package/examples/extensions/README.md +2 -0
  12. package/examples/extensions/plan-mode/README.md +66 -0
  13. package/examples/extensions/plan-mode/index.ts +390 -0
  14. package/examples/extensions/plan-mode/utils.ts +168 -0
  15. package/examples/extensions/subagent/README.md +175 -0
  16. package/examples/extensions/subagent/agents/planner.md +37 -0
  17. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  18. package/examples/extensions/subagent/agents/scout.md +50 -0
  19. package/examples/extensions/subagent/agents/worker.md +24 -0
  20. package/examples/extensions/subagent/agents.ts +126 -0
  21. package/examples/extensions/subagent/index.ts +1009 -0
  22. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  23. package/examples/extensions/subagent/prompts/implement.md +10 -0
  24. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  25. package/npm-shrinkwrap.json +2 -2
  26. package/package.json +1 -1
  27. package/dist/extensions/biu/index.d.ts +0 -19
  28. package/dist/extensions/biu/index.d.ts.map +0 -1
  29. package/dist/extensions/biu/index.js +0 -350
  30. package/dist/extensions/biu/index.js.map +0 -1
  31. package/dist/extensions/biu/prompts.d.ts +0 -26
  32. package/dist/extensions/biu/prompts.d.ts.map +0 -1
  33. package/dist/extensions/biu/prompts.js +0 -260
  34. package/dist/extensions/biu/prompts.js.map +0 -1
  35. package/dist/extensions/biu/workspace.d.ts +0 -122
  36. package/dist/extensions/biu/workspace.d.ts.map +0 -1
  37. package/dist/extensions/biu/workspace.js +0 -404
  38. package/dist/extensions/biu/workspace.js.map +0 -1
  39. package/dist/extensions/rewind/anchor.d.ts +0 -29
  40. package/dist/extensions/rewind/anchor.d.ts.map +0 -1
  41. package/dist/extensions/rewind/anchor.js +0 -35
  42. package/dist/extensions/rewind/anchor.js.map +0 -1
  43. package/dist/extensions/rewind/config.d.ts +0 -16
  44. package/dist/extensions/rewind/config.d.ts.map +0 -1
  45. package/dist/extensions/rewind/config.js +0 -69
  46. package/dist/extensions/rewind/config.js.map +0 -1
  47. package/dist/extensions/rewind/engine.d.ts +0 -93
  48. package/dist/extensions/rewind/engine.d.ts.map +0 -1
  49. package/dist/extensions/rewind/engine.js +0 -778
  50. package/dist/extensions/rewind/engine.js.map +0 -1
  51. package/dist/extensions/rewind/gc.d.ts +0 -35
  52. package/dist/extensions/rewind/gc.d.ts.map +0 -1
  53. package/dist/extensions/rewind/gc.js +0 -169
  54. package/dist/extensions/rewind/gc.js.map +0 -1
  55. package/dist/extensions/rewind/index.d.ts +0 -3
  56. package/dist/extensions/rewind/index.d.ts.map +0 -1
  57. package/dist/extensions/rewind/index.js +0 -287
  58. package/dist/extensions/rewind/index.js.map +0 -1
  59. package/dist/extensions/rewind/menu.d.ts +0 -13
  60. package/dist/extensions/rewind/menu.d.ts.map +0 -1
  61. package/dist/extensions/rewind/menu.js +0 -123
  62. package/dist/extensions/rewind/menu.js.map +0 -1
  63. package/dist/extensions/rewind/paths.d.ts +0 -4
  64. package/dist/extensions/rewind/paths.d.ts.map +0 -1
  65. package/dist/extensions/rewind/paths.js +0 -15
  66. package/dist/extensions/rewind/paths.js.map +0 -1
  67. package/dist/extensions/rewind/restore.d.ts +0 -54
  68. package/dist/extensions/rewind/restore.d.ts.map +0 -1
  69. package/dist/extensions/rewind/restore.js +0 -94
  70. package/dist/extensions/rewind/restore.js.map +0 -1
  71. package/dist/extensions/rewind/snapshot.d.ts +0 -45
  72. package/dist/extensions/rewind/snapshot.d.ts.map +0 -1
  73. package/dist/extensions/rewind/snapshot.js +0 -21
  74. package/dist/extensions/rewind/snapshot.js.map +0 -1
  75. package/dist/extensions/rewind/storage.d.ts +0 -12
  76. package/dist/extensions/rewind/storage.d.ts.map +0 -1
  77. package/dist/extensions/rewind/storage.js +0 -33
  78. package/dist/extensions/rewind/storage.js.map +0 -1
  79. package/dist/extensions/rewind/text.d.ts +0 -7
  80. package/dist/extensions/rewind/text.d.ts.map +0 -1
  81. package/dist/extensions/rewind/text.js +0 -19
  82. package/dist/extensions/rewind/text.js.map +0 -1
  83. package/dist/extensions/rewind/tool-path.d.ts +0 -3
  84. package/dist/extensions/rewind/tool-path.d.ts.map +0 -1
  85. package/dist/extensions/rewind/tool-path.js +0 -9
  86. package/dist/extensions/rewind/tool-path.js.map +0 -1
  87. package/docs/bundled/extensions/biu.md +0 -63
  88. package/docs/bundled/extensions/rewind.md +0 -86
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ This file records `@astralyn/pi` releases beginning with the first Fork-owned re
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.84.2] - 2026-08-09
8
+
9
+ ### Removed
10
+
11
+ - Removed the bundled rewind extension, including per-edit backups, the `/rewind` settings command, and `/tree` work-tree restoration. Existing `~/.pi/agent/rewind/` data is no longer read and can be removed manually; historical `pi-rewind-snapshot` session entries remain inert.
12
+ - Removed the bundled Biu extension, including the `/biu` workflow command, `biu://` path resolution for the core file tools, and the SPEC approval gate. Existing `~/.pi/agent/biu/` workspace data is no longer read and can be removed manually; historical `biu-mode` session entries stay inert and `biu-kickoff` messages fall back to the default custom-message rendering.
13
+
7
14
  ## [0.84.1] - 2026-08-07
8
15
 
9
16
  ### Added
@@ -197,7 +204,7 @@ This file records `@astralyn/pi` releases beginning with the first Fork-owned re
197
204
  - Fixed auto-compaction to also check the context before continuing a run with queued steering or follow-up messages; previously a turn without tool results skipped the mid-turn check and long follow-up chains could only recover via overflow.
198
205
  - Fixed the IME candidate window jumping between the caret and the end of the input line while typing with a CJK input method in Windows Terminal and other terminals that anchor the candidate window to the hardware cursor. Each TUI render pass is now flushed to stdout as one atomic write instead of separate frame, cursor-reposition, and cursor-visibility writes, so the terminal never observes the intermediate cursor position (upstream [#6289](https://github.com/earendil-works/pi/issues/6289), [#5200](https://github.com/earendil-works/pi/issues/5200)).
199
206
  - Fixed the terminal viewport jumping to the top of the buffer when scrolling up through history while a response is streaming, most visibly in Windows Terminal. Content-driven full redraws (triggered whenever a line above the viewport changes during streaming markdown reflow) previously cleared the terminal scrollback with `ESC[3J` and replayed the entire transcript; such frames are now rewritten to overwrite the visible screen in place (avoiding `ESC[2J`, which conhost implements by pushing the screen into scrollback), preserving scrollback, the reading position, and pre-session shell history without accumulating duplicate screen copies. Width-change redraws still clear scrollback since re-wrapped content invalidates it (upstream [#6502](https://github.com/earendil-works/pi/issues/6502), [#5576](https://github.com/earendil-works/pi/issues/5576), [#6050](https://github.com/earendil-works/pi/issues/6050)).
200
- - Fixed the rewind extension's `/tree` restore semantics. Snapshots now anchor to the first user entry of a run (steering/follow-up messages no longer shift the anchor onto a mid-run message), and the restore target mirrors `/tree`'s leaf rules: user-message targets restore to the state before that turn, other targets to the state after it, and navigation is silent instead of rolling back the target turn's own edits when nothing was recorded afterwards. Also fixed resume/fork backup migration to link only retained frames (removing a race with over-cap blob pruning), made restore-side change detection immune to mtime-preserving content swaps, deduplicated case-insensitive tracking keys on Windows, and taught the storage menu's "remove all" to keep backups recently written by other running sessions. See [rewind](docs/bundled/extensions/rewind.md).
207
+ - Fixed the rewind extension's `/tree` restore semantics. Snapshots now anchor to the first user entry of a run (steering/follow-up messages no longer shift the anchor onto a mid-run message), and the restore target mirrors `/tree`'s leaf rules: user-message targets restore to the state before that turn, other targets to the state after it, and navigation is silent instead of rolling back the target turn's own edits when nothing was recorded afterwards. Also fixed resume/fork backup migration to link only retained frames (removing a race with over-cap blob pruning), made restore-side change detection immune to mtime-preserving content swaps, deduplicated case-insensitive tracking keys on Windows, and taught the storage menu's "remove all" to keep backups recently written by other running sessions.
201
208
  - Fixed subagent working-directory resolution under a symlinked parent directory (macOS `/tmp`, Windows junctions): the containment check compared the real parent path against the unresolved candidate, so every call — including the default inherit-cwd case — was rejected as an escape. Traversal and symlink escapes are still blocked.
202
209
  - Fixed the subagent tool staying broken for the rest of the session after a transient `ModelRuntime` creation failure; the rejected promise is no longer cached, so the next invocation retries.
203
210
  - Fixed subagent progress updates firing after the tool result had settled (a throttled emitter leaked its timer), and skipped redundant progress serialization when consecutive events change nothing user-visible.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAWnE,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAU9C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AASnE,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAQ9C,CAAC"}
@@ -1,18 +1,14 @@
1
- import biuExtension from "./biu/index.js";
2
1
  import deepwikiExtension from "./deepwiki/index.js";
3
2
  import llamaExtension from "./llama/index.js";
4
3
  import questionExtension from "./question/index.js";
5
- import rewindExtension from "./rewind/index.js";
6
4
  import routerExtension from "./router/index.js";
7
5
  import statuslineExtension from "./statusline/index.js";
8
6
  import subagentExtension from "./subagent/index.js";
9
7
  import todoExtension from "./todo/index.js";
10
8
  export const builtInExtensions = [
11
- { name: "biu", factory: biuExtension, hidden: true },
12
9
  { name: "llama.cpp", factory: llamaExtension, hidden: true },
13
10
  { name: "deepwiki", factory: deepwikiExtension, hidden: true },
14
11
  { name: "question", factory: questionExtension, hidden: true },
15
- { name: "rewind", factory: rewindExtension, hidden: true },
16
12
  { name: "router", factory: routerExtension, hidden: true },
17
13
  { name: "statusline", factory: statuslineExtension, hidden: true },
18
14
  { name: "subagent", factory: subagentExtension, hidden: true },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IACnD,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE;IACpD,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE;IAC5D,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE;IAC1D,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE;IAC1D,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE;IAClE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE;CACtD,CAAC","sourcesContent":["import type { InlineExtension } from \"../core/extensions/types.ts\";\nimport biuExtension from \"./biu/index.ts\";\nimport deepwikiExtension from \"./deepwiki/index.ts\";\nimport llamaExtension from \"./llama/index.ts\";\nimport questionExtension from \"./question/index.ts\";\nimport rewindExtension from \"./rewind/index.ts\";\nimport routerExtension from \"./router/index.ts\";\nimport statuslineExtension from \"./statusline/index.ts\";\nimport subagentExtension from \"./subagent/index.ts\";\nimport todoExtension from \"./todo/index.ts\";\n\nexport const builtInExtensions: InlineExtension[] = [\n\t{ name: \"biu\", factory: biuExtension, hidden: true },\n\t{ name: \"llama.cpp\", factory: llamaExtension, hidden: true },\n\t{ name: \"deepwiki\", factory: deepwikiExtension, hidden: true },\n\t{ name: \"question\", factory: questionExtension, hidden: true },\n\t{ name: \"rewind\", factory: rewindExtension, hidden: true },\n\t{ name: \"router\", factory: routerExtension, hidden: true },\n\t{ name: \"statusline\", factory: statuslineExtension, hidden: true },\n\t{ name: \"subagent\", factory: subagentExtension, hidden: true },\n\t{ name: \"todo\", factory: todoExtension, hidden: true },\n];\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IACnD,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE;IAC5D,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE;IAC1D,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE;IAClE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE;CACtD,CAAC","sourcesContent":["import type { InlineExtension } from \"../core/extensions/types.ts\";\nimport deepwikiExtension from \"./deepwiki/index.ts\";\nimport llamaExtension from \"./llama/index.ts\";\nimport questionExtension from \"./question/index.ts\";\nimport routerExtension from \"./router/index.ts\";\nimport statuslineExtension from \"./statusline/index.ts\";\nimport subagentExtension from \"./subagent/index.ts\";\nimport todoExtension from \"./todo/index.ts\";\n\nexport const builtInExtensions: InlineExtension[] = [\n\t{ name: \"llama.cpp\", factory: llamaExtension, hidden: true },\n\t{ name: \"deepwiki\", factory: deepwikiExtension, hidden: true },\n\t{ name: \"question\", factory: questionExtension, hidden: true },\n\t{ name: \"router\", factory: routerExtension, hidden: true },\n\t{ name: \"statusline\", factory: statuslineExtension, hidden: true },\n\t{ name: \"subagent\", factory: subagentExtension, hidden: true },\n\t{ name: \"todo\", factory: todoExtension, hidden: true },\n];\n"]}
@@ -61,7 +61,7 @@ export declare const TodoParamsSchema: Type.TObject<{
61
61
  subject: Type.TOptional<Type.TString>;
62
62
  description: Type.TOptional<Type.TString>;
63
63
  activeForm: Type.TOptional<Type.TString>;
64
- status: Type.TOptional<Type.TUnsafe<"pending" | "in_progress" | "completed" | "deleted">>;
64
+ status: Type.TOptional<Type.TUnsafe<"pending" | "completed" | "in_progress" | "deleted">>;
65
65
  blockedBy: Type.TOptional<Type.TArray<Type.TInteger>>;
66
66
  items: Type.TOptional<Type.TArray<Type.TObject<{
67
67
  key: Type.TOptional<Type.TString>;
@@ -18,11 +18,11 @@ const LEGACY_METADATA_LIMITS = {
18
18
  maxBytes: 16 * 1024 * 1024,
19
19
  };
20
20
  // ---- per-session state ------------------------------------------------------
21
- // Keyed by session id like rewind's engine state: one Pi process can host more
22
- // than one session over its lifetime (resume, /tree branch switches), and a
23
- // module-level singleton would leak one session's list into another. Tool
24
- // renderers get no ctx, so the active session is a module-level pointer kept
25
- // current by execute and the lifecycle handlers (which do have ctx).
21
+ // Keyed by session id: one Pi process can host more than one session over its
22
+ // lifetime (resume, /tree branch switches), and a module-level singleton would
23
+ // leak one session's list into another. Tool renderers get no ctx, so the
24
+ // active session is a module-level pointer kept current by execute and the
25
+ // lifecycle handlers (which do have ctx).
26
26
  const states = new Map();
27
27
  let activeSid = "";
28
28
  /** Point the module at a session's state bucket. Call wherever ctx is in hand. */