create-principles-disciple 1.104.0 → 1.104.2

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 (1234) hide show
  1. package/README.md +2 -2
  2. package/console/dist/server/config/pd-config-store.d.ts +8 -1
  3. package/console/dist/server/config/pd-config-store.js +50 -0
  4. package/console/dist/server/index.js +24 -3
  5. package/console/dist/server/models/HealthCheckModel.d.ts +27 -0
  6. package/console/dist/server/models/HealthCheckModel.js +56 -0
  7. package/console/dist/server/routes/failed-tasks.d.ts +24 -0
  8. package/console/dist/server/routes/failed-tasks.js +207 -0
  9. package/console/dist/server/routes/feedback-reports.d.ts +1 -0
  10. package/console/dist/server/routes/feedback-reports.js +29 -2
  11. package/console/dist/server/routes/lifecycle.js +19 -1
  12. package/console/dist/server/routes/onboarding.js +2 -2
  13. package/console/dist/server/routes/update.js +307 -35
  14. package/console/dist/server/utils/gateway.d.ts +25 -0
  15. package/console/dist/server/utils/gateway.js +131 -0
  16. package/console/dist/ui/App.d.ts +1 -1
  17. package/console/dist/ui/App.js +2 -1
  18. package/console/dist/ui/api.d.ts +2 -1
  19. package/console/dist/ui/api.js +14 -2
  20. package/console/dist/ui/components/auth/login-form.d.ts +2 -1
  21. package/console/dist/ui/components/auth/splash-screen.d.ts +2 -1
  22. package/console/dist/ui/components/error-boundary.d.ts +1 -1
  23. package/console/dist/ui/components/focus/daily-thought-card.d.ts +1 -1
  24. package/console/dist/ui/components/language-switcher.d.ts +2 -1
  25. package/console/dist/ui/components/layout/app-sidebar.d.ts +6 -1
  26. package/console/dist/ui/components/layout/app-sidebar.js +10 -2
  27. package/console/dist/ui/components/layout/page-loading.d.ts +1 -1
  28. package/console/dist/ui/components/layout/page-shell.d.ts +1 -1
  29. package/console/dist/ui/components/layout/section-title.d.ts +1 -1
  30. package/console/dist/ui/components/notifications/NotificationProvider.d.ts +1 -1
  31. package/console/dist/ui/components/onboarding/CircuitDiagram.d.ts +1 -1
  32. package/console/dist/ui/components/onboarding/DemoResultView.d.ts +1 -1
  33. package/console/dist/ui/components/onboarding/SlashCommandsCard.d.ts +16 -0
  34. package/console/dist/ui/components/onboarding/SlashCommandsCard.js +20 -0
  35. package/console/dist/ui/components/onboarding/slashCommands.d.ts +20 -0
  36. package/console/dist/ui/components/onboarding/slashCommands.js +23 -0
  37. package/console/dist/ui/components/theme-provider.d.ts +1 -1
  38. package/console/dist/ui/components/theme-toggle.d.ts +2 -1
  39. package/console/dist/ui/components/ui/alert-dialog.d.ts +8 -8
  40. package/console/dist/ui/components/ui/badge.d.ts +2 -2
  41. package/console/dist/ui/components/ui/button.d.ts +2 -2
  42. package/console/dist/ui/components/ui/charts.d.ts +5 -5
  43. package/console/dist/ui/components/ui/dialog.d.ts +8 -8
  44. package/console/dist/ui/components/ui/markdown.d.ts +4 -4
  45. package/console/dist/ui/components/ui/progress-bar.d.ts +2 -2
  46. package/console/dist/ui/components/ui/sheet.d.ts +9 -9
  47. package/console/dist/ui/components/ui/shiny-text.d.ts +1 -1
  48. package/console/dist/ui/components/ui/skeleton.d.ts +1 -1
  49. package/console/dist/ui/components/ui/sonner.d.ts +1 -1
  50. package/console/dist/ui/i18n/en.json +52 -7
  51. package/console/dist/ui/i18n/zh-CN.json +52 -7
  52. package/console/dist/ui/pages/ReportProblemValidators.d.ts +63 -0
  53. package/console/dist/ui/pages/ReportProblemValidators.js +238 -0
  54. package/console/dist/ui/pages/activation/ActivationPage.d.ts +1 -1
  55. package/console/dist/ui/pages/activation/ActivationPage.js +1 -1
  56. package/console/dist/ui/pages/control-center/AgentCard.d.ts +1 -1
  57. package/console/dist/ui/pages/control-center/AgentCard.js +1 -1
  58. package/console/dist/ui/pages/control-center/AgentGroup.d.ts +1 -1
  59. package/console/dist/ui/pages/control-center/ControlCenterPage.d.ts +1 -1
  60. package/console/dist/ui/pages/control-center/ControlCenterPage.js +1 -1
  61. package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.d.ts +1 -1
  62. package/console/dist/ui/pages/control-center/RuntimeProfileManager.d.ts +1 -1
  63. package/console/dist/ui/pages/control-center/RuntimeProfileManager.js +1 -1
  64. package/console/dist/ui/pages/control-center/WorkflowDiagram.d.ts +1 -1
  65. package/console/dist/ui/pages/debt/DebtPage.d.ts +2 -1
  66. package/console/dist/ui/pages/debt/DebtPage.js +1 -1
  67. package/console/dist/ui/pages/design-system/DesignSystemPage.d.ts +2 -1
  68. package/console/dist/ui/pages/failed-tasks/FailedTasksPage.d.ts +1 -0
  69. package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +229 -0
  70. package/console/dist/ui/pages/focus/FocusPage.d.ts +1 -1
  71. package/console/dist/ui/pages/focus/FocusPage.js +2 -2
  72. package/console/dist/ui/pages/intent/IntentOnboarding.d.ts +4 -4
  73. package/console/dist/ui/pages/intent/IntentOnboarding.js +1 -1
  74. package/console/dist/ui/pages/intent/IntentPage.d.ts +1 -1
  75. package/console/dist/ui/pages/intent/IntentPage.js +1 -1
  76. package/console/dist/ui/pages/pain/PainPage.d.ts +1 -1
  77. package/console/dist/ui/pages/pain/PainPage.js +1 -1
  78. package/console/dist/ui/pages/principles/PrincipleDetailPage.d.ts +1 -1
  79. package/console/dist/ui/pages/principles/PrincipleDetailPage.js +1 -1
  80. package/console/dist/ui/pages/principles/PrinciplesPage.d.ts +1 -1
  81. package/console/dist/ui/pages/report-problem/ReportProblemPage.d.ts +1 -1
  82. package/console/dist/ui/pages/report-problem/ReportProblemPage.js +36 -9
  83. package/console/dist/ui/pages/settings/SettingsPage.d.ts +1 -1
  84. package/console/dist/ui/pages/settings/SettingsPage.js +1 -1
  85. package/console/dist/ui/pages/settings/UpdatePage.d.ts +1 -1
  86. package/console/dist/ui/pages/settings/UpdatePage.js +35 -3
  87. package/console/dist/ui/pages/signal-keywords/KeywordEditDialog.d.ts +1 -1
  88. package/console/dist/ui/pages/signal-keywords/KeywordListSection.d.ts +1 -1
  89. package/console/dist/ui/pages/signal-keywords/PendingTermsSection.d.ts +1 -1
  90. package/console/dist/ui/pages/signal-keywords/SignalKeywordsPage.d.ts +1 -1
  91. package/console/dist/ui/pages/welcome/WelcomePage.d.ts +1 -1
  92. package/console/dist/ui/pages/welcome/WelcomePage.js +7 -5
  93. package/console/dist/ui/utils/agent-metadata.js +9 -9
  94. package/console/dist/ui/utils/validators.d.ts +14 -2
  95. package/console/dist/ui/utils/validators.js +18 -1
  96. package/console/dist/web/assets/app.css +428 -716
  97. package/console/dist/web/assets/app.js +1574 -877
  98. package/console/package.json +14 -14
  99. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.d.ts +2 -0
  100. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.d.ts.map +1 -0
  101. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.js +346 -0
  102. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.js.map +1 -0
  103. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.d.ts +2 -0
  104. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.d.ts.map +1 -0
  105. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.js +290 -0
  106. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.js.map +1 -0
  107. package/core/dist/adapters/__tests__/writing-pain-adapter.test.d.ts +2 -0
  108. package/core/dist/adapters/__tests__/writing-pain-adapter.test.d.ts.map +1 -0
  109. package/core/dist/adapters/__tests__/writing-pain-adapter.test.js +239 -0
  110. package/core/dist/adapters/__tests__/writing-pain-adapter.test.js.map +1 -0
  111. package/core/dist/adapters/code-review/code-review-pain-adapter.d.ts.map +1 -1
  112. package/core/dist/adapters/coding/openclaw-pain-adapter.d.ts.map +1 -1
  113. package/core/dist/adapters/writing/writing-pain-adapter.d.ts.map +1 -1
  114. package/core/dist/evolution-store.js.map +1 -1
  115. package/core/dist/evolution-store.test.d.ts +2 -0
  116. package/core/dist/evolution-store.test.d.ts.map +1 -0
  117. package/core/dist/evolution-store.test.js +291 -0
  118. package/core/dist/evolution-store.test.js.map +1 -0
  119. package/core/dist/host/__tests__/host-adapter.test.d.ts +2 -0
  120. package/core/dist/host/__tests__/host-adapter.test.d.ts.map +1 -0
  121. package/core/dist/host/__tests__/host-adapter.test.js +96 -0
  122. package/core/dist/host/__tests__/host-adapter.test.js.map +1 -0
  123. package/core/dist/host/host-adapter.d.ts +185 -0
  124. package/core/dist/host/host-adapter.d.ts.map +1 -0
  125. package/core/dist/host/host-adapter.js +81 -0
  126. package/core/dist/host/host-adapter.js.map +1 -0
  127. package/core/dist/host/host-installer.d.ts +165 -0
  128. package/core/dist/host/host-installer.d.ts.map +1 -0
  129. package/core/dist/host/host-installer.js +55 -0
  130. package/core/dist/host/host-installer.js.map +1 -0
  131. package/core/dist/host/index.d.ts +14 -0
  132. package/core/dist/host/index.d.ts.map +1 -0
  133. package/core/dist/host/index.js +3 -0
  134. package/core/dist/host/index.js.map +1 -0
  135. package/core/dist/index.d.ts +2 -0
  136. package/core/dist/index.d.ts.map +1 -1
  137. package/core/dist/index.js +1 -0
  138. package/core/dist/index.js.map +1 -1
  139. package/core/dist/principle-injector.d.ts.map +1 -1
  140. package/core/dist/principle-injector.test.d.ts +2 -0
  141. package/core/dist/principle-injector.test.d.ts.map +1 -0
  142. package/core/dist/principle-injector.test.js +158 -0
  143. package/core/dist/principle-injector.test.js.map +1 -0
  144. package/core/dist/principle-tree-ledger-lifecycle.test.d.ts +2 -0
  145. package/core/dist/principle-tree-ledger-lifecycle.test.d.ts.map +1 -0
  146. package/core/dist/principle-tree-ledger-lifecycle.test.js +530 -0
  147. package/core/dist/principle-tree-ledger-lifecycle.test.js.map +1 -0
  148. package/core/dist/principle-tree-ledger.d.ts.map +1 -1
  149. package/core/dist/principle-tree-ledger.js +55 -30
  150. package/core/dist/principle-tree-ledger.js.map +1 -1
  151. package/core/dist/prompt-builder/__tests__/attitude-directive.test.d.ts +2 -0
  152. package/core/dist/prompt-builder/__tests__/attitude-directive.test.d.ts.map +1 -0
  153. package/core/dist/prompt-builder/__tests__/attitude-directive.test.js +49 -0
  154. package/core/dist/prompt-builder/__tests__/attitude-directive.test.js.map +1 -0
  155. package/core/dist/prompt-builder/__tests__/correction-cue.test.d.ts +2 -0
  156. package/core/dist/prompt-builder/__tests__/correction-cue.test.d.ts.map +1 -0
  157. package/core/dist/prompt-builder/__tests__/correction-cue.test.js +61 -0
  158. package/core/dist/prompt-builder/__tests__/correction-cue.test.js.map +1 -0
  159. package/core/dist/prompt-builder/__tests__/message-extraction.test.d.ts +2 -0
  160. package/core/dist/prompt-builder/__tests__/message-extraction.test.d.ts.map +1 -0
  161. package/core/dist/prompt-builder/__tests__/message-extraction.test.js +90 -0
  162. package/core/dist/prompt-builder/__tests__/message-extraction.test.js.map +1 -0
  163. package/core/dist/prompt-builder/__tests__/minimal-trigger.test.d.ts +2 -0
  164. package/core/dist/prompt-builder/__tests__/minimal-trigger.test.d.ts.map +1 -0
  165. package/core/dist/prompt-builder/__tests__/minimal-trigger.test.js +45 -0
  166. package/core/dist/prompt-builder/__tests__/minimal-trigger.test.js.map +1 -0
  167. package/core/dist/prompt-builder/__tests__/principle-selection.test.js.map +1 -1
  168. package/core/dist/prompt-builder/empathy-keyword-matching.js.map +1 -1
  169. package/core/dist/prompt-builder/empathy-types.js.map +1 -1
  170. package/core/dist/prompt-builder/focus-compression.js.map +1 -1
  171. package/core/dist/prompt-builder/routing-guidance.d.ts +3 -3
  172. package/core/dist/prompt-builder/routing-guidance.d.ts.map +1 -1
  173. package/core/dist/prompt-builder/routing-guidance.js.map +1 -1
  174. package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.js +399 -1
  175. package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.js.map +1 -1
  176. package/core/dist/quality-scorecard/__tests__/report-generator.test.d.ts +2 -0
  177. package/core/dist/quality-scorecard/__tests__/report-generator.test.d.ts.map +1 -0
  178. package/core/dist/quality-scorecard/__tests__/report-generator.test.js +627 -0
  179. package/core/dist/quality-scorecard/__tests__/report-generator.test.js.map +1 -0
  180. package/core/dist/quality-scorecard/types.d.ts +1 -1
  181. package/core/dist/quality-scorecard/types.d.ts.map +1 -1
  182. package/core/dist/runtime-v2/__tests__/admission-gate.test.js.map +1 -1
  183. package/core/dist/runtime-v2/__tests__/adversarial-loop.test.js.map +1 -1
  184. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +317 -6
  185. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  186. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js +839 -0
  187. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js.map +1 -1
  188. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
  189. package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.d.ts +26 -0
  190. package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.d.ts.map +1 -0
  191. package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.js +402 -0
  192. package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.js.map +1 -0
  193. package/core/dist/runtime-v2/__tests__/build-golden-trace-from-artificer.test.js.map +1 -1
  194. package/core/dist/runtime-v2/__tests__/context-payload-validation.test.d.ts +11 -0
  195. package/core/dist/runtime-v2/__tests__/context-payload-validation.test.d.ts.map +1 -0
  196. package/core/dist/runtime-v2/__tests__/context-payload-validation.test.js +309 -0
  197. package/core/dist/runtime-v2/__tests__/context-payload-validation.test.js.map +1 -0
  198. package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.d.ts +25 -0
  199. package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.d.ts.map +1 -0
  200. package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.js +405 -0
  201. package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.js.map +1 -0
  202. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js.map +1 -1
  203. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.js.map +1 -1
  204. package/core/dist/runtime-v2/__tests__/error-categories.test.js +1 -0
  205. package/core/dist/runtime-v2/__tests__/error-categories.test.js.map +1 -1
  206. package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.d.ts +2 -0
  207. package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.d.ts.map +1 -0
  208. package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.js +562 -0
  209. package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.js.map +1 -0
  210. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -1
  211. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js.map +1 -1
  212. package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js.map +1 -1
  213. package/core/dist/runtime-v2/__tests__/feedback/create-report.test.js +51 -0
  214. package/core/dist/runtime-v2/__tests__/feedback/create-report.test.js.map +1 -1
  215. package/core/dist/runtime-v2/__tests__/feedback/privacy-preview.test.js +1 -1
  216. package/core/dist/runtime-v2/__tests__/feedback/privacy-preview.test.js.map +1 -1
  217. package/core/dist/runtime-v2/__tests__/feedback/render-markdown.test.js +1 -1
  218. package/core/dist/runtime-v2/__tests__/feedback/render-markdown.test.js.map +1 -1
  219. package/core/dist/runtime-v2/__tests__/fixtures/test-helpers.js.map +1 -1
  220. package/core/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.js.map +1 -1
  221. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js.map +1 -1
  222. package/core/dist/runtime-v2/__tests__/internalization-consumer-product-path.test.js.map +1 -1
  223. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js +1 -1
  224. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js.map +1 -1
  225. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -1
  226. package/core/dist/runtime-v2/__tests__/internalization-route.test.js +1 -1
  227. package/core/dist/runtime-v2/__tests__/internalization-route.test.js.map +1 -1
  228. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -1
  229. package/core/dist/runtime-v2/__tests__/l1-hard-cap.test.js.map +1 -1
  230. package/core/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.js.map +1 -1
  231. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js.map +1 -1
  232. package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.d.ts +8 -0
  233. package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.d.ts.map +1 -0
  234. package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.js +168 -0
  235. package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.js.map +1 -0
  236. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js +13 -2
  237. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js.map +1 -1
  238. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js.map +1 -1
  239. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -1
  240. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js +150 -0
  241. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js.map +1 -1
  242. package/core/dist/runtime-v2/__tests__/pruning-mask.test.d.ts +25 -0
  243. package/core/dist/runtime-v2/__tests__/pruning-mask.test.d.ts.map +1 -0
  244. package/core/dist/runtime-v2/__tests__/pruning-mask.test.js +281 -0
  245. package/core/dist/runtime-v2/__tests__/pruning-mask.test.js.map +1 -0
  246. package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js +8 -8
  247. package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js.map +1 -1
  248. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -1
  249. package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js.map +1 -1
  250. package/core/dist/runtime-v2/__tests__/schema-version.test.d.ts +19 -0
  251. package/core/dist/runtime-v2/__tests__/schema-version.test.d.ts.map +1 -0
  252. package/core/dist/runtime-v2/__tests__/schema-version.test.js +176 -0
  253. package/core/dist/runtime-v2/__tests__/schema-version.test.js.map +1 -0
  254. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js.map +1 -1
  255. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js +20 -5
  256. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js.map +1 -1
  257. package/core/dist/runtime-v2/__tests__/task-state-semantics.test.js.map +1 -1
  258. package/core/dist/runtime-v2/__tests__/task-three-strikes.test.js.map +1 -1
  259. package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.d.ts +29 -0
  260. package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.d.ts.map +1 -0
  261. package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.js +431 -0
  262. package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.js.map +1 -0
  263. package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.d.ts +2 -0
  264. package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.d.ts.map +1 -0
  265. package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.js +110 -0
  266. package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.js.map +1 -0
  267. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js +109 -0
  268. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js.map +1 -1
  269. package/core/dist/runtime-v2/activation/__tests__/activation-re-dispatch.test.js.map +1 -1
  270. package/core/dist/runtime-v2/activation/__tests__/approval-completion-service.test.js.map +1 -1
  271. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -1
  272. package/core/dist/runtime-v2/activation/__tests__/helpers.js.map +1 -1
  273. package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js.map +1 -1
  274. package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js.map +1 -1
  275. package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts +11 -0
  276. package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts.map +1 -1
  277. package/core/dist/runtime-v2/activation/activation-dispatcher.js +60 -6
  278. package/core/dist/runtime-v2/activation/activation-dispatcher.js.map +1 -1
  279. package/core/dist/runtime-v2/activation/activation-types.d.ts +4 -0
  280. package/core/dist/runtime-v2/activation/activation-types.d.ts.map +1 -1
  281. package/core/dist/runtime-v2/activation/approval-completion-service.d.ts.map +1 -1
  282. package/core/dist/runtime-v2/activation/approval-completion-service.js.map +1 -1
  283. package/core/dist/runtime-v2/activation/approval-queue.d.ts.map +1 -1
  284. package/core/dist/runtime-v2/activation/approval-queue.js.map +1 -1
  285. package/core/dist/runtime-v2/activation/low-risk-writers.d.ts +2 -2
  286. package/core/dist/runtime-v2/activation/low-risk-writers.d.ts.map +1 -1
  287. package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts.map +1 -1
  288. package/core/dist/runtime-v2/activation/memory-approval-store.d.ts.map +1 -1
  289. package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.js.map +1 -1
  290. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -1
  291. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -1
  292. package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -1
  293. package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -1
  294. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -1
  295. package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts +1 -1
  296. package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -1
  297. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js +13 -3
  298. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js.map +1 -1
  299. package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.js +3 -2
  300. package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.js.map +1 -1
  301. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.d.ts +19 -0
  302. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.d.ts.map +1 -0
  303. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.js +188 -0
  304. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.js.map +1 -0
  305. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js +102 -9
  306. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js.map +1 -1
  307. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +51 -23
  308. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
  309. package/core/dist/runtime-v2/adapter/__tests__/principle-tree-ledger-adapter.test.js.map +1 -1
  310. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +1 -1
  311. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -1
  312. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts.map +1 -1
  313. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js +2 -1
  314. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js.map +1 -1
  315. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +1 -1
  316. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
  317. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +2 -2
  318. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
  319. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts.map +1 -1
  320. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js +42 -16
  321. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js.map +1 -1
  322. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts +1 -1
  323. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -1
  324. package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts +36 -0
  325. package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts.map +1 -0
  326. package/core/dist/runtime-v2/adapter/output-schema-registry.js +44 -0
  327. package/core/dist/runtime-v2/adapter/output-schema-registry.js.map +1 -0
  328. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +17 -0
  329. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  330. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +61 -33
  331. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  332. package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
  333. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts.map +1 -1
  334. package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -1
  335. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts.map +1 -1
  336. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js +1 -1
  337. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js.map +1 -1
  338. package/core/dist/runtime-v2/admission-gate.js.map +1 -1
  339. package/core/dist/runtime-v2/agent-spec.d.ts +10 -10
  340. package/core/dist/runtime-v2/agent-spec.d.ts.map +1 -1
  341. package/core/dist/runtime-v2/candidate-intake-service.d.ts.map +1 -1
  342. package/core/dist/runtime-v2/candidate-intake.d.ts +5 -5
  343. package/core/dist/runtime-v2/candidate-intake.d.ts.map +1 -1
  344. package/core/dist/runtime-v2/candidate-intake.js.map +1 -1
  345. package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js +29 -1
  346. package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js.map +1 -1
  347. package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.d.ts +2 -0
  348. package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.d.ts.map +1 -0
  349. package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.js +308 -0
  350. package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.js.map +1 -0
  351. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +5 -4
  352. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
  353. package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js +44 -0
  354. package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js.map +1 -1
  355. package/core/dist/runtime-v2/config/index.d.ts +1 -1
  356. package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
  357. package/core/dist/runtime-v2/config/index.js.map +1 -1
  358. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts +2 -0
  359. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
  360. package/core/dist/runtime-v2/config/pd-config-agent-binding.js +16 -0
  361. package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
  362. package/core/dist/runtime-v2/config/pd-config-defaults.d.ts +2 -2
  363. package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
  364. package/core/dist/runtime-v2/config/pd-config-defaults.js +5 -15
  365. package/core/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
  366. package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
  367. package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
  368. package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts +1 -1
  369. package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts.map +1 -1
  370. package/core/dist/runtime-v2/config/pd-config-types.d.ts +25 -10
  371. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  372. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  373. package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
  374. package/core/dist/runtime-v2/config/pd-config-validate.js +9 -0
  375. package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
  376. package/core/dist/runtime-v2/context-payload.d.ts +8 -8
  377. package/core/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -1
  378. package/core/dist/runtime-v2/detection/__tests__/detection-funnel-policy.test.js.map +1 -1
  379. package/core/dist/runtime-v2/detection/detection-funnel-policy.d.ts.map +1 -1
  380. package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.js +46 -0
  381. package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.js.map +1 -1
  382. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.d.ts +2 -0
  383. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.d.ts.map +1 -1
  384. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.js +29 -2
  385. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.js.map +1 -1
  386. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -1
  387. package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.d.ts.map +1 -1
  388. package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.js.map +1 -1
  389. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
  390. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
  391. package/core/dist/runtime-v2/diagnostician/router-prompt-builder.d.ts.map +1 -1
  392. package/core/dist/runtime-v2/diagnostician/router-prompt-builder.js.map +1 -1
  393. package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
  394. package/core/dist/runtime-v2/diagnostician-output.js +7 -1
  395. package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
  396. package/core/dist/runtime-v2/error-categories.d.ts +2 -2
  397. package/core/dist/runtime-v2/error-categories.d.ts.map +1 -1
  398. package/core/dist/runtime-v2/error-categories.js +4 -1
  399. package/core/dist/runtime-v2/error-categories.js.map +1 -1
  400. package/core/dist/runtime-v2/evidence-triage/__tests__/admission-events.test.js.map +1 -1
  401. package/core/dist/runtime-v2/evidence-triage/__tests__/observation-resolver.test.js.map +1 -1
  402. package/core/dist/runtime-v2/evidence-triage/__tests__/triage-policy.test.js.map +1 -1
  403. package/core/dist/runtime-v2/evidence-triage/trigger-controller.js.map +1 -1
  404. package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.d.ts +15 -0
  405. package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.d.ts.map +1 -0
  406. package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.js +90 -0
  407. package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.js.map +1 -0
  408. package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.d.ts +12 -0
  409. package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.d.ts.map +1 -0
  410. package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.js +114 -0
  411. package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.js.map +1 -0
  412. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +66 -0
  413. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  414. package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.d.ts +8 -0
  415. package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.d.ts.map +1 -0
  416. package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.js +56 -0
  417. package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.js.map +1 -0
  418. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +1 -1
  419. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  420. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +56 -1
  421. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  422. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js.map +1 -1
  423. package/core/dist/runtime-v2/feature-flags/surface-guard-policy.js.map +1 -1
  424. package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.d.ts +2 -0
  425. package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.d.ts.map +1 -0
  426. package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.js +221 -0
  427. package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.js.map +1 -0
  428. package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.d.ts +11 -0
  429. package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.d.ts.map +1 -0
  430. package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.js +160 -0
  431. package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.js.map +1 -0
  432. package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.d.ts +2 -0
  433. package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.d.ts.map +1 -0
  434. package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.js +342 -0
  435. package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.js.map +1 -0
  436. package/core/dist/runtime-v2/feedback/create-report.d.ts +7 -1
  437. package/core/dist/runtime-v2/feedback/create-report.d.ts.map +1 -1
  438. package/core/dist/runtime-v2/feedback/create-report.js +65 -7
  439. package/core/dist/runtime-v2/feedback/create-report.js.map +1 -1
  440. package/core/dist/runtime-v2/feedback/feedback-types.d.ts +18 -1
  441. package/core/dist/runtime-v2/feedback/feedback-types.d.ts.map +1 -1
  442. package/core/dist/runtime-v2/feedback/feedback-types.js +19 -12
  443. package/core/dist/runtime-v2/feedback/feedback-types.js.map +1 -1
  444. package/core/dist/runtime-v2/feedback/index.d.ts +3 -1
  445. package/core/dist/runtime-v2/feedback/index.d.ts.map +1 -1
  446. package/core/dist/runtime-v2/feedback/index.js +7 -1
  447. package/core/dist/runtime-v2/feedback/index.js.map +1 -1
  448. package/core/dist/runtime-v2/feedback/pending-agent-draft-store.d.ts +106 -0
  449. package/core/dist/runtime-v2/feedback/pending-agent-draft-store.d.ts.map +1 -0
  450. package/core/dist/runtime-v2/feedback/pending-agent-draft-store.js +220 -0
  451. package/core/dist/runtime-v2/feedback/pending-agent-draft-store.js.map +1 -0
  452. package/core/dist/runtime-v2/feedback/privacy-preview.d.ts +16 -0
  453. package/core/dist/runtime-v2/feedback/privacy-preview.d.ts.map +1 -1
  454. package/core/dist/runtime-v2/feedback/privacy-preview.js +54 -0
  455. package/core/dist/runtime-v2/feedback/privacy-preview.js.map +1 -1
  456. package/core/dist/runtime-v2/feedback/redact-sensitive.js.map +1 -1
  457. package/core/dist/runtime-v2/feedback/render-markdown.js.map +1 -1
  458. package/core/dist/runtime-v2/full-trace-contract.d.ts +8 -8
  459. package/core/dist/runtime-v2/full-trace-contract.d.ts.map +1 -1
  460. package/core/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.js.map +1 -1
  461. package/core/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.js.map +1 -1
  462. package/core/dist/runtime-v2/gfi/gfi-kernel.js.map +1 -1
  463. package/core/dist/runtime-v2/golden-trace.js.map +1 -1
  464. package/core/dist/runtime-v2/index.d.ts +11 -2
  465. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  466. package/core/dist/runtime-v2/index.js +13 -1
  467. package/core/dist/runtime-v2/index.js.map +1 -1
  468. package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js.map +1 -1
  469. package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts.map +1 -1
  470. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts.map +1 -1
  471. package/core/dist/runtime-v2/internalization/__tests__/adversarial-case.test.js.map +1 -1
  472. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.js.map +1 -1
  473. package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.d.ts +11 -0
  474. package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.d.ts.map +1 -0
  475. package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.js +124 -0
  476. package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.js.map +1 -0
  477. package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.d.ts +12 -0
  478. package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.d.ts.map +1 -0
  479. package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.js +253 -0
  480. package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.js.map +1 -0
  481. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +175 -0
  482. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
  483. package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js.map +1 -1
  484. package/core/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js +32 -5
  485. package/core/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js.map +1 -1
  486. package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.d.ts +15 -0
  487. package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.d.ts.map +1 -0
  488. package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js +301 -0
  489. package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js.map +1 -0
  490. package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.d.ts +12 -0
  491. package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.d.ts.map +1 -0
  492. package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.js +176 -0
  493. package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.js.map +1 -0
  494. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -1
  495. package/core/dist/runtime-v2/internalization/__tests__/diag-distiller-runner.test.js.map +1 -1
  496. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js.map +1 -1
  497. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-runner.test.js.map +1 -1
  498. package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js.map +1 -1
  499. package/core/dist/runtime-v2/internalization/__tests__/diag-router-runner.test.js.map +1 -1
  500. package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.js +27 -1
  501. package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.js.map +1 -1
  502. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js.map +1 -1
  503. package/core/dist/runtime-v2/internalization/__tests__/philosopher-runner-trust-boundary.test.js.map +1 -1
  504. package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.d.ts +2 -0
  505. package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.d.ts.map +1 -0
  506. package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.js +279 -0
  507. package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.js.map +1 -0
  508. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.d.ts +22 -0
  509. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.d.ts.map +1 -0
  510. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.js +92 -0
  511. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.js.map +1 -0
  512. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.d.ts +165 -0
  513. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.d.ts.map +1 -0
  514. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.js +659 -0
  515. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.js.map +1 -0
  516. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.d.ts +22 -0
  517. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.d.ts.map +1 -0
  518. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.js +229 -0
  519. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.js.map +1 -0
  520. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.d.ts +2 -0
  521. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.d.ts.map +1 -0
  522. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js +1039 -0
  523. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js.map +1 -0
  524. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.d.ts +13 -0
  525. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.d.ts.map +1 -0
  526. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.js +257 -0
  527. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.js.map +1 -0
  528. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.d.ts +11 -0
  529. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.d.ts.map +1 -0
  530. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.js +154 -0
  531. package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.js.map +1 -0
  532. package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.d.ts +12 -0
  533. package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.d.ts.map +1 -0
  534. package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.js +254 -0
  535. package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.js.map +1 -0
  536. package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js +14 -5
  537. package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js.map +1 -1
  538. package/core/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.js.map +1 -1
  539. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -1
  540. package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.d.ts +15 -0
  541. package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.d.ts.map +1 -0
  542. package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.js +150 -0
  543. package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.js.map +1 -0
  544. package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.js +29 -0
  545. package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.js.map +1 -1
  546. package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js.map +1 -1
  547. package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.js +173 -0
  548. package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.js.map +1 -1
  549. package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.d.ts +22 -0
  550. package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.d.ts.map +1 -0
  551. package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.js +280 -0
  552. package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.js.map +1 -0
  553. package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.d.ts +25 -0
  554. package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.d.ts.map +1 -0
  555. package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.js +413 -0
  556. package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.js.map +1 -0
  557. package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.d.ts +12 -0
  558. package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.d.ts.map +1 -0
  559. package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.js +176 -0
  560. package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.js.map +1 -0
  561. package/core/dist/runtime-v2/internalization/artifact-content-hash.d.ts +19 -0
  562. package/core/dist/runtime-v2/internalization/artifact-content-hash.d.ts.map +1 -0
  563. package/core/dist/runtime-v2/internalization/artifact-content-hash.js +116 -0
  564. package/core/dist/runtime-v2/internalization/artifact-content-hash.js.map +1 -0
  565. package/core/dist/runtime-v2/internalization/artifact-summary.d.ts +106 -0
  566. package/core/dist/runtime-v2/internalization/artifact-summary.d.ts.map +1 -0
  567. package/core/dist/runtime-v2/internalization/artifact-summary.js +331 -0
  568. package/core/dist/runtime-v2/internalization/artifact-summary.js.map +1 -0
  569. package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -1
  570. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +42 -1
  571. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
  572. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +22 -3
  573. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
  574. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts +22 -0
  575. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
  576. package/core/dist/runtime-v2/internalization/artificer-runner.js +229 -3
  577. package/core/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
  578. package/core/dist/runtime-v2/internalization/attach-summary-envelope.d.ts +60 -0
  579. package/core/dist/runtime-v2/internalization/attach-summary-envelope.d.ts.map +1 -0
  580. package/core/dist/runtime-v2/internalization/attach-summary-envelope.js +126 -0
  581. package/core/dist/runtime-v2/internalization/attach-summary-envelope.js.map +1 -0
  582. package/core/dist/runtime-v2/internalization/candidate-lineage.d.ts +136 -0
  583. package/core/dist/runtime-v2/internalization/candidate-lineage.d.ts.map +1 -0
  584. package/core/dist/runtime-v2/internalization/candidate-lineage.js +230 -0
  585. package/core/dist/runtime-v2/internalization/candidate-lineage.js.map +1 -0
  586. package/core/dist/runtime-v2/internalization/context-manifest.d.ts +117 -0
  587. package/core/dist/runtime-v2/internalization/context-manifest.d.ts.map +1 -0
  588. package/core/dist/runtime-v2/internalization/context-manifest.js +156 -0
  589. package/core/dist/runtime-v2/internalization/context-manifest.js.map +1 -0
  590. package/core/dist/runtime-v2/internalization/context-manifests.d.ts +74 -0
  591. package/core/dist/runtime-v2/internalization/context-manifests.d.ts.map +1 -0
  592. package/core/dist/runtime-v2/internalization/context-manifests.js +192 -0
  593. package/core/dist/runtime-v2/internalization/context-manifests.js.map +1 -0
  594. package/core/dist/runtime-v2/internalization/correction-proposal.js.map +1 -1
  595. package/core/dist/runtime-v2/internalization/diag-distiller-runner.d.ts +1 -1
  596. package/core/dist/runtime-v2/internalization/diag-distiller-runner.d.ts.map +1 -1
  597. package/core/dist/runtime-v2/internalization/diag-distiller-runner.js +23 -2
  598. package/core/dist/runtime-v2/internalization/diag-distiller-runner.js.map +1 -1
  599. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
  600. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js +9 -1
  601. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
  602. package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts +7 -2
  603. package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
  604. package/core/dist/runtime-v2/internalization/diag-router-runner.js +28 -1
  605. package/core/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
  606. package/core/dist/runtime-v2/internalization/dimension-coverage-policy.d.ts +54 -0
  607. package/core/dist/runtime-v2/internalization/dimension-coverage-policy.d.ts.map +1 -0
  608. package/core/dist/runtime-v2/internalization/dimension-coverage-policy.js +70 -0
  609. package/core/dist/runtime-v2/internalization/dimension-coverage-policy.js.map +1 -0
  610. package/core/dist/runtime-v2/internalization/dreamer-output.d.ts.map +1 -1
  611. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts.map +1 -1
  612. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.js.map +1 -1
  613. package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts +9 -1
  614. package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -1
  615. package/core/dist/runtime-v2/internalization/dreamer-runner.js +41 -7
  616. package/core/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -1
  617. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +27 -1
  618. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
  619. package/core/dist/runtime-v2/internalization/evaluator-output.js +7 -1
  620. package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
  621. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +1 -1
  622. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
  623. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js +12 -0
  624. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
  625. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +115 -1
  626. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  627. package/core/dist/runtime-v2/internalization/evaluator-runner.js +384 -5
  628. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  629. package/core/dist/runtime-v2/internalization/index.d.ts +2 -0
  630. package/core/dist/runtime-v2/internalization/index.d.ts.map +1 -1
  631. package/core/dist/runtime-v2/internalization/index.js +2 -0
  632. package/core/dist/runtime-v2/internalization/index.js.map +1 -1
  633. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.d.ts +24 -0
  634. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.d.ts.map +1 -1
  635. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.js +25 -2
  636. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.js.map +1 -1
  637. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +1 -1
  638. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
  639. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +44 -1
  640. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
  641. package/core/dist/runtime-v2/internalization/internalization-task-guards.js.map +1 -1
  642. package/core/dist/runtime-v2/internalization/lifecycle-read-model.test.js.map +1 -1
  643. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +3 -0
  644. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -1
  645. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -1
  646. package/core/dist/runtime-v2/internalization/philosopher-output.d.ts.map +1 -1
  647. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts.map +1 -1
  648. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.js.map +1 -1
  649. package/core/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -1
  650. package/core/dist/runtime-v2/internalization/philosopher-runner.js +25 -1
  651. package/core/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -1
  652. package/core/dist/runtime-v2/internalization/pi-artifact-store.d.ts.map +1 -1
  653. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts +35 -1
  654. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -1
  655. package/core/dist/runtime-v2/internalization/pitask-metadata.js +64 -0
  656. package/core/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -1
  657. package/core/dist/runtime-v2/internalization/progressive-evaluator.d.ts +115 -0
  658. package/core/dist/runtime-v2/internalization/progressive-evaluator.d.ts.map +1 -0
  659. package/core/dist/runtime-v2/internalization/progressive-evaluator.js +248 -0
  660. package/core/dist/runtime-v2/internalization/progressive-evaluator.js.map +1 -0
  661. package/core/dist/runtime-v2/internalization/prompt-budget-manager.d.ts +90 -0
  662. package/core/dist/runtime-v2/internalization/prompt-budget-manager.d.ts.map +1 -0
  663. package/core/dist/runtime-v2/internalization/prompt-budget-manager.js +149 -0
  664. package/core/dist/runtime-v2/internalization/prompt-budget-manager.js.map +1 -0
  665. package/core/dist/runtime-v2/internalization/queue-actionability.d.ts +11 -0
  666. package/core/dist/runtime-v2/internalization/queue-actionability.d.ts.map +1 -1
  667. package/core/dist/runtime-v2/internalization/queue-actionability.js +12 -0
  668. package/core/dist/runtime-v2/internalization/queue-actionability.js.map +1 -1
  669. package/core/dist/runtime-v2/internalization/resolve-injection.d.ts +62 -0
  670. package/core/dist/runtime-v2/internalization/resolve-injection.d.ts.map +1 -0
  671. package/core/dist/runtime-v2/internalization/resolve-injection.js +78 -0
  672. package/core/dist/runtime-v2/internalization/resolve-injection.js.map +1 -0
  673. package/core/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts +1 -1
  674. package/core/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts.map +1 -1
  675. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
  676. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  677. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.js.map +1 -1
  678. package/core/dist/runtime-v2/internalization/routing-policy.test.js.map +1 -1
  679. package/core/dist/runtime-v2/internalization/rule-code-validator.d.ts.map +1 -1
  680. package/core/dist/runtime-v2/internalization/rule-code-validator.js +7 -1
  681. package/core/dist/runtime-v2/internalization/rule-code-validator.js.map +1 -1
  682. package/core/dist/runtime-v2/internalization/rule-host-input-builder.js.map +1 -1
  683. package/core/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -1
  684. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
  685. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
  686. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
  687. package/core/dist/runtime-v2/internalization/scribe-runner.js +33 -1
  688. package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
  689. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.d.ts.map +1 -1
  690. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.js +75 -13
  691. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.js.map +1 -1
  692. package/core/dist/runtime-v2/internalization/summary-field-reader.d.ts +38 -0
  693. package/core/dist/runtime-v2/internalization/summary-field-reader.d.ts.map +1 -0
  694. package/core/dist/runtime-v2/internalization/summary-field-reader.js +108 -0
  695. package/core/dist/runtime-v2/internalization/summary-field-reader.js.map +1 -0
  696. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts.map +1 -1
  697. package/core/dist/runtime-v2/internalization-integrity-remediation.d.ts.map +1 -1
  698. package/core/dist/runtime-v2/internalization-queue-read-model.d.ts.map +1 -1
  699. package/core/dist/runtime-v2/internalization-queue-read-model.js.map +1 -1
  700. package/core/dist/runtime-v2/language-directive.d.ts +1 -1
  701. package/core/dist/runtime-v2/language-directive.d.ts.map +1 -1
  702. package/core/dist/runtime-v2/language-directive.js.map +1 -1
  703. package/core/dist/runtime-v2/mainline-contract.js.map +1 -1
  704. package/core/dist/runtime-v2/observer/agent-scheduler.d.ts.map +1 -1
  705. package/core/dist/runtime-v2/observer/correction-observer.d.ts.map +1 -1
  706. package/core/dist/runtime-v2/observer/empathy-observer.d.ts.map +1 -1
  707. package/core/dist/runtime-v2/operator-health-read-model.d.ts.map +1 -1
  708. package/core/dist/runtime-v2/pain-chain-read-model.d.ts.map +1 -1
  709. package/core/dist/runtime-v2/pain-gate/__tests__/pain-diagnostic-gate-policy.test.js.map +1 -1
  710. package/core/dist/runtime-v2/pain-gate/pain-diagnostic-gate-policy.d.ts +1 -1
  711. package/core/dist/runtime-v2/pain-gate/pain-diagnostic-gate-policy.d.ts.map +1 -1
  712. package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
  713. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +4 -0
  714. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  715. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +3 -1
  716. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  717. package/core/dist/runtime-v2/pain-to-principle-service.d.ts +2 -0
  718. package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
  719. package/core/dist/runtime-v2/pain-to-principle-service.js +2 -0
  720. package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
  721. package/core/dist/runtime-v2/proven-channel-baseline.js +1 -1
  722. package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
  723. package/core/dist/runtime-v2/pruning-read-model.d.ts.map +1 -1
  724. package/core/dist/runtime-v2/recovery-sweep-service.js.map +1 -1
  725. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.d.ts +2 -0
  726. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.d.ts.map +1 -0
  727. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.js +459 -0
  728. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.js.map +1 -0
  729. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.d.ts +2 -0
  730. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.d.ts.map +1 -0
  731. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.js +320 -0
  732. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.js.map +1 -0
  733. package/core/dist/runtime-v2/runner/__tests__/default-validator.test.js +63 -0
  734. package/core/dist/runtime-v2/runner/__tests__/default-validator.test.js.map +1 -1
  735. package/core/dist/runtime-v2/runner/__tests__/diagnose.test.js.map +1 -1
  736. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts +117 -4
  737. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
  738. package/core/dist/runtime-v2/runner/base-peer-runner.js +403 -0
  739. package/core/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
  740. package/core/dist/runtime-v2/runner/default-validator.d.ts.map +1 -1
  741. package/core/dist/runtime-v2/runner/default-validator.js +31 -3
  742. package/core/dist/runtime-v2/runner/default-validator.js.map +1 -1
  743. package/core/dist/runtime-v2/runner/diagnostician-validator.d.ts.map +1 -1
  744. package/core/dist/runtime-v2/runner/peer-runner-types.d.ts +36 -0
  745. package/core/dist/runtime-v2/runner/peer-runner-types.d.ts.map +1 -1
  746. package/core/dist/runtime-v2/runtime-protocol.d.ts +1 -1
  747. package/core/dist/runtime-v2/schema-conformance-read-model.d.ts.map +1 -1
  748. package/core/dist/runtime-v2/signal-collector/types.d.ts.map +1 -1
  749. package/core/dist/runtime-v2/stalled-diagnostician-task-read-model.d.ts.map +1 -1
  750. package/core/dist/runtime-v2/store/artifact/memory-artifact-store.d.ts.map +1 -1
  751. package/core/dist/runtime-v2/store/artifact/memory-artifact-store.js.map +1 -1
  752. package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.d.ts.map +1 -1
  753. package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.js.map +1 -1
  754. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -1
  755. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js.map +1 -1
  756. package/core/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts.map +1 -1
  757. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts.map +1 -1
  758. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js.map +1 -1
  759. package/core/dist/runtime-v2/store/commit/diagnostician-committer.d.ts +15 -0
  760. package/core/dist/runtime-v2/store/commit/diagnostician-committer.d.ts.map +1 -1
  761. package/core/dist/runtime-v2/store/commit/diagnostician-committer.js +32 -1
  762. package/core/dist/runtime-v2/store/commit/diagnostician-committer.js.map +1 -1
  763. package/core/dist/runtime-v2/store/commit/memory-commit-store.d.ts.map +1 -1
  764. package/core/dist/runtime-v2/store/commit/sqlite-commit-store.d.ts.map +1 -1
  765. package/core/dist/runtime-v2/store/commit/sqlite-commit-store.js.map +1 -1
  766. package/core/dist/runtime-v2/store/context/resilient-context-assembler.d.ts.map +1 -1
  767. package/core/dist/runtime-v2/store/context/resilient-context-assembler.js.map +1 -1
  768. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -1
  769. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -1
  770. package/core/dist/runtime-v2/store/diagnostician-committer.test.js +36 -2
  771. package/core/dist/runtime-v2/store/diagnostician-committer.test.js.map +1 -1
  772. package/core/dist/runtime-v2/store/event-emitter.d.ts.map +1 -1
  773. package/core/dist/runtime-v2/store/history/resilient-history-query.d.ts.map +1 -1
  774. package/core/dist/runtime-v2/store/history/resilient-history-query.js.map +1 -1
  775. package/core/dist/runtime-v2/store/history/sqlite-history-query.d.ts.map +1 -1
  776. package/core/dist/runtime-v2/store/history/sqlite-history-query.js.map +1 -1
  777. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js.map +1 -1
  778. package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts.map +1 -1
  779. package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js.map +1 -1
  780. package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts.map +1 -1
  781. package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js.map +1 -1
  782. package/core/dist/runtime-v2/store/lifecycle/lease-manager.d.ts.map +1 -1
  783. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js.map +1 -1
  784. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.js.map +1 -1
  785. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.d.ts.map +1 -1
  786. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.js.map +1 -1
  787. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js.map +1 -1
  788. package/core/dist/runtime-v2/store/lifecycle/retry-policy.d.ts.map +1 -1
  789. package/core/dist/runtime-v2/store/lifecycle/retry-policy.js.map +1 -1
  790. package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.d.ts +2 -0
  791. package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.d.ts.map +1 -0
  792. package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.js +225 -0
  793. package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.js.map +1 -0
  794. package/core/dist/runtime-v2/store/pain/index.d.ts +3 -0
  795. package/core/dist/runtime-v2/store/pain/index.d.ts.map +1 -0
  796. package/core/dist/runtime-v2/store/pain/index.js +2 -0
  797. package/core/dist/runtime-v2/store/pain/index.js.map +1 -0
  798. package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.d.ts +70 -0
  799. package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.d.ts.map +1 -0
  800. package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.js +154 -0
  801. package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.js.map +1 -0
  802. package/core/dist/runtime-v2/store/run/memory-run-store.d.ts.map +1 -1
  803. package/core/dist/runtime-v2/store/run/sqlite-run-store.d.ts.map +1 -1
  804. package/core/dist/runtime-v2/store/run/sqlite-run-store.js.map +1 -1
  805. package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -1
  806. package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.js.map +1 -1
  807. package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -1
  808. package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
  809. package/core/dist/runtime-v2/store/sqlite-connection.js +46 -1
  810. package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
  811. package/core/dist/runtime-v2/store/sqlite-task-store.test.js.map +1 -1
  812. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.d.ts +2 -0
  813. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.d.ts.map +1 -0
  814. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js +442 -0
  815. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js.map +1 -0
  816. package/core/dist/runtime-v2/store/task/index.d.ts +1 -0
  817. package/core/dist/runtime-v2/store/task/index.d.ts.map +1 -1
  818. package/core/dist/runtime-v2/store/task/index.js.map +1 -1
  819. package/core/dist/runtime-v2/store/task/memory-task-store.d.ts.map +1 -1
  820. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts +45 -0
  821. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -1
  822. package/core/dist/runtime-v2/store/task/sqlite-task-store.js +205 -0
  823. package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
  824. package/core/dist/runtime-v2/store/task/task-types.d.ts +60 -0
  825. package/core/dist/runtime-v2/store/task/task-types.d.ts.map +1 -0
  826. package/core/dist/runtime-v2/store/task/task-types.js +2 -0
  827. package/core/dist/runtime-v2/store/task/task-types.js.map +1 -0
  828. package/core/dist/runtime-v2/store/task-migration.d.ts.map +1 -1
  829. package/core/dist/runtime-v2/store/task-migration.js.map +1 -1
  830. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.js.map +1 -1
  831. package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.d.ts.map +1 -1
  832. package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.js.map +1 -1
  833. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.d.ts.map +1 -1
  834. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.js.map +1 -1
  835. package/core/dist/runtime-v2/store/workspace-leak-guard.d.ts +23 -0
  836. package/core/dist/runtime-v2/store/workspace-leak-guard.d.ts.map +1 -0
  837. package/core/dist/runtime-v2/store/workspace-leak-guard.js +111 -0
  838. package/core/dist/runtime-v2/store/workspace-leak-guard.js.map +1 -0
  839. package/core/dist/runtime-v2/story-a-demo.d.ts +1 -1
  840. package/core/dist/runtime-v2/story-a-demo.d.ts.map +1 -1
  841. package/core/dist/runtime-v2/story-a-demo.js +8 -10
  842. package/core/dist/runtime-v2/story-a-demo.js.map +1 -1
  843. package/core/dist/runtime-v2/task-status.d.ts +2 -2
  844. package/core/dist/runtime-v2/tools/__tests__/agent-tool-contract.test.js.map +1 -1
  845. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -1
  846. package/core/dist/runtime-v2/tools/__tests__/dreamer-output-typebox.test.js.map +1 -1
  847. package/core/dist/runtime-v2/trace-refiner.d.ts +2 -2
  848. package/core/dist/runtime-v2/trace-refiner.d.ts.map +1 -1
  849. package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
  850. package/core/dist/trajectory-store.js.map +1 -1
  851. package/core/dist/trajectory-store.test.d.ts +2 -0
  852. package/core/dist/trajectory-store.test.d.ts.map +1 -0
  853. package/core/dist/trajectory-store.test.js +251 -0
  854. package/core/dist/trajectory-store.test.js.map +1 -0
  855. package/core/dist/workflow-funnel-loader.d.ts.map +1 -1
  856. package/core/package.json +13 -7
  857. package/dist/i18n.d.ts.map +1 -1
  858. package/dist/i18n.js +56 -6
  859. package/dist/i18n.js.map +1 -1
  860. package/dist/index.d.ts +2 -0
  861. package/dist/index.d.ts.map +1 -1
  862. package/dist/index.js +186 -27
  863. package/dist/index.js.map +1 -1
  864. package/dist/installer.d.ts +11 -2
  865. package/dist/installer.d.ts.map +1 -1
  866. package/dist/installer.js +296 -145
  867. package/dist/installer.js.map +1 -1
  868. package/dist/installers/codex-host-installer.d.ts +15 -0
  869. package/dist/installers/codex-host-installer.d.ts.map +1 -0
  870. package/dist/installers/codex-host-installer.js +445 -0
  871. package/dist/installers/codex-host-installer.js.map +1 -0
  872. package/dist/installers/index.d.ts +40 -0
  873. package/dist/installers/index.d.ts.map +1 -0
  874. package/dist/installers/index.js +35 -0
  875. package/dist/installers/index.js.map +1 -0
  876. package/dist/installers/openclaw-host-installer.d.ts +18 -0
  877. package/dist/installers/openclaw-host-installer.d.ts.map +1 -0
  878. package/dist/installers/openclaw-host-installer.js +404 -0
  879. package/dist/installers/openclaw-host-installer.js.map +1 -0
  880. package/dist/mvp-config.d.ts +23 -4
  881. package/dist/mvp-config.d.ts.map +1 -1
  882. package/dist/mvp-config.js +15 -7
  883. package/dist/mvp-config.js.map +1 -1
  884. package/dist/prompts.d.ts +17 -1
  885. package/dist/prompts.d.ts.map +1 -1
  886. package/dist/prompts.js +114 -0
  887. package/dist/prompts.js.map +1 -1
  888. package/dist/uninstaller.d.ts +18 -1
  889. package/dist/uninstaller.d.ts.map +1 -1
  890. package/dist/uninstaller.js +60 -75
  891. package/dist/uninstaller.js.map +1 -1
  892. package/dist/updater.d.ts +0 -6
  893. package/dist/updater.d.ts.map +1 -1
  894. package/dist/updater.js +0 -11
  895. package/dist/updater.js.map +1 -1
  896. package/dist/utils/env.d.ts +14 -0
  897. package/dist/utils/env.d.ts.map +1 -1
  898. package/dist/utils/env.js +35 -2
  899. package/dist/utils/env.js.map +1 -1
  900. package/dist/utils/logger.d.ts.map +1 -1
  901. package/dist/utils/logger.js +1 -1
  902. package/dist/utils/logger.js.map +1 -1
  903. package/package.json +7 -7
  904. package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.d.ts +2 -0
  905. package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.d.ts.map +1 -0
  906. package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.js +60 -0
  907. package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.js.map +1 -0
  908. package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.js +11 -4
  909. package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.js.map +1 -1
  910. package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.js +2 -2
  911. package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.js.map +1 -1
  912. package/pd-cli/dist/commands/admission-gate.d.ts +24 -0
  913. package/pd-cli/dist/commands/admission-gate.d.ts.map +1 -0
  914. package/pd-cli/dist/commands/admission-gate.js +29 -0
  915. package/pd-cli/dist/commands/admission-gate.js.map +1 -0
  916. package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
  917. package/pd-cli/dist/commands/candidate.js +2 -21
  918. package/pd-cli/dist/commands/candidate.js.map +1 -1
  919. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  920. package/pd-cli/dist/commands/console.js +40 -0
  921. package/pd-cli/dist/commands/console.js.map +1 -1
  922. package/pd-cli/dist/commands/demo-story-a.js.map +1 -1
  923. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
  924. package/pd-cli/dist/commands/diagnose.js +88 -9
  925. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  926. package/pd-cli/dist/commands/errors-list.d.ts +25 -0
  927. package/pd-cli/dist/commands/errors-list.d.ts.map +1 -0
  928. package/pd-cli/dist/commands/errors-list.js +368 -0
  929. package/pd-cli/dist/commands/errors-list.js.map +1 -0
  930. package/pd-cli/dist/commands/health.js.map +1 -1
  931. package/pd-cli/dist/commands/pain-evidence.d.ts +6 -0
  932. package/pd-cli/dist/commands/pain-evidence.d.ts.map +1 -1
  933. package/pd-cli/dist/commands/pain-evidence.js +6 -0
  934. package/pd-cli/dist/commands/pain-evidence.js.map +1 -1
  935. package/pd-cli/dist/commands/pain-retry.d.ts +1 -0
  936. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  937. package/pd-cli/dist/commands/pain-retry.js +288 -19
  938. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  939. package/pd-cli/dist/commands/proven-channel-baseline.js.map +1 -1
  940. package/pd-cli/dist/commands/runtime-canary.d.ts.map +1 -1
  941. package/pd-cli/dist/commands/runtime-canary.js +28 -5
  942. package/pd-cli/dist/commands/runtime-canary.js.map +1 -1
  943. package/pd-cli/dist/commands/runtime-internalization-context-trace.d.ts +25 -0
  944. package/pd-cli/dist/commands/runtime-internalization-context-trace.d.ts.map +1 -0
  945. package/pd-cli/dist/commands/runtime-internalization-context-trace.js +374 -0
  946. package/pd-cli/dist/commands/runtime-internalization-context-trace.js.map +1 -0
  947. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  948. package/pd-cli/dist/commands/runtime-internalization-run-once.js +20 -5
  949. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  950. package/pd-cli/dist/commands/runtime-uat.guard.test.js +13 -15
  951. package/pd-cli/dist/commands/runtime-uat.guard.test.js.map +1 -1
  952. package/pd-cli/dist/commands/runtime-uat.js.map +1 -1
  953. package/pd-cli/dist/index.js +21 -3
  954. package/pd-cli/dist/index.js.map +1 -1
  955. package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.d.ts +2 -0
  956. package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.d.ts.map +1 -0
  957. package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.js +304 -0
  958. package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.js.map +1 -0
  959. package/pd-cli/dist/services/__tests__/rulehost-readiness.test.js.map +1 -1
  960. package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.js.map +1 -1
  961. package/pd-cli/dist/services/config-doctor.js.map +1 -1
  962. package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts.map +1 -1
  963. package/pd-cli/dist/services/pain-flood-simulation-runner.js +9 -0
  964. package/pd-cli/dist/services/pain-flood-simulation-runner.js.map +1 -1
  965. package/pd-cli/dist/services/proven-channel-baseline-runner.d.ts.map +1 -1
  966. package/pd-cli/dist/services/proven-channel-baseline-runner.js +10 -2
  967. package/pd-cli/dist/services/proven-channel-baseline-runner.js.map +1 -1
  968. package/pd-cli/dist/services/quality-scorecard/data-extractor.js.map +1 -1
  969. package/pd-cli/dist/services/resolve-runtime-from-pd-config.js.map +1 -1
  970. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts +73 -1
  971. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
  972. package/pd-cli/dist/services/rulehost-pipeline-runner.js +107 -6
  973. package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -1
  974. package/pd-cli/dist/services/rulehost-readiness.js.map +1 -1
  975. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts +1 -0
  976. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
  977. package/pd-cli/dist/services/runtime-adapter-resolver.js +2 -0
  978. package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
  979. package/pd-cli/dist/services/synthetic-baseline-runner.d.ts.map +1 -1
  980. package/pd-cli/dist/services/synthetic-baseline-runner.js +11 -0
  981. package/pd-cli/dist/services/synthetic-baseline-runner.js.map +1 -1
  982. package/pd-cli/dist/utils/production-workspace-guard.d.ts +4 -4
  983. package/pd-cli/dist/utils/production-workspace-guard.d.ts.map +1 -1
  984. package/pd-cli/dist/utils/production-workspace-guard.js +19 -16
  985. package/pd-cli/dist/utils/production-workspace-guard.js.map +1 -1
  986. package/pd-cli/dist/utils/production-workspace-guard.test.js +54 -19
  987. package/pd-cli/dist/utils/production-workspace-guard.test.js.map +1 -1
  988. package/pd-cli/package.json +4 -4
  989. package/plugin/dist/assets/logo.svg +11 -0
  990. package/plugin/dist/bundle.js +3152 -0
  991. package/plugin/dist/config/defaults/runtime.d.ts +1 -1
  992. package/plugin/dist/constants/tools.d.ts +4 -4
  993. package/plugin/dist/core/config-health.d.ts +1 -11
  994. package/plugin/dist/core/dictionary.d.ts +1 -1
  995. package/plugin/dist/core/path-resolver.d.ts +3 -3
  996. package/plugin/dist/core/signal-collector-host.d.ts +9 -1
  997. package/plugin/dist/core/system-logger.d.ts +16 -0
  998. package/plugin/dist/index.d.ts +1 -1
  999. package/plugin/dist/index.js +1 -808
  1000. package/plugin/dist/openclaw-sdk.d.ts +49 -8
  1001. package/plugin/dist/openclaw.plugin.json +65 -0
  1002. package/plugin/dist/service/evolution-worker.d.ts +27 -1
  1003. package/plugin/dist/templates/langs/en/core/AGENTS.md +205 -0
  1004. package/plugin/dist/templates/langs/en/core/BOOT.md +60 -0
  1005. package/plugin/dist/templates/langs/en/core/BOOTSTRAP.md +259 -0
  1006. package/plugin/dist/templates/langs/en/core/HEARTBEAT.md +74 -0
  1007. package/plugin/dist/templates/langs/en/core/IDENTITY.md +8 -0
  1008. package/plugin/dist/templates/langs/en/core/PRINCIPLES.md +10 -0
  1009. package/plugin/dist/templates/langs/en/core/SOUL.md +46 -0
  1010. package/plugin/dist/templates/langs/en/core/TOOLS.md +15 -0
  1011. package/plugin/dist/templates/langs/en/core/USER.md +10 -0
  1012. package/plugin/dist/templates/langs/en/pain/00_seed_samples.md +23 -0
  1013. package/plugin/dist/templates/langs/en/pain_dictionary.json +22 -0
  1014. package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +77 -0
  1015. package/plugin/dist/templates/langs/en/skills/admin/SKILL.md +39 -0
  1016. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +2 -0
  1017. package/plugin/dist/templates/langs/en/skills/bootstrap-tools/SKILL.md +53 -0
  1018. package/plugin/dist/templates/langs/en/skills/deductive-audit/SKILL.md +36 -0
  1019. package/plugin/dist/templates/langs/en/skills/evolution-framework-update/SKILL.md +31 -0
  1020. package/plugin/dist/templates/langs/en/skills/evolve-task/SKILL.md +83 -0
  1021. package/plugin/dist/templates/langs/en/skills/feedback/SKILL.md +51 -0
  1022. package/plugin/dist/templates/langs/en/skills/init-strategy/SKILL.md +54 -0
  1023. package/plugin/dist/templates/langs/en/skills/inject-rule/SKILL.md +19 -0
  1024. package/plugin/dist/templates/langs/en/skills/pd-auditor/SKILL.md +61 -0
  1025. package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +76 -0
  1026. package/plugin/dist/templates/langs/en/skills/pd-explorer/SKILL.md +65 -0
  1027. package/plugin/dist/templates/langs/en/skills/pd-implementer/SKILL.md +68 -0
  1028. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +213 -0
  1029. package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -0
  1030. package/plugin/dist/templates/langs/en/skills/pd-planner/SKILL.md +65 -0
  1031. package/plugin/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +71 -0
  1032. package/plugin/dist/templates/langs/en/skills/profile/SKILL.md +24 -0
  1033. package/plugin/dist/templates/langs/en/skills/reflection/SKILL.md +40 -0
  1034. package/plugin/dist/templates/langs/en/skills/reflection-log/SKILL.md +37 -0
  1035. package/plugin/dist/templates/langs/en/skills/report/SKILL.md +13 -0
  1036. package/plugin/dist/templates/langs/en/skills/root-cause/SKILL.md +33 -0
  1037. package/plugin/dist/templates/langs/en/skills/triage/SKILL.md +29 -0
  1038. package/plugin/dist/templates/langs/en/skills/watch-evolution/SKILL.md +33 -0
  1039. package/plugin/dist/templates/langs/zh/core/AGENTS.md +197 -0
  1040. package/plugin/dist/templates/langs/zh/core/BOOT.md +60 -0
  1041. package/plugin/dist/templates/langs/zh/core/BOOTSTRAP.md +260 -0
  1042. package/plugin/dist/templates/langs/zh/core/HEARTBEAT.md +98 -0
  1043. package/plugin/dist/templates/langs/zh/core/IDENTITY.md +8 -0
  1044. package/plugin/dist/templates/langs/zh/core/PRINCIPLES.md +7 -0
  1045. package/plugin/dist/templates/langs/zh/core/SOUL.md +46 -0
  1046. package/plugin/dist/templates/langs/zh/core/TOOLS.md +15 -0
  1047. package/plugin/dist/templates/langs/zh/core/USER.md +10 -0
  1048. package/plugin/dist/templates/langs/zh/pain/00_seed_samples.md +24 -0
  1049. package/plugin/dist/templates/langs/zh/pain_dictionary.json +18 -0
  1050. package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +77 -0
  1051. package/plugin/dist/templates/langs/zh/skills/admin/SKILL.md +41 -0
  1052. package/plugin/dist/templates/langs/zh/skills/bootstrap-tools/SKILL.md +52 -0
  1053. package/plugin/dist/templates/langs/zh/skills/deductive-audit/SKILL.md +36 -0
  1054. package/plugin/dist/templates/langs/zh/skills/evolution-framework-update/SKILL.md +31 -0
  1055. package/plugin/dist/templates/langs/zh/skills/evolve-task/SKILL.md +83 -0
  1056. package/plugin/dist/templates/langs/zh/skills/feedback/SKILL.md +53 -0
  1057. package/plugin/dist/templates/langs/zh/skills/init-strategy/SKILL.md +54 -0
  1058. package/plugin/dist/templates/langs/zh/skills/inject-rule/SKILL.md +19 -0
  1059. package/plugin/dist/templates/langs/zh/skills/pd-auditor/SKILL.md +61 -0
  1060. package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +76 -0
  1061. package/plugin/dist/templates/langs/zh/skills/pd-explorer/SKILL.md +65 -0
  1062. package/plugin/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +68 -0
  1063. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +213 -0
  1064. package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +30 -0
  1065. package/plugin/dist/templates/langs/zh/skills/pd-planner/SKILL.md +65 -0
  1066. package/plugin/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +71 -0
  1067. package/plugin/dist/templates/langs/zh/skills/profile/SKILL.md +24 -0
  1068. package/plugin/dist/templates/langs/zh/skills/reflection/SKILL.md +40 -0
  1069. package/plugin/dist/templates/langs/zh/skills/reflection-log/SKILL.md +37 -0
  1070. package/plugin/dist/templates/langs/zh/skills/report/SKILL.md +13 -0
  1071. package/plugin/dist/templates/langs/zh/skills/root-cause/SKILL.md +33 -0
  1072. package/plugin/dist/templates/langs/zh/skills/triage/SKILL.md +29 -0
  1073. package/plugin/dist/templates/langs/zh/skills/watch-evolution/SKILL.md +33 -0
  1074. package/plugin/dist/templates/pain_dictionary.json +36 -0
  1075. package/plugin/dist/templates/pain_settings.json +103 -0
  1076. package/plugin/dist/templates/workspace/.principles/DECISION_POLICY.json +44 -0
  1077. package/plugin/dist/templates/workspace/.principles/PRINCIPLES.md +20 -0
  1078. package/plugin/dist/templates/workspace/.principles/PROFILE.json +54 -0
  1079. package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +56 -0
  1080. package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +65 -0
  1081. package/plugin/dist/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +7 -0
  1082. package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +9 -0
  1083. package/plugin/dist/templates/workspace/.principles/models/_INDEX.md +27 -0
  1084. package/plugin/dist/templates/workspace/.principles/models/first_principles.md +62 -0
  1085. package/plugin/dist/templates/workspace/.principles/models/marketing_4p.md +52 -0
  1086. package/plugin/dist/templates/workspace/.principles/models/porter_five.md +63 -0
  1087. package/plugin/dist/templates/workspace/.principles/models/swot.md +60 -0
  1088. package/plugin/dist/templates/workspace/.principles/models/user_story_map.md +63 -0
  1089. package/plugin/dist/templates/workspace/.state/WORKBOARD.json +4 -0
  1090. package/plugin/dist/templates/workspace/AUDIT.md +15 -0
  1091. package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +57 -0
  1092. package/plugin/dist/templates/workspace/okr/RECOVERY_PROTOCOL.md +56 -0
  1093. package/plugin/dist/templates/workspace/okr/TASK_CHANGES.jsonl +6 -0
  1094. package/plugin/dist/templates/workspace/okr/WEEK_TASKS.json +6 -0
  1095. package/plugin/openclaw.plugin.json +5 -5
  1096. package/plugin/package.json +22 -10
  1097. package/plugin/scripts/bootstrap-rules.mjs +5 -1
  1098. package/plugin/scripts/postinstall.cjs +177 -0
  1099. package/plugin/scripts/sync-plugin.mjs +12 -1
  1100. package/plugin/dist/commands/archive-impl.js +0 -105
  1101. package/plugin/dist/commands/capabilities.js +0 -77
  1102. package/plugin/dist/commands/context.js +0 -299
  1103. package/plugin/dist/commands/disable-impl.js +0 -118
  1104. package/plugin/dist/commands/evolution-status.js +0 -185
  1105. package/plugin/dist/commands/export.js +0 -53
  1106. package/plugin/dist/commands/focus.js +0 -451
  1107. package/plugin/dist/commands/pain.js +0 -336
  1108. package/plugin/dist/commands/principle-rollback.js +0 -26
  1109. package/plugin/dist/commands/promote-impl.js +0 -194
  1110. package/plugin/dist/commands/rollback-impl.js +0 -180
  1111. package/plugin/dist/commands/rollback.js +0 -126
  1112. package/plugin/dist/commands/samples.js +0 -83
  1113. package/plugin/dist/commands/strategy.js +0 -16
  1114. package/plugin/dist/commands/thinking-os.js +0 -186
  1115. package/plugin/dist/commands/workflow-debug.js +0 -132
  1116. package/plugin/dist/config/defaults/runtime.js +0 -74
  1117. package/plugin/dist/config/errors.js +0 -107
  1118. package/plugin/dist/config/index.js +0 -7
  1119. package/plugin/dist/constants/tools.js +0 -53
  1120. package/plugin/dist/core/__tests__/focus-history.test.js +0 -160
  1121. package/plugin/dist/core/behavior-example-pack-assembler.js +0 -207
  1122. package/plugin/dist/core/bootstrap-rules.js +0 -187
  1123. package/plugin/dist/core/code-implementation-storage.js +0 -139
  1124. package/plugin/dist/core/config-health.js +0 -60
  1125. package/plugin/dist/core/config-service.js +0 -26
  1126. package/plugin/dist/core/config.js +0 -191
  1127. package/plugin/dist/core/control-ui-db.js +0 -333
  1128. package/plugin/dist/core/correction-cue-learner.js +0 -186
  1129. package/plugin/dist/core/correction-types.js +0 -1
  1130. package/plugin/dist/core/detection-funnel.js +0 -56
  1131. package/plugin/dist/core/detection-service.js +0 -28
  1132. package/plugin/dist/core/dictionary-service.js +0 -26
  1133. package/plugin/dist/core/dictionary.js +0 -148
  1134. package/plugin/dist/core/empathy-keyword-matcher.js +0 -40
  1135. package/plugin/dist/core/empathy-types.js +0 -1
  1136. package/plugin/dist/core/event-log.js +0 -706
  1137. package/plugin/dist/core/evolution-engine.js +0 -460
  1138. package/plugin/dist/core/evolution-logger.js +0 -261
  1139. package/plugin/dist/core/evolution-reducer.js +0 -720
  1140. package/plugin/dist/core/evolution-types.js +0 -11
  1141. package/plugin/dist/core/file-store.js +0 -46
  1142. package/plugin/dist/core/focus-history.js +0 -574
  1143. package/plugin/dist/core/hygiene/tracker.js +0 -110
  1144. package/plugin/dist/core/init.js +0 -254
  1145. package/plugin/dist/core/intent-doc-reader-adapter.js +0 -76
  1146. package/plugin/dist/core/intent-doc-reader.js +0 -210
  1147. package/plugin/dist/core/migration.js +0 -86
  1148. package/plugin/dist/core/pain-diagnostic-gate.js +0 -69
  1149. package/plugin/dist/core/pain.js +0 -56
  1150. package/plugin/dist/core/path-resolver.js +0 -358
  1151. package/plugin/dist/core/paths.js +0 -77
  1152. package/plugin/dist/core/pd-config-loader.js +0 -307
  1153. package/plugin/dist/core/pd-task-reconciler.js +0 -262
  1154. package/plugin/dist/core/pd-task-service.js +0 -32
  1155. package/plugin/dist/core/pd-task-store.js +0 -62
  1156. package/plugin/dist/core/pd-task-types.js +0 -2
  1157. package/plugin/dist/core/principle-compiler/__tests__/compiler-replay-gate.test.js +0 -132
  1158. package/plugin/dist/core/principle-compiler/code-validator.js +0 -86
  1159. package/plugin/dist/core/principle-compiler/compiler.js +0 -289
  1160. package/plugin/dist/core/principle-compiler/index.js +0 -10
  1161. package/plugin/dist/core/principle-compiler/ledger-registrar.js +0 -95
  1162. package/plugin/dist/core/principle-compiler/template-generator.js +0 -7
  1163. package/plugin/dist/core/principle-injection.js +0 -10
  1164. package/plugin/dist/core/principle-internalization/filesystem-lifecycle-datasource.js +0 -34
  1165. package/plugin/dist/core/principle-internalization/lifecycle-read-model.js +0 -21
  1166. package/plugin/dist/core/principle-internalization/lifecycle-refresh.js +0 -4
  1167. package/plugin/dist/core/principle-internalization/principle-lifecycle-service.js +0 -89
  1168. package/plugin/dist/core/principle-training-state.js +0 -113
  1169. package/plugin/dist/core/principle-tree-ledger.js +0 -42
  1170. package/plugin/dist/core/profile.js +0 -211
  1171. package/plugin/dist/core/reflection/reflection-context.js +0 -91
  1172. package/plugin/dist/core/replay-engine.js +0 -82
  1173. package/plugin/dist/core/rule-context-assembler.js +0 -148
  1174. package/plugin/dist/core/rule-host.js +0 -554
  1175. package/plugin/dist/core/rule-implementation-runtime.js +0 -112
  1176. package/plugin/dist/core/runtime-v2-prompt-activation-reader.js +0 -99
  1177. package/plugin/dist/core/session-tracker.js +0 -462
  1178. package/plugin/dist/core/signal-collector-host.js +0 -337
  1179. package/plugin/dist/core/system-logger.js +0 -113
  1180. package/plugin/dist/core/thinking-models.js +0 -94
  1181. package/plugin/dist/core/thinking-os-parser.js +0 -132
  1182. package/plugin/dist/core/trajectory-types.js +0 -8
  1183. package/plugin/dist/core/trajectory.js +0 -1692
  1184. package/plugin/dist/core/workflow-funnel-loader.js +0 -135
  1185. package/plugin/dist/core/workspace-context.js +0 -260
  1186. package/plugin/dist/core/workspace-dir-validation.js +0 -37
  1187. package/plugin/dist/core/workspace-guidance-migrator.js +0 -141
  1188. package/plugin/dist/hooks/after-tool-call-helpers.js +0 -552
  1189. package/plugin/dist/hooks/after-tool-call-types.js +0 -13
  1190. package/plugin/dist/hooks/gate-block-helper.js +0 -249
  1191. package/plugin/dist/hooks/gate.js +0 -430
  1192. package/plugin/dist/hooks/lifecycle.js +0 -284
  1193. package/plugin/dist/hooks/llm.js +0 -452
  1194. package/plugin/dist/hooks/message-sanitize.js +0 -77
  1195. package/plugin/dist/hooks/pain.js +0 -369
  1196. package/plugin/dist/hooks/prompt-helpers.js +0 -288
  1197. package/plugin/dist/hooks/prompt-types.js +0 -12
  1198. package/plugin/dist/hooks/prompt.js +0 -501
  1199. package/plugin/dist/hooks/raw-observation-adapter.js +0 -15
  1200. package/plugin/dist/hooks/raw-observation-types.js +0 -11
  1201. package/plugin/dist/hooks/trajectory-collector.js +0 -164
  1202. package/plugin/dist/hooks/trajectory-evidence.js +0 -92
  1203. package/plugin/dist/hooks/triage-adapter.js +0 -72
  1204. package/plugin/dist/hooks/trigger-cooldown-tracker.js +0 -80
  1205. package/plugin/dist/i18n/commands.js +0 -120
  1206. package/plugin/dist/openclaw-sdk.js +0 -4
  1207. package/plugin/dist/rulehost-evidence.js +0 -3
  1208. package/plugin/dist/service/correction-observer-service.js +0 -191
  1209. package/plugin/dist/service/evolution-dedup.js +0 -54
  1210. package/plugin/dist/service/evolution-worker.js +0 -578
  1211. package/plugin/dist/service/internalization-auto-consumer-service.js +0 -323
  1212. package/plugin/dist/service/keyword-optimization-service.js +0 -137
  1213. package/plugin/dist/service/phase3-input-filter.js +0 -172
  1214. package/plugin/dist/service/queue-io.js +0 -91
  1215. package/plugin/dist/service/queue-migration.js +0 -113
  1216. package/plugin/dist/service/runtime-summary-service.js +0 -639
  1217. package/plugin/dist/service/subagent-workflow/subagent-error-utils.js +0 -23
  1218. package/plugin/dist/service/subagent-workflow/types.js +0 -11
  1219. package/plugin/dist/service/subagent-workflow/workflow-store.js +0 -298
  1220. package/plugin/dist/service/trajectory-service.js +0 -16
  1221. package/plugin/dist/service/workflow-watchdog.js +0 -104
  1222. package/plugin/dist/types/event-types.js +0 -1
  1223. package/plugin/dist/types/hygiene-types.js +0 -1
  1224. package/plugin/dist/types/principle-tree-schema.js +0 -24
  1225. package/plugin/dist/types/queue.js +0 -1
  1226. package/plugin/dist/types/runtime-summary.js +0 -1
  1227. package/plugin/dist/types.js +0 -11
  1228. package/plugin/dist/utils/file-lock.js +0 -310
  1229. package/plugin/dist/utils/hashing.js +0 -25
  1230. package/plugin/dist/utils/io.js +0 -174
  1231. package/plugin/dist/utils/node-vm-polyfill.js +0 -9
  1232. package/plugin/dist/utils/retry.js +0 -380
  1233. package/plugin/dist/utils/session-key.js +0 -21
  1234. package/plugin/dist/utils/workspace-resolver.js +0 -288
@@ -0,0 +1,342 @@
1
+ /**
2
+ * PendingAgentDraftStore tests (Task 11).
3
+ *
4
+ * Verifies insertPendingDraft (incl. idempotency), getUnconsumedByTaskId,
5
+ * markConsumed, and listPending against a real SQLite database.
6
+ *
7
+ * ERR checklist:
8
+ * - EP-01 / ERR-001, ERR-005: agent_draft JSON parsed as unknown; no `as`
9
+ * casts on row data — only `as unknown` then narrowed via isRecord/typeof.
10
+ * - EP-03 / ERR-002: write failures return { ok: false, error } (rc-9).
11
+ * - EP-03 / ERR-009, ERR-010: corrupt agent_draft JSON fails loud (rc-3).
12
+ * - EP-05 / ERR-015: insertPendingDraft reads fresh state via SELECT before
13
+ * INSERT/UPDATE; markConsumed uses UPDATE ... WHERE.
14
+ */
15
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
16
+ import * as path from 'node:path';
17
+ import * as os from 'node:os';
18
+ import * as fs from 'node:fs';
19
+ import { SqliteConnection } from '../../store/sqlite-connection.js';
20
+ import { PendingAgentDraftStore, } from '../pending-agent-draft-store.js';
21
+ function createTestConnection() {
22
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pd-test-pending-draft-'));
23
+ return new SqliteConnection(tmpDir);
24
+ }
25
+ function makeDraft(overrides = {}) {
26
+ return {
27
+ summary: 'peer runner failed',
28
+ observedFailure: 'Error: permanent failure',
29
+ commandSummary: 'last tool call: write_file',
30
+ ...overrides,
31
+ };
32
+ }
33
+ describe('PendingAgentDraftStore', () => {
34
+ let connection = null;
35
+ let store = null;
36
+ beforeEach(() => {
37
+ connection = createTestConnection();
38
+ // Touch getDb() so initSchema() runs (creates pending_agent_drafts table).
39
+ connection.getDb();
40
+ store = new PendingAgentDraftStore(connection);
41
+ });
42
+ afterEach(() => {
43
+ connection?.close();
44
+ });
45
+ describe('insertPendingDraft', () => {
46
+ it('creates a new row with correct fields and returns ok with pad- prefixed id', () => {
47
+ const result = store.insertPendingDraft({
48
+ taskId: 'task-1',
49
+ painId: 'pain-1',
50
+ agentDraft: makeDraft(),
51
+ });
52
+ expect(result.ok).toBe(true);
53
+ if (result.ok) {
54
+ expect(result.id).toMatch(/^pad-/);
55
+ }
56
+ const row = store.getUnconsumedByTaskId('task-1');
57
+ expect(row).not.toBeNull();
58
+ if (!row)
59
+ throw new Error('row is null');
60
+ expect(row.taskId).toBe('task-1');
61
+ expect(row.painId).toBe('pain-1');
62
+ expect(row.consumedAt).toBeNull();
63
+ expect(row.createdAt).toMatch(/^\d{4}-\d{2}-\d{2}T/);
64
+ expect(row.agentDraft.summary).toBe('peer runner failed');
65
+ expect(row.agentDraft.observedFailure).toBe('Error: permanent failure');
66
+ expect(row.agentDraft.commandSummary).toBe('last tool call: write_file');
67
+ });
68
+ it('persists painId as null when not provided', () => {
69
+ store.insertPendingDraft({
70
+ taskId: 'task-no-pain',
71
+ agentDraft: makeDraft(),
72
+ });
73
+ const row = store.getUnconsumedByTaskId('task-no-pain');
74
+ expect(row).not.toBeNull();
75
+ if (!row)
76
+ throw new Error('row is null');
77
+ expect(row.painId).toBeNull();
78
+ });
79
+ it('serializes agentDraft as JSON in the database', () => {
80
+ store.insertPendingDraft({
81
+ taskId: 'task-1',
82
+ agentDraft: makeDraft({ summary: 'special chars: "quotes" \\backslash' }),
83
+ });
84
+ // Read raw row to verify JSON serialization.
85
+ const db = connection.getDb();
86
+ const rawRow = db
87
+ .prepare('SELECT agent_draft FROM pending_agent_drafts WHERE task_id = ?')
88
+ .get('task-1');
89
+ expect(rawRow).toBeDefined();
90
+ if (!rawRow)
91
+ throw new Error('rawRow is null');
92
+ const parsed = JSON.parse(rawRow.agent_draft);
93
+ expect(parsed.summary).toBe('special chars: "quotes" \\backslash');
94
+ });
95
+ it('is idempotent: same taskId second insert updates the existing row, does not create a new one', () => {
96
+ const draft1 = makeDraft({ summary: 'first attempt' });
97
+ const r1 = store.insertPendingDraft({ taskId: 'task-idem', painId: 'pain-1', agentDraft: draft1 });
98
+ expect(r1.ok).toBe(true);
99
+ // Brief delay so createdAt differs (ISO millisecond precision).
100
+ // Use a unique draft so we can verify the update.
101
+ const draft2 = makeDraft({ summary: 'second attempt', observedFailure: 'new failure' });
102
+ const r2 = store.insertPendingDraft({ taskId: 'task-idem', painId: 'pain-2', agentDraft: draft2 });
103
+ expect(r2.ok).toBe(true);
104
+ // The id should be preserved (UPDATE, not INSERT).
105
+ if (r1.ok && r2.ok) {
106
+ expect(r2.id).toBe(r1.id);
107
+ }
108
+ // Count rows for this taskId — should be exactly 1.
109
+ const db = connection.getDb();
110
+ const countRow = db
111
+ .prepare('SELECT COUNT(*) as cnt FROM pending_agent_drafts WHERE task_id = ?')
112
+ .get('task-idem');
113
+ expect(countRow.cnt).toBe(1);
114
+ // The single row should reflect the updated values.
115
+ const row = store.getUnconsumedByTaskId('task-idem');
116
+ expect(row).not.toBeNull();
117
+ if (!row)
118
+ throw new Error('row is null');
119
+ expect(row.agentDraft.summary).toBe('second attempt');
120
+ expect(row.agentDraft.observedFailure).toBe('new failure');
121
+ expect(row.painId).toBe('pain-2');
122
+ });
123
+ it('idempotent update preserves the original row id', () => {
124
+ const r1 = store.insertPendingDraft({
125
+ taskId: 'task-idem-id',
126
+ agentDraft: makeDraft({ summary: 'v1' }),
127
+ });
128
+ expect(r1.ok).toBe(true);
129
+ const originalId = r1.ok ? r1.id : '';
130
+ // Three successive updates — id must stay the same.
131
+ const r2 = store.insertPendingDraft({
132
+ taskId: 'task-idem-id',
133
+ agentDraft: makeDraft({ summary: 'v2' }),
134
+ });
135
+ const r3 = store.insertPendingDraft({
136
+ taskId: 'task-idem-id',
137
+ agentDraft: makeDraft({ summary: 'v3' }),
138
+ });
139
+ expect(r2.ok && r2.id).toBe(originalId);
140
+ expect(r3.ok && r3.id).toBe(originalId);
141
+ const row = store.getUnconsumedByTaskId('task-idem-id');
142
+ expect(row).not.toBeNull();
143
+ if (!row)
144
+ throw new Error('row is null');
145
+ expect(row.id).toBe(originalId);
146
+ expect(row.agentDraft.summary).toBe('v3');
147
+ });
148
+ it('after markConsumed, a new insert creates a fresh row (partial unique index allows it)', () => {
149
+ const r1 = store.insertPendingDraft({
150
+ taskId: 'task-cycle',
151
+ agentDraft: makeDraft({ summary: 'first' }),
152
+ });
153
+ expect(r1.ok).toBe(true);
154
+ const firstId = r1.ok ? r1.id : '';
155
+ // Mark consumed — frees the partial unique index slot for this taskId.
156
+ expect(store.markConsumed(firstId).ok).toBe(true);
157
+ // A new insert should succeed and create a NEW row (different id).
158
+ const r2 = store.insertPendingDraft({
159
+ taskId: 'task-cycle',
160
+ agentDraft: makeDraft({ summary: 'second' }),
161
+ });
162
+ expect(r2.ok).toBe(true);
163
+ const secondId = r2.ok ? r2.id : '';
164
+ expect(secondId).not.toBe(firstId);
165
+ // getUnconsumedByTaskId should return the NEW row, not the consumed one.
166
+ const row = store.getUnconsumedByTaskId('task-cycle');
167
+ expect(row).not.toBeNull();
168
+ if (!row)
169
+ throw new Error('row is null');
170
+ expect(row.id).toBe(secondId);
171
+ expect(row.agentDraft.summary).toBe('second');
172
+ // The consumed row should still exist in the table (just with consumed_at set).
173
+ const db = connection.getDb();
174
+ const countRow = db
175
+ .prepare('SELECT COUNT(*) as cnt FROM pending_agent_drafts WHERE task_id = ?')
176
+ .get('task-cycle');
177
+ expect(countRow.cnt).toBe(2);
178
+ });
179
+ });
180
+ describe('getUnconsumedByTaskId', () => {
181
+ it('returns null when no row exists', () => {
182
+ const row = store.getUnconsumedByTaskId('nonexistent');
183
+ expect(row).toBeNull();
184
+ });
185
+ it('returns null after the only row is consumed', () => {
186
+ store.insertPendingDraft({ taskId: 'task-1', agentDraft: makeDraft() });
187
+ const row = store.getUnconsumedByTaskId('task-1');
188
+ expect(row).not.toBeNull();
189
+ if (!row)
190
+ throw new Error('row is null');
191
+ expect(store.markConsumed(row.id).ok).toBe(true);
192
+ expect(store.getUnconsumedByTaskId('task-1')).toBeNull();
193
+ });
194
+ it('returns the unconsumed row when both a consumed and unconsumed row exist for the same taskId', () => {
195
+ // Insert, consume, then insert again — leaves one consumed + one pending.
196
+ const r1 = store.insertPendingDraft({
197
+ taskId: 'task-multi',
198
+ agentDraft: makeDraft({ summary: 'consumed' }),
199
+ });
200
+ expect(r1.ok).toBe(true);
201
+ expect(store.markConsumed(r1.ok ? r1.id : '').ok).toBe(true);
202
+ const r2 = store.insertPendingDraft({
203
+ taskId: 'task-multi',
204
+ agentDraft: makeDraft({ summary: 'pending' }),
205
+ });
206
+ expect(r2.ok).toBe(true);
207
+ const row = store.getUnconsumedByTaskId('task-multi');
208
+ expect(row).not.toBeNull();
209
+ if (!row)
210
+ throw new Error('row is null');
211
+ expect(row.agentDraft.summary).toBe('pending');
212
+ expect(row.consumedAt).toBeNull();
213
+ });
214
+ });
215
+ describe('markConsumed', () => {
216
+ it('sets consumed_at on an existing row', () => {
217
+ const r = store.insertPendingDraft({ taskId: 'task-1', agentDraft: makeDraft() });
218
+ expect(r.ok).toBe(true);
219
+ const id = r.ok ? r.id : '';
220
+ const markResult = store.markConsumed(id);
221
+ expect(markResult.ok).toBe(true);
222
+ // The row should no longer be returned by getUnconsumedByTaskId.
223
+ expect(store.getUnconsumedByTaskId('task-1')).toBeNull();
224
+ // But it should still exist with consumed_at set.
225
+ const db = connection.getDb();
226
+ const rawRow = db
227
+ .prepare('SELECT consumed_at FROM pending_agent_drafts WHERE id = ?')
228
+ .get(id);
229
+ expect(rawRow).toBeDefined();
230
+ if (!rawRow)
231
+ throw new Error('rawRow is null');
232
+ expect(rawRow.consumed_at).not.toBeNull();
233
+ expect(rawRow.consumed_at).toMatch(/^\d{4}-\d{2}-\d{2}T/);
234
+ });
235
+ it('returns ok:true for a non-existent id (silent success per spec)', () => {
236
+ const result = store.markConsumed('pad-does-not-exist');
237
+ expect(result.ok).toBe(true);
238
+ });
239
+ it('is idempotent: marking an already-consumed row again still returns ok', () => {
240
+ const r = store.insertPendingDraft({ taskId: 'task-1', agentDraft: makeDraft() });
241
+ expect(r.ok).toBe(true);
242
+ const id = r.ok ? r.id : '';
243
+ expect(store.markConsumed(id).ok).toBe(true);
244
+ // Second mark — should still succeed (consumed_at just refreshes).
245
+ const second = store.markConsumed(id);
246
+ expect(second.ok).toBe(true);
247
+ });
248
+ });
249
+ describe('listPending', () => {
250
+ it('returns empty array when no rows exist', () => {
251
+ expect(store.listPending()).toEqual([]);
252
+ });
253
+ it('returns only unconsumed rows, ordered by created_at DESC', () => {
254
+ // Insert three drafts with distinct taskIds. Use raw SQL to set
255
+ // deterministic created_at values so the ORDER BY is unambiguous.
256
+ const db = connection.getDb();
257
+ const baseDraft = JSON.stringify(makeDraft());
258
+ db.prepare('INSERT INTO pending_agent_drafts (id, task_id, pain_id, agent_draft, created_at, consumed_at) VALUES (?, ?, ?, ?, ?, ?)').run('pad-old', 'task-old', null, baseDraft, '2026-07-01T00:00:00Z', null);
259
+ db.prepare('INSERT INTO pending_agent_drafts (id, task_id, pain_id, agent_draft, created_at, consumed_at) VALUES (?, ?, ?, ?, ?, ?)').run('pad-mid', 'task-mid', null, baseDraft, '2026-07-02T00:00:00Z', null);
260
+ db.prepare('INSERT INTO pending_agent_drafts (id, task_id, pain_id, agent_draft, created_at, consumed_at) VALUES (?, ?, ?, ?, ?, ?)').run('pad-new', 'task-new', null, baseDraft, '2026-07-03T00:00:00Z', null);
261
+ // Mark the middle one consumed — it should be excluded.
262
+ expect(store.markConsumed('pad-mid').ok).toBe(true);
263
+ const rows = store.listPending();
264
+ expect(rows).toHaveLength(2);
265
+ // DESC order: newest first.
266
+ if (!rows[0])
267
+ throw new Error('rows[0] is null');
268
+ if (!rows[1])
269
+ throw new Error('rows[1] is null');
270
+ expect(rows[0].id).toBe('pad-new');
271
+ expect(rows[1].id).toBe('pad-old');
272
+ });
273
+ it('respects the limit parameter', () => {
274
+ for (let i = 0; i < 5; i++) {
275
+ store.insertPendingDraft({ taskId: `task-${i}`, agentDraft: makeDraft() });
276
+ }
277
+ const rows = store.listPending({ limit: 2 });
278
+ expect(rows).toHaveLength(2);
279
+ });
280
+ it('defaults to limit=100 when no filter provided', () => {
281
+ for (let i = 0; i < 110; i++) {
282
+ store.insertPendingDraft({ taskId: `task-${i}`, agentDraft: makeDraft() });
283
+ }
284
+ const rows = store.listPending();
285
+ expect(rows).toHaveLength(100);
286
+ });
287
+ });
288
+ describe('agentDraft JSON round-trip (rc-1: treat as unknown)', () => {
289
+ it('preserves nested string fields through serialize/deserialize', () => {
290
+ const draft = {
291
+ summary: 'complex summary with "quotes"',
292
+ observedFailure: 'multi\nline\nfailure',
293
+ commandSummary: 'cmd: foo --bar baz',
294
+ };
295
+ store.insertPendingDraft({ taskId: 'task-complex', agentDraft: draft });
296
+ const row = store.getUnconsumedByTaskId('task-complex');
297
+ expect(row).not.toBeNull();
298
+ if (!row)
299
+ throw new Error('row is null');
300
+ expect(row.agentDraft.summary).toBe(draft.summary);
301
+ expect(row.agentDraft.observedFailure).toBe(draft.observedFailure);
302
+ expect(row.agentDraft.commandSummary).toBe(draft.commandSummary);
303
+ });
304
+ it('preserves a draft with only the required summary field', () => {
305
+ const draft = { summary: 'minimal' };
306
+ store.insertPendingDraft({ taskId: 'task-min', agentDraft: draft });
307
+ const row = store.getUnconsumedByTaskId('task-min');
308
+ expect(row).not.toBeNull();
309
+ if (!row)
310
+ throw new Error('row is null');
311
+ expect(row.agentDraft.summary).toBe('minimal');
312
+ expect(row.agentDraft.observedFailure).toBeUndefined();
313
+ expect(row.agentDraft.commandSummary).toBeUndefined();
314
+ });
315
+ it('fails loud when agent_draft is corrupt JSON (rc-3: no silent fallback)', () => {
316
+ // Insert a row with invalid JSON directly via raw SQL.
317
+ const db = connection.getDb();
318
+ db.prepare('INSERT INTO pending_agent_drafts (id, task_id, pain_id, agent_draft, created_at, consumed_at) VALUES (?, ?, ?, ?, ?, ?)').run('pad-corrupt', 'task-corrupt', null, '{not valid json', '2026-07-04T00:00:00Z', null);
319
+ // getUnconsumedByTaskId should throw (fail loud) rather than return
320
+ // a row with a raw string masquerading as AgentDraftPayload.
321
+ expect(() => store.getUnconsumedByTaskId('task-corrupt')).toThrow(/corrupt agent_draft JSON/);
322
+ // listPending should also throw on the same corrupt row.
323
+ expect(() => store.listPending()).toThrow(/corrupt agent_draft JSON/);
324
+ });
325
+ it('fails loud when agent_draft JSON does not match AgentDraftPayload shape (rc-3)', () => {
326
+ const db = connection.getDb();
327
+ // summary is missing — fails isAgentDraftPayload validation.
328
+ db.prepare('INSERT INTO pending_agent_drafts (id, task_id, pain_id, agent_draft, created_at, consumed_at) VALUES (?, ?, ?, ?, ?, ?)').run('pad-shape', 'task-shape', null, '{"observedFailure":"x"}', '2026-07-04T00:00:00Z', null);
329
+ expect(() => store.getUnconsumedByTaskId('task-shape')).toThrow(/failed shape validation/);
330
+ });
331
+ it('fails loud when agent_draft is empty string (rc-3: corrupt JSON)', () => {
332
+ const db = connection.getDb();
333
+ // Empty string is a string (passes the typeof guard) but is not valid
334
+ // JSON — JSON.parse('') throws SyntaxError. The store must fail loud
335
+ // rather than return a row whose agentDraft is an empty string.
336
+ db.prepare('INSERT INTO pending_agent_drafts (id, task_id, pain_id, agent_draft, created_at, consumed_at) VALUES (?, ?, ?, ?, ?, ?)').run('pad-empty', 'task-empty', null, '', '2026-07-04T00:00:00Z', null);
337
+ // Empty string fails JSON.parse — should fail loud as corrupt JSON.
338
+ expect(() => store.getUnconsumedByTaskId('task-empty')).toThrow(/corrupt agent_draft JSON/);
339
+ });
340
+ });
341
+ });
342
+ //# sourceMappingURL=pending-agent-draft-store.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-agent-draft-store.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,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AAC,0BAA0B,CAAC,CAAC;QAC9F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { FeedbackReport, ValidationError } from './feedback-types.js';
2
+ import type { PendingAgentDraftStore } from './pending-agent-draft-store.js';
2
3
  export type CreateReportResult = {
3
4
  ok: true;
4
5
  report: FeedbackReport;
@@ -9,6 +10,11 @@ export type CreateReportResult = {
9
10
  /**
10
11
  * Create a FeedbackReport from untrusted input + diagnostics.
11
12
  * No `as` casts on untrusted values. Failure paths return structured errors.
13
+ *
14
+ * `maintainerEmail` (optional): when provided as a non-empty string, a
15
+ * `mailto:` URL is built into `report.outputs.mailtoUrl`. When omitted or
16
+ * empty, `mailtoUrl` is ''. The email value itself is not validated for
17
+ * shape — callers decide what address to pass.
12
18
  */
13
- export declare function createFeedbackReport(input: unknown, diagnostics: unknown): CreateReportResult;
19
+ export declare function createFeedbackReport(input: unknown, diagnostics: unknown, maintainerEmail?: string, pendingAgentDraftStore?: PendingAgentDraftStore): CreateReportResult;
14
20
  //# sourceMappingURL=create-report.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-report.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/feedback/create-report.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EAId,eAAe,EAGhB,MAAM,qBAAqB,CAAC;AAiB7B,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACpC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAiI7C;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,OAAO,GACnB,kBAAkB,CAwHpB"}
1
+ {"version":3,"file":"create-report.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/feedback/create-report.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EAId,eAAe,EAIhB,MAAM,qBAAqB,CAAC;AAgB7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACpC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAiI7C;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,OAAO,EACpB,eAAe,CAAC,EAAE,MAAM,EACxB,sBAAsB,CAAC,EAAE,sBAAsB,GAC9C,kBAAkB,CA6KpB"}
@@ -8,7 +8,7 @@ import { isRecord, isString, isUserSeverity, normalizeFeedbackDraftInput, } from
8
8
  import { redactAbsolutePaths, redactTokenLikeValues, redactEnvLikeValues, redactSensitiveFields, } from './redact-sensitive.js';
9
9
  import { renderReportMarkdown } from './render-markdown.js';
10
10
  import { buildGitHubIssueDraftUrl } from './render-github-url.js';
11
- import { buildPrivacyPreview, buildEmailText } from './privacy-preview.js';
11
+ import { buildPrivacyPreview, buildEmailText, buildMailtoUrl } from './privacy-preview.js';
12
12
  const MAX_DESCRIPTION_FOR_REDACT = 8000;
13
13
  const MAX_STEPS_FOR_REDACT = 8000;
14
14
  const MAX_CONTEXT_REFS = 12;
@@ -137,8 +137,14 @@ function collectDiagnostics(diagnostics) {
137
137
  /**
138
138
  * Create a FeedbackReport from untrusted input + diagnostics.
139
139
  * No `as` casts on untrusted values. Failure paths return structured errors.
140
+ *
141
+ * `maintainerEmail` (optional): when provided as a non-empty string, a
142
+ * `mailto:` URL is built into `report.outputs.mailtoUrl`. When omitted or
143
+ * empty, `mailtoUrl` is ''. The email value itself is not validated for
144
+ * shape — callers decide what address to pass.
140
145
  */
141
- export function createFeedbackReport(input, diagnostics) {
146
+ // eslint-disable-next-line @typescript-eslint/max-params -- Task 13: pendingAgentDraftStore added for agent draft merge
147
+ export function createFeedbackReport(input, diagnostics, maintainerEmail, pendingAgentDraftStore) {
142
148
  // Step 1: validate and normalize the input
143
149
  const norm = normalizeFeedbackDraftInput(input);
144
150
  if (!norm.ok) {
@@ -172,11 +178,44 @@ export function createFeedbackReport(input, diagnostics) {
172
178
  if (typeof actualInput === 'string' && actualBehavior !== actualInput) {
173
179
  redactionNotes.push('actualBehavior was redacted');
174
180
  }
181
+ // Task 13: If taskId is provided and a pending agent draft exists, merge it.
182
+ // User-provided agentDraft (from input.agentDraft) takes priority — the
183
+ // agent draft from the store is a fallback for when the user didn't write one.
184
+ let mergedAgentDraft = draft.agentDraft;
185
+ let consumedDraftId;
186
+ if (draft.taskId && pendingAgentDraftStore) {
187
+ try {
188
+ const pendingDraft = pendingAgentDraftStore.getUnconsumedByTaskId(draft.taskId);
189
+ if (pendingDraft) {
190
+ consumedDraftId = pendingDraft.id;
191
+ if (!mergedAgentDraft) {
192
+ // User didn't provide agentDraft — use the store's draft
193
+ mergedAgentDraft = {
194
+ summary: pendingDraft.agentDraft.summary,
195
+ };
196
+ if (pendingDraft.agentDraft.observedFailure) {
197
+ mergedAgentDraft.observedFailure = pendingDraft.agentDraft.observedFailure;
198
+ }
199
+ if (pendingDraft.agentDraft.commandSummary) {
200
+ mergedAgentDraft.commandSummary = pendingDraft.agentDraft.commandSummary;
201
+ }
202
+ }
203
+ // If user provided agentDraft, we still mark the store's draft as consumed
204
+ // (the user's report supersedes the agent's draft — no need to keep it pending)
205
+ }
206
+ }
207
+ catch (err) {
208
+ // rc-9: don't silently swallow store errors — record to redactionNotes
209
+ // and continue without the agent draft. The report still gets created.
210
+ redactionNotes.push(`agent draft lookup failed: ${err instanceof Error ? err.message : String(err)}`);
211
+ }
212
+ }
175
213
  // Step 4: scrub the diagnosticSummary via redactSensitiveFields (defense in
176
214
  // depth — versions and platform should already be low-sensitivity, but
177
215
  // user-injected values must not leak tokens through the field structure).
178
216
  const scrubbed = redactSensitiveFields(diagnosticSummary);
179
217
  const safeDiagnostic = scrubbed.ok
218
+ // runtime-contract-exempt: ERR-001 redactSensitiveFields is a shape-preserving recursive redactor — it only replaces string values and truncates, never changes object structure. The output is guaranteed to match the input's DiagnosticSummary shape by construction.
180
219
  ? scrubbed.value
181
220
  : diagnosticSummary;
182
221
  if (scrubbed.ok) {
@@ -191,15 +230,18 @@ export function createFeedbackReport(input, diagnostics) {
191
230
  // Step 6: build contextRefs from the context object
192
231
  const contextRefs = [];
193
232
  if (draft.context) {
194
- pushContextRef(contextRefs, 'source', { id: draft.context.source, label: `source=${draft.context.source}` });
233
+ const ctxSource = draft.context.source;
234
+ pushContextRef(contextRefs, 'source', { id: ctxSource, label: ctxSource !== undefined ? `source=${ctxSource}` : undefined });
235
+ pushContextRef(contextRefs, 'sourceDetail', { id: draft.context.sourceDetail });
195
236
  pushContextRef(contextRefs, 'page', { id: draft.context.page });
196
237
  pushContextRef(contextRefs, 'painId', { id: draft.context.painId });
197
238
  pushContextRef(contextRefs, 'principleId', { id: draft.context.principleId });
198
239
  pushContextRef(contextRefs, 'approvalId', { id: draft.context.approvalId });
199
240
  pushContextRef(contextRefs, 'activationId', { id: draft.context.activationId });
200
241
  pushContextRef(contextRefs, 'updateAttemptId', { id: draft.context.updateAttemptId });
242
+ pushContextRef(contextRefs, 'taskId', { id: draft.context.taskId });
201
243
  }
202
- if (draft.agentDraft) {
244
+ if (mergedAgentDraft) {
203
245
  pushContextRef(contextRefs, 'agentDraft', { id: 'present', label: 'agentDraft attached' });
204
246
  }
205
247
  // Step 7: build the privacy preview
@@ -227,13 +269,13 @@ export function createFeedbackReport(input, diagnostics) {
227
269
  diagnosticSummary: safeDiagnostic,
228
270
  contextRefs,
229
271
  privacy,
230
- outputs: { markdown: '', emailText: '', githubIssueUrl: '' },
272
+ outputs: { markdown: '', emailText: '', githubIssueUrl: '', mailtoUrl: '' },
231
273
  };
232
274
  // Surface the agent-attached evidence in the report so it propagates to
233
275
  // markdown, emailText, and any later consumer.
234
276
  // Redact sensitive values (paths/tokens/env) from agentDraft string fields.
235
- if (draft.agentDraft) {
236
- const ad = draft.agentDraft;
277
+ if (mergedAgentDraft) {
278
+ const ad = mergedAgentDraft;
237
279
  report.agentDraft = {
238
280
  summary: redactEnvLikeValues(redactAbsolutePaths(redactTokenLikeValues(ad.summary))),
239
281
  };
@@ -252,6 +294,22 @@ export function createFeedbackReport(input, diagnostics) {
252
294
  const shortSummary = `type=${draft.type}; ${description.slice(0, 200)}`;
253
295
  const urlResult = buildGitHubIssueDraftUrl(redactedTitle, draft.type, shortSummary);
254
296
  report.outputs.githubIssueUrl = urlResult.ok ? urlResult.url : '';
297
+ // Step 11: build the mailto: URL when a maintainer email is provided.
298
+ // buildMailtoUrl returns '' for empty/missing email, so the output is
299
+ // always a string (callers without an email get an empty mailtoUrl).
300
+ report.outputs.mailtoUrl = buildMailtoUrl(report, maintainerEmail ?? '');
301
+ // Task 13: Mark the pending agent draft as consumed now that the report
302
+ // has been successfully built. Idempotent — safe to call even if the
303
+ // draft was already consumed or never existed.
304
+ if (consumedDraftId && pendingAgentDraftStore) {
305
+ try {
306
+ pendingAgentDraftStore.markConsumed(consumedDraftId);
307
+ }
308
+ catch (err) {
309
+ // rc-9: record the failure but don't fail the report creation
310
+ report.privacy.redactionNotes.push(`agent draft markConsumed failed: ${err instanceof Error ? err.message : String(err)}`);
311
+ }
312
+ }
255
313
  return { ok: true, report };
256
314
  }
257
315
  //# sourceMappingURL=create-report.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-report.js","sourceRoot":"","sources":["../../../src/runtime-v2/feedback/create-report.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,wEAAwE;AACxE,qDAAqD;AACrD,4HAA4H;AAC5H,oFAAoF;AACpF,uEAAuE;AAWvE,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,2BAA2B,GAC5B,M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AY,CAAC,eAAe,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,8DAA8D;YAC9D,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,oCAAoC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
@@ -2,13 +2,21 @@ export type FeedbackType = 'bug' | 'confusing' | 'privacy_concern' | 'feature_re
2
2
  export type UserSeverity = 'low' | 'medium' | 'high';
3
3
  export type FeedbackSource = 'console' | 'cli' | 'agent';
4
4
  export interface FeedbackContext {
5
- source: FeedbackSource;
5
+ source?: FeedbackSource;
6
+ /**
7
+ * P1-3 (rc-9): Preserves the original `source` value when it is not a valid
8
+ * FeedbackSource enum. For example, `source=failed_tasks_page` is mapped to
9
+ * `source='console'` with `sourceDetail='failed_tasks_page'` so the
10
+ * maintainer can see the concrete entry point without losing the enum.
11
+ */
12
+ sourceDetail?: string;
6
13
  page?: string;
7
14
  painId?: string;
8
15
  principleId?: string;
9
16
  approvalId?: string;
10
17
  activationId?: string;
11
18
  updateAttemptId?: string;
19
+ taskId?: string;
12
20
  }
13
21
  export interface AgentDraft {
14
22
  summary: string;
@@ -38,6 +46,12 @@ export interface FeedbackDraftInput {
38
46
  userSeverity?: unknown;
39
47
  context?: unknown;
40
48
  agentDraft?: unknown;
49
+ /**
50
+ * Task 13: top-level taskId shortcut, independent from context.taskId.
51
+ * When provided, createFeedbackReport uses it to look up a pending agent
52
+ * draft in PendingAgentDraftStore and merge it into the report.
53
+ */
54
+ taskId?: unknown;
41
55
  }
42
56
  /**
43
57
  * The narrowed shape returned by `normalizeFeedbackDraftInput` on success.
@@ -49,6 +63,8 @@ export interface NormalizedDraft {
49
63
  userText: FeedbackUserText;
50
64
  context?: FeedbackContext;
51
65
  agentDraft?: AgentDraft;
66
+ /** Task 13: top-level taskId (validated string), separate from context.taskId. */
67
+ taskId?: string;
52
68
  }
53
69
  export interface RecentEvent {
54
70
  type: string;
@@ -92,6 +108,7 @@ export interface FeedbackReport {
92
108
  markdown: string;
93
109
  emailText: string;
94
110
  githubIssueUrl: string;
111
+ mailtoUrl: string;
95
112
  };
96
113
  }
97
114
  export type ValidationError = {