agentbox-sdk 0.1.311 → 0.1.312
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/agents/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createNormalizedEvent,
|
|
3
3
|
normalizeRawAgentEvent,
|
|
4
4
|
toAISDKStream
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-A52XCBGW.js";
|
|
6
6
|
import {
|
|
7
7
|
AgentBoxError,
|
|
8
8
|
AsyncQueue,
|
|
@@ -1670,6 +1670,7 @@ function buildClaudeQueryOptions(params) {
|
|
|
1670
1670
|
settings: params.settingsPath,
|
|
1671
1671
|
extraArgs,
|
|
1672
1672
|
includePartialMessages: true,
|
|
1673
|
+
forwardSubagentText: true,
|
|
1673
1674
|
includeHookEvents,
|
|
1674
1675
|
thinking: { type: "adaptive", display: "summarized" },
|
|
1675
1676
|
...provider?.additionalDirectories?.length ? { additionalDirectories: provider.additionalDirectories } : {},
|
|
@@ -549,6 +549,7 @@ var ClaudeCodeLogAssembler = class {
|
|
|
549
549
|
currentMessageId = null;
|
|
550
550
|
textByMessageId = /* @__PURE__ */ new Map();
|
|
551
551
|
thinkingByMessageId = /* @__PURE__ */ new Map();
|
|
552
|
+
parentToolUseIdByMessageId = /* @__PURE__ */ new Map();
|
|
552
553
|
byMessageId = /* @__PURE__ */ new Map();
|
|
553
554
|
// Per-message tool_use / image / other non-text-non-thinking content blocks.
|
|
554
555
|
// Tracked persistently so any `upsertMessage` call (including those from a
|
|
@@ -569,6 +570,7 @@ var ClaudeCodeLogAssembler = class {
|
|
|
569
570
|
const id = message && typeof message.id === "string" ? message.id : null;
|
|
570
571
|
if (!id) return [];
|
|
571
572
|
this.currentMessageId = id;
|
|
573
|
+
this.setParentToolUseId(id, event);
|
|
572
574
|
if (!this.textByMessageId.has(id)) this.textByMessageId.set(id, "");
|
|
573
575
|
if (!this.thinkingByMessageId.has(id))
|
|
574
576
|
this.thinkingByMessageId.set(id, "");
|
|
@@ -599,6 +601,7 @@ var ClaudeCodeLogAssembler = class {
|
|
|
599
601
|
if (!id || !message) {
|
|
600
602
|
return [clone(event)];
|
|
601
603
|
}
|
|
604
|
+
this.setParentToolUseId(id, event);
|
|
602
605
|
const final = extractClaudeAssistantContent(message);
|
|
603
606
|
this.textByMessageId.set(id, final.text);
|
|
604
607
|
if (final.thinking) {
|
|
@@ -615,6 +618,7 @@ var ClaudeCodeLogAssembler = class {
|
|
|
615
618
|
this.currentMessageId = null;
|
|
616
619
|
this.textByMessageId.clear();
|
|
617
620
|
this.thinkingByMessageId.clear();
|
|
621
|
+
this.parentToolUseIdByMessageId.clear();
|
|
618
622
|
this.byMessageId.clear();
|
|
619
623
|
this.extraBlocksByMessageId.clear();
|
|
620
624
|
for (const snapshot of snapshots) {
|
|
@@ -623,6 +627,8 @@ var ClaudeCodeLogAssembler = class {
|
|
|
623
627
|
const messageId = typeof snapshot.messageId === "string" ? snapshot.messageId : null;
|
|
624
628
|
if (!messageId) continue;
|
|
625
629
|
this.byMessageId.set(messageId, clone(snapshot));
|
|
630
|
+
const parentToolUseId = typeof snapshot.parent_tool_use_id === "string" ? snapshot.parent_tool_use_id : null;
|
|
631
|
+
this.parentToolUseIdByMessageId.set(messageId, parentToolUseId);
|
|
626
632
|
const message = isRecord(snapshot.message) ? snapshot.message : null;
|
|
627
633
|
const content = message && Array.isArray(message.content) ? message.content : [];
|
|
628
634
|
let text = "";
|
|
@@ -657,6 +663,15 @@ var ClaudeCodeLogAssembler = class {
|
|
|
657
663
|
map.set(key, clone(block));
|
|
658
664
|
}
|
|
659
665
|
}
|
|
666
|
+
setParentToolUseId(messageId, event) {
|
|
667
|
+
if (event.parent_tool_use_id === null) {
|
|
668
|
+
this.parentToolUseIdByMessageId.set(messageId, null);
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
if (typeof event.parent_tool_use_id === "string") {
|
|
672
|
+
this.parentToolUseIdByMessageId.set(messageId, event.parent_tool_use_id);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
660
675
|
upsertMessage(messageId) {
|
|
661
676
|
const text = this.textByMessageId.get(messageId) ?? "";
|
|
662
677
|
const thinking = this.thinkingByMessageId.get(messageId) ?? "";
|
|
@@ -670,6 +685,7 @@ var ClaudeCodeLogAssembler = class {
|
|
|
670
685
|
const next = {
|
|
671
686
|
type: "message.updated",
|
|
672
687
|
messageId,
|
|
688
|
+
parent_tool_use_id: this.parentToolUseIdByMessageId.get(messageId) ?? null,
|
|
673
689
|
message: {
|
|
674
690
|
id: messageId,
|
|
675
691
|
role: "assistant",
|
package/dist/events/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
Agent,
|
|
3
3
|
agentboxRoot,
|
|
4
4
|
getAgentLayout
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3M5SPIRD.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderLogAssembler,
|
|
8
8
|
createNormalizedEvent,
|
|
9
9
|
normalizeRawAgentEvent,
|
|
10
10
|
toAISDKEvent,
|
|
11
11
|
toAISDKStream
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-A52XCBGW.js";
|
|
13
13
|
import {
|
|
14
14
|
Sandbox,
|
|
15
15
|
SandboxAdapter,
|