@rol1n/pi-kit 0.1.1 → 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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +176 -39
  3. package/README_zh.md +211 -0
  4. package/ask-u-questions/README.md +2 -2
  5. package/continue-signal/README.md +2 -2
  6. package/custom-providers/README.md +2 -2
  7. package/image-generate/README.md +4 -2
  8. package/memory-log/README.md +81 -14
  9. package/memory-log/config.ts +1 -1
  10. package/memory-log/hooks/compaction-hook.ts +58 -15
  11. package/memory-log/hooks/compaction-trigger.ts +24 -97
  12. package/memory-log/hooks/observer-trigger.ts +2 -1
  13. package/memory-log/index.ts +4 -0
  14. package/memory-log/ledger/index.ts +1 -0
  15. package/memory-log/ledger/recall.ts +111 -0
  16. package/memory-log/ledger/render.ts +3 -1
  17. package/memory-log/ledger/serialize.ts +2 -4
  18. package/memory-log/ledger/types.ts +4 -1
  19. package/memory-log/runtime.ts +0 -5
  20. package/memory-log/tools/recall.ts +60 -0
  21. package/model-vision/README.md +2 -2
  22. package/model-vision/image.ts +84 -0
  23. package/model-vision/index.ts +124 -0
  24. package/model-vision/network.ts +82 -0
  25. package/model-vision/requests.ts +151 -0
  26. package/multi-harness/README.md +4 -4
  27. package/oai-subquota/README.md +2 -2
  28. package/package.json +19 -24
  29. package/prompt-snipaste/README.md +19 -5
  30. package/prompt-snipaste/index.ts +4 -4
  31. package/prompt-snipaste/snippets.ts +28 -149
  32. package/prompt-snipaste/types.ts +1 -0
  33. package/screenshot/README.md +2 -2
  34. package/screenshot/index.ts +126 -0
  35. package/scripts/check-package.mjs +54 -0
  36. package/skills/worktree-studio/SKILL.md +99 -0
  37. package/srp-theme/README.md +2 -2
  38. package/subagent/README.md +4 -4
  39. package/tui-asr/README.md +4 -2
  40. package/web-reach/README.md +2 -2
  41. package/windows-wheel-fix/README.md +2 -2
  42. /package/{prompt-snipaste/prompts → prompts}/ask-questions.md +0 -0
  43. /package/{prompt-snipaste/prompts → prompts}/delegate-exploration.md +0 -0
  44. /package/{prompt-snipaste/prompts → prompts}/diagnose-report.md +0 -0
  45. /package/{prompt-snipaste/prompts → prompts}/frontend-tech-preset.md +0 -0
  46. /package/{prompt-snipaste/prompts → prompts}/orchestrator-mode.md +0 -0
  47. /package/{prompt-snipaste/prompts → prompts}/session-kickoff.md +0 -0
  48. /package/{prompt-snipaste/prompts → prompts}/verify-not-assume.md +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RoL1n_SrP
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # pi-kit
2
2
 
3
- Pi extensions and prompt templates distributed together as **`@rol1n/pi-kit`** and individually as **`@rol1n/<extension>`**. Each extension directory contains its own `index.ts` and `README.md`.
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
+
5
+ <p align="left">
6
+ <b>English</b> •
7
+ <a href="README_zh.md"><b>中文说明</b></a>
8
+ </p>
9
+
10
+ [![npm version](https://img.shields.io/npm/v/@rol1n/pi-kit?style=flat-square&logo=npm)](https://www.npmjs.com/package/@rol1n/pi-kit)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
12
+
13
+ ---
4
14
 
5
15
  ## Install
6
16
 
@@ -8,67 +18,194 @@ Pi extensions and prompt templates distributed together as **`@rol1n/pi-kit`** a
8
18
  pi install npm:@rol1n/pi-kit
9
19
  ```
10
20
 
11
- Install from GitHub or a local checkout:
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).
22
+
23
+ Install from GitHub or a local checkout during development:
12
24
 
13
25
  ```sh
14
26
  pi install https://github.com/RolinShmily/pi-kit
15
27
  pi install /absolute/path/to/pi-kit
16
28
  ```
17
29
 
18
- Update with `pi update npm:@rol1n/pi-kit` or `pi update --extensions`.
30
+ Update installed packages:
31
+
32
+ ```sh
33
+ pi update npm:@rol1n/pi-kit
34
+ pi update --extensions
35
+ ```
36
+
37
+ ---
19
38
 
20
39
  ## Extensions
21
40
 
22
- | Extension | Purpose | Default in kit | Standalone npm |
23
- |---|---|---|---|
24
- | [ask-u-questions](ask-u-questions/README.md) | Interactive single/multi-choice and text dialogs | Yes | `@rol1n/ask-u-questions` |
25
- | [continue-signal](continue-signal/README.md) | Resume an idle agent via `/continue` or Alt+C | Yes | `@rol1n/continue-signal` |
26
- | [custom-providers](custom-providers/README.md) | Additional model providers and gateway registration | Yes | `@rol1n/custom-providers` |
27
- | [image-generate](image-generate/README.md) | Image generation tool and `/image-generate` selector | Yes | `@rol1n/image-generate` |
28
- | [memory-log](memory-log/README.md) | Background observational memory and compaction | Yes | `@rol1n/memory-log` |
29
- | [model-vision](model-vision/README.md) | Image understanding and OCR tool | No | `@rol1n/model-vision` |
30
- | [multi-harness](multi-harness/README.md) | Delegate to Pi, Codex, Claude, and OpenCode | Yes | `@rol1n/multi-harness` |
31
- | [oai-subquota](oai-subquota/README.md) | OpenAI Codex subscription quota monitor | Yes | `@rol1n/oai-subquota` |
32
- | [prompt-snipaste](prompt-snipaste/README.md) | Select prompt snippets for the next user message (bundles 7 built-in prompts) | Yes | `@rol1n/prompt-snipaste` |
33
- | [screenshot](screenshot/README.md) | Insert the latest Windows/WSL screenshot path | No | `@rol1n/screenshot` |
34
- | [srp-theme](srp-theme/README.md) | Prompt preview footer and streaming TPS meter | Yes | `@rol1n/srp-theme` |
35
- | [subagent](subagent/README.md) | Delegate to asynchronous Pi workers | Yes | `@rol1n/subagent` |
36
- | [tui-asr](tui-asr/README.md) | Streaming voice dictation via DashScope ASR | Yes | `@rol1n/tui-asr` |
37
- | [web-reach](web-reach/README.md) | Keyless Exa web search and multi-tier page extraction | Yes | `@rol1n/web-reach` |
38
- | [windows-wheel-fix](windows-wheel-fix/README.md) | Windows ConPTY/Zellij mouse-wheel reporting fix | Yes (Windows only) | `@rol1n/windows-wheel-fix` |
39
-
40
- ## Resource selection
41
-
42
- The kit exposes 13 extension entrypoints and the 7 prompt templates bundled in [prompt-snipaste/prompts](prompt-snipaste/prompts/). Narrow loaded resources with `pi config` or in `settings.json`:
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` |
60
+
61
+ ---
62
+
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.
72
+
73
+ To load only this skill, without any kit extensions or prompt templates:
43
74
 
44
75
  ```json
45
76
  {
46
77
  "packages": [
47
78
  {
48
79
  "source": "npm:@rol1n/pi-kit",
49
- "extensions": ["**/*.ts", "!tui-asr/**"],
50
- "prompts": ["prompt-snipaste/prompts/diagnose-report.md"]
80
+ "extensions": [],
81
+ "prompts": [],
82
+ "skills": ["skills/worktree-studio/SKILL.md"]
51
83
  }
52
84
  ]
53
85
  }
54
86
  ```
55
87
 
56
- ## Build and publish
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.
57
89
 
58
- [kit.config.json](kit.config.json) controls which extensions are bundled into `@rol1n/pi-kit` (`bundle: true`) and inter-extension npm dependencies (`deps`).
90
+ ---
59
91
 
60
- ```sh
61
- # Sync package.json from kit.config.json and validate
62
- npm run manifest
63
- npm run check
92
+ ## Prompt Templates
93
+
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.
64
95
 
65
- # Stage any extension into dist/<id>
66
- npm run prepare:extension -- subagent
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": []`.
67
97
 
68
- # Publish all standalone extensions, or the kit, or one extension
69
- npm run publish:ci -- extensions
70
- npm run publish:ci -- kit
71
- npm run publish:ci -- tui-asr
98
+ To use only the directory from a local checkout, reference it through the top-level `prompts` setting; no extension needs to be loaded:
99
+
100
+ ```json
101
+ {
102
+ "prompts": ["/absolute/path/to/pi-kit/prompts"]
103
+ }
72
104
  ```
73
105
 
74
- GitHub Actions OIDC Trusted Publishing is configured in [`.github/workflows/publish.yml`](.github/workflows/publish.yml).
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.
109
+
110
+ ---
111
+
112
+ ## Resource Selection
113
+
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.
115
+
116
+ ### Disable selected extensions
117
+
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:
119
+
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
+ }
133
+ ```
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
+
200
+ ---
201
+
202
+ ## Acknowledgements
203
+
204
+ - [elpapi42/pi-observational-memory](https://github.com/elpapi42/pi-observational-memory) — Observational memory architecture and inspiration for [`memory-log`](memory-log/README.md).
205
+ - [earendil-works/pi](https://github.com/earendil-works/pi) — The Pi coding agent harness and SDK.
206
+
207
+ ---
208
+
209
+ ## License
210
+
211
+ [MIT](LICENSE) © RoL1n_SrP
package/README_zh.md ADDED
@@ -0,0 +1,211 @@
1
+ # pi-kit
2
+
3
+ > 面向 [Pi Coding Agent](https://pi.dev) 的模块化扩展、提示词模板与技能套件。只安装 **`@rol1n/pi-kit`** 一个包,通过 Pi 配置选择加载哪些功能。
4
+
5
+ <p align="left">
6
+ <a href="README.md"><b>English</b></a> •
7
+ <b>中文说明</b>
8
+ </p>
9
+
10
+ [![npm version](https://img.shields.io/npm/v/@rol1n/pi-kit?style=flat-square&logo=npm)](https://www.npmjs.com/package/@rol1n/pi-kit)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
12
+
13
+ ---
14
+
15
+ ## 安装
16
+
17
+ ```sh
18
+ pi install npm:@rol1n/pi-kit
19
+ ```
20
+
21
+ 包含 **15 个扩展入口、7 个提示词模板及 worktree-studio 技能**。扩展与提示词命令默认加载,技能正文按需读取;无需安装独立扩展包。通过[资源按需筛选](#资源按需筛选)禁用不需要的扩展,或仅启用指定功能。具体功能仍可能需要认证、平台支持或单独激活(例如 `/mem-log on` 开启后台记忆)。
22
+
23
+ 开发期间也可直接从 GitHub 或本地目录安装:
24
+
25
+ ```sh
26
+ pi install https://github.com/RolinShmily/pi-kit
27
+ pi install /absolute/path/to/pi-kit
28
+ ```
29
+
30
+ 更新已安装的包:
31
+
32
+ ```sh
33
+ pi update npm:@rol1n/pi-kit
34
+ pi update --extensions
35
+ ```
36
+
37
+ ---
38
+
39
+ ## 扩展列表
40
+
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` |
60
+
61
+ ---
62
+
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 前会要求确认;同意探索不等于授权合并、提交或删除结果。
72
+
73
+ 只使用该技能,不加载 kit 的扩展和提示词:
74
+
75
+ ```json
76
+ {
77
+ "packages": [
78
+ {
79
+ "source": "npm:@rol1n/pi-kit",
80
+ "extensions": [],
81
+ "prompts": [],
82
+ "skills": ["skills/worktree-studio/SKILL.md"]
83
+ }
84
+ ]
85
+ }
86
+ ```
87
+
88
+ 请移除其他已配置技能目录里的旧副本,避免同名冲突。在包配置中设置 `"skills": []` 可单独禁用技能,不影响扩展和提示词。
89
+
90
+ ---
91
+
92
+ ## 独立提示词目录
93
+
94
+ 根目录 [`prompts/`](prompts/) 是独立、标准的 Pi 资源,在 `package.json` 中通过 `"pi": { "prompts": ["./prompts"] }` 声明,不属于、也不依赖 `prompt-snipaste` 扩展。
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": []`,这些模板仍可单独使用。
97
+
98
+ 如需只部署本地检出目录中的模板,可通过顶层 `prompts` 引用,无需加载任何扩展:
99
+
100
+ ```json
101
+ {
102
+ "prompts": ["/absolute/path/to/pi-kit/prompts"]
103
+ }
104
+ ```
105
+
106
+ 升级后,已有筛选配置中的 `prompt-snipaste/prompts/...` 路径需要改为 `prompts/...`。
107
+
108
+ 反过来,`prompt-snipaste` 是面向**任意已启用 Pi 提示词**的通用组合框架,可读取全局、已信任项目或其他包提供的模板,不依赖固定文件名,也没有内置模板兜底。
109
+
110
+ ---
111
+
112
+ ## 资源按需筛选
113
+
114
+ 编辑全局 `~/.pi/agent/settings.json` 或项目 `.pi/settings.json`,将 `packages` 数组中原有的 `"npm:@rol1n/pi-kit"` 字符串替换为对象,保留其他包。**`source` 是 `packages[]` 内的字段,不是顶层字段。** 筛选路径相对于安装包根目录,不是启动列表里的 `@rol1n/pi-kit:...` 展示名称。
115
+
116
+ ### 黑名单:禁用部分扩展
117
+
118
+ 以下配置加载除语音听写、网页搜索与 Windows 滚轮修复之外的所有扩展。不写 `prompts` 和 `skills`,仍然提供全部 7 个模板及内置技能:
119
+
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
+ }
133
+ ```
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
+
200
+ ---
201
+
202
+ ## 致谢
203
+
204
+ - [elpapi42/pi-observational-memory](https://github.com/elpapi42/pi-observational-memory) — [`memory-log`](memory-log/README.md) 的观察记忆架构灵感与上游基础。
205
+ - [earendil-works/pi](https://github.com/earendil-works/pi) — Pi Coding Agent 运行时与 SDK。
206
+
207
+ ---
208
+
209
+ ## 许可证
210
+
211
+ [MIT](LICENSE) © RoL1n_SrP
@@ -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