pi-fast-subagent 0.5.0 → 0.5.1

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 (2) hide show
  1. package/README.md +95 -54
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -61,6 +61,51 @@ model: anthropic/claude-haiku-4-5
61
61
  You are code exploration specialist. Read relevant files, trace data flow, summarize findings clearly.
62
62
  ```
63
63
 
64
+ ## Background Agents
65
+
66
+ Every foreground subagent can be moved to background at any time. Background jobs run concurrently while you continue chatting. When a job finishes, pi automatically posts the result as a follow-up message.
67
+
68
+ ### Status bar
69
+
70
+ While a foreground subagent is running, the pi status bar shows:
71
+ ```
72
+ {agent-name} running · Ctrl+Shift+B to move to background
73
+ ```
74
+
75
+ While background jobs are running:
76
+ ```
77
+ ⧗ N bg agents
78
+ ```
79
+
80
+ ### Moving to background
81
+
82
+ **Keyboard shortcut (while subagent is running):**
83
+ ```
84
+ Ctrl+Shift+B
85
+ ```
86
+
87
+ **Slash command:**
88
+ ```
89
+ /fast-subagent:bg fg_ab12cd34
90
+ ```
91
+
92
+ **Via tool call:**
93
+ ```js
94
+ subagent({ action: "detach", jobId: "fg_ab12cd34" })
95
+ ```
96
+
97
+ ### Auto-completion announcement
98
+
99
+ When a background job finishes, pi injects a follow-up message automatically:
100
+ ```
101
+ Background subagent ✓: sa_ab12cd34 (scout, 4.2s)
102
+ > Explore src and summarize architecture
103
+
104
+ <result output>
105
+ ```
106
+
107
+ Failed jobs are announced the same way with ✗ and the error message.
108
+
64
109
  ## Slash Commands
65
110
 
66
111
  ### `/fast-subagent:agent`
@@ -81,13 +126,13 @@ Tab-completion is supported for agent names.
81
126
 
82
127
  ### `/fast-subagent:bg`
83
128
 
84
- Detach running foreground subagent to background:
129
+ Detach a running foreground subagent to background. Each foreground job has a `fg_` prefixed ID shown in the status bar.
85
130
 
86
131
  ```
87
132
  /fast-subagent:bg fg_ab12cd34
88
133
  ```
89
134
 
90
- Omit job id to list active foreground jobs:
135
+ Omit ID to list all active foreground jobs:
91
136
 
92
137
  ```
93
138
  /fast-subagent:bg
@@ -95,13 +140,13 @@ Omit job id to list active foreground jobs:
95
140
 
96
141
  ### `/fast-subagent:bg-status`
97
142
 
98
- Show active background subagents in selector UI. Arrow keys move selection. Enter shows full details for selected job.
143
+ Open selector UI showing all active background jobs. Arrow keys to navigate, Enter to view full details.
99
144
 
100
145
  ```
101
146
  /fast-subagent:bg-status
102
147
  ```
103
148
 
104
- Show details for specific background job:
149
+ Skip the selector — show details for a specific job directly:
105
150
 
106
151
  ```
107
152
  /fast-subagent:bg-status sa_ab12cd34
@@ -109,52 +154,58 @@ Show details for specific background job:
109
154
 
110
155
  ### `/fast-subagent:bg-cancel`
111
156
 
112
- Cancel running background subagent. Omit job id to open selector UI, then choose job with arrow keys.
157
+ Open selector UI to choose a running job to cancel:
113
158
 
114
159
  ```
115
160
  /fast-subagent:bg-cancel
116
161
  ```
117
162
 
118
- Cancel specific background job directly:
163
+ Cancel a specific job directly:
119
164
 
120
165
  ```
121
166
  /fast-subagent:bg-cancel sa_ab12cd34
122
167
  ```
123
168
 
124
- ## Usage
169
+ ## Keyboard Shortcuts
125
170
 
126
- ### List agents
171
+ | Shortcut | Action |
172
+ |---|---|
173
+ | `Ctrl+Shift+B` | Move active foreground subagent to background |
127
174
 
128
- ```js
129
- subagent({ action: "list" })
130
- ```
175
+ ## Roadmap
131
176
 
132
- ### Single
177
+ Goal: keep this extension **small and focused** — aligned with pi's philosophy of minimal, composable tooling. No feature creep. Every addition must earn its place.
133
178
 
134
- ```js
135
- subagent({
136
- agent: "scout",
137
- task: "Explore src and summarize architecture"
138
- })
139
- ```
179
+ - **UI/UX polish** — improve visibility of running subagents: clearer status lines, better progress feedback, agent name + task always visible during execution
180
+ - ~~**Background subagents**~~ ✔ shipped in v0.4.0 — fire-and-forget with `background: true`, poll/cancel/detach support
181
+
182
+ ## Notes
183
+
184
+ - Async/background isolation not supported in-process
185
+ - Git worktree isolation not supported
186
+ - Nested subagent depth limited to 2 by default
187
+
188
+ ## Tool Reference
140
189
 
141
- ### General-purpose built-in agent
190
+ > These are `subagent` tool call examples used by the LLM internally. Not typically invoked directly by users.
191
+
192
+ ### List / discover agents
142
193
 
143
194
  ```js
144
- subagent({
145
- agent: "general",
146
- task: "Summarize open TODOs and propose next step"
147
- })
195
+ // List all agents
196
+ subagent({ action: "list" })
197
+
198
+ // Get details for a specific agent
199
+ subagent({ action: "get", agent: "scout" })
200
+
201
+ // Scope filter: "user" | "project" | "both" (default)
202
+ subagent({ action: "list", agentScope: "project" })
148
203
  ```
149
204
 
150
- ### Override model
205
+ ### Single
151
206
 
152
207
  ```js
153
- subagent({
154
- agent: "scout",
155
- task: "Explore src and summarize architecture",
156
- model: "anthropic/claude-haiku-4-5"
157
- })
208
+ subagent({ agent: "scout", task: "Explore src and summarize architecture" })
158
209
  ```
159
210
 
160
211
  ### Parallel
@@ -165,42 +216,32 @@ subagent({
165
216
  { agent: "scout", task: "Map auth flow" },
166
217
  { agent: "scout", task: "Map navigation" }
167
218
  ],
168
- concurrency: 2
219
+ concurrency: 2 // default: 4
169
220
  })
221
+
222
+ // Repeat one task N times
223
+ subagent({ tasks: [{ agent: "scout", task: "Explore src", count: 3 }] })
170
224
  ```
171
225
 
172
- ### Background (fire-and-forget)
226
+ ### Background
173
227
 
174
228
  ```js
175
- // Dispatch — returns job ID immediately
229
+ // Fire-and-forget — returns job ID immediately
176
230
  subagent({ agent: "scout", task: "Explore src", background: true })
177
231
  // → { jobId: "sa_ab12cd34", status: "running" }
178
232
 
179
- // Poll check result / progress
180
- subagent({ action: "poll", jobId: "sa_ab12cd34" })
181
-
182
- // Cancel
183
- subagent({ action: "cancel", jobId: "sa_ab12cd34" })
184
-
185
- // List all background jobs
186
- subagent({ action: "status" })
187
-
188
- // Detach a running foreground job to background
189
- subagent({ action: "detach", jobId: "fg_ab12cd34" })
233
+ subagent({ action: "poll", jobId: "sa_ab12cd34" }) // check progress
234
+ subagent({ action: "cancel", jobId: "sa_ab12cd34" }) // abort
235
+ subagent({ action: "status" }) // list all bg jobs
236
+ subagent({ action: "detach", jobId: "fg_ab12cd34" }) // move fg → bg
190
237
  ```
191
238
 
192
- ## Roadmap
193
-
194
- Goal: keep this extension **small and focused** — aligned with pi's philosophy of minimal, composable tooling. No feature creep. Every addition must earn its place.
239
+ ### Options
195
240
 
196
- - **UI/UX polish** — improve visibility of running subagents: clearer status lines, better progress feedback, agent name + task always visible during execution
197
- - **Background agents** ala claude code
198
-
199
- ## Notes
200
-
201
- - Async/background isolation not supported in-process
202
- - Git worktree isolation not supported
203
- - Nested subagent depth limited to 2 by default
241
+ ```js
242
+ subagent({ agent: "scout", task: "...", model: "anthropic/claude-haiku-4-5" })
243
+ subagent({ agent: "scout", task: "...", cwd: "/path/to/project" })
244
+ ```
204
245
 
205
246
  ## Publish
206
247
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-fast-subagent",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "In-process subagent delegation for pi with single, parallel, and background modes",
5
5
  "type": "module",
6
6
  "keywords": [