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.
Files changed (112) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/ingestion/explicit-owner-statement.d.ts +6 -0
  3. package/codex-adapter/dist/ingestion/explicit-owner-statement.js +6 -0
  4. package/codex-adapter/dist/pd-hook.js +5 -2
  5. package/codex-adapter/dist/worker/workspace-worker.d.ts +13 -1
  6. package/codex-adapter/dist/worker/workspace-worker.js +26 -3
  7. package/codex-adapter/package.json +1 -1
  8. package/core/dist/runtime-v2/index.d.ts +2 -2
  9. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  10. package/core/dist/runtime-v2/index.js +1 -1
  11. package/core/dist/runtime-v2/index.js.map +1 -1
  12. package/core/dist/runtime-v2/pain-ingress-payload.d.ts +13 -1
  13. package/core/dist/runtime-v2/pain-ingress-payload.d.ts.map +1 -1
  14. package/core/dist/runtime-v2/pain-ingress-payload.js +21 -2
  15. package/core/dist/runtime-v2/pain-ingress-payload.js.map +1 -1
  16. package/core/dist/runtime-v2/pain-ingress.d.ts.map +1 -1
  17. package/core/dist/runtime-v2/pain-ingress.js +3 -0
  18. package/core/dist/runtime-v2/pain-ingress.js.map +1 -1
  19. package/core/dist/runtime-v2/signal-collector/confidence-gate.d.ts +35 -0
  20. package/core/dist/runtime-v2/signal-collector/confidence-gate.d.ts.map +1 -0
  21. package/core/dist/runtime-v2/signal-collector/confidence-gate.js +48 -0
  22. package/core/dist/runtime-v2/signal-collector/confidence-gate.js.map +1 -0
  23. package/core/dist/runtime-v2/signal-collector/index.d.ts +1 -0
  24. package/core/dist/runtime-v2/signal-collector/index.d.ts.map +1 -1
  25. package/core/dist/runtime-v2/signal-collector/index.js +1 -0
  26. package/core/dist/runtime-v2/signal-collector/index.js.map +1 -1
  27. package/core/dist/runtime-v2/signal-collector/keyword-stage.d.ts +4 -6
  28. package/core/dist/runtime-v2/signal-collector/keyword-stage.d.ts.map +1 -1
  29. package/core/dist/runtime-v2/signal-collector/keyword-stage.js +100 -9
  30. package/core/dist/runtime-v2/signal-collector/keyword-stage.js.map +1 -1
  31. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -1
  32. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js +8 -4
  33. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -1
  34. package/core/package.json +1 -1
  35. package/dist/installer.d.ts.map +1 -1
  36. package/dist/installer.js +52 -1
  37. package/dist/installer.js.map +1 -1
  38. package/dist/installers/mcp-registration-conflict.d.ts +35 -0
  39. package/dist/installers/mcp-registration-conflict.d.ts.map +1 -0
  40. package/dist/installers/mcp-registration-conflict.js +559 -0
  41. package/dist/installers/mcp-registration-conflict.js.map +1 -0
  42. package/dist/installers/openclaw-host-installer.d.ts.map +1 -1
  43. package/dist/installers/openclaw-host-installer.js +20 -0
  44. package/dist/installers/openclaw-host-installer.js.map +1 -1
  45. package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
  46. package/dist/installers/workbuddy-host-installer.js +124 -2
  47. package/dist/installers/workbuddy-host-installer.js.map +1 -1
  48. package/dist/mcp-server-layout-compat.d.ts +18 -0
  49. package/dist/mcp-server-layout-compat.d.ts.map +1 -0
  50. package/dist/mcp-server-layout-compat.js +22 -0
  51. package/dist/mcp-server-layout-compat.js.map +1 -0
  52. package/host-runtime/dist/governance-signal-admission.d.ts +147 -4
  53. package/host-runtime/dist/governance-signal-admission.js +1065 -60
  54. package/host-runtime/dist/index.d.ts +2 -0
  55. package/host-runtime/dist/index.js +2 -0
  56. package/host-runtime/dist/signal-classifier.d.ts +46 -0
  57. package/host-runtime/dist/signal-classifier.js +167 -0
  58. package/host-runtime/dist/signal-stage2-cycle.d.ts +42 -0
  59. package/host-runtime/dist/signal-stage2-cycle.js +184 -0
  60. package/host-runtime/package.json +1 -1
  61. package/install-layout/dist/index.d.ts +15 -0
  62. package/install-layout/dist/index.js +10 -0
  63. package/install-layout/package.json +1 -1
  64. package/package.json +9 -7
  65. package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
  66. package/pd-cli/dist/commands/health-codex.js +12 -0
  67. package/pd-cli/dist/commands/health-codex.js.map +1 -1
  68. package/pd-cli/dist/commands/health-mcp.d.ts +74 -0
  69. package/pd-cli/dist/commands/health-mcp.d.ts.map +1 -0
  70. package/pd-cli/dist/commands/health-mcp.js +723 -0
  71. package/pd-cli/dist/commands/health-mcp.js.map +1 -0
  72. package/pd-cli/dist/commands/health.d.ts +2 -0
  73. package/pd-cli/dist/commands/health.d.ts.map +1 -1
  74. package/pd-cli/dist/commands/health.js +11 -6
  75. package/pd-cli/dist/commands/health.js.map +1 -1
  76. package/pd-mcp-server/dist/budget.d.ts +15 -0
  77. package/pd-mcp-server/dist/budget.js +19 -0
  78. package/pd-mcp-server/dist/deadline.d.ts +75 -0
  79. package/pd-mcp-server/dist/deadline.js +136 -0
  80. package/pd-mcp-server/dist/envelope.d.ts +52 -0
  81. package/pd-mcp-server/dist/envelope.js +63 -0
  82. package/pd-mcp-server/dist/index.d.ts +10 -0
  83. package/pd-mcp-server/dist/index.js +76 -0
  84. package/pd-mcp-server/dist/logging.d.ts +12 -0
  85. package/pd-mcp-server/dist/logging.js +42 -0
  86. package/pd-mcp-server/dist/server.d.ts +90 -0
  87. package/pd-mcp-server/dist/server.js +178 -0
  88. package/pd-mcp-server/dist/version.d.ts +13 -0
  89. package/pd-mcp-server/dist/version.js +13 -0
  90. package/pd-mcp-server/dist/workspace.d.ts +23 -0
  91. package/pd-mcp-server/dist/workspace.js +77 -0
  92. package/pd-mcp-server/package.json +49 -0
  93. package/plugin/dist/bundle.js +414 -412
  94. package/plugin/dist/core/mcp-binding.d.ts +41 -0
  95. package/plugin/dist/index.d.ts +33 -0
  96. package/plugin/dist/openclaw.plugin.json +10 -1
  97. package/plugin/dist/utils/workspace-resolver.d.ts +17 -0
  98. package/plugin/openclaw.plugin.json +10 -1
  99. package/plugin/package.json +2 -1
  100. package/release-manager/dist/installer.js +52 -1
  101. package/release-manager/dist/installers/mcp-registration-conflict.js +559 -0
  102. package/release-manager/dist/installers/openclaw-host-installer.js +20 -0
  103. package/release-manager/dist/installers/workbuddy-host-installer.js +124 -2
  104. package/release-manager/dist/mcp-server-layout-compat.js +22 -0
  105. package/release-manager/package.json +7 -5
  106. package/workbuddy-adapter/dist/pd-hook.js +28 -5
  107. package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +6 -1
  108. package/workbuddy-adapter/dist/worker/workspace-worker.js +24 -3
  109. package/workbuddy-adapter/package.json +1 -1
  110. package/workbuddy-adapter/plugin/.codebuddy-plugin/plugin.json +2 -2
  111. package/workbuddy-adapter/plugin/.mcp.json +10 -0
  112. package/workbuddy-adapter/plugin/mcp/launcher.cjs +347 -0
package/dist/installer.js CHANGED
@@ -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);