create-principles-disciple 1.146.9 → 1.147.0
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/explicit-owner-statement.d.ts +6 -0
- package/codex-adapter/dist/ingestion/explicit-owner-statement.js +6 -0
- package/codex-adapter/dist/pd-hook.js +5 -2
- package/codex-adapter/dist/worker/workspace-worker.d.ts +13 -1
- package/codex-adapter/dist/worker/workspace-worker.js +26 -3
- package/codex-adapter/package.json +1 -1
- package/core/dist/runtime-v2/index.d.ts +2 -2
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +1 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/pain-ingress-payload.d.ts +13 -1
- package/core/dist/runtime-v2/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-ingress-payload.js +21 -2
- package/core/dist/runtime-v2/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime-v2/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-ingress.js +3 -0
- package/core/dist/runtime-v2/pain-ingress.js.map +1 -1
- package/core/dist/runtime-v2/signal-collector/confidence-gate.d.ts +35 -0
- package/core/dist/runtime-v2/signal-collector/confidence-gate.d.ts.map +1 -0
- package/core/dist/runtime-v2/signal-collector/confidence-gate.js +48 -0
- package/core/dist/runtime-v2/signal-collector/confidence-gate.js.map +1 -0
- package/core/dist/runtime-v2/signal-collector/index.d.ts +1 -0
- package/core/dist/runtime-v2/signal-collector/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/signal-collector/index.js +1 -0
- package/core/dist/runtime-v2/signal-collector/index.js.map +1 -1
- package/core/dist/runtime-v2/signal-collector/keyword-stage.d.ts +4 -6
- package/core/dist/runtime-v2/signal-collector/keyword-stage.d.ts.map +1 -1
- package/core/dist/runtime-v2/signal-collector/keyword-stage.js +100 -9
- package/core/dist/runtime-v2/signal-collector/keyword-stage.js.map +1 -1
- package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js +8 -4
- package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +52 -1
- package/dist/installer.js.map +1 -1
- package/dist/installers/mcp-registration-conflict.d.ts +35 -0
- package/dist/installers/mcp-registration-conflict.d.ts.map +1 -0
- package/dist/installers/mcp-registration-conflict.js +559 -0
- package/dist/installers/mcp-registration-conflict.js.map +1 -0
- package/dist/installers/openclaw-host-installer.d.ts.map +1 -1
- package/dist/installers/openclaw-host-installer.js +20 -0
- package/dist/installers/openclaw-host-installer.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +124 -2
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/mcp-server-layout-compat.d.ts +18 -0
- package/dist/mcp-server-layout-compat.d.ts.map +1 -0
- package/dist/mcp-server-layout-compat.js +22 -0
- package/dist/mcp-server-layout-compat.js.map +1 -0
- package/host-runtime/dist/governance-signal-admission.d.ts +147 -4
- package/host-runtime/dist/governance-signal-admission.js +1065 -60
- package/host-runtime/dist/index.d.ts +2 -0
- package/host-runtime/dist/index.js +2 -0
- package/host-runtime/dist/signal-classifier.d.ts +46 -0
- package/host-runtime/dist/signal-classifier.js +167 -0
- package/host-runtime/dist/signal-stage2-cycle.d.ts +42 -0
- package/host-runtime/dist/signal-stage2-cycle.js +184 -0
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/index.d.ts +15 -0
- package/install-layout/dist/index.js +10 -0
- package/install-layout/package.json +1 -1
- package/package.json +9 -7
- package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex.js +12 -0
- package/pd-cli/dist/commands/health-codex.js.map +1 -1
- package/pd-cli/dist/commands/health-mcp.d.ts +74 -0
- package/pd-cli/dist/commands/health-mcp.d.ts.map +1 -0
- package/pd-cli/dist/commands/health-mcp.js +723 -0
- package/pd-cli/dist/commands/health-mcp.js.map +1 -0
- package/pd-cli/dist/commands/health.d.ts +2 -0
- package/pd-cli/dist/commands/health.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +11 -6
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-mcp-server/dist/budget.d.ts +15 -0
- package/pd-mcp-server/dist/budget.js +19 -0
- package/pd-mcp-server/dist/deadline.d.ts +75 -0
- package/pd-mcp-server/dist/deadline.js +136 -0
- package/pd-mcp-server/dist/envelope.d.ts +52 -0
- package/pd-mcp-server/dist/envelope.js +63 -0
- package/pd-mcp-server/dist/index.d.ts +10 -0
- package/pd-mcp-server/dist/index.js +76 -0
- package/pd-mcp-server/dist/logging.d.ts +12 -0
- package/pd-mcp-server/dist/logging.js +42 -0
- package/pd-mcp-server/dist/server.d.ts +90 -0
- package/pd-mcp-server/dist/server.js +178 -0
- package/pd-mcp-server/dist/version.d.ts +13 -0
- package/pd-mcp-server/dist/version.js +13 -0
- package/pd-mcp-server/dist/workspace.d.ts +23 -0
- package/pd-mcp-server/dist/workspace.js +77 -0
- package/pd-mcp-server/package.json +49 -0
- package/plugin/dist/bundle.js +414 -412
- package/plugin/dist/core/mcp-binding.d.ts +41 -0
- package/plugin/dist/index.d.ts +33 -0
- package/plugin/dist/openclaw.plugin.json +10 -1
- package/plugin/dist/utils/workspace-resolver.d.ts +17 -0
- package/plugin/openclaw.plugin.json +10 -1
- package/plugin/package.json +2 -1
- package/release-manager/dist/installer.js +52 -1
- package/release-manager/dist/installers/mcp-registration-conflict.js +559 -0
- package/release-manager/dist/installers/openclaw-host-installer.js +20 -0
- package/release-manager/dist/installers/workbuddy-host-installer.js +124 -2
- package/release-manager/dist/mcp-server-layout-compat.js +22 -0
- package/release-manager/package.json +7 -5
- package/workbuddy-adapter/dist/pd-hook.js +28 -5
- package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +6 -1
- package/workbuddy-adapter/dist/worker/workspace-worker.js +24 -3
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/.codebuddy-plugin/plugin.json +2 -2
- package/workbuddy-adapter/plugin/.mcp.json +10 -0
- package/workbuddy-adapter/plugin/mcp/launcher.cjs +347 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const MCP_BINDING_SCHEMA: 'pd.mcp-binding.v1';
|
|
2
|
+
export declare const MCP_BINDING_HOST: 'openclaw';
|
|
3
|
+
export interface McpBindingOutcome {
|
|
4
|
+
readonly ok: boolean;
|
|
5
|
+
readonly reason?: string;
|
|
6
|
+
readonly written?: boolean;
|
|
7
|
+
readonly serverEntry?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Pure: the binding content for a resolved workspace (exported for tests). */
|
|
10
|
+
export declare function buildMcpBinding(workspaceDir: string, runtimeDir: string, serverEntry: string): Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Canonical shared runtime root (~/.pd/runtime). Mirrors
|
|
13
|
+
* @principles/install-layout's runtimeDir; the lean OpenClaw bundle does not
|
|
14
|
+
* depend on that package, so this is the single local mirror and the binding
|
|
15
|
+
* records it for the launcher's canonical-path check.
|
|
16
|
+
*/
|
|
17
|
+
export declare function canonicalRuntimeDir(homeDir: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Canonical installed MCP server entry (~/.pd/runtime/pd-mcp-server/dist/
|
|
20
|
+
* index.js). Same canonical-path convention as the plugin scripts' pd-cli
|
|
21
|
+
* probe; layout authority stays in @principles/install-layout.
|
|
22
|
+
*/
|
|
23
|
+
export declare function canonicalMcpServerEntry(homeDir: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Ensure the launcher binding matches the CURRENT resolved workspace.
|
|
26
|
+
* The workspace arrives from the runtime resolver and may be unresolved
|
|
27
|
+
* (undefined) — that state is reported, never coerced. Returns an outcome;
|
|
28
|
+
* never throws (degrades to a structured warning).
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Remove the launcher binding when the current workspace cannot be trusted.
|
|
32
|
+
* A stale binding would keep the launcher pointed at the LAST resolved
|
|
33
|
+
* workspace (SPEC §3.5 requires fail-closed when the workspace cannot be
|
|
34
|
+
* confirmed). Missing file is not an error; a failed removal is reported.
|
|
35
|
+
*/
|
|
36
|
+
export declare function invalidateMcpBinding(extensionRoot: string): {
|
|
37
|
+
ok: boolean;
|
|
38
|
+
removed: boolean;
|
|
39
|
+
reason?: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function ensureMcpBinding(workspaceDir: string | undefined, extensionRoot: string, homeDir: string): McpBindingOutcome;
|
package/plugin/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,39 @@ export declare function shouldUseSharedHostRuntime(workspaceDir: string, logger:
|
|
|
39
39
|
source: string;
|
|
40
40
|
rollbackReason: string | null;
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Gate 4 (PRI-1071): keep the host-wide launcher binding in lockstep with an
|
|
44
|
+
* EXPLICITLY DECLARED PD workspace only.
|
|
45
|
+
*
|
|
46
|
+
* The MCP server is one process per host and reads ONE `mcp-binding.json` beside
|
|
47
|
+
* the plugin payload, while OpenClaw may run several agents with different
|
|
48
|
+
* `ctx.workspaceDir`s. Binding whichever agent resolved first (or `main`) would
|
|
49
|
+
* serve that workspace's Pain evidence to every other agent — cross-workspace
|
|
50
|
+
* recall leakage. So:
|
|
51
|
+
* - explicit PD workspace (PD_WORKSPACE_DIR / OPENCLAW_WORKSPACE /
|
|
52
|
+
* principles-disciple.json `workspace`) → bind it (idempotent);
|
|
53
|
+
* - no explicit declaration → REMOVE the binding and let the launcher
|
|
54
|
+
* fail closed (`binding_missing`). Never infer from `main`, `cwd`, `HOME`
|
|
55
|
+
* or the host default (SPEC §3.5).
|
|
56
|
+
*
|
|
57
|
+
* Hooks are unaffected: per-event hook resolution keeps its existing chain.
|
|
58
|
+
* Never throws (G4-07: MCP unavailability must not break PD's other functions).
|
|
59
|
+
*/
|
|
60
|
+
export interface McpBindingSyncResult {
|
|
61
|
+
status: 'written' | 'unchanged' | 'invalidated' | 'unavailable';
|
|
62
|
+
reason: string;
|
|
63
|
+
nextAction: string;
|
|
64
|
+
workspaceDir?: string;
|
|
65
|
+
source?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function syncMcpBindingFromExplicitWorkspace(options: {
|
|
68
|
+
extensionRoot: string;
|
|
69
|
+
homeDir: string;
|
|
70
|
+
resolver?: () => {
|
|
71
|
+
workspaceDir: string;
|
|
72
|
+
source: string;
|
|
73
|
+
} | null;
|
|
74
|
+
}): McpBindingSyncResult;
|
|
42
75
|
declare const plugin: {
|
|
43
76
|
name: string;
|
|
44
77
|
description: string;
|
|
@@ -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": "2.
|
|
5
|
+
"version": "2.4.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -12,6 +12,15 @@
|
|
|
12
12
|
"skills": [
|
|
13
13
|
"templates/langs/zh/skills"
|
|
14
14
|
],
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"pd-recall": {
|
|
17
|
+
"transport": "stdio",
|
|
18
|
+
"command": "node",
|
|
19
|
+
"args": [
|
|
20
|
+
"./mcp/launcher.cjs"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
15
24
|
"configSchema": {
|
|
16
25
|
"type": "object",
|
|
17
26
|
"additionalProperties": false,
|
|
@@ -77,6 +77,23 @@ export interface RejectedWorkspaceCandidate {
|
|
|
77
77
|
reason: 'not_absolute' | 'rejected_by_validation';
|
|
78
78
|
}
|
|
79
79
|
export declare function resolveCanonicalWorkspaceDir(): CanonicalWorkspaceResult | null;
|
|
80
|
+
/**
|
|
81
|
+
* Resolve ONLY owner-declared PD workspace sources (env vars + config file),
|
|
82
|
+
* without any host/agent/default inference.
|
|
83
|
+
*
|
|
84
|
+
* Gate 4 (PRI-1071): the MCP launcher binding is host-wide (one binding file
|
|
85
|
+
* per plugin payload), so it may only record a workspace the Owner explicitly
|
|
86
|
+
* declared. A resolved `main` agent workspace, `ctx.workspaceDir` of whichever
|
|
87
|
+
* agent happened to load the plugin, `process.cwd()` or `~/.openclaw/workspace`
|
|
88
|
+
* all describe WHERE A SESSION RUNS — never which state tree owns governance
|
|
89
|
+
* for every agent of the host. In a multi-agent OpenClaw install those differ,
|
|
90
|
+
* and binding one agent's workspace would serve that agent's Pain evidence to
|
|
91
|
+
* every other agent (cross-workspace recall leakage).
|
|
92
|
+
*
|
|
93
|
+
* Returns `null` when no explicit source resolves; callers must fail closed
|
|
94
|
+
* (invalidate a previously written binding) instead of inferring a default.
|
|
95
|
+
*/
|
|
96
|
+
export declare function resolveExplicitPdWorkspaceDir(): CanonicalWorkspaceResult | null;
|
|
80
97
|
export type HookWorkspaceSource = CanonicalWorkspaceSource | 'openclaw_context' | 'openclaw_api';
|
|
81
98
|
export interface HookWorkspaceResolutionSuccess {
|
|
82
99
|
ok: true;
|
|
@@ -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": "2.
|
|
5
|
+
"version": "2.4.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -12,6 +12,15 @@
|
|
|
12
12
|
"skills": [
|
|
13
13
|
"templates/langs/zh/skills"
|
|
14
14
|
],
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"pd-recall": {
|
|
17
|
+
"transport": "stdio",
|
|
18
|
+
"command": "node",
|
|
19
|
+
"args": [
|
|
20
|
+
"./mcp/launcher.cjs"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
15
24
|
"configSchema": {
|
|
16
25
|
"type": "object",
|
|
17
26
|
"additionalProperties": false,
|
package/plugin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
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",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
|
+
"mcp",
|
|
31
32
|
"templates",
|
|
32
33
|
"assets",
|
|
33
34
|
"openclaw.plugin.json",
|
|
@@ -14,7 +14,8 @@ 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
16
|
import { runWorkbuddyEarlyPreflight } from './installers/workbuddy-host-installer.js';
|
|
17
|
-
import { INSTALL_LAYOUT_VERSION, getWorkbuddyWorkspaceDir, installManifestHostsForPersist, mergeInstallManifestWorkspaces, parseInstallManifest } from '@principles/install-layout';
|
|
17
|
+
import { INSTALL_LAYOUT_VERSION, getInstallLayoutPaths, getWorkbuddyWorkspaceDir, installManifestHostsForPersist, mergeInstallManifestWorkspaces, parseInstallManifest } from '@principles/install-layout';
|
|
18
|
+
import { resolveMcpServerDir } from './mcp-server-layout-compat.js';
|
|
18
19
|
import { detectOpenClawMainWorkspaceDivergence } from './utils/workspace-divergence.js';
|
|
19
20
|
import { applySkillLanguageSelection } from './skill-language.js';
|
|
20
21
|
import { parseReleaseAssetIdentity, parseReleaseAssetManifest, ReleaseAssetManifestError, verifyReleaseAssetManifestAsync, verifyReleaseAssetTarget, } from './update/release-asset-manifest.js';
|
|
@@ -659,6 +660,7 @@ const NPM_DISTRIBUTED_COMPONENTS = [
|
|
|
659
660
|
['PD CLI', 'pd-cli'],
|
|
660
661
|
['Console', 'console'],
|
|
661
662
|
['Install layout', 'install-layout'],
|
|
663
|
+
['MCP server', 'pd-mcp-server'],
|
|
662
664
|
];
|
|
663
665
|
// Components whose install step demands MORE than the generic
|
|
664
666
|
// package.json+dist shape check — the per-component extra files are
|
|
@@ -812,6 +814,7 @@ const SELF_CONTAINED_COMPONENTS = [
|
|
|
812
814
|
['PD CLI', 'pd-cli'],
|
|
813
815
|
['Console', 'console'],
|
|
814
816
|
['Install layout', 'install-layout'],
|
|
817
|
+
['MCP server', 'pd-mcp-server'],
|
|
815
818
|
];
|
|
816
819
|
export async function preflightSelfContainedReleaseAsset(assetDir) {
|
|
817
820
|
const identityPath = path.join(assetDir, '_release', 'asset.json');
|
|
@@ -2190,6 +2193,38 @@ function getInstalledCodexAdapterDir() {
|
|
|
2190
2193
|
function getInstalledWorkbuddyAdapterDir() {
|
|
2191
2194
|
return path.join(getPdRuntimeDir(), 'workbuddy-adapter');
|
|
2192
2195
|
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Gate 4 (PRI-1071): the shared MCP server installs as a runtime sibling so
|
|
2198
|
+
* the three host launchers can point their PD-owned bindings at one canonical
|
|
2199
|
+
* entry (~/.pd/runtime/pd-mcp-server/dist/index.js).
|
|
2200
|
+
*/
|
|
2201
|
+
function getInstalledMcpServerDir() {
|
|
2202
|
+
return resolveMcpServerDir(getInstallLayoutPaths(getHomeDir()));
|
|
2203
|
+
}
|
|
2204
|
+
/**
|
|
2205
|
+
* Gate 4 (PRI-1071): deploy the bundled @principles/pd-mcp-server the same
|
|
2206
|
+
* way as the codex/workbuddy adapters. Observable skip (not a failure) for
|
|
2207
|
+
* installer builds older than the component — the host launchers then fail
|
|
2208
|
+
* closed at launch with the honest "server entry missing" state (SPEC §3.5).
|
|
2209
|
+
* Link materialization happens via ensureComponentFileDependencyLinks AFTER
|
|
2210
|
+
* all siblings exist (same ordering contract as the codex adapter).
|
|
2211
|
+
*/
|
|
2212
|
+
function installBundledMcpServer(pluginDir) {
|
|
2213
|
+
const mcpServerSrc = path.join(pluginDir, 'pd-mcp-server');
|
|
2214
|
+
const mcpServerDest = getInstalledMcpServerDir();
|
|
2215
|
+
if (!existsSync(mcpServerSrc)) {
|
|
2216
|
+
logger.warn(`Bundled @principles/pd-mcp-server not found in this installer package (${mcpServerSrc}) — the pd-recall MCP tool stays unavailable in this deployment. Hook/CLI/Console installation is unaffected.`);
|
|
2217
|
+
return false;
|
|
2218
|
+
}
|
|
2219
|
+
const mcpServerPkgJson = path.join(mcpServerSrc, 'package.json');
|
|
2220
|
+
const mcpServerDistEntry = path.join(mcpServerSrc, 'dist', 'index.js');
|
|
2221
|
+
if (!existsSync(mcpServerPkgJson) || !existsSync(mcpServerDistEntry)) {
|
|
2222
|
+
throw new Error('Bundled @principles/pd-mcp-server is incomplete (missing package.json / dist/index.js). Package may be corrupted.');
|
|
2223
|
+
}
|
|
2224
|
+
rmSync(mcpServerDest, { recursive: true, force: true });
|
|
2225
|
+
cpSync(mcpServerSrc, mcpServerDest, { recursive: true });
|
|
2226
|
+
return true;
|
|
2227
|
+
}
|
|
2193
2228
|
function installBundledCore(pluginDir) {
|
|
2194
2229
|
const coreSrc = path.join(pluginDir, 'core');
|
|
2195
2230
|
const coreDest = getInstalledCoreDir();
|
|
@@ -2598,6 +2633,9 @@ async function installConsoleDependencies() {
|
|
|
2598
2633
|
const consoleDest = getInstalledConsoleDir();
|
|
2599
2634
|
await prepareComponentDependencies(consoleDest, 'Console');
|
|
2600
2635
|
}
|
|
2636
|
+
async function installMcpServerDependencies() {
|
|
2637
|
+
await prepareComponentDependencies(getInstalledMcpServerDir(), 'MCP server');
|
|
2638
|
+
}
|
|
2601
2639
|
const CONSOLE_PORT_MAX_RETRIES = 3;
|
|
2602
2640
|
/**
|
|
2603
2641
|
* P0-2 (SPEC v1.2 §5 step 6 / invariant I-4): terminate a child and WAIT for
|
|
@@ -3727,6 +3765,19 @@ transaction) {
|
|
|
3727
3765
|
// installer builds is an observable skip, not a failure.
|
|
3728
3766
|
installBundledWorkbuddyAdapter(pluginDir);
|
|
3729
3767
|
ensureWorkbuddyAdapterResolution();
|
|
3768
|
+
// Gate 4 (PRI-1071): the shared MCP server refreshes with the runtime so
|
|
3769
|
+
// the host launchers' bindings always point at the current canonical
|
|
3770
|
+
// entry. Older installer payloads skip observably (the launchers fail
|
|
3771
|
+
// closed at start with the honest missing-entry state).
|
|
3772
|
+
const mcpServerInstalled = installBundledMcpServer(pluginDir);
|
|
3773
|
+
if (mcpServerInstalled) {
|
|
3774
|
+
ensureComponentFileDependencyLinks(getInstalledMcpServerDir(), 'pd-mcp-server');
|
|
3775
|
+
// The npm-distributed payload ships only dist/ + package.json, and the
|
|
3776
|
+
// MCP server keeps @modelcontextprotocol/server + zod as registry deps
|
|
3777
|
+
// (unlike the file:-linked siblings). Without this pass the launcher
|
|
3778
|
+
// starts an entry whose imports cannot resolve.
|
|
3779
|
+
await installMcpServerDependencies();
|
|
3780
|
+
}
|
|
3730
3781
|
if (spinner)
|
|
3731
3782
|
updateProgress(spinner, stepIndex, 'Installing release-manager authority module...');
|
|
3732
3783
|
installBundledReleaseManagerPackage(pluginDir);
|