@zvec/zvec-grep 0.1.4 → 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 +86 -162
- package/README_CN.md +80 -162
- 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 +3 -0
- package/dist/cli/args.js +749 -201
- 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.d.ts +3 -1
- package/dist/cli/commands.js +529 -180
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/errors.js +7 -6
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/format/context.d.ts +1 -0
- package/dist/cli/format/context.js +270 -70
- package/dist/cli/format/context.js.map +1 -1
- package/dist/cli/format/debug.js +14 -16
- package/dist/cli/format/debug.js.map +1 -1
- package/dist/cli/format/highlight.js.map +1 -1
- package/dist/cli/format/progress.d.ts +4 -0
- package/dist/cli/format/progress.js +222 -44
- package/dist/cli/format/progress.js.map +1 -1
- package/dist/cli/format/range.js.map +1 -1
- package/dist/cli/format/status.d.ts +77 -6
- package/dist/cli/format/status.js +343 -114
- package/dist/cli/format/status.js.map +1 -1
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +368 -84
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.js +4 -4
- package/dist/cli/index.js.map +1 -1
- 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 +40 -13
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/version.js +3 -1
- package/dist/cli/version.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 +50 -0
- package/dist/engine/config.js +321 -0
- package/dist/engine/config.js.map +1 -0
- 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/adapter.js.map +1 -1
- package/dist/engine/extraction/code/extractor.d.ts +5 -11
- package/dist/engine/extraction/code/extractor.js +184 -109
- package/dist/engine/extraction/code/extractor.js.map +1 -1
- package/dist/engine/extraction/code/families/c-family.js +13 -7
- 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/js-ts.js +24 -18
- package/dist/engine/extraction/code/families/js-ts.js.map +1 -1
- package/dist/engine/extraction/code/families/metadata.d.ts +1 -1
- package/dist/engine/extraction/code/families/metadata.js +11 -8
- package/dist/engine/extraction/code/families/metadata.js.map +1 -1
- package/dist/engine/extraction/code/families/name-field.js +5 -5
- package/dist/engine/extraction/code/families/name-field.js.map +1 -1
- package/dist/engine/extraction/code/languages/c.js +1 -4
- package/dist/engine/extraction/code/languages/c.js.map +1 -1
- package/dist/engine/extraction/code/languages/cpp.js.map +1 -1
- package/dist/engine/extraction/code/languages/go.js +1 -3
- package/dist/engine/extraction/code/languages/go.js.map +1 -1
- package/dist/engine/extraction/code/languages/java.js.map +1 -1
- package/dist/engine/extraction/code/languages/javascript.js +1 -3
- package/dist/engine/extraction/code/languages/javascript.js.map +1 -1
- package/dist/engine/extraction/code/languages/python.js +5 -6
- package/dist/engine/extraction/code/languages/python.js.map +1 -1
- package/dist/engine/extraction/code/languages/rust.js +1 -5
- package/dist/engine/extraction/code/languages/rust.js.map +1 -1
- package/dist/engine/extraction/code/languages/typescript.js.map +1 -1
- package/dist/engine/extraction/code/tree-sitter/grammar.js.map +1 -0
- package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.js +2 -1
- 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/ids.js.map +1 -1
- 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 +37 -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} +165 -113
- 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} +168 -102
- 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 -41
- 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 +53 -29
- 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 +399 -147
- package/dist/engine/pipeline/indexing/index.js.map +1 -1
- package/dist/engine/pipeline/indexing/root-paths.js +16 -19
- 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 +318 -66
- 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 +76 -34
- 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/lexical.d.ts +14 -15
- package/dist/engine/service/lexical.js +78 -119
- package/dist/engine/service/lexical.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 +29 -25
- package/dist/engine/service/structure-enrichment.js.map +1 -1
- package/dist/engine/service/types.d.ts +61 -35
- 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 +878 -544
- 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 +110 -49
- package/dist/engine/storage/zvec.js.map +1 -1
- package/dist/engine/types.d.ts +29 -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.d.ts +10 -0
- package/dist/engine/utils/file-selection.js +157 -0
- package/dist/engine/utils/file-selection.js.map +1 -0
- package/dist/engine/utils/glob.d.ts +3 -0
- package/dist/engine/utils/glob.js +116 -18
- package/dist/engine/utils/glob.js.map +1 -1
- package/dist/engine/utils/hash.js.map +1 -1
- package/dist/engine/utils/json.d.ts +6 -2
- package/dist/engine/utils/json.js +50 -12
- package/dist/engine/utils/json.js.map +1 -1
- package/dist/engine/utils/lock.js +7 -7
- package/dist/engine/utils/lock.js.map +1 -1
- package/dist/engine/utils/path.js +2 -2
- package/dist/engine/utils/path.js.map +1 -1
- package/dist/engine/utils/timing.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 +6 -6
- package/dist/index.js +3 -3
- 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 +43 -7
- package/skills/zvec-grep/SKILL.md +43 -123
- package/skills/zvec-grep/agents/openai.yaml +2 -2
- package/skills/zvec-grep/references/cli-fallback.md +85 -0
- 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}/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
package/README.md
CHANGED
|
@@ -3,220 +3,144 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
|
+
<p>
|
|
7
|
+
<a href="./docs/08-roadmap.md"><img src="https://img.shields.io/badge/status-work%20in%20progress-F59E0B?style=for-the-badge" alt="Work in progress" /></a>
|
|
8
|
+
</p>
|
|
6
9
|
<picture>
|
|
7
|
-
<source media="(prefers-color-scheme: dark)" srcset="
|
|
8
|
-
<img src="
|
|
10
|
+
<source media="(prefers-color-scheme: dark)" srcset="./.github/assets/zg-logo-dark.svg">
|
|
11
|
+
<img src="./.github/assets/zg-logo.svg" width="150" alt="zg logo" />
|
|
9
12
|
</picture>
|
|
13
|
+
<p><strong>Know the words—or don’t. Just zg.</strong></p>
|
|
14
|
+
<p>The local-first search layer for humans and agents.</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<a href="https://www.npmjs.com/package/@zvec/zvec-grep"><img src="https://img.shields.io/npm/v/@zvec/zvec-grep.svg" alt="npm version" /></a>
|
|
18
|
+
<a href="https://github.com/zvec-ai/zvec-grep/actions/workflows/ci.yml"><img src="https://github.com/zvec-ai/zvec-grep/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
19
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0 license" /></a>
|
|
20
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22-blue.svg" alt="Node.js 22 or newer" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
<a href="#tour">🎬 <strong>Tour</strong></a> |
|
|
25
|
+
<a href="#features">💫 <strong>Features</strong></a> |
|
|
26
|
+
<a href="#quickstart">🚀 <strong>Quickstart</strong></a> |
|
|
27
|
+
<a href="./docs/README.md">📚 <strong>Docs</strong></a> |
|
|
28
|
+
<a href="#benchmarks">📊 <strong>Benchmarks</strong></a> |
|
|
29
|
+
<a href="#community">🤝 <strong>Community</strong></a>
|
|
30
|
+
</p>
|
|
10
31
|
</div>
|
|
11
32
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<img src="https://img.shields.io/badge/node-%3E%3D20-blue.svg" alt="Node.js >=20"/>
|
|
16
|
-
<img src="https://img.shields.io/badge/CLI-zg-2ea44f.svg" alt="zg CLI"/>
|
|
17
|
-
</p>
|
|
18
|
-
|
|
19
|
-
<p align="center">
|
|
20
|
-
<a href="#quickstart">🚀 <strong>Quickstart</strong></a> |
|
|
21
|
-
<a href="#features">💫 <strong>Features</strong></a> |
|
|
22
|
-
<a href="#installation">📦 <strong>Installation</strong></a> |
|
|
23
|
-
<a href="#models">🧠 <strong>Models</strong></a> |
|
|
24
|
-
<a href="#library-api">🛠️ <strong>Library API</strong></a>
|
|
25
|
-
</p>
|
|
26
|
-
|
|
27
|
-
**zvec-grep** is an agent-friendly hybrid code search tool built on Zvec. It gives repositories a root-local semantic index, combines vector search with full-text search, and keeps CLI output compact enough for AI agents while still offering rich terminal output for humans.
|
|
28
|
-
|
|
29
|
-
The command is intentionally short:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
zg "where query auto update happens"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
> [!IMPORTANT]
|
|
36
|
-
> **v0.1.3**
|
|
37
|
-
>
|
|
38
|
-
> - **Hybrid Code Search**: Query code with natural language, exact terms, or both in one command.
|
|
39
|
-
> - **Explicit Index Lifecycle**: New repositories require `zg --index --embedding <model>`; agents do not silently create indexes.
|
|
40
|
-
> - **Automatic Refresh**: Existing anonymous indexes are checked and incrementally updated before normal queries.
|
|
41
|
-
> - **Token-Efficient Output**: Agent output defaults to `--preview none`; `--human` defaults to full source previews.
|
|
42
|
-
> - **No-Index Lexical Search**: `zg --rg` provides managed ripgrep search without requiring an index.
|
|
43
|
-
|
|
44
|
-
## <a id="features"></a>💫 Features
|
|
45
|
-
|
|
46
|
-
- **Semantic + Lexical Retrieval**: Blend vector search and full-text search for code, docs, tests, scripts, and configuration.
|
|
47
|
-
- **Root-Local Indexes**: Anonymous indexes live under `<repo>/.zvec-grep/`, so repository state stays with the repository.
|
|
48
|
-
- **Agent-Ready Output**: Default output is grouped by file and keeps previews small to save tokens.
|
|
49
|
-
- **Human Output Mode**: Add `--human` for a terminal-friendly summary with full previews by default.
|
|
50
|
-
- **Managed ripgrep Route**: `zg --rg` supports common `rg` flags and works even before a repository is indexed.
|
|
51
|
-
- **Explicit Model Choice**: The first index build requires a model such as `local/embeddinggemma-300m`, `local/qwen3-embedding-0.6b`, or `qwen/text-embedding-v4`.
|
|
52
|
-
- **Schema Reuse**: Re-running `zg --index` on an existing index reuses the stored embedding schema unless you explicitly change it.
|
|
53
|
-
- **Library API**: Use `createZvecGrep()` directly from Node.js tools, agents, or MCP servers.
|
|
54
|
-
|
|
55
|
-
## <a id="installation"></a>📦 Installation
|
|
56
|
-
|
|
57
|
-
Install the CLI from npm:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npm install -g @zvec/zvec-grep
|
|
61
|
-
zg --version
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Or run it without a global install:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
npx @zvec/zvec-grep --help
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### ✅ Requirements
|
|
71
|
-
|
|
72
|
-
- Node.js 20 or newer
|
|
73
|
-
- macOS, Linux, or Windows
|
|
74
|
-
- A supported embedding model for indexed search
|
|
75
|
-
|
|
76
|
-
`zg --rg` works without any embedding model or index.
|
|
77
|
-
|
|
78
|
-
## <a id="quickstart"></a>⚡ Quickstart
|
|
79
|
-
|
|
80
|
-
Index a repository with an explicit embedding model:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
zg --index \
|
|
84
|
-
--embedding local/embeddinggemma-300m \
|
|
85
|
-
--include "src/**" \
|
|
86
|
-
--include "docs/**" \
|
|
87
|
-
--include "test/**" \
|
|
88
|
-
--exclude "dist/**,node_modules/**,coverage/**"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Check index state:
|
|
33
|
+
**zg** (**z**vec-**g**rep) unifies ripgrep, BM25, and vector search behind
|
|
34
|
+
[one local-first interface](./docs/05-architecture.md). Use it directly from the
|
|
35
|
+
terminal, or let your agent use it for you.
|
|
92
36
|
|
|
93
|
-
|
|
94
|
-
zg --status
|
|
95
|
-
```
|
|
37
|
+
<a id="tour"></a>
|
|
96
38
|
|
|
97
|
-
|
|
39
|
+
## 🎬 See it in action
|
|
98
40
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
41
|
+
<div align="center">
|
|
42
|
+
<img src="./.github/assets/zvec-grep-tour.gif" width="1000" alt="Install the agent integration, index a repository, and let the agent search it with zvec-grep" />
|
|
43
|
+
</div>
|
|
102
44
|
|
|
103
|
-
|
|
45
|
+
Install the integration once, index the workspace, then search from the terminal
|
|
46
|
+
or ask your agent naturally.
|
|
104
47
|
|
|
105
|
-
|
|
106
|
-
zg "GPU fallback" --fts "usingCpuFallback" --include "src/**" --limit 5
|
|
107
|
-
```
|
|
48
|
+
<a id="features"></a>
|
|
108
49
|
|
|
109
|
-
|
|
50
|
+
## 💫 Why zg?
|
|
110
51
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
52
|
+
- **Works out of the box** — one guided install connects zg to your agent on
|
|
53
|
+
macOS, Linux, or Windows; ask naturally, with no search syntax to learn.
|
|
54
|
+
- **All-in-one retrieval layer** — semantic discovery, BM25-ranked retrieval,
|
|
55
|
+
exact text, and regex search all stay behind zg.
|
|
56
|
+
- **Agent- and human-friendly** — compact, file-oriented context for agents
|
|
57
|
+
and readable terminal output for people, with less noise for both.
|
|
58
|
+
- **Local first, permission aware** — ripgrep, indexes, and local models stay
|
|
59
|
+
on your machine; remote embeddings require explicit authorization.
|
|
114
60
|
|
|
115
|
-
|
|
61
|
+
<a id="quickstart"></a>
|
|
116
62
|
|
|
117
|
-
|
|
118
|
-
zg --human "root local index discovery" --limit 3
|
|
119
|
-
```
|
|
63
|
+
## 🚀 Quickstart
|
|
120
64
|
|
|
121
|
-
|
|
65
|
+
Requires Node.js 22 or newer on macOS, Linux, or Windows.
|
|
122
66
|
|
|
123
|
-
|
|
67
|
+
### 1. Install and connect your agent
|
|
124
68
|
|
|
125
69
|
```bash
|
|
126
|
-
|
|
127
|
-
zg
|
|
70
|
+
npm install -g @zvec/zvec-grep
|
|
71
|
+
zg install
|
|
128
72
|
```
|
|
129
73
|
|
|
130
|
-
|
|
74
|
+
`zg install` detects Codex, Claude Code, Cursor, and OpenCode and configures the
|
|
75
|
+
local MCP integration. See [Agent integrations](./docs/01-agents.md) for managed
|
|
76
|
+
configuration, permissions, and uninstall instructions. You can also select one
|
|
77
|
+
explicitly:
|
|
131
78
|
|
|
132
79
|
```bash
|
|
133
|
-
zg --
|
|
134
|
-
--embedding qwen/text-embedding-v4 \
|
|
135
|
-
--api-key "$DASHSCOPE_API_KEY"
|
|
80
|
+
zg install --target codex --yes
|
|
136
81
|
```
|
|
137
82
|
|
|
138
|
-
|
|
83
|
+
### 2. Index your repository
|
|
139
84
|
|
|
140
85
|
```bash
|
|
141
|
-
|
|
86
|
+
cd your-repository
|
|
87
|
+
zg index --embedding local/potion-code-16m-v2
|
|
142
88
|
```
|
|
143
89
|
|
|
144
|
-
|
|
90
|
+
This quickstart uses the lightweight
|
|
91
|
+
[Potion Code v2](./docs/07-embedding.md) model so you can build the first index
|
|
92
|
+
quickly. The first run downloads it; the index stays in `.zvec-grep/`, and later
|
|
93
|
+
updates only need `zg index`. See the
|
|
94
|
+
[retrieval pipeline](./docs/04-pipeline.md#indexing) to control scope, updates, and
|
|
95
|
+
rebuilds.
|
|
145
96
|
|
|
146
|
-
|
|
97
|
+
### 3. Ask your agent
|
|
147
98
|
|
|
148
|
-
```
|
|
149
|
-
|
|
99
|
+
```text
|
|
100
|
+
My app forgets dark mode every time I refresh. Find out why.
|
|
150
101
|
```
|
|
151
102
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
--include "src/**" \
|
|
157
|
-
--exclude "test/**,tests/**,fixtures/**,dist/**"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Use `--preview` to control indexed source previews:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
zg "plugin lifecycle" --preview none
|
|
164
|
-
zg "plugin lifecycle" --preview short --limit 5
|
|
165
|
-
zg "plugin lifecycle" --preview full --limit 2
|
|
166
|
-
```
|
|
103
|
+
The agent uses zg for semantic discovery and ranked keyword retrieval, while
|
|
104
|
+
exact lexical lookup stays with native grep or rg. The
|
|
105
|
+
[MCP guide](./docs/03-mcp.md) describes the default search tool and the optional
|
|
106
|
+
full toolset, which retains managed rg.
|
|
167
107
|
|
|
168
|
-
|
|
108
|
+
To search directly from the terminal, use the same local layer. See the
|
|
109
|
+
[CLI guide](./docs/02-cli.md) for routes, filters, and output controls.
|
|
169
110
|
|
|
170
111
|
```bash
|
|
171
|
-
zg "
|
|
172
|
-
zg --rg -i -C 2 -g "*.ts" "needle text" src
|
|
112
|
+
zg query --human "theme preference persistence on startup" --limit 3
|
|
173
113
|
```
|
|
174
114
|
|
|
175
|
-
|
|
115
|
+
<a id="benchmarks"></a>
|
|
176
116
|
|
|
177
|
-
|
|
178
|
-
import { createZvecGrep } from "@zvec/zvec-grep";
|
|
117
|
+
## 📊 Benchmarks
|
|
179
118
|
|
|
180
|
-
|
|
181
|
-
root: process.cwd(),
|
|
182
|
-
});
|
|
119
|
+
> 🚧 **Work in progress.**
|
|
183
120
|
|
|
184
|
-
|
|
185
|
-
query: "ranking implementation",
|
|
186
|
-
limit: 5,
|
|
187
|
-
});
|
|
121
|
+
## 🗺️ Roadmap
|
|
188
122
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
123
|
+
zg is moving toward richer multimodal formats, stronger hybrid retrieval, a
|
|
124
|
+
more out-of-the-box experience, and support from desktop to mobile.
|
|
192
125
|
|
|
193
|
-
|
|
194
|
-
```
|
|
126
|
+
Explore the full [Roadmap](./docs/08-roadmap.md).
|
|
195
127
|
|
|
196
|
-
|
|
128
|
+
<a id="community"></a>
|
|
197
129
|
|
|
198
|
-
|
|
199
|
-
const result = await zvecGrep.context({
|
|
200
|
-
query: "ZVEC_GREP_HOME",
|
|
201
|
-
rg: true,
|
|
202
|
-
});
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## 🤝 Join the Zvec Community
|
|
130
|
+
## 🤝 Join Our Community
|
|
206
131
|
|
|
207
132
|
<div align="center">
|
|
208
133
|
|
|
209
134
|
| 💬 DingTalk | 📱 WeChat | 🎮 Discord | X (Twitter) |
|
|
210
135
|
| :---: | :---: | :---: | :---: |
|
|
211
|
-
| <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/dingding.png" width="150" alt="DingTalk QR Code"/> | <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/wechat.png?
|
|
136
|
+
| <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/dingding.png" width="150" alt="DingTalk QR Code"/> | <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/wechat.png?v1" width="150" alt="WeChat QR Code"/> | [](https://discord.gg/rKddFBBu9z) | [](<https://x.com/ZvecAI>) |
|
|
212
137
|
| Scan to join | Scan to join | Click to join | Click to follow |
|
|
213
138
|
|
|
214
139
|
</div>
|
|
215
140
|
|
|
216
141
|
## ❤️ Contributing
|
|
217
142
|
|
|
218
|
-
|
|
143
|
+
Community contributions are always welcome—bug fixes, features, and
|
|
144
|
+
documentation improvements all help make zvec-grep better.
|
|
219
145
|
|
|
220
|
-
|
|
221
|
-
npm test
|
|
222
|
-
```
|
|
146
|
+
Check out our [Contributing Guide](./CONTRIBUTING.md) to get started!
|
package/README_CN.md
CHANGED
|
@@ -3,220 +3,138 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
|
+
<p>
|
|
7
|
+
<a href="./docs/08-roadmap.md"><img src="https://img.shields.io/badge/status-work%20in%20progress-F59E0B?style=for-the-badge" alt="项目开发中" /></a>
|
|
8
|
+
</p>
|
|
6
9
|
<picture>
|
|
7
|
-
<source media="(prefers-color-scheme: dark)" srcset="
|
|
8
|
-
<img src="
|
|
10
|
+
<source media="(prefers-color-scheme: dark)" srcset="./.github/assets/zg-logo-dark.svg">
|
|
11
|
+
<img src="./.github/assets/zg-logo.svg" width="150" alt="zg logo" />
|
|
9
12
|
</picture>
|
|
13
|
+
<p><strong>Know the words—or don’t. Just zg.</strong></p>
|
|
14
|
+
<p>面向人与 Agent 的本地优先统一检索层。</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<a href="https://www.npmjs.com/package/@zvec/zvec-grep"><img src="https://img.shields.io/npm/v/@zvec/zvec-grep.svg" alt="npm 版本" /></a>
|
|
18
|
+
<a href="https://github.com/zvec-ai/zvec-grep/actions/workflows/ci.yml"><img src="https://github.com/zvec-ai/zvec-grep/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
19
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0 许可证" /></a>
|
|
20
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22-blue.svg" alt="Node.js 22 或更新版本" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
<a href="#tour">🎬 <strong>功能演示</strong></a> |
|
|
25
|
+
<a href="#features">💫 <strong>核心特性</strong></a> |
|
|
26
|
+
<a href="#quickstart">🚀 <strong>快速开始</strong></a> |
|
|
27
|
+
<a href="./docs/README.md">📚 <strong>文档</strong></a> |
|
|
28
|
+
<a href="#benchmarks">📊 <strong>性能测试</strong></a> |
|
|
29
|
+
<a href="#community">🤝 <strong>社区</strong></a>
|
|
30
|
+
</p>
|
|
10
31
|
</div>
|
|
11
32
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<img src="https://img.shields.io/badge/node-%3E%3D20-blue.svg" alt="Node.js >=20"/>
|
|
16
|
-
<img src="https://img.shields.io/badge/CLI-zg-2ea44f.svg" alt="zg CLI"/>
|
|
17
|
-
</p>
|
|
18
|
-
|
|
19
|
-
<p align="center">
|
|
20
|
-
<a href="#quickstart">🚀 <strong>快速开始</strong></a> |
|
|
21
|
-
<a href="#features">💫 <strong>核心特性</strong></a> |
|
|
22
|
-
<a href="#installation">📦 <strong>安装</strong></a> |
|
|
23
|
-
<a href="#models">🧠 <strong>模型</strong></a> |
|
|
24
|
-
<a href="#library-api">🛠️ <strong>库 API</strong></a>
|
|
25
|
-
</p>
|
|
26
|
-
|
|
27
|
-
**zvec-grep** 是基于 Zvec 构建的、面向 agent 的代码库混合检索工具。它为仓库维护本地语义索引,融合向量检索与全文检索,并默认输出节省 token 的结果;当人在终端里阅读时,也可以切换到更完整的展示模式。
|
|
28
|
-
|
|
29
|
-
命令非常短:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
zg "where query auto update happens"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
> [!IMPORTANT]
|
|
36
|
-
> **v0.1.3**
|
|
37
|
-
>
|
|
38
|
-
> - **混合代码检索**:可以用自然语言、精确关键词,或两者组合来搜索代码。
|
|
39
|
-
> - **明确的索引生命周期**:新仓库必须显式运行 `zg --index --embedding <model>`;agent 不会静默创建索引。
|
|
40
|
-
> - **自动刷新**:已有匿名索引会在普通查询前自动检查并增量更新。
|
|
41
|
-
> - **节省 Token 的输出**:agent 默认输出 `--preview none`;`--human` 默认展示完整源码 preview。
|
|
42
|
-
> - **无索引文本搜索**:`zg --rg` 提供托管的 ripgrep 搜索,不需要先建索引。
|
|
43
|
-
|
|
44
|
-
## <a id="features"></a>💫 核心特性
|
|
45
|
-
|
|
46
|
-
- **语义 + 词法检索**:融合向量检索和全文检索,适合源码、文档、测试、脚本和配置。
|
|
47
|
-
- **仓库本地索引**:匿名索引存放在 `<repo>/.zvec-grep/`,索引状态跟随仓库。
|
|
48
|
-
- **Agent 友好输出**:默认按文件分组,并尽量减少源码 preview,降低上下文成本。
|
|
49
|
-
- **人类阅读模式**:加 `--human` 后更适合终端阅读,并默认展示完整 preview。
|
|
50
|
-
- **托管 ripgrep 通道**:`zg --rg` 支持常见 `rg` 参数,未建索引仓库也能使用。
|
|
51
|
-
- **显式模型选择**:第一次建索引必须指定模型,例如 `local/embeddinggemma-300m`、`local/qwen3-embedding-0.6b` 或 `qwen/text-embedding-v4`。
|
|
52
|
-
- **Schema 复用**:已有索引再次运行 `zg --index` 会复用保存的 embedding schema,除非你显式切换模型。
|
|
53
|
-
- **库 API**:Node.js 工具、agent 或 MCP server 可以直接使用 `createZvecGrep()`。
|
|
54
|
-
|
|
55
|
-
## <a id="installation"></a>📦 安装
|
|
56
|
-
|
|
57
|
-
从 npm 安装 CLI:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npm install -g @zvec/zvec-grep
|
|
61
|
-
zg --version
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
也可以不全局安装,直接运行:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
npx @zvec/zvec-grep --help
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### ✅ 运行要求
|
|
71
|
-
|
|
72
|
-
- Node.js 20 或更新版本
|
|
73
|
-
- macOS、Linux 或 Windows
|
|
74
|
-
- 使用索引检索时需要选择一个支持的 embedding 模型
|
|
75
|
-
|
|
76
|
-
`zg --rg` 不需要 embedding 模型,也不需要索引。
|
|
77
|
-
|
|
78
|
-
## <a id="quickstart"></a>⚡ 快速开始
|
|
79
|
-
|
|
80
|
-
为仓库建索引,并显式指定 embedding 模型:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
zg --index \
|
|
84
|
-
--embedding local/embeddinggemma-300m \
|
|
85
|
-
--include "src/**" \
|
|
86
|
-
--include "docs/**" \
|
|
87
|
-
--include "test/**" \
|
|
88
|
-
--exclude "dist/**,node_modules/**,coverage/**"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
查看索引状态:
|
|
33
|
+
**zg**(**z**vec-**g**rep)将 ripgrep、BM25 与向量检索统一在一个
|
|
34
|
+
[本地优先的检索入口](./docs/05-architecture.md)中。无论是人在终端中搜索,
|
|
35
|
+
还是让 Agent 自主检索,只用 zg 即可。
|
|
92
36
|
|
|
93
|
-
|
|
94
|
-
zg --status
|
|
95
|
-
```
|
|
37
|
+
<a id="tour"></a>
|
|
96
38
|
|
|
97
|
-
|
|
39
|
+
## 🎬 功能演示
|
|
98
40
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
41
|
+
<div align="center">
|
|
42
|
+
<img src="./.github/assets/zvec-grep-tour.gif" width="1000" alt="安装 Agent 集成、为仓库建索引并让 Agent 使用 zvec-grep 搜索代码" />
|
|
43
|
+
</div>
|
|
102
44
|
|
|
103
|
-
|
|
45
|
+
只需安装一次集成并为工作区建索引,之后既可以在终端中搜索,也可以直接向
|
|
46
|
+
Agent 提问。
|
|
104
47
|
|
|
105
|
-
|
|
106
|
-
zg "GPU fallback" --fts "usingCpuFallback" --include "src/**" --limit 5
|
|
107
|
-
```
|
|
48
|
+
<a id="features"></a>
|
|
108
49
|
|
|
109
|
-
|
|
50
|
+
## 💫 为什么选择 zg?
|
|
110
51
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
52
|
+
- **开箱即用,零学习成本**:一套引导式安装即可在 macOS、Linux 和 Windows
|
|
53
|
+
上接入 Agent;直接用自然语言提问,无需学习搜索语法。
|
|
54
|
+
- **一站式检索层**:语义发现、BM25 相关性检索、精确文本与正则搜索
|
|
55
|
+
都由 zg 统一提供。
|
|
56
|
+
- **对 Agent 和开发者都友好**:为 Agent 提供紧凑、围绕文件组织的上下文,
|
|
57
|
+
为开发者提供易读的终端输出,双方都能减少无关噪声。
|
|
58
|
+
- **本地优先、权限明确**:ripgrep、索引与本地模型均留在本机;远程 Embedding
|
|
59
|
+
需要显式授权。
|
|
114
60
|
|
|
115
|
-
|
|
61
|
+
<a id="quickstart"></a>
|
|
116
62
|
|
|
117
|
-
|
|
118
|
-
zg --human "root local index discovery" --limit 3
|
|
119
|
-
```
|
|
63
|
+
## 🚀 快速开始
|
|
120
64
|
|
|
121
|
-
|
|
65
|
+
需要 Node.js 22 或更新版本,支持 macOS、Linux 和 Windows。
|
|
122
66
|
|
|
123
|
-
|
|
67
|
+
### 1. 安装并连接 Agent
|
|
124
68
|
|
|
125
69
|
```bash
|
|
126
|
-
|
|
127
|
-
zg
|
|
70
|
+
npm install -g @zvec/zvec-grep
|
|
71
|
+
zg install
|
|
128
72
|
```
|
|
129
73
|
|
|
130
|
-
|
|
74
|
+
`zg install` 会检测 Codex、Claude Code、Cursor 和 OpenCode,并配置本地 MCP 集成。
|
|
75
|
+
查看 [Agent 集成指南](./docs/01-agents.md),了解配置变更、权限和卸载方式。
|
|
76
|
+
也可以明确指定目标:
|
|
131
77
|
|
|
132
78
|
```bash
|
|
133
|
-
zg --
|
|
134
|
-
--embedding qwen/text-embedding-v4 \
|
|
135
|
-
--api-key "$DASHSCOPE_API_KEY"
|
|
79
|
+
zg install --target codex --yes
|
|
136
80
|
```
|
|
137
81
|
|
|
138
|
-
|
|
82
|
+
### 2. 为仓库建索引
|
|
139
83
|
|
|
140
84
|
```bash
|
|
141
|
-
|
|
85
|
+
cd your-repository
|
|
86
|
+
zg index --embedding local/potion-code-16m-v2
|
|
142
87
|
```
|
|
143
88
|
|
|
144
|
-
|
|
89
|
+
快速开始使用轻量的 [Potion Code v2](./docs/07-embedding.md),以便快速完成首次建索引。
|
|
90
|
+
第一次运行会下载模型,索引保存在 `.zvec-grep/` 下;后续更新只需运行
|
|
91
|
+
`zg index`。查看 [检索 Pipeline](./docs/04-pipeline.md#indexing),进一步控制检索范围、
|
|
92
|
+
增量更新和重建。
|
|
145
93
|
|
|
146
|
-
|
|
94
|
+
### 3. 直接向 Agent 提问
|
|
147
95
|
|
|
148
|
-
```
|
|
149
|
-
|
|
96
|
+
```text
|
|
97
|
+
每次刷新页面,应用都会忘记深色模式。帮我找出原因。
|
|
150
98
|
```
|
|
151
99
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
zg "cache invalidation" \
|
|
156
|
-
--include "src/**" \
|
|
157
|
-
--exclude "test/**,tests/**,fixtures/**,dist/**"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
使用 `--preview` 控制索引结果的源码展示量:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
zg "plugin lifecycle" --preview none
|
|
164
|
-
zg "plugin lifecycle" --preview short --limit 5
|
|
165
|
-
zg "plugin lifecycle" --preview full --limit 2
|
|
166
|
-
```
|
|
100
|
+
Agent 会始终通过 zg 完成语义发现、关键词相关性检索与穷尽精确匹配。你无需
|
|
101
|
+
选择或调用其他搜索工具。[MCP 指南](./docs/03-mcp.md)介绍了 Agent 使用的两个工具。
|
|
167
102
|
|
|
168
|
-
|
|
103
|
+
也可以直接在终端中使用同一个本地检索层。查看 [CLI 指南](./docs/02-cli.md),了解
|
|
104
|
+
搜索方式、过滤条件和输出控制。
|
|
169
105
|
|
|
170
106
|
```bash
|
|
171
|
-
zg "
|
|
172
|
-
zg --rg -i -C 2 -g "*.ts" "needle text" src
|
|
107
|
+
zg query --human "theme preference persistence on startup" --limit 3
|
|
173
108
|
```
|
|
174
109
|
|
|
175
|
-
|
|
110
|
+
<a id="benchmarks"></a>
|
|
176
111
|
|
|
177
|
-
|
|
178
|
-
import { createZvecGrep } from "@zvec/zvec-grep";
|
|
112
|
+
## 📊 性能测试
|
|
179
113
|
|
|
180
|
-
|
|
181
|
-
root: process.cwd(),
|
|
182
|
-
});
|
|
114
|
+
> 🚧 **正在完善中。**
|
|
183
115
|
|
|
184
|
-
|
|
185
|
-
query: "ranking implementation",
|
|
186
|
-
limit: 5,
|
|
187
|
-
});
|
|
116
|
+
## 🗺️ Roadmap
|
|
188
117
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
118
|
+
zg 正在迈向更丰富的多模态格式、更强的混合检索、更开箱即用的体验,以及从
|
|
119
|
+
桌面端到移动端的全平台支持。
|
|
192
120
|
|
|
193
|
-
|
|
194
|
-
```
|
|
121
|
+
查看完整 [Roadmap](./docs/08-roadmap.md)。
|
|
195
122
|
|
|
196
|
-
|
|
123
|
+
<a id="community"></a>
|
|
197
124
|
|
|
198
|
-
|
|
199
|
-
const result = await zvecGrep.context({
|
|
200
|
-
query: "ZVEC_GREP_HOME",
|
|
201
|
-
rg: true,
|
|
202
|
-
});
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## 🤝 加入 Zvec 社区
|
|
125
|
+
## 🤝 加入社区
|
|
206
126
|
|
|
207
127
|
<div align="center">
|
|
208
128
|
|
|
209
129
|
| 💬 钉钉群 | 📱 微信群 | 🎮 Discord | X (Twitter) |
|
|
210
130
|
| :---: | :---: | :---: | :---: |
|
|
211
|
-
| <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/dingding.png" width="150" alt="钉钉二维码"/> | <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/wechat.png?
|
|
131
|
+
| <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/dingding.png" width="150" alt="钉钉二维码"/> | <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/wechat.png?v1" width="150" alt="微信二维码"/> | [](https://discord.gg/rKddFBBu9z) | [](<https://x.com/ZvecAI>) |
|
|
212
132
|
| 扫码加入 | 扫码加入 | 点击加入 | 点击关注 |
|
|
213
133
|
|
|
214
134
|
</div>
|
|
215
135
|
|
|
216
136
|
## ❤️ 参与贡献
|
|
217
137
|
|
|
218
|
-
|
|
138
|
+
始终欢迎社区贡献——缺陷修复、新功能和文档改进都会让 zvec-grep 变得更好。
|
|
219
139
|
|
|
220
|
-
|
|
221
|
-
npm test
|
|
222
|
-
```
|
|
140
|
+
请查阅我们的[贡献指南](./CONTRIBUTING.md)开始参与!
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { RemoteEmbeddingAuthorizationManager } from "./manager.js";
|
|
2
|
+
export { createRemoteEmbeddingOperationPermit, remoteEmbeddingAuthorizationGuard, withRemoteEmbeddingOperationPermit, } from "./operation.js";
|
|
3
|
+
export { RemoteEmbeddingAuthorizationStore } from "./store.js";
|
|
4
|
+
export { formatRemoteEmbeddingAuthorizationPrompt, remoteEmbeddingDisclosureData, type RemoteEmbeddingAuthorizationPromptInput, } from "./prompt.js";
|
|
5
|
+
export { indexStatusIsFresh, planRemoteIndexAuthorization, planRemoteSearchAuthorization, searchUsesVector, } from "./planner.js";
|
|
6
|
+
export { canonicalizeWorkspaceRoots, createRemoteEmbeddingTarget, remoteEmbeddingTargetFingerprint, workspaceFingerprint, } from "./target.js";
|
|
7
|
+
export type { RemoteEmbeddingAuthorizationPlan, RemoteEmbeddingAuthorizationScope, RemoteEmbeddingAuthorizationStatus, RemoteEmbeddingDataDisclosure, RemoteEmbeddingOperation, RemoteEmbeddingOperationPermit, RemoteEmbeddingTarget, RemoteEmbeddingWorkspaceGrant, } from "./types.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { RemoteEmbeddingAuthorizationManager } from "./manager.js";
|
|
2
|
+
export { createRemoteEmbeddingOperationPermit, remoteEmbeddingAuthorizationGuard, withRemoteEmbeddingOperationPermit, } from "./operation.js";
|
|
3
|
+
export { RemoteEmbeddingAuthorizationStore } from "./store.js";
|
|
4
|
+
export { formatRemoteEmbeddingAuthorizationPrompt, remoteEmbeddingDisclosureData, } from "./prompt.js";
|
|
5
|
+
export { indexStatusIsFresh, planRemoteIndexAuthorization, planRemoteSearchAuthorization, searchUsesVector, } from "./planner.js";
|
|
6
|
+
export { canonicalizeWorkspaceRoots, createRemoteEmbeddingTarget, remoteEmbeddingTargetFingerprint, workspaceFingerprint, } from "./target.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EACL,oCAAoC,EACpC,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EACL,wCAAwC,EACxC,6BAA6B,GAE9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RemoteEmbeddingAuthorizationStore } from "./store.js";
|
|
2
|
+
import type { RemoteEmbeddingAuthorizationPlan, RemoteEmbeddingAuthorizationScope, RemoteEmbeddingOperationPermit } from "./types.js";
|
|
3
|
+
export declare class RemoteEmbeddingAuthorizationManager {
|
|
4
|
+
readonly store: RemoteEmbeddingAuthorizationStore;
|
|
5
|
+
constructor(store?: RemoteEmbeddingAuthorizationStore);
|
|
6
|
+
existingWorkspacePermit(plan: RemoteEmbeddingAuthorizationPlan): Promise<RemoteEmbeddingOperationPermit | undefined>;
|
|
7
|
+
grant(plan: RemoteEmbeddingAuthorizationPlan, scope: RemoteEmbeddingAuthorizationScope): Promise<RemoteEmbeddingOperationPermit>;
|
|
8
|
+
}
|