osborn 0.9.245 → 0.9.246

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/dist/claude-llm.js +22 -1
  2. package/package.json +1 -1
@@ -1817,6 +1817,10 @@ class ClaudeLLMStream extends llm.LLMStream {
1817
1817
  #abortController;
1818
1818
  #llmRef;
1819
1819
  #approvedWriterToolUseIds = new Set();
1820
+ // Last Task/Agent dispatch description per subagent_type, captured at PreToolUse so
1821
+ // SubagentStart can label the Running row with WHAT the sub-agent is doing even if the
1822
+ // SDK hook input omits the prompt. Cleared when consumed by the matching start.
1823
+ #pendingTaskByType = new Map();
1820
1824
  constructor(llmInstance, { chatCtx, toolCtx, connOptions, opts, sessionId, onSessionId, eventEmitter, onCheckpoint, onPermissionRequest, abortController, }) {
1821
1825
  super(llmInstance, { chatCtx, toolCtx, connOptions });
1822
1826
  this.#llmRef = llmInstance;
@@ -2026,6 +2030,14 @@ class ClaudeLLMStream extends llm.LLMStream {
2026
2030
  // tool_use, returns {} → canUseTool workspace auto-approve).
2027
2031
  }
2028
2032
  console.log(`🔧 Claude: ${toolName}`);
2033
+ // Capture the dispatch description/prompt per subagent_type so SubagentStart
2034
+ // can show WHAT a sub-agent is working on (see #pendingTaskByType).
2035
+ if (toolName === 'Task' || toolName === 'Agent') {
2036
+ const st = String(toolInput?.subagent_type || toolInput?.agent_type || '');
2037
+ const d = String(toolInput?.description || toolInput?.prompt || '');
2038
+ if (st && d)
2039
+ this.#pendingTaskByType.set(st, d);
2040
+ }
2029
2041
  this.#eventEmitter.emit('tool_use', { name: toolName, input: toolInput, agentRole: agentType || 'main' });
2030
2042
  return {};
2031
2043
  }]
@@ -2395,7 +2407,16 @@ class ClaudeLLMStream extends llm.LLMStream {
2395
2407
  matcher: '.*',
2396
2408
  hooks: [async (input) => {
2397
2409
  console.log('[LIFECYCLE-PROBE] SubagentStart', JSON.stringify(input));
2398
- this.#eventEmitter.emit('agent_started', { agent_type: input?.agent_type, agent_id: input?.agent_id });
2410
+ // Surface WHAT the sub-agent was dispatched to do (not just its type) so the
2411
+ // Running panel shows the task while it's in flight, before any result lands.
2412
+ // The SDK hook may carry the initial prompt/description; fall back to the last
2413
+ // Task/Agent dispatch of this type captured at PreToolUse. Best-effort.
2414
+ const at0 = input?.agent_type;
2415
+ const rawTask = input?.prompt ?? input?.description ?? (at0 ? this.#pendingTaskByType.get(String(at0)) : undefined);
2416
+ if (at0)
2417
+ this.#pendingTaskByType.delete(String(at0));
2418
+ const task = rawTask ? String(rawTask).replace(/\s+/g, ' ').trim().slice(0, 160) : undefined;
2419
+ this.#eventEmitter.emit('agent_started', { agent_type: input?.agent_type, agent_id: input?.agent_id, task });
2399
2420
  // Record the dispatch as LIVE so the frontend can reconcile orphaned
2400
2421
  // "running" rows against statusManager.getActiveDispatchIds(). Without a
2401
2422
  // start-time entry the manager only knew about dispatches at completion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.245",
3
+ "version": "0.9.246",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {