@deepstrike/wasm-kernel 0.2.36 → 0.2.38
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 +70 -5
- package/deepstrike_wasm.js +1 -1
- package/deepstrike_wasm_bg.js +113 -12
- package/deepstrike_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/deepstrike_wasm.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Discriminated union returned by `IdlePipeline` methods. Inspect `kind`:
|
|
5
|
+
* - `\"synthesize_insights\"` → `messages` (SDK must call the LLM, then `feedSynthesisResult`)
|
|
6
|
+
* - `\"commit_memories\"` → `agentId`, `curationResult`, `runResult`
|
|
7
|
+
* - `\"noop\"` | `\"aborted\"`
|
|
8
|
+
*/
|
|
9
|
+
export interface IdlePipelineAction {
|
|
10
|
+
kind: string;
|
|
11
|
+
messages?: Message[];
|
|
12
|
+
agentId?: string;
|
|
13
|
+
curationResult?: CurationResult;
|
|
14
|
+
runResult?: IdleRunResult;
|
|
15
|
+
}
|
|
16
|
+
|
|
3
17
|
/**
|
|
4
18
|
* Structured context for a provider call — emitted with `kind === \"call_llm\"`.
|
|
5
19
|
*/
|
|
@@ -51,12 +65,33 @@ export interface CriterionResult {
|
|
|
51
65
|
feedback: string;
|
|
52
66
|
}
|
|
53
67
|
|
|
68
|
+
export interface CurationResult {
|
|
69
|
+
toAdd: MemoryEntry[];
|
|
70
|
+
/**
|
|
71
|
+
* Indices into the `existingMemories` slice passed to `feedTrigger`.
|
|
72
|
+
*/
|
|
73
|
+
toRemoveIndices: number[];
|
|
74
|
+
stats: CurationStats;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CurationStats {
|
|
78
|
+
insightsProcessed: number;
|
|
79
|
+
duplicatesRemoved: number;
|
|
80
|
+
conflictsResolved: number;
|
|
81
|
+
entriesAdded: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
54
84
|
export interface GovernanceVerdict {
|
|
55
85
|
kind: string;
|
|
56
86
|
reason?: string;
|
|
57
87
|
retryAfterMs?: number;
|
|
58
88
|
}
|
|
59
89
|
|
|
90
|
+
export interface IdleRunResult {
|
|
91
|
+
sessionsProcessed: number;
|
|
92
|
+
insightsExtracted: number;
|
|
93
|
+
}
|
|
94
|
+
|
|
60
95
|
export interface LoopPolicy {
|
|
61
96
|
maxTokens: number;
|
|
62
97
|
maxTurns?: number;
|
|
@@ -71,6 +106,15 @@ export interface LoopResult {
|
|
|
71
106
|
totalTokensUsed: number;
|
|
72
107
|
}
|
|
73
108
|
|
|
109
|
+
export interface MemoryEntry {
|
|
110
|
+
text: string;
|
|
111
|
+
score: number;
|
|
112
|
+
/**
|
|
113
|
+
* JSON-encoded metadata blob.
|
|
114
|
+
*/
|
|
115
|
+
metadata: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
74
118
|
export interface Message {
|
|
75
119
|
role: string;
|
|
76
120
|
content: string;
|
|
@@ -116,6 +160,18 @@ export interface RuntimeTask {
|
|
|
116
160
|
lane?: string;
|
|
117
161
|
}
|
|
118
162
|
|
|
163
|
+
export interface SessionData {
|
|
164
|
+
sessionId: string;
|
|
165
|
+
agentId: string;
|
|
166
|
+
messages: Message[];
|
|
167
|
+
/**
|
|
168
|
+
* JSON-encoded metadata blob.
|
|
169
|
+
*/
|
|
170
|
+
metadata: string;
|
|
171
|
+
createdAtMs: number;
|
|
172
|
+
updatedAtMs: number;
|
|
173
|
+
}
|
|
174
|
+
|
|
119
175
|
export interface SkillCandidate {
|
|
120
176
|
name: string;
|
|
121
177
|
description: string;
|
|
@@ -169,6 +225,20 @@ export class Governance {
|
|
|
169
225
|
setTime(now_ms: number): void;
|
|
170
226
|
}
|
|
171
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Two-phase offline dream pipeline (parity with the napi/pyo3 exports):
|
|
230
|
+
* 1. `feedTrigger(sessions, existingMemories, nowMs)` → `"synthesize_insights"` + prompt messages
|
|
231
|
+
* 2. Call the LLM with those messages, collect the text response
|
|
232
|
+
* 3. `feedSynthesisResult(text)` → `"commit_memories"` with the curation delta
|
|
233
|
+
*/
|
|
234
|
+
export class IdlePipeline {
|
|
235
|
+
free(): void;
|
|
236
|
+
[Symbol.dispose](): void;
|
|
237
|
+
feedSynthesisResult(content: string): IdlePipelineAction;
|
|
238
|
+
feedTrigger(sessions: SessionData[], existing_memories: MemoryEntry[], now_ms: number): IdlePipelineAction;
|
|
239
|
+
constructor(agent_id: string);
|
|
240
|
+
}
|
|
241
|
+
|
|
172
242
|
export class KernelRuntime {
|
|
173
243
|
free(): void;
|
|
174
244
|
[Symbol.dispose](): void;
|
|
@@ -199,11 +269,6 @@ export class SignalRouter {
|
|
|
199
269
|
* Pull the next queued signal (highest priority first).
|
|
200
270
|
*/
|
|
201
271
|
next(): RuntimeSignal | undefined;
|
|
202
|
-
/**
|
|
203
|
-
* Pull the next queued signal visible to `recipient` (broadcasts plus signals
|
|
204
|
-
* addressed to it); other recipients' signals stay queued. Omit ⇒ no filter.
|
|
205
|
-
*/
|
|
206
|
-
nextFor(recipient?: string | null): RuntimeSignal | undefined;
|
|
207
272
|
}
|
|
208
273
|
|
|
209
274
|
/**
|
package/deepstrike_wasm.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./deepstrike_wasm_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
|
-
Governance, KernelRuntime, SignalRouter, buildEvalMessages, parseVerdict, verdictOutputSchema
|
|
8
|
+
Governance, IdlePipeline, KernelRuntime, SignalRouter, buildEvalMessages, parseVerdict, verdictOutputSchema
|
|
9
9
|
} from "./deepstrike_wasm_bg.js";
|
package/deepstrike_wasm_bg.js
CHANGED
|
@@ -120,6 +120,72 @@ export class Governance {
|
|
|
120
120
|
}
|
|
121
121
|
if (Symbol.dispose) Governance.prototype[Symbol.dispose] = Governance.prototype.free;
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Two-phase offline dream pipeline (parity with the napi/pyo3 exports):
|
|
125
|
+
* 1. `feedTrigger(sessions, existingMemories, nowMs)` → `"synthesize_insights"` + prompt messages
|
|
126
|
+
* 2. Call the LLM with those messages, collect the text response
|
|
127
|
+
* 3. `feedSynthesisResult(text)` → `"commit_memories"` with the curation delta
|
|
128
|
+
*/
|
|
129
|
+
export class IdlePipeline {
|
|
130
|
+
__destroy_into_raw() {
|
|
131
|
+
const ptr = this.__wbg_ptr;
|
|
132
|
+
this.__wbg_ptr = 0;
|
|
133
|
+
IdlePipelineFinalization.unregister(this);
|
|
134
|
+
return ptr;
|
|
135
|
+
}
|
|
136
|
+
free() {
|
|
137
|
+
const ptr = this.__destroy_into_raw();
|
|
138
|
+
wasm.__wbg_idlepipeline_free(ptr, 0);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @param {string} content
|
|
142
|
+
* @returns {IdlePipelineAction}
|
|
143
|
+
*/
|
|
144
|
+
feedSynthesisResult(content) {
|
|
145
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
146
|
+
const len0 = WASM_VECTOR_LEN;
|
|
147
|
+
const ret = wasm.idlepipeline_feedSynthesisResult(this.__wbg_ptr, ptr0, len0);
|
|
148
|
+
return takeObject(ret);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @param {SessionData[]} sessions
|
|
152
|
+
* @param {MemoryEntry[]} existing_memories
|
|
153
|
+
* @param {number} now_ms
|
|
154
|
+
* @returns {IdlePipelineAction}
|
|
155
|
+
*/
|
|
156
|
+
feedTrigger(sessions, existing_memories, now_ms) {
|
|
157
|
+
try {
|
|
158
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
159
|
+
const ptr0 = passArrayJsValueToWasm0(sessions, wasm.__wbindgen_export);
|
|
160
|
+
const len0 = WASM_VECTOR_LEN;
|
|
161
|
+
const ptr1 = passArrayJsValueToWasm0(existing_memories, wasm.__wbindgen_export);
|
|
162
|
+
const len1 = WASM_VECTOR_LEN;
|
|
163
|
+
wasm.idlepipeline_feedTrigger(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, now_ms);
|
|
164
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
165
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
166
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
167
|
+
if (r2) {
|
|
168
|
+
throw takeObject(r1);
|
|
169
|
+
}
|
|
170
|
+
return takeObject(r0);
|
|
171
|
+
} finally {
|
|
172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* @param {string} agent_id
|
|
177
|
+
*/
|
|
178
|
+
constructor(agent_id) {
|
|
179
|
+
const ptr0 = passStringToWasm0(agent_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
180
|
+
const len0 = WASM_VECTOR_LEN;
|
|
181
|
+
const ret = wasm.idlepipeline_new(ptr0, len0);
|
|
182
|
+
this.__wbg_ptr = ret;
|
|
183
|
+
IdlePipelineFinalization.register(this, this.__wbg_ptr, this);
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (Symbol.dispose) IdlePipeline.prototype[Symbol.dispose] = IdlePipeline.prototype.free;
|
|
188
|
+
|
|
123
189
|
export class KernelRuntime {
|
|
124
190
|
__destroy_into_raw() {
|
|
125
191
|
const ptr = this.__wbg_ptr;
|
|
@@ -294,18 +360,6 @@ export class SignalRouter {
|
|
|
294
360
|
const ret = wasm.signalrouter_next(this.__wbg_ptr);
|
|
295
361
|
return takeObject(ret);
|
|
296
362
|
}
|
|
297
|
-
/**
|
|
298
|
-
* Pull the next queued signal visible to `recipient` (broadcasts plus signals
|
|
299
|
-
* addressed to it); other recipients' signals stay queued. Omit ⇒ no filter.
|
|
300
|
-
* @param {string | null} [recipient]
|
|
301
|
-
* @returns {RuntimeSignal | undefined}
|
|
302
|
-
*/
|
|
303
|
-
nextFor(recipient) {
|
|
304
|
-
var ptr0 = isLikeNone(recipient) ? 0 : passStringToWasm0(recipient, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
305
|
-
var len0 = WASM_VECTOR_LEN;
|
|
306
|
-
const ret = wasm.signalrouter_nextFor(this.__wbg_ptr, ptr0, len0);
|
|
307
|
-
return takeObject(ret);
|
|
308
|
-
}
|
|
309
363
|
}
|
|
310
364
|
if (Symbol.dispose) SignalRouter.prototype[Symbol.dispose] = SignalRouter.prototype.free;
|
|
311
365
|
|
|
@@ -404,6 +458,10 @@ export function __wbg___wbindgen_in_07056af4f902c445(arg0, arg1) {
|
|
|
404
458
|
const ret = getObject(arg0) in getObject(arg1);
|
|
405
459
|
return ret;
|
|
406
460
|
}
|
|
461
|
+
export function __wbg___wbindgen_is_function_5cd60d5cf78b4eef(arg0) {
|
|
462
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
463
|
+
return ret;
|
|
464
|
+
}
|
|
407
465
|
export function __wbg___wbindgen_is_object_b4593df85baada48(arg0) {
|
|
408
466
|
const val = getObject(arg0);
|
|
409
467
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -434,9 +492,25 @@ export function __wbg___wbindgen_string_get_d109740c0d18f4d7(arg0, arg1) {
|
|
|
434
492
|
export function __wbg___wbindgen_throw_9c31b086c2b26051(arg0, arg1) {
|
|
435
493
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
436
494
|
}
|
|
495
|
+
export function __wbg_call_13665d9f14390edc() { return handleError(function (arg0, arg1) {
|
|
496
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
497
|
+
return addHeapObject(ret);
|
|
498
|
+
}, arguments); }
|
|
499
|
+
export function __wbg_done_54b8da57023b7ed2(arg0) {
|
|
500
|
+
const ret = getObject(arg0).done;
|
|
501
|
+
return ret;
|
|
502
|
+
}
|
|
437
503
|
export function __wbg_getRandomValues_ef12552bf5acd2fe() { return handleError(function (arg0, arg1) {
|
|
438
504
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
439
505
|
}, arguments); }
|
|
506
|
+
export function __wbg_get_3e9a707ab7d352eb() { return handleError(function (arg0, arg1) {
|
|
507
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
508
|
+
return addHeapObject(ret);
|
|
509
|
+
}, arguments); }
|
|
510
|
+
export function __wbg_get_unchecked_1dfe6d05ad91d9b7(arg0, arg1) {
|
|
511
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
512
|
+
return addHeapObject(ret);
|
|
513
|
+
}
|
|
440
514
|
export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
|
|
441
515
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
442
516
|
return addHeapObject(ret);
|
|
@@ -461,10 +535,22 @@ export function __wbg_instanceof_Uint8Array_abd07d4bd221d50b(arg0) {
|
|
|
461
535
|
const ret = result;
|
|
462
536
|
return ret;
|
|
463
537
|
}
|
|
538
|
+
export function __wbg_isArray_94898ed3aad6947b(arg0) {
|
|
539
|
+
const ret = Array.isArray(getObject(arg0));
|
|
540
|
+
return ret;
|
|
541
|
+
}
|
|
464
542
|
export function __wbg_isSafeInteger_01e964d144ad3a55(arg0) {
|
|
465
543
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
466
544
|
return ret;
|
|
467
545
|
}
|
|
546
|
+
export function __wbg_iterator_1441b47f341dc34f() {
|
|
547
|
+
const ret = Symbol.iterator;
|
|
548
|
+
return addHeapObject(ret);
|
|
549
|
+
}
|
|
550
|
+
export function __wbg_length_2591a0f4f659a55c(arg0) {
|
|
551
|
+
const ret = getObject(arg0).length;
|
|
552
|
+
return ret;
|
|
553
|
+
}
|
|
468
554
|
export function __wbg_length_56fcd3e2b7e0299d(arg0) {
|
|
469
555
|
const ret = getObject(arg0).length;
|
|
470
556
|
return ret;
|
|
@@ -481,6 +567,14 @@ export function __wbg_new_7ddec6de44ff8f5d(arg0) {
|
|
|
481
567
|
const ret = new Uint8Array(getObject(arg0));
|
|
482
568
|
return addHeapObject(ret);
|
|
483
569
|
}
|
|
570
|
+
export function __wbg_next_2a4e19f4f5083b0f(arg0) {
|
|
571
|
+
const ret = getObject(arg0).next;
|
|
572
|
+
return addHeapObject(ret);
|
|
573
|
+
}
|
|
574
|
+
export function __wbg_next_6429a146bf756f93() { return handleError(function (arg0) {
|
|
575
|
+
const ret = getObject(arg0).next();
|
|
576
|
+
return addHeapObject(ret);
|
|
577
|
+
}, arguments); }
|
|
484
578
|
export function __wbg_prototypesetcall_5f9bdc8d75e07276(arg0, arg1, arg2) {
|
|
485
579
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
486
580
|
}
|
|
@@ -490,6 +584,10 @@ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
|
490
584
|
export function __wbg_set_78ea6a19f4818587(arg0, arg1, arg2) {
|
|
491
585
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
492
586
|
}
|
|
587
|
+
export function __wbg_value_9cc0518af87a489c(arg0) {
|
|
588
|
+
const ret = getObject(arg0).value;
|
|
589
|
+
return addHeapObject(ret);
|
|
590
|
+
}
|
|
493
591
|
export function __wbindgen_cast_0000000000000001(arg0) {
|
|
494
592
|
// Cast intrinsic for `F64 -> Externref`.
|
|
495
593
|
const ret = arg0;
|
|
@@ -510,6 +608,9 @@ export function __wbindgen_object_drop_ref(arg0) {
|
|
|
510
608
|
const GovernanceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
511
609
|
? { register: () => {}, unregister: () => {} }
|
|
512
610
|
: new FinalizationRegistry(ptr => wasm.__wbg_governance_free(ptr, 1));
|
|
611
|
+
const IdlePipelineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
612
|
+
? { register: () => {}, unregister: () => {} }
|
|
613
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_idlepipeline_free(ptr, 1));
|
|
513
614
|
const KernelRuntimeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
514
615
|
? { register: () => {}, unregister: () => {} }
|
|
515
616
|
: new FinalizationRegistry(ptr => wasm.__wbg_kernelruntime_free(ptr, 1));
|
package/deepstrike_wasm_bg.wasm
CHANGED
|
Binary file
|