bazilion 0.11.0 → 0.12.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.
Files changed (69) hide show
  1. package/dist/cli.js +433 -146
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1382 -232
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/migrations/0001_init.sql +81 -0
  6. package/dist/web/client/assets/AgentTabs-R6gSjIj3.js +1 -0
  7. package/dist/web/client/assets/{ProductionTeamPolicyEditor-B6dbpuYy.js → ProductionTeamPolicyEditor-CSL3W7XM.js} +2 -2
  8. package/dist/web/client/assets/{ProfileCommunicationEditor-Bf8UvmZT.js → ProfileCommunicationEditor-CwU0QkmE.js} +1 -1
  9. package/dist/web/client/assets/{TeamTabs-sQBHChtd.js → TeamTabs-C1Hakkff.js} +1 -1
  10. package/dist/web/client/assets/{TemplatesTabs-DPsuwsWB.js → TemplatesTabs-klEydJ8-.js} +1 -1
  11. package/dist/web/client/assets/{_id-C9rkCclz.js → _id-BOC7ioJu.js} +1 -1
  12. package/dist/web/client/assets/{_id-DYASsGQ8.js → _id-CnVq-rED.js} +1 -1
  13. package/dist/web/client/assets/{_id-DE4IY5bL.js → _id-e4u7dmBb.js} +1 -1
  14. package/dist/web/client/assets/{_id-D65IzC8H.js → _id-wkjjWLz0.js} +1 -1
  15. package/dist/web/client/assets/{activity-C7o6-xHg.js → activity-uqhwzmiy.js} +1 -1
  16. package/dist/web/client/assets/{agents-UroO4d25.js → agents-B2usE-L_.js} +1 -1
  17. package/dist/web/client/assets/{agents-h8yWXQ2H.js → agents-FaQtkAWs.js} +1 -1
  18. package/dist/web/client/assets/{approvals-DKhF0YLC.js → approvals-DqLE6ttw.js} +1 -1
  19. package/dist/web/client/assets/attention-CkGozYnJ.js +1 -0
  20. package/dist/web/client/assets/attention-Gavt2yEp.js +1 -0
  21. package/dist/web/client/assets/chevron-down-CJk0zGNT.js +1 -0
  22. package/dist/web/client/assets/{config-q8JDresK.js → config-xrXoDEWM.js} +1 -1
  23. package/dist/web/client/assets/{context-CBucAoi6.js → context-ZWqx3uiC.js} +1 -1
  24. package/dist/web/client/assets/inbox-BoIvl9ZF.js +1 -0
  25. package/dist/web/client/assets/{index-DUXAevpZ.js → index-nb2MV8X1.js} +3 -3
  26. package/dist/web/client/assets/learning-6_oYn1l7.js +1 -0
  27. package/dist/web/client/assets/{login-CNAV9Wer.js → login-DM1ytxQL.js} +1 -1
  28. package/dist/web/client/assets/{mcp-BKdEFwHO.js → mcp-CetZbyUh.js} +1 -1
  29. package/dist/web/client/assets/{members-BDqZQh26.js → members-DdqWtwZd.js} +1 -1
  30. package/dist/web/client/assets/{memory-DVdEVr6L.js → memory-FNrxFHmC.js} +1 -1
  31. package/dist/web/client/assets/plus-C3GroITC.js +1 -0
  32. package/dist/web/client/assets/{policy-DdDctqvg.js → policy-BKPejYRI.js} +1 -1
  33. package/dist/web/client/assets/{routes-BEfALSZv.js → routes-CH1ZTTo-.js} +1 -1
  34. package/dist/web/client/assets/{services-DZP2ybzb.js → services-zk9SqN06.js} +1 -1
  35. package/dist/web/client/assets/{skills-DoeIjITs.js → skills-tXDpomHW.js} +1 -1
  36. package/dist/web/client/assets/styles-DMltY3su.css +2 -0
  37. package/dist/web/client/assets/{teams-W3j-UoJ9.js → teams-BZYjekBN.js} +1 -1
  38. package/dist/web/client/assets/{teams-DlHRnrQw.js → teams-D1c8zlxs.js} +1 -1
  39. package/dist/web/client/assets/{telegram-2OdeGv4E.js → telegram-DCe1CWMt.js} +1 -1
  40. package/dist/web/client/assets/{tokens-MuBfmgue.js → tokens-DAPjRS0N.js} +1 -1
  41. package/dist/web/client/assets/triggers-D8R-5guA.js +1 -0
  42. package/dist/web/client/assets/{welcome-CvNr5IMi.js → welcome-CuK0shDJ.js} +1 -1
  43. package/dist/web/server/assets/{AgentTabs-DoMDJBXH.js → AgentTabs-aXdsiiMp.js} +5 -0
  44. package/dist/web/server/assets/{_id-Cg7x6q3g.js → _id-BHYLL8M-.js} +2 -2
  45. package/dist/web/server/assets/{_id-DqON-59C.js → _id-FcHdSocl.js} +1 -1
  46. package/dist/web/server/assets/{_tanstack-start-manifest_v-BXauUXg6.js → _tanstack-start-manifest_v-fLsYERQ-.js} +76 -53
  47. package/dist/web/server/assets/attention-BW_6ddkj.js +11 -0
  48. package/dist/web/server/assets/attention-BxkTf337.js +14 -0
  49. package/dist/web/server/assets/attention-CM-Ks1N9.js +19 -0
  50. package/dist/web/server/assets/attention-w21GQIGH.js +264 -0
  51. package/dist/web/server/assets/{inbox-CUIyf9MT.js → inbox-BLUzA5sQ.js} +40 -3
  52. package/dist/web/server/assets/{inbox-B3-TRsNI.js → inbox-CzlKT9Wg.js} +5 -3
  53. package/dist/web/server/assets/{inbox-BardsGyy.js → inbox-ZvDNAjaM.js} +1 -1
  54. package/dist/web/server/assets/learning-8zav4pIT.js +33 -0
  55. package/dist/web/server/assets/learning-B7PBkvER.js +16 -0
  56. package/dist/web/server/assets/learning-Cq7K2heb.js +312 -0
  57. package/dist/web/server/assets/{router-C5_NjTsP.js → router-CQuj7553.js} +80 -47
  58. package/dist/web/server/assets/{triggers-CBl4yMyw.js → triggers-BZPl5CHs.js} +1 -1
  59. package/dist/web/server/assets/{triggers-_3rdhwSN.js → triggers-CSNNzRIi.js} +2 -2
  60. package/dist/web/server/server.js +11 -3
  61. package/dist/worker.js +166 -36
  62. package/dist/worker.js.map +1 -1
  63. package/package.json +3 -3
  64. package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +0 -1
  65. package/dist/web/client/assets/chevron-down-BK6NPMMP.js +0 -1
  66. package/dist/web/client/assets/inbox-BwoRikj1.js +0 -1
  67. package/dist/web/client/assets/plus-b4yFXP0O.js +0 -1
  68. package/dist/web/client/assets/styles-BYM0UGdF.css +0 -2
  69. package/dist/web/client/assets/triggers-CX7RMQFQ.js +0 -1
@@ -1 +1 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{m as i}from"./index-DUXAevpZ.js";import{n as a,r as o}from"./Page-CwNuDhWz.js";import{t as s}from"./Button-ByiV6fpd.js";import{t as c}from"./TemplatesTabs-DPsuwsWB.js";var l=e(n()),u=t();function d(){let e=i.useLoaderData(),t=r();return(0,u.jsxs)(o,{size:`wide`,children:[(0,u.jsx)(a,{eyebrow:`Templates`,title:`Team templates`,description:`Create revisioned rosters with stable slots and a reusable communication policy.`}),(0,u.jsx)(c,{}),(0,u.jsx)(f,{onCreated:()=>t.invalidate()}),(0,u.jsx)(`div`,{className:`overflow-x-auto`,children:(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:`slots`}),(0,u.jsx)(`th`,{children:`revision`}),(0,u.jsx)(`th`,{children:`source state`})]})}),(0,u.jsxs)(`tbody`,{children:[e.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsx)(`a`,{href:`/templates/teams/${encodeURIComponent(e.id)}`,children:(0,u.jsx)(`code`,{children:e.id})})}),(0,u.jsx)(`td`,{children:e.name}),(0,u.jsx)(`td`,{children:e.slotCount}),(0,u.jsx)(`td`,{children:e.currentRevision}),(0,u.jsx)(`td`,{children:e.deletedAt?`deleted source`:`canonical`})]},e.id)),e.length===0&&(0,u.jsx)(`tr`,{children:(0,u.jsx)(`td`,{colSpan:5,className:`muted`,children:`No team templates yet.`})})]})]})})]})}function f({onCreated:e}){let[t,n]=(0,l.useState)(``),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(null),[c,d]=(0,l.useState)(!1);async function f(a){a.preventDefault(),d(!0),o(null);try{let a=await fetch(`/api/team-templates`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t.trim(),name:r.trim()})});if(!a.ok)throw Error((await a.json().catch(()=>null))?.error??a.statusText);n(``),i(``),await e()}catch(e){o(e.message)}finally{d(!1)}}return(0,u.jsxs)(`form`,{className:`card`,onSubmit:f,children:[(0,u.jsx)(`h2`,{className:`text-xl`,children:`new team template`}),a&&(0,u.jsx)(`p`,{className:`err`,children:a}),(0,u.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,u.jsxs)(`label`,{children:[`id`,(0,u.jsx)(`input`,{required:!0,value:t,onChange:e=>n(e.target.value),placeholder:`review-team`})]}),(0,u.jsxs)(`label`,{children:[`name`,(0,u.jsx)(`input`,{required:!0,value:r,onChange:e=>i(e.target.value),placeholder:`Review team`})]})]}),(0,u.jsx)(s,{variant:`primary`,type:`submit`,disabled:c,children:c?`creating…`:`create team template`})]})}export{d as component};
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{h as i}from"./index-nb2MV8X1.js";import{n as a,r as o}from"./Page-CwNuDhWz.js";import{t as s}from"./Button-ByiV6fpd.js";import{t as c}from"./TemplatesTabs-klEydJ8-.js";var l=e(n()),u=t();function d(){let e=i.useLoaderData(),t=r();return(0,u.jsxs)(o,{size:`wide`,children:[(0,u.jsx)(a,{eyebrow:`Templates`,title:`Team templates`,description:`Create revisioned rosters with stable slots and a reusable communication policy.`}),(0,u.jsx)(c,{}),(0,u.jsx)(f,{onCreated:()=>t.invalidate()}),(0,u.jsx)(`div`,{className:`overflow-x-auto`,children:(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:`slots`}),(0,u.jsx)(`th`,{children:`revision`}),(0,u.jsx)(`th`,{children:`source state`})]})}),(0,u.jsxs)(`tbody`,{children:[e.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsx)(`a`,{href:`/templates/teams/${encodeURIComponent(e.id)}`,children:(0,u.jsx)(`code`,{children:e.id})})}),(0,u.jsx)(`td`,{children:e.name}),(0,u.jsx)(`td`,{children:e.slotCount}),(0,u.jsx)(`td`,{children:e.currentRevision}),(0,u.jsx)(`td`,{children:e.deletedAt?`deleted source`:`canonical`})]},e.id)),e.length===0&&(0,u.jsx)(`tr`,{children:(0,u.jsx)(`td`,{colSpan:5,className:`muted`,children:`No team templates yet.`})})]})]})})]})}function f({onCreated:e}){let[t,n]=(0,l.useState)(``),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(null),[c,d]=(0,l.useState)(!1);async function f(a){a.preventDefault(),d(!0),o(null);try{let a=await fetch(`/api/team-templates`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t.trim(),name:r.trim()})});if(!a.ok)throw Error((await a.json().catch(()=>null))?.error??a.statusText);n(``),i(``),await e()}catch(e){o(e.message)}finally{d(!1)}}return(0,u.jsxs)(`form`,{className:`card`,onSubmit:f,children:[(0,u.jsx)(`h2`,{className:`text-xl`,children:`new team template`}),a&&(0,u.jsx)(`p`,{className:`err`,children:a}),(0,u.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,u.jsxs)(`label`,{children:[`id`,(0,u.jsx)(`input`,{required:!0,value:t,onChange:e=>n(e.target.value),placeholder:`review-team`})]}),(0,u.jsxs)(`label`,{children:[`name`,(0,u.jsx)(`input`,{required:!0,value:r,onChange:e=>i(e.target.value),placeholder:`Review team`})]})]}),(0,u.jsx)(s,{variant:`primary`,type:`submit`,disabled:c,children:c?`creating…`:`create team template`})]})}export{d as component};
@@ -1 +1 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{S as i}from"./index-DUXAevpZ.js";import{a,i as o,n as s,r as c,t as l}from"./Page-CwNuDhWz.js";import{t as u}from"./Button-ByiV6fpd.js";var d=e(n()),f=t();function p(){let{teams:e,memberCounts:t,policies:n,readiness:d}=i.useLoaderData(),p=r();async function h(e){if(!confirm(`remove this team registration?`))return;let t=n[e]?.revision;if(!t)return;let r=await fetch(`/api/teams/${encodeURIComponent(e)}?expectedTeamPolicyRevision=${t}`,{method:`DELETE`});if(!r.ok&&r.status!==204){alert(r.statusText);return}await p.invalidate()}return(0,f.jsxs)(c,{size:`wide`,children:[(0,f.jsx)(s,{eyebrow:`Workspace`,title:`Teams`,description:`Each Team owns one workspace, one live membership roster, and one effective communication policy. Every agent belongs to exactly one Team.`}),(0,f.jsx)(o,{title:`Policy enforcement`,description:`Management contract v${d.contractVersion} is ready for this daemon.`,actions:(0,f.jsx)(a,{variant:d.enforcementActive?`success`:`warning`,children:d.enforcementActive?`Enforcement on`:`Enforcement off`}),"aria-label":`Team Policy enforcement readiness`,children:(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d.enforcementActive?`Communication boundaries are currently enforcing each Team policy.`:(0,f.jsxs)(f.Fragment,{children:[`Set `,(0,f.jsx)(`code`,{children:`BAZILION_TEAM_POLICY_ENFORCEMENT=on`}),` and restart the daemon to enforce Team policies.`]})})}),(0,f.jsx)(m,{onRegistered:()=>p.invalidate()}),(0,f.jsx)(o,{title:`Registered teams`,description:`Open a Team to manage its context, members, shared memory, and policy.`,children:e.length===0?(0,f.jsx)(l,{title:`No teams registered`,description:`Register a Team above to create a workspace for your agents.`}):(0,f.jsx)(`div`,{className:`overflow-x-auto`,children:(0,f.jsxs)(`table`,{className:`min-w-[820px]`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`ID`}),(0,f.jsx)(`th`,{children:`Name`}),(0,f.jsx)(`th`,{children:`Members`}),(0,f.jsx)(`th`,{children:`Policy`}),(0,f.jsx)(`th`,{children:`Baseline`}),(0,f.jsx)(`th`,{children:(0,f.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,f.jsx)(`tbody`,{children:e.map(e=>{let r=t[e.id]??0,i=n[e.id];return(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{children:(0,f.jsx)(`code`,{children:e.id})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`a`,{href:`/teams/${e.id}`,children:e.name})}),(0,f.jsx)(`td`,{children:r}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`a`,{href:`/teams/${e.id}/policy`,children:i?`r${i.revision} · ${i.edges} edges`:`Unavailable`})}),(0,f.jsx)(`td`,{children:i?.baseline??`None`}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`div`,{className:`flex justify-end`,children:r===0?(0,f.jsx)(u,{variant:`danger`,onClick:()=>h(e.id),children:`Remove`}):(0,f.jsx)(a,{variant:`neutral`,title:`${r} agent(s) belong to this Team`,children:`In use`})})})]},e.id)})})]})})})]})}function m({onRegistered:e}){let[t,n]=(0,d.useState)(``),[r,i]=(0,d.useState)(``),[a,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1);async function h(o){if(o.preventDefault(),l(null),!t.trim()){l(`id is required`);return}m(!0);try{let o=await fetch(`/api/teams`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t.trim(),name:r.trim()||void 0,link:a.trim()||void 0})});if(!o.ok){let e=await o.json().catch(()=>null);throw Error(e?.error??o.statusText)}n(``),i(``),s(``),e()}catch(e){l(e.message)}finally{m(!1)}}return(0,f.jsx)(o,{title:`Register a team`,description:(0,f.jsxs)(f.Fragment,{children:[`Teams live under `,(0,f.jsx)(`code`,{children:`~/.bazilion/teams/<slug>/`}),`. Link an existing project directory or leave the target blank to create a fresh workspace.`]}),children:(0,f.jsxs)(`form`,{onSubmit:h,children:[c&&(0,f.jsx)(`div`,{className:`err`,children:c}),(0,f.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,f.jsxs)(`label`,{children:[`ID (slug)`,(0,f.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),required:!0,placeholder:`my-project`})]}),(0,f.jsxs)(`label`,{children:[`Name`,(0,f.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`My project`})]}),(0,f.jsxs)(`label`,{className:`sm:col-span-2`,children:[`Link target (optional, absolute path)`,(0,f.jsx)(`input`,{value:a,onChange:e=>s(e.target.value),placeholder:`/home/user/projects/my-project`})]})]}),(0,f.jsx)(`div`,{className:`mt-4`,children:(0,f.jsx)(u,{variant:`primary`,type:`submit`,disabled:p,children:p?`Registering…`:`Register team`})})]})})}export{p as component};
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{w as i}from"./index-nb2MV8X1.js";import{a,i as o,n as s,r as c,t as l}from"./Page-CwNuDhWz.js";import{t as u}from"./Button-ByiV6fpd.js";var d=e(n()),f=t();function p(){let{teams:e,memberCounts:t,policies:n,readiness:d}=i.useLoaderData(),p=r();async function h(e){if(!confirm(`remove this team registration?`))return;let t=n[e]?.revision;if(!t)return;let r=await fetch(`/api/teams/${encodeURIComponent(e)}?expectedTeamPolicyRevision=${t}`,{method:`DELETE`});if(!r.ok&&r.status!==204){alert(r.statusText);return}await p.invalidate()}return(0,f.jsxs)(c,{size:`wide`,children:[(0,f.jsx)(s,{eyebrow:`Workspace`,title:`Teams`,description:`Each Team owns one workspace, one live membership roster, and one effective communication policy. Every agent belongs to exactly one Team.`}),(0,f.jsx)(o,{title:`Policy enforcement`,description:`Management contract v${d.contractVersion} is ready for this daemon.`,actions:(0,f.jsx)(a,{variant:d.enforcementActive?`success`:`warning`,children:d.enforcementActive?`Enforcement on`:`Enforcement off`}),"aria-label":`Team Policy enforcement readiness`,children:(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d.enforcementActive?`Communication boundaries are currently enforcing each Team policy.`:(0,f.jsxs)(f.Fragment,{children:[`Set `,(0,f.jsx)(`code`,{children:`BAZILION_TEAM_POLICY_ENFORCEMENT=on`}),` and restart the daemon to enforce Team policies.`]})})}),(0,f.jsx)(m,{onRegistered:()=>p.invalidate()}),(0,f.jsx)(o,{title:`Registered teams`,description:`Open a Team to manage its context, members, shared memory, and policy.`,children:e.length===0?(0,f.jsx)(l,{title:`No teams registered`,description:`Register a Team above to create a workspace for your agents.`}):(0,f.jsx)(`div`,{className:`overflow-x-auto`,children:(0,f.jsxs)(`table`,{className:`min-w-[820px]`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`ID`}),(0,f.jsx)(`th`,{children:`Name`}),(0,f.jsx)(`th`,{children:`Members`}),(0,f.jsx)(`th`,{children:`Policy`}),(0,f.jsx)(`th`,{children:`Baseline`}),(0,f.jsx)(`th`,{children:(0,f.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,f.jsx)(`tbody`,{children:e.map(e=>{let r=t[e.id]??0,i=n[e.id];return(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{children:(0,f.jsx)(`code`,{children:e.id})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`a`,{href:`/teams/${e.id}`,children:e.name})}),(0,f.jsx)(`td`,{children:r}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`a`,{href:`/teams/${e.id}/policy`,children:i?`r${i.revision} · ${i.edges} edges`:`Unavailable`})}),(0,f.jsx)(`td`,{children:i?.baseline??`None`}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`div`,{className:`flex justify-end`,children:r===0?(0,f.jsx)(u,{variant:`danger`,onClick:()=>h(e.id),children:`Remove`}):(0,f.jsx)(a,{variant:`neutral`,title:`${r} agent(s) belong to this Team`,children:`In use`})})})]},e.id)})})]})})})]})}function m({onRegistered:e}){let[t,n]=(0,d.useState)(``),[r,i]=(0,d.useState)(``),[a,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1);async function h(o){if(o.preventDefault(),l(null),!t.trim()){l(`id is required`);return}m(!0);try{let o=await fetch(`/api/teams`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t.trim(),name:r.trim()||void 0,link:a.trim()||void 0})});if(!o.ok){let e=await o.json().catch(()=>null);throw Error(e?.error??o.statusText)}n(``),i(``),s(``),e()}catch(e){l(e.message)}finally{m(!1)}}return(0,f.jsx)(o,{title:`Register a team`,description:(0,f.jsxs)(f.Fragment,{children:[`Teams live under `,(0,f.jsx)(`code`,{children:`~/.bazilion/teams/<slug>/`}),`. Link an existing project directory or leave the target blank to create a fresh workspace.`]}),children:(0,f.jsxs)(`form`,{onSubmit:h,children:[c&&(0,f.jsx)(`div`,{className:`err`,children:c}),(0,f.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,f.jsxs)(`label`,{children:[`ID (slug)`,(0,f.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),required:!0,placeholder:`my-project`})]}),(0,f.jsxs)(`label`,{children:[`Name`,(0,f.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`My project`})]}),(0,f.jsxs)(`label`,{className:`sm:col-span-2`,children:[`Link target (optional, absolute path)`,(0,f.jsx)(`input`,{value:a,onChange:e=>s(e.target.value),placeholder:`/home/user/projects/my-project`})]})]}),(0,f.jsx)(`div`,{className:`mt-4`,children:(0,f.jsx)(u,{variant:`primary`,type:`submit`,disabled:p,children:p?`Registering…`:`Register team`})})]})})}export{p as component};
@@ -1 +1 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{a as i}from"./index-DUXAevpZ.js";import{t as a}from"./Button-ByiV6fpd.js";import{t as o}from"./ConfigPage-BCwfgyjD.js";var s=e(n()),c=t();function l(){let e=i.useLoaderData(),t=r(),[n,l]=(0,s.useState)(``),[m,h]=(0,s.useState)(e.chatId),[g,_]=(0,s.useState)(!1),[v,y]=(0,s.useState)(null),[b,x]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),[w,T]=(0,s.useState)(!1);async function E(e){e.preventDefault(),_(!0),y(null),x(!1);try{let e=await fetch(`/api/config/telegram`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({botToken:n,chatId:m})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}l(``),x(!0),await t.invalidate()}catch(e){y(e.message)}finally{_(!1)}}async function D(){if(confirm(`Clear the saved Telegram credentials?`))try{await fetch(`/api/config/telegram`,{method:`DELETE`}),l(``),h(``),C(null),x(!1),y(null),await t.invalidate()}catch(e){y(e.message)}}async function O(){T(!0),C(null);try{C(await(await fetch(`/api/config/telegram/health`)).json())}catch(e){C({configured:!0,preflight:null,error:{step:`getMe`,message:e.message},polling:null})}finally{T(!1)}}return(0,c.jsxs)(o,{active:`integrations`,title:`Telegram`,description:`Connect one forum-supergroup bot with one topic per agent, so conversations stay reachable from your phone.`,size:`narrow`,children:[e.migratedChatId&&(0,c.jsx)(d,{toChatId:e.migratedChatId}),(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,c.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-3`,children:`Credentials`}),e.configured&&(0,c.jsxs)(`p`,{className:`text-xs text-success mb-3`,children:[`✓ Stored: `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.botTokenPreview}),` `,e.chatId&&(0,c.jsxs)(c.Fragment,{children:[`· chat `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.chatId})]})]}),(0,c.jsxs)(`form`,{onSubmit:E,className:`space-y-3`,children:[(0,c.jsxs)(`label`,{className:`block`,children:[(0,c.jsx)(`span`,{className:`block text-sm font-medium mb-1`,children:`Bot token`}),(0,c.jsx)(`input`,{type:`password`,autoComplete:`off`,value:n,onChange:e=>l(e.target.value),placeholder:e.configured?`(leave blank to keep stored value)`:`1234567890:ABC...`,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`,required:!e.configured}),(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`From @BotFather → /newbot. Disable Privacy Mode in `,(0,c.jsx)(`em`,{children:`Bot Settings → Team Privacy → Turn off`}),`.`]})]}),(0,c.jsxs)(`label`,{className:`block`,children:[(0,c.jsx)(`span`,{className:`block text-sm font-medium mb-1`,children:`Supergroup chat ID`}),(0,c.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`-1001234567890`,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`,required:!0}),(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Forum-enabled supergroup the bot is admin in (with`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:`can_manage_topics`}),`).`]})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 pt-1`,children:[(0,c.jsx)(a,{variant:`primary`,type:`submit`,disabled:g,children:g?`saving…`:`save credentials`}),e.configured&&(0,c.jsx)(a,{variant:`danger`,onClick:D,children:`clear credentials`}),b&&(0,c.jsx)(`span`,{className:`text-xs text-success`,children:`saved ✓`}),v&&(0,c.jsxs)(`span`,{className:`text-xs text-danger`,children:[`error: `,v]})]})]})]}),(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,c.jsxs)(`div`,{className:`mb-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,c.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wide text-muted-foreground`,children:`Preflight checks`}),(0,c.jsx)(a,{variant:`ghost`,onClick:O,disabled:w||!e.configured,children:w?`checking…`:`run preflight`})]}),!e.configured&&(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`Save credentials above first.`}),e.configured&&!S&&!w&&(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground italic`,children:[`Click `,(0,c.jsx)(`em`,{children:`run preflight`}),` to validate the stored credentials against the Telegram Bot API.`]}),S&&(0,c.jsx)(p,{health:S}),S?.polling&&(0,c.jsx)(f,{polling:S.polling})]}),e.configured&&(0,c.jsx)(u,{})]})}function u(){let[e,t]=(0,s.useState)(null),[n,r]=(0,s.useState)(``),[i,o]=(0,s.useState)(``),[l,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(null);async function p(){try{let e=await fetch(`/api/config/telegram/acl`);if(!e.ok)throw Error(e.statusText);t(await e.json())}catch(e){f(e.message)}}(0,s.useEffect)(()=>{p()},[]);async function m(e){e.preventDefault();let t=Number(n);if(!Number.isInteger(t)){f(`user id must be an integer`);return}u(!0),f(null);try{let e=await fetch(`/api/config/telegram/acl`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({userId:t,label:i.trim()||null})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??e.statusText)}r(``),o(``),await p()}catch(e){f(e.message)}finally{u(!1)}}async function h(e){f(null);try{let t=await fetch(`/api/config/telegram/acl/${e}`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??t.statusText)}await p()}catch(e){f(e.message)}}return(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,c.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-1`,children:`Access control`}),(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-3`,children:[`Allowlisted Telegram users can use the bot (commands + chat). While the list is empty the bot is open and the first person to message it becomes owner. Users find their id via`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:`/whoami`}),`.`]}),e===null?(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`loading…`}):e.length===0?(0,c.jsx)(`p`,{className:`text-xs text-warning mb-3`,children:`Open — no allowlist yet. The first user to message the bot claims owner.`}):(0,c.jsx)(`ul`,{className:`mb-3 space-y-1 text-sm`,children:e.map(e=>(0,c.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,c.jsx)(`code`,{className:`font-mono`,children:e.userId}),(0,c.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.label??(e.username?`@${e.username}`:`—`),` · `,e.role]}),e.role!==`owner`&&(0,c.jsx)(`button`,{type:`button`,onClick:()=>void h(e.userId),className:`ghost-btn text-xs text-rose-baziu`,children:`remove`})]},e.userId))}),(0,c.jsxs)(`form`,{onSubmit:m,className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center`,children:[(0,c.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`user id`,className:`w-full rounded-md border bg-background px-2 py-1 font-mono text-sm sm:w-28`}),(0,c.jsx)(`input`,{value:i,onChange:e=>o(e.target.value),placeholder:`label (optional)`,className:`w-full rounded-md border bg-background px-2 py-1 text-sm sm:w-40`}),(0,c.jsx)(a,{variant:`ghost`,type:`submit`,disabled:l,children:`add`}),d&&(0,c.jsx)(`span`,{className:`text-xs text-danger`,children:d})]})]})}function d({toChatId:e}){let[t,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null);async function o(){n(!0),i(null);try{let e=await fetch(`/api/config/telegram/reconnect`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??e.statusText)}window.location.reload()}catch(e){i(e.message),n(!1)}}return(0,c.jsxs)(`div`,{className:`rounded-md border-2 border-danger/25 bg-danger/10 px-4 py-3 text-sm`,children:[(0,c.jsx)(`div`,{className:`font-semibold text-danger mb-1`,children:`Supergroup chat id changed`}),(0,c.jsxs)(`p`,{className:`text-danger mb-2`,children:[`Telegram migrated this supergroup to a new chat id (`,(0,c.jsx)(`code`,{className:`font-mono`,children:e}),`). The bot is still pointed at the old id. Reconnect to repoint it and re-create the `,(0,c.jsx)(`code`,{className:`font-mono`,children:`⚙ bazilion`}),` `,`service chat in the new team. Agent topic bindings will reconcile on next use.`]}),(0,c.jsx)(a,{variant:`primary`,onClick:o,disabled:t,children:t?`reconnecting…`:`Reconnect to ${e}`}),r&&(0,c.jsx)(`span`,{className:`ml-3 text-xs text-danger`,children:r})]})}function f({polling:e}){let t=e.startedAt?new Date(e.startedAt).toISOString():null,n=e.lastSuccessfulPollAt?new Date(e.lastSuccessfulPollAt).toISOString():null;return(0,c.jsxs)(`div`,{className:`mt-4 rounded-md border bg-muted/30 px-3 py-2 text-xs space-y-1`,children:[(0,c.jsx)(`p`,{className:`font-semibold uppercase tracking-wide text-muted-foreground`,children:`Polling state`}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 font-mono`,children:[(0,c.jsx)(`span`,{className:e.running?`text-success`:`text-danger`,children:e.running?`running`:`stopped`}),(0,c.jsx)(`span`,{className:e.activated?`text-success`:`text-warning`,children:e.activated?`activated`:`awaiting activation`}),e.lastUpdateId!==null&&(0,c.jsxs)(`span`,{children:[`last update `,e.lastUpdateId]}),t&&(0,c.jsxs)(`span`,{children:[`started `,t]}),n&&(0,c.jsxs)(`span`,{children:[`last poll `,n]})]}),e.error&&(0,c.jsxs)(`p`,{className:`text-danger`,children:[`error: `,e.error]})]})}function p({health:e}){if(e.error)return(0,c.jsxs)(`div`,{className:`rounded-md border border-danger/25 bg-danger/10 px-3 py-2 text-sm`,children:[(0,c.jsxs)(`p`,{className:`font-semibold text-danger`,children:[`Failed at `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.error.step})]}),(0,c.jsx)(`p`,{className:`text-danger mt-1`,children:e.error.message}),h(e.error.step)]});if(!e.preflight)return(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No preflight data.`});let t=e.preflight;return(0,c.jsxs)(`ul`,{className:`space-y-1.5`,children:[(0,c.jsxs)(m,{ok:t.botUsername.length>0,label:`Bot identity`,children:[`@`,t.botUsername]}),(0,c.jsx)(m,{ok:t.chatTitle.length>0,label:`Supergroup reachable`,children:t.chatTitle}),(0,c.jsx)(m,{ok:t.isForum,label:`Forum topics enabled`,children:t.isForum?`is_forum: true`:`is_forum: false — the supergroup owner must enable Topics in team settings`}),(0,c.jsx)(m,{ok:t.hasManageTopics,label:`Bot has can_manage_topics`,children:t.hasManageTopics?`admin with can_manage_topics`:`promote the bot to admin in the supergroup with the "Manage topics" permission`}),(0,c.jsx)(m,{ok:t.privacyModeOff,label:`Privacy Mode is OFF`,children:t.privacyModeOff?`can_read_all_group_messages: true`:`BotFather → /mybots → select bot → Bot Settings → Team Privacy → Turn off`})]})}function m({ok:e,label:t,children:n}){return(0,c.jsxs)(`li`,{className:`flex items-start gap-2 text-sm`,children:[(0,c.jsx)(`span`,{className:`mt-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold leading-none ${e?`bg-success/10 text-success`:`bg-danger/10 text-danger`}`,"aria-hidden":!0,children:e?`✓`:`✕`}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`font-medium`,children:t}),(0,c.jsx)(`span`,{className:`ml-2 text-xs ${e?`text-muted-foreground`:`text-danger`}`,children:n})]})]})}function h(e){switch(e){case`getMe`:return(0,c.jsx)(`p`,{className:`text-xs text-danger mt-1`,children:`The token is invalid or revoked. Re-issue with @BotFather → /token, or paste a fresh one above.`});case`getChat`:return(0,c.jsx)(`p`,{className:`text-xs text-danger mt-1`,children:`The chat id either doesn't exist, points at a basic team (not a supergroup), or the bot isn't a member. Forward any message from the supergroup to the bot to double-check the id, then add the bot to the team.`});case`getChatMember`:return(0,c.jsx)(`p`,{className:`text-xs text-danger mt-1`,children:`The bot is in the chat but the membership lookup failed. Usually means the bot was kicked or the chat id was migrated — confirm the bot is still in the supergroup.`})}}export{l as component};
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{o as i}from"./index-nb2MV8X1.js";import{t as a}from"./Button-ByiV6fpd.js";import{t as o}from"./ConfigPage-BCwfgyjD.js";var s=e(n()),c=t();function l(){let e=i.useLoaderData(),t=r(),[n,l]=(0,s.useState)(``),[m,h]=(0,s.useState)(e.chatId),[g,_]=(0,s.useState)(!1),[v,y]=(0,s.useState)(null),[b,x]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),[w,T]=(0,s.useState)(!1);async function E(e){e.preventDefault(),_(!0),y(null),x(!1);try{let e=await fetch(`/api/config/telegram`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({botToken:n,chatId:m})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}l(``),x(!0),await t.invalidate()}catch(e){y(e.message)}finally{_(!1)}}async function D(){if(confirm(`Clear the saved Telegram credentials?`))try{await fetch(`/api/config/telegram`,{method:`DELETE`}),l(``),h(``),C(null),x(!1),y(null),await t.invalidate()}catch(e){y(e.message)}}async function O(){T(!0),C(null);try{C(await(await fetch(`/api/config/telegram/health`)).json())}catch(e){C({configured:!0,preflight:null,error:{step:`getMe`,message:e.message},polling:null})}finally{T(!1)}}return(0,c.jsxs)(o,{active:`integrations`,title:`Telegram`,description:`Connect one forum-supergroup bot with one topic per agent, so conversations stay reachable from your phone.`,size:`narrow`,children:[e.migratedChatId&&(0,c.jsx)(d,{toChatId:e.migratedChatId}),(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,c.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-3`,children:`Credentials`}),e.configured&&(0,c.jsxs)(`p`,{className:`text-xs text-success mb-3`,children:[`✓ Stored: `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.botTokenPreview}),` `,e.chatId&&(0,c.jsxs)(c.Fragment,{children:[`· chat `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.chatId})]})]}),(0,c.jsxs)(`form`,{onSubmit:E,className:`space-y-3`,children:[(0,c.jsxs)(`label`,{className:`block`,children:[(0,c.jsx)(`span`,{className:`block text-sm font-medium mb-1`,children:`Bot token`}),(0,c.jsx)(`input`,{type:`password`,autoComplete:`off`,value:n,onChange:e=>l(e.target.value),placeholder:e.configured?`(leave blank to keep stored value)`:`1234567890:ABC...`,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`,required:!e.configured}),(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`From @BotFather → /newbot. Disable Privacy Mode in `,(0,c.jsx)(`em`,{children:`Bot Settings → Team Privacy → Turn off`}),`.`]})]}),(0,c.jsxs)(`label`,{className:`block`,children:[(0,c.jsx)(`span`,{className:`block text-sm font-medium mb-1`,children:`Supergroup chat ID`}),(0,c.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`-1001234567890`,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`,required:!0}),(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Forum-enabled supergroup the bot is admin in (with`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:`can_manage_topics`}),`).`]})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 pt-1`,children:[(0,c.jsx)(a,{variant:`primary`,type:`submit`,disabled:g,children:g?`saving…`:`save credentials`}),e.configured&&(0,c.jsx)(a,{variant:`danger`,onClick:D,children:`clear credentials`}),b&&(0,c.jsx)(`span`,{className:`text-xs text-success`,children:`saved ✓`}),v&&(0,c.jsxs)(`span`,{className:`text-xs text-danger`,children:[`error: `,v]})]})]})]}),(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,c.jsxs)(`div`,{className:`mb-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,c.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wide text-muted-foreground`,children:`Preflight checks`}),(0,c.jsx)(a,{variant:`ghost`,onClick:O,disabled:w||!e.configured,children:w?`checking…`:`run preflight`})]}),!e.configured&&(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`Save credentials above first.`}),e.configured&&!S&&!w&&(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground italic`,children:[`Click `,(0,c.jsx)(`em`,{children:`run preflight`}),` to validate the stored credentials against the Telegram Bot API.`]}),S&&(0,c.jsx)(p,{health:S}),S?.polling&&(0,c.jsx)(f,{polling:S.polling})]}),e.configured&&(0,c.jsx)(u,{})]})}function u(){let[e,t]=(0,s.useState)(null),[n,r]=(0,s.useState)(``),[i,o]=(0,s.useState)(``),[l,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(null);async function p(){try{let e=await fetch(`/api/config/telegram/acl`);if(!e.ok)throw Error(e.statusText);t(await e.json())}catch(e){f(e.message)}}(0,s.useEffect)(()=>{p()},[]);async function m(e){e.preventDefault();let t=Number(n);if(!Number.isInteger(t)){f(`user id must be an integer`);return}u(!0),f(null);try{let e=await fetch(`/api/config/telegram/acl`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({userId:t,label:i.trim()||null})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??e.statusText)}r(``),o(``),await p()}catch(e){f(e.message)}finally{u(!1)}}async function h(e){f(null);try{let t=await fetch(`/api/config/telegram/acl/${e}`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??t.statusText)}await p()}catch(e){f(e.message)}}return(0,c.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,c.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-1`,children:`Access control`}),(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-3`,children:[`Allowlisted Telegram users can use the bot (commands + chat). While the list is empty the bot is open and the first person to message it becomes owner. Users find their id via`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:`/whoami`}),`.`]}),e===null?(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`loading…`}):e.length===0?(0,c.jsx)(`p`,{className:`text-xs text-warning mb-3`,children:`Open — no allowlist yet. The first user to message the bot claims owner.`}):(0,c.jsx)(`ul`,{className:`mb-3 space-y-1 text-sm`,children:e.map(e=>(0,c.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,c.jsx)(`code`,{className:`font-mono`,children:e.userId}),(0,c.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.label??(e.username?`@${e.username}`:`—`),` · `,e.role]}),e.role!==`owner`&&(0,c.jsx)(`button`,{type:`button`,onClick:()=>void h(e.userId),className:`ghost-btn text-xs text-rose-baziu`,children:`remove`})]},e.userId))}),(0,c.jsxs)(`form`,{onSubmit:m,className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center`,children:[(0,c.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`user id`,className:`w-full rounded-md border bg-background px-2 py-1 font-mono text-sm sm:w-28`}),(0,c.jsx)(`input`,{value:i,onChange:e=>o(e.target.value),placeholder:`label (optional)`,className:`w-full rounded-md border bg-background px-2 py-1 text-sm sm:w-40`}),(0,c.jsx)(a,{variant:`ghost`,type:`submit`,disabled:l,children:`add`}),d&&(0,c.jsx)(`span`,{className:`text-xs text-danger`,children:d})]})]})}function d({toChatId:e}){let[t,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null);async function o(){n(!0),i(null);try{let e=await fetch(`/api/config/telegram/reconnect`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??e.statusText)}window.location.reload()}catch(e){i(e.message),n(!1)}}return(0,c.jsxs)(`div`,{className:`rounded-md border-2 border-danger/25 bg-danger/10 px-4 py-3 text-sm`,children:[(0,c.jsx)(`div`,{className:`font-semibold text-danger mb-1`,children:`Supergroup chat id changed`}),(0,c.jsxs)(`p`,{className:`text-danger mb-2`,children:[`Telegram migrated this supergroup to a new chat id (`,(0,c.jsx)(`code`,{className:`font-mono`,children:e}),`). The bot is still pointed at the old id. Reconnect to repoint it and re-create the `,(0,c.jsx)(`code`,{className:`font-mono`,children:`⚙ bazilion`}),` `,`service chat in the new team. Agent topic bindings will reconcile on next use.`]}),(0,c.jsx)(a,{variant:`primary`,onClick:o,disabled:t,children:t?`reconnecting…`:`Reconnect to ${e}`}),r&&(0,c.jsx)(`span`,{className:`ml-3 text-xs text-danger`,children:r})]})}function f({polling:e}){let t=e.startedAt?new Date(e.startedAt).toISOString():null,n=e.lastSuccessfulPollAt?new Date(e.lastSuccessfulPollAt).toISOString():null;return(0,c.jsxs)(`div`,{className:`mt-4 rounded-md border bg-muted/30 px-3 py-2 text-xs space-y-1`,children:[(0,c.jsx)(`p`,{className:`font-semibold uppercase tracking-wide text-muted-foreground`,children:`Polling state`}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 font-mono`,children:[(0,c.jsx)(`span`,{className:e.running?`text-success`:`text-danger`,children:e.running?`running`:`stopped`}),(0,c.jsx)(`span`,{className:e.activated?`text-success`:`text-warning`,children:e.activated?`activated`:`awaiting activation`}),e.lastUpdateId!==null&&(0,c.jsxs)(`span`,{children:[`last update `,e.lastUpdateId]}),t&&(0,c.jsxs)(`span`,{children:[`started `,t]}),n&&(0,c.jsxs)(`span`,{children:[`last poll `,n]})]}),e.error&&(0,c.jsxs)(`p`,{className:`text-danger`,children:[`error: `,e.error]})]})}function p({health:e}){if(e.error)return(0,c.jsxs)(`div`,{className:`rounded-md border border-danger/25 bg-danger/10 px-3 py-2 text-sm`,children:[(0,c.jsxs)(`p`,{className:`font-semibold text-danger`,children:[`Failed at `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.error.step})]}),(0,c.jsx)(`p`,{className:`text-danger mt-1`,children:e.error.message}),h(e.error.step)]});if(!e.preflight)return(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No preflight data.`});let t=e.preflight;return(0,c.jsxs)(`ul`,{className:`space-y-1.5`,children:[(0,c.jsxs)(m,{ok:t.botUsername.length>0,label:`Bot identity`,children:[`@`,t.botUsername]}),(0,c.jsx)(m,{ok:t.chatTitle.length>0,label:`Supergroup reachable`,children:t.chatTitle}),(0,c.jsx)(m,{ok:t.isForum,label:`Forum topics enabled`,children:t.isForum?`is_forum: true`:`is_forum: false — the supergroup owner must enable Topics in team settings`}),(0,c.jsx)(m,{ok:t.hasManageTopics,label:`Bot has can_manage_topics`,children:t.hasManageTopics?`admin with can_manage_topics`:`promote the bot to admin in the supergroup with the "Manage topics" permission`}),(0,c.jsx)(m,{ok:t.privacyModeOff,label:`Privacy Mode is OFF`,children:t.privacyModeOff?`can_read_all_group_messages: true`:`BotFather → /mybots → select bot → Bot Settings → Team Privacy → Turn off`})]})}function m({ok:e,label:t,children:n}){return(0,c.jsxs)(`li`,{className:`flex items-start gap-2 text-sm`,children:[(0,c.jsx)(`span`,{className:`mt-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold leading-none ${e?`bg-success/10 text-success`:`bg-danger/10 text-danger`}`,"aria-hidden":!0,children:e?`✓`:`✕`}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`font-medium`,children:t}),(0,c.jsx)(`span`,{className:`ml-2 text-xs ${e?`text-muted-foreground`:`text-danger`}`,children:n})]})]})}function h(e){switch(e){case`getMe`:return(0,c.jsx)(`p`,{className:`text-xs text-danger mt-1`,children:`The token is invalid or revoked. Re-issue with @BotFather → /token, or paste a fresh one above.`});case`getChat`:return(0,c.jsx)(`p`,{className:`text-xs text-danger mt-1`,children:`The chat id either doesn't exist, points at a basic team (not a supergroup), or the bot isn't a member. Forward any message from the supergroup to the bot to double-check the id, then add the bot to the team.`});case`getChatMember`:return(0,c.jsx)(`p`,{className:`text-xs text-danger mt-1`,children:`The bot is in the chat but the membership lookup failed. Usually means the bot was kicked or the chat id was migrated — confirm the bot is still in the supergroup.`})}}export{l as component};
@@ -1 +1 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{_ as i}from"./index-DUXAevpZ.js";import{t as a}from"./ConfigPage-BCwfgyjD.js";var o=e(n()),s=t();function c(e){return new Date(e).toISOString().slice(0,16).replace(`T`,` `)}function l(){let{tokens:e}=i.useLoaderData(),{all:t}=i.useSearch(),n=t===`1`,l=r(),[u,d]=(0,o.useState)(``),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)(!1);async function v(e){e.preventDefault(),h(null),_(!0);try{let e=await fetch(`/api/tokens`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({label:u})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}p((await e.json()).token),d(``),await l.invalidate()}catch(e){h(e.message)}finally{_(!1)}}async function y(e){await fetch(`/api/tokens/${e}`,{method:`DELETE`}),await l.invalidate()}return(0,s.jsxs)(a,{active:`tokens`,title:`API tokens`,description:(0,s.jsxs)(s.Fragment,{children:[`Manage per-client credentials for the HTTP API and CLI. The`,` `,(0,s.jsx)(`code`,{className:`font-mono`,children:`bootstrap`}),` token from`,` `,(0,s.jsx)(`code`,{className:`font-mono`,children:`~/.bazilion/auth.json`}),` remains protected; mint separate credentials for mobile, LAN, and remote clients.`]}),children:[(0,s.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,s.jsx)(`h3`,{className:`font-serif text-xl mb-3`,children:`Mint a new token`}),(0,s.jsxs)(`form`,{onSubmit:v,className:`mb-3 flex flex-col items-stretch gap-2 sm:flex-row sm:items-end`,children:[(0,s.jsxs)(`label`,{className:`w-full text-sm sm:w-auto`,children:[`Label`,(0,s.jsx)(`input`,{type:`text`,value:u,onChange:e=>d(e.target.value),required:!0,placeholder:`e.g. laptop-tailscale`,autoComplete:`off`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 text-sm sm:w-72`})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:g,className:`rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:g?`creating…`:`create`})]}),f&&(0,s.jsxs)(`div`,{className:`rounded-md border border-warning/25 bg-warning/10 p-3`,children:[(0,s.jsx)(`p`,{className:`text-xs text-warning mb-1`,children:`copy this token now — it is not recoverable later.`}),(0,s.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap break-all`,children:f})]}),m&&(0,s.jsx)(`p`,{className:`text-sm text-danger`,children:m})]}),(0,s.jsx)(`div`,{children:(0,s.jsxs)(`label`,{className:`text-sm flex items-center gap-2`,children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>{window.location.assign(e.target.checked?`/config/tokens?all=1`:`/config/tokens`)}}),`show revoked`]})}),(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`w-full min-w-[720px] text-sm`,children:[(0,s.jsx)(`thead`,{className:`text-left text-muted-foreground border-b`,children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{className:`py-2`,children:`label`}),(0,s.jsx)(`th`,{children:`id`}),(0,s.jsx)(`th`,{children:`state`}),(0,s.jsx)(`th`,{children:`created`}),(0,s.jsx)(`th`,{children:`last used`}),(0,s.jsx)(`th`,{})]})}),(0,s.jsxs)(`tbody`,{children:[e.length===0&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:6,className:`py-6 text-center text-muted-foreground italic`,children:`no tokens yet — mint one above`})}),e.map(e=>{let t=e.label===`bootstrap`;return(0,s.jsxs)(`tr`,{className:`border-b last:border-0 hover:bg-accent/30`,children:[(0,s.jsxs)(`td`,{className:`py-2`,children:[e.label,t&&(0,s.jsx)(`span`,{className:`ml-2 text-[0.7em] uppercase tracking-wide text-muted-foreground`,children:`auth.json`})]}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`code`,{className:`font-mono text-xs`,children:e.id})}),(0,s.jsx)(`td`,{children:e.revokedAt?(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`revoked`}):(0,s.jsx)(`span`,{className:`text-success`,children:`active`})}),(0,s.jsx)(`td`,{className:`text-muted-foreground text-xs`,children:c(e.createdAt)}),(0,s.jsx)(`td`,{className:`text-muted-foreground text-xs`,children:e.lastUsedAt?c(e.lastUsedAt):`(never)`}),(0,s.jsx)(`td`,{children:!e.revokedAt&&!t&&(0,s.jsx)(`button`,{type:`button`,onClick:()=>y(e.id),className:`rounded-md border px-2 py-1 text-xs text-danger hover:bg-danger/10`,children:`revoke`})})]},e.id)})]})]})})]})}export{l as component};
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{v as i}from"./index-nb2MV8X1.js";import{t as a}from"./ConfigPage-BCwfgyjD.js";var o=e(n()),s=t();function c(e){return new Date(e).toISOString().slice(0,16).replace(`T`,` `)}function l(){let{tokens:e}=i.useLoaderData(),{all:t}=i.useSearch(),n=t===`1`,l=r(),[u,d]=(0,o.useState)(``),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)(!1);async function v(e){e.preventDefault(),h(null),_(!0);try{let e=await fetch(`/api/tokens`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({label:u})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}p((await e.json()).token),d(``),await l.invalidate()}catch(e){h(e.message)}finally{_(!1)}}async function y(e){await fetch(`/api/tokens/${e}`,{method:`DELETE`}),await l.invalidate()}return(0,s.jsxs)(a,{active:`tokens`,title:`API tokens`,description:(0,s.jsxs)(s.Fragment,{children:[`Manage per-client credentials for the HTTP API and CLI. The`,` `,(0,s.jsx)(`code`,{className:`font-mono`,children:`bootstrap`}),` token from`,` `,(0,s.jsx)(`code`,{className:`font-mono`,children:`~/.bazilion/auth.json`}),` remains protected; mint separate credentials for mobile, LAN, and remote clients.`]}),children:[(0,s.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,s.jsx)(`h3`,{className:`font-serif text-xl mb-3`,children:`Mint a new token`}),(0,s.jsxs)(`form`,{onSubmit:v,className:`mb-3 flex flex-col items-stretch gap-2 sm:flex-row sm:items-end`,children:[(0,s.jsxs)(`label`,{className:`w-full text-sm sm:w-auto`,children:[`Label`,(0,s.jsx)(`input`,{type:`text`,value:u,onChange:e=>d(e.target.value),required:!0,placeholder:`e.g. laptop-tailscale`,autoComplete:`off`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 text-sm sm:w-72`})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:g,className:`rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:g?`creating…`:`create`})]}),f&&(0,s.jsxs)(`div`,{className:`rounded-md border border-warning/25 bg-warning/10 p-3`,children:[(0,s.jsx)(`p`,{className:`text-xs text-warning mb-1`,children:`copy this token now — it is not recoverable later.`}),(0,s.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap break-all`,children:f})]}),m&&(0,s.jsx)(`p`,{className:`text-sm text-danger`,children:m})]}),(0,s.jsx)(`div`,{children:(0,s.jsxs)(`label`,{className:`text-sm flex items-center gap-2`,children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>{window.location.assign(e.target.checked?`/config/tokens?all=1`:`/config/tokens`)}}),`show revoked`]})}),(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`w-full min-w-[720px] text-sm`,children:[(0,s.jsx)(`thead`,{className:`text-left text-muted-foreground border-b`,children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{className:`py-2`,children:`label`}),(0,s.jsx)(`th`,{children:`id`}),(0,s.jsx)(`th`,{children:`state`}),(0,s.jsx)(`th`,{children:`created`}),(0,s.jsx)(`th`,{children:`last used`}),(0,s.jsx)(`th`,{})]})}),(0,s.jsxs)(`tbody`,{children:[e.length===0&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:6,className:`py-6 text-center text-muted-foreground italic`,children:`no tokens yet — mint one above`})}),e.map(e=>{let t=e.label===`bootstrap`;return(0,s.jsxs)(`tr`,{className:`border-b last:border-0 hover:bg-accent/30`,children:[(0,s.jsxs)(`td`,{className:`py-2`,children:[e.label,t&&(0,s.jsx)(`span`,{className:`ml-2 text-[0.7em] uppercase tracking-wide text-muted-foreground`,children:`auth.json`})]}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`code`,{className:`font-mono text-xs`,children:e.id})}),(0,s.jsx)(`td`,{children:e.revokedAt?(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`revoked`}):(0,s.jsx)(`span`,{className:`text-success`,children:`active`})}),(0,s.jsx)(`td`,{className:`text-muted-foreground text-xs`,children:c(e.createdAt)}),(0,s.jsx)(`td`,{className:`text-muted-foreground text-xs`,children:e.lastUsedAt?c(e.lastUsedAt):`(never)`}),(0,s.jsx)(`td`,{children:!e.revokedAt&&!t&&(0,s.jsx)(`button`,{type:`button`,onClick:()=>y(e.id),className:`rounded-md border px-2 py-1 text-xs text-danger hover:bg-danger/10`,children:`revoke`})})]},e.id)})]})]})})]})}export{l as component};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{a as i}from"./index-nb2MV8X1.js";import{r as a}from"./Page-CwNuDhWz.js";import{t as o}from"./AgentTabs-R6gSjIj3.js";var s=e(n()),c=t();function l(){let{resolved:e,triggers:t,dispatches:n}=i.useLoaderData(),s=r();async function l(e){await fetch(`/api/triggers/${e.id}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:!e.enabled})}),await s.invalidate()}async function d(e){confirm(`delete this trigger?`)&&(await fetch(`/api/triggers/${e}`,{method:`DELETE`}),await s.invalidate())}return(0,c.jsxs)(a,{children:[(0,c.jsx)(`header`,{className:`mb-6`,children:(0,c.jsx)(`h1`,{children:e.agent.name})}),(0,c.jsx)(o,{agentId:e.agent.id,active:`triggers`,archived:e.agent.status===`archived`}),(0,c.jsx)(u,{agentId:e.agent.id,onAdded:()=>s.invalidate()}),(0,c.jsx)(`h3`,{className:`mb-3 mt-6 font-body text-[0.85em] font-semibold uppercase tracking-wider text-mocha-light`,children:`Active triggers`}),t.length===0?(0,c.jsx)(`p`,{className:`muted`,children:`no triggers yet — add one above.`}):(0,c.jsxs)(`table`,{children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`th`,{children:`id`}),(0,c.jsx)(`th`,{children:`kind`}),(0,c.jsx)(`th`,{children:`spec`}),(0,c.jsx)(`th`,{children:`message`}),(0,c.jsx)(`th`,{children:`last fired`}),(0,c.jsx)(`th`,{})]})}),(0,c.jsx)(`tbody`,{children:t.map(e=>{let t=e.kind===`interval`?`every ${e.intervalSec}s`:e.cronExpr,n=e.lastFiredAt?new Date(e.lastFiredAt).toLocaleString():`(never)`;return(0,c.jsxs)(`tr`,{className:e.enabled?``:`opacity-60`,children:[(0,c.jsx)(`td`,{children:(0,c.jsxs)(`code`,{children:[e.id.slice(0,8),`…`]})}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`span`,{className:`inline-block rounded-sm border border-frost bg-ivory px-2 py-0.5 font-mono text-[0.8em] text-mocha`,children:e.kind})}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`code`,{children:t})}),(0,c.jsx)(`td`,{children:e.message.length>60?`${e.message.slice(0,60)}…`:e.message}),(0,c.jsx)(`td`,{className:`text-[0.82em] text-mocha-light`,children:n}),(0,c.jsx)(`td`,{children:(0,c.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,c.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:()=>l(e),children:e.enabled?`disable`:`enable`}),(0,c.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:()=>d(e.id),children:`delete`})]})})]},e.id)})})]}),(0,c.jsx)(`h3`,{className:`mb-3 mt-8 font-body text-[0.85em] font-semibold uppercase tracking-wider text-mocha-light`,children:`Recent dispatches`}),n.length===0?(0,c.jsx)(`p`,{className:`muted`,children:`no scheduled occurrences yet.`}):(0,c.jsxs)(`table`,{children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`th`,{children:`scheduled`}),(0,c.jsx)(`th`,{children:`status`}),(0,c.jsx)(`th`,{children:`attempts`}),(0,c.jsx)(`th`,{children:`error`})]})}),(0,c.jsx)(`tbody`,{children:n.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`text-[0.82em]`,children:new Date(e.scheduledAt).toLocaleString()}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`code`,{children:e.status})}),(0,c.jsx)(`td`,{children:e.attemptCount}),(0,c.jsx)(`td`,{className:`text-[0.82em] text-mocha-light`,children:e.lastError??`—`})]},e.id))})]})]})}function u({agentId:e,onAdded:t}){let[n,r]=(0,s.useState)(`interval`),[i,a]=(0,s.useState)(300),[o,l]=(0,s.useState)(``),[u,d]=(0,s.useState)(``),[f,p]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1);async function g(r){if(r.preventDefault(),p(null),!u.trim()){p(`message is required`);return}if(n===`interval`&&(!Number.isFinite(i)||i<=0)){p(`interval must be a positive number`);return}if(n===`cron`&&!o.trim()){p(`cron expression is required`);return}h(!0);try{let r={kind:n,message:u.trim()};n===`interval`?r.intervalSec=i:r.cronExpr=o.trim();let s=await fetch(`/api/agents/${encodeURIComponent(e)}/triggers`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(!s.ok){let e=await s.json().catch(()=>null);throw Error(e?.error??s.statusText)}d(``),l(``),a(300),t()}catch(e){p(e.message)}finally{h(!1)}}return(0,c.jsxs)(`form`,{className:`card`,onSubmit:g,children:[(0,c.jsx)(`h3`,{children:`Add trigger`}),(0,c.jsxs)(`div`,{className:`mb-3 flex gap-3`,children:[(0,c.jsxs)(`label`,{className:`m-0 inline-flex cursor-pointer items-center gap-1`,children:[(0,c.jsx)(`input`,{type:`radio`,checked:n===`interval`,onChange:()=>r(`interval`)}),`interval (every N seconds)`]}),(0,c.jsxs)(`label`,{className:`m-0 inline-flex cursor-pointer items-center gap-1`,children:[(0,c.jsx)(`input`,{type:`radio`,checked:n===`cron`,onChange:()=>r(`cron`)}),`cron (5-field)`]})]}),n===`interval`?(0,c.jsxs)(`label`,{children:[`interval (seconds)`,(0,c.jsx)(`input`,{type:`number`,min:1,value:i,onChange:e=>a(Number(e.target.value))})]}):(0,c.jsxs)(`label`,{children:[`cron expression (minute hour dom month dow)`,(0,c.jsx)(`input`,{type:`text`,placeholder:`*/15 * * * *`,value:o,onChange:e=>l(e.target.value)})]}),(0,c.jsxs)(`label`,{children:[`message`,(0,c.jsx)(`textarea`,{placeholder:`e.g. check your inbox and act on anything new`,value:u,onChange:e=>d(e.target.value),className:`font-mono text-[0.9em] min-h-[80px]`})]}),(0,c.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,c.jsx)(`button`,{type:`submit`,disabled:m,children:m?`adding…`:`add`}),f&&(0,c.jsx)(`span`,{className:`text-[0.85em] text-danger`,children:f})]})]})}export{l as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{O as t}from"./index-DUXAevpZ.js";import{i as n,n as r,r as i}from"./Page-CwNuDhWz.js";var a=t(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),o=e();function s(){return(0,o.jsxs)(i,{size:`narrow`,children:[(0,o.jsx)(r,{eyebrow:`First run`,title:`Welcome to bazilion`,description:`Connect one model provider, then Bazilion will prepare your default Agent template and Team.`}),(0,o.jsxs)(n,{title:`Three steps to your first conversation`,children:[(0,o.jsxs)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:[`Before you can spawn agents, enable a provider and save at least one concrete model id. Once you do, a `,(0,o.jsx)(`code`,{children:`default`}),` Agent template (and a `,(0,o.jsx)(`code`,{children:`default`}),` team directory) are created automatically and the rest of the app unlocks.`]}),(0,o.jsxs)(`ol`,{className:`my-5 space-y-4`,children:[(0,o.jsxs)(c,{n:1,children:[(0,o.jsx)(`strong`,{children:`Choose a provider.`}),` Head to the`,` `,(0,o.jsx)(`a`,{href:`/config`,children:`providers tab`}),`, pick a provider, and set credentials or a local endpoint if that provider needs one. Local providers like Ollama and LM Studio can use their default loopback URLs.`]}),(0,o.jsxs)(c,{n:2,children:[(0,o.jsx)(`strong`,{children:`Enable it and save a model.`}),` Flip the provider's toggle on, then click a catalog chip or type one exact model id (for example`,` `,(0,o.jsx)(`code`,{children:`claude-opus-4-8`}),`, `,(0,o.jsx)(`code`,{children:`gpt-5.6-luna`}),`, or `,(0,o.jsx)(`code`,{children:`llama3.3`}),`) and press `,(0,o.jsx)(`em`,{children:`save models`}),`.`]}),(0,o.jsxs)(c,{n:3,children:[(0,o.jsx)(`strong`,{children:`Start chatting.`}),` You'll be redirected to the home page automatically, where the `,(0,o.jsx)(`code`,{children:`default`}),` Agent template is ready for your first spawn.`]})]}),(0,o.jsxs)(`a`,{href:`/config`,className:`btn-primary no-underline`,children:[`Configure providers `,(0,o.jsx)(a,{className:`h-4 w-4`,"aria-hidden":`true`})]})]})]})}function c({n:e,children:t}){return(0,o.jsxs)(`li`,{className:`grid grid-cols-[2rem_1fr] gap-3 border-t border-frost pt-3 first:border-t-0 first:pt-0`,children:[(0,o.jsx)(`span`,{className:`text-center font-display text-xl text-sapphire`,children:e}),(0,o.jsx)(`div`,{className:`text-[0.92em] leading-relaxed text-mocha`,children:t})]})}export{s as component};
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{A as t}from"./index-nb2MV8X1.js";import{i as n,n as r,r as i}from"./Page-CwNuDhWz.js";var a=t(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),o=e();function s(){return(0,o.jsxs)(i,{size:`narrow`,children:[(0,o.jsx)(r,{eyebrow:`First run`,title:`Welcome to bazilion`,description:`Connect one model provider, then Bazilion will prepare your default Agent template and Team.`}),(0,o.jsxs)(n,{title:`Three steps to your first conversation`,children:[(0,o.jsxs)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:[`Before you can spawn agents, enable a provider and save at least one concrete model id. Once you do, a `,(0,o.jsx)(`code`,{children:`default`}),` Agent template (and a `,(0,o.jsx)(`code`,{children:`default`}),` team directory) are created automatically and the rest of the app unlocks.`]}),(0,o.jsxs)(`ol`,{className:`my-5 space-y-4`,children:[(0,o.jsxs)(c,{n:1,children:[(0,o.jsx)(`strong`,{children:`Choose a provider.`}),` Head to the`,` `,(0,o.jsx)(`a`,{href:`/config`,children:`providers tab`}),`, pick a provider, and set credentials or a local endpoint if that provider needs one. Local providers like Ollama and LM Studio can use their default loopback URLs.`]}),(0,o.jsxs)(c,{n:2,children:[(0,o.jsx)(`strong`,{children:`Enable it and save a model.`}),` Flip the provider's toggle on, then click a catalog chip or type one exact model id (for example`,` `,(0,o.jsx)(`code`,{children:`claude-opus-4-8`}),`, `,(0,o.jsx)(`code`,{children:`gpt-5.6-luna`}),`, or `,(0,o.jsx)(`code`,{children:`llama3.3`}),`) and press `,(0,o.jsx)(`em`,{children:`save models`}),`.`]}),(0,o.jsxs)(c,{n:3,children:[(0,o.jsx)(`strong`,{children:`Start chatting.`}),` You'll be redirected to the home page automatically, where the `,(0,o.jsx)(`code`,{children:`default`}),` Agent template is ready for your first spawn.`]})]}),(0,o.jsxs)(`a`,{href:`/config`,className:`btn-primary no-underline`,children:[`Configure providers `,(0,o.jsx)(a,{className:`h-4 w-4`,"aria-hidden":`true`})]})]})]})}function c({n:e,children:t}){return(0,o.jsxs)(`li`,{className:`grid grid-cols-[2rem_1fr] gap-3 border-t border-frost pt-3 first:border-t-0 first:pt-0`,children:[(0,o.jsx)(`span`,{className:`text-center font-display text-xl text-sapphire`,children:e}),(0,o.jsx)(`div`,{className:`text-[0.92em] leading-relaxed text-mocha`,children:t})]})}export{s as component};
@@ -17,6 +17,11 @@ var TABS = [
17
17
  key: "triggers",
18
18
  href: (id) => `/agents/${id}/triggers`,
19
19
  label: "Triggers"
20
+ },
21
+ {
22
+ key: "learning",
23
+ href: (id) => `/agents/${id}/learning`,
24
+ label: "Learning"
20
25
  }
21
26
  ];
22
27
  function AgentTabs({ agentId, active, archived }) {
@@ -1,6 +1,6 @@
1
- import { t as Route } from "./_id-DqON-59C.js";
1
+ import { t as Route } from "./_id-FcHdSocl.js";
2
2
  import { r as PageShell } from "./Page-LENulSXY.js";
3
- import { t as AgentTabs } from "./AgentTabs-DoMDJBXH.js";
3
+ import { t as AgentTabs } from "./AgentTabs-aXdsiiMp.js";
4
4
  import { t as AgentAvatar } from "./AgentAvatar-8gTAy_tP.js";
5
5
  import { t as ChatPane } from "./ChatPane-Ba5wTsVk.js";
6
6
  import { r as REASONING_LEVELS } from "./wire-constants-C8nBJcU3.js";
@@ -2,7 +2,7 @@ import { t as createServerFn } from "../server.js";
2
2
  import { t as createSsrRpc } from "./createSsrRpc-DFsIAfFd.js";
3
3
  import { createFileRoute, lazyRouteComponent, redirect } from "@tanstack/react-router";
4
4
  //#region src/routes/agents/$id/index.tsx
5
- var $$splitComponentImporter = () => import("./_id-Cg7x6q3g.js");
5
+ var $$splitComponentImporter = () => import("./_id-BHYLL8M-.js");
6
6
  var fetchAgent = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(createSsrRpc("846c9081aed17057351730985f133b0aab67a5dabfca9562552829a90ff30849"));
7
7
  var Route = createFileRoute("/agents/$id/")({
8
8
  validateSearch: (search) => ({
@@ -12,11 +12,13 @@ var tsrStartManifest = () => ({ routes: {
12
12
  "/config/tokens",
13
13
  "/agents/",
14
14
  "/approvals/",
15
+ "/attention/",
15
16
  "/config/",
16
17
  "/skills/",
17
18
  "/teams/",
18
19
  "/templates/",
19
20
  "/agents/$id/inbox",
21
+ "/agents/$id/learning",
20
22
  "/agents/$id/triggers",
21
23
  "/config/integrations/telegram",
22
24
  "/teams/$id/activity",
@@ -32,7 +34,7 @@ var tsrStartManifest = () => ({ routes: {
32
34
  "/templates/teams/$id/"
33
35
  ],
34
36
  preloads: [
35
- "/assets/index-DUXAevpZ.js",
37
+ "/assets/index-nb2MV8X1.js",
36
38
  "/assets/jsx-runtime-DGeXAQPT.js",
37
39
  "/assets/preload-helper-mNuBjNXU.js",
38
40
  "/assets/react-3W8R1pOO.js"
@@ -40,40 +42,40 @@ var tsrStartManifest = () => ({ routes: {
40
42
  scripts: [{ attrs: {
41
43
  type: "module",
42
44
  async: !0,
43
- src: "/assets/index-DUXAevpZ.js"
45
+ src: "/assets/index-nb2MV8X1.js"
44
46
  } }]
45
47
  },
46
48
  "/": {
47
49
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/index.tsx",
48
50
  children: void 0,
49
51
  preloads: [
50
- "/assets/routes-BEfALSZv.js",
52
+ "/assets/routes-CH1ZTTo-.js",
51
53
  "/assets/Button-ByiV6fpd.js",
52
54
  "/assets/wire-constants-BhVKOCQa.js",
53
- "/assets/chevron-down-BK6NPMMP.js",
54
- "/assets/plus-b4yFXP0O.js"
55
+ "/assets/chevron-down-CJk0zGNT.js",
56
+ "/assets/plus-C3GroITC.js"
55
57
  ]
56
58
  },
57
59
  "/login": {
58
60
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/login.tsx",
59
61
  children: void 0,
60
- preloads: ["/assets/login-CNAV9Wer.js"]
62
+ preloads: ["/assets/login-DM1ytxQL.js"]
61
63
  },
62
64
  "/welcome": {
63
65
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/welcome.tsx",
64
66
  children: void 0,
65
- preloads: ["/assets/welcome-CvNr5IMi.js", "/assets/Page-CwNuDhWz.js"]
67
+ preloads: ["/assets/welcome-CuK0shDJ.js", "/assets/Page-CwNuDhWz.js"]
66
68
  },
67
69
  "/config/mcp": {
68
70
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/config/mcp.tsx",
69
71
  children: void 0,
70
- preloads: ["/assets/mcp-BKdEFwHO.js", "/assets/ConfigPage-BCwfgyjD.js"]
72
+ preloads: ["/assets/mcp-CetZbyUh.js", "/assets/ConfigPage-BCwfgyjD.js"]
71
73
  },
72
74
  "/config/services": {
73
75
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/config/services.tsx",
74
76
  children: void 0,
75
77
  preloads: [
76
- "/assets/services-DZP2ybzb.js",
78
+ "/assets/services-zk9SqN06.js",
77
79
  "/assets/ConfigPage-BCwfgyjD.js",
78
80
  "/assets/FieldRow-avAFLgYW.js"
79
81
  ]
@@ -81,13 +83,13 @@ var tsrStartManifest = () => ({ routes: {
81
83
  "/config/tokens": {
82
84
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/config/tokens.tsx",
83
85
  children: void 0,
84
- preloads: ["/assets/tokens-MuBfmgue.js", "/assets/ConfigPage-BCwfgyjD.js"]
86
+ preloads: ["/assets/tokens-DAPjRS0N.js", "/assets/ConfigPage-BCwfgyjD.js"]
85
87
  },
86
88
  "/agents/": {
87
89
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/agents/index.tsx",
88
90
  children: void 0,
89
91
  preloads: [
90
- "/assets/agents-UroO4d25.js",
92
+ "/assets/agents-B2usE-L_.js",
91
93
  "/assets/AgentAvatar-JYijLvZ2.js",
92
94
  "/assets/Button-ByiV6fpd.js",
93
95
  "/assets/Page-CwNuDhWz.js"
@@ -99,16 +101,27 @@ var tsrStartManifest = () => ({ routes: {
99
101
  preloads: [
100
102
  "/assets/approvals-DGi0PSx8.js",
101
103
  "/assets/RecoveryState-QfMSuwy3.js",
102
- "/assets/approvals-DKhF0YLC.js",
104
+ "/assets/approvals-DqLE6ttw.js",
103
105
  "/assets/Button-ByiV6fpd.js",
104
106
  "/assets/Page-CwNuDhWz.js"
105
107
  ]
106
108
  },
109
+ "/attention/": {
110
+ filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/attention/index.tsx",
111
+ children: void 0,
112
+ preloads: [
113
+ "/assets/attention-CkGozYnJ.js",
114
+ "/assets/Button-ByiV6fpd.js",
115
+ "/assets/Page-CwNuDhWz.js",
116
+ "/assets/attention-Gavt2yEp.js",
117
+ "/assets/RecoveryState-QfMSuwy3.js"
118
+ ]
119
+ },
107
120
  "/config/": {
108
121
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/config/index.tsx",
109
122
  children: void 0,
110
123
  preloads: [
111
- "/assets/config-q8JDresK.js",
124
+ "/assets/config-xrXoDEWM.js",
112
125
  "/assets/ConfigPage-BCwfgyjD.js",
113
126
  "/assets/FieldRow-avAFLgYW.js"
114
127
  ]
@@ -117,7 +130,7 @@ var tsrStartManifest = () => ({ routes: {
117
130
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/skills/index.tsx",
118
131
  children: void 0,
119
132
  preloads: [
120
- "/assets/skills-DoeIjITs.js",
133
+ "/assets/skills-tXDpomHW.js",
121
134
  "/assets/Button-ByiV6fpd.js",
122
135
  "/assets/Page-CwNuDhWz.js"
123
136
  ]
@@ -128,7 +141,7 @@ var tsrStartManifest = () => ({ routes: {
128
141
  preloads: [
129
142
  "/assets/teams-CSNyLz3l.js",
130
143
  "/assets/RecoveryState-QfMSuwy3.js",
131
- "/assets/teams-DlHRnrQw.js",
144
+ "/assets/teams-D1c8zlxs.js",
132
145
  "/assets/Button-ByiV6fpd.js",
133
146
  "/assets/Page-CwNuDhWz.js"
134
147
  ]
@@ -137,8 +150,18 @@ var tsrStartManifest = () => ({ routes: {
137
150
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/agents/$id/inbox.tsx",
138
151
  children: void 0,
139
152
  preloads: [
140
- "/assets/inbox-BwoRikj1.js",
141
- "/assets/AgentTabs-B3hq5a3e.js",
153
+ "/assets/inbox-BoIvl9ZF.js",
154
+ "/assets/AgentTabs-R6gSjIj3.js",
155
+ "/assets/Page-CwNuDhWz.js"
156
+ ]
157
+ },
158
+ "/agents/$id/learning": {
159
+ filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/agents/$id/learning.tsx",
160
+ children: void 0,
161
+ preloads: [
162
+ "/assets/learning-6_oYn1l7.js",
163
+ "/assets/AgentTabs-R6gSjIj3.js",
164
+ "/assets/Button-ByiV6fpd.js",
142
165
  "/assets/Page-CwNuDhWz.js"
143
166
  ]
144
167
  },
@@ -146,8 +169,8 @@ var tsrStartManifest = () => ({ routes: {
146
169
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/agents/$id/triggers.tsx",
147
170
  children: void 0,
148
171
  preloads: [
149
- "/assets/triggers-CX7RMQFQ.js",
150
- "/assets/AgentTabs-B3hq5a3e.js",
172
+ "/assets/triggers-D8R-5guA.js",
173
+ "/assets/AgentTabs-R6gSjIj3.js",
151
174
  "/assets/Page-CwNuDhWz.js"
152
175
  ]
153
176
  },
@@ -155,7 +178,7 @@ var tsrStartManifest = () => ({ routes: {
155
178
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/config/integrations/telegram.tsx",
156
179
  children: void 0,
157
180
  preloads: [
158
- "/assets/telegram-2OdeGv4E.js",
181
+ "/assets/telegram-DCe1CWMt.js",
159
182
  "/assets/Button-ByiV6fpd.js",
160
183
  "/assets/ConfigPage-BCwfgyjD.js"
161
184
  ]
@@ -164,40 +187,40 @@ var tsrStartManifest = () => ({ routes: {
164
187
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/teams/$id/activity.tsx",
165
188
  children: void 0,
166
189
  preloads: [
167
- "/assets/activity-C7o6-xHg.js",
190
+ "/assets/activity-DJuhhQCb.js",
191
+ "/assets/RecoveryState-QfMSuwy3.js",
192
+ "/assets/activity-uqhwzmiy.js",
168
193
  "/assets/Button-ByiV6fpd.js",
169
194
  "/assets/Page-CwNuDhWz.js",
170
- "/assets/TeamTabs-sQBHChtd.js",
171
- "/assets/chevron-down-BK6NPMMP.js",
172
- "/assets/activity-DJuhhQCb.js",
173
- "/assets/RecoveryState-QfMSuwy3.js"
195
+ "/assets/TeamTabs-C1Hakkff.js",
196
+ "/assets/chevron-down-CJk0zGNT.js"
174
197
  ]
175
198
  },
176
199
  "/teams/$id/context": {
177
200
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/teams/$id/context.tsx",
178
201
  children: void 0,
179
202
  preloads: [
180
- "/assets/context-CBucAoi6.js",
203
+ "/assets/context-ZWqx3uiC.js",
181
204
  "/assets/Page-CwNuDhWz.js",
182
- "/assets/TeamTabs-sQBHChtd.js"
205
+ "/assets/TeamTabs-C1Hakkff.js"
183
206
  ]
184
207
  },
185
208
  "/teams/$id/members": {
186
209
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/teams/$id/members.tsx",
187
210
  children: void 0,
188
211
  preloads: [
189
- "/assets/members-BDqZQh26.js",
212
+ "/assets/members-DdqWtwZd.js",
190
213
  "/assets/Page-CwNuDhWz.js",
191
- "/assets/TeamTabs-sQBHChtd.js"
214
+ "/assets/TeamTabs-C1Hakkff.js"
192
215
  ]
193
216
  },
194
217
  "/teams/$id/memory": {
195
218
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/teams/$id/memory.tsx",
196
219
  children: void 0,
197
220
  preloads: [
198
- "/assets/memory-DVdEVr6L.js",
221
+ "/assets/memory-FNrxFHmC.js",
199
222
  "/assets/Page-CwNuDhWz.js",
200
- "/assets/TeamTabs-sQBHChtd.js"
223
+ "/assets/TeamTabs-C1Hakkff.js"
201
224
  ]
202
225
  },
203
226
  "/teams/$id/policy": {
@@ -205,12 +228,12 @@ var tsrStartManifest = () => ({ routes: {
205
228
  children: void 0,
206
229
  css: ["/assets/ProductionTeamPolicyEditor-DLioOiRN.css"],
207
230
  preloads: [
208
- "/assets/policy-DdDctqvg.js",
231
+ "/assets/policy-BKPejYRI.js",
209
232
  "/assets/Button-ByiV6fpd.js",
210
233
  "/assets/Page-CwNuDhWz.js",
211
234
  "/assets/RecoveryState-QfMSuwy3.js",
212
- "/assets/TeamTabs-sQBHChtd.js",
213
- "/assets/ProductionTeamPolicyEditor-B6dbpuYy.js",
235
+ "/assets/TeamTabs-C1Hakkff.js",
236
+ "/assets/ProductionTeamPolicyEditor-CSL3W7XM.js",
214
237
  "/assets/policy-K4hIbbIN.js"
215
238
  ]
216
239
  },
@@ -218,9 +241,9 @@ var tsrStartManifest = () => ({ routes: {
218
241
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/agents/$id/index.tsx",
219
242
  children: void 0,
220
243
  preloads: [
221
- "/assets/_id-C9rkCclz.js",
244
+ "/assets/_id-BOC7ioJu.js",
222
245
  "/assets/AgentAvatar-JYijLvZ2.js",
223
- "/assets/AgentTabs-B3hq5a3e.js",
246
+ "/assets/AgentTabs-R6gSjIj3.js",
224
247
  "/assets/wire-constants-BhVKOCQa.js",
225
248
  "/assets/Page-CwNuDhWz.js"
226
249
  ]
@@ -229,21 +252,21 @@ var tsrStartManifest = () => ({ routes: {
229
252
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/teams/$id/index.tsx",
230
253
  children: void 0,
231
254
  preloads: [
232
- "/assets/_id-D65IzC8H.js",
255
+ "/assets/_id-wkjjWLz0.js",
233
256
  "/assets/Button-ByiV6fpd.js",
234
257
  "/assets/Page-CwNuDhWz.js",
235
- "/assets/TeamTabs-sQBHChtd.js"
258
+ "/assets/TeamTabs-C1Hakkff.js"
236
259
  ]
237
260
  },
238
261
  "/templates/agents/": {
239
262
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/templates/agents/index.tsx",
240
263
  children: void 0,
241
264
  preloads: [
242
- "/assets/agents-h8yWXQ2H.js",
265
+ "/assets/agents-FaQtkAWs.js",
243
266
  "/assets/Button-ByiV6fpd.js",
244
267
  "/assets/Page-CwNuDhWz.js",
245
- "/assets/TemplatesTabs-DPsuwsWB.js",
246
- "/assets/ProfileCommunicationEditor-Bf8UvmZT.js",
268
+ "/assets/TemplatesTabs-klEydJ8-.js",
269
+ "/assets/ProfileCommunicationEditor-CwU0QkmE.js",
247
270
  "/assets/team-policy-D0jpnn2b.js"
248
271
  ]
249
272
  },
@@ -251,35 +274,35 @@ var tsrStartManifest = () => ({ routes: {
251
274
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/templates/teams/index.tsx",
252
275
  children: void 0,
253
276
  preloads: [
254
- "/assets/teams-W3j-UoJ9.js",
277
+ "/assets/teams-BZYjekBN.js",
255
278
  "/assets/Button-ByiV6fpd.js",
256
279
  "/assets/Page-CwNuDhWz.js",
257
- "/assets/TemplatesTabs-DPsuwsWB.js"
280
+ "/assets/TemplatesTabs-klEydJ8-.js"
258
281
  ]
259
282
  },
260
283
  "/templates/agents/$id/": {
261
284
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/templates/agents/$id/index.tsx",
262
285
  children: void 0,
263
286
  preloads: [
264
- "/assets/_id-DYASsGQ8.js",
287
+ "/assets/_id-CnVq-rED.js",
265
288
  "/assets/Page-CwNuDhWz.js",
266
- "/assets/TemplatesTabs-DPsuwsWB.js",
267
- "/assets/ProfileCommunicationEditor-Bf8UvmZT.js",
289
+ "/assets/TemplatesTabs-klEydJ8-.js",
290
+ "/assets/ProfileCommunicationEditor-CwU0QkmE.js",
268
291
  "/assets/team-policy-D0jpnn2b.js"
269
292
  ]
270
293
  },
271
294
  "/templates/teams/$id/": {
272
295
  filePath: "/home/runner/work/bazilion/bazilion/apps/web/src/routes/templates/teams/$id/index.tsx",
273
296
  children: void 0,
274
- css: ["/assets/ProductionTeamPolicyEditor-DLioOiRN.css"],
275
297
  preloads: [
276
- "/assets/_id-DE4IY5bL.js",
277
- "/assets/Page-CwNuDhWz.js",
298
+ "/assets/_id-DGyKURCp.js",
278
299
  "/assets/RecoveryState-QfMSuwy3.js",
279
- "/assets/TemplatesTabs-DPsuwsWB.js",
280
- "/assets/ProductionTeamPolicyEditor-B6dbpuYy.js",
281
- "/assets/_id-DGyKURCp.js"
282
- ]
300
+ "/assets/_id-e4u7dmBb.js",
301
+ "/assets/Page-CwNuDhWz.js",
302
+ "/assets/TemplatesTabs-klEydJ8-.js",
303
+ "/assets/ProductionTeamPolicyEditor-CSL3W7XM.js"
304
+ ],
305
+ css: ["/assets/ProductionTeamPolicyEditor-DLioOiRN.css"]
283
306
  }
284
307
  } });
285
308
  //#endregion
@@ -0,0 +1,11 @@
1
+ import { t as RecoveryState } from "./RecoveryState-B2SG-mrY.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/routes/attention/index.tsx?tsr-split=errorComponent
4
+ var SplitErrorComponent = ({ error, reset }) => /* @__PURE__ */ jsx(RecoveryState, {
5
+ title: "Attention Center unavailable",
6
+ error,
7
+ reset,
8
+ fallbackHref: "/"
9
+ });
10
+ //#endregion
11
+ export { SplitErrorComponent as errorComponent };
@@ -0,0 +1,14 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-DFsIAfFd.js";
3
+ import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
+ //#region src/routes/attention/index.tsx
5
+ var $$splitErrorComponentImporter = () => import("./attention-BW_6ddkj.js");
6
+ var $$splitComponentImporter = () => import("./attention-w21GQIGH.js");
7
+ var loadAttention = createServerFn({ method: "GET" }).handler(createSsrRpc("883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a"));
8
+ var Route = createFileRoute("/attention/")({
9
+ loader: () => loadAttention(),
10
+ component: lazyRouteComponent($$splitComponentImporter, "component"),
11
+ errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent")
12
+ });
13
+ //#endregion
14
+ export { Route as t };
@@ -0,0 +1,19 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createServerRpc } from "./createServerRpc-pU-IQV2Y.js";
3
+ import { n as daemonClient } from "./daemon-client-2NRMzlTr.js";
4
+ //#region src/routes/attention/index.tsx?tss-serverfn-split
5
+ var loadAttention_createServerFn_handler = createServerRpc({
6
+ id: "883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a",
7
+ name: "loadAttention",
8
+ filename: "src/routes/attention/index.tsx"
9
+ }, (opts) => loadAttention.__executeServer(opts));
10
+ var loadAttention = createServerFn({ method: "GET" }).handler(loadAttention_createServerFn_handler, async () => {
11
+ const client = daemonClient();
12
+ const [list, summary] = await Promise.all([client.get("/api/attention?state=all&limit=200"), client.get("/api/attention/summary")]);
13
+ return {
14
+ list,
15
+ summary
16
+ };
17
+ });
18
+ //#endregion
19
+ export { loadAttention_createServerFn_handler };