@kendoo.agentdesk/agentdesk 0.14.2 → 0.14.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/cli/orchestrator.mjs +2 -0
- package/cli/stream-parser.mjs +14 -0
- package/package.json +1 -1
package/cli/orchestrator.mjs
CHANGED
|
@@ -110,6 +110,7 @@ export async function runOrchestrator({
|
|
|
110
110
|
teamNames: soloAgent ? [soloAgent] : teamSections.names,
|
|
111
111
|
callbacks: {
|
|
112
112
|
onPhaseChange({ phase }) { emit({ type: "phase:change", phase, model: representativeModel }); },
|
|
113
|
+
onModel({ model }) { emit({ type: "session:model", model }); },
|
|
113
114
|
onAgentMessage({ agent, tag, message }) { emit({ type: "agent:message", agent, tag, message }); },
|
|
114
115
|
onToolUse({ agent, tool, description }) { totalSteps++; emit({ type: "tool:use", agent, tool, description }); },
|
|
115
116
|
onToolResult({ success, summary }) { emit({ type: "tool:result", success, summary }); },
|
|
@@ -208,6 +209,7 @@ async function runSinglePhase({ prompt, cwd, env, teamNames, emit, modelArgs = [
|
|
|
208
209
|
teamNames,
|
|
209
210
|
callbacks: {
|
|
210
211
|
onPhaseChange({ phase }) { lastPhase = phase; },
|
|
212
|
+
onModel({ model }) { emit({ type: "session:model", model }); },
|
|
211
213
|
onAgentMessage({ agent, tag, message }) { emit({ type: "agent:message", agent, tag, message }); },
|
|
212
214
|
onToolUse({ agent, tool, description }) { steps++; emit({ type: "tool:use", agent, tool, description }); },
|
|
213
215
|
onToolResult({ success, summary }) { emit({ type: "tool:result", success, summary }); },
|
package/cli/stream-parser.mjs
CHANGED
|
@@ -53,10 +53,24 @@ export function createStreamParser({ teamNames, callbacks }) {
|
|
|
53
53
|
.map(n => String(n).padStart(2, "0")).join(":");
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
let reportedModel = null;
|
|
57
|
+
|
|
58
|
+
function captureModel(candidate) {
|
|
59
|
+
if (!candidate || typeof candidate !== "string") return;
|
|
60
|
+
if (reportedModel === candidate) return;
|
|
61
|
+
reportedModel = candidate;
|
|
62
|
+
callbacks.onModel?.({ model: candidate, timestamp: timestamp() });
|
|
63
|
+
}
|
|
64
|
+
|
|
56
65
|
function parseLine(line) {
|
|
57
66
|
try {
|
|
58
67
|
const event = JSON.parse(line);
|
|
59
68
|
|
|
69
|
+
// Claude's stream-json exposes the actual model it picked — capture it
|
|
70
|
+
// so the UI can show the real model instead of a vague "default" label.
|
|
71
|
+
if (event.type === "system" && event.model) captureModel(event.model);
|
|
72
|
+
if (event.message?.model) captureModel(event.message.model);
|
|
73
|
+
|
|
60
74
|
// Track token usage
|
|
61
75
|
if (event.usage) {
|
|
62
76
|
if (event.usage.input_tokens) totalInputTokens = Math.max(totalInputTokens, event.usage.input_tokens);
|