@sparkelf/dsh-plus 0.2.8-alpha.50 → 0.2.9-alpha.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +1 -1
  3. package/README.zh.md +1 -1
  4. package/cordis.patch.yml +29 -7
  5. package/lib/{apply-DmICvIGh.js → apply-CvePS57c.js} +213 -43
  6. package/lib/{apply-08huHfLG.js → apply-DycMqLJO.js} +240 -53
  7. package/lib/apply-c_7SZFSh.js +1193 -0
  8. package/lib/apply.js +2 -2
  9. package/lib/bin.js +20 -319
  10. package/lib/types/apply.d.ts +14 -1
  11. package/lib/types/apply.js +275 -53
  12. package/lib/types/capabilities.js +25 -36
  13. package/lib/types/manifest.d.ts +24 -0
  14. package/lib/types/manifest.js +51 -0
  15. package/lib/types/profile.d.ts +1 -0
  16. package/lib/types/profile.js +14 -3
  17. package/package.json +529 -577
  18. package/patches/approval-allow-policy.patch +3 -3
  19. package/patches/atomic-write-zombie-lock-holder.patch +1 -1
  20. package/patches/bootstrap-exempt-names.patch +6 -6
  21. package/patches/composer-popover-boundaries.patch +41 -283
  22. package/patches/image-offload-hoist-replay.patch +34 -31
  23. package/patches/input-trigger-source-label.patch +63 -0
  24. package/patches/legacy-code-preset.patch +5 -5
  25. package/patches/llm-pi-ai-transport-truncation.patch +4 -4
  26. package/patches/mobile-journal-generation.patch +2 -2
  27. package/patches/office-preview-stable-load.patch +1 -1
  28. package/patches/officecli-deliverables.patch +2 -2
  29. package/patches/ptc-mcp-schema-types.patch +3 -3
  30. package/patches/responses-reasoning-status.patch +197 -48
  31. package/patches/session-controller-image-downgrade-and-tool-visibility.patch +16 -14
  32. package/patches/session-export-chinese.patch +11 -11
  33. package/patches/session-format-legacy-restart.patch +1 -1
  34. package/patches/sidebar-right-tab-menu.patch +119 -0
  35. package/patches/state-dot-brand-blue.patch +2 -2
  36. package/patches/ui-settings-compact-phone.patch +2 -9
  37. package/patches/ui-sidebar-right-global-panel.patch +3 -3
  38. package/patches/workspace-hide-group-rooms.patch +38 -0
  39. package/patches/workspace-storage-restore.patch +21 -5
  40. package/patches/wsl-native-open.patch +8 -8
  41. package/lib/apply-e0aMC4B4.js +0 -601
  42. package/lib/types/standalone-capabilities.d.ts +0 -139
  43. package/lib/types/standalone-capabilities.js +0 -688
  44. package/lib/types/standalone-cli.d.ts +0 -17
  45. package/lib/types/standalone-cli.js +0 -913
  46. package/lib/types/standalone-profile.d.ts +0 -258
  47. package/lib/types/standalone-profile.js +0 -747
  48. package/lib/types/standalone-server.d.ts +0 -70
  49. package/lib/types/standalone-server.js +0 -158
  50. package/patches/browser-auth-mode.patch +0 -127
  51. package/patches/diagram-preview.patch +0 -562
  52. package/patches/dsh-resource-ref-chip.patch +0 -40
  53. package/patches/session-envelope-ignorable.patch +0 -63
  54. package/patches/session-log-trajectory-toolbar.patch +0 -352
  55. package/patches/ui-schedule-plaza-tab.patch +0 -217
  56. package/patches/web-runtime-compat.patch +0 -83
package/lib/apply.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as parseOfficialWorkspacePackages, r as runApply, t as materializeOfficialPackageScope } from "./apply-08huHfLG.js";
2
- export { materializeOfficialPackageScope, parseOfficialWorkspacePackages, runApply };
1
+ import { i as runApply, n as parseOfficialWorkspacePackages, r as resolvePatchPackageNames, t as materializeOfficialPackageScope } from "./apply-c_7SZFSh.js";
2
+ export { materializeOfficialPackageScope, parseOfficialWorkspacePackages, resolvePatchPackageNames, runApply };
package/lib/bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { i as readPatchSet, r as runApply } from "./apply-08huHfLG.js";
2
+ import { a as assertRedirectsPublished, c as writeProfileCompatibility, i as runApply, l as writeProfileProjection, o as projectEdition, s as readDistributionFacts, u as readPatchSet } from "./apply-c_7SZFSh.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { execFileSync, spawn, spawnSync } from "node:child_process";
5
5
  import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
6
6
  import { dirname, join, posix, resolve, win32 } from "node:path";
7
+ import semver from "semver";
7
8
  import { homedir } from "node:os";
8
- import semver, { valid, validRange } from "semver";
9
9
  import { parseDocument } from "yaml";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { createServer } from "node:net";
@@ -75,307 +75,13 @@ function newerVersion(name, installed, registry = "https://registry.npmjs.org")
75
75
  return publishedVersions(name, registry).filter((entry) => semver.gt(entry.version, installed)).at(-1);
76
76
  }
77
77
  //#endregion
78
- //#region lib/types/manifest.js
79
- /**
80
- * Derive the profile's override table from the distribution's own facts.
81
- *
82
- * The distribution records one truth per fact: the patch set names the official packages it
83
- * patches, the runtime names the version its republished builds carry, and an edition names the
84
- * capabilities a deployment omits. The override table npm and pnpm read is a projection of those
85
- * three, never a fourth list: an entry that cannot be derived fails the build instead of being
86
- * carried forward, which is what kept a stale `@deepseek-ai/dsh-client-ui-slots` pin alive long
87
- * after the patch behind it had gone.
88
- *
89
- * @module manifest
90
- */
91
- /** npm scope every patched official package is republished under. */
92
- const OFFICIAL_PREFIX = "@deepseek-ai/";
93
- /** npm scope the distribution publishes its republished builds under. */
94
- const REPUBLISHED_PREFIX = "@sparkelf/";
95
- function record(value, label) {
96
- if (value === null || typeof value !== "object" || Array.isArray(value)) throw new Error(label + " must be an object");
97
- return value;
98
- }
99
- /** A declared value as text, or the fallback when the manifest holds something else. */
100
- function text(value, fallback = "") {
101
- return typeof value === "string" ? value : fallback;
102
- }
103
- function stringArray(value, label) {
104
- if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string" || entry === "")) throw new Error(label + " must be a non-empty string array");
105
- return value;
106
- }
107
- function stringMap(value, label) {
108
- const result = {};
109
- for (const [name, spec] of Object.entries(record(value, label))) {
110
- if (typeof spec !== "string" || spec === "") throw new Error(label + "." + name + " must be a non-empty string");
111
- result[name] = spec;
112
- }
113
- return result;
114
- }
115
- /**
116
- * The republished scope name for one official package.
117
- *
118
- * @param official - an `@deepseek-ai/dsh-*` name.
119
- * @returns the `@sparkelf/dsh-*` name the distribution publishes it as.
120
- */
121
- function republishedName(official) {
122
- if (!official.startsWith(OFFICIAL_PREFIX)) throw new Error(official + " is not an official package name");
123
- return REPUBLISHED_PREFIX + official.slice(13);
124
- }
125
- /**
126
- * Derive the redirect table from the patch set.
127
- *
128
- * Every `dsh-source` entry republishes the packages its payload modifies, because a registry
129
- * installation has no source tree to patch. An entry that changes only types sets
130
- * `target.republish: false` and must say why; anything else would look like a redirect that
131
- * silently never happens.
132
- *
133
- * @param entries - the distribution's patch entries.
134
- * @param runtimeVersion - exact version the republished builds carry.
135
- * @returns official name to `npm:` alias spec.
136
- */
137
- function deriveRedirects(entries, runtimeVersion) {
138
- const redirects = {};
139
- const ids = {};
140
- for (const entry of entries) {
141
- if (entry.target.kind !== "dsh-source") continue;
142
- const packages = entry.target.packages ?? [];
143
- if (packages.length === 0) throw new Error("patch entry " + entry.id + " declares no target packages");
144
- if (!(entry.target.republish !== false)) {
145
- if (entry.target.reason === void 0 || entry.target.reason.trim() === "") throw new Error("patch entry " + entry.id + " sets republish:false without a reason");
146
- continue;
147
- }
148
- for (const official of packages) {
149
- const spec = "npm:" + republishedName(official) + "@" + runtimeVersion;
150
- if (redirects[official] !== void 0 && redirects[official] !== spec) throw new Error("patch entries " + (ids[official] ?? "?") + " and " + entry.id + " redirect " + official + " to different targets");
151
- redirects[official] = spec;
152
- ids[official] = entry.id;
153
- }
154
- }
155
- if (Object.keys(redirects).length === 0) throw new Error("the patch set declares no republishable target");
156
- return {
157
- redirects,
158
- ids
159
- };
160
- }
161
- /** Read and validate the facts one installed distribution declares. */
162
- function readDistributionFacts(directory) {
163
- const manifest = record(JSON.parse(readFileSync(join(directory, "package.json"), "utf8")), "distribution manifest");
164
- const plus = record(manifest.dshPlus, "dshPlus");
165
- const profile = record(plus.profile, "dshPlus.profile");
166
- if (profile.overrides !== void 0) throw new Error("dshPlus.profile.overrides is retired; overrides are derived from dshPlus.patchSet");
167
- const runtimeVersion = text(record(plus.runtime, "dshPlus.runtime").version);
168
- if (valid(runtimeVersion) === null) throw new Error("dshPlus.runtime.version must be an exact version, got: " + runtimeVersion);
169
- const omission = record(plus.omission, "dshPlus.omission");
170
- const omissionPackage = text(omission.package);
171
- const omissionVersion = text(omission.version);
172
- if (!omissionPackage.startsWith("@sparkelf/") || valid(omissionVersion) === null) throw new Error("dshPlus.omission must name an @sparkelf package and an exact version");
173
- if (validRange(text(record(plus.compatibility, "dshPlus.compatibility").dsh)) === null) throw new Error("dshPlus.compatibility.dsh must be a semver range");
174
- const rawEntries = record(plus.patchSet, "dshPlus.patchSet").entries;
175
- if (!Array.isArray(rawEntries) || rawEntries.length === 0) throw new Error("dshPlus.patchSet.entries must be a non-empty array");
176
- const { redirects, ids } = deriveRedirects(rawEntries.map((value, index) => {
177
- const entry = record(value, "patchSet.entries[" + String(index) + "]");
178
- const target = record(entry.target, "patchSet.entries[" + String(index) + "].target");
179
- const targetFacts = { kind: text(target.kind) };
180
- if (target.packages !== void 0) Object.assign(targetFacts, { packages: stringArray(target.packages, "target.packages") });
181
- if (target.republish === false) Object.assign(targetFacts, { republish: false });
182
- if (typeof target.reason === "string") Object.assign(targetFacts, { reason: target.reason });
183
- return {
184
- id: text(entry.id),
185
- target: targetFacts
186
- };
187
- }), runtimeVersion);
188
- const dependencies = stringMap(profile.dependencies, "dshPlus.profile.dependencies");
189
- const allowBuilds = {};
190
- for (const [name, allowed] of Object.entries(record(profile.allowBuilds, "dshPlus.profile.allowBuilds"))) {
191
- if (typeof allowed !== "boolean") throw new Error("dshPlus.profile.allowBuilds." + name + " must be a boolean");
192
- allowBuilds[name] = allowed;
193
- }
194
- const editions = {};
195
- const rawEditions = plus.editions === void 0 ? {} : record(plus.editions, "dshPlus.editions");
196
- for (const [id, value] of Object.entries(rawEditions)) {
197
- const edition = record(value, "dshPlus.editions." + id);
198
- const rawPackages = edition.packages;
199
- if (rawPackages === void 0) throw new Error("dshPlus.editions." + id + ".packages is required");
200
- const names = Array.isArray(rawPackages) ? stringArray(rawPackages, "dshPlus.editions." + id + ".packages") : Object.keys(record(rawPackages, "dshPlus.editions." + id + ".packages"));
201
- for (const name of names) if (dependencyKey(dependencies, name) === void 0) throw new Error("edition \"" + id + "\" installs " + name + ", which dshPlus.profile.dependencies does not pin");
202
- const omit = stringArray(edition.omit ?? [], "dshPlus.editions." + id + ".omit");
203
- for (const name of omit) if (dependencies[name] === void 0 && manifest.dependencies?.[name] === void 0) throw new Error("edition \"" + id + "\" omits " + name + ", which the distribution does not declare");
204
- const excludePackages = stringArray(edition.excludePackages ?? [], "dshPlus.editions." + id + ".excludePackages");
205
- for (const name of excludePackages) {
206
- if (dependencies[name] === void 0 && !stringArray(edition.bundles ?? [], "x").includes(name)) throw new Error("edition \"" + id + "\" excludes " + name + ", which it does not install or mount");
207
- if (omit.includes(name)) throw new Error("edition \"" + id + "\" both excludes and omits " + name);
208
- for (const [other, spec] of Object.entries(dependencies)) if (/^npm:/u.test(spec) && spec.includes(name + "@")) throw new Error("edition \"" + id + "\" excludes " + name + " but " + other + " aliases it");
209
- }
210
- const bundles = stringArray(edition.bundles ?? [], "dshPlus.editions." + id + ".bundles");
211
- for (const name of bundles) if (omit.includes(name)) throw new Error("edition \"" + id + "\" mounts " + name + " but also omits it");
212
- editions[id] = {
213
- label: text(edition.label, id),
214
- profile: text(edition.profile, "plus"),
215
- bundles,
216
- packages: names,
217
- omit,
218
- excludePackages
219
- };
220
- }
221
- return {
222
- name: String(manifest.name),
223
- version: String(manifest.version),
224
- runtimeVersion,
225
- omissionSpec: "npm:" + omissionPackage + "@" + omissionVersion,
226
- bundles: stringArray(profile.bundles, "dshPlus.profile.bundles"),
227
- dependencies,
228
- allowBuilds,
229
- redirects,
230
- redirectIds: ids,
231
- editions
232
- };
233
- }
234
- /**
235
- * The dependency-table key that installs one package.
236
- *
237
- * A bundle published under a scope we own is installed through an alias: the official name a
238
- * consumer imports (`dsh-better-sidebar`) is the key, and the spec names our build
239
- * (`npm:@sparkelf/dsh-better-sidebar@…`). Editions name the real package, so the
240
- * lookup has to follow the alias or it reports a reviewed package as unpinned.
241
- *
242
- * @param dependencies - the distribution's dependency table.
243
- * @param name - package name an edition names.
244
- * @returns the key that installs it, or undefined when the distribution does not carry it.
245
- */
246
- function dependencyKey(dependencies, name) {
247
- if (dependencies[name] !== void 0) return name;
248
- for (const [key, spec] of Object.entries(dependencies)) if (/^npm:(@[^/]+\/[^@]+)@/u.exec(spec)?.[1] === name) return key;
249
- }
250
- /**
251
- * Project an edition into the profile npm and pnpm install.
252
- *
253
- * The distribution's reviewed order is the base; the edition names the bundle order and package
254
- * set it installs and the capabilities it must not run. Versions always come from
255
- * `profile.dependencies`, so an edition cannot pin a version the distribution did not review.
256
- * No edition means the full distribution, which is what a launcher start without a selection
257
- * materializes.
258
- *
259
- * @param facts - validated distribution facts.
260
- * @param editionId - edition to project, or undefined for the full distribution.
261
- * @returns the profile's dependencies, bundles, and override table.
262
- */
263
- function projectEdition(facts, editionId, extraExcludes = []) {
264
- const edition = editionId === void 0 ? void 0 : facts.editions[editionId];
265
- if (editionId !== void 0 && edition === void 0) throw new Error("unknown edition \"" + editionId + "\"; declared: " + (Object.keys(facts.editions).join(", ") || "(none)"));
266
- const excludedNames = new Set([...edition?.excludePackages ?? [], ...extraExcludes]);
267
- for (const name of excludedNames) if (!(facts.dependencies[name] !== void 0 || facts.bundles.includes(name))) throw new Error("exclude names " + name + ", which the distribution does not install or mount");
268
- const omittedNames = new Set(edition?.omit ?? []);
269
- const omitted = {};
270
- for (const name of omittedNames) omitted[name] = facts.omissionSpec;
271
- const dependencies = {};
272
- const sharedOfficials = Object.keys(facts.dependencies).filter((name) => name.startsWith("@deepseek-ai/dsh"));
273
- const packageNames = edition === void 0 ? [...new Set([...Object.keys(facts.dependencies), ...sharedOfficials])] : [...new Set([...edition.packages, ...sharedOfficials])];
274
- for (const name of packageNames) {
275
- if (omittedNames.has(name) || excludedNames.has(name)) continue;
276
- const key = dependencyKey(facts.dependencies, name) ?? name;
277
- const spec = facts.dependencies[key];
278
- if (spec === void 0) throw new Error(name + " is not a reviewed package");
279
- dependencies[key] = spec;
280
- }
281
- for (const [name, spec] of Object.entries(facts.redirects)) {
282
- if (omittedNames.has(name) || excludedNames.has(name)) continue;
283
- dependencies[name] = spec;
284
- }
285
- const bundles = (edition === void 0 ? [...facts.bundles] : [...new Set(edition.bundles)]).filter((name) => !excludedNames.has(name));
286
- for (const name of bundles) if (!facts.bundles.includes(name) && !(edition?.bundles ?? []).includes(name)) throw new Error("edition \"" + String(editionId) + "\" mounts bundle " + name + ", which the distribution does not declare");
287
- const overrides = {};
288
- for (const [name, spec] of Object.entries(facts.redirects)) {
289
- if (omittedNames.has(name) || excludedNames.has(name)) continue;
290
- overrides[name] = spec;
291
- }
292
- overrides["@deepseek-ai/dsh"] = facts.runtimeVersion;
293
- Object.assign(overrides, omitted);
294
- return {
295
- profileName: edition?.profile ?? "plus",
296
- dependencies,
297
- bundles,
298
- overrides,
299
- allowBuilds: facts.allowBuilds,
300
- omittedPackages: omitted
301
- };
302
- }
303
- /**
304
- * Assert every redirect target is served by a registry.
305
- *
306
- * A redirect names a published build; one that names a version the registry does not serve
307
- * installs nothing at all, and the failure surfaces as a resolver error that reads like a
308
- * packaging defect rather than a release that never happened.
309
- *
310
- * @param redirects - official name to `npm:` alias spec.
311
- * @param registry - npm registry base URL.
312
- * @returns nothing; throws on the first unavailable target.
313
- */
314
- async function assertRedirectsPublished(redirects, registry = "https://registry.npmjs.org") {
315
- for (const spec of Object.values(redirects)) {
316
- const match = /^npm:(@[^/]+\/[^@]+)@(.+)$/u.exec(spec);
317
- if (match === null) throw new Error("redirect " + spec + " is not an npm alias");
318
- const [, name, version] = match;
319
- if (name === void 0 || version === void 0) throw new Error("redirect " + spec + " is not an npm alias");
320
- if (!(await fetch(registry.replace(/\/$/u, "") + "/" + name.replace("/", "%2f") + "/" + version)).ok) throw new Error("redirect target " + name + "@" + version + " is not served by " + registry);
321
- }
322
- }
323
- /**
324
- * Write the profile manifest and the pnpm workspace the install reads.
325
- *
326
- * npm reads `overrides` from the root manifest and pnpm reads them from the workspace file, so
327
- * both are written from the same projection. Resolver settings a container needs (store location,
328
- * supported architectures, release-age window) belong to the caller and are appended to the
329
- * workspace file afterwards.
330
- *
331
- * @param directory - profile directory to write into.
332
- * @param facts - validated distribution facts.
333
- * @param editionId - edition to project.
334
- * @param extraExcludes - packages the caller drops on top of the edition's own exclusions.
335
- * @returns the projection that was written.
336
- */
337
- function writeProfileProjection(directory, facts, editionId, extraExcludes = []) {
338
- const projection = projectEdition(facts, editionId, extraExcludes);
339
- mkdirSync(directory, { recursive: true });
340
- const dependencies = {
341
- "@sparkelf/dsh-plus": facts.version,
342
- "@deepseek-ai/dsh": facts.runtimeVersion,
343
- ...projection.dependencies
344
- };
345
- writeFileSync(join(directory, "package.json"), JSON.stringify({
346
- name: "dsh-profile-" + projection.profileName,
347
- private: true,
348
- type: "module",
349
- dependencies,
350
- dsh: { profile: {
351
- bundles: projection.bundles,
352
- patchReload: "live"
353
- } }
354
- }, null, 2) + "\n");
355
- const workspace = [
356
- "packages:",
357
- " - .",
358
- "nodeLinker: hoisted",
359
- "autoInstallPeers: false",
360
- "",
361
- "overrides:",
362
- ...Object.keys(projection.overrides).sort().map((name) => " " + JSON.stringify(name) + ": " + (projection.overrides[name] ?? "")),
363
- "",
364
- "allowBuilds:",
365
- ...Object.keys(projection.allowBuilds).sort().map((name) => " " + JSON.stringify(name) + ": " + String(projection.allowBuilds[name])),
366
- ""
367
- ];
368
- writeFileSync(join(directory, "pnpm-workspace.yaml"), workspace.join("\n"));
369
- return projection;
370
- }
371
- //#endregion
372
78
  //#region lib/types/capabilities.js
373
79
  /** Capabilities offered at install time, in interview order. */
374
80
  const CAPABILITIES = [
375
81
  {
376
82
  id: "exa",
377
83
  title: "Web search (Exa)",
378
- detail: "Search the web through Exa instead of the built-in provider; needs an API key",
84
+ detail: "Route web search through the Exa provider the profile mounts; needs an API key",
379
85
  needsEndpoint: false
380
86
  },
381
87
  {
@@ -499,9 +205,11 @@ function capabilityEnvironment(answers, existing = "") {
499
205
  * The profile patch layer that turns the selected capabilities on.
500
206
  *
501
207
  * The file is data the profile's loader merges, so enabling a capability writes a
502
- * row rather than editing the deployment. An empty selection still writes the file,
503
- * because a layer that exists and mounts nothing is how a previously enabled
504
- * capability is turned back off.
208
+ * row rather than editing the deployment. Exa is the exception: the distribution
209
+ * mounts its provider unconditionally and the capability supplies only the key in the
210
+ * deployment env file, so no row is written for it. An empty selection still writes
211
+ * the file, because a layer that exists and mounts nothing is how a previously
212
+ * enabled capability is turned back off.
505
213
  *
506
214
  * The profile's own layer is a separate file with its own name: a deployment that
507
215
  * configured something by hand keeps it, and the capability rows are rewritten
@@ -558,7 +266,6 @@ function foreignPatchRows(existing) {
558
266
  function capabilityPatchLayer(answers, existing = "") {
559
267
  const enabled = new Set(answers.enabled);
560
268
  const rows = [];
561
- if (enabled.has("exa")) rows.push(" - id: web-search-exa", " name: '@deepseek-ai/dsh-web-search-exa'", " config:", " searchType: auto", " numResults: 8");
562
269
  if (enabled.has("computer-use")) rows.push(" - id: computer-use", " name: '@deepseek-ai/dsh-computer-use'", " - id: computer-use-cua-driver-mcp", " name: '@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp'");
563
270
  if (enabled.has("officecli")) rows.push(" - id: officecli", " name: '@sparkelf/dsh-officecli'");
564
271
  if (enabled.has("mineru")) rows.push(" - id: mineru", " name: '@sparkelf/dsh-mineru'", " config:", " endpoint: " + (answers.mineruEndpoint ?? "http://127.0.0.1:8000/file_parse"));
@@ -566,7 +273,6 @@ function capabilityPatchLayer(answers, existing = "") {
566
273
  const foreign = foreignPatchRows(existing);
567
274
  if (rows.length > 0) lines.push("- insert:", ...rows);
568
275
  else lines.push("[]");
569
- if (enabled.has("exa")) lines.push("", "# Route web_search through Exa rather than the built-in provider.", "- id: web", " config:", " searchProvider: exa");
570
276
  if (foreign.length > 0) lines.push("", "# Rows this file carried before the capability interview; kept verbatim.", ...foreign);
571
277
  return lines.join("\n") + "\n";
572
278
  }
@@ -616,15 +322,15 @@ function readCapabilityRecord(home) {
616
322
  */
617
323
  function detectEnabledCapabilities(profilePatchText, envText) {
618
324
  const mounted = [];
619
- if (/^\s*- id: web-search-exa\s*$/mu.test(profilePatchText)) mounted.push("exa");
620
- if (/^\s*- id: mineru\s*$/mu.test(profilePatchText)) mounted.push("mineru");
621
- if (/^\s*- id: officecli\s*$/mu.test(profilePatchText)) mounted.push("officecli");
622
- if (/^\s*- id: computer-use\s*$/mu.test(profilePatchText)) mounted.push("computer-use");
623
325
  const env = [];
624
326
  for (const line of envText.split("\n")) {
625
327
  const name = /^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(line)?.[1];
626
328
  if (name !== void 0 && !env.includes(name)) env.push(name);
627
329
  }
330
+ if (env.includes("EXA_API_KEY") || /^\s*- id: web-search-exa\s*$/mu.test(profilePatchText)) mounted.push("exa");
331
+ if (/^\s*- id: mineru\s*$/mu.test(profilePatchText)) mounted.push("mineru");
332
+ if (/^\s*- id: officecli\s*$/mu.test(profilePatchText)) mounted.push("officecli");
333
+ if (/^\s*- id: computer-use\s*$/mu.test(profilePatchText)) mounted.push("computer-use");
628
334
  return {
629
335
  mounted,
630
336
  env
@@ -641,13 +347,6 @@ function detectEnabledCapabilities(profilePatchText, envText) {
641
347
  * @returns the insert payload lines, without the surrounding `- insert:` entry.
642
348
  */
643
349
  function capabilityRows(id) {
644
- if (id === "exa") return [
645
- " - id: web-search-exa",
646
- " name: '@deepseek-ai/dsh-web-search-exa'",
647
- " config:",
648
- " searchType: auto",
649
- " numResults: 8"
650
- ];
651
350
  if (id === "officecli") return [" - id: officecli", " name: '@sparkelf/dsh-officecli'"];
652
351
  if (id === "computer-use") return [
653
352
  " - id: computer-use",
@@ -689,7 +388,7 @@ function editCapabilityPatchLayer(existing, id, enable, mineruEndpoint) {
689
388
  " endpoint: " + (mineruEndpoint ?? "http://127.0.0.1:8000/file_parse")
690
389
  ];
691
390
  const rows = id === "mineru" && enable ? mineruRows : capabilityRows(id);
692
- const trimmed = (enable && rows !== void 0 ? insertCapabilityRows(withoutRows, rows, id === "exa") : withoutRows.text).replace(/\n+$/u, "");
391
+ const trimmed = (enable && rows !== void 0 ? insertCapabilityRows(withoutRows, rows) : withoutRows.text).replace(/\n+$/u, "");
693
392
  return trimmed === "" ? "\n" : trimmed + "\n";
694
393
  }
695
394
  /**
@@ -753,10 +452,9 @@ function dropOwnedRows(existing, ids, withSelector) {
753
452
  *
754
453
  * @param state - the layer with this capability's own rows already removed.
755
454
  * @param rows - the insert payload lines to add.
756
- * @param withSelector - whether Exa's `web` selector row must also be present.
757
455
  * @returns the layer's new text.
758
456
  */
759
- function insertCapabilityRows(state, rows, withSelector) {
457
+ function insertCapabilityRows(state, rows) {
760
458
  const lines = state.text.split("\n");
761
459
  const insertIndex = lines.findIndex((line) => /^- insert:\s*$/.test(line));
762
460
  if (insertIndex >= 0) {
@@ -777,7 +475,6 @@ function insertCapabilityRows(state, rows, withSelector) {
777
475
  if (trailing !== void 0) lines.push(trailing);
778
476
  }
779
477
  }
780
- if (withSelector && !/^\s*- id: web\s*$/mu.test(lines.join("\n"))) lines.push("", "# Route web_search through Exa rather than the built-in provider.", "- id: web", " config:", " searchProvider: exa", " fetchProvider: http");
781
478
  return lines.join("\n");
782
479
  }
783
480
  /**
@@ -1184,6 +881,7 @@ function readDistributionProfile(distributionDirectory, editionId, extraExcludes
1184
881
  runtimeVersion: facts.runtimeVersion,
1185
882
  bundles: projection.bundles,
1186
883
  dependencies: projection.dependencies,
884
+ compatibilityExemptions: facts.compatibilityExemptions,
1187
885
  allowBuilds: projection.allowBuilds,
1188
886
  overrides: projection.overrides,
1189
887
  omittedPackages: projection.omittedPackages,
@@ -1306,8 +1004,10 @@ function alignOfficialVersions(profileDirectory, runtimeVersion, registry) {
1306
1004
  const document = parseDocument(readFileSync(workspacePath, "utf8"));
1307
1005
  let changed = 0;
1308
1006
  for (const name of served) {
1309
- if (document.getIn(["overrides", name]) === runtimeVersion) continue;
1310
- document.setIn(["overrides", name], runtimeVersion);
1007
+ const current = document.getIn(["overrides", name]);
1008
+ const replacement = typeof current === "string" && current.startsWith("npm:@sparkelf/") ? "npm:@sparkelf/" + name.slice(13) + "@" + runtimeVersion : runtimeVersion;
1009
+ if (current === replacement) continue;
1010
+ document.setIn(["overrides", name], replacement);
1311
1011
  changed += 1;
1312
1012
  }
1313
1013
  if (changed === 0) return 0;
@@ -1541,6 +1241,7 @@ function resolvePaths(anchor, env = process.env, editionId) {
1541
1241
  function ensureProfile(paths, editionId, extraExcludes = [], dryRun = false) {
1542
1242
  const manifestPath = join(paths.profileDirectory, "package.json");
1543
1243
  const distribution = readDistributionProfile(paths.distributionDirectory, editionId, extraExcludes);
1244
+ writeProfileCompatibility(paths.profileDirectory, distribution.compatibilityExemptions, distribution.runtimeVersion);
1544
1245
  if (existsSync(manifestPath)) {
1545
1246
  writeProfileOverrides(paths.profileDirectory, distribution.overrides, distribution.allowBuilds, {
1546
1247
  ...paths.omittedPackages,
@@ -1,9 +1,22 @@
1
- /** Materialize the Plus distribution's embedded patch set without Desktop. */
1
+ /** Materialize the Plus distribution's independent patch packages without Desktop. */
2
2
  /** One official workspace package available as a profile peer dependency. */
3
3
  export interface OfficialWorkspacePackage {
4
4
  name: string;
5
5
  directory: string;
6
6
  }
7
+ /**
8
+ * Names of distribution dependencies that carry `dshPatch` variants.
9
+ *
10
+ * `patchPackageVariants()` resolves these names from the Plus install tree, so they must be
11
+ * packages this distribution actually depends on. The current manifest declares `dshPlus.patchSet`
12
+ * instead of a flat list: only entries whose target is an npm package name a `dshPatch` carrier
13
+ * (`dsh-source` entries name the source packages being patched, which are never Plus dependencies).
14
+ * An older tarball may still carry the flat `dshPlus.patchPackages` list, which wins when present.
15
+ *
16
+ * @param plus - Parsed `dshPlus` block of the distribution manifest.
17
+ * @returns Patch-carrier package names; empty when the distribution ships only source patches.
18
+ */
19
+ export declare function resolvePatchPackageNames(plus: Record<string, unknown>): string[];
7
20
  /**
8
21
  * Parse pnpm's workspace roster into exact official package directories.
9
22
  * @param dshRoot - exact official DSH checkout root.