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

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
@@ -191,10 +191,12 @@ export async function fetchVariantAttribution(client, parentSessionID, directory
191
191
  // Two alias sources: the after-hook metadata stamp (terminal
192
192
  // completed parts) and the before-hook description annotation -
193
193
  // aborted/error parts never receive the metadata stamp, but the
194
- // annotation ("(@alias variant)" appended at call time) persists.
194
+ // annotation persists. Reads every historical annotation form:
195
+ // legacy "(@x variant)", terse "(@x)", switch "(@x ← y)".
195
196
  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];
197
+ const descriptionMatch = typeof description === "string" ? [...description.matchAll(/\(@\s*([^()@←]*?)\s*(?:\s+variant)?\s*(?:\s*←\s*[^()@←]*?)?\s*\)/g)].at(-1) : undefined;
198
+ const descriptionAlias = (descriptionMatch?.[1] ?? "").trim();
199
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? (descriptionAlias !== "" ? descriptionAlias : undefined);
198
200
  const routedAgent = variantMeta?.routedAgent;
199
201
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
200
202
  map.set(child, {
package/dist/tui.js CHANGED
@@ -212,8 +212,9 @@ async function fetchVariantAttribution(client, parentSessionID, directory, avPar
212
212
  const child = metadata?.sessionId;
213
213
  const variantMeta = metadata?.agentVariants;
214
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
+ const descriptionMatch = typeof description === "string" ? [...description.matchAll(/\(@\s*([^()@\u2190]*?)\s*(?:\s+variant)?\s*(?:\s*\u2190\s*[^()@\u2190]*?)?\s*\)/g)].at(-1) : undefined;
216
+ const descriptionAlias = (descriptionMatch?.[1] ?? "").trim();
217
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? (descriptionAlias !== "" ? descriptionAlias : undefined);
217
218
  const routedAgent = variantMeta?.routedAgent;
218
219
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
219
220
  map.set(child, {
package/dist/wizard.js CHANGED
@@ -159,8 +159,9 @@ async function fetchVariantAttribution(client, parentSessionID, directory, avPar
159
159
  const child = metadata?.sessionId;
160
160
  const variantMeta = metadata?.agentVariants;
161
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
+ const descriptionMatch = typeof description === "string" ? [...description.matchAll(/\(@\s*([^()@\u2190]*?)\s*(?:\s+variant)?\s*(?:\s*\u2190\s*[^()@\u2190]*?)?\s*\)/g)].at(-1) : undefined;
163
+ const descriptionAlias = (descriptionMatch?.[1] ?? "").trim();
164
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? (descriptionAlias !== "" ? descriptionAlias : undefined);
164
165
  const routedAgent = variantMeta?.routedAgent;
165
166
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
166
167
  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.3",
3
+ "version": "0.2.0-dev.4",
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
@@ -230,10 +230,13 @@ export async function fetchVariantAttribution(
230
230
  // Two alias sources: the after-hook metadata stamp (terminal
231
231
  // completed parts) and the before-hook description annotation -
232
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]
233
+ // annotation persists. Reads every historical annotation form:
234
+ // legacy "(@x variant)", terse "(@x)", switch "(@x ← y)".
235
+ const description: unknown = part.state?.input?.description
236
+ const descriptionMatch =
237
+ typeof description === "string" ? [...description.matchAll(/\(@\s*([^()@←]*?)\s*(?:\s+variant)?\s*(?:\s*←\s*[^()@←]*?)?\s*\)/g)].at(-1) : undefined
238
+ const descriptionAlias = (descriptionMatch?.[1] ?? "").trim()
239
+ const alias = (typeof variantMeta?.alias === "string" ? variantMeta.alias : undefined) ?? (descriptionAlias !== "" ? descriptionAlias : undefined)
237
240
  const routedAgent = variantMeta?.routedAgent
238
241
  if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
239
242
  map.set(child, {