@powerhousedao/ph-clint-app 0.1.0-dev.72 → 0.1.0-dev.74

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 (229) hide show
  1. package/dist/browser/document-models/index.js +1 -1
  2. package/dist/browser/document-models/ph-clint-project/index.js +3 -3
  3. package/dist/browser/{editor-DL0W2XOS.js → editor-CAZmaheq.js} +825 -261
  4. package/dist/browser/{editor-DL0W2XOS.js.map → editor-CAZmaheq.js.map} +1 -1
  5. package/dist/browser/editors/ph-clint-project-editor/module.js +1 -1
  6. package/dist/browser/index.js +3 -3
  7. package/dist/browser/index.js.map +1 -1
  8. package/dist/browser/{module-DoAlHsjp.js → module-K5q3UobV.js} +1970 -977
  9. package/dist/browser/module-K5q3UobV.js.map +1 -0
  10. package/dist/browser/{ph-clint-project-D634z5c5.js → ph-clint-project-Bbl7jqNw.js} +4 -6
  11. package/dist/browser/ph-clint-project-Bbl7jqNw.js.map +1 -0
  12. package/dist/connect/assets/editor-CQqCB-3d.js +2 -0
  13. package/dist/connect/assets/editor-CQqCB-3d.js.map +1 -0
  14. package/dist/connect/assets/{index-BXAErAWR.js → index-DmrNLi1C.js} +20 -20
  15. package/dist/connect/assets/index-DmrNLi1C.js.map +1 -0
  16. package/dist/connect/assets/index-cjUwUwMU.css +2 -0
  17. package/dist/connect/assets/ph-clint-project-DZ_ZplDv.js +1142 -0
  18. package/dist/connect/assets/ph-clint-project-DZ_ZplDv.js.map +1 -0
  19. package/dist/connect/index.html +3 -3
  20. package/dist/connect/ph-packages.json +1 -1
  21. package/dist/document-models/document-models.d.ts +1 -1
  22. package/dist/document-models/index.d.ts +1 -1
  23. package/dist/document-models/ph-clint-project/index.d.ts +2 -2
  24. package/dist/document-models/ph-clint-project/upgrades/index.d.ts +2 -2
  25. package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts +2 -2
  26. package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts.map +1 -1
  27. package/dist/document-models/ph-clint-project/v1/actions.d.ts +28 -16
  28. package/dist/document-models/ph-clint-project/v1/actions.d.ts.map +1 -1
  29. package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts +29 -19
  30. package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts.map +1 -1
  31. package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts +2 -2
  32. package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts.map +1 -1
  33. package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts +28 -18
  34. package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts.map +1 -1
  35. package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts +6 -6
  36. package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts.map +1 -1
  37. package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts +2 -2
  38. package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts.map +1 -1
  39. package/dist/document-models/ph-clint-project/v1/gen/deployment/error.d.ts +1 -1
  40. package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts +3 -3
  41. package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts.map +1 -1
  42. package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts +1 -1
  43. package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts.map +1 -1
  44. package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts +2 -2
  45. package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts.map +1 -1
  46. package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts +6 -6
  47. package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts.map +1 -1
  48. package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts +2 -2
  49. package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts.map +1 -1
  50. package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts +1 -1
  51. package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts.map +1 -1
  52. package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts +3 -3
  53. package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts.map +1 -1
  54. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts +6 -54
  55. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts.map +1 -1
  56. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts +2 -14
  57. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts.map +1 -1
  58. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts +1 -78
  59. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts.map +1 -1
  60. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts +3 -15
  61. package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts.map +1 -1
  62. package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/actions.d.ts +3 -3
  63. package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts +2 -2
  64. package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts.map +1 -1
  65. package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/error.d.ts +1 -1
  66. package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts +3 -3
  67. package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts.map +1 -1
  68. package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts +4 -4
  69. package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts.map +1 -1
  70. package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts +2 -2
  71. package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts.map +1 -1
  72. package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts +3 -3
  73. package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts.map +1 -1
  74. package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts +5 -5
  75. package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts.map +1 -1
  76. package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts +2 -2
  77. package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts.map +1 -1
  78. package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts +1 -1
  79. package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts.map +1 -1
  80. package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts +3 -3
  81. package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts.map +1 -1
  82. package/dist/document-models/ph-clint-project/v1/gen/index.d.ts +25 -20
  83. package/dist/document-models/ph-clint-project/v1/gen/index.d.ts.map +1 -1
  84. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/actions.d.ts +3 -3
  85. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts +2 -2
  86. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts.map +1 -1
  87. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts +13 -1
  88. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts.map +1 -1
  89. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts +3 -3
  90. package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts.map +1 -1
  91. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts +40 -0
  92. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts.map +1 -0
  93. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts +11 -0
  94. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts.map +1 -0
  95. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts +79 -0
  96. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts.map +1 -0
  97. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts +18 -0
  98. package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts.map +1 -0
  99. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts +28 -0
  100. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts.map +1 -0
  101. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts +8 -0
  102. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts.map +1 -0
  103. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts +36 -0
  104. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts.map +1 -0
  105. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts +15 -0
  106. package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts.map +1 -0
  107. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts +20 -0
  108. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts.map +1 -0
  109. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts +6 -0
  110. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts.map +1 -0
  111. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts +41 -0
  112. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts.map +1 -0
  113. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts +13 -0
  114. package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts.map +1 -0
  115. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts +24 -0
  116. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts.map +1 -0
  117. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts +7 -0
  118. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts.map +1 -0
  119. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts +46 -0
  120. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts.map +1 -0
  121. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts +14 -0
  122. package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts.map +1 -0
  123. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts +24 -0
  124. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts.map +1 -0
  125. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts +7 -0
  126. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts.map +1 -0
  127. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts +51 -0
  128. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts.map +1 -0
  129. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts +14 -0
  130. package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts.map +1 -0
  131. package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts +2 -2
  132. package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts.map +1 -1
  133. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts +7 -7
  134. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts.map +1 -1
  135. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts +2 -2
  136. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts.map +1 -1
  137. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts +1 -1
  138. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts.map +1 -1
  139. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts +3 -3
  140. package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts.map +1 -1
  141. package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts +7 -7
  142. package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts.map +1 -1
  143. package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts +2 -2
  144. package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts.map +1 -1
  145. package/dist/document-models/ph-clint-project/v1/gen/publishing/error.d.ts +1 -1
  146. package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts +3 -3
  147. package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts.map +1 -1
  148. package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts +2 -2
  149. package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts.map +1 -1
  150. package/dist/document-models/ph-clint-project/v1/gen/schema/index.d.ts +2 -2
  151. package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts +214 -129
  152. package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts.map +1 -1
  153. package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts +23 -7
  154. package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts.map +1 -1
  155. package/dist/document-models/ph-clint-project/v1/gen/types.d.ts +5 -5
  156. package/dist/document-models/ph-clint-project/v1/gen/types.d.ts.map +1 -1
  157. package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts +2 -2
  158. package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts.map +1 -1
  159. package/dist/document-models/ph-clint-project/v1/hooks.d.ts +6 -3
  160. package/dist/document-models/ph-clint-project/v1/hooks.d.ts.map +1 -1
  161. package/dist/document-models/ph-clint-project/v1/index.d.ts +6 -6
  162. package/dist/document-models/ph-clint-project/v1/module.d.ts +28 -16
  163. package/dist/document-models/ph-clint-project/v1/module.d.ts.map +1 -1
  164. package/dist/document-models/ph-clint-project/v1/src/index.d.ts +1 -1
  165. package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts +1 -1
  166. package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts.map +1 -1
  167. package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts +1 -1
  168. package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts.map +1 -1
  169. package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts +1 -1
  170. package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts.map +1 -1
  171. package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts +1 -1
  172. package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts.map +1 -1
  173. package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts +1 -1
  174. package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts.map +1 -1
  175. package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts +1 -1
  176. package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts.map +1 -1
  177. package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts +1 -1
  178. package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts.map +1 -1
  179. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts +3 -0
  180. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts.map +1 -0
  181. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts +3 -0
  182. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts.map +1 -0
  183. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts +3 -0
  184. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts.map +1 -0
  185. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts +3 -0
  186. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts.map +1 -0
  187. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts +3 -0
  188. package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts.map +1 -0
  189. package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts +1 -1
  190. package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts.map +1 -1
  191. package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts +1 -1
  192. package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts.map +1 -1
  193. package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts +2 -0
  194. package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts.map +1 -0
  195. package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts +2 -0
  196. package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts.map +1 -0
  197. package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts +2 -0
  198. package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts.map +1 -0
  199. package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts +2 -0
  200. package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts.map +1 -0
  201. package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts +2 -0
  202. package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts.map +1 -0
  203. package/dist/document-models/ph-clint-project/v1/utils.d.ts +2 -2
  204. package/dist/document-models/upgrade-manifests.d.ts +1 -1
  205. package/dist/document-models/upgrade-manifests.d.ts.map +1 -1
  206. package/dist/editors/ph-clint-project-editor/editor.d.ts.map +1 -1
  207. package/dist/node/document-models/index.mjs +1 -1
  208. package/dist/node/document-models/ph-clint-project/index.mjs +3 -3
  209. package/dist/node/{editor-mM5FSNXc.mjs → editor-DOw2BwlR.mjs} +825 -261
  210. package/dist/node/{editor-mM5FSNXc.mjs.map → editor-DOw2BwlR.mjs.map} +1 -1
  211. package/dist/node/editors/ph-clint-project-editor/module.mjs +1 -1
  212. package/dist/node/index.mjs +3 -3
  213. package/dist/node/index.mjs.map +1 -1
  214. package/dist/node/{module-DayL4J7r.mjs → module-DTtUZ4DR.mjs} +1970 -977
  215. package/dist/node/module-DTtUZ4DR.mjs.map +1 -0
  216. package/dist/node/{ph-clint-project-Btx_kiiQ.mjs → ph-clint-project-DFA4zHJv.mjs} +4 -6
  217. package/dist/node/ph-clint-project-DFA4zHJv.mjs.map +1 -0
  218. package/dist/style.css +27 -30
  219. package/package.json +1 -1
  220. package/dist/browser/module-DoAlHsjp.js.map +0 -1
  221. package/dist/browser/ph-clint-project-D634z5c5.js.map +0 -1
  222. package/dist/connect/assets/editor-DgkuaKuV.js +0 -2
  223. package/dist/connect/assets/editor-DgkuaKuV.js.map +0 -1
  224. package/dist/connect/assets/index-BSq-9kCR.css +0 -2
  225. package/dist/connect/assets/index-BXAErAWR.js.map +0 -1
  226. package/dist/connect/assets/ph-clint-project-BRYYVNTj.js +0 -758
  227. package/dist/connect/assets/ph-clint-project-BRYYVNTj.js.map +0 -1
  228. package/dist/node/module-DayL4J7r.mjs.map +0 -1
  229. package/dist/node/ph-clint-project-Btx_kiiQ.mjs.map +0 -1
@@ -1,758 +0,0 @@
1
- import{r as e}from"./chunk-zsgVPwQN.js";import{$ as t,At as n,Ct as r,Dt as i,Et as a,K as ee,Mt as o,Nt as s,Pt as te,Q as ne,St as re,Tt as c,Z as ie,at as ae,ct as oe,et as se,it as l,kt as u,nt as ce,pt as le,st as ue,tt as de,ut as fe,wt as d}from"./lz-string-CSbzFwDi.js";import{G as pe,K as me,Mt as he,dt as ge}from"./dist-BzAXfaNf.js";var _e=e=>e!=null,ve=r().refine(e=>_e(e)),f=re([`Connect`,`Disabled`,`Reactor`,`Switchboard`]),ye=re([`Failed`,`InProgress`,`Pending`,`Succeeded`]),be=re([`Dev`,`Production`,`Staging`]);function xe(){return u({githubUrl:o(),id:n(),name:n()})}function Se(){return u({id:n(),isDefault:c().nullish()})}function Ce(){return u({documentType:n(),packageId:n()})}function p(){return u({id:n(),packageName:n()})}function m(){return u({content:n(),id:n(),insertBefore:n().nullish(),title:n()})}function we(){return u({resource:n()})}function Te(){return u({version:n()})}function Ee(){return u({_:c().nullish()})}function De(){return u({_:c().nullish()})}function Oe(){return u({_:c().nullish()})}function ke(){return u({agentId:n(),agentName:n()})}function h(){return u({_:c().nullish()})}function Ae(){return u({__typename:i(`ExternalSkill`).optional(),githubUrl:o(),id:n(),name:n()})}function je(){return u({id:n(),isDefault:c()})}function Me(){return u({documentTypes:d(n()),id:n(),packageName:n(),version:n().nullish()})}function Ne(){return u({content:n(),id:n(),title:n()})}function Pe(){return u({githubUrl:o(),id:n(),name:n()})}function g(){return u({agentDescription:n().nullish(),agentId:n().nullish(),agentImage:n().nullish(),agentName:n().nullish(),description:n(),enableChat:c().nullish(),externalSkills:d(a(()=>Pe())),mastraEnabled:c(),models:d(a(()=>je())).nullish(),name:n(),observabilityEnabled:c().nullish(),packages:d(a(()=>Me())),powerhouse:f,profiles:d(a(()=>Ne())).nullish(),proxyEnabled:c().nullish(),routineEnabled:c(),scope:n().nullish(),supportedResources:d(n()).nullish(),version:n()})}function Fe(){return u({__typename:i(`PhClintAgentModel`).optional(),id:n(),isDefault:c()})}function Ie(){return u({__typename:i(`PhClintAgentProfile`).optional(),content:n(),id:n(),title:n()})}function Le(){return u({__typename:i(`PhClintDeployment`).optional(),observabilityEnabled:c(),proxyEnabled:c(),supportedResources:d(n())})}function Re(){return u({__typename:i(`PhClintFeatures`).optional(),mastra:a(()=>Be()),powerhouse:f,routine:a(()=>He())})}function ze(){return u({__typename:i(`PhClintMastraCommon`).optional(),enableChat:c()})}function Be(){return u({__typename:i(`PhClintMastraFeature`).optional(),agentDescription:n().nullish(),agentId:n().nullish(),agentImage:n().nullish(),agentName:n().nullish(),common:a(()=>ze()),enabled:c(),models:d(a(()=>Fe())),profiles:d(a(()=>Ie()))})}function Ve(){return u({__typename:i(`PhClintProjectState`).optional(),deployment:a(()=>Le()),description:n(),externalSkills:d(a(()=>Ae())),features:a(()=>Re()),name:n().nullish(),packages:d(a(()=>Ue())),publishHistory:d(a(()=>We())),scope:n().nullish(),version:n()})}function He(){return u({__typename:i(`PhClintRoutineFeature`).optional(),enabled:c()})}function Ue(){return u({__typename:i(`PowerhousePackage`).optional(),documentTypes:d(n()),id:n(),managed:c(),packageName:n(),version:n().nullish()})}function _(){return u({id:n(),timestamp:s()})}function v(){return u({id:n(),timestamp:s()})}function We(){return u({__typename:i(`PublishRecord`).optional(),id:n(),status:ye,tag:be,timestamp:s(),version:n()})}function y(){return u({id:n(),timestamp:s()})}function b(){return u({id:n()})}function x(){return u({id:n()})}function S(){return u({documentType:n(),packageId:n()})}function C(){return u({id:n()})}function w(){return u({id:n()})}function T(){return u({resource:n()})}function E(){return u({ids:d(n()),insertBefore:n().nullish()})}function D(){return u({description:n()})}function O(){return u({agentId:n()})}function k(){return u({image:n()})}function A(){return u({agentName:n()})}function j(){return u({id:n()})}function M(){return u({description:n()})}function N(){return u({enabled:c()})}function P(){return u({githubUrl:o(),id:n()})}function F(){return u({id:n(),name:n()})}function I(){return u({enabled:c()})}function L(){return u({identifier:n()})}function Ge(){return u({packageId:n(),version:n().nullish()})}function R(){return u({level:f,skipAutoProxy:c().nullish()})}function z(){return u({enabled:c()})}function B(){return u({id:n(),status:ye})}function V(){return u({version:n()})}function H(){return u({content:n().nullish(),id:n(),title:n().nullish()})}var Ke=e({addSupportedResource:()=>qe,removeSupportedResource:()=>Je,setObservabilityEnabled:()=>Xe,setProxyEnabled:()=>Ye}),qe=e=>l(`ADD_SUPPORTED_RESOURCE`,{...e},void 0,we,`global`),Je=e=>l(`REMOVE_SUPPORTED_RESOURCE`,{...e},void 0,T,`global`),Ye=e=>l(`SET_PROXY_ENABLED`,{...e},void 0,z,`global`),Xe=e=>l(`SET_OBSERVABILITY_ENABLED`,{...e},void 0,I,`global`),Ze=e({addExternalSkill:()=>Qe,removeExternalSkill:()=>$e,setExternalSkillGithubUrl:()=>tt,setExternalSkillName:()=>et}),Qe=e=>l(`ADD_EXTERNAL_SKILL`,{...e},void 0,xe,`global`),$e=e=>l(`REMOVE_EXTERNAL_SKILL`,{...e},void 0,b,`global`),et=e=>l(`SET_EXTERNAL_SKILL_NAME`,{...e},void 0,F,`global`),tt=e=>l(`SET_EXTERNAL_SKILL_GITHUB_URL`,{...e},void 0,P,`global`),nt=e({addModel:()=>st,addProfile:()=>ut,clearAgentImage:()=>gt,disableMastra:()=>it,enableMastra:()=>rt,removeModel:()=>ct,removeProfile:()=>ft,reorderProfiles:()=>pt,setAgentDescription:()=>mt,setAgentId:()=>at,setAgentImage:()=>ht,setAgentName:()=>ot,setDefaultModel:()=>lt,setEnableChat:()=>_t,updateProfile:()=>dt}),rt=e=>l(`ENABLE_MASTRA`,{...e},void 0,ke,`global`),it=e=>l(`DISABLE_MASTRA`,{...e},void 0,De,`global`),at=e=>l(`SET_AGENT_ID`,{...e},void 0,O,`global`),ot=e=>l(`SET_AGENT_NAME`,{...e},void 0,A,`global`),st=e=>l(`ADD_MODEL`,{...e},void 0,Se,`global`),ct=e=>l(`REMOVE_MODEL`,{...e},void 0,x,`global`),lt=e=>l(`SET_DEFAULT_MODEL`,{...e},void 0,j,`global`),ut=e=>l(`ADD_PROFILE`,{...e},void 0,m,`global`),dt=e=>l(`UPDATE_PROFILE`,{...e},void 0,H,`global`),ft=e=>l(`REMOVE_PROFILE`,{...e},void 0,w,`global`),pt=e=>l(`REORDER_PROFILES`,{...e},void 0,E,`global`),mt=e=>l(`SET_AGENT_DESCRIPTION`,{...e},void 0,D,`global`),ht=e=>l(`SET_AGENT_IMAGE`,{...e},void 0,k,`global`),gt=e=>l(`CLEAR_AGENT_IMAGE`,{...e},void 0,Ee,`global`),_t=e=>l(`SET_ENABLE_CHAT`,{...e},void 0,N,`global`),vt=e({setPowerhouseLevel:()=>yt}),yt=e=>l(`SET_POWERHOUSE_LEVEL`,{...e},void 0,R,`global`),bt=e({disableRoutine:()=>St,enableRoutine:()=>xt}),xt=e=>l(`ENABLE_ROUTINE`,{...e},void 0,h,`global`),St=e=>l(`DISABLE_ROUTINE`,{...e},void 0,Oe,`global`),Ct=e({setDescription:()=>wt,setPackageIdentifier:()=>Et,setVersion:()=>Tt}),wt=e=>l(`SET_DESCRIPTION`,{...e},void 0,M,`global`),Tt=e=>l(`SET_VERSION`,{...e},void 0,V,`global`),Et=e=>l(`SET_PACKAGE_IDENTIFIER`,{...e},void 0,L,`global`),Dt=e({importSpec:()=>Ot}),Ot=e=>l(`IMPORT_SPEC`,{...e},void 0,g,`global`),kt=e({addPackageDocumentType:()=>Mt,addPowerhousePackage:()=>At,removePackageDocumentType:()=>Nt,removePowerhousePackage:()=>jt,setPackageVersion:()=>Pt}),At=e=>l(`ADD_POWERHOUSE_PACKAGE`,{...e},void 0,p,`global`),jt=e=>l(`REMOVE_POWERHOUSE_PACKAGE`,{...e},void 0,C,`global`),Mt=e=>l(`ADD_PACKAGE_DOCUMENT_TYPE`,{...e},void 0,Ce,`global`),Nt=e=>l(`REMOVE_PACKAGE_DOCUMENT_TYPE`,{...e},void 0,S,`global`),Pt=e=>l(`SET_PACKAGE_VERSION`,{...e},void 0,Ge,`global`),Ft=e({bumpVersion:()=>It,publishDev:()=>Lt,publishProduction:()=>zt,publishStaging:()=>Rt,setPublishStatus:()=>Bt}),It=e=>l(`BUMP_VERSION`,{...e},void 0,Te,`global`),Lt=e=>l(`PUBLISH_DEV`,{...e},void 0,_,`global`),Rt=e=>l(`PUBLISH_STAGING`,{...e},void 0,y,`global`),zt=e=>l(`PUBLISH_PRODUCTION`,{...e},void 0,v,`global`),Bt=e=>l(`SET_PUBLISH_STATUS`,{...e},void 0,B,`global`),Vt={...t,...Ct,...vt,...nt,...bt,...kt,...Ze,...Ft,...Dt,...Ke},Ht={id:`powerhouse/ph-clint-project`,name:`PhClintProject`,author:{name:`Powerhouse Inc.`,website:`https://powerhouse.inc`},extension:`pcp`,description:`A ph-clint implementation project specification. Drives code generation of a ph-clint CLI project: identity fields (name, scope, version, description, bin) plus three feature toggles (Powerhouse, Mastra, Routine). Enabling Powerhouse is irreversible; enabling Mastra auto-enables Routine; disabling Routine is blocked while Mastra is on.`,specifications:[{state:{local:{schema:``,examples:[],initialValue:``},global:{schema:`type PhClintProjectState {
2
- name: String
3
- scope: String
4
- version: String!
5
- description: String!
6
- features: PhClintFeatures!
7
- packages: [PowerhousePackage!]!
8
- externalSkills: [ExternalSkill!]!
9
- publishHistory: [PublishRecord!]!
10
- deployment: PhClintDeployment!
11
- }
12
-
13
- type PhClintFeatures {
14
- powerhouse: PowerhouseLevel!
15
- mastra: PhClintMastraFeature!
16
- routine: PhClintRoutineFeature!
17
- }
18
-
19
- enum PowerhouseLevel {
20
- Disabled
21
- Reactor
22
- Switchboard
23
- Connect
24
- }
25
-
26
- type PhClintMastraFeature {
27
- enabled: Boolean!
28
- agentId: String
29
- agentName: String
30
- agentDescription: String
31
- agentImage: String
32
- models: [PhClintAgentModel!]!
33
- profiles: [PhClintAgentProfile!]!
34
- common: PhClintMastraCommon!
35
- }
36
-
37
- type PhClintMastraCommon {
38
- enableChat: Boolean!
39
- }
40
-
41
- type PhClintAgentModel {
42
- id: String!
43
- isDefault: Boolean!
44
- }
45
-
46
- type PhClintAgentProfile {
47
- id: String!
48
- title: String!
49
- content: String!
50
- }
51
-
52
- type PhClintRoutineFeature {
53
- enabled: Boolean!
54
- }
55
-
56
- type PowerhousePackage {
57
- id: OID!
58
- packageName: String!
59
- documentTypes: [String!]!
60
- version: String
61
- managed: Boolean!
62
- }
63
-
64
- type ExternalSkill {
65
- id: OID!
66
- name: String!
67
- githubUrl: URL!
68
- }
69
-
70
- enum PublishTag {
71
- Dev
72
- Staging
73
- Production
74
- }
75
-
76
- enum PublishStatus {
77
- Pending
78
- InProgress
79
- Succeeded
80
- Failed
81
- }
82
-
83
- type PublishRecord {
84
- id: OID!
85
- tag: PublishTag!
86
- version: String!
87
- timestamp: DateTime!
88
- status: PublishStatus!
89
- }
90
-
91
- type PhClintDeployment {
92
- proxyEnabled: Boolean!
93
- observabilityEnabled: Boolean!
94
- supportedResources: [String!]!
95
- }`,examples:[],initialValue:`{
96
- "name": null,
97
- "scope": null,
98
- "version": "0.1.0",
99
- "description": "",
100
- "features": {
101
- "powerhouse": "Disabled",
102
- "mastra": {
103
- "enabled": false,
104
- "agentId": null,
105
- "agentName": null,
106
- "agentDescription": null,
107
- "agentImage": null,
108
- "models": [],
109
- "profiles": [],
110
- "common": { "enableChat": false }
111
- },
112
- "routine": { "enabled": false }
113
- },
114
- "packages": [],
115
- "externalSkills": [],
116
- "publishHistory": [],
117
- "deployment": {
118
- "proxyEnabled": false,
119
- "observabilityEnabled": false,
120
- "supportedResources": [
121
- "vetra-agent-s",
122
- "vetra-agent-m",
123
- "vetra-agent-l",
124
- "vetra-agent-xl",
125
- "vetra-agent-xxl"
126
- ]
127
- }
128
- }`}},modules:[{id:`m-identity`,name:`identity`,description:`Package identity fields: name, scope, version, description, bin`,operations:[{id:`o-set-description`,name:`SET_DESCRIPTION`,description:`Set the package description.`,schema:`input SetDescriptionInput {
129
- description: String!
130
- }`,template:`Set the package description.`,reducer:`state.description = action.input.description;`,errors:[],examples:[],scope:`global`},{id:`o-set-version`,name:`SET_VERSION`,description:`Set the package version. Must be a valid semver string.`,schema:`input SetVersionInput {
131
- version: String!
132
- }`,template:`Set the package version. Must be a valid semver string.`,reducer:`if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {
133
- throw new InvalidVersionError(\`Invalid version: \${action.input.version}\`);
134
- }
135
- state.version = action.input.version;`,errors:[{id:`e-set-version-invalid`,name:`InvalidVersionError`,code:`INVALID_VERSION`,description:`The version must be a valid semver string (major.minor.patch, optionally with prerelease/build metadata).`,template:`Invalid version: {{version}}`}],examples:[],scope:`global`},{id:`o-set-package-identifier`,name:`SET_PACKAGE_IDENTIFIER`,description:`Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'. Auto-adds '-cli' suffix if missing, stores scope with '@' prefix.`,schema:`input SetPackageIdentifierInput {
136
- identifier: String!
137
- }`,template:`Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'.`,reducer:`const trimmed = action.input.identifier.trim();
138
- if (!trimmed) {
139
- throw new InvalidPackageIdentifierError('Package identifier must not be empty');
140
- }
141
- let scopePart = null;
142
- let namePart = trimmed;
143
- if (trimmed.includes('/')) {
144
- const parts = trimmed.split('/');
145
- if (parts.length !== 2 || !parts[0] || !parts[1]) {
146
- throw new InvalidPackageIdentifierError(\`Invalid package identifier: \${trimmed}\`);
147
- }
148
- scopePart = parts[0].replace(/^@/, '');
149
- namePart = parts[1];
150
- }
151
- if (scopePart !== null) {
152
- if (!/^[a-z][a-z0-9-]*$/.test(scopePart)) {
153
- throw new InvalidPackageIdentifierError(\`Invalid scope: \${scopePart}\`);
154
- }
155
- }
156
- if (!namePart.endsWith('-cli')) {
157
- namePart = namePart + '-cli';
158
- }
159
- if (!/^[a-z][a-z0-9-]*$/.test(namePart)) {
160
- throw new InvalidPackageIdentifierError(\`Invalid package name: \${namePart}\`);
161
- }
162
- state.scope = scopePart ? \`@\${scopePart}\` : null;
163
- state.name = namePart;
164
- const managed = state.packages.find((p) => p.managed);
165
- if (managed) {
166
- const appBase = namePart.replace(/-cli$/, '-app');
167
- managed.packageName = scopePart ? \`@\${scopePart}/\${appBase}\` : appBase;
168
- managed.id = \`app-\${namePart}\`;
169
- }`,errors:[{id:`e-invalid-package-identifier`,name:`InvalidPackageIdentifierError`,code:`INVALID_PACKAGE_IDENTIFIER`,description:`The package identifier is invalid. Must be a valid npm package name with optional scope.`,template:``}],examples:[],scope:`global`}]},{id:`m-features-powerhouse`,name:`features_powerhouse`,description:`Powerhouse integration level. Ordered enum: Disabled < Reactor < Switchboard < Connect. Once above Disabled, cannot go back to Disabled (irreversible migration).`,operations:[{id:`o-set-powerhouse-level`,name:`SET_POWERHOUSE_LEVEL`,description:`Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).`,schema:`input SetPowerhouseLevelInput {
170
- level: PowerhouseLevel!
171
- skipAutoProxy: Boolean
172
- }`,template:`Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).`,reducer:`const LEVELS = ['Disabled', 'Reactor', 'Switchboard', 'Connect'];
173
- const current = LEVELS.indexOf(state.features.powerhouse);
174
- const next = LEVELS.indexOf(action.input.level);
175
- if (current >= 1 && next < 1) {
176
- throw new CannotLowerPowerhouseError(
177
- 'Cannot lower Powerhouse level below Reactor once enabled',
178
- );
179
- }
180
- state.features.powerhouse = action.input.level;
181
- if (current === 0 && next >= 1) {
182
- const hasManaged = state.packages.some((p) => p.managed);
183
- if (!hasManaged) {
184
- const baseName = state.name
185
- ? state.name.replace(/-cli$/, '-app')
186
- : 'app';
187
- const appName =
188
- state.scope && state.name
189
- ? \`\${state.scope}/\${baseName}\`
190
- : baseName;
191
- state.packages.push({
192
- id: \`app-\${state.name || 'managed'}\`,
193
- packageName: appName,
194
- documentTypes: ['*/*'],
195
- version: null,
196
- managed: true,
197
- });
198
- }
199
- }
200
- if (next >= 2 && !action.input.skipAutoProxy) {
201
- state.deployment.proxyEnabled = true;
202
- }`,errors:[{id:`e-cannot-lower-powerhouse`,name:`CannotLowerPowerhouseError`,code:`CANNOT_LOWER_POWERHOUSE`,description:`Cannot lower the Powerhouse level below Reactor once it has been set above Disabled.`,template:`Cannot lower Powerhouse level below Reactor once enabled`}],examples:[],scope:`global`}]},{id:`m-features-mastra`,name:`features_mastra`,description:`Mastra agent feature toggle. Orthogonal to Routine.`,operations:[{id:`o-enable-mastra`,name:`ENABLE_MASTRA`,description:`Enable the Mastra agent feature. Mastra and Routine are orthogonal — enable Routine separately if needed. Idempotent.`,schema:`input EnableMastraInput {
203
- agentId: String!
204
- agentName: String!
205
- }`,template:`Enable the Mastra agent feature. Mastra and Routine are orthogonal — enable Routine separately if needed. Idempotent.`,reducer:`if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {
206
- throw new InvalidAgentIdError(
207
- \`Invalid agent ID: \${action.input.agentId}. Must be lowercase kebab-case.\`,
208
- );
209
- }
210
- const trimmedName = action.input.agentName.trim();
211
- if (!trimmedName) {
212
- throw new InvalidAgentNameError('Agent name must not be empty.');
213
- }
214
- state.features.mastra.enabled = true;
215
- state.features.mastra.agentId = action.input.agentId;
216
- state.features.mastra.agentName = trimmedName;
217
- // Auto-add default model and profile
218
- if (state.features.mastra.models.length === 0) {
219
- state.features.mastra.models.push({ id: 'clint/demo-agent', isDefault: true });
220
- }
221
- if (state.features.mastra.profiles.length === 0) {
222
- state.features.mastra.profiles.push({ id: 'base', title: 'Base Profile', content: 'You are a helpful assistant.' });
223
- }`,errors:[{id:`e-enable-mastra-invalid-id`,name:`InvalidAgentIdError`,code:`INVALID_AGENT_ID`,description:`The agent ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.`,template:``},{id:`e-enable-mastra-invalid-name`,name:`InvalidAgentNameError`,code:`INVALID_AGENT_NAME`,description:`The agent name must not be empty after trimming.`,template:``}],examples:[],scope:`global`},{id:`o-disable-mastra`,name:`DISABLE_MASTRA`,description:`Disable the Mastra agent feature. Does not affect Routine — disable that separately if desired.`,schema:`input DisableMastraInput {
224
- _: Boolean
225
- }`,template:`Disable the Mastra agent feature. Does not affect Routine — disable that separately if desired.`,reducer:`state.features.mastra.enabled = false;
226
- state.features.mastra.agentId = null;
227
- state.features.mastra.agentName = null;
228
- state.features.mastra.agentDescription = null;
229
- state.features.mastra.agentImage = null;
230
- state.features.mastra.models = [];
231
- state.features.mastra.profiles = [];
232
- state.features.mastra.common.enableChat = false;
233
- // Remove auto-added clint-common package if managed
234
- const ccIdx = state.packages.findIndex(
235
- (p) => p.packageName === '@powerhousedao/clint-common' && p.managed,
236
- );
237
- if (ccIdx !== -1) {
238
- state.packages.splice(ccIdx, 1);
239
- }`,errors:[],examples:[],scope:`global`},{id:`o-set-agent-id`,name:`SET_AGENT_ID`,description:`Set the agent ID. Must be lowercase kebab-case. Only valid when mastra is enabled.`,schema:`input SetAgentIdInput {
240
- agentId: String!
241
- }`,template:`Set the agent ID. Must be lowercase kebab-case. Only valid when mastra is enabled.`,reducer:`if (!state.features.mastra.enabled) {
242
- throw new MastraNotEnabledError('Cannot set agent ID when Mastra is disabled.');
243
- }
244
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {
245
- throw new InvalidAgentIdError(\`Invalid agent ID: \${action.input.agentId}. Must be lowercase kebab-case.\`);
246
- }
247
- state.features.mastra.agentId = action.input.agentId;`,errors:[{id:`e-set-agent-id-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before setting agent identity.`,template:``},{id:`e-set-agent-id-invalid`,name:`InvalidAgentIdError`,code:`INVALID_AGENT_ID`,description:`The agent ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.`,template:``}],examples:[],scope:`global`},{id:`o-set-agent-name`,name:`SET_AGENT_NAME`,description:`Set the agent display name. Must be non-empty after trim. Only valid when mastra is enabled.`,schema:`input SetAgentNameInput {
248
- agentName: String!
249
- }`,template:`Set the agent display name. Must be non-empty after trim. Only valid when mastra is enabled.`,reducer:`if (!state.features.mastra.enabled) {
250
- throw new MastraNotEnabledError('Cannot set agent name when Mastra is disabled.');
251
- }
252
- const trimmedName = action.input.agentName.trim();
253
- if (!trimmedName) {
254
- throw new InvalidAgentNameError('Agent name must not be empty.');
255
- }
256
- state.features.mastra.agentName = trimmedName;`,errors:[{id:`e-set-agent-name-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before setting agent identity.`,template:``},{id:`e-set-agent-name-invalid`,name:`InvalidAgentNameError`,code:`INVALID_AGENT_NAME`,description:`The agent name must not be empty after trimming.`,template:``}],examples:[],scope:`global`},{id:`o-add-model`,name:`ADD_MODEL`,description:`Add a model to the agent. ID must be provider/model-name format. First model is forced default. If isDefault is true, previous default is unset.`,schema:`input AddModelInput {
257
- id: String!
258
- isDefault: Boolean
259
- }`,template:`Add a model to the agent. ID must be provider/model-name format. First model is forced default. If isDefault is true, previous default is unset.`,reducer:`if (!state.features.mastra.enabled) {
260
- throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');
261
- }
262
- if (!/^[a-z0-9-]+\\/[a-z0-9._-]+$/.test(action.input.id)) {
263
- throw new InvalidModelIdError(\`Invalid model ID: \${action.input.id}. Must be provider/model-name format.\`);
264
- }
265
- if (state.features.mastra.models.find(m => m.id === action.input.id)) {
266
- throw new DuplicateModelError(\`Model already exists: \${action.input.id}\`);
267
- }
268
- const isFirst = state.features.mastra.models.length === 0;
269
- const makeDefault = isFirst || action.input.isDefault === true;
270
- if (makeDefault) {
271
- for (const m of state.features.mastra.models) {
272
- m.isDefault = false;
273
- }
274
- }
275
- state.features.mastra.models.push({
276
- id: action.input.id,
277
- isDefault: makeDefault,
278
- });`,errors:[{id:`e-add-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing models.`,template:``},{id:`e-add-model-invalid-id`,name:`InvalidModelIdError`,code:`INVALID_MODEL_ID`,description:`Model ID must match provider/model-name format.`,template:``},{id:`e-add-model-duplicate`,name:`DuplicateModelError`,code:`DUPLICATE_MODEL`,description:`A model with this ID already exists.`,template:``}],examples:[],scope:`global`},{id:`o-remove-model`,name:`REMOVE_MODEL`,description:`Remove a model. If removing the default and others remain, promotes first remaining to default.`,schema:`input RemoveModelInput {
279
- id: String!
280
- }`,template:`Remove a model. If removing the default and others remain, promotes first remaining to default.`,reducer:`if (!state.features.mastra.enabled) {
281
- throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');
282
- }
283
- const idx = state.features.mastra.models.findIndex(m => m.id === action.input.id);
284
- if (idx === -1) {
285
- throw new ModelNotFoundError(\`Model not found: \${action.input.id}\`);
286
- }
287
- const wasDefault = state.features.mastra.models[idx].isDefault;
288
- state.features.mastra.models.splice(idx, 1);
289
- if (wasDefault && state.features.mastra.models.length > 0) {
290
- state.features.mastra.models[0].isDefault = true;
291
- }`,errors:[{id:`e-remove-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing models.`,template:``},{id:`e-remove-model-not-found`,name:`ModelNotFoundError`,code:`MODEL_NOT_FOUND`,description:`The specified model was not found.`,template:``}],examples:[],scope:`global`},{id:`o-set-default-model`,name:`SET_DEFAULT_MODEL`,description:`Set a model as the default. Unsets the previous default.`,schema:`input SetDefaultModelInput {
292
- id: String!
293
- }`,template:`Set a model as the default. Unsets the previous default.`,reducer:`if (!state.features.mastra.enabled) {
294
- throw new MastraNotEnabledError('Cannot set default model when Mastra is disabled.');
295
- }
296
- const model = state.features.mastra.models.find(m => m.id === action.input.id);
297
- if (!model) {
298
- throw new ModelNotFoundError(\`Model not found: \${action.input.id}\`);
299
- }
300
- for (const m of state.features.mastra.models) {
301
- m.isDefault = false;
302
- }
303
- model.isDefault = true;`,errors:[{id:`e-set-default-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing models.`,template:``},{id:`e-set-default-model-not-found`,name:`ModelNotFoundError`,code:`MODEL_NOT_FOUND`,description:`The specified model was not found.`,template:``}],examples:[],scope:`global`},{id:`o-add-profile`,name:`ADD_PROFILE`,description:`Add an agent profile section. Inserted before insertBefore if provided, otherwise appended to end.`,schema:`input AddProfileInput {
304
- id: String!
305
- title: String!
306
- content: String!
307
- insertBefore: String
308
- }`,template:`Add an agent profile section. Inserted before insertBefore if provided, otherwise appended to end.`,reducer:`if (!state.features.mastra.enabled) {
309
- throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');
310
- }
311
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {
312
- throw new InvalidProfileIdError(\`Invalid profile ID: \${action.input.id}. Must be lowercase kebab-case.\`);
313
- }
314
- if (state.features.mastra.profiles.find(p => p.id === action.input.id)) {
315
- throw new DuplicateProfileError(\`Profile already exists: \${action.input.id}\`);
316
- }
317
- const profile = {
318
- id: action.input.id,
319
- title: action.input.title,
320
- content: action.input.content,
321
- };
322
- if (action.input.insertBefore) {
323
- const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);
324
- if (beforeIdx === -1) {
325
- throw new ProfileNotFoundError(\`insertBefore profile not found: \${action.input.insertBefore}\`);
326
- }
327
- state.features.mastra.profiles.splice(beforeIdx, 0, profile);
328
- } else {
329
- state.features.mastra.profiles.push(profile);
330
- }`,errors:[{id:`e-add-profile-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-add-profile-invalid-id`,name:`InvalidProfileIdError`,code:`INVALID_PROFILE_ID`,description:`Profile ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.`,template:``},{id:`e-add-profile-duplicate`,name:`DuplicateProfileError`,code:`DUPLICATE_PROFILE`,description:`A profile with this ID already exists.`,template:``},{id:`e-add-profile-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`The insertBefore profile was not found.`,template:``}],examples:[],scope:`global`},{id:`o-update-profile`,name:`UPDATE_PROFILE`,description:`Update an existing profile's title and/or content. Only updates provided fields.`,schema:`input UpdateProfileInput {
331
- id: String!
332
- title: String
333
- content: String
334
- }`,template:`Update an existing profile's title and/or content. Only updates provided fields.`,reducer:`if (!state.features.mastra.enabled) {
335
- throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');
336
- }
337
- const profile = state.features.mastra.profiles.find(p => p.id === action.input.id);
338
- if (!profile) {
339
- throw new ProfileNotFoundError(\`Profile not found: \${action.input.id}\`);
340
- }
341
- if (action.input.title) profile.title = action.input.title;
342
- if (action.input.content) profile.content = action.input.content;`,errors:[{id:`e-update-profile-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-update-profile-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`The specified profile was not found.`,template:``}],examples:[],scope:`global`},{id:`o-remove-profile`,name:`REMOVE_PROFILE`,description:`Remove an agent profile section.`,schema:`input RemoveProfileInput {
343
- id: String!
344
- }`,template:`Remove an agent profile section.`,reducer:`if (!state.features.mastra.enabled) {
345
- throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');
346
- }
347
- const idx = state.features.mastra.profiles.findIndex(p => p.id === action.input.id);
348
- if (idx === -1) {
349
- throw new ProfileNotFoundError(\`Profile not found: \${action.input.id}\`);
350
- }
351
- state.features.mastra.profiles.splice(idx, 1);`,errors:[{id:`e-remove-profile-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-remove-profile-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`The specified profile was not found.`,template:``}],examples:[],scope:`global`},{id:`o-reorder-profiles`,name:`REORDER_PROFILES`,description:`Move one or more profiles before another profile, or to the end if insertBefore is null.`,schema:`input ReorderProfilesInput {
352
- ids: [String!]!
353
- insertBefore: String
354
- }`,template:`Move one or more profiles before another profile, or to the end if insertBefore is null.`,reducer:`if (!state.features.mastra.enabled) {
355
- throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');
356
- }
357
- const moving = [];
358
- for (const id of action.input.ids) {
359
- const profile = state.features.mastra.profiles.find(p => p.id === id);
360
- if (!profile) {
361
- throw new ProfileNotFoundError(\`Profile not found: \${id}\`);
362
- }
363
- moving.push(profile);
364
- }
365
- // Remove moved profiles
366
- state.features.mastra.profiles = state.features.mastra.profiles.filter(p => !action.input.ids.includes(p.id));
367
- // Insert at target position
368
- if (action.input.insertBefore) {
369
- const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);
370
- if (beforeIdx === -1) {
371
- throw new ProfileNotFoundError(\`insertBefore profile not found: \${action.input.insertBefore}\`);
372
- }
373
- state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);
374
- } else {
375
- state.features.mastra.profiles.push(...moving);
376
- }`,errors:[{id:`e-reorder-profiles-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-reorder-profiles-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`A referenced profile was not found.`,template:``}],examples:[],scope:`global`},{id:`o-set-agent-description`,name:`SET_AGENT_DESCRIPTION`,description:`Set the agent description. Only valid when mastra is enabled.`,schema:`input SetAgentDescriptionInput {
377
- description: String!
378
- }`,template:`Set the agent description. Only valid when mastra is enabled.`,reducer:`if (!state.features.mastra.enabled) {
379
- throw new MastraNotEnabledError('Cannot set agent description when Mastra is disabled.');
380
- }
381
- state.features.mastra.agentDescription = action.input.description;`,errors:[{id:`e-set-agent-desc-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before setting agent description.`,template:``}],examples:[],scope:`global`},{id:`o-set-agent-image`,name:`SET_AGENT_IMAGE`,description:`Set the agent image URL (avatar). Only valid when mastra is enabled.`,schema:`input SetAgentImageInput {
382
- image: String!
383
- }`,template:`Set the agent image URL (avatar). Only valid when mastra is enabled.`,reducer:`if (!state.features.mastra.enabled) {
384
- throw new MastraNotEnabledError(
385
- 'Cannot set agent image when Mastra is disabled.',
386
- );
387
- }
388
- if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.image)) {
389
- throw new InvalidAgentImageError(
390
- 'Agent image must be a data URL (data:image/...;base64,...)',
391
- );
392
- }
393
- state.features.mastra.agentImage = action.input.image;`,errors:[{id:`e-set-agent-image-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before setting agent image.`,template:``},{id:`e-invalid-agent-image`,name:`InvalidAgentImageError`,code:`INVALID_AGENT_IMAGE`,description:`Agent image must be a data URL`,template:``}],examples:[],scope:`global`},{id:`o-clear-agent-image`,name:`CLEAR_AGENT_IMAGE`,description:``,schema:`input ClearAgentImageInput {
394
- _: Boolean
395
- }`,template:``,reducer:`if (!state.features.mastra.enabled) {
396
- throw new MastraNotEnabledError(
397
- 'Cannot clear agent image when Mastra is disabled.',
398
- );
399
- }
400
- state.features.mastra.agentImage = null;`,errors:[{id:`e-mastra-not-enabled-clear-img`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled`,template:``}],examples:[],scope:`global`},{id:`o-set-enable-chat`,name:`SET_ENABLE_CHAT`,description:`Enable or disable the chat integration. When enabled, auto-adds @powerhousedao/clint-common as a managed package with powerhouse/chat-session doc type. When disabled, removes it if it only has that doc type.`,schema:`input SetEnableChatInput {
401
- enabled: Boolean!
402
- }`,template:`Toggle the chat integration feature. Requires both Mastra and Powerhouse to be enabled.`,reducer:`if (!state.features.mastra.enabled) {
403
- throw new MastraNotEnabledError('Cannot toggle chat when Mastra is disabled.');
404
- }
405
- if (state.features.powerhouse === 'Disabled') {
406
- throw new PowerhouseNotEnabledError('Cannot toggle chat when Powerhouse is disabled.');
407
- }
408
- state.features.mastra.common.enableChat = action.input.enabled;
409
- const CLINT_COMMON_PKG = '@powerhousedao/clint-common';
410
- const CHAT_DOC_TYPE = 'powerhouse/chat-session';
411
- if (action.input.enabled) {
412
- const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);
413
- if (!existing) {
414
- state.packages.push({
415
- id: 'pkg-clint-common',
416
- packageName: CLINT_COMMON_PKG,
417
- documentTypes: [CHAT_DOC_TYPE],
418
- version: null,
419
- managed: true,
420
- });
421
- } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {
422
- existing.documentTypes.push(CHAT_DOC_TYPE);
423
- }
424
- } else {
425
- const idx = state.packages.findIndex(
426
- (p) => p.packageName === CLINT_COMMON_PKG && p.managed,
427
- );
428
- if (idx !== -1) {
429
- const pkg = state.packages[idx];
430
- if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) {
431
- state.packages.splice(idx, 1);
432
- } else {
433
- const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);
434
- if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);
435
- }
436
- }
437
- }`,errors:[{id:`e-chat-mastra-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before toggling chat.`,template:``},{id:`e-chat-powerhouse-not-enabled`,name:`PowerhouseNotEnabledError`,code:`POWERHOUSE_NOT_ENABLED`,description:`Powerhouse must be enabled (Reactor or above) before toggling chat.`,template:``}],examples:[],scope:`global`}]},{id:`m-features-routine`,name:`features_routine`,description:`Routine loop feature toggle.`,operations:[{id:`o-enable-routine`,name:`ENABLE_ROUTINE`,description:`Enable the routine loop. Idempotent.`,schema:`input EnableRoutineInput {
438
- _: Boolean
439
- }`,template:`Enable the routine loop. Idempotent.`,reducer:`state.features.routine.enabled = true;`,errors:[],examples:[],scope:`global`},{id:`o-disable-routine`,name:`DISABLE_ROUTINE`,description:`Disable the routine loop. Always allowed.`,schema:`input DisableRoutineInput {
440
- _: Boolean
441
- }`,template:`Disable the routine loop.`,reducer:`state.features.routine.enabled = false;`,errors:[],examples:[],scope:`global`}]},{id:`m-powerhouse-packages`,name:`powerhouse_packages`,description:`Manage reactor packages and their document types. The app package is auto-created when Powerhouse level goes above Disabled.`,operations:[{id:`o-add-powerhouse-package`,name:`ADD_POWERHOUSE_PACKAGE`,description:`Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.`,schema:`input AddPowerhousePackageInput {
442
- id: OID!
443
- packageName: String!
444
- }`,template:`Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.`,reducer:`const exists = state.packages.find(
445
- (p) =>
446
- p.id === action.input.id ||
447
- p.packageName === action.input.packageName,
448
- );
449
- if (exists) {
450
- throw new DuplicatePackageError(
451
- \`Package already exists: \${action.input.packageName}\`,
452
- );
453
- }
454
- state.packages.push({
455
- id: action.input.id,
456
- packageName: action.input.packageName,
457
- documentTypes: [],
458
- version: null,
459
- managed: false,
460
- });`,errors:[{id:`e-duplicate-package`,name:`DuplicatePackageError`,code:`DUPLICATE_PACKAGE`,description:`A package with the same ID or name already exists.`,template:``}],examples:[],scope:`global`},{id:`o-remove-powerhouse-package`,name:`REMOVE_POWERHOUSE_PACKAGE`,description:`Remove a reactor package. Cannot remove the auto-managed app package.`,schema:`input RemovePowerhousePackageInput {
461
- id: OID!
462
- }`,template:`Remove a reactor package. Cannot remove the auto-managed app package.`,reducer:`const idx = state.packages.findIndex((p) => p.id === action.input.id);
463
- if (idx === -1) {
464
- throw new PackageNotFoundError(\`Package not found: \${action.input.id}\`);
465
- }
466
- const pkg = state.packages[idx];
467
- if (pkg.managed) {
468
- throw new CannotRemoveManagedPackageError(
469
- "Cannot remove a managed package",
470
- );
471
- }
472
- state.packages.splice(idx, 1);`,errors:[{id:`e-package-not-found-remove`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`The specified package ID was not found.`,template:``},{id:`e-cannot-remove-app-package`,name:`CannotRemoveAppPackageError`,code:`CANNOT_REMOVE_APP_PACKAGE`,description:`The auto-managed app package cannot be removed.`,template:``},{id:`e-cannot-remove-managed`,name:`CannotRemoveManagedPackageError`,code:`CANNOT_REMOVE_MANAGED_PACKAGE`,description:`Cannot remove a managed (framework-controlled) package`,template:``}],examples:[],scope:`global`},{id:`o-add-package-document-type`,name:`ADD_PACKAGE_DOCUMENT_TYPE`,description:`Add a document type ID to a package (app or external).`,schema:`input AddPackageDocumentTypeInput {
473
- packageId: OID!
474
- documentType: String!
475
- }`,template:`Add a document type ID to a package (app or external).`,reducer:`if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\/[a-z0-9-]+$/.test(action.input.documentType)) {
476
- throw new InvalidDocumentTypeError(
477
- \`Invalid document type format: \${action.input.documentType}. Expected org/name.\`,
478
- );
479
- }
480
- const pkg = state.packages.find((p) => p.id === action.input.packageId);
481
- if (!pkg) {
482
- throw new PackageNotFoundError(
483
- \`Package not found: \${action.input.packageId}\`,
484
- );
485
- }
486
- if (action.input.documentType === '*/*') {
487
- pkg.documentTypes.length = 0;
488
- pkg.documentTypes.push('*/*');
489
- return;
490
- }
491
- if (pkg.documentTypes.includes('*/*')) {
492
- return;
493
- }
494
- if (pkg.documentTypes.includes(action.input.documentType)) {
495
- throw new DuplicateDocumentTypeError(
496
- \`Document type already registered: \${action.input.documentType}\`,
497
- );
498
- }
499
- pkg.documentTypes.push(action.input.documentType);`,errors:[{id:`e-invalid-document-type`,name:`InvalidDocumentTypeError`,code:`INVALID_DOCUMENT_TYPE`,description:`Document type must match org/name format (e.g. powerhouse/ph-clint-project).`,template:``},{id:`e-package-not-found-add-dt`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`The specified package ID was not found.`,template:``},{id:`e-duplicate-document-type`,name:`DuplicateDocumentTypeError`,code:`DUPLICATE_DOCUMENT_TYPE`,description:`This document type is already registered in the package.`,template:``}],examples:[],scope:`global`},{id:`o-remove-package-document-type`,name:`REMOVE_PACKAGE_DOCUMENT_TYPE`,description:`Remove a document type ID from a package.`,schema:`input RemovePackageDocumentTypeInput {
500
- packageId: OID!
501
- documentType: String!
502
- }`,template:`Remove a document type ID from a package.`,reducer:`const pkg = state.packages.find(p => p.id === action.input.packageId);
503
- if (!pkg) {
504
- throw new PackageNotFoundError(\`Package not found: \${action.input.packageId}\`);
505
- }
506
- const idx = pkg.documentTypes.indexOf(action.input.documentType);
507
- if (idx === -1) {
508
- throw new DocumentTypeNotFoundError(\`Document type not found: \${action.input.documentType}\`);
509
- }
510
- pkg.documentTypes.splice(idx, 1);`,errors:[{id:`e-package-not-found-rm-dt`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`The specified package ID was not found.`,template:``},{id:`e-document-type-not-found`,name:`DocumentTypeNotFoundError`,code:`DOCUMENT_TYPE_NOT_FOUND`,description:`The specified document type was not found in this package.`,template:``}],examples:[],scope:`global`},{id:`o-set-package-version`,name:`SET_PACKAGE_VERSION`,description:``,schema:`input SetPackageVersionInput {
511
- packageId: OID!
512
- version: String
513
- }`,template:``,reducer:`const pkg = state.packages.find((p) => p.id === action.input.packageId);
514
- if (!pkg) {
515
- throw new PackageNotFoundError(
516
- \`Package not found: \${action.input.packageId}\`,
517
- );
518
- }
519
- if (action.input.version != null) {
520
- const SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;
521
- if (!SEMVER.test(action.input.version)) {
522
- throw new InvalidVersionError(
523
- \`Invalid version: \${action.input.version}\`,
524
- );
525
- }
526
- }
527
- pkg.version = action.input.version || null;`,errors:[{id:`e-pkg-not-found-set-ver`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`Referenced package does not exist`,template:``},{id:`e-invalid-version`,name:`InvalidVersionError`,code:`INVALID_VERSION`,description:`Version string is not valid semver`,template:``}],examples:[],scope:`global`}]},{id:`m-external-skills`,name:`external_skills`,description:`External skills from the skills.sh ecosystem. Each skill has a name and GitHub URL for installation.`,operations:[{id:`o-add-external-skill`,name:`ADD_EXTERNAL_SKILL`,description:`Add an external skill. Name must be lowercase kebab-case.`,schema:`input AddExternalSkillInput {
528
- id: OID!
529
- name: String!
530
- githubUrl: URL!
531
- }`,template:`Add an external skill. Name must be lowercase kebab-case.`,reducer:`if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {
532
- throw new InvalidSkillNameError(\`Invalid skill name: \${action.input.name}. Must be lowercase kebab-case.\`);
533
- }
534
- const exists = state.externalSkills.find(s => s.id === action.input.id || s.name === action.input.name);
535
- if (exists) {
536
- throw new DuplicateSkillError(\`Skill already exists: \${action.input.name}\`);
537
- }
538
- state.externalSkills.push({
539
- id: action.input.id,
540
- name: action.input.name,
541
- githubUrl: action.input.githubUrl,
542
- });`,errors:[{id:`e-invalid-skill-name`,name:`InvalidSkillNameError`,code:`INVALID_SKILL_NAME`,description:`Skill name must be lowercase kebab-case (e.g. playwright-cli).`,template:``},{id:`e-duplicate-skill`,name:`DuplicateSkillError`,code:`DUPLICATE_SKILL`,description:`A skill with the same ID or name already exists.`,template:``}],examples:[],scope:`global`},{id:`o-remove-external-skill`,name:`REMOVE_EXTERNAL_SKILL`,description:`Remove an external skill by ID.`,schema:`input RemoveExternalSkillInput {
543
- id: OID!
544
- }`,template:`Remove an external skill by ID.`,reducer:`const idx = state.externalSkills.findIndex(s => s.id === action.input.id);
545
- if (idx === -1) {
546
- throw new SkillNotFoundError(\`Skill not found: \${action.input.id}\`);
547
- }
548
- state.externalSkills.splice(idx, 1);`,errors:[{id:`e-skill-not-found-remove`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The specified skill ID was not found.`,template:``}],examples:[],scope:`global`},{id:`o-set-external-skill-name`,name:`SET_EXTERNAL_SKILL_NAME`,description:`Update the name of an external skill.`,schema:`input SetExternalSkillNameInput {
549
- id: OID!
550
- name: String!
551
- }`,template:`Update the name of an external skill.`,reducer:`const skill = state.externalSkills.find(s => s.id === action.input.id);
552
- if (!skill) {
553
- throw new SkillNotFoundError(\`Skill not found: \${action.input.id}\`);
554
- }
555
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {
556
- throw new InvalidSkillNameError(\`Invalid skill name: \${action.input.name}. Must be lowercase kebab-case.\`);
557
- }
558
- const duplicate = state.externalSkills.find(s => s.name === action.input.name && s.id !== action.input.id);
559
- if (duplicate) {
560
- throw new DuplicateSkillError(\`Skill name already in use: \${action.input.name}\`);
561
- }
562
- skill.name = action.input.name;`,errors:[{id:`e-skill-not-found-set-name`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The specified skill ID was not found.`,template:``},{id:`e-invalid-skill-name-set`,name:`InvalidSkillNameError`,code:`INVALID_SKILL_NAME`,description:`Skill name must be lowercase kebab-case.`,template:``},{id:`e-duplicate-skill-set-name`,name:`DuplicateSkillError`,code:`DUPLICATE_SKILL`,description:`Another skill already uses this name.`,template:``}],examples:[],scope:`global`},{id:`o-set-external-skill-github-url`,name:`SET_EXTERNAL_SKILL_GITHUB_URL`,description:`Update the GitHub URL of an external skill.`,schema:`input SetExternalSkillGithubUrlInput {
563
- id: OID!
564
- githubUrl: URL!
565
- }`,template:`Update the GitHub URL of an external skill.`,reducer:`const skill = state.externalSkills.find(s => s.id === action.input.id);
566
- if (!skill) {
567
- throw new SkillNotFoundError(\`Skill not found: \${action.input.id}\`);
568
- }
569
- skill.githubUrl = action.input.githubUrl;`,errors:[{id:`e-skill-not-found-set-url`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The specified skill ID was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-publishing`,name:`publishing`,description:`Version bumping and publish records. Tracks dev/staging/production publish intents and their status.`,operations:[{id:`o-bump-version`,name:`BUMP_VERSION`,description:`Bump the project version. Must be a valid semver string greater than the current version.`,schema:`input BumpVersionInput {
570
- version: String!
571
- }`,template:`Bump the project version. Must be a valid semver string greater than the current version.`,reducer:`if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {
572
- throw new InvalidVersionError(\`Invalid version: \${action.input.version}\`);
573
- }
574
- state.version = action.input.version;`,errors:[{id:`e-invalid-version-bump`,name:`InvalidVersionError`,code:`INVALID_VERSION`,description:`The version must be a valid semver string.`,template:``}],examples:[],scope:`global`},{id:`o-publish-dev`,name:`PUBLISH_DEV`,description:`Record a dev publish intent. Creates a Pending publish record.`,schema:`input PublishDevInput {
575
- id: OID!
576
- timestamp: DateTime!
577
- }`,template:`Record a dev publish intent. Creates a Pending publish record.`,reducer:`state.publishHistory.push({
578
- id: action.input.id,
579
- tag: 'Dev',
580
- version: state.version,
581
- timestamp: action.input.timestamp,
582
- status: 'Pending',
583
- });`,errors:[],examples:[],scope:`global`},{id:`o-publish-staging`,name:`PUBLISH_STAGING`,description:`Record a staging publish intent. Creates a Pending publish record.`,schema:`input PublishStagingInput {
584
- id: OID!
585
- timestamp: DateTime!
586
- }`,template:`Record a staging publish intent. Creates a Pending publish record.`,reducer:`state.publishHistory.push({
587
- id: action.input.id,
588
- tag: 'Staging',
589
- version: state.version,
590
- timestamp: action.input.timestamp,
591
- status: 'Pending',
592
- });`,errors:[],examples:[],scope:`global`},{id:`o-publish-production`,name:`PUBLISH_PRODUCTION`,description:`Record a production publish intent. Creates a Pending publish record.`,schema:`input PublishProductionInput {
593
- id: OID!
594
- timestamp: DateTime!
595
- }`,template:`Record a production publish intent. Creates a Pending publish record.`,reducer:`state.publishHistory.push({
596
- id: action.input.id,
597
- tag: 'Production',
598
- version: state.version,
599
- timestamp: action.input.timestamp,
600
- status: 'Pending',
601
- });`,errors:[],examples:[],scope:`global`},{id:`o-set-publish-status`,name:`SET_PUBLISH_STATUS`,description:`Update the status of a publish record. Used by the trigger after publish completes.`,schema:`input SetPublishStatusInput {
602
- id: OID!
603
- status: PublishStatus!
604
- }`,template:`Update the status of a publish record. Used by the trigger after publish completes.`,reducer:`const record = state.publishHistory.find(r => r.id === action.input.id);
605
- if (!record) {
606
- throw new PublishRecordNotFoundError(\`Publish record not found: \${action.input.id}\`);
607
- }
608
- record.status = action.input.status;`,errors:[{id:`e-publish-record-not-found`,name:`PublishRecordNotFoundError`,code:`PUBLISH_RECORD_NOT_FOUND`,description:`The specified publish record ID was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-lifecycle`,name:`lifecycle`,description:`Document lifecycle operations. IMPORT_SPEC bulk-imports a full project spec into the document.`,operations:[{id:`o-import-spec`,name:`IMPORT_SPEC`,description:`Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.`,schema:`input ImportSpecInput {
609
- name: String!
610
- scope: String
611
- version: String!
612
- description: String!
613
- powerhouse: PowerhouseLevel!
614
- mastraEnabled: Boolean!
615
- routineEnabled: Boolean!
616
- packages: [ImportPackageInput!]!
617
- externalSkills: [ImportSkillInput!]!
618
- agentId: String
619
- agentName: String
620
- models: [ImportModelInput!]
621
- profiles: [ImportProfileInput!]
622
- agentDescription: String
623
- agentImage: String
624
- enableChat: Boolean
625
- proxyEnabled: Boolean
626
- observabilityEnabled: Boolean
627
- supportedResources: [String!]
628
- }
629
-
630
- input ImportPackageInput {
631
- id: OID!
632
- packageName: String!
633
- documentTypes: [String!]!
634
- version: String
635
- }
636
-
637
- input ImportSkillInput {
638
- id: OID!
639
- name: String!
640
- githubUrl: URL!
641
- }
642
-
643
- input ImportModelInput {
644
- id: String!
645
- isDefault: Boolean!
646
- }
647
-
648
- input ImportProfileInput {
649
- id: String!
650
- title: String!
651
- content: String!
652
- }`,template:`Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.`,reducer:`state.name = action.input.name;
653
- state.scope = action.input.scope || null;
654
- state.version = action.input.version;
655
- state.description = action.input.description;
656
- state.features.powerhouse = action.input.powerhouse;
657
- state.features.mastra.enabled = action.input.mastraEnabled;
658
- state.features.routine.enabled = action.input.routineEnabled;
659
-
660
- // Derive the expected managed app package name
661
- const appBase = action.input.name.replace(/-cli$/, '-app');
662
- const appPkgName = action.input.scope
663
- ? \`\${action.input.scope}/\${appBase}\`
664
- : appBase;
665
- const phEnabled = action.input.powerhouse !== 'Disabled';
666
-
667
- state.packages = action.input.packages.map((p) => ({
668
- id: p.id,
669
- packageName: p.packageName,
670
- documentTypes: [...p.documentTypes],
671
- version: p.version || null,
672
- managed: phEnabled && p.packageName === appPkgName,
673
- }));
674
- state.externalSkills = action.input.externalSkills.map((s) => ({
675
- id: s.id,
676
- name: s.name,
677
- githubUrl: s.githubUrl,
678
- }));
679
- state.features.mastra.agentId = action.input.agentId || null;
680
- state.features.mastra.agentName = action.input.agentName || null;
681
- state.features.mastra.models = (action.input.models || []).map((m) => ({
682
- id: m.id,
683
- isDefault: m.isDefault,
684
- }));
685
- state.features.mastra.profiles = (action.input.profiles || []).map((p) => ({
686
- id: p.id,
687
- title: p.title,
688
- content: p.content,
689
- }));
690
-
691
- // agentDescription — respects mastra-enabled guard
692
- if (action.input.agentDescription && state.features.mastra.enabled) {
693
- state.features.mastra.agentDescription = action.input.agentDescription;
694
- } else {
695
- state.features.mastra.agentDescription = null;
696
- }
697
-
698
- // agentImage — validates data URL format (same logic as setAgentImageOperation)
699
- if (action.input.agentImage && state.features.mastra.enabled) {
700
- if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.agentImage)) {
701
- throw new InvalidAgentImageError(
702
- 'Invalid image: must be a data URL (data:<mime>;base64,...)',
703
- );
704
- }
705
- state.features.mastra.agentImage = action.input.agentImage;
706
- } else {
707
- state.features.mastra.agentImage = null;
708
- }
709
-
710
- // enableChat — respects mastra+powerhouse guards, manages clint-common package
711
- if (
712
- action.input.enableChat &&
713
- state.features.mastra.enabled &&
714
- state.features.powerhouse !== 'Disabled'
715
- ) {
716
- state.features.mastra.common.enableChat = true;
717
- const CLINT_COMMON_PKG = '@powerhousedao/clint-common';
718
- const CHAT_DOC_TYPE = 'powerhouse/chat-session';
719
- const existing = state.packages.find(
720
- (p) => p.packageName === CLINT_COMMON_PKG,
721
- );
722
- if (!existing) {
723
- state.packages.push({
724
- id: 'pkg-clint-common',
725
- packageName: CLINT_COMMON_PKG,
726
- documentTypes: [CHAT_DOC_TYPE],
727
- version: null,
728
- managed: true,
729
- });
730
- } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {
731
- existing.documentTypes.push(CHAT_DOC_TYPE);
732
- }
733
- } else {
734
- state.features.mastra.common.enableChat = false;
735
- }
736
-
737
- // Deployment fields
738
- state.deployment.proxyEnabled = action.input.proxyEnabled ?? false;
739
- state.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;
740
- state.deployment.supportedResources = action.input.supportedResources
741
- ? [...action.input.supportedResources]
742
- : [];`,errors:[],examples:[],scope:`global`}]},{id:`m-deployment`,name:`deployment`,description:`Deployment settings: service announcement toggle and supported resource tiers.`,operations:[{id:`o-add-supported-resource`,name:`ADD_SUPPORTED_RESOURCE`,description:`Add a supported resource tier. Guards against duplicates.`,schema:`input AddSupportedResourceInput {
743
- resource: String!
744
- }`,template:`Add a supported resource tier. Guards against duplicates.`,reducer:`if (state.deployment.supportedResources.includes(action.input.resource)) {
745
- throw new DuplicateResourceError(\`Resource already exists: \${action.input.resource}\`);
746
- }
747
- state.deployment.supportedResources.push(action.input.resource);`,errors:[{id:`e-duplicate-resource`,name:`DuplicateResourceError`,code:`DUPLICATE_RESOURCE`,description:`This resource is already in the supported resources list.`,template:``}],examples:[],scope:`global`},{id:`o-remove-supported-resource`,name:`REMOVE_SUPPORTED_RESOURCE`,description:`Remove a supported resource tier.`,schema:`input RemoveSupportedResourceInput {
748
- resource: String!
749
- }`,template:`Remove a supported resource tier.`,reducer:`const idx = state.deployment.supportedResources.indexOf(action.input.resource);
750
- if (idx === -1) {
751
- throw new ResourceNotFoundError(\`Resource not found: \${action.input.resource}\`);
752
- }
753
- state.deployment.supportedResources.splice(idx, 1);`,errors:[{id:`e-resource-not-found`,name:`ResourceNotFoundError`,code:`RESOURCE_NOT_FOUND`,description:`The specified resource was not found in the supported resources list.`,template:``}],examples:[],scope:`global`},{id:`o-set-proxy-enabled`,name:`SET_PROXY_ENABLED`,description:`Toggle the embedded reverse proxy.`,schema:`input SetProxyEnabledInput {
754
- enabled: Boolean!
755
- }`,template:`Toggle the embedded reverse proxy.`,reducer:`state.deployment.proxyEnabled = action.input.enabled;`,errors:[],examples:[],scope:`global`},{id:`o-set-observability-enabled`,name:`SET_OBSERVABILITY_ENABLED`,description:`Toggle the observability plugin (Sentry + OpenTelemetry).`,schema:`input SetObservabilityEnabledInput {
756
- enabled: Boolean!
757
- }`,template:`Toggle the observability plugin (Sentry + OpenTelemetry).`,reducer:`state.deployment.observabilityEnabled = action.input.enabled;`,errors:[],examples:[],scope:`global`}]}],version:1,changeLog:[]}]},Ut=class extends Error{errorCode=`DuplicateResourceError`;constructor(e=`DuplicateResourceError`){super(e)}},Wt=class extends Error{errorCode=`ResourceNotFoundError`;constructor(e=`ResourceNotFoundError`){super(e)}},U={addSupportedResourceOperation(e,t){if(e.deployment.supportedResources.includes(t.input.resource))throw new Ut(`Resource already exists: ${t.input.resource}`);e.deployment.supportedResources.push(t.input.resource)},removeSupportedResourceOperation(e,t){let n=e.deployment.supportedResources.indexOf(t.input.resource);if(n===-1)throw new Wt(`Resource not found: ${t.input.resource}`);e.deployment.supportedResources.splice(n,1)},setProxyEnabledOperation(e,t){e.deployment.proxyEnabled=t.input.enabled},setObservabilityEnabledOperation(e,t){e.deployment.observabilityEnabled=t.input.enabled}},Gt=class extends Error{errorCode=`InvalidSkillNameError`;constructor(e=`InvalidSkillNameError`){super(e)}},Kt=class extends Error{errorCode=`DuplicateSkillError`;constructor(e=`DuplicateSkillError`){super(e)}},qt=class extends Error{errorCode=`SkillNotFoundError`;constructor(e=`SkillNotFoundError`){super(e)}},W={addExternalSkillOperation(e,t){if(!/^[a-z][a-z0-9-]*$/.test(t.input.name))throw new Gt(`Invalid skill name: ${t.input.name}. Must be lowercase kebab-case.`);if(e.externalSkills.find(e=>e.id===t.input.id||e.name===t.input.name))throw new Kt(`Skill already exists: ${t.input.name}`);e.externalSkills.push({id:t.input.id,name:t.input.name,githubUrl:t.input.githubUrl})},removeExternalSkillOperation(e,t){let n=e.externalSkills.findIndex(e=>e.id===t.input.id);if(n===-1)throw new qt(`Skill not found: ${t.input.id}`);e.externalSkills.splice(n,1)},setExternalSkillNameOperation(e,t){let n=e.externalSkills.find(e=>e.id===t.input.id);if(!n)throw new qt(`Skill not found: ${t.input.id}`);if(!/^[a-z][a-z0-9-]*$/.test(t.input.name))throw new Gt(`Invalid skill name: ${t.input.name}. Must be lowercase kebab-case.`);if(e.externalSkills.find(e=>e.name===t.input.name&&e.id!==t.input.id))throw new Kt(`Skill name already in use: ${t.input.name}`);n.name=t.input.name},setExternalSkillGithubUrlOperation(e,t){let n=e.externalSkills.find(e=>e.id===t.input.id);if(!n)throw new qt(`Skill not found: ${t.input.id}`);n.githubUrl=t.input.githubUrl}},Jt=class extends Error{errorCode=`InvalidAgentIdError`;constructor(e=`InvalidAgentIdError`){super(e)}},Yt=class extends Error{errorCode=`InvalidAgentNameError`;constructor(e=`InvalidAgentNameError`){super(e)}},G=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},Xt=class extends Error{errorCode=`InvalidModelIdError`;constructor(e=`InvalidModelIdError`){super(e)}},Zt=class extends Error{errorCode=`DuplicateModelError`;constructor(e=`DuplicateModelError`){super(e)}},Qt=class extends Error{errorCode=`ModelNotFoundError`;constructor(e=`ModelNotFoundError`){super(e)}},$t=class extends Error{errorCode=`InvalidProfileIdError`;constructor(e=`InvalidProfileIdError`){super(e)}},en=class extends Error{errorCode=`DuplicateProfileError`;constructor(e=`DuplicateProfileError`){super(e)}},K=class extends Error{errorCode=`ProfileNotFoundError`;constructor(e=`ProfileNotFoundError`){super(e)}},tn=class extends Error{errorCode=`InvalidAgentImageError`;constructor(e=`InvalidAgentImageError`){super(e)}},nn=class extends Error{errorCode=`PowerhouseNotEnabledError`;constructor(e=`PowerhouseNotEnabledError`){super(e)}},q={enableMastraOperation(e,t){if(!/^[a-z][a-z0-9-]*$/.test(t.input.agentId))throw new Jt(`Invalid agent ID: ${t.input.agentId}. Must be lowercase kebab-case.`);let n=t.input.agentName.trim();if(!n)throw new Yt(`Agent name must not be empty.`);e.features.mastra.enabled=!0,e.features.mastra.agentId=t.input.agentId,e.features.mastra.agentName=n,e.features.mastra.models.length===0&&e.features.mastra.models.push({id:`clint/demo-agent`,isDefault:!0}),e.features.mastra.profiles.length===0&&e.features.mastra.profiles.push({id:`base`,title:`Base Profile`,content:`You are a helpful assistant`})},disableMastraOperation(e){e.features.mastra.enabled=!1,e.features.mastra.agentId=null,e.features.mastra.agentName=null,e.features.mastra.agentDescription=null,e.features.mastra.agentImage=null,e.features.mastra.models=[],e.features.mastra.profiles=[],e.features.mastra.common.enableChat=!1;let t=e.packages.findIndex(e=>e.packageName===`@powerhousedao/clint-common`&&e.managed);t!==-1&&e.packages.splice(t,1)},setAgentIdOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot set agent ID when Mastra is disabled.`);if(!/^[a-z][a-z0-9-]*$/.test(t.input.agentId))throw new Jt(`Invalid agent ID: ${t.input.agentId}. Must be lowercase kebab-case.`);e.features.mastra.agentId=t.input.agentId},setAgentNameOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot set agent name when Mastra is disabled.`);let n=t.input.agentName.trim();if(!n)throw new Yt(`Agent name must not be empty.`);e.features.mastra.agentName=n},addModelOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot add model when Mastra is disabled.`);if(!/^[a-z0-9-]+\/[a-z0-9._-]+$/.test(t.input.id))throw new Xt(`Invalid model ID: ${t.input.id}. Must be provider/model-name format.`);if(e.features.mastra.models.find(e=>e.id===t.input.id))throw new Zt(`Model already exists: ${t.input.id}`);let n=e.features.mastra.models.length===0||t.input.isDefault===!0;if(n)for(let t of e.features.mastra.models)t.isDefault=!1;e.features.mastra.models.push({id:t.input.id,isDefault:n})},removeModelOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot remove model when Mastra is disabled.`);let n=e.features.mastra.models.findIndex(e=>e.id===t.input.id);if(n===-1)throw new Qt(`Model not found: ${t.input.id}`);let r=e.features.mastra.models[n].isDefault;e.features.mastra.models.splice(n,1),r&&e.features.mastra.models.length>0&&(e.features.mastra.models[0].isDefault=!0)},setDefaultModelOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot set default model when Mastra is disabled.`);let n=e.features.mastra.models.find(e=>e.id===t.input.id);if(!n)throw new Qt(`Model not found: ${t.input.id}`);for(let t of e.features.mastra.models)t.isDefault=!1;n.isDefault=!0},addProfileOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot add profile when Mastra is disabled.`);if(!/^[a-z][a-z0-9-]*$/.test(t.input.id))throw new $t(`Invalid profile ID: ${t.input.id}. Must be lowercase kebab-case.`);if(e.features.mastra.profiles.find(e=>e.id===t.input.id))throw new en(`Profile already exists: ${t.input.id}`);let n={id:t.input.id,title:t.input.title,content:t.input.content};if(t.input.insertBefore){let r=e.features.mastra.profiles.findIndex(e=>e.id===t.input.insertBefore);if(r===-1)throw new K(`insertBefore profile not found: ${t.input.insertBefore}`);e.features.mastra.profiles.splice(r,0,n)}else e.features.mastra.profiles.push(n)},updateProfileOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot update profile when Mastra is disabled.`);let n=e.features.mastra.profiles.find(e=>e.id===t.input.id);if(!n)throw new K(`Profile not found: ${t.input.id}`);t.input.title&&(n.title=t.input.title),t.input.content&&(n.content=t.input.content)},removeProfileOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot remove profile when Mastra is disabled.`);let n=e.features.mastra.profiles.findIndex(e=>e.id===t.input.id);if(n===-1)throw new K(`Profile not found: ${t.input.id}`);e.features.mastra.profiles.splice(n,1)},reorderProfilesOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot reorder profiles when Mastra is disabled.`);let n=[];for(let r of t.input.ids){let t=e.features.mastra.profiles.find(e=>e.id===r);if(!t)throw new K(`Profile not found: ${r}`);n.push(t)}if(e.features.mastra.profiles=e.features.mastra.profiles.filter(e=>!t.input.ids.includes(e.id)),t.input.insertBefore){let r=e.features.mastra.profiles.findIndex(e=>e.id===t.input.insertBefore);if(r===-1)throw new K(`insertBefore profile not found: ${t.input.insertBefore}`);e.features.mastra.profiles.splice(r,0,...n)}else e.features.mastra.profiles.push(...n)},setAgentDescriptionOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot set agent description when Mastra is disabled.`);e.features.mastra.agentDescription=t.input.description},setAgentImageOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot set agent image when Mastra is disabled.`);if(!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(t.input.image))throw new tn(`Invalid image: must be a data URL (data:<mime>;base64,...)`);e.features.mastra.agentImage=t.input.image},clearAgentImageOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot clear agent image when Mastra is disabled.`);e.features.mastra.agentImage=null},setEnableChatOperation(e,t){if(!e.features.mastra.enabled)throw new G(`Cannot toggle chat when Mastra is disabled.`);if(e.features.powerhouse===`Disabled`)throw new nn(`Cannot toggle chat when Powerhouse is disabled.`);e.features.mastra.common.enableChat=t.input.enabled;let n=`@powerhousedao/clint-common`,r=`powerhouse/chat-session`;if(t.input.enabled){let t=e.packages.find(e=>e.packageName===n);t?t.documentTypes.includes(r)||t.documentTypes.push(r):e.packages.push({id:`pkg-clint-common`,packageName:n,documentTypes:[r],version:null,managed:!0})}else{let t=e.packages.findIndex(e=>e.packageName===n&&e.managed);if(t!==-1){let n=e.packages[t];if(n.documentTypes.length===1&&n.documentTypes[0]===r)e.packages.splice(t,1);else{let e=n.documentTypes.indexOf(r);e!==-1&&n.documentTypes.splice(e,1)}}}}},rn=class extends Error{errorCode=`CannotLowerPowerhouseError`;constructor(e=`CannotLowerPowerhouseError`){super(e)}},an=[`Disabled`,`Reactor`,`Switchboard`,`Connect`],on={setPowerhouseLevelOperation(e,t){let n=an.indexOf(e.features.powerhouse),r=an.indexOf(t.input.level);if(n>=1&&r<1)throw new rn(`Cannot lower Powerhouse level below Reactor once enabled`);if(e.features.powerhouse=t.input.level,n===0&&r>=1&&!e.packages.some(e=>e.managed)){let t=e.name?e.name.replace(/-cli$/,`-app`):`app`,n=e.scope&&e.name?`${e.scope}/${t}`:t;e.packages.push({id:`app-${e.name||`managed`}`,packageName:n,documentTypes:[`*/*`],version:null,managed:!0})}r>=2&&!t.input.skipAutoProxy&&(e.deployment.proxyEnabled=!0)}},sn={enableRoutineOperation(e){e.features.routine.enabled=!0},disableRoutineOperation(e){e.features.routine.enabled=!1}},cn=class extends Error{errorCode=`InvalidVersionError`;constructor(e=`InvalidVersionError`){super(e)}},J=class extends Error{errorCode=`InvalidPackageIdentifierError`;constructor(e=`InvalidPackageIdentifierError`){super(e)}},ln=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,un=/^[a-z][a-z0-9-]*$/,dn={setVersionOperation(e,t){if(!ln.test(t.input.version))throw new cn(`Invalid version: ${t.input.version}`);e.version=t.input.version},setDescriptionOperation(e,t){e.description=t.input.description},setPackageIdentifierOperation(e,t){let n=t.input.identifier.trim();if(!n)throw new J(`Package identifier must not be empty`);let r=null,i=n;if(n.includes(`/`)){let e=n.split(`/`);if(e.length!==2||!e[0]||!e[1])throw new J(`Invalid package identifier: ${n}`);r=e[0].replace(/^@/,``),i=e[1]}if(r!==null&&!un.test(r))throw new J(`Invalid scope: ${r}`);if(i.endsWith(`-cli`)||(i+=`-cli`),!un.test(i))throw new J(`Invalid package name: ${i}`);e.scope=r?`@${r}`:null,e.name=i;let a=e.packages.find(e=>e.managed);if(a){let e=i.replace(/-cli$/,`-app`);a.packageName=r?`@${r}/${e}`:e,a.id=`app-${i}`}}},fn={importSpecOperation(e,t){e.name=t.input.name,e.scope=t.input.scope||null,e.version=t.input.version,e.description=t.input.description,e.features.powerhouse=t.input.powerhouse,e.features.mastra.enabled=t.input.mastraEnabled,e.features.routine.enabled=t.input.routineEnabled;let n=t.input.name.replace(/-cli$/,`-app`),r=t.input.scope?`${t.input.scope}/${n}`:n,i=t.input.powerhouse!==`Disabled`;if(e.packages=t.input.packages.map(e=>({id:e.id,packageName:e.packageName,documentTypes:[...e.documentTypes],version:e.version||null,managed:i&&e.packageName===r})),e.externalSkills=t.input.externalSkills.map(e=>({id:e.id,name:e.name,githubUrl:e.githubUrl})),e.features.mastra.agentId=t.input.agentId||null,e.features.mastra.agentName=t.input.agentName||null,e.features.mastra.models=(t.input.models||[]).map(e=>({id:e.id,isDefault:e.isDefault})),e.features.mastra.profiles=(t.input.profiles||[]).map(e=>({id:e.id,title:e.title,content:e.content})),t.input.agentDescription&&e.features.mastra.enabled?e.features.mastra.agentDescription=t.input.agentDescription:e.features.mastra.agentDescription=null,t.input.agentImage&&e.features.mastra.enabled){if(!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(t.input.agentImage))throw new tn(`Invalid image: must be a data URL (data:<mime>;base64,...)`);e.features.mastra.agentImage=t.input.agentImage}else e.features.mastra.agentImage=null;if(t.input.enableChat&&e.features.mastra.enabled&&e.features.powerhouse!==`Disabled`){e.features.mastra.common.enableChat=!0;let t=`@powerhousedao/clint-common`,n=`powerhouse/chat-session`,r=e.packages.find(e=>e.packageName===t);r?r.documentTypes.includes(n)||r.documentTypes.push(n):e.packages.push({id:`pkg-clint-common`,packageName:t,documentTypes:[n],version:null,managed:!0})}else e.features.mastra.common.enableChat=!1;e.deployment.proxyEnabled=t.input.proxyEnabled??!1,e.deployment.observabilityEnabled=t.input.observabilityEnabled??!1,e.deployment.supportedResources=t.input.supportedResources?[...t.input.supportedResources]:[]}},pn=class extends Error{errorCode=`DuplicatePackageError`;constructor(e=`DuplicatePackageError`){super(e)}},Y=class extends Error{errorCode=`PackageNotFoundError`;constructor(e=`PackageNotFoundError`){super(e)}},mn=class extends Error{errorCode=`CannotRemoveManagedPackageError`;constructor(e=`CannotRemoveManagedPackageError`){super(e)}},hn=class extends Error{errorCode=`InvalidDocumentTypeError`;constructor(e=`InvalidDocumentTypeError`){super(e)}},gn=class extends Error{errorCode=`DuplicateDocumentTypeError`;constructor(e=`DuplicateDocumentTypeError`){super(e)}},_n=class extends Error{errorCode=`DocumentTypeNotFoundError`;constructor(e=`DocumentTypeNotFoundError`){super(e)}},vn=class extends Error{errorCode=`InvalidVersionError`;constructor(e=`InvalidVersionError`){super(e)}},yn=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,X={addPowerhousePackageOperation(e,t){if(e.packages.find(e=>e.id===t.input.id||e.packageName===t.input.packageName))throw new pn(`Package already exists: ${t.input.packageName}`);e.packages.push({id:t.input.id,packageName:t.input.packageName,documentTypes:[],version:null,managed:!1})},removePowerhousePackageOperation(e,t){let n=e.packages.findIndex(e=>e.id===t.input.id);if(n===-1)throw new Y(`Package not found: ${t.input.id}`);if(e.packages[n].managed)throw new mn(`Cannot remove a managed package`);e.packages.splice(n,1)},addPackageDocumentTypeOperation(e,t){if(t.input.documentType!==`*/*`&&!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t.input.documentType))throw new hn(`Invalid document type format: ${t.input.documentType}. Expected org/name.`);let n=e.packages.find(e=>e.id===t.input.packageId);if(!n)throw new Y(`Package not found: ${t.input.packageId}`);if(t.input.documentType===`*/*`){n.documentTypes.length=0,n.documentTypes.push(`*/*`);return}if(!n.documentTypes.includes(`*/*`)){if(n.documentTypes.includes(t.input.documentType))throw new gn(`Document type already registered: ${t.input.documentType}`);n.documentTypes.push(t.input.documentType)}},removePackageDocumentTypeOperation(e,t){let n=e.packages.find(e=>e.id===t.input.packageId);if(!n)throw new Y(`Package not found: ${t.input.packageId}`);let r=n.documentTypes.indexOf(t.input.documentType);if(r===-1)throw new _n(`Document type not found: ${t.input.documentType}`);n.documentTypes.splice(r,1)},setPackageVersionOperation(e,t){let n=e.packages.find(e=>e.id===t.input.packageId);if(!n)throw new Y(`Package not found: ${t.input.packageId}`);if(t.input.version!=null&&!yn.test(t.input.version))throw new vn(`Invalid version: ${t.input.version}`);n.version=t.input.version||null}},bn=class extends Error{errorCode=`InvalidVersionError`;constructor(e=`InvalidVersionError`){super(e)}},xn=class extends Error{errorCode=`PublishRecordNotFoundError`;constructor(e=`PublishRecordNotFoundError`){super(e)}},Z={bumpVersionOperation(e,t){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(t.input.version))throw new bn(`Invalid version: ${t.input.version}`);e.version=t.input.version},publishDevOperation(e,t){e.publishHistory.push({id:t.input.id,tag:`Dev`,version:e.version,timestamp:t.input.timestamp,status:`Pending`})},publishStagingOperation(e,t){e.publishHistory.push({id:t.input.id,tag:`Staging`,version:e.version,timestamp:t.input.timestamp,status:`Pending`})},publishProductionOperation(e,t){e.publishHistory.push({id:t.input.id,tag:`Production`,version:e.version,timestamp:t.input.timestamp,status:`Pending`})},setPublishStatusOperation(e,t){let n=e.publishHistory.find(e=>e.id===t.input.id);if(!n)throw new xn(`Publish record not found: ${t.input.id}`);n.status=t.input.status}},Sn=ue((e,t,n)=>{if(le(t))return e;switch(t.type){case`SET_DESCRIPTION`:M().parse(t.input),dn.setDescriptionOperation(e[t.scope],t,n);break;case`SET_VERSION`:V().parse(t.input),dn.setVersionOperation(e[t.scope],t,n);break;case`SET_PACKAGE_IDENTIFIER`:L().parse(t.input),dn.setPackageIdentifierOperation(e[t.scope],t,n);break;case`SET_POWERHOUSE_LEVEL`:R().parse(t.input),on.setPowerhouseLevelOperation(e[t.scope],t,n);break;case`ENABLE_MASTRA`:ke().parse(t.input),q.enableMastraOperation(e[t.scope],t,n);break;case`DISABLE_MASTRA`:De().parse(t.input),q.disableMastraOperation(e[t.scope],t,n);break;case`SET_AGENT_ID`:O().parse(t.input),q.setAgentIdOperation(e[t.scope],t,n);break;case`SET_AGENT_NAME`:A().parse(t.input),q.setAgentNameOperation(e[t.scope],t,n);break;case`ADD_MODEL`:Se().parse(t.input),q.addModelOperation(e[t.scope],t,n);break;case`REMOVE_MODEL`:x().parse(t.input),q.removeModelOperation(e[t.scope],t,n);break;case`SET_DEFAULT_MODEL`:j().parse(t.input),q.setDefaultModelOperation(e[t.scope],t,n);break;case`ADD_PROFILE`:m().parse(t.input),q.addProfileOperation(e[t.scope],t,n);break;case`UPDATE_PROFILE`:H().parse(t.input),q.updateProfileOperation(e[t.scope],t,n);break;case`REMOVE_PROFILE`:w().parse(t.input),q.removeProfileOperation(e[t.scope],t,n);break;case`REORDER_PROFILES`:E().parse(t.input),q.reorderProfilesOperation(e[t.scope],t,n);break;case`SET_AGENT_DESCRIPTION`:D().parse(t.input),q.setAgentDescriptionOperation(e[t.scope],t,n);break;case`SET_AGENT_IMAGE`:k().parse(t.input),q.setAgentImageOperation(e[t.scope],t,n);break;case`CLEAR_AGENT_IMAGE`:Ee().parse(t.input),q.clearAgentImageOperation(e[t.scope],t,n);break;case`SET_ENABLE_CHAT`:N().parse(t.input),q.setEnableChatOperation(e[t.scope],t,n);break;case`ENABLE_ROUTINE`:h().parse(t.input),sn.enableRoutineOperation(e[t.scope],t,n);break;case`DISABLE_ROUTINE`:Oe().parse(t.input),sn.disableRoutineOperation(e[t.scope],t,n);break;case`ADD_POWERHOUSE_PACKAGE`:p().parse(t.input),X.addPowerhousePackageOperation(e[t.scope],t,n);break;case`REMOVE_POWERHOUSE_PACKAGE`:C().parse(t.input),X.removePowerhousePackageOperation(e[t.scope],t,n);break;case`ADD_PACKAGE_DOCUMENT_TYPE`:Ce().parse(t.input),X.addPackageDocumentTypeOperation(e[t.scope],t,n);break;case`REMOVE_PACKAGE_DOCUMENT_TYPE`:S().parse(t.input),X.removePackageDocumentTypeOperation(e[t.scope],t,n);break;case`SET_PACKAGE_VERSION`:Ge().parse(t.input),X.setPackageVersionOperation(e[t.scope],t,n);break;case`ADD_EXTERNAL_SKILL`:xe().parse(t.input),W.addExternalSkillOperation(e[t.scope],t,n);break;case`REMOVE_EXTERNAL_SKILL`:b().parse(t.input),W.removeExternalSkillOperation(e[t.scope],t,n);break;case`SET_EXTERNAL_SKILL_NAME`:F().parse(t.input),W.setExternalSkillNameOperation(e[t.scope],t,n);break;case`SET_EXTERNAL_SKILL_GITHUB_URL`:P().parse(t.input),W.setExternalSkillGithubUrlOperation(e[t.scope],t,n);break;case`BUMP_VERSION`:Te().parse(t.input),Z.bumpVersionOperation(e[t.scope],t,n);break;case`PUBLISH_DEV`:_().parse(t.input),Z.publishDevOperation(e[t.scope],t,n);break;case`PUBLISH_STAGING`:y().parse(t.input),Z.publishStagingOperation(e[t.scope],t,n);break;case`PUBLISH_PRODUCTION`:v().parse(t.input),Z.publishProductionOperation(e[t.scope],t,n);break;case`SET_PUBLISH_STATUS`:B().parse(t.input),Z.setPublishStatusOperation(e[t.scope],t,n);break;case`IMPORT_SPEC`:g().parse(t.input),fn.importSpecOperation(e[t.scope],t,n);break;case`ADD_SUPPORTED_RESOURCE`:we().parse(t.input),U.addSupportedResourceOperation(e[t.scope],t,n);break;case`REMOVE_SUPPORTED_RESOURCE`:T().parse(t.input),U.removeSupportedResourceOperation(e[t.scope],t,n);break;case`SET_PROXY_ENABLED`:z().parse(t.input),U.setProxyEnabledOperation(e[t.scope],t,n);break;case`SET_OBSERVABILITY_ENABLED`:I().parse(t.input),U.setObservabilityEnabledOperation(e[t.scope],t,n);break;default:return e}}),Cn=`powerhouse/ph-clint-project`,wn=ie.extend({documentType:i(Cn)}),Q=ne.extend({global:Ve()}),Tn=u({header:wn,state:Q,initialState:Q});function En(e){return Q.safeParse(e).success}function Dn(e){Q.parse(e)}function $(e){return Tn.safeParse(e).success}function On(e){Tn.parse(e)}var kn={name:null,scope:null,version:`0.1.0`,description:``,features:{powerhouse:`Disabled`,mastra:{enabled:!1,agentId:null,agentName:null,agentDescription:null,agentImage:null,models:[],profiles:[],common:{enableChat:!1}},routine:{enabled:!1}},packages:[],externalSkills:[],publishHistory:[],deployment:{proxyEnabled:!1,observabilityEnabled:!1,supportedResources:[`vetra-agent-s`,`vetra-agent-m`,`vetra-agent-l`,`vetra-agent-xl`,`vetra-agent-xxl`]}},An={},jn={fileExtension:`pcp`,createState(e){return{...fe(),global:{...kn,...e?.global},local:{...An,...e?.local}}},createDocument(e){let t=se(jn.createState,e);return t.header.documentType=Cn,t.header.id=te(),t},saveToFileHandle(e,t){return ce(e,t)},loadFromInput(e){return de(e,Sn)},isStateOfType(e){return En(e)},assertIsStateOfType(e){return Dn(e)},isDocumentOfType(e){return $(e)},assertIsDocumentOfType(e){return On(e)}},Mn=e({}),Nn={...jn,...Mn},Pn={version:1,reducer:Sn,actions:Vt,utils:Nn,documentModel:oe(fe(),Ht)},Fn=ee.forDocumentModel(Pn);function In(){return{name:null,scope:null,version:`0.1.0`,description:``,features:{powerhouse:`Disabled`,mastra:{enabled:!1,agentId:null,agentName:null,agentDescription:null,agentImage:null,models:[],profiles:[],common:{enableChat:!1}},routine:{enabled:!1}},packages:[],externalSkills:[],publishHistory:[],deployment:{proxyEnabled:!1,observabilityEnabled:!1,supportedResources:[`vetra-agent-s`,`vetra-agent-m`,`vetra-agent-l`,`vetra-agent-xl`,`vetra-agent-xxl`]}}}function Ln(){return{}}function Rn(){return{...fe(),global:In(),local:Ln()}}function zn(e){return{...In(),...e||{}}}function Bn(e){return{...Ln(),...e||{}}}function Vn(e,t,n){return{...ae(e?.auth,e?.document),global:zn(t),local:Bn(n)}}function Hn(e){return jn.createDocument(e?Vn(ae(e.auth,e.document),e.global,e.local):void 0)}function Un(e){let[t,n]=he(e);return $(t)?[t,n]:[void 0,void 0]}function Wn(){let[e,t]=ge();return On(e),[e,t]}function Gn(){return pe()?.filter($)}function Kn(){return me()?.filter($)}var qn=[1],Jn=qn[0],Yn={documentType:`powerhouse/ph-clint-project`,latestVersion:Jn,supportedVersions:qn,upgrades:{}};export{ut as $,v as $t,Ft as A,Te as At,Pt as B,Pe as Bt,$ as C,R as Cn,Ye as Ct,Ht as D,H as Dn,p as Dt,Sn as E,V as En,Ce as Et,Mt as F,h as Ft,Et as G,Re as Gt,Ot as H,Fe as Ht,At as I,Ae as It,St as J,Ve as Jt,Tt as K,ze as Kt,kt as L,je as Lt,zt as M,De as Mt,Rt as N,Oe as Nt,Vt as O,ve as On,m as Ot,Bt as P,ke as Pt,st as Q,_ as Qt,Nt as R,Me as Rt,Dn as S,Ge as Sn,Xe as St,Cn as T,B as Tn,Se as Tt,Ct as U,Ie as Ut,Dt as V,g as Vt,wt as W,Le as Wt,vt as X,f as Xt,xt as Y,He as Yt,yt as Z,Ue as Zt,An as _,N as _n,tt as _t,Gn as a,x as an,ft as at,Q as b,I as bn,Ke as bt,Hn as c,w as cn,at as ct,Ln as d,D as dn,lt as dt,We as en,gt as et,Rn as f,O as fn,_t as ft,kn as g,M as gn,$e as gt,Nn as h,j as hn,Ze as ht,Un as i,b as in,ct as it,Lt as j,Ee as jt,It as k,_e as kn,we as kt,Vn as l,T as ln,ht as lt,Pn as m,A as mn,Qe as mt,Jn as n,ye as nn,it as nt,Kn as o,S as on,pt as ot,Fn as p,k as pn,dt as pt,bt as q,Be as qt,qn as r,be as rn,rt,Wn as s,C as sn,mt as st,Yn as t,y as tn,nt as tt,In as u,E as un,ot as ut,wn as v,P as vn,et as vt,En as w,z as wn,xe as wt,On as x,L as xn,Je as xt,Tn as y,F as yn,qe as yt,jt as z,Ne as zt};
758
- //# sourceMappingURL=ph-clint-project-BRYYVNTj.js.map