create-principles-disciple 1.153.2 → 1.153.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/codex-adapter/dist/worker/workspace-worker.js +5 -1
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/index.js +8 -1
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.d.ts +9 -1
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +19 -1
- package/console/dist/server/models/IntentPageModel.d.ts +37 -1
- package/console/dist/server/models/IntentPageModel.js +53 -1
- package/console/dist/server/routes/update-history.d.ts +32 -0
- package/console/dist/server/routes/update-history.js +215 -1
- package/console/dist/web/assets/app.css +106 -0
- package/console/dist/web/assets/app.js +118 -32
- package/console/dist/web/assets/intent-reflection.webp +3 -0
- package/core/dist/runtime/config/index.d.ts +1 -1
- package/core/dist/runtime/config/index.d.ts.map +1 -1
- package/core/dist/runtime/config/index.js +1 -1
- package/core/dist/runtime/config/index.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +4 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/index.d.ts +3 -3
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +2 -2
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/intent/intent-browser.d.ts +2 -2
- package/core/dist/runtime/intent/intent-browser.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-browser.js +5 -1
- package/core/dist/runtime/intent/intent-browser.js.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +58 -11
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +11 -2
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +24 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +59 -5
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts +7 -0
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +62 -14
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +44 -8
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/prompts.d.ts +6 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +17 -7
- package/dist/prompts.js.map +1 -1
- package/dist/utils/env.d.ts +19 -2
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +55 -14
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/host-workspace-ownership.d.ts +25 -0
- package/dist/utils/host-workspace-ownership.d.ts.map +1 -0
- package/dist/utils/host-workspace-ownership.js +69 -0
- package/dist/utils/host-workspace-ownership.js.map +1 -0
- package/host-runtime/dist/diagnostician-auto-run.js +6 -0
- package/host-runtime/dist/governance-signal-admission.js +7 -0
- package/host-runtime/dist/index.d.ts +1 -0
- package/host-runtime/dist/index.js +4 -0
- package/host-runtime/dist/intent-doc-reader.d.ts +70 -0
- package/host-runtime/dist/intent-doc-reader.js +292 -0
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/index.d.ts +24 -1
- package/install-layout/dist/index.js +58 -1
- package/install-layout/dist/mcp-binding-contract.d.ts +27 -0
- package/install-layout/dist/mcp-binding-contract.js +62 -0
- package/install-layout/package.json +1 -1
- package/package.json +3 -3
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +7 -1
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/health-mcp.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-mcp.js +20 -2
- package/pd-cli/dist/commands/health-mcp.js.map +1 -1
- package/pd-cli/dist/commands/mcp-probe.d.ts +11 -0
- package/pd-cli/dist/commands/mcp-probe.d.ts.map +1 -1
- package/pd-cli/dist/commands/mcp-probe.js +24 -2
- package/pd-cli/dist/commands/mcp-probe.js.map +1 -1
- package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-record.js +6 -0
- package/pd-cli/dist/commands/pain-record.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +8 -1
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +473 -473
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/mcp/launcher.cjs +132 -5
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/installer.js +59 -5
- package/release-manager/dist/installers/codex-host-installer.js +62 -14
- package/release-manager/dist/installers/workbuddy-host-installer.js +44 -8
- package/release-manager/dist/utils/env.js +55 -14
- package/release-manager/dist/utils/host-workspace-ownership.js +69 -0
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/dist/worker/workspace-worker.js +5 -1
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/mcp/launcher.cjs +132 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "4.1.
|
|
5
|
+
"version": "4.1.8",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/plugin/mcp/launcher.cjs
CHANGED
|
@@ -84,6 +84,7 @@ const INITIAL_ENV_PRESENCE = Object.freeze({
|
|
|
84
84
|
const logState = {
|
|
85
85
|
host: 'unknown',
|
|
86
86
|
bindingPathExists: false,
|
|
87
|
+
bindingSource: 'not_checked',
|
|
87
88
|
workspaceResolution: 'not_checked',
|
|
88
89
|
seq: 0,
|
|
89
90
|
runId: null,
|
|
@@ -354,6 +355,86 @@ function isInside(parent, child) {
|
|
|
354
355
|
return relative !== '' && relative !== '..' && !relative.startsWith('..' + path.sep) && !path.isAbsolute(relative);
|
|
355
356
|
}
|
|
356
357
|
|
|
358
|
+
// PRI-1247: a binding must never point one host at ANOTHER host's owned default
|
|
359
|
+
// governance workspace (the Codex installer used to inherit the OpenClaw
|
|
360
|
+
// detection result). This mirrors `findForeignWorkspaceHost` in
|
|
361
|
+
// @principles/install-layout; the parity test pins both sides together.
|
|
362
|
+
function hostOwnedWorkspaces(bindingHost, homeDir, codexHome) {
|
|
363
|
+
switch (bindingHost) {
|
|
364
|
+
case 'openclaw':
|
|
365
|
+
return [path.join(homeDir, 'clawd'), path.join(homeDir, '.openclaw', 'workspace')];
|
|
366
|
+
case 'codex':
|
|
367
|
+
return [path.join(codexHome, 'pd-workspace')];
|
|
368
|
+
case 'workbuddy':
|
|
369
|
+
return [path.join(homeDir, '.workbuddy', 'pd-workspace')];
|
|
370
|
+
default:
|
|
371
|
+
return [];
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function findForeignWorkspaceOwner(bindingHost, workspaceDir, homeDir, codexHome) {
|
|
376
|
+
const normalize = (value) => {
|
|
377
|
+
const resolved = path.resolve(value);
|
|
378
|
+
return process.platform === 'win32' ? resolved.toLowerCase() : resolved;
|
|
379
|
+
};
|
|
380
|
+
const target = normalize(workspaceDir);
|
|
381
|
+
for (const other of KNOWN_HOSTS) {
|
|
382
|
+
if (other === bindingHost) continue;
|
|
383
|
+
for (const owned of hostOwnedWorkspaces(other, homeDir, codexHome)) {
|
|
384
|
+
if (isInsideOrSame(normalize(owned), target)) return other;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Derive the Codex home from this launcher's own payload path:
|
|
392
|
+
* `<codexHome>/plugins/cache/<marketplace>/principles-disciple/<version>`.
|
|
393
|
+
* Returns null for any other layout (tests, OpenClaw/WorkBuddy payloads), so
|
|
394
|
+
* the persistent-binding lookup is inert where it does not apply.
|
|
395
|
+
*/
|
|
396
|
+
function deriveCodexHomeFromPayload(root) {
|
|
397
|
+
const pluginDir = path.dirname(root);
|
|
398
|
+
const marketplaceDir = path.dirname(pluginDir);
|
|
399
|
+
const cacheDir = path.dirname(marketplaceDir);
|
|
400
|
+
const pluginsDir = path.dirname(cacheDir);
|
|
401
|
+
if (path.basename(pluginDir) !== 'principles-disciple') return null;
|
|
402
|
+
if (path.basename(cacheDir) !== 'cache' || path.basename(pluginsDir) !== 'plugins') return null;
|
|
403
|
+
const home = path.dirname(pluginsDir);
|
|
404
|
+
return path.isAbsolute(home) ? home : null;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* PRI-1248: host-persistent binding candidates, in authority order. A Codex
|
|
409
|
+
* cache refresh deletes anything inside the versioned payload, so the copy in
|
|
410
|
+
* PLUGIN_DATA must be authoritative; the payload-local file stays as the
|
|
411
|
+
* legacy fallback for bindings written before this change.
|
|
412
|
+
*/
|
|
413
|
+
function codexPersistentBindingCandidates(root) {
|
|
414
|
+
const candidates = [];
|
|
415
|
+
const pluginData = typeof process.env.PLUGIN_DATA === 'string' ? process.env.PLUGIN_DATA.trim() : '';
|
|
416
|
+
if (pluginData.length > 0 && path.isAbsolute(pluginData)) {
|
|
417
|
+
candidates.push(path.join(path.resolve(pluginData), 'mcp-binding.json'));
|
|
418
|
+
}
|
|
419
|
+
const codexHome = deriveCodexHomeFromPayload(root);
|
|
420
|
+
if (codexHome !== null) {
|
|
421
|
+
const marketplace = path.basename(path.dirname(path.dirname(root)));
|
|
422
|
+
const dataRoot = path.join(codexHome, 'plugins', 'data');
|
|
423
|
+
let matches = [];
|
|
424
|
+
try {
|
|
425
|
+
matches = fs.readdirSync(dataRoot).filter((name) => name.startsWith('principles-disciple-'));
|
|
426
|
+
} catch {
|
|
427
|
+
// First run before PLUGIN_DATA exists: fall through to the canonical name.
|
|
428
|
+
}
|
|
429
|
+
if (matches.length === 1) {
|
|
430
|
+
candidates.push(path.join(dataRoot, matches[0], 'mcp-binding.json'));
|
|
431
|
+
} else if (/^[A-Za-z0-9._-]+$/.test(marketplace)) {
|
|
432
|
+
candidates.push(path.join(dataRoot, `principles-disciple-${marketplace}`, 'mcp-binding.json'));
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return [...new Set(candidates)];
|
|
436
|
+
}
|
|
437
|
+
|
|
357
438
|
const PD_CONFIG_FILENAME = 'principles-disciple.json';
|
|
358
439
|
|
|
359
440
|
/** A declared workspace must be one fixed, real directory — never HOME or a drive root. */
|
|
@@ -448,11 +529,35 @@ logState.host = host;
|
|
|
448
529
|
|
|
449
530
|
// rc-1/rc-3/rc-5: the binding file is read as untrusted; every field is
|
|
450
531
|
// validated before use and unknown content is never coerced.
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
532
|
+
// PRI-1248: a Codex payload directory is replaceable, so the host-persistent
|
|
533
|
+
// copy in PLUGIN_DATA is authoritative; the payload-local file remains the
|
|
534
|
+
// legacy fallback for bindings written before the durable location existed.
|
|
535
|
+
const legacyBindingPath = path.join(pluginRoot, 'mcp-binding.json');
|
|
536
|
+
const bindingCandidates = host === 'codex'
|
|
537
|
+
? [...codexPersistentBindingCandidates(pluginRoot), legacyBindingPath]
|
|
538
|
+
: [legacyBindingPath];
|
|
539
|
+
let bindingPath = null;
|
|
540
|
+
for (const candidate of bindingCandidates) {
|
|
541
|
+
try {
|
|
542
|
+
if (fs.statSync(candidate).isFile()) {
|
|
543
|
+
bindingPath = candidate;
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
} catch {
|
|
547
|
+
// Absent candidate — try the next location.
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
logState.bindingPathExists = bindingPath !== null;
|
|
551
|
+
logState.bindingSource = bindingPath === null
|
|
552
|
+
? 'missing'
|
|
553
|
+
: (bindingPath === legacyBindingPath ? 'payload' : 'persistent');
|
|
554
|
+
if (bindingPath === null) {
|
|
555
|
+
fail(
|
|
556
|
+
'binding_missing',
|
|
557
|
+
host === 'codex'
|
|
558
|
+
? `Re-run the PD host setup (Codex: $pd-control setup) so mcp-binding.json is written for this host (checked ${bindingCandidates.join(' and ')}).`
|
|
559
|
+
: 'Re-run the PD host setup (Codex: $pd-control setup) so mcp-binding.json is written into the plugin directory.',
|
|
560
|
+
);
|
|
456
561
|
}
|
|
457
562
|
let raw;
|
|
458
563
|
try {
|
|
@@ -568,6 +673,27 @@ if (!workspaceStat.isDirectory()) {
|
|
|
568
673
|
}
|
|
569
674
|
logState.workspaceResolution = 'ok';
|
|
570
675
|
|
|
676
|
+
// PRI-1247: "exists and is a directory" is not ownership. A binding left by
|
|
677
|
+
// the old OpenClaw-oriented detection points Codex at OpenClaw's governance
|
|
678
|
+
// tree, so pain evidence would land in the wrong database. Refuse that before
|
|
679
|
+
// any MCP traffic; the OpenClaw declaration gate below is unchanged.
|
|
680
|
+
// The payload-derived Codex home is only meaningful when THIS payload is a
|
|
681
|
+
// Codex payload: WorkBuddy/OpenClaw caches share the same
|
|
682
|
+
// `<root>/plugins/cache/<marketplace>/principles-disciple/<version>` shape, and
|
|
683
|
+
// deriving from them would invent a Codex workspace inside the host's own tree.
|
|
684
|
+
const ownershipHome = os.homedir();
|
|
685
|
+
const ownershipCodexHome = (host === 'codex' ? deriveCodexHomeFromPayload(pluginRoot) : null)
|
|
686
|
+
?? (typeof process.env.CODEX_HOME === 'string' && path.isAbsolute(process.env.CODEX_HOME)
|
|
687
|
+
? path.resolve(process.env.CODEX_HOME)
|
|
688
|
+
: path.join(ownershipHome, '.codex'));
|
|
689
|
+
const foreignWorkspaceHost = findForeignWorkspaceOwner(host, binding.workspaceDir, ownershipHome, ownershipCodexHome);
|
|
690
|
+
if (foreignWorkspaceHost !== null) {
|
|
691
|
+
fail(
|
|
692
|
+
`binding_workspace_foreign_host:${foreignWorkspaceHost}`,
|
|
693
|
+
`mcp-binding.json binds ${foreignWorkspaceHost}'s default governance workspace. Re-run the PD host setup for ${host} with ITS OWN workspace (or an explicit supported --workspace), so pain evidence is not written into another host's database.`,
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
|
|
571
697
|
// P0 (2026-11-13): an experiment must never bind a workspace outside its own
|
|
572
698
|
// root. The binding is untrusted input written by another process generation;
|
|
573
699
|
// a stale one (or one produced from an inherited production pointer) keeps the
|
|
@@ -622,6 +748,7 @@ writeLogEvent('info', 'launcher_start', {
|
|
|
622
748
|
launcherVersion: LAUNCHER_VERSION,
|
|
623
749
|
mcpServerVersion: packageManifest.version,
|
|
624
750
|
bindingPathExists: logState.bindingPathExists,
|
|
751
|
+
bindingSource: logState.bindingSource,
|
|
625
752
|
workspaceResolution: logState.workspaceResolution,
|
|
626
753
|
envPresence: INITIAL_ENV_PRESENCE,
|
|
627
754
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "4.1.
|
|
5
|
+
"version": "4.1.8",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/plugin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,7 +9,7 @@ import { execFileSync, spawn } from 'child_process';
|
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import { select } from '@inquirer/prompts';
|
|
11
11
|
import { logger } from './utils/logger.js';
|
|
12
|
-
import { checkOpenClawGateway, stopOpenClawGateway, restartOpenClawGateway } from './utils/env.js';
|
|
12
|
+
import { checkOpenClawGateway, detectWorkspace, stopOpenClawGateway, restartOpenClawGateway } from './utils/env.js';
|
|
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 { detectInstalledHosts, evaluateRecordedHostPresence, getHostInstallers, isRecordedHost } from './installers/index.js';
|
|
@@ -3790,6 +3790,20 @@ export async function ensureOpenClawWorkspaceDeclaration(workspaceDir, channels)
|
|
|
3790
3790
|
await fse.writeJson(inspection.configPath, config, { spaces: 2 });
|
|
3791
3791
|
return { configPath: inspection.configPath, action: 'created' };
|
|
3792
3792
|
}
|
|
3793
|
+
/**
|
|
3794
|
+
* Collect every non-empty `warnings` array from the hosts this run touched —
|
|
3795
|
+
* the requested host AND the sibling refresh results. The refresh set matters:
|
|
3796
|
+
* it is exactly the path that used to leave WorkBuddy silently un-rebound.
|
|
3797
|
+
*/
|
|
3798
|
+
export function collectHostWarnings(results) {
|
|
3799
|
+
const records = [];
|
|
3800
|
+
for (const result of results) {
|
|
3801
|
+
const warnings = (result.warnings ?? []).filter((warning) => warning.trim().length > 0);
|
|
3802
|
+
if (warnings.length > 0)
|
|
3803
|
+
records.push({ hostId: result.hostId, warnings });
|
|
3804
|
+
}
|
|
3805
|
+
return records;
|
|
3806
|
+
}
|
|
3793
3807
|
/**
|
|
3794
3808
|
* Marketplace contract (2026-11-07): partition host installer results into
|
|
3795
3809
|
* REAL failures and pending MANUAL actions (e.g. the Codex Marketplace
|
|
@@ -3860,12 +3874,28 @@ export function summarizeTouchedHosts(results, deps = {}) {
|
|
|
3860
3874
|
* is missing, OpenClaw install still succeeds). Each result includes a
|
|
3861
3875
|
* structured reason + nextAction.
|
|
3862
3876
|
*/
|
|
3863
|
-
|
|
3877
|
+
/**
|
|
3878
|
+
* PRI-1247: the Codex host must never inherit the OpenClaw-oriented workspace
|
|
3879
|
+
* when the operator did not explicitly choose one. Under `--host all` the
|
|
3880
|
+
* shared context carries the OpenClaw workspace, so Codex resolves its OWN
|
|
3881
|
+
* default here (an explicit --workspace still wins for every host).
|
|
3882
|
+
*/
|
|
3883
|
+
function resolveCodexHostWorkspace(options) {
|
|
3884
|
+
if (options.workspaceExplicit === true)
|
|
3885
|
+
return path.resolve(options.workspaceDir);
|
|
3886
|
+
if (options.host !== 'all')
|
|
3887
|
+
return path.resolve(options.workspaceDir);
|
|
3888
|
+
return detectWorkspace({ host: 'codex' }).detectedPath;
|
|
3889
|
+
}
|
|
3890
|
+
async function runHostInstallers(host, ctx, overrides = {}) {
|
|
3864
3891
|
const installers = getHostInstallers(host);
|
|
3865
3892
|
const results = [];
|
|
3866
3893
|
for (const installer of installers) {
|
|
3867
3894
|
try {
|
|
3868
|
-
const
|
|
3895
|
+
const installerCtx = installer.hostId === 'codex' && overrides.codexWorkspaceDir !== undefined
|
|
3896
|
+
? { ...ctx, workspaceDir: overrides.codexWorkspaceDir }
|
|
3897
|
+
: ctx;
|
|
3898
|
+
const result = await installer.install(installerCtx);
|
|
3869
3899
|
results.push(result);
|
|
3870
3900
|
}
|
|
3871
3901
|
catch (err) {
|
|
@@ -4610,7 +4640,14 @@ transaction) {
|
|
|
4610
4640
|
}
|
|
4611
4641
|
: undefined,
|
|
4612
4642
|
};
|
|
4613
|
-
|
|
4643
|
+
// The Codex binding needs its workspace to exist (the launcher refuses a
|
|
4644
|
+
// binding_workspace_missing). Under `--host all` this is the host's own
|
|
4645
|
+
// default, distinct from the shared OpenClaw workspace (PRI-1247).
|
|
4646
|
+
const codexWorkspaceDir = resolveCodexHostWorkspace(options);
|
|
4647
|
+
if (options.host === 'all' && options.workspaceExplicit !== true) {
|
|
4648
|
+
await fse.ensureDir(codexWorkspaceDir);
|
|
4649
|
+
}
|
|
4650
|
+
const hostResults = await runHostInstallers(options.host, hostInstallCtx, { codexWorkspaceDir });
|
|
4614
4651
|
// Report host install results (rc-9: surface failures, don't silently swallow).
|
|
4615
4652
|
// rc-9 propagation: if ANY host installer FAILED, the aggregate install
|
|
4616
4653
|
// result is NOT successful — callers (CLI, tests) must see the failure.
|
|
@@ -4631,6 +4668,13 @@ transaction) {
|
|
|
4631
4668
|
for (const msg of hostFailureMessages) {
|
|
4632
4669
|
logger.warn(msg);
|
|
4633
4670
|
}
|
|
4671
|
+
// PRI-1249: a host that installed but had to work around something the
|
|
4672
|
+
// Owner should know (e.g. an unverifiable same-name MCP entry PD refused
|
|
4673
|
+
// to touch) must not be silent — the workaround is reported, never hidden.
|
|
4674
|
+
for (const hr of hostResults) {
|
|
4675
|
+
for (const warning of hr.warnings ?? [])
|
|
4676
|
+
logger.warn(`Host "${hr.hostId}": ${warning}`);
|
|
4677
|
+
}
|
|
4634
4678
|
for (const hr of hostResults) {
|
|
4635
4679
|
if (hr.success && hr.configAction === 'skipped') {
|
|
4636
4680
|
logger.info(`Host "${hr.hostId}" install: ${hr.reason ?? 'skipped'}. Next: ${hr.nextAction}`);
|
|
@@ -4650,11 +4694,16 @@ transaction) {
|
|
|
4650
4694
|
for (const refreshTarget of refreshTargets) {
|
|
4651
4695
|
if (spinner)
|
|
4652
4696
|
updateProgress(spinner, stepIndex, `Refreshing ${refreshTarget} host binding...`);
|
|
4653
|
-
const refreshResults = await runHostInstallers(refreshTarget, hostInstallCtx);
|
|
4697
|
+
const refreshResults = await runHostInstallers(refreshTarget, hostInstallCtx, { codexWorkspaceDir });
|
|
4654
4698
|
refreshedResults.push(...refreshResults);
|
|
4655
4699
|
for (const hr of refreshResults) {
|
|
4656
4700
|
if (hr.success) {
|
|
4657
4701
|
logger.info(`Host "${hr.hostId}" refresh: ${hr.configAction === 'updated' ? 'updated' : 'no change needed'}${hr.reason ? ` — ${hr.reason}` : ''}.`);
|
|
4702
|
+
// PRI-1249: the sibling refresh is exactly the path that silently
|
|
4703
|
+
// skipped WorkBuddy's re-bind before this fix — its warnings must be
|
|
4704
|
+
// as visible as a first install's.
|
|
4705
|
+
for (const warning of hr.warnings ?? [])
|
|
4706
|
+
logger.warn(`Host "${hr.hostId}": ${warning}`);
|
|
4658
4707
|
}
|
|
4659
4708
|
else {
|
|
4660
4709
|
// rc-9: never silent — state the reason and the exact recovery step.
|
|
@@ -4666,6 +4715,10 @@ transaction) {
|
|
|
4666
4715
|
// First installs and upgrades share it, so an already-installed host being
|
|
4667
4716
|
// brought forward can never be silent (Owner report).
|
|
4668
4717
|
const hostSummary = summarizeTouchedHosts([...hostResults, ...refreshedResults]);
|
|
4718
|
+
// PRI-1249: the warnings of BOTH sets travel with the result — `--json`
|
|
4719
|
+
// silences logger.warn, so without this a successful install that had to
|
|
4720
|
+
// work around a host condition reports success with no trace of it.
|
|
4721
|
+
const hostWarnings = collectHostWarnings([...hostResults, ...refreshedResults]);
|
|
4669
4722
|
if (hostSummary.length > 0) {
|
|
4670
4723
|
logger.info('Install summary:');
|
|
4671
4724
|
for (const line of hostSummary)
|
|
@@ -4862,6 +4915,7 @@ transaction) {
|
|
|
4862
4915
|
nextAction: nextActions.join(' | '),
|
|
4863
4916
|
consoleUrl: launchResult.consoleUrl,
|
|
4864
4917
|
hostResults,
|
|
4918
|
+
...(hostWarnings.length > 0 ? { hostWarnings } : {}),
|
|
4865
4919
|
hostSummary,
|
|
4866
4920
|
...(compatibilityVisibility.lines.length > 0 ? { compatibilityWarnings: compatibilityVisibility.lines } : {}),
|
|
4867
4921
|
...(manualActionReason !== undefined ? { reason: manualActionReason, manualActions: hostManualActions } : {}),
|
|
@@ -30,7 +30,8 @@ import * as os from 'os';
|
|
|
30
30
|
import { createRequire } from 'module';
|
|
31
31
|
import { pathToFileURL } from 'url';
|
|
32
32
|
import { isNpmDependencyResolutionEnabled } from '../installer.js';
|
|
33
|
-
import { isSameMcpBindingPath, validateMcpBinding } from '@principles/install-layout';
|
|
33
|
+
import { isSameMcpBindingPath, validateMcpBinding, } from '@principles/install-layout';
|
|
34
|
+
import { findForeignWorkspaceHost } from '../utils/host-workspace-ownership.js';
|
|
34
35
|
import { getPdRuntimeDir } from '../mvp-config.js';
|
|
35
36
|
// NOTE (PRI-625 review round 3 / PRI-669 gate): this installer ships as the
|
|
36
37
|
// self-contained npx package — @principles/core is NOT in its dependencies,
|
|
@@ -474,6 +475,32 @@ export function resolvePluginDataRoot(codexHome, marketplace) {
|
|
|
474
475
|
}
|
|
475
476
|
return /^[A-Za-z0-9._-]+$/.test(marketplace) ? path.join(dataRoot, `principles-disciple-${marketplace}`) : undefined;
|
|
476
477
|
}
|
|
478
|
+
function isBindingFile(file) {
|
|
479
|
+
try {
|
|
480
|
+
return statSync(file).isFile();
|
|
481
|
+
}
|
|
482
|
+
catch {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* PRI-1248: durable binding first, payload-local legacy second — the same
|
|
488
|
+
* authority order as the launcher and `pd health`. Implemented locally because
|
|
489
|
+
* the installer's top-level graph must keep loading against the CURRENT
|
|
490
|
+
* registry install-layout (PRI-669 shape); a parity test pins the data-root
|
|
491
|
+
* rule to the shared implementation.
|
|
492
|
+
*/
|
|
493
|
+
function selectCodexBindingPath(codexHome, pluginRoot) {
|
|
494
|
+
const marketplace = path.basename(path.dirname(path.dirname(pluginRoot)));
|
|
495
|
+
const pluginData = resolvePluginDataRoot(codexHome, marketplace);
|
|
496
|
+
const persistent = pluginData === undefined ? null : path.join(pluginData, 'mcp-binding.json');
|
|
497
|
+
if (persistent !== null && isBindingFile(persistent))
|
|
498
|
+
return { path: persistent, persistent: true };
|
|
499
|
+
const legacy = path.join(pluginRoot, 'mcp-binding.json');
|
|
500
|
+
if (isBindingFile(legacy))
|
|
501
|
+
return { path: legacy, persistent: false };
|
|
502
|
+
return undefined;
|
|
503
|
+
}
|
|
477
504
|
const MCP_BINDING_FILE = 'mcp-binding.json';
|
|
478
505
|
function isDirectoryOnDisk(target) {
|
|
479
506
|
try {
|
|
@@ -491,19 +518,16 @@ function isFileOnDisk(target) {
|
|
|
491
518
|
return false;
|
|
492
519
|
}
|
|
493
520
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
* the launcher stays dead until a human re-runs setup.
|
|
502
|
-
*/
|
|
503
|
-
function isMcpBindingHealthy(pluginRoot, runtimeDir, pin) {
|
|
521
|
+
function isMcpBindingHealthy(input) {
|
|
522
|
+
const { pluginRoot, runtimeDir, pin, codexHome, homeDir } = input;
|
|
523
|
+
// PRI-1248: the host-persistent PLUGIN_DATA copy is authoritative; the
|
|
524
|
+
// payload-local file is the legacy fallback. Same order as launcher.cjs.
|
|
525
|
+
const selected = selectCodexBindingPath(codexHome, pluginRoot);
|
|
526
|
+
if (selected === undefined)
|
|
527
|
+
return false;
|
|
504
528
|
let binding;
|
|
505
529
|
try {
|
|
506
|
-
binding = JSON.parse(readFileSync(path
|
|
530
|
+
binding = JSON.parse(readFileSync(selected.path, 'utf8'));
|
|
507
531
|
}
|
|
508
532
|
catch {
|
|
509
533
|
return false;
|
|
@@ -518,6 +542,15 @@ function isMcpBindingHealthy(pluginRoot, runtimeDir, pin) {
|
|
|
518
542
|
const verdict = validateMcpBinding(binding, 'codex', process.platform);
|
|
519
543
|
if (!verdict.ok)
|
|
520
544
|
return false;
|
|
545
|
+
// PRI-1247: an existing, readable workspace that belongs to ANOTHER PD host
|
|
546
|
+
// is a cross-host misbinding, not a healthy binding. Treat it as repair-needed
|
|
547
|
+
// so the installer rewrites it with this host's workspace.
|
|
548
|
+
if (findForeignWorkspaceHost('codex', verdict.binding.workspaceDir, {
|
|
549
|
+
homeDir,
|
|
550
|
+
codexHome,
|
|
551
|
+
platform: process.platform,
|
|
552
|
+
}) !== null)
|
|
553
|
+
return false;
|
|
521
554
|
// Installer-only context the shape contract cannot know: the binding must
|
|
522
555
|
// describe THIS payload's runtime at THIS payload's pin. The comparison uses
|
|
523
556
|
// the launcher's own rule (Windows paths are case-insensitive), so a binding
|
|
@@ -545,6 +578,9 @@ export class CodexHostInstaller {
|
|
|
545
578
|
codexHome() {
|
|
546
579
|
return this.deps.codexHome ?? getCodexDir();
|
|
547
580
|
}
|
|
581
|
+
ownershipHome() {
|
|
582
|
+
return this.deps.homeDir ?? os.homedir();
|
|
583
|
+
}
|
|
548
584
|
/**
|
|
549
585
|
* Run `codex plugin add <plugin>@<marketplace>`. Re-adding an installed
|
|
550
586
|
* plugin is the host's own in-place refresh path — no uninstall/remove is
|
|
@@ -707,7 +743,13 @@ export class CodexHostInstaller {
|
|
|
707
743
|
// refresh deletes it even when PLUGIN_DATA's runtime still matches the pin.
|
|
708
744
|
// Treat a missing/stale binding as repair-needed: without it the Codex
|
|
709
745
|
// launcher exits `binding_missing` and pd-recall never appears in tools/list.
|
|
710
|
-
const bindingHealthy = isMcpBindingHealthy(
|
|
746
|
+
const bindingHealthy = isMcpBindingHealthy({
|
|
747
|
+
pluginRoot: current.versionDir,
|
|
748
|
+
runtimeDir,
|
|
749
|
+
pin,
|
|
750
|
+
codexHome: this.codexHome(),
|
|
751
|
+
homeDir: this.ownershipHome(),
|
|
752
|
+
});
|
|
711
753
|
let runtimeReconciled = false;
|
|
712
754
|
let bindingRepaired = false;
|
|
713
755
|
if (installed !== undefined && cohortsEqual(installed, pin) && bindingHealthy) {
|
|
@@ -726,7 +768,13 @@ export class CodexHostInstaller {
|
|
|
726
768
|
nextAction: 'Run: $pd-control setup — it installs the pinned runtime and verifies the exact bytes. If it also fails, check that npm is on PATH.',
|
|
727
769
|
};
|
|
728
770
|
}
|
|
729
|
-
if (!isMcpBindingHealthy(
|
|
771
|
+
if (!isMcpBindingHealthy({
|
|
772
|
+
pluginRoot: current.versionDir,
|
|
773
|
+
runtimeDir,
|
|
774
|
+
pin,
|
|
775
|
+
codexHome: this.codexHome(),
|
|
776
|
+
homeDir: this.ownershipHome(),
|
|
777
|
+
})) {
|
|
730
778
|
return {
|
|
731
779
|
success: false,
|
|
732
780
|
hostId: this.hostId,
|
|
@@ -2307,26 +2307,58 @@ export class WorkBuddyHostInstaller {
|
|
|
2307
2307
|
};
|
|
2308
2308
|
}
|
|
2309
2309
|
const { payload } = payloadFind;
|
|
2310
|
-
// 3b. SPEC §7.5/§11.3: a same-name user-level MCP server must
|
|
2311
|
-
//
|
|
2312
|
-
//
|
|
2313
|
-
|
|
2310
|
+
// 3b. SPEC §7.5/§11.3: a same-name user-level MCP server must never be
|
|
2311
|
+
// adopted or overwritten. The check is read-only and leaves the file alone.
|
|
2312
|
+
//
|
|
2313
|
+
// PRI-1249: a PROVEN foreign entry (`conflict`) always stops the install.
|
|
2314
|
+
// An entry whose ownership cannot be proven (`unverifiable` — in practice a
|
|
2315
|
+
// dead absolute `mcp/launcher.cjs` left behind by an older registration)
|
|
2316
|
+
// used to stop it too, and because `writeWorkbuddyMcpBinding` runs later in
|
|
2317
|
+
// this method, a host that was ALREADY installed could never be re-bound to
|
|
2318
|
+
// a new shared runtime: the launcher then failed closed forever with
|
|
2319
|
+
// `binding_version_mismatch`, and every official remedy (install / update /
|
|
2320
|
+
// repair) re-hit this same gate.
|
|
2321
|
+
//
|
|
2322
|
+
// The deadlock only exists for hosts PD has already bound, so only those
|
|
2323
|
+
// are allowed past an unprovable entry. A first registration keeps Gate 4's
|
|
2324
|
+
// hard stop: there the entry may belong to someone else entirely.
|
|
2325
|
+
//
|
|
2326
|
+
// "Already bound" must be read from a fact this run does NOT destroy:
|
|
2327
|
+
// `materializeMarketplace()` wipes the marketplace payload before copying,
|
|
2328
|
+
// so a copy failure would erase the binding that authorises the retry and
|
|
2329
|
+
// re-create the very deadlock this fix removes. The host's own registration
|
|
2330
|
+
// record survives that, so either signal counts.
|
|
2331
|
+
//
|
|
2332
|
+
// Why proceeding is not a user-config write: this installer writes no part
|
|
2333
|
+
// of `~/.workbuddy/mcp.json` — no writer for it exists anywhere in this
|
|
2334
|
+
// repository, and the classifier beside this code is read-only. The bytes
|
|
2335
|
+
// stay identical whether the install proceeds or not (the test asserts the
|
|
2336
|
+
// sha256). What PD itself does write is its own payload + binding.
|
|
2337
|
+
const pdMcpBindingPresent = existsSync(path.join(p.marketplaceRoot, WORKBUDDY_PLUGIN_NAME, 'mcp-binding.json'));
|
|
2338
|
+
const pdAlreadyInstalledForHost = pdMcpBindingPresent || details.registered;
|
|
2339
|
+
const mcpRegistration = checkMcpRegistrationConflict('workbuddy', {
|
|
2314
2340
|
homeDir: this.deps.homeDir(),
|
|
2315
2341
|
workbuddyConfigDir: p.configDir,
|
|
2316
2342
|
// Ownership is proven by the payload PD ships OR by launcher content
|
|
2317
2343
|
// stamps — never by the `mcp/launcher.cjs` file NAME alone.
|
|
2318
2344
|
pdLauncherRoots: [payload.pluginDir],
|
|
2319
2345
|
});
|
|
2320
|
-
if (!
|
|
2346
|
+
if (!mcpRegistration.ok && (mcpRegistration.kind === 'conflict' || !pdAlreadyInstalledForHost)) {
|
|
2321
2347
|
return {
|
|
2322
2348
|
success: false,
|
|
2323
2349
|
hostId: this.hostId,
|
|
2324
2350
|
configPath: p.settingsPath,
|
|
2325
2351
|
configAction: 'skipped',
|
|
2326
|
-
reason:
|
|
2327
|
-
nextAction:
|
|
2352
|
+
reason: mcpRegistration.reason,
|
|
2353
|
+
nextAction: mcpRegistration.nextAction,
|
|
2328
2354
|
};
|
|
2329
2355
|
}
|
|
2356
|
+
// Not a failure: this host already carries a PD MCP payload, and PD writes
|
|
2357
|
+
// none of that user file. The Owner still needs the exact path and the
|
|
2358
|
+
// recovery step (rc-9: reason + nextAction, never a bare "something was odd").
|
|
2359
|
+
const mcpRegistrationWarning = mcpRegistration.ok
|
|
2360
|
+
? undefined
|
|
2361
|
+
: `${mcpRegistration.reason} PD left that entry untouched and continued so this host is not left bound to the previous MCP server version. ${mcpRegistration.nextAction}`;
|
|
2330
2362
|
// 4. Materialize the PD-owned marketplace (source stays inside its root).
|
|
2331
2363
|
try {
|
|
2332
2364
|
materializeMarketplace(p.marketplaceRoot, payload.pluginDir);
|
|
@@ -2560,12 +2592,16 @@ export class WorkBuddyHostInstaller {
|
|
|
2560
2592
|
// pd-review). Idempotent and preservation-first: a copy that is not
|
|
2561
2593
|
// provably a published payload is reported, never overwritten or deleted.
|
|
2562
2594
|
const legacySkill = deprecateAllLegacyWorkbuddySkills({ configDir: p.configDir });
|
|
2595
|
+
const installWarnings = [
|
|
2596
|
+
...legacySkill.warnings,
|
|
2597
|
+
...(mcpRegistrationWarning === undefined ? [] : [mcpRegistrationWarning]),
|
|
2598
|
+
];
|
|
2563
2599
|
return {
|
|
2564
2600
|
success: true,
|
|
2565
2601
|
hostId: this.hostId,
|
|
2566
2602
|
configPath: p.settingsPath,
|
|
2567
2603
|
configAction: registration.settingsAction,
|
|
2568
|
-
warnings:
|
|
2604
|
+
warnings: installWarnings.length > 0 ? installWarnings : undefined,
|
|
2569
2605
|
pluginState: this.readInstalledPluginState(),
|
|
2570
2606
|
governance: governanceDefaults === null
|
|
2571
2607
|
? undefined
|
|
@@ -14,6 +14,7 @@ import * as fs from 'fs';
|
|
|
14
14
|
import * as path from 'path';
|
|
15
15
|
import * as os from 'os';
|
|
16
16
|
import * as net from 'net';
|
|
17
|
+
import { findForeignWorkspaceHost } from './host-workspace-ownership.js';
|
|
17
18
|
import { errnoCode } from './config-file-io.js';
|
|
18
19
|
const IS_WIN32 = process.platform === 'win32';
|
|
19
20
|
/** 探测超时:卡死的 .cmd shim / 挂起的二进制不应挂住安装器(rc-9 降级)。 */
|
|
@@ -94,21 +95,59 @@ export function checkEnvironment() {
|
|
|
94
95
|
}
|
|
95
96
|
return result;
|
|
96
97
|
}
|
|
98
|
+
/** The initialized Codex workspace used by `$pd-control setup` (`locateWorkspace`). */
|
|
99
|
+
function codexWorkspaceCandidates(homeDir, codexHome, cwd) {
|
|
100
|
+
const candidates = [path.join(codexHome, 'pd-workspace')];
|
|
101
|
+
// A project with `.pd/config.yaml` is an initialized workspace and wins over
|
|
102
|
+
// the bare cwd, matching the plugin's own locateWorkspace order.
|
|
103
|
+
let current = cwd;
|
|
104
|
+
for (;;) {
|
|
105
|
+
if (fs.existsSync(path.join(current, '.pd', 'config.yaml'))) {
|
|
106
|
+
candidates.push(current);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
const parent = path.dirname(current);
|
|
110
|
+
if (parent === current)
|
|
111
|
+
break;
|
|
112
|
+
current = parent;
|
|
113
|
+
}
|
|
114
|
+
candidates.push(cwd);
|
|
115
|
+
// Never default Codex to another PD host's owned workspace, even when the
|
|
116
|
+
// process happens to run inside it (PRI-1247).
|
|
117
|
+
return candidates.filter((candidate) => findForeignWorkspaceHost('codex', candidate, {
|
|
118
|
+
homeDir,
|
|
119
|
+
codexHome,
|
|
120
|
+
platform: process.platform,
|
|
121
|
+
}) === null);
|
|
122
|
+
}
|
|
97
123
|
/**
|
|
98
|
-
*
|
|
124
|
+
* 检测工作区。
|
|
125
|
+
*
|
|
126
|
+
* 默认(OpenClaw)保持原有候选顺序;`host: 'codex'` 只使用 Codex 自己的
|
|
127
|
+
* 工作区(`<CODEX_HOME>/pd-workspace` → 最近的项目 `.pd/config.yaml` → cwd),
|
|
128
|
+
* 不再继承 OPENCLAW_WORKSPACE / PD_WORKSPACE_DIR / ~/clawd(PRI-1247)。
|
|
99
129
|
*/
|
|
100
|
-
export function detectWorkspace() {
|
|
101
|
-
const homeDir = os.homedir();
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
130
|
+
export function detectWorkspace(options = {}) {
|
|
131
|
+
const homeDir = options.homeDir ?? os.homedir();
|
|
132
|
+
const host = options.host ?? 'openclaw';
|
|
133
|
+
const codexHome = options.codexHome
|
|
134
|
+
?? (typeof process.env.CODEX_HOME === 'string' && path.isAbsolute(process.env.CODEX_HOME)
|
|
135
|
+
? path.resolve(process.env.CODEX_HOME)
|
|
136
|
+
: path.join(homeDir, '.codex'));
|
|
137
|
+
const candidates = host === 'codex'
|
|
138
|
+
? codexWorkspaceCandidates(homeDir, codexHome, options.cwd ?? process.cwd())
|
|
139
|
+
: [];
|
|
140
|
+
if (host !== 'codex') {
|
|
141
|
+
// 安全地添加候选路径
|
|
142
|
+
if (process.env.OPENCLAW_WORKSPACE) {
|
|
143
|
+
candidates.push(process.env.OPENCLAW_WORKSPACE);
|
|
144
|
+
}
|
|
145
|
+
if (process.env.PD_WORKSPACE_DIR) {
|
|
146
|
+
candidates.push(process.env.PD_WORKSPACE_DIR);
|
|
147
|
+
}
|
|
148
|
+
candidates.push(path.join(homeDir, 'clawd'));
|
|
149
|
+
candidates.push(path.join(homeDir, '.openclaw', 'workspace'));
|
|
109
150
|
}
|
|
110
|
-
candidates.push(path.join(homeDir, 'clawd'));
|
|
111
|
-
candidates.push(path.join(homeDir, '.openclaw', 'workspace'));
|
|
112
151
|
// 核心文件列表(用于检测是否已安装)
|
|
113
152
|
const CORE_FILES = [
|
|
114
153
|
'AGENTS.md',
|
|
@@ -141,8 +180,10 @@ export function detectWorkspace() {
|
|
|
141
180
|
};
|
|
142
181
|
}
|
|
143
182
|
}
|
|
144
|
-
//
|
|
145
|
-
const defaultPath =
|
|
183
|
+
// Codex first install defaults to ITS OWN user workspace; OpenClaw keeps ~/clawd.
|
|
184
|
+
const defaultPath = host === 'codex'
|
|
185
|
+
? path.join(codexHome, 'pd-workspace')
|
|
186
|
+
: path.join(homeDir, 'clawd');
|
|
146
187
|
return {
|
|
147
188
|
detectedPath: defaultPath,
|
|
148
189
|
exists: false,
|