create-principles-disciple 1.121.7 → 1.121.9

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 (461) hide show
  1. package/README.md +13 -1
  2. package/console/dist/server/config/pd-config-store.d.ts +1 -3
  3. package/console/dist/server/config/pd-config-store.js +4 -4
  4. package/console/dist/server/feedback/channels.d.ts +2 -8
  5. package/console/dist/server/feedback/channels.js +0 -11
  6. package/console/dist/server/index.js +34 -5
  7. package/console/dist/server/models/ActivationsConsoleModel.d.ts +28 -1
  8. package/console/dist/server/models/ActivationsConsoleModel.js +72 -30
  9. package/console/dist/server/models/GovernanceExperienceCollector.d.ts +28 -0
  10. package/console/dist/server/models/GovernanceExperienceCollector.js +305 -0
  11. package/console/dist/server/models/GovernanceProjectionCollector.d.ts +60 -2
  12. package/console/dist/server/models/GovernanceProjectionCollector.js +323 -285
  13. package/console/dist/server/models/PrincipleClassifier.d.ts +1 -1
  14. package/console/dist/server/models/PrincipleClassifier.js +7 -4
  15. package/console/dist/server/models/PrinciplesConsoleModel.d.ts +2 -1
  16. package/console/dist/server/models/ReceiptsConsoleModel.d.ts +5 -0
  17. package/console/dist/server/models/ReceiptsConsoleModel.js +140 -13
  18. package/console/dist/server/routes/activations.js +1 -1
  19. package/console/dist/server/routes/failed-tasks.js +28 -11
  20. package/console/dist/server/routes/governance.d.ts +26 -0
  21. package/console/dist/server/routes/governance.js +51 -0
  22. package/console/dist/server/routes/owner-identity.d.ts +31 -0
  23. package/console/dist/server/routes/owner-identity.js +76 -0
  24. package/console/dist/server/routes/update-history.d.ts +5 -0
  25. package/console/dist/server/routes/update-history.js +50 -4
  26. package/console/dist/server/routes/update.js +186 -32
  27. package/console/dist/shared/feedback-channel-ids.d.ts +13 -0
  28. package/console/dist/shared/feedback-channel-ids.js +12 -0
  29. package/console/dist/shared/feedback-contract.d.ts +46 -0
  30. package/console/dist/shared/feedback-contract.js +45 -0
  31. package/console/dist/ui/App.js +1 -1
  32. package/console/dist/ui/api.d.ts +22 -3
  33. package/console/dist/ui/api.js +63 -3
  34. package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.d.ts +6 -0
  35. package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.js +66 -0
  36. package/console/dist/ui/i18n/en.json +198 -2
  37. package/console/dist/ui/i18n/zh-CN.json +196 -0
  38. package/console/dist/ui/pages/activation/ActivationPage.js +14 -2
  39. package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +25 -5
  40. package/console/dist/ui/pages/focus/FocusPage.d.ts +28 -1
  41. package/console/dist/ui/pages/focus/FocusPage.js +128 -15
  42. package/console/dist/ui/pages/principles/PrincipleDetailPage.d.ts +30 -0
  43. package/console/dist/ui/pages/principles/PrincipleDetailPage.js +49 -6
  44. package/console/dist/ui/pages/settings/SettingsPage.js +67 -2
  45. package/console/dist/ui/pages/settings/UpdatePage.js +7 -7
  46. package/console/dist/ui/utils/enum-labels.js +0 -1
  47. package/console/dist/ui/utils/validators.d.ts +53 -21
  48. package/console/dist/ui/utils/validators.js +248 -21
  49. package/console/dist/web/assets/app.css +6 -0
  50. package/console/dist/web/assets/app.js +2721 -1664
  51. package/console/package.json +4 -2
  52. package/core/dist/host/host-adapter.d.ts +1 -1
  53. package/core/dist/host/host-adapter.d.ts.map +1 -1
  54. package/core/dist/host/host-adapter.js +1 -0
  55. package/core/dist/host/host-adapter.js.map +1 -1
  56. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +12 -2
  57. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  58. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +1 -1
  59. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
  60. package/core/dist/runtime-v2/__tests__/governance-experience.test.d.ts +2 -0
  61. package/core/dist/runtime-v2/__tests__/governance-experience.test.d.ts.map +1 -0
  62. package/core/dist/runtime-v2/__tests__/governance-experience.test.js +300 -0
  63. package/core/dist/runtime-v2/__tests__/governance-experience.test.js.map +1 -0
  64. package/core/dist/runtime-v2/__tests__/owner-identity.test.d.ts +2 -0
  65. package/core/dist/runtime-v2/__tests__/owner-identity.test.d.ts.map +1 -0
  66. package/core/dist/runtime-v2/__tests__/owner-identity.test.js +147 -0
  67. package/core/dist/runtime-v2/__tests__/owner-identity.test.js.map +1 -0
  68. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.d.ts +18 -0
  69. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.d.ts.map +1 -0
  70. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.js +303 -0
  71. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.js.map +1 -0
  72. package/core/dist/runtime-v2/__tests__/recovery-actions-log.test.js +40 -0
  73. package/core/dist/runtime-v2/__tests__/recovery-actions-log.test.js.map +1 -1
  74. package/core/dist/runtime-v2/__tests__/status-contract.test.d.ts +2 -0
  75. package/core/dist/runtime-v2/__tests__/status-contract.test.d.ts.map +1 -0
  76. package/core/dist/runtime-v2/__tests__/status-contract.test.js +107 -0
  77. package/core/dist/runtime-v2/__tests__/status-contract.test.js.map +1 -0
  78. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.d.ts +2 -0
  79. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.d.ts.map +1 -0
  80. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.js +104 -0
  81. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.js.map +1 -0
  82. package/core/dist/runtime-v2/activation/__tests__/promotion-readiness-evaluator.test.js +19 -0
  83. package/core/dist/runtime-v2/activation/__tests__/promotion-readiness-evaluator.test.js.map +1 -1
  84. package/core/dist/runtime-v2/activation/__tests__/rulecode-owner-decision-service.test.js +20 -0
  85. package/core/dist/runtime-v2/activation/__tests__/rulecode-owner-decision-service.test.js.map +1 -1
  86. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-safety-store.test.js +40 -0
  87. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-safety-store.test.js.map +1 -1
  88. package/core/dist/runtime-v2/activation/index.d.ts +2 -0
  89. package/core/dist/runtime-v2/activation/index.d.ts.map +1 -1
  90. package/core/dist/runtime-v2/activation/index.js +1 -0
  91. package/core/dist/runtime-v2/activation/index.js.map +1 -1
  92. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.d.ts +30 -0
  93. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.d.ts.map +1 -0
  94. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.js +87 -0
  95. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.js.map +1 -0
  96. package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.d.ts.map +1 -1
  97. package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.js +3 -0
  98. package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.js.map +1 -1
  99. package/core/dist/runtime-v2/activation/promotion-readiness-reader.d.ts +1 -1
  100. package/core/dist/runtime-v2/activation/promotion-readiness-reader.d.ts.map +1 -1
  101. package/core/dist/runtime-v2/activation/promotion-readiness-reader.js +2 -2
  102. package/core/dist/runtime-v2/activation/promotion-readiness-reader.js.map +1 -1
  103. package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.d.ts.map +1 -1
  104. package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.js +18 -9
  105. package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.js.map +1 -1
  106. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js +1 -1
  107. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js.map +1 -1
  108. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js +91 -1
  109. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js.map +1 -1
  110. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +59 -12
  111. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
  112. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +10 -9
  113. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -1
  114. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js +42 -1
  115. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js.map +1 -1
  116. package/core/dist/runtime-v2/adapter/json-extractor.d.ts +25 -0
  117. package/core/dist/runtime-v2/adapter/json-extractor.d.ts.map +1 -1
  118. package/core/dist/runtime-v2/adapter/json-extractor.js +126 -0
  119. package/core/dist/runtime-v2/adapter/json-extractor.js.map +1 -1
  120. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +9 -4
  121. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
  122. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +9 -4
  123. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
  124. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts +5 -1
  125. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -1
  126. package/core/dist/runtime-v2/adapter/output-repair-contract.js +4 -1
  127. package/core/dist/runtime-v2/adapter/output-repair-contract.js.map +1 -1
  128. package/core/dist/runtime-v2/adapter/pi-ai-catalog.d.ts +7 -0
  129. package/core/dist/runtime-v2/adapter/pi-ai-catalog.d.ts.map +1 -0
  130. package/core/dist/runtime-v2/adapter/pi-ai-catalog.js +19 -0
  131. package/core/dist/runtime-v2/adapter/pi-ai-catalog.js.map +1 -0
  132. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +13 -15
  133. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  134. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +104 -37
  135. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  136. package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts +16 -1
  137. package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts.map +1 -1
  138. package/core/dist/runtime-v2/adapter/structured-output-repair.js +38 -6
  139. package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -1
  140. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +1 -1
  141. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -1
  142. package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js +8 -9
  143. package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js.map +1 -1
  144. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +27 -3
  145. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
  146. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.d.ts +11 -0
  147. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.d.ts.map +1 -0
  148. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.js +93 -0
  149. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.js.map +1 -0
  150. package/core/dist/runtime-v2/config/__tests__/pd-config-workspace.test.js +41 -0
  151. package/core/dist/runtime-v2/config/__tests__/pd-config-workspace.test.js.map +1 -1
  152. package/core/dist/runtime-v2/config/index.d.ts +2 -2
  153. package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
  154. package/core/dist/runtime-v2/config/index.js +2 -0
  155. package/core/dist/runtime-v2/config/index.js.map +1 -1
  156. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
  157. package/core/dist/runtime-v2/config/pd-config-agent-binding.js +4 -13
  158. package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
  159. package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
  160. package/core/dist/runtime-v2/config/pd-config-effective.js +14 -7
  161. package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
  162. package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts.map +1 -1
  163. package/core/dist/runtime-v2/config/pd-config-feature-flags.js +5 -12
  164. package/core/dist/runtime-v2/config/pd-config-feature-flags.js.map +1 -1
  165. package/core/dist/runtime-v2/config/pd-config-types.d.ts +8 -0
  166. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  167. package/core/dist/runtime-v2/config/pd-config-types.js +2 -0
  168. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  169. package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
  170. package/core/dist/runtime-v2/config/pd-config-validate.js +48 -3
  171. package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
  172. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js +36 -8
  173. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js.map +1 -1
  174. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js +36 -12
  175. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js.map +1 -1
  176. package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts +22 -8
  177. package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts.map +1 -1
  178. package/core/dist/runtime-v2/core-principles/core-axiom-block.js +28 -13
  179. package/core/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -1
  180. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts +29 -4
  181. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts.map +1 -1
  182. package/core/dist/runtime-v2/core-principles/core-principle-registry.js +68 -33
  183. package/core/dist/runtime-v2/core-principles/core-principle-registry.js.map +1 -1
  184. package/core/dist/runtime-v2/core-principles/index.d.ts +3 -3
  185. package/core/dist/runtime-v2/core-principles/index.d.ts.map +1 -1
  186. package/core/dist/runtime-v2/core-principles/index.js +1 -1
  187. package/core/dist/runtime-v2/core-principles/index.js.map +1 -1
  188. package/core/dist/runtime-v2/evolution/evolution-types.d.ts +2 -1
  189. package/core/dist/runtime-v2/evolution/evolution-types.d.ts.map +1 -1
  190. package/core/dist/runtime-v2/evolution/evolution-types.js.map +1 -1
  191. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.d.ts +2 -0
  192. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.d.ts.map +1 -0
  193. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.js +48 -0
  194. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.js.map +1 -0
  195. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.d.ts +2 -0
  196. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.d.ts.map +1 -0
  197. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.js +46 -0
  198. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.js.map +1 -0
  199. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +86 -31
  200. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  201. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.d.ts +2 -0
  202. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.d.ts.map +1 -0
  203. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.js +83 -0
  204. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.js.map +1 -0
  205. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +19 -1
  206. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  207. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +128 -10
  208. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  209. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts +37 -0
  210. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts.map +1 -0
  211. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +304 -0
  212. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -0
  213. package/core/dist/runtime-v2/feature-flags/index.d.ts +4 -2
  214. package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -1
  215. package/core/dist/runtime-v2/feature-flags/index.js +3 -1
  216. package/core/dist/runtime-v2/feature-flags/index.js.map +1 -1
  217. package/core/dist/runtime-v2/governance-experience-contract.d.ts +468 -0
  218. package/core/dist/runtime-v2/governance-experience-contract.d.ts.map +1 -0
  219. package/core/dist/runtime-v2/governance-experience-contract.js +208 -0
  220. package/core/dist/runtime-v2/governance-experience-contract.js.map +1 -0
  221. package/core/dist/runtime-v2/governance-experience.d.ts +11 -0
  222. package/core/dist/runtime-v2/governance-experience.d.ts.map +1 -0
  223. package/core/dist/runtime-v2/governance-experience.js +276 -0
  224. package/core/dist/runtime-v2/governance-experience.js.map +1 -0
  225. package/core/dist/runtime-v2/index.d.ts +20 -8
  226. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  227. package/core/dist/runtime-v2/index.js +20 -6
  228. package/core/dist/runtime-v2/index.js.map +1 -1
  229. package/core/dist/runtime-v2/internalization/__tests__/artificer-output-retry-flag.test.js +29 -10
  230. package/core/dist/runtime-v2/internalization/__tests__/artificer-output-retry-flag.test.js.map +1 -1
  231. package/core/dist/runtime-v2/owner-identity.d.ts +69 -0
  232. package/core/dist/runtime-v2/owner-identity.d.ts.map +1 -0
  233. package/core/dist/runtime-v2/owner-identity.js +179 -0
  234. package/core/dist/runtime-v2/owner-identity.js.map +1 -0
  235. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  236. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +2 -3
  237. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  238. package/core/dist/runtime-v2/product-telemetry/daily-identity.d.ts +70 -0
  239. package/core/dist/runtime-v2/product-telemetry/daily-identity.d.ts.map +1 -0
  240. package/core/dist/runtime-v2/product-telemetry/daily-identity.js +89 -0
  241. package/core/dist/runtime-v2/product-telemetry/daily-identity.js.map +1 -0
  242. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts +110 -0
  243. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts.map +1 -0
  244. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js +250 -0
  245. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js.map +1 -0
  246. package/core/dist/runtime-v2/pruning-read-model.d.ts +2 -1
  247. package/core/dist/runtime-v2/pruning-read-model.d.ts.map +1 -1
  248. package/core/dist/runtime-v2/pruning-read-model.js.map +1 -1
  249. package/core/dist/runtime-v2/receipt-coverage.d.ts +63 -0
  250. package/core/dist/runtime-v2/receipt-coverage.d.ts.map +1 -0
  251. package/core/dist/runtime-v2/receipt-coverage.js +19 -0
  252. package/core/dist/runtime-v2/receipt-coverage.js.map +1 -0
  253. package/core/dist/runtime-v2/recovery-actions-log.d.ts +7 -0
  254. package/core/dist/runtime-v2/recovery-actions-log.d.ts.map +1 -1
  255. package/core/dist/runtime-v2/recovery-actions-log.js +6 -0
  256. package/core/dist/runtime-v2/recovery-actions-log.js.map +1 -1
  257. package/core/dist/runtime-v2/runtime-protocol.js +1 -1
  258. package/core/dist/runtime-v2/runtime-protocol.js.map +1 -1
  259. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js +17 -1
  260. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js.map +1 -1
  261. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -1
  262. package/core/dist/runtime-v2/store/task/sqlite-task-store.js +10 -0
  263. package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
  264. package/core/dist/runtime-v2/store/task/task-types.d.ts +2 -0
  265. package/core/dist/runtime-v2/store/task/task-types.d.ts.map +1 -1
  266. package/core/dist/runtime-v2/task-status.d.ts +9 -5
  267. package/core/dist/runtime-v2/task-status.d.ts.map +1 -1
  268. package/core/dist/runtime-v2/task-status.js +15 -7
  269. package/core/dist/runtime-v2/task-status.js.map +1 -1
  270. package/core/dist/runtime-v2/types/event-types.d.ts +4 -0
  271. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  272. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  273. package/core/dist/runtime-v2/types/index.d.ts +1 -1
  274. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  275. package/core/dist/runtime-v2/types/index.js +1 -1
  276. package/core/dist/runtime-v2/types/index.js.map +1 -1
  277. package/core/dist/runtime-v2/types/principle-enums.d.ts +3 -2
  278. package/core/dist/runtime-v2/types/principle-enums.d.ts.map +1 -1
  279. package/core/dist/runtime-v2/types/principle-enums.js +11 -5
  280. package/core/dist/runtime-v2/types/principle-enums.js.map +1 -1
  281. package/core/dist/runtime-v2/types/principle-schema.d.ts +1 -1
  282. package/core/dist/runtime-v2/types/principle-tree-store.d.ts +1 -1
  283. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts.map +1 -1
  284. package/core/dist/runtime-v2/utils/cli-process-runner.js +3 -2
  285. package/core/dist/runtime-v2/utils/cli-process-runner.js.map +1 -1
  286. package/core/package.json +4 -5
  287. package/dist/i18n.d.ts.map +1 -1
  288. package/dist/i18n.js +4 -2
  289. package/dist/i18n.js.map +1 -1
  290. package/dist/index.d.ts +2 -0
  291. package/dist/index.d.ts.map +1 -1
  292. package/dist/index.js +47 -11
  293. package/dist/index.js.map +1 -1
  294. package/dist/installer.d.ts +31 -5
  295. package/dist/installer.d.ts.map +1 -1
  296. package/dist/installer.js +472 -161
  297. package/dist/installer.js.map +1 -1
  298. package/dist/installers/codex-host-installer.d.ts.map +1 -1
  299. package/dist/installers/codex-host-installer.js +4 -0
  300. package/dist/installers/codex-host-installer.js.map +1 -1
  301. package/dist/mvp-config.d.ts +10 -0
  302. package/dist/mvp-config.d.ts.map +1 -1
  303. package/dist/mvp-config.js +30 -3
  304. package/dist/mvp-config.js.map +1 -1
  305. package/dist/uninstaller.d.ts +9 -1
  306. package/dist/uninstaller.d.ts.map +1 -1
  307. package/dist/uninstaller.js +103 -23
  308. package/dist/uninstaller.js.map +1 -1
  309. package/dist/update/atomic-file.d.ts +35 -0
  310. package/dist/update/atomic-file.d.ts.map +1 -0
  311. package/dist/update/atomic-file.js +120 -0
  312. package/dist/update/atomic-file.js.map +1 -0
  313. package/dist/update/bootstrap-protocol.d.ts +55 -0
  314. package/dist/update/bootstrap-protocol.d.ts.map +1 -0
  315. package/dist/update/bootstrap-protocol.js +132 -0
  316. package/dist/update/bootstrap-protocol.js.map +1 -0
  317. package/dist/update/channel-metadata.d.ts +28 -0
  318. package/dist/update/channel-metadata.d.ts.map +1 -0
  319. package/dist/update/channel-metadata.js +90 -0
  320. package/dist/update/channel-metadata.js.map +1 -0
  321. package/dist/update/channel-promotion.d.ts +39 -0
  322. package/dist/update/channel-promotion.d.ts.map +1 -0
  323. package/dist/update/channel-promotion.js +55 -0
  324. package/dist/update/channel-promotion.js.map +1 -0
  325. package/dist/update/data-compatibility.d.ts +35 -0
  326. package/dist/update/data-compatibility.d.ts.map +1 -0
  327. package/dist/update/data-compatibility.js +45 -0
  328. package/dist/update/data-compatibility.js.map +1 -0
  329. package/dist/update/install-layout.d.ts +59 -0
  330. package/dist/update/install-layout.d.ts.map +1 -0
  331. package/dist/update/install-layout.js +127 -0
  332. package/dist/update/install-layout.js.map +1 -0
  333. package/dist/update/legacy-migration.d.ts +56 -0
  334. package/dist/update/legacy-migration.d.ts.map +1 -0
  335. package/dist/update/legacy-migration.js +254 -0
  336. package/dist/update/legacy-migration.js.map +1 -0
  337. package/dist/update/product-identity.d.ts +50 -0
  338. package/dist/update/product-identity.d.ts.map +1 -0
  339. package/dist/update/product-identity.js +63 -0
  340. package/dist/update/product-identity.js.map +1 -0
  341. package/dist/update/release-asset-manifest.d.ts +31 -0
  342. package/dist/update/release-asset-manifest.d.ts.map +1 -0
  343. package/dist/update/release-asset-manifest.js +161 -0
  344. package/dist/update/release-asset-manifest.js.map +1 -0
  345. package/dist/update/release-identity.d.ts +33 -0
  346. package/dist/update/release-identity.d.ts.map +1 -0
  347. package/dist/update/release-identity.js +108 -0
  348. package/dist/update/release-identity.js.map +1 -0
  349. package/dist/update/release-manager.d.ts +96 -0
  350. package/dist/update/release-manager.d.ts.map +1 -0
  351. package/dist/update/release-manager.js +253 -0
  352. package/dist/update/release-manager.js.map +1 -0
  353. package/dist/update/release-metadata.d.ts +57 -0
  354. package/dist/update/release-metadata.d.ts.map +1 -0
  355. package/dist/update/release-metadata.js +200 -0
  356. package/dist/update/release-metadata.js.map +1 -0
  357. package/dist/update/release-policy.d.ts +51 -0
  358. package/dist/update/release-policy.d.ts.map +1 -0
  359. package/dist/update/release-policy.js +103 -0
  360. package/dist/update/release-policy.js.map +1 -0
  361. package/dist/update/rollback-policy.d.ts +56 -0
  362. package/dist/update/rollback-policy.d.ts.map +1 -0
  363. package/dist/update/rollback-policy.js +61 -0
  364. package/dist/update/rollback-policy.js.map +1 -0
  365. package/dist/update/transaction-journal.d.ts +121 -0
  366. package/dist/update/transaction-journal.d.ts.map +1 -0
  367. package/dist/update/transaction-journal.js +333 -0
  368. package/dist/update/transaction-journal.js.map +1 -0
  369. package/dist/update/trust-metadata.d.ts +55 -0
  370. package/dist/update/trust-metadata.d.ts.map +1 -0
  371. package/dist/update/trust-metadata.js +170 -0
  372. package/dist/update/trust-metadata.js.map +1 -0
  373. package/dist/update/update-history.d.ts +46 -0
  374. package/dist/update/update-history.d.ts.map +1 -0
  375. package/dist/update/update-history.js +123 -0
  376. package/dist/update/update-history.js.map +1 -0
  377. package/dist/utils/env.d.ts +7 -0
  378. package/dist/utils/env.d.ts.map +1 -1
  379. package/dist/utils/env.js +134 -44
  380. package/dist/utils/env.js.map +1 -1
  381. package/host-runtime/dist/governance-observation-store.d.ts +172 -0
  382. package/host-runtime/dist/governance-observation-store.js +649 -0
  383. package/host-runtime/dist/index.d.ts +6 -0
  384. package/host-runtime/dist/index.js +8 -0
  385. package/host-runtime/dist/product-telemetry/consent-store.d.ts +107 -0
  386. package/host-runtime/dist/product-telemetry/consent-store.js +329 -0
  387. package/host-runtime/dist/product-telemetry/eligibility.d.ts +53 -0
  388. package/host-runtime/dist/product-telemetry/eligibility.js +69 -0
  389. package/host-runtime/dist/product-telemetry/exporter.d.ts +46 -0
  390. package/host-runtime/dist/product-telemetry/exporter.js +71 -0
  391. package/host-runtime/dist/product-telemetry/milestone-readers.d.ts +61 -0
  392. package/host-runtime/dist/product-telemetry/milestone-readers.js +234 -0
  393. package/host-runtime/dist/product-telemetry/service.d.ts +142 -0
  394. package/host-runtime/dist/product-telemetry/service.js +532 -0
  395. package/host-runtime/dist/product-telemetry/workspace-scope.d.ts +38 -0
  396. package/host-runtime/dist/product-telemetry/workspace-scope.js +64 -0
  397. package/host-runtime/package.json +7 -2
  398. package/install-layout/dist/index.d.ts +48 -0
  399. package/install-layout/dist/index.js +81 -0
  400. package/install-layout/dist/index.test.d.ts +1 -0
  401. package/install-layout/dist/index.test.js +34 -0
  402. package/install-layout/package.json +33 -0
  403. package/package.json +16 -6
  404. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.d.ts +9 -0
  405. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.d.ts.map +1 -0
  406. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.js +76 -0
  407. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.js.map +1 -0
  408. package/pd-cli/dist/commands/__tests__/version.test.d.ts +2 -0
  409. package/pd-cli/dist/commands/__tests__/version.test.d.ts.map +1 -0
  410. package/pd-cli/dist/commands/__tests__/version.test.js +134 -0
  411. package/pd-cli/dist/commands/__tests__/version.test.js.map +1 -0
  412. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  413. package/pd-cli/dist/commands/console.js +29 -10
  414. package/pd-cli/dist/commands/console.js.map +1 -1
  415. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
  416. package/pd-cli/dist/commands/pain-record.js +6 -15
  417. package/pd-cli/dist/commands/pain-record.js.map +1 -1
  418. package/pd-cli/dist/commands/runtime-activation.d.ts +29 -0
  419. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
  420. package/pd-cli/dist/commands/runtime-activation.js +70 -31
  421. package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
  422. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  423. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +2 -2
  424. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  425. package/pd-cli/dist/commands/telemetry.d.ts +82 -0
  426. package/pd-cli/dist/commands/telemetry.d.ts.map +1 -0
  427. package/pd-cli/dist/commands/telemetry.js +268 -0
  428. package/pd-cli/dist/commands/telemetry.js.map +1 -0
  429. package/pd-cli/dist/commands/version.d.ts +11 -0
  430. package/pd-cli/dist/commands/version.d.ts.map +1 -0
  431. package/pd-cli/dist/commands/version.js +48 -0
  432. package/pd-cli/dist/commands/version.js.map +1 -0
  433. package/pd-cli/dist/index.js +35 -2
  434. package/pd-cli/dist/index.js.map +1 -1
  435. package/pd-cli/dist/services/version-report.d.ts +44 -0
  436. package/pd-cli/dist/services/version-report.d.ts.map +1 -0
  437. package/pd-cli/dist/services/version-report.js +152 -0
  438. package/pd-cli/dist/services/version-report.js.map +1 -0
  439. package/pd-cli/package.json +3 -2
  440. package/plugin/dist/bundle.js +870 -932
  441. package/plugin/dist/core/init.d.ts +2 -1
  442. package/plugin/dist/core/principle-application-ledger.d.ts +10 -0
  443. package/plugin/dist/core/product-telemetry-trigger.d.ts +14 -0
  444. package/plugin/dist/core/thinking-os-parser.d.ts +5 -2
  445. package/plugin/dist/governance-audit.js +386 -0
  446. package/plugin/dist/hooks/gate-block-helper.d.ts +25 -1
  447. package/plugin/dist/hooks/gate.d.ts +22 -0
  448. package/plugin/dist/openclaw.plugin.json +1 -1
  449. package/plugin/dist/rulehost-evidence.js +832 -0
  450. package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +53 -45
  451. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +1 -1
  452. package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +62 -46
  453. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +1 -1
  454. package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +66 -38
  455. package/plugin/openclaw.plugin.json +1 -1
  456. package/plugin/package.json +1 -1
  457. package/plugin/templates/langs/en/principles/THINKING_OS.md +53 -45
  458. package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +1 -1
  459. package/plugin/templates/langs/zh/principles/THINKING_OS.md +62 -46
  460. package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +1 -1
  461. package/plugin/templates/workspace/.principles/THINKING_OS.md +66 -38
@@ -0,0 +1,48 @@
1
+ export declare const INSTALL_LAYOUT_VERSION: 1;
2
+ export declare const INSTALL_LAYOUT_MODES: readonly ['canonical', 'legacy'];
3
+ export type InstallLayoutMode = (typeof INSTALL_LAYOUT_MODES)[number];
4
+ export declare const INSTALL_HOSTS: readonly ['codex', 'openclaw'];
5
+ export type InstallHost = (typeof INSTALL_HOSTS)[number];
6
+ export interface InstallManifest {
7
+ layoutVersion: typeof INSTALL_LAYOUT_VERSION;
8
+ mode: InstallLayoutMode;
9
+ hosts: InstallHost[];
10
+ }
11
+ export interface InstallLayoutPaths {
12
+ homeDir: string;
13
+ pdDir: string;
14
+ manifest: string;
15
+ runtimeDir: string;
16
+ pluginDir: string;
17
+ installLayoutDir: string;
18
+ coreDir: string;
19
+ hostRuntimeDir: string;
20
+ pdCliDir: string;
21
+ consoleDir: string;
22
+ binDir: string;
23
+ codexDir: string;
24
+ openClawDir: string;
25
+ openClawExtensionDir: string;
26
+ }
27
+ export interface LayoutResolution {
28
+ mode: InstallLayoutMode | 'missing';
29
+ paths: InstallLayoutPaths;
30
+ manifest?: InstallManifest;
31
+ reason?: string;
32
+ nextAction?: string;
33
+ }
34
+ export interface ResolveInstallLayoutOptions {
35
+ homeDir: string;
36
+ manifest?: unknown;
37
+ canonicalRuntimeExists: boolean;
38
+ legacyExtensionExists: boolean;
39
+ }
40
+ export declare function parseInstallManifest(value: unknown): {
41
+ manifest?: InstallManifest;
42
+ error?: string;
43
+ };
44
+ export declare function getInstallLayoutPaths(homeDir: string): InstallLayoutPaths;
45
+ export declare function resolveInstallLayout(options: ResolveInstallLayoutOptions): LayoutResolution;
46
+ export declare function getConsoleServerEntry(paths: InstallLayoutPaths, mode: InstallLayoutMode): string;
47
+ export declare function getConsoleWebIndex(paths: InstallLayoutPaths, mode: InstallLayoutMode): string;
48
+ export declare function getPdCliEntry(paths: InstallLayoutPaths, mode: InstallLayoutMode): string;
@@ -0,0 +1,81 @@
1
+ import * as path from 'node:path';
2
+ export const INSTALL_LAYOUT_VERSION = 1;
3
+ export const INSTALL_LAYOUT_MODES = ['canonical', 'legacy'];
4
+ export const INSTALL_HOSTS = ['codex', 'openclaw'];
5
+ function isRecord(value) {
6
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
7
+ }
8
+ function isHost(value) {
9
+ return typeof value === 'string' && INSTALL_HOSTS.includes(value);
10
+ }
11
+ export function parseInstallManifest(value) {
12
+ if (!isRecord(value))
13
+ return { error: 'install_manifest_malformed: expected an object' };
14
+ if (value.layoutVersion !== INSTALL_LAYOUT_VERSION) {
15
+ return { error: `install_manifest_unsupported_version: ${String(value.layoutVersion)}` };
16
+ }
17
+ if (value.mode !== 'canonical' && value.mode !== 'legacy') {
18
+ return { error: 'install_manifest_malformed: mode must be canonical or legacy' };
19
+ }
20
+ if (!Array.isArray(value.hosts) || value.hosts.length === 0 || !value.hosts.every(isHost)) {
21
+ return { error: 'install_manifest_malformed: hosts must contain codex and/or openclaw' };
22
+ }
23
+ const hosts = [...new Set(value.hosts)];
24
+ return { manifest: { layoutVersion: INSTALL_LAYOUT_VERSION, mode: value.mode, hosts } };
25
+ }
26
+ export function getInstallLayoutPaths(homeDir) {
27
+ const home = path.resolve(homeDir);
28
+ const pdDir = path.join(home, '.pd');
29
+ const runtimeDir = path.join(pdDir, 'runtime');
30
+ const openClawDir = path.join(home, '.openclaw');
31
+ return {
32
+ homeDir: home,
33
+ pdDir,
34
+ manifest: path.join(pdDir, 'install.json'),
35
+ runtimeDir,
36
+ pluginDir: path.join(runtimeDir, 'plugin'),
37
+ installLayoutDir: path.join(runtimeDir, 'install-layout'),
38
+ coreDir: path.join(runtimeDir, 'core'),
39
+ hostRuntimeDir: path.join(runtimeDir, 'host-runtime'),
40
+ pdCliDir: path.join(runtimeDir, 'pd-cli'),
41
+ consoleDir: path.join(runtimeDir, 'console'),
42
+ binDir: path.join(runtimeDir, 'bin'),
43
+ codexDir: path.join(pdDir, 'codex'),
44
+ openClawDir,
45
+ openClawExtensionDir: path.join(openClawDir, 'extensions', 'principles-disciple'),
46
+ };
47
+ }
48
+ export function resolveInstallLayout(options) {
49
+ const paths = getInstallLayoutPaths(options.homeDir);
50
+ const parsed = parseInstallManifest(options.manifest);
51
+ if (parsed.manifest && parsed.manifest.mode === 'canonical' && options.canonicalRuntimeExists) {
52
+ return { mode: 'canonical', paths, manifest: parsed.manifest };
53
+ }
54
+ if (options.legacyExtensionExists) {
55
+ return {
56
+ mode: 'legacy',
57
+ paths,
58
+ ...(parsed.manifest ? { manifest: parsed.manifest } : {}),
59
+ reason: parsed.error ?? 'install_layout_legacy_fallback',
60
+ nextAction: 'Run the installer update to migrate the shared runtime to ~/.pd/runtime.',
61
+ };
62
+ }
63
+ return {
64
+ mode: 'missing',
65
+ paths,
66
+ reason: parsed.error ?? 'install_runtime_missing',
67
+ nextAction: 'Run npx create-principles-disciple to install or repair PD.',
68
+ };
69
+ }
70
+ export function getConsoleServerEntry(paths, mode) {
71
+ const root = mode === 'canonical' ? paths.consoleDir : path.join(paths.openClawExtensionDir, 'console');
72
+ return path.join(root, 'dist', 'server.js');
73
+ }
74
+ export function getConsoleWebIndex(paths, mode) {
75
+ const root = mode === 'canonical' ? paths.consoleDir : path.join(paths.openClawExtensionDir, 'console');
76
+ return path.join(root, 'dist', 'web', 'index.html');
77
+ }
78
+ export function getPdCliEntry(paths, mode) {
79
+ const root = mode === 'canonical' ? paths.pdCliDir : path.join(paths.openClawExtensionDir, 'pd-cli');
80
+ return path.join(root, 'dist', 'index.js');
81
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { getInstallLayoutPaths, getConsoleServerEntry, parseInstallManifest, resolveInstallLayout } from './index.js';
3
+ describe('install layout', () => {
4
+ it('resolves a canonical Codex-only install without OpenClaw', () => {
5
+ const paths = getInstallLayoutPaths('C:/Users/alice');
6
+ const result = resolveInstallLayout({
7
+ homeDir: 'C:/Users/alice',
8
+ manifest: { layoutVersion: 1, mode: 'canonical', hosts: ['codex'] },
9
+ canonicalRuntimeExists: true,
10
+ legacyExtensionExists: false,
11
+ });
12
+ expect(result.mode).toBe('canonical');
13
+ expect(result.manifest?.hosts).toEqual(['codex']);
14
+ expect(paths.openClawExtensionDir).toContain('.openclaw');
15
+ expect(paths.pluginDir).toContain('plugin');
16
+ expect(paths.installLayoutDir).toContain('install-layout');
17
+ expect(getConsoleServerEntry(result.paths, 'canonical')).toContain('.pd');
18
+ });
19
+ it('falls back to legacy only when the old extension exists', () => {
20
+ const result = resolveInstallLayout({
21
+ homeDir: '/home/alice',
22
+ manifest: undefined,
23
+ canonicalRuntimeExists: false,
24
+ legacyExtensionExists: true,
25
+ });
26
+ expect(result.mode).toBe('legacy');
27
+ expect(result.nextAction).toContain('migrate');
28
+ });
29
+ it('rejects malformed manifests instead of silently treating them as canonical', () => {
30
+ expect(parseInstallManifest({ layoutVersion: 1, mode: 'canonical', hosts: ['wat'] })).toEqual({
31
+ error: 'install_manifest_malformed: hosts must contain codex and/or openclaw',
32
+ });
33
+ });
34
+ });
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@principles/install-layout",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/csuzngjh/principles.git"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "test": "npm run build && vitest run"
27
+ },
28
+ "devDependencies": {
29
+ "@types/node": "^26.1.2",
30
+ "typescript": "^7.0.2",
31
+ "vitest": "^4.1.10"
32
+ }
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.121.7",
3
+ "version": "1.121.9",
4
4
  "description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,6 +13,7 @@
13
13
  "console",
14
14
  "core",
15
15
  "host-runtime",
16
+ "install-layout",
16
17
  "README.md",
17
18
  "LICENSE"
18
19
  ],
@@ -20,9 +21,15 @@
20
21
  "build": "tsc",
21
22
  "dev": "tsc --watch",
22
23
  "bundle": "node scripts/bundle-plugin.mjs",
24
+ "build:release-asset": "node scripts/build-self-contained-release.mjs",
25
+ "generate:release-locks": "node scripts/generate-release-locks.mjs",
26
+ "check:release-locks": "node scripts/check-release-locks.mjs",
23
27
  "prepack": "npm run build && npm run bundle",
24
28
  "prepublishOnly": "npm run build && npm run bundle",
25
- "test": "vitest run"
29
+ "test": "vitest run",
30
+ "test:fast": "vitest run --exclude tests/smoke-packaged-install.test.ts --exclude tests/release-asset-smoke.test.ts",
31
+ "test:smoke:packaged": "vitest run tests/smoke-packaged-install.test.ts",
32
+ "test:smoke:release-asset": "vitest run tests/release-asset-smoke.test.ts"
26
33
  },
27
34
  "keywords": [
28
35
  "openclaw",
@@ -34,14 +41,17 @@
34
41
  "author": "csuzngjh",
35
42
  "license": "MIT",
36
43
  "dependencies": {
44
+ "@principles/install-layout": "0.1.0",
45
+ "@tufjs/models": "3.0.1",
37
46
  "@inquirer/prompts": "^8.5.2",
38
47
  "commander": "^14.0.3",
39
48
  "fs-extra": "^11.4.0",
40
- "js-yaml": "^5.2.0",
49
+ "js-yaml": "^5.3.0",
41
50
  "ora": "^9.4.0",
42
51
  "picocolors": "^1.0.0",
43
52
  "semver": "^7.8.5",
44
- "tar": "^7.5.15"
53
+ "tar": "^7.5.22",
54
+ "tuf-js": "3.1.0"
45
55
  },
46
56
  "devDependencies": {
47
57
  "@types/fs-extra": "^11.0.4",
@@ -54,7 +64,7 @@
54
64
  "vitest": "^4.1.10"
55
65
  },
56
66
  "engines": {
57
- "node": ">=18.0.0"
67
+ "node": ">=22.0.0"
58
68
  },
59
69
  "repository": {
60
70
  "type": "git",
@@ -62,6 +72,6 @@
62
72
  "directory": "packages/create-principles-disciple"
63
73
  },
64
74
  "pd": {
65
- "bundledPluginVersion": "1.221.2"
75
+ "bundledPluginVersion": "1.222.5"
66
76
  }
67
77
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * pd telemetry — parser-level flag wiring tests (PRI-597, CLI Operator Gate
3
+ * rule 7 / EP-04).
4
+ *
5
+ * Exercises the real Commander tree via registerTelemetryCommand; actions are
6
+ * captured so no handler logic runs.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=telemetry-flag-wiring.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-flag-wiring.test.d.ts","sourceRoot":"","sources":["../../../src/commands/__tests__/telemetry-flag-wiring.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * pd telemetry — parser-level flag wiring tests (PRI-597, CLI Operator Gate
3
+ * rule 7 / EP-04).
4
+ *
5
+ * Exercises the real Commander tree via registerTelemetryCommand; actions are
6
+ * captured so no handler logic runs.
7
+ */
8
+ import { describe, it, expect } from 'vitest';
9
+ import { Command } from 'commander';
10
+ import { registerTelemetryCommand } from '../telemetry.js';
11
+ function freshProgram() {
12
+ const program = new Command();
13
+ program.name('pd').exitOverride();
14
+ return program;
15
+ }
16
+ function requireCmd(cmd, name) {
17
+ if (cmd === undefined) {
18
+ throw new Error(`Command '${name}' not found in tree`);
19
+ }
20
+ return cmd;
21
+ }
22
+ function telemetrySub(name) {
23
+ const program = freshProgram();
24
+ registerTelemetryCommand(program);
25
+ const telemetry = requireCmd(program.commands.find((c) => c.name() === 'telemetry'), 'telemetry');
26
+ return requireCmd(telemetry.commands.find((c) => c.name() === name), `telemetry ${name}`);
27
+ }
28
+ describe('pd telemetry — command registration', () => {
29
+ it('registers the telemetry group with all five subcommands', () => {
30
+ const program = freshProgram();
31
+ registerTelemetryCommand(program);
32
+ const telemetry = requireCmd(program.commands.find((c) => c.name() === 'telemetry'), 'telemetry');
33
+ const subNames = telemetry.commands.map((c) => c.name()).sort();
34
+ expect(subNames).toEqual(['disable', 'enable', 'preview', 'reset', 'status']);
35
+ });
36
+ it('status registers --workspace (-w) and --json', () => {
37
+ const status = telemetrySub('status');
38
+ expect(status.options.find((o) => o.long === '--workspace')?.short).toBe('-w');
39
+ expect(status.options.find((o) => o.long === '--json')).toBeDefined();
40
+ });
41
+ it('enable/disable/reset register the dry-run/confirm pair (cli-4) plus --workspace and --json', () => {
42
+ for (const name of ['enable', 'disable', 'reset']) {
43
+ const cmd = telemetrySub(name);
44
+ expect(cmd.options.find((o) => o.long === '--dry-run'), name).toBeDefined();
45
+ expect(cmd.options.find((o) => o.long === '--confirm'), name).toBeDefined();
46
+ expect(cmd.options.find((o) => o.long === '--workspace'), name).toBeDefined();
47
+ expect(cmd.options.find((o) => o.long === '--json'), name).toBeDefined();
48
+ }
49
+ });
50
+ it('preview registers --workspace (-w) and --json', () => {
51
+ const preview = telemetrySub('preview');
52
+ expect(preview.options.find((o) => o.long === '--workspace')?.short).toBe('-w');
53
+ expect(preview.options.find((o) => o.long === '--json')).toBeDefined();
54
+ });
55
+ it('parser dispatches telemetry enable with --confirm as opts.confirm === true', async () => {
56
+ const program = freshProgram();
57
+ registerTelemetryCommand(program);
58
+ const holder = { opts: null };
59
+ const telemetry = requireCmd(program.commands.find((c) => c.name() === 'telemetry'), 'telemetry');
60
+ const enable = requireCmd(telemetry.commands.find((c) => c.name() === 'enable'), 'enable');
61
+ enable.action((...args) => {
62
+ for (let i = args.length - 1; i >= 0; i--) {
63
+ const arg = args[i];
64
+ if (arg !== null && typeof arg === 'object' && !(arg instanceof Command)) {
65
+ holder.opts = arg;
66
+ break;
67
+ }
68
+ }
69
+ });
70
+ await program.parseAsync(['node', 'pd', 'telemetry', 'enable', '--confirm', '--json']);
71
+ expect(holder.opts).not.toBeNull();
72
+ expect(holder.opts?.confirm).toBe(true);
73
+ expect(holder.opts?.json).toBe(true);
74
+ });
75
+ });
76
+ //# sourceMappingURL=telemetry-flag-wiring.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-flag-wiring.test.js","sourceRoot":"","sources":["../../../src/commands/__tests__/telemetry-flag-wiring.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,SAAS,YAAY;IACnB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;IAClC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAA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I,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,YAAY,OAAO,CAAC,EAAE,CAAC;oBACzE,MAAM,CAAC,IAAI,GAAG,GAA8B,CAAC;oBAC7C,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;QACvF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=version.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.test.d.ts","sourceRoot":"","sources":["../../../src/commands/__tests__/version.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,134 @@
1
+ import * as fs from 'node:fs';
2
+ import * as os from 'node:os';
3
+ import * as path from 'node:path';
4
+ import { afterEach, describe, expect, it } from 'vitest';
5
+ import { buildVersionReport, formatShortVersion, VersionReportError } from '../../services/version-report.js';
6
+ const temporaryDirectories = [];
7
+ function tempHome() {
8
+ const root = fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), 'pd-version-'));
9
+ temporaryDirectories.push(root);
10
+ return root;
11
+ }
12
+ function writeDualSlotHome(home) {
13
+ const pdHome = path.join(home, '.pd');
14
+ fs.mkdirSync(path.join(pdHome, 'releases', 'b'.repeat(64), 'plugin'), { recursive: true });
15
+ fs.mkdirSync(path.join(pdHome, 'bootstrap'), { recursive: true });
16
+ fs.mkdirSync(path.join(pdHome, 'logs'), { recursive: true });
17
+ fs.writeFileSync(path.join(pdHome, 'active.json'), JSON.stringify({
18
+ schemaVersion: 1,
19
+ generation: 4,
20
+ releaseId: 'b'.repeat(64),
21
+ releaseMetadataDigest: '2'.repeat(64),
22
+ previousReleaseId: 'a'.repeat(64),
23
+ transactionId: 'txn-9',
24
+ productVersion: '1.223.0',
25
+ }));
26
+ fs.writeFileSync(path.join(pdHome, 'bootstrap', 'bootstrap.json'), JSON.stringify({
27
+ bootstrapVersion: '1.1.0',
28
+ installedAt: '2026-08-25T00:00:00Z',
29
+ }));
30
+ fs.writeFileSync(path.join(pdHome, 'install.json'), JSON.stringify({ channel: 'candidate', autoCheck: true }));
31
+ fs.writeFileSync(path.join(pdHome, 'releases', 'b'.repeat(64), 'metadata.json'), JSON.stringify({
32
+ productVersion: '1.223.0',
33
+ releaseId: 'b'.repeat(64),
34
+ metadataDigest: '2'.repeat(64),
35
+ }));
36
+ fs.writeFileSync(path.join(pdHome, 'releases', 'b'.repeat(64), 'plugin', 'package.json'), JSON.stringify({ version: '1.76.1' }));
37
+ fs.writeFileSync(path.join(pdHome, 'logs', 'history.jsonl'), [
38
+ JSON.stringify({ at: '2026-08-24T00:00:00Z', kind: 'update', outcome: 'succeeded', transactionId: 'txn-8' }),
39
+ JSON.stringify({ at: '2026-08-25T00:00:00Z', kind: 'recovery', outcome: 'recovered', transactionId: 'txn-9' }),
40
+ ].join('\n') + '\n');
41
+ }
42
+ afterEach(() => {
43
+ while (temporaryDirectories.length > 0) {
44
+ const directory = temporaryDirectories.pop();
45
+ if (directory)
46
+ fs.rmSync(directory, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 });
47
+ }
48
+ });
49
+ describe('canonical version report (SPEC 12 / 18-1, 18-10)', () => {
50
+ it('reports the canonical product identity from ~/.pd, not package.json', () => {
51
+ const home = tempHome();
52
+ writeDualSlotHome(home);
53
+ const report = buildVersionReport(home);
54
+ expect(report).toMatchObject({
55
+ productVersion: '1.223.0',
56
+ releaseId: 'b'.repeat(64),
57
+ bootstrapVersion: '1.1.0',
58
+ channel: 'candidate',
59
+ source: 'official-installer',
60
+ generation: 4,
61
+ health: 'healthy',
62
+ });
63
+ expect(report.components.plugin).toBe('1.76.1');
64
+ expect(report.lastTransaction).toEqual({ id: 'txn-9', kind: 'recovery', outcome: 'recovered' });
65
+ expect(formatShortVersion(report)).toBe(`Principles Disciple 1.223.0 (${'b'.repeat(12)})`);
66
+ });
67
+ it('classifies a legacy overlay installation with an installer next action', () => {
68
+ const home = tempHome();
69
+ // The current official installer creates ~/.pd/bin before the transactional
70
+ // dual-slot layout is activated. That support directory must not make a
71
+ // valid legacy overlay look like a corrupt partial dual-slot install.
72
+ fs.mkdirSync(path.join(home, '.pd', 'bin'), { recursive: true });
73
+ const overlay = path.join(home, '.openclaw', 'extensions', 'principles-disciple');
74
+ fs.mkdirSync(overlay, { recursive: true });
75
+ fs.writeFileSync(path.join(overlay, 'package.json'), JSON.stringify({ version: '1.218.0' }));
76
+ const report = buildVersionReport(home);
77
+ expect(report).toMatchObject({
78
+ productVersion: '1.218.0',
79
+ source: 'official-legacy-overlay',
80
+ health: 'degraded',
81
+ generation: 0,
82
+ });
83
+ });
84
+ it('retains compatibility with the older nested legacy overlay manifest', () => {
85
+ const home = tempHome();
86
+ const overlay = path.join(home, '.openclaw', 'extensions', 'principles-disciple', 'plugin');
87
+ fs.mkdirSync(overlay, { recursive: true });
88
+ fs.writeFileSync(path.join(overlay, 'package.json'), JSON.stringify({ version: '1.202.0' }));
89
+ expect(buildVersionReport(home)).toMatchObject({
90
+ productVersion: '1.202.0', source: 'official-legacy-overlay', health: 'degraded',
91
+ });
92
+ });
93
+ it('refuses with a structured reason and next action when nothing is installed', () => {
94
+ const home = tempHome();
95
+ try {
96
+ buildVersionReport(home);
97
+ throw new Error('expected VersionReportError');
98
+ }
99
+ catch (error) {
100
+ expect(error).toBeInstanceOf(VersionReportError);
101
+ const refusal = error;
102
+ expect(refusal.reason).toBe('not_installed');
103
+ expect(refusal.nextAction).toMatch(/official installer/i);
104
+ }
105
+ });
106
+ it('reports degraded health when the active release directory is incomplete', () => {
107
+ const home = tempHome();
108
+ writeDualSlotHome(home);
109
+ fs.rmSync(path.join(home, '.pd', 'releases', 'b'.repeat(64), 'metadata.json'), { force: true });
110
+ const report = buildVersionReport(home);
111
+ expect(report.health).toBe('degraded');
112
+ });
113
+ it('reports corrupt health when release metadata exists but disagrees with active.json', () => {
114
+ const home = tempHome();
115
+ writeDualSlotHome(home);
116
+ fs.writeFileSync(path.join(home, '.pd', 'releases', 'b'.repeat(64), 'metadata.json'), '{}');
117
+ const report = buildVersionReport(home);
118
+ expect(report.health).toBe('corrupt');
119
+ });
120
+ it('refuses a malformed active record loudly instead of guessing', () => {
121
+ const home = tempHome();
122
+ fs.mkdirSync(path.join(home, '.pd'), { recursive: true });
123
+ fs.writeFileSync(path.join(home, '.pd', 'active.json'), JSON.stringify({ generation: 'four' }));
124
+ try {
125
+ buildVersionReport(home);
126
+ throw new Error('expected VersionReportError');
127
+ }
128
+ catch (error) {
129
+ expect(error).toBeInstanceOf(VersionReportError);
130
+ expect(error.reason).toBe('active_record_corrupt');
131
+ }
132
+ });
133
+ });
134
+ //# sourceMappingURL=version.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.test.js","sourceRoot":"","sources":["../../../src/commands/__tests__/version.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,Q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AkB,CAAC,IAAI,CAAC,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;YACjD,MAAM,CAAE,KAA4B,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/commands/console.ts"],"names":[],"mappings":"AAiBA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AASD,wBAAsB,aAAa,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmH5E;AAID;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAubpF"}
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/commands/console.ts"],"names":[],"mappings":"AAwBA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAuBD,wBAAsB,aAAa,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoH5E;AAID;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwbpF"}
@@ -2,6 +2,7 @@ import * as path from 'path';
2
2
  import * as fs from 'fs';
3
3
  import { spawn } from 'child_process';
4
4
  import { resolveWorkspaceDir } from '../resolve-workspace.js';
5
+ import { getConsoleServerEntry, getConsoleWebIndex, getInstallLayoutPaths, resolveInstallLayout, } from '@principles/install-layout';
5
6
  import { planConsoleLaunch, openBrowser, isLoopbackHost, normalizeLoopbackHost, probeConsoleHealth, } from '../services/console-launcher.js';
6
7
  function sleep(ms) {
7
8
  return new Promise((res) => setTimeout(res, ms));
@@ -10,15 +11,31 @@ function getConsoleDir() {
10
11
  const homeDir = process.env.HOME || process.env.USERPROFILE;
11
12
  if (!homeDir)
12
13
  return null;
13
- const consoleDir = path.join(homeDir, '.openclaw', 'extensions', 'principles-disciple', 'console');
14
- return fs.existsSync(consoleDir) ? consoleDir : null;
14
+ const paths = getInstallLayoutPaths(homeDir);
15
+ let manifest;
16
+ try {
17
+ manifest = JSON.parse(fs.readFileSync(paths.manifest, 'utf8'));
18
+ }
19
+ catch {
20
+ manifest = undefined;
21
+ }
22
+ const resolved = resolveInstallLayout({
23
+ homeDir,
24
+ manifest,
25
+ canonicalRuntimeExists: fs.existsSync(paths.runtimeDir),
26
+ legacyExtensionExists: fs.existsSync(paths.openClawExtensionDir),
27
+ });
28
+ if (resolved.mode === 'missing')
29
+ return null;
30
+ const dir = resolved.mode === 'canonical' ? paths.consoleDir : path.join(paths.openClawExtensionDir, 'console');
31
+ return { dir, mode: resolved.mode };
15
32
  }
16
33
  export async function handleConsole(opts = {}) {
17
34
  const workspaceDir = opts.workspace
18
35
  ? path.resolve(opts.workspace)
19
36
  : resolveWorkspaceDir();
20
- const consoleDir = getConsoleDir();
21
- if (!consoleDir) {
37
+ const consoleLocation = getConsoleDir();
38
+ if (!consoleLocation) {
22
39
  const msg = 'pd-console is not installed. Run: npx create-principles-disciple to install.';
23
40
  if (opts.json) {
24
41
  console.log(JSON.stringify({ success: false, reason: msg, nextAction: 'npx create-principles-disciple' }));
@@ -29,7 +46,8 @@ export async function handleConsole(opts = {}) {
29
46
  process.exit(1);
30
47
  return;
31
48
  }
32
- const serverEntry = path.join(consoleDir, 'dist', 'server.js');
49
+ const paths = getInstallLayoutPaths(process.env.HOME || process.env.USERPROFILE || '.');
50
+ const serverEntry = getConsoleServerEntry(paths, consoleLocation.mode);
33
51
  if (!fs.existsSync(serverEntry)) {
34
52
  const msg = `Console server entry not found at ${serverEntry}. Re-run installer.`;
35
53
  if (opts.json) {
@@ -43,7 +61,7 @@ export async function handleConsole(opts = {}) {
43
61
  }
44
62
  // EP-06 regression guard (PR #1169): verify web UI bundle exists before launch.
45
63
  // Without dist/web/index.html the server returns 404 "Run npm run build:ui first".
46
- const webIndex = path.join(consoleDir, 'dist', 'web', 'index.html');
64
+ const webIndex = getConsoleWebIndex(paths, consoleLocation.mode);
47
65
  if (!fs.existsSync(webIndex)) {
48
66
  const msg = `Console web UI not found at ${webIndex}. The console bundle is corrupted. Re-run installer.`;
49
67
  if (opts.json) {
@@ -244,8 +262,8 @@ export async function handleConsoleOpen(opts = {}) {
244
262
  }
245
263
  }
246
264
  // 3) Check that the console runtime is installed (ERR-040: fail loud if missing)
247
- const consoleDir = getConsoleDir();
248
- if (!consoleDir) {
265
+ const consoleLocation = getConsoleDir();
266
+ if (!consoleLocation) {
249
267
  const result = {
250
268
  status: 'failed',
251
269
  url: '',
@@ -267,7 +285,8 @@ export async function handleConsoleOpen(opts = {}) {
267
285
  process.exit(1);
268
286
  return;
269
287
  }
270
- const serverEntry = path.join(consoleDir, 'dist', 'server.js');
288
+ const paths = getInstallLayoutPaths(process.env.HOME || process.env.USERPROFILE || '.');
289
+ const serverEntry = getConsoleServerEntry(paths, consoleLocation.mode);
271
290
  if (!fs.existsSync(serverEntry)) {
272
291
  const result = {
273
292
  status: 'failed',
@@ -293,7 +312,7 @@ export async function handleConsoleOpen(opts = {}) {
293
312
  // EP-06 regression guard (PR #1169): verify web UI bundle exists before launch.
294
313
  // Without dist/web/index.html the server returns 404 "Run npm run build:ui first"
295
314
  // — a fatal first-impression bug for new users.
296
- const webIndex = path.join(consoleDir, 'dist', 'web', 'index.html');
315
+ const webIndex = getConsoleWebIndex(paths, consoleLocation.mode);
297
316
  if (!fs.existsSync(webIndex)) {
298
317
  const result = {
299
318
  status: 'failed',