@deepseek-ai/dsh-plugin-manager 0.2.2-rc.1 → 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.
- package/README.i18n.yaml +4 -4
- package/README.md +6 -5
- package/README.zh.md +6 -5
- package/lib/index.js +255 -68
- package/lib/typert.host.js +84 -66
- package/lib/typert.remote-client.d.ts.map +1 -0
- package/lib/typert.remote-client.js +77 -59
- package/lib/types/build-approval.d.ts.map +1 -0
- package/lib/types/build-approval.js.map +1 -0
- package/lib/types/bundle-detail.d.ts.map +1 -0
- package/lib/types/bundle-detail.js.map +1 -0
- package/lib/types/diagnostic.d.ts.map +1 -0
- package/lib/types/diagnostic.js +1 -0
- package/lib/types/diagnostic.js.map +1 -0
- package/lib/types/failure.d.ts.map +1 -0
- package/lib/types/failure.js.map +1 -0
- package/lib/types/git-transport.d.ts.map +1 -0
- package/lib/types/git-transport.js.map +1 -0
- package/lib/types/github-connection.d.ts +16 -5
- package/lib/types/github-connection.d.ts.map +1 -0
- package/lib/types/github-connection.js +18 -8
- package/lib/types/github-connection.js.map +1 -0
- package/lib/types/index.d.ts +39 -10
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +144 -46
- package/lib/types/index.js.map +1 -0
- package/lib/types/install-failure.d.ts.map +1 -0
- package/lib/types/install-failure.js.map +1 -0
- package/lib/types/install-spec.d.ts +13 -1
- package/lib/types/install-spec.d.ts.map +1 -0
- package/lib/types/install-spec.js +41 -1
- package/lib/types/install-spec.js.map +1 -0
- package/lib/types/official-install-target.d.ts.map +1 -0
- package/lib/types/official-install-target.js.map +1 -0
- package/lib/types/operations.d.ts +16 -4
- package/lib/types/operations.d.ts.map +1 -0
- package/lib/types/operations.js +38 -5
- package/lib/types/operations.js.map +1 -0
- package/lib/types/patch.d.ts.map +1 -0
- package/lib/types/patch.js.map +1 -0
- package/lib/types/registry.d.ts.map +1 -0
- package/lib/types/registry.js.map +1 -0
- package/lib/types/run-tree.d.ts.map +1 -0
- package/lib/types/run-tree.js.map +1 -0
- package/lib/types/tools.d.ts.map +1 -0
- package/lib/types/tools.js +2 -1
- package/lib/types/tools.js.map +1 -0
- package/lib/types/types.d.ts +31 -5
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/types.js.map +1 -0
- package/lib/types/versions.d.ts.map +1 -0
- package/lib/types/versions.js.map +1 -0
- package/package.json +39 -35
- package/src/build-approval.ts +96 -0
- package/src/bundle-detail.ts +104 -0
- package/src/diagnostic.ts +86 -0
- package/src/failure.ts +29 -0
- package/src/git-transport.ts +72 -0
- package/src/github-connection.ts +102 -0
- package/src/index.ts +1458 -0
- package/src/install-failure.ts +44 -0
- package/src/install-spec.ts +159 -0
- package/src/official-install-target.ts +58 -0
- package/src/operations.ts +695 -0
- package/src/patch.ts +78 -0
- package/src/registry.ts +98 -0
- package/src/run-tree.ts +77 -0
- package/src/tools.ts +164 -0
- package/src/types.ts +477 -0
- package/src/versions.ts +80 -0
package/lib/types/types.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export interface IncompatiblePlugin {
|
|
|
37
37
|
}
|
|
38
38
|
/** Localizable management failure and optional external diagnostic. */
|
|
39
39
|
export interface ManagementError {
|
|
40
|
-
code: ReadOnlyReason | 'unknown-plugin' | 'invalid-spec' | 'already-installed' | 'ambiguous-install' | 'not-bundle' | 'not-removable' | 'stop-profile' | 'bundle-in-use' | 'stale-approval' | 'incompatible-version' | 'unsupported-platform' | 'operation-error';
|
|
40
|
+
code: ReadOnlyReason | 'unknown-plugin' | 'invalid-spec' | 'already-installed' | 'ambiguous-install' | 'not-bundle' | 'not-removable' | 'stop-profile' | 'bundle-in-use' | 'stale-approval' | 'incompatible-version' | 'unsupported-platform' | 'unexpected-package' | 'operation-error';
|
|
41
41
|
diagnostic?: string;
|
|
42
42
|
/** Present with `incompatible-version`: the packages the running DSH version rejects. */
|
|
43
43
|
incompatible?: IncompatiblePlugin[];
|
|
@@ -88,7 +88,10 @@ export interface BundleInfo {
|
|
|
88
88
|
description?: string;
|
|
89
89
|
/** Default GUI visibility after package and Host checks; selected or profile-installed bundles remain manageable. */
|
|
90
90
|
listedByDefault?: boolean;
|
|
91
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Selected in the profile manifest; a selected bundle whose layer was skipped carries the load `error`, and none of
|
|
93
|
+
* its `rows` has an `entryId`.
|
|
94
|
+
*/
|
|
92
95
|
enabled: boolean;
|
|
93
96
|
/** Whether the profile declares this dependency; availability separately reports whether its files can be read. */
|
|
94
97
|
installed: boolean;
|
|
@@ -104,10 +107,12 @@ export interface BundleInfo {
|
|
|
104
107
|
optional: boolean;
|
|
105
108
|
removable: boolean;
|
|
106
109
|
/**
|
|
107
|
-
*
|
|
108
|
-
* spec under its own name, whose
|
|
110
|
+
* How `updateBundle` replaces the bundle, absent when it cannot: `registry` for a third-party profile dependency saved
|
|
111
|
+
* as a registry spec under its own name, whose newer versions `listVersions` reads; `git` for one saved as a Git spec
|
|
112
|
+
* pinned to a full commit, which updates to another commit of the same repository directory. Either needs a semver
|
|
113
|
+
* manifest version and no plugin management.
|
|
109
114
|
*/
|
|
110
|
-
|
|
115
|
+
update?: 'registry' | 'git';
|
|
111
116
|
readOnlyReason?: ReadOnlyReason;
|
|
112
117
|
error?: ManagementError;
|
|
113
118
|
/** The rows the bundle's patch inserts, in declaration order; empty when the patch cannot be read. */
|
|
@@ -143,6 +148,12 @@ export interface PackageResult {
|
|
|
143
148
|
timedOut?: boolean;
|
|
144
149
|
/** Present when a compatibility check refused the run: the packages the running DSH version rejects. */
|
|
145
150
|
incompatible?: IncompatiblePlugin[];
|
|
151
|
+
/**
|
|
152
|
+
* Present when an `expected` check refused the run: `unexpected-package` when the run left the expected package
|
|
153
|
+
* missing or at another version, or added or changed another direct dependency; otherwise `not-bundle` when the
|
|
154
|
+
* expected package declares no bundle. The output names what the run installed.
|
|
155
|
+
*/
|
|
156
|
+
unmet?: 'unexpected-package' | 'not-bundle';
|
|
146
157
|
}
|
|
147
158
|
/** Persisted change and independently observed application outcome. */
|
|
148
159
|
export interface ChangeResult {
|
|
@@ -187,6 +198,16 @@ export interface InstallBundleOptions {
|
|
|
187
198
|
approvedBuilds?: string[];
|
|
188
199
|
/** The registry asked first; absent, the configured one. The configured fallbacks follow while a registry is unreachable or stale. */
|
|
189
200
|
registry?: Registry;
|
|
201
|
+
/**
|
|
202
|
+
* The package and manifest version the spec must install. An installation that leaves this package missing or at
|
|
203
|
+
* another version, or that adds or changes another direct dependency, is undone with its profile files and modules
|
|
204
|
+
* before its bundle loads, and fails with `unexpected-package`; one whose package declares no bundle is undone the
|
|
205
|
+
* same way and fails with `not-bundle`, and one whose bundle patches cannot load fails as an operation error.
|
|
206
|
+
*/
|
|
207
|
+
expected?: {
|
|
208
|
+
readonly name: string;
|
|
209
|
+
readonly version: string;
|
|
210
|
+
};
|
|
190
211
|
}
|
|
191
212
|
/** Where an inspection asks. */
|
|
192
213
|
export interface InspectOptions {
|
|
@@ -276,6 +297,11 @@ export interface ListVersionsOptions {
|
|
|
276
297
|
export interface UpdateBundleOptions {
|
|
277
298
|
/** The registry asked first, normally the one that answered `listVersions`; absent, as for `listVersions`. */
|
|
278
299
|
readonly registry?: Registry;
|
|
300
|
+
/**
|
|
301
|
+
* The Git spec of the target version: required for a bundle listed with `update: 'git'`, where it must pin a full
|
|
302
|
+
* commit of the installed copy's repository directory, and refused for any other.
|
|
303
|
+
*/
|
|
304
|
+
readonly spec?: string;
|
|
279
305
|
/** Names the update's progress and the target installation's logs; `cancelInstall` stops only that installation. */
|
|
280
306
|
readonly requestId?: PluginInstallRequestId;
|
|
281
307
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAA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qB,GAAG,IAAI,CAAA;QACrE;;;;;WAKG;QACH,6BAA6B,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAA;KACpE;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/versions.ts"],"names":[],"mappings":"AAGA,oHAAoH;AACpH,eAAO,MAAM,mBAAmB,4CAA6C,CAAA;AAE7E,gGAAgG;AAChG,eAAO,MAAM,cAAc,kFAAmF,CAAA;AAE9G,2FAA2F;AAC3F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAC7B;AAED,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IACnG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAOD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAmBpF;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAcz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C,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;YACtE,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;YACtE,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE;SAClG;QACD,MAAM,EAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,SAAS;QAC3C,GAAG,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;KAC7E,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-plugin-manager",
|
|
3
3
|
"description": "Current-profile plugin and bundle management shared by dsh CLI, Web and agent tools",
|
|
4
|
-
"version": "0.2.2-rc.
|
|
4
|
+
"version": "0.2.2-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -57,38 +57,42 @@
|
|
|
57
57
|
"lib/index.js",
|
|
58
58
|
"lib/types/**/*.js",
|
|
59
59
|
"lib/types/**/*.d.ts",
|
|
60
|
+
"lib/types/**/*.d.ts.map",
|
|
61
|
+
"lib/**/*.js.map",
|
|
60
62
|
"lib/typert.host.js",
|
|
61
63
|
"lib/typert.host.d.ts",
|
|
62
64
|
"lib/typert.remote-client.js",
|
|
63
|
-
"lib/typert.remote-client.d.ts"
|
|
65
|
+
"lib/typert.remote-client.d.ts",
|
|
66
|
+
"lib/typert.remote-client.d.ts.map",
|
|
67
|
+
"src"
|
|
64
68
|
],
|
|
65
69
|
"license": "MIT",
|
|
66
70
|
"dependencies": {
|
|
67
|
-
"@deepseek-ai/dsh-app-boot": "0.2.2-rc.
|
|
68
|
-
"@deepseek-ai/dsh-atomic-write": "0.2.2-rc.
|
|
69
|
-
"@deepseek-ai/dsh-official-bundles": "0.2.2-rc.
|
|
71
|
+
"@deepseek-ai/dsh-app-boot": "0.2.2-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-atomic-write": "0.2.2-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-official-bundles": "0.2.2-rc.2",
|
|
70
74
|
"@deepseek-ai/schemastery": "~3.19.0",
|
|
71
75
|
"execa": "^10.0.1",
|
|
72
76
|
"semver": "^7.8.5",
|
|
73
77
|
"yaml": "^2.9.0",
|
|
74
|
-
"zod": "4.
|
|
75
|
-
"@deepseek-ai/dsh-util-values": "0.2.2-rc.
|
|
76
|
-
"@deepseek-ai/dsh-plugin-detail": "0.2.2-rc.
|
|
77
|
-
"@deepseek-ai/dsh-timeout": "0.2.2-rc.
|
|
78
|
+
"zod": "4.6.6",
|
|
79
|
+
"@deepseek-ai/dsh-util-values": "0.2.2-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-plugin-detail": "0.2.2-rc.2",
|
|
81
|
+
"@deepseek-ai/dsh-timeout": "0.2.2-rc.2",
|
|
78
82
|
"hosted-git-info": "^9.0.3"
|
|
79
83
|
},
|
|
80
84
|
"peerDependencies": {
|
|
81
85
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
82
86
|
"@deepseek-ai/cordis-plugin-loader": "~1.1.0",
|
|
83
|
-
"@deepseek-ai/dsh-host-plugin-inventory": "0.2.2-rc.
|
|
84
|
-
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.
|
|
85
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.
|
|
86
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
87
|
-
"@deepseek-ai/dsh-hmr": "0.2.2-rc.
|
|
88
|
-
"@deepseek-ai/dsh-brand": "0.2.2-rc.
|
|
89
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.
|
|
90
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.
|
|
91
|
-
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.
|
|
87
|
+
"@deepseek-ai/dsh-host-plugin-inventory": "0.2.2-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.2",
|
|
90
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.2",
|
|
91
|
+
"@deepseek-ai/dsh-hmr": "0.2.2-rc.2",
|
|
92
|
+
"@deepseek-ai/dsh-brand": "0.2.2-rc.2",
|
|
93
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.2",
|
|
94
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
|
|
95
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.2"
|
|
92
96
|
},
|
|
93
97
|
"peerDependenciesMeta": {
|
|
94
98
|
"@deepseek-ai/dsh-hmr": {
|
|
@@ -101,26 +105,26 @@
|
|
|
101
105
|
"devDependencies": {
|
|
102
106
|
"chokidar": "^4.0.3",
|
|
103
107
|
"@types/semver": "^7.8.0",
|
|
104
|
-
"@deepseek-ai/dsh-package-manifest": "0.2.2-rc.
|
|
108
|
+
"@deepseek-ai/dsh-package-manifest": "0.2.2-rc.2",
|
|
105
109
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
106
110
|
"@deepseek-ai/cordis-plugin-loader": "~1.1.0",
|
|
107
|
-
"@deepseek-ai/dsh-host-plugin-inventory": "0.2.2-rc.
|
|
108
|
-
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.
|
|
109
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.
|
|
110
|
-
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.
|
|
111
|
-
"@deepseek-ai/dsh-tool-testkit": "0.2.2-rc.
|
|
112
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
113
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
114
|
-
"@deepseek-ai/dsh-hmr": "0.2.2-rc.
|
|
111
|
+
"@deepseek-ai/dsh-host-plugin-inventory": "0.2.2-rc.2",
|
|
112
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.2",
|
|
113
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.2",
|
|
114
|
+
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.2",
|
|
115
|
+
"@deepseek-ai/dsh-tool-testkit": "0.2.2-rc.2",
|
|
116
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.2",
|
|
117
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
|
|
118
|
+
"@deepseek-ai/dsh-hmr": "0.2.2-rc.2",
|
|
115
119
|
"@deepseek-ai/cordis-plugin-timer": "~1.2.0",
|
|
116
|
-
"@deepseek-ai/dsh-brand": "0.2.2-rc.
|
|
117
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.
|
|
118
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
119
|
-
"@deepseek-ai/dsh-session": "0.2.2-rc.
|
|
120
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
121
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.
|
|
122
|
-
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.
|
|
123
|
-
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.
|
|
120
|
+
"@deepseek-ai/dsh-brand": "0.2.2-rc.2",
|
|
121
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.2",
|
|
122
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.2",
|
|
123
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.2",
|
|
124
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.2",
|
|
125
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
|
|
126
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.2",
|
|
127
|
+
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.2",
|
|
124
128
|
"@types/hosted-git-info": "^3.0.5"
|
|
125
129
|
}
|
|
126
130
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** Approve pnpm's pending dependency scripts in the current profile's workspace settings. */
|
|
2
|
+
import { readFile } from 'node:fs/promises'
|
|
3
|
+
import { join } from 'node:path'
|
|
4
|
+
import { isAlias, isMap, isNode, isScalar, parseDocument, visit } from 'yaml'
|
|
5
|
+
import { ManagementFailure } from './failure.ts'
|
|
6
|
+
import { writeFileAtomic } from '@deepseek-ai/dsh-atomic-write'
|
|
7
|
+
|
|
8
|
+
/** Value pnpm leaves for a build script that still needs a decision. */
|
|
9
|
+
const UNDECIDED_BUILD = 'set this to true or false'
|
|
10
|
+
|
|
11
|
+
/** Where a non-interactive run names the build scripts it skipped. */
|
|
12
|
+
const IGNORED_BUILDS = /\bIgnored build scripts: (.+)/
|
|
13
|
+
|
|
14
|
+
/** The `allowBuilds` key pnpm suggests when it refuses to prepare a git-hosted package; a subdirectory key can contain spaces. */
|
|
15
|
+
const GIT_DEP_PREPARE = /ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED[\s\S]*?^allowBuilds:\r?\n[ \t]+(.+?): true$/m
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Whether an `allowBuilds` key names a git URL that carries a credential: a password, or any user name over HTTP(S).
|
|
19
|
+
* Such a key is not recorded, so the credential stays out of the profile settings and the pending list.
|
|
20
|
+
*/
|
|
21
|
+
function carriesCredential(key: string): boolean {
|
|
22
|
+
const at = key.indexOf('@git+')
|
|
23
|
+
if (at === -1) return false
|
|
24
|
+
const url = URL.parse(key.slice(at + '@git+'.length).replace(/#.*$/s, ''))
|
|
25
|
+
return url !== null && (url.password !== '' || (url.username !== '' && /^https?:$/.test(url.protocol)))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function readPolicy(dir: string) {
|
|
29
|
+
let text: string
|
|
30
|
+
try { text = await readFile(join(dir, 'pnpm-workspace.yaml'), 'utf8') }
|
|
31
|
+
catch (error) {
|
|
32
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
|
|
33
|
+
text = '{}\n'
|
|
34
|
+
}
|
|
35
|
+
const document = parseDocument(text)
|
|
36
|
+
if (document.errors[0] !== undefined) throw document.errors[0]
|
|
37
|
+
if (!isMap(document.contents)) throw new Error('pnpm-workspace.yaml must be a YAML mapping')
|
|
38
|
+
const builds = document.get('allowBuilds')
|
|
39
|
+
if (builds !== undefined && !isMap(builds)) throw new Error('allowBuilds must be a YAML mapping')
|
|
40
|
+
visit(builds ?? null, (_key, node) => {
|
|
41
|
+
if (isAlias(node) || (isNode(node) && 'anchor' in node && node.anchor)) {
|
|
42
|
+
throw new Error('allowBuilds must not contain YAML anchors or aliases')
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
const keys = isMap(builds) ? builds.items.flatMap(({ key }) =>
|
|
46
|
+
isScalar(key) && typeof key.value === 'string' ? [key.value] : []) : []
|
|
47
|
+
const pending = isMap(builds) ? builds.items.flatMap(({ key, value }) =>
|
|
48
|
+
isScalar(key) && typeof key.value === 'string' && !/[*?]/.test(key.value)
|
|
49
|
+
&& isScalar(value) && value.value === UNDECIDED_BUILD ? [key.value] : []) : []
|
|
50
|
+
return { document, pending, keys }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Record the build scripts a failed run reported as blocked, then list every `allowBuilds` key awaiting a decision.
|
|
55
|
+
*
|
|
56
|
+
* pnpm writes those policy entries itself only when it can prompt, and the
|
|
57
|
+
* manager always runs it non-interactively, so the run's own report is the
|
|
58
|
+
* record that survives.
|
|
59
|
+
* @param dir Current profile directory.
|
|
60
|
+
* @param output Captured output of the failed run.
|
|
61
|
+
* @returns Exact `allowBuilds` keys awaiting a build decision; wildcard rules are excluded.
|
|
62
|
+
*/
|
|
63
|
+
export async function recordPendingBuilds(dir: string, output: string): Promise<string[]> {
|
|
64
|
+
const { document, pending, keys } = await readPolicy(dir)
|
|
65
|
+
const known = new Set(keys)
|
|
66
|
+
const added = blockedBuildNames(output).filter(name => !known.has(name))
|
|
67
|
+
if (added.length === 0) return pending
|
|
68
|
+
for (const name of added) document.setIn(['allowBuilds', name], UNDECIDED_BUILD)
|
|
69
|
+
await writeFileAtomic(join(dir, 'pnpm-workspace.yaml'), String(document), { mode: 0o600 })
|
|
70
|
+
return [...pending, ...added]
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Read the `allowBuilds` keys a pnpm run reported as ignored build scripts or as a git-hosted package it refused to prepare.
|
|
75
|
+
* @param output Captured output of the run.
|
|
76
|
+
* @returns Exact keys in report order; wildcard patterns and git keys carrying a credential are excluded.
|
|
77
|
+
*/
|
|
78
|
+
export function blockedBuildNames(output: string): string[] {
|
|
79
|
+
const ignored = IGNORED_BUILDS.exec(output)?.[1]?.split(',') ?? []
|
|
80
|
+
const git = GIT_DEP_PREPARE.exec(output)?.[1]
|
|
81
|
+
return [...ignored, ...git === undefined ? [] : [git]]
|
|
82
|
+
.map(name => name.trim()).filter(name => name !== '' && !/[*?]/.test(name) && !carriesCredential(name))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Persist approval without running scripts; the caller holds the profile manifest lock.
|
|
86
|
+
* @param dir Current profile directory.
|
|
87
|
+
* @param names Explicit package names from the pending build list.
|
|
88
|
+
* @throws If a name is no longer pending or allowBuilds contains YAML anchors or aliases; no approvals are written.
|
|
89
|
+
*/
|
|
90
|
+
export async function approveBuilds(dir: string, names: readonly string[]): Promise<void> {
|
|
91
|
+
const { document, pending } = await readPolicy(dir)
|
|
92
|
+
if (names.some(name => !pending.includes(name))) throw new ManagementFailure('stale-approval')
|
|
93
|
+
if (names.length === 0) return
|
|
94
|
+
for (const name of names) document.setIn(['allowBuilds', name], true)
|
|
95
|
+
await writeFileAtomic(join(dir, 'pnpm-workspace.yaml'), String(document), { mode: 0o600 })
|
|
96
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detail documents of profile bundles: an installed bundle's `meta.detail` file or README from its directory, and an
|
|
3
|
+
* official bundle the installation offers, before it is installed, from the npm file CDNs at its offered version. Reads
|
|
4
|
+
* keep no state; an image request resolves its bundle and document again.
|
|
5
|
+
*/
|
|
6
|
+
import semver from 'semver'
|
|
7
|
+
import { resolveBundleDir } from '@deepseek-ai/dsh-app-boot'
|
|
8
|
+
import type { ProfileContext } from '@deepseek-ai/dsh-app-boot'
|
|
9
|
+
import {
|
|
10
|
+
DetailFailure, detailImage, languageChain, localFiles, npmFileSourceOrder, npmFiles, readPackageDocument,
|
|
11
|
+
type DetailFiles, type NpmFileSource,
|
|
12
|
+
} from '@deepseek-ai/dsh-plugin-detail'
|
|
13
|
+
import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
|
|
14
|
+
import type { BundleDetail, BundleInfo } from './types.ts'
|
|
15
|
+
|
|
16
|
+
/** Limits and sources of bundle detail reads. */
|
|
17
|
+
export interface BundleDetailOptions {
|
|
18
|
+
readonly profile: ProfileContext
|
|
19
|
+
readonly maxDocumentBytes: number
|
|
20
|
+
readonly maxImageBytes: number
|
|
21
|
+
readonly npmFileSources: readonly NpmFileSource[]
|
|
22
|
+
/** Deadline of one CDN request. */
|
|
23
|
+
readonly timeoutMs: number
|
|
24
|
+
/** The plugin manager's disposal. */
|
|
25
|
+
readonly lifetime: AbortSignal
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The files of a listed bundle: its directory when its files can be read, otherwise its offered npm version.
|
|
30
|
+
* @param bundle - the bundle as `listBundles()` reports it.
|
|
31
|
+
* @param preferred - npm file CDNs to ask first for an offered version; see `npmFileSourceOrder`.
|
|
32
|
+
* @param options - profile, sources, and limits.
|
|
33
|
+
* @returns the files, or undefined for a bundle offered at no published version.
|
|
34
|
+
* @throws {RemoteError} `plugin-manager/unknown-bundle` when the bundle's directory cannot be resolved.
|
|
35
|
+
*/
|
|
36
|
+
function filesOf(bundle: BundleInfo, preferred: readonly string[], options: BundleDetailOptions): DetailFiles | undefined {
|
|
37
|
+
if (bundle.availability !== 'missing') {
|
|
38
|
+
let dir: string
|
|
39
|
+
try {
|
|
40
|
+
dir = resolveBundleDir('dsh', bundle.name, options.profile.installAnchor, options.profile.dir)
|
|
41
|
+
} catch (error) {
|
|
42
|
+
throw new RemoteError('plugin-manager/unknown-bundle', (error as Error).message, { name: bundle.name }, { cause: error })
|
|
43
|
+
}
|
|
44
|
+
// `listBundles()` reports the version of every bundle whose manifest it read; one without is read as unversioned.
|
|
45
|
+
return localFiles(dir, String(bundle.version))
|
|
46
|
+
}
|
|
47
|
+
const version = bundle.installTarget?.version
|
|
48
|
+
if (version === undefined || semver.valid(version) !== version) return undefined
|
|
49
|
+
const sources = npmFileSourceOrder(options.npmFileSources, preferred)
|
|
50
|
+
return npmFiles(bundle.name, version, sources, { timeoutMs: options.timeoutMs, lifetime: options.lifetime })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Rethrow a detail failure as the Remote error clients read. */
|
|
54
|
+
function remoteFailure(error: unknown): never {
|
|
55
|
+
if (error instanceof DetailFailure) {
|
|
56
|
+
throw new RemoteError('plugin-manager/detail-unavailable', error.message, { reason: error.reason }, { cause: error })
|
|
57
|
+
}
|
|
58
|
+
throw error
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Read a bundle's detail document in a display language.
|
|
63
|
+
* @param bundle - the bundle as `listBundles()` reports it.
|
|
64
|
+
* @param language - a BCP 47 language id.
|
|
65
|
+
* @param preferred - npm file CDNs to ask first for an offered version; see `npmFileSourceOrder`.
|
|
66
|
+
* @param options - profile, sources, and limits.
|
|
67
|
+
* @returns the document, or `none` when the bundle has neither a `meta.detail` file nor a README.
|
|
68
|
+
* @throws {RemoteError} `plugin-manager/invalid-language`, `plugin-manager/unknown-bundle`, or
|
|
69
|
+
* `plugin-manager/detail-unavailable`.
|
|
70
|
+
*/
|
|
71
|
+
export async function readBundleDocument(
|
|
72
|
+
bundle: BundleInfo, language: string, preferred: readonly string[], options: BundleDetailOptions,
|
|
73
|
+
): Promise<BundleDetail> {
|
|
74
|
+
let languages: string[]
|
|
75
|
+
try {
|
|
76
|
+
languages = languageChain(language)
|
|
77
|
+
} catch (error) {
|
|
78
|
+
throw new RemoteError('plugin-manager/invalid-language', (error as Error).message, { language }, { cause: error })
|
|
79
|
+
}
|
|
80
|
+
const files = filesOf(bundle, preferred, options)
|
|
81
|
+
if (files === undefined) return { status: 'none' }
|
|
82
|
+
const document = await readPackageDocument(files, '', languages, options.maxDocumentBytes, options.lifetime).catch(remoteFailure)
|
|
83
|
+
return document === undefined ? { status: 'none' } : { status: 'found', ...document }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Read an image beside a bundle's detail document.
|
|
88
|
+
* @param bundle - the bundle as `listBundles()` reports it.
|
|
89
|
+
* @param document - the document's path inside the bundle, as {@link readBundleDocument} returned it.
|
|
90
|
+
* @param destination - the image destination as the document writes it.
|
|
91
|
+
* @param preferred - npm file CDNs to ask first for an offered version; see `npmFileSourceOrder`.
|
|
92
|
+
* @param options - profile, sources, and limits.
|
|
93
|
+
* @returns the bytes and media type, or undefined for a path outside the bundle, an unsupported type, or a missing file.
|
|
94
|
+
* @throws {RemoteError} `plugin-manager/unknown-bundle` or `plugin-manager/detail-unavailable`.
|
|
95
|
+
*/
|
|
96
|
+
export async function readBundleImage(
|
|
97
|
+
bundle: BundleInfo, document: string, destination: string, preferred: readonly string[], options: BundleDetailOptions,
|
|
98
|
+
): Promise<{ bytes: Uint8Array; mediaType: string } | undefined> {
|
|
99
|
+
const image = detailImage(document, destination)
|
|
100
|
+
const files = image === undefined ? undefined : filesOf(bundle, preferred, options)
|
|
101
|
+
if (image === undefined || files === undefined) return undefined
|
|
102
|
+
const bytes = await files.read(image.path, options.maxImageBytes, options.lifetime).catch(remoteFailure)
|
|
103
|
+
return bytes === undefined ? undefined : { bytes, mediaType: image.mediaType }
|
|
104
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Whitelisted operation records shared by diagnostic transport and durable readers. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
import type { Branded } from '@deepseek-ai/dsh-brand'
|
|
4
|
+
import type { ChangeResult, ManagementError, PluginChange, PluginOperation, PluginOperationId, RestartReason } from './types.ts'
|
|
5
|
+
|
|
6
|
+
/** Identifies the process lifetime which observed management operations. */
|
|
7
|
+
export type PluginOperationRunId = Branded<'PluginOperationRunId'>
|
|
8
|
+
|
|
9
|
+
/** One diagnostic event; omissions and unknown outcomes must not be interpreted as successful operations. */
|
|
10
|
+
export interface PluginOperationRecord {
|
|
11
|
+
readonly runId: PluginOperationRunId
|
|
12
|
+
readonly operation: PluginOperation
|
|
13
|
+
readonly transportDropped: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const fields = {
|
|
17
|
+
id: z.uuid().transform(value => value as PluginOperationId),
|
|
18
|
+
time: z.iso.datetime(),
|
|
19
|
+
reason: z.enum({
|
|
20
|
+
'plugin': 'plugin',
|
|
21
|
+
'bundle': 'bundle',
|
|
22
|
+
'install': 'install',
|
|
23
|
+
'remove': 'remove',
|
|
24
|
+
} satisfies { [K in PluginChange['reason']]: K }),
|
|
25
|
+
target: z.string().max(256).nullable(),
|
|
26
|
+
stage: z.enum({
|
|
27
|
+
'install': 'install',
|
|
28
|
+
'enable': 'enable',
|
|
29
|
+
'remove': 'remove',
|
|
30
|
+
} satisfies { [K in ChangeResult['stage']]: K }),
|
|
31
|
+
enabled: z.boolean().optional(),
|
|
32
|
+
version: z.string().max(128).optional(),
|
|
33
|
+
}
|
|
34
|
+
const operation: z.ZodType<PluginOperation> = z.discriminatedUnion('phase', [
|
|
35
|
+
z.object({ ...fields, phase: z.literal('started') }),
|
|
36
|
+
z.object({ ...fields, phase: z.literal('unknown') }),
|
|
37
|
+
z.object({ ...fields, phase: z.literal('settled'),
|
|
38
|
+
application: z.enum({
|
|
39
|
+
'applied': 'applied',
|
|
40
|
+
'restart-required': 'restart-required',
|
|
41
|
+
'overridden': 'overridden',
|
|
42
|
+
'failed': 'failed',
|
|
43
|
+
'cancelled': 'cancelled',
|
|
44
|
+
} satisfies { [K in ChangeResult['application']]: K }),
|
|
45
|
+
changed: z.boolean(),
|
|
46
|
+
errorCode: z.enum({
|
|
47
|
+
'management-required': 'management-required',
|
|
48
|
+
'unaddressable': 'unaddressable',
|
|
49
|
+
'unknown-plugin': 'unknown-plugin',
|
|
50
|
+
'invalid-spec': 'invalid-spec',
|
|
51
|
+
'already-installed': 'already-installed',
|
|
52
|
+
'ambiguous-install': 'ambiguous-install',
|
|
53
|
+
'not-bundle': 'not-bundle',
|
|
54
|
+
'not-removable': 'not-removable',
|
|
55
|
+
'stop-profile': 'stop-profile',
|
|
56
|
+
'bundle-in-use': 'bundle-in-use',
|
|
57
|
+
'stale-approval': 'stale-approval',
|
|
58
|
+
'incompatible-version': 'incompatible-version',
|
|
59
|
+
'unsupported-platform': 'unsupported-platform',
|
|
60
|
+
'unexpected-package': 'unexpected-package',
|
|
61
|
+
'operation-error': 'operation-error',
|
|
62
|
+
} satisfies { [K in ManagementError['code']]: K }).optional(),
|
|
63
|
+
restartReason: z.enum({
|
|
64
|
+
'no-hmr': 'no-hmr',
|
|
65
|
+
'package-moved': 'package-moved',
|
|
66
|
+
'host-module': 'host-module',
|
|
67
|
+
'unmanaged-plugin': 'unmanaged-plugin',
|
|
68
|
+
'module-comparison': 'module-comparison',
|
|
69
|
+
} satisfies { [K in RestartReason]: K }).optional(),
|
|
70
|
+
}),
|
|
71
|
+
])
|
|
72
|
+
const record = z.object({
|
|
73
|
+
runId: z.uuid().transform(value => value as PluginOperationRunId),
|
|
74
|
+
operation,
|
|
75
|
+
transportDropped: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Validate transport/file data and discard fields outside the diagnostic whitelist.
|
|
80
|
+
* @param value - Untrusted decoded JSON.
|
|
81
|
+
* @returns A bounded record, or undefined for malformed, oversized or unsupported records.
|
|
82
|
+
*/
|
|
83
|
+
export function parsePluginOperationRecord(value: unknown): PluginOperationRecord | undefined {
|
|
84
|
+
const parsed = record.safeParse(value)
|
|
85
|
+
return parsed.success ? parsed.data : undefined
|
|
86
|
+
}
|
package/src/failure.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Localizable rejections shared by profile management operations. */
|
|
2
|
+
import type { PluginCompatibility } from '@deepseek-ai/dsh-app-boot'
|
|
3
|
+
import type { IncompatiblePlugin, ManagementError } from './types.ts'
|
|
4
|
+
|
|
5
|
+
/** Expected management rejection; presentation belongs to the caller's locale. */
|
|
6
|
+
export class ManagementFailure extends Error {
|
|
7
|
+
/** Code rendered by the caller's locale dictionary. */
|
|
8
|
+
readonly code: ManagementError['code']
|
|
9
|
+
/** The packages an `incompatible-version` rejection names. */
|
|
10
|
+
readonly incompatible: IncompatiblePlugin[] | undefined
|
|
11
|
+
/**
|
|
12
|
+
* @param code Localizable management rejection.
|
|
13
|
+
* @param incompatible Packages the running DSH version rejects, for `incompatible-version`.
|
|
14
|
+
*/
|
|
15
|
+
constructor(code: ManagementError['code'], incompatible?: IncompatiblePlugin[]) {
|
|
16
|
+
super(code)
|
|
17
|
+
this.code = code
|
|
18
|
+
this.incompatible = incompatible
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Drop the exemption status from an unexempted compatibility result.
|
|
24
|
+
* @param issue Result whose exemption is not active.
|
|
25
|
+
* @returns The package, runtime, and unmet DSH requirements.
|
|
26
|
+
*/
|
|
27
|
+
export function incompatiblePlugin(issue: PluginCompatibility): IncompatiblePlugin {
|
|
28
|
+
return { name: issue.name, version: issue.version, runtimeVersion: issue.runtimeVersion, requirements: issue.requirements }
|
|
29
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** The Git transport an installation of a self-hosted repository uses, chosen by probing access before pnpm starts. */
|
|
2
|
+
import { execa } from 'execa'
|
|
3
|
+
import hostedGitInfo from 'hosted-git-info'
|
|
4
|
+
import { scrubbedParentEnv } from '@deepseek-ai/dsh-subprocess'
|
|
5
|
+
import type { ParsedInstallSpec } from './install-spec.ts'
|
|
6
|
+
|
|
7
|
+
/** Deadline and cancellation for each read-only access probe. */
|
|
8
|
+
export interface GitTransportOptions {
|
|
9
|
+
timeoutMs: number
|
|
10
|
+
signal: AbortSignal
|
|
11
|
+
/** The application-owned package manager's environment, also used by its Git children. */
|
|
12
|
+
env?: Readonly<Record<string, string>>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** An HTTP(S) Git URL with an optional `git+` prefix, which pnpm clones over that transport as written. */
|
|
16
|
+
const HTTP_GIT_URL = /^(?:git\+)?https?:\/\//i
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The SSH form of an HTTP(S) Git spec on a host pnpm has no transport fallback for. pnpm tries HTTPS and SSH itself
|
|
20
|
+
* for the hosts `hosted-git-info` knows, such as GitHub and GitLab.com, and clones any other URL over the transport
|
|
21
|
+
* it names.
|
|
22
|
+
* @param spec The parsed installation address.
|
|
23
|
+
* @returns `git+ssh://git@<host>/<path>` on SSH's default port with the spec's fragment, or `undefined` for a spec that
|
|
24
|
+
* is not an HTTP(S) Git URL on such a host, or whose URL carries credentials or a query.
|
|
25
|
+
*/
|
|
26
|
+
export function sshGitSpec(spec: ParsedInstallSpec): string | undefined {
|
|
27
|
+
if (spec.kind !== 'git' || !HTTP_GIT_URL.test(spec.spec) || hostedGitInfo.fromUrl(spec.spec) !== undefined) return undefined
|
|
28
|
+
const url = new URL(spec.spec.replace(/^git\+/i, ''))
|
|
29
|
+
if (url.username !== '' || url.password !== '' || url.search !== '') return undefined
|
|
30
|
+
// The fragment is copied as written: WHATWG serialization would percent-encode some of its characters.
|
|
31
|
+
const hash = /#.*$/s.exec(spec.spec)?.[0] ?? ''
|
|
32
|
+
return `git+ssh://git@${url.hostname}${url.pathname}${hash}`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Probe whether Git can read a repository with the installer's Git configuration and credential helpers. Git's
|
|
37
|
+
* terminal and askpass prompts are disabled, `core.askPass` included because Windows drops the empty `GIT_ASKPASS`,
|
|
38
|
+
* and on POSIX the probe has no controlling terminal, so SSH cannot ask about host keys or passphrases either.
|
|
39
|
+
* @param repository The repository URL Git reads.
|
|
40
|
+
* @param dir The profile directory where installation runs.
|
|
41
|
+
* @param options The probe deadline, cancellation and environment.
|
|
42
|
+
* @returns Whether `git ls-remote` listed the repository's HEAD.
|
|
43
|
+
*/
|
|
44
|
+
async function readable(repository: string, dir: string, options: GitTransportOptions): Promise<boolean> {
|
|
45
|
+
const result = await execa('git', ['-c', 'core.askPass=', 'ls-remote', '--exit-code', '--', repository, 'HEAD'], {
|
|
46
|
+
cwd: dir,
|
|
47
|
+
env: {
|
|
48
|
+
...scrubbedParentEnv(), ...options.env, LC_ALL: 'C', GIT_TERMINAL_PROMPT: '0', GCM_INTERACTIVE: 'never',
|
|
49
|
+
GIT_ASKPASS: '', SSH_ASKPASS: '', SSH_ASKPASS_REQUIRE: 'never',
|
|
50
|
+
},
|
|
51
|
+
extendEnv: false, stdin: 'ignore', stdout: 'ignore', stderr: 'ignore', reject: false,
|
|
52
|
+
timeout: options.timeoutMs, cancelSignal: options.signal, killDescendants: true, killSignal: 'SIGKILL',
|
|
53
|
+
})
|
|
54
|
+
return !result.failed
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Choose how pnpm clones an HTTP(S) Git repository that {@link sshGitSpec} has an SSH form for: probe the spec's URL,
|
|
59
|
+
* and when HTTP(S) cannot read it, probe the SSH form.
|
|
60
|
+
* @param spec The parsed installation address.
|
|
61
|
+
* @param dir The profile directory where installation runs.
|
|
62
|
+
* @param options The deadline of each probe, cancellation and the installer's environment.
|
|
63
|
+
* @returns The SSH form when only SSH can read the repository; otherwise the spec unchanged.
|
|
64
|
+
*/
|
|
65
|
+
export async function chooseGitTransport(spec: ParsedInstallSpec, dir: string, options: GitTransportOptions): Promise<string> {
|
|
66
|
+
const ssh = sshGitSpec(spec)
|
|
67
|
+
if (ssh === undefined) return spec.spec
|
|
68
|
+
const strip = (value: string): string => value.replace(/^git\+/i, '').replace(/#.*$/s, '')
|
|
69
|
+
if (await readable(strip(spec.spec), dir, options)) return spec.spec
|
|
70
|
+
if (options.signal.aborted || !await readable(strip(ssh), dir, options)) return spec.spec
|
|
71
|
+
return ssh
|
|
72
|
+
}
|