@sparkelf/dsh-plus 0.2.8-alpha.50 → 0.2.9-alpha.101
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 +29 -7
- package/lib/{apply-DmICvIGh.js → apply-CvePS57c.js} +213 -43
- package/lib/{apply-08huHfLG.js → apply-DycMqLJO.js} +240 -53
- package/lib/apply-c_7SZFSh.js +1193 -0
- package/lib/apply.js +2 -2
- package/lib/bin.js +20 -319
- package/lib/types/apply.d.ts +14 -1
- package/lib/types/apply.js +275 -53
- 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 +14 -3
- package/package.json +531 -577
- package/patches/approval-allow-policy.patch +3 -3
- package/patches/atomic-write-zombie-lock-holder.patch +1 -1
- package/patches/bootstrap-exempt-names.patch +6 -6
- package/patches/composer-popover-boundaries.patch +41 -283
- package/patches/image-offload-hoist-replay.patch +34 -31
- package/patches/input-trigger-source-label.patch +63 -0
- package/patches/legacy-code-preset.patch +5 -5
- package/patches/llm-pi-ai-transport-truncation.patch +4 -4
- package/patches/mobile-journal-generation.patch +2 -2
- package/patches/office-preview-stable-load.patch +1 -1
- package/patches/officecli-deliverables.patch +2 -2
- package/patches/ptc-mcp-schema-types.patch +3 -3
- package/patches/responses-reasoning-status.patch +197 -48
- package/patches/session-controller-image-downgrade-and-tool-visibility.patch +16 -14
- package/patches/session-export-chinese.patch +11 -11
- package/patches/session-format-legacy-restart.patch +1 -1
- package/patches/sidebar-right-tab-menu.patch +119 -0
- package/patches/state-dot-brand-blue.patch +2 -2
- package/patches/ui-settings-compact-phone.patch +2 -9
- package/patches/ui-sidebar-right-global-panel.patch +3 -3
- package/patches/workspace-hide-group-rooms.patch +38 -0
- package/patches/workspace-storage-restore.patch +21 -5
- package/patches/wsl-native-open.patch +8 -8
- package/lib/apply-e0aMC4B4.js +0 -601
- package/lib/types/standalone-capabilities.d.ts +0 -139
- package/lib/types/standalone-capabilities.js +0 -688
- package/lib/types/standalone-cli.d.ts +0 -17
- package/lib/types/standalone-cli.js +0 -913
- package/lib/types/standalone-profile.d.ts +0 -258
- package/lib/types/standalone-profile.js +0 -747
- package/lib/types/standalone-server.d.ts +0 -70
- package/lib/types/standalone-server.js +0 -158
- package/patches/browser-auth-mode.patch +0 -127
- package/patches/diagram-preview.patch +0 -562
- package/patches/dsh-resource-ref-chip.patch +0 -40
- package/patches/session-envelope-ignorable.patch +0 -63
- package/patches/session-log-trajectory-toolbar.patch +0 -352
- package/patches/ui-schedule-plaza-tab.patch +0 -217
- package/patches/web-runtime-compat.patch +0 -83
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,
|
|
@@ -257,9 +258,16 @@ export function alignOfficialVersions(profileDirectory, runtimeVersion, registry
|
|
|
257
258
|
const document = parseDocument(readFileSync(workspacePath, 'utf8'));
|
|
258
259
|
let changed = 0;
|
|
259
260
|
for (const name of served) {
|
|
260
|
-
|
|
261
|
+
// A patched package must keep its @sparkelf replacement. Writing the plain official
|
|
262
|
+
// version here discards the redirect and installs the unpatched build, which then
|
|
263
|
+
// misses the exports the patch added.
|
|
264
|
+
const current = document.getIn(['overrides', name]);
|
|
265
|
+
const replacement = typeof current === 'string' && current.startsWith('npm:@sparkelf/')
|
|
266
|
+
? 'npm:@sparkelf/' + name.slice('@deepseek-ai/'.length) + '@' + runtimeVersion
|
|
267
|
+
: runtimeVersion;
|
|
268
|
+
if (current === replacement)
|
|
261
269
|
continue;
|
|
262
|
-
document.setIn(['overrides', name],
|
|
270
|
+
document.setIn(['overrides', name], replacement);
|
|
263
271
|
changed += 1;
|
|
264
272
|
}
|
|
265
273
|
if (changed === 0)
|
|
@@ -534,6 +542,9 @@ export function resolvePaths(anchor, env = process.env, editionId) {
|
|
|
534
542
|
export function ensureProfile(paths, editionId, extraExcludes = [], dryRun = false) {
|
|
535
543
|
const manifestPath = join(paths.profileDirectory, 'package.json');
|
|
536
544
|
const distribution = readDistributionProfile(paths.distributionDirectory, editionId, extraExcludes);
|
|
545
|
+
// The app-boot preflight reads this before importing any plugin, so an upgraded or
|
|
546
|
+
// freshly created profile must carry the distribution's grants on every materialization.
|
|
547
|
+
writeProfileCompatibility(paths.profileDirectory, distribution.compatibilityExemptions, distribution.runtimeVersion);
|
|
537
548
|
if (existsSync(manifestPath)) {
|
|
538
549
|
// The workspace carries decisions the distribution owns — overrides and the build
|
|
539
550
|
// script allowlist — and a distribution release changes them. Rewriting on every
|