sentienceapi 0.90.9__py3-none-any.whl

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.

Potentially problematic release.


This version of sentienceapi might be problematic. Click here for more details.

Files changed (46) hide show
  1. sentience/__init__.py +153 -0
  2. sentience/actions.py +439 -0
  3. sentience/agent.py +687 -0
  4. sentience/agent_config.py +43 -0
  5. sentience/base_agent.py +101 -0
  6. sentience/browser.py +409 -0
  7. sentience/cli.py +130 -0
  8. sentience/cloud_tracing.py +292 -0
  9. sentience/conversational_agent.py +509 -0
  10. sentience/expect.py +92 -0
  11. sentience/extension/background.js +233 -0
  12. sentience/extension/content.js +298 -0
  13. sentience/extension/injected_api.js +1473 -0
  14. sentience/extension/manifest.json +36 -0
  15. sentience/extension/pkg/sentience_core.d.ts +51 -0
  16. sentience/extension/pkg/sentience_core.js +529 -0
  17. sentience/extension/pkg/sentience_core_bg.wasm +0 -0
  18. sentience/extension/pkg/sentience_core_bg.wasm.d.ts +10 -0
  19. sentience/extension/release.json +115 -0
  20. sentience/extension/test-content.js +4 -0
  21. sentience/formatting.py +59 -0
  22. sentience/generator.py +202 -0
  23. sentience/inspector.py +185 -0
  24. sentience/llm_provider.py +431 -0
  25. sentience/models.py +406 -0
  26. sentience/overlay.py +115 -0
  27. sentience/query.py +303 -0
  28. sentience/read.py +96 -0
  29. sentience/recorder.py +369 -0
  30. sentience/schemas/trace_v1.json +216 -0
  31. sentience/screenshot.py +54 -0
  32. sentience/snapshot.py +282 -0
  33. sentience/text_search.py +107 -0
  34. sentience/trace_indexing/__init__.py +27 -0
  35. sentience/trace_indexing/index_schema.py +111 -0
  36. sentience/trace_indexing/indexer.py +363 -0
  37. sentience/tracer_factory.py +211 -0
  38. sentience/tracing.py +285 -0
  39. sentience/utils.py +296 -0
  40. sentience/wait.py +73 -0
  41. sentienceapi-0.90.9.dist-info/METADATA +878 -0
  42. sentienceapi-0.90.9.dist-info/RECORD +46 -0
  43. sentienceapi-0.90.9.dist-info/WHEEL +5 -0
  44. sentienceapi-0.90.9.dist-info/entry_points.txt +2 -0
  45. sentienceapi-0.90.9.dist-info/licenses/LICENSE.md +43 -0
  46. sentienceapi-0.90.9.dist-info/top_level.txt +1 -0
@@ -0,0 +1,36 @@
1
+ {
2
+ "manifest_version": 3,
3
+ "name": "Sentience Semantic Visual Grounding Extractor",
4
+ "version": "2.0.7",
5
+ "description": "Extract semantic visual grounding data from web pages",
6
+ "permissions": ["activeTab", "scripting"],
7
+ "host_permissions": ["<all_urls>"],
8
+ "background": {
9
+ "service_worker": "background.js",
10
+ "type": "module"
11
+ },
12
+ "web_accessible_resources": [
13
+ {
14
+ "resources": ["pkg/*"],
15
+ "matches": ["<all_urls>"]
16
+ }
17
+ ],
18
+ "content_scripts": [
19
+ {
20
+ "matches": ["<all_urls>"],
21
+ "js": ["content.js"],
22
+ "run_at": "document_start",
23
+ "all_frames": true
24
+ },
25
+ {
26
+ "matches": ["<all_urls>"],
27
+ "js": ["injected_api.js"],
28
+ "run_at": "document_idle",
29
+ "world": "MAIN",
30
+ "all_frames": true
31
+ }
32
+ ],
33
+ "content_security_policy": {
34
+ "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
35
+ }
36
+ }
@@ -0,0 +1,51 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function analyze_page(val: any): any;
5
+
6
+ export function analyze_page_with_options(val: any, options: any): any;
7
+
8
+ export function decide_and_act(_raw_elements: any): void;
9
+
10
+ /**
11
+ * Prune raw elements before sending to API
12
+ * This is a "dumb" filter that reduces payload size without leaking proprietary IP
13
+ * Filters out: tiny elements, invisible elements, non-interactive wrapper divs
14
+ * Amazon: 5000-6000 elements -> ~200-400 elements (~95% reduction)
15
+ */
16
+ export function prune_for_api(val: any): any;
17
+
18
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
19
+
20
+ export interface InitOutput {
21
+ readonly memory: WebAssembly.Memory;
22
+ readonly analyze_page: (a: number) => number;
23
+ readonly analyze_page_with_options: (a: number, b: number) => number;
24
+ readonly decide_and_act: (a: number) => void;
25
+ readonly prune_for_api: (a: number) => number;
26
+ readonly __wbindgen_export: (a: number, b: number) => number;
27
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
28
+ readonly __wbindgen_export3: (a: number) => void;
29
+ }
30
+
31
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
32
+
33
+ /**
34
+ * Instantiates the given `module`, which can either be bytes or
35
+ * a precompiled `WebAssembly.Module`.
36
+ *
37
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
38
+ *
39
+ * @returns {InitOutput}
40
+ */
41
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
42
+
43
+ /**
44
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
45
+ * for everything else, calls `WebAssembly.instantiate` directly.
46
+ *
47
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
48
+ *
49
+ * @returns {Promise<InitOutput>}
50
+ */
51
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,529 @@
1
+ let wasm;
2
+
3
+ function addHeapObject(obj) {
4
+ if (heap_next === heap.length) heap.push(heap.length + 1);
5
+ const idx = heap_next;
6
+ heap_next = heap[idx];
7
+
8
+ heap[idx] = obj;
9
+ return idx;
10
+ }
11
+
12
+ function debugString(val) {
13
+ // primitive types
14
+ const type = typeof val;
15
+ if (type == 'number' || type == 'boolean' || val == null) {
16
+ return `${val}`;
17
+ }
18
+ if (type == 'string') {
19
+ return `"${val}"`;
20
+ }
21
+ if (type == 'symbol') {
22
+ const description = val.description;
23
+ if (description == null) {
24
+ return 'Symbol';
25
+ } else {
26
+ return `Symbol(${description})`;
27
+ }
28
+ }
29
+ if (type == 'function') {
30
+ const name = val.name;
31
+ if (typeof name == 'string' && name.length > 0) {
32
+ return `Function(${name})`;
33
+ } else {
34
+ return 'Function';
35
+ }
36
+ }
37
+ // objects
38
+ if (Array.isArray(val)) {
39
+ const length = val.length;
40
+ let debug = '[';
41
+ if (length > 0) {
42
+ debug += debugString(val[0]);
43
+ }
44
+ for(let i = 1; i < length; i++) {
45
+ debug += ', ' + debugString(val[i]);
46
+ }
47
+ debug += ']';
48
+ return debug;
49
+ }
50
+ // Test for built-in
51
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
52
+ let className;
53
+ if (builtInMatches && builtInMatches.length > 1) {
54
+ className = builtInMatches[1];
55
+ } else {
56
+ // Failed to match the standard '[object ClassName]'
57
+ return toString.call(val);
58
+ }
59
+ if (className == 'Object') {
60
+ // we're a user defined class or Object
61
+ // JSON.stringify avoids problems with cycles, and is generally much
62
+ // easier than looping through ownProperties of `val`.
63
+ try {
64
+ return 'Object(' + JSON.stringify(val) + ')';
65
+ } catch (_) {
66
+ return 'Object';
67
+ }
68
+ }
69
+ // errors
70
+ if (val instanceof Error) {
71
+ return `${val.name}: ${val.message}\n${val.stack}`;
72
+ }
73
+ // TODO we could test for more things here, like `Set`s and `Map`s.
74
+ return className;
75
+ }
76
+
77
+ function dropObject(idx) {
78
+ if (idx < 132) return;
79
+ heap[idx] = heap_next;
80
+ heap_next = idx;
81
+ }
82
+
83
+ function getArrayU8FromWasm0(ptr, len) {
84
+ ptr = ptr >>> 0;
85
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
86
+ }
87
+
88
+ let cachedDataViewMemory0 = null;
89
+ function getDataViewMemory0() {
90
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
91
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
92
+ }
93
+ return cachedDataViewMemory0;
94
+ }
95
+
96
+ function getStringFromWasm0(ptr, len) {
97
+ ptr = ptr >>> 0;
98
+ return decodeText(ptr, len);
99
+ }
100
+
101
+ let cachedUint8ArrayMemory0 = null;
102
+ function getUint8ArrayMemory0() {
103
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
104
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
105
+ }
106
+ return cachedUint8ArrayMemory0;
107
+ }
108
+
109
+ function getObject(idx) { return heap[idx]; }
110
+
111
+ function handleError(f, args) {
112
+ try {
113
+ return f.apply(this, args);
114
+ } catch (e) {
115
+ wasm.__wbindgen_export3(addHeapObject(e));
116
+ }
117
+ }
118
+
119
+ let heap = new Array(128).fill(undefined);
120
+ heap.push(undefined, null, true, false);
121
+
122
+ let heap_next = heap.length;
123
+
124
+ function isLikeNone(x) {
125
+ return x === undefined || x === null;
126
+ }
127
+
128
+ function passStringToWasm0(arg, malloc, realloc) {
129
+ if (realloc === undefined) {
130
+ const buf = cachedTextEncoder.encode(arg);
131
+ const ptr = malloc(buf.length, 1) >>> 0;
132
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
133
+ WASM_VECTOR_LEN = buf.length;
134
+ return ptr;
135
+ }
136
+
137
+ let len = arg.length;
138
+ let ptr = malloc(len, 1) >>> 0;
139
+
140
+ const mem = getUint8ArrayMemory0();
141
+
142
+ let offset = 0;
143
+
144
+ for (; offset < len; offset++) {
145
+ const code = arg.charCodeAt(offset);
146
+ if (code > 0x7F) break;
147
+ mem[ptr + offset] = code;
148
+ }
149
+ if (offset !== len) {
150
+ if (offset !== 0) {
151
+ arg = arg.slice(offset);
152
+ }
153
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
154
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
155
+ const ret = cachedTextEncoder.encodeInto(arg, view);
156
+
157
+ offset += ret.written;
158
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
159
+ }
160
+
161
+ WASM_VECTOR_LEN = offset;
162
+ return ptr;
163
+ }
164
+
165
+ function takeObject(idx) {
166
+ const ret = getObject(idx);
167
+ dropObject(idx);
168
+ return ret;
169
+ }
170
+
171
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
172
+ cachedTextDecoder.decode();
173
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
174
+ let numBytesDecoded = 0;
175
+ function decodeText(ptr, len) {
176
+ numBytesDecoded += len;
177
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
178
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
179
+ cachedTextDecoder.decode();
180
+ numBytesDecoded = len;
181
+ }
182
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
183
+ }
184
+
185
+ const cachedTextEncoder = new TextEncoder();
186
+
187
+ if (!('encodeInto' in cachedTextEncoder)) {
188
+ cachedTextEncoder.encodeInto = function (arg, view) {
189
+ const buf = cachedTextEncoder.encode(arg);
190
+ view.set(buf);
191
+ return {
192
+ read: arg.length,
193
+ written: buf.length
194
+ };
195
+ }
196
+ }
197
+
198
+ let WASM_VECTOR_LEN = 0;
199
+
200
+ /**
201
+ * @param {any} val
202
+ * @returns {any}
203
+ */
204
+ export function analyze_page(val) {
205
+ const ret = wasm.analyze_page(addHeapObject(val));
206
+ return takeObject(ret);
207
+ }
208
+
209
+ /**
210
+ * @param {any} val
211
+ * @param {any} options
212
+ * @returns {any}
213
+ */
214
+ export function analyze_page_with_options(val, options) {
215
+ const ret = wasm.analyze_page_with_options(addHeapObject(val), addHeapObject(options));
216
+ return takeObject(ret);
217
+ }
218
+
219
+ /**
220
+ * @param {any} _raw_elements
221
+ */
222
+ export function decide_and_act(_raw_elements) {
223
+ wasm.decide_and_act(addHeapObject(_raw_elements));
224
+ }
225
+
226
+ /**
227
+ * Prune raw elements before sending to API
228
+ * This is a "dumb" filter that reduces payload size without leaking proprietary IP
229
+ * Filters out: tiny elements, invisible elements, non-interactive wrapper divs
230
+ * Amazon: 5000-6000 elements -> ~200-400 elements (~95% reduction)
231
+ * @param {any} val
232
+ * @returns {any}
233
+ */
234
+ export function prune_for_api(val) {
235
+ const ret = wasm.prune_for_api(addHeapObject(val));
236
+ return takeObject(ret);
237
+ }
238
+
239
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
240
+
241
+ async function __wbg_load(module, imports) {
242
+ if (typeof Response === 'function' && module instanceof Response) {
243
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
244
+ try {
245
+ return await WebAssembly.instantiateStreaming(module, imports);
246
+ } catch (e) {
247
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
248
+
249
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
250
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
251
+
252
+ } else {
253
+ throw e;
254
+ }
255
+ }
256
+ }
257
+
258
+ const bytes = await module.arrayBuffer();
259
+ return await WebAssembly.instantiate(bytes, imports);
260
+ } else {
261
+ const instance = await WebAssembly.instantiate(module, imports);
262
+
263
+ if (instance instanceof WebAssembly.Instance) {
264
+ return { instance, module };
265
+ } else {
266
+ return instance;
267
+ }
268
+ }
269
+ }
270
+
271
+ function __wbg_get_imports() {
272
+ const imports = {};
273
+ imports.wbg = {};
274
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
275
+ const ret = Error(getStringFromWasm0(arg0, arg1));
276
+ return addHeapObject(ret);
277
+ };
278
+ imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
279
+ const ret = Number(getObject(arg0));
280
+ return ret;
281
+ };
282
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
283
+ const v = getObject(arg1);
284
+ const ret = typeof(v) === 'bigint' ? v : undefined;
285
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
286
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
287
+ };
288
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
289
+ const v = getObject(arg0);
290
+ const ret = typeof(v) === 'boolean' ? v : undefined;
291
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
292
+ };
293
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
294
+ const ret = debugString(getObject(arg1));
295
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
296
+ const len1 = WASM_VECTOR_LEN;
297
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
298
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
299
+ };
300
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
301
+ const ret = getObject(arg0) in getObject(arg1);
302
+ return ret;
303
+ };
304
+ imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
305
+ const ret = typeof(getObject(arg0)) === 'bigint';
306
+ return ret;
307
+ };
308
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
309
+ const ret = typeof(getObject(arg0)) === 'function';
310
+ return ret;
311
+ };
312
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
313
+ const val = getObject(arg0);
314
+ const ret = typeof(val) === 'object' && val !== null;
315
+ return ret;
316
+ };
317
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
318
+ const ret = getObject(arg0) === undefined;
319
+ return ret;
320
+ };
321
+ imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
322
+ const ret = getObject(arg0) === getObject(arg1);
323
+ return ret;
324
+ };
325
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
326
+ const ret = getObject(arg0) == getObject(arg1);
327
+ return ret;
328
+ };
329
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
330
+ const obj = getObject(arg1);
331
+ const ret = typeof(obj) === 'number' ? obj : undefined;
332
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
333
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
334
+ };
335
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
336
+ const obj = getObject(arg1);
337
+ const ret = typeof(obj) === 'string' ? obj : undefined;
338
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
339
+ var len1 = WASM_VECTOR_LEN;
340
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
341
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
342
+ };
343
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
344
+ throw new Error(getStringFromWasm0(arg0, arg1));
345
+ };
346
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
347
+ const ret = getObject(arg0).call(getObject(arg1));
348
+ return addHeapObject(ret);
349
+ }, arguments) };
350
+ imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
351
+ const ret = getObject(arg0).done;
352
+ return ret;
353
+ };
354
+ imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
355
+ console.error(getObject(arg0));
356
+ };
357
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
358
+ const ret = getObject(arg0)[arg1 >>> 0];
359
+ return addHeapObject(ret);
360
+ };
361
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
362
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
363
+ return addHeapObject(ret);
364
+ }, arguments) };
365
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
366
+ const ret = getObject(arg0)[getObject(arg1)];
367
+ return addHeapObject(ret);
368
+ };
369
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
370
+ let result;
371
+ try {
372
+ result = getObject(arg0) instanceof ArrayBuffer;
373
+ } catch (_) {
374
+ result = false;
375
+ }
376
+ const ret = result;
377
+ return ret;
378
+ };
379
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
380
+ let result;
381
+ try {
382
+ result = getObject(arg0) instanceof Uint8Array;
383
+ } catch (_) {
384
+ result = false;
385
+ }
386
+ const ret = result;
387
+ return ret;
388
+ };
389
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
390
+ const ret = Array.isArray(getObject(arg0));
391
+ return ret;
392
+ };
393
+ imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
394
+ const ret = Number.isSafeInteger(getObject(arg0));
395
+ return ret;
396
+ };
397
+ imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
398
+ const ret = Symbol.iterator;
399
+ return addHeapObject(ret);
400
+ };
401
+ imports.wbg.__wbg_js_click_element_2fe1e774f3d232c7 = function(arg0) {
402
+ js_click_element(arg0);
403
+ };
404
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
405
+ const ret = getObject(arg0).length;
406
+ return ret;
407
+ };
408
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
409
+ const ret = getObject(arg0).length;
410
+ return ret;
411
+ };
412
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
413
+ const ret = new Object();
414
+ return addHeapObject(ret);
415
+ };
416
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
417
+ const ret = new Array();
418
+ return addHeapObject(ret);
419
+ };
420
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
421
+ const ret = new Uint8Array(getObject(arg0));
422
+ return addHeapObject(ret);
423
+ };
424
+ imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
425
+ const ret = getObject(arg0).next;
426
+ return addHeapObject(ret);
427
+ };
428
+ imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
429
+ const ret = getObject(arg0).next();
430
+ return addHeapObject(ret);
431
+ }, arguments) };
432
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
433
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
434
+ };
435
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
436
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
437
+ };
438
+ imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
439
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
440
+ };
441
+ imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
442
+ const ret = getObject(arg0).value;
443
+ return addHeapObject(ret);
444
+ };
445
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
446
+ // Cast intrinsic for `Ref(String) -> Externref`.
447
+ const ret = getStringFromWasm0(arg0, arg1);
448
+ return addHeapObject(ret);
449
+ };
450
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
451
+ // Cast intrinsic for `U64 -> Externref`.
452
+ const ret = BigInt.asUintN(64, arg0);
453
+ return addHeapObject(ret);
454
+ };
455
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
456
+ // Cast intrinsic for `F64 -> Externref`.
457
+ const ret = arg0;
458
+ return addHeapObject(ret);
459
+ };
460
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
461
+ const ret = getObject(arg0);
462
+ return addHeapObject(ret);
463
+ };
464
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
465
+ takeObject(arg0);
466
+ };
467
+
468
+ return imports;
469
+ }
470
+
471
+ function __wbg_finalize_init(instance, module) {
472
+ wasm = instance.exports;
473
+ __wbg_init.__wbindgen_wasm_module = module;
474
+ cachedDataViewMemory0 = null;
475
+ cachedUint8ArrayMemory0 = null;
476
+
477
+
478
+
479
+ return wasm;
480
+ }
481
+
482
+ function initSync(module) {
483
+ if (wasm !== undefined) return wasm;
484
+
485
+
486
+ if (typeof module !== 'undefined') {
487
+ if (Object.getPrototypeOf(module) === Object.prototype) {
488
+ ({module} = module)
489
+ } else {
490
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
491
+ }
492
+ }
493
+
494
+ const imports = __wbg_get_imports();
495
+ if (!(module instanceof WebAssembly.Module)) {
496
+ module = new WebAssembly.Module(module);
497
+ }
498
+ const instance = new WebAssembly.Instance(module, imports);
499
+ return __wbg_finalize_init(instance, module);
500
+ }
501
+
502
+ async function __wbg_init(module_or_path) {
503
+ if (wasm !== undefined) return wasm;
504
+
505
+
506
+ if (typeof module_or_path !== 'undefined') {
507
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
508
+ ({module_or_path} = module_or_path)
509
+ } else {
510
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
511
+ }
512
+ }
513
+
514
+ if (typeof module_or_path === 'undefined') {
515
+ module_or_path = new URL('sentience_core_bg.wasm', import.meta.url);
516
+ }
517
+ const imports = __wbg_get_imports();
518
+
519
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
520
+ module_or_path = fetch(module_or_path);
521
+ }
522
+
523
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
524
+
525
+ return __wbg_finalize_init(instance, module);
526
+ }
527
+
528
+ export { initSync };
529
+ export default __wbg_init;
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const analyze_page: (a: number) => number;
5
+ export const analyze_page_with_options: (a: number, b: number) => number;
6
+ export const decide_and_act: (a: number) => void;
7
+ export const prune_for_api: (a: number) => number;
8
+ export const __wbindgen_export: (a: number, b: number) => number;
9
+ export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
10
+ export const __wbindgen_export3: (a: number) => void;