pi-all-tools 1.0.4 → 1.0.6

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.
@@ -0,0 +1,27 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ compile:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: "22"
20
+
21
+ - name: Install
22
+ run: npm install
23
+
24
+ - name: Compile
25
+ run: |
26
+ npm install --no-save typescript @types/node
27
+ npx --no-install tsc --noEmit --skipLibCheck --esModuleInterop --module nodenext --moduleResolution nodenext --target es2022 extensions/default-tools.ts
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-all-tools
2
2
 
3
- Enable all 7 built-in Pi tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`
3
+ Ensure 3 additional Pi tools are always available: `find`, `grep`, `ls`
4
4
 
5
5
  ## Install
6
6
 
@@ -10,4 +10,4 @@ pi install npm:pi-all-tools
10
10
 
11
11
  ## What it does
12
12
 
13
- Pi 默认只启用 4 个工具 (read, bash, edit, write)。此扩展在每次 agent 启动时读取当前活跃工具列表,仅追加缺失的 find, grep, ls,不覆盖其他扩展注册的工具。
13
+ Pi 默认自带 4 个工具 (read, bash, edit, write)。此扩展在每次 agent 启动时自动追加 `find`, `grep`, `ls`,共 7 个工具可用,不覆盖其他扩展注册的工具。
@@ -1,7 +1,12 @@
1
- export default function (pi: any) {
1
+ // Ponytail: local typed interface keeps zero deps
2
+ export default function (pi: { on: (event: string, cb: () => void | Promise<void>) => void; getActiveTools: () => string[]; setActiveTools: (tools: string[]) => void }) {
2
3
  pi.on("before_agent_start", async () => {
3
- const current = pi.getActiveTools() || [];
4
- const missing = ["find", "grep", "ls"].filter(t => !current.includes(t));
5
- if (missing.length > 0) pi.setActiveTools([...current, ...missing]);
4
+ try {
5
+ const current = pi.getActiveTools() ?? [];
6
+ const missing = ["find", "grep", "ls"].filter(t => !current.includes(t));
7
+ if (missing.length > 0) pi.setActiveTools([...current, ...missing]);
8
+ } catch {
9
+ // Extension should never crash Pi — silent no-op on failure
10
+ }
6
11
  });
7
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-all-tools",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Enable all 7 built-in Pi tools by default (read, bash, edit, write, grep, find, ls)",
5
5
  "license": "MIT",
6
6
  "repository": "github:RealAlexandreAI/pi-all-tools",