@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.
Files changed (356) hide show
  1. package/README.md +86 -162
  2. package/README_CN.md +80 -162
  3. package/dist/authorization/index.d.ts +7 -0
  4. package/dist/authorization/index.js +7 -0
  5. package/dist/authorization/index.js.map +1 -0
  6. package/dist/authorization/manager.d.ts +8 -0
  7. package/dist/authorization/manager.js +19 -0
  8. package/dist/authorization/manager.js.map +1 -0
  9. package/dist/authorization/operation.d.ts +7 -0
  10. package/dist/authorization/operation.js +50 -0
  11. package/dist/authorization/operation.js.map +1 -0
  12. package/dist/authorization/planner.d.ts +21 -0
  13. package/dist/authorization/planner.js +97 -0
  14. package/dist/authorization/planner.js.map +1 -0
  15. package/dist/authorization/prompt.d.ts +11 -0
  16. package/dist/authorization/prompt.js +62 -0
  17. package/dist/authorization/prompt.js.map +1 -0
  18. package/dist/authorization/store.d.ts +20 -0
  19. package/dist/authorization/store.js +251 -0
  20. package/dist/authorization/store.js.map +1 -0
  21. package/dist/authorization/target.d.ts +15 -0
  22. package/dist/authorization/target.js +49 -0
  23. package/dist/authorization/target.js.map +1 -0
  24. package/dist/authorization/types.d.ts +61 -0
  25. package/dist/authorization/types.js +2 -0
  26. package/dist/authorization/types.js.map +1 -0
  27. package/dist/cli/args.d.ts +3 -0
  28. package/dist/cli/args.js +749 -201
  29. package/dist/cli/args.js.map +1 -1
  30. package/dist/cli/auth.d.ts +21 -0
  31. package/dist/cli/auth.js +212 -0
  32. package/dist/cli/auth.js.map +1 -0
  33. package/dist/cli/commands.d.ts +3 -1
  34. package/dist/cli/commands.js +529 -180
  35. package/dist/cli/commands.js.map +1 -1
  36. package/dist/cli/errors.js +7 -6
  37. package/dist/cli/errors.js.map +1 -1
  38. package/dist/cli/format/context.d.ts +1 -0
  39. package/dist/cli/format/context.js +270 -70
  40. package/dist/cli/format/context.js.map +1 -1
  41. package/dist/cli/format/debug.js +14 -16
  42. package/dist/cli/format/debug.js.map +1 -1
  43. package/dist/cli/format/highlight.js.map +1 -1
  44. package/dist/cli/format/progress.d.ts +4 -0
  45. package/dist/cli/format/progress.js +222 -44
  46. package/dist/cli/format/progress.js.map +1 -1
  47. package/dist/cli/format/range.js.map +1 -1
  48. package/dist/cli/format/status.d.ts +77 -6
  49. package/dist/cli/format/status.js +343 -114
  50. package/dist/cli/format/status.js.map +1 -1
  51. package/dist/cli/help.d.ts +1 -1
  52. package/dist/cli/help.js +368 -84
  53. package/dist/cli/help.js.map +1 -1
  54. package/dist/cli/index.js +4 -4
  55. package/dist/cli/index.js.map +1 -1
  56. package/dist/cli/install.d.ts +4 -0
  57. package/dist/cli/install.js +845 -0
  58. package/dist/cli/install.js.map +1 -0
  59. package/dist/cli/managed-rg.d.ts +10 -0
  60. package/dist/cli/managed-rg.js +329 -0
  61. package/dist/cli/managed-rg.js.map +1 -0
  62. package/dist/cli/types.d.ts +40 -13
  63. package/dist/cli/types.js.map +1 -1
  64. package/dist/cli/version.js +3 -1
  65. package/dist/cli/version.js.map +1 -1
  66. package/dist/client/daemon-client.d.ts +19 -0
  67. package/dist/client/daemon-client.js +180 -0
  68. package/dist/client/daemon-client.js.map +1 -0
  69. package/dist/client/mode-router.d.ts +9 -0
  70. package/dist/client/mode-router.js +28 -0
  71. package/dist/client/mode-router.js.map +1 -0
  72. package/dist/client/search-policy.d.ts +11 -0
  73. package/dist/client/search-policy.js +15 -0
  74. package/dist/client/search-policy.js.map +1 -0
  75. package/dist/daemon/backend.d.ts +76 -0
  76. package/dist/daemon/backend.js +1049 -0
  77. package/dist/daemon/backend.js.map +1 -0
  78. package/dist/daemon/change-set.d.ts +25 -0
  79. package/dist/daemon/change-set.js +101 -0
  80. package/dist/daemon/change-set.js.map +1 -0
  81. package/dist/daemon/config.d.ts +24 -0
  82. package/dist/daemon/config.js +88 -0
  83. package/dist/daemon/config.js.map +1 -0
  84. package/dist/daemon/errors.d.ts +5 -0
  85. package/dist/daemon/errors.js +11 -0
  86. package/dist/daemon/errors.js.map +1 -0
  87. package/dist/daemon/http-server.d.ts +30 -0
  88. package/dist/daemon/http-server.js +287 -0
  89. package/dist/daemon/http-server.js.map +1 -0
  90. package/dist/daemon/index-coordinator.d.ts +23 -0
  91. package/dist/daemon/index-coordinator.js +68 -0
  92. package/dist/daemon/index-coordinator.js.map +1 -0
  93. package/dist/daemon/job-scheduler.d.ts +70 -0
  94. package/dist/daemon/job-scheduler.js +366 -0
  95. package/dist/daemon/job-scheduler.js.map +1 -0
  96. package/dist/daemon/logger.d.ts +9 -0
  97. package/dist/daemon/logger.js +53 -0
  98. package/dist/daemon/logger.js.map +1 -0
  99. package/dist/daemon/model-pool.d.ts +45 -0
  100. package/dist/daemon/model-pool.js +187 -0
  101. package/dist/daemon/model-pool.js.map +1 -0
  102. package/dist/daemon/root-lease.d.ts +14 -0
  103. package/dist/daemon/root-lease.js +188 -0
  104. package/dist/daemon/root-lease.js.map +1 -0
  105. package/dist/daemon/root-runtime.d.ts +78 -0
  106. package/dist/daemon/root-runtime.js +333 -0
  107. package/dist/daemon/root-runtime.js.map +1 -0
  108. package/dist/daemon/runtime-manager.d.ts +45 -0
  109. package/dist/daemon/runtime-manager.js +243 -0
  110. package/dist/daemon/runtime-manager.js.map +1 -0
  111. package/dist/daemon/runtime.d.ts +12 -0
  112. package/dist/daemon/runtime.js +102 -0
  113. package/dist/daemon/runtime.js.map +1 -0
  114. package/dist/daemon/server-controller.d.ts +39 -0
  115. package/dist/daemon/server-controller.js +203 -0
  116. package/dist/daemon/server-controller.js.map +1 -0
  117. package/dist/daemon/watch-manager.d.ts +50 -0
  118. package/dist/daemon/watch-manager.js +293 -0
  119. package/dist/daemon/watch-manager.js.map +1 -0
  120. package/dist/daemon/workspace-read-session-cache.d.ts +31 -0
  121. package/dist/daemon/workspace-read-session-cache.js +115 -0
  122. package/dist/daemon/workspace-read-session-cache.js.map +1 -0
  123. package/dist/engine/config.d.ts +50 -0
  124. package/dist/engine/config.js +321 -0
  125. package/dist/engine/config.js.map +1 -0
  126. package/dist/engine/{errors/index.d.ts → errors.d.ts} +6 -1
  127. package/dist/engine/{errors/details.js → errors.js} +17 -4
  128. package/dist/engine/errors.js.map +1 -0
  129. package/dist/engine/extraction/code/adapter.d.ts +1 -1
  130. package/dist/engine/extraction/code/adapter.js.map +1 -1
  131. package/dist/engine/extraction/code/extractor.d.ts +5 -11
  132. package/dist/engine/extraction/code/extractor.js +184 -109
  133. package/dist/engine/extraction/code/extractor.js.map +1 -1
  134. package/dist/engine/extraction/code/families/c-family.js +13 -7
  135. package/dist/engine/extraction/code/families/c-family.js.map +1 -1
  136. package/dist/engine/extraction/code/families/js-ts.d.ts +1 -1
  137. package/dist/engine/extraction/code/families/js-ts.js +24 -18
  138. package/dist/engine/extraction/code/families/js-ts.js.map +1 -1
  139. package/dist/engine/extraction/code/families/metadata.d.ts +1 -1
  140. package/dist/engine/extraction/code/families/metadata.js +11 -8
  141. package/dist/engine/extraction/code/families/metadata.js.map +1 -1
  142. package/dist/engine/extraction/code/families/name-field.js +5 -5
  143. package/dist/engine/extraction/code/families/name-field.js.map +1 -1
  144. package/dist/engine/extraction/code/languages/c.js +1 -4
  145. package/dist/engine/extraction/code/languages/c.js.map +1 -1
  146. package/dist/engine/extraction/code/languages/cpp.js.map +1 -1
  147. package/dist/engine/extraction/code/languages/go.js +1 -3
  148. package/dist/engine/extraction/code/languages/go.js.map +1 -1
  149. package/dist/engine/extraction/code/languages/java.js.map +1 -1
  150. package/dist/engine/extraction/code/languages/javascript.js +1 -3
  151. package/dist/engine/extraction/code/languages/javascript.js.map +1 -1
  152. package/dist/engine/extraction/code/languages/python.js +5 -6
  153. package/dist/engine/extraction/code/languages/python.js.map +1 -1
  154. package/dist/engine/extraction/code/languages/rust.js +1 -5
  155. package/dist/engine/extraction/code/languages/rust.js.map +1 -1
  156. package/dist/engine/extraction/code/languages/typescript.js.map +1 -1
  157. package/dist/engine/extraction/code/tree-sitter/grammar.js.map +1 -0
  158. package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.js +2 -1
  159. package/dist/engine/extraction/code/tree-sitter/nodes.js.map +1 -0
  160. package/dist/engine/extraction/code/tree-sitter/parser.js.map +1 -0
  161. package/dist/engine/extraction/ids.js.map +1 -1
  162. package/dist/engine/extraction/image/extractor.d.ts +5 -0
  163. package/dist/engine/extraction/image/extractor.js +35 -0
  164. package/dist/engine/extraction/image/extractor.js.map +1 -0
  165. package/dist/engine/extraction/index.d.ts +3 -44
  166. package/dist/engine/extraction/index.js +1 -280
  167. package/dist/engine/extraction/index.js.map +1 -1
  168. package/dist/engine/extraction/markdown/extractor.d.ts +5 -11
  169. package/dist/engine/extraction/markdown/extractor.js +37 -16
  170. package/dist/engine/extraction/markdown/extractor.js.map +1 -1
  171. package/dist/engine/extraction/runtime.d.ts +4 -0
  172. package/dist/engine/extraction/runtime.js +26 -0
  173. package/dist/engine/extraction/runtime.js.map +1 -0
  174. package/dist/engine/extraction/source.d.ts +18 -0
  175. package/dist/engine/extraction/source.js +22 -0
  176. package/dist/engine/extraction/source.js.map +1 -0
  177. package/dist/engine/extraction/text/extractor.d.ts +7 -0
  178. package/dist/engine/extraction/text/extractor.js +168 -0
  179. package/dist/engine/extraction/text/extractor.js.map +1 -0
  180. package/dist/engine/extraction/types.d.ts +4 -0
  181. package/dist/engine/{models → extraction}/types.js.map +1 -1
  182. package/dist/engine/{files/file-type.d.ts → file-type.d.ts} +1 -1
  183. package/dist/engine/file-type.js.map +1 -0
  184. package/dist/engine/index-status.d.ts +9 -0
  185. package/dist/engine/index-status.js +38 -0
  186. package/dist/engine/index-status.js.map +1 -0
  187. package/dist/engine/manifest.d.ts +12 -0
  188. package/dist/engine/manifest.js +120 -0
  189. package/dist/engine/manifest.js.map +1 -0
  190. package/dist/engine/models/{providers/llama-cpp/embedding.d.ts → backends/llama-cpp.d.ts} +25 -20
  191. package/dist/engine/models/{providers/llama-cpp/embedding.js → backends/llama-cpp.js} +165 -113
  192. package/dist/engine/models/backends/llama-cpp.js.map +1 -0
  193. package/dist/engine/models/backends/model2vec.d.ts +57 -0
  194. package/dist/engine/models/backends/model2vec.js +332 -0
  195. package/dist/engine/models/backends/model2vec.js.map +1 -0
  196. package/dist/engine/models/backends/qwen.d.ts +44 -0
  197. package/dist/engine/models/{providers/qwen/embedding.js → backends/qwen.js} +168 -102
  198. package/dist/engine/models/backends/qwen.js.map +1 -0
  199. package/dist/engine/models/backends/transformers-js.d.ts +87 -0
  200. package/dist/engine/models/backends/transformers-js.js +316 -0
  201. package/dist/engine/models/backends/transformers-js.js.map +1 -0
  202. package/dist/engine/models/catalog.d.ts +188 -23
  203. package/dist/engine/models/catalog.js +172 -41
  204. package/dist/engine/models/catalog.js.map +1 -1
  205. package/dist/engine/models/download-progress.d.ts +15 -0
  206. package/dist/engine/models/download-progress.js +48 -0
  207. package/dist/engine/models/download-progress.js.map +1 -0
  208. package/dist/engine/models/embeddings.d.ts +58 -18
  209. package/dist/engine/models/embeddings.js +53 -29
  210. package/dist/engine/models/embeddings.js.map +1 -1
  211. package/dist/engine/models/factory.d.ts +2 -5
  212. package/dist/engine/models/factory.js +41 -56
  213. package/dist/engine/models/factory.js.map +1 -1
  214. package/dist/engine/models/index.d.ts +4 -6
  215. package/dist/engine/models/index.js +4 -4
  216. package/dist/engine/models/index.js.map +1 -1
  217. package/dist/engine/models/ranking.d.ts +7 -3
  218. package/dist/engine/models/resolution.d.ts +8 -0
  219. package/dist/engine/models/resolution.js +22 -0
  220. package/dist/engine/models/resolution.js.map +1 -0
  221. package/dist/engine/pipeline/indexing/index.d.ts +9 -7
  222. package/dist/engine/pipeline/indexing/index.js +399 -147
  223. package/dist/engine/pipeline/indexing/index.js.map +1 -1
  224. package/dist/engine/pipeline/indexing/root-paths.js +16 -19
  225. package/dist/engine/pipeline/indexing/root-paths.js.map +1 -1
  226. package/dist/engine/pipeline/indexing/scanner/index.d.ts +6 -1
  227. package/dist/engine/pipeline/indexing/scanner/index.js +318 -66
  228. package/dist/engine/pipeline/indexing/scanner/index.js.map +1 -1
  229. package/dist/engine/pipeline/search/index.d.ts +6 -6
  230. package/dist/engine/pipeline/search/index.js +76 -34
  231. package/dist/engine/pipeline/search/index.js.map +1 -1
  232. package/dist/engine/service/index.d.ts +3 -2
  233. package/dist/engine/service/index.js +1 -1
  234. package/dist/engine/service/index.js.map +1 -1
  235. package/dist/engine/service/lexical.d.ts +14 -15
  236. package/dist/engine/service/lexical.js +78 -119
  237. package/dist/engine/service/lexical.js.map +1 -1
  238. package/dist/engine/service/root.d.ts +13 -12
  239. package/dist/engine/service/root.js +35 -24
  240. package/dist/engine/service/root.js.map +1 -1
  241. package/dist/engine/service/structure-enrichment.js +29 -25
  242. package/dist/engine/service/structure-enrichment.js.map +1 -1
  243. package/dist/engine/service/types.d.ts +61 -35
  244. package/dist/engine/service/workspace-index.d.ts +24 -0
  245. package/dist/engine/service/workspace-index.js +151 -0
  246. package/dist/engine/service/workspace-index.js.map +1 -0
  247. package/dist/engine/service/zvec-grep.d.ts +12 -1
  248. package/dist/engine/service/zvec-grep.js +878 -544
  249. package/dist/engine/service/zvec-grep.js.map +1 -1
  250. package/dist/engine/storage/index.d.ts +8 -4
  251. package/dist/engine/storage/index.js +1 -1
  252. package/dist/engine/storage/index.js.map +1 -1
  253. package/dist/engine/storage/zvec.d.ts +10 -33
  254. package/dist/engine/storage/zvec.js +110 -49
  255. package/dist/engine/storage/zvec.js.map +1 -1
  256. package/dist/engine/types.d.ts +29 -23
  257. package/dist/engine/types.js +1 -1
  258. package/dist/engine/types.js.map +1 -1
  259. package/dist/engine/utils/daemon-lease.d.ts +17 -0
  260. package/dist/engine/utils/daemon-lease.js +175 -0
  261. package/dist/engine/utils/daemon-lease.js.map +1 -0
  262. package/dist/engine/utils/file-selection.d.ts +10 -0
  263. package/dist/engine/utils/file-selection.js +157 -0
  264. package/dist/engine/utils/file-selection.js.map +1 -0
  265. package/dist/engine/utils/glob.d.ts +3 -0
  266. package/dist/engine/utils/glob.js +116 -18
  267. package/dist/engine/utils/glob.js.map +1 -1
  268. package/dist/engine/utils/hash.js.map +1 -1
  269. package/dist/engine/utils/json.d.ts +6 -2
  270. package/dist/engine/utils/json.js +50 -12
  271. package/dist/engine/utils/json.js.map +1 -1
  272. package/dist/engine/utils/lock.js +7 -7
  273. package/dist/engine/utils/lock.js.map +1 -1
  274. package/dist/engine/utils/path.js +2 -2
  275. package/dist/engine/utils/path.js.map +1 -1
  276. package/dist/engine/utils/timing.js.map +1 -1
  277. package/dist/index-progress.d.ts +10 -0
  278. package/dist/index-progress.js +159 -0
  279. package/dist/index-progress.js.map +1 -0
  280. package/dist/index.d.ts +6 -6
  281. package/dist/index.js +3 -3
  282. package/dist/index.js.map +1 -1
  283. package/dist/mcp/http-transport.d.ts +27 -0
  284. package/dist/mcp/http-transport.js +182 -0
  285. package/dist/mcp/http-transport.js.map +1 -0
  286. package/dist/mcp/input-normalization.d.ts +38 -0
  287. package/dist/mcp/input-normalization.js +95 -0
  288. package/dist/mcp/input-normalization.js.map +1 -0
  289. package/dist/mcp/progress-heartbeat.d.ts +17 -0
  290. package/dist/mcp/progress-heartbeat.js +46 -0
  291. package/dist/mcp/progress-heartbeat.js.map +1 -0
  292. package/dist/mcp/request-metadata.d.ts +2 -0
  293. package/dist/mcp/request-metadata.js +11 -0
  294. package/dist/mcp/request-metadata.js.map +1 -0
  295. package/dist/mcp/request-state.d.ts +40 -0
  296. package/dist/mcp/request-state.js +210 -0
  297. package/dist/mcp/request-state.js.map +1 -0
  298. package/dist/mcp/result-format.d.ts +13 -0
  299. package/dist/mcp/result-format.js +75 -0
  300. package/dist/mcp/result-format.js.map +1 -0
  301. package/dist/mcp/schemas.d.ts +430 -0
  302. package/dist/mcp/schemas.js +447 -0
  303. package/dist/mcp/schemas.js.map +1 -0
  304. package/dist/mcp/tools.d.ts +150 -0
  305. package/dist/mcp/tools.js +448 -0
  306. package/dist/mcp/tools.js.map +1 -0
  307. package/dist/mcp/toolset.d.ts +5 -0
  308. package/dist/mcp/toolset.js +12 -0
  309. package/dist/mcp/toolset.js.map +1 -0
  310. package/dist/observability/trace-context.d.ts +11 -0
  311. package/dist/observability/trace-context.js +138 -0
  312. package/dist/observability/trace-context.js.map +1 -0
  313. package/docs/01-agents.md +111 -0
  314. package/docs/02-cli.md +229 -0
  315. package/docs/03-mcp.md +167 -0
  316. package/docs/04-pipeline.md +218 -0
  317. package/docs/05-architecture.md +86 -0
  318. package/docs/06-server.md +210 -0
  319. package/docs/07-embedding.md +179 -0
  320. package/docs/08-roadmap.md +85 -0
  321. package/docs/README.md +53 -0
  322. package/package.json +43 -7
  323. package/skills/zvec-grep/SKILL.md +43 -123
  324. package/skills/zvec-grep/agents/openai.yaml +2 -2
  325. package/skills/zvec-grep/references/cli-fallback.md +85 -0
  326. package/dist/engine/collection/index.d.ts +0 -55
  327. package/dist/engine/collection/index.js +0 -710
  328. package/dist/engine/collection/index.js.map +0 -1
  329. package/dist/engine/errors/details.d.ts +0 -6
  330. package/dist/engine/errors/details.js.map +0 -1
  331. package/dist/engine/errors/index.js +0 -16
  332. package/dist/engine/errors/index.js.map +0 -1
  333. package/dist/engine/extraction/tree-sitter/grammar.js.map +0 -1
  334. package/dist/engine/extraction/tree-sitter/nodes.js.map +0 -1
  335. package/dist/engine/extraction/tree-sitter/parser.js.map +0 -1
  336. package/dist/engine/files/file-type.js.map +0 -1
  337. package/dist/engine/models/providers/index.d.ts +0 -2
  338. package/dist/engine/models/providers/index.js +0 -3
  339. package/dist/engine/models/providers/index.js.map +0 -1
  340. package/dist/engine/models/providers/llama-cpp/embedding.js.map +0 -1
  341. package/dist/engine/models/providers/llama-cpp/index.d.ts +0 -1
  342. package/dist/engine/models/providers/llama-cpp/index.js +0 -2
  343. package/dist/engine/models/providers/llama-cpp/index.js.map +0 -1
  344. package/dist/engine/models/providers/qwen/embedding.d.ts +0 -42
  345. package/dist/engine/models/providers/qwen/embedding.js.map +0 -1
  346. package/dist/engine/models/providers/qwen/index.d.ts +0 -1
  347. package/dist/engine/models/providers/qwen/index.js +0 -2
  348. package/dist/engine/models/providers/qwen/index.js.map +0 -1
  349. package/dist/engine/models/types.d.ts +0 -30
  350. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.d.ts +0 -0
  351. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.js +0 -0
  352. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.d.ts +0 -0
  353. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.d.ts +0 -0
  354. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.js +0 -0
  355. /package/dist/engine/{models → extraction}/types.js +0 -0
  356. /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="https://zvec.oss-cn-hongkong.aliyuncs.com/logo/github_log_2.svg" />
8
- <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/logo/github_logo_1.svg" width="400" alt="zvec logo" />
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
- <p align="center">
13
- <a href="https://www.npmjs.com/package/@zvec/zvec-grep"><img src="https://img.shields.io/npm/v/@zvec/zvec-grep.svg" alt="npm Release"/></a>
14
- <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License"/></a>
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
- ```bash
94
- zg --status
95
- ```
37
+ <a id="tour"></a>
96
38
 
97
- Search with natural language:
39
+ ## 🎬 See it in action
98
40
 
99
- ```bash
100
- zg "where query auto update happens"
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
- Combine semantic intent with exact anchors:
45
+ Install the integration once, index the workspace, then search from the terminal
46
+ or ask your agent naturally.
104
47
 
105
- ```bash
106
- zg "GPU fallback" --fts "usingCpuFallback" --include "src/**" --limit 5
107
- ```
48
+ <a id="features"></a>
108
49
 
109
- Use exhaustive lexical search without an index:
50
+ ## 💫 Why zg?
110
51
 
111
- ```bash
112
- zg --rg -F "ZVEC_GREP_HOME" src
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
- Switch to human-readable output:
61
+ <a id="quickstart"></a>
116
62
 
117
- ```bash
118
- zg --human "root local index discovery" --limit 3
119
- ```
63
+ ## 🚀 Quickstart
120
64
 
121
- ## <a id="models"></a>🧠 Models
65
+ Requires Node.js 22 or newer on macOS, Linux, or Windows.
122
66
 
123
- Local models run through `node-llama-cpp` and keep code search private to your machine:
67
+ ### 1. Install and connect your agent
124
68
 
125
69
  ```bash
126
- zg --index --embedding local/embeddinggemma-300m
127
- zg --index --embedding local/qwen3-embedding-0.6b
70
+ npm install -g @zvec/zvec-grep
71
+ zg install
128
72
  ```
129
73
 
130
- Remote Qwen embeddings are useful when you prefer a managed embedding service or want to avoid local model setup:
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 --index \
134
- --embedding qwen/text-embedding-v4 \
135
- --api-key "$DASHSCOPE_API_KEY"
80
+ zg install --target codex --yes
136
81
  ```
137
82
 
138
- For existing indexes, `zg --index` without `--embedding` reuses the stored schema. Use `--rebuild --embedding <model>` only when you intentionally want to rebuild with a different model:
83
+ ### 2. Index your repository
139
84
 
140
85
  ```bash
141
- zg --index --rebuild --embedding local/qwen3-embedding-0.6b
86
+ cd your-repository
87
+ zg index --embedding local/potion-code-16m-v2
142
88
  ```
143
89
 
144
- ## 🔎 Query Patterns
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
- Multiple quoted queries are treated as separate search groups:
97
+ ### 3. Ask your agent
147
98
 
148
- ```bash
149
- zg "request validation" "error handling" --limit 5
99
+ ```text
100
+ My app forgets dark mode every time I refresh. Find out why.
150
101
  ```
151
102
 
152
- Use path filters early to keep results focused:
153
-
154
- ```bash
155
- zg "cache invalidation" \
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
- For exact text, symbols, flags, or error codes, use `--fts` or `--rg`:
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 "authentication flow" --fts "AuthService" "ForbiddenError"
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
- ## <a id="library-api"></a>🛠️ Library API
115
+ <a id="benchmarks"></a>
176
116
 
177
- ```ts
178
- import { createZvecGrep } from "@zvec/zvec-grep";
117
+ ## 📊 Benchmarks
179
118
 
180
- const zvecGrep = await createZvecGrep({
181
- root: process.cwd(),
182
- });
119
+ > 🚧 **Work in progress.**
183
120
 
184
- const result = await zvecGrep.context({
185
- query: "ranking implementation",
186
- limit: 5,
187
- });
121
+ ## 🗺️ Roadmap
188
122
 
189
- for (const item of result.items) {
190
- console.log(`${item.file.relativePath}:${item.range.startLine}`);
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
- await zvecGrep.close();
194
- ```
126
+ Explore the full [Roadmap](./docs/08-roadmap.md).
195
127
 
196
- For explicit no-index lexical search:
128
+ <a id="community"></a>
197
129
 
198
- ```ts
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?v=6" width="150" alt="WeChat QR Code"/> | [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rKddFBBu9z) | [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZvecAI)](<https://x.com/ZvecAI>) |
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"/> | [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rKddFBBu9z) | [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZvecAI)](<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
- Issues and pull requests are welcome. Please keep changes focused, add tests for behavior changes, and run:
143
+ Community contributions are always welcome—bug fixes, features, and
144
+ documentation improvements all help make zvec-grep better.
219
145
 
220
- ```bash
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="https://zvec.oss-cn-hongkong.aliyuncs.com/logo/github_log_2.svg" />
8
- <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/logo/github_logo_1.svg" width="400" alt="zvec logo" />
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
- <p align="center">
13
- <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>
14
- <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="许可证"/></a>
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
- ```bash
94
- zg --status
95
- ```
37
+ <a id="tour"></a>
96
38
 
97
- 用自然语言搜索:
39
+ ## 🎬 功能演示
98
40
 
99
- ```bash
100
- zg "where query auto update happens"
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
- ```bash
106
- zg "GPU fallback" --fts "usingCpuFallback" --include "src/**" --limit 5
107
- ```
48
+ <a id="features"></a>
108
49
 
109
- 不依赖索引,做穷尽文本搜索:
50
+ ## 💫 为什么选择 zg?
110
51
 
111
- ```bash
112
- zg --rg -F "ZVEC_GREP_HOME" src
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
- ```bash
118
- zg --human "root local index discovery" --limit 3
119
- ```
63
+ ## 🚀 快速开始
120
64
 
121
- ## <a id="models"></a>🧠 模型
65
+ 需要 Node.js 22 或更新版本,支持 macOS、Linux 和 Windows。
122
66
 
123
- 本地模型通过 `node-llama-cpp` 运行,适合把代码检索留在本机:
67
+ ### 1. 安装并连接 Agent
124
68
 
125
69
  ```bash
126
- zg --index --embedding local/embeddinggemma-300m
127
- zg --index --embedding local/qwen3-embedding-0.6b
70
+ npm install -g @zvec/zvec-grep
71
+ zg install
128
72
  ```
129
73
 
130
- 远程 Qwen embedding 适合希望使用托管 embedding 服务,或不想在本机配置模型的场景:
74
+ `zg install` 会检测 Codex、Claude Code、Cursor 和 OpenCode,并配置本地 MCP 集成。
75
+ 查看 [Agent 集成指南](./docs/01-agents.md),了解配置变更、权限和卸载方式。
76
+ 也可以明确指定目标:
131
77
 
132
78
  ```bash
133
- zg --index \
134
- --embedding qwen/text-embedding-v4 \
135
- --api-key "$DASHSCOPE_API_KEY"
79
+ zg install --target codex --yes
136
80
  ```
137
81
 
138
- 对于已有索引,`zg --index` 不传 `--embedding` 会复用索引里保存的 schema。只有在你明确想切换模型时,才使用 `--rebuild --embedding <model>`:
82
+ ### 2. 为仓库建索引
139
83
 
140
84
  ```bash
141
- zg --index --rebuild --embedding local/qwen3-embedding-0.6b
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
- 多个带引号的 query 会作为多个搜索组分别检索:
94
+ ### 3. 直接向 Agent 提问
147
95
 
148
- ```bash
149
- zg "request validation" "error handling" --limit 5
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
- 查精确文本、符号、配置项或错误码时,使用 `--fts` 或 `--rg`:
103
+ 也可以直接在终端中使用同一个本地检索层。查看 [CLI 指南](./docs/02-cli.md),了解
104
+ 搜索方式、过滤条件和输出控制。
169
105
 
170
106
  ```bash
171
- zg "authentication flow" --fts "AuthService" "ForbiddenError"
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
- ## <a id="library-api"></a>🛠️ 库 API
110
+ <a id="benchmarks"></a>
176
111
 
177
- ```ts
178
- import { createZvecGrep } from "@zvec/zvec-grep";
112
+ ## 📊 性能测试
179
113
 
180
- const zvecGrep = await createZvecGrep({
181
- root: process.cwd(),
182
- });
114
+ > 🚧 **正在完善中。**
183
115
 
184
- const result = await zvecGrep.context({
185
- query: "ranking implementation",
186
- limit: 5,
187
- });
116
+ ## 🗺️ Roadmap
188
117
 
189
- for (const item of result.items) {
190
- console.log(`${item.file.relativePath}:${item.range.startLine}`);
191
- }
118
+ zg 正在迈向更丰富的多模态格式、更强的混合检索、更开箱即用的体验,以及从
119
+ 桌面端到移动端的全平台支持。
192
120
 
193
- await zvecGrep.close();
194
- ```
121
+ 查看完整 [Roadmap](./docs/08-roadmap.md)。
195
122
 
196
- 显式进行无索引文本搜索:
123
+ <a id="community"></a>
197
124
 
198
- ```ts
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?v=6" width="150" alt="微信二维码"/> | [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rKddFBBu9z) | [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZvecAI)](<https://x.com/ZvecAI>) |
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="微信二维码"/> | [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rKddFBBu9z) | [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZvecAI)](<https://x.com/ZvecAI>) |
212
132
  | 扫码加入 | 扫码加入 | 点击加入 | 点击关注 |
213
133
 
214
134
  </div>
215
135
 
216
136
  ## ❤️ 参与贡献
217
137
 
218
- 欢迎提交 issue 和 pull request。请保持改动聚焦;如果改变行为,请补充测试,并运行:
138
+ 始终欢迎社区贡献——缺陷修复、新功能和文档改进都会让 zvec-grep 变得更好。
219
139
 
220
- ```bash
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
+ }