entroly 0.15.0 → 0.19.13
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/README.md +35 -0
- package/bin/entroly.js +15 -0
- package/index.js +1 -0
- package/package.json +32 -8
- package/entroly_wasm.d.ts +0 -156
- package/entroly_wasm.js +0 -468
- package/entroly_wasm_bg.wasm +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# entroly
|
|
2
|
+
|
|
3
|
+
Compatibility package for npm users.
|
|
4
|
+
|
|
5
|
+
This package installs the current Node/WebAssembly Entroly runtime by depending
|
|
6
|
+
on [`entroly-wasm`](https://www.npmjs.com/package/entroly-wasm), then exposes a
|
|
7
|
+
short `entroly` binary that delegates to `entroly-wasm`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g entroly
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Equivalent direct package:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g entroly-wasm
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
entroly serve
|
|
25
|
+
entroly optimize 8000 "fix the auth bug"
|
|
26
|
+
entroly health
|
|
27
|
+
entroly demo
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For Python users, use the PyPI package instead:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install entroly
|
|
34
|
+
entroly go
|
|
35
|
+
```
|
package/bin/entroly.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
|
|
5
|
+
const target = require.resolve("entroly-wasm/bin/entroly-wasm.js");
|
|
6
|
+
const result = spawnSync(process.execPath, [target, ...process.argv.slice(2)], {
|
|
7
|
+
stdio: "inherit",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
if (result.error) {
|
|
11
|
+
console.error(result.error.message);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("entroly-wasm");
|
package/package.json
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entroly",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"version": "0.19.13",
|
|
4
|
+
"description": "Compatibility alias for Entroly's Node/WASM runtime. Installs and delegates to entroly-wasm.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"entroly": "./bin/entroly.js"
|
|
8
|
+
},
|
|
5
9
|
"files": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
10
|
+
"index.js",
|
|
11
|
+
"bin/entroly.js",
|
|
12
|
+
"README.md"
|
|
9
13
|
],
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
}
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"entroly-wasm": "0.19.13"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/juyterman1000/entroly"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"entroly",
|
|
23
|
+
"entroly-wasm",
|
|
24
|
+
"context-optimization",
|
|
25
|
+
"mcp",
|
|
26
|
+
"mcp-server",
|
|
27
|
+
"ai",
|
|
28
|
+
"agents",
|
|
29
|
+
"webassembly"
|
|
30
|
+
],
|
|
31
|
+
"author": "entroly",
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=16.0.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/entroly_wasm.d.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
export class WasmEntrolyEngine {
|
|
5
|
-
free(): void;
|
|
6
|
-
[Symbol.dispose](): void;
|
|
7
|
-
/**
|
|
8
|
-
* Advance the turn counter and apply Ebbinghaus decay.
|
|
9
|
-
*/
|
|
10
|
-
advance_turn(): void;
|
|
11
|
-
/**
|
|
12
|
-
* Analyze codebase health (A-F grade).
|
|
13
|
-
*/
|
|
14
|
-
analyze_health(): any;
|
|
15
|
-
/**
|
|
16
|
-
* Clear EGSC cache.
|
|
17
|
-
*/
|
|
18
|
-
cache_clear(): void;
|
|
19
|
-
/**
|
|
20
|
-
* Cache hit rate.
|
|
21
|
-
*/
|
|
22
|
-
cache_hit_rate(): number;
|
|
23
|
-
/**
|
|
24
|
-
* Cache empty check.
|
|
25
|
-
*/
|
|
26
|
-
cache_is_empty(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Cache entry count.
|
|
29
|
-
*/
|
|
30
|
-
cache_len(): number;
|
|
31
|
-
/**
|
|
32
|
-
* Classify a task query.
|
|
33
|
-
*/
|
|
34
|
-
classify_task(query: string): any;
|
|
35
|
-
/**
|
|
36
|
-
* Clear all fragments and reset engine.
|
|
37
|
-
*/
|
|
38
|
-
clear(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Dependency graph stats.
|
|
41
|
-
*/
|
|
42
|
-
dep_graph_stats(): any;
|
|
43
|
-
/**
|
|
44
|
-
* Detect entropy anomalies.
|
|
45
|
-
*/
|
|
46
|
-
entropy_anomalies(): any;
|
|
47
|
-
/**
|
|
48
|
-
* Explain why each fragment was selected/excluded in last optimization.
|
|
49
|
-
*/
|
|
50
|
-
explain_selection(): any;
|
|
51
|
-
/**
|
|
52
|
-
* Export all fragments as JSON.
|
|
53
|
-
*/
|
|
54
|
-
export_fragments(): any;
|
|
55
|
-
/**
|
|
56
|
-
* Export full engine state as JSON string.
|
|
57
|
-
*/
|
|
58
|
-
export_state(): any;
|
|
59
|
-
/**
|
|
60
|
-
* Get fragment count.
|
|
61
|
-
*/
|
|
62
|
-
fragment_count(): number;
|
|
63
|
-
/**
|
|
64
|
-
* Get the current turn number.
|
|
65
|
-
*/
|
|
66
|
-
get_turn(): number;
|
|
67
|
-
/**
|
|
68
|
-
* Hierarchical context compression.
|
|
69
|
-
*/
|
|
70
|
-
hierarchical_compress(token_budget: number, query: string): any;
|
|
71
|
-
/**
|
|
72
|
-
* Import engine state from JSON string.
|
|
73
|
-
*/
|
|
74
|
-
import_state(json_str: string): any;
|
|
75
|
-
/**
|
|
76
|
-
* Ingest a context fragment into the engine.
|
|
77
|
-
* Pipeline: tokens → SimHash → dedup → entropy → criticality → depgraph → store
|
|
78
|
-
*/
|
|
79
|
-
ingest(content: string, source: string, token_count: number, is_pinned: boolean): any;
|
|
80
|
-
/**
|
|
81
|
-
* Create a new Entroly engine with default parameters.
|
|
82
|
-
*/
|
|
83
|
-
constructor();
|
|
84
|
-
/**
|
|
85
|
-
* Full optimization pipeline: IOS + PRISM + Channel Coding + Resonance + Causal.
|
|
86
|
-
*/
|
|
87
|
-
optimize(token_budget: number, query: string): any;
|
|
88
|
-
/**
|
|
89
|
-
* Query manifold stats.
|
|
90
|
-
*/
|
|
91
|
-
query_manifold_stats(): any;
|
|
92
|
-
/**
|
|
93
|
-
* Semantic recall of relevant fragments.
|
|
94
|
-
*/
|
|
95
|
-
recall(query: string, top_k: number): any;
|
|
96
|
-
/**
|
|
97
|
-
* Record failed outcome for specific fragment IDs.
|
|
98
|
-
*/
|
|
99
|
-
record_failure(fragment_ids_json: string): void;
|
|
100
|
-
/**
|
|
101
|
-
* Record a continuous reward signal.
|
|
102
|
-
*/
|
|
103
|
-
record_reward(fragment_ids_json: string, reward: number): void;
|
|
104
|
-
/**
|
|
105
|
-
* Record successful outcome for specific fragment IDs.
|
|
106
|
-
*/
|
|
107
|
-
record_success(fragment_ids_json: string): void;
|
|
108
|
-
/**
|
|
109
|
-
* Remove a fragment by ID.
|
|
110
|
-
*/
|
|
111
|
-
remove(fragment_id: string): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Scan a fragment for security vulnerabilities.
|
|
114
|
-
*/
|
|
115
|
-
scan_fragment(fragment_id: string): any;
|
|
116
|
-
/**
|
|
117
|
-
* Score context utilization from LLM response.
|
|
118
|
-
*/
|
|
119
|
-
score_utilization(response: string): any;
|
|
120
|
-
/**
|
|
121
|
-
* Security report for all fragments.
|
|
122
|
-
*/
|
|
123
|
-
security_report(): any;
|
|
124
|
-
/**
|
|
125
|
-
* Semantic dedup report.
|
|
126
|
-
*/
|
|
127
|
-
semantic_dedup_report(): any;
|
|
128
|
-
/**
|
|
129
|
-
* Set cost-per-token directly.
|
|
130
|
-
*/
|
|
131
|
-
set_cache_cost_per_token(cost: number): void;
|
|
132
|
-
/**
|
|
133
|
-
* Enable/disable channel coding.
|
|
134
|
-
*/
|
|
135
|
-
set_channel_coding_enabled(enabled: boolean): void;
|
|
136
|
-
/**
|
|
137
|
-
* Set exploration rate.
|
|
138
|
-
*/
|
|
139
|
-
set_exploration_rate(rate: number): void;
|
|
140
|
-
/**
|
|
141
|
-
* Set cost model from model name.
|
|
142
|
-
*/
|
|
143
|
-
set_model(model_name: string): void;
|
|
144
|
-
/**
|
|
145
|
-
* Enable/disable query personas.
|
|
146
|
-
*/
|
|
147
|
-
set_query_personas_enabled(enabled: boolean): void;
|
|
148
|
-
/**
|
|
149
|
-
* Set scoring weights (normalized to sum=1.0).
|
|
150
|
-
*/
|
|
151
|
-
set_weights(w_recency: number, w_frequency: number, w_semantic: number, w_entropy: number): void;
|
|
152
|
-
/**
|
|
153
|
-
* Get full engine statistics as JSON.
|
|
154
|
-
*/
|
|
155
|
-
stats(): any;
|
|
156
|
-
}
|
package/entroly_wasm.js
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./entroly_wasm.d.ts" */
|
|
2
|
-
|
|
3
|
-
class WasmEntrolyEngine {
|
|
4
|
-
__destroy_into_raw() {
|
|
5
|
-
const ptr = this.__wbg_ptr;
|
|
6
|
-
this.__wbg_ptr = 0;
|
|
7
|
-
WasmEntrolyEngineFinalization.unregister(this);
|
|
8
|
-
return ptr;
|
|
9
|
-
}
|
|
10
|
-
free() {
|
|
11
|
-
const ptr = this.__destroy_into_raw();
|
|
12
|
-
wasm.__wbg_wasmentrolyengine_free(ptr, 0);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Advance the turn counter and apply Ebbinghaus decay.
|
|
16
|
-
*/
|
|
17
|
-
advance_turn() {
|
|
18
|
-
wasm.wasmentrolyengine_advance_turn(this.__wbg_ptr);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Analyze codebase health (A-F grade).
|
|
22
|
-
* @returns {any}
|
|
23
|
-
*/
|
|
24
|
-
analyze_health() {
|
|
25
|
-
const ret = wasm.wasmentrolyengine_analyze_health(this.__wbg_ptr);
|
|
26
|
-
return ret;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Clear EGSC cache.
|
|
30
|
-
*/
|
|
31
|
-
cache_clear() {
|
|
32
|
-
wasm.wasmentrolyengine_cache_clear(this.__wbg_ptr);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Cache hit rate.
|
|
36
|
-
* @returns {number}
|
|
37
|
-
*/
|
|
38
|
-
cache_hit_rate() {
|
|
39
|
-
const ret = wasm.wasmentrolyengine_cache_hit_rate(this.__wbg_ptr);
|
|
40
|
-
return ret;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Cache empty check.
|
|
44
|
-
* @returns {boolean}
|
|
45
|
-
*/
|
|
46
|
-
cache_is_empty() {
|
|
47
|
-
const ret = wasm.wasmentrolyengine_cache_is_empty(this.__wbg_ptr);
|
|
48
|
-
return ret !== 0;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Cache entry count.
|
|
52
|
-
* @returns {number}
|
|
53
|
-
*/
|
|
54
|
-
cache_len() {
|
|
55
|
-
const ret = wasm.wasmentrolyengine_cache_len(this.__wbg_ptr);
|
|
56
|
-
return ret >>> 0;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Classify a task query.
|
|
60
|
-
* @param {string} query
|
|
61
|
-
* @returns {any}
|
|
62
|
-
*/
|
|
63
|
-
classify_task(query) {
|
|
64
|
-
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
65
|
-
const len0 = WASM_VECTOR_LEN;
|
|
66
|
-
const ret = wasm.wasmentrolyengine_classify_task(this.__wbg_ptr, ptr0, len0);
|
|
67
|
-
return ret;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Clear all fragments and reset engine.
|
|
71
|
-
*/
|
|
72
|
-
clear() {
|
|
73
|
-
wasm.wasmentrolyengine_clear(this.__wbg_ptr);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Dependency graph stats.
|
|
77
|
-
* @returns {any}
|
|
78
|
-
*/
|
|
79
|
-
dep_graph_stats() {
|
|
80
|
-
const ret = wasm.wasmentrolyengine_dep_graph_stats(this.__wbg_ptr);
|
|
81
|
-
return ret;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Detect entropy anomalies.
|
|
85
|
-
* @returns {any}
|
|
86
|
-
*/
|
|
87
|
-
entropy_anomalies() {
|
|
88
|
-
const ret = wasm.wasmentrolyengine_entropy_anomalies(this.__wbg_ptr);
|
|
89
|
-
return ret;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Explain why each fragment was selected/excluded in last optimization.
|
|
93
|
-
* @returns {any}
|
|
94
|
-
*/
|
|
95
|
-
explain_selection() {
|
|
96
|
-
const ret = wasm.wasmentrolyengine_explain_selection(this.__wbg_ptr);
|
|
97
|
-
return ret;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Export all fragments as JSON.
|
|
101
|
-
* @returns {any}
|
|
102
|
-
*/
|
|
103
|
-
export_fragments() {
|
|
104
|
-
const ret = wasm.wasmentrolyengine_export_fragments(this.__wbg_ptr);
|
|
105
|
-
return ret;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Export full engine state as JSON string.
|
|
109
|
-
* @returns {any}
|
|
110
|
-
*/
|
|
111
|
-
export_state() {
|
|
112
|
-
const ret = wasm.wasmentrolyengine_export_state(this.__wbg_ptr);
|
|
113
|
-
return ret;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Get fragment count.
|
|
117
|
-
* @returns {number}
|
|
118
|
-
*/
|
|
119
|
-
fragment_count() {
|
|
120
|
-
const ret = wasm.wasmentrolyengine_fragment_count(this.__wbg_ptr);
|
|
121
|
-
return ret >>> 0;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Get the current turn number.
|
|
125
|
-
* @returns {number}
|
|
126
|
-
*/
|
|
127
|
-
get_turn() {
|
|
128
|
-
const ret = wasm.wasmentrolyengine_get_turn(this.__wbg_ptr);
|
|
129
|
-
return ret >>> 0;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Hierarchical context compression.
|
|
133
|
-
* @param {number} token_budget
|
|
134
|
-
* @param {string} query
|
|
135
|
-
* @returns {any}
|
|
136
|
-
*/
|
|
137
|
-
hierarchical_compress(token_budget, query) {
|
|
138
|
-
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
139
|
-
const len0 = WASM_VECTOR_LEN;
|
|
140
|
-
const ret = wasm.wasmentrolyengine_hierarchical_compress(this.__wbg_ptr, token_budget, ptr0, len0);
|
|
141
|
-
return ret;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Import engine state from JSON string.
|
|
145
|
-
* @param {string} json_str
|
|
146
|
-
* @returns {any}
|
|
147
|
-
*/
|
|
148
|
-
import_state(json_str) {
|
|
149
|
-
const ptr0 = passStringToWasm0(json_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
150
|
-
const len0 = WASM_VECTOR_LEN;
|
|
151
|
-
const ret = wasm.wasmentrolyengine_import_state(this.__wbg_ptr, ptr0, len0);
|
|
152
|
-
return ret;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Ingest a context fragment into the engine.
|
|
156
|
-
* Pipeline: tokens → SimHash → dedup → entropy → criticality → depgraph → store
|
|
157
|
-
* @param {string} content
|
|
158
|
-
* @param {string} source
|
|
159
|
-
* @param {number} token_count
|
|
160
|
-
* @param {boolean} is_pinned
|
|
161
|
-
* @returns {any}
|
|
162
|
-
*/
|
|
163
|
-
ingest(content, source, token_count, is_pinned) {
|
|
164
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
165
|
-
const len0 = WASM_VECTOR_LEN;
|
|
166
|
-
const ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
167
|
-
const len1 = WASM_VECTOR_LEN;
|
|
168
|
-
const ret = wasm.wasmentrolyengine_ingest(this.__wbg_ptr, ptr0, len0, ptr1, len1, token_count, is_pinned);
|
|
169
|
-
return ret;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Create a new Entroly engine with default parameters.
|
|
173
|
-
*/
|
|
174
|
-
constructor() {
|
|
175
|
-
const ret = wasm.wasmentrolyengine_new();
|
|
176
|
-
this.__wbg_ptr = ret >>> 0;
|
|
177
|
-
WasmEntrolyEngineFinalization.register(this, this.__wbg_ptr, this);
|
|
178
|
-
return this;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Full optimization pipeline: IOS + PRISM + Channel Coding + Resonance + Causal.
|
|
182
|
-
* @param {number} token_budget
|
|
183
|
-
* @param {string} query
|
|
184
|
-
* @returns {any}
|
|
185
|
-
*/
|
|
186
|
-
optimize(token_budget, query) {
|
|
187
|
-
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
-
const len0 = WASM_VECTOR_LEN;
|
|
189
|
-
const ret = wasm.wasmentrolyengine_optimize(this.__wbg_ptr, token_budget, ptr0, len0);
|
|
190
|
-
return ret;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Query manifold stats.
|
|
194
|
-
* @returns {any}
|
|
195
|
-
*/
|
|
196
|
-
query_manifold_stats() {
|
|
197
|
-
const ret = wasm.wasmentrolyengine_query_manifold_stats(this.__wbg_ptr);
|
|
198
|
-
return ret;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Semantic recall of relevant fragments.
|
|
202
|
-
* @param {string} query
|
|
203
|
-
* @param {number} top_k
|
|
204
|
-
* @returns {any}
|
|
205
|
-
*/
|
|
206
|
-
recall(query, top_k) {
|
|
207
|
-
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
208
|
-
const len0 = WASM_VECTOR_LEN;
|
|
209
|
-
const ret = wasm.wasmentrolyengine_recall(this.__wbg_ptr, ptr0, len0, top_k);
|
|
210
|
-
return ret;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Record failed outcome for specific fragment IDs.
|
|
214
|
-
* @param {string} fragment_ids_json
|
|
215
|
-
*/
|
|
216
|
-
record_failure(fragment_ids_json) {
|
|
217
|
-
const ptr0 = passStringToWasm0(fragment_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
218
|
-
const len0 = WASM_VECTOR_LEN;
|
|
219
|
-
wasm.wasmentrolyengine_record_failure(this.__wbg_ptr, ptr0, len0);
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Record a continuous reward signal.
|
|
223
|
-
* @param {string} fragment_ids_json
|
|
224
|
-
* @param {number} reward
|
|
225
|
-
*/
|
|
226
|
-
record_reward(fragment_ids_json, reward) {
|
|
227
|
-
const ptr0 = passStringToWasm0(fragment_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
228
|
-
const len0 = WASM_VECTOR_LEN;
|
|
229
|
-
wasm.wasmentrolyengine_record_reward(this.__wbg_ptr, ptr0, len0, reward);
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Record successful outcome for specific fragment IDs.
|
|
233
|
-
* @param {string} fragment_ids_json
|
|
234
|
-
*/
|
|
235
|
-
record_success(fragment_ids_json) {
|
|
236
|
-
const ptr0 = passStringToWasm0(fragment_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
237
|
-
const len0 = WASM_VECTOR_LEN;
|
|
238
|
-
wasm.wasmentrolyengine_record_success(this.__wbg_ptr, ptr0, len0);
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Remove a fragment by ID.
|
|
242
|
-
* @param {string} fragment_id
|
|
243
|
-
* @returns {boolean}
|
|
244
|
-
*/
|
|
245
|
-
remove(fragment_id) {
|
|
246
|
-
const ptr0 = passStringToWasm0(fragment_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
247
|
-
const len0 = WASM_VECTOR_LEN;
|
|
248
|
-
const ret = wasm.wasmentrolyengine_remove(this.__wbg_ptr, ptr0, len0);
|
|
249
|
-
return ret !== 0;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Scan a fragment for security vulnerabilities.
|
|
253
|
-
* @param {string} fragment_id
|
|
254
|
-
* @returns {any}
|
|
255
|
-
*/
|
|
256
|
-
scan_fragment(fragment_id) {
|
|
257
|
-
const ptr0 = passStringToWasm0(fragment_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
-
const len0 = WASM_VECTOR_LEN;
|
|
259
|
-
const ret = wasm.wasmentrolyengine_scan_fragment(this.__wbg_ptr, ptr0, len0);
|
|
260
|
-
return ret;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Score context utilization from LLM response.
|
|
264
|
-
* @param {string} response
|
|
265
|
-
* @returns {any}
|
|
266
|
-
*/
|
|
267
|
-
score_utilization(response) {
|
|
268
|
-
const ptr0 = passStringToWasm0(response, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
-
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
const ret = wasm.wasmentrolyengine_score_utilization(this.__wbg_ptr, ptr0, len0);
|
|
271
|
-
return ret;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Security report for all fragments.
|
|
275
|
-
* @returns {any}
|
|
276
|
-
*/
|
|
277
|
-
security_report() {
|
|
278
|
-
const ret = wasm.wasmentrolyengine_security_report(this.__wbg_ptr);
|
|
279
|
-
return ret;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Semantic dedup report.
|
|
283
|
-
* @returns {any}
|
|
284
|
-
*/
|
|
285
|
-
semantic_dedup_report() {
|
|
286
|
-
const ret = wasm.wasmentrolyengine_semantic_dedup_report(this.__wbg_ptr);
|
|
287
|
-
return ret;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Set cost-per-token directly.
|
|
291
|
-
* @param {number} cost
|
|
292
|
-
*/
|
|
293
|
-
set_cache_cost_per_token(cost) {
|
|
294
|
-
wasm.wasmentrolyengine_set_cache_cost_per_token(this.__wbg_ptr, cost);
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Enable/disable channel coding.
|
|
298
|
-
* @param {boolean} enabled
|
|
299
|
-
*/
|
|
300
|
-
set_channel_coding_enabled(enabled) {
|
|
301
|
-
wasm.wasmentrolyengine_set_channel_coding_enabled(this.__wbg_ptr, enabled);
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Set exploration rate.
|
|
305
|
-
* @param {number} rate
|
|
306
|
-
*/
|
|
307
|
-
set_exploration_rate(rate) {
|
|
308
|
-
wasm.wasmentrolyengine_set_exploration_rate(this.__wbg_ptr, rate);
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Set cost model from model name.
|
|
312
|
-
* @param {string} model_name
|
|
313
|
-
*/
|
|
314
|
-
set_model(model_name) {
|
|
315
|
-
const ptr0 = passStringToWasm0(model_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
316
|
-
const len0 = WASM_VECTOR_LEN;
|
|
317
|
-
wasm.wasmentrolyengine_set_model(this.__wbg_ptr, ptr0, len0);
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Enable/disable query personas.
|
|
321
|
-
* @param {boolean} enabled
|
|
322
|
-
*/
|
|
323
|
-
set_query_personas_enabled(enabled) {
|
|
324
|
-
wasm.wasmentrolyengine_set_query_personas_enabled(this.__wbg_ptr, enabled);
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Set scoring weights (normalized to sum=1.0).
|
|
328
|
-
* @param {number} w_recency
|
|
329
|
-
* @param {number} w_frequency
|
|
330
|
-
* @param {number} w_semantic
|
|
331
|
-
* @param {number} w_entropy
|
|
332
|
-
*/
|
|
333
|
-
set_weights(w_recency, w_frequency, w_semantic, w_entropy) {
|
|
334
|
-
wasm.wasmentrolyengine_set_weights(this.__wbg_ptr, w_recency, w_frequency, w_semantic, w_entropy);
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Get full engine statistics as JSON.
|
|
338
|
-
* @returns {any}
|
|
339
|
-
*/
|
|
340
|
-
stats() {
|
|
341
|
-
const ret = wasm.wasmentrolyengine_stats(this.__wbg_ptr);
|
|
342
|
-
return ret;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
if (Symbol.dispose) WasmEntrolyEngine.prototype[Symbol.dispose] = WasmEntrolyEngine.prototype.free;
|
|
346
|
-
exports.WasmEntrolyEngine = WasmEntrolyEngine;
|
|
347
|
-
|
|
348
|
-
function __wbg_get_imports() {
|
|
349
|
-
const import0 = {
|
|
350
|
-
__proto__: null,
|
|
351
|
-
__wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
|
|
352
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
353
|
-
},
|
|
354
|
-
__wbg_parse_545d11396395fbbd: function() { return handleError(function (arg0, arg1) {
|
|
355
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
356
|
-
return ret;
|
|
357
|
-
}, arguments); },
|
|
358
|
-
__wbindgen_init_externref_table: function() {
|
|
359
|
-
const table = wasm.__wbindgen_externrefs;
|
|
360
|
-
const offset = table.grow(4);
|
|
361
|
-
table.set(0, undefined);
|
|
362
|
-
table.set(offset + 0, undefined);
|
|
363
|
-
table.set(offset + 1, null);
|
|
364
|
-
table.set(offset + 2, true);
|
|
365
|
-
table.set(offset + 3, false);
|
|
366
|
-
},
|
|
367
|
-
};
|
|
368
|
-
return {
|
|
369
|
-
__proto__: null,
|
|
370
|
-
"./entroly_wasm_bg.js": import0,
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const WasmEntrolyEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
375
|
-
? { register: () => {}, unregister: () => {} }
|
|
376
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmentrolyengine_free(ptr >>> 0, 1));
|
|
377
|
-
|
|
378
|
-
function addToExternrefTable0(obj) {
|
|
379
|
-
const idx = wasm.__externref_table_alloc();
|
|
380
|
-
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
381
|
-
return idx;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
function getStringFromWasm0(ptr, len) {
|
|
385
|
-
ptr = ptr >>> 0;
|
|
386
|
-
return decodeText(ptr, len);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
let cachedUint8ArrayMemory0 = null;
|
|
390
|
-
function getUint8ArrayMemory0() {
|
|
391
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
392
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
393
|
-
}
|
|
394
|
-
return cachedUint8ArrayMemory0;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
function handleError(f, args) {
|
|
398
|
-
try {
|
|
399
|
-
return f.apply(this, args);
|
|
400
|
-
} catch (e) {
|
|
401
|
-
const idx = addToExternrefTable0(e);
|
|
402
|
-
wasm.__wbindgen_exn_store(idx);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
407
|
-
if (realloc === undefined) {
|
|
408
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
409
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
410
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
411
|
-
WASM_VECTOR_LEN = buf.length;
|
|
412
|
-
return ptr;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
let len = arg.length;
|
|
416
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
417
|
-
|
|
418
|
-
const mem = getUint8ArrayMemory0();
|
|
419
|
-
|
|
420
|
-
let offset = 0;
|
|
421
|
-
|
|
422
|
-
for (; offset < len; offset++) {
|
|
423
|
-
const code = arg.charCodeAt(offset);
|
|
424
|
-
if (code > 0x7F) break;
|
|
425
|
-
mem[ptr + offset] = code;
|
|
426
|
-
}
|
|
427
|
-
if (offset !== len) {
|
|
428
|
-
if (offset !== 0) {
|
|
429
|
-
arg = arg.slice(offset);
|
|
430
|
-
}
|
|
431
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
432
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
433
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
434
|
-
|
|
435
|
-
offset += ret.written;
|
|
436
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
WASM_VECTOR_LEN = offset;
|
|
440
|
-
return ptr;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
444
|
-
cachedTextDecoder.decode();
|
|
445
|
-
function decodeText(ptr, len) {
|
|
446
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
const cachedTextEncoder = new TextEncoder();
|
|
450
|
-
|
|
451
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
452
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
453
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
454
|
-
view.set(buf);
|
|
455
|
-
return {
|
|
456
|
-
read: arg.length,
|
|
457
|
-
written: buf.length
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
let WASM_VECTOR_LEN = 0;
|
|
463
|
-
|
|
464
|
-
const wasmPath = `${__dirname}/entroly_wasm_bg.wasm`;
|
|
465
|
-
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
466
|
-
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
467
|
-
let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
468
|
-
wasm.__wbindgen_start();
|
package/entroly_wasm_bg.wasm
DELETED
|
Binary file
|