@gavin-hu/my-pi-agent 0.14.0 → 0.15.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 (229) hide show
  1. package/README.md +54 -34
  2. package/README.zh-CN.md +44 -28
  3. package/extensions/bytefly/README.md +193 -140
  4. package/extensions/bytefly/block/component.ts +7 -15
  5. package/extensions/bytefly/block/register.ts +6 -1
  6. package/extensions/bytefly/doctor/register.ts +24 -5
  7. package/extensions/bytefly/doctor/tools.ts +4 -0
  8. package/extensions/bytefly/footer/collect/snapshot.ts +6 -1
  9. package/extensions/bytefly/footer/config.ts +10 -6
  10. package/extensions/bytefly/footer/price/price.ts +5 -3
  11. package/extensions/bytefly/footer/price/rates.ts +63 -26
  12. package/extensions/bytefly/footer/render/status.ts +3 -3
  13. package/extensions/bytefly/header/component.ts +3 -2
  14. package/extensions/bytefly/index.ts +3 -3
  15. package/extensions/bytefly/notice/component.ts +8 -3
  16. package/extensions/bytefly/notify/config.ts +6 -11
  17. package/extensions/bytefly/notify/dispatch.ts +13 -5
  18. package/extensions/bytefly/panel/commands.ts +21 -1
  19. package/extensions/bytefly/panel/format.ts +5 -2
  20. package/extensions/bytefly/panel/settings-runtime.ts +26 -6
  21. package/extensions/bytefly/panel/settings.ts +41 -4
  22. package/extensions/bytefly/panel/themes.ts +32 -0
  23. package/extensions/bytefly/panel/tui/editing.ts +77 -0
  24. package/extensions/bytefly/panel/tui/entries.ts +24 -0
  25. package/extensions/bytefly/panel/tui/extensions-view.ts +13 -8
  26. package/extensions/bytefly/panel/tui/frame.ts +121 -4
  27. package/extensions/bytefly/panel/tui/settings-view.ts +54 -15
  28. package/extensions/bytefly/panel/tui.ts +94 -152
  29. package/extensions/bytefly/picker/discovery.ts +1 -0
  30. package/extensions/bytefly/picker/types.ts +2 -0
  31. package/extensions/bytefly/separator/component.ts +14 -4
  32. package/extensions/bytefly/update/cache.ts +58 -19
  33. package/extensions/bytefly/update/check.ts +35 -0
  34. package/extensions/bytefly/update/format.ts +76 -35
  35. package/extensions/bytefly/update/register.ts +144 -55
  36. package/extensions/bytefly/update/state.ts +4 -2
  37. package/extensions/bytefly/update/suppress.ts +66 -0
  38. package/extensions/bytefly/update/types.ts +15 -0
  39. package/extensions/check/README.md +253 -0
  40. package/extensions/check/commands.ts +128 -0
  41. package/extensions/check/config.ts +39 -0
  42. package/extensions/check/detect.ts +269 -0
  43. package/extensions/check/failures.ts +230 -0
  44. package/extensions/check/format.ts +135 -0
  45. package/extensions/check/index.ts +26 -0
  46. package/extensions/check/render.ts +185 -0
  47. package/extensions/check/runner.ts +176 -0
  48. package/extensions/check/runtime.ts +244 -0
  49. package/extensions/check/source.ts +80 -0
  50. package/extensions/check/tools.ts +173 -0
  51. package/extensions/check/tui.ts +195 -0
  52. package/extensions/check/types.ts +99 -0
  53. package/extensions/document/README.md +1 -1
  54. package/extensions/document/extract/pdf.ts +8 -16
  55. package/extensions/document/formats.ts +2 -2
  56. package/extensions/file-browse/README.md +126 -37
  57. package/extensions/file-browse/client.ts +98 -33
  58. package/extensions/file-browse/config.ts +24 -9
  59. package/extensions/file-browse/files.ts +183 -48
  60. package/extensions/file-browse/fuzzy.ts +65 -11
  61. package/extensions/file-browse/git.ts +37 -47
  62. package/extensions/file-browse/html.ts +97 -171
  63. package/extensions/file-browse/live-client.ts +158 -0
  64. package/extensions/file-browse/live.ts +222 -0
  65. package/extensions/file-browse/markdown.ts +110 -92
  66. package/extensions/file-browse/raw-html.ts +478 -0
  67. package/extensions/file-browse/router.ts +65 -78
  68. package/extensions/file-browse/server.ts +75 -59
  69. package/extensions/file-browse/styles.ts +124 -0
  70. package/extensions/file-browse/urls.ts +80 -0
  71. package/extensions/goal/README.md +103 -47
  72. package/extensions/goal/clarify-parse.ts +4 -9
  73. package/extensions/goal/clarify.ts +27 -4
  74. package/extensions/goal/commands.ts +24 -11
  75. package/extensions/goal/format.ts +41 -10
  76. package/extensions/goal/index.ts +39 -16
  77. package/extensions/goal/plan-route.ts +51 -0
  78. package/extensions/goal/schema.ts +6 -23
  79. package/extensions/goal/state.ts +39 -57
  80. package/extensions/goal/tools.ts +26 -20
  81. package/extensions/goal/types.ts +11 -1
  82. package/extensions/job/README.md +20 -6
  83. package/extensions/job/format.ts +18 -68
  84. package/extensions/job/index.ts +26 -41
  85. package/extensions/job/log-writer.ts +208 -0
  86. package/extensions/job/logs.ts +3 -2
  87. package/extensions/job/process.ts +6 -99
  88. package/extensions/job/runtime.ts +42 -181
  89. package/extensions/job/schema.ts +1 -4
  90. package/extensions/job/tools.ts +1 -15
  91. package/extensions/job/tui.ts +117 -307
  92. package/extensions/job/ui.ts +7 -33
  93. package/extensions/memory/README.md +1 -1
  94. package/extensions/memory/errors.ts +5 -6
  95. package/extensions/memory/tui.ts +14 -24
  96. package/extensions/plan/README.md +94 -18
  97. package/extensions/plan/commands.ts +9 -5
  98. package/extensions/plan/format.ts +87 -0
  99. package/extensions/plan/index.ts +31 -15
  100. package/extensions/plan/plans.ts +2 -3
  101. package/extensions/plan/policy.ts +0 -6
  102. package/extensions/plan/runtime.ts +4 -2
  103. package/extensions/plan/steps.ts +37 -8
  104. package/extensions/plan/todos.ts +44 -3
  105. package/extensions/plan/tools/enter.ts +94 -0
  106. package/extensions/plan/tools/exit.ts +296 -0
  107. package/extensions/plan/tools/nested.ts +21 -0
  108. package/extensions/plan/tools/steps.ts +136 -0
  109. package/extensions/plan/tools/todo-seed.ts +76 -0
  110. package/extensions/plan/tools/write.ts +127 -0
  111. package/extensions/plan/tools.ts +18 -703
  112. package/extensions/plan/web-client.ts +6 -22
  113. package/extensions/plan/web-page.ts +19 -30
  114. package/extensions/plan/web-router.ts +32 -79
  115. package/extensions/plan/web.ts +21 -42
  116. package/extensions/question/answers.ts +3 -8
  117. package/extensions/question/tui.ts +6 -6
  118. package/extensions/rewind/README.md +95 -22
  119. package/extensions/rewind/checklist.ts +192 -0
  120. package/extensions/rewind/commands.ts +8 -0
  121. package/extensions/rewind/config.ts +3 -11
  122. package/extensions/rewind/format.ts +220 -2
  123. package/extensions/rewind/git.ts +101 -21
  124. package/extensions/rewind/hunk-picker.ts +114 -0
  125. package/extensions/rewind/patch.ts +88 -0
  126. package/extensions/rewind/path-picker.ts +67 -100
  127. package/extensions/rewind/paths.ts +93 -19
  128. package/extensions/rewind/restore.ts +53 -10
  129. package/extensions/rewind/review-tui.ts +320 -0
  130. package/extensions/rewind/review.ts +397 -0
  131. package/extensions/rewind/rewind-tui.ts +4 -3
  132. package/extensions/rewind/runtime.ts +94 -17
  133. package/extensions/rewind/snapshot.ts +13 -4
  134. package/extensions/subagent/README.md +61 -6
  135. package/extensions/subagent/background-tui.ts +208 -0
  136. package/extensions/subagent/background.ts +470 -0
  137. package/extensions/subagent/commands.ts +80 -0
  138. package/extensions/subagent/config.ts +4 -0
  139. package/extensions/subagent/format.ts +24 -1
  140. package/extensions/subagent/index.ts +91 -2
  141. package/extensions/subagent/render.ts +13 -0
  142. package/extensions/subagent/run.ts +17 -16
  143. package/extensions/subagent/schema.ts +12 -0
  144. package/extensions/subagent/types.ts +11 -0
  145. package/extensions/subagent/ui.ts +50 -0
  146. package/extensions/todo/README.md +18 -13
  147. package/extensions/todo/format.ts +3 -2
  148. package/extensions/todo/runtime.ts +3 -2
  149. package/extensions/todo/schema.ts +8 -84
  150. package/extensions/todo/state.ts +5 -46
  151. package/extensions/todo/tools.ts +2 -1
  152. package/extensions/todo/types.ts +6 -15
  153. package/extensions/watch/README.md +14 -6
  154. package/extensions/watch/child.ts +150 -0
  155. package/extensions/watch/format.ts +8 -48
  156. package/extensions/watch/index.ts +42 -58
  157. package/extensions/watch/runtime.ts +49 -128
  158. package/extensions/watch/schema.ts +1 -4
  159. package/extensions/watch/tools.ts +1 -11
  160. package/extensions/watch/tui.ts +103 -273
  161. package/extensions/watch/ui.ts +5 -32
  162. package/extensions/web-access/README.md +1 -1
  163. package/extensions/web-access/fetch/page.ts +1 -1
  164. package/extensions/web-access/fetch/tool.ts +6 -2
  165. package/extensions/web-access/search/search.ts +2 -5
  166. package/extensions/wechat/README.md +1 -1
  167. package/extensions/wechat/client.ts +23 -0
  168. package/extensions/wechat/commands.ts +57 -42
  169. package/extensions/wechat/deliver.ts +5 -9
  170. package/extensions/wechat/errors.ts +3 -6
  171. package/extensions/wechat/inbound.ts +2 -5
  172. package/extensions/wechat/index.ts +2 -8
  173. package/extensions/wechat/outbound.ts +2 -4
  174. package/extensions/wechat/peer-worker.ts +3 -8
  175. package/extensions/wechat/poll.ts +10 -9
  176. package/extensions/wechat/presence.ts +35 -62
  177. package/extensions/wechat/reply-pipeline.ts +3 -1
  178. package/extensions/wechat/status-screen.ts +1 -1
  179. package/extensions/wechat/timer.ts +57 -0
  180. package/extensions/worktree/config.ts +8 -20
  181. package/extensions/worktree/enter.ts +7 -12
  182. package/extensions/worktree/git.ts +38 -69
  183. package/extensions/worktree/index.ts +5 -4
  184. package/extensions/worktree/registry.ts +7 -7
  185. package/extensions/worktree/root-tools.ts +2 -2
  186. package/extensions/worktree/status.ts +15 -9
  187. package/lib/README.md +23 -8
  188. package/lib/config.ts +50 -3
  189. package/lib/errors.ts +12 -0
  190. package/lib/format.ts +50 -0
  191. package/lib/git/read.ts +28 -0
  192. package/lib/goal-state.ts +23 -8
  193. package/lib/http/headers.ts +74 -0
  194. package/lib/http/index.ts +13 -0
  195. package/lib/http/response.ts +46 -0
  196. package/lib/http/router.ts +52 -0
  197. package/lib/http/server.ts +109 -0
  198. package/lib/lines.ts +77 -0
  199. package/lib/pdf.ts +82 -0
  200. package/lib/plan-entry.ts +71 -0
  201. package/lib/plan-state.ts +34 -0
  202. package/lib/pool.ts +62 -0
  203. package/lib/report.ts +99 -0
  204. package/lib/requirements.ts +25 -19
  205. package/lib/spawn.ts +170 -0
  206. package/lib/todo-state.ts +110 -23
  207. package/lib/tool-names.ts +7 -0
  208. package/lib/tool-result.ts +33 -0
  209. package/lib/tui/README.md +68 -3
  210. package/lib/tui/chrome.ts +28 -4
  211. package/lib/tui/columns.ts +6 -1
  212. package/lib/tui/confirm.ts +65 -0
  213. package/lib/tui/dock-screen.ts +418 -0
  214. package/lib/tui/glyphs.ts +2 -1
  215. package/lib/tui/indent.ts +1 -1
  216. package/lib/tui/index.ts +2 -0
  217. package/lib/tui/rows.ts +21 -0
  218. package/lib/tui/status-controller.ts +35 -1
  219. package/lib/tui/tool.ts +59 -1
  220. package/lib/web/components.ts +20 -1
  221. package/lib/web/markup.ts +32 -0
  222. package/lib/web/runtime.ts +50 -0
  223. package/package.json +22 -5
  224. package/skills/init/SKILL.md +165 -0
  225. package/skills/init/references/agents-md-quality.md +103 -0
  226. package/skills/init/references/interview-questions.md +81 -0
  227. package/skills/refactor/SKILL.md +141 -0
  228. package/extensions/watch/process.ts +0 -63
  229. package/extensions/web-access/fetch/pdf.ts +0 -45
package/README.md CHANGED
@@ -8,9 +8,13 @@
8
8
  [![built for Pi](https://img.shields.io/badge/built%20for-Pi-5A4FCF)](https://pi.dev)
9
9
 
10
10
  `my-pi-agent` is a single [Pi](https://pi.dev) package that adds a curated set
11
- of extensions and themes to the agent you already use — install the pack, turn
11
+ of extensions, skills, and themes to the agent you already use — install the pack, turn
12
12
  off what you do not want, and keep using Pi unchanged.
13
13
 
14
+ This page is the catalog and the setup instructions. For how to use a feature —
15
+ the keys, the commands, and what you should see — start with the
16
+ [user guide](./docs/user-guide/).
17
+
14
18
  ![A terminal window running the Pi TUI with the bytefly header, hint row, context and loaded extensions, a turn separator, and the status bar](assets/chrome.png)
15
19
 
16
20
  ## Contents
@@ -42,10 +46,10 @@ want the agent to *think first and work safely*:
42
46
  documents from inside the session, and answer a WeChat chat through a bridge to
43
47
  the live session.
44
48
 
45
- Everything is optional and independently toggleable. Nothing is patched or
46
- forked: Pi discovers the resources through the `pi` manifest in
47
- [`package.json`](./package.json), so the package upgrades with Pi like any
48
- other.
49
+ Everything is optional and independently toggleable. Nothing is forked, and no
50
+ installed Pi file is modified: Pi discovers the resources through the `pi`
51
+ manifest in [`package.json`](./package.json), so the package upgrades with Pi
52
+ like any other.
49
53
 
50
54
  ## Quick start
51
55
 
@@ -55,7 +59,7 @@ Requires a working [Pi](https://pi.dev) installation.
55
59
  pi install npm:@gavin-hu/my-pi-agent
56
60
  ```
57
61
 
58
- [Getting started](./docs/getting-started.md) has the other sources — git, a
62
+ [User guide](./docs/user-guide/) has the other sources — git, a
59
63
  pinned release, a project-local install, and a trial that writes nothing — plus
60
64
  the fit decision, the first workflows, and how to remove the pack.
61
65
 
@@ -69,33 +73,36 @@ Then, from inside Pi:
69
73
  - `/bytefly [extension] [refresh]` opens the control center on Extensions, lists
70
74
  every loaded extension with its runtime health, enables or disables one, and
71
75
  clears a project override with `x`.
72
- - `/bytefly settings` opens the control center's Settings section: bytefly
73
- startup TUI, desktop notifications and their delivery method, the proactive
74
- health check, the currency and cost precision, the transcript
75
- rail glyph, output padding, and the hardware cursor, with `Space`/`Enter` to
76
- change a value and `Tab` for Global/Project scope.
76
+ - `/bytefly settings` opens the control center's Settings section: the curated
77
+ settings, grouped by area, plus a **Theme** row, with `Space`/`Enter` to change
78
+ a value and `Tab` for Global/Project scope.
77
79
  - `/bytefly doctor [extension] [refresh]` prints the doctor report —
78
80
  `run_doctor`'s text — and checks that each enabled extension has what it needs
79
81
  at runtime.
80
- - `/settings` → **Theme** selects a theme.
82
+ - `/bytefly update` re-runs the package update check now and reports the
83
+ updateable packages, this package's version and release URL, or a skip.
81
84
  - `/plan <task>` starts a task in read-only planning mode.
85
+ - `/skill:init` creates or updates `AGENTS.md` through a short built-in interview and a plan you review first.
82
86
 
83
- One thing the pack does on its own: once per interactive session, `bytefly` asks
84
- npm for the newest published version and marks the header when yours is older.
85
- Nothing about the session is sent, and `PI_OFFLINE` skips the request;
87
+ One thing the pack does on its own: once per interactive session, `bytefly`
88
+ asks Pi's package manager which configured packages are behind, suppresses Pi's
89
+ own startup update block, and posts one themed notice naming
90
+ `pi update --extensions`; this package's new version also marks the header.
91
+ Nothing about the session is sent, and `PI_OFFLINE` skips the check;
86
92
  [`docs/security.md`](./docs/security.md) covers the trust boundaries.
87
93
 
88
94
  ## What you get
89
95
 
90
- Sixteen extensions, grouped by what you are trying to do, plus two themes. Each
91
- extension's own `README.md` has the full tool and command surface.
96
+ 17 extensions, 2 packaged skills, and 2 themes, grouped by what you are trying
97
+ to do. Each extension's own `README.md` has the full tool and command surface.
92
98
 
93
99
  ### Plan and delegate
94
100
 
95
101
  | Extension | Tools and commands | What it does |
96
102
  |---|---|---|
97
- | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | Read-only planning: the model investigates, saves a plan under `.pi/plans`, and you approve it before anything is written. Review in the TUI, or open it in a browser to leave inline comments. |
98
- | [`subagent`](./extensions/subagent/) | `subagent` | Delegate a task to a specialist agent (`explorer`, `planner`, `reviewer`, `worker`, `researcher`, `tester`, `debugger`, `documenter`) in its own Pi process — single, parallel, or chained. |
103
+ | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | Read-only planning: the model investigates, saves a plan under `.pi/plans`, and you approve it before anything is written. Review in the TUI, or open it in a browser to leave inline comments. The `init` skill uses the same review to create or update a project's `AGENTS.md`. |
104
+ | [`check`](./extensions/check/) | `run_check`, `/check` | Detect the project's test, lint, or typecheck command (or take `check.command`), run it in a supervised process, and turn failures into a navigable `file:line` list. |
105
+ | [`subagent`](./extensions/subagent/) | `subagent`, `/agents` | Delegate a task to a specialist agent (`explorer`, `planner`, `reviewer`, `worker`, `researcher`, `tester`, `debugger`, `documenter`) in its own Pi process — single, parallel, chained, or in the background, with a footer chip while it runs and a finish notice. |
99
106
  | [`todo`](./extensions/todo/) | `todo`, `/todos` | A persistent task list (`pending` / `in_progress` / `completed`) with a one-line widget. |
100
107
  | [`goal`](./extensions/goal/) | `goal`, `/goal` | A persistent session objective, kept in a widget and restated before each turn. |
101
108
  | [`question`](./extensions/question/) | `ask_user_question` | Ask you one or more structured questions (labelled options plus free-form "Other") and wait. |
@@ -106,8 +113,8 @@ extension's own `README.md` has the full tool and command surface.
106
113
 
107
114
  | Extension | Tools and commands | What it does |
108
115
  |---|---|---|
109
- | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree*`, `--worktree` | Work inside an isolated `git worktree` on its own branch; the built-in read/write/edit/bash tools follow, and cleanup refuses to throw work away. |
110
- | [`rewind`](./extensions/rewind/) | `/rewind`, `↺ N` status chip | Snapshot the repo on every prompt under `refs/pi/rewind` and restore code, conversation, or both. |
116
+ | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree status|enter|exit|prune`, `--worktree` | Work inside an isolated `git worktree` on its own branch; the built-in read/write/edit/bash tools follow, and cleanup refuses to throw work away. |
117
+ | [`rewind`](./extensions/rewind/) | `/rewind`, `/review`, `↺ N` status chip | Snapshot the repo on every prompt under `refs/pi/rewind`, restore code, conversation, or both, and review the latest turn's changes before reverting a file. |
111
118
  | [`memory`](./extensions/memory/) | `memory`, `/memory` | Durable cross-session notes as human-editable markdown, injected into each run and managed through the `/memory` picker. |
112
119
 
113
120
  ### Reach the world
@@ -115,7 +122,7 @@ extension's own `README.md` has the full tool and command surface.
115
122
  | Extension | Tools and commands | What it does |
116
123
  |---|---|---|
117
124
  | [`web-access`](./extensions/web-access/) | `web_search`, `web_fetch` | Search the web (keyless DuckDuckGo by default, optional SearXNG or Brave) and fetch a page as readable text, with paging, `find`, per-hop SSRF checks, and optional PDF support. |
118
- | [`file-browse`](./extensions/file-browse/) | `/browse` | Start a loopback, read-only file browser rooted at the working directory, with Markdown preview and a fuzzy quick-open palette. |
125
+ | [`file-browse`](./extensions/file-browse/) | `/browse` | Start a loopback, read-only file browser rooted at the working directory, with Markdown preview, a fuzzy quick-open palette, and live status for a page left open. |
119
126
  | [`document`](./extensions/document/) | `read_doc` | Extract text from a local PDF, DOCX, DOC, ODT, RTF, or XLSX in process, paged. |
120
127
  | [`file-open`](./extensions/file-open/) | `/open`, `open_path` | Open or reveal a file or directory in the OS-native application. |
121
128
  | [`wechat`](./extensions/wechat/) | `/wechat`, `send_wechat` | Bridge a WeChat chat to the live session over the Weixin iLink bot API; inbound text, images, and files become turns. |
@@ -124,14 +131,26 @@ extension's own `README.md` has the full tool and command surface.
124
131
 
125
132
  | Extension | Tools and commands | What it does |
126
133
  |---|---|---|
127
- | [`bytefly`](./extensions/bytefly/) | `/bytefly` (with the `doctor` and `settings` subcommands), `run_doctor` | The visible layer: a themed header with a width-adaptive footer, a live run line on Pi's working row (tool, tool count, and elapsed time), and a transcript where every tool block leads with its call line and rails its result under it. `/bytefly` switches extensions and holds the curated settings; opt-in `notify` raises OS notifications when a run, a job, or a question needs you. `bytefly.json` is the config document every extension reads. |
134
+ | [`bytefly`](./extensions/bytefly/) | `/bytefly` (with the `doctor`, `settings`, and `update` subcommands), `run_doctor` | The visible layer: a themed header with a width-adaptive footer, a live run line on Pi's working row (tool, tool count, and elapsed time), and a transcript where every tool block leads with its call line and rails its result under it. `/bytefly` switches extensions and holds the curated settings; opt-in `notify` raises OS notifications when a run, a job, or a question needs you. `bytefly.json` is the config document every extension reads. |
135
+
136
+ ### Skills
137
+
138
+ Packaged workflows loaded on demand: each skill's name and description are
139
+ advertised to the model, and its instructions load only when the task matches
140
+ (`/skill:<name>` forces one).
141
+
142
+ | Skill | What it does |
143
+ |---|---|
144
+ | [`init`](./skills/init/SKILL.md) | Creates or updates a project's `AGENTS.md` through a built-in interactive interview and plan review, from repository evidence. |
145
+ | [`refactor`](./skills/refactor/SKILL.md) | Audits a project or path for refactoring opportunities: duplication, oversized modules, coupling, drift, and high-churn code with weak tests. Returns a ranked shortlist with evidence and verification commands; discovery is read-only. |
128
146
 
129
147
  ### Themes
130
148
 
131
149
  [`bytefly-dark`](./themes/bytefly-dark.json) is a GitHub-inspired dark palette
132
150
  and [`bytefly-light`](./themes/bytefly-light.json) its light companion, with
133
151
  optional automatic light/dark switching. Installing the pack does not change
134
- your theme: pick one through `/settings` → **Theme**, or set
152
+ your theme: pick one through `/settings` → **Theme** (or `/bytefly settings` →
153
+ **Theme**), or set
135
154
  `"theme": "bytefly-light/bytefly-dark"` for switching. The screenshots in this
136
155
  README use `bytefly-dark`.
137
156
 
@@ -156,20 +175,23 @@ each tool's own renderer (or bytefly's generic fallback): the user nameplate and
156
175
  a notice, Pi's built-ins, and every tool this package registers. The rail glyph
157
176
  is the `chrome.rail` setting.
158
177
 
159
- ![A full-page reference of every tool block: the user nameplate, a notice, the turn rule, Pi's read, write, edit, bash, grep, find, and ls renderers, and every package tool — todo, goal, memory, job, watch, subagent, web_search, web_fetch, read_doc, open_path, run_doctor, send_wechat, ask_user_question, the plan tools, and the worktree tools](assets/tool-renderings.png)
178
+ ![A full-page reference of every tool block: the user nameplate, a notice, the turn rule, Pi's read, write, edit, bash, grep, find, and ls renderers, and every package tool — todo, goal, memory, job, watch, subagent, web_search, web_fetch, read_doc, open_path, run_doctor, run_check, send_wechat, ask_user_question, the plan tools, and the worktree tools](assets/tool-renderings.png)
160
179
 
161
180
  `bun run screenshot:tools` regenerates it; `bun run screenshot:tool-pngs` writes
162
181
  one image per tool under [`assets/tools/`](./assets/tools).
163
182
 
183
+ Ready to use one? The [user guide](./docs/user-guide/) has a walkthrough for
184
+ each: the first run, the keys that matter, and what to expect on screen.
185
+
164
186
  ## Configuration
165
187
 
166
188
  Most extensions need no configuration. Every setting lives in one shared
167
189
  document, `bytefly.json`, read from `<agent-dir>/bytefly.json` and merged with
168
190
  `<cwd>/.pi/bytefly.json` (project wins), under a top-level section named for the
169
- extension. Each extension's `README.md` covers the behaviour around its keys,
170
- [`docs/configuration.md`](./docs/configuration.md) indexes the sections, and
171
- [`docs/references/bytefly-config.md`](./docs/references/bytefly-config.md) lists
172
- every key with its type, default, and bounds.
191
+ extension. Each extension's `README.md` covers the behaviour around its keys, and
192
+ [`docs/configuration.md`](./docs/configuration.md) has the resolution rules, the
193
+ settings screen walkthrough, and every section's keys with their type, default,
194
+ and bounds.
173
195
 
174
196
  Every extension is on by default. To load the pack without some of them, set
175
197
  `PI_DISABLED_EXTENSIONS` to a comma- or whitespace-separated list of extension
@@ -187,11 +209,9 @@ stops the factories from registering; to drop the whole package, use Pi's
187
209
 
188
210
  | Guide | What it covers |
189
211
  |---|---|
190
- | [Getting started](./docs/getting-started.md) | Whether the pack fits, a trial run, install options, verifying the load, first workflows, and removal. |
191
- | [Extensions](./docs/extensions.md) | The full catalog of every extension and theme. |
192
- | [Configuration](./docs/configuration.md) | Config-file resolution, the per-extension index, environment variables. |
193
- | [Configuration reference](./docs/references/bytefly-config.md) | Every `bytefly.json` section and key, with its type, default, and bounds. |
194
- | [Architecture](./docs/architecture.md) | How the package, its extensions, and `lib/` fit together. |
212
+ | [User guide](./docs/user-guide/) | A chaptered manual: install, every feature, settings, troubleshooting, and a command reference. |
213
+ | [Configuration](./docs/configuration.md) | Resolution, the settings screen, and every `bytefly.json` key with its default and bounds. |
214
+ | [Architecture](./docs/architecture.md) | The load path, runtime model, state, process shapes, and where new code belongs. |
195
215
  | [Development](./docs/development.md) | Local setup, checks, tests, cross-platform notes, and the release process. |
196
216
  | [Security](./docs/security.md) | Trust boundaries for the loopback and remote surfaces. |
197
217
  | [Roadmap](./ROADMAP.md) | Where the pack is going, grouped by the README's promises, with the evidence behind each item. |
package/README.zh-CN.md CHANGED
@@ -8,7 +8,10 @@
8
8
  [![built for Pi](https://img.shields.io/badge/built%20for-Pi-5A4FCF)](https://pi.dev)
9
9
 
10
10
  `my-pi-agent` 是一个 [Pi](https://pi.dev) 包,在你已经使用的智能体之上新增一组精选
11
- 扩展和主题 —— 安装整个包,关掉你不需要的部分,其余照常使用 Pi。
11
+ 扩展、技能和主题 —— 安装整个包,关掉你不需要的部分,其余照常使用 Pi。
12
+
13
+ 本页是目录与安装说明。要了解某个功能怎么用 —— 按键、命令以及应有的效果 ——
14
+ 请先看[用户指南](./docs/user-guide/)。
12
15
 
13
16
  ![一个运行 Pi TUI 的终端窗口,包含 bytefly 头部、提示行、上下文与已加载扩展、回合分隔线以及状态栏](assets/chrome.png)
14
17
 
@@ -37,9 +40,9 @@ Pi 提供一个精简而锐利的内核。这个包是在其之上的一层,
37
40
  - **连通网络与文件。** 在会话内搜索、抓取、浏览、打开和读取文档,还可通过桥接
38
41
  在微信里直接回答当前会话。
39
42
 
40
- 一切都是可选的,且可独立开关。没有任何东西被补丁或分叉:Pi 通过
41
- [`package.json`](./package.json) 里的 `pi` manifest 发现这些资源,因此该包能像
42
- 其他包一样随 Pi 一起升级。
43
+ 一切都是可选的,且可独立开关。没有任何东西被分叉,也没有修改已安装的 Pi 文件:
44
+ Pi 通过 [`package.json`](./package.json) 里的 `pi` manifest 发现这些资源,因此
45
+ 该包能像其他包一样随 Pi 一起升级。
43
46
 
44
47
  ## 快速开始
45
48
 
@@ -49,7 +52,7 @@ Pi 提供一个精简而锐利的内核。这个包是在其之上的一层,
49
52
  pi install npm:@gavin-hu/my-pi-agent
50
53
  ```
51
54
 
52
- [快速开始](./docs/getting-started.md) 介绍其余安装方式——git、固定版本、
55
+ [用户指南](./docs/user-guide/) 介绍其余安装方式——git、固定版本、
53
56
  仅项目本地安装,以及不写入任何内容的试用——还有适用性判断、首个工作流和移除方式。
54
57
 
55
58
  `git` 需在 `PATH` 上,供 [`worktree`](./extensions/worktree/) 与
@@ -61,29 +64,32 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
61
64
 
62
65
  - `/bytefly [extension] [refresh]` 打开控制中心的 Extensions 区,列出每个已加载扩展
63
66
  及其运行时健康状况,启用或禁用一个扩展,并用 `x` 清除项目级覆盖。
64
- - `/bytefly settings` 打开控制中心的 Settings 区:bytefly 启动 TUI、桌面通知及其
65
- 投递方式、主动健康检查、货币与费用精度、转录轨道字形、输出内边距和硬件光标;
66
- 用 `Space`/`Enter` 修改,用 `Tab` 切换 Global/Project 作用域。
67
+ - `/bytefly settings` 打开控制中心的 Settings 区:精选设置按类别分组,并提供
68
+ **Theme** 行;用 `Space`/`Enter` 修改,用 `Tab` 切换 Global/Project 作用域。
67
69
  - `/bytefly doctor [extension] [refresh]` 打印 doctor 报告(`run_doctor` 的文本),
68
70
  检查每个已启用扩展在运行时是否具备所需条件。
69
- - `/settings` → **Theme** 选择主题。
71
+ - `/bytefly update` 立即重跑包更新检查,报告可更新的包、本包版本与 release URL,
72
+ 或跳过原因。
70
73
  - `/plan <任务>` 以只读规划模式开始一个任务。
74
+ - `/skill:init` 通过内置的简短访谈和先审阅的计划创建或更新 `AGENTS.md`。
71
75
 
72
- 还有一件包会自行做的事:每次交互式会话启动时,`bytefly` 向 npm 询问最新发布
73
- 版本,当你的版本较旧时在头部标出。不会发送任何会话内容,`PI_OFFLINE` 可跳过
74
- 该请求;信任边界见 [`docs/security.md`](./docs/security.md)。
76
+ 还有一件包会自行做的事:每次交互式会话启动时,`bytefly` 询问 Pi 的包管理器
77
+ 哪些已配置的包有更新,抑制 Pi 自己的启动更新块,并用一个主题化 notice 列出它们
78
+ 和 `pi update --extensions`;本包的新版本还会标在头部。不会发送任何会话内容,
79
+ `PI_OFFLINE` 可跳过检查;信任边界见 [`docs/security.md`](./docs/security.md)。
75
80
 
76
81
  ## 包含内容
77
82
 
78
- 十六个扩展,按你想达成的目标分组,外加两个主题。每个扩展自己的 `README.md`
83
+ 17 个扩展、2 个随包技能,以及 2 个主题,按你想达成的目标分组。每个扩展自己的 `README.md`
79
84
  提供完整的工具与命令说明。
80
85
 
81
86
  ### 规划与委派
82
87
 
83
88
  | 扩展 | 工具与命令 | 说明 |
84
89
  |---|---|---|
85
- | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | 只读规划:模型先调研,把计划保存到 `.pi/plans` 下,你在写入任何内容前先批准。可在 TUI 中审阅,或在浏览器中打开以留下行内评论。 |
86
- | [`subagent`](./extensions/subagent/) | `subagent` | 把任务委派给专职智能体(`explorer`、`planner`、`reviewer`、`worker`、`researcher`、`tester`、`debugger`、`documenter`),运行在它自己的 Pi 进程中 —— 单个、并行或链式。 |
90
+ | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | 只读规划:模型先调研,把计划保存到 `.pi/plans` 下,你在写入任何内容前先批准。可在 TUI 中审阅,或在浏览器中打开以留下行内评论。`init` 技能复用同一审阅流程来创建或更新项目的 `AGENTS.md`。 |
91
+ | [`check`](./extensions/check/) | `run_check`, `/check` | 检测项目的测试、lint 或类型检查命令(或使用 `check.command`),在受监管的进程中运行,并把失败整理成可导航的 `file:line` 列表。 |
92
+ | [`subagent`](./extensions/subagent/) | `subagent`, `/agents` | 把任务委派给专职智能体(`explorer`、`planner`、`reviewer`、`worker`、`researcher`、`tester`、`debugger`、`documenter`),运行在它自己的 Pi 进程中 —— 单个、并行、链式或在后台运行;后台运行时在页脚显示数量,完成后发出提示。 |
87
93
  | [`todo`](./extensions/todo/) | `todo`, `/todos` | 持久任务列表(`pending` / `in_progress` / `completed`),配一行式 widget。 |
88
94
  | [`goal`](./extensions/goal/) | `goal`, `/goal` | 持久会话目标,保存在 widget 中,并在每个回合前重述。 |
89
95
  | [`question`](./extensions/question/) | `ask_user_question` | 向你提出一个或多个结构化问题(带标签的选项外加自由填写的“其他”)并等待回答。 |
@@ -94,8 +100,8 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
94
100
 
95
101
  | 扩展 | 工具与命令 | 说明 |
96
102
  |---|---|---|
97
- | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree*`, `--worktree` | 在隔离的 `git worktree` 里、在独立分支上工作;内置的 read/write/edit/bash 工具会跟随,清理时也不会丢弃工作。 |
98
- | [`rewind`](./extensions/rewind/) | `/rewind`, `↺ N` 状态标记 | 每次提示时在 `refs/pi/rewind` 下对仓库生成快照,可恢复代码、对话或两者。 |
103
+ | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree status|enter|exit|prune`, `--worktree` | 在隔离的 `git worktree` 里、在独立分支上工作;内置的 read/write/edit/bash 工具会跟随,清理时也不会丢弃工作。 |
104
+ | [`rewind`](./extensions/rewind/) | `/rewind`, `/review`, `↺ N` 状态标记 | 每次提示时在 `refs/pi/rewind` 下对仓库生成快照,可恢复代码、对话或两者,并在还原文件前审阅本轮改动。 |
99
105
  | [`memory`](./extensions/memory/) | `memory`, `/memory` | 跨会话的持久笔记,以可人工编辑的 Markdown 保存,注入每次运行,并通过 `/memory` 选择器管理。 |
100
106
 
101
107
  ### 连通外部世界
@@ -103,7 +109,7 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
103
109
  | 扩展 | 工具与命令 | 说明 |
104
110
  |---|---|---|
105
111
  | [`web-access`](./extensions/web-access/) | `web_search`, `web_fetch` | 搜索网络(默认无密钥的 DuckDuckGo,可选 SearXNG 或 Brave),并把页面抓取为可读文本,支持分页、`find`、逐跳 SSRF 检查以及可选的 PDF 支持。 |
106
- | [`file-browse`](./extensions/file-browse/) | `/browse` | 启动一个以工作目录为根的本地回环、只读文件浏览器,带 Markdown 预览和模糊快速打开面板。 |
112
+ | [`file-browse`](./extensions/file-browse/) | `/browse` | 启动一个以工作目录为根的本地回环、只读文件浏览器,带 Markdown 预览、模糊快速打开面板,以及为常开页面提供的实时状态。 |
107
113
  | [`document`](./extensions/document/) | `read_doc` | 在进程内从本地 PDF、DOCX、DOC、ODT、RTF 或 XLSX 提取文本,支持分页。 |
108
114
  | [`file-open`](./extensions/file-open/) | `/open`, `open_path` | 用操作系统原生应用打开或定位文件/目录。 |
109
115
  | [`wechat`](./extensions/wechat/) | `/wechat`, `send_wechat` | 通过微信 iLink 机器人 API 把微信聊天桥接到实时会话;入站文本、图片和文件会变成回合。 |
@@ -112,13 +118,23 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
112
118
 
113
119
  | 扩展 | 工具与命令 | 说明 |
114
120
  |---|---|---|
115
- | [`bytefly`](./extensions/bytefly/) | `/bytefly`(`doctor`、`settings` 子命令)、`run_doctor` | 可见的那一层:主题化头部配宽度自适应页脚,Pi 工作行上实时显示工具、调用次数与计时,转录中每个工具块以调用行为标题、结果正文挂在其下方。`/bytefly` 可开关扩展并集中存放精选设置;可选的 `notify` 会在一次运行、后台任务或待回答的问题需要你时发出系统通知。`bytefly.json` 是每个扩展都会读取的配置文档。 |
121
+ | [`bytefly`](./extensions/bytefly/) | `/bytefly`(`doctor`、`settings`、`update` 子命令)、`run_doctor` | 可见的那一层:主题化头部配宽度自适应页脚,Pi 工作行上实时显示工具、调用次数与计时,转录中每个工具块以调用行为标题、结果正文挂在其下方。`/bytefly` 可开关扩展并集中存放精选设置;可选的 `notify` 会在一次运行、后台任务或待回答的问题需要你时发出系统通知。`bytefly.json` 是每个扩展都会读取的配置文档。 |
122
+
123
+ ### 技能
124
+
125
+ 按需加载的随包工作流:每个技能的名称和描述会提供给模型,只有任务匹配时才加载完整说明(`/skill:<name>` 可强制加载)。
126
+
127
+ | 技能 | 说明 |
128
+ |---|---|
129
+ | [`init`](./skills/init/SKILL.md) | 基于仓库证据,通过内置的交互式访谈和计划审阅创建或更新项目的 `AGENTS.md`。 |
130
+ | [`refactor`](./skills/refactor/SKILL.md) | 审计项目或路径中的重构机会:重复代码、过大的模块、耦合、结构漂移,以及测试薄弱且改动频繁的代码。返回带证据和验证命令的排序清单;发现阶段只读。 |
116
131
 
117
132
  ### 主题
118
133
 
119
134
  [`bytefly-dark`](./themes/bytefly-dark.json) 是 GitHub 风格的深色调色板,
120
135
  [`bytefly-light`](./themes/bytefly-light.json) 是其浅色搭档,并支持可选的自动
121
- 浅色/深色切换。安装本包不会改变你的主题:通过 `/settings` → **Theme** 选择,
136
+ 浅色/深色切换。安装本包不会改变你的主题:通过 `/settings` → **Theme**(或
137
+ `/bytefly settings` → **Theme**)选择,
122
138
  或设置 `"theme": "bytefly-light/bytefly-dark"` 以自动切换。本 README 的截图
123
139
  使用 `bytefly-dark`。
124
140
 
@@ -147,14 +163,16 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
147
163
  `bun run screenshot:tools` 重新生成它;`bun run screenshot:tool-pngs` 在
148
164
  [`assets/tools/`](./assets/tools) 下为每个工具输出一张图。
149
165
 
166
+ 准备上手了?[用户指南](./docs/user-guide/) 为每个扩展都准备了分步讲解:
167
+ 第一次运行、关键按键,以及屏幕上会出现什么。
168
+
150
169
  ## 配置
151
170
 
152
171
  大多数扩展无需配置。所有设置都在一个共享文档 `bytefly.json` 中,从
153
172
  `<agent-dir>/bytefly.json` 读取,并与 `<cwd>/.pi/bytefly.json` 合并(项目优先),
154
173
  位于一个以扩展名命名的顶层 section 下。每个扩展的 `README.md` 说明其键位的行为,
155
- [`docs/configuration.md`](./docs/configuration.md) 为其建立索引,
156
- [`docs/references/bytefly-config.md`](./docs/references/bytefly-config.md) 逐个列出每个键的
157
- 类型、默认值和取值范围。
174
+ [`docs/configuration.md`](./docs/configuration.md) 则给出解析规则、设置界面操作方式,
175
+ 以及每个 section 的键、类型、默认值和取值范围。
158
176
 
159
177
  每个扩展默认都开启。若要在加载整包时排除其中一些,把 `PI_DISABLED_EXTENSIONS`
160
178
  设为一个以逗号或空白分隔的扩展名列表(即 [`extensions/`](./extensions/) 下的目录
@@ -171,11 +189,9 @@ Pi 的 `--no-extensions`,或从你的设置中删除该包。
171
189
 
172
190
  | 指南 | 内容 |
173
191
  |---|---|
174
- | [快速开始](./docs/getting-started.md) | 是否适合你、试用、安装选项、验证加载、首个工作流、移除。 |
175
- | [扩展](./docs/extensions.md) | 所有扩展与主题的完整目录。 |
176
- | [配置](./docs/configuration.md) | 配置文件解析、按扩展索引、环境变量。 |
177
- | [配置参考](./docs/references/bytefly-config.md) | 列出 `bytefly.json` 的每个 section 与键,包括类型、默认值和取值范围。 |
178
- | [架构](./docs/architecture.md) | 包、各扩展与 `lib/` 如何协同。 |
192
+ | [用户指南](./docs/user-guide/) | 分章手册:安装、每项功能、设置、故障排查与命令参考。 |
193
+ | [配置](./docs/configuration.md) | 解析规则、设置界面,以及 `bytefly.json` 每个键的默认值与取值范围。 |
194
+ | [架构](./docs/architecture.md) | 加载路径、运行时模型、状态、进程形态,以及新代码应放在哪里。 |
179
195
  | [开发](./docs/development.md) | 本地设置、检查、测试、跨平台注意事项与发布流程。 |
180
196
  | [安全](./docs/security.md) | 回环与远程界面的信任边界。 |
181
197
  | [路线图](./ROADMAP.md) | 包的下一步方向,按 README 的承诺分组,并列出每条事项的依据。 |