@sparkelf/dsh-plus 0.2.9-alpha.83 → 0.2.9-alpha.85
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 +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/cordis.patch.yml +18 -0
- package/lib/apply-c_7SZFSh.js +1193 -0
- package/lib/apply.js +1 -1
- package/lib/bin.js +16 -317
- package/lib/types/apply.js +16 -0
- package/lib/types/capabilities.js +25 -36
- package/lib/types/manifest.d.ts +24 -0
- package/lib/types/manifest.js +51 -0
- package/lib/types/profile.d.ts +1 -0
- package/lib/types/profile.js +5 -1
- package/package.json +23 -5
- package/patches/office-system-soffice.patch +492 -0
package/lib/types/manifest.js
CHANGED
|
@@ -17,6 +17,8 @@ import { valid, validRange } from 'semver';
|
|
|
17
17
|
const OFFICIAL_PREFIX = '@deepseek-ai/';
|
|
18
18
|
/** npm scope the distribution publishes its republished builds under. */
|
|
19
19
|
const REPUBLISHED_PREFIX = '@sparkelf/';
|
|
20
|
+
/** Independent profile metadata the app-boot preflight reads before importing plugins. */
|
|
21
|
+
export const PROFILE_COMPATIBILITY_FILENAME = 'compatibility.json';
|
|
20
22
|
function record(value, label) {
|
|
21
23
|
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
22
24
|
throw new Error(label + ' must be an object');
|
|
@@ -136,6 +138,20 @@ export function readDistributionFacts(directory) {
|
|
|
136
138
|
});
|
|
137
139
|
const { redirects, ids } = deriveRedirects(entries, runtimeVersion);
|
|
138
140
|
const dependencies = stringMap(profile.dependencies, 'dshPlus.profile.dependencies');
|
|
141
|
+
const compatibilityExemptions = profile.compatibility === undefined
|
|
142
|
+
? []
|
|
143
|
+
: stringArray(profile.compatibility, 'dshPlus.profile.compatibility');
|
|
144
|
+
for (const entry of compatibilityExemptions) {
|
|
145
|
+
const separator = entry.lastIndexOf('@');
|
|
146
|
+
const name = entry.slice(0, separator);
|
|
147
|
+
const version = entry.slice(separator + 1);
|
|
148
|
+
if (separator <= 0 || valid(version) === null) {
|
|
149
|
+
throw new Error('dshPlus.profile.compatibility entry must be an exact package@version, got: ' + entry);
|
|
150
|
+
}
|
|
151
|
+
if (dependencies[name] !== version) {
|
|
152
|
+
throw new Error('dshPlus.profile.compatibility names ' + entry + ', which dshPlus.profile.dependencies does not pin');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
139
155
|
const allowBuilds = {};
|
|
140
156
|
for (const [name, allowed] of Object.entries(record(profile.allowBuilds, 'dshPlus.profile.allowBuilds'))) {
|
|
141
157
|
if (typeof allowed !== 'boolean')
|
|
@@ -204,6 +220,7 @@ export function readDistributionFacts(directory) {
|
|
|
204
220
|
omissionSpec: 'npm:' + omissionPackage + '@' + omissionVersion,
|
|
205
221
|
bundles: stringArray(profile.bundles, 'dshPlus.profile.bundles'),
|
|
206
222
|
dependencies,
|
|
223
|
+
compatibilityExemptions,
|
|
207
224
|
allowBuilds,
|
|
208
225
|
redirects,
|
|
209
226
|
redirectIds: ids,
|
|
@@ -340,6 +357,39 @@ export async function assertRedirectsPublished(redirects, registry = 'https://re
|
|
|
340
357
|
throw new Error('redirect target ' + name + '@' + version + ' is not served by ' + registry);
|
|
341
358
|
}
|
|
342
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* Record the distribution's exact-version grants in the profile's compatibility file.
|
|
362
|
+
*
|
|
363
|
+
* The file is the app-boot preflight's own grant mechanism: a missing or unreadable file
|
|
364
|
+
* authorizes nothing, and every other key belongs to the deployment. Writing merges the
|
|
365
|
+
* distribution's grants into the existing object rather than replacing it, so a grant a
|
|
366
|
+
* user or image added for another plugin survives a `dsh-plus install`/`start`.
|
|
367
|
+
*
|
|
368
|
+
* @param directory - profile directory that receives the file.
|
|
369
|
+
* @param exemptions - exact `package@version` grants the distribution admits.
|
|
370
|
+
* @param runtimeVersion - exact runtime each grant names.
|
|
371
|
+
*/
|
|
372
|
+
export function writeProfileCompatibility(directory, exemptions, runtimeVersion) {
|
|
373
|
+
mkdirSync(directory, { recursive: true });
|
|
374
|
+
const path = join(directory, PROFILE_COMPATIBILITY_FILENAME);
|
|
375
|
+
let current = {};
|
|
376
|
+
try {
|
|
377
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
378
|
+
if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed))
|
|
379
|
+
current = parsed;
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
// Absent, unreadable, or malformed: the preflight already ignores such a file, so
|
|
383
|
+
// starting from an empty object replaces the unusable content with valid grants.
|
|
384
|
+
}
|
|
385
|
+
for (const entry of exemptions) {
|
|
386
|
+
const versions = Array.isArray(current[entry])
|
|
387
|
+
? current[entry].filter((version) => typeof version === 'string')
|
|
388
|
+
: [];
|
|
389
|
+
current[entry] = [...new Set([...versions, runtimeVersion])];
|
|
390
|
+
}
|
|
391
|
+
writeFileSync(path, JSON.stringify(current, null, 2) + '\n');
|
|
392
|
+
}
|
|
343
393
|
/**
|
|
344
394
|
* Write the profile manifest and the pnpm workspace the install reads.
|
|
345
395
|
*
|
|
@@ -389,6 +439,7 @@ export function writeProfileProjection(directory, facts, editionId, extraExclude
|
|
|
389
439
|
'',
|
|
390
440
|
];
|
|
391
441
|
writeFileSync(join(directory, 'pnpm-workspace.yaml'), workspace.join('\n'));
|
|
442
|
+
writeProfileCompatibility(directory, facts.compatibilityExemptions, facts.runtimeVersion);
|
|
392
443
|
return projection;
|
|
393
444
|
}
|
|
394
445
|
/** Whether a path is a directory carrying a package manifest. */
|
package/lib/types/profile.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export declare function readDistributionProfile(distributionDirectory: string, e
|
|
|
74
74
|
readonly runtimeVersion: string;
|
|
75
75
|
readonly bundles: readonly string[];
|
|
76
76
|
readonly dependencies: Readonly<Record<string, string>>;
|
|
77
|
+
readonly compatibilityExemptions: readonly string[];
|
|
77
78
|
readonly allowBuilds: Readonly<Record<string, boolean>>;
|
|
78
79
|
readonly overrides: Readonly<Record<string, string>>;
|
|
79
80
|
readonly omittedPackages: Readonly<Record<string, string>>;
|
package/lib/types/profile.js
CHANGED
|
@@ -14,7 +14,7 @@ import { createRequire } from 'node:module';
|
|
|
14
14
|
import { homedir } from 'node:os';
|
|
15
15
|
import { dirname, join, posix, resolve, win32 } from 'node:path';
|
|
16
16
|
import { parseDocument } from 'yaml';
|
|
17
|
-
import { projectEdition, readDistributionFacts } from "./manifest.js";
|
|
17
|
+
import { projectEdition, readDistributionFacts, writeProfileCompatibility } from "./manifest.js";
|
|
18
18
|
import { readPatchSet } from "./patch-set.js";
|
|
19
19
|
/** Profile name the launcher materializes when no edition is selected. */
|
|
20
20
|
export const DEFAULT_PROFILE = 'plus';
|
|
@@ -119,6 +119,7 @@ export function readDistributionProfile(distributionDirectory, editionId, extraE
|
|
|
119
119
|
runtimeVersion: facts.runtimeVersion,
|
|
120
120
|
bundles: projection.bundles,
|
|
121
121
|
dependencies: projection.dependencies,
|
|
122
|
+
compatibilityExemptions: facts.compatibilityExemptions,
|
|
122
123
|
allowBuilds: projection.allowBuilds,
|
|
123
124
|
overrides: projection.overrides,
|
|
124
125
|
omittedPackages: projection.omittedPackages,
|
|
@@ -534,6 +535,9 @@ export function resolvePaths(anchor, env = process.env, editionId) {
|
|
|
534
535
|
export function ensureProfile(paths, editionId, extraExcludes = [], dryRun = false) {
|
|
535
536
|
const manifestPath = join(paths.profileDirectory, 'package.json');
|
|
536
537
|
const distribution = readDistributionProfile(paths.distributionDirectory, editionId, extraExcludes);
|
|
538
|
+
// The app-boot preflight reads this before importing any plugin, so an upgraded or
|
|
539
|
+
// freshly created profile must carry the distribution's grants on every materialization.
|
|
540
|
+
writeProfileCompatibility(paths.profileDirectory, distribution.compatibilityExemptions, distribution.runtimeVersion);
|
|
537
541
|
if (existsSync(manifestPath)) {
|
|
538
542
|
// The workspace carries decisions the distribution owns — overrides and the build
|
|
539
543
|
// script allowlist — and a distribution release changes them. Rewriting on every
|
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@deepseek-ai/dsh-computer-use": "0.2.2-rc.2",
|
|
7
7
|
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp": "0.2.2-rc.2",
|
|
8
|
-
"@deepseek-ai/dsh-web-search-exa": "0.1.6-alpha.1",
|
|
9
8
|
"@sparkelf/dsh-image-hoist": ">=0.1.3",
|
|
10
9
|
"@sparkelf/dsh-plugin-backup": ">=0.2.1-alpha.1",
|
|
11
10
|
"@sparkelf/dsh-plugin-mcp-credentials": ">=0.2.1-alpha.54",
|
|
@@ -60,7 +59,6 @@
|
|
|
60
59
|
"omit": [
|
|
61
60
|
"@deepseek-ai/dsh-computer-use",
|
|
62
61
|
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp",
|
|
63
|
-
"@deepseek-ai/dsh-web-search-exa",
|
|
64
62
|
"@sparkelf/dsh-mobile-bridge",
|
|
65
63
|
"@sparkelf/dsh-quant",
|
|
66
64
|
"dsh-video-preview"
|
|
@@ -93,6 +91,7 @@
|
|
|
93
91
|
"@deepseek-ai/dsh-session-title-llm",
|
|
94
92
|
"@deepseek-ai/dsh-shell",
|
|
95
93
|
"@deepseek-ai/dsh-spill",
|
|
94
|
+
"@deepseek-ai/dsh-web-search-exa",
|
|
96
95
|
"@deepseek-ai/dsh-workflow",
|
|
97
96
|
"@sparkelf/dsh-artifact-app",
|
|
98
97
|
"@sparkelf/dsh-dataops-managed",
|
|
@@ -196,6 +195,7 @@
|
|
|
196
195
|
"dsh-video-preview",
|
|
197
196
|
"@sparkelf/dsh-sql-workbench",
|
|
198
197
|
"@sparkelf/dsh-client-ui-skill-center",
|
|
198
|
+
"@deepseek-ai/dsh-web-search-exa",
|
|
199
199
|
"@deepseek-ai/cordis-plugin-group"
|
|
200
200
|
],
|
|
201
201
|
"profile": "plus"
|
|
@@ -406,6 +406,21 @@
|
|
|
406
406
|
]
|
|
407
407
|
}
|
|
408
408
|
},
|
|
409
|
+
{
|
|
410
|
+
"dsh": ">=0.2.2-rc.2",
|
|
411
|
+
"file": "./patches/office-system-soffice.patch",
|
|
412
|
+
"id": "office-system-soffice",
|
|
413
|
+
"retireWhen": "官方 office-kit 在 Linux 提供原生 LibreOffice 引擎或系统 LibreOffice 后端后退役",
|
|
414
|
+
"target": {
|
|
415
|
+
"kind": "dsh-source",
|
|
416
|
+
"packages": [
|
|
417
|
+
"@deepseek-ai/dsh-office-kit"
|
|
418
|
+
],
|
|
419
|
+
"paths": [
|
|
420
|
+
"packages/document/office-kit/"
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
},
|
|
409
424
|
{
|
|
410
425
|
"dsh": ">=0.2.2-alpha.2",
|
|
411
426
|
"file": "./patches/officecli-deliverables.patch",
|
|
@@ -729,6 +744,9 @@
|
|
|
729
744
|
"@sparkelf/dsh-quant",
|
|
730
745
|
"@sparkelf/dsh-artifact-app"
|
|
731
746
|
],
|
|
747
|
+
"compatibility": [
|
|
748
|
+
"@deepseek-ai/dsh-web-search-exa@0.2.2-rc.1"
|
|
749
|
+
],
|
|
732
750
|
"dependencies": {
|
|
733
751
|
"@deepseek-ai/cordis-plugin-group": "1.0.6-alpha.2",
|
|
734
752
|
"@deepseek-ai/dsh-agent": "0.2.2-rc.2",
|
|
@@ -757,6 +775,7 @@
|
|
|
757
775
|
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
|
|
758
776
|
"@deepseek-ai/dsh-tool-session-query": "0.2.2-rc.2",
|
|
759
777
|
"@deepseek-ai/dsh-util-workspace-path": "0.2.2-rc.2",
|
|
778
|
+
"@deepseek-ai/dsh-web-search-exa": "0.2.2-rc.1",
|
|
760
779
|
"@deepseek-ai/dsh-workflow": "0.2.2-rc.2",
|
|
761
780
|
"@sparkelf/dsh-api-client": "0.5.3",
|
|
762
781
|
"@sparkelf/dsh-artifact-app": "0.1.1",
|
|
@@ -820,8 +839,7 @@
|
|
|
820
839
|
"name": "@sparkelf/dsh-plus",
|
|
821
840
|
"optionalDependencies": {
|
|
822
841
|
"@deepseek-ai/dsh-computer-use": "0.2.2-alpha.2",
|
|
823
|
-
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp": "0.2.2-alpha.2"
|
|
824
|
-
"@deepseek-ai/dsh-web-search-exa": "0.1.6-alpha.1"
|
|
842
|
+
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp": "0.2.2-alpha.2"
|
|
825
843
|
},
|
|
826
844
|
"peerDependencies": {
|
|
827
845
|
"@deepseek-ai/cordis": ">=4.0.1"
|
|
@@ -836,5 +854,5 @@
|
|
|
836
854
|
},
|
|
837
855
|
"type": "module",
|
|
838
856
|
"types": "lib/types/index.d.ts",
|
|
839
|
-
"version": "0.2.9-alpha.
|
|
857
|
+
"version": "0.2.9-alpha.85"
|
|
840
858
|
}
|