dorkos 0.128.0 → 0.129.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/dist/bin/cli.js +84 -16
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-CmQERFxo.js → AboutPage-CML_SdU1.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-Dw231W2w.js → ActivityErrorState-TuQRJopr.js} +1 -1
- package/dist/client/assets/{ActivityPage-DVfeyA9u.js → ActivityPage-CmSxeVSK.js} +1 -1
- package/dist/client/assets/ActivityRow-DJhDehIR.js +1 -0
- package/dist/client/assets/{AdapterIcon-NqCDzgCI.js → AdapterIcon-CeRDpZGz.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-B6KkTuJo.js +2 -0
- package/dist/client/assets/{AgentOptionRow-BRJfZo2y.js → AgentOptionRow-388OJkPc.js} +1 -1
- package/dist/client/assets/{AgentPicker-B7upjYRk.js → AgentPicker-C51wqToQ.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-DXJnLk6q.js → AgentRequestCard-Bz31ewIs.js} +4 -4
- package/dist/client/assets/AppearancePage-DSVeowGb.js +1 -0
- package/dist/client/assets/{ApplyToOverridesDialog-C_QQhNIf.js → ApplyToOverridesDialog-DRtcLrVY.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-CqKZyoxB.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-G7vrCqeA.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-DA1jhqFy.js} +3 -3
- package/dist/client/assets/BindingDialog-D25PAed0.js +1 -0
- package/dist/client/assets/{BlintzCanvas-DruVZcDU.js → BlintzCanvas-BgIQdpTx.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-CtLpZnTs.js → CanvasCsvContent-ZWHWmb88.js} +4 -4
- package/dist/client/assets/CanvasFileContent-DR5pUgca.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-OP1ZOMui.js +2 -0
- package/dist/client/assets/ChannelComposer-BJ0nNzQb.js +45 -0
- package/dist/client/assets/{ChatAppsOff-CCZUzDIH.js → ChatAppsOff-ByitL4Xt.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-BCpYdhgZ.js → CodeMirrorDiff-JsV_vWBa.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BeCubxHV.js → CodeMirrorEditor-BfCJG9hQ.js} +1 -1
- package/dist/client/assets/{CommitmentList-BZtfTnwg.js → CommitmentList-yFV3_m00.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-DmurDgxV.js → CommitmentsPage-DeERVg-2.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Bik6GLKp.js → ComputerResourceView-CYMMSE8Y.js} +1 -1
- package/dist/client/assets/{ComputerViewer-CksBDqdu.js → ComputerViewer-H7kJSIj7.js} +1 -1
- package/dist/client/assets/ConnectionAccessLists-SRkf7-Y6.js +1 -0
- package/dist/client/assets/{ConnectionsPage-Cgg36gDY.js → ConnectionsPage-D6e3hd4L.js} +2 -2
- package/dist/client/assets/{ConventionPage-CNhpF6Z1.js → ConventionPage-CpvRMcSG.js} +2 -2
- package/dist/client/assets/{ExtensionPageRoute-C2zue_Pw.js → ExtensionPageRoute-CiFv6we8.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-3v1TfY1P.js → FloatingTanStackRouterDevtools-CqogiFob-D-8CeYC7.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-Mbo0D-zk.js → ForwardConsentHost-ml3b_fsX.js} +1 -1
- package/dist/client/assets/HandlePage-Bq5qdCfY.js +1 -0
- package/dist/client/assets/HeartbeatPage-C0zSvWH4.js +1 -0
- package/dist/client/assets/{KeyEntry-C43vkwpA.js → KeyEntry-Dq6eKAbX.js} +1 -1
- package/dist/client/assets/{LexicalField-iAHcvRmI.js → LexicalField-CYOqOLpV.js} +1 -1
- package/dist/client/assets/{ManagesPage-BUIJvLmv.js → ManagesPage-DZTMD3Al.js} +1 -1
- package/dist/client/assets/Marketplace-buSfuVrY.js +36 -0
- package/dist/client/assets/{MarketplaceSourcesView-BZODwhxu.js → MarketplaceSourcesView-BxwvBWgh.js} +1 -1
- package/dist/client/assets/{McpAppFrame-D15nxVaI.js → McpAppFrame-CWiRFp8o.js} +2 -2
- package/dist/client/assets/{McpSigninBody-DmBxqgxN.js → McpSigninBody-BpYSAV1h.js} +1 -1
- package/dist/client/assets/{Model3dViewer-RGXeJd6a.js → Model3dViewer-B2KTvx6d.js} +1 -1
- package/dist/client/assets/NamePage-_yT2RQvT.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-DBAdvv5p.js → NewDirectMessageMenu-CMp4ppiH.js} +1 -1
- package/dist/client/assets/{NotificationsPage-NRfyiinS.js → NotificationsPage-CWXIghVM.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-CgQ6uefo.js → OpenMeshSwitch-C9hiAEHP.js} +2 -2
- package/dist/client/assets/OperatorIdentityForm-CjmMoP6n.js +1 -0
- package/dist/client/assets/{PermissionHistory-DPEPq8D9.js → PermissionHistory-D_Imuq02.js} +1 -1
- package/dist/client/assets/{PermissionsPage--k-xutbJ.js → PermissionsPage-QMLV8PfB.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DMMptmPS.js → PersonalityPopover-BL9DLK0Q.js} +1 -1
- package/dist/client/assets/PhotoPage-Djh4IZBF.js +1 -0
- package/dist/client/assets/PreviewRefusedNotice-Dt2hV0aJ.js +1 -0
- package/dist/client/assets/{ProfileFields-DbPJ7fvN.js → ProfileFields-DD6X85w2.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-CzwhrIlw.js → ProfilePanelContainer-DuFEpNJ3.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-CZEXvlJm.js → ProfileRolePicker-CT9eJ1J0.js} +1 -1
- package/dist/client/assets/PromptSuggestionChips-C8V611-5.js +1 -0
- package/dist/client/assets/{ReportsToPopover-YOwGLJy5.js → ReportsToPopover-Bs55bP7b.js} +1 -1
- package/dist/client/assets/RoomSurface-DXZ36tmU.js +1 -0
- package/dist/client/assets/{RoomsPage-CoXjZMWL.js → RoomsPage-CDiSwt-I.js} +1 -1
- package/dist/client/assets/RunsOnPopover-CFBDa9DO.js +1 -0
- package/dist/client/assets/RuntimeConnectFlow-DsawxJN7.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-bdf844gx.js +1 -0
- package/dist/client/assets/{SeenDevices-Bh2yh-PW.js → SeenDevices-Cix5nnGQ.js} +2 -2
- package/dist/client/assets/{SessionsPage-CFvkbT9X.js → SessionsPage-CCu8rM-J.js} +1 -1
- package/dist/client/assets/SettingsDialog-D7sVluoe.js +12 -0
- package/dist/client/assets/SkillsPage-SSq7ofgp.js +1 -0
- package/dist/client/assets/TaskDialogWrapper-CBIuIbmj.js +1 -0
- package/dist/client/assets/TasksEmptyState-C0K_NOA3.js +3 -0
- package/dist/client/assets/{TasksPage-D0Zi6Mve.js → TasksPage-BpSn7GmR.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CY9eLVad.js → TeamComputerEntry-BAi9omUC.js} +1 -1
- package/dist/client/assets/{ToolsPage-0_vx5P-F.js → ToolsPage-nkGWy6MR.js} +2 -2
- package/dist/client/assets/{TopologyGraph-DUZLZZrB.js → TopologyGraph-D6SSv0kC.js} +14 -14
- package/dist/client/assets/TourHost-CrZciWIf.js +1 -0
- package/dist/client/assets/{UnlinkDialog-ptZy3IN4.js → UnlinkDialog-B9zw8r6F.js} +1 -1
- package/dist/client/assets/{UnreadDivider-Ckey1IWn.js → UnreadDivider-BnJ06LmP.js} +1 -1
- package/dist/client/assets/WidgetErrorCard-CQKYI7oK.js +108 -0
- package/dist/client/assets/{WithheldExtensionsNotice-7Vu1Jctn.js → WithheldExtensionsNotice-VMM5NjL5.js} +1 -1
- package/dist/client/assets/WorkView-D5d8DDxS.js +51 -0
- package/dist/client/assets/_shell-CTKp94uQ.js +80 -0
- package/dist/client/assets/{_shell._home-BRIXhYLg.js → _shell._home-CcfELPIk.js} +1 -1
- package/dist/client/assets/_shell._home.activity-CGKsuLq8.js +1 -0
- package/dist/client/assets/_shell._home.index-DrJRgJCb.js +3 -0
- package/dist/client/assets/_shell._home.tasks-B_lv_-fX.js +1 -0
- package/dist/client/assets/_shell._home.workspaces-CjBJymCW.js +1 -0
- package/dist/client/assets/{_shell.channels-Bx6q9xVH.js → _shell.channels-CzQFR6pU.js} +4 -4
- package/dist/client/assets/_shell.connections-B5hafeep.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-DFznTGbN.js → _shell.feedback-requests-DtD2bH-4.js} +2 -2
- package/dist/client/assets/_shell.marketplace-DUpaCb0r.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-C3pA7zZW.js +1 -0
- package/dist/client/assets/_shell.session-DH_9f3AK.js +1 -0
- package/dist/client/assets/{_shell.team-DmA09abY.js → _shell.team-BrGo-IxK.js} +6 -6
- package/dist/client/assets/_shell.threads-Ceq_tmNk.js +1 -0
- package/dist/client/assets/_shell.x._extensionId-DaXLhYNr.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DaXLhYNr.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-DxgtVd9I.js → abnfDiagram-WEYOIA3C-BN5bqwbu.js} +1 -1
- package/dist/client/assets/{access-copy-Dqct36mi.js → access-copy-BAhTOOsG.js} +1 -1
- package/dist/client/assets/{arc-C-67Ef0p.js → arc-BfTE_VoF.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-B7TjdT-_.js → architectureDiagram-ZHVYKT53-Dc6keeDz.js} +1 -1
- package/dist/client/assets/{banner-C9qTs6-C.js → banner-DOgGDCJ5.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DNqxJ3Ww.js → blockDiagram-RJAE7QA3-B4c6U-ob.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-D3jNLV0j.js → c4Diagram-XDPPPE54-CCtD8QC8.js} +1 -1
- package/dist/client/assets/channel-CF9_Q7CV.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-C6OKx0ty.js → chunk-2E7WHVMD-DcDNqIJG.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-Dr_6hHrZ.js → chunk-2Q5K7J3B-DOVVK0B8.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-CSrZVDEt.js → chunk-4EMNKR2T-Cg-Do982.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-CIazeRXO.js → chunk-55XCU76K-CDmULSeY.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-C8IJ3zTR.js → chunk-5VM5RSS4-Bi0yIWW1.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-D9DGXb79.js → chunk-JWPE2WC7-ZHaJh6CV.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-B0LNYdif.js → chunk-VQ5W62QI-DZi6GyW_.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-C7IAIbvZ.js → chunk-XXDRQBXY-D18oZOrd.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-C79hvjlu.js → chunk-ZCHMQSOR-BkZ0l0fE.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-0Di1C2ZB.js → classDiagram-v2-4MYWR3UA-BfmK1buF.js} +1 -1
- package/dist/client/assets/{command-BVQb6I3_.js → command-CZqA020F.js} +1 -1
- package/dist/client/assets/copy-button-ByA00JGh.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-rZumaV4b.js → cose-bilkent-JH36ORCC-B1NTVSbk.js} +1 -1
- package/dist/client/assets/{cpu-DeRuDMl4.js → cpu-DNvpMmNN.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-CI9l9xhM.js → cynefin-EF2NZ3EQ-CB_HMIZ8.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-C8CdorJJ.js → cynefinDiagram-WF24UDRP-MmIWYdc2.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-AHpsTq1O.js → dagre-NK4GIZVX-BQay0k4e.js} +1 -1
- package/dist/client/assets/detail-row-290qyusq.js +1 -0
- package/dist/client/assets/{diagram-CBK3MWTC-BpPLL30n.js → diagram-CBK3MWTC-C1lRH4cb.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-D6loMn3G.js → diagram-I5XIIV2D-CnANa27A.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-BaGNd5eN.js → diagram-ODIL2UCW-Cwt7hxes.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BnDdKu_g.js → diagram-PFBEJUXE-DZtAER77.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-UXagB0_c.js → diagram-RJA3I4VV-CbVXbiGs.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-C-whBP-S.js → diagram-TYUNFSNR-D-AcGdsL.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-BbG481iS.js → ebnfDiagram-V4P3TTPT-DLkrFSAy.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-FtssIxOc.js → elk-QONTBCTQ-DQM6Glxa.js} +1 -1
- package/dist/client/assets/{empty-state-CACt-76q.js → empty-state-BnuM8oop.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-PpFgUf4C.js → erDiagram-KYQIGQAA-C1qgB1Mn.js} +1 -1
- package/dist/client/assets/{execution-config-CGL73sRn.js → execution-config-BjLHHc9x.js} +1 -1
- package/dist/client/assets/{file-D80JE_L0.js → file-D7_QdH_S.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-CcJ_e4_m.js → file-exclamation-point-Cdt8YqyQ.js} +1 -1
- package/dist/client/assets/{file-text-Ds9edaTZ.js → file-text-CB9l6Ur-.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-BtqFMP_f.js → find-latest-widget-fence-SQB9WgjN.js} +5 -5
- package/dist/client/assets/{flowDiagram-IUGLLWBU-BIva66g9.js → flowDiagram-IUGLLWBU-DH-ePeFu.js} +1 -1
- package/dist/client/assets/form--HjBAzX8.js +1 -0
- package/dist/client/assets/{format-cron-BpGrgPLu.js → format-cron-svkfKW5b.js} +1 -1
- package/dist/client/assets/format-tokens-DymkROvy.js +1 -0
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CZqips_4.js → ganttDiagram-R7GPNTJY-fjb_iAW1.js} +1 -1
- package/dist/client/assets/{git-branch-B8JNwQ6q.js → git-branch-CPOwiT8a.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DoIc3lda.js → gitGraphDiagram-PDYL7XHY-CcCqH5T3.js} +1 -1
- package/dist/client/assets/{graph-yizM0vwL.js → graph-DS3J2jnN.js} +1 -1
- package/dist/client/assets/{heart-BavUIV45.js → heart-C6uRnXx3.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CGr3AgaU.js → highlighted-body-KPVGNVTW-CNygKq0i.js} +1 -1
- package/dist/client/assets/image-lightbox-BQV3i0WJ.js +1 -0
- package/dist/client/assets/{image-off-C1uTDs9-.js → image-off-B88WBkcV.js} +1 -1
- package/dist/client/assets/{index-SOKlO1zZ.js → index-3CJSEcZE.js} +1 -1
- package/dist/client/assets/index-3JL8A9YZ.css +1 -0
- package/dist/client/assets/{index-BJEt9R_G.js → index-57qzL_5b.js} +1 -1
- package/dist/client/assets/index-5RD9flqf.js +1 -0
- package/dist/client/assets/{index-FhWMRBQP.js → index-B6pmysqs.js} +1 -1
- package/dist/client/assets/{index-DEiSJbvu.js → index-BIZNH5u1.js} +1 -1
- package/dist/client/assets/{index-BOhSPP-6.js → index-BKdXHSbr.js} +1 -1
- package/dist/client/assets/{index-B36osK_S.js → index-BN3zOTbR.js} +3 -3
- package/dist/client/assets/{index-DYEmUa5t.js → index-BNq_mnok.js} +1 -1
- package/dist/client/assets/index-BPp-rj-W.js +1 -0
- package/dist/client/assets/{index-DW4KUPHp.js → index-BTqJGL1_.js} +1 -1
- package/dist/client/assets/{index-CJXMgnYp.js → index-B_YZ5cyn.js} +1 -1
- package/dist/client/assets/{index-Dcd4NqFB.js → index-B_rc9Pb1.js} +1 -1
- package/dist/client/assets/{index-56EOd-zy.js → index-B_v2l2ND.js} +1 -1
- package/dist/client/assets/{index-QSXJR98z.js → index-Bktc0aFV.js} +1 -1
- package/dist/client/assets/index-BtTqA4_d.js +1 -0
- package/dist/client/assets/{index-CiGYtR9O.js → index-BxsALYNM.js} +1 -1
- package/dist/client/assets/index-C4Uak2ha.js +1 -0
- package/dist/client/assets/{index-FI_y_dND.js → index-C7I0BjyX.js} +1 -1
- package/dist/client/assets/{index-CoNMlH37.js → index-CEicS7Zi.js} +1 -1
- package/dist/client/assets/{index-1QfQImuJ.js → index-CLTrC-a-.js} +3 -3
- package/dist/client/assets/{index-CXBYgGja.js → index-CLVvKY2v.js} +1 -1
- package/dist/client/assets/{index-BKWJiERs.js → index-COXdXByr.js} +1 -1
- package/dist/client/assets/{index-CoKNU2F9.js → index-CTJA-mZu.js} +1 -1
- package/dist/client/assets/{index-BOEPL6hN.js → index-CZmU-67J.js} +1 -1
- package/dist/client/assets/{index-LwL5BpE4.js → index-Cbbw2ByB.js} +1 -1
- package/dist/client/assets/{index-C4t0UTU-.js → index-Cbk19RQp.js} +1 -1
- package/dist/client/assets/{index-DqkFtcGQ.js → index-D0QV18E0.js} +1 -1
- package/dist/client/assets/{index-7XeZCCDI.js → index-D5fV4hrl.js} +1 -1
- package/dist/client/assets/{index-CeDn1Ak1.js → index-DBAPfYwE.js} +1 -1
- package/dist/client/assets/{index-Cdod8zEY.js → index-DK8zHloW.js} +1 -1
- package/dist/client/assets/index-DO8NbOqk.js +1 -0
- package/dist/client/assets/{index-C8ZpJXTQ.js → index-DXZ-w0Z9.js} +1 -1
- package/dist/client/assets/{index-n_pnc-CO.js → index-DYQjub9g.js} +1 -1
- package/dist/client/assets/index-Daoy3TZ8.js +1 -0
- package/dist/client/assets/{index-tgbcsB6H.js → index-DdBvjuc4.js} +1 -1
- package/dist/client/assets/{index-X282DRZf.js → index-DhqeMM58.js} +2 -2
- package/dist/client/assets/{index-YSHcMqHa.js → index-Ds9wPt9M.js} +1 -1
- package/dist/client/assets/{index-Br6xDNvu.js → index-RQhQx8gq.js} +1 -1
- package/dist/client/assets/{index-CrTmY12y.js → index-UJpgX--l.js} +2 -2
- package/dist/client/assets/index-YUtEyz7O.js +1053 -0
- package/dist/client/assets/{index-BkJlIXqM.js → index-oc-yQ5Q4.js} +1 -1
- package/dist/client/assets/index-tRdq7FGO.js +1 -0
- package/dist/client/assets/{index-ZR5f82z2.js → index-um-0KSur.js} +1 -1
- package/dist/client/assets/{index.esm-CAeUe7uQ.js → index.esm-B10OaB6F.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-DweUdYSy.js → infoDiagram-MVDRKAX5-CGtvYWtj.js} +1 -1
- package/dist/client/assets/{inline-code-SYHTKcle.js → inline-code-BL-6EKVP.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DKNQIv7P.js → ishikawaDiagram-HPEHV2GE-ICsVVT2t.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-DPD7F4VO.js → journeyDiagram-BOSHW7O7-DEmSX2Hn.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-B_uPSwxC.js → kanban-definition-FNSA4HC5-SAV5PQOr.js} +1 -1
- package/dist/client/assets/{layers-F4mvrI2l.js → layers-Bfdpn7ZM.js} +1 -1
- package/dist/client/assets/{lightbulb-a6nNsrzy.js → lightbulb-CSPTiZoi.js} +1 -1
- package/dist/client/assets/{link-2-yI2Tlm7Q.js → link-2-ZzmN9B9k.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CsGil5te.js → list-runtime-types-7qV7HQ7K.js} +1 -1
- package/dist/client/assets/{markdown-content-Cjhsscbn.js → markdown-content-CiDXslQf.js} +1 -1
- package/dist/client/assets/mention-pill-CuSUdpn7.js +1 -0
- package/dist/client/assets/{mermaid.core-9PwG-9fN.js → mermaid.core-C-qvGQ5g.js} +4 -4
- package/dist/client/assets/{message-square-off-aV4NMCjd.js → message-square-off-BehEHG9c.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-BRbWmQkj.js → mindmap-definition-6OY57UG3-DzU2APoo.js} +1 -1
- package/dist/client/assets/{more-details-CRLU2HN4.js → more-details-DF2dJXMV.js} +1 -1
- package/dist/client/assets/{owner-notice-CTJbhUak.js → owner-notice-DoH-_Veh.js} +1 -1
- package/dist/client/assets/{package-sPggO7Dr.js → package-Fm_v1gMn.js} +1 -1
- package/dist/client/assets/{page-container-CnfDuiDC.js → page-container-Bcz5wJVR.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-63OC5vfI.js → pane-resize-handle-_EuIpxzc.js} +1 -1
- package/dist/client/assets/{paperclip-WhPo3_WD.js → paperclip-AGN67YEM.js} +1 -1
- package/dist/client/assets/path-input-jrT0Ap4j.js +1 -0
- package/dist/client/assets/{pegDiagram-ECIUJNBX-Ct9Li_PA.js → pegDiagram-ECIUJNBX-CAyGJ7fm.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-BAB5RA5v.js → pieDiagram-GNMPY74T-tmLJe1p-.js} +1 -1
- package/dist/client/assets/{plug-_q5iqunq.js → plug-C-4o4Kb8.js} +1 -1
- package/dist/client/assets/primer-trigger-CmE4Ib-X.js +3 -0
- package/dist/client/assets/{profile-errors-COcBx7w5.js → profile-errors-vJU1kT3U.js} +1 -1
- package/dist/client/assets/{progress-77FCPL2y.js → progress-BTu_QWg8.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-BqPJVmMS.js → quadrantDiagram-D57K4MC3-CUr2zJoz.js} +1 -1
- package/dist/client/assets/{query-error-state-5236P3z0.js → query-error-state-BCX32dab.js} +1 -1
- package/dist/client/assets/{radio-C8xmfoqO.js → radio-DBitPjM1.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-B8U11nT6.js → railroadDiagram-Y72NRBL7-Bk9OMEWz.js} +1 -1
- package/dist/client/assets/registry-DVPRVi8T.js +34 -0
- package/dist/client/assets/registry-DiFfRDdW.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-B80E4EUn.js → relay-trace-schemas-C-1Js81V.js} +2 -2
- package/dist/client/assets/{repeat-CHmB_vD7.js → repeat-B1wCYWXI.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-CzJ1gzTh.js → requirementDiagram-EQYSW5RA-B2pkljrw.js} +1 -1
- package/dist/client/assets/{room-files-source-B0gc97Ri.js → room-files-source-BDkq0-fd.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-CCU6SVnv.js → rotate-ccw-clock-Ds8cHkxD.js} +1 -1
- package/dist/client/assets/{rotate-cw-B8WQa8O-.js → rotate-cw-hUzouNTK.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-D4vQwyve.js → sankeyDiagram-SY24JHO5-DEW9eIPS.js} +1 -1
- package/dist/client/assets/scroll-area-RSd8NjrE.js +1 -0
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BVnIsPQe.js → sequenceDiagram-BLEHNHQU-CoiCdD1D.js} +1 -1
- package/dist/client/assets/{shield-x-ijIbRppV.js → shield-x-KL4ZbHfz.js} +1 -1
- package/dist/client/assets/signed-in-Dzxe2378.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-DGb1rAJL.js → sizeCapture-INFHLROL-BWGf0Ghs.js} +1 -1
- package/dist/client/assets/{soul-file-CXgYs25S.js → soul-file-BQXbWArv.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DeX3IKTm.js → stateDiagram-v2-A6IESKWZ-aeqwGZMB.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-DN5ljYhG.js → swimlanes-B3ENRKFQ-BkWhAAlV.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CS2DMvLi.js +8 -0
- package/dist/client/assets/{table-D9ww_3Ij.js → table-CfLst6CF.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-DpRthC3r.js → timeline-definition-JXYKGLGB-C1BUxIfq.js} +1 -1
- package/dist/client/assets/{trust-posture-Dn2ciEE0.js → trust-posture-CfEIPM4Z.js} +1 -1
- package/dist/client/assets/{unplug-BZ8zSvfB.js → unplug-B3eDst8L.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CGy05tAO.js → unverified-catalog-notice-BqIWxQuN.js} +1 -1
- package/dist/client/assets/{use-bindings-BLAWQRpe.js → use-bindings-DhOKnybh.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-ICOpilWK.js → use-composer-prefs-_rlNL0D8.js} +1 -1
- package/dist/client/assets/{use-connector-management-DEMGZy9N.js → use-connector-management-CHLdhBhC.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DxGYrks3.js → use-deep-link-scroll-BVkszEn2.js} +1 -1
- package/dist/client/assets/{use-delete-binding-Bnv3J5Fu.js → use-delete-binding-BET7vH2R.js} +1 -1
- package/dist/client/assets/{use-dev-links-BOcktLiE.js → use-dev-links-BjLPuSUC.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-D38tSozW.js → use-direct-message-panel-ClXVf94w.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-9qiNBqpc.js → use-external-adapter-catalog-D1INoacX.js} +1 -1
- package/dist/client/assets/use-filter-state-BRlb3qG3.js +6 -0
- package/dist/client/assets/use-full-activity-feed-GWBg-_1B.js +1 -0
- package/dist/client/assets/use-is-below-desktop-BjWA-tqP.js +1 -0
- package/dist/client/assets/{use-local-browser-B1huJhdg.js → use-local-browser-C-V2n_wd.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BTYAy6zc.js → use-mesh-topology-BzSFyR_s.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-CaPc6Prv.js → use-mounted-ref-1T3JbkY1.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-u76DPoP0.js → use-notification-prefs-qcYeVmLQ.js} +1 -1
- package/dist/client/assets/use-pending-read-C1oA2H00.js +1 -0
- package/dist/client/assets/use-personality-commit-CJb-rqmM.js +1 -0
- package/dist/client/assets/{use-promo-activation-5HG08FlB.js → use-promo-activation-CAJItujg.js} +3 -3
- package/dist/client/assets/{use-promo-dismissals-CO7-qhEl.js → use-promo-dismissals-C6bPU5Rm.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-D07Mv-Sa.js → use-pulse-freshness-Y11Ibit1.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DRQBuAIe.js → use-room-follow-claim-Di-yvoJD.js} +1 -1
- package/dist/client/assets/{use-room-sessions-Bzk7rM40.js → use-room-sessions-CPDRbQAW.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CcznVldj.js → use-roving-tab-list-DK0OzOUz.js} +1 -1
- package/dist/client/assets/{use-session-canvas-CpgE7tFb.js → use-session-canvas-DA2i9Mdm.js} +6 -6
- package/dist/client/assets/use-status-budget-jMg_w0rF.js +21 -0
- package/dist/client/assets/{use-transform-ByJGn3hq.js → use-transform-BX3r518L.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-C-z5fstJ.js → use-unclaimed-chats-B0nk8b84.js} +1 -1
- package/dist/client/assets/use-update-config-Ce7sHmp2.js +1 -0
- package/dist/client/assets/{useMutationState-BF1EFtIZ.js → useMutationState-Rlga1GBT.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-efVKbRIX.js → usecaseDiagram-WPOLBNNX-mjIwRNL1.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Bravmwce.js → vennDiagram-Q3Y3IDCW-BcDIpVa6.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-fR77zByv.js → wardleyDiagram-IVAIDKWA-NFX31kox.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-BphORSLh.js → xychartDiagram-4URNHDU4-DZZY7dL1.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261031012841_dor3309_file_turn_on_offer.sql +2 -0
- package/dist/drizzle/20261101122330_schedule_declined_content_key.sql +1 -0
- package/dist/drizzle/meta/20261031012841_snapshot.json +14116 -0
- package/dist/drizzle/meta/20261101122330_snapshot.json +14123 -0
- package/dist/drizzle/meta/_journal.json +14 -0
- package/dist/server/index.js +6424 -4548
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ActivityRow-DIBH4v9c.js +0 -1
- package/dist/client/assets/AdapterSetupWizard-Dle_b9qc.js +0 -2
- package/dist/client/assets/AppearancePage-DXbhUt2e.js +0 -1
- package/dist/client/assets/AttentionSignalRow-5E7TkG98.js +0 -1
- package/dist/client/assets/BindingDialog-q--8SDJF.js +0 -1
- package/dist/client/assets/CanvasFileContent-BThy5fjD.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-BbgR73jh.js +0 -2
- package/dist/client/assets/ChannelComposer-qhk0KtW7.js +0 -44
- package/dist/client/assets/ConnectionAccessLists-DRwO1v0V.js +0 -1
- package/dist/client/assets/HandlePage-B4qbFi40.js +0 -1
- package/dist/client/assets/HeartbeatPage-BnNbQLCW.js +0 -1
- package/dist/client/assets/Marketplace-DbdLWz0-.js +0 -36
- package/dist/client/assets/NamePage-fhxyWDDY.js +0 -1
- package/dist/client/assets/OperatorIdentityForm-Bls5Vo_u.js +0 -1
- package/dist/client/assets/PhotoPage-CNHcXbz4.js +0 -1
- package/dist/client/assets/PreviewRefusedNotice-Ds4IO32o.js +0 -1
- package/dist/client/assets/PromptSuggestionChips-BXxC799Q.js +0 -1
- package/dist/client/assets/RoomSurface-DgH3a_Fv.js +0 -1
- package/dist/client/assets/RunsOnPopover-CEkkjrGg.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-DXWGgvCW.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-D6L1QhMF.js +0 -1
- package/dist/client/assets/SettingsDialog-BOOqWKcj.js +0 -12
- package/dist/client/assets/SkillsPage-ntCEhUIM.js +0 -1
- package/dist/client/assets/TaskDialogWrapper-vBWAWwTY.js +0 -1
- package/dist/client/assets/TasksEmptyState-C_3UkAbA.js +0 -3
- package/dist/client/assets/TourHost-B69XAKpE.js +0 -1
- package/dist/client/assets/WidgetErrorCard-BlqaIsPK.js +0 -108
- package/dist/client/assets/WorkView-BekLkR4O.js +0 -51
- package/dist/client/assets/_shell-Du0F-5fK.js +0 -80
- package/dist/client/assets/_shell._home.activity-5rihXoYF.js +0 -1
- package/dist/client/assets/_shell._home.index-BsLNqt4f.js +0 -3
- package/dist/client/assets/_shell._home.tasks-Cxs5tLWA.js +0 -1
- package/dist/client/assets/_shell._home.workspaces-CEHDdfbP.js +0 -1
- package/dist/client/assets/_shell.connections-Bm0WmgXH.js +0 -1
- package/dist/client/assets/_shell.marketplace-CsQ60Mlc.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-DNyShS1x.js +0 -1
- package/dist/client/assets/_shell.session-BN42bV3w.js +0 -1
- package/dist/client/assets/_shell.threads-HH4EvufJ.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-3ZlJV1iu.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-3ZlJV1iu.js +0 -1
- package/dist/client/assets/card-DUmTNXJJ.js +0 -1
- package/dist/client/assets/channel-B7zgJbnU.js +0 -1
- package/dist/client/assets/form-D93N5lrK.js +0 -1
- package/dist/client/assets/image-lightbox-vgPEvSCc.js +0 -1
- package/dist/client/assets/index-B446r3dL.js +0 -1
- package/dist/client/assets/index-BGo1YiUE.js +0 -1
- package/dist/client/assets/index-BO3yPJt-.js +0 -1
- package/dist/client/assets/index-DE6uOpn4.js +0 -1
- package/dist/client/assets/index-Dag1qeZI.js +0 -1
- package/dist/client/assets/index-Dm0Tav7v.js +0 -1
- package/dist/client/assets/index-Dry_agqN.css +0 -1
- package/dist/client/assets/index-OQuvRZTD.js +0 -1058
- package/dist/client/assets/index-eVrGefuq.js +0 -1
- package/dist/client/assets/mention-pill-BsOeTJ2f.js +0 -1
- package/dist/client/assets/path-input-C2KIXdON.js +0 -1
- package/dist/client/assets/primer-trigger-B2tjuHBx.js +0 -3
- package/dist/client/assets/registry-BzXBOE9h.js +0 -34
- package/dist/client/assets/registry-sfhDu9q2.js +0 -1
- package/dist/client/assets/scroll-area-FwZwM74Q.js +0 -1
- package/dist/client/assets/search-x-Q18Wm-C5.js +0 -6
- package/dist/client/assets/signed-in-DEOMBWVX.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D8kHFWtL.js +0 -8
- package/dist/client/assets/use-full-activity-feed-CtQquOBW.js +0 -1
- package/dist/client/assets/use-is-below-desktop-CAGEAsCC.js +0 -1
- package/dist/client/assets/use-pending-read-D0y6i7G9.js +0 -1
- package/dist/client/assets/use-personality-commit-C3h8upDo.js +0 -1
- package/dist/client/assets/use-status-budget-Xn2sIeM1.js +0 -16
- package/dist/client/assets/use-update-config-L5NCTj3t.js +0 -1
package/dist/server/index.js.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/server/index.js.map
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 66233663 bytes
|
|
4
|
+
sha256: bebab59216aa2c8ad266e09d9835233bec8ba353c9da04c1dd47fec9b3ada508
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dorkos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "You, multiplied. Build and run your business with an agent team. Your agents join your team chat, take on real work, and build the tools your company runs on.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dorian Collier",
|
|
@@ -83,15 +83,15 @@
|
|
|
83
83
|
"tsx": "^4.23.15",
|
|
84
84
|
"typescript": "^5.9.3",
|
|
85
85
|
"vitest": "^4.1.11",
|
|
86
|
-
"@dorkos/db": "0.0.0",
|
|
87
86
|
"@dorkos/browser": "0.0.0",
|
|
88
|
-
"@dorkos/
|
|
87
|
+
"@dorkos/client": "0.0.0",
|
|
89
88
|
"@dorkos/marketplace": "0.0.0",
|
|
89
|
+
"@dorkos/eslint-config": "0.0.0",
|
|
90
90
|
"@dorkos/harness": "0.0.0",
|
|
91
91
|
"@dorkos/server": "0.0.0",
|
|
92
|
-
"@dorkos/typescript-config": "0.0.0",
|
|
93
92
|
"@dorkos/shared": "0.0.0",
|
|
94
|
-
"@dorkos/
|
|
93
|
+
"@dorkos/typescript-config": "0.0.0",
|
|
94
|
+
"@dorkos/db": "0.0.0"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"build": "tsx scripts/build.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b7 as d,dE as x,j as e,_ as u,G as l,cs as m,dF as g,B as h}from"./index-OQuvRZTD.js";import{b as f,c}from"./table-D9ww_3Ij.js";const k={tasks:{text:"text-purple-500",bg:"bg-purple-500/10",label:"Schedules"},relay:{text:"text-teal-500",bg:"bg-teal-500/10",label:"Messages"},agent:{text:"text-indigo-500",bg:"bg-indigo-500/10",label:"Agent"},config:{text:"text-amber-500",bg:"bg-amber-500/10",label:"Settings"},system:{text:"text-neutral-500",bg:"bg-neutral-500/10",label:"System"},permissions:{text:"text-sky-500",bg:"bg-sky-500/10",label:"Permissions"}},p={user:{text:"text-muted-foreground"},agent:{text:"text-foreground"},system:{icon:x,text:"text-neutral-500"},tasks:{icon:d,text:"text-purple-500"}};function b({actorType:s,actorLabel:r,agentColor:a,className:n}){const i=p[s],t=i.icon;return s==="user"?e.jsx(u,{shape:"pill",variant:"outline",className:l("text-muted-foreground",n),children:r}):s==="agent"?e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1.5 text-xs font-medium",i.text,n),children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:a?{backgroundColor:a}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r})]}):e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1 text-xs font-medium",i.text,n),children:[t&&e.jsx(t,{className:"size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{children:r})]})}function y(s,r=new Date){const a=new Date(s),n=new Date(r);n.setHours(0,0,0,0);const i=new Date(n);i.setDate(i.getDate()-1);const t=new Date(n);t.setDate(t.getDate()-t.getDay());const o=a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return a>=n?o:a>=i?`Yesterday ${o}`:a>=t?`${a.toLocaleDateString("en-US",{weekday:"long"})} ${o}`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function v({item:s,compact:r=!1,className:a}){const n=m(),i=y(s.occurredAt),t=s.linkPath?g(s.linkPath):null;return e.jsxs(f,{"data-slot":"activity-row","data-activity-row":t?"":void 0,tabIndex:t?0:void 0,onKeyDown:t?o=>{o.key==="Enter"&&n({href:t,replace:!1})}:void 0,className:l(t?"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none":"hover:bg-transparent",a),children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx("span",{className:"text-muted-foreground text-xs tabular-nums",children:i})}),e.jsx(c,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(b,{actorType:s.actorType,actorLabel:s.actorLabel})})]}),e.jsx(c,{className:l("max-w-0 py-1.5",r?"pl-2":"max-sm:pl-2"),children:e.jsxs("span",{className:"text-foreground/80 block truncate text-sm",children:[e.jsx("span",{className:l("text-muted-foreground mr-1 text-xs font-medium",!r&&"sm:hidden"),children:s.actorLabel}),s.summary]})}),e.jsx(c,{className:l("py-1.5 pr-2 text-right",r?"w-10":"w-16 max-sm:w-10"),children:t&&e.jsx(h,{variant:"ghost",size:"sm",className:"h-6 min-h-[44px] px-2 text-xs sm:min-h-0",onClick:()=>n({href:t,replace:!1}),children:"Open →"})})]})}export{v as A,k as C};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a1 as be,a3 as Ne,a4 as qe,j as e,be as ze,bf as Ee,r as m,dp as ie,hZ as Te,dq as oe,h0 as le,$ as $e,Q as ce,T as de,au as ue,U as he,V as pe,bw as Y,ap as J,h_ as me,h$ as Me,G as U,eg as Z,eh as X,ei as ee,ej as se,ek as te,I as re,eo as xe,J as We,bv as Ve,B as k,i0 as Se,eq as De,en as ae,x as ke,bc as Pe,bb as Re,a0 as Oe,ai as ge,i1 as Le,i2 as _e,i3 as Ge,i4 as Ue,i5 as Ie,i6 as Qe,i7 as He,i8 as Ke,cZ as Ye,dD as G,fi as Je,fj as Ze,fk as Xe,fl as es,fm as ss,fn as ts,i9 as fe,ia as H}from"./index-OQuvRZTD.js";import{B as rs}from"./use-bindings-BLAWQRpe.js";import{M as I}from"./markdown-content-Cjhsscbn.js";import{u as as}from"./form-D93N5lrK.js";import{a as ns}from"./BindingDialog-q--8SDJF.js";import"./relay-trace-schemas-B80E4EUn.js";function Bs(s={}){const t=be(),a=Ne();return qe({mutationFn:({id:r,updates:l})=>t.updateBinding(r,l),onSuccess:()=>{a.invalidateQueries({queryKey:[...rs]})},meta:s.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:s.errorLabel??"Couldn’t update that connection"}})}function is({field:s,value:t,onChange:a,error:r,allValues:l}){const[i,n]=m.useState("");if(s.showWhen&&l[s.showWhen.field]!==s.showWhen.equals)return null;const o=`config-field-${s.key}`,v=s.type==="select"&&s.displayAs==="radio-cards",h=t!=null?String(t):"",x=h==="***",y=()=>{if(x){n("");return}if(s.pattern&&h&&!new RegExp(s.pattern).test(h)){n(s.patternMessage??"Check the format");return}n("")},d=r??i;if(s.type==="boolean")return e.jsxs("div",{children:[e.jsxs(ie,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs(Te,{className:"min-w-0",children:[e.jsxs(oe,{htmlFor:o,className:"text-sm font-medium",children:[s.label,s.required&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),s.description&&e.jsx(le,{className:"text-xs",children:s.description})]}),e.jsx($e,{id:o,checked:!!t,onCheckedChange:N=>a(s.key,N)})]}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(I,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(Y,{children:d&&e.jsx(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{className:"mt-1.5",children:d})})})]});const b=()=>{var N,C;switch(s.type){case"text":case"url":return e.jsx(re,{id:o,type:s.type==="url"?"url":"text",value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"password":return x?e.jsx(xe,{id:o,value:h,showPassword:!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onFocus:()=>a(s.key,""),onBlur:y,placeholder:"Saved · type to replace"}):e.jsx(xe,{id:o,value:h,visibleByDefault:s.visibleByDefault??!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onBlur:y,onPaste:()=>setTimeout(y,0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"number":return e.jsx(re,{id:o,type:"number",value:h,onChange:c=>a(s.key,c.target.value?Number(c.target.value):void 0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"select":return s.displayAs==="radio-cards"?e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"radiogroup","aria-labelledby":`${o}-label`,"aria-required":s.required||void 0,children:(N=s.options)==null?void 0:N.map(c=>e.jsxs("button",{type:"button",role:"radio","aria-checked":h===c.value,onClick:()=>a(s.key,c.value),className:U("hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring flex flex-col items-start rounded-md border p-3 text-left transition outline-none focus-visible:ring-[3px]",h===c.value&&"border-primary ring-primary bg-accent/30 ring-1"),children:[e.jsx("span",{className:"text-sm font-medium",children:c.label}),c.description&&e.jsx("span",{className:"text-muted-foreground mt-1 text-xs",children:c.description})]},c.value))}):e.jsxs(Z,{value:h,onValueChange:c=>a(s.key,c),children:[e.jsx(X,{id:o,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0,children:e.jsx(ee,{placeholder:s.placeholder??"Select…"})}),e.jsx(se,{children:(C=s.options)==null?void 0:C.map(c=>e.jsx(te,{value:c.value,children:c.label},c.value))})]});case"textarea":return e.jsx(Me,{id:o,value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,rows:3,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});default:return null}};return e.jsxs(ie,{children:[e.jsxs(oe,{id:`${o}-label`,htmlFor:v?void 0:o,children:[s.label,s.required&&!x&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),b(),s.description&&e.jsx(le,{className:"text-xs",children:s.description}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(I,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(Y,{children:d&&e.jsx(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{children:d})})})]})}function os(s,t){return s.showWhen?t[s.showWhen.field]===s.showWhen.equals:!0}function ls({fields:s,allValues:t,renderField:a}){const r=new Map;for(const l of s){const i=l.section;r.has(i)||r.set(i,[]),r.get(i).push(l)}return e.jsx("div",{className:"space-y-6",children:Array.from(r.entries()).map(([l,i])=>{const n=i.filter(o=>os(o,t));return n.length===0?null:e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("h4",{className:"text-sm font-semibold",children:l}),e.jsx(ze,{children:e.jsx(Ee,{children:n.map(o=>a(o))})})]},l??"__default")})})}const je=["agent","configure","test","confirm"],cs={agent:"Agent",configure:"Set up",test:"Check",confirm:"Review"};function ds({current:s,showAgentStep:t}){const a=t?je:je.filter(l=>l!=="agent"),r=a.indexOf(s);return e.jsx("div",{className:"flex items-start justify-between px-1",role:"navigation","aria-label":"Setup steps",children:a.map((l,i)=>{const n=i<r,o=i===r,v=i>r;return e.jsxs(m.Fragment,{children:[i>0&&e.jsx("div",{className:U("mt-3 h-px flex-1",n||o?"bg-primary":"border-muted-foreground/40 border-t border-dashed")}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:U("flex size-6 items-center justify-center rounded-full text-xs font-medium",n&&"bg-primary text-primary-foreground",o&&"bg-primary text-primary-foreground ring-primary/30 ring-2",v&&"border-muted-foreground text-muted-foreground border"),"aria-current":o?"step":void 0,children:n?e.jsx(We,{className:"size-3"}):i+1}),e.jsx("span",{className:U("text-3xs",o?"text-foreground font-medium":"text-muted-foreground"),children:cs[l]})]})]},l)})})}function us({manifest:s,label:t,onLabelChange:a,fields:r,form:l,currentSetupStep:i,hasSetupGuide:n,onOpenGuide:o}){const{Subscribe:v,AppField:h}=l;return e.jsxs("div",{className:"space-y-4",children:[s.setupInstructions&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[e.jsx(Ve,{className:"mt-0.5 size-4 shrink-0"}),e.jsx(I,{content:s.setupInstructions,className:"text-sm text-blue-800 dark:text-blue-200"})]}),(s.actionButton||n)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n&&e.jsxs(k,{type:"button",variant:"outline",size:"sm",onClick:o,children:[e.jsx(Se,{className:"mr-1.5 size-3.5"}),"Setup guide"]}),s.actionButton&&e.jsx(k,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx(De,{href:s.actionButton.url,children:s.actionButton.label})})]}),i&&e.jsx("h4",{className:"text-sm font-medium",children:i.title}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"adapter-label",children:"Name (optional)"}),e.jsx(re,{id:"adapter-label",placeholder:s.displayName,value:t,onChange:x=>a(x.target.value)}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Helps you tell this connection apart."})]}),e.jsx(v,{selector:x=>x.values,children:x=>e.jsx(ls,{fields:r,allValues:x,renderField:y=>e.jsx(h,{name:y.key,children:d=>{var b;return e.jsx(is,{field:y,value:d.state.value,onChange:(N,C)=>d.handleChange(C),onBlur:d.handleBlur,error:d.state.meta.isTouched?(b=d.state.meta.errors[0])==null?void 0:b.toString():void 0,allValues:x})}},y.key)})})]})}function hs({isPending:s,isSuccess:t,isError:a,errorMessage:r,botUsername:l,onRetry:i}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{size:"lg",className:"text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Trying to reach it…"})]}),t&&e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(Pe,{className:"text-status-success size-8"}),e.jsx("p",{className:"text-status-success-fg text-sm",children:"Reachable"}),l&&e.jsx("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:e.jsxs("span",{className:"font-mono",children:["@",l]})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Re,{className:"text-destructive size-8"}),e.jsx("p",{className:"text-destructive text-sm",children:"Not reachable"}),r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[e.jsx(Oe,{className:"mt-0.5 size-3 shrink-0"}),e.jsx("span",{children:r})]}),e.jsx(k,{variant:"outline",size:"sm",onClick:i,children:"Retry"})]})]})}function ps(s){return s.length>8?"•••• "+s.slice(-4):"•••"}function ms({manifest:s,adapterId:t,isEditMode:a,values:r,botUsername:l,agentName:i}){return e.jsxs("div",{className:"space-y-3",children:[!a&&i&&e.jsxs("p",{className:"bg-accent/30 rounded-md border px-3 py-2 text-sm",children:["Messages here go to ",e.jsx("span",{className:"font-medium",children:i}),"."]}),!a&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connection ID"}),e.jsx("span",{className:"font-mono",children:t})]}),s.configFields.map(n=>{if(n.showWhen&&r[n.showWhen.field]!==n.showWhen.equals)return null;const o=String(r[n.key]??""),v=n.type==="password"?ps(o):o;return e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:n.label}),e.jsx("span",{className:"max-w-[200px] truncate font-mono",children:v})]},n.key)}),l&&s.type==="telegram"&&e.jsxs("a",{href:`https://t.me/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1.5 text-sm underline-offset-4 hover:underline",children:["Message @",l," in Telegram"]})]})}const ye=[{value:"per-chat",label:"One shared chat per group or channel",hint:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",hint:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",hint:"Nothing carries over from the message before."}];function xs({agentOptions:s,agentId:t,onAgentIdChange:a,strategy:r,onStrategyChange:l}){var n;const i=s.length===1?s[0]:void 0;return m.useEffect(()=>{i&&!t&&a(i.id)},[i,t,a]),s.length===0?e.jsx("p",{role:"alert",className:"text-muted-foreground rounded-md border border-dashed px-4 py-6 text-center text-sm",children:"No agents yet. Add one from the Team page first."}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Messages here go to this agent."}),i?e.jsxs("div",{className:"bg-accent/30 rounded-md border px-4 py-3 text-sm",children:[e.jsx("span",{className:"font-medium",children:ge(i)})," will answer."]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-agent",children:"Who should answer?"}),e.jsxs(Z,{value:t,onValueChange:a,children:[e.jsx(X,{id:"wizard-agent",className:"w-full",children:e.jsx(ee,{placeholder:"Pick an agent"})}),e.jsx(se,{children:s.map(o=>e.jsx(te,{value:o.id,children:ge(o)},o.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-memory",children:"How the agent remembers"}),e.jsxs(Z,{value:r,onValueChange:o=>l(o),children:[e.jsx(X,{id:"wizard-memory",className:"w-full",children:e.jsx(ee,{})}),e.jsx(se,{children:ye.map(o=>e.jsx(te,{value:o.value,children:o.label},o.value))})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(n=ye.find(o=>o.value===r))==null?void 0:n.hint})]})]})}function gs({open:s,onOpenChange:t,title:a,content:r}){return e.jsx(Le,{open:s,onOpenChange:t,children:e.jsxs(_e,{side:"right",className:"w-[480px] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ge,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"size-4"}),a," setup guide"]}),e.jsx(Ie,{children:"Step-by-step setup instructions."})]}),e.jsx("div",{className:"mt-4 px-4",children:e.jsx(I,{content:r})})]})})}function we(s){const t=s.setupSteps;if(!t||t.length===0)return[];const a=new Set(t.flatMap(r=>r.fields));return s.configFields.filter(r=>!a.has(r.key))}function fs(s,t){return typeof t=="string"||t===void 0||t===null?t:s.valueShape==="id-list"?Array.isArray(t)?t.join(`
|
|
2
|
-
`):t:s.valueShape==="json-object"&&typeof t=="object"?JSON.stringify(t,null,2):t}function js(s,t){const a=s.setupSteps;if(!a||a.length===0)return s.configFields;const r=a[t];if(!r)return s.configFields;const l=s.configFields.filter(i=>r.fields.includes(i.key));return t!==a.length-1?l:[...l,...we(s)]}const ys="Advanced";function K(s){const t={};for(const[a,r]of Object.entries(s)){const l=a.split(".");let i=t;for(let n=0;n<l.length-1;n++){const o=l[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[l[l.length-1]]=r}return t}function ve(s,t){const a=t.split(".");let r=s;for(const l of a){if(r==null||typeof r!="object")return;r=r[l]}return r}function vs(s,t){const a={};for(const r of s.configFields){const l=t?ve(t,r.key):void 0;l!==void 0&&r.type!=="password"?a[r.key]=fs(r,l):r.type==="password"&&t&&ve(t,r.key)!==void 0?a[r.key]="***":r.default!==void 0?a[r.key]=r.default:a[r.key]=r.type==="boolean"?!1:""}return a}function bs(s,t=[]){const a=s.type;if(!t.includes(a))return a;let r=2;for(;t.includes(`${a}-${r}`);)r++;return`${a}-${r}`}function Ns({manifest:s,existingInstance:t,existingAdapterIds:a=[],onOpenChange:r}){const l=!!t,[i,n]=m.useState(t?"configure":"agent"),[o,v]=m.useState(!1),[h]=m.useState(()=>(t==null?void 0:t.id)??bs(s,a)),[x,y]=m.useState(()=>{var p;return((p=t==null?void 0:t.config)==null?void 0:p.label)??""}),[d,b]=m.useState(0),[N,C]=m.useState(""),[c,P]=m.useState(""),[$,R]=m.useState("per-chat"),E=Qe(),q=He(),S=Ke(),M=ns(),{data:F}=Ye(),w=be(),z=Ne(),T=(F==null?void 0:F.agents)??[],B=s.setupSteps&&s.setupSteps.length>0,j=as({defaultValues:vs(s,t==null?void 0:t.config),validators:{onSubmit:({value:p})=>{const g={};for(const u of s.configFields)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(g[u.key]=`${u.label} is required`)}return Object.keys(g).length>0?{fields:g}:void 0}},onSubmit:async()=>{}}),W=m.useMemo(()=>{const p=new Set(we(s).map(g=>g.key));return js(s,d).map(g=>p.has(g.key)&&!g.section?{...g,section:ys}:g)},[s,d]),O=m.useCallback(()=>{const p=j.state.values;let g=!0;for(const u of W)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(j.setFieldMeta(u.key,A=>({...A,isTouched:!0,errors:[`${u.label} is required`],errorMap:{onSubmit:`${u.label} is required`}})),g=!1)}return g},[j,W]),L=m.useCallback(()=>{if(i==="agent"){if(!c)return;n("configure");return}if(i==="configure"){if(!O())return;if(B&&s.setupSteps&&d<s.setupSteps.length-1){b(u=>u+1);return}const g=j.state.values;n("test"),S.mutate({type:s.type,config:K(g)},{onSuccess:u=>{u.botUsername&&(C(u.botUsername),x||y(`@${u.botUsername}`))}})}else i==="test"&&n("confirm")},[i,c,B,s,d,O,j,S,x]),V=m.useCallback(()=>{i==="test"?(n("configure"),S.reset()):i==="confirm"?n("test"):i==="configure"&&(B&&d>0?b(p=>p-1):l||n("agent"))},[i,B,d,S,l]),D=m.useCallback(async p=>{try{return await w.removeRelayAdapter(p),!0}catch{return!1}finally{z.invalidateQueries({queryKey:["relay"]})}},[w,z]),Q=m.useCallback(()=>{const p=j.state.values,g=K(p),u=x?{...g,label:x}:g;if(l&&t){q.mutate({id:t.id,config:u},{onSuccess:()=>r(!1)});return}if(!c){n("agent");return}E.mutate({type:s.type,id:h,config:u},{onSuccess:()=>{M.mutate({adapterId:h,agentId:c,sessionStrategy:$,label:""},{onSuccess:()=>{var A;const f=((A=T.find(_=>_.id===c))==null?void 0:A.name)??c;G.success(`${s.displayName} is connected`,{description:`Messages here go to ${f}.`}),r(!1)},onError:f=>{n("agent"),D(h).then(A=>{A?G.error("Nothing was set up",{description:`${s.displayName} couldn’t be linked to an agent, so it wasn’t saved. ${f.message}`}):G.error("Couldn’t finish undoing",{description:`${s.displayName} was added with no agent to answer it. Remove it from Messaging. ${f.message}`})})}})},onError:f=>{var A,_,ne;(A=f.message)!=null&&A.includes("timed out")?G.error(`Couldn’t reach ${s.displayName}`,{description:"Check your token and network, then try again."}):((_=f.message)!=null&&_.includes("duplicate")||(ne=f.message)!=null&&ne.includes("exists"))&&(n("configure"),b(0))}})},[j,l,t,q,E,M,s,h,x,c,$,T,D,r]),Ce=m.useCallback(p=>{p||(n(l?"configure":"agent"),b(0),y(""),C(""),P(""),R("per-chat"),v(!1),j.reset(),S.reset()),r(p)},[r,j,S,l]),Ae=m.useCallback(()=>{S.mutate({type:s.type,config:K(j.state.values)})},[S,s.type,j]),Fe=E.isPending||q.isPending||M.isPending,Be=B&&s.setupSteps?s.setupSteps[d]:void 0;return{step:i,isEditMode:l,adapterId:h,label:x,setLabel:y,botUsername:N,guideOpen:o,setGuideOpen:v,form:j,visibleFields:W,bindAgentId:c,setBindAgentId:P,bindStrategy:$,setBindStrategy:R,agentOptions:T,isSaving:Fe,hasSetupSteps:B,setupStepIndex:d,currentSetupStep:Be,testConnection:S,handleContinue:L,handleBack:V,handleSave:Q,handleOpenChange:Ce,handleRetryTest:Ae}}function qs({open:s,onOpenChange:t,manifest:a,existingInstance:r,existingAdapterIds:l=[]}){var L;const i=Ns({manifest:a,existingInstance:r,existingAdapterIds:l,onOpenChange:t}),{step:n,isEditMode:o,adapterId:v,label:h,setLabel:x,botUsername:y,guideOpen:d,setGuideOpen:b,form:N,visibleFields:C,bindAgentId:c,setBindAgentId:P,bindStrategy:$,setBindStrategy:R,agentOptions:E,isSaving:q,hasSetupSteps:S,setupStepIndex:M,currentSetupStep:F,testConnection:w,handleContinue:z,handleBack:T,handleSave:B,handleOpenChange:j,handleRetryTest:W}=i,O={agent:"Pick who answers messages here.",configure:(F==null?void 0:F.description)??"Fill in the settings this needs.",test:"Checking the connection…",confirm:"Check it over, then save."}[n];return e.jsxs(m.Fragment,{children:[e.jsx(Je,{open:s,onOpenChange:j,children:e.jsxs(Ze,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[e.jsxs(Xe,{children:[e.jsx(es,{children:o?`Edit ${a.displayName}`:`Add ${a.displayName}`}),e.jsx(ss,{children:O})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto py-2",children:[e.jsx(ds,{current:n,showAgentStep:!o}),e.jsx(Y,{mode:"wait",children:e.jsxs(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[n==="agent"&&e.jsx(xs,{agentOptions:E,agentId:c,onAgentIdChange:P,strategy:$,onStrategyChange:R}),n==="configure"&&e.jsx(us,{manifest:a,label:h,onLabelChange:x,fields:C,form:N,currentSetupStep:F,hasSetupGuide:!!a.setupGuide,onOpenGuide:()=>b(!0)}),n==="test"&&e.jsx(hs,{isPending:w.isPending,isSuccess:w.isSuccess,isError:w.isError,errorMessage:(L=w.error)==null?void 0:L.message,botUsername:y,onRetry:W}),n==="confirm"&&e.jsx(N.Subscribe,{selector:V=>V.values,children:V=>{var D;return e.jsx(ms,{manifest:a,adapterId:v,isEditMode:o,values:V,botUsername:y,agentName:((D=E.find(Q=>Q.id===c))==null?void 0:D.name)||c})}})]},n)})]}),e.jsxs(ts,{className:"flex items-center justify-between sm:justify-between",children:[e.jsxs("div",{children:[(n==="test"||n==="confirm")&&e.jsxs(k,{variant:"ghost",onClick:T,disabled:q,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]}),n==="configure"&&(S?M>0:!o)&&e.jsxs(k,{variant:"ghost",onClick:T,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),n==="agent"&&e.jsxs(k,{onClick:z,disabled:!c,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="configure"&&e.jsxs(k,{onClick:z,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="test"&&!w.isPending&&!w.isSuccess&&e.jsx(k,{variant:"ghost",onClick:z,children:"Skip"}),n==="test"&&w.isSuccess&&e.jsxs(k,{onClick:z,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="confirm"&&e.jsxs(k,{onClick:B,disabled:q,children:[q&&e.jsx(ke,{className:"mr-2"}),o?"Save changes":"Connect"]})]})]})]})}),a.setupGuide&&e.jsx(gs,{open:d,onOpenChange:b,title:a.displayName,content:a.setupGuide})]})}export{qs as A,Bs as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,dh as F,di as G,G as b,ap as f,bw as v,dj as U,dk as $,dl as B,J as D,r as u,dm as E,B as W,X as V,dn as J,b as q,e as K,t as X,g as Y}from"./index-OQuvRZTD.js";import{u as Z,P as Q}from"./use-personality-commit-C3h8upDo.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-CXgYs25S.js";const H={hidden:{},visible:{transition:{staggerChildren:.04}}},I={hidden:{opacity:0,scale:.5},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:25}}};function _(){return e.jsx(f.span,{className:"pointer-events-none absolute inset-0 flex items-center justify-center",initial:{scale:0,opacity:1},animate:{scale:1,opacity:0},transition:{duration:.6,ease:[.34,1.56,.64,1]},"aria-hidden":!0,children:e.jsx(D,{className:"size-4 text-white drop-shadow-md",strokeWidth:3})})}function O({celebratory:s,className:t,children:a}){return s?e.jsx(f.div,{className:t,variants:H,initial:"hidden",animate:"visible",children:a}):e.jsx("div",{className:t,children:a})}function A({celebratory:s,children:t}){return s?e.jsx(f.div,{variants:I,children:t}):t}const ee=e.jsx("span",{className:"text-3xs leading-none font-bold",children:"A"}),te="ring-muted-foreground/50 ring-dashed ring-2 ring-offset-2",se="Select default color";function ae({value:s,autoColor:t,onSelect:a,onHoverChange:i,justSelectedKey:o,celebratory:n=!1,autoIcon:r=ee,autoActiveRing:c=te,autoLabel:d=se}){const x=s!=null;return e.jsxs(O,{celebratory:n,className:"flex flex-wrap items-center gap-2",children:[e.jsx(A,{celebratory:n,children:e.jsx(T,{active:!x,activeRing:c,color:t,label:d,tooltip:"Unique, derived from agent name",onClick:()=>a(null),onHoverChange:i,justSelected:o==="auto",celebratory:n,children:r})}),e.jsx("div",{className:"bg-border mx-0.5 h-5 w-px"}),F.map(l=>e.jsx(A,{celebratory:n,children:e.jsx(T,{active:s===l.hex,activeRing:"ring-foreground ring-2 ring-offset-2",color:l.hex,label:`Select ${l.name}`,tooltip:l.name,onClick:()=>a(l.hex),onHoverChange:i,justSelected:o===l.hex,celebratory:n})},l.hex))]})}function T({active:s,activeRing:t,color:a,label:i,tooltip:o,tooltipSide:n="bottom",onClick:r,onHoverChange:c,justSelected:d,celebratory:x,children:l}){const h=e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>c==null?void 0:c(a),onMouseLeave:()=>c==null?void 0:c(null),className:b("group/swatch relative size-8 rounded-full transition-[scale,box-shadow] duration-150",s?t:"hover:scale-110"),style:{backgroundColor:a},"aria-label":i,children:[l&&e.jsx("span",{className:"bg-background/80 text-foreground absolute inset-0 flex items-center justify-center rounded-full",children:l}),x&&e.jsx("span",{className:"absolute inset-[-4px] -z-10 rounded-full opacity-0 blur-md transition-opacity duration-200 group-hover/swatch:opacity-50",style:{backgroundColor:a},"aria-hidden":!0}),e.jsx(v,{children:d&&e.jsx(_,{})})]});return x?e.jsxs(U,{children:[e.jsx($,{asChild:!0,children:h}),e.jsx(B,{side:n,className:"text-3xs",children:o})]}):h}function ne({value:s,autoEmoji:t,hasOverride:a,onSelect:i,justSelectedKey:o,celebratory:n=!1}){return e.jsx(O,{celebratory:n,className:"grid grid-cols-6 gap-1.5",children:G.map(r=>{const c=r===s,d=r===t&&!a,x=b("relative flex size-9 items-center justify-center rounded-md text-lg transition-colors duration-150",c?b(d?"bg-accent ring-muted-foreground/50 ring-1":"bg-accent ring-foreground ring-1",d&&!n&&"ring-dashed"):"hover:bg-accent/50 active:scale-90");return e.jsx(ie,{celebratory:n,onClick:()=>i(r),className:x,ariaLabel:`Select icon ${r}`,justSelected:o===`emoji-${r}`,children:r},r)})})}function ie({celebratory:s,onClick:t,className:a,ariaLabel:i,justSelected:o,children:n}){const r=e.jsx(v,{children:o&&e.jsx(_,{})});return s?e.jsxs(f.button,{type:"button",onClick:t,className:a,"aria-label":i,variants:I,whileHover:{scale:1.25},whileTap:{scale:.85},transition:{type:"spring",stiffness:500,damping:20},children:[n,r]}):e.jsxs("button",{type:"button",onClick:t,className:a,"aria-label":i,children:[n,r]})}const re=e.jsx(J,{className:"size-3"}),oe="ring-muted-foreground/50 ring-2 ring-offset-2",ce="Select unique auto-generated color",C="dorkos:avatar-first-customization",le={hidden:{},visible:{transition:{staggerChildren:.04}}},w={hidden:{opacity:0,y:4},visible:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ue(){const[s]=u.useState(()=>Array.from({length:14},(a,i)=>{const o=Math.PI*2*i/14,n=28+Math.random()*20,r=360*i/14;return{x:Math.cos(o)*n,y:Math.sin(o)*n,size:3+Math.random()*3,hue:r,delay:i*.02}}));return e.jsx("div",{className:"pointer-events-none absolute inset-0 z-50 overflow-visible","aria-hidden":!0,children:s.map((t,a)=>e.jsx(f.span,{className:"absolute top-1/2 left-1/2 rounded-full",style:{width:t.size,height:t.size,background:`hsl(${t.hue}, 80%, 70%)`,boxShadow:`0 0 6px hsl(${t.hue}, 80%, 70%)`},initial:{x:"-50%",y:"-50%",scale:0,opacity:1},animate:{x:t.x,y:t.y,scale:1,opacity:0},transition:{duration:.6,ease:"easeOut",delay:t.delay}},a))})}function de({agent:s,onUpdate:t,onPreviewColor:a,title:i,onClose:o}){const n=u.useMemo(()=>E(s.id),[s.id]),r=n.color,c=n.icon,d=s.icon??c,x=s.color!=null,l=s.icon!=null,h=x||l,[y,S]=u.useState(null),p=u.useRef(null),[z,k]=u.useState(!1),N=u.useRef(!1);u.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=u.useCallback(()=>{if(!N.current){try{if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch{return}N.current=!0,k(!0),setTimeout(()=>k(!1),800)}},[]),j=u.useCallback(m=>{p.current&&clearTimeout(p.current),S(m),p.current=setTimeout(()=>S(null),600)},[]),R=u.useCallback(()=>{t({color:null,icon:null})},[t]),P=u.useCallback(m=>{t({color:m}),a(null),j(m??"auto"),g()},[t,a,j,g]),L=u.useCallback(m=>{t({icon:m===c?null:m}),j(`emoji-${m}`),g()},[t,c,j,g]),M=u.useCallback(m=>{a(m)},[a]);return e.jsxs("div",{className:"flex flex-1 flex-col overflow-auto","data-testid":"avatar-picker-panel",children:[(i||o||h)&&e.jsxs("div",{className:b("flex items-center justify-between px-4 py-2",(i||o)&&"border-b"),children:[i&&e.jsx("span",{className:"text-xs font-semibold",children:i}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx(v,{children:h&&e.jsx(f.button,{type:"button",onClick:R,className:"text-muted-foreground hover:text-foreground text-3xs transition-colors",initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},children:"Reset to defaults"})}),o&&e.jsx(W,{variant:"ghost",size:"icon-md",className:"size-6",onClick:o,"aria-label":"Close appearance picker",children:e.jsx(V,{className:"size-3.5"})})]})]}),e.jsxs(f.div,{className:"space-y-5 p-4",variants:le,initial:"hidden",animate:"visible",children:[e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Color"}),e.jsx(ae,{value:s.color,autoColor:r,onSelect:P,onHoverChange:M,justSelectedKey:y,celebratory:!0,autoIcon:re,autoActiveRing:oe,autoLabel:ce})]}),e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Icon"}),e.jsx(ne,{value:d,autoEmoji:c,hasOverride:l,onSelect:L,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(v,{children:z&&e.jsx(ue,{})})]})}function xe({children:s}){return e.jsx("h3",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:s})}function be({member:s}){const{agent:t,isPending:a,update:i}=q(s),o=Z(t,i),[n,r]=u.useState(null);if(a)return e.jsx(K,{className:"h-64 w-full"});if(!t)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s appearance."});const c=X(s),d=E(t.id),x=n??t.color??d.color,l=t.icon??d.icon;return e.jsxs("div",{className:"flex flex-col gap-5","data-slot":"profile-appearance",children:[e.jsx("div",{className:"flex justify-center pt-1",children:e.jsx(Y,{size:"lg",kind:c.kind,color:x,emoji:l,fallback:c.fallback,origin:c.origin})}),e.jsx(de,{agent:t,onUpdate:i,onPreviewColor:r}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(xe,{children:"Personality"}),e.jsx(Q,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{be as AppearancePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{as as o,at as c,j as t,ap as d,G as s,a0 as m,au as u,B as l}from"./index-OQuvRZTD.js";const x={initial:{opacity:0,y:8},animate:{opacity:1,y:0}};function h({signal:e}){const r=o(),n=c(e.since),a=e.kind==="error",i=a?m:u;return t.jsxs(d.div,{variants:x,"data-slot":"attention-signal-row",className:"hover:bg-accent/50 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1 transition-colors",children:[t.jsx("span",{className:s("size-1.5 shrink-0 rounded-full",a?"bg-status-error":"bg-status-warning"),"aria-hidden":!0}),t.jsx(i,{className:s("size-3.5 shrink-0",a?"text-status-error/70":"text-status-warning-fg"),"aria-hidden":!0}),t.jsxs("span",{className:"text-foreground/90 min-w-0 flex-1 truncate text-xs",children:[e.primary,e.secondary!==void 0&&t.jsxs("span",{className:"text-muted-foreground",children:[" · ",e.secondary]})]}),t.jsx("span",{className:"text-muted-foreground shrink-0 text-xs tabular-nums",children:n}),t.jsx(l,{variant:"ghost",size:"sm",className:"relative h-6 shrink-0 px-2 text-xs after:absolute after:-inset-3 md:after:hidden","aria-label":`Open ${e.primary}`,onClick:()=>void r.navigate({href:e.deepLink}),children:"Open →"})]})}export{h as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gR as v,gS as fe,gO as be,gT as Ce,j as e,bH as ee,bI as ne,bJ as te,bK as se,gU as Ne,bL as ae,gV as ie,bM as re,bN as ce,bP as oe,a1 as de,a3 as Ie,a4 as Te,a2 as Ae,y as le,gW as Se,r as A,gX as he,en as g,eg as S,eh as k,ei as R,ej as F,ek as b,gY as ke,gZ as Re,$ as E,_ as pe,aL as Fe,g_ as Oe,g$ as we,a5 as Me,cZ as De,d0 as Ee,d1 as Be,d3 as $e,d4 as _e,d5 as Le,ai as Pe,I as ze,h0 as Z,B,dN as He,h1 as qe,fh as Ye,h2 as Ge,x as Ke}from"./index-OQuvRZTD.js";import{B as Ue}from"./use-bindings-BLAWQRpe.js";import{u as We}from"./form-D93N5lrK.js";import{I as Qe,t as Ve}from"./trust-posture-Dn2ciEE0.js";function J(n){return`Turn on ${be(n.stop)}`}function Ze(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Je({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Ze(n):null;return e.jsx(ee,{open:n!==null,onOpenChange:C=>!C&&o(),children:e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Ne,{descriptor:n??void 0,className:`size-4 ${d}`}),n&&J(n)]}),e.jsxs(ae,{children:[n==null?void 0:n.promise,y&&" ",y&&e.jsx("span",{className:"text-foreground mt-2 block","data-testid":"consent-asks-note",children:y})]})]}),e.jsx("div",{className:"text-muted-foreground space-y-2 text-sm",children:i}),n&&e.jsx(ie,{mode:n.id,descriptor:n}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:h,children:n&&J(n)})]})]})})}function dn(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Ue]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Xe(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const X=[{value:"per-chat",label:"One shared chat per group or channel",description:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",description:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",description:"Nothing carries over from the message before."}],Y="claude-code";function ve({strategy:n,onStrategyChange:i,permissionMode:o,onPermissionModeChange:h,canInitiate:d,onCanInitiateChange:y,canReply:C,onCanReplyChange:O,canReceive:w,onCanReceiveChange:M,notifyOnTaskComplete:$,onNotifyOnTaskCompleteChange:_,notifyBootstrapHint:p,bridged:L,open:P,onOpenChange:z,hasChanges:H}){const u=X.find(l=>l.value===n),j=le(Y),c=(j==null?void 0:j.permissionModes.values)??[],r=c.find(l=>l.id===o),D=(r==null?void 0:r.label)??Se(o),[f,I]=A.useState(null);function q(l){const N=c.find(T=>T.id===l);if(N&&v(N)){I(N);return}h(l)}return e.jsxs(e.Fragment,{children:[e.jsxs(he,{open:P,onOpenChange:z,trigger:"Advanced",badge:H?e.jsx(pe,{variant:"secondary",children:"Modified"}):void 0,children:[L?e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{children:"How the agent remembers"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Kept in the channel this chat is linked to."})]}):e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(k,{id:"binding-session-strategy",className:"w-full",children:e.jsx(R,{})}),e.jsx(F,{children:X.map(l=>e.jsx(b,{value:l.value,children:l.label},l.value))})]}),u&&e.jsx("p",{className:"text-muted-foreground text-xs",children:u.description})]}),e.jsxs("div",{className:"space-y-2 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Permissions"}),c.length===0?e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",D,"”. No other levels to choose yet. Saving keeps it."]}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{mode:o,descriptors:c,onChangeMode:q,strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",D,"”. Saving keeps it, or pick a stop."]})}),e.jsx(ie,{mode:o,...r?{descriptor:r}:{},className:"px-1"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Message direction"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsxs(g,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(Re,{className:"text-muted-foreground size-3"}),"Agent can message first"]}),e.jsx(E,{id:"perm-initiate",checked:d,onCheckedChange:y,"aria-label":"Agent can message first"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"perm-reply",className:"cursor-pointer text-xs font-normal",children:"Agent can reply to messages"}),e.jsx(E,{id:"perm-reply",checked:C,onCheckedChange:O,"aria-label":"Agent can reply to messages"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"perm-receive",className:"cursor-pointer text-xs font-normal",children:"Agent receives new messages"}),e.jsx(E,{id:"perm-receive",checked:w,onCheckedChange:M,"aria-label":"Agent receives new messages"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Notifications"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"notify-task-complete",className:"cursor-pointer text-xs font-normal",children:"Message me when scheduled tasks finish"}),e.jsx(E,{id:"notify-task-complete",checked:$,onCheckedChange:_,"aria-label":"Message me when scheduled tasks finish"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When off, you still hear about runs that didn’t finish."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Needs “Agent can message first”."}),p&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Message your bot once to start. Bots can’t write first."})]})]}),e.jsx(Je,{descriptor:f,consequence:e.jsxs(e.Fragment,{children:["Anyone who can message this connection can make the agent act, with no one asked."," ",e.jsxs(Qe,{label:"About asking in the chat",title:"At a stop that asks",children:[e.jsx("p",{children:"Where your connection can show buttons, the agent waits for Approve or Deny."}),e.jsx("p",{children:"Only people on the approver list can answer."}),e.jsx("p",{children:"An ask nobody answers is refused after 10 minutes, and the agent carries on."})]})]}),onCancel:()=>I(null),onConfirm:()=>{f&&h(f.id),I(null)}})]})}const m="__any__",en={"per-chat":"One shared chat per group or channel","per-user":"One chat for each person",stateless:"No memory between messages"},me=[{value:"dm",label:"Direct message"},{value:"group",label:"Group"},{value:"channel",label:"Broadcast channel"},{value:"thread",label:"Thread"}];function ge(n){var i;return((i=me.find(o=>o.value===n))==null?void 0:i.label)??n}function nn({sessionStrategy:n,chatDisplayName:i,channelType:o}){const h=en[n];return i?`${h} in ${i}`:o?`${h} · ${ge(o)}`:h}function ln(n){return{adapterId:n.adapterId,agentId:n.agentId,sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId,channelType:n.channelType,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function hn(n){return{sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId??null,channelType:n.channelType??null,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function tn(n){return!!(n!=null&&n.canInitiate||(n==null?void 0:n.canReply)===!1||(n==null?void 0:n.canReceive)===!1||(n==null?void 0:n.notifyOnTaskComplete)===!1||(n==null?void 0:n.permissionMode)!==void 0&&n.permissionMode!=="acceptEdits"||n!=null&&n.sessionStrategy&&n.sessionStrategy!=="per-chat")}function sn(n,i){return{adapterId:(n==null?void 0:n.adapterId)??"",agentId:(n==null?void 0:n.agentId)??"",strategy:(n==null?void 0:n.sessionStrategy)??"per-chat",label:(n==null?void 0:n.label)??"",chatId:(n==null?void 0:n.chatId)??m,channelType:(n==null?void 0:n.channelType)??m,permissionMode:(n==null?void 0:n.permissionMode)??(i==null?void 0:i.defaultPermissionMode)??"acceptEdits",canInitiate:(n==null?void 0:n.canInitiate)??(i==null?void 0:i.defaultCanInitiate)??!1,canReply:(n==null?void 0:n.canReply)??!0,canReceive:(n==null?void 0:n.canReceive)??!0,notifyOnTaskComplete:(n==null?void 0:n.notifyOnTaskComplete)??!0}}function pn({open:n,onOpenChange:i,onConfirm:o,mode:h,initialValues:d,adapterName:y,agentName:C,onDelete:O,bindingId:w,isPending:M,bridged:$,bridgeSlot:_}){const p=h==="edit",[L,P]=A.useState(()=>!!(d!=null&&d.chatId||d!=null&&d.channelType)),[z,H]=A.useState(()=>tn(d)),{data:u}=Fe(),j=le(Y),[c]=A.useState(()=>{var t;return sn(d,p?void 0:{defaultPermissionMode:Oe(we(u==null?void 0:u.executionDefaults,Y),(j==null?void 0:j.permissionModes.values)??[]),defaultCanInitiate:u!=null&&Ve((t=u.permissions)==null?void 0:t.preset)==="trusted"})}),r=We({defaultValues:c,onSubmit:async({value:t})=>{await o({adapterId:t.adapterId,agentId:t.agentId,sessionStrategy:t.strategy,label:t.label,permissionMode:t.permissionMode,chatId:t.chatId===m?void 0:t.chatId,channelType:t.channelType===m?void 0:t.channelType,canInitiate:t.canInitiate,canReply:t.canReply,canReceive:t.canReceive,notifyOnTaskComplete:t.notifyOnTaskComplete}),p||r.reset()}}),{data:D=[]}=Me(),{data:f}=De(),[I,q]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Xe(I||void 0),N=D.flatMap(t=>t.instances.filter(x=>x.enabled).map(x=>({id:x.id,label:x.label?`${x.label} (${t.manifest.displayName})`:`${x.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function xe(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(Ee,{open:n,onOpenChange:i,children:e.jsxs(Be,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs($e,{className:"border-b px-4 py-3",children:[e.jsx(_e,{children:p?"Edit connection":"Add connection"}),e.jsx(Le,{className:"sr-only",children:p?"Edit this connection’s settings":"Connect this agent to a chat"})]}),e.jsx(r.Subscribe,{selector:t=>({values:t.values,isSubmitting:t.isSubmitting}),children:({values:t,isSubmitting:x})=>{var V;const G=p||!!t.adapterId&&!!t.agentId,ue=!p||t.adapterId!==c.adapterId||t.agentId!==c.agentId||t.strategy!==c.strategy||t.label!==c.label||t.chatId!==c.chatId||t.channelType!==c.channelType||t.permissionMode!==c.permissionMode||t.canInitiate!==c.canInitiate||t.canReply!==c.canReply||t.canReceive!==c.canReceive||t.notifyOnTaskComplete!==c.notifyOnTaskComplete,K=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,U=G&&K?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${K}.`:null,W=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!G||!ue||!!M||x,Q=!!M||x;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[p?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connection:"," ",e.jsx("span",{className:"text-foreground font-medium",children:y})," →"," ",e.jsx("span",{className:"text-foreground font-medium",children:C})]}),_]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-adapter",children:"Source"}),N.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"Nothing set up yet"}):e.jsx(r.AppField,{name:"adapterId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:a=>{s.handleChange(a),q(a)},children:[e.jsx(k,{id:"binding-adapter",className:"w-full",children:e.jsx(R,{placeholder:"Pick a source"})}),e.jsx(F,{children:N.map(a=>e.jsx(b,{value:a.id,children:a.label},a.id))})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-agent",children:"Agent"}),T.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"No agents yet"}):e.jsx(r.AppField,{name:"agentId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-agent",className:"w-full",children:e.jsx(R,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Pe(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(ze,{id:"binding-label",placeholder:"e.g., Customer support bot",value:s.state.value,onBlur:s.handleBlur,onChange:a=>s.handleChange(a.target.value)}),e.jsx(Z,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:W?e.jsx(pe,{variant:"secondary",children:"Active"}):void 0,children:[e.jsx(r.AppField,{name:"chatId",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-chat-id",className:"w-full",children:e.jsx(R,{placeholder:"Any chat"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any chat"}),l.map(a=>e.jsxs(b,{value:a.chatId,children:[e.jsx("span",{children:a.displayName??a.chatId}),(a.channelType||a.messageCount>0)&&e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:[a.channelType?ge(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(Z,{children:"Only take messages from this chat"})]})}),e.jsx(r.AppField,{name:"channelType",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-channel-type",className:"w-full",children:e.jsx(R,{placeholder:"Any type"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any type"}),me.map(a=>e.jsx(b,{value:a.value,children:a.label},a.value))]})]})]})}),W&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:xe,children:"Clear filters"})})]}),e.jsx(ve,{strategy:t.strategy,onStrategyChange:s=>r.setFieldValue("strategy",s),permissionMode:t.permissionMode,onPermissionModeChange:s=>r.setFieldValue("permissionMode",s),canInitiate:t.canInitiate,onCanInitiateChange:s=>r.setFieldValue("canInitiate",s),canReply:t.canReply,onCanReplyChange:s=>r.setFieldValue("canReply",s),canReceive:t.canReceive,onCanReceiveChange:s=>r.setFieldValue("canReceive",s),notifyOnTaskComplete:t.notifyOnTaskComplete,onNotifyOnTaskCompleteChange:s=>r.setFieldValue("notifyOnTaskComplete",s),notifyBootstrapHint:l.length===0,bridged:$,open:z,onOpenChange:H,hasChanges:ye}),U&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:U})]}),e.jsxs(He,{className:"border-t px-4 py-3",children:[p&&O&&w&&e.jsxs(ee,{children:[e.jsx(qe,{asChild:!0,children:e.jsxs(B,{variant:"ghost",size:"sm",className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950",children:[e.jsx(Ye,{className:"mr-1.5 size-3.5"}),"Remove"]})}),e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsx(se,{children:"Remove this connection?"}),e.jsx(ae,{children:"This agent stops getting messages from it."})]}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:()=>O(w),className:Ge({variant:"destructive"}),children:"Remove connection"})]})]})]}),e.jsx(B,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsxs(B,{size:"sm",onClick:()=>r.handleSubmit(),disabled:je,children:[Q&&e.jsx(Ke,{size:"xs",className:"mr-1.5"}),Q?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{pn as B,dn as a,nn as b,ln as c,ge as d,hn as t,Xe as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-BeCubxHV.js","assets/index-OQuvRZTD.js","assets/index-Dry_agqN.css","assets/index-BkJlIXqM.js","assets/index-1QfQImuJ.js","assets/BlintzCanvas-DruVZcDU.js","assets/index-QSXJR98z.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as a,aW as z,h7 as ce,j as t,G as O,g0 as oe,g1 as le,B as D,g2 as ue,g3 as de,g4 as X,h8 as fe,dj as he,dk as pe,J as me,gh as ve,dl as xe,a3 as ge,h9 as be,aX as ee,a1 as ye,ha as je,a2 as Ce}from"./index-OQuvRZTD.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-CpgE7tFb.js";import{R as Te}from"./rotate-cw-B8WQa8O-.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CAeUe7uQ.js";import"./WidgetErrorCard-BlqaIsPK.js";import"./index-CoKNU2F9.js";import"./card-DUmTNXJJ.js";import"./progress-77FCPL2y.js";import"./markdown-content-Cjhsscbn.js";import"./table-D9ww_3Ij.js";import"./package-sPggO7Dr.js";import"./heart-BavUIV45.js";import"./git-branch-B8JNwQ6q.js";import"./file-text-Ds9edaTZ.js";import"./file-D80JE_L0.js";import"./McpAppFrame-D15nxVaI.js";import"./more-details-CRLU2HN4.js";function B(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=z.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function Z({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(X,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(X,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(Z,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(Z,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const Ee=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-BeCubxHV.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ze=a.lazy(()=>ee(()=>import("./BlintzCanvas-DruVZcDU.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Be=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),E=a.useRef(null),V=a.useRef(C),Y=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:E,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,V.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=E.current)==null||k.cancel(),E.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Be)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const q=N.confirmed;q.content===S.current&&w.setQueryData(B(d,e.sourcePath),Q=>Q&&{...Q,content:q.content,hash:q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=E.current)==null||v.cancel(),E.current=null)},[s]),a.useEffect(()=>{const v=Y.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=E.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),E.current=null,y(r,!1),V.current(!1)}},[r,y,Y]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(B(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},W=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),J=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&W&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:W}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ze,{value:J,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(Ee,{value:J,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function at({content:e,documentId:r}){const d=ye(),n=z(g=>g.selectedCwd),o=z(g=>g.setDocumentEditing),s=z(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=z(g=>g.canvasSessionId),b=z(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:B(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{at as CanvasFileContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-RGXeJd6a.js","assets/index-OQuvRZTD.js","assets/index-Dry_agqN.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a1 as m,aW as n,r as s,j as t,aX as p}from"./index-OQuvRZTD.js";import{r as u}from"./use-session-canvas-CpgE7tFb.js";import"./rotate-cw-B8WQa8O-.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CAeUe7uQ.js";import"./WidgetErrorCard-BlqaIsPK.js";import"./index-CoKNU2F9.js";import"./card-DUmTNXJJ.js";import"./progress-77FCPL2y.js";import"./markdown-content-Cjhsscbn.js";import"./table-D9ww_3Ij.js";import"./package-sPggO7Dr.js";import"./heart-BavUIV45.js";import"./git-branch-B8JNwQ6q.js";import"./file-text-Ds9edaTZ.js";import"./file-D80JE_L0.js";import"./McpAppFrame-D15nxVaI.js";import"./more-details-CRLU2HN4.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-RGXeJd6a.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var o;const r=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function A({content:e}){const r=m(),o=n(i=>i.selectedCwd),l=s.useMemo(()=>u(e.src,i=>r.mediaUrl(o??"",i)),[e.src,r,o]),a=s.useMemo(()=>f(e.src),[e.src]);return l.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(d,{url:l.url,format:a,label:e.title??"Canvas 3D model"})})})}export{A as CanvasModel3dContent,f as formatOf};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B36osK_S.js","assets/index-OQuvRZTD.js","assets/index-Dry_agqN.css","assets/room-files-source-B0gc97Ri.js","assets/markdown-content-Cjhsscbn.js","assets/file-exclamation-point-CcJ_e4_m.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-n_pnc-CO.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-B8WQa8O-.js","assets/link-2-yI2Tlm7Q.js","assets/file-D80JE_L0.js","assets/git-branch-B8JNwQ6q.js","assets/more-details-CRLU2HN4.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{O as F,r as c,j as l,B as ue,h4 as kn,n2 as wn,g as In,k4 as Nn,G as te,a1 as fe,a3 as Fe,a4 as Le,aN as H,ch as Be,ci as Rn,cX as Cn,n3 as An,lB as Mn,n4 as Sn,h as jn,av as _n,co as Ue,gw as se,q as Z,dD as He,s as pe,l$ as On,n5 as En,mF as Tn,n6 as $n,eR as Dn,g8 as Pn,Y as Fn,e2 as Ln,n0 as Bn,n7 as Un,n8 as Hn,a0 as Kn,bv as qn,n9 as Wn,na as zn,ju as Vn,it as Gn,gB as Yn,kV as Ne,nb as Ke,bU as Jn,kU as X,kY as qe,nc as Xn,cg as ge,ag as Qn,bY as he,im as We,nd as Zn,cs as ze,ne as et,fe as nt,kl as Ve,nf as Ge,aX as tt,gy as Ye,kX as st,ng as Je,nh as ot,ni as at,nj as rt,nk as Re,eT as it,nl as ct,nm as lt,nn as dt,no as ut,np as mt,nq as ft,l as pt,hh as gt,ap as Xe,kM as ht,ah as xt,nr as yt,ns as bt,nt as vt,b6 as kt,c4 as wt,nu as It,nv as Nt,nw as Rt,nx as Ct,bw as Ce,f2 as At}from"./index-OQuvRZTD.js";import{g as Ae,m as Me,h as xe,f as Qe,M as Mt,a as St,E as jt,i as _t,j as Ot,c as P,k as Et,b as Tt,l as $t,u as Dt,C as Pt}from"./registry-BzXBOE9h.js";import"./WidgetErrorCard-BlqaIsPK.js";import{R as Ft,A as Ze}from"./repeat-CHmB_vD7.js";import{u as Lt}from"./use-room-sessions-Bzk7rM40.js";import{M as Bt}from"./markdown-content-Cjhsscbn.js";import{W as Ut,a as Ht}from"./find-latest-widget-fence-BtqFMP_f.js";import{f as Kt}from"./format-duration-BCr6uzby.js";import{H as qt,a as Wt,b as zt}from"./RuntimeSetupDialog-D6L1QhMF.js";import{M as Se}from"./mention-pill-BsOeTJ2f.js";import{R as Vt}from"./rotate-ccw-clock-CCU6SVnv.js";import{U as Gt}from"./unplug-BZ8zSvfB.js";import{M as je}from"./message-square-off-aV4NMCjd.js";import{i as Yt}from"./registry-sfhDu9q2.js";/**
|
|
3
|
-
* @license lucide-react v1.48.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const en={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};en.node;const Jt=F(en);/**
|
|
8
|
-
* @license lucide-react v1.48.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const nn={name:"link-2-off",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]};nn.node;const Xt=F(nn);/**
|
|
13
|
-
* @license lucide-react v1.48.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const tn={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};tn.node;const Qt=F(tn);/**
|
|
18
|
-
* @license lucide-react v1.48.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const sn={name:"power-off",size:24,node:[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};sn.node;const Zt=F(sn);/**
|
|
23
|
-
* @license lucide-react v1.48.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const on={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};on.node;const es=F(on);/**
|
|
28
|
-
* @license lucide-react v1.48.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const an={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};an.node;const ns=F(an);/**
|
|
33
|
-
* @license lucide-react v1.48.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const rn={name:"user-minus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};rn.node;const _e=F(rn);/**
|
|
38
|
-
* @license lucide-react v1.48.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const cn={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};cn.node;const ts=F(cn),ss='[data-slot="identity-hover-card-actions"] button:not(:disabled)';function os(e){const{open:t,setOpen:s,triggerRef:n,enabled:o}=e,a=c.useRef(null),r=c.useRef(!1);c.useEffect(()=>{if(!t||!r.current)return;r.current=!1;let u=0,x=0;const v=()=>{var f;const m=(f=a.current)==null?void 0:f.querySelector(ss);if(m)return m.focus();++u<10&&(x=requestAnimationFrame(v))};return v(),()=>cancelAnimationFrame(x)},[t]);const i=c.useCallback(u=>{var x;!u&&((x=a.current)!=null&&x.contains(document.activeElement))||s(u)},[s]),d=c.useCallback(u=>{!o||u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),r.current=!0,s(!0))},[o,s]),p=c.useMemo(()=>({onEscapeKeyDown:()=>{var u;return(u=n.current)==null?void 0:u.focus()},onBlur:u=>{var v,m,f;const x=u.relatedTarget;x&&((v=a.current)!=null&&v.contains(x)||(m=n.current)!=null&&m.contains(x))||(f=a.current)!=null&&f.contains(document.activeElement)||s(!1)}}),[s,n]);return{contentRef:a,handleOpenChange:i,onTriggerKeyDown:d,contentHandlers:p}}function ce(e){const t=e.key==="ArrowRight"||e.key==="ArrowDown",s=e.key==="ArrowLeft"||e.key==="ArrowUp",n=e.key==="Tab";if(!t&&!s&&!n)return;const o=e.currentTarget.closest('[data-slot="identity-hover-card-actions"]');if(!o)return;const a=Array.from(o.querySelectorAll("button:not(:disabled)")),r=a.indexOf(document.activeElement);if(r===-1||a.length===0)return;e.preventDefault();const i=s||n&&e.shiftKey?-1:1;a[(r+i+a.length)%a.length].focus()}function as({kind:e,about:t}){const n=[e==="agent"?"Agent":e==="human"?"Person":null,t.role].filter(Boolean).join(" · ");return!n&&!t.status?null:l.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 px-3 pb-3","data-slot":"identity-hover-card-about",children:[n&&l.jsx("p",{className:"text-muted-foreground truncate text-xs",title:n,children:n}),t.status&&l.jsx("p",{className:"text-foreground/80 truncate text-xs","data-slot":"identity-hover-card-status",children:t.status})]})}function rs({actions:e,onAct:t}){const s=n=>()=>{t(),n()};return l.jsxs("div",{className:"border-border mt-auto flex flex-col gap-2 border-t p-3","data-slot":"identity-hover-card-actions",role:"group","aria-label":"Actions",children:[l.jsxs("div",{className:"flex gap-2",children:[e.onMessage&&l.jsx(ue,{size:"xs",className:"flex-1",onClick:s(e.onMessage),onKeyDown:ce,children:"Message"}),e.onViewProfile&&l.jsx(ue,{size:"xs",variant:"outline",className:"flex-1",onClick:s(e.onViewProfile),onKeyDown:ce,children:"Profile"})]}),e.session&&l.jsxs("button",{type:"button","data-slot":"identity-hover-card-session",onClick:s(e.session.onOpen),onKeyDown:ce,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[l.jsx(kn,{className:"size-3.5 shrink-0","aria-hidden":!0}),l.jsx("span",{className:"truncate",children:e.session.label})]})]})}const is=300;function G({className:e,children:t}){return l.jsx("span",{className:te("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:t})}function ye({identity:e,children:t,onViewProfile:s,about:n,actions:o,onOpenChange:a,openOnClick:r=!1,className:i}){const{kind:d,displayName:p,handle:u,color:x,emoji:v,imageUrl:m,origin:f,agent:g}=e,w=x??"hsl(var(--muted-foreground))",h=typeof f=="object"&&f!==null,y=d==="agent"&&(g==null?void 0:g.working)!=null?g.working:null,[I,S]=c.useState(!1),M=c.useCallback(k=>{S(k),a==null||a(k)},[a]),C=c.useRef(!1),N=c.useRef(null),A=wn({onLongPress:()=>{C.current&&M(!0)}}),{contentRef:_,handleOpenChange:j,onTriggerKeyDown:b,contentHandlers:O}=os({open:I,setOpen:M,triggerRef:N,enabled:r&&o!==void 0});return l.jsxs(qt,{open:I,onOpenChange:j,openDelay:is,children:[l.jsx(Wt,{asChild:!0,ref:N,"data-gesture-priority":"",...A,onPointerDown:k=>{C.current=k.pointerType==="touch"||k.pointerType==="pen",A.onPointerDown(k)},...r?{onClick:()=>M(!0),onKeyDown:b}:{},children:t}),l.jsxs(zt,{ref:_,...O,...o?{role:"dialog","aria-label":p}:{},"data-slot":"identity-hover-card",align:"start",className:te("flex w-64 flex-col gap-0 overflow-hidden p-0",i),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",children:[l.jsx(In,{"aria-hidden":!0,color:w,emoji:v,imageUrl:m,fallback:Nn(p),kind:d,origin:f,status:y?"working":"idle",size:"md"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:p}),u&&l.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",u]})]})]}),n&&l.jsx(as,{kind:d,about:n}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[d==="agent"&&((g==null?void 0:g.runtime)||(g==null?void 0:g.model))&&l.jsx(G,{children:[g.runtime,g.model].filter(Boolean).join(" · ")}),y&&l.jsxs(G,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Kt(y.forMs)]}),d==="human"&&l.jsx(G,{children:h?f.platform:"On this machine"}),d==="agent"&&(g==null?void 0:g.managedBy)&&l.jsxs(G,{children:["Managed by"," ",g.managedBy.handle?`@${g.managedBy.handle}`:g.managedBy.displayName]})]}),o?l.jsx(rs,{actions:o,onAct:()=>{var k;(k=N.current)==null||k.focus(),M(!1)}}):s?l.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var k;(k=N.current)==null||k.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):l.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),l.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function cs(){const e=fe(),t=Fe();return Le({onMutate:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var u;const r=t.getQueryData(H.entries(s)),i=(u=r==null?void 0:r.find(x=>x.id===n))==null?void 0:u.reactions,{reactions:d,on:p}=Ae(i,o,a);return t.setQueryData(H.entries(s),x=>Me(x,n,d)),{on:p}},mutationFn:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var d,p;const r=t.getQueryData(H.entries(s)),i=((p=(d=r==null?void 0:r.find(u=>u.id===n))==null?void 0:d.reactions)==null?void 0:p.some(u=>u.emoji===o&&u.authorIds.includes(a)))??!1;return e.toggleReaction(s,n,{emoji:o,on:i})},onError:(s,{roomId:n,entryId:o,emoji:a,viewerAuthorId:r},i)=>{i!==void 0&&t.setQueryData(H.entries(n),d=>{var x;const p=(x=d==null?void 0:d.find(v=>v.id===o))==null?void 0:x.reactions,{reactions:u}=Ae(p,a,r,!i.on);return Me(d,o,u)})},onSuccess:({frequents:s},{roomId:n})=>{t.setQueryData(H.detail(n),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function q(e){return e.threadRootEntryId??e.parentEntryId}function ls(e){return q(e)??e.id}function ds(e,t){return Math.max(t??0,e)}function na(e,t,s){let n=e[0],o=0;for(const a of e)a.seq>n.seq&&(n=a),t!==null&&a.seq>t&&(o+=1);return{count:ds(e.length,s),lastAt:n.createdAt,unread:o}}function us(e){var M,C;const{agentPath:t,displayName:s,onViewProfile:n,engaged:o}=e,a=Be(),r=Rn(),i=a&&o&&t!==void 0,d=Cn(i?t:null),p=An(d.member),u=Mn(),x=Sn(),v=jn(),m=_n(),{data:f}=Ue({enabled:i&&r}),g=m.status==="ready"?m.roomId:null,w=f==null?void 0:f.find(N=>N.id===g),h=w?se(w):null,y=(C=(M=d.member)==null?void 0:M.agent)==null?void 0:C.effectiveRuntimeId,I=c.useCallback(()=>{t!==void 0&&(Z.getState().recordOpened("agent",t),u({agentPath:t},y?{runtime:y}:{}))},[t,u,y]),S=c.useCallback(async()=>{if(t===void 0||!v)return;const N=await x(t);if(N===null){He(`${s} has no session in ${h??"this room"} yet`);return}v(pe({session:N}))},[t,v,x,s,h]);return c.useMemo(()=>!a||t===void 0?null:{about:{role:d.role,status:p},actions:{onMessage:I,...n?{onViewProfile:n}:{},...r&&h?{session:{label:`Session in ${h}`,onOpen:()=>void S()}}:{}}},[a,t,d.role,p,I,n,r,h,S])}function ms({identity:e,agentPath:t,onViewProfile:s,openOnClick:n=!1,children:o}){const[a,r]=c.useState(!1),i=us({agentPath:t,displayName:e.displayName,onViewProfile:s,engaged:a}),d=c.useCallback(p=>{p&&r(!0)},[]);return l.jsx(ye,{identity:e,onViewProfile:s,onOpenChange:d,openOnClick:n&&i!==null,...i?{about:i.about,actions:i.actions}:{},children:o})}function fs(e){return l.jsx(Ht,{code:e.code,isIncomplete:e.isIncomplete})}const ps=[{language:Ut,component:fs}],gs={turn_failed:{Icon:Kn,tone:"text-status-warning"},agent_busy:{Icon:Hn},agent_gone:{Icon:ts,tone:"text-status-warning"},agent_left:{Icon:_e,tone:"text-status-warning"},room_archived:{Icon:Un},agent_reseated:{Icon:Bn},handle_changed:{Icon:Ze},files_set_up:{Icon:Ln},handoff_shared:{Icon:Fn},handoff_declined:{Icon:je},runtime_gone:{Icon:Zt,tone:"text-status-warning"},agent_paused:{Icon:Pn},agent_declined:{Icon:je},agent_unavailable:{Icon:Dn},awaiting_approval:{Icon:Jt,tone:"text-status-warning"},halted:{Icon:$n},budget_reached:{Icon:Tn},cascade_stopped:{Icon:En},addressing_changed:{Icon:Qt},bridge_blocked:{Icon:Gt,tone:"text-status-warning"},bridge_undelivered:{Icon:On,tone:"text-status-warning"},bridge_rate_limited:{Icon:ns},bridge_second_agent_refused:{Icon:_e},bridge_disconnected:{Icon:Xt},bridge_agent_swapped:{Icon:Ft},bridge_history_note:{Icon:Vt}},hs={Icon:qn},le=80;function xs(e){const t=e.trim();if(t.length<=le)return t;const s=t.slice(0,le),n=s.lastIndexOf(" ");return`${(n>le/2?s.slice(0,n):s).trimEnd()}…`}function ys(e,t,s){const n=bs(e,s),o=a=>l.jsx("a",{href:t.href,onClick:t.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-2",children:a});return n===null?l.jsxs(l.Fragment,{children:[e," ",o("Open chat")]}):l.jsxs(l.Fragment,{children:[e.slice(0,n.index),o(n.words),e.slice(n.index+n.words.length)]})}function bs(e,t){if(t!==void 0){const n=Wn(t),o=e.lastIndexOf(n);if(o!==-1)return{index:o,words:n}}const s=zn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function vs({entry:e,feedPosition:t,rowId:s,sessionLink:n,subjectName:o}){const{Icon:a,tone:r}=(e.body.notice&&gs[e.body.notice])??hs;return l.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...t&&{role:"article","aria-label":xs(e.body.text)},...xe(t),className:te("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",r??"text-muted-foreground"),children:[l.jsx(a,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),l.jsx("span",{children:n?ys(e.body.text,n,o):e.body.text})]})}const ks=Yt.moment;function ws({entry:e,moment:t,subject:s,subjectIdentity:n,feedPosition:o,rowId:a}){const r=Qe(e.createdAt);return l.jsx("div",{id:a,"data-slot":"moment-row","data-testid":"room-moment","data-moment":t.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...xe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:l.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[l.jsx(ye,{identity:{kind:s.kind,displayName:s.displayName,handle:n==null?void 0:n.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:n==null?void 0:n.origin,agent:n==null?void 0:n.agent},children:l.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[l.jsx(Mt,{author:s}),l.jsx("span",{className:"sr-only",children:s.displayName})]})}),l.jsx(ks,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),l.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),r.length>0&&l.jsx("time",{dateTime:e.createdAt,title:St(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:r})]})})}function Is(e,t){const s=X.getState(),n=s.drafts[e]??"",o=n===""||n.endsWith(" ")||n.endsWith(`
|
|
43
|
-
`)?"":" ";s.set(e,`${n}${o}@${t} `)}function Ns({roomId:e,entry:t,author:s,viewerAuthorId:n,onViewProfile:o}){const a=ls(t),r=t.body.text,i=(s==null?void 0:s.id)===n?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:p}=Vn({toastOnSettle:!0});return c.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:es,run:()=>{Yn.getState().openThread(e,a,!0),Ne.getState().requestFocus(Ke(e,a))}},copy:{id:"copy",label:"Copy text",icon:Gn,run:()=>void p(r)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:Jn,run:o}),i!==void 0&&(u.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:Ze,run:()=>{Is(e,i),Ne.getState().requestFocus(e)}}),jt.map(x=>u[x]).filter(x=>x!==void 0)},[e,a,r,i,d,o,p])}function Rs(e){if(e.kind==="notice")return{kind:"notice"};const t=e.body.moment;return t?{kind:"moment",moment:t}:{kind:"message"}}function ta(e,t=[]){return new Map([...t.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function sa(e,t){const s=e.body.subjectAuthorId;return s===void 0||t.has(e.authorId)?e.authorId:s}function Cs(e,t,s){const n=t.get(e),o=qe({record:{kind:(n==null?void 0:n.kind)??"system",id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:n==null?void 0:n.emoji,color:n==null?void 0:n.color,imageUrl:n==null?void 0:n.imageUrl},override:(n==null?void 0:n.agentRef)===void 0?null:s==null?void 0:s.get(n.agentRef)});return{kind:o.kind,id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(n==null?void 0:n.origin)=="object"&&(n==null?void 0:n.origin)!==null,...(n==null?void 0:n.retired)===!0?{retired:!0}:{}}}function oa(e){const t=new Set;for(const a of e)q(a)===null&&t.add(a.id);const s=[],n=new Map,o=new Set;for(const a of e){const r=q(a);if(r===null){s.push(a);continue}if(!t.has(r)){s.push(a),o.add(a.id);continue}const i=n.get(r);i?i.push(a):n.set(r,[a])}return{topLevel:s,repliesByRoot:n,orphaned:o}}function As(e){return`thread-${e}`}function Ms(e){return`thread-row-${e}`}function aa(e){return`thread-panel-entry-${e}`}function Ss(e){return`room-entry-${e}`}function js(e,t){const s=e.find(i=>i.id===t);if(s===void 0)return null;const n=q(s)??null,o={rowId:t,domId:Ss(t)};if(n===null)return o;const a=e.find(i=>i.id===n);return a!==void 0&&(q(a)??null)===null?{rowId:As(n),domId:Ms(n)}:o}function ra(e,t){if(t===null)return null;const s=e.find(n=>n.seq===t);return s===void 0?null:js(e,s.id)}const Oe=48;function ia(e,t,s){const n=e.body.answersEntryId;if(n===void 0||n===e.id||t!==void 0&&t.id===n)return null;const o=s(n);if(o===void 0)return null;const a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:n,excerpt:a.length>Oe?`${a.slice(0,Oe).trimEnd()}…`:a}}function _s(e,t){const s=new Map;for(const n of e){const o=t[n.projectPath];if(!o)continue;const a=Xn({runtime:o.runtime,model:o.model});s.set(ge(n.projectPath),{memberId:n.id,visual:Qn(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function Os(e){const t=new Map;for(const[s,n]of e)t.set(s,n.visual);return t}const Es={info:new Map,faces:new Map},be=c.createContext(Es);function ca({known:e,children:t}){return l.jsx(be.Provider,{value:e,children:t})}function la(){const e=he(),t=c.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=c.useMemo(()=>t.map(r=>r.projectPath),[t]),n=We(s),o=c.useMemo(()=>_s(t,n.data??{}),[t,n.data]),a=c.useMemo(()=>Os(o),[o]);return c.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const t=c.useContext(be);return e===void 0?void 0:t.info.get(e)}function Ts(){return c.useContext(be).faces}function $s({showAuthorHeader:e,headerId:t,displayName:s,time:n,summary:o,contentId:a,summaryId:r,feedPosition:i}){return{...e?{"aria-labelledby":t}:{"aria-label":n.length>0?`${s}, ${n}`:s},"aria-describedby":o===null?a:r,...xe(i)}}const Q=120,Ds="code block";function Ps(e){if(e.length<=Q&&!e.includes("```"))return null;const t=Fs(e);return t.length===0?null:t}function Fs(e){const t=e.replace(/```[\s\S]*?(?:```|$)/g,` ${Ds} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(t.length<=Q)return t;const s=Ls(t,Q),n=s.lastIndexOf(" ");return`${(n>Q/2?s.slice(0,n):s).trimEnd()}…`}function Ls(e,t){if(typeof Intl.Segmenter=="function"){const n=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of n.segment(e)){if(o.length+a.length>t)break;o+=a}return o}let s="";for(const n of e){if(s.length+n.length>t)break;s+=n}return s}function Bs({roomId:e,entry:t,viewerAuthorId:s,reactionFrequents:n,streamStalled:o,isMember:a=!0}){const r=cs(),i=o===!0||!a,d=c.useMemo(()=>t.reactions??[],[t.reactions]),p=c.useMemo(()=>d.filter(v=>_t(v,s)).map(v=>v.emoji),[d,s]),u=c.useCallback(v=>r.mutate({roomId:e,entryId:t.id,emoji:v,viewerAuthorId:s}),[r,e,t.id,s]),x=c.useMemo(()=>({quick:n,mine:p,onToggle:u,disabled:i}),[n,p,u,i]);return{reactions:d,toggle:u,quickRow:x}}function Us({barRef:e,pillsRef:t,hasReactions:s}){return n=>{var a,r;if(n.target!==n.currentTarget)return;const{key:o}=n;if(o==="ArrowDown"&&s){n.preventDefault(),(a=t.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(n.preventDefault(),(r=e.current)==null||r.focusFirst())}}function Hs(e,t){var x,v;const s=t.body.subjectAuthorId,n=t.body.notice,o=t.kind==="notice"&&n!==void 0&&s!==void 0&&Zn.includes(n),a=Lt(e,{enabled:o}),r=ze(),i=Fe(),d=fe(),p=o?((v=(x=a.data)==null?void 0:x.bindings.find(m=>m.authorId===s))==null?void 0:v.sessionId)??null:null,u=c.useCallback(m=>{m.button!==0||m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||(m.preventDefault(),!(p===null||s===void 0)&&et({queryClient:i,transport:d},e,s).then(f=>{f.kind!=="none"&&r(pe({session:f.kind==="bound"?f.sessionId:p}))}))},[s,r,i,e,p,d]);return c.useMemo(()=>p===null?null:{href:nt({session:p}),onOpen:u},[u,p])}const ne="mention",ve="author_id",Ks={[ne]:[ve]},qs=[ne];function Ws(e,t){if(!t||t.length===0)return e;const s=zs(e,t);if(s.length===0)return e;let n=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:i}=s[o],d=n.slice(0,a),p=n.slice(a,a+r),u=n.slice(a+r);n=`${d}<${ne} ${ve}="${i}">${p}</${ne}>${u}`}return n}function zs(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(n.push(a),o=a.offset+a.length);return n}const Vs=/^[\s,&+/]*(?:and[\s,&+/]+)?$/i;function Gs(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=new Set;let o=!0;return s.map((a,r)=>{if(o&&r>0){const i=s[r-1];o=Vs.test(e.slice(i.offset+i.length,a.offset))}return o&&n.add(a.authorId),n.has(a.authorId)?a:{...a,cc:!0}})}function Ys(e){const t=new Set(e.filter(n=>!n.cc).map(n=>n.authorId)),s=[];for(const n of e)n.cc&&!t.has(n.authorId)&&!s.includes(n.authorId)&&s.push(n.authorId);return s}const Js=new Map,ln=c.createContext(Js);function Xs({authors:e,children:t}){return l.jsx(ln.Provider,{value:e,children:t})}function Qs(e){const t=c.useContext(ln);return e===void 0?void 0:t.get(e)}const Ee=new WeakMap;function Zs(e){const t=Ee.get(e);if(t)return t;const s=new Map(e.map(n=>[ge(n.projectPath),n.projectPath]));return Ee.set(e,s),s}function eo(e){var n;const s=(n=he().data)==null?void 0:n.agents;return c.useMemo(()=>e===void 0||!s?void 0:Zs(s).get(e),[s,e])}function dn(e){const{agentRef:t,identity:s,onViewProfile:n}=e,o=Be(),a=eo(o?t:void 0),r=ee(t);return c.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const i={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(p,u={})=>l.jsx(ms,{identity:i,agentPath:a,onViewProfile:n,openOnClick:u.openOnClick??!1,children:p});return{wrap:d,wrapAvatar:p=>d(l.jsx("button",{type:"button",tabIndex:-1,"aria-label":s.displayName,"aria-haspopup":"dialog",className:"focus-ring inline-flex cursor-pointer rounded-sm","data-slot":"room-agent-card-face",children:p}),{openOnClick:!0}),wrapName:p=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:te(p.props.className,"focus-ring cursor-pointer rounded-sm text-left underline-offset-4 hover:underline"),"data-slot":"room-agent-card-name",children:s.displayName}),{openOnClick:!0})}},[o,s,a,r,n])}const no={kind:"human",displayName:""};function to(e){return typeof e=="string"?e.replace(/^@/,""):""}function so({authorId:e,children:t,cc:s}){const n=Qs(e),o=ee(n==null?void 0:n.agentRef),{open:a}=Ve(),r=n?qe({record:n,override:o==null?void 0:o.visual}):null,i=n?Ge(n,o==null?void 0:o.memberId):void 0,d=c.useMemo(()=>i===void 0?void 0:()=>a(i),[i,a]),p=r==null?void 0:r.color,u=r==null?void 0:r.emoji,x=r==null?void 0:r.imageUrl,v=c.useMemo(()=>n?{kind:n.kind,displayName:n.displayName,handle:n.handle??void 0,color:p,emoji:u,imageUrl:x,origin:n.origin,agent:o&&{runtime:o.runtime,...o.model&&{model:o.model}}}:null,[n,p,u,x,o]),m=dn({agentRef:n==null?void 0:n.agentRef,identity:v??no,onViewProfile:d});if(!n||!v)return l.jsx(Se,{kind:"human",label:to(t),resolved:!1});const g=m?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:d?{role:"button",tabIndex:0,"aria-label":`View ${n.displayName}’s profile`,onClick:d,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),d())}}:{},w=l.jsx(Se,{kind:n.kind,label:n.displayName,handle:n.handle??void 0,color:n.color,origin:n.origin,resolved:!0,interactive:d!==void 0,...g,cc:s});return m?m.wrap(w,{openOnClick:!0}):l.jsx(ye,{onViewProfile:d,identity:v,children:w})}function oo(e,t=new Set){return{mention:s=>{const n=s[ve],o=typeof n=="string"?n:void 0;return!o||!e.has(o)?l.jsx(l.Fragment,{children:s.children}):l.jsx(so,{authorId:o,cc:t.has(o),children:s.children})}}}function ao({entry:e,authors:t}){const s=c.useMemo(()=>Ws(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),n=c.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(i=>i.authorId))??[])},[e.mentionSpans]),o=c.useMemo(()=>new Set(Ys(e.mentionSpans??[])),[e.mentionSpans]),a=c.useMemo(()=>oo(n,o),[n,o]);return l.jsx(Xs,{authors:t,children:l.jsx(Bt,{content:s,className:"msg-prose",allowedTags:Ks,literalTagContent:qs,components:a,renderers:ps})})}function ro(e){return function(s){return l.jsx(ao,{entry:s,authors:e})}}const un="the top folder";function Te(e){return e.slice(e.lastIndexOf("/")+1)}function io(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function co(e){return e===""?un:`${e}/`}function de(e){return e.target!==void 0?e.target===""?un:e.target:co(io(e.paths[0]??""))}function lo(e,t){const s=e.paths[0]??"",n=e.target;switch(e.kind){case"edit":return`${t} edited ${n??s}`;case"add":return`${t} added ${n??s}`;case"upload":return e.pathCount===1?`${t} uploaded ${Te(s)} to ${de(e)}`:`${t} uploaded ${e.pathCount} files to ${de(e)}`;case"rename":{const o=e.from??"";return n!==void 0?`${t} renamed ${o} to ${n}`:o.endsWith("/")?`${t} renamed ${o}`:`${t} renamed ${o} to ${s}`}case"delete":return n!==void 0?`${t} deleted ${n}`:e.pathCount===1?`${t} deleted ${s}`:`${t} deleted ${e.pathCount} files`;case"from-attachment":return`${t} saved ${Te(s)} from the chat to ${de(e)}`}}const uo=c.lazy(()=>tt(()=>import("./index-B36osK_S.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function da({roomId:e,entry:t,author:s,authorRef:n,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:i,streamStalled:d,isMember:p=!0,grouping:u,orphanedReply:x,answers:v,feedPosition:m,rowId:f}){const g=Qe(t.createdAt),w=c.useMemo(()=>{const L=Ps(t.body.text),ie=Ot(t.attachments??[]);if(ie===null)return L;const Ie=L??t.body.text.trim();return Ie.length>0?`${Ie} ${ie}`:ie},[t.body.text,t.attachments]),h=c.useId(),y=`${h}-author`,I=`${h}-content`,S=`${h}-summary`,M=c.useRef(null),C=c.useRef(null),N=c.useRef(null),{reactions:A,toggle:_,quickRow:j}=Bs({roomId:e,entry:t,viewerAuthorId:a,reactionFrequents:i,streamStalled:d,isMember:p}),b=ee(n==null?void 0:n.agentRef),{open:O}=Ve(),k=n===void 0?void 0:Ge(n,b==null?void 0:b.memberId),T=c.useCallback(()=>{k!==void 0&&O(k)},[O,k]),$=k===void 0?void 0:T,W=Ns({roomId:e,entry:t,author:n,viewerAuthorId:a,onViewProfile:$}),z=(n==null?void 0:n.handle)??void 0,B=c.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:z,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,z,s.color,s.emoji,s.imageUrl]),D=dn({agentRef:n==null?void 0:n.agentRef,identity:B,onViewProfile:$}),R=Us({barRef:C,pillsRef:N,hasReactions:A.length>0}),U=c.useCallback(()=>{var L;return(L=M.current)==null?void 0:L.focus()},[]),oe=c.useMemo(()=>ro(o),[o]),xn=c.useCallback(L=>l.jsx(c.Suspense,{fallback:null,children:l.jsx(uo,{roomId:e,attachment:L})}),[e]),yn=Ts(),ae=t.body.subjectAuthorId??t.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),bn=Hs(e,t),re=Rs(t);if(re.kind==="notice")return l.jsx(vs,{entry:t,feedPosition:m,rowId:f,sessionLink:bn,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(ws,{entry:t,moment:re.moment,subject:ae===t.authorId?s:Cs(ae,o,yn),subjectIdentity:{handle:(E==null?void 0:E.handle)??void 0,origin:E==null?void 0:E.origin,agent:V&&{runtime:V.runtime,...V.model&&{model:V.model}}},feedPosition:m,rowId:f});const vn=u.position==="first"||u.position==="only",we=t.authorId===a;return l.jsxs(P.Root,{ref:M,id:f,position:u.position,actions:W,reactions:j,"data-testid":"room-entry",tabIndex:0,...$s({showAuthorHeader:vn,headerId:y,displayName:s.displayName,time:g,summary:w,contentId:I,summaryId:S,feedPosition:m}),onKeyDown:R,children:[l.jsx(P.Gutter,{author:s,at:t.createdAt,onViewProfile:D?void 0:$,isSelf:we,renderAvatar:D==null?void 0:D.wrapAvatar}),l.jsxs(P.Body,{children:[l.jsx(P.Author,{id:y,author:s,at:t.createdAt,origin:n==null?void 0:n.origin,isSelf:we,renderName:D==null?void 0:D.wrapName}),x===!0&&l.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),v!=null&&l.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${v.excerpt}”`}),t.body.via&&l.jsx(Et,{via:t.body.via}),l.jsx(P.Content,{id:I,className:"wrap-anywhere [&_pre]:overflow-x-auto [&_pre]:wrap-normal",children:t.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:lo(t.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):oe(t,{rowId:t.id,isStreaming:!1})}),w!==null&&l.jsx("span",{id:S,className:"hidden",children:w}),l.jsx(P.Attachments,{items:t.attachments??[],renderAction:p?xn:void 0}),l.jsx(P.Reactions,{ref:N,reactions:A,viewerAuthorId:a,names:r,frequents:i,onToggle:_,disabled:d===!0||!p,onExit:U}),l.jsx(P.Actions,{actions:W,reactions:j,barRef:C,onExit:U})]})]})}const ua={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function mo(e){const t=fe(),[s,n]=c.useState([]),o=c.useRef(new Map),a=c.useCallback(m=>{const f=m.map(g=>({id:crypto.randomUUID(),file:g,status:"pending",progress:0}));n(g=>[...g,...f])},[]),r=c.useCallback(m=>{o.current.delete(m),n(f=>f.filter(g=>g.id!==m))},[]),i=c.useCallback(m=>{if(!m){o.current.clear(),n([]);return}const f=new Set(m);for(const g of f)o.current.delete(g);n(g=>g.filter(w=>!f.has(w.id)))},[]),d=c.useCallback(m=>{o.current.delete(m),n(f=>f.map(g=>g.id===m&&g.status==="error"?{...g,status:"pending",progress:0,error:void 0}:g))},[]),p=c.useRef(null),u=Le({meta:{suppressErrorToast:!0},mutationFn:async m=>{n(h=>h.map(y=>m.some(I=>I.id===y.id)?{...y,status:"uploading"}:y));const f=h=>{n(y=>y.map(I=>I.status==="uploading"?{...I,progress:h.percentage}:I))},g=new AbortController;p.current=g;const w=m.map(h=>h.file);return t.uploadRoomAttachments(e,w,f,g.signal)},onSettled:()=>{p.current=null},onSuccess:(m,f)=>{f.forEach((g,w)=>{const h=m[w];h&&o.current.set(g.id,h.id)}),n(g=>g.map(w=>f.findIndex(y=>y.id===w.id)===-1?w:{...w,status:"uploaded",progress:100}))},onError:m=>{n(f=>f.map(g=>g.status==="uploading"?{...g,status:"error",error:m.message}:g))}}),x=c.useCallback(()=>{var m;(m=p.current)==null||m.abort()},[]),v=c.useCallback(async()=>{const m=s.filter(g=>g.status==="error");if(m.length>0)throw new Error(m.length===1?`${m[0].file.name} didn’t upload. Try again or remove it.`:`${m.length} files didn’t upload. Try again or remove them.`);const f=s.filter(g=>g.status==="pending");return f.length>0&&await u.mutateAsync(f),s.map(g=>o.current.get(g.id)).filter(g=>g!==void 0)},[s,u]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:i,cancelUpload:x,uploadAndGetIds:v,hasPendingFiles:s.length>0,hasFailedUpload:s.some(m=>m.status==="error"),isUploading:u.isPending}}function ma(e){const{room:t,threadRootId:s}=e,n=Tt(),o=$t(),a=mo((t==null?void 0:t.id)??""),r=t!==void 0&&Ye(t.members,t.viewerAuthorId),i=c.useRef({attachments:a,post:n,reply:o,room:t,threadRootId:s});c.useEffect(()=>{i.current={attachments:a,post:n,reply:o,room:t,threadRootId:s}});const d=c.useCallback(y=>i.current.attachments.addFiles(y),[]),p=c.useCallback(y=>i.current.attachments.removeFile(y),[]),u=c.useCallback(y=>i.current.attachments.retryFile(y),[]),x=c.useCallback(()=>i.current.attachments.cancelUpload(),[]),{pendingFiles:v,hasFailedUpload:m,isUploading:f}=a,g=c.useMemo(()=>({staged:v,add:d,remove:p,retry:u,cancel:x,hasFailed:m,isUploading:f,holdsSendWhileUploading:!1}),[v,m,f,d,p,u,x]),w=c.useCallback(async y=>{const{attachments:I,post:S,reply:M,room:C,threadRootId:N}=i.current;if(C===void 0)throw new Error("That room isn’t loaded yet.");if(C.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",C.id);const A=st(),_=I.pendingFiles.map(k=>k.file.name),j=I.pendingFiles.map(k=>k.id),b=await I.uploadAndGetIds();I.clearFiles(j);const O=y.parentEntryId??N;if(O!==void 0){M.mutate({roomId:C.id,rootEntryId:O,text:y.text,clientId:A,attachmentIds:b,attachmentNames:_});return}S.mutate({roomId:C.id,text:y.text,clientId:A,attachmentIds:b,attachmentNames:_})},[]);return{target:c.useMemo(()=>({kind:"room",id:(t==null?void 0:t.id)??"",placeholder:t===void 0?"Message…":s===void 0?`Message ${se(t)}…`:"Reply in this thread…",canSend:t!==void 0&&!t.archived&&r,...t===void 0?{canSendReason:"Still opening this room…"}:t.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Je},send:w,attachments:g}),[t,s,r,g,w]),attachments:a}}const mn=8;function fn(e){if(e==null)return null;const t=e.replace(/\s+/g," ").trim();return t.length===0?null:t}function fo(e){if(rt(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const t=e.working??0;return t>0?t===1?"1 agent working":`${t} agents working`:fn(e.topic)}function $e(e){return{kind:"session",id:e.id,name:at(e.title),summary:fn(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function po(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:se(e),summary:fo(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 go(e){return e.kind==="session"?Re("session",e.id):Re("room",e.id)}function De(e,t){const s=[Y(t[go(e)]),...e.kind==="session"?[Y(e.session.lastTouchedByYouAt),Y(e.session.userLastMessageAt)]:[]].filter(n=>n!==null);return s.length>0?Math.max(...s):Y(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function ho(e){return(t,s)=>De(s,e)-De(t,e)||s.id.localeCompare(t.id)}function xo(e){const t=new Set;return e.filter(s=>{const n=`${s.kind}:${s.id}`;return t.has(n)?!1:(t.add(n),!0)})}function yo(e,t){return!(t.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function bo({sessions:e,rooms:t,mutedRoomIds:s=new Set,interactions:n={},limit:o=mn}){const{yours:a,spinOffs:r,automated:i}=ot(e),d=ho(n),p=[...a.map($e),...t.filter(u=>yo(u,s)).map(po)].sort(d);return{items:xo(p).slice(0,o),automated:[...r,...i].map($e).sort(d).slice(0,o)}}const vo=3,ko=lt;function wo({limit:e=mn,mutedRoomIds:t,enabled:s=!0}={}){var p,u;const n=it(Math.max(e*vo,ko),{enabled:s}),o=Ue({enabled:s}),a=ct(),r=(p=n.data)==null?void 0:p.sessions,i=o.data;return{...c.useMemo(()=>bo({sessions:r??[],rooms:i??[],mutedRoomIds:t,interactions:a,limit:e}),[r,i,t,a,e]),isLoading:s&&(n.isLoading||o.isLoading),warnings:((u=n.data)==null?void 0:u.warnings)??[]}}const Io=6,pn="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const No='[role="combobox"]';function K(e){return e instanceof Element&&e.matches(No)}function Ro({value:e,yieldToPalette:t=!1,enabled:s=!0}){const n=ze(),o=dt(),[a,r]=c.useState(!1),[i,d]=c.useState({stamp:"",index:0}),[p,u]=c.useState(!1),[x,v]=c.useState(!1);e.length>0&&!x&&v(!0);const m=c.useRef(!1);c.useEffect(()=>{m.current=!0},[]);const{data:f}=he({enabled:s}),g=c.useMemo(()=>((f==null?void 0:f.agents)??[]).map(R=>R.projectPath),[f]),{data:w}=We(g,{enabled:s}),h=c.useMemo(()=>w??{},[w]),y=c.useMemo(()=>ut(g,h),[g,h]),I=c.useMemo(()=>new Map(g.map(R=>[ge(R),R])),[g]),S=c.useCallback(R=>mt({room:R,agentsByPath:h,pathByAgentRef:I}),[h,I]),M=c.useMemo(()=>ft(o.muted),[o.muted]),{items:C}=wo({mutedRoomIds:M,enabled:s}),N=c.useMemo(()=>C.slice(0,Io),[C]),A=s&&a&&!p&&!x&&!t&&e.length===0&&N.length>0,_=`${A}:${N.length}`,j=i.stamp===_?i.index:0,b=c.useCallback(R=>{m.current&&K(R.target)&&(u(!1),v(!1),r(!0))},[]),O=c.useCallback(R=>{K(R.target)&&r(!0)},[]),k=c.useCallback(R=>{K(R.target)&&r(!1)},[]),T=c.useCallback(R=>{N.length!==0&&d(U=>{const oe=U.stamp===_?U.index:0;return{stamp:_,index:(oe+R+N.length)%N.length}})},[N.length,_]),$=c.useCallback(()=>T(1),[T]),W=c.useCallback(()=>T(-1),[T]),z=c.useCallback(()=>{u(!0)},[]),B=c.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Z.getState().recordOpened("agent",R.session.cwd),n(pe({dir:R.session.cwd??void 0,session:R.session.id}));return}Z.getState().recordOpened("room",R.room.id),n({...pt.channels(),search:{id:R.room.id}})},[n]),D=c.useCallback(()=>{const R=N[j];!A||!R||B(R)},[A,N,j,B]);return{isOpen:A,hasRows:N.length>0,rows:N,agents:h,displayNames:y,visualOf:S,selectedIndex:j,activeDescendantId:A&&N[j]!==void 0?ke(j):void 0,listboxId:A?pn:void 0,handleFocus:b,handleBlur:k,handlePointerDown:O,moveDown:$,moveUp:W,selectHighlighted:D,selectRow:B,dismiss:z}}function gn({mark:e,label:t,title:s,summary:n,lastActivityAt:o,index:a,isSelected:r,now:i,onSelect:d}){const p=c.useMemo(()=>Number.isNaN(Date.parse(o))?null:kt(o),[o,i]);return l.jsxs("div",{id:ke(a),role:"option","aria-selected":r,"data-selected":r,title:s,onClick:d,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),l.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[l.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:t}),p!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:p})]}),n!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:n})]})]})}function Co({item:e,agent:t,displayName:s,index:n,isSelected:o,now:a,onSelect:r}){const i=ht(t,e.session.cwd??s);return l.jsx(gn,{mark:l.jsx(xt,{color:i.color,emoji:i.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:n,isSelected:o,now:a,onSelect:r})}function Ao({item:e,visual:t,index:s,isSelected:n,now:o,onSelect:a}){return l.jsx(gn,{mark:l.jsx(bt,{room:e.room,participants:e.room.participants,visuals:vt(t)}),label:l.jsx(yt,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:n,now:o,onSelect:a})}function Mo({rows:e,selectedIndex:t,agents:s={},displayNames:n={},visualOf:o,onSelect:a}){const r=gt(6e4);return c.useEffect(()=>{var i,d;(d=(i=document.getElementById(ke(t)))==null?void 0:i.scrollIntoView)==null||d.call(i,{block:"nearest"})},[t]),l.jsx(Xe.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:i=>i.preventDefault(),children:l.jsx("div",{id:pn,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((i,d)=>{var p;return i.kind==="session"?l.jsx(Co,{item:i,agent:i.session.cwd&&s[i.session.cwd]||null,displayName:i.session.cwd&&n[i.session.cwd]||((p=i.session.cwd)==null?void 0:p.split("/").pop())||"Agent",index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`session-${i.id}`):l.jsx(Ao,{item:i,visual:o(i.room),index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`room-${i.id}`)})})})}const Pe={people:"People",agents:"Agents"},So=["people","agents"];function jo(e,t){const s=[];for(const{author:n}of e){if(n.kind==="system"||n.id===t||n.retired)continue;const o=n.handle;s.push({section:n.kind==="agent"?"agents":"people",authorId:n.id,label:n.displayName,...o?{handle:o}:{},...n.emoji?{emoji:n.emoji}:{},...n.color?{color:n.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function _o(e,t,s){const n=t.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:Oo(a,n)})).filter(a=>a.tier!==null).sort((a,r)=>a.tier-r.tier||a.position-r.position);return s.flatMap(a=>o.filter(r=>r.row.section===a).map(({row:r})=>r))}function Oo(e,t){var o;if(t==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let n=null;for(const a of s){const r=a===t?0:a.startsWith(t)?1:a.includes(t)?2:null;r!==null&&(n===null||r<n)&&(n=r)}return n}function J(e,t,s){var a;const n=e.length;if(n===0)return 0;let o=(t%n+n)%n;for(let r=0;r<n;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+n)%n}return 0}function Eo(e,t,s,n){const o=e.slice(0,t),a=e.slice(t+1+s.length),r=`@${n}`,i=a.startsWith(" ")?"":" ";return{value:o+r+i+a,cursorPos:o.length+r.length+1}}const To=/(^|\s)@([A-Za-z0-9_.-]*)$/,hn="mention-palette-listbox";function me(e){return`mention-item-${e}`}function $o({members:e,viewerAuthorId:t,text:s,sectionOrder:n=So}){var O;const[o,a]=c.useState(!1),[r,i]=c.useState(""),[d,p]=c.useState(-1),u=wt(s),x=c.useRef(!1),v=c.useMemo(()=>jo(e,t),[e,t]),m=c.useMemo(()=>o?_o(v,r,n):[],[v,r,o,n]),[f,g]=c.useState(null),w=f!==null&&f.query===r&&f.open===o?f.index:J(m,0,1),h=m[w],y=m.length===0||h!==void 0&&!h.disabled?w:J(m,0,1),I=c.useCallback((k,T)=>{const $=k.slice(0,T).match(To);if(!$){a(!1);return}a(!0),i($[2]),p(($.index??0)+$[1].length)},[]),S=c.useCallback(k=>{u.write(k),x.current=!1},[u]),M=c.useCallback(k=>{x.current||I(u.read(),k)},[I,u]),C=c.useCallback(()=>{g({query:r,open:o,index:J(m,y+1,1)})},[m,y,r,o]),N=c.useCallback(()=>{g({query:r,open:o,index:J(m,y-1,-1)})},[m,y,r,o]),A=c.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),Eo(u.read(),d,r,k.handle)),[d,r,u]),_=c.useCallback(()=>{const k=m[y];return k?A(k):(a(!1),null)},[m,y,A]),j=c.useCallback(()=>{x.current=!0,a(!1)},[]),b=m.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:b,rows:m,selectedIndex:y,activeDescendantId:o&&((O=m[y])==null?void 0:O.disabled)===!1?me(y):void 0,listboxId:o?hn:void 0,noteTextChange:S,handleCursorChange:M,moveDown:C,moveUp:N,selectHighlighted:_,selectRow:A,dismiss:j}}function Do({rows:e,selectedIndex:t,onSelect:s}){const n=c.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const i=o[o.length-1];i&&i.section===a.section?i.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return c.useEffect(()=>{var o;(o=document.getElementById(me(t)))==null||o.scrollIntoView({block:"nearest"})},[t]),l.jsx(Xe.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:l.jsx("div",{id:hn,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?l.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):n.map(({section:o,items:a},r)=>l.jsxs("div",{role:"group","aria-label":Pe[o],children:[r>0&&l.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),l.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:Pe[o]}),a.map(({row:i,index:d})=>{const p=d===t;return l.jsxs("div",{id:me(d),role:"option","aria-selected":p,"aria-disabled":i.disabled,"data-selected":p,"data-disabled":i.disabled,onClick:()=>{i.disabled||s(i)},className:i.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:i.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:i.label}),i.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",i.handle]}),i.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:i.disabledReason})]},i.authorId)})]},o))})})}const Po=/@([A-Za-z0-9][A-Za-z0-9_.-]*)/g,Fo=/[.\-_]+$/;function Lo(e,t){const s=new Map;for(const{author:o}of t)o.handle&&s.set(o.handle.toLowerCase(),o.handle);const n=[];for(const o of e.matchAll(Po)){if(o.index===void 0)continue;const a=o[1].toLowerCase(),r=a.replace(Fo,""),i=s.get(a)??s.get(r);if(!i)continue;const d=(s.has(a)?a.length:r.length)+1;n.push({offset:o.index,length:d,authorId:i,handle:i})}return n}function Bo(e,t){const s=Gs(e,Lo(e,t)),n=[],o=[];for(const r of s){const i=r.cc?o:n;i.includes(r.handle)||i.push(r.handle)}if(o.length===0||n.length===0)return null;const a=r=>r.map(i=>`@${i}`).join(", ");return`Asks ${a(n)} · cc ${a(o)}`}function fa({room:e,threadRootId:t,focusOnMount:s,offerJumpBackIn:n,onFocusChange:o,attachments:a}){const r=t===void 0?e.id:Ke(e.id,t),i=It(r),{target:d}=Dt(),p=Nt(),u=Rt(r),x=c.useRef(null),v=Ye(e.members,e.viewerAuthorId),m=c.useRef(!1),f=$o({members:e.members,viewerAuthorId:e.viewerAuthorId,text:i}),g=c.useMemo(()=>e.kind==="channel"?Bo(i,e.members):null,[e.kind,e.members,i]),w=n===!0,h=Ro({value:i,yieldToPalette:f.isOpen,enabled:w}),y=c.useRef(u);c.useEffect(()=>{var b;u!==y.current&&(y.current=u,(b=x.current)==null||b.focus())},[u]),c.useEffect(()=>{var b;s===!0&&((b=x.current)==null||b.focusUnlessTouch())},[]);const I=c.useCallback(b=>X.getState().set(r,b),[r]),[S,M]=c.useState(null);c.useLayoutEffect(()=>{var b;S!==null&&((b=x.current)==null||b.focusAt(S.pos))},[S]);const C=c.useCallback(b=>{b&&(I(b.value),M({pos:b.cursorPos}))},[I]),N=c.useCallback(b=>C(f.selectRow(b)),[f,C]),A=c.useCallback(()=>C(f.selectHighlighted()),[f,C]),_=()=>{if(d===null||!d.canSend||m.current)return;f.dismiss();const b=X.getState().take(r).trim();if(b==="")return;const O=a.pendingFiles.length>0;O&&(m.current=!0),d.send({text:b}).catch(()=>{const k=X.getState(),T=k.drafts[r]??"";k.set(r,T===""?b:`${b}
|
|
44
|
-
${T}`)}).finally(()=>{O&&(m.current=!1)})};if(!v)return l.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[l.jsx("p",{className:"text-muted-foreground text-sm",children:Je}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:p.isPending,onClick:()=>p.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>He.success(`You joined ${se(e)}`)}),children:Ct})]});const j=l.jsx(Pt.Composer,{inputRef:x,value:i,onChange:b=>{I(b),f.noteTextChange(b)},onSubmit:_,footer:g?l.jsx("p",{"data-slot":"cc-line",className:"text-muted-foreground px-3 pb-2 text-xs",children:g}):void 0,head:l.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f.isOpen&&f.rows.length===0?"No one by that name.":""}),mentionPicker:l.jsx(Ce,{children:f.isOpen&&l.jsx(Do,{rows:f.rows,selectedIndex:f.selectedIndex,onSelect:N})}),overlays:l.jsx(l.Fragment,{children:l.jsx(Ce,{children:h.isOpen&&l.jsx(Mo,{rows:h.rows,selectedIndex:h.selectedIndex,agents:h.agents,displayNames:h.displayNames,visualOf:h.visualOf,onSelect:h.selectRow})})}),input:{onCursorChange:f.handleCursorChange,isStreaming:!1,isPaletteOpen:f.isOpen||h.isOpen,paletteHasResults:h.isOpen?h.hasRows:f.hasSelectableRows,onArrowUp:h.isOpen?h.moveUp:f.moveUp,onArrowDown:h.isOpen?h.moveDown:f.moveDown,onCommandSelect:h.isOpen?h.selectHighlighted:A,onEscape:h.isOpen?h.dismiss:f.dismiss,tabPicks:!h.isOpen,onClear:()=>{I(""),f.dismiss()},activeDescendantId:h.isOpen?h.activeDescendantId:f.activeDescendantId,paletteListboxId:h.isOpen?h.listboxId:f.listboxId,contextKey:r,...a.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!w&&o===void 0?j:l.jsx("section",{className:"flex flex-col","data-testid":At.homeComposer,onFocus:b=>{h.handleFocus(b),K(b.target)&&(o==null||o(!0))},onBlur:b=>{h.handleBlur(b),K(b.target)&&(o==null||o(!1))},onPointerDown:h.handlePointerDown,children:j})}export{ca as A,fa as C,ye as I,ua as R,ta as a,da as b,Cs as c,sa as d,la as e,ia as f,oa as g,As as h,ds as i,na as j,Ms as k,Ss as l,js as m,aa as n,ra as o,K as p,ls as r,q as t,ma as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,e as x,B as o,Y as m,Z as u,_ as h,$ as g}from"./index-OQuvRZTD.js";import{u as p,s as l,a as j,b as f}from"./access-copy-Dqct36mi.js";import{Q as N}from"./query-error-state-5236P3z0.js";const v={agent:"From the agent",this_chat:"Only in this chat"};function k({agentId:n,onManage:e}){var i;const a=p(n);if(a.isPending)return s.jsx(x,{className:"h-24 w-full rounded-lg"});if(a.isError)return s.jsx(N,{title:"Couldn’t load account access",description:"Nothing changed. Try again.",onRetry:()=>void a.refetch(),isRetrying:a.isFetching});const c=((i=a.data)==null?void 0:i.connections)??[];return s.jsxs("section",{"aria-labelledby":"agent-account-access",className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"agent-account-access",className:"text-sm font-semibold",children:"Account access"}),s.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Accounts this agent can use."})]}),e&&s.jsxs(o,{variant:"ghost",size:"sm",onClick:e,children:["Manage",s.jsx(m,{className:"size-3.5","aria-hidden":!0})]})]}),c.length===0?s.jsxs("div",{className:"bg-muted/40 rounded-lg p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Give access from the Connections page."})]}):s.jsx("ul",{className:"space-y-1.5",children:c.map(t=>{const r=t.readiness.state==="ready";return s.jsxs("li",{"data-testid":`agent-connection-${t.connectionId}`,className:"bg-muted/40 flex min-h-11 items-center gap-3 rounded-lg px-3 py-2",children:[s.jsx(u,{iconKey:t.toolkit,displayName:l(t.toolkit),className:"size-7"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"truncate text-sm font-medium",children:[l(t.toolkit)," (",t.label,")"]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.operationRevisionIds.length," approved"," ",t.operationRevisionIds.length===1?"action":"actions",t.everyAgent&&" · given to every agent"]})]}),s.jsx(h,{size:"xs",variant:r?"secondary":"outline",title:r?void 0:t.readiness.copy.owner,children:r?"Available":"Unavailable"})]},t.connectionId)})})]})}const y="This only affects this chat. Turning an app back on never adds access.",C="Couldn’t change access for this chat. Try again.";function b(n){return(n==null?void 0:n.code)==="session_access_other_agent"?n.message:C}function _({sessionId:n,onManage:e,emptyAction:a,footer:c}){var r;const i=j(n);if(i.isPending)return s.jsx(x,{className:"h-16 w-full rounded-lg"});if(i.isError)return s.jsxs("section",{"data-testid":"session-connectors",className:"space-y-2",children:[s.jsx("p",{role:"alert",className:"text-destructive px-1 text-xs",children:"Couldn’t load account access."}),s.jsx(o,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]});const t=((r=i.data)==null?void 0:r.connections)??[];return s.jsxs("section",{"data-testid":"session-connectors","aria-labelledby":"session-account-access",className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[s.jsx("h3",{id:"session-account-access",className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Connections"}),e&&s.jsxs(o,{variant:"ghost",size:"xs",onClick:e,children:["Manage agent access",s.jsx(m,{className:"size-3","aria-hidden":!0})]})]}),t.length===0?s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md px-2.5 py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Ask this agent to request the access it needs."})]}),a]}):s.jsxs(s.Fragment,{children:[t.some(d=>d.thisChat)&&s.jsx("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:y}),t.map(d=>s.jsx(S,{sessionId:n,connection:d},d.connectionId))]}),t.length>0&&c]})}function S({sessionId:n,connection:e}){const a=f(n),c=e.readiness.state==="ready",i=`${l(e.toolkit)} (${e.label})`;return s.jsxs("div",{"data-testid":`session-connection-${e.connectionId}`,"data-reason":e.readiness.reason,className:"bg-muted/40 rounded-md px-2.5 py-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-sm font-medium",children:i}),s.jsx(h,{size:"xs",variant:c?"secondary":"outline",children:c?v[e.source]:"Not available"})]}),s.jsx("p",{className:c?"text-muted-foreground mt-1 text-xs":"text-status-warning-fg mt-1 text-xs",children:c?`${e.operationRevisionIds.length} ${e.operationRevisionIds.length===1?"action":"actions"} available in this chat.`:e.readiness.copy.owner})]}),e.thisChat&&s.jsx(g,{"aria-label":`${i} in this chat`,"data-testid":`session-connection-switch-${e.connectionId}`,checked:e.thisChat==="on",disabled:a.isPending,onCheckedChange:t=>a.mutate({connectionId:e.connectionId,on:t}),className:"mt-0.5 shrink-0"})]}),a.isError&&e.thisChat&&s.jsx("p",{role:"alert",className:"text-destructive mt-1 text-xs",children:b(a.error)})]})}export{k as A,_ as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-OQuvRZTD.js";import{a as t}from"./ProfileFields-DbPJ7fvN.js";import"./profile-errors-COcBx7w5.js";import"./use-mounted-ref-CaPc6Prv.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a1 as T,a3 as w,a4 as B,hb as v,hc as $,h as O,j as s,hd as A,b6 as E,he as W,_ as P,B as x,s as R,a7 as D,hf as M,hg as H,d as L,r as h,hh as F,e as S,hi as I,hj as q,b as U,hk as _}from"./index-OQuvRZTD.js";import{M as C}from"./more-details-CRLU2HN4.js";import{HeartbeatFileEditor as z}from"./ConventionPage-CNhpF6Z1.js";import"./relay-trace-schemas-B80E4EUn.js";import"./form-D93N5lrK.js";import"./untrusted-text-BDygHCRk.js";import"./soul-file-CXgYs25S.js";function Q(){const e=T(),t=w();return B({mutationFn:n=>e.chooseTriageCredits(n),onSettled:()=>t.invalidateQueries({queryKey:v.all})})}function K(e,t){if(e.cadence==="off")return"Sends no reports.";const n=e.cadence==="weekly"?"each week":"each workday",a=e.items===0?"Nothing to report yet.":`${e.items} ${e.items===1?"item":"items"} so far.`;return`Reports to ${t} ${n}. ${a}`}function G(e,t){const n=$(e,t);return a=>{var r;return((r=e.find(l=>{var o;return((o=l.agent)==null?void 0:o.manifestId)===a}))==null?void 0:r.displayName)??n(a)}}function J(e){return Number.isNaN(e.getTime())?null:e.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function V({beat:e,onOpenChat:t}){const n=A[e.outcome],a=J(new Date(e.startedAt));return s.jsxs("li",{"data-slot":"heartbeat-beat","data-outcome":e.outcome,className:"flex flex-col gap-1 rounded-md px-2 py-2",children:[s.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[s.jsx("time",{dateTime:e.startedAt,title:a??void 0,children:E(e.startedAt)}),s.jsx("span",{children:W[e.kind]}),s.jsx(P,{variant:"outline",size:"xs",tone:n.tone,className:"ml-auto",children:n.label})]}),e.summary&&s.jsx("p",{className:"text-sm break-words",children:e.summary}),t&&s.jsx(x,{size:"xs",variant:"ghost",className:"-ml-2 self-start","aria-label":a?`Open chat from the check at ${a}`:"Open chat from this check",onClick:t,children:"Open chat"})]})}function X({beats:e,canOpenChat:t}){const n=O();return e.length===0?s.jsx("p",{className:"text-muted-foreground px-2 text-sm",children:"No checks yet."}):s.jsx("ul",{className:"flex flex-col","aria-label":"Last checks",children:e.map(a=>{const r=a.sessionId,l=t&&r&&n?()=>void n(R({session:r})):void 0;return s.jsx(V,{beat:a,...l?{onOpenChat:l}:{}},a.id)})})}function Y(e){return e.runsOn==="credits"?`Checks run on DorkOS credits. ${e.today} today.`:`Checks run on ${D(e.runtime)}.`}function Z(e){if(e.today===0)return null;const t=`${e.tokens.toLocaleString("en-US")} tokens`;return e.runsOn==="credits"?`${t} today.`:`${`${e.today} ${e.today===1?"check":"checks"}`} on credits earlier today, ${t}.`}function ee(){const e=Q();return s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border px-3 py-3","data-slot":"heartbeat-credits-offer",children:[s.jsx("p",{className:"text-sm font-medium",children:"Run cheap checks on DorkOS credits?"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Quick checks skip most full runs. Nothing is spent until you say yes."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(x,{size:"sm",disabled:e.isPending,onClick:()=>e.mutate(!0),children:"Use credits"}),s.jsx(x,{size:"sm",variant:"ghost",disabled:e.isPending,onClick:()=>e.mutate(!1),children:"Not now"})]}),e.isError&&s.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save your answer. Try again."})]})}function se({checks:e}){const t=Z(e);return s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-checks",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Checks"}),s.jsx("p",{className:"text-sm",children:Y(e)}),t&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t}),e.offer&&s.jsx(ee,{})]})}function te({held:e,nameOf:t,now:n}){return e.length===0?null:s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-held",children:[s.jsxs("h3",{className:"text-sm font-semibold",children:["Held until working hours: ",e.length,"."]}),s.jsx("ul",{className:"flex flex-col","aria-label":"Held messages",children:e.map(a=>{const r=M(a.deliverAfter,new Date(n));return s.jsxs("li",{className:"flex flex-col gap-0.5 rounded-md px-2 py-2",children:[a.text&&s.jsx("p",{className:"line-clamp-3 text-sm break-words whitespace-pre-line",children:a.text}),s.jsx("p",{className:"text-muted-foreground text-xs",children:[`To ${t(a.to)}`,r].filter(Boolean).join(" · ")})]},a.id)})})]})}function f(e){return e.value===null?null:`${Math.round(e.value*100)}%`}function p(e){return`${e.part} of ${e.whole}`}function ne(e){return`Target ${e.charAt(0).toLowerCase()}${e.slice(1)}`}function ae(e){return e.value!==null?e.value.toFixed(1):e.messages>0?`${e.messages} sent, none useful`:null}function re(e){return e.windowDays===1?"No checks in the last day.":`No checks in the last ${e.windowDays} days.`}function oe(e){return e.windowDays===1?"Last day.":`Last ${e.windowDays} days.`}function N(e,t,n){return`${e} ${e===1?t:n}`}function le(e){const{pauses:t,wakeOff:n,mutes:a}=e.mutesAndPauses,r=[t>0?N(t,"pause","pauses"):null,n>0?N(n,"switch-off","switch-offs"):null,a>0?N(a,"mute","mutes"):null].filter(l=>l!==null);return r.length===0?null:r.join(", ")}function ie(e){const t=e.supporting,n=o=>Math.round(o).toLocaleString("en-US"),a=f(t.quietBeats),r=f(t.commitmentsOnTime);return[a?`Quiet checks: ${a}, ${p(t.quietBeats)}.`:null,r?`Promises kept on time: ${r}, ${p(t.commitmentsOnTime)}.`:"No promises came due.",t.noEndBeat>0?`Ended without a summary: ${t.noEndBeat}.`:null,t.triage.checks>0?`Cheap checks: ${t.triage.checks}, ${n(t.triage.tokens)} tokens.`:null,t.turns.count>0?t.turns.tokensPerTurn===null?`Full runs: ${t.turns.count}.`:`Full runs: ${t.turns.count}, about ${n(t.turns.tokensPerTurn)} tokens each.`:null,t.bypass>0?`Posted outside a check’s summary: ${t.bypass}.`:null,t.held>0?`Held for people’s hours: ${t.held}.`:null].filter(o=>o!==null)}function u({label:e,value:t,detail:n,target:a,source:r}){return s.jsxs("div",{"data-slot":"heartbeat-measure",className:"grid grid-cols-[1fr_auto] items-baseline gap-x-2 gap-y-0.5 py-1.5",children:[s.jsx("dt",{className:"text-sm",children:e}),s.jsx("dd",{className:"text-sm font-medium tabular-nums",children:t}),(n||a)&&s.jsxs("dd",{className:"text-muted-foreground col-span-2 flex flex-wrap gap-x-2 text-xs",children:[n&&s.jsx("span",{className:"tabular-nums",children:n}),a&&s.jsx("span",{children:ne(a)})]}),s.jsx("dd",{className:"text-muted-foreground col-span-2 text-xs",children:r})]})}function k({measures:e}){const{mutesAndPauses:t}=e;return s.jsx(u,{label:"Mutes and pauses",value:String(t.total),detail:le(e),target:t.target,source:t.source})}function ce({measures:e}){const t="Nothing to count yet";if(e.supporting.beats===0)return s.jsxs("section",{className:"space-y-1","data-slot":"heartbeat-measures","data-state":"empty",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Measures"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:re(e)}),s.jsx("dl",{children:s.jsx(k,{measures:e})})]});const{keptRate:n,usefulRaiseRate:a,interruptions:r}=e,l=ie(e);return s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-measures","data-state":"measured",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Measures"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[oe(e)," Targets are starting points, not grades."]})]}),s.jsxs("dl",{className:"divide-y",children:[s.jsx(u,{label:"Work that stuck",value:f(n)??t,detail:n.whole>0?p(n):null,target:n.target,source:n.source}),s.jsx(u,{label:"Useful messages",value:f(a)??t,detail:a.whole>0?p(a):null,target:a.target,source:a.source}),s.jsx(u,{label:"Interruptions per useful outcome",value:ae(r)??t,detail:r.value===null?null:`${r.messages} sent, ${r.usefulOutcomes} useful`,target:r.target,source:r.source}),s.jsx(u,{label:"Surprises",value:"Not measured yet",source:e.surprises.source}),s.jsx(k,{measures:e})]}),l.length>0&&s.jsx(C,{label:"Supporting measures",openLabel:"Fewer measures",children:s.jsx("ul",{className:"space-y-1 text-xs","aria-label":"Supporting measures",children:l.map(o=>s.jsx("li",{children:o},o))})})]})}function ue({status:e,now:t,readerName:n}){const a=e.enabled&&e.wake==="timed"?I(e.nextBeatAt,new Date(t)):null,r=e.enabled&&e.skippedReason===null;return s.jsxs("section",{className:"space-y-1","data-slot":"heartbeat-wake",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"How it wakes"}),s.jsx("p",{className:"text-sm",children:q(e)}),a&&s.jsx("p",{className:"text-muted-foreground text-xs",children:a}),r&&s.jsx("p",{className:"text-muted-foreground text-xs","data-slot":"heartbeat-next-report",children:K(e.report,n(e.report.to))})]})}function de({error:e}){return s.jsxs("div",{role:"alert",className:"space-y-1","data-slot":"heartbeat-file-problem",children:[s.jsx("p",{className:"text-destructive text-sm",children:"These settings don’t read. The last good ones still apply."}),s.jsx("p",{className:"text-sm",children:_(e)}),s.jsx(C,{children:s.jsx("p",{className:"font-mono break-words",children:e})})]})}function me(e){var i;const{member:t,roster:n,onPush:a,status:r}=e,l=w(),{agent:o,isPending:g}=U(t),[j,c]=h.useState(!1),d=((i=t.agent)==null?void 0:i.manifestId)??"";if(g)return s.jsx(S,{className:"h-40 w-full"});const m=!!o&&((o==null?void 0:o.heartbeatContent)??null)===null;return m&&!j?s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-file-empty",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"No HEARTBEAT.md yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"It wakes only when something happens."}),s.jsx(x,{size:"sm",variant:"outline",onClick:()=>c(!0),children:"Write one"})]}):s.jsxs("section",{className:"space-y-2",children:[r.fileError&&s.jsx(de,{error:r.fileError}),s.jsx(z,{member:t,roster:n,onPush:a,...m?{onCancel:()=>c(!1)}:{},onSaved:()=>void l.invalidateQueries({queryKey:v.agent(d)})})]})}function ye(e){var y,b;const{member:t,roster:n}=e,a=((y=t.agent)==null?void 0:y.manifestId)??null,r=H(a,{live:!0}),l=L(t,n),o=l==="managed"||l==="system",g=h.useMemo(()=>$(n,t),[n,t]),j=h.useMemo(()=>G(n,t),[n,t]),c=F(3e4),[d,m]=h.useState(!1);if(o&&((b=r.data)!=null&&b.enabled)&&!d&&m(!0),!a)return null;if(r.isPending)return s.jsx(S,{className:"h-24 w-full"});if(!r.data)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this heartbeat."});const i=r.data;return s.jsxs("div",{className:"space-y-6","data-slot":"profile-heartbeat",children:[s.jsx(ue,{status:i,now:c,readerName:j}),i.enabled&&s.jsx(se,{checks:i.checks}),o&&d&&s.jsx(me,{...e,status:i}),s.jsx(te,{held:i.held,nameOf:g,now:c}),s.jsx(ce,{measures:i.measures}),s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-beats",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Last checks"}),s.jsx(X,{beats:i.lastBeats,now:c,canOpenChat:i.enabled})]})]})}export{ye as HeartbeatPage};
|