bazilion 0.8.0 → 0.9.0
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/README.md +47 -5
- package/dist/cli.js +1184 -628
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +5194 -1574
- package/dist/daemon.js.map +1 -1
- package/dist/migrations/0001_init.sql +318 -88
- package/dist/web/client/assets/{FieldRow-CNKma5LE.js → FieldRow-DmwAFfbF.js} +1 -1
- package/dist/web/client/assets/ProductionTeamPolicyEditor-1a5jQqUB.js +7 -0
- package/dist/web/client/assets/ProductionTeamPolicyEditor-DLioOiRN.css +1 -0
- package/dist/web/client/assets/ProfileCommunicationEditor-D1OZ8WE5.js +1 -0
- package/dist/web/client/assets/RecoveryState-QfMSuwy3.js +1 -0
- package/dist/web/client/assets/TeamTabs-BViZ4sti.js +1 -0
- package/dist/web/client/assets/TemplatesTabs-DVcY9pMD.js +1 -0
- package/dist/web/client/assets/_id-8P7brhGy.js +1 -0
- package/dist/web/client/assets/_id-C3o3MHq8.js +1 -0
- package/dist/web/client/assets/_id-DGRrSF1e.js +1 -0
- package/dist/web/client/assets/_id-DGyKURCp.js +1 -0
- package/dist/web/client/assets/_id-KnJe-aW9.js +1 -0
- package/dist/web/client/assets/activity-DJuhhQCb.js +1 -0
- package/dist/web/client/assets/activity-WWvJSo4t.js +1 -0
- package/dist/web/client/assets/agents-C32T1voV.js +1 -0
- package/dist/web/client/assets/agents-nH4m4gZ1.js +1 -0
- package/dist/web/client/assets/approvals-DGi0PSx8.js +1 -0
- package/dist/web/client/assets/approvals-l8jIZjqz.js +1 -0
- package/dist/web/client/assets/{config-DIuEc5bm.js → config-C7wvi1nR.js} +2 -2
- package/dist/web/client/assets/context-BEGWE3RC.js +1 -0
- package/dist/web/client/assets/inbox--4aBaAgG.js +1 -0
- package/dist/web/client/assets/index-BCXoh1c8.js +12 -0
- package/dist/web/client/assets/{login-CawJX16E.js → login-Bk2wwIHQ.js} +1 -1
- package/dist/web/client/assets/{mcp-DIrh9-v_.js → mcp-vM7xgh9e.js} +1 -1
- package/dist/web/client/assets/members-cPKfnrSL.js +1 -0
- package/dist/web/client/assets/memory-BOcsaemD.js +1 -0
- package/dist/web/client/assets/policy-BGLCJYvS.js +1 -0
- package/dist/web/client/assets/policy-K4hIbbIN.js +1 -0
- package/dist/web/client/assets/{preload-helper-CvnapA2_.js → preload-helper-eOOCz1Fu.js} +1 -1
- package/dist/web/client/assets/routes-DnrP3dwv.js +1 -0
- package/dist/web/client/assets/services-C2_O3ifw.js +1 -0
- package/dist/web/client/assets/{skills-Da0MURjY.js → skills-B__fLZjx.js} +1 -1
- package/dist/web/client/assets/styles-Dn24-ZvP.css +2 -0
- package/dist/web/client/assets/team-policy-BdX340m4.js +1 -0
- package/dist/web/client/assets/teams-CSNyLz3l.js +1 -0
- package/dist/web/client/assets/teams-DZMB4_iw.js +1 -0
- package/dist/web/client/assets/teams-rpaYKNIb.js +1 -0
- package/dist/web/client/assets/telegram-B1O4Ko0V.js +1 -0
- package/dist/web/client/assets/{tokens-E_JvO5JN.js → tokens-D7FH9VgA.js} +1 -1
- package/dist/web/client/assets/triggers-3PLy2_Fo.js +1 -0
- package/dist/web/client/assets/welcome-B-QQobzq.js +1 -0
- package/dist/web/client/assets/{ChatPane-DzEgOEqS.js → wire-constants-BY9Q9Z7d.js} +4 -4
- package/dist/web/server/assets/{ChatPane-BvpswYvF.js → ChatPane-Dh3qxzdb.js} +23 -12
- package/dist/web/server/assets/ProductionTeamPolicyEditor-Bke5doyl.js +1009 -0
- package/dist/web/server/assets/ProfileCommunicationEditor-C2RU-2QB.js +107 -0
- package/dist/web/server/assets/RecoveryState-B2SG-mrY.js +37 -0
- package/dist/web/server/assets/{Sidebar-DmEiewRN.js → Sidebar-CGmtCnYU.js} +372 -48
- package/dist/web/server/assets/TeamTabs-BPxDBfqy.js +50 -0
- package/dist/web/server/assets/{TemplatesTabs---7h5GYa.js → TemplatesTabs-zf4YhStd.js} +6 -6
- package/dist/web/server/assets/{_id-CXg-Blec.js → _id-5lLzLwcv.js} +52 -40
- package/dist/web/server/assets/_id-A8Xiv6Lc.js +11 -0
- package/dist/web/server/assets/{_id-BqnDy_Ca.js → _id-B04VaQlh.js} +6 -5
- package/dist/web/server/assets/{_id-BdRiQb2H.js → _id-B6g9wmPR.js} +126 -27
- package/dist/web/server/assets/_id-ButXHnRH.js +14 -0
- package/dist/web/server/assets/_id-C4AOhstq.js +44 -0
- package/dist/web/server/assets/{_id-DDixKEud.js → _id-CCHA0gdR.js} +72 -12
- package/dist/web/server/assets/{_id-D_Ew11ED.js → _id-CUWgTqMS.js} +8 -8
- package/dist/web/server/assets/_id-DJkzwHjM.js +42 -0
- package/dist/web/server/assets/{_id-CnQflrRv.js → _id-DdC9wpNN.js} +5 -5
- package/dist/web/server/assets/{_id-DUIrFV3G.js → _id-DkFgCIb-.js} +9 -1
- package/dist/web/server/assets/{_id-D8duqgd5.js → _id-_nFwi9gD.js} +5 -4
- package/dist/web/server/assets/{_id-Sjw0zhA6.js → _id-fpFQ9_Ya.js} +4 -4
- package/dist/web/server/assets/_tanstack-start-manifest_v-Div-TukY.js +241 -0
- package/dist/web/server/assets/activity-C2ZKg1Q9.js +170 -0
- package/dist/web/server/assets/activity-CGCf8BQf.js +11 -0
- package/dist/web/server/assets/activity-DedraoFj.js +14 -0
- package/dist/web/server/assets/activity-GPx8NCeB.js +12 -0
- package/dist/web/server/assets/{profiles-CZ5NkmVw.js → agents-B8kinIPW.js} +4 -4
- package/dist/web/server/assets/{agents-k5QURC4I.js → agents-BR2qXlXF.js} +4 -4
- package/dist/web/server/assets/{agents-ChcAJUI5.js → agents-Bp1nsVs2.js} +1 -1
- package/dist/web/server/assets/{profiles-LxcC_L6n.js → agents-CUQmWhTp.js} +36 -10
- package/dist/web/server/assets/{agents-C7SBPN0M.js → agents-DU9Hqs58.js} +51 -12
- package/dist/web/server/assets/{profiles-C6a3RKgu.js → agents-LHowEI6S.js} +4 -4
- package/dist/web/server/assets/approvals-CbFXFvG8.js +11 -0
- package/dist/web/server/assets/approvals-DHgARzd8.js +242 -0
- package/dist/web/server/assets/approvals-Dw2LJoSA.js +14 -0
- package/dist/web/server/assets/approvals-VPc0YpLN.js +12 -0
- package/dist/web/server/assets/{auth-DzRAMwVt.js → auth-l-Vf8wlu.js} +5 -1
- package/dist/web/server/assets/{config-CdVjqjin.js → config-BvKctDOX.js} +4 -4
- package/dist/web/server/assets/{config-Bq3o924J.js → config-QvHaxGlP.js} +1 -1
- package/dist/web/server/assets/context-5lrf2ame.js +12 -0
- package/dist/web/server/assets/context-CEr4-xiA.js +49 -0
- package/dist/web/server/assets/context-D3Egm-vY.js +12 -0
- package/dist/web/server/assets/members-40DxRdVj.js +48 -0
- package/dist/web/server/assets/members-DlGBKZNl.js +12 -0
- package/dist/web/server/assets/members-ksELRsyk.js +12 -0
- package/dist/web/server/assets/{memory-Ns2-Z31p.js → memory-B5moRnnp.js} +5 -5
- package/dist/web/server/assets/{memory-BaYnfm7K.js → memory-CO0jKGzJ.js} +8 -8
- package/dist/web/server/assets/memory-CiTl4cN9.js +289 -0
- package/dist/web/server/assets/policy-BYVXqsan.js +11 -0
- package/dist/web/server/assets/policy-DNcGZLOB.js +21 -0
- package/dist/web/server/assets/policy-Dr55y-Mh.js +496 -0
- package/dist/web/server/assets/policy-Dxs78_GO.js +40 -0
- package/dist/web/server/assets/{router-BrDascdO.js → router-_izWQUeG.js} +156 -101
- package/dist/web/server/assets/{routes-Ce2VWrU9.js → routes-BSSKp3Rv.js} +4 -4
- package/dist/web/server/assets/{routes-C61gBiXa.js → routes-BrTOoeth.js} +5 -5
- package/dist/web/server/assets/{routes-V9URcp1v.js → routes-DOj6ljcm.js} +1 -1
- package/dist/web/server/assets/{services-B91w2f-X.js → services-CHe4ihJk.js} +11 -11
- package/dist/web/server/assets/{services-Ccc5s2bS.js → services-Pv_V88VA.js} +3 -3
- package/dist/web/server/assets/{start-CYDpZ6cb.js → start-DlHq0RaQ.js} +1 -1
- package/dist/web/server/assets/team-policy-Csvc5EDd.js +180 -0
- package/dist/web/server/assets/teams-35Oprf6e.js +14 -0
- package/dist/web/server/assets/teams-3im0oQnS.js +11 -0
- package/dist/web/server/assets/teams-B5IF65p2.js +12 -0
- package/dist/web/server/assets/teams-B9O-WDH5.js +108 -0
- package/dist/web/server/assets/teams-DFkN7ic7.js +36 -0
- package/dist/web/server/assets/teams-DH1CvWmT.js +12 -0
- package/dist/web/server/assets/teams-zcm9XaQU.js +174 -0
- package/dist/web/server/assets/{telegram-DfAddLdv.js → telegram-C9sQFwWj.js} +7 -7
- package/dist/web/server/assets/{telegram-T3l9KtiE.js → telegram-mTnJCOmn.js} +1 -1
- package/dist/web/server/assets/{welcome-CP4CZ9B6.js → welcome-CDGE2Sdk.js} +2 -2
- package/dist/web/server/assets/{wire-constants-Deb4NxBb.js → wire-constants-C8nBJcU3.js} +3 -3
- package/dist/web/server/server.js +64 -42
- package/dist/worker.js +180 -128
- package/dist/worker.js.map +1 -1
- package/package.json +7 -7
- package/dist/migrations/0002_profile_groups.sql +0 -38
- package/dist/migrations/0003_agent_telegram.sql +0 -40
- package/dist/migrations/0004_agent_mirror_mode.sql +0 -17
- package/dist/migrations/0005_group_topic_name_format.sql +0 -15
- package/dist/migrations/0006_telegram_acl.sql +0 -18
- package/dist/migrations/0007_mcp_servers.sql +0 -30
- package/dist/migrations/0008_seed_user_md.sql +0 -39
- package/dist/web/client/assets/MembersEditor-C6UpqDdV.js +0 -1
- package/dist/web/client/assets/SpawnTeamModal-BEkNCKXm.js +0 -1
- package/dist/web/client/assets/TemplatesTabs-UM04RMO9.js +0 -1
- package/dist/web/client/assets/_id-BNJapCT4.js +0 -1
- package/dist/web/client/assets/_id-CjGoV8Mr.js +0 -1
- package/dist/web/client/assets/_id-DehuCHUw.js +0 -1
- package/dist/web/client/assets/_id-Dz9fjcCM.js +0 -1
- package/dist/web/client/assets/agents-M6omAXcZ.js +0 -1
- package/dist/web/client/assets/groups-DpE2d2zZ.js +0 -1
- package/dist/web/client/assets/inbox-BPnLsRNf.js +0 -1
- package/dist/web/client/assets/index-MAJuXnie.js +0 -12
- package/dist/web/client/assets/memory-BpHbdKsd.js +0 -1
- package/dist/web/client/assets/profile-groups-ByoKak0c.js +0 -1
- package/dist/web/client/assets/profiles-BEjv8LGo.js +0 -1
- package/dist/web/client/assets/routes-D2COHy7v.js +0 -1
- package/dist/web/client/assets/services-D212jSK_.js +0 -1
- package/dist/web/client/assets/styles-BgE5bCHA.css +0 -2
- package/dist/web/client/assets/telegram-Czh2MdVm.js +0 -1
- package/dist/web/client/assets/triggers-BBRZQOm7.js +0 -1
- package/dist/web/client/assets/welcome-Dn-zvmBE.js +0 -1
- package/dist/web/client/assets/wire-constants-BkT5-597.js +0 -1
- package/dist/web/server/assets/MembersEditor-BWQztvrX.js +0 -131
- package/dist/web/server/assets/SpawnTeamModal-dSN421k_.js +0 -107
- package/dist/web/server/assets/_id-BKev9H1p.js +0 -12
- package/dist/web/server/assets/_id-BNwlbWHP.js +0 -24
- package/dist/web/server/assets/_id-CRqqi8IE.js +0 -161
- package/dist/web/server/assets/_tanstack-start-manifest_v-D9FLKShQ.js +0 -178
- package/dist/web/server/assets/groups-CbSwND2r.js +0 -12
- package/dist/web/server/assets/groups-CeRRlZaZ.js +0 -150
- package/dist/web/server/assets/groups-pk4CYSuf.js +0 -21
- package/dist/web/server/assets/memory-CQaqWnyM.js +0 -284
- package/dist/web/server/assets/profile-groups-CiU06yN1.js +0 -28
- package/dist/web/server/assets/profile-groups-D21MYoLM.js +0 -208
- package/dist/web/server/assets/profile-groups-aoJleXHP.js +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n,d as r}from"./preload-helper-eOOCz1Fu.js";import{T as i,d as a}from"./index-BCXoh1c8.js";import{t as o}from"./AgentTabs-DioGqUVR.js";import{t as s}from"./AgentAvatar-JYijLvZ2.js";import{i as c,r as l}from"./wire-constants-BY9Q9Z7d.js";var u=i(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),d=e(n(),1),f=t();function p({value:e,className:t,ariaLabel:n=`Copy to clipboard`,title:r=`Copy to clipboard`}){let[i,a]=(0,d.useState)(!1);async function o(){if(!e)return;let t=!1;try{navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),t=!0)}catch{}if(!t){let n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.opacity=`0`,document.body.appendChild(n),n.select();try{t=document.execCommand(`copy`)}catch{}n.remove()}t&&(a(!0),setTimeout(()=>a(!1),1e3))}return(0,f.jsx)(`button`,{type:`button`,onClick:o,title:r,"aria-label":n,className:`inline-flex h-[1.3rem] w-[1.6rem] items-center justify-center rounded-sm border border-transparent text-mocha-light transition-colors hover:border-frost hover:bg-snow hover:text-mocha ${i?`border-[#bcd9bc] bg-[#eef7ee] text-[#3b7a3b] hover:border-[#bcd9bc] hover:bg-[#eef7ee] hover:text-[#3b7a3b]`:``} ${t??``}`,children:i?`✓`:`⧉`})}function m(){let{resolved:e,initialMessages:t,sessionHead:n,teams:i,skills:l,modelGroups:d,telegramConfigured:m}=a.useLoaderData(),b=a.useSearch(),S=r();async function C(){confirm(`archive "${e.agent.name}"? (reversible)`)&&(await fetch(`/api/agents/${e.agent.id}/archive`,{method:`POST`}),await S.invalidate())}async function w(){await fetch(`/api/agents/${e.agent.id}/unarchive`,{method:`POST`}),await S.invalidate()}async function T(){let t=`Permanently delete agent "${e.agent.name}"?\n\nThis removes the DB rows (messages, triggers, skill attachments) AND the agent's on-disk directory (memory, templates, state, sessions). This cannot be undone.`;if(!confirm(t))return;let n=await fetch(`/api/teams/${encodeURIComponent(e.team.id)}/policy`);if(!n.ok){alert(`The current Team policy is unavailable. Nothing was deleted.`);return}let r=await n.json(),i=await fetch(`/api/agents/${e.agent.id}?expectedTeamRevision=${r.teamPolicy.revision}`,{method:`DELETE`});i.ok||i.status===204?window.location.assign(`/agents`):alert(`failed: ${i.statusText}`)}return(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`header`,{className:`mb-8`,children:[b.teamPolicy&&(0,f.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,f.jsxs)(`a`,{href:`/teams/${encodeURIComponent(b.teamPolicy)}/policy?view=${b.view??`flow`}&selected=${encodeURIComponent(b.selected??``)}&vx=${b.vx??0}&vy=${b.vy??0}&vz=${b.vz??.9}`,className:`ghost-btn`,children:[(0,f.jsx)(u,{className:`h-4 w-4`}),` back to Team policy`]}),(0,f.jsx)(`span`,{className:`text-xs text-mocha-light`,children:`Returns to the same projection, viewport, and selection.`})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(s,{identity:e.agent.identity,size:44}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h1`,{className:`mb-0`,children:e.agent.name}),(e.agent.identity?.creature||e.agent.identity?.vibe)&&(0,f.jsx)(`p`,{className:`muted mt-0.5 text-sm`,children:[e.agent.identity?.creature,e.agent.identity?.vibe].filter(Boolean).join(` · `)})]})]}),(0,f.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-5 gap-y-2`,children:[(0,f.jsxs)(g,{children:[(0,f.jsx)(`span`,{className:`px-1.5 font-mono text-[0.95em] text-mocha select-all`,children:e.agent.id}),(0,f.jsx)(p,{value:e.agent.id,ariaLabel:`Copy agent UUID`,title:`Copy UUID to clipboard`})]}),(0,f.jsxs)(g,{children:[`status: `,(0,f.jsx)(`span`,{className:`ml-1`,children:e.agent.status})]}),(0,f.jsxs)(g,{children:[`profile: `,(0,f.jsx)(`code`,{className:`ml-1 bg-transparent px-0`,children:e.profile.id})]}),(0,f.jsxs)(g,{children:[`team:`,` `,(0,f.jsx)(`a`,{href:`/teams/${encodeURIComponent(e.team.id)}`,className:`ml-1 bg-transparent px-0 font-mono underline`,children:e.team.id}),` `,`·`,` `,(0,f.jsx)(`a`,{href:`/teams/${encodeURIComponent(e.team.id)}/memory`,className:`ml-0.5 underline`,children:`shared memory →`})]}),(0,f.jsxs)(g,{children:[`model: `,(0,f.jsx)(`code`,{className:`ml-1 bg-transparent px-0`,children:e.model})]}),(0,f.jsxs)(g,{children:[`reasoning:`,` `,(0,f.jsx)(`code`,{className:`ml-1 bg-transparent px-0`,children:e.reasoningLevel})]})]}),(0,f.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[e.agent.status===`archived`?(0,f.jsx)(`button`,{type:`button`,onClick:w,className:`ghost-btn`,children:`unarchive`}):(0,f.jsx)(`button`,{type:`button`,onClick:C,className:`ghost-btn`,children:`archive`}),(0,f.jsx)(`button`,{type:`button`,onClick:T,className:`ghost-btn border-[rgba(196,135,138,0.4)] text-[#9B3D3D] hover:bg-[rgba(196,135,138,0.08)]`,children:`delete permanently`})]}),(0,f.jsx)(_,{agentId:e.agent.id,currentModelOverride:e.agent.modelOverride??null,profileDefaultModel:e.profile.defaultModel,currentReasoning:e.reasoningLevel,modelGroups:d})]}),e.agent.status===`archived`&&(0,f.jsxs)(`div`,{className:`mb-4 rounded-md border border-frost bg-fawn/35 px-4 py-2 text-[0.9em] text-chocolate`,children:[(0,f.jsx)(`strong`,{className:`text-[#7a4e2a]`,children:`This agent is archived.`}),` It's hidden from the default agent list; use `,(0,f.jsx)(`em`,{children:`unarchive`}),` above to bring it back, or`,` `,(0,f.jsx)(`em`,{children:`delete permanently`}),` to remove its data entirely.`]}),(0,f.jsx)(o,{agentId:e.agent.id,active:`chat`,archived:e.agent.status===`archived`}),(0,f.jsx)(h,{children:`Chat`}),(0,f.jsx)(`div`,{className:`h-[70vh]`,children:(0,f.jsx)(c,{agentId:e.agent.id,agentName:e.agent.name,initialMessages:t,initialSessionHead:n})}),(0,f.jsx)(`p`,{className:`mt-2 text-[0.82em] text-mocha-light`,children:`chat history persists in bazilion across navigation and restarts.`}),(0,f.jsxs)(`section`,{className:`mt-10`,children:[(0,f.jsx)(h,{children:`Team`}),(0,f.jsxs)(`p`,{className:`text-[0.9em] text-mocha-light`,children:[`Current team: `,(0,f.jsx)(`code`,{children:e.team.id}),` (`,e.team.name,`) —`,` `,(0,f.jsx)(`code`,{children:e.team.path}),`.`,` `,(0,f.jsx)(`a`,{href:`/teams/${e.team.id}`,children:`view / edit USER.md`})]}),(0,f.jsx)(v,{agentId:e.agent.id,currentTeamId:e.team.id,teams:i})]}),(0,f.jsxs)(`section`,{className:`mt-10`,children:[(0,f.jsx)(h,{children:`Skills`}),(0,f.jsx)(y,{agentId:e.agent.id,attached:new Set(e.skills),all:l})]}),m&&(0,f.jsxs)(`section`,{className:`mt-10`,children:[(0,f.jsx)(h,{children:`Telegram`}),(0,f.jsx)(x,{agent:e.agent})]})]})}function h({children:e}){return(0,f.jsx)(`h3`,{className:`mb-3 font-body text-[0.85em] font-semibold uppercase tracking-wider text-mocha-light`,children:e})}function g({children:e}){return(0,f.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-frost bg-ivory px-3 py-0.5 text-[0.84em] text-mocha-light`,children:e})}function _({agentId:e,currentModelOverride:t,profileDefaultModel:n,currentReasoning:i,modelGroups:a}){let o=r(),[s,c]=(0,d.useState)(t??``),[u,p]=(0,d.useState)(i),[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(null),b=t!==null&&a.some(e=>e.models.some(n=>`${e.provider}:${n}`===t));async function x(t){t.preventDefault(),h(!0),y(null);try{let t=await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({modelOverride:s===``?null:s,reasoningLevel:u})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}_(!0),setTimeout(()=>_(!1),1500),await o.invalidate()}catch(e){y(e.message)}finally{h(!1)}}return(0,f.jsxs)(`details`,{className:`mt-3 text-[0.9em]`,children:[(0,f.jsx)(`summary`,{className:`cursor-pointer text-mocha-light`,children:`settings`}),(0,f.jsxs)(`form`,{onSubmit:x,className:`mt-2 flex flex-wrap items-end gap-3 border-t border-dashed border-frost py-3`,children:[(0,f.jsxs)(`label`,{className:`flex flex-col gap-1 text-[0.85em] text-mocha-light`,children:[`model override`,(0,f.jsxs)(`select`,{name:`modelOverride`,value:s,onChange:e=>c(e.target.value),className:`min-w-[16rem] rounded-sm border border-frost bg-snow px-2 py-1.5`,children:[(0,f.jsxs)(`option`,{value:``,children:[`inherit from profile (`,n,`)`]}),t!==null&&!b&&(0,f.jsxs)(`option`,{value:t,children:[t,` (not in curated list)`]}),a.map(e=>(0,f.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>{let n=`${e.provider}:${t}`;return(0,f.jsx)(`option`,{value:n,children:n},n)})},e.provider))]})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1 text-[0.85em] text-mocha-light`,children:[`reasoning level`,(0,f.jsx)(`select`,{name:`reasoningLevel`,value:u,onChange:e=>p(e.target.value),className:`min-w-[16rem] rounded-sm border border-frost bg-snow px-2 py-1.5`,children:l.map(e=>(0,f.jsx)(`option`,{value:e,children:e},e))})]}),(0,f.jsx)(`button`,{type:`submit`,disabled:m,children:m?`saving…`:`save`}),g&&(0,f.jsx)(`span`,{className:`text-[0.85em] text-[#3b7a3b]`,children:`saved ✓`}),v&&(0,f.jsx)(`span`,{className:`text-[0.85em] text-[#9B3D3D]`,children:v})]})]})}function v({agentId:e,currentTeamId:t,teams:n}){let i=r(),[a,o]=(0,d.useState)(t),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(`profile_defaults`),[p,m]=(0,d.useState)(null),[h,g]=(0,d.useState)(null);async function _(n){if(n.preventDefault(),a!==t){c(!0),m(null);try{let[n,r]=await Promise.all([fetch(`/api/teams/${encodeURIComponent(t)}/policy`),fetch(`/api/teams/${encodeURIComponent(a)}/policy`)]);if(!n.ok||!r.ok)throw Error(`A Team policy is unavailable. Nothing was moved.`);let o=await n.json(),s=await r.json(),c={teamId:a,sourceExpectedRevision:o.teamPolicy.revision,destinationExpectedRevision:s.teamPolicy.revision,placement:l};if(!h){let t=await fetch(`/api/agents/${encodeURIComponent(e)}/team/preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(c)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}g(await t.json());return}let u=await fetch(`/api/agents/${encodeURIComponent(e)}/team`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({...c,sourceExpectedRevision:h.source.currentRevision,destinationExpectedRevision:h.destination.currentRevision})});if(!u.ok){let e=await u.json().catch(()=>null);throw Error(e?.error??u.statusText)}await i.invalidate()}catch(e){m(e.message)}finally{c(!1)}}}return(0,f.jsxs)(`form`,{onSubmit:_,className:`mt-2 flex flex-wrap items-end gap-2`,children:[(0,f.jsxs)(`label`,{className:`flex flex-col gap-1 text-[0.85em] text-mocha-light`,children:[`move to:`,(0,f.jsx)(`select`,{value:a,onChange:e=>{o(e.target.value),g(null)},className:`min-w-[18rem] rounded-sm border border-frost bg-snow px-2 py-1.5`,children:n.map(e=>(0,f.jsxs)(`option`,{value:e.id,children:[e.id,` — `,e.path]},e.id))})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1 text-[0.85em] text-mocha-light`,children:[`destination placement:`,(0,f.jsxs)(`select`,{value:l,onChange:e=>{u(e.target.value),g(null)},className:`rounded-sm border border-frost bg-snow px-2 py-1.5`,children:[(0,f.jsx)(`option`,{value:`profile_defaults`,children:`agent-template defaults`}),(0,f.jsx)(`option`,{value:`isolated`,children:`isolated`}),(0,f.jsx)(`option`,{value:`open`,children:`open`})]})]}),(0,f.jsx)(`button`,{type:`submit`,disabled:s||a===t,children:s?`working…`:h?`commit reviewed move`:`review move`}),p&&(0,f.jsx)(`span`,{className:`text-[0.85em] text-[#9B3D3D]`,children:p}),h&&(0,f.jsxs)(`div`,{className:`basis-full rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,f.jsxs)(`p`,{children:[`Source revision `,h.source.currentRevision,` → `,(0,f.jsx)(`strong`,{children:h.source.resultingRevision}),`, removing `,h.source.removedEdges.length,` incident edges. Destination revision `,h.destination.currentRevision,` → `,(0,f.jsx)(`strong`,{children:h.destination.resultingRevision}),`, adding `,h.destination.addedEdges.length,` edges to `,h.destination.existingEdges.length,` existing edges.`]}),(0,f.jsx)(`p`,{className:`mt-1 muted`,children:h.lineage})]})]})}function y({agentId:e,attached:t,all:n}){let i=r(),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null);async function l(t){let n=t.scanFindings??[];if(n.length===0||confirm(`Skill "${t.name}" has ${n.length} scan finding${n.length===1?``:`s`}. Attach it anyway?`)){o(t.name),c(null);try{let r=await fetch(`/api/agents/${encodeURIComponent(e)}/skills`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({skill:t.name,allowFindings:n.length>0})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??r.statusText)}await i.invalidate()}catch(e){c(e.message)}finally{o(null)}}}async function u(t){o(t),c(null);try{let n=await fetch(`/api/agents/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`,{method:`DELETE`});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}await i.invalidate()}catch(e){c(e.message)}finally{o(null)}}return n.length===0?(0,f.jsx)(`p`,{className:`text-[0.9em] text-mocha-light`,children:`no skills installed`}):(0,f.jsxs)(f.Fragment,{children:[s&&(0,f.jsx)(`p`,{className:`mb-2 text-[0.85em] text-[#9B3D3D]`,children:s}),(0,f.jsxs)(`table`,{children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`name`}),(0,f.jsx)(`th`,{children:`description`}),(0,f.jsx)(`th`,{children:`scan`}),(0,f.jsx)(`th`,{})]})}),(0,f.jsx)(`tbody`,{children:n.map(e=>{let n=t.has(e.name),r=a===e.name;return(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{children:(0,f.jsx)(`code`,{children:e.name})}),(0,f.jsx)(`td`,{children:e.description||(0,f.jsx)(`span`,{className:`text-mocha-light`,children:`—`})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(b,{findings:e.scanFindings??[]})}),(0,f.jsx)(`td`,{children:n?(0,f.jsx)(`button`,{type:`button`,className:`ghost-btn`,disabled:r,onClick:()=>u(e.name),children:r?`…`:`detach`}):(0,f.jsx)(`button`,{type:`button`,className:`ghost-btn`,disabled:r,onClick:()=>l(e),children:r?`…`:`attach`})})]},e.name)})})]})]})}function b({findings:e}){return e.length===0?(0,f.jsx)(`span`,{className:`text-mocha-light`,children:`clean`}):(0,f.jsxs)(`details`,{className:`text-[0.82em]`,children:[(0,f.jsxs)(`summary`,{className:e.some(e=>e.severity===`danger`)?`cursor-pointer text-[#9B3D3D]`:`cursor-pointer text-mocha`,children:[e.length,` finding`,e.length===1?``:`s`]}),(0,f.jsx)(`ul`,{className:`m-0 list-disc pl-4`,children:e.map((e,t)=>(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`span`,{className:`font-mono`,children:e.severity}),`: `,e.code,e.line?` line ${e.line}`:``,` - `,e.message]},`${e.code}-${e.line??0}-${t}`))})]})}function x({agent:e}){let t=r(),[n,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(e.telegramMirrorMode),[l,u]=(0,d.useState)(e.telegramIconEmoji??``),p=e.telegramTopicId!==null;async function m(){i(!0),o(null);try{let n=await fetch(`/api/agents/${encodeURIComponent(e.id)}/telegram/bind`,{method:`POST`});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}let r=await n.json();window.open(r.deepLink,`_blank`,`noopener`),await t.invalidate()}catch(e){o(e.message)}finally{i(!1)}}async function h(){if(confirm(`Unbind this agent from its Telegram topic? The topic stays in Telegram as an orphan.`)){i(!0),o(null);try{let n=await fetch(`/api/agents/${encodeURIComponent(e.id)}/telegram/binding`,{method:`DELETE`});if(!n.ok)throw Error(n.statusText);await t.invalidate()}catch(e){o(e.message)}finally{i(!1)}}}async function g(n){c(n);try{let r=await fetch(`/api/agents/${encodeURIComponent(e.id)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({telegramMirrorMode:n})});if(!r.ok)throw Error(r.statusText);await t.invalidate()}catch(t){c(e.telegramMirrorMode),o(t.message)}}async function _(){o(null);try{let n=await fetch(`/api/agents/${encodeURIComponent(e.id)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({telegramIconEmoji:l.trim()||null})});if(!n.ok)throw Error(n.statusText);await t.invalidate()}catch(e){o(e.message)}}return(0,f.jsxs)(`div`,{className:`text-[0.9em]`,children:[(0,f.jsx)(`div`,{className:`mb-3 flex items-center gap-3`,children:p?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-semibold text-emerald-800`,children:`bound`}),(0,f.jsxs)(`span`,{className:`font-mono text-mocha`,children:[`topic #`,e.telegramTopicId]}),(0,f.jsx)(`button`,{type:`button`,onClick:m,disabled:n,className:`ghost-btn`,title:`Open the topic in Telegram (works on desktop/Android; iOS shows the topic list)`,children:`open in Telegram`}),(0,f.jsx)(`button`,{type:`button`,onClick:h,disabled:n,className:`ghost-btn border-[rgba(196,135,138,0.4)] text-[#9B3D3D] hover:bg-[rgba(196,135,138,0.08)]`,children:`unbind`})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`rounded-full bg-amber-100 px-2 py-0.5 text-xs font-semibold text-amber-800`,children:`unbound`}),(0,f.jsx)(`button`,{type:`button`,onClick:m,disabled:n,className:`ghost-btn`,title:`Create a Telegram topic for this agent`,children:n?`binding…`:`bind a topic`})]})}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`label`,{htmlFor:`mirror-mode`,className:`text-mocha-light`,children:`mirror mode:`}),(0,f.jsxs)(`select`,{id:`mirror-mode`,value:s,onChange:e=>void g(e.target.value),className:`rounded-md border bg-background px-2 py-1 font-mono text-sm`,disabled:n,children:[(0,f.jsx)(`option`,{value:`minimal`,children:`minimal — assistant messages only`}),(0,f.jsx)(`option`,{value:`verbose`,children:`verbose — also tool calls`})]})]}),(0,f.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,f.jsx)(`label`,{htmlFor:`topic-icon`,className:`text-mocha-light`,children:`topic icon:`}),(0,f.jsx)(`input`,{id:`topic-icon`,value:l,onChange:e=>u(e.target.value),placeholder:`(profile default)`,maxLength:8,className:`w-32 rounded-md border bg-background px-2 py-1 font-mono text-sm`,disabled:n}),(0,f.jsx)(`button`,{type:`button`,onClick:()=>void _(),disabled:n||l===(e.telegramIconEmoji??``),className:`ghost-btn`,children:`save icon`})]}),a&&(0,f.jsx)(`p`,{className:`mt-2 text-sm text-rose-700`,children:a}),(0,f.jsx)(`p`,{className:`mt-3 text-[0.85em] text-mocha-light`,children:`When bound, every assistant turn for this agent gets mirrored to the topic. Typing in the topic triggers a new turn. iOS Telegram clients have a known limitation that prevents inline link deep-links from opening directly into a topic — bound state is still functional; navigate via the topic list manually.`})]})}export{m as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{t}from"./RecoveryState-QfMSuwy3.js";var n=e(),r=({error:e,reset:r})=>(0,n.jsx)(t,{title:`Team template unavailable`,error:e,reset:r,fallbackHref:`/templates/teams`});export{r as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n,d as r}from"./preload-helper-eOOCz1Fu.js";import{t as i}from"./ProfileCommunicationEditor-D1OZ8WE5.js";import{t as a}from"./index-BCXoh1c8.js";import{t as o}from"./team-policy-BdX340m4.js";var s=e(n()),c=t();function l(){let{loaded:e,modelGroups:t,skills:n}=a.useLoaderData(),[r,i]=(0,s.useState)(`basics`);return(0,c.jsxs)(`div`,{children:[(0,c.jsxs)(`header`,{className:`mb-1`,children:[(0,c.jsx)(`a`,{href:`/templates/agents`,className:`mb-1 inline-block text-[0.85em] text-mocha-light hover:text-sapphire`,children:`← agent templates`}),(0,c.jsx)(`h1`,{children:e.profile.name}),(0,c.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[0.9em] text-mocha-light`,children:[(0,c.jsx)(`code`,{children:e.profile.id}),(0,c.jsx)(`span`,{children:`·`}),(0,c.jsxs)(`span`,{children:[`model: `,(0,c.jsx)(`code`,{children:e.profile.defaultModel})]})]})]}),(0,c.jsxs)(`p`,{className:`muted my-6`,children:[`These settings and files seed every agent spawned from this Agent template going forward.`,` `,(0,c.jsx)(`strong`,{children:`Existing agents keep their own copies`}),` — edits here don't propagate to already-spawned agents.`]}),(0,c.jsx)(d,{items:[{id:`basics`,label:`1. basics`},{id:`skills`,label:`2. skills`},{id:`communication`,label:`3. communication`}],active:r,onChange:e=>i(e)}),r===`basics`&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(g,{profileId:e.profile.id,initialName:e.profile.name,currentModel:e.profile.defaultModel,modelGroups:t}),(0,c.jsx)(m,{profileId:e.profile.id,file:`SOUL.md`,initialContent:e.files.soul,rows:14}),(0,c.jsx)(m,{profileId:e.profile.id,file:`IDENTITY.md`,initialContent:e.files.identity,rows:10}),e.files.bootstrap===null?(0,c.jsxs)(`section`,{className:`file-card`,children:[(0,c.jsx)(`div`,{className:`file-head`,children:(0,c.jsx)(`h3`,{children:`BOOTSTRAP.md`})}),(0,c.jsx)(`p`,{className:`muted`,children:`This profile was created without a bootstrap prompt. Spawned agents won't see a first-run intro message.`})]}):(0,c.jsx)(m,{profileId:e.profile.id,file:`BOOTSTRAP.md`,initialContent:e.files.bootstrap,rows:10}),(0,c.jsx)(h,{profileId:e.profile.id,file:`AGENTS.md`,initialContent:e.files.agents,hint:`Peers and routing notes — who this agent can hand off to.`}),(0,c.jsx)(h,{profileId:e.profile.id,file:`TOOLS.md`,initialContent:e.files.tools,hint:`Tool playbook. Agent-specific usage notes that go beyond the generic tool descriptions.`}),(0,c.jsx)(h,{profileId:e.profile.id,file:`HEARTBEAT.md`,initialContent:e.files.heartbeat,hint:`Tasks the agent should check on scheduled wake-ups. Pair with a trigger whose message is the canned heartbeat prompt.`})]}),r===`skills`&&(0,c.jsx)(_,{profileId:e.profile.id,initialMode:e.profile.skillsMode,initialPicked:new Set(e.defaultSkills),skills:n}),r===`communication`&&(0,c.jsx)(u,{profileId:e.profile.id,initial:e.profile.communicationDefaults??o})]})}function u({profileId:e,initial:t}){let[n,r]=(0,s.useState)(t),[a,o]=(0,s.useState)(null),l=JSON.stringify(n)!==JSON.stringify(t);return(0,c.jsxs)(`section`,{className:`rounded-md border border-frost bg-snow p-5 shadow-baziu-sm`,children:[(0,c.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:(0,c.jsx)(`h3`,{className:`m-0 font-body text-[0.95rem] font-semibold normal-case text-chocolate`,children:`Communication defaults`})}),(0,c.jsx)(`p`,{className:`muted mb-4`,children:`Materialized into new Team and Team policy snapshots after preset resolution. Existing snapshots never inherit later changes. Stored by the daemon.`}),(0,c.jsx)(i,{value:n,onChange:r}),(0,c.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,c.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:!l,onClick:async()=>{let t=await fetch(`/api/profiles/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({communicationDefaults:n})});if(!t.ok)throw Error((await t.json().catch(()=>null))?.error??t.statusText);o(Date.now())},children:`save communication defaults`}),a&&(0,c.jsx)(`span`,{className:`text-xs text-sapphire`,children:`saved to daemon`})]})]})}function d({items:e,active:t,onChange:n}){return(0,c.jsx)(`nav`,{role:`tablist`,className:`-mb-px mb-5 flex gap-1 border-b border-frost`,children:e.map(e=>(0,c.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===e.id,onClick:()=>n(e.id),className:`unstyled cursor-pointer border-b-2 bg-transparent px-4 py-2 text-[0.9em] font-medium transition-colors ${t===e.id?`border-sapphire text-sapphire`:`border-transparent text-mocha hover:text-sapphire`}`,children:e.label},e.id))})}function f(e){return e===`saved`?`text-sapphire`:e===`error`?`text-[#9B3D3D]`:e===`dirty`?`text-mocha`:`text-mocha-light`}function p({title:e,status:t,children:n}){return(0,c.jsxs)(`section`,{className:`file-card mb-5 rounded-[16px] border border-frost bg-snow p-5 shadow-baziu-sm`,children:[(0,c.jsxs)(`div`,{className:`mb-2 flex items-baseline justify-between`,children:[(0,c.jsx)(`h3`,{className:`m-0 font-mono text-[0.95em] font-semibold normal-case tracking-normal text-chocolate`,children:e}),t&&(0,c.jsx)(`span`,{className:`text-[0.82em] ${f(t.kind)}`,children:t.message})]}),n]})}function m({profileId:e,file:t,initialContent:n,rows:r=10}){let[i,a]=(0,s.useState)(n),[o,l]=(0,s.useState)(n),[u,d]=(0,s.useState)({kind:`idle`,message:``}),f=o!==i&&u.kind!==`saving`&&u.kind!==`error`?{kind:`dirty`,message:`unsaved changes`}:u;async function m(){d({kind:`saving`,message:`saving…`});try{let n=await fetch(`/api/profiles/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({content:o})});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}a(o),d({kind:`saved`,message:`saved`})}catch(e){d({kind:`error`,message:`error: ${e.message}`})}}function h(){l(i),d({kind:`idle`,message:``})}return(0,c.jsxs)(p,{title:t,status:f,children:[(0,c.jsx)(`textarea`,{rows:r,value:o,onChange:e=>l(e.target.value),className:`font-mono text-[0.88em] leading-[1.55]`}),(0,c.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,c.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:m,disabled:u.kind===`saving`,children:`save`}),(0,c.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:h,children:`revert`})]})]})}function h({profileId:e,file:t,initialContent:n,hint:i}){let a=r(),[o,l]=(0,s.useState)(!1),[u,d]=(0,s.useState)({kind:`idle`,message:``});async function f(){l(!0),d({kind:`saving`,message:`creating…`});try{let n=await fetch(`/api/profiles/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({content:``})});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}await a.invalidate()}catch(e){d({kind:`error`,message:`error: ${e.message}`}),l(!1)}}return n===null?(0,c.jsxs)(p,{title:t,status:u,children:[(0,c.jsx)(`p`,{className:`muted my-1`,children:i}),(0,c.jsx)(`div`,{className:`mt-3 flex gap-2`,children:(0,c.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:f,disabled:o,children:o?`creating…`:`create empty`})})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`p`,{className:`muted -mb-3 ml-1 mt-2 text-[0.85em]`,children:i}),(0,c.jsx)(m,{profileId:e,file:t,initialContent:n,rows:10})]})}function g({profileId:e,initialName:t,currentModel:n,modelGroups:i}){let a=r(),[o,l]=(0,s.useState)(t),[u,d]=(0,s.useState)(n),[f,m]=(0,s.useState)({kind:`idle`,message:``}),h=!i.flatMap(e=>e.models.map(t=>`${e.provider}:${t}`)).includes(n);async function g(t){t.preventDefault(),m({kind:`saving`,message:`saving…`});try{let t=await fetch(`/api/profiles/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({name:o.trim(),defaultModel:u.trim()})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}await a.invalidate(),m({kind:`saved`,message:`saved`})}catch(e){m({kind:`error`,message:`error: ${e.message}`})}}return(0,c.jsx)(p,{title:`settings`,status:f,children:(0,c.jsxs)(`form`,{onSubmit:g,children:[(0,c.jsxs)(`div`,{className:`flex gap-4`,children:[(0,c.jsxs)(`label`,{className:`flex-1`,children:[`name`,(0,c.jsx)(`input`,{value:o,onChange:e=>l(e.target.value)})]}),(0,c.jsxs)(`label`,{className:`flex-1`,children:[`default model`,i.length===0?(0,c.jsx)(`select`,{disabled:!0,children:(0,c.jsx)(`option`,{children:`(no models available — enable on /config)`})}):(0,c.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),children:[h&&(0,c.jsxs)(`option`,{value:n,children:[n,` (not in enabled list)`]}),i.map(e=>(0,c.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>(0,c.jsx)(`option`,{value:`${e.provider}:${t}`,children:`${e.provider}:${t}`},t))},e.provider))]})]})]}),(0,c.jsx)(`div`,{className:`mt-3 flex gap-2`,children:(0,c.jsx)(`button`,{type:`submit`,disabled:f.kind===`saving`,children:`save settings`})})]})})}function _({profileId:e,initialMode:t,initialPicked:n,skills:i}){let a=r(),[o,l]=(0,s.useState)(t),[u,d]=(0,s.useState)(n),[f,m]=(0,s.useState)({kind:`idle`,message:``});function h(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function g(t){t.preventDefault(),m({kind:`saving`,message:`saving…`});try{let t=await fetch(`/api/profiles/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({skillsMode:o,defaultSkills:o===`selected`?Array.from(u):[]})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}await a.invalidate(),m({kind:`saved`,message:`saved`})}catch(e){m({kind:`error`,message:`error: ${e.message}`})}}return(0,c.jsxs)(p,{title:`skills`,status:f,children:[(0,c.jsx)(`p`,{className:`muted my-2`,children:`Choose what agents spawned from this profile inherit. Existing agents aren't affected — they keep whatever skills they were spawned with.`}),(0,c.jsxs)(`form`,{onSubmit:g,children:[(0,c.jsxs)(`label`,{className:`my-2 flex cursor-pointer items-start gap-2`,children:[(0,c.jsx)(`input`,{type:`radio`,checked:o===`all`,onChange:()=>l(`all`)}),(0,c.jsxs)(`span`,{children:[(0,c.jsx)(`strong`,{children:`allow all skills`}),` — every skill on disk is attached at spawn.`]})]}),(0,c.jsxs)(`label`,{className:`my-2 flex cursor-pointer items-start gap-2`,children:[(0,c.jsx)(`input`,{type:`radio`,checked:o===`selected`,onChange:()=>l(`selected`)}),(0,c.jsxs)(`span`,{children:[(0,c.jsx)(`strong`,{children:`select skills`}),` — attach only the ones ticked below.`]})]}),(0,c.jsx)(`div`,{className:`mt-3 max-h-[22rem] overflow-y-auto rounded-md border border-frost p-3 ${o===`all`?`pointer-events-none opacity-50`:``}`,children:i.length===0?(0,c.jsxs)(`p`,{className:`muted`,children:[`No skills installed yet. Import some on `,(0,c.jsx)(`a`,{href:`/skills`,children:`/skills`}),`.`]}):i.map(e=>(0,c.jsxs)(`label`,{className:`my-1.5 flex cursor-pointer items-start gap-2`,children:[(0,c.jsx)(`input`,{type:`checkbox`,checked:u.has(e.name),onChange:()=>h(e.name)}),(0,c.jsxs)(`span`,{children:[(0,c.jsx)(`code`,{children:e.name}),e.description&&(0,c.jsxs)(`span`,{className:`text-[0.9em] text-mocha-light`,children:[` — `,e.description]})]})]},e.name))}),(0,c.jsx)(`div`,{className:`mt-3 flex gap-2`,children:(0,c.jsx)(`button`,{type:`submit`,disabled:f.kind===`saving`,children:`save skills`})})]})]})}export{l as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{t}from"./RecoveryState-QfMSuwy3.js";var n=e(),r=({error:e,reset:r})=>(0,n.jsx)(t,{title:`Policy activity unavailable`,error:e,reset:r,fallbackHref:`/teams`});export{r as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n}from"./preload-helper-eOOCz1Fu.js";import{T as r,o as i}from"./index-BCXoh1c8.js";import{t as a}from"./Button-ByiV6fpd.js";import{t as o}from"./TeamTabs-BViZ4sti.js";var s=r(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),c=e(n()),l=t();function u(){let e=i.useLoaderData(),{id:t}=i.useParams(),[n,r]=(0,c.useState)(e),[s,u]=(0,c.useState)(!1),[f,p]=(0,c.useState)(null);return(0,l.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{children:`blocked communication`}),(0,l.jsx)(`p`,{className:`muted`,children:`Durable denial evidence. Diagnostic simulations never create these records.`})]}),(0,l.jsx)(o,{teamId:t}),(0,l.jsxs)(`div`,{className:`space-y-3`,children:[n.blocks.map(e=>(0,l.jsx)(d,{block:e},e.id)),n.blocks.length===0&&(0,l.jsx)(`p`,{className:`card muted`,children:`No blocked communication has been recorded for this team.`})]}),f&&(0,l.jsx)(`p`,{role:`alert`,className:`err`,children:f}),n.nextCursor&&(0,l.jsx)(a,{variant:`ghost`,disabled:s,onClick:async()=>{if(n.nextCursor){u(!0),p(null);try{let e=await fetch(`/api/teams/${encodeURIComponent(t)}/policy/blocks?limit=25&cursor=${encodeURIComponent(n.nextCursor)}`);if(!e.ok)throw Error(`Could not load activity (${e.status})`);let i=await e.json();r({blocks:[...n.blocks,...i.blocks],nextCursor:i.nextCursor})}catch(e){p(e instanceof Error?e.message:String(e))}finally{u(!1)}}},children:s?`Loading…`:`Load older evidence`})]})}function d({block:e}){return(0,l.jsxs)(`details`,{className:`card team`,children:[(0,l.jsxs)(`summary`,{className:`flex cursor-pointer list-none flex-wrap items-center gap-2`,children:[(0,l.jsx)(`strong`,{className:`mr-auto break-all`,children:e.reason_code}),(0,l.jsx)(`time`,{className:`text-xs text-mocha-light`,children:new Date(e.created_at).toLocaleString()}),(0,l.jsx)(s,{className:`h-4 w-4 transition-transform team-open:rotate-180`})]}),(0,l.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,l.jsx)(f,{label:`Path`,value:`${p(e.source_kind,e.source_id)} → ${p(e.target_kind,e.target_id)}`}),(0,l.jsx)(f,{label:`Channel / origin`,value:`${e.channel} · ${e.origin}`}),(0,l.jsx)(f,{label:`Operation`,value:e.operation}),(0,l.jsx)(f,{label:`Attempt identity`,value:`${e.attempt_kind}:${e.attempt_id}`,code:!0}),(0,l.jsx)(f,{label:`Reason`,value:e.reason,wide:!0})]}),(0,l.jsx)(`h3`,{className:`mt-5 text-sm`,children:`Policy revisions`}),(0,l.jsx)(`ul`,{className:`mt-2 text-sm`,children:e.policyRefs.map(e=>(0,l.jsxs)(`li`,{children:[(0,l.jsx)(`code`,{children:e.teamId}),` revision `,e.revision]},`${e.teamId}:${e.revision}`))}),e.componentOutcomes.length>1&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`h3`,{className:`mt-5 text-sm`,children:`Cross-Team consent components`}),(0,l.jsx)(`div`,{className:`mt-2 overflow-x-auto`,children:(0,l.jsxs)(`table`,{children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{children:`Team`}),(0,l.jsx)(`th`,{children:`Required edge`}),(0,l.jsx)(`th`,{children:`Matched`})]})}),(0,l.jsx)(`tbody`,{children:e.componentOutcomes.map(e=>(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`td`,{children:(0,l.jsx)(`code`,{children:e.teamId})}),(0,l.jsx)(`td`,{className:`break-all`,children:(0,l.jsx)(`code`,{children:e.edge})}),(0,l.jsx)(`td`,{children:e.matched?`yes`:`no`})]},`${e.teamId}:${e.edge}`))})]})})]}),(0,l.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,l.jsx)(f,{label:`Required edges`,value:e.requiredEdgeIds.join(`, `)||`none`,code:!0}),(0,l.jsx)(f,{label:`Matched edges`,value:e.matchedEdgeIds.join(`, `)||`none`,code:!0})]})]})}function f({label:e,value:t,code:n=!1,wide:r=!1}){return(0,l.jsxs)(`div`,{className:r?`sm:col-span-2`:``,children:[(0,l.jsx)(`dt`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:e}),(0,l.jsx)(`dd`,{className:`mt-1 break-words`,children:n?(0,l.jsx)(`code`,{className:`break-all`,children:t}):t})]})}function p(e,t){return t?`${e}:${t}`:e}export{u as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n,d as r}from"./preload-helper-eOOCz1Fu.js";import{v as i}from"./index-BCXoh1c8.js";import{t as a}from"./AgentAvatar-JYijLvZ2.js";var o=e(n()),s=t();function c(){let{agents:e,profiles:t,teams:n,modelGroups:o}=i.useLoaderData(),{all:c}=i.useSearch(),u=c===`1`,d=r();async function f(e){confirm(`archive this agent? (reversible)`)&&(await fetch(`/api/agents/${e}/archive`,{method:`POST`}),await d.invalidate())}async function p(e){await fetch(`/api/agents/${e}/unarchive`,{method:`POST`}),await d.invalidate()}async function m(t){if(!confirm(`permanently delete this agent and all its data?`))return;let n=e.find(e=>e.id===t);if(!n)return;let r=await fetch(`/api/teams/${encodeURIComponent(n.teamId)}/policy`);if(!r.ok)return;let i=await r.json();await fetch(`/api/agents/${encodeURIComponent(t)}?expectedTeamRevision=${i.teamPolicy.revision}`,{method:`DELETE`}),await d.invalidate()}return(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{children:`agents`}),(0,s.jsx)(l,{profiles:t,teams:n,modelGroups:o,onSpawned:d.invalidate}),(0,s.jsx)(`p`,{children:(0,s.jsx)(`a`,{href:u?`/agents`:`/agents?all=1`,children:u?`hide archived`:`show archived`})}),(0,s.jsxs)(`table`,{children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{children:`id`}),(0,s.jsx)(`th`,{children:`name`}),(0,s.jsx)(`th`,{children:`profile`}),(0,s.jsx)(`th`,{children:`status`}),(0,s.jsx)(`th`,{})]})}),(0,s.jsxs)(`tbody`,{children:[e.length===0&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:5,className:`muted`,children:`no agents yet`})}),e.map(e=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{children:(0,s.jsx)(`a`,{href:`/agents/${e.id}`,title:e.id,children:(0,s.jsxs)(`code`,{children:[e.id.slice(0,8),`…`]})})}),(0,s.jsx)(`td`,{children:(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(a,{identity:e.identity,size:26}),(0,s.jsxs)(`div`,{className:`leading-tight`,children:[(0,s.jsx)(`div`,{children:e.name}),(e.identity?.creature||e.identity?.vibe)&&(0,s.jsx)(`div`,{className:`muted text-[0.8em]`,children:[e.identity?.creature,e.identity?.vibe].filter(Boolean).join(` · `)})]})]})}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`code`,{children:e.profileId})}),(0,s.jsx)(`td`,{children:e.status}),(0,s.jsx)(`td`,{children:(0,s.jsxs)(`div`,{className:`flex gap-1.5`,children:[e.status===`archived`?(0,s.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:()=>p(e.id),children:`unarchive`}):(0,s.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:()=>f(e.id),children:`archive`}),(0,s.jsx)(`button`,{type:`button`,className:`ghost-btn`,style:{color:`var(--color-rose-baziu)`},onClick:()=>m(e.id),children:`delete`})]})})]},e.id))]})]})]})}function l({profiles:e,teams:t,modelGroups:n,onSpawned:r}){let[i,a]=(0,o.useState)(``),[c,l]=(0,o.useState)(``),[u,d]=(0,o.useState)(``),[f,p]=(0,o.useState)(t.find(e=>e.id==="default")?.id??``),[m,h]=(0,o.useState)(`profile_defaults`),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(null);async function b(e){if(e.preventDefault(),!i){y(`profile is required`);return}_(!0),y(null);try{let e={profile:i};if(c&&(e.name=c),u&&(e.model=u),f){let t=await fetch(`/api/teams/${encodeURIComponent(f)}/policy`);if(!t.ok)throw Error(`The selected Team policy is unavailable.`);let n=await t.json();e.teamId=f,e.teamExpectedRevision=n.teamPolicy.revision,e.placement=m}let t=await fetch(`/api/agents`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}await t.json(),l(``),d(``),r()}catch(e){y(e.message)}finally{_(!1)}}return(0,s.jsxs)(`form`,{className:`card`,onSubmit:b,children:[(0,s.jsx)(`h3`,{children:`spawn agent`}),v&&(0,s.jsx)(`div`,{className:`err`,children:v}),(0,s.jsx)(`p`,{className:`muted my-2 text-[0.85em]`,children:`Skills come from the profile's defaults at spawn time. Tweak per-agent skills after the fact from the agent detail page.`}),(0,s.jsxs)(`div`,{className:`flex gap-4`,children:[(0,s.jsxs)(`label`,{className:`flex-1`,children:[`profile`,(0,s.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),required:!0,children:[(0,s.jsx)(`option`,{value:``,children:`--`}),e.map(e=>(0,s.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),(0,s.jsxs)(`label`,{className:`flex-1`,children:[`name`,(0,s.jsx)(`input`,{value:c,onChange:e=>l(e.target.value)})]})]}),(0,s.jsxs)(`label`,{children:[`model override`,n.length===0?(0,s.jsx)(`input`,{value:``,disabled:!0,placeholder:`(uses profile default — enable models on /config)`}):(0,s.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),children:[(0,s.jsx)(`option`,{value:``,children:`(uses profile default)`}),n.map(e=>(0,s.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>(0,s.jsx)(`option`,{value:`${e.provider}:${t}`,children:`${e.provider}:${t}`},t))},e.provider))]})]}),(0,s.jsxs)(`label`,{children:[`team`,t.length===0?(0,s.jsx)(`select`,{disabled:!0,children:(0,s.jsx)(`option`,{children:`(no teams — register one on /teams)`})}):(0,s.jsx)(`select`,{value:f,onChange:e=>p(e.target.value),children:t.map(e=>(0,s.jsxs)(`option`,{value:e.id,children:[e.id,` (`,e.name,`)`]},e.id))})]}),(0,s.jsxs)(`label`,{children:[`initial policy placement`,(0,s.jsxs)(`select`,{value:m,onChange:e=>h(e.target.value),children:[(0,s.jsx)(`option`,{value:`profile_defaults`,children:`agent-template defaults`}),(0,s.jsx)(`option`,{value:`isolated`,children:`isolated`}),(0,s.jsx)(`option`,{value:`open`,children:`open to current members and boundaries`})]}),(0,s.jsx)(`span`,{className:`muted mt-1 block text-xs`,children:`Submit uses the latest displayed Team revision; a concurrent policy change is shown as a conflict and never overwritten.`})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:g,children:g?`spawning…`:`spawn`})]})}export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n,d as r}from"./preload-helper-eOOCz1Fu.js";import{t as i}from"./ProfileCommunicationEditor-D1OZ8WE5.js";import{p as a}from"./index-BCXoh1c8.js";import{t as o}from"./Button-ByiV6fpd.js";import{t as s}from"./team-policy-BdX340m4.js";import{t as c}from"./TemplatesTabs-DVcY9pMD.js";var l=e(n()),u=t();function d(){let{profiles:e,modelGroups:t,skills:n,templates:i}=a.useLoaderData(),s=r();async function l(e){if(!confirm(`delete profile and all its files?`))return;let t=await fetch(`/api/profiles/${e}`,{method:`DELETE`});if(!t.ok&&t.status!==204){let e=await t.json().catch(()=>null);alert(e?.error??t.statusText);return}await s.invalidate()}return(0,u.jsxs)(`div`,{children:[(0,u.jsx)(c,{}),(0,u.jsx)(`h1`,{children:`agent templates`}),(0,u.jsx)(`p`,{className:`muted`,children:`An agent template is a spawn template — SOUL/IDENTITY templates, a default model, a skills policy. Agents choose a Team at spawn time, independent of their Agent template.`}),(0,u.jsx)(f,{modelGroups:t,skills:n,templates:i,onCreated:()=>s.invalidate()}),(0,u.jsxs)(`table`,{children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`id`}),(0,u.jsx)(`th`,{children:`name`}),(0,u.jsx)(`th`,{children:`model`}),(0,u.jsx)(`th`,{children:`agents`}),(0,u.jsx)(`th`,{children:`skills`}),(0,u.jsx)(`th`,{})]})}),(0,u.jsxs)(`tbody`,{children:[e.length===0&&(0,u.jsx)(`tr`,{children:(0,u.jsx)(`td`,{colSpan:6,className:`muted`,children:`no agent templates yet`})}),e.map(e=>{let t=e.skillsMode===`all`?`all`:e.defaultSkills.length===0?`—`:e.defaultSkills.join(`, `);return(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsx)(`a`,{href:`/templates/agents/${e.id}`,children:(0,u.jsx)(`code`,{children:e.id})})}),(0,u.jsx)(`td`,{children:e.name}),(0,u.jsx)(`td`,{children:(0,u.jsx)(`code`,{children:e.defaultModel})}),(0,u.jsx)(`td`,{children:e.agentCount}),(0,u.jsx)(`td`,{className:`text-xs text-mocha-light`,children:t}),(0,u.jsx)(`td`,{children:e.agentCount===0?(0,u.jsx)(o,{variant:`danger`,onClick:()=>l(e.id),children:`delete`}):(0,u.jsx)(`span`,{className:`muted`,title:`${e.agentCount} agent(s) use this profile`,children:`in use`})})]},e.id)})]})]})]})}function f({modelGroups:e,skills:t,templates:n,onCreated:r}){let[a,c]=(0,l.useState)(`basics`),[d,f]=(0,l.useState)(``),[h,g]=(0,l.useState)(``),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(n.soul),[x,S]=(0,l.useState)(n.identity),[C,w]=(0,l.useState)(n.bootstrap),[T,E]=(0,l.useState)(!0),[D,O]=(0,l.useState)(n.agents),[k,A]=(0,l.useState)(!0),[j,M]=(0,l.useState)(n.tools),[N,P]=(0,l.useState)(!0),[F,I]=(0,l.useState)(n.heartbeat),[L,R]=(0,l.useState)(!1);function z(e,t,n){t(n),!n&&a===e&&c(`basics`)}let[B,V]=(0,l.useState)(`all`),[H,U]=(0,l.useState)(s),[W,G]=(0,l.useState)(new Set),[K,q]=(0,l.useState)(null),[J,Y]=(0,l.useState)(!1);function X(e){G(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function Z(e){if(e.preventDefault(),q(null),!d.trim()){q(`id is required`);return}if(!_.trim()){q(`default model is required`);return}Y(!0);try{let e={id:d.trim(),name:h.trim()||void 0,model:_.trim(),skillsMode:B,defaultSkills:B===`selected`?Array.from(W):[],soul:y,identity:x,bootstrap:T?C:null,agents:k?D:null,tools:N?j:null,heartbeat:L?F:null,communicationDefaults:H},t=await fetch(`/api/profiles`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}f(``),g(``),v(``),E(!0),O(n.agents),A(!0),M(n.tools),P(!0),I(n.heartbeat),R(!1),G(new Set),V(`all`),U(s),c(`basics`),r()}catch(e){q(e.message)}finally{Y(!1)}}return(0,u.jsxs)(`form`,{className:`card`,onSubmit:Z,children:[(0,u.jsx)(`h3`,{children:`create agent template`}),K&&(0,u.jsx)(`div`,{className:`err`,children:K}),(0,u.jsx)(p,{items:[{id:`basics`,label:`basics`},{id:`soul`,label:`SOUL`},{id:`identity`,label:`IDENTITY`},{id:`bootstrap`,label:`BOOTSTRAP`,disabled:!T},{id:`agents`,label:`AGENTS`,disabled:!k},{id:`tools`,label:`TOOLS`,disabled:!N},{id:`heartbeat`,label:`HEARTBEAT`,disabled:!L},{id:`skills`,label:`skills`},{id:`communication`,label:`communication`}],active:a,onChange:e=>c(e)}),(0,u.jsxs)(`fieldset`,{className:`mb-5 rounded-md border border-frost p-3`,children:[(0,u.jsx)(`legend`,{className:`px-1 text-[0.85em] font-medium text-mocha`,children:`templates to include`}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2 text-[0.9em]`,children:[(0,u.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 opacity-60`,title:`always included`,children:[(0,u.jsx)(`input`,{type:`checkbox`,defaultChecked:!0,disabled:!0}),` SOUL.md`]}),(0,u.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 opacity-60`,title:`always included`,children:[(0,u.jsx)(`input`,{type:`checkbox`,defaultChecked:!0,disabled:!0}),` IDENTITY.md`]}),(0,u.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>z(`bootstrap`,E,e.target.checked)}),`BOOTSTRAP.md`]}),(0,u.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>z(`agents`,A,e.target.checked)}),`AGENTS.md`]}),(0,u.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:N,onChange:e=>z(`tools`,P,e.target.checked)}),`TOOLS.md`]}),(0,u.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:L,onChange:e=>z(`heartbeat`,R,e.target.checked)}),`HEARTBEAT.md`]})]}),(0,u.jsx)(`p`,{className:`muted mt-2 text-[0.8em]`,children:`Disabled files aren't created for this Agent template. Each spawned agent gets its own copy of the enabled files at spawn time.`})]}),a===`basics`&&(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`flex gap-4`,children:[(0,u.jsxs)(`label`,{className:`flex-1`,children:[`id (slug)`,(0,u.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),required:!0})]}),(0,u.jsxs)(`label`,{className:`flex-1`,children:[`name`,(0,u.jsx)(`input`,{value:h,onChange:e=>g(e.target.value)})]})]}),(0,u.jsxs)(`label`,{children:[`default model`,e.length===0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`select`,{disabled:!0,children:(0,u.jsx)(`option`,{children:`(no models available)`})}),(0,u.jsxs)(`span`,{className:`muted text-[0.85em]`,children:[`Enable a provider and curate models on `,(0,u.jsx)(`a`,{href:`/config`,children:`/config`}),` first.`]})]}):(0,u.jsxs)(`select`,{value:_,onChange:e=>v(e.target.value),required:!0,children:[(0,u.jsx)(`option`,{value:``,children:`-- pick a model --`}),e.map(e=>(0,u.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>(0,u.jsx)(`option`,{value:`${e.provider}:${t}`,children:`${e.provider}:${t}`},t))},e.provider))]})]})]}),a===`soul`&&(0,u.jsx)(m,{label:`SOUL.md`,hint:`Persona, values, and operating principles. Injected into every session.`,value:y,onChange:b,rows:16}),a===`identity`&&(0,u.jsx)(m,{label:`IDENTITY.md`,hint:`Name, creature, vibe, emoji, avatar — filled in during the bootstrap ritual.`,value:x,onChange:S,rows:12}),a===`bootstrap`&&(0,u.jsx)(m,{label:`BOOTSTRAP.md`,hint:`One-time first-run ritual. The agent retires it once introductions are done.`,value:C,onChange:w,rows:16}),a===`agents`&&(0,u.jsx)(m,{label:`AGENTS.md`,hint:`The workspace operating manual — memory discipline, red lines, channel etiquette.`,value:D,onChange:O,rows:16}),a===`tools`&&(0,u.jsx)(m,{label:`TOOLS.md`,hint:`Agent-specific tool notes and environment facts beyond the generic tool descriptions.`,value:j,onChange:M,rows:14}),a===`heartbeat`&&(0,u.jsx)(m,{label:`HEARTBEAT.md`,hint:`Optional checklist run on scheduled wake-ups. Pair with an interval/cron trigger.`,value:F,onChange:I,rows:12}),a===`skills`&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`muted my-2`,children:`Choose which skills agents inherit at spawn time. In both modes each agent can still attach or detach skills individually after it's spawned.`}),(0,u.jsxs)(`label`,{className:`flex items-start gap-2 my-2 cursor-pointer`,children:[(0,u.jsx)(`input`,{type:`radio`,name:`skillsMode`,value:`all`,checked:B===`all`,onChange:()=>V(`all`)}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`allow all skills`}),` — every skill on disk is attached when an agent is spawned.`]})]}),(0,u.jsxs)(`label`,{className:`flex items-start gap-2 my-2 cursor-pointer`,children:[(0,u.jsx)(`input`,{type:`radio`,name:`skillsMode`,value:`selected`,checked:B===`selected`,onChange:()=>V(`selected`)}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`select skills`}),` — attach only the ones you pick below.`]})]}),(0,u.jsx)(`div`,{className:`mt-3 max-h-[22rem] overflow-y-auto rounded-md border border-frost p-3 ${B===`all`?`opacity-50 pointer-events-none`:``}`,children:t.length===0?(0,u.jsxs)(`p`,{className:`muted`,children:[`No skills installed yet. Import some on `,(0,u.jsx)(`a`,{href:`/skills`,children:`/skills`}),`.`]}):t.map(e=>(0,u.jsxs)(`label`,{className:`my-1.5 flex cursor-pointer items-start gap-2`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:W.has(e.name),onChange:()=>X(e.name)}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`code`,{children:e.name}),e.description&&(0,u.jsxs)(`span`,{className:`text-[0.9em] text-mocha-light`,children:[` — `,e.description]})]})]},e.name))})]}),a===`communication`&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`mb-3 flex items-center gap-2`,children:(0,u.jsx)(`h4`,{className:`text-sm font-semibold text-chocolate`,children:`Communication defaults`})}),(0,u.jsx)(`p`,{className:`muted mb-4`,children:`Materialized when a Team or live policy snapshot is created. Existing snapshots never inherit later changes.`}),(0,u.jsx)(i,{value:H,onChange:U})]}),(0,u.jsx)(`div`,{className:`mt-5 flex gap-2`,children:(0,u.jsx)(o,{variant:`primary`,type:`submit`,disabled:J,children:J?`creating…`:`create`})})]})}function p({items:e,active:t,onChange:n}){return(0,u.jsx)(`nav`,{role:`tablist`,className:`-mb-px mb-5 flex flex-wrap gap-1 border-b border-frost`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===e.id,disabled:e.disabled,title:e.disabled?`disabled — enable it in “templates to include”`:void 0,onClick:()=>n(e.id),className:`unstyled border-b-2 bg-transparent px-4 py-2 text-[0.9em] font-medium transition-colors ${e.disabled?`cursor-not-allowed border-transparent text-mocha-light/40`:t===e.id?`cursor-pointer border-sapphire text-sapphire`:`cursor-pointer border-transparent text-mocha hover:text-sapphire`}`,children:e.label},e.id))})}function m({label:e,hint:t,value:n,onChange:r,rows:i}){return(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`muted my-2 text-[0.85em]`,children:t}),(0,u.jsxs)(`label`,{children:[e,(0,u.jsx)(`textarea`,{rows:i,value:n,onChange:e=>r(e.target.value),className:`font-mono text-[0.88em] leading-[1.55]`})]})]})}export{d as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{t}from"./RecoveryState-QfMSuwy3.js";var n=e(),r=({error:e,reset:r})=>(0,n.jsx)(t,{title:`Approval queue unavailable`,error:e,reset:r,fallbackHref:`/`});export{r as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n}from"./preload-helper-eOOCz1Fu.js";import{y as r}from"./index-BCXoh1c8.js";import{t as i}from"./Button-ByiV6fpd.js";var a=e(n()),o=t();function s(){let[e,t]=(0,a.useState)(r.useLoaderData().approvals),[n,s]=(0,a.useState)(`pending`),[d,p]=(0,a.useState)(null),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(null),v=e.filter(e=>n===`all`||e.status===n),y=async()=>{let e=await fetch(`/api/approvals?limit=100`);if(!e.ok)throw Error(`Could not refresh approvals (${e.status})`);t((await e.json()).approvals)},b=async e=>{let t=await fetch(`/api/approvals/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Could not load approval (${t.status})`);p(await t.json())},x=async e=>{if(d){h(!0),_(null);try{let t=await fetch(`/api/approvals/${encodeURIComponent(d.id)}/${e}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({reason:e===`deny`?`Denied by operator`:void 0})}),n=await t.json();if(!t.ok)throw Error(n.error??`Decision failed (${t.status})`);await y(),await b(d.id),_(e===`approve`?`Approved and delivered once.`:`Denied.`)}catch(e){_(e instanceof Error?e.message:String(e)),await y(),await b(d.id)}finally{h(!1)}}};return(0,o.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h1`,{children:`communication approvals`}),(0,o.jsx)(`p`,{className:`muted`,children:`One durable queue for policy-protected attempts. Approval authorizes only the captured attempt.`})]}),(0,o.jsxs)(`label`,{className:`block max-w-xs text-sm`,children:[`Status`,(0,o.jsxs)(`select`,{value:n,onChange:e=>s(e.target.value),children:[(0,o.jsx)(`option`,{value:`pending`,children:`Pending`}),(0,o.jsx)(`option`,{value:`all`,children:`All history`}),(0,o.jsx)(`option`,{value:`delivered`,children:`Delivered`}),(0,o.jsx)(`option`,{value:`denied`,children:`Denied`}),(0,o.jsx)(`option`,{value:`expired`,children:`Expired`}),(0,o.jsx)(`option`,{value:`cancelled`,children:`Cancelled`}),(0,o.jsx)(`option`,{value:`delivery_failed`,children:`Delivery failed`})]})]}),(0,o.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(320px,0.8fr)]`,children:[(0,o.jsxs)(`div`,{className:`overflow-x-auto rounded-lg border border-frost`,children:[(0,o.jsxs)(`table`,{className:`w-full`,children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{children:[(0,o.jsx)(`th`,{children:`Status`}),(0,o.jsx)(`th`,{children:`Path`}),(0,o.jsx)(`th`,{children:`Origin`}),(0,o.jsx)(`th`,{children:`Expires`})]})}),(0,o.jsx)(`tbody`,{children:v.map(e=>(0,o.jsxs)(`tr`,{tabIndex:0,role:`button`,"aria-label":`Inspect ${e.attemptKind} approval`,onClick:()=>void b(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&b(e.id)},className:`cursor-pointer`,children:[(0,o.jsx)(`td`,{children:(0,o.jsx)(c,{value:e.status})}),(0,o.jsxs)(`td`,{children:[l(e.source),` → `,l(e.target)]}),(0,o.jsx)(`td`,{children:e.origin}),(0,o.jsx)(`td`,{children:(0,o.jsx)(`time`,{dateTime:new Date(e.expiresAt).toISOString(),children:f(e.expiresAt)})})]},e.id))})]}),!v.length&&(0,o.jsx)(`p`,{className:`muted p-4`,children:`No approvals match this filter.`})]}),(0,o.jsx)(`aside`,{className:`card min-w-0`,"aria-label":`Approval detail`,children:d?(0,o.jsxs)(`div`,{className:`space-y-4`,children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,o.jsx)(`h2`,{className:`m-0 text-lg`,children:`attempt detail`}),(0,o.jsx)(c,{value:d.status})]}),(0,o.jsxs)(`dl`,{className:`grid gap-3 text-sm`,children:[(0,o.jsx)(u,{label:`Attempt`,value:`${d.attemptKind}:${d.attemptId}`}),(0,o.jsx)(u,{label:`Operation`,value:d.operation}),(0,o.jsx)(u,{label:`Path`,value:`${l(d.source)} → ${l(d.target)}`}),(0,o.jsx)(u,{label:`Policy`,value:d.policyRefs.map(e=>`${e.teamId}@${e.revision}`).join(`, `)}),(0,o.jsx)(u,{label:`Expires`,value:f(d.expiresAt)})]}),(0,o.jsxs)(`details`,{children:[(0,o.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold`,children:`Sensitive payload`}),(0,o.jsx)(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded bg-ivory p-2 text-xs`,children:JSON.stringify(d.payload,null,2)})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h3`,{className:`text-sm`,children:`Audit history`}),(0,o.jsx)(`ol`,{className:`mt-2 space-y-1 text-xs`,children:d.events.map(e=>(0,o.jsxs)(`li`,{children:[f(e.createdAt),` · `,e.event,` · `,e.actor]},e.id))})]}),g&&(0,o.jsx)(`p`,{role:`status`,className:`text-sm`,children:g}),d.status===`pending`&&(0,o.jsxs)(`div`,{className:`flex gap-2`,children:[(0,o.jsx)(i,{variant:`primary`,disabled:m,onClick:()=>void x(`approve`),children:`Approve once`}),(0,o.jsx)(i,{variant:`danger`,disabled:m,onClick:()=>void x(`deny`),children:`Deny`})]})]}):(0,o.jsx)(`p`,{className:`muted`,children:`Select an attempt to inspect its policy and audit history.`})})]})]})}function c({value:e}){return(0,o.jsx)(`span`,{className:`rounded px-2 py-0.5 text-xs ${e===`pending`?`bg-amber-100 text-amber-900 dark:bg-amber-900/40 dark:text-amber-100`:e===`delivered`?`bg-sapphire-glow text-sapphire-deep`:`bg-rose-baziu/10 text-chocolate`}`,children:e.replace(`_`,` `)})}function l(e){return e.kind===`agent`?`Agent ${e.id}`:e.kind===`user`?`User`:`Outside ${e.teamId}`}function u({label:e,value:t}){return(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`dt`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:e}),(0,o.jsx)(`dd`,{className:`break-all`,children:t})]})}var d=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`medium`,timeZone:`UTC`});function f(e){return`${d.format(new Date(e))} UTC`}export{s as component};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{$ as n,d as r}from"./preload-helper-eOOCz1Fu.js";import{b as i}from"./index-BCXoh1c8.js";import{t as a}from"./ConfigTabs-pY-V0Rie.js";import{t as o}from"./FieldRow-DmwAFfbF.js";var s=e(n()),c=t();function l(){let{providers:e,openaiCodex:t}=i.useLoaderData(),n=e.some(e=>e.enabled&&e.curated.length>0);return(0,c.jsxs)(`main`,{className:`mx-auto max-w-5xl px-6 py-8`,children:[(0,c.jsx)(`h1`,{className:`font-serif text-3xl text-foreground mb-2`,children:`config`}),(0,c.jsx)(a,{active:`providers`}),!n&&(0,c.jsx)(u,{providers:e,openaiCodex:t}),(0,c.jsxs)(`p`,{className:`text-muted-foreground text-sm mb-6`,children:[`Each card configures one LLM provider end to end: credentials (encrypted in the`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:`secrets`}),` table), URLs and IDs (plaintext in the`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:`config`}),` table), and the curated model list that powers profile / agent dropdowns.`]}),e.map(e=>(0,c.jsx)(d,{p:e,openaiCodexStatus:e.id===`openai-codex`?t:void 0},e.id))]})}function u({providers:e,openaiCodex:t}){let n=[];for(let r of e)r.enabled&&(r.id===`openai-codex`&&!t.connected&&n.push(`${r.id}: enabled but ChatGPT is not connected — click "Connect ChatGPT" below`),r.curated.length===0&&n.push(`${r.id}: enabled but no curated models — add at least one name in the "curated models" box below and save`));let r=e.filter(e=>e.enabled).length;return(0,c.jsxs)(`div`,{className:`rounded-md border-2 border-amber-400 bg-amber-50 px-4 py-3 mb-4 text-sm`,children:[(0,c.jsx)(`div`,{className:`font-semibold text-amber-900 mb-1`,children:`First-run setup is not complete`}),(0,c.jsxs)(`p`,{className:`text-amber-900 mb-2`,children:[`The rest of the app stays on the Welcome screen until at least one provider is`,` `,(0,c.jsx)(`strong`,{children:`enabled`}),` and has `,(0,c.jsx)(`strong`,{children:`at least one curated model`}),`. Use a catalog chip when one is available, or paste the exact model id from your local/server provider.`]}),n.length>0?(0,c.jsx)(`ul`,{className:`list-disc pl-5 text-amber-900 space-y-0.5`,children:n.map(e=>(0,c.jsx)(`li`,{children:e},e))}):r===0?(0,c.jsx)(`p`,{className:`text-amber-900`,children:`No providers are enabled yet — pick one below, flip the toggle on, set credentials, and save at least one model name.`}):null]})}function d({p:e,openaiCodexStatus:t}){let n=r(),[i,a]=(0,s.useState)(e.enabled),[l,u]=(0,s.useState)(e.curated.join(`
|
|
2
2
|
`)),[d,h]=(0,s.useState)(!1),[g,_]=(0,s.useState)(null);async function v(t){a(t);try{await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/enabled`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:t})}),await n.invalidate()}catch{a(!t)}}async function y(t){t.preventDefault(),h(!0),_(null);try{let t=l.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/models`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({models:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`${r.status} ${r.statusText}`)}_(`saved ✓`),await n.invalidate()}catch(e){_(`error: ${e.message}`)}finally{h(!1)}}return(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card mb-3 overflow-hidden`,children:[(0,c.jsxs)(`header`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,c.jsx)(`span`,{className:`font-mono font-semibold`,children:e.id}),(0,c.jsxs)(`span`,{className:`text-muted-foreground text-sm`,children:[`· `,e.displayName]}),(0,c.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs uppercase tracking-wide font-semibold cursor-pointer`,children:[(0,c.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>v(e.target.checked),className:`size-4`}),(0,c.jsx)(`span`,{className:i?`text-emerald-700`:`text-muted-foreground`,children:i?`enabled`:`disabled`})]}),(0,c.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:[e.curated.length>0&&(0,c.jsxs)(`span`,{children:[e.curated.length,` curated`]}),e.catalog.length>0&&(0,c.jsxs)(`span`,{children:[` · `,e.catalog.length,` catalog`]}),e.live&&!e.live.error&&(0,c.jsxs)(`span`,{children:[` · `,e.live.models.length,` live`]})]})]}),i&&(0,c.jsxs)(`div`,{className:`border-t border-dashed px-4 py-3`,children:[e.hint&&(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:e.hint}),e.id===`openai-codex`&&t&&(0,c.jsx)(m,{status:t}),e.fields.length===0&&e.envHint&&e.id!==`openai-codex`&&(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Credentials come from the process env: `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.envHint})]}),e.fields.map(e=>(0,c.jsx)(o,{field:e},e.envVar)),(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`curated models (one per line)`}),e.curated.length===0&&(0,c.jsxs)(`p`,{className:`mb-2 text-xs font-medium text-amber-700`,children:[`First-run setup needs at least one model name here — type one (e.g.`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:f(e.id)}),`) and click`,` `,(0,c.jsx)(`em`,{children:`save models`}),`. Catalog chips below are the safest source when available.`]}),(0,c.jsxs)(`form`,{onSubmit:y,children:[(0,c.jsx)(`textarea`,{value:l,onChange:e=>u(e.target.value),rows:Math.max(3,Math.min(8,l.split(`
|
|
3
|
-
`).length)),className:`w-full rounded-md border bg-background px-2 py-1.5 font-mono text-sm outline-none focus:ring-2 focus:ring-ring/30`,placeholder:e.catalog.length===0&&!e.live?`Type model names one per line, e.g. qwen3-coder-30b`:`Click catalog chips below, or type names one per line`}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,c.jsx)(`button`,{type:`submit`,disabled:d,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:`save models`}),g&&(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:g})]})]}),e.catalog.length>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`catalog`}),(0,c.jsx)(p,{items:e.catalog,onPick:e=>u(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live&&!e.live.error&&e.live.models.length>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`live`}),(0,c.jsx)(p,{items:e.live.models,onPick:e=>u(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live?.error&&(0,c.jsxs)(`p`,{className:`text-xs text-rose-700 mt-2`,children:[`could not fetch: `,e.live.error]})]})]})}function f(e){switch(e){case`openai-codex`:return`gpt-5.
|
|
3
|
+
`).length)),className:`w-full rounded-md border bg-background px-2 py-1.5 font-mono text-sm outline-none focus:ring-2 focus:ring-ring/30`,placeholder:e.catalog.length===0&&!e.live?`Type model names one per line, e.g. qwen3-coder-30b`:`Click catalog chips below, or type names one per line`}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,c.jsx)(`button`,{type:`submit`,disabled:d,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:`save models`}),g&&(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:g})]})]}),e.catalog.length>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`catalog`}),(0,c.jsx)(p,{items:e.catalog,onPick:e=>u(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live&&!e.live.error&&e.live.models.length>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`live`}),(0,c.jsx)(p,{items:e.live.models,onPick:e=>u(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live?.error&&(0,c.jsxs)(`p`,{className:`text-xs text-rose-700 mt-2`,children:[`could not fetch: `,e.live.error]})]})]})}function f(e){switch(e){case`openai-codex`:return`gpt-5.6-luna`;case`openai`:return`gpt-5.6-luna`;case`anthropic`:return`claude-opus-4-8`;case`google`:return`gemini-3-pro-preview`;case`google-vertex`:return`gemini-3.1-pro-preview`;case`xai`:return`grok-4.3`;case`groq`:return`llama-3.3-70b-versatile`;case`cerebras`:return`zai-glm-4.7`;case`mistral`:return`mistral-large-latest`;case`zai`:return`glm-5.2`;case`huggingface`:return`Qwen/Qwen3.5-397B-A17B`;case`openrouter`:return`anthropic/claude-opus-4.8`;case`vercel-ai-gateway`:return`anthropic/claude-opus-4.8`;case`deepseek`:return`deepseek-v4-pro`;case`fireworks`:return`accounts/fireworks/models/kimi-k2p7-code`;case`together`:return`Qwen/Qwen3.7-Max`;case`moonshotai`:return`kimi-k2.7-code`;case`moonshotai-cn`:return`kimi-k2.7-code`;case`kimi-coding`:return`kimi-for-coding`;case`minimax`:return`MiniMax-M2.7`;case`minimax-cn`:return`MiniMax-M3`;case`ant-ling`:return`Ling-2.6-1T`;case`nvidia`:return`nvidia/nemotron-3-super-120b-a12b`;case`cloudflare-workers-ai`:return`@cf/moonshotai/kimi-k2.6`;case`cloudflare-ai-gateway`:return`claude-opus-4-7`;case`github-copilot`:return`claude-opus-4.7`;case`xiaomi`:return`mimo-v2.5`;case`xiaomi-token-plan-ams`:case`xiaomi-token-plan-cn`:case`xiaomi-token-plan-sgp`:return`mimo-v2.5-pro`;case`opencode`:return`claude-opus-4-8`;case`opencode-go`:return`kimi-k2.7-code`;case`zai-coding-cn`:return`glm-5.2`;case`azure-openai`:return`gpt-5.6-luna`;case`bedrock`:return`anthropic.claude-opus-4-8`;case`ollama`:return`llama3.3`;case`lmstudio`:return`qwen3-coder-30b`;case`llamacpp`:return`unsloth/Qwen3.6-35B-A3B-MTP-GGUF:MXFP4_MOE`;default:return`model-name`}}function p({items:e,onPick:t}){return(0,c.jsx)(`div`,{className:`flex flex-wrap gap-1.5 max-h-40 overflow-y-auto rounded-md border bg-background p-1.5`,children:e.map(e=>(0,c.jsx)(`button`,{type:`button`,onClick:()=>t(e),className:`rounded border bg-card px-2 py-0.5 font-mono text-xs hover:border-primary hover:bg-accent`,children:e},e))})}function m({status:e}){let t=r(),[n,i]=(0,s.useState)(!1),[a,o]=(0,s.useState)(null);async function l(){i(!0),o(null);try{let e=await fetch(`/api/auth/openai/login`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}await t.invalidate()}catch(e){o(e.message)}finally{i(!1)}}async function u(){i(!0),o(null);try{await fetch(`/api/auth/openai`,{method:`DELETE`}),await t.invalidate()}catch(e){o(e.message)}finally{i(!1)}}return(0,c.jsxs)(`div`,{className:`rounded-md border bg-muted/30 p-3 mb-3`,children:[e.connected?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center mb-2`,children:[(0,c.jsx)(`span`,{className:`rounded-full bg-emerald-100 text-emerald-800 px-2 py-0.5 text-xs font-semibold uppercase`,children:`connected`}),e.accountId&&(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`account `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.accountId})]}),e.expiresAt&&(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`token expires`,` `,new Date(e.expiresAt).toISOString().replace(/\.\d+Z$/,`Z`)]})]}),(0,c.jsx)(`button`,{type:`button`,onClick:u,disabled:n,className:`rounded-md border px-3 py-1.5 text-sm text-rose-700 hover:bg-rose-50 disabled:opacity-50`,children:`disconnect`})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:[`Sign in with your ChatGPT account — the OAuth flow opens a new browser tab. The loopback callback at `,(0,c.jsx)(`code`,{className:`font-mono`,children:`localhost:1455`}),` only works when you're using the web UI on the same machine as the daemon. For remote setups, run `,(0,c.jsx)(`code`,{className:`font-mono`,children:`bazilion auth openai login`}),` on the client.`]}),(0,c.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:n?`opening browser…`:`Connect ChatGPT →`})]}),a&&(0,c.jsx)(`p`,{className:`text-sm text-rose-700 mt-2`,children:a})]})}export{l as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{s as t}from"./index-BCXoh1c8.js";import{t as n}from"./TeamTabs-BViZ4sti.js";var r=e();function i(){let e=t.useLoaderData();return(0,r.jsxs)(`div`,{className:`mx-auto max-w-5xl px-6 py-8`,children:[(0,r.jsx)(`h1`,{children:`team context`}),(0,r.jsx)(`p`,{className:`muted`,children:`Workspace, operator context, and integrations owned by this Team.`}),(0,r.jsx)(n,{teamId:e.id}),(0,r.jsxs)(`section`,{className:`card`,children:[(0,r.jsxs)(`dl`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`dt`,{className:`muted`,children:`workspace path`}),(0,r.jsx)(`dd`,{children:(0,r.jsx)(`code`,{children:e.path})})]}),(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`dt`,{className:`muted`,children:`Telegram topic format`}),(0,r.jsx)(`dd`,{children:(0,r.jsx)(`code`,{children:e.telegramTopicNameFormat??`built-in naming`})})]}),(0,r.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,r.jsx)(`dt`,{className:`muted`,children:`USER.md`}),(0,r.jsx)(`dd`,{className:`mt-2 whitespace-pre-wrap rounded-md border border-frost bg-ivory p-3 text-sm`,children:e.userMd||`No operator context configured.`})]})]}),(0,r.jsx)(`p`,{className:`mt-4 text-sm text-mocha`,children:`Edit USER.md and Telegram naming from Overview during this transition. This route is the canonical context projection.`})]})]})}export{i as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{r as t}from"./index-BCXoh1c8.js";import{t as n}from"./AgentTabs-DioGqUVR.js";var r=e();function i(e){try{let t=JSON.parse(e);if(typeof t.text==`string`)return t.text}catch{}return e}function a(){let{resolved:e,messages:a,unreadCount:o,selected:s,agentNames:c}=t.useLoaderData(),l=t.useSearch().unread===`1`,u=!!(s&&s.toAgentId!==e.agent.id);function d(e){let t=c[e];return t?`${t} (${e.slice(0,8)})`:e.slice(0,8)}return(0,r.jsxs)(`main`,{className:`mx-auto max-w-5xl px-6 py-8`,children:[(0,r.jsx)(`h1`,{className:`font-serif text-3xl text-foreground mb-1`,children:e.agent.name}),(0,r.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-6`,children:[(0,r.jsxs)(`code`,{className:`font-mono`,children:[e.agent.id.slice(0,8),`…`]}),` · unread: `,o]}),(0,r.jsx)(n,{agentId:e.agent.id,active:`inbox`,archived:e.agent.status===`archived`}),(0,r.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-[360px_1fr] gap-6`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsxs)(`div`,{className:`flex gap-1 border-b mb-3`,children:[(0,r.jsx)(`a`,{href:`/agents/${e.agent.id}/inbox`,className:`px-3 py-1.5 text-sm border-b-2 -mb-px ${l?`border-transparent text-muted-foreground`:`border-primary text-primary font-semibold`}`,children:`all`}),(0,r.jsx)(`a`,{href:`/agents/${e.agent.id}/inbox?unread=1`,className:`px-3 py-1.5 text-sm border-b-2 -mb-px ${l?`border-primary text-primary font-semibold`:`border-transparent text-muted-foreground`}`,children:`unread`})]}),(0,r.jsx)(`div`,{className:`rounded-lg border bg-card max-h-[640px] overflow-y-auto`,children:a.length===0?(0,r.jsx)(`div`,{className:`p-6 text-center text-muted-foreground italic`,children:l?`no unread messages`:`inbox empty`}):a.map(t=>{let n=i(t.payload),a=n.length>80?`${n.slice(0,80)}…`:n,o=new Date(t.createdAt).toLocaleString(),c=s?.id===t.id,u=t.readAt===null,f=l?`?unread=1&id=${t.id}`:`?id=${t.id}`;return(0,r.jsxs)(`a`,{href:`/agents/${e.agent.id}/inbox${f}`,className:`block border-b last:border-0 px-3 py-2 text-sm hover:bg-accent/30 ${c?`bg-accent/40`:``} ${u?`font-medium`:``}`,children:[(0,r.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{className:`font-mono`,children:[u&&(0,r.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-primary mr-1.5 align-middle`}),`from `,d(t.fromAgentId)]}),(0,r.jsx)(`span`,{className:`font-mono`,children:o})]}),(0,r.jsx)(`div`,{className:`text-foreground mt-0.5 truncate`,children:a})]},t.id)})})]}),(0,r.jsxs)(`div`,{children:[s&&!u&&(0,r.jsxs)(`div`,{className:`rounded-lg border bg-card p-5 mb-4`,children:[(0,r.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground mb-2 space-y-0.5`,children:[(0,r.jsxs)(`div`,{children:[`id: `,(0,r.jsx)(`code`,{children:s.id})]}),(0,r.jsxs)(`div`,{children:[`from: `,(0,r.jsx)(`code`,{children:d(s.fromAgentId)})]}),(0,r.jsxs)(`div`,{children:[`received: `,new Date(s.createdAt).toLocaleString()]}),(0,r.jsxs)(`div`,{children:[`read:`,` `,s.readAt?new Date(s.readAt).toLocaleString():`(unread)`]}),s.replyTo&&(0,r.jsxs)(`div`,{children:[`reply to: `,(0,r.jsx)(`code`,{children:s.replyTo})]})]}),(0,r.jsx)(`div`,{className:`border-t pt-3 font-mono text-sm whitespace-pre-wrap break-words`,children:i(s.payload)})]}),u&&(0,r.jsx)(`div`,{className:`rounded-lg border bg-card p-5 mb-4 text-muted-foreground`,children:`message is not addressed to this agent`}),(0,r.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agents exchange messages automatically via their`,` `,(0,r.jsx)(`code`,{className:`font-mono`,children:`send_message`}),` tool. An idle recipient's scheduler tick drains unread mail.`]})]})]})]})}export{a as component};
|