@joycodetech/qmd-ja 2.5.3
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/CHANGELOG.md +819 -0
- package/LICENSE +21 -0
- package/README.md +1143 -0
- package/bin/qmd +162 -0
- package/dist/ast.d.ts +65 -0
- package/dist/ast.js +334 -0
- package/dist/bench/bench.d.ts +23 -0
- package/dist/bench/bench.js +280 -0
- package/dist/bench/score.d.ts +33 -0
- package/dist/bench/score.js +88 -0
- package/dist/bench/types.d.ts +80 -0
- package/dist/bench/types.js +8 -0
- package/dist/cli/formatter.d.ts +120 -0
- package/dist/cli/formatter.js +355 -0
- package/dist/cli/qmd.d.ts +43 -0
- package/dist/cli/qmd.js +4159 -0
- package/dist/collections.d.ts +166 -0
- package/dist/collections.js +410 -0
- package/dist/db.d.ts +44 -0
- package/dist/db.js +75 -0
- package/dist/index.d.ts +230 -0
- package/dist/index.js +242 -0
- package/dist/llm.d.ts +500 -0
- package/dist/llm.js +1615 -0
- package/dist/maintenance.d.ts +23 -0
- package/dist/maintenance.js +37 -0
- package/dist/mcp/server.d.ts +24 -0
- package/dist/mcp/server.js +702 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.js +4 -0
- package/dist/store.d.ts +996 -0
- package/dist/store.js +4208 -0
- package/models/vaporetto-bccwj.model +0 -0
- package/package.json +130 -0
- package/scripts/build.mjs +30 -0
- package/scripts/check-package-grammars.mjs +29 -0
- package/scripts/package-smoke.mjs +65 -0
- package/scripts/test-all.mjs +38 -0
- package/skills/qmd/SKILL.md +295 -0
- package/skills/qmd/references/mcp-setup.md +102 -0
- package/skills/release/SKILL.md +139 -0
- package/skills/release/scripts/install-hooks.sh +38 -0
- package/vendor/vaporetto-node-wasm/package.json +11 -0
- package/vendor/vaporetto-node-wasm/vaporetto_node_wasm.d.ts +19 -0
- package/vendor/vaporetto-node-wasm/vaporetto_node_wasm.js +202 -0
- package/vendor/vaporetto-node-wasm/vaporetto_node_wasm_bg.wasm +0 -0
- package/vendor/vaporetto-node-wasm/vaporetto_node_wasm_bg.wasm.d.ts +13 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# QMD MCP Server Setup
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g @tobilu/qmd
|
|
7
|
+
qmd collection add ~/path/to/markdown --name myknowledge
|
|
8
|
+
qmd embed
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configure MCP Client
|
|
12
|
+
|
|
13
|
+
**Claude Code** (`~/.claude/settings.json`):
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"mcpServers": {
|
|
17
|
+
"qmd": { "command": "qmd", "args": ["mcp"] }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"qmd": { "command": "qmd", "args": ["mcp"] }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**OpenClaw** (`~/.openclaw/openclaw.json`):
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcp": {
|
|
35
|
+
"servers": {
|
|
36
|
+
"qmd": { "command": "qmd", "args": ["mcp"] }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## HTTP Mode
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
qmd mcp --http # Port 8181
|
|
46
|
+
qmd mcp --http --daemon # Background
|
|
47
|
+
qmd mcp stop # Stop daemon
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Tools
|
|
51
|
+
|
|
52
|
+
### structured_search
|
|
53
|
+
|
|
54
|
+
Search with pre-expanded queries.
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"searches": [
|
|
59
|
+
{ "type": "lex", "query": "keyword phrases" },
|
|
60
|
+
{ "type": "vec", "query": "natural language question" },
|
|
61
|
+
{ "type": "hyde", "query": "hypothetical answer passage..." }
|
|
62
|
+
],
|
|
63
|
+
"limit": 10,
|
|
64
|
+
"collection": "optional",
|
|
65
|
+
"minScore": 0.0
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| Type | Method | Input |
|
|
70
|
+
|------|--------|-------|
|
|
71
|
+
| `lex` | BM25 | Keywords (2-5 terms) |
|
|
72
|
+
| `vec` | Vector | Question |
|
|
73
|
+
| `hyde` | Vector | Answer passage (50-100 words) |
|
|
74
|
+
|
|
75
|
+
### get
|
|
76
|
+
|
|
77
|
+
Retrieve document by path or `#docid`.
|
|
78
|
+
|
|
79
|
+
| Param | Type | Description |
|
|
80
|
+
|-------|------|-------------|
|
|
81
|
+
| `path` | string | File path or `#docid` |
|
|
82
|
+
| `full` | bool? | Return full content |
|
|
83
|
+
| `lineNumbers` | bool? | Add line numbers |
|
|
84
|
+
|
|
85
|
+
### multi_get
|
|
86
|
+
|
|
87
|
+
Retrieve multiple documents.
|
|
88
|
+
|
|
89
|
+
| Param | Type | Description |
|
|
90
|
+
|-------|------|-------------|
|
|
91
|
+
| `pattern` | string | Glob or comma-separated list |
|
|
92
|
+
| `maxBytes` | number? | Skip large files (default 10KB) |
|
|
93
|
+
|
|
94
|
+
### status
|
|
95
|
+
|
|
96
|
+
Index health and collections. No params.
|
|
97
|
+
|
|
98
|
+
## Troubleshooting
|
|
99
|
+
|
|
100
|
+
- **Not starting**: `which qmd`, `qmd mcp` manually
|
|
101
|
+
- **No results**: `qmd collection list`, `qmd embed`
|
|
102
|
+
- **Slow first search**: Normal, models loading (~3GB)
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release
|
|
3
|
+
description: Manage releases for this project. Validates changelog, installs git hooks, and cuts releases. Use when user says "/release", "release 1.0.5", "cut a release", or asks about the release process. NOT auto-invoked by the model.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Release
|
|
8
|
+
|
|
9
|
+
Cut a release, validate the changelog, and ensure git hooks are installed.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
`/release 1.0.5` or `/release patch` (bumps patch from current version).
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
When the user triggers `/release <version>`:
|
|
18
|
+
|
|
19
|
+
1. **Gather context** — run `skills/release/scripts/release-context.sh <version>`.
|
|
20
|
+
This silently installs git hooks and prints everything needed: version info,
|
|
21
|
+
working directory status, commits since last release, files changed, current
|
|
22
|
+
`[Unreleased]` content, and the previous release entry for style reference.
|
|
23
|
+
|
|
24
|
+
2. **Commit outstanding work** — if the context shows staged, modified, or
|
|
25
|
+
untracked files that belong in this release, commit them first. Use the
|
|
26
|
+
/commit skill or make well-formed commits directly.
|
|
27
|
+
|
|
28
|
+
3. **Write the changelog** — if `[Unreleased]` is empty, write it now using
|
|
29
|
+
the commits and file changes from the context output. Follow the changelog
|
|
30
|
+
standard below. Re-run the context script after committing if needed.
|
|
31
|
+
|
|
32
|
+
4. **Cut the release** — run `scripts/release.sh <version>`. This renames
|
|
33
|
+
`[Unreleased]` → `[X.Y.Z] - date`, inserts a fresh `[Unreleased]`,
|
|
34
|
+
bumps `package.json`, commits, and tags.
|
|
35
|
+
|
|
36
|
+
5. **Show the final changelog** — print the full `[Unreleased]` +
|
|
37
|
+
minor series rollup via `scripts/extract-changelog.sh <version>`.
|
|
38
|
+
Ask the user to confirm before pushing.
|
|
39
|
+
|
|
40
|
+
6. **Push** — after explicit confirmation, run `git push origin main --tags`.
|
|
41
|
+
|
|
42
|
+
7. **Watch CI** — after the push, start a background dispatch to watch the
|
|
43
|
+
publish workflow. Use `interactive_shell` in dispatch mode with:
|
|
44
|
+
```
|
|
45
|
+
gh run watch $(gh run list --workflow=publish.yml --limit=1 --json databaseId --jq '.[0].databaseId') --exit-status
|
|
46
|
+
```
|
|
47
|
+
The agent will be notified when CI completes and should report the result.
|
|
48
|
+
|
|
49
|
+
7. **Check dependency updates** — before cutting the release, check for
|
|
50
|
+
updates to `sqlite-vec` (and platform packages), `node-llama-cpp`,
|
|
51
|
+
and `better-sqlite3`. Run `pnpm outdated` and report any available
|
|
52
|
+
updates for these packages. If updates exist, bump them (pinned, no
|
|
53
|
+
`^` ranges) and re-run tests before proceeding.
|
|
54
|
+
|
|
55
|
+
If any step fails, stop and explain. Never force-push or skip validation.
|
|
56
|
+
|
|
57
|
+
## Dependency Policy
|
|
58
|
+
|
|
59
|
+
All dependencies must be pinned to exact versions (no `^` or `~` ranges).
|
|
60
|
+
The lockfile ensures reproducible installs. When adding or updating any
|
|
61
|
+
dependency, always use the exact version string (e.g. `"3.18.1"` not
|
|
62
|
+
`"^3.18.1"`).
|
|
63
|
+
|
|
64
|
+
## Changelog Standard
|
|
65
|
+
|
|
66
|
+
The changelog lives in `CHANGELOG.md` and follows [Keep a Changelog](https://keepachangelog.com/) conventions.
|
|
67
|
+
|
|
68
|
+
### Heading format
|
|
69
|
+
|
|
70
|
+
- `## [Unreleased]` — accumulates entries between releases
|
|
71
|
+
- `## [X.Y.Z] - YYYY-MM-DD` — released versions
|
|
72
|
+
|
|
73
|
+
### Structure of a release entry
|
|
74
|
+
|
|
75
|
+
Each version entry has two parts:
|
|
76
|
+
|
|
77
|
+
**1. Highlights (optional, 1-4 sentences of prose)**
|
|
78
|
+
|
|
79
|
+
Immediately after the version heading, before any `###` section. The elevator
|
|
80
|
+
pitch — what would you tell someone in 30 seconds? Only for significant
|
|
81
|
+
releases; skip for small patches.
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
## [1.1.0] - 2026-03-01
|
|
85
|
+
|
|
86
|
+
QMD now runs on both Node.js and Bun, with up to 2.7x faster reranking
|
|
87
|
+
through parallel contexts. GPU auto-detection replaces the unreliable
|
|
88
|
+
`gpu: "auto"` with explicit CUDA/Metal/Vulkan probing.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**2. Detailed changelog (`### Changes` and `### Fixes`)**
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
### Changes
|
|
95
|
+
|
|
96
|
+
- Runtime: support Node.js (>=22) alongside Bun. The `qmd` wrapper
|
|
97
|
+
auto-detects a suitable install via PATH. #149 (thanks @igrigorik)
|
|
98
|
+
- Performance: parallel embedding & reranking — up to 2.7x faster on
|
|
99
|
+
multi-core machines.
|
|
100
|
+
|
|
101
|
+
### Fixes
|
|
102
|
+
|
|
103
|
+
- Prevent VRAM waste from duplicate context creation during concurrent
|
|
104
|
+
`embedBatch` calls. #152 (thanks @jkrems)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Writing guidelines
|
|
108
|
+
|
|
109
|
+
- **Explain the why, not just the what.** The changelog is for users.
|
|
110
|
+
- **Include numbers.** "2.7x faster", "17x less memory".
|
|
111
|
+
- **Group by theme, not by file.** "Performance" not "Changes to llm.ts".
|
|
112
|
+
- **Don't list every commit.** Aggregate related changes.
|
|
113
|
+
- **Credit contributors:** end bullets with `#NNN (thanks @username)` for
|
|
114
|
+
external PRs. No need to credit the repo owner.
|
|
115
|
+
|
|
116
|
+
### What not to include
|
|
117
|
+
|
|
118
|
+
- Internal refactors with no user-visible effect
|
|
119
|
+
- Dependency bumps (unless fixing a user-facing bug)
|
|
120
|
+
- CI/tooling changes (unless affecting the release artifact)
|
|
121
|
+
- Test additions (unless validating a fix worth mentioning)
|
|
122
|
+
|
|
123
|
+
## GitHub Release Notes
|
|
124
|
+
|
|
125
|
+
Each GitHub release includes the full changelog for the **minor series** back
|
|
126
|
+
to x.x.0. The `scripts/extract-changelog.sh` script handles this, and the
|
|
127
|
+
publish workflow (`publish.yml`) calls it to populate the GitHub release.
|
|
128
|
+
|
|
129
|
+
## Git Hooks
|
|
130
|
+
|
|
131
|
+
The pre-push hook (`scripts/pre-push`) blocks `v*` tag pushes unless:
|
|
132
|
+
|
|
133
|
+
1. `package.json` version matches the tag
|
|
134
|
+
2. `CHANGELOG.md` has a `## [X.Y.Z] - date` entry for the version
|
|
135
|
+
3. CI passed on GitHub (warns in non-interactive shells, blocks in terminals)
|
|
136
|
+
|
|
137
|
+
Hooks are installed silently by the context script. They can also be installed
|
|
138
|
+
manually via `skills/release/scripts/install-hooks.sh` or automatically via
|
|
139
|
+
`bun install` (prepare script).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Install git hooks for release validation.
|
|
5
|
+
# Idempotent — safe to run multiple times.
|
|
6
|
+
|
|
7
|
+
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
8
|
+
if [[ -z "$REPO_ROOT" ]]; then
|
|
9
|
+
echo "Error: not in a git repository" >&2
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
HOOKS_DIR="$REPO_ROOT/.git/hooks"
|
|
14
|
+
SOURCE="$REPO_ROOT/scripts/pre-push"
|
|
15
|
+
|
|
16
|
+
if [[ ! -f "$SOURCE" ]]; then
|
|
17
|
+
echo "Error: scripts/pre-push not found at $SOURCE" >&2
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Install pre-push hook
|
|
22
|
+
if [[ -L "$HOOKS_DIR/pre-push" ]] && [[ "$(readlink "$HOOKS_DIR/pre-push")" == "$SOURCE" ]]; then
|
|
23
|
+
echo "pre-push hook: already installed (symlink)"
|
|
24
|
+
elif [[ -f "$HOOKS_DIR/pre-push" ]]; then
|
|
25
|
+
# Existing hook that isn't our symlink — back it up
|
|
26
|
+
BACKUP="$HOOKS_DIR/pre-push.backup.$(date +%s)"
|
|
27
|
+
echo "pre-push hook: backing up existing hook to $(basename "$BACKUP")"
|
|
28
|
+
mv "$HOOKS_DIR/pre-push" "$BACKUP"
|
|
29
|
+
ln -sf "$SOURCE" "$HOOKS_DIR/pre-push"
|
|
30
|
+
echo "pre-push hook: installed (symlink → scripts/pre-push)"
|
|
31
|
+
else
|
|
32
|
+
ln -sf "$SOURCE" "$HOOKS_DIR/pre-push"
|
|
33
|
+
echo "pre-push hook: installed (symlink → scripts/pre-push)"
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Ensure the source is executable
|
|
37
|
+
chmod +x "$SOURCE"
|
|
38
|
+
echo "Done."
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class VaporettoTokenizer {
|
|
5
|
+
free(): void;
|
|
6
|
+
[Symbol.dispose](): void;
|
|
7
|
+
/**
|
|
8
|
+
* Create a new tokenizer from a zstd-compressed or raw model buffer.
|
|
9
|
+
*/
|
|
10
|
+
constructor(model_data: Uint8Array);
|
|
11
|
+
/**
|
|
12
|
+
* Tokenize a string and return space-separated tokens.
|
|
13
|
+
*/
|
|
14
|
+
tokenize(text: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Return token surfaces as a JS array of strings.
|
|
17
|
+
*/
|
|
18
|
+
tokenize_to_array(text: string): Array<any>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/* @ts-self-types="./vaporetto_node_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
class VaporettoTokenizer {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
VaporettoTokenizerFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_vaporettotokenizer_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a new tokenizer from a zstd-compressed or raw model buffer.
|
|
16
|
+
* @param {Uint8Array} model_data
|
|
17
|
+
*/
|
|
18
|
+
constructor(model_data) {
|
|
19
|
+
const ptr0 = passArray8ToWasm0(model_data, wasm.__wbindgen_malloc);
|
|
20
|
+
const len0 = WASM_VECTOR_LEN;
|
|
21
|
+
const ret = wasm.vaporettotokenizer_new(ptr0, len0);
|
|
22
|
+
if (ret[2]) {
|
|
23
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
24
|
+
}
|
|
25
|
+
this.__wbg_ptr = ret[0];
|
|
26
|
+
VaporettoTokenizerFinalization.register(this, this.__wbg_ptr, this);
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Tokenize a string and return space-separated tokens.
|
|
31
|
+
* @param {string} text
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
tokenize(text) {
|
|
35
|
+
let deferred3_0;
|
|
36
|
+
let deferred3_1;
|
|
37
|
+
try {
|
|
38
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
39
|
+
const len0 = WASM_VECTOR_LEN;
|
|
40
|
+
const ret = wasm.vaporettotokenizer_tokenize(this.__wbg_ptr, ptr0, len0);
|
|
41
|
+
var ptr2 = ret[0];
|
|
42
|
+
var len2 = ret[1];
|
|
43
|
+
if (ret[3]) {
|
|
44
|
+
ptr2 = 0; len2 = 0;
|
|
45
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
46
|
+
}
|
|
47
|
+
deferred3_0 = ptr2;
|
|
48
|
+
deferred3_1 = len2;
|
|
49
|
+
return getStringFromWasm0(ptr2, len2);
|
|
50
|
+
} finally {
|
|
51
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Return token surfaces as a JS array of strings.
|
|
56
|
+
* @param {string} text
|
|
57
|
+
* @returns {Array<any>}
|
|
58
|
+
*/
|
|
59
|
+
tokenize_to_array(text) {
|
|
60
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
61
|
+
const len0 = WASM_VECTOR_LEN;
|
|
62
|
+
const ret = wasm.vaporettotokenizer_tokenize_to_array(this.__wbg_ptr, ptr0, len0);
|
|
63
|
+
if (ret[2]) {
|
|
64
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
65
|
+
}
|
|
66
|
+
return takeFromExternrefTable0(ret[0]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (Symbol.dispose) VaporettoTokenizer.prototype[Symbol.dispose] = VaporettoTokenizer.prototype.free;
|
|
70
|
+
exports.VaporettoTokenizer = VaporettoTokenizer;
|
|
71
|
+
function __wbg_get_imports() {
|
|
72
|
+
const import0 = {
|
|
73
|
+
__proto__: null,
|
|
74
|
+
__wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
|
|
75
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
76
|
+
return ret;
|
|
77
|
+
},
|
|
78
|
+
__wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
|
|
79
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
80
|
+
},
|
|
81
|
+
__wbg_new_36e147a8ced3c6e0: function() {
|
|
82
|
+
const ret = new Array();
|
|
83
|
+
return ret;
|
|
84
|
+
},
|
|
85
|
+
__wbg_push_f724b5db8acf89d2: function(arg0, arg1) {
|
|
86
|
+
const ret = arg0.push(arg1);
|
|
87
|
+
return ret;
|
|
88
|
+
},
|
|
89
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
90
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
91
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
92
|
+
return ret;
|
|
93
|
+
},
|
|
94
|
+
__wbindgen_init_externref_table: function() {
|
|
95
|
+
const table = wasm.__wbindgen_externrefs;
|
|
96
|
+
const offset = table.grow(4);
|
|
97
|
+
table.set(0, undefined);
|
|
98
|
+
table.set(offset + 0, undefined);
|
|
99
|
+
table.set(offset + 1, null);
|
|
100
|
+
table.set(offset + 2, true);
|
|
101
|
+
table.set(offset + 3, false);
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
return {
|
|
105
|
+
__proto__: null,
|
|
106
|
+
"./vaporetto_node_wasm_bg.js": import0,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const VaporettoTokenizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
111
|
+
? { register: () => {}, unregister: () => {} }
|
|
112
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vaporettotokenizer_free(ptr, 1));
|
|
113
|
+
|
|
114
|
+
function getStringFromWasm0(ptr, len) {
|
|
115
|
+
return decodeText(ptr >>> 0, len);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let cachedUint8ArrayMemory0 = null;
|
|
119
|
+
function getUint8ArrayMemory0() {
|
|
120
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
121
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
122
|
+
}
|
|
123
|
+
return cachedUint8ArrayMemory0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
127
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
128
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
129
|
+
WASM_VECTOR_LEN = arg.length;
|
|
130
|
+
return ptr;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
134
|
+
if (realloc === undefined) {
|
|
135
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
136
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
137
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
138
|
+
WASM_VECTOR_LEN = buf.length;
|
|
139
|
+
return ptr;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let len = arg.length;
|
|
143
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
144
|
+
|
|
145
|
+
const mem = getUint8ArrayMemory0();
|
|
146
|
+
|
|
147
|
+
let offset = 0;
|
|
148
|
+
|
|
149
|
+
for (; offset < len; offset++) {
|
|
150
|
+
const code = arg.charCodeAt(offset);
|
|
151
|
+
if (code > 0x7F) break;
|
|
152
|
+
mem[ptr + offset] = code;
|
|
153
|
+
}
|
|
154
|
+
if (offset !== len) {
|
|
155
|
+
if (offset !== 0) {
|
|
156
|
+
arg = arg.slice(offset);
|
|
157
|
+
}
|
|
158
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
159
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
160
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
161
|
+
|
|
162
|
+
offset += ret.written;
|
|
163
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
WASM_VECTOR_LEN = offset;
|
|
167
|
+
return ptr;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function takeFromExternrefTable0(idx) {
|
|
171
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
172
|
+
wasm.__externref_table_dealloc(idx);
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
177
|
+
cachedTextDecoder.decode();
|
|
178
|
+
function decodeText(ptr, len) {
|
|
179
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const cachedTextEncoder = new TextEncoder();
|
|
183
|
+
|
|
184
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
185
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
186
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
187
|
+
view.set(buf);
|
|
188
|
+
return {
|
|
189
|
+
read: arg.length,
|
|
190
|
+
written: buf.length
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
let WASM_VECTOR_LEN = 0;
|
|
196
|
+
|
|
197
|
+
const wasmPath = `${__dirname}/vaporetto_node_wasm_bg.wasm`;
|
|
198
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
199
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
200
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
201
|
+
let wasm = wasmInstance.exports;
|
|
202
|
+
wasm.__wbindgen_start();
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_vaporettotokenizer_free: (a: number, b: number) => void;
|
|
5
|
+
export const vaporettotokenizer_new: (a: number, b: number) => [number, number, number];
|
|
6
|
+
export const vaporettotokenizer_tokenize: (a: number, b: number, c: number) => [number, number, number, number];
|
|
7
|
+
export const vaporettotokenizer_tokenize_to_array: (a: number, b: number, c: number) => [number, number, number];
|
|
8
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
9
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
10
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
11
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
12
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
13
|
+
export const __wbindgen_start: () => void;
|