dorkos 0.101.0 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/bin/cli.js +2935 -1738
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-CwxCTicf.js → AboutPage-BNVLNd3q.js} +1 -1
- package/dist/client/assets/{ActivityRow-D0QQ0SFu.js → ActivityRow-CvjAfRBM.js} +1 -1
- package/dist/client/assets/AdapterIcon-wGSXBn-k.js +1 -0
- package/dist/client/assets/AdapterSetupWizard-CmSJ2sno.js +2 -0
- package/dist/client/assets/{AgentRequestCard-BLLmoAES.js → AgentRequestCard-D62XQXBM.js} +4 -4
- package/dist/client/assets/{AppearancePage-GqrWckTQ.js → AppearancePage-Bds0L-wm.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-sEhnIPBB.js → AttentionSignalRow-C6RkjCWK.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BXjzhT_D.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CerNarG-.js} +24 -24
- package/dist/client/assets/{BlintzCanvas-CXi0fvcM.js → BlintzCanvas-CUqethk_.js} +24 -24
- package/dist/client/assets/{CanvasCsvContent-QhDSf8Pd.js → CanvasCsvContent-DdbIUPMJ.js} +1 -1
- package/dist/client/assets/CanvasFileContent-CX2VNF4o.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-OprkQsgq.js +2 -0
- package/dist/client/assets/{CodeMirrorDiff-BMG7DBg2.js → CodeMirrorDiff-BnMdmI0K.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BYdz0ipX.js → CodeMirrorEditor-C7T-DaVA.js} +1 -1
- package/dist/client/assets/ConnectionAccessLists-B3QGnSxM.js +1 -0
- package/dist/client/assets/ConnectionsPage-E3br6maQ.js +11 -0
- package/dist/client/assets/{ConventionPage-y-Zq3Klp.js → ConventionPage-vMN5qEwP.js} +3 -3
- package/dist/client/assets/{ExtensionPageRoute-gZKKPhaj.js → ExtensionPageRoute-DFkPAzjs.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-CbKIa11X.js → FloatingTanStackRouterDevtools-CqogiFob-BP4itJWW.js} +1 -1
- package/dist/client/assets/HandlePage-De4D_IVs.js +1 -0
- package/dist/client/assets/{LexicalField-Ceoa9flp.js → LexicalField-BbUXXxTw.js} +1 -1
- package/dist/client/assets/{ManagesPage-Dcqdm6I8.js → ManagesPage-DsNSZHug.js} +1 -1
- package/dist/client/assets/Marketplace-D4zHIIak.js +36 -0
- package/dist/client/assets/MarketplaceSourcesView-DILS8-ca.js +1 -0
- package/dist/client/assets/{McpAppFrame-B1ThSf2U.js → McpAppFrame-Cl_2azg-.js} +2 -2
- package/dist/client/assets/McpSigninBody-TpoSImsV.js +1 -0
- package/dist/client/assets/{Model3dViewer-DlcQ3-LS.js → Model3dViewer-C-iyu5eV.js} +1 -1
- package/dist/client/assets/NamePage-C-3w8oeg.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-bJE7b4lX.js +1 -0
- package/dist/client/assets/{NotificationsPage-CQQIdLtI.js → NotificationsPage-CL23qwVw.js} +1 -1
- package/dist/client/assets/OperatorIdentityForm-ixaqUfIO.js +1 -0
- package/dist/client/assets/{PermissionsPage-TX-d7aVQ.js → PermissionsPage-D4xbxTkc.js} +1 -1
- package/dist/client/assets/{PersonalityPicker-C_9JVOva.js → PersonalityPicker-CTvPlN-k.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-BoTED73t.js → PersonalityPopover-Coy0eaIg.js} +1 -1
- package/dist/client/assets/PhotoPage-DpEEXO3e.js +1 -0
- package/dist/client/assets/PreviewRefusedNotice-B2GLqLYi.js +1 -0
- package/dist/client/assets/{PromptSuggestionChips-B_oUtFMI.js → PromptSuggestionChips-YdKEWyNT.js} +1 -1
- package/dist/client/assets/RoomSurface-BwIBBvYq.js +44 -0
- package/dist/client/assets/{RoomsPage-zOjjpHdA.js → RoomsPage-DaEXPz65.js} +1 -1
- package/dist/client/assets/RunsOnPopover-tvbVPKVf.js +1 -0
- package/dist/client/assets/SessionsPage-CAdV_XBY.js +1 -0
- package/dist/client/assets/SkillsPage-B4F19LmV.js +1 -0
- package/dist/client/assets/{TasksPage-BZapA_v6.js → TasksPage-BXcaEx3V.js} +1 -1
- package/dist/client/assets/ToolsPage-BYBwPql_.js +2 -0
- package/dist/client/assets/{TopologyGraph-BMcPxZsA.js → TopologyGraph-CZ2Y5I2e.js} +1 -1
- package/dist/client/assets/TourHost-BNpDrN0O.js +1 -0
- package/dist/client/assets/UnlinkDialog-Zyuh5qZY.js +1 -0
- package/dist/client/assets/{UnreadDivider-KSqqcHKN.js → UnreadDivider-Dh67_mAz.js} +1 -1
- package/dist/client/assets/_shell-lcu5vkQ7.js +98 -0
- package/dist/client/assets/{_shell._home-Bp_p1VUv.js → _shell._home-CPV1Z64k.js} +1 -1
- package/dist/client/assets/_shell._home.activity-CEvkKYBD.js +1 -0
- package/dist/client/assets/_shell._home.index-tGnRLvY-.js +3 -0
- package/dist/client/assets/{_shell._home.tasks-BsBH_4tZ.js → _shell._home.tasks-CtpZNevK.js} +1 -1
- package/dist/client/assets/_shell._home.workspaces-D6tkWdS8.js +1 -0
- package/dist/client/assets/{_shell.channels-DWAHkDPV.js → _shell.channels-DbrQXIVv.js} +4 -4
- package/dist/client/assets/_shell.connections-C3Ho4S8R.js +6 -0
- package/dist/client/assets/{_shell.feedback-requests-Hjv640j9.js → _shell.feedback-requests-D9l7SJi1.js} +1 -1
- package/dist/client/assets/_shell.marketplace-BfY-kBJk.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-B0km_EUs.js +1 -0
- package/dist/client/assets/_shell.session-O8MC-USm.js +54 -0
- package/dist/client/assets/{_shell.team-ctLQztjw.js → _shell.team-DvJK7irE.js} +4 -4
- package/dist/client/assets/_shell.x._extensionId-_-fII74H.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-_-fII74H.js +1 -0
- package/dist/client/assets/agent-attention-BvnWcLpc.js +5 -0
- package/dist/client/assets/{agent-browser-CCN16ZOz.js → agent-browser-DsDp0cSX.js} +1 -1
- package/dist/client/assets/{banner-DOm9_4l-.js → banner-Cja2VfwN.js} +2 -2
- package/dist/client/assets/{file-exclamation-point-BKzL0QhY.js → file-exclamation-point-D8KYFYSh.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-DTxMTVdP.js → highlighted-body-KPVGNVTW-Chp5pHWq.js} +1 -1
- package/dist/client/assets/{hover-card-qzuFUCaR.js → hover-card-FvX18DHP.js} +1 -1
- package/dist/client/assets/{index-Dcs6e-U_.js → index-BFPRILKF.js} +1 -1
- package/dist/client/assets/{index-CtOB9fS3.js → index-BKCteC7q.js} +1 -1
- package/dist/client/assets/index-Bbffv0TQ.js +1247 -0
- package/dist/client/assets/{index-BMOfHKE0.js → index-BhatJcNc.js} +1 -1
- package/dist/client/assets/index-BroohPSu.js +1 -0
- package/dist/client/assets/{index-DT_v3O-B.js → index-Bt4vTnDj.js} +1 -1
- package/dist/client/assets/{index-DwzSdOh3.js → index-BwkmCRvO.js} +1 -1
- package/dist/client/assets/{index-CTai_TxZ.js → index-BzS1K2wS.js} +1 -1
- package/dist/client/assets/{index-C3XnoXTY.js → index-C6F5gzX-.js} +1 -1
- package/dist/client/assets/{index-BaB-skF0.js → index-CIzSi3tA.js} +3 -3
- package/dist/client/assets/{index-BPcwoJoz.js → index-CLCbHvV5.js} +1 -1
- package/dist/client/assets/{index-DA-i3I4q.js → index-CXjobHw0.js} +1 -1
- package/dist/client/assets/{index-DgH_dl1a.js → index-CYcJ7ENW.js} +2 -2
- package/dist/client/assets/{index-3lQkXKcq.js → index-CeqzGl3y.js} +1 -1
- package/dist/client/assets/{index-DgtF-nBt.js → index-CknNaeS2.js} +1 -1
- package/dist/client/assets/{index-Bk98IpMn.js → index-CtK6WJzD.js} +1 -1
- package/dist/client/assets/{index-C8ZMfyGc.js → index-CvxLe-_3.js} +1 -1
- package/dist/client/assets/{index-CF9fqPef.js → index-D24Ttd-y.js} +4 -4
- package/dist/client/assets/{index-CIPHHziB.js → index-D6Jn2eBq.js} +1 -1
- package/dist/client/assets/{index-D3DXMH4x.js → index-DDibi3-x.js} +1 -1
- package/dist/client/assets/{index-C7B2uRgo.js → index-DElGMXW8.js} +2 -2
- package/dist/client/assets/{index-CmlaXay_.js → index-DGNJkiFb.js} +1 -1
- package/dist/client/assets/{index-WjW-NUCp.js → index-DI2T-dXr.js} +1 -1
- package/dist/client/assets/{index-CLhD0Bno.js → index-DZf_utaG.js} +1 -1
- package/dist/client/assets/{index-CTXNRyRE.js → index-D_XtXoLp.js} +1 -1
- package/dist/client/assets/{index-CDTumWMC.js → index-DjdQaKwP.js} +1 -1
- package/dist/client/assets/index-Do18O9VZ.js +1 -0
- package/dist/client/assets/{index-CVl132_4.js → index-Do1vOFrm.js} +1 -1
- package/dist/client/assets/{index-BIMClIrX.js → index-Dv1DkyeB.js} +1 -1
- package/dist/client/assets/{index-IgIVF9T_.js → index-DyvLJ_Z5.js} +1 -1
- package/dist/client/assets/index-HgvJwMGi.js +5 -0
- package/dist/client/assets/{index-DR1JT9Uz.js → index-OxwtxTFo.js} +3 -3
- package/dist/client/assets/index-QSDTjavn.js +1 -0
- package/dist/client/assets/{index-DOxEmnH2.js → index-ZLdoJdwS.js} +1 -1
- package/dist/client/assets/index-_GlgFH88.css +1 -0
- package/dist/client/assets/{index-CScfHuKF.js → index-euarUu2E.js} +1 -1
- package/dist/client/assets/{index-B-z7hA9x.js → index-jYh6X22t.js} +1 -1
- package/dist/client/assets/{index-CIfwPLXd.js → index-uQ1vTS05.js} +1 -1
- package/dist/client/assets/{index-CejezM4U.js → index-xfBvKz-h.js} +1 -1
- package/dist/client/assets/{index-BW5ce4t8.js → index-znQ5q2gV.js} +1 -1
- package/dist/client/assets/{layers-CJHXSEKK.js → layers-8-cbYlfw.js} +1 -1
- package/dist/client/assets/{lightbulb-DWjxw7lb.js → lightbulb-DoB0IKly.js} +1 -1
- package/dist/client/assets/{mention-pill-akMU3IVs.js → mention-pill-BHC6tMG9.js} +1 -1
- package/dist/client/assets/{message-square-off-DEagHpQY.js → message-square-off-CEHuZJtY.js} +1 -1
- package/dist/client/assets/{owner-notice-CLsx0s7q.js → owner-notice-dtDSKfGs.js} +1 -1
- package/dist/client/assets/{page-container-W7byjRmk.js → page-container-BOrdASM1.js} +1 -1
- package/dist/client/assets/primer-trigger-CC-cR5zN.js +3 -0
- package/dist/client/assets/{radio-B8Ozjv9U.js → radio-BfZPhctR.js} +1 -1
- package/dist/client/assets/{room-files-source-Bsc3YA91.js → room-files-source-BHupFaLE.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-CNcDcTvq.js → rotate-ccw-clock-BvzfP8lR.js} +1 -1
- package/dist/client/assets/{rotate-cw-xvfipJLN.js → rotate-cw-BDweizfR.js} +1 -1
- package/dist/client/assets/{scroll-area-C95q3ss7.js → scroll-area-Dph6w3a6.js} +1 -1
- package/dist/client/assets/{search-x-C6SAxw7a.js → search-x-CoFJOP2l.js} +2 -2
- package/dist/client/assets/{shield-x-DxOGc0dW.js → shield-x-BZ6rhiT0.js} +1 -1
- package/dist/client/assets/{soul-file-pg0ShYy3.js → soul-file-H8fwhgiL.js} +1 -1
- package/dist/client/assets/use-delete-binding-CUsepFIL.js +1 -0
- package/dist/client/assets/use-dev-links-DYYe0vvP.js +1 -0
- package/dist/client/assets/{use-external-adapter-catalog-B0gcY-k7.js → use-external-adapter-catalog-CAl3MNq-.js} +1 -1
- package/dist/client/assets/use-full-activity-feed-Bb7BUusp.js +1 -0
- package/dist/client/assets/use-is-below-desktop-CIgGSgoL.js +1 -0
- package/dist/client/assets/use-jump-back-in-BdLBzvDr.js +11 -0
- package/dist/client/assets/use-mesh-topology-wYtCBbF_.js +1 -0
- package/dist/client/assets/use-pending-read-9UcfnDwF.js +1 -0
- package/dist/client/assets/{use-personality-commit-OH7d0xl_.js → use-personality-commit-CaxUHrX5.js} +1 -1
- package/dist/client/assets/{use-promo-activation-BgdGasXE.js → use-promo-activation-rNaAOdoh.js} +2 -2
- package/dist/client/assets/use-pulse-freshness-CygG3s-S.js +1 -0
- package/dist/client/assets/use-room-follow-claim-BIK37Iy3.js +1 -0
- package/dist/client/assets/{use-roving-tab-list-Be60AWK3.js → use-roving-tab-list-DQgkKGzc.js} +1 -1
- package/dist/client/assets/{use-session-canvas-Bqs6IQO7.js → use-session-canvas-Dpy5BEId.js} +5 -5
- package/dist/client/assets/use-session-diagnostics-atu9cfgr.js +16 -0
- package/dist/client/assets/use-unclaimed-chats-qUI5vY5K.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261008170031_session_touches.sql +5 -0
- package/dist/drizzle/20261009171311_chat_messages.sql +41 -0
- package/dist/drizzle/20261009173712_started_by_report_back.sql +1 -0
- package/dist/drizzle/meta/20261008170031_snapshot.json +12642 -0
- package/dist/drizzle/meta/20261009171311_snapshot.json +12906 -0
- package/dist/drizzle/meta/20261009173712_snapshot.json +12914 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/server/index.js +23608 -19236
- package/dist/server/index.js.map +2 -2
- package/package.json +6 -6
- package/dist/client/assets/AdapterIcon-CL-MyyKy.js +0 -1
- package/dist/client/assets/AdapterSetupWizard-C8HOvHLF.js +0 -2
- package/dist/client/assets/CanvasFileContent-ZZhdofR4.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-DMMMZh4o.js +0 -2
- package/dist/client/assets/ConnectionAccessLists-PW1uzcGU.js +0 -1
- package/dist/client/assets/ConnectionsPage-EwitZwOE.js +0 -11
- package/dist/client/assets/HandlePage-CL3_n1CI.js +0 -1
- package/dist/client/assets/Marketplace-DsU-q1ZZ.js +0 -36
- package/dist/client/assets/MarketplaceSourcesView-D72YoKNR.js +0 -1
- package/dist/client/assets/McpSigninBody-Btg3PnYN.js +0 -1
- package/dist/client/assets/NamePage-Bzqj4Eob.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-89yeGqvy.js +0 -1
- package/dist/client/assets/OperatorIdentityForm-BhiB9tQp.js +0 -1
- package/dist/client/assets/PhotoPage-C3fMlebQ.js +0 -1
- package/dist/client/assets/PreviewRefusedNotice-ChCgdKWN.js +0 -1
- package/dist/client/assets/RoomSurface-CgtNuYhl.js +0 -39
- package/dist/client/assets/RunsOnPopover-JTm1cYuw.js +0 -1
- package/dist/client/assets/SessionsPage-D4kyvHQf.js +0 -6
- package/dist/client/assets/SkillsPage-KYUVzuVa.js +0 -1
- package/dist/client/assets/ToolsPage-CWpHMlrR.js +0 -2
- package/dist/client/assets/TourHost-VY1-sy1Y.js +0 -1
- package/dist/client/assets/UnlinkDialog-3p38G_9q.js +0 -1
- package/dist/client/assets/_shell-DAjwimLg.js +0 -93
- package/dist/client/assets/_shell._home.activity-tk-XApvX.js +0 -1
- package/dist/client/assets/_shell._home.index-BNVhSN0y.js +0 -3
- package/dist/client/assets/_shell._home.workspaces-DuXnjQh0.js +0 -1
- package/dist/client/assets/_shell.connections-DIm3mUHy.js +0 -6
- package/dist/client/assets/_shell.marketplace-DF6Y7mc0.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-Do8cm7kq.js +0 -1
- package/dist/client/assets/_shell.session-DlN8iOl-.js +0 -43
- package/dist/client/assets/_shell.x._extensionId-0Q1rJtud.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-0Q1rJtud.js +0 -1
- package/dist/client/assets/agent-attention-Dn__3LQE.js +0 -5
- package/dist/client/assets/hand-DLUdsiuR.js +0 -6
- package/dist/client/assets/index-CQWqpw_G.js +0 -1
- package/dist/client/assets/index-D5uYwabS.js +0 -1
- package/dist/client/assets/index-DFMDv6qR.js +0 -1
- package/dist/client/assets/index-DMYBI16t.js +0 -1252
- package/dist/client/assets/index-DbbZNAKk.js +0 -5
- package/dist/client/assets/index-Dgp1LmEk.css +0 -1
- package/dist/client/assets/primer-trigger-DuM9vVnV.js +0 -3
- package/dist/client/assets/use-delete-binding-CZVeHqn0.js +0 -1
- package/dist/client/assets/use-dev-links-Df2WkCic.js +0 -1
- package/dist/client/assets/use-full-activity-feed-SYcgdMZu.js +0 -1
- package/dist/client/assets/use-is-below-desktop-C5_YenEp.js +0 -1
- package/dist/client/assets/use-jump-back-in-DWUPb1gi.js +0 -11
- package/dist/client/assets/use-mesh-topology-HLzZIgis.js +0 -1
- package/dist/client/assets/use-pending-read-BuJknrxG.js +0 -1
- package/dist/client/assets/use-pulse-freshness-BlD-dM_g.js +0 -1
- package/dist/client/assets/use-rename-session-D3MuyK-F.js +0 -1
- package/dist/client/assets/use-room-follow-claim-CyjhzbRJ.js +0 -1
- package/dist/client/assets/use-session-diagnostics-CfKdB2iY.js +0 -16
- package/dist/client/assets/use-unclaimed-chats-lqMhotUB.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{g3 as _,dr as x,r,j as a,bd as R,O as h,aa as y,g8 as O,g9 as v,ga as b,gb as D,gc as U,Q as P,ad as C,gd as p,ge as j,gf as w,aD as T,gg as H}from"./index-DMYBI16t.js";import{u as A}from"./use-is-below-desktop-C5_YenEp.js";const F=.16,G=`[&_button]:${O}`;function oe({candidates:e,ready:t,name:s="sidebar-bottom-slot",className:n}){const o=_(),c=x(),i=t?e.find(I=>I.show):void 0,[u,d]=r.useState(void 0),l=r.useRef(!1);r.useEffect(()=>{!t||l.current||(l.current=!0,d((i==null?void 0:i.id)??null))},[t,i]);const M=u!==void 0&&(i==null?void 0:i.id)!==u&&!o;return a.jsx("div",{"data-slot":s,className:y("shrink-0 px-2 pb-2 empty:p-0",c&&G,n),children:a.jsx(R,{initial:!1,children:i!==void 0&&a.jsx(h.div,{initial:M?{height:0,opacity:0}:!1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:o?0:F,ease:[0,0,.2,1]},className:"overflow-hidden",children:i.render()},i.id)})})}const K={knock:"/knock.wav",settle:"/settle.wav","turn-end":"/notification.wav"},g=new Map;function L(e){try{let t=g.get(e);t||(t=new Audio(K[e]),g.set(e,t)),t.currentTime=0,t.play().catch(()=>{})}catch{}}const $="You",W="human",Y="system",B="System",Q="agent",q="Agent",z="runtime:";function V(e){return e.messageType==="local_command_output"||e.messageType==="compaction"}function ae(e,t){var n,o;if(V(e))return{kind:"system",id:Y,displayName:B};if(e.role==="user")return{kind:"human",id:W,displayName:((n=t.humanName)==null?void 0:n.trim())||$};if(t.agent){const{id:c,displayName:i,emoji:u,color:d,imageUrl:l}=t.agent;return{kind:"agent",id:c,displayName:i,emoji:u,color:d,imageUrl:l}}const s=(o=t.runtime)==null?void 0:o.trim();return s?{kind:"agent",id:`${z}${s}`,displayName:v(s),runtime:s}:{kind:"agent",id:Q,displayName:q}}const X=[0,.2,.4];function J({className:e}){return a.jsx("div",{className:y("flex gap-1",e),"data-testid":"typing-dots","aria-hidden":"true",children:X.map(t=>a.jsx("span",{className:"bg-muted-foreground h-2 w-2 rounded-full",style:{animation:"typing-dot 1.4s ease-in-out infinite",animationDelay:`${t}s`}},t))})}function re({record:e}){const t=_(),{color:s,emoji:n}=b({id:e.agentId,icon:e.icon,color:e.color}),o=e.displayName.trim()||"Your agent";return a.jsxs("div",{className:"flex flex-col items-center gap-5 text-center","data-testid":"first-light",children:[a.jsx(h.div,{animate:t?void 0:{scale:[1,1.05,1],opacity:[.9,1,.9]},transition:t?void 0:{duration:3,repeat:1/0,ease:"easeInOut"},children:a.jsx(D,{color:s,emoji:n,size:"lg"})}),a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsxs("p",{className:"text-muted-foreground text-base","aria-live":"polite",children:[o," is waking up…"]}),a.jsx(J,{})]})]})}const E="dork-kickoff",S=`<${E}>`,k=`</${E}>`;function ce(e){return`${S}
|
|
2
|
-
${e.trim()}
|
|
3
|
-
${k}`}function Z(e){const t=U(e);return t.startsWith(S)&&t.endsWith(k)}function ue(e){const t=e.findIndex(s=>s.role==="user");return t===-1||!Z(e[t].content)?e:e.filter((s,n)=>n!==t)}function le(e,t,s){const n=P();return C({queryKey:["commands",{cwd:e??null,sessionId:t??null,runtime:s??null}],queryFn:()=>n.getCommands(!1,e??void 0,{sessionId:t,runtime:s}),staleTime:p.COMMANDS_STALE_TIME_MS,gcTime:p.COMMANDS_GC_TIME_MS})}function de(){const e=T(n=>n.loadRightPanelState),t=A(),s=r.useRef(!t);r.useEffect(()=>{e({restoreOpen:s.current})},[e])}const N=Symbol("right-panel-layout-key-pending");function fe(){const[e]=j(),{data:t,isPending:s}=w(e),n=T(u=>u.loadRightPanelForAgent),o=A(),c=r.useRef(o);r.useEffect(()=>{c.current=o},[o]);let i;e?s?i=N:i=(t==null?void 0:t.id)??e:i=null,r.useEffect(()=>{i!==N&&n(i,e,{inherit:!c.current})},[i,e,n]),r.useEffect(()=>()=>n(null),[n])}const ee={knock:"knock",settle:"allClear","turn-end":"turnEnd"};function me(){const{prefs:e}=H(),{sounds:t}=e;return{play:r.useCallback(n=>{t[ee[n]]&&L(n)},[t])}}const pe=3e4;let f=!1;const m=new Set;function ge(){if(!f){f=!0;for(const e of m)e()}}function te(e){return m.add(e),()=>{m.delete(e)}}function ne(){return f}function Ne(){return r.useSyncExternalStore(te,ne,()=>!1)}export{oe as B,re as F,pe as L,J as T,ge as a,me as b,le as c,fe as d,de as e,ue as f,ae as r,Ne as u,ce as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as r,R as o,U as s,a7 as a}from"./index-DMYBI16t.js";function i(){const e=r(),t=o();return s({mutationFn:n=>e.deleteBinding(n),onSuccess:()=>{t.invalidateQueries({queryKey:[...a]})},meta:{errorLabel:"Couldn’t remove that connection"}})}export{i as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as a,ad as r,R as i,r as n,ae as s,af as t}from"./index-DMYBI16t.js";function l(){const e=a();return r({queryKey:s.devLinks(),queryFn:()=>e.listDevLinks()})}function o(){const e=i();return n.useCallback(()=>{e.invalidateQueries({queryKey:[...s.all,"installed"]}),e.invalidateQueries({queryKey:t.all}),e.invalidateQueries({queryKey:["commands"]})},[e])}export{l as a,o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as r,ai as a}from"./index-DMYBI16t.js";const n=["activity"];function o(t={}){const i=r();return a({queryKey:[...n,t],queryFn:({pageParam:e})=>i.listActivityEvents({...t,limit:50,before:e}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,staleTime:3e4,refetchOnWindowFocus:!0})}export{n as A,o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aj as e}from"./index-DMYBI16t.js";const o=1024;function t(){return e(`(max-width: ${o-1}px)`)}export{t as u};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as l,Y as h,j as c,fd as N,aa as _,fe as x,ff as S,fg as M,fh as L,fi as p,eC as C,fj as T,fk as E,fl as D}from"./index-DMYBI16t.js";function J(){const[e,t]=l.useState(()=>m());return l.useEffect(()=>{const n=window.visualViewport;if(!n)return;const s=()=>{const r=m();t(i=>i===r?i:r)};return n.addEventListener("resize",s),n.addEventListener("scroll",s),()=>{n.removeEventListener("resize",s),n.removeEventListener("scroll",s)}},[]),e}function m(){const e=typeof window<"u"?window.visualViewport:void 0;return!e||e.scale>1?0:Math.max(0,Math.round(window.innerHeight-(e.height+e.offsetTop)))}/**
|
|
2
|
-
* @license lucide-react v1.48.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const g={name:"at-sign",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]};g.node;const R=h(g);/**
|
|
7
|
-
* @license lucide-react v1.48.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const A={name:"repeat",size:24,node:[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]};A.node;const U=h(A),j=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"]);function Y({gripStyle:e,onDragging:t,onResizeEnd:n,disabled:s=!1,...r}){const i=a=>{!s&&j.has(a.key)&&(n==null||n())};return c.jsx(N,{...r,disabled:s,tabIndex:s?-1:0,"aria-disabled":s||void 0,onDragging:a=>{t==null||t(a),a||n==null||n()},onKeyDown:i,className:"group relative outline-none",style:{width:0,overflow:"visible"},children:c.jsx("div",{className:"absolute inset-y-0 -left-1 z-10 flex w-2 items-center justify-center",style:e,children:c.jsx("div",{"data-slot":"pane-resize-line",className:_("h-full w-px transition-colors duration-500",!s&&"group-hover:bg-ring/50 group-focus-visible:bg-ring group-focus-visible:transition-none")})})})}const k=8;function I(e){if(e==null)return null;const t=e.replace(/\s+/g," ").trim();return t.length===0?null:t}function H(e){if(L(e)){const n=e.unreadCount??0;return n===1?"1 new message":`${n} new messages`}const t=e.working??0;return t>0?t===1?"1 agent working":`${t} agents working`:I(e.topic)}function w(e){return{kind:"session",id:e.id,name:S(e.title),summary:I(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function O(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:M(e),summary:H(e),lastActivityAt:e.lastActivityAt,room:e}}function y(e){if(e===void 0)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}function B(e){return e.kind==="session"?p("session",e.id):p("room",e.id)}function v(e,t){const n=y(t[B(e)]);return n!==null?n:y(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function K(e){return(t,n)=>v(n,e)-v(t,e)||n.id.localeCompare(t.id)}function W(e){const t=new Set;return e.filter(n=>{const s=`${n.kind}:${n.id}`;return t.has(s)?!1:(t.add(s),!0)})}function b(e,t){return!(t.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function P({sessions:e,rooms:t,mutedRoomIds:n=new Set,interactions:s={},limit:r=k}){const{conversations:i,automated:a}=x([...e]),o=K(s),f=[...i.map(w),...t.filter(u=>b(u,n)).map(O)].sort(o);return{items:W(f).slice(0,r),automated:a.map(w).sort(o).slice(0,r)}}const V=3,$=D;function Q({limit:e=k,mutedRoomIds:t,enabled:n=!0}={}){var u,d;const s=C(Math.max(e*V,$),{enabled:n}),r=T({enabled:n}),i=E(),a=(u=s.data)==null?void 0:u.sessions,o=r.data;return{...l.useMemo(()=>P({sessions:a??[],rooms:o??[],mutedRoomIds:t,interactions:i,limit:e}),[a,o,t,i,e]),isLoading:n&&(s.isLoading||r.isLoading),warnings:((d=s.data)==null?void 0:d.warnings)??[]}}export{R as A,Y as P,U as R,J as a,Q as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as t,ad as s}from"./index-DMYBI16t.js";const u=["mesh","topology"];function y(e,o=!0){const r=t();return s({queryKey:[...u,e],queryFn:()=>r.getMeshTopology(e),enabled:o,staleTime:3e4,refetchInterval:3e4})}export{y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ag as n}from"./index-DMYBI16t.js";function r(s){const e=n();return s||e}export{r as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as h,ad as E,r as T,bh as p,ah as a,bi as y,bj as m,bk as A}from"./index-DMYBI16t.js";import{A as D}from"./use-full-activity-feed-SYcgdMZu.js";const f=15,g=["dashboard-activity"],k=["Today","Yesterday","This week","Earlier"];function w(d){const s=new Date,e=new Date(s);e.setHours(0,0,0,0);const _=new Date(e);_.setDate(_.getDate()-1);const o=new Date(e);o.setDate(o.getDate()-o.getDay());const l=new Map;for(const n of d){const c=new Date(n.occurredAt);let i;c>=e?i="Today":c>=_?i="Yesterday":c>=o?i="This week":i="Earlier";const u=l.get(i)??[];u.push(n),l.set(i,u)}return k.filter(n=>l.has(n)).map(n=>({label:n,items:l.get(n)}))}function b(){const d=h(),{data:s,isLoading:e}=E({queryKey:g,queryFn:()=>d.listActivityEvents({limit:f}),staleTime:3e4,refetchOnWindowFocus:!0});return{groups:T.useMemo(()=>w((s==null?void 0:s.items)??[]),[s==null?void 0:s.items]),hasMore:(s==null?void 0:s.nextCursor)!=null,isLoading:e}}const r=[g,D],t={relay_message:r,relay_flow:r,relay_adapters_changed:r,relay_bindings_changed:r,extension_reloaded:r,task_run_failed:[...r,y],task_run_updated:[y],relay_dead_letter:[m],mesh_liveness_changed:[A],tasks_changed:r},I=1200;function v(d=I){const s=p({coalesceMs:d}),e=_=>s(_.map(o=>({queryKey:o})));a("relay_message",()=>e(t.relay_message)),a("relay_flow",()=>e(t.relay_flow)),a("relay_adapters_changed",()=>e(t.relay_adapters_changed)),a("relay_bindings_changed",()=>e(t.relay_bindings_changed)),a("extension_reloaded",()=>e(t.extension_reloaded)),a("task_run_failed",()=>e(t.task_run_failed)),a("task_run_updated",()=>e(t.task_run_updated)),a("relay_dead_letter",()=>e(t.relay_dead_letter)),a("mesh_liveness_changed",()=>e(t.mesh_liveness_changed)),a("tasks_changed",()=>e(t.tasks_changed))}export{v as a,b as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as h,R as d,T as p,U as Q,V as i,W as f}from"./index-DMYBI16t.js";function S(r){const m=h(),t=d(),{ownResolvedAccount:c,nameFor:v}=p();return Q({mutationFn:({sessionId:a,title:o})=>m.updateSession(a,{title:o},r??void 0),onMutate:async({sessionId:a,title:o})=>{var y;await t.cancelQueries({queryKey:i.listRoot});const s=t.getQueryData(i.list(r)),e=(y=s==null?void 0:s.find(u=>u.id===a))==null?void 0:y.account,n=e===void 0||c!==void 0&&e===c;return n&&t.setQueryData(i.list(r),u=>u==null?void 0:u.map(l=>l.id===a?{...l,title:o}:l)),{previous:s,account:e,showsInList:n}},onSuccess:(a,o,s)=>{const e=s==null?void 0:s.account;if(!e||s!=null&&s.showsInList)return;const n=v(e);f.success(`Renamed on ${n}`,{description:c?"Shows once you switch to that account.":`Shows while ${n} is the active account.`})},onError:(a,o,s)=>{s!=null&&s.previous&&t.setQueryData(i.list(r),s.previous)},onSettled:()=>{t.invalidateQueries({queryKey:i.listRoot})},meta:{errorLabel:"Couldn’t rename that session"}})}export{S as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ax as a,r,Q as p,ay as E,az as F}from"./index-DMYBI16t.js";function g(e){const n=a(l=>l.forgetRoom);r.useEffect(()=>{if(e!==null)return()=>n(e)},[e,n])}function L(e){const n=p(),l=a(t=>{var o;return e?((o=t.intent[e])==null?void 0:o.leaderId)??null:null}),u=a(t=>t.startFollowing),s=a(t=>t.stopFollowing),c=a(t=>t.sweep),f=r.useCallback(t=>{e&&u(e,t)},[e,u]),w=r.useCallback(()=>{e&&s(e)},[e,s]);return r.useEffect(()=>{const t=setInterval(()=>c(),E);return()=>clearInterval(t)},[c]),r.useEffect(()=>{if(!e||l===null)return;let t=!0;const o=()=>{n.followRoomMember(e,l).catch(()=>{t&&s(e)})};o();const v=setInterval(o,F),i=()=>s(e);return window.addEventListener("blur",i),window.addEventListener("pagehide",i),()=>{t=!1,clearInterval(v),window.removeEventListener("blur",i),window.removeEventListener("pagehide",i),n.unfollowRoomMember(e).catch(()=>{})}},[n,e,l,s]),{following:l,follow:f,stop:w}}export{g as a,L as u};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{Y as xe,ds as oe,Q as V,R as ge,U as Ms,kr as Rs,hz as F,r as h,ks as As,kt as Je,ku as Ze,kv as es,kw as _s,aD as ne,hC as ss,dt as Ne,w as je,ad as ye,kx as Ds,ky as Os,V as ts,kz as Ps,dw as ns,kA as Is,kB as Ae,kC as Us,kD as Ls,kE as zs,W as Bs,j as s,bd as be,O as ke,aa as T,dM as $s,gd as _e,kF as me,kG as Fs,dj as ee,kH as Gs,hV as rs,kI as Hs,kj as Qs,bm as ve,kJ as Ws,c8 as q,hh as qs,kK as Ks,kL as is,kM as Vs,kN as K,cr as O,cs as P,ct as I,dl as Se,dm as Te,dn as Ce,dp as we,kO as Xs,aB as as,kP as Ys,hy as Js,kQ as Zs,kR as et,kS as G,dy as st,kT as tt,dQ as nt,aX as rt,B as H,kU as it,kV as at,g9 as ot,kW as os,kX as lt,T as ct,kY as De,kZ as ut,hX as dt,hY as mt,k_ as Oe,h_ as pt,h$ as ft,k$ as ht,l0 as xt,i0 as Pe,l1 as gt,f as Nt,l2 as jt,l3 as yt,dC as Ie,hj as ls,l4 as bt,l5 as kt,l6 as cs,l7 as us,l8 as vt,fG as St,fH as Tt,fI as Ct,fJ as wt,a3 as re,fK as Et,fL as Mt,fM as Rt,fN as At,e as J,e6 as ds,dD as Ue,jD as Le,hv as _t,I as Dt,jE as Ot,l9 as Pt,ab as ms,hq as Ee,bO as It,la as ps,dq as ie,lb as Ut,bQ as de,lc as pe,ld as fs,le as hs,bR as xs,lf as Lt,lg as zt,lh as Bt,fP as $t,li as Ft,fR as Gt,bS as Ht,lj as Qt,be as Z,bT as gs,lk as Wt,iD as qt,ir as Kt,ll as Vt,lm as Xt,dR as Yt,ln as Jt,iS as Zt,lo as en,h1 as sn,h2 as tn,gV as nn,aF as rn,X as an,dr as on,ka as ln,fA as cn,hA as un,el as dn,lp as mn,hU as pn,a6 as fn,id as hn,h4 as xn,c5 as gn,lq as Nn,lr as jn,ls as yn,lt as bn,lu as kn,lv as vn,lw as Sn}from"./index-DMYBI16t.js";import{L as Tn}from"./layers-CJHXSEKK.js";import{H as Cn,a as wn,b as En}from"./hover-card-qzuFUCaR.js";/**
|
|
2
|
-
* @license lucide-react v1.48.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Ns={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};Ns.node;const Mn=xe(Ns);/**
|
|
7
|
-
* @license lucide-react v1.48.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const js={name:"clipboard-copy",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]};js.node;const Rn=xe(js);/**
|
|
12
|
-
* @license lucide-react v1.48.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const ys={name:"wifi",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]};ys.node;const se=xe(ys);function An(e){return e.ambient===!0&&e.status!=="error"}function fi(e){const t=[],n=[];for(const r of e)(r.ambient?n:t).push(r);return{shown:t,ambient:n}}function _n(e){var t;return((t=e==null?void 0:e.ui)==null?void 0:t.statusBar)??As}function Dn(){const{data:e}=oe();return _n(e)}function On(){const e=V(),t=ge(),n=Ms({mutationKey:Rs,mutationFn:i=>e.updateConfig({ui:{statusBar:{pins:[...i]}}}),onMutate:async i=>{await t.cancelQueries({queryKey:F.current()});const o=t.getQueryData(F.current());return t.setQueryData(F.current(),a=>a!=null&&a.ui?{...a,ui:{...a.ui,statusBar:{pins:[...i]}}}:a),{previous:o}},onError:(i,o,a)=>{a&&a.previous!==void 0&&t.setQueryData(F.current(),a.previous)},onSettled:()=>{t.invalidateQueries({queryKey:F.current()})}});return{setPins:h.useCallback(i=>n.mutate(i),[n]),isPending:n.isPending}}function Pn(e){var n;const t=e.cacheStats;return!t||t.cacheReadTokens===0&&t.cacheCreationTokens===0?null:{cacheReadTokens:t.cacheReadTokens,cacheCreationTokens:t.cacheCreationTokens,contextTokens:(n=e.contextUsage)==null?void 0:n.totalTokens}}function In(e){var t,n;return e?{contextPercent:Je((t=e.contextUsage)==null?void 0:t.totalTokens,(n=e.contextUsage)==null?void 0:n.maxTokens),costUsd:e.cost,model:e.model,cacheStatus:Pn(e),usage:e.usage}:{contextPercent:null,costUsd:null,model:null,cacheStatus:null,usage:null}}function bs(e,t,n){if(t)return"streaming";if(e===void 0)return n;switch(e){case"streaming":return"streaming";case"error":return"error";default:return"idle"}}function hi(e,t){var n;return bs((n=e.status)==null?void 0:n.lifecycle,e.triggerPending,t)}function Un(e){const t=Ze(e),n=es(e),r=_s(e);return bs(t,n,r)}function te(e){return!e.isPending||e.fetchStatus==="idle"||e.fetchStatus==="paused"}const Ln=5e3;function zn(e,t){const n=V(),r=ne(k=>k.selectedCwd),{sessions:i,isAnswered:o,isLoading:a}=ss(),c=oe(),f=Ne(),{data:p}=c,{data:m}=f,d=t??(m==null?void 0:m.defaultRuntime)??null,u=je(d),N=e!==null&&o&&!i.some(k=>k.id===e),S=ye({queryKey:ts.storedSettings(e),queryFn:()=>n.getStoredSessionSettings(e),staleTime:Ln,enabled:N,networkMode:"always"}),{data:l}=S;if(r===null)return{mode:void 0,settled:!1};if(a)return{mode:void 0,settled:!1};if(!N)return{mode:void 0,settled:!0};if(!te(S)||!te(c)||!te(f))return{mode:void 0,settled:!1};if((l==null?void 0:l.permissionMode)!==void 0)return{mode:l.permissionMode,settled:!0};if(!d||!(u!=null&&u.permissionModes.supported))return{mode:void 0,settled:!0};const j=Ds(p==null?void 0:p.executionDefaults,d);return{mode:Os(j,u.permissionModes),settled:!0}}function Bn(e,t,n,r){var Q,W;const i=V(),o=ge(),a=ne(y=>y.selectedCwd),c=Ps(e),f=(c==null?void 0:c.cwd)??a,p=ne(y=>y.pendingAccount),{data:m}=ns({sessionId:e??void 0,runtime:r??void 0}),d=Is(e??""),u=Ae(y=>y.apply),N=Ae(y=>y.clear),S=Us(e),{data:l}=S,{sessions:j}=ss(),k=e===null?void 0:j.find(y=>y.id===e),w=zn(e,r),g=((Q=m==null?void 0:m.find(y=>y.isDefault))==null?void 0:Q.value)??((W=m==null?void 0:m[0])==null?void 0:W.value)??"",b=Ls(e??""),R=!r||!(l!=null&&l.runtime)||l.runtime===r?l==null?void 0:l.model:void 0,M=b&&R===b.from?b.to:R,U=d.model??(n?t==null?void 0:t.model:null)??M??g,A=m==null?void 0:m.find(y=>y.value===U),E=(t==null?void 0:t.contextTokens)??(l==null?void 0:l.contextTokens)??null,x=(t==null?void 0:t.contextMaxTokens)??(A==null?void 0:A.contextWindow)??null,B=d.effort??(l==null?void 0:l.effort)??null,$=d.fastMode??(l==null?void 0:l.fastMode)??!1,X=d.permissionMode??(l==null?void 0:l.permissionMode)??(k==null?void 0:k.permissionMode)??w.mode,le=e===null||X!==void 0||te(S)&&w.settled,ce={permissionMode:zs(d.permissionMode,X),permissionModeKnown:le,model:U,effort:B,fastMode:$,costUsd:(t==null?void 0:t.costUsd)??null,contextPercent:Je(E,x),isStreaming:n,cwd:(l==null?void 0:l.cwd)??null},ue=h.useCallback(async(y,C)=>{var Me;if(!e)return;const _={...y.model?{model:y.model}:{},...y.permissionMode?{permissionMode:y.permissionMode}:{},...y.effort?{effort:y.effort}:{},...y.fastMode!==void 0?{fastMode:y.fastMode}:{}};u(e,_);const L=(p==null?void 0:p.sessionId)===e?p.id:void 0,ws={...r?{runtime:r}:{},...L?{account:L}:{},...y};try{const{permissionModePendingUntilNextTurn:Y,runtimeUnbound:Es,...Re}=await i.updateSession(e,ws,f??void 0);return Y&&Bs.warning("Saved · starts on your next message",{description:"The current reply keeps its old setting."}),o.setQueriesData({queryKey:ts.bySession(e)},z=>({...z,...Re,...y.model===void 0?{model:z==null?void 0:z.model}:{},...Es?{runtime:z==null?void 0:z.runtime}:{}})),Re}catch(Y){console.error("[useSessionStatus] updateSession failed for session",e,Y),N(e,_),(Me=C==null?void 0:C.onError)==null||Me.call(C,Y)}},[i,e,r,f,p,o,u,N]);return h.useEffect(()=>{if(!e)return;const y={};d.model!==void 0&&(l==null?void 0:l.model)===d.model&&(y.model=d.model),d.permissionMode!==void 0&&(l==null?void 0:l.permissionMode)===d.permissionMode&&(y.permissionMode=d.permissionMode),d.effort!==void 0&&(l==null?void 0:l.effort)===d.effort&&(y.effort=d.effort),d.fastMode!==void 0&&(l==null?void 0:l.fastMode)===d.fastMode&&(y.fastMode=d.fastMode),Object.keys(y).length>0&&N(e,y)},[e,l==null?void 0:l.model,l==null?void 0:l.permissionMode,l==null?void 0:l.effort,l==null?void 0:l.fastMode,d,N]),{...ce,updateSession:ue}}function $n(e){const t=V();return ye({queryKey:["subagents",e??null],queryFn:()=>t.getSubagents({sessionId:e}),staleTime:1800*1e3})}const Fn={duration:.2,ease:[.4,0,.2,1]},Gn="pointer-coarse:[&_button]:py-3";function xi({items:e,trailing:t}){const n=e.filter(i=>i.cluster==="left"),r=e.filter(i=>i.cluster==="right");return s.jsxs("div",{role:"toolbar","aria-label":"Session status","aria-live":"polite","data-testid":"status-line",className:"text-muted-foreground flex items-center gap-2 overflow-hidden px-1 text-xs whitespace-nowrap pointer-coarse:min-h-11",children:[s.jsx(ze,{items:n,className:"min-w-0 flex-auto"}),s.jsx(ze,{items:r,className:"min-w-0 shrink"}),t!==void 0&&s.jsx("span",{className:"flex shrink-0 items-center",children:t})]})}const Hn=8;function Qn(e,t){return Hn**Math.max(0,t.indexOf(e.key))}function ze({items:e,className:t}){const n=[...e].sort((r,i)=>i.severity-r.severity).map(r=>r.key);return s.jsx("div",{className:T("flex items-center gap-2",t),children:s.jsx(be,{initial:!1,mode:"popLayout",children:e.map((r,i)=>s.jsxs(ke.div,{"data-testid":`status-item-${r.key}`,"data-rigid":r.rigid?"true":void 0,layout:"position",initial:{opacity:0,scale:.8,filter:"blur(4px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.8,filter:"blur(4px)"},transition:Fn,style:r.rigid?void 0:{flexShrink:Qn(r,n)},className:T("inline-flex items-center gap-2",r.rigid?"shrink-0":"min-w-10",Gn),children:[i>0&&s.jsx(Wn,{}),r.node]},r.key))})})}function Wn(){return s.jsx("span",{className:"text-muted-foreground/30 shrink-0","aria-hidden":"true",children:"·"})}function gi({cwd:e}){const t=e.split("/").filter(Boolean).pop()??e;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:e,children:[s.jsx($s,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:t})]})}const qn=Object.freeze({state:"unknown"}),Kn=Object.freeze({state:"no-repo"});function Vn(e){const t=V();return ye({queryKey:["git-status",e],queryFn:()=>t.getGitStatus(e??void 0),enabled:!!e,refetchInterval:_e.GIT_STATUS_REFETCH_MS,refetchIntervalInBackground:!1,staleTime:_e.GIT_STATUS_STALE_TIME_MS})}function Xn(e){return!!e&&!("error"in e)}function Yn(e){return e===void 0?qn:"error"in e?Kn:{state:"repo",branch:e.branch,dirty:!e.clean}}function ae(e){const t=e.trim(),n=Array.from(t);return n.length<=me?t:`${n.slice(0,me-1).join("").trimEnd()}…`}function Jn(e){return e.replace(/\s*\([^()]*\)\s*$/,"").split("·")[0].trim()}function Zn(e,t){return ae(er(e,t))}function er(e,t){const n=t.find(i=>i.value===e);if(n)return Jn(n.displayName);const r=/claude-(\w+)-/.exec(e);return r?`${r[1].charAt(0).toUpperCase()}${r[1].slice(1)}`:e==="default"?"Default":Fs(e)??e}function Ni({data:e,workspace:t,compact:n}){if(!e)return null;if(!Xn(e))return s.jsxs("span",{className:"text-muted-foreground/50 inline-flex min-w-0 items-center gap-1",title:"Not a git repository",children:[s.jsx(ee,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:"No repo"})]});const r=e.modified+e.staged+e.untracked,i=r===1?"1 change":`${r} changes`,o=[];if(e.modified>0&&o.push(`${e.modified} modified`),e.staged>0&&o.push(`${e.staged} staged`),e.untracked>0&&o.push(`${e.untracked} untracked`),e.conflicted>0&&o.push(`${e.conflicted} conflicted`),t){const c=Gs(t.portBase),f=[`${t.key} · ${t.projectKey}`,`${t.branch??e.branch} · ${t.provider}`,e.ahead>0?`↑${e.ahead}`:"",e.behind>0?`↓${e.behind}`:"",o.length>0?o.join(", "):"clean",`ports ${c.DORKOS_PORT} / ${c.VITE_PORT} / ${c.SITE_PORT}`,t.pinned?"pinned":""].filter(Boolean);return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:f.join(" · "),children:[s.jsx(ee,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[20ch] truncate font-medium",children:n?ae(t.key):t.key}),!n&&s.jsxs("span",{className:"text-muted-foreground truncate",children:["· ",t.projectKey]}),t.pinned&&s.jsx(rs,{className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),r>0&&(n?s.jsx(Be,{label:i}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",i]}))]})}const a=o.length>0?`${e.branch} · ${o.join(", ")}`:`${e.branch} · clean`;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:a,children:[s.jsx(ee,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[25ch] truncate",children:n?ae(e.branch):e.branch}),e.ahead>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(Hs,{className:"size-(--size-icon-xs)"}),e.ahead]}),e.behind>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(Qs,{className:"size-(--size-icon-xs)"}),e.behind]}),r>0&&(n?s.jsx(Be,{label:i}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",i]}))]})}function Be({label:e}){return s.jsx("span",{role:"img","aria-label":e,title:e,className:"bg-muted-foreground/70 size-1 shrink-0 rounded-full"})}function sr({stop:e,onMakeDefault:t,onDismiss:n,pending:r,error:i,placement:o="inline"}){const a=o==="overlay";return a&&!e?null:s.jsx("div",{className:T("flex items-center px-1",a?"bg-background/95 pointer-events-auto absolute right-0 bottom-full left-0 z-20 mb-1 rounded-md py-0.5 backdrop-blur-sm":"min-h-5"),"data-testid":a?"make-default-slot-overlay":"make-default-slot",children:e&&s.jsxs("p",{role:"status","data-testid":"make-default-offer",className:T("animate-in fade-in-0 flex min-w-0 items-center gap-1.5 text-xs duration-200 motion-reduce:animate-none",i?"text-destructive":"text-muted-foreground"),children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:i?s.jsxs(s.Fragment,{children:[s.jsx(ve,{className:"mr-1 inline size-3 shrink-0 align-[-2px]","aria-hidden":!0}),i]}):s.jsxs(s.Fragment,{children:["Start every new session in ",Ws(e),"?"]})})," ",s.jsxs("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap",children:[i?s.jsx("button",{type:"button",disabled:r,onClick:t,"data-testid":"make-default-retry",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Try again"}):s.jsx("button",{type:"button",disabled:r,onClick:t,"data-testid":"make-default-confirm",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Make default"}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("button",{type:"button",onClick:n,"data-testid":"make-default-dismiss",className:"focus-ring hover:text-foreground rounded-sm underline underline-offset-2",children:"Dismiss"})]})]})})}const tr="Auto mode needs Opus 4.6+ or Sonnet 4.6";function ji({mode:e,onChangeMode:t,disabled:n,pending:r,runtime:i,modelSupportsAutoMode:o,planActive:a,compact:c,makeDefault:f,onOpenChange:p}){var E;const m=je(i),d=ne(x=>x.setControlCenterOpen),u=q(x=>x.open),N=q(x=>x.setOpen),S=q(x=>x.setAvailable),l=!(m&&!m.permissionModes.supported)&&n!==!0&&r!==!0;if(h.useEffect(()=>(S(l),()=>S(!1)),[l,S]),m&&!m.permissionModes.supported)return null;const j=(m==null?void 0:m.permissionModes.values)??[],k=!o&&j.some(x=>x.id==="auto"),w=k?j.filter(x=>x.id!=="auto"):j,g=w.find(x=>x.id===e),b=(g==null?void 0:g.label)??qs(e),D=c?ae(b):b,R=Ks(g),M=(E=is(w).find(x=>x.mode.id===e))==null?void 0:E.stop,U=k&&(M==="act"||e==="auto"),A=s.jsxs("button",{disabled:n,"data-testid":"permission-mode-trigger","aria-label":`Permissions: ${b}`,className:T(K,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40",R),children:[s.jsx(Vs,{descriptor:g,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:D})]});return n?s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:A})}),s.jsx(I,{side:"top",children:"Send a message first"})]}):r?s.jsxs("span",{"data-testid":"permission-mode-pending","aria-busy":"true","aria-label":"Permissions: still loading",className:T(K,"items-center gap-1 opacity-40"),children:[s.jsx("span",{className:"bg-muted-foreground/30 size-(--size-icon-xs) shrink-0 animate-pulse rounded-full"}),s.jsx("span",{className:"bg-muted-foreground/30 h-2 w-10 animate-pulse rounded"})]}):s.jsxs(Se,{open:u,onOpenChange:x=>{N(x),p==null||p(x)},children:[s.jsx(Te,{asChild:!0,children:A}),s.jsxs(Ce,{side:"top",align:"start",className:"w-80 p-3","aria-label":"Permissions",children:[s.jsx(we,{children:"Permissions"}),s.jsx(Xs,{mode:e,descriptors:w,onChangeMode:t,planActive:a,onUnlock:()=>d(!0)}),f&&s.jsx(sr,{...f}),U&&s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:s.jsxs("p",{"data-testid":"auto-unsupported-hint",className:"text-muted-foreground text-3xs mt-2 flex items-center gap-1.5 px-1",children:[s.jsx(as,{className:"size-(--size-icon-xs) shrink-0"}),"Auto unavailable on this model"]})}),s.jsx(I,{side:"top",children:tr})]}),s.jsx(Ys,{mode:e,descriptor:g,className:"mt-2 px-1"})]})]})}const nr=6e3;function rr(e){return e instanceof Error&&e.message||"Couldn’t save that. Try again."}function yi(e){var Q,W,y;const{sessionId:t,runtime:n,declaredModes:r,runtimeDefaultMode:i}=e,{data:o}=oe(),{data:a}=Ne(),c=Js(),f=ge(),p=Zs(),m=et(t),d=G(C=>C.dismissDefaultStopOffer),[u,N]=h.useState(null),[S,l]=h.useState(null),[j,k]=h.useState(null),[w,g]=h.useState(t);w!==t&&(g(t),N(null),l(null),k(null));const b=o==null?void 0:o.executionDefaults,D=n??(b==null?void 0:b.runtime),R=(Q=b==null?void 0:b.perRuntime.find(C=>C.runtime===D))==null?void 0:Q.trustStop,M=R??(b==null?void 0:b.trustStop)??null,U=(W=r.find(C=>C.id===i))==null?void 0:W.stop,A=M??U,E=R!=null?(y=st(a,D))==null?void 0:y.configSection:void 0,x=p.canRemember;h.useEffect(()=>{if(!u)return;const C=setTimeout(()=>N(null),nr);return()=>clearTimeout(C)},[u]);const B=h.useCallback(C=>{const _=r.find(L=>L.id===C);!_||tt(_)||!x||m||_.stop!==A&&(k(null),N(_.stop))},[r,x,m,A,N,k]),$=h.useCallback((C,_)=>{k(null),c.mutate({..._?{ui:{autonomyAcknowledgedAt:new Date().toISOString()}}:{},runtimes:E?{[E]:{defaultTrustStop:C}}:{defaultTrustStop:C}},{onSuccess:()=>{f.invalidateQueries({queryKey:F.all}),N(null)},onError:L=>k(rr(L))})},[c,f,E,N,k]),X=h.useCallback(()=>{var C;if(u){if(u==="autonomy"&&p.acknowledgedAt===null){const _=(C=is(r).find(L=>L.stop==="autonomy"))==null?void 0:C.mode;if(_){l(_);return}}$(u,!1)}},[u,p.acknowledgedAt,r,$,l]),le=h.useCallback(()=>{d(t),N(null)},[d,t,N]),ce=h.useCallback(()=>{l(null),$("autonomy",!0)},[$,l]),ue=h.useCallback(()=>{l(null),N(null)},[l,N]);return{line:x?{stop:u,onMakeDefault:X,onDismiss:le,pending:c.isPending,error:j}:null,offerFor:B,pendingDescriptor:S,confirm:ce,cancel:ue}}function bi({runtimeLabel:e,onShown:t,onDismiss:n}){const r=q(o=>o.available),i=q(o=>o.setOpen);return h.useEffect(()=>{t==null||t()},[t]),s.jsxs(nt,{"data-slot":"read-only-mode-notice","data-testid":"read-only-mode-notice",gap:"none",className:"flex-row flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",children:[s.jsx(rt,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:["In this mode, ",e," reads files but won’t change them. Asking won’t help."]}),s.jsxs("div",{className:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1.5 sm:w-auto",children:[s.jsx(H,{variant:"ghost",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:n,children:"Dismiss"}),r&&s.jsx(H,{variant:"outline",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:()=>i(!0),children:"Change permissions"})]})]})}function ki(e,t,n){const r=je(t??void 0),i=G(d=>d.recordReadOnlyHintShown),o=G(d=>d.spendReadOnlyHint),a=it(e??""),c=r==null?void 0:r.permissionModes.values.find(d=>d.id===n),f=c!==void 0&&at(c);h.useEffect(()=>{f||!e||a!=="shown"||o(e)},[f,e,a,o]);const p=h.useCallback(()=>{e&&i(e)},[e,i]),m=h.useCallback(()=>{e&&o(e)},[e,o]);return h.useMemo(()=>({eligible:!!e&&f&&a!=="spent",runtimeLabel:t?ot(t):"This agent",markShown:p,dismiss:m}),[e,f,a,t,p,m])}function vi({descriptor:e,active:t,onToggle:n,disabled:r}){return s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:s.jsxs("button",{type:"button","aria-pressed":t,disabled:r,onClick:()=>n(!t),className:T(K,"items-center gap-1","disabled:cursor-not-allowed disabled:opacity-40",t&&"text-foreground"),children:[s.jsx(os,{className:"size-(--size-icon-xs) shrink-0","aria-hidden":!0}),s.jsx("span",{className:"truncate",children:e.label})]})}),s.jsx(I,{side:"top",children:r?"Send a message first":e.promise})]})}function Si({runtime:e,model:t,onChangeRuntime:n,canSelect:r,compact:i,account:o}){const{data:a}=Ne(),{data:c}=lt(),{nameFor:f}=ct(),[p,m]=h.useState({open:!1}),d=Object.keys((a==null?void 0:a.capabilities)??{}),u=d.filter(g=>De(c,g)),N=d.filter(g=>!De(c,g)),S=a!==void 0&&Object.values(ut).some(g=>g.setup&&!d.includes(g.type)),l=!!n&&(d.length>1||N.length>0||S),j=i?null:t,k=s.jsx(Oe,{runtime:e,model:j,iconClassName:"size-(--size-icon-xs)"}),w=o?`Account: ${f(o)}`:null;return r?l?s.jsxs(s.Fragment,{children:[s.jsxs(dt,{children:[s.jsx(mt,{asChild:!0,children:s.jsx("button",{className:K,children:s.jsx(Oe,{runtime:e,model:j,iconClassName:"size-(--size-icon-xs)"})})}),s.jsxs(pt,{side:"top",align:"start",className:"w-56",children:[s.jsx(ft,{children:"Runs on"}),s.jsx(ht,{value:e,onValueChange:g=>n==null?void 0:n(g),children:u.map(g=>{const b=Ie(g);return s.jsx(xt,{value:g,icon:b.icon,children:b.label},g)})}),N.map(g=>{const b=Ie(g);return s.jsx(Pe,{icon:b.icon,description:"Connect",onSelect:()=>m({open:!0,runtime:g}),children:b.label},g)}),S&&s.jsxs(s.Fragment,{children:[s.jsx(gt,{}),s.jsx(Pe,{icon:Nt,onSelect:()=>m({open:!0}),children:"Add a runtime"})]})]})]}),s.jsx(jt,{runtime:p.runtime,open:p.open,onOpenChange:g=>m(b=>({...b,open:g})),renderConnect:yt,showConnectSuccess:!0,onRuntimeReady:g=>{n==null||n(g)}})]}):w?s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:k}),s.jsx(I,{side:"top",children:w})]}):k:s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:k}),s.jsxs(I,{side:"top",children:[s.jsx("span",{className:"block",children:"Set when the session starts. It can’t change after."}),w&&s.jsx("span",{className:"block",children:w})]})]})}function Ti(e,t,n){const r=ls(),i=bt(e),o=new Date(r),a=t.pending?null:t.usage;return{...kt({liveTurnUsage:n,liveTurnAt:i,accountStatus:vt(a,o),accountObservedAt:cs(us(a))}),accountUsage:a}}function Ci({open:e,onOpenChange:t,onConfirm:n}){return s.jsx(St,{open:e,onOpenChange:t,children:s.jsxs(Tt,{children:[s.jsxs(Ct,{children:[s.jsxs(wt,{className:"flex items-center gap-2",children:[s.jsx(as,{className:"text-muted-foreground size-4"}),"Turn on Auto mode?",s.jsx(re,{size:"xs",variant:"secondary",className:"tracking-wide uppercase",children:"Preview"})]}),s.jsx(Et,{children:"Asks only before risky steps, like deleting files. Switch back anytime."})]}),s.jsxs(Mt,{children:[s.jsx(Rt,{children:"Cancel"}),s.jsx(At,{onClick:n,children:"Turn on Auto mode"})]})]})})}const $e=[{slug:"frontier",label:"Frontier"},{slug:"solid-coders",label:"Solid coders"},{slug:"quick-helpers",label:"Quick helpers"},{slug:"more-models",label:"More models"},{slug:"no-tools",label:"Can’t do agent work"}],ir=10,ar="Can’t use tools, so it can’t read files or run commands.",or="Makes images DorkOS can’t show yet.",lr=["openrouter/openrouter/auto","openrouter/auto"];function cr(e){return lr.some(t=>e.value===t||e.value.startsWith(`${t}-`))}function ks(e){return e.supportsToolUse!==!1}function ur(e){return e.supportsImageOutput===!0&&!cr(e)?or:ks(e)?null:ar}function dr(e){if(!ks(e))return"no-tools";switch(e.tier){case"frontier":return"frontier";case"solid-coder":return"solid-coders";case"quick-helper":return"quick-helpers";default:return"more-models"}}function mr(e){return e.some(t=>t.tier!=null)||e.length>ir}function pr(e,t){const n=t.trim().toLowerCase();return n?e.value.toLowerCase().includes(n)||e.displayName.toLowerCase().includes(n):!0}function fr(e){const t=new Map($e.map(n=>[n.slug,[]]));for(const n of e)t.get(dr(n)).push(n);return $e.map(n=>({...n,models:t.get(n.slug)})).filter(n=>n.models.length>0)}function hr(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function xr(){return s.jsx("div",{className:"space-y-2","data-testid":"model-cards-skeleton",children:Array.from({length:3}).map((e,t)=>s.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-3",children:[s.jsx(J,{className:"size-4 rounded-full"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(J,{className:"h-3.5 w-24"}),s.jsx(J,{className:"h-2.5 w-32"})]}),s.jsx(J,{className:"h-5 w-10 rounded-md"})]},t))})}function gr({onRetry:e,message:t}){return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center","data-testid":"model-load-error",children:[s.jsx(ve,{className:"text-muted-foreground size-5"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t??"Couldn’t load the model list."}),s.jsxs("button",{onClick:e,className:"text-foreground hover:bg-accent inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",children:[s.jsx(ds,{className:"size-3"}),"Retry"]})]})}function Nr(e){const t=e.slice(e.lastIndexOf(" ")+1);return t.includes("/")||t.includes(":")}function vs({text:e,className:t}){return Nr(e)?s.jsx("div",{dir:"rtl",className:T("truncate text-left",t),title:e,children:s.jsx("bdi",{dir:"ltr",children:e})}):s.jsx("div",{className:T("truncate",t),title:e,children:e})}function Fe({model:e,isSelected:t}){const n=ur(e);return s.jsxs("label",{className:T("flex w-full cursor-pointer items-center gap-3 rounded-xl border p-3 transition-colors duration-150",t?"bg-secondary border-foreground/15":"border-border hover:border-muted-foreground/30 hover:bg-muted/50 opacity-70"),children:[s.jsx(Ot,{value:e.value,className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-foreground line-clamp-2 text-sm font-medium break-words",children:[e.displayName,e.local&&s.jsxs("span",{className:"text-muted-foreground text-3xs ml-1.5 font-normal",children:[Pt()," · private"]})]}),s.jsx(vs,{text:e.description,className:"text-muted-foreground text-2xs leading-tight"}),n&&s.jsx("div",{className:"text-2xs text-status-warning-fg mt-0.5 leading-tight","data-testid":`model-limitation-${e.value}`,children:n})]}),e.contextWindow&&s.jsx(re,{size:"xs",variant:"secondary",className:"shrink-0",children:hr(e.contextWindow)})]})}function jr({value:e}){return s.jsxs("div",{className:"space-y-1.5","data-testid":"model-unavailable-saved",children:[s.jsxs("div",{className:"border-border flex w-full items-center gap-3 rounded-xl border border-dashed p-3 opacity-80",children:[s.jsx(ve,{className:"text-status-warning-fg size-4 shrink-0"}),s.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[s.jsx(vs,{text:e,className:"text-foreground min-w-0 text-sm font-medium"}),s.jsx("span",{className:"text-muted-foreground text-2xs shrink-0 font-normal",children:"(not available)"})]})]}),s.jsx("p",{className:"text-muted-foreground text-2xs leading-snug",children:"This model isn’t available anymore. Pick another."})]})}function yr({slug:e,label:t}){return s.jsx("div",{className:"text-muted-foreground text-2xs mt-2 mb-1 font-medium tracking-wide uppercase first:mt-0","data-testid":`model-group-${e}`,children:t})}function br({models:e,selectedModel:t,onChangeModel:n,emptyMessage:r}){const[i,o]=h.useState(""),a=mr(e),f=e.length>0&&t.length>0&&!e.some(u=>u.value===t)?s.jsx(jr,{value:t}):null,p=e.some(u=>u.unverified),m=h.useMemo(()=>a?e.filter(u=>pr(u,i)):e,[e,i,a]),d=h.useMemo(()=>a?fr(m):[],[m,a]);return e.length===0?s.jsx("div",{className:"border-border text-muted-foreground text-2xs rounded-xl border border-dashed p-3 leading-snug","data-testid":"model-catalog-unavailable",children:r??"Couldn’t load models. Check Settings, then try again."}):a?s.jsxs("div",{className:"space-y-2",children:[f,p&&s.jsx(Ue,{}),s.jsxs("div",{className:"relative",children:[s.jsx(_t,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),s.jsx(Dt,{type:"text",value:i,onChange:u=>o(u.target.value),placeholder:"Search models…","aria-label":"Search models","data-testid":"model-search",className:"h-8 pl-8 text-xs"})]}),d.length===0?s.jsx("p",{className:"text-muted-foreground py-4 text-center text-xs","data-testid":"model-search-empty",children:p?"No match in this short list. Connect a provider to see more.":"No models match"}):s.jsx(Le,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:d.map(u=>s.jsxs(h.Fragment,{children:[s.jsx(yr,{slug:u.slug,label:u.label}),u.models.map(N=>s.jsx(Fe,{model:N,isSelected:N.value===t},N.value))]},u.slug))})]}):s.jsxs("div",{className:"space-y-2",children:[f,p&&s.jsx(Ue,{}),s.jsx(Le,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:e.map(u=>s.jsx(Fe,{model:u,isSelected:u.value===t},u.value))})]})}const fe={none:{label:"None",description:"No reasoning"},minimal:{label:"Minimal",description:"Near-zero thinking"},low:{label:"Low",description:"Fastest responses"},medium:{label:"Medium",description:"Moderate thinking"},high:{label:"High",description:"Deep reasoning"},max:{label:"Max",description:"Maximum thinking"},xhigh:{label:"XHigh",description:"Beyond maximum"}},kr={duration:.15,ease:"easeOut"};function vr({effortLevels:e,effort:t,onChangeEffort:n}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Effort"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Effort level",children:[s.jsx(he,{role:"radio",label:"Default",isSelected:t===null,onClick:()=>n(null)}),e.map(r=>s.jsx(he,{role:"radio",label:fe[r].label,description:fe[r].description,isSelected:t===r,onClick:()=>n(r)},r))]})]})}function Sr({supportsFastMode:e,fastMode:t,onChangeFastMode:n}){return e?s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Mode"}),s.jsx("div",{className:"flex gap-1.5",children:s.jsx(he,{role:"switch",label:"Fast",icon:s.jsx(Ee,{className:"size-3"}),isSelected:t,onClick:()=>n(!t)})})]}):null}function he({role:e,label:t,description:n,icon:r,isSelected:i,onClick:o}){const a=s.jsxs("button",{role:e,"aria-checked":i,onClick:o,className:T("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),children:[r,t]});return n?s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:a}),s.jsx(I,{side:"top",className:"text-xs",children:n})]}):a}function wi({model:e,onChangeModel:t,effort:n,onChangeEffort:r,fastMode:i,onChangeFastMode:o,disabled:a,sessionId:c,runtime:f,onCredits:p,compact:m}){var R;const{data:d,isLoading:u,isError:N,refetch:S}=ns({sessionId:c,runtime:f??void 0}),l=d??[],j=l.find(M=>M.value===e),k=!!(j!=null&&j.supportsEffort&&(((R=j.supportedEffortLevels)==null?void 0:R.length)??0)>0),w=(j==null?void 0:j.supportsFastMode)??!1,g=!m&&k&&n?fe[n].label:null,b=!m&&i,D=s.jsxs("button",{disabled:a,className:T(K,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40"),"data-testid":"model-config-trigger",children:[s.jsx(ms,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:Zn(e,l)}),g&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsx(re,{size:"xs",variant:"secondary",children:g})]}),b&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsxs(re,{size:"xs",variant:"secondary",children:[s.jsx(Ee,{className:"mr-0.5 inline size-2.5"}),"Fast"]})]})]});return a?s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:D})}),s.jsx(I,{side:"top",children:"Send a message first"})]}):s.jsxs(Se,{children:[s.jsx(Te,{asChild:!0,children:D}),s.jsxs(Ce,{side:"top",align:"start",className:"w-120 max-w-[calc(100vw-1.5rem)] p-3","data-testid":"model-config-popover",children:[s.jsx(we,{children:"Model"}),l.some(M=>M.paidFromCredits)&&s.jsx("p",{className:"text-muted-foreground text-2xs mb-2","data-testid":"model-credits-note",children:l.some(M=>M.creditsListOutOfDate)?"Models your DorkOS credits cover. This list may be out of date.":"Models your DorkOS credits cover"}),u&&s.jsx(xr,{}),N&&s.jsx(gr,{onRetry:()=>S(),message:p?"Couldn’t load the models DorkOS credits cover. Your model stays as it is.":void 0}),!u&&!N&&s.jsx(br,{models:l,selectedModel:e,onChangeModel:t,emptyMessage:p?"DorkOS credits don’t cover a model for this runtime yet.":void 0}),s.jsx(be,{children:!u&&!N&&(k||w)&&s.jsxs(ke.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:kr,children:[s.jsx(It,{className:"my-3"}),s.jsx("div",{className:"text-muted-foreground text-2xs mb-3 font-medium tracking-wide uppercase",children:"Configuration"}),s.jsxs("div",{className:"space-y-3",children:[k&&s.jsx(vr,{effortLevels:j.supportedEffortLevels,effort:n,onChangeEffort:r}),w&&s.jsx(Sr,{supportsFastMode:(j==null?void 0:j.supportsFastMode)??!1,fastMode:i,onChangeFastMode:o})]})]},"config")})]})]})}function Ei({percent:e,contextUsage:t,compact:n,reading:r,now:i}){const o=ps(e,t)??e,a=Ut(o),c=a==="critical"?ie.error:a==="warning"?ie.warning:"",f=n!=null&&o>=hs,p=t?{total:t.totalTokens,max:t.maxTokens}:r&&r.maxTokens>0?{total:r.totalTokens,max:r.maxTokens}:null,m=(r==null?void 0:r.observedAt)??null,d=p!==null,u=s.jsxs("span",{"aria-label":d?"Context window usage":void 0,className:T("inline-flex shrink-0 items-center gap-1",d&&"cursor-default",c),children:[s.jsx(Tn,{className:"size-(--size-icon-xs) shrink-0"}),s.jsxs("span",{children:[o,"%"]})]});return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[p?s.jsx(Tr,{totals:p,categories:(t==null?void 0:t.categories)??[],observedAt:m,now:i,children:u}):u,s.jsx(be,{initial:!1,children:f&&s.jsxs(ke.button,{type:"button",onClick:n.onCompact,disabled:n.pending,"aria-label":n.pending?"Compacting conversation…":`Context ${o}% full. Compact now`,"aria-busy":n.pending,"data-testid":"compaction-chip",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-60",children:[s.jsx(ds,{"aria-hidden":"true",className:T("size-(--size-icon-xs) shrink-0",n.pending&&"animate-spin")}),s.jsx("span",{className:"truncate",children:"Compact"})]},"compact")})]})}function Tr({totals:e,categories:t,observedAt:n,now:r,children:i}){const o=t.filter(a=>a.tokens>0).sort((a,c)=>c.tokens-a.tokens);return s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:i}),s.jsx(I,{side:"top",className:"max-w-64",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-xs font-medium",children:[de(e.total)," / ",de(e.max)," tokens"]}),o.length>0&&s.jsx("div",{className:"space-y-0.5",children:o.map(a=>s.jsxs("div",{className:"text-3xs flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate",children:[s.jsx("span",{className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:a.color}}),a.name]}),s.jsx("span",{className:T(pe,"shrink-0"),children:de(a.tokens)})]},a.name))}),n!==null&&s.jsx(fs,{observedAt:n,now:r,surface:"tooltip"})]})})]})}function Mi({usage:e,accountUsage:t=null,observedAt:n=null,open:r,onOpenChange:i,now:o}){const a=ls(),c=o??new Date(a),f=us(t),p=f.length>0?cs(f):n,m=e!=null&&xs(e);let d;return f.length>0?d=s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsx("div",{className:"flex flex-col gap-2.5",children:f.map(u=>s.jsx(Lt,{window:u,label:zt(u.key,u.label),now:c},u.key))}),e&&s.jsx("div",{className:"text-3xs space-y-0.5",children:s.jsx(Bt,{usage:e})})]}):m?d=s.jsx(Ht,{usage:e}):d=s.jsx("p",{className:"text-muted-foreground text-xs",children:"No usage yet."}),s.jsxs($t,{open:r,onOpenChange:i,children:[s.jsx(Ft,{asChild:!0,children:s.jsx("span",{"aria-hidden":!0,className:"inline-block h-0 w-0"})}),s.jsx(Gt,{side:"top",align:"end",className:"w-72 max-w-[calc(100vw-1.5rem)]","aria-label":"Usage and cost",children:s.jsxs("div",{className:"space-y-2",children:[d,p!==null&&(f.length>0||m)&&s.jsx(fs,{observedAt:p,now:c})]})})]})}const Cr={connecting:{color:Z.warning,label:"Connecting",shortLabel:"Connecting",icon:se,tasks:!0},connected:{color:Z.success,label:"Connected",shortLabel:"Connected",icon:se,tasks:!1},reconnecting:{color:Z.warning,label:"Reconnecting",shortLabel:"Reconnecting",icon:se,tasks:!0},disconnected:{color:Z.error,label:"Live updates lost",shortLabel:"Offline",icon:Qt,tasks:!1}};function Ri({connectionState:e,compact:t}){const n=Cr[e],r=n.icon;return s.jsxs(Cn,{openDelay:200,children:[s.jsx(wn,{asChild:!0,children:s.jsxs("span",{className:"flex min-w-0 cursor-default items-center gap-1.5 text-xs",children:[s.jsx("span",{className:T("size-1.5 shrink-0 rounded-full",n.color,n.tasks&&"animate-breath")}),s.jsx("span",{className:"text-muted-foreground truncate",children:t?n.shortLabel:n.label})]})}),s.jsx(En,{side:"top",align:"center",className:"w-72 p-3",children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx(r,{className:T("mt-0.5 size-4 shrink-0",e==="disconnected"?ie.error:ie.warning)}),s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsx("p",{className:"text-sm font-medium",children:n.label}),s.jsx(wr,{connectionState:e})]})]})})]})}function wr({connectionState:e}){const t="text-muted-foreground text-xs leading-relaxed";return e==="connecting"?s.jsx("p",{className:t,children:"Connecting to live updates. New messages appear once connected."}):e==="reconnecting"?s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Live updates dropped and are reconnecting. Nothing is lost."}),s.jsx("p",{className:T(t,"text-muted-foreground/70"),children:"No action needed."})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Couldn’t reconnect live updates. New messages won’t appear until they’re back."}),s.jsx("p",{className:T(t,"text-muted-foreground/70"),children:"Refresh the page. If that doesn’t help, check that DorkOS is running."})]})}function Ai({count:e,running:t,waiting:n}){const r=e===1?"":"s",i=e-t.length,o=`${e} subagent${r} running`;return s.jsxs(O,{children:[s.jsx(P,{asChild:!0,children:s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1","aria-label":o,children:[s.jsx(gs,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"shrink-0 tabular-nums",children:e})]})}),s.jsxs(I,{side:"top",className:"max-w-64",children:[n&&s.jsx("p",{className:"mb-1 font-medium",children:"Still working. The agent continues when they finish."}),s.jsx("ul",{className:"space-y-1",children:t.map(a=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:a.description??"Working…"}),s.jsxs("p",{className:T(pe,"text-3xs leading-tight"),children:[a.toolUses??0," tool",a.toolUses===1?"":"s",a.lastToolName?` · last ${a.lastToolName}`:""]})]},a.taskId))}),i>0&&s.jsx("p",{className:T(pe,"text-3xs leading-tight"),children:t.length>0?`and ${i} more`:`${i} task${r} from earlier`})]})]})}const Er=new Set(["main","master"]);function _i(e,t,n){return{dirty:!t,onDefaultBranch:!n&&Er.has(e)}}const v={AGENT_ANCHOR:1e3,CONNECTION_LOST:100,CONTEXT_CRITICAL:90,ACCOUNT_ATTENTION:85,USAGE_EXHAUSTED:80,PERMISSION_BYPASS:70,CONTEXT_WARNING:50,USAGE_WARNING:50,PERMISSION_ELEVATED:40,PLAN_ACTIVE:40,SUBAGENTS_RUNNING:35,EXTENSION_ITEM:35,RUNTIME_NON_DEFAULT:30,GIT_DIRTY:20,MODEL:10,CWD:5,QUIET:0},Mr={session:"Session",diagnostics:"Diagnostics"};function Ge(e){return e.runtime&&!e.runtime.isDefault?v.RUNTIME_NON_DEFAULT:v.QUIET}function Rr(e){return e.account!==null}const Ar=new Set(["near","model-out","out"]);function He(e){return e.permissionDescriptor?e.permissionDescriptor.stop!=="ask":e.permissionMode!=="default"}const Ss=[{key:"agent",label:"Agent",description:"Who you are talking to",cluster:"left",group:null,icon:qt,promote:()=>!0,severity:()=>v.AGENT_ANCHOR},{key:"cwd",label:"Directory",description:"The folder this session can touch",cluster:"left",group:"session",icon:Kt,promote:e=>e.cwd!==null,severity:()=>v.CWD},{key:"git",label:"Git",description:"Branch and uncommitted changes",cluster:"left",group:"session",icon:ee,promote:e=>e.git!==null&&(e.git.dirty||!e.git.onDefaultBranch),severity:e=>{var t;return(t=e.git)!=null&&t.dirty?v.GIT_DIRTY:v.QUIET}},{key:"runtime",label:"Runs on",description:"What runs this session",cluster:"right",group:"session",icon:Vt,promote:e=>e.runtime!==null&&(!e.runtime.isDefault||e.runtime.canSelect),severity:Ge},{key:"account",label:"Account",description:"Which Claude account this uses, and what’s left",cluster:"right",group:null,icon:Xt,promote:e=>e.account!==null,severity:e=>e.account&&Ar.has(e.account.chipState)?v.ACCOUNT_ATTENTION:Ge(e)},{key:"extensions",label:"Add-ons",description:"What your extensions show here",cluster:"right",group:null,icon:Yt,promote:e=>e.extensionItems.some(t=>t.visible),severity:e=>e.extensionItems.some(t=>t.visible&&t.urgent)?v.ACCOUNT_ATTENTION:v.EXTENSION_ITEM},{key:"model",label:"Model",description:"The model answering you",cluster:"right",group:"session",icon:ms,promote:()=>!0,severity:()=>v.MODEL},{key:"cache",label:"Cache",description:"How much came from cache",cluster:"right",group:"session",icon:Ee,promote:()=>!1,severity:()=>v.QUIET,neverInLine:!0},{key:"context",label:"Context",description:"How full the conversation window is",cluster:"right",group:"session",icon:Mn,rigid:!0,promote:e=>e.contextPercent!==null,severity:e=>e.contextPercent===null?v.QUIET:e.contextPercent>=hs?v.CONTEXT_CRITICAL:e.contextPercent>=en?v.CONTEXT_WARNING:v.QUIET},{key:"usage",label:"Usage & cost",description:"Plan limits or session cost",cluster:"right",group:"session",icon:Jt,rigid:!0,promote:e=>e.usage!==null&&xs(e.usage)&&!Rr(e),wide:e=>e.usageStale,severity:e=>{var t,n;return((t=e.usage)==null?void 0:t.state)==="exhausted"?v.USAGE_EXHAUSTED:((n=e.usage)==null?void 0:n.state)==="warning"?v.USAGE_WARNING:v.QUIET}},{key:"permission",label:"Permissions",description:"How freely the agent acts",cluster:"right",group:"session",icon:Zt,promote:e=>He(e),severity:e=>(e.permissionDescriptor?sn(e.permissionDescriptor):tn(e.permissionMode))?v.PERMISSION_BYPASS:He(e)?v.PERMISSION_ELEVATED:v.QUIET},{key:"plan",label:"Plan",description:"Plan first, change nothing until approved",cluster:"right",group:"session",icon:os,promote:e=>e.plan!==null,severity:e=>{var t;return(t=e.plan)!=null&&t.active?v.PLAN_ACTIVE:v.QUIET}},{key:"subagents",label:"Subagents",description:"Subagents working on this turn",cluster:"right",group:"diagnostics",icon:gs,rigid:!0,promote:e=>e.subagentsInFlight>0,severity:e=>e.subagentsInFlight>0?v.SUBAGENTS_RUNNING:v.QUIET},{key:"connection",label:"Live updates",description:"The live link that delivers messages",cluster:"right",group:"diagnostics",icon:se,promote:e=>e.connectionState!=="connected",severity:e=>e.connectionState==="connected"?v.QUIET:v.CONNECTION_LOST}];function Ts(e){return e.group==="session"&&e.neverInLine!==!0}function _r(){const{pins:e}=Dn(),{setPins:t}=On(),n=h.useCallback(i=>{const o=Wt.find(a=>a===i);o&&t(e.includes(o)?e.filter(a=>a!==o):[...e,o])},[e,t]),r=h.useCallback(()=>t([]),[t]);return{pins:e,toggle:n,reset:r}}function Dr(){return["session","diagnostics"].map(t=>({group:t,label:Mr[t],items:Ss.filter(n=>n.group===t)})).filter(t=>t.items.length>0)}function Cs(e){const t=e.contextTokens??e.readTokens+e.creationTokens;return t<=0?0:Math.round(e.readTokens/t*100)}function Or(e){return e?e.kind==="subscription"&&e.utilization!=null?`${Math.round(e.utilization*100)}% of ${e.windowLabel??"your plan"}`:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:null:null}function Pr(e){return e.split("/").filter(Boolean).pop()??e}function Ir(e,t){switch(e){case"cwd":return t.cwd?Pr(t.cwd):null;case"git":return t.git.state==="unknown"?null:t.git.state==="no-repo"?"No repo":t.git.dirty?`${t.git.branch} · changed`:t.git.branch;case"runtime":return t.runtime;case"model":return t.model;case"context":return t.contextPercent===null?null:`${t.contextPercent}% full`;case"cache":return t.cache===null?null:`${Cs(t.cache)}% from cache`;case"usage":return Or(t.usage);case"permission":return t.permissionMode;case"connection":return`${t.connectionState} · event ${t.lastEventSeq}`;default:return null}}function Ur(e){return JSON.stringify({sessionId:e.sessionId,cwd:e.cwd,git:e.git,runtime:e.runtime,model:e.model,selectedModel:e.selectedModel,effort:e.effort,fastMode:e.fastMode,permissionMode:e.permissionMode,contextPercent:e.contextPercent,contextUsage:e.contextUsage,cache:e.cache===null?null:{readTokens:e.cache.readTokens,creationTokens:e.cache.creationTokens,contextTokens:e.cache.contextTokens??null,hitPercent:Cs(e.cache)},usage:e.usage,connectionState:e.connectionState,streaming:e.streaming,lifecycle:e.lifecycle,triggerPending:e.triggerPending,lastEventSeq:e.lastEventSeq,snapshotCursor:e.snapshotCursor,lastEventAt:e.lastEventAt===null?null:new Date(e.lastEventAt).toISOString(),queueDepth:e.queueDepth,subagents:e.subagents.map(t=>t.name),activeSubagents:e.activeSubagents,runningSubagentCount:e.runningSubagentCount,clientVersion:e.clientVersion,capturedAt:new Date().toISOString()},null,2)}function Lr({copied:e,failed:t}){return e?s.jsx(rn,{className:"text-status-success size-3.5","aria-hidden":!0}):t?s.jsx(an,{className:"text-destructive size-3.5","aria-hidden":!0}):s.jsx(Rn,{className:"size-3.5","aria-hidden":!0})}function zr(e,t){return e?"Copied":t?"Couldn’t copy":"Copy diagnostics"}function Br({diagnostics:e,className:t}){const{copied:n,failed:r,copy:i}=nn(),o=()=>void i(Ur(e));return s.jsxs(H,{variant:"ghost",size:"sm",className:T("gap-1.5 text-xs",t),onClick:o,children:[s.jsx(Lr,{copied:n,failed:r}),zr(n,r)]})}function Di({open:e,onOpenChange:t,diagnostics:n,controls:r,promotionContext:i,urgentAction:o,overflowCount:a=0,addOns:c}){const f=on(),{pins:p,toggle:m,reset:d}=_r(),u=Dr(),N=new Set(p),S=a>0;return s.jsxs(Se,{open:e,onOpenChange:t,children:[s.jsx(ln,{children:s.jsxs(O,{children:[s.jsx(Te,{asChild:!0,children:s.jsx(P,{asChild:!0,children:s.jsxs("button",{type:"button","data-testid":"status-reveal","aria-label":S?`Session details, ${a} more`:"Session details",className:"text-muted-foreground/50 hover:text-muted-foreground inline-flex shrink-0 items-center justify-center gap-0.5 transition-colors duration-150 pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:[s.jsx(cn,{className:"size-4"}),S&&s.jsxs("span",{className:"tabular-nums",children:["+",a]})]})})}),s.jsx(I,{side:"top",children:S?`Session details, ${a} more`:"Session details"})]})}),s.jsxs(Ce,{side:"top",align:"end",className:"w-80 p-3","aria-label":"Session",children:[s.jsx(we,{children:"Session"}),o&&s.jsx(H,{variant:"secondary",className:"mb-3 w-full",disabled:o.pending,onClick:()=>{o.onAction(),t(!1)},children:o.label}),s.jsxs("div",{className:"flex flex-col gap-4",children:[c&&s.jsxs("section",{className:"space-y-1","data-testid":"session-add-ons",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:"Add-ons"}),c]}),u.map(l=>s.jsxs("section",{className:"space-y-1",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:l.label}),$r(Fr(l.items,r),f?i:null).map(j=>s.jsx(Hr,{item:j,value:Ir(j.key,n),pinned:N.has(j.key),onTogglePin:Ts(j)?()=>m(j.key):null,control:Gr(j.key,r)},j.key)),l.group==="diagnostics"&&s.jsxs(s.Fragment,{children:[s.jsx(Qe,{label:"Queued messages",value:String(n.queueDepth)}),s.jsx(Qe,{label:"Session ID",value:n.sessionId||"—"})]})]},l.group))]}),n.sessionId!==""&&s.jsxs(H,{variant:"ghost",size:"sm",className:"text-muted-foreground mt-3 h-7 w-full justify-start gap-1.5 text-xs",onClick:()=>{t(!1),dn({sessionId:n.sessionId})},children:[s.jsx(un,{className:"size-3.5","aria-hidden":!0}),"View notifications"]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[s.jsx(Br,{diagnostics:n}),s.jsxs(H,{variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 text-xs",disabled:p.length===0,onClick:d,children:[s.jsx(mn,{className:"size-3.5","aria-hidden":!0}),"Reset pins"]})]})]})]})}function $r(e,t){return t?[...e].sort((n,r)=>r.severity(t)-n.severity(t)):e}function Fr(e,t){return e.filter(n=>n.key!=="plan"||t.plan!==null)}function Gr(e,t){return e==="plan"&&t.plan?s.jsx(fn,{checked:t.plan.active,onCheckedChange:t.plan.onToggle,"aria-label":"Plan first, change nothing until approved"}):null}function Hr({item:e,value:t,pinned:n,onTogglePin:r,control:i}){const o=e.icon;return s.jsxs("div",{"data-testid":`session-row-${e.key}`,className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx(o,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t??void 0,children:t??"—"}),i,r&&s.jsx("button",{type:"button",onClick:r,"aria-pressed":n,"aria-label":n?`Stop keeping ${e.label} in the status bar`:`Keep ${e.label} in the status bar`,className:T("hover:text-foreground inline-flex size-6 shrink-0 items-center justify-center rounded-md transition-colors duration-150",n?"text-foreground":"text-muted-foreground/50"),children:n?s.jsx(rs,{className:"size-3.5"}):s.jsx(pn,{className:"size-3.5"})})]})}function Qe({label:e,value:t}){return s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx("span",{className:"w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t,children:t})]})}function Oi(e){const t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]),h.useEffect(()=>{const n=r=>{const i=r.key==="."||r.key===">";(r.metaKey||r.ctrlKey)&&r.shiftKey&&i&&(r.preventDefault(),t.current())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[])}function Qr(e){const t=new Map;for(const r of e){if(r.type!=="subagent_update")continue;const i=t.get(r.taskId);t.set(r.taskId,{taskId:r.taskId,status:r.status,description:r.description??(i==null?void 0:i.description),toolUses:r.toolUses??(i==null?void 0:i.toolUses),lastToolName:r.lastToolName??(i==null?void 0:i.lastToolName),summary:r.summary??(i==null?void 0:i.summary),ambient:r.ambient??(i==null?void 0:i.ambient)})}const n=[];for(const{ambient:r,...i}of t.values())An({ambient:r,status:i.status})||n.push(i);return n}function Pi(e){const t=[],n=[];for(const r of e)r.status==="running"?t.push(r):n.push(r);return{running:t,finished:n}}const We=new WeakMap;function qe(e,t,n){let r=We.get(e);r||(r=new Set,We.set(e,r)),!r.has(t)&&(r.add(t),n())}function Ke(e,t,n){let r;try{r=n()}catch(i){return qe(e,`${t}:throw`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}" threw in ${t}(); it is hidden until it stops throwing.`,i)),!1}return typeof r!="boolean"?(qe(e,`${t}:type`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}": ${t}() must return true or false, synchronously, reading only its ctx; it returned ${Wr(r)}, read as false.`)),!1):r}function Wr(e){return e instanceof Promise?"a Promise":e===null?"null":typeof e=="object"?"an object":`a ${typeof e}`}function qr(e,t){const n=[],r=[];for(const i of e){const o=i.when?Ke(i,"when",()=>i.when(t)):!0,a=o&&i.urgent?Ke(i,"urgent",()=>i.urgent(t)):!1;n.push({id:i.id,visible:o,urgent:a}),o&&r.push(i)}return r.sort((i,o)=>(i.priority??0)-(o.priority??0)),{promotion:n,visible:r}}function Ii(e){const t=hn("status-bar");return h.useMemo(()=>qr(t,e),[t,e])}function Kr(e){return e!=null&&e!==!1}function Ui({ctx:e,pins:t,nodes:n}){var o;const r=new Set(t),i=[];for(const a of Ss){if(a.neverInLine)continue;const c=n[a.key];if(!Kr(c))continue;const f=r.has(a.key)&&Ts(a);!f&&!a.promote(e)||i.push({key:a.key,cluster:a.cluster,severity:a.severity(e),pinned:f,rigid:a.rigid===!0,wide:((o=a.wide)==null?void 0:o.call(a,e))===!0,node:c})}return i}const Ve=648,Vr=440,Xr=340,Yr=3,Jr=3,Zr=2,ei=4,si=8,ti=20,ni=me*si+ti,ri=Number.POSITIVE_INFINITY,Xe=[],ii=["cwd"],Ye=["cwd","git"];function ai(e){if(e===null||e<=0)return{density:"full",rightBudget:ri,dropped:Xe};if(e>=Ve){const t=Math.floor((e-Ve)/ni);return{density:"full",rightBudget:ei+t,dropped:Xe}}return e>=Vr?{density:"compact",rightBudget:Yr,dropped:ii}:e>=Xr?{density:"identity",rightBudget:Jr,dropped:Ye}:{density:"avatar",rightBudget:Zr,dropped:Ye}}function oi(e,t){return t.severity!==e.severity?t.severity-e.severity:Number(t.pinned)-Number(e.pinned)}const li=2,ci=2;function Li(e,t){const n=new Set(t.dropped),r=e.filter(c=>c.cluster==="right"),i=new Set;let o=0,a=0;for(const c of[...r].sort(oi)){if(a>=t.rightBudget)break;c.rigid&&o>=li||(c.rigid&&(o+=1),i.add(c.key),a+=c.wide?Math.min(ci,t.rightBudget-a):1)}return{items:e.filter(c=>c.cluster==="right"?i.has(c.key):!n.has(c.key)),overflow:r.length-i.size}}function zi(){const e=h.useRef(null),[t,n]=h.useState(null);h.useLayoutEffect(()=>{const i=e.current;if(!i)return;n(i.getBoundingClientRect().width);const o=new ResizeObserver(a=>{var p,m;const c=a.at(0);if(!c)return;const f=((m=(p=c.contentBoxSize)==null?void 0:p.at(0))==null?void 0:m.inlineSize)??c.contentRect.width;n(f)});return o.observe(i),()=>o.disconnect()},[]);const r=h.useMemo(()=>ai(t),[t]);return{ref:e,budget:r}}const ui=[];function Bi(e){const t=xn(e),n=h.useMemo(()=>In(t),[t]),r=Un(e)==="streaming",i=G(h.useCallback(E=>{var x;return((x=E.sessions[e])==null?void 0:x.sessionStatus)??null},[e])),o=gn(e),a=Bn(e||null,i,r,o.runtime),c=G(h.useCallback(E=>{var x;return((x=E.sessions[e])==null?void 0:x.contextUsage)??null},[e])),f=G(Nn(E=>{var B;const x=(B=E.sessions[e])==null?void 0:B.sessionStatus;return!(x!=null&&x.cacheReadTokens)&&!(x!=null&&x.cacheCreationTokens)?null:{cacheReadTokens:x.cacheReadTokens??0,cacheCreationTokens:x.cacheCreationTokens??0,contextTokens:x.contextTokens}})),p=n.cacheStatus??f,{data:m}=Vn(a.cwd),{data:d}=$n(e),{data:u}=oe(),N=jn(e),S=Ze(e),l=yn(e),j=bn(e),k=kn(e),w=es(e),g=vn(e).length,b=Sn(e),D=h.useMemo(()=>{let E=null;return()=>E??(E=Qr(b))},[b]),R=(t==null?void 0:t.runningSubagentCount)??null,M=h.useMemo(()=>Yn(m),[m]),U=ps(n.contextPercent??a.contextPercent,c),A=(o.model??n.model??a.model)||null;return h.useMemo(()=>({sessionId:e,cwd:a.cwd,git:M,runtime:o.runtime,model:A,selectedModel:a.model||null,effort:a.effort??null,fastMode:a.fastMode,permissionMode:a.permissionMode,contextPercent:U,contextUsage:c,cache:p?{readTokens:p.cacheReadTokens,creationTokens:p.cacheCreationTokens,contextTokens:p.contextTokens}:null,usage:n.usage,connectionState:N,streaming:r,lifecycle:S??null,triggerPending:w,lastEventSeq:l,snapshotCursor:k,lastEventAt:j,queueDepth:g,subagents:d??ui,get activeSubagents(){return D()},runningSubagentCount:R,clientVersion:(u==null?void 0:u.version)??null}),[e,a.cwd,a.model,a.effort,a.fastMode,a.permissionMode,M,o.runtime,A,U,c,p,n,N,S,r,w,l,k,j,g,d,D,R,u==null?void 0:u.version])}export{Ci as A,zi as B,Br as C,Ti as D,fi as E,Bn as F,Ni as G,zn as H,hi as I,An as J,sr as M,ji as P,bi as R,Di as S,Mi as U,Cr as a,Ri as b,Cs as c,Ei as d,gi as e,wi as f,vi as g,Si as h,xi as i,Ai as j,Li as k,qr as l,Ur as m,_i as n,Xn as o,Pi as p,Rr as q,ai as r,Ui as s,Ii as t,Bi as u,Vn as v,yi as w,ki as x,Oi as y,_r as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as a,ad as l,R as s,ah as c,U as r,a7 as d}from"./index-DMYBI16t.js";const u=["relay","unclaimed-chats"];function m(e){return[...u,e]}function h(e="pending",t=!0){const n=a();return l({queryKey:m(e),queryFn:()=>n.listUnclaimedChats(e),enabled:t})}function y(){const e=s(),t=()=>{e.invalidateQueries({queryKey:[...u]})};c("relay_chat_unclaimed",t),c("relay_chat_unclaimed_burst",t)}function i(e){e.invalidateQueries({queryKey:[...u]})}function U(){const e=a(),t=s();return r({mutationFn:({id:n,input:o})=>e.claimUnclaimedChat(n,o),meta:{suppressErrorToast:!0},onSuccess:()=>{i(t),t.invalidateQueries({queryKey:[...d]})}})}function p(){const e=a(),t=s();return r({mutationFn:n=>e.ignoreUnclaimedChat(n),meta:{errorLabel:"Couldn’t ignore this chat"},onSuccess:()=>i(t)})}function v(){const e=a(),t=s();return r({mutationFn:n=>e.blockUnclaimedChat(n),meta:{errorLabel:"Couldn’t block this chat"},onSuccess:()=>i(t)})}function q(){const e=a(),t=s();return r({mutationFn:n=>e.leaveUnclaimedChat(n),meta:{errorLabel:"Couldn’t leave this chat"},onSuccess:()=>i(t)})}export{u as U,y as a,U as b,p as c,v as d,q as e,h as u};
|