@linxin666/dsh-remote-web-ui 0.4.2 → 0.4.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 (69) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +8 -6
  3. package/README.zh.md +8 -6
  4. package/lib/client.js +154 -594
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +323 -908
  7. package/lib/types/client/RemoteEntry.d.ts.map +1 -1
  8. package/lib/types/client/RemoteEntry.js +8 -9
  9. package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
  10. package/lib/types/client/RemoteSettingsCard.js +1 -1
  11. package/lib/types/client/index.d.ts +32 -3
  12. package/lib/types/client/index.d.ts.map +1 -1
  13. package/lib/types/client/index.js +51 -8
  14. package/lib/types/client/locales.d.ts +0 -84
  15. package/lib/types/client/locales.d.ts.map +1 -1
  16. package/lib/types/client/locales.js +0 -84
  17. package/lib/types/client/settings-entry-form.d.ts +50 -0
  18. package/lib/types/client/settings-entry-form.d.ts.map +1 -0
  19. package/lib/types/client/settings-entry-form.js +98 -0
  20. package/lib/types/index.d.ts +99 -7
  21. package/lib/types/index.d.ts.map +1 -1
  22. package/lib/types/index.js +104 -137
  23. package/lib/types/lan-bind-plan.d.ts +14 -0
  24. package/lib/types/lan-bind-plan.d.ts.map +1 -1
  25. package/lib/types/lan-bind-plan.js +16 -0
  26. package/lib/types/lan-bind.d.ts +1 -1
  27. package/lib/types/lan-bind.js +1 -1
  28. package/lib/types/mount-once.d.ts +38 -7
  29. package/lib/types/mount-once.d.ts.map +1 -1
  30. package/lib/types/mount-once.js +96 -12
  31. package/lib/types/tunnel.d.ts +60 -3
  32. package/lib/types/tunnel.d.ts.map +1 -1
  33. package/lib/types/tunnel.js +136 -3
  34. package/package.json +2 -2
  35. package/src/client/RemoteEntry.tsx +7 -9
  36. package/src/client/RemoteSettingsCard.tsx +0 -2
  37. package/src/client/index.ts +53 -9
  38. package/src/client/locales.ts +0 -84
  39. package/src/client/remote.module.css +50 -200
  40. package/src/client/settings-entry-form.ts +142 -0
  41. package/src/index.ts +156 -152
  42. package/src/lan-bind-plan.ts +22 -0
  43. package/src/lan-bind.ts +1 -1
  44. package/src/mount-once.ts +107 -13
  45. package/src/tunnel.ts +142 -3
  46. package/lib/types/client/UpdateEntry.d.ts +0 -14
  47. package/lib/types/client/UpdateEntry.d.ts.map +0 -1
  48. package/lib/types/client/UpdateEntry.js +0 -112
  49. package/lib/types/client/UpdatePanel.d.ts +0 -42
  50. package/lib/types/client/UpdatePanel.d.ts.map +0 -1
  51. package/lib/types/client/UpdatePanel.js +0 -101
  52. package/lib/types/client/update-api.d.ts +0 -29
  53. package/lib/types/client/update-api.d.ts.map +0 -1
  54. package/lib/types/client/update-api.js +0 -47
  55. package/lib/types/console-output.d.ts +0 -41
  56. package/lib/types/console-output.d.ts.map +0 -1
  57. package/lib/types/console-output.js +0 -89
  58. package/lib/types/update-routes.d.ts +0 -30
  59. package/lib/types/update-routes.d.ts.map +0 -1
  60. package/lib/types/update-routes.js +0 -47
  61. package/lib/types/update.d.ts +0 -282
  62. package/lib/types/update.d.ts.map +0 -1
  63. package/lib/types/update.js +0 -773
  64. package/src/client/UpdateEntry.tsx +0 -144
  65. package/src/client/UpdatePanel.tsx +0 -256
  66. package/src/client/update-api.ts +0 -49
  67. package/src/console-output.ts +0 -97
  68. package/src/update-routes.ts +0 -65
  69. package/src/update.ts +0 -915
@@ -1,89 +0,0 @@
1
- // Generated by scripts/sync-shared.mjs from shared/host/console-output.ts. Do not edit this copy; edit the shared source and run "node scripts/sync-shared.mjs".
2
- /**
3
- * Console-output capture shared by the family's Host halves.
4
- *
5
- * A child process's stdout/stderr are raw bytes, and on Windows a console
6
- * program writes the OEM code page (CP936/GBK on a zh-CN system), not UTF-8.
7
- * Decoding each chunk on its own corrupts the text twice over: the
8
- * encoding is guessed wrong, and a multi-byte character split across two reads
9
- * decodes into two replacement characters. This capture accumulates raw bytes
10
- * under a byte budget and decodes exactly once, at read time.
11
- */
12
- /** Count the U+FFFD replacement characters one candidate decode produced. */
13
- function replacementCount(text) {
14
- let count = 0;
15
- for (const character of text) {
16
- if (character === '\uFFFD')
17
- count += 1;
18
- }
19
- return count;
20
- }
21
- /**
22
- * Decode one console byte buffer. Strict UTF-8 wins whenever it is valid;
23
- * otherwise the bytes are not UTF-8 at all and the console wrote its own code
24
- * page, so the candidate that loses the least text is taken.
25
- * @param bytes - the captured bytes.
26
- * @returns the decoded text.
27
- */
28
- export function decodeConsoleBytes(bytes) {
29
- try {
30
- return new TextDecoder('utf-8', { fatal: true }).decode(bytes);
31
- }
32
- catch {
33
- // Not valid UTF-8. Prefer whichever candidate leaves the fewest
34
- // replacement characters so real UTF-8 text carrying one bad byte is not
35
- // rewritten wholesale as GBK gibberish; without the legacy code page
36
- // (small-ICU builds) the lenient UTF-8 pass is all that is left.
37
- let best;
38
- let bestLoss = Number.POSITIVE_INFINITY;
39
- for (const label of ['gbk', 'utf-8']) {
40
- let text;
41
- try {
42
- text = new TextDecoder(label).decode(bytes);
43
- }
44
- catch {
45
- continue;
46
- }
47
- const loss = replacementCount(text);
48
- if (loss < bestLoss) {
49
- best = text;
50
- bestLoss = loss;
51
- }
52
- }
53
- /* v8 ignore next 3 -- reachable only without the legacy code page AND without the lenient pass */
54
- if (best === undefined)
55
- return Buffer.from(bytes).toString('utf8');
56
- return best;
57
- }
58
- }
59
- /**
60
- * Create a capture bounded to a byte budget. Overflow drops from the FRONT
61
- * (the tail is what carries a failure reason), and the cut never lands inside
62
- * a character: leading UTF-8 continuation bytes are dropped with it, and a
63
- * legacy code page's dangling lead byte — indistinguishable from a real byte
64
- * without knowing the encoding until the whole buffer is decoded — is removed
65
- * with the one replacement character it produced, so an over-long stream still
66
- * reads cleanly at the seam.
67
- * @param maxBytes - maximum retained bytes.
68
- * @returns the capture.
69
- */
70
- export function createOutputCapture(maxBytes) {
71
- let buffer = Buffer.alloc(0);
72
- let trimmed = false;
73
- return {
74
- push(chunk) {
75
- buffer = buffer.length === 0 ? Buffer.from(chunk) : Buffer.concat([buffer, Buffer.from(chunk)]);
76
- if (buffer.length <= maxBytes)
77
- return;
78
- let start = buffer.length - maxBytes;
79
- while (start < buffer.length && (buffer[start] & 0xc0) === 0x80)
80
- start += 1;
81
- buffer = Buffer.from(buffer.subarray(start));
82
- trimmed = true;
83
- },
84
- read() {
85
- const text = decodeConsoleBytes(buffer);
86
- return trimmed && text.startsWith('\uFFFD') ? text.slice(1) : text;
87
- },
88
- };
89
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * The /api/update route family: the status probe and the update run. Both
3
- * are loopback-only control surfaces — the run endpoint triggers a real
4
- * pnpm install inside the owning profile, so it must never be reachable
5
- * from a LAN/phone origin.
6
- */
7
- import type { IncomingMessage } from 'node:http';
8
- import type { WebRoute } from '@deepseek-ai/dsh-host-webserver';
9
- import type { UpdateRunResult, UpdateStatus } from './update.ts';
10
- /** Route paths (exact matches under /api). */
11
- export declare const UPDATE_PATHS: {
12
- readonly status: "/api/update/status";
13
- readonly run: "/api/update/run";
14
- };
15
- /** Route-family dependencies (test seam). */
16
- export interface UpdateRoutesDeps {
17
- /** Loopback-only fence: the control endpoints are host-surface only. */
18
- fence(request: IncomingMessage): boolean;
19
- /** Probe registry versions and report the comparison. */
20
- check(): Promise<UpdateStatus>;
21
- /** Run the pnpm update (resolves when pnpm exits). */
22
- run(): Promise<UpdateRunResult>;
23
- }
24
- /**
25
- * Build the /api/update route family.
26
- * @param deps - fence + check/run seams.
27
- * @returns the exact routes to register on webServer.
28
- */
29
- export declare function makeUpdateRoutes(deps: UpdateRoutesDeps): WebRoute[];
30
- //# sourceMappingURL=update-routes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-routes.d.ts","sourceRoot":"","sources":["../../src/update-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAGhE,8CAA8C;AAC9C,eAAO,MAAM,YAAY;;;CAGf,CAAA;AAEV,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAA;IACxC,yDAAyD;IACzD,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC,CAAA;IAC9B,sDAAsD;IACtD,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CA+BnE"}
@@ -1,47 +0,0 @@
1
- /**
2
- * The /api/update route family: the status probe and the update run. Both
3
- * are loopback-only control surfaces — the run endpoint triggers a real
4
- * pnpm install inside the owning profile, so it must never be reachable
5
- * from a LAN/phone origin.
6
- */
7
- import { writeJson } from "./http.js";
8
- /** Route paths (exact matches under /api). */
9
- export const UPDATE_PATHS = {
10
- status: '/api/update/status',
11
- run: '/api/update/run',
12
- };
13
- /**
14
- * Build the /api/update route family.
15
- * @param deps - fence + check/run seams.
16
- * @returns the exact routes to register on webServer.
17
- */
18
- export function makeUpdateRoutes(deps) {
19
- const handleStatus = async (req, res) => {
20
- if (req.method !== 'GET') {
21
- res.writeHead(405, { 'content-type': 'text/plain; charset=utf-8' });
22
- res.end('method not allowed');
23
- return;
24
- }
25
- if (!deps.fence(req)) {
26
- writeJson(res, 403, { ok: false, code: "forbidden" });
27
- return;
28
- }
29
- writeJson(res, 200, await deps.check());
30
- };
31
- const handleRun = async (req, res) => {
32
- if (req.method !== 'POST') {
33
- res.writeHead(405, { 'content-type': 'text/plain; charset=utf-8' });
34
- res.end('method not allowed');
35
- return;
36
- }
37
- if (!deps.fence(req)) {
38
- writeJson(res, 403, { ok: false, code: "forbidden" });
39
- return;
40
- }
41
- writeJson(res, 200, await deps.run());
42
- };
43
- return [
44
- { kind: 'exact', path: UPDATE_PATHS.status, handler: handleStatus },
45
- { kind: 'exact', path: UPDATE_PATHS.run, handler: handleRun },
46
- ];
47
- }
@@ -1,282 +0,0 @@
1
- /**
2
- * Remote update support for the dsh-web family — host half. Detects the
3
- * installed aggregate package (@linxin666/dsh-web-all), or the directly
4
- * installed family packages when the aggregate is absent, probes npm for newer
5
- * releases, and runs `pnpm update --latest` inside the owning dsh profile.
6
- *
7
- * Pure logic with injected seams (manifest reading, registry fetches, process
8
- * spawning) so the whole surface is unit-testable without touching disk,
9
- * network, or a real profile.
10
- */
11
- import { spawn } from 'node:child_process';
12
- /** npm registry base used for version probes. */
13
- export declare const NPM_REGISTRY = "https://registry.npmjs.org";
14
- /** The family scope every dsh-web package is published under. */
15
- export declare const FAMILY_SCOPE = "@linxin666/";
16
- /** The aggregate package that is the canonical update entry point. */
17
- export declare const AGGREGATE_PACKAGE = "@linxin666/dsh-web-all";
18
- /** Fallback anchor: this plugin's own package when the aggregate is absent. */
19
- export declare const SELF_PACKAGE = "@linxin666/dsh-remote-web-ui";
20
- /** GitHub repository used to surface human-readable release notes. */
21
- export declare const UPDATE_RELEASE_REPO = "zhu1090093659/dsh-web";
22
- /** Release-notes cache freshness window (host process). */
23
- export declare const RELEASE_NOTES_CACHE_TTL_MS: number;
24
- /** A parsed semantic version (prerelease identifiers kept as strings). */
25
- export interface SemverParts {
26
- major: number;
27
- minor: number;
28
- patch: number;
29
- /** Dot-split prerelease identifiers; empty when absent. */
30
- prerelease: string[];
31
- }
32
- /**
33
- * Parse a semantic version string (leading `v` tolerated, build metadata
34
- * ignored). Returns undefined for unparseable input.
35
- * @param value - the version string, e.g. `0.1.10` or `0.1.11-rc.1`.
36
- * @returns the parsed parts, or undefined.
37
- */
38
- export declare function parseSemver(value: string): SemverParts | undefined;
39
- /**
40
- * Compare two semantic versions per the semver precedence rules (a release
41
- * outranks any of its prereleases; numeric prerelease identifiers compare
42
- * numerically and sort below alphanumeric ones). An unparseable version sorts
43
- * below every parseable one; two unparseable versions compare equal.
44
- * @param a - first version.
45
- * @param b - second version.
46
- * @returns negative when a < b, 0 when equal, positive when a > b.
47
- */
48
- export declare function compareVersions(a: string, b: string): number;
49
- /** The found dsh profile owning an installed package. */
50
- export interface FoundProfile {
51
- /** Profile name (e.g. `web`). */
52
- name: string;
53
- /** Absolute profile directory. */
54
- dir: string;
55
- }
56
- /**
57
- * Locate the owning dsh profile by walking up from an installed package's
58
- * manifest until a manifest named `dsh-profile-*` appears (the profile
59
- * directory is the first ancestor whose package.json carries that name).
60
- * @param anchorManifestPath - absolute path of the anchor package.json.
61
- * @returns the profile name/dir, or undefined when not profile-installed.
62
- */
63
- export declare function findProfile(anchorManifestPath: string): FoundProfile | undefined;
64
- /** A package version spec in a manifest dependencies map. */
65
- type DependencySpec = string | {
66
- version: string;
67
- } | undefined;
68
- /** Whether a dependency spec is a local link/file/dev-mode install. */
69
- export declare function isLinkedSpec(spec: DependencySpec): boolean;
70
- /** One package's current-vs-latest comparison. */
71
- export interface UpdatePackageStatus {
72
- /** Package name. */
73
- name: string;
74
- /** Locally installed version. */
75
- current: string;
76
- /** Latest npm release — undefined when the registry probe failed. */
77
- latest?: string;
78
- /** Whether npm carries a strictly newer release. */
79
- outdated: boolean;
80
- }
81
- /** Structured release-note sections shown in the update panel. */
82
- export interface UpdateReleaseNotes {
83
- /** Version the notes describe. */
84
- version: string;
85
- /** New feature bullets. */
86
- features: string[];
87
- /** Bug-fix bullets. */
88
- fixes: string[];
89
- /** Other-change bullets. */
90
- other: string[];
91
- }
92
- /** The full update-status snapshot served to the browser half. */
93
- export interface UpdateStatus {
94
- /** npm = registry-managed (updatable); link = local dev install; missing = no anchor package. */
95
- mode: 'npm' | 'link' | 'missing';
96
- /** Owning profile name (npm mode). */
97
- profileName?: string;
98
- /** The anchor package the update targets. */
99
- anchor?: string;
100
- /** Per-package version comparison (anchor first). */
101
- packages: UpdatePackageStatus[];
102
- /** True when any package has a newer npm release. */
103
- outdated: boolean;
104
- /** Human-readable release notes for the target release, when available. */
105
- notes?: UpdateReleaseNotes;
106
- /** Whole-check failure (e.g. registry unreachable). */
107
- error?: string;
108
- }
109
- /** Dependency-injection seam for checkUpdates (testable without network). */
110
- export interface UpdateCheckDeps {
111
- /** Absolute path of the anchor package manifest, when resolvable. */
112
- anchorManifestPath?: string;
113
- /** Resolve a package.json specifier to its absolute path (host require). */
114
- resolve(specifier: string): string | undefined;
115
- /** Probe one package's latest npm version; undefined on failure. */
116
- fetchLatest(name: string): Promise<string | undefined>;
117
- /** Fetch structured release notes for one target version, when available. */
118
- fetchReleaseNotes?(version: string): Promise<UpdateReleaseNotes | undefined>;
119
- }
120
- /**
121
- * Resolve the anchor package's manifest path. The aggregate package is the
122
- * canonical entry point; this plugin's own package is the fallback. Both a
123
- * throwing resolve and an undefined return mean "not installed" and move on
124
- * to the next candidate.
125
- * @param resolve - a Node resolve implementation scoped to the host process.
126
- * @returns the absolute manifest path, or undefined when neither is installed.
127
- */
128
- export declare function resolveAnchorManifest(resolve: (specifier: string) => string | undefined): string | undefined;
129
- /** The resolved update target: the profile pnpm runs in plus the package list. */
130
- export interface UpdateTarget {
131
- /** Owning profile name. */
132
- profileName: string;
133
- /** Absolute profile directory pnpm runs in. */
134
- profileDir: string;
135
- /** The package names pnpm updates (anchor first). */
136
- packages: string[];
137
- }
138
- /**
139
- * Resolve what an update would touch: the owning profile directory and the
140
- * family package list. Fails with an error code when the anchor is missing
141
- * ('not-found') or is a local dev install ('link').
142
- * @param deps - the anchor manifest path (resolveAnchorManifest output).
143
- * @returns the target, or the failure code.
144
- */
145
- export declare function resolveUpdateTarget(deps: {
146
- anchorManifestPath?: string;
147
- }): UpdateTarget | {
148
- error: 'not-found' | 'link';
149
- };
150
- /** Family children of the anchor: its dependencies under the family scope. */
151
- export declare function familyChildren(anchorManifest: Record<string, unknown>): string[];
152
- /** Concurrent registry probes in flight for one update-status call. */
153
- export declare const UPDATE_PROBE_CONCURRENCY = 4;
154
- /**
155
- * Probe every package's latest version with a bounded number of requests in
156
- * flight, preserving the caller's order in the result.
157
- * @param names - package names to probe.
158
- * @param fetchLatest - the probe for one package (returns undefined on failure).
159
- * @returns one result per name, in the input order.
160
- */
161
- export declare function probeLatestVersions(names: readonly string[], fetchLatest: (name: string) => Promise<string | undefined>): Promise<(string | undefined)[]>;
162
- /**
163
- * Probe the npm registry for one package's latest release.
164
- * @param name - the package name (scope slash URL-encoded).
165
- * @param fetchImpl - the fetch implementation (global fetch in the host).
166
- * @param timeoutMs - probe timeout.
167
- * @returns the latest version string, or undefined on any failure.
168
- */
169
- export declare function fetchLatestVersion(name: string, fetchImpl: (url: string, init?: RequestInit) => Promise<{
170
- ok: boolean;
171
- json(): Promise<unknown>;
172
- }>, timeoutMs?: number): Promise<string | undefined>;
173
- export declare function parseReleaseNotesBody(version: string, body: string): UpdateReleaseNotes | undefined;
174
- /**
175
- * Fetch and parse the GitHub Release for one `dsh-web` version.
176
- * @param version - the npm release version (without the `v` prefix).
177
- * @param fetchImpl - injected fetch; global `fetch` in the host.
178
- * @param timeoutMs - hard timeout for the GitHub API probe.
179
- * @returns structured notes, or undefined when unavailable.
180
- */
181
- export declare function fetchGitHubReleaseNotes(version: string, fetchImpl?: (url: string, init?: RequestInit) => Promise<{
182
- ok: boolean;
183
- json(): Promise<unknown>;
184
- }>, timeoutMs?: number): Promise<UpdateReleaseNotes | undefined>;
185
- /**
186
- * Build the update status: locate the anchor, detect the install mode, and
187
- * compare every family package against the npm registry.
188
- * @param deps - manifest resolution + registry probe seams.
189
- * @returns the status snapshot.
190
- */
191
- export declare function checkUpdates(deps: UpdateCheckDeps): Promise<UpdateStatus>;
192
- /** Structured failure codes the browser half translates. */
193
- export type UpdateErrorCode =
194
- /** pnpm is not on PATH. */
195
- 'pnpm-missing'
196
- /** The install exceeded the hard timeout. */
197
- | 'timeout'
198
- /** The anchor package is not installed. */
199
- | 'not-found'
200
- /** The anchor is a local link/dev install pnpm cannot update. */
201
- | 'link'
202
- /** pnpm exited non-zero. */
203
- | 'pnpm-failed'
204
- /** pnpm exited 0 but the installed versions did not move. */
205
- | 'stale'
206
- /** pnpm exited 0 but the post-run version check could not verify the install. */
207
- | 'verify-failed';
208
- /** Result of one update run. */
209
- export interface UpdateRunResult {
210
- ok: boolean;
211
- /** pnpm exit code (null when the process never started or was killed). */
212
- exitCode: number | null;
213
- /** Captured pnpm output tail (diagnostics for the panel). */
214
- output: string;
215
- /** Human-readable failure description (fallback copy). */
216
- error?: string;
217
- /** Structured failure code (translated by the browser half). */
218
- errorCode?: UpdateErrorCode;
219
- }
220
- /** Dependency-injection seam for runUpdate. */
221
- export interface UpdateRunDeps {
222
- /** The profile directory pnpm runs in. */
223
- profileDir: string;
224
- /** The package names pnpm updates. */
225
- packages: readonly string[];
226
- /** Spawn seam (defaults to child_process.spawn). */
227
- spawnImpl?: typeof spawn;
228
- /** Hard timeout; the child is killed on expiry. */
229
- timeoutMs?: number;
230
- /** Platform override (defaults to process.platform; test seam). */
231
- platform?: NodeJS.Platform;
232
- /** Process-group kill seam (defaults to process.kill; test seam). */
233
- killImpl?: KillImpl;
234
- }
235
- /** Seam for the process-group kill (tests inject a recorder). */
236
- export type KillImpl = (pid: number, signal: NodeJS.Signals) => void;
237
- /**
238
- * Run the update inside the profile directory. Tries pnpm first, falls back
239
- * to corepack and then npx when the previous command is missing (ENOENT);
240
- * all candidates share one hard timeout and keep accumulating output.
241
- * @param deps - profile dir, package list, and spawn/timeout seams.
242
- * @returns the outcome with captured output.
243
- */
244
- export declare function runUpdate(deps: UpdateRunDeps): Promise<UpdateRunResult>;
245
- /** Seam set for the verified update run (run + post-run status check). */
246
- export interface UpdateRunVerifiedDeps {
247
- /** The pnpm run (profile dir + package list). */
248
- run: UpdateRunDeps;
249
- /** The post-run status check (same seams as checkUpdates). */
250
- check: UpdateCheckDeps;
251
- }
252
- /**
253
- * Run the update, then verify the installed versions actually moved. pnpm
254
- * exits 0 even when it silently kept the installed versions — runUpdate
255
- * overrides pnpm 11's `minimumReleaseAge` gate (default 24 h) with
256
- * `--config.minimumReleaseAge=0`, but an older pnpm without the override or
257
- * another silent no-op can still keep versions in place — so a green exit
258
- * alone must not report a misleading "update complete". Re-read the
259
- * installed versions afterwards and surface a `stale` failure (with the
260
- * captured pnpm output) when nothing moved, so the panel can tell the user
261
- * how to unblock the gate instead of claiming success.
262
- *
263
- * The stale decision anchors on the pre-run installed versions, not on the
264
- * registry latest: under a lenient gate pnpm may move 0.1.12 -> 0.1.13 while
265
- * latest stays 0.1.15 — that is a real update, not stale. The post-run anchor
266
- * path is re-resolved rather than reused from boot time: pnpm removes the old
267
- * version's .pnpm directory on update, so a boot-time captured path would
268
- * fail to read and collapse a successful update into a bogus 'missing'.
269
- *
270
- * A green exit whose verification has nothing to compare (registry probe
271
- * outage, missing anchor, non-npm mode) is reported as `verify-failed` — it
272
- * must never read as success. A green exit where no package moved but the
273
- * post-run check could not prove the install is fully current (a partial
274
- * probe failure hides whether a gate kept something back) is also
275
- * `verify-failed`: it must not collapse into a success either.
276
- * @param deps - the run and check seams.
277
- * @returns the run result; `stale` when exit 0 left every version in place,
278
- * `verify-failed` when the post-run check could not verify anything.
279
- */
280
- export declare function runUpdateVerified(deps: UpdateRunVerifiedDeps): Promise<UpdateRunResult>;
281
- export {};
282
- //# sourceMappingURL=update.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAI1C,iDAAiD;AACjD,eAAO,MAAM,YAAY,+BAA+B,CAAA;AAExD,iEAAiE;AACjE,eAAO,MAAM,YAAY,gBAAgB,CAAA;AAEzC,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,2BAA2B,CAAA;AAEzD,+EAA+E;AAC/E,eAAO,MAAM,YA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