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.
Files changed (51) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/ingestion/catch-up.d.ts +1 -1
  3. package/codex-adapter/dist/ingestion/catch-up.js +10 -2
  4. package/codex-adapter/dist/pd-hook.js +6 -2
  5. package/codex-adapter/dist/worker/workspace-worker.js +2 -1
  6. package/core/package.json +1 -1
  7. package/dist/installer.d.ts +20 -6
  8. package/dist/installer.d.ts.map +1 -1
  9. package/dist/installer.js +80 -30
  10. package/dist/installer.js.map +1 -1
  11. package/dist/installers/workbuddy-host-installer.d.ts +36 -0
  12. package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
  13. package/dist/installers/workbuddy-host-installer.js +103 -8
  14. package/dist/installers/workbuddy-host-installer.js.map +1 -1
  15. package/dist/utils/config-file-io.d.ts +10 -2
  16. package/dist/utils/config-file-io.d.ts.map +1 -1
  17. package/dist/utils/config-file-io.js +32 -9
  18. package/dist/utils/config-file-io.js.map +1 -1
  19. package/host-runtime/dist/workbuddy-worker-status.js +4 -1
  20. package/host-runtime/package.json +1 -1
  21. package/package.json +10 -3
  22. package/pd-cli/dist/commands/health-codex-install.d.ts +4 -0
  23. package/pd-cli/dist/commands/health-codex-install.d.ts.map +1 -1
  24. package/pd-cli/dist/commands/health-codex-install.js +2 -2
  25. package/pd-cli/dist/commands/health-codex-install.js.map +1 -1
  26. package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
  27. package/pd-cli/dist/commands/health-codex.js +30 -2
  28. package/pd-cli/dist/commands/health-codex.js.map +1 -1
  29. package/pd-cli/dist/commands/pain-explicit.d.ts.map +1 -1
  30. package/pd-cli/dist/commands/pain-explicit.js +20 -20
  31. package/pd-cli/dist/commands/pain-explicit.js.map +1 -1
  32. package/pd-cli/package.json +1 -1
  33. package/plugin/dist/bundle.js +1 -1
  34. package/plugin/dist/openclaw.plugin.json +1 -1
  35. package/plugin/openclaw.plugin.json +1 -1
  36. package/plugin/package.json +1 -1
  37. package/release-manager/dist/installer.d.ts +20 -6
  38. package/release-manager/dist/installer.d.ts.map +1 -1
  39. package/release-manager/dist/installer.js +80 -30
  40. package/release-manager/dist/installer.js.map +1 -1
  41. package/release-manager/dist/installers/workbuddy-host-installer.d.ts +36 -0
  42. package/release-manager/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
  43. package/release-manager/dist/installers/workbuddy-host-installer.js +103 -8
  44. package/release-manager/dist/installers/workbuddy-host-installer.js.map +1 -1
  45. package/release-manager/dist/utils/config-file-io.d.ts +10 -2
  46. package/release-manager/dist/utils/config-file-io.d.ts.map +1 -1
  47. package/release-manager/dist/utils/config-file-io.js +32 -9
  48. package/release-manager/dist/utils/config-file-io.js.map +1 -1
  49. package/release-manager/package.json +10 -3
  50. package/workbuddy-adapter/dist/pd-hook.js +5 -1
  51. package/workbuddy-adapter/dist/worker/workspace-worker.js +2 -1
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "productVersion": "2.5.0",
4
- "sourceCommit": "74af3071c4f988f8b24a42c5b26c5b7f48feb715"
4
+ "sourceCommit": "1c787bf80015d10ab8cd06bcb949c329f3dce473"
5
5
  }
@@ -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 = "Set features.codex_conversation_ingestion.enabled=true in the selected Workspace .pd/config.yaml to enable bounded conversation ingestion.";
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
- export const CODEX_CATCH_UP_NEXT_ACTION = 'Set features.codex_conversation_ingestion.enabled=true in the selected Workspace .pd/config.yaml to enable bounded conversation ingestion.';
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: 'Set features.host.codex.enabled=true in the selected Workspace to enable PD.' };
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
- return { stdout: {}, exitCode: 0, stderr: [diagnostic('host.codex_disabled', 'Set features.host.codex.enabled=true in the selected Workspace to enable PD.')] };
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', 'Set features.codex_conversation_ingestion.enabled=true in the selected Workspace .pd/config.yaml to enable bounded conversation ingestion.')];
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
- return { ...base, mode: 'paused', reason: 'host.codex_disabled', nextAction: 'Set features.host.codex.enabled=true in the Workspace .pd/config.yaml to enable Codex PD behavior.' };
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.9",
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",
@@ -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 deployed)
261
- * pd-cli so its static @principles/* / principles-disciple imports resolve
262
- * during the pre-deployment compatibility scan. Mirrors the links syncPdCli
263
- * creates for the deployed copy — targets are the sibling component
264
- * directories of the npm package (files whitelist: core/, host-runtime/,
265
- * codex-adapter/, install-layout/, plugin/). Idempotent.
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>;
@@ -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;AAC3E,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,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCjG;AA4BD,wBAAgB,sBAAsB,IAAI,MAAM,CAU/C;AAgCD,wBAAgB,yBAAyB,CAAC,OAAO,E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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 deployed)
1220
- * pd-cli so its static @principles/* / principles-disciple imports resolve
1221
- * during the pre-deployment compatibility scan. Mirrors the links syncPdCli
1222
- * creates for the deployed copy — targets are the sibling component
1223
- * directories of the npm package (files whitelist: core/, host-runtime/,
1224
- * codex-adapter/, install-layout/, plugin/). Idempotent.
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
- // Unix relative targets are computed from EACH link's own directory:
1229
- // @principles/* links sit at <root>/pd-cli/node_modules/@principles/<name>
1230
- // → three levels up to <root>;
1231
- // principles-disciple sits at <root>/pd-cli/node_modules/principles-disciple
1232
- // → two levels up to <root>.
1233
- // (Windows junctions take absolute targets.) A wrong level produces a
1234
- // DANGLING link — existsSync() is false and the second run hits EEXIST.
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
- for (const spec of linkSpecs) {
1243
- if (existsSync(spec.linkPath))
1244
- continue;
1245
- if (!existsSync(spec.windowsTarget))
1246
- continue; // component absent from this package layout — skip
1247
- mkdirSync(path.dirname(spec.linkPath), { recursive: true });
1248
- if (isWindows()) {
1249
- symlinkSync(spec.windowsTarget, spec.linkPath, 'junction');
1250
- }
1251
- else {
1252
- symlinkSync(spec.unixTarget, spec.linkPath, 'dir');
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).