@xynogen/pix-subagent 0.1.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/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 xynogen
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.
22
+
23
+ ---
24
+
25
+ Portions of this software are ported from tintinweb/pi-subagents
26
+ (https://github.com/tintinweb/pi-subagents), licensed under MIT.
27
+ Copyright (c) tintinweb.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # @xynogen/pix-subagent
2
+
3
+ Pi extension — planner-driven sub-agents with 3 tools, live widget (model always visible), and explicit work-splitting.
4
+
5
+ ## Install
6
+
7
+ Bundled by [`@xynogen/pix-core`](https://www.npmjs.com/package/@xynogen/pix-core) — no separate install needed.
8
+
9
+ Standalone:
10
+
11
+ ```bash
12
+ pi install npm:@xynogen/pix-subagent
13
+ ```
14
+
15
+ ## What it does
16
+
17
+ Gives the parent agent (planner) three tools to delegate work to isolated child sessions:
18
+
19
+ | Tool | Purpose |
20
+ |---|---|
21
+ | `agent` | Spawn a sub-agent (foreground or background) |
22
+ | `agent_result` | Fetch latest output / full conversation by ID |
23
+ | `agent_steer` | Inject a message into a running background agent |
24
+
25
+ ### The pix twist
26
+
27
+ **Model name is always visible** — in the widget header and completion notification, regardless of whether the child uses the same model as the parent. Looks like:
28
+
29
+ ```
30
+ ● Agents
31
+ ├─ ⠹ Explore [haiku] scout auth flow · ↻2 · 3 tool uses · 12.4k · 1.2s
32
+ │ ⎿ grep "middleware" src/
33
+ └─ ✓ Plan [sonnet] design refactor · ↻5 · 2.1s
34
+ ```
35
+
36
+ ## Tools
37
+
38
+ ### `agent` — spawn a sub-agent
39
+
40
+ ```
41
+ prompt string Self-contained task description
42
+ description string 3-5 words, shown in widget
43
+ subagent_type string Agent type (see available types in tool description)
44
+ model? string "provider/id" or fuzzy ("haiku") — from the live model list
45
+ allowed_tools? string[] Restrict child's tools (intersected, never widens)
46
+ thinking? string off|minimal|low|medium|high|xhigh
47
+ max_turns? number Omit for unlimited
48
+ run_in_background? bool false (default) = foreground; true = background + notify
49
+ resume? string Agent ID to continue
50
+ isolated? bool No extension/MCP tools, builtins only
51
+ inherit_context? bool Fork parent conversation into child
52
+ ```
53
+
54
+ **`allowed_tools[]`** is the work-splitting hook. Pass `["read","grep","find"]` to scope an Explore agent to read-only ops. The list is intersected with the agent type's default set — it can only narrow, never widen.
55
+
56
+ **`model`** accepts `"provider/id"` or fuzzy strings like `"haiku"`, `"sonnet"`. The live list of available models (those with auth configured) is injected into the tool description so the planner can pick correctly. Unknown → error returned to planner to re-pick.
57
+
58
+ ### `agent_result` — fetch result
59
+
60
+ ```
61
+ agent_id string ID returned by agent (background)
62
+ verbose? bool true = full conversation; false (default) = latest text
63
+ ```
64
+
65
+ Calling this suppresses the completion notification (result already consumed).
66
+
67
+ ### `agent_steer` — redirect running agent
68
+
69
+ ```
70
+ agent_id string Running background agent ID
71
+ message string Steering message to inject
72
+ ```
73
+
74
+ Delivered after the agent's current tool execution. If the session isn't ready yet, the message is queued and delivered on session start.
75
+
76
+ ## Default agent types
77
+
78
+ | Type | Tools | Model |
79
+ |---|---|---|
80
+ | `general-purpose` | all (read/bash/edit/write/grep/find/ls) | parent |
81
+ | `Explore` | read/bash/grep/find/ls (read-only) | haiku |
82
+ | `Plan` | read/bash/grep/find/ls (read-only) | parent |
83
+
84
+ ## Custom agents
85
+
86
+ Drop a `.md` file in `.pi/agents/` (project) or `~/.pi/agent/agents/` (global):
87
+
88
+ ```markdown
89
+ ---
90
+ description: Scout for auth-related code patterns
91
+ tools: read, grep, find
92
+ model: anthropic/claude-haiku-4-5
93
+ thinking: low
94
+ max_turns: 20
95
+ ---
96
+ You are a read-only code scout. Find patterns, never write files.
97
+ ```
98
+
99
+ Frontmatter fields: `description`, `tools` (CSV), `model`, `thinking`, `max_turns`, `extensions` (true/false/CSV), `skills` (true/false/CSV), `isolated`, `inherit_context`, `run_in_background`, `prompt_mode` (replace/append), `enabled` (false to disable).
100
+
101
+ ## Deferred (v2+)
102
+
103
+ - Git worktree isolation (`isolation: "worktree"`)
104
+ - Cron/interval scheduling (`schedule` param)
105
+ - Cross-extension RPC event bus
106
+ - `/agents` conversation viewer overlay
107
+ - Persistent agent memory (user/project/local scope)
108
+ - Smart group-join notifications for parallel fan-outs
109
+ - Chain/parallel orchestration modes
110
+
111
+ ## Attribution
112
+
113
+ Spawn engine ported from [tintinweb/pi-subagents](https://github.com/tintinweb/pi-subagents) (MIT).
114
+ Work-splitting design inspired by [nicobailon/pi-subagents](https://github.com/nicobailon/pi-subagents) (MIT).
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@xynogen/pix-subagent",
3
+ "version": "0.1.0",
4
+ "description": "Pi tool — planner-driven sub-agents: spawn, fetch, steer scoped child agents",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "scripts": {
8
+ "test": "bun test"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "pi": {
16
+ "extensions": [
17
+ "src/extension.ts"
18
+ ]
19
+ },
20
+ "keywords": [
21
+ "pi",
22
+ "pi-package",
23
+ "pi-extension",
24
+ "subagent",
25
+ "agent",
26
+ "autonomous"
27
+ ],
28
+ "author": "xynogen",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/xynogen/pix-mono.git",
33
+ "directory": "packages/pix-subagent"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "@sinclair/typebox": "^0.34.0"
40
+ },
41
+ "peerDependencies": {
42
+ "@earendil-works/pi-coding-agent": "*",
43
+ "@earendil-works/pi-ai": "*",
44
+ "@earendil-works/pi-tui": "*"
45
+ }
46
+ }