dsh-gitnexus-plus 0.1.1 → 0.1.3

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 (64) hide show
  1. package/README-CN.md +174 -0
  2. package/README.md +184 -447
  3. package/lib/bin/search-helper.d.ts +22 -0
  4. package/lib/bin/search-helper.d.ts.map +1 -0
  5. package/lib/bin/search-helper.js +57 -0
  6. package/lib/bin/search-helper.js.map +1 -0
  7. package/lib/client.js +978 -122
  8. package/lib/gitnexus/analyze.d.ts +27 -2
  9. package/lib/gitnexus/analyze.d.ts.map +1 -1
  10. package/lib/gitnexus/analyze.js +71 -6
  11. package/lib/gitnexus/analyze.js.map +1 -1
  12. package/lib/gitnexus/commands.d.ts +41 -8
  13. package/lib/gitnexus/commands.d.ts.map +1 -1
  14. package/lib/gitnexus/commands.js +62 -9
  15. package/lib/gitnexus/commands.js.map +1 -1
  16. package/lib/gitnexus/coverage.d.ts +16 -0
  17. package/lib/gitnexus/coverage.d.ts.map +1 -1
  18. package/lib/gitnexus/coverage.js +61 -2
  19. package/lib/gitnexus/coverage.js.map +1 -1
  20. package/lib/gitnexus/git-activity.d.ts +85 -0
  21. package/lib/gitnexus/git-activity.d.ts.map +1 -1
  22. package/lib/gitnexus/git-activity.js +286 -1
  23. package/lib/gitnexus/git-activity.js.map +1 -1
  24. package/lib/gitnexus/index-meta.d.ts +15 -5
  25. package/lib/gitnexus/index-meta.d.ts.map +1 -1
  26. package/lib/gitnexus/index-meta.js +25 -5
  27. package/lib/gitnexus/index-meta.js.map +1 -1
  28. package/lib/gitnexus/languages.d.ts +7 -0
  29. package/lib/gitnexus/languages.d.ts.map +1 -1
  30. package/lib/gitnexus/languages.js +82 -2
  31. package/lib/gitnexus/languages.js.map +1 -1
  32. package/lib/gitnexus/root.d.ts +6 -0
  33. package/lib/gitnexus/root.d.ts.map +1 -1
  34. package/lib/gitnexus/root.js +6 -0
  35. package/lib/gitnexus/root.js.map +1 -1
  36. package/lib/gitnexus/scan.d.ts +3 -0
  37. package/lib/gitnexus/scan.d.ts.map +1 -1
  38. package/lib/gitnexus/scan.js +6 -3
  39. package/lib/gitnexus/scan.js.map +1 -1
  40. package/lib/gitnexus/search.d.ts +167 -0
  41. package/lib/gitnexus/search.d.ts.map +1 -0
  42. package/lib/gitnexus/search.js +517 -0
  43. package/lib/gitnexus/search.js.map +1 -0
  44. package/lib/index.d.ts +32 -13
  45. package/lib/index.d.ts.map +1 -1
  46. package/lib/index.js +68 -21
  47. package/lib/index.js.map +1 -1
  48. package/lib/routes/analyze.d.ts +8 -2
  49. package/lib/routes/analyze.d.ts.map +1 -1
  50. package/lib/routes/analyze.js +5 -1
  51. package/lib/routes/analyze.js.map +1 -1
  52. package/lib/routes/coverage.d.ts +15 -6
  53. package/lib/routes/coverage.d.ts.map +1 -1
  54. package/lib/routes/coverage.js +77 -12
  55. package/lib/routes/coverage.js.map +1 -1
  56. package/lib/routes/file-history.d.ts +21 -0
  57. package/lib/routes/file-history.d.ts.map +1 -0
  58. package/lib/routes/file-history.js +69 -0
  59. package/lib/routes/file-history.js.map +1 -0
  60. package/lib/routes/search.d.ts +27 -0
  61. package/lib/routes/search.d.ts.map +1 -0
  62. package/lib/routes/search.js +77 -0
  63. package/lib/routes/search.js.map +1 -0
  64. package/package.json +3 -2
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Search helper, run by the **system Node** rather than the DSH host.
4
+ *
5
+ * The host is Electron's Node and cannot load GitNexus's LadybugDB native addon
6
+ * (ABI mismatch: "A dynamic link library (DLL) initialization routine failed").
7
+ * This process is started with the platform Node that the CLI already uses, imports
8
+ * the same adapter, runs one read-only query, and prints exactly one JSON object for
9
+ * the host to parse.
10
+ *
11
+ * Invocation:
12
+ * node search-helper.js <repo> <sanitized-query> [limit] [managedPrefix]
13
+ *
14
+ * Success: `{ "ok": true, "report": SearchReport }`
15
+ * Failure: `{ "ok": false, "status": <number>, "code": <SearchErrorCode>, "message": string }`
16
+ *
17
+ * It always exits 0 for a reported failure, so the host reads a structured answer
18
+ * instead of inferring one from an exit code. A process-level crash (native fault)
19
+ * is the one case the host handles from an unparseable stdout/stderr pair.
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=search-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-helper.d.ts","sourceRoot":"","sources":["../../src/bin/search-helper.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Search helper, run by the **system Node** rather than the DSH host.
4
+ *
5
+ * The host is Electron's Node and cannot load GitNexus's LadybugDB native addon
6
+ * (ABI mismatch: "A dynamic link library (DLL) initialization routine failed").
7
+ * This process is started with the platform Node that the CLI already uses, imports
8
+ * the same adapter, runs one read-only query, and prints exactly one JSON object for
9
+ * the host to parse.
10
+ *
11
+ * Invocation:
12
+ * node search-helper.js <repo> <sanitized-query> [limit] [managedPrefix]
13
+ *
14
+ * Success: `{ "ok": true, "report": SearchReport }`
15
+ * Failure: `{ "ok": false, "status": <number>, "code": <SearchErrorCode>, "message": string }`
16
+ *
17
+ * It always exits 0 for a reported failure, so the host reads a structured answer
18
+ * instead of inferring one from an exit code. A process-level crash (native fault)
19
+ * is the one case the host handles from an unparseable stdout/stderr pair.
20
+ */
21
+ import { SearchError, searchSymbols } from '../gitnexus/search.js';
22
+ /** Write the one object, then exit once stdout has flushed. */
23
+ function emit(payload) {
24
+ const text = JSON.stringify(payload);
25
+ process.stdout.write(text, () => process.exit(0));
26
+ // A native handle can keep the event loop alive; the payload is already queued.
27
+ setTimeout(() => process.exit(0), 2000).unref();
28
+ }
29
+ const [, , repoArg, queryArg, limitArg, managedArg] = process.argv;
30
+ if (typeof repoArg !== 'string' || repoArg === '' || typeof queryArg !== 'string') {
31
+ emit({
32
+ ok: false,
33
+ status: 400,
34
+ code: 'invalid-query',
35
+ message: 'usage: search-helper <repo> <query> [limit] [managedPrefix]',
36
+ });
37
+ }
38
+ else {
39
+ const parsedLimit = limitArg === undefined ? undefined : Number.parseInt(limitArg, 10);
40
+ const limit = parsedLimit === undefined || !Number.isFinite(parsedLimit) ? undefined : parsedLimit;
41
+ try {
42
+ const report = await searchSymbols(repoArg, queryArg, {
43
+ limit,
44
+ managedPrefix: managedArg === undefined || managedArg === '' ? undefined : managedArg,
45
+ });
46
+ emit({ ok: true, report });
47
+ }
48
+ catch (error) {
49
+ emit({
50
+ ok: false,
51
+ status: error instanceof SearchError ? error.status : 500,
52
+ code: error instanceof SearchError ? error.code : 'search-failed',
53
+ message: error instanceof Error ? error.message : String(error),
54
+ });
55
+ }
56
+ }
57
+ //# sourceMappingURL=search-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-helper.js","sourceRoot":"","sources":["../../src/bin/search-helper.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnE,+DAA+D;AAC/D,SAAS,IAAI,CAAC,OAAgB;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,gFAAgF;IAChF,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,EAAE,AAAD,EAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AAEnE,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,C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