@rol1n/pi-kit 0.1.2 → 0.1.3

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 (41) hide show
  1. package/README.md +131 -56
  2. package/README_zh.md +131 -56
  3. package/ask-u-questions/README.md +2 -2
  4. package/continue-signal/README.md +2 -2
  5. package/custom-providers/README.md +2 -2
  6. package/image-generate/README.md +4 -2
  7. package/memory-log/README.md +2 -2
  8. package/model-vision/README.md +2 -2
  9. package/model-vision/image.ts +84 -0
  10. package/model-vision/index.ts +124 -0
  11. package/model-vision/network.ts +82 -0
  12. package/model-vision/requests.ts +151 -0
  13. package/multi-harness/README.md +4 -4
  14. package/oai-subquota/README.md +2 -2
  15. package/package.json +18 -24
  16. package/prompt-snipaste/README.md +19 -5
  17. package/prompt-snipaste/index.ts +4 -4
  18. package/prompt-snipaste/snippets.ts +28 -149
  19. package/prompt-snipaste/types.ts +1 -0
  20. package/screenshot/README.md +2 -2
  21. package/screenshot/index.ts +126 -0
  22. package/scripts/check-package.mjs +54 -0
  23. package/skills/worktree-studio/SKILL.md +99 -0
  24. package/srp-theme/README.md +2 -2
  25. package/subagent/README.md +4 -4
  26. package/tui-asr/README.md +4 -2
  27. package/web-reach/README.md +2 -2
  28. package/web-reach/html.ts +83 -0
  29. package/web-reach/index.ts +82 -0
  30. package/web-reach/page.ts +214 -0
  31. package/web-reach/rsc.ts +161 -0
  32. package/web-reach/search.ts +85 -0
  33. package/web-reach/transport.ts +35 -0
  34. package/windows-wheel-fix/README.md +2 -2
  35. /package/{prompt-snipaste/prompts → prompts}/ask-questions.md +0 -0
  36. /package/{prompt-snipaste/prompts → prompts}/delegate-exploration.md +0 -0
  37. /package/{prompt-snipaste/prompts → prompts}/diagnose-report.md +0 -0
  38. /package/{prompt-snipaste/prompts → prompts}/frontend-tech-preset.md +0 -0
  39. /package/{prompt-snipaste/prompts → prompts}/orchestrator-mode.md +0 -0
  40. /package/{prompt-snipaste/prompts → prompts}/session-kickoff.md +0 -0
  41. /package/{prompt-snipaste/prompts → prompts}/verify-not-assume.md +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-kit
2
2
 
3
- > Modular extensions and prompt templates for the [Pi Coding Agent](https://pi.dev), published as the **`@rol1n/pi-kit`** bundle and as standalone **`@rol1n/<extension>`** packages.
3
+ > One package of modular extensions, prompt templates, and skills for the [Pi Coding Agent](https://pi.dev). Install **`@rol1n/pi-kit`**, then choose what loads through Pi settings.
4
4
 
5
5
  <p align="left">
6
6
  <b>English</b> •
@@ -14,19 +14,11 @@
14
14
 
15
15
  ## Install
16
16
 
17
- Install the default bundle:
18
-
19
17
  ```sh
20
18
  pi install npm:@rol1n/pi-kit
21
19
  ```
22
20
 
23
- Or install any standalone extension individually:
24
-
25
- ```sh
26
- pi install npm:@rol1n/memory-log
27
- pi install npm:@rol1n/subagent
28
- pi install npm:@rol1n/multi-harness
29
- ```
21
+ The package includes **15 extension entrypoints, 7 prompt templates, and the worktree-studio skill**. Extensions and prompt commands load by default; skill instructions are read on demand. No separate extension packages are needed. See [Resource Selection](#resource-selection) to disable extensions or use an allowlist. Individual features may still require credentials, platform support, or activation (`/mem-log on` for background memory).
30
22
 
31
23
  Install from GitHub or a local checkout during development:
32
24
 
@@ -46,82 +38,165 @@ pi update --extensions
46
38
 
47
39
  ## Extensions
48
40
 
49
- Each top-level directory is a self-contained extension (`<name>/index.ts` + `README.md`). Detailed commands, parameters, and settings are documented in each extension's README:
50
-
51
- | Extension | Description | In `@rol1n/pi-kit` | Standalone Package |
52
- | :--- | :--- | :---: | :--- |
53
- | [ask-u-questions](ask-u-questions/README.md) | Interactive single-choice, multi-choice, and text dialogs | Yes | `@rol1n/ask-u-questions` |
54
- | [continue-signal](continue-signal/README.md) | Resume an idle agent via `/continue` or `Alt+C` | Yes | `@rol1n/continue-signal` |
55
- | [custom-providers](custom-providers/README.md) | Additional model providers and gateway registration | Yes | `@rol1n/custom-providers` |
56
- | [image-generate](image-generate/README.md) | Image generation tool and `/image-generate` model selector | Yes | `@rol1n/image-generate` |
57
- | [memory-log](memory-log/README.md) | Tiered asynchronous observational memory and instant compaction | Yes | `@rol1n/memory-log` |
58
- | [model-vision](model-vision/README.md) | Image understanding and OCR tool (`model_vision`) | No | `@rol1n/model-vision` |
59
- | [multi-harness](multi-harness/README.md) | Delegate tasks across `pi`, `codex`, `claude`, and `opencode` | Yes | `@rol1n/multi-harness` |
60
- | [oai-subquota](oai-subquota/README.md) | OpenAI Codex subscription quota monitor and statusline | Yes | `@rol1n/oai-subquota` |
61
- | [prompt-snipaste](prompt-snipaste/README.md) | Prompt snippet selector (`/snipaste`, `Alt+S`) with 7 built-in prompts | Yes | `@rol1n/prompt-snipaste` |
62
- | [screenshot](screenshot/README.md) | Insert the latest Windows/WSL screenshot path (`/screenshot`) | No | `@rol1n/screenshot` |
63
- | [srp-theme](srp-theme/README.md) | Last-prompt preview widget and real-time streaming TPS meter | Yes | `@rol1n/srp-theme` |
64
- | [subagent](subagent/README.md) | Delegate tasks to parallel Pi workers in tmux/Zellij or background processes | Yes | `@rol1n/subagent` |
65
- | [tui-asr](tui-asr/README.md) | Streaming voice dictation via Aliyun DashScope ASR (`/asr`, `Alt+M`) | Yes | `@rol1n/tui-asr` |
66
- | [web-reach](web-reach/README.md) | Keyless Exa MCP web search and multi-tier page extraction | No | `@rol1n/web-reach` |
67
- | [windows-wheel-fix](windows-wheel-fix/README.md) | Windows ConPTY / Zellij mouse-wheel reporting fix | Yes (Windows) | `@rol1n/windows-wheel-fix` |
68
-
69
- > Standalone packages with cross-extension dependencies (`tui-asr` / `image-generate` -> `@rol1n/custom-providers`, `multi-harness` -> `@rol1n/subagent`) declare standard npm `dependencies` and resolve them automatically on install.
41
+ Each top-level extension directory has an `index.ts` entrypoint and an English README covering its commands, parameters, and configuration. All entries below are declared in `package.json`:
42
+
43
+ | Extension | Description | Entry path for settings |
44
+ | :--- | :--- | :--- |
45
+ | [ask-u-questions](ask-u-questions/README.md) | Interactive single-choice, multi-choice, and text dialogs | `ask-u-questions/index.ts` |
46
+ | [continue-signal](continue-signal/README.md) | Resume an idle agent via `/continue` or `Alt+C` | `continue-signal/index.ts` |
47
+ | [custom-providers](custom-providers/README.md) | Additional model providers and gateway registration | `custom-providers/index.ts` |
48
+ | [image-generate](image-generate/README.md) | Image generation tool and `/image-generate` model selector | `image-generate/index.ts` |
49
+ | [memory-log](memory-log/README.md) | Tiered observational memory, source recall, and safe compaction | `memory-log/index.ts` |
50
+ | [model-vision](model-vision/README.md) | Image understanding and OCR (`model_vision`) | `model-vision/index.ts` |
51
+ | [multi-harness](multi-harness/README.md) | Delegate across `pi`, `codex`, `claude`, and `opencode` | `multi-harness/index.ts` |
52
+ | [oai-subquota](oai-subquota/README.md) | OpenAI Codex subscription quota monitor | `oai-subquota/index.ts` |
53
+ | [prompt-snipaste](prompt-snipaste/README.md) | Generic selector for enabled Pi prompts (`/snipaste`, `Alt+S`) | `prompt-snipaste/index.ts` |
54
+ | [screenshot](screenshot/README.md) | Insert the latest Windows/WSL screenshot path | `screenshot/index.ts` |
55
+ | [srp-theme](srp-theme/README.md) | Last-prompt preview and streaming TPS meter | `srp-theme/index.ts` |
56
+ | [subagent](subagent/README.md) | Parallel Pi workers in tmux/Zellij or background processes | `subagent/index.ts` |
57
+ | [tui-asr](tui-asr/README.md) | DashScope voice dictation (`/asr`, `Alt+M`) | `tui-asr/index.ts` |
58
+ | [web-reach](web-reach/README.md) | Keyless Exa MCP search and multi-tier page extraction | `web-reach/index.ts` |
59
+ | [windows-wheel-fix](windows-wheel-fix/README.md) | Windows ConPTY / Zellij wheel fix; no-op elsewhere | `windows-wheel-fix/index.ts` |
70
60
 
71
61
  ---
72
62
 
73
- ## Resource Selection
63
+ ## Skills
64
+
65
+ The root [`skills/`](skills/) directory is declared through `pi.skills` and distributed in the same npm package. Skills are instructions, not extension code: Pi advertises their metadata and reads the full document when needed.
66
+
67
+ | Skill | Purpose |
68
+ | :--- | :--- |
69
+ | [worktree-studio](skills/worktree-studio/SKILL.md) | Plan isolated Git-worktree alternatives, delegate implementation, collect real diffs and verification, and compare results without automatically integrating or deleting them |
70
+
71
+ Invoke it explicitly with `/skill:worktree-studio Compare the viable approaches for this change`. Git and a suitable delegation runtime are needed for experiments; `multi_harness` and `subagent` are available options. The skill requires confirmation before creating worktrees or launching paid workers. It never treats exploration approval as permission to merge, commit, or discard results.
74
72
 
75
- `@rol1n/pi-kit` exposes 12 extension entrypoints and the 7 prompt templates bundled in [prompt-snipaste/prompts](prompt-snipaste/prompts/). Use `pi config` or filter loaded resources in `settings.json`:
73
+ To load only this skill, without any kit extensions or prompt templates:
76
74
 
77
75
  ```json
78
76
  {
79
77
  "packages": [
80
78
  {
81
79
  "source": "npm:@rol1n/pi-kit",
82
- "extensions": ["**/*.ts", "!tui-asr/**"],
83
- "prompts": ["prompt-snipaste/prompts/diagnose-report.md"]
80
+ "extensions": [],
81
+ "prompts": [],
82
+ "skills": ["skills/worktree-studio/SKILL.md"]
84
83
  }
85
84
  ]
86
85
  }
87
86
  ```
88
87
 
88
+ Remove older local copies from configured skill locations to avoid duplicate skill names. Setting `"skills": []` on this package disables its skills independently of extensions and prompts.
89
+
89
90
  ---
90
91
 
91
- ## Development & Publishing
92
+ ## Prompt Templates
92
93
 
93
- [kit.config.json](kit.config.json) controls bundle selection (`bundle`), inter-extension dependencies (`deps`), and release versions. The top-level `version` belongs to `@rol1n/pi-kit`; each extension can set its own `version`, otherwise it inherits the top-level version. Set explicit extension versions to release the kit and standalone packages independently.
94
+ The root [`prompts/`](prompts/) directory is an independent, standard Pi resource, declared as `"pi": { "prompts": ["./prompts"] }` in `package.json`. It does not belong to or require the `prompt-snipaste` extension.
94
95
 
95
- ### Automated releases
96
+ Templates become normal Pi slash commands: [/ask-questions](prompts/ask-questions.md), [/delegate-exploration](prompts/delegate-exploration.md), [/diagnose-report](prompts/diagnose-report.md), [/frontend-tech-preset](prompts/frontend-tech-preset.md), [/orchestrator-mode](prompts/orchestrator-mode.md), [/session-kickoff](prompts/session-kickoff.md), and [/verify-not-assume](prompts/verify-not-assume.md). They remain available when `prompt-snipaste` is disabled, or even with `"extensions": []`.
96
97
 
97
- 1. Update the code and bump the relevant version(s) in `kit.config.json`.
98
- 2. Push to `main` with changes to `kit.config.json` or `package.json`, or manually run **Publish to npm** in GitHub Actions. Changes to the packaging script or workflow also trigger a release run.
99
- 3. CI runs the same pipeline for both triggers:
98
+ To use only the directory from a local checkout, reference it through the top-level `prompts` setting; no extension needs to be loaded:
100
99
 
101
- ```sh
102
- npm run manifest
103
- npm run check
104
- npm run publish:ci -- all
100
+ ```json
101
+ {
102
+ "prompts": ["/absolute/path/to/pi-kit/prompts"]
103
+ }
105
104
  ```
106
105
 
107
- The workflow in [`.github/workflows/publish.yml`](.github/workflows/publish.yml) generates `package.json`, validates the layout, then publishes all standalone extensions in dependency order, followed by the kit. Already-published versions are skipped; versions are never bumped automatically. `bundle: false` excludes an extension from the kit, not from standalone publishing. Publishing runs do not overlap, and a new run does not cancel an active release. Code-only pushes do not trigger publishing.
106
+ Existing filters using `prompt-snipaste/prompts/...` must be changed to `prompts/...` after updating.
107
+
108
+ Conversely, `prompt-snipaste` is a generic composer for **any enabled Pi prompt templates** from personal, trusted project, or package sources. It has no required template names or bundled fallback library.
108
109
 
109
- You do not need to run `manifest` or publish locally for an npm release. CI generates the manifest only in its checkout and does not commit it back. For local or Git installs, run `npm run manifest` and commit the generated `package.json` when changing bundle selection or versions so the repository manifest stays in sync.
110
+ ---
111
+
112
+ ## Resource Selection
110
113
 
111
- ### Local development and manual publishing
114
+ Edit `~/.pi/agent/settings.json` (personal) or `.pi/settings.json` (project). Replace the existing `"npm:@rol1n/pi-kit"` string inside `packages` with an object; keep your other packages. **`source` belongs inside `packages[]`, not at the top level.** Paths are relative to the installed package root, not the startup listing's `@rol1n/pi-kit:...` labels.
112
115
 
113
- ```sh
114
- # Sync the local manifest and validate all extensions
115
- npm run manifest
116
- npm run check
116
+ ### Disable selected extensions
117
117
 
118
- # Stage a standalone package into dist/<id>
119
- npm run prepare:extension -- memory-log
118
+ This loads everything except voice dictation, web search/extraction, and the Windows wheel fix. Omitting `prompts` and `skills` keeps all 7 templates and the bundled skill available:
120
119
 
121
- # Optional local release; also accepts extensions, kit, or a single extension ID
122
- npm run publish:ci -- all
120
+ ```json
121
+ {
122
+ "packages": [
123
+ {
124
+ "source": "npm:@rol1n/pi-kit",
125
+ "extensions": [
126
+ "!tui-asr/**",
127
+ "!web-reach/**",
128
+ "!windows-wheel-fix/**"
129
+ ]
130
+ }
131
+ ]
132
+ }
123
133
  ```
124
134
 
135
+ ### Load only selected extensions
136
+
137
+ This loads only memory and Pi subagents, with no bundled prompt commands or skills:
138
+
139
+ ```json
140
+ {
141
+ "packages": [
142
+ {
143
+ "source": "npm:@rol1n/pi-kit",
144
+ "extensions": ["memory-log/index.ts", "subagent/index.ts"],
145
+ "prompts": [],
146
+ "skills": []
147
+ }
148
+ ]
149
+ }
150
+ ```
151
+
152
+ ### Filter rules
153
+
154
+ | Setting | Effect |
155
+ | :--- | :--- |
156
+ | Property omitted | Load all resources of that type declared by the package |
157
+ | `"extensions": []` | Disable all extension entrypoints, without disabling prompts or skills |
158
+ | `"extensions": ["!tui-asr/**"]` | Load all entrypoints except matches |
159
+ | `"extensions": ["memory-log/index.ts"]` | Load only matching entrypoints |
160
+ | `"extensions": ["-tui-asr/index.ts"]` | Exclude one exact entry path |
161
+ | `"prompts": ["prompts/diagnose-report.md"]` | Load only that prompt template |
162
+ | `"prompts": []` | Disable all bundled prompt templates |
163
+ | `"skills": []` | Disable all bundled skills |
164
+ | `"skills": ["skills/worktree-studio/SKILL.md"]` | Load only that skill |
165
+
166
+ Run `/reload` or restart Pi after editing. Alternatively, run `pi config` in a terminal to toggle discovered resources interactively. Use an allowlist if newly added extensions should remain disabled after future kit updates.
167
+
168
+ ### Dependencies and overlapping tools
169
+
170
+ Filtering controls entrypoint loading, not installation or imports. `image-generate` and `tui-asr` initialize the shared `custom-providers` module themselves; exclude all three entries if you do not want those providers registered. `multi-harness` uses shared helpers from `subagent/mux.ts` without requiring the `subagent` tool entry to load. These files ship in the same package; there are no sibling npm packages to install.
171
+
172
+ Disable overlapping entries when another package already provides the same tool, especially `web-reach` (`web_search`, `web_fetch`) and `image-generate` (`image_generate`). Extensions and the root `prompts/` resource are independent. Disabling `prompt-snipaste/index.ts` leaves template commands available; filtering out all kit prompts leaves the selector free to use enabled prompts from other sources.
173
+
174
+ ### Migrating from standalone packages
175
+
176
+ This repository now releases only `@rol1n/pi-kit`. Previously published standalone versions remain on npm but receive no further releases from this workflow. Remove old standalone declarations before enabling the same extensions through the kit to avoid duplicate registration; use the filters above instead.
177
+
178
+ ---
179
+
180
+ ## Development & Publishing
181
+
182
+ [package.json](package.json) is the single source of package metadata, the release version, published files, and Pi resources. Edit it directly; no manifest generation or standalone staging is needed. When adding an extension, list its directory in `files` and its entrypoint in `pi.extensions` so it is included by default. Add skills as `skills/<name>/SKILL.md` and prompt templates as `prompts/<name>.md`; the declared root resource directories already cover them.
183
+
184
+ ```sh
185
+ npm run check # Validate the manifest and extension coverage
186
+ npm test # Run offline memory-log and prompt selector tests
187
+ npm pack --dry-run --ignore-scripts # Inspect the npm package contents
188
+ ```
189
+
190
+ ### Releases
191
+
192
+ 1. Make your changes and bump `version` directly in `package.json`.
193
+ 2. Push to `main`, or manually run **Publish to npm** in GitHub Actions.
194
+ 3. [The workflow](.github/workflows/publish.yml) validates the package, runs tests, and publishes **only the root `@rol1n/pi-kit` package** with npm provenance. Existing versions are skipped; registry/network errors fail the job rather than being treated as an unpublished version.
195
+
196
+ Automatic runs watch `package.json`, the validation script, and the workflow itself. Code-only pushes do not publish; bump the version when ready to release. Runs are serialized without cancelling an active publish. CI uses the configured npm Trusted Publisher, or `NPM_TOKEN` if provided, and never rewrites the manifest or bumps versions.
197
+
198
+ For an authorized local release, use the normal npm command: `npm publish --access public`.
199
+
125
200
  ---
126
201
 
127
202
  ## Acknowledgements
package/README_zh.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-kit
2
2
 
3
- > 面向 [Pi Coding Agent](https://pi.dev) 的模块化扩展与提示词模板套件,支持作为 **`@rol1n/pi-kit`** 聚合包或 **`@rol1n/<extension>`** 独立包安装。
3
+ > 面向 [Pi Coding Agent](https://pi.dev) 的模块化扩展、提示词模板与技能套件。只安装 **`@rol1n/pi-kit`** 一个包,通过 Pi 配置选择加载哪些功能。
4
4
 
5
5
  <p align="left">
6
6
  <a href="README.md"><b>English</b></a> •
@@ -14,19 +14,11 @@
14
14
 
15
15
  ## 安装
16
16
 
17
- 安装默认聚合包:
18
-
19
17
  ```sh
20
18
  pi install npm:@rol1n/pi-kit
21
19
  ```
22
20
 
23
- 或按需安装任意独立扩展包:
24
-
25
- ```sh
26
- pi install npm:@rol1n/memory-log
27
- pi install npm:@rol1n/subagent
28
- pi install npm:@rol1n/multi-harness
29
- ```
21
+ 包含 **15 个扩展入口、7 个提示词模板及 worktree-studio 技能**。扩展与提示词命令默认加载,技能正文按需读取;无需安装独立扩展包。通过[资源按需筛选](#资源按需筛选)禁用不需要的扩展,或仅启用指定功能。具体功能仍可能需要认证、平台支持或单独激活(例如 `/mem-log on` 开启后台记忆)。
30
22
 
31
23
  开发期间也可直接从 GitHub 或本地目录安装:
32
24
 
@@ -46,82 +38,165 @@ pi update --extensions
46
38
 
47
39
  ## 扩展列表
48
40
 
49
- 仓库根目录下每个文件夹均为自包含扩展(`<name>/index.ts` + `README.md`)。各扩展的详细命令、参数与配置说明请参阅对应目录的 README:
50
-
51
- | 扩展目录 | 功能简介 | 默认纳入 `pi-kit` | 独立 npm 包名 |
52
- | :--- | :--- | :---: | :--- |
53
- | [ask-u-questions](ask-u-questions/README.md) | 交互式单选、多选与自由文本提问弹窗(共享 UI 锁) | Yes | `@rol1n/ask-u-questions` |
54
- | [continue-signal](continue-signal/README.md) | 通过 `/continue` 或 `Alt+C` 唤醒空闲智能体继续未完成任务 | Yes | `@rol1n/continue-signal` |
55
- | [custom-providers](custom-providers/README.md) | 自定义模型服务商与网关(Magpie、智谱、阿里百炼等)注册 | Yes | `@rol1n/custom-providers` |
56
- | [image-generate](image-generate/README.md) | OpenRouter / 百炼文生图与参考图生图工具及 `/image-generate` 模型选择器 | Yes | `@rol1n/image-generate` |
57
- | [memory-log](memory-log/README.md) | 分层异步观察记忆系统与零模型阻塞的确定性秒级压缩 | Yes | `@rol1n/memory-log` |
58
- | [model-vision](model-vision/README.md) | 本地与远程图片视觉理解、OCR 与 UI 诊断工具(`model_vision`) | No | `@rol1n/model-vision` |
59
- | [multi-harness](multi-harness/README.md) | 跨 `pi`、`codex`、`claude`、`opencode` 的多 CLI 协同委派运行时 | Yes | `@rol1n/multi-harness` |
60
- | [oai-subquota](oai-subquota/README.md) | OpenAI Codex 订阅额度(5h / 7d 窗口与重置时间)状态栏监控 | Yes | `@rol1n/oai-subquota` |
61
- | [prompt-snipaste](prompt-snipaste/README.md) | 提示词片段选择器(`/snipaste`、`Alt+S`),内置 7 个常用提示词模板 | Yes | `@rol1n/prompt-snipaste` |
62
- | [screenshot](screenshot/README.md) | 一键将最新 Windows / WSL 系统截图路径插入编辑器(`/screenshot`) | No | `@rol1n/screenshot` |
63
- | [srp-theme](srp-theme/README.md) | 编辑器下方最近提问预览组件与实时流式 TPS 速率仪表 | Yes | `@rol1n/srp-theme` |
64
- | [subagent](subagent/README.md) | 基于 tmux / Zellij 分屏或后台进程的并发 Pi 子智能体工具 | Yes | `@rol1n/subagent` |
65
- | [tui-asr](tui-asr/README.md) | 基于阿里百炼 Paraformer 的终端实时流式语音听写(`/asr`、`Alt+M`) | Yes | `@rol1n/tui-asr` |
66
- | [web-reach](web-reach/README.md) | 免 Key Exa MCP 网页搜索与多级网页正文提取(RSC / HTML / PDF / Jina) | No | `@rol1n/web-reach` |
67
- | [windows-wheel-fix](windows-wheel-fix/README.md) | 修复 Windows ConPTY / Zellij 下鼠标滚轮被误转为上下方向键的问题 | Yes (仅 Windows) | `@rol1n/windows-wheel-fix` |
68
-
69
- > 带有跨扩展依赖的独立包(`tui-asr` / `image-generate` 依赖 `@rol1n/custom-providers`,`multi-harness` 依赖 `@rol1n/subagent`)已声明标准 npm `dependencies`,单独安装时会自动拉取补全并激活所需依赖。
41
+ 每个扩展目录都有 `index.ts` 入口和英文 README,介绍对应命令、参数与配置。以下入口全部直接声明在 `package.json` 中:
42
+
43
+ | 扩展 | 功能简介 | 配置中使用的入口路径 |
44
+ | :--- | :--- | :--- |
45
+ | [ask-u-questions](ask-u-questions/README.md) | 交互式单选、多选与自由文本提问 | `ask-u-questions/index.ts` |
46
+ | [continue-signal](continue-signal/README.md) | 通过 `/continue` 或 `Alt+C` 继续未完成任务 | `continue-signal/index.ts` |
47
+ | [custom-providers](custom-providers/README.md) | 注册自定义模型服务商与网关 | `custom-providers/index.ts` |
48
+ | [image-generate](image-generate/README.md) | 图片生成工具与 `/image-generate` 模型选择器 | `image-generate/index.ts` |
49
+ | [memory-log](memory-log/README.md) | 分层观察记忆、原始对话溯源与安全压缩 | `memory-log/index.ts` |
50
+ | [model-vision](model-vision/README.md) | 图片理解与 OCR(`model_vision`) | `model-vision/index.ts` |
51
+ | [multi-harness](multi-harness/README.md) | 跨 `pi`、`codex`、`claude`、`opencode` 委派任务 | `multi-harness/index.ts` |
52
+ | [oai-subquota](oai-subquota/README.md) | OpenAI Codex 订阅额度监控 | `oai-subquota/index.ts` |
53
+ | [prompt-snipaste](prompt-snipaste/README.md) | 面向已启用 Pi 提示词的通用选择器(`/snipaste`、`Alt+S`) | `prompt-snipaste/index.ts` |
54
+ | [screenshot](screenshot/README.md) | 插入最新 Windows / WSL 截图路径 | `screenshot/index.ts` |
55
+ | [srp-theme](srp-theme/README.md) | 最近提问预览与实时流式 TPS 仪表 | `srp-theme/index.ts` |
56
+ | [subagent](subagent/README.md) | tmux / Zellij 分屏或后台进程中的并发 Pi 子智能体 | `subagent/index.ts` |
57
+ | [tui-asr](tui-asr/README.md) | 百炼语音听写(`/asr`、`Alt+M`) | `tui-asr/index.ts` |
58
+ | [web-reach](web-reach/README.md) | 免 Key Exa MCP 搜索与多级网页正文提取 | `web-reach/index.ts` |
59
+ | [windows-wheel-fix](windows-wheel-fix/README.md) | Windows ConPTY / Zellij 滚轮修复,其他平台无操作 | `windows-wheel-fix/index.ts` |
70
60
 
71
61
  ---
72
62
 
73
- ## 资源按需筛选
63
+ ## 技能
64
+
65
+ 根目录 [`skills/`](skills/) 通过 `pi.skills` 声明,随同一个 npm 包分发。技能是工作流指导,不是扩展代码:Pi 先展示其名称与描述,需要时再读取完整内容。
66
+
67
+ | 技能 | 用途 |
68
+ | :--- | :--- |
69
+ | [worktree-studio](skills/worktree-studio/SKILL.md) | 规划隔离的 Git worktree 方案实验,委派实现,收集真实 diff 与验证结果,再比较取舍,不自动集成或删除成果 |
70
+
71
+ 可显式使用 `/skill:worktree-studio 比较这次修改的可行实现方案`。实验需要 Git 和可用的委派运行时,`multi_harness`、`subagent` 都可以使用。创建 worktree 或启动付费 worker 前会要求确认;同意探索不等于授权合并、提交或删除结果。
74
72
 
75
- `@rol1n/pi-kit` 默认导出 12 个扩展入口与 [prompt-snipaste/prompts](prompt-snipaste/prompts/) 下的 7 个提示词模板。可通过 `pi config` 或在 `settings.json` 中按需过滤:
73
+ 只使用该技能,不加载 kit 的扩展和提示词:
76
74
 
77
75
  ```json
78
76
  {
79
77
  "packages": [
80
78
  {
81
79
  "source": "npm:@rol1n/pi-kit",
82
- "extensions": ["**/*.ts", "!tui-asr/**"],
83
- "prompts": ["prompt-snipaste/prompts/diagnose-report.md"]
80
+ "extensions": [],
81
+ "prompts": [],
82
+ "skills": ["skills/worktree-studio/SKILL.md"]
84
83
  }
85
84
  ]
86
85
  }
87
86
  ```
88
87
 
88
+ 请移除其他已配置技能目录里的旧副本,避免同名冲突。在包配置中设置 `"skills": []` 可单独禁用技能,不影响扩展和提示词。
89
+
89
90
  ---
90
91
 
91
- ## 构建与发布
92
+ ## 独立提示词目录
92
93
 
93
- [kit.config.json](kit.config.json) 统一管理聚合包选择(`bundle`)、扩展间的依赖关系(`deps`)与发布版本。顶层 `version` 属于 `@rol1n/pi-kit`;各扩展可以单独设置 `version`,未设置时继承顶层版本。为每个扩展显式设置版本即可让聚合包与独立包分别升级。
94
+ 根目录 [`prompts/`](prompts/) 是独立、标准的 Pi 资源,在 `package.json` 中通过 `"pi": { "prompts": ["./prompts"] }` 声明,不属于、也不依赖 `prompt-snipaste` 扩展。
94
95
 
95
- ### 自动发布
96
+ 模板会成为普通 Pi 斜杠命令:[/ask-questions](prompts/ask-questions.md)、[/delegate-exploration](prompts/delegate-exploration.md)、[/diagnose-report](prompts/diagnose-report.md)、[/frontend-tech-preset](prompts/frontend-tech-preset.md)、[/orchestrator-mode](prompts/orchestrator-mode.md)、[/session-kickoff](prompts/session-kickoff.md)、[/verify-not-assume](prompts/verify-not-assume.md)。即使禁用 `prompt-snipaste`,或配置 `"extensions": []`,这些模板仍可单独使用。
96
97
 
97
- 1. 修改代码,并在 `kit.config.json` 中提升需要发布的包的版本。
98
- 2. 将包含 `kit.config.json` 或 `package.json` 变更的提交推送到 `main`,或在 GitHub Actions 手动运行 **Publish to npm**。修改打包脚本或工作流本身也会触发发布流程。
99
- 3. 自动和手动触发均执行同一条流水线:
98
+ 如需只部署本地检出目录中的模板,可通过顶层 `prompts` 引用,无需加载任何扩展:
100
99
 
101
- ```sh
102
- npm run manifest
103
- npm run check
104
- npm run publish:ci -- all
100
+ ```json
101
+ {
102
+ "prompts": ["/absolute/path/to/pi-kit/prompts"]
103
+ }
105
104
  ```
106
105
 
107
- [`.github/workflows/publish.yml`](.github/workflows/publish.yml) 会生成 `package.json`、校验扩展布局,再按依赖顺序发布所有独立扩展,最后发布聚合包。已存在的版本自动跳过,不会自动提升版本号。`bundle: false` 只表示不纳入聚合包,不影响独立发布。发布流程不会并行执行,新触发的流程也不会取消正在进行的发布。仅修改扩展代码不会触发发布。
106
+ 升级后,已有筛选配置中的 `prompt-snipaste/prompts/...` 路径需要改为 `prompts/...`。
107
+
108
+ 反过来,`prompt-snipaste` 是面向**任意已启用 Pi 提示词**的通用组合框架,可读取全局、已信任项目或其他包提供的模板,不依赖固定文件名,也没有内置模板兜底。
108
109
 
109
- 发布 npm 包无需本地运行 `manifest` 或 `publish`。CI 只在运行目录中生成清单,不会自动提交回仓库。若使用本地或 Git 安装,调整聚合包选择或版本后仍应运行 `npm run manifest` 并提交生成的 `package.json`,保持仓库清单同步。
110
+ ---
111
+
112
+ ## 资源按需筛选
110
113
 
111
- ### 本地开发与手动发布
114
+ 编辑全局 `~/.pi/agent/settings.json` 或项目 `.pi/settings.json`,将 `packages` 数组中原有的 `"npm:@rol1n/pi-kit"` 字符串替换为对象,保留其他包。**`source` 是 `packages[]` 内的字段,不是顶层字段。** 筛选路径相对于安装包根目录,不是启动列表里的 `@rol1n/pi-kit:...` 展示名称。
112
115
 
113
- ```sh
114
- # 同步本地清单并校验所有扩展
115
- npm run manifest
116
- npm run check
116
+ ### 黑名单:禁用部分扩展
117
117
 
118
- # 将单个扩展构建到 dist/<id>
119
- npm run prepare:extension -- memory-log
118
+ 以下配置加载除语音听写、网页搜索与 Windows 滚轮修复之外的所有扩展。不写 `prompts` 和 `skills`,仍然提供全部 7 个模板及内置技能:
120
119
 
121
- # 可选的本地发布,也支持 extensions、kit 或单个扩展 ID
122
- npm run publish:ci -- all
120
+ ```json
121
+ {
122
+ "packages": [
123
+ {
124
+ "source": "npm:@rol1n/pi-kit",
125
+ "extensions": [
126
+ "!tui-asr/**",
127
+ "!web-reach/**",
128
+ "!windows-wheel-fix/**"
129
+ ]
130
+ }
131
+ ]
132
+ }
123
133
  ```
124
134
 
135
+ ### 白名单:只加载指定扩展
136
+
137
+ 以下配置只启用记忆与 Pi 子智能体,不加载内置提示词命令或技能:
138
+
139
+ ```json
140
+ {
141
+ "packages": [
142
+ {
143
+ "source": "npm:@rol1n/pi-kit",
144
+ "extensions": ["memory-log/index.ts", "subagent/index.ts"],
145
+ "prompts": [],
146
+ "skills": []
147
+ }
148
+ ]
149
+ }
150
+ ```
151
+
152
+ ### 筛选规则
153
+
154
+ | 写法 | 效果 |
155
+ | :--- | :--- |
156
+ | 省略某个资源字段 | 加载包中声明的全部该类资源 |
157
+ | `"extensions": []` | 禁用全部扩展入口,不影响提示词和技能 |
158
+ | `"extensions": ["!tui-asr/**"]` | 加载除匹配项之外的全部扩展 |
159
+ | `"extensions": ["memory-log/index.ts"]` | 只加载匹配入口 |
160
+ | `"extensions": ["-tui-asr/index.ts"]` | 按精确路径排除一个入口 |
161
+ | `"prompts": ["prompts/diagnose-report.md"]` | 只加载该提示词模板 |
162
+ | `"prompts": []` | 禁用全部内置提示词模板 |
163
+ | `"skills": []` | 禁用全部内置技能 |
164
+ | `"skills": ["skills/worktree-studio/SKILL.md"]` | 只加载该技能 |
165
+
166
+ 修改后执行 `/reload` 或重启 Pi。也可以在终端运行 `pi config`,交互勾选并保存配置。如果不希望未来升级时自动启用新增扩展,请使用白名单。
167
+
168
+ ### 依赖与工具重名
169
+
170
+ 筛选控制入口加载,不会卸载文件或阻止其他入口导入模块。`image-generate` 和 `tui-asr` 会主动初始化共用的 `custom-providers`;若不希望注册这些服务商,需要同时排除三个入口。`multi-harness` 复用 `subagent/mux.ts`,不要求启用 `subagent` 工具入口。这些依赖均包含在同一个包内,无需再安装其他独立扩展包。
171
+
172
+ 如果其他包已经提供同名工具,请禁用重叠入口,尤其是 `web-reach`(`web_search`、`web_fetch`)和 `image-generate`(`image_generate`)。扩展与根目录 `prompts/` 资源彼此独立:禁用 `prompt-snipaste/index.ts` 后仍可使用模板命令;禁用全部 kit 提示词后,选择器仍可使用其他来源中已启用的提示词。
173
+
174
+ ### 从独立包迁移
175
+
176
+ 本仓库此后只发布 `@rol1n/pi-kit`。已发布的独立版本仍保留在 npm,但本工作流不再发布其新版本。请先移除旧独立包的配置,再通过聚合包启用相同扩展,避免重复注册;按需加载改用上述筛选配置。
177
+
178
+ ---
179
+
180
+ ## 构建与发布
181
+
182
+ [package.json](package.json) 是包元数据、版本、发布文件及 Pi 资源的唯一配置来源,直接编辑即可,无需生成清单或构建独立包。新增扩展时,将目录加入 `files`、入口加入 `pi.extensions`,默认随包加载。技能放在 `skills/<name>/SKILL.md`,提示词放在 `prompts/<name>.md`,已声明的资源根目录会自动覆盖新增文件。
183
+
184
+ ```sh
185
+ npm run check # 校验清单与扩展覆盖范围
186
+ npm test # 运行离线 memory-log 与提示词选择器测试
187
+ npm pack --dry-run --ignore-scripts # 检查 npm 包内容
188
+ ```
189
+
190
+ ### 发布
191
+
192
+ 1. 修改代码,直接提升 `package.json` 中的 `version`。
193
+ 2. 推送到 `main`,或在 GitHub Actions 手动运行 **Publish to npm**。
194
+ 3. [工作流](.github/workflows/publish.yml) 校验清单、运行测试,随后**仅发布根目录的 `@rol1n/pi-kit`**,附带 npm provenance。已发布版本自动跳过;查询遇到网络或注册表错误会使任务失败,不会误判为尚未发布。
195
+
196
+ 自动触发范围是 `package.json`、校验脚本和工作流本身。仅修改扩展代码不会发布,准备发布时请提升版本。任务串行执行,不取消进行中的发布。CI 使用已配置的 npm Trusted Publisher,或提供的 `NPM_TOKEN`;不会重写清单或自动升级版本。
197
+
198
+ 如需经授权后在本地发布,直接使用标准命令:`npm publish --access public`。
199
+
125
200
  ---
126
201
 
127
202
  ## 致谢
@@ -5,10 +5,10 @@ Interactive single-choice, multiple-choice, and free-text questions for Pi. Regi
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- pi install npm:@rol1n/ask-u-questions
8
+ pi install npm:@rol1n/pi-kit
9
9
  ```
10
10
 
11
- Also included in `@rol1n/pi-kit`.
11
+ Included and loaded by default in `@rol1n/pi-kit`. See [resource selection](../README.md#resource-selection) to disable this entry or load only selected extensions.
12
12
 
13
13
  ## Use
14
14
 
@@ -5,10 +5,10 @@ Resume an idle Pi agent with a visible continuation signal.
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- pi install npm:@rol1n/continue-signal
8
+ pi install npm:@rol1n/pi-kit
9
9
  ```
10
10
 
11
- Also included in `@rol1n/pi-kit`.
11
+ Included and loaded by default in `@rol1n/pi-kit`. See [resource selection](../README.md#resource-selection) to disable this entry or load only selected extensions.
12
12
 
13
13
  ## Commands and shortcuts
14
14
 
@@ -5,10 +5,10 @@ Registers additional model providers through Pi's native model registry and `/lo
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- pi install npm:@rol1n/custom-providers
8
+ pi install npm:@rol1n/pi-kit
9
9
  ```
10
10
 
11
- Also included in `@rol1n/pi-kit`.
11
+ Included and loaded by default in `@rol1n/pi-kit`. See [resource selection](../README.md#resource-selection) to disable this entry or load only selected extensions.
12
12
 
13
13
  ## Providers
14
14
 
@@ -5,10 +5,12 @@ Generate images through OpenRouter or DashScope and save them to `.pi/generated-
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- pi install npm:@rol1n/image-generate
8
+ pi install npm:@rol1n/pi-kit
9
9
  ```
10
10
 
11
- Also included in `@rol1n/pi-kit`. Installing this package automatically installs `@rol1n/custom-providers`.
11
+ Included and loaded by default in `@rol1n/pi-kit`. See [resource selection](../README.md#resource-selection) to disable this entry or load only selected extensions.
12
+
13
+ Uses `custom-providers` from the same kit; required provider registration is initialized automatically.
12
14
 
13
15
  ## Use
14
16
 
@@ -7,10 +7,10 @@
7
7
  ## Install
8
8
 
9
9
  ```sh
10
- pi install npm:@rol1n/memory-log
10
+ pi install npm:@rol1n/pi-kit
11
11
  ```
12
12
 
13
- Also included in `@rol1n/pi-kit`. The extension loads with new-session memory disabled by default (`/mem-log on` to enable for the current session, or `"defaultEnabled": true` in settings).
13
+ Included and loaded by default in `@rol1n/pi-kit`. See [resource selection](../README.md#resource-selection) to disable this entry or load only selected extensions. The extension loads with new-session memory disabled by default (`/mem-log on` to enable for the current session, or `"defaultEnabled": true` in settings).
14
14
 
15
15
  ---
16
16
 
@@ -5,10 +5,10 @@ Analyze a local image or public HTTP(S) image URL with a vision model. Registers
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- pi install npm:@rol1n/model-vision
8
+ pi install npm:@rol1n/pi-kit
9
9
  ```
10
10
 
11
- Available as a standalone package (not enabled in `@rol1n/pi-kit` by default).
11
+ Included and loaded by default in `@rol1n/pi-kit`. See [resource selection](../README.md#resource-selection) to disable this entry or load only selected extensions.
12
12
 
13
13
  ## Use
14
14