bazilion 0.16.0 → 0.18.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 (128) hide show
  1. package/dist/cli.js +672 -87
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +3759 -432
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/migrations/0001_init.sql +169 -0
  6. package/dist/web/client/assets/ChatPane-CAYS_fIQ.js +76 -0
  7. package/dist/web/client/assets/ConfirmDialog-BzIiABOP.js +1 -0
  8. package/dist/web/client/assets/{FieldRow-DJ2Gx4Du.js → FieldRow-W_54rw5c.js} +1 -1
  9. package/dist/web/client/assets/ProductionTeamPolicyEditor-DNXVX8Lz.js +7 -0
  10. package/dist/web/client/assets/ProfileCommunicationEditor-DN0fOzqn.js +1 -0
  11. package/dist/web/client/assets/{ResultSourceConversation-CtzJ8QA-.js → ResultSourceConversation-DoU4tOWc.js} +1 -1
  12. package/dist/web/client/assets/TeamTabs-BmTZRI4T.js +1 -0
  13. package/dist/web/client/assets/TemplatesTabs-Bs_OXKwx.js +1 -0
  14. package/dist/web/client/assets/{UnsavedChangesGuard-BCsLw-mU.js → UnsavedChangesGuard-CPRtFReU.js} +1 -1
  15. package/dist/web/client/assets/{_id-DxopIW-y.js → _id-CxAB4TDr.js} +1 -1
  16. package/dist/web/client/assets/_id-DL4tJFQB.js +1 -0
  17. package/dist/web/client/assets/{_id-BEDmIXVf.js → _id-DR9eFC17.js} +1 -1
  18. package/dist/web/client/assets/{_id-BFM_tn_s.js → _id-Dbmei5tg.js} +1 -1
  19. package/dist/web/client/assets/{_id-B5Ov7cdO.js → _id-ybF-pqmr.js} +1 -1
  20. package/dist/web/client/assets/activity-oUyy77jD.js +1 -0
  21. package/dist/web/client/assets/{agents-CMPOFcs-.js → agents-D_TrEqAg.js} +1 -1
  22. package/dist/web/client/assets/{agents-O4soKZND.js → agents-DkjJp7JP.js} +1 -1
  23. package/dist/web/client/assets/{approvals-CwDu_lrA.js → approvals-DhOerWdt.js} +1 -1
  24. package/dist/web/client/assets/{attention-BY8MMuM_.js → attention-DGwiF-Jy.js} +1 -1
  25. package/dist/web/client/assets/chevron-right-DSa4xPTs.js +1 -0
  26. package/dist/web/client/assets/config-BJ2ZzHPR.js +3 -0
  27. package/dist/web/client/assets/createServerFn-Dzfjt7mA.js +3 -0
  28. package/dist/web/client/assets/git-review-presentation-CzHQulDk.js +1 -0
  29. package/dist/web/client/assets/{inbox-CWXql0K3.js → inbox-BUElnGep.js} +1 -1
  30. package/dist/web/client/assets/index-Bi-HxcPG.js +50 -0
  31. package/dist/web/client/assets/{learning-DAm4dyyc.js → learning-BiTHNwB3.js} +1 -1
  32. package/dist/web/client/assets/login-BmcZvAH2.js +1 -0
  33. package/dist/web/client/assets/{mcp-loLB0wuh.js → mcp-Cwk9V82W.js} +1 -1
  34. package/dist/web/client/assets/{members-BJ0ikkTl.js → members-CHDNabFh.js} +1 -1
  35. package/dist/web/client/assets/{memory-Drn9Gv53.js → memory-Cx_Fpd4e.js} +1 -1
  36. package/dist/web/client/assets/policy-C0nMdwcG.js +1 -0
  37. package/dist/web/client/assets/{results-9exU6f7m.js → results-Bz3jASs-.js} +1 -1
  38. package/dist/web/client/assets/review-AK9WGmpv.js +1 -0
  39. package/dist/web/client/assets/routes-DsMY_6oy.js +1 -0
  40. package/dist/web/client/assets/{services-BLso1BhA.js → services-DItA6fJ7.js} +1 -1
  41. package/dist/web/client/assets/{skills-BodqX3OI.js → skills-DbNV2vgL.js} +1 -1
  42. package/dist/web/client/assets/{styles-d1yjBpud.css → styles-C6br2xxl.css} +1 -1
  43. package/dist/web/client/assets/{teams-ByQedXZi.js → teams-D83scDxw.js} +1 -1
  44. package/dist/web/client/assets/{teams-SYsF1bOR.js → teams-DAny1ypN.js} +1 -1
  45. package/dist/web/client/assets/{telegram-DC9PLFbB.js → telegram-BOmf9vUh.js} +1 -1
  46. package/dist/web/client/assets/{tokens-DGy8Ijpo.js → tokens-DBGH6Bw5.js} +1 -1
  47. package/dist/web/client/assets/{triggers-BXpVmHDG.js → triggers-D1_pseI3.js} +1 -1
  48. package/dist/web/client/assets/verifications-CBTo-FyV.js +2 -0
  49. package/dist/web/client/assets/welcome-DAfPOm15.js +1 -0
  50. package/dist/web/client/assets/x-CWY-gUaM.js +1 -0
  51. package/dist/web/server/assets/{ChatPane-CS5oI7ef.js → ChatPane-DybH39WK.js} +301 -14
  52. package/dist/web/server/assets/{ResultSourceConversation-BpVWBRYq.js → ResultSourceConversation-BmXTcEOA.js} +1 -1
  53. package/dist/web/server/assets/{TeamTabs-TCKjCvMA.js → TeamTabs-Dg4v6x0-.js} +8 -0
  54. package/dist/web/server/assets/{_id-DtIYuJJX.js → _id--onriuvj.js} +1 -1
  55. package/dist/web/server/assets/{_id-DOnInzLb.js → _id--zoh1vv7.js} +1 -1
  56. package/dist/web/server/assets/{_id-CeyHEsCZ.js → _id-6p-mDmI8.js} +1 -1
  57. package/dist/web/server/assets/{_id-5pgKoid8.js → _id-BN1BPEDI.js} +1 -1
  58. package/dist/web/server/assets/{_id-DFHB9JFQ.js → _id-BYKpT2Tu.js} +1 -1
  59. package/dist/web/server/assets/{_id-B_-CDHOi2.js → _id-BqWTB8Wl.js} +1 -1
  60. package/dist/web/server/assets/{_id-BnqodC1c2.js → _id-C_2er0_G.js} +3 -3
  61. package/dist/web/server/assets/{_id-BG2nkGxa.js → _id-DptBl3X8.js} +1 -1
  62. package/dist/web/server/assets/{_id-DwZXhLlL.js → _id-EAjRXNbD.js} +2 -2
  63. package/dist/web/server/assets/{_id-DrB9uR1b.js → _id-dUnXL-My2.js} +1 -1
  64. package/dist/web/server/assets/{_tanstack-start-manifest_v-D7gKv6m6.js → _tanstack-start-manifest_v-B3M-dfRO.js} +108 -84
  65. package/dist/web/server/assets/{activity-0VUkStOu.js → activity-C5jpoEQI.js} +1 -1
  66. package/dist/web/server/assets/{activity-C88qrNqv.js → activity-Cu7zKPGD.js} +1 -1
  67. package/dist/web/server/assets/{activity-5fWKPDxj.js → activity-Dn50vkQP.js} +2 -2
  68. package/dist/web/server/assets/{agents-CSXLaM2W.js → agents-RE6aYOb-.js} +1 -1
  69. package/dist/web/server/assets/{agents-C86K6HvS.js → agents-nAOx_H7s.js} +1 -1
  70. package/dist/web/server/assets/{approvals-C3MysI6l.js → approvals-DhHxIDrL.js} +1 -1
  71. package/dist/web/server/assets/{attention-DLeLCKah.js → attention-CBWzWRni.js} +1 -1
  72. package/dist/web/server/assets/{auth-CDZp9aEk.js → auth-tB3i6cFd.js} +1 -1
  73. package/dist/web/server/assets/{config-BVTHvljR.js → config-D1k_tTAw.js} +1 -1
  74. package/dist/web/server/assets/{daemon-client-xWyYKAcx.js → daemon-client-C7qjQ2iO.js} +45 -0
  75. package/dist/web/server/assets/git-review-BB3M9nYg.js +26 -0
  76. package/dist/web/server/assets/git-review-Bf5ABFJg.js +179 -0
  77. package/dist/web/server/assets/git-review-presentation-TJiHJhen.js +81 -0
  78. package/dist/web/server/assets/{inbox-PQTrjtOw.js → inbox-Dw4pTevh.js} +1 -1
  79. package/dist/web/server/assets/{learning-K0cmDsZR.js → learning-CF8ZzFVD.js} +1 -1
  80. package/dist/web/server/assets/{mcp-Rtraochg.js → mcp-D5dmBT82.js} +1 -1
  81. package/dist/web/server/assets/{members-CD3GiTfF.js → members-Bd0OtiTr.js} +1 -1
  82. package/dist/web/server/assets/{members-grAKFWgv.js → members-CvwEN9pm.js} +1 -1
  83. package/dist/web/server/assets/{members-cc5SeEaW.js → members-xSXoYUOd.js} +2 -2
  84. package/dist/web/server/assets/{memory-egFpBD1g.js → memory-CcPK7um7.js} +1 -1
  85. package/dist/web/server/assets/{memory-C5i_GxlY.js → memory-UP6AsRkO.js} +2 -2
  86. package/dist/web/server/assets/{memory-CVqnyUaM.js → memory-lo2vHRNw.js} +1 -1
  87. package/dist/web/server/assets/{policy-bLKwvnja.js → policy-B62WXIFo.js} +1 -1
  88. package/dist/web/server/assets/{policy-Dgjb0_gK.js → policy-Bze9Krhg.js} +2 -2
  89. package/dist/web/server/assets/{policy-ooSBgiDS.js → policy-Dh6wd2wN.js} +1 -1
  90. package/dist/web/server/assets/{results-N-kP4iFT.js → results-BFqs2iOu.js} +1 -1
  91. package/dist/web/server/assets/{results-DXdYtHaq.js → results-BWnu3gXP.js} +1 -1
  92. package/dist/web/server/assets/{results-CfNsFncJ.js → results-CzZk50Fu.js} +3 -3
  93. package/dist/web/server/assets/review-DUe3vHPU.js +393 -0
  94. package/dist/web/server/assets/review-c_-cFi7H.js +14 -0
  95. package/dist/web/server/assets/{router-B6g_s7W3.js → router-Deq94UJQ.js} +41 -27
  96. package/dist/web/server/assets/{routes-pcRy_Sf8.js → routes-B6x3pEW8.js} +1 -1
  97. package/dist/web/server/assets/{routes-BqSaZvlu.js → routes-CVKkvFVv.js} +1 -1
  98. package/dist/web/server/assets/{routes-Dsh8F_7i.js → routes-DsUzzxk4.js} +2 -2
  99. package/dist/web/server/assets/{services-DlZA8fRL.js → services-CEr61xb5.js} +1 -1
  100. package/dist/web/server/assets/{skills-i2duvgW-.js → skills-BImC3LTO.js} +1 -1
  101. package/dist/web/server/assets/{teams-6RYIj1Xm.js → teams-8zEIo08E.js} +1 -1
  102. package/dist/web/server/assets/{teams-B1AI3NfN.js → teams-D-yaAWLV.js} +1 -1
  103. package/dist/web/server/assets/{telegram-C4q0YTVn.js → telegram-CGl_LFtJ.js} +1 -1
  104. package/dist/web/server/assets/{tokens-RFquA2Bx.js → tokens-cB-uf7qm.js} +1 -1
  105. package/dist/web/server/assets/{triggers-DVD-iE-N.js → triggers-CtSj79L0.js} +1 -1
  106. package/dist/web/server/assets/verification-B5QjcpIo.js +97 -0
  107. package/dist/web/server/assets/verifications-BfQsfwSE.js +268 -0
  108. package/dist/web/server/assets/verifications-CUq_6ZqL.js +26 -0
  109. package/dist/web/server/server.js +72 -28
  110. package/dist/worker.js +470 -79
  111. package/dist/worker.js.map +1 -1
  112. package/package.json +3 -3
  113. package/dist/web/client/assets/ChatPane-CQZzxOir.js +0 -76
  114. package/dist/web/client/assets/ConfirmDialog-MicTTwdy.js +0 -1
  115. package/dist/web/client/assets/ProductionTeamPolicyEditor-DqUnN_ce.js +0 -7
  116. package/dist/web/client/assets/ProfileCommunicationEditor-DArXub0b.js +0 -1
  117. package/dist/web/client/assets/TeamTabs-DbIk5vvT.js +0 -1
  118. package/dist/web/client/assets/TemplatesTabs-CatJIjGi.js +0 -1
  119. package/dist/web/client/assets/_id-CrnEVcw8.js +0 -1
  120. package/dist/web/client/assets/activity-CrG8Bg60.js +0 -1
  121. package/dist/web/client/assets/chevron-right-Cf6vKeLq.js +0 -1
  122. package/dist/web/client/assets/config-Cn4iBJFz.js +0 -3
  123. package/dist/web/client/assets/index-Bq2zrG2_.js +0 -52
  124. package/dist/web/client/assets/login-BsABI8Ux.js +0 -1
  125. package/dist/web/client/assets/policy-pQadZyk0.js +0 -1
  126. package/dist/web/client/assets/routes-jw1PuqiR.js +0 -1
  127. package/dist/web/client/assets/welcome-BKsnsCxJ.js +0 -1
  128. package/dist/web/client/assets/x-BK4xNCzS.js +0 -1
@@ -1,3 +0,0 @@
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-bztXdkDj.js";import{t as i}from"./chevron-right-Cf6vKeLq.js";import{t as a}from"./ConfirmDialog-MicTTwdy.js";import{C as o,K as s,Y as c,q as l}from"./index-Bq2zrG2_.js";import{a as u,t as d}from"./Page-NV96O47A.js";import{t as f}from"./Button-ByiV6fpd.js";import{t as p}from"./ConfigPage-BCLp-FUC.js";import{t as m}from"./FieldRow-DJ2Gx4Du.js";var h=c(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),g=c(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),_=c(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),v=e(n()),y=t();function b({status:e}){let t=e.configuredOperatorHttp,n=e.protectedUnattendedTurns;return(0,y.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,y.jsxs)(`header`,{className:`border-b px-4 py-3`,children:[(0,y.jsx)(`h2`,{className:`font-semibold`,children:`Execution security`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Operator HTTP requests keep their configured compatibility behavior. Unattended sources use a separate mandatory protected baseline.`})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 p-4 lg:grid-cols-2`,children:[(0,y.jsxs)(`section`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,y.jsx)(`h3`,{className:`font-semibold`,children:`Configured operator HTTP`}),(0,y.jsx)(x,{ok:!1,children:`legacy · unprotected`})]}),(0,y.jsxs)(`dl`,{className:`space-y-2 text-sm`,children:[(0,y.jsx)(S,{label:`Coding surface`,value:C(t.codingSurface)}),(0,y.jsx)(S,{label:`Docker image`,value:t.dockerImage,mono:!0}),(0,y.jsx)(S,{label:`Browser`,value:t.browser}),(0,y.jsx)(S,{label:`MCP`,value:t.mcp})]}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`This compatibility branch is for operator requests; Telegram and unattended delivery never select it.`})]}),(0,y.jsxs)(`section`,{className:`rounded-md border p-3 ${n.baseRuntimeReady?`border-success/25 bg-success/5`:`border-warning/25 bg-warning/10`}`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,y.jsx)(`h3`,{className:`font-semibold`,children:`Protected unattended turns`}),(0,y.jsx)(x,{ok:n.baseRuntimeReady,children:n.baseRuntimeReady?`base runtime ready`:`base runtime unavailable`})]}),(0,y.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Telegram, schedules, inbox wake-ups, and approval delivery cannot select the legacy surface.`}),(0,y.jsxs)(`dl`,{className:`space-y-2 text-sm`,children:[(0,y.jsx)(S,{label:`Coding surface`,value:`Docker only`}),(0,y.jsx)(S,{label:`Docker`,value:n.docker.ready?`ready`:`unavailable`,ok:n.docker.ready}),(0,y.jsx)(S,{label:`Docker image`,value:n.docker.image,mono:!0}),n.docker.reason&&(0,y.jsx)(S,{label:`Docker reason`,value:n.docker.reason}),(0,y.jsx)(S,{label:`OpenAI Codex enabled`,value:w(n.openaiCodex.enabled),ok:n.openaiCodex.enabled}),(0,y.jsx)(S,{label:`ChatGPT connected`,value:w(n.openaiCodex.connected),ok:n.openaiCodex.connected}),(0,y.jsx)(S,{label:`OpenAI access`,value:T(n.openaiCodex),ok:n.openaiCodex.accessCurrent||n.openaiCodex.refreshOnNextTurn}),(0,y.jsx)(S,{label:`OpenAI Codex baseline eligible`,value:w(n.openaiCodex.baselineEligible),ok:n.openaiCodex.baselineEligible}),(0,y.jsx)(S,{label:`Browser`,value:n.browser,ok:!0}),(0,y.jsx)(S,{label:`MCP`,value:n.mcp,ok:!0})]}),n.remediation&&(0,y.jsxs)(`p`,{className:`mt-3 rounded-md border border-warning/25 bg-background/60 px-3 py-2 text-xs text-warning`,children:[(0,y.jsx)(`strong`,{children:`Remediation:`}),` `,n.remediation]}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Every turn separately validates its selected normal/review model, bound OAuth refresh, and Team/input/memory/skill mounts and paths before execution.`})]})]})]})}function x({ok:e,children:t}){return(0,y.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs font-semibold uppercase ${e?`bg-success/10 text-success`:`bg-warning/10 text-warning`}`,children:t})}function S({label:e,value:t,ok:n,mono:r=!1}){return(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,y.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,y.jsx)(`dd`,{className:`${r?`font-mono`:`font-medium`} text-right ${n===void 0?``:n?`text-success`:`text-warning`}`,children:t})]})}function C(e){return e===`host`?`Host tools`:e===`docker`?`Docker only`:`Unavailable`}function w(e){return e?`yes`:`no`}function T(e){return e.accessCurrent?`current`:e.refreshOnNextTurn?`refresh on next turn`:`unavailable`}var E=new Set([`openai-codex`,`openai`,`anthropic`,`google`]),D=new Set([`ollama`,`lmstudio`,`llamacpp`]);function O(e){return e.enabled||e.curated.length>0||e.fields.some(e=>e.set)}function k(e,t){let n=t.trim().toLocaleLowerCase();return n?[e.id,e.displayName,e.hint??``,e.envHint,...e.fields.flatMap(e=>[e.label,e.envVar]),...e.curated,...e.catalog].some(e=>e.toLocaleLowerCase().includes(n)):!0}function A(e,t=``){let n=e.filter(e=>k(e,t)),r=n.filter(O),i=new Set(r.map(e=>e.id)),a=n.filter(e=>!i.has(e.id));return[{key:`configured`,title:`Configured`,description:`Providers you enabled, added models to, or saved credentials for.`,providers:r},{key:`recommended`,title:`Recommended starting points`,description:`The simplest hosted options for a first Bazilion conversation.`,providers:a.filter(e=>E.has(e.id))},{key:`local`,title:`Local models`,description:`Use a model server on the same machine without exposing the daemon.`,providers:a.filter(e=>D.has(e.id))},{key:`more`,title:`More providers`,description:`Specialist, regional, enterprise, and subscription endpoints.`,providers:a.filter(e=>!E.has(e.id)&&!D.has(e.id))}].filter(e=>e.providers.length>0)}function j(e){return e.enabled?e.curated.length===0?{label:`Needs a model`,tone:`warning`}:{label:`Configured, unverified`,tone:`warning`}:O(e)?{label:`Saved, disabled`,tone:`neutral`}:{label:`Not configured`,tone:`neutral`}}function M(){let{providers:e,openaiCodex:t,executionSecurity:n}=o.useLoaderData(),r=e.some(e=>e.enabled&&e.curated.length>0),a=(0,v.useRef)(r),[c,u]=(0,v.useState)(!1),[m,x]=(0,v.useState)(``),S=(0,v.useMemo)(()=>A(e,m),[e,m]),C=e.filter(O).length,w=e.filter(e=>e.enabled).length;return(0,v.useEffect)(()=>{!a.current&&r&&u(!0)},[r]),(0,y.jsxs)(p,{active:`providers`,title:`Providers`,description:(0,y.jsx)(y.Fragment,{children:`Connect the model services your agents may use. Credentials stay encrypted; advanced endpoint and environment names remain available inside each provider.`}),children:[(0,y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,"aria-label":`Provider summary`,children:[(0,y.jsx)(N,{label:`Configured`,value:C,detail:`credentials, models, or toggle`}),(0,y.jsx)(N,{label:`Enabled`,value:w,detail:`available to agent runtime`}),(0,y.jsx)(N,{label:`Selected models`,value:e.reduce((e,t)=>e+(t.enabled?t.curated.length:0),0),detail:`configured; test connectivity separately`})]}),(0,y.jsxs)(`details`,{className:`rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,y.jsxs)(`summary`,{className:`flex min-h-12 cursor-pointer list-none items-center gap-3 px-4 py-3 text-sm font-semibold text-foreground marker:hidden sm:px-5`,children:[(0,y.jsx)(s,{className:`size-4 text-primary`,"aria-hidden":`true`}),`Execution security`,(0,y.jsx)(`span`,{className:`ml-auto text-xs font-normal text-muted-foreground`,children:`Inspect host and protected-turn posture`}),(0,y.jsx)(l,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`})]}),(0,y.jsx)(`div`,{className:`border-t border-border p-3 sm:p-4`,children:(0,y.jsx)(b,{status:n})})]}),!r&&(0,y.jsx)(P,{providers:e,openaiCodex:t}),c&&(0,y.jsx)(`section`,{role:`status`,className:`rounded-2xl border border-success/30 bg-success/10 p-5 text-sm`,children:(0,y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,y.jsx)(h,{className:`mt-0.5 size-5 shrink-0 text-success`,"aria-hidden":`true`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`h2`,{className:`m-0 font-body text-base font-semibold text-foreground`,children:`Your default workspace is ready`}),(0,y.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Bazilion created the default Agent template and Team. Test the selected model below before relying on it, or continue to spawn your first agent.`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,y.jsxs)(`a`,{href:`/agents`,className:`btn-primary no-underline`,children:[`Spawn your first agent`,(0,y.jsx)(i,{className:`size-4`,"aria-hidden":`true`})]}),(0,y.jsx)(f,{variant:`ghost`,onClick:()=>u(!1),children:`Keep configuring`})]})]})]})}),(0,y.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4 shadow-baziu-sm sm:p-5`,children:[(0,y.jsx)(`label`,{htmlFor:`provider-search`,className:`m-0 text-sm font-semibold text-foreground`,children:`Find a provider`}),(0,y.jsxs)(`div`,{className:`relative mt-2`,children:[(0,y.jsx)(g,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,y.jsx)(`input`,{id:`provider-search`,type:`search`,value:m,onChange:e=>x(e.target.value),placeholder:`Search by service, model, or advanced key`,className:`pl-9`})]}),(0,y.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:`Start with one provider. Everything else stays collapsed until you need it.`})]}),S.length===0?(0,y.jsx)(d,{icon:(0,y.jsx)(g,{className:`size-4`,"aria-hidden":`true`}),title:`No providers match`,description:`Try another search instead of “${m}”.`,actions:(0,y.jsx)(f,{variant:`ghost`,onClick:()=>x(``),children:`Clear search`})}):(0,y.jsx)(`div`,{className:`space-y-4`,children:S.map(e=>(0,y.jsxs)(`details`,{open:!!m||e.key===`configured`||!r&&e.key===`recommended`,className:`group/providers overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,y.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3 px-4 py-4 marker:hidden sm:px-5`,children:[(0,y.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent text-accent-foreground`,children:(0,y.jsx)(_,{className:`size-4`,"aria-hidden":`true`})}),(0,y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`span`,{className:`block text-sm font-semibold text-foreground`,children:e.title}),(0,y.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-muted-foreground`,children:e.description})]}),(0,y.jsx)(`span`,{className:`rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground`,children:e.providers.length}),(0,y.jsx)(l,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/providers:rotate-180`,"aria-hidden":`true`})]}),(0,y.jsx)(`div`,{className:`space-y-2 border-t border-border bg-muted/20 p-2 sm:p-3`,children:e.providers.map(e=>(0,y.jsx)(F,{p:e,initiallyOpen:e.enabled||!!m||!r&&e.id===`openai-codex`,openaiCodexStatus:e.id===`openai-codex`?t:void 0},e.id))})]},`${e.key}:${m}`))})]})}function N({label:e,value:t,detail:n}){return(0,y.jsxs)(`div`,{className:`min-w-0 rounded-2xl border border-border bg-card p-4 shadow-baziu-sm`,children:[(0,y.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,y.jsx)(`div`,{className:`mt-1 text-2xl font-semibold text-foreground`,children:t}),(0,y.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:n})]})}function P({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,y.jsxs)(`div`,{role:`status`,className:`rounded-2xl border border-warning/30 bg-warning/10 p-5 text-sm`,children:[(0,y.jsx)(`div`,{className:`font-semibold text-foreground mb-1`,children:`Finish your first provider`}),(0,y.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`Enable one provider, save at least one exact model id, then send the small test request. Saving the model creates your default resources; a successful test confirms that the credential and model actually work.`}),n.length>0?(0,y.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-warning`,children:n.map(e=>(0,y.jsx)(`li`,{children:e},e))}):r===0?(0,y.jsx)(`p`,{className:`text-warning`,children:`No provider is enabled. Open a recommended option below and follow its steps.`}):null]})}function F({p:e,openaiCodexStatus:t,initiallyOpen:n}){let a=r(),[o,s]=(0,v.useState)(e.enabled),[c,l]=(0,v.useState)(n),[d,p]=(0,v.useState)(e.curated.join(`
2
- `)),[h,g]=(0,v.useState)(!1),[_,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(e.curated[0]??``),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(null),k=j({...e,enabled:o});async function A(t){s(t),S(null);try{let n=await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/enabled`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:t})});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Could not update provider (${n.status})`)}t&&l(!0),await a.invalidate()}catch(e){s(!t),S(e instanceof Error?e.message:String(e))}}async function M(t){t.preventDefault(),g(!0),b(null);try{let t=d.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),n=await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/models`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({models:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}b({kind:`success`,message:`Models saved. Run the connection test before relying on them.`}),w(t[0]??``),O(null),await a.invalidate()}catch(e){b({kind:`error`,message:e.message})}finally{g(!1)}}async function N(){if(C){E(!0),O(null);try{let t=await fetch(`/api/providers/test`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({model:`${e.id}:${C}`,message:`Reply with exactly: Bazilion connection verified.`})}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??`Connection test failed (${t.status})`);O({kind:`success`,message:`Verified ${e.displayName} with ${C}.`}),await a.invalidate()}catch(e){O({kind:`error`,message:e instanceof Error?e.message:String(e)})}finally{E(!1)}}}return(0,y.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-border bg-card`,children:[(0,y.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`unstyled flex min-w-0 flex-1 items-center gap-2 rounded-lg text-left`,"aria-expanded":c,"aria-controls":`provider-${e.id}`,onClick:()=>l(e=>!e),children:[(0,y.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${c?`rotate-90`:``}`,"aria-hidden":`true`}),(0,y.jsxs)(`span`,{className:`min-w-0`,children:[(0,y.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:e.displayName}),(0,y.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.id})]})]}),(0,y.jsx)(u,{variant:k.tone===`success`?`success`:k.tone===`warning`?`warning`:`neutral`,children:k.label}),(0,y.jsxs)(`label`,{className:`m-0 flex cursor-pointer items-center gap-1.5 rounded-lg px-1 text-xs font-semibold`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>A(e.target.checked),className:`size-4`,"aria-label":`${o?`Disable`:`Enable`} ${e.displayName}`}),(0,y.jsx)(`span`,{className:o?`text-success`:`text-muted-foreground`,children:o?`enabled`:`disabled`})]}),(0,y.jsxs)(`span`,{className:`w-full pl-6 text-xs text-muted-foreground sm:w-auto sm:pl-0`,children:[e.curated.length>0&&(0,y.jsxs)(`span`,{children:[e.curated.length,` curated`]}),e.catalog.length>0&&(0,y.jsxs)(`span`,{children:[` · `,e.catalog.length,` catalog`]}),e.live&&!e.live.error&&(0,y.jsxs)(`span`,{children:[` · `,e.live.models.length,` live`]})]})]}),x&&(0,y.jsx)(`p`,{role:`alert`,className:`mx-4 mb-3 text-sm text-danger`,children:x}),c&&(0,y.jsxs)(`div`,{id:`provider-${e.id}`,className:`border-t border-dashed px-3 py-4 sm:px-4`,children:[e.hint&&(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:e.hint}),e.id===`openai-codex`&&t&&(0,y.jsx)(R,{status:t}),e.fields.length===0&&e.envHint&&e.id!==`openai-codex`&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Credentials come from the process env: `,(0,y.jsx)(`code`,{className:`font-mono`,children:e.envHint})]}),e.fields.map(e=>(0,y.jsx)(m,{field:e},e.envVar)),(0,y.jsx)(`h4`,{id:`provider-${e.id}-models-label`,className:`mt-4 mb-1 font-body text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Models available to agents`}),e.curated.length===0&&(0,y.jsxs)(`p`,{className:`mb-2 text-xs font-medium text-warning`,children:[`First-run setup needs at least one model name here — type one (e.g.`,` `,(0,y.jsx)(`code`,{className:`font-mono`,children:I(e.id)}),`) and click`,` `,(0,y.jsx)(`em`,{children:`save models`}),`. Catalog chips below are the safest source when available.`]}),(0,y.jsxs)(`form`,{onSubmit:M,children:[(0,y.jsx)(`textarea`,{id:`provider-${e.id}-models`,"aria-labelledby":`provider-${e.id}-models-label`,value:d,onChange:e=>p(e.target.value),rows:Math.max(3,Math.min(8,d.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,y.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,y.jsx)(`button`,{type:`submit`,disabled:h,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:h?`Saving…`:`Save models`}),_&&(0,y.jsx)(`span`,{role:_.kind===`error`?`alert`:`status`,className:`text-xs ${_.kind===`error`?`text-danger`:`text-success`}`,children:_.message})]})]}),e.catalog.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`catalog`}),(0,y.jsx)(L,{items:e.catalog,onPick:e=>p(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live&&!e.live.error&&e.live.models.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`live`}),(0,y.jsx)(L,{items:e.live.models,onPick:e=>p(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live?.error&&(0,y.jsxs)(`p`,{role:`alert`,className:`text-xs text-danger mt-2`,children:[`Could not fetch live models: `,e.live.error]}),o&&e.curated.length>0&&(0,y.jsxs)(`div`,{className:`mt-4 rounded-xl border border-border bg-muted/30 p-3`,children:[(0,y.jsx)(`h4`,{className:`m-0 font-body text-sm font-semibold text-foreground`,children:`Test the connection`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`Sends one short real request. Your provider may charge its normal token cost.`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-end`,children:[(0,y.jsxs)(`label`,{className:`m-0 min-w-0 flex-1 text-xs font-semibold text-foreground`,children:[`Model`,(0,y.jsx)(`select`,{className:`mt-1`,value:C,onChange:e=>w(e.target.value),children:e.curated.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))})]}),(0,y.jsx)(f,{variant:`ghost`,disabled:T||!C,onClick:()=>void N(),children:T?`Testing…`:`Send test request`})]}),D&&(0,y.jsx)(`p`,{role:D.kind===`error`?`alert`:`status`,className:`mt-3 rounded-lg px-3 py-2 text-sm ${D.kind===`error`?`bg-danger/10 text-danger`:`bg-success/10 text-success`}`,children:D.message})]})]})]})}function I(e){switch(e){case`openai-codex`:return`gpt-6-astra`;case`openai`:return`gpt-6-astra`;case`anthropic`:return`claude-opus-5`;case`google`:return`gemini-3.6-flash`;case`google-vertex`:return`gemini-3.6-flash`;case`xai`:return`grok-4.5`;case`groq`:return`llama-3.3-70b-versatile`;case`cerebras`:return`gpt-oss-120b`;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-5`;case`vercel-ai-gateway`:return`anthropic/claude-opus-5`;case`deepseek`:return`deepseek-v4-pro`;case`fireworks`:return`accounts/fireworks/models/kimi-k3`;case`together`:return`moonshotai/Kimi-K3`;case`baseten`:return`moonshotai/Kimi-K3`;case`moonshotai`:return`kimi-k3`;case`moonshotai-cn`:return`kimi-k3`;case`kimi-coding`:return`kimi-for-coding`;case`minimax`:return`MiniMax-M2.7`;case`minimax-cn`:return`MiniMax-M3`;case`qwen-token-plan`:return`qwen3.8-max`;case`qwen-token-plan-cn`:case`qwen-token-plan-individual`:return`qwen3.8-max`;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-5`;case`github-copilot`:return`claude-opus-5`;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-5`;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`global.anthropic.claude-opus-5`;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 L({items:e,onPick:t}){return(0,y.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,y.jsx)(`button`,{type:`button`,onClick:()=>t(e),"aria-label":`Add ${e} to selected models`,className:`rounded border bg-card px-2 py-0.5 font-mono text-xs hover:border-primary hover:bg-accent`,children:e},e))})}function R({status:e}){let t=r(),[n,i]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>{u.current?.abort()},[]);async function d(){u.current?.abort();let e=new AbortController;u.current=e,i(!0),s(null);try{let n=await fetch(`/api/auth/openai/login`,{method:`POST`,signal:e.signal});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}if(e.signal.aborted)return;await t.invalidate()}catch(t){if(e.signal.aborted)return;s(t.message)}finally{u.current===e&&(u.current=null,e.signal.aborted||i(!1))}}async function p(){i(!0),s(null);try{let e=await fetch(`/api/auth/openai`,{method:`DELETE`});if(!e.ok&&e.status!==204){let t=await e.json().catch(()=>null);throw Error(t?.error??`Could not disconnect ChatGPT (${e.status})`)}await t.invalidate()}catch(e){throw s(e instanceof Error?e.message:String(e)),e}finally{i(!1)}}return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`rounded-md border bg-muted/30 p-3 mb-3`,children:[e.connected?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center mb-2`,children:[(0,y.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-2 py-0.5 text-xs font-semibold uppercase`,children:`connected`}),e.accountId&&(0,y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`account `,(0,y.jsx)(`code`,{className:`font-mono`,children:e.accountId})]}),e.expiresAt&&(0,y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`token expires`,` `,new Date(e.expiresAt).toISOString().replace(/\.\d+Z$/,`Z`)]})]}),(0,y.jsx)(f,{variant:`danger`,onClick:()=>l(!0),disabled:n,children:`Disconnect ChatGPT`})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.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,y.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 or callback trouble, run`,` `,(0,y.jsx)(`code`,{className:`font-mono`,children:`bazilion auth openai login --device-code`}),` on the client. From a source checkout, run`,` `,(0,y.jsx)(`code`,{className:`font-mono`,children:`pnpm tsx apps/cli/src/index.ts auth openai login --device-code`}),` `,`from the repository root.`]}),(0,y.jsx)(f,{variant:`primary`,onClick:d,disabled:n,children:n?`opening browser…`:`Connect ChatGPT →`})]}),o&&(0,y.jsx)(`p`,{role:`alert`,className:`text-sm text-danger mt-2`,children:o})]}),(0,y.jsx)(a,{open:c,onOpenChange:l,title:`Disconnect ChatGPT?`,description:(0,y.jsxs)(`p`,{children:[`This removes the saved OpenAI Codex OAuth credentials. Agents using an`,` `,(0,y.jsx)(`code`,{children:`openai-codex`}),` model will stop working until you connect again.`]}),confirmLabel:`Disconnect ChatGPT`,onConfirm:p})]})}export{M as component};