dorkos 0.124.0 → 0.124.1
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 +935 -551
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BH8Ndn3e.js → AboutPage-DHaZvsJE.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-K5Mew9EX.js → ActivityErrorState-BP-qFk2S.js} +1 -1
- package/dist/client/assets/{ActivityPage-BB20L5HU.js → ActivityPage-Bme3TzdQ.js} +1 -1
- package/dist/client/assets/{ActivityRow-C5O7rnmS.js → ActivityRow-BRZyW9MA.js} +1 -1
- package/dist/client/assets/{AdapterIcon-Bmybvrzb.js → AdapterIcon-BcfquTja.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-CkdV7Hhh.js → AdapterSetupWizard-B4I23pBg.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-BA2cDa7r.js → AgentOptionRow-Cb34LtmH.js} +1 -1
- package/dist/client/assets/{AgentPicker-CsIIPGZJ.js → AgentPicker-ouNRFSDh.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-0fOxvaoe.js → AgentRequestCard-B6MHIsxa.js} +2 -2
- package/dist/client/assets/{AppearancePage-XOjkkoli.js → AppearancePage-CutehigK.js} +1 -1
- package/dist/client/assets/ApplyToOverridesDialog-B-wIUI27.js +1 -0
- package/dist/client/assets/{AttentionSignalRow-CjjZobp7.js → AttentionSignalRow-B1aMjgX_.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-9TVHyRPJ.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CdWF4WLz.js} +1 -1
- package/dist/client/assets/{BindingDialog-DLoAQauL.js → BindingDialog-BAdueON5.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-CYHsXAcY.js → BlintzCanvas-b30dG4gx.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent--Gr7Fe_U.js → CanvasCsvContent-DGHgSikG.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-estXyAbr.js → CanvasFileContent-D1bFaUeh.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-CkOo930M.js → CanvasModel3dContent-dST7g1v2.js} +2 -2
- package/dist/client/assets/{ChatAppsOff-D4L1zJVN.js → ChatAppsOff-DiObvmJS.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-DY_6ju-z.js → CodeMirrorDiff-BncI1OY1.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BUoDBsBv.js → CodeMirrorEditor-DV6psv19.js} +1 -1
- package/dist/client/assets/{CommitmentList-wDkcVP9c.js → CommitmentList-Dx_Ek_Gl.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-CzSM6b8R.js → CommitmentsPage-Bca8NMUa.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-cERD9H2L.js → ComputerResourceView-DNVNFTdn.js} +1 -1
- package/dist/client/assets/{ComputerViewer-rMcfbk2_.js → ComputerViewer-D8SxJdMm.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-f7QeQbQo.js → ConnectionAccessLists-Bhj1YT15.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BmjtA6pw.js → ConnectionsPage-B20JZxoK.js} +1 -1
- package/dist/client/assets/{ConventionPage-CH-ah6nI.js → ConventionPage-De645wxU.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-CJIxa6ST.js → ExtensionPageRoute-nTeiOBRQ.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BP7EJ2JL.js → FloatingTanStackRouterDevtools-CqogiFob-DM79UITv.js} +1 -1
- package/dist/client/assets/HandlePage-B08V-om7.js +1 -0
- package/dist/client/assets/{HeartbeatPage-BUsf-qrU.js → HeartbeatPage-CBoUxz6t.js} +1 -1
- package/dist/client/assets/{KeyEntry-C2kWdN8q.js → KeyEntry-Cug8ocpX.js} +1 -1
- package/dist/client/assets/{LexicalField-CR8ulsI_.js → LexicalField-Bv_ogmAq.js} +1 -1
- package/dist/client/assets/{ManagesPage-DTtsIOGi.js → ManagesPage-DfJBQKK3.js} +1 -1
- package/dist/client/assets/{Marketplace-iaV5XAzv.js → Marketplace-swCVUbdY.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-6tgzUfFj.js → MarketplaceSourcesView-CDZDChpV.js} +1 -1
- package/dist/client/assets/{McpAppFrame-C7eYYdI9.js → McpAppFrame-BM9cNPPd.js} +1 -1
- package/dist/client/assets/{McpSigninBody-BDyGbJ7I.js → McpSigninBody-DKyUKrEE.js} +1 -1
- package/dist/client/assets/{Model3dViewer-BujDNuVS.js → Model3dViewer-rXSL5y2P.js} +1 -1
- package/dist/client/assets/NamePage-JwMDK1JD.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-D4e-z2Jt.js → NewDirectMessageMenu-GCEMS5oV.js} +1 -1
- package/dist/client/assets/{NotificationsPage-CkDeTaJp.js → NotificationsPage-DSWsOVLa.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-CtbOt3r5.js → OpenMeshSwitch-BTuctDj4.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-Vr4qZnmM.js → OperatorIdentityForm-ODDMd2YN.js} +1 -1
- package/dist/client/assets/PermissionHistory-41a58Se7.js +1 -0
- package/dist/client/assets/{PermissionsPage-f4QaX8oM.js → PermissionsPage-DefmymZ6.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-BkZruwF-.js → PersonalityPopover-7zPVBI1I.js} +1 -1
- package/dist/client/assets/PhotoPage-DlOVhkW9.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-BXC2K0tx.js → PreviewRefusedNotice-CwGlBJ7U.js} +1 -1
- package/dist/client/assets/{ProfileFields-BebX5oiv.js → ProfileFields-DVMkpJSb.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-DZoL65zQ.js → ProfilePanelContainer-RrhoPD3T.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-D9H7wsuT.js → ProfileRolePicker-CXRVBCAu.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-B5fDmc-g.js → PromptSuggestionChips-bBroJdTi.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-uVYhSqj7.js → ReportsToPopover-CfPatsWM.js} +1 -1
- package/dist/client/assets/{RoomSurface-Bg5WV4Ep.js → RoomSurface-CdgCdV6h.js} +11 -11
- package/dist/client/assets/{RoomsPage-yflYFulU.js → RoomsPage-C3dDp1Mb.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-DtGrX1Vq.js → RunsOnPopover-BcKjfQi-.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-DjReuQ-T.js → RuntimeConnectFlow-DCIRnvOH.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-Cr4GRi8c.js → RuntimeSetupDialog-Bg-0b-LC.js} +1 -1
- package/dist/client/assets/SeenDevices-nMsGUQTv.js +19 -0
- package/dist/client/assets/{SessionsPage-BWu-en78.js → SessionsPage-Cqfx4FGW.js} +1 -1
- package/dist/client/assets/SettingsDialog-C8r2igJ_.js +12 -0
- package/dist/client/assets/{SkillsPage-BdUb9SZy.js → SkillsPage-BleHQavF.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-qYJPEoSR.js → TaskDialogWrapper-BhTEvf-u.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-Bgcg9vxF.js → TasksEmptyState-Bprx1k8M.js} +2 -2
- package/dist/client/assets/{TasksPage-Ch5W2WQS.js → TasksPage-Dub39yEJ.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CPwSIMRw.js → TeamComputerEntry-CJ-NG0u5.js} +1 -1
- package/dist/client/assets/ToolsPage-IsD6M-ZW.js +2 -0
- package/dist/client/assets/{TopologyGraph-I4_mkMHM.js → TopologyGraph-CwyasvFI.js} +14 -14
- package/dist/client/assets/{TourHost-BPaSwh9I.js → TourHost-BYfztuPb.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-BUWZUu5P.js → UnlinkDialog-BKhgxVdF.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-cS8yMCxU.js → WidgetErrorCard-1NyzIJBj.js} +6 -6
- package/dist/client/assets/_shell-Ct2Bz7D0.js +80 -0
- package/dist/client/assets/{_shell._home-DCA5k-jb.js → _shell._home-xWj7wO5z.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BX4nFLna.js → _shell._home.activity-BqcLoaB1.js} +1 -1
- package/dist/client/assets/{_shell._home.index-C8t8cw72.js → _shell._home.index-D4sQsKKk.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-BgUeEvhK.js → _shell._home.tasks--UhQB6h3.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-BPBdnkRt.js → _shell._home.workspaces-BPFD8Of2.js} +1 -1
- package/dist/client/assets/{_shell.channels-CX4kki7G.js → _shell.channels-CnFdvRzc.js} +4 -4
- package/dist/client/assets/{_shell.connections-0vP7g7E4.js → _shell.connections-Ik01wS5M.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-TsuaO4eR.js → _shell.feedback-requests-Czu42kzo.js} +1 -1
- package/dist/client/assets/_shell.marketplace-Cezv-i16.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BTENmr4W.js +1 -0
- package/dist/client/assets/_shell.session-BjevHF_O.js +63 -0
- package/dist/client/assets/{_shell.team-Bm6cOBhR.js → _shell.team-UfaJqohh.js} +3 -3
- package/dist/client/assets/_shell.x._extensionId-0OO_Xr72.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-0OO_Xr72.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-CrvoN15x.js → abnfDiagram-WEYOIA3C-oxkfGyl6.js} +1 -1
- package/dist/client/assets/{access-copy-B3yNZ7Gz.js → access-copy-Dggxx2cX.js} +1 -1
- package/dist/client/assets/{arc-CuT6QA_y.js → arc-CqQdP0Qe.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-CPXCZ9H4.js → architectureDiagram-ZHVYKT53-89xM7zJD.js} +1 -1
- package/dist/client/assets/{banner-DRumuw3F.js → banner-DqJ2pM0Y.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-CM0rka9p.js → blockDiagram-RJAE7QA3-CcxwDmZC.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-D4j2cXRy.js → c4Diagram-XDPPPE54-DCIhIyXa.js} +1 -1
- package/dist/client/assets/{card-B3CtfC3R.js → card-DT-vFAns.js} +1 -1
- package/dist/client/assets/channel-Ngk70nQZ.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-KGyqhVpO.js → chunk-2E7WHVMD-BfWEXcCj.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-Dl0BHoqK.js → chunk-2Q5K7J3B-KLXLZXlR.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Da7vH6Kv.js → chunk-4EMNKR2T-CL5Gttmj.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-DgBUEROO.js → chunk-55XCU76K-cfAl84Mv.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-BQ4mn-_I.js → chunk-5VM5RSS4-BqUyGgoH.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-8LPR3mXf.js → chunk-JWPE2WC7-BWr2ST9i.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-BkIVXi4W.js → chunk-VQ5W62QI-V5zYx50O.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-DQXJx06h.js → chunk-XXDRQBXY-gnvheN_J.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-DzCE7qlD.js → chunk-ZCHMQSOR-ClGxxZvV.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-C_cZra7c.js → classDiagram-v2-4MYWR3UA-DvmHzDb5.js} +1 -1
- package/dist/client/assets/{command-CDKbyppr.js → command-CNx4L11m.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-DlXHdGwT.js → cose-bilkent-JH36ORCC-Df8nXBRj.js} +1 -1
- package/dist/client/assets/{cpu-B7xLO7jn.js → cpu-D8KJEkdh.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-HhP4ArLc.js → cynefin-EF2NZ3EQ-CAn6ufHs.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-D4GgWnZV.js → cynefinDiagram-WF24UDRP-Cep_NrRw.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-SZ_OI2Zi.js → dagre-NK4GIZVX-sWD3z9wf.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-BN-_Ja5m.js → diagram-CBK3MWTC-CUpaBATr.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-t7AK6xnL.js → diagram-I5XIIV2D-BejWB2ry.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-C1V7szSc.js → diagram-ODIL2UCW-BGKJfNk9.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-DPtraQ2g.js → diagram-PFBEJUXE-V0dP8H8k.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-D2XNRB2b.js → diagram-RJA3I4VV-Bf5dVsFX.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-BieaRy38.js → diagram-TYUNFSNR-CLrMSqb4.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-Bwki86UY.js → ebnfDiagram-V4P3TTPT-BGG4CWA0.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-WEXSAyHB.js → elk-QONTBCTQ-bf9D6f0w.js} +1 -1
- package/dist/client/assets/{empty-state-J-UJ0BUU.js → empty-state-CDoXnrKn.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-DIKASnoc.js → erDiagram-KYQIGQAA-fEUv-33P.js} +1 -1
- package/dist/client/assets/{execution-config-ILQiJAmy.js → execution-config-Ca9MDOtV.js} +1 -1
- package/dist/client/assets/{file-D40js1Zx.js → file-CiyVL55_.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-Dg3ZpiAe.js → file-exclamation-point-DaFRIKco.js} +1 -1
- package/dist/client/assets/{file-text-DgdvRfMk.js → file-text-DsnD-A8g.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-D4kBWC_1.js → find-latest-widget-fence-CNsnCgbB.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-CoavNw0M.js → flowDiagram-IUGLLWBU-CRbeSDod.js} +1 -1
- package/dist/client/assets/{form-DlPwEgQH.js → form-Cru78aT-.js} +1 -1
- package/dist/client/assets/{format-cron-BrK8RzgT.js → format-cron-9K38-tn1.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-DccKAz7f.js → ganttDiagram-R7GPNTJY-Mkk7zgs_.js} +1 -1
- package/dist/client/assets/{git-branch-BpxhecMq.js → git-branch-CONwEYiR.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DEbo_dgQ.js → gitGraphDiagram-PDYL7XHY-Drre0vyA.js} +1 -1
- package/dist/client/assets/{graph-DROgI3M3.js → graph-BJlnKWgo.js} +1 -1
- package/dist/client/assets/{heart-c7u4Ezxt.js → heart-CqwUlIUG.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CrATNdTR.js → highlighted-body-KPVGNVTW-e4LXC_pS.js} +1 -1
- package/dist/client/assets/{image-lightbox-DE_fHkw-.js → image-lightbox-DHDtzoja.js} +1 -1
- package/dist/client/assets/{image-off-BExgZjfM.js → image-off-DZuLkaRJ.js} +1 -1
- package/dist/client/assets/{index-D0eJtRlK.js → index-1yEXEZiH.js} +1 -1
- package/dist/client/assets/{index-Be0OJLWK.js → index-A41zxoWk.js} +1 -1
- package/dist/client/assets/{index-DeRDq7bD.js → index-B25gvCK_.js} +1 -1
- package/dist/client/assets/index-B9bZYNKR.js +1 -0
- package/dist/client/assets/{index-DaZ1I8s-.js → index-BBmkfbXd.js} +1 -1
- package/dist/client/assets/{index-DNGNMW3c.js → index-BDD2EyoW.js} +1 -1
- package/dist/client/assets/{index-Ccf1XBTs.js → index-BFNy-Yp3.js} +1 -1
- package/dist/client/assets/{index-DksjixUS.js → index-BIB-maE5.js} +1 -1
- package/dist/client/assets/{index-CbHCZsbE.js → index-BKp2B9JS.js} +1 -1
- package/dist/client/assets/{index-DCJQGDZk.js → index-BLP5O7X9.js} +1 -1
- package/dist/client/assets/{index-DhHobJd3.js → index-BTjZIgFn.js} +1 -1
- package/dist/client/assets/{index-BVqSmajJ.js → index-BV2Ezdxv.js} +1 -1
- package/dist/client/assets/{index-C7B3eSOP.js → index-B_0LYi32.js} +1 -1
- package/dist/client/assets/{index-DDgOoXP1.js → index-Bd7vUYhr.js} +1 -1
- package/dist/client/assets/{index-BlyoyIck.js → index-Bo7x9IkO.js} +1 -1
- package/dist/client/assets/{index-D150FXCC.js → index-BtDxwJsM.js} +1 -1
- package/dist/client/assets/{index-DswGXheF.js → index-By58MgcZ.js} +1 -1
- package/dist/client/assets/index-C3cvP8Fo.js +1033 -0
- package/dist/client/assets/{index-C5or4L_3.js → index-CVuEUzi5.js} +1 -1
- package/dist/client/assets/{index-BkoMsjtM.js → index-CoWJD3Jg.js} +2 -2
- package/dist/client/assets/{index-CqPRAM_6.js → index-CyVH876g.js} +1 -1
- package/dist/client/assets/{index-BGqvci3k.js → index-D67Kfy-M.js} +1 -1
- package/dist/client/assets/{index-D3YeRrne.js → index-DAlpmAIA.js} +1 -1
- package/dist/client/assets/{index-BEkYBuOq.js → index-DDNwNOHF.js} +1 -1
- package/dist/client/assets/{index-CD8aw6Jb.js → index-DL8ISRMH.js} +1 -1
- package/dist/client/assets/{index-AzyLwYS_.js → index-DabU6r9W.js} +3 -3
- package/dist/client/assets/{index-CT_pFeX_.js → index-DdJBZE0H.js} +1 -1
- package/dist/client/assets/{index-B3eeEDWj.js → index-DijWcSDZ.js} +1 -1
- package/dist/client/assets/index-DyRGZyur.css +1 -0
- package/dist/client/assets/{index-DINk1YfD.js → index-DzwZJuO1.js} +1 -1
- package/dist/client/assets/{index-CZmqtJWZ.js → index-HR8BYVRQ.js} +1 -1
- package/dist/client/assets/{index-J3Hh1MnL.js → index-LEcodwyW.js} +1 -1
- package/dist/client/assets/index-UPF8suf2.js +1 -0
- package/dist/client/assets/{index-DT7pv2iW.js → index-Vz7VUm9l.js} +1 -1
- package/dist/client/assets/index-YW-v746p.js +1 -0
- package/dist/client/assets/{index-2wezsLA_.js → index-cI2u8WZS.js} +1 -1
- package/dist/client/assets/{index-InEBtYxw.js → index-iTQUa_b2.js} +6 -6
- package/dist/client/assets/{index-CYy1cjtq.js → index-mZqojApH.js} +1 -1
- package/dist/client/assets/{index-dyAahqKe.js → index-pVFjKNjX.js} +1 -1
- package/dist/client/assets/{index-DxiRRZRo.js → index-skAhJyIF.js} +1 -1
- package/dist/client/assets/{index-BizvylBV.js → index-vJy88bwb.js} +1 -1
- package/dist/client/assets/index-wY5OcS4a.js +43 -0
- package/dist/client/assets/{index-mwf7ZNk2.js → index-x1yAu9zJ.js} +1 -1
- package/dist/client/assets/{index-F-vqXYqa.js → index-xAgihCJ7.js} +1 -1
- package/dist/client/assets/{index.esm-BFJ9SG0n.js → index.esm-BUPoRUaG.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-VL8q5pKx.js → infoDiagram-MVDRKAX5-B_Wyzufh.js} +1 -1
- package/dist/client/assets/{inline-code-BE9ckzPs.js → inline-code-BIzGDx6z.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-BLKkPYF-.js → ishikawaDiagram-HPEHV2GE-BDk2-6Pd.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-CSYpRobu.js → journeyDiagram-BOSHW7O7-7qf9KWEQ.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-HilAqtZo.js → kanban-definition-FNSA4HC5-CFYDQmXn.js} +1 -1
- package/dist/client/assets/{layers-Cm7coqdo.js → layers-C9tVVcXg.js} +1 -1
- package/dist/client/assets/{lightbulb-DqdWS75d.js → lightbulb-f4jtsAh0.js} +1 -1
- package/dist/client/assets/{link-2-CDJapTSa.js → link-2-ZNlK1BG1.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CP82p1u4.js → list-runtime-types-CqO-QFYD.js} +1 -1
- package/dist/client/assets/{markdown-content-m_qereFc.js → markdown-content-DaEVxezf.js} +1 -1
- package/dist/client/assets/{mention-pill-DV5HIG5Q.js → mention-pill-BiCPflY-.js} +1 -1
- package/dist/client/assets/{mermaid.core-zxW6MBr-.js → mermaid.core-SX8SzrsU.js} +4 -4
- package/dist/client/assets/{message-square-off-YVtpbaJ0.js → message-square-off-_qbedNGF.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-IAYemvOg.js → mindmap-definition-6OY57UG3-BloJIArH.js} +1 -1
- package/dist/client/assets/{more-details-ReA2ZFBn.js → more-details-CdJT0Ehl.js} +1 -1
- package/dist/client/assets/{owner-notice-M4hn_1ep.js → owner-notice-BDafFD_I.js} +1 -1
- package/dist/client/assets/{package-CUuTl39E.js → package-Cb7lEm7t.js} +1 -1
- package/dist/client/assets/{page-container-BnmNikNZ.js → page-container-DsRgIMAL.js} +1 -1
- package/dist/client/assets/{paperclip-C6fYq5Zf.js → paperclip-DNu1VtoX.js} +1 -1
- package/dist/client/assets/{path-input-DHn9-XaE.js → path-input-D3O71b-X.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-CojaUwe7.js → pegDiagram-ECIUJNBX-Di48kPNu.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CjP3pw6V.js → pieDiagram-GNMPY74T-DY8B_SPD.js} +1 -1
- package/dist/client/assets/{plug-DHQcxt7N.js → plug-IIS_cL9-.js} +1 -1
- package/dist/client/assets/{primer-trigger-BmV5wjek.js → primer-trigger-DurKYe8C.js} +2 -2
- package/dist/client/assets/{profile-errors-BSCuj3rT.js → profile-errors-BdhZfdvZ.js} +1 -1
- package/dist/client/assets/{progress-4FQQfnS6.js → progress-g5kkqvlR.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-OP0Z8zcR.js → quadrantDiagram-D57K4MC3-Depv_dON.js} +1 -1
- package/dist/client/assets/{query-error-state-BkUdxenP.js → query-error-state-PuLGD7Jp.js} +1 -1
- package/dist/client/assets/{radio-ta5Bw763.js → radio-QOLZSBz1.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-CT3NCb9b.js → railroadDiagram-Y72NRBL7-BfD2AiZM.js} +1 -1
- package/dist/client/assets/registry-Ck8p6n1T.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-DwUuyxao.js → relay-trace-schemas-DF_DfZ7s.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-tde4lYGp.js → requirementDiagram-EQYSW5RA-B1iTjrkD.js} +1 -1
- package/dist/client/assets/{room-files-source-CZWhaaOy.js → room-files-source-g1th8mWs.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-RfbbgUa4.js → rotate-ccw-clock-BGwYMaGL.js} +1 -1
- package/dist/client/assets/{rotate-cw-B3rB_YSw.js → rotate-cw-B4Y0q4GY.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-sdCzIA7-.js → sankeyDiagram-SY24JHO5-D5TzVJrQ.js} +1 -1
- package/dist/client/assets/{scroll-area-B4WB7Q40.js → scroll-area-BvScZKSa.js} +1 -1
- package/dist/client/assets/{search-x-DCUmWW2_.js → search-x-CqN5twBj.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-DvzTJcKu.js → sequenceDiagram-BLEHNHQU-BhUahaNf.js} +1 -1
- package/dist/client/assets/{shield-x-CANziVLc.js → shield-x-DHJrwtKp.js} +1 -1
- package/dist/client/assets/signed-in-BmywDpR5.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-DuDA7TKE.js → sizeCapture-INFHLROL-D2Vi1Kq9.js} +1 -1
- package/dist/client/assets/{soul-file-Co_8f1qw.js → soul-file-BMpVFN7U.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BJPX5JTC.js → stateDiagram-v2-A6IESKWZ-b9gSbZnF.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-CiLSffGv.js → swimlanes-B3ENRKFQ-i47jxLY6.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CA9gW19w.js +8 -0
- package/dist/client/assets/{table-BSAvOYPp.js → table-CN2HCi4p.js} +1 -1
- package/dist/client/assets/{terminal-6CdY-T1V.js → terminal-BORQniao.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-5oq8sl82.js → timeline-definition-JXYKGLGB-eY5gj0js.js} +1 -1
- package/dist/client/assets/{trust-posture-D-Yjm6ot.js → trust-posture-Bcyy5Fub.js} +1 -1
- package/dist/client/assets/{unplug-Bq_1WdV7.js → unplug-lkD35Rwp.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CEzu54YH.js → unverified-catalog-notice-DiCIrrhU.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-Tn3ZbPAj.js → use-adapter-catalog-BrqVd-47.js} +1 -1
- package/dist/client/assets/{use-bindings-Bz9YRgO7.js → use-bindings-CU2RSXOy.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-D9oKJSQN.js → use-composer-prefs-Dy2oTM8Y.js} +1 -1
- package/dist/client/assets/{use-connector-management-CLYFraXN.js → use-connector-management-5oRqzydY.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DkS713kG.js → use-deep-link-scroll-Bg5nW8qq.js} +1 -1
- package/dist/client/assets/{use-delete-binding-CukKpHBK.js → use-delete-binding-qeyRkvR1.js} +1 -1
- package/dist/client/assets/{use-dev-links-DQ32IcGe.js → use-dev-links-FY4J_PjA.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-D-FO_XW6.js → use-external-adapter-catalog-HiWFZZrW.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-BNxcyb1j.js → use-full-activity-feed-K1uk9Wya.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-Cu_jKnft.js +1 -0
- package/dist/client/assets/use-is-hub-BX7ypNRJ.js +1 -0
- package/dist/client/assets/{use-jump-back-in-Bibj5tVk.js → use-jump-back-in-BjZ8EswV.js} +1 -1
- package/dist/client/assets/{use-local-browser-xg7WXAVK.js → use-local-browser-CTFiF0wf.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BgCSFw8s.js → use-mesh-topology-CafidaIH.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-qRbdZfOU.js → use-mounted-ref-B38uSLCx.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-B-4kZR7I.js → use-notification-prefs-m9XSNB6W.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-CCq-mZlY.js → use-panel-tab-placements-D9n6rNJ1.js} +1 -1
- package/dist/client/assets/use-pending-read-BoV-UI1E.js +1 -0
- package/dist/client/assets/{use-personality-commit-DwSisUfF.js → use-personality-commit-ChLQfLrK.js} +1 -1
- package/dist/client/assets/{use-promo-activation-Botoso6l.js → use-promo-activation-DbJDgp4_.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-RJXp-r_J.js → use-promo-dismissals-Csw0j0N0.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-B3390hGg.js → use-pulse-freshness-BIZ7daHW.js} +1 -1
- package/dist/client/assets/{use-relay-config-BV0xcLwS.js → use-relay-config-hUB3lVFv.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Du4hKHIJ.js → use-room-follow-claim-BpKzhniV.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-g2hO6Ruz.js → use-roving-tab-list-BtM0bZL7.js} +1 -1
- package/dist/client/assets/{use-session-canvas-i30oMO_Q.js → use-session-canvas-DRrkNRcL.js} +3 -3
- package/dist/client/assets/use-session-diagnostics-BTNgouum.js +16 -0
- package/dist/client/assets/{use-unclaimed-chats-B92om889.js → use-unclaimed-chats-BbMZtNG9.js} +1 -1
- package/dist/client/assets/use-update-config-CkWwKNkY.js +1 -0
- package/dist/client/assets/{useMutationState-DdOGdpjP.js → useMutationState-CVpvw27W.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-Di5pJvcw.js → usecaseDiagram-WPOLBNNX-CHcpeLg4.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-K7KAf26T.js → vennDiagram-Q3Y3IDCW-gQbZL_A6.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-DVTaxQt9.js → wardleyDiagram-IVAIDKWA-BFH_WHzZ.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-x-lSJm_B.js → xychartDiagram-4URNHDU4-B0QpyqeZ.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261019185620_dor3037_wifi_holds.sql +8 -0
- package/dist/drizzle/meta/20261019185620_snapshot.json +14079 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/extension-child.cjs +18 -2
- package/dist/server/index.js +55523 -26605
- package/dist/server/index.js.map +2 -2
- package/package.json +6 -6
- package/dist/client/assets/ApplyToOverridesDialog-CoO6V1G4.js +0 -1
- package/dist/client/assets/HandlePage-Cg8H3mQS.js +0 -1
- package/dist/client/assets/NamePage-Bx8T98OF.js +0 -1
- package/dist/client/assets/PermissionHistory-DzU1rf2B.js +0 -1
- package/dist/client/assets/PhotoPage-CmrOIRjf.js +0 -1
- package/dist/client/assets/SeenDevices-SPWkdzoK.js +0 -19
- package/dist/client/assets/SettingsDialog-_dEXUhHe.js +0 -12
- package/dist/client/assets/ToolsPage-Idimrn3o.js +0 -2
- package/dist/client/assets/_shell-ClVN2pUj.js +0 -80
- package/dist/client/assets/_shell.marketplace-CiL6YRbl.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-C0sI8e21.js +0 -1
- package/dist/client/assets/_shell.session-_hhBvFc6.js +0 -63
- package/dist/client/assets/_shell.x._extensionId-BWy5v1YE.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-BWy5v1YE.js +0 -1
- package/dist/client/assets/channel-DjBlTcCV.js +0 -1
- package/dist/client/assets/index-7jby-RRg.js +0 -1
- package/dist/client/assets/index-BqIHtiaE.js +0 -1
- package/dist/client/assets/index-Cga0qx1T.js +0 -1033
- package/dist/client/assets/index-Ct4At33X.js +0 -1
- package/dist/client/assets/index-DITPwUa9.js +0 -38
- package/dist/client/assets/index-DUZrTFYD.css +0 -1
- package/dist/client/assets/registry-Dc102rws.js +0 -1
- package/dist/client/assets/signed-in-DctJ2IWe.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Dv1-QS9J.js +0 -8
- package/dist/client/assets/use-is-below-desktop-gTvJDvw4.js +0 -1
- package/dist/client/assets/use-is-hub-B1vPpkYU.js +0 -1
- package/dist/client/assets/use-pending-read-C8L_v4Zw.js +0 -1
- package/dist/client/assets/use-session-diagnostics-a4b83F5J.js +0 -16
- package/dist/client/assets/use-update-config-Tbn3SodN.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,cM as F,cN as G,G as b,ar as f,bx as v,cO as U,cP as $,cQ as B,J as D,r as u,cR as E,B as W,X as V,cS as J,b as q,e as K,t as Q,g as X}from"./index-
|
|
1
|
+
import{j as e,cM as F,cN as G,G as b,ar as f,bx as v,cO as U,cP as $,cQ as B,J as D,r as u,cR as E,B as W,X as V,cS as J,b as q,e as K,t as Q,g as X}from"./index-C3cvP8Fo.js";import{u as Y,P as Z}from"./use-personality-commit-ChLQfLrK.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-BMpVFN7U.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 O(){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 _({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(_,{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(O,{})})]});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(_,{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(O,{})});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),[R,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)},[]),z=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]),M=u.useCallback(m=>{t({icon:m===c?null:m}),j(`emoji-${m}`),g()},[t,c,j,g]),L=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:z,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:L,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:M,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(v,{children:R&&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=Y(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=Q(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(X,{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(Z,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{be as AppearancePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gO as C,a1 as A,a2 as k,gP as x,a3 as T,a4 as j,au as R,gQ as P,gR as D,a7 as N,j as n,by as I,bz as E,G as L,bA as B,bC as q,r as F,cy as _,cz as O,cB as K,cC as z,cD as M,dy as Q,gS as W,e1 as U,de as H,B as p}from"./index-C3cvP8Fo.js";function V(e,s){const a=new Set(e.filesAndCommands.followingAgentIds);if(s.kind==="files")return a.size;const t=e.exceptions.filter(o=>o.action===void 0),r=new Set;if(s.kind==="preset"){const o=new Map;for(const c of t){const l=o.get(c.agentId)??new Set;l.add(c.area),o.set(c.agentId,l)}for(const[c,l]of o)l.size>=C.length&&!a.has(c)&&r.add(c)}else{for(const o of t)o.area===s.area&&r.add(o.agentId);if(s.kind==="action")for(const o of e.exceptions)o.action===s.action&&r.add(o.agentId)}return Math.max(0,e.agentCount-r.size)}function Z(e){return`affects ${e} ${e===1?"agent":"agents"}`}function ee(){const e=A();return k({queryKey:x.overview(),queryFn:()=>e.getPermissions()})}function se(e){const s=A(),a=T();return j({mutationFn:async t=>{if(t.kind==="preset"){if(e.kind!=="default")throw new Error("A preset is chosen for everyone.");return s.setPermissionPreset({preset:t.preset,surface:t.surface,...t.applyToAgents?{applyToAgents:t.applyToAgents}:{}})}const r={...t.areas?{areas:t.areas}:{},...t.actions?{actions:t.actions}:{},surface:t.surface};return e.kind==="agent"?s.patchAgentPermissions(e.agentId,{...r,...t.filesAndCommands!==void 0?{filesAndCommands:t.filesAndCommands}:{}}):s.patchPermissionDefaults({...r,...t.applyToAgents?{applyToAgents:t.applyToAgents}:{}})},onSettled:()=>{a.invalidateQueries({queryKey:x.all}),a.invalidateQueries({queryKey:["mesh","agents"]}),a.invalidateQueries({queryKey:R.all})}})}const h={blocked:"Blocked",ask:"Ask",allowed:"Allowed"},v={careful:"Careful",balanced:"Balanced",full:"Full power",trusted:"Trusted"},te={careful:"Agents ask before they change anything, and can’t reach outside DorkOS.",balanced:"Agents run their rooms and ask before anything wider.",full:"Agents do everyday work alone and ask before installs or settings changes.",trusted:"Agents work on their own, and everything they do is recorded."};function ne(e,s){switch(e){case"default-area":case"default-action":return"Changed from your preset";case"preset":return`From ${v[s??"trusted"]}`;case"floor":return"Never Allowed";case"always-asks":return"Always asks, so you see the change first";default:return""}}const ae="Blocked stops agents that follow the rules. It isn’t a sandbox.";function re(e){switch(e){case"agent":return"Set for this agent";case"runtime":return"Set in Settings → Runtimes";case"default":return"The setting everyone has";case"runtime-own":return"Not set, so each AI tool uses its own default"}}function w(e){return`the default (${v[e??"trusted"]})`}function oe(e){const s=h[e.state],a=e.agentName??"this agent";switch(e.source){case"inactive":return"Blocked, because this agent’s access was turned off.";case"floor":return`${s}. This area is locked, so it’s never Allowed.`;case"always-asks":return e.fromExtension?`${s}. Extension tools that can delete things always ask.`:`${s}. It always shows you the change first, so it’s never Allowed.`}if(e.destructiveAsk)return"Ask. Actions that run someone else’s code ask unless set one by one.";switch(e.source){case"agent-area":return`${s}, set for ${a}.`;case"agent-action":return`${s}, set for this one action on ${a}.`;case"default-area":return`${s} for everyone, changed from ${w(e.preset)}.`;case"default-action":return`${s} for everyone, set for this one action.`;case"preset":return`${s}, from ${w(e.preset)}.`}}function ie(e,s,a){const t=e?P(e):null;switch(s){case"agent":return`${t}, set for ${a??"this agent"}.`;case"runtime":return`${t}, set in Settings → Runtimes.`;case"default":return`${t}, the setting everyone has.`;case"runtime-own":return"Not set, so each AI tool uses its own default."}}const G={settings:" in Settings","agent-page":" on the agent’s page","control-center":" in the Control Center","request-card":" from a request card","first-run":" during setup","agent-request":" from an agent's request",api:" through the API",cli:" from the command line",upgrade:"",undo:" with Undo","file-edit":""};function X(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Y(e){if(!e)return null;const s=`on ${X(e.occurredAt)}`,a=G[e.surface];switch(e.attribution){case"signed-in":return`Changed by ${e.actorLabel.charAt(0).toLowerCase()+e.actorLabel.slice(1)} ${s}${a}.`;case"local-trust":return`Changed ${s}${a}. With login off, who is unknown.`;case"agent-request-approved":return`Changed ${s}: ${e.actorLabel}.`;case"agent":return`Changed by ${e.actorLabel} ${s}.`;case"upgrade":return`Set by an upgrade ${s}.`;case"outside":return`Changed outside DorkOS ${s}, in the agent’s settings file.`}}function ce(e){D(e)||N.error(e instanceof Error&&e.message?e.message:"Couldn’t save that change. Try again.")}function le({question:e,sentence:s,lastChange:a,className:t}){const r=Y(a);return n.jsxs(I,{children:[n.jsx(E,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e,className:L("text-muted-foreground hover:text-foreground focus-visible:ring-ring inline rounded-sm py-2 text-xs underline decoration-dotted underline-offset-2 transition-colors focus-visible:ring-2 focus-visible:outline-none md:py-0",t),children:"Why?"})}),n.jsxs(B,{className:"w-72 space-y-1.5",align:"start",children:[n.jsx(q,{className:"text-sm font-medium",children:e}),n.jsx("p",{className:"text-sm","data-testid":"permission-why-source",children:s}),r?n.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"permission-why-change",children:r}):null]})]})}function de({open:e,onCancel:s,subject:a,title:t,next:r,agents:o,affectedCount:c,onKeep:l,onUpdate:S,pending:m=!1}){const[u,f]=F.useState(new Set),b=r in h?h[r]:r,y=o.length,$=(i,g)=>{const d=new Set(u);g?d.add(i):d.delete(i),f(d)};return n.jsx(_,{open:e,onOpenChange:i=>{i||(f(new Set),s())},children:n.jsxs(O,{className:"!min-h-0 sm:max-w-md",children:[n.jsxs(K,{children:[n.jsx(z,{children:t??`Set ${a} to ${b} for everyone?`}),n.jsxs(M,{children:[y===1?"1 agent is":`${y} agents are`," set differently. Pick any that should follow."]})]}),n.jsxs(Q,{className:"space-y-3",children:[n.jsx("ul",{className:"space-y-2","aria-label":"Agents set differently",children:o.map(i=>{const g=`apply-${i.agentId}`;return n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx(W,{id:g,checked:u.has(i.agentId),onCheckedChange:d=>$(i.agentId,d===!0)}),n.jsxs(U,{htmlFor:g,className:"text-sm font-normal",children:[i.agentName,": ",i.detail]})]},i.agentId)})}),n.jsxs("p",{className:"text-muted-foreground text-sm",children:["This affects ",c," ",c===1?"agent":"agents"," now."]})]}),n.jsxs(H,{className:"gap-2",children:[n.jsx(p,{variant:"outline",onClick:()=>{f(new Set),l()},disabled:m,children:"Keep their settings"}),n.jsx(p,{onClick:()=>{const i=[...u];f(new Set),S(i)},disabled:m||u.size===0,children:"Update selected"})]})]})})}export{de as A,ae as B,le as P,h as S,se as a,ie as b,V as c,Z as d,v as e,re as f,ne as g,te as h,Y as l,ce as r,oe as s,ee as u};
|
package/dist/client/assets/{AttentionSignalRow-CjjZobp7.js → AttentionSignalRow-B1aMjgX_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ax as r,ay as n,j as e,ar as i,a0 as o,B as d}from"./index-
|
|
1
|
+
import{ax as r,ay as n,j as e,ar as i,a0 as o,B as d}from"./index-C3cvP8Fo.js";const c={initial:{opacity:0,y:8},animate:{opacity:1,y:0}};function l({signal:t}){const a=r(),s=n(t.since);return e.jsxs(i.div,{variants:c,"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:[e.jsx("span",{className:"bg-status-error size-1.5 shrink-0 rounded-full","aria-hidden":!0}),e.jsx(o,{className:"text-status-error/70 size-3.5 shrink-0","aria-hidden":!0}),e.jsxs("span",{className:"text-foreground/90 min-w-0 flex-1 truncate text-xs",children:[t.primary,t.secondary!==void 0&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.secondary]})]}),e.jsx("span",{className:"text-muted-foreground shrink-0 text-xs tabular-nums",children:s}),e.jsx(d,{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 ${t.primary}`,onClick:()=>void a.navigate({href:t.deepLink}),children:"Open →"})]})}export{l as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as L,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-
|
|
1
|
+
import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as L,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-CoWJD3Jg.js";import{cG as Dt,cH as be,aV as V,cI as st,cJ as Tt,cK as At,cL as Rt}from"./index-C3cvP8Fo.js";let Mt={data:""},Pt=r=>{if(typeof window=="object"){let e=(r?r.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(r||document.head).appendChild(e),e.firstChild}return r||Mt},Lt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ot=/\/\*[^]*?\*\/| +/g,lt=/\n+/g,ae=(r,e)=>{let i="",t="",c="";for(let a in r){let l=r[a];a[0]=="@"?a[1]=="i"?i=a+" "+l+";":t+=a[1]=="f"?ae(l,a):a+"{"+ae(l,a[1]=="k"?"":e)+"}":typeof l=="object"?t+=ae(l,e?e.replace(/([^,])+/g,v=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,v):v?v+" "+u:u)):a):l!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=ae.p?ae.p(a,l):a+":"+l+";")}return i+(e&&c?e+"{"+c+"}":c)+t},ne={},bt=r=>{if(typeof r=="object"){let e="";for(let i in r)e+=i+bt(r[i]);return e}return r},jt=(r,e,i,t,c)=>{let a=bt(r),l=ne[a]||(ne[a]=(u=>{let o=0,n=11;for(;o<u.length;)n=101*n+u.charCodeAt(o++)>>>0;return"go"+n})(a));if(!ne[l]){let u=a!==r?r:(o=>{let n,k,m=[{}];for(;n=Lt.exec(o.replace(Ot,""));)n[4]?m.shift():n[3]?(k=n[3].replace(lt," ").trim(),m.unshift(m[0][k]=m[0][k]||{})):m[0][n[1]]=n[2].replace(lt," ").trim();return m[0]})(r);ne[l]=ae(c?{["@keyframes "+l]:u}:u,i?"":"."+l)}let v=i&&ne.g;return i&&(ne.g=ne[l]),((u,o,n,k)=>{k?o.data=o.data.replace(k,u):o.data.indexOf(u)===-1&&(o.data=n?u+o.data:o.data+u)})(ne[l],e,t,v),l},Ht=(r,e,i)=>r.reduce((t,c,a)=>{let l=e[a];if(l&&l.call){let v=l(i),u=v&&v.props&&v.props.className||/^go/.test(v)&&v;l=u?"."+u:v&&typeof v=="object"?v.props?"":ae(v,""):v===!1?"":v}return t+c+(l??"")},"");function ue(r){let e=this||{},i=r.call?r(e.p):r;return jt(i.unshift?i.raw?Ht(i,[].slice.call(arguments,1),e.p):i.reduce((t,c)=>Object.assign(t,c&&c.call?c(e.p):c),{}):i,Pt(e.target),e.g,e.o,e.k)}ue.bind({g:1});ue.bind({k:1});var D={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",70:"b3",20:"33"},font:{size:{"2xs":"calc(var(--tsrd-font-size) * 0.625)",xs:"calc(var(--tsrd-font-size) * 0.75)",sm:"calc(var(--tsrd-font-size) * 0.875)",md:"var(--tsrd-font-size)"},lineHeight:{xs:"calc(var(--tsrd-font-size) * 1)",sm:"calc(var(--tsrd-font-size) * 1.25)"},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontFamily:{sans:"ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"}},border:{radius:{xs:"calc(var(--tsrd-font-size) * 0.125)",sm:"calc(var(--tsrd-font-size) * 0.25)",md:"calc(var(--tsrd-font-size) * 0.375)",full:"9999px"}},size:{0:"0px",.5:"calc(var(--tsrd-font-size) * 0.125)",1:"calc(var(--tsrd-font-size) * 0.25)",1.5:"calc(var(--tsrd-font-size) * 0.375)",2:"calc(var(--tsrd-font-size) * 0.5)",2.5:"calc(var(--tsrd-font-size) * 0.625)",3:"calc(var(--tsrd-font-size) * 0.75)",3.5:"calc(var(--tsrd-font-size) * 0.875)",4:"calc(var(--tsrd-font-size) * 1)",5:"calc(var(--tsrd-font-size) * 1.25)",8:"calc(var(--tsrd-font-size) * 2)"}},Gt=r=>{const{colors:e,font:i,size:t,alpha:c,border:a}=D,{fontFamily:l,lineHeight:v,size:u}=i,o=r?ue.bind({target:r}):ue;return{devtoolsPanelContainer:o`
|
|
2
2
|
direction: ltr;
|
|
3
3
|
position: fixed;
|
|
4
4
|
bottom: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gS as v,gT as fe,gn as be,gU as Ce,j as e,gc as ee,gd as ne,ge as te,gf as se,gV as Ne,gg as ae,gW as ie,gh as re,gi as ce,gj as oe,a1 as de,a3 as Ie,a4 as Te,a2 as Ae,y as le,gX as Se,r as A,gY as he,e1 as g,dW as S,dX as k,dY as R,dZ as F,d_ as b,gZ as ke,g_ as Re,$ as E,_ as pe,as as Fe,g$ as Oe,h0 as we,cv as Me,cy as De,cz as Ee,cB as Be,cC as $e,cD as _e,ak as Le,I as Pe,h1 as X,B,de as ze,h2 as qe,ev as He,h3 as Ye,x as We}from"./index-Cga0qx1T.js";import{B as Ge}from"./use-bindings-Bz9YRgO7.js";import{u as Ue}from"./form-DlPwEgQH.js";import{u as Ke}from"./use-adapter-catalog-Tn3ZbPAj.js";import{I as Qe,t as Ve}from"./trust-posture-D-Yjm6ot.js";function Z(n){return`Turn on ${be(n.stop)}`}function Xe(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Ze({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Xe(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&&Z(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&&Z(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Ge]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Je(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const J=[{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:q}){const u=J.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 H(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:q?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:J.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:H,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(Ze,{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 hn(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 pn(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 mn({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,q]=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=Ue({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=[]}=Ke(),{data:f}=Me(),[I,H]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Je(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(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{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 W=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,G=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,U=W&&G?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${G}.`:null,K=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!W||!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),H(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:Le(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(Pe,{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(X,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:K?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(X,{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))]})]})]})}),K&&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:q,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(ze,{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(He,{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:Ye({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(We,{size:"xs",className:"mr-1.5"}),Q?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,ge as d,pn as t,Je as u};
|
|
1
|
+
import{gT as v,gU as fe,gQ as be,gV as Ce,j as e,gc as ee,gd as ne,ge as te,gf as se,gW as Ne,gg as ae,gX as ie,gh as re,gi as ce,gj as oe,a1 as de,a3 as Ie,a4 as Te,a2 as Ae,y as le,gY as Se,r as A,gZ as he,e1 as g,dW as S,dX as k,dY as R,dZ as F,d_ as b,g_ as ke,g$ as Re,$ as E,_ as pe,as as Fe,h0 as Oe,h1 as we,cv as Me,cy as De,cz as Ee,cB as Be,cC as $e,cD as _e,ak as Le,I as Pe,h2 as X,B,de as ze,h3 as qe,ev as He,h4 as Ye,x as We}from"./index-C3cvP8Fo.js";import{B as Ge}from"./use-bindings-CU2RSXOy.js";import{u as Qe}from"./form-Cru78aT-.js";import{u as Ue}from"./use-adapter-catalog-BrqVd-47.js";import{I as Ke,t as Ve}from"./trust-posture-Bcyy5Fub.js";function Z(n){return`Turn on ${be(n.stop)}`}function Xe(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Ze({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Xe(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&&Z(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&&Z(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Ge]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Je(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const J=[{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:q}){const u=J.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 H(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:q?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:J.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:H,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(Ze,{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(Ke,{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 hn(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 pn(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 mn({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,q]=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=Qe({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=[]}=Ue(),{data:f}=Me(),[I,H]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Je(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(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{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 W=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,G=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,Q=W&&G?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${G}.`:null,U=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!W||!ue||!!M||x,K=!!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),H(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:Le(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(Pe,{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(X,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:U?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(X,{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))]})]})]})}),U&&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:q,hasChanges:ye}),Q&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:Q})]}),e.jsxs(ze,{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(He,{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:Ye({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:[K&&e.jsx(We,{size:"xs",className:"mr-1.5"}),K?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,ge as d,pn as t,Je as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-
|
|
2
|
-
var E7=Object.defineProperty;var S1=r=>{throw TypeError(r)};var D7=(r,e,t)=>e in r?E7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ce=(r,e,t)=>D7(r,typeof e!="symbol"?e+"":e,t),nd=(r,e,t)=>e.has(r)||S1("Cannot "+t);var C=(r,e,t)=>(nd(r,e,"read from private field"),t?t.call(r):e.get(r)),_=(r,e,t)=>e.has(r)?S1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),F=(r,e,t,n)=>(nd(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Wi=(r,e,t)=>(nd(r,e,"access private method"),t);import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-SX8SzrsU.js","assets/index-C3cvP8Fo.js","assets/index-DyRGZyur.css","assets/transform-BqqRT-Iy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var E7=Object.defineProperty;var S1=r=>{throw TypeError(r)};var D7=(r,e,t)=>e in r?E7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ce=(r,e,t)=>D7(r,typeof e!="symbol"?e+"":e,t),nd=(r,e,t)=>e.has(r)||S1("Cannot "+t);var C=(r,e,t)=>(nd(r,e,"read from private field"),t?t.call(r):e.get(r)),_=(r,e,t)=>e.has(r)?S1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),F=(r,e,t,n)=>(nd(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Wi=(r,e,t)=>(nd(r,e,"access private method"),t);import{pv as C1,pw as O7,px as _2,py as gh,pz as R7,pA as I7,pB as z7,r as R,R as j2,e6 as bc,pC as yh,pD as vh,pE as $s,pF as M1,pG as V2,pH as L7,pI as ol,pJ as al,pK as T1,pL as es,pM as B7,pN as P7,pO as F7,pP as f0,pQ as W2,pR as Ua,gE as $7,pS as q7,pT as ns,pU as Tr,pV as Ui,pW as Hc,pX as je,ep as H7,pY as _7,pZ as j7,p_ as Wr,p$ as tu,q0 as Mi,q1 as U2,q2 as A1,j as L,gD as V7,G as W7,aX as U7}from"./index-C3cvP8Fo.js";import{p as zf}from"./index-BIB-maE5.js";import{aw as K7,ax as G7,ab as J7,ac as Y7,ad as X7,ae as Z7,af as Q7,ag as K2,ah as eb,q as p0,ai as tb,aj as G2,ar as rb,ak as nb,al as ib,am as sb,an as ob,ao as ab,ap as lb,aq as cb,Z as Lf,a4 as ub,a5 as J2,a6 as db,a7 as hb,a8 as fb,a9 as pb,aa as mb,m as gb,a as yb,ay as vb,E as Fa,as as bb,t as ht,n as wb,at as kb,C as N1,az as xb}from"./index-DabU6r9W.js";const Sb={}.hasOwnProperty;function Y2(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)Y2(r,e.extensions[t]);for(n in e)if(Sb.call(e,n))switch(n){case"extensions":break;case"unsafe":{E1(r[n],e[n]);break}case"join":{E1(r[n],e[n]);break}case"handlers":{Cb(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function E1(r,e){e&&r.push(...e)}function Cb(r,e){e&&Object.assign(r,e)}const Mb=[Tb];function Tb(r,e,t,n){if(e.type==="code"&&C1(e,n)&&(r.type==="list"||r.type===e.type&&C1(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&O7(e,n))?void 0:t.spread?1:0}const Ki=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Ab=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
3
3
|
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Ki},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
4
4
|
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
5
5
|
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
@@ -1228,4 +1228,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1228
1228
|
fill: hsl(var(--muted-foreground)) !important;
|
|
1229
1229
|
stroke: hsl(var(--muted-foreground)) !important;
|
|
1230
1230
|
}
|
|
1231
|
-
`,hz={look:"classic",fontFamily:"var(--font-sans)",themeCSS:dz},fz=()=>U7(()=>import("./mermaid.core-
|
|
1231
|
+
`,hz={look:"classic",fontFamily:"var(--font-sans)",themeCSS:dz},fz=()=>U7(()=>import("./mermaid.core-SX8SzrsU.js").then(r=>r.bm),__vite__mapDeps([0,1,2,3])).then(r=>(r.default.initialize(hz),r));function pz({value:r,editable:e,onChange:t,className:n,sourceRevision:i,onSourceReady:s,onSourceSelection:o,onTaskToggleRequest:a,wikiLinks:l}){const c=V7();return L.jsx("div",{"data-theme":c,className:"dorkos-markdown contents",children:L.jsx(cz,{value:r,theme:c,editable:e,onChange:t,sourceRevision:i,onSourceReady:s,onSourceSelection:o,onTaskToggleRequest:a,wikiLinks:l,mermaid:fz,className:W7("desktop:select-text",n)})})}const bz=Object.freeze(Object.defineProperty({__proto__:null,BlintzCanvas:pz},Symbol.toStringTag,{value:"Module"}));export{bz as B,G0 as S,nD as a,rD as b,sD as c,UE as f,J0 as i,Iv as p,wv as r,J4 as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ep as Ee,a1 as xe,aW as Re,r as ve,a2 as Se,j,G as Ce}from"./index-
|
|
1
|
+
import{ep as Ee,a1 as xe,aW as Re,r as ve,a2 as Se,j,G as Ce}from"./index-C3cvP8Fo.js";import{u as Oe}from"./index-pVFjKNjX.js";import{r as Te}from"./use-session-canvas-DRrkNRcL.js";import"./rotate-cw-B4Y0q4GY.js";import"./query-keys-DeYqUDia.js";import"./index.esm-BUPoRUaG.js";import"./WidgetErrorCard-1NyzIJBj.js";import"./index-xAgihCJ7.js";import"./card-DT-vFAns.js";import"./progress-g5kkqvlR.js";import"./markdown-content-DaEVxezf.js";import"./table-CN2HCi4p.js";import"./terminal-BORQniao.js";import"./package-Cb7lEm7t.js";import"./heart-CqwUlIUG.js";import"./git-branch-CONwEYiR.js";import"./file-text-DsnD-A8g.js";import"./file-CiyVL55_.js";import"./McpAppFrame-BM9cNPPd.js";import"./more-details-CdJT0Ehl.js";var he={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.7.0
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-
|
|
2
|
-
import{r as n,aW as B,gF as ne,j as t,B as L,a3 as se,G as ae,J as ie,gs as ce,gG as ue,aX as $,a1 as oe,gH as le,a2 as de}from"./index-Cga0qx1T.js";import{u as fe,a as he,b as ve}from"./use-session-canvas-i30oMO_Q.js";import{R as pe}from"./rotate-cw-B3rB_YSw.js";import"./query-keys-DeYqUDia.js";import"./index.esm-BFJ9SG0n.js";import"./WidgetErrorCard-cS8yMCxU.js";import"./index-F-vqXYqa.js";import"./card-B3CtfC3R.js";import"./progress-4FQQfnS6.js";import"./markdown-content-m_qereFc.js";import"./table-BSAvOYPp.js";import"./terminal-6CdY-T1V.js";import"./package-CUuTl39E.js";import"./heart-c7u4Ezxt.js";import"./git-branch-BpxhecMq.js";import"./file-text-DgdvRfMk.js";import"./file-D40js1Zx.js";import"./McpAppFrame-C7eYYdI9.js";import"./more-details-ReA2ZFBn.js";function O(e,i){return["canvas-file",e,i]}function me({documentId:e,sourcePath:i,binding:g,save:u,draftRef:y,revisionRef:r,finishAttemptRef:C,timerRef:b,finalSaveRef:x,invalidateConfirmedFile:f}){const p=n.useRef({binding:g,save:u,invalidateConfirmedFile:f}),P=n.useRef(null),o=n.useRef(null);return n.useLayoutEffect(()=>{p.current={binding:g,save:u,invalidateConfirmedFile:f}}),n.useLayoutEffect(()=>{const R=B.getState().openDocuments.find(h=>h.id===e);if(!R||typeof R.openedAt!="number")return;const w=ne(e,R.openedAt,i,{required:()=>!!p.current.binding,current:()=>{const h=o.current;return!!h&&h.revision===r.current&&h.attempt===C.current&&h.binding===p.current.binding&&h.save===p.current.save&&h.binding.current()},invalidateConfirmedFile:()=>p.current.invalidateConfirmedFile(),prepare:async()=>{var a;o.current=null;const{binding:h,save:_}=p.current;if(!(h!=null&&h.current()))return!1;b.current&&(clearTimeout(b.current),b.current=null);const F=y.current,m=r.current,c=++C.current,s=await _(F);return s.status!=="changed"&&s.status!=="no_op"||s.confirmed.content!==F||r.current!==m||C.current!==c||p.current.binding!==h||p.current.save!==_||!h.current()?!1:((a=x.current)==null||a.cancel(),x.current=null,o.current={revision:m,attempt:c,binding:h,save:_},!0)}});return P.current=w,()=>w.retire()},[e,i,y,r,C,b,x]),P}function ye(e,i,g){var c;const u=n.useRef(e),y=n.useRef(null),r=n.useRef(null),[C,b]=n.useState({identity:e.identity,phase:"pending",busy:!1});n.useLayoutEffect(()=>{u.current=e},[e]);const x=n.useCallback((s,a)=>{y.current===s&&u.current.identity===s&&u.current.current()&&b(d=>({identity:s,...a,historical:a.historical??(d.identity===s?d.historical:void 0)}))},[]),f=n.useCallback(s=>{y.current!==s||u.current.identity!==s||b(a=>a.identity===s?{...a,phase:"unavailable",busy:!1}:{identity:s,phase:"unavailable",busy:!1})},[]),p=e.identity,P=e.supported;n.useLayoutEffect(()=>{const s=u.current;r.current=null,y.current=p;let a=!1;return P&&i==="ready"&&s.discover().then(d=>{a||(d.status==="observed"?x(p,{phase:"ready",discovery:d.value,busy:!1}):d.status!=="idle"?x(p,{phase:"unavailable",busy:!1}):f(p))}),()=>{a=!0,r.current=null,y.current===p&&(y.current=null)}},[p,P,i,g,x,f]);const o=C.identity===e.identity?C:void 0,R=n.useCallback(async()=>{const s=u.current,a=s.identity;if(y.current!==a||!s.current())return;r.current=null,b(j=>({identity:a,phase:"pending",busy:!0,historical:j.identity===a?j.historical:void 0}));const d=await s.discover(!0);d.status==="observed"?x(a,{phase:"ready",discovery:d.value,busy:!1}):d.status!=="idle"?x(a,{phase:"unavailable",busy:!1}):f(a)},[x,f]),w=n.useCallback(async s=>{const a=u.current,d=a.identity;if(y.current!==d||!a.current())return;r.current=null,b(l=>({identity:d,phase:"pending",busy:!0,discovery:l.identity===d?l.discovery:void 0,historical:l.identity===d?l.historical:void 0}));const j=await a.recover(s);j.status==="observed"?x(d,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?x(d,{phase:j.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}):f(d)},[x,f]),h=n.useCallback(async()=>{const s=u.current,a=s.identity;if(y.current!==a||!s.current())return{status:"idle"};const d={};r.current=d,b(l=>l.identity===a?{...l,phase:"pending",busy:!0}:l);const j=await s.inspectCurrent();return r.current!==d?{status:"idle"}:(r.current=null,j.status==="idle"&&f(a),y.current===a&&u.current.identity===a&&s.current()&&j.status!=="idle"&&b(l=>l.identity===a?{...l,phase:j.status==="observed"?"ready":j.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}:l),j)},[f]),_=e.supported&&i==="ready",F=i==="pending"?"pending":(o==null?void 0:o.phase)??"pending",m=_&&(F!=="ready"||((c=o==null?void 0:o.discovery)==null?void 0:c.admission)==="blocked");return{supported:_,phase:F,editBlocked:m,busy:(o==null?void 0:o.busy)??F==="pending",discovery:o==null?void 0:o.discovery,historical:o==null?void 0:o.historical,refresh:R,recover:w,inspectCurrent:h}}function xe({recovery:e,editing:i,loadCurrent:g}){var u,y;return e.supported?t.jsxs("section",{"aria-label":"Previous file saves",className:"mx-2 mt-2 rounded border p-2 text-sm",children:[e.phase==="pending"&&t.jsx("p",{role:"status",children:"Checking previous saves…"}),e.phase==="unavailable"&&t.jsx("p",{role:"alert",children:"Previous save evidence is unavailable. New saves stay blocked until it can be checked."}),e.phase==="local_uncertain"&&t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."}),((u=e.discovery)==null?void 0:u.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),e.discovery&&t.jsxs(t.Fragment,{children:[!e.discovery.entries.length&&t.jsx("p",{children:"No matching recent saves."}),e.discovery.hasMore&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),t.jsx("ul",{children:e.discovery.entries.map(r=>t.jsxs("li",{children:[t.jsxs("span",{children:[r.eventId,":"," ",r.state==="receipt"?"Historical save recorded":r.state==="review"?"Original save needs review":r.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),r.state==="review"&&(r.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(L,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.recover(r.eventId),children:"Recover original receipt"})]}))]},r.eventId))})]}),((y=e.historical)==null?void 0:y.state)==="receipt"&&t.jsxs("div",{role:"status",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.jsxs("div",{className:"flex gap-2",children:[t.jsx(L,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(L,{type:"button",size:"sm",variant:"ghost",disabled:i||e.editBlocked||e.busy,onClick:g,children:"Load current file"})]}),t.jsx("p",{children:"These controls don’t resend drafts or confirm agent delivery. Use Load current file."})]}):null}const be=n.lazy(()=>$(()=>import("./CodeMirrorEditor-BUoDBsBv.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ge=n.lazy(()=>$(()=>import("./BlintzCanvas-CYHsXAcY.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),je=500;function Ce(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function ke(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 W({content:e,documentId:i,cwd:g,loaded:u,theme:y,isEditing:r,onEditingChange:C,setDocumentEditing:b,observedBinding:x,fileSaveObservation:f="unavailable",recoveryBinding:p}){const P=e.readOnly!==!0,o=Ce(e.sourcePath,e.language),R=se(),[w,h]=n.useState(u),[_,F]=n.useState(),m=n.useRef(x);n.useLayoutEffect(()=>{m.current=x},[x]);const c=fe({documentId:i,sourcePath:e.sourcePath,cwd:g,loadedContent:u,documentSaveBinding:_,documentRecoveryBinding:p}),s=ye(c.recovery,f,p),a=he({cwd:g,sourcePath:o?e.sourcePath:null,content:w,saved:c.status==="saved"}),d=n.useRef(!1),j=n.useRef(r);n.useLayoutEffect(()=>(d.current=!0,j.current=r,()=>{d.current=!1}),[r]);const l=n.useRef(null),S=n.useRef(w),D=n.useRef(0),E=n.useRef(0),A=n.useRef(c.save),Q=n.useRef(c.prepareFinalSave),H=n.useRef(c.waitForCloseDrain),z=n.useRef(null),U=n.useRef(C),K=me({documentId:i,sourcePath:e.sourcePath,binding:_,save:c.save,draftRef:S,revisionRef:D,finishAttemptRef:E,timerRef:l,finalSaveRef:z,invalidateConfirmedFile:()=>{R.invalidateQueries({queryKey:O(g,e.sourcePath)}).catch(()=>{})}});n.useEffect(()=>{S.current=w,A.current=c.save,Q.current=c.prepareFinalSave,H.current=c.waitForCloseDrain,U.current=C});const G=n.useCallback(v=>{var k;D.current+=1,S.current=v,h(v),(k=z.current)==null||k.cancel(),z.current=Q.current(v),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,A.current(S.current)},je)},[]),J=()=>{var N;if(s.editBlocked||f==="pending"||f==="ready"&&!((N=m.current)!=null&&N.current()))return;const v=m.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const T=m.current;return!!T&&ue(k,T.incarnation)&&T.current()}}:void 0),D.current+=1,S.current=u,h(u),C(!0),b(i,!0)},X=async()=>{l.current&&(clearTimeout(l.current),l.current=null);const v=S.current,k=D.current,N=++E.current,T=await A.current(v);if(T.status!=="changed"&&T.status!=="no_op"||D.current!==k||E.current!==N||T.confirmed.content!==v)return;const M=T.confirmed;M.content===S.current&&R.setQueryData(O(g,e.sourcePath),q=>q&&{...q,content:M.content,hash:M.hash}),C(!1),b(i,!1)},Z=()=>{R.invalidateQueries({queryKey:O(g,e.sourcePath)})};n.useEffect(()=>{var v;r||(l.current&&clearTimeout(l.current),l.current=null,(v=z.current)==null||v.cancel(),z.current=null)},[r]),n.useEffect(()=>{const v=K.current;return()=>{var T;l.current&&(clearTimeout(l.current),l.current=null);const k=(T=z.current)==null?void 0:T.flush(),N=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>H.current(N))),z.current=null,b(i,!1),U.current(!1)}},[i,b,K]);const ee=async()=>{if(r||!d.current||s.editBlocked)return;const v=D.current,k=await s.inspectCurrent();k.status!=="observed"||!d.current||j.current||D.current!==v||!c.recovery.current()||R.setQueryData(O(g,e.sourcePath),N=>N&&{...N,...k.value})},te=()=>{const v=c.adoptDisk();v!=null&&h(v)},re=()=>{c.overwrite(S.current)},V=c.status==="saved"?c.confirmedContent!==w?"Unsaved changes":c.documentReceipt?"Save recorded":"Saved to file":ke(c.status),Y=r?w:u;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[P&&V&&t.jsx("span",{className:ae("mt-3 text-xs",c.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:V}),!r&&f==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!r&&t.jsx(L,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:Z,"aria-label":"Refresh from disk",children:t.jsx(pe,{className:"size-4"})}),P&&t.jsx(L,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:r?()=>void X():J,"aria-label":r?"Finish editing":"Edit file",disabled:!r&&(f==="pending"||s.editBlocked),"data-document-save-observation":f,children:r?t.jsx(ie,{className:"size-4"}):t.jsx(ce,{className:"size-4"})})]}),t.jsx(xe,{recovery:s,editing:r,loadCurrent:()=>void ee()}),c.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(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>void c.retryUnconfirmed(),children:"Retry original save"})]}),c.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(L,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:te,children:"Reload"}),t.jsx(L,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:re,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:o?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ge,{value:Y,editable:r,onChange:r?G:void 0,wikiLinks:a})}):t.jsx(be,{value:Y,editable:r,filename:e.sourcePath,languageHint:e.language,theme:y,onChange:r?G:void 0})})})]})}function Re(e){const{fileSaveBinding:i,fileSaveObservation:g}=ve(e.documentId);return t.jsx(W,{...e,observedBinding:i,recoveryBinding:i,fileSaveObservation:g})}function we(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 Ke({content:e,documentId:i}){const g=oe(),u=B(m=>m.selectedCwd),y=B(m=>m.setDocumentEditing),r=B(m=>{var c;return((c=m.openDocuments.find(s=>s.id===i))==null?void 0:c.editing)??!1}),C=le(),b=B(m=>m.canvasSessionId),x=B(m=>m.roomCanvasLiveRoomId),{data:f,error:p,isLoading:P}=de({queryKey:O(u,e.sourcePath),enabled:u!==null,queryFn:()=>g.readFileContent(u,e.sourcePath),staleTime:3e4,retry:!1}),[o,R]=n.useState(null),w=m=>{R(m&&f?{pinnedHash:f.hash}:null)};if(u===null)return t.jsx(I,{children:"Open a chat to view files."});if(P)return t.jsx(I,{children:"Loading file…"});if(p||!f)return t.jsx(I,{children:we(p)});const h=o!==null&&r,_=(h?o==null?void 0:o.pinnedHash:null)??f.hash,F=b&&!x?Re:W;return t.jsx(F,{content:e,documentId:i,cwd:u,loaded:f.content,theme:C,isEditing:h,onEditingChange:w,setDocumentEditing:y},`${e.sourcePath}:${_}`)}function I({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{Ke as CanvasFileContent};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-DV6psv19.js","assets/index-C3cvP8Fo.js","assets/index-DyRGZyur.css","assets/index-BDD2EyoW.js","assets/index-DabU6r9W.js","assets/BlintzCanvas-b30dG4gx.js","assets/index-BIB-maE5.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as n,aW as B,gB as ne,j as t,B as L,a3 as se,G as ae,J as ie,go as ce,gC as ue,aX as G,a1 as oe,gD as le,a2 as de}from"./index-C3cvP8Fo.js";import{u as fe,a as he,b as ve}from"./use-session-canvas-DRrkNRcL.js";import{R as pe}from"./rotate-cw-B4Y0q4GY.js";import"./query-keys-DeYqUDia.js";import"./index.esm-BUPoRUaG.js";import"./WidgetErrorCard-1NyzIJBj.js";import"./index-xAgihCJ7.js";import"./card-DT-vFAns.js";import"./progress-g5kkqvlR.js";import"./markdown-content-DaEVxezf.js";import"./table-CN2HCi4p.js";import"./terminal-BORQniao.js";import"./package-Cb7lEm7t.js";import"./heart-CqwUlIUG.js";import"./git-branch-CONwEYiR.js";import"./file-text-DsnD-A8g.js";import"./file-CiyVL55_.js";import"./McpAppFrame-BM9cNPPd.js";import"./more-details-CdJT0Ehl.js";function O(e,i){return["canvas-file",e,i]}function me({documentId:e,sourcePath:i,binding:g,save:u,draftRef:y,revisionRef:r,finishAttemptRef:C,timerRef:b,finalSaveRef:x,invalidateConfirmedFile:f}){const p=n.useRef({binding:g,save:u,invalidateConfirmedFile:f}),P=n.useRef(null),o=n.useRef(null);return n.useLayoutEffect(()=>{p.current={binding:g,save:u,invalidateConfirmedFile:f}}),n.useLayoutEffect(()=>{const R=B.getState().openDocuments.find(h=>h.id===e);if(!R||typeof R.openedAt!="number")return;const w=ne(e,R.openedAt,i,{required:()=>!!p.current.binding,current:()=>{const h=o.current;return!!h&&h.revision===r.current&&h.attempt===C.current&&h.binding===p.current.binding&&h.save===p.current.save&&h.binding.current()},invalidateConfirmedFile:()=>p.current.invalidateConfirmedFile(),prepare:async()=>{var a;o.current=null;const{binding:h,save:_}=p.current;if(!(h!=null&&h.current()))return!1;b.current&&(clearTimeout(b.current),b.current=null);const F=y.current,m=r.current,c=++C.current,s=await _(F);return s.status!=="changed"&&s.status!=="no_op"||s.confirmed.content!==F||r.current!==m||C.current!==c||p.current.binding!==h||p.current.save!==_||!h.current()?!1:((a=x.current)==null||a.cancel(),x.current=null,o.current={revision:m,attempt:c,binding:h,save:_},!0)}});return P.current=w,()=>w.retire()},[e,i,y,r,C,b,x]),P}function ye(e,i,g){var c;const u=n.useRef(e),y=n.useRef(null),r=n.useRef(null),[C,b]=n.useState({identity:e.identity,phase:"pending",busy:!1});n.useLayoutEffect(()=>{u.current=e},[e]);const x=n.useCallback((s,a)=>{y.current===s&&u.current.identity===s&&u.current.current()&&b(d=>({identity:s,...a,historical:a.historical??(d.identity===s?d.historical:void 0)}))},[]),f=n.useCallback(s=>{y.current!==s||u.current.identity!==s||b(a=>a.identity===s?{...a,phase:"unavailable",busy:!1}:{identity:s,phase:"unavailable",busy:!1})},[]),p=e.identity,P=e.supported;n.useLayoutEffect(()=>{const s=u.current;r.current=null,y.current=p;let a=!1;return P&&i==="ready"&&s.discover().then(d=>{a||(d.status==="observed"?x(p,{phase:"ready",discovery:d.value,busy:!1}):d.status!=="idle"?x(p,{phase:"unavailable",busy:!1}):f(p))}),()=>{a=!0,r.current=null,y.current===p&&(y.current=null)}},[p,P,i,g,x,f]);const o=C.identity===e.identity?C:void 0,R=n.useCallback(async()=>{const s=u.current,a=s.identity;if(y.current!==a||!s.current())return;r.current=null,b(j=>({identity:a,phase:"pending",busy:!0,historical:j.identity===a?j.historical:void 0}));const d=await s.discover(!0);d.status==="observed"?x(a,{phase:"ready",discovery:d.value,busy:!1}):d.status!=="idle"?x(a,{phase:"unavailable",busy:!1}):f(a)},[x,f]),w=n.useCallback(async s=>{const a=u.current,d=a.identity;if(y.current!==d||!a.current())return;r.current=null,b(l=>({identity:d,phase:"pending",busy:!0,discovery:l.identity===d?l.discovery:void 0,historical:l.identity===d?l.historical:void 0}));const j=await a.recover(s);j.status==="observed"?x(d,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?x(d,{phase:j.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}):f(d)},[x,f]),h=n.useCallback(async()=>{const s=u.current,a=s.identity;if(y.current!==a||!s.current())return{status:"idle"};const d={};r.current=d,b(l=>l.identity===a?{...l,phase:"pending",busy:!0}:l);const j=await s.inspectCurrent();return r.current!==d?{status:"idle"}:(r.current=null,j.status==="idle"&&f(a),y.current===a&&u.current.identity===a&&s.current()&&j.status!=="idle"&&b(l=>l.identity===a?{...l,phase:j.status==="observed"?"ready":j.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}:l),j)},[f]),_=e.supported&&i==="ready",F=i==="pending"?"pending":(o==null?void 0:o.phase)??"pending",m=_&&(F!=="ready"||((c=o==null?void 0:o.discovery)==null?void 0:c.admission)==="blocked");return{supported:_,phase:F,editBlocked:m,busy:(o==null?void 0:o.busy)??F==="pending",discovery:o==null?void 0:o.discovery,historical:o==null?void 0:o.historical,refresh:R,recover:w,inspectCurrent:h}}function xe({recovery:e,editing:i,loadCurrent:g}){var u,y;return e.supported?t.jsxs("section",{"aria-label":"Previous file saves",className:"mx-2 mt-2 rounded border p-2 text-sm",children:[e.phase==="pending"&&t.jsx("p",{role:"status",children:"Checking previous saves…"}),e.phase==="unavailable"&&t.jsx("p",{role:"alert",children:"Previous save evidence is unavailable. New saves stay blocked until it can be checked."}),e.phase==="local_uncertain"&&t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."}),((u=e.discovery)==null?void 0:u.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),e.discovery&&t.jsxs(t.Fragment,{children:[!e.discovery.entries.length&&t.jsx("p",{children:"No matching recent saves."}),e.discovery.hasMore&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),t.jsx("ul",{children:e.discovery.entries.map(r=>t.jsxs("li",{children:[t.jsxs("span",{children:[r.eventId,":"," ",r.state==="receipt"?"Historical save recorded":r.state==="review"?"Original save needs review":r.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),r.state==="review"&&(r.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(L,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.recover(r.eventId),children:"Recover original receipt"})]}))]},r.eventId))})]}),((y=e.historical)==null?void 0:y.state)==="receipt"&&t.jsxs("div",{role:"status",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.jsxs("div",{className:"flex gap-2",children:[t.jsx(L,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(L,{type:"button",size:"sm",variant:"ghost",disabled:i||e.editBlocked||e.busy,onClick:g,children:"Load current file"})]}),t.jsx("p",{children:"These controls don’t resend drafts or confirm agent delivery. Use Load current file."})]}):null}const be=n.lazy(()=>G(()=>import("./CodeMirrorEditor-DV6psv19.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ge=n.lazy(()=>G(()=>import("./BlintzCanvas-b30dG4gx.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),je=500;function Ce(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function ke(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 W({content:e,documentId:i,cwd:g,loaded:u,theme:y,isEditing:r,onEditingChange:C,setDocumentEditing:b,observedBinding:x,fileSaveObservation:f="unavailable",recoveryBinding:p}){const P=e.readOnly!==!0,o=Ce(e.sourcePath,e.language),R=se(),[w,h]=n.useState(u),[_,F]=n.useState(),m=n.useRef(x);n.useLayoutEffect(()=>{m.current=x},[x]);const c=fe({documentId:i,sourcePath:e.sourcePath,cwd:g,loadedContent:u,documentSaveBinding:_,documentRecoveryBinding:p}),s=ye(c.recovery,f,p),a=he({cwd:g,sourcePath:o?e.sourcePath:null,content:w,saved:c.status==="saved"}),d=n.useRef(!1),j=n.useRef(r);n.useLayoutEffect(()=>(d.current=!0,j.current=r,()=>{d.current=!1}),[r]);const l=n.useRef(null),S=n.useRef(w),D=n.useRef(0),E=n.useRef(0),A=n.useRef(c.save),Q=n.useRef(c.prepareFinalSave),U=n.useRef(c.waitForCloseDrain),z=n.useRef(null),H=n.useRef(C),K=me({documentId:i,sourcePath:e.sourcePath,binding:_,save:c.save,draftRef:S,revisionRef:D,finishAttemptRef:E,timerRef:l,finalSaveRef:z,invalidateConfirmedFile:()=>{R.invalidateQueries({queryKey:O(g,e.sourcePath)}).catch(()=>{})}});n.useEffect(()=>{S.current=w,A.current=c.save,Q.current=c.prepareFinalSave,U.current=c.waitForCloseDrain,H.current=C});const V=n.useCallback(v=>{var k;D.current+=1,S.current=v,h(v),(k=z.current)==null||k.cancel(),z.current=Q.current(v),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,A.current(S.current)},je)},[]),J=()=>{var N;if(s.editBlocked||f==="pending"||f==="ready"&&!((N=m.current)!=null&&N.current()))return;const v=m.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const T=m.current;return!!T&&ue(k,T.incarnation)&&T.current()}}:void 0),D.current+=1,S.current=u,h(u),C(!0),b(i,!0)},X=async()=>{l.current&&(clearTimeout(l.current),l.current=null);const v=S.current,k=D.current,N=++E.current,T=await A.current(v);if(T.status!=="changed"&&T.status!=="no_op"||D.current!==k||E.current!==N||T.confirmed.content!==v)return;const M=T.confirmed;M.content===S.current&&R.setQueryData(O(g,e.sourcePath),q=>q&&{...q,content:M.content,hash:M.hash}),C(!1),b(i,!1)},Z=()=>{R.invalidateQueries({queryKey:O(g,e.sourcePath)})};n.useEffect(()=>{var v;r||(l.current&&clearTimeout(l.current),l.current=null,(v=z.current)==null||v.cancel(),z.current=null)},[r]),n.useEffect(()=>{const v=K.current;return()=>{var T;l.current&&(clearTimeout(l.current),l.current=null);const k=(T=z.current)==null?void 0:T.flush(),N=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(N))),z.current=null,b(i,!1),H.current(!1)}},[i,b,K]);const ee=async()=>{if(r||!d.current||s.editBlocked)return;const v=D.current,k=await s.inspectCurrent();k.status!=="observed"||!d.current||j.current||D.current!==v||!c.recovery.current()||R.setQueryData(O(g,e.sourcePath),N=>N&&{...N,...k.value})},te=()=>{const v=c.adoptDisk();v!=null&&h(v)},re=()=>{c.overwrite(S.current)},Y=c.status==="saved"?c.confirmedContent!==w?"Unsaved changes":c.documentReceipt?"Save recorded":"Saved to file":ke(c.status),$=r?w:u;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[P&&Y&&t.jsx("span",{className:ae("mt-3 text-xs",c.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:Y}),!r&&f==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!r&&t.jsx(L,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:Z,"aria-label":"Refresh from disk",children:t.jsx(pe,{className:"size-4"})}),P&&t.jsx(L,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:r?()=>void X():J,"aria-label":r?"Finish editing":"Edit file",disabled:!r&&(f==="pending"||s.editBlocked),"data-document-save-observation":f,children:r?t.jsx(ie,{className:"size-4"}):t.jsx(ce,{className:"size-4"})})]}),t.jsx(xe,{recovery:s,editing:r,loadCurrent:()=>void ee()}),c.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(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>void c.retryUnconfirmed(),children:"Retry original save"})]}),c.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(L,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:te,children:"Reload"}),t.jsx(L,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:re,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:o?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ge,{value:$,editable:r,onChange:r?V:void 0,wikiLinks:a})}):t.jsx(be,{value:$,editable:r,filename:e.sourcePath,languageHint:e.language,theme:y,onChange:r?V:void 0})})})]})}function Re(e){const{fileSaveBinding:i,fileSaveObservation:g}=ve(e.documentId);return t.jsx(W,{...e,observedBinding:i,recoveryBinding:i,fileSaveObservation:g})}function we(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 Ke({content:e,documentId:i}){const g=oe(),u=B(m=>m.selectedCwd),y=B(m=>m.setDocumentEditing),r=B(m=>{var c;return((c=m.openDocuments.find(s=>s.id===i))==null?void 0:c.editing)??!1}),C=le(),b=B(m=>m.canvasSessionId),x=B(m=>m.roomCanvasLiveRoomId),{data:f,error:p,isLoading:P}=de({queryKey:O(u,e.sourcePath),enabled:u!==null,queryFn:()=>g.readFileContent(u,e.sourcePath),staleTime:3e4,retry:!1}),[o,R]=n.useState(null),w=m=>{R(m&&f?{pinnedHash:f.hash}:null)};if(u===null)return t.jsx(I,{children:"Open a chat to view files."});if(P)return t.jsx(I,{children:"Loading file…"});if(p||!f)return t.jsx(I,{children:we(p)});const h=o!==null&&r,_=(h?o==null?void 0:o.pinnedHash:null)??f.hash,F=b&&!x?Re:W;return t.jsx(F,{content:e,documentId:i,cwd:u,loaded:f.content,theme:C,isEditing:h,onEditingChange:w,setDocumentEditing:y},`${e.sourcePath}:${_}`)}function I({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{Ke as CanvasFileContent};
|
package/dist/client/assets/{CanvasModel3dContent-CkOo930M.js → CanvasModel3dContent-dST7g1v2.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-
|
|
2
|
-
import{a1 as a,aW as n,r as s,j as t,aX as p}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-rXSL5y2P.js","assets/index-C3cvP8Fo.js","assets/index-DyRGZyur.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a1 as a,aW as n,r as s,j as t,aX as p}from"./index-C3cvP8Fo.js";import{r as u}from"./use-session-canvas-DRrkNRcL.js";import"./rotate-cw-B4Y0q4GY.js";import"./query-keys-DeYqUDia.js";import"./index.esm-BUPoRUaG.js";import"./WidgetErrorCard-1NyzIJBj.js";import"./index-xAgihCJ7.js";import"./card-DT-vFAns.js";import"./progress-g5kkqvlR.js";import"./markdown-content-DaEVxezf.js";import"./table-CN2HCi4p.js";import"./terminal-BORQniao.js";import"./package-Cb7lEm7t.js";import"./heart-CqwUlIUG.js";import"./git-branch-CONwEYiR.js";import"./file-text-DsnD-A8g.js";import"./file-CiyVL55_.js";import"./McpAppFrame-BM9cNPPd.js";import"./more-details-CdJT0Ehl.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-rXSL5y2P.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 O({content:e}){const r=a(),o=n(i=>i.selectedCwd),l=s.useMemo(()=>u(e.src,i=>r.mediaUrl(o??"",i)),[e.src,r,o]),m=s.useMemo(()=>f(e.src),[e.src]);return l.url===null||m===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:m,label:e.title??"Canvas 3D model"})})})}export{O as CanvasModel3dContent,f as formatOf};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{W as m,a1 as x,aW as k,r as v,j as t,B as d,G as p,a7 as y}from"./index-
|
|
1
|
+
import{W as m,a1 as x,aW as k,r as v,j as t,B as d,G as p,a7 as y}from"./index-C3cvP8Fo.js";import{u as R}from"./use-update-config-CkWwKNkY.js";import{I as S}from"./inline-code-BIzGDx6z.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as J,r as T}from"./index-Cga0qx1T.js";import{R as lt}from"./index-DNGNMW3c.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-AzyLwYS_.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
1
|
+
import{j as J,r as T}from"./index-C3cvP8Fo.js";import{R as lt}from"./index-BDD2EyoW.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-DabU6r9W.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
2
2
|
`){m.firstChild||m.appendChild(document.createElement("br")),m=S(),A++;continue}let L=D,ce=w+(C?" cm-deletedText":""),ue=!1,X=c.indexOf(`
|
|
3
3
|
`,A);if(X>-1&&X<D&&(L=X),o&&g<p.length){let j=Math.max(0,C?p[g].toA:p[g].fromA);j<=L&&(L=j,C&&g++,ue=!0)}if(L>A){let j=document.createTextNode(c.slice(A,L));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(j)}else m.appendChild(j);A=L}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),D=0;ft(x,{style:w=>dt(t,w)},(w,A,L)=>{w>D&&R(D,w,""),R(w,A,L),D=A}),R(D,c.length,"")}else R(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),d},r=M.widget({block:!0,side:-1,widget:new rt(i)});return ye.set(e.changes,r),r}function Nt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(f=>f.fromB<=l&&f.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(V);i.fromB!=i.toB&&i.toA<=s.length&&(r+=t.state.lineBreak);let o=Ne.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:r},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function Ft(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!i)return!1;let s=n.field(V).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function Re(t){let e=new N;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&it(t,n);e.add(n.fromB,n.fromB,Gt(t,n,!!l))}return e.finish()}const Vt=H.define({create:t=>Re(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Re(e.state):t},provide:t=>B.decorations.from(t)}),Te=new WeakMap;function it(t,e){let n=Te.get(e);if(n!==void 0)return n;n=null;let l=t.field(V),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==s&&r<10){let o=[],f=0,h=e.fromA,a=e.fromB;for(let d of e.changes){if(d.fromA<d.toA){f+=d.toA-d.fromA;let c=l.sliceString(h+d.fromA,h+d.toA);if(/\n/.test(c))break e;o.push(M.widget({widget:new jt(c),side:-1}).range(a+d.fromB))}d.fromB<d.toB&&o.push(tt.range(a+d.fromB,a+d.toB))}f<e.endA-e.fromA-r*2&&(n=o)}return Te.set(e,n),n}class jt extends Y{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const It=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Ut=M.line({class:"cm-inlineChangedLine"});function Wt(t,e,n,l){let i=it(t,e),r=0;if(!i)return!1;for(let s=t.doc.lineAt(e.fromB);;){for(l&&l.add(s.from,s.from,It),n.add(s.from,s.from,Ut);r<i.length&&i[r].to<=s.to;){let o=i[r++];n.add(o.from,o.to,o.value)}if(s.to>=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}function Ht(t){const[e,n]=T.useState([]);return T.useEffect(()=>{let l=!1;const i=ht.matchFilename(ct,t);if(!i){n([]);return}return i.load().then(r=>{l||n([r])}).catch(()=>{l||n([])}),()=>{l=!0}},[t]),e}function Kt({baseline:t,current:e,theme:n,filename:l,sideBySide:i,onRejectHunk:r,onHunkCountChange:s}){const o=Ht(l);return i?J.jsx(Pt,{baseline:t,current:e,theme:n,languageExtension:o}):J.jsx(zt,{baseline:t,current:e,theme:n,languageExtension:o,onRejectHunk:r,onHunkCountChange:s})}function zt({baseline:t,current:e,theme:n,languageExtension:l,onRejectHunk:i,onHunkCountChange:r}){const s=T.useRef(-1),o=T.useMemo(()=>[B.lineWrapping,Tt({original:t,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),...l],[t,l]);return J.jsx(lt,{value:e,editable:!1,readOnly:!0,theme:n,height:"100%",className:"desktop:select-text h-full text-sm",extensions:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},onChange:f=>i(f),onUpdate:f=>{var a;const h=((a=vt(f.state))==null?void 0:a.chunks.length)??null;h!==null&&h!==s.current&&(s.current=h,r(h))}})}function Pt({baseline:t,current:e,theme:n,languageExtension:l}){const i=T.useRef(null);return T.useEffect(()=>{const r=i.current;if(!r)return;const s=[B.editable.of(!1),ne.readOnly.of(!0),B.lineWrapping,...n==="dark"?[qt()]:[],...l],o=new Et({a:{doc:t,extensions:s},b:{doc:e,extensions:s},parent:r,collapseUnchanged:{margin:3,minSize:4},highlightChanges:!0,gutter:!0});return()=>o.destroy()},[t,e,n,l]),J.jsx("div",{ref:i,className:"cm-diff-split h-full overflow-auto text-sm"})}function qt(){return B.theme({"&":{backgroundColor:"transparent",color:"inherit"}},{dark:!0})}export{Kt as CodeMirrorDiff};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as f}from"./index-
|
|
1
|
+
import{r as n,j as f}from"./index-C3cvP8Fo.js";import{R as l}from"./index-BDD2EyoW.js";import{m as a,n as c,E as x}from"./index-DabU6r9W.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as A,a3 as E,a4 as k,fE as I,fF as $,fG as P,fH as j,fI as o,fJ as R,fK as q,fL as z,r as p,j as t,I as y,B as v,G as w,fM as F,e as U,O as W,Q as K,C as X,U as Q,f as B,a7 as H}from"./index-
|
|
1
|
+
import{a1 as A,a3 as E,a4 as k,fE as I,fF as $,fG as P,fH as j,fI as o,fJ as R,fK as q,fL as z,r as p,j as t,I as y,B as v,G as w,fM as F,e as U,O as W,Q as K,C as X,U as Q,f as B,a7 as H}from"./index-C3cvP8Fo.js";function G(){const e=A(),s=E();return k({mutationFn:({agentId:n,body:a})=>e.createCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}function J(){const e=A(),s=E();return k({mutationFn:({id:n,body:a})=>e.updateCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}$();const L=300,O=500,Z=200,M="external:",T=P(["open","kept","missed","dropped"]).openapi("CommitmentState"),V=j({id:o(),agentId:o(),to:o().nullable(),what:o(),dueAt:o().nullable(),state:T,overdue:R(),sourceSessionId:o().nullable(),sourceRoomEntryId:o().nullable(),createdAt:o(),closedAt:o().nullable(),note:o().nullable()}).openapi("Commitment"),_=o().datetime({offset:!0});j({what:o().trim().min(1).max(L),to:o().trim().min(1).max(Z).optional(),dueAt:_.optional()}).openapi("CreateCommitmentRequest");j({state:T,dueAt:_.nullable().optional(),note:o().trim().max(O).optional(),from:T.optional()}).openapi("UpdateCommitmentRequest");const Y=500;j({agentId:o().min(1).optional(),state:T.optional(),to:o().min(1).optional(),limit:q().int().min(1).max(Y).optional()}).openapi("ListCommitmentsQuery");j({commitments:z(V)}).openapi("ListCommitmentsResponse");function ee(e,s=new Date){if(!e)return null;const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const a=n.getTime()<s.getTime()?"Overdue ·":"Due",d=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?`${a} ${d}`:Math.abs(n.getTime()-s.getTime())/864e5<6?`${a} ${n.toLocaleDateString(void 0,{weekday:"short"})} ${d}`:`${a} ${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function te(e,s){return e?e.startsWith(M)?`To ${e.slice(M.length)}`:`To ${(s==null?void 0:s(e))??e}`:null}function se(e){return{open:e.filter(s=>s.state==="open"),closed:e.filter(s=>s.state!=="open")}}const ae={kept:"Kept",missed:"Missed",dropped:"Dropped"};function de(e){var n;const s=new Map;for(const a of e)s.set(a.id,a.displayName),(n=a.agent)!=null&&n.manifestId&&s.set(a.agent.manifestId,a.displayName);return a=>s.get(a)}const ne=6e4;function oe(){const e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ie({agentId:e,onDone:s}){var m;const n=G(),[a,d]=p.useState(""),[r,l]=p.useState(""),u=p.useId(),g=p.useId(),x=a.trim(),N=n.isError&&((m=n.error)==null?void 0:m.code)==="PAST_DUE",h=r?new Date(r).getTime():null,[c,S]=p.useState(!1),[b]=p.useState(oe);function i(C){if(C.preventDefault(),!x||c)return;const f=h!==null?new Date(h).toISOString():void 0;n.mutate({agentId:e,body:{what:x,...f?{dueAt:f}:{}}},{onSuccess:s})}return t.jsxs("form",{onSubmit:i,"data-slot":"add-commitment-form",className:"flex flex-col gap-2 rounded-md border p-3",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium",children:"What was promised"}),t.jsx(y,{id:u,value:a,maxLength:L,onChange:C=>d(C.target.value),placeholder:"Send Acme the revised quote"}),t.jsx("label",{htmlFor:g,className:"text-xs font-medium",children:"Due (optional)"}),t.jsx(y,{id:g,type:"datetime-local",value:r,min:b,"aria-invalid":c||void 0,onChange:C=>{const f=C.target.value;l(f),S(f!==""&&new Date(f).getTime()<Date.now()-ne)}}),(c||N)&&t.jsx("p",{className:"text-destructive text-xs",children:"That time has passed."}),n.isError&&!N&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save the commitment. Try again."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(v,{type:"button",size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),t.jsx(v,{type:"submit",size:"sm",disabled:!x||c||n.isPending,children:"Add commitment"})]})]})}function D({commitment:e,agentName:s,nameOf:n,onClose:a,busy:d}){const r=e.state==="open",l=[s,te(e.to,n)].filter(Boolean).join(" · "),u=r?ee(e.dueAt):null;return t.jsxs("li",{"data-slot":"commitment-row","data-state":e.state,"data-overdue":e.overdue||void 0,className:"flex flex-col gap-2 rounded-md px-2 py-2 sm:flex-row sm:items-center sm:gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:w("text-sm break-words",!r&&"text-muted-foreground",e.state==="dropped"&&"line-through"),children:e.what}),(l||u||!r)&&t.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[e.state!=="open"&&t.jsx("span",{children:ae[e.state]}),l&&t.jsx("span",{className:"min-w-0 truncate",children:l}),u&&t.jsx("span",{className:w(e.overdue&&"text-destructive font-medium"),children:u})]})]}),r&&a&&t.jsxs("div",{className:"flex shrink-0 gap-1",children:[t.jsx(v,{size:"xs",variant:"outline",disabled:d,onClick:()=>a("kept"),"aria-label":`Mark kept: ${e.what}`,children:"Mark kept"}),t.jsx(v,{size:"xs",variant:"ghost",disabled:d,onClick:()=>a("dropped"),"aria-label":`Drop: ${e.what}`,children:"Drop"})]})]})}const re={kept:"Marked kept",dropped:"Commitment dropped"};function ue({agentId:e,nameOf:s,canAdd:n=!1,readOnly:a=!1,canChange:d}){var b;const r=F(e?{agentId:e}:{}),l=J(),[u,g]=p.useState(!1),x=e===void 0;function N(i,m){l.mutate({id:i.id,body:{state:m}},{onSuccess:()=>H.success(re[m],{action:{label:"Undo",onClick:()=>l.mutate({id:i.id,body:{state:"open",from:m}})}})})}if(r.isPending)return t.jsx(U,{className:"h-16 w-full"});if(r.isError)return t.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read commitments."});const{open:h,closed:c}=se(r.data),S=l.isPending?(b=l.variables)==null?void 0:b.id:void 0;return t.jsxs("div",{"data-slot":"commitment-list",className:"flex flex-col gap-2",children:[h.length===0&&c.length===0&&!u&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"No commitments yet."}),h.length>0&&t.jsx("ul",{className:"flex flex-col","aria-label":"Open commitments",children:h.map(i=>t.jsx(D,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s,busy:S===i.id,...a||d&&!d(i)?{}:{onClose:m=>N(i,m)}},i.id))}),l.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t change that commitment. Try again."}),c.length>0&&t.jsxs(W,{children:[t.jsxs(K,{className:"focus-ring text-muted-foreground hover:text-foreground group flex items-center gap-1 rounded-md px-2 py-1 text-xs",children:[t.jsx(X,{"aria-hidden":!0,className:"size-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Closed (",c.length,")"]}),t.jsx(Q,{children:t.jsx("ul",{className:"flex flex-col","aria-label":"Closed commitments",children:c.map(i=>t.jsx(D,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s},i.id))})})]}),n&&!a&&e&&u&&t.jsx(ie,{agentId:e,onDone:()=>g(!1)}),n&&!a&&e&&!u&&t.jsxs(v,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>g(!0),children:[t.jsx(B,{"aria-hidden":!0}),"Add commitment"]})]})}export{ue as C,de as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,d,j as m}from"./index-
|
|
1
|
+
import{r,d,j as m}from"./index-C3cvP8Fo.js";import{r as c,C as l}from"./CommitmentList-Dx_Ek_Gl.js";function u({member:s,roster:t}){var o;const e=(o=s.agent)==null?void 0:o.manifestId,i=r.useMemo(()=>c(t),[t]),n=d(s,t),a=n==="managed"||n==="system";return e?m.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-commitments",children:m.jsx(l,{agentId:e,nameOf:i,canAdd:a,readOnly:!a})}):null}export{u as CommitmentsPage};
|
package/dist/client/assets/{ComputerResourceView-cERD9H2L.js → ComputerResourceView-DNVNFTdn.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{W as g,a1 as x,aW as o,r as C,j as e,B as d,Y as P}from"./index-
|
|
1
|
+
import{W as g,a1 as x,aW as o,r as C,j as e,B as d,Y as P}from"./index-C3cvP8Fo.js";import{r as m,u as f,C as w}from"./ComputerViewer-D8SxJdMm.js";import{u as v}from"./use-is-below-desktop-Cu_jKnft.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|