@powerhousedao/ph-clint-app 0.1.0-dev.74 → 0.1.0-dev.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/document-models/ph-clint-project/index.js +3 -3
- package/dist/browser/{editor-CAZmaheq.js → editor-Z7QJIYOp.js} +377 -403
- package/dist/browser/{editor-CAZmaheq.js.map → editor-Z7QJIYOp.js.map} +1 -1
- package/dist/browser/editors/ph-clint-project-editor/module.js +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/browser/{module-K5q3UobV.js → module-BZ6W31hV.js} +70 -132
- package/dist/browser/{module-K5q3UobV.js.map → module-BZ6W31hV.js.map} +1 -1
- package/dist/browser/{ph-clint-project-Bbl7jqNw.js → ph-clint-project-3b5ZHznW.js} +2 -2
- package/dist/browser/{ph-clint-project-Bbl7jqNw.js.map → ph-clint-project-3b5ZHznW.js.map} +1 -1
- package/dist/connect/assets/editor-CEMUd4Ju.js +2 -0
- package/dist/connect/assets/editor-CEMUd4Ju.js.map +1 -0
- package/dist/connect/assets/{index-DmrNLi1C.js → index-BxEnFQyj.js} +20 -20
- package/dist/connect/assets/{index-DmrNLi1C.js.map → index-BxEnFQyj.js.map} +1 -1
- package/dist/connect/assets/{ph-clint-project-DZ_ZplDv.js → ph-clint-project-C_SSQ38p.js} +7 -37
- package/dist/connect/assets/ph-clint-project-C_SSQ38p.js.map +1 -0
- package/dist/connect/index.html +2 -2
- package/dist/connect/ph-packages.json +1 -1
- package/dist/document-models/ph-clint-project/v1/actions.d.ts +0 -1
- package/dist/document-models/ph-clint-project/v1/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts +2 -6
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts +2 -3
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts +0 -4
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts +1 -2
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts +0 -6
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts +1 -2
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/module.d.ts +0 -1
- package/dist/document-models/ph-clint-project/v1/module.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts.map +1 -1
- package/dist/editors/ph-clint-project-editor/editor.d.ts.map +1 -1
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/document-models/ph-clint-project/index.mjs +3 -3
- package/dist/node/{editor-DOw2BwlR.mjs → editor-C82Trmk4.mjs} +377 -403
- package/dist/node/{editor-DOw2BwlR.mjs.map → editor-C82Trmk4.mjs.map} +1 -1
- package/dist/node/editors/ph-clint-project-editor/module.mjs +1 -1
- package/dist/node/index.mjs +3 -3
- package/dist/node/{module-DTtUZ4DR.mjs → module-ZwrJ5kaI.mjs} +70 -132
- package/dist/node/{module-DTtUZ4DR.mjs.map → module-ZwrJ5kaI.mjs.map} +1 -1
- package/dist/node/{ph-clint-project-DFA4zHJv.mjs → ph-clint-project-YqV6kGMs.mjs} +2 -2
- package/dist/node/{ph-clint-project-DFA4zHJv.mjs.map → ph-clint-project-YqV6kGMs.mjs.map} +1 -1
- package/dist/style.css +7 -0
- package/package.json +1 -1
- package/dist/connect/assets/editor-CQqCB-3d.js +0 -2
- package/dist/connect/assets/editor-CQqCB-3d.js.map +0 -1
- package/dist/connect/assets/ph-clint-project-DZ_ZplDv.js.map +0 -1
package/dist/style.css
CHANGED
|
@@ -474,6 +474,13 @@
|
|
|
474
474
|
margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
+
.space-y-4 {
|
|
478
|
+
:where(& > :not(:last-child)) {
|
|
479
|
+
--tw-space-y-reverse: 0;
|
|
480
|
+
margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
|
|
481
|
+
margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
|
|
482
|
+
}
|
|
483
|
+
}
|
|
477
484
|
.rounded {
|
|
478
485
|
border-radius: 0.25rem;
|
|
479
486
|
}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Pt as e}from"./lz-string-CSbzFwDi.js";import{h as t}from"./connect-ClPSMjSP-B0m_vica.js";import{O as n,s as r}from"./ph-clint-project-DZ_ZplDv.js";import{useCallback as i,useRef as a,useState as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";var u=[{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 d(e){return l(`label`,{className:e.compact?`my-1 block`:`my-3 block`,children:[c(`h3`,{className:e.compact?`text-xs text-gray-600`:`text-base`,children:e.label}),c(`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 f(e){return l(`label`,{className:`my-2 flex items-center gap-3`,children:[c(`input`,{type:`checkbox`,checked:e.checked,disabled:e.disabled,onChange:t=>e.onChange(t.target.checked)}),c(`span`,{className:`font-semibold`,children:e.label}),e.hint?c(`span`,{className:`text-sm text-gray-600`,children:e.hint}):null]})}function p(){let[i,a]=r(),s=i.state.global,{powerhouse:u,mastra:d,routine:f}=s.features,[p,g]=o(`spec`),_=e=>a(n.setPackageIdentifier({identifier:e})),v=e=>a(n.setVersion({version:e})),y=e=>a(n.setDescription({description:e})),b=e=>a(n.setPowerhouseLevel({level:e})),x=e=>{if(e){let e=s.name||`my-agent`,t=`${e}-agent`,r=`${e.charAt(0).toUpperCase()}${e.slice(1).replace(/-([a-z])/g,(e,t)=>` ${t.toUpperCase()}`)} Agent`;a(n.enableMastra({agentId:t,agentName:r}))}else a(n.disableMastra({_:!0}))},S=e=>{a(e?n.enableRoutine({_:!0}):n.disableRoutine({_:!0}))},C=t=>a(n.addPowerhousePackage({id:e(),packageName:t})),w=e=>a(n.removePowerhousePackage({id:e})),T=(e,t)=>a(n.addPackageDocumentType({packageId:e,documentType:t})),E=(e,t)=>a(n.removePackageDocumentType({packageId:e,documentType:t})),D=(t,r)=>a(n.addExternalSkill({id:e(),name:t,githubUrl:r})),O=e=>a(n.removeExternalSkill({id:e})),k=e=>a(n.bumpVersion({version:e})),A=()=>a(n.publishDev({id:e(),timestamp:new Date().toISOString()})),j=()=>a(n.publishStaging({id:e(),timestamp:new Date().toISOString()})),M=()=>a(n.publishProduction({id:e(),timestamp:new Date().toISOString()})),N=e=>a(n.setMainAgentName({name:e})),P=e=>a(n.setMainAgentDescription({description:e})),F=()=>a(n.clearMainAgentDescription({_:!0})),I=e=>a(n.setMainAgentImage({image:e})),L=()=>a(n.clearMainAgentImage({_:!0})),R=(e,t,r,i)=>a(n.addSubAgent({id:e,name:t,description:r,modelId:i})),z=e=>a(n.removeSubAgent({id:e})),B=(e,t)=>a(n.setSubAgentName({id:e,name:t})),V=(e,t)=>a(n.setSubAgentDescription({id:e,description:t})),H=(e,t)=>a(n.addModel({id:e,isDefault:t})),U=e=>a(n.removeModel({id:e})),W=e=>a(n.setDefaultModel({id:e})),G=(e,t,r,i)=>a(n.addProfile({id:e,title:t,content:r,insertBefore:i})),K=(e,t,r)=>a(n.updateProfile({id:e,title:t,content:r})),q=e=>a(n.removeProfile({id:e})),J=(e,t)=>a(n.reorderProfiles({ids:e,insertBefore:t})),Y=(e,t)=>a(n.setAgentModel({agentId:e,modelId:t})),X=(e,t,r)=>a(n.addAgentProfileRef({agentId:e,profileId:t,insertBefore:r})),re=(e,t)=>a(n.removeAgentProfileRef({agentId:e,profileId:t})),ie=(e,t,r)=>a(n.reorderAgentProfileRefs({agentId:e,ids:t,insertBefore:r})),ae=(e,t)=>a(n.addAgentSkill({agentId:e,name:t})),oe=(e,t)=>a(n.removeAgentSkill({agentId:e,name:t})),se=(e,t)=>a(n.addAgentToolPattern({agentId:e,pattern:t})),ce=(e,t)=>a(n.removeAgentToolPattern({agentId:e,pattern:t})),Z=e=>a(n.setEnableChat({enabled:e})),le=e=>a(n.setProxyEnabled({enabled:e})),ue=e=>a(n.setObservabilityEnabled({enabled:e})),de=e=>a(n.addSupportedResource({resource:e})),fe=e=>a(n.removeSupportedResource({resource:e})),Q=u!==`Disabled`,$=e=>`px-4 py-2 text-sm font-medium border-b-2 cursor-pointer ${p===e?`border-blue-500 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`;return l(`div`,{className:`mx-auto max-w-4xl bg-gray-50 p-6`,children:[c(t,{}),l(`div`,{className:`ph-default-styles`,children:[c(`h2`,{className:`mt-4 text-xl font-bold`,children:`ph-clint Project Spec`}),l(`nav`,{className:`my-4 flex border-b border-gray-200`,children:[c(`button`,{className:$(`spec`),onClick:()=>g(`spec`),children:`CLI`}),c(`button`,{className:$(`agent`),onClick:()=>g(`agent`),children:`Agent`}),c(`button`,{className:$(`powerhouse`),onClick:()=>g(`powerhouse`),children:`Powerhouse`}),c(`button`,{className:$(`skills`),onClick:()=>g(`skills`),children:`Skills`}),c(`button`,{className:$(`publish`),onClick:()=>g(`publish`),children:`Publish`})]}),p===`spec`&&c(m,{state:s,powerhouse:u,mastra:d,routine:f,isAboveDisabled:Q,setPackageIdentifier:_,setVersion:v,setDescription:y,setPowerhouseLevel:b,toggleMastra:x,toggleRoutine:S}),p===`agent`&&c(ee,{mastra:d,isAboveDisabled:Q,setMainAgentName:N,setMainAgentDescription:P,clearMainAgentDescription:F,setMainAgentImage:I,clearMainAgentImage:L,addSubAgent:R,removeSubAgent:z,setSubAgentName:B,setSubAgentDescription:V,setAgentModel:Y,addAgentProfileRef:X,removeAgentProfileRef:re,reorderAgentProfileRefs:ie,addAgentSkill:ae,removeAgentSkill:oe,addAgentToolPattern:se,removeAgentToolPattern:ce,addModel:H,removeModel:U,setDefaultModel:W,addProfile:G,updateProfile:K,removeProfile:q,reorderProfiles:J,setEnableChat:Z}),p===`powerhouse`&&c(h,{packages:s.packages,isAboveDisabled:Q,addPackage:C,removePackage:w,addDocType:T,removeDocType:E}),p===`skills`&&c(te,{skills:s.externalSkills,addSkill:D,removeSkill:O}),p===`publish`&&c(ne,{version:s.version,publishHistory:s.publishHistory,documentHeader:i.header,deployment:s.deployment,bumpVersion:k,publishDev:A,publishStaging:j,publishProduction:M,setProxyEnabled:le,setObservabilityEnabled:ue,addSupportedResource:de,removeSupportedResource:fe})]})]})}function m(e){let{state:t}=e,n=`${t.scope?t.scope+`/`:``}${t.name??``}`;return l(s,{children:[l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Identity`}),l(`div`,{className:`grid grid-cols-[3fr_1fr] gap-4`,children:[c(d,{label:`Package name`,value:n,placeholder:`@scope/my-tool-cli`,onCommit:e.setPackageIdentifier}),c(d,{label:`Version`,value:t.version,placeholder:`0.1.0`,onCommit:e.setVersion})]}),c(d,{label:`Description`,value:t.description,placeholder:`What this CLI does`,onCommit:e.setDescription})]}),c(`hr`,{}),l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Features`}),l(`div`,{className:`my-4 rounded border border-gray-200 bg-white p-4`,children:[c(`h4`,{className:`text-base font-semibold`,children:`Powerhouse`}),e.isAboveDisabled&&c(`p`,{className:`text-sm text-gray-500`,children:`Cannot go back to Disabled once enabled`}),c(`div`,{className:`mt-2 space-y-2`,children:u.map((t,n)=>l(`label`,{className:`flex items-start gap-2`,children:[n>0&&c(`div`,{className:`absolute -mt-3 ml-[7px] h-3 border-l border-gray-300`}),c(`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`}),l(`div`,{children:[c(`span`,{className:`font-medium`,children:t.value}),c(`span`,{className:`ml-2 text-sm text-gray-500`,children:t.description})]})]},t.value))})]}),c(`div`,{className:`my-4 rounded border border-gray-200 bg-white p-4`,children:c(f,{label:`Mastra`,checked:e.mastra.enabled,hint:`AI agent framework`,onChange:e.toggleMastra})}),c(`div`,{className:`my-4 rounded border border-gray-200 bg-white p-4`,children:c(f,{label:`Routine loop`,checked:e.routine.enabled,hint:`tick-based execution loop with triggers`,onChange:e.toggleRoutine})})]})]})}function h(e){return e.isAboveDisabled?c(k,{packages:e.packages,addPackage:e.addPackage,removePackage:e.removePackage,addDocType:e.addDocType,removeDocType:e.removeDocType}):l(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Powerhouse`}),c(`p`,{className:`mt-2`,children:`Enable Powerhouse in the Spec tab (set level to Reactor or above) to manage packages.`})]})}function ee(e){let{mastra:t}=e,n=t.mainAgent;if(!t.enabled||!n)return l(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Agent`}),c(`p`,{className:`mt-2`,children:`Enable Mastra in the Spec tab to configure agents.`})]});let r=[n.id,...t.subAgents.map(e=>e.id)];return l(s,{children:[c(g,{main:n,models:t.models,profiles:t.profiles,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}),c(`hr`,{}),c(v,{subAgents:t.subAgents,models:t.models,profiles:t.profiles,existingAgentIds:r,addSubAgent:e.addSubAgent,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}),c(`hr`,{}),c(T,{models:t.models,main:t.mainAgent,subAgents:t.subAgents,addModel:e.addModel,removeModel:e.removeModel,setDefaultModel:e.setDefaultModel}),c(`hr`,{}),c(E,{profiles:t.profiles,main:t.mainAgent,subAgents:t.subAgents,addProfile:e.addProfile,updateProfile:e.updateProfile,removeProfile:e.removeProfile,reorderProfiles:e.reorderProfiles}),c(`hr`,{}),l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Common`}),c(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:c(f,{label:`Enable Chat`,checked:t.common.enableChat,disabled:!e.isAboveDisabled,hint:e.isAboveDisabled?`Chat session integration via clint-common`:`Requires Powerhouse to be enabled`,onChange:e.setEnableChat})})]})]})}function g(e){let{main:t}=e;return l(`section`,{className:`my-6`,children:[l(`div`,{className:`flex items-center gap-2`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Main Agent`}),c(`span`,{className:`rounded bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-700`,children:`Main`})]}),l(`p`,{className:`text-sm text-gray-600`,children:[`The orchestrating agent. Subagents are exposed to it as tools named `,c(`code`,{children:`agent-<subagent-id>`}),`. Only the main agent can have an avatar.`]}),l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[l(`div`,{style:{display:`flex`,gap:`1.5rem`},children:[c(`div`,{style:{flexShrink:0,width:`7rem`},children:c(w,{image:t.image??null,onSetImage:e.setMainAgentImage,onClearImage:e.clearMainAgentImage})}),l(`div`,{style:{flex:1,minWidth:0},children:[l(`div`,{className:`grid grid-cols-[1fr_2fr] gap-4`,children:[c(d,{compact:!0,readOnly:!0,label:`Agent ID`,value:t.id,onCommit:()=>{}}),c(d,{compact:!0,label:`Agent Name`,value:t.name,placeholder:`My Agent`,onCommit:e.setMainAgentName})]}),c(_,{value:t.description,placeholder:`A brief description of what this agent does`,onSet:e.setMainAgentDescription,onClear:e.clearMainAgentDescription})]})]}),c(`hr`,{className:`my-4`}),c(x,{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){return l(`label`,{className:`my-1 block`,children:[c(`h3`,{className:`text-xs text-gray-600`,children:`Description`}),c(`div`,{className:`flex items-center gap-2`,children:c(`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 v(e){let[t,n]=o(!1);return l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Sub-agents`}),l(`p`,{className:`text-sm text-gray-600`,children:[`Specialised agents the main agent can delegate to. Each is exposed as a tool named `,c(`code`,{children:`agent-<id>`}),`.`]}),e.subAgents.map(t=>c(b,{sub:t,models:e.models,profiles:e.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},t.id)),t?c(y,{models:e.models,existingAgentIds:e.existingAgentIds,onAdd:(t,r,i,a)=>{e.addSubAgent(t,r,i,a),n(!1)},onCancel:()=>n(!1)}):c(`button`,{className:`mt-3 rounded bg-blue-500 px-3 py-2 text-sm text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50`,disabled:e.models.length===0,title:e.models.length===0?`Add a model first`:``,onClick:()=>n(!0),children:`+ Add Sub-agent`})]})}function y(e){let[t,n]=o(``),[r,i]=o(``),[a,s]=o(``),[u,d]=o((e.models.find(e=>e.isDefault)??e.models[0])?.id??``),f=/^[a-z][a-z0-9-]*$/.test(t)&&!e.existingAgentIds.includes(t)&&r.trim()&&a.trim()&&u;return l(`div`,{className:`my-3 rounded border border-blue-200 bg-blue-50 p-4`,children:[l(`div`,{className:`grid grid-cols-2 gap-3`,children:[l(`label`,{className:`block`,children:[c(`span`,{className:`text-xs text-gray-600`,children:`Sub-agent ID`}),c(`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`})]}),l(`label`,{className:`block`,children:[c(`span`,{className:`text-xs text-gray-600`,children:`Display name`}),c(`input`,{type:`text`,value:r,placeholder:`Summarizer`,onChange:e=>i(e.target.value),className:`w-full rounded border p-2 text-sm`})]})]}),l(`label`,{className:`my-2 block`,children:[c(`span`,{className:`text-xs text-gray-600`,children:`Description (the main agent uses this to decide when to delegate)`}),c(`input`,{type:`text`,value:a,placeholder:`Summarizes long documents into bullet points`,onChange:e=>s(e.target.value),className:`w-full rounded border p-2 text-sm`})]}),l(`label`,{className:`my-2 block`,children:[c(`span`,{className:`text-xs text-gray-600`,children:`Model`}),c(`select`,{value:u,onChange:e=>d(e.target.value),className:`w-full rounded border p-2 font-mono text-sm`,children:e.models.map(e=>l(`option`,{value:e.id,children:[e.id,e.isDefault?` (default)`:``]},e.id))})]}),l(`div`,{className:`mt-2 flex items-center gap-2`,children:[c(`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:!f,onClick:()=>e.onAdd(t,r.trim(),a.trim(),u),children:`Add`}),c(`button`,{className:`text-sm text-gray-500 hover:text-gray-700`,onClick:e.onCancel,children:`Cancel`})]})]})}function b(e){let{sub:t}=e,[n,r]=o(!1);return l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[l(`div`,{className:`flex items-center justify-between`,children:[l(`div`,{className:`flex items-center gap-3`,children:[c(`button`,{className:`text-sm text-gray-400 hover:text-gray-700`,onClick:()=>r(!n),title:n?`Collapse`:`Expand`,children:n?`▾`:`▸`}),c(`span`,{className:`rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500`,children:t.id}),c(`span`,{className:`font-semibold`,children:t.name})]}),c(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.removeSubAgent(t.id),children:`Remove`})]}),c(`p`,{className:`ml-7 text-sm text-gray-600`,children:t.description}),n&&l(`div`,{className:`mt-4 space-y-3 border-t border-gray-100 pt-4`,children:[l(`div`,{className:`grid grid-cols-2 gap-3`,children:[c(d,{compact:!0,label:`Name`,value:t.name,onCommit:n=>e.setSubAgentName(t.id,n)}),c(d,{compact:!0,label:`Description`,value:t.description,onCommit:n=>e.setSubAgentDescription(t.id,n)})]}),c(x,{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 x(e){return l(`div`,{className:`space-y-3`,children:[l(`label`,{className:`block`,children:[c(`span`,{className:`text-xs text-gray-600`,children:`Model`}),c(`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=>l(`option`,{value:e.id,children:[e.id,e.isDefault?` (default)`:``]},e.id))})]}),c(S,{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)}),c(C,{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)}),c(C,{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 S(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 l(`div`,{children:[c(`span`,{className:`text-xs text-gray-600`,children:`Profiles (instructions, in order)`}),l(`ul`,{className:`my-1 space-y-1`,children:[e.profileIds.map((t,i)=>{let a=e.allProfiles.find(e=>e.id===t);return l(`li`,{className:`flex items-center gap-2 rounded bg-gray-50 px-2 py-1`,children:[c(`button`,{className:`text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:i===0,onClick:()=>n(i),title:`Move up`,children:`↑`}),c(`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:`↓`}),c(`span`,{className:`font-mono text-xs text-gray-500`,children:t}),c(`span`,{className:`flex-1 text-sm`,children:a?.title??c(`em`,{className:`text-red-500`,children:`(missing in library)`})}),c(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.onRemove(t),children:`Remove`})]},t)}),e.profileIds.length===0&&c(`li`,{className:`px-2 py-1 text-sm italic text-gray-400`,children:`No profiles assigned`})]}),t.length>0&&l(`select`,{value:``,onChange:t=>{t.target.value&&e.onAdd(t.target.value)},className:`rounded border p-1 text-sm`,children:[c(`option`,{value:``,children:`+ Add profile…`}),t.map(e=>l(`option`,{value:e.id,children:[e.title,` (`,e.id,`)`]},e.id))]})]})}function C(e){let[t,n]=o(``),r=e.validator(t.trim());return l(`div`,{children:[c(`span`,{className:`text-xs text-gray-600`,children:e.label}),c(`p`,{className:`text-xs text-gray-500`,children:e.hint}),c(`div`,{className:`my-1 flex flex-wrap items-center gap-1`,children:e.values.map(t=>l(`span`,{className:`flex items-center gap-1 rounded bg-gray-100 px-2 py-1 font-mono text-xs`,children:[t,c(`button`,{className:`text-red-500 hover:text-red-700`,onClick:()=>e.onRemove(t),title:`Remove`,children:`×`})]},t))}),l(`div`,{className:`flex items-center gap-2`,children:[c(`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`}),c(`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 w(e){let[t,n]=o(!1),r=a(0),u=t=>{if(!t.type.startsWith(`image/`))return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&e.onSetImage(n.result)},n.readAsDataURL(t)},d=i(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.stopPropagation())},[]),f=i(e=>{e.dataTransfer.types.includes(`Files`)&&(e.stopPropagation(),r.current+=1,r.current===1&&n(!0))},[]),p=i(e=>{e.dataTransfer.types.includes(`Files`)&&(e.stopPropagation(),r.current=Math.max(0,r.current-1),r.current===0&&n(!1))},[]),m=i(e=>{if(e.dataTransfer.types.includes(`Files`)){e.preventDefault(),e.stopPropagation(),r.current=0,n(!1);let t=e.dataTransfer.files[0];t&&u(t)}},[]),h=`7rem`;return c(`div`,{style:{width:h,height:h,flexShrink:0},className:`relative my-3`,children:e.image?l(s,{children:[c(`img`,{src:e.image,alt:`Agent`,style:{width:h,height:h},className:`rounded border border-gray-200 object-cover`}),l(`div`,{className:`mt-1 flex justify-center gap-1`,children:[l(`label`,{className:`cursor-pointer rounded bg-gray-100 px-2 py-0.5 text-xs hover:bg-gray-200`,children:[`Replace`,c(`input`,{type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{e.target.files?.[0]&&u(e.target.files[0])}})]}),c(`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`})]})]}):c(`div`,{style:{width:h,height:h},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:d,onDragEnter:f,onDragLeave:p,onDrop:m,children:l(`label`,{className:`cursor-pointer p-2 text-xs text-gray-500 hover:text-blue-600`,children:[`Drop image or click`,c(`input`,{type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{e.target.files?.[0]&&u(e.target.files[0])}})]})})})}function T(e){let[t,n]=o(``),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 l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Models`}),c(`p`,{className:`text-sm text-gray-600`,children:`Provider/model format (e.g. anthropic/claude-sonnet-4-5). Exactly one is the default.`}),e.models.length>0&&l(`table`,{className:`mt-3 w-full text-sm`,children:[c(`thead`,{children:l(`tr`,{className:`border-b text-left text-gray-500`,children:[c(`th`,{className:`py-1`,children:`Default`}),c(`th`,{className:`py-1`,children:`Model`}),c(`th`,{className:`py-1`,children:`Used by`}),c(`th`,{className:`py-1`})]})}),c(`tbody`,{children:e.models.map(t=>{let n=r(t.id),i=n.length>0;return l(`tr`,{className:`border-b border-gray-100`,children:[c(`td`,{className:`py-2`,children:c(`input`,{type:`radio`,name:`default-model`,checked:t.isDefault,onChange:()=>e.setDefaultModel(t.id)})}),c(`td`,{className:`py-2 font-mono`,children:t.id}),c(`td`,{className:`py-2 text-xs text-gray-500`,children:n.length===0?c(`em`,{children:`—`}):n.join(`, `)}),c(`td`,{className:`py-2 text-right`,children:c(`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)})})]}),l(`div`,{className:`mt-3 flex items-center gap-2`,children:[c(`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`}),c(`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 E(e){let[t,n]=o(!1),[r,i]=o(``),[a,s]=o(``),u=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},d=()=>{let t=r.trim(),o=a.trim();t&&o&&(e.addProfile(t,o,``),i(``),s(``),n(!1))},f=t=>{if(t===0)return;let n=e.profiles[t].id,r=e.profiles[t-1].id;e.reorderProfiles([n],r)},p=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 l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Agent Profiles`}),c(`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=u(t.id),i=r.length>0;return l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[l(`div`,{className:`flex items-center justify-between`,children:[l(`div`,{className:`flex items-center gap-2`,children:[c(`span`,{className:`rounded bg-gray-100 px-2 py-0.5 font-mono text-xs text-gray-500`,children:t.id}),c(`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&&l(`span`,{className:`rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700`,title:r.join(`, `),children:[`used by: `,r.join(`, `)]})]}),l(`div`,{className:`flex items-center gap-1`,children:[c(`button`,{className:`px-1 text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:n===0,onClick:()=>f(n),title:`Move up`,children:`↑`}),c(`button`,{className:`px-1 text-gray-400 hover:text-gray-600 disabled:opacity-30`,disabled:n===e.profiles.length-1,onClick:()=>p(n),title:`Move down`,children:`↓`}),c(`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`})]})]}),c(`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?c(`div`,{className:`my-3 rounded border border-blue-200 bg-blue-50 p-4`,children:l(`div`,{className:`flex items-center gap-2`,children:[c(`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`}),c(`input`,{type:`text`,placeholder:`Section Title`,value:a,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d()},className:`flex-1 rounded border p-2 text-sm`}),c(`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:d,children:`Add`}),c(`button`,{className:`text-sm text-gray-500 hover:text-gray-700`,onClick:()=>{n(!1),i(``),s(``)},children:`Cancel`})]})}):c(`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 te(e){return l(s,{children:[l(`section`,{className:`my-6 rounded border border-dashed border-gray-300 bg-white p-8 text-center text-gray-500`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Skill Templates`}),c(`p`,{className:`mt-2`,children:`Coming soon`})]}),c(`hr`,{}),c(D,{skills:e.skills,addSkill:e.addSkill,removeSkill:e.removeSkill})]})}function D(e){let[t,n]=o(``),[r,i]=o(``),a=()=>{t.trim()&&r.trim()&&(e.addSkill(t.trim(),r.trim()),n(``),i(``))};return l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`External Skills`}),c(`p`,{className:`text-sm text-gray-600`,children:`Skills from the skills.sh ecosystem, installed via GitHub URL.`}),e.skills.length>0&&c(`ul`,{className:`mt-3 space-y-2`,children:e.skills.map(t=>l(`li`,{className:`flex items-center justify-between rounded border border-gray-200 bg-white p-3`,children:[l(`div`,{children:[c(`span`,{className:`font-mono font-semibold`,children:t.name}),c(`span`,{className:`ml-2 text-sm text-gray-500`,children:t.githubUrl})]}),c(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.removeSkill(t.id),children:`Remove`})]},t.id))}),l(`div`,{className:`mt-3 flex items-center gap-2`,children:[c(`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`}),c(`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`}),c(`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 ne(e){let t=e.publishHistory.slice(-5).reverse();return l(s,{children:[l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Publishing`}),l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[l(`div`,{className:`flex items-center gap-4`,children:[c(`span`,{className:`text-sm text-gray-600`,children:`Current version:`}),c(`span`,{className:`font-mono font-semibold`,children:e.version})]}),l(`div`,{className:`mt-4 flex items-center gap-2`,children:[c(`button`,{className:`rounded bg-gray-600 px-3 py-2 text-sm text-white hover:bg-gray-700`,onClick:e.publishDev,children:`Publish Dev`}),c(`button`,{className:`rounded bg-amber-600 px-3 py-2 text-sm text-white hover:bg-amber-700`,onClick:e.publishStaging,children:`Publish Staging`}),c(`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&&l(`div`,{className:`mt-3`,children:[c(`h4`,{className:`text-sm font-semibold text-gray-600`,children:`Recent publish history`}),c(`ul`,{className:`mt-2 space-y-1`,children:t.map(e=>l(`li`,{className:`flex items-center gap-3 text-sm`,children:[c(j,{status:e.status}),c(`span`,{className:`font-mono`,children:e.version}),c(`span`,{className:`text-gray-500`,children:e.tag}),c(`span`,{className:`text-gray-400`,children:e.timestamp})]},e.id))})]})]}),c(`hr`,{}),c(O,{deployment:e.deployment,setProxyEnabled:e.setProxyEnabled,setObservabilityEnabled:e.setObservabilityEnabled,addSupportedResource:e.addSupportedResource,removeSupportedResource:e.removeSupportedResource}),c(`hr`,{}),l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Document`}),l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[l(`p`,{className:`text-sm text-gray-600`,children:[`Document ID: `,c(`span`,{className:`font-mono`,children:e.documentHeader.id})]}),l(`p`,{className:`text-sm text-gray-600`,children:[`Type: `,c(`span`,{className:`font-mono`,children:e.documentHeader.documentType})]}),l(`div`,{className:`mt-3 flex items-center gap-2`,children:[c(`span`,{className:`text-sm text-gray-600`,children:`Bump version to:`}),c(`input`,{type:`text`,placeholder:`0.2.0`,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`})]})]})]})]})}function O(e){let[t,n]=o(``);return l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Deployment`}),l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[c(f,{label:`Proxy enabled`,checked:e.deployment.proxyEnabled,onChange:e.setProxyEnabled,hint:`Embedded reverse proxy`}),c(f,{label:`Observability enabled`,checked:e.deployment.observabilityEnabled,onChange:e.setObservabilityEnabled,hint:`Sentry + OpenTelemetry`})]}),l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[c(`h4`,{className:`text-base font-semibold`,children:`Supported resources`}),c(`ul`,{className:`my-2 space-y-1`,children:e.deployment.supportedResources.map(t=>l(`li`,{className:`flex items-center justify-between text-sm`,children:[c(`span`,{className:`font-mono`,children:t}),c(`button`,{className:`text-red-500 hover:text-red-700`,onClick:()=>e.removeSupportedResource(t),children:`Remove`})]},t))}),l(`div`,{className:`mt-2 flex items-center gap-2`,children:[c(`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`}),c(`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 k(e){let[t,n]=o(``);return l(`section`,{className:`my-6`,children:[c(`h3`,{className:`text-lg font-semibold`,children:`Reactor Packages`}),e.packages.map(t=>c(A,{pkg:t,addDocType:e.addDocType,removeDocType:e.removeDocType,removePackage:e.removePackage},t.id)),l(`div`,{className:`my-3 flex items-center gap-2`,children:[c(`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`}),c(`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 A(e){let[t,n]=o(``);return l(`div`,{className:`my-3 rounded border border-gray-200 bg-white p-4`,children:[l(`div`,{className:`flex items-center justify-between`,children:[l(`div`,{children:[c(`span`,{className:`font-mono font-semibold`,children:e.pkg.packageName}),e.pkg.managed&&c(`span`,{className:`ml-2 rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700`,children:`managed`}),e.pkg.version&&l(`span`,{className:`ml-2 text-sm text-gray-500`,children:[`v`,e.pkg.version]})]}),!e.pkg.managed&&c(`button`,{className:`text-sm text-red-500 hover:text-red-700`,onClick:()=>e.removePackage(e.pkg.id),children:`Remove Package`})]}),c(`ul`,{className:`my-2 space-y-1`,children:e.pkg.documentTypes.map(t=>l(`li`,{className:`flex items-center justify-between text-sm`,children:[c(`span`,{className:`font-mono`,children:t}),c(`button`,{className:`text-red-500 hover:text-red-700`,onClick:()=>e.removeDocType(e.pkg.id,t),children:`×`})]},t))}),l(`div`,{className:`mt-2 flex items-center gap-2`,children:[c(`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`}),c(`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 j(e){return c(`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{p as default};
|
|
2
|
-
//# sourceMappingURL=editor-CQqCB-3d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor-CQqCB-3d.js","names":[],"sources":["../../../editors/ph-clint-project-editor/editor.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport { generateId } from 'document-model';\nimport { DocumentToolbar } from '@powerhousedao/design-system/connect';\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\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 = 'spec' | 'agent' | 'powerhouse' | 'skills' | 'publish';\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>('spec');\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 = (image: string) => dispatch(actions.setMainAgentImage({ image }));\n const clearMainAgentImage = () => dispatch(actions.clearMainAgentImage({ _: true }));\n\n // sub agent dispatchers\n const addSubAgent = (id: string, name: string, description: string, modelId: string) =>\n 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, isDefault?: boolean) => dispatch(actions.addModel({ id, isDefault }));\n const removeModel = (id: string) => dispatch(actions.removeModel({ id }));\n const setDefaultModel = (id: string) => dispatch(actions.setDefaultModel({ id }));\n const addProfile = (id: string, title: string, content: string, insertBefore?: string) =>\n 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) =>\n dispatch(actions.addAgentProfileRef({ agentId, profileId, insertBefore }));\n const removeAgentProfileRef = (agentId: string, profileId: string) =>\n dispatch(actions.removeAgentProfileRef({ agentId, profileId }));\n const reorderAgentProfileRefs = (agentId: string, ids: string[], insertBefore: string | null) =>\n 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 <button className={tabClasses('spec')} onClick={() => setActiveTab('spec')}>CLI</button>\n <button className={tabClasses('agent')} onClick={() => setActiveTab('agent')}>Agent</button>\n <button className={tabClasses('powerhouse')} onClick={() => setActiveTab('powerhouse')}>Powerhouse</button>\n <button className={tabClasses('skills')} onClick={() => setActiveTab('skills')}>Skills</button>\n <button className={tabClasses('publish')} onClick={() => setActiveTab('publish')}>Publish</button>\n </nav>\n\n {activeTab === 'spec' && (\n <SpecTab\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 />\n )}\n\n {activeTab === 'agent' && (\n <AgentTab\n mastra={mastra}\n isAboveDisabled={isAboveDisabled}\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 addModel={addModel}\n removeModel={removeModel}\n setDefaultModel={setDefaultModel}\n addProfile={addProfile}\n updateProfile={updateProfile}\n removeProfile={removeProfile}\n reorderProfiles={reorderProfiles}\n setEnableChat={setEnableChat}\n />\n )}\n\n {activeTab === 'powerhouse' && (\n <PowerhouseTab\n packages={state.packages}\n isAboveDisabled={isAboveDisabled}\n addPackage={addPackage}\n removePackage={removePackage}\n addDocType={addDocType}\n removeDocType={removeDocType}\n />\n )}\n\n {activeTab === 'skills' && <SkillsTab skills={state.externalSkills} addSkill={addSkill} removeSkill={removeSkill} />}\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/* ── Spec Tab ─────────────────────────────────────────────────── */\n\nfunction SpecTab(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}) {\n const { state } = 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={props.mastra.enabled} hint=\"AI agent framework\" onChange={props.toggleMastra} />\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/* ── 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 Spec 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/* ── Agent Tab ────────────────────────────────────────────────── */\n\ninterface AgentTabProps {\n mastra: PhClintMastraFeature;\n isAboveDisabled: boolean;\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 addModel: (id: string, isDefault?: boolean) => void;\n removeModel: (id: string) => void;\n setDefaultModel: (id: string) => void;\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 setEnableChat: (enabled: boolean) => void;\n}\n\nfunction AgentTab(props: AgentTabProps) {\n const { mastra } = props;\n\n const main = mastra.mainAgent;\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\">Agent</h3>\n <p className=\"mt-2\">Enable Mastra in the Spec 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 <MainAgentPanel\n main={main}\n models={mastra.models}\n profiles={mastra.profiles}\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 <hr />\n\n <SubAgentsSection\n subAgents={mastra.subAgents}\n models={mastra.models}\n profiles={mastra.profiles}\n existingAgentIds={allAgentIds}\n addSubAgent={props.addSubAgent}\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 <hr />\n\n <ModelsSection\n models={mastra.models}\n main={mastra.mainAgent}\n subAgents={mastra.subAgents}\n addModel={props.addModel}\n removeModel={props.removeModel}\n setDefaultModel={props.setDefaultModel}\n />\n\n <hr />\n\n <ProfilesSection\n profiles={mastra.profiles}\n main={mastra.mainAgent}\n subAgents={mastra.subAgents}\n addProfile={props.addProfile}\n updateProfile={props.updateProfile}\n removeProfile={props.removeProfile}\n reorderProfiles={props.reorderProfiles}\n />\n\n <hr />\n\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Common</h3>\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\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 </section>\n </>\n );\n}\n\n/* ── Main Agent panel ─────────────────────────────────────────── */\n\ninterface MainAgentPanelProps {\n main: PhClintMainAgent;\n models: PhClintAgentModel[];\n profiles: PhClintAgentProfile[];\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 MainAgentPanel(props: MainAgentPanelProps) {\n const { main } = props;\n\n return (\n <section className=\"my-6\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"text-lg font-semibold\">Main Agent</h3>\n <span className=\"rounded bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-700\">Main</span>\n </div>\n <p className=\"text-sm text-gray-600\">The orchestrating agent. Subagents are exposed to it as tools named <code>agent-<subagent-id></code>. Only the main agent can have an avatar.</p>\n\n <div className=\"my-3 rounded border border-gray-200 bg-white p-4\">\n <div style={{ display: 'flex', gap: '1.5rem' }}>\n <div style={{ flexShrink: 0, width: '7rem' }}>\n <AgentImageField image={main.image ?? null} 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\n value={main.description}\n placeholder=\"A brief description of what this agent does\"\n onSet={props.setMainAgentDescription}\n onClear={props.clearMainAgentDescription}\n />\n </div>\n </div>\n\n <hr className=\"my-4\" />\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 </section>\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\n/* ── Sub agents ──────────────────────────────────────────────── */\n\ninterface SubAgentsSectionProps {\n subAgents: PhClintSubAgent[];\n models: PhClintAgentModel[];\n profiles: PhClintAgentProfile[];\n existingAgentIds: string[];\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 SubAgentsSection(props: SubAgentsSectionProps) {\n const [showAddForm, setShowAddForm] = useState(false);\n\n return (\n <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Sub-agents</h3>\n <p className=\"text-sm text-gray-600\">Specialised agents the main agent can delegate to. Each is exposed as a tool named <code>agent-<id></code>.</p>\n\n {props.subAgents.map((sub) => (\n <SubAgentCard\n key={sub.id}\n sub={sub}\n models={props.models}\n profiles={props.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 {showAddForm ? (\n <AddSubAgentForm\n models={props.models}\n existingAgentIds={props.existingAgentIds}\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=\"mt-3 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={props.models.length === 0}\n title={props.models.length === 0 ? 'Add a model first' : ''}\n onClick={() => setShowAddForm(true)}\n >\n + Add Sub-agent\n </button>\n )}\n </section>\n );\n}\n\nfunction AddSubAgentForm(props: {\n models: PhClintAgentModel[];\n existingAgentIds: string[];\n onAdd: (id: string, name: string, description: string, modelId: string) => void;\n onCancel: () => void;\n}) {\n const [id, setId] = useState('');\n const [name, setName] = useState('');\n const [description, setDescription] = useState('');\n const defaultModel = props.models.find((m) => m.isDefault) ?? props.models[0];\n const [modelId, setModelId] = useState<string>(defaultModel?.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\n type=\"text\"\n value={id}\n placeholder=\"summarizer\"\n onChange={(e) => setId(e.target.value.trim())}\n className=\"w-full rounded border p-2 font-mono text-sm\"\n />\n </label>\n <label className=\"block\">\n <span className=\"text-xs text-gray-600\">Display name</span>\n <input\n type=\"text\"\n value={name}\n placeholder=\"Summarizer\"\n onChange={(e) => setName(e.target.value)}\n className=\"w-full rounded border p-2 text-sm\"\n />\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\n type=\"text\"\n value={description}\n placeholder=\"Summarizes long documents into bullet points\"\n onChange={(e) => setDescription(e.target.value)}\n className=\"w-full rounded border p-2 text-sm\"\n />\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 {m.isDefault ? ' (default)' : ''}\n </option>\n ))}\n </select>\n </label>\n <div className=\"mt-2 flex items-center gap-2\">\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={!canAdd}\n onClick={() => props.onAdd(id, name.trim(), description.trim(), modelId)}\n >\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\n value={props.modelId}\n onChange={(e) => props.setAgentModel(props.agentId, e.target.value)}\n className=\"mt-1 w-full rounded border p-2 font-mono text-sm\"\n >\n {props.models.map((m) => (\n <option key={m.id} value={m.id}>\n {m.id}\n {m.isDefault ? ' (default)' : ''}\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={\n props.isMain\n ? 'Glob patterns over tool names (e.g. clint-project-*, *-mcp__*). Empty = all tools.'\n : 'Glob patterns over tool names. Empty = no tools.'\n }\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 && (\n <li className=\"px-2 py-1 text-sm italic text-gray-400\">No profiles assigned</li>\n )}\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: {\n label: string;\n hint: string;\n values: string[];\n placeholder: string;\n validator: (v: string) => boolean;\n onAdd: (v: string) => void;\n onRemove: (v: string) => void;\n}) {\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: { image: string | null | undefined; onSetImage: (dataUrl: string) => void; onClearImage: () => void }) {\n const [isDragOver, setIsDragOver] = useState(false);\n const dragDepthRef = useRef(0);\n\n const handleFile = (file: File) => {\n if (!file.type.startsWith('image/')) return;\n const reader = new FileReader();\n reader.onload = () => {\n if (typeof reader.result === 'string') props.onSetImage(reader.result);\n };\n reader.readAsDataURL(file);\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) 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.image ? (\n <>\n <img src={props.image} alt=\"Agent\" style={{ width: SIZE, height: SIZE }} className=\"rounded border border-gray-200 object-cover\" />\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]) 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]) handleFile(e.target.files[0]);\n }}\n />\n </label>\n </div>\n )}\n </div>\n );\n}\n\n/* ── Models library ──────────────────────────────────────────── */\n\nfunction ModelsSection(props: {\n models: PhClintAgentModel[];\n main: PhClintMainAgent | null | undefined;\n subAgents: PhClintSubAgent[];\n addModel: (id: string, isDefault?: boolean) => void;\n removeModel: (id: string) => void;\n setDefaultModel: (id: string) => void;\n}) {\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 <section className=\"my-6\">\n <h3 className=\"text-lg font-semibold\">Models</h3>\n <p className=\"text-sm text-gray-600\">Provider/model format (e.g. anthropic/claude-sonnet-4-5). Exactly one is the default.</p>\n\n {props.models.length > 0 && (\n <table className=\"mt-3 w-full text-sm\">\n <thead>\n <tr className=\"border-b text-left text-gray-500\">\n <th className=\"py-1\">Default</th>\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\">\n <input type=\"radio\" name=\"default-model\" checked={m.isDefault} onChange={() => props.setDefaultModel(m.id)} />\n </td>\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\n className=\"text-red-500 hover:text-red-700 disabled:cursor-not-allowed disabled:text-gray-300\"\n disabled={inUse}\n title={inUse ? `In use by ${users.join(', ')}` : ''}\n onClick={() => props.removeModel(m.id)}\n >\n Remove\n </button>\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n )}\n\n <div className=\"mt-3 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 </section>\n );\n}\n\n/* ── Profiles library ────────────────────────────────────────── */\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\n className=\"ml-2 text-sm text-red-500 hover:text-red-700 disabled:cursor-not-allowed disabled:text-gray-300\"\n disabled={inUse}\n title={inUse ? `In use by ${users.join(', ')}` : ''}\n onClick={() => props.removeProfile(profile.id)}\n >\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/* ── 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\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-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\">Document ID: <span className=\"font-mono\">{props.documentHeader.id}</span></p>\n <p className=\"text-sm text-gray-600\">Type: <span className=\"font-mono\">{props.documentHeader.documentType}</span></p>\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=\"0.2.0\"\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 </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'\n : props.status === 'Failed' ? 'bg-red-100 text-red-700'\n : props.status === 'InProgress' ? 'bg-amber-100 text-amber-700'\n : '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":"wRAkBA,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,CAED,SAAS,EAAU,EAAyI,CAC1J,OACE,EAAC,QAAD,CAAO,UAAW,EAAM,QAAU,aAAe,sBAAjD,CACE,EAAC,KAAD,CAAI,UAAW,EAAM,QAAU,wBAA0B,qBAAc,EAAM,MAAW,CAAA,CACxF,EAAC,QAAD,CACE,KAAK,OACL,aAAc,EAAM,MACpB,YAAa,EAAM,YACnB,SAAU,EAAM,SAChB,OAAS,GAAM,CACb,IAAM,EAAO,EAAE,OAAO,MAAM,MAAM,CAC9B,IAAS,EAAM,OAAO,EAAM,SAAS,EAAK,EAEhD,UAAY,GAAM,CACZ,EAAE,MAAQ,SAAS,EAAE,cAAc,MAAM,EAE/C,UAAU,mBACV,CAAA,CACI,GAIZ,SAAS,EAAO,EAAkH,CAChI,OACE,EAAC,QAAD,CAAO,UAAU,wCAAjB,CACE,EAAC,QAAD,CAAO,KAAK,WAAW,QAAS,EAAM,QAAS,SAAU,EAAM,SAAU,SAAW,GAAM,EAAM,SAAS,EAAE,OAAO,QAAQ,CAAI,CAAA,CAC9H,EAAC,OAAD,CAAM,UAAU,yBAAiB,EAAM,MAAa,CAAA,CACnD,EAAM,KAAO,EAAC,OAAD,CAAM,UAAU,iCAAyB,EAAM,KAAY,CAAA,CAAG,KACtE,GAMZ,SAAwB,GAAS,CAC/B,GAAM,CAAC,EAAU,GAAY,GAAmC,CAC1D,EAAQ,EAAS,MAAM,OACvB,CAAE,aAAY,SAAQ,WAAY,EAAM,SACxC,CAA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