create-principles-disciple 1.145.38 → 1.145.41
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/codex-adapter/dist/ingestion/catch-up.d.ts +1 -1
- package/codex-adapter/dist/ingestion/catch-up.js +10 -2
- package/codex-adapter/dist/pd-hook.js +6 -2
- package/codex-adapter/dist/worker/workspace-worker.js +2 -1
- package/core/package.json +1 -1
- package/dist/installer.d.ts +20 -6
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +80 -30
- package/dist/installer.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts +36 -0
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +103 -8
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/utils/config-file-io.d.ts +10 -2
- package/dist/utils/config-file-io.d.ts.map +1 -1
- package/dist/utils/config-file-io.js +32 -9
- package/dist/utils/config-file-io.js.map +1 -1
- package/host-runtime/dist/workbuddy-worker-status.js +4 -1
- package/host-runtime/package.json +1 -1
- package/package.json +10 -3
- package/pd-cli/dist/commands/health-codex-install.d.ts +4 -0
- package/pd-cli/dist/commands/health-codex-install.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex-install.js +2 -2
- package/pd-cli/dist/commands/health-codex-install.js.map +1 -1
- package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex.js +30 -2
- package/pd-cli/dist/commands/health-codex.js.map +1 -1
- package/pd-cli/dist/commands/pain-explicit.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-explicit.js +20 -20
- package/pd-cli/dist/commands/pain-explicit.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +1 -1
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/installer.d.ts +20 -6
- package/release-manager/dist/installer.d.ts.map +1 -1
- package/release-manager/dist/installer.js +80 -30
- package/release-manager/dist/installer.js.map +1 -1
- package/release-manager/dist/installers/workbuddy-host-installer.d.ts +36 -0
- package/release-manager/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/release-manager/dist/installers/workbuddy-host-installer.js +103 -8
- package/release-manager/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/release-manager/dist/utils/config-file-io.d.ts +10 -2
- package/release-manager/dist/utils/config-file-io.d.ts.map +1 -1
- package/release-manager/dist/utils/config-file-io.js +32 -9
- package/release-manager/dist/utils/config-file-io.js.map +1 -1
- package/release-manager/package.json +10 -3
- package/workbuddy-adapter/dist/pd-hook.js +5 -1
- package/workbuddy-adapter/dist/worker/workspace-worker.js +2 -1
|
@@ -32,7 +32,7 @@ export type CodexCatchUpResult = {
|
|
|
32
32
|
/** Checkpoints not examined this invocation because of the bound (rotation converges them over repeated passes). */
|
|
33
33
|
readonly unexaminedRollouts: readonly string[];
|
|
34
34
|
};
|
|
35
|
-
export declare const CODEX_CATCH_UP_NEXT_ACTION = "
|
|
35
|
+
export declare const CODEX_CATCH_UP_NEXT_ACTION = "Enable bounded conversation ingestion in the selected Workspace .pd/config.yaml \u2014 in the existing \"features:\" block set codex_conversation_ingestion: {enabled: true} (one flat key, not nested).";
|
|
36
36
|
/**
|
|
37
37
|
* Perform one bounded catch-up pass. `remainingLagRollouts` is derived from
|
|
38
38
|
* each processed rollout's reported lag plus the checkpoints left unprocessed
|
|
@@ -22,7 +22,15 @@ import { locateCodexTranscriptByRolloutIdentity } from './transcript-locate.js';
|
|
|
22
22
|
import { ingestCodexTranscriptFromPath } from './ingestion.js';
|
|
23
23
|
import { runGovernanceAdmission } from './admission.js';
|
|
24
24
|
const DEFAULT_MAX_ROLLOUTS = 8;
|
|
25
|
-
|
|
25
|
+
// PRI-1063 (review fix): the hint must survive two hard constraints.
|
|
26
|
+
// 1. It may travel through `diagnostic()` elsewhere, which collapses ALL
|
|
27
|
+
// whitespace (`replace(/\s+/g, ' ')`) — a multi-line YAML block would be
|
|
28
|
+
// flattened into unusable text, so the snippet itself is single-line.
|
|
29
|
+
// 2. A real .pd/config.yaml ALWAYS already has a top-level `features:` key, so
|
|
30
|
+
// pasting a second `features:` block throws "duplicated mapping key". The
|
|
31
|
+
// instruction therefore says "in the existing features: block", and the
|
|
32
|
+
// flow mapping keeps the edited line copy-pasteable.
|
|
33
|
+
export const CODEX_CATCH_UP_NEXT_ACTION = 'Enable bounded conversation ingestion in the selected Workspace .pd/config.yaml — in the existing "features:" block set codex_conversation_ingestion: {enabled: true} (one flat key, not nested).';
|
|
26
34
|
/**
|
|
27
35
|
* Perform one bounded catch-up pass. `remainingLagRollouts` is derived from
|
|
28
36
|
* each processed rollout's reported lag plus the checkpoints left unprocessed
|
|
@@ -38,7 +46,7 @@ export async function catchUpCodexIngestion(options) {
|
|
|
38
46
|
}
|
|
39
47
|
const { flags } = computeFeatureFlagsFromConfig(config.effective);
|
|
40
48
|
if (flags['host.codex']?.enabled !== true) {
|
|
41
|
-
return { status: 'skipped', reason: 'host.codex_disabled', nextAction: '
|
|
49
|
+
return { status: 'skipped', reason: 'host.codex_disabled', nextAction: 'Enable PD in the selected Workspace .pd/config.yaml — in the existing "features:" block set host.codex: {enabled: true} (one flat key, not nested).' };
|
|
42
50
|
}
|
|
43
51
|
if (flags.codex_conversation_ingestion?.enabled !== true) {
|
|
44
52
|
return { status: 'skipped', reason: 'feature_disabled', nextAction: CODEX_CATCH_UP_NEXT_ACTION };
|
|
@@ -244,7 +244,11 @@ export async function processHookInvocation(rawStdin, _env = process.env, cwd =
|
|
|
244
244
|
}
|
|
245
245
|
const { flags } = computeFeatureFlagsFromConfig(config.effective);
|
|
246
246
|
if (flags['host.codex']?.enabled !== true) {
|
|
247
|
-
|
|
247
|
+
// PRI-1063 (review fix): single-line flow mapping. `diagnostic()` below
|
|
248
|
+
// collapses every whitespace run, so a multi-line YAML block would reach
|
|
249
|
+
// the user flattened into garbage; and a second `features:` block would
|
|
250
|
+
// duplicate the key already present in every real config.
|
|
251
|
+
return { stdout: {}, exitCode: 0, stderr: [diagnostic('host.codex_disabled', 'Enable PD in the selected Workspace .pd/config.yaml — in the existing "features:" block set host.codex: {enabled: true} (one flat key, not nested).')] };
|
|
248
252
|
}
|
|
249
253
|
const ingestionEnabled = flags.codex_conversation_ingestion?.enabled === true;
|
|
250
254
|
if (event.kind === 'turn_complete') {
|
|
@@ -269,7 +273,7 @@ export async function processHookInvocation(rawStdin, _env = process.env, cwd =
|
|
|
269
273
|
// would be per-event noise).
|
|
270
274
|
const stderr = ingestionEnabled
|
|
271
275
|
? [...clearDiagnostics, ...await runConversationIngestion({ rawPayload: parsed, kind: event.kind, workspaceDir: resolution.workspaceDir, env: _env })]
|
|
272
|
-
: [...clearDiagnostics, diagnostic('feature_disabled', '
|
|
276
|
+
: [...clearDiagnostics, diagnostic('feature_disabled', 'Enable bounded conversation ingestion in the selected Workspace .pd/config.yaml — in the existing "features:" block set codex_conversation_ingestion: {enabled: true} (one flat key, not nested).')];
|
|
273
277
|
return { stdout: {}, exitCode: 0, stderr };
|
|
274
278
|
}
|
|
275
279
|
try {
|
|
@@ -176,7 +176,8 @@ export async function runCodexWorkspaceWorkerCycle(options) {
|
|
|
176
176
|
}
|
|
177
177
|
const { flags } = computeFeatureFlagsFromConfig(config.effective);
|
|
178
178
|
if (flags['host.codex']?.enabled !== true) {
|
|
179
|
-
|
|
179
|
+
// PRI-1063 (review fix): single-line flow mapping — see catch-up.ts.
|
|
180
|
+
return { ...base, mode: 'paused', reason: 'host.codex_disabled', nextAction: 'Enable Codex PD behavior in the Workspace .pd/config.yaml — in the existing "features:" block set host.codex: {enabled: true} (one flat key, not nested).' };
|
|
180
181
|
}
|
|
181
182
|
// CR-08: liveness bookkeeping starts only after the workspace proved
|
|
182
183
|
// eligible — writing into a missing workspace directory would fabricate it.
|
package/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/core",
|
|
3
|
-
"version": "1.297.
|
|
3
|
+
"version": "1.297.10",
|
|
4
4
|
"description": "Pure-logic core of Principles Disciple, an AI Agent Governance System - pain signal capture and principle proposal (no I/O)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/dist/installer.d.ts
CHANGED
|
@@ -257,12 +257,26 @@ export type LegacyRulePreflightRunner = (pdCliEntry: string, workspaceDir: strin
|
|
|
257
257
|
*/
|
|
258
258
|
export declare function parseCompatibilityScanStdout(stdout: unknown): LegacyRulePreflightOutcome;
|
|
259
259
|
/**
|
|
260
|
-
* PRI-693: materialize node_modules links for the BUNDLED (not yet
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
260
|
+
* PRI-693 / PRI-1060: materialize node_modules links for the BUNDLED (not yet
|
|
261
|
+
* deployed) components so the pre-deployment compatibility scan can execute
|
|
262
|
+
* the bundled pd-cli. Mirrors the links syncPdCli creates for the deployed
|
|
263
|
+
* copy — targets are the sibling component directories of the npm package
|
|
264
|
+
* (files whitelist: core/, host-runtime/, codex-adapter/, workbuddy-adapter/,
|
|
265
|
+
* install-layout/, plugin/). Idempotent.
|
|
266
|
+
*
|
|
267
|
+
* Links are materialized at BOTH levels:
|
|
268
|
+
*
|
|
269
|
+
* 1. <root>/pd-cli/node_modules/* — pd-cli's OWN first-hop imports.
|
|
270
|
+
* 2. <root>/node_modules/* — every OTHER bundled component's `file:../`
|
|
271
|
+
* sibling dependencies. Node resolves a component reached through a
|
|
272
|
+
* junction by its REAL path, so host-runtime/dist/index.js importing
|
|
273
|
+
* '@principles/core' never sees pd-cli's node_modules — it only resolves
|
|
274
|
+
* via the package root's node_modules (PRI-1060: this exact gap crashed
|
|
275
|
+
* the scan with ERR_MODULE_NOT_FOUND on every registry install). The
|
|
276
|
+
* third-party dependencies of the bundled graph (@sinclair/typebox,
|
|
277
|
+
* better-sqlite3, …) are declared as top-level installer dependencies so
|
|
278
|
+
* the surrounding npx/npm install places them one node_modules above the
|
|
279
|
+
* package, reachable by the same upward resolution.
|
|
266
280
|
*/
|
|
267
281
|
export declare function ensureBundledPdCliResolution(pdCliRoot: string): void;
|
|
268
282
|
export declare function runLegacyRuleContractPreflight(pluginDir: string, workspaceDir: string, runScan?: LegacyRulePreflightRunner): Promise<LegacyRulePreflightOutcome>;
|
package/dist/installer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAaA,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;
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAaA,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;AAGnF,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoBtF,OAAO,EAKL,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,CAA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nE;AAqDD,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,wBAAwB,GAAG,gBAAgB,CAYzH;AAED;;;;GAIG;AAEH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,EAAE,EAAE,gBAAgB,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CAqBN;AAED,oFAAoF;AAEpF,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,EAAE,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,CA4yBxB"}
|
package/dist/installer.js
CHANGED
|
@@ -13,6 +13,7 @@ import { checkOpenClawGateway, stopOpenClawGateway, restartOpenClawGateway } fro
|
|
|
13
13
|
import { t } from './i18n.js';
|
|
14
14
|
import { generateConfigYamlContent, ExistingConfigVerifyInfraError, validateExistingConfigYamlForPreserve, getConfigYamlPath, readEnabledChannelsFromConfigYaml, getOpenClawDir, getPdDir, getPdRuntimeDir, getInstallManifestPath, getPdRuntimeBackupsDir, getPluginExtDir, getInstalledPluginDir, getInstalledLayoutPackageDir, getPdBackupsDir, getInstalledPdCliDir, getInstalledBinDir, getInstalledConsoleDir, getHomeDir, isWindows, } from './mvp-config.js';
|
|
15
15
|
import { getHostInstallers } from './installers/index.js';
|
|
16
|
+
import { runWorkbuddyEarlyPreflight } from './installers/workbuddy-host-installer.js';
|
|
16
17
|
import { INSTALL_LAYOUT_VERSION, getWorkbuddyWorkspaceDir, installManifestHostsForPersist, mergeInstallManifestWorkspaces, parseInstallManifest } from '@principles/install-layout';
|
|
17
18
|
import { detectOpenClawMainWorkspaceDivergence } from './utils/workspace-divergence.js';
|
|
18
19
|
import { applySkillLanguageSelection } from './skill-language.js';
|
|
@@ -122,6 +123,9 @@ let activeHostTarget = 'openclaw';
|
|
|
122
123
|
function installsOpenClaw(host) {
|
|
123
124
|
return host === 'openclaw' || host === 'all';
|
|
124
125
|
}
|
|
126
|
+
function installsWorkbuddy(host) {
|
|
127
|
+
return host === 'workbuddy' || host === 'all';
|
|
128
|
+
}
|
|
125
129
|
function installedPluginDir() {
|
|
126
130
|
return getInstalledPluginDir();
|
|
127
131
|
}
|
|
@@ -1216,40 +1220,65 @@ export function parseCompatibilityScanStdout(stdout) {
|
|
|
1216
1220
|
return protocolInvalid(`ok is not a boolean`);
|
|
1217
1221
|
}
|
|
1218
1222
|
/**
|
|
1219
|
-
* PRI-693: materialize node_modules links for the BUNDLED (not yet
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1223
|
+
* PRI-693 / PRI-1060: materialize node_modules links for the BUNDLED (not yet
|
|
1224
|
+
* deployed) components so the pre-deployment compatibility scan can execute
|
|
1225
|
+
* the bundled pd-cli. Mirrors the links syncPdCli creates for the deployed
|
|
1226
|
+
* copy — targets are the sibling component directories of the npm package
|
|
1227
|
+
* (files whitelist: core/, host-runtime/, codex-adapter/, workbuddy-adapter/,
|
|
1228
|
+
* install-layout/, plugin/). Idempotent.
|
|
1229
|
+
*
|
|
1230
|
+
* Links are materialized at BOTH levels:
|
|
1231
|
+
*
|
|
1232
|
+
* 1. <root>/pd-cli/node_modules/* — pd-cli's OWN first-hop imports.
|
|
1233
|
+
* 2. <root>/node_modules/* — every OTHER bundled component's `file:../`
|
|
1234
|
+
* sibling dependencies. Node resolves a component reached through a
|
|
1235
|
+
* junction by its REAL path, so host-runtime/dist/index.js importing
|
|
1236
|
+
* '@principles/core' never sees pd-cli's node_modules — it only resolves
|
|
1237
|
+
* via the package root's node_modules (PRI-1060: this exact gap crashed
|
|
1238
|
+
* the scan with ERR_MODULE_NOT_FOUND on every registry install). The
|
|
1239
|
+
* third-party dependencies of the bundled graph (@sinclair/typebox,
|
|
1240
|
+
* better-sqlite3, …) are declared as top-level installer dependencies so
|
|
1241
|
+
* the surrounding npx/npm install places them one node_modules above the
|
|
1242
|
+
* package, reachable by the same upward resolution.
|
|
1225
1243
|
*/
|
|
1226
1244
|
export function ensureBundledPdCliResolution(pdCliRoot) {
|
|
1227
1245
|
const packageRoot = path.resolve(pdCliRoot, '..');
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
const linkSpecs = [
|
|
1236
|
-
{ linkPath: path.join(pdCliRoot, 'node_modules', '@principles', 'core'), windowsTarget: path.join(packageRoot, 'core'), unixTarget: '../../../core' },
|
|
1237
|
-
{ linkPath: path.join(pdCliRoot, 'node_modules', '@principles', 'host-runtime'), windowsTarget: path.join(packageRoot, 'host-runtime'), unixTarget: '../../../host-runtime' },
|
|
1238
|
-
{ linkPath: path.join(pdCliRoot, 'node_modules', '@principles', 'codex-adapter'), windowsTarget: path.join(packageRoot, 'codex-adapter'), unixTarget: '../../../codex-adapter' },
|
|
1239
|
-
{ linkPath: path.join(pdCliRoot, 'node_modules', '@principles', 'install-layout'), windowsTarget: path.join(packageRoot, 'install-layout'), unixTarget: '../../../install-layout' },
|
|
1240
|
-
{ linkPath: path.join(pdCliRoot, 'node_modules', 'principles-disciple'), windowsTarget: path.join(packageRoot, 'plugin'), unixTarget: '../../plugin' },
|
|
1246
|
+
const componentLinks = [
|
|
1247
|
+
{ linkName: path.join('@principles', 'core'), componentDir: 'core' },
|
|
1248
|
+
{ linkName: path.join('@principles', 'host-runtime'), componentDir: 'host-runtime' },
|
|
1249
|
+
{ linkName: path.join('@principles', 'codex-adapter'), componentDir: 'codex-adapter' },
|
|
1250
|
+
{ linkName: path.join('@principles', 'workbuddy-adapter'), componentDir: 'workbuddy-adapter' },
|
|
1251
|
+
{ linkName: path.join('@principles', 'install-layout'), componentDir: 'install-layout' },
|
|
1252
|
+
{ linkName: 'principles-disciple', componentDir: 'plugin' },
|
|
1241
1253
|
];
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1254
|
+
// Unix relative targets are computed from EACH link's own directory — a
|
|
1255
|
+
// wrong level produces a DANGLING link (existsSync() false, second run hits
|
|
1256
|
+
// EEXIST). Windows junctions take absolute targets and ignore the depth.
|
|
1257
|
+
const linkBases = [
|
|
1258
|
+
// <root>/pd-cli/node_modules/@principles/<name> → three levels up to
|
|
1259
|
+
// <root>; <root>/pd-cli/node_modules/principles-disciple → two levels.
|
|
1260
|
+
{ nodeModulesDir: path.join(pdCliRoot, 'node_modules'), depth: 3 },
|
|
1261
|
+
// <root>/node_modules/@principles/<name> → two levels up; principles-
|
|
1262
|
+
// disciple → one level.
|
|
1263
|
+
{ nodeModulesDir: path.join(packageRoot, 'node_modules'), depth: 2 },
|
|
1264
|
+
];
|
|
1265
|
+
for (const base of linkBases) {
|
|
1266
|
+
for (const spec of componentLinks) {
|
|
1267
|
+
const linkPath = path.join(base.nodeModulesDir, spec.linkName);
|
|
1268
|
+
if (existsSync(linkPath))
|
|
1269
|
+
continue;
|
|
1270
|
+
const windowsTarget = path.join(packageRoot, spec.componentDir);
|
|
1271
|
+
if (!existsSync(windowsTarget))
|
|
1272
|
+
continue; // component absent from this package layout — skip
|
|
1273
|
+
const depthUp = spec.linkName.includes(path.sep) ? base.depth : base.depth - 1;
|
|
1274
|
+
const unixTarget = `${'../'.repeat(depthUp)}${spec.componentDir}`;
|
|
1275
|
+
mkdirSync(path.dirname(linkPath), { recursive: true });
|
|
1276
|
+
if (isWindows()) {
|
|
1277
|
+
symlinkSync(windowsTarget, linkPath, 'junction');
|
|
1278
|
+
}
|
|
1279
|
+
else {
|
|
1280
|
+
symlinkSync(unixTarget, linkPath, 'dir');
|
|
1281
|
+
}
|
|
1253
1282
|
}
|
|
1254
1283
|
}
|
|
1255
1284
|
}
|
|
@@ -3231,6 +3260,27 @@ transaction) {
|
|
|
3231
3260
|
};
|
|
3232
3261
|
}
|
|
3233
3262
|
}
|
|
3263
|
+
// PRI-1062: WorkBuddy hard preflights run BEFORE any side effect — including
|
|
3264
|
+
// the gateway stop below. A running WorkBuddy holds settings.json with
|
|
3265
|
+
// exclusive sharing (the commit-stage rename fails with EPERM after minutes
|
|
3266
|
+
// of npm work) and hooks never launch without Git Bash. Both are knowable up
|
|
3267
|
+
// front; failing here costs one bash probe + two file opens instead of a
|
|
3268
|
+
// full install + rollback.
|
|
3269
|
+
//
|
|
3270
|
+
// Ordering is load-bearing: this must precede the gateway pre-flight. On
|
|
3271
|
+
// `--host all` the gateway block below may STOP the Owner's OpenClaw
|
|
3272
|
+
// gateway, and a refusal that returns from here would leave it stopped —
|
|
3273
|
+
// `restartedGateway` is only honoured at the end of the install flow.
|
|
3274
|
+
if (installsWorkbuddy(options.host)) {
|
|
3275
|
+
const workbuddyPreflight = runWorkbuddyEarlyPreflight();
|
|
3276
|
+
if (!workbuddyPreflight.ok) {
|
|
3277
|
+
logger.error(workbuddyPreflight.reason);
|
|
3278
|
+
return buildGatewayRefusalResult(options, {
|
|
3279
|
+
reason: `workbuddy_preflight_failed: ${workbuddyPreflight.reason}`,
|
|
3280
|
+
nextAction: workbuddyPreflight.nextAction,
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3234
3284
|
// Gateway lock pre-flight: a running gateway holds native-module file handles
|
|
3235
3285
|
// that make the backup rename fail with EPERM. Decide stop/abort/proceed
|
|
3236
3286
|
// BEFORE mutating anything (cli-5: abort/stop-failed paths must not mutate).
|