@deepstrike/wasm 0.2.25 → 0.2.26
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/runtime/types/agent.js +14 -1
- package/package.json +2 -2
|
@@ -65,6 +65,19 @@ export function milestoneCheckResultToKernel(result) {
|
|
|
65
65
|
...(result.reason ? { reason: result.reason } : {}),
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
+
/** Tool-call `arguments` reach us as a raw model-authored string (e.g. the OpenAIChat-family
|
|
69
|
+
* non-streaming path passes it through verbatim via `normalizeToolCalls`). A malformed JSON
|
|
70
|
+
* string must degrade to empty args here, never throw — otherwise one bad tool-call on a
|
|
71
|
+
* sub-agent's final turn bricks the parent's result serialization. Mirrors the `catch→{}`
|
|
72
|
+
* guard every provider/runtime parse site already uses. */
|
|
73
|
+
function safeParseToolArgs(raw) {
|
|
74
|
+
try {
|
|
75
|
+
return JSON.parse(raw || "{}");
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return {};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
68
81
|
export function subAgentResultToKernel(result) {
|
|
69
82
|
const finalMessage = result.result.finalMessage;
|
|
70
83
|
return {
|
|
@@ -78,7 +91,7 @@ export function subAgentResultToKernel(result) {
|
|
|
78
91
|
tool_calls: (finalMessage.toolCalls ?? []).map(tc => ({
|
|
79
92
|
id: tc.id,
|
|
80
93
|
name: tc.name,
|
|
81
|
-
arguments:
|
|
94
|
+
arguments: safeParseToolArgs(tc.arguments),
|
|
82
95
|
})),
|
|
83
96
|
...(finalMessage.tokenCount !== undefined ? { token_count: finalMessage.tokenCount } : {}),
|
|
84
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "DeepStrike WASM SDK — browser, Cloudflare Workers, Deno Deploy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"test": "node --experimental-vm-modules node_modules/.bin/jest"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@deepstrike/wasm-kernel": "0.2.
|
|
18
|
+
"@deepstrike/wasm-kernel": "0.2.26"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^30.0.0",
|