@tangle-network/agent-runtime 0.83.0 → 0.84.1
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/agent.js +2 -2
- package/dist/{chunk-J3N6GODQ.js → chunk-G7HQI6DB.js} +2 -2
- package/dist/{chunk-QDVLTRCP.js → chunk-UJW6EVNY.js} +501 -216
- package/dist/chunk-UJW6EVNY.js.map +1 -0
- package/dist/{chunk-UJ3ONGHR.js → chunk-XBSWWF6A.js} +3 -3
- package/dist/{chunk-SSA6OERV.js → chunk-XN5TIJGP.js} +1006 -1006
- package/dist/{chunk-SSA6OERV.js.map → chunk-XN5TIJGP.js.map} +1 -1
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/loop-runner-bin.js +3 -3
- package/dist/loops.d.ts +155 -3
- package/dist/loops.js +4 -2
- package/dist/mcp/bin.js +1 -1
- package/dist/mcp/index.js +3 -3
- package/package.json +3 -3
- package/dist/chunk-QDVLTRCP.js.map +0 -1
- /package/dist/{chunk-J3N6GODQ.js.map → chunk-G7HQI6DB.js.map} +0 -0
- /package/dist/{chunk-UJ3ONGHR.js.map → chunk-XBSWWF6A.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpToolsForRuntimeMcp,
|
|
3
3
|
mcpToolsForRuntimeMcpSubset
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G7HQI6DB.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_ROUTER_BASE_URL,
|
|
7
7
|
cleanModelId,
|
|
@@ -20,16 +20,16 @@ import {
|
|
|
20
20
|
runLoopRunnerCli,
|
|
21
21
|
selfImproveLoopRunner,
|
|
22
22
|
worktreeLoopRunner
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XBSWWF6A.js";
|
|
24
24
|
import "./chunk-SGKPNBXE.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-UJW6EVNY.js";
|
|
26
26
|
import {
|
|
27
27
|
assertModelAllowed,
|
|
28
28
|
composeRuntimeHooks,
|
|
29
29
|
defineRuntimeHooks,
|
|
30
30
|
notifyRuntimeDecisionPoint,
|
|
31
31
|
notifyRuntimeHookEvent
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-XN5TIJGP.js";
|
|
33
33
|
import {
|
|
34
34
|
INTELLIGENCE_WIRE_VERSION,
|
|
35
35
|
buildLoopOtelSpans,
|
|
@@ -483,10 +483,9 @@ function* parseStreamChunk(chunk, context, usage, toolCalls) {
|
|
|
483
483
|
for (const tc of deltaToolCalls) {
|
|
484
484
|
if (!tc || typeof tc !== "object") continue;
|
|
485
485
|
const rec = tc;
|
|
486
|
-
const idx = numberValue(rec.index) ?? 0;
|
|
487
|
-
const key = `openai:${idx}`;
|
|
488
|
-
const acc = toolCalls.get(key) ?? { argsRaw: "", source: "openai", finalized: false };
|
|
489
486
|
const id = stringValue(rec.id);
|
|
487
|
+
const key = deltaToolCallKey(rec, id, toolCalls);
|
|
488
|
+
const acc = toolCalls.get(key) ?? { argsRaw: "", source: "openai", finalized: false };
|
|
490
489
|
if (id) acc.id = id;
|
|
491
490
|
const fn = rec.function;
|
|
492
491
|
const name = stringValue(fn?.name);
|
|
@@ -599,6 +598,16 @@ function* flushPendingToolCalls(toolCalls, context) {
|
|
|
599
598
|
yield buildToolCallEvent(acc, context);
|
|
600
599
|
}
|
|
601
600
|
}
|
|
601
|
+
function deltaToolCallKey(rec, id, toolCalls) {
|
|
602
|
+
const idx = numberValue(rec.index);
|
|
603
|
+
if (idx !== void 0) return `openai:${idx}`;
|
|
604
|
+
if (id) return `openai:id:${id}`;
|
|
605
|
+
let last;
|
|
606
|
+
for (const [key, acc] of toolCalls) {
|
|
607
|
+
if (acc.source === "openai" && !acc.finalized) last = key;
|
|
608
|
+
}
|
|
609
|
+
return last ?? "openai:0";
|
|
610
|
+
}
|
|
602
611
|
function buildToolCallEvent(acc, context) {
|
|
603
612
|
let args = acc.argsRaw;
|
|
604
613
|
if (acc.argsRaw.length > 0) {
|