create-principles-disciple 1.147.2 → 1.147.4
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/_release/product-identity.json +1 -1
- package/dist/installer.d.ts +20 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +178 -115
- package/dist/installer.js.map +1 -1
- package/dist/mvp-config.d.ts +11 -0
- package/dist/mvp-config.d.ts.map +1 -1
- package/dist/mvp-config.js.map +1 -1
- package/dist/update/release-metadata.d.ts +13 -5
- package/dist/update/release-metadata.d.ts.map +1 -1
- package/dist/update/release-metadata.js.map +1 -1
- package/package.json +3 -2
- package/pd-cli/package.json +1 -1
- package/release-manager/dist/installer.js +178 -115
- package/release-manager/package.json +2 -1
package/dist/installer.d.ts
CHANGED
|
@@ -340,6 +340,26 @@ export interface GlobalPdShimResult {
|
|
|
340
340
|
export declare function renderShForwardingShim(targetPath: string): string;
|
|
341
341
|
export declare function installGlobalPdShim(): GlobalPdShimResult | boolean;
|
|
342
342
|
export declare function tryUpgradePdCliFromNpm(installedPdCliDir: string): void;
|
|
343
|
+
/**
|
|
344
|
+
* G3 §10.5: materialize the INSTALLED pd-cli's `file:../` sibling links
|
|
345
|
+
* (core / host-runtime / codex-adapter / workbuddy-adapter / install-layout /
|
|
346
|
+
* principles-disciple) through the shared helper. Replaces the hand-rolled
|
|
347
|
+
* per-dependency blocks that used to live in syncPdCli(): those short-circuited
|
|
348
|
+
* on existsSync(), so an npm-materialized physical copy silently won over the
|
|
349
|
+
* intended runtime sibling.
|
|
350
|
+
*
|
|
351
|
+
* Ordering contract: MUST run after installPdCliDependencies() (the dependency
|
|
352
|
+
* stage is what can (re)materialize node_modules) AND after every sibling is
|
|
353
|
+
* deployed. A missing sibling fails the install loud (the helper).
|
|
354
|
+
*/
|
|
355
|
+
export declare function ensurePdCliResolution(): void;
|
|
356
|
+
/**
|
|
357
|
+
* G3 §10.5: same contract for the INSTALLED pd-console (core / host-runtime /
|
|
358
|
+
* install-layout / principles-disciple / create-principles-disciple). Runs
|
|
359
|
+
* after installConsoleDependencies() so npm-materialized copies are corrected
|
|
360
|
+
* instead of silently kept.
|
|
361
|
+
*/
|
|
362
|
+
export declare function ensureConsoleResolution(): void;
|
|
343
363
|
/**
|
|
344
364
|
* PRI-711: materialize node_modules links for the INSTALLED codex-adapter so
|
|
345
365
|
* its declared `file:../<component>` dependencies resolve under ESM realpath
|
package/dist/installer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAMvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAoBL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAInF,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoBtF,OAAO,EAOL,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAC;AAEzC,iFAAiF;AACjF,eAAO,MAAM,8BAA8B,EAAG,yBAAkC,CAAC;AAEjF;gFACgF;AAChF,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAMpF;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCjG;AAkCD,wBAAgB,sBAAsB,IAAI,MAAM,CAU/C;
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAOA,OAAO,EAA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AE,EAAE,gBAAgB,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CAYN;AAQD,wBAAsB,OAAO,CAC3B,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,cAAmB,EAMzB,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,aAAa,CAAC,CAo8BxB"}
|
package/dist/installer.js
CHANGED
|
@@ -133,9 +133,6 @@ function installsOpenClaw(host) {
|
|
|
133
133
|
function installsWorkbuddy(host) {
|
|
134
134
|
return host === 'workbuddy' || host === 'all';
|
|
135
135
|
}
|
|
136
|
-
function installedPluginDir() {
|
|
137
|
-
return getInstalledPluginDir();
|
|
138
|
-
}
|
|
139
136
|
function pluginInstallDirs() {
|
|
140
137
|
return installsOpenClaw(activeHostTarget)
|
|
141
138
|
? [getInstalledPluginDir(), getPluginExtDir()]
|
|
@@ -1909,77 +1906,13 @@ function syncPdCli(pluginDir) {
|
|
|
1909
1906
|
if (existsSync(bundledNodeModules)) {
|
|
1910
1907
|
cpSync(bundledNodeModules, path.join(installedPdCliDir, 'node_modules'), { recursive: true });
|
|
1911
1908
|
}
|
|
1912
|
-
//
|
|
1913
|
-
//
|
|
1914
|
-
//
|
|
1915
|
-
//
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
const coreLinkPath = path.join(coreLinkDir, 'core');
|
|
1920
|
-
if (!existsSync(coreLinkPath)) {
|
|
1921
|
-
if (isWindows()) {
|
|
1922
|
-
// On Windows, use a junction (directory symlink) which doesn't require elevated privileges
|
|
1923
|
-
symlinkSync(coreLinkTarget, coreLinkPath, 'junction');
|
|
1924
|
-
}
|
|
1925
|
-
else {
|
|
1926
|
-
// On Unix, use a relative symlink for portability
|
|
1927
|
-
symlinkSync('../../../core', coreLinkPath, 'dir');
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
// Create node_modules/@principles/host-runtime symlink so pd-cli can resolve
|
|
1931
|
-
// its @principles/host-runtime dependency (rewritten to "file:../host-runtime"
|
|
1932
|
-
// by bundle-plugin.mjs). Without this, `pd --version` crashes with
|
|
1933
|
-
// ERR_MODULE_NOT_FOUND because pd-cli statically imports createProductionHostRuntime.
|
|
1934
|
-
// host-runtime's own better-sqlite3 / js-yaml / @principles/core dependencies
|
|
1935
|
-
// resolve through the plugin's <ext>/node_modules/ (shared via Node's upward
|
|
1936
|
-
// module resolution), so no separate npm install is needed.
|
|
1937
|
-
const hostRuntimeLinkTarget = path.join(getPdRuntimeDir(), 'host-runtime');
|
|
1938
|
-
const hostRuntimeLinkPath = path.join(coreLinkDir, 'host-runtime');
|
|
1939
|
-
if (!existsSync(hostRuntimeLinkPath)) {
|
|
1940
|
-
if (isWindows()) {
|
|
1941
|
-
symlinkSync(hostRuntimeLinkTarget, hostRuntimeLinkPath, 'junction');
|
|
1942
|
-
}
|
|
1943
|
-
else {
|
|
1944
|
-
symlinkSync('../../../host-runtime', hostRuntimeLinkPath, 'dir');
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
// Create node_modules/@principles/codex-adapter symlink so pd-cli can resolve
|
|
1948
|
-
// its @principles/codex-adapter dependency (rewritten to
|
|
1949
|
-
// "file:../codex-adapter" by bundle-plugin.mjs). Without this, `pd codex
|
|
1950
|
-
// worker` crashes with ERR_MODULE_NOT_FOUND (PRI-624).
|
|
1951
|
-
const codexAdapterLinkTarget = path.join(getPdRuntimeDir(), 'codex-adapter');
|
|
1952
|
-
const codexAdapterLinkPath = path.join(coreLinkDir, 'codex-adapter');
|
|
1953
|
-
if (!existsSync(codexAdapterLinkPath)) {
|
|
1954
|
-
if (isWindows()) {
|
|
1955
|
-
symlinkSync(codexAdapterLinkTarget, codexAdapterLinkPath, 'junction');
|
|
1956
|
-
}
|
|
1957
|
-
else {
|
|
1958
|
-
symlinkSync('../../../codex-adapter', codexAdapterLinkPath, 'dir');
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
// Create node_modules/principles-disciple symlink so pd-cli can resolve
|
|
1962
|
-
// its principles-disciple dependency (the plugin package, rewritten to
|
|
1963
|
-
// "file:../plugin" by bundle-plugin.mjs). The plugin is installed at the
|
|
1964
|
-
// extension dir root (getPluginExtDir()), so the symlink target is the
|
|
1965
|
-
// ext dir itself — Node resolves `import 'principles-disciple'` via the
|
|
1966
|
-
// plugin's package.json exports field.
|
|
1967
|
-
// Without this, `pd runtime init` crashes with ERR_MODULE_NOT_FOUND
|
|
1968
|
-
// because runtime-init.ts statically imports initTrajectorySchema.
|
|
1969
|
-
const pdLinkDir = path.join(installedPdCliDir, 'node_modules');
|
|
1970
|
-
const pdLinkTarget = installedPluginDir();
|
|
1971
|
-
mkdirSync(pdLinkDir, { recursive: true });
|
|
1972
|
-
const pdLinkPath = path.join(pdLinkDir, 'principles-disciple');
|
|
1973
|
-
if (!existsSync(pdLinkPath)) {
|
|
1974
|
-
if (isWindows()) {
|
|
1975
|
-
symlinkSync(pdLinkTarget, pdLinkPath, 'junction');
|
|
1976
|
-
}
|
|
1977
|
-
else {
|
|
1978
|
-
// Relative from <ext>/pd-cli/node_modules/ to <ext>/: go up twice
|
|
1979
|
-
// (node_modules → pd-cli → ext)
|
|
1980
|
-
symlinkSync('../../', pdLinkPath, 'dir');
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1909
|
+
// G3 §10.5: the pd-cli sibling links (core / host-runtime / codex-adapter /
|
|
1910
|
+
// workbuddy-adapter / install-layout / principles-disciple) are NO LONGER
|
|
1911
|
+
// hand-rolled here. install() materializes them via
|
|
1912
|
+
// ensurePdCliResolution() AFTER installPdCliDependencies(), so a physical
|
|
1913
|
+
// copy produced by the dependency stage can never be silently kept — this
|
|
1914
|
+
// block used to short-circuit on existsSync() and leave npm-materialized
|
|
1915
|
+
// copies in place.
|
|
1983
1916
|
tryUpgradePdCliFromNpm(installedPdCliDir);
|
|
1984
1917
|
const installedBinDir = getInstalledBinDir();
|
|
1985
1918
|
mkdirSync(installedBinDir, { recursive: true });
|
|
@@ -2157,29 +2090,11 @@ function installConsole(consoleDir) {
|
|
|
2157
2090
|
}
|
|
2158
2091
|
rmSync(consoleDest, { recursive: true, force: true });
|
|
2159
2092
|
cpSync(consoleSrc, consoleDest, { recursive: true });
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
}
|
|
2166
|
-
else {
|
|
2167
|
-
symlinkSync(path.relative(path.dirname(pluginLinkPath), installedPluginDir()), pluginLinkPath, 'dir');
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
// PRI-672: console resolves its create-principles-disciple dependency (the
|
|
2171
|
-
// ReleaseManager authority module, rewritten to file:../release-manager by
|
|
2172
|
-
// bundle-plugin.mjs) through this link into ~/.pd/runtime.
|
|
2173
|
-
const releaseManagerLinkPath = path.join(consoleDest, 'node_modules', 'create-principles-disciple');
|
|
2174
|
-
if (!existsSync(releaseManagerLinkPath)) {
|
|
2175
|
-
mkdirSync(path.dirname(releaseManagerLinkPath), { recursive: true });
|
|
2176
|
-
if (isWindows()) {
|
|
2177
|
-
symlinkSync(getInstalledReleaseManagerDir(), releaseManagerLinkPath, 'junction');
|
|
2178
|
-
}
|
|
2179
|
-
else {
|
|
2180
|
-
symlinkSync(path.relative(path.dirname(releaseManagerLinkPath), getInstalledReleaseManagerDir()), releaseManagerLinkPath, 'dir');
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2093
|
+
// G3 §10.5: the console's sibling links (core / host-runtime / install-layout
|
|
2094
|
+
// / principles-disciple / create-principles-disciple) are materialized by
|
|
2095
|
+
// ensureConsoleResolution() AFTER installConsoleDependencies() — see
|
|
2096
|
+
// ensurePdCliResolution() for why the old existsSync() short-circuit was
|
|
2097
|
+
// removed instead of kept.
|
|
2183
2098
|
}
|
|
2184
2099
|
function getInstalledCoreDir() {
|
|
2185
2100
|
return path.join(getPdRuntimeDir(), 'core');
|
|
@@ -2272,6 +2187,101 @@ function installBundledCodexAdapter(pluginDir) {
|
|
|
2272
2187
|
rmSync(codexAdapterDest, { recursive: true, force: true });
|
|
2273
2188
|
cpSync(codexAdapterSrc, codexAdapterDest, { recursive: true });
|
|
2274
2189
|
}
|
|
2190
|
+
/**
|
|
2191
|
+
* P1: structural package-name validation. Unscoped names have exactly one
|
|
2192
|
+
* segment; scoped names exactly `@scope/pkg`. This is deliberately NOT one
|
|
2193
|
+
* regex: "." / ".." pass a character-class test, yet path.join() normalizes
|
|
2194
|
+
* them onto node_modules / the scope parent / the component root.
|
|
2195
|
+
*/
|
|
2196
|
+
function isSafeNameSegment(segment) {
|
|
2197
|
+
return segment.length > 0 && segment !== '.' && segment !== '..' && /^[A-Za-z0-9._-]+$/.test(segment);
|
|
2198
|
+
}
|
|
2199
|
+
function parseDependencyName(name) {
|
|
2200
|
+
const scoped = name.startsWith('@');
|
|
2201
|
+
const raw = (scoped ? name.slice(1) : name).split('/');
|
|
2202
|
+
if (scoped ? raw.length !== 2 : raw.length !== 1)
|
|
2203
|
+
return undefined;
|
|
2204
|
+
if (!raw.every(isSafeNameSegment))
|
|
2205
|
+
return undefined;
|
|
2206
|
+
if (!scoped)
|
|
2207
|
+
return raw;
|
|
2208
|
+
const [scope, packageName] = raw;
|
|
2209
|
+
return scope !== undefined && packageName !== undefined ? [`@${scope}`, packageName] : undefined;
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* P1: `target` must be a STRICT descendant of `root` (never root itself, never
|
|
2213
|
+
* `..`, never an absolute escape). Applied to the lexical link path, the real
|
|
2214
|
+
* node_modules directory (which must stay inside the component) and any
|
|
2215
|
+
* symlinked ancestor we are about to create or delete through.
|
|
2216
|
+
*/
|
|
2217
|
+
function assertStrictlyInside(root, target, componentLabel) {
|
|
2218
|
+
const relative = path.relative(root, target);
|
|
2219
|
+
if (relative === '' || relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
2220
|
+
throw new Error(`Installed ${componentLabel} dependency link path escapes the install tree (${target} is not strictly inside ${root}).`);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
/** P1: an existing path used as a link parent must be a real directory, not a symlink. */
|
|
2224
|
+
function assertRealParentDirectory(dir, componentLabel) {
|
|
2225
|
+
let stat;
|
|
2226
|
+
try {
|
|
2227
|
+
stat = lstatSync(dir);
|
|
2228
|
+
}
|
|
2229
|
+
catch (error) {
|
|
2230
|
+
throw new Error(`Installed ${componentLabel} dependency link parent is missing (${dir}): ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
2231
|
+
}
|
|
2232
|
+
if (stat.isSymbolicLink()) {
|
|
2233
|
+
throw new Error(`Installed ${componentLabel} dependency link parent must not be a symbolic link (${dir}).`);
|
|
2234
|
+
}
|
|
2235
|
+
if (!stat.isDirectory()) {
|
|
2236
|
+
throw new Error(`Installed ${componentLabel} dependency link parent must be a directory (${dir}).`);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* P1 two-phase planning: resolve + validate every `file:../` dependency and
|
|
2241
|
+
* its final link path without mutating anything. Only a fully valid plan is
|
|
2242
|
+
* returned, so an invalid later entry cannot leave earlier links half-applied.
|
|
2243
|
+
*/
|
|
2244
|
+
function planComponentFileDependencyLinks(componentDir, componentLabel, dependencies) {
|
|
2245
|
+
const runtimeDir = getPdRuntimeDir();
|
|
2246
|
+
const runtimeDirReal = realpathSync(runtimeDir);
|
|
2247
|
+
const nodeModulesDir = path.join(componentDir, 'node_modules');
|
|
2248
|
+
const operations = [];
|
|
2249
|
+
for (const [name, ref] of Object.entries(dependencies)) {
|
|
2250
|
+
if (typeof ref !== 'string' || !ref.startsWith('file:../'))
|
|
2251
|
+
continue;
|
|
2252
|
+
const siblingName = ref.slice('file:../'.length);
|
|
2253
|
+
// rc-1: only a single ordinary sibling segment; "." / ".." and separators
|
|
2254
|
+
// must not resolve the ref outside the runtime dir.
|
|
2255
|
+
if (!isSafeNameSegment(siblingName)) {
|
|
2256
|
+
throw new Error(`Installed ${componentLabel} declares an unsupported file dependency ref "${ref}" for ${name}.`);
|
|
2257
|
+
}
|
|
2258
|
+
const segments = parseDependencyName(name);
|
|
2259
|
+
if (segments === undefined) {
|
|
2260
|
+
throw new Error(`Installed ${componentLabel} declares an unsupported dependency name "${name}".`);
|
|
2261
|
+
}
|
|
2262
|
+
const siblingDir = path.join(runtimeDir, siblingName);
|
|
2263
|
+
if (!existsSync(siblingDir)) {
|
|
2264
|
+
throw new Error(`${componentLabel} depends on ${ref} but the sibling runtime component is missing: ${siblingDir}`);
|
|
2265
|
+
}
|
|
2266
|
+
const siblingReal = realpathSync(siblingDir);
|
|
2267
|
+
// The sibling must resolve to exactly <runtime>/<siblingName>: a symlink
|
|
2268
|
+
// that redirects the link target outside the runtime is not a sibling.
|
|
2269
|
+
if (path.relative(runtimeDirReal, siblingReal) !== siblingName) {
|
|
2270
|
+
throw new Error(`Installed ${componentLabel} declares a file dependency ref that resolves outside the runtime dir: "${ref}".`);
|
|
2271
|
+
}
|
|
2272
|
+
const linkPath = path.join(nodeModulesDir, ...segments);
|
|
2273
|
+
// Lexical boundary + segment-count: path.join() collapses "." / ".." and
|
|
2274
|
+
// repeated separators, so the normalized path must still have exactly the
|
|
2275
|
+
// declared number of segments and be a strict descendant of node_modules.
|
|
2276
|
+
const relative = path.relative(nodeModulesDir, linkPath);
|
|
2277
|
+
if (relative.split(path.sep).length !== segments.length) {
|
|
2278
|
+
throw new Error(`Installed ${componentLabel} declares an unsupported dependency name "${name}".`);
|
|
2279
|
+
}
|
|
2280
|
+
assertStrictlyInside(nodeModulesDir, linkPath, componentLabel);
|
|
2281
|
+
operations.push({ segments, siblingReal, linkPath });
|
|
2282
|
+
}
|
|
2283
|
+
return operations;
|
|
2284
|
+
}
|
|
2275
2285
|
/**
|
|
2276
2286
|
* PRI-711 (generalized for ADR-0020 host adapters): materialize node_modules
|
|
2277
2287
|
* links for an INSTALLED runtime component so its declared `file:../<component>`
|
|
@@ -2298,21 +2308,40 @@ function ensureComponentFileDependencyLinks(componentDir, componentLabel) {
|
|
|
2298
2308
|
if (manifest.dependencies !== undefined && !isRecord(manifest.dependencies)) {
|
|
2299
2309
|
throw new Error(`Installed ${componentLabel} package.json dependencies must be an object (${manifestPath}).`);
|
|
2300
2310
|
}
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2311
|
+
// P1: validate EVERYTHING before touching the filesystem. A manifest is
|
|
2312
|
+
// untrusted input, and a name that normalizes to node_modules / the scope
|
|
2313
|
+
// parent / the component root must never reach a recursive delete.
|
|
2314
|
+
const operations = planComponentFileDependencyLinks(componentDir, componentLabel, manifest.dependencies ?? {});
|
|
2315
|
+
if (operations.length === 0)
|
|
2316
|
+
return;
|
|
2317
|
+
const componentDirReal = realpathSync(componentDir);
|
|
2318
|
+
const nodeModulesDir = path.join(componentDir, 'node_modules');
|
|
2319
|
+
// P1: node_modules itself must be a real directory inside the component —
|
|
2320
|
+
// a symlinked parent would redirect every link/delete outside the install.
|
|
2321
|
+
mkdirSync(nodeModulesDir, { recursive: true });
|
|
2322
|
+
assertRealParentDirectory(nodeModulesDir, componentLabel);
|
|
2323
|
+
const nodeModulesReal = realpathSync(nodeModulesDir);
|
|
2324
|
+
assertStrictlyInside(componentDirReal, nodeModulesReal, componentLabel);
|
|
2325
|
+
for (const operation of operations) {
|
|
2326
|
+
const { segments, siblingReal, linkPath } = operation;
|
|
2327
|
+
if (segments.length === 2) {
|
|
2328
|
+
// scoped parent: create only when absent; never replace an existing
|
|
2329
|
+
// real directory (npm may legitimately share it) and never follow a
|
|
2330
|
+
// symlinked parent.
|
|
2331
|
+
const scopeSegment = segments[0];
|
|
2332
|
+
const scopeDir = path.join(nodeModulesDir, scopeSegment);
|
|
2333
|
+
let scopeStat;
|
|
2334
|
+
try {
|
|
2335
|
+
scopeStat = lstatSync(scopeDir);
|
|
2336
|
+
}
|
|
2337
|
+
catch {
|
|
2338
|
+
scopeStat = undefined;
|
|
2339
|
+
}
|
|
2340
|
+
if (scopeStat === undefined)
|
|
2341
|
+
mkdirSync(scopeDir);
|
|
2342
|
+
assertRealParentDirectory(scopeDir, componentLabel);
|
|
2343
|
+
assertStrictlyInside(nodeModulesReal, realpathSync(scopeDir), componentLabel);
|
|
2314
2344
|
}
|
|
2315
|
-
const linkPath = path.join(componentDir, 'node_modules', name);
|
|
2316
2345
|
let stat;
|
|
2317
2346
|
try {
|
|
2318
2347
|
stat = lstatSync(linkPath);
|
|
@@ -2323,24 +2352,50 @@ function ensureComponentFileDependencyLinks(componentDir, componentLabel) {
|
|
|
2323
2352
|
if (stat !== undefined) {
|
|
2324
2353
|
if (stat.isSymbolicLink()) {
|
|
2325
2354
|
try {
|
|
2326
|
-
if (realpathSync(linkPath) ===
|
|
2355
|
+
if (realpathSync(linkPath) === siblingReal)
|
|
2327
2356
|
continue;
|
|
2328
2357
|
}
|
|
2329
2358
|
catch {
|
|
2330
2359
|
// Unreadable link target — fall through to replace.
|
|
2331
2360
|
}
|
|
2332
2361
|
}
|
|
2362
|
+
// linkPath was proven to be a strict descendant of node_modules during
|
|
2363
|
+
// planning, and both parent levels were re-verified as real directories
|
|
2364
|
+
// above, so the only recursive delete stays inside the component tree.
|
|
2333
2365
|
rmSync(linkPath, { recursive: stat.isDirectory() && !stat.isSymbolicLink(), force: true });
|
|
2334
2366
|
}
|
|
2335
|
-
mkdirSync(path.dirname(linkPath), { recursive: true });
|
|
2336
2367
|
if (isWindows()) {
|
|
2337
|
-
symlinkSync(
|
|
2368
|
+
symlinkSync(siblingReal, linkPath, 'junction');
|
|
2338
2369
|
}
|
|
2339
2370
|
else {
|
|
2340
|
-
symlinkSync(path.relative(path.dirname(linkPath),
|
|
2371
|
+
symlinkSync(path.relative(path.dirname(linkPath), siblingReal), linkPath, 'dir');
|
|
2341
2372
|
}
|
|
2342
2373
|
}
|
|
2343
2374
|
}
|
|
2375
|
+
/**
|
|
2376
|
+
* G3 §10.5: materialize the INSTALLED pd-cli's `file:../` sibling links
|
|
2377
|
+
* (core / host-runtime / codex-adapter / workbuddy-adapter / install-layout /
|
|
2378
|
+
* principles-disciple) through the shared helper. Replaces the hand-rolled
|
|
2379
|
+
* per-dependency blocks that used to live in syncPdCli(): those short-circuited
|
|
2380
|
+
* on existsSync(), so an npm-materialized physical copy silently won over the
|
|
2381
|
+
* intended runtime sibling.
|
|
2382
|
+
*
|
|
2383
|
+
* Ordering contract: MUST run after installPdCliDependencies() (the dependency
|
|
2384
|
+
* stage is what can (re)materialize node_modules) AND after every sibling is
|
|
2385
|
+
* deployed. A missing sibling fails the install loud (the helper).
|
|
2386
|
+
*/
|
|
2387
|
+
export function ensurePdCliResolution() {
|
|
2388
|
+
ensureComponentFileDependencyLinks(getInstalledPdCliDir(), '@principles/pd-cli');
|
|
2389
|
+
}
|
|
2390
|
+
/**
|
|
2391
|
+
* G3 §10.5: same contract for the INSTALLED pd-console (core / host-runtime /
|
|
2392
|
+
* install-layout / principles-disciple / create-principles-disciple). Runs
|
|
2393
|
+
* after installConsoleDependencies() so npm-materialized copies are corrected
|
|
2394
|
+
* instead of silently kept.
|
|
2395
|
+
*/
|
|
2396
|
+
export function ensureConsoleResolution() {
|
|
2397
|
+
ensureComponentFileDependencyLinks(getInstalledConsoleDir(), '@principles/pd-console');
|
|
2398
|
+
}
|
|
2344
2399
|
/**
|
|
2345
2400
|
* PRI-711: materialize node_modules links for the INSTALLED codex-adapter so
|
|
2346
2401
|
* its declared `file:../<component>` dependencies resolve under ESM realpath
|
|
@@ -3805,6 +3860,10 @@ transaction) {
|
|
|
3805
3860
|
if (pdCliSync.globalShim !== null)
|
|
3806
3861
|
globalShimRecord = pdCliSync.globalShim;
|
|
3807
3862
|
await installPdCliDependencies();
|
|
3863
|
+
// G3 §10.5: materialize the sibling links AFTER the dependency stage — every
|
|
3864
|
+
// sibling component is already deployed at this point, and a physical copy
|
|
3865
|
+
// the dependency stage produced is now corrected rather than silently kept.
|
|
3866
|
+
ensurePdCliResolution();
|
|
3808
3867
|
stepIndex++;
|
|
3809
3868
|
if (spinner)
|
|
3810
3869
|
updateProgress(spinner, stepIndex, 'Preparing core library for pd-cli...');
|
|
@@ -3836,6 +3895,10 @@ transaction) {
|
|
|
3836
3895
|
if (spinner)
|
|
3837
3896
|
updateProgress(spinner, stepIndex, 'Validating bundled console dependencies...');
|
|
3838
3897
|
await installConsoleDependencies();
|
|
3898
|
+
// G3 §10.5: same ordering contract as pd-cli — links after the dependency
|
|
3899
|
+
// stage, with every console sibling (plugin / release-manager / core /
|
|
3900
|
+
// host-runtime / install-layout) already deployed.
|
|
3901
|
+
ensureConsoleResolution();
|
|
3839
3902
|
stepIndex++;
|
|
3840
3903
|
// PRI-912 (SPEC-P1′-A): dedup the plugin's bundled @principles/core copy
|
|
3841
3904
|
// into a canonical junction only after EVERY component is deployed, so a
|