@sparkelf/dsh-plus 0.2.2-alpha.2.1 → 0.2.2-alpha.2.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.
- package/lib/bin.js +67 -19
- package/lib/types/standalone-cli.js +40 -3
- package/lib/types/standalone-profile.js +60 -20
- package/package.json +28 -51
package/lib/bin.js
CHANGED
|
@@ -900,11 +900,12 @@ function isWithin(candidate, parent, platform = process.platform) {
|
|
|
900
900
|
* @returns absolute path to the installed distribution.
|
|
901
901
|
*/
|
|
902
902
|
function resolveDistributionDirectory(anchor) {
|
|
903
|
+
const ownDirectory = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
903
904
|
let resolved;
|
|
904
905
|
try {
|
|
905
906
|
resolved = dirname(createRequire(anchor).resolve("@sparkelf/dsh-plus/package.json"));
|
|
906
907
|
} catch {
|
|
907
|
-
|
|
908
|
+
return ownDirectory;
|
|
908
909
|
}
|
|
909
910
|
let current = resolve(dirname(anchor));
|
|
910
911
|
for (;;) {
|
|
@@ -913,7 +914,7 @@ function resolveDistributionDirectory(anchor) {
|
|
|
913
914
|
if (parent === current) break;
|
|
914
915
|
current = parent;
|
|
915
916
|
}
|
|
916
|
-
|
|
917
|
+
return ownDirectory;
|
|
917
918
|
}
|
|
918
919
|
function readDistributionProfile(distributionDirectory) {
|
|
919
920
|
const manifest = requireRecord(JSON.parse(readFileSync(join(distributionDirectory, "package.json"), "utf8")), "Plus distribution manifest");
|
|
@@ -982,7 +983,11 @@ function requireDependencyMap(value, label) {
|
|
|
982
983
|
* @param consumerDirectory - directory whose `node_modules` holds the installation.
|
|
983
984
|
*/
|
|
984
985
|
function installProfilePackages(paths, consumerDirectory) {
|
|
985
|
-
if (!existsSync(join(consumerDirectory, "node_modules")))
|
|
986
|
+
if (!existsSync(join(consumerDirectory, "node_modules"))) {
|
|
987
|
+
installWithRegistryFallback(paths);
|
|
988
|
+
alignReplacedPackageNames(join(paths.profileDirectory, "node_modules"));
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
986
991
|
const profileModules = join(paths.profileDirectory, "node_modules");
|
|
987
992
|
if (existsSync(profileModules)) {
|
|
988
993
|
linkNestedBundles(paths, profileModules);
|
|
@@ -1004,6 +1009,7 @@ function installProfilePackages(paths, consumerDirectory) {
|
|
|
1004
1009
|
function installWithRegistryFallback(paths) {
|
|
1005
1010
|
const registries = registryOrder();
|
|
1006
1011
|
for (const [index, registry] of registries.entries()) {
|
|
1012
|
+
if (index > 0) rmSync(join(paths.profileDirectory, "pnpm-lock.yaml"), { force: true });
|
|
1007
1013
|
const result = spawnSync("pnpm", [
|
|
1008
1014
|
"install",
|
|
1009
1015
|
"--no-frozen-lockfile",
|
|
@@ -1072,7 +1078,7 @@ const MAINLAND_REGISTRY = "https://registry.npmmirror.com";
|
|
|
1072
1078
|
*/
|
|
1073
1079
|
function registryOrder() {
|
|
1074
1080
|
const configured = process.env.DSH_PLUS_INSTALL_REGISTRY;
|
|
1075
|
-
if (configured !== void 0 && configured !== "") return [configured, MAINLAND_REGISTRY];
|
|
1081
|
+
if (configured !== void 0 && configured !== "") return [configured, configured === MAINLAND_REGISTRY ? OFFICIAL_REGISTRY : MAINLAND_REGISTRY];
|
|
1076
1082
|
const locale = [
|
|
1077
1083
|
process.env.LANG,
|
|
1078
1084
|
process.env.LC_ALL,
|
|
@@ -1184,20 +1190,32 @@ function ensureProfile(paths, consumerDirectory, edition) {
|
|
|
1184
1190
|
const offered = Object.keys(distribution.editions);
|
|
1185
1191
|
throw new Error("unknown edition \"" + edition + "\"; this release offers " + (offered.length === 0 ? "(none)" : offered.join(", ")));
|
|
1186
1192
|
}
|
|
1187
|
-
const
|
|
1188
|
-
const
|
|
1193
|
+
for (const name of Object.keys(composition?.packages ?? {})) if (name.startsWith("@deepseek-ai/")) throw new Error("edition \"" + String(edition) + "\" lists the official package " + name + "; editions contain only third-party or self-developed plugins");
|
|
1194
|
+
const runtime = distribution.dshRange.replace(/^>=?/u, "");
|
|
1195
|
+
const baseBundles = composition === void 0 ? distribution.bundles : distribution.bundles.filter((bundle) => bundle.startsWith("@deepseek-ai/") || bundle === "@sparkelf/dsh-plus");
|
|
1196
|
+
const basePackages = composition === void 0 ? distribution.dependencies : {
|
|
1197
|
+
"@deepseek-ai/dsh": distribution.dshRange,
|
|
1198
|
+
"@sparkelf/dsh-plus": distribution.version,
|
|
1199
|
+
...Object.fromEntries(baseBundles.filter((bundle) => bundle.startsWith("@deepseek-ai/dsh-")).map((bundle) => [bundle, runtime]))
|
|
1200
|
+
};
|
|
1201
|
+
const compositionPackages = composition === void 0 ? basePackages : {
|
|
1202
|
+
...basePackages,
|
|
1203
|
+
...composition.packages
|
|
1204
|
+
};
|
|
1205
|
+
const compositionBundles = composition === void 0 ? baseBundles : [...baseBundles, ...composition.bundles];
|
|
1189
1206
|
if (existsSync(manifestPath)) {
|
|
1190
1207
|
if (composition !== void 0) {
|
|
1191
1208
|
const manifest = requireRecord(JSON.parse(readFileSync(manifestPath, "utf8")), "Plus profile manifest");
|
|
1192
1209
|
manifest.dependencies = {
|
|
1193
1210
|
...manifest.dependencies,
|
|
1194
|
-
...
|
|
1211
|
+
...compositionPackages
|
|
1195
1212
|
};
|
|
1196
1213
|
manifest.dsh = {
|
|
1197
1214
|
...manifest.dsh,
|
|
1198
1215
|
profile: {
|
|
1199
1216
|
...manifest.dsh?.profile,
|
|
1200
|
-
bundles: [...
|
|
1217
|
+
bundles: [...compositionBundles],
|
|
1218
|
+
...edition === void 0 ? {} : { plusEdition: edition }
|
|
1201
1219
|
}
|
|
1202
1220
|
};
|
|
1203
1221
|
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + "\n");
|
|
@@ -1211,15 +1229,11 @@ function ensureProfile(paths, consumerDirectory, edition) {
|
|
|
1211
1229
|
name: "dsh-profile-plus",
|
|
1212
1230
|
private: true,
|
|
1213
1231
|
type: "module",
|
|
1214
|
-
dependencies:
|
|
1215
|
-
"@sparkelf/dsh-plus": distribution.version,
|
|
1216
|
-
"@deepseek-ai/dsh": distribution.dshRange,
|
|
1217
|
-
...distribution.dependencies,
|
|
1218
|
-
...editionPackages
|
|
1219
|
-
},
|
|
1232
|
+
dependencies: compositionPackages,
|
|
1220
1233
|
dsh: { profile: {
|
|
1221
|
-
bundles: [...
|
|
1222
|
-
patchReload: "live"
|
|
1234
|
+
bundles: [...compositionBundles],
|
|
1235
|
+
patchReload: "live",
|
|
1236
|
+
...edition === void 0 ? {} : { plusEdition: edition }
|
|
1223
1237
|
} }
|
|
1224
1238
|
};
|
|
1225
1239
|
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + "\n");
|
|
@@ -1483,6 +1497,7 @@ function runForeground(entry, profileName, port, host, open) {
|
|
|
1483
1497
|
/** Parse the install command's edition selection. */
|
|
1484
1498
|
function parseInstallOptions(argv) {
|
|
1485
1499
|
let edition;
|
|
1500
|
+
let profile;
|
|
1486
1501
|
for (let index = 0; index < argv.length; index += 1) {
|
|
1487
1502
|
const token = argv[index];
|
|
1488
1503
|
if (token === "--edition") {
|
|
@@ -1492,10 +1507,20 @@ function parseInstallOptions(argv) {
|
|
|
1492
1507
|
index += 1;
|
|
1493
1508
|
continue;
|
|
1494
1509
|
}
|
|
1510
|
+
if (token === "--profile") {
|
|
1511
|
+
const value = argv[index + 1];
|
|
1512
|
+
if (value === void 0 || value === "") throw new Error("--profile requires a value");
|
|
1513
|
+
profile = value;
|
|
1514
|
+
index += 1;
|
|
1515
|
+
continue;
|
|
1516
|
+
}
|
|
1495
1517
|
throw new Error("unknown option: " + String(token));
|
|
1496
1518
|
}
|
|
1497
1519
|
if (edition === void 0) throw new Error("install requires --edition personal or --edition team");
|
|
1498
|
-
return {
|
|
1520
|
+
return {
|
|
1521
|
+
edition,
|
|
1522
|
+
profile
|
|
1523
|
+
};
|
|
1499
1524
|
}
|
|
1500
1525
|
/**
|
|
1501
1526
|
* Install one edition's package manifest into the profile.
|
|
@@ -1508,8 +1533,13 @@ function parseInstallOptions(argv) {
|
|
|
1508
1533
|
* @returns the process exit code.
|
|
1509
1534
|
*/
|
|
1510
1535
|
function install(argv) {
|
|
1511
|
-
const { edition } = parseInstallOptions(argv);
|
|
1512
|
-
const
|
|
1536
|
+
const { edition, profile } = parseInstallOptions(argv);
|
|
1537
|
+
const base = resolvePaths(declarationAnchor());
|
|
1538
|
+
const paths = profile === void 0 ? base : {
|
|
1539
|
+
...base,
|
|
1540
|
+
profileName: profile,
|
|
1541
|
+
profileDirectory: join(base.home, "profiles", profile)
|
|
1542
|
+
};
|
|
1513
1543
|
ensureProfile(paths, installationRoot(), edition);
|
|
1514
1544
|
console.log("Installed the " + edition + " edition into " + paths.profileDirectory);
|
|
1515
1545
|
return 0;
|
|
@@ -1892,6 +1922,23 @@ async function doctor() {
|
|
|
1892
1922
|
const record = readCapabilityRecord(paths.home);
|
|
1893
1923
|
const drifted = record === void 0 ? [] : CAPABILITIES.filter((capability) => record.enabled.includes(capability.id) !== actual.mounted.includes(capability.id));
|
|
1894
1924
|
check(drifted.length === 0, drifted.length === 0 ? "capabilities: " + (actual.mounted.length === 0 ? "(none enabled)" : actual.mounted.join(", ")) : "capabilities disagree with capabilities.json: " + drifted.map((capability) => capability.id).join(", ") + " (run dsh-plus capabilities)");
|
|
1925
|
+
const profileManifestPath = join(paths.profileDirectory, "package.json");
|
|
1926
|
+
if (existsSync(profileManifestPath)) {
|
|
1927
|
+
const profileManifest = JSON.parse(readFileSync(profileManifestPath, "utf8"));
|
|
1928
|
+
const editionId = profileManifest.dsh?.profile?.plusEdition;
|
|
1929
|
+
if (editionId !== void 0) {
|
|
1930
|
+
const edition = readDistributionProfile(paths.distributionDirectory).editions[editionId];
|
|
1931
|
+
if (edition === void 0) check(false, "edition \"" + editionId + "\" is not declared by this distribution");
|
|
1932
|
+
else {
|
|
1933
|
+
const bundles = new Set(profileManifest.dsh?.profile?.bundles ?? []);
|
|
1934
|
+
const missingBundles = edition.bundles.filter((bundle) => !bundles.has(bundle));
|
|
1935
|
+
const packageNames = Object.keys(edition.packages);
|
|
1936
|
+
const missingPackages = packageNames.filter((name) => !existsSync(join(paths.profileDirectory, "node_modules", ...name.split("/"), "package.json")));
|
|
1937
|
+
check(missingBundles.length === 0, "edition " + editionId + ": " + String(edition.bundles.length - missingBundles.length) + "/" + String(edition.bundles.length) + " bundles mounted" + (missingBundles.length === 0 ? "" : " (missing " + missingBundles.join(", ") + ")"));
|
|
1938
|
+
check(missingPackages.length === 0, "edition " + editionId + ": " + String(packageNames.length - missingPackages.length) + "/" + String(packageNames.length) + " packages installed" + (missingPackages.length === 0 ? "" : " (missing " + missingPackages.join(", ") + ")"));
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1895
1942
|
console.log(failures === 0 ? "No problems found." : String(failures) + " problem(s) found.");
|
|
1896
1943
|
return failures === 0 ? 0 : 1;
|
|
1897
1944
|
}
|
|
@@ -1916,6 +1963,7 @@ const USAGE = [
|
|
|
1916
1963
|
"",
|
|
1917
1964
|
"install options:",
|
|
1918
1965
|
" --edition <id> package manifest to install (personal or team)",
|
|
1966
|
+
" --profile <n> profile name to install into (default: this installation)",
|
|
1919
1967
|
"",
|
|
1920
1968
|
"capabilities options:",
|
|
1921
1969
|
" --enable <ids> enable the comma-separated capability ids",
|
|
@@ -169,6 +169,7 @@ function runForeground(entry, profileName, port, host, open) {
|
|
|
169
169
|
/** Parse the install command's edition selection. */
|
|
170
170
|
function parseInstallOptions(argv) {
|
|
171
171
|
let edition;
|
|
172
|
+
let profile;
|
|
172
173
|
for (let index = 0; index < argv.length; index += 1) {
|
|
173
174
|
const token = argv[index];
|
|
174
175
|
if (token === '--edition') {
|
|
@@ -179,11 +180,19 @@ function parseInstallOptions(argv) {
|
|
|
179
180
|
index += 1;
|
|
180
181
|
continue;
|
|
181
182
|
}
|
|
183
|
+
if (token === '--profile') {
|
|
184
|
+
const value = argv[index + 1];
|
|
185
|
+
if (value === undefined || value === '')
|
|
186
|
+
throw new Error('--profile requires a value');
|
|
187
|
+
profile = value;
|
|
188
|
+
index += 1;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
182
191
|
throw new Error('unknown option: ' + String(token));
|
|
183
192
|
}
|
|
184
193
|
if (edition === undefined)
|
|
185
194
|
throw new Error('install requires --edition personal or --edition team');
|
|
186
|
-
return { edition };
|
|
195
|
+
return { edition, profile };
|
|
187
196
|
}
|
|
188
197
|
/**
|
|
189
198
|
* Install one edition's package manifest into the profile.
|
|
@@ -196,8 +205,11 @@ function parseInstallOptions(argv) {
|
|
|
196
205
|
* @returns the process exit code.
|
|
197
206
|
*/
|
|
198
207
|
function install(argv) {
|
|
199
|
-
const { edition } = parseInstallOptions(argv);
|
|
200
|
-
const
|
|
208
|
+
const { edition, profile } = parseInstallOptions(argv);
|
|
209
|
+
const base = resolvePaths(declarationAnchor());
|
|
210
|
+
const paths = profile === undefined
|
|
211
|
+
? base
|
|
212
|
+
: { ...base, profileName: profile, profileDirectory: join(base.home, 'profiles', profile) };
|
|
201
213
|
ensureProfile(paths, installationRoot(), edition);
|
|
202
214
|
console.log('Installed the ' + edition + ' edition into ' + paths.profileDirectory);
|
|
203
215
|
return 0;
|
|
@@ -628,6 +640,30 @@ async function doctor() {
|
|
|
628
640
|
? 'capabilities: ' + (actual.mounted.length === 0 ? '(none enabled)' : actual.mounted.join(', '))
|
|
629
641
|
: 'capabilities disagree with ' + CAPABILITY_RECORD + ': ' + drifted.map(capability => capability.id).join(', ')
|
|
630
642
|
+ ' (run dsh-plus capabilities)');
|
|
643
|
+
const profileManifestPath = join(paths.profileDirectory, 'package.json');
|
|
644
|
+
if (existsSync(profileManifestPath)) {
|
|
645
|
+
const profileManifest = JSON.parse(readFileSync(profileManifestPath, 'utf8'));
|
|
646
|
+
const editionId = profileManifest.dsh?.profile?.plusEdition;
|
|
647
|
+
if (editionId !== undefined) {
|
|
648
|
+
const distribution = readDistributionProfile(paths.distributionDirectory);
|
|
649
|
+
const edition = distribution.editions[editionId];
|
|
650
|
+
if (edition === undefined) {
|
|
651
|
+
check(false, 'edition "' + editionId + '" is not declared by this distribution');
|
|
652
|
+
}
|
|
653
|
+
else {
|
|
654
|
+
const bundles = new Set(profileManifest.dsh?.profile?.bundles ?? []);
|
|
655
|
+
const missingBundles = edition.bundles.filter(bundle => !bundles.has(bundle));
|
|
656
|
+
const packageNames = Object.keys(edition.packages);
|
|
657
|
+
const missingPackages = packageNames.filter(name => !existsSync(join(paths.profileDirectory, 'node_modules', ...name.split('/'), 'package.json')));
|
|
658
|
+
check(missingBundles.length === 0, 'edition ' + editionId + ': ' + String(edition.bundles.length - missingBundles.length) + '/'
|
|
659
|
+
+ String(edition.bundles.length) + ' bundles mounted'
|
|
660
|
+
+ (missingBundles.length === 0 ? '' : ' (missing ' + missingBundles.join(', ') + ')'));
|
|
661
|
+
check(missingPackages.length === 0, 'edition ' + editionId + ': ' + String(packageNames.length - missingPackages.length) + '/'
|
|
662
|
+
+ String(packageNames.length) + ' packages installed'
|
|
663
|
+
+ (missingPackages.length === 0 ? '' : ' (missing ' + missingPackages.join(', ') + ')'));
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
631
667
|
console.log(failures === 0 ? 'No problems found.' : String(failures) + ' problem(s) found.');
|
|
632
668
|
return failures === 0 ? 0 : 1;
|
|
633
669
|
}
|
|
@@ -652,6 +688,7 @@ const USAGE = [
|
|
|
652
688
|
'',
|
|
653
689
|
'install options:',
|
|
654
690
|
' --edition <id> package manifest to install (personal or team)',
|
|
691
|
+
' --profile <n> profile name to install into (default: this installation)',
|
|
655
692
|
'',
|
|
656
693
|
'capabilities options:',
|
|
657
694
|
' --enable <ids> enable the comma-separated capability ids',
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* bundle's own list.
|
|
10
10
|
*/
|
|
11
11
|
import { spawnSync } from 'node:child_process';
|
|
12
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
12
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
13
13
|
import { createRequire } from 'node:module';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
14
15
|
import { homedir } from 'node:os';
|
|
15
16
|
import { dirname, join, posix, resolve, win32 } from 'node:path';
|
|
16
17
|
import { parseDocument } from 'yaml';
|
|
@@ -142,12 +143,15 @@ export function isWithin(candidate, parent, platform = process.platform) {
|
|
|
142
143
|
* @returns absolute path to the installed distribution.
|
|
143
144
|
*/
|
|
144
145
|
export function resolveDistributionDirectory(anchor) {
|
|
146
|
+
const ownDirectory = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
145
147
|
let resolved;
|
|
146
148
|
try {
|
|
147
149
|
resolved = dirname(createRequire(anchor).resolve('@sparkelf/dsh-plus/package.json'));
|
|
148
150
|
}
|
|
149
151
|
catch {
|
|
150
|
-
|
|
152
|
+
// `npx @sparkelf/dsh-plus ...` runs the CLI from a temporary install, so the consumer
|
|
153
|
+
// tree has no copy to resolve. The running module's own package is the distribution.
|
|
154
|
+
return ownDirectory;
|
|
151
155
|
}
|
|
152
156
|
// A resolution that leaves the consumer tree means the module answered from its own
|
|
153
157
|
// installation, which reports health for a distribution the consumer never installed.
|
|
@@ -163,7 +167,7 @@ export function resolveDistributionDirectory(anchor) {
|
|
|
163
167
|
break;
|
|
164
168
|
current = parent;
|
|
165
169
|
}
|
|
166
|
-
|
|
170
|
+
return ownDirectory;
|
|
167
171
|
}
|
|
168
172
|
export function readDistributionProfile(distributionDirectory) {
|
|
169
173
|
const manifest = requireRecord(JSON.parse(readFileSync(join(distributionDirectory, 'package.json'), 'utf8')), 'Plus distribution manifest');
|
|
@@ -242,7 +246,12 @@ function requireDependencyMap(value, label) {
|
|
|
242
246
|
export function installProfilePackages(paths, consumerDirectory) {
|
|
243
247
|
const consumerModules = join(consumerDirectory, 'node_modules');
|
|
244
248
|
if (!existsSync(consumerModules)) {
|
|
245
|
-
|
|
249
|
+
// `npx @sparkelf/dsh-plus` runs from a temporary package tree that has no launcher
|
|
250
|
+
// beside it. The profile installs its own tree, so there is nothing to link from
|
|
251
|
+
// the caller; only the profile's packages matter.
|
|
252
|
+
installWithRegistryFallback(paths);
|
|
253
|
+
alignReplacedPackageNames(join(paths.profileDirectory, 'node_modules'));
|
|
254
|
+
return;
|
|
246
255
|
}
|
|
247
256
|
const profileModules = join(paths.profileDirectory, 'node_modules');
|
|
248
257
|
if (existsSync(profileModules)) {
|
|
@@ -267,6 +276,11 @@ export function installProfilePackages(paths, consumerDirectory) {
|
|
|
267
276
|
function installWithRegistryFallback(paths) {
|
|
268
277
|
const registries = registryOrder();
|
|
269
278
|
for (const [index, registry] of registries.entries()) {
|
|
279
|
+
// A lockfile written against the previous registry keeps its resolved URLs, so the
|
|
280
|
+
// second attempt would fetch from the registry that just failed. Drop it and resolve
|
|
281
|
+
// against the registry being tried.
|
|
282
|
+
if (index > 0)
|
|
283
|
+
rmSync(join(paths.profileDirectory, 'pnpm-lock.yaml'), { force: true });
|
|
270
284
|
const result = spawnSync('pnpm', ['install', '--no-frozen-lockfile', '--registry', registry], {
|
|
271
285
|
cwd: paths.profileDirectory,
|
|
272
286
|
stdio: 'inherit',
|
|
@@ -336,8 +350,12 @@ const MAINLAND_REGISTRY = 'https://registry.npmmirror.com';
|
|
|
336
350
|
*/
|
|
337
351
|
export function registryOrder() {
|
|
338
352
|
const configured = process.env.DSH_PLUS_INSTALL_REGISTRY;
|
|
339
|
-
if (configured !== undefined && configured !== '')
|
|
340
|
-
|
|
353
|
+
if (configured !== undefined && configured !== '') {
|
|
354
|
+
// The fallback must be the other registry, not the configured one again: an override
|
|
355
|
+
// set to the mirror used to fall back to the same mirror and fail twice.
|
|
356
|
+
const fallback = configured === MAINLAND_REGISTRY ? OFFICIAL_REGISTRY : MAINLAND_REGISTRY;
|
|
357
|
+
return [configured, fallback];
|
|
358
|
+
}
|
|
341
359
|
// Intl reports the system locale on every platform. The POSIX variables are empty on
|
|
342
360
|
// Windows, so reading them alone classified every Windows console as non-mainland and
|
|
343
361
|
// reached the origin first — measured in a consumer's log, which showed npmjs failing
|
|
@@ -466,17 +484,46 @@ export function ensureProfile(paths, consumerDirectory, edition) {
|
|
|
466
484
|
throw new Error('unknown edition "' + edition + '"; this release offers '
|
|
467
485
|
+ (offered.length === 0 ? '(none)' : offered.join(', ')));
|
|
468
486
|
}
|
|
469
|
-
|
|
470
|
-
|
|
487
|
+
// An edition lists only third-party, fork, and self-developed plugins. The official
|
|
488
|
+
// runtime is the CLI's responsibility and must not be duplicated in that list.
|
|
489
|
+
for (const name of Object.keys(composition?.packages ?? {})) {
|
|
490
|
+
if (name.startsWith('@deepseek-ai/')) {
|
|
491
|
+
throw new Error('edition "' + String(edition) + '" lists the official package ' + name
|
|
492
|
+
+ '; editions contain only third-party or self-developed plugins');
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const runtime = distribution.dshRange.replace(/^>=?/u, '');
|
|
496
|
+
const baseBundles = composition === undefined
|
|
497
|
+
? distribution.bundles
|
|
498
|
+
: distribution.bundles.filter(bundle => bundle.startsWith('@deepseek-ai/') || bundle === '@sparkelf/dsh-plus');
|
|
499
|
+
const basePackages = composition === undefined
|
|
500
|
+
? distribution.dependencies
|
|
501
|
+
: {
|
|
502
|
+
'@deepseek-ai/dsh': distribution.dshRange,
|
|
503
|
+
'@sparkelf/dsh-plus': distribution.version,
|
|
504
|
+
...Object.fromEntries(baseBundles
|
|
505
|
+
.filter(bundle => bundle.startsWith('@deepseek-ai/dsh-'))
|
|
506
|
+
.map(bundle => [bundle, runtime])),
|
|
507
|
+
};
|
|
508
|
+
const compositionPackages = composition === undefined
|
|
509
|
+
? basePackages
|
|
510
|
+
: { ...basePackages, ...composition.packages };
|
|
511
|
+
const compositionBundles = composition === undefined
|
|
512
|
+
? baseBundles
|
|
513
|
+
: [...baseBundles, ...composition.bundles];
|
|
471
514
|
if (existsSync(manifestPath)) {
|
|
472
515
|
// A selected edition is an explicit install choice, so its packages and bundle order
|
|
473
516
|
// replace the profile's rather than being ignored. Other profile decisions stay.
|
|
474
517
|
if (composition !== undefined) {
|
|
475
518
|
const manifest = requireRecord(JSON.parse(readFileSync(manifestPath, 'utf8')), 'Plus profile manifest');
|
|
476
|
-
manifest.dependencies = { ...manifest.dependencies, ...
|
|
519
|
+
manifest.dependencies = { ...manifest.dependencies, ...compositionPackages };
|
|
477
520
|
manifest.dsh = {
|
|
478
521
|
...manifest.dsh,
|
|
479
|
-
profile: {
|
|
522
|
+
profile: {
|
|
523
|
+
...manifest.dsh?.profile,
|
|
524
|
+
bundles: [...compositionBundles],
|
|
525
|
+
...(edition === undefined ? {} : { plusEdition: edition }),
|
|
526
|
+
},
|
|
480
527
|
};
|
|
481
528
|
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
|
|
482
529
|
}
|
|
@@ -493,19 +540,12 @@ export function ensureProfile(paths, consumerDirectory, edition) {
|
|
|
493
540
|
name: 'dsh-profile-' + STANDALONE_PROFILE,
|
|
494
541
|
private: true,
|
|
495
542
|
type: 'module',
|
|
496
|
-
dependencies:
|
|
497
|
-
'@sparkelf/dsh-plus': distribution.version,
|
|
498
|
-
// The launcher's own tree supplies every service package the bundles mount. A
|
|
499
|
-
// profile that lists only the distribution's plugins installs a partial tree and
|
|
500
|
-
// fails at load with a module the launcher would have carried.
|
|
501
|
-
'@deepseek-ai/dsh': distribution.dshRange,
|
|
502
|
-
...distribution.dependencies,
|
|
503
|
-
...editionPackages,
|
|
504
|
-
},
|
|
543
|
+
dependencies: compositionPackages,
|
|
505
544
|
dsh: {
|
|
506
545
|
profile: {
|
|
507
|
-
bundles: [...
|
|
546
|
+
bundles: [...compositionBundles],
|
|
508
547
|
patchReload: 'live',
|
|
548
|
+
...(edition === undefined ? {} : { plusEdition: edition }),
|
|
509
549
|
},
|
|
510
550
|
},
|
|
511
551
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkelf/dsh-plus",
|
|
3
3
|
"description": "DeepSeek Harness Plus official-base Web distribution profile and ranged compatibility patchset",
|
|
4
|
-
"version": "0.2.2-alpha.2.
|
|
4
|
+
"version": "0.2.2-alpha.2.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -553,20 +553,15 @@
|
|
|
553
553
|
"personal": {
|
|
554
554
|
"label": "个人版",
|
|
555
555
|
"bundles": [
|
|
556
|
-
"@deepseek-ai/dsh-base",
|
|
557
|
-
"@deepseek-ai/dsh-experimental-agent-team-profile",
|
|
558
|
-
"@deepseek-ai/dsh-web-app",
|
|
559
|
-
"@deepseek-ai/dsh-experimental-auto-review",
|
|
560
556
|
"@sparkelf/dsh-mineru",
|
|
561
557
|
"@sparkelf/dsh-officecli",
|
|
562
558
|
"dshmarket",
|
|
563
|
-
"dsh-better-sidebar",
|
|
559
|
+
"@sparkelf/dsh-better-sidebar",
|
|
564
560
|
"@sparkelf/dsh-office-viewer-fonts",
|
|
565
561
|
"dsh-video-preview",
|
|
566
562
|
"@sparkelf/dsh-genui",
|
|
567
563
|
"@sparkelf/dsh-plugin-supervisor",
|
|
568
|
-
"@sparkelf/dsh-
|
|
569
|
-
"dsh-sql-workbench",
|
|
564
|
+
"@sparkelf/dsh-sql-workbench",
|
|
570
565
|
"@sparkelf/dsh-ssh-manager",
|
|
571
566
|
"@sparkelf/dsh-api-client",
|
|
572
567
|
"dsh-right-bg-anim",
|
|
@@ -575,89 +570,71 @@
|
|
|
575
570
|
"@sparkelf/dsh-client-ui-diagram-viewer"
|
|
576
571
|
],
|
|
577
572
|
"packages": {
|
|
578
|
-
"@deepseek-ai/dsh": "0.2.2-alpha.2",
|
|
579
|
-
"@deepseek-ai/dsh-base": "0.2.2-alpha.2",
|
|
580
|
-
"@deepseek-ai/dsh-web-app": "0.2.2-alpha.2",
|
|
581
|
-
"@sparkelf/dsh-plus": "0.2.2-alpha.2.1",
|
|
582
573
|
"@sparkelf/dsh-mineru": "0.1.4",
|
|
583
574
|
"@sparkelf/dsh-officecli": "0.1.4",
|
|
584
575
|
"@sparkelf/dsh-plugin-supervisor": "0.1.9",
|
|
585
|
-
"dsh-sql-workbench": "0.5.3",
|
|
586
576
|
"@sparkelf/dsh-workbench-vault": "0.1.2",
|
|
587
|
-
"@sparkelf/dsh-ssh-manager": "0.7.
|
|
577
|
+
"@sparkelf/dsh-ssh-manager": "0.7.5",
|
|
588
578
|
"@sparkelf/dsh-api-client": "0.5.3",
|
|
589
|
-
"dsh-
|
|
590
|
-
"@sparkelf/dsh-office-viewer-fonts": "0.1.5",
|
|
579
|
+
"@sparkelf/dsh-office-viewer-fonts": "0.1.6",
|
|
591
580
|
"dsh-video-preview": "0.1.4",
|
|
592
581
|
"dsh-right-bg-anim": "1.1.0",
|
|
593
|
-
"@deepseek-ai/dsh-experimental-agent-team-profile": ">=0.2.2-alpha.2",
|
|
594
582
|
"@sparkelf/dsh-mobile-bridge": "0.2.18",
|
|
595
583
|
"@sparkelf/dsh-quant": "0.91.0-sparkelf.13",
|
|
596
|
-
"@
|
|
597
|
-
"@sparkelf/dsh-
|
|
598
|
-
"@sparkelf/dsh-
|
|
584
|
+
"@sparkelf/dsh-genui": "0.15.0-sparkelf.1",
|
|
585
|
+
"@sparkelf/dsh-client-ui-diagram-viewer": "0.2.1-alpha.28",
|
|
586
|
+
"@sparkelf/dsh-sql-workbench": "0.5.4-sparkelf.1",
|
|
587
|
+
"@sparkelf/dsh-better-sidebar": "0.29.0-sparkelf.2"
|
|
599
588
|
}
|
|
600
589
|
},
|
|
601
590
|
"team": {
|
|
602
591
|
"label": "团队版",
|
|
603
592
|
"bundles": [
|
|
604
|
-
"@deepseek-ai/dsh-base",
|
|
605
|
-
"@deepseek-ai/dsh-experimental-agent-team-profile",
|
|
606
|
-
"@deepseek-ai/dsh-web-app",
|
|
607
|
-
"@deepseek-ai/dsh-experimental-auto-review",
|
|
608
593
|
"@sparkelf/dsh-mineru",
|
|
609
594
|
"@sparkelf/dsh-officecli",
|
|
610
595
|
"dshmarket",
|
|
611
|
-
"dsh-better-sidebar",
|
|
612
596
|
"@sparkelf/dsh-office-viewer-fonts",
|
|
613
597
|
"@sparkelf/dsh-genui",
|
|
614
598
|
"@sparkelf/dsh-plugin-supervisor",
|
|
615
|
-
"@sparkelf/dsh-
|
|
616
|
-
"dsh-sql-workbench",
|
|
599
|
+
"@sparkelf/dsh-sql-workbench",
|
|
617
600
|
"@sparkelf/dsh-ssh-manager",
|
|
618
601
|
"@sparkelf/dsh-api-client",
|
|
619
602
|
"dsh-right-bg-anim",
|
|
620
603
|
"@sparkelf/dsh-client-ui-diagram-viewer",
|
|
621
604
|
"@sparkelf/dsh-dataops-managed",
|
|
622
605
|
"@sparkelf/dsh-query-result-analysis",
|
|
623
|
-
"@sparkelf/dsh-
|
|
606
|
+
"@sparkelf/dsh-better-sidebar",
|
|
624
607
|
"@sparkelf/dsh-credential-manager",
|
|
608
|
+
"@sparkelf/dsh-knowledge-base",
|
|
625
609
|
"@sparkelf/dsh-group-chat",
|
|
610
|
+
"@sparkelf/dsh-ocr",
|
|
611
|
+
"@sparkelf/dsh-dataops-account",
|
|
626
612
|
"@sparkelf/dsh-kb-citation",
|
|
627
613
|
"@sparkelf/dsh-task-bus"
|
|
628
614
|
],
|
|
629
615
|
"packages": {
|
|
630
|
-
"@
|
|
631
|
-
"@sparkelf/dsh-
|
|
616
|
+
"@sparkelf/dsh-api-client": "0.5.3",
|
|
617
|
+
"@sparkelf/dsh-client-ui-diagram-viewer": "0.2.1-alpha.28",
|
|
618
|
+
"@sparkelf/dsh-dataops-managed": "0.3.21",
|
|
619
|
+
"@sparkelf/dsh-genui": "0.15.0-sparkelf.1",
|
|
620
|
+
"@sparkelf/dsh-knowledge-base": "0.1.21",
|
|
632
621
|
"@sparkelf/dsh-mineru": "0.1.4",
|
|
622
|
+
"@sparkelf/dsh-office-viewer-fonts": "0.1.6",
|
|
633
623
|
"@sparkelf/dsh-officecli": "0.1.4",
|
|
634
624
|
"@sparkelf/dsh-plugin-supervisor": "0.1.9",
|
|
635
|
-
"dsh-
|
|
625
|
+
"@sparkelf/dsh-ssh-manager": "0.7.5",
|
|
636
626
|
"@sparkelf/dsh-workbench-vault": "0.1.2",
|
|
637
|
-
"@sparkelf/dsh-ssh-manager": "0.7.4",
|
|
638
|
-
"@sparkelf/dsh-api-client": "0.5.3",
|
|
639
|
-
"dsh-better-sidebar": "0.28.0",
|
|
640
|
-
"@sparkelf/dsh-office-viewer-fonts": "0.1.5",
|
|
641
627
|
"dsh-right-bg-anim": "1.1.0",
|
|
642
|
-
"@
|
|
643
|
-
"@deepseek-ai/dsh-experimental-auto-review": "0.2.2-alpha.2",
|
|
644
|
-
"@sparkelf/dsh-genui": "0.13.0-sparkelf.3",
|
|
645
|
-
"@sparkelf/dsh-client-ui-diagram-viewer": "0.2.1-alpha.28",
|
|
646
|
-
"@deepseek-ai/dsh-tool-session-query": "0.2.2-alpha.2",
|
|
647
|
-
"@sparkelf/dsh-client-ui-skill-center": "0.2.1-rc.2.4",
|
|
648
|
-
"@sparkelf/dsh-image-hoist": ">=0.1.3",
|
|
649
|
-
"@sparkelf/dsh-plugin-backup": "0.2.1-rc.2.4",
|
|
650
|
-
"@sparkelf/dsh-plugin-mcp-credentials": "0.2.1-rc.2.6",
|
|
651
|
-
"dshmarket": ">=1.66.7",
|
|
652
|
-
"semver": ">=7.7.3",
|
|
653
|
-
"yaml": ">=2.9.0",
|
|
654
|
-
"@sparkelf/dsh-dataops-managed": "0.3.21",
|
|
655
|
-
"@sparkelf/dsh-query-result-analysis": "0.1.4",
|
|
656
|
-
"@sparkelf/dsh-knowledge-base": "0.1.21",
|
|
628
|
+
"@sparkelf/dsh-task-bus": "0.1.0",
|
|
657
629
|
"@sparkelf/dsh-credential-manager": "0.1.0",
|
|
630
|
+
"@sparkelf/dsh-dataops-account": "0.2.0",
|
|
658
631
|
"@sparkelf/dsh-group-chat": "0.5.1",
|
|
659
632
|
"@sparkelf/dsh-kb-citation": "0.1.3",
|
|
660
|
-
"@sparkelf/dsh-
|
|
633
|
+
"@sparkelf/dsh-ocr": "0.1.0",
|
|
634
|
+
"@sparkelf/dsh-query-result-analysis": "0.1.4",
|
|
635
|
+
"@sparkelf/dsh-better-sidebar": "0.29.0-sparkelf.2",
|
|
636
|
+
"dsh-video-preview": "0.1.4",
|
|
637
|
+
"@sparkelf/dsh-sql-workbench": "0.5.4-sparkelf.1"
|
|
661
638
|
}
|
|
662
639
|
}
|
|
663
640
|
}
|