@deepseek-ai/dsh-app-boot 0.2.1-rc.5 → 0.2.2-alpha.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/README.i18n.yaml +8 -8
- package/README.md +9 -5
- package/README.zh.md +9 -5
- package/lib/index.js +1002 -253
- package/lib/types/bundle-platform.d.ts +17 -0
- package/lib/types/index.d.ts +7 -3
- package/lib/types/profile-plugins.d.ts +2 -0
- package/lib/types/profile.d.ts +4 -21
- package/lib/types/startup-diagnostics.d.ts +38 -0
- package/lib/worker/profile-resolution-bootstrap.js +5 -5
- package/package.json +19 -18
- package/lib/types/official-bundle-packages.d.ts +0 -4
- package/lib/types/official-bundles.d.ts +0 -12
- package/lib/types/official-bundles.generated.d.ts +0 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Host operating-system admission for optional bundle layers. */
|
|
2
|
+
/** A valid bundle declaration excludes the operating system running DSH. */
|
|
3
|
+
export declare class UnsupportedBundlePlatformError extends Error {
|
|
4
|
+
/**
|
|
5
|
+
* @param platforms Node platform names supported by the bundle.
|
|
6
|
+
* @param platform Operating system of the DSH Host.
|
|
7
|
+
*/
|
|
8
|
+
constructor(platforms: readonly string[], platform: string);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validate package metadata and reject an unsupported Host before selecting or composing a bundle.
|
|
12
|
+
* @param platforms The optional `dsh.bundle.platforms` field read from package.json.
|
|
13
|
+
* @param platform Operating system of the DSH Host, from Node's `process.platform`.
|
|
14
|
+
* @throws When the declaration is malformed or excludes the Host; omission allows every platform.
|
|
15
|
+
*/
|
|
16
|
+
export declare function assertBundlePlatform(platforms: unknown, platform: string): void;
|
|
17
|
+
//# sourceMappingURL=bundle-platform.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* config expressions, and drive the Cordis Loader against a leaf `cordis.yml` until the tree settles.
|
|
6
6
|
* @module @deepseek-ai/dsh-app-boot
|
|
7
7
|
*/
|
|
8
|
+
import { type StartupCompositionDiagnostic } from './startup-diagnostics.ts';
|
|
9
|
+
export type { StartupCompositionDiagnostic, StartupPluginState, StartupServiceState } from './startup-diagnostics.ts';
|
|
8
10
|
import { Context, type FiberState } from '@deepseek-ai/cordis';
|
|
9
11
|
import { type Entry } from '@deepseek-ai/cordis-plugin-loader';
|
|
10
12
|
import { type PatchOptions } from '@deepseek-ai/cordis-plugin-include';
|
|
@@ -13,10 +15,9 @@ import { type LaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environm
|
|
|
13
15
|
export { readBundlePatches, readProfilePatches, resolveTelemetryPatch, type ProfileContext, type ProfilePnpmInvocation } from './profile-context.ts';
|
|
14
16
|
export { sanitizeProfile } from './profile-sanitize.ts';
|
|
15
17
|
export { getDshRuntimeVersion, evaluatePluginCompatibility, pluginCompatibilityWarning, type PluginCompatibility } from './plugin-compatibility.ts';
|
|
16
|
-
export { PROFILE_COMPATIBILITY_FILENAME, readProfileCompatibility, readProfileVersionExemptions, setProfileVersionExemption, type ProfileCompatibility, } from './profile-compatibility.ts';
|
|
18
|
+
export { PROFILE_COMPATIBILITY_FILENAME, readProfileCompatibility, readProfileVersionExemptions, setProfileVersionExemption, validatePluginVersionExemption, type ProfileCompatibility, } from './profile-compatibility.ts';
|
|
17
19
|
export { prepareProfileEntries, prepareProfilePatches } from './compatibility-preflight.ts';
|
|
18
20
|
export { readPluginMeta, resolvePluginResource } from './package-meta.ts';
|
|
19
|
-
export { ON_DEMAND_BUNDLES, OFFICIAL_ON_DEMAND_CATALOG, type OfficialBundleCatalogEntry } from './official-bundles.ts';
|
|
20
21
|
export { generateConfigSchema, type ConfigSchemaDump, type NativeConfigSchema } from './config-schema/index.ts';
|
|
21
22
|
export { createConfigProjector, LOADER_EXPRESSION_SCHEMA, type ConfigProjection } from './config-schema/projector.ts';
|
|
22
23
|
export { isNativeConfigSchema } from './config-schema/native.ts';
|
|
@@ -35,7 +36,8 @@ declare module '@deepseek-ai/cordis' {
|
|
|
35
36
|
'app-boot/config-reload'(): void;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
export {
|
|
39
|
+
export { assertBundlePlatform, UnsupportedBundlePlatformError } from './bundle-platform.ts';
|
|
40
|
+
export { composeEntries, createRuntimeResolution, ProfileRuntimeResolution, bundlePatchFiles, bundlePatchPaths, initProfile, removeLinkProjections, loadProfile, loadProfileDirectory, PROFILE_PATCH_FILENAME, PROFILES_DIR, readProfileManifest, reportSkippedBundles, resolveBundleDir, resolveProfileDir, writeProfileManifest, type Profile, type ProfileLayer, type SkippedBundle, type ProfileManifest, type LinkedRoot, type RuntimeResolutionOptions, type RuntimeResolutionEntry, type RuntimeResolution, } from './profile.ts';
|
|
39
41
|
export { PluginPackages, type PluginPackage, type PluginPackagesConfig, } from './profile-resolution/service.ts';
|
|
40
42
|
export { ResolutionRestartRequired } from './profile-resolution/resolver.ts';
|
|
41
43
|
/**
|
|
@@ -285,6 +287,8 @@ interface StartupLogRecord {
|
|
|
285
287
|
/** Startup audit failure with non-enumerable metadata and original failures as its cause. */
|
|
286
288
|
export declare class StartupError extends Error {
|
|
287
289
|
readonly entries: readonly StartupEntryDiagnostic[];
|
|
290
|
+
/** Plugin states captured before disposal, excluding configuration values. */
|
|
291
|
+
composition?: StartupCompositionDiagnostic;
|
|
288
292
|
/** Root configuration and startup logs, attached by boot after disposal. */
|
|
289
293
|
startup?: {
|
|
290
294
|
configurationPath: string;
|
|
@@ -52,6 +52,8 @@ export declare function writeProfileBundles(profileDir: string, manifest: Profil
|
|
|
52
52
|
* template entries retain their order and duplicates. New bundle dependencies activate automatically.
|
|
53
53
|
* @param options - location, inventory captured before pnpm, and whether explicitly disabled bundles remain disabled.
|
|
54
54
|
* @returns updated inventory and newly added ordinary dependencies for caller-owned warnings.
|
|
55
|
+
* @throws If a new selection has invalid platform metadata or excludes the Host. Installed dependencies
|
|
56
|
+
* remain; no bundle selection changes are written.
|
|
55
57
|
*/
|
|
56
58
|
export declare function reconcileProfilePlugins(options: ProfilePluginLocation & {
|
|
57
59
|
readonly before: ProfilePluginInventory;
|
package/lib/types/profile.d.ts
CHANGED
|
@@ -27,11 +27,6 @@ import type { DshBundleManifest, DshPackageManifest } from '@deepseek-ai/dsh-pac
|
|
|
27
27
|
export declare const PROFILES_DIR = "profiles";
|
|
28
28
|
/** The user patch layer inside a profile directory (hot-reloaded on long-lived surfaces). */
|
|
29
29
|
export declare const PROFILE_PATCH_FILENAME = "cordis.patch.yml";
|
|
30
|
-
/** Installation-owned defaults used when a shipped profile is first opened. */
|
|
31
|
-
export interface ProfileTemplate {
|
|
32
|
-
/** Ordered bundle layer list. */
|
|
33
|
-
bundles: readonly string[];
|
|
34
|
-
}
|
|
35
30
|
/** Package metadata accepted by the profile reader; local profiles need no published identity. */
|
|
36
31
|
export type ProfileManifest = Partial<DshPackageManifest>;
|
|
37
32
|
/**
|
|
@@ -132,19 +127,6 @@ export interface RuntimeResolution {
|
|
|
132
127
|
* @returns the absolute profile directory (which may not exist yet).
|
|
133
128
|
*/
|
|
134
129
|
export declare function resolveProfileDir(name: string, home?: string): string;
|
|
135
|
-
/** The shipped profile templates auto-initialized on first use, by name. */
|
|
136
|
-
export declare const PROFILE_TEMPLATES: Record<string, ProfileTemplate>;
|
|
137
|
-
/** The bundle list a `dsh plugin` init uses for a name with no shipped template. */
|
|
138
|
-
export declare const DEFAULT_PROFILE_BUNDLES: readonly string[];
|
|
139
|
-
/**
|
|
140
|
-
* The bundles the dsh installation ships for a person to switch on: each a
|
|
141
|
-
* runtime dependency of the installation that declares `dsh.bundle.patch`,
|
|
142
|
-
* an `icon`, and `./locale/*.json` display metadata, selected by no shipped
|
|
143
|
-
* template, and offered switched off by the plugin manager
|
|
144
|
-
* ([rationale](../../../../.agents/notes/implemented/process/2026-09-15-shipped-optional-bundles.md),
|
|
145
|
-
* [admission](../../../../.agents/notes/implemented/architecture/2026-09-21-experimental-capabilities-as-optional-bundles.md)).
|
|
146
|
-
*/
|
|
147
|
-
export declare const OPTIONAL_BUNDLES: readonly string[];
|
|
148
130
|
/**
|
|
149
131
|
* Initialize a profile directory: manifest, empty user patch layer, and the
|
|
150
132
|
* pnpm settings out-of-tree plugins need. Existing files are never touched,
|
|
@@ -237,7 +219,8 @@ export declare function resolveBundleDir(binName: string, packageName: string, i
|
|
|
237
219
|
* the shared Harness home. This is used by application-owned profiles whose
|
|
238
220
|
* package project and lifecycle belong to that application.
|
|
239
221
|
* Retired bundles are removed from the stored bundle list first, rewriting the
|
|
240
|
-
* manifest when it listed one. Unreadable bundles, and bundles whose own dsh requirements
|
|
222
|
+
* manifest when it listed one. Unreadable bundles, unsupported Host platforms, and bundles whose own dsh requirements
|
|
223
|
+
* the profile does not exempt are skipped
|
|
241
224
|
* without changing the manifest and listed in `skippedBundles`; nothing is printed.
|
|
242
225
|
* @param binName - the diagnostic prefix on thrown errors.
|
|
243
226
|
* @param dir - absolute profile package directory.
|
|
@@ -250,8 +233,8 @@ export declare function loadProfileDirectory(binName: string, dir: string, insta
|
|
|
250
233
|
}): Profile;
|
|
251
234
|
/**
|
|
252
235
|
* Load a profile: resolve every `dsh.profile.bundles` entry to its patch
|
|
253
|
-
* layer and parse the profile's own patch file. Unreadable
|
|
254
|
-
* are skipped and listed in `skippedBundles`; profile manifest and user patch errors still throw.
|
|
236
|
+
* layer and parse the profile's own patch file. Unreadable bundles, unsupported Host platforms,
|
|
237
|
+
* and incompatible bundles are skipped and listed in `skippedBundles`; profile manifest and user patch errors still throw.
|
|
255
238
|
* @param binName - the diagnostic prefix on thrown errors.
|
|
256
239
|
* @param name - the profile name.
|
|
257
240
|
* @param installAnchor - absolute path of the dsh app's package.json (first resolution anchor).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Configuration-free snapshots captured before a failed startup disposes its plugins. */
|
|
2
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/** One configured entry at the time startup failed. */
|
|
4
|
+
export interface StartupPluginState {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly module: string;
|
|
7
|
+
readonly version: string;
|
|
8
|
+
readonly state: 'disabled' | 'active' | 'pending' | 'failed' | 'disposed' | 'loading' | 'unloading';
|
|
9
|
+
/** Loader source URL; individual overlay ownership may be unavailable. */
|
|
10
|
+
readonly source: string;
|
|
11
|
+
readonly missing: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
/** Observed registrations for one service missing from a consumer. */
|
|
14
|
+
export interface StartupServiceState {
|
|
15
|
+
readonly consumer: string;
|
|
16
|
+
readonly service: string;
|
|
17
|
+
/** Empty means no registration was observed, not that no configured plugin can provide it. */
|
|
18
|
+
readonly providers: readonly {
|
|
19
|
+
readonly entry: string;
|
|
20
|
+
readonly state: string;
|
|
21
|
+
readonly visibility: 'same-scope' | 'other-scope';
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
/** Bounded startup state without plugin config, service values, or logger arguments. */
|
|
25
|
+
export interface StartupCompositionDiagnostic {
|
|
26
|
+
readonly plugins: readonly StartupPluginState[];
|
|
27
|
+
readonly services: readonly StartupServiceState[];
|
|
28
|
+
readonly omittedPlugins: number;
|
|
29
|
+
readonly omittedServices: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Capture Loader state and registered service ownership before teardown.
|
|
33
|
+
* Providers that never registered cannot be inferred from their package names.
|
|
34
|
+
* @param ctx - Live application context with its Loader still mounted.
|
|
35
|
+
* @returns At most 256 plugin rows and 256 missing-service observations, with omission counts.
|
|
36
|
+
*/
|
|
37
|
+
export declare function captureStartupComposition(ctx: Context): StartupCompositionDiagnostic;
|
|
38
|
+
//# sourceMappingURL=startup-diagnostics.d.ts.map
|
|
@@ -569,7 +569,7 @@ function internalModules() {
|
|
|
569
569
|
const esmResolve = addon.requireBuiltin("internal/modules/esm/resolve");
|
|
570
570
|
const esm = esmModule.getOrInitializeCascadedLoader();
|
|
571
571
|
const modern = "getOrCreateModuleJob" in esm;
|
|
572
|
-
/* v8 ignore start -- the supported Node
|
|
572
|
+
/* v8 ignore start -- the supported Node 24/26 matrix validates each available Internal interface */
|
|
573
573
|
if (typeof esm.resolveSync !== "function" || typeof Reflect.get(esm, modern ? "getOrCreateModuleJob" : "getModuleJobForImport") !== "function" || !modern && typeof Reflect.get(esm, "resolve") !== "function" || typeof cjsModule.Module._resolveFilename !== "function" || typeof cjsHelpers.getCjsConditions !== "function" || typeof esmUtils.getDefaultConditions !== "function" || typeof esmResolve.defaultResolve !== "function") throw new Error("profile resolution: unsupported Node module loader");
|
|
574
574
|
/* v8 ignore stop */
|
|
575
575
|
return {
|
|
@@ -645,7 +645,7 @@ function installRuntimeInterception(resolution) {
|
|
|
645
645
|
let expected;
|
|
646
646
|
try {
|
|
647
647
|
expected = adapted(target.specifier, target.parentURL, attributes);
|
|
648
|
-
/* v8 ignore next --
|
|
648
|
+
/* v8 ignore next -- the current loader resolves synchronously; the private interface also permits Promise results */
|
|
649
649
|
if (expected instanceof Promise) expected = expected.catch(restoreImporter);
|
|
650
650
|
} catch (error) {
|
|
651
651
|
return restoreImporter(error);
|
|
@@ -674,7 +674,7 @@ function installRuntimeInterception(resolution) {
|
|
|
674
674
|
} catch (error) {
|
|
675
675
|
return restoreImporter(error);
|
|
676
676
|
}
|
|
677
|
-
/* v8 ignore next --
|
|
677
|
+
/* v8 ignore next -- the current loader resolves synchronously; the private interface also permits Promise results */
|
|
678
678
|
if (result instanceof Promise) return result.catch(restoreImporter);
|
|
679
679
|
if (cacheable) state.esm = result;
|
|
680
680
|
return result;
|
|
@@ -696,12 +696,12 @@ function installRuntimeInterception(resolution) {
|
|
|
696
696
|
};
|
|
697
697
|
return (request, parent, attributes) => {
|
|
698
698
|
const result = adapted(request, parent, attributes);
|
|
699
|
-
/* v8 ignore next --
|
|
699
|
+
/* v8 ignore next -- the current loader resolves synchronously; the private interface also permits Promise results */
|
|
700
700
|
return result instanceof Promise ? result.then((resolved) => relocate(resolved, parent)) : relocate(result, parent);
|
|
701
701
|
};
|
|
702
702
|
};
|
|
703
703
|
let restoreEsm;
|
|
704
|
-
/* v8 ignore else -- CI coverage runs Node 24 v2; the Node
|
|
704
|
+
/* v8 ignore else -- CI coverage runs Node 24 v2; the Node 24.0 matrix exercises the v1 adapter */
|
|
705
705
|
if (modern) {
|
|
706
706
|
const loader = esm;
|
|
707
707
|
const original = Reflect.get(loader, "resolveSync");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-app-boot",
|
|
3
3
|
"description": "Shared boot glue for the app bins: .env loading, fail-loud Loader guards, snapshot-aware config resolution, and the Loader boot sequence",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-atomic-write": "0.2.
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
35
|
+
"@deepseek-ai/dsh-atomic-write": "0.2.2-alpha.3",
|
|
36
|
+
"@deepseek-ai/dsh-official-bundles": "0.2.2-alpha.3",
|
|
37
|
+
"@deepseek-ai/dsh-package-manifest": "0.2.2-alpha.3",
|
|
37
38
|
"@eslint-community/regexpp": "^4.12.2",
|
|
38
39
|
"ajv": "^8.20.0",
|
|
39
40
|
"js-yaml": "^4.3.2",
|
|
@@ -42,24 +43,24 @@
|
|
|
42
43
|
"semver": "^7.8.5"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"@deepseek-ai/cordis-plugin-group": "~1.0.
|
|
46
|
-
"@deepseek-ai/cordis-plugin-include": "~1.0.
|
|
47
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.
|
|
48
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.
|
|
49
|
-
"@deepseek-ai/dsh-home-paths": "0.2.
|
|
50
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
46
|
+
"@deepseek-ai/cordis-plugin-group": "~1.0.6-alpha.2",
|
|
47
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.11-alpha.2",
|
|
48
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.7-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.3",
|
|
50
|
+
"@deepseek-ai/dsh-home-paths": "0.2.2-alpha.3",
|
|
51
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.2"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
54
|
-
"@deepseek-ai/cordis-plugin-group": "~1.0.
|
|
55
|
-
"@deepseek-ai/cordis-plugin-include": "~1.0.
|
|
56
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.
|
|
57
|
-
"@deepseek-ai/cordis-plugin-timer": "~1.1.
|
|
58
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.
|
|
59
|
-
"@deepseek-ai/dsh-home-paths": "0.2.
|
|
60
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.
|
|
54
|
+
"@deepseek-ai/schemastery": "~3.18.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/cordis-plugin-group": "~1.0.6-alpha.2",
|
|
56
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.11-alpha.2",
|
|
57
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.7-alpha.2",
|
|
58
|
+
"@deepseek-ai/cordis-plugin-timer": "~1.1.8-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.3",
|
|
60
|
+
"@deepseek-ai/dsh-home-paths": "0.2.2-alpha.3",
|
|
61
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.3",
|
|
61
62
|
"@types/js-yaml": "^4.0.9",
|
|
62
63
|
"@types/semver": "^7.8.0",
|
|
63
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
64
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.2"
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Package admission shared by offline catalog generation and release ordering. */
|
|
2
|
-
/** Public DSH release members available through the ordinary on-demand bundle installer. */
|
|
3
|
-
export declare const ON_DEMAND_BUNDLES: readonly string[];
|
|
4
|
-
//# sourceMappingURL=official-bundle-packages.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Official bundles offered without installing their provider runtimes in the DSH distribution. */
|
|
2
|
-
import type { PluginLocalizedMeta } from '@deepseek-ai/dsh-package-manifest';
|
|
3
|
-
export { ON_DEMAND_BUNDLES } from './official-bundle-packages.ts';
|
|
4
|
-
/** Offline discovery metadata; installation state and the requested version belong to the running host. */
|
|
5
|
-
export interface OfficialBundleCatalogEntry {
|
|
6
|
-
/** Exact npm package name accepted by the existing bundle installer. */
|
|
7
|
-
readonly packageName: string;
|
|
8
|
-
/** Package-owned localized text and a self-contained icon, embedded without provider code. */
|
|
9
|
-
readonly meta: Required<Pick<PluginLocalizedMeta, 'title' | 'description' | 'icon'>>;
|
|
10
|
-
}
|
|
11
|
-
export { OFFICIAL_ON_DEMAND_CATALOG } from './official-bundles.generated.ts';
|
|
12
|
-
//# sourceMappingURL=official-bundles.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Generated offline Official bundle metadata. Run pnpm gen-official-bundle-catalog; do not edit. */
|
|
2
|
-
import type { OfficialBundleCatalogEntry } from './official-bundles.ts';
|
|
3
|
-
/** Official on-demand entries, independent of installed packages and registry availability. */
|
|
4
|
-
export declare const OFFICIAL_ON_DEMAND_CATALOG: readonly OfficialBundleCatalogEntry[];
|
|
5
|
-
//# sourceMappingURL=official-bundles.generated.d.ts.map
|