@mirrowel/opencode-subagent-explorer 0.2.0-dev.2 → 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 +9 -1
- package/dist/tui.js +4 -1
- package/dist/wizard.js +4 -1
- package/package.json +1 -1
- package/src/sessions.ts +10 -1
package/dist/sessions.js
CHANGED
|
@@ -188,7 +188,15 @@ 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
|
-
|
|
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 persists. Reads every historical annotation form:
|
|
195
|
+
// legacy "(@x variant)", terse "(@x)", switch "(@x ← y)".
|
|
196
|
+
const description = part.state?.input?.description;
|
|
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);
|
|
192
200
|
const routedAgent = variantMeta?.routedAgent;
|
|
193
201
|
if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
|
|
194
202
|
map.set(child, {
|
package/dist/tui.js
CHANGED
|
@@ -211,7 +211,10 @@ 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
|
|
214
|
+
const description = part.state?.input?.description;
|
|
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);
|
|
215
218
|
const routedAgent = variantMeta?.routedAgent;
|
|
216
219
|
if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
|
|
217
220
|
map.set(child, {
|
package/dist/wizard.js
CHANGED
|
@@ -158,7 +158,10 @@ 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
|
|
161
|
+
const description = part.state?.input?.description;
|
|
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);
|
|
162
165
|
const routedAgent = variantMeta?.routedAgent;
|
|
163
166
|
if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
|
|
164
167
|
map.set(child, {
|
package/package.json
CHANGED
package/src/sessions.ts
CHANGED
|
@@ -227,7 +227,16 @@ 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
|
-
|
|
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 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)
|
|
231
240
|
const routedAgent = variantMeta?.routedAgent
|
|
232
241
|
if (typeof child === "string" && typeof alias === "string" && !map.has(child)) {
|
|
233
242
|
map.set(child, {
|