@dikolab/kbdb 0.4.0 → 0.4.1
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 +13 -5
- package/dist/{chunk-BJPSPNGX.mjs → chunk-BJXEVALU.mjs} +115 -1
- package/dist/chunk-BJXEVALU.mjs.map +7 -0
- package/dist/cli.cjs +462 -79
- package/dist/cli.cjs.map +4 -4
- package/dist/cli.mjs +356 -79
- package/dist/cli.mjs.map +4 -4
- package/dist/kbdb-worker.cjs +413 -53
- package/dist/kbdb-worker.cjs.map +4 -4
- package/dist/mod.cjs +230 -54
- package/dist/mod.cjs.map +4 -4
- package/dist/mod.mjs +229 -53
- package/dist/mod.mjs.map +4 -4
- package/dist/src/shared/cli/typings/cli-options.interface.d.ts +5 -0
- package/dist/src/shared/embedding/classes/tfidf-embedding-provider.class.d.ts +28 -0
- package/dist/src/shared/embedding/constants/tfidf-defaults.constant.d.ts +4 -0
- package/dist/src/shared/embedding/functions/create-embedding-provider.function.d.ts +5 -2
- package/dist/src/shared/embedding/index.d.ts +2 -0
- package/dist/src/shared/log/constants/log-colors.constant.d.ts +5 -0
- package/dist/src/shared/log/constants/log-defaults.constant.d.ts +3 -0
- package/dist/src/shared/log/constants/log-icons.constant.d.ts +3 -0
- package/dist/src/shared/log/functions/configure-log.function.d.ts +12 -0
- package/dist/src/shared/log/functions/log.function.d.ts +28 -0
- package/dist/src/shared/log/functions/parse-log-level.function.d.ts +10 -0
- package/dist/src/shared/log/functions/resolve-log-level.function.d.ts +12 -0
- package/dist/src/shared/log/functions/write-stderr.function.d.ts +10 -0
- package/dist/src/shared/log/index.d.ts +10 -0
- package/dist/src/shared/log/typings/log-config.interface.d.ts +7 -0
- package/dist/src/shared/log/typings/log-level.type.d.ts +7 -0
- package/dist/src/shared/log/typings/log-output.interface.d.ts +4 -0
- package/dist/src/shared/version/constants/version.constant.d.ts +1 -1
- package/dist/src/shared/worker-client/classes/worker-client.class.d.ts +7 -0
- package/dist/src/shared/worker-client/functions/retry-on-timeout.function.d.ts +1 -0
- package/dist/src/shared/worker-daemon/classes/worker-daemon.class.d.ts +1 -0
- package/dist/src/shared/worker-daemon/functions/run-worker.function.d.ts +6 -1
- package/dist/src/shared/worker-daemon/typings/wasm-modules.interface.d.ts +5 -0
- package/dist/wasm/default-embedding/kbdb_default_embedding.d.ts +55 -0
- package/dist/wasm/default-embedding/kbdb_default_embedding.js +156 -0
- package/dist/wasm/default-embedding/kbdb_default_embedding_bg.wasm +0 -0
- package/dist/wasm/default-embedding/kbdb_default_embedding_bg.wasm.d.ts +12 -0
- package/dist/wasm/default-embedding/package.json +13 -0
- package/dist/wasm/fs-database/kbdb_fs_database_bg.wasm +0 -0
- package/dist/wasm/fs-migration/kbdb_fs_migration.d.ts +38 -0
- package/dist/wasm/fs-migration/kbdb_fs_migration.js +130 -0
- package/dist/wasm/fs-migration/kbdb_fs_migration_bg.wasm +0 -0
- package/dist/wasm/fs-migration/kbdb_fs_migration_bg.wasm.d.ts +9 -0
- package/dist/wasm/fs-migration/package.json +13 -0
- package/dist/wasm/kb-worker/kbdb_worker_bg.wasm +0 -0
- package/dist/wasm/query-parser/kbdb_query_parser_bg.wasm +0 -0
- package/dist/worker.mjs +306 -54
- package/dist/worker.mjs.map +4 -4
- package/docs/details/agent-tooling.md +10 -0
- package/docs/details/cli.md +29 -13
- package/docs/details/knowledge-base.md +15 -8
- package/docs/details/mcp-server.md +16 -1
- package/docs/details/search-and-ranking.md +6 -2
- package/docs/goals/cli.md +33 -4
- package/docs/goals/content-parser.md +1 -1
- package/docs/goals/hybrid-search.md +71 -42
- package/docs/goals/mcp.md +3 -1
- package/docs/goals/overview.md +1 -1
- package/docs/goals/query-parser.md +1 -1
- package/docs/goals/semantic-dedup.md +7 -3
- package/docs/goals/worker-daemon.md +31 -20
- package/docs/modules/overview.md +43 -22
- package/docs/modules/rust/embedding/module.md +91 -0
- package/docs/modules/rust/overview.md +56 -21
- package/docs/modules/rust/query-parser/functions/module.md +7 -5
- package/docs/modules/rust/query-parser/functions/pipeline.md +6 -138
- package/docs/modules/rust/query-parser/module.md +16 -22
- package/docs/modules/rust/query-parser/types/module.md +5 -4
- package/docs/modules/rust/query-parser/types/token.md +5 -1
- package/docs/modules/rust/shared/content-parser/functions.md +1 -1
- package/docs/modules/rust/shared/memory/module.md +1 -1
- package/docs/modules/rust/shared/module.md +33 -5
- package/docs/modules/rust/shared/pipeline/functions.md +141 -0
- package/docs/modules/rust/shared/pipeline/module.md +62 -0
- package/docs/modules/rust/shared/pipeline/types.md +43 -0
- package/docs/modules/rust/shared/section/module.md +1 -1
- package/docs/modules/rust/shared/section/types.md +1 -1
- package/docs/modules/typescript/cli.md +4 -2
- package/docs/modules/typescript/kbdb-worker.md +20 -5
- package/docs/modules/typescript/overview.md +28 -6
- package/docs/modules/typescript/shared/cli/functions.md +15 -4
- package/docs/modules/typescript/shared/cli/typings.md +21 -0
- package/docs/modules/typescript/shared/embedding/functions.md +30 -3
- package/docs/modules/typescript/shared/embedding/module.md +10 -4
- package/docs/modules/typescript/shared/embedding/typings.md +7 -5
- package/docs/modules/typescript/shared/log/constants.md +82 -0
- package/docs/modules/typescript/shared/log/functions.md +131 -0
- package/docs/modules/typescript/shared/log/module.md +153 -0
- package/docs/modules/typescript/shared/log/typings.md +82 -0
- package/docs/modules/typescript/shared/module.md +22 -6
- package/docs/modules/typescript/shared/worker-daemon/functions.md +19 -6
- package/docs/modules/typescript/shared/worker-daemon/module.md +5 -2
- package/docs/modules/typescript/shared/worker-daemon/typings.md +13 -7
- package/docs/release-notes/0.4.1.md +149 -0
- package/package.json +2 -2
- package/dist/chunk-BJPSPNGX.mjs.map +0 -7
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
let wasm_bindgen = (function(exports) {
|
|
2
|
+
let script_src;
|
|
3
|
+
if (typeof document !== 'undefined' && document.currentScript !== null) {
|
|
4
|
+
script_src = new URL(document.currentScript.src, location.href).toString();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns the number of dimensions in the embedding vector.
|
|
9
|
+
* @returns {number}
|
|
10
|
+
*/
|
|
11
|
+
function embedding_dimensions() {
|
|
12
|
+
const ret = wasm.embedding_dimensions();
|
|
13
|
+
return ret >>> 0;
|
|
14
|
+
}
|
|
15
|
+
exports.embedding_dimensions = embedding_dimensions;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Writes the model name "tfidf-v1" to the return slot. Returns 1.
|
|
19
|
+
* @returns {number}
|
|
20
|
+
*/
|
|
21
|
+
function embedding_model_name() {
|
|
22
|
+
const ret = wasm.embedding_model_name();
|
|
23
|
+
return ret >>> 0;
|
|
24
|
+
}
|
|
25
|
+
exports.embedding_model_name = embedding_model_name;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Embed a single UTF-8 text into a 256-dimensional TF-IDF vector.
|
|
29
|
+
*
|
|
30
|
+
* Reads text from `(ptr, len)`, writes raw little-endian f32 bytes to
|
|
31
|
+
* the return slot. Returns 1 on success.
|
|
32
|
+
* @param {number} ptr
|
|
33
|
+
* @param {number} len
|
|
34
|
+
* @returns {number}
|
|
35
|
+
*/
|
|
36
|
+
function embedding_tfidf(ptr, len) {
|
|
37
|
+
const ret = wasm.embedding_tfidf(ptr, len);
|
|
38
|
+
return ret >>> 0;
|
|
39
|
+
}
|
|
40
|
+
exports.embedding_tfidf = embedding_tfidf;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Embed a newline-separated batch of texts into 256-dimensional vectors.
|
|
44
|
+
*
|
|
45
|
+
* Encodes: u32 count, then count × DIMENSIONS f32 values (little-endian).
|
|
46
|
+
* Returns 1 on success.
|
|
47
|
+
* @param {number} ptr
|
|
48
|
+
* @param {number} len
|
|
49
|
+
* @returns {number}
|
|
50
|
+
*/
|
|
51
|
+
function embedding_tfidf_batch(ptr, len) {
|
|
52
|
+
const ret = wasm.embedding_tfidf_batch(ptr, len);
|
|
53
|
+
return ret >>> 0;
|
|
54
|
+
}
|
|
55
|
+
exports.embedding_tfidf_batch = embedding_tfidf_batch;
|
|
56
|
+
function __wbg_get_imports() {
|
|
57
|
+
const import0 = {
|
|
58
|
+
__proto__: null,
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
__proto__: null,
|
|
62
|
+
"./kbdb_default_embedding_bg.js": import0,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let wasmModule, wasmInstance, wasm;
|
|
67
|
+
function __wbg_finalize_init(instance, module) {
|
|
68
|
+
wasmInstance = instance;
|
|
69
|
+
wasm = instance.exports;
|
|
70
|
+
wasmModule = module;
|
|
71
|
+
return wasm;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function __wbg_load(module, imports) {
|
|
75
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
76
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
77
|
+
try {
|
|
78
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
81
|
+
|
|
82
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
83
|
+
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);
|
|
84
|
+
|
|
85
|
+
} else { throw e; }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const bytes = await module.arrayBuffer();
|
|
90
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
91
|
+
} else {
|
|
92
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
93
|
+
|
|
94
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
95
|
+
return { instance, module };
|
|
96
|
+
} else {
|
|
97
|
+
return instance;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function expectedResponseType(type) {
|
|
102
|
+
switch (type) {
|
|
103
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function initSync(module) {
|
|
110
|
+
if (wasm !== undefined) return wasm;
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
if (module !== undefined) {
|
|
114
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
115
|
+
({module} = module)
|
|
116
|
+
} else {
|
|
117
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const imports = __wbg_get_imports();
|
|
122
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
123
|
+
module = new WebAssembly.Module(module);
|
|
124
|
+
}
|
|
125
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
126
|
+
return __wbg_finalize_init(instance, module);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function __wbg_init(module_or_path) {
|
|
130
|
+
if (wasm !== undefined) return wasm;
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
if (module_or_path !== undefined) {
|
|
134
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
135
|
+
({module_or_path} = module_or_path)
|
|
136
|
+
} else {
|
|
137
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (module_or_path === undefined && script_src !== undefined) {
|
|
142
|
+
module_or_path = script_src.replace(/\.js$/, "_bg.wasm");
|
|
143
|
+
}
|
|
144
|
+
const imports = __wbg_get_imports();
|
|
145
|
+
|
|
146
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
147
|
+
module_or_path = fetch(module_or_path);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
151
|
+
|
|
152
|
+
return __wbg_finalize_init(instance, module);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return Object.assign(__wbg_init, { initSync }, exports);
|
|
156
|
+
})({ __proto__: null });
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const set_return: (a: number, b: number) => void;
|
|
5
|
+
export const embedding_tfidf: (a: number, b: number) => number;
|
|
6
|
+
export const embedding_tfidf_batch: (a: number, b: number) => number;
|
|
7
|
+
export const embedding_dimensions: () => number;
|
|
8
|
+
export const embedding_model_name: () => number;
|
|
9
|
+
export const kbdb_alloc: (a: number) => number;
|
|
10
|
+
export const get_return_len: () => number;
|
|
11
|
+
export const get_return_ptr: () => number;
|
|
12
|
+
export const kbdb_free: (a: number, b: number) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kbdb-default-embedding",
|
|
3
|
+
"description": "Built-in TF-IDF embedding for kbdb -- compiles to default-embedding.wasm",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"files": [
|
|
7
|
+
"kbdb_default_embedding_bg.wasm",
|
|
8
|
+
"kbdb_default_embedding.js",
|
|
9
|
+
"kbdb_default_embedding.d.ts"
|
|
10
|
+
],
|
|
11
|
+
"browser": "kbdb_default_embedding.js",
|
|
12
|
+
"types": "kbdb_default_embedding.d.ts"
|
|
13
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare namespace wasm_bindgen {
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Runs database migrations from the current catalog version up to
|
|
7
|
+
* `DB_FORMAT_VERSION`. `ptr`/`len` point to the UTF-8 context path.
|
|
8
|
+
*
|
|
9
|
+
* - Returns 0 if the database is already at the current version.
|
|
10
|
+
* - Returns 0 after successfully running all required migrations.
|
|
11
|
+
* - Returns -1 if the catalog version is newer than `DB_FORMAT_VERSION`
|
|
12
|
+
* (error message in return slot).
|
|
13
|
+
* - Returns -1 on any I/O or parse error (message in return slot).
|
|
14
|
+
*/
|
|
15
|
+
export function db_migrate(ptr: number, len: number): number;
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
declare type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
19
|
+
|
|
20
|
+
declare interface InitOutput {
|
|
21
|
+
readonly memory: WebAssembly.Memory;
|
|
22
|
+
readonly kbdb_free: (a: number, b: number) => void;
|
|
23
|
+
readonly set_return: (a: number, b: number) => void;
|
|
24
|
+
readonly db_migrate: (a: number, b: number) => number;
|
|
25
|
+
readonly kbdb_alloc: (a: number) => number;
|
|
26
|
+
readonly get_return_len: () => number;
|
|
27
|
+
readonly get_return_ptr: () => number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
32
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
33
|
+
*
|
|
34
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
35
|
+
*
|
|
36
|
+
* @returns {Promise<InitOutput>}
|
|
37
|
+
*/
|
|
38
|
+
declare function wasm_bindgen (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
let wasm_bindgen = (function(exports) {
|
|
2
|
+
let script_src;
|
|
3
|
+
if (typeof document !== 'undefined' && document.currentScript !== null) {
|
|
4
|
+
script_src = new URL(document.currentScript.src, location.href).toString();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Runs database migrations from the current catalog version up to
|
|
9
|
+
* `DB_FORMAT_VERSION`. `ptr`/`len` point to the UTF-8 context path.
|
|
10
|
+
*
|
|
11
|
+
* - Returns 0 if the database is already at the current version.
|
|
12
|
+
* - Returns 0 after successfully running all required migrations.
|
|
13
|
+
* - Returns -1 if the catalog version is newer than `DB_FORMAT_VERSION`
|
|
14
|
+
* (error message in return slot).
|
|
15
|
+
* - Returns -1 on any I/O or parse error (message in return slot).
|
|
16
|
+
* @param {number} ptr
|
|
17
|
+
* @param {number} len
|
|
18
|
+
* @returns {number}
|
|
19
|
+
*/
|
|
20
|
+
function db_migrate(ptr, len) {
|
|
21
|
+
const ret = wasm.db_migrate(ptr, len);
|
|
22
|
+
return ret;
|
|
23
|
+
}
|
|
24
|
+
exports.db_migrate = db_migrate;
|
|
25
|
+
const import1 = require("env");
|
|
26
|
+
const import2 = require("env");
|
|
27
|
+
|
|
28
|
+
function __wbg_get_imports() {
|
|
29
|
+
const import0 = {
|
|
30
|
+
__proto__: null,
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
__proto__: null,
|
|
34
|
+
"./kbdb_fs_migration_bg.js": import0,
|
|
35
|
+
"env": import1,
|
|
36
|
+
"env": import2,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let wasmModule, wasmInstance, wasm;
|
|
41
|
+
function __wbg_finalize_init(instance, module) {
|
|
42
|
+
wasmInstance = instance;
|
|
43
|
+
wasm = instance.exports;
|
|
44
|
+
wasmModule = module;
|
|
45
|
+
return wasm;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function __wbg_load(module, imports) {
|
|
49
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
50
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
51
|
+
try {
|
|
52
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
55
|
+
|
|
56
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
57
|
+
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);
|
|
58
|
+
|
|
59
|
+
} else { throw e; }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const bytes = await module.arrayBuffer();
|
|
64
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
65
|
+
} else {
|
|
66
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
67
|
+
|
|
68
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
69
|
+
return { instance, module };
|
|
70
|
+
} else {
|
|
71
|
+
return instance;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function expectedResponseType(type) {
|
|
76
|
+
switch (type) {
|
|
77
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function initSync(module) {
|
|
84
|
+
if (wasm !== undefined) return wasm;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if (module !== undefined) {
|
|
88
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
89
|
+
({module} = module)
|
|
90
|
+
} else {
|
|
91
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const imports = __wbg_get_imports();
|
|
96
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
97
|
+
module = new WebAssembly.Module(module);
|
|
98
|
+
}
|
|
99
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
100
|
+
return __wbg_finalize_init(instance, module);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function __wbg_init(module_or_path) {
|
|
104
|
+
if (wasm !== undefined) return wasm;
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
if (module_or_path !== undefined) {
|
|
108
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
109
|
+
({module_or_path} = module_or_path)
|
|
110
|
+
} else {
|
|
111
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (module_or_path === undefined && script_src !== undefined) {
|
|
116
|
+
module_or_path = script_src.replace(/\.js$/, "_bg.wasm");
|
|
117
|
+
}
|
|
118
|
+
const imports = __wbg_get_imports();
|
|
119
|
+
|
|
120
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
121
|
+
module_or_path = fetch(module_or_path);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
125
|
+
|
|
126
|
+
return __wbg_finalize_init(instance, module);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return Object.assign(__wbg_init, { initSync }, exports);
|
|
130
|
+
})({ __proto__: null });
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const kbdb_free: (a: number, b: number) => void;
|
|
5
|
+
export const set_return: (a: number, b: number) => void;
|
|
6
|
+
export const db_migrate: (a: number, b: number) => number;
|
|
7
|
+
export const kbdb_alloc: (a: number) => number;
|
|
8
|
+
export const get_return_len: () => number;
|
|
9
|
+
export const get_return_ptr: () => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kbdb-fs-migration",
|
|
3
|
+
"description": "Database migration engine for kbdb -- compiles to fs-migration.wasm",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"files": [
|
|
7
|
+
"kbdb_fs_migration_bg.wasm",
|
|
8
|
+
"kbdb_fs_migration.js",
|
|
9
|
+
"kbdb_fs_migration.d.ts"
|
|
10
|
+
],
|
|
11
|
+
"browser": "kbdb_fs_migration.js",
|
|
12
|
+
"types": "kbdb_fs_migration.d.ts"
|
|
13
|
+
}
|
|
Binary file
|
|
Binary file
|