@lightcone-ai/daemon 0.9.49 → 0.9.50
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/package.json +1 -1
- package/src/agent-manager.js +19 -8
package/package.json
CHANGED
package/src/agent-manager.js
CHANGED
|
@@ -563,18 +563,29 @@ export class AgentManager {
|
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
// Activity state machine
|
|
566
|
+
const displayName = this.agents.get(key)?.config?.displayName ?? agentId.slice(0, 8);
|
|
566
567
|
if (event.type === 'assistant') {
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
568
|
+
const content = event.message?.content ?? [];
|
|
569
|
+
for (const block of content) {
|
|
570
|
+
if (block.type === 'thinking') {
|
|
571
|
+
console.log(`[AgentManager][${displayName}] <thinking> ${block.thinking?.slice(0, 500)}`);
|
|
572
|
+
} else if (block.type === 'text') {
|
|
573
|
+
console.log(`[AgentManager][${displayName}] <text> ${block.text?.slice(0, 500)}`);
|
|
574
|
+
} else if (block.type === 'tool_use') {
|
|
575
|
+
console.log(`[AgentManager][${displayName}] <tool_use> ${block.name} params=${JSON.stringify(block.input ?? {}).slice(0, 500)}`);
|
|
576
|
+
connection.send({ type: 'agent:activity', agentId, teamId, activity: 'working', detail: block.name, entries: [] });
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (!content.some(c => c.type === 'tool_use')) {
|
|
574
580
|
connection.send({ type: 'agent:activity', agentId, teamId, activity: 'thinking', detail: '', entries: [] });
|
|
575
581
|
}
|
|
582
|
+
} else if (event.type === 'tool') {
|
|
583
|
+
const content = event.content;
|
|
584
|
+
const resultStr = Array.isArray(content)
|
|
585
|
+
? content.map(c => c.text ?? c.content ?? JSON.stringify(c)).join('').slice(0, 1000)
|
|
586
|
+
: JSON.stringify(content ?? event).slice(0, 1000);
|
|
587
|
+
console.log(`[AgentManager][${displayName}] <tool_result> id=${event.tool_use_id ?? '?'} → ${resultStr}`);
|
|
576
588
|
} else if (event.type === 'result') {
|
|
577
|
-
const displayName = this.agents.get(key)?.config?.displayName ?? agentId.slice(0, 8);
|
|
578
589
|
console.log(`[AgentManager][${displayName}] turn done (stop_reason=${event.stop_reason ?? '?'})`);
|
|
579
590
|
connection.send({ type: 'agent:activity', agentId, teamId, activity: 'online', detail: '', entries: [] });
|
|
580
591
|
}
|