pi-ptc-subagents 7.1.0 → 7.3.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/README.md CHANGED
@@ -1,23 +1,29 @@
1
1
  # pi-ptc-subagents
2
2
 
3
- Programmable tool calling and subagent dispatch for [pi](https://pi.dev) — and a [Kimi Code](https://www.kimi.com/code) plugin (`ptc-tools`, MCP) that brings the same "write one program, batch-call your tools" to Kimi sessions. The npm package name is the pi-face distribution; the Kimi face ships from this repo's releases.
3
+ Programmable tool calling and subagent dispatch for [pi](https://pi.dev) — and a
4
+ [Kimi Code](https://www.kimi.com/code) plugin (`ptc-tools`, MCP) that brings the same
5
+ "write one program, batch-call your tools" to Kimi sessions. The npm package covers pi;
6
+ the Kimi Code plugin ships from this repo's GitHub Releases.
4
7
 
5
- pi calls tools one at a time. This package lets the model write a program that calls them
6
- in one go — and lets that program spawn pi subagents. Two capabilities. One package.
8
+ pi calls tools one at a time. On pi, the model writes a program that calls them in one
9
+ go — and can spawn pi subagents from inside it. On Kimi Code, the plugin gives the model
10
+ one program tool over a fixed file-tool set.
7
11
 
8
12
  ```
9
- full_ptc model ──▶ ptc_run_code ──▶ program ──┬──▶ tools.read · grep · edit · … (session tools)
10
- └──▶ pi_task_ptc ──▶ pi child ──▶ report
13
+ on pi
14
+ full_ptc model ──▶ ptc_run_code ──▶ program ──┬──▶ tools.read · grep · edit · … (session tools)
15
+ └──▶ pi_task_ptc ──▶ pi child ──▶ report
11
16
 
12
- codemode_ptc model ──▶ codemode script ───────────┬──▶ tools.read · grep · edit · … (session tools)
13
- └──▶ pi_task_codemode ──▶ pi child ──▶ report
17
+ codemode_ptc model ──▶ codemode script ───────────┬──▶ tools.read · grep · edit · … (session tools)
18
+ └──▶ pi_task_codemode ──▶ pi child ──▶ report
14
19
 
15
- one call in, one result back — never the calls in between.
16
- ```
20
+ on kimi (MCP)
21
+ model ──▶ ptc_run_code ──▶ program ──────▶ tools.read · grep · glob · edit (fs 四件套, workdir-locked)
17
22
 
18
- Both surfaces are detected from the session. There is no setting.
23
+ one call in, one result back — never the calls in between.
24
+ ```
19
25
 
20
- ## What you get
26
+ ## On pi
21
27
 
22
28
  - **One program, many tool calls.** `ptc_run_code` and `ptc_workflow` run TypeScript in a
23
29
  worker. The program uses the session's tools as `tools.read(...)`, `tools.grep(...)`.
@@ -30,8 +36,6 @@ Both surfaces are detected from the session. There is no setting.
30
36
  - **Search, where it belongs.** `web_ds_search` registers only inside dispatched children.
31
37
  Off by default.
32
38
 
33
- A call looks like this — the same shape on both surfaces:
34
-
35
39
  ```ts
36
40
  // full_ptc, inside ptc_run_code
37
41
  const r = await tools.pi_task_ptc({ task: "audit the auth code", wait: true });
@@ -42,7 +46,42 @@ const r = await tools.pi_task_codemode({ task: "audit the auth code", wait: true
42
46
  return r.report?.summary ?? r.text;
43
47
  ```
44
48
 
45
- ## Install
49
+ ### Surfaces
50
+
51
+ - **`full_ptc`** — the PTC pair is model-facing. Programs reach tasks with `pi_task_ptc`.
52
+ - **`codemode_ptc`** — pi's codemode orchestrates. Scripts reach tasks with
53
+ `pi_task_codemode`; the PTC pair is not registered at all.
54
+
55
+ Which one you get depends on whether `codemode` is loaded and callable. Nothing to configure.
56
+
57
+ ### PTC mode
58
+
59
+ On a `full_ptc` session, PTC mode adds a routing lead to the system prompt: batch your
60
+ tool calls into one program. `/ptc off` drops the lead.
61
+
62
+ It does not hide the built-in tools from the model. pi keeps a tool callable from a
63
+ program only while it is active, so narrowing the loadout would take `tools.read` away
64
+ from the program too — the two cannot both hold on pi 1.4.0.
65
+
66
+ ## The Kimi Code plugin (`ptc-tools`)
67
+
68
+ Two MCP tools; the host's own tools remain the orchestrator (no subagent door here —
69
+ Kimi Code ships its own Agent tool, so this plugin doesn't duplicate one):
70
+
71
+ - **`ptc_run_code({ code, description, workdir, timeoutMs? })`** — a TypeScript program in
72
+ the same vm cell as on pi, over a fixed tool set: `read` / `grep` / `glob` / `edit`.
73
+ Every path is realpath-checked and confined to `workdir`; `edit` lands atomically and
74
+ requires a unique `old_string`. No `bash`, no task dispatch inside the program.
75
+ - **`web_ds_search`** — search / open / find, callable directly (no child process needed).
76
+ Quota is per MCP server process (default 30 calls, `0` = unlimited); the DeepSeek key
77
+ resolves from env, then Kimi Code's `config.toml`.
78
+
79
+ Install with `/plugins install https://github.com/a1121611810/pi-ptc-subagents` — the bare repo
80
+ URL tracks the latest GitHub Release (pinned URLs get no update checks); run `/reload` to
81
+ activate. A bundled `ptc` skill teaches the model when to write a program instead of
82
+ fanning out tool calls one by one.
83
+
84
+ ## Install (pi)
46
85
 
47
86
  ```bash
48
87
  pi install npm:pi-ptc-subagents
@@ -60,24 +99,9 @@ To run one build without touching your settings:
60
99
  pi -ne -e packages/entry/dist/index.js
61
100
  ```
62
101
 
63
- ## Surfaces
64
-
65
- - **`full_ptc`** — the PTC pair is model-facing. Programs reach tasks with `pi_task_ptc`.
66
- - **`codemode_ptc`** — pi's codemode orchestrates. Scripts reach tasks with
67
- `pi_task_codemode`; the PTC pair is not registered at all.
68
-
69
- Which one you get depends on whether `codemode` is loaded and callable. Nothing to configure.
70
-
71
- ## PTC mode
102
+ Requires Node ≥ 22.19.
72
103
 
73
- On a `full_ptc` session, PTC mode adds a routing lead to the system prompt: batch your
74
- tool calls into one program. `/ptc mode off` drops the lead.
75
-
76
- It does not hide the built-in tools from the model. pi keeps a tool callable from a
77
- program only while it is active, so narrowing the loadout would take `tools.read` away
78
- from the program too — the two cannot both hold on pi 1.4.0.
79
-
80
- ## Configuration
104
+ ## Configuration (pi)
81
105
 
82
106
  `~/.pi/agent/ptc.json` — all optional:
83
107
 
@@ -92,19 +116,29 @@ from the program too — the two cannot both hold on pi 1.4.0.
92
116
 
93
117
  ## Trust posture
94
118
 
95
- Programs run as you. There is no OS sandbox, and a program's tool calls bypass pi's
96
- `tool_call` hooks. `bash` is not bound by default.
119
+ Programs run in a vm cell on both editions (ADR-0019, v7.0.0): the only door out is
120
+ `tools.*`, which goes through the same tool pipeline as a direct call. Programs do not
121
+ see `process`, `fetch`, or dynamic `import` — code that used them broke in v7.0.0.
122
+
123
+ That is an alignment of power paths, not a security boundary. There is still no OS
124
+ sandbox: whatever the bound tools can do, a program can do, and a dispatched child is a
125
+ full pi process running as you. `bash` is not in the program binding table on either edition.
97
126
 
98
127
  ## Compatibility
99
128
 
100
- pi `>= 0.86.0`. Real-machine smoke tests cover 0.86.0 through 1.4, including a program that
101
- dispatches a real child process. Details:
102
- [docs/pi-version-matrix.md](./docs/pi-version-matrix.md).
129
+ pi `>= 0.86.0`, tracked against latest (currently 1.4.0). Two version facts matter:
130
+
131
+ - **In-program `tools.*` needs pi ≥ 0.99.** On 0.86/0.87 a program still evaluates and can
132
+ still dispatch a task, but session-tool calls fail with a clear version error. The
133
+ codemode surface itself also only exists from 0.99.
134
+ - Everything else in the 0.86–1.4 range is covered by real-machine smoke tests, including
135
+ a program that dispatches a real child process. Per-version details:
136
+ [docs/pi-version-matrix.md](./docs/pi-version-matrix.md).
103
137
 
104
138
  ## Documentation
105
139
 
106
140
  - [AGENTS.md](./AGENTS.md) — how this repository is built and guarded
107
- - [docs/adr/](./docs/adr/) — decisions, 0001–0015
141
+ - [docs/adr/](./docs/adr/) — decisions, 0001–0020
108
142
  - [docs/prototypes/](./docs/prototypes/) — spec and status pages
109
143
  - [docs/research/](./docs/research/) — evidence notes
110
144