@deepseek-ai/dsh-plugin-manager 0.2.2-alpha.3 → 0.2.2-rc.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.
Files changed (70) hide show
  1. package/README.i18n.yaml +4 -4
  2. package/README.md +6 -5
  3. package/README.zh.md +6 -5
  4. package/lib/index.js +255 -68
  5. package/lib/typert.host.js +84 -66
  6. package/lib/typert.remote-client.d.ts.map +1 -0
  7. package/lib/typert.remote-client.js +77 -59
  8. package/lib/types/build-approval.d.ts.map +1 -0
  9. package/lib/types/build-approval.js.map +1 -0
  10. package/lib/types/bundle-detail.d.ts.map +1 -0
  11. package/lib/types/bundle-detail.js.map +1 -0
  12. package/lib/types/diagnostic.d.ts.map +1 -0
  13. package/lib/types/diagnostic.js +1 -0
  14. package/lib/types/diagnostic.js.map +1 -0
  15. package/lib/types/failure.d.ts.map +1 -0
  16. package/lib/types/failure.js.map +1 -0
  17. package/lib/types/git-transport.d.ts.map +1 -0
  18. package/lib/types/git-transport.js.map +1 -0
  19. package/lib/types/github-connection.d.ts +16 -5
  20. package/lib/types/github-connection.d.ts.map +1 -0
  21. package/lib/types/github-connection.js +18 -8
  22. package/lib/types/github-connection.js.map +1 -0
  23. package/lib/types/index.d.ts +39 -10
  24. package/lib/types/index.d.ts.map +1 -0
  25. package/lib/types/index.js +144 -46
  26. package/lib/types/index.js.map +1 -0
  27. package/lib/types/install-failure.d.ts.map +1 -0
  28. package/lib/types/install-failure.js.map +1 -0
  29. package/lib/types/install-spec.d.ts +13 -1
  30. package/lib/types/install-spec.d.ts.map +1 -0
  31. package/lib/types/install-spec.js +41 -1
  32. package/lib/types/install-spec.js.map +1 -0
  33. package/lib/types/official-install-target.d.ts.map +1 -0
  34. package/lib/types/official-install-target.js.map +1 -0
  35. package/lib/types/operations.d.ts +16 -4
  36. package/lib/types/operations.d.ts.map +1 -0
  37. package/lib/types/operations.js +38 -5
  38. package/lib/types/operations.js.map +1 -0
  39. package/lib/types/patch.d.ts.map +1 -0
  40. package/lib/types/patch.js.map +1 -0
  41. package/lib/types/registry.d.ts.map +1 -0
  42. package/lib/types/registry.js.map +1 -0
  43. package/lib/types/run-tree.d.ts.map +1 -0
  44. package/lib/types/run-tree.js.map +1 -0
  45. package/lib/types/tools.d.ts.map +1 -0
  46. package/lib/types/tools.js +2 -1
  47. package/lib/types/tools.js.map +1 -0
  48. package/lib/types/types.d.ts +31 -5
  49. package/lib/types/types.d.ts.map +1 -0
  50. package/lib/types/types.js.map +1 -0
  51. package/lib/types/versions.d.ts.map +1 -0
  52. package/lib/types/versions.js.map +1 -0
  53. package/package.json +45 -41
  54. package/src/build-approval.ts +96 -0
  55. package/src/bundle-detail.ts +104 -0
  56. package/src/diagnostic.ts +86 -0
  57. package/src/failure.ts +29 -0
  58. package/src/git-transport.ts +72 -0
  59. package/src/github-connection.ts +102 -0
  60. package/src/index.ts +1458 -0
  61. package/src/install-failure.ts +44 -0
  62. package/src/install-spec.ts +159 -0
  63. package/src/official-install-target.ts +58 -0
  64. package/src/operations.ts +695 -0
  65. package/src/patch.ts +78 -0
  66. package/src/registry.ts +98 -0
  67. package/src/run-tree.ts +77 -0
  68. package/src/tools.ts +164 -0
  69. package/src/types.ts +477 -0
  70. package/src/versions.ts +80 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-approval.d.ts","sourceRoot":"","sources":["../../src/build-approval.ts"],"names":[],"mappings":"AAoDA;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQxF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAK1D;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,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MAAM,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAElE,6GAA6G;AAC7G,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAA;IACpC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAA;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAClC;AAgED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,GAAG,SAAS,CAG5F"}
@@ -44,6 +44,7 @@ const operation = z.discriminatedUnion('phase', [
44
44
  'stale-approval': 'stale-approval',
45
45
  'incompatible-version': 'incompatible-version',
46
46
  'unsupported-platform': 'unsupported-platform',
47
+ 'unexpected-package': 'unexpected-package',
47
48
  'operation-error': 'operation-error',
48
49
  }).optional(),
49
50
  restartReason: z.enum({
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../../src/diagnostic.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAcvB,MAAM,MAAM,GAAG;IACb,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,KAA0B,CAAC;IAC3D,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC;QACb,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,QAAQ;KAC4B,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAA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Y,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAA;IACvD;;;OAGG;gBACS,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,EAAE,kBAAkB,EAAE;CAK/E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CAEjF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure.js","sourceRoot":"","sources":["../../src/failure.ts"],"names":[],"mappings":"AAIA,kFAAkF;AAClF,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,uDAAuD;IAC9C,IAAI,CAAyB;IACtC,8DAA8D;IACrD,YAAY,CAAkC;IACvD;;;OAGG;IACH,YAAY,IAA6B,EAAE,YAAmC;QAC5E,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA0B;IAC3D,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAA;AAC7H,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-transport.d.ts","sourceRoot":"","sources":["../../src/git-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,iEAAiE;AACjE,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,0FAA0F;IAC1F,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACvC;AAKD;;;;;;;GAO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,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAA;IACpE,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAA;IACzF,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -11,7 +11,7 @@ export interface GithubConnectionFailure extends PackageResult {
11
11
  */
12
12
  readonly argv: readonly string[];
13
13
  }
14
- /** Deadline, diagnostics and cancellation for one read-only GitHub check. */
14
+ /** Deadline, diagnostics and cancellation for one read-only Git repository check. */
15
15
  export interface GithubConnectionOptions {
16
16
  timeoutMs: number;
17
17
  outputBytes: number;
@@ -21,13 +21,24 @@ export interface GithubConnectionOptions {
21
21
  }
22
22
  /**
23
23
  * Check a GitHub repository before pnpm starts, without downloading or building its package.
24
- * Git reads the profile's Git and proxy configuration without invoking credential helpers or prompting.
25
- * Timeout and cancellation terminate its descendants too; pnpm owns authentication and transport fallback.
26
24
  * @param spec The parsed installation address; npm packages, local paths and other hosts are not checked.
27
25
  * @param dir The profile directory where installation runs.
28
26
  * @param options The connection deadline, output bound and operation cancellation.
29
- * @returns A failed check carrying the command line it ran (without URL user information) and its bounded output, with a
30
- * complete log at logPath, or undefined for a reachable repository or an unhandled spec.
27
+ * @returns As {@link checkGitConnection}, or undefined for a spec that does not name a GitHub repository.
31
28
  */
32
29
  export declare function checkGithubConnection(spec: ParsedInstallSpec, dir: string, options: GithubConnectionOptions): Promise<GithubConnectionFailure | undefined>;
30
+ /**
31
+ * Check a Git repository with `git ls-remote`, without downloading or building its package. A host shorthand is read
32
+ * over HTTPS; any other spec over the URL it names. Git reads the profile's Git and proxy configuration without
33
+ * invoking credential helpers or prompting, so a repository that needs credentials fails as `unknown`, not as a
34
+ * connection failure. Timeout and cancellation terminate its descendants too.
35
+ * @param spec The parsed address of a Git repository.
36
+ * @param dir The profile directory where installation runs.
37
+ * @param options The connection deadline, output bound and operation cancellation.
38
+ * @returns A failed check carrying the command line it ran (without URL user information), its bounded output and its
39
+ * failure kind, with a complete log at logPath, or undefined for a reachable repository.
40
+ */
41
+ export declare function checkGitConnection(spec: ParsedInstallSpec & {
42
+ readonly kind: 'git';
43
+ }, dir: string, options: GithubConnectionOptions): Promise<GithubConnectionFailure | undefined>;
33
44
  //# sourceMappingURL=github-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-connection.d.ts","sourceRoot":"","sources":["../../src/github-connection.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,aAAa;IAC5D;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CACjC;AAED,qFAAqF;AACrF,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,WAAW,CAAA;IACnB,0FAA0F;IAC1F,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACvC;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GACrE,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAK9C;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,iBAAiB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAChG,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CA0C9C"}
@@ -1,4 +1,4 @@
1
- /** Bounded GitHub repository checks using the installer's Git configuration and environment. */
1
+ /** Bounded Git repository connection checks using the installer's Git configuration and environment. */
2
2
  import { mkdir, mkdtemp, open } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
4
  import { execa } from 'execa';
@@ -7,13 +7,10 @@ import { classifyInstallFailure } from "./install-failure.js";
7
7
  import { HTTP_USER_INFO } from "./install-spec.js";
8
8
  /**
9
9
  * Check a GitHub repository before pnpm starts, without downloading or building its package.
10
- * Git reads the profile's Git and proxy configuration without invoking credential helpers or prompting.
11
- * Timeout and cancellation terminate its descendants too; pnpm owns authentication and transport fallback.
12
10
  * @param spec The parsed installation address; npm packages, local paths and other hosts are not checked.
13
11
  * @param dir The profile directory where installation runs.
14
12
  * @param options The connection deadline, output bound and operation cancellation.
15
- * @returns A failed check carrying the command line it ran (without URL user information) and its bounded output, with a
16
- * complete log at logPath, or undefined for a reachable repository or an unhandled spec.
13
+ * @returns As {@link checkGitConnection}, or undefined for a spec that does not name a GitHub repository.
17
14
  */
18
15
  export async function checkGithubConnection(spec, dir, options) {
19
16
  if (spec.kind !== 'git')
@@ -21,9 +18,22 @@ export async function checkGithubConnection(spec, dir, options) {
21
18
  const host = spec.host.toLowerCase().replace(/:.*$/, '');
22
19
  if (host !== 'github.com' && !host.endsWith('.github.com'))
23
20
  return undefined;
21
+ return checkGitConnection(spec, dir, options);
22
+ }
23
+ /**
24
+ * Check a Git repository with `git ls-remote`, without downloading or building its package. A host shorthand is read
25
+ * over HTTPS; any other spec over the URL it names. Git reads the profile's Git and proxy configuration without
26
+ * invoking credential helpers or prompting, so a repository that needs credentials fails as `unknown`, not as a
27
+ * connection failure. Timeout and cancellation terminate its descendants too.
28
+ * @param spec The parsed address of a Git repository.
29
+ * @param dir The profile directory where installation runs.
30
+ * @param options The connection deadline, output bound and operation cancellation.
31
+ * @returns A failed check carrying the command line it ran (without URL user information), its bounded output and its
32
+ * failure kind, with a complete log at logPath, or undefined for a reachable repository.
33
+ */
34
+ export async function checkGitConnection(spec, dir, options) {
24
35
  const repository = spec.spec.replace(/#.*$/s, '')
25
- .replace(/^github:/i, 'https://github.com/')
26
- .replace(/^gist:/i, 'https://gist.github.com/')
36
+ .replace(/^(?:github|gitlab|bitbucket|gist):/i, `https://${spec.host}/`)
27
37
  .replace(/^git\+/i, '');
28
38
  const logRoot = join(dir, '.plugin-manager', 'logs');
29
39
  await mkdir(logRoot, { recursive: true, mode: 0o700 });
@@ -50,7 +60,7 @@ export async function checkGithubConnection(spec, dir, options) {
50
60
  if (result.timedOut)
51
61
  await log.write(`dsh: connection to ${spec.host} timed out after ${String(options.timeoutMs)}ms\n`);
52
62
  if ((await log.stat()).size === 0)
53
- await log.write(result.shortMessage ?? 'GitHub connection check failed');
63
+ await log.write(result.shortMessage ?? 'Git connection check failed');
54
64
  const { size } = await log.stat();
55
65
  const bytes = Buffer.alloc(Math.min(size, options.outputBytes));
56
66
  await log.read(bytes, 0, bytes.length, size - bytes.length);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-connection.js","sourceRoot":"","sources":["../../src/github-connection.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,cAAc,EAA0B,MAAM,mBAAmB,CAAA;AAwB1E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAuB,EAAE,GAAW,EAAE,OAAgC;IAEtE,IAAI,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AE,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAA;QAC/D,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;QAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QACrC,oHAAoH;QACpH,0GAA0G;QAC1G,OAAO;YACL,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACrF,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO;YACtD,IAAI,EAAE,sBAAsB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;YACxE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;SAC7C,CAAA;IACH,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,KAAK,EAAE,CAAA;IACnB,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@ import type { NpmFileSource } from '@deepseek-ai/dsh-plugin-detail/types';
5
5
  import type { BundleDetail, BundleInfo, ChangeResult, InspectOptions, InstallBundleOptions, ListVersionsOptions, PluginEntryId, PluginInfo, PluginInstallCancellation, PluginInstallRequestId, PluginRegistries, PluginSpecInspection, PluginUpdateResult, PluginVersionList, UpdateBundleOptions } from './types.ts';
6
6
  export type * from './types.ts';
7
7
  export { classifyInstallFailure, type InstallFailureFacts } from './install-failure.ts';
8
- export { InvalidInstallSpecError, parseInstallSpec, type ParsedInstallSpec } from './install-spec.ts';
8
+ export { InvalidInstallSpecError, parseInstallSpec, pinnedGitOrigin, type ParsedInstallSpec } from './install-spec.ts';
9
9
  /** The pnpm executable, registries, and limits for diagnostics, lookups and connection checks. */
10
10
  export interface Config {
11
11
  /** The pnpm executable name or path; resolved through `PATH` like the `dsh plugin` command. */
@@ -149,18 +149,47 @@ export declare class PluginManager extends TypertRemoteService {
149
149
  */
150
150
  listVersions(name: string, options?: ListVersionsOptions, signal?: AbortSignal): Promise<PluginVersionList>;
151
151
  /**
152
- * Replace an installed registry bundle with a newer published version. The target is checked on the registry first:
153
- * it must exist, declare a bundle, and accept the running DSH version, or nothing changes. With HMR the installed
154
- * version is removed, so its plugins stop, and the target is installed with the same selection; when that
155
- * installation fails or is cancelled, the removed version is installed again from the registry it came from.
156
- * Without HMR the target is installed over the running version and the result reports the restart.
152
+ * Replace an installed bundle with a newer version. A registry copy updates to `name@version`, checked on the registry
153
+ * first: it must exist, declare a bundle, and accept the running DSH version, or nothing changes. A Git copy updates
154
+ * to the Git spec `options.spec` names, which must pin a full commit of the repository directory the copy came from;
155
+ * with HMR, a network failure or timeout reaching its repository stops the update before anything changes. pnpm reads
156
+ * a Git package only while installing it, so its bundle and compatibility are checked then. Either target
157
+ * installation is undone, profile files and modules included, before its bundle loads unless it installs `name` at
158
+ * `version`. With HMR the installed version is removed, so its plugins stop, and the target is installed with the same
159
+ * selection; when that installation fails or is cancelled, the removed version is installed again: a registry copy
160
+ * from the registry it came from, a Git copy from its saved spec. Without HMR the target is installed over the running
161
+ * version and the result reports the restart.
157
162
  * @param name Installed profile dependency name.
158
- * @param version Exact published version newer than the installed one.
159
- * @param options The registry asked first, as for `listVersions`, and the request id naming the progress and the
160
- * target installation's logs and cancellation.
163
+ * @param version Exact version newer than the installed one.
164
+ * @param options The registry asked first, as for `listVersions`; the Git spec of `version`, required for and accepted
165
+ * only by a bundle `listBundles` lists with `update: 'git'`; and the request id naming the progress and the target
166
+ * installation's logs and cancellation.
161
167
  * @returns The versions, the last step that ran with its result, and the reinstallation when one ran.
162
168
  */
163
169
  updateBundle(name: string, version: string, options?: UpdateBundleOptions): Promise<PluginUpdateResult>;
170
+ /**
171
+ * The target of a Git copy's update: the caller's Git spec, pinned to a full commit of the copy's repository directory.
172
+ * @param name The package name.
173
+ * @param origin The repository directory the installed copy pins.
174
+ * @param options The caller's spec and registry.
175
+ * @returns The spec and the registry its dependencies are asked from first, or why the update is refused.
176
+ */
177
+ private planGitUpdate;
178
+ /**
179
+ * Check that the network reaches the repository of a Git update's target. Only a network failure or a timeout
180
+ * counts: a check Git cannot run, or one the repository refuses without credentials, leaves the answer to pnpm.
181
+ * @param spec The target's pinned Git spec.
182
+ * @returns The failed check, or undefined when the host answered or the check could not tell.
183
+ */
184
+ private gitHostUnreachable;
185
+ /**
186
+ * Check a registry copy's update target on the registry plan before anything changes.
187
+ * @param name The package name.
188
+ * @param version The target version.
189
+ * @param options The caller's registry, as for `listVersions`; a spec is refused.
190
+ * @returns The exact spec and the registry that answered for it, or why the target cannot replace the bundle.
191
+ */
192
+ private checkRegistryUpdate;
164
193
  /**
165
194
  * The registry a version listing or an update asks first.
166
195
  * @param name The package name.
@@ -226,7 +255,7 @@ export declare class PluginManager extends TypertRemoteService {
226
255
  removeBundle(name: string): Promise<ChangeResult>;
227
256
  /** The rows a bundle's patch inserts and the existing rows it changes; an unreadable patch throws. */
228
257
  private declaredRows;
229
- /** Run one pnpm command in the profile, streaming its output as install-log chunks. */
258
+ /** Run one pnpm command in the profile, streaming its output as install-log chunks; `expected` is the package an `add` must install. */
230
259
  private runPnpm;
231
260
  /** The profile files an installation may rewrite, as they are now; absent files read as undefined. */
232
261
  private readRestoredFiles;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,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,SAAS;IAMjB;;;OAGG;YACW,eAAe;IAY7B;;;;OAIG;YACW,gBAAgB;IAK9B;;;;OAIG;YACW,MAAM;YAYN,MAAM;IAwDpB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,eAAe;IAQvB,+FAA+F;IAC/F,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,SAAS;CASlB;AAED,eAAe,aAAa,CAAA"}
@@ -51,16 +51,16 @@ import { OPTIONAL_BUNDLES, OFFICIAL_ON_DEMAND_CATALOG, PROTECTED_PLUGINS } from
51
51
  import { bundleManifest, readProfileRegistry, registryArguments, runProfilePnpm, saveManifest, viewProfilePackage } from "./operations.js";
52
52
  import { classifyInstallFailure } from "./install-failure.js";
53
53
  import { officialBundleInstallTarget } from "./official-install-target.js";
54
- import { dependencySpec, InvalidInstallSpecError, parseInstallSpec } from "./install-spec.js";
54
+ import { dependencySpec, InvalidInstallSpecError, parseInstallSpec, pinnedGitOrigin } from "./install-spec.js";
55
55
  import { attributeFailure, normalizeRegistry, NPMMIRROR_REGISTRY, registryPlan } from "./registry.js";
56
56
  import { flatten, writePluginEnabled } from "./patch.js";
57
57
  import { incompatiblePlugin, ManagementFailure } from "./failure.js";
58
58
  import { approveBuilds, recordPendingBuilds } from "./build-approval.js";
59
- import { checkGithubConnection } from "./github-connection.js";
59
+ import { checkGitConnection, checkGithubConnection } from "./github-connection.js";
60
60
  import { chooseGitTransport, sshGitSpec } from "./git-transport.js";
61
61
  import { newerVersions, VERSION_FIELDS, VERSION_LIST_FIELDS, versionFacts } from "./versions.js";
62
62
  export { classifyInstallFailure } from "./install-failure.js";
63
- export { InvalidInstallSpecError, parseInstallSpec } from "./install-spec.js";
63
+ export { InvalidInstallSpecError, parseInstallSpec, pinnedGitOrigin } from "./install-spec.js";
64
64
  /** The Fetch route serving images beside bundle detail documents. */
65
65
  const DETAIL_FILE_PATH = '/api/plugin-manager/detail-file';
66
66
  /** An http(s) URL, as pnpm's `--registry` takes it. */
@@ -115,7 +115,7 @@ function refused(problem, reason) {
115
115
  * Why an update cannot replace a listed bundle, or what it replaces.
116
116
  * @param bundle The listed bundle, or undefined for a name the inventory does not list.
117
117
  * @param name The package name, for the refusal.
118
- * @returns The bundle, its installed version, and its registry spec; or the refusal's diagnostic.
118
+ * @returns The bundle, its installed version, and how it was installed; or the refusal's diagnostic.
119
119
  */
120
120
  function updateRefusal(bundle, name) {
121
121
  if (bundle === undefined || !bundle.installed || bundle.availability !== 'profile' || bundle.official || bundle.source === undefined) {
@@ -127,12 +127,16 @@ function updateRefusal(bundle, name) {
127
127
  const installed = bundle.version;
128
128
  if (installed === undefined || semver.valid(installed) === null)
129
129
  return `${bundle.name} declares no semver version`;
130
+ // Only a pinned commit reinstalls the removed version when its replacement fails.
131
+ const origin = pinnedGitOrigin(bundle.source);
132
+ if (origin !== undefined)
133
+ return { kind: 'git', bundle, installed, source: bundle.source, origin };
130
134
  const parsed = parsedForRegistry(bundle.source);
131
135
  // A protocol in the saved range, such as an `npm:` alias, names another package than the dependency.
132
136
  if (parsed.kind !== 'registry' || parsed.name !== bundle.name || parsed.range?.includes(':') === true) {
133
- return `${bundle.name} is not installed from a registry under its own name`;
137
+ return `${bundle.name} is installed neither from a registry under its own name nor from a Git commit`;
134
138
  }
135
- return { bundle, installed, parsed };
139
+ return { kind: 'registry', bundle, installed, parsed };
136
140
  }
137
141
  /**
138
142
  * Map items with at most `limit` calls in flight, stopping new calls once one answers `stop`.
@@ -467,7 +471,10 @@ let PluginManager = (() => {
467
471
  * display metadata, activation selections, whether the installation offers the bundle, and removal availability.
468
472
  */
469
473
  listBundles() {
470
- return Promise.resolve(this.readBundles().map(bundle => ({ ...bundle, updatable: typeof updateRefusal(bundle, bundle.name) !== 'string' })));
474
+ return Promise.resolve(this.readBundles().map((bundle) => {
475
+ const target = updateRefusal(bundle, bundle.name);
476
+ return typeof target === 'string' ? bundle : { ...bundle, update: target.kind };
477
+ }));
471
478
  }
472
479
  /** The bundle inventory before update eligibility, which is derived from each listed bundle. */
473
480
  readBundles() {
@@ -509,7 +516,6 @@ let PluginManager = (() => {
509
516
  }
510
517
  const error = platformError ?? targetError ?? (enabled ? { code: 'not-bundle' } : undefined);
511
518
  bundles.push({ name, official, availability: 'missing', ...catalogMeta, ...target, enabled, installed, optional,
512
- ...offered.listedByDefault === undefined ? {} : { listedByDefault: offered.listedByDefault },
513
519
  ...platformError?.code === 'unsupported-platform' ? { listedByDefault: false } : {},
514
520
  removable: enabled, rows: [], overrides: [],
515
521
  ...error === undefined ? {} : { error } });
@@ -535,16 +541,20 @@ let PluginManager = (() => {
535
541
  }
536
542
  version = info.version;
537
543
  const listedByDefault = info.dsh?.bundle?.listedByDefault;
538
- if (listedByDefault !== undefined) {
539
- if (typeof listedByDefault !== 'boolean')
540
- throw new Error('dsh.bundle.listedByDefault must be a boolean');
544
+ // The launcher ignores this display field, so an invalid value is a metadata diagnostic, not a load error.
545
+ const listingDiagnostic = listedByDefault === undefined || typeof listedByDefault === 'boolean'
546
+ ? undefined
547
+ : 'dsh.bundle.listedByDefault must be a boolean';
548
+ if (typeof listedByDefault === 'boolean')
541
549
  listing = { listedByDefault };
542
- }
543
550
  const compatibility = evaluatePluginCompatibility(info, exemptions);
544
551
  if (compatibility !== undefined && !compatibility.exempted)
545
552
  throw new ManagementFailure('incompatible-version', [incompatiblePlugin(compatibility)]);
546
553
  const dir = resolveBundleDir('dsh', name, this.profile.installAnchor, this.profile.dir);
547
- const meta = offered?.meta ?? readPluginMeta(info.name ?? name, pathToFileURL(join(dir, 'package.json')).href);
554
+ const read = offered?.meta ?? readPluginMeta(info.name ?? name, pathToFileURL(join(dir, 'package.json')).href);
555
+ const meta = listingDiagnostic === undefined
556
+ ? read
557
+ : { ...read, error: read?.error === undefined ? listingDiagnostic : `${read.error}; ${listingDiagnostic}` };
548
558
  let platformError;
549
559
  try {
550
560
  assertBundlePlatform(info.dsh?.bundle?.platforms, process.platform);
@@ -665,6 +675,8 @@ let PluginManager = (() => {
665
675
  const target = updateRefusal((await this.listBundles()).find(bundle => bundle.name === name), name);
666
676
  if (typeof target === 'string')
667
677
  return { status: 'refused', problem: 'not-updatable', reason: target, attempts: [] };
678
+ if (target.kind === 'git')
679
+ return { status: 'refused', problem: 'not-updatable', reason: `${name} is installed from Git, which lists no versions`, attempts: [] };
668
680
  const plan = registryPlan(this.registryFor(name, options?.registry), await this.registries());
669
681
  const listing = await this.askRegistries(name, VERSION_LIST_FIELDS, plan, target.parsed, signal);
670
682
  if (listing.status === 'refused')
@@ -712,15 +724,21 @@ let PluginManager = (() => {
712
724
  };
713
725
  }
714
726
  /**
715
- * Replace an installed registry bundle with a newer published version. The target is checked on the registry first:
716
- * it must exist, declare a bundle, and accept the running DSH version, or nothing changes. With HMR the installed
717
- * version is removed, so its plugins stop, and the target is installed with the same selection; when that
718
- * installation fails or is cancelled, the removed version is installed again from the registry it came from.
719
- * Without HMR the target is installed over the running version and the result reports the restart.
727
+ * Replace an installed bundle with a newer version. A registry copy updates to `name@version`, checked on the registry
728
+ * first: it must exist, declare a bundle, and accept the running DSH version, or nothing changes. A Git copy updates
729
+ * to the Git spec `options.spec` names, which must pin a full commit of the repository directory the copy came from;
730
+ * with HMR, a network failure or timeout reaching its repository stops the update before anything changes. pnpm reads
731
+ * a Git package only while installing it, so its bundle and compatibility are checked then. Either target
732
+ * installation is undone, profile files and modules included, before its bundle loads unless it installs `name` at
733
+ * `version`. With HMR the installed version is removed, so its plugins stop, and the target is installed with the same
734
+ * selection; when that installation fails or is cancelled, the removed version is installed again: a registry copy
735
+ * from the registry it came from, a Git copy from its saved spec. Without HMR the target is installed over the running
736
+ * version and the result reports the restart.
720
737
  * @param name Installed profile dependency name.
721
- * @param version Exact published version newer than the installed one.
722
- * @param options The registry asked first, as for `listVersions`, and the request id naming the progress and the
723
- * target installation's logs and cancellation.
738
+ * @param version Exact version newer than the installed one.
739
+ * @param options The registry asked first, as for `listVersions`; the Git spec of `version`, required for and accepted
740
+ * only by a bundle `listBundles` lists with `update: 'git'`; and the request id naming the progress and the target
741
+ * installation's logs and cancellation.
724
742
  * @returns The versions, the last step that ran with its result, and the reinstallation when one ran.
725
743
  */
726
744
  async updateBundle(name, version, options) {
@@ -742,34 +760,34 @@ let PluginManager = (() => {
742
760
  if (semver.valid(version) === null || !semver.gt(version, from)) {
743
761
  return refusedBefore({ code: 'invalid-spec', diagnostic: `${version} is not a version newer than the installed ${from}` });
744
762
  }
745
- const spec = `${name}@${version}`;
746
- const plan = registryPlan(this.registryFor(name, options?.registry), await this.registries());
747
- const checked = await this.askRegistries(spec, VERSION_FIELDS, plan, { kind: 'registry', spec, name });
748
- if (checked.status === 'refused')
749
- return refusedBefore({ code: 'operation-error', diagnostic: checked.reason });
750
- const facts = versionFacts(checked.answer, name, version);
751
- if (!facts.bundle)
752
- return refusedBefore({ code: 'not-bundle' });
753
- let compatibility;
754
- try {
755
- compatibility = evaluatePluginCompatibility(facts.manifest, readProfileVersionExemptions(this.profile.dir));
756
- }
757
- catch (error) {
758
- return refusedBefore({ code: 'operation-error', diagnostic: messageOf(error) });
759
- }
760
- if (compatibility !== undefined && !compatibility.exempted) {
761
- return refusedBefore({ code: 'incompatible-version', incompatible: [incompatiblePlugin(compatibility)] });
762
- }
763
+ const planned = target.kind === 'git'
764
+ ? this.planGitUpdate(name, target.origin, options)
765
+ : await this.checkRegistryUpdate(name, version, options);
766
+ if ('code' in planned)
767
+ return refusedBefore(planned);
768
+ const { spec, registry, saveExact } = planned;
763
769
  const { enabled } = bundle;
764
770
  // A lock timeout or disposal rejects instead of reporting; it reads as the failed step it is.
765
771
  const settled = (stage, target, operation) => operation.catch((error) => ({ changed: false, application: 'failed', stage, target, error: managementError(error) }));
766
772
  const installTarget = () => settled('install', spec, this.installBundle(spec, {
767
- saveExact: true, registry: checked.registry, enabled, ...requestId === undefined ? {} : { requestId },
773
+ saveExact, enabled, expected: { name, version },
774
+ ...registry === undefined ? {} : { registry }, ...requestId === undefined ? {} : { requestId },
768
775
  }));
769
776
  if (this.ownerContext.get('hmr') === undefined) {
770
777
  announce('installing');
771
778
  return { from, to: version, step: 'install', result: await installTarget() };
772
779
  }
780
+ // A Git host that cannot be reached would fail the target and the reinstallation alike, so nothing is removed.
781
+ const unreachable = target.kind === 'git' ? await this.gitHostUnreachable(spec) : undefined;
782
+ if (unreachable !== undefined) {
783
+ return {
784
+ from, to: version, step: 'check',
785
+ result: {
786
+ changed: false, application: 'failed', stage: 'install', target: name, failedAt: 'spec-host', packageResult: unreachable,
787
+ error: { code: 'operation-error', diagnostic: unreachable.output },
788
+ },
789
+ };
790
+ }
773
791
  // The removed version is installed again where it came from, else over the configured plan, as its removal asks.
774
792
  const previousRegistry = this.installedFrom.get(name);
775
793
  announce('removing');
@@ -785,12 +803,89 @@ let PluginManager = (() => {
785
803
  if (result.stage === 'enable')
786
804
  await settled('remove', name, this.removeBundle(name));
787
805
  // The reinstallation carries no request id, so cancelling the update cannot leave the package removed.
788
- const previous = `${name}@${from}`;
806
+ const previous = target.kind === 'git' ? target.source : `${name}@${from}`;
789
807
  const restore = await settled('install', previous, this.installBundle(previous, {
790
- saveExact: true, enabled, ...previousRegistry === undefined ? {} : { registry: previousRegistry },
808
+ saveExact, enabled, ...previousRegistry === undefined ? {} : { registry: previousRegistry },
791
809
  }));
792
810
  return { from, to: version, step: 'install', result, restore };
793
811
  }
812
+ /**
813
+ * The target of a Git copy's update: the caller's Git spec, pinned to a full commit of the copy's repository directory.
814
+ * @param name The package name.
815
+ * @param origin The repository directory the installed copy pins.
816
+ * @param options The caller's spec and registry.
817
+ * @returns The spec and the registry its dependencies are asked from first, or why the update is refused.
818
+ */
819
+ planGitUpdate(name, origin, options) {
820
+ const spec = options?.spec;
821
+ const pinned = spec === undefined ? undefined : pinnedGitOrigin(spec);
822
+ if (spec === undefined || pinned === undefined) {
823
+ return { code: 'invalid-spec', diagnostic: `${name} is installed from Git and updates only to a Git spec pinned to a full commit` };
824
+ }
825
+ if (pinned !== origin) {
826
+ return { code: 'invalid-spec', diagnostic: `${spec} is not in the repository directory ${name} is installed from, ${origin}` };
827
+ }
828
+ return { spec, registry: this.registryFor(name, options?.registry), saveExact: false };
829
+ }
830
+ /**
831
+ * Check that the network reaches the repository of a Git update's target. Only a network failure or a timeout
832
+ * counts: a check Git cannot run, or one the repository refuses without credentials, leaves the answer to pnpm.
833
+ * @param spec The target's pinned Git spec.
834
+ * @returns The failed check, or undefined when the host answered or the check could not tell.
835
+ */
836
+ async gitHostUnreachable(spec) {
837
+ const parsed = parseInstallSpec(spec);
838
+ /* v8 ignore next -- planGitUpdate accepts only a pinned Git spec */
839
+ if (parsed.kind !== 'git')
840
+ return undefined;
841
+ const env = this.profile.packageManager?.env === undefined ? {} : { env: this.profile.packageManager.env };
842
+ const check = checkGitConnection(parsed, this.profile.dir, {
843
+ timeoutMs: this.githubConnectionTimeoutMs, outputBytes: this.outputBytes, signal: this.abort.signal, ...env,
844
+ });
845
+ this.packageOperations.add(check);
846
+ let failure;
847
+ try {
848
+ failure = await check;
849
+ }
850
+ finally {
851
+ this.packageOperations.delete(check);
852
+ }
853
+ this.abort.signal.throwIfAborted();
854
+ if (failure?.kind !== 'network' && failure?.kind !== 'timeout')
855
+ return undefined;
856
+ // The answer keeps a plain PackageResult; the check's command line stays out of the wire fields.
857
+ const { argv: _argv, ...packageResult } = failure;
858
+ return packageResult;
859
+ }
860
+ /**
861
+ * Check a registry copy's update target on the registry plan before anything changes.
862
+ * @param name The package name.
863
+ * @param version The target version.
864
+ * @param options The caller's registry, as for `listVersions`; a spec is refused.
865
+ * @returns The exact spec and the registry that answered for it, or why the target cannot replace the bundle.
866
+ */
867
+ async checkRegistryUpdate(name, version, options) {
868
+ const spec = `${name}@${version}`;
869
+ if (options?.spec !== undefined)
870
+ return { code: 'invalid-spec', diagnostic: `${name} is installed from a registry and updates only to ${spec}` };
871
+ const plan = registryPlan(this.registryFor(name, options?.registry), await this.registries());
872
+ const checked = await this.askRegistries(spec, VERSION_FIELDS, plan, { kind: 'registry', spec, name });
873
+ if (checked.status === 'refused')
874
+ return { code: 'operation-error', diagnostic: checked.reason };
875
+ const facts = versionFacts(checked.answer, name, version);
876
+ if (!facts.bundle)
877
+ return { code: 'not-bundle' };
878
+ let compatibility;
879
+ try {
880
+ compatibility = evaluatePluginCompatibility(facts.manifest, readProfileVersionExemptions(this.profile.dir));
881
+ }
882
+ catch (error) {
883
+ return { code: 'operation-error', diagnostic: messageOf(error) };
884
+ }
885
+ if (compatibility !== undefined && !compatibility.exempted)
886
+ return { code: 'incompatible-version', incompatible: [incompatiblePlugin(compatibility)] };
887
+ return { spec, registry: checked.registry, saveExact: true };
888
+ }
794
889
  /**
795
890
  * The registry a version listing or an update asks first.
796
891
  * @param name The package name.
@@ -971,13 +1066,16 @@ let PluginManager = (() => {
971
1066
  result.registries.push(registry);
972
1067
  used = registry;
973
1068
  announce('installing', { registry, index: index + 1, total: plan.length });
974
- run = await this.runPnpm(['add', installSpec, ...options?.saveExact === true ? ['--save-exact'] : [], ...registryArguments(registry)], control.abort.signal, requestId);
1069
+ run = await this.runPnpm(['add', installSpec, ...options?.saveExact === true ? ['--save-exact'] : [], ...registryArguments(registry)], control.abort.signal, requestId, options?.expected);
975
1070
  result.packageResult = run;
976
1071
  if (stopped())
977
1072
  throw new InstallCancelledError();
978
1073
  // A compatibility refusal is the package's own answer, so no other registry is asked.
979
1074
  if (run.incompatible !== undefined)
980
1075
  throw new ManagementFailure('incompatible-version', run.incompatible);
1076
+ // So is a run that installed another package, version, or no bundle where the caller expects one.
1077
+ if (run.unmet !== undefined)
1078
+ throw new ManagementFailure(run.unmet);
981
1079
  // A run this manager terminated is not a success, even when pnpm trapped the signal and exited 0.
982
1080
  if (run.exitCode === 0 && run.timedOut !== true)
983
1081
  break;
@@ -1162,8 +1260,8 @@ let PluginManager = (() => {
1162
1260
  const overrides = [...new Set(patches.flatMap(item => item.insert === undefined && typeof item.id === 'string' && !declared.has(item.id) ? [item.id] : []))];
1163
1261
  return { rows, overrides };
1164
1262
  }
1165
- /** Run one pnpm command in the profile, streaming its output as install-log chunks. */
1166
- async runPnpm(args, signal, requestId) {
1263
+ /** Run one pnpm command in the profile, streaming its output as install-log chunks; `expected` is the package an `add` must install. */
1264
+ async runPnpm(args, signal, requestId, expected) {
1167
1265
  const jobId = randomUUID();
1168
1266
  const argv = ['pnpm', ...args];
1169
1267
  const cwd = this.profile.dir;
@@ -1172,7 +1270,7 @@ let PluginManager = (() => {
1172
1270
  execution: 'service', ...this.profile.packageManager ?? { command: this.pnpmCommand },
1173
1271
  signal: signal === undefined ? this.abort.signal : AbortSignal.any([this.abort.signal, signal]),
1174
1272
  outputBytes: this.outputBytes, activateNewBundles: false, idleTimeoutMs: this.idleTimeoutMs,
1175
- lookupTimeoutMs: this.inspectTimeoutMs,
1273
+ lookupTimeoutMs: this.inspectTimeoutMs, ...expected === undefined ? {} : { expected },
1176
1274
  onOutput: (text, stream) => {
1177
1275
  this.ownerContext.emit('plugin-manager/install-log', { ...identity, jobId, argv, cwd, stream, text });
1178
1276
  },