@deepstrike/wasm 0.2.48 → 0.2.49
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.
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Mirrors the kernel's EXPOSURE_EXEMPT_META_TOOLS invariant: kernel-owned meta surfaces are
|
|
2
|
+
// never narrowed away by a tool allow-list. `read_result` is runner-resolved before reaching any
|
|
3
|
+
// plane today, but the lists must not drift.
|
|
4
|
+
const DEFAULT_META_TOOLS = new Set(["skill", "memory", "knowledge", "update_plan", "read_result"]);
|
|
2
5
|
/** Wraps an execution plane, allowing only manifest-permitted tool IDs (+ meta-tools). */
|
|
3
6
|
export class FilteredExecutionPlane {
|
|
4
7
|
inner;
|
package/dist/runtime/runner.js
CHANGED
|
@@ -6,7 +6,7 @@ import { peekProviderReplay, seedProviderReplayFromEvents } from "./provider-rep
|
|
|
6
6
|
import { sanitizeReplayText } from "./replay-sanitize.js";
|
|
7
7
|
import { formatToolError } from "../tools/errors.js";
|
|
8
8
|
import { buildLlmCompletedEvent, buildRunTerminalEvent, buildWorkflowNodeCompletedEvent, buildWorkflowNodesSubmittedEvent, recoverWorkflowNodeOutcomes, recoverSubmittedWorkflowNodes, repairEventsForRecovery, } from "./session-repair.js";
|
|
9
|
-
import { kernelAction, kernelApply, kernelMaybeAction, messageToKernelMessage, skillMetadataToKernel, toolResultToKernel, toolSchemaToKernel, } from "./kernel-step.js";
|
|
9
|
+
import { kernelAction, kernelApply, kernelMaybeAction, messageToKernelMessage, skillMetadataToKernel, taskUpdateToKernel, toolResultToKernel, toolSchemaToKernel, } from "./kernel-step.js";
|
|
10
10
|
import { agentRunSpecToKernel, findSpawnProcessObservation, milestoneCheckPass, milestoneCheckResultToKernel, spawnObservationToManifest, subAgentResultToKernel, submitWorkflowNodesToKernel, submitWorkflowToKernel, workflowBudgetNote, workflowNodeOutcomeFromKernel, workflowNodeStatusFromTermination, workflowNodeToManifest, workflowNodeToSpec, workflowSpecToKernel, } from "./types/agent.js";
|
|
11
11
|
import { defaultSubAgentOrchestrator } from "./sub-agent-orchestrator.js";
|
|
12
12
|
import { extractJsonValue, schemaInstruction, schemaRetryInstruction, validateAgainstSchema, } from "./output-schema.js";
|
|
@@ -872,7 +872,20 @@ export class RuntimeRunner {
|
|
|
872
872
|
// host-resolved: (a) this turn's in-memory pending spool map, (b) the on-disk result spool,
|
|
873
873
|
// (c) a session-log scan for the original `tool_completed` event.
|
|
874
874
|
const readResultCalls = allCalls.filter(c => c.name === "read_result");
|
|
875
|
-
const
|
|
875
|
+
const planCalls = allCalls.filter(c => c.name === "update_plan");
|
|
876
|
+
const normalCalls = allCalls.filter(c => c.name !== "submit_workflow_nodes" && c.name !== "start_workflow" && c.name !== "read_result"
|
|
877
|
+
&& c.name !== "update_plan");
|
|
878
|
+
// `update_plan` is a kernel meta-tool (exposed via `enablePlanTool`), not a registered
|
|
879
|
+
// plane tool — resolve it here as an `update_task` apply, mirroring the node/python runners.
|
|
880
|
+
for (const call of planCalls) {
|
|
881
|
+
const update = parseUpdatePlanArgs(call.arguments);
|
|
882
|
+
kernelApply(runtime, this.pendingObservations, {
|
|
883
|
+
kind: "update_task",
|
|
884
|
+
update: taskUpdateToKernel(update),
|
|
885
|
+
});
|
|
886
|
+
toolResults.push({ callId: call.id, output: "success", isError: false });
|
|
887
|
+
yield { type: "tool_result", callId: call.id, content: "success", isError: false };
|
|
888
|
+
}
|
|
876
889
|
for (const call of readResultCalls) {
|
|
877
890
|
const out = await this.resolveReadResult(sessionId, call.arguments);
|
|
878
891
|
toolResults.push({ callId: call.id, output: out.text, isError: out.isError });
|
|
@@ -2060,6 +2073,26 @@ export async function collectText(stream) {
|
|
|
2060
2073
|
}
|
|
2061
2074
|
return text;
|
|
2062
2075
|
}
|
|
2076
|
+
/** Parse `update_plan` meta-tool args into a task update (snake_case aliases accepted, mirroring
|
|
2077
|
+
* the node/python runners). Malformed payload → an empty update (a no-op `update_task`). */
|
|
2078
|
+
function parseUpdatePlanArgs(argsStr) {
|
|
2079
|
+
let parsed = {};
|
|
2080
|
+
try {
|
|
2081
|
+
parsed = JSON.parse(argsStr);
|
|
2082
|
+
}
|
|
2083
|
+
catch {
|
|
2084
|
+
// Ignore parse error → empty update.
|
|
2085
|
+
}
|
|
2086
|
+
return {
|
|
2087
|
+
plan: parsed.plan,
|
|
2088
|
+
currentStep: parsed.currentStep !== undefined ? Number(parsed.currentStep) : parsed.current_step !== undefined ? Number(parsed.current_step) : undefined,
|
|
2089
|
+
progress: parsed.progress,
|
|
2090
|
+
scratchpad: parsed.scratchpad,
|
|
2091
|
+
blockedOn: parsed.blockedOn !== undefined
|
|
2092
|
+
? parsed.blockedOn
|
|
2093
|
+
: parsed.blocked_on,
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2063
2096
|
/** R3-1: parse `submit_workflow_nodes` tool args (`{ nodes: WorkflowNodeSpec[] }`). Node shapes are
|
|
2064
2097
|
* trusted structurally; the kernel validates them on append. Malformed payload → no nodes. */
|
|
2065
2098
|
function parseSubmitWorkflowNodesArgs(argsStr) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.49",
|
|
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.49"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^30.0.0",
|