entroly-wasm 1.0.5 → 1.0.7
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/index.js +26 -1
- package/package.json +1 -1
- package/pkg/entroly_wasm.d.ts +4 -0
- package/pkg/entroly_wasm.js +35 -0
- package/pkg/entroly_wasm_bg.wasm +0 -0
package/index.js
CHANGED
|
@@ -13,11 +13,15 @@
|
|
|
13
13
|
let WasmEntrolyEngine;
|
|
14
14
|
let classifyQueryTransitionRust;
|
|
15
15
|
let rewardWeightedOptimizeRust;
|
|
16
|
+
let optimizeTaskProfilesRust;
|
|
17
|
+
let classifyLearningQueryRust;
|
|
16
18
|
function bindWasmExports(mod) {
|
|
17
19
|
({
|
|
18
20
|
WasmEntrolyEngine,
|
|
19
21
|
classify_query_transition: classifyQueryTransitionRust,
|
|
20
22
|
reward_weighted_optimize: rewardWeightedOptimizeRust,
|
|
23
|
+
optimize_task_profiles: optimizeTaskProfilesRust,
|
|
24
|
+
classify_learning_query: classifyLearningQueryRust,
|
|
21
25
|
} = mod);
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -34,7 +38,12 @@ function buildAndBindWasm() {
|
|
|
34
38
|
|
|
35
39
|
try {
|
|
36
40
|
bindWasmExports(require('./pkg/entroly_wasm'));
|
|
37
|
-
if (
|
|
41
|
+
if (
|
|
42
|
+
!classifyQueryTransitionRust ||
|
|
43
|
+
!rewardWeightedOptimizeRust ||
|
|
44
|
+
!optimizeTaskProfilesRust ||
|
|
45
|
+
!classifyLearningQueryRust
|
|
46
|
+
) {
|
|
38
47
|
buildAndBindWasm();
|
|
39
48
|
}
|
|
40
49
|
} catch (err) {
|
|
@@ -71,12 +80,28 @@ function rewardWeightedOptimize(...args) {
|
|
|
71
80
|
return rewardWeightedOptimizeRust(...args);
|
|
72
81
|
}
|
|
73
82
|
|
|
83
|
+
function optimizeTaskProfiles(...args) {
|
|
84
|
+
if (!optimizeTaskProfilesRust) {
|
|
85
|
+
throw new Error('Rust optimize_task_profiles is unavailable; rebuild entroly-wasm');
|
|
86
|
+
}
|
|
87
|
+
return optimizeTaskProfilesRust(...args);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function classifyLearningQuery(...args) {
|
|
91
|
+
if (!classifyLearningQueryRust) {
|
|
92
|
+
throw new Error('Rust classify_learning_query is unavailable; rebuild entroly-wasm');
|
|
93
|
+
}
|
|
94
|
+
return classifyLearningQueryRust(...args);
|
|
95
|
+
}
|
|
96
|
+
|
|
74
97
|
module.exports = {
|
|
75
98
|
// Core engine (wasm)
|
|
76
99
|
EntrolyEngine: WasmEntrolyEngine,
|
|
77
100
|
WasmEntrolyEngine,
|
|
78
101
|
classifyQueryTransition,
|
|
79
102
|
rewardWeightedOptimize,
|
|
103
|
+
optimizeTaskProfiles,
|
|
104
|
+
classifyLearningQuery,
|
|
80
105
|
|
|
81
106
|
// Configuration
|
|
82
107
|
EntrolyConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entroly-wasm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Information-theoretic context optimization for AI coding agents. Zero-friction, pure WebAssembly - no Python dependency.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "pkg/entroly_wasm.d.ts",
|
package/pkg/entroly_wasm.d.ts
CHANGED
|
@@ -201,6 +201,10 @@ export class WasmEntrolyEngine {
|
|
|
201
201
|
stats(): any;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
export function classify_learning_query(query: string): string;
|
|
205
|
+
|
|
204
206
|
export function classify_query_transition(prev_hash: bigint, current_query: string, elapsed_s: number, time_window_s: number, rephrase_threshold: number, topic_change_threshold: number): any;
|
|
205
207
|
|
|
208
|
+
export function optimize_task_profiles(episodes_json: string): any;
|
|
209
|
+
|
|
206
210
|
export function reward_weighted_optimize(episodes_json: string, current_weights_json: string): any;
|
package/pkg/entroly_wasm.js
CHANGED
|
@@ -436,6 +436,26 @@ class WasmEntrolyEngine {
|
|
|
436
436
|
if (Symbol.dispose) WasmEntrolyEngine.prototype[Symbol.dispose] = WasmEntrolyEngine.prototype.free;
|
|
437
437
|
exports.WasmEntrolyEngine = WasmEntrolyEngine;
|
|
438
438
|
|
|
439
|
+
/**
|
|
440
|
+
* @param {string} query
|
|
441
|
+
* @returns {string}
|
|
442
|
+
*/
|
|
443
|
+
function classify_learning_query(query) {
|
|
444
|
+
let deferred2_0;
|
|
445
|
+
let deferred2_1;
|
|
446
|
+
try {
|
|
447
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
448
|
+
const len0 = WASM_VECTOR_LEN;
|
|
449
|
+
const ret = wasm.classify_learning_query(ptr0, len0);
|
|
450
|
+
deferred2_0 = ret[0];
|
|
451
|
+
deferred2_1 = ret[1];
|
|
452
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
453
|
+
} finally {
|
|
454
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
exports.classify_learning_query = classify_learning_query;
|
|
458
|
+
|
|
439
459
|
/**
|
|
440
460
|
* @param {bigint} prev_hash
|
|
441
461
|
* @param {string} current_query
|
|
@@ -453,6 +473,21 @@ function classify_query_transition(prev_hash, current_query, elapsed_s, time_win
|
|
|
453
473
|
}
|
|
454
474
|
exports.classify_query_transition = classify_query_transition;
|
|
455
475
|
|
|
476
|
+
/**
|
|
477
|
+
* @param {string} episodes_json
|
|
478
|
+
* @returns {any}
|
|
479
|
+
*/
|
|
480
|
+
function optimize_task_profiles(episodes_json) {
|
|
481
|
+
const ptr0 = passStringToWasm0(episodes_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
482
|
+
const len0 = WASM_VECTOR_LEN;
|
|
483
|
+
const ret = wasm.optimize_task_profiles(ptr0, len0);
|
|
484
|
+
if (ret[2]) {
|
|
485
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
486
|
+
}
|
|
487
|
+
return takeFromExternrefTable0(ret[0]);
|
|
488
|
+
}
|
|
489
|
+
exports.optimize_task_profiles = optimize_task_profiles;
|
|
490
|
+
|
|
456
491
|
/**
|
|
457
492
|
* @param {string} episodes_json
|
|
458
493
|
* @param {string} current_weights_json
|
package/pkg/entroly_wasm_bg.wasm
CHANGED
|
Binary file
|