@deepstrike/wasm-kernel 0.1.11 → 0.1.15
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/deepstrike_wasm.d.ts +18 -4
- package/deepstrike_wasm_bg.js +25 -24
- package/deepstrike_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/deepstrike_wasm.d.ts
CHANGED
|
@@ -8,22 +8,31 @@ export interface LoopObservation {
|
|
|
8
8
|
kind: string;
|
|
9
9
|
action?: string;
|
|
10
10
|
rhoAfter?: number;
|
|
11
|
+
sprint?: number;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Discriminated union; inspect `kind`:
|
|
15
|
-
* - `\"call_llm\"` → `
|
|
16
|
+
* - `\"call_llm\"` → `context`, `tools` (includes meta-tools when configured)
|
|
16
17
|
* - `\"execute_tools\"` → `calls`
|
|
17
18
|
* - `\"done\"` → `result`
|
|
18
19
|
*/
|
|
19
20
|
export interface LoopAction {
|
|
20
21
|
kind: string;
|
|
21
|
-
|
|
22
|
+
context?: RenderedContext;
|
|
22
23
|
tools?: ToolSchema[];
|
|
23
24
|
calls?: ToolCall[];
|
|
24
25
|
result?: LoopResult;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Structured context for a provider call — emitted with `kind === \"call_llm\"`.
|
|
30
|
+
*/
|
|
31
|
+
export interface RenderedContext {
|
|
32
|
+
systemText: string;
|
|
33
|
+
turns: Message[];
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
export interface ContentPartObj {
|
|
28
37
|
type: string;
|
|
29
38
|
text?: string;
|
|
@@ -165,7 +174,7 @@ export class ContextEngine {
|
|
|
165
174
|
compress(): number;
|
|
166
175
|
constructor(max_tokens: number);
|
|
167
176
|
pressure(): number;
|
|
168
|
-
render():
|
|
177
|
+
render(): RenderedContext;
|
|
169
178
|
setAvailableSkills(skills: SkillMetadata[]): void;
|
|
170
179
|
totalTokens(): number;
|
|
171
180
|
}
|
|
@@ -192,6 +201,11 @@ export class Governance {
|
|
|
192
201
|
export class LoopStateMachine {
|
|
193
202
|
free(): void;
|
|
194
203
|
[Symbol.dispose](): void;
|
|
204
|
+
/**
|
|
205
|
+
* Pre-populate the history partition with a prior transcript message.
|
|
206
|
+
* Must be called before `start`.
|
|
207
|
+
*/
|
|
208
|
+
addHistoryMessage(message: Message, tokens: number): void;
|
|
195
209
|
/**
|
|
196
210
|
* Pre-populate the memory partition with a long-term memory snippet.
|
|
197
211
|
* Must be called before `start`. Use for seeding known context from past sessions.
|
|
@@ -210,7 +224,7 @@ export class LoopStateMachine {
|
|
|
210
224
|
isTerminal(): boolean;
|
|
211
225
|
constructor(policy: LoopPolicy);
|
|
212
226
|
pressure(): number;
|
|
213
|
-
render():
|
|
227
|
+
render(): RenderedContext;
|
|
214
228
|
setAvailableSkills(skills: SkillMetadata[]): void;
|
|
215
229
|
setKnowledgeEnabled(enabled: boolean): void;
|
|
216
230
|
setMemoryEnabled(enabled: boolean): void;
|
package/deepstrike_wasm_bg.js
CHANGED
|
@@ -60,20 +60,11 @@ export class ContextEngine {
|
|
|
60
60
|
return ret;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* @returns {
|
|
63
|
+
* @returns {RenderedContext}
|
|
64
64
|
*/
|
|
65
65
|
render() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
wasm.contextengine_render(retptr, this.__wbg_ptr);
|
|
69
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
70
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
71
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
72
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
73
|
-
return v1;
|
|
74
|
-
} finally {
|
|
75
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
76
|
-
}
|
|
66
|
+
const ret = wasm.contextengine_render(this.__wbg_ptr);
|
|
67
|
+
return takeObject(ret);
|
|
77
68
|
}
|
|
78
69
|
/**
|
|
79
70
|
* @param {SkillMetadata[]} skills
|
|
@@ -211,6 +202,25 @@ export class LoopStateMachine {
|
|
|
211
202
|
const ptr = this.__destroy_into_raw();
|
|
212
203
|
wasm.__wbg_loopstatemachine_free(ptr, 0);
|
|
213
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Pre-populate the history partition with a prior transcript message.
|
|
207
|
+
* Must be called before `start`.
|
|
208
|
+
* @param {Message} message
|
|
209
|
+
* @param {number} tokens
|
|
210
|
+
*/
|
|
211
|
+
addHistoryMessage(message, tokens) {
|
|
212
|
+
try {
|
|
213
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
214
|
+
wasm.loopstatemachine_addHistoryMessage(retptr, this.__wbg_ptr, addHeapObject(message), tokens);
|
|
215
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
216
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
217
|
+
if (r1) {
|
|
218
|
+
throw takeObject(r0);
|
|
219
|
+
}
|
|
220
|
+
} finally {
|
|
221
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
214
224
|
/**
|
|
215
225
|
* Pre-populate the memory partition with a long-term memory snippet.
|
|
216
226
|
* Must be called before `start`. Use for seeding known context from past sessions.
|
|
@@ -295,20 +305,11 @@ export class LoopStateMachine {
|
|
|
295
305
|
return ret;
|
|
296
306
|
}
|
|
297
307
|
/**
|
|
298
|
-
* @returns {
|
|
308
|
+
* @returns {RenderedContext}
|
|
299
309
|
*/
|
|
300
310
|
render() {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
wasm.loopstatemachine_render(retptr, this.__wbg_ptr);
|
|
304
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
305
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
306
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
307
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
308
|
-
return v1;
|
|
309
|
-
} finally {
|
|
310
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
311
|
-
}
|
|
311
|
+
const ret = wasm.loopstatemachine_render(this.__wbg_ptr);
|
|
312
|
+
return takeObject(ret);
|
|
312
313
|
}
|
|
313
314
|
/**
|
|
314
315
|
* @param {SkillMetadata[]} skills
|
package/deepstrike_wasm_bg.wasm
CHANGED
|
Binary file
|