@maxiaochao/pi-toolkit 0.7.1 → 0.8.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2026-09-24 - v0.8.0
2
+
3
+ - add the agent-team skill: cross-vendor adversarial review in herdr panes, with the model roster in skills/agent-team/models.json
4
+
5
+ ## 2026-09-24 - v0.7.2
6
+
7
+ - bundle the calldiff skill (copied verbatim from tanishqkancharla/calldiff, MIT, pinned to a main commit since upstream has no release tags) for call-stack diffs across git commits; the previous v0.7.1 tarball was briefly unavailable on the registry right after publish and is now served normally
8
+
1
9
  ## 2026-09-24 - v0.7.1
2
10
 
3
11
  - bundle the herdr skill (copied verbatim from herdrdev/herdr v0.9.1, Apache-2.0) for driving the Herdr terminal multiplexer from inside a pane; move the tapd CLI skill from .claude/skills into skills/ so it ships with the package
package/README.md CHANGED
@@ -89,6 +89,8 @@ The bundled `herdr` skill (copied verbatim from [herdrdev/herdr](https://github.
89
89
 
90
90
  The bundled `tapd` skill documents the third-party `tapd` CLI ([studyzy/tapd-ai-cli](https://github.com/studyzy/tapd-ai-cli)) for TAPD: requirements, defects, tasks, iterations, wikis, comments, attachments, timesheets, and workflow status maps, including the `--filter` advanced query syntax. It is the CLI's own command reference, so refresh the file with `tapd skill init` when the CLI changes.
91
91
 
92
+ The bundled `calldiff` skill (copied verbatim from [tanishqkancharla/calldiff](https://github.com/tanishqkancharla/calldiff), MIT, pinned to a `main` commit because upstream has no release tags) teaches call-stack diffs across git commits: `diff` shows which callees appeared, disappeared, or moved under an entrypoint, `tree` prints one call tree, and `reach` finds call paths between two symbols, all with `--entry`/`--file` entrypoint selection, `--locs` source locations, and `--format json` for agents.
93
+
92
94
  ## Tiny Subagent
93
95
 
94
96
  The tiny subagent is a separate npm package. Install it independently when you want the `tiny_subagents` tool:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxiaochao/pi-toolkit",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Personal pi coding agent toolkit: /todos, /btw, /cache_export extensions, browser automation, and bundled theme/skills.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: agent-team
3
+ description: 以对抗评审的方式让不同厂商的模型交叉验证同一个结论,当前会话担任管理者。Use when the user asks for 对抗评审 / 交叉验证, or wants a long-running investigation red-teamed by independent agents.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ 当前会话是**管理者**,不是转述人:自己也承担一份实证工作,并对每一轮的裁决负责。队员是长驻的 herdr pane,不是一次性 subagent —— 它们要能被反复追问、被点名互相反驳。
8
+
9
+ herdr 的完整 CLI 语义在 `herdr --skill`,本文只写这套协作协议。
10
+
11
+ ## 何时值得开
12
+
13
+ 只在用户要求组队时开,它会在用户的终端里真的分屏。值得开的条件:结论会驱动一个代价高的动作(改内核、下线设备、向客户定责),或者证据链已经长到单模型会自我确认。查一个事实、读一份文件用不上。
14
+
15
+ ## 1. 建队
16
+
17
+ **必须跨厂商。** 同厂同代模型共享盲区,三个一起点头等于一个点头。
18
+
19
+ 名单在同目录的 `models.json`,先读它,照里面的 `model` 字段写命令;用户指定了别的模型就用用户的。每个成员有 `name` / `model` / `role` / `charter`,`defaults` 里是共用的 `kind` 与 `thinking`。
20
+
21
+ ```bash
22
+ herdr pane split --current --direction right --cwd "$PWD" --no-focus
23
+ herdr agent start <name> --kind pi --pane <pane> -- --model <model> --thinking <thinking>
24
+ echo <pane> > /tmp/pane_<name>
25
+ ```
26
+
27
+ pane id 落盘,后面所有广播脚本都从这里取。开完把该成员的 `charter` 作为第一条 prompt 发过去,立常设职责。`herdr agent list` 确认都是 idle 再开工。
28
+
29
+ ## 2. 分角色:互不重叠的攻击面
30
+
31
+ 每个 pane 领一个**方法论上互斥**的职责:`auditor` 审源码、`replicator` 复算数据、`adversary` 攻方法学。具体措辞是 `models.json` 里各自的 `charter`,改职责改那里。
32
+
33
+ ## 3. 交底与通信
34
+
35
+ herdr 没有邮箱,只有 `agent prompt`(往别人输入框塞文字)和 `agent read`(把别人屏幕刮下来)。拓扑是星型,管理者是唯一的路由:跨 pane 的话全部由管理者转述,把 A 的原话引进 B 的下一条 prompt(「opus 说你这个计数可能一对多,用数据回应」)。
36
+
37
+ ```
38
+ 管理者(本会话)
39
+ 唯一写 FINDINGS 的人
40
+ │ │ │
41
+ 下行:消息 │ │ │ herdr agent prompt
42
+ (短指针) ▼ ▼ ▼
43
+ ┌────┐ ┌──────┐ ┌──────┐
44
+ │ sol│ │ grok │ │ opus │ 彼此不相连
45
+ └──┬──┘ └──┬───┘ └──┬───┘
46
+ │ │ │
47
+ 上行:文件 └───────┴───────┘
48
+ ▼
49
+ /tmp/<轮次>-<name>.md ← 管理者从磁盘读
50
+ ```
51
+
52
+ 技术上任何 pane 都能 prompt 任何 pane,让它们直连有四个代价:管理者看不见这次交换,ledger 就缺一环;对正在 working 的 agent 发 prompt 会被拒(`agent_blocked`)或插进它当前那一轮;没有投递回执;而且两两串供会让它们彼此收敛,恰好毁掉跨厂商独立性这唯一的价值来源。
53
+
54
+ 下行只发短指针,正文留在文件里:长文本经终端会被折断或触发意外快捷键。上行走文件:队员把结论写 `/tmp/<轮次>-<name>.md`,终端只回一行路径,管理者从磁盘读。`agent read` 是终端截图,会截断、会按宽度折行、会混进 TUI 边框,拿它收长输出必丢内容;只用它确认回执和状态。
55
+
56
+ 基准文档 `FINDINGS-stageN.md` 是**唯一事实源**,只有管理者写,新版本整体取代旧版本而不是打补丁。必含四块:机制链、编号发现、已推翻清单、未闭合点。
57
+
58
+ ```bash
59
+ MSG='【N17】读 /tmp/FINDINGS-stage4.md 全文。本轮你的攻击点:……。结论写 /tmp/N17-<你的名字>.md,终端只回一行路径。'
60
+ for a in sol grok opus; do herdr agent prompt "$a" "$MSG"; done
61
+ for a in sol grok opus; do herdr agent wait "$a" --until idle --timeout 900000; done
62
+ ```
63
+
64
+ ## 4. 回合
65
+
66
+ 一轮 = 广播 → 各自独立干 → 管理者从磁盘收文件 → 裁决 → 更新文档 → 再广播。
67
+
68
+ 每轮广播里给每个 pane 一个**具体到能证伪的攻击点**(「查 ART 的 adbconnection.cc,确认这条错误日志与被销毁的 fd 是不是 1:1」),而不是「你看看有没有问题」。
69
+
70
+ ## 5. 纪律
71
+
72
+ - **ledger**:发现按 `N1, N2…` 只增不改;每一条被推翻的结论进 `X1, X2…` 清单,写明是谁推翻的。这份 X 清单是最终交付里最有价值的部分。
73
+ - **retraction 要公开**:管理者被驳倒时,在下一次广播开头显式写「我错了,更正为……」。管理者一旦开始维护自己的结论,pane 就会停止攻击,整个队伍塌成回音室。
74
+ - **replication**:任何承载结论的数字至少两方独立算。对不上先查口径再查代码。
75
+ - **control**:任何「异常」指标必须配阴性样本才进文档。拿不出对照的指标只是一个数。
76
+ - **grading**:每条结论标注 `源码读取 / 实测 / 推断` 和置信度。推断不能和实测并列陈述。
77
+ - **裁决**:两个 pane 冲突时判出谁对,并说明依据。把冲突的结论平均掉会同时丢掉两边的信息。
78
+
79
+ ## 6. 收尾
80
+
81
+ 收敛判据:完整一轮广播后没有任何 pane 能产出新的 X。
82
+
83
+ 最终文档必须单列**未闭合点**,以及**每一个需要人或设备批准才能执行的动作**。
84
+
85
+ 用完 `herdr pane close <pane_id>` 关掉,pane 不会自己退出。
86
+
87
+ ## 故障
88
+
89
+ - pane 额度耗尽:降级为剩余 pane 继续,并在文档里记下缺失的是哪个视角。
90
+ - agent 卡在 blocked:`herdr agent read <name> --source visible` 看它在等什么,多半是在等一个确认。
91
+ - 广播后无人响应:`herdr agent list` 核对 pane 是否还活着,pane id 会随布局变化。
@@ -0,0 +1,26 @@
1
+ {
2
+ "defaults": {
3
+ "kind": "pi",
4
+ "thinking": "high"
5
+ },
6
+ "members": [
7
+ {
8
+ "name": "sol",
9
+ "model": "pudu/gpt-5.6-sol",
10
+ "role": "auditor",
11
+ "charter": "只接受能逐行引用的源码、规范、commit,输出必须带 文件:行号。负责把「机制上可能」变成「代码里确实如此」;查不到就说查不到,不要用常识补。"
12
+ },
13
+ {
14
+ "name": "grok",
15
+ "model": "pudu/grok-4.6",
16
+ "role": "replicator",
17
+ "charter": "拿原始数据和口径,不看管理者的脚本,独立重算同一个指标,只报自己的数和差异。数对不上就是一次发现,先查口径再查代码。"
18
+ },
19
+ {
20
+ "name": "opus",
21
+ "model": "pudu/claude-opus-5",
22
+ "role": "adversary",
23
+ "charter": "攻前提和方法学,不攻结论。指出指标对样本组成的敏感性、计数的一对多、缺失的阴性对照。附议没有价值,找不到问题就说明理由。"
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tanishq Kancharla
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.
@@ -0,0 +1,19 @@
1
+ calldiff Skill
2
+
3
+ This directory is copied verbatim from the calldiff repository:
4
+ https://github.com/tanishqkancharla/calldiff
5
+ skills/calldiff/SKILL.md at commit 2086f6e4e9ed3c410bba7c94ca3dde77791b1956 (main)
6
+
7
+ The upstream repository is licensed under the MIT License. A copy of that
8
+ license is included in LICENSE.
9
+
10
+ Upstream publishes no release tags, so this file is pinned to a main commit
11
+ instead of a tag. The CLI can also write its own copy with `calldiff skills
12
+ add` (to ~/.agents/skills/calldiff/SKILL.md), but that generated file is terser
13
+ than the committed one — it leaves the --entry/--file descriptions empty and
14
+ says 22 languages — so pi-toolkit ships the committed file.
15
+
16
+ To refresh, copy skills/calldiff/SKILL.md and LICENSE from a newer upstream
17
+ commit and update the commit above. The bundled commands were smoke-tested
18
+ against calldiff 0.5.0 (`diff`, `tree`, `reach`, `--entry`, `--file`,
19
+ `--maxDepth`/`--max-depth`, `--locs`, `--format json`).
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: calldiff
3
+ description: Diff call stacks across git commits — like git diff, but for who-calls-whom. Shows which callees appeared, disappeared, or moved under an entrypoint across 23 languages (diff, tree, and reach). Use for agentic code review when call flow changed and line diffs bury the shape of the change.
4
+ requires_bin: calldiff
5
+ command: calldiff
6
+ ---
7
+
8
+ # calldiff diff
9
+
10
+ Diff call stacks between two git trees
11
+
12
+ ## Arguments
13
+
14
+ | Name | Type | Required | Description |
15
+ |------|------|----------|-------------|
16
+ | `from` | `string` | no | Before ref (default: HEAD) |
17
+ | `to` | `string` | no | After ref (default: working tree) |
18
+ | `paths` | `array` | no | Limit to these path prefixes |
19
+
20
+ ## Options
21
+
22
+ | Flag | Type | Default | Description |
23
+ |------|------|---------|-------------|
24
+ | `--entry` | `unknown` | | Entrypoint symbol(s): functionName or ClassName.method |
25
+ | `--file` | `unknown` | | Entrypoint file(s): indexed source path; expands to that file's exports |
26
+ | `--maxDepth` | `number` | `12` | Max call-tree depth |
27
+ | `--locs` | `boolean` | `false` | Show call-site source locations (file:line) |
28
+ | `--from` | `string` | | Left / "before" tree |
29
+ | `--to` | `string` | | Right / "after" tree |
30
+
31
+ ## Examples
32
+
33
+ ```sh
34
+ # HEAD vs working tree
35
+ calldiff diff
36
+
37
+ # One ref vs working tree
38
+ calldiff diff main
39
+
40
+ # Two commits / branches
41
+ calldiff diff abc123 def456
42
+
43
+ # Force entrypoints
44
+ calldiff diff main feature --entry createAgentSession
45
+
46
+ # File expands to that file's exports
47
+ calldiff diff main feature --file src/routes.ts
48
+ ```
49
+
50
+ > Semantics match git diff: no refs → HEAD vs worktree; one ref → that vs worktree; two refs → compare those trees.
51
+
52
+ ---
53
+
54
+ # calldiff reach
55
+
56
+ Find all call paths from an entrypoint to a target symbol
57
+
58
+ ## Arguments
59
+
60
+ | Name | Type | Required | Description |
61
+ |------|------|----------|-------------|
62
+ | `ref` | `string` | no | Git ref (default: working tree) |
63
+ | `paths` | `array` | no | Limit to these path prefixes |
64
+
65
+ ## Options
66
+
67
+ | Flag | Type | Default | Description |
68
+ |------|------|---------|-------------|
69
+ | `--entry` | `unknown` | | Entrypoint symbol(s): functionName or ClassName.method |
70
+ | `--file` | `unknown` | | Entrypoint file(s): indexed source path; expands to that file's exports |
71
+ | `--to` | `string` | | Target symbol to reach (functionName or ClassName.method) |
72
+ | `--maxDepth` | `number` | `12` | Max call-tree depth |
73
+ | `--locs` | `boolean` | `false` | Show call-site source locations (file:line) |
74
+
75
+ ## Examples
76
+
77
+ ```sh
78
+ # Paths in the working tree
79
+ calldiff reach --entry runCheckout --to sendEmail
80
+
81
+ # Paths at a commit, limited to a directory
82
+ calldiff reach HEAD examples/checkout --entry runCheckout --to sendEmail
83
+
84
+ # Paths from every export in a file
85
+ calldiff reach --file packages/api/src/flow.ts --to notify
86
+ ```
87
+
88
+ ---
89
+
90
+ # calldiff tree
91
+
92
+ View a call tree (no diff) for one or more entrypoints
93
+
94
+ ## Arguments
95
+
96
+ | Name | Type | Required | Description |
97
+ |------|------|----------|-------------|
98
+ | `ref` | `string` | no | Git ref (default: working tree) |
99
+ | `paths` | `array` | no | Limit to these path prefixes |
100
+
101
+ ## Options
102
+
103
+ | Flag | Type | Default | Description |
104
+ |------|------|---------|-------------|
105
+ | `--entry` | `unknown` | | Entrypoint symbol(s): functionName or ClassName.method |
106
+ | `--file` | `unknown` | | Entrypoint file(s): indexed source path; expands to that file's exports |
107
+ | `--maxDepth` | `number` | `12` | Max call-tree depth |
108
+ | `--locs` | `boolean` | `false` | Show call-site source locations (file:line) |
109
+
110
+ ## Examples
111
+
112
+ ```sh
113
+ # Tree from working tree
114
+ calldiff tree --entry createAgentSession
115
+
116
+ # Tree from a commit
117
+ calldiff tree HEAD --entry PiService.createAgentSession
118
+
119
+ # Every export in a file
120
+ calldiff tree --file packages/api/src/routes.ts
121
+ ```