@zvec/zvec-grep 0.2.2 → 0.3.0-rc.2

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 (415) hide show
  1. package/README.md +87 -252
  2. package/bin/zg.exe +3 -0
  3. package/install.cjs +510 -0
  4. package/package.json +22 -72
  5. package/platforms.json +92 -0
  6. package/plugins.cjs +183 -0
  7. package/README_CN.md +0 -239
  8. package/dist/authorization/index.d.ts +0 -7
  9. package/dist/authorization/index.js +0 -7
  10. package/dist/authorization/index.js.map +0 -1
  11. package/dist/authorization/manager.d.ts +0 -8
  12. package/dist/authorization/manager.js +0 -19
  13. package/dist/authorization/manager.js.map +0 -1
  14. package/dist/authorization/operation.d.ts +0 -7
  15. package/dist/authorization/operation.js +0 -50
  16. package/dist/authorization/operation.js.map +0 -1
  17. package/dist/authorization/planner.d.ts +0 -21
  18. package/dist/authorization/planner.js +0 -97
  19. package/dist/authorization/planner.js.map +0 -1
  20. package/dist/authorization/prompt.d.ts +0 -12
  21. package/dist/authorization/prompt.js +0 -63
  22. package/dist/authorization/prompt.js.map +0 -1
  23. package/dist/authorization/store.d.ts +0 -20
  24. package/dist/authorization/store.js +0 -251
  25. package/dist/authorization/store.js.map +0 -1
  26. package/dist/authorization/target.d.ts +0 -15
  27. package/dist/authorization/target.js +0 -49
  28. package/dist/authorization/target.js.map +0 -1
  29. package/dist/authorization/types.d.ts +0 -61
  30. package/dist/authorization/types.js +0 -2
  31. package/dist/authorization/types.js.map +0 -1
  32. package/dist/cli/args.d.ts +0 -5
  33. package/dist/cli/args.js +0 -1210
  34. package/dist/cli/args.js.map +0 -1
  35. package/dist/cli/auth.d.ts +0 -21
  36. package/dist/cli/auth.js +0 -209
  37. package/dist/cli/auth.js.map +0 -1
  38. package/dist/cli/commands.d.ts +0 -4
  39. package/dist/cli/commands.js +0 -742
  40. package/dist/cli/commands.js.map +0 -1
  41. package/dist/cli/errors.d.ts +0 -9
  42. package/dist/cli/errors.js +0 -131
  43. package/dist/cli/errors.js.map +0 -1
  44. package/dist/cli/format/context.d.ts +0 -9
  45. package/dist/cli/format/context.js +0 -786
  46. package/dist/cli/format/context.js.map +0 -1
  47. package/dist/cli/format/debug.d.ts +0 -4
  48. package/dist/cli/format/debug.js +0 -60
  49. package/dist/cli/format/debug.js.map +0 -1
  50. package/dist/cli/format/highlight.d.ts +0 -3
  51. package/dist/cli/format/highlight.js +0 -106
  52. package/dist/cli/format/highlight.js.map +0 -1
  53. package/dist/cli/format/progress.d.ts +0 -13
  54. package/dist/cli/format/progress.js +0 -290
  55. package/dist/cli/format/progress.js.map +0 -1
  56. package/dist/cli/format/range.d.ts +0 -3
  57. package/dist/cli/format/range.js +0 -24
  58. package/dist/cli/format/range.js.map +0 -1
  59. package/dist/cli/format/status.d.ts +0 -83
  60. package/dist/cli/format/status.js +0 -530
  61. package/dist/cli/format/status.js.map +0 -1
  62. package/dist/cli/help.d.ts +0 -1
  63. package/dist/cli/help.js +0 -528
  64. package/dist/cli/help.js.map +0 -1
  65. package/dist/cli/index.d.ts +0 -2
  66. package/dist/cli/index.js +0 -34
  67. package/dist/cli/index.js.map +0 -1
  68. package/dist/cli/install.d.ts +0 -4
  69. package/dist/cli/install.js +0 -1661
  70. package/dist/cli/install.js.map +0 -1
  71. package/dist/cli/managed-rg.d.ts +0 -10
  72. package/dist/cli/managed-rg.js +0 -337
  73. package/dist/cli/managed-rg.js.map +0 -1
  74. package/dist/cli/server-search.d.ts +0 -3
  75. package/dist/cli/server-search.js +0 -12
  76. package/dist/cli/server-search.js.map +0 -1
  77. package/dist/cli/types.d.ts +0 -87
  78. package/dist/cli/types.js +0 -10
  79. package/dist/cli/types.js.map +0 -1
  80. package/dist/cli/version.d.ts +0 -1
  81. package/dist/cli/version.js +0 -13
  82. package/dist/cli/version.js.map +0 -1
  83. package/dist/client/daemon-client.d.ts +0 -31
  84. package/dist/client/daemon-client.js +0 -203
  85. package/dist/client/daemon-client.js.map +0 -1
  86. package/dist/client/mode-router.d.ts +0 -9
  87. package/dist/client/mode-router.js +0 -28
  88. package/dist/client/mode-router.js.map +0 -1
  89. package/dist/client/search-policy.d.ts +0 -11
  90. package/dist/client/search-policy.js +0 -15
  91. package/dist/client/search-policy.js.map +0 -1
  92. package/dist/daemon/backend.d.ts +0 -78
  93. package/dist/daemon/backend.js +0 -1089
  94. package/dist/daemon/backend.js.map +0 -1
  95. package/dist/daemon/change-set.d.ts +0 -30
  96. package/dist/daemon/change-set.js +0 -163
  97. package/dist/daemon/change-set.js.map +0 -1
  98. package/dist/daemon/config.d.ts +0 -27
  99. package/dist/daemon/config.js +0 -107
  100. package/dist/daemon/config.js.map +0 -1
  101. package/dist/daemon/errors.d.ts +0 -5
  102. package/dist/daemon/errors.js +0 -11
  103. package/dist/daemon/errors.js.map +0 -1
  104. package/dist/daemon/http-server.d.ts +0 -30
  105. package/dist/daemon/http-server.js +0 -288
  106. package/dist/daemon/http-server.js.map +0 -1
  107. package/dist/daemon/index-coordinator.d.ts +0 -22
  108. package/dist/daemon/index-coordinator.js +0 -55
  109. package/dist/daemon/index-coordinator.js.map +0 -1
  110. package/dist/daemon/job-scheduler.d.ts +0 -73
  111. package/dist/daemon/job-scheduler.js +0 -434
  112. package/dist/daemon/job-scheduler.js.map +0 -1
  113. package/dist/daemon/logger.d.ts +0 -9
  114. package/dist/daemon/logger.js +0 -53
  115. package/dist/daemon/logger.js.map +0 -1
  116. package/dist/daemon/model-pool.d.ts +0 -45
  117. package/dist/daemon/model-pool.js +0 -187
  118. package/dist/daemon/model-pool.js.map +0 -1
  119. package/dist/daemon/root-lease.d.ts +0 -14
  120. package/dist/daemon/root-lease.js +0 -197
  121. package/dist/daemon/root-lease.js.map +0 -1
  122. package/dist/daemon/root-runtime.d.ts +0 -80
  123. package/dist/daemon/root-runtime.js +0 -340
  124. package/dist/daemon/root-runtime.js.map +0 -1
  125. package/dist/daemon/runtime-manager.d.ts +0 -47
  126. package/dist/daemon/runtime-manager.js +0 -252
  127. package/dist/daemon/runtime-manager.js.map +0 -1
  128. package/dist/daemon/runtime.d.ts +0 -12
  129. package/dist/daemon/runtime.js +0 -104
  130. package/dist/daemon/runtime.js.map +0 -1
  131. package/dist/daemon/server-controller.d.ts +0 -38
  132. package/dist/daemon/server-controller.js +0 -327
  133. package/dist/daemon/server-controller.js.map +0 -1
  134. package/dist/daemon/watch-manager.d.ts +0 -55
  135. package/dist/daemon/watch-manager.js +0 -347
  136. package/dist/daemon/watch-manager.js.map +0 -1
  137. package/dist/daemon/workspace-read-session-cache.d.ts +0 -31
  138. package/dist/daemon/workspace-read-session-cache.js +0 -115
  139. package/dist/daemon/workspace-read-session-cache.js.map +0 -1
  140. package/dist/engine/code-formats.d.ts +0 -3
  141. package/dist/engine/code-formats.js +0 -14
  142. package/dist/engine/code-formats.js.map +0 -1
  143. package/dist/engine/config.d.ts +0 -50
  144. package/dist/engine/config.js +0 -321
  145. package/dist/engine/config.js.map +0 -1
  146. package/dist/engine/errors.d.ts +0 -20
  147. package/dist/engine/errors.js +0 -51
  148. package/dist/engine/errors.js.map +0 -1
  149. package/dist/engine/extraction/code/adapter.d.ts +0 -19
  150. package/dist/engine/extraction/code/adapter.js +0 -24
  151. package/dist/engine/extraction/code/adapter.js.map +0 -1
  152. package/dist/engine/extraction/code/extractor.d.ts +0 -13
  153. package/dist/engine/extraction/code/extractor.js +0 -696
  154. package/dist/engine/extraction/code/extractor.js.map +0 -1
  155. package/dist/engine/extraction/code/families/c-family.d.ts +0 -2
  156. package/dist/engine/extraction/code/families/c-family.js +0 -122
  157. package/dist/engine/extraction/code/families/c-family.js.map +0 -1
  158. package/dist/engine/extraction/code/families/js-ts.d.ts +0 -12
  159. package/dist/engine/extraction/code/families/js-ts.js +0 -118
  160. package/dist/engine/extraction/code/families/js-ts.js.map +0 -1
  161. package/dist/engine/extraction/code/families/metadata.d.ts +0 -8
  162. package/dist/engine/extraction/code/families/metadata.js +0 -86
  163. package/dist/engine/extraction/code/families/metadata.js.map +0 -1
  164. package/dist/engine/extraction/code/families/name-field.d.ts +0 -3
  165. package/dist/engine/extraction/code/families/name-field.js +0 -22
  166. package/dist/engine/extraction/code/families/name-field.js.map +0 -1
  167. package/dist/engine/extraction/code/languages/c.d.ts +0 -1
  168. package/dist/engine/extraction/code/languages/c.js +0 -12
  169. package/dist/engine/extraction/code/languages/c.js.map +0 -1
  170. package/dist/engine/extraction/code/languages/cpp.d.ts +0 -1
  171. package/dist/engine/extraction/code/languages/cpp.js +0 -18
  172. package/dist/engine/extraction/code/languages/cpp.js.map +0 -1
  173. package/dist/engine/extraction/code/languages/go.d.ts +0 -2
  174. package/dist/engine/extraction/code/languages/go.js +0 -70
  175. package/dist/engine/extraction/code/languages/go.js.map +0 -1
  176. package/dist/engine/extraction/code/languages/java.d.ts +0 -1
  177. package/dist/engine/extraction/code/languages/java.js +0 -17
  178. package/dist/engine/extraction/code/languages/java.js.map +0 -1
  179. package/dist/engine/extraction/code/languages/javascript.d.ts +0 -2
  180. package/dist/engine/extraction/code/languages/javascript.js +0 -23
  181. package/dist/engine/extraction/code/languages/javascript.js.map +0 -1
  182. package/dist/engine/extraction/code/languages/python.d.ts +0 -2
  183. package/dist/engine/extraction/code/languages/python.js +0 -52
  184. package/dist/engine/extraction/code/languages/python.js.map +0 -1
  185. package/dist/engine/extraction/code/languages/rust.d.ts +0 -2
  186. package/dist/engine/extraction/code/languages/rust.js +0 -25
  187. package/dist/engine/extraction/code/languages/rust.js.map +0 -1
  188. package/dist/engine/extraction/code/languages/typescript.d.ts +0 -2
  189. package/dist/engine/extraction/code/languages/typescript.js +0 -37
  190. package/dist/engine/extraction/code/languages/typescript.js.map +0 -1
  191. package/dist/engine/extraction/code/tree-sitter/grammar.d.ts +0 -4
  192. package/dist/engine/extraction/code/tree-sitter/grammar.js +0 -49
  193. package/dist/engine/extraction/code/tree-sitter/grammar.js.map +0 -1
  194. package/dist/engine/extraction/code/tree-sitter/nodes.d.ts +0 -3
  195. package/dist/engine/extraction/code/tree-sitter/nodes.js +0 -27
  196. package/dist/engine/extraction/code/tree-sitter/nodes.js.map +0 -1
  197. package/dist/engine/extraction/code/tree-sitter/parser.d.ts +0 -2
  198. package/dist/engine/extraction/code/tree-sitter/parser.js +0 -31
  199. package/dist/engine/extraction/code/tree-sitter/parser.js.map +0 -1
  200. package/dist/engine/extraction/ids.d.ts +0 -1
  201. package/dist/engine/extraction/ids.js +0 -5
  202. package/dist/engine/extraction/ids.js.map +0 -1
  203. package/dist/engine/extraction/image/extractor.d.ts +0 -5
  204. package/dist/engine/extraction/image/extractor.js +0 -35
  205. package/dist/engine/extraction/image/extractor.js.map +0 -1
  206. package/dist/engine/extraction/index.d.ts +0 -4
  207. package/dist/engine/extraction/index.js +0 -3
  208. package/dist/engine/extraction/index.js.map +0 -1
  209. package/dist/engine/extraction/markdown/extractor.d.ts +0 -7
  210. package/dist/engine/extraction/markdown/extractor.js +0 -362
  211. package/dist/engine/extraction/markdown/extractor.js.map +0 -1
  212. package/dist/engine/extraction/runtime.d.ts +0 -9
  213. package/dist/engine/extraction/runtime.js +0 -37
  214. package/dist/engine/extraction/runtime.js.map +0 -1
  215. package/dist/engine/extraction/source.d.ts +0 -18
  216. package/dist/engine/extraction/source.js +0 -22
  217. package/dist/engine/extraction/source.js.map +0 -1
  218. package/dist/engine/extraction/text/extractor.d.ts +0 -7
  219. package/dist/engine/extraction/text/extractor.js +0 -168
  220. package/dist/engine/extraction/text/extractor.js.map +0 -1
  221. package/dist/engine/extraction/types.d.ts +0 -4
  222. package/dist/engine/extraction/types.js +0 -2
  223. package/dist/engine/extraction/types.js.map +0 -1
  224. package/dist/engine/extraction/vector-content.d.ts +0 -5
  225. package/dist/engine/extraction/vector-content.js +0 -83
  226. package/dist/engine/extraction/vector-content.js.map +0 -1
  227. package/dist/engine/file-size-policy.d.ts +0 -6
  228. package/dist/engine/file-size-policy.js +0 -20
  229. package/dist/engine/file-size-policy.js.map +0 -1
  230. package/dist/engine/file-type.d.ts +0 -15
  231. package/dist/engine/file-type.js +0 -152
  232. package/dist/engine/file-type.js.map +0 -1
  233. package/dist/engine/index-status.d.ts +0 -9
  234. package/dist/engine/index-status.js +0 -38
  235. package/dist/engine/index-status.js.map +0 -1
  236. package/dist/engine/manifest.d.ts +0 -13
  237. package/dist/engine/manifest.js +0 -124
  238. package/dist/engine/manifest.js.map +0 -1
  239. package/dist/engine/models/artifact-cache-lock.d.ts +0 -16
  240. package/dist/engine/models/artifact-cache-lock.js +0 -228
  241. package/dist/engine/models/artifact-cache-lock.js.map +0 -1
  242. package/dist/engine/models/artifact-downloader.d.ts +0 -77
  243. package/dist/engine/models/artifact-downloader.js +0 -766
  244. package/dist/engine/models/artifact-downloader.js.map +0 -1
  245. package/dist/engine/models/backends/llama-cpp.d.ts +0 -99
  246. package/dist/engine/models/backends/llama-cpp.js +0 -573
  247. package/dist/engine/models/backends/llama-cpp.js.map +0 -1
  248. package/dist/engine/models/backends/model2vec-runtime.d.ts +0 -63
  249. package/dist/engine/models/backends/model2vec-runtime.js +0 -112
  250. package/dist/engine/models/backends/model2vec-runtime.js.map +0 -1
  251. package/dist/engine/models/backends/model2vec-tokenizer.d.ts +0 -2
  252. package/dist/engine/models/backends/model2vec-tokenizer.js +0 -42
  253. package/dist/engine/models/backends/model2vec-tokenizer.js.map +0 -1
  254. package/dist/engine/models/backends/model2vec-worker-pool.d.ts +0 -25
  255. package/dist/engine/models/backends/model2vec-worker-pool.js +0 -264
  256. package/dist/engine/models/backends/model2vec-worker-pool.js.map +0 -1
  257. package/dist/engine/models/backends/model2vec-worker.d.ts +0 -1
  258. package/dist/engine/models/backends/model2vec-worker.js +0 -41
  259. package/dist/engine/models/backends/model2vec-worker.js.map +0 -1
  260. package/dist/engine/models/backends/model2vec.d.ts +0 -38
  261. package/dist/engine/models/backends/model2vec.js +0 -344
  262. package/dist/engine/models/backends/model2vec.js.map +0 -1
  263. package/dist/engine/models/backends/qwen.d.ts +0 -44
  264. package/dist/engine/models/backends/qwen.js +0 -411
  265. package/dist/engine/models/backends/qwen.js.map +0 -1
  266. package/dist/engine/models/backends/transformers-js.d.ts +0 -87
  267. package/dist/engine/models/backends/transformers-js.js +0 -360
  268. package/dist/engine/models/backends/transformers-js.js.map +0 -1
  269. package/dist/engine/models/catalog.d.ts +0 -490
  270. package/dist/engine/models/catalog.js +0 -522
  271. package/dist/engine/models/catalog.js.map +0 -1
  272. package/dist/engine/models/download-progress.d.ts +0 -16
  273. package/dist/engine/models/download-progress.js +0 -47
  274. package/dist/engine/models/download-progress.js.map +0 -1
  275. package/dist/engine/models/embeddings.d.ts +0 -69
  276. package/dist/engine/models/embeddings.js +0 -125
  277. package/dist/engine/models/embeddings.js.map +0 -1
  278. package/dist/engine/models/factory.d.ts +0 -2
  279. package/dist/engine/models/factory.js +0 -51
  280. package/dist/engine/models/factory.js.map +0 -1
  281. package/dist/engine/models/index.d.ts +0 -4
  282. package/dist/engine/models/index.js +0 -5
  283. package/dist/engine/models/index.js.map +0 -1
  284. package/dist/engine/models/ranking.d.ts +0 -19
  285. package/dist/engine/models/ranking.js +0 -2
  286. package/dist/engine/models/ranking.js.map +0 -1
  287. package/dist/engine/models/resolution.d.ts +0 -8
  288. package/dist/engine/models/resolution.js +0 -22
  289. package/dist/engine/models/resolution.js.map +0 -1
  290. package/dist/engine/pipeline/indexing/index.d.ts +0 -14
  291. package/dist/engine/pipeline/indexing/index.js +0 -1217
  292. package/dist/engine/pipeline/indexing/index.js.map +0 -1
  293. package/dist/engine/pipeline/indexing/input-budget.d.ts +0 -2
  294. package/dist/engine/pipeline/indexing/input-budget.js +0 -51
  295. package/dist/engine/pipeline/indexing/input-budget.js.map +0 -1
  296. package/dist/engine/pipeline/indexing/root-paths.d.ts +0 -7
  297. package/dist/engine/pipeline/indexing/root-paths.js +0 -148
  298. package/dist/engine/pipeline/indexing/root-paths.js.map +0 -1
  299. package/dist/engine/pipeline/indexing/scanner/index.d.ts +0 -14
  300. package/dist/engine/pipeline/indexing/scanner/index.js +0 -776
  301. package/dist/engine/pipeline/indexing/scanner/index.js.map +0 -1
  302. package/dist/engine/pipeline/search/index.d.ts +0 -12
  303. package/dist/engine/pipeline/search/index.js +0 -811
  304. package/dist/engine/pipeline/search/index.js.map +0 -1
  305. package/dist/engine/service/index.d.ts +0 -3
  306. package/dist/engine/service/index.js +0 -2
  307. package/dist/engine/service/index.js.map +0 -1
  308. package/dist/engine/service/lexical.d.ts +0 -28
  309. package/dist/engine/service/lexical.js +0 -446
  310. package/dist/engine/service/lexical.js.map +0 -1
  311. package/dist/engine/service/root.d.ts +0 -15
  312. package/dist/engine/service/root.js +0 -57
  313. package/dist/engine/service/root.js.map +0 -1
  314. package/dist/engine/service/structure-enrichment.d.ts +0 -8
  315. package/dist/engine/service/structure-enrichment.js +0 -178
  316. package/dist/engine/service/structure-enrichment.js.map +0 -1
  317. package/dist/engine/service/types.d.ts +0 -210
  318. package/dist/engine/service/types.js +0 -2
  319. package/dist/engine/service/types.js.map +0 -1
  320. package/dist/engine/service/workspace-index.d.ts +0 -26
  321. package/dist/engine/service/workspace-index.js +0 -157
  322. package/dist/engine/service/workspace-index.js.map +0 -1
  323. package/dist/engine/service/zvec-grep.d.ts +0 -13
  324. package/dist/engine/service/zvec-grep.js +0 -1393
  325. package/dist/engine/service/zvec-grep.js.map +0 -1
  326. package/dist/engine/storage/index.d.ts +0 -53
  327. package/dist/engine/storage/index.js +0 -3
  328. package/dist/engine/storage/index.js.map +0 -1
  329. package/dist/engine/storage/layout.d.ts +0 -10
  330. package/dist/engine/storage/layout.js +0 -29
  331. package/dist/engine/storage/layout.js.map +0 -1
  332. package/dist/engine/storage/zvec.d.ts +0 -4
  333. package/dist/engine/storage/zvec.js +0 -976
  334. package/dist/engine/storage/zvec.js.map +0 -1
  335. package/dist/engine/types.d.ts +0 -303
  336. package/dist/engine/types.js +0 -14
  337. package/dist/engine/types.js.map +0 -1
  338. package/dist/engine/utils/atomic-file.d.ts +0 -3
  339. package/dist/engine/utils/atomic-file.js +0 -39
  340. package/dist/engine/utils/atomic-file.js.map +0 -1
  341. package/dist/engine/utils/daemon-lease.d.ts +0 -17
  342. package/dist/engine/utils/daemon-lease.js +0 -175
  343. package/dist/engine/utils/daemon-lease.js.map +0 -1
  344. package/dist/engine/utils/file-selection.d.ts +0 -10
  345. package/dist/engine/utils/file-selection.js +0 -157
  346. package/dist/engine/utils/file-selection.js.map +0 -1
  347. package/dist/engine/utils/glob.d.ts +0 -9
  348. package/dist/engine/utils/glob.js +0 -208
  349. package/dist/engine/utils/glob.js.map +0 -1
  350. package/dist/engine/utils/hash.d.ts +0 -2
  351. package/dist/engine/utils/hash.js +0 -8
  352. package/dist/engine/utils/hash.js.map +0 -1
  353. package/dist/engine/utils/json.d.ts +0 -8
  354. package/dist/engine/utils/json.js +0 -83
  355. package/dist/engine/utils/json.js.map +0 -1
  356. package/dist/engine/utils/lock.d.ts +0 -19
  357. package/dist/engine/utils/lock.js +0 -254
  358. package/dist/engine/utils/lock.js.map +0 -1
  359. package/dist/engine/utils/path.d.ts +0 -4
  360. package/dist/engine/utils/path.js +0 -18
  361. package/dist/engine/utils/path.js.map +0 -1
  362. package/dist/engine/utils/timing.d.ts +0 -19
  363. package/dist/engine/utils/timing.js +0 -87
  364. package/dist/engine/utils/timing.js.map +0 -1
  365. package/dist/index-progress.d.ts +0 -10
  366. package/dist/index-progress.js +0 -159
  367. package/dist/index-progress.js.map +0 -1
  368. package/dist/index.d.ts +0 -6
  369. package/dist/index.js +0 -4
  370. package/dist/index.js.map +0 -1
  371. package/dist/mcp/http-transport.d.ts +0 -27
  372. package/dist/mcp/http-transport.js +0 -182
  373. package/dist/mcp/http-transport.js.map +0 -1
  374. package/dist/mcp/input-normalization.d.ts +0 -38
  375. package/dist/mcp/input-normalization.js +0 -104
  376. package/dist/mcp/input-normalization.js.map +0 -1
  377. package/dist/mcp/progress-heartbeat.d.ts +0 -17
  378. package/dist/mcp/progress-heartbeat.js +0 -46
  379. package/dist/mcp/progress-heartbeat.js.map +0 -1
  380. package/dist/mcp/request-metadata.d.ts +0 -2
  381. package/dist/mcp/request-metadata.js +0 -11
  382. package/dist/mcp/request-metadata.js.map +0 -1
  383. package/dist/mcp/request-state.d.ts +0 -40
  384. package/dist/mcp/request-state.js +0 -210
  385. package/dist/mcp/request-state.js.map +0 -1
  386. package/dist/mcp/result-format.d.ts +0 -13
  387. package/dist/mcp/result-format.js +0 -75
  388. package/dist/mcp/result-format.js.map +0 -1
  389. package/dist/mcp/schemas.d.ts +0 -668
  390. package/dist/mcp/schemas.js +0 -512
  391. package/dist/mcp/schemas.js.map +0 -1
  392. package/dist/mcp/stdio-bridge.d.ts +0 -15
  393. package/dist/mcp/stdio-bridge.js +0 -190
  394. package/dist/mcp/stdio-bridge.js.map +0 -1
  395. package/dist/mcp/tools.d.ts +0 -153
  396. package/dist/mcp/tools.js +0 -488
  397. package/dist/mcp/tools.js.map +0 -1
  398. package/dist/mcp/toolset.d.ts +0 -5
  399. package/dist/mcp/toolset.js +0 -12
  400. package/dist/mcp/toolset.js.map +0 -1
  401. package/dist/observability/trace-context.d.ts +0 -11
  402. package/dist/observability/trace-context.js +0 -138
  403. package/dist/observability/trace-context.js.map +0 -1
  404. package/dist/prompts/zvec-grep-guidance.d.ts +0 -2
  405. package/dist/prompts/zvec-grep-guidance.js +0 -9
  406. package/dist/prompts/zvec-grep-guidance.js.map +0 -1
  407. package/docs/01-agents.md +0 -209
  408. package/docs/02-cli.md +0 -247
  409. package/docs/03-mcp.md +0 -185
  410. package/docs/04-pipeline.md +0 -226
  411. package/docs/05-architecture.md +0 -86
  412. package/docs/06-server.md +0 -233
  413. package/docs/07-embedding.md +0 -209
  414. package/docs/08-roadmap.md +0 -85
  415. package/docs/README.md +0 -53
package/README.md CHANGED
@@ -1,254 +1,89 @@
1
- <p align="right">
2
- English | <a href="./README_CN.md">中文</a>
3
- </p>
4
-
5
- <div align="center">
6
- <picture>
7
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/zg-logo-dark.svg">
8
- <img src="./.github/assets/zg-logo.svg" width="150" alt="zg logo" />
9
- </picture>
10
- <p><strong>Know the words—or don’t. Just zg.</strong></p>
11
- <p>The local-first search layer for humans and agents.</p>
12
-
13
- <p>
14
- <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>
15
- <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>
16
- <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0 license" /></a>
17
- <img src="https://img.shields.io/badge/node-%3E%3D22-blue.svg" alt="Node.js 22 or newer" />
18
- </p>
19
-
20
- <p>
21
- <a href="#tour">🎬 <strong>Tour</strong></a> |
22
- <a href="#features">💫 <strong>Features</strong></a> |
23
- <a href="#try-it-yourself">🚀 <strong>Try it yourself</strong></a> |
24
- <a href="./docs/README.md">📚 <strong>Docs</strong></a> |
25
- <a href="#benchmarks">📊 <strong>Benchmarks</strong></a> |
26
- <a href="#community">🤝 <strong>Community</strong></a>
27
- </p>
28
- </div>
29
-
30
- **zg** (**z**vec-**g**rep), powered by [zvec](https://github.com/alibaba/zvec),
31
- unifies ripgrep, BM25, and vector search behind
32
- [one local-first interface](./docs/05-architecture.md). Use it directly from the
33
- terminal, or let your agent use it for you.
34
-
35
- <a id="tour"></a>
36
-
37
- ## 🎬 See it in action
38
-
39
- <div align="center">
40
- <picture>
41
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/zvec-grep-tour-dark.gif">
42
- <img src="./.github/assets/zvec-grep-tour.gif" width="1000" alt="Install the agent integration, index a workspace, and let the agent search it with zvec-grep" />
43
- </picture>
44
- </div>
45
-
46
- <a id="features"></a>
47
-
48
- ## 💫 Why zg?
49
-
50
- - **Ready for humans and agents** — install once, index once, then use the same
51
- workspace from the CLI or your agent on macOS, Linux, and Windows.
52
- - **Search beyond keywords** — discover by meaning, rank by relevance, then
53
- verify with exact text or regex when needed.
54
- - **Multi-format search** — search source code, documents, and structured data
55
- while preserving useful structure and source locations.
56
- - **Less searching, less context** — ranked, source-linked results surface the
57
- right evidence with fewer tool calls, fewer tokens, and less noise.
58
- - **Local by default** — files, indexes, and local models stay on your machine;
59
- remote embeddings receive data only with your permission.
60
-
61
- <a id="try-it-yourself"></a>
62
-
63
- ## 🚀 Try it yourself
64
-
65
- ### 1. Set up a sample bookshelf
66
-
67
- ```bash
68
- # Requires Node.js 22 or newer.
69
- npm install -g @zvec/zvec-grep
70
-
71
- mkdir zg-mystery && cd zg-mystery
72
- curl --retry 3 --retry-all-errors --progress-bar -fL \
73
- -o alice-in-wonderland.txt https://raw.githubusercontent.com/GITenberg/Alice-s-Adventures-in-Wonderland_11/master/11.txt \
74
- -o sherlock-holmes.txt https://raw.githubusercontent.com/GITenberg/The-Memoirs-of-Sherlock-Holmes_834/master/834.txt
75
-
76
- zg index --embedding local/potion-retrieval-32m
77
- ```
78
-
79
- > [!NOTE]
80
- > The index is stored in `.zvec-grep/` under the indexed project root.
81
-
82
- > [!TIP]
83
- > If `zg index` or `zg query` fails, rerun the same command with `--debug`
84
- > for diagnostics (supported in both direct and server modes).
85
- > `zg status --mode direct --debug` reports per-file failures stored in an
86
- > existing index; rerun a failed direct command to diagnose command-level
87
- > fatal errors. Use
88
- > `zg status --mode server --debug` to inspect recorded server indexing errors.
89
- > For server connection failures, check `zg server status` and the
90
- > [server logs](./docs/06-server.md#logs-and-state).
91
-
92
- ### 2. Choose how to search
93
-
94
- #### For agents: ask with OpenCode
95
-
96
- With [OpenCode](https://opencode.ai/) configured:
97
-
98
- ```bash
99
- zg install --target opencode --yes
100
- opencode models
101
- opencode run --model opencode/nemotron-3-ultra-free \
102
- "An unseen creature left a few marks. What did the detective infer? Cite local evidence."
103
- ```
104
-
105
- Free model availability can change. Check `opencode models` and replace the
106
- example model with one that is currently available in your environment.
107
-
108
- OpenCode chooses zg on its own—the prompt does not name a tool.
109
-
110
- <details>
111
- <summary><strong>See the full agent run and answer</strong></summary>
112
-
113
- ```text
114
- ⚙ zvec_grep_zvec_grep_search {"root":".../zg-mystery","query":"An unseen creature left a few marks. What did the detective infer?","fts":["marks","unseen creature","inferred","detective"],"fuse":true}
115
- → Read sherlock-holmes.txt [offset=5440, limit=120]
116
-
117
- Answer:
118
- The detective is Sherlock Holmes in *The Adventure of the Crooked Man*.
119
- From the animal's foot-marks, he inferred:
120
-
121
- - It was not a dog, cat, monkey, or other familiar creature: its print had
122
- five foot-pads, long nails, and was nearly as large as a dessert-spoon
123
- (sherlock-holmes.txt:5479-5486).
124
- - It had a long body and very short legs: nearly two feet long, but with a
125
- stride of only about three inches (sherlock-holmes.txt:5497-5502).
126
- - It was carnivorous because it climbed the curtain toward a canary's cage
127
- (sherlock-holmes.txt:5509-5510).
128
- - It was probably from the weasel or stoat tribe, though unusually large
129
- (sherlock-holmes.txt:5514-5516).
130
-
131
- Holmes also inferred that a man entered through the window with it and later
132
- left with the key (sherlock-holmes.txt:5464-5470, 5527-5528).
1
+ # zvec-grep
2
+
3
+ This is the npm distribution wrapper for the native `zg` CLI. The package uses
4
+ an exact-version optional dependency to install only the native package matching
5
+ the current operating system, CPU architecture, and Linux libc.
6
+
7
+ Linux/Windows x64 install a complete CPU runtime first. The same executable
8
+ retains CUDA plugin-loading capability; no recompilation is needed to add GPU
9
+ support. Base packages pin optional component versions, core identities and
10
+ archive/file hashes in `plugins.json`, not npm dependencies.
11
+
12
+ `ZG_INSTALL_ACCELERATOR=auto` (default) downloads the existing complete CUDA
13
+ component set only when bounded NVIDIA detection succeeds. `cpu` skips both
14
+ detection and downloads; `cuda` forces installation even on GPU-free image
15
+ builders. Detection is only a download hint, not a CUDA compatibility test.
16
+ It runs `nvidia-smi` with a five-second timeout and checks for a successful,
17
+ nonempty result; it does not compare driver versions, probe CUDA/cuDNN libraries,
18
+ or choose different plugin subsets for GGUF and ORT.
19
+ Optional failures in auto mode leave CPU usable with a warning; base corruption
20
+ and forced CUDA installation failures are errors. Host NVIDIA drivers, CUDA
21
+ runtime libraries and cuDNN remain separate requirements.
22
+
23
+ Stop running zg/daemon processes before adding plugins. On Linux, for example:
24
+
25
+ ```sh
26
+ ZG_INSTALL_ACCELERATOR=cpu npm install -g @zvec/zvec-grep
27
+ ZG_INSTALL_ACCELERATOR=cuda npm rebuild -g @zvec/zvec-grep --foreground-scripts
133
28
  ```
134
29
 
135
- </details>
136
-
137
- #### For humans: search directly
138
-
139
- Search the same bookshelf directly, without an agent:
140
-
141
- ```bash
142
- zg query --human "An unseen creature left a few marks. What did the detective infer?" --limit 3
143
- ```
144
-
145
- zg returns the relevant passages from `sherlock-holmes.txt`, ranked ahead of
146
- `alice-in-wonderland.txt`.
147
-
148
- <a id="benchmarks"></a>
149
-
150
- ## 📊 Benchmarks
151
-
152
- Each benchmark uses paired A/B runs with tasks, agent/model, prompt,
153
- environment, and limits held constant; only zg access and usage guidance
154
- differ.
155
-
156
- See the [benchmark documentation](./benchmarks/README.md) for full results and
157
- reproduction details.
158
-
159
- ### 1. Cross-Domain Agent Benchmark
160
-
161
- [SWE-QA-Bench](./benchmarks/swe-qa-bench/README.md) uses Claude Code with
162
- Claude Opus 5 at high reasoning effort;
163
- [BrowseComp-Plus](./benchmarks/browse-comp-plus/README.md) uses Codex
164
- gpt-5.6-sol at medium reasoning effort. Both zg profiles use Qwen3.7 Text
165
- Embedding.
166
-
167
- <p align="center">
168
- <picture>
169
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/benchmark-overall-retrieval-indexed-v4-dark.svg">
170
- <source media="(prefers-color-scheme: light)" srcset="./.github/assets/benchmark-overall-retrieval-indexed-v4-light.svg">
171
- <img src="./.github/assets/benchmark-overall-retrieval-indexed-v4-light.svg" alt="Overall zg benchmark results for Coding and general text retrieval, comparing answer quality, input tokens, tool calls, and agent time against Baseline" width="1200" />
172
- </picture>
173
- </p>
174
-
175
- - **Why it helps:** semantic discovery narrows the search space, ranked lexical
176
- retrieval anchors exact identifiers, and compact evidence reduces broad
177
- scans, repeated tool calls, and model context.
178
- - **Why it generalizes:** the same retrieval loop works across domains—code is
179
- indexed with symbols, signatures, and breadcrumbs, while prose is retrieved
180
- as focused sections and chunks.
181
-
182
- ### 2. Real-World Case Studies
183
-
184
- <table align="center">
185
- <tr>
186
- <td align="center">
187
- <picture>
188
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/benchmark-repository-top3-v2.png">
189
- <source media="(prefers-color-scheme: light)" srcset="./.github/assets/benchmark-repository-top3-v2-light.png">
190
- <img src="./.github/assets/benchmark-repository-top3-v2-light.png" alt="Baseline to zg comparison across three repository-comprehension tasks: Judge score, input tokens, tool calls, and wall time" width="980" />
191
- </picture>
192
- </td>
193
- </tr>
194
- </table>
195
-
196
- - **[Pylint](https://github.com/pylint-dev/pylint) — Python static analysis:** the task asks how AST node handling
197
- separates annotated and non-annotated attribute initialization. Symbol-aware
198
- retrieval is useful because the architectural entry point is not known in
199
- advance.
200
- - **[Matplotlib](https://github.com/matplotlib/matplotlib) — plotting and rendering:** the task traces `FontInfo` and font
201
- selection through multiple math-text rendering stages. Ranked semantic and
202
- lexical evidence helps reconstruct the cross-file data and control flow.
203
- - **[Django](https://github.com/django/django) — web framework:** the task connects username uniqueness, ORM
204
- transactions, and formset bulk operations. Compact ranked evidence brings
205
- the distributed design rationale together.
206
-
207
- <details>
208
- <summary><strong>Repository questions</strong></summary>
209
-
210
- | Repository | Question type | Question |
211
- | --- | --- | --- |
212
- | **`pylint-dev/pylint`** | What<br>Architecture exploration | What is the architectural pattern that distinguishes type-annotated from non-annotated instance attribute initialization using AST node type separation? |
213
- | **`matplotlib/matplotlib`** | Where<br>Data / Control-flow | Where does the `FontInfo` NamedTuple propagate font metrics and glyph data through the mathematical text rendering pipeline, and what control flow determines whether the `postscript_name` or the `FT2Font` object is used at different stages of character rendering? |
214
- | **`django/django`** | Why<br>Design rationale | Why does the User model's unique constraint on the username field interact with Django's ORM transaction handling, and what cascading effects would occur if this constraint were removed on an existing database with formset-based bulk operations? |
215
-
216
- </details>
217
-
218
- > zg works best when evidence spans files or modules and the target location is
219
- > unknown, especially for call-chain, data-flow, and architectural questions.
220
- > Since agents decide when and how to use it, results vary by model and run;
221
- > repeated-run averages are more reliable.
222
-
223
- ## 📚 Documentation
224
-
225
- | Guide | What you can do |
226
- | :--- | :--- |
227
- | [Agent integrations](./docs/01-agents.md) | Connect zg to Codex, Claude Code, Qwen Code, Qoder, Cursor, or OpenCode and verify that it works. |
228
- | [CLI guide](./docs/02-cli.md) | Search, index, and manage your local workspaces from the terminal. |
229
- | [MCP guide](./docs/03-mcp.md) | Understand which zg tools your agent can use and how access is secured. |
230
- | [Retrieval pipeline](./docs/04-pipeline.md) | Choose what to index, keep it fresh, and get better search results. |
231
- | [Architecture](./docs/05-architecture.md) | See how zg handles your query and where your data stays. |
232
- | [Server and execution modes](./docs/06-server.md) | Choose between one-off commands and a long-running local server. |
233
- | [Embedding models](./docs/07-embedding.md) | Pick the right model for speed, search quality, privacy, and your hardware. |
234
- | [Roadmap](./docs/08-roadmap.md) | See what is coming next and help shape zg's priorities. |
235
-
236
- <a id="community"></a>
237
-
238
- ## 🤝 Join Our Community
239
-
240
- <div align="center">
241
-
242
- | 💬 DingTalk | 📱 WeChat | 🎮 Discord | X (Twitter) |
243
- | :---: | :---: | :---: | :---: |
244
- | <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?v5" 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>) |
245
- | Scan to join | Scan to join | Click to join | Click to follow |
246
-
247
- </div>
248
-
249
- ## ❤️ Contributing
250
-
251
- Community contributions are always welcome—bug fixes, features, and
252
- documentation improvements all help make zvec-grep better.
253
-
254
- Check out our [Contributing Guide](./CONTRIBUTING.md) to get started!
30
+ For project-local installations, omit `-g` and run in the project directory.
31
+ After a successful global installation or rebuild, postinstall attempts to
32
+ migrate existing user-level agent launch configurations from 0.2.x. It uses the
33
+ new native executable with `--install --upgrade-installed`; no agent selection,
34
+ new integration, daemon startup or model loading is involved. HTTP settings,
35
+ custom fields, permissions, guidance and comments are preserved. Changed files
36
+ receive adjacent `.zg-upgrade-*.bak` backups. Reconnect agents after migration;
37
+ HTTP users can run `zg --server on` to replace an old daemon.
38
+
39
+ Local dependencies, temporary execution, CI, elevated Unix installs and
40
+ ambiguous user homes skip automatic migration. Set
41
+ `ZG_INSTALL_SKIP_AGENT_UPGRADE=1` to opt out independently of native installation.
42
+ Migration errors or the 10-second timeout do not fail package installation;
43
+ details are saved in `agent-upgrade.log` inside this package when possible.
44
+ Retry with `zg --install --upgrade-installed`, or preview changes with
45
+ `zg --install --upgrade-installed --dry-run`. The command only scans known user
46
+ configuration locations, respects directory overrides, and reports unsupported
47
+ custom launchers for manual handling. Repeated runs make no additional changes.
48
+
49
+ In PowerShell, set `$env:ZG_INSTALL_ACCELERATOR = 'cuda'` before `npm rebuild`,
50
+ then remove that environment variable when finished. There is no `zg-setup`
51
+ command. Restart any previously running daemon after successful installation.
52
+ CPU mode disables downloads; it does not uninstall already verified plugins.
53
+ Failed or interrupted CUDA additions leave the existing CPU payload intact.
54
+ After correcting the failure, rerun the same rebuild command; no separate
55
+ recovery command or download-resume feature is normally needed. Concurrent
56
+ installations are rejected. Stale-lock recovery is serialized and rechecks the
57
+ owner before removal; releasing a lock never deletes a replacement owner's lock.
58
+ If a process is killed during the brief lock-recovery operation itself, the
59
+ installer fails closed on `.native-install.lock.recovery`. Stop all installers,
60
+ inspect the lock and this guard directory in the installed meta package, and
61
+ remove the abandoned empty guard before retrying. Never remove it while an
62
+ installer is running. An invalid/partially written `.native-install.lock` also
63
+ requires inspection instead of automatic deletion.
64
+
65
+ `ZG_PLUGIN_DIR` selects an absolute directory containing the exact component
66
+ `.tgz` files (no registry/cache fallback if a file is missing).
67
+ `ZG_INSTALL_OFFLINE=1` or npm's `--offline` prevents network requests; without a
68
+ local directory only previously verified archives in `ZG_PLUGIN_CACHE` are used.
69
+ The default cache is below npm's cache, isolated by platform, version, core and
70
+ content identity. Runtime libraries are copied beside the binary, not loaded
71
+ from absolute cache paths. Online downloads use npm's registry/proxy/auth/CA
72
+ configuration and do not run component lifecycle scripts.
73
+
74
+ The installer verifies archives, streams Linux/Windows ORT fragments into a temporary
75
+ file, then checks the complete library hash before activation. It preserves
76
+ `bin/zg.exe`, `lib/` and `lib/cuda12/`; no compilation, driver/Toolkit installation
77
+ or model execution happens during installation. `native-install.json` records
78
+ the installed core and plugins; normal CLI execution never downloads plugins.
79
+ The `zg` command enters the native executable directly. Unix rpaths and the
80
+ Windows native delay-load hook locate the sibling `lib/` without a launcher.
81
+
82
+ Node.js 14.14 or newer is required only for installation. Online plugin downloads
83
+ need npm 7+; plugin extraction uses the system `tar` (included with the supported
84
+ Windows/macOS/Linux environments). CLI execution does not require Node or npm.
85
+
86
+ `--ignore-scripts` skips CPU bootstrap too and leaves a placeholder command.
87
+ Explicitly allow this package's lifecycle scripts in your npm policy, then use
88
+ `npm rebuild -g @zvec/zvec-grep --ignore-scripts=false` to initialize it. If the
89
+ platform dependency was omitted, reinstall without `--omit=optional` first.
package/bin/zg.exe ADDED
@@ -0,0 +1,3 @@
1
+ echo "zvec-grep native binary was not materialized during npm install." >&2
2
+ echo "Reinstall without --ignore-scripts and without --omit=optional." >&2
3
+ exit 1