limixbot 0.2.13 → 0.3.2

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 (140) hide show
  1. package/dist/assets/{ActivityPanel-Crvi6UFN.js → ActivityPanel-BDwrkDBX.js} +1 -1
  2. package/dist/assets/{App-DBQxC6tF.js → App-Cb2UOJS6.js} +97 -97
  3. package/dist/assets/{AppEventEditor-BKkrL3lm.js → AppEventEditor-B383TR3m.js} +1 -1
  4. package/dist/assets/BotSettingsDialog-CbbZerHF.js +16 -0
  5. package/dist/assets/{BrowserPanel-CXiPysF8.js → BrowserPanel-DY-yCZ9T.js} +1 -1
  6. package/dist/assets/{BrowserProfilesManager-B5ZQeFJ9.js → BrowserProfilesManager-BmOMzdgM.js} +1 -1
  7. package/dist/assets/{CloudAddDialog-CjSOW3Ui.js → CloudAddDialog-DP5-ha1H.js} +1 -1
  8. package/dist/assets/{ComputerFilesPane-VwEQWopG.js → ComputerFilesPane-CB2u6MXN.js} +1 -1
  9. package/dist/assets/{ComputerPanel-C4y6Mvwd.js → ComputerPanel-DI10c-7Z.js} +2 -2
  10. package/dist/assets/{DataPanel-CeaLVEeb.js → DataPanel-fAjB6GSn.js} +1 -1
  11. package/dist/assets/{DesktopViewer-CfxFVwdn.js → DesktopViewer-mWGetNwB.js} +1 -1
  12. package/dist/assets/{FilesView-B9X_qlkn.js → FilesView-CLR6NiY2.js} +1 -1
  13. package/dist/assets/{GrokMoveDialog-CuC9v4Fd.js → GrokMoveDialog-lZOa5ZKz.js} +2 -2
  14. package/dist/assets/{InspectorPanel-B6ZAVTyD.js → InspectorPanel-lOPEUSb8.js} +1 -1
  15. package/dist/assets/{KeyboardShortcutsModal-DkoOxF2t.js → KeyboardShortcutsModal-BGRMc9wJ.js} +1 -1
  16. package/dist/assets/{LiveDesktop-BsPQ6sGB.js → LiveDesktop-LRjYEzUz.js} +1 -1
  17. package/dist/assets/{LocalVmWorkspace-U6rVY7_g.js → LocalVmWorkspace-Bwq-s97O.js} +1 -1
  18. package/dist/assets/{MacLocalControl-CC-lKazM.js → MacLocalControl-DuTxY3A3.js} +1 -1
  19. package/dist/assets/{MarkdownFilePreview-D0maDIQ1.js → MarkdownFilePreview-B69UWgiO.js} +1 -1
  20. package/dist/assets/{MenuMotion-CLF0GByT.js → MenuMotion-DKMkKESs.js} +1 -1
  21. package/dist/assets/NewBotDialog-Bpi6-xSj.js +1 -0
  22. package/dist/assets/{PhoneAppDialog-CTPZwJnL.js → PhoneAppDialog-V46SXKel.js} +1 -1
  23. package/dist/assets/{PlacesRail-D510vk5R.js → PlacesRail-4ErVypbT.js} +1 -1
  24. package/dist/assets/{PluginsPanel-BC0YDZ8h.js → PluginsPanel-Cw8XeQBF.js} +1 -1
  25. package/dist/assets/{ProIntroduction-BIiaveWm.js → ProIntroduction-DPYk--IK.js} +1 -1
  26. package/dist/assets/{RemoteAgentSettingsPanel-OVWheJHu.js → RemoteAgentSettingsPanel-qxzESq_H.js} +1 -1
  27. package/dist/assets/{RoomPanel-mDRTZ2vs.js → RoomPanel-DaoRmKS_.js} +1 -1
  28. package/dist/assets/{RoutinesPage-9VDuovqw.js → RoutinesPage-CD1DvtyW.js} +2 -2
  29. package/dist/assets/{SettingsModal-BHJvNrwz.js → SettingsModal-C359HBUM.js} +1 -1
  30. package/dist/assets/{ShareTeamDialog-C4go2USY.js → ShareTeamDialog-rc1xx02E.js} +1 -1
  31. package/dist/assets/{SignedInSites-Cm_X_p_X.js → SignedInSites-CPp5ofCJ.js} +1 -1
  32. package/dist/assets/TeamLibraryPanel-D-iDVZPU.js +1 -0
  33. package/dist/assets/{TeamMapPage-CkYOrZ7X.js → TeamMapPage-od4f3NJr.js} +1 -1
  34. package/dist/assets/{TriggersPage-_qYPJ97Z.js → TriggersPage-D2ovyRGM.js} +1 -1
  35. package/dist/assets/{VisibilitySection-CpwyInUL.js → VisibilitySection-oSi2vtmx.js} +1 -1
  36. package/dist/assets/{WebhookTrigger-CfspvK5m.js → WebhookTrigger-CyP8At0y.js} +1 -1
  37. package/dist/assets/{WorksOnGrid-BtfeNPO2.js → WorksOnGrid-DbfBPgPv.js} +1 -1
  38. package/dist/assets/{abnfDiagram-YUKMZFIV-qTIn3JJ1.js → abnfDiagram-YUKMZFIV-C7wn2CLu.js} +1 -1
  39. package/dist/assets/{activity-CEhxqMcq.js → activity-Cru8B1z7.js} +1 -1
  40. package/dist/assets/{architectureDiagram-47P4ROYG-BQls0L4i.js → architectureDiagram-47P4ROYG-DgFc7YIC.js} +1 -1
  41. package/dist/assets/{blockDiagram-E7TT5TSB-DMD6noIL.js → blockDiagram-E7TT5TSB-qR-t8DMo.js} +1 -1
  42. package/dist/assets/{c4Diagram-CRA5TL53-CIp2zuwT.js → c4Diagram-CRA5TL53-DdmUjVbB.js} +1 -1
  43. package/dist/assets/{calendar-days-Di_J-dvc.js → calendar-days-CN7x0QvP.js} +1 -1
  44. package/dist/assets/channel-BIffrG1w.js +1 -0
  45. package/dist/assets/{chunk-2Q5K7J3B-BBkqbpZ4.js → chunk-2Q5K7J3B-D09jrdDt.js} +1 -1
  46. package/dist/assets/{chunk-5VM5RSS4-JdwNE0CO.js → chunk-5VM5RSS4-DJXT-XDN.js} +1 -1
  47. package/dist/assets/{chunk-7TKQ45FW-D_Zh7_1M.js → chunk-7TKQ45FW-CaULsRlr.js} +1 -1
  48. package/dist/assets/{chunk-AW2ZBBNX-BvSbOQeA.js → chunk-AW2ZBBNX-BcEB179w.js} +1 -1
  49. package/dist/assets/{chunk-FVRAUYC3-CXYsdaIb.js → chunk-FVRAUYC3-DMhPq4_N.js} +2 -2
  50. package/dist/assets/{chunk-HTAEGDNF-CO93FKYG.js → chunk-HTAEGDNF-DcoWRcH-.js} +1 -1
  51. package/dist/assets/{chunk-JWPE2WC7-Ko0D98Sv.js → chunk-JWPE2WC7-CpN6DEZO.js} +1 -1
  52. package/dist/assets/{chunk-KQW6MTUR-DBGMbUnJ.js → chunk-KQW6MTUR-BxIldIqB.js} +1 -1
  53. package/dist/assets/{chunk-XXDRQBXY-PVMPph1f.js → chunk-XXDRQBXY--M4TxaOR.js} +1 -1
  54. package/dist/assets/{classDiagram-v2-K4WV4PDN-Z-SRrzrQ.js → classDiagram-v2-K4WV4PDN-DQUUn5pg.js} +1 -1
  55. package/dist/assets/{coins-QIRjm19F.js → coins-DxQLVJqa.js} +1 -1
  56. package/dist/assets/{core-Cb-3LQeb.js → core-CjjU--NA.js} +1 -1
  57. package/dist/assets/{cose-bilkent-JH36ORCC-DcOhjasx.js → cose-bilkent-JH36ORCC-DCCMLnpT.js} +1 -1
  58. package/dist/assets/{cynefin-EF2NZ3EQ-D9Pv76Si.js → cynefin-EF2NZ3EQ-iK--S4gB.js} +1 -1
  59. package/dist/assets/{cynefinDiagram-3GCD6N5R-1Nlm6fT4.js → cynefinDiagram-3GCD6N5R-DiwEQVzk.js} +1 -1
  60. package/dist/assets/{dagre-W4DXFKR2-CW-TdWBz.js → dagre-W4DXFKR2-Bb-WXIrp.js} +1 -1
  61. package/dist/assets/{diagram-2UJZ2QOL-DJYwBSWN.js → diagram-2UJZ2QOL-CU1G-LPy.js} +1 -1
  62. package/dist/assets/{diagram-OVF4WLC6-ZajDgMU2.js → diagram-OVF4WLC6-KUL_hQtY.js} +1 -1
  63. package/dist/assets/{diagram-PFPMY2P6-D03UoQDq.js → diagram-PFPMY2P6-Du0EMvGo.js} +1 -1
  64. package/dist/assets/{diagram-UMYRVEAY-B9gI6La0.js → diagram-UMYRVEAY-BUNv47Vc.js} +1 -1
  65. package/dist/assets/{diagram-YEKJPTXX-Dxzg_fDQ.js → diagram-YEKJPTXX-DyWO406P.js} +1 -1
  66. package/dist/assets/{diagram-ZIFT7M5P-Cv6eTFZE.js → diagram-ZIFT7M5P-DGps1w58.js} +1 -1
  67. package/dist/assets/{ebnfDiagram-VR2GEFS7-BCUklW6x.js → ebnfDiagram-VR2GEFS7-BxaaJRK8.js} +1 -1
  68. package/dist/assets/{elk-IJKZMXRS-VcZs96wT.js → elk-IJKZMXRS-BuVZZmTr.js} +1 -1
  69. package/dist/assets/{erDiagram-O2IAPWRE-CJ61fO-Z.js → erDiagram-O2IAPWRE-qhhsO6Fp.js} +1 -1
  70. package/dist/assets/{file-up-BObBqrEg.js → file-up-BiK20g0M.js} +1 -1
  71. package/dist/assets/{flowDiagram-OXPTDLAJ-CQMoLXxB.js → flowDiagram-OXPTDLAJ-BsRrcKnA.js} +1 -1
  72. package/dist/assets/{ganttDiagram-R7TSEDQI-ev5i74AH.js → ganttDiagram-R7TSEDQI-jVqCmREp.js} +1 -1
  73. package/dist/assets/{gitGraphDiagram-XJZIOB7I-B8MGdCiz.js → gitGraphDiagram-XJZIOB7I-COi9bChD.js} +1 -1
  74. package/dist/assets/{import-name-6aD0J6QH.js → import-name-CrWA8Hw3.js} +1 -1
  75. package/dist/assets/{index-CRF26t5P.js → index-BIC6c7Sg.js} +1 -1
  76. package/dist/assets/{index-DgGTgaCO.js → index-Bhz3ZrDI.js} +2 -2
  77. package/dist/assets/{index-Dpov1WyC.js → index-Dy5VWChH.js} +1 -1
  78. package/dist/assets/{infoDiagram-5W2HQ5XZ-CoqaIohe.js → infoDiagram-5W2HQ5XZ-CUfzOgVW.js} +1 -1
  79. package/dist/assets/{ishikawaDiagram-K3B6WC7H-BMzA3Pkb.js → ishikawaDiagram-K3B6WC7H-DMR_Ey1I.js} +1 -1
  80. package/dist/assets/{journeyDiagram-COXZFDF6-DLNIN037.js → journeyDiagram-COXZFDF6-UiPc_2sp.js} +1 -1
  81. package/dist/assets/{kanban-definition-P3RFRI5V-savLUzO8.js → kanban-definition-P3RFRI5V-VvQXCMxr.js} +1 -1
  82. package/dist/assets/{mcp-servers-D2hHUxUp.js → mcp-servers-CBCpG62C.js} +1 -1
  83. package/dist/assets/{mermaid.core-1h5EGl1v.js → mermaid.core-BZKmLobY.js} +4 -4
  84. package/dist/assets/{mindmap-definition-LZFPQGKD-hMbAYcVv.js → mindmap-definition-LZFPQGKD-BJi3q0s6.js} +1 -1
  85. package/dist/assets/{minimize-63hYzV5y.js → minimize-B78LHbd3.js} +1 -1
  86. package/dist/assets/{monitor-DOeLdhQc.js → monitor-UBjV7Qf5.js} +1 -1
  87. package/dist/assets/{new-bot-DkcWCdL_.js → new-bot-D0DDXTKe.js} +1 -1
  88. package/dist/assets/{org-library-C-rnQ1YG.js → org-library-BdlqWown.js} +1 -1
  89. package/dist/assets/{package-format-CMpBgycc.js → package-format-EwGfXp1v.js} +1 -1
  90. package/dist/assets/{pegDiagram-BGZESJAR-BIY55aib.js → pegDiagram-BGZESJAR-C6W87HN9.js} +1 -1
  91. package/dist/assets/{pieDiagram-CAPJLFHJ-DR8o8piD.js → pieDiagram-CAPJLFHJ-B1E_Ycub.js} +1 -1
  92. package/dist/assets/{quadrantDiagram-GDMTTRAM-Dqb1703W.js → quadrantDiagram-GDMTTRAM-BasGTzC_.js} +1 -1
  93. package/dist/assets/{rail-Ok1gt1lN.js → rail-BFRrwJ6b.js} +1 -1
  94. package/dist/assets/{railroadDiagram-SM67HX2B-ZWJ9xWQY.js → railroadDiagram-SM67HX2B-BZVzOUlx.js} +1 -1
  95. package/dist/assets/{remote-desktop-panel-ganxVzJo.js → remote-desktop-panel--ikzFjV8.js} +1 -1
  96. package/dist/assets/{requirementDiagram-X7JNWC4A-Cjv_VLZj.js → requirementDiagram-X7JNWC4A-C8s2XakO.js} +1 -1
  97. package/dist/assets/{sankeyDiagram-UM26HJRW-ChHoiXzB.js → sankeyDiagram-UM26HJRW-CCCP1mnQ.js} +1 -1
  98. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-B67gwOH0.js → sequenceDiagram-ZO4K6R2Y-BvwC79vw.js} +1 -1
  99. package/dist/assets/{sizeCapture-INFHLROL-DOr4ZALb.js → sizeCapture-INFHLROL-DzRVDjCL.js} +1 -1
  100. package/dist/assets/{stateDiagram-v2-TBUQTH76-DnoBtm-E.js → stateDiagram-v2-TBUQTH76-CKVmZfLe.js} +1 -1
  101. package/dist/assets/{styles-BcVNrxGE.js → styles-Bo7bYxUt.js} +5 -5
  102. package/dist/assets/styles-bUbK33f1.css +1 -0
  103. package/dist/assets/{swimlanes-N4OXWK64-2TFXb7MH.js → swimlanes-N4OXWK64-BaSkTx2s.js} +1 -1
  104. package/dist/assets/swimlanesDiagram-K3J5GTZL-D67LlSLv.js +8 -0
  105. package/dist/assets/{team-share-C9qIusMs.js → team-share-BgI5VFVf.js} +1 -1
  106. package/dist/assets/{timeline-definition-YOQAKGHF-4zjxAMyG.js → timeline-definition-YOQAKGHF-Np9aXu8d.js} +1 -1
  107. package/dist/assets/{usecaseDiagram-VIAY4XPW-CCfZ1eoO.js → usecaseDiagram-VIAY4XPW-CaHpESyo.js} +1 -1
  108. package/dist/assets/{vennDiagram-BLWOH2XV-h7rTFRTN.js → vennDiagram-BLWOH2XV-BpnM9QrV.js} +1 -1
  109. package/dist/assets/vi-B8BbvT0G.js +15 -0
  110. package/dist/assets/{wardleyDiagram-YMQ3BMBF-CXwA22zv.js → wardleyDiagram-YMQ3BMBF-Cb0psm8G.js} +1 -1
  111. package/dist/assets/{xychartDiagram-TAQBALBS-d4qol5BJ.js → xychartDiagram-TAQBALBS-Bi_SjN1M.js} +1 -1
  112. package/dist/index.html +3 -3
  113. package/dist/rail.html +5 -5
  114. package/dist-server/container-mcp.js +22 -21
  115. package/dist-server/index.js +529 -523
  116. package/dist-server/openmausbot.js +46 -46
  117. package/dist-server/package.json +1 -1
  118. package/dist-server/pair-cli.js +46 -46
  119. package/dist-server/server/config.js +6 -1
  120. package/dist-server/server/container-computer.js +4 -4
  121. package/dist-server/server/host/team-connections-host.js +2 -2
  122. package/dist-server/server/index.js +21 -4
  123. package/dist-server/server/limix-skill-folder.js +72 -0
  124. package/dist-server/server/mcp-registry.js +2 -2
  125. package/dist-server/server/routes/bot-skills.js +2 -1
  126. package/dist-server/server/service-unit.js +1 -1
  127. package/dist-server/server/skill-library.js +1 -1
  128. package/dist-server/server/team-library.js +2 -2
  129. package/dist-server/shared/grok-import.js +1 -1
  130. package/dist-server/shared/package-format.js +3 -3
  131. package/dist-server/vps-container-mcp.js +22 -21
  132. package/dist-server/workspace-backup.worker.js +20 -20
  133. package/package.json +1 -1
  134. package/dist/assets/BotSettingsDialog-BVTAiGvS.js +0 -16
  135. package/dist/assets/NewBotDialog-D9e-ED-j.js +0 -1
  136. package/dist/assets/TeamLibraryPanel-B-R6YFK-.js +0 -1
  137. package/dist/assets/channel-DRGNbeY-.js +0 -1
  138. package/dist/assets/styles-D-yh7Z23.css +0 -1
  139. package/dist/assets/swimlanesDiagram-K3J5GTZL-C_836Lnu.js +0 -8
  140. package/dist/assets/vi-KgT8L8Qj.js +0 -15
@@ -1 +1 @@
1
- import{r,j as e,t as a,X as D,a as p,L as A,g as H}from"./styles-BcVNrxGE.js";import{c as F,B as U,L as W}from"./PlacesRail-D510vk5R.js";import{b as X}from"./remote-desktop-DDRRx8uY.js";import{u as $,n as G}from"./App-DBQxC6tF.js";import"./monitor-DOeLdhQc.js";import"./index-DgGTgaCO.js";import"./MenuMotion-CLF0GByT.js";function K(n){return{enabled:n?.enabled??!0,verificationPending:n?.verificationPending??!1}}const E=3,b=50;function J(n){const s=n.trim();if(!s)return null;if(!/^\d+$/.test(s))return;const o=Number(s);return o>=1&&o<=b?o:void 0}function P(n,s){return n.trim().split(/[.!?\n]/)[0]?.trim().slice(0,60)||`${s?.name??"Bot"} automation`}const x="w-full rounded-xl border border-hairline/60 bg-panel px-3.5 py-2.5 text-[13px] text-ink outline-none placeholder:text-ink-tertiary focus:border-accent/70";function ae({webhook:n,bots:s,initialBotId:o,onClose:l,onCredential:R}){const{state:h,dispatch:C}=$(),[d,T]=r.useState(n?.botId??(o&&s.some(t=>t.id===o)?o:s[0]?.id)??""),[f,O]=r.useState(n?.name??""),[c,I]=r.useState(n?.prompt??""),[m,g]=r.useState(n?.runOn??"maus"),[v,_]=r.useState((n?.eventTypes??[]).join(", ")),[j,B]=r.useState(n?.maxPendingRuns?.toString()??""),[y,N]=r.useState(!1),[k,u]=r.useState(""),S=r.useRef(null);F(S,l);const L=!!(h.config?.box.configured&&X(h.instances,s.find(t=>t.id===d)?.modelSelection.instanceId)?.snapshot.state==="available"),M=async()=>{const t=s.find(i=>i.id===d),w=J(j);if(w===void 0){u(a("automations.editor.app.limitError",{max:b}));return}const z={name:f.trim()||P(c,t),prompt:c.trim(),botId:d,runOn:m,...K(n),eventTypes:v.split(",").map(i=>i.trim()).filter(Boolean),maxPendingRuns:w};N(!0),u("");try{const i=await G(n?`/api/webhooks/${n.id}`:"/api/webhooks",{method:n?"PATCH":"POST",body:JSON.stringify(z)});C({type:"webhookPatched",webhook:i.webhook}),l(),i.credential&&R(i.credential,i.webhook.id)}catch(i){u(i instanceof Error?i.message:String(i))}finally{N(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-5",onMouseDown:t=>t.target===t.currentTarget&&l(),children:e.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-label":n?a("automations.editor.app.editTitle"):a("automations.editor.app.title"),tabIndex:-1,className:"flex max-h-[90vh] w-full max-w-[560px] flex-col overflow-hidden rounded-2xl border border-hairline/60 bg-panel shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between border-b border-hairline/40 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[17px] font-semibold text-ink",children:n?a("automations.editor.app.editTitle"):a("automations.editor.app.title")}),e.jsx("div",{className:"mt-1 text-[12px] text-ink-secondary",children:a("automations.editor.app.subtitle")})]}),e.jsx("button",{type:"button",onClick:l,"aria-label":a("automations.newBox.cancel"),className:"rounded-lg p-2 text-ink-secondary hover:bg-raised hover:text-ink",children:e.jsx(D,{size:18})})]}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-5",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[13px] font-medium text-ink",children:a("automations.editor.app.who")}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:s.map(t=>e.jsxs("button",{type:"button",onClick:()=>T(t.id),className:p("flex min-w-0 items-center gap-2 rounded-xl border px-3 py-2 text-left",d===t.id?"border-accent/70 bg-accent/10":"border-hairline/50 bg-inset hover:bg-raised/60"),children:[e.jsx(U,{bot:t,state:d===t.id?"happy":"idle",size:32,animated:!1}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium text-ink",children:t.name})]},t.id))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-2 block text-[13px] font-medium text-ink",children:a("automations.editor.app.what")}),e.jsx("textarea",{autoFocus:!0,value:c,onChange:t=>I(t.target.value),rows:3,placeholder:a("automations.editor.app.whatPlaceholder"),className:p(x,"resize-y py-3 leading-relaxed")})]}),e.jsxs("details",{className:"rounded-xl border border-hairline/45 bg-inset/45 px-4 py-3",children:[e.jsx("summary",{className:"cursor-pointer text-[13px] font-medium text-ink",children:a("automations.more")}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.name")}),e.jsx("input",{value:f,onChange:t=>O(t.target.value),placeholder:P(c,s.find(t=>t.id===d)),className:x})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.runOn")}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>g("maus"),className:p("flex items-center gap-2 rounded-xl border p-3 text-left text-[13px] font-medium text-ink",m==="maus"?"border-accent/70 bg-accent/10":"border-hairline/50 bg-panel hover:bg-raised/60"),children:[e.jsx(A,{size:14}),a("automations.editor.app.thisComputer")]}),e.jsxs("button",{type:"button",disabled:!L&&m!=="cloud",onClick:()=>g("cloud"),className:p("flex items-center gap-2 rounded-xl border p-3 text-left text-[13px] font-medium text-ink disabled:cursor-not-allowed disabled:opacity-45",m==="cloud"?"border-accent/70 bg-accent/10":"border-hairline/50 bg-panel hover:bg-raised/60"),children:[e.jsx(H,{size:14}),a("automations.editor.app.cloud")]})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.events")}),e.jsx("input",{value:v,onChange:t=>_(t.target.value),placeholder:"push, workflow_run",className:x}),e.jsx("span",{className:"mt-1.5 block text-[11px] text-ink-secondary",children:a("automations.editor.app.eventsHelp")})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.limit")}),e.jsx("input",{type:"number",inputMode:"numeric",min:1,max:b,step:1,value:j,onChange:t=>B(t.target.value),placeholder:String(E),className:x}),e.jsx("span",{className:"mt-1.5 block text-[11px] text-ink-secondary",children:a("automations.editor.app.limitHelp",{count:E})})]})]})]}),k&&e.jsx("div",{className:"rounded-xl border border-danger/30 bg-danger/10 px-3.5 py-3 text-[12px] text-danger",children:k})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-hairline/40 px-5 py-4",children:[e.jsx("button",{type:"button",onClick:l,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:a("automations.newBox.cancel")}),e.jsxs("button",{type:"button",disabled:y||!d,onClick:()=>{M()},className:"flex items-center gap-2 rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110 disabled:opacity-40",children:[y&&e.jsx(W,{size:14,className:"animate-spin"}),n?a("automations.editor.app.save"):a("automations.editor.app.create")]})]})]})})}export{ae as WebhookEditor,P as suggestedName};
1
+ import{r,j as e,t as a,X as D,a as p,L as A,g as H}from"./styles-Bo7bYxUt.js";import{c as F,B as U,L as W}from"./PlacesRail-4ErVypbT.js";import{b as X}from"./remote-desktop-DDRRx8uY.js";import{u as $,n as G}from"./App-Cb2UOJS6.js";import"./monitor-UBjV7Qf5.js";import"./index-Bhz3ZrDI.js";import"./MenuMotion-DKMkKESs.js";function K(n){return{enabled:n?.enabled??!0,verificationPending:n?.verificationPending??!1}}const E=3,b=50;function J(n){const s=n.trim();if(!s)return null;if(!/^\d+$/.test(s))return;const o=Number(s);return o>=1&&o<=b?o:void 0}function P(n,s){return n.trim().split(/[.!?\n]/)[0]?.trim().slice(0,60)||`${s?.name??"Bot"} automation`}const x="w-full rounded-xl border border-hairline/60 bg-panel px-3.5 py-2.5 text-[13px] text-ink outline-none placeholder:text-ink-tertiary focus:border-accent/70";function ae({webhook:n,bots:s,initialBotId:o,onClose:l,onCredential:R}){const{state:h,dispatch:C}=$(),[d,T]=r.useState(n?.botId??(o&&s.some(t=>t.id===o)?o:s[0]?.id)??""),[f,O]=r.useState(n?.name??""),[c,I]=r.useState(n?.prompt??""),[m,g]=r.useState(n?.runOn??"maus"),[v,_]=r.useState((n?.eventTypes??[]).join(", ")),[j,B]=r.useState(n?.maxPendingRuns?.toString()??""),[y,N]=r.useState(!1),[k,u]=r.useState(""),S=r.useRef(null);F(S,l);const L=!!(h.config?.box.configured&&X(h.instances,s.find(t=>t.id===d)?.modelSelection.instanceId)?.snapshot.state==="available"),M=async()=>{const t=s.find(i=>i.id===d),w=J(j);if(w===void 0){u(a("automations.editor.app.limitError",{max:b}));return}const z={name:f.trim()||P(c,t),prompt:c.trim(),botId:d,runOn:m,...K(n),eventTypes:v.split(",").map(i=>i.trim()).filter(Boolean),maxPendingRuns:w};N(!0),u("");try{const i=await G(n?`/api/webhooks/${n.id}`:"/api/webhooks",{method:n?"PATCH":"POST",body:JSON.stringify(z)});C({type:"webhookPatched",webhook:i.webhook}),l(),i.credential&&R(i.credential,i.webhook.id)}catch(i){u(i instanceof Error?i.message:String(i))}finally{N(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-5",onMouseDown:t=>t.target===t.currentTarget&&l(),children:e.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-label":n?a("automations.editor.app.editTitle"):a("automations.editor.app.title"),tabIndex:-1,className:"flex max-h-[90vh] w-full max-w-[560px] flex-col overflow-hidden rounded-2xl border border-hairline/60 bg-panel shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between border-b border-hairline/40 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[17px] font-semibold text-ink",children:n?a("automations.editor.app.editTitle"):a("automations.editor.app.title")}),e.jsx("div",{className:"mt-1 text-[12px] text-ink-secondary",children:a("automations.editor.app.subtitle")})]}),e.jsx("button",{type:"button",onClick:l,"aria-label":a("automations.newBox.cancel"),className:"rounded-lg p-2 text-ink-secondary hover:bg-raised hover:text-ink",children:e.jsx(D,{size:18})})]}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-5",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[13px] font-medium text-ink",children:a("automations.editor.app.who")}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:s.map(t=>e.jsxs("button",{type:"button",onClick:()=>T(t.id),className:p("flex min-w-0 items-center gap-2 rounded-xl border px-3 py-2 text-left",d===t.id?"border-accent/70 bg-accent/10":"border-hairline/50 bg-inset hover:bg-raised/60"),children:[e.jsx(U,{bot:t,state:d===t.id?"happy":"idle",size:32,animated:!1}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium text-ink",children:t.name})]},t.id))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-2 block text-[13px] font-medium text-ink",children:a("automations.editor.app.what")}),e.jsx("textarea",{autoFocus:!0,value:c,onChange:t=>I(t.target.value),rows:3,placeholder:a("automations.editor.app.whatPlaceholder"),className:p(x,"resize-y py-3 leading-relaxed")})]}),e.jsxs("details",{className:"rounded-xl border border-hairline/45 bg-inset/45 px-4 py-3",children:[e.jsx("summary",{className:"cursor-pointer text-[13px] font-medium text-ink",children:a("automations.more")}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.name")}),e.jsx("input",{value:f,onChange:t=>O(t.target.value),placeholder:P(c,s.find(t=>t.id===d)),className:x})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.runOn")}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>g("maus"),className:p("flex items-center gap-2 rounded-xl border p-3 text-left text-[13px] font-medium text-ink",m==="maus"?"border-accent/70 bg-accent/10":"border-hairline/50 bg-panel hover:bg-raised/60"),children:[e.jsx(A,{size:14}),a("automations.editor.app.thisComputer")]}),e.jsxs("button",{type:"button",disabled:!L&&m!=="cloud",onClick:()=>g("cloud"),className:p("flex items-center gap-2 rounded-xl border p-3 text-left text-[13px] font-medium text-ink disabled:cursor-not-allowed disabled:opacity-45",m==="cloud"?"border-accent/70 bg-accent/10":"border-hairline/50 bg-panel hover:bg-raised/60"),children:[e.jsx(H,{size:14}),a("automations.editor.app.cloud")]})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.events")}),e.jsx("input",{value:v,onChange:t=>_(t.target.value),placeholder:"push, workflow_run",className:x}),e.jsx("span",{className:"mt-1.5 block text-[11px] text-ink-secondary",children:a("automations.editor.app.eventsHelp")})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-ink-secondary",children:a("automations.editor.app.limit")}),e.jsx("input",{type:"number",inputMode:"numeric",min:1,max:b,step:1,value:j,onChange:t=>B(t.target.value),placeholder:String(E),className:x}),e.jsx("span",{className:"mt-1.5 block text-[11px] text-ink-secondary",children:a("automations.editor.app.limitHelp",{count:E})})]})]})]}),k&&e.jsx("div",{className:"rounded-xl border border-danger/30 bg-danger/10 px-3.5 py-3 text-[12px] text-danger",children:k})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-hairline/40 px-5 py-4",children:[e.jsx("button",{type:"button",onClick:l,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:a("automations.newBox.cancel")}),e.jsxs("button",{type:"button",disabled:y||!d,onClick:()=>{M()},className:"flex items-center gap-2 rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110 disabled:opacity-40",children:[y&&e.jsx(W,{size:14,className:"animate-spin"}),n?a("automations.editor.app.save"):a("automations.editor.app.create")]})]})]})})}export{ae as WebhookEditor,P as suggestedName};
@@ -1 +1 @@
1
- import{j as r,t,a as u,g as v,f as g}from"./styles-BcVNrxGE.js";import{u as h,_ as k,$ as j,G as N,a0 as w,a1 as p}from"./App-DBQxC6tF.js";import{M as A}from"./monitor-DOeLdhQc.js";import{g as C}from"./PlacesRail-D510vk5R.js";function z({value:s,compact:o=!1,onChange:e}){const{state:c}=h();return c.config?.cloudHome?null:r.jsxs("div",{className:"mt-3 rounded-lg bg-inset p-3",children:[r.jsx("div",{className:"text-[12px] font-medium text-ink",children:o?t("botAccess.cloud.provider"):t("botAccess.cloud.backend")}),r.jsx("div",{className:"mt-0.5 text-[12px] text-ink-secondary",children:o?s==="vps"?t("botAccess.cloud.vpsDescription"):t("botAccess.cloud.hostedDescription"):s==="vps"?t("botAccess.cloud.vpsAutoDescription"):t("botAccess.cloud.hostedBackendDescription")}),r.jsx("div",{className:"mt-2 flex overflow-hidden rounded-lg border border-hairline/40",children:["box","vps"].map((n,a)=>r.jsx("button",{onClick:()=>e(n),className:u("flex-1 py-1.5 text-[12px]",a>0&&"border-l border-hairline/40",s===n?"bg-raised text-ink":"text-ink-secondary hover:bg-raised/60 hover:text-ink"),children:n==="vps"?t("botAccess.cloud.selfHostedVps"):t("botAccess.cloud.boat")},n))})]})}const D=[[null,"vm.dest.auto","computer.dest.autoDesc",k],["cloud","place.cloud","computer.dest.cloudDesc",v],["vm","vm.dest.vm","computer.dest.vmDesc",j],["local","vm.dest.local","computer.dest.localDesc",A],["browser","vm.dest.browser","computer.dest.browserDesc",N],["off","vm.dest.off","computer.dest.offDesc",C]];function G(s,o){return D.filter(([e])=>e===null||e==="off"||w(e,s)&&!(e==="local"&&p(o)))}function H(s,o,e){return s===null?!o||o==="local"&&p(e):o===s}function M(s,o,e){const c=s==="local"?"thisComputer":s==="vm"?"localVm":s==="cloud"?o==="vps"?"vps":"box":null;return e&&c&&!e.computers[c]?t("policy.managedBy",{organization:e.organizationName}):void 0}function R({options:s,onSelect:o}){return r.jsx("div",{role:"group","aria-label":t("computer.destinationAria"),className:"mt-3 grid auto-rows-fr grid-cols-2 gap-2",children:s.map(({mode:e,labelKey:c,descriptionKey:n,Icon:a,selected:i,managedBy:m,disabled:l,unavailableTitle:x,note:f,issue:b,view:d})=>r.jsxs("button",{disabled:l,title:x,onClick:()=>o(e),type:"button","aria-pressed":i,className:u("min-w-0 rounded-lg border px-2.5 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-card",i?"border-accent/60 bg-accent/10 text-ink":"border-hairline/50 bg-panel/30 text-ink-secondary",l?"cursor-not-allowed":"hover:border-accent/40 hover:bg-control/60"),children:[r.jsxs("span",{className:"flex items-center gap-2 text-[12px] font-medium leading-4",children:[i?r.jsx(g,{size:14,className:"shrink-0 text-accent"}):r.jsx(a,{size:14,className:"shrink-0 text-ink-secondary"}),r.jsx("span",{children:t(c)})]}),r.jsx("span",{className:"mt-1.5 block text-[11px] leading-4 text-ink-secondary",children:m??f??(l?d.line:b?d.short:t(n))})]},e??"auto"))})}export{z as C,R as W,H as a,M as p,G as w};
1
+ import{j as r,t,a as u,g as v,f as g}from"./styles-Bo7bYxUt.js";import{u as h,_ as k,$ as j,G as N,a0 as w,a1 as p}from"./App-Cb2UOJS6.js";import{M as A}from"./monitor-UBjV7Qf5.js";import{g as C}from"./PlacesRail-4ErVypbT.js";function z({value:s,compact:o=!1,onChange:e}){const{state:c}=h();return c.config?.cloudHome?null:r.jsxs("div",{className:"mt-3 rounded-lg bg-inset p-3",children:[r.jsx("div",{className:"text-[12px] font-medium text-ink",children:o?t("botAccess.cloud.provider"):t("botAccess.cloud.backend")}),r.jsx("div",{className:"mt-0.5 text-[12px] text-ink-secondary",children:o?s==="vps"?t("botAccess.cloud.vpsDescription"):t("botAccess.cloud.hostedDescription"):s==="vps"?t("botAccess.cloud.vpsAutoDescription"):t("botAccess.cloud.hostedBackendDescription")}),r.jsx("div",{className:"mt-2 flex overflow-hidden rounded-lg border border-hairline/40",children:["box","vps"].map((n,a)=>r.jsx("button",{onClick:()=>e(n),className:u("flex-1 py-1.5 text-[12px]",a>0&&"border-l border-hairline/40",s===n?"bg-raised text-ink":"text-ink-secondary hover:bg-raised/60 hover:text-ink"),children:n==="vps"?t("botAccess.cloud.selfHostedVps"):t("botAccess.cloud.boat")},n))})]})}const D=[[null,"vm.dest.auto","computer.dest.autoDesc",k],["cloud","place.cloud","computer.dest.cloudDesc",v],["vm","vm.dest.vm","computer.dest.vmDesc",j],["local","vm.dest.local","computer.dest.localDesc",A],["browser","vm.dest.browser","computer.dest.browserDesc",N],["off","vm.dest.off","computer.dest.offDesc",C]];function G(s,o){return D.filter(([e])=>e===null||e==="off"||w(e,s)&&!(e==="local"&&p(o)))}function H(s,o,e){return s===null?!o||o==="local"&&p(e):o===s}function M(s,o,e){const c=s==="local"?"thisComputer":s==="vm"?"localVm":s==="cloud"?o==="vps"?"vps":"box":null;return e&&c&&!e.computers[c]?t("policy.managedBy",{organization:e.organizationName}):void 0}function R({options:s,onSelect:o}){return r.jsx("div",{role:"group","aria-label":t("computer.destinationAria"),className:"mt-3 grid auto-rows-fr grid-cols-2 gap-2",children:s.map(({mode:e,labelKey:c,descriptionKey:n,Icon:a,selected:i,managedBy:m,disabled:l,unavailableTitle:x,note:f,issue:b,view:d})=>r.jsxs("button",{disabled:l,title:x,onClick:()=>o(e),type:"button","aria-pressed":i,className:u("min-w-0 rounded-lg border px-2.5 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-card",i?"border-accent/60 bg-accent/10 text-ink":"border-hairline/50 bg-panel/30 text-ink-secondary",l?"cursor-not-allowed":"hover:border-accent/40 hover:bg-control/60"),children:[r.jsxs("span",{className:"flex items-center gap-2 text-[12px] font-medium leading-4",children:[i?r.jsx(g,{size:14,className:"shrink-0 text-accent"}):r.jsx(a,{size:14,className:"shrink-0 text-ink-secondary"}),r.jsx("span",{children:t(c)})]}),r.jsx("span",{className:"mt-1.5 block text-[11px] leading-4 text-ink-secondary",children:m??f??(l?d.line:b?d.short:t(n))})]},e??"auto"))})}export{z as C,R as W,H as a,M as p,G as w};
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-AW2ZBBNX-BvSbOQeA.js";import{p as f}from"./chunk-JWPE2WC7-Ko0D98Sv.js";import{_ as n,l as o}from"./mermaid.core-1h5EGl1v.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ-D9Pv76Si.js";import"./styles-BcVNrxGE.js";import"./step-CkmJJ7wq.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-AW2ZBBNX-BcEB179w.js";import{p as f}from"./chunk-JWPE2WC7-CpN6DEZO.js";import{_ as n,l as o}from"./mermaid.core-BZKmLobY.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ-iK--S4gB.js";import"./styles-Bo7bYxUt.js";import"./step-CkmJJ7wq.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
@@ -1 +1 @@
1
- import{t as e,d as l,n as y,e as p}from"./styles-BcVNrxGE.js";const f=["all","approvals","decisions","config","people","session","webhook","bot-api","mcp","engine","bot","budget","visibility"];function m(t){const a=new URLSearchParams;t.who.trim()&&a.set("who",t.who.trim()),t.what!=="all"&&a.set("what",t.what),t.from&&a.set("from",t.from),t.to&&a.set("to",t.to);const i=a.toString();return i?`?${i}`:""}function v(t){return t==="This computer"?e("activity.actor.loopback"):t==="Local service"?e("activity.actor.worker"):t==="Command line"?e("activity.actor.cli"):t||"—"}function u(t){return Object.hasOwn(p,t)}function h(t){if(t.type==="approval"){const n=`activity.decision.${t.what}`,c=u(n)?e(n):t.what,r=t.tool?e("activity.approvalLine",{decision:c,tool:t.tool}):c;return t.bot?`${r} ${e("activity.approvalIn",{bot:t.bot})}`:r}const a=`activity.action.${t.action}`,i=u(a)?e(a):t.action,o=t.target?.name??t.target?.id;return o?`${i}: ${o}`:i}function b(t){if(t==null)return"—";if(typeof t=="string")return t;const a=JSON.stringify(t);return a.length>160?`${a.slice(0,157)}…`:a}const s=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;function d(t,a){const i=s(t);if(i===s(a))return e("chat.day.today");const o=new Date(a);if(o.setDate(a.getDate()-1),i===s(o))return e("chat.day.yesterday");const n=r=>t.toLocaleDateString(y(),r),c=e("activity.day.date",{weekday:n({weekday:"short"}),day:t.getDate(),month:n({month:"short"})});return t.getFullYear()===a.getFullYear()?c:e("activity.day.dateYear",{date:c,year:t.getFullYear()})}const w=t=>t.labelKey?.startsWith("activity.tool.")?l(t.labelKey,t.label):t.label,S=t=>t.app!==null&&t.appKey?.startsWith("activity.app.")?l(t.appKey,t.app):t.app;function $(t,a){const i=[];for(const o of t){const n=new Date(o.at),c=s(n),r=i[i.length-1];r&&r.key===c?r.rows.push(o):i.push({key:c,label:d(n,a),rows:[o]})}return i}function k(t){switch(t){case"ran":return{text:e("activity.outcome.ran"),tone:"ok"};case"failed":return{text:e("activity.outcome.failed"),tone:"danger"};case"running":return{text:e("activity.outcome.running"),tone:"accent"};case"allowed":return{text:e("activity.outcome.allowed"),tone:"ok"};case"denied":return{text:e("activity.outcome.denied"),tone:"danger"};case"waiting":return{text:e("activity.outcome.waiting"),tone:"warn"}}}function D(t){const a=new Date(t);return Number.isNaN(a.getTime())?"--:--":`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}export{f as A,S as a,w as b,m as c,h as d,b as e,D as f,$ as g,k as o,v as w};
1
+ import{t as e,d as l,n as y,e as p}from"./styles-Bo7bYxUt.js";const f=["all","approvals","decisions","config","people","session","webhook","bot-api","mcp","engine","bot","budget","visibility"];function m(t){const a=new URLSearchParams;t.who.trim()&&a.set("who",t.who.trim()),t.what!=="all"&&a.set("what",t.what),t.from&&a.set("from",t.from),t.to&&a.set("to",t.to);const i=a.toString();return i?`?${i}`:""}function v(t){return t==="This computer"?e("activity.actor.loopback"):t==="Local service"?e("activity.actor.worker"):t==="Command line"?e("activity.actor.cli"):t||"—"}function u(t){return Object.hasOwn(p,t)}function h(t){if(t.type==="approval"){const n=`activity.decision.${t.what}`,c=u(n)?e(n):t.what,r=t.tool?e("activity.approvalLine",{decision:c,tool:t.tool}):c;return t.bot?`${r} ${e("activity.approvalIn",{bot:t.bot})}`:r}const a=`activity.action.${t.action}`,i=u(a)?e(a):t.action,o=t.target?.name??t.target?.id;return o?`${i}: ${o}`:i}function b(t){if(t==null)return"—";if(typeof t=="string")return t;const a=JSON.stringify(t);return a.length>160?`${a.slice(0,157)}…`:a}const s=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;function d(t,a){const i=s(t);if(i===s(a))return e("chat.day.today");const o=new Date(a);if(o.setDate(a.getDate()-1),i===s(o))return e("chat.day.yesterday");const n=r=>t.toLocaleDateString(y(),r),c=e("activity.day.date",{weekday:n({weekday:"short"}),day:t.getDate(),month:n({month:"short"})});return t.getFullYear()===a.getFullYear()?c:e("activity.day.dateYear",{date:c,year:t.getFullYear()})}const w=t=>t.labelKey?.startsWith("activity.tool.")?l(t.labelKey,t.label):t.label,S=t=>t.app!==null&&t.appKey?.startsWith("activity.app.")?l(t.appKey,t.app):t.app;function $(t,a){const i=[];for(const o of t){const n=new Date(o.at),c=s(n),r=i[i.length-1];r&&r.key===c?r.rows.push(o):i.push({key:c,label:d(n,a),rows:[o]})}return i}function k(t){switch(t){case"ran":return{text:e("activity.outcome.ran"),tone:"ok"};case"failed":return{text:e("activity.outcome.failed"),tone:"danger"};case"running":return{text:e("activity.outcome.running"),tone:"accent"};case"allowed":return{text:e("activity.outcome.allowed"),tone:"ok"};case"denied":return{text:e("activity.outcome.denied"),tone:"danger"};case"waiting":return{text:e("activity.outcome.waiting"),tone:"warn"}}}function D(t){const a=new Date(t);return Number.isNaN(a.getTime())?"--:--":`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}export{f as A,S as a,w as b,m as c,h as d,b as e,D as f,$ as g,k as o,v as w};