@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.
@@ -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. The Loader's `baseUrl` is the profile directory, whose
18
- * `node_modules` pnpm manages for out-of-tree plugins, while the maintained
19
- * flat fallback directory `$DSH_HOME/profiles/node_modules` (one symlink per
20
- * package the installation's app and bundles depend on) makes every in-box
21
- * plugin Node-resolvable from any profile through the ordinary parent-walk.
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, readonly 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 the flat module fallback `$DSH_HOME/profiles/node_modules`: one
102
- * symlink per package in the dsh app's resolvable dependency CLOSURE (BFS
103
- * over `dependencies` from the app manifest), each resolved from its own
104
- * real location. Node's parent-directory walk from any profile finds this
105
- * directory after the profile's own `node_modules`, so every in-box plugin
106
- * resolves without pnpm ever managing it — the exact "bundles come from the
107
- * installation" contract. The closure (not just direct dependencies) is
108
- * required for out-of-tree plugins: their peer dependencies name Service
109
- * Definition packages (`dsh-compaction`, `dsh-invariants`, ...) that the app
110
- * reaches only through its Service Provider packages. Symlinked packages
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(installAnchor: string, home?: string): void;
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.1-rc.2",
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.1",
39
- "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
40
- "@deepseek-ai/dsh-launch-environment": "^0.1.1-rc.2",
41
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
42
- "@deepseek-ai/cordis-plugin-hmr": "^1.0.16",
43
- "@deepseek-ai/cordis-plugin-include": "^1.0.6",
44
- "@deepseek-ai/dsh-home-paths": "^0.1.1-rc.2",
45
- "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
46
- "@deepseek-ai/cordis": "^4.0.1"
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.1",
56
- "@deepseek-ai/cordis-plugin-hmr": "^1.0.16",
57
- "@deepseek-ai/cordis-plugin-include": "^1.0.6",
58
- "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
59
- "@deepseek-ai/cordis-plugin-timer": "^1.1.3",
60
- "@deepseek-ai/dsh-home-paths": "^0.1.1-rc.2",
61
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
62
- "@deepseek-ai/dsh-launch-environment": "^0.1.1-rc.2",
63
- "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
64
- "@deepseek-ai/cordis": "^4.0.1"
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
  }