@powerhousedao/ph-clint-app 0.1.0-dev.89 → 0.1.0-dev.90
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/{editor-BuHwuzRa.js → editor-Bp2wUo8R.js} +748 -522
- package/dist/browser/editor-Bp2wUo8R.js.map +1 -0
- package/dist/browser/editors/ph-clint-project-editor/module.js +1 -1
- package/dist/connect/assets/{AddDriveModal-BoKLJyUY-DwlVwt2n.js → AddDriveModal-BoKLJyUY-cGJwd_2F.js} +2 -2
- package/dist/connect/assets/{AddDriveModal-BoKLJyUY-DwlVwt2n.js.map → AddDriveModal-BoKLJyUY-cGJwd_2F.js.map} +1 -1
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-lBEW3sSH.js → ClearStorageModal-CXoNWmRe-D3ifKRm-.js} +2 -2
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-lBEW3sSH.js.map → ClearStorageModal-CXoNWmRe-D3ifKRm-.js.map} +1 -1
- package/dist/connect/assets/{CookiesPolicyModal-1nOh6oN3-BYSDp-5J.js → CookiesPolicyModal-1nOh6oN3-kK_sx5mz.js} +2 -2
- package/dist/connect/assets/{CookiesPolicyModal-1nOh6oN3-BYSDp-5J.js.map → CookiesPolicyModal-1nOh6oN3-kK_sx5mz.js.map} +1 -1
- package/dist/connect/assets/{CreateDocumentModal-nQbLVDq3-DJbJhlYp.js → CreateDocumentModal-nQbLVDq3-DFAye2CX.js} +2 -2
- package/dist/connect/assets/{CreateDocumentModal-nQbLVDq3-DJbJhlYp.js.map → CreateDocumentModal-nQbLVDq3-DFAye2CX.js.map} +1 -1
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-Du3PKhbh.js → DebugSettingsModal-5SDhy5gt-DLMPdDQB.js} +2 -2
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-Du3PKhbh.js.map → DebugSettingsModal-5SDhy5gt-DLMPdDQB.js.map} +1 -1
- package/dist/connect/assets/{DeleteDriveModal-6P0T1QgD-CaEKmseP.js → DeleteDriveModal-6P0T1QgD-CK6cPXbT.js} +2 -2
- package/dist/connect/assets/{DeleteDriveModal-6P0T1QgD-CaEKmseP.js.map → DeleteDriveModal-6P0T1QgD-CK6cPXbT.js.map} +1 -1
- package/dist/connect/assets/{DeleteItemModal-BmV1aQyZ-B01dssV-.js → DeleteItemModal-BmV1aQyZ-Ld9lHNhl.js} +2 -2
- package/dist/connect/assets/{DeleteItemModal-BmV1aQyZ-B01dssV-.js.map → DeleteItemModal-BmV1aQyZ-Ld9lHNhl.js.map} +1 -1
- package/dist/connect/assets/{DisclaimerModal-CVTFfN0_-CfPGYzP1.js → DisclaimerModal-CVTFfN0_-D7N9TDI4.js} +2 -2
- package/dist/connect/assets/{DisclaimerModal-CVTFfN0_-CfPGYzP1.js.map → DisclaimerModal-CVTFfN0_-D7N9TDI4.js.map} +1 -1
- package/dist/connect/assets/{DownloadDocumentWithErrorsModal-CXeFUtaz-UexzRqQT.js → DownloadDocumentWithErrorsModal-CXeFUtaz-CYIIl42M.js} +2 -2
- package/dist/connect/assets/{DownloadDocumentWithErrorsModal-CXeFUtaz-UexzRqQT.js.map → DownloadDocumentWithErrorsModal-CXeFUtaz-CYIIl42M.js.map} +1 -1
- package/dist/connect/assets/{DriveAuthRequiredModal-B3VdLwSH-C5FZCMC5.js → DriveAuthRequiredModal-B3VdLwSH-fqmI_4sF.js} +2 -2
- package/dist/connect/assets/{DriveAuthRequiredModal-B3VdLwSH-C5FZCMC5.js.map → DriveAuthRequiredModal-B3VdLwSH-fqmI_4sF.js.map} +1 -1
- package/dist/connect/assets/{DriveSettingsModal-CsNFEJ9E-BoXSbW1c.js → DriveSettingsModal-CsNFEJ9E-BR2vyeU8.js} +2 -2
- package/dist/connect/assets/{DriveSettingsModal-CsNFEJ9E-BoXSbW1c.js.map → DriveSettingsModal-CsNFEJ9E-BR2vyeU8.js.map} +1 -1
- package/dist/connect/assets/{InspectorModal-BsSihzuc-hukmcBoP.js → InspectorModal-BsSihzuc-B0n5gbGB.js} +2 -2
- package/dist/connect/assets/{InspectorModal-BsSihzuc-hukmcBoP.js.map → InspectorModal-BsSihzuc-B0n5gbGB.js.map} +1 -1
- package/dist/connect/assets/{MissingPackageModal-Bn036mWQ-BOXHWmFa.js → MissingPackageModal-Bn036mWQ-C021G1nV.js} +2 -2
- package/dist/connect/assets/{MissingPackageModal-Bn036mWQ-BOXHWmFa.js.map → MissingPackageModal-Bn036mWQ-C021G1nV.js.map} +1 -1
- package/dist/connect/assets/{SettingsModal-S_A5qf95-Fz0f2CXX.js → SettingsModal-S_A5qf95-uzigz0nk.js} +2 -2
- package/dist/connect/assets/{SettingsModal-S_A5qf95-Fz0f2CXX.js.map → SettingsModal-S_A5qf95-uzigz0nk.js.map} +1 -1
- package/dist/connect/assets/{UpgradeDriveModal-C7lV4rAX-BkeBWpDi.js → UpgradeDriveModal-C7lV4rAX-CTIf4duw.js} +2 -2
- package/dist/connect/assets/{UpgradeDriveModal-C7lV4rAX-BkeBWpDi.js.map → UpgradeDriveModal-C7lV4rAX-CTIf4duw.js.map} +1 -1
- package/dist/connect/assets/build-info-cc1PjSvF-DtAGzh0W.js.map +1 -1
- package/dist/connect/assets/chunk-pbuEa-1d-KEQyMDN_.js.map +1 -1
- package/dist/connect/assets/{components-ByEUkO4U-Mc23VVA-.js → components-ByEUkO4U-xPZUVkzr.js} +4 -4
- package/dist/connect/assets/{components-ByEUkO4U-Mc23VVA-.js.map → components-ByEUkO4U-xPZUVkzr.js.map} +1 -1
- package/dist/connect/assets/{components-HCKyLh9m.js → components-Djrujufg.js} +2 -2
- package/dist/connect/assets/{components-HCKyLh9m.js.map → components-Djrujufg.js.map} +1 -1
- package/dist/connect/assets/{connect-pRAhId57.js → connect-CGvtDtZh.js} +2 -2
- package/dist/connect/assets/{connect-pRAhId57.js.map → connect-CGvtDtZh.js.map} +1 -1
- package/dist/connect/assets/{connect.config-Bt4pvvWV-CAyer5pZ.js → connect.config-Bt4pvvWV-Dj3FkjaZ.js} +2 -2
- package/dist/connect/assets/{connect.config-Bt4pvvWV-CAyer5pZ.js.map → connect.config-Bt4pvvWV-Dj3FkjaZ.js.map} +1 -1
- package/dist/connect/assets/{dist-DmhUSVtT.js → dist-t-ezfpxv.js} +3 -3
- package/dist/connect/assets/{dist-DmhUSVtT.js.map → dist-t-ezfpxv.js.map} +1 -1
- package/dist/connect/assets/{editor-B560eld_-CIE3_3II.js → editor-B560eld_-DLpKHubk.js} +2 -2
- package/dist/connect/assets/{editor-B560eld_-CIE3_3II.js.map → editor-B560eld_-DLpKHubk.js.map} +1 -1
- package/dist/connect/assets/editor-BaQ62r3i.js +2 -0
- package/dist/connect/assets/editor-BaQ62r3i.js.map +1 -0
- package/dist/connect/assets/{editor-CAVHtR-v-ClzvSfK5.js → editor-CAVHtR-v-D33T9vW0.js} +2 -2
- package/dist/connect/assets/{editor-CAVHtR-v-ClzvSfK5.js.map → editor-CAVHtR-v-D33T9vW0.js.map} +1 -1
- package/dist/connect/assets/{editor-CVCLxUhe-C6nP7EPN.js → editor-CVCLxUhe-C9Ftgu1S.js} +2 -2
- package/dist/connect/assets/{editor-CVCLxUhe-C6nP7EPN.js.map → editor-CVCLxUhe-C9Ftgu1S.js.map} +1 -1
- package/dist/connect/assets/{editor-DnG2Zzet-CRhirYbH.js → editor-DnG2Zzet-CQ38uSti.js} +2 -2
- package/dist/connect/assets/{editor-DnG2Zzet-CRhirYbH.js.map → editor-DnG2Zzet-CQ38uSti.js.map} +1 -1
- package/dist/connect/assets/{editor-mor7dV6n-DDigdbLM.js → editor-mor7dV6n-NTU9k1uj.js} +2 -2
- package/dist/connect/assets/{editor-mor7dV6n-DDigdbLM.js.map → editor-mor7dV6n-NTU9k1uj.js.map} +1 -1
- package/dist/connect/assets/{editor-xCnDas6c-CyHuSL7M.js → editor-xCnDas6c-DdGhx--5.js} +2 -2
- package/dist/connect/assets/{editor-xCnDas6c-CyHuSL7M.js.map → editor-xCnDas6c-DdGhx--5.js.map} +1 -1
- package/dist/connect/assets/esm-dD38MHAT.js +10 -0
- package/dist/connect/assets/esm-dD38MHAT.js.map +1 -0
- package/dist/connect/assets/{hooks-Btogj1f0-CMXQZV6d.js → hooks-Btogj1f0-BKAAmyt-.js} +2 -2
- package/dist/connect/assets/{hooks-Btogj1f0-CMXQZV6d.js.map → hooks-Btogj1f0-BKAAmyt-.js.map} +1 -1
- package/dist/connect/assets/index-NB86TKkT.js +3 -0
- package/dist/connect/assets/{index-DS7vbdaR.js.map → index-NB86TKkT.js.map} +1 -1
- package/dist/connect/assets/{load-BWibkoFV-BVilFVpD.js → load-BWibkoFV-CDRjWwYQ.js} +2 -2
- package/dist/connect/assets/{load-BWibkoFV-BVilFVpD.js.map → load-BWibkoFV-CDRjWwYQ.js.map} +1 -1
- package/dist/connect/assets/module-1hr_ne9w-CWAVsMzZ.js.map +1 -1
- package/dist/connect/assets/{module-DP3LMNU7.js → module-7zCQE1MC.js} +2 -2
- package/dist/connect/assets/{module-DP3LMNU7.js.map → module-7zCQE1MC.js.map} +1 -1
- package/dist/connect/assets/module-CRq_lUkG-D61oeRlC.js.map +1 -1
- package/dist/connect/assets/module-DP3bVbak-VbUPIBZP.js.map +1 -1
- package/dist/connect/assets/package-BZLLR0Ma-B7vswMvI.js.map +1 -1
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-T-NGWlGh.js → pglite-seed-BWk7yOwr-b2F0oJiP.js} +2 -2
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-T-NGWlGh.js.map → pglite-seed-BWk7yOwr-b2F0oJiP.js.map} +1 -1
- package/dist/connect/assets/pglite.worker-BuyZ0d7u.js.map +1 -1
- package/dist/connect/assets/pglite.worker.legacy-D5InEf0i.js.map +1 -1
- package/dist/connect/assets/{ph-clint-project-BZ5X7dVQ.js → ph-clint-project-p1zY6e17.js} +2 -2
- package/dist/connect/assets/{ph-clint-project-BZ5X7dVQ.js.map → ph-clint-project-p1zY6e17.js.map} +1 -1
- package/dist/connect/assets/{reactor-BxNvHOKC-DmVBqCt_.js → reactor-BxNvHOKC-CeMF1M2u.js} +4 -4
- package/dist/connect/assets/{reactor-BxNvHOKC-DmVBqCt_.js.map → reactor-BxNvHOKC-CeMF1M2u.js.map} +1 -1
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-oC4nicB2.js → registerServiceWorker-D9l1kja7-DG3DqQna.js} +2 -2
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-oC4nicB2.js.map → registerServiceWorker-D9l1kja7-DG3DqQna.js.map} +1 -1
- package/dist/connect/assets/reload-connect-toast-CwvSc6F--BQcqGaN_.js.map +1 -1
- package/dist/connect/assets/runtime-config-DL3QjcfM-D9g4VFtY.js.map +1 -1
- package/dist/connect/assets/toast-BEy42aYx-Dg_jZf6v.js.map +1 -1
- package/dist/connect/assets/{useRegistryPackages-B-gFECmd-CXOBKziY.js → useRegistryPackages-B-gFECmd-C8h2M5qM.js} +2 -2
- package/dist/connect/assets/{useRegistryPackages-B-gFECmd-CXOBKziY.js.map → useRegistryPackages-B-gFECmd-C8h2M5qM.js.map} +1 -1
- package/dist/connect/assets/{useVetraDocument-tpjMF571-DT5T1mNT.js → useVetraDocument-tpjMF571-DxT9GgCx.js} +2 -2
- package/dist/connect/assets/{useVetraDocument-tpjMF571-DT5T1mNT.js.map → useVetraDocument-tpjMF571-DxT9GgCx.js.map} +1 -1
- package/dist/connect/assets/utils-BiV3cs9Y-B7i9WJ1b.js.map +1 -1
- package/dist/connect/assets/{utils-CkWB3DRk-CxqNKFWP.js → utils-CkWB3DRk-BURJYofr.js} +2 -2
- package/dist/connect/assets/{utils-CkWB3DRk-CxqNKFWP.js.map → utils-CkWB3DRk-BURJYofr.js.map} +1 -1
- package/dist/connect/index.html +3 -3
- package/dist/connect/powerhouse.config.json +1 -1
- package/dist/node/{editor-Bev0bZuJ.mjs → editor-BC9t7D3T.mjs} +748 -517
- package/dist/node/editor-BC9t7D3T.mjs.map +1 -0
- package/dist/node/editors/ph-clint-project-editor/module.mjs +1 -1
- package/package.json +2 -2
- package/dist/browser/editor-BuHwuzRa.js.map +0 -1
- package/dist/connect/assets/editor-BrPMvNFl.js +0 -2
- package/dist/connect/assets/editor-BrPMvNFl.js.map +0 -1
- package/dist/connect/assets/esm-mbrYcWED.js +0 -10
- package/dist/connect/assets/esm-mbrYcWED.js.map +0 -1
- package/dist/connect/assets/index-DS7vbdaR.js +0 -3
- package/dist/node/editor-Bev0bZuJ.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Mt as e,gn as t}from"./dist-
|
|
2
|
-
//# sourceMappingURL=editor-B560eld_-
|
|
1
|
+
import{Mt as e,gn as t}from"./dist-t-ezfpxv.js";import{g as n,z as r}from"./connect-CGvtDtZh.js";import{a as i,c as a,l as o,n as s,o as c,r as l,s as u}from"./utils-CkWB3DRk-BURJYofr.js";import{t as d}from"./components-Djrujufg.js";import{n as f,t as p}from"./hooks-Btogj1f0-BKAAmyt-.js";import{n as m}from"./useVetraDocument-tpjMF571-DxT9GgCx.js";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useCallback as v,useEffect as y,useState as b}from"react";var x=({processorName:e=``,processorType:n=``,documentTypes:i=[],processorApps:a=[],status:o=`DRAFT`,onNameChange:s,onTypeChange:c,onAddDocumentType:l,onRemoveDocumentType:u,onAddProcessorApp:m,onRemoveProcessorApp:v,onConfirm:x})=>{let[S,C]=b(e),[w,T]=b(n),[E,D]=b(i),[O,k]=b(``),[A,j]=b(a),[M,N]=b(!1),P=p();f(S,s,300),f(w,c,300),y(()=>{C(e)},[e]),y(()=>{T(n)},[n]),y(()=>{D(i)},[i]),y(()=>{j(a)},[a]),y(()=>{o===`DRAFT`&&N(!1)},[o]);let F=M||o===`CONFIRMED`,I=()=>{S.trim()&&w&&E.length>0&&A.length>0&&(N(!0),x?.())},L=e=>{D(E.filter(t=>t.id!==e)),u?.(e)},R=!!S.trim()&&!!w&&E.length>0&&A.length>0;return _(`div`,{className:`space-y-6 p-6`,children:[_(`div`,{className:`flex items-center justify-between`,children:[g(`h2`,{className:`text-lg font-medium text-foreground`,children:`Processor Configuration`}),g(d,{status:o===`CONFIRMED`?`confirmed`:`draft`,label:o===`CONFIRMED`?`Confirmed`:`Draft`})]}),_(`div`,{children:[g(`label`,{htmlFor:`processor-name`,className:`mb-2 block text-sm font-medium text-foreground`,children:`Processor Name`}),g(`input`,{id:`processor-name`,type:`text`,value:S,onChange:e=>C(e.target.value),disabled:F,className:r(`w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect`,F?`cursor-not-allowed bg-muted text-muted-foreground`:``),placeholder:`Enter processor name`})]}),_(`div`,{children:[g(`label`,{htmlFor:`processor-type`,className:`mb-2 block text-sm font-medium text-foreground`,children:`Type`}),_(`select`,{id:`processor-type`,value:w,onChange:e=>T(e.target.value),disabled:F,className:r(`w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none`,F?`cursor-not-allowed bg-muted`:``),children:[g(`option`,{value:``,children:`Select type...`}),g(`option`,{value:`analytics`,children:`Analytics`}),g(`option`,{value:`relational`,children:`Relational Database`})]})]}),_(`div`,{children:[g(`label`,{htmlFor:`document-types`,className:`mb-2 block text-sm font-medium text-foreground`,children:`Document Types`}),_(`div`,{className:`space-y-2`,children:[!F&&P.length>0&&_(`select`,{id:`document-types`,value:O,onChange:e=>{let t=e.target.value;if(t&&!E.some(e=>e.documentType===t)){let e=Date.now().toString(),n={id:e,documentType:t};D([...E,n]),l?.(e,t)}k(``)},className:`w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none`,children:[g(`option`,{value:``,children:`Select a document type to add`}),P.filter(e=>!E.some(t=>t.documentType===e)).map(e=>g(`option`,{value:e,children:e},e))]}),g(`div`,{className:`space-y-1`,children:E.map(e=>_(`div`,{className:`flex items-center py-1`,children:[g(`span`,{className:`text-sm text-foreground`,children:e.documentType}),!F&&g(`button`,{onClick:()=>L(e.id),className:`ml-2 text-muted-foreground hover:hover-effect focus:outline-none`,children:`×`})]},e.id))})]})]}),_(`div`,{children:[g(`label`,{htmlFor:`processor-apps`,className:`mb-2 block text-sm font-medium text-foreground`,children:`Processor Apps`}),_(`div`,{className:`space-y-2`,children:[!F&&g(h,{children:t.map(e=>_(`div`,{className:`flex gap-1`,children:[g(`input`,{type:`checkbox`,name:e,id:e,checked:A.includes(e),onChange:t=>{t.target.checked?(j(t=>[...new Set([...t,e])]),m?.(e)):A.length>1&&(j(t=>t.filter(t=>t!==e)),v?.(e))}}),g(`label`,{htmlFor:e,className:`text-foreground`,children:e})]},e))}),g(`div`,{className:`space-y-1`,children:F&&A.map(e=>g(`span`,{className:`text-sm text-foreground`,children:e},e))})]})]}),!F&&g(`div`,{children:g(`button`,{onClick:I,disabled:!R,className:`rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect`,children:`Confirm`})})]})},S={isExternalControlsEnabled:!1};function C(){e(S);let[t,r]=m(),d=v(()=>{r([a({status:`CONFIRMED`})])},[r]),f=v(e=>{e!==t.state.global.name&&r(u({name:e}))},[t.state.global.name,r]),p=v(e=>{e!==t.state.global.type&&r(o({type:e}))},[t.state.global.type,r]),h=v((e,t)=>{r(s({id:e,documentType:t}))},[r]),y=v(e=>{r(i({id:e}))},[r]),b=v(e=>{r(l({processorApp:e}))},[r]),C=v(e=>{r(c({processorApp:e}))},[r]);return _(`div`,{className:`bg-background p-6`,children:[g(n,{}),g(x,{onNameChange:f,onTypeChange:p,onAddDocumentType:h,onRemoveDocumentType:y,onAddProcessorApp:b,onRemoveProcessorApp:C,status:t.state.global.status,processorName:t.state.global.name??``,processorType:t.state.global.type??``,documentTypes:t.state.global.documentTypes??[],processorApps:t.state.global.processorApps,onConfirm:d})]})}export{C as default};
|
|
2
|
+
//# sourceMappingURL=editor-B560eld_-DLpKHubk.js.map
|
package/dist/connect/assets/{editor-B560eld_-CIE3_3II.js.map → editor-B560eld_-DLpKHubk.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-B560eld_-CIE3_3II.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+vetra@6.2.0-dev.23_@babel+runtime@7.29.2_@electric-sql+pglite@0.3.15_@fa_4e356600b8337b4dd0d28e4139ca6eec/node_modules/@powerhousedao/vetra/dist/editor-B560eld_.js"],"sourcesContent":["import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from \"./utils-CkWB3DRk.js\";\nimport { StatusPill } from \"./editors/components/index.js\";\nimport { n as useAvailableDocumentTypes, t as useDebounce } from \"./hooks-Btogj1f0.js\";\nimport { n as useSelectedProcessorModuleDocument } from \"./useVetraDocument-tpjMF571.js\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { PROCESSOR_APPS } from \"@powerhousedao/shared/processors\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\n//#region editors/processor-editor/components/ProcessorEditorForm.tsx\nconst ProcessorEditorForm = ({ processorName: initialProcessorName = \"\", processorType: initialProcessorType = \"\", documentTypes: initialDocumentTypes = [], processorApps: initialProcessorApps = [], status = \"DRAFT\", onNameChange, onTypeChange, onAddDocumentType, onRemoveDocumentType, onAddProcessorApp, onRemoveProcessorApp, onConfirm }) => {\n\tconst [processorName, setProcessorName] = useState(initialProcessorName);\n\tconst [processorType, setProcessorType] = useState(initialProcessorType);\n\tconst [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);\n\tconst [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\tconst [processorApps, setProcessorApps] = useState(initialProcessorApps);\n\tconst [isConfirmed, setIsConfirmed] = useState(false);\n\tconst availableDocumentTypes = useAvailableDocumentTypes();\n\tuseDebounce(processorName, onNameChange, 300);\n\tuseDebounce(processorType, onTypeChange, 300);\n\tuseEffect(() => {\n\t\tsetProcessorName(initialProcessorName);\n\t}, [initialProcessorName]);\n\tuseEffect(() => {\n\t\tsetProcessorType(initialProcessorType);\n\t}, [initialProcessorType]);\n\tuseEffect(() => {\n\t\tsetDocumentTypes(initialDocumentTypes);\n\t}, [initialDocumentTypes]);\n\tuseEffect(() => {\n\t\tsetProcessorApps(initialProcessorApps);\n\t}, [initialProcessorApps]);\n\tuseEffect(() => {\n\t\tif (status === \"DRAFT\") setIsConfirmed(false);\n\t}, [status]);\n\tconst isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\tconst handleConfirm = () => {\n\t\tif (processorName.trim() && processorType && documentTypes.length > 0 && processorApps.length > 0) {\n\t\t\tsetIsConfirmed(true);\n\t\t\tonConfirm?.();\n\t\t}\n\t};\n\tconst handleRemoveDocumentType = (id) => {\n\t\tsetDocumentTypes(documentTypes.filter((dt) => dt.id !== id));\n\t\tonRemoveDocumentType?.(id);\n\t};\n\tconst canConfirm = !!processorName.trim() && !!processorType && documentTypes.length > 0 && processorApps.length > 0;\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"space-y-6 p-6\",\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"flex items-center justify-between\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"h2\", {\n\t\t\t\t\tclassName: \"text-lg font-medium text-foreground\",\n\t\t\t\t\tchildren: \"Processor Configuration\"\n\t\t\t\t}), /* @__PURE__ */ jsx(StatusPill, {\n\t\t\t\t\tstatus: status === \"CONFIRMED\" ? \"confirmed\" : \"draft\",\n\t\t\t\t\tlabel: status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"\n\t\t\t\t})]\n\t\t\t}),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"processor-name\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Processor Name\"\n\t\t\t}), /* @__PURE__ */ jsx(\"input\", {\n\t\t\t\tid: \"processor-name\",\n\t\t\t\ttype: \"text\",\n\t\t\t\tvalue: processorName,\n\t\t\t\tonChange: (e) => setProcessorName(e.target.value),\n\t\t\t\tdisabled: isReadOnly,\n\t\t\t\tclassName: twMerge(\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\", isReadOnly ? \"cursor-not-allowed bg-muted text-muted-foreground\" : \"\"),\n\t\t\t\tplaceholder: \"Enter processor name\"\n\t\t\t})] }),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"processor-type\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Type\"\n\t\t\t}), /* @__PURE__ */ jsxs(\"select\", {\n\t\t\t\tid: \"processor-type\",\n\t\t\t\tvalue: processorType,\n\t\t\t\tonChange: (e) => setProcessorType(e.target.value),\n\t\t\t\tdisabled: isReadOnly,\n\t\t\t\tclassName: twMerge(\"w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\", isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\"),\n\t\t\t\tchildren: [\n\t\t\t\t\t/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\tchildren: \"Select type...\"\n\t\t\t\t\t}),\n\t\t\t\t\t/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"analytics\",\n\t\t\t\t\t\tchildren: \"Analytics\"\n\t\t\t\t\t}),\n\t\t\t\t\t/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"relational\",\n\t\t\t\t\t\tchildren: \"Relational Database\"\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t})] }),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"document-types\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Document Types\"\n\t\t\t}), /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"space-y-2\",\n\t\t\t\tchildren: [!isReadOnly && availableDocumentTypes.length > 0 && /* @__PURE__ */ jsxs(\"select\", {\n\t\t\t\t\tid: \"document-types\",\n\t\t\t\t\tvalue: selectedDocumentType,\n\t\t\t\t\tonChange: (e) => {\n\t\t\t\t\t\tconst selectedValue = e.target.value;\n\t\t\t\t\t\tif (selectedValue && !documentTypes.some((dt) => dt.documentType === selectedValue)) {\n\t\t\t\t\t\t\tconst id = Date.now().toString();\n\t\t\t\t\t\t\tconst newType = {\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tdocumentType: selectedValue\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsetDocumentTypes([...documentTypes, newType]);\n\t\t\t\t\t\t\tonAddDocumentType?.(id, selectedValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSelectedDocumentType(\"\");\n\t\t\t\t\t},\n\t\t\t\t\tclassName: \"w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\tchildren: \"Select a document type to add\"\n\t\t\t\t\t}), availableDocumentTypes.filter((docType) => !documentTypes.some((dt) => dt.documentType === docType)).map((docType) => /* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: docType,\n\t\t\t\t\t\tchildren: docType\n\t\t\t\t\t}, docType))]\n\t\t\t\t}), /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"space-y-1\",\n\t\t\t\t\tchildren: documentTypes.map((type) => /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\t\tclassName: \"flex items-center py-1\",\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\t\tclassName: \"text-sm text-foreground\",\n\t\t\t\t\t\t\tchildren: type.documentType\n\t\t\t\t\t\t}), !isReadOnly && /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\t\t\t\tonClick: () => handleRemoveDocumentType(type.id),\n\t\t\t\t\t\t\tclassName: \"ml-2 text-muted-foreground hover:hover-effect focus:outline-none\",\n\t\t\t\t\t\t\tchildren: \"×\"\n\t\t\t\t\t\t})]\n\t\t\t\t\t}, type.id))\n\t\t\t\t})]\n\t\t\t})] }),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"processor-apps\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Processor Apps\"\n\t\t\t}), /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"space-y-2\",\n\t\t\t\tchildren: [!isReadOnly && /* @__PURE__ */ jsx(Fragment, { children: PROCESSOR_APPS.map((processorApp) => /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"flex gap-1\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"input\", {\n\t\t\t\t\t\ttype: \"checkbox\",\n\t\t\t\t\t\tname: processorApp,\n\t\t\t\t\t\tid: processorApp,\n\t\t\t\t\t\tchecked: processorApps.includes(processorApp),\n\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\tif (event.target.checked) {\n\t\t\t\t\t\t\t\tsetProcessorApps((processorApps) => [...new Set([...processorApps, processorApp])]);\n\t\t\t\t\t\t\t\tonAddProcessorApp?.(processorApp);\n\t\t\t\t\t\t\t} else if (processorApps.length > 1) {\n\t\t\t\t\t\t\t\tsetProcessorApps((processorApps) => processorApps.filter((p) => p !== processorApp));\n\t\t\t\t\t\t\t\tonRemoveProcessorApp?.(processorApp);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"label\", {\n\t\t\t\t\t\thtmlFor: processorApp,\n\t\t\t\t\t\tclassName: \"text-foreground\",\n\t\t\t\t\t\tchildren: processorApp\n\t\t\t\t\t})]\n\t\t\t\t}, processorApp)) }), /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"space-y-1\",\n\t\t\t\t\tchildren: isReadOnly && processorApps.map((processorApp) => /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\tclassName: \"text-sm text-foreground\",\n\t\t\t\t\t\tchildren: processorApp\n\t\t\t\t\t}, processorApp))\n\t\t\t\t})]\n\t\t\t})] }),\n\t\t\t!isReadOnly && /* @__PURE__ */ jsx(\"div\", { children: /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\tonClick: handleConfirm,\n\t\t\t\tdisabled: !canConfirm,\n\t\t\t\tclassName: \"rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\",\n\t\t\t\tchildren: \"Confirm\"\n\t\t\t}) })\n\t\t]\n\t});\n};\n//#endregion\n//#region editors/processor-editor/config.ts\nconst editorConfig = { isExternalControlsEnabled: false };\n//#endregion\n//#region editors/processor-editor/editor.tsx\nfunction Editor() {\n\tuseSetPHDocumentEditorConfig(editorConfig);\n\tconst [document, dispatch] = useSelectedProcessorModuleDocument();\n\tconst onConfirm = useCallback(() => {\n\t\tdispatch([setProcessorStatus({ status: \"CONFIRMED\" })]);\n\t}, [dispatch]);\n\tconst onNameChange = useCallback((name) => {\n\t\tif (name === document.state.global.name) return;\n\t\tdispatch(setProcessorName({ name }));\n\t}, [document.state.global.name, dispatch]);\n\tconst onTypeChange = useCallback((type) => {\n\t\tif (type === document.state.global.type) return;\n\t\tdispatch(setProcessorType({ type }));\n\t}, [document.state.global.type, dispatch]);\n\tconst onAddDocumentType = useCallback((id, documentType) => {\n\t\tdispatch(addDocumentType({\n\t\t\tid,\n\t\t\tdocumentType\n\t\t}));\n\t}, [dispatch]);\n\tconst onRemoveDocumentType = useCallback((id) => {\n\t\tdispatch(removeDocumentType({ id }));\n\t}, [dispatch]);\n\tconst onAddProcessorApp = useCallback((processorApp) => {\n\t\tdispatch(addProcessorApp({ processorApp }));\n\t}, [dispatch]);\n\tconst onRemoveProcessorApp = useCallback((processorApp) => {\n\t\tdispatch(removeProcessorApp({ processorApp }));\n\t}, [dispatch]);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"bg-background p-6\",\n\t\tchildren: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(ProcessorEditorForm, {\n\t\t\tonNameChange,\n\t\t\tonTypeChange,\n\t\t\tonAddDocumentType,\n\t\t\tonRemoveDocumentType,\n\t\t\tonAddProcessorApp,\n\t\t\tonRemoveProcessorApp,\n\t\t\tstatus: document.state.global.status,\n\t\t\tprocessorName: document.state.global.name ?? \"\",\n\t\t\tprocessorType: document.state.global.type ?? \"\",\n\t\t\tdocumentTypes: document.state.global.documentTypes ?? [],\n\t\t\tprocessorApps: document.state.global.processorApps,\n\t\t\tonConfirm\n\t\t})]\n\t});\n}\n//#endregion\nexport { Editor as default };\n\n//# sourceMappingURL=editor-B560eld_.js.map"],"x_google_ignoreList":[0],"mappings":"8dAWA,IAAM,GAAuB,CAAE,cAAe,EAAuB,GAAI,cAAe,EAAuB,GAAI,cAAe,EAAuB,EAAE,CAAE,cAAe,EAAuB,EAAE,CAA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D,EAAS,EAAmB,CAAE,eAAc,CAAC,CAAC,EAC5C,CAAC,EAAS,CAAC,CACd,OAAuB,EAAK,MAAO,CAClC,UAAW,oBACX,SAAU,CAAiB,EAAI,EAAiB,EAAE,CAAC,CAAkB,EAAI,EAAqB,CAC7F,eACA,eACA,oBACA,uBACA,oBACA,uBACA,OAAQ,EAAS,MAAM,OAAO,OAC9B,cAAe,EAAS,MAAM,OAAO,MAAQ,GAC7C,cAAe,EAAS,MAAM,OAAO,MAAQ,GAC7C,cAAe,EAAS,MAAM,OAAO,eAAiB,EAAE,CACxD,cAAe,EAAS,MAAM,OAAO,cACrC,YACA,CAAC,CAAC,CACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"editor-B560eld_-DLpKHubk.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+vetra@6.2.0-dev.23_@babel+runtime@7.29.2_@electric-sql+pglite@0.3.15_@pa_0c94680c61477a0a5c7bf05c9b5bc3fb/node_modules/@powerhousedao/vetra/dist/editor-B560eld_.js"],"sourcesContent":["import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from \"./utils-CkWB3DRk.js\";\nimport { StatusPill } from \"./editors/components/index.js\";\nimport { n as useAvailableDocumentTypes, t as useDebounce } from \"./hooks-Btogj1f0.js\";\nimport { n as useSelectedProcessorModuleDocument } from \"./useVetraDocument-tpjMF571.js\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { PROCESSOR_APPS } from \"@powerhousedao/shared/processors\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\n//#region editors/processor-editor/components/ProcessorEditorForm.tsx\nconst ProcessorEditorForm = ({ processorName: initialProcessorName = \"\", processorType: initialProcessorType = \"\", documentTypes: initialDocumentTypes = [], processorApps: initialProcessorApps = [], status = \"DRAFT\", onNameChange, onTypeChange, onAddDocumentType, onRemoveDocumentType, onAddProcessorApp, onRemoveProcessorApp, onConfirm }) => {\n\tconst [processorName, setProcessorName] = useState(initialProcessorName);\n\tconst [processorType, setProcessorType] = useState(initialProcessorType);\n\tconst [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);\n\tconst [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\tconst [processorApps, setProcessorApps] = useState(initialProcessorApps);\n\tconst [isConfirmed, setIsConfirmed] = useState(false);\n\tconst availableDocumentTypes = useAvailableDocumentTypes();\n\tuseDebounce(processorName, onNameChange, 300);\n\tuseDebounce(processorType, onTypeChange, 300);\n\tuseEffect(() => {\n\t\tsetProcessorName(initialProcessorName);\n\t}, [initialProcessorName]);\n\tuseEffect(() => {\n\t\tsetProcessorType(initialProcessorType);\n\t}, [initialProcessorType]);\n\tuseEffect(() => {\n\t\tsetDocumentTypes(initialDocumentTypes);\n\t}, [initialDocumentTypes]);\n\tuseEffect(() => {\n\t\tsetProcessorApps(initialProcessorApps);\n\t}, [initialProcessorApps]);\n\tuseEffect(() => {\n\t\tif (status === \"DRAFT\") setIsConfirmed(false);\n\t}, [status]);\n\tconst isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\tconst handleConfirm = () => {\n\t\tif (processorName.trim() && processorType && documentTypes.length > 0 && processorApps.length > 0) {\n\t\t\tsetIsConfirmed(true);\n\t\t\tonConfirm?.();\n\t\t}\n\t};\n\tconst handleRemoveDocumentType = (id) => {\n\t\tsetDocumentTypes(documentTypes.filter((dt) => dt.id !== id));\n\t\tonRemoveDocumentType?.(id);\n\t};\n\tconst canConfirm = !!processorName.trim() && !!processorType && documentTypes.length > 0 && processorApps.length > 0;\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"space-y-6 p-6\",\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"flex items-center justify-between\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"h2\", {\n\t\t\t\t\tclassName: \"text-lg font-medium text-foreground\",\n\t\t\t\t\tchildren: \"Processor Configuration\"\n\t\t\t\t}), /* @__PURE__ */ jsx(StatusPill, {\n\t\t\t\t\tstatus: status === \"CONFIRMED\" ? \"confirmed\" : \"draft\",\n\t\t\t\t\tlabel: status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"\n\t\t\t\t})]\n\t\t\t}),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"processor-name\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Processor Name\"\n\t\t\t}), /* @__PURE__ */ jsx(\"input\", {\n\t\t\t\tid: \"processor-name\",\n\t\t\t\ttype: \"text\",\n\t\t\t\tvalue: processorName,\n\t\t\t\tonChange: (e) => setProcessorName(e.target.value),\n\t\t\t\tdisabled: isReadOnly,\n\t\t\t\tclassName: twMerge(\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\", isReadOnly ? \"cursor-not-allowed bg-muted text-muted-foreground\" : \"\"),\n\t\t\t\tplaceholder: \"Enter processor name\"\n\t\t\t})] }),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"processor-type\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Type\"\n\t\t\t}), /* @__PURE__ */ jsxs(\"select\", {\n\t\t\t\tid: \"processor-type\",\n\t\t\t\tvalue: processorType,\n\t\t\t\tonChange: (e) => setProcessorType(e.target.value),\n\t\t\t\tdisabled: isReadOnly,\n\t\t\t\tclassName: twMerge(\"w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\", isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\"),\n\t\t\t\tchildren: [\n\t\t\t\t\t/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\tchildren: \"Select type...\"\n\t\t\t\t\t}),\n\t\t\t\t\t/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"analytics\",\n\t\t\t\t\t\tchildren: \"Analytics\"\n\t\t\t\t\t}),\n\t\t\t\t\t/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"relational\",\n\t\t\t\t\t\tchildren: \"Relational Database\"\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t})] }),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"document-types\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Document Types\"\n\t\t\t}), /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"space-y-2\",\n\t\t\t\tchildren: [!isReadOnly && availableDocumentTypes.length > 0 && /* @__PURE__ */ jsxs(\"select\", {\n\t\t\t\t\tid: \"document-types\",\n\t\t\t\t\tvalue: selectedDocumentType,\n\t\t\t\t\tonChange: (e) => {\n\t\t\t\t\t\tconst selectedValue = e.target.value;\n\t\t\t\t\t\tif (selectedValue && !documentTypes.some((dt) => dt.documentType === selectedValue)) {\n\t\t\t\t\t\t\tconst id = Date.now().toString();\n\t\t\t\t\t\t\tconst newType = {\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tdocumentType: selectedValue\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsetDocumentTypes([...documentTypes, newType]);\n\t\t\t\t\t\t\tonAddDocumentType?.(id, selectedValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSelectedDocumentType(\"\");\n\t\t\t\t\t},\n\t\t\t\t\tclassName: \"w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\tchildren: \"Select a document type to add\"\n\t\t\t\t\t}), availableDocumentTypes.filter((docType) => !documentTypes.some((dt) => dt.documentType === docType)).map((docType) => /* @__PURE__ */ jsx(\"option\", {\n\t\t\t\t\t\tvalue: docType,\n\t\t\t\t\t\tchildren: docType\n\t\t\t\t\t}, docType))]\n\t\t\t\t}), /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"space-y-1\",\n\t\t\t\t\tchildren: documentTypes.map((type) => /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\t\tclassName: \"flex items-center py-1\",\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\t\tclassName: \"text-sm text-foreground\",\n\t\t\t\t\t\t\tchildren: type.documentType\n\t\t\t\t\t\t}), !isReadOnly && /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\t\t\t\tonClick: () => handleRemoveDocumentType(type.id),\n\t\t\t\t\t\t\tclassName: \"ml-2 text-muted-foreground hover:hover-effect focus:outline-none\",\n\t\t\t\t\t\t\tchildren: \"×\"\n\t\t\t\t\t\t})]\n\t\t\t\t\t}, type.id))\n\t\t\t\t})]\n\t\t\t})] }),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"processor-apps\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Processor Apps\"\n\t\t\t}), /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"space-y-2\",\n\t\t\t\tchildren: [!isReadOnly && /* @__PURE__ */ jsx(Fragment, { children: PROCESSOR_APPS.map((processorApp) => /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"flex gap-1\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"input\", {\n\t\t\t\t\t\ttype: \"checkbox\",\n\t\t\t\t\t\tname: processorApp,\n\t\t\t\t\t\tid: processorApp,\n\t\t\t\t\t\tchecked: processorApps.includes(processorApp),\n\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\tif (event.target.checked) {\n\t\t\t\t\t\t\t\tsetProcessorApps((processorApps) => [...new Set([...processorApps, processorApp])]);\n\t\t\t\t\t\t\t\tonAddProcessorApp?.(processorApp);\n\t\t\t\t\t\t\t} else if (processorApps.length > 1) {\n\t\t\t\t\t\t\t\tsetProcessorApps((processorApps) => processorApps.filter((p) => p !== processorApp));\n\t\t\t\t\t\t\t\tonRemoveProcessorApp?.(processorApp);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"label\", {\n\t\t\t\t\t\thtmlFor: processorApp,\n\t\t\t\t\t\tclassName: \"text-foreground\",\n\t\t\t\t\t\tchildren: processorApp\n\t\t\t\t\t})]\n\t\t\t\t}, processorApp)) }), /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"space-y-1\",\n\t\t\t\t\tchildren: isReadOnly && processorApps.map((processorApp) => /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\tclassName: \"text-sm text-foreground\",\n\t\t\t\t\t\tchildren: processorApp\n\t\t\t\t\t}, processorApp))\n\t\t\t\t})]\n\t\t\t})] }),\n\t\t\t!isReadOnly && /* @__PURE__ */ jsx(\"div\", { children: /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\tonClick: handleConfirm,\n\t\t\t\tdisabled: !canConfirm,\n\t\t\t\tclassName: \"rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\",\n\t\t\t\tchildren: \"Confirm\"\n\t\t\t}) })\n\t\t]\n\t});\n};\n//#endregion\n//#region editors/processor-editor/config.ts\nconst editorConfig = { isExternalControlsEnabled: false };\n//#endregion\n//#region editors/processor-editor/editor.tsx\nfunction Editor() {\n\tuseSetPHDocumentEditorConfig(editorConfig);\n\tconst [document, dispatch] = useSelectedProcessorModuleDocument();\n\tconst onConfirm = useCallback(() => {\n\t\tdispatch([setProcessorStatus({ status: \"CONFIRMED\" })]);\n\t}, [dispatch]);\n\tconst onNameChange = useCallback((name) => {\n\t\tif (name === document.state.global.name) return;\n\t\tdispatch(setProcessorName({ name }));\n\t}, [document.state.global.name, dispatch]);\n\tconst onTypeChange = useCallback((type) => {\n\t\tif (type === document.state.global.type) return;\n\t\tdispatch(setProcessorType({ type }));\n\t}, [document.state.global.type, dispatch]);\n\tconst onAddDocumentType = useCallback((id, documentType) => {\n\t\tdispatch(addDocumentType({\n\t\t\tid,\n\t\t\tdocumentType\n\t\t}));\n\t}, [dispatch]);\n\tconst onRemoveDocumentType = useCallback((id) => {\n\t\tdispatch(removeDocumentType({ id }));\n\t}, [dispatch]);\n\tconst onAddProcessorApp = useCallback((processorApp) => {\n\t\tdispatch(addProcessorApp({ processorApp }));\n\t}, [dispatch]);\n\tconst onRemoveProcessorApp = useCallback((processorApp) => {\n\t\tdispatch(removeProcessorApp({ processorApp }));\n\t}, [dispatch]);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"bg-background p-6\",\n\t\tchildren: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(ProcessorEditorForm, {\n\t\t\tonNameChange,\n\t\t\tonTypeChange,\n\t\t\tonAddDocumentType,\n\t\t\tonRemoveDocumentType,\n\t\t\tonAddProcessorApp,\n\t\t\tonRemoveProcessorApp,\n\t\t\tstatus: document.state.global.status,\n\t\t\tprocessorName: document.state.global.name ?? \"\",\n\t\t\tprocessorType: document.state.global.type ?? \"\",\n\t\t\tdocumentTypes: document.state.global.documentTypes ?? [],\n\t\t\tprocessorApps: document.state.global.processorApps,\n\t\t\tonConfirm\n\t\t})]\n\t});\n}\n//#endregion\nexport { Editor as default };\n\n//# sourceMappingURL=editor-B560eld_.js.map"],"x_google_ignoreList":[0],"mappings":"8dAWA,IAAM,GAAuB,CAAE,cAAe,EAAuB,GAAI,cAAe,EAAuB,GAAI,cAAe,EAAuB,EAAE,CAAE,cAAe,EAAuB,EAAE,CAAE,SAAS,QAAS,eAAc,eAAc,oBAAmB,uBAAsB,oBAAmB,uBAAsB,eAAgB,CACtV,GAAM,CAAC,EAAe,GAAoB,EAAS,EAAqB,CAClE,CAAC,EAAe,GAAoB,EAAS,EAAqB,CAClE,CAAC,EAAe,GAAoB,EAAS,EAAqB,CAClE,CAAC,EAAsB,GAA2B,EAAS,GAAG,CAC9D,CAAC,EAAe,GAAoB,EAAS,EAAqB,CAClE,CAAC,EAAa,GAAkB,EAAS,GAAM,CAC/C,EAAyB,GAA2B,CAC1D,EAAY,EAAe,EAAc,IAAI,CAC7C,EAAY,EAAe,EAAc,IAAI,CAC7C,MAAgB,CACf,EAAiB,EAAqB,EACpC,CAAC,EAAqB,CAAC,CAC1B,MAAgB,CACf,EAAiB,EAAqB,EACpC,CAAC,EAAqB,CAAC,CAC1B,MAAgB,CACf,EAAiB,EAAqB,EACpC,CAAC,EAAqB,CAAC,CAC1B,MAAgB,CACf,EAAiB,EAAqB,EACpC,CAAC,EAAqB,CAAC,CAC1B,MAAgB,CACX,IAAW,SAAS,EAAe,GAAM,EAC3C,CAAC,EAAO,CAAC,CACZ,IAAM,EAAa,GAAe,IAAW,YACvC,MAAsB,CACvB,EAAc,MAAM,EAAI,GAAiB,EAAc,OAAS,GAAK,EAAc,OAAS,IAC/F,EAAe,GAAK,CACpB,KAAa,GAGT,EAA4B,GAAO,CACxC,EAAiB,EAAc,OAAQ,GAAO,EAAG,KAAO,EAAG,CAAC,CAC5D,IAAuB,EAAG,EAErB,EAAa,CAAC,CAAC,EAAc,MAAM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EAAgB,CACxB,KACA,eACA,CAAC,CAAC,EACD,CAAC,EAAS,CAAC,CACR,EAAuB,EAAa,GAAO,CAChD,EAAS,EAAmB,CAAE,KAAI,CAAC,CAAC,EAClC,CAAC,EAAS,CAAC,CACR,EAAoB,EAAa,GAAiB,CACvD,EAAS,EAAgB,CAAE,eAAc,CAAC,CAAC,EACzC,CAAC,EAAS,CAAC,CACR,EAAuB,EAAa,GAAiB,CAC1D,EAAS,EAAmB,CAAE,eAAc,CAAC,CAAC,EAC5C,CAAC,EAAS,CAAC,CACd,OAAuB,EAAK,MAAO,CAClC,UAAW,oBACX,SAAU,CAAiB,EAAI,EAAiB,EAAE,CAAC,CAAkB,EAAI,EAAqB,CAC7F,eACA,eACA,oBACA,uBACA,oBACA,uBACA,OAAQ,EAAS,MAAM,OAAO,OAC9B,cAAe,EAAS,MAAM,OAAO,MAAQ,GAC7C,cAAe,EAAS,MAAM,OAAO,MAAQ,GAC7C,cAAe,EAAS,MAAM,OAAO,eAAiB,EAAE,CACxD,cAAe,EAAS,MAAM,OAAO,cACrC,YACA,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./chunk-BNv3lrIs.js";import{Et as e,Ht as t,_ as n,n as r,vt as i}from"./dist-t-ezfpxv.js";import{g as a}from"./connect-CGvtDtZh.js";import{X as o}from"./types-CxSpmNGK-BaNo7EHQ.js";import{O as s,s as c}from"./ph-clint-project-p1zY6e17.js";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{useCallback as f,useEffect as p,useMemo as m,useRef as h,useState as g}from"react";var _=[{value:`Disabled`,description:`No Powerhouse integration`},{value:`Reactor`,description:`Document model runtime`},{value:`Switchboard`,description:`API service (GraphQL + MCP)`},{value:`Connect`,description:`Web UI for document management`}];function v(e){let t=/^(\d+)\.(\d+)\.(\d+)/.exec(e);if(!t)return`${e}.1`;let[,n,r,i]=t;return`${n}.${r}.${Number(i)+1}`}function y(e){return d(`label`,{className:e.compact?`my-1 block`:`my-3 block`,children:[u(`h3`,{className:e.compact?`text-xs text-gray-600`:`text-base`,children:e.label}),u(`input`,{type:`text`,defaultValue:e.value,placeholder:e.placeholder,readOnly:e.readOnly,onBlur:t=>{let n=t.target.value.trim();n!==e.value&&e.onCommit(n)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},className:`w-full font-mono`})]})}function b(e){return d(`label`,{className:`my-2 flex items-center gap-3`,children:[u(`input`,{type:`checkbox`,checked:e.checked,disabled:e.disabled,onChange:t=>e.onChange(t.target.checked)}),u(`span`,{className:`font-semibold`,children:e.label}),e.hint?u(`span`,{className:`text-sm text-gray-600`,children:e.hint}):null]})}var x=[{value:`cli`,label:`CLI`},{value:`agents`,label:`Agents`},{value:`profiles`,label:`Profiles`},{value:`skills`,label:`Skills`},{value:`powerhouse`,label:`Powerhouse`},{value:`publish`,label:`Publish`}];function S(){let[i,l]=c(),f=i.state.global,{powerhouse:p,mastra:h,routine:_}=f.features,[v,y]=g(`cli`),[b]=e(),S=b?.state?.local?.remoteUrl,T=m(()=>t({remoteUrl:S?n(S):r}),[S]),E=e=>l(s.setPackageIdentifier({identifier:e})),D=e=>l(s.setVersion({version:e})),O=e=>l(s.setDescription({description:e})),k=e=>l(s.setPowerhouseLevel({level:e})),A=e=>{if(e){let e=f.name||`my-agent`,t=`${e}-agent`,n=`${e.charAt(0).toUpperCase()}${e.slice(1).replace(/-([a-z])/g,(e,t)=>` ${t.toUpperCase()}`)} Agent`;l(s.enableMastra({agentId:t,agentName:n}))}else l(s.disableMastra({_:!0}))},j=e=>{l(e?s.enableRoutine({_:!0}):s.disableRoutine({_:!0}))},M=e=>l(s.addPowerhousePackage({id:o(),packageName:e})),N=e=>l(s.removePowerhousePackage({id:e})),F=(e,t)=>l(s.addPackageDocumentType({packageId:e,documentType:t})),L=(e,t)=>l(s.removePackageDocumentType({packageId:e,documentType:t})),R=(e,t)=>l(s.addExternalSkill({id:o(),name:e,githubUrl:t})),z=e=>l(s.removeExternalSkill({id:e})),B=e=>l(s.bumpVersion({version:e})),V=()=>l(s.publishDev({id:o(),timestamp:new Date().toISOString()})),H=()=>l(s.publishStaging({id:o(),timestamp:new Date().toISOString()})),U=()=>l(s.publishProduction({id:o(),timestamp:new Date().toISOString()})),W=e=>l(s.setMainAgentName({name:e})),G=e=>l(s.setMainAgentDescription({description:e})),K=()=>l(s.clearMainAgentDescription({_:!0})),q=e=>l(s.setMainAgentImage({attachment:e})),J=()=>l(s.clearMainAgentImage({_:!0})),Y=(e,t,n,r)=>l(s.addSubAgent({id:e,name:t,description:n,modelId:r})),X=e=>l(s.removeSubAgent({id:e})),Z=(e,t)=>l(s.setSubAgentName({id:e,name:t})),Q=(e,t)=>l(s.setSubAgentDescription({id:e,description:t})),ne=e=>l(s.addModel({id:e})),re=e=>l(s.removeModel({id:e})),ie=(e,t,n,r)=>l(s.addProfile({id:e,title:t,content:n,insertBefore:r})),ae=(e,t,n)=>l(s.updateProfile({id:e,title:t,content:n})),oe=e=>l(s.removeProfile({id:e})),se=(e,t)=>l(s.reorderProfiles({ids:e,insertBefore:t})),ce=(e,t)=>l(s.setAgentModel({agentId:e,modelId:t})),le=(e,t,n)=>l(s.addAgentProfileRef({agentId:e,profileId:t,insertBefore:n})),ue=(e,t)=>l(s.removeAgentProfileRef({agentId:e,profileId:t})),de=(e,t,n)=>l(s.reorderAgentProfileRefs({agentId:e,ids:t,insertBefore:n})),fe=(e,t)=>l(s.addAgentSkill({agentId:e,name:t})),pe=(e,t)=>l(s.removeAgentSkill({agentId:e,name:t})),me=(e,t)=>l(s.addAgentToolPattern({agentId:e,pattern:t})),he=(e,t)=>l(s.removeAgentToolPattern({agentId:e,pattern:t})),ge=e=>l(s.setEnableChat({enabled:e})),_e=e=>l(s.setProxyEnabled({enabled:e})),ve=e=>l(s.setObservabilityEnabled({enabled:e})),ye=e=>l(s.addSupportedResource({resource:e})),be=e=>l(s.removeSupportedResource({resource:e})),$=p!==`Disabled`,xe=e=>`px-4 py-2 text-sm font-medium border-b-2 cursor-pointer ${v===e?`border-blue-500 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`;return d(`div`,{className:`mx-auto max-w-4xl bg-gray-50 p-6`,children:[u(a,{}),d(`div`,{className:`ph-default-styles`,children:[u(`h2`,{className:`mt-4 text-xl font-bold`,children:`ph-clint Project Spec`}),u(`nav`,{className:`my-4 flex border-b border-gray-200`,children:x.map(e=>u(`button`,{className:xe(e.value),onClick:()=>y(e.value),children:e.label},e.value))}),v===`cli`&&u(C,{state:f,powerhouse:p,mastra:h,routine:_,isAboveDisabled:$,setPackageIdentifier:E,setVersion:D,setDescription:O,setPowerhouseLevel:k,toggleMastra:A,toggleRoutine:j,setEnableChat:ge,addModel:ne,removeModel:re}),v===`agents`&&u(w,{mastra:h,attachments:T,setMainAgentName:W,setMainAgentDescription:G,clearMainAgentDescription:K,setMainAgentImage:q,clearMainAgentImage:J,addSubAgent:Y,removeSubAgent:X,setSubAgentName:Z,setSubAgentDescription:Q,setAgentModel:ce,addAgentProfileRef:le,removeAgentProfileRef:ue,reorderAgentProfileRefs:de,addAgentSkill:fe,removeAgentSkill:pe,addAgentToolPattern:me,removeAgentToolPattern:he}),v===`profiles`&&u(P,{mastra:h,addProfile:ie,updateProfile:ae,removeProfile:oe,reorderProfiles:se}),v===`skills`&&u(I,{skills:f.externalSkills,addSkill:R,removeSkill:z}),v===`powerhouse`&&u(ee,{packages:f.packages,isAboveDisabled:$,addPackage:M,removePackage:N,addDocType:F,removeDocType:L}),v===`publish`&&u(te,{version:f.version,publishHistory:f.publishHistory,documentHeader:i.header,deployment:f.deployment,bumpVersion:B,publishDev:V,publishStaging:H,publishProduction:U,setProxyEnabled:_e,setObservabilityEnabled:ve,addSupportedResource:ye,removeSupportedResource:be})]})]})}function C(e){let{state:t,mastra:n}=e,r=`${t.scope?t.scope+`/`:``}${t.name??``}`;return d(l,{children:[d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Identity`}),d(`div`,{className:`grid grid-cols-[3fr_1fr] gap-4`,children:[u(y,{label:`Package name`,value:r,placeholder:`@scope/my-tool-cli`,onCommit:e.setPackageIdentifier}),u(y,{label:`Version`,value:t.version,placeholder:`0.1.0`,onCommit:e.setVersion})]}),u(y,{label:`Description`,value:t.description,placeholder:`What this CLI does`,onCommit:e.setDescription})]}),u(`hr`,{}),d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Features`}),d(`div`,{className:`my-4 rounded border border-gray-200 bg-white p-4`,children:[u(`h4`,{className:`text-base font-semibold`,children:`Powerhouse`}),e.isAboveDisabled&&u(`p`,{className:`text-sm text-gray-500`,children:`Cannot go back to Disabled once enabled`}),u(`div`,{className:`mt-2 space-y-2`,children:_.map((t,n)=>d(`label`,{className:`flex items-start gap-2`,children:[n>0&&u(`div`,{className:`absolute -mt-3 ml-[7px] h-3 border-l border-gray-300`}),u(`input`,{type:`radio`,name:`powerhouse-level`,checked:e.powerhouse===t.value,disabled:e.isAboveDisabled&&t.value===`Disabled`,onChange:()=>e.setPowerhouseLevel(t.value),className:`mt-0.5`}),d(`div`,{children:[u(`span`,{className:`font-medium`,children:t.value}),u(`span`,{className:`ml-2 text-sm text-gray-500`,children:t.description})]})]},t.value))})]}),d(`div`,{className:`my-4 rounded border border-gray-200 bg-white p-4`,children:[u(b,{label:`Mastra`,checked:n.enabled,hint:`AI agent framework`,onChange:e.toggleMastra}),n.enabled&&d(`div`,{className:`mt-4 space-y-4 border-t border-gray-100 pt-4`,children:[u(N,{models:n.models,main:n.mainAgent,subAgents:n.subAgents,addModel:e.addModel,removeModel:e.removeModel}),d(`div`,{children:[u(`h4`,{className:`text-sm font-semibold text-gray-700`,children:`Common`}),u(b,{label:`Enable Chat`,checked:n.common.enableChat,disabled:!e.isAboveDisabled,hint:e.isAboveDisabled?`Chat session integration via clint-common`:`Requires Powerhouse to be enabled`,onChange:e.setEnableChat})]})]})]}),u(`div`,{className:`my-4 rounded border border-gray-200 bg-white p-4`,children:u(b,{label:`Routine loop`,checked:e.routine.enabled,hint:`tick-based execution loop with triggers`,onChange:e.toggleRoutine})})]})]})}function w(e){let{mastra:t,attachments:n}=e,r=t.mainAgent,[i,a]=g(!1);if(!t.enabled||!r)return d(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Agents`}),u(`p`,{className:`mt-2`,children:`Enable Mastra in the CLI tab to configure agents.`})]});let o=[r.id,...t.subAgents.map(e=>e.id)];return d(l,{children:[u(T,{main:r,models:t.models,profiles:t.profiles,attachments:n,setMainAgentName:e.setMainAgentName,setMainAgentDescription:e.setMainAgentDescription,clearMainAgentDescription:e.clearMainAgentDescription,setMainAgentImage:e.setMainAgentImage,clearMainAgentImage:e.clearMainAgentImage,setAgentModel:e.setAgentModel,addAgentProfileRef:e.addAgentProfileRef,removeAgentProfileRef:e.removeAgentProfileRef,reorderAgentProfileRefs:e.reorderAgentProfileRefs,addAgentSkill:e.addAgentSkill,removeAgentSkill:e.removeAgentSkill,addAgentToolPattern:e.addAgentToolPattern,removeAgentToolPattern:e.removeAgentToolPattern}),t.subAgents.map(n=>u(O,{sub:n,models:t.models,profiles:t.profiles,removeSubAgent:e.removeSubAgent,setSubAgentName:e.setSubAgentName,setSubAgentDescription:e.setSubAgentDescription,setAgentModel:e.setAgentModel,addAgentProfileRef:e.addAgentProfileRef,removeAgentProfileRef:e.removeAgentProfileRef,reorderAgentProfileRefs:e.reorderAgentProfileRefs,addAgentSkill:e.addAgentSkill,removeAgentSkill:e.removeAgentSkill,addAgentToolPattern:e.addAgentToolPattern,removeAgentToolPattern:e.removeAgentToolPattern},n.id)),u(`section`,{className:`my-6`,children:i?u(D,{models:t.models,existingAgentIds:o,onAdd:(t,n,r,i)=>{e.addSubAgent(t,n,r,i),a(!1)},onCancel:()=>a(!1)}):u(`button`,{className:`rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50`,disabled:t.models.length===0,title:t.models.length===0?`Add a model first (CLI tab → Mastra)`:``,onClick:()=>a(!0),children:`+ Add Sub-agent`})})]})}function T(e){let{main:t}=e,[n,r]=g(!0);return d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[u(`div`,{className:`flex items-center justify-between`,children:d(`div`,{className:`flex items-center gap-3`,children:[u(`button`,{className:`text-sm text-gray-400 hover:text-gray-700`,onClick:()=>r(!n),title:n?`Collapse`:`Expand`,children:n?`▾`:`▸`}),u(`span`,{className:`rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500`,children:t.id}),u(`span`,{className:`font-semibold`,children:t.name}),u(`span`,{className:`rounded bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-700`,children:`Main`})]})}),t.description&&u(`p`,{className:`ml-7 text-sm text-gray-600`,children:t.description}),n&&d(`div`,{className:`mt-4 space-y-3 border-t border-gray-100 pt-4`,children:[d(`div`,{style:{display:`flex`,gap:`1.5rem`},children:[u(`div`,{style:{flexShrink:0,width:`7rem`},children:u(M,{attachmentRef:t.attachment??null,attachments:e.attachments,onSetImage:e.setMainAgentImage,onClearImage:e.clearMainAgentImage})}),d(`div`,{style:{flex:1,minWidth:0},children:[d(`div`,{className:`grid grid-cols-[1fr_2fr] gap-4`,children:[u(y,{compact:!0,readOnly:!0,label:`Agent ID`,value:t.id,onCommit:()=>{}}),u(y,{compact:!0,label:`Agent Name`,value:t.name,placeholder:`My Agent`,onCommit:e.setMainAgentName})]}),u(E,{value:t.description,placeholder:`A brief description of what this agent does`,onSet:e.setMainAgentDescription,onClear:e.clearMainAgentDescription})]})]}),u(k,{agentId:t.id,isMain:!0,modelId:t.modelId,profileIds:t.profileIds,skills:t.skills,toolPatterns:t.toolPatterns,models:e.models,profiles:e.profiles,setAgentModel:e.setAgentModel,addAgentProfileRef:e.addAgentProfileRef,removeAgentProfileRef:e.removeAgentProfileRef,reorderAgentProfileRefs:e.reorderAgentProfileRefs,addAgentSkill:e.addAgentSkill,removeAgentSkill:e.removeAgentSkill,addAgentToolPattern:e.addAgentToolPattern,removeAgentToolPattern:e.removeAgentToolPattern})]})]})}function E(e){return d(`label`,{className:`my-1 block`,children:[u(`h3`,{className:`text-xs text-gray-600`,children:`Description`}),u(`div`,{className:`flex items-center gap-2`,children:u(`input`,{type:`text`,defaultValue:e.value??``,placeholder:e.placeholder,onBlur:t=>{let n=t.target.value.trim();n&&n!==(e.value??``)?e.onSet(n):!n&&e.value!==null&&e.onClear()},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},className:`w-full font-mono`})})]})}function D(e){let[t,n]=g(``),[r,i]=g(``),[a,o]=g(``),[s,c]=g(e.models[0]?.id??``),l=/^[a-z][a-z0-9-]*$/.test(t)&&!e.existingAgentIds.includes(t)&&r.trim()&&a.trim()&&s;return d(`div`,{className:`my-3 rounded border border-blue-200 bg-blue-50 p-4`,children:[d(`div`,{className:`grid grid-cols-2 gap-3`,children:[d(`label`,{className:`block`,children:[u(`span`,{className:`text-xs text-gray-600`,children:`Sub-agent ID`}),u(`input`,{type:`text`,value:t,placeholder:`summarizer`,onChange:e=>n(e.target.value.trim()),className:`w-full rounded border p-2 font-mono text-sm`})]}),d(`label`,{className:`block`,children:[u(`span`,{className:`text-xs text-gray-600`,children:`Display name`}),u(`input`,{type:`text`,value:r,placeholder:`Summarizer`,onChange:e=>i(e.target.value),className:`w-full rounded border p-2 text-sm`})]})]}),d(`label`,{className:`my-2 block`,children:[u(`span`,{className:`text-xs text-gray-600`,children:`Description (the main agent uses this to decide when to delegate)`}),u(`input`,{type:`text`,value:a,placeholder:`Summarizes long documents into bullet points`,onChange:e=>o(e.target.value),className:`w-full rounded border p-2 text-sm`})]}),d(`label`,{className:`my-2 block`,children:[u(`span`,{className:`text-xs text-gray-600`,children:`Model`}),u(`select`,{value:s,onChange:e=>c(e.target.value),className:`w-full rounded border p-2 font-mono text-sm`,children:e.models.map(e=>u(`option`,{value:e.id,children:e.id},e.id))})]}),d(`div`,{className:`mt-2 flex items-center gap-2`,children:[u(`button`,{className:`rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50`,disabled:!l,onClick:()=>e.onAdd(t,r.trim(),a.trim(),s),children:`Add`}),u(`button`,{className:`text-sm text-gray-500 hover:text-gray-700`,onClick:e.onCancel,children:`Cancel`})]})]})}function O(e){let{sub:t}=e,[n,r]=g(!1);return d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[d(`div`,{className:`flex items-center justify-between`,children:[d(`div`,{className:`flex items-center gap-3`,children:[u(`button`,{className:`text-sm text-gray-400 hover:text-gray-700`,onClick:()=>r(!n),title:n?`Collapse`:`Expand`,children:n?`▾`:`▸`}),u(`span`,{className:`rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500`,children:t.id}),u(`span`,{className:`font-semibold`,children:t.name})]}),u(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.removeSubAgent(t.id),children:`Remove`})]}),u(`p`,{className:`ml-7 text-sm text-gray-600`,children:t.description}),n&&d(`div`,{className:`mt-4 space-y-3 border-t border-gray-100 pt-4`,children:[d(`div`,{className:`grid grid-cols-2 gap-3`,children:[u(y,{compact:!0,label:`Name`,value:t.name,onCommit:n=>e.setSubAgentName(t.id,n)}),u(y,{compact:!0,label:`Description`,value:t.description,onCommit:n=>e.setSubAgentDescription(t.id,n)})]}),u(k,{agentId:t.id,isMain:!1,modelId:t.modelId,profileIds:t.profileIds,skills:t.skills,toolPatterns:t.toolPatterns,models:e.models,profiles:e.profiles,setAgentModel:e.setAgentModel,addAgentProfileRef:e.addAgentProfileRef,removeAgentProfileRef:e.removeAgentProfileRef,reorderAgentProfileRefs:e.reorderAgentProfileRefs,addAgentSkill:e.addAgentSkill,removeAgentSkill:e.removeAgentSkill,addAgentToolPattern:e.addAgentToolPattern,removeAgentToolPattern:e.removeAgentToolPattern})]})]})}function k(e){return d(`div`,{className:`space-y-3`,children:[d(`label`,{className:`block`,children:[u(`span`,{className:`text-xs text-gray-600`,children:`Model`}),u(`select`,{value:e.modelId,onChange:t=>e.setAgentModel(e.agentId,t.target.value),className:`mt-1 w-full rounded border p-2 font-mono text-sm`,children:e.models.map(e=>u(`option`,{value:e.id,children:e.id},e.id))})]}),u(A,{agentId:e.agentId,profileIds:e.profileIds,allProfiles:e.profiles,onAdd:t=>e.addAgentProfileRef(e.agentId,t),onRemove:t=>e.removeAgentProfileRef(e.agentId,t),onReorder:(t,n)=>e.reorderAgentProfileRefs(e.agentId,t,n)}),u(j,{label:`Skills`,hint:`Reference skills by name. tpl wins over ext if both exist.`,values:e.skills,placeholder:`skill-name`,validator:e=>/^[a-z][a-z0-9-]*$/.test(e),onAdd:t=>e.addAgentSkill(e.agentId,t),onRemove:t=>e.removeAgentSkill(e.agentId,t)}),u(j,{label:`Tool patterns`,hint:e.isMain?`Glob patterns over tool names (e.g. clint-project-*, *-mcp__*). Empty = all tools.`:`Glob patterns over tool names. Empty = no tools.`,values:e.toolPatterns,placeholder:`pattern*`,validator:e=>e.length>0,onAdd:t=>e.addAgentToolPattern(e.agentId,t),onRemove:t=>e.removeAgentToolPattern(e.agentId,t)})]})}function A(e){let t=e.allProfiles.filter(t=>!e.profileIds.includes(t.id)),n=t=>{if(t===0)return;let n=e.profileIds[t],r=e.profileIds[t-1];e.onReorder([n],r)},r=t=>{if(t>=e.profileIds.length-1)return;let n=e.profileIds[t],r=t+2<e.profileIds.length?e.profileIds[t+2]:null;e.onReorder([n],r)};return d(`div`,{children:[u(`span`,{className:`text-xs text-gray-600`,children:`Profiles (instructions, in order)`}),d(`ul`,{className:`my-1 space-y-1`,children:[e.profileIds.map((t,i)=>{let a=e.allProfiles.find(e=>e.id===t);return d(`li`,{className:`flex items-center gap-2 rounded bg-gray-50 px-2 py-1`,children:[u(`button`,{className:`text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:i===0,onClick:()=>n(i),title:`Move up`,children:`↑`}),u(`button`,{className:`text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:i===e.profileIds.length-1,onClick:()=>r(i),title:`Move down`,children:`↓`}),u(`span`,{className:`font-mono text-xs text-gray-500`,children:t}),u(`span`,{className:`flex-1 text-sm`,children:a?.title??u(`em`,{className:`text-red-500`,children:`(missing in library)`})}),u(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.onRemove(t),children:`Remove`})]},t)}),e.profileIds.length===0&&u(`li`,{className:`px-2 py-1 text-sm italic text-gray-400`,children:`No profiles assigned`})]}),t.length>0&&d(`select`,{value:``,onChange:t=>{t.target.value&&e.onAdd(t.target.value)},className:`rounded border p-1 text-sm`,children:[u(`option`,{value:``,children:`+ Add profile…`}),t.map(e=>d(`option`,{value:e.id,children:[e.title,` (`,e.id,`)`]},e.id))]})]})}function j(e){let[t,n]=g(``),r=e.validator(t.trim());return d(`div`,{children:[u(`span`,{className:`text-xs text-gray-600`,children:e.label}),u(`p`,{className:`text-xs text-gray-500`,children:e.hint}),u(`div`,{className:`my-1 flex flex-wrap items-center gap-1`,children:e.values.map(t=>d(`span`,{className:`flex items-center gap-1 rounded bg-gray-100 px-2 py-1 font-mono text-xs`,children:[t,u(`button`,{className:`text-red-500 hover:text-red-700`,onClick:()=>e.onRemove(t),title:`Remove`,children:`×`})]},t))}),d(`div`,{className:`flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:e.placeholder,value:t,onChange:e=>n(e.target.value),onKeyDown:i=>{i.key===`Enter`&&r&&(e.onAdd(t.trim()),n(``))},className:`flex-1 rounded border p-1 font-mono text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-2 py-1 text-xs text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50`,disabled:!r,onClick:()=>{e.onAdd(t.trim()),n(``)},children:`Add`})]})]})}function M(e){let[t,n]=g(!1),[r,a]=g(void 0),o=h(0),s=i();p(()=>{if(!e.attachmentRef||!e.attachments){a(void 0);return}let t=!1,n;return(async()=>{try{let{body:r,header:i}=await e.attachments.get(e.attachmentRef),o=[],s=r.getReader();for(;;){let{done:e,value:n}=await s.read();if(t||e)break;n&&o.push(n)}if(t)return;let c=new Blob(o,{type:i.mimeType}),l=URL.createObjectURL(c);n=l,a(l)}catch{}})(),()=>{t=!0,n&&URL.revokeObjectURL(n)}},[e.attachmentRef,e.attachments]);let c=async t=>{if(t.type.startsWith(`image/`)){if(!e.attachments){s?.(`Attachment service unavailable — cannot upload image`,{type:`error`});return}try{let{ref:n}=await(await e.attachments.reserve({mimeType:t.type,fileName:t.name})).send(t.stream());e.onSetImage(n)}catch(e){s?.(`Failed to upload image: ${e instanceof Error?e.message:String(e)}`,{type:`error`})}}},m=f(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.stopPropagation())},[]),_=f(e=>{e.dataTransfer.types.includes(`Files`)&&(e.stopPropagation(),o.current+=1,o.current===1&&n(!0))},[]),v=f(e=>{e.dataTransfer.types.includes(`Files`)&&(e.stopPropagation(),o.current=Math.max(0,o.current-1),o.current===0&&n(!1))},[]),y=f(e=>{if(e.dataTransfer.types.includes(`Files`)){e.preventDefault(),e.stopPropagation(),o.current=0,n(!1);let t=e.dataTransfer.files[0];t&&c(t)}},[]),b=`7rem`;return u(`div`,{style:{width:b,height:b,flexShrink:0},className:`relative my-3`,children:e.attachmentRef?d(l,{children:[r&&u(`img`,{src:r,alt:`Agent`,style:{width:b,height:b},className:`rounded border border-gray-200 object-cover`}),!r&&u(`div`,{style:{width:b,height:b},className:`rounded border border-gray-200 bg-gray-100`}),d(`div`,{className:`mt-1 flex justify-center gap-1`,children:[d(`label`,{className:`cursor-pointer rounded bg-gray-100 px-2 py-0.5 text-xs hover:bg-gray-200`,children:[`Replace`,u(`input`,{type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{e.target.files?.[0]&&c(e.target.files[0])}})]}),u(`button`,{className:`rounded bg-gray-100 px-2 py-0.5 text-xs text-red-600 hover:bg-gray-200`,onClick:e.onClearImage,children:`Remove`})]})]}):u(`div`,{style:{width:b,height:b},className:`flex flex-col items-center justify-center rounded border-2 border-dashed text-center ${t?`border-blue-400 bg-blue-50`:`border-gray-300 bg-white`}`,onDragOver:m,onDragEnter:_,onDragLeave:v,onDrop:y,children:d(`label`,{className:`cursor-pointer p-2 text-xs text-gray-500 hover:text-blue-600`,children:[`Drop image or click`,u(`input`,{type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{e.target.files?.[0]&&c(e.target.files[0])}})]})})})}function N(e){let[t,n]=g(``),r=t=>{let n=[];e.main?.modelId===t&&n.push(e.main.id);for(let r of e.subAgents)r.modelId===t&&n.push(r.id);return n},i=()=>{let r=t.trim();r&&(e.addModel(r),n(``))};return d(`div`,{children:[u(`h4`,{className:`text-sm font-semibold text-gray-700`,children:`Models`}),d(`p`,{className:`text-xs text-gray-500`,children:[`Provider/model format (e.g. `,u(`code`,{children:`anthropic/claude-sonnet-4-5`}),`). Each agent picks one from this list.`]}),e.models.length>0&&d(`table`,{className:`mt-2 w-full text-sm`,children:[u(`thead`,{children:d(`tr`,{className:`border-b text-left text-gray-500`,children:[u(`th`,{className:`py-1`,children:`Model`}),u(`th`,{className:`py-1`,children:`Used by`}),u(`th`,{className:`py-1`})]})}),u(`tbody`,{children:e.models.map(t=>{let n=r(t.id),i=n.length>0;return d(`tr`,{className:`border-b border-gray-100`,children:[u(`td`,{className:`py-2 font-mono`,children:t.id}),u(`td`,{className:`py-2 text-xs text-gray-500`,children:n.length===0?u(`em`,{children:`—`}):n.join(`, `)}),u(`td`,{className:`py-2 text-right`,children:u(`button`,{className:`text-red-500 hover:text-red-700 disabled:cursor-not-allowed disabled:text-gray-300`,disabled:i,title:i?`In use by ${n.join(`, `)}`:``,onClick:()=>e.removeModel(t.id),children:`Remove`})})]},t.id)})})]}),d(`div`,{className:`mt-2 flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:`provider/model-name`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()},className:`flex-1 rounded border p-2 font-mono text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50`,disabled:!t.trim(),onClick:i,children:`Add Model`})]})]})}function P(e){return e.mastra.enabled?u(F,{profiles:e.mastra.profiles,main:e.mastra.mainAgent,subAgents:e.mastra.subAgents,addProfile:e.addProfile,updateProfile:e.updateProfile,removeProfile:e.removeProfile,reorderProfiles:e.reorderProfiles}):d(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Profiles`}),u(`p`,{className:`mt-2`,children:`Enable Mastra in the CLI tab to manage agent profiles.`})]})}function F(e){let[t,n]=g(!1),[r,i]=g(``),[a,o]=g(``),s=t=>{let n=[];e.main?.profileIds.includes(t)&&n.push(e.main.id);for(let r of e.subAgents)r.profileIds.includes(t)&&n.push(r.id);return n},c=()=>{let t=r.trim(),s=a.trim();t&&s&&(e.addProfile(t,s,``),i(``),o(``),n(!1))},l=t=>{if(t===0)return;let n=e.profiles[t].id,r=e.profiles[t-1].id;e.reorderProfiles([n],r)},f=t=>{if(t>=e.profiles.length-1)return;let n=e.profiles[t].id,r=t+2<e.profiles.length?e.profiles[t+2].id:null;e.reorderProfiles([n],r)};return d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Agent Profiles`}),u(`p`,{className:`text-sm text-gray-600`,children:`Markdown sections that compose into agents' instructions. Reference these from each agent's profile list.`}),e.profiles.map((t,n)=>{let r=s(t.id),i=r.length>0;return d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[d(`div`,{className:`flex items-center justify-between`,children:[d(`div`,{className:`flex items-center gap-2`,children:[u(`span`,{className:`rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500`,children:t.id}),u(`input`,{type:`text`,defaultValue:t.title,onBlur:n=>{let r=n.target.value.trim();r&&r!==t.title&&e.updateProfile(t.id,r)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},className:`border-b border-transparent font-semibold hover:border-gray-300 focus:border-blue-500`}),r.length>0&&d(`span`,{className:`rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700`,title:r.join(`, `),children:[`used by: `,r.join(`, `)]})]}),d(`div`,{className:`flex items-center gap-1`,children:[u(`button`,{className:`px-1 text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:n===0,onClick:()=>l(n),title:`Move up`,children:`↑`}),u(`button`,{className:`px-1 text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:n===e.profiles.length-1,onClick:()=>f(n),title:`Move down`,children:`↓`}),u(`button`,{className:`ml-2 text-sm text-red-500 hover:text-red-700 disabled:cursor-not-allowed disabled:text-gray-300`,disabled:i,title:i?`In use by ${r.join(`, `)}`:``,onClick:()=>e.removeProfile(t.id),children:`Remove`})]})]}),u(`textarea`,{defaultValue:t.content,onBlur:n=>{let r=n.target.value;r!==t.content&&e.updateProfile(t.id,void 0,r)},placeholder:`Markdown content for this profile section...`,rows:4,className:`mt-2 w-full rounded border border-gray-200 p-2 font-mono text-sm`})]},t.id)}),t?u(`div`,{className:`my-3 rounded border border-blue-200 bg-blue-50 p-4`,children:d(`div`,{className:`flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:`section-id`,value:r,onChange:e=>i(e.target.value),className:`w-40 rounded border p-2 font-mono text-sm`}),u(`input`,{type:`text`,placeholder:`Section Title`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c()},className:`flex-1 rounded border p-2 text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50`,disabled:!r.trim()||!a.trim(),onClick:c,children:`Add`}),u(`button`,{className:`text-sm text-gray-500 hover:text-gray-700`,onClick:()=>{n(!1),i(``),o(``)},children:`Cancel`})]})}):u(`button`,{className:`mt-3 rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600`,onClick:()=>n(!0),children:`+ Add Profile`})]})}function I(e){return d(l,{children:[d(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Skill Templates`}),u(`p`,{className:`mt-2`,children:`Coming soon`})]}),u(`hr`,{}),u(L,{skills:e.skills,addSkill:e.addSkill,removeSkill:e.removeSkill})]})}function L(e){let[t,n]=g(``),[r,i]=g(``),a=()=>{t.trim()&&r.trim()&&(e.addSkill(t.trim(),r.trim()),n(``),i(``))};return d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`External Skills`}),u(`p`,{className:`text-sm text-gray-600`,children:`Skills from the skills.sh ecosystem, installed via GitHub URL.`}),e.skills.length>0&&u(`ul`,{className:`mt-3 space-y-2`,children:e.skills.map(t=>d(`li`,{className:`flex items-center justify-between rounded border border-gray-200 bg-white p-3`,children:[d(`div`,{children:[u(`span`,{className:`font-mono font-semibold`,children:t.name}),u(`span`,{className:`ml-2 text-sm text-gray-500`,children:t.githubUrl})]}),u(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.removeSkill(t.id),children:`Remove`})]},t.id))}),d(`div`,{className:`mt-3 flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:`skill-name`,value:t,onChange:e=>n(e.target.value),className:`w-40 rounded border p-2 font-mono text-sm`}),u(`input`,{type:`text`,placeholder:`https://github.com/org/repo`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&a()},className:`flex-1 rounded border p-2 font-mono text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50`,disabled:!t.trim()||!r.trim(),onClick:a,children:`Add Skill`})]})]})}function ee(e){return e.isAboveDisabled?u(z,{packages:e.packages,addPackage:e.addPackage,removePackage:e.removePackage,addDocType:e.addDocType,removeDocType:e.removeDocType}):d(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Powerhouse`}),u(`p`,{className:`mt-2`,children:`Enable Powerhouse in the CLI tab (set level to Reactor or above) to manage packages.`})]})}function te(e){let t=e.publishHistory.slice(-5).reverse(),n=v(e.version);return d(l,{children:[d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Publishing`}),d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[d(`div`,{className:`flex items-center gap-4`,children:[u(`span`,{className:`text-sm text-gray-600`,children:`Current version:`}),u(`span`,{className:`font-mono font-semibold`,children:e.version})]}),d(`div`,{className:`mt-3 flex items-center gap-2`,children:[u(`span`,{className:`text-sm text-gray-600`,children:`Bump version to:`}),u(`input`,{type:`text`,placeholder:n,onKeyDown:t=>{if(t.key===`Enter`){let n=t.currentTarget.value.trim();n&&e.bumpVersion(n),t.currentTarget.value=``}},className:`rounded border p-1 font-mono text-sm`})]}),d(`div`,{className:`mt-4 flex items-center gap-2`,children:[u(`button`,{className:`rounded bg-gray-600 px-3 py-2 text-sm text-white hover:bg-gray-700`,onClick:e.publishDev,children:`Publish Dev`}),u(`button`,{className:`rounded bg-amber-600 px-3 py-2 text-sm text-white hover:bg-amber-700`,onClick:e.publishStaging,children:`Publish Staging`}),u(`button`,{className:`rounded bg-green-600 px-3 py-2 text-sm text-white hover:bg-green-700`,onClick:e.publishProduction,children:`Publish Production`})]})]}),t.length>0&&d(`div`,{className:`mt-3`,children:[u(`h4`,{className:`text-sm font-semibold text-gray-600`,children:`Recent publish history`}),u(`ul`,{className:`mt-2 space-y-1`,children:t.map(e=>d(`li`,{className:`flex items-center gap-3 text-sm`,children:[u(V,{status:e.status}),u(`span`,{className:`font-mono`,children:e.version}),u(`span`,{className:`text-gray-500`,children:e.tag}),u(`span`,{className:`text-gray-400`,children:e.timestamp})]},e.id))})]})]}),u(`hr`,{}),u(R,{deployment:e.deployment,setProxyEnabled:e.setProxyEnabled,setObservabilityEnabled:e.setObservabilityEnabled,addSupportedResource:e.addSupportedResource,removeSupportedResource:e.removeSupportedResource}),u(`hr`,{}),d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Document`}),d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[d(`p`,{className:`text-sm text-gray-600`,children:[`Document ID: `,u(`span`,{className:`font-mono`,children:e.documentHeader.id})]}),d(`p`,{className:`text-sm text-gray-600`,children:[`Type: `,u(`span`,{className:`font-mono`,children:e.documentHeader.documentType})]})]})]})]})}function R(e){let[t,n]=g(``);return d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Deployment`}),d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[u(b,{label:`Proxy enabled`,checked:e.deployment.proxyEnabled,onChange:e.setProxyEnabled,hint:`Embedded reverse proxy`}),u(b,{label:`Observability enabled`,checked:e.deployment.observabilityEnabled,onChange:e.setObservabilityEnabled,hint:`Sentry + OpenTelemetry`})]}),d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[u(`h4`,{className:`text-base font-semibold`,children:`Supported resources`}),u(`ul`,{className:`my-2 space-y-1`,children:e.deployment.supportedResources.map(t=>d(`li`,{className:`flex items-center justify-between text-sm`,children:[u(`span`,{className:`font-mono`,children:t}),u(`button`,{className:`text-red-500 hover:text-red-700`,onClick:()=>e.removeSupportedResource(t),children:`Remove`})]},t))}),d(`div`,{className:`mt-2 flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:`vetra-agent-...`,value:t,onChange:e=>n(e.target.value),onKeyDown:r=>{r.key===`Enter`&&t.trim()&&(e.addSupportedResource(t.trim()),n(``))},className:`flex-1 rounded border p-1 font-mono text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-2 py-1 text-xs text-white hover:bg-blue-600 disabled:opacity-50`,disabled:!t.trim(),onClick:()=>{e.addSupportedResource(t.trim()),n(``)},children:`Add`})]})]})]})}function z(e){let[t,n]=g(``);return d(`section`,{className:`my-6`,children:[u(`h3`,{className:`text-lg font-semibold`,children:`Reactor Packages`}),e.packages.map(t=>u(B,{pkg:t,addDocType:e.addDocType,removeDocType:e.removeDocType,removePackage:e.removePackage},t.id)),d(`div`,{className:`my-3 flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:`@scope/package-name`,value:t,onChange:e=>n(e.target.value),onKeyDown:r=>{r.key===`Enter`&&t.trim()&&(e.addPackage(t.trim()),n(``))},className:`flex-1 rounded border p-2 font-mono text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50`,disabled:!t.trim(),onClick:()=>{e.addPackage(t.trim()),n(``)},children:`Add Package`})]})]})}function B(e){let[t,n]=g(``);return d(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[d(`div`,{className:`flex items-center justify-between`,children:[d(`div`,{children:[u(`span`,{className:`font-mono font-semibold`,children:e.pkg.packageName}),e.pkg.managed&&u(`span`,{className:`ml-2 rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700`,children:`managed`}),e.pkg.version&&d(`span`,{className:`ml-2 text-sm text-gray-500`,children:[`v`,e.pkg.version]})]}),!e.pkg.managed&&u(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.removePackage(e.pkg.id),children:`Remove Package`})]}),u(`ul`,{className:`my-2 space-y-1`,children:e.pkg.documentTypes.map(t=>d(`li`,{className:`flex items-center justify-between text-sm`,children:[u(`span`,{className:`font-mono`,children:t}),u(`button`,{className:`text-red-500 hover:text-red-700`,onClick:()=>e.removeDocType(e.pkg.id,t),children:`×`})]},t))}),d(`div`,{className:`mt-2 flex items-center gap-2`,children:[u(`input`,{type:`text`,placeholder:`org/doc-type or */*`,value:t,onChange:e=>n(e.target.value),onKeyDown:r=>{r.key===`Enter`&&t.trim()&&(e.addDocType(e.pkg.id,t.trim()),n(``))},className:`flex-1 rounded border p-1 font-mono text-sm`}),u(`button`,{className:`rounded bg-blue-500 px-2 py-1 text-xs text-white hover:bg-blue-600 disabled:opacity-50`,disabled:!t.trim(),onClick:()=>{e.addDocType(e.pkg.id,t.trim()),n(``)},children:`Add Doc Type`})]})]})}function V(e){return u(`span`,{className:`rounded px-2 py-0.5 text-xs ${e.status===`Succeeded`?`bg-green-100 text-green-700`:e.status===`Failed`?`bg-red-100 text-red-700`:e.status===`InProgress`?`bg-amber-100 text-amber-700`:`bg-gray-100 text-gray-700`}`,children:e.status})}export{S as default};
|
|
2
|
+
//# sourceMappingURL=editor-BaQ62r3i.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-BaQ62r3i.js","names":[],"sources":["../../../editors/ph-clint-project-editor/editor.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { generateId } from 'document-model';\nimport { DocumentToolbar } from '@powerhousedao/design-system/connect';\nimport { createRemoteAttachmentService, type IAttachmentService } from '@powerhousedao/reactor-attachments';\nimport { DEFAULT_SWITCHBOARD_URL, getSwitchboardGatewayUrlFromDriveUrl, useSelectedDrive, usePHToast } from '@powerhousedao/reactor-browser';\nimport { useSelectedPhClintProjectDocument, actions } from 'document-models/ph-clint-project';\nimport type {\n PowerhouseLevel,\n PowerhousePackage,\n ExternalSkill,\n PublishRecord,\n PhClintProjectState,\n PhClintMastraFeature,\n PhClintMainAgent,\n PhClintSubAgent,\n PhClintAgentModel,\n PhClintAgentProfile,\n PhClintDeployment,\n} from '../../document-models/ph-clint-project/v1/gen/types.js';\n\nconst POWERHOUSE_LEVELS: { value: PowerhouseLevel; description: string }[] = [\n { value: 'Disabled', description: 'No Powerhouse integration' },\n { value: 'Reactor', description: 'Document model runtime' },\n { value: 'Switchboard', description: 'API service (GraphQL + MCP)' },\n { value: 'Connect', description: 'Web UI for document management' },\n];\n\n/** Patch-bump a semver-ish version string: 0.0.1 → 0.0.2. Falls back to \"<version>.1\" when unparseable. */\nfunction bumpPatch(version: string): string {\n const m = /^(\\d+)\\.(\\d+)\\.(\\d+)/.exec(version);\n if (!m) return `${version}.1`;\n const [, major, minor, patch] = m;\n return `${major}.${minor}.${Number(patch) + 1}`;\n}\n\nfunction TextField(props: { label: string; value: string; placeholder?: string; readOnly?: boolean; compact?: boolean; onCommit: (value: string) => void }) {\n return (\n <label className={props.compact ? 'my-1 block' : 'my-3 block'}>\n <h3 className={props.compact ? 'text-xs text-gray-600' : 'text-base'}>{props.label}</h3>\n <input\n type=\"text\"\n defaultValue={props.value}\n placeholder={props.placeholder}\n readOnly={props.readOnly}\n onBlur={(e) => {\n const next = e.target.value.trim();\n if (next !== props.value) props.onCommit(next);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') e.currentTarget.blur();\n }}\n className=\"w-full font-mono\"\n />\n </label>\n );\n}\n\nfunction Toggle(props: { label: string; checked: boolean; disabled?: boolean; hint?: string; onChange: (next: boolean) => void }) {\n return (\n <label className=\"my-2 flex items-center gap-3\">\n <input type=\"checkbox\" checked={props.checked} disabled={props.disabled} onChange={(e) => props.onChange(e.target.checked)} />\n <span className=\"font-semibold\">{props.label}</span>\n {props.hint ? <span className=\"text-sm text-gray-600\">{props.hint}</span> : null}\n </label>\n );\n}\n\ntype Tab = 'cli' | 'agents' | 'profiles' | 'skills' | 'powerhouse' | 'publish';\n\nconst TAB_LABELS: { value: Tab; label: string }[] = [\n { value: 'cli', label: 'CLI' },\n { value: 'agents', label: 'Agents' },\n { value: 'profiles', label: 'Profiles' },\n { value: 'skills', label: 'Skills' },\n { value: 'powerhouse', label: 'Powerhouse' },\n { value: 'publish', label: 'Publish' },\n];\n\nexport default function Editor() {\n const [document, dispatch] = useSelectedPhClintProjectDocument();\n const state = document.state.global;\n const { powerhouse, mastra, routine } = state.features;\n const [activeTab, setActiveTab] = useState<Tab>('cli');\n const [drive] = useSelectedDrive();\n const driveRemoteUrl: string | undefined = (drive?.state?.local as { remoteUrl?: string } | undefined)?.remoteUrl;\n const attachmentService = useMemo(\n () =>\n createRemoteAttachmentService({\n remoteUrl: driveRemoteUrl ? getSwitchboardGatewayUrlFromDriveUrl(driveRemoteUrl) : DEFAULT_SWITCHBOARD_URL,\n }),\n [driveRemoteUrl],\n );\n\n // identity dispatchers\n const setPackageIdentifier = (identifier: string) => dispatch(actions.setPackageIdentifier({ identifier }));\n const setVersion = (version: string) => dispatch(actions.setVersion({ version }));\n const setDescription = (description: string) => dispatch(actions.setDescription({ description }));\n\n // feature dispatchers\n const setPowerhouseLevel = (level: PowerhouseLevel) => dispatch(actions.setPowerhouseLevel({ level }));\n const toggleMastra = (enabled: boolean) => {\n if (enabled) {\n const baseName = state.name || 'my-agent';\n const agentId = `${baseName}-agent`;\n const agentName = `${baseName.charAt(0).toUpperCase()}${baseName.slice(1).replace(/-([a-z])/g, (_, c: string) => ` ${c.toUpperCase()}`)} Agent`;\n dispatch(actions.enableMastra({ agentId, agentName }));\n } else {\n dispatch(actions.disableMastra({ _: true }));\n }\n };\n const toggleRoutine = (enabled: boolean) => {\n if (enabled) dispatch(actions.enableRoutine({ _: true }));\n else dispatch(actions.disableRoutine({ _: true }));\n };\n\n // package dispatchers\n const addPackage = (packageName: string) => dispatch(actions.addPowerhousePackage({ id: generateId(), packageName }));\n const removePackage = (id: string) => dispatch(actions.removePowerhousePackage({ id }));\n const addDocType = (packageId: string, documentType: string) => dispatch(actions.addPackageDocumentType({ packageId, documentType }));\n const removeDocType = (packageId: string, documentType: string) => dispatch(actions.removePackageDocumentType({ packageId, documentType }));\n\n // external-skill dispatchers\n const addSkill = (name: string, githubUrl: string) => dispatch(actions.addExternalSkill({ id: generateId(), name, githubUrl }));\n const removeSkill = (id: string) => dispatch(actions.removeExternalSkill({ id }));\n\n // publish dispatchers\n const bumpVersion = (version: string) => dispatch(actions.bumpVersion({ version }));\n const publishDev = () => dispatch(actions.publishDev({ id: generateId(), timestamp: new Date().toISOString() }));\n const publishStaging = () => dispatch(actions.publishStaging({ id: generateId(), timestamp: new Date().toISOString() }));\n const publishProduction = () => dispatch(actions.publishProduction({ id: generateId(), timestamp: new Date().toISOString() }));\n\n // main agent dispatchers\n const setMainAgentName = (name: string) => dispatch(actions.setMainAgentName({ name }));\n const setMainAgentDescription = (description: string) => dispatch(actions.setMainAgentDescription({ description }));\n const clearMainAgentDescription = () => dispatch(actions.clearMainAgentDescription({ _: true }));\n const setMainAgentImage = (attachment: string) => dispatch(actions.setMainAgentImage({ attachment }));\n const clearMainAgentImage = () => dispatch(actions.clearMainAgentImage({ _: true }));\n\n // sub agent dispatchers\n const addSubAgent = (id: string, name: string, description: string, modelId: string) => dispatch(actions.addSubAgent({ id, name, description, modelId }));\n const removeSubAgent = (id: string) => dispatch(actions.removeSubAgent({ id }));\n const setSubAgentName = (id: string, name: string) => dispatch(actions.setSubAgentName({ id, name }));\n const setSubAgentDescription = (id: string, description: string) => dispatch(actions.setSubAgentDescription({ id, description }));\n\n // library dispatchers\n const addModel = (id: string) => dispatch(actions.addModel({ id }));\n const removeModel = (id: string) => dispatch(actions.removeModel({ id }));\n const addProfile = (id: string, title: string, content: string, insertBefore?: string) => dispatch(actions.addProfile({ id, title, content, insertBefore }));\n const updateProfile = (id: string, title?: string, content?: string) => dispatch(actions.updateProfile({ id, title, content }));\n const removeProfile = (id: string) => dispatch(actions.removeProfile({ id }));\n const reorderProfiles = (ids: string[], insertBefore: string | null) => dispatch(actions.reorderProfiles({ ids, insertBefore }));\n\n // per-agent binding dispatchers\n const setAgentModel = (agentId: string, modelId: string) => dispatch(actions.setAgentModel({ agentId, modelId }));\n const addAgentProfileRef = (agentId: string, profileId: string, insertBefore?: string) => dispatch(actions.addAgentProfileRef({ agentId, profileId, insertBefore }));\n const removeAgentProfileRef = (agentId: string, profileId: string) => dispatch(actions.removeAgentProfileRef({ agentId, profileId }));\n const reorderAgentProfileRefs = (agentId: string, ids: string[], insertBefore: string | null) => dispatch(actions.reorderAgentProfileRefs({ agentId, ids, insertBefore }));\n const addAgentSkill = (agentId: string, name: string) => dispatch(actions.addAgentSkill({ agentId, name }));\n const removeAgentSkill = (agentId: string, name: string) => dispatch(actions.removeAgentSkill({ agentId, name }));\n const addAgentToolPattern = (agentId: string, pattern: string) => dispatch(actions.addAgentToolPattern({ agentId, pattern }));\n const removeAgentToolPattern = (agentId: string, pattern: string) => dispatch(actions.removeAgentToolPattern({ agentId, pattern }));\n\n // chat dispatcher\n const setEnableChat = (enabled: boolean) => dispatch(actions.setEnableChat({ enabled }));\n\n // deployment dispatchers\n const setProxyEnabled = (enabled: boolean) => dispatch(actions.setProxyEnabled({ enabled }));\n const setObservabilityEnabled = (enabled: boolean) => dispatch(actions.setObservabilityEnabled({ enabled }));\n const addSupportedResource = (resource: string) => dispatch(actions.addSupportedResource({ resource }));\n const removeSupportedResource = (resource: string) => dispatch(actions.removeSupportedResource({ resource }));\n\n const isAboveDisabled = powerhouse !== 'Disabled';\n\n const tabClasses = (tab: Tab) => `px-4 py-2 text-sm font-medium border-b-2 cursor-pointer ${activeTab === tab ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700'}`;\n\n return (\n <div className=\"mx-auto max-w-4xl bg-gray-50 p-6\">\n <DocumentToolbar />\n\n <div className=\"ph-default-styles\">\n <h2 className=\"mt-4 text-xl font-bold\">ph-clint Project Spec</h2>\n\n <nav className=\"my-4 flex border-b border-gray-200\">\n {TAB_LABELS.map((t) => (\n <button key={t.value} className={tabClasses(t.value)} onClick={() => setActiveTab(t.value)}>\n {t.label}\n </button>\n ))}\n </nav>\n\n {activeTab === 'cli' && (\n <CliTab\n state={state}\n powerhouse={powerhouse}\n mastra={mastra}\n routine={routine}\n isAboveDisabled={isAboveDisabled}\n setPackageIdentifier={setPackageIdentifier}\n setVersion={setVersion}\n setDescription={setDescription}\n setPowerhouseLevel={setPowerhouseLevel}\n toggleMastra={toggleMastra}\n toggleRoutine={toggleRoutine}\n setEnableChat={setEnableChat}\n addModel={addModel}\n removeModel={removeModel}\n />\n )}\n\n {activeTab === 'agents' && (\n <AgentsTab\n mastra={mastra}\n attachments={attachmentService}\n setMainAgentName={setMainAgentName}\n setMainAgentDescription={setMainAgentDescription}\n clearMainAgentDescription={clearMainAgentDescription}\n setMainAgentImage={setMainAgentImage}\n clearMainAgentImage={clearMainAgentImage}\n addSubAgent={addSubAgent}\n removeSubAgent={removeSubAgent}\n setSubAgentName={setSubAgentName}\n setSubAgentDescription={setSubAgentDescription}\n setAgentModel={setAgentModel}\n addAgentProfileRef={addAgentProfileRef}\n removeAgentProfileRef={removeAgentProfileRef}\n reorderAgentProfileRefs={reorderAgentProfileRefs}\n addAgentSkill={addAgentSkill}\n removeAgentSkill={removeAgentSkill}\n addAgentToolPattern={addAgentToolPattern}\n removeAgentToolPattern={removeAgentToolPattern}\n />\n )}\n\n {activeTab === 'profiles' && <ProfilesTab mastra={mastra} addProfile={addProfile} updateProfile={updateProfile} removeProfile={removeProfile} reorderProfiles={reorderProfiles} />}\n\n {activeTab === 'skills' && <SkillsTab skills={state.externalSkills} addSkill={addSkill} removeSkill={removeSkill} />}\n\n {activeTab === 'powerhouse' && <PowerhouseTab packages={state.packages} isAboveDisabled={isAboveDisabled} addPackage={addPackage} removePackage={removePackage} addDocType={addDocType} removeDocType={removeDocType} />}\n\n {activeTab === 'publish' && (\n <PublishTab\n version={state.version}\n publishHistory={state.publishHistory}\n documentHeader={document.header}\n deployment={state.deployment}\n bumpVersion={bumpVersion}\n publishDev={publishDev}\n publishStaging={publishStaging}\n publishProduction={publishProduction}\n setProxyEnabled={setProxyEnabled}\n setObservabilityEnabled={setObservabilityEnabled}\n addSupportedResource={addSupportedResource}\n removeSupportedResource={removeSupportedResource}\n />\n )}\n </div>\n </div>\n );\n}\n\n/* ── CLI Tab ──────────────────────────────────────────────────── */\n\nfunction CliTab(props: {\n state: PhClintProjectState;\n powerhouse: PowerhouseLevel;\n mastra: PhClintMastraFeature;\n routine: { enabled: boolean };\n isAboveDisabled: boolean;\n setPackageIdentifier: (identifier: string) => void;\n setVersion: (version: string) => void;\n setDescription: (description: string) => void;\n setPowerhouseLevel: (level: PowerhouseLevel) => void;\n toggleMastra: (enabled: boolean) => void;\n toggleRoutine: (enabled: boolean) => void;\n setEnableChat: (enabled: boolean) => void;\n addModel: (id: string) => void;\n removeModel: (id: string) => void;\n}) {\n const { state, mastra } = props;\n const packageIdentifier = `${state.scope ? state.scope + '/' : ''}${state.name ?? ''}`;\n\n return (\n <>\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Identity</h3>\n <div className=\"grid grid-cols-[3fr_1fr] gap-4\">\n <TextField label=\"Package name\" value={packageIdentifier} placeholder=\"@scope/my-tool-cli\" onCommit={props.setPackageIdentifier} />\n <TextField label=\"Version\" value={state.version} placeholder=\"0.1.0\" onCommit={props.setVersion} />\n </div>\n <TextField label=\"Description\" value={state.description} placeholder=\"What this CLI does\" onCommit={props.setDescription} />\n </section>\n\n <hr />\n\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Features</h3>\n\n <div className=\"my-4 rounded border border-gray-200 bg-white p-4\">\n <h4 className=\"text-base font-semibold\">Powerhouse</h4>\n {props.isAboveDisabled && <p className=\"text-sm text-gray-500\">Cannot go back to Disabled once enabled</p>}\n <div className=\"mt-2 space-y-2\">\n {POWERHOUSE_LEVELS.map((level, i) => (\n <label key={level.value} className=\"flex items-start gap-2\">\n {i > 0 && <div className=\"absolute -mt-3 ml-[7px] h-3 border-l border-gray-300\" />}\n <input type=\"radio\" name=\"powerhouse-level\" checked={props.powerhouse === level.value} disabled={props.isAboveDisabled && level.value === 'Disabled'} onChange={() => props.setPowerhouseLevel(level.value)} className=\"mt-0.5\" />\n <div>\n <span className=\"font-medium\">{level.value}</span>\n <span className=\"ml-2 text-sm text-gray-500\">{level.description}</span>\n </div>\n </label>\n ))}\n </div>\n </div>\n\n <div className=\"my-4 rounded border border-gray-200 bg-white p-4\">\n <Toggle label=\"Mastra\" checked={mastra.enabled} hint=\"AI agent framework\" onChange={props.toggleMastra} />\n {mastra.enabled && (\n <div className=\"mt-4 space-y-4 border-t border-gray-100 pt-4\">\n <ModelsSection models={mastra.models} main={mastra.mainAgent} subAgents={mastra.subAgents} addModel={props.addModel} removeModel={props.removeModel} />\n <div>\n <h4 className=\"text-sm font-semibold text-gray-700\">Common</h4>\n <Toggle\n label=\"Enable Chat\"\n checked={mastra.common.enableChat}\n disabled={!props.isAboveDisabled}\n hint={props.isAboveDisabled ? 'Chat session integration via clint-common' : 'Requires Powerhouse to be enabled'}\n onChange={props.setEnableChat}\n />\n </div>\n </div>\n )}\n </div>\n\n <div className=\"my-4 rounded border border-gray-200 bg-white p-4\">\n <Toggle label=\"Routine loop\" checked={props.routine.enabled} hint=\"tick-based execution loop with triggers\" onChange={props.toggleRoutine} />\n </div>\n </section>\n </>\n );\n}\n\n/* ── Agents Tab ───────────────────────────────────────────────── */\n\ninterface AgentsTabProps {\n mastra: PhClintMastraFeature;\n attachments?: IAttachmentService;\n setMainAgentName: (name: string) => void;\n setMainAgentDescription: (description: string) => void;\n clearMainAgentDescription: () => void;\n setMainAgentImage: (image: string) => void;\n clearMainAgentImage: () => void;\n addSubAgent: (id: string, name: string, description: string, modelId: string) => void;\n removeSubAgent: (id: string) => void;\n setSubAgentName: (id: string, name: string) => void;\n setSubAgentDescription: (id: string, description: string) => void;\n setAgentModel: (agentId: string, modelId: string) => void;\n addAgentProfileRef: (agentId: string, profileId: string, insertBefore?: string) => void;\n removeAgentProfileRef: (agentId: string, profileId: string) => void;\n reorderAgentProfileRefs: (agentId: string, ids: string[], insertBefore: string | null) => void;\n addAgentSkill: (agentId: string, name: string) => void;\n removeAgentSkill: (agentId: string, name: string) => void;\n addAgentToolPattern: (agentId: string, pattern: string) => void;\n removeAgentToolPattern: (agentId: string, pattern: string) => void;\n}\n\nfunction AgentsTab(props: AgentsTabProps) {\n const { mastra, attachments } = props;\n const main = mastra.mainAgent;\n const [showAddForm, setShowAddForm] = useState(false);\n\n if (!mastra.enabled || !main) {\n return (\n <section className=\"my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500\">\n <h3 className=\"text-lg font-semibold\">Agents</h3>\n <p className=\"mt-2\">Enable Mastra in the CLI tab to configure agents.</p>\n </section>\n );\n }\n\n const allAgentIds = [main.id, ...mastra.subAgents.map((s) => s.id)];\n\n return (\n <>\n <MainAgentCard\n main={main}\n models={mastra.models}\n profiles={mastra.profiles}\n attachments={attachments}\n setMainAgentName={props.setMainAgentName}\n setMainAgentDescription={props.setMainAgentDescription}\n clearMainAgentDescription={props.clearMainAgentDescription}\n setMainAgentImage={props.setMainAgentImage}\n clearMainAgentImage={props.clearMainAgentImage}\n setAgentModel={props.setAgentModel}\n addAgentProfileRef={props.addAgentProfileRef}\n removeAgentProfileRef={props.removeAgentProfileRef}\n reorderAgentProfileRefs={props.reorderAgentProfileRefs}\n addAgentSkill={props.addAgentSkill}\n removeAgentSkill={props.removeAgentSkill}\n addAgentToolPattern={props.addAgentToolPattern}\n removeAgentToolPattern={props.removeAgentToolPattern}\n />\n\n {mastra.subAgents.map((sub) => (\n <SubAgentCard\n key={sub.id}\n sub={sub}\n models={mastra.models}\n profiles={mastra.profiles}\n removeSubAgent={props.removeSubAgent}\n setSubAgentName={props.setSubAgentName}\n setSubAgentDescription={props.setSubAgentDescription}\n setAgentModel={props.setAgentModel}\n addAgentProfileRef={props.addAgentProfileRef}\n removeAgentProfileRef={props.removeAgentProfileRef}\n reorderAgentProfileRefs={props.reorderAgentProfileRefs}\n addAgentSkill={props.addAgentSkill}\n removeAgentSkill={props.removeAgentSkill}\n addAgentToolPattern={props.addAgentToolPattern}\n removeAgentToolPattern={props.removeAgentToolPattern}\n />\n ))}\n\n <section className=\"my-6\">\n {showAddForm ? (\n <AddSubAgentForm\n models={mastra.models}\n existingAgentIds={allAgentIds}\n onAdd={(id, name, description, modelId) => {\n props.addSubAgent(id, name, description, modelId);\n setShowAddForm(false);\n }}\n onCancel={() => setShowAddForm(false)}\n />\n ) : (\n <button\n className=\"rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50\"\n disabled={mastra.models.length === 0}\n title={mastra.models.length === 0 ? 'Add a model first (CLI tab → Mastra)' : ''}\n onClick={() => setShowAddForm(true)}\n >\n + Add Sub-agent\n </button>\n )}\n </section>\n </>\n );\n}\n\n/* ── Main Agent card (collapsible, sits as a peer of sub-agents) ── */\n\ninterface MainAgentCardProps {\n main: PhClintMainAgent;\n models: PhClintAgentModel[];\n profiles: PhClintAgentProfile[];\n attachments?: IAttachmentService;\n setMainAgentName: (name: string) => void;\n setMainAgentDescription: (description: string) => void;\n clearMainAgentDescription: () => void;\n setMainAgentImage: (image: string) => void;\n clearMainAgentImage: () => void;\n setAgentModel: (agentId: string, modelId: string) => void;\n addAgentProfileRef: (agentId: string, profileId: string, insertBefore?: string) => void;\n removeAgentProfileRef: (agentId: string, profileId: string) => void;\n reorderAgentProfileRefs: (agentId: string, ids: string[], insertBefore: string | null) => void;\n addAgentSkill: (agentId: string, name: string) => void;\n removeAgentSkill: (agentId: string, name: string) => void;\n addAgentToolPattern: (agentId: string, pattern: string) => void;\n removeAgentToolPattern: (agentId: string, pattern: string) => void;\n}\n\nfunction MainAgentCard(props: MainAgentCardProps) {\n const { main } = props;\n const [expanded, setExpanded] = useState(true);\n\n return (\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <button className=\"text-sm text-gray-400 hover:text-gray-700\" onClick={() => setExpanded(!expanded)} title={expanded ? 'Collapse' : 'Expand'}>\n {expanded ? '▾' : '▸'}\n </button>\n <span className=\"rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500\">{main.id}</span>\n <span className=\"font-semibold\">{main.name}</span>\n <span className=\"rounded bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-700\">Main</span>\n </div>\n </div>\n {main.description && <p className=\"ml-7 text-sm text-gray-600\">{main.description}</p>}\n\n {expanded && (\n <div className=\"mt-4 space-y-3 border-t border-gray-100 pt-4\">\n <div style={{ display: 'flex', gap: '1.5rem' }}>\n <div style={{ flexShrink: 0, width: '7rem' }}>\n <AgentImageField attachmentRef={main.attachment ?? null} attachments={props.attachments} onSetImage={props.setMainAgentImage} onClearImage={props.clearMainAgentImage} />\n </div>\n <div style={{ flex: 1, minWidth: 0 }}>\n <div className=\"grid grid-cols-[1fr_2fr] gap-4\">\n <TextField compact readOnly label=\"Agent ID\" value={main.id} onCommit={() => {}} />\n <TextField compact label=\"Agent Name\" value={main.name} placeholder=\"My Agent\" onCommit={props.setMainAgentName} />\n </div>\n <DescriptionField value={main.description} placeholder=\"A brief description of what this agent does\" onSet={props.setMainAgentDescription} onClear={props.clearMainAgentDescription} />\n </div>\n </div>\n\n <AgentBindings\n agentId={main.id}\n isMain\n modelId={main.modelId}\n profileIds={main.profileIds}\n skills={main.skills}\n toolPatterns={main.toolPatterns}\n models={props.models}\n profiles={props.profiles}\n setAgentModel={props.setAgentModel}\n addAgentProfileRef={props.addAgentProfileRef}\n removeAgentProfileRef={props.removeAgentProfileRef}\n reorderAgentProfileRefs={props.reorderAgentProfileRefs}\n addAgentSkill={props.addAgentSkill}\n removeAgentSkill={props.removeAgentSkill}\n addAgentToolPattern={props.addAgentToolPattern}\n removeAgentToolPattern={props.removeAgentToolPattern}\n />\n </div>\n )}\n </div>\n );\n}\n\nfunction DescriptionField(props: { value: string | null | undefined; placeholder: string; onSet: (v: string) => void; onClear: () => void }) {\n return (\n <label className=\"my-1 block\">\n <h3 className=\"text-xs text-gray-600\">Description</h3>\n <div className=\"flex items-center gap-2\">\n <input\n type=\"text\"\n defaultValue={props.value ?? ''}\n placeholder={props.placeholder}\n onBlur={(e) => {\n const next = e.target.value.trim();\n if (next && next !== (props.value ?? '')) props.onSet(next);\n else if (!next && props.value !== null) props.onClear();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') e.currentTarget.blur();\n }}\n className=\"w-full font-mono\"\n />\n </div>\n </label>\n );\n}\n\nfunction AddSubAgentForm(props: { models: PhClintAgentModel[]; existingAgentIds: string[]; onAdd: (id: string, name: string, description: string, modelId: string) => void; onCancel: () => void }) {\n const [id, setId] = useState('');\n const [name, setName] = useState('');\n const [description, setDescription] = useState('');\n const [modelId, setModelId] = useState<string>(props.models[0]?.id ?? '');\n\n const idValid = /^[a-z][a-z0-9-]*$/.test(id) && !props.existingAgentIds.includes(id);\n const canAdd = idValid && name.trim() && description.trim() && modelId;\n\n return (\n <div className=\"my-3 rounded border border-blue-200 bg-blue-50 p-4\">\n <div className=\"grid grid-cols-2 gap-3\">\n <label className=\"block\">\n <span className=\"text-xs text-gray-600\">Sub-agent ID</span>\n <input type=\"text\" value={id} placeholder=\"summarizer\" onChange={(e) => setId(e.target.value.trim())} className=\"w-full rounded border p-2 font-mono text-sm\" />\n </label>\n <label className=\"block\">\n <span className=\"text-xs text-gray-600\">Display name</span>\n <input type=\"text\" value={name} placeholder=\"Summarizer\" onChange={(e) => setName(e.target.value)} className=\"w-full rounded border p-2 text-sm\" />\n </label>\n </div>\n <label className=\"my-2 block\">\n <span className=\"text-xs text-gray-600\">Description (the main agent uses this to decide when to delegate)</span>\n <input type=\"text\" value={description} placeholder=\"Summarizes long documents into bullet points\" onChange={(e) => setDescription(e.target.value)} className=\"w-full rounded border p-2 text-sm\" />\n </label>\n <label className=\"my-2 block\">\n <span className=\"text-xs text-gray-600\">Model</span>\n <select value={modelId} onChange={(e) => setModelId(e.target.value)} className=\"w-full rounded border p-2 font-mono text-sm\">\n {props.models.map((m) => (\n <option key={m.id} value={m.id}>\n {m.id}\n </option>\n ))}\n </select>\n </label>\n <div className=\"mt-2 flex items-center gap-2\">\n <button className=\"rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50\" disabled={!canAdd} onClick={() => props.onAdd(id, name.trim(), description.trim(), modelId)}>\n Add\n </button>\n <button className=\"text-sm text-gray-500 hover:text-gray-700\" onClick={props.onCancel}>\n Cancel\n </button>\n </div>\n </div>\n );\n}\n\ninterface SubAgentCardProps {\n sub: PhClintSubAgent;\n models: PhClintAgentModel[];\n profiles: PhClintAgentProfile[];\n removeSubAgent: (id: string) => void;\n setSubAgentName: (id: string, name: string) => void;\n setSubAgentDescription: (id: string, description: string) => void;\n setAgentModel: (agentId: string, modelId: string) => void;\n addAgentProfileRef: (agentId: string, profileId: string, insertBefore?: string) => void;\n removeAgentProfileRef: (agentId: string, profileId: string) => void;\n reorderAgentProfileRefs: (agentId: string, ids: string[], insertBefore: string | null) => void;\n addAgentSkill: (agentId: string, name: string) => void;\n removeAgentSkill: (agentId: string, name: string) => void;\n addAgentToolPattern: (agentId: string, pattern: string) => void;\n removeAgentToolPattern: (agentId: string, pattern: string) => void;\n}\n\nfunction SubAgentCard(props: SubAgentCardProps) {\n const { sub } = props;\n const [expanded, setExpanded] = useState(false);\n\n return (\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <button className=\"text-sm text-gray-400 hover:text-gray-700\" onClick={() => setExpanded(!expanded)} title={expanded ? 'Collapse' : 'Expand'}>\n {expanded ? '▾' : '▸'}\n </button>\n <span className=\"rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500\">{sub.id}</span>\n <span className=\"font-semibold\">{sub.name}</span>\n </div>\n <button className=\"text-sm text-red-500 hover:text-red-700\" onClick={() => props.removeSubAgent(sub.id)}>\n Remove\n </button>\n </div>\n <p className=\"ml-7 text-sm text-gray-600\">{sub.description}</p>\n\n {expanded && (\n <div className=\"mt-4 space-y-3 border-t border-gray-100 pt-4\">\n <div className=\"grid grid-cols-2 gap-3\">\n <TextField compact label=\"Name\" value={sub.name} onCommit={(v) => props.setSubAgentName(sub.id, v)} />\n <TextField compact label=\"Description\" value={sub.description} onCommit={(v) => props.setSubAgentDescription(sub.id, v)} />\n </div>\n <AgentBindings\n agentId={sub.id}\n isMain={false}\n modelId={sub.modelId}\n profileIds={sub.profileIds}\n skills={sub.skills}\n toolPatterns={sub.toolPatterns}\n models={props.models}\n profiles={props.profiles}\n setAgentModel={props.setAgentModel}\n addAgentProfileRef={props.addAgentProfileRef}\n removeAgentProfileRef={props.removeAgentProfileRef}\n reorderAgentProfileRefs={props.reorderAgentProfileRefs}\n addAgentSkill={props.addAgentSkill}\n removeAgentSkill={props.removeAgentSkill}\n addAgentToolPattern={props.addAgentToolPattern}\n removeAgentToolPattern={props.removeAgentToolPattern}\n />\n </div>\n )}\n </div>\n );\n}\n\n/* ── Agent bindings (per-agent model + profiles + skills + tool patterns) ── */\n\ninterface AgentBindingsProps {\n agentId: string;\n isMain: boolean;\n modelId: string;\n profileIds: string[];\n skills: string[];\n toolPatterns: string[];\n models: PhClintAgentModel[];\n profiles: PhClintAgentProfile[];\n setAgentModel: (agentId: string, modelId: string) => void;\n addAgentProfileRef: (agentId: string, profileId: string, insertBefore?: string) => void;\n removeAgentProfileRef: (agentId: string, profileId: string) => void;\n reorderAgentProfileRefs: (agentId: string, ids: string[], insertBefore: string | null) => void;\n addAgentSkill: (agentId: string, name: string) => void;\n removeAgentSkill: (agentId: string, name: string) => void;\n addAgentToolPattern: (agentId: string, pattern: string) => void;\n removeAgentToolPattern: (agentId: string, pattern: string) => void;\n}\n\nfunction AgentBindings(props: AgentBindingsProps) {\n return (\n <div className=\"space-y-3\">\n <label className=\"block\">\n <span className=\"text-xs text-gray-600\">Model</span>\n <select value={props.modelId} onChange={(e) => props.setAgentModel(props.agentId, e.target.value)} className=\"mt-1 w-full rounded border p-2 font-mono text-sm\">\n {props.models.map((m) => (\n <option key={m.id} value={m.id}>\n {m.id}\n </option>\n ))}\n </select>\n </label>\n\n <ProfileRefsEditor\n agentId={props.agentId}\n profileIds={props.profileIds}\n allProfiles={props.profiles}\n onAdd={(profileId) => props.addAgentProfileRef(props.agentId, profileId)}\n onRemove={(profileId) => props.removeAgentProfileRef(props.agentId, profileId)}\n onReorder={(ids, insertBefore) => props.reorderAgentProfileRefs(props.agentId, ids, insertBefore)}\n />\n\n <ChipListEditor\n label=\"Skills\"\n hint=\"Reference skills by name. tpl wins over ext if both exist.\"\n values={props.skills}\n placeholder=\"skill-name\"\n validator={(v) => /^[a-z][a-z0-9-]*$/.test(v)}\n onAdd={(v) => props.addAgentSkill(props.agentId, v)}\n onRemove={(v) => props.removeAgentSkill(props.agentId, v)}\n />\n\n <ChipListEditor\n label=\"Tool patterns\"\n hint={props.isMain ? 'Glob patterns over tool names (e.g. clint-project-*, *-mcp__*). Empty = all tools.' : 'Glob patterns over tool names. Empty = no tools.'}\n values={props.toolPatterns}\n placeholder=\"pattern*\"\n validator={(v) => v.length > 0}\n onAdd={(v) => props.addAgentToolPattern(props.agentId, v)}\n onRemove={(v) => props.removeAgentToolPattern(props.agentId, v)}\n />\n </div>\n );\n}\n\nfunction ProfileRefsEditor(props: {\n agentId: string;\n profileIds: string[];\n allProfiles: PhClintAgentProfile[];\n onAdd: (profileId: string) => void;\n onRemove: (profileId: string) => void;\n onReorder: (ids: string[], insertBefore: string | null) => void;\n}) {\n const available = props.allProfiles.filter((p) => !props.profileIds.includes(p.id));\n\n const moveUp = (index: number) => {\n if (index === 0) return;\n const id = props.profileIds[index];\n const beforeId = props.profileIds[index - 1];\n props.onReorder([id], beforeId);\n };\n\n const moveDown = (index: number) => {\n if (index >= props.profileIds.length - 1) return;\n const id = props.profileIds[index];\n const afterNext = index + 2 < props.profileIds.length ? props.profileIds[index + 2] : null;\n props.onReorder([id], afterNext);\n };\n\n return (\n <div>\n <span className=\"text-xs text-gray-600\">Profiles (instructions, in order)</span>\n <ul className=\"my-1 space-y-1\">\n {props.profileIds.map((profileId, i) => {\n const profile = props.allProfiles.find((p) => p.id === profileId);\n return (\n <li key={profileId} className=\"flex items-center gap-2 rounded bg-gray-50 px-2 py-1\">\n <button className=\"text-gray-400 hover:text-gray-600 disabled:opacity-30\" disabled={i === 0} onClick={() => moveUp(i)} title=\"Move up\">\n ↑\n </button>\n <button className=\"text-gray-400 hover:text-gray-600 disabled:opacity-30\" disabled={i === props.profileIds.length - 1} onClick={() => moveDown(i)} title=\"Move down\">\n ↓\n </button>\n <span className=\"font-mono text-xs text-gray-500\">{profileId}</span>\n <span className=\"flex-1 text-sm\">{profile?.title ?? <em className=\"text-red-500\">(missing in library)</em>}</span>\n <button className=\"text-sm text-red-500 hover:text-red-700\" onClick={() => props.onRemove(profileId)}>\n Remove\n </button>\n </li>\n );\n })}\n {props.profileIds.length === 0 && <li className=\"px-2 py-1 text-sm italic text-gray-400\">No profiles assigned</li>}\n </ul>\n {available.length > 0 && (\n <select\n value=\"\"\n onChange={(e) => {\n if (e.target.value) props.onAdd(e.target.value);\n }}\n className=\"rounded border p-1 text-sm\"\n >\n <option value=\"\">+ Add profile…</option>\n {available.map((p) => (\n <option key={p.id} value={p.id}>\n {p.title} ({p.id})\n </option>\n ))}\n </select>\n )}\n </div>\n );\n}\n\nfunction ChipListEditor(props: { label: string; hint: string; values: string[]; placeholder: string; validator: (v: string) => boolean; onAdd: (v: string) => void; onRemove: (v: string) => void }) {\n const [input, setInput] = useState('');\n const valid = props.validator(input.trim());\n\n return (\n <div>\n <span className=\"text-xs text-gray-600\">{props.label}</span>\n <p className=\"text-xs text-gray-500\">{props.hint}</p>\n <div className=\"my-1 flex flex-wrap items-center gap-1\">\n {props.values.map((v) => (\n <span key={v} className=\"flex items-center gap-1 rounded bg-gray-100 px-2 py-1 font-mono text-xs\">\n {v}\n <button className=\"text-red-500 hover:text-red-700\" onClick={() => props.onRemove(v)} title=\"Remove\">\n ×\n </button>\n </span>\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <input\n type=\"text\"\n placeholder={props.placeholder}\n value={input}\n onChange={(e) => setInput(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && valid) {\n props.onAdd(input.trim());\n setInput('');\n }\n }}\n className=\"flex-1 rounded border p-1 font-mono text-sm\"\n />\n <button\n className=\"rounded bg-blue-500 px-2 py-1 text-xs text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50\"\n disabled={!valid}\n onClick={() => {\n props.onAdd(input.trim());\n setInput('');\n }}\n >\n Add\n </button>\n </div>\n </div>\n );\n}\n\n/* ── Agent image (avatar) — main only ────────────────────────── */\n\nfunction AgentImageField(props: { attachmentRef: string | null | undefined; attachments?: IAttachmentService; onSetImage: (ref: string) => void; onClearImage: () => void }) {\n const [isDragOver, setIsDragOver] = useState(false);\n const [objectUrl, setObjectUrl] = useState<string | undefined>(undefined);\n const dragDepthRef = useRef(0);\n const toast = usePHToast();\n\n useEffect(() => {\n if (!props.attachmentRef || !props.attachments) {\n setObjectUrl(undefined);\n return;\n }\n let cancelled = false;\n let createdUrl: string | undefined;\n void (async () => {\n try {\n const { body, header } = await props.attachments!.get(props.attachmentRef as Parameters<NonNullable<typeof props.attachments>['get']>[0]);\n const chunks: Uint8Array[] = [];\n const reader = body.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (cancelled) break;\n if (done) break;\n if (value) chunks.push(value);\n }\n if (cancelled) return;\n const blob = new Blob(chunks as BlobPart[], { type: header.mimeType });\n const url = URL.createObjectURL(blob);\n createdUrl = url;\n setObjectUrl(url);\n } catch {\n // attachment not yet available or service error\n }\n })();\n return () => {\n cancelled = true;\n if (createdUrl) URL.revokeObjectURL(createdUrl);\n };\n }, [props.attachmentRef, props.attachments]);\n\n const handleFile = async (file: File) => {\n if (!file.type.startsWith('image/')) return;\n if (!props.attachments) {\n toast?.('Attachment service unavailable — cannot upload image', { type: 'error' });\n return;\n }\n try {\n const upload = await props.attachments.reserve({ mimeType: file.type, fileName: file.name });\n const { ref } = await upload.send(file.stream());\n props.onSetImage(ref);\n } catch (err) {\n toast?.(`Failed to upload image: ${err instanceof Error ? err.message : String(err)}`, { type: 'error' });\n }\n };\n\n const onDragOver = useCallback((e: React.DragEvent) => {\n if (e.dataTransfer.types.includes('Files')) {\n e.preventDefault();\n e.stopPropagation();\n }\n }, []);\n\n const onDragEnter = useCallback((e: React.DragEvent) => {\n if (e.dataTransfer.types.includes('Files')) {\n e.stopPropagation();\n dragDepthRef.current += 1;\n if (dragDepthRef.current === 1) setIsDragOver(true);\n }\n }, []);\n\n const onDragLeave = useCallback((e: React.DragEvent) => {\n if (e.dataTransfer.types.includes('Files')) {\n e.stopPropagation();\n dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);\n if (dragDepthRef.current === 0) setIsDragOver(false);\n }\n }, []);\n\n const onDrop = useCallback((e: React.DragEvent) => {\n if (e.dataTransfer.types.includes('Files')) {\n e.preventDefault();\n e.stopPropagation();\n dragDepthRef.current = 0;\n setIsDragOver(false);\n const file = e.dataTransfer.files[0];\n if (file) void handleFile(file);\n }\n }, []);\n\n const SIZE = '7rem';\n\n return (\n <div style={{ width: SIZE, height: SIZE, flexShrink: 0 }} className=\"relative my-3\">\n {props.attachmentRef ? (\n <>\n {objectUrl && <img src={objectUrl} alt=\"Agent\" style={{ width: SIZE, height: SIZE }} className=\"rounded border border-gray-200 object-cover\" />}\n {!objectUrl && <div style={{ width: SIZE, height: SIZE }} className=\"rounded border border-gray-200 bg-gray-100\" />}\n <div className=\"mt-1 flex justify-center gap-1\">\n <label className=\"cursor-pointer rounded bg-gray-100 px-2 py-0.5 text-xs hover:bg-gray-200\">\n Replace\n <input\n type=\"file\"\n accept=\"image/*\"\n className=\"hidden\"\n onChange={(e) => {\n if (e.target.files?.[0]) void handleFile(e.target.files[0]);\n }}\n />\n </label>\n <button className=\"rounded bg-gray-100 px-2 py-0.5 text-xs text-red-600 hover:bg-gray-200\" onClick={props.onClearImage}>\n Remove\n </button>\n </div>\n </>\n ) : (\n <div\n style={{ width: SIZE, height: SIZE }}\n className={`flex flex-col items-center justify-center rounded border-2 border-dashed text-center ${isDragOver ? 'border-blue-400 bg-blue-50' : 'border-gray-300 bg-white'}`}\n onDragOver={onDragOver}\n onDragEnter={onDragEnter}\n onDragLeave={onDragLeave}\n onDrop={onDrop}\n >\n <label className=\"cursor-pointer p-2 text-xs text-gray-500 hover:text-blue-600\">\n Drop image or click\n <input\n type=\"file\"\n accept=\"image/*\"\n className=\"hidden\"\n onChange={(e) => {\n if (e.target.files?.[0]) void handleFile(e.target.files[0]);\n }}\n />\n </label>\n </div>\n )}\n </div>\n );\n}\n\n/* ── Models library (inlined under CLI > Features > Mastra) ─── */\n\nfunction ModelsSection(props: { models: PhClintAgentModel[]; main: PhClintMainAgent | null | undefined; subAgents: PhClintSubAgent[]; addModel: (id: string) => void; removeModel: (id: string) => void }) {\n const [newModelId, setNewModelId] = useState('');\n\n const usersOf = (modelId: string): string[] => {\n const u: string[] = [];\n if (props.main?.modelId === modelId) u.push(props.main.id);\n for (const s of props.subAgents) if (s.modelId === modelId) u.push(s.id);\n return u;\n };\n\n const handleAdd = () => {\n const id = newModelId.trim();\n if (id) {\n props.addModel(id);\n setNewModelId('');\n }\n };\n\n return (\n <div>\n <h4 className=\"text-sm font-semibold text-gray-700\">Models</h4>\n <p className=\"text-xs text-gray-500\">\n Provider/model format (e.g. <code>anthropic/claude-sonnet-4-5</code>). Each agent picks one from this list.\n </p>\n\n {props.models.length > 0 && (\n <table className=\"mt-2 w-full text-sm\">\n <thead>\n <tr className=\"border-b text-left text-gray-500\">\n <th className=\"py-1\">Model</th>\n <th className=\"py-1\">Used by</th>\n <th className=\"py-1\" />\n </tr>\n </thead>\n <tbody>\n {props.models.map((m) => {\n const users = usersOf(m.id);\n const inUse = users.length > 0;\n return (\n <tr key={m.id} className=\"border-b border-gray-100\">\n <td className=\"py-2 font-mono\">{m.id}</td>\n <td className=\"py-2 text-xs text-gray-500\">{users.length === 0 ? <em>—</em> : users.join(', ')}</td>\n <td className=\"py-2 text-right\">\n <button className=\"text-red-500 hover:text-red-700 disabled:cursor-not-allowed disabled:text-gray-300\" disabled={inUse} title={inUse ? `In use by ${users.join(', ')}` : ''} onClick={() => props.removeModel(m.id)}>\n Remove\n </button>\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n )}\n\n <div className=\"mt-2 flex items-center gap-2\">\n <input\n type=\"text\"\n placeholder=\"provider/model-name\"\n value={newModelId}\n onChange={(e) => setNewModelId(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleAdd();\n }}\n className=\"flex-1 rounded border p-2 font-mono text-sm\"\n />\n <button className=\"rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50\" disabled={!newModelId.trim()} onClick={handleAdd}>\n Add Model\n </button>\n </div>\n </div>\n );\n}\n\n/* ── Profiles Tab ─────────────────────────────────────────────── */\n\nfunction ProfilesTab(props: {\n mastra: PhClintMastraFeature;\n addProfile: (id: string, title: string, content: string, insertBefore?: string) => void;\n updateProfile: (id: string, title?: string, content?: string) => void;\n removeProfile: (id: string) => void;\n reorderProfiles: (ids: string[], insertBefore: string | null) => void;\n}) {\n if (!props.mastra.enabled) {\n return (\n <section className=\"my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500\">\n <h3 className=\"text-lg font-semibold\">Profiles</h3>\n <p className=\"mt-2\">Enable Mastra in the CLI tab to manage agent profiles.</p>\n </section>\n );\n }\n\n return (\n <ProfilesSection\n profiles={props.mastra.profiles}\n main={props.mastra.mainAgent}\n subAgents={props.mastra.subAgents}\n addProfile={props.addProfile}\n updateProfile={props.updateProfile}\n removeProfile={props.removeProfile}\n reorderProfiles={props.reorderProfiles}\n />\n );\n}\n\nfunction ProfilesSection(props: {\n profiles: PhClintAgentProfile[];\n main: PhClintMainAgent | null | undefined;\n subAgents: PhClintSubAgent[];\n addProfile: (id: string, title: string, content: string, insertBefore?: string) => void;\n updateProfile: (id: string, title?: string, content?: string) => void;\n removeProfile: (id: string) => void;\n reorderProfiles: (ids: string[], insertBefore: string | null) => void;\n}) {\n const [showAddForm, setShowAddForm] = useState(false);\n const [newId, setNewId] = useState('');\n const [newTitle, setNewTitle] = useState('');\n\n const usersOf = (profileId: string): string[] => {\n const u: string[] = [];\n if (props.main?.profileIds.includes(profileId)) u.push(props.main.id);\n for (const s of props.subAgents) if (s.profileIds.includes(profileId)) u.push(s.id);\n return u;\n };\n\n const handleAdd = () => {\n const id = newId.trim();\n const title = newTitle.trim();\n if (id && title) {\n props.addProfile(id, title, '');\n setNewId('');\n setNewTitle('');\n setShowAddForm(false);\n }\n };\n\n const moveUp = (index: number) => {\n if (index === 0) return;\n const id = props.profiles[index].id;\n const beforeId = props.profiles[index - 1].id;\n props.reorderProfiles([id], beforeId);\n };\n\n const moveDown = (index: number) => {\n if (index >= props.profiles.length - 1) return;\n const id = props.profiles[index].id;\n const afterNext = index + 2 < props.profiles.length ? props.profiles[index + 2].id : null;\n props.reorderProfiles([id], afterNext);\n };\n\n return (\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Agent Profiles</h3>\n <p className=\"text-sm text-gray-600\">Markdown sections that compose into agents' instructions. Reference these from each agent's profile list.</p>\n\n {props.profiles.map((profile, i) => {\n const users = usersOf(profile.id);\n const inUse = users.length > 0;\n return (\n <div key={profile.id} className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <span className=\"rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500\">{profile.id}</span>\n <input\n type=\"text\"\n defaultValue={profile.title}\n onBlur={(e) => {\n const next = e.target.value.trim();\n if (next && next !== profile.title) props.updateProfile(profile.id, next);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') e.currentTarget.blur();\n }}\n className=\"border-b border-transparent font-semibold hover:border-gray-300 focus:border-blue-500\"\n />\n {users.length > 0 && (\n <span className=\"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700\" title={users.join(', ')}>\n used by: {users.join(', ')}\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-1\">\n <button className=\"px-1 text-gray-400 hover:text-gray-600 disabled:opacity-30\" disabled={i === 0} onClick={() => moveUp(i)} title=\"Move up\">\n ↑\n </button>\n <button className=\"px-1 text-gray-400 hover:text-gray-600 disabled:opacity-30\" disabled={i === props.profiles.length - 1} onClick={() => moveDown(i)} title=\"Move down\">\n ↓\n </button>\n <button className=\"ml-2 text-sm text-red-500 hover:text-red-700 disabled:cursor-not-allowed disabled:text-gray-300\" disabled={inUse} title={inUse ? `In use by ${users.join(', ')}` : ''} onClick={() => props.removeProfile(profile.id)}>\n Remove\n </button>\n </div>\n </div>\n <textarea\n defaultValue={profile.content}\n onBlur={(e) => {\n const next = e.target.value;\n if (next !== profile.content) props.updateProfile(profile.id, undefined, next);\n }}\n placeholder=\"Markdown content for this profile section...\"\n rows={4}\n className=\"mt-2 w-full rounded border border-gray-200 p-2 font-mono text-sm\"\n />\n </div>\n );\n })}\n\n {showAddForm ? (\n <div className=\"my-3 rounded border border-blue-200 bg-blue-50 p-4\">\n <div className=\"flex items-center gap-2\">\n <input type=\"text\" placeholder=\"section-id\" value={newId} onChange={(e) => setNewId(e.target.value)} className=\"w-40 rounded border p-2 font-mono text-sm\" />\n <input\n type=\"text\"\n placeholder=\"Section Title\"\n value={newTitle}\n onChange={(e) => setNewTitle(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleAdd();\n }}\n className=\"flex-1 rounded border p-2 text-sm\"\n />\n <button className=\"rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50\" disabled={!newId.trim() || !newTitle.trim()} onClick={handleAdd}>\n Add\n </button>\n <button\n className=\"text-sm text-gray-500 hover:text-gray-700\"\n onClick={() => {\n setShowAddForm(false);\n setNewId('');\n setNewTitle('');\n }}\n >\n Cancel\n </button>\n </div>\n </div>\n ) : (\n <button className=\"mt-3 rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600\" onClick={() => setShowAddForm(true)}>\n + Add Profile\n </button>\n )}\n </section>\n );\n}\n\n/* ── Skills Tab ───────────────────────────────────────────────── */\n\nfunction SkillsTab(props: { skills: ExternalSkill[]; addSkill: (name: string, githubUrl: string) => void; removeSkill: (id: string) => void }) {\n return (\n <>\n <section className=\"my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500\">\n <h3 className=\"text-lg font-semibold\">Skill Templates</h3>\n <p className=\"mt-2\">Coming soon</p>\n </section>\n\n <hr />\n\n <ExternalSkillsSection skills={props.skills} addSkill={props.addSkill} removeSkill={props.removeSkill} />\n </>\n );\n}\n\nfunction ExternalSkillsSection(props: { skills: ExternalSkill[]; addSkill: (name: string, githubUrl: string) => void; removeSkill: (id: string) => void }) {\n const [newName, setNewName] = useState('');\n const [newUrl, setNewUrl] = useState('');\n\n const handleAdd = () => {\n if (newName.trim() && newUrl.trim()) {\n props.addSkill(newName.trim(), newUrl.trim());\n setNewName('');\n setNewUrl('');\n }\n };\n\n return (\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">External Skills</h3>\n <p className=\"text-sm text-gray-600\">Skills from the skills.sh ecosystem, installed via GitHub URL.</p>\n\n {props.skills.length > 0 && (\n <ul className=\"mt-3 space-y-2\">\n {props.skills.map((skill) => (\n <li key={skill.id} className=\"flex items-center justify-between rounded border border-gray-200 bg-white p-3\">\n <div>\n <span className=\"font-mono font-semibold\">{skill.name}</span>\n <span className=\"ml-2 text-sm text-gray-500\">{skill.githubUrl}</span>\n </div>\n <button className=\"text-sm text-red-500 hover:text-red-700\" onClick={() => props.removeSkill(skill.id)}>\n Remove\n </button>\n </li>\n ))}\n </ul>\n )}\n\n <div className=\"mt-3 flex items-center gap-2\">\n <input type=\"text\" placeholder=\"skill-name\" value={newName} onChange={(e) => setNewName(e.target.value)} className=\"w-40 rounded border p-2 font-mono text-sm\" />\n <input\n type=\"text\"\n placeholder=\"https://github.com/org/repo\"\n value={newUrl}\n onChange={(e) => setNewUrl(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleAdd();\n }}\n className=\"flex-1 rounded border p-2 font-mono text-sm\"\n />\n <button className=\"rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50\" disabled={!newName.trim() || !newUrl.trim()} onClick={handleAdd}>\n Add Skill\n </button>\n </div>\n </section>\n );\n}\n\n/* ── Powerhouse Tab ──────────────────────────────────────────── */\n\nfunction PowerhouseTab(props: {\n packages: PowerhousePackage[];\n isAboveDisabled: boolean;\n addPackage: (packageName: string) => void;\n removePackage: (id: string) => void;\n addDocType: (packageId: string, documentType: string) => void;\n removeDocType: (packageId: string, documentType: string) => void;\n}) {\n if (!props.isAboveDisabled) {\n return (\n <section className=\"my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500\">\n <h3 className=\"text-lg font-semibold\">Powerhouse</h3>\n <p className=\"mt-2\">Enable Powerhouse in the CLI tab (set level to Reactor or above) to manage packages.</p>\n </section>\n );\n }\n\n return <PackagesSection packages={props.packages} addPackage={props.addPackage} removePackage={props.removePackage} addDocType={props.addDocType} removeDocType={props.removeDocType} />;\n}\n\n/* ── Publish Tab ──────────────────────────────────────────────── */\n\nfunction PublishTab(props: {\n version: string;\n publishHistory: PublishRecord[];\n documentHeader: { id: string; documentType: string };\n deployment: PhClintDeployment;\n bumpVersion: (version: string) => void;\n publishDev: () => void;\n publishStaging: () => void;\n publishProduction: () => void;\n setProxyEnabled: (enabled: boolean) => void;\n setObservabilityEnabled: (enabled: boolean) => void;\n addSupportedResource: (resource: string) => void;\n removeSupportedResource: (resource: string) => void;\n}) {\n const recentHistory = props.publishHistory.slice(-5).reverse();\n const nextPatch = bumpPatch(props.version);\n\n return (\n <>\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Publishing</h3>\n\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <div className=\"flex items-center gap-4\">\n <span className=\"text-sm text-gray-600\">Current version:</span>\n <span className=\"font-mono font-semibold\">{props.version}</span>\n </div>\n\n <div className=\"mt-3 flex items-center gap-2\">\n <span className=\"text-sm text-gray-600\">Bump version to:</span>\n <input\n type=\"text\"\n placeholder={nextPatch}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n const v = e.currentTarget.value.trim();\n if (v) props.bumpVersion(v);\n e.currentTarget.value = '';\n }\n }}\n className=\"rounded border p-1 font-mono text-sm\"\n />\n </div>\n\n <div className=\"mt-4 flex items-center gap-2\">\n <button className=\"rounded bg-gray-600 px-3 py-2 text-sm text-white hover:bg-gray-700\" onClick={props.publishDev}>\n Publish Dev\n </button>\n <button className=\"rounded bg-amber-600 px-3 py-2 text-sm text-white hover:bg-amber-700\" onClick={props.publishStaging}>\n Publish Staging\n </button>\n <button className=\"rounded bg-green-600 px-3 py-2 text-sm text-white hover:bg-green-700\" onClick={props.publishProduction}>\n Publish Production\n </button>\n </div>\n </div>\n\n {recentHistory.length > 0 && (\n <div className=\"mt-3\">\n <h4 className=\"text-sm font-semibold text-gray-600\">Recent publish history</h4>\n <ul className=\"mt-2 space-y-1\">\n {recentHistory.map((r) => (\n <li key={r.id} className=\"flex items-center gap-3 text-sm\">\n <StatusBadge status={r.status} />\n <span className=\"font-mono\">{r.version}</span>\n <span className=\"text-gray-500\">{r.tag}</span>\n <span className=\"text-gray-400\">{r.timestamp}</span>\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n\n <hr />\n\n <DeploymentSection\n deployment={props.deployment}\n setProxyEnabled={props.setProxyEnabled}\n setObservabilityEnabled={props.setObservabilityEnabled}\n addSupportedResource={props.addSupportedResource}\n removeSupportedResource={props.removeSupportedResource}\n />\n\n <hr />\n\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Document</h3>\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <p className=\"text-sm text-gray-600\">\n Document ID: <span className=\"font-mono\">{props.documentHeader.id}</span>\n </p>\n <p className=\"text-sm text-gray-600\">\n Type: <span className=\"font-mono\">{props.documentHeader.documentType}</span>\n </p>\n </div>\n </section>\n </>\n );\n}\n\nfunction DeploymentSection(props: {\n deployment: PhClintDeployment;\n setProxyEnabled: (enabled: boolean) => void;\n setObservabilityEnabled: (enabled: boolean) => void;\n addSupportedResource: (resource: string) => void;\n removeSupportedResource: (resource: string) => void;\n}) {\n const [newResource, setNewResource] = useState('');\n\n return (\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Deployment</h3>\n\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <Toggle label=\"Proxy enabled\" checked={props.deployment.proxyEnabled} onChange={props.setProxyEnabled} hint=\"Embedded reverse proxy\" />\n <Toggle label=\"Observability enabled\" checked={props.deployment.observabilityEnabled} onChange={props.setObservabilityEnabled} hint=\"Sentry + OpenTelemetry\" />\n </div>\n\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <h4 className=\"text-base font-semibold\">Supported resources</h4>\n <ul className=\"my-2 space-y-1\">\n {props.deployment.supportedResources.map((r) => (\n <li key={r} className=\"flex items-center justify-between text-sm\">\n <span className=\"font-mono\">{r}</span>\n <button className=\"text-red-500 hover:text-red-700\" onClick={() => props.removeSupportedResource(r)}>\n Remove\n </button>\n </li>\n ))}\n </ul>\n <div className=\"mt-2 flex items-center gap-2\">\n <input\n type=\"text\"\n placeholder=\"vetra-agent-...\"\n value={newResource}\n onChange={(e) => setNewResource(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && newResource.trim()) {\n props.addSupportedResource(newResource.trim());\n setNewResource('');\n }\n }}\n className=\"flex-1 rounded border p-1 font-mono text-sm\"\n />\n <button\n className=\"rounded bg-blue-500 px-2 py-1 text-xs text-white hover:bg-blue-600 disabled:opacity-50\"\n disabled={!newResource.trim()}\n onClick={() => {\n props.addSupportedResource(newResource.trim());\n setNewResource('');\n }}\n >\n Add\n </button>\n </div>\n </div>\n </section>\n );\n}\n\n/* ── Powerhouse Packages section ─────────────────────────────── */\n\nfunction PackagesSection(props: {\n packages: PowerhousePackage[];\n addPackage: (packageName: string) => void;\n removePackage: (id: string) => void;\n addDocType: (packageId: string, documentType: string) => void;\n removeDocType: (packageId: string, documentType: string) => void;\n}) {\n const [newPackage, setNewPackage] = useState('');\n\n return (\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Reactor Packages</h3>\n\n {props.packages.map((pkg) => (\n <PackageCard key={pkg.id} pkg={pkg} addDocType={props.addDocType} removeDocType={props.removeDocType} removePackage={props.removePackage} />\n ))}\n\n <div className=\"my-3 flex items-center gap-2\">\n <input\n type=\"text\"\n placeholder=\"@scope/package-name\"\n value={newPackage}\n onChange={(e) => setNewPackage(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && newPackage.trim()) {\n props.addPackage(newPackage.trim());\n setNewPackage('');\n }\n }}\n className=\"flex-1 rounded border p-2 font-mono text-sm\"\n />\n <button\n className=\"rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:opacity-50\"\n disabled={!newPackage.trim()}\n onClick={() => {\n props.addPackage(newPackage.trim());\n setNewPackage('');\n }}\n >\n Add Package\n </button>\n </div>\n </section>\n );\n}\n\nfunction PackageCard(props: { pkg: PowerhousePackage; addDocType: (packageId: string, documentType: string) => void; removeDocType: (packageId: string, documentType: string) => void; removePackage: (id: string) => void }) {\n const [newDocType, setNewDocType] = useState('');\n\n return (\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <span className=\"font-mono font-semibold\">{props.pkg.packageName}</span>\n {props.pkg.managed && <span className=\"ml-2 rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700\">managed</span>}\n {props.pkg.version && <span className=\"ml-2 text-sm text-gray-500\">v{props.pkg.version}</span>}\n </div>\n {!props.pkg.managed && (\n <button className=\"text-sm text-red-500 hover:text-red-700\" onClick={() => props.removePackage(props.pkg.id)}>\n Remove Package\n </button>\n )}\n </div>\n <ul className=\"my-2 space-y-1\">\n {props.pkg.documentTypes.map((dt) => (\n <li key={dt} className=\"flex items-center justify-between text-sm\">\n <span className=\"font-mono\">{dt}</span>\n <button className=\"text-red-500 hover:text-red-700\" onClick={() => props.removeDocType(props.pkg.id, dt)}>\n ×\n </button>\n </li>\n ))}\n </ul>\n <div className=\"mt-2 flex items-center gap-2\">\n <input\n type=\"text\"\n placeholder=\"org/doc-type or */*\"\n value={newDocType}\n onChange={(e) => setNewDocType(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && newDocType.trim()) {\n props.addDocType(props.pkg.id, newDocType.trim());\n setNewDocType('');\n }\n }}\n className=\"flex-1 rounded border p-1 font-mono text-sm\"\n />\n <button\n className=\"rounded bg-blue-500 px-2 py-1 text-xs text-white hover:bg-blue-600 disabled:opacity-50\"\n disabled={!newDocType.trim()}\n onClick={() => {\n props.addDocType(props.pkg.id, newDocType.trim());\n setNewDocType('');\n }}\n >\n Add Doc Type\n </button>\n </div>\n </div>\n );\n}\n\nfunction StatusBadge(props: { status: string }) {\n const color = props.status === 'Succeeded' ? 'bg-green-100 text-green-700' : props.status === 'Failed' ? 'bg-red-100 text-red-700' : props.status === 'InProgress' ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-700';\n return <span className={`rounded px-2 py-0.5 text-xs ${color}`}>{props.status}</span>;\n}\n"],"mappings":"iZAoBA,IAAM,EAAuE,CAC3E,CAAE,MAAO,WAAY,YAAa,4BAA6B,CAC/D,CAAE,MAAO,UAAW,YAAa,yBAA0B,CAC3D,CAAE,MAAO,cAAe,YAAa,8BAA+B,CACpE,CAAE,MAAO,UAAW,YAAa,iCAAkC,CACpE,CAGD,SAAS,EAAU,EAAyB,CAC1C,IAAM,EAAI,uBAAuB,KAAK,EAAQ,CAC9C,GAAI,CAAC,EAAG,MAAO,GAAG,EAAQ,IAC1B,GAAM,EAAG,EAAO,EAAO,GAAS,EAChC,MAAO,GAAG,EAAM,GAAG,EAAM,GAAG,OAAO,EAAM,CAAG,IAG9C,SAAS,EAAU,EAAyI,CAC1J,OACE,EAAC,QAAD,CAAO,UAAW,EAAM,QAAU,aAAe,sBAAjD,CACE,EAAC,KAAD,CAAI,UAAW,EAAM,QAAU,wBAA0B,qBAAc,EA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,MAAM,GACxC,EAAM,WAAW,EAAM,IAAI,GAAI,EAAW,MAAM,CAAC,CACjD,EAAc,GAAG,GAGrB,UAAU,8CACV,CAAA,CACF,EAAC,SAAD,CACE,UAAU,yFACV,SAAU,CAAC,EAAW,MAAM,CAC5B,YAAe,CACb,EAAM,WAAW,EAAM,IAAI,GAAI,EAAW,MAAM,CAAC,CACjD,EAAc,GAAG,WAEpB,eAEQ,CAAA,CACL,GACF,GAIV,SAAS,EAAY,EAA2B,CAE9C,OAAO,EAAC,OAAD,CAAM,UAAW,+BADV,EAAM,SAAW,YAAc,8BAAgC,EAAM,SAAW,SAAW,0BAA4B,EAAM,SAAW,aAAe,8BAAgC,uCACpI,EAAM,OAAc,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Mt as e}from"./dist-
|
|
2
|
-
//# sourceMappingURL=editor-CAVHtR-v-
|
|
1
|
+
import{Mt as e}from"./dist-t-ezfpxv.js";import{g as t,z as n}from"./connect-CGvtDtZh.js";import{i as r,r as i}from"./utils-BiV3cs9Y-B7i9WJ1b.js";import{t as a}from"./components-Djrujufg.js";import{n as o}from"./hooks-Btogj1f0-BKAAmyt-.js";import{r as s}from"./useVetraDocument-tpjMF571-DxT9GgCx.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useCallback as u,useEffect as d,useState as f}from"react";var p=({subgraphName:e=``,status:t=`DRAFT`,onNameChange:r,onConfirm:i})=>{let[s,u]=f(e),[p,m]=f(!1);o(s,r,300),d(()=>{u(e)},[e]),d(()=>{t===`DRAFT`&&m(!1)},[t]);let h=p||t===`CONFIRMED`;return l(`div`,{className:`space-y-6 p-6`,children:[l(`div`,{className:`flex items-center justify-between`,children:[c(`h2`,{className:`text-lg font-medium text-foreground`,children:`Subgraph Configuration`}),c(a,{status:t===`CONFIRMED`?`confirmed`:`draft`,label:t===`CONFIRMED`?`Confirmed`:`Draft`})]}),l(`div`,{children:[c(`label`,{htmlFor:`subgraph-name`,className:`mb-2 block text-sm font-medium text-foreground`,children:`Subgraph Name`}),c(`input`,{id:`subgraph-name`,type:`text`,value:s,onChange:e=>u(e.target.value),disabled:h,className:n(`w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect`,h?`cursor-not-allowed bg-muted`:``),placeholder:`Enter subgraph name`})]}),!h&&c(`div`,{children:c(`button`,{onClick:()=>{s.trim()&&(m(!0),i?.())},disabled:!s.trim(),className:`rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect`,children:`Confirm`})})]})},m={isExternalControlsEnabled:!1};function h(){e(m);let[n,a]=s(),o=u(e=>{e!==n.state.global.name&&a(i({name:e}))},[n.state.global.name,a]),d=u(()=>{a(r({status:`CONFIRMED`}))},[a]);return l(`div`,{className:`bg-background p-6`,children:[c(t,{}),c(p,{subgraphName:n.state.global.name??``,status:n.state.global.status,onNameChange:o,onConfirm:d})]})}export{h as default};
|
|
2
|
+
//# sourceMappingURL=editor-CAVHtR-v-D33T9vW0.js.map
|
package/dist/connect/assets/{editor-CAVHtR-v-ClzvSfK5.js.map → editor-CAVHtR-v-D33T9vW0.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-CAVHtR-v-
|
|
1
|
+
{"version":3,"file":"editor-CAVHtR-v-D33T9vW0.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+vetra@6.2.0-dev.23_@babel+runtime@7.29.2_@electric-sql+pglite@0.3.15_@pa_0c94680c61477a0a5c7bf05c9b5bc3fb/node_modules/@powerhousedao/vetra/dist/editor-CAVHtR-v.js"],"sourcesContent":["import { g as setSubgraphStatus, h as setSubgraphName } from \"./utils-BiV3cs9Y.js\";\nimport { StatusPill } from \"./editors/components/index.js\";\nimport { t as useDebounce } from \"./hooks-Btogj1f0.js\";\nimport { r as useSelectedSubgraphModuleDocument } from \"./useVetraDocument-tpjMF571.js\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\n//#region editors/subgraph-editor/components/SubgraphEditorForm.tsx\nconst SubgraphEditorForm = ({ subgraphName: initialSubgraphName = \"\", status = \"DRAFT\", onNameChange, onConfirm }) => {\n\tconst [subgraphName, setSubgraphName] = useState(initialSubgraphName);\n\tconst [isConfirmed, setIsConfirmed] = useState(false);\n\tuseDebounce(subgraphName, onNameChange, 300);\n\tuseEffect(() => {\n\t\tsetSubgraphName(initialSubgraphName);\n\t}, [initialSubgraphName]);\n\tuseEffect(() => {\n\t\tif (status === \"DRAFT\") setIsConfirmed(false);\n\t}, [status]);\n\tconst isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\tconst handleConfirm = () => {\n\t\tif (subgraphName.trim()) {\n\t\t\tsetIsConfirmed(true);\n\t\t\tonConfirm?.();\n\t\t}\n\t};\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"space-y-6 p-6\",\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"flex items-center justify-between\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"h2\", {\n\t\t\t\t\tclassName: \"text-lg font-medium text-foreground\",\n\t\t\t\t\tchildren: \"Subgraph Configuration\"\n\t\t\t\t}), /* @__PURE__ */ jsx(StatusPill, {\n\t\t\t\t\tstatus: status === \"CONFIRMED\" ? \"confirmed\" : \"draft\",\n\t\t\t\t\tlabel: status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"\n\t\t\t\t})]\n\t\t\t}),\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\thtmlFor: \"subgraph-name\",\n\t\t\t\tclassName: \"mb-2 block text-sm font-medium text-foreground\",\n\t\t\t\tchildren: \"Subgraph Name\"\n\t\t\t}), /* @__PURE__ */ jsx(\"input\", {\n\t\t\t\tid: \"subgraph-name\",\n\t\t\t\ttype: \"text\",\n\t\t\t\tvalue: subgraphName,\n\t\t\t\tonChange: (e) => setSubgraphName(e.target.value),\n\t\t\t\tdisabled: isReadOnly,\n\t\t\t\tclassName: twMerge(\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\", isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\"),\n\t\t\t\tplaceholder: \"Enter subgraph name\"\n\t\t\t})] }),\n\t\t\t!isReadOnly && /* @__PURE__ */ jsx(\"div\", { children: /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\tonClick: handleConfirm,\n\t\t\t\tdisabled: !subgraphName.trim(),\n\t\t\t\tclassName: \"rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\",\n\t\t\t\tchildren: \"Confirm\"\n\t\t\t}) })\n\t\t]\n\t});\n};\n//#endregion\n//#region editors/subgraph-editor/config.ts\nconst editorConfig = { isExternalControlsEnabled: false };\n//#endregion\n//#region editors/subgraph-editor/editor.tsx\nfunction Editor() {\n\tuseSetPHDocumentEditorConfig(editorConfig);\n\tconst [document, dispatch] = useSelectedSubgraphModuleDocument();\n\tconst onNameChange = useCallback((name) => {\n\t\tif (name === document.state.global.name) return;\n\t\tdispatch(setSubgraphName({ name }));\n\t}, [document.state.global.name, dispatch]);\n\tconst onConfirm = useCallback(() => {\n\t\tdispatch(setSubgraphStatus({ status: \"CONFIRMED\" }));\n\t}, [dispatch]);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"bg-background p-6\",\n\t\tchildren: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(SubgraphEditorForm, {\n\t\t\tsubgraphName: document.state.global.name ?? \"\",\n\t\t\tstatus: document.state.global.status,\n\t\t\tonNameChange,\n\t\t\tonConfirm\n\t\t})]\n\t});\n}\n//#endregion\nexport { Editor as default };\n\n//# sourceMappingURL=editor-CAVHtR-v.js.map"],"x_google_ignoreList":[0],"mappings":"8ZAUA,IAAM,GAAsB,CAAE,aAAc,EAAsB,GAAI,SAAS,QAAS,eAAc,eAAgB,CACrH,GAAM,CAAC,EAAc,GAAmB,EAAS,EAAoB,CAC/D,CAAC,EAAa,GAAkB,EAAS,GAAM,CACrD,EAAY,EAAc,EAAc,IAAI,CAC5C,MAAgB,CACf,EAAgB,EAAoB,EAClC,CAAC,EAAoB,CAAC,CACzB,MAAgB,CACX,IAAW,SAAS,EAAe,GAAM,EAC3C,CAAC,EAAO,CAAC,CACZ,IAAM,EAAa,GAAe,IAAW,YAO7C,OAAuB,EAAK,MAAO,CAClC,UAAW,gBACX,SAAU,CACO,EAAK,MAAO,CAC3B,UAAW,oCACX,SAAU,CAAiB,EAAI,KAAM,CACpC,UAAW,sCACX,SAAU,yBACV,CAAC,CAAkB,EAAI,EAAY,CACnC,OAAQ,IAAW,YAAc,YAAc,QAC/C,MAAO,IAAW,YAAc,YAAc,QAC9C,CAAC,CAAC,CACH,CAAC,CACc,EAAK,MAAO,CAAE,SAAU,CAAiB,EAAI,QAAS,CACrE,QAAS,gBACT,UAAW,iDACX,SAAU,gBACV,CAAC,CAAkB,EAAI,QAAS,CAChC,GAAI,gBACJ,KAAM,OACN,MAAO,EACP,SAAW,GAAM,EAAgB,EAAE,OAAO,MAAM,CAChD,SAAU,EACV,UAAW,EAAQ,uMAAwM,EAAa,8BAAgC,GAAG,CAC3Q,YAAa,sBACb,CAAC,CAAC,CAAE,CAAC,CACN,CAAC,GAA8B,EAAI,MAAO,CAAE,SAA0B,EAAI,SAAU,CACnF,YAjCyB,CACvB,EAAa,MAAM,GACtB,EAAe,GAAK,CACpB,KAAa,GA+BZ,SAAU,CAAC,EAAa,MAAM,CAC9B,UAAW,0KACX,SAAU,UACV,CAAC,CAAE,CAAC,CACL,CACD,CAAC,EAIG,EAAe,CAAE,0BAA2B,GAAO,CAGzD,SAAS,GAAS,CACjB,EAA6B,EAAa,CAC1C,GAAM,CAAC,EAAU,GAAY,GAAmC,CAC1D,EAAe,EAAa,GAAS,CACtC,IAAS,EAAS,MAAM,OAAO,MACnC,EAAS,EAAgB,CAAE,OAAM,CAAC,CAAC,EACjC,CAAC,EAAS,MAAM,OAAO,KAAM,EAAS,CAAC,CACpC,EAAY,MAAkB,CACnC,EAAS,EAAkB,CAAE,OAAQ,YAAa,CAAC,CAAC,EAClD,CAAC,EAAS,CAAC,CACd,OAAuB,EAAK,MAAO,CAClC,UAAW,oBACX,SAAU,CAAiB,EAAI,EAAiB,EAAE,CAAC,CAAkB,EAAI,EAAoB,CAC5F,aAAc,EAAS,MAAM,OAAO,MAAQ,GAC5C,OAAQ,EAAS,MAAM,OAAO,OAC9B,eACA,YACA,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as e,Ct as t,Mt as n,Nt as r}from"./dist-
|
|
2
|
-
//# sourceMappingURL=editor-CVCLxUhe-
|
|
1
|
+
import{$ as e,Ct as t,Mt as n,Nt as r}from"./dist-t-ezfpxv.js";import{g as i,z as a}from"./connect-CGvtDtZh.js";import{n as o}from"./dist-Cb4AoJ-8.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./module-CRq_lUkG-D61oeRlC.js";import{t as h}from"./components-Djrujufg.js";import{n as g}from"./hooks-Btogj1f0-BKAAmyt-.js";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{useCallback as y,useEffect as b,useState as x}from"react";o.forDocumentModel(m);function S(){let[e,n]=t();return f(e),[e,n]}var C=`all-in-drive`,w=`all-in-reactor`,T=`allow-any`,E=()=>{let[t,n]=S(),i=t.state.global.name,o=t.state.global.status,f=t.state.global.isDragAndDropEnabled,m=t.state.global.allowedDocumentTypes,[E,D]=x(i),[O,k]=x(o===`CONFIRMED`),A=e(),j=r(),[M,N]=x(m??[]);g(E,y(e=>{e!==i&&(console.log(`onNameChange`,e),n(s({name:e})))},[i,n]),300);let P=()=>{n(d({status:`CONFIRMED`}))},F=e=>{e!==f&&n(c({enabled:e}))};b(()=>{o===`DRAFT`&&k(!1)},[o]);let I=O||o===`CONFIRMED`,L=()=>{E.trim()&&(k(!0),P())},R=e=>{!e||M.includes(e)||(N([...M,e]),n(u({documentType:e})))},z=e=>{N(M.filter(t=>t!==e)),n(l({documentType:e}))},B=()=>{let e=[...new Set([...M,...A??[]])];N(e),n(p({documentTypes:e}))},V=()=>{let e=[...new Set([...M,...j??[]])];N(e),n(p({documentTypes:e}))},H=()=>{N([]),n(p({documentTypes:[]}))},U=e=>{e===C?B():e===w?V():e===T?H():R(e)};return v(`div`,{className:`space-y-6 p-6`,children:[v(`div`,{className:`flex items-center justify-between`,children:[_(`h2`,{className:`text-lg font-medium text-foreground`,children:`App Configuration`}),_(h,{status:o===`CONFIRMED`?`confirmed`:`draft`,label:o===`CONFIRMED`?`Confirmed`:`Draft`})]}),v(`div`,{children:[_(`label`,{htmlFor:`app-name`,className:`mb-2 block text-sm font-medium text-foreground`,children:`App Name`}),_(`input`,{id:`app-name`,type:`text`,value:E,onChange:e=>D(e.target.value),disabled:I,className:a(`w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect`,I?`cursor-not-allowed bg-muted`:``),placeholder:`Enter app name`})]}),v(`div`,{children:[_(`label`,{htmlFor:`document-types`,className:`mb-2 block text-sm font-medium text-foreground`,children:`Document Types`}),v(`div`,{className:`space-y-2`,children:[!I&&v(`select`,{onChange:e=>U(e.target.value),className:`w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none`,children:[_(`option`,{children:`Select a document type to add`}),_(`option`,{children:`--- Vetra drive document types ---`}),_(`option`,{value:C,children:`Add all document types in Vetra drive`}),A?.filter(e=>!M.includes(e)).map(e=>_(`option`,{value:e,children:e},e)),_(`option`,{children:`--- Reactor document types ---`}),_(`option`,{value:w,children:`Add all document types in Reactor`}),j?.filter(e=>!M.includes(e)).map(e=>_(`option`,{value:e,children:e},e)),_(`option`,{children:`--- Allow any document type ---`}),_(`option`,{value:T,children:`Allow any document type`})]}),_(`div`,{className:`space-y-1`,children:M.length>0?M.map(e=>v(`div`,{className:`flex items-center py-1`,children:[_(`span`,{className:`text-sm text-foreground`,children:e}),!I&&_(`button`,{onClick:()=>z(e),className:`ml-2 text-muted-foreground hover:hover-effect focus:outline-none`,children:`×`})]},e)):_(`span`,{className:`text-sm text-foreground`,children:`All documents (*)`})})]})]}),v(`div`,{children:[_(`h3`,{className:`mb-4 text-base font-medium text-foreground`,children:`Drag and Drop Settings`}),_(`div`,{className:`mb-4`,children:v(`label`,{htmlFor:`drag-and-drop-enabled`,className:`flex items-center`,children:[_(`input`,{id:`drag-and-drop-enabled`,type:`checkbox`,checked:f,onChange:e=>F(e.target.checked),disabled:I,className:a(`mr-2 size-4 rounded-sm border-border text-info focus:ring-ring`,I?`cursor-not-allowed`:``)}),_(`span`,{className:`text-sm font-medium text-foreground`,children:`Enable drag and drop`})]})})]}),!I&&_(`div`,{children:_(`button`,{onClick:L,disabled:!E.trim(),className:`rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect`,children:`Confirm`})})]})},D={isExternalControlsEnabled:!1};function O(){return n(D),v(`div`,{className:`bg-background p-6`,children:[_(i,{}),_(E,{})]})}export{O as default};
|
|
2
|
+
//# sourceMappingURL=editor-CVCLxUhe-C9Ftgu1S.js.map
|