@mirrowel/opencode-subagent-explorer 0.2.0-dev.2 → 0.2.0-dev.3

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/dist/sessions.js CHANGED
@@ -188,7 +188,13 @@ export async function fetchVariantAttribution(client, parentSessionID, directory
188
188
  const metadata = part.state?.metadata;
189
189
  const child = metadata?.sessionId;
190
190
  const variantMeta = metadata?.agentVariants;
191
- const alias = variantMeta?.alias;
191
+ // Two alias sources: the after-hook metadata stamp (terminal
192
+ // completed parts) and the before-hook description annotation -
193
+ // aborted/error parts never receive the metadata stamp, but the
194
+ // annotation ("(@alias variant)" appended at call time) persists.
195
+ const description = part.state?.input?.description;
196
+ const descriptionMatch = typeof description === "string" ? description.match(/\s+\(@(\S+) variant\)$/) : undefined;
197
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? descriptionMatch?.[1];
192
198
  const routedAgent = variantMeta?.routedAgent;
193
199
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
194
200
  map.set(child, {
package/dist/tui.js CHANGED
@@ -211,7 +211,9 @@ async function fetchVariantAttribution(client, parentSessionID, directory, avPar
211
211
  const metadata = part.state?.metadata;
212
212
  const child = metadata?.sessionId;
213
213
  const variantMeta = metadata?.agentVariants;
214
- const alias = variantMeta?.alias;
214
+ const description = part.state?.input?.description;
215
+ const descriptionMatch = typeof description === "string" ? description.match(/\s+\(@(\S+) variant\)$/) : undefined;
216
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? descriptionMatch?.[1];
215
217
  const routedAgent = variantMeta?.routedAgent;
216
218
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
217
219
  map.set(child, {
package/dist/wizard.js CHANGED
@@ -158,7 +158,9 @@ async function fetchVariantAttribution(client, parentSessionID, directory, avPar
158
158
  const metadata = part.state?.metadata;
159
159
  const child = metadata?.sessionId;
160
160
  const variantMeta = metadata?.agentVariants;
161
- const alias = variantMeta?.alias;
161
+ const description = part.state?.input?.description;
162
+ const descriptionMatch = typeof description === "string" ? description.match(/\s+\(@(\S+) variant\)$/) : undefined;
163
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? descriptionMatch?.[1];
162
164
  const routedAgent = variantMeta?.routedAgent;
163
165
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
164
166
  map.set(child, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirrowel/opencode-subagent-explorer",
3
- "version": "0.2.0-dev.2",
3
+ "version": "0.2.0-dev.3",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for exploring and cleaning up subagent sessions of the current session",
6
6
  "license": "MIT",
package/src/sessions.ts CHANGED
@@ -227,7 +227,13 @@ export async function fetchVariantAttribution(
227
227
  const metadata = part.state?.metadata as Record<string, any> | undefined
228
228
  const child = metadata?.sessionId
229
229
  const variantMeta = metadata?.agentVariants as Record<string, unknown> | undefined
230
- const alias = variantMeta?.alias
230
+ // Two alias sources: the after-hook metadata stamp (terminal
231
+ // completed parts) and the before-hook description annotation -
232
+ // aborted/error parts never receive the metadata stamp, but the
233
+ // annotation ("(@alias variant)" appended at call time) persists.
234
+ const description = part.state?.input?.description
235
+ const descriptionMatch = typeof description === "string" ? description.match(/\s+\(@(\S+) variant\)$/) : undefined
236
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? descriptionMatch?.[1]
231
237
  const routedAgent = variantMeta?.routedAgent
232
238
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
233
239
  map.set(child, {