create-principles-disciple 1.73.0 → 1.75.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 (272) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +24 -0
  3. package/console/dist/server/index.js +13 -1
  4. package/console/dist/server/routes/agents.js +3 -118
  5. package/console/dist/server/routes/update-history.d.ts +12 -0
  6. package/console/dist/server/routes/update-history.js +52 -0
  7. package/console/dist/server/routes/update.d.ts +10 -0
  8. package/console/dist/server/routes/update.js +435 -0
  9. package/console/dist/ui/App.js +2 -1
  10. package/console/dist/ui/components/UpdateBanner.d.ts +1 -0
  11. package/console/dist/ui/components/UpdateBanner.js +41 -0
  12. package/console/dist/ui/components/UpdateProgressDialog.d.ts +12 -0
  13. package/console/dist/ui/components/UpdateProgressDialog.js +28 -0
  14. package/console/dist/ui/i18n/en.json +0 -1
  15. package/console/dist/ui/i18n/zh-CN.json +0 -1
  16. package/console/dist/ui/pages/AgentsPage.js +3 -17
  17. package/console/dist/ui/pages/TasksPage.js +0 -1
  18. package/console/dist/ui/pages/UpdatePage.d.ts +1 -0
  19. package/console/dist/ui/pages/UpdatePage.js +142 -0
  20. package/console/dist/web/assets/app.css +7 -0
  21. package/console/dist/web/assets/app.js +456 -173
  22. package/console/package.json +2 -0
  23. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts +2 -0
  24. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts.map +1 -0
  25. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js +270 -0
  26. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js.map +1 -0
  27. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +1 -1
  28. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  29. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +4 -3
  30. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  31. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts +13 -0
  32. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts.map +1 -0
  33. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js +266 -0
  34. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js.map +1 -0
  35. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +3 -7
  36. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -1
  37. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js +7 -19
  38. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js.map +1 -1
  39. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +97 -15
  40. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +1 -1
  41. package/core/dist/runtime-v2/diagnostician-output.d.ts +0 -10
  42. package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
  43. package/core/dist/runtime-v2/diagnostician-output.js +5 -10
  44. package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
  45. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +6 -1
  46. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
  47. package/core/dist/runtime-v2/diagnostician-prompt-builder.js +23 -15
  48. package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
  49. package/dist/index.js +0 -0
  50. package/dist/installer.d.ts.map +1 -1
  51. package/dist/installer.js +67 -0
  52. package/dist/installer.js.map +1 -1
  53. package/dist/uninstaller.d.ts +0 -5
  54. package/dist/uninstaller.d.ts.map +1 -1
  55. package/dist/uninstaller.js +53 -8
  56. package/dist/uninstaller.js.map +1 -1
  57. package/dist/updater.d.ts +45 -0
  58. package/dist/updater.d.ts.map +1 -0
  59. package/dist/updater.js +333 -0
  60. package/dist/updater.js.map +1 -0
  61. package/dist/utils/env.d.ts +6 -0
  62. package/dist/utils/env.d.ts.map +1 -1
  63. package/dist/utils/env.js +54 -0
  64. package/dist/utils/env.js.map +1 -1
  65. package/package.json +6 -2
  66. package/pd-cli/dist/index.js +4 -1
  67. package/pd-cli/dist/index.js.map +1 -1
  68. package/pd-cli/package.json +2 -2
  69. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +2 -2
  70. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +2 -2
  71. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts +0 -2
  72. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts.map +0 -1
  73. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js +0 -215
  74. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js.map +0 -1
  75. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts +0 -2
  76. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts.map +0 -1
  77. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js +0 -92
  78. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js.map +0 -1
  79. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts +0 -2
  80. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts.map +0 -1
  81. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js +0 -134
  82. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js.map +0 -1
  83. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts +0 -2
  84. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts.map +0 -1
  85. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js +0 -226
  86. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js.map +0 -1
  87. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts +0 -3
  88. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts.map +0 -1
  89. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.js +0 -5
  90. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.js.map +0 -1
  91. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts +0 -4
  92. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts.map +0 -1
  93. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.js +0 -81
  94. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.js.map +0 -1
  95. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts +0 -29
  96. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts.map +0 -1
  97. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.js +0 -15
  98. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.js.map +0 -1
  99. package/core/dist/runtime-v2/idle-trigger/index.d.ts +0 -5
  100. package/core/dist/runtime-v2/idle-trigger/index.d.ts.map +0 -1
  101. package/core/dist/runtime-v2/idle-trigger/index.js +0 -4
  102. package/core/dist/runtime-v2/idle-trigger/index.js.map +0 -1
  103. package/core/dist/runtime-v2/nocturnal/candidate-scoring.d.ts +0 -486
  104. package/core/dist/runtime-v2/nocturnal/candidate-scoring.d.ts.map +0 -1
  105. package/core/dist/runtime-v2/nocturnal/candidate-scoring.js +0 -493
  106. package/core/dist/runtime-v2/nocturnal/candidate-scoring.js.map +0 -1
  107. package/core/dist/runtime-v2/nocturnal/index.d.ts +0 -9
  108. package/core/dist/runtime-v2/nocturnal/index.d.ts.map +0 -1
  109. package/core/dist/runtime-v2/nocturnal/index.js +0 -5
  110. package/core/dist/runtime-v2/nocturnal/index.js.map +0 -1
  111. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts +0 -185
  112. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts.map +0 -1
  113. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.js +0 -912
  114. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.js.map +0 -1
  115. package/core/dist/runtime-v2/nocturnal/snapshot-contract.d.ts +0 -192
  116. package/core/dist/runtime-v2/nocturnal/snapshot-contract.d.ts.map +0 -1
  117. package/core/dist/runtime-v2/nocturnal/snapshot-contract.js +0 -185
  118. package/core/dist/runtime-v2/nocturnal/snapshot-contract.js.map +0 -1
  119. package/core/dist/runtime-v2/nocturnal/trinity-types.d.ts +0 -421
  120. package/core/dist/runtime-v2/nocturnal/trinity-types.d.ts.map +0 -1
  121. package/core/dist/runtime-v2/nocturnal/trinity-types.js +0 -182
  122. package/core/dist/runtime-v2/nocturnal/trinity-types.js.map +0 -1
  123. package/pd-cli/dist/commands/runtime-idle-trigger.d.ts +0 -12
  124. package/pd-cli/dist/commands/runtime-idle-trigger.d.ts.map +0 -1
  125. package/pd-cli/dist/commands/runtime-idle-trigger.js +0 -102
  126. package/pd-cli/dist/commands/runtime-idle-trigger.js.map +0 -1
  127. package/plugin/dist/bundle.js +0 -2424
  128. package/plugin/dist/core/trajectory/index.js +0 -1804
  129. package/plugin/dist/openclaw.plugin.json +0 -65
  130. package/plugin/dist/templates/langs/en/core/AGENTS.md +0 -205
  131. package/plugin/dist/templates/langs/en/core/BOOT.md +0 -60
  132. package/plugin/dist/templates/langs/en/core/BOOTSTRAP.md +0 -273
  133. package/plugin/dist/templates/langs/en/core/HEARTBEAT.md +0 -74
  134. package/plugin/dist/templates/langs/en/core/IDENTITY.md +0 -8
  135. package/plugin/dist/templates/langs/en/core/PRINCIPLES.md +0 -10
  136. package/plugin/dist/templates/langs/en/core/SOUL.md +0 -46
  137. package/plugin/dist/templates/langs/en/core/TOOLS.md +0 -15
  138. package/plugin/dist/templates/langs/en/core/USER.md +0 -10
  139. package/plugin/dist/templates/langs/en/pain/00_seed_samples.md +0 -23
  140. package/plugin/dist/templates/langs/en/pain_dictionary.json +0 -22
  141. package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +0 -64
  142. package/plugin/dist/templates/langs/en/skills/admin/SKILL.md +0 -39
  143. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/EXAMPLES.md +0 -63
  144. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/REFERENCE.md +0 -136
  145. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/SKILL.md +0 -67
  146. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/agent-registry.json +0 -143
  147. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +0 -107
  148. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +0 -107
  149. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +0 -95
  150. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +0 -98
  151. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +0 -58
  152. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +0 -190
  153. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +0 -2
  154. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +0 -310
  155. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +0 -683
  156. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +0 -604
  157. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +0 -32
  158. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +0 -707
  159. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/run.mjs +0 -3455
  160. package/plugin/dist/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
  161. package/plugin/dist/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
  162. package/plugin/dist/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
  163. package/plugin/dist/templates/langs/en/skills/evolve-system/SKILL.md +0 -46
  164. package/plugin/dist/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
  165. package/plugin/dist/templates/langs/en/skills/feedback/SKILL.md +0 -51
  166. package/plugin/dist/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
  167. package/plugin/dist/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
  168. package/plugin/dist/templates/langs/en/skills/manage-okr/SKILL.md +0 -96
  169. package/plugin/dist/templates/langs/en/skills/pd-auditor/SKILL.md +0 -61
  170. package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +0 -67
  171. package/plugin/dist/templates/langs/en/skills/pd-daily/SKILL.md +0 -199
  172. package/plugin/dist/templates/langs/en/skills/pd-diagnostician/SKILL.md +0 -466
  173. package/plugin/dist/templates/langs/en/skills/pd-explorer/SKILL.md +0 -65
  174. package/plugin/dist/templates/langs/en/skills/pd-grooming/SKILL.md +0 -46
  175. package/plugin/dist/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
  176. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +0 -230
  177. package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +0 -30
  178. package/plugin/dist/templates/langs/en/skills/pd-planner/SKILL.md +0 -65
  179. package/plugin/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -61
  180. package/plugin/dist/templates/langs/en/skills/plan-script/SKILL.md +0 -32
  181. package/plugin/dist/templates/langs/en/skills/profile/SKILL.md +0 -24
  182. package/plugin/dist/templates/langs/en/skills/reflection/SKILL.md +0 -40
  183. package/plugin/dist/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
  184. package/plugin/dist/templates/langs/en/skills/report/SKILL.md +0 -13
  185. package/plugin/dist/templates/langs/en/skills/root-cause/SKILL.md +0 -33
  186. package/plugin/dist/templates/langs/en/skills/triage/SKILL.md +0 -29
  187. package/plugin/dist/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
  188. package/plugin/dist/templates/langs/zh/core/AGENTS.md +0 -197
  189. package/plugin/dist/templates/langs/zh/core/BOOT.md +0 -60
  190. package/plugin/dist/templates/langs/zh/core/BOOTSTRAP.md +0 -273
  191. package/plugin/dist/templates/langs/zh/core/HEARTBEAT.md +0 -98
  192. package/plugin/dist/templates/langs/zh/core/IDENTITY.md +0 -8
  193. package/plugin/dist/templates/langs/zh/core/PRINCIPLES.md +0 -7
  194. package/plugin/dist/templates/langs/zh/core/SOUL.md +0 -46
  195. package/plugin/dist/templates/langs/zh/core/TOOLS.md +0 -15
  196. package/plugin/dist/templates/langs/zh/core/USER.md +0 -10
  197. package/plugin/dist/templates/langs/zh/pain/00_seed_samples.md +0 -24
  198. package/plugin/dist/templates/langs/zh/pain_dictionary.json +0 -18
  199. package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +0 -64
  200. package/plugin/dist/templates/langs/zh/skills/admin/SKILL.md +0 -41
  201. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/EXAMPLES.md +0 -63
  202. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/REFERENCE.md +0 -136
  203. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/SKILL.md +0 -67
  204. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/agent-registry.json +0 -143
  205. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +0 -107
  206. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +0 -107
  207. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/nocturnal-trinity-quality-enhancement.json +0 -111
  208. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +0 -95
  209. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +0 -98
  210. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +0 -58
  211. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +0 -190
  212. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +0 -2
  213. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +0 -310
  214. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +0 -683
  215. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +0 -604
  216. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +0 -32
  217. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +0 -707
  218. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/run.mjs +0 -3455
  219. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/archive.test.mjs +0 -230
  220. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/contract-enforcement.test.mjs +0 -672
  221. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/decision.test.mjs +0 -1321
  222. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/run.test.mjs +0 -1435
  223. package/plugin/dist/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
  224. package/plugin/dist/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
  225. package/plugin/dist/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
  226. package/plugin/dist/templates/langs/zh/skills/evolve-system/SKILL.md +0 -46
  227. package/plugin/dist/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
  228. package/plugin/dist/templates/langs/zh/skills/feedback/SKILL.md +0 -53
  229. package/plugin/dist/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
  230. package/plugin/dist/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
  231. package/plugin/dist/templates/langs/zh/skills/manage-okr/SKILL.md +0 -109
  232. package/plugin/dist/templates/langs/zh/skills/pd-auditor/SKILL.md +0 -61
  233. package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +0 -67
  234. package/plugin/dist/templates/langs/zh/skills/pd-daily/SKILL.md +0 -283
  235. package/plugin/dist/templates/langs/zh/skills/pd-diagnostician/SKILL.md +0 -391
  236. package/plugin/dist/templates/langs/zh/skills/pd-explorer/SKILL.md +0 -65
  237. package/plugin/dist/templates/langs/zh/skills/pd-grooming/SKILL.md +0 -46
  238. package/plugin/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
  239. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -230
  240. package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +0 -30
  241. package/plugin/dist/templates/langs/zh/skills/pd-planner/SKILL.md +0 -65
  242. package/plugin/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -61
  243. package/plugin/dist/templates/langs/zh/skills/plan-script/SKILL.md +0 -32
  244. package/plugin/dist/templates/langs/zh/skills/profile/SKILL.md +0 -24
  245. package/plugin/dist/templates/langs/zh/skills/reflection/SKILL.md +0 -40
  246. package/plugin/dist/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
  247. package/plugin/dist/templates/langs/zh/skills/report/SKILL.md +0 -13
  248. package/plugin/dist/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
  249. package/plugin/dist/templates/langs/zh/skills/triage/SKILL.md +0 -29
  250. package/plugin/dist/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
  251. package/plugin/dist/templates/pain_dictionary.json +0 -36
  252. package/plugin/dist/templates/pain_settings.json +0 -103
  253. package/plugin/dist/templates/workspace/.principles/DECISION_POLICY.json +0 -44
  254. package/plugin/dist/templates/workspace/.principles/PRINCIPLES.md +0 -20
  255. package/plugin/dist/templates/workspace/.principles/PROFILE.json +0 -54
  256. package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +0 -56
  257. package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +0 -64
  258. package/plugin/dist/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +0 -7
  259. package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
  260. package/plugin/dist/templates/workspace/.principles/models/_INDEX.md +0 -27
  261. package/plugin/dist/templates/workspace/.principles/models/first_principles.md +0 -62
  262. package/plugin/dist/templates/workspace/.principles/models/marketing_4p.md +0 -52
  263. package/plugin/dist/templates/workspace/.principles/models/porter_five.md +0 -63
  264. package/plugin/dist/templates/workspace/.principles/models/swot.md +0 -60
  265. package/plugin/dist/templates/workspace/.principles/models/user_story_map.md +0 -63
  266. package/plugin/dist/templates/workspace/.state/WORKBOARD.json +0 -4
  267. package/plugin/dist/templates/workspace/AUDIT.md +0 -15
  268. package/plugin/dist/templates/workspace/PLAN.md +0 -2
  269. package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +0 -57
  270. package/plugin/dist/templates/workspace/okr/RECOVERY_PROTOCOL.md +0 -56
  271. package/plugin/dist/templates/workspace/okr/TASK_CHANGES.jsonl +0 -6
  272. package/plugin/dist/templates/workspace/okr/WEEK_TASKS.json +0 -6
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Principles Disciple Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Principles Disciple Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -94,6 +94,30 @@ If an update fails, the installer automatically restores the previous working in
94
94
 
95
95
  If the installer cannot restore the backup (rare), re-run the installer with `--force`.
96
96
 
97
+ ## Updating
98
+
99
+ PD supports updating through the Web UI:
100
+
101
+ 1. Open PD Console (http://localhost:3100)
102
+ 2. Navigate to Settings → Update
103
+ 3. Check for updates and review version info
104
+ 4. Click "Update Now" to apply
105
+
106
+ ### Update Options
107
+
108
+ - **Merge Strategy**: How to handle workspace file changes
109
+ - `smart`: Generate .update files for manual merge
110
+ - `overwrite`: Force overwrite workspace files
111
+ - `keep`: Keep existing workspace files unchanged
112
+ - **Backup**: Create backup before update (recommended for rollback support)
113
+
114
+ ### API Endpoints
115
+
116
+ - `GET /api/update/check` — Check for available updates
117
+ - `POST /api/update/apply` — Apply an update
118
+ - `GET /api/update/status` — Get current update status
119
+ - `POST /api/update/rollback` — Rollback to previous version
120
+
97
121
  ## Commands
98
122
 
99
123
  - `install` — Install PD (default command)
@@ -20,6 +20,8 @@ import { handlePrinciplesRoute, disposePrinciplesModels } from './routes/princip
20
20
  import { createWorkspacesRoutes } from './routes/workspaces.js';
21
21
  import { createCentralRoutes } from './routes/central.js';
22
22
  import { handleAgentsRoute, disposeAgentModels } from './routes/agents.js';
23
+ import { handleUpdateRoute } from './routes/update.js';
24
+ import { handleUpdateHistoryRoute } from './routes/update-history.js';
23
25
  import { handleStateRoute } from './routes/state.js';
24
26
  import { sendJson, sendSuccess, sendError, sendNotFound, sendUnauthorized } from './utils/response.js';
25
27
  import { parseDiagnosticianOutput, parseDiagnosticInput, parseSeverityFromDiagnostic, parseReasonSummaryFromDiagnostic, parseRecommendationKind } from './utils/diagnostic-parser.js';
@@ -344,6 +346,17 @@ function handleRequest(services) {
344
346
  asyncHandler(() => handleAgentsRoute(req, res, services.workspaceDir, subPath))(req, res);
345
347
  return;
346
348
  }
349
+ // GET /api/update/history (MUST be before update catch-all)
350
+ if (urlPath === '/api/update/history') {
351
+ asyncHandler(() => handleUpdateHistoryRoute(req, res, services.workspaceDir, ''))(req, res);
352
+ return;
353
+ }
354
+ // Update routes: GET /api/update/check, POST /api/update/apply, GET /api/update/status, POST /api/update/rollback
355
+ if (urlPath === '/api/update' || urlPath.startsWith('/api/update/')) {
356
+ const subPath = urlPath.slice('/api/update'.length);
357
+ asyncHandler(() => handleUpdateRoute(req, res, services.workspaceDir, subPath))(req, res);
358
+ return;
359
+ }
347
360
  // GET /api/v1/state, /api/v1/state/:taskId
348
361
  if (urlPath === '/api/v1/state' || urlPath.startsWith('/api/v1/state/')) {
349
362
  const subPath = urlPath.slice('/api/v1/state'.length);
@@ -448,7 +461,6 @@ function handleRequest(services) {
448
461
  principle_candidate_intake: '原则候选录入',
449
462
  dreamer: '深度反思',
450
463
  keyword_optimization: '关键词优化',
451
- sleep_reflection: '夜间反思',
452
464
  };
453
465
  return {
454
466
  id: t.taskId,
@@ -15,7 +15,7 @@ const AGENT_REGISTRY = [
15
15
  taskKind: null,
16
16
  prompt: 'N/A - Heartbeat-driven scheduler, no LLM prompt',
17
17
  tools: ['processCompilationBackfill', 'processEvolutionQueue', 'processDetectionQueue', 'sweepExpiredWorkflows', 'runWorkflowWatchdog'],
18
- subAgents: ['nocturnal-reflection', 'correction-observer'],
18
+ subAgents: ['correction-observer'],
19
19
  },
20
20
  {
21
21
  id: 'diagnostician',
@@ -30,58 +30,6 @@ const AGENT_REGISTRY = [
30
30
  tools: ['PainSignalBridge', 'DiagnosticianRunner', 'SqliteContextAssembler'],
31
31
  subAgents: [],
32
32
  },
33
- {
34
- id: 'nocturnal-reflection',
35
- name: 'Nocturnal Reflection',
36
- nameZh: '夜间反思',
37
- description: 'Deep reflection pipeline that runs Trinity (Dreamer→Philosopher→Scribe) to generate high-quality decision alternatives',
38
- descriptionZh: '深度反思管线,运行 Trinity(梦想家→哲学家→书记员)生成高质量决策替代方案',
39
- icon: 'Moon',
40
- category: 'reflector',
41
- taskKind: 'sleep_reflection',
42
- prompt: 'Nocturnal Dreamer — Candidate Generation\nNocturnal Philosopher — 6D Scoring & Risk Ranking\nNocturnal Scribe — Tournament Selection & Comparative Analysis',
43
- tools: ['NocturnalTargetSelector', 'NocturnalTrajectoryExtractor', 'TrinityRunner', 'NocturnalArbiter', 'NocturnalExecutability', 'NocturnalArtificer'],
44
- subAgents: ['trinity-dreamer', 'trinity-philosopher', 'trinity-scribe'],
45
- },
46
- {
47
- id: 'trinity-dreamer',
48
- name: 'Trinity Dreamer',
49
- nameZh: 'Trinity 梦想家',
50
- description: 'Generates 2-3 candidate correction alternatives from session trajectory analysis',
51
- descriptionZh: '从会话轨迹分析中生成 2-3 个候选纠正方案',
52
- icon: 'Sparkles',
53
- category: 'sub-process',
54
- taskKind: null,
55
- prompt: 'You are a principles analyst specializing in identifying decision alternatives.\nYour task is to analyze a session trajectory and generate 2-3 candidate corrections.\nOutput: {"valid": true, "candidates": [...]}',
56
- tools: ['runEmbeddedPiAgent'],
57
- subAgents: [],
58
- },
59
- {
60
- id: 'trinity-philosopher',
61
- name: 'Trinity Philosopher',
62
- nameZh: 'Trinity 哲学家',
63
- description: 'Evaluates and ranks candidates using 6-dimensional scoring and risk assessment',
64
- descriptionZh: '使用 6 维评分和风险评估对候选方案进行评估和排名',
65
- icon: 'Scale',
66
- category: 'sub-process',
67
- taskKind: null,
68
- prompt: 'You are a principles philosopher.\nEvaluate candidates against existing principles.\nScore each on 6 dimensions: correctness, specificity, actionability, non-redundancy, safety, generalizability.',
69
- tools: ['runEmbeddedPiAgent'],
70
- subAgents: [],
71
- },
72
- {
73
- id: 'trinity-scribe',
74
- name: 'Trinity Scribe',
75
- nameZh: 'Trinity 书记员',
76
- description: 'Performs tournament selection and produces the final structured artifact draft',
77
- descriptionZh: '执行锦标赛选择,产出最终结构化 artifact 草稿',
78
- icon: 'PenTool',
79
- category: 'sub-process',
80
- taskKind: null,
81
- prompt: 'You are a principles scribe.\nPerform tournament selection among ranked candidates.\nProduce a final structured artifact with comparative analysis.',
82
- tools: ['runEmbeddedPiAgent'],
83
- subAgents: [],
84
- },
85
33
  {
86
34
  id: 'correction-observer',
87
35
  name: 'Correction Observer',
@@ -281,66 +229,7 @@ class AgentConsoleModel {
281
229
  db?.close();
282
230
  }
283
231
  }
284
- getTrinitySubAgentStatus(agentId, workflows) {
285
- const stageMap = {
286
- 'trinity-dreamer': 'dreamer',
287
- 'trinity-philosopher': 'philosopher',
288
- 'trinity-scribe': 'scribe',
289
- };
290
- const stage = stageMap[agentId];
291
- if (!stage)
292
- return { status: 'unknown', lastRunAt: null };
293
- const stageOrder = ['dreamer', 'philosopher', 'scribe'];
294
- const stageIndex = stageOrder.indexOf(stage);
295
- for (const wf of workflows) {
296
- if (wf.workflow_type !== 'nocturnal')
297
- continue;
298
- const eventStates = this.getStageEvents(wf.workflow_id);
299
- const stageEvent = eventStates[stage];
300
- if (stageEvent === 'failed') {
301
- return { status: 'failed', lastRunAt: new Date(wf.updated_at).toISOString() };
302
- }
303
- if (stageEvent === 'completed') {
304
- return { status: 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
305
- }
306
- for (let i = stageOrder.length - 1; i >= 0; i--) {
307
- const s = stageOrder[i];
308
- if (eventStates[s] === 'completed') {
309
- if (i === stageIndex)
310
- return { status: 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
311
- if (i > stageIndex)
312
- return { status: 'running', lastRunAt: new Date(wf.updated_at).toISOString() };
313
- return { status: 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
314
- }
315
- if (eventStates[s] === 'running' || eventStates[s] === 'started') {
316
- if (i === stageIndex)
317
- return { status: 'running', lastRunAt: new Date(wf.updated_at).toISOString() };
318
- if (i < stageIndex)
319
- return { status: 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
320
- return { status: 'running', lastRunAt: new Date(wf.updated_at).toISOString() };
321
- }
322
- }
323
- if (wf.state === 'active' || wf.state === 'pending') {
324
- if (stageIndex === 0)
325
- return { status: 'running', lastRunAt: new Date(wf.updated_at).toISOString() };
326
- return { status: 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
327
- }
328
- if (wf.state === 'completed') {
329
- return { status: 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
330
- }
331
- if (wf.state === 'terminal_error') {
332
- if (eventStates.dreamer === 'failed') {
333
- return { status: stageIndex === 0 ? 'failed' : 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
334
- }
335
- if (eventStates.philosopher === 'failed') {
336
- return { status: stageIndex <= 1 ? (stageIndex === 1 ? 'failed' : 'idle') : 'idle', lastRunAt: new Date(wf.updated_at).toISOString() };
337
- }
338
- return { status: 'failed', lastRunAt: new Date(wf.updated_at).toISOString() };
339
- }
340
- }
341
- return { status: 'unknown', lastRunAt: null };
342
- }
343
- async buildAgentInfo(agent, allTasks, workflows) {
232
+ async buildAgentInfo(agent, allTasks, _workflows) {
344
233
  let status = 'unknown';
345
234
  let lastRunAt = null;
346
235
  let lastStatus = null;
@@ -350,7 +239,7 @@ class AgentConsoleModel {
350
239
  if (agent.id === 'evolution-worker') {
351
240
  const workerStatus = this.getEvolutionWorkerStatus();
352
241
  ({ status, lastRunAt } = workerStatus);
353
- const queueTasks = allTasks.filter(t => t.taskKind === 'diagnostician' || t.taskKind === 'sleep_reflection' || t.taskKind === 'keyword_optimization');
242
+ const queueTasks = allTasks.filter(t => t.taskKind === 'diagnostician' || t.taskKind === 'keyword_optimization');
354
243
  recentTaskCount = queueTasks.length;
355
244
  failedTaskCount = queueTasks.filter(t => t.status === 'failed').length;
356
245
  if (queueTasks.length > 0) {
@@ -376,10 +265,6 @@ class AgentConsoleModel {
376
265
  status = 'idle';
377
266
  }
378
267
  }
379
- else if (agent.id === 'trinity-dreamer' || agent.id === 'trinity-philosopher' || agent.id === 'trinity-scribe') {
380
- const subStatus = this.getTrinitySubAgentStatus(agent.id, workflows);
381
- ({ status, lastRunAt } = subStatus);
382
- }
383
268
  else if (agent.id === 'pain-diagnostic-gate') {
384
269
  status = 'idle';
385
270
  }
@@ -0,0 +1,12 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ interface UpdateHistoryEntry {
3
+ id: string;
4
+ timestamp: string;
5
+ fromVersion: string;
6
+ toVersion: string;
7
+ success: boolean;
8
+ backupPath?: string;
9
+ }
10
+ export declare function appendUpdateHistory(workspaceDir: string, entry: Omit<UpdateHistoryEntry, 'id' | 'timestamp'>): void;
11
+ export declare function handleUpdateHistoryRoute(req: IncomingMessage, res: ServerResponse, workspaceDir: string, _subPath: string): Promise<void>;
12
+ export {};
@@ -0,0 +1,52 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { sendSuccess, sendMethodNotAllowed } from '../utils/response.js';
4
+ function getHistoryPath(workspaceDir) {
5
+ return path.join(workspaceDir, '.pd', 'update-history.json');
6
+ }
7
+ function loadHistory(historyPath) {
8
+ if (fs.existsSync(historyPath)) {
9
+ try {
10
+ const raw = fs.readFileSync(historyPath, 'utf-8');
11
+ const parsed = JSON.parse(raw);
12
+ if (Array.isArray(parsed)) {
13
+ return parsed.filter((e) => typeof e === 'object' && e !== null &&
14
+ typeof e.fromVersion === 'string' &&
15
+ typeof e.toVersion === 'string' &&
16
+ typeof e.success === 'boolean');
17
+ }
18
+ }
19
+ catch (err) {
20
+ console.warn(`[update-history] Failed to parse update history file (${historyPath}):`, err instanceof Error ? err.message : err);
21
+ }
22
+ }
23
+ return [];
24
+ }
25
+ export function appendUpdateHistory(workspaceDir, entry) {
26
+ const historyPath = getHistoryPath(workspaceDir);
27
+ const history = loadHistory(historyPath);
28
+ history.push({
29
+ ...entry,
30
+ id: `update-${Date.now()}`,
31
+ timestamp: new Date().toISOString(),
32
+ });
33
+ // Keep last 50 entries
34
+ if (history.length > 50) {
35
+ history.splice(0, history.length - 50);
36
+ }
37
+ const dir = path.dirname(historyPath);
38
+ if (!fs.existsSync(dir)) {
39
+ fs.mkdirSync(dir, { recursive: true });
40
+ }
41
+ fs.writeFileSync(historyPath, JSON.stringify(history, null, 2));
42
+ }
43
+ /* eslint-disable @typescript-eslint/max-params */
44
+ export async function handleUpdateHistoryRoute(req, res, workspaceDir, _subPath) {
45
+ if (req.method !== 'GET') {
46
+ sendMethodNotAllowed(res);
47
+ return;
48
+ }
49
+ const historyPath = getHistoryPath(workspaceDir);
50
+ const history = loadHistory(historyPath);
51
+ sendSuccess(res, history);
52
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Update API — provides backend for the Web UI update feature.
3
+ *
4
+ * GET /check — Check for updates
5
+ * POST /apply — Apply an update
6
+ * GET /status — Get current update status
7
+ * POST /rollback — Rollback an update
8
+ */
9
+ import type { IncomingMessage, ServerResponse } from 'node:http';
10
+ export declare function handleUpdateRoute(req: IncomingMessage, res: ServerResponse, workspaceDir: string, subPath: string): Promise<void>;