@zvec/zvec-grep 0.1.5 → 0.1.6
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 +88 -249
- package/README_CN.md +82 -246
- package/dist/authorization/index.d.ts +7 -0
- package/dist/authorization/index.js +7 -0
- package/dist/authorization/index.js.map +1 -0
- package/dist/authorization/manager.d.ts +8 -0
- package/dist/authorization/manager.js +19 -0
- package/dist/authorization/manager.js.map +1 -0
- package/dist/authorization/operation.d.ts +7 -0
- package/dist/authorization/operation.js +50 -0
- package/dist/authorization/operation.js.map +1 -0
- package/dist/authorization/planner.d.ts +21 -0
- package/dist/authorization/planner.js +97 -0
- package/dist/authorization/planner.js.map +1 -0
- package/dist/authorization/prompt.d.ts +11 -0
- package/dist/authorization/prompt.js +62 -0
- package/dist/authorization/prompt.js.map +1 -0
- package/dist/authorization/store.d.ts +20 -0
- package/dist/authorization/store.js +251 -0
- package/dist/authorization/store.js.map +1 -0
- package/dist/authorization/target.d.ts +15 -0
- package/dist/authorization/target.js +49 -0
- package/dist/authorization/target.js.map +1 -0
- package/dist/authorization/types.d.ts +61 -0
- package/dist/authorization/types.js +2 -0
- package/dist/authorization/types.js.map +1 -0
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/args.js +304 -54
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth.d.ts +21 -0
- package/dist/cli/auth.js +212 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/commands.js +433 -618
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/errors.js +2 -2
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/format/context.d.ts +1 -0
- package/dist/cli/format/context.js +241 -45
- package/dist/cli/format/context.js.map +1 -1
- package/dist/cli/format/debug.js +2 -2
- package/dist/cli/format/debug.js.map +1 -1
- package/dist/cli/format/progress.d.ts +4 -0
- package/dist/cli/format/progress.js +219 -46
- package/dist/cli/format/progress.js.map +1 -1
- package/dist/cli/format/status.d.ts +77 -6
- package/dist/cli/format/status.js +302 -106
- package/dist/cli/format/status.js.map +1 -1
- package/dist/cli/help.js +258 -59
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/cli/install.d.ts +4 -0
- package/dist/cli/install.js +845 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/managed-rg.d.ts +10 -0
- package/dist/cli/managed-rg.js +329 -0
- package/dist/cli/managed-rg.js.map +1 -0
- package/dist/cli/types.d.ts +20 -6
- package/dist/cli/types.js.map +1 -1
- package/dist/client/daemon-client.d.ts +19 -0
- package/dist/client/daemon-client.js +180 -0
- package/dist/client/daemon-client.js.map +1 -0
- package/dist/client/mode-router.d.ts +9 -0
- package/dist/client/mode-router.js +28 -0
- package/dist/client/mode-router.js.map +1 -0
- package/dist/client/search-policy.d.ts +11 -0
- package/dist/client/search-policy.js +15 -0
- package/dist/client/search-policy.js.map +1 -0
- package/dist/daemon/backend.d.ts +76 -0
- package/dist/daemon/backend.js +1049 -0
- package/dist/daemon/backend.js.map +1 -0
- package/dist/daemon/change-set.d.ts +25 -0
- package/dist/daemon/change-set.js +101 -0
- package/dist/daemon/change-set.js.map +1 -0
- package/dist/daemon/config.d.ts +24 -0
- package/dist/daemon/config.js +88 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/errors.d.ts +5 -0
- package/dist/daemon/errors.js +11 -0
- package/dist/daemon/errors.js.map +1 -0
- package/dist/daemon/http-server.d.ts +30 -0
- package/dist/daemon/http-server.js +287 -0
- package/dist/daemon/http-server.js.map +1 -0
- package/dist/daemon/index-coordinator.d.ts +23 -0
- package/dist/daemon/index-coordinator.js +68 -0
- package/dist/daemon/index-coordinator.js.map +1 -0
- package/dist/daemon/job-scheduler.d.ts +70 -0
- package/dist/daemon/job-scheduler.js +366 -0
- package/dist/daemon/job-scheduler.js.map +1 -0
- package/dist/daemon/logger.d.ts +9 -0
- package/dist/daemon/logger.js +53 -0
- package/dist/daemon/logger.js.map +1 -0
- package/dist/daemon/model-pool.d.ts +45 -0
- package/dist/daemon/model-pool.js +187 -0
- package/dist/daemon/model-pool.js.map +1 -0
- package/dist/daemon/root-lease.d.ts +14 -0
- package/dist/daemon/root-lease.js +188 -0
- package/dist/daemon/root-lease.js.map +1 -0
- package/dist/daemon/root-runtime.d.ts +78 -0
- package/dist/daemon/root-runtime.js +333 -0
- package/dist/daemon/root-runtime.js.map +1 -0
- package/dist/daemon/runtime-manager.d.ts +45 -0
- package/dist/daemon/runtime-manager.js +243 -0
- package/dist/daemon/runtime-manager.js.map +1 -0
- package/dist/daemon/runtime.d.ts +12 -0
- package/dist/daemon/runtime.js +102 -0
- package/dist/daemon/runtime.js.map +1 -0
- package/dist/daemon/server-controller.d.ts +39 -0
- package/dist/daemon/server-controller.js +203 -0
- package/dist/daemon/server-controller.js.map +1 -0
- package/dist/daemon/watch-manager.d.ts +50 -0
- package/dist/daemon/watch-manager.js +293 -0
- package/dist/daemon/watch-manager.js.map +1 -0
- package/dist/daemon/workspace-read-session-cache.d.ts +31 -0
- package/dist/daemon/workspace-read-session-cache.js +115 -0
- package/dist/daemon/workspace-read-session-cache.js.map +1 -0
- package/dist/engine/config.d.ts +30 -8
- package/dist/engine/config.js +171 -45
- package/dist/engine/config.js.map +1 -1
- package/dist/engine/{errors/index.d.ts → errors.d.ts} +6 -1
- package/dist/engine/{errors/details.js → errors.js} +17 -4
- package/dist/engine/errors.js.map +1 -0
- package/dist/engine/extraction/code/adapter.d.ts +1 -1
- package/dist/engine/extraction/code/extractor.d.ts +5 -11
- package/dist/engine/extraction/code/extractor.js +105 -44
- package/dist/engine/extraction/code/extractor.js.map +1 -1
- package/dist/engine/extraction/code/families/c-family.js +1 -1
- package/dist/engine/extraction/code/families/c-family.js.map +1 -1
- package/dist/engine/extraction/code/families/js-ts.d.ts +1 -1
- package/dist/engine/extraction/code/families/metadata.d.ts +1 -1
- package/dist/engine/extraction/code/tree-sitter/grammar.js.map +1 -0
- package/dist/engine/extraction/code/tree-sitter/nodes.js.map +1 -0
- package/dist/engine/extraction/code/tree-sitter/parser.js.map +1 -0
- package/dist/engine/extraction/image/extractor.d.ts +5 -0
- package/dist/engine/extraction/image/extractor.js +35 -0
- package/dist/engine/extraction/image/extractor.js.map +1 -0
- package/dist/engine/extraction/index.d.ts +3 -44
- package/dist/engine/extraction/index.js +1 -280
- package/dist/engine/extraction/index.js.map +1 -1
- package/dist/engine/extraction/markdown/extractor.d.ts +5 -11
- package/dist/engine/extraction/markdown/extractor.js +35 -16
- package/dist/engine/extraction/markdown/extractor.js.map +1 -1
- package/dist/engine/extraction/runtime.d.ts +4 -0
- package/dist/engine/extraction/runtime.js +26 -0
- package/dist/engine/extraction/runtime.js.map +1 -0
- package/dist/engine/extraction/source.d.ts +18 -0
- package/dist/engine/extraction/source.js +22 -0
- package/dist/engine/extraction/source.js.map +1 -0
- package/dist/engine/extraction/text/extractor.d.ts +7 -0
- package/dist/engine/extraction/text/extractor.js +168 -0
- package/dist/engine/extraction/text/extractor.js.map +1 -0
- package/dist/engine/extraction/types.d.ts +4 -0
- package/dist/engine/{models → extraction}/types.js.map +1 -1
- package/dist/engine/{files/file-type.d.ts → file-type.d.ts} +1 -1
- package/dist/engine/file-type.js.map +1 -0
- package/dist/engine/index-status.d.ts +9 -0
- package/dist/engine/index-status.js +38 -0
- package/dist/engine/index-status.js.map +1 -0
- package/dist/engine/manifest.d.ts +12 -0
- package/dist/engine/manifest.js +120 -0
- package/dist/engine/manifest.js.map +1 -0
- package/dist/engine/models/{providers/llama-cpp/embedding.d.ts → backends/llama-cpp.d.ts} +25 -20
- package/dist/engine/models/{providers/llama-cpp/embedding.js → backends/llama-cpp.js} +127 -106
- package/dist/engine/models/backends/llama-cpp.js.map +1 -0
- package/dist/engine/models/backends/model2vec.d.ts +57 -0
- package/dist/engine/models/backends/model2vec.js +332 -0
- package/dist/engine/models/backends/model2vec.js.map +1 -0
- package/dist/engine/models/backends/qwen.d.ts +44 -0
- package/dist/engine/models/{providers/qwen/embedding.js → backends/qwen.js} +155 -94
- package/dist/engine/models/backends/qwen.js.map +1 -0
- package/dist/engine/models/backends/transformers-js.d.ts +87 -0
- package/dist/engine/models/backends/transformers-js.js +316 -0
- package/dist/engine/models/backends/transformers-js.js.map +1 -0
- package/dist/engine/models/catalog.d.ts +188 -23
- package/dist/engine/models/catalog.js +172 -25
- package/dist/engine/models/catalog.js.map +1 -1
- package/dist/engine/models/download-progress.d.ts +15 -0
- package/dist/engine/models/download-progress.js +48 -0
- package/dist/engine/models/download-progress.js.map +1 -0
- package/dist/engine/models/embeddings.d.ts +58 -18
- package/dist/engine/models/embeddings.js +52 -28
- package/dist/engine/models/embeddings.js.map +1 -1
- package/dist/engine/models/factory.d.ts +2 -5
- package/dist/engine/models/factory.js +41 -56
- package/dist/engine/models/factory.js.map +1 -1
- package/dist/engine/models/index.d.ts +4 -6
- package/dist/engine/models/index.js +4 -4
- package/dist/engine/models/index.js.map +1 -1
- package/dist/engine/models/ranking.d.ts +7 -3
- package/dist/engine/models/resolution.d.ts +8 -0
- package/dist/engine/models/resolution.js +22 -0
- package/dist/engine/models/resolution.js.map +1 -0
- package/dist/engine/pipeline/indexing/index.d.ts +9 -7
- package/dist/engine/pipeline/indexing/index.js +360 -121
- package/dist/engine/pipeline/indexing/index.js.map +1 -1
- package/dist/engine/pipeline/indexing/root-paths.js +6 -6
- package/dist/engine/pipeline/indexing/root-paths.js.map +1 -1
- package/dist/engine/pipeline/indexing/scanner/index.d.ts +6 -1
- package/dist/engine/pipeline/indexing/scanner/index.js +233 -29
- package/dist/engine/pipeline/indexing/scanner/index.js.map +1 -1
- package/dist/engine/pipeline/search/index.d.ts +6 -6
- package/dist/engine/pipeline/search/index.js +8 -10
- package/dist/engine/pipeline/search/index.js.map +1 -1
- package/dist/engine/service/index.d.ts +3 -2
- package/dist/engine/service/index.js +1 -1
- package/dist/engine/service/index.js.map +1 -1
- package/dist/engine/service/root.d.ts +13 -12
- package/dist/engine/service/root.js +35 -24
- package/dist/engine/service/root.js.map +1 -1
- package/dist/engine/service/structure-enrichment.js +12 -14
- package/dist/engine/service/structure-enrichment.js.map +1 -1
- package/dist/engine/service/types.d.ts +32 -37
- package/dist/engine/service/workspace-index.d.ts +24 -0
- package/dist/engine/service/workspace-index.js +151 -0
- package/dist/engine/service/workspace-index.js.map +1 -0
- package/dist/engine/service/zvec-grep.d.ts +12 -1
- package/dist/engine/service/zvec-grep.js +677 -486
- package/dist/engine/service/zvec-grep.js.map +1 -1
- package/dist/engine/storage/index.d.ts +8 -4
- package/dist/engine/storage/index.js +1 -1
- package/dist/engine/storage/index.js.map +1 -1
- package/dist/engine/storage/zvec.d.ts +10 -33
- package/dist/engine/storage/zvec.js +95 -38
- package/dist/engine/storage/zvec.js.map +1 -1
- package/dist/engine/types.d.ts +15 -23
- package/dist/engine/types.js +1 -1
- package/dist/engine/types.js.map +1 -1
- package/dist/engine/utils/daemon-lease.d.ts +17 -0
- package/dist/engine/utils/daemon-lease.js +175 -0
- package/dist/engine/utils/daemon-lease.js.map +1 -0
- package/dist/engine/utils/file-selection.js +38 -1
- package/dist/engine/utils/file-selection.js.map +1 -1
- package/dist/engine/utils/lock.js +1 -1
- package/dist/engine/utils/lock.js.map +1 -1
- package/dist/index-progress.d.ts +10 -0
- package/dist/index-progress.js +159 -0
- package/dist/index-progress.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/http-transport.d.ts +27 -0
- package/dist/mcp/http-transport.js +182 -0
- package/dist/mcp/http-transport.js.map +1 -0
- package/dist/mcp/input-normalization.d.ts +38 -0
- package/dist/mcp/input-normalization.js +95 -0
- package/dist/mcp/input-normalization.js.map +1 -0
- package/dist/mcp/progress-heartbeat.d.ts +17 -0
- package/dist/mcp/progress-heartbeat.js +46 -0
- package/dist/mcp/progress-heartbeat.js.map +1 -0
- package/dist/mcp/request-metadata.d.ts +2 -0
- package/dist/mcp/request-metadata.js +11 -0
- package/dist/mcp/request-metadata.js.map +1 -0
- package/dist/mcp/request-state.d.ts +40 -0
- package/dist/mcp/request-state.js +210 -0
- package/dist/mcp/request-state.js.map +1 -0
- package/dist/mcp/result-format.d.ts +13 -0
- package/dist/mcp/result-format.js +75 -0
- package/dist/mcp/result-format.js.map +1 -0
- package/dist/mcp/schemas.d.ts +430 -0
- package/dist/mcp/schemas.js +447 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/tools.d.ts +150 -0
- package/dist/mcp/tools.js +448 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/toolset.d.ts +5 -0
- package/dist/mcp/toolset.js +12 -0
- package/dist/mcp/toolset.js.map +1 -0
- package/dist/observability/trace-context.d.ts +11 -0
- package/dist/observability/trace-context.js +138 -0
- package/dist/observability/trace-context.js.map +1 -0
- package/docs/01-agents.md +111 -0
- package/docs/02-cli.md +229 -0
- package/docs/03-mcp.md +167 -0
- package/docs/04-pipeline.md +218 -0
- package/docs/05-architecture.md +86 -0
- package/docs/06-server.md +210 -0
- package/docs/07-embedding.md +179 -0
- package/docs/08-roadmap.md +85 -0
- package/docs/README.md +53 -0
- package/package.json +17 -8
- package/skills/zvec-grep/SKILL.md +43 -133
- package/skills/zvec-grep/agents/openai.yaml +2 -2
- package/skills/zvec-grep/references/cli-fallback.md +85 -0
- package/dist/cli/mcp.d.ts +0 -2
- package/dist/cli/mcp.js +0 -354
- package/dist/cli/mcp.js.map +0 -1
- package/dist/engine/collection/index.d.ts +0 -55
- package/dist/engine/collection/index.js +0 -710
- package/dist/engine/collection/index.js.map +0 -1
- package/dist/engine/errors/details.d.ts +0 -6
- package/dist/engine/errors/details.js.map +0 -1
- package/dist/engine/errors/index.js +0 -16
- package/dist/engine/errors/index.js.map +0 -1
- package/dist/engine/extraction/tree-sitter/grammar.js.map +0 -1
- package/dist/engine/extraction/tree-sitter/nodes.js.map +0 -1
- package/dist/engine/extraction/tree-sitter/parser.js.map +0 -1
- package/dist/engine/files/file-type.js.map +0 -1
- package/dist/engine/models/providers/index.d.ts +0 -2
- package/dist/engine/models/providers/index.js +0 -3
- package/dist/engine/models/providers/index.js.map +0 -1
- package/dist/engine/models/providers/llama-cpp/embedding.js.map +0 -1
- package/dist/engine/models/providers/llama-cpp/index.d.ts +0 -1
- package/dist/engine/models/providers/llama-cpp/index.js +0 -2
- package/dist/engine/models/providers/llama-cpp/index.js.map +0 -1
- package/dist/engine/models/providers/qwen/embedding.d.ts +0 -42
- package/dist/engine/models/providers/qwen/embedding.js.map +0 -1
- package/dist/engine/models/providers/qwen/index.d.ts +0 -1
- package/dist/engine/models/providers/qwen/index.js +0 -2
- package/dist/engine/models/providers/qwen/index.js.map +0 -1
- package/dist/engine/models/types.d.ts +0 -30
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.d.ts +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.js +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.d.ts +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.js +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.d.ts +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.js +0 -0
- /package/dist/engine/{models → extraction}/types.js +0 -0
- /package/dist/engine/{files/file-type.js → file-type.js} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
[Documentation](./README.md) · [Agents](./01-agents.md) ·
|
|
4
|
+
[CLI](./02-cli.md) · [MCP](./03-mcp.md) · [Pipeline](./04-pipeline.md) ·
|
|
5
|
+
[Architecture](./05-architecture.md) · [Server](./06-server.md) ·
|
|
6
|
+
[Embedding](./07-embedding.md) · [Roadmap](./08-roadmap.md)
|
|
7
|
+
|
|
8
|
+
zvec-grep is under active development. The destination is one dependable,
|
|
9
|
+
local-first search layer that people and agents can use without choosing among
|
|
10
|
+
separate retrieval tools. This roadmap describes direction, not promised dates;
|
|
11
|
+
priorities may change as we learn from real workloads.
|
|
12
|
+
|
|
13
|
+
## Now — make the public preview dependable
|
|
14
|
+
|
|
15
|
+
- Make installation, updates, and removal reliable across current platforms and
|
|
16
|
+
agent integrations.
|
|
17
|
+
- Harden incremental indexing, freshness, Server recovery, and concurrent
|
|
18
|
+
workspace access.
|
|
19
|
+
- Establish reproducible search-quality, performance, and agent-context
|
|
20
|
+
evaluation.
|
|
21
|
+
- Stabilize the CLI, MCP contracts, configuration, diagnostics, and index
|
|
22
|
+
compatibility policy before a stable release.
|
|
23
|
+
|
|
24
|
+
## Product direction
|
|
25
|
+
|
|
26
|
+
The following four directions are part of the product vision, not optional
|
|
27
|
+
experiments. Their sequencing may change, but each is required for zg to become
|
|
28
|
+
the search layer we want it to be.
|
|
29
|
+
|
|
30
|
+
### 1. Search more data formats, natively
|
|
31
|
+
|
|
32
|
+
- Make PDF, PowerPoint (`.ppt` and `.pptx`), HTML, images, and other multimodal
|
|
33
|
+
documents first-class searchable inputs.
|
|
34
|
+
- Add format-aware extraction that preserves useful structure, layout, metadata,
|
|
35
|
+
and relationships instead of flattening every file into plain text.
|
|
36
|
+
- Combine text extraction, OCR, vision-language understanding, and multimodal
|
|
37
|
+
Embedding where each format benefits from them.
|
|
38
|
+
- Use format- and content-aware retrieval so zg can choose a smarter strategy
|
|
39
|
+
for each query and source.
|
|
40
|
+
|
|
41
|
+
### 2. Strengthen retrieval
|
|
42
|
+
|
|
43
|
+
- Add knowledge-graph construction and graph retrieval to complement BM25,
|
|
44
|
+
vector search, and managed ripgrep.
|
|
45
|
+
- Expand multi-route hybrid retrieval across lexical, vector, graph, structural,
|
|
46
|
+
and metadata signals.
|
|
47
|
+
- Improve query planning so people and agents can express intent without
|
|
48
|
+
manually choosing retrieval routes.
|
|
49
|
+
- Improve fusion, reranking, evaluation, and explainability while keeping the
|
|
50
|
+
returned context compact.
|
|
51
|
+
|
|
52
|
+
### 3. Make zg more out of the box
|
|
53
|
+
|
|
54
|
+
- Provide a local GUI for search, workspace management, indexing, model setup,
|
|
55
|
+
permissions, and diagnostics.
|
|
56
|
+
- Support more installation paths beyond npm, including platform-native package
|
|
57
|
+
managers and installers where appropriate.
|
|
58
|
+
- Make first-run setup, Agent discovery, model selection, updates, and recovery
|
|
59
|
+
increasingly automatic with useful defaults.
|
|
60
|
+
- Preserve CLI and configuration control for advanced users while removing it
|
|
61
|
+
from the critical path for everyone else.
|
|
62
|
+
|
|
63
|
+
### 4. Reach every platform, from PC to mobile
|
|
64
|
+
|
|
65
|
+
- Deliver a consistent experience across macOS, Windows, and Linux desktops.
|
|
66
|
+
- Extend the local search layer to iOS and Android instead of treating mobile as
|
|
67
|
+
a remote client to a required cloud service.
|
|
68
|
+
- Adapt indexing, storage, and model execution to the memory, power, and lifecycle
|
|
69
|
+
constraints of mobile devices.
|
|
70
|
+
- Keep the same local-first trust and permission model across desktop and mobile.
|
|
71
|
+
|
|
72
|
+
## Guardrails
|
|
73
|
+
|
|
74
|
+
- Local-first remains the default; remote content transfer always requires
|
|
75
|
+
explicit authorization.
|
|
76
|
+
- zg should hide retrieval-tool choice from users without hiding useful control.
|
|
77
|
+
- Better recall must not come at the cost of noisy, oversized agent context.
|
|
78
|
+
- A hosted service must never be required for the core local workflow.
|
|
79
|
+
|
|
80
|
+
## Help shape the roadmap
|
|
81
|
+
|
|
82
|
+
Priorities should come from real use. Open a
|
|
83
|
+
[GitHub issue](https://github.com/zvec-ai/zvec-grep/issues) to describe a
|
|
84
|
+
workflow, limitation, or result that matters to you. Contributions are welcome;
|
|
85
|
+
see the [Contributing Guide](../CONTRIBUTING.md).
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# zvec-grep documentation
|
|
2
|
+
|
|
3
|
+
**zg** is one local-first search layer for people and agents. These guides go
|
|
4
|
+
beyond the short path in the project [README](../README.md) and explain how to
|
|
5
|
+
connect an agent, shape an index, search it, and control the underlying
|
|
6
|
+
interfaces.
|
|
7
|
+
|
|
8
|
+
> [!IMPORTANT]
|
|
9
|
+
> zvec-grep is a work in progress. Commands and configuration may change before
|
|
10
|
+
> the first stable release.
|
|
11
|
+
|
|
12
|
+
## Start here
|
|
13
|
+
|
|
14
|
+
| I want to… | Read |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Connect Codex, Claude Code, Cursor, or OpenCode | [Agent integrations](./01-agents.md) |
|
|
17
|
+
| Use zg directly from a terminal | [CLI guide](./02-cli.md) |
|
|
18
|
+
| Understand the tools exposed to an agent | [MCP guide](./03-mcp.md) |
|
|
19
|
+
| Understand indexing, updates, and search routes | [Retrieval pipeline](./04-pipeline.md) |
|
|
20
|
+
| See how the components and trust boundaries fit together | [Architecture](./05-architecture.md) |
|
|
21
|
+
| Choose between Auto, Server, and Direct execution | [Server and execution modes](./06-server.md) |
|
|
22
|
+
| Choose and configure an Embedding model | [Embedding models](./07-embedding.md) |
|
|
23
|
+
| See what is stable now and what comes next | [Roadmap](./08-roadmap.md) |
|
|
24
|
+
|
|
25
|
+
## Recommended paths
|
|
26
|
+
|
|
27
|
+
If you primarily use an agent, start with [Agent integrations](./01-agents.md),
|
|
28
|
+
then read the [MCP guide](./03-mcp.md) and
|
|
29
|
+
[Retrieval pipeline](./04-pipeline.md). The [Server guide](./06-server.md)
|
|
30
|
+
explains the daemon that connects them.
|
|
31
|
+
|
|
32
|
+
If you primarily use the terminal, start with the [CLI guide](./02-cli.md), then
|
|
33
|
+
read the [Retrieval pipeline](./04-pipeline.md). Use the
|
|
34
|
+
[Embedding guide](./07-embedding.md) when creating a new index. The default
|
|
35
|
+
`auto` execution mode is explained in
|
|
36
|
+
[Server and execution modes](./06-server.md).
|
|
37
|
+
|
|
38
|
+
For the whole-system mental model and trust boundaries, read
|
|
39
|
+
[Architecture](./05-architecture.md).
|
|
40
|
+
|
|
41
|
+
The [Roadmap](./08-roadmap.md) tracks the path from work in progress to a stable
|
|
42
|
+
release.
|
|
43
|
+
|
|
44
|
+
The CLI remains the source of truth for flags in the installed version:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
zg help
|
|
48
|
+
zg help query
|
|
49
|
+
zg help index
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
For development setup and pull request conventions, see
|
|
53
|
+
[CONTRIBUTING.md](../CONTRIBUTING.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zvec/zvec-grep",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Agent-friendly hybrid code search with indexed context and managed ripgrep.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"README.md",
|
|
32
32
|
"README_CN.md",
|
|
33
33
|
"LICENSE",
|
|
34
|
+
"docs",
|
|
34
35
|
"dist",
|
|
35
36
|
"skills/zvec-grep"
|
|
36
37
|
],
|
|
@@ -41,17 +42,21 @@
|
|
|
41
42
|
"lint": "eslint .",
|
|
42
43
|
"prepack": "npm run build",
|
|
43
44
|
"test:coverage": "npm run build && c8 --all --include=dist/**/*.js --check-coverage --lines=80 --statements=80 --functions=80 --branches=80 npm run test:all",
|
|
44
|
-
"test:all": "
|
|
45
|
-
"test:e2e": "npm run build &&
|
|
46
|
-
"test:integration": "npm run build &&
|
|
45
|
+
"test:all": "npm run test:run:root && npm run test:run:unit && npm run test:run:integration && npm run test:run:e2e",
|
|
46
|
+
"test:e2e": "npm run build && npm run test:run:e2e",
|
|
47
|
+
"test:integration": "npm run build && npm run test:run:root && npm run test:run:integration",
|
|
47
48
|
"test:package": "npm run build && node --test --test-concurrency=1 test/package/*.test.mjs",
|
|
48
|
-
"test:
|
|
49
|
+
"test:run:e2e": "node --test --test-concurrency=1 test/e2e/*.test.mjs",
|
|
50
|
+
"test:run:integration": "node --test --test-concurrency=1 test/integration/*.test.mjs",
|
|
51
|
+
"test:run:root": "node --test --test-concurrency=1 test/*.test.mjs",
|
|
52
|
+
"test:run:unit": "node --test --test-concurrency=1 test/unit/*.test.mjs test/unit/extraction/*.test.mjs test/unit/models/*.test.mjs",
|
|
53
|
+
"test:unit": "npm run build && npm run test:run:unit",
|
|
49
54
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
50
|
-
"workflow:check": "node scripts/check-workflows.mjs",
|
|
51
55
|
"test": "npm run build && npm run test:all"
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
58
|
"@eslint/js": "^10.0.1",
|
|
59
|
+
"@modelcontextprotocol/conformance": "0.1.16",
|
|
55
60
|
"@types/node": "^22.20.1",
|
|
56
61
|
"c8": "^11.0.0",
|
|
57
62
|
"eslint": "^10.7.0",
|
|
@@ -61,12 +66,16 @@
|
|
|
61
66
|
"typescript-eslint": "^8.64.0"
|
|
62
67
|
},
|
|
63
68
|
"dependencies": {
|
|
64
|
-
"@
|
|
69
|
+
"@huggingface/transformers": "^3.8.1",
|
|
70
|
+
"@modelcontextprotocol/client": "2.0.0",
|
|
71
|
+
"@modelcontextprotocol/core": "2.0.0",
|
|
72
|
+
"@modelcontextprotocol/node": "2.0.0",
|
|
73
|
+
"@modelcontextprotocol/server": "2.0.0",
|
|
65
74
|
"@vscode/ripgrep": "^1.18.0",
|
|
66
75
|
"@zvec/zvec": "^0.5.0",
|
|
67
76
|
"tree-sitter-wasms": "^0.1.13",
|
|
68
77
|
"web-tree-sitter": "^0.20.8",
|
|
69
|
-
"zod": "
|
|
78
|
+
"zod": "4.2.0"
|
|
70
79
|
},
|
|
71
80
|
"optionalDependencies": {
|
|
72
81
|
"node-llama-cpp": "3.18.1"
|
|
@@ -1,151 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zvec-grep
|
|
3
|
-
description:
|
|
3
|
+
description: Repository code search and indexing with zvec-grep. Use when exploring a codebase, locating symbols, references, or exact text, creating or inspecting a repository index, diagnosing the daemon, or whenever repository investigation would otherwise use grep, rg, or broad file reads.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# zvec-grep
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Select the transport
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Use zvec-grep indexed search for conceptual repository investigation. Use native
|
|
11
|
+
`grep` or `rg` for exact lexical searches unless the optional managed-rg MCP tool
|
|
12
|
+
is explicitly available.
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
zg status
|
|
14
|
-
```
|
|
14
|
+
Use the public native HTTP MCP search tools as the primary interface when the matching `zvec_grep_*` tool is present. Call them directly; do not run `zg`, probe the daemon through shell, or choose CLI for convenience.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Use CLI fallback only when one of these conditions is true:
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
- The task requires index lifecycle or daemon diagnostics, which are intentionally
|
|
19
|
+
kept out of the default agent MCP toolset.
|
|
20
|
+
- An available MCP search tool cannot perform the required operation.
|
|
21
|
+
- MCP initialization, authentication, connection, or the required search call has
|
|
22
|
+
failed.
|
|
23
|
+
- The repository has no index, the user has not authorized indexing, and an explicit no-index lexical search is needed.
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
Do not retry a submitted indexing write through another transport after a connection interruption.
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
zg index --embedding local/embeddinggemma-300m -g "src/**" -g "docs/**" -g "test/**" -g "!dist/**" -g "!node_modules/**"
|
|
24
|
-
zg index --rebuild --embedding local/embeddinggemma-300m -g "src/**" -g "!dist/**" -g "!node_modules/**" -t ts
|
|
25
|
-
```
|
|
27
|
+
## Use the MCP workflow
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
Pass the repository's daemon-visible absolute path as `root` on every repository call.
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
1. Use native `grep` or `rg` when an exact keyword, text, symbol, filename,
|
|
32
|
+
path, configuration key, error message, source fragment, literal, or regex
|
|
33
|
+
anchor is known and locating it is sufficient to answer the question.
|
|
34
|
+
2. Call `zvec_grep_search` when the answer requires conceptual discovery,
|
|
35
|
+
architecture, lifecycle, data or control flow, comparison, design rationale,
|
|
36
|
+
or performance analysis. Search defaults to `freshness: "eventual"`; use
|
|
37
|
+
`freshness: "wait_for_fresh"` only when the result must include all pending
|
|
38
|
+
changes. Use hybrid `queries` for concepts plus known lexical constraints,
|
|
39
|
+
`fts` for indexed lexical-only intent, and `vector` for semantic-only intent.
|
|
40
|
+
3. When exact symbols are present but the answer spans multiple components,
|
|
41
|
+
files, stages, or implementations, call `zvec_grep_search` first with the
|
|
42
|
+
concept and known symbols, then use native `grep` or `rg` for focused follow-up.
|
|
43
|
+
4. Read the indexed search response's `freshness` and `indexing` fields. Use
|
|
44
|
+
`possibly_stale` results immediately when they are sufficient; do not call
|
|
45
|
+
status merely because a background update is active.
|
|
46
|
+
5. Apply focused path and file-type filters early. Exclude dependencies,
|
|
47
|
+
generated output, caches, build artifacts, fixtures, and logs unless the
|
|
48
|
+
task concerns them.
|
|
32
49
|
|
|
33
|
-
|
|
50
|
+
The default public MCP endpoint intentionally exposes only indexed search. If the
|
|
51
|
+
index is missing, explain that indexed search requires an index and ask before
|
|
52
|
+
creating one. After authorization, use the CLI lifecycle workflow; never silently
|
|
53
|
+
create, rebuild, or drop an index. The optional full MCP toolset exposes
|
|
54
|
+
`zvec_grep_rg`; the CLI `zg query --rg` route remains available for explicit
|
|
55
|
+
managed-ripgrep fallback.
|
|
34
56
|
|
|
35
|
-
|
|
36
|
-
zg query "<query>"
|
|
37
|
-
```
|
|
57
|
+
Use multiple queries when comparing related concepts.
|
|
38
58
|
|
|
39
|
-
|
|
59
|
+
## Use CLI fallback
|
|
40
60
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
zg query "plugin loading lifecycle" -g "src/**" -g "!test/**" -g "!tests/**" -g "!**/*.test.*" -g "!**/*.spec.*"
|
|
45
|
-
zg query "query planning" -g "src/**" -g "packages/*/src/**" -g "!fixtures/**" -g "!node_modules/**" -t ts
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Indexed agent results use `--preview none` by default: essential metadata plus one representative source line when source is available. Human results use `--preview full` by default. Use `--preview short` for essential metadata plus a small deterministic source window, or `--preview full` after narrowing to a few results. `--preview` is for indexed/semantic results; with `--rg`, use ripgrep context flags such as `-A`, `-B`, or `-C` instead.
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
zg query "plugin loading" --limit 30 --preview none
|
|
52
|
-
zg query "plugin loading" --limit 10 --preview short
|
|
53
|
-
zg query "plugin loading" --limit 3 --preview full
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Use multiple quoted queries when you are exploring related ideas or comparing several names/concepts. Each query gets its own search group, and `--limit` applies per query/group:
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
zg query "request validation" "error handling"
|
|
60
|
-
zg query "authentication flow" "session refresh" "permission checks" --limit 5
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Use `--fuse` only when those groups should contribute to one combined ranking;
|
|
64
|
-
then `--limit` applies to the final fused list:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
zg query --hybrid "authentication flow" --fts "AuthService" --vector "credential validation" --fuse --limit 10
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Use `zg query --rg` only when you need exhaustive literal/regex search, exact verification, or ripgrep-specific flags. For exploratory code understanding, prefer indexed `zg query` search first:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
zg query --rg "SymbolName|LogMessage"
|
|
74
|
-
zg query --rg -F "ExactSymbolOrText" src
|
|
75
|
-
zg query --rg -i -C 2 -g "*.ts" -g "!dist/**" "needle text" src
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Do not call `grep` or `rg` directly for repository search. If exhaustive regex or literal matching is required, use `zg query --rg`; otherwise keep using indexed `zg query` search to avoid noisy, token-heavy match lists.
|
|
79
|
-
|
|
80
|
-
Check the local anonymous index explicitly only when starting a repository investigation or diagnosing index state. Build it only when the user asks for persistent indexed semantic search:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
zg status
|
|
84
|
-
zg index --embedding local/embeddinggemma-300m
|
|
85
|
-
zg index --rebuild --embedding local/embeddinggemma-300m
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
For a new index, always pass `--embedding <model>` or set `ZVEC_GREP_EMBEDDING`; `zg index` does not choose a model silently. For an existing index, rerunning `zg index` without `--embedding` reuses the collection's stored embedding schema. Use `--embedding <model>` when intentionally choosing or changing models. Local models use `local/model`, such as `local/embeddinggemma-300m` and `local/qwen3-embedding-0.6b`. Remote models use `provider/model`, such as `qwen/text-embedding-v4`.
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
zg index --embedding local/qwen3-embedding-0.6b
|
|
92
|
-
zg index --embedding qwen/text-embedding-v4 --api-key "$DASHSCOPE_API_KEY"
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Use explicit routes only when the intent is clear:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
zg query --fts "ExactSymbolOrToken"
|
|
99
|
-
zg query --vector "natural language description of the code you need"
|
|
100
|
-
zg query --fts "AuthService" --fts "validateRequest" --vector "where incoming requests are authorized"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Combine default hybrid queries with `--fts` when you want broad semantic/lexical recall plus exact anchors such as symbols, flags, error codes, or log text. Put the default hybrid queries first, then add one or more `--fts` terms:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
zg query "authentication flow" --fts "AuthService" -g "src/**" -t ts
|
|
107
|
-
zg query "cache invalidation" "stale data handling" --fts "CACHE_TTL" --fts "invalidateCache" --limit 5
|
|
108
|
-
zg query "request routing behavior" --fts "routeRequest" --fts "RouteOptions" -g "src/**" -t ts
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Use query filters to narrow noisy searches before reading results. Prefer adding `-g`/`--glob`, `--iglob`, `-t`/`--type`, and `-T`/`--type-not` to the first query when you already know the relevant area:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
zg query "error handling" -g "src/**" -g "!dist/**" -g "!node_modules/**"
|
|
115
|
-
zg query "database migration" -g "src/**" -g "!**/*.test.*"
|
|
116
|
-
zg query "recent API changes" --modified-after 2026-06-01 --modified-before 2026-06-25
|
|
117
|
-
zg query "create user" --symbol-type function --prefer-symbol
|
|
118
|
-
zg query "service lifecycle" "resource cleanup" --symbol-type class --symbol-type function --limit 5
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Filter notes:
|
|
122
|
-
|
|
123
|
-
- Quote glob filters so the shell does not expand them.
|
|
124
|
-
- `-g`/`--glob` accepts one glob and can be repeated. Prefix a glob with `!` to exclude it. Use `--iglob` for case-insensitive globs.
|
|
125
|
-
- `-t`/`--type` and `-T`/`--type-not` use ripgrep's file-type names and work in indexed and rg modes.
|
|
126
|
-
- Type filters further restrict the glob-selected files. For example, `-g "docs/**" -t ts` selects only TypeScript files under `docs`.
|
|
127
|
-
- Dependency, third-party, generated, build, cache, nested-git, `.gitignore`d, and over-1MB files are skipped during indexing by default. Hidden dot paths are skipped by default; use `--hidden` when explicitly needed. `.git/**` and `.zvec-grep/**` remain excluded.
|
|
128
|
-
- `--modified-after` and `--modified-before` accept epoch milliseconds, `YYYY-MM-DD`, or other parseable date strings.
|
|
129
|
-
- `--symbol-type` can be repeated; supported values are `module`, `class`, `interface`, `function`, `value`, and `alias`.
|
|
130
|
-
- `--prefer-symbol` is useful when a query names a symbol and you want exact indexed symbol hits ranked first.
|
|
131
|
-
- `--rg` is for exhaustive ripgrep search outside `.git/**` and `.zvec-grep/**`; do not combine it with indexed symbol options such as `--symbol-type` or `--prefer-symbol`. It uses rg regex syntax by default, so use `-F` for literal text and `-e` when a pattern begins with `-`. Managed rg supports common matching, pattern-file, context, glob, type, ignore, depth, size, symlink, encoding, multiline, and regex-engine flags. Zvec-grep owns the result format, so output-changing flags such as `--json`, `--count`, `--files`, `-l`, `-o`, `--replace`, and `--vimgrep` are rejected. In `--rg`, `--limit` is a global result limit while `-m`/`--max-count` retains rg's per-file meaning.
|
|
132
|
-
|
|
133
|
-
Combine multiple queries, explicit routes, and filters for focused context:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
zg query "authorization failure" "permission checks" \
|
|
137
|
-
--fts "ForbiddenError" --fts "hasPermission" \
|
|
138
|
-
-g "src/**" \
|
|
139
|
-
-g "!dist/**" \
|
|
140
|
-
-g "!**/*.test.*" \
|
|
141
|
-
--symbol-type function \
|
|
142
|
-
--limit 5
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Read output as:
|
|
146
|
-
|
|
147
|
-
- `path:start-end` is the returned entity.
|
|
148
|
-
- `outline:` is generated structure or call summary.
|
|
149
|
-
- `matched:` is the matching excerpt range inside the entity or `--rg` context block.
|
|
150
|
-
- `source:` is original file text for indexed results. `--rg` results omit the `source:` label and print numbered matching lines directly under `path:start-end`.
|
|
151
|
-
- `--preview none` omits `outline:`, `matched:`, and `source:` blocks but keeps metadata and one representative numbered source line when source is available.
|
|
61
|
+
Read [references/cli-fallback.md](references/cli-fallback.md) only after a fallback condition above is satisfied. Leave CLI mode unset for status, fallback search, and authorized indexing commands so the default Auto mode can select Server or Direct; do not probe forced Server mode and then retry forced Direct mode. Keep the selected transport consistent for the investigation unless its availability changes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "zvec-grep"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use zvec-grep
|
|
3
|
+
short_description: "Repository search with explicit index lifecycle"
|
|
4
|
+
default_prompt: "Use $zvec-grep to investigate this repository before raw grep or rg. Prefer the public MCP search tools, and use the zg CLI only for authorized index lifecycle or daemon diagnostics."
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# CLI fallback
|
|
2
|
+
|
|
3
|
+
Use these commands only when the native MCP tools are unavailable or when an explicit no-index lexical search is required.
|
|
4
|
+
|
|
5
|
+
## Choose the route
|
|
6
|
+
|
|
7
|
+
Leave `--mode` unset for ordinary status and query commands. The default Auto mode uses the daemon when reachable and Direct mode otherwise:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
zg status
|
|
11
|
+
zg query "authentication flow" --fts "AuthService" -g "src/**" -g "!tests/**" -g "!dist/**"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Do not probe with `--mode server` and then retry with `--mode direct`. Use an explicit mode only when diagnosing routing or when the user requests one. Do not force Direct writes while a daemon lease is active.
|
|
15
|
+
|
|
16
|
+
## Check index state
|
|
17
|
+
|
|
18
|
+
Check status once per repository investigation and reuse it:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
zg status
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If the index is missing, do not build it automatically. Mention `zg index` and wait for the user to authorize persistent indexing.
|
|
25
|
+
|
|
26
|
+
## Search an existing index
|
|
27
|
+
|
|
28
|
+
Start with indexed hybrid search, then add exact or semantic routes as needed:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
zg query "request validation" "error handling" -g "src/**" -g "!tests/**" -g "!dist/**" --limit 10 --preview short
|
|
32
|
+
zg query "authentication flow" --fts "AuthService" --fts "ForbiddenError" -g "src/**"
|
|
33
|
+
zg query --vector "where incoming requests are authorized" -g "src/**"
|
|
34
|
+
zg query "changes that must be indexed before search" --refresh wait
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
When Auto selects Server, queries return the current index and refresh stale data in the background by default. Direct queries do not refresh by default. Add `--refresh wait` when the query must wait for pending index changes, or `--refresh off` to disable refresh explicitly. Use `--preview none` for broad candidate scans, `--preview short` for a small deterministic window, and `--preview full` only after narrowing.
|
|
38
|
+
|
|
39
|
+
## Recover from a Direct model failure
|
|
40
|
+
|
|
41
|
+
Direct mode already attempts CPU fallback when local GPU initialization fails. Do not repeat the query with an explicit CPU override.
|
|
42
|
+
|
|
43
|
+
If the local model or embedding context remains unavailable and exact anchors are available, remove positional hybrid and vector queries and search those anchors through the existing indexed FTS route. Indexed FTS does not require an embedding model:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
zg query --fts "AuthService" --fts "ForbiddenError" -g "src/**" --limit 20 --preview short
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Do not switch to managed ripgrep merely because semantic search is unavailable. Use it only when the task requires exhaustive literal or regex matching, or when no index exists and the user has not authorized creating one.
|
|
50
|
+
|
|
51
|
+
## Search exhaustively with managed ripgrep
|
|
52
|
+
|
|
53
|
+
Use managed ripgrep only for exhaustive literal or regex matching; it does not require an index:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
zg query --rg "SymbolName|LogMessage"
|
|
57
|
+
zg query --rg -F "ExactSymbolOrText" src
|
|
58
|
+
zg query --rg -i -C 2 -g "*.ts" -g "!dist/**" "needle text" src
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Managed ripgrep always runs locally. It remains available while the daemon is running or an index writer is active; do not stop the daemon or switch client mode before using it.
|
|
62
|
+
|
|
63
|
+
Use `-e` or `--regexp` when the pattern begins with `-`. Common ripgrep flags include `-n`, `-H`, `-F`, `-i`, `-w`, `-A`, `-B`, `-C`, `-g`, `--hidden`, `--type`, `--type-not`, `--no-ignore`, `--smart-case`, and `--pcre2`.
|
|
64
|
+
|
|
65
|
+
## Index only with authorization
|
|
66
|
+
|
|
67
|
+
When a server default model is known, let Auto submit the index without repeating the model:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
zg index
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Otherwise, use the embedding model selected by the user:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
zg index --embedding local/embeddinggemma-300m
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Use focused path filters for a new index:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
zg index --embedding local/embeddinggemma-300m -g "src/**" -g "docs/**" -g "test/**" -g "!dist/**" -g "!node_modules/**" -g "!coverage/**"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Rebuild only when an incompatible embedding schema or index version requires it. Existing indexes reuse their stored embedding schema unless the user intentionally changes it.
|
package/dist/cli/mcp.d.ts
DELETED