dsh-gitnexus-plus 0.0.0-stage → 0.1.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.
- package/LICENSE +38 -0
- package/README.md +631 -2
- package/cordis.patch.yml +18 -0
- package/lib/bin/gitnexus-coverage.d.ts +14 -0
- package/lib/bin/gitnexus-coverage.d.ts.map +1 -0
- package/lib/bin/gitnexus-coverage.js +171 -0
- package/lib/bin/gitnexus-coverage.js.map +1 -0
- package/lib/bin/search-helper.d.ts +22 -0
- package/lib/bin/search-helper.d.ts.map +1 -0
- package/lib/bin/search-helper.js +57 -0
- package/lib/bin/search-helper.js.map +1 -0
- package/lib/client.js +2131 -0
- package/lib/gitnexus/analyze.d.ts +173 -0
- package/lib/gitnexus/analyze.d.ts.map +1 -0
- package/lib/gitnexus/analyze.js +308 -0
- package/lib/gitnexus/analyze.js.map +1 -0
- package/lib/gitnexus/commands.d.ts +129 -0
- package/lib/gitnexus/commands.d.ts.map +1 -0
- package/lib/gitnexus/commands.js +185 -0
- package/lib/gitnexus/commands.js.map +1 -0
- package/lib/gitnexus/coverage.d.ts +340 -0
- package/lib/gitnexus/coverage.d.ts.map +1 -0
- package/lib/gitnexus/coverage.js +554 -0
- package/lib/gitnexus/coverage.js.map +1 -0
- package/lib/gitnexus/format.d.ts +16 -0
- package/lib/gitnexus/format.d.ts.map +1 -0
- package/lib/gitnexus/format.js +178 -0
- package/lib/gitnexus/format.js.map +1 -0
- package/lib/gitnexus/git-activity.d.ts +136 -0
- package/lib/gitnexus/git-activity.d.ts.map +1 -0
- package/lib/gitnexus/git-activity.js +345 -0
- package/lib/gitnexus/git-activity.js.map +1 -0
- package/lib/gitnexus/git.d.ts +70 -0
- package/lib/gitnexus/git.d.ts.map +1 -0
- package/lib/gitnexus/git.js +121 -0
- package/lib/gitnexus/git.js.map +1 -0
- package/lib/gitnexus/index-meta.d.ts +160 -0
- package/lib/gitnexus/index-meta.d.ts.map +1 -0
- package/lib/gitnexus/index-meta.js +176 -0
- package/lib/gitnexus/index-meta.js.map +1 -0
- package/lib/gitnexus/install.d.ts +97 -0
- package/lib/gitnexus/install.d.ts.map +1 -0
- package/lib/gitnexus/install.js +228 -0
- package/lib/gitnexus/install.js.map +1 -0
- package/lib/gitnexus/languages.d.ts +80 -0
- package/lib/gitnexus/languages.d.ts.map +1 -0
- package/lib/gitnexus/languages.js +297 -0
- package/lib/gitnexus/languages.js.map +1 -0
- package/lib/gitnexus/root.d.ts +74 -0
- package/lib/gitnexus/root.d.ts.map +1 -0
- package/lib/gitnexus/root.js +168 -0
- package/lib/gitnexus/root.js.map +1 -0
- package/lib/gitnexus/scan.d.ts +68 -0
- package/lib/gitnexus/scan.d.ts.map +1 -0
- package/lib/gitnexus/scan.js +249 -0
- package/lib/gitnexus/scan.js.map +1 -0
- package/lib/gitnexus/search.d.ts +167 -0
- package/lib/gitnexus/search.d.ts.map +1 -0
- package/lib/gitnexus/search.js +517 -0
- package/lib/gitnexus/search.js.map +1 -0
- package/lib/gitnexus/toolchain.d.ts +136 -0
- package/lib/gitnexus/toolchain.d.ts.map +1 -0
- package/lib/gitnexus/toolchain.js +251 -0
- package/lib/gitnexus/toolchain.js.map +1 -0
- package/lib/index.d.ts +98 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +252 -0
- package/lib/index.js.map +1 -0
- package/lib/routes/analyze.d.ts +41 -0
- package/lib/routes/analyze.d.ts.map +1 -0
- package/lib/routes/analyze.js +75 -0
- package/lib/routes/analyze.js.map +1 -0
- package/lib/routes/coverage.d.ts +52 -0
- package/lib/routes/coverage.d.ts.map +1 -0
- package/lib/routes/coverage.js +81 -0
- package/lib/routes/coverage.js.map +1 -0
- package/lib/routes/guard.d.ts +92 -0
- package/lib/routes/guard.d.ts.map +1 -0
- package/lib/routes/guard.js +187 -0
- package/lib/routes/guard.js.map +1 -0
- package/lib/routes/install.d.ts +27 -0
- package/lib/routes/install.d.ts.map +1 -0
- package/lib/routes/install.js +46 -0
- package/lib/routes/install.js.map +1 -0
- package/lib/routes/search.d.ts +27 -0
- package/lib/routes/search.d.ts.map +1 -0
- package/lib/routes/search.js +77 -0
- package/lib/routes/search.js.map +1 -0
- package/package.json +87 -4
- package/scripts/link-runtime.mjs +146 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/gitnexus/search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAyDjD,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAkB;IACtB,MAAM,CAAS;IAExB,YAAY,IAAqB,EAAE,MAAc,EAAE,OAAe;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAYD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;AAEhD;;;;;;GAMG;AACH,KAAK,UAAU,WAAW,CAAC,OAAsB;IAC/C,MAAM,IAAI,GAAG,gBAAgB,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1F,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB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AE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACnE,OAAO,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE;gBACpC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,KAAK,CAAC,OAAO;aACtB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether GitNexus is actually available on this machine.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS
|
|
5
|
+
* ---------------
|
|
6
|
+
* The plugin declares **no runtime dependencies** and never imports `gitnexus` as a
|
|
7
|
+
* module. It reads an index another tool produced and, when it can, deep-imports the
|
|
8
|
+
* upstream scan primitives at runtime. That design keeps the plugin a pure observer —
|
|
9
|
+
* but it means "the operator has no GitNexus" is a first-class reachable state, not
|
|
10
|
+
* an edge case, and nothing was checking for it.
|
|
11
|
+
*
|
|
12
|
+
* The consequence was not a crash. The engine degrades: `loadScanPrimitives` returns
|
|
13
|
+
* `null`, the local walker takes over, and the size caps fall back to their built-in
|
|
14
|
+
* defaults. The damage was in what the operator was **told**: with no index, the panel
|
|
15
|
+
* handed over `gitnexus analyze --index-only …` — a command that fails with
|
|
16
|
+
* `command not found` on a machine that has no GitNexus, presented as the next step.
|
|
17
|
+
*
|
|
18
|
+
* TWO SEPARATE QUESTIONS
|
|
19
|
+
* ----------------------
|
|
20
|
+
* The library tree and the CLI are different things and are reported separately,
|
|
21
|
+
* because they gate different promises:
|
|
22
|
+
*
|
|
23
|
+
* - **package root** — can this plugin reuse GitNexus's own scan rules and language
|
|
24
|
+
* detector, and are the numbers therefore authoritative?
|
|
25
|
+
* - **CLI on PATH** — will the maintenance command the panel hands over actually
|
|
26
|
+
* run when the operator pastes it?
|
|
27
|
+
*
|
|
28
|
+
* A `gitnexus` installed as a dependency but never linked globally satisfies the
|
|
29
|
+
* first and not the second, and collapsing them into one boolean would make the
|
|
30
|
+
* panel either over- or under-promise in that case.
|
|
31
|
+
*/
|
|
32
|
+
/** The probe order for a platform. Exported so a test can assert the ordering. */
|
|
33
|
+
export declare function cliShimNames(platform?: NodeJS.Platform): readonly string[];
|
|
34
|
+
/**
|
|
35
|
+
* The POSIX probe order, kept exported under its original name.
|
|
36
|
+
*
|
|
37
|
+
* Callers that need the real answer must use {@link cliShimNames}; this is the list
|
|
38
|
+
* for a platform where the extensionless shim is the correct one.
|
|
39
|
+
*/
|
|
40
|
+
export declare const CLI_SHIM_NAMES: readonly string[];
|
|
41
|
+
export interface CliProbeFound {
|
|
42
|
+
present: true;
|
|
43
|
+
/**
|
|
44
|
+
* Absolute path to the thing that runs the CLI.
|
|
45
|
+
*
|
|
46
|
+
* A `.js` script when it came from the declared `gitnexus` dependency — that
|
|
47
|
+
* package's `bin` is `dist/cli/index.js` — and a shim path when it came from PATH.
|
|
48
|
+
* `viaNode` says which, because the two need different command shapes: a script is
|
|
49
|
+
* spawned as `node <path>`, a shim is spawned directly (and on Windows needs the
|
|
50
|
+
* shell's call operator).
|
|
51
|
+
*/
|
|
52
|
+
cliPath: string;
|
|
53
|
+
/** Whether `cliPath` has to be run through `node`. */
|
|
54
|
+
viaNode: boolean;
|
|
55
|
+
/** Where this came from, so an unexpected pick can be diagnosed. */
|
|
56
|
+
source: 'override' | 'managed' | 'dependency' | 'path';
|
|
57
|
+
/** The package root it was resolved from, when it came from a dependency. */
|
|
58
|
+
packageRoot: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface CliProbeMissing {
|
|
61
|
+
present: false;
|
|
62
|
+
/** How many PATH entries were examined — evidence the probe actually ran. */
|
|
63
|
+
probedDirs: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* How much of GitNexus is available.
|
|
67
|
+
*
|
|
68
|
+
* `library-only` is the case worth naming: analysis is authoritative, but a handed-over
|
|
69
|
+
* command will not run as typed.
|
|
70
|
+
*/
|
|
71
|
+
export type ToolchainVerdict =
|
|
72
|
+
/** Both the library tree and a CLI shim are present. Every promise holds. */
|
|
73
|
+
'ready'
|
|
74
|
+
/** The library tree is present but no CLI shim was found on PATH. */
|
|
75
|
+
| 'library-only'
|
|
76
|
+
/** Neither was found: the plugin falls back to its own scan rules. */
|
|
77
|
+
| 'absent';
|
|
78
|
+
export interface ToolchainStatus {
|
|
79
|
+
/** Where the GitNexus package tree was found, if anywhere. */
|
|
80
|
+
packageRoot: string | null;
|
|
81
|
+
/** Version read from that tree's manifest, for provenance. */
|
|
82
|
+
packageVersion: string | null;
|
|
83
|
+
/** Whether a `gitnexus` executable is reachable through PATH. */
|
|
84
|
+
cli: CliProbeFound | CliProbeMissing;
|
|
85
|
+
verdict: ToolchainVerdict;
|
|
86
|
+
}
|
|
87
|
+
export interface ToolchainOptions {
|
|
88
|
+
env?: NodeJS.ProcessEnv;
|
|
89
|
+
moduleUrl?: string;
|
|
90
|
+
/** Platform whose shim naming applies. Defaults to the running one. */
|
|
91
|
+
platform?: NodeJS.Platform;
|
|
92
|
+
/**
|
|
93
|
+
* Where this plugin installs GitNexus when the operator asks it to.
|
|
94
|
+
*
|
|
95
|
+
* Checked before the dependency and PATH so that a copy the plugin installed is the
|
|
96
|
+
* one it uses: that copy is the only one whose version it chose, and finding a
|
|
97
|
+
* different one later would make the refresh behave differently from the install that
|
|
98
|
+
* preceded it.
|
|
99
|
+
*/
|
|
100
|
+
managedPrefix?: string;
|
|
101
|
+
/** Skips discovery entirely, returning an `absent` verdict — for tests. */
|
|
102
|
+
discover?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Resolve the `gitnexus` CLI this plugin will run.
|
|
106
|
+
*
|
|
107
|
+
* ORDER: explicit override, then the declared dependency, then PATH.
|
|
108
|
+
*
|
|
109
|
+
* The dependency comes first because the plugin now declares `gitnexus` as one, so it
|
|
110
|
+
* is present by construction and no PATH search is needed — the "is GitNexus installed"
|
|
111
|
+
* question stops being a runtime check and becomes an install-time guarantee. That was
|
|
112
|
+
* the whole point of taking the dependency: a check that always succeeds is not a check.
|
|
113
|
+
*
|
|
114
|
+
* PATH remains as the fallback rather than the primary, because a normal `npm install`
|
|
115
|
+
* of this plugin puts `gitnexus` beside it in `node_modules`, where PATH never looks.
|
|
116
|
+
* Keeping the search means a machine with a global install still works if the
|
|
117
|
+
* dependency somehow did not land, and it keeps this repository's own tests runnable
|
|
118
|
+
* without a 1 GB install.
|
|
119
|
+
*
|
|
120
|
+
* Does not execute anything. Spawning the CLI to ask its version would be the direct
|
|
121
|
+
* test, but a confined DSH process denies piped stdio (`spawn EPERM`), which is the
|
|
122
|
+
* same constraint that shaped the maintenance commands — so a probe that only stats the
|
|
123
|
+
* filesystem is the one that works everywhere this plugin runs.
|
|
124
|
+
*/
|
|
125
|
+
export declare function findGitnexusCli(options?: ToolchainOptions): CliProbeFound | CliProbeMissing;
|
|
126
|
+
/** Resolve the full picture: library tree, CLI shim, and the verdict they imply. */
|
|
127
|
+
export declare function readToolchainStatus(options?: ToolchainOptions): ToolchainStatus;
|
|
128
|
+
/**
|
|
129
|
+
* The one-line explanation the panel and the CLI show, or `null` when everything is
|
|
130
|
+
* present and there is nothing to warn about.
|
|
131
|
+
*
|
|
132
|
+
* Kept here rather than in the browser half so the CLI and the panel cannot describe
|
|
133
|
+
* the same machine state two different ways.
|
|
134
|
+
*/
|
|
135
|
+
export declare function toolchainNotice(status: ToolchainStatus): string | null;
|
|
136
|
+
//# sourceMappingURL=toolchain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolchain.d.ts","sourceRoot":"","sources":["../../src/gitnexus/toolchain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA2CH,kFAAkF;AAClF,wBAAg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;;GAoBG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,aAAa,GAAG,eAAe,CAkD/F;AAoDD,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CASnF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAgBtE"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether GitNexus is actually available on this machine.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS
|
|
5
|
+
* ---------------
|
|
6
|
+
* The plugin declares **no runtime dependencies** and never imports `gitnexus` as a
|
|
7
|
+
* module. It reads an index another tool produced and, when it can, deep-imports the
|
|
8
|
+
* upstream scan primitives at runtime. That design keeps the plugin a pure observer —
|
|
9
|
+
* but it means "the operator has no GitNexus" is a first-class reachable state, not
|
|
10
|
+
* an edge case, and nothing was checking for it.
|
|
11
|
+
*
|
|
12
|
+
* The consequence was not a crash. The engine degrades: `loadScanPrimitives` returns
|
|
13
|
+
* `null`, the local walker takes over, and the size caps fall back to their built-in
|
|
14
|
+
* defaults. The damage was in what the operator was **told**: with no index, the panel
|
|
15
|
+
* handed over `gitnexus analyze --index-only …` — a command that fails with
|
|
16
|
+
* `command not found` on a machine that has no GitNexus, presented as the next step.
|
|
17
|
+
*
|
|
18
|
+
* TWO SEPARATE QUESTIONS
|
|
19
|
+
* ----------------------
|
|
20
|
+
* The library tree and the CLI are different things and are reported separately,
|
|
21
|
+
* because they gate different promises:
|
|
22
|
+
*
|
|
23
|
+
* - **package root** — can this plugin reuse GitNexus's own scan rules and language
|
|
24
|
+
* detector, and are the numbers therefore authoritative?
|
|
25
|
+
* - **CLI on PATH** — will the maintenance command the panel hands over actually
|
|
26
|
+
* run when the operator pastes it?
|
|
27
|
+
*
|
|
28
|
+
* A `gitnexus` installed as a dependency but never linked globally satisfies the
|
|
29
|
+
* first and not the second, and collapsing them into one boolean would make the
|
|
30
|
+
* panel either over- or under-promise in that case.
|
|
31
|
+
*/
|
|
32
|
+
import { existsSync } from 'node:fs';
|
|
33
|
+
import { fileURLToPath } from 'node:url';
|
|
34
|
+
import path from 'node:path';
|
|
35
|
+
import { findGitnexusRoot, readGitnexusVersion } from './root.js';
|
|
36
|
+
/**
|
|
37
|
+
* Filenames a `gitnexus` CLI shim can have, in probe order **per platform**.
|
|
38
|
+
*
|
|
39
|
+
* Written out rather than derived from `PATHEXT`, for the reason `root.ts` already
|
|
40
|
+
* documents: under nvm-for-windows the shim is `gitnexus.ps1`, and `PATHEXT` does not
|
|
41
|
+
* list `.ps1`, so extension-driven discovery silently finds nothing on exactly the
|
|
42
|
+
* machines where the CLI is installed.
|
|
43
|
+
*
|
|
44
|
+
* ORDER IS PLATFORM-SPECIFIC, AND THAT IS THE WHOLE POINT
|
|
45
|
+
* ------------------------------------------------------
|
|
46
|
+
* npm writes three shims side by side: `gitnexus` (a `#!/bin/sh` script), `gitnexus.cmd`
|
|
47
|
+
* and `gitnexus.ps1`. The extensionless one is the POSIX entry point; on Windows it is
|
|
48
|
+
* inert. Measured on the reference machine:
|
|
49
|
+
*
|
|
50
|
+
* gitnexus -> no output, no exit status
|
|
51
|
+
* gitnexus.ps1 -> 1.6.12, exit 0
|
|
52
|
+
* gitnexus.cmd -> 1.6.12, exit 0
|
|
53
|
+
*
|
|
54
|
+
* A single order listing the extensionless name first — which is the natural way to
|
|
55
|
+
* write it — therefore selects a shim that cannot run on Windows, and the `.ps1`
|
|
56
|
+
* fix above it never gets a chance to help. The runner would build a command around
|
|
57
|
+
* that path and report a failure that has nothing to do with the repository.
|
|
58
|
+
*
|
|
59
|
+
* `.cmd` leads on Windows because it is the one a batch *or* a PowerShell host can
|
|
60
|
+
* spawn; `.ps1` follows for installs that ship only that.
|
|
61
|
+
*/
|
|
62
|
+
const WINDOWS_SHIM_NAMES = [
|
|
63
|
+
'gitnexus.cmd',
|
|
64
|
+
'gitnexus.exe',
|
|
65
|
+
'gitnexus.bat',
|
|
66
|
+
'gitnexus.ps1',
|
|
67
|
+
'gitnexus',
|
|
68
|
+
];
|
|
69
|
+
const POSIX_SHIM_NAMES = ['gitnexus'];
|
|
70
|
+
/** The probe order for a platform. Exported so a test can assert the ordering. */
|
|
71
|
+
export function cliShimNames(platform = process.platform) {
|
|
72
|
+
return platform === 'win32' ? WINDOWS_SHIM_NAMES : POSIX_SHIM_NAMES;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The POSIX probe order, kept exported under its original name.
|
|
76
|
+
*
|
|
77
|
+
* Callers that need the real answer must use {@link cliShimNames}; this is the list
|
|
78
|
+
* for a platform where the extensionless shim is the correct one.
|
|
79
|
+
*/
|
|
80
|
+
export const CLI_SHIM_NAMES = POSIX_SHIM_NAMES;
|
|
81
|
+
/**
|
|
82
|
+
* The effective `PATH`, whatever the platform spells it.
|
|
83
|
+
*
|
|
84
|
+
* `process.env` is a case-insensitive proxy — `process.env.PATH` resolves on Windows
|
|
85
|
+
* even though the variable is stored as `Path`. **Spreading it into a plain object
|
|
86
|
+
* drops that**, so `{ ...process.env }.PATH` is `undefined` on the default Windows
|
|
87
|
+
* layout and the probe walks zero directories while reporting a plausible-looking
|
|
88
|
+
* miss. That is how this was found: the runner reported "no gitnexus" on a machine
|
|
89
|
+
* where `gitnexus` runs, with `probedDirs: 0` as the only clue.
|
|
90
|
+
*
|
|
91
|
+
* Caller-supplied values still win, checked in the same three spellings so an
|
|
92
|
+
* override cannot be lost the same way.
|
|
93
|
+
*/
|
|
94
|
+
function effectivePath(override) {
|
|
95
|
+
const pick = (source) => {
|
|
96
|
+
if (source === undefined)
|
|
97
|
+
return undefined;
|
|
98
|
+
return source.PATH ?? source.Path ?? source.path;
|
|
99
|
+
};
|
|
100
|
+
return pick(override) ?? pick(process.env) ?? '';
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Resolve the `gitnexus` CLI this plugin will run.
|
|
104
|
+
*
|
|
105
|
+
* ORDER: explicit override, then the declared dependency, then PATH.
|
|
106
|
+
*
|
|
107
|
+
* The dependency comes first because the plugin now declares `gitnexus` as one, so it
|
|
108
|
+
* is present by construction and no PATH search is needed — the "is GitNexus installed"
|
|
109
|
+
* question stops being a runtime check and becomes an install-time guarantee. That was
|
|
110
|
+
* the whole point of taking the dependency: a check that always succeeds is not a check.
|
|
111
|
+
*
|
|
112
|
+
* PATH remains as the fallback rather than the primary, because a normal `npm install`
|
|
113
|
+
* of this plugin puts `gitnexus` beside it in `node_modules`, where PATH never looks.
|
|
114
|
+
* Keeping the search means a machine with a global install still works if the
|
|
115
|
+
* dependency somehow did not land, and it keeps this repository's own tests runnable
|
|
116
|
+
* without a 1 GB install.
|
|
117
|
+
*
|
|
118
|
+
* Does not execute anything. Spawning the CLI to ask its version would be the direct
|
|
119
|
+
* test, but a confined DSH process denies piped stdio (`spawn EPERM`), which is the
|
|
120
|
+
* same constraint that shaped the maintenance commands — so a probe that only stats the
|
|
121
|
+
* filesystem is the one that works everywhere this plugin runs.
|
|
122
|
+
*/
|
|
123
|
+
export function findGitnexusCli(options = {}) {
|
|
124
|
+
if (options.discover === false)
|
|
125
|
+
return { present: false, probedDirs: 0 };
|
|
126
|
+
const platform = options.platform ?? process.platform;
|
|
127
|
+
// An explicit override wins, so a machine with a non-standard layout — or a test —
|
|
128
|
+
// can name the executable directly.
|
|
129
|
+
const explicit = options.env?.GITNEXUS_CLI ?? process.env.GITNEXUS_CLI;
|
|
130
|
+
if (typeof explicit === 'string' && explicit !== '' && existsSync(explicit)) {
|
|
131
|
+
return {
|
|
132
|
+
present: true,
|
|
133
|
+
cliPath: explicit,
|
|
134
|
+
viaNode: explicit.endsWith('.js'),
|
|
135
|
+
source: 'override',
|
|
136
|
+
packageRoot: null,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// The copy this plugin installed, when there is one. Ahead of the dependency and PATH
|
|
140
|
+
// because it is the only copy whose version this plugin chose: finding a different one
|
|
141
|
+
// afterwards would make the refresh behave differently from the install before it.
|
|
142
|
+
const managed = options.managedPrefix;
|
|
143
|
+
if (typeof managed === 'string' && managed !== '') {
|
|
144
|
+
const script = path.join(managed, 'node_modules', 'gitnexus', 'dist', 'cli', 'index.js');
|
|
145
|
+
try {
|
|
146
|
+
if (existsSync(script)) {
|
|
147
|
+
return { present: true, cliPath: script, viaNode: true, source: 'managed', packageRoot: path.join(managed, 'node_modules', 'gitnexus') };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
/* unreadable managed tree — fall through to the other sources */
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const fromDependency = resolveDependencyCli(options);
|
|
155
|
+
if (fromDependency !== null)
|
|
156
|
+
return fromDependency;
|
|
157
|
+
const entries = effectivePath(options.env).split(path.delimiter).filter((dir) => dir !== '');
|
|
158
|
+
for (const dir of entries) {
|
|
159
|
+
for (const name of cliShimNames(platform)) {
|
|
160
|
+
const candidate = path.join(dir, name);
|
|
161
|
+
try {
|
|
162
|
+
if (existsSync(candidate)) {
|
|
163
|
+
return { present: true, cliPath: candidate, viaNode: false, source: 'path', packageRoot: null };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
/* unreadable PATH entry — keep looking */
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return { present: false, probedDirs: entries.length };
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The CLI shipped inside the `gitnexus` dependency, if it is installed.
|
|
175
|
+
*
|
|
176
|
+
* Resolved by walking up from this module rather than by asking Node to resolve the
|
|
177
|
+
* package name, because these modules are CommonJS-compiled and a bare `require` of an
|
|
178
|
+
* ESM-only package would throw for a reason unrelated to whether the file exists. Each
|
|
179
|
+
* candidate is a plain `node_modules/gitnexus` directory on the way to the filesystem
|
|
180
|
+
* root, which is exactly where npm and pnpm put it.
|
|
181
|
+
*/
|
|
182
|
+
function resolveDependencyCli(options) {
|
|
183
|
+
const startDir = options.moduleUrl === undefined ? undefined : safeDirname(options.moduleUrl);
|
|
184
|
+
let dir = startDir ?? undefined;
|
|
185
|
+
// `import.meta.url` is only available in the host half, so the caller may not pass
|
|
186
|
+
// one; without a starting point there is nothing to walk and PATH is the answer.
|
|
187
|
+
if (dir === undefined)
|
|
188
|
+
return null;
|
|
189
|
+
for (let depth = 0; depth < 24; depth += 1) {
|
|
190
|
+
const candidateRoot = path.join(dir, 'node_modules', 'gitnexus');
|
|
191
|
+
const manifest = path.join(candidateRoot, 'package.json');
|
|
192
|
+
const script = path.join(candidateRoot, 'dist', 'cli', 'index.js');
|
|
193
|
+
try {
|
|
194
|
+
if (existsSync(manifest) && existsSync(script)) {
|
|
195
|
+
return {
|
|
196
|
+
present: true,
|
|
197
|
+
cliPath: script,
|
|
198
|
+
viaNode: true,
|
|
199
|
+
source: 'dependency',
|
|
200
|
+
packageRoot: candidateRoot,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
/* unreadable directory — keep walking up */
|
|
206
|
+
}
|
|
207
|
+
const parent = path.dirname(dir);
|
|
208
|
+
if (parent === dir)
|
|
209
|
+
break;
|
|
210
|
+
dir = parent;
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
/** Directory of one module url, or `undefined` when it cannot be read as a path. */
|
|
215
|
+
function safeDirname(moduleUrl) {
|
|
216
|
+
try {
|
|
217
|
+
return path.dirname(fileURLToPath(moduleUrl));
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** Resolve the full picture: library tree, CLI shim, and the verdict they imply. */
|
|
224
|
+
export function readToolchainStatus(options = {}) {
|
|
225
|
+
const packageRoot = findGitnexusRoot(options);
|
|
226
|
+
const packageVersion = packageRoot === null ? null : readGitnexusVersion(packageRoot);
|
|
227
|
+
const cli = findGitnexusCli(options);
|
|
228
|
+
const verdict = packageRoot !== null && cli.present ? 'ready' : packageRoot !== null ? 'library-only' : 'absent';
|
|
229
|
+
return { packageRoot, packageVersion, cli, verdict };
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The one-line explanation the panel and the CLI show, or `null` when everything is
|
|
233
|
+
* present and there is nothing to warn about.
|
|
234
|
+
*
|
|
235
|
+
* Kept here rather than in the browser half so the CLI and the panel cannot describe
|
|
236
|
+
* the same machine state two different ways.
|
|
237
|
+
*/
|
|
238
|
+
export function toolchainNotice(status) {
|
|
239
|
+
switch (status.verdict) {
|
|
240
|
+
case 'ready':
|
|
241
|
+
return null;
|
|
242
|
+
case 'library-only':
|
|
243
|
+
return ('本机有 GitNexus 库但没有 gitnexus 命令(可能只作为依赖安装、未全局链接)。' +
|
|
244
|
+
'下面的命令需要先 `npm i -g gitnexus` 才能直接执行。');
|
|
245
|
+
case 'absent':
|
|
246
|
+
return ('本机没有 GitNexus。扫描规则来自本插件内置的回退实现,' +
|
|
247
|
+
'与 GitNexus 自身的忽略规则不完全一致,覆盖差异数字仅供参考。' +
|
|
248
|
+
'初始化索引需要先安装:`npm i -g gitnexus`。');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=toolchain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolchain.js","sourceRoot":"","sources":["../../src/gitnexus/toolchain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,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;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,QAAQ,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC;QACd,KAAK,cAAc;YACjB,OAAO,CACL,iDAAiD;gBACjD,sCAAsC,CACvC,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO,CACL,iCAAiC;gBACjC,qCAAqC;gBACrC,iCAAiC,CAClC,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-gitnexus-plus —host half.
|
|
3
|
+
*
|
|
4
|
+
* Registers one read-only tool and one loopback HTTP route over the coverage
|
|
5
|
+
* engine in `./gitnexus/`. Both answer the same question —"what did this index
|
|
6
|
+
* leave out?" —for the two callers that need it: the model, and a browser half
|
|
7
|
+
* that will render it.
|
|
8
|
+
*
|
|
9
|
+
* The read path is still never allowed to change anything: a status check must not
|
|
10
|
+
* start a 30-second rebuild. The two mutating capabilities are separate routes with
|
|
11
|
+
* their own guards, and both go through the host's shell executor rather than
|
|
12
|
+
* spawning from the read path. Keyword search is a third read-only route over the
|
|
13
|
+
* graph itself; the tool above stays read-only.
|
|
14
|
+
*/
|
|
15
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
16
|
+
import { type MaintenanceCommand } from './gitnexus/commands.js';
|
|
17
|
+
export declare const name = "gitnexus-plus";
|
|
18
|
+
/**
|
|
19
|
+
* Only `tools` is required. `webServer` is reached through `ctx.inject` because a
|
|
20
|
+
* headless profile has no HTTP carrier at all —naming it here would leave the
|
|
21
|
+
* plugin permanently pending there, and the tool would never register.
|
|
22
|
+
*/
|
|
23
|
+
export declare const inject: readonly ["tools"];
|
|
24
|
+
/** The shape `Schema.object` infers below, named for use in signatures. */
|
|
25
|
+
export interface PluginConfig {
|
|
26
|
+
scanDefaultCapKb: number;
|
|
27
|
+
minifiedSampleLimit: number;
|
|
28
|
+
serveRoutes: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Shapes the maintenance commands the panel hands to the operator. `memoryOff`
|
|
31
|
+
* defaults on because the CLI otherwise re-spawns itself over piped stdio, which
|
|
32
|
+
* a confined process denies.
|
|
33
|
+
*
|
|
34
|
+
* `skipFts: false` (default) means **automatic**: the plugin skips FTS when the
|
|
35
|
+
* index does not have it, and omits the flag when it does. Both static values were
|
|
36
|
+
* measured wrong on a real machine: `true` forces a 21x full rebuild on an FTS
|
|
37
|
+
* index, while an unconditional `false` makes a refresh on a non-FTS index die
|
|
38
|
+
* with `spawn EPERM` when the extension tries to install out-of-process. `true`
|
|
39
|
+
* here forces the flag for an operator who needs it.
|
|
40
|
+
*/
|
|
41
|
+
skipFts: boolean;
|
|
42
|
+
memoryOff: boolean;
|
|
43
|
+
analyzeHeapMb: number;
|
|
44
|
+
/**
|
|
45
|
+
* Wall-clock ceiling for a run this plugin starts.
|
|
46
|
+
*
|
|
47
|
+
* Ten minutes, because the escape hatch this panel offers is a full rebuild and
|
|
48
|
+
* those are measured in minutes on a large repository. Too short a ceiling turns
|
|
49
|
+
* the feature into "it always times out on the repos that need it most"; the run
|
|
50
|
+
* is cancellable, so the cost of it being generous is bounded by the operator.
|
|
51
|
+
*/
|
|
52
|
+
analyzeTimeoutMs: number;
|
|
53
|
+
/**
|
|
54
|
+
* Where the plugin installs GitNexus when asked. Empty means the default,
|
|
55
|
+
* `$DSH_HOME/gitnexus-plus/gitnexus`.
|
|
56
|
+
*/
|
|
57
|
+
gitnexusInstallDir: string;
|
|
58
|
+
/** Wall-clock ceiling for that install. Compiling native modules is slow. */
|
|
59
|
+
installTimeoutMs: number;
|
|
60
|
+
/**
|
|
61
|
+
* Redirect for GitNexus's global registry write. Empty means
|
|
62
|
+
* `<project>/.gitnexus/plugin-home`, inside the workspace. The global
|
|
63
|
+
* `~/.gitnexus` is outside a confined host's writable scope, and a refresh that
|
|
64
|
+
* dies on the registry write leaves the index incomplete.
|
|
65
|
+
*/
|
|
66
|
+
gitnexusHome: string;
|
|
67
|
+
}
|
|
68
|
+
export declare const Config: import("@deepseek-ai/schemastery").SchemaLike<{
|
|
69
|
+
scanDefaultCapKb: number;
|
|
70
|
+
minifiedSampleLimit: number;
|
|
71
|
+
serveRoutes: boolean;
|
|
72
|
+
skipFts: boolean;
|
|
73
|
+
memoryOff: boolean;
|
|
74
|
+
analyzeHeapMb: number;
|
|
75
|
+
analyzeTimeoutMs: number;
|
|
76
|
+
gitnexusInstallDir: string;
|
|
77
|
+
installTimeoutMs: number;
|
|
78
|
+
gitnexusHome: string;
|
|
79
|
+
}>;
|
|
80
|
+
/** The maintenance payload the panel renders alongside a report. */
|
|
81
|
+
export interface MaintenanceInfo {
|
|
82
|
+
commands: MaintenanceCommand[];
|
|
83
|
+
rationale: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Whether the mounted analyze route understands `force=1`. The client uses it to
|
|
86
|
+
* avoid offering a full-rebuild button against an older host, where that flag was
|
|
87
|
+
* ignored and the button would silently run an incremental refresh instead.
|
|
88
|
+
*/
|
|
89
|
+
supportsForce: true;
|
|
90
|
+
}
|
|
91
|
+
export declare function apply(ctx: Context, config: PluginConfig): void;
|
|
92
|
+
/**
|
|
93
|
+
* Human-readable rendering lives in `./gitnexus/format.js` —free of DSH imports
|
|
94
|
+
* so it can be tested without a host. Re-exported here for callers that already
|
|
95
|
+
* hold the plugin module.
|
|
96
|
+
*/
|
|
97
|
+
export { formatReport } from './gitnexus/format.js';
|
|
98
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAuBhC,eAAO,MAAM,IAAI,kBAAkB,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,MAAM,oBAAqB,CAAC;AAEzC,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;EAWjB,CAAC;AAqBH,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,aAAa,EAAE,IAAI,CAAC;CACrB;AAiBD,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA+L9D;AAED;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|