@esso0428/pi-subagents 0.17.5 → 0.17.7

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 (263) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CONTRIBUTING.md +4 -0
  3. package/README.md +1 -1
  4. package/dist/abortable.d.ts +13 -0
  5. package/dist/abortable.d.ts.map +1 -0
  6. package/dist/abortable.js +43 -0
  7. package/dist/abortable.js.map +1 -0
  8. package/dist/agent-color.d.ts +36 -0
  9. package/dist/agent-color.d.ts.map +1 -0
  10. package/dist/agent-color.js +124 -0
  11. package/dist/agent-color.js.map +1 -0
  12. package/dist/agent-file-toggle.d.ts +126 -0
  13. package/dist/agent-file-toggle.d.ts.map +1 -0
  14. package/dist/agent-file-toggle.js +259 -0
  15. package/dist/agent-file-toggle.js.map +1 -0
  16. package/dist/agent-history.d.ts +4 -0
  17. package/dist/agent-history.d.ts.map +1 -1
  18. package/dist/agent-history.js +47 -1
  19. package/dist/agent-history.js.map +1 -1
  20. package/dist/agent-manager.d.ts +370 -56
  21. package/dist/agent-manager.d.ts.map +1 -1
  22. package/dist/agent-manager.js +1123 -409
  23. package/dist/agent-manager.js.map +1 -1
  24. package/dist/agent-runner.d.ts +100 -10
  25. package/dist/agent-runner.d.ts.map +1 -1
  26. package/dist/agent-runner.js +166 -21
  27. package/dist/agent-runner.js.map +1 -1
  28. package/dist/agent-types.d.ts +57 -5
  29. package/dist/agent-types.d.ts.map +1 -1
  30. package/dist/agent-types.js +164 -32
  31. package/dist/agent-types.js.map +1 -1
  32. package/dist/child-context.d.ts +3 -0
  33. package/dist/child-context.d.ts.map +1 -0
  34. package/dist/child-context.js +13 -0
  35. package/dist/child-context.js.map +1 -0
  36. package/dist/cross-extension-rpc.d.ts +23 -3
  37. package/dist/cross-extension-rpc.d.ts.map +1 -1
  38. package/dist/cross-extension-rpc.js +79 -17
  39. package/dist/cross-extension-rpc.js.map +1 -1
  40. package/dist/custom-agents.d.ts +38 -1
  41. package/dist/custom-agents.d.ts.map +1 -1
  42. package/dist/custom-agents.js +164 -12
  43. package/dist/custom-agents.js.map +1 -1
  44. package/dist/index.d.ts +34 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +1908 -495
  47. package/dist/index.js.map +1 -1
  48. package/dist/invocation-config.d.ts +87 -2
  49. package/dist/invocation-config.d.ts.map +1 -1
  50. package/dist/invocation-config.js +71 -3
  51. package/dist/invocation-config.js.map +1 -1
  52. package/dist/mention-clone.d.ts +88 -0
  53. package/dist/mention-clone.d.ts.map +1 -0
  54. package/dist/mention-clone.js +154 -0
  55. package/dist/mention-clone.js.map +1 -0
  56. package/dist/mention.d.ts +82 -0
  57. package/dist/mention.d.ts.map +1 -0
  58. package/dist/mention.js +132 -0
  59. package/dist/mention.js.map +1 -0
  60. package/dist/model-resolver.d.ts +17 -0
  61. package/dist/model-resolver.d.ts.map +1 -1
  62. package/dist/model-resolver.js +15 -0
  63. package/dist/model-resolver.js.map +1 -1
  64. package/dist/model-scope.d.ts +50 -0
  65. package/dist/model-scope.d.ts.map +1 -0
  66. package/dist/model-scope.js +49 -0
  67. package/dist/model-scope.js.map +1 -0
  68. package/dist/nested-tools.d.ts +57 -0
  69. package/dist/nested-tools.d.ts.map +1 -0
  70. package/dist/nested-tools.js +301 -0
  71. package/dist/nested-tools.js.map +1 -0
  72. package/dist/output-file.d.ts +22 -3
  73. package/dist/output-file.d.ts.map +1 -1
  74. package/dist/output-file.js +58 -7
  75. package/dist/output-file.js.map +1 -1
  76. package/dist/prompts.d.ts +23 -0
  77. package/dist/prompts.d.ts.map +1 -1
  78. package/dist/prompts.js +20 -2
  79. package/dist/prompts.js.map +1 -1
  80. package/dist/schedule.d.ts.map +1 -1
  81. package/dist/schedule.js +36 -15
  82. package/dist/schedule.js.map +1 -1
  83. package/dist/settings.d.ts +228 -2
  84. package/dist/settings.d.ts.map +1 -1
  85. package/dist/settings.js +94 -0
  86. package/dist/settings.js.map +1 -1
  87. package/dist/status-note.d.ts +49 -1
  88. package/dist/status-note.d.ts.map +1 -1
  89. package/dist/status-note.js +62 -1
  90. package/dist/status-note.js.map +1 -1
  91. package/dist/structured-output.d.ts +62 -0
  92. package/dist/structured-output.d.ts.map +1 -0
  93. package/dist/structured-output.js +113 -0
  94. package/dist/structured-output.js.map +1 -0
  95. package/dist/types.d.ts +176 -10
  96. package/dist/types.d.ts.map +1 -1
  97. package/dist/ui/agent-mention.d.ts +83 -0
  98. package/dist/ui/agent-mention.d.ts.map +1 -0
  99. package/dist/ui/agent-mention.js +188 -0
  100. package/dist/ui/agent-mention.js.map +1 -0
  101. package/dist/ui/agent-widget.d.ts +96 -75
  102. package/dist/ui/agent-widget.d.ts.map +1 -1
  103. package/dist/ui/agent-widget.js +397 -420
  104. package/dist/ui/agent-widget.js.map +1 -1
  105. package/dist/ui/conversation-blocks.d.ts.map +1 -1
  106. package/dist/ui/conversation-blocks.js +6 -0
  107. package/dist/ui/conversation-blocks.js.map +1 -1
  108. package/dist/ui/conversation-timeline.d.ts +10 -2
  109. package/dist/ui/conversation-timeline.d.ts.map +1 -1
  110. package/dist/ui/conversation-timeline.js +130 -23
  111. package/dist/ui/conversation-timeline.js.map +1 -1
  112. package/dist/ui/conversation-viewer.d.ts +20 -5
  113. package/dist/ui/conversation-viewer.d.ts.map +1 -1
  114. package/dist/ui/conversation-viewer.js +274 -73
  115. package/dist/ui/conversation-viewer.js.map +1 -1
  116. package/dist/ui/fleet-list.d.ts +198 -0
  117. package/dist/ui/fleet-list.d.ts.map +1 -0
  118. package/dist/ui/fleet-list.js +487 -0
  119. package/dist/ui/fleet-list.js.map +1 -0
  120. package/dist/ui/schedule-menu.d.ts.map +1 -1
  121. package/dist/ui/schedule-menu.js +6 -7
  122. package/dist/ui/schedule-menu.js.map +1 -1
  123. package/dist/ui/select-item.d.ts +28 -0
  124. package/dist/ui/select-item.d.ts.map +1 -0
  125. package/dist/ui/select-item.js +35 -0
  126. package/dist/ui/select-item.js.map +1 -0
  127. package/dist/ui/workflow-card.d.ts +176 -0
  128. package/dist/ui/workflow-card.d.ts.map +1 -0
  129. package/dist/ui/workflow-card.js +333 -0
  130. package/dist/ui/workflow-card.js.map +1 -0
  131. package/dist/ui/workflow-dialog.d.ts +306 -0
  132. package/dist/ui/workflow-dialog.d.ts.map +1 -0
  133. package/dist/ui/workflow-dialog.js +844 -0
  134. package/dist/ui/workflow-dialog.js.map +1 -0
  135. package/dist/ui/workflow-menu.d.ts +61 -0
  136. package/dist/ui/workflow-menu.d.ts.map +1 -0
  137. package/dist/ui/workflow-menu.js +148 -0
  138. package/dist/ui/workflow-menu.js.map +1 -0
  139. package/dist/usage.d.ts +86 -1
  140. package/dist/usage.d.ts.map +1 -1
  141. package/dist/usage.js +72 -1
  142. package/dist/usage.js.map +1 -1
  143. package/dist/workflow/collisions.d.ts +96 -0
  144. package/dist/workflow/collisions.d.ts.map +1 -0
  145. package/dist/workflow/collisions.js +89 -0
  146. package/dist/workflow/collisions.js.map +1 -0
  147. package/dist/workflow/entry.d.ts +33 -0
  148. package/dist/workflow/entry.d.ts.map +1 -0
  149. package/dist/workflow/entry.js +30 -0
  150. package/dist/workflow/entry.js.map +1 -0
  151. package/dist/workflow/host.d.ts +63 -0
  152. package/dist/workflow/host.d.ts.map +1 -0
  153. package/dist/workflow/host.js +363 -0
  154. package/dist/workflow/host.js.map +1 -0
  155. package/dist/workflow/journal.d.ts +98 -0
  156. package/dist/workflow/journal.d.ts.map +1 -0
  157. package/dist/workflow/journal.js +121 -0
  158. package/dist/workflow/journal.js.map +1 -0
  159. package/dist/workflow/json-schema.d.ts +52 -0
  160. package/dist/workflow/json-schema.d.ts.map +1 -0
  161. package/dist/workflow/json-schema.js +112 -0
  162. package/dist/workflow/json-schema.js.map +1 -0
  163. package/dist/workflow/meta.d.ts +68 -0
  164. package/dist/workflow/meta.d.ts.map +1 -0
  165. package/dist/workflow/meta.js +318 -0
  166. package/dist/workflow/meta.js.map +1 -0
  167. package/dist/workflow/progress.d.ts +225 -0
  168. package/dist/workflow/progress.d.ts.map +1 -0
  169. package/dist/workflow/progress.js +362 -0
  170. package/dist/workflow/progress.js.map +1 -0
  171. package/dist/workflow/runtime.d.ts +335 -0
  172. package/dist/workflow/runtime.d.ts.map +1 -0
  173. package/dist/workflow/runtime.js +831 -0
  174. package/dist/workflow/runtime.js.map +1 -0
  175. package/dist/workflow/saved.d.ts +91 -0
  176. package/dist/workflow/saved.d.ts.map +1 -0
  177. package/dist/workflow/saved.js +204 -0
  178. package/dist/workflow/saved.js.map +1 -0
  179. package/dist/workflow/task.d.ts +137 -0
  180. package/dist/workflow/task.d.ts.map +1 -0
  181. package/dist/workflow/task.js +208 -0
  182. package/dist/workflow/task.js.map +1 -0
  183. package/dist/workflow/tool-description.d.ts +39 -0
  184. package/dist/workflow/tool-description.d.ts.map +1 -0
  185. package/dist/workflow/tool-description.js +200 -0
  186. package/dist/workflow/tool-description.js.map +1 -0
  187. package/dist/workflow/worker-source.d.ts +48 -0
  188. package/dist/workflow/worker-source.d.ts.map +1 -0
  189. package/dist/workflow/worker-source.js +779 -0
  190. package/dist/workflow/worker-source.js.map +1 -0
  191. package/dist/worktree.d.ts +10 -3
  192. package/dist/worktree.d.ts.map +1 -1
  193. package/dist/worktree.js +58 -54
  194. package/dist/worktree.js.map +1 -1
  195. package/dist/xml.d.ts +11 -0
  196. package/dist/xml.d.ts.map +1 -0
  197. package/dist/xml.js +13 -0
  198. package/dist/xml.js.map +1 -0
  199. package/docs/rpc.md +183 -0
  200. package/docs/superpowers/plans/2026-09-30-conversation-viewer-scrollbar.md +216 -0
  201. package/docs/superpowers/plans/2026-09-30-upstream-event-workflow-partial-history.md +195 -0
  202. package/docs/superpowers/specs/2026-09-30-conversation-viewer-scrollbar-design.md +82 -0
  203. package/docs/superpowers/specs/2026-09-30-upstream-event-workflow-partial-history-design.md +49 -0
  204. package/docs/workflows.md +437 -0
  205. package/examples/agent-tool-description.md +7 -7
  206. package/examples/workflows/compose.js +51 -0
  207. package/examples/workflows/fan-out-audit.js +47 -0
  208. package/examples/workflows/gated-fix.js +60 -0
  209. package/examples/workflows/lib/count-child.js +27 -0
  210. package/examples/workflows/review-panel.js +63 -0
  211. package/examples/workflows/structured-findings.js +78 -0
  212. package/package.json +1 -1
  213. package/src/abortable.ts +43 -0
  214. package/src/agent-color.ts +161 -0
  215. package/src/agent-file-toggle.ts +269 -0
  216. package/src/agent-history.ts +54 -2
  217. package/src/agent-manager.ts +1263 -402
  218. package/src/agent-runner.ts +251 -27
  219. package/src/agent-types.ts +188 -32
  220. package/src/child-context.ts +15 -0
  221. package/src/cross-extension-rpc.ts +96 -20
  222. package/src/custom-agents.ts +170 -13
  223. package/src/index.ts +2024 -537
  224. package/src/invocation-config.ts +118 -3
  225. package/src/mention-clone.ts +196 -0
  226. package/src/mention.ts +141 -0
  227. package/src/model-resolver.ts +18 -0
  228. package/src/model-scope.ts +70 -0
  229. package/src/nested-tools.ts +424 -0
  230. package/src/output-file.ts +61 -6
  231. package/src/prompts.ts +45 -2
  232. package/src/schedule.ts +35 -14
  233. package/src/settings.ts +312 -2
  234. package/src/status-note.ts +66 -1
  235. package/src/structured-output.ts +130 -0
  236. package/src/types.ts +177 -10
  237. package/src/ui/agent-mention.ts +216 -0
  238. package/src/ui/agent-widget.ts +389 -441
  239. package/src/ui/conversation-blocks.ts +6 -0
  240. package/src/ui/conversation-timeline.ts +139 -25
  241. package/src/ui/conversation-viewer.ts +284 -69
  242. package/src/ui/fleet-list.ts +558 -0
  243. package/src/ui/schedule-menu.ts +9 -8
  244. package/src/ui/select-item.ts +45 -0
  245. package/src/ui/workflow-card.ts +470 -0
  246. package/src/ui/workflow-dialog.ts +1115 -0
  247. package/src/ui/workflow-menu.ts +193 -0
  248. package/src/usage.ts +109 -2
  249. package/src/workflow/collisions.ts +123 -0
  250. package/src/workflow/entry.ts +47 -0
  251. package/src/workflow/host.ts +403 -0
  252. package/src/workflow/journal.ts +164 -0
  253. package/src/workflow/json-schema.ts +128 -0
  254. package/src/workflow/meta.ts +325 -0
  255. package/src/workflow/progress.ts +550 -0
  256. package/src/workflow/runtime.ts +1219 -0
  257. package/src/workflow/saved.ts +217 -0
  258. package/src/workflow/task.ts +302 -0
  259. package/src/workflow/tool-description.ts +200 -0
  260. package/src/workflow/worker-source.ts +781 -0
  261. package/src/worktree.ts +69 -55
  262. package/src/xml.ts +13 -0
  263. package/vitest.config.ts +0 -18
@@ -0,0 +1,188 @@
1
+ /**
2
+ * agent-mention.ts — what `@` can address, and the suggestions pi renders for it.
3
+ *
4
+ * A subagent is addressable whether or not it is currently running: a live
5
+ * record is messaged or resumed, an evicted one whose session is still on disk
6
+ * is reopened, and an agent *type* with no instance at all is started. That is
7
+ * the point of the handle — `@explore` means the Explore agent, not "the
8
+ * Explore process that happens to exist right now" — so the roster below unions
9
+ * all three, and the dispatcher and the popup read the same list.
10
+ *
11
+ * Rows are per *agent*, not per handle. An agent given a `name` holds two names
12
+ * (its alias and its type-derived handle) and both resolve, but it lists once,
13
+ * under the alias, with its type moved into the description so the row still
14
+ * says what it is.
15
+ *
16
+ * pi's `CombinedAutocompleteProvider` already owns `@`, where it means "attach a
17
+ * file". Extensions can wrap it (`ctx.ui.addAutocompleteProvider`), so this
18
+ * provider adds the `@` tokens that name an agent and delegates everything else
19
+ * — including all of `applyCompletion`, whose `@`-branch already inserts
20
+ * `item.value` plus a trailing space, which is exactly what a handle needs.
21
+ *
22
+ * Matching mirrors Claude Code: case-insensitive prefix, not fuzzy. What it does
23
+ * NOT mirror is Claude Code dropping files whenever an agent matches. Here `@` is
24
+ * pi's file picker first, and the handles are additive, so a token matching both
25
+ * lists both — agents first. Suppressing on any match sounds narrow and is not:
26
+ * an empty token prefix-matches every handle, so a bare `@` — the gesture people
27
+ * use to browse files — would offer no files at all, and a single letter
28
+ * beginning any handle would do the same.
29
+ *
30
+ * Both halves ship under ONE `prefix`, which is sound because wherever BOTH sides
31
+ * produce rows they measured the same span. pi's `extractAtPrefix` takes the
32
+ * token after the last of `{space, tab, ", ', =}` and keeps it only if it starts
33
+ * with `@`; `MENTION_TRIGGER` matches `@[\w-]*` at the cursor, after start-of-line
34
+ * or `[\s。、?!]`. Where those two disagree, exactly one side answers and there
35
+ * is nothing to merge: `@src/index.ts` and `@"my file` are pi's alone (no handle
36
+ * matches), `=@ex` is pi's alone (`=` is a delimiter to pi, not a boundary to us),
37
+ * and `。@ex` is ours alone (the reverse). A merged response therefore never
38
+ * carries a prefix from one side and an item from the other.
39
+ *
40
+ * Offering never-started types is a deliberate step beyond Claude Code, whose
41
+ * registry holds only live tasks, so an agent you had not launched yet was
42
+ * unaddressable.
43
+ */
44
+ import { handleBase, MENTION_TRIGGER } from "../mention.js";
45
+ /**
46
+ * Everything `@` can reach, in the order the popup lists it: steerable agents
47
+ * first, then the other live ones earliest-launched, then agent types with no
48
+ * live instance. A type whose handle a record already holds is omitted — that
49
+ * name addresses the existing agent, which is what makes `@explore` mean
50
+ * "message the one that's running" and only otherwise "start one".
51
+ */
52
+ export function mentionRoster(manager, types,
53
+ // Identity by default: a caller with no registry to consult gets the raw
54
+ // type, which is also what `getConfig` falls back to when no label is set.
55
+ displayNameOf = type => type) {
56
+ const live = (r) => r.status === "running" || r.status === "queued";
57
+ const records = manager.listAgents()
58
+ .filter(r => r.handle !== undefined && r.parentAgentId === undefined)
59
+ .sort((a, b) => (Number(live(b)) - Number(live(a))) || (a.startedAt - b.startedAt));
60
+ const taken = new Set();
61
+ const targets = [];
62
+ // One row per agent, not per handle. An aliased agent lists under its alias
63
+ // only — both names resolve, but showing two rows for one agent reads as two
64
+ // agents. The type handle stays addressable whether or not it is listed.
65
+ for (const record of records) {
66
+ const handle = record.alias ?? record.handle;
67
+ taken.add(handle.toLowerCase());
68
+ if (record.handle)
69
+ taken.add(record.handle.toLowerCase());
70
+ targets.push({ kind: "record", handle, record, typeLabel: displayNameOf(record.type) });
71
+ }
72
+ // Then agents that are gone but whose conversation can be reopened. After the
73
+ // live ones: a running agent is the likelier target, and this keeps the
74
+ // ordering "what exists now, then what can be brought back, then what can be
75
+ // started".
76
+ for (const entry of manager.listTombstones()) {
77
+ const handle = entry.alias ?? entry.handle;
78
+ if (taken.has(handle.toLowerCase()))
79
+ continue;
80
+ taken.add(handle.toLowerCase());
81
+ taken.add(entry.handle.toLowerCase());
82
+ targets.push({ kind: "tombstone", handle, entry, typeLabel: displayNameOf(entry.type) });
83
+ }
84
+ for (const type of types) {
85
+ const handle = handleBase(type.name);
86
+ if (taken.has(handle))
87
+ continue;
88
+ taken.add(handle);
89
+ targets.push({ kind: "type", handle, type: type.name, description: type.description });
90
+ }
91
+ return targets;
92
+ }
93
+ export function createMentionProvider(current, roster, isEnabled) {
94
+ // One warning per provider, not per keystroke: `getSuggestions` runs on every
95
+ // character typed after `@`, so an unguarded log would bury the terminal in
96
+ // the time it takes to finish a word.
97
+ let warnedInnerFailure = false;
98
+ return {
99
+ // Only `@` — the contract is "characters that should naturally trigger
100
+ // THIS provider", and pi unions each wrapper's own set onto the outermost
101
+ // one itself (interactive-mode.js:432), so re-declaring the wrapped
102
+ // provider's characters here would both misreport us and duplicate that.
103
+ triggerCharacters: ["@"],
104
+ async getSuggestions(lines, cursorLine, cursorCol, options) {
105
+ const mine = isEnabled() ? mentionItems(roster(), lines[cursorLine] ?? "", cursorCol) : null;
106
+ // Asked unconditionally: pi owns `@` and must keep answering for it even
107
+ // when a handle matches too. That is the same work vanilla pi does on any
108
+ // `@` keystroke — a capped `fd` search, or nothing at all when the host
109
+ // configured no `fd` path — but we now do it on tokens we used to answer
110
+ // alone, so it must not be able to take the popup down with it. The
111
+ // wrapped provider is not always pi's: another extension may sit inside
112
+ // us, and before this it was never called for a token naming an agent.
113
+ // try/catch, not `.catch()`: a provider that throws SYNCHRONOUSLY never
114
+ // returns the promise a `.catch()` would attach to, and the throw escapes
115
+ // this method as a rejection — which pi does not handle either
116
+ // (components/editor.js:1892 awaits with no catch of its own).
117
+ let theirs = null;
118
+ try {
119
+ theirs = await current.getSuggestions(lines, cursorLine, cursorCol, options);
120
+ }
121
+ catch (err) {
122
+ // Safe to treat as "no files": pi discards any response whose request is
123
+ // no longer current, so an aborted search that surfaces as a rejection
124
+ // cannot leave a stale popup behind (`isAutocompleteRequestCurrent`).
125
+ // Warned rather than swallowed outright — the failure is invisible in
126
+ // the popup, and the same `console.warn` channel already carries this
127
+ // extension's other non-fatal failures.
128
+ if (!warnedInnerFailure) {
129
+ warnedInnerFailure = true;
130
+ console.warn("[pi-subagents] the autocomplete provider below us failed; showing agent rows only:", err);
131
+ }
132
+ theirs = null;
133
+ }
134
+ if (!mine)
135
+ return theirs;
136
+ if (!theirs)
137
+ return mine;
138
+ // Agents first: there are a handful of them against pi's 20 file rows, and
139
+ // a handle buried under fuzzy path matches is a handle nobody finds. The
140
+ // prefix is ours by the span argument in the header — identical to pi's
141
+ // whenever both sides have something to say.
142
+ return { items: [...mine.items, ...theirs.items], prefix: mine.prefix };
143
+ },
144
+ applyCompletion(lines, cursorLine, cursorCol, item, prefix) {
145
+ return current.applyCompletion(lines, cursorLine, cursorCol, item, prefix);
146
+ },
147
+ shouldTriggerFileCompletion(lines, cursorLine, cursorCol) {
148
+ return current.shouldTriggerFileCompletion?.(lines, cursorLine, cursorCol) ?? true;
149
+ },
150
+ };
151
+ }
152
+ /** Suggestions for the `@…` token under the cursor, or null when it names no agent. */
153
+ function mentionItems(roster, line, cursorCol) {
154
+ const match = MENTION_TRIGGER.exec(line.slice(0, cursorCol));
155
+ if (!match)
156
+ return null;
157
+ const typed = match[2].toLowerCase();
158
+ const items = [];
159
+ for (const target of roster) {
160
+ if (!target.handle.toLowerCase().startsWith(typed))
161
+ continue;
162
+ items.push({ value: `@${target.handle}`, label: `@${target.handle}`, description: describeTarget(target) });
163
+ }
164
+ return items.length > 0 ? { items, prefix: `@${match[2]}` } : null;
165
+ }
166
+ /** Name the action that will actually happen, so the list never mispromises. */
167
+ function describeTarget(target) {
168
+ if (target.kind === "type")
169
+ return `start agent · ${summarize(target.description)}`;
170
+ if (target.kind === "tombstone") {
171
+ // No status: the record is gone, and "completed" would imply one is still
172
+ // being tracked. The type carries the identity the handle may not.
173
+ return `resume · ${target.typeLabel} · ${target.entry.description}`;
174
+ }
175
+ const { status, description, alias } = target.record;
176
+ const action = status === "running" || status === "queued" ? "send message" : "resume";
177
+ // A row listed under its alias has lost the type its handle would have shown,
178
+ // so name it — `@auth-audit` alone says nothing about what the agent is.
179
+ // A type-derived row already reads as its type and would just repeat itself.
180
+ const identity = alias ? `${target.typeLabel} · ` : "";
181
+ return `${action} · ${identity}${status} · ${description}`;
182
+ }
183
+ /** First sentence of an agent description, clipped — these run to paragraphs. */
184
+ function summarize(description) {
185
+ const first = (description.match(/^.*?[.!?](?=\s|$)/s)?.[0] ?? description).replace(/\s+/g, " ").trim();
186
+ return first.length > 60 ? `${first.slice(0, 59).trimEnd()}…` : first;
187
+ }
188
+ //# sourceMappingURL=agent-mention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-mention.js","sourceRoot":"","sources":["../../src/ui/agent-mention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAiB5D;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAqB,EACrB,KAA0B;AAC1B,yEAAyE;AACzE,2EAA2E;AAC3E,gBAA0C,IAAI,CAAC,EAAE,CAAC,IAAI;IAEtD,MAAM,IAAI,GAAG,CAAC,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC;IACjF,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,aAAa,KAAK,SAAS,CAAC;SACpE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,MAAM,CAAC,MAAM,CAAC;IACrD,MAAM,MAAM,GAAG,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvF,8EAA8E;IAC9E,yEAAyE;IACzE,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,OAAO,GAAG,MAAM,MAAM,QAAQ,GAAG,MAAM,MAAM,WAAW,EAAE,CAAC;AAC7D,CAAC;AAED,iFAAiF;AACjF,SAAS,SAAS,CAAC,WAAmB;IACpC,MAAM,KAAK,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACxG,OAAO,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACxE,CAAC"}
@@ -4,17 +4,18 @@
4
4
  * Displays a tree of agents with animated spinners, live stats, and activity descriptions.
5
5
  * Uses the callback form of setWidget for themed rendering.
6
6
  */
7
- import type { AgentManager } from "../agent-manager.js";
8
- import type { AgentInvocation, AgentRecord, SubagentType, WidgetMode } from "../types.js";
7
+ import { type AgentManager } from "../agent-manager.js";
8
+ import type { AgentInvocation, SubagentType, WidgetMode } from "../types.js";
9
9
  import { type LifetimeUsage, type SessionLike } from "../usage.js";
10
10
  /** Maximum number of rendered lines before overflow collapse kicks in. */
11
11
  export declare const MAX_WIDGET_LINES = 12;
12
- /**
13
- * Derive the widget ceiling from the terminal height while retaining the
14
- * historical MAX_WIDGET_LINES ceiling. Very short terminals may have no room
15
- * for the widget; that is preferable to consuming the editor/input area.
16
- */
17
- export declare function getWidgetLineBudget(rows: number): number;
12
+ /** Number of lines available above an editor, retaining room for the prompt. */
13
+ export declare function getWidgetLineBudget(terminalRows: number): number;
14
+ export type AgentWidgetOpenMode = "live" | "history";
15
+ export interface AgentWidgetOptions {
16
+ canOpenHistory?: (record: import("../types.js").AgentRecord) => boolean;
17
+ onOpen?: (record: import("../types.js").AgentRecord, mode: AgentWidgetOpenMode) => void;
18
+ }
18
19
  /** Braille spinner frames for animated running indicator. */
19
20
  export declare const SPINNER: string[];
20
21
  /** Statuses that indicate an error/non-success outcome (used for linger behavior and icon rendering). */
@@ -23,18 +24,6 @@ export type Theme = {
23
24
  fg(color: string, text: string): string;
24
25
  bold(text: string): string;
25
26
  };
26
- export type AgentWidgetOpenMode = "live" | "history";
27
- export type AgentWidgetOpenCallback = (record: AgentRecord, mode: AgentWidgetOpenMode) => void | Promise<void>;
28
- export type AgentWidgetOptions = {
29
- canOpenHistory: (record: AgentRecord) => boolean;
30
- onOpen: AgentWidgetOpenCallback;
31
- };
32
- /** @deprecated Use AgentWidgetOpenMode. */
33
- export type AgentOpenMode = AgentWidgetOpenMode;
34
- /** @deprecated Use AgentWidgetOpenCallback. */
35
- export type AgentOpenCallback = AgentWidgetOpenCallback;
36
- /** @deprecated Use AgentWidgetOptions.canOpenHistory. */
37
- export type AgentHistoryCapability = AgentWidgetOptions["canOpenHistory"];
38
27
  export type UICtx = {
39
28
  setStatus(key: string, text: string | undefined): void;
40
29
  setWidget(key: string, content: undefined | ((tui: any, theme: Theme) => {
@@ -43,11 +32,11 @@ export type UICtx = {
43
32
  }), options?: {
44
33
  placement?: "aboveEditor" | "belowEditor";
45
34
  }): void;
46
- onTerminalInput(handler: (data: string) => {
35
+ onTerminalInput?(handler: (data: string) => {
47
36
  consume?: boolean;
48
37
  data?: string;
49
38
  } | undefined): () => void;
50
- getEditorText(): string;
39
+ getEditorText?(): string;
51
40
  };
52
41
  /** Per-agent live activity state. */
53
42
  export interface AgentActivity {
@@ -59,7 +48,7 @@ export interface AgentActivity {
59
48
  turnCount: number;
60
49
  /** Effective max turns for this agent (undefined = unlimited). */
61
50
  maxTurns?: number;
62
- /** Lifetime usage breakdown — see LifetimeUsage docs. */
51
+ /** Lifetime token usage, including partial runs. */
63
52
  lifetimeUsage: LifetimeUsage;
64
53
  }
65
54
  /** Metadata attached to Agent tool results for custom rendering. */
@@ -75,7 +64,7 @@ export interface AgentDetails {
75
64
  activity?: string;
76
65
  /** Current spinner frame index (for animated running indicator). */
77
66
  spinnerFrame?: number;
78
- /** Short model name if different from parent (e.g. "haiku", "sonnet"). */
67
+ /** Short label for the model the run used, e.g. "haiku 4.5". */
79
68
  modelName?: string;
80
69
  /** Notable config tags (e.g. ["thinking: high", "isolated"]). */
81
70
  tags?: string[];
@@ -83,6 +72,8 @@ export interface AgentDetails {
83
72
  turnCount?: number;
84
73
  /** Effective max turns (undefined = unlimited). */
85
74
  maxTurns?: number;
75
+ /** Estimated cost in USD; 0 when the model has no pricing data. */
76
+ cost?: number;
86
77
  agentId?: string;
87
78
  error?: string;
88
79
  }
@@ -90,6 +81,20 @@ export interface AgentDetails {
90
81
  export declare function fgPreservingNestedStyles(theme: Theme, color: string, text: string): string;
91
82
  /** Format a token count compactly: "33.8k token", "1.2M token". */
92
83
  export declare function formatTokens(count: number): string;
84
+ /**
85
+ * Format a cost as `~$0.0042`, or "" when there is nothing to show.
86
+ *
87
+ * The tilde is load-bearing: this is pi's own estimate from the model's listed
88
+ * rates, not a billed figure, and the surfaces that print it sit next to token
89
+ * counts that ARE exact.
90
+ *
91
+ * Nothing is printed for zero, which is also what a model with no pricing data
92
+ * reports: `$0.00` beside a local model's tokens would claim its cost was
93
+ * measured and found to be nothing, rather than never measured at all. For the
94
+ * same reason a real cost too small for four decimals reads `<$0.0001` — it was
95
+ * measured, and rounding it to `~$0.0000` would say the opposite.
96
+ */
97
+ export declare function formatCost(cost: number): string;
93
98
  /**
94
99
  * Token count with optional context-fill % and compaction-count annotations.
95
100
  * Thresholds for percent: <70% dim, 70–85% warning, ≥85% error.
@@ -111,9 +116,16 @@ export declare function formatDuration(startedAt: number, completedAt?: number):
111
116
  export declare function getDisplayName(type: SubagentType): string;
112
117
  /** Short label for prompt mode: "twin" for append, nothing for replace (the default). */
113
118
  export declare function getPromptModeLabel(type: SubagentType): string | undefined;
114
- /** Mode label is not included — callers add it where they want it. */
119
+ /**
120
+ * Mode label is not included — callers add it where they want it.
121
+ *
122
+ * Both model forms come back so each surface can pick by width; the
123
+ * "(asked X)" annotation is applied here rather than by callers, so a value the
124
+ * spawn did not honor cannot be rendered as though it had been (#182).
125
+ */
115
126
  export declare function buildInvocationTags(invocation: AgentInvocation | undefined): {
116
127
  modelName?: string;
128
+ modelId?: string;
117
129
  tags: string[];
118
130
  };
119
131
  /** Build a human-readable activity string from currently-running tools or response text. */
@@ -121,32 +133,54 @@ export declare function describeActivity(activeTools: Map<string, string>, respo
121
133
  export declare class AgentWidget {
122
134
  private manager;
123
135
  private agentActivity;
124
- /** Read live at render time. Selects which agents the widget shows. */
136
+ /**
137
+ * Read live at render time. Selects which agents the widget shows — see
138
+ * `WidgetMode`. Defaults to `"all"` when a caller supplies no policy; the
139
+ * extension supplies one defaulting to `"background"`.
140
+ */
125
141
  private mode;
126
- private options;
127
142
  private uiCtx;
128
143
  private widgetFrame;
129
144
  private widgetInterval;
130
- private inputUnsub;
131
- /** Whether arrow keys currently navigate the agent roster. */
132
- private navigationActive;
133
- /** Stable identity of the selected row, so roster changes do not jump selection. */
134
- private selectedAgentId;
135
- /** Last logical roster index of the selected row, used when it disappears. */
136
- private selectedRosterIndex;
137
- /** First logical row currently represented by the bounded viewport. */
138
- private viewportStart;
145
+ /** Tracks how many turns each finished agent has survived. Key: agent ID, Value: turns since finished. */
146
+ private finishedTurnAge;
147
+ /** How many extra turns errors/aborted agents linger (completed agents clear after 1 turn). */
148
+ private static readonly ERROR_LINGER_TURNS;
139
149
  /** Whether the widget callback is currently registered with the TUI. */
140
150
  private widgetRegistered;
141
151
  /** Cached TUI reference from widget factory callback, used for requestRender(). */
142
152
  private tui;
143
153
  /** Last status bar text, used to avoid redundant setStatus calls. */
144
154
  private lastStatusText;
145
- /** Snapshot of the state used for the last widget registration/render request. */
146
- private lastRenderKey;
155
+ private lastSnapshot;
156
+ private inputCleanup;
157
+ private navigationActive;
158
+ private selectedAgentId;
159
+ private viewportStart;
160
+ private selectedRosterIndex;
161
+ private openOptions;
162
+ private showCost;
163
+ private showModel;
147
164
  constructor(manager: AgentManager, agentActivity: Map<string, AgentActivity>,
148
- /** Read live at render time. Selects which agents the widget shows. */
149
- mode?: () => WidgetMode, options?: AgentWidgetOptions);
165
+ /**
166
+ * Read live at render time. Selects which agents the widget shows — see
167
+ * `WidgetMode`. Defaults to `"all"` when a caller supplies no policy; the
168
+ * extension supplies one defaulting to `"background"`.
169
+ */
170
+ mode?: () => WidgetMode,
171
+ /**
172
+ * Read live at render time, like `mode`. Whether running agents show an
173
+ * estimated cost beside their token count. Defaults to off — the extension
174
+ * supplies the user's `showCost` setting.
175
+ */
176
+ /**
177
+ * Read live at render time, like `mode`. Whether running agents name the
178
+ * model driving them and the thinking level it is running at. Defaults to
179
+ * off — the extension supplies the user's `showModel` setting — because the
180
+ * row is already dense and the same pair is on the tool result and in the
181
+ * conversation viewer unconditionally.
182
+ */
183
+ showCostOrOptions?: (() => boolean) | AgentWidgetOptions, showModel?: () => boolean);
150
184
  /**
151
185
  * Agents eligible for the widget, per the current `WidgetMode`:
152
186
  * - `off`: none (the widget's existing empty-state path hides it entirely).
@@ -160,41 +194,30 @@ export declare class AgentWidget {
160
194
  */
161
195
  private widgetAgents;
162
196
  /** Set the UI context (grabbed from first tool execution). */
163
- setUICtx(ctx: UICtx): boolean;
164
- /** Request a render on the currently registered TUI without touching input. */
165
- requestUiRefresh(force?: boolean): boolean;
166
- /** Called on each new turn (tool_execution_start). */
167
- onTurnStart(): void;
168
- /** Keep the spinner/elapsed-time timer alive only while a visible agent runs. */
169
- ensureTimer(): void;
170
- private syncTimer;
197
+ setUICtx(ctx: UICtx): void;
171
198
  /**
172
- * Retained for the lifecycle call sites. Terminal visibility is determined
173
- * by the manager record and the history capability, not a one-turn timer.
199
+ * Called on each new turn (tool_execution_start).
200
+ * Ages finished agents and clears those that have lingered long enough.
174
201
  */
175
- markFinished(_agentId: string): void;
202
+ onTurnStart(): void;
203
+ /** Ensure the widget update timer is running. */
204
+ ensureTimer(): void;
205
+ /** Check if a finished agent should still be shown in the widget. */
206
+ private shouldShowFinished;
207
+ /** Record an agent as finished (call when agent completes). */
208
+ markFinished(agentId: string): void;
176
209
  /**
177
- * Records represented by selectable rows in the above-editor widget.
178
- *
179
- * Keep this order as the single source of truth for both rendering and key
180
- * navigation. `listAgents()` is newest-first; active rows come first so the
181
- * panel exposes currently useful work before terminal history.
210
+ * Drop an agent's finished-age (call when a settled agent starts running
211
+ * again, i.e. a background resume). markFinished only seeds an age it has not
212
+ * seen before, so a resumed agent would otherwise keep the age from its
213
+ * previous run — already past the linger limit, hiding the new run's
214
+ * completion line entirely.
182
215
  */
183
- private roster;
184
- /** True when pi's prompt editor owns the keyboard. */
185
- private editorHasFocus;
186
- private selectedIndexOf;
187
- private deactivate;
188
- /** Resume navigation from the retained row, or select the first row. */
189
- private activate;
190
- /** Move the selected row, activating only from an empty focused editor. */
191
- private moveSelection;
192
- private openSelected;
193
- /** Handle terminal input before it reaches the focused prompt editor. */
194
- handleKey(data: string): {
195
- consume?: boolean;
196
- data?: string;
197
- } | undefined;
216
+ markRunning(agentId: string): void;
217
+ private navigationAgents;
218
+ private updateViewport;
219
+ private handleInput;
220
+ private requestUiRefresh;
198
221
  /** Render a finished agent line. */
199
222
  private renderFinishedLine;
200
223
  /**
@@ -202,10 +225,8 @@ export declare class AgentWidget {
202
225
  * reading live state each time instead of capturing it in a closure.
203
226
  */
204
227
  private renderWidget;
205
- /** Build a render-relevant snapshot without capturing mutable records. */
206
- private renderKey;
207
- /** Force an immediate widget update. `advanceSpinner` is reserved for the timer. */
208
- update(advanceSpinner?: boolean): void;
228
+ /** Force an immediate widget update. */
229
+ update(): void;
209
230
  dispose(): void;
210
231
  }
211
232
  //# sourceMappingURL=agent-widget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-widget.d.ts","sourceRoot":"","sources":["../../src/ui/agent-widget.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAA8C,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/G,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAInC;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED,6DAA6D;AAC7D,eAAO,MAAM,OAAO,UAAqD,CAAC;AAE1E,yGAAyG;AACzG,eAAO,MAAM,cAAc,aAAsD,CAAC;AAelF,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAAC;AACrD,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/G,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IACjD,MAAM,EAAE,uBAAuB,CAAC;CACjC,CAAC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