@takara-ai/miru-code 1.1.3 → 1.2.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 +178 -107
- package/package.json +9 -5
- package/src/benchmark/compare.ts +278 -0
- package/src/benchmark/grep.ts +352 -0
- package/src/benchmark/history.ts +206 -0
- package/src/benchmark/locate-compare.ts +65 -0
- package/src/benchmark/rg-literal.ts +143 -0
- package/src/benchmark/summary.ts +29 -0
- package/src/benchmark/types.ts +65 -0
- package/src/cli.ts +183 -4
- package/src/credentials.ts +8 -0
- package/src/help.ts +45 -2
- package/src/index/create.ts +2 -2
- package/src/index/incremental.ts +4 -3
- package/src/index.ts +3 -1
- package/src/installer/benchmark-mode.ts +248 -0
- package/src/installer/config.ts +14 -2
- package/src/installer/hooks/opencode-plugin.ts +6 -20
- package/src/installer/hooks/search-guard.ts +4 -5
- package/src/installer/installer.ts +58 -5
- package/src/installer/search-policy.ts +28 -9
- package/src/literal.ts +139 -0
- package/src/mcp/index-cache.ts +2 -2
- package/src/mcp/serve.ts +4 -3
- package/src/mcp/server.ts +166 -9
- package/src/miru-index.ts +15 -6
- package/src/snippet.ts +6 -3
- package/src/token-count.ts +62 -0
- package/src/tokenizer/bert-wordpiece.ts +219 -0
- package/src/tokenizer/load.ts +14 -0
- package/src/types.ts +8 -0
- package/src/utils.ts +8 -1
- package/tokenizer/tokenizer.json +1 -0
package/README.md
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
# Miru (見る)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Find code by meaning, not grep. Miru returns the best **chunks** (path, lines, snippet) for questions like “where is auth middleware configured?”
|
|
3
|
+
Your AI agent finds the code it needs in 60% fewer tokens.
|
|
6
4
|
|
|
7
5
|
**Requires:** [Bun](https://bun.sh) 1.1+ · [Takara API key](https://takara.ai)
|
|
8
6
|
|
|
9
|
-
## Privacy and API usage
|
|
10
|
-
|
|
11
|
-
Miru sends **file contents** to the [Takara inference API](https://takara.ai) when building an index and when embedding search queries. Chunks from your repo are transmitted over HTTPS to generate embeddings. API usage may incur cost depending on your Takara plan.
|
|
12
|
-
|
|
13
|
-
If you index proprietary code, make sure that sending snippets to Takara's endpoint fits your security and compliance requirements. `MIRU_WORKSPACE_ROOT` is an opt-in boundary for MCP local `repo` paths only, and restricts indexing to a single workspace directory when set.
|
|
14
|
-
|
|
15
7
|
## Install
|
|
16
8
|
|
|
17
9
|
```bash
|
|
@@ -41,13 +33,15 @@ miru install
|
|
|
41
33
|
|
|
42
34
|
Interactive TUI — **↑↓** move, **space** toggle, **a** all, **enter** confirm. Pick agents and integrations:
|
|
43
35
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
36
|
+
|
|
37
|
+
| Integration | What it does |
|
|
38
|
+
| ----------------------------- | ------------------------------------------------------------------- |
|
|
39
|
+
| MCP server | `search`, `locate`, `expand`, and `find_related` tools in the agent |
|
|
40
|
+
| Instructions | Search policy in `CLAUDE.md` / `AGENTS.md` / `GEMINI.md` |
|
|
41
|
+
| Sub-agent | Dedicated `miru-code` agent file |
|
|
42
|
+
| Cursor rules | Always-on `.cursor/rules/miru-code.mdc` (Cursor only) |
|
|
43
|
+
| Search hooks *(experimental)* | Block built-in Grep/Glob and redirect to Miru MCP |
|
|
44
|
+
|
|
51
45
|
|
|
52
46
|
Restart the IDE when done.
|
|
53
47
|
|
|
@@ -57,28 +51,33 @@ miru uninstall # remove miru config
|
|
|
57
51
|
|
|
58
52
|
**Supported:** Cursor · Claude Code · Gemini CLI · Kiro · OpenCode · GitHub Copilot · Codex · VS Code · Visual Studio (Windows) · Windsurf / Devin Desktop
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
54
|
+
|
|
55
|
+
| IDE | MCP | Instructions / rules | Hooks *(experimental)* |
|
|
56
|
+
| -------------- | ------------------------------------- | ------------------------------- | ------------------------------------------------- |
|
|
57
|
+
| Cursor | `~/.cursor/mcp.json` | `~/.cursor/rules/miru-code.mdc` | `~/.cursor/hooks.json` |
|
|
58
|
+
| Claude Code | `~/.claude.json` | `~/.claude/CLAUDE.md` | `~/.claude/settings.json` |
|
|
59
|
+
| Gemini CLI | `~/.gemini/settings.json` | `~/.gemini/GEMINI.md` | `~/.gemini/settings.json` (`BeforeTool`) |
|
|
60
|
+
| Kiro | `~/.kiro/settings/mcp.json` | `~/.kiro/steering/miru.md` | `~/.kiro/settings/hooks.json` |
|
|
61
|
+
| OpenCode | `~/.config/opencode/opencode.json(c)` | `~/.config/opencode/AGENTS.md` | `~/.config/opencode/plugins/miru-search-guard.ts` |
|
|
62
|
+
| GitHub Copilot | `~/.copilot/mcp-config.json` | — | `~/.copilot/hooks/miru-search.json` |
|
|
63
|
+
| Codex | `~/.codex/config.toml` | `~/.codex/AGENTS.md` | `~/.codex/hooks.json` |
|
|
64
|
+
| VS Code | `…/Code/User/mcp.json` | — | `~/.copilot/hooks/miru-search.json` |
|
|
65
|
+
| Visual Studio | `%USERPROFILE%\.mcp.json` | — | `~/.copilot/hooks/miru-search.json` |
|
|
66
|
+
| Windsurf | — | — | `~/.codeium/windsurf/hooks.json` |
|
|
67
|
+
|
|
72
68
|
|
|
73
69
|
Sub-agent files are also written where supported (see `miru install` plan). Windsurf hooks only *(experimental)* — no MCP entry yet.
|
|
74
70
|
|
|
75
|
-
|
|
71
|
+
<details>
|
|
72
|
+
<summary>Search hooks <em>(experimental)</em></summary>
|
|
76
73
|
|
|
77
74
|
Search hooks are **experimental** — behavior and IDE support may change between releases.
|
|
78
75
|
|
|
79
|
-
Hooks run `miru hook-guard` before built-in search tools execute. They **block** conceptual Grep/Glob/SemanticSearch and shell `rg`/`grep`/`find`, and tell the agent to use Miru MCP `search` instead. Exact literal lookups (e.g. `REDIS_HOST`, a symbol name) still pass through.
|
|
76
|
+
Hooks run `miru hook-guard` before built-in search tools execute. They **block** conceptual Grep/Glob/SemanticSearch and shell `rg`/`grep`/`find`, and tell the agent to use Miru MCP `search` (or `locate` for exact literals) instead. Exact literal lookups (e.g. `REDIS_HOST`, a symbol name) still pass through.
|
|
77
|
+
|
|
78
|
+
Hooks are **off by default** at install time. Enable them in the installer if you want built-in Grep/Glob redirected to Miru MCP.
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
</details>
|
|
82
81
|
|
|
83
82
|
**Team sub-agent in a repo** (optional):
|
|
84
83
|
|
|
@@ -88,8 +87,11 @@ miru init --agent claude --force
|
|
|
88
87
|
|
|
89
88
|
## Try it
|
|
90
89
|
|
|
90
|
+
Meaning-based questions → `search`. Exact strings (env vars, symbols, error codes) → `locate`.
|
|
91
|
+
|
|
91
92
|
```bash
|
|
92
93
|
miru search "auth middleware" ./src
|
|
94
|
+
miru locate REDIS_HOST ./src
|
|
93
95
|
miru expand src/auth.ts 42 ./src
|
|
94
96
|
miru find-related src/auth.ts 42 ./src
|
|
95
97
|
```
|
|
@@ -104,13 +106,17 @@ bunx @takara-ai/miru-code search "auth middleware" ./src
|
|
|
104
106
|
|
|
105
107
|
## MCP tools
|
|
106
108
|
|
|
107
|
-
When wired via `miru install`, the MCP server exposes
|
|
109
|
+
When wired via `miru install`, the MCP server exposes `search`, `locate`, `expand`, and `find_related`. `read_benchmark` appears only in [benchmark mode](#benchmark-mode). Pass the **project root** as `repo` for local workspaces (or an `https://` git URL). The index is built on the first call and cached for the session.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
| Tool | When to use |
|
|
113
|
+
| ---------------- | --------------------------------------------------------------------------------------- |
|
|
114
|
+
| `search` | Default for code exploration — hybrid semantic + keyword search. One call per question. |
|
|
115
|
+
| `locate` | Exact substrings (env vars, symbols, error codes) — prefer over Grep. |
|
|
116
|
+
| `expand` | More context in the **same file** when a hit has `truncated: true`. |
|
|
117
|
+
| `find_related` | Similar code in **other files** from a `file_path` + `anchor_line`. |
|
|
118
|
+
| `read_benchmark` | Cumulative token-savings rollup *(benchmark mode only)*. |
|
|
108
119
|
|
|
109
|
-
| Tool | When to use |
|
|
110
|
-
|------|-------------|
|
|
111
|
-
| `search` | Default for code exploration — hybrid semantic + keyword search. One call per question. |
|
|
112
|
-
| `expand` | More context in the **same file** when a hit has `truncated: true`. |
|
|
113
|
-
| `find_related` | Similar code in **other files** from a `file_path` + `anchor_line`. |
|
|
114
120
|
|
|
115
121
|
### Workflow
|
|
116
122
|
|
|
@@ -121,42 +127,19 @@ When wired via `miru install`, the MCP server exposes three tools. Pass the **pr
|
|
|
121
127
|
|
|
122
128
|
Prefer these tools over Grep, Glob, or SemanticSearch when Miru MCP is connected — hooks and instructions enforce that when enabled.
|
|
123
129
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
**`search`**
|
|
127
|
-
|
|
128
|
-
| Param | Required | Notes |
|
|
129
|
-
|-------|----------|-------|
|
|
130
|
-
| `query` | yes | Natural language or code query |
|
|
131
|
-
| `repo` | yes | Project root or git URL |
|
|
132
|
-
| `top_k` | no | Results to return (default 3, max 10) |
|
|
133
|
-
| `dedupe_by_file` | no | Keep best hit per file (default `true`) |
|
|
134
|
-
|
|
135
|
-
**`expand`**
|
|
136
|
-
|
|
137
|
-
| Param | Required | Notes |
|
|
138
|
-
|-------|----------|-------|
|
|
139
|
-
| `file_path` | yes | From hit `file_path` or `absolute_path` (local repos) |
|
|
140
|
-
| `anchor_line` | yes | From the search hit (`anchor_line` when truncated, else `start_line`) |
|
|
141
|
-
| `repo` | yes | Same repo as the search |
|
|
142
|
-
| `before` / `after` | no | Extra chunks before/after anchor (default 1 each) |
|
|
143
|
-
|
|
144
|
-
**`find_related`**
|
|
145
|
-
|
|
146
|
-
| Param | Required | Notes |
|
|
147
|
-
|-------|----------|-------|
|
|
148
|
-
| `file_path` | yes | From a search hit |
|
|
149
|
-
| `anchor_line` | yes | From the search hit |
|
|
150
|
-
| `repo` | yes | Same repo as the search |
|
|
151
|
-
| `top_k` | no | Related chunks to return (default 3, max 10) |
|
|
152
|
-
|
|
153
|
-
Local repo hits include `absolute_path` for one-click navigation. Confirm exact literals (env var names, quoted strings) with native grep when needed.
|
|
130
|
+
Local repo hits include `absolute_path` for one-click navigation. Parameter reference is below under [MCP parameters](#mcp-parameters).
|
|
154
131
|
|
|
155
132
|
## How it works
|
|
156
133
|
|
|
157
|
-
Hybrid search: Takara embeddings + BM25 + fusion + reranking.
|
|
134
|
+
Hybrid search: Takara embeddings + BM25 + fusion + reranking. Index **code**, **docs**, **config**, or **all** with `--content`.
|
|
158
135
|
|
|
159
|
-
|
|
136
|
+
MCP watches local files and updates the index incrementally. Package upgrades invalidate stale caches via the version epoch.
|
|
137
|
+
|
|
138
|
+
| OS | Index cache |
|
|
139
|
+
|----|-------------|
|
|
140
|
+
| macOS | `~/Library/Caches/miru` |
|
|
141
|
+
| Linux | `~/.cache/miru` |
|
|
142
|
+
| Windows | `%LOCALAPPDATA%\miru\Cache` |
|
|
160
143
|
|
|
161
144
|
### Chunking & languages
|
|
162
145
|
|
|
@@ -187,9 +170,7 @@ Miru chunks source in tiers: **AST** (tree-sitter, default) → **structural** h
|
|
|
187
170
|
| rust | `.rs` |
|
|
188
171
|
| scala | `.scala` |
|
|
189
172
|
| solidity | `.sol` |
|
|
190
|
-
| typescript | `.ts`, `.mts`, `.cts` |
|
|
191
|
-
|
|
192
|
-
**Also shipped:** `.tsx` uses a dedicated TSX grammar; extra OCaml and PHP-only grammars are vendored alongside the main set.
|
|
173
|
+
| typescript | `.ts`, `.tsx`, `.mts`, `.cts` |
|
|
193
174
|
|
|
194
175
|
**Structural fallback** (brace/indent heuristics when AST is unavailable): python, go, typescript, javascript, cpp, c.
|
|
195
176
|
|
|
@@ -199,17 +180,24 @@ Set `MIRU_AST_CHUNKING=0` to disable AST and use structural → lines only.
|
|
|
199
180
|
|
|
200
181
|
## CLI reference
|
|
201
182
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
|
205
|
-
| `miru
|
|
206
|
-
| `miru
|
|
207
|
-
| `miru
|
|
208
|
-
| `miru
|
|
209
|
-
| `miru
|
|
210
|
-
| `miru
|
|
211
|
-
| `miru
|
|
212
|
-
| `miru`
|
|
183
|
+
|
|
184
|
+
| Command | Purpose |
|
|
185
|
+
| ---------------------------------------- | --------------------------------------------------------------------------------- |
|
|
186
|
+
| `miru setup` | Store API key |
|
|
187
|
+
| `miru install` | Configure IDE (global) |
|
|
188
|
+
| `miru uninstall` | Remove IDE config |
|
|
189
|
+
| `miru search <query> [path]` | Search (`-k N`, `--content`, `--json`) |
|
|
190
|
+
| `miru locate <literal> [path]` | Exact substring in the index |
|
|
191
|
+
| `miru expand <file> <line> [path]` | Adjacent chunks in the same file |
|
|
192
|
+
| `miru find-related <file> <line> [path]` | Related chunks |
|
|
193
|
+
| `miru benchmark on/off/status/clear` | Toggle MCP benchmark mode / clear report |
|
|
194
|
+
| `miru init --agent <id>` | Project-local sub-agent |
|
|
195
|
+
| `miru clear [path]` | Drop index cache (use after big CLI-only refactors) |
|
|
196
|
+
| `miru hook-guard` | PreToolUse hook entrypoint *(experimental)*; used by installers, reads JSON stdin |
|
|
197
|
+
| `miru` | Start MCP server (`--benchmark` for comparisons) |
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
CLI uses hyphens (`find-related`); MCP tool names use underscores (`find_related`).
|
|
213
201
|
|
|
214
202
|
## Library
|
|
215
203
|
|
|
@@ -226,21 +214,112 @@ const results = await index.search({ query: "BM25 tokenize", topK: 10 });
|
|
|
226
214
|
|
|
227
215
|
## Environment
|
|
228
216
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `
|
|
217
|
+
|
|
218
|
+
| Variable | Notes |
|
|
219
|
+
| ----------------------------- | ------------------------------------------------------------------------ |
|
|
220
|
+
| `TAKARA_API_KEY` | Required |
|
|
221
|
+
| `MIRU_OPENAI_BASE_URL` | Default `https://infer.takara.ai/v1` |
|
|
222
|
+
| `MIRU_OPENAI_EMBEDDING_MODEL` | Default `ds1-miru-int8` |
|
|
223
|
+
| `MIRU_WORKSPACE_ROOT` | Optional: restrict MCP local `repo` paths to this directory |
|
|
224
|
+
| `MIRU_MAX_INDEX_FILES` | Cap files indexed per operation |
|
|
225
|
+
| `MIRU_ALLOW_HTTP_GIT` | Set `1` to allow plain `http://` git clones |
|
|
226
|
+
| `MIRU_MCP_WATCH` | Set `0` to disable MCP file watch |
|
|
227
|
+
| `MIRU_AST_CHUNKING` | Set `0` to disable tree-sitter AST chunking |
|
|
228
|
+
| `MIRU_BENCHMARK_HISTORY_PATH` | Override; see [Benchmark mode](#benchmark-mode) |
|
|
229
|
+
| `MIRU_QUIET` | Set `1` to skip the framed CLI banner (subtitle only on color terminals) |
|
|
230
|
+
| `NO_COLOR` | Disable CLI colors |
|
|
231
|
+
|
|
241
232
|
|
|
242
233
|
See `.env.example` for more.
|
|
243
234
|
|
|
235
|
+
## Privacy and API usage
|
|
236
|
+
|
|
237
|
+
Miru sends **file contents** to the [Takara inference API](https://takara.ai) when building an index and when embedding search queries. Chunks from your repo are transmitted over HTTPS to generate embeddings. API usage may incur cost depending on your Takara plan.
|
|
238
|
+
|
|
239
|
+
If you index proprietary code, make sure that sending snippets to Takara's endpoint fits your security and compliance requirements. `MIRU_WORKSPACE_ROOT` is an opt-in boundary for MCP local `repo` paths only, and restricts indexing to a single workspace directory when set.
|
|
240
|
+
|
|
241
|
+
## Benchmark mode
|
|
242
|
+
|
|
243
|
+
Optional measurement of how many tokens Miru saves versus a simple Grep workflow (ripgrep + reading the top matched file). Useful when evaluating Miru; leave it off day-to-day. Only local repo paths are compared — git URL repos skip the comparison and return `benchmark_skipped: "local_repo_only"`.
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
miru benchmark on # add --benchmark to installed MCP configs
|
|
247
|
+
miru benchmark status
|
|
248
|
+
miru benchmark off # prefer off when finished measuring
|
|
249
|
+
miru benchmark clear # delete the global report
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Restart agents after changing mode. `miru install` keeps `--benchmark` if it was already enabled.
|
|
253
|
+
|
|
254
|
+
While on, each `search` / `locate` response includes a compact `benchmark` block (`save_pct`, `miru_tok`, `grep_tok`, `saved_tok`, `rank1`). Call `read_benchmark` for a cumulative rollup (or ask the agent when you want totals).
|
|
255
|
+
|
|
256
|
+
History is **global** (not per-repo) under Miru's state directory:
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
| OS | Default path |
|
|
260
|
+
| ------- | ---------------------------------------------------------------------------- |
|
|
261
|
+
| macOS | `~/Library/Application Support/miru/benchmark-history.json` |
|
|
262
|
+
| Linux | `~/.config/miru/benchmark-history.json` (`$XDG_CONFIG_HOME/miru/…` when set) |
|
|
263
|
+
| Windows | `%APPDATA%\miru\benchmark-history.json` |
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
Override with `MIRU_BENCHMARK_HISTORY_PATH`. Append-only JSONL of compact token deltas (no query text); `read_benchmark` returns cumulative totals. Stored in plaintext — `miru benchmark clear` or uninstall on shared machines.
|
|
267
|
+
|
|
268
|
+
## MCP parameters
|
|
269
|
+
|
|
270
|
+
`**search**`
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
| Param | Required | Notes |
|
|
274
|
+
| ---------------- | -------- | --------------------------------------- |
|
|
275
|
+
| `query` | yes | Natural language or code query |
|
|
276
|
+
| `repo` | yes | Project root or git URL |
|
|
277
|
+
| `top_k` | no | Results to return (default 3, max 10) |
|
|
278
|
+
| `dedupe_by_file` | no | Keep best hit per file (default `true`) |
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
`**locate**`
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
| Param | Required | Notes |
|
|
285
|
+
| ------------- | -------- | ----------------------------------------------------------------------------------- |
|
|
286
|
+
| `literal` | yes | Exact substring to find |
|
|
287
|
+
| `repo` | yes | Project root or git URL |
|
|
288
|
+
| `mode` | no | `count` · `locations` · `lines` (default). Prefer `count`/`locations` when possible |
|
|
289
|
+
| `limit` | no | Cap returned hits. Omit to return all matches |
|
|
290
|
+
| `ignore_case` | no | Case-insensitive match (default `false`) |
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
`**expand**`
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
| Param | Required | Notes |
|
|
297
|
+
| ------------------ | -------- | --------------------------------------------------------------------- |
|
|
298
|
+
| `file_path` | yes | From hit `file_path` or `absolute_path` (local repos) |
|
|
299
|
+
| `anchor_line` | yes | From the search hit (`anchor_line` when truncated, else `start_line`) |
|
|
300
|
+
| `repo` | yes | Same repo as the search |
|
|
301
|
+
| `before` / `after` | no | Extra chunks before/after anchor (default 1 each) |
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
`**find_related**`
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
| Param | Required | Notes |
|
|
308
|
+
| ------------- | -------- | -------------------------------------------- |
|
|
309
|
+
| `file_path` | yes | From a search hit |
|
|
310
|
+
| `anchor_line` | yes | From the search hit |
|
|
311
|
+
| `repo` | yes | Same repo as the search |
|
|
312
|
+
| `top_k` | no | Related chunks to return (default 3, max 10) |
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
`**read_benchmark**` *(benchmark mode only)*
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
| Param | Required | Notes |
|
|
319
|
+
| ------ | -------- | ---------------------------------------------------------------------- |
|
|
320
|
+
| `repo` | no | Filter rollup to one local path or git URL. Omit for all saved queries |
|
|
321
|
+
|
|
322
|
+
|
|
244
323
|
## Manual MCP (skip `miru install`)
|
|
245
324
|
|
|
246
325
|
```json
|
|
@@ -252,6 +331,8 @@ See `.env.example` for more.
|
|
|
252
331
|
}
|
|
253
332
|
```
|
|
254
333
|
|
|
334
|
+
For benchmark mode, set `"args": ["--benchmark"]` (or append that flag). Prefer `miru benchmark on` after a normal install — it updates every agent config.
|
|
335
|
+
|
|
255
336
|
Run `miru setup` once so the server can load your key from `credentials.json`.
|
|
256
337
|
|
|
257
338
|
Use `bunx` + `@takara-ai/miru-code` if `miru` is not global. Wrapper key varies by IDE (`mcpServers`, `servers`, or `mcp`).
|
|
@@ -266,18 +347,8 @@ bun test && bun run typecheck
|
|
|
266
347
|
|
|
267
348
|
Local MCP: `"command": "bun", "args": ["/path/to/miru-code/src/cli.ts"]`
|
|
268
349
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
`miru help` and setup print a framed wordmark and Takara crane on color terminals. Set `MIRU_QUIET=1` to use the subtitle line only.
|
|
272
|
-
|
|
273
|
-
Crane ASCII art is committed in `src/brand-banner.ts`. To regenerate it from the SVG source (local `assets/red_crane_vector.svg`, gitignored):
|
|
274
|
-
|
|
275
|
-
```bash
|
|
276
|
-
bun run scripts/render-crane-art.ts
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
Copy the printed `TAKARA_CRANE` constant into `src/brand-banner.ts`. Requires ImageMagick (`magick`).
|
|
350
|
+
`miru help` / setup print a framed wordmark on color terminals (`MIRU_QUIET=1` for subtitle only). Crane art lives in `src/brand-banner.ts`; regenerate with `bun run scripts/render-crane-art.ts` (ImageMagick). The crane is a registered mark of Takara.ai Ltd.
|
|
280
351
|
|
|
281
352
|
## License
|
|
282
353
|
|
|
283
|
-
MIT
|
|
354
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takara-ai/miru-code",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Miru (見る) — hybrid code search for agents. Bun, TypeScript, Takara embeddings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"src",
|
|
39
39
|
"grammars",
|
|
40
|
+
"tokenizer",
|
|
40
41
|
"README.md",
|
|
41
42
|
"LICENSE"
|
|
42
43
|
],
|
|
@@ -57,8 +58,10 @@
|
|
|
57
58
|
"benchmark:recall": "bun run scripts/benchmark-recall-tokens.ts",
|
|
58
59
|
"benchmark:vs-grep": "bun run scripts/benchmark-miru-vs-grep.ts",
|
|
59
60
|
"benchmark:workflow": "bun run scripts/benchmark-workflow-tokens.ts",
|
|
61
|
+
"benchmark:literal": "bun run scripts/benchmark-literal-tokens.ts",
|
|
60
62
|
"benchmark:quality": "bun run scripts/benchmark-quality.ts",
|
|
61
|
-
"benchmark:quantization": "bun run scripts/benchmark-quantization.ts"
|
|
63
|
+
"benchmark:quantization": "bun run scripts/benchmark-quantization.ts",
|
|
64
|
+
"benchmark:tokenizer-ab": "bun run scripts/tokenizer-ab.ts"
|
|
62
65
|
},
|
|
63
66
|
"dependencies": {
|
|
64
67
|
"ignore": "^7.0.5",
|
|
@@ -67,7 +70,10 @@
|
|
|
67
70
|
},
|
|
68
71
|
"devDependencies": {
|
|
69
72
|
"@biomejs/biome": "^2.5.1",
|
|
73
|
+
"@huggingface/tokenizers": "^0.1.3",
|
|
70
74
|
"@types/bun": "^1.3.14",
|
|
75
|
+
"ajv": "^8.17.1",
|
|
76
|
+
"ajv-formats": "^3.0.1",
|
|
71
77
|
"tree-sitter-bash": "^0.25.1",
|
|
72
78
|
"tree-sitter-c": "^0.24.1",
|
|
73
79
|
"tree-sitter-c-sharp": "^0.23.5",
|
|
@@ -90,8 +96,6 @@
|
|
|
90
96
|
"tree-sitter-scala": "^0.24.0",
|
|
91
97
|
"tree-sitter-solidity": "^1.2.13",
|
|
92
98
|
"tree-sitter-typescript": "^0.23.2",
|
|
93
|
-
"typescript": "^6.0.3"
|
|
94
|
-
"ajv": "^8.17.1",
|
|
95
|
-
"ajv-formats": "^3.0.1"
|
|
99
|
+
"typescript": "^6.0.3"
|
|
96
100
|
}
|
|
97
101
|
}
|