@zvec/zvec-grep 0.2.1 → 0.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/README.md +87 -238
  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 -230
  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 -1207
  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 -697
  40. package/dist/cli/commands.js.map +0 -1
  41. package/dist/cli/errors.d.ts +0 -6
  42. package/dist/cli/errors.js +0 -98
  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 -81
  60. package/dist/cli/format/status.js +0 -512
  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 -524
  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 -32
  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 -329
  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 -1085
  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 -24
  99. package/dist/daemon/config.js +0 -88
  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 -70
  111. package/dist/daemon/job-scheduler.js +0 -366
  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 -188
  121. package/dist/daemon/root-lease.js.map +0 -1
  122. package/dist/daemon/root-runtime.d.ts +0 -79
  123. package/dist/daemon/root-runtime.js +0 -337
  124. package/dist/daemon/root-runtime.js.map +0 -1
  125. package/dist/daemon/runtime-manager.d.ts +0 -46
  126. package/dist/daemon/runtime-manager.js +0 -246
  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 -102
  130. package/dist/daemon/runtime.js.map +0 -1
  131. package/dist/daemon/server-controller.d.ts +0 -39
  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 -340
  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 -19
  147. package/dist/engine/errors.js +0 -40
  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/backends/llama-cpp.d.ts +0 -99
  240. package/dist/engine/models/backends/llama-cpp.js +0 -511
  241. package/dist/engine/models/backends/llama-cpp.js.map +0 -1
  242. package/dist/engine/models/backends/model2vec-runtime.d.ts +0 -63
  243. package/dist/engine/models/backends/model2vec-runtime.js +0 -112
  244. package/dist/engine/models/backends/model2vec-runtime.js.map +0 -1
  245. package/dist/engine/models/backends/model2vec-tokenizer.d.ts +0 -2
  246. package/dist/engine/models/backends/model2vec-tokenizer.js +0 -42
  247. package/dist/engine/models/backends/model2vec-tokenizer.js.map +0 -1
  248. package/dist/engine/models/backends/model2vec-worker-pool.d.ts +0 -25
  249. package/dist/engine/models/backends/model2vec-worker-pool.js +0 -264
  250. package/dist/engine/models/backends/model2vec-worker-pool.js.map +0 -1
  251. package/dist/engine/models/backends/model2vec-worker.d.ts +0 -1
  252. package/dist/engine/models/backends/model2vec-worker.js +0 -41
  253. package/dist/engine/models/backends/model2vec-worker.js.map +0 -1
  254. package/dist/engine/models/backends/model2vec.d.ts +0 -40
  255. package/dist/engine/models/backends/model2vec.js +0 -311
  256. package/dist/engine/models/backends/model2vec.js.map +0 -1
  257. package/dist/engine/models/backends/qwen.d.ts +0 -44
  258. package/dist/engine/models/backends/qwen.js +0 -411
  259. package/dist/engine/models/backends/qwen.js.map +0 -1
  260. package/dist/engine/models/backends/transformers-js.d.ts +0 -87
  261. package/dist/engine/models/backends/transformers-js.js +0 -316
  262. package/dist/engine/models/backends/transformers-js.js.map +0 -1
  263. package/dist/engine/models/catalog.d.ts +0 -231
  264. package/dist/engine/models/catalog.js +0 -218
  265. package/dist/engine/models/catalog.js.map +0 -1
  266. package/dist/engine/models/download-progress.d.ts +0 -15
  267. package/dist/engine/models/download-progress.js +0 -48
  268. package/dist/engine/models/download-progress.js.map +0 -1
  269. package/dist/engine/models/embeddings.d.ts +0 -67
  270. package/dist/engine/models/embeddings.js +0 -125
  271. package/dist/engine/models/embeddings.js.map +0 -1
  272. package/dist/engine/models/factory.d.ts +0 -2
  273. package/dist/engine/models/factory.js +0 -51
  274. package/dist/engine/models/factory.js.map +0 -1
  275. package/dist/engine/models/index.d.ts +0 -4
  276. package/dist/engine/models/index.js +0 -5
  277. package/dist/engine/models/index.js.map +0 -1
  278. package/dist/engine/models/ranking.d.ts +0 -19
  279. package/dist/engine/models/ranking.js +0 -2
  280. package/dist/engine/models/ranking.js.map +0 -1
  281. package/dist/engine/models/resolution.d.ts +0 -8
  282. package/dist/engine/models/resolution.js +0 -22
  283. package/dist/engine/models/resolution.js.map +0 -1
  284. package/dist/engine/pipeline/indexing/index.d.ts +0 -14
  285. package/dist/engine/pipeline/indexing/index.js +0 -1061
  286. package/dist/engine/pipeline/indexing/index.js.map +0 -1
  287. package/dist/engine/pipeline/indexing/input-budget.d.ts +0 -2
  288. package/dist/engine/pipeline/indexing/input-budget.js +0 -51
  289. package/dist/engine/pipeline/indexing/input-budget.js.map +0 -1
  290. package/dist/engine/pipeline/indexing/root-paths.d.ts +0 -7
  291. package/dist/engine/pipeline/indexing/root-paths.js +0 -148
  292. package/dist/engine/pipeline/indexing/root-paths.js.map +0 -1
  293. package/dist/engine/pipeline/indexing/scanner/index.d.ts +0 -14
  294. package/dist/engine/pipeline/indexing/scanner/index.js +0 -776
  295. package/dist/engine/pipeline/indexing/scanner/index.js.map +0 -1
  296. package/dist/engine/pipeline/search/index.d.ts +0 -12
  297. package/dist/engine/pipeline/search/index.js +0 -811
  298. package/dist/engine/pipeline/search/index.js.map +0 -1
  299. package/dist/engine/service/index.d.ts +0 -3
  300. package/dist/engine/service/index.js +0 -2
  301. package/dist/engine/service/index.js.map +0 -1
  302. package/dist/engine/service/lexical.d.ts +0 -28
  303. package/dist/engine/service/lexical.js +0 -446
  304. package/dist/engine/service/lexical.js.map +0 -1
  305. package/dist/engine/service/root.d.ts +0 -15
  306. package/dist/engine/service/root.js +0 -57
  307. package/dist/engine/service/root.js.map +0 -1
  308. package/dist/engine/service/structure-enrichment.d.ts +0 -8
  309. package/dist/engine/service/structure-enrichment.js +0 -178
  310. package/dist/engine/service/structure-enrichment.js.map +0 -1
  311. package/dist/engine/service/types.d.ts +0 -210
  312. package/dist/engine/service/types.js +0 -2
  313. package/dist/engine/service/types.js.map +0 -1
  314. package/dist/engine/service/workspace-index.d.ts +0 -26
  315. package/dist/engine/service/workspace-index.js +0 -157
  316. package/dist/engine/service/workspace-index.js.map +0 -1
  317. package/dist/engine/service/zvec-grep.d.ts +0 -13
  318. package/dist/engine/service/zvec-grep.js +0 -1393
  319. package/dist/engine/service/zvec-grep.js.map +0 -1
  320. package/dist/engine/storage/index.d.ts +0 -53
  321. package/dist/engine/storage/index.js +0 -3
  322. package/dist/engine/storage/index.js.map +0 -1
  323. package/dist/engine/storage/layout.d.ts +0 -10
  324. package/dist/engine/storage/layout.js +0 -29
  325. package/dist/engine/storage/layout.js.map +0 -1
  326. package/dist/engine/storage/zvec.d.ts +0 -4
  327. package/dist/engine/storage/zvec.js +0 -976
  328. package/dist/engine/storage/zvec.js.map +0 -1
  329. package/dist/engine/types.d.ts +0 -303
  330. package/dist/engine/types.js +0 -14
  331. package/dist/engine/types.js.map +0 -1
  332. package/dist/engine/utils/daemon-lease.d.ts +0 -17
  333. package/dist/engine/utils/daemon-lease.js +0 -175
  334. package/dist/engine/utils/daemon-lease.js.map +0 -1
  335. package/dist/engine/utils/file-selection.d.ts +0 -10
  336. package/dist/engine/utils/file-selection.js +0 -157
  337. package/dist/engine/utils/file-selection.js.map +0 -1
  338. package/dist/engine/utils/glob.d.ts +0 -9
  339. package/dist/engine/utils/glob.js +0 -208
  340. package/dist/engine/utils/glob.js.map +0 -1
  341. package/dist/engine/utils/hash.d.ts +0 -2
  342. package/dist/engine/utils/hash.js +0 -8
  343. package/dist/engine/utils/hash.js.map +0 -1
  344. package/dist/engine/utils/json.d.ts +0 -8
  345. package/dist/engine/utils/json.js +0 -83
  346. package/dist/engine/utils/json.js.map +0 -1
  347. package/dist/engine/utils/lock.d.ts +0 -19
  348. package/dist/engine/utils/lock.js +0 -254
  349. package/dist/engine/utils/lock.js.map +0 -1
  350. package/dist/engine/utils/path.d.ts +0 -4
  351. package/dist/engine/utils/path.js +0 -18
  352. package/dist/engine/utils/path.js.map +0 -1
  353. package/dist/engine/utils/timing.d.ts +0 -19
  354. package/dist/engine/utils/timing.js +0 -87
  355. package/dist/engine/utils/timing.js.map +0 -1
  356. package/dist/index-progress.d.ts +0 -10
  357. package/dist/index-progress.js +0 -159
  358. package/dist/index-progress.js.map +0 -1
  359. package/dist/index.d.ts +0 -6
  360. package/dist/index.js +0 -4
  361. package/dist/index.js.map +0 -1
  362. package/dist/mcp/http-transport.d.ts +0 -27
  363. package/dist/mcp/http-transport.js +0 -182
  364. package/dist/mcp/http-transport.js.map +0 -1
  365. package/dist/mcp/input-normalization.d.ts +0 -38
  366. package/dist/mcp/input-normalization.js +0 -104
  367. package/dist/mcp/input-normalization.js.map +0 -1
  368. package/dist/mcp/progress-heartbeat.d.ts +0 -17
  369. package/dist/mcp/progress-heartbeat.js +0 -46
  370. package/dist/mcp/progress-heartbeat.js.map +0 -1
  371. package/dist/mcp/request-metadata.d.ts +0 -2
  372. package/dist/mcp/request-metadata.js +0 -11
  373. package/dist/mcp/request-metadata.js.map +0 -1
  374. package/dist/mcp/request-state.d.ts +0 -40
  375. package/dist/mcp/request-state.js +0 -210
  376. package/dist/mcp/request-state.js.map +0 -1
  377. package/dist/mcp/result-format.d.ts +0 -13
  378. package/dist/mcp/result-format.js +0 -75
  379. package/dist/mcp/result-format.js.map +0 -1
  380. package/dist/mcp/schemas.d.ts +0 -664
  381. package/dist/mcp/schemas.js +0 -510
  382. package/dist/mcp/schemas.js.map +0 -1
  383. package/dist/mcp/stdio-bridge.d.ts +0 -14
  384. package/dist/mcp/stdio-bridge.js +0 -178
  385. package/dist/mcp/stdio-bridge.js.map +0 -1
  386. package/dist/mcp/tools.d.ts +0 -153
  387. package/dist/mcp/tools.js +0 -482
  388. package/dist/mcp/tools.js.map +0 -1
  389. package/dist/mcp/toolset.d.ts +0 -5
  390. package/dist/mcp/toolset.js +0 -12
  391. package/dist/mcp/toolset.js.map +0 -1
  392. package/dist/observability/trace-context.d.ts +0 -11
  393. package/dist/observability/trace-context.js +0 -138
  394. package/dist/observability/trace-context.js.map +0 -1
  395. package/dist/prompts/zvec-grep-guidance.d.ts +0 -2
  396. package/dist/prompts/zvec-grep-guidance.js +0 -9
  397. package/dist/prompts/zvec-grep-guidance.js.map +0 -1
  398. package/docs/01-agents.md +0 -209
  399. package/docs/02-cli.md +0 -246
  400. package/docs/03-mcp.md +0 -185
  401. package/docs/04-pipeline.md +0 -226
  402. package/docs/05-architecture.md +0 -86
  403. package/docs/06-server.md +0 -220
  404. package/docs/07-embedding.md +0 -203
  405. package/docs/08-roadmap.md +0 -85
  406. package/docs/README.md +0 -53
package/README.md CHANGED
@@ -1,240 +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) unifies ripgrep, BM25, and vector search behind
31
- [one local-first interface](./docs/05-architecture.md). Use it directly from the
32
- terminal, or let your agent use it for you.
33
-
34
- <a id="tour"></a>
35
-
36
- ## 🎬 See it in action
37
-
38
- <div align="center">
39
- <picture>
40
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/zvec-grep-tour-dark.gif">
41
- <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" />
42
- </picture>
43
- </div>
44
-
45
- <a id="features"></a>
46
-
47
- ## 💫 Why zg?
48
-
49
- - **Ready for humans and agents** — install once, index once, then use the same
50
- workspace from the CLI or your agent on macOS, Linux, and Windows.
51
- - **Search beyond keywords** — discover by meaning, rank by relevance, then
52
- verify with exact text or regex when needed.
53
- - **Multi-format search** — search source code, documents, and structured data
54
- while preserving useful structure and source locations.
55
- - **Less searching, less context** — ranked, source-linked results surface the
56
- right evidence with fewer tool calls, fewer tokens, and less noise.
57
- - **Local by default** — files, indexes, and local models stay on your machine;
58
- remote embeddings receive data only with your permission.
59
-
60
- <a id="try-it-yourself"></a>
61
-
62
- ## 🚀 Try it yourself
63
-
64
- ### 1. Set up a sample bookshelf
65
-
66
- ```bash
67
- # Requires Node.js 22 or newer.
68
- npm install -g @zvec/zvec-grep
69
-
70
- mkdir zg-mystery && cd zg-mystery
71
- curl --retry 3 --retry-all-errors --progress-bar -fL \
72
- -o alice-in-wonderland.txt https://raw.githubusercontent.com/GITenberg/Alice-s-Adventures-in-Wonderland_11/master/11.txt \
73
- -o sherlock-holmes.txt https://raw.githubusercontent.com/GITenberg/The-Memoirs-of-Sherlock-Holmes_834/master/834.txt
74
-
75
- zg index --embedding local/potion-retrieval-32m
76
- ```
77
-
78
- ### 2. Choose how to search
79
-
80
- #### For agents: ask with OpenCode
81
-
82
- With [OpenCode](https://opencode.ai/) configured:
83
-
84
- ```bash
85
- zg install --target opencode --yes
86
- opencode models
87
- opencode run --model opencode/nemotron-3-ultra-free \
88
- "An unseen creature left a few marks. What did the detective infer? Cite local evidence."
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
89
28
  ```
90
29
 
91
- Free model availability can change. Check `opencode models` and replace the
92
- example model with one that is currently available in your environment.
93
-
94
- OpenCode chooses zg on its own—the prompt does not name a tool.
95
-
96
- <details>
97
- <summary><strong>See the full agent run and answer</strong></summary>
98
-
99
- ```text
100
- ⚙ 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}
101
- → Read sherlock-holmes.txt [offset=5440, limit=120]
102
-
103
- Answer:
104
- The detective is Sherlock Holmes in *The Adventure of the Crooked Man*.
105
- From the animal's foot-marks, he inferred:
106
-
107
- - It was not a dog, cat, monkey, or other familiar creature: its print had
108
- five foot-pads, long nails, and was nearly as large as a dessert-spoon
109
- (sherlock-holmes.txt:5479-5486).
110
- - It had a long body and very short legs: nearly two feet long, but with a
111
- stride of only about three inches (sherlock-holmes.txt:5497-5502).
112
- - It was carnivorous because it climbed the curtain toward a canary's cage
113
- (sherlock-holmes.txt:5509-5510).
114
- - It was probably from the weasel or stoat tribe, though unusually large
115
- (sherlock-holmes.txt:5514-5516).
116
-
117
- Holmes also inferred that a man entered through the window with it and later
118
- left with the key (sherlock-holmes.txt:5464-5470, 5527-5528).
119
- ```
120
-
121
- </details>
122
-
123
- #### For humans: search directly
124
-
125
- Search the same bookshelf directly, without an agent:
126
-
127
- ```bash
128
- zg query --human "An unseen creature left a few marks. What did the detective infer?" --limit 3
129
- ```
130
-
131
- zg returns the relevant passages from `sherlock-holmes.txt`, ranked ahead of
132
- `alice-in-wonderland.txt`.
133
-
134
- <a id="benchmarks"></a>
135
-
136
- ## 📊 Benchmarks
137
-
138
- Each benchmark uses paired A/B runs with tasks, agent/model, prompt,
139
- environment, and limits held constant; only zg access and usage guidance
140
- differ.
141
-
142
- See the [benchmark documentation](./benchmarks/README.md) for full results and
143
- reproduction details.
144
-
145
- ### 1. Cross-Domain Agent Benchmark
146
-
147
- [SWE-QA-Bench](./benchmarks/swe-qa-bench/README.md) uses Claude Code with
148
- Claude Opus 5 at high reasoning effort;
149
- [BrowseComp-Plus](./benchmarks/browse-comp-plus/README.md) uses Codex
150
- gpt-5.6-sol at medium reasoning effort. Both zg profiles use Qwen3.7 Text
151
- Embedding.
152
-
153
- <p align="center">
154
- <picture>
155
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/benchmark-overall-retrieval-indexed-v4-dark.svg">
156
- <source media="(prefers-color-scheme: light)" srcset="./.github/assets/benchmark-overall-retrieval-indexed-v4-light.svg">
157
- <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" />
158
- </picture>
159
- </p>
160
-
161
- - **Why it helps:** semantic discovery narrows the search space, ranked lexical
162
- retrieval anchors exact identifiers, and compact evidence reduces broad
163
- scans, repeated tool calls, and model context.
164
- - **Why it generalizes:** the same retrieval loop works across domains—code is
165
- indexed with symbols, signatures, and breadcrumbs, while prose is retrieved
166
- as focused sections and chunks.
167
-
168
- ### 2. Real-World Case Studies
169
-
170
- <table align="center">
171
- <tr>
172
- <td align="center">
173
- <picture>
174
- <source media="(prefers-color-scheme: dark)" srcset="./.github/assets/benchmark-repository-top3-v2.png">
175
- <source media="(prefers-color-scheme: light)" srcset="./.github/assets/benchmark-repository-top3-v2-light.png">
176
- <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" />
177
- </picture>
178
- </td>
179
- </tr>
180
- </table>
181
-
182
- - **[Pylint](https://github.com/pylint-dev/pylint) — Python static analysis:** the task asks how AST node handling
183
- separates annotated and non-annotated attribute initialization. Symbol-aware
184
- retrieval is useful because the architectural entry point is not known in
185
- advance.
186
- - **[Matplotlib](https://github.com/matplotlib/matplotlib) — plotting and rendering:** the task traces `FontInfo` and font
187
- selection through multiple math-text rendering stages. Ranked semantic and
188
- lexical evidence helps reconstruct the cross-file data and control flow.
189
- - **[Django](https://github.com/django/django) — web framework:** the task connects username uniqueness, ORM
190
- transactions, and formset bulk operations. Compact ranked evidence brings
191
- the distributed design rationale together.
192
-
193
- <details>
194
- <summary><strong>Repository questions</strong></summary>
195
-
196
- | Repository | Question type | Question |
197
- | --- | --- | --- |
198
- | **`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? |
199
- | **`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? |
200
- | **`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? |
201
-
202
- </details>
203
-
204
- > zg works best when evidence spans files or modules and the target location is
205
- > unknown, especially for call-chain, data-flow, and architectural questions.
206
- > Since agents decide when and how to use it, results vary by model and run;
207
- > repeated-run averages are more reliable.
208
-
209
- ## 📚 Documentation
210
-
211
- | Guide | What you can do |
212
- | :--- | :--- |
213
- | [Agent integrations](./docs/01-agents.md) | Connect zg to Codex, Claude Code, Qwen Code, Qoder, Cursor, or OpenCode and verify that it works. |
214
- | [CLI guide](./docs/02-cli.md) | Search, index, and manage your local workspaces from the terminal. |
215
- | [MCP guide](./docs/03-mcp.md) | Understand which zg tools your agent can use and how access is secured. |
216
- | [Retrieval pipeline](./docs/04-pipeline.md) | Choose what to index, keep it fresh, and get better search results. |
217
- | [Architecture](./docs/05-architecture.md) | See how zg handles your query and where your data stays. |
218
- | [Server and execution modes](./docs/06-server.md) | Choose between one-off commands and a long-running local server. |
219
- | [Embedding models](./docs/07-embedding.md) | Pick the right model for speed, search quality, privacy, and your hardware. |
220
- | [Roadmap](./docs/08-roadmap.md) | See what is coming next and help shape zg's priorities. |
221
-
222
- <a id="community"></a>
223
-
224
- ## 🤝 Join Our Community
225
-
226
- <div align="center">
227
-
228
- | 💬 DingTalk | 📱 WeChat | 🎮 Discord | X (Twitter) |
229
- | :---: | :---: | :---: | :---: |
230
- | <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?v4" 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>) |
231
- | Scan to join | Scan to join | Click to join | Click to follow |
232
-
233
- </div>
234
-
235
- ## ❤️ Contributing
236
-
237
- Community contributions are always welcome—bug fixes, features, and
238
- documentation improvements all help make zvec-grep better.
239
-
240
- 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