@deepseek-ai/dsh-app-boot 0.1.1-rc.2 → 0.1.2-alpha.2
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 +126 -33
- package/README.zh.md +131 -38
- package/lib/index.js +383 -59
- package/lib/types/index.d.ts +4 -4
- package/lib/types/profile.d.ts +44 -25
- package/package.json +23 -21
package/lib/types/profile.d.ts
CHANGED
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Module resolution is two-anchor by construction: a bundle name resolves
|
|
16
16
|
* first from the dsh installation (the launcher's own package), then from the
|
|
17
|
-
* profile directory.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* profile directory. Pnpm-managed entries in the profile's `node_modules`
|
|
18
|
+
* resolve first. Dsh-owned links add packages carried only by selected
|
|
19
|
+
* bundles, while `$DSH_HOME/profiles/node_modules` supplies the installation
|
|
20
|
+
* dependency closure through Node's ordinary parent-walk. Plain Node uses
|
|
21
|
+
* symlinks for that shared fallback; packaged executables use ESM proxies so
|
|
22
|
+
* external plugins retain the installation's module instances.
|
|
22
23
|
* @module @deepseek-ai/dsh-app-boot/profile
|
|
23
24
|
*/
|
|
24
25
|
import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader';
|
|
@@ -36,6 +37,17 @@ export interface DshBundleManifest {
|
|
|
36
37
|
export interface DshProfileManifest {
|
|
37
38
|
/** Ordered bundle layer list (package names). */
|
|
38
39
|
bundles?: string[];
|
|
40
|
+
/** Whether user patch files reload while this profile remains active. */
|
|
41
|
+
patchReload?: ProfilePatchReload;
|
|
42
|
+
}
|
|
43
|
+
/** User patch-file lifecycle selected by a profile. */
|
|
44
|
+
export type ProfilePatchReload = 'live' | 'startup';
|
|
45
|
+
/** Installation-owned defaults used when a shipped profile is first opened. */
|
|
46
|
+
export interface ProfileTemplate {
|
|
47
|
+
/** Ordered bundle layer list. */
|
|
48
|
+
bundles: readonly string[];
|
|
49
|
+
/** User patch-file lifecycle for the generated profile. */
|
|
50
|
+
patchReload: ProfilePatchReload;
|
|
39
51
|
}
|
|
40
52
|
/**
|
|
41
53
|
* The profile-launcher slice of the `dsh`-owned package.json section. A
|
|
@@ -77,6 +89,8 @@ export interface Profile {
|
|
|
77
89
|
patchPath: string;
|
|
78
90
|
/** The profile's own patches; empty when the file is absent. */
|
|
79
91
|
patches: PatchOptions[];
|
|
92
|
+
/** Whether the launcher watches user patch files after boot. */
|
|
93
|
+
patchReload: ProfilePatchReload;
|
|
80
94
|
}
|
|
81
95
|
/**
|
|
82
96
|
* Resolve a profile's directory under the Harness home.
|
|
@@ -86,37 +100,42 @@ export interface Profile {
|
|
|
86
100
|
*/
|
|
87
101
|
export declare function resolveProfileDir(name: string, home?: string): string;
|
|
88
102
|
/** The shipped profile templates auto-initialized on first use, by name. */
|
|
89
|
-
export declare const PROFILE_TEMPLATES: Record<string,
|
|
103
|
+
export declare const PROFILE_TEMPLATES: Record<string, ProfileTemplate>;
|
|
90
104
|
/** The bundle list a `dsh plugin` init uses for a name with no shipped template. */
|
|
91
105
|
export declare const DEFAULT_PROFILE_BUNDLES: readonly string[];
|
|
106
|
+
/** Custom profiles retain the historical live patch-file behavior. */
|
|
107
|
+
export declare const DEFAULT_PROFILE_PATCH_RELOAD: ProfilePatchReload;
|
|
92
108
|
/**
|
|
93
109
|
* Initialize a profile directory: manifest, empty user patch layer, and the
|
|
94
110
|
* pnpm settings out-of-tree plugins need. Existing files are never touched,
|
|
95
111
|
* so re-running is a no-op on an initialized profile.
|
|
96
112
|
* @param dir - the profile directory from {@link resolveProfileDir}.
|
|
97
113
|
* @param bundles - the initial `dsh.profile.bundles` layer list.
|
|
114
|
+
* @param patchReload - user patch-file lifecycle; custom profiles default to live reload.
|
|
98
115
|
*/
|
|
99
|
-
export declare function initProfile(dir: string, bundles: readonly string[]): void;
|
|
116
|
+
export declare function initProfile(dir: string, bundles: readonly string[], patchReload?: ProfilePatchReload): void;
|
|
117
|
+
/** Inputs for {@link healProfilesModuleFallback}. */
|
|
118
|
+
export interface ProfileModuleFallbackOptions {
|
|
119
|
+
/** Absolute package.json path of the running dsh installation. */
|
|
120
|
+
installAnchor: string;
|
|
121
|
+
/** Loaded profile whose selected bundles may carry profile-local plugins. */
|
|
122
|
+
profile?: Profile;
|
|
123
|
+
/** Harness home; defaults to {@link resolveDshHome}. */
|
|
124
|
+
home?: string;
|
|
125
|
+
}
|
|
100
126
|
/**
|
|
101
|
-
* Maintain
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* resolve their own dependencies from their real directories (Node's default
|
|
112
|
-
* symlink-following), so each package needs only its one flat link.
|
|
113
|
-
* Idempotent: correct links are kept and moved installations are
|
|
114
|
-
* re-pointed; a stale link to a vanished package stays until its name is
|
|
115
|
-
* reused (dangling links are invisible to resolution).
|
|
116
|
-
* @param installAnchor - absolute path of the dsh app's package.json.
|
|
117
|
-
* @param home - the Harness home; defaults to {@link resolveDshHome}.
|
|
127
|
+
* Maintain module fallbacks for one profile launch. The shared
|
|
128
|
+
* `$DSH_HOME/profiles/node_modules` mirrors the dsh installation dependency
|
|
129
|
+
* closure. Plain Node writes symlinks; a packaged executable writes ESM
|
|
130
|
+
* proxies under a cross-process lock because operating-system links cannot
|
|
131
|
+
* enter pkg's virtual filesystem. Missing packages carried only by selected
|
|
132
|
+
* bundles are linked through a profile-owned directory into that profile's
|
|
133
|
+
* `node_modules`; pnpm-managed entries remain authoritative, and another
|
|
134
|
+
* profile's links cannot change its resolution.
|
|
135
|
+
* @param options - installation anchor, optional loaded profile, and Harness home.
|
|
136
|
+
* @returns settlement after the shared fallback and profile-local links are current.
|
|
118
137
|
*/
|
|
119
|
-
export declare function healProfilesModuleFallback(
|
|
138
|
+
export declare function healProfilesModuleFallback(options: ProfileModuleFallbackOptions): Promise<void>;
|
|
120
139
|
/**
|
|
121
140
|
* Read a profile's manifest.
|
|
122
141
|
* @param binName - the diagnostic prefix on the thrown error.
|
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.1.
|
|
4
|
+
"version": "0.1.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,18 +32,20 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"js-yaml": "^4.2.0"
|
|
35
|
+
"js-yaml": "^4.2.0",
|
|
36
|
+
"resolve.exports": "^2.0.3",
|
|
37
|
+
"@deepseek-ai/dsh-atomic-write": "^0.1.2-alpha.2"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
|
-
"@deepseek-ai/cordis-plugin-group": "^1.0.
|
|
39
|
-
"@deepseek-ai/cordis-plugin-
|
|
40
|
-
"@deepseek-ai/
|
|
41
|
-
"@deepseek-ai/
|
|
42
|
-
"@deepseek-ai/
|
|
43
|
-
"@deepseek-ai/
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/
|
|
46
|
-
"@deepseek-ai/
|
|
40
|
+
"@deepseek-ai/cordis-plugin-group": "^1.0.2",
|
|
41
|
+
"@deepseek-ai/cordis-plugin-hmr": "^1.0.17",
|
|
42
|
+
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
43
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
44
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.2-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.2",
|
|
47
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
48
|
+
"@deepseek-ai/dsh-launch-environment": "^0.1.2-alpha.2"
|
|
47
49
|
},
|
|
48
50
|
"peerDependenciesMeta": {
|
|
49
51
|
"@deepseek-ai/cordis-plugin-hmr": {
|
|
@@ -52,15 +54,15 @@
|
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
56
|
"@types/js-yaml": "^4.0.9",
|
|
55
|
-
"@deepseek-ai/cordis-plugin-group": "^1.0.
|
|
56
|
-
"@deepseek-ai/cordis-plugin-hmr": "^1.0.
|
|
57
|
-
"@deepseek-ai/cordis-plugin-include": "^1.0.
|
|
58
|
-
"@deepseek-ai/cordis-plugin-loader": "^1.0.
|
|
59
|
-
"@deepseek-ai/cordis-plugin-timer": "^1.1.
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/
|
|
64
|
-
"@deepseek-ai/
|
|
57
|
+
"@deepseek-ai/cordis-plugin-group": "^1.0.2",
|
|
58
|
+
"@deepseek-ai/cordis-plugin-hmr": "^1.0.17",
|
|
59
|
+
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
60
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
61
|
+
"@deepseek-ai/cordis-plugin-timer": "^1.1.4",
|
|
62
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.2-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.2",
|
|
65
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
66
|
+
"@deepseek-ai/dsh-launch-environment": "^0.1.2-alpha.2"
|
|
65
67
|
}
|
|
66
68
|
}
|