@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
@@ -8689,6 +8689,25 @@ const PublishTagSchema = _enum([
8689
8689
  "Production",
8690
8690
  "Staging"
8691
8691
  ]);
8692
+ function AddAgentProfileRefInputSchema() {
8693
+ return object({
8694
+ agentId: string(),
8695
+ insertBefore: string().nullish(),
8696
+ profileId: string()
8697
+ });
8698
+ }
8699
+ function AddAgentSkillInputSchema() {
8700
+ return object({
8701
+ agentId: string(),
8702
+ name: string()
8703
+ });
8704
+ }
8705
+ function AddAgentToolPatternInputSchema() {
8706
+ return object({
8707
+ agentId: string(),
8708
+ pattern: string()
8709
+ });
8710
+ }
8692
8711
  function AddExternalSkillInputSchema() {
8693
8712
  return object({
8694
8713
  githubUrl: url(),
@@ -8722,13 +8741,24 @@ function AddProfileInputSchema() {
8722
8741
  title: string()
8723
8742
  });
8724
8743
  }
8744
+ function AddSubAgentInputSchema() {
8745
+ return object({
8746
+ description: string(),
8747
+ id: string(),
8748
+ modelId: string(),
8749
+ name: string()
8750
+ });
8751
+ }
8725
8752
  function AddSupportedResourceInputSchema() {
8726
8753
  return object({ resource: string() });
8727
8754
  }
8728
8755
  function BumpVersionInputSchema() {
8729
8756
  return object({ version: string() });
8730
8757
  }
8731
- function ClearAgentImageInputSchema() {
8758
+ function ClearMainAgentDescriptionInputSchema() {
8759
+ return object({ _: boolean().nullish() });
8760
+ }
8761
+ function ClearMainAgentImageInputSchema() {
8732
8762
  return object({ _: boolean().nullish() });
8733
8763
  }
8734
8764
  function DisableMastraInputSchema() {
@@ -8754,6 +8784,18 @@ function ExternalSkillSchema() {
8754
8784
  name: string()
8755
8785
  });
8756
8786
  }
8787
+ function ImportMainAgentInputSchema() {
8788
+ return object({
8789
+ description: string().nullish(),
8790
+ id: string(),
8791
+ image: string().nullish(),
8792
+ modelId: string(),
8793
+ name: string(),
8794
+ profileIds: array(string()),
8795
+ skills: array(string()),
8796
+ toolPatterns: array(string())
8797
+ });
8798
+ }
8757
8799
  function ImportModelInputSchema() {
8758
8800
  return object({
8759
8801
  id: string(),
@@ -8784,27 +8826,36 @@ function ImportSkillInputSchema() {
8784
8826
  }
8785
8827
  function ImportSpecInputSchema() {
8786
8828
  return object({
8787
- agentDescription: string().nullish(),
8788
- agentId: string().nullish(),
8789
- agentImage: string().nullish(),
8790
- agentName: string().nullish(),
8791
8829
  description: string(),
8792
8830
  enableChat: boolean().nullish(),
8793
8831
  externalSkills: array(lazy(() => ImportSkillInputSchema())),
8832
+ mainAgent: lazy(() => ImportMainAgentInputSchema().nullish()),
8794
8833
  mastraEnabled: boolean(),
8795
- models: array(lazy(() => ImportModelInputSchema())).nullish(),
8834
+ models: array(lazy(() => ImportModelInputSchema())),
8796
8835
  name: string(),
8797
8836
  observabilityEnabled: boolean().nullish(),
8798
8837
  packages: array(lazy(() => ImportPackageInputSchema())),
8799
8838
  powerhouse: PowerhouseLevelSchema,
8800
- profiles: array(lazy(() => ImportProfileInputSchema())).nullish(),
8839
+ profiles: array(lazy(() => ImportProfileInputSchema())),
8801
8840
  proxyEnabled: boolean().nullish(),
8802
8841
  routineEnabled: boolean(),
8803
8842
  scope: string().nullish(),
8843
+ subAgents: array(lazy(() => ImportSubAgentInputSchema())),
8804
8844
  supportedResources: array(string()).nullish(),
8805
8845
  version: string()
8806
8846
  });
8807
8847
  }
8848
+ function ImportSubAgentInputSchema() {
8849
+ return object({
8850
+ description: string(),
8851
+ id: string(),
8852
+ modelId: string(),
8853
+ name: string(),
8854
+ profileIds: array(string()),
8855
+ skills: array(string()),
8856
+ toolPatterns: array(string())
8857
+ });
8858
+ }
8808
8859
  function PhClintAgentModelSchema() {
8809
8860
  return object({
8810
8861
  __typename: literal("PhClintAgentModel").optional(),
@@ -8836,6 +8887,19 @@ function PhClintFeaturesSchema() {
8836
8887
  routine: lazy(() => PhClintRoutineFeatureSchema())
8837
8888
  });
8838
8889
  }
8890
+ function PhClintMainAgentSchema() {
8891
+ return object({
8892
+ __typename: literal("PhClintMainAgent").optional(),
8893
+ description: string().nullish(),
8894
+ id: string(),
8895
+ image: string().nullish(),
8896
+ modelId: string(),
8897
+ name: string(),
8898
+ profileIds: array(string()),
8899
+ skills: array(string()),
8900
+ toolPatterns: array(string())
8901
+ });
8902
+ }
8839
8903
  function PhClintMastraCommonSchema() {
8840
8904
  return object({
8841
8905
  __typename: literal("PhClintMastraCommon").optional(),
@@ -8845,14 +8909,12 @@ function PhClintMastraCommonSchema() {
8845
8909
  function PhClintMastraFeatureSchema() {
8846
8910
  return object({
8847
8911
  __typename: literal("PhClintMastraFeature").optional(),
8848
- agentDescription: string().nullish(),
8849
- agentId: string().nullish(),
8850
- agentImage: string().nullish(),
8851
- agentName: string().nullish(),
8852
8912
  common: lazy(() => PhClintMastraCommonSchema()),
8853
8913
  enabled: boolean(),
8914
+ mainAgent: lazy(() => PhClintMainAgentSchema().nullish()),
8854
8915
  models: array(lazy(() => PhClintAgentModelSchema())),
8855
- profiles: array(lazy(() => PhClintAgentProfileSchema()))
8916
+ profiles: array(lazy(() => PhClintAgentProfileSchema())),
8917
+ subAgents: array(lazy(() => PhClintSubAgentSchema()))
8856
8918
  });
8857
8919
  }
8858
8920
  function PhClintProjectStateSchema() {
@@ -8875,6 +8937,18 @@ function PhClintRoutineFeatureSchema() {
8875
8937
  enabled: boolean()
8876
8938
  });
8877
8939
  }
8940
+ function PhClintSubAgentSchema() {
8941
+ return object({
8942
+ __typename: literal("PhClintSubAgent").optional(),
8943
+ description: string(),
8944
+ id: string(),
8945
+ modelId: string(),
8946
+ name: string(),
8947
+ profileIds: array(string()),
8948
+ skills: array(string()),
8949
+ toolPatterns: array(string())
8950
+ });
8951
+ }
8878
8952
  function PowerhousePackageSchema() {
8879
8953
  return object({
8880
8954
  __typename: literal("PowerhousePackage").optional(),
@@ -8913,6 +8987,24 @@ function PublishStagingInputSchema() {
8913
8987
  timestamp: datetime()
8914
8988
  });
8915
8989
  }
8990
+ function RemoveAgentProfileRefInputSchema() {
8991
+ return object({
8992
+ agentId: string(),
8993
+ profileId: string()
8994
+ });
8995
+ }
8996
+ function RemoveAgentSkillInputSchema() {
8997
+ return object({
8998
+ agentId: string(),
8999
+ name: string()
9000
+ });
9001
+ }
9002
+ function RemoveAgentToolPatternInputSchema() {
9003
+ return object({
9004
+ agentId: string(),
9005
+ pattern: string()
9006
+ });
9007
+ }
8916
9008
  function RemoveExternalSkillInputSchema() {
8917
9009
  return object({ id: string() });
8918
9010
  }
@@ -8931,26 +9023,30 @@ function RemovePowerhousePackageInputSchema() {
8931
9023
  function RemoveProfileInputSchema() {
8932
9024
  return object({ id: string() });
8933
9025
  }
9026
+ function RemoveSubAgentInputSchema() {
9027
+ return object({ id: string() });
9028
+ }
8934
9029
  function RemoveSupportedResourceInputSchema() {
8935
9030
  return object({ resource: string() });
8936
9031
  }
8937
- function ReorderProfilesInputSchema() {
9032
+ function ReorderAgentProfileRefsInputSchema() {
8938
9033
  return object({
9034
+ agentId: string(),
8939
9035
  ids: array(string()),
8940
9036
  insertBefore: string().nullish()
8941
9037
  });
8942
9038
  }
8943
- function SetAgentDescriptionInputSchema() {
8944
- return object({ description: string() });
8945
- }
8946
- function SetAgentIdInputSchema() {
8947
- return object({ agentId: string() });
8948
- }
8949
- function SetAgentImageInputSchema() {
8950
- return object({ image: string() });
9039
+ function ReorderProfilesInputSchema() {
9040
+ return object({
9041
+ ids: array(string()),
9042
+ insertBefore: string().nullish()
9043
+ });
8951
9044
  }
8952
- function SetAgentNameInputSchema() {
8953
- return object({ agentName: string() });
9045
+ function SetAgentModelInputSchema() {
9046
+ return object({
9047
+ agentId: string(),
9048
+ modelId: string()
9049
+ });
8954
9050
  }
8955
9051
  function SetDefaultModelInputSchema() {
8956
9052
  return object({ id: string() });
@@ -8973,6 +9069,15 @@ function SetExternalSkillNameInputSchema() {
8973
9069
  name: string()
8974
9070
  });
8975
9071
  }
9072
+ function SetMainAgentDescriptionInputSchema() {
9073
+ return object({ description: string() });
9074
+ }
9075
+ function SetMainAgentImageInputSchema() {
9076
+ return object({ image: string() });
9077
+ }
9078
+ function SetMainAgentNameInputSchema() {
9079
+ return object({ name: string() });
9080
+ }
8976
9081
  function SetObservabilityEnabledInputSchema() {
8977
9082
  return object({ enabled: boolean() });
8978
9083
  }
@@ -9000,6 +9105,18 @@ function SetPublishStatusInputSchema() {
9000
9105
  status: PublishStatusSchema
9001
9106
  });
9002
9107
  }
9108
+ function SetSubAgentDescriptionInputSchema() {
9109
+ return object({
9110
+ description: string(),
9111
+ id: string()
9112
+ });
9113
+ }
9114
+ function SetSubAgentNameInputSchema() {
9115
+ return object({
9116
+ id: string(),
9117
+ name: string()
9118
+ });
9119
+ }
9003
9120
  function SetVersionInputSchema() {
9004
9121
  return object({ version: string() });
9005
9122
  }
@@ -9016,7 +9133,7 @@ function UpdateProfileInputSchema() {
9016
9133
  * WARNING: DO NOT EDIT
9017
9134
  * This file is auto-generated and updated by codegen
9018
9135
  */
9019
- var creators_exports$8 = /* @__PURE__ */ __exportAll({
9136
+ var creators_exports$13 = /* @__PURE__ */ __exportAll({
9020
9137
  addSupportedResource: () => addSupportedResource,
9021
9138
  removeSupportedResource: () => removeSupportedResource,
9022
9139
  setObservabilityEnabled: () => setObservabilityEnabled,
@@ -9032,7 +9149,7 @@ const setObservabilityEnabled = (input) => createAction("SET_OBSERVABILITY_ENABL
9032
9149
  * WARNING: DO NOT EDIT
9033
9150
  * This file is auto-generated and updated by codegen
9034
9151
  */
9035
- var creators_exports$7 = /* @__PURE__ */ __exportAll({
9152
+ var creators_exports$12 = /* @__PURE__ */ __exportAll({
9036
9153
  addExternalSkill: () => addExternalSkill,
9037
9154
  removeExternalSkill: () => removeExternalSkill,
9038
9155
  setExternalSkillGithubUrl: () => setExternalSkillGithubUrl,
@@ -9048,37 +9165,13 @@ const setExternalSkillGithubUrl = (input) => createAction("SET_EXTERNAL_SKILL_GI
9048
9165
  * WARNING: DO NOT EDIT
9049
9166
  * This file is auto-generated and updated by codegen
9050
9167
  */
9051
- var creators_exports$6 = /* @__PURE__ */ __exportAll({
9052
- addModel: () => addModel,
9053
- addProfile: () => addProfile,
9054
- clearAgentImage: () => clearAgentImage,
9168
+ var creators_exports$11 = /* @__PURE__ */ __exportAll({
9055
9169
  disableMastra: () => disableMastra,
9056
9170
  enableMastra: () => enableMastra,
9057
- removeModel: () => removeModel,
9058
- removeProfile: () => removeProfile,
9059
- reorderProfiles: () => reorderProfiles,
9060
- setAgentDescription: () => setAgentDescription,
9061
- setAgentId: () => setAgentId,
9062
- setAgentImage: () => setAgentImage,
9063
- setAgentName: () => setAgentName,
9064
- setDefaultModel: () => setDefaultModel,
9065
- setEnableChat: () => setEnableChat,
9066
- updateProfile: () => updateProfile
9171
+ setEnableChat: () => setEnableChat
9067
9172
  });
9068
9173
  const enableMastra = (input) => createAction("ENABLE_MASTRA", { ...input }, void 0, EnableMastraInputSchema, "global");
9069
9174
  const disableMastra = (input) => createAction("DISABLE_MASTRA", { ...input }, void 0, DisableMastraInputSchema, "global");
9070
- const setAgentId = (input) => createAction("SET_AGENT_ID", { ...input }, void 0, SetAgentIdInputSchema, "global");
9071
- const setAgentName = (input) => createAction("SET_AGENT_NAME", { ...input }, void 0, SetAgentNameInputSchema, "global");
9072
- const addModel = (input) => createAction("ADD_MODEL", { ...input }, void 0, AddModelInputSchema, "global");
9073
- const removeModel = (input) => createAction("REMOVE_MODEL", { ...input }, void 0, RemoveModelInputSchema, "global");
9074
- const setDefaultModel = (input) => createAction("SET_DEFAULT_MODEL", { ...input }, void 0, SetDefaultModelInputSchema, "global");
9075
- const addProfile = (input) => createAction("ADD_PROFILE", { ...input }, void 0, AddProfileInputSchema, "global");
9076
- const updateProfile = (input) => createAction("UPDATE_PROFILE", { ...input }, void 0, UpdateProfileInputSchema, "global");
9077
- const removeProfile = (input) => createAction("REMOVE_PROFILE", { ...input }, void 0, RemoveProfileInputSchema, "global");
9078
- const reorderProfiles = (input) => createAction("REORDER_PROFILES", { ...input }, void 0, ReorderProfilesInputSchema, "global");
9079
- const setAgentDescription = (input) => createAction("SET_AGENT_DESCRIPTION", { ...input }, void 0, SetAgentDescriptionInputSchema, "global");
9080
- const setAgentImage = (input) => createAction("SET_AGENT_IMAGE", { ...input }, void 0, SetAgentImageInputSchema, "global");
9081
- const clearAgentImage = (input) => createAction("CLEAR_AGENT_IMAGE", { ...input }, void 0, ClearAgentImageInputSchema, "global");
9082
9175
  const setEnableChat = (input) => createAction("SET_ENABLE_CHAT", { ...input }, void 0, SetEnableChatInputSchema, "global");
9083
9176
  //#endregion
9084
9177
  //#region document-models/ph-clint-project/v1/gen/features-powerhouse/creators.ts
@@ -9086,7 +9179,7 @@ const setEnableChat = (input) => createAction("SET_ENABLE_CHAT", { ...input }, v
9086
9179
  * WARNING: DO NOT EDIT
9087
9180
  * This file is auto-generated and updated by codegen
9088
9181
  */
9089
- var creators_exports$5 = /* @__PURE__ */ __exportAll({ setPowerhouseLevel: () => setPowerhouseLevel });
9182
+ var creators_exports$10 = /* @__PURE__ */ __exportAll({ setPowerhouseLevel: () => setPowerhouseLevel });
9090
9183
  const setPowerhouseLevel = (input) => createAction("SET_POWERHOUSE_LEVEL", { ...input }, void 0, SetPowerhouseLevelInputSchema, "global");
9091
9184
  //#endregion
9092
9185
  //#region document-models/ph-clint-project/v1/gen/features-routine/creators.ts
@@ -9094,7 +9187,7 @@ const setPowerhouseLevel = (input) => createAction("SET_POWERHOUSE_LEVEL", { ...
9094
9187
  * WARNING: DO NOT EDIT
9095
9188
  * This file is auto-generated and updated by codegen
9096
9189
  */
9097
- var creators_exports$4 = /* @__PURE__ */ __exportAll({
9190
+ var creators_exports$9 = /* @__PURE__ */ __exportAll({
9098
9191
  disableRoutine: () => disableRoutine,
9099
9192
  enableRoutine: () => enableRoutine
9100
9193
  });
@@ -9106,7 +9199,7 @@ const disableRoutine = (input) => createAction("DISABLE_ROUTINE", { ...input },
9106
9199
  * WARNING: DO NOT EDIT
9107
9200
  * This file is auto-generated and updated by codegen
9108
9201
  */
9109
- var creators_exports$3 = /* @__PURE__ */ __exportAll({
9202
+ var creators_exports$8 = /* @__PURE__ */ __exportAll({
9110
9203
  setDescription: () => setDescription,
9111
9204
  setPackageIdentifier: () => setPackageIdentifier,
9112
9205
  setVersion: () => setVersion
@@ -9120,9 +9213,97 @@ const setPackageIdentifier = (input) => createAction("SET_PACKAGE_IDENTIFIER", {
9120
9213
  * WARNING: DO NOT EDIT
9121
9214
  * This file is auto-generated and updated by codegen
9122
9215
  */
9123
- var creators_exports$2 = /* @__PURE__ */ __exportAll({ importSpec: () => importSpec });
9216
+ var creators_exports$7 = /* @__PURE__ */ __exportAll({ importSpec: () => importSpec });
9124
9217
  const importSpec = (input) => createAction("IMPORT_SPEC", { ...input }, void 0, ImportSpecInputSchema, "global");
9125
9218
  //#endregion
9219
+ //#region document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.ts
9220
+ /**
9221
+ * WARNING: DO NOT EDIT
9222
+ * This file is auto-generated and updated by codegen
9223
+ */
9224
+ var creators_exports$6 = /* @__PURE__ */ __exportAll({
9225
+ addAgentProfileRef: () => addAgentProfileRef,
9226
+ addAgentSkill: () => addAgentSkill,
9227
+ addAgentToolPattern: () => addAgentToolPattern,
9228
+ removeAgentProfileRef: () => removeAgentProfileRef,
9229
+ removeAgentSkill: () => removeAgentSkill,
9230
+ removeAgentToolPattern: () => removeAgentToolPattern,
9231
+ reorderAgentProfileRefs: () => reorderAgentProfileRefs,
9232
+ setAgentModel: () => setAgentModel
9233
+ });
9234
+ const setAgentModel = (input) => createAction("SET_AGENT_MODEL", { ...input }, void 0, SetAgentModelInputSchema, "global");
9235
+ const addAgentProfileRef = (input) => createAction("ADD_AGENT_PROFILE_REF", { ...input }, void 0, AddAgentProfileRefInputSchema, "global");
9236
+ const removeAgentProfileRef = (input) => createAction("REMOVE_AGENT_PROFILE_REF", { ...input }, void 0, RemoveAgentProfileRefInputSchema, "global");
9237
+ const reorderAgentProfileRefs = (input) => createAction("REORDER_AGENT_PROFILE_REFS", { ...input }, void 0, ReorderAgentProfileRefsInputSchema, "global");
9238
+ const addAgentSkill = (input) => createAction("ADD_AGENT_SKILL", { ...input }, void 0, AddAgentSkillInputSchema, "global");
9239
+ const removeAgentSkill = (input) => createAction("REMOVE_AGENT_SKILL", { ...input }, void 0, RemoveAgentSkillInputSchema, "global");
9240
+ const addAgentToolPattern = (input) => createAction("ADD_AGENT_TOOL_PATTERN", { ...input }, void 0, AddAgentToolPatternInputSchema, "global");
9241
+ const removeAgentToolPattern = (input) => createAction("REMOVE_AGENT_TOOL_PATTERN", { ...input }, void 0, RemoveAgentToolPatternInputSchema, "global");
9242
+ //#endregion
9243
+ //#region document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.ts
9244
+ /**
9245
+ * WARNING: DO NOT EDIT
9246
+ * This file is auto-generated and updated by codegen
9247
+ */
9248
+ var creators_exports$5 = /* @__PURE__ */ __exportAll({
9249
+ clearMainAgentDescription: () => clearMainAgentDescription,
9250
+ clearMainAgentImage: () => clearMainAgentImage,
9251
+ setMainAgentDescription: () => setMainAgentDescription,
9252
+ setMainAgentImage: () => setMainAgentImage,
9253
+ setMainAgentName: () => setMainAgentName
9254
+ });
9255
+ const setMainAgentName = (input) => createAction("SET_MAIN_AGENT_NAME", { ...input }, void 0, SetMainAgentNameInputSchema, "global");
9256
+ const setMainAgentDescription = (input) => createAction("SET_MAIN_AGENT_DESCRIPTION", { ...input }, void 0, SetMainAgentDescriptionInputSchema, "global");
9257
+ const clearMainAgentDescription = (input) => createAction("CLEAR_MAIN_AGENT_DESCRIPTION", { ...input }, void 0, ClearMainAgentDescriptionInputSchema, "global");
9258
+ const setMainAgentImage = (input) => createAction("SET_MAIN_AGENT_IMAGE", { ...input }, void 0, SetMainAgentImageInputSchema, "global");
9259
+ const clearMainAgentImage = (input) => createAction("CLEAR_MAIN_AGENT_IMAGE", { ...input }, void 0, ClearMainAgentImageInputSchema, "global");
9260
+ //#endregion
9261
+ //#region document-models/ph-clint-project/v1/gen/mastra-models/creators.ts
9262
+ /**
9263
+ * WARNING: DO NOT EDIT
9264
+ * This file is auto-generated and updated by codegen
9265
+ */
9266
+ var creators_exports$4 = /* @__PURE__ */ __exportAll({
9267
+ addModel: () => addModel,
9268
+ removeModel: () => removeModel,
9269
+ setDefaultModel: () => setDefaultModel
9270
+ });
9271
+ const addModel = (input) => createAction("ADD_MODEL", { ...input }, void 0, AddModelInputSchema, "global");
9272
+ const removeModel = (input) => createAction("REMOVE_MODEL", { ...input }, void 0, RemoveModelInputSchema, "global");
9273
+ const setDefaultModel = (input) => createAction("SET_DEFAULT_MODEL", { ...input }, void 0, SetDefaultModelInputSchema, "global");
9274
+ //#endregion
9275
+ //#region document-models/ph-clint-project/v1/gen/mastra-profiles/creators.ts
9276
+ /**
9277
+ * WARNING: DO NOT EDIT
9278
+ * This file is auto-generated and updated by codegen
9279
+ */
9280
+ var creators_exports$3 = /* @__PURE__ */ __exportAll({
9281
+ addProfile: () => addProfile,
9282
+ removeProfile: () => removeProfile,
9283
+ reorderProfiles: () => reorderProfiles,
9284
+ updateProfile: () => updateProfile
9285
+ });
9286
+ const addProfile = (input) => createAction("ADD_PROFILE", { ...input }, void 0, AddProfileInputSchema, "global");
9287
+ const updateProfile = (input) => createAction("UPDATE_PROFILE", { ...input }, void 0, UpdateProfileInputSchema, "global");
9288
+ const removeProfile = (input) => createAction("REMOVE_PROFILE", { ...input }, void 0, RemoveProfileInputSchema, "global");
9289
+ const reorderProfiles = (input) => createAction("REORDER_PROFILES", { ...input }, void 0, ReorderProfilesInputSchema, "global");
9290
+ //#endregion
9291
+ //#region document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.ts
9292
+ /**
9293
+ * WARNING: DO NOT EDIT
9294
+ * This file is auto-generated and updated by codegen
9295
+ */
9296
+ var creators_exports$2 = /* @__PURE__ */ __exportAll({
9297
+ addSubAgent: () => addSubAgent,
9298
+ removeSubAgent: () => removeSubAgent,
9299
+ setSubAgentDescription: () => setSubAgentDescription,
9300
+ setSubAgentName: () => setSubAgentName
9301
+ });
9302
+ const addSubAgent = (input) => createAction("ADD_SUB_AGENT", { ...input }, void 0, AddSubAgentInputSchema, "global");
9303
+ const removeSubAgent = (input) => createAction("REMOVE_SUB_AGENT", { ...input }, void 0, RemoveSubAgentInputSchema, "global");
9304
+ const setSubAgentName = (input) => createAction("SET_SUB_AGENT_NAME", { ...input }, void 0, SetSubAgentNameInputSchema, "global");
9305
+ const setSubAgentDescription = (input) => createAction("SET_SUB_AGENT_DESCRIPTION", { ...input }, void 0, SetSubAgentDescriptionInputSchema, "global");
9306
+ //#endregion
9126
9307
  //#region document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.ts
9127
9308
  /**
9128
9309
  * WARNING: DO NOT EDIT
@@ -9167,15 +9348,20 @@ const setPublishStatus = (input) => createAction("SET_PUBLISH_STATUS", { ...inpu
9167
9348
  /** Actions for the PhClintProject document model */
9168
9349
  const actions = {
9169
9350
  ...baseActions,
9170
- ...creators_exports$3,
9171
- ...creators_exports$5,
9172
- ...creators_exports$6,
9173
- ...creators_exports$4,
9351
+ ...creators_exports$8,
9352
+ ...creators_exports$10,
9353
+ ...creators_exports$9,
9174
9354
  ...creators_exports$1,
9175
- ...creators_exports$7,
9355
+ ...creators_exports$12,
9176
9356
  ...creators_exports,
9357
+ ...creators_exports$7,
9358
+ ...creators_exports$13,
9359
+ ...creators_exports$11,
9360
+ ...creators_exports$4,
9361
+ ...creators_exports$3,
9362
+ ...creators_exports$5,
9177
9363
  ...creators_exports$2,
9178
- ...creators_exports$8
9364
+ ...creators_exports$6
9179
9365
  };
9180
9366
  //#endregion
9181
9367
  //#region document-models/ph-clint-project/v1/gen/document-model.ts
@@ -9196,9 +9382,9 @@ const documentModel = {
9196
9382
  initialValue: ""
9197
9383
  },
9198
9384
  global: {
9199
- schema: "type PhClintProjectState {\n name: String\n scope: String\n version: String!\n description: String!\n features: PhClintFeatures!\n packages: [PowerhousePackage!]!\n externalSkills: [ExternalSkill!]!\n publishHistory: [PublishRecord!]!\n deployment: PhClintDeployment!\n}\n\ntype PhClintFeatures {\n powerhouse: PowerhouseLevel!\n mastra: PhClintMastraFeature!\n routine: PhClintRoutineFeature!\n}\n\nenum PowerhouseLevel {\n Disabled\n Reactor\n Switchboard\n Connect\n}\n\ntype PhClintMastraFeature {\n enabled: Boolean!\n agentId: String\n agentName: String\n agentDescription: String\n agentImage: String\n models: [PhClintAgentModel!]!\n profiles: [PhClintAgentProfile!]!\n common: PhClintMastraCommon!\n}\n\ntype PhClintMastraCommon {\n enableChat: Boolean!\n}\n\ntype PhClintAgentModel {\n id: String!\n isDefault: Boolean!\n}\n\ntype PhClintAgentProfile {\n id: String!\n title: String!\n content: String!\n}\n\ntype PhClintRoutineFeature {\n enabled: Boolean!\n}\n\ntype PowerhousePackage {\n id: OID!\n packageName: String!\n documentTypes: [String!]!\n version: String\n managed: Boolean!\n}\n\ntype ExternalSkill {\n id: OID!\n name: String!\n githubUrl: URL!\n}\n\nenum PublishTag {\n Dev\n Staging\n Production\n}\n\nenum PublishStatus {\n Pending\n InProgress\n Succeeded\n Failed\n}\n\ntype PublishRecord {\n id: OID!\n tag: PublishTag!\n version: String!\n timestamp: DateTime!\n status: PublishStatus!\n}\n\ntype PhClintDeployment {\n proxyEnabled: Boolean!\n observabilityEnabled: Boolean!\n supportedResources: [String!]!\n}",
9385
+ schema: "type PhClintProjectState {\n name: String\n scope: String\n version: String!\n description: String!\n features: PhClintFeatures!\n packages: [PowerhousePackage!]!\n externalSkills: [ExternalSkill!]!\n publishHistory: [PublishRecord!]!\n deployment: PhClintDeployment!\n}\n\ntype PhClintFeatures {\n powerhouse: PowerhouseLevel!\n mastra: PhClintMastraFeature!\n routine: PhClintRoutineFeature!\n}\n\nenum PowerhouseLevel {\n Disabled\n Reactor\n Switchboard\n Connect\n}\n\ntype PhClintMastraFeature {\n enabled: Boolean!\n mainAgent: PhClintMainAgent\n subAgents: [PhClintSubAgent!]!\n models: [PhClintAgentModel!]!\n profiles: [PhClintAgentProfile!]!\n common: PhClintMastraCommon!\n}\n\ntype PhClintMainAgent {\n id: OID!\n name: String!\n description: String\n image: String\n modelId: OID!\n profileIds: [OID!]!\n skills: [String!]!\n toolPatterns: [String!]!\n}\n\ntype PhClintSubAgent {\n id: OID!\n name: String!\n description: String!\n modelId: OID!\n profileIds: [OID!]!\n skills: [String!]!\n toolPatterns: [String!]!\n}\n\ntype PhClintMastraCommon {\n enableChat: Boolean!\n}\n\ntype PhClintAgentModel {\n id: OID!\n isDefault: Boolean!\n}\n\ntype PhClintAgentProfile {\n id: OID!\n title: String!\n content: String!\n}\n\ntype PhClintRoutineFeature {\n enabled: Boolean!\n}\n\ntype PowerhousePackage {\n id: OID!\n packageName: String!\n documentTypes: [String!]!\n version: String\n managed: Boolean!\n}\n\ntype ExternalSkill {\n id: OID!\n name: String!\n githubUrl: URL!\n}\n\nenum PublishTag {\n Dev\n Staging\n Production\n}\n\nenum PublishStatus {\n Pending\n InProgress\n Succeeded\n Failed\n}\n\ntype PublishRecord {\n id: OID!\n tag: PublishTag!\n version: String!\n timestamp: DateTime!\n status: PublishStatus!\n}\n\ntype PhClintDeployment {\n proxyEnabled: Boolean!\n observabilityEnabled: Boolean!\n supportedResources: [String!]!\n}",
9200
9386
  examples: [],
9201
- initialValue: "{\n \"name\": null,\n \"scope\": null,\n \"version\": \"0.1.0\",\n \"description\": \"\",\n \"features\": {\n \"powerhouse\": \"Disabled\",\n \"mastra\": {\n \"enabled\": false,\n \"agentId\": null,\n \"agentName\": null,\n \"agentDescription\": null,\n \"agentImage\": null,\n \"models\": [],\n \"profiles\": [],\n \"common\": { \"enableChat\": false }\n },\n \"routine\": { \"enabled\": false }\n },\n \"packages\": [],\n \"externalSkills\": [],\n \"publishHistory\": [],\n \"deployment\": {\n \"proxyEnabled\": false,\n \"observabilityEnabled\": false,\n \"supportedResources\": [\n \"vetra-agent-s\",\n \"vetra-agent-m\",\n \"vetra-agent-l\",\n \"vetra-agent-xl\",\n \"vetra-agent-xxl\"\n ]\n }\n}"
9387
+ initialValue: "{\n \"name\": null,\n \"scope\": null,\n \"version\": \"0.1.0\",\n \"description\": \"\",\n \"features\": {\n \"powerhouse\": \"Disabled\",\n \"mastra\": {\n \"enabled\": false,\n \"mainAgent\": null,\n \"subAgents\": [],\n \"models\": [],\n \"profiles\": [],\n \"common\": { \"enableChat\": false }\n },\n \"routine\": { \"enabled\": false }\n },\n \"packages\": [],\n \"externalSkills\": [],\n \"publishHistory\": [],\n \"deployment\": {\n \"proxyEnabled\": false,\n \"observabilityEnabled\": false,\n \"supportedResources\": [\n \"vetra-agent-s\",\n \"vetra-agent-m\",\n \"vetra-agent-l\",\n \"vetra-agent-xl\",\n \"vetra-agent-xxl\"\n ]\n }\n}"
9202
9388
  }
9203
9389
  },
9204
9390
  modules: [
@@ -9277,117 +9463,113 @@ const documentModel = {
9277
9463
  }]
9278
9464
  },
9279
9465
  {
9280
- id: "m-features-mastra",
9281
- name: "features_mastra",
9282
- description: "Mastra agent feature toggle. Orthogonal to Routine.",
9466
+ id: "m-features-routine",
9467
+ name: "features_routine",
9468
+ description: "Routine loop feature toggle.",
9469
+ operations: [{
9470
+ id: "o-enable-routine",
9471
+ name: "ENABLE_ROUTINE",
9472
+ description: "Enable the routine loop. Idempotent.",
9473
+ schema: "input EnableRoutineInput {\n _: Boolean\n}",
9474
+ template: "Enable the routine loop. Idempotent.",
9475
+ reducer: "state.features.routine.enabled = true;",
9476
+ errors: [],
9477
+ examples: [],
9478
+ scope: "global"
9479
+ }, {
9480
+ id: "o-disable-routine",
9481
+ name: "DISABLE_ROUTINE",
9482
+ description: "Disable the routine loop. Always allowed.",
9483
+ schema: "input DisableRoutineInput {\n _: Boolean\n}",
9484
+ template: "Disable the routine loop.",
9485
+ reducer: "state.features.routine.enabled = false;",
9486
+ errors: [],
9487
+ examples: [],
9488
+ scope: "global"
9489
+ }]
9490
+ },
9491
+ {
9492
+ id: "m-powerhouse-packages",
9493
+ name: "powerhouse_packages",
9494
+ description: "Manage reactor packages and their document types. The app package is auto-created when Powerhouse level goes above Disabled.",
9283
9495
  operations: [
9284
9496
  {
9285
- id: "o-enable-mastra",
9286
- name: "ENABLE_MASTRA",
9287
- description: "Enable the Mastra agent feature. Mastra and Routine are orthogonal — enable Routine separately if needed. Idempotent.",
9288
- schema: "input EnableMastraInput {\n agentId: String!\n agentName: String!\n}",
9289
- template: "Enable the Mastra agent feature. Mastra and Routine are orthogonal — enable Routine separately if needed. Idempotent.",
9290
- reducer: "if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\n throw new InvalidAgentIdError(\n `Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`,\n );\n}\nconst trimmedName = action.input.agentName.trim();\nif (!trimmedName) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n}\nstate.features.mastra.enabled = true;\nstate.features.mastra.agentId = action.input.agentId;\nstate.features.mastra.agentName = trimmedName;\n// Auto-add default model and profile\nif (state.features.mastra.models.length === 0) {\n state.features.mastra.models.push({ id: 'clint/demo-agent', isDefault: true });\n}\nif (state.features.mastra.profiles.length === 0) {\n state.features.mastra.profiles.push({ id: 'base', title: 'Base Profile', content: 'You are a helpful assistant.' });\n}",
9497
+ id: "o-add-powerhouse-package",
9498
+ name: "ADD_POWERHOUSE_PACKAGE",
9499
+ description: "Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.",
9500
+ schema: "input AddPowerhousePackageInput {\n id: OID!\n packageName: String!\n}",
9501
+ template: "Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.",
9502
+ reducer: "const exists = state.packages.find(\n (p) =>\n p.id === action.input.id ||\n p.packageName === action.input.packageName,\n);\nif (exists) {\n throw new DuplicatePackageError(\n `Package already exists: ${action.input.packageName}`,\n );\n}\nstate.packages.push({\n id: action.input.id,\n packageName: action.input.packageName,\n documentTypes: [],\n version: null,\n managed: false,\n});",
9291
9503
  errors: [{
9292
- id: "e-enable-mastra-invalid-id",
9293
- name: "InvalidAgentIdError",
9294
- code: "INVALID_AGENT_ID",
9295
- description: "The agent ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.",
9296
- template: ""
9297
- }, {
9298
- id: "e-enable-mastra-invalid-name",
9299
- name: "InvalidAgentNameError",
9300
- code: "INVALID_AGENT_NAME",
9301
- description: "The agent name must not be empty after trimming.",
9504
+ id: "e-duplicate-package",
9505
+ name: "DuplicatePackageError",
9506
+ code: "DUPLICATE_PACKAGE",
9507
+ description: "A package with the same ID or name already exists.",
9302
9508
  template: ""
9303
9509
  }],
9304
9510
  examples: [],
9305
9511
  scope: "global"
9306
9512
  },
9307
9513
  {
9308
- id: "o-disable-mastra",
9309
- name: "DISABLE_MASTRA",
9310
- description: "Disable the Mastra agent feature. Does not affect Routine — disable that separately if desired.",
9311
- schema: "input DisableMastraInput {\n _: Boolean\n}",
9312
- template: "Disable the Mastra agent feature. Does not affect Routine — disable that separately if desired.",
9313
- reducer: "state.features.mastra.enabled = false;\nstate.features.mastra.agentId = null;\nstate.features.mastra.agentName = null;\nstate.features.mastra.agentDescription = null;\nstate.features.mastra.agentImage = null;\nstate.features.mastra.models = [];\nstate.features.mastra.profiles = [];\nstate.features.mastra.common.enableChat = false;\n// Remove auto-added clint-common package if managed\nconst ccIdx = state.packages.findIndex(\n (p) => p.packageName === '@powerhousedao/clint-common' && p.managed,\n);\nif (ccIdx !== -1) {\n state.packages.splice(ccIdx, 1);\n}",
9314
- errors: [],
9514
+ id: "o-remove-powerhouse-package",
9515
+ name: "REMOVE_POWERHOUSE_PACKAGE",
9516
+ description: "Remove a reactor package. Cannot remove the auto-managed app package.",
9517
+ schema: "input RemovePowerhousePackageInput {\n id: OID!\n}",
9518
+ template: "Remove a reactor package. Cannot remove the auto-managed app package.",
9519
+ reducer: "const idx = state.packages.findIndex((p) => p.id === action.input.id);\nif (idx === -1) {\n throw new PackageNotFoundError(`Package not found: ${action.input.id}`);\n}\nconst pkg = state.packages[idx];\nif (pkg.managed) {\n throw new CannotRemoveManagedPackageError(\n \"Cannot remove a managed package\",\n );\n}\nstate.packages.splice(idx, 1);",
9520
+ errors: [
9521
+ {
9522
+ id: "e-package-not-found-remove",
9523
+ name: "PackageNotFoundError",
9524
+ code: "PACKAGE_NOT_FOUND",
9525
+ description: "The specified package ID was not found.",
9526
+ template: ""
9527
+ },
9528
+ {
9529
+ id: "e-cannot-remove-app-package",
9530
+ name: "CannotRemoveAppPackageError",
9531
+ code: "CANNOT_REMOVE_APP_PACKAGE",
9532
+ description: "The auto-managed app package cannot be removed.",
9533
+ template: ""
9534
+ },
9535
+ {
9536
+ id: "e-cannot-remove-managed",
9537
+ name: "CannotRemoveManagedPackageError",
9538
+ code: "CANNOT_REMOVE_MANAGED_PACKAGE",
9539
+ description: "Cannot remove a managed (framework-controlled) package",
9540
+ template: ""
9541
+ }
9542
+ ],
9315
9543
  examples: [],
9316
9544
  scope: "global"
9317
9545
  },
9318
9546
  {
9319
- id: "o-set-agent-id",
9320
- name: "SET_AGENT_ID",
9321
- description: "Set the agent ID. Must be lowercase kebab-case. Only valid when mastra is enabled.",
9322
- schema: "input SetAgentIdInput {\n agentId: String!\n}",
9323
- template: "Set the agent ID. Must be lowercase kebab-case. Only valid when mastra is enabled.",
9324
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent ID when Mastra is disabled.');\n}\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\n throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);\n}\nstate.features.mastra.agentId = action.input.agentId;",
9325
- errors: [{
9326
- id: "e-set-agent-id-not-enabled",
9327
- name: "MastraNotEnabledError",
9328
- code: "MASTRA_NOT_ENABLED",
9329
- description: "Mastra must be enabled before setting agent identity.",
9330
- template: ""
9331
- }, {
9332
- id: "e-set-agent-id-invalid",
9333
- name: "InvalidAgentIdError",
9334
- code: "INVALID_AGENT_ID",
9335
- description: "The agent ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.",
9336
- template: ""
9337
- }],
9338
- examples: [],
9339
- scope: "global"
9340
- },
9341
- {
9342
- id: "o-set-agent-name",
9343
- name: "SET_AGENT_NAME",
9344
- description: "Set the agent display name. Must be non-empty after trim. Only valid when mastra is enabled.",
9345
- schema: "input SetAgentNameInput {\n agentName: String!\n}",
9346
- template: "Set the agent display name. Must be non-empty after trim. Only valid when mastra is enabled.",
9347
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent name when Mastra is disabled.');\n}\nconst trimmedName = action.input.agentName.trim();\nif (!trimmedName) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n}\nstate.features.mastra.agentName = trimmedName;",
9348
- errors: [{
9349
- id: "e-set-agent-name-not-enabled",
9350
- name: "MastraNotEnabledError",
9351
- code: "MASTRA_NOT_ENABLED",
9352
- description: "Mastra must be enabled before setting agent identity.",
9353
- template: ""
9354
- }, {
9355
- id: "e-set-agent-name-invalid",
9356
- name: "InvalidAgentNameError",
9357
- code: "INVALID_AGENT_NAME",
9358
- description: "The agent name must not be empty after trimming.",
9359
- template: ""
9360
- }],
9361
- examples: [],
9362
- scope: "global"
9363
- },
9364
- {
9365
- id: "o-add-model",
9366
- name: "ADD_MODEL",
9367
- 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.",
9368
- schema: "input AddModelInput {\n id: String!\n isDefault: Boolean\n}",
9369
- 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.",
9370
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');\n}\nif (!/^[a-z0-9-]+\\/[a-z0-9._-]+$/.test(action.input.id)) {\n throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);\n}\nif (state.features.mastra.models.find(m => m.id === action.input.id)) {\n throw new DuplicateModelError(`Model already exists: ${action.input.id}`);\n}\nconst isFirst = state.features.mastra.models.length === 0;\nconst makeDefault = isFirst || action.input.isDefault === true;\nif (makeDefault) {\n for (const m of state.features.mastra.models) {\n m.isDefault = false;\n }\n}\nstate.features.mastra.models.push({\n id: action.input.id,\n isDefault: makeDefault,\n});",
9547
+ id: "o-add-package-document-type",
9548
+ name: "ADD_PACKAGE_DOCUMENT_TYPE",
9549
+ description: "Add a document type ID to a package (app or external).",
9550
+ schema: "input AddPackageDocumentTypeInput {\n packageId: OID!\n documentType: String!\n}",
9551
+ template: "Add a document type ID to a package (app or external).",
9552
+ reducer: "if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\/[a-z0-9-]+$/.test(action.input.documentType)) {\n throw new InvalidDocumentTypeError(\n `Invalid document type format: ${action.input.documentType}. Expected org/name.`,\n );\n}\nconst pkg = state.packages.find((p) => p.id === action.input.packageId);\nif (!pkg) {\n throw new PackageNotFoundError(\n `Package not found: ${action.input.packageId}`,\n );\n}\nif (action.input.documentType === '*/*') {\n pkg.documentTypes.length = 0;\n pkg.documentTypes.push('*/*');\n return;\n}\nif (pkg.documentTypes.includes('*/*')) {\n return;\n}\nif (pkg.documentTypes.includes(action.input.documentType)) {\n throw new DuplicateDocumentTypeError(\n `Document type already registered: ${action.input.documentType}`,\n );\n}\npkg.documentTypes.push(action.input.documentType);",
9371
9553
  errors: [
9372
9554
  {
9373
- id: "e-add-model-not-enabled",
9374
- name: "MastraNotEnabledError",
9375
- code: "MASTRA_NOT_ENABLED",
9376
- description: "Mastra must be enabled before managing models.",
9555
+ id: "e-invalid-document-type",
9556
+ name: "InvalidDocumentTypeError",
9557
+ code: "INVALID_DOCUMENT_TYPE",
9558
+ description: "Document type must match org/name format (e.g. powerhouse/ph-clint-project).",
9377
9559
  template: ""
9378
9560
  },
9379
9561
  {
9380
- id: "e-add-model-invalid-id",
9381
- name: "InvalidModelIdError",
9382
- code: "INVALID_MODEL_ID",
9383
- description: "Model ID must match provider/model-name format.",
9562
+ id: "e-package-not-found-add-dt",
9563
+ name: "PackageNotFoundError",
9564
+ code: "PACKAGE_NOT_FOUND",
9565
+ description: "The specified package ID was not found.",
9384
9566
  template: ""
9385
9567
  },
9386
9568
  {
9387
- id: "e-add-model-duplicate",
9388
- name: "DuplicateModelError",
9389
- code: "DUPLICATE_MODEL",
9390
- description: "A model with this ID already exists.",
9569
+ id: "e-duplicate-document-type",
9570
+ name: "DuplicateDocumentTypeError",
9571
+ code: "DUPLICATE_DOCUMENT_TYPE",
9572
+ description: "This document type is already registered in the package.",
9391
9573
  template: ""
9392
9574
  }
9393
9575
  ],
@@ -9395,85 +9577,125 @@ const documentModel = {
9395
9577
  scope: "global"
9396
9578
  },
9397
9579
  {
9398
- id: "o-remove-model",
9399
- name: "REMOVE_MODEL",
9400
- description: "Remove a model. If removing the default and others remain, promotes first remaining to default.",
9401
- schema: "input RemoveModelInput {\n id: String!\n}",
9402
- template: "Remove a model. If removing the default and others remain, promotes first remaining to default.",
9403
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');\n}\nconst idx = state.features.mastra.models.findIndex(m => m.id === action.input.id);\nif (idx === -1) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n}\nconst wasDefault = state.features.mastra.models[idx].isDefault;\nstate.features.mastra.models.splice(idx, 1);\nif (wasDefault && state.features.mastra.models.length > 0) {\n state.features.mastra.models[0].isDefault = true;\n}",
9580
+ id: "o-remove-package-document-type",
9581
+ name: "REMOVE_PACKAGE_DOCUMENT_TYPE",
9582
+ description: "Remove a document type ID from a package.",
9583
+ schema: "input RemovePackageDocumentTypeInput {\n packageId: OID!\n documentType: String!\n}",
9584
+ template: "Remove a document type ID from a package.",
9585
+ reducer: "const pkg = state.packages.find(p => p.id === action.input.packageId);\nif (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n}\nconst idx = pkg.documentTypes.indexOf(action.input.documentType);\nif (idx === -1) {\n throw new DocumentTypeNotFoundError(`Document type not found: ${action.input.documentType}`);\n}\npkg.documentTypes.splice(idx, 1);",
9404
9586
  errors: [{
9405
- id: "e-remove-model-not-enabled",
9406
- name: "MastraNotEnabledError",
9407
- code: "MASTRA_NOT_ENABLED",
9408
- description: "Mastra must be enabled before managing models.",
9587
+ id: "e-package-not-found-rm-dt",
9588
+ name: "PackageNotFoundError",
9589
+ code: "PACKAGE_NOT_FOUND",
9590
+ description: "The specified package ID was not found.",
9409
9591
  template: ""
9410
9592
  }, {
9411
- id: "e-remove-model-not-found",
9412
- name: "ModelNotFoundError",
9413
- code: "MODEL_NOT_FOUND",
9414
- description: "The specified model was not found.",
9593
+ id: "e-document-type-not-found",
9594
+ name: "DocumentTypeNotFoundError",
9595
+ code: "DOCUMENT_TYPE_NOT_FOUND",
9596
+ description: "The specified document type was not found in this package.",
9415
9597
  template: ""
9416
9598
  }],
9417
9599
  examples: [],
9418
9600
  scope: "global"
9419
9601
  },
9420
9602
  {
9421
- id: "o-set-default-model",
9422
- name: "SET_DEFAULT_MODEL",
9423
- description: "Set a model as the default. Unsets the previous default.",
9424
- schema: "input SetDefaultModelInput {\n id: String!\n}",
9425
- template: "Set a model as the default. Unsets the previous default.",
9426
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set default model when Mastra is disabled.');\n}\nconst model = state.features.mastra.models.find(m => m.id === action.input.id);\nif (!model) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n}\nfor (const m of state.features.mastra.models) {\n m.isDefault = false;\n}\nmodel.isDefault = true;",
9603
+ id: "o-set-package-version",
9604
+ name: "SET_PACKAGE_VERSION",
9605
+ description: "",
9606
+ schema: "input SetPackageVersionInput {\n packageId: OID!\n version: String\n}",
9607
+ template: "",
9608
+ reducer: "const pkg = state.packages.find((p) => p.id === action.input.packageId);\nif (!pkg) {\n throw new PackageNotFoundError(\n `Package not found: ${action.input.packageId}`,\n );\n}\nif (action.input.version != null) {\n const SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\n if (!SEMVER.test(action.input.version)) {\n throw new InvalidVersionError(\n `Invalid version: ${action.input.version}`,\n );\n }\n}\npkg.version = action.input.version || null;",
9427
9609
  errors: [{
9428
- id: "e-set-default-model-not-enabled",
9429
- name: "MastraNotEnabledError",
9430
- code: "MASTRA_NOT_ENABLED",
9431
- description: "Mastra must be enabled before managing models.",
9610
+ id: "e-pkg-not-found-set-ver",
9611
+ name: "PackageNotFoundError",
9612
+ code: "PACKAGE_NOT_FOUND",
9613
+ description: "Referenced package does not exist",
9432
9614
  template: ""
9433
9615
  }, {
9434
- id: "e-set-default-model-not-found",
9435
- name: "ModelNotFoundError",
9436
- code: "MODEL_NOT_FOUND",
9437
- description: "The specified model was not found.",
9616
+ id: "e-invalid-version",
9617
+ name: "InvalidVersionError",
9618
+ code: "INVALID_VERSION",
9619
+ description: "Version string is not valid semver",
9620
+ template: ""
9621
+ }],
9622
+ examples: [],
9623
+ scope: "global"
9624
+ }
9625
+ ]
9626
+ },
9627
+ {
9628
+ id: "m-external-skills",
9629
+ name: "external_skills",
9630
+ description: "External skills from the skills.sh ecosystem. Each skill has a name and GitHub URL for installation.",
9631
+ operations: [
9632
+ {
9633
+ id: "o-add-external-skill",
9634
+ name: "ADD_EXTERNAL_SKILL",
9635
+ description: "Add an external skill. Name must be lowercase kebab-case.",
9636
+ schema: "input AddExternalSkillInput {\n id: OID!\n name: String!\n githubUrl: URL!\n}",
9637
+ template: "Add an external skill. Name must be lowercase kebab-case.",
9638
+ reducer: "if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n}\nconst exists = state.externalSkills.find(s => s.id === action.input.id || s.name === action.input.name);\nif (exists) {\n throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);\n}\nstate.externalSkills.push({\n id: action.input.id,\n name: action.input.name,\n githubUrl: action.input.githubUrl,\n});",
9639
+ errors: [{
9640
+ id: "e-invalid-skill-name",
9641
+ name: "InvalidSkillNameError",
9642
+ code: "INVALID_SKILL_NAME",
9643
+ description: "Skill name must be lowercase kebab-case (e.g. playwright-cli).",
9644
+ template: ""
9645
+ }, {
9646
+ id: "e-duplicate-skill",
9647
+ name: "DuplicateSkillError",
9648
+ code: "DUPLICATE_SKILL",
9649
+ description: "A skill with the same ID or name already exists.",
9438
9650
  template: ""
9439
9651
  }],
9440
9652
  examples: [],
9441
9653
  scope: "global"
9442
9654
  },
9443
9655
  {
9444
- id: "o-add-profile",
9445
- name: "ADD_PROFILE",
9446
- description: "Add an agent profile section. Inserted before insertBefore if provided, otherwise appended to end.",
9447
- schema: "input AddProfileInput {\n id: String!\n title: String!\n content: String!\n insertBefore: String\n}",
9448
- template: "Add an agent profile section. Inserted before insertBefore if provided, otherwise appended to end.",
9449
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');\n}\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\n throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);\n}\nif (state.features.mastra.profiles.find(p => p.id === action.input.id)) {\n throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);\n}\nconst profile = {\n id: action.input.id,\n title: action.input.title,\n content: action.input.content,\n};\nif (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, profile);\n} else {\n state.features.mastra.profiles.push(profile);\n}",
9656
+ id: "o-remove-external-skill",
9657
+ name: "REMOVE_EXTERNAL_SKILL",
9658
+ description: "Remove an external skill by ID.",
9659
+ schema: "input RemoveExternalSkillInput {\n id: OID!\n}",
9660
+ template: "Remove an external skill by ID.",
9661
+ reducer: "const idx = state.externalSkills.findIndex(s => s.id === action.input.id);\nif (idx === -1) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n}\nstate.externalSkills.splice(idx, 1);",
9662
+ errors: [{
9663
+ id: "e-skill-not-found-remove",
9664
+ name: "SkillNotFoundError",
9665
+ code: "SKILL_NOT_FOUND",
9666
+ description: "The specified skill ID was not found.",
9667
+ template: ""
9668
+ }],
9669
+ examples: [],
9670
+ scope: "global"
9671
+ },
9672
+ {
9673
+ id: "o-set-external-skill-name",
9674
+ name: "SET_EXTERNAL_SKILL_NAME",
9675
+ description: "Update the name of an external skill.",
9676
+ schema: "input SetExternalSkillNameInput {\n id: OID!\n name: String!\n}",
9677
+ template: "Update the name of an external skill.",
9678
+ reducer: "const skill = state.externalSkills.find(s => s.id === action.input.id);\nif (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n}\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n}\nconst duplicate = state.externalSkills.find(s => s.name === action.input.name && s.id !== action.input.id);\nif (duplicate) {\n throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);\n}\nskill.name = action.input.name;",
9450
9679
  errors: [
9451
9680
  {
9452
- id: "e-add-profile-not-enabled",
9453
- name: "MastraNotEnabledError",
9454
- code: "MASTRA_NOT_ENABLED",
9455
- description: "Mastra must be enabled before managing profiles.",
9456
- template: ""
9457
- },
9458
- {
9459
- id: "e-add-profile-invalid-id",
9460
- name: "InvalidProfileIdError",
9461
- code: "INVALID_PROFILE_ID",
9462
- description: "Profile ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.",
9681
+ id: "e-skill-not-found-set-name",
9682
+ name: "SkillNotFoundError",
9683
+ code: "SKILL_NOT_FOUND",
9684
+ description: "The specified skill ID was not found.",
9463
9685
  template: ""
9464
9686
  },
9465
9687
  {
9466
- id: "e-add-profile-duplicate",
9467
- name: "DuplicateProfileError",
9468
- code: "DUPLICATE_PROFILE",
9469
- description: "A profile with this ID already exists.",
9688
+ id: "e-invalid-skill-name-set",
9689
+ name: "InvalidSkillNameError",
9690
+ code: "INVALID_SKILL_NAME",
9691
+ description: "Skill name must be lowercase kebab-case.",
9470
9692
  template: ""
9471
9693
  },
9472
9694
  {
9473
- id: "e-add-profile-not-found",
9474
- name: "ProfileNotFoundError",
9475
- code: "PROFILE_NOT_FOUND",
9476
- description: "The insertBefore profile was not found.",
9695
+ id: "e-duplicate-skill-set-name",
9696
+ name: "DuplicateSkillError",
9697
+ code: "DUPLICATE_SKILL",
9698
+ description: "Another skill already uses this name.",
9477
9699
  template: ""
9478
9700
  }
9479
9701
  ],
@@ -9481,131 +9703,222 @@ const documentModel = {
9481
9703
  scope: "global"
9482
9704
  },
9483
9705
  {
9484
- id: "o-update-profile",
9485
- name: "UPDATE_PROFILE",
9486
- description: "Update an existing profile's title and/or content. Only updates provided fields.",
9487
- schema: "input UpdateProfileInput {\n id: String!\n title: String\n content: String\n}",
9488
- template: "Update an existing profile's title and/or content. Only updates provided fields.",
9489
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');\n}\nconst profile = state.features.mastra.profiles.find(p => p.id === action.input.id);\nif (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n}\nif (action.input.title) profile.title = action.input.title;\nif (action.input.content) profile.content = action.input.content;",
9706
+ id: "o-set-external-skill-github-url",
9707
+ name: "SET_EXTERNAL_SKILL_GITHUB_URL",
9708
+ description: "Update the GitHub URL of an external skill.",
9709
+ schema: "input SetExternalSkillGithubUrlInput {\n id: OID!\n githubUrl: URL!\n}",
9710
+ template: "Update the GitHub URL of an external skill.",
9711
+ reducer: "const skill = state.externalSkills.find(s => s.id === action.input.id);\nif (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n}\nskill.githubUrl = action.input.githubUrl;",
9490
9712
  errors: [{
9491
- id: "e-update-profile-not-enabled",
9492
- name: "MastraNotEnabledError",
9493
- code: "MASTRA_NOT_ENABLED",
9494
- description: "Mastra must be enabled before managing profiles.",
9495
- template: ""
9496
- }, {
9497
- id: "e-update-profile-not-found",
9498
- name: "ProfileNotFoundError",
9499
- code: "PROFILE_NOT_FOUND",
9500
- description: "The specified profile was not found.",
9713
+ id: "e-skill-not-found-set-url",
9714
+ name: "SkillNotFoundError",
9715
+ code: "SKILL_NOT_FOUND",
9716
+ description: "The specified skill ID was not found.",
9501
9717
  template: ""
9502
9718
  }],
9503
9719
  examples: [],
9504
9720
  scope: "global"
9505
- },
9721
+ }
9722
+ ]
9723
+ },
9724
+ {
9725
+ id: "m-publishing",
9726
+ name: "publishing",
9727
+ description: "Version bumping and publish records. Tracks dev/staging/production publish intents and their status.",
9728
+ operations: [
9506
9729
  {
9507
- id: "o-remove-profile",
9508
- name: "REMOVE_PROFILE",
9509
- description: "Remove an agent profile section.",
9510
- schema: "input RemoveProfileInput {\n id: String!\n}",
9511
- template: "Remove an agent profile section.",
9512
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');\n}\nconst idx = state.features.mastra.profiles.findIndex(p => p.id === action.input.id);\nif (idx === -1) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n}\nstate.features.mastra.profiles.splice(idx, 1);",
9730
+ id: "o-bump-version",
9731
+ name: "BUMP_VERSION",
9732
+ description: "Bump the project version. Must be a valid semver string greater than the current version.",
9733
+ schema: "input BumpVersionInput {\n version: String!\n}",
9734
+ template: "Bump the project version. Must be a valid semver string greater than the current version.",
9735
+ reducer: "if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n}\nstate.version = action.input.version;",
9513
9736
  errors: [{
9514
- id: "e-remove-profile-not-enabled",
9515
- name: "MastraNotEnabledError",
9516
- code: "MASTRA_NOT_ENABLED",
9517
- description: "Mastra must be enabled before managing profiles.",
9518
- template: ""
9519
- }, {
9520
- id: "e-remove-profile-not-found",
9521
- name: "ProfileNotFoundError",
9522
- code: "PROFILE_NOT_FOUND",
9523
- description: "The specified profile was not found.",
9737
+ id: "e-invalid-version-bump",
9738
+ name: "InvalidVersionError",
9739
+ code: "INVALID_VERSION",
9740
+ description: "The version must be a valid semver string.",
9524
9741
  template: ""
9525
9742
  }],
9526
9743
  examples: [],
9527
9744
  scope: "global"
9528
9745
  },
9529
9746
  {
9530
- id: "o-reorder-profiles",
9531
- name: "REORDER_PROFILES",
9532
- description: "Move one or more profiles before another profile, or to the end if insertBefore is null.",
9533
- schema: "input ReorderProfilesInput {\n ids: [String!]!\n insertBefore: String\n}",
9534
- template: "Move one or more profiles before another profile, or to the end if insertBefore is null.",
9535
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');\n}\nconst moving = [];\nfor (const id of action.input.ids) {\n const profile = state.features.mastra.profiles.find(p => p.id === id);\n if (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${id}`);\n }\n moving.push(profile);\n}\n// Remove moved profiles\nstate.features.mastra.profiles = state.features.mastra.profiles.filter(p => !action.input.ids.includes(p.id));\n// Insert at target position\nif (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);\n} else {\n state.features.mastra.profiles.push(...moving);\n}",
9536
- errors: [{
9537
- id: "e-reorder-profiles-not-enabled",
9538
- name: "MastraNotEnabledError",
9539
- code: "MASTRA_NOT_ENABLED",
9540
- description: "Mastra must be enabled before managing profiles.",
9541
- template: ""
9542
- }, {
9543
- id: "e-reorder-profiles-not-found",
9544
- name: "ProfileNotFoundError",
9545
- code: "PROFILE_NOT_FOUND",
9546
- description: "A referenced profile was not found.",
9547
- template: ""
9548
- }],
9549
- examples: [],
9747
+ id: "o-publish-dev",
9748
+ name: "PUBLISH_DEV",
9749
+ description: "Record a dev publish intent. Creates a Pending publish record.",
9750
+ schema: "input PublishDevInput {\n id: OID!\n timestamp: DateTime!\n}",
9751
+ template: "Record a dev publish intent. Creates a Pending publish record.",
9752
+ reducer: "state.publishHistory.push({\n id: action.input.id,\n tag: 'Dev',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n});",
9753
+ errors: [],
9754
+ examples: [],
9755
+ scope: "global"
9756
+ },
9757
+ {
9758
+ id: "o-publish-staging",
9759
+ name: "PUBLISH_STAGING",
9760
+ description: "Record a staging publish intent. Creates a Pending publish record.",
9761
+ schema: "input PublishStagingInput {\n id: OID!\n timestamp: DateTime!\n}",
9762
+ template: "Record a staging publish intent. Creates a Pending publish record.",
9763
+ reducer: "state.publishHistory.push({\n id: action.input.id,\n tag: 'Staging',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n});",
9764
+ errors: [],
9765
+ examples: [],
9766
+ scope: "global"
9767
+ },
9768
+ {
9769
+ id: "o-publish-production",
9770
+ name: "PUBLISH_PRODUCTION",
9771
+ description: "Record a production publish intent. Creates a Pending publish record.",
9772
+ schema: "input PublishProductionInput {\n id: OID!\n timestamp: DateTime!\n}",
9773
+ template: "Record a production publish intent. Creates a Pending publish record.",
9774
+ reducer: "state.publishHistory.push({\n id: action.input.id,\n tag: 'Production',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n});",
9775
+ errors: [],
9776
+ examples: [],
9550
9777
  scope: "global"
9551
9778
  },
9552
9779
  {
9553
- id: "o-set-agent-description",
9554
- name: "SET_AGENT_DESCRIPTION",
9555
- description: "Set the agent description. Only valid when mastra is enabled.",
9556
- schema: "input SetAgentDescriptionInput {\n description: String!\n}",
9557
- template: "Set the agent description. Only valid when mastra is enabled.",
9558
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent description when Mastra is disabled.');\n}\nstate.features.mastra.agentDescription = action.input.description;",
9780
+ id: "o-set-publish-status",
9781
+ name: "SET_PUBLISH_STATUS",
9782
+ description: "Update the status of a publish record. Used by the trigger after publish completes.",
9783
+ schema: "input SetPublishStatusInput {\n id: OID!\n status: PublishStatus!\n}",
9784
+ template: "Update the status of a publish record. Used by the trigger after publish completes.",
9785
+ reducer: "const record = state.publishHistory.find(r => r.id === action.input.id);\nif (!record) {\n throw new PublishRecordNotFoundError(`Publish record not found: ${action.input.id}`);\n}\nrecord.status = action.input.status;",
9559
9786
  errors: [{
9560
- id: "e-set-agent-desc-not-enabled",
9561
- name: "MastraNotEnabledError",
9562
- code: "MASTRA_NOT_ENABLED",
9563
- description: "Mastra must be enabled before setting agent description.",
9787
+ id: "e-publish-record-not-found",
9788
+ name: "PublishRecordNotFoundError",
9789
+ code: "PUBLISH_RECORD_NOT_FOUND",
9790
+ description: "The specified publish record ID was not found.",
9564
9791
  template: ""
9565
9792
  }],
9566
9793
  examples: [],
9567
9794
  scope: "global"
9568
- },
9795
+ }
9796
+ ]
9797
+ },
9798
+ {
9799
+ id: "m-lifecycle",
9800
+ name: "lifecycle",
9801
+ description: "Document lifecycle operations. IMPORT_SPEC bulk-imports a full project spec into the document.",
9802
+ operations: [{
9803
+ id: "o-import-spec",
9804
+ name: "IMPORT_SPEC",
9805
+ 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.",
9806
+ schema: "input ImportSpecInput {\n name: String!\n scope: String\n version: String!\n description: String!\n powerhouse: PowerhouseLevel!\n mastraEnabled: Boolean!\n routineEnabled: Boolean!\n packages: [ImportPackageInput!]!\n externalSkills: [ImportSkillInput!]!\n mainAgent: ImportMainAgentInput\n subAgents: [ImportSubAgentInput!]!\n models: [ImportModelInput!]!\n profiles: [ImportProfileInput!]!\n enableChat: Boolean\n proxyEnabled: Boolean\n observabilityEnabled: Boolean\n supportedResources: [String!]\n}\n\ninput ImportPackageInput {\n id: OID!\n packageName: String!\n documentTypes: [String!]!\n version: String\n}\n\ninput ImportSkillInput {\n id: OID!\n name: String!\n githubUrl: URL!\n}\n\ninput ImportModelInput {\n id: OID!\n isDefault: Boolean!\n}\n\ninput ImportProfileInput {\n id: OID!\n title: String!\n content: String!\n}\n\ninput ImportMainAgentInput {\n id: OID!\n name: String!\n description: String\n image: String\n modelId: OID!\n profileIds: [OID!]!\n skills: [String!]!\n toolPatterns: [String!]!\n}\n\ninput ImportSubAgentInput {\n id: OID!\n name: String!\n description: String!\n modelId: OID!\n profileIds: [OID!]!\n skills: [String!]!\n toolPatterns: [String!]!\n}",
9807
+ 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.",
9808
+ reducer: "state.name = action.input.name;\nstate.scope = action.input.scope || null;\nstate.version = action.input.version;\nstate.description = action.input.description;\nstate.features.powerhouse = action.input.powerhouse;\nstate.features.mastra.enabled = action.input.mastraEnabled;\nstate.features.routine.enabled = action.input.routineEnabled;\n\nconst appBase = action.input.name.replace(/-cli$/, '-app');\nconst appPkgName = action.input.scope\n ? `${action.input.scope}/${appBase}`\n : appBase;\nconst phEnabled = action.input.powerhouse !== 'Disabled';\n\nstate.packages = action.input.packages.map((p) => ({\n id: p.id,\n packageName: p.packageName,\n documentTypes: [...p.documentTypes],\n version: p.version || null,\n managed: phEnabled && p.packageName === appPkgName,\n}));\nstate.externalSkills = action.input.externalSkills.map((s) => ({\n id: s.id,\n name: s.name,\n githubUrl: s.githubUrl,\n}));\n\nstate.features.mastra.models = action.input.models.map((m) => ({\n id: m.id,\n isDefault: m.isDefault,\n}));\nstate.features.mastra.profiles = action.input.profiles.map((p) => ({\n id: p.id,\n title: p.title,\n content: p.content,\n}));\n\nif (action.input.mainAgent && state.features.mastra.enabled) {\n const m = action.input.mainAgent;\n let image = null;\n if (m.image) {\n if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(m.image)) {\n throw new InvalidAgentImageError(\n 'Invalid image: must be a data URL (data:<mime>;base64,...)',\n );\n }\n image = m.image;\n }\n state.features.mastra.mainAgent = {\n id: m.id,\n name: m.name,\n description: m.description || null,\n image,\n modelId: m.modelId,\n profileIds: [...m.profileIds],\n skills: [...m.skills],\n toolPatterns: [...m.toolPatterns],\n };\n} else {\n state.features.mastra.mainAgent = null;\n}\n\nif (state.features.mastra.enabled) {\n state.features.mastra.subAgents = action.input.subAgents.map((s) => ({\n id: s.id,\n name: s.name,\n description: s.description,\n modelId: s.modelId,\n profileIds: [...s.profileIds],\n skills: [...s.skills],\n toolPatterns: [...s.toolPatterns],\n }));\n} else {\n state.features.mastra.subAgents = [];\n}\n\nif (\n action.input.enableChat &&\n state.features.mastra.enabled &&\n state.features.powerhouse !== 'Disabled'\n) {\n state.features.mastra.common.enableChat = true;\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\n const existing = state.packages.find(\n (p) => p.packageName === CLINT_COMMON_PKG,\n );\n if (!existing) {\n state.packages.push({\n id: 'pkg-clint-common',\n packageName: CLINT_COMMON_PKG,\n documentTypes: [CHAT_DOC_TYPE],\n version: null,\n managed: true,\n });\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\n existing.documentTypes.push(CHAT_DOC_TYPE);\n }\n} else {\n state.features.mastra.common.enableChat = false;\n}\n\nstate.deployment.proxyEnabled = action.input.proxyEnabled ?? false;\nstate.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;\nstate.deployment.supportedResources = action.input.supportedResources\n ? [...action.input.supportedResources]\n : [];",
9809
+ errors: [{
9810
+ id: "e-import-spec-invalid-image",
9811
+ name: "InvalidAgentImageError",
9812
+ code: "INVALID_AGENT_IMAGE",
9813
+ description: "Agent image must be a data URL",
9814
+ template: ""
9815
+ }],
9816
+ examples: [],
9817
+ scope: "global"
9818
+ }]
9819
+ },
9820
+ {
9821
+ id: "m-deployment",
9822
+ name: "deployment",
9823
+ description: "Deployment settings: service announcement toggle and supported resource tiers.",
9824
+ operations: [
9569
9825
  {
9570
- id: "o-set-agent-image",
9571
- name: "SET_AGENT_IMAGE",
9572
- description: "Set the agent image URL (avatar). Only valid when mastra is enabled.",
9573
- schema: "input SetAgentImageInput {\n image: String!\n}",
9574
- template: "Set the agent image URL (avatar). Only valid when mastra is enabled.",
9575
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError(\n 'Cannot set agent image when Mastra is disabled.',\n );\n}\nif (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.image)) {\n throw new InvalidAgentImageError(\n 'Agent image must be a data URL (data:image/...;base64,...)',\n );\n}\nstate.features.mastra.agentImage = action.input.image;",
9826
+ id: "o-add-supported-resource",
9827
+ name: "ADD_SUPPORTED_RESOURCE",
9828
+ description: "Add a supported resource tier. Guards against duplicates.",
9829
+ schema: "input AddSupportedResourceInput {\n resource: String!\n}",
9830
+ template: "Add a supported resource tier. Guards against duplicates.",
9831
+ reducer: "if (state.deployment.supportedResources.includes(action.input.resource)) {\n throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);\n}\nstate.deployment.supportedResources.push(action.input.resource);",
9576
9832
  errors: [{
9577
- id: "e-set-agent-image-not-enabled",
9578
- name: "MastraNotEnabledError",
9579
- code: "MASTRA_NOT_ENABLED",
9580
- description: "Mastra must be enabled before setting agent image.",
9833
+ id: "e-duplicate-resource",
9834
+ name: "DuplicateResourceError",
9835
+ code: "DUPLICATE_RESOURCE",
9836
+ description: "This resource is already in the supported resources list.",
9581
9837
  template: ""
9582
- }, {
9583
- id: "e-invalid-agent-image",
9584
- name: "InvalidAgentImageError",
9585
- code: "INVALID_AGENT_IMAGE",
9586
- description: "Agent image must be a data URL",
9838
+ }],
9839
+ examples: [],
9840
+ scope: "global"
9841
+ },
9842
+ {
9843
+ id: "o-remove-supported-resource",
9844
+ name: "REMOVE_SUPPORTED_RESOURCE",
9845
+ description: "Remove a supported resource tier.",
9846
+ schema: "input RemoveSupportedResourceInput {\n resource: String!\n}",
9847
+ template: "Remove a supported resource tier.",
9848
+ reducer: "const idx = state.deployment.supportedResources.indexOf(action.input.resource);\nif (idx === -1) {\n throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);\n}\nstate.deployment.supportedResources.splice(idx, 1);",
9849
+ errors: [{
9850
+ id: "e-resource-not-found",
9851
+ name: "ResourceNotFoundError",
9852
+ code: "RESOURCE_NOT_FOUND",
9853
+ description: "The specified resource was not found in the supported resources list.",
9587
9854
  template: ""
9588
9855
  }],
9589
9856
  examples: [],
9590
9857
  scope: "global"
9591
9858
  },
9592
9859
  {
9593
- id: "o-clear-agent-image",
9594
- name: "CLEAR_AGENT_IMAGE",
9595
- description: "",
9596
- schema: "input ClearAgentImageInput {\n _: Boolean\n}",
9597
- template: "",
9598
- reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError(\n 'Cannot clear agent image when Mastra is disabled.',\n );\n}\nstate.features.mastra.agentImage = null;",
9860
+ id: "o-set-proxy-enabled",
9861
+ name: "SET_PROXY_ENABLED",
9862
+ description: "Toggle the embedded reverse proxy.",
9863
+ schema: "input SetProxyEnabledInput {\n enabled: Boolean!\n}",
9864
+ template: "Toggle the embedded reverse proxy.",
9865
+ reducer: "state.deployment.proxyEnabled = action.input.enabled;",
9866
+ errors: [],
9867
+ examples: [],
9868
+ scope: "global"
9869
+ },
9870
+ {
9871
+ id: "o-set-observability-enabled",
9872
+ name: "SET_OBSERVABILITY_ENABLED",
9873
+ description: "Toggle the observability plugin (Sentry + OpenTelemetry).",
9874
+ schema: "input SetObservabilityEnabledInput {\n enabled: Boolean!\n}",
9875
+ template: "Toggle the observability plugin (Sentry + OpenTelemetry).",
9876
+ reducer: "state.deployment.observabilityEnabled = action.input.enabled;",
9877
+ errors: [],
9878
+ examples: [],
9879
+ scope: "global"
9880
+ }
9881
+ ]
9882
+ },
9883
+ {
9884
+ id: "m-features-mastra",
9885
+ name: "features_mastra",
9886
+ description: "Top-level Mastra feature toggles: enable/disable and chat integration.",
9887
+ operations: [
9888
+ {
9889
+ id: "o-enable-mastra",
9890
+ name: "ENABLE_MASTRA",
9891
+ description: "Enable Mastra. Seeds mainAgent with a default model (clint/demo-agent) and a base profile. Idempotent.",
9892
+ schema: "input EnableMastraInput {\n agentId: OID!\n agentName: String!\n}",
9893
+ template: "Enable the Mastra agent feature. Seeds mainAgent with the seeded model + profile.",
9894
+ reducer: "if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\n throw new InvalidAgentIdError(\n `Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`,\n );\n}\nconst trimmedName = action.input.agentName.trim();\nif (!trimmedName) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n}\nstate.features.mastra.enabled = true;\nif (state.features.mastra.models.length === 0) {\n state.features.mastra.models.push({ id: 'clint/demo-agent', isDefault: true });\n}\nif (state.features.mastra.profiles.length === 0) {\n state.features.mastra.profiles.push({ id: 'base', title: 'Base Profile', content: 'You are a helpful assistant.' });\n}\nconst existing = state.features.mastra.mainAgent;\nif (!existing) {\n state.features.mastra.mainAgent = {\n id: action.input.agentId,\n name: trimmedName,\n description: null,\n image: null,\n modelId: 'clint/demo-agent',\n profileIds: ['base'],\n skills: [],\n toolPatterns: [],\n };\n} else {\n existing.id = action.input.agentId;\n existing.name = trimmedName;\n}",
9599
9895
  errors: [{
9600
- id: "e-mastra-not-enabled-clear-img",
9601
- name: "MastraNotEnabledError",
9602
- code: "MASTRA_NOT_ENABLED",
9603
- description: "Mastra must be enabled",
9896
+ id: "e-enable-mastra-invalid-id",
9897
+ name: "InvalidAgentIdError",
9898
+ code: "INVALID_AGENT_ID",
9899
+ description: "The agent ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.",
9900
+ template: ""
9901
+ }, {
9902
+ id: "e-enable-mastra-invalid-name",
9903
+ name: "InvalidAgentNameError",
9904
+ code: "INVALID_AGENT_NAME",
9905
+ description: "The agent name must not be empty after trimming.",
9604
9906
  template: ""
9605
9907
  }],
9606
9908
  examples: [],
9607
9909
  scope: "global"
9608
9910
  },
9911
+ {
9912
+ id: "o-disable-mastra",
9913
+ name: "DISABLE_MASTRA",
9914
+ description: "Disable Mastra. Clears mainAgent, subAgents, models, profiles and the chat integration. Removes the auto-managed clint-common package.",
9915
+ schema: "input DisableMastraInput {\n _: Boolean\n}",
9916
+ template: "Disable the Mastra agent feature.",
9917
+ reducer: "state.features.mastra.enabled = false;\nstate.features.mastra.mainAgent = null;\nstate.features.mastra.subAgents = [];\nstate.features.mastra.models = [];\nstate.features.mastra.profiles = [];\nstate.features.mastra.common.enableChat = false;\nconst ccIdx = state.packages.findIndex(\n (p) => p.packageName === '@powerhousedao/clint-common' && p.managed,\n);\nif (ccIdx !== -1) {\n state.packages.splice(ccIdx, 1);\n}",
9918
+ errors: [],
9919
+ examples: [],
9920
+ scope: "global"
9921
+ },
9609
9922
  {
9610
9923
  id: "o-set-enable-chat",
9611
9924
  name: "SET_ENABLE_CHAT",
@@ -9632,80 +9945,37 @@ const documentModel = {
9632
9945
  ]
9633
9946
  },
9634
9947
  {
9635
- id: "m-features-routine",
9636
- name: "features_routine",
9637
- description: "Routine loop feature toggle.",
9638
- operations: [{
9639
- id: "o-enable-routine",
9640
- name: "ENABLE_ROUTINE",
9641
- description: "Enable the routine loop. Idempotent.",
9642
- schema: "input EnableRoutineInput {\n _: Boolean\n}",
9643
- template: "Enable the routine loop. Idempotent.",
9644
- reducer: "state.features.routine.enabled = true;",
9645
- errors: [],
9646
- examples: [],
9647
- scope: "global"
9648
- }, {
9649
- id: "o-disable-routine",
9650
- name: "DISABLE_ROUTINE",
9651
- description: "Disable the routine loop. Always allowed.",
9652
- schema: "input DisableRoutineInput {\n _: Boolean\n}",
9653
- template: "Disable the routine loop.",
9654
- reducer: "state.features.routine.enabled = false;",
9655
- errors: [],
9656
- examples: [],
9657
- scope: "global"
9658
- }]
9659
- },
9660
- {
9661
- id: "m-powerhouse-packages",
9662
- name: "powerhouse_packages",
9663
- description: "Manage reactor packages and their document types. The app package is auto-created when Powerhouse level goes above Disabled.",
9948
+ id: "m-mastra-models",
9949
+ name: "mastra_models",
9950
+ description: "Model library CRUD. Models are referenced by main and sub agents via modelId.",
9664
9951
  operations: [
9665
9952
  {
9666
- id: "o-add-powerhouse-package",
9667
- name: "ADD_POWERHOUSE_PACKAGE",
9668
- description: "Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.",
9669
- schema: "input AddPowerhousePackageInput {\n id: OID!\n packageName: String!\n}",
9670
- template: "Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.",
9671
- reducer: "const exists = state.packages.find(\n (p) =>\n p.id === action.input.id ||\n p.packageName === action.input.packageName,\n);\nif (exists) {\n throw new DuplicatePackageError(\n `Package already exists: ${action.input.packageName}`,\n );\n}\nstate.packages.push({\n id: action.input.id,\n packageName: action.input.packageName,\n documentTypes: [],\n version: null,\n managed: false,\n});",
9672
- errors: [{
9673
- id: "e-duplicate-package",
9674
- name: "DuplicatePackageError",
9675
- code: "DUPLICATE_PACKAGE",
9676
- description: "A package with the same ID or name already exists.",
9677
- template: ""
9678
- }],
9679
- examples: [],
9680
- scope: "global"
9681
- },
9682
- {
9683
- id: "o-remove-powerhouse-package",
9684
- name: "REMOVE_POWERHOUSE_PACKAGE",
9685
- description: "Remove a reactor package. Cannot remove the auto-managed app package.",
9686
- schema: "input RemovePowerhousePackageInput {\n id: OID!\n}",
9687
- template: "Remove a reactor package. Cannot remove the auto-managed app package.",
9688
- reducer: "const idx = state.packages.findIndex((p) => p.id === action.input.id);\nif (idx === -1) {\n throw new PackageNotFoundError(`Package not found: ${action.input.id}`);\n}\nconst pkg = state.packages[idx];\nif (pkg.managed) {\n throw new CannotRemoveManagedPackageError(\n \"Cannot remove a managed package\",\n );\n}\nstate.packages.splice(idx, 1);",
9953
+ id: "o-add-model",
9954
+ name: "ADD_MODEL",
9955
+ description: "Add a model to the library. ID must be provider/model-name format. First model is forced default. If isDefault is true, previous default is unset.",
9956
+ schema: "input AddModelInput {\n id: OID!\n isDefault: Boolean\n}",
9957
+ template: "Add a model to the library.",
9958
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');\n}\nif (!/^[a-z0-9-]+\\/[a-z0-9._-]+$/.test(action.input.id)) {\n throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);\n}\nif (state.features.mastra.models.find(m => m.id === action.input.id)) {\n throw new DuplicateModelError(`Model already exists: ${action.input.id}`);\n}\nconst isFirst = state.features.mastra.models.length === 0;\nconst makeDefault = isFirst || action.input.isDefault === true;\nif (makeDefault) {\n for (const m of state.features.mastra.models) {\n m.isDefault = false;\n }\n}\nstate.features.mastra.models.push({\n id: action.input.id,\n isDefault: makeDefault,\n});",
9689
9959
  errors: [
9690
9960
  {
9691
- id: "e-package-not-found-remove",
9692
- name: "PackageNotFoundError",
9693
- code: "PACKAGE_NOT_FOUND",
9694
- description: "The specified package ID was not found.",
9961
+ id: "e-add-model-not-enabled",
9962
+ name: "MastraNotEnabledError",
9963
+ code: "MASTRA_NOT_ENABLED",
9964
+ description: "Mastra must be enabled before managing models.",
9695
9965
  template: ""
9696
9966
  },
9697
9967
  {
9698
- id: "e-cannot-remove-app-package",
9699
- name: "CannotRemoveAppPackageError",
9700
- code: "CANNOT_REMOVE_APP_PACKAGE",
9701
- description: "The auto-managed app package cannot be removed.",
9968
+ id: "e-add-model-invalid-id",
9969
+ name: "InvalidModelIdError",
9970
+ code: "INVALID_MODEL_ID",
9971
+ description: "Model ID must match provider/model-name format.",
9702
9972
  template: ""
9703
9973
  },
9704
9974
  {
9705
- id: "e-cannot-remove-managed",
9706
- name: "CannotRemoveManagedPackageError",
9707
- code: "CANNOT_REMOVE_MANAGED_PACKAGE",
9708
- description: "Cannot remove a managed (framework-controlled) package",
9975
+ id: "e-add-model-duplicate",
9976
+ name: "DuplicateModelError",
9977
+ code: "DUPLICATE_MODEL",
9978
+ description: "A model with this ID already exists.",
9709
9979
  template: ""
9710
9980
  }
9711
9981
  ],
@@ -9713,32 +9983,32 @@ const documentModel = {
9713
9983
  scope: "global"
9714
9984
  },
9715
9985
  {
9716
- id: "o-add-package-document-type",
9717
- name: "ADD_PACKAGE_DOCUMENT_TYPE",
9718
- description: "Add a document type ID to a package (app or external).",
9719
- schema: "input AddPackageDocumentTypeInput {\n packageId: OID!\n documentType: String!\n}",
9720
- template: "Add a document type ID to a package (app or external).",
9721
- reducer: "if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\/[a-z0-9-]+$/.test(action.input.documentType)) {\n throw new InvalidDocumentTypeError(\n `Invalid document type format: ${action.input.documentType}. Expected org/name.`,\n );\n}\nconst pkg = state.packages.find((p) => p.id === action.input.packageId);\nif (!pkg) {\n throw new PackageNotFoundError(\n `Package not found: ${action.input.packageId}`,\n );\n}\nif (action.input.documentType === '*/*') {\n pkg.documentTypes.length = 0;\n pkg.documentTypes.push('*/*');\n return;\n}\nif (pkg.documentTypes.includes('*/*')) {\n return;\n}\nif (pkg.documentTypes.includes(action.input.documentType)) {\n throw new DuplicateDocumentTypeError(\n `Document type already registered: ${action.input.documentType}`,\n );\n}\npkg.documentTypes.push(action.input.documentType);",
9986
+ id: "o-remove-model",
9987
+ name: "REMOVE_MODEL",
9988
+ description: "Remove a model from the library. Rejects when any agent (main or sub) references it. Promotes first remaining to default if removing the current default.",
9989
+ schema: "input RemoveModelInput {\n id: OID!\n}",
9990
+ template: "Remove a model from the library.",
9991
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');\n}\nconst idx = state.features.mastra.models.findIndex((m) => m.id === action.input.id);\nif (idx === -1) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n}\nconst main = state.features.mastra.mainAgent;\nconst usedByMain = !!main && main.modelId === action.input.id;\nconst usedBySub = state.features.mastra.subAgents.some(\n (s) => s.modelId === action.input.id,\n);\nif (usedByMain || usedBySub) {\n throw new ModelInUseError(\n `Model ${action.input.id} is in use by an agent.`,\n );\n}\nconst wasDefault = state.features.mastra.models[idx].isDefault;\nstate.features.mastra.models.splice(idx, 1);\nif (wasDefault && state.features.mastra.models.length > 0) {\n state.features.mastra.models[0].isDefault = true;\n}",
9722
9992
  errors: [
9723
9993
  {
9724
- id: "e-invalid-document-type",
9725
- name: "InvalidDocumentTypeError",
9726
- code: "INVALID_DOCUMENT_TYPE",
9727
- description: "Document type must match org/name format (e.g. powerhouse/ph-clint-project).",
9994
+ id: "e-remove-model-not-enabled",
9995
+ name: "MastraNotEnabledError",
9996
+ code: "MASTRA_NOT_ENABLED",
9997
+ description: "Mastra must be enabled before managing models.",
9728
9998
  template: ""
9729
9999
  },
9730
10000
  {
9731
- id: "e-package-not-found-add-dt",
9732
- name: "PackageNotFoundError",
9733
- code: "PACKAGE_NOT_FOUND",
9734
- description: "The specified package ID was not found.",
10001
+ id: "e-remove-model-not-found",
10002
+ name: "ModelNotFoundError",
10003
+ code: "MODEL_NOT_FOUND",
10004
+ description: "The specified model was not found.",
9735
10005
  template: ""
9736
10006
  },
9737
10007
  {
9738
- id: "e-duplicate-document-type",
9739
- name: "DuplicateDocumentTypeError",
9740
- code: "DUPLICATE_DOCUMENT_TYPE",
9741
- description: "This document type is already registered in the package.",
10008
+ id: "e-remove-model-in-use",
10009
+ name: "ModelInUseError",
10010
+ code: "MODEL_IN_USE",
10011
+ description: "Cannot remove a model that is still referenced by an agent.",
9742
10012
  template: ""
9743
10013
  }
9744
10014
  ],
@@ -9746,46 +10016,23 @@ const documentModel = {
9746
10016
  scope: "global"
9747
10017
  },
9748
10018
  {
9749
- id: "o-remove-package-document-type",
9750
- name: "REMOVE_PACKAGE_DOCUMENT_TYPE",
9751
- description: "Remove a document type ID from a package.",
9752
- schema: "input RemovePackageDocumentTypeInput {\n packageId: OID!\n documentType: String!\n}",
9753
- template: "Remove a document type ID from a package.",
9754
- reducer: "const pkg = state.packages.find(p => p.id === action.input.packageId);\nif (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n}\nconst idx = pkg.documentTypes.indexOf(action.input.documentType);\nif (idx === -1) {\n throw new DocumentTypeNotFoundError(`Document type not found: ${action.input.documentType}`);\n}\npkg.documentTypes.splice(idx, 1);",
9755
- errors: [{
9756
- id: "e-package-not-found-rm-dt",
9757
- name: "PackageNotFoundError",
9758
- code: "PACKAGE_NOT_FOUND",
9759
- description: "The specified package ID was not found.",
9760
- template: ""
9761
- }, {
9762
- id: "e-document-type-not-found",
9763
- name: "DocumentTypeNotFoundError",
9764
- code: "DOCUMENT_TYPE_NOT_FOUND",
9765
- description: "The specified document type was not found in this package.",
9766
- template: ""
9767
- }],
9768
- examples: [],
9769
- scope: "global"
9770
- },
9771
- {
9772
- id: "o-set-package-version",
9773
- name: "SET_PACKAGE_VERSION",
9774
- description: "",
9775
- schema: "input SetPackageVersionInput {\n packageId: OID!\n version: String\n}",
9776
- template: "",
9777
- reducer: "const pkg = state.packages.find((p) => p.id === action.input.packageId);\nif (!pkg) {\n throw new PackageNotFoundError(\n `Package not found: ${action.input.packageId}`,\n );\n}\nif (action.input.version != null) {\n const SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\n if (!SEMVER.test(action.input.version)) {\n throw new InvalidVersionError(\n `Invalid version: ${action.input.version}`,\n );\n }\n}\npkg.version = action.input.version || null;",
10019
+ id: "o-set-default-model",
10020
+ name: "SET_DEFAULT_MODEL",
10021
+ description: "Set a model as the default. Unsets the previous default.",
10022
+ schema: "input SetDefaultModelInput {\n id: OID!\n}",
10023
+ template: "Set a model as the default.",
10024
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set default model when Mastra is disabled.');\n}\nconst model = state.features.mastra.models.find(m => m.id === action.input.id);\nif (!model) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n}\nfor (const m of state.features.mastra.models) {\n m.isDefault = false;\n}\nmodel.isDefault = true;",
9778
10025
  errors: [{
9779
- id: "e-pkg-not-found-set-ver",
9780
- name: "PackageNotFoundError",
9781
- code: "PACKAGE_NOT_FOUND",
9782
- description: "Referenced package does not exist",
10026
+ id: "e-set-default-model-not-enabled",
10027
+ name: "MastraNotEnabledError",
10028
+ code: "MASTRA_NOT_ENABLED",
10029
+ description: "Mastra must be enabled before managing models.",
9783
10030
  template: ""
9784
10031
  }, {
9785
- id: "e-invalid-version",
9786
- name: "InvalidVersionError",
9787
- code: "INVALID_VERSION",
9788
- description: "Version string is not valid semver",
10032
+ id: "e-set-default-model-not-found",
10033
+ name: "ModelNotFoundError",
10034
+ code: "MODEL_NOT_FOUND",
10035
+ description: "The specified model was not found.",
9789
10036
  template: ""
9790
10037
  }],
9791
10038
  examples: [],
@@ -9794,77 +10041,100 @@ const documentModel = {
9794
10041
  ]
9795
10042
  },
9796
10043
  {
9797
- id: "m-external-skills",
9798
- name: "external_skills",
9799
- description: "External skills from the skills.sh ecosystem. Each skill has a name and GitHub URL for installation.",
10044
+ id: "m-mastra-profiles",
10045
+ name: "mastra_profiles",
10046
+ description: "Profile library CRUD. Profiles are referenced by main and sub agents via profileIds.",
9800
10047
  operations: [
9801
10048
  {
9802
- id: "o-add-external-skill",
9803
- name: "ADD_EXTERNAL_SKILL",
9804
- description: "Add an external skill. Name must be lowercase kebab-case.",
9805
- schema: "input AddExternalSkillInput {\n id: OID!\n name: String!\n githubUrl: URL!\n}",
9806
- template: "Add an external skill. Name must be lowercase kebab-case.",
9807
- reducer: "if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n}\nconst exists = state.externalSkills.find(s => s.id === action.input.id || s.name === action.input.name);\nif (exists) {\n throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);\n}\nstate.externalSkills.push({\n id: action.input.id,\n name: action.input.name,\n githubUrl: action.input.githubUrl,\n});",
9808
- errors: [{
9809
- id: "e-invalid-skill-name",
9810
- name: "InvalidSkillNameError",
9811
- code: "INVALID_SKILL_NAME",
9812
- description: "Skill name must be lowercase kebab-case (e.g. playwright-cli).",
9813
- template: ""
9814
- }, {
9815
- id: "e-duplicate-skill",
9816
- name: "DuplicateSkillError",
9817
- code: "DUPLICATE_SKILL",
9818
- description: "A skill with the same ID or name already exists.",
9819
- template: ""
9820
- }],
10049
+ id: "o-add-profile",
10050
+ name: "ADD_PROFILE",
10051
+ description: "Add a profile to the library. Inserted before insertBefore if provided, otherwise appended.",
10052
+ schema: "input AddProfileInput {\n id: OID!\n title: String!\n content: String!\n insertBefore: OID\n}",
10053
+ template: "Add a profile to the library.",
10054
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');\n}\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\n throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);\n}\nif (state.features.mastra.profiles.find(p => p.id === action.input.id)) {\n throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);\n}\nconst profile = {\n id: action.input.id,\n title: action.input.title,\n content: action.input.content,\n};\nif (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, profile);\n} else {\n state.features.mastra.profiles.push(profile);\n}",
10055
+ errors: [
10056
+ {
10057
+ id: "e-add-profile-not-enabled",
10058
+ name: "MastraNotEnabledError",
10059
+ code: "MASTRA_NOT_ENABLED",
10060
+ description: "Mastra must be enabled before managing profiles.",
10061
+ template: ""
10062
+ },
10063
+ {
10064
+ id: "e-add-profile-invalid-id",
10065
+ name: "InvalidProfileIdError",
10066
+ code: "INVALID_PROFILE_ID",
10067
+ description: "Profile ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.",
10068
+ template: ""
10069
+ },
10070
+ {
10071
+ id: "e-add-profile-duplicate",
10072
+ name: "DuplicateProfileError",
10073
+ code: "DUPLICATE_PROFILE",
10074
+ description: "A profile with this ID already exists.",
10075
+ template: ""
10076
+ },
10077
+ {
10078
+ id: "e-add-profile-not-found",
10079
+ name: "ProfileNotFoundError",
10080
+ code: "PROFILE_NOT_FOUND",
10081
+ description: "The insertBefore profile was not found.",
10082
+ template: ""
10083
+ }
10084
+ ],
9821
10085
  examples: [],
9822
10086
  scope: "global"
9823
10087
  },
9824
10088
  {
9825
- id: "o-remove-external-skill",
9826
- name: "REMOVE_EXTERNAL_SKILL",
9827
- description: "Remove an external skill by ID.",
9828
- schema: "input RemoveExternalSkillInput {\n id: OID!\n}",
9829
- template: "Remove an external skill by ID.",
9830
- reducer: "const idx = state.externalSkills.findIndex(s => s.id === action.input.id);\nif (idx === -1) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n}\nstate.externalSkills.splice(idx, 1);",
10089
+ id: "o-update-profile",
10090
+ name: "UPDATE_PROFILE",
10091
+ description: "Update an existing profile's title and/or content. Only updates provided fields.",
10092
+ schema: "input UpdateProfileInput {\n id: OID!\n title: String\n content: String\n}",
10093
+ template: "Update an existing profile.",
10094
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');\n}\nconst profile = state.features.mastra.profiles.find(p => p.id === action.input.id);\nif (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n}\nif (action.input.title) profile.title = action.input.title;\nif (action.input.content) profile.content = action.input.content;",
9831
10095
  errors: [{
9832
- id: "e-skill-not-found-remove",
9833
- name: "SkillNotFoundError",
9834
- code: "SKILL_NOT_FOUND",
9835
- description: "The specified skill ID was not found.",
10096
+ id: "e-update-profile-not-enabled",
10097
+ name: "MastraNotEnabledError",
10098
+ code: "MASTRA_NOT_ENABLED",
10099
+ description: "Mastra must be enabled before managing profiles.",
10100
+ template: ""
10101
+ }, {
10102
+ id: "e-update-profile-not-found",
10103
+ name: "ProfileNotFoundError",
10104
+ code: "PROFILE_NOT_FOUND",
10105
+ description: "The specified profile was not found.",
9836
10106
  template: ""
9837
10107
  }],
9838
10108
  examples: [],
9839
10109
  scope: "global"
9840
10110
  },
9841
10111
  {
9842
- id: "o-set-external-skill-name",
9843
- name: "SET_EXTERNAL_SKILL_NAME",
9844
- description: "Update the name of an external skill.",
9845
- schema: "input SetExternalSkillNameInput {\n id: OID!\n name: String!\n}",
9846
- template: "Update the name of an external skill.",
9847
- reducer: "const skill = state.externalSkills.find(s => s.id === action.input.id);\nif (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n}\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n}\nconst duplicate = state.externalSkills.find(s => s.name === action.input.name && s.id !== action.input.id);\nif (duplicate) {\n throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);\n}\nskill.name = action.input.name;",
10112
+ id: "o-remove-profile",
10113
+ name: "REMOVE_PROFILE",
10114
+ description: "Remove a profile from the library. Rejects when any agent (main or sub) references it.",
10115
+ schema: "input RemoveProfileInput {\n id: OID!\n}",
10116
+ template: "Remove a profile from the library.",
10117
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');\n}\nconst idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);\nif (idx === -1) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n}\nconst main = state.features.mastra.mainAgent;\nconst usedByMain = !!main && main.profileIds.includes(action.input.id);\nconst usedBySub = state.features.mastra.subAgents.some(\n (s) => s.profileIds.includes(action.input.id),\n);\nif (usedByMain || usedBySub) {\n throw new ProfileInUseError(\n `Profile ${action.input.id} is in use by an agent.`,\n );\n}\nstate.features.mastra.profiles.splice(idx, 1);",
9848
10118
  errors: [
9849
10119
  {
9850
- id: "e-skill-not-found-set-name",
9851
- name: "SkillNotFoundError",
9852
- code: "SKILL_NOT_FOUND",
9853
- description: "The specified skill ID was not found.",
10120
+ id: "e-remove-profile-not-enabled",
10121
+ name: "MastraNotEnabledError",
10122
+ code: "MASTRA_NOT_ENABLED",
10123
+ description: "Mastra must be enabled before managing profiles.",
9854
10124
  template: ""
9855
10125
  },
9856
10126
  {
9857
- id: "e-invalid-skill-name-set",
9858
- name: "InvalidSkillNameError",
9859
- code: "INVALID_SKILL_NAME",
9860
- description: "Skill name must be lowercase kebab-case.",
10127
+ id: "e-remove-profile-not-found",
10128
+ name: "ProfileNotFoundError",
10129
+ code: "PROFILE_NOT_FOUND",
10130
+ description: "The specified profile was not found.",
9861
10131
  template: ""
9862
10132
  },
9863
10133
  {
9864
- id: "e-duplicate-skill-set-name",
9865
- name: "DuplicateSkillError",
9866
- code: "DUPLICATE_SKILL",
9867
- description: "Another skill already uses this name.",
10134
+ id: "e-remove-profile-in-use",
10135
+ name: "ProfileInUseError",
10136
+ code: "PROFILE_IN_USE",
10137
+ description: "Cannot remove a profile that is still referenced by an agent.",
9868
10138
  template: ""
9869
10139
  }
9870
10140
  ],
@@ -9872,17 +10142,23 @@ const documentModel = {
9872
10142
  scope: "global"
9873
10143
  },
9874
10144
  {
9875
- id: "o-set-external-skill-github-url",
9876
- name: "SET_EXTERNAL_SKILL_GITHUB_URL",
9877
- description: "Update the GitHub URL of an external skill.",
9878
- schema: "input SetExternalSkillGithubUrlInput {\n id: OID!\n githubUrl: URL!\n}",
9879
- template: "Update the GitHub URL of an external skill.",
9880
- reducer: "const skill = state.externalSkills.find(s => s.id === action.input.id);\nif (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n}\nskill.githubUrl = action.input.githubUrl;",
10145
+ id: "o-reorder-profiles",
10146
+ name: "REORDER_PROFILES",
10147
+ description: "Move one or more profiles before another profile, or to the end if insertBefore is null.",
10148
+ schema: "input ReorderProfilesInput {\n ids: [OID!]!\n insertBefore: OID\n}",
10149
+ template: "Reorder profiles.",
10150
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');\n}\nconst moving = [];\nfor (const id of action.input.ids) {\n const profile = state.features.mastra.profiles.find(p => p.id === id);\n if (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${id}`);\n }\n moving.push(profile);\n}\nstate.features.mastra.profiles = state.features.mastra.profiles.filter(p => !action.input.ids.includes(p.id));\nif (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);\n} else {\n state.features.mastra.profiles.push(...moving);\n}",
9881
10151
  errors: [{
9882
- id: "e-skill-not-found-set-url",
9883
- name: "SkillNotFoundError",
9884
- code: "SKILL_NOT_FOUND",
9885
- description: "The specified skill ID was not found.",
10152
+ id: "e-reorder-profiles-not-enabled",
10153
+ name: "MastraNotEnabledError",
10154
+ code: "MASTRA_NOT_ENABLED",
10155
+ description: "Mastra must be enabled before managing profiles.",
10156
+ template: ""
10157
+ }, {
10158
+ id: "e-reorder-profiles-not-found",
10159
+ name: "ProfileNotFoundError",
10160
+ code: "PROFILE_NOT_FOUND",
10161
+ description: "A referenced profile was not found.",
9886
10162
  template: ""
9887
10163
  }],
9888
10164
  examples: [],
@@ -9891,72 +10167,102 @@ const documentModel = {
9891
10167
  ]
9892
10168
  },
9893
10169
  {
9894
- id: "m-publishing",
9895
- name: "publishing",
9896
- description: "Version bumping and publish records. Tracks dev/staging/production publish intents and their status.",
10170
+ id: "m-mastra-main-agent",
10171
+ name: "mastra_main_agent",
10172
+ description: "Main agent identity ops. Main agent ID is set at ENABLE_MASTRA and stable thereafter — to change it, disable then re-enable.",
9897
10173
  operations: [
9898
10174
  {
9899
- id: "o-bump-version",
9900
- name: "BUMP_VERSION",
9901
- description: "Bump the project version. Must be a valid semver string greater than the current version.",
9902
- schema: "input BumpVersionInput {\n version: String!\n}",
9903
- template: "Bump the project version. Must be a valid semver string greater than the current version.",
9904
- reducer: "if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n}\nstate.version = action.input.version;",
10175
+ id: "o-set-main-agent-name",
10176
+ name: "SET_MAIN_AGENT_NAME",
10177
+ description: "Set the main agent's display name. Must be non-empty after trim.",
10178
+ schema: "input SetMainAgentNameInput {\n name: String!\n}",
10179
+ template: "Set the main agent's display name.",
10180
+ reducer: "const main = state.features.mastra.mainAgent;\nif (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError(\n 'Cannot set main agent name when Mastra is disabled.',\n );\n}\nconst trimmed = action.input.name.trim();\nif (!trimmed) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n}\nmain.name = trimmed;",
9905
10181
  errors: [{
9906
- id: "e-invalid-version-bump",
9907
- name: "InvalidVersionError",
9908
- code: "INVALID_VERSION",
9909
- description: "The version must be a valid semver string.",
10182
+ id: "e-set-main-name-not-enabled",
10183
+ name: "MastraNotEnabledError",
10184
+ code: "MASTRA_NOT_ENABLED",
10185
+ description: "Mastra must be enabled before managing the main agent.",
10186
+ template: ""
10187
+ }, {
10188
+ id: "e-set-main-name-invalid",
10189
+ name: "InvalidAgentNameError",
10190
+ code: "INVALID_AGENT_NAME",
10191
+ description: "The agent name must not be empty after trimming.",
9910
10192
  template: ""
9911
10193
  }],
9912
10194
  examples: [],
9913
10195
  scope: "global"
9914
10196
  },
9915
10197
  {
9916
- id: "o-publish-dev",
9917
- name: "PUBLISH_DEV",
9918
- description: "Record a dev publish intent. Creates a Pending publish record.",
9919
- schema: "input PublishDevInput {\n id: OID!\n timestamp: DateTime!\n}",
9920
- template: "Record a dev publish intent. Creates a Pending publish record.",
9921
- reducer: "state.publishHistory.push({\n id: action.input.id,\n tag: 'Dev',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n});",
9922
- errors: [],
10198
+ id: "o-set-main-agent-description",
10199
+ name: "SET_MAIN_AGENT_DESCRIPTION",
10200
+ description: "Set the main agent's description.",
10201
+ schema: "input SetMainAgentDescriptionInput {\n description: String!\n}",
10202
+ template: "Set the main agent's description.",
10203
+ reducer: "const main = state.features.mastra.mainAgent;\nif (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError(\n 'Cannot set main agent description when Mastra is disabled.',\n );\n}\nmain.description = action.input.description;",
10204
+ errors: [{
10205
+ id: "e-set-main-desc-not-enabled",
10206
+ name: "MastraNotEnabledError",
10207
+ code: "MASTRA_NOT_ENABLED",
10208
+ description: "Mastra must be enabled before managing the main agent.",
10209
+ template: ""
10210
+ }],
9923
10211
  examples: [],
9924
10212
  scope: "global"
9925
10213
  },
9926
10214
  {
9927
- id: "o-publish-staging",
9928
- name: "PUBLISH_STAGING",
9929
- description: "Record a staging publish intent. Creates a Pending publish record.",
9930
- schema: "input PublishStagingInput {\n id: OID!\n timestamp: DateTime!\n}",
9931
- template: "Record a staging publish intent. Creates a Pending publish record.",
9932
- reducer: "state.publishHistory.push({\n id: action.input.id,\n tag: 'Staging',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n});",
9933
- errors: [],
10215
+ id: "o-clear-main-agent-description",
10216
+ name: "CLEAR_MAIN_AGENT_DESCRIPTION",
10217
+ description: "Clear the main agent's description.",
10218
+ schema: "input ClearMainAgentDescriptionInput {\n _: Boolean\n}",
10219
+ template: "Clear the main agent's description.",
10220
+ reducer: "const main = state.features.mastra.mainAgent;\nif (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError(\n 'Cannot clear main agent description when Mastra is disabled.',\n );\n}\nmain.description = null;",
10221
+ errors: [{
10222
+ id: "e-clear-main-desc-not-enabled",
10223
+ name: "MastraNotEnabledError",
10224
+ code: "MASTRA_NOT_ENABLED",
10225
+ description: "Mastra must be enabled before managing the main agent.",
10226
+ template: ""
10227
+ }],
9934
10228
  examples: [],
9935
10229
  scope: "global"
9936
10230
  },
9937
10231
  {
9938
- id: "o-publish-production",
9939
- name: "PUBLISH_PRODUCTION",
9940
- description: "Record a production publish intent. Creates a Pending publish record.",
9941
- schema: "input PublishProductionInput {\n id: OID!\n timestamp: DateTime!\n}",
9942
- template: "Record a production publish intent. Creates a Pending publish record.",
9943
- reducer: "state.publishHistory.push({\n id: action.input.id,\n tag: 'Production',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n});",
9944
- errors: [],
10232
+ id: "o-set-main-agent-image",
10233
+ name: "SET_MAIN_AGENT_IMAGE",
10234
+ description: "Set the main agent's avatar image. Must be a data URL.",
10235
+ schema: "input SetMainAgentImageInput {\n image: String!\n}",
10236
+ template: "Set the main agent's avatar.",
10237
+ reducer: "const main = state.features.mastra.mainAgent;\nif (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError(\n 'Cannot set main agent image when Mastra is disabled.',\n );\n}\nif (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.image)) {\n throw new InvalidAgentImageError(\n 'Agent image must be a data URL (data:image/...;base64,...)',\n );\n}\nmain.image = action.input.image;",
10238
+ errors: [{
10239
+ id: "e-set-main-image-not-enabled",
10240
+ name: "MastraNotEnabledError",
10241
+ code: "MASTRA_NOT_ENABLED",
10242
+ description: "Mastra must be enabled before managing the main agent.",
10243
+ template: ""
10244
+ }, {
10245
+ id: "e-set-main-image-invalid",
10246
+ name: "InvalidAgentImageError",
10247
+ code: "INVALID_AGENT_IMAGE",
10248
+ description: "Agent image must be a data URL",
10249
+ template: ""
10250
+ }],
9945
10251
  examples: [],
9946
10252
  scope: "global"
9947
10253
  },
9948
10254
  {
9949
- id: "o-set-publish-status",
9950
- name: "SET_PUBLISH_STATUS",
9951
- description: "Update the status of a publish record. Used by the trigger after publish completes.",
9952
- schema: "input SetPublishStatusInput {\n id: OID!\n status: PublishStatus!\n}",
9953
- template: "Update the status of a publish record. Used by the trigger after publish completes.",
9954
- reducer: "const record = state.publishHistory.find(r => r.id === action.input.id);\nif (!record) {\n throw new PublishRecordNotFoundError(`Publish record not found: ${action.input.id}`);\n}\nrecord.status = action.input.status;",
10255
+ id: "o-clear-main-agent-image",
10256
+ name: "CLEAR_MAIN_AGENT_IMAGE",
10257
+ description: "Clear the main agent's avatar.",
10258
+ schema: "input ClearMainAgentImageInput {\n _: Boolean\n}",
10259
+ template: "Clear the main agent's avatar.",
10260
+ reducer: "const main = state.features.mastra.mainAgent;\nif (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError(\n 'Cannot clear main agent image when Mastra is disabled.',\n );\n}\nmain.image = null;",
9955
10261
  errors: [{
9956
- id: "e-publish-record-not-found",
9957
- name: "PublishRecordNotFoundError",
9958
- code: "PUBLISH_RECORD_NOT_FOUND",
9959
- description: "The specified publish record ID was not found.",
10262
+ id: "e-clear-main-image-not-enabled",
10263
+ name: "MastraNotEnabledError",
10264
+ code: "MASTRA_NOT_ENABLED",
10265
+ description: "Mastra must be enabled before managing the main agent.",
9960
10266
  template: ""
9961
10267
  }],
9962
10268
  examples: [],
@@ -9965,79 +10271,404 @@ const documentModel = {
9965
10271
  ]
9966
10272
  },
9967
10273
  {
9968
- id: "m-lifecycle",
9969
- name: "lifecycle",
9970
- description: "Document lifecycle operations. IMPORT_SPEC bulk-imports a full project spec into the document.",
9971
- operations: [{
9972
- id: "o-import-spec",
9973
- name: "IMPORT_SPEC",
9974
- 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.",
9975
- schema: "input ImportSpecInput {\n name: String!\n scope: String\n version: String!\n description: String!\n powerhouse: PowerhouseLevel!\n mastraEnabled: Boolean!\n routineEnabled: Boolean!\n packages: [ImportPackageInput!]!\n externalSkills: [ImportSkillInput!]!\n agentId: String\n agentName: String\n models: [ImportModelInput!]\n profiles: [ImportProfileInput!]\n agentDescription: String\n agentImage: String\n enableChat: Boolean\n proxyEnabled: Boolean\n observabilityEnabled: Boolean\n supportedResources: [String!]\n}\n\ninput ImportPackageInput {\n id: OID!\n packageName: String!\n documentTypes: [String!]!\n version: String\n}\n\ninput ImportSkillInput {\n id: OID!\n name: String!\n githubUrl: URL!\n}\n\ninput ImportModelInput {\n id: String!\n isDefault: Boolean!\n}\n\ninput ImportProfileInput {\n id: String!\n title: String!\n content: String!\n}",
9976
- 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.",
9977
- reducer: "state.name = action.input.name;\nstate.scope = action.input.scope || null;\nstate.version = action.input.version;\nstate.description = action.input.description;\nstate.features.powerhouse = action.input.powerhouse;\nstate.features.mastra.enabled = action.input.mastraEnabled;\nstate.features.routine.enabled = action.input.routineEnabled;\n\n// Derive the expected managed app package name\nconst appBase = action.input.name.replace(/-cli$/, '-app');\nconst appPkgName = action.input.scope\n ? `${action.input.scope}/${appBase}`\n : appBase;\nconst phEnabled = action.input.powerhouse !== 'Disabled';\n\nstate.packages = action.input.packages.map((p) => ({\n id: p.id,\n packageName: p.packageName,\n documentTypes: [...p.documentTypes],\n version: p.version || null,\n managed: phEnabled && p.packageName === appPkgName,\n}));\nstate.externalSkills = action.input.externalSkills.map((s) => ({\n id: s.id,\n name: s.name,\n githubUrl: s.githubUrl,\n}));\nstate.features.mastra.agentId = action.input.agentId || null;\nstate.features.mastra.agentName = action.input.agentName || null;\nstate.features.mastra.models = (action.input.models || []).map((m) => ({\n id: m.id,\n isDefault: m.isDefault,\n}));\nstate.features.mastra.profiles = (action.input.profiles || []).map((p) => ({\n id: p.id,\n title: p.title,\n content: p.content,\n}));\n\n// agentDescription — respects mastra-enabled guard\nif (action.input.agentDescription && state.features.mastra.enabled) {\n state.features.mastra.agentDescription = action.input.agentDescription;\n} else {\n state.features.mastra.agentDescription = null;\n}\n\n// agentImage — validates data URL format (same logic as setAgentImageOperation)\nif (action.input.agentImage && state.features.mastra.enabled) {\n if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.agentImage)) {\n throw new InvalidAgentImageError(\n 'Invalid image: must be a data URL (data:<mime>;base64,...)',\n );\n }\n state.features.mastra.agentImage = action.input.agentImage;\n} else {\n state.features.mastra.agentImage = null;\n}\n\n// enableChat — respects mastra+powerhouse guards, manages clint-common package\nif (\n action.input.enableChat &&\n state.features.mastra.enabled &&\n state.features.powerhouse !== 'Disabled'\n) {\n state.features.mastra.common.enableChat = true;\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\n const existing = state.packages.find(\n (p) => p.packageName === CLINT_COMMON_PKG,\n );\n if (!existing) {\n state.packages.push({\n id: 'pkg-clint-common',\n packageName: CLINT_COMMON_PKG,\n documentTypes: [CHAT_DOC_TYPE],\n version: null,\n managed: true,\n });\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\n existing.documentTypes.push(CHAT_DOC_TYPE);\n }\n} else {\n state.features.mastra.common.enableChat = false;\n}\n\n// Deployment fields\nstate.deployment.proxyEnabled = action.input.proxyEnabled ?? false;\nstate.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;\nstate.deployment.supportedResources = action.input.supportedResources\n ? [...action.input.supportedResources]\n : [];",
9978
- errors: [],
9979
- examples: [],
9980
- scope: "global"
9981
- }]
9982
- },
9983
- {
9984
- id: "m-deployment",
9985
- name: "deployment",
9986
- description: "Deployment settings: service announcement toggle and supported resource tiers.",
10274
+ id: "m-mastra-sub-agents",
10275
+ name: "mastra_sub_agents",
10276
+ description: "Sub-agent CRUD. Sub-agent ids are unique across the main agent and all other sub-agents.",
9987
10277
  operations: [
9988
10278
  {
9989
- id: "o-add-supported-resource",
9990
- name: "ADD_SUPPORTED_RESOURCE",
9991
- description: "Add a supported resource tier. Guards against duplicates.",
9992
- schema: "input AddSupportedResourceInput {\n resource: String!\n}",
9993
- template: "Add a supported resource tier. Guards against duplicates.",
9994
- reducer: "if (state.deployment.supportedResources.includes(action.input.resource)) {\n throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);\n}\nstate.deployment.supportedResources.push(action.input.resource);",
10279
+ id: "o-add-sub-agent",
10280
+ name: "ADD_SUB_AGENT",
10281
+ description: "Add a sub-agent. ID must be lowercase kebab-case and unique (across main + sub agents). modelId must exist in the model library. Seeds empty profileIds/skills/toolPatterns.",
10282
+ schema: "input AddSubAgentInput {\n id: OID!\n name: String!\n description: String!\n modelId: OID!\n}",
10283
+ template: "Add a sub-agent.",
10284
+ reducer: "const main = state.features.mastra.mainAgent;\nif (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError(\n 'Cannot add sub-agent when Mastra is disabled.',\n );\n}\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\n throw new InvalidAgentIdError(\n `Invalid sub-agent ID: ${action.input.id}. Must be lowercase kebab-case.`,\n );\n}\nconst trimmedName = action.input.name.trim();\nif (!trimmedName) {\n throw new InvalidAgentNameError('Sub-agent name must not be empty.');\n}\nif (main.id === action.input.id) {\n throw new DuplicateAgentIdError(\n `Agent ID already taken by main agent: ${action.input.id}`,\n );\n}\nif (state.features.mastra.subAgents.find((s) => s.id === action.input.id)) {\n throw new DuplicateAgentIdError(\n `Sub-agent already exists: ${action.input.id}`,\n );\n}\nif (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {\n throw new ModelReferenceNotFoundError(\n `Model not in library: ${action.input.modelId}`,\n );\n}\nstate.features.mastra.subAgents.push({\n id: action.input.id,\n name: trimmedName,\n description: action.input.description,\n modelId: action.input.modelId,\n profileIds: [],\n skills: [],\n toolPatterns: [],\n});",
10285
+ errors: [
10286
+ {
10287
+ id: "e-add-sub-not-enabled",
10288
+ name: "MastraNotEnabledError",
10289
+ code: "MASTRA_NOT_ENABLED",
10290
+ description: "Mastra must be enabled before managing sub-agents.",
10291
+ template: ""
10292
+ },
10293
+ {
10294
+ id: "e-add-sub-invalid-id",
10295
+ name: "InvalidAgentIdError",
10296
+ code: "INVALID_AGENT_ID",
10297
+ description: "Sub-agent ID must be lowercase kebab-case.",
10298
+ template: ""
10299
+ },
10300
+ {
10301
+ id: "e-add-sub-invalid-name",
10302
+ name: "InvalidAgentNameError",
10303
+ code: "INVALID_AGENT_NAME",
10304
+ description: "Sub-agent name must not be empty after trimming.",
10305
+ template: ""
10306
+ },
10307
+ {
10308
+ id: "e-add-sub-duplicate",
10309
+ name: "DuplicateAgentIdError",
10310
+ code: "DUPLICATE_AGENT_ID",
10311
+ description: "An agent with this ID already exists (main or sub).",
10312
+ template: ""
10313
+ },
10314
+ {
10315
+ id: "e-add-sub-model-not-found",
10316
+ name: "ModelReferenceNotFoundError",
10317
+ code: "MODEL_REFERENCE_NOT_FOUND",
10318
+ description: "The referenced modelId does not exist in the model library.",
10319
+ template: ""
10320
+ }
10321
+ ],
10322
+ examples: [],
10323
+ scope: "global"
10324
+ },
10325
+ {
10326
+ id: "o-remove-sub-agent",
10327
+ name: "REMOVE_SUB_AGENT",
10328
+ description: "Remove a sub-agent.",
10329
+ schema: "input RemoveSubAgentInput {\n id: OID!\n}",
10330
+ template: "Remove a sub-agent.",
10331
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove sub-agent when Mastra is disabled.');\n}\nconst idx = state.features.mastra.subAgents.findIndex(s => s.id === action.input.id);\nif (idx === -1) {\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\n}\nstate.features.mastra.subAgents.splice(idx, 1);",
9995
10332
  errors: [{
9996
- id: "e-duplicate-resource",
9997
- name: "DuplicateResourceError",
9998
- code: "DUPLICATE_RESOURCE",
9999
- description: "This resource is already in the supported resources list.",
10333
+ id: "e-remove-sub-not-enabled",
10334
+ name: "MastraNotEnabledError",
10335
+ code: "MASTRA_NOT_ENABLED",
10336
+ description: "Mastra must be enabled before managing sub-agents.",
10337
+ template: ""
10338
+ }, {
10339
+ id: "e-remove-sub-not-found",
10340
+ name: "AgentNotFoundError",
10341
+ code: "AGENT_NOT_FOUND",
10342
+ description: "The specified sub-agent was not found.",
10000
10343
  template: ""
10001
10344
  }],
10002
10345
  examples: [],
10003
10346
  scope: "global"
10004
10347
  },
10005
10348
  {
10006
- id: "o-remove-supported-resource",
10007
- name: "REMOVE_SUPPORTED_RESOURCE",
10008
- description: "Remove a supported resource tier.",
10009
- schema: "input RemoveSupportedResourceInput {\n resource: String!\n}",
10010
- template: "Remove a supported resource tier.",
10011
- reducer: "const idx = state.deployment.supportedResources.indexOf(action.input.resource);\nif (idx === -1) {\n throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);\n}\nstate.deployment.supportedResources.splice(idx, 1);",
10349
+ id: "o-set-sub-agent-name",
10350
+ name: "SET_SUB_AGENT_NAME",
10351
+ description: "Set a sub-agent's display name.",
10352
+ schema: "input SetSubAgentNameInput {\n id: OID!\n name: String!\n}",
10353
+ template: "Set a sub-agent's display name.",
10354
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set sub-agent name when Mastra is disabled.');\n}\nconst sub = state.features.mastra.subAgents.find(s => s.id === action.input.id);\nif (!sub) {\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\n}\nconst trimmed = action.input.name.trim();\nif (!trimmed) {\n throw new InvalidAgentNameError('Sub-agent name must not be empty.');\n}\nsub.name = trimmed;",
10355
+ errors: [
10356
+ {
10357
+ id: "e-set-sub-name-not-enabled",
10358
+ name: "MastraNotEnabledError",
10359
+ code: "MASTRA_NOT_ENABLED",
10360
+ description: "Mastra must be enabled before managing sub-agents.",
10361
+ template: ""
10362
+ },
10363
+ {
10364
+ id: "e-set-sub-name-not-found",
10365
+ name: "AgentNotFoundError",
10366
+ code: "AGENT_NOT_FOUND",
10367
+ description: "The specified sub-agent was not found.",
10368
+ template: ""
10369
+ },
10370
+ {
10371
+ id: "e-set-sub-name-invalid",
10372
+ name: "InvalidAgentNameError",
10373
+ code: "INVALID_AGENT_NAME",
10374
+ description: "Sub-agent name must not be empty after trimming.",
10375
+ template: ""
10376
+ }
10377
+ ],
10378
+ examples: [],
10379
+ scope: "global"
10380
+ },
10381
+ {
10382
+ id: "o-set-sub-agent-description",
10383
+ name: "SET_SUB_AGENT_DESCRIPTION",
10384
+ description: "Set a sub-agent's description.",
10385
+ schema: "input SetSubAgentDescriptionInput {\n id: OID!\n description: String!\n}",
10386
+ template: "Set a sub-agent's description.",
10387
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set sub-agent description when Mastra is disabled.');\n}\nconst sub = state.features.mastra.subAgents.find(s => s.id === action.input.id);\nif (!sub) {\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\n}\nsub.description = action.input.description;",
10012
10388
  errors: [{
10013
- id: "e-resource-not-found",
10014
- name: "ResourceNotFoundError",
10015
- code: "RESOURCE_NOT_FOUND",
10016
- description: "The specified resource was not found in the supported resources list.",
10389
+ id: "e-set-sub-desc-not-enabled",
10390
+ name: "MastraNotEnabledError",
10391
+ code: "MASTRA_NOT_ENABLED",
10392
+ description: "Mastra must be enabled before managing sub-agents.",
10393
+ template: ""
10394
+ }, {
10395
+ id: "e-set-sub-desc-not-found",
10396
+ name: "AgentNotFoundError",
10397
+ code: "AGENT_NOT_FOUND",
10398
+ description: "The specified sub-agent was not found.",
10017
10399
  template: ""
10018
10400
  }],
10019
10401
  examples: [],
10020
10402
  scope: "global"
10403
+ }
10404
+ ]
10405
+ },
10406
+ {
10407
+ id: "m-mastra-agent-bindings",
10408
+ name: "mastra_agent_bindings",
10409
+ description: "Per-agent assignments of model, profile references, skills, and tool-name patterns. agentId resolves to main if it matches mainAgent.id, else looks up subAgents.",
10410
+ operations: [
10411
+ {
10412
+ id: "o-set-agent-model",
10413
+ name: "SET_AGENT_MODEL",
10414
+ description: "Set the agent's model. modelId must exist in the model library. agentId resolves to main or a sub.",
10415
+ schema: "input SetAgentModelInput {\n agentId: OID!\n modelId: OID!\n}",
10416
+ template: "Bind an agent to a model.",
10417
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent model when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nif (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {\n throw new ModelReferenceNotFoundError(\n `Model not in library: ${action.input.modelId}`,\n );\n}\nagent.modelId = action.input.modelId;",
10418
+ errors: [
10419
+ {
10420
+ id: "e-set-model-not-enabled",
10421
+ name: "MastraNotEnabledError",
10422
+ code: "MASTRA_NOT_ENABLED",
10423
+ description: "Mastra must be enabled before managing agent bindings.",
10424
+ template: ""
10425
+ },
10426
+ {
10427
+ id: "e-set-model-agent-not-found",
10428
+ name: "AgentNotFoundError",
10429
+ code: "AGENT_NOT_FOUND",
10430
+ description: "The specified agentId resolves to neither main nor any sub-agent.",
10431
+ template: ""
10432
+ },
10433
+ {
10434
+ id: "e-set-model-ref-not-found",
10435
+ name: "ModelReferenceNotFoundError",
10436
+ code: "MODEL_REFERENCE_NOT_FOUND",
10437
+ description: "The referenced modelId does not exist in the model library.",
10438
+ template: ""
10439
+ }
10440
+ ],
10441
+ examples: [],
10442
+ scope: "global"
10021
10443
  },
10022
10444
  {
10023
- id: "o-set-proxy-enabled",
10024
- name: "SET_PROXY_ENABLED",
10025
- description: "Toggle the embedded reverse proxy.",
10026
- schema: "input SetProxyEnabledInput {\n enabled: Boolean!\n}",
10027
- template: "Toggle the embedded reverse proxy.",
10028
- reducer: "state.deployment.proxyEnabled = action.input.enabled;",
10029
- errors: [],
10445
+ id: "o-add-agent-profile-ref",
10446
+ name: "ADD_AGENT_PROFILE_REF",
10447
+ description: "Add a profile reference to an agent. profileId must exist in the profile library. Inserts before insertBefore if provided, otherwise appends. Dedup: silent if already present.",
10448
+ schema: "input AddAgentProfileRefInput {\n agentId: OID!\n profileId: OID!\n insertBefore: OID\n}",
10449
+ template: "Add a profile reference to an agent.",
10450
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add profile ref when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nif (!state.features.mastra.profiles.find((p) => p.id === action.input.profileId)) {\n throw new ProfileReferenceNotFoundError(\n `Profile not in library: ${action.input.profileId}`,\n );\n}\nif (agent.profileIds.includes(action.input.profileId)) {\n return;\n}\nif (action.input.insertBefore) {\n const beforeIdx = agent.profileIds.indexOf(action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileReferenceNotFoundError(\n `insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`,\n );\n }\n agent.profileIds.splice(beforeIdx, 0, action.input.profileId);\n} else {\n agent.profileIds.push(action.input.profileId);\n}",
10451
+ errors: [
10452
+ {
10453
+ id: "e-add-profile-ref-not-enabled",
10454
+ name: "MastraNotEnabledError",
10455
+ code: "MASTRA_NOT_ENABLED",
10456
+ description: "Mastra must be enabled.",
10457
+ template: ""
10458
+ },
10459
+ {
10460
+ id: "e-add-profile-ref-agent-not-found",
10461
+ name: "AgentNotFoundError",
10462
+ code: "AGENT_NOT_FOUND",
10463
+ description: "The specified agentId was not found.",
10464
+ template: ""
10465
+ },
10466
+ {
10467
+ id: "e-add-profile-ref-not-found",
10468
+ name: "ProfileReferenceNotFoundError",
10469
+ code: "PROFILE_REFERENCE_NOT_FOUND",
10470
+ description: "The referenced profileId does not exist in the profile library, or insertBefore is not present in the agent.",
10471
+ template: ""
10472
+ }
10473
+ ],
10030
10474
  examples: [],
10031
10475
  scope: "global"
10032
10476
  },
10033
10477
  {
10034
- id: "o-set-observability-enabled",
10035
- name: "SET_OBSERVABILITY_ENABLED",
10036
- description: "Toggle the observability plugin (Sentry + OpenTelemetry).",
10037
- schema: "input SetObservabilityEnabledInput {\n enabled: Boolean!\n}",
10038
- template: "Toggle the observability plugin (Sentry + OpenTelemetry).",
10039
- reducer: "state.deployment.observabilityEnabled = action.input.enabled;",
10040
- errors: [],
10478
+ id: "o-remove-agent-profile-ref",
10479
+ name: "REMOVE_AGENT_PROFILE_REF",
10480
+ description: "Remove a profile reference from an agent.",
10481
+ schema: "input RemoveAgentProfileRefInput {\n agentId: OID!\n profileId: OID!\n}",
10482
+ template: "Remove a profile reference from an agent.",
10483
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove profile ref when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nconst idx = agent.profileIds.indexOf(action.input.profileId);\nif (idx === -1) {\n throw new ProfileReferenceNotFoundError(\n `Profile not in agent's profileIds: ${action.input.profileId}`,\n );\n}\nagent.profileIds.splice(idx, 1);",
10484
+ errors: [
10485
+ {
10486
+ id: "e-remove-profile-ref-not-enabled",
10487
+ name: "MastraNotEnabledError",
10488
+ code: "MASTRA_NOT_ENABLED",
10489
+ description: "Mastra must be enabled.",
10490
+ template: ""
10491
+ },
10492
+ {
10493
+ id: "e-remove-profile-ref-agent-not-found",
10494
+ name: "AgentNotFoundError",
10495
+ code: "AGENT_NOT_FOUND",
10496
+ description: "The specified agentId was not found.",
10497
+ template: ""
10498
+ },
10499
+ {
10500
+ id: "e-remove-profile-ref-not-found",
10501
+ name: "ProfileReferenceNotFoundError",
10502
+ code: "PROFILE_REFERENCE_NOT_FOUND",
10503
+ description: "The profileId is not present in this agent's profileIds.",
10504
+ template: ""
10505
+ }
10506
+ ],
10507
+ examples: [],
10508
+ scope: "global"
10509
+ },
10510
+ {
10511
+ id: "o-reorder-agent-profile-refs",
10512
+ name: "REORDER_AGENT_PROFILE_REFS",
10513
+ description: "Reorder an agent's profile references. Moves the given ids before insertBefore, or to the end if insertBefore is null.",
10514
+ schema: "input ReorderAgentProfileRefsInput {\n agentId: OID!\n ids: [OID!]!\n insertBefore: OID\n}",
10515
+ template: "Reorder an agent's profile references.",
10516
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot reorder profile refs when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nfor (const id of action.input.ids) {\n if (!agent.profileIds.includes(id)) {\n throw new ProfileReferenceNotFoundError(\n `Profile not in agent's profileIds: ${id}`,\n );\n }\n}\nconst remaining = agent.profileIds.filter(\n (id) => !action.input.ids.includes(id),\n);\nif (action.input.insertBefore) {\n const beforeIdx = remaining.indexOf(action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileReferenceNotFoundError(\n `insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`,\n );\n }\n remaining.splice(beforeIdx, 0, ...action.input.ids);\n} else {\n remaining.push(...action.input.ids);\n}\nagent.profileIds = remaining;",
10517
+ errors: [
10518
+ {
10519
+ id: "e-reorder-refs-not-enabled",
10520
+ name: "MastraNotEnabledError",
10521
+ code: "MASTRA_NOT_ENABLED",
10522
+ description: "Mastra must be enabled.",
10523
+ template: ""
10524
+ },
10525
+ {
10526
+ id: "e-reorder-refs-agent-not-found",
10527
+ name: "AgentNotFoundError",
10528
+ code: "AGENT_NOT_FOUND",
10529
+ description: "The specified agentId was not found.",
10530
+ template: ""
10531
+ },
10532
+ {
10533
+ id: "e-reorder-refs-not-found",
10534
+ name: "ProfileReferenceNotFoundError",
10535
+ code: "PROFILE_REFERENCE_NOT_FOUND",
10536
+ description: "A referenced profileId is not present in this agent.",
10537
+ template: ""
10538
+ }
10539
+ ],
10540
+ examples: [],
10541
+ scope: "global"
10542
+ },
10543
+ {
10544
+ id: "o-add-agent-skill",
10545
+ name: "ADD_AGENT_SKILL",
10546
+ description: "Add a skill name to an agent. Dedup: silent if already present.",
10547
+ schema: "input AddAgentSkillInput {\n agentId: OID!\n name: String!\n}",
10548
+ template: "Add a skill to an agent.",
10549
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add skill when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nconst trimmed = action.input.name.trim();\nif (!/^[a-z][a-z0-9-]*$/.test(trimmed)) {\n throw new InvalidSkillNameError(\n `Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`,\n );\n}\nif (!agent.skills.includes(trimmed)) {\n agent.skills.push(trimmed);\n}",
10550
+ errors: [
10551
+ {
10552
+ id: "e-add-skill-not-enabled",
10553
+ name: "MastraNotEnabledError",
10554
+ code: "MASTRA_NOT_ENABLED",
10555
+ description: "Mastra must be enabled.",
10556
+ template: ""
10557
+ },
10558
+ {
10559
+ id: "e-add-skill-agent-not-found",
10560
+ name: "AgentNotFoundError",
10561
+ code: "AGENT_NOT_FOUND",
10562
+ description: "The specified agentId was not found.",
10563
+ template: ""
10564
+ },
10565
+ {
10566
+ id: "e-add-skill-invalid",
10567
+ name: "InvalidSkillNameError",
10568
+ code: "INVALID_SKILL_NAME",
10569
+ description: "Skill name must be lowercase kebab-case.",
10570
+ template: ""
10571
+ }
10572
+ ],
10573
+ examples: [],
10574
+ scope: "global"
10575
+ },
10576
+ {
10577
+ id: "o-remove-agent-skill",
10578
+ name: "REMOVE_AGENT_SKILL",
10579
+ description: "Remove a skill name from an agent.",
10580
+ schema: "input RemoveAgentSkillInput {\n agentId: OID!\n name: String!\n}",
10581
+ template: "Remove a skill from an agent.",
10582
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove skill when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nconst idx = agent.skills.indexOf(action.input.name);\nif (idx === -1) {\n throw new SkillNotFoundError(`Skill not on agent: ${action.input.name}`);\n}\nagent.skills.splice(idx, 1);",
10583
+ errors: [
10584
+ {
10585
+ id: "e-remove-skill-not-enabled",
10586
+ name: "MastraNotEnabledError",
10587
+ code: "MASTRA_NOT_ENABLED",
10588
+ description: "Mastra must be enabled.",
10589
+ template: ""
10590
+ },
10591
+ {
10592
+ id: "e-remove-skill-agent-not-found",
10593
+ name: "AgentNotFoundError",
10594
+ code: "AGENT_NOT_FOUND",
10595
+ description: "The specified agentId was not found.",
10596
+ template: ""
10597
+ },
10598
+ {
10599
+ id: "e-remove-skill-not-found",
10600
+ name: "SkillNotFoundError",
10601
+ code: "SKILL_NOT_FOUND",
10602
+ description: "The skill name is not on this agent.",
10603
+ template: ""
10604
+ }
10605
+ ],
10606
+ examples: [],
10607
+ scope: "global"
10608
+ },
10609
+ {
10610
+ id: "o-add-agent-tool-pattern",
10611
+ name: "ADD_AGENT_TOOL_PATTERN",
10612
+ description: "Add a tool-name glob pattern to an agent. Dedup: silent if already present.",
10613
+ schema: "input AddAgentToolPatternInput {\n agentId: OID!\n pattern: String!\n}",
10614
+ template: "Add a tool-name pattern to an agent.",
10615
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add tool pattern when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nconst trimmed = action.input.pattern.trim();\nif (!trimmed) {\n throw new InvalidToolPatternError('Tool pattern must not be empty after trimming.');\n}\nif (!agent.toolPatterns.includes(trimmed)) {\n agent.toolPatterns.push(trimmed);\n}",
10616
+ errors: [
10617
+ {
10618
+ id: "e-add-pattern-not-enabled",
10619
+ name: "MastraNotEnabledError",
10620
+ code: "MASTRA_NOT_ENABLED",
10621
+ description: "Mastra must be enabled.",
10622
+ template: ""
10623
+ },
10624
+ {
10625
+ id: "e-add-pattern-agent-not-found",
10626
+ name: "AgentNotFoundError",
10627
+ code: "AGENT_NOT_FOUND",
10628
+ description: "The specified agentId was not found.",
10629
+ template: ""
10630
+ },
10631
+ {
10632
+ id: "e-add-pattern-invalid",
10633
+ name: "InvalidToolPatternError",
10634
+ code: "INVALID_TOOL_PATTERN",
10635
+ description: "Tool pattern must not be empty after trimming.",
10636
+ template: ""
10637
+ }
10638
+ ],
10639
+ examples: [],
10640
+ scope: "global"
10641
+ },
10642
+ {
10643
+ id: "o-remove-agent-tool-pattern",
10644
+ name: "REMOVE_AGENT_TOOL_PATTERN",
10645
+ description: "Remove a tool-name glob pattern from an agent.",
10646
+ schema: "input RemoveAgentToolPatternInput {\n agentId: OID!\n pattern: String!\n}",
10647
+ template: "Remove a tool-name pattern from an agent.",
10648
+ reducer: "if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove tool pattern when Mastra is disabled.');\n}\nconst main = state.features.mastra.mainAgent;\nlet agent;\nif (main && main.id === action.input.agentId) {\n agent = main;\n} else {\n agent = state.features.mastra.subAgents.find(\n (s) => s.id === action.input.agentId,\n );\n}\nif (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n}\nconst idx = agent.toolPatterns.indexOf(action.input.pattern);\nif (idx === -1) {\n throw new ToolPatternNotFoundError(\n `Tool pattern not on agent: ${action.input.pattern}`,\n );\n}\nagent.toolPatterns.splice(idx, 1);",
10649
+ errors: [
10650
+ {
10651
+ id: "e-remove-pattern-not-enabled",
10652
+ name: "MastraNotEnabledError",
10653
+ code: "MASTRA_NOT_ENABLED",
10654
+ description: "Mastra must be enabled.",
10655
+ template: ""
10656
+ },
10657
+ {
10658
+ id: "e-remove-pattern-agent-not-found",
10659
+ name: "AgentNotFoundError",
10660
+ code: "AGENT_NOT_FOUND",
10661
+ description: "The specified agentId was not found.",
10662
+ template: ""
10663
+ },
10664
+ {
10665
+ id: "e-remove-pattern-not-found",
10666
+ name: "ToolPatternNotFoundError",
10667
+ code: "TOOL_PATTERN_NOT_FOUND",
10668
+ description: "The tool pattern is not on this agent.",
10669
+ template: ""
10670
+ }
10671
+ ],
10041
10672
  examples: [],
10042
10673
  scope: "global"
10043
10674
  }
@@ -10049,49 +10680,401 @@ const documentModel = {
10049
10680
  }]
10050
10681
  };
10051
10682
  //#endregion
10052
- //#region document-models/ph-clint-project/v1/gen/deployment/error.ts
10053
- var DuplicateResourceError = class extends Error {
10054
- errorCode = "DuplicateResourceError";
10055
- constructor(message = "DuplicateResourceError") {
10683
+ //#region document-models/ph-clint-project/v1/gen/deployment/error.ts
10684
+ var DuplicateResourceError = class extends Error {
10685
+ errorCode = "DuplicateResourceError";
10686
+ constructor(message = "DuplicateResourceError") {
10687
+ super(message);
10688
+ }
10689
+ };
10690
+ var ResourceNotFoundError = class extends Error {
10691
+ errorCode = "ResourceNotFoundError";
10692
+ constructor(message = "ResourceNotFoundError") {
10693
+ super(message);
10694
+ }
10695
+ };
10696
+ //#endregion
10697
+ //#region document-models/ph-clint-project/v1/src/reducers/deployment.ts
10698
+ const phClintProjectDeploymentOperations = {
10699
+ addSupportedResourceOperation(state, action) {
10700
+ if (state.deployment.supportedResources.includes(action.input.resource)) throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);
10701
+ state.deployment.supportedResources.push(action.input.resource);
10702
+ },
10703
+ removeSupportedResourceOperation(state, action) {
10704
+ const idx = state.deployment.supportedResources.indexOf(action.input.resource);
10705
+ if (idx === -1) throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);
10706
+ state.deployment.supportedResources.splice(idx, 1);
10707
+ },
10708
+ setProxyEnabledOperation(state, action) {
10709
+ state.deployment.proxyEnabled = action.input.enabled;
10710
+ },
10711
+ setObservabilityEnabledOperation(state, action) {
10712
+ state.deployment.observabilityEnabled = action.input.enabled;
10713
+ }
10714
+ };
10715
+ //#endregion
10716
+ //#region document-models/ph-clint-project/v1/gen/external-skills/error.ts
10717
+ var InvalidSkillNameError$1 = class extends Error {
10718
+ errorCode = "InvalidSkillNameError";
10719
+ constructor(message = "InvalidSkillNameError") {
10720
+ super(message);
10721
+ }
10722
+ };
10723
+ var DuplicateSkillError = class extends Error {
10724
+ errorCode = "DuplicateSkillError";
10725
+ constructor(message = "DuplicateSkillError") {
10726
+ super(message);
10727
+ }
10728
+ };
10729
+ var SkillNotFoundError$1 = class extends Error {
10730
+ errorCode = "SkillNotFoundError";
10731
+ constructor(message = "SkillNotFoundError") {
10732
+ super(message);
10733
+ }
10734
+ };
10735
+ //#endregion
10736
+ //#region document-models/ph-clint-project/v1/src/reducers/external-skills.ts
10737
+ const phClintProjectExternalSkillsOperations = {
10738
+ addExternalSkillOperation(state, action) {
10739
+ if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) throw new InvalidSkillNameError$1(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);
10740
+ if (state.externalSkills.find((s) => s.id === action.input.id || s.name === action.input.name)) throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);
10741
+ state.externalSkills.push({
10742
+ id: action.input.id,
10743
+ name: action.input.name,
10744
+ githubUrl: action.input.githubUrl
10745
+ });
10746
+ },
10747
+ removeExternalSkillOperation(state, action) {
10748
+ const idx = state.externalSkills.findIndex((s) => s.id === action.input.id);
10749
+ if (idx === -1) throw new SkillNotFoundError$1(`Skill not found: ${action.input.id}`);
10750
+ state.externalSkills.splice(idx, 1);
10751
+ },
10752
+ setExternalSkillNameOperation(state, action) {
10753
+ const skill = state.externalSkills.find((s) => s.id === action.input.id);
10754
+ if (!skill) throw new SkillNotFoundError$1(`Skill not found: ${action.input.id}`);
10755
+ if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) throw new InvalidSkillNameError$1(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);
10756
+ if (state.externalSkills.find((s) => s.name === action.input.name && s.id !== action.input.id)) throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);
10757
+ skill.name = action.input.name;
10758
+ },
10759
+ setExternalSkillGithubUrlOperation(state, action) {
10760
+ const skill = state.externalSkills.find((s) => s.id === action.input.id);
10761
+ if (!skill) throw new SkillNotFoundError$1(`Skill not found: ${action.input.id}`);
10762
+ skill.githubUrl = action.input.githubUrl;
10763
+ }
10764
+ };
10765
+ //#endregion
10766
+ //#region document-models/ph-clint-project/v1/gen/features-mastra/error.ts
10767
+ var InvalidAgentIdError$1 = class extends Error {
10768
+ errorCode = "InvalidAgentIdError";
10769
+ constructor(message = "InvalidAgentIdError") {
10770
+ super(message);
10771
+ }
10772
+ };
10773
+ var InvalidAgentNameError$2 = class extends Error {
10774
+ errorCode = "InvalidAgentNameError";
10775
+ constructor(message = "InvalidAgentNameError") {
10776
+ super(message);
10777
+ }
10778
+ };
10779
+ var MastraNotEnabledError$5 = class extends Error {
10780
+ errorCode = "MastraNotEnabledError";
10781
+ constructor(message = "MastraNotEnabledError") {
10782
+ super(message);
10783
+ }
10784
+ };
10785
+ var PowerhouseNotEnabledError = class extends Error {
10786
+ errorCode = "PowerhouseNotEnabledError";
10787
+ constructor(message = "PowerhouseNotEnabledError") {
10788
+ super(message);
10789
+ }
10790
+ };
10791
+ //#endregion
10792
+ //#region document-models/ph-clint-project/v1/src/reducers/features-mastra.ts
10793
+ const phClintProjectFeaturesMastraOperations = {
10794
+ enableMastraOperation(state, action) {
10795
+ if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) throw new InvalidAgentIdError$1(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);
10796
+ const trimmedName = action.input.agentName.trim();
10797
+ if (!trimmedName) throw new InvalidAgentNameError$2("Agent name must not be empty.");
10798
+ state.features.mastra.enabled = true;
10799
+ if (state.features.mastra.models.length === 0) state.features.mastra.models.push({
10800
+ id: "clint/demo-agent",
10801
+ isDefault: true
10802
+ });
10803
+ if (state.features.mastra.profiles.length === 0) state.features.mastra.profiles.push({
10804
+ id: "base",
10805
+ title: "Base Profile",
10806
+ content: "You are a helpful assistant."
10807
+ });
10808
+ const existing = state.features.mastra.mainAgent;
10809
+ if (!existing) state.features.mastra.mainAgent = {
10810
+ id: action.input.agentId,
10811
+ name: trimmedName,
10812
+ description: null,
10813
+ image: null,
10814
+ modelId: "clint/demo-agent",
10815
+ profileIds: ["base"],
10816
+ skills: [],
10817
+ toolPatterns: []
10818
+ };
10819
+ else {
10820
+ existing.id = action.input.agentId;
10821
+ existing.name = trimmedName;
10822
+ }
10823
+ },
10824
+ disableMastraOperation(state) {
10825
+ state.features.mastra.enabled = false;
10826
+ state.features.mastra.mainAgent = null;
10827
+ state.features.mastra.subAgents = [];
10828
+ state.features.mastra.models = [];
10829
+ state.features.mastra.profiles = [];
10830
+ state.features.mastra.common.enableChat = false;
10831
+ const ccIdx = state.packages.findIndex((p) => p.packageName === "@powerhousedao/clint-common" && p.managed);
10832
+ if (ccIdx !== -1) state.packages.splice(ccIdx, 1);
10833
+ },
10834
+ setEnableChatOperation(state, action) {
10835
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$5("Cannot toggle chat when Mastra is disabled.");
10836
+ if (state.features.powerhouse === "Disabled") throw new PowerhouseNotEnabledError("Cannot toggle chat when Powerhouse is disabled.");
10837
+ state.features.mastra.common.enableChat = action.input.enabled;
10838
+ const CLINT_COMMON_PKG = "@powerhousedao/clint-common";
10839
+ const CHAT_DOC_TYPE = "powerhouse/chat-session";
10840
+ if (action.input.enabled) {
10841
+ const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);
10842
+ if (!existing) state.packages.push({
10843
+ id: "pkg-clint-common",
10844
+ packageName: CLINT_COMMON_PKG,
10845
+ documentTypes: [CHAT_DOC_TYPE],
10846
+ version: null,
10847
+ managed: true
10848
+ });
10849
+ else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) existing.documentTypes.push(CHAT_DOC_TYPE);
10850
+ } else {
10851
+ const idx = state.packages.findIndex((p) => p.packageName === CLINT_COMMON_PKG && p.managed);
10852
+ if (idx !== -1) {
10853
+ const pkg = state.packages[idx];
10854
+ if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) state.packages.splice(idx, 1);
10855
+ else {
10856
+ const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);
10857
+ if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);
10858
+ }
10859
+ }
10860
+ }
10861
+ }
10862
+ };
10863
+ //#endregion
10864
+ //#region document-models/ph-clint-project/v1/gen/features-powerhouse/error.ts
10865
+ var CannotLowerPowerhouseError = class extends Error {
10866
+ errorCode = "CannotLowerPowerhouseError";
10867
+ constructor(message = "CannotLowerPowerhouseError") {
10868
+ super(message);
10869
+ }
10870
+ };
10871
+ //#endregion
10872
+ //#region document-models/ph-clint-project/v1/src/reducers/features-powerhouse.ts
10873
+ const LEVELS = [
10874
+ "Disabled",
10875
+ "Reactor",
10876
+ "Switchboard",
10877
+ "Connect"
10878
+ ];
10879
+ const phClintProjectFeaturesPowerhouseOperations = { setPowerhouseLevelOperation(state, action) {
10880
+ const current = LEVELS.indexOf(state.features.powerhouse);
10881
+ const next = LEVELS.indexOf(action.input.level);
10882
+ if (current >= 1 && next < 1) throw new CannotLowerPowerhouseError("Cannot lower Powerhouse level below Reactor once enabled");
10883
+ state.features.powerhouse = action.input.level;
10884
+ if (current === 0 && next >= 1) {
10885
+ if (!state.packages.some((p) => p.managed)) {
10886
+ const baseName = state.name ? state.name.replace(/-cli$/, "-app") : "app";
10887
+ const appName = state.scope && state.name ? `${state.scope}/${baseName}` : baseName;
10888
+ state.packages.push({
10889
+ id: `app-${state.name || "managed"}`,
10890
+ packageName: appName,
10891
+ documentTypes: ["*/*"],
10892
+ version: null,
10893
+ managed: true
10894
+ });
10895
+ }
10896
+ }
10897
+ if (next >= 2 && !action.input.skipAutoProxy) state.deployment.proxyEnabled = true;
10898
+ } };
10899
+ //#endregion
10900
+ //#region document-models/ph-clint-project/v1/src/reducers/features-routine.ts
10901
+ const phClintProjectFeaturesRoutineOperations = {
10902
+ enableRoutineOperation(state) {
10903
+ state.features.routine.enabled = true;
10904
+ },
10905
+ disableRoutineOperation(state) {
10906
+ state.features.routine.enabled = false;
10907
+ }
10908
+ };
10909
+ //#endregion
10910
+ //#region document-models/ph-clint-project/v1/gen/identity/error.ts
10911
+ var InvalidVersionError$2 = class extends Error {
10912
+ errorCode = "InvalidVersionError";
10913
+ constructor(message = "InvalidVersionError") {
10914
+ super(message);
10915
+ }
10916
+ };
10917
+ var InvalidPackageIdentifierError = class extends Error {
10918
+ errorCode = "InvalidPackageIdentifierError";
10919
+ constructor(message = "InvalidPackageIdentifierError") {
10920
+ super(message);
10921
+ }
10922
+ };
10923
+ //#endregion
10924
+ //#region document-models/ph-clint-project/v1/src/reducers/identity.ts
10925
+ const SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
10926
+ const NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
10927
+ const phClintProjectIdentityOperations = {
10928
+ setVersionOperation(state, action) {
10929
+ if (!SEMVER_PATTERN.test(action.input.version)) throw new InvalidVersionError$2(`Invalid version: ${action.input.version}`);
10930
+ state.version = action.input.version;
10931
+ },
10932
+ setDescriptionOperation(state, action) {
10933
+ state.description = action.input.description;
10934
+ },
10935
+ setPackageIdentifierOperation(state, action) {
10936
+ const trimmed = action.input.identifier.trim();
10937
+ if (!trimmed) throw new InvalidPackageIdentifierError("Package identifier must not be empty");
10938
+ let scopePart = null;
10939
+ let namePart = trimmed;
10940
+ if (trimmed.includes("/")) {
10941
+ const parts = trimmed.split("/");
10942
+ if (parts.length !== 2 || !parts[0] || !parts[1]) throw new InvalidPackageIdentifierError(`Invalid package identifier: ${trimmed}`);
10943
+ scopePart = parts[0].replace(/^@/, "");
10944
+ namePart = parts[1];
10945
+ }
10946
+ if (scopePart !== null) {
10947
+ if (!NAME_PATTERN.test(scopePart)) throw new InvalidPackageIdentifierError(`Invalid scope: ${scopePart}`);
10948
+ }
10949
+ if (!namePart.endsWith("-cli")) namePart = namePart + "-cli";
10950
+ if (!NAME_PATTERN.test(namePart)) throw new InvalidPackageIdentifierError(`Invalid package name: ${namePart}`);
10951
+ state.scope = scopePart ? `@${scopePart}` : null;
10952
+ state.name = namePart;
10953
+ const managed = state.packages.find((p) => p.managed);
10954
+ if (managed) {
10955
+ const appBase = namePart.replace(/-cli$/, "-app");
10956
+ managed.packageName = scopePart ? `@${scopePart}/${appBase}` : appBase;
10957
+ managed.id = `app-${namePart}`;
10958
+ }
10959
+ }
10960
+ };
10961
+ //#endregion
10962
+ //#region document-models/ph-clint-project/v1/gen/lifecycle/error.ts
10963
+ var InvalidAgentImageError$1 = class extends Error {
10964
+ errorCode = "InvalidAgentImageError";
10965
+ constructor(message = "InvalidAgentImageError") {
10966
+ super(message);
10967
+ }
10968
+ };
10969
+ //#endregion
10970
+ //#region document-models/ph-clint-project/v1/src/reducers/lifecycle.ts
10971
+ const phClintProjectLifecycleOperations = { importSpecOperation(state, action) {
10972
+ state.name = action.input.name;
10973
+ state.scope = action.input.scope || null;
10974
+ state.version = action.input.version;
10975
+ state.description = action.input.description;
10976
+ state.features.powerhouse = action.input.powerhouse;
10977
+ state.features.mastra.enabled = action.input.mastraEnabled;
10978
+ state.features.routine.enabled = action.input.routineEnabled;
10979
+ const appBase = action.input.name.replace(/-cli$/, "-app");
10980
+ const appPkgName = action.input.scope ? `${action.input.scope}/${appBase}` : appBase;
10981
+ const phEnabled = action.input.powerhouse !== "Disabled";
10982
+ state.packages = action.input.packages.map((p) => ({
10983
+ id: p.id,
10984
+ packageName: p.packageName,
10985
+ documentTypes: [...p.documentTypes],
10986
+ version: p.version || null,
10987
+ managed: phEnabled && p.packageName === appPkgName
10988
+ }));
10989
+ state.externalSkills = action.input.externalSkills.map((s) => ({
10990
+ id: s.id,
10991
+ name: s.name,
10992
+ githubUrl: s.githubUrl
10993
+ }));
10994
+ state.features.mastra.models = action.input.models.map((m) => ({
10995
+ id: m.id,
10996
+ isDefault: m.isDefault
10997
+ }));
10998
+ state.features.mastra.profiles = action.input.profiles.map((p) => ({
10999
+ id: p.id,
11000
+ title: p.title,
11001
+ content: p.content
11002
+ }));
11003
+ if (action.input.mainAgent && state.features.mastra.enabled) {
11004
+ const m = action.input.mainAgent;
11005
+ let image = null;
11006
+ if (m.image) {
11007
+ if (!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(m.image)) throw new InvalidAgentImageError$1("Invalid image: must be a data URL (data:<mime>;base64,...)");
11008
+ image = m.image;
11009
+ }
11010
+ state.features.mastra.mainAgent = {
11011
+ id: m.id,
11012
+ name: m.name,
11013
+ description: m.description || null,
11014
+ image,
11015
+ modelId: m.modelId,
11016
+ profileIds: [...m.profileIds],
11017
+ skills: [...m.skills],
11018
+ toolPatterns: [...m.toolPatterns]
11019
+ };
11020
+ } else state.features.mastra.mainAgent = null;
11021
+ if (state.features.mastra.enabled) state.features.mastra.subAgents = action.input.subAgents.map((s) => ({
11022
+ id: s.id,
11023
+ name: s.name,
11024
+ description: s.description,
11025
+ modelId: s.modelId,
11026
+ profileIds: [...s.profileIds],
11027
+ skills: [...s.skills],
11028
+ toolPatterns: [...s.toolPatterns]
11029
+ }));
11030
+ else state.features.mastra.subAgents = [];
11031
+ if (action.input.enableChat && state.features.mastra.enabled && state.features.powerhouse !== "Disabled") {
11032
+ state.features.mastra.common.enableChat = true;
11033
+ const CLINT_COMMON_PKG = "@powerhousedao/clint-common";
11034
+ const CHAT_DOC_TYPE = "powerhouse/chat-session";
11035
+ const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);
11036
+ if (!existing) state.packages.push({
11037
+ id: "pkg-clint-common",
11038
+ packageName: CLINT_COMMON_PKG,
11039
+ documentTypes: [CHAT_DOC_TYPE],
11040
+ version: null,
11041
+ managed: true
11042
+ });
11043
+ else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) existing.documentTypes.push(CHAT_DOC_TYPE);
11044
+ } else state.features.mastra.common.enableChat = false;
11045
+ state.deployment.proxyEnabled = action.input.proxyEnabled ?? false;
11046
+ state.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;
11047
+ state.deployment.supportedResources = action.input.supportedResources ? [...action.input.supportedResources] : [];
11048
+ } };
11049
+ //#endregion
11050
+ //#region document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.ts
11051
+ var MastraNotEnabledError$4 = class extends Error {
11052
+ errorCode = "MastraNotEnabledError";
11053
+ constructor(message = "MastraNotEnabledError") {
10056
11054
  super(message);
10057
11055
  }
10058
11056
  };
10059
- var ResourceNotFoundError = class extends Error {
10060
- errorCode = "ResourceNotFoundError";
10061
- constructor(message = "ResourceNotFoundError") {
11057
+ var AgentNotFoundError$1 = class extends Error {
11058
+ errorCode = "AgentNotFoundError";
11059
+ constructor(message = "AgentNotFoundError") {
10062
11060
  super(message);
10063
11061
  }
10064
11062
  };
10065
- //#endregion
10066
- //#region document-models/ph-clint-project/v1/src/reducers/deployment.ts
10067
- const phClintProjectDeploymentOperations = {
10068
- addSupportedResourceOperation(state, action) {
10069
- if (state.deployment.supportedResources.includes(action.input.resource)) throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);
10070
- state.deployment.supportedResources.push(action.input.resource);
10071
- },
10072
- removeSupportedResourceOperation(state, action) {
10073
- const idx = state.deployment.supportedResources.indexOf(action.input.resource);
10074
- if (idx === -1) throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);
10075
- state.deployment.supportedResources.splice(idx, 1);
10076
- },
10077
- setProxyEnabledOperation(state, action) {
10078
- state.deployment.proxyEnabled = action.input.enabled;
10079
- },
10080
- setObservabilityEnabledOperation(state, action) {
10081
- state.deployment.observabilityEnabled = action.input.enabled;
11063
+ var ModelReferenceNotFoundError$1 = class extends Error {
11064
+ errorCode = "ModelReferenceNotFoundError";
11065
+ constructor(message = "ModelReferenceNotFoundError") {
11066
+ super(message);
10082
11067
  }
10083
11068
  };
10084
- //#endregion
10085
- //#region document-models/ph-clint-project/v1/gen/external-skills/error.ts
10086
- var InvalidSkillNameError = class extends Error {
10087
- errorCode = "InvalidSkillNameError";
10088
- constructor(message = "InvalidSkillNameError") {
11069
+ var ProfileReferenceNotFoundError = class extends Error {
11070
+ errorCode = "ProfileReferenceNotFoundError";
11071
+ constructor(message = "ProfileReferenceNotFoundError") {
10089
11072
  super(message);
10090
11073
  }
10091
11074
  };
10092
- var DuplicateSkillError = class extends Error {
10093
- errorCode = "DuplicateSkillError";
10094
- constructor(message = "DuplicateSkillError") {
11075
+ var InvalidSkillNameError = class extends Error {
11076
+ errorCode = "InvalidSkillNameError";
11077
+ constructor(message = "InvalidSkillNameError") {
10095
11078
  super(message);
10096
11079
  }
10097
11080
  };
@@ -10101,51 +11084,153 @@ var SkillNotFoundError = class extends Error {
10101
11084
  super(message);
10102
11085
  }
10103
11086
  };
11087
+ var InvalidToolPatternError = class extends Error {
11088
+ errorCode = "InvalidToolPatternError";
11089
+ constructor(message = "InvalidToolPatternError") {
11090
+ super(message);
11091
+ }
11092
+ };
11093
+ var ToolPatternNotFoundError = class extends Error {
11094
+ errorCode = "ToolPatternNotFoundError";
11095
+ constructor(message = "ToolPatternNotFoundError") {
11096
+ super(message);
11097
+ }
11098
+ };
10104
11099
  //#endregion
10105
- //#region document-models/ph-clint-project/v1/src/reducers/external-skills.ts
10106
- const phClintProjectExternalSkillsOperations = {
10107
- addExternalSkillOperation(state, action) {
10108
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);
10109
- if (state.externalSkills.find((s) => s.id === action.input.id || s.name === action.input.name)) throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);
10110
- state.externalSkills.push({
10111
- id: action.input.id,
10112
- name: action.input.name,
10113
- githubUrl: action.input.githubUrl
10114
- });
11100
+ //#region document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.ts
11101
+ function resolveAgent(main, subs, agentId) {
11102
+ if (main && main.id === agentId) return main;
11103
+ return subs.find((s) => s.id === agentId);
11104
+ }
11105
+ const phClintProjectMastraAgentBindingsOperations = {
11106
+ setAgentModelOperation(state, action) {
11107
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot set agent model when Mastra is disabled.");
11108
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11109
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11110
+ if (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) throw new ModelReferenceNotFoundError$1(`Model not in library: ${action.input.modelId}`);
11111
+ agent.modelId = action.input.modelId;
10115
11112
  },
10116
- removeExternalSkillOperation(state, action) {
10117
- const idx = state.externalSkills.findIndex((s) => s.id === action.input.id);
10118
- if (idx === -1) throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);
10119
- state.externalSkills.splice(idx, 1);
11113
+ addAgentProfileRefOperation(state, action) {
11114
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot add profile ref when Mastra is disabled.");
11115
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11116
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11117
+ if (!state.features.mastra.profiles.find((p) => p.id === action.input.profileId)) throw new ProfileReferenceNotFoundError(`Profile not in library: ${action.input.profileId}`);
11118
+ if (agent.profileIds.includes(action.input.profileId)) return;
11119
+ if (action.input.insertBefore) {
11120
+ const beforeIdx = agent.profileIds.indexOf(action.input.insertBefore);
11121
+ if (beforeIdx === -1) throw new ProfileReferenceNotFoundError(`insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`);
11122
+ agent.profileIds.splice(beforeIdx, 0, action.input.profileId);
11123
+ } else agent.profileIds.push(action.input.profileId);
10120
11124
  },
10121
- setExternalSkillNameOperation(state, action) {
10122
- const skill = state.externalSkills.find((s) => s.id === action.input.id);
10123
- if (!skill) throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);
10124
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);
10125
- if (state.externalSkills.find((s) => s.name === action.input.name && s.id !== action.input.id)) throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);
10126
- skill.name = action.input.name;
11125
+ removeAgentProfileRefOperation(state, action) {
11126
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot remove profile ref when Mastra is disabled.");
11127
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11128
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11129
+ const idx = agent.profileIds.indexOf(action.input.profileId);
11130
+ if (idx === -1) throw new ProfileReferenceNotFoundError(`Profile not in agent's profileIds: ${action.input.profileId}`);
11131
+ agent.profileIds.splice(idx, 1);
10127
11132
  },
10128
- setExternalSkillGithubUrlOperation(state, action) {
10129
- const skill = state.externalSkills.find((s) => s.id === action.input.id);
10130
- if (!skill) throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);
10131
- skill.githubUrl = action.input.githubUrl;
11133
+ reorderAgentProfileRefsOperation(state, action) {
11134
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot reorder profile refs when Mastra is disabled.");
11135
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11136
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11137
+ for (const id of action.input.ids) if (!agent.profileIds.includes(id)) throw new ProfileReferenceNotFoundError(`Profile not in agent's profileIds: ${id}`);
11138
+ const remaining = agent.profileIds.filter((id) => !action.input.ids.includes(id));
11139
+ if (action.input.insertBefore) {
11140
+ const beforeIdx = remaining.indexOf(action.input.insertBefore);
11141
+ if (beforeIdx === -1) throw new ProfileReferenceNotFoundError(`insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`);
11142
+ remaining.splice(beforeIdx, 0, ...action.input.ids);
11143
+ } else remaining.push(...action.input.ids);
11144
+ agent.profileIds = remaining;
11145
+ },
11146
+ addAgentSkillOperation(state, action) {
11147
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot add skill when Mastra is disabled.");
11148
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11149
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11150
+ const trimmed = action.input.name.trim();
11151
+ if (!/^[a-z][a-z0-9-]*$/.test(trimmed)) throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);
11152
+ if (!agent.skills.includes(trimmed)) agent.skills.push(trimmed);
11153
+ },
11154
+ removeAgentSkillOperation(state, action) {
11155
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot remove skill when Mastra is disabled.");
11156
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11157
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11158
+ const idx = agent.skills.indexOf(action.input.name);
11159
+ if (idx === -1) throw new SkillNotFoundError(`Skill not on agent: ${action.input.name}`);
11160
+ agent.skills.splice(idx, 1);
11161
+ },
11162
+ addAgentToolPatternOperation(state, action) {
11163
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot add tool pattern when Mastra is disabled.");
11164
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11165
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11166
+ const trimmed = action.input.pattern.trim();
11167
+ if (!trimmed) throw new InvalidToolPatternError("Tool pattern must not be empty after trimming.");
11168
+ if (!agent.toolPatterns.includes(trimmed)) agent.toolPatterns.push(trimmed);
11169
+ },
11170
+ removeAgentToolPatternOperation(state, action) {
11171
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$4("Cannot remove tool pattern when Mastra is disabled.");
11172
+ const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);
11173
+ if (!agent) throw new AgentNotFoundError$1(`Agent not found: ${action.input.agentId}`);
11174
+ const idx = agent.toolPatterns.indexOf(action.input.pattern);
11175
+ if (idx === -1) throw new ToolPatternNotFoundError(`Tool pattern not on agent: ${action.input.pattern}`);
11176
+ agent.toolPatterns.splice(idx, 1);
10132
11177
  }
10133
11178
  };
10134
11179
  //#endregion
10135
- //#region document-models/ph-clint-project/v1/gen/features-mastra/error.ts
10136
- var InvalidAgentIdError = class extends Error {
10137
- errorCode = "InvalidAgentIdError";
10138
- constructor(message = "InvalidAgentIdError") {
11180
+ //#region document-models/ph-clint-project/v1/gen/mastra-main-agent/error.ts
11181
+ var MastraNotEnabledError$3 = class extends Error {
11182
+ errorCode = "MastraNotEnabledError";
11183
+ constructor(message = "MastraNotEnabledError") {
10139
11184
  super(message);
10140
11185
  }
10141
11186
  };
10142
- var InvalidAgentNameError = class extends Error {
11187
+ var InvalidAgentNameError$1 = class extends Error {
10143
11188
  errorCode = "InvalidAgentNameError";
10144
11189
  constructor(message = "InvalidAgentNameError") {
10145
11190
  super(message);
10146
11191
  }
10147
11192
  };
10148
- var MastraNotEnabledError = class extends Error {
11193
+ var InvalidAgentImageError = class extends Error {
11194
+ errorCode = "InvalidAgentImageError";
11195
+ constructor(message = "InvalidAgentImageError") {
11196
+ super(message);
11197
+ }
11198
+ };
11199
+ //#endregion
11200
+ //#region document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.ts
11201
+ const phClintProjectMastraMainAgentOperations = {
11202
+ setMainAgentNameOperation(state, action) {
11203
+ const main = state.features.mastra.mainAgent;
11204
+ if (!state.features.mastra.enabled || !main) throw new MastraNotEnabledError$3("Cannot set main agent name when Mastra is disabled.");
11205
+ const trimmed = action.input.name.trim();
11206
+ if (!trimmed) throw new InvalidAgentNameError$1("Agent name must not be empty.");
11207
+ main.name = trimmed;
11208
+ },
11209
+ setMainAgentDescriptionOperation(state, action) {
11210
+ const main = state.features.mastra.mainAgent;
11211
+ if (!state.features.mastra.enabled || !main) throw new MastraNotEnabledError$3("Cannot set main agent description when Mastra is disabled.");
11212
+ main.description = action.input.description;
11213
+ },
11214
+ clearMainAgentDescriptionOperation(state) {
11215
+ const main = state.features.mastra.mainAgent;
11216
+ if (!state.features.mastra.enabled || !main) throw new MastraNotEnabledError$3("Cannot clear main agent description when Mastra is disabled.");
11217
+ main.description = null;
11218
+ },
11219
+ setMainAgentImageOperation(state, action) {
11220
+ const main = state.features.mastra.mainAgent;
11221
+ if (!state.features.mastra.enabled || !main) throw new MastraNotEnabledError$3("Cannot set main agent image when Mastra is disabled.");
11222
+ if (!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(action.input.image)) throw new InvalidAgentImageError("Agent image must be a data URL (data:image/...;base64,...)");
11223
+ main.image = action.input.image;
11224
+ },
11225
+ clearMainAgentImageOperation(state) {
11226
+ const main = state.features.mastra.mainAgent;
11227
+ if (!state.features.mastra.enabled || !main) throw new MastraNotEnabledError$3("Cannot clear main agent image when Mastra is disabled.");
11228
+ main.image = null;
11229
+ }
11230
+ };
11231
+ //#endregion
11232
+ //#region document-models/ph-clint-project/v1/gen/mastra-models/error.ts
11233
+ var MastraNotEnabledError$2 = class extends Error {
10149
11234
  errorCode = "MastraNotEnabledError";
10150
11235
  constructor(message = "MastraNotEnabledError") {
10151
11236
  super(message);
@@ -10169,81 +11254,17 @@ var ModelNotFoundError = class extends Error {
10169
11254
  super(message);
10170
11255
  }
10171
11256
  };
10172
- var InvalidProfileIdError = class extends Error {
10173
- errorCode = "InvalidProfileIdError";
10174
- constructor(message = "InvalidProfileIdError") {
10175
- super(message);
10176
- }
10177
- };
10178
- var DuplicateProfileError = class extends Error {
10179
- errorCode = "DuplicateProfileError";
10180
- constructor(message = "DuplicateProfileError") {
10181
- super(message);
10182
- }
10183
- };
10184
- var ProfileNotFoundError = class extends Error {
10185
- errorCode = "ProfileNotFoundError";
10186
- constructor(message = "ProfileNotFoundError") {
10187
- super(message);
10188
- }
10189
- };
10190
- var InvalidAgentImageError = class extends Error {
10191
- errorCode = "InvalidAgentImageError";
10192
- constructor(message = "InvalidAgentImageError") {
10193
- super(message);
10194
- }
10195
- };
10196
- var PowerhouseNotEnabledError = class extends Error {
10197
- errorCode = "PowerhouseNotEnabledError";
10198
- constructor(message = "PowerhouseNotEnabledError") {
11257
+ var ModelInUseError = class extends Error {
11258
+ errorCode = "ModelInUseError";
11259
+ constructor(message = "ModelInUseError") {
10199
11260
  super(message);
10200
11261
  }
10201
11262
  };
10202
11263
  //#endregion
10203
- //#region document-models/ph-clint-project/v1/src/reducers/features-mastra.ts
10204
- const phClintProjectFeaturesMastraOperations = {
10205
- enableMastraOperation(state, action) {
10206
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);
10207
- const trimmedName = action.input.agentName.trim();
10208
- if (!trimmedName) throw new InvalidAgentNameError("Agent name must not be empty.");
10209
- state.features.mastra.enabled = true;
10210
- state.features.mastra.agentId = action.input.agentId;
10211
- state.features.mastra.agentName = trimmedName;
10212
- if (state.features.mastra.models.length === 0) state.features.mastra.models.push({
10213
- id: "clint/demo-agent",
10214
- isDefault: true
10215
- });
10216
- if (state.features.mastra.profiles.length === 0) state.features.mastra.profiles.push({
10217
- id: "base",
10218
- title: "Base Profile",
10219
- content: "You are a helpful assistant"
10220
- });
10221
- },
10222
- disableMastraOperation(state) {
10223
- state.features.mastra.enabled = false;
10224
- state.features.mastra.agentId = null;
10225
- state.features.mastra.agentName = null;
10226
- state.features.mastra.agentDescription = null;
10227
- state.features.mastra.agentImage = null;
10228
- state.features.mastra.models = [];
10229
- state.features.mastra.profiles = [];
10230
- state.features.mastra.common.enableChat = false;
10231
- const ccIdx = state.packages.findIndex((p) => p.packageName === "@powerhousedao/clint-common" && p.managed);
10232
- if (ccIdx !== -1) state.packages.splice(ccIdx, 1);
10233
- },
10234
- setAgentIdOperation(state, action) {
10235
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set agent ID when Mastra is disabled.");
10236
- if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);
10237
- state.features.mastra.agentId = action.input.agentId;
10238
- },
10239
- setAgentNameOperation(state, action) {
10240
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set agent name when Mastra is disabled.");
10241
- const trimmedName = action.input.agentName.trim();
10242
- if (!trimmedName) throw new InvalidAgentNameError("Agent name must not be empty.");
10243
- state.features.mastra.agentName = trimmedName;
10244
- },
11264
+ //#region document-models/ph-clint-project/v1/src/reducers/mastra-models.ts
11265
+ const phClintProjectMastraModelsOperations = {
10245
11266
  addModelOperation(state, action) {
10246
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot add model when Mastra is disabled.");
11267
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$2("Cannot add model when Mastra is disabled.");
10247
11268
  if (!/^[a-z0-9-]+\/[a-z0-9._-]+$/.test(action.input.id)) throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);
10248
11269
  if (state.features.mastra.models.find((m) => m.id === action.input.id)) throw new DuplicateModelError(`Model already exists: ${action.input.id}`);
10249
11270
  const makeDefault = state.features.mastra.models.length === 0 || action.input.isDefault === true;
@@ -10254,22 +11275,62 @@ const phClintProjectFeaturesMastraOperations = {
10254
11275
  });
10255
11276
  },
10256
11277
  removeModelOperation(state, action) {
10257
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot remove model when Mastra is disabled.");
11278
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$2("Cannot remove model when Mastra is disabled.");
10258
11279
  const idx = state.features.mastra.models.findIndex((m) => m.id === action.input.id);
10259
11280
  if (idx === -1) throw new ModelNotFoundError(`Model not found: ${action.input.id}`);
11281
+ const main = state.features.mastra.mainAgent;
11282
+ const usedByMain = !!main && main.modelId === action.input.id;
11283
+ const usedBySub = state.features.mastra.subAgents.some((s) => s.modelId === action.input.id);
11284
+ if (usedByMain || usedBySub) throw new ModelInUseError(`Model ${action.input.id} is in use by an agent.`);
10260
11285
  const wasDefault = state.features.mastra.models[idx].isDefault;
10261
11286
  state.features.mastra.models.splice(idx, 1);
10262
11287
  if (wasDefault && state.features.mastra.models.length > 0) state.features.mastra.models[0].isDefault = true;
10263
11288
  },
10264
11289
  setDefaultModelOperation(state, action) {
10265
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set default model when Mastra is disabled.");
11290
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$2("Cannot set default model when Mastra is disabled.");
10266
11291
  const model = state.features.mastra.models.find((m) => m.id === action.input.id);
10267
11292
  if (!model) throw new ModelNotFoundError(`Model not found: ${action.input.id}`);
10268
11293
  for (const m of state.features.mastra.models) m.isDefault = false;
10269
11294
  model.isDefault = true;
10270
- },
11295
+ }
11296
+ };
11297
+ //#endregion
11298
+ //#region document-models/ph-clint-project/v1/gen/mastra-profiles/error.ts
11299
+ var MastraNotEnabledError$1 = class extends Error {
11300
+ errorCode = "MastraNotEnabledError";
11301
+ constructor(message = "MastraNotEnabledError") {
11302
+ super(message);
11303
+ }
11304
+ };
11305
+ var InvalidProfileIdError = class extends Error {
11306
+ errorCode = "InvalidProfileIdError";
11307
+ constructor(message = "InvalidProfileIdError") {
11308
+ super(message);
11309
+ }
11310
+ };
11311
+ var DuplicateProfileError = class extends Error {
11312
+ errorCode = "DuplicateProfileError";
11313
+ constructor(message = "DuplicateProfileError") {
11314
+ super(message);
11315
+ }
11316
+ };
11317
+ var ProfileNotFoundError = class extends Error {
11318
+ errorCode = "ProfileNotFoundError";
11319
+ constructor(message = "ProfileNotFoundError") {
11320
+ super(message);
11321
+ }
11322
+ };
11323
+ var ProfileInUseError = class extends Error {
11324
+ errorCode = "ProfileInUseError";
11325
+ constructor(message = "ProfileInUseError") {
11326
+ super(message);
11327
+ }
11328
+ };
11329
+ //#endregion
11330
+ //#region document-models/ph-clint-project/v1/src/reducers/mastra-profiles.ts
11331
+ const phClintProjectMastraProfilesOperations = {
10271
11332
  addProfileOperation(state, action) {
10272
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot add profile when Mastra is disabled.");
11333
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$1("Cannot add profile when Mastra is disabled.");
10273
11334
  if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);
10274
11335
  if (state.features.mastra.profiles.find((p) => p.id === action.input.id)) throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);
10275
11336
  const profile = {
@@ -10284,234 +11345,120 @@ const phClintProjectFeaturesMastraOperations = {
10284
11345
  } else state.features.mastra.profiles.push(profile);
10285
11346
  },
10286
11347
  updateProfileOperation(state, action) {
10287
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot update profile when Mastra is disabled.");
11348
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$1("Cannot update profile when Mastra is disabled.");
10288
11349
  const profile = state.features.mastra.profiles.find((p) => p.id === action.input.id);
10289
11350
  if (!profile) throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);
10290
- if (action.input.title) profile.title = action.input.title;
10291
- if (action.input.content) profile.content = action.input.content;
10292
- },
10293
- removeProfileOperation(state, action) {
10294
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot remove profile when Mastra is disabled.");
10295
- const idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);
10296
- if (idx === -1) throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);
10297
- state.features.mastra.profiles.splice(idx, 1);
10298
- },
10299
- reorderProfilesOperation(state, action) {
10300
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot reorder profiles when Mastra is disabled.");
10301
- const moving = [];
10302
- for (const id of action.input.ids) {
10303
- const profile = state.features.mastra.profiles.find((p) => p.id === id);
10304
- if (!profile) throw new ProfileNotFoundError(`Profile not found: ${id}`);
10305
- moving.push(profile);
10306
- }
10307
- state.features.mastra.profiles = state.features.mastra.profiles.filter((p) => !action.input.ids.includes(p.id));
10308
- if (action.input.insertBefore) {
10309
- const beforeIdx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.insertBefore);
10310
- if (beforeIdx === -1) throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);
10311
- state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);
10312
- } else state.features.mastra.profiles.push(...moving);
10313
- },
10314
- setAgentDescriptionOperation(state, action) {
10315
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set agent description when Mastra is disabled.");
10316
- state.features.mastra.agentDescription = action.input.description;
10317
- },
10318
- setAgentImageOperation(state, action) {
10319
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set agent image when Mastra is disabled.");
10320
- if (!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(action.input.image)) throw new InvalidAgentImageError("Invalid image: must be a data URL (data:<mime>;base64,...)");
10321
- state.features.mastra.agentImage = action.input.image;
10322
- },
10323
- clearAgentImageOperation(state, action) {
10324
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot clear agent image when Mastra is disabled.");
10325
- state.features.mastra.agentImage = null;
10326
- },
10327
- setEnableChatOperation(state, action) {
10328
- if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot toggle chat when Mastra is disabled.");
10329
- if (state.features.powerhouse === "Disabled") throw new PowerhouseNotEnabledError("Cannot toggle chat when Powerhouse is disabled.");
10330
- state.features.mastra.common.enableChat = action.input.enabled;
10331
- const CLINT_COMMON_PKG = "@powerhousedao/clint-common";
10332
- const CHAT_DOC_TYPE = "powerhouse/chat-session";
10333
- if (action.input.enabled) {
10334
- const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);
10335
- if (!existing) state.packages.push({
10336
- id: "pkg-clint-common",
10337
- packageName: CLINT_COMMON_PKG,
10338
- documentTypes: [CHAT_DOC_TYPE],
10339
- version: null,
10340
- managed: true
10341
- });
10342
- else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) existing.documentTypes.push(CHAT_DOC_TYPE);
10343
- } else {
10344
- const idx = state.packages.findIndex((p) => p.packageName === CLINT_COMMON_PKG && p.managed);
10345
- if (idx !== -1) {
10346
- const pkg = state.packages[idx];
10347
- if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) state.packages.splice(idx, 1);
10348
- else {
10349
- const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);
10350
- if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);
10351
- }
10352
- }
11351
+ if (action.input.title) profile.title = action.input.title;
11352
+ if (action.input.content) profile.content = action.input.content;
11353
+ },
11354
+ removeProfileOperation(state, action) {
11355
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$1("Cannot remove profile when Mastra is disabled.");
11356
+ const idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);
11357
+ if (idx === -1) throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);
11358
+ const main = state.features.mastra.mainAgent;
11359
+ const usedByMain = !!main && main.profileIds.includes(action.input.id);
11360
+ const usedBySub = state.features.mastra.subAgents.some((s) => s.profileIds.includes(action.input.id));
11361
+ if (usedByMain || usedBySub) throw new ProfileInUseError(`Profile ${action.input.id} is in use by an agent.`);
11362
+ state.features.mastra.profiles.splice(idx, 1);
11363
+ },
11364
+ reorderProfilesOperation(state, action) {
11365
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError$1("Cannot reorder profiles when Mastra is disabled.");
11366
+ const moving = [];
11367
+ for (const id of action.input.ids) {
11368
+ const profile = state.features.mastra.profiles.find((p) => p.id === id);
11369
+ if (!profile) throw new ProfileNotFoundError(`Profile not found: ${id}`);
11370
+ moving.push(profile);
10353
11371
  }
11372
+ state.features.mastra.profiles = state.features.mastra.profiles.filter((p) => !action.input.ids.includes(p.id));
11373
+ if (action.input.insertBefore) {
11374
+ const beforeIdx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.insertBefore);
11375
+ if (beforeIdx === -1) throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);
11376
+ state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);
11377
+ } else state.features.mastra.profiles.push(...moving);
10354
11378
  }
10355
11379
  };
10356
11380
  //#endregion
10357
- //#region document-models/ph-clint-project/v1/gen/features-powerhouse/error.ts
10358
- var CannotLowerPowerhouseError = class extends Error {
10359
- errorCode = "CannotLowerPowerhouseError";
10360
- constructor(message = "CannotLowerPowerhouseError") {
11381
+ //#region document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.ts
11382
+ var MastraNotEnabledError = class extends Error {
11383
+ errorCode = "MastraNotEnabledError";
11384
+ constructor(message = "MastraNotEnabledError") {
10361
11385
  super(message);
10362
11386
  }
10363
11387
  };
10364
- //#endregion
10365
- //#region document-models/ph-clint-project/v1/src/reducers/features-powerhouse.ts
10366
- const LEVELS = [
10367
- "Disabled",
10368
- "Reactor",
10369
- "Switchboard",
10370
- "Connect"
10371
- ];
10372
- const phClintProjectFeaturesPowerhouseOperations = { setPowerhouseLevelOperation(state, action) {
10373
- const current = LEVELS.indexOf(state.features.powerhouse);
10374
- const next = LEVELS.indexOf(action.input.level);
10375
- if (current >= 1 && next < 1) throw new CannotLowerPowerhouseError("Cannot lower Powerhouse level below Reactor once enabled");
10376
- state.features.powerhouse = action.input.level;
10377
- if (current === 0 && next >= 1) {
10378
- if (!state.packages.some((p) => p.managed)) {
10379
- const baseName = state.name ? state.name.replace(/-cli$/, "-app") : "app";
10380
- const appName = state.scope && state.name ? `${state.scope}/${baseName}` : baseName;
10381
- state.packages.push({
10382
- id: `app-${state.name || "managed"}`,
10383
- packageName: appName,
10384
- documentTypes: ["*/*"],
10385
- version: null,
10386
- managed: true
10387
- });
10388
- }
11388
+ var InvalidAgentIdError = class extends Error {
11389
+ errorCode = "InvalidAgentIdError";
11390
+ constructor(message = "InvalidAgentIdError") {
11391
+ super(message);
10389
11392
  }
10390
- if (next >= 2 && !action.input.skipAutoProxy) state.deployment.proxyEnabled = true;
10391
- } };
10392
- //#endregion
10393
- //#region document-models/ph-clint-project/v1/src/reducers/features-routine.ts
10394
- const phClintProjectFeaturesRoutineOperations = {
10395
- enableRoutineOperation(state) {
10396
- state.features.routine.enabled = true;
10397
- },
10398
- disableRoutineOperation(state) {
10399
- state.features.routine.enabled = false;
11393
+ };
11394
+ var InvalidAgentNameError = class extends Error {
11395
+ errorCode = "InvalidAgentNameError";
11396
+ constructor(message = "InvalidAgentNameError") {
11397
+ super(message);
10400
11398
  }
10401
11399
  };
10402
- //#endregion
10403
- //#region document-models/ph-clint-project/v1/gen/identity/error.ts
10404
- var InvalidVersionError$2 = class extends Error {
10405
- errorCode = "InvalidVersionError";
10406
- constructor(message = "InvalidVersionError") {
11400
+ var DuplicateAgentIdError = class extends Error {
11401
+ errorCode = "DuplicateAgentIdError";
11402
+ constructor(message = "DuplicateAgentIdError") {
10407
11403
  super(message);
10408
11404
  }
10409
11405
  };
10410
- var InvalidPackageIdentifierError = class extends Error {
10411
- errorCode = "InvalidPackageIdentifierError";
10412
- constructor(message = "InvalidPackageIdentifierError") {
11406
+ var ModelReferenceNotFoundError = class extends Error {
11407
+ errorCode = "ModelReferenceNotFoundError";
11408
+ constructor(message = "ModelReferenceNotFoundError") {
11409
+ super(message);
11410
+ }
11411
+ };
11412
+ var AgentNotFoundError = class extends Error {
11413
+ errorCode = "AgentNotFoundError";
11414
+ constructor(message = "AgentNotFoundError") {
10413
11415
  super(message);
10414
11416
  }
10415
11417
  };
10416
11418
  //#endregion
10417
- //#region document-models/ph-clint-project/v1/src/reducers/identity.ts
10418
- const SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
10419
- const NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
10420
- const phClintProjectIdentityOperations = {
10421
- setVersionOperation(state, action) {
10422
- if (!SEMVER_PATTERN.test(action.input.version)) throw new InvalidVersionError$2(`Invalid version: ${action.input.version}`);
10423
- state.version = action.input.version;
11419
+ //#region document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.ts
11420
+ const phClintProjectMastraSubAgentsOperations = {
11421
+ addSubAgentOperation(state, action) {
11422
+ const main = state.features.mastra.mainAgent;
11423
+ if (!state.features.mastra.enabled || !main) throw new MastraNotEnabledError("Cannot add sub-agent when Mastra is disabled.");
11424
+ if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) throw new InvalidAgentIdError(`Invalid sub-agent ID: ${action.input.id}. Must be lowercase kebab-case.`);
11425
+ const trimmedName = action.input.name.trim();
11426
+ if (!trimmedName) throw new InvalidAgentNameError("Sub-agent name must not be empty.");
11427
+ if (main.id === action.input.id) throw new DuplicateAgentIdError(`Agent ID already taken by main agent: ${action.input.id}`);
11428
+ if (state.features.mastra.subAgents.find((s) => s.id === action.input.id)) throw new DuplicateAgentIdError(`Sub-agent already exists: ${action.input.id}`);
11429
+ if (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) throw new ModelReferenceNotFoundError(`Model not in library: ${action.input.modelId}`);
11430
+ state.features.mastra.subAgents.push({
11431
+ id: action.input.id,
11432
+ name: trimmedName,
11433
+ description: action.input.description,
11434
+ modelId: action.input.modelId,
11435
+ profileIds: [],
11436
+ skills: [],
11437
+ toolPatterns: []
11438
+ });
10424
11439
  },
10425
- setDescriptionOperation(state, action) {
10426
- state.description = action.input.description;
11440
+ removeSubAgentOperation(state, action) {
11441
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot remove sub-agent when Mastra is disabled.");
11442
+ const idx = state.features.mastra.subAgents.findIndex((s) => s.id === action.input.id);
11443
+ if (idx === -1) throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);
11444
+ state.features.mastra.subAgents.splice(idx, 1);
10427
11445
  },
10428
- setPackageIdentifierOperation(state, action) {
10429
- const trimmed = action.input.identifier.trim();
10430
- if (!trimmed) throw new InvalidPackageIdentifierError("Package identifier must not be empty");
10431
- let scopePart = null;
10432
- let namePart = trimmed;
10433
- if (trimmed.includes("/")) {
10434
- const parts = trimmed.split("/");
10435
- if (parts.length !== 2 || !parts[0] || !parts[1]) throw new InvalidPackageIdentifierError(`Invalid package identifier: ${trimmed}`);
10436
- scopePart = parts[0].replace(/^@/, "");
10437
- namePart = parts[1];
10438
- }
10439
- if (scopePart !== null) {
10440
- if (!NAME_PATTERN.test(scopePart)) throw new InvalidPackageIdentifierError(`Invalid scope: ${scopePart}`);
10441
- }
10442
- if (!namePart.endsWith("-cli")) namePart = namePart + "-cli";
10443
- if (!NAME_PATTERN.test(namePart)) throw new InvalidPackageIdentifierError(`Invalid package name: ${namePart}`);
10444
- state.scope = scopePart ? `@${scopePart}` : null;
10445
- state.name = namePart;
10446
- const managed = state.packages.find((p) => p.managed);
10447
- if (managed) {
10448
- const appBase = namePart.replace(/-cli$/, "-app");
10449
- managed.packageName = scopePart ? `@${scopePart}/${appBase}` : appBase;
10450
- managed.id = `app-${namePart}`;
10451
- }
11446
+ setSubAgentNameOperation(state, action) {
11447
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set sub-agent name when Mastra is disabled.");
11448
+ const sub = state.features.mastra.subAgents.find((s) => s.id === action.input.id);
11449
+ if (!sub) throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);
11450
+ const trimmed = action.input.name.trim();
11451
+ if (!trimmed) throw new InvalidAgentNameError("Sub-agent name must not be empty.");
11452
+ sub.name = trimmed;
11453
+ },
11454
+ setSubAgentDescriptionOperation(state, action) {
11455
+ if (!state.features.mastra.enabled) throw new MastraNotEnabledError("Cannot set sub-agent description when Mastra is disabled.");
11456
+ const sub = state.features.mastra.subAgents.find((s) => s.id === action.input.id);
11457
+ if (!sub) throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);
11458
+ sub.description = action.input.description;
10452
11459
  }
10453
11460
  };
10454
11461
  //#endregion
10455
- //#region document-models/ph-clint-project/v1/src/reducers/lifecycle.ts
10456
- const phClintProjectLifecycleOperations = { importSpecOperation(state, action) {
10457
- state.name = action.input.name;
10458
- state.scope = action.input.scope || null;
10459
- state.version = action.input.version;
10460
- state.description = action.input.description;
10461
- state.features.powerhouse = action.input.powerhouse;
10462
- state.features.mastra.enabled = action.input.mastraEnabled;
10463
- state.features.routine.enabled = action.input.routineEnabled;
10464
- const appBase = action.input.name.replace(/-cli$/, "-app");
10465
- const appPkgName = action.input.scope ? `${action.input.scope}/${appBase}` : appBase;
10466
- const phEnabled = action.input.powerhouse !== "Disabled";
10467
- state.packages = action.input.packages.map((p) => ({
10468
- id: p.id,
10469
- packageName: p.packageName,
10470
- documentTypes: [...p.documentTypes],
10471
- version: p.version || null,
10472
- managed: phEnabled && p.packageName === appPkgName
10473
- }));
10474
- state.externalSkills = action.input.externalSkills.map((s) => ({
10475
- id: s.id,
10476
- name: s.name,
10477
- githubUrl: s.githubUrl
10478
- }));
10479
- state.features.mastra.agentId = action.input.agentId || null;
10480
- state.features.mastra.agentName = action.input.agentName || null;
10481
- state.features.mastra.models = (action.input.models || []).map((m) => ({
10482
- id: m.id,
10483
- isDefault: m.isDefault
10484
- }));
10485
- state.features.mastra.profiles = (action.input.profiles || []).map((p) => ({
10486
- id: p.id,
10487
- title: p.title,
10488
- content: p.content
10489
- }));
10490
- if (action.input.agentDescription && state.features.mastra.enabled) state.features.mastra.agentDescription = action.input.agentDescription;
10491
- else state.features.mastra.agentDescription = null;
10492
- if (action.input.agentImage && state.features.mastra.enabled) {
10493
- if (!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(action.input.agentImage)) throw new InvalidAgentImageError("Invalid image: must be a data URL (data:<mime>;base64,...)");
10494
- state.features.mastra.agentImage = action.input.agentImage;
10495
- } else state.features.mastra.agentImage = null;
10496
- if (action.input.enableChat && state.features.mastra.enabled && state.features.powerhouse !== "Disabled") {
10497
- state.features.mastra.common.enableChat = true;
10498
- const CLINT_COMMON_PKG = "@powerhousedao/clint-common";
10499
- const CHAT_DOC_TYPE = "powerhouse/chat-session";
10500
- const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);
10501
- if (!existing) state.packages.push({
10502
- id: "pkg-clint-common",
10503
- packageName: CLINT_COMMON_PKG,
10504
- documentTypes: [CHAT_DOC_TYPE],
10505
- version: null,
10506
- managed: true
10507
- });
10508
- else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) existing.documentTypes.push(CHAT_DOC_TYPE);
10509
- } else state.features.mastra.common.enableChat = false;
10510
- state.deployment.proxyEnabled = action.input.proxyEnabled ?? false;
10511
- state.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;
10512
- state.deployment.supportedResources = action.input.supportedResources ? [...action.input.supportedResources] : [];
10513
- } };
10514
- //#endregion
10515
11462
  //#region document-models/ph-clint-project/v1/gen/powerhouse-packages/error.ts
10516
11463
  var DuplicatePackageError = class extends Error {
10517
11464
  errorCode = "DuplicatePackageError";
@@ -10679,66 +11626,6 @@ const stateReducer = (state, action, dispatch) => {
10679
11626
  SetPowerhouseLevelInputSchema().parse(action.input);
10680
11627
  phClintProjectFeaturesPowerhouseOperations.setPowerhouseLevelOperation(state[action.scope], action, dispatch);
10681
11628
  break;
10682
- case "ENABLE_MASTRA":
10683
- EnableMastraInputSchema().parse(action.input);
10684
- phClintProjectFeaturesMastraOperations.enableMastraOperation(state[action.scope], action, dispatch);
10685
- break;
10686
- case "DISABLE_MASTRA":
10687
- DisableMastraInputSchema().parse(action.input);
10688
- phClintProjectFeaturesMastraOperations.disableMastraOperation(state[action.scope], action, dispatch);
10689
- break;
10690
- case "SET_AGENT_ID":
10691
- SetAgentIdInputSchema().parse(action.input);
10692
- phClintProjectFeaturesMastraOperations.setAgentIdOperation(state[action.scope], action, dispatch);
10693
- break;
10694
- case "SET_AGENT_NAME":
10695
- SetAgentNameInputSchema().parse(action.input);
10696
- phClintProjectFeaturesMastraOperations.setAgentNameOperation(state[action.scope], action, dispatch);
10697
- break;
10698
- case "ADD_MODEL":
10699
- AddModelInputSchema().parse(action.input);
10700
- phClintProjectFeaturesMastraOperations.addModelOperation(state[action.scope], action, dispatch);
10701
- break;
10702
- case "REMOVE_MODEL":
10703
- RemoveModelInputSchema().parse(action.input);
10704
- phClintProjectFeaturesMastraOperations.removeModelOperation(state[action.scope], action, dispatch);
10705
- break;
10706
- case "SET_DEFAULT_MODEL":
10707
- SetDefaultModelInputSchema().parse(action.input);
10708
- phClintProjectFeaturesMastraOperations.setDefaultModelOperation(state[action.scope], action, dispatch);
10709
- break;
10710
- case "ADD_PROFILE":
10711
- AddProfileInputSchema().parse(action.input);
10712
- phClintProjectFeaturesMastraOperations.addProfileOperation(state[action.scope], action, dispatch);
10713
- break;
10714
- case "UPDATE_PROFILE":
10715
- UpdateProfileInputSchema().parse(action.input);
10716
- phClintProjectFeaturesMastraOperations.updateProfileOperation(state[action.scope], action, dispatch);
10717
- break;
10718
- case "REMOVE_PROFILE":
10719
- RemoveProfileInputSchema().parse(action.input);
10720
- phClintProjectFeaturesMastraOperations.removeProfileOperation(state[action.scope], action, dispatch);
10721
- break;
10722
- case "REORDER_PROFILES":
10723
- ReorderProfilesInputSchema().parse(action.input);
10724
- phClintProjectFeaturesMastraOperations.reorderProfilesOperation(state[action.scope], action, dispatch);
10725
- break;
10726
- case "SET_AGENT_DESCRIPTION":
10727
- SetAgentDescriptionInputSchema().parse(action.input);
10728
- phClintProjectFeaturesMastraOperations.setAgentDescriptionOperation(state[action.scope], action, dispatch);
10729
- break;
10730
- case "SET_AGENT_IMAGE":
10731
- SetAgentImageInputSchema().parse(action.input);
10732
- phClintProjectFeaturesMastraOperations.setAgentImageOperation(state[action.scope], action, dispatch);
10733
- break;
10734
- case "CLEAR_AGENT_IMAGE":
10735
- ClearAgentImageInputSchema().parse(action.input);
10736
- phClintProjectFeaturesMastraOperations.clearAgentImageOperation(state[action.scope], action, dispatch);
10737
- break;
10738
- case "SET_ENABLE_CHAT":
10739
- SetEnableChatInputSchema().parse(action.input);
10740
- phClintProjectFeaturesMastraOperations.setEnableChatOperation(state[action.scope], action, dispatch);
10741
- break;
10742
11629
  case "ENABLE_ROUTINE":
10743
11630
  EnableRoutineInputSchema().parse(action.input);
10744
11631
  phClintProjectFeaturesRoutineOperations.enableRoutineOperation(state[action.scope], action, dispatch);
@@ -10823,6 +11710,114 @@ const stateReducer = (state, action, dispatch) => {
10823
11710
  SetObservabilityEnabledInputSchema().parse(action.input);
10824
11711
  phClintProjectDeploymentOperations.setObservabilityEnabledOperation(state[action.scope], action, dispatch);
10825
11712
  break;
11713
+ case "ENABLE_MASTRA":
11714
+ EnableMastraInputSchema().parse(action.input);
11715
+ phClintProjectFeaturesMastraOperations.enableMastraOperation(state[action.scope], action, dispatch);
11716
+ break;
11717
+ case "DISABLE_MASTRA":
11718
+ DisableMastraInputSchema().parse(action.input);
11719
+ phClintProjectFeaturesMastraOperations.disableMastraOperation(state[action.scope], action, dispatch);
11720
+ break;
11721
+ case "SET_ENABLE_CHAT":
11722
+ SetEnableChatInputSchema().parse(action.input);
11723
+ phClintProjectFeaturesMastraOperations.setEnableChatOperation(state[action.scope], action, dispatch);
11724
+ break;
11725
+ case "ADD_MODEL":
11726
+ AddModelInputSchema().parse(action.input);
11727
+ phClintProjectMastraModelsOperations.addModelOperation(state[action.scope], action, dispatch);
11728
+ break;
11729
+ case "REMOVE_MODEL":
11730
+ RemoveModelInputSchema().parse(action.input);
11731
+ phClintProjectMastraModelsOperations.removeModelOperation(state[action.scope], action, dispatch);
11732
+ break;
11733
+ case "SET_DEFAULT_MODEL":
11734
+ SetDefaultModelInputSchema().parse(action.input);
11735
+ phClintProjectMastraModelsOperations.setDefaultModelOperation(state[action.scope], action, dispatch);
11736
+ break;
11737
+ case "ADD_PROFILE":
11738
+ AddProfileInputSchema().parse(action.input);
11739
+ phClintProjectMastraProfilesOperations.addProfileOperation(state[action.scope], action, dispatch);
11740
+ break;
11741
+ case "UPDATE_PROFILE":
11742
+ UpdateProfileInputSchema().parse(action.input);
11743
+ phClintProjectMastraProfilesOperations.updateProfileOperation(state[action.scope], action, dispatch);
11744
+ break;
11745
+ case "REMOVE_PROFILE":
11746
+ RemoveProfileInputSchema().parse(action.input);
11747
+ phClintProjectMastraProfilesOperations.removeProfileOperation(state[action.scope], action, dispatch);
11748
+ break;
11749
+ case "REORDER_PROFILES":
11750
+ ReorderProfilesInputSchema().parse(action.input);
11751
+ phClintProjectMastraProfilesOperations.reorderProfilesOperation(state[action.scope], action, dispatch);
11752
+ break;
11753
+ case "SET_MAIN_AGENT_NAME":
11754
+ SetMainAgentNameInputSchema().parse(action.input);
11755
+ phClintProjectMastraMainAgentOperations.setMainAgentNameOperation(state[action.scope], action, dispatch);
11756
+ break;
11757
+ case "SET_MAIN_AGENT_DESCRIPTION":
11758
+ SetMainAgentDescriptionInputSchema().parse(action.input);
11759
+ phClintProjectMastraMainAgentOperations.setMainAgentDescriptionOperation(state[action.scope], action, dispatch);
11760
+ break;
11761
+ case "CLEAR_MAIN_AGENT_DESCRIPTION":
11762
+ ClearMainAgentDescriptionInputSchema().parse(action.input);
11763
+ phClintProjectMastraMainAgentOperations.clearMainAgentDescriptionOperation(state[action.scope], action, dispatch);
11764
+ break;
11765
+ case "SET_MAIN_AGENT_IMAGE":
11766
+ SetMainAgentImageInputSchema().parse(action.input);
11767
+ phClintProjectMastraMainAgentOperations.setMainAgentImageOperation(state[action.scope], action, dispatch);
11768
+ break;
11769
+ case "CLEAR_MAIN_AGENT_IMAGE":
11770
+ ClearMainAgentImageInputSchema().parse(action.input);
11771
+ phClintProjectMastraMainAgentOperations.clearMainAgentImageOperation(state[action.scope], action, dispatch);
11772
+ break;
11773
+ case "ADD_SUB_AGENT":
11774
+ AddSubAgentInputSchema().parse(action.input);
11775
+ phClintProjectMastraSubAgentsOperations.addSubAgentOperation(state[action.scope], action, dispatch);
11776
+ break;
11777
+ case "REMOVE_SUB_AGENT":
11778
+ RemoveSubAgentInputSchema().parse(action.input);
11779
+ phClintProjectMastraSubAgentsOperations.removeSubAgentOperation(state[action.scope], action, dispatch);
11780
+ break;
11781
+ case "SET_SUB_AGENT_NAME":
11782
+ SetSubAgentNameInputSchema().parse(action.input);
11783
+ phClintProjectMastraSubAgentsOperations.setSubAgentNameOperation(state[action.scope], action, dispatch);
11784
+ break;
11785
+ case "SET_SUB_AGENT_DESCRIPTION":
11786
+ SetSubAgentDescriptionInputSchema().parse(action.input);
11787
+ phClintProjectMastraSubAgentsOperations.setSubAgentDescriptionOperation(state[action.scope], action, dispatch);
11788
+ break;
11789
+ case "SET_AGENT_MODEL":
11790
+ SetAgentModelInputSchema().parse(action.input);
11791
+ phClintProjectMastraAgentBindingsOperations.setAgentModelOperation(state[action.scope], action, dispatch);
11792
+ break;
11793
+ case "ADD_AGENT_PROFILE_REF":
11794
+ AddAgentProfileRefInputSchema().parse(action.input);
11795
+ phClintProjectMastraAgentBindingsOperations.addAgentProfileRefOperation(state[action.scope], action, dispatch);
11796
+ break;
11797
+ case "REMOVE_AGENT_PROFILE_REF":
11798
+ RemoveAgentProfileRefInputSchema().parse(action.input);
11799
+ phClintProjectMastraAgentBindingsOperations.removeAgentProfileRefOperation(state[action.scope], action, dispatch);
11800
+ break;
11801
+ case "REORDER_AGENT_PROFILE_REFS":
11802
+ ReorderAgentProfileRefsInputSchema().parse(action.input);
11803
+ phClintProjectMastraAgentBindingsOperations.reorderAgentProfileRefsOperation(state[action.scope], action, dispatch);
11804
+ break;
11805
+ case "ADD_AGENT_SKILL":
11806
+ AddAgentSkillInputSchema().parse(action.input);
11807
+ phClintProjectMastraAgentBindingsOperations.addAgentSkillOperation(state[action.scope], action, dispatch);
11808
+ break;
11809
+ case "REMOVE_AGENT_SKILL":
11810
+ RemoveAgentSkillInputSchema().parse(action.input);
11811
+ phClintProjectMastraAgentBindingsOperations.removeAgentSkillOperation(state[action.scope], action, dispatch);
11812
+ break;
11813
+ case "ADD_AGENT_TOOL_PATTERN":
11814
+ AddAgentToolPatternInputSchema().parse(action.input);
11815
+ phClintProjectMastraAgentBindingsOperations.addAgentToolPatternOperation(state[action.scope], action, dispatch);
11816
+ break;
11817
+ case "REMOVE_AGENT_TOOL_PATTERN":
11818
+ RemoveAgentToolPatternInputSchema().parse(action.input);
11819
+ phClintProjectMastraAgentBindingsOperations.removeAgentToolPatternOperation(state[action.scope], action, dispatch);
11820
+ break;
10826
11821
  default: return state;
10827
11822
  }
10828
11823
  };
@@ -10876,10 +11871,8 @@ const initialGlobalState = {
10876
11871
  powerhouse: "Disabled",
10877
11872
  mastra: {
10878
11873
  enabled: false,
10879
- agentId: null,
10880
- agentName: null,
10881
- agentDescription: null,
10882
- agentImage: null,
11874
+ mainAgent: null,
11875
+ subAgents: [],
10883
11876
  models: [],
10884
11877
  profiles: [],
10885
11878
  common: { enableChat: false }
@@ -10963,6 +11956,6 @@ const PhClintProject = {
10963
11956
  documentModel: createState(defaultBaseState(), documentModel)
10964
11957
  };
10965
11958
  //#endregion
10966
- export { setDefaultModel as $, SetAgentDescriptionInputSchema as $t, importSpec as A, createReducer as An, PhClintAgentModelSchema as At, addModel as B, validateInitialState as Bn, PublishDevInputSchema as Bt, addPackageDocumentType as C, baseCreateDocument as Cn, EnableRoutineInputSchema as Ct, removePowerhousePackage as D, createAction as Dn, ImportProfileInputSchema as Dt, removePackageDocumentType as E, buildSignedAction as En, ImportPackageInputSchema as Et, creators_exports$4 as F, isDocumentAction as Fn, PhClintMastraFeatureSchema as Ft, enableMastra as G, any as Gn, PublishTagSchema as Gt, clearAgentImage as H, validateStateSchemaName as Hn, PublishRecordSchema as Ht, disableRoutine as I, redo as In, PhClintProjectStateSchema as It, reorderProfiles as J, literal as Jn, RemovePackageDocumentTypeInputSchema as Jt, removeModel as K, array as Kn, RemoveExternalSkillInputSchema as Kt, enableRoutine as L, replayDocument as Ln, PhClintRoutineFeatureSchema as Lt, setDescription as M, createZip as Mn, PhClintDeploymentSchema as Mt, setPackageIdentifier as N, defaultBaseState as Nn, PhClintFeaturesSchema as Nt, setPackageVersion as O, createBaseState as On, ImportSkillInputSchema as Ot, setVersion as P, documentModelDocumentType as Pn, PhClintMastraCommonSchema as Pt, setAgentName as Q, generateId as Qn, ReorderProfilesInputSchema as Qt, creators_exports$5 as R, setName as Rn, PowerhouseLevelSchema as Rt, setPublishStatus as S, BaseDocumentStateSchema as Sn, EnableMastraInputSchema as St, creators_exports$1 as T, baseSaveToFileHandle as Tn, ImportModelInputSchema as Tt, creators_exports$6 as U, capitalCase as Un, PublishStagingInputSchema as Ut, addProfile as V, validateModules as Vn, PublishProductionInputSchema as Vt, disableMastra as W, _enum as Wn, PublishStatusSchema as Wt, setAgentId as X, string as Xn, RemoveProfileInputSchema as Xt, setAgentDescription as Y, object as Yn, RemovePowerhousePackageInputSchema as Yt, setAgentImage as Z, union as Zn, RemoveSupportedResourceInputSchema as Zt, bumpVersion as _, isDefinedNonNullAny as _n, AddSupportedResourceInputSchema as _t, utils$1 as a, SetEnableChatInputSchema as an, setExternalSkillGithubUrl as at, publishProduction as b, logger as bn, DisableMastraInputSchema as bt, PhClintProjectPHStateSchema as c, SetObservabilityEnabledInputSchema as cn, creators_exports$8 as ct, isPhClintProjectDocument as d, SetPowerhouseLevelInputSchema as dn, setProxyEnabled as dt, SetAgentIdInputSchema as en, setEnableChat as et, isPhClintProjectState as f, SetProxyEnabledInputSchema as fn, AddExternalSkillInputSchema as ft, actions as g, definedNonNullAnySchema as gn, AddProfileInputSchema as gt, documentModel as h, UpdateProfileInputSchema as hn, AddPowerhousePackageInputSchema as ht, initialLocalState as i, SetDescriptionInputSchema as in, removeExternalSkill as it, creators_exports$3 as j, createState as jn, PhClintAgentProfileSchema as jt, creators_exports$2 as k, createPresignedHeader as kn, ImportSpecInputSchema as kt, assertIsPhClintProjectDocument as l, SetPackageIdentifierInputSchema as ln, removeSupportedResource as lt, reducer as m, SetVersionInputSchema as mn, AddPackageDocumentTypeInputSchema as mt, utils as n, SetAgentNameInputSchema as nn, addExternalSkill as nt, PhClintProjectDocumentHeaderSchema as o, SetExternalSkillGithubUrlInputSchema as on, setExternalSkillName as ot, phClintProjectDocumentType as p, SetPublishStatusInputSchema as pn, AddModelInputSchema as pt, removeProfile as q, boolean as qn, RemoveModelInputSchema as qt, initialGlobalState as r, SetDefaultModelInputSchema as rn, creators_exports$7 as rt, PhClintProjectDocumentSchema as s, SetExternalSkillNameInputSchema as sn, addSupportedResource as st, PhClintProject as t, SetAgentImageInputSchema as tn, updateProfile as tt, assertIsPhClintProjectState as u, SetPackageVersionInputSchema as un, setObservabilityEnabled as ut, creators_exports as v, PHDocumentController as vn, BumpVersionInputSchema as vt, addPowerhousePackage as w, baseLoadFromInput as wn, ExternalSkillSchema as wt, publishStaging as x, BaseDocumentHeaderSchema as xn, DisableRoutineInputSchema as xt, publishDev as y, documentModelDocumentModelModule as yn, ClearAgentImageInputSchema as yt, setPowerhouseLevel as z, undo as zn, PowerhousePackageSchema as zt };
11959
+ export { removeAgentProfileRef as $, logger as $n, ImportSubAgentInputSchema as $t, creators_exports$2 as A, SetAgentModelInputSchema as An, union as Ar, AddAgentSkillInputSchema as At, creators_exports$4 as B, SetPackageIdentifierInputSchema as Bn, ClearMainAgentDescriptionInputSchema as Bt, addPackageDocumentType as C, RemovePackageDocumentTypeInputSchema as Cn, _enum as Cr, setExternalSkillName as Ct, removePowerhousePackage as D, RemoveSupportedResourceInputSchema as Dn, literal as Dr, setObservabilityEnabled as Dt, removePackageDocumentType as E, RemoveSubAgentInputSchema as En, boolean as Er, removeSupportedResource as Et, creators_exports$3 as F, SetExternalSkillNameInputSchema as Fn, AddPowerhousePackageInputSchema as Ft, creators_exports$5 as G, SetSubAgentDescriptionInputSchema as Gn, EnableRoutineInputSchema as Gt, setDefaultModel as H, SetPowerhouseLevelInputSchema as Hn, DisableMastraInputSchema as Ht, removeProfile as I, SetMainAgentDescriptionInputSchema as In, AddProfileInputSchema as It, setMainAgentName as J, UpdateProfileInputSchema as Jn, ImportModelInputSchema as Jt, setMainAgentDescription as K, SetSubAgentNameInputSchema as Kn, ExternalSkillSchema as Kt, reorderProfiles as L, SetMainAgentImageInputSchema as Ln, AddSubAgentInputSchema as Lt, setSubAgentDescription as M, SetDescriptionInputSchema as Mn, AddExternalSkillInputSchema as Mt, setSubAgentName as N, SetEnableChatInputSchema as Nn, AddModelInputSchema as Nt, setPackageVersion as O, ReorderAgentProfileRefsInputSchema as On, object as Or, setProxyEnabled as Ot, addProfile as P, SetExternalSkillGithubUrlInputSchema as Pn, AddPackageDocumentTypeInputSchema as Pt, creators_exports$6 as Q, documentModelDocumentModelModule as Qn, ImportSpecInputSchema as Qt, updateProfile as R, SetMainAgentNameInputSchema as Rn, AddSupportedResourceInputSchema as Rt, setPublishStatus as S, RemoveModelInputSchema as Sn, capitalCase as Sr, setExternalSkillGithubUrl as St, creators_exports$1 as T, RemoveProfileInputSchema as Tn, array as Tr, creators_exports$13 as Tt, clearMainAgentDescription as U, SetProxyEnabledInputSchema as Un, DisableRoutineInputSchema as Ut, removeModel as V, SetPackageVersionInputSchema as Vn, ClearMainAgentImageInputSchema as Vt, clearMainAgentImage as W, SetPublishStatusInputSchema as Wn, EnableMastraInputSchema as Wt, addAgentSkill as X, isDefinedNonNullAny as Xn, ImportProfileInputSchema as Xt, addAgentProfileRef as Y, definedNonNullAnySchema as Yn, ImportPackageInputSchema as Yt, addAgentToolPattern as Z, PHDocumentController as Zn, ImportSkillInputSchema as Zt, bumpVersion as _, PublishTagSchema as _n, setName as _r, enableMastra as _t, utils$1 as a, PhClintMastraCommonSchema as an, buildSignedAction as ar, importSpec as at, publishProduction as b, RemoveAgentToolPatternInputSchema as bn, validateModules as br, creators_exports$12 as bt, PhClintProjectPHStateSchema as c, PhClintRoutineFeatureSchema as cn, createPresignedHeader as cr, setPackageIdentifier as ct, isPhClintProjectDocument as d, PowerhousePackageSchema as dn, createZip as dr, disableRoutine as dt, PhClintAgentModelSchema as en, BaseDocumentHeaderSchema as er, removeAgentSkill as et, isPhClintProjectState as f, PublishDevInputSchema as fn, defaultBaseState as fr, enableRoutine as ft, actions as g, PublishStatusSchema as gn, replayDocument as gr, disableMastra as gt, documentModel as h, PublishStagingInputSchema as hn, redo as hr, creators_exports$11 as ht, initialLocalState as i, PhClintMainAgentSchema as in, baseSaveToFileHandle as ir, creators_exports$7 as it, removeSubAgent as j, SetDefaultModelInputSchema as jn, generateId as jr, AddAgentToolPatternInputSchema as jt, addSubAgent as k, ReorderProfilesInputSchema as kn, string as kr, AddAgentProfileRefInputSchema as kt, assertIsPhClintProjectDocument as l, PhClintSubAgentSchema as ln, createReducer as lr, setVersion as lt, reducer as m, PublishRecordSchema as mn, isDocumentAction as mr, setPowerhouseLevel as mt, utils as n, PhClintDeploymentSchema as nn, baseCreateDocument as nr, reorderAgentProfileRefs as nt, PhClintProjectDocumentHeaderSchema as o, PhClintMastraFeatureSchema as on, createAction as or, creators_exports$8 as ot, phClintProjectDocumentType as p, PublishProductionInputSchema as pn, documentModelDocumentType as pr, creators_exports$10 as pt, setMainAgentImage as q, SetVersionInputSchema as qn, ImportMainAgentInputSchema as qt, initialGlobalState as r, PhClintFeaturesSchema as rn, baseLoadFromInput as rr, setAgentModel as rt, PhClintProjectDocumentSchema as s, PhClintProjectStateSchema as sn, createBaseState as sr, setDescription as st, PhClintProject as t, PhClintAgentProfileSchema as tn, BaseDocumentStateSchema as tr, removeAgentToolPattern as tt, assertIsPhClintProjectState as u, PowerhouseLevelSchema as un, createState as ur, creators_exports$9 as ut, creators_exports as v, RemoveAgentProfileRefInputSchema as vn, undo as vr, setEnableChat as vt, addPowerhousePackage as w, RemovePowerhousePackageInputSchema as wn, any as wr, addSupportedResource as wt, publishStaging as x, RemoveExternalSkillInputSchema as xn, validateStateSchemaName as xr, removeExternalSkill as xt, publishDev as y, RemoveAgentSkillInputSchema as yn, validateInitialState as yr, addExternalSkill as yt, addModel as z, SetObservabilityEnabledInputSchema as zn, BumpVersionInputSchema as zt };
10967
11960
 
10968
- //# sourceMappingURL=module-DoAlHsjp.js.map
11961
+ //# sourceMappingURL=module-K5q3UobV.js.map