dsh-gitnexus-plus 0.1.2 → 0.1.4
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/README-CN.md +189 -0
- package/README.md +219 -597
- package/lib/bin/graph-helper.d.ts +21 -0
- package/lib/bin/graph-helper.d.ts.map +1 -0
- package/lib/bin/graph-helper.js +71 -0
- package/lib/bin/graph-helper.js.map +1 -0
- package/lib/client.js +4107 -2029
- package/lib/gitnexus/analyze.d.ts +48 -8
- package/lib/gitnexus/analyze.d.ts.map +1 -1
- package/lib/gitnexus/analyze.js +376 -75
- package/lib/gitnexus/analyze.js.map +1 -1
- package/lib/gitnexus/commands.d.ts +8 -1
- package/lib/gitnexus/commands.d.ts.map +1 -1
- package/lib/gitnexus/commands.js +19 -0
- package/lib/gitnexus/commands.js.map +1 -1
- package/lib/gitnexus/coverage.d.ts +16 -0
- package/lib/gitnexus/coverage.d.ts.map +1 -1
- package/lib/gitnexus/coverage.js +58 -1
- package/lib/gitnexus/coverage.js.map +1 -1
- package/lib/gitnexus/delta.d.ts +144 -0
- package/lib/gitnexus/delta.d.ts.map +1 -0
- package/lib/gitnexus/delta.js +347 -0
- package/lib/gitnexus/delta.js.map +1 -0
- package/lib/gitnexus/git-activity.d.ts +77 -0
- package/lib/gitnexus/git-activity.d.ts.map +1 -1
- package/lib/gitnexus/git-activity.js +327 -8
- package/lib/gitnexus/git-activity.js.map +1 -1
- package/lib/gitnexus/graph.d.ts +126 -0
- package/lib/gitnexus/graph.d.ts.map +1 -0
- package/lib/gitnexus/graph.js +472 -0
- package/lib/gitnexus/graph.js.map +1 -0
- package/lib/gitnexus/root.d.ts +0 -3
- package/lib/gitnexus/root.d.ts.map +1 -1
- package/lib/gitnexus/root.js +64 -5
- package/lib/gitnexus/root.js.map +1 -1
- package/lib/gitnexus/scan.d.ts +2 -0
- package/lib/gitnexus/scan.d.ts.map +1 -1
- package/lib/gitnexus/scan.js +3 -2
- package/lib/gitnexus/scan.js.map +1 -1
- package/lib/gitnexus/search.d.ts +21 -8
- package/lib/gitnexus/search.d.ts.map +1 -1
- package/lib/gitnexus/search.js +87 -13
- package/lib/gitnexus/search.js.map +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +170 -2
- package/lib/index.js.map +1 -1
- package/lib/routes/analyze.d.ts +3 -2
- package/lib/routes/analyze.d.ts.map +1 -1
- package/lib/routes/analyze.js +8 -2
- package/lib/routes/analyze.js.map +1 -1
- package/lib/routes/coverage.d.ts +2 -1
- package/lib/routes/coverage.d.ts.map +1 -1
- package/lib/routes/coverage.js +53 -1
- package/lib/routes/coverage.js.map +1 -1
- package/lib/routes/delta.d.ts +22 -0
- package/lib/routes/delta.d.ts.map +1 -0
- package/lib/routes/delta.js +50 -0
- package/lib/routes/delta.js.map +1 -0
- package/lib/routes/file-diff.d.ts +19 -0
- package/lib/routes/file-diff.d.ts.map +1 -0
- package/lib/routes/file-diff.js +69 -0
- package/lib/routes/file-diff.js.map +1 -0
- package/lib/routes/file-history.d.ts +21 -0
- package/lib/routes/file-history.d.ts.map +1 -0
- package/lib/routes/file-history.js +69 -0
- package/lib/routes/file-history.js.map +1 -0
- package/lib/routes/graph.d.ts +22 -0
- package/lib/routes/graph.d.ts.map +1 -0
- package/lib/routes/graph.js +71 -0
- package/lib/routes/graph.js.map +1 -0
- package/package.json +3 -2
|
@@ -21,11 +21,18 @@
|
|
|
21
21
|
*
|
|
22
22
|
* THE ONE RULE THAT MATTERS
|
|
23
23
|
* -------------------------
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* This runner never **constructs** a sandbox policy and never chooses a mode. It may
|
|
25
|
+
* forward a policy the host resolved (`options.sandboxPolicy`), and the host may only
|
|
26
|
+
* fill in the workspace root — see `src/index.ts`. The reason is measured, not
|
|
27
|
+
* theoretical: an agentless route has no session, so `sandboxPolicy.resolve()` falls
|
|
28
|
+
* back to `config.workspaceRoot ?? process.cwd()` and the sandbox derives its write
|
|
29
|
+
* capability SID from *that* path. The repository's own grant then never applies, and
|
|
30
|
+
* every write inside `.gitnexus` is refused — the failure this plugin reported as
|
|
31
|
+
* "sandbox denies .gitnexus". Supplying the workspace root is not escalation: the mode
|
|
32
|
+
* still comes from the deployment, and a read-only deployment stays read-only.
|
|
33
|
+
*
|
|
34
|
+
* A denial is reported as a denial, not retried wider: the same rule the subagent
|
|
35
|
+
* prompt states, for the same reason.
|
|
29
36
|
*/
|
|
30
37
|
import { type ToolchainOptions } from './toolchain.js';
|
|
31
38
|
/** Where a run got to. `unavailable` is decided before anything is spawned. */
|
|
@@ -41,8 +48,16 @@ export interface AnalyzeStatus {
|
|
|
41
48
|
state: AnalyzeState;
|
|
42
49
|
/** Whether this run was a full rebuild (`--force`). */
|
|
43
50
|
force: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether this run repaired the search indexes (`--repair-fts`) instead of
|
|
53
|
+
* re-analysing. Mutually exclusive with `force`: they ask for opposite things, and
|
|
54
|
+
* the route never sets both.
|
|
55
|
+
*/
|
|
56
|
+
repairFts: boolean;
|
|
44
57
|
/** The command as run, so a failure can be reproduced by hand. */
|
|
45
58
|
command: string;
|
|
59
|
+
/** How many times the command was spawned. 2 means the transient-lock retry ran. */
|
|
60
|
+
attempts: number;
|
|
46
61
|
startedAt: number;
|
|
47
62
|
finishedAt: number | null;
|
|
48
63
|
exitCode: number | null;
|
|
@@ -64,6 +79,12 @@ export interface ShellRequestLike {
|
|
|
64
79
|
onExpiry?: 'kill' | 'none';
|
|
65
80
|
stdoutMaxBytes?: number;
|
|
66
81
|
signal?: AbortSignal;
|
|
82
|
+
/**
|
|
83
|
+
* A policy the host resolved for this call. The runner forwards it unchanged and
|
|
84
|
+
* never builds one; see the module comment for why the workspace root has to travel
|
|
85
|
+
* with the call at all.
|
|
86
|
+
*/
|
|
87
|
+
sandboxPolicy?: unknown;
|
|
67
88
|
}
|
|
68
89
|
export interface ShellResultLike {
|
|
69
90
|
exitCode?: number | null;
|
|
@@ -116,22 +137,39 @@ export interface AnalyzeRunnerOptions {
|
|
|
116
137
|
* measured to fail with `spawn EPERM` on an index without FTS (the extension tries
|
|
117
138
|
* to install out-of-process), while a static `true` forces a full rebuild on one
|
|
118
139
|
* that has it.
|
|
140
|
+
*
|
|
141
|
+
* Ignored when `repairFts` is requested: that run exists to build the FTS indexes,
|
|
142
|
+
* so skipping them would make it a no-op with a success exit code.
|
|
119
143
|
*/
|
|
120
144
|
skipFts?: boolean;
|
|
121
145
|
/** Override the redirect of the global registry write. */
|
|
122
146
|
gitnexusHome?: string | null;
|
|
147
|
+
/**
|
|
148
|
+
* Wait before the single transient-lock retry. Short in tests, long enough in
|
|
149
|
+
* production for a scanner that briefly holds `.gitnexus` to let go.
|
|
150
|
+
*/
|
|
151
|
+
retryDelayMs?: number;
|
|
152
|
+
/**
|
|
153
|
+
* The sandbox policy for one repository, resolved by the host.
|
|
154
|
+
*
|
|
155
|
+
* Optional: a deployment without a `sandboxPolicy` service passes nothing, and the
|
|
156
|
+
* shell keeps its own default. The runner does not inspect or alter the value.
|
|
157
|
+
*/
|
|
158
|
+
sandboxPolicy?: (repoPath: string) => unknown;
|
|
123
159
|
now?: () => number;
|
|
124
160
|
}
|
|
125
161
|
export interface AnalyzeRunner {
|
|
126
162
|
/**
|
|
127
163
|
* Begin a run, or report the one already in flight for this repository.
|
|
128
164
|
*
|
|
129
|
-
* `force` selects a full rebuild
|
|
130
|
-
* processes on one store contend, so a
|
|
131
|
-
* in flight returns that run
|
|
165
|
+
* `force` selects a full rebuild and `repairFts` selects an FTS-only repair. They are
|
|
166
|
+
* requests, not additional runs: two analyze processes on one store contend, so a
|
|
167
|
+
* request while a run is in flight returns that run — and `repairFts` wins over
|
|
168
|
+
* `force` when a caller passes both, because repairing is the smaller claim.
|
|
132
169
|
*/
|
|
133
170
|
start(repoPath: string, options?: {
|
|
134
171
|
force?: boolean;
|
|
172
|
+
repairFts?: boolean;
|
|
135
173
|
}): AnalyzeStatus;
|
|
136
174
|
status(repoPath: string): AnalyzeStatus | null;
|
|
137
175
|
cancel(repoPath: string): boolean;
|
|
@@ -165,6 +203,8 @@ export declare function analyzeCommandLine(cliPath: string, repoPath: string, op
|
|
|
165
203
|
viaNode?: boolean;
|
|
166
204
|
/** Full rebuild. This is the destructive escape hatch; the button must say so. */
|
|
167
205
|
force?: boolean;
|
|
206
|
+
/** Repair the search (FTS) indexes only. Never combined with `skipFts`. */
|
|
207
|
+
repairFts?: boolean;
|
|
168
208
|
/** Must match `maintenanceCommands`; see the note on the runner option. */
|
|
169
209
|
skipFts?: boolean;
|
|
170
210
|
gitnexusHome?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/gitnexus/analyze.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/gitnexus/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAKH,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExE,+EAA+E;AAC/E,MAAM,MAAM,YAAY;AACtB,oEAAoE;AAClE,aAAa,GACb,SAAS,GACT,MAAM;AACR,2CAA2C;GACzC,QAAQ,GACR,WAAW,GACX,WAAW;AACb,kEAAkE;GAChE,QAAQ,CAAC;AAEb,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;IACpB,uDAAuD;IACvD,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU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