@deepstrike/wasm 0.2.35 → 0.2.37
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/facade.js +11 -7
- package/dist/runtime/kernel-event-log.d.ts +0 -6
- package/dist/runtime/kernel-event-log.js +38 -62
- package/dist/runtime/kernel-step.d.ts +9 -0
- package/dist/runtime/kernel-step.js +12 -0
- package/dist/runtime/large-result-spool.d.ts +7 -0
- package/dist/runtime/large-result-spool.js +25 -0
- package/dist/runtime/os-snapshot.d.ts +0 -1
- package/dist/runtime/os-snapshot.js +0 -19
- package/dist/runtime/runner.d.ts +103 -8
- package/dist/runtime/runner.js +415 -100
- package/dist/runtime/session-log.d.ts +15 -54
- package/dist/runtime/session-repair.d.ts +29 -6
- package/dist/runtime/session-repair.js +37 -8
- package/dist/runtime/sub-agent-orchestrator.d.ts +7 -0
- package/dist/runtime/sub-agent-orchestrator.js +39 -4
- package/dist/runtime/types/agent.d.ts +46 -2
- package/dist/runtime/types/agent.js +54 -1
- package/dist/runtime/workflow-control-flow.d.ts +10 -2
- package/dist/runtime/workflow-control-flow.js +27 -6
- package/dist/types.d.ts +2 -1
- package/package.json +2 -2
|
@@ -6,12 +6,33 @@
|
|
|
6
6
|
//! decision from the node's agent and extracts the matching result signal (`loopContinue` /
|
|
7
7
|
//! `classifyBranch` / `tournamentWinner`) the kernel reads back.
|
|
8
8
|
import { extractJsonValue } from "./output-schema.js";
|
|
9
|
-
/** Instruction appended to a loop
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
/** Instruction appended to a loop iteration's goal. DW-3: the continuation verb is the
|
|
10
|
+
* kernel-adjudicated `pace` meta-tool (armed on every iteration run), not a text blob — one
|
|
11
|
+
* vocabulary shared with the round-level loop agent. Iterations share one session, so "the work
|
|
12
|
+
* so far" is simply the visible transcript. */
|
|
13
|
+
export function loopInstruction(maxIters, iteration = 0) {
|
|
14
|
+
return (`This task runs as a LOOP — this is iteration ${iteration + 1} of up to ${maxIters}. Your prior ` +
|
|
15
|
+
`iterations' work (if any) is visible above; do the NEXT increment now. Then call the \`pace\` tool: ` +
|
|
16
|
+
`\`{"next": "continue"}\` to request another iteration, or \`{"next": "stop"}\` when the overall ` +
|
|
17
|
+
`task is complete. Ending without calling \`pace\` also completes the loop.`);
|
|
18
|
+
}
|
|
19
|
+
/** W-N2: dependency outputs appended to a dependent node's goal — a DAG edge carries data, not
|
|
20
|
+
* just ordering (fan-out→synthesize was an uninformed synthesis without this). Each dependency's
|
|
21
|
+
* output is clipped so a chain of large nodes can't blow the child's context; empty/unknown
|
|
22
|
+
* outputs are skipped. Returns "" when the node has no dependencies. */
|
|
23
|
+
export function dependencyOutputsNote(inputAgentIds, outputs, maxPerDep = 8_000) {
|
|
24
|
+
if (!inputAgentIds?.length || !outputs)
|
|
25
|
+
return "";
|
|
26
|
+
const blocks = inputAgentIds
|
|
27
|
+
.map(id => {
|
|
28
|
+
const out = outputs.get(id) ?? "";
|
|
29
|
+
if (!out)
|
|
30
|
+
return "";
|
|
31
|
+
const clipped = out.length > maxPerDep ? `${out.slice(0, maxPerDep)}\n…[truncated]` : out;
|
|
32
|
+
return `[dependency ${id} output]\n${clipped}`;
|
|
33
|
+
})
|
|
34
|
+
.filter(Boolean);
|
|
35
|
+
return blocks.join("\n\n");
|
|
15
36
|
}
|
|
16
37
|
/** Instruction appended to a classify node's goal: pick exactly one of the kernel's branch labels. */
|
|
17
38
|
export function classifyInstruction(labels) {
|
package/dist/types.d.ts
CHANGED
|
@@ -105,7 +105,8 @@ export interface DoneEvent extends StreamEvent {
|
|
|
105
105
|
iterations: number;
|
|
106
106
|
totalTokens: number;
|
|
107
107
|
status: string;
|
|
108
|
-
dreamResult?: import("./memory/index.js").DreamResult;
|
|
108
|
+
dreamResult?: import("./memory/index.js").DreamResult; /** ③ loop-agent: the kernel-adjudicated after-round decision (absent on non-loop runs). */
|
|
109
|
+
paceDecision?: import("./runtime/kernel-step.js").PaceDecision;
|
|
109
110
|
}
|
|
110
111
|
export interface ErrorEvent extends StreamEvent {
|
|
111
112
|
type: "error";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.37",
|
|
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.37"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^30.0.0",
|