@powerhousedao/ph-clint-app 0.1.0-dev.73 → 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.
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/document-models/ph-clint-project/index.js +3 -3
- package/dist/browser/{editor-DL0W2XOS.js → editor-CAZmaheq.js} +825 -261
- package/dist/browser/{editor-DL0W2XOS.js.map → editor-CAZmaheq.js.map} +1 -1
- package/dist/browser/editors/ph-clint-project-editor/module.js +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{module-DoAlHsjp.js → module-K5q3UobV.js} +1970 -977
- package/dist/browser/module-K5q3UobV.js.map +1 -0
- package/dist/browser/{ph-clint-project-D634z5c5.js → ph-clint-project-Bbl7jqNw.js} +4 -6
- package/dist/browser/ph-clint-project-Bbl7jqNw.js.map +1 -0
- package/dist/connect/assets/editor-CQqCB-3d.js +2 -0
- package/dist/connect/assets/editor-CQqCB-3d.js.map +1 -0
- package/dist/connect/assets/{index-BXAErAWR.js → index-DmrNLi1C.js} +20 -20
- package/dist/connect/assets/index-DmrNLi1C.js.map +1 -0
- package/dist/connect/assets/index-cjUwUwMU.css +2 -0
- package/dist/connect/assets/ph-clint-project-DZ_ZplDv.js +1142 -0
- package/dist/connect/assets/ph-clint-project-DZ_ZplDv.js.map +1 -0
- package/dist/connect/index.html +3 -3
- package/dist/connect/ph-packages.json +1 -1
- package/dist/document-models/document-models.d.ts +1 -1
- package/dist/document-models/index.d.ts +1 -1
- package/dist/document-models/ph-clint-project/index.d.ts +2 -2
- package/dist/document-models/ph-clint-project/upgrades/index.d.ts +2 -2
- package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts +2 -2
- package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/actions.d.ts +28 -16
- package/dist/document-models/ph-clint-project/v1/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts +29 -19
- package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts +28 -18
- package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts +6 -6
- package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts +6 -6
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts +6 -54
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts +2 -14
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts +1 -78
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts +3 -15
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/actions.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts +4 -4
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts +5 -5
- package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/index.d.ts +25 -20
- package/dist/document-models/ph-clint-project/v1/gen/index.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/actions.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts +13 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts +40 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts +11 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts +79 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts +18 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts +28 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts +8 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts +36 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts +15 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts +20 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts +6 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts +41 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts +13 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts +24 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts +7 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts +46 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts +14 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts +24 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts +7 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts +51 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts +14 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts +7 -7
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts +7 -7
- package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/index.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts +214 -129
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts +23 -7
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/types.d.ts +5 -5
- package/dist/document-models/ph-clint-project/v1/gen/types.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/hooks.d.ts +6 -3
- package/dist/document-models/ph-clint-project/v1/hooks.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/index.d.ts +6 -6
- package/dist/document-models/ph-clint-project/v1/module.d.ts +28 -16
- package/dist/document-models/ph-clint-project/v1/module.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/index.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/utils.d.ts +2 -2
- package/dist/document-models/upgrade-manifests.d.ts +1 -1
- package/dist/document-models/upgrade-manifests.d.ts.map +1 -1
- package/dist/editors/ph-clint-project-editor/editor.d.ts.map +1 -1
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/document-models/ph-clint-project/index.mjs +3 -3
- package/dist/node/{editor-mM5FSNXc.mjs → editor-DOw2BwlR.mjs} +825 -261
- package/dist/node/{editor-mM5FSNXc.mjs.map → editor-DOw2BwlR.mjs.map} +1 -1
- package/dist/node/editors/ph-clint-project-editor/module.mjs +1 -1
- package/dist/node/index.mjs +3 -3
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{module-DayL4J7r.mjs → module-DTtUZ4DR.mjs} +1970 -977
- package/dist/node/module-DTtUZ4DR.mjs.map +1 -0
- package/dist/node/{ph-clint-project-Btx_kiiQ.mjs → ph-clint-project-DFA4zHJv.mjs} +4 -6
- package/dist/node/ph-clint-project-DFA4zHJv.mjs.map +1 -0
- package/dist/style.css +27 -30
- package/package.json +1 -1
- package/dist/browser/module-DoAlHsjp.js.map +0 -1
- package/dist/browser/ph-clint-project-D634z5c5.js.map +0 -1
- package/dist/connect/assets/editor-DgkuaKuV.js +0 -2
- package/dist/connect/assets/editor-DgkuaKuV.js.map +0 -1
- package/dist/connect/assets/index-BSq-9kCR.css +0 -2
- package/dist/connect/assets/index-BXAErAWR.js.map +0 -1
- package/dist/connect/assets/ph-clint-project-BRYYVNTj.js +0 -758
- package/dist/connect/assets/ph-clint-project-BRYYVNTj.js.map +0 -1
- package/dist/node/module-DayL4J7r.mjs.map +0 -1
- package/dist/node/ph-clint-project-Btx_kiiQ.mjs.map +0 -1
|
@@ -0,0 +1,1142 @@
|
|
|
1
|
+
import{r as e}from"./chunk-zsgVPwQN.js";import{$ as t,At as n,Ct as r,Dt as i,Et as a,K as ee,Mt as o,Nt as s,Pt as te,Q as ne,St as re,Tt as c,Z as ie,at as ae,ct as oe,et as se,it as l,kt as u,nt as ce,pt as le,st as ue,tt as de,ut as fe,wt as d}from"./lz-string-CSbzFwDi.js";import{G as pe,K as me,Mt as he,dt as ge}from"./dist-BzAXfaNf.js";var _e=e=>e!=null,ve=r().refine(e=>_e(e)),f=re([`Connect`,`Disabled`,`Reactor`,`Switchboard`]),ye=re([`Failed`,`InProgress`,`Pending`,`Succeeded`]),be=re([`Dev`,`Production`,`Staging`]);function xe(){return u({agentId:n(),insertBefore:n().nullish(),profileId:n()})}function Se(){return u({agentId:n(),name:n()})}function Ce(){return u({agentId:n(),pattern:n()})}function we(){return u({githubUrl:o(),id:n(),name:n()})}function Te(){return u({id:n(),isDefault:c().nullish()})}function Ee(){return u({documentType:n(),packageId:n()})}function De(){return u({id:n(),packageName:n()})}function Oe(){return u({content:n(),id:n(),insertBefore:n().nullish(),title:n()})}function ke(){return u({description:n(),id:n(),modelId:n(),name:n()})}function Ae(){return u({resource:n()})}function je(){return u({version:n()})}function Me(){return u({_:c().nullish()})}function Ne(){return u({_:c().nullish()})}function Pe(){return u({_:c().nullish()})}function Fe(){return u({_:c().nullish()})}function Ie(){return u({agentId:n(),agentName:n()})}function Le(){return u({_:c().nullish()})}function Re(){return u({__typename:i(`ExternalSkill`).optional(),githubUrl:o(),id:n(),name:n()})}function ze(){return u({description:n().nullish(),id:n(),image:n().nullish(),modelId:n(),name:n(),profileIds:d(n()),skills:d(n()),toolPatterns:d(n())})}function Be(){return u({id:n(),isDefault:c()})}function Ve(){return u({documentTypes:d(n()),id:n(),packageName:n(),version:n().nullish()})}function He(){return u({content:n(),id:n(),title:n()})}function Ue(){return u({githubUrl:o(),id:n(),name:n()})}function p(){return u({description:n(),enableChat:c().nullish(),externalSkills:d(a(()=>Ue())),mainAgent:a(()=>ze().nullish()),mastraEnabled:c(),models:d(a(()=>Be())),name:n(),observabilityEnabled:c().nullish(),packages:d(a(()=>Ve())),powerhouse:f,profiles:d(a(()=>He())),proxyEnabled:c().nullish(),routineEnabled:c(),scope:n().nullish(),subAgents:d(a(()=>We())),supportedResources:d(n()).nullish(),version:n()})}function We(){return u({description:n(),id:n(),modelId:n(),name:n(),profileIds:d(n()),skills:d(n()),toolPatterns:d(n())})}function Ge(){return u({__typename:i(`PhClintAgentModel`).optional(),id:n(),isDefault:c()})}function Ke(){return u({__typename:i(`PhClintAgentProfile`).optional(),content:n(),id:n(),title:n()})}function qe(){return u({__typename:i(`PhClintDeployment`).optional(),observabilityEnabled:c(),proxyEnabled:c(),supportedResources:d(n())})}function Je(){return u({__typename:i(`PhClintFeatures`).optional(),mastra:a(()=>Ze()),powerhouse:f,routine:a(()=>$e())})}function Ye(){return u({__typename:i(`PhClintMainAgent`).optional(),description:n().nullish(),id:n(),image:n().nullish(),modelId:n(),name:n(),profileIds:d(n()),skills:d(n()),toolPatterns:d(n())})}function Xe(){return u({__typename:i(`PhClintMastraCommon`).optional(),enableChat:c()})}function Ze(){return u({__typename:i(`PhClintMastraFeature`).optional(),common:a(()=>Xe()),enabled:c(),mainAgent:a(()=>Ye().nullish()),models:d(a(()=>Ge())),profiles:d(a(()=>Ke())),subAgents:d(a(()=>et()))})}function Qe(){return u({__typename:i(`PhClintProjectState`).optional(),deployment:a(()=>qe()),description:n(),externalSkills:d(a(()=>Re())),features:a(()=>Je()),name:n().nullish(),packages:d(a(()=>tt())),publishHistory:d(a(()=>nt())),scope:n().nullish(),version:n()})}function $e(){return u({__typename:i(`PhClintRoutineFeature`).optional(),enabled:c()})}function et(){return u({__typename:i(`PhClintSubAgent`).optional(),description:n(),id:n(),modelId:n(),name:n(),profileIds:d(n()),skills:d(n()),toolPatterns:d(n())})}function tt(){return u({__typename:i(`PowerhousePackage`).optional(),documentTypes:d(n()),id:n(),managed:c(),packageName:n(),version:n().nullish()})}function m(){return u({id:n(),timestamp:s()})}function h(){return u({id:n(),timestamp:s()})}function nt(){return u({__typename:i(`PublishRecord`).optional(),id:n(),status:ye,tag:be,timestamp:s(),version:n()})}function g(){return u({id:n(),timestamp:s()})}function _(){return u({agentId:n(),profileId:n()})}function v(){return u({agentId:n(),name:n()})}function y(){return u({agentId:n(),pattern:n()})}function b(){return u({id:n()})}function x(){return u({id:n()})}function S(){return u({documentType:n(),packageId:n()})}function C(){return u({id:n()})}function w(){return u({id:n()})}function T(){return u({id:n()})}function E(){return u({resource:n()})}function D(){return u({agentId:n(),ids:d(n()),insertBefore:n().nullish()})}function O(){return u({ids:d(n()),insertBefore:n().nullish()})}function k(){return u({agentId:n(),modelId:n()})}function A(){return u({id:n()})}function j(){return u({description:n()})}function M(){return u({enabled:c()})}function rt(){return u({githubUrl:o(),id:n()})}function it(){return u({id:n(),name:n()})}function at(){return u({description:n()})}function ot(){return u({image:n()})}function st(){return u({name:n()})}function ct(){return u({enabled:c()})}function lt(){return u({identifier:n()})}function ut(){return u({packageId:n(),version:n().nullish()})}function dt(){return u({level:f,skipAutoProxy:c().nullish()})}function ft(){return u({enabled:c()})}function pt(){return u({id:n(),status:ye})}function mt(){return u({description:n(),id:n()})}function ht(){return u({id:n(),name:n()})}function gt(){return u({version:n()})}function _t(){return u({content:n().nullish(),id:n(),title:n().nullish()})}var vt=e({addSupportedResource:()=>yt,removeSupportedResource:()=>bt,setObservabilityEnabled:()=>St,setProxyEnabled:()=>xt}),yt=e=>l(`ADD_SUPPORTED_RESOURCE`,{...e},void 0,Ae,`global`),bt=e=>l(`REMOVE_SUPPORTED_RESOURCE`,{...e},void 0,E,`global`),xt=e=>l(`SET_PROXY_ENABLED`,{...e},void 0,ft,`global`),St=e=>l(`SET_OBSERVABILITY_ENABLED`,{...e},void 0,ct,`global`),Ct=e({addExternalSkill:()=>wt,removeExternalSkill:()=>Tt,setExternalSkillGithubUrl:()=>Dt,setExternalSkillName:()=>Et}),wt=e=>l(`ADD_EXTERNAL_SKILL`,{...e},void 0,we,`global`),Tt=e=>l(`REMOVE_EXTERNAL_SKILL`,{...e},void 0,b,`global`),Et=e=>l(`SET_EXTERNAL_SKILL_NAME`,{...e},void 0,it,`global`),Dt=e=>l(`SET_EXTERNAL_SKILL_GITHUB_URL`,{...e},void 0,rt,`global`),Ot=e({disableMastra:()=>At,enableMastra:()=>kt,setEnableChat:()=>jt}),kt=e=>l(`ENABLE_MASTRA`,{...e},void 0,Ie,`global`),At=e=>l(`DISABLE_MASTRA`,{...e},void 0,Pe,`global`),jt=e=>l(`SET_ENABLE_CHAT`,{...e},void 0,M,`global`),Mt=e({setPowerhouseLevel:()=>Nt}),Nt=e=>l(`SET_POWERHOUSE_LEVEL`,{...e},void 0,dt,`global`),Pt=e({disableRoutine:()=>It,enableRoutine:()=>Ft}),Ft=e=>l(`ENABLE_ROUTINE`,{...e},void 0,Le,`global`),It=e=>l(`DISABLE_ROUTINE`,{...e},void 0,Fe,`global`),Lt=e({setDescription:()=>Rt,setPackageIdentifier:()=>Bt,setVersion:()=>zt}),Rt=e=>l(`SET_DESCRIPTION`,{...e},void 0,j,`global`),zt=e=>l(`SET_VERSION`,{...e},void 0,gt,`global`),Bt=e=>l(`SET_PACKAGE_IDENTIFIER`,{...e},void 0,lt,`global`),Vt=e({importSpec:()=>Ht}),Ht=e=>l(`IMPORT_SPEC`,{...e},void 0,p,`global`),Ut=e({addAgentProfileRef:()=>Gt,addAgentSkill:()=>Jt,addAgentToolPattern:()=>Xt,removeAgentProfileRef:()=>Kt,removeAgentSkill:()=>Yt,removeAgentToolPattern:()=>Zt,reorderAgentProfileRefs:()=>qt,setAgentModel:()=>Wt}),Wt=e=>l(`SET_AGENT_MODEL`,{...e},void 0,k,`global`),Gt=e=>l(`ADD_AGENT_PROFILE_REF`,{...e},void 0,xe,`global`),Kt=e=>l(`REMOVE_AGENT_PROFILE_REF`,{...e},void 0,_,`global`),qt=e=>l(`REORDER_AGENT_PROFILE_REFS`,{...e},void 0,D,`global`),Jt=e=>l(`ADD_AGENT_SKILL`,{...e},void 0,Se,`global`),Yt=e=>l(`REMOVE_AGENT_SKILL`,{...e},void 0,v,`global`),Xt=e=>l(`ADD_AGENT_TOOL_PATTERN`,{...e},void 0,Ce,`global`),Zt=e=>l(`REMOVE_AGENT_TOOL_PATTERN`,{...e},void 0,y,`global`),Qt=e({clearMainAgentDescription:()=>tn,clearMainAgentImage:()=>rn,setMainAgentDescription:()=>en,setMainAgentImage:()=>nn,setMainAgentName:()=>$t}),$t=e=>l(`SET_MAIN_AGENT_NAME`,{...e},void 0,st,`global`),en=e=>l(`SET_MAIN_AGENT_DESCRIPTION`,{...e},void 0,at,`global`),tn=e=>l(`CLEAR_MAIN_AGENT_DESCRIPTION`,{...e},void 0,Me,`global`),nn=e=>l(`SET_MAIN_AGENT_IMAGE`,{...e},void 0,ot,`global`),rn=e=>l(`CLEAR_MAIN_AGENT_IMAGE`,{...e},void 0,Ne,`global`),an=e({addModel:()=>on,removeModel:()=>sn,setDefaultModel:()=>cn}),on=e=>l(`ADD_MODEL`,{...e},void 0,Te,`global`),sn=e=>l(`REMOVE_MODEL`,{...e},void 0,x,`global`),cn=e=>l(`SET_DEFAULT_MODEL`,{...e},void 0,A,`global`),ln=e({addProfile:()=>un,removeProfile:()=>fn,reorderProfiles:()=>pn,updateProfile:()=>dn}),un=e=>l(`ADD_PROFILE`,{...e},void 0,Oe,`global`),dn=e=>l(`UPDATE_PROFILE`,{...e},void 0,_t,`global`),fn=e=>l(`REMOVE_PROFILE`,{...e},void 0,w,`global`),pn=e=>l(`REORDER_PROFILES`,{...e},void 0,O,`global`),mn=e({addSubAgent:()=>hn,removeSubAgent:()=>gn,setSubAgentDescription:()=>vn,setSubAgentName:()=>_n}),hn=e=>l(`ADD_SUB_AGENT`,{...e},void 0,ke,`global`),gn=e=>l(`REMOVE_SUB_AGENT`,{...e},void 0,T,`global`),_n=e=>l(`SET_SUB_AGENT_NAME`,{...e},void 0,ht,`global`),vn=e=>l(`SET_SUB_AGENT_DESCRIPTION`,{...e},void 0,mt,`global`),yn=e({addPackageDocumentType:()=>Sn,addPowerhousePackage:()=>bn,removePackageDocumentType:()=>Cn,removePowerhousePackage:()=>xn,setPackageVersion:()=>wn}),bn=e=>l(`ADD_POWERHOUSE_PACKAGE`,{...e},void 0,De,`global`),xn=e=>l(`REMOVE_POWERHOUSE_PACKAGE`,{...e},void 0,C,`global`),Sn=e=>l(`ADD_PACKAGE_DOCUMENT_TYPE`,{...e},void 0,Ee,`global`),Cn=e=>l(`REMOVE_PACKAGE_DOCUMENT_TYPE`,{...e},void 0,S,`global`),wn=e=>l(`SET_PACKAGE_VERSION`,{...e},void 0,ut,`global`),Tn=e({bumpVersion:()=>En,publishDev:()=>Dn,publishProduction:()=>kn,publishStaging:()=>On,setPublishStatus:()=>An}),En=e=>l(`BUMP_VERSION`,{...e},void 0,je,`global`),Dn=e=>l(`PUBLISH_DEV`,{...e},void 0,m,`global`),On=e=>l(`PUBLISH_STAGING`,{...e},void 0,g,`global`),kn=e=>l(`PUBLISH_PRODUCTION`,{...e},void 0,h,`global`),An=e=>l(`SET_PUBLISH_STATUS`,{...e},void 0,pt,`global`),jn={...t,...Lt,...Mt,...Pt,...yn,...Ct,...Tn,...Vt,...vt,...Ot,...an,...ln,...Qt,...mn,...Ut},Mn={id:`powerhouse/ph-clint-project`,name:`PhClintProject`,author:{name:`Powerhouse Inc.`,website:`https://powerhouse.inc`},extension:`pcp`,description:`A ph-clint implementation project specification. Drives code generation of a ph-clint CLI project: identity fields (name, scope, version, description, bin) plus three feature toggles (Powerhouse, Mastra, Routine). Enabling Powerhouse is irreversible; enabling Mastra auto-enables Routine; disabling Routine is blocked while Mastra is on.`,specifications:[{state:{local:{schema:``,examples:[],initialValue:``},global:{schema:`type PhClintProjectState {
|
|
2
|
+
name: String
|
|
3
|
+
scope: String
|
|
4
|
+
version: String!
|
|
5
|
+
description: String!
|
|
6
|
+
features: PhClintFeatures!
|
|
7
|
+
packages: [PowerhousePackage!]!
|
|
8
|
+
externalSkills: [ExternalSkill!]!
|
|
9
|
+
publishHistory: [PublishRecord!]!
|
|
10
|
+
deployment: PhClintDeployment!
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type PhClintFeatures {
|
|
14
|
+
powerhouse: PowerhouseLevel!
|
|
15
|
+
mastra: PhClintMastraFeature!
|
|
16
|
+
routine: PhClintRoutineFeature!
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
enum PowerhouseLevel {
|
|
20
|
+
Disabled
|
|
21
|
+
Reactor
|
|
22
|
+
Switchboard
|
|
23
|
+
Connect
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type PhClintMastraFeature {
|
|
27
|
+
enabled: Boolean!
|
|
28
|
+
mainAgent: PhClintMainAgent
|
|
29
|
+
subAgents: [PhClintSubAgent!]!
|
|
30
|
+
models: [PhClintAgentModel!]!
|
|
31
|
+
profiles: [PhClintAgentProfile!]!
|
|
32
|
+
common: PhClintMastraCommon!
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type PhClintMainAgent {
|
|
36
|
+
id: OID!
|
|
37
|
+
name: String!
|
|
38
|
+
description: String
|
|
39
|
+
image: String
|
|
40
|
+
modelId: OID!
|
|
41
|
+
profileIds: [OID!]!
|
|
42
|
+
skills: [String!]!
|
|
43
|
+
toolPatterns: [String!]!
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type PhClintSubAgent {
|
|
47
|
+
id: OID!
|
|
48
|
+
name: String!
|
|
49
|
+
description: String!
|
|
50
|
+
modelId: OID!
|
|
51
|
+
profileIds: [OID!]!
|
|
52
|
+
skills: [String!]!
|
|
53
|
+
toolPatterns: [String!]!
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type PhClintMastraCommon {
|
|
57
|
+
enableChat: Boolean!
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type PhClintAgentModel {
|
|
61
|
+
id: OID!
|
|
62
|
+
isDefault: Boolean!
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type PhClintAgentProfile {
|
|
66
|
+
id: OID!
|
|
67
|
+
title: String!
|
|
68
|
+
content: String!
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type PhClintRoutineFeature {
|
|
72
|
+
enabled: Boolean!
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type PowerhousePackage {
|
|
76
|
+
id: OID!
|
|
77
|
+
packageName: String!
|
|
78
|
+
documentTypes: [String!]!
|
|
79
|
+
version: String
|
|
80
|
+
managed: Boolean!
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type ExternalSkill {
|
|
84
|
+
id: OID!
|
|
85
|
+
name: String!
|
|
86
|
+
githubUrl: URL!
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
enum PublishTag {
|
|
90
|
+
Dev
|
|
91
|
+
Staging
|
|
92
|
+
Production
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
enum PublishStatus {
|
|
96
|
+
Pending
|
|
97
|
+
InProgress
|
|
98
|
+
Succeeded
|
|
99
|
+
Failed
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
type PublishRecord {
|
|
103
|
+
id: OID!
|
|
104
|
+
tag: PublishTag!
|
|
105
|
+
version: String!
|
|
106
|
+
timestamp: DateTime!
|
|
107
|
+
status: PublishStatus!
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type PhClintDeployment {
|
|
111
|
+
proxyEnabled: Boolean!
|
|
112
|
+
observabilityEnabled: Boolean!
|
|
113
|
+
supportedResources: [String!]!
|
|
114
|
+
}`,examples:[],initialValue:`{
|
|
115
|
+
"name": null,
|
|
116
|
+
"scope": null,
|
|
117
|
+
"version": "0.1.0",
|
|
118
|
+
"description": "",
|
|
119
|
+
"features": {
|
|
120
|
+
"powerhouse": "Disabled",
|
|
121
|
+
"mastra": {
|
|
122
|
+
"enabled": false,
|
|
123
|
+
"mainAgent": null,
|
|
124
|
+
"subAgents": [],
|
|
125
|
+
"models": [],
|
|
126
|
+
"profiles": [],
|
|
127
|
+
"common": { "enableChat": false }
|
|
128
|
+
},
|
|
129
|
+
"routine": { "enabled": false }
|
|
130
|
+
},
|
|
131
|
+
"packages": [],
|
|
132
|
+
"externalSkills": [],
|
|
133
|
+
"publishHistory": [],
|
|
134
|
+
"deployment": {
|
|
135
|
+
"proxyEnabled": false,
|
|
136
|
+
"observabilityEnabled": false,
|
|
137
|
+
"supportedResources": [
|
|
138
|
+
"vetra-agent-s",
|
|
139
|
+
"vetra-agent-m",
|
|
140
|
+
"vetra-agent-l",
|
|
141
|
+
"vetra-agent-xl",
|
|
142
|
+
"vetra-agent-xxl"
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
}`}},modules:[{id:`m-identity`,name:`identity`,description:`Package identity fields: name, scope, version, description, bin`,operations:[{id:`o-set-description`,name:`SET_DESCRIPTION`,description:`Set the package description.`,schema:`input SetDescriptionInput {
|
|
146
|
+
description: String!
|
|
147
|
+
}`,template:`Set the package description.`,reducer:`state.description = action.input.description;`,errors:[],examples:[],scope:`global`},{id:`o-set-version`,name:`SET_VERSION`,description:`Set the package version. Must be a valid semver string.`,schema:`input SetVersionInput {
|
|
148
|
+
version: String!
|
|
149
|
+
}`,template:`Set the package version. Must be a valid semver string.`,reducer:`if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {
|
|
150
|
+
throw new InvalidVersionError(\`Invalid version: \${action.input.version}\`);
|
|
151
|
+
}
|
|
152
|
+
state.version = action.input.version;`,errors:[{id:`e-set-version-invalid`,name:`InvalidVersionError`,code:`INVALID_VERSION`,description:`The version must be a valid semver string (major.minor.patch, optionally with prerelease/build metadata).`,template:`Invalid version: {{version}}`}],examples:[],scope:`global`},{id:`o-set-package-identifier`,name:`SET_PACKAGE_IDENTIFIER`,description:`Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'. Auto-adds '-cli' suffix if missing, stores scope with '@' prefix.`,schema:`input SetPackageIdentifierInput {
|
|
153
|
+
identifier: String!
|
|
154
|
+
}`,template:`Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'.`,reducer:`const trimmed = action.input.identifier.trim();
|
|
155
|
+
if (!trimmed) {
|
|
156
|
+
throw new InvalidPackageIdentifierError('Package identifier must not be empty');
|
|
157
|
+
}
|
|
158
|
+
let scopePart = null;
|
|
159
|
+
let namePart = trimmed;
|
|
160
|
+
if (trimmed.includes('/')) {
|
|
161
|
+
const parts = trimmed.split('/');
|
|
162
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
163
|
+
throw new InvalidPackageIdentifierError(\`Invalid package identifier: \${trimmed}\`);
|
|
164
|
+
}
|
|
165
|
+
scopePart = parts[0].replace(/^@/, '');
|
|
166
|
+
namePart = parts[1];
|
|
167
|
+
}
|
|
168
|
+
if (scopePart !== null) {
|
|
169
|
+
if (!/^[a-z][a-z0-9-]*$/.test(scopePart)) {
|
|
170
|
+
throw new InvalidPackageIdentifierError(\`Invalid scope: \${scopePart}\`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (!namePart.endsWith('-cli')) {
|
|
174
|
+
namePart = namePart + '-cli';
|
|
175
|
+
}
|
|
176
|
+
if (!/^[a-z][a-z0-9-]*$/.test(namePart)) {
|
|
177
|
+
throw new InvalidPackageIdentifierError(\`Invalid package name: \${namePart}\`);
|
|
178
|
+
}
|
|
179
|
+
state.scope = scopePart ? \`@\${scopePart}\` : null;
|
|
180
|
+
state.name = namePart;
|
|
181
|
+
const managed = state.packages.find((p) => p.managed);
|
|
182
|
+
if (managed) {
|
|
183
|
+
const appBase = namePart.replace(/-cli$/, '-app');
|
|
184
|
+
managed.packageName = scopePart ? \`@\${scopePart}/\${appBase}\` : appBase;
|
|
185
|
+
managed.id = \`app-\${namePart}\`;
|
|
186
|
+
}`,errors:[{id:`e-invalid-package-identifier`,name:`InvalidPackageIdentifierError`,code:`INVALID_PACKAGE_IDENTIFIER`,description:`The package identifier is invalid. Must be a valid npm package name with optional scope.`,template:``}],examples:[],scope:`global`}]},{id:`m-features-powerhouse`,name:`features_powerhouse`,description:`Powerhouse integration level. Ordered enum: Disabled < Reactor < Switchboard < Connect. Once above Disabled, cannot go back to Disabled (irreversible migration).`,operations:[{id:`o-set-powerhouse-level`,name:`SET_POWERHOUSE_LEVEL`,description:`Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).`,schema:`input SetPowerhouseLevelInput {
|
|
187
|
+
level: PowerhouseLevel!
|
|
188
|
+
skipAutoProxy: Boolean
|
|
189
|
+
}`,template:`Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).`,reducer:`const LEVELS = ['Disabled', 'Reactor', 'Switchboard', 'Connect'];
|
|
190
|
+
const current = LEVELS.indexOf(state.features.powerhouse);
|
|
191
|
+
const next = LEVELS.indexOf(action.input.level);
|
|
192
|
+
if (current >= 1 && next < 1) {
|
|
193
|
+
throw new CannotLowerPowerhouseError(
|
|
194
|
+
'Cannot lower Powerhouse level below Reactor once enabled',
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
state.features.powerhouse = action.input.level;
|
|
198
|
+
if (current === 0 && next >= 1) {
|
|
199
|
+
const hasManaged = state.packages.some((p) => p.managed);
|
|
200
|
+
if (!hasManaged) {
|
|
201
|
+
const baseName = state.name
|
|
202
|
+
? state.name.replace(/-cli$/, '-app')
|
|
203
|
+
: 'app';
|
|
204
|
+
const appName =
|
|
205
|
+
state.scope && state.name
|
|
206
|
+
? \`\${state.scope}/\${baseName}\`
|
|
207
|
+
: baseName;
|
|
208
|
+
state.packages.push({
|
|
209
|
+
id: \`app-\${state.name || 'managed'}\`,
|
|
210
|
+
packageName: appName,
|
|
211
|
+
documentTypes: ['*/*'],
|
|
212
|
+
version: null,
|
|
213
|
+
managed: true,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (next >= 2 && !action.input.skipAutoProxy) {
|
|
218
|
+
state.deployment.proxyEnabled = true;
|
|
219
|
+
}`,errors:[{id:`e-cannot-lower-powerhouse`,name:`CannotLowerPowerhouseError`,code:`CANNOT_LOWER_POWERHOUSE`,description:`Cannot lower the Powerhouse level below Reactor once it has been set above Disabled.`,template:`Cannot lower Powerhouse level below Reactor once enabled`}],examples:[],scope:`global`}]},{id:`m-features-routine`,name:`features_routine`,description:`Routine loop feature toggle.`,operations:[{id:`o-enable-routine`,name:`ENABLE_ROUTINE`,description:`Enable the routine loop. Idempotent.`,schema:`input EnableRoutineInput {
|
|
220
|
+
_: Boolean
|
|
221
|
+
}`,template:`Enable the routine loop. Idempotent.`,reducer:`state.features.routine.enabled = true;`,errors:[],examples:[],scope:`global`},{id:`o-disable-routine`,name:`DISABLE_ROUTINE`,description:`Disable the routine loop. Always allowed.`,schema:`input DisableRoutineInput {
|
|
222
|
+
_: Boolean
|
|
223
|
+
}`,template:`Disable the routine loop.`,reducer:`state.features.routine.enabled = false;`,errors:[],examples:[],scope:`global`}]},{id:`m-powerhouse-packages`,name:`powerhouse_packages`,description:`Manage reactor packages and their document types. The app package is auto-created when Powerhouse level goes above Disabled.`,operations:[{id:`o-add-powerhouse-package`,name:`ADD_POWERHOUSE_PACKAGE`,description:`Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.`,schema:`input AddPowerhousePackageInput {
|
|
224
|
+
id: OID!
|
|
225
|
+
packageName: String!
|
|
226
|
+
}`,template:`Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.`,reducer:`const exists = state.packages.find(
|
|
227
|
+
(p) =>
|
|
228
|
+
p.id === action.input.id ||
|
|
229
|
+
p.packageName === action.input.packageName,
|
|
230
|
+
);
|
|
231
|
+
if (exists) {
|
|
232
|
+
throw new DuplicatePackageError(
|
|
233
|
+
\`Package already exists: \${action.input.packageName}\`,
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
state.packages.push({
|
|
237
|
+
id: action.input.id,
|
|
238
|
+
packageName: action.input.packageName,
|
|
239
|
+
documentTypes: [],
|
|
240
|
+
version: null,
|
|
241
|
+
managed: false,
|
|
242
|
+
});`,errors:[{id:`e-duplicate-package`,name:`DuplicatePackageError`,code:`DUPLICATE_PACKAGE`,description:`A package with the same ID or name already exists.`,template:``}],examples:[],scope:`global`},{id:`o-remove-powerhouse-package`,name:`REMOVE_POWERHOUSE_PACKAGE`,description:`Remove a reactor package. Cannot remove the auto-managed app package.`,schema:`input RemovePowerhousePackageInput {
|
|
243
|
+
id: OID!
|
|
244
|
+
}`,template:`Remove a reactor package. Cannot remove the auto-managed app package.`,reducer:`const idx = state.packages.findIndex((p) => p.id === action.input.id);
|
|
245
|
+
if (idx === -1) {
|
|
246
|
+
throw new PackageNotFoundError(\`Package not found: \${action.input.id}\`);
|
|
247
|
+
}
|
|
248
|
+
const pkg = state.packages[idx];
|
|
249
|
+
if (pkg.managed) {
|
|
250
|
+
throw new CannotRemoveManagedPackageError(
|
|
251
|
+
"Cannot remove a managed package",
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
state.packages.splice(idx, 1);`,errors:[{id:`e-package-not-found-remove`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`The specified package ID was not found.`,template:``},{id:`e-cannot-remove-app-package`,name:`CannotRemoveAppPackageError`,code:`CANNOT_REMOVE_APP_PACKAGE`,description:`The auto-managed app package cannot be removed.`,template:``},{id:`e-cannot-remove-managed`,name:`CannotRemoveManagedPackageError`,code:`CANNOT_REMOVE_MANAGED_PACKAGE`,description:`Cannot remove a managed (framework-controlled) package`,template:``}],examples:[],scope:`global`},{id:`o-add-package-document-type`,name:`ADD_PACKAGE_DOCUMENT_TYPE`,description:`Add a document type ID to a package (app or external).`,schema:`input AddPackageDocumentTypeInput {
|
|
255
|
+
packageId: OID!
|
|
256
|
+
documentType: String!
|
|
257
|
+
}`,template:`Add a document type ID to a package (app or external).`,reducer:`if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\/[a-z0-9-]+$/.test(action.input.documentType)) {
|
|
258
|
+
throw new InvalidDocumentTypeError(
|
|
259
|
+
\`Invalid document type format: \${action.input.documentType}. Expected org/name.\`,
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
const pkg = state.packages.find((p) => p.id === action.input.packageId);
|
|
263
|
+
if (!pkg) {
|
|
264
|
+
throw new PackageNotFoundError(
|
|
265
|
+
\`Package not found: \${action.input.packageId}\`,
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
if (action.input.documentType === '*/*') {
|
|
269
|
+
pkg.documentTypes.length = 0;
|
|
270
|
+
pkg.documentTypes.push('*/*');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (pkg.documentTypes.includes('*/*')) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (pkg.documentTypes.includes(action.input.documentType)) {
|
|
277
|
+
throw new DuplicateDocumentTypeError(
|
|
278
|
+
\`Document type already registered: \${action.input.documentType}\`,
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
pkg.documentTypes.push(action.input.documentType);`,errors:[{id:`e-invalid-document-type`,name:`InvalidDocumentTypeError`,code:`INVALID_DOCUMENT_TYPE`,description:`Document type must match org/name format (e.g. powerhouse/ph-clint-project).`,template:``},{id:`e-package-not-found-add-dt`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`The specified package ID was not found.`,template:``},{id:`e-duplicate-document-type`,name:`DuplicateDocumentTypeError`,code:`DUPLICATE_DOCUMENT_TYPE`,description:`This document type is already registered in the package.`,template:``}],examples:[],scope:`global`},{id:`o-remove-package-document-type`,name:`REMOVE_PACKAGE_DOCUMENT_TYPE`,description:`Remove a document type ID from a package.`,schema:`input RemovePackageDocumentTypeInput {
|
|
282
|
+
packageId: OID!
|
|
283
|
+
documentType: String!
|
|
284
|
+
}`,template:`Remove a document type ID from a package.`,reducer:`const pkg = state.packages.find(p => p.id === action.input.packageId);
|
|
285
|
+
if (!pkg) {
|
|
286
|
+
throw new PackageNotFoundError(\`Package not found: \${action.input.packageId}\`);
|
|
287
|
+
}
|
|
288
|
+
const idx = pkg.documentTypes.indexOf(action.input.documentType);
|
|
289
|
+
if (idx === -1) {
|
|
290
|
+
throw new DocumentTypeNotFoundError(\`Document type not found: \${action.input.documentType}\`);
|
|
291
|
+
}
|
|
292
|
+
pkg.documentTypes.splice(idx, 1);`,errors:[{id:`e-package-not-found-rm-dt`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`The specified package ID was not found.`,template:``},{id:`e-document-type-not-found`,name:`DocumentTypeNotFoundError`,code:`DOCUMENT_TYPE_NOT_FOUND`,description:`The specified document type was not found in this package.`,template:``}],examples:[],scope:`global`},{id:`o-set-package-version`,name:`SET_PACKAGE_VERSION`,description:``,schema:`input SetPackageVersionInput {
|
|
293
|
+
packageId: OID!
|
|
294
|
+
version: String
|
|
295
|
+
}`,template:``,reducer:`const pkg = state.packages.find((p) => p.id === action.input.packageId);
|
|
296
|
+
if (!pkg) {
|
|
297
|
+
throw new PackageNotFoundError(
|
|
298
|
+
\`Package not found: \${action.input.packageId}\`,
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
if (action.input.version != null) {
|
|
302
|
+
const SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;
|
|
303
|
+
if (!SEMVER.test(action.input.version)) {
|
|
304
|
+
throw new InvalidVersionError(
|
|
305
|
+
\`Invalid version: \${action.input.version}\`,
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
pkg.version = action.input.version || null;`,errors:[{id:`e-pkg-not-found-set-ver`,name:`PackageNotFoundError`,code:`PACKAGE_NOT_FOUND`,description:`Referenced package does not exist`,template:``},{id:`e-invalid-version`,name:`InvalidVersionError`,code:`INVALID_VERSION`,description:`Version string is not valid semver`,template:``}],examples:[],scope:`global`}]},{id:`m-external-skills`,name:`external_skills`,description:`External skills from the skills.sh ecosystem. Each skill has a name and GitHub URL for installation.`,operations:[{id:`o-add-external-skill`,name:`ADD_EXTERNAL_SKILL`,description:`Add an external skill. Name must be lowercase kebab-case.`,schema:`input AddExternalSkillInput {
|
|
310
|
+
id: OID!
|
|
311
|
+
name: String!
|
|
312
|
+
githubUrl: URL!
|
|
313
|
+
}`,template:`Add an external skill. Name must be lowercase kebab-case.`,reducer:`if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {
|
|
314
|
+
throw new InvalidSkillNameError(\`Invalid skill name: \${action.input.name}. Must be lowercase kebab-case.\`);
|
|
315
|
+
}
|
|
316
|
+
const exists = state.externalSkills.find(s => s.id === action.input.id || s.name === action.input.name);
|
|
317
|
+
if (exists) {
|
|
318
|
+
throw new DuplicateSkillError(\`Skill already exists: \${action.input.name}\`);
|
|
319
|
+
}
|
|
320
|
+
state.externalSkills.push({
|
|
321
|
+
id: action.input.id,
|
|
322
|
+
name: action.input.name,
|
|
323
|
+
githubUrl: action.input.githubUrl,
|
|
324
|
+
});`,errors:[{id:`e-invalid-skill-name`,name:`InvalidSkillNameError`,code:`INVALID_SKILL_NAME`,description:`Skill name must be lowercase kebab-case (e.g. playwright-cli).`,template:``},{id:`e-duplicate-skill`,name:`DuplicateSkillError`,code:`DUPLICATE_SKILL`,description:`A skill with the same ID or name already exists.`,template:``}],examples:[],scope:`global`},{id:`o-remove-external-skill`,name:`REMOVE_EXTERNAL_SKILL`,description:`Remove an external skill by ID.`,schema:`input RemoveExternalSkillInput {
|
|
325
|
+
id: OID!
|
|
326
|
+
}`,template:`Remove an external skill by ID.`,reducer:`const idx = state.externalSkills.findIndex(s => s.id === action.input.id);
|
|
327
|
+
if (idx === -1) {
|
|
328
|
+
throw new SkillNotFoundError(\`Skill not found: \${action.input.id}\`);
|
|
329
|
+
}
|
|
330
|
+
state.externalSkills.splice(idx, 1);`,errors:[{id:`e-skill-not-found-remove`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The specified skill ID was not found.`,template:``}],examples:[],scope:`global`},{id:`o-set-external-skill-name`,name:`SET_EXTERNAL_SKILL_NAME`,description:`Update the name of an external skill.`,schema:`input SetExternalSkillNameInput {
|
|
331
|
+
id: OID!
|
|
332
|
+
name: String!
|
|
333
|
+
}`,template:`Update the name of an external skill.`,reducer:`const skill = state.externalSkills.find(s => s.id === action.input.id);
|
|
334
|
+
if (!skill) {
|
|
335
|
+
throw new SkillNotFoundError(\`Skill not found: \${action.input.id}\`);
|
|
336
|
+
}
|
|
337
|
+
if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {
|
|
338
|
+
throw new InvalidSkillNameError(\`Invalid skill name: \${action.input.name}. Must be lowercase kebab-case.\`);
|
|
339
|
+
}
|
|
340
|
+
const duplicate = state.externalSkills.find(s => s.name === action.input.name && s.id !== action.input.id);
|
|
341
|
+
if (duplicate) {
|
|
342
|
+
throw new DuplicateSkillError(\`Skill name already in use: \${action.input.name}\`);
|
|
343
|
+
}
|
|
344
|
+
skill.name = action.input.name;`,errors:[{id:`e-skill-not-found-set-name`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The specified skill ID was not found.`,template:``},{id:`e-invalid-skill-name-set`,name:`InvalidSkillNameError`,code:`INVALID_SKILL_NAME`,description:`Skill name must be lowercase kebab-case.`,template:``},{id:`e-duplicate-skill-set-name`,name:`DuplicateSkillError`,code:`DUPLICATE_SKILL`,description:`Another skill already uses this name.`,template:``}],examples:[],scope:`global`},{id:`o-set-external-skill-github-url`,name:`SET_EXTERNAL_SKILL_GITHUB_URL`,description:`Update the GitHub URL of an external skill.`,schema:`input SetExternalSkillGithubUrlInput {
|
|
345
|
+
id: OID!
|
|
346
|
+
githubUrl: URL!
|
|
347
|
+
}`,template:`Update the GitHub URL of an external skill.`,reducer:`const skill = state.externalSkills.find(s => s.id === action.input.id);
|
|
348
|
+
if (!skill) {
|
|
349
|
+
throw new SkillNotFoundError(\`Skill not found: \${action.input.id}\`);
|
|
350
|
+
}
|
|
351
|
+
skill.githubUrl = action.input.githubUrl;`,errors:[{id:`e-skill-not-found-set-url`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The specified skill ID was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-publishing`,name:`publishing`,description:`Version bumping and publish records. Tracks dev/staging/production publish intents and their status.`,operations:[{id:`o-bump-version`,name:`BUMP_VERSION`,description:`Bump the project version. Must be a valid semver string greater than the current version.`,schema:`input BumpVersionInput {
|
|
352
|
+
version: String!
|
|
353
|
+
}`,template:`Bump the project version. Must be a valid semver string greater than the current version.`,reducer:`if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {
|
|
354
|
+
throw new InvalidVersionError(\`Invalid version: \${action.input.version}\`);
|
|
355
|
+
}
|
|
356
|
+
state.version = action.input.version;`,errors:[{id:`e-invalid-version-bump`,name:`InvalidVersionError`,code:`INVALID_VERSION`,description:`The version must be a valid semver string.`,template:``}],examples:[],scope:`global`},{id:`o-publish-dev`,name:`PUBLISH_DEV`,description:`Record a dev publish intent. Creates a Pending publish record.`,schema:`input PublishDevInput {
|
|
357
|
+
id: OID!
|
|
358
|
+
timestamp: DateTime!
|
|
359
|
+
}`,template:`Record a dev publish intent. Creates a Pending publish record.`,reducer:`state.publishHistory.push({
|
|
360
|
+
id: action.input.id,
|
|
361
|
+
tag: 'Dev',
|
|
362
|
+
version: state.version,
|
|
363
|
+
timestamp: action.input.timestamp,
|
|
364
|
+
status: 'Pending',
|
|
365
|
+
});`,errors:[],examples:[],scope:`global`},{id:`o-publish-staging`,name:`PUBLISH_STAGING`,description:`Record a staging publish intent. Creates a Pending publish record.`,schema:`input PublishStagingInput {
|
|
366
|
+
id: OID!
|
|
367
|
+
timestamp: DateTime!
|
|
368
|
+
}`,template:`Record a staging publish intent. Creates a Pending publish record.`,reducer:`state.publishHistory.push({
|
|
369
|
+
id: action.input.id,
|
|
370
|
+
tag: 'Staging',
|
|
371
|
+
version: state.version,
|
|
372
|
+
timestamp: action.input.timestamp,
|
|
373
|
+
status: 'Pending',
|
|
374
|
+
});`,errors:[],examples:[],scope:`global`},{id:`o-publish-production`,name:`PUBLISH_PRODUCTION`,description:`Record a production publish intent. Creates a Pending publish record.`,schema:`input PublishProductionInput {
|
|
375
|
+
id: OID!
|
|
376
|
+
timestamp: DateTime!
|
|
377
|
+
}`,template:`Record a production publish intent. Creates a Pending publish record.`,reducer:`state.publishHistory.push({
|
|
378
|
+
id: action.input.id,
|
|
379
|
+
tag: 'Production',
|
|
380
|
+
version: state.version,
|
|
381
|
+
timestamp: action.input.timestamp,
|
|
382
|
+
status: 'Pending',
|
|
383
|
+
});`,errors:[],examples:[],scope:`global`},{id:`o-set-publish-status`,name:`SET_PUBLISH_STATUS`,description:`Update the status of a publish record. Used by the trigger after publish completes.`,schema:`input SetPublishStatusInput {
|
|
384
|
+
id: OID!
|
|
385
|
+
status: PublishStatus!
|
|
386
|
+
}`,template:`Update the status of a publish record. Used by the trigger after publish completes.`,reducer:`const record = state.publishHistory.find(r => r.id === action.input.id);
|
|
387
|
+
if (!record) {
|
|
388
|
+
throw new PublishRecordNotFoundError(\`Publish record not found: \${action.input.id}\`);
|
|
389
|
+
}
|
|
390
|
+
record.status = action.input.status;`,errors:[{id:`e-publish-record-not-found`,name:`PublishRecordNotFoundError`,code:`PUBLISH_RECORD_NOT_FOUND`,description:`The specified publish record ID was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-lifecycle`,name:`lifecycle`,description:`Document lifecycle operations. IMPORT_SPEC bulk-imports a full project spec into the document.`,operations:[{id:`o-import-spec`,name:`IMPORT_SPEC`,description:`Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.`,schema:`input ImportSpecInput {
|
|
391
|
+
name: String!
|
|
392
|
+
scope: String
|
|
393
|
+
version: String!
|
|
394
|
+
description: String!
|
|
395
|
+
powerhouse: PowerhouseLevel!
|
|
396
|
+
mastraEnabled: Boolean!
|
|
397
|
+
routineEnabled: Boolean!
|
|
398
|
+
packages: [ImportPackageInput!]!
|
|
399
|
+
externalSkills: [ImportSkillInput!]!
|
|
400
|
+
mainAgent: ImportMainAgentInput
|
|
401
|
+
subAgents: [ImportSubAgentInput!]!
|
|
402
|
+
models: [ImportModelInput!]!
|
|
403
|
+
profiles: [ImportProfileInput!]!
|
|
404
|
+
enableChat: Boolean
|
|
405
|
+
proxyEnabled: Boolean
|
|
406
|
+
observabilityEnabled: Boolean
|
|
407
|
+
supportedResources: [String!]
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
input ImportPackageInput {
|
|
411
|
+
id: OID!
|
|
412
|
+
packageName: String!
|
|
413
|
+
documentTypes: [String!]!
|
|
414
|
+
version: String
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
input ImportSkillInput {
|
|
418
|
+
id: OID!
|
|
419
|
+
name: String!
|
|
420
|
+
githubUrl: URL!
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
input ImportModelInput {
|
|
424
|
+
id: OID!
|
|
425
|
+
isDefault: Boolean!
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
input ImportProfileInput {
|
|
429
|
+
id: OID!
|
|
430
|
+
title: String!
|
|
431
|
+
content: String!
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
input ImportMainAgentInput {
|
|
435
|
+
id: OID!
|
|
436
|
+
name: String!
|
|
437
|
+
description: String
|
|
438
|
+
image: String
|
|
439
|
+
modelId: OID!
|
|
440
|
+
profileIds: [OID!]!
|
|
441
|
+
skills: [String!]!
|
|
442
|
+
toolPatterns: [String!]!
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
input ImportSubAgentInput {
|
|
446
|
+
id: OID!
|
|
447
|
+
name: String!
|
|
448
|
+
description: String!
|
|
449
|
+
modelId: OID!
|
|
450
|
+
profileIds: [OID!]!
|
|
451
|
+
skills: [String!]!
|
|
452
|
+
toolPatterns: [String!]!
|
|
453
|
+
}`,template:`Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.`,reducer:`state.name = action.input.name;
|
|
454
|
+
state.scope = action.input.scope || null;
|
|
455
|
+
state.version = action.input.version;
|
|
456
|
+
state.description = action.input.description;
|
|
457
|
+
state.features.powerhouse = action.input.powerhouse;
|
|
458
|
+
state.features.mastra.enabled = action.input.mastraEnabled;
|
|
459
|
+
state.features.routine.enabled = action.input.routineEnabled;
|
|
460
|
+
|
|
461
|
+
const appBase = action.input.name.replace(/-cli$/, '-app');
|
|
462
|
+
const appPkgName = action.input.scope
|
|
463
|
+
? \`\${action.input.scope}/\${appBase}\`
|
|
464
|
+
: appBase;
|
|
465
|
+
const phEnabled = action.input.powerhouse !== 'Disabled';
|
|
466
|
+
|
|
467
|
+
state.packages = action.input.packages.map((p) => ({
|
|
468
|
+
id: p.id,
|
|
469
|
+
packageName: p.packageName,
|
|
470
|
+
documentTypes: [...p.documentTypes],
|
|
471
|
+
version: p.version || null,
|
|
472
|
+
managed: phEnabled && p.packageName === appPkgName,
|
|
473
|
+
}));
|
|
474
|
+
state.externalSkills = action.input.externalSkills.map((s) => ({
|
|
475
|
+
id: s.id,
|
|
476
|
+
name: s.name,
|
|
477
|
+
githubUrl: s.githubUrl,
|
|
478
|
+
}));
|
|
479
|
+
|
|
480
|
+
state.features.mastra.models = action.input.models.map((m) => ({
|
|
481
|
+
id: m.id,
|
|
482
|
+
isDefault: m.isDefault,
|
|
483
|
+
}));
|
|
484
|
+
state.features.mastra.profiles = action.input.profiles.map((p) => ({
|
|
485
|
+
id: p.id,
|
|
486
|
+
title: p.title,
|
|
487
|
+
content: p.content,
|
|
488
|
+
}));
|
|
489
|
+
|
|
490
|
+
if (action.input.mainAgent && state.features.mastra.enabled) {
|
|
491
|
+
const m = action.input.mainAgent;
|
|
492
|
+
let image = null;
|
|
493
|
+
if (m.image) {
|
|
494
|
+
if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(m.image)) {
|
|
495
|
+
throw new InvalidAgentImageError(
|
|
496
|
+
'Invalid image: must be a data URL (data:<mime>;base64,...)',
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
image = m.image;
|
|
500
|
+
}
|
|
501
|
+
state.features.mastra.mainAgent = {
|
|
502
|
+
id: m.id,
|
|
503
|
+
name: m.name,
|
|
504
|
+
description: m.description || null,
|
|
505
|
+
image,
|
|
506
|
+
modelId: m.modelId,
|
|
507
|
+
profileIds: [...m.profileIds],
|
|
508
|
+
skills: [...m.skills],
|
|
509
|
+
toolPatterns: [...m.toolPatterns],
|
|
510
|
+
};
|
|
511
|
+
} else {
|
|
512
|
+
state.features.mastra.mainAgent = null;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (state.features.mastra.enabled) {
|
|
516
|
+
state.features.mastra.subAgents = action.input.subAgents.map((s) => ({
|
|
517
|
+
id: s.id,
|
|
518
|
+
name: s.name,
|
|
519
|
+
description: s.description,
|
|
520
|
+
modelId: s.modelId,
|
|
521
|
+
profileIds: [...s.profileIds],
|
|
522
|
+
skills: [...s.skills],
|
|
523
|
+
toolPatterns: [...s.toolPatterns],
|
|
524
|
+
}));
|
|
525
|
+
} else {
|
|
526
|
+
state.features.mastra.subAgents = [];
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (
|
|
530
|
+
action.input.enableChat &&
|
|
531
|
+
state.features.mastra.enabled &&
|
|
532
|
+
state.features.powerhouse !== 'Disabled'
|
|
533
|
+
) {
|
|
534
|
+
state.features.mastra.common.enableChat = true;
|
|
535
|
+
const CLINT_COMMON_PKG = '@powerhousedao/clint-common';
|
|
536
|
+
const CHAT_DOC_TYPE = 'powerhouse/chat-session';
|
|
537
|
+
const existing = state.packages.find(
|
|
538
|
+
(p) => p.packageName === CLINT_COMMON_PKG,
|
|
539
|
+
);
|
|
540
|
+
if (!existing) {
|
|
541
|
+
state.packages.push({
|
|
542
|
+
id: 'pkg-clint-common',
|
|
543
|
+
packageName: CLINT_COMMON_PKG,
|
|
544
|
+
documentTypes: [CHAT_DOC_TYPE],
|
|
545
|
+
version: null,
|
|
546
|
+
managed: true,
|
|
547
|
+
});
|
|
548
|
+
} else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {
|
|
549
|
+
existing.documentTypes.push(CHAT_DOC_TYPE);
|
|
550
|
+
}
|
|
551
|
+
} else {
|
|
552
|
+
state.features.mastra.common.enableChat = false;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
state.deployment.proxyEnabled = action.input.proxyEnabled ?? false;
|
|
556
|
+
state.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;
|
|
557
|
+
state.deployment.supportedResources = action.input.supportedResources
|
|
558
|
+
? [...action.input.supportedResources]
|
|
559
|
+
: [];`,errors:[{id:`e-import-spec-invalid-image`,name:`InvalidAgentImageError`,code:`INVALID_AGENT_IMAGE`,description:`Agent image must be a data URL`,template:``}],examples:[],scope:`global`}]},{id:`m-deployment`,name:`deployment`,description:`Deployment settings: service announcement toggle and supported resource tiers.`,operations:[{id:`o-add-supported-resource`,name:`ADD_SUPPORTED_RESOURCE`,description:`Add a supported resource tier. Guards against duplicates.`,schema:`input AddSupportedResourceInput {
|
|
560
|
+
resource: String!
|
|
561
|
+
}`,template:`Add a supported resource tier. Guards against duplicates.`,reducer:`if (state.deployment.supportedResources.includes(action.input.resource)) {
|
|
562
|
+
throw new DuplicateResourceError(\`Resource already exists: \${action.input.resource}\`);
|
|
563
|
+
}
|
|
564
|
+
state.deployment.supportedResources.push(action.input.resource);`,errors:[{id:`e-duplicate-resource`,name:`DuplicateResourceError`,code:`DUPLICATE_RESOURCE`,description:`This resource is already in the supported resources list.`,template:``}],examples:[],scope:`global`},{id:`o-remove-supported-resource`,name:`REMOVE_SUPPORTED_RESOURCE`,description:`Remove a supported resource tier.`,schema:`input RemoveSupportedResourceInput {
|
|
565
|
+
resource: String!
|
|
566
|
+
}`,template:`Remove a supported resource tier.`,reducer:`const idx = state.deployment.supportedResources.indexOf(action.input.resource);
|
|
567
|
+
if (idx === -1) {
|
|
568
|
+
throw new ResourceNotFoundError(\`Resource not found: \${action.input.resource}\`);
|
|
569
|
+
}
|
|
570
|
+
state.deployment.supportedResources.splice(idx, 1);`,errors:[{id:`e-resource-not-found`,name:`ResourceNotFoundError`,code:`RESOURCE_NOT_FOUND`,description:`The specified resource was not found in the supported resources list.`,template:``}],examples:[],scope:`global`},{id:`o-set-proxy-enabled`,name:`SET_PROXY_ENABLED`,description:`Toggle the embedded reverse proxy.`,schema:`input SetProxyEnabledInput {
|
|
571
|
+
enabled: Boolean!
|
|
572
|
+
}`,template:`Toggle the embedded reverse proxy.`,reducer:`state.deployment.proxyEnabled = action.input.enabled;`,errors:[],examples:[],scope:`global`},{id:`o-set-observability-enabled`,name:`SET_OBSERVABILITY_ENABLED`,description:`Toggle the observability plugin (Sentry + OpenTelemetry).`,schema:`input SetObservabilityEnabledInput {
|
|
573
|
+
enabled: Boolean!
|
|
574
|
+
}`,template:`Toggle the observability plugin (Sentry + OpenTelemetry).`,reducer:`state.deployment.observabilityEnabled = action.input.enabled;`,errors:[],examples:[],scope:`global`}]},{id:`m-features-mastra`,name:`features_mastra`,description:`Top-level Mastra feature toggles: enable/disable and chat integration.`,operations:[{id:`o-enable-mastra`,name:`ENABLE_MASTRA`,description:`Enable Mastra. Seeds mainAgent with a default model (clint/demo-agent) and a base profile. Idempotent.`,schema:`input EnableMastraInput {
|
|
575
|
+
agentId: OID!
|
|
576
|
+
agentName: String!
|
|
577
|
+
}`,template:`Enable the Mastra agent feature. Seeds mainAgent with the seeded model + profile.`,reducer:`if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {
|
|
578
|
+
throw new InvalidAgentIdError(
|
|
579
|
+
\`Invalid agent ID: \${action.input.agentId}. Must be lowercase kebab-case.\`,
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
const trimmedName = action.input.agentName.trim();
|
|
583
|
+
if (!trimmedName) {
|
|
584
|
+
throw new InvalidAgentNameError('Agent name must not be empty.');
|
|
585
|
+
}
|
|
586
|
+
state.features.mastra.enabled = true;
|
|
587
|
+
if (state.features.mastra.models.length === 0) {
|
|
588
|
+
state.features.mastra.models.push({ id: 'clint/demo-agent', isDefault: true });
|
|
589
|
+
}
|
|
590
|
+
if (state.features.mastra.profiles.length === 0) {
|
|
591
|
+
state.features.mastra.profiles.push({ id: 'base', title: 'Base Profile', content: 'You are a helpful assistant.' });
|
|
592
|
+
}
|
|
593
|
+
const existing = state.features.mastra.mainAgent;
|
|
594
|
+
if (!existing) {
|
|
595
|
+
state.features.mastra.mainAgent = {
|
|
596
|
+
id: action.input.agentId,
|
|
597
|
+
name: trimmedName,
|
|
598
|
+
description: null,
|
|
599
|
+
image: null,
|
|
600
|
+
modelId: 'clint/demo-agent',
|
|
601
|
+
profileIds: ['base'],
|
|
602
|
+
skills: [],
|
|
603
|
+
toolPatterns: [],
|
|
604
|
+
};
|
|
605
|
+
} else {
|
|
606
|
+
existing.id = action.input.agentId;
|
|
607
|
+
existing.name = trimmedName;
|
|
608
|
+
}`,errors:[{id:`e-enable-mastra-invalid-id`,name:`InvalidAgentIdError`,code:`INVALID_AGENT_ID`,description:`The agent ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.`,template:``},{id:`e-enable-mastra-invalid-name`,name:`InvalidAgentNameError`,code:`INVALID_AGENT_NAME`,description:`The agent name must not be empty after trimming.`,template:``}],examples:[],scope:`global`},{id:`o-disable-mastra`,name:`DISABLE_MASTRA`,description:`Disable Mastra. Clears mainAgent, subAgents, models, profiles and the chat integration. Removes the auto-managed clint-common package.`,schema:`input DisableMastraInput {
|
|
609
|
+
_: Boolean
|
|
610
|
+
}`,template:`Disable the Mastra agent feature.`,reducer:`state.features.mastra.enabled = false;
|
|
611
|
+
state.features.mastra.mainAgent = null;
|
|
612
|
+
state.features.mastra.subAgents = [];
|
|
613
|
+
state.features.mastra.models = [];
|
|
614
|
+
state.features.mastra.profiles = [];
|
|
615
|
+
state.features.mastra.common.enableChat = false;
|
|
616
|
+
const ccIdx = state.packages.findIndex(
|
|
617
|
+
(p) => p.packageName === '@powerhousedao/clint-common' && p.managed,
|
|
618
|
+
);
|
|
619
|
+
if (ccIdx !== -1) {
|
|
620
|
+
state.packages.splice(ccIdx, 1);
|
|
621
|
+
}`,errors:[],examples:[],scope:`global`},{id:`o-set-enable-chat`,name:`SET_ENABLE_CHAT`,description:`Enable or disable the chat integration. When enabled, auto-adds @powerhousedao/clint-common as a managed package with powerhouse/chat-session doc type. When disabled, removes it if it only has that doc type.`,schema:`input SetEnableChatInput {
|
|
622
|
+
enabled: Boolean!
|
|
623
|
+
}`,template:`Toggle the chat integration feature. Requires both Mastra and Powerhouse to be enabled.`,reducer:`if (!state.features.mastra.enabled) {
|
|
624
|
+
throw new MastraNotEnabledError('Cannot toggle chat when Mastra is disabled.');
|
|
625
|
+
}
|
|
626
|
+
if (state.features.powerhouse === 'Disabled') {
|
|
627
|
+
throw new PowerhouseNotEnabledError('Cannot toggle chat when Powerhouse is disabled.');
|
|
628
|
+
}
|
|
629
|
+
state.features.mastra.common.enableChat = action.input.enabled;
|
|
630
|
+
const CLINT_COMMON_PKG = '@powerhousedao/clint-common';
|
|
631
|
+
const CHAT_DOC_TYPE = 'powerhouse/chat-session';
|
|
632
|
+
if (action.input.enabled) {
|
|
633
|
+
const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);
|
|
634
|
+
if (!existing) {
|
|
635
|
+
state.packages.push({
|
|
636
|
+
id: 'pkg-clint-common',
|
|
637
|
+
packageName: CLINT_COMMON_PKG,
|
|
638
|
+
documentTypes: [CHAT_DOC_TYPE],
|
|
639
|
+
version: null,
|
|
640
|
+
managed: true,
|
|
641
|
+
});
|
|
642
|
+
} else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {
|
|
643
|
+
existing.documentTypes.push(CHAT_DOC_TYPE);
|
|
644
|
+
}
|
|
645
|
+
} else {
|
|
646
|
+
const idx = state.packages.findIndex(
|
|
647
|
+
(p) => p.packageName === CLINT_COMMON_PKG && p.managed,
|
|
648
|
+
);
|
|
649
|
+
if (idx !== -1) {
|
|
650
|
+
const pkg = state.packages[idx];
|
|
651
|
+
if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) {
|
|
652
|
+
state.packages.splice(idx, 1);
|
|
653
|
+
} else {
|
|
654
|
+
const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);
|
|
655
|
+
if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}`,errors:[{id:`e-chat-mastra-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before toggling chat.`,template:``},{id:`e-chat-powerhouse-not-enabled`,name:`PowerhouseNotEnabledError`,code:`POWERHOUSE_NOT_ENABLED`,description:`Powerhouse must be enabled (Reactor or above) before toggling chat.`,template:``}],examples:[],scope:`global`}]},{id:`m-mastra-models`,name:`mastra_models`,description:`Model library CRUD. Models are referenced by main and sub agents via modelId.`,operations:[{id:`o-add-model`,name:`ADD_MODEL`,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.`,schema:`input AddModelInput {
|
|
659
|
+
id: OID!
|
|
660
|
+
isDefault: Boolean
|
|
661
|
+
}`,template:`Add a model to the library.`,reducer:`if (!state.features.mastra.enabled) {
|
|
662
|
+
throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');
|
|
663
|
+
}
|
|
664
|
+
if (!/^[a-z0-9-]+\\/[a-z0-9._-]+$/.test(action.input.id)) {
|
|
665
|
+
throw new InvalidModelIdError(\`Invalid model ID: \${action.input.id}. Must be provider/model-name format.\`);
|
|
666
|
+
}
|
|
667
|
+
if (state.features.mastra.models.find(m => m.id === action.input.id)) {
|
|
668
|
+
throw new DuplicateModelError(\`Model already exists: \${action.input.id}\`);
|
|
669
|
+
}
|
|
670
|
+
const isFirst = state.features.mastra.models.length === 0;
|
|
671
|
+
const makeDefault = isFirst || action.input.isDefault === true;
|
|
672
|
+
if (makeDefault) {
|
|
673
|
+
for (const m of state.features.mastra.models) {
|
|
674
|
+
m.isDefault = false;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
state.features.mastra.models.push({
|
|
678
|
+
id: action.input.id,
|
|
679
|
+
isDefault: makeDefault,
|
|
680
|
+
});`,errors:[{id:`e-add-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing models.`,template:``},{id:`e-add-model-invalid-id`,name:`InvalidModelIdError`,code:`INVALID_MODEL_ID`,description:`Model ID must match provider/model-name format.`,template:``},{id:`e-add-model-duplicate`,name:`DuplicateModelError`,code:`DUPLICATE_MODEL`,description:`A model with this ID already exists.`,template:``}],examples:[],scope:`global`},{id:`o-remove-model`,name:`REMOVE_MODEL`,description:`Remove a model from the library. Rejects when any agent (main or sub) references it. Promotes first remaining to default if removing the current default.`,schema:`input RemoveModelInput {
|
|
681
|
+
id: OID!
|
|
682
|
+
}`,template:`Remove a model from the library.`,reducer:`if (!state.features.mastra.enabled) {
|
|
683
|
+
throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');
|
|
684
|
+
}
|
|
685
|
+
const idx = state.features.mastra.models.findIndex((m) => m.id === action.input.id);
|
|
686
|
+
if (idx === -1) {
|
|
687
|
+
throw new ModelNotFoundError(\`Model not found: \${action.input.id}\`);
|
|
688
|
+
}
|
|
689
|
+
const main = state.features.mastra.mainAgent;
|
|
690
|
+
const usedByMain = !!main && main.modelId === action.input.id;
|
|
691
|
+
const usedBySub = state.features.mastra.subAgents.some(
|
|
692
|
+
(s) => s.modelId === action.input.id,
|
|
693
|
+
);
|
|
694
|
+
if (usedByMain || usedBySub) {
|
|
695
|
+
throw new ModelInUseError(
|
|
696
|
+
\`Model \${action.input.id} is in use by an agent.\`,
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
const wasDefault = state.features.mastra.models[idx].isDefault;
|
|
700
|
+
state.features.mastra.models.splice(idx, 1);
|
|
701
|
+
if (wasDefault && state.features.mastra.models.length > 0) {
|
|
702
|
+
state.features.mastra.models[0].isDefault = true;
|
|
703
|
+
}`,errors:[{id:`e-remove-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing models.`,template:``},{id:`e-remove-model-not-found`,name:`ModelNotFoundError`,code:`MODEL_NOT_FOUND`,description:`The specified model was not found.`,template:``},{id:`e-remove-model-in-use`,name:`ModelInUseError`,code:`MODEL_IN_USE`,description:`Cannot remove a model that is still referenced by an agent.`,template:``}],examples:[],scope:`global`},{id:`o-set-default-model`,name:`SET_DEFAULT_MODEL`,description:`Set a model as the default. Unsets the previous default.`,schema:`input SetDefaultModelInput {
|
|
704
|
+
id: OID!
|
|
705
|
+
}`,template:`Set a model as the default.`,reducer:`if (!state.features.mastra.enabled) {
|
|
706
|
+
throw new MastraNotEnabledError('Cannot set default model when Mastra is disabled.');
|
|
707
|
+
}
|
|
708
|
+
const model = state.features.mastra.models.find(m => m.id === action.input.id);
|
|
709
|
+
if (!model) {
|
|
710
|
+
throw new ModelNotFoundError(\`Model not found: \${action.input.id}\`);
|
|
711
|
+
}
|
|
712
|
+
for (const m of state.features.mastra.models) {
|
|
713
|
+
m.isDefault = false;
|
|
714
|
+
}
|
|
715
|
+
model.isDefault = true;`,errors:[{id:`e-set-default-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing models.`,template:``},{id:`e-set-default-model-not-found`,name:`ModelNotFoundError`,code:`MODEL_NOT_FOUND`,description:`The specified model was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-mastra-profiles`,name:`mastra_profiles`,description:`Profile library CRUD. Profiles are referenced by main and sub agents via profileIds.`,operations:[{id:`o-add-profile`,name:`ADD_PROFILE`,description:`Add a profile to the library. Inserted before insertBefore if provided, otherwise appended.`,schema:`input AddProfileInput {
|
|
716
|
+
id: OID!
|
|
717
|
+
title: String!
|
|
718
|
+
content: String!
|
|
719
|
+
insertBefore: OID
|
|
720
|
+
}`,template:`Add a profile to the library.`,reducer:`if (!state.features.mastra.enabled) {
|
|
721
|
+
throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');
|
|
722
|
+
}
|
|
723
|
+
if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {
|
|
724
|
+
throw new InvalidProfileIdError(\`Invalid profile ID: \${action.input.id}. Must be lowercase kebab-case.\`);
|
|
725
|
+
}
|
|
726
|
+
if (state.features.mastra.profiles.find(p => p.id === action.input.id)) {
|
|
727
|
+
throw new DuplicateProfileError(\`Profile already exists: \${action.input.id}\`);
|
|
728
|
+
}
|
|
729
|
+
const profile = {
|
|
730
|
+
id: action.input.id,
|
|
731
|
+
title: action.input.title,
|
|
732
|
+
content: action.input.content,
|
|
733
|
+
};
|
|
734
|
+
if (action.input.insertBefore) {
|
|
735
|
+
const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);
|
|
736
|
+
if (beforeIdx === -1) {
|
|
737
|
+
throw new ProfileNotFoundError(\`insertBefore profile not found: \${action.input.insertBefore}\`);
|
|
738
|
+
}
|
|
739
|
+
state.features.mastra.profiles.splice(beforeIdx, 0, profile);
|
|
740
|
+
} else {
|
|
741
|
+
state.features.mastra.profiles.push(profile);
|
|
742
|
+
}`,errors:[{id:`e-add-profile-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-add-profile-invalid-id`,name:`InvalidProfileIdError`,code:`INVALID_PROFILE_ID`,description:`Profile ID must match /^[a-z][a-z0-9-]*$/ — lowercase kebab-case.`,template:``},{id:`e-add-profile-duplicate`,name:`DuplicateProfileError`,code:`DUPLICATE_PROFILE`,description:`A profile with this ID already exists.`,template:``},{id:`e-add-profile-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`The insertBefore profile was not found.`,template:``}],examples:[],scope:`global`},{id:`o-update-profile`,name:`UPDATE_PROFILE`,description:`Update an existing profile's title and/or content. Only updates provided fields.`,schema:`input UpdateProfileInput {
|
|
743
|
+
id: OID!
|
|
744
|
+
title: String
|
|
745
|
+
content: String
|
|
746
|
+
}`,template:`Update an existing profile.`,reducer:`if (!state.features.mastra.enabled) {
|
|
747
|
+
throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');
|
|
748
|
+
}
|
|
749
|
+
const profile = state.features.mastra.profiles.find(p => p.id === action.input.id);
|
|
750
|
+
if (!profile) {
|
|
751
|
+
throw new ProfileNotFoundError(\`Profile not found: \${action.input.id}\`);
|
|
752
|
+
}
|
|
753
|
+
if (action.input.title) profile.title = action.input.title;
|
|
754
|
+
if (action.input.content) profile.content = action.input.content;`,errors:[{id:`e-update-profile-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-update-profile-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`The specified profile was not found.`,template:``}],examples:[],scope:`global`},{id:`o-remove-profile`,name:`REMOVE_PROFILE`,description:`Remove a profile from the library. Rejects when any agent (main or sub) references it.`,schema:`input RemoveProfileInput {
|
|
755
|
+
id: OID!
|
|
756
|
+
}`,template:`Remove a profile from the library.`,reducer:`if (!state.features.mastra.enabled) {
|
|
757
|
+
throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');
|
|
758
|
+
}
|
|
759
|
+
const idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);
|
|
760
|
+
if (idx === -1) {
|
|
761
|
+
throw new ProfileNotFoundError(\`Profile not found: \${action.input.id}\`);
|
|
762
|
+
}
|
|
763
|
+
const main = state.features.mastra.mainAgent;
|
|
764
|
+
const usedByMain = !!main && main.profileIds.includes(action.input.id);
|
|
765
|
+
const usedBySub = state.features.mastra.subAgents.some(
|
|
766
|
+
(s) => s.profileIds.includes(action.input.id),
|
|
767
|
+
);
|
|
768
|
+
if (usedByMain || usedBySub) {
|
|
769
|
+
throw new ProfileInUseError(
|
|
770
|
+
\`Profile \${action.input.id} is in use by an agent.\`,
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
state.features.mastra.profiles.splice(idx, 1);`,errors:[{id:`e-remove-profile-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-remove-profile-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`The specified profile was not found.`,template:``},{id:`e-remove-profile-in-use`,name:`ProfileInUseError`,code:`PROFILE_IN_USE`,description:`Cannot remove a profile that is still referenced by an agent.`,template:``}],examples:[],scope:`global`},{id:`o-reorder-profiles`,name:`REORDER_PROFILES`,description:`Move one or more profiles before another profile, or to the end if insertBefore is null.`,schema:`input ReorderProfilesInput {
|
|
774
|
+
ids: [OID!]!
|
|
775
|
+
insertBefore: OID
|
|
776
|
+
}`,template:`Reorder profiles.`,reducer:`if (!state.features.mastra.enabled) {
|
|
777
|
+
throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');
|
|
778
|
+
}
|
|
779
|
+
const moving = [];
|
|
780
|
+
for (const id of action.input.ids) {
|
|
781
|
+
const profile = state.features.mastra.profiles.find(p => p.id === id);
|
|
782
|
+
if (!profile) {
|
|
783
|
+
throw new ProfileNotFoundError(\`Profile not found: \${id}\`);
|
|
784
|
+
}
|
|
785
|
+
moving.push(profile);
|
|
786
|
+
}
|
|
787
|
+
state.features.mastra.profiles = state.features.mastra.profiles.filter(p => !action.input.ids.includes(p.id));
|
|
788
|
+
if (action.input.insertBefore) {
|
|
789
|
+
const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);
|
|
790
|
+
if (beforeIdx === -1) {
|
|
791
|
+
throw new ProfileNotFoundError(\`insertBefore profile not found: \${action.input.insertBefore}\`);
|
|
792
|
+
}
|
|
793
|
+
state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);
|
|
794
|
+
} else {
|
|
795
|
+
state.features.mastra.profiles.push(...moving);
|
|
796
|
+
}`,errors:[{id:`e-reorder-profiles-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing profiles.`,template:``},{id:`e-reorder-profiles-not-found`,name:`ProfileNotFoundError`,code:`PROFILE_NOT_FOUND`,description:`A referenced profile was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-mastra-main-agent`,name:`mastra_main_agent`,description:`Main agent identity ops. Main agent ID is set at ENABLE_MASTRA and stable thereafter — to change it, disable then re-enable.`,operations:[{id:`o-set-main-agent-name`,name:`SET_MAIN_AGENT_NAME`,description:`Set the main agent's display name. Must be non-empty after trim.`,schema:`input SetMainAgentNameInput {
|
|
797
|
+
name: String!
|
|
798
|
+
}`,template:`Set the main agent's display name.`,reducer:`const main = state.features.mastra.mainAgent;
|
|
799
|
+
if (!state.features.mastra.enabled || !main) {
|
|
800
|
+
throw new MastraNotEnabledError(
|
|
801
|
+
'Cannot set main agent name when Mastra is disabled.',
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
const trimmed = action.input.name.trim();
|
|
805
|
+
if (!trimmed) {
|
|
806
|
+
throw new InvalidAgentNameError('Agent name must not be empty.');
|
|
807
|
+
}
|
|
808
|
+
main.name = trimmed;`,errors:[{id:`e-set-main-name-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing the main agent.`,template:``},{id:`e-set-main-name-invalid`,name:`InvalidAgentNameError`,code:`INVALID_AGENT_NAME`,description:`The agent name must not be empty after trimming.`,template:``}],examples:[],scope:`global`},{id:`o-set-main-agent-description`,name:`SET_MAIN_AGENT_DESCRIPTION`,description:`Set the main agent's description.`,schema:`input SetMainAgentDescriptionInput {
|
|
809
|
+
description: String!
|
|
810
|
+
}`,template:`Set the main agent's description.`,reducer:`const main = state.features.mastra.mainAgent;
|
|
811
|
+
if (!state.features.mastra.enabled || !main) {
|
|
812
|
+
throw new MastraNotEnabledError(
|
|
813
|
+
'Cannot set main agent description when Mastra is disabled.',
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
main.description = action.input.description;`,errors:[{id:`e-set-main-desc-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing the main agent.`,template:``}],examples:[],scope:`global`},{id:`o-clear-main-agent-description`,name:`CLEAR_MAIN_AGENT_DESCRIPTION`,description:`Clear the main agent's description.`,schema:`input ClearMainAgentDescriptionInput {
|
|
817
|
+
_: Boolean
|
|
818
|
+
}`,template:`Clear the main agent's description.`,reducer:`const main = state.features.mastra.mainAgent;
|
|
819
|
+
if (!state.features.mastra.enabled || !main) {
|
|
820
|
+
throw new MastraNotEnabledError(
|
|
821
|
+
'Cannot clear main agent description when Mastra is disabled.',
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
main.description = null;`,errors:[{id:`e-clear-main-desc-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing the main agent.`,template:``}],examples:[],scope:`global`},{id:`o-set-main-agent-image`,name:`SET_MAIN_AGENT_IMAGE`,description:`Set the main agent's avatar image. Must be a data URL.`,schema:`input SetMainAgentImageInput {
|
|
825
|
+
image: String!
|
|
826
|
+
}`,template:`Set the main agent's avatar.`,reducer:`const main = state.features.mastra.mainAgent;
|
|
827
|
+
if (!state.features.mastra.enabled || !main) {
|
|
828
|
+
throw new MastraNotEnabledError(
|
|
829
|
+
'Cannot set main agent image when Mastra is disabled.',
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.image)) {
|
|
833
|
+
throw new InvalidAgentImageError(
|
|
834
|
+
'Agent image must be a data URL (data:image/...;base64,...)',
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
main.image = action.input.image;`,errors:[{id:`e-set-main-image-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing the main agent.`,template:``},{id:`e-set-main-image-invalid`,name:`InvalidAgentImageError`,code:`INVALID_AGENT_IMAGE`,description:`Agent image must be a data URL`,template:``}],examples:[],scope:`global`},{id:`o-clear-main-agent-image`,name:`CLEAR_MAIN_AGENT_IMAGE`,description:`Clear the main agent's avatar.`,schema:`input ClearMainAgentImageInput {
|
|
838
|
+
_: Boolean
|
|
839
|
+
}`,template:`Clear the main agent's avatar.`,reducer:`const main = state.features.mastra.mainAgent;
|
|
840
|
+
if (!state.features.mastra.enabled || !main) {
|
|
841
|
+
throw new MastraNotEnabledError(
|
|
842
|
+
'Cannot clear main agent image when Mastra is disabled.',
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
main.image = null;`,errors:[{id:`e-clear-main-image-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing the main agent.`,template:``}],examples:[],scope:`global`}]},{id:`m-mastra-sub-agents`,name:`mastra_sub_agents`,description:`Sub-agent CRUD. Sub-agent ids are unique across the main agent and all other sub-agents.`,operations:[{id:`o-add-sub-agent`,name:`ADD_SUB_AGENT`,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.`,schema:`input AddSubAgentInput {
|
|
846
|
+
id: OID!
|
|
847
|
+
name: String!
|
|
848
|
+
description: String!
|
|
849
|
+
modelId: OID!
|
|
850
|
+
}`,template:`Add a sub-agent.`,reducer:`const main = state.features.mastra.mainAgent;
|
|
851
|
+
if (!state.features.mastra.enabled || !main) {
|
|
852
|
+
throw new MastraNotEnabledError(
|
|
853
|
+
'Cannot add sub-agent when Mastra is disabled.',
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {
|
|
857
|
+
throw new InvalidAgentIdError(
|
|
858
|
+
\`Invalid sub-agent ID: \${action.input.id}. Must be lowercase kebab-case.\`,
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
const trimmedName = action.input.name.trim();
|
|
862
|
+
if (!trimmedName) {
|
|
863
|
+
throw new InvalidAgentNameError('Sub-agent name must not be empty.');
|
|
864
|
+
}
|
|
865
|
+
if (main.id === action.input.id) {
|
|
866
|
+
throw new DuplicateAgentIdError(
|
|
867
|
+
\`Agent ID already taken by main agent: \${action.input.id}\`,
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
if (state.features.mastra.subAgents.find((s) => s.id === action.input.id)) {
|
|
871
|
+
throw new DuplicateAgentIdError(
|
|
872
|
+
\`Sub-agent already exists: \${action.input.id}\`,
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
if (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {
|
|
876
|
+
throw new ModelReferenceNotFoundError(
|
|
877
|
+
\`Model not in library: \${action.input.modelId}\`,
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
state.features.mastra.subAgents.push({
|
|
881
|
+
id: action.input.id,
|
|
882
|
+
name: trimmedName,
|
|
883
|
+
description: action.input.description,
|
|
884
|
+
modelId: action.input.modelId,
|
|
885
|
+
profileIds: [],
|
|
886
|
+
skills: [],
|
|
887
|
+
toolPatterns: [],
|
|
888
|
+
});`,errors:[{id:`e-add-sub-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing sub-agents.`,template:``},{id:`e-add-sub-invalid-id`,name:`InvalidAgentIdError`,code:`INVALID_AGENT_ID`,description:`Sub-agent ID must be lowercase kebab-case.`,template:``},{id:`e-add-sub-invalid-name`,name:`InvalidAgentNameError`,code:`INVALID_AGENT_NAME`,description:`Sub-agent name must not be empty after trimming.`,template:``},{id:`e-add-sub-duplicate`,name:`DuplicateAgentIdError`,code:`DUPLICATE_AGENT_ID`,description:`An agent with this ID already exists (main or sub).`,template:``},{id:`e-add-sub-model-not-found`,name:`ModelReferenceNotFoundError`,code:`MODEL_REFERENCE_NOT_FOUND`,description:`The referenced modelId does not exist in the model library.`,template:``}],examples:[],scope:`global`},{id:`o-remove-sub-agent`,name:`REMOVE_SUB_AGENT`,description:`Remove a sub-agent.`,schema:`input RemoveSubAgentInput {
|
|
889
|
+
id: OID!
|
|
890
|
+
}`,template:`Remove a sub-agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
891
|
+
throw new MastraNotEnabledError('Cannot remove sub-agent when Mastra is disabled.');
|
|
892
|
+
}
|
|
893
|
+
const idx = state.features.mastra.subAgents.findIndex(s => s.id === action.input.id);
|
|
894
|
+
if (idx === -1) {
|
|
895
|
+
throw new AgentNotFoundError(\`Sub-agent not found: \${action.input.id}\`);
|
|
896
|
+
}
|
|
897
|
+
state.features.mastra.subAgents.splice(idx, 1);`,errors:[{id:`e-remove-sub-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing sub-agents.`,template:``},{id:`e-remove-sub-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified sub-agent was not found.`,template:``}],examples:[],scope:`global`},{id:`o-set-sub-agent-name`,name:`SET_SUB_AGENT_NAME`,description:`Set a sub-agent's display name.`,schema:`input SetSubAgentNameInput {
|
|
898
|
+
id: OID!
|
|
899
|
+
name: String!
|
|
900
|
+
}`,template:`Set a sub-agent's display name.`,reducer:`if (!state.features.mastra.enabled) {
|
|
901
|
+
throw new MastraNotEnabledError('Cannot set sub-agent name when Mastra is disabled.');
|
|
902
|
+
}
|
|
903
|
+
const sub = state.features.mastra.subAgents.find(s => s.id === action.input.id);
|
|
904
|
+
if (!sub) {
|
|
905
|
+
throw new AgentNotFoundError(\`Sub-agent not found: \${action.input.id}\`);
|
|
906
|
+
}
|
|
907
|
+
const trimmed = action.input.name.trim();
|
|
908
|
+
if (!trimmed) {
|
|
909
|
+
throw new InvalidAgentNameError('Sub-agent name must not be empty.');
|
|
910
|
+
}
|
|
911
|
+
sub.name = trimmed;`,errors:[{id:`e-set-sub-name-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing sub-agents.`,template:``},{id:`e-set-sub-name-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified sub-agent was not found.`,template:``},{id:`e-set-sub-name-invalid`,name:`InvalidAgentNameError`,code:`INVALID_AGENT_NAME`,description:`Sub-agent name must not be empty after trimming.`,template:``}],examples:[],scope:`global`},{id:`o-set-sub-agent-description`,name:`SET_SUB_AGENT_DESCRIPTION`,description:`Set a sub-agent's description.`,schema:`input SetSubAgentDescriptionInput {
|
|
912
|
+
id: OID!
|
|
913
|
+
description: String!
|
|
914
|
+
}`,template:`Set a sub-agent's description.`,reducer:`if (!state.features.mastra.enabled) {
|
|
915
|
+
throw new MastraNotEnabledError('Cannot set sub-agent description when Mastra is disabled.');
|
|
916
|
+
}
|
|
917
|
+
const sub = state.features.mastra.subAgents.find(s => s.id === action.input.id);
|
|
918
|
+
if (!sub) {
|
|
919
|
+
throw new AgentNotFoundError(\`Sub-agent not found: \${action.input.id}\`);
|
|
920
|
+
}
|
|
921
|
+
sub.description = action.input.description;`,errors:[{id:`e-set-sub-desc-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing sub-agents.`,template:``},{id:`e-set-sub-desc-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified sub-agent was not found.`,template:``}],examples:[],scope:`global`}]},{id:`m-mastra-agent-bindings`,name:`mastra_agent_bindings`,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.`,operations:[{id:`o-set-agent-model`,name:`SET_AGENT_MODEL`,description:`Set the agent's model. modelId must exist in the model library. agentId resolves to main or a sub.`,schema:`input SetAgentModelInput {
|
|
922
|
+
agentId: OID!
|
|
923
|
+
modelId: OID!
|
|
924
|
+
}`,template:`Bind an agent to a model.`,reducer:`if (!state.features.mastra.enabled) {
|
|
925
|
+
throw new MastraNotEnabledError('Cannot set agent model when Mastra is disabled.');
|
|
926
|
+
}
|
|
927
|
+
const main = state.features.mastra.mainAgent;
|
|
928
|
+
let agent;
|
|
929
|
+
if (main && main.id === action.input.agentId) {
|
|
930
|
+
agent = main;
|
|
931
|
+
} else {
|
|
932
|
+
agent = state.features.mastra.subAgents.find(
|
|
933
|
+
(s) => s.id === action.input.agentId,
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
if (!agent) {
|
|
937
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
938
|
+
}
|
|
939
|
+
if (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {
|
|
940
|
+
throw new ModelReferenceNotFoundError(
|
|
941
|
+
\`Model not in library: \${action.input.modelId}\`,
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
agent.modelId = action.input.modelId;`,errors:[{id:`e-set-model-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled before managing agent bindings.`,template:``},{id:`e-set-model-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId resolves to neither main nor any sub-agent.`,template:``},{id:`e-set-model-ref-not-found`,name:`ModelReferenceNotFoundError`,code:`MODEL_REFERENCE_NOT_FOUND`,description:`The referenced modelId does not exist in the model library.`,template:``}],examples:[],scope:`global`},{id:`o-add-agent-profile-ref`,name:`ADD_AGENT_PROFILE_REF`,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.`,schema:`input AddAgentProfileRefInput {
|
|
945
|
+
agentId: OID!
|
|
946
|
+
profileId: OID!
|
|
947
|
+
insertBefore: OID
|
|
948
|
+
}`,template:`Add a profile reference to an agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
949
|
+
throw new MastraNotEnabledError('Cannot add profile ref when Mastra is disabled.');
|
|
950
|
+
}
|
|
951
|
+
const main = state.features.mastra.mainAgent;
|
|
952
|
+
let agent;
|
|
953
|
+
if (main && main.id === action.input.agentId) {
|
|
954
|
+
agent = main;
|
|
955
|
+
} else {
|
|
956
|
+
agent = state.features.mastra.subAgents.find(
|
|
957
|
+
(s) => s.id === action.input.agentId,
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
if (!agent) {
|
|
961
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
962
|
+
}
|
|
963
|
+
if (!state.features.mastra.profiles.find((p) => p.id === action.input.profileId)) {
|
|
964
|
+
throw new ProfileReferenceNotFoundError(
|
|
965
|
+
\`Profile not in library: \${action.input.profileId}\`,
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
if (agent.profileIds.includes(action.input.profileId)) {
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
if (action.input.insertBefore) {
|
|
972
|
+
const beforeIdx = agent.profileIds.indexOf(action.input.insertBefore);
|
|
973
|
+
if (beforeIdx === -1) {
|
|
974
|
+
throw new ProfileReferenceNotFoundError(
|
|
975
|
+
\`insertBefore profile not in agent's profileIds: \${action.input.insertBefore}\`,
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
agent.profileIds.splice(beforeIdx, 0, action.input.profileId);
|
|
979
|
+
} else {
|
|
980
|
+
agent.profileIds.push(action.input.profileId);
|
|
981
|
+
}`,errors:[{id:`e-add-profile-ref-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-add-profile-ref-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-add-profile-ref-not-found`,name:`ProfileReferenceNotFoundError`,code:`PROFILE_REFERENCE_NOT_FOUND`,description:`The referenced profileId does not exist in the profile library, or insertBefore is not present in the agent.`,template:``}],examples:[],scope:`global`},{id:`o-remove-agent-profile-ref`,name:`REMOVE_AGENT_PROFILE_REF`,description:`Remove a profile reference from an agent.`,schema:`input RemoveAgentProfileRefInput {
|
|
982
|
+
agentId: OID!
|
|
983
|
+
profileId: OID!
|
|
984
|
+
}`,template:`Remove a profile reference from an agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
985
|
+
throw new MastraNotEnabledError('Cannot remove profile ref when Mastra is disabled.');
|
|
986
|
+
}
|
|
987
|
+
const main = state.features.mastra.mainAgent;
|
|
988
|
+
let agent;
|
|
989
|
+
if (main && main.id === action.input.agentId) {
|
|
990
|
+
agent = main;
|
|
991
|
+
} else {
|
|
992
|
+
agent = state.features.mastra.subAgents.find(
|
|
993
|
+
(s) => s.id === action.input.agentId,
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
if (!agent) {
|
|
997
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
998
|
+
}
|
|
999
|
+
const idx = agent.profileIds.indexOf(action.input.profileId);
|
|
1000
|
+
if (idx === -1) {
|
|
1001
|
+
throw new ProfileReferenceNotFoundError(
|
|
1002
|
+
\`Profile not in agent's profileIds: \${action.input.profileId}\`,
|
|
1003
|
+
);
|
|
1004
|
+
}
|
|
1005
|
+
agent.profileIds.splice(idx, 1);`,errors:[{id:`e-remove-profile-ref-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-remove-profile-ref-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-remove-profile-ref-not-found`,name:`ProfileReferenceNotFoundError`,code:`PROFILE_REFERENCE_NOT_FOUND`,description:`The profileId is not present in this agent's profileIds.`,template:``}],examples:[],scope:`global`},{id:`o-reorder-agent-profile-refs`,name:`REORDER_AGENT_PROFILE_REFS`,description:`Reorder an agent's profile references. Moves the given ids before insertBefore, or to the end if insertBefore is null.`,schema:`input ReorderAgentProfileRefsInput {
|
|
1006
|
+
agentId: OID!
|
|
1007
|
+
ids: [OID!]!
|
|
1008
|
+
insertBefore: OID
|
|
1009
|
+
}`,template:`Reorder an agent's profile references.`,reducer:`if (!state.features.mastra.enabled) {
|
|
1010
|
+
throw new MastraNotEnabledError('Cannot reorder profile refs when Mastra is disabled.');
|
|
1011
|
+
}
|
|
1012
|
+
const main = state.features.mastra.mainAgent;
|
|
1013
|
+
let agent;
|
|
1014
|
+
if (main && main.id === action.input.agentId) {
|
|
1015
|
+
agent = main;
|
|
1016
|
+
} else {
|
|
1017
|
+
agent = state.features.mastra.subAgents.find(
|
|
1018
|
+
(s) => s.id === action.input.agentId,
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
if (!agent) {
|
|
1022
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
1023
|
+
}
|
|
1024
|
+
for (const id of action.input.ids) {
|
|
1025
|
+
if (!agent.profileIds.includes(id)) {
|
|
1026
|
+
throw new ProfileReferenceNotFoundError(
|
|
1027
|
+
\`Profile not in agent's profileIds: \${id}\`,
|
|
1028
|
+
);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
const remaining = agent.profileIds.filter(
|
|
1032
|
+
(id) => !action.input.ids.includes(id),
|
|
1033
|
+
);
|
|
1034
|
+
if (action.input.insertBefore) {
|
|
1035
|
+
const beforeIdx = remaining.indexOf(action.input.insertBefore);
|
|
1036
|
+
if (beforeIdx === -1) {
|
|
1037
|
+
throw new ProfileReferenceNotFoundError(
|
|
1038
|
+
\`insertBefore profile not in agent's profileIds: \${action.input.insertBefore}\`,
|
|
1039
|
+
);
|
|
1040
|
+
}
|
|
1041
|
+
remaining.splice(beforeIdx, 0, ...action.input.ids);
|
|
1042
|
+
} else {
|
|
1043
|
+
remaining.push(...action.input.ids);
|
|
1044
|
+
}
|
|
1045
|
+
agent.profileIds = remaining;`,errors:[{id:`e-reorder-refs-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-reorder-refs-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-reorder-refs-not-found`,name:`ProfileReferenceNotFoundError`,code:`PROFILE_REFERENCE_NOT_FOUND`,description:`A referenced profileId is not present in this agent.`,template:``}],examples:[],scope:`global`},{id:`o-add-agent-skill`,name:`ADD_AGENT_SKILL`,description:`Add a skill name to an agent. Dedup: silent if already present.`,schema:`input AddAgentSkillInput {
|
|
1046
|
+
agentId: OID!
|
|
1047
|
+
name: String!
|
|
1048
|
+
}`,template:`Add a skill to an agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
1049
|
+
throw new MastraNotEnabledError('Cannot add skill when Mastra is disabled.');
|
|
1050
|
+
}
|
|
1051
|
+
const main = state.features.mastra.mainAgent;
|
|
1052
|
+
let agent;
|
|
1053
|
+
if (main && main.id === action.input.agentId) {
|
|
1054
|
+
agent = main;
|
|
1055
|
+
} else {
|
|
1056
|
+
agent = state.features.mastra.subAgents.find(
|
|
1057
|
+
(s) => s.id === action.input.agentId,
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
if (!agent) {
|
|
1061
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
1062
|
+
}
|
|
1063
|
+
const trimmed = action.input.name.trim();
|
|
1064
|
+
if (!/^[a-z][a-z0-9-]*$/.test(trimmed)) {
|
|
1065
|
+
throw new InvalidSkillNameError(
|
|
1066
|
+
\`Invalid skill name: \${action.input.name}. Must be lowercase kebab-case.\`,
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
if (!agent.skills.includes(trimmed)) {
|
|
1070
|
+
agent.skills.push(trimmed);
|
|
1071
|
+
}`,errors:[{id:`e-add-skill-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-add-skill-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-add-skill-invalid`,name:`InvalidSkillNameError`,code:`INVALID_SKILL_NAME`,description:`Skill name must be lowercase kebab-case.`,template:``}],examples:[],scope:`global`},{id:`o-remove-agent-skill`,name:`REMOVE_AGENT_SKILL`,description:`Remove a skill name from an agent.`,schema:`input RemoveAgentSkillInput {
|
|
1072
|
+
agentId: OID!
|
|
1073
|
+
name: String!
|
|
1074
|
+
}`,template:`Remove a skill from an agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
1075
|
+
throw new MastraNotEnabledError('Cannot remove skill when Mastra is disabled.');
|
|
1076
|
+
}
|
|
1077
|
+
const main = state.features.mastra.mainAgent;
|
|
1078
|
+
let agent;
|
|
1079
|
+
if (main && main.id === action.input.agentId) {
|
|
1080
|
+
agent = main;
|
|
1081
|
+
} else {
|
|
1082
|
+
agent = state.features.mastra.subAgents.find(
|
|
1083
|
+
(s) => s.id === action.input.agentId,
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
if (!agent) {
|
|
1087
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
1088
|
+
}
|
|
1089
|
+
const idx = agent.skills.indexOf(action.input.name);
|
|
1090
|
+
if (idx === -1) {
|
|
1091
|
+
throw new SkillNotFoundError(\`Skill not on agent: \${action.input.name}\`);
|
|
1092
|
+
}
|
|
1093
|
+
agent.skills.splice(idx, 1);`,errors:[{id:`e-remove-skill-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-remove-skill-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-remove-skill-not-found`,name:`SkillNotFoundError`,code:`SKILL_NOT_FOUND`,description:`The skill name is not on this agent.`,template:``}],examples:[],scope:`global`},{id:`o-add-agent-tool-pattern`,name:`ADD_AGENT_TOOL_PATTERN`,description:`Add a tool-name glob pattern to an agent. Dedup: silent if already present.`,schema:`input AddAgentToolPatternInput {
|
|
1094
|
+
agentId: OID!
|
|
1095
|
+
pattern: String!
|
|
1096
|
+
}`,template:`Add a tool-name pattern to an agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
1097
|
+
throw new MastraNotEnabledError('Cannot add tool pattern when Mastra is disabled.');
|
|
1098
|
+
}
|
|
1099
|
+
const main = state.features.mastra.mainAgent;
|
|
1100
|
+
let agent;
|
|
1101
|
+
if (main && main.id === action.input.agentId) {
|
|
1102
|
+
agent = main;
|
|
1103
|
+
} else {
|
|
1104
|
+
agent = state.features.mastra.subAgents.find(
|
|
1105
|
+
(s) => s.id === action.input.agentId,
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
if (!agent) {
|
|
1109
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
1110
|
+
}
|
|
1111
|
+
const trimmed = action.input.pattern.trim();
|
|
1112
|
+
if (!trimmed) {
|
|
1113
|
+
throw new InvalidToolPatternError('Tool pattern must not be empty after trimming.');
|
|
1114
|
+
}
|
|
1115
|
+
if (!agent.toolPatterns.includes(trimmed)) {
|
|
1116
|
+
agent.toolPatterns.push(trimmed);
|
|
1117
|
+
}`,errors:[{id:`e-add-pattern-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-add-pattern-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-add-pattern-invalid`,name:`InvalidToolPatternError`,code:`INVALID_TOOL_PATTERN`,description:`Tool pattern must not be empty after trimming.`,template:``}],examples:[],scope:`global`},{id:`o-remove-agent-tool-pattern`,name:`REMOVE_AGENT_TOOL_PATTERN`,description:`Remove a tool-name glob pattern from an agent.`,schema:`input RemoveAgentToolPatternInput {
|
|
1118
|
+
agentId: OID!
|
|
1119
|
+
pattern: String!
|
|
1120
|
+
}`,template:`Remove a tool-name pattern from an agent.`,reducer:`if (!state.features.mastra.enabled) {
|
|
1121
|
+
throw new MastraNotEnabledError('Cannot remove tool pattern when Mastra is disabled.');
|
|
1122
|
+
}
|
|
1123
|
+
const main = state.features.mastra.mainAgent;
|
|
1124
|
+
let agent;
|
|
1125
|
+
if (main && main.id === action.input.agentId) {
|
|
1126
|
+
agent = main;
|
|
1127
|
+
} else {
|
|
1128
|
+
agent = state.features.mastra.subAgents.find(
|
|
1129
|
+
(s) => s.id === action.input.agentId,
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
if (!agent) {
|
|
1133
|
+
throw new AgentNotFoundError(\`Agent not found: \${action.input.agentId}\`);
|
|
1134
|
+
}
|
|
1135
|
+
const idx = agent.toolPatterns.indexOf(action.input.pattern);
|
|
1136
|
+
if (idx === -1) {
|
|
1137
|
+
throw new ToolPatternNotFoundError(
|
|
1138
|
+
\`Tool pattern not on agent: \${action.input.pattern}\`,
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
agent.toolPatterns.splice(idx, 1);`,errors:[{id:`e-remove-pattern-not-enabled`,name:`MastraNotEnabledError`,code:`MASTRA_NOT_ENABLED`,description:`Mastra must be enabled.`,template:``},{id:`e-remove-pattern-agent-not-found`,name:`AgentNotFoundError`,code:`AGENT_NOT_FOUND`,description:`The specified agentId was not found.`,template:``},{id:`e-remove-pattern-not-found`,name:`ToolPatternNotFoundError`,code:`TOOL_PATTERN_NOT_FOUND`,description:`The tool pattern is not on this agent.`,template:``}],examples:[],scope:`global`}]}],version:1,changeLog:[]}]},Nn=class extends Error{errorCode=`DuplicateResourceError`;constructor(e=`DuplicateResourceError`){super(e)}},Pn=class extends Error{errorCode=`ResourceNotFoundError`;constructor(e=`ResourceNotFoundError`){super(e)}},N={addSupportedResourceOperation(e,t){if(e.deployment.supportedResources.includes(t.input.resource))throw new Nn(`Resource already exists: ${t.input.resource}`);e.deployment.supportedResources.push(t.input.resource)},removeSupportedResourceOperation(e,t){let n=e.deployment.supportedResources.indexOf(t.input.resource);if(n===-1)throw new Pn(`Resource not found: ${t.input.resource}`);e.deployment.supportedResources.splice(n,1)},setProxyEnabledOperation(e,t){e.deployment.proxyEnabled=t.input.enabled},setObservabilityEnabledOperation(e,t){e.deployment.observabilityEnabled=t.input.enabled}},Fn=class extends Error{errorCode=`InvalidSkillNameError`;constructor(e=`InvalidSkillNameError`){super(e)}},In=class extends Error{errorCode=`DuplicateSkillError`;constructor(e=`DuplicateSkillError`){super(e)}},Ln=class extends Error{errorCode=`SkillNotFoundError`;constructor(e=`SkillNotFoundError`){super(e)}},P={addExternalSkillOperation(e,t){if(!/^[a-z][a-z0-9-]*$/.test(t.input.name))throw new Fn(`Invalid skill name: ${t.input.name}. Must be lowercase kebab-case.`);if(e.externalSkills.find(e=>e.id===t.input.id||e.name===t.input.name))throw new In(`Skill already exists: ${t.input.name}`);e.externalSkills.push({id:t.input.id,name:t.input.name,githubUrl:t.input.githubUrl})},removeExternalSkillOperation(e,t){let n=e.externalSkills.findIndex(e=>e.id===t.input.id);if(n===-1)throw new Ln(`Skill not found: ${t.input.id}`);e.externalSkills.splice(n,1)},setExternalSkillNameOperation(e,t){let n=e.externalSkills.find(e=>e.id===t.input.id);if(!n)throw new Ln(`Skill not found: ${t.input.id}`);if(!/^[a-z][a-z0-9-]*$/.test(t.input.name))throw new Fn(`Invalid skill name: ${t.input.name}. Must be lowercase kebab-case.`);if(e.externalSkills.find(e=>e.name===t.input.name&&e.id!==t.input.id))throw new In(`Skill name already in use: ${t.input.name}`);n.name=t.input.name},setExternalSkillGithubUrlOperation(e,t){let n=e.externalSkills.find(e=>e.id===t.input.id);if(!n)throw new Ln(`Skill not found: ${t.input.id}`);n.githubUrl=t.input.githubUrl}},Rn=class extends Error{errorCode=`InvalidAgentIdError`;constructor(e=`InvalidAgentIdError`){super(e)}},zn=class extends Error{errorCode=`InvalidAgentNameError`;constructor(e=`InvalidAgentNameError`){super(e)}},Bn=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},Vn=class extends Error{errorCode=`PowerhouseNotEnabledError`;constructor(e=`PowerhouseNotEnabledError`){super(e)}},Hn={enableMastraOperation(e,t){if(!/^[a-z][a-z0-9-]*$/.test(t.input.agentId))throw new Rn(`Invalid agent ID: ${t.input.agentId}. Must be lowercase kebab-case.`);let n=t.input.agentName.trim();if(!n)throw new zn(`Agent name must not be empty.`);e.features.mastra.enabled=!0,e.features.mastra.models.length===0&&e.features.mastra.models.push({id:`clint/demo-agent`,isDefault:!0}),e.features.mastra.profiles.length===0&&e.features.mastra.profiles.push({id:`base`,title:`Base Profile`,content:`You are a helpful assistant.`});let r=e.features.mastra.mainAgent;r?(r.id=t.input.agentId,r.name=n):e.features.mastra.mainAgent={id:t.input.agentId,name:n,description:null,image:null,modelId:`clint/demo-agent`,profileIds:[`base`],skills:[],toolPatterns:[]}},disableMastraOperation(e){e.features.mastra.enabled=!1,e.features.mastra.mainAgent=null,e.features.mastra.subAgents=[],e.features.mastra.models=[],e.features.mastra.profiles=[],e.features.mastra.common.enableChat=!1;let t=e.packages.findIndex(e=>e.packageName===`@powerhousedao/clint-common`&&e.managed);t!==-1&&e.packages.splice(t,1)},setEnableChatOperation(e,t){if(!e.features.mastra.enabled)throw new Bn(`Cannot toggle chat when Mastra is disabled.`);if(e.features.powerhouse===`Disabled`)throw new Vn(`Cannot toggle chat when Powerhouse is disabled.`);e.features.mastra.common.enableChat=t.input.enabled;let n=`@powerhousedao/clint-common`,r=`powerhouse/chat-session`;if(t.input.enabled){let t=e.packages.find(e=>e.packageName===n);t?t.documentTypes.includes(r)||t.documentTypes.push(r):e.packages.push({id:`pkg-clint-common`,packageName:n,documentTypes:[r],version:null,managed:!0})}else{let t=e.packages.findIndex(e=>e.packageName===n&&e.managed);if(t!==-1){let n=e.packages[t];if(n.documentTypes.length===1&&n.documentTypes[0]===r)e.packages.splice(t,1);else{let e=n.documentTypes.indexOf(r);e!==-1&&n.documentTypes.splice(e,1)}}}}},Un=class extends Error{errorCode=`CannotLowerPowerhouseError`;constructor(e=`CannotLowerPowerhouseError`){super(e)}},Wn=[`Disabled`,`Reactor`,`Switchboard`,`Connect`],Gn={setPowerhouseLevelOperation(e,t){let n=Wn.indexOf(e.features.powerhouse),r=Wn.indexOf(t.input.level);if(n>=1&&r<1)throw new Un(`Cannot lower Powerhouse level below Reactor once enabled`);if(e.features.powerhouse=t.input.level,n===0&&r>=1&&!e.packages.some(e=>e.managed)){let t=e.name?e.name.replace(/-cli$/,`-app`):`app`,n=e.scope&&e.name?`${e.scope}/${t}`:t;e.packages.push({id:`app-${e.name||`managed`}`,packageName:n,documentTypes:[`*/*`],version:null,managed:!0})}r>=2&&!t.input.skipAutoProxy&&(e.deployment.proxyEnabled=!0)}},Kn={enableRoutineOperation(e){e.features.routine.enabled=!0},disableRoutineOperation(e){e.features.routine.enabled=!1}},qn=class extends Error{errorCode=`InvalidVersionError`;constructor(e=`InvalidVersionError`){super(e)}},F=class extends Error{errorCode=`InvalidPackageIdentifierError`;constructor(e=`InvalidPackageIdentifierError`){super(e)}},Jn=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,Yn=/^[a-z][a-z0-9-]*$/,Xn={setVersionOperation(e,t){if(!Jn.test(t.input.version))throw new qn(`Invalid version: ${t.input.version}`);e.version=t.input.version},setDescriptionOperation(e,t){e.description=t.input.description},setPackageIdentifierOperation(e,t){let n=t.input.identifier.trim();if(!n)throw new F(`Package identifier must not be empty`);let r=null,i=n;if(n.includes(`/`)){let e=n.split(`/`);if(e.length!==2||!e[0]||!e[1])throw new F(`Invalid package identifier: ${n}`);r=e[0].replace(/^@/,``),i=e[1]}if(r!==null&&!Yn.test(r))throw new F(`Invalid scope: ${r}`);if(i.endsWith(`-cli`)||(i+=`-cli`),!Yn.test(i))throw new F(`Invalid package name: ${i}`);e.scope=r?`@${r}`:null,e.name=i;let a=e.packages.find(e=>e.managed);if(a){let e=i.replace(/-cli$/,`-app`);a.packageName=r?`@${r}/${e}`:e,a.id=`app-${i}`}}},Zn=class extends Error{errorCode=`InvalidAgentImageError`;constructor(e=`InvalidAgentImageError`){super(e)}},Qn={importSpecOperation(e,t){e.name=t.input.name,e.scope=t.input.scope||null,e.version=t.input.version,e.description=t.input.description,e.features.powerhouse=t.input.powerhouse,e.features.mastra.enabled=t.input.mastraEnabled,e.features.routine.enabled=t.input.routineEnabled;let n=t.input.name.replace(/-cli$/,`-app`),r=t.input.scope?`${t.input.scope}/${n}`:n,i=t.input.powerhouse!==`Disabled`;if(e.packages=t.input.packages.map(e=>({id:e.id,packageName:e.packageName,documentTypes:[...e.documentTypes],version:e.version||null,managed:i&&e.packageName===r})),e.externalSkills=t.input.externalSkills.map(e=>({id:e.id,name:e.name,githubUrl:e.githubUrl})),e.features.mastra.models=t.input.models.map(e=>({id:e.id,isDefault:e.isDefault})),e.features.mastra.profiles=t.input.profiles.map(e=>({id:e.id,title:e.title,content:e.content})),t.input.mainAgent&&e.features.mastra.enabled){let n=t.input.mainAgent,r=null;if(n.image){if(!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(n.image))throw new Zn(`Invalid image: must be a data URL (data:<mime>;base64,...)`);r=n.image}e.features.mastra.mainAgent={id:n.id,name:n.name,description:n.description||null,image:r,modelId:n.modelId,profileIds:[...n.profileIds],skills:[...n.skills],toolPatterns:[...n.toolPatterns]}}else e.features.mastra.mainAgent=null;if(e.features.mastra.enabled?e.features.mastra.subAgents=t.input.subAgents.map(e=>({id:e.id,name:e.name,description:e.description,modelId:e.modelId,profileIds:[...e.profileIds],skills:[...e.skills],toolPatterns:[...e.toolPatterns]})):e.features.mastra.subAgents=[],t.input.enableChat&&e.features.mastra.enabled&&e.features.powerhouse!==`Disabled`){e.features.mastra.common.enableChat=!0;let t=`@powerhousedao/clint-common`,n=`powerhouse/chat-session`,r=e.packages.find(e=>e.packageName===t);r?r.documentTypes.includes(n)||r.documentTypes.push(n):e.packages.push({id:`pkg-clint-common`,packageName:t,documentTypes:[n],version:null,managed:!0})}else e.features.mastra.common.enableChat=!1;e.deployment.proxyEnabled=t.input.proxyEnabled??!1,e.deployment.observabilityEnabled=t.input.observabilityEnabled??!1,e.deployment.supportedResources=t.input.supportedResources?[...t.input.supportedResources]:[]}},I=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},L=class extends Error{errorCode=`AgentNotFoundError`;constructor(e=`AgentNotFoundError`){super(e)}},$n=class extends Error{errorCode=`ModelReferenceNotFoundError`;constructor(e=`ModelReferenceNotFoundError`){super(e)}},R=class extends Error{errorCode=`ProfileReferenceNotFoundError`;constructor(e=`ProfileReferenceNotFoundError`){super(e)}},er=class extends Error{errorCode=`InvalidSkillNameError`;constructor(e=`InvalidSkillNameError`){super(e)}},tr=class extends Error{errorCode=`SkillNotFoundError`;constructor(e=`SkillNotFoundError`){super(e)}},nr=class extends Error{errorCode=`InvalidToolPatternError`;constructor(e=`InvalidToolPatternError`){super(e)}},rr=class extends Error{errorCode=`ToolPatternNotFoundError`;constructor(e=`ToolPatternNotFoundError`){super(e)}};function z(e,t,n){return e&&e.id===n?e:t.find(e=>e.id===n)}var B={setAgentModelOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot set agent model when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);if(!e.features.mastra.models.find(e=>e.id===t.input.modelId))throw new $n(`Model not in library: ${t.input.modelId}`);n.modelId=t.input.modelId},addAgentProfileRefOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot add profile ref when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);if(!e.features.mastra.profiles.find(e=>e.id===t.input.profileId))throw new R(`Profile not in library: ${t.input.profileId}`);if(!n.profileIds.includes(t.input.profileId))if(t.input.insertBefore){let e=n.profileIds.indexOf(t.input.insertBefore);if(e===-1)throw new R(`insertBefore profile not in agent's profileIds: ${t.input.insertBefore}`);n.profileIds.splice(e,0,t.input.profileId)}else n.profileIds.push(t.input.profileId)},removeAgentProfileRefOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot remove profile ref when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);let r=n.profileIds.indexOf(t.input.profileId);if(r===-1)throw new R(`Profile not in agent's profileIds: ${t.input.profileId}`);n.profileIds.splice(r,1)},reorderAgentProfileRefsOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot reorder profile refs when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);for(let e of t.input.ids)if(!n.profileIds.includes(e))throw new R(`Profile not in agent's profileIds: ${e}`);let r=n.profileIds.filter(e=>!t.input.ids.includes(e));if(t.input.insertBefore){let e=r.indexOf(t.input.insertBefore);if(e===-1)throw new R(`insertBefore profile not in agent's profileIds: ${t.input.insertBefore}`);r.splice(e,0,...t.input.ids)}else r.push(...t.input.ids);n.profileIds=r},addAgentSkillOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot add skill when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);let r=t.input.name.trim();if(!/^[a-z][a-z0-9-]*$/.test(r))throw new er(`Invalid skill name: ${t.input.name}. Must be lowercase kebab-case.`);n.skills.includes(r)||n.skills.push(r)},removeAgentSkillOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot remove skill when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);let r=n.skills.indexOf(t.input.name);if(r===-1)throw new tr(`Skill not on agent: ${t.input.name}`);n.skills.splice(r,1)},addAgentToolPatternOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot add tool pattern when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);let r=t.input.pattern.trim();if(!r)throw new nr(`Tool pattern must not be empty after trimming.`);n.toolPatterns.includes(r)||n.toolPatterns.push(r)},removeAgentToolPatternOperation(e,t){if(!e.features.mastra.enabled)throw new I(`Cannot remove tool pattern when Mastra is disabled.`);let n=z(e.features.mastra.mainAgent,e.features.mastra.subAgents,t.input.agentId);if(!n)throw new L(`Agent not found: ${t.input.agentId}`);let r=n.toolPatterns.indexOf(t.input.pattern);if(r===-1)throw new rr(`Tool pattern not on agent: ${t.input.pattern}`);n.toolPatterns.splice(r,1)}},V=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},ir=class extends Error{errorCode=`InvalidAgentNameError`;constructor(e=`InvalidAgentNameError`){super(e)}},ar=class extends Error{errorCode=`InvalidAgentImageError`;constructor(e=`InvalidAgentImageError`){super(e)}},H={setMainAgentNameOperation(e,t){let n=e.features.mastra.mainAgent;if(!e.features.mastra.enabled||!n)throw new V(`Cannot set main agent name when Mastra is disabled.`);let r=t.input.name.trim();if(!r)throw new ir(`Agent name must not be empty.`);n.name=r},setMainAgentDescriptionOperation(e,t){let n=e.features.mastra.mainAgent;if(!e.features.mastra.enabled||!n)throw new V(`Cannot set main agent description when Mastra is disabled.`);n.description=t.input.description},clearMainAgentDescriptionOperation(e){let t=e.features.mastra.mainAgent;if(!e.features.mastra.enabled||!t)throw new V(`Cannot clear main agent description when Mastra is disabled.`);t.description=null},setMainAgentImageOperation(e,t){let n=e.features.mastra.mainAgent;if(!e.features.mastra.enabled||!n)throw new V(`Cannot set main agent image when Mastra is disabled.`);if(!/^data:[a-z]+\/[a-z0-9.+-]+;base64,/.test(t.input.image))throw new ar(`Agent image must be a data URL (data:image/...;base64,...)`);n.image=t.input.image},clearMainAgentImageOperation(e){let t=e.features.mastra.mainAgent;if(!e.features.mastra.enabled||!t)throw new V(`Cannot clear main agent image when Mastra is disabled.`);t.image=null}},or=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},sr=class extends Error{errorCode=`InvalidModelIdError`;constructor(e=`InvalidModelIdError`){super(e)}},cr=class extends Error{errorCode=`DuplicateModelError`;constructor(e=`DuplicateModelError`){super(e)}},lr=class extends Error{errorCode=`ModelNotFoundError`;constructor(e=`ModelNotFoundError`){super(e)}},ur=class extends Error{errorCode=`ModelInUseError`;constructor(e=`ModelInUseError`){super(e)}},dr={addModelOperation(e,t){if(!e.features.mastra.enabled)throw new or(`Cannot add model when Mastra is disabled.`);if(!/^[a-z0-9-]+\/[a-z0-9._-]+$/.test(t.input.id))throw new sr(`Invalid model ID: ${t.input.id}. Must be provider/model-name format.`);if(e.features.mastra.models.find(e=>e.id===t.input.id))throw new cr(`Model already exists: ${t.input.id}`);let n=e.features.mastra.models.length===0||t.input.isDefault===!0;if(n)for(let t of e.features.mastra.models)t.isDefault=!1;e.features.mastra.models.push({id:t.input.id,isDefault:n})},removeModelOperation(e,t){if(!e.features.mastra.enabled)throw new or(`Cannot remove model when Mastra is disabled.`);let n=e.features.mastra.models.findIndex(e=>e.id===t.input.id);if(n===-1)throw new lr(`Model not found: ${t.input.id}`);let r=e.features.mastra.mainAgent,i=!!r&&r.modelId===t.input.id,a=e.features.mastra.subAgents.some(e=>e.modelId===t.input.id);if(i||a)throw new ur(`Model ${t.input.id} is in use by an agent.`);let ee=e.features.mastra.models[n].isDefault;e.features.mastra.models.splice(n,1),ee&&e.features.mastra.models.length>0&&(e.features.mastra.models[0].isDefault=!0)},setDefaultModelOperation(e,t){if(!e.features.mastra.enabled)throw new or(`Cannot set default model when Mastra is disabled.`);let n=e.features.mastra.models.find(e=>e.id===t.input.id);if(!n)throw new lr(`Model not found: ${t.input.id}`);for(let t of e.features.mastra.models)t.isDefault=!1;n.isDefault=!0}},U=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},fr=class extends Error{errorCode=`InvalidProfileIdError`;constructor(e=`InvalidProfileIdError`){super(e)}},pr=class extends Error{errorCode=`DuplicateProfileError`;constructor(e=`DuplicateProfileError`){super(e)}},W=class extends Error{errorCode=`ProfileNotFoundError`;constructor(e=`ProfileNotFoundError`){super(e)}},mr=class extends Error{errorCode=`ProfileInUseError`;constructor(e=`ProfileInUseError`){super(e)}},G={addProfileOperation(e,t){if(!e.features.mastra.enabled)throw new U(`Cannot add profile when Mastra is disabled.`);if(!/^[a-z][a-z0-9-]*$/.test(t.input.id))throw new fr(`Invalid profile ID: ${t.input.id}. Must be lowercase kebab-case.`);if(e.features.mastra.profiles.find(e=>e.id===t.input.id))throw new pr(`Profile already exists: ${t.input.id}`);let n={id:t.input.id,title:t.input.title,content:t.input.content};if(t.input.insertBefore){let r=e.features.mastra.profiles.findIndex(e=>e.id===t.input.insertBefore);if(r===-1)throw new W(`insertBefore profile not found: ${t.input.insertBefore}`);e.features.mastra.profiles.splice(r,0,n)}else e.features.mastra.profiles.push(n)},updateProfileOperation(e,t){if(!e.features.mastra.enabled)throw new U(`Cannot update profile when Mastra is disabled.`);let n=e.features.mastra.profiles.find(e=>e.id===t.input.id);if(!n)throw new W(`Profile not found: ${t.input.id}`);t.input.title&&(n.title=t.input.title),t.input.content&&(n.content=t.input.content)},removeProfileOperation(e,t){if(!e.features.mastra.enabled)throw new U(`Cannot remove profile when Mastra is disabled.`);let n=e.features.mastra.profiles.findIndex(e=>e.id===t.input.id);if(n===-1)throw new W(`Profile not found: ${t.input.id}`);let r=e.features.mastra.mainAgent,i=!!r&&r.profileIds.includes(t.input.id),a=e.features.mastra.subAgents.some(e=>e.profileIds.includes(t.input.id));if(i||a)throw new mr(`Profile ${t.input.id} is in use by an agent.`);e.features.mastra.profiles.splice(n,1)},reorderProfilesOperation(e,t){if(!e.features.mastra.enabled)throw new U(`Cannot reorder profiles when Mastra is disabled.`);let n=[];for(let r of t.input.ids){let t=e.features.mastra.profiles.find(e=>e.id===r);if(!t)throw new W(`Profile not found: ${r}`);n.push(t)}if(e.features.mastra.profiles=e.features.mastra.profiles.filter(e=>!t.input.ids.includes(e.id)),t.input.insertBefore){let r=e.features.mastra.profiles.findIndex(e=>e.id===t.input.insertBefore);if(r===-1)throw new W(`insertBefore profile not found: ${t.input.insertBefore}`);e.features.mastra.profiles.splice(r,0,...n)}else e.features.mastra.profiles.push(...n)}},K=class extends Error{errorCode=`MastraNotEnabledError`;constructor(e=`MastraNotEnabledError`){super(e)}},hr=class extends Error{errorCode=`InvalidAgentIdError`;constructor(e=`InvalidAgentIdError`){super(e)}},gr=class extends Error{errorCode=`InvalidAgentNameError`;constructor(e=`InvalidAgentNameError`){super(e)}},_r=class extends Error{errorCode=`DuplicateAgentIdError`;constructor(e=`DuplicateAgentIdError`){super(e)}},vr=class extends Error{errorCode=`ModelReferenceNotFoundError`;constructor(e=`ModelReferenceNotFoundError`){super(e)}},yr=class extends Error{errorCode=`AgentNotFoundError`;constructor(e=`AgentNotFoundError`){super(e)}},q={addSubAgentOperation(e,t){let n=e.features.mastra.mainAgent;if(!e.features.mastra.enabled||!n)throw new K(`Cannot add sub-agent when Mastra is disabled.`);if(!/^[a-z][a-z0-9-]*$/.test(t.input.id))throw new hr(`Invalid sub-agent ID: ${t.input.id}. Must be lowercase kebab-case.`);let r=t.input.name.trim();if(!r)throw new gr(`Sub-agent name must not be empty.`);if(n.id===t.input.id)throw new _r(`Agent ID already taken by main agent: ${t.input.id}`);if(e.features.mastra.subAgents.find(e=>e.id===t.input.id))throw new _r(`Sub-agent already exists: ${t.input.id}`);if(!e.features.mastra.models.find(e=>e.id===t.input.modelId))throw new vr(`Model not in library: ${t.input.modelId}`);e.features.mastra.subAgents.push({id:t.input.id,name:r,description:t.input.description,modelId:t.input.modelId,profileIds:[],skills:[],toolPatterns:[]})},removeSubAgentOperation(e,t){if(!e.features.mastra.enabled)throw new K(`Cannot remove sub-agent when Mastra is disabled.`);let n=e.features.mastra.subAgents.findIndex(e=>e.id===t.input.id);if(n===-1)throw new yr(`Sub-agent not found: ${t.input.id}`);e.features.mastra.subAgents.splice(n,1)},setSubAgentNameOperation(e,t){if(!e.features.mastra.enabled)throw new K(`Cannot set sub-agent name when Mastra is disabled.`);let n=e.features.mastra.subAgents.find(e=>e.id===t.input.id);if(!n)throw new yr(`Sub-agent not found: ${t.input.id}`);let r=t.input.name.trim();if(!r)throw new gr(`Sub-agent name must not be empty.`);n.name=r},setSubAgentDescriptionOperation(e,t){if(!e.features.mastra.enabled)throw new K(`Cannot set sub-agent description when Mastra is disabled.`);let n=e.features.mastra.subAgents.find(e=>e.id===t.input.id);if(!n)throw new yr(`Sub-agent not found: ${t.input.id}`);n.description=t.input.description}},br=class extends Error{errorCode=`DuplicatePackageError`;constructor(e=`DuplicatePackageError`){super(e)}},J=class extends Error{errorCode=`PackageNotFoundError`;constructor(e=`PackageNotFoundError`){super(e)}},xr=class extends Error{errorCode=`CannotRemoveManagedPackageError`;constructor(e=`CannotRemoveManagedPackageError`){super(e)}},Sr=class extends Error{errorCode=`InvalidDocumentTypeError`;constructor(e=`InvalidDocumentTypeError`){super(e)}},Cr=class extends Error{errorCode=`DuplicateDocumentTypeError`;constructor(e=`DuplicateDocumentTypeError`){super(e)}},wr=class extends Error{errorCode=`DocumentTypeNotFoundError`;constructor(e=`DocumentTypeNotFoundError`){super(e)}},Tr=class extends Error{errorCode=`InvalidVersionError`;constructor(e=`InvalidVersionError`){super(e)}},Er=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,Y={addPowerhousePackageOperation(e,t){if(e.packages.find(e=>e.id===t.input.id||e.packageName===t.input.packageName))throw new br(`Package already exists: ${t.input.packageName}`);e.packages.push({id:t.input.id,packageName:t.input.packageName,documentTypes:[],version:null,managed:!1})},removePowerhousePackageOperation(e,t){let n=e.packages.findIndex(e=>e.id===t.input.id);if(n===-1)throw new J(`Package not found: ${t.input.id}`);if(e.packages[n].managed)throw new xr(`Cannot remove a managed package`);e.packages.splice(n,1)},addPackageDocumentTypeOperation(e,t){if(t.input.documentType!==`*/*`&&!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t.input.documentType))throw new Sr(`Invalid document type format: ${t.input.documentType}. Expected org/name.`);let n=e.packages.find(e=>e.id===t.input.packageId);if(!n)throw new J(`Package not found: ${t.input.packageId}`);if(t.input.documentType===`*/*`){n.documentTypes.length=0,n.documentTypes.push(`*/*`);return}if(!n.documentTypes.includes(`*/*`)){if(n.documentTypes.includes(t.input.documentType))throw new Cr(`Document type already registered: ${t.input.documentType}`);n.documentTypes.push(t.input.documentType)}},removePackageDocumentTypeOperation(e,t){let n=e.packages.find(e=>e.id===t.input.packageId);if(!n)throw new J(`Package not found: ${t.input.packageId}`);let r=n.documentTypes.indexOf(t.input.documentType);if(r===-1)throw new wr(`Document type not found: ${t.input.documentType}`);n.documentTypes.splice(r,1)},setPackageVersionOperation(e,t){let n=e.packages.find(e=>e.id===t.input.packageId);if(!n)throw new J(`Package not found: ${t.input.packageId}`);if(t.input.version!=null&&!Er.test(t.input.version))throw new Tr(`Invalid version: ${t.input.version}`);n.version=t.input.version||null}},Dr=class extends Error{errorCode=`InvalidVersionError`;constructor(e=`InvalidVersionError`){super(e)}},Or=class extends Error{errorCode=`PublishRecordNotFoundError`;constructor(e=`PublishRecordNotFoundError`){super(e)}},X={bumpVersionOperation(e,t){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(t.input.version))throw new Dr(`Invalid version: ${t.input.version}`);e.version=t.input.version},publishDevOperation(e,t){e.publishHistory.push({id:t.input.id,tag:`Dev`,version:e.version,timestamp:t.input.timestamp,status:`Pending`})},publishStagingOperation(e,t){e.publishHistory.push({id:t.input.id,tag:`Staging`,version:e.version,timestamp:t.input.timestamp,status:`Pending`})},publishProductionOperation(e,t){e.publishHistory.push({id:t.input.id,tag:`Production`,version:e.version,timestamp:t.input.timestamp,status:`Pending`})},setPublishStatusOperation(e,t){let n=e.publishHistory.find(e=>e.id===t.input.id);if(!n)throw new Or(`Publish record not found: ${t.input.id}`);n.status=t.input.status}},kr=ue((e,t,n)=>{if(le(t))return e;switch(t.type){case`SET_DESCRIPTION`:j().parse(t.input),Xn.setDescriptionOperation(e[t.scope],t,n);break;case`SET_VERSION`:gt().parse(t.input),Xn.setVersionOperation(e[t.scope],t,n);break;case`SET_PACKAGE_IDENTIFIER`:lt().parse(t.input),Xn.setPackageIdentifierOperation(e[t.scope],t,n);break;case`SET_POWERHOUSE_LEVEL`:dt().parse(t.input),Gn.setPowerhouseLevelOperation(e[t.scope],t,n);break;case`ENABLE_ROUTINE`:Le().parse(t.input),Kn.enableRoutineOperation(e[t.scope],t,n);break;case`DISABLE_ROUTINE`:Fe().parse(t.input),Kn.disableRoutineOperation(e[t.scope],t,n);break;case`ADD_POWERHOUSE_PACKAGE`:De().parse(t.input),Y.addPowerhousePackageOperation(e[t.scope],t,n);break;case`REMOVE_POWERHOUSE_PACKAGE`:C().parse(t.input),Y.removePowerhousePackageOperation(e[t.scope],t,n);break;case`ADD_PACKAGE_DOCUMENT_TYPE`:Ee().parse(t.input),Y.addPackageDocumentTypeOperation(e[t.scope],t,n);break;case`REMOVE_PACKAGE_DOCUMENT_TYPE`:S().parse(t.input),Y.removePackageDocumentTypeOperation(e[t.scope],t,n);break;case`SET_PACKAGE_VERSION`:ut().parse(t.input),Y.setPackageVersionOperation(e[t.scope],t,n);break;case`ADD_EXTERNAL_SKILL`:we().parse(t.input),P.addExternalSkillOperation(e[t.scope],t,n);break;case`REMOVE_EXTERNAL_SKILL`:b().parse(t.input),P.removeExternalSkillOperation(e[t.scope],t,n);break;case`SET_EXTERNAL_SKILL_NAME`:it().parse(t.input),P.setExternalSkillNameOperation(e[t.scope],t,n);break;case`SET_EXTERNAL_SKILL_GITHUB_URL`:rt().parse(t.input),P.setExternalSkillGithubUrlOperation(e[t.scope],t,n);break;case`BUMP_VERSION`:je().parse(t.input),X.bumpVersionOperation(e[t.scope],t,n);break;case`PUBLISH_DEV`:m().parse(t.input),X.publishDevOperation(e[t.scope],t,n);break;case`PUBLISH_STAGING`:g().parse(t.input),X.publishStagingOperation(e[t.scope],t,n);break;case`PUBLISH_PRODUCTION`:h().parse(t.input),X.publishProductionOperation(e[t.scope],t,n);break;case`SET_PUBLISH_STATUS`:pt().parse(t.input),X.setPublishStatusOperation(e[t.scope],t,n);break;case`IMPORT_SPEC`:p().parse(t.input),Qn.importSpecOperation(e[t.scope],t,n);break;case`ADD_SUPPORTED_RESOURCE`:Ae().parse(t.input),N.addSupportedResourceOperation(e[t.scope],t,n);break;case`REMOVE_SUPPORTED_RESOURCE`:E().parse(t.input),N.removeSupportedResourceOperation(e[t.scope],t,n);break;case`SET_PROXY_ENABLED`:ft().parse(t.input),N.setProxyEnabledOperation(e[t.scope],t,n);break;case`SET_OBSERVABILITY_ENABLED`:ct().parse(t.input),N.setObservabilityEnabledOperation(e[t.scope],t,n);break;case`ENABLE_MASTRA`:Ie().parse(t.input),Hn.enableMastraOperation(e[t.scope],t,n);break;case`DISABLE_MASTRA`:Pe().parse(t.input),Hn.disableMastraOperation(e[t.scope],t,n);break;case`SET_ENABLE_CHAT`:M().parse(t.input),Hn.setEnableChatOperation(e[t.scope],t,n);break;case`ADD_MODEL`:Te().parse(t.input),dr.addModelOperation(e[t.scope],t,n);break;case`REMOVE_MODEL`:x().parse(t.input),dr.removeModelOperation(e[t.scope],t,n);break;case`SET_DEFAULT_MODEL`:A().parse(t.input),dr.setDefaultModelOperation(e[t.scope],t,n);break;case`ADD_PROFILE`:Oe().parse(t.input),G.addProfileOperation(e[t.scope],t,n);break;case`UPDATE_PROFILE`:_t().parse(t.input),G.updateProfileOperation(e[t.scope],t,n);break;case`REMOVE_PROFILE`:w().parse(t.input),G.removeProfileOperation(e[t.scope],t,n);break;case`REORDER_PROFILES`:O().parse(t.input),G.reorderProfilesOperation(e[t.scope],t,n);break;case`SET_MAIN_AGENT_NAME`:st().parse(t.input),H.setMainAgentNameOperation(e[t.scope],t,n);break;case`SET_MAIN_AGENT_DESCRIPTION`:at().parse(t.input),H.setMainAgentDescriptionOperation(e[t.scope],t,n);break;case`CLEAR_MAIN_AGENT_DESCRIPTION`:Me().parse(t.input),H.clearMainAgentDescriptionOperation(e[t.scope],t,n);break;case`SET_MAIN_AGENT_IMAGE`:ot().parse(t.input),H.setMainAgentImageOperation(e[t.scope],t,n);break;case`CLEAR_MAIN_AGENT_IMAGE`:Ne().parse(t.input),H.clearMainAgentImageOperation(e[t.scope],t,n);break;case`ADD_SUB_AGENT`:ke().parse(t.input),q.addSubAgentOperation(e[t.scope],t,n);break;case`REMOVE_SUB_AGENT`:T().parse(t.input),q.removeSubAgentOperation(e[t.scope],t,n);break;case`SET_SUB_AGENT_NAME`:ht().parse(t.input),q.setSubAgentNameOperation(e[t.scope],t,n);break;case`SET_SUB_AGENT_DESCRIPTION`:mt().parse(t.input),q.setSubAgentDescriptionOperation(e[t.scope],t,n);break;case`SET_AGENT_MODEL`:k().parse(t.input),B.setAgentModelOperation(e[t.scope],t,n);break;case`ADD_AGENT_PROFILE_REF`:xe().parse(t.input),B.addAgentProfileRefOperation(e[t.scope],t,n);break;case`REMOVE_AGENT_PROFILE_REF`:_().parse(t.input),B.removeAgentProfileRefOperation(e[t.scope],t,n);break;case`REORDER_AGENT_PROFILE_REFS`:D().parse(t.input),B.reorderAgentProfileRefsOperation(e[t.scope],t,n);break;case`ADD_AGENT_SKILL`:Se().parse(t.input),B.addAgentSkillOperation(e[t.scope],t,n);break;case`REMOVE_AGENT_SKILL`:v().parse(t.input),B.removeAgentSkillOperation(e[t.scope],t,n);break;case`ADD_AGENT_TOOL_PATTERN`:Ce().parse(t.input),B.addAgentToolPatternOperation(e[t.scope],t,n);break;case`REMOVE_AGENT_TOOL_PATTERN`:y().parse(t.input),B.removeAgentToolPatternOperation(e[t.scope],t,n);break;default:return e}}),Ar=`powerhouse/ph-clint-project`,jr=ie.extend({documentType:i(Ar)}),Z=ne.extend({global:Qe()}),Q=u({header:jr,state:Z,initialState:Z});function Mr(e){return Z.safeParse(e).success}function Nr(e){Z.parse(e)}function $(e){return Q.safeParse(e).success}function Pr(e){Q.parse(e)}var Fr={name:null,scope:null,version:`0.1.0`,description:``,features:{powerhouse:`Disabled`,mastra:{enabled:!1,mainAgent:null,subAgents:[],models:[],profiles:[],common:{enableChat:!1}},routine:{enabled:!1}},packages:[],externalSkills:[],publishHistory:[],deployment:{proxyEnabled:!1,observabilityEnabled:!1,supportedResources:[`vetra-agent-s`,`vetra-agent-m`,`vetra-agent-l`,`vetra-agent-xl`,`vetra-agent-xxl`]}},Ir={},Lr={fileExtension:`pcp`,createState(e){return{...fe(),global:{...Fr,...e?.global},local:{...Ir,...e?.local}}},createDocument(e){let t=se(Lr.createState,e);return t.header.documentType=Ar,t.header.id=te(),t},saveToFileHandle(e,t){return ce(e,t)},loadFromInput(e){return de(e,kr)},isStateOfType(e){return Mr(e)},assertIsStateOfType(e){return Nr(e)},isDocumentOfType(e){return $(e)},assertIsDocumentOfType(e){return Pr(e)}},Rr=e({}),zr={...Lr,...Rr},Br={version:1,reducer:kr,actions:jn,utils:zr,documentModel:oe(fe(),Mn)},Vr=ee.forDocumentModel(Br);function Hr(){return{name:null,scope:null,version:`0.1.0`,description:``,features:{powerhouse:`Disabled`,mastra:{enabled:!1,mainAgent:null,subAgents:[],models:[],profiles:[],common:{enableChat:!1}},routine:{enabled:!1}},packages:[],externalSkills:[],publishHistory:[],deployment:{proxyEnabled:!1,observabilityEnabled:!1,supportedResources:[`vetra-agent-s`,`vetra-agent-m`,`vetra-agent-l`,`vetra-agent-xl`,`vetra-agent-xxl`]}}}function Ur(){return{}}function Wr(){return{...fe(),global:Hr(),local:Ur()}}function Gr(e){return{...Hr(),...e||{}}}function Kr(e){return{...Ur(),...e||{}}}function qr(e,t,n){return{...ae(e?.auth,e?.document),global:Gr(t),local:Kr(n)}}function Jr(e){return Lr.createDocument(e?qr(ae(e.auth,e.document),e.global,e.local):void 0)}function Yr(e){let[t,n]=he(e);return $(t)?[t,n]:[void 0,void 0]}function Xr(){let[e,t]=ge();return Pr(e),[e,t]}function Zr(){return pe()?.filter($)}function Qr(){return me()?.filter($)}var $r=[1],ei=$r[0],ti={documentType:`powerhouse/ph-clint-project`,latestVersion:ei,supportedVersions:$r,upgrades:{}};export{sn as $,ut as $n,Ne as $t,Tn as A,_ as An,jt as At,wn as B,D as Bn,xt as Bt,$ as C,tt as Cn,It as Ct,Mn as D,g as Dn,Ot as Dt,kr as E,nt as En,Nt as Et,Sn as F,S as Fn,Et as Ft,_n as G,M as Gn,Te as Gt,mn as H,k as Hn,Se as Ht,bn as I,C as In,yt as It,fn as J,at as Jn,Oe as Jt,un as K,rt as Kn,Ee as Kt,yn as L,w as Ln,vt as Lt,kn as M,y as Mn,Ct as Mt,On as N,b as Nn,Tt as Nt,jn as O,ye as On,At as Ot,An as P,x as Pn,Dt as Pt,an as Q,lt as Qn,Me as Qt,Cn as R,T as Rn,bt as Rt,Nr as S,f as Sn,Pt as St,Ar as T,h as Tn,Mt as Tt,gn as U,A as Un,Ce as Ut,hn as V,O as Vn,xe as Vt,vn as W,j as Wn,we as Wt,dn as X,st as Xn,Ae as Xt,pn as Y,ot as Yn,ke as Yt,on as Z,ct as Zn,je as Zt,Ir as _,Xe as _n,Ht as _t,Zr as a,ze as an,gt as ar,nn as at,Z as b,$e as bn,Bt as bt,Jr as c,He as cn,_e as cr,Jt as ct,Ur as d,We as dn,Kt as dt,Pe as en,dt as er,cn as et,Wr as f,Ge as fn,Yt as ft,Fr as g,Ye as gn,Vt as gt,zr as h,Je as hn,Wt as ht,Yr as i,Re as in,ht as ir,en as it,Dn as j,v as jn,wt as jt,En as k,be as kn,kt,qr as l,Ue as ln,Xt as lt,Br as m,qe as mn,qt as mt,ei as n,Ie as nn,pt as nr,rn as nt,Qr as o,Be as on,_t as or,$t as ot,Vr as p,Ke as pn,Zt as pt,ln as q,it as qn,De as qt,$r as r,Le as rn,mt as rr,Qt as rt,Xr as s,Ve as sn,ve as sr,Gt as st,ti as t,Fe as tn,ft as tr,tn as tt,Hr as u,p as un,Ut as ut,jr as v,Ze as vn,Lt as vt,Mr as w,m as wn,Ft as wt,Pr as x,et as xn,zt as xt,Q as y,Qe as yn,Rt as yt,xn as z,E as zn,St as zt};
|
|
1142
|
+
//# sourceMappingURL=ph-clint-project-DZ_ZplDv.js.map
|