@forsion/unit 2.13.4 → 2.13.5
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/main.mjs +112 -9
- package/package.json +1 -1
- package/release.json +5 -5
- package/web/assets/ArtificialView-BD1yHz1N.js +1 -0
- package/web/assets/AutomationBuilder-B09c-5Bi.js +1 -0
- package/web/assets/CalendarConfigView-Bd-ZDGPO.js +1 -0
- package/web/assets/CalendarSide-B0RVbOsg.js +1 -0
- package/web/assets/CalendarView-BHio-n_r.js +3 -0
- package/web/assets/CalendarView-t91KpUG7.css +1 -0
- package/web/assets/CapabilityMenu-DyHTEYLr.js +1 -0
- package/web/assets/Chrome-C7F6fdDp.js +1 -0
- package/web/assets/{CodeView-GZ0BAgoW.js → CodeView-BGOnrGhB.js} +3 -3
- package/web/assets/CtxMenuButtons-BYjrbUKS.js +1 -0
- package/web/assets/DashboardGridView-CR-R_qV8.js +25 -0
- package/web/assets/DashboardGridView-RoVFSkNO.css +1 -0
- package/web/assets/EventCard-QyYorE1_.js +1 -0
- package/web/assets/ExcalidrawCanvas-BgcFPMpU.css +1 -0
- package/web/assets/ExcalidrawCanvas-lwJCN6uB.js +1 -0
- package/web/assets/FloatingToc-DO7SH8Ku.js +1 -0
- package/web/assets/GitCloneDialog-CbW-RJak.js +1 -0
- package/web/assets/{GitCloneDialog-Bj9G3o-n.css → GitCloneDialog-DOxZk2K0.css} +1 -1
- package/web/assets/HomepageView-Bx8FbWlY.css +1 -0
- package/web/assets/HomepageView-CHJEhf9c.js +4 -0
- package/web/assets/ImageStudioPanels-CgVf0wiq.js +3 -0
- package/web/assets/ImageStudioView-4WcX0_V4.js +1 -0
- package/web/assets/InlineAiPanel-CdIPINsA.js +1 -0
- package/web/assets/InlineFiles-CAIyTk1n.js +1 -0
- package/web/assets/{MarkdownBlock-DQTuoen3.css → MarkdownBlock-Cqfk5DhC.css} +1 -1
- package/web/assets/MarkdownBlock-DSItkLhu.js +58 -0
- package/web/assets/ModelPill--CU3XTIQ.js +2 -0
- package/web/assets/{ModelPill-CzdNh7Mt.css → ModelPill-BiUsuhy3.css} +1 -1
- package/web/assets/MuseLibraryView-PlS7HAlV.js +2 -0
- package/web/assets/MuseView-CvsO62Fo.js +7 -0
- package/web/assets/{PageHistoryPanel-Bn4-XmdK.js → PageHistoryPanel-CDh7nm78.js} +2 -2
- package/web/assets/{PdfAnnotator-Cq8cklTz.js → PdfAnnotator-DafvjP3U.js} +3 -3
- package/web/assets/PenRow-CEy-s6SF.js +1 -0
- package/web/assets/PluginToolCard-BmTRr5JT.css +1 -0
- package/web/assets/PluginToolCard-DCzLhsCA.js +2 -0
- package/web/assets/ProductView-AUqnTwmQ.js +1 -0
- package/web/assets/SettingsPage-B9mmkWaM.js +3 -0
- package/web/assets/StudioGuestSurface-OOhRA8nt.js +1 -0
- package/web/assets/TodoListView-BkgMe44I.js +1 -0
- package/web/assets/Tooltip-DOYi44eY.js +1 -0
- package/web/assets/UnifiedPage-CTmQpf2T.css +1 -0
- package/web/assets/UnifiedPage-s7-tDSwG.js +712 -0
- package/web/assets/ViewSelectionBar-WmSWMFsR.js +2 -0
- package/web/assets/appStore-DDOkzWDA.js +456 -0
- package/web/assets/appStore-iy8_Tmac.css +1 -0
- package/web/assets/arrow-up-right-BptN64d-.js +1 -0
- package/web/assets/{artificial-BzLFkChP.css → artificial-BubVxExB.css} +1 -1
- package/web/assets/astryxBridge-BL56QfEv.js +69 -0
- package/web/assets/astryxBridge-djzCiy4v.css +1 -0
- package/web/assets/automationListSource-B1jz6q0t.js +1 -0
- package/web/assets/boardSurface-CP4HNmcm.js +1 -0
- package/web/assets/calendarNavStore-DCi7VBmM.js +1 -0
- package/web/assets/canvasPrefs-ArsX3NFO.js +1 -0
- package/web/assets/chatBoxSurface-DRsDr-MT.js +1 -0
- package/web/assets/chevron-up-ChXNh14u.js +1 -0
- package/web/assets/{client-CaivGZFR.js → client-fKy9CWk0.js} +5 -5
- package/web/assets/code-xml-DCCD9eCS.js +1 -0
- package/web/assets/{codeStudioStore-DhyMazGT.js → codeStudioStore-BgLfCDK2.js} +8 -8
- package/web/assets/codingNavigation-BrkLENBZ.css +1 -0
- package/web/assets/contextMenuSurface-BF593l2M.js +1 -0
- package/web/assets/copy-plus-ClKrSgM7.js +1 -0
- package/web/assets/create-DYmVT68X.js +14 -0
- package/web/assets/dashboardSurface-C6cbR3oG.js +1 -0
- package/web/assets/dbStore-BIG5Mfh2.js +1 -0
- package/web/assets/deskCapture-q-jRDIcc.js +1 -0
- package/web/assets/{diff2html-Daje9Kkm.js → diff2html-Di8qIz6O.js} +2 -2
- package/web/assets/{docx-preview-CABR7n30.js → docx-preview-B-URZXdP.js} +1 -1
- package/web/assets/draft-CBSW5tHx.js +2 -0
- package/web/assets/drawingStore-CGvTqqYW.js +7 -0
- package/web/assets/file-down-Z913cCyQ.js +1 -0
- package/web/assets/floatingTocSurface-DGwTiqvU.js +1 -0
- package/web/assets/foldActions-DGIPTmE1.js +1 -0
- package/web/assets/folder-1OJQeDI1.js +1 -0
- package/web/assets/folder-minus-D_j1SwHu.js +1 -0
- package/web/assets/folder-plus-DP9sFr26.js +1 -0
- package/web/assets/gestures-ZhFAENNZ.js +1 -0
- package/web/assets/git-branch-BMajF2cu.js +1 -0
- package/web/assets/homeCardStatus-5R7XkxFL.js +1 -0
- package/web/assets/i18n-CAf4PT1o.css +1 -0
- package/web/assets/i18n.generated-DW_l6CkR.js +15 -0
- package/web/assets/imageStudio-CwG21Bat.css +1 -0
- package/web/assets/imageStudio-DC_syDtx.js +4 -0
- package/web/assets/index-B8A3nKeL.js +1 -0
- package/web/assets/{index-BGfvNj7R.js → index-BDZIQnEx.js} +2 -2
- package/web/assets/index-BYKR7EVg.js +1 -0
- package/web/assets/index-BeW45J9J.js +7 -0
- package/web/assets/index-BnJguNqI.js +1 -0
- package/web/assets/index-BniT-A2n.js +1 -0
- package/web/assets/index-C--E96Ul.js +1 -0
- package/web/assets/index-CI2esW1X.js +1 -0
- package/web/assets/index-CIKPZc3Q.js +1 -0
- package/web/assets/index-COzdD7mZ.js +13 -0
- package/web/assets/index-CPfmhZ3Z.js +1 -0
- package/web/assets/index-CVLDDD5Z.js +1 -0
- package/web/assets/index-CWXpOSI2.js +1 -0
- package/web/assets/index-Cg1FWM_p.js +1 -0
- package/web/assets/index-CmsN2Zm2.js +1 -0
- package/web/assets/index-CtCYv9bF.js +1 -0
- package/web/assets/index-CtRdzpNh.js +1 -0
- package/web/assets/index-D-ClOPbg.js +1 -0
- package/web/assets/{index-gt5JBIFf.js → index-DfhEDV2T.js} +2 -2
- package/web/assets/index-Dr6YmrrT.js +1 -0
- package/web/assets/index-SpegRFQV.js +1 -0
- package/web/assets/index-bF04pF8q.js +3 -0
- package/web/assets/index-fDB1l4d-.js +3398 -0
- package/web/assets/index-jzlU5luC.js +1 -0
- package/web/assets/{index-O05r2Ty6.js → index-uhvJ8AiJ.js} +1 -1
- package/web/assets/{invitePage-Bgveo6Hj.js → invitePage-iOT1zBvp.js} +1 -1
- package/web/assets/{ipc-B6hkgxQL.js → ipc-SAPDwyQ4.js} +1 -1
- package/web/assets/{jszip.min-eU-k-vEy.js → jszip.min-B3n1FGCb.js} +1 -1
- package/web/assets/launchpad-C9U9hpWJ.css +1 -0
- package/web/assets/launchpad-CcmSwlJl.js +2 -0
- package/web/assets/layout-grid-oIyIGbc5.js +1 -0
- package/web/assets/linkFollow-uke1Xtit.js +8 -0
- package/web/assets/listFold-BeNv2v6M.js +1 -0
- package/web/assets/lock-open-D2nMg0ga.js +1 -0
- package/web/assets/log-out-D70NCXC4.js +1 -0
- package/web/assets/magnet-Cqmm97W8.js +1 -0
- package/web/assets/main-B9aT0WXG.js +15 -0
- package/web/assets/main-BlVApHpj.css +1 -0
- package/web/assets/markdownEditorSurface-BiDH0__r.css +1 -0
- package/web/assets/markdownEditorSurface-zUzFity2.js +3 -0
- package/web/assets/mediaPlayer-DB4KUvua.js +1 -0
- package/web/assets/message-square-plus-BvUfAAZm.js +1 -0
- package/web/assets/{messages-CKtabOqy.js → messages-GQUjmbwW.js} +1 -1
- package/web/assets/minimize-2-CMhzL6ZW.js +1 -0
- package/web/assets/mobileEntry-6u7TYC4s.css +1 -0
- package/web/assets/mobileEntry-BnHzrdoC.js +13 -0
- package/web/assets/modelPickerSurface-Dtz40Ae2.js +1 -0
- package/web/assets/nativeDownload-DsGyUSJ5.js +1 -0
- package/web/assets/nativeSheetMenu--iihXNVd.js +1 -0
- package/web/assets/pageStore-CyvNZEYX.js +13 -0
- package/web/assets/pageStore-ys8L4rjF.css +1 -0
- package/web/assets/{pageTree-BYYPgZm_.js → pageTree-Ci2qzrs1.js} +3 -3
- package/web/assets/pen-line-DC3lbEY1.js +1 -0
- package/web/assets/pen-tool-DD5_N4lZ.js +1 -0
- package/web/assets/pencil--sWwxHdP.js +1 -0
- package/web/assets/phoneList-BpLxxdq6.css +1 -0
- package/web/assets/phoneList-DKRMxQHf.js +1 -0
- package/web/assets/pluginChat-82zZt47Y.js +2 -0
- package/web/assets/react-b7FrqRQR.js +1 -0
- package/web/assets/recordSurface-vUX25Z8R.js +1 -0
- package/web/assets/redo-2-CqlqhWrI.js +1 -0
- package/web/assets/rotate-ccw-D8kni6Ni.js +1 -0
- package/web/assets/selectionActions-DIq0xDm8.js +2 -0
- package/web/assets/selectionBarSurface-B94e5JW_.js +1 -0
- package/web/assets/sessionTitle-Ctp4iNKu.js +1 -0
- package/web/assets/settingsPageSurface-C9TA3mJg.js +1 -0
- package/web/assets/sharePage-CY04XCAf.js +2 -0
- package/web/assets/{shareViewer-BiMqIBxP.js → shareViewer-DweNF8Ch.js} +2 -2
- package/web/assets/star-B0sZEmbj.js +1 -0
- package/web/assets/tableSurface-CSBYBw5P.js +1 -0
- package/web/assets/tanguProbe-B8Qv2vcm.js +6 -0
- package/web/assets/{terminalView-lbcBgG0c.js → terminalView-BLGdmdl7.js} +3 -3
- package/web/assets/type-Dt7RNB9g.js +1 -0
- package/web/assets/undo-2-QimgpLBn.js +1 -0
- package/web/assets/{unitAccount-DGwGsmC3.js → unitAccount-DL3jfd84.js} +1 -1
- package/web/assets/{unitBridge-CE2yAvm0.js → unitBridge-BSsCy1zP.js} +1 -1
- package/web/assets/{unitCloudTransport-BGFwkaDM.js → unitCloudTransport-CI_6H0TU.js} +1 -1
- package/web/assets/unitOwnerAccess-CiQ7nD7E.js +1 -0
- package/web/assets/unitShim-Dl2ksNp-.js +5 -0
- package/web/assets/upload-Dy7svciS.js +1 -0
- package/web/assets/userSpaces-oMHIWgYe.js +1 -0
- package/web/assets/viewportLock-B0l1GU_k.css +1 -0
- package/web/assets/viewportLock-BZq5PTeN.js +738 -0
- package/web/assets/zoom-in-DDEtY_Go.js +1 -0
- package/web/excalidraw/excalidraw.js +4 -2
- package/web/index.html +12 -13
- package/web/assets/ArtificialView-DLh75dAI.js +0 -1
- package/web/assets/AutomationBuilder-DNWWGnFr.js +0 -1
- package/web/assets/CalendarConfigView-G7je7k9-.js +0 -1
- package/web/assets/CalendarView-B2MtaOJk.js +0 -1
- package/web/assets/CapabilityMenu-DJaZ_Cyt.js +0 -1
- package/web/assets/CheckboxInput-FYXLaZke.js +0 -1
- package/web/assets/Chrome-CFonajM4.js +0 -1
- package/web/assets/DashboardGridView-D9s9pez_.css +0 -1
- package/web/assets/DashboardGridView-Xgw4wa0_.js +0 -17
- package/web/assets/EventCard-_39F_I5M.js +0 -1
- package/web/assets/ExcalidrawCanvas-4uYrLYin.css +0 -1
- package/web/assets/ExcalidrawCanvas-rXujil36.js +0 -1
- package/web/assets/FloatingToc-DNqAkkI0.js +0 -1
- package/web/assets/GitCloneDialog-CQx-O4j1.js +0 -1
- package/web/assets/HomepageView-DcWmTPQO.css +0 -1
- package/web/assets/HomepageView-MYEk3RCs.js +0 -3
- package/web/assets/ImageStudioPanels-4wnb2XF4.js +0 -3
- package/web/assets/ImageStudioView-qrmW8pfx.js +0 -1
- package/web/assets/InlineAiPanel-B3kd1ob2.js +0 -1
- package/web/assets/InlineFiles-Clnqh9jD.js +0 -1
- package/web/assets/MarkdownBlock-DT_wsaja.js +0 -58
- package/web/assets/ModelPill-JaIH3ffZ.js +0 -2
- package/web/assets/MuseLibraryView-DOJVVeU6.js +0 -2
- package/web/assets/MuseView-uxTmjVQa.js +0 -6
- package/web/assets/PenRow-COOYAaxx.js +0 -1
- package/web/assets/ProductView-DPTveulg.js +0 -1
- package/web/assets/RightPanel-BJUacrsf.js +0 -4
- package/web/assets/RightPanel-D0zk1g3I.css +0 -1
- package/web/assets/SketchCard-B_UU5sxV.js +0 -641
- package/web/assets/StudioGuestSurface-yBa4QKfX.js +0 -1
- package/web/assets/TargetHealthNotice-BLzDB-Xl.css +0 -1
- package/web/assets/TargetHealthNotice-CgkdTdhB.js +0 -47
- package/web/assets/TodoListView-CricdCfW.js +0 -1
- package/web/assets/Tooltip-o8ZqIb3L.js +0 -1
- package/web/assets/UnifiedPage-BWAyqj65.js +0 -69
- package/web/assets/UnifiedPage-CWXc_mo1.css +0 -1
- package/web/assets/ViewSelectionBar-35x8TiLA.js +0 -2
- package/web/assets/appStore-CI1_L5OS.js +0 -3357
- package/web/assets/appStore-DQc2marq.css +0 -1
- package/web/assets/approvalText-Cy2UAUAQ.js +0 -2
- package/web/assets/arrow-up-right-BDsMFoNQ.js +0 -1
- package/web/assets/astryxBridge-CF_hpqC2.css +0 -1
- package/web/assets/astryxBridge-CH_c5xjo.js +0 -70
- package/web/assets/automationListSource-CB6AWkL_.js +0 -1
- package/web/assets/boardSurface-CLvEUjbF.js +0 -1
- package/web/assets/book-open-BLzEdGfu.js +0 -1
- package/web/assets/calendarNavStore-BHUNxDx8.js +0 -1
- package/web/assets/canvasPrefs-CvE7mgyq.js +0 -1
- package/web/assets/chatBoxSurface-CuuHLzs5.js +0 -1
- package/web/assets/circle-question-mark-BM4ZRxQS.js +0 -1
- package/web/assets/circle-x-DTcNGZDT.js +0 -1
- package/web/assets/code-xml-AE3mT4T5.js +0 -1
- package/web/assets/codingNavigation-B0kVsy4x.js +0 -53
- package/web/assets/codingNavigation-DHCidM4N.css +0 -1
- package/web/assets/create-1JI2I47p.js +0 -14
- package/web/assets/dashboardSurface-CIE5HybN.js +0 -1
- package/web/assets/deskCapture-COW7aG5Y.js +0 -1
- package/web/assets/emoji-DZ9CA_3l.css +0 -1
- package/web/assets/emoji-DphwSxPx.js +0 -1
- package/web/assets/floatingTocSurface-BOm2QYBK.js +0 -1
- package/web/assets/foldActions-DNbJPlPl.js +0 -1
- package/web/assets/folder-DotgUhYD.js +0 -1
- package/web/assets/folder-plus-aJgL9NeP.js +0 -1
- package/web/assets/gestures-dqncPOwo.js +0 -1
- package/web/assets/git-branch-CwR2qic6.js +0 -1
- package/web/assets/hack2gate-dark-Dx2RtDRI.jpg +0 -0
- package/web/assets/hack2gate-light-DRKq9tyS.jpg +0 -0
- package/web/assets/hand-XNkzNiW2.js +0 -1
- package/web/assets/hard-drive-CfWKRoAE.js +0 -1
- package/web/assets/i18n-CykmULlm.css +0 -1
- package/web/assets/i18n.generated-BwynSSMk.js +0 -15
- package/web/assets/imageStudio-CWgLpC_d.js +0 -2
- package/web/assets/imageStudio-DZ0qGU2s.css +0 -1
- package/web/assets/index-B65ULikK.js +0 -1
- package/web/assets/index-BIIeiIap.js +0 -1
- package/web/assets/index-BOzsniE1.js +0 -297
- package/web/assets/index-BfrjVzia.js +0 -13
- package/web/assets/index-Bi9UtjVz.js +0 -1
- package/web/assets/index-C1uilc9i.js +0 -1
- package/web/assets/index-C3Dc3Ivz.js +0 -1
- package/web/assets/index-CJF_Ld1Y.js +0 -1
- package/web/assets/index-CMARP4oV.js +0 -1
- package/web/assets/index-C_RsQVNm.js +0 -7
- package/web/assets/index-ChyxZMm8.js +0 -1
- package/web/assets/index-CoKcOaZg.js +0 -1
- package/web/assets/index-CuviSCbk.js +0 -1
- package/web/assets/index-Cw43kua8.js +0 -1
- package/web/assets/index-D1fu6XQN.js +0 -3
- package/web/assets/index-DG-hXb63.js +0 -1
- package/web/assets/index-DjnTfJpN.js +0 -1
- package/web/assets/index-Dtw0abst.js +0 -1
- package/web/assets/index-W3ErfZiX.js +0 -1
- package/web/assets/index-Yc56b3XX.js +0 -1
- package/web/assets/index-d4jCdYJH.js +0 -1
- package/web/assets/index-siHtlYTM.js +0 -1
- package/web/assets/launchpad-C2c1MSVX.css +0 -1
- package/web/assets/layout-grid-CraV7nhh.js +0 -1
- package/web/assets/linkFollow-BpvDWzUx.js +0 -8
- package/web/assets/list-tree-cLJw-jYQ.js +0 -1
- package/web/assets/listFold-M8s5JYEC.js +0 -1
- package/web/assets/lock-DBkXXwaI.js +0 -1
- package/web/assets/lock-open-C-9-AWct.js +0 -1
- package/web/assets/log-out-C8bDXj9P.js +0 -1
- package/web/assets/main-BiS_5wrB.css +0 -1
- package/web/assets/main-CMk6twzA.js +0 -20
- package/web/assets/markdownEditorSurface-Bql20IAf.css +0 -1
- package/web/assets/markdownEditorSurface-DgQ0TUWH.js +0 -3
- package/web/assets/message-square-plus-8pfimvem.js +0 -1
- package/web/assets/minus-CfA9fAN3.js +0 -1
- package/web/assets/mobileEntry-DS1vohuL.css +0 -1
- package/web/assets/mobileEntry-NcMcK0LV.js +0 -13
- package/web/assets/nativeDownload-CNtwSCy0.js +0 -1
- package/web/assets/pageChrome-BR4cfIaA.js +0 -1
- package/web/assets/pageChrome-BbUhILy0.css +0 -1
- package/web/assets/pen-tool-C5ftHCnm.js +0 -1
- package/web/assets/pencil-ehhM9_9k.js +0 -1
- package/web/assets/phoneList-B6gwUJZF.js +0 -9
- package/web/assets/phoneList-iRdfiKA8.css +0 -1
- package/web/assets/pluginChat-DTTWWiUS.js +0 -2
- package/web/assets/redo-2-DCEAgQlN.js +0 -1
- package/web/assets/rotate-ccw-DdkrbRAB.js +0 -1
- package/web/assets/selectionActions-BQD2kox1.js +0 -2
- package/web/assets/selectionBarSurface-CzUZmJDJ.js +0 -1
- package/web/assets/server-Ddu9f1k3.js +0 -1
- package/web/assets/sharePage-CNrm2xTC.js +0 -2
- package/web/assets/star-Dxv7XANS.js +0 -1
- package/web/assets/tableSurface-Bly1iCXc.js +0 -1
- package/web/assets/terminal-CAmmC9cV.js +0 -1
- package/web/assets/type-Dz6rnTvG.js +0 -1
- package/web/assets/undo-2-B7izWNb_.js +0 -1
- package/web/assets/unitOwnerAccess-D4nKS6Gg.js +0 -1
- package/web/assets/unitShim-2_2hhGxS.js +0 -5
- package/web/assets/upload-DqpRRAhG.js +0 -1
- package/web/assets/userSpaces-VFu4s05v.js +0 -1
- package/web/assets/viewportLock-3AOdDmwi.js +0 -631
- package/web/assets/viewportLock-djvL8fUQ.css +0 -1
- package/web/assets/zoom-in-Bf-eKTnH.js +0 -1
package/main.mjs
CHANGED
|
@@ -42,6 +42,15 @@ var init_nativeFeatures = __esm({
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
+
// desktop/shared/corePlugins.ts
|
|
46
|
+
var CORE_BUNDLE_IDS;
|
|
47
|
+
var init_corePlugins = __esm({
|
|
48
|
+
"desktop/shared/corePlugins.ts"() {
|
|
49
|
+
"use strict";
|
|
50
|
+
CORE_BUNDLE_IDS = ["forsion-extend", "tangu-computer-use"];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
45
54
|
// unit/packages.ts
|
|
46
55
|
import { readFile as readFile2, readdir, realpath as realpath2, stat } from "node:fs/promises";
|
|
47
56
|
import { isAbsolute, resolve, sep as sep2 } from "node:path";
|
|
@@ -90,7 +99,10 @@ async function readPackage(dir, appVersion) {
|
|
|
90
99
|
descriptionEn: manifest.descriptionEn,
|
|
91
100
|
onboarding: manifest.onboarding,
|
|
92
101
|
fileExtensions: Array.isArray(manifest.fileExtensions) ? manifest.fileExtensions.filter(isSafePluginExt).map((v) => v.trim().toLowerCase()).slice(0, 8) : [],
|
|
93
|
-
code
|
|
102
|
+
code,
|
|
103
|
+
// 首方核心包(Forsion Extend):页面据 locked 才放出它的商店页、「Forsion 云端」子页与首方接缝(同桌面内置包)。
|
|
104
|
+
// ponytail: 只按 id 认 —— Unit 只装运营方用 CLI 拷进来的本地包(install.ts),没有商店安装;哪天 Unit 能从商店装插件,改成按桌面 builtinBundles 的固定公钥验 SIGNATURE 再标。
|
|
105
|
+
...CORE_BUNDLE_IDS.includes(manifest.id) ? { locked: true } : {}
|
|
94
106
|
};
|
|
95
107
|
}
|
|
96
108
|
if (manifest.runtime) {
|
|
@@ -130,6 +142,7 @@ var init_packages = __esm({
|
|
|
130
142
|
"use strict";
|
|
131
143
|
init_pluginFiles();
|
|
132
144
|
init_nativeFeatures();
|
|
145
|
+
init_corePlugins();
|
|
133
146
|
validId = (id) => typeof id === "string" && /^[a-z][a-z0-9-]*$/.test(id);
|
|
134
147
|
}
|
|
135
148
|
});
|
|
@@ -665,6 +678,7 @@ var ENGINE_ROUTES = [
|
|
|
665
678
|
{ method: "DELETE", path: "/agent/skills/user/:id", access: "deny-remote", src: "routes/assets.ts", why: "delete user skill" },
|
|
666
679
|
{ method: "GET", path: "/agent/tools", access: "allow", src: "routes/assets.ts", why: "tool list" },
|
|
667
680
|
{ method: "GET", path: "/agent/browser-extension", access: "deny-remote", src: "routes/browserExtension.ts", why: "browser extension pairing credentials" },
|
|
681
|
+
{ method: "POST", path: "/agent/browser-extension/reload-clients", access: "deny-remote", src: "routes/browserExtension.ts", why: "reloads the browser extension on the local machine" },
|
|
668
682
|
{ method: "POST", path: "/agent/browser-extension/reset-code", access: "deny-remote", src: "routes/browserExtension.ts", why: "rotates browser extension pairing credentials" },
|
|
669
683
|
{ method: "GET", path: "/agent/channels", access: "deny-remote", src: "routes/channels.ts", why: "channel config is local-only" },
|
|
670
684
|
{ method: "PUT", path: "/agent/channels/:kind/config", access: "deny-remote", src: "routes/channels.ts", why: "channel config is local-only" },
|
|
@@ -686,6 +700,9 @@ var ENGINE_ROUTES = [
|
|
|
686
700
|
{ method: "GET", path: "/agent/agents/:slug/human", access: "deny-remote", src: "routes/human.ts", why: "host collaboration configuration" },
|
|
687
701
|
{ method: "PUT", path: "/agent/agents/:slug/human", access: "deny-remote", src: "routes/human.ts", why: "host collaboration configuration write" },
|
|
688
702
|
{ method: "POST", path: "/agent/agents/:slug/human/undo", access: "deny-remote", src: "routes/human.ts", why: "host collaboration configuration undo" },
|
|
703
|
+
{ method: "GET", path: "/agent/human/:file", access: "deny-remote", src: "routes/human.ts", why: "host human folder (HUMAN / AGENT / SOUL / MEMORY)" },
|
|
704
|
+
{ method: "PUT", path: "/agent/human/:file", access: "deny-remote", src: "routes/human.ts", why: "host human folder write" },
|
|
705
|
+
{ method: "POST", path: "/agent/human/:file/undo", access: "deny-remote", src: "routes/human.ts", why: "host human folder undo" },
|
|
689
706
|
{ method: "GET", path: "/agent/project-context/human", access: "deny-remote", src: "routes/human.ts", why: "host collaboration configuration" },
|
|
690
707
|
{ method: "PUT", path: "/agent/project-context/human", access: "deny-remote", src: "routes/human.ts", why: "host collaboration configuration write" },
|
|
691
708
|
{ method: "POST", path: "/agent/project-context/human/undo", access: "deny-remote", src: "routes/human.ts", why: "host collaboration configuration undo" },
|
|
@@ -703,6 +720,8 @@ var ENGINE_ROUTES = [
|
|
|
703
720
|
{ method: "GET", path: "/agent/memory", access: "allow", src: "routes/memory.ts", why: "read memory" },
|
|
704
721
|
{ method: "POST", path: "/agent/memory", access: "deny-remote", src: "routes/memory.ts", why: "memory write" },
|
|
705
722
|
{ method: "POST", path: "/agent/sync", access: "deny-remote", src: "routes/memory.ts", why: "memory sync (design appendix C)" },
|
|
723
|
+
{ method: "GET", path: "/agent/sync/default", access: "allow", src: "routes/memory.ts", why: "account-level agent sync switch (read)" },
|
|
724
|
+
{ method: "PUT", path: "/agent/sync/default", access: "deny-remote", src: "routes/memory.ts", why: "account-level agent sync switch: only this computer decides what it uploads" },
|
|
706
725
|
{ method: "GET", path: "/agent/sync/status", access: "allow", src: "routes/memory.ts", why: "memory sync status" },
|
|
707
726
|
{ method: "DELETE", path: "/agent/agents/:slug/memory/dream", access: "deny-remote", src: "routes/memoryMaintenance.ts", why: "memory maintenance control" },
|
|
708
727
|
{ method: "GET", path: "/agent/agents/:slug/memory/dream", access: "allow", src: "routes/memoryMaintenance.ts", why: "read memory maintenance state" },
|
|
@@ -741,6 +760,7 @@ var ENGINE_ROUTES = [
|
|
|
741
760
|
{ method: "POST", path: "/agent/project-context/git/publish-github", access: "deny-remote", src: "routes/projectContext.ts", why: "creates a GitHub repository with the linked account, adds a remote and pushes" },
|
|
742
761
|
{ method: "POST", path: "/agent/project-context/git/pull", access: "deny-remote", src: "routes/projectContext.ts", why: "git fetch + fast-forward with local credentials (runs repository hooks)" },
|
|
743
762
|
{ method: "POST", path: "/agent/project-context/git/push", access: "deny-remote", src: "routes/projectContext.ts", why: "git push with local credentials" },
|
|
763
|
+
{ method: "POST", path: "/agent/project-context/git/push-target", access: "deny-remote", src: "routes/projectContext.ts", why: "git repository config write (which remote the current branch pushes to)" },
|
|
744
764
|
{ method: "POST", path: "/agent/project-context/git/remote", access: "deny-remote", src: "routes/projectContext.ts", why: "writes the repo config and contacts the remote (may send the signed-in account credentials)" },
|
|
745
765
|
{ method: "POST", path: "/agent/project-context/git/trust", access: "deny-remote", src: "routes/projectContext.ts", why: "trusts repo-provided executable git config" },
|
|
746
766
|
{ method: "DELETE", path: "/agent/project-context/icon", access: "deny-remote", src: "routes/projectContext.ts", why: "project icon write" },
|
|
@@ -777,10 +797,13 @@ var ENGINE_ROUTES = [
|
|
|
777
797
|
{ method: "DELETE", path: "/agent/sessions/:id", access: "deny-remote", src: "routes/sessions.ts", why: "irreversible hard delete of a local session (runs, messages, code checkpoints); remote uses archive (PATCH archived)" },
|
|
778
798
|
{ method: "PATCH", path: "/agent/sessions/:id", access: "allow", src: "routes/sessions.ts", why: "rename / archive / model / project of a session (a remote project_path never widens /unit/host* reads: only locally confirmed project roots count)" },
|
|
779
799
|
{ method: "POST", path: "/agent/sessions/:id/aside", access: "allow", src: "routes/sessions.ts", why: "btw aside (taint propagates, C5)" },
|
|
800
|
+
{ method: "GET", path: "/agent/sessions/:id/asides", access: "allow", src: "routes/sessions.ts", why: "saved btw asides of a session (read)" },
|
|
801
|
+
{ method: "DELETE", path: "/agent/sessions/:id/asides/:asideId", access: "deny-remote", src: "routes/sessions.ts", why: "irreversible delete of a saved btw aside; local only like session hard delete" },
|
|
780
802
|
{ method: "GET", path: "/agent/sessions/:id/background", access: "allow", src: "routes/sessions.ts", why: "background child sessions" },
|
|
781
803
|
{ method: "POST", path: "/agent/sessions/:id/branch", access: "allow", src: "routes/sessions.ts", why: "branch a session (remote taint propagates, C5)" },
|
|
782
804
|
{ method: "GET", path: "/agent/sessions/:id/checkpoints", access: "allow", src: "routes/sessions.ts", why: "list code checkpoints" },
|
|
783
805
|
{ method: "POST", path: "/agent/sessions/:id/checkpoints/restore", access: "deny-remote", src: "routes/sessions.ts", why: "restores host files from checkpoints (design appendix C)" },
|
|
806
|
+
{ method: "POST", path: "/agent/sessions/:id/children", access: "allow", src: "routes/sessions.ts", why: "task card starts a visible child session; remote taint is copied onto its first run and stored marker (C5)" },
|
|
784
807
|
{ method: "POST", path: "/agent/sessions/:id/compact", access: "allow", src: "routes/sessions.ts", why: "compact a session" },
|
|
785
808
|
{ method: "GET", path: "/agent/sessions/:id/config", access: "allow", src: "routes/sessions.ts", why: "read session config" },
|
|
786
809
|
{ method: "PATCH", path: "/agent/sessions/:id/config", access: "allow", src: "routes/sessions.ts", why: "session config patch (field subset + approval ceiling enforced engine-side, P0 \u2463 / C3)" },
|
|
@@ -788,11 +811,13 @@ var ENGINE_ROUTES = [
|
|
|
788
811
|
{ method: "GET", path: "/agent/sessions/:id/detail", access: "allow", src: "routes/sessions.ts", why: "session detail" },
|
|
789
812
|
{ method: "GET", path: "/agent/sessions/:id/messages", access: "allow", src: "routes/sessions.ts", why: "session messages" },
|
|
790
813
|
{ method: "POST", path: "/agent/sessions/:id/messages/delete", access: "deny-remote", src: "routes/sessions.ts", why: "irreversible deletion of local conversation history" },
|
|
814
|
+
{ method: "POST", path: "/agent/sessions/:id/read", access: "allow", src: "routes/sessions.ts", why: "mark a session read (only moves last_read_at)" },
|
|
791
815
|
{ method: "GET", path: "/agent/sessions/:id/status", access: "allow", src: "routes/sessions.ts", why: "live run status (context / tokens / steps)" },
|
|
792
816
|
{ method: "POST", path: "/agent/sessions/:id/suggest", access: "allow", src: "routes/sessions.ts", why: "next-message suggestion for the input box (reads a one-shot in-memory snapshot of the run that just ended; writes nothing)" },
|
|
793
817
|
{ method: "POST", path: "/agent/sessions/:id/team-members/:slug", access: "allow", src: "routes/sessions.ts", why: "open a team member child session (taint propagates, C5)" },
|
|
794
818
|
{ method: "GET", path: "/agent/sessions/:id/timeline", access: "allow", src: "routes/sessions.ts", why: "session timeline" },
|
|
795
819
|
{ method: "GET", path: "/agent/sessions/:id/usage", access: "allow", src: "routes/sessions.ts", why: "session usage" },
|
|
820
|
+
{ method: "GET", path: "/agent/sessions/attention", access: "allow", src: "routes/sessions.ts", why: "per-session unread / waiting flags for row status and the Tangu badge (ids and booleans only)" },
|
|
796
821
|
{ method: "GET", path: "/agent/sessions/search", access: "allow", src: "routes/sessions.ts", why: "session search" },
|
|
797
822
|
{ method: "POST", path: "/agent/solo/:kind/:id/open", access: "allow", src: "routes/solo.ts", why: "open the Agent direct-chat session" },
|
|
798
823
|
{ method: "POST", path: "/agent/solo/:kind/:id/rotate", access: "allow", src: "routes/solo.ts", why: "start a fresh Agent direct-chat session" },
|
|
@@ -1085,6 +1110,7 @@ var VAULT_RPC_LOCAL_ONLY = /* @__PURE__ */ new Set([IPC.emptyTrash, IPC.deleteTr
|
|
|
1085
1110
|
var UNIT_INTERNAL_HEADER = "x-unit-internal";
|
|
1086
1111
|
var UNIT_P2P_HEADER = "x-unit-p2p";
|
|
1087
1112
|
var LOCAL_ONLY_BODY = { code: "LOCAL_ONLY", detail: "This action is only available on the device itself" };
|
|
1113
|
+
var HOST_OFF_BODY = { code: "HOST_OFF", detail: "Device connection is turned off on this computer" };
|
|
1088
1114
|
var BAD_CALLER_BODY = { code: "BAD_CALLER_ASSERTION", detail: "Invalid caller assertion" };
|
|
1089
1115
|
var ENGINE_PATH_CHARS = /^(?:[A-Za-z0-9\-._~!$&'()*+,;=:@/]|%[0-9A-Fa-f]{2})*$/;
|
|
1090
1116
|
var ENGINE_QUERY_CHARS = /^[\x21-\x7e]*$/;
|
|
@@ -1123,6 +1149,8 @@ function engineRouteAccess(method, normPath) {
|
|
|
1123
1149
|
}
|
|
1124
1150
|
var decodeRpcArgs = (args2) => args2.map((a) => a && typeof a === "object" && typeof a.__u8 === "string" ? Buffer.from(a.__u8, "base64") : a);
|
|
1125
1151
|
var encodeRpcResult = (r) => r instanceof Uint8Array ? { __u8: Buffer.from(r).toString("base64") } : r;
|
|
1152
|
+
var newPairStore = () => ({ pending: /* @__PURE__ */ new Map(), byIp: /* @__PURE__ */ new Map() });
|
|
1153
|
+
var DOORBELL_PATHS = /* @__PURE__ */ new Set(["/unit/meta", "/unit/pair/request", "/unit/pair/poll", "/unit/browser-control"]);
|
|
1126
1154
|
var sha256 = (s) => createHash("sha256").update(s).digest("hex");
|
|
1127
1155
|
var PAIR_TTL_MS = 2 * 6e4;
|
|
1128
1156
|
var MIME = {
|
|
@@ -1198,8 +1226,7 @@ function startUnitWeb(deps, opts) {
|
|
|
1198
1226
|
const proxyCallerKey = randomBytes(32).toString("hex");
|
|
1199
1227
|
const seenCallerDispatch = /* @__PURE__ */ new Map();
|
|
1200
1228
|
const ownerProjection = deps.projection?.mode === "local";
|
|
1201
|
-
const pending
|
|
1202
|
-
const pendingByIp = /* @__PURE__ */ new Map();
|
|
1229
|
+
const { pending, byIp: pendingByIp } = opts.pairs ?? newPairStore();
|
|
1203
1230
|
const assetTokens = /* @__PURE__ */ new Map();
|
|
1204
1231
|
const ASSET_TTL_MS = 10 * 6e4;
|
|
1205
1232
|
const gc = () => {
|
|
@@ -1429,6 +1456,10 @@ function startUnitWeb(deps, opts) {
|
|
|
1429
1456
|
}
|
|
1430
1457
|
};
|
|
1431
1458
|
const handler = async (req, res) => {
|
|
1459
|
+
if (opts.doorbell && !DOORBELL_PATHS.has(plainPath(req))) {
|
|
1460
|
+
json2(res, 503, HOST_OFF_BODY);
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1432
1463
|
if (!ownerProjection && lockedNow()) {
|
|
1433
1464
|
const p = plainPath(req);
|
|
1434
1465
|
if (!(p === "/engine" || p.startsWith("/engine/")) && p !== "/vault/rpc" && !lockedRequestAllowed(req.method || "GET", p)) {
|
|
@@ -1494,6 +1525,10 @@ function startUnitWeb(deps, opts) {
|
|
|
1494
1525
|
return;
|
|
1495
1526
|
}
|
|
1496
1527
|
if (path === "/unit/pair/request" && req.method === "POST") {
|
|
1528
|
+
if (opts.doorbell && !opts.doorbell.origins.includes(String(req.headers.origin || ""))) {
|
|
1529
|
+
json2(res, 403, HOST_OFF_BODY);
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1497
1532
|
const prevId = pendingByIp.get(ip);
|
|
1498
1533
|
if (prevId && pending.get(prevId)?.status === "pending") {
|
|
1499
1534
|
json2(res, 429, { detail: "\u5DF2\u6709\u5F85\u786E\u8BA4\u7684\u914D\u5BF9\u8BF7\u6C42", code: "PAIR_PENDING" });
|
|
@@ -1515,7 +1550,7 @@ function startUnitWeb(deps, opts) {
|
|
|
1515
1550
|
pending.set(p.id, p);
|
|
1516
1551
|
pendingByIp.set(ip, p.id);
|
|
1517
1552
|
json2(res, 200, { requestId: p.id, code: p.code, ttlMs: PAIR_TTL_MS });
|
|
1518
|
-
void deps.confirmPair({ name: p.name, code: p.code, ip }).then(async (ok) => {
|
|
1553
|
+
void deps.confirmPair({ name: p.name, code: p.code, ip, expires: p.expires }).then(async (ok) => {
|
|
1519
1554
|
const live = pending.get(p.id);
|
|
1520
1555
|
if (!live || live.status !== "pending" || live.expires < Date.now()) return;
|
|
1521
1556
|
if (!ok) {
|
|
@@ -1547,6 +1582,24 @@ function startUnitWeb(deps, opts) {
|
|
|
1547
1582
|
json2(res, 200, { status: p.status });
|
|
1548
1583
|
return;
|
|
1549
1584
|
}
|
|
1585
|
+
if (path === "/unit/browser-control" && req.method === "GET") {
|
|
1586
|
+
const info = authInfo(req);
|
|
1587
|
+
if (!info.ok) {
|
|
1588
|
+
json2(res, 401, { detail: "Not paired", code: "UNPAIRED" });
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
if (info.via !== "lan" || !isLoopback(req.socket.remoteAddress)) {
|
|
1592
|
+
json2(res, 403, LOCAL_ONLY_BODY);
|
|
1593
|
+
return;
|
|
1594
|
+
}
|
|
1595
|
+
const code = deps.browserControlCode ? await deps.browserControlCode() : null;
|
|
1596
|
+
if (!code) {
|
|
1597
|
+
json2(res, 404, { detail: "Browser control is not available on this computer", code: "BROWSER_CONTROL_UNAVAILABLE" });
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
json2(res, 200, { code });
|
|
1601
|
+
return;
|
|
1602
|
+
}
|
|
1550
1603
|
if (path === "/unit/whoami" && req.method === "GET") {
|
|
1551
1604
|
if (!authed(req)) {
|
|
1552
1605
|
json2(res, 401, { detail: "\u672A\u914D\u5BF9", code: "UNPAIRED" });
|
|
@@ -1856,7 +1909,7 @@ function startUnitWeb(deps, opts) {
|
|
|
1856
1909
|
});
|
|
1857
1910
|
server.requestTimeout = 60 * 60 * 1e3;
|
|
1858
1911
|
return new Promise((resolve8, reject) => {
|
|
1859
|
-
if (deps.routeUpgrade) server.on("upgrade", (req, socket, head) => {
|
|
1912
|
+
if (deps.routeUpgrade && !opts.doorbell) server.on("upgrade", (req, socket, head) => {
|
|
1860
1913
|
if (!deps.routeUpgrade(req, socket, head)) socket.destroy();
|
|
1861
1914
|
});
|
|
1862
1915
|
const sockets = /* @__PURE__ */ new Set();
|
|
@@ -1865,7 +1918,7 @@ function startUnitWeb(deps, opts) {
|
|
|
1865
1918
|
socket.once("close", () => sockets.delete(socket));
|
|
1866
1919
|
});
|
|
1867
1920
|
server.once("error", reject);
|
|
1868
|
-
server.listen(opts.port, opts.bindHost ?? "0.0.0.0", () => {
|
|
1921
|
+
server.listen(opts.port, opts.doorbell ? "127.0.0.1" : opts.bindHost ?? "0.0.0.0", () => {
|
|
1869
1922
|
const { port } = server.address();
|
|
1870
1923
|
resolve8({
|
|
1871
1924
|
port,
|
|
@@ -2980,6 +3033,7 @@ async function startBasicUnit(config, managementOptions = {}) {
|
|
|
2980
3033
|
product.agentBackend = product.nativeFeatures.includes("tangu");
|
|
2981
3034
|
product.spaces = spaces.length ? [] : ["home"];
|
|
2982
3035
|
product.defaultSpace = spaces.includes(config.defaultSpace || "") ? config.defaultSpace : spaces[0] || "home";
|
|
3036
|
+
product.market = visible2.some((r) => !!r.package.ui?.locked);
|
|
2983
3037
|
};
|
|
2984
3038
|
let chain = Promise.resolve(), closing = false, started = false;
|
|
2985
3039
|
const syncRuntimes = async () => {
|
|
@@ -3275,7 +3329,7 @@ init_control();
|
|
|
3275
3329
|
// desktop/package.json
|
|
3276
3330
|
var package_default = {
|
|
3277
3331
|
name: "forsion-desktop",
|
|
3278
|
-
version: "2.13.
|
|
3332
|
+
version: "2.13.5",
|
|
3279
3333
|
description: "Forsion Desktop \u2014 AI \u9A71\u52A8\u7684\u5E94\u7528\u751F\u6001\u7CFB\u7EDF\u7684\u684C\u9762\u7AEF(Electron):Tangu Agent \u5F15\u64CE + LCL \u53EF\u505C\u9760\u5DE5\u4F5C\u533A\u6846\u67B6 + \u53EF\u63D2\u62D4\u529F\u80FD\u7A7A\u95F4(\u5BF9\u8BDD/\u7B14\u8BB0/\u65E5\u5386/\u6536\u4EF6\u7BB1/\u7F16\u7801),\u6309\u4EA7\u54C1\u6863\u6848\u88C1\u51FA\u5168\u5BB6\u6876\u4E0E\u5355\u54C1\u53D1\u884C\u7248",
|
|
3280
3334
|
author: "Forsion",
|
|
3281
3335
|
private: true,
|
|
@@ -3283,8 +3337,9 @@ var package_default = {
|
|
|
3283
3337
|
main: "out/main/main.js",
|
|
3284
3338
|
scripts: {
|
|
3285
3339
|
postinstall: "node build/link-lcl.cjs && node build/copy-excalidraw-assets.cjs && node build/gen-fonts.cjs && node build/fix-pty-helper.cjs",
|
|
3286
|
-
predev: "node scripts/dev-version.check.cjs",
|
|
3340
|
+
predev: "node scripts/dev-version.check.cjs && node build/copy-excalidraw-assets.cjs",
|
|
3287
3341
|
dev: "electron-vite dev --noSandbox",
|
|
3342
|
+
"check:marketplace-upgrade": "node scripts/marketplace-upgrade.e2e.cjs",
|
|
3288
3343
|
"check:visualize": "node scripts/visualize.check.cjs",
|
|
3289
3344
|
"check:intelligent-ui": "node scripts/intelligent-ui.e2e.cjs",
|
|
3290
3345
|
"e2e:intelligent-live": "cd ../tangu-agent && node scripts/live-harness.mjs --only intelligentusers --model codex/gpt-6-luna --timeout 1800000",
|
|
@@ -3321,8 +3376,13 @@ var package_default = {
|
|
|
3321
3376
|
"check:listsrc": "node scripts/plugin-listsrc.check.cjs",
|
|
3322
3377
|
"e2e:latex": "node scripts/e2e-editor.cjs --script=latex-suite.e2e.cjs",
|
|
3323
3378
|
"e2e:activewindow": "node scripts/active-window.e2e.cjs",
|
|
3379
|
+
"check:plugindata": "node scripts/plugin-data.e2e.cjs",
|
|
3324
3380
|
"e2e:recall": "node scripts/recall-rewind.e2e.cjs",
|
|
3325
3381
|
"e2e:chatevents": "node scripts/chat-events.e2e.cjs",
|
|
3382
|
+
"e2e:nested": "node scripts/nested-sessions.e2e.cjs",
|
|
3383
|
+
"e2e:anchors": "node scripts/branch-anchors.e2e.cjs",
|
|
3384
|
+
"e2e:chatcanvas": "node scripts/chat-canvas.e2e.cjs",
|
|
3385
|
+
"e2e:musedm": "node scripts/muse-dm.e2e.cjs",
|
|
3326
3386
|
"e2e:computerhistory": "node scripts/computer-history.e2e.cjs",
|
|
3327
3387
|
"e2e:appdock": "node scripts/app-dock.e2e.cjs",
|
|
3328
3388
|
"e2e:apprefs": "node scripts/app-refs.e2e.cjs",
|
|
@@ -3339,6 +3399,7 @@ var package_default = {
|
|
|
3339
3399
|
"e2e:runlocation": "node scripts/run-location.e2e.cjs",
|
|
3340
3400
|
"check:runlocpill": "node scripts/e2e-editor.cjs --check=run-location-pill",
|
|
3341
3401
|
"e2e:chatlanding": "node scripts/amadeus-chat-landing.e2e.cjs",
|
|
3402
|
+
"e2e:websearch": "node scripts/websearch-settings.e2e.cjs",
|
|
3342
3403
|
"e2e:musespace": "node scripts/muse-space.e2e.cjs",
|
|
3343
3404
|
"e2e:coreplugins": "node scripts/core-plugins.e2e.cjs",
|
|
3344
3405
|
"e2e:restart-update": "node scripts/restart-update.e2e.cjs",
|
|
@@ -3346,9 +3407,13 @@ var package_default = {
|
|
|
3346
3407
|
"e2e:storepages": "node scripts/store-pages.e2e.cjs",
|
|
3347
3408
|
"e2e:market-auto-update": "node scripts/market-auto-update.e2e.cjs",
|
|
3348
3409
|
"e2e:market-open-settings": "node scripts/market-open-settings.e2e.cjs",
|
|
3410
|
+
"e2e:cloud-settings": "node scripts/cloud-settings-groups.e2e.cjs",
|
|
3349
3411
|
"e2e:account": "node scripts/account-center.shot.cjs",
|
|
3350
3412
|
"e2e:accountpopups": "node scripts/account-popups.shot.cjs",
|
|
3351
3413
|
"e2e:extend": "node scripts/extend-seam.e2e.cjs",
|
|
3414
|
+
"e2e:guide": "node scripts/guide-space.e2e.cjs",
|
|
3415
|
+
"check:guide-anchors": "node scripts/guide-space.e2e.cjs --anchors",
|
|
3416
|
+
"e2e:penzor": "node scripts/penzor-space.e2e.cjs",
|
|
3352
3417
|
"e2e:musesettings": "node scripts/muse-settings.e2e.cjs",
|
|
3353
3418
|
"e2e:modelcatalog": "node scripts/model-catalog.e2e.cjs",
|
|
3354
3419
|
"e2e:museagentspace": "node scripts/muse-agentspace.e2e.cjs",
|
|
@@ -3368,6 +3433,9 @@ var package_default = {
|
|
|
3368
3433
|
"check:selectionbar": "node scripts/selection-bar.check.cjs",
|
|
3369
3434
|
"check:promptsuggest": "node scripts/prompt-suggest.check.cjs",
|
|
3370
3435
|
"check:chatlayout": "node scripts/chat-layout.check.cjs",
|
|
3436
|
+
"check:chatscrollhold": "node scripts/chat-scroll-hold.check.cjs",
|
|
3437
|
+
"check:chatcanvasjump": "node scripts/chat-canvas-jump.check.cjs",
|
|
3438
|
+
"check:sendflight": "node scripts/send-flight.check.cjs",
|
|
3371
3439
|
"check:sessionemoji": "node scripts/session-emoji.check.cjs",
|
|
3372
3440
|
"check:messageactions": "node scripts/chat-message-actions.check.cjs",
|
|
3373
3441
|
"check:approval": "node scripts/approval-menu.check.cjs",
|
|
@@ -3375,6 +3443,9 @@ var package_default = {
|
|
|
3375
3443
|
"check:caret": "node scripts/smooth-caret.check.cjs",
|
|
3376
3444
|
"check:spacerestore": "node scripts/space-restore.check.cjs",
|
|
3377
3445
|
"check:spacerestart": "node scripts/space-restart.check.cjs",
|
|
3446
|
+
"check:spacemainpage": "node scripts/space-main-page.check.cjs",
|
|
3447
|
+
"check:rightrules": "node scripts/right-rules.check.cjs",
|
|
3448
|
+
"check:sidetoggle": "node scripts/side-toggle-drift.check.cjs",
|
|
3378
3449
|
"check:spacefallback": "node scripts/space-fallback-persist.check.cjs",
|
|
3379
3450
|
"check:bluebirdspace": "node scripts/bluebird-space.check.cjs",
|
|
3380
3451
|
"check:bluebirdtimestamps": "node scripts/bluebird-space.check.cjs --timestamps",
|
|
@@ -3403,6 +3474,7 @@ var package_default = {
|
|
|
3403
3474
|
"check:editorai": "node scripts/e2e-editor.cjs --check=editor-ai",
|
|
3404
3475
|
"check:menus": "node scripts/e2e-editor.cjs --check=editor-menus",
|
|
3405
3476
|
"check:cloudgap": "node scripts/cloud-gap.check.cjs",
|
|
3477
|
+
"check:cloudvaults": "node scripts/cloud-vault-sections.check.cjs",
|
|
3406
3478
|
"check:amadeusinteractions": "node scripts/e2e-editor.cjs --check=amadeus-interactions",
|
|
3407
3479
|
"check:dashboard": "node scripts/e2e-editor.cjs --check=dashboard",
|
|
3408
3480
|
"check:embedinputs": "node scripts/e2e-editor.cjs --check=embed-inputs",
|
|
@@ -3442,6 +3514,7 @@ var package_default = {
|
|
|
3442
3514
|
"e2e:pdfcite": "node scripts/pdf-citation.e2e.cjs",
|
|
3443
3515
|
"check:hlband": "node scripts/pdf-highlight-geometry.check.cjs",
|
|
3444
3516
|
"e2e:filecite": "node scripts/file-citation.e2e.cjs",
|
|
3517
|
+
"e2e:openfile": "node scripts/open-external-file.e2e.cjs",
|
|
3445
3518
|
"e2e:pathgonefiles": "node scripts/vault-pathgone-files.e2e.cjs",
|
|
3446
3519
|
"e2e:ftoverride": "node scripts/filetype-override.e2e.cjs",
|
|
3447
3520
|
"e2e:pathgoneunmounted": "node scripts/vault-pathgone-unmounted.e2e.cjs",
|
|
@@ -3461,21 +3534,34 @@ var package_default = {
|
|
|
3461
3534
|
"check:modelmenu": "node scripts/model-menu.check.cjs",
|
|
3462
3535
|
"check:menutap": "node scripts/menu-tap.check.cjs",
|
|
3463
3536
|
"check:settingsui": "node scripts/settings-ui.check.cjs",
|
|
3537
|
+
"check:settingsparts": "node scripts/settings-parts.shot.cjs",
|
|
3464
3538
|
"check:agentmemory": "node scripts/agent-memory.check.cjs",
|
|
3465
3539
|
"check:settingsmode": "node scripts/settings-mode.check.cjs",
|
|
3466
3540
|
"check:themecontrast": "node scripts/theme-contrast.check.cjs",
|
|
3467
3541
|
"check:themevisual": "node scripts/theme-visual.check.cjs",
|
|
3468
3542
|
"check:spaceappearance": "node scripts/space-appearance.e2e.cjs",
|
|
3469
3543
|
"check:fps": "node scripts/check-fps.cjs",
|
|
3544
|
+
"probe:longcontent": "node scripts/long-content.probe.cjs",
|
|
3470
3545
|
"check:themeapp": "node scripts/theme-app.check.cjs",
|
|
3471
3546
|
"check:marketui": "node scripts/market-ui.check.cjs",
|
|
3472
3547
|
"probe:marketdl": "node scripts/market-download.probe.cjs",
|
|
3473
3548
|
"check:uiscale": "node scripts/ui-scale.check.cjs",
|
|
3549
|
+
"check:attachfold": "node scripts/chat-attach-fold.check.cjs",
|
|
3550
|
+
"check:imageviewer": "node scripts/chat-image-viewer.check.cjs",
|
|
3551
|
+
"check:shortcuts": "node scripts/shortcut-conflicts.check.cjs",
|
|
3552
|
+
"e2e:cusettings": "node scripts/computer-use-settings.e2e.cjs",
|
|
3474
3553
|
"check:uifont": "node scripts/ui-font.check.cjs",
|
|
3475
3554
|
"check:topchrome": "node scripts/top-chrome.check.cjs",
|
|
3476
3555
|
"check:minicard": "node scripts/mini-card.check.cjs",
|
|
3556
|
+
"check:minidock": "node scripts/mini-dock.e2e.cjs",
|
|
3477
3557
|
"check:floatingpanel": "node scripts/floating-panel.check.cjs",
|
|
3478
3558
|
"check:quietfocus": "node scripts/quiet-focus.check.cjs",
|
|
3559
|
+
"check:windows-background": "node scripts/background-desktop.check.cjs",
|
|
3560
|
+
"check:windows-icons": "node scripts/windows-icons.check.cjs",
|
|
3561
|
+
"check:windows-updater": "node scripts/windows-updater.check.cjs",
|
|
3562
|
+
"check:windows-apprefs": "node scripts/windows-apprefs.check.cjs",
|
|
3563
|
+
"e2e:windows-clip": "node scripts/windows-clip.e2e.cjs",
|
|
3564
|
+
"e2e:windows-legacy": "node scripts/windows-legacy-state.e2e.cjs",
|
|
3479
3565
|
"check:persistignore": "node scripts/persist-ignore.check.cjs",
|
|
3480
3566
|
"check:spaceicon": "node scripts/space-icon.check.cjs",
|
|
3481
3567
|
"check:spacehidden": "node scripts/plugin-space-hidden.check.cjs",
|
|
@@ -3483,12 +3569,16 @@ var package_default = {
|
|
|
3483
3569
|
"check:plugindeps": "node scripts/plugin-deps.check.cjs",
|
|
3484
3570
|
"check:pluginsync": "node scripts/plugin-install-sync.check.cjs",
|
|
3485
3571
|
"check:first-run": "node scripts/onboarding.check.cjs",
|
|
3572
|
+
"stage:calendar": "node scripts/calendar.stage.cjs",
|
|
3486
3573
|
"stage:first-run": "node scripts/onboarding.stage.cjs",
|
|
3487
3574
|
"check:miniauto": "node scripts/mini-auto.check.cjs",
|
|
3488
3575
|
"check:board": "node scripts/board-paper.check.cjs",
|
|
3489
3576
|
"check:boardlive": "node scripts/e2e-editor.cjs --check=board-live",
|
|
3577
|
+
"check:boardpen": "node scripts/e2e-editor.cjs --check=board-pen",
|
|
3578
|
+
"check:boardview": "node scripts/board-view.electron.cjs",
|
|
3490
3579
|
"check:scrollbar": "node scripts/scrollbar-overlay.check.cjs",
|
|
3491
3580
|
"check:callout": "node scripts/callout-fold.check.cjs",
|
|
3581
|
+
"check:typejitter": "node scripts/type-jitter.probe.cjs",
|
|
3492
3582
|
"check:toggle": "node scripts/e2e-editor.cjs --check=toggle-block",
|
|
3493
3583
|
"check:togglecaret": "node scripts/e2e-editor.cjs --check=toggle-caret",
|
|
3494
3584
|
"check:togglecontent": "node scripts/e2e-editor.cjs --check=toggle-content",
|
|
@@ -3529,12 +3619,18 @@ var package_default = {
|
|
|
3529
3619
|
"probe:startup-windows": "node scripts/startup-windows.probe.cjs",
|
|
3530
3620
|
"probe:startup-trace": "node scripts/startup-trace.probe.cjs",
|
|
3531
3621
|
"check:parity": "node scripts/platform-parity.check.cjs",
|
|
3622
|
+
"check:terms": "node scripts/terms-update.check.cjs",
|
|
3623
|
+
"check:tanguboundary": "node scripts/tangu-boundary.check.cjs --selftest && node scripts/tangu-boundary.check.cjs",
|
|
3624
|
+
"check:achcloud": "node scripts/achievements-cloud.check.cjs",
|
|
3625
|
+
"e2e:spaceswitch": "node scripts/space-switch.electron.cjs",
|
|
3532
3626
|
"check:vitecache": "node scripts/vite-cachedir.check.cjs",
|
|
3533
3627
|
"check:enginetarget": "node scripts/engine-target.check.cjs",
|
|
3534
3628
|
"check:remotechain": "node scripts/remote-chain.e2e.cjs",
|
|
3535
3629
|
"check:streamrenew": "node scripts/stream-renew.check.cjs",
|
|
3536
3630
|
"check:phonedist": "node scripts/lib/phone-dist-stamp.selftest.cjs",
|
|
3537
3631
|
"check:unitswitcher": "node scripts/unit-switcher.check.cjs",
|
|
3632
|
+
"e2e:unitsettings": "node scripts/unit-settings.e2e.cjs",
|
|
3633
|
+
"e2e:unitpublic": "npx tsx scripts/unit-public-extend.e2e.ts",
|
|
3538
3634
|
"check:secrets": "node scripts/device-secrets.e2e.cjs",
|
|
3539
3635
|
"gen:engineroutes": "node scripts/gen-engine-routes.mjs",
|
|
3540
3636
|
"test:ics-tz": 'for tz in Europe/London America/New_York Asia/Shanghai Australia/Lord_Howe UTC; do echo "== $tz"; TZ=$tz vitest run frontend/src/views/calendar/ics.test.ts || exit 1; done',
|
|
@@ -3562,6 +3658,7 @@ var package_default = {
|
|
|
3562
3658
|
"fix:zhpunct": "node scripts/zh-punct.codemod.cjs",
|
|
3563
3659
|
"shot:walk": "node scripts/uiux-walk.shot.cjs",
|
|
3564
3660
|
"check:agentprofile": "node scripts/agent-profile.check.cjs",
|
|
3661
|
+
"check:humanprofile": "node scripts/human-profile.check.cjs",
|
|
3565
3662
|
"check:projectdetails": "node scripts/project-details.check.cjs",
|
|
3566
3663
|
"check:creationcard": "node scripts/creation-card.check.cjs",
|
|
3567
3664
|
"check:teamoutputs": "node scripts/team-outputs.check.cjs",
|
|
@@ -3584,8 +3681,12 @@ var package_default = {
|
|
|
3584
3681
|
"check:shadowcontract": "node scripts/shadow-contract.check.cjs",
|
|
3585
3682
|
"check:shadowsurface": "node scripts/shadow-surface.check.cjs",
|
|
3586
3683
|
"check:calendarui": "node scripts/calendar-ui.check.cjs",
|
|
3684
|
+
"check:calendar-actions": "node scripts/calendar-actions.check.cjs",
|
|
3587
3685
|
"check:astryxscope": "node scripts/astryx-scope.check.cjs",
|
|
3686
|
+
"check:astryxhas": "node scripts/astryx-has.check.cjs",
|
|
3687
|
+
"check:restylescope": "node scripts/restyle-scope.check.cjs",
|
|
3588
3688
|
"check:todo": "node scripts/todo-view.check.cjs",
|
|
3689
|
+
"check:homeglyph": "node scripts/home-glyph.check.cjs",
|
|
3589
3690
|
"check:chattabs": "node scripts/chat-multitab.check.cjs",
|
|
3590
3691
|
"check:openbeside": "node scripts/open-beside.check.cjs",
|
|
3591
3692
|
"check:linkmenu": "node scripts/e2e-editor.cjs --check=link-menu",
|
|
@@ -3602,6 +3703,7 @@ var package_default = {
|
|
|
3602
3703
|
"e2e:canvaslive": "node scripts/canvas-live.e2e.cjs",
|
|
3603
3704
|
"e2e:attachment-clipboard": "node scripts/attachment-clipboard.e2e.cjs",
|
|
3604
3705
|
"e2e:seams": "node scripts/plugin-seams.e2e.cjs",
|
|
3706
|
+
"e2e:toolcard": "node scripts/tool-result-card.e2e.cjs",
|
|
3605
3707
|
"check:imgsel": "node scripts/image-select.check.cjs",
|
|
3606
3708
|
"check:coldrag": "node scripts/e2e-editor.cjs --check=columns-realdrag",
|
|
3607
3709
|
"check:topdrag": "node scripts/e2e-editor.cjs --check=toplevel-realdrag",
|
|
@@ -3630,7 +3732,7 @@ var package_default = {
|
|
|
3630
3732
|
"@dnd-kit/sortable": "^10.0.0",
|
|
3631
3733
|
"@dnd-kit/utilities": "^3.2.2",
|
|
3632
3734
|
"@excalidraw/excalidraw": "npm:@zsviczian/excalidraw@0.18.122",
|
|
3633
|
-
"@forsion/extend": "0.
|
|
3735
|
+
"@forsion/extend": "0.9.1",
|
|
3634
3736
|
"@forsion/tangu-computer-use": "0.7.1",
|
|
3635
3737
|
"@milkdown/kit": "^7.21.2",
|
|
3636
3738
|
"@milkdown/plugin-math": "^7.5.9",
|
|
@@ -3688,6 +3790,7 @@ var package_default = {
|
|
|
3688
3790
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
3689
3791
|
"@fontsource/lxgw-wenkai": "^5.3.0",
|
|
3690
3792
|
"@fontsource/noto-sans-sc": "^5.3.0",
|
|
3793
|
+
"@forsion/clip": "2.1.1",
|
|
3691
3794
|
"@iarna/toml": "^2.2.5",
|
|
3692
3795
|
"@types/node": "^20.10.0",
|
|
3693
3796
|
"@types/qrcode": "^1.5.6",
|
package/package.json
CHANGED
package/release.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"desktopVersion": "2.13.
|
|
3
|
-
"desktopTag": "v2.13.
|
|
4
|
-
"desktopCommit": "
|
|
2
|
+
"desktopVersion": "2.13.5",
|
|
3
|
+
"desktopTag": "v2.13.5",
|
|
4
|
+
"desktopCommit": "8d9bff2af3a52313021c39f430a91e9066c27214",
|
|
5
5
|
"unitRevision": 0,
|
|
6
6
|
"prerelease": false,
|
|
7
|
-
"sourceCommit": "
|
|
7
|
+
"sourceCommit": "8d9bff2af3a52313021c39f430a91e9066c27214",
|
|
8
8
|
"sourceDirty": false,
|
|
9
|
-
"builtAt": "2026-10-
|
|
9
|
+
"builtAt": "2026-10-20T22:57:03.093Z",
|
|
10
10
|
"commercialServerIncluded": false
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as D,r as d,j as t}from"./index-fDB1l4d-.js";import{p as F,f as T,A as M,aO as R,s as y,a7 as W,l as V}from"./pageStore-CyvNZEYX.js";import"./client-fKy9CWk0.js";import{rp as q,ei as U,jQ as B,rq as N,ao as H,R as O,aW as _,dm as $,rr as K,f9 as Q,u as X}from"./appStore-DDOkzWDA.js";import{u as G}from"./codeStudioStore-BgLfCDK2.js";import{C as J}from"./CapabilityMenu-DyHTEYLr.js";import{c as Y}from"./react-b7FrqRQR.js";/* empty css */import{C as Z}from"./code-xml-DCCD9eCS.js";import{P as aa}from"./pencil--sWwxHdP.js";import{A as ta}from"./arrow-up-right-BptN64d-.js";import"./ipc-SAPDwyQ4.js";import"./nativeDownload-DsGyUSJ5.js";import"./dbStore-BIG5Mfh2.js";import"./drawingStore-CGvTqqYW.js";const ia=[["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"m15 10-3 3-3-3",key:"lzhmyn"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]],ea=F("monitor-down",ia);let p=0;const f=Y((i,l)=>({items:[],status:"loading",async load(){const m=window.tangu?.productsList;if(!m){i({status:"error"});return}const n=++p;l().status!=="ready"&&i({status:"loading"});try{const r=await m();n===p&&i({items:r,status:"ready"})}catch{n===p&&l().status!=="ready"&&i({status:"error"})}}})),v=i=>i instanceof Error?i.message:String(i);function ga(){const{t:i,locale:l}=D(),m=f(a=>a.items),n=f(a=>a.status),r=f(a=>a.load),[k]=d.useState(()=>f.getState().status!=="ready"),[S,o]=d.useState(null),w=T(a=>a.spaces.some(e=>e.id==="coding"))&&!!M("code-studio"),[z,g]=d.useState(()=>Date.now());d.useEffect(()=>{r();const a=()=>{g(Date.now()),r()};return window.addEventListener("focus",a),()=>{window.removeEventListener("focus",a)}},[r]),d.useEffect(()=>{const a=setInterval(()=>{document.hidden||g(Date.now())},6e4);return()=>clearInterval(a)},[]);const u=(a,e,s=!1)=>X.getState().toast(i(a,e),s),L=a=>{V.getState().openView("product",{id:a.id},"main",{newTab:!0})},C=a=>{window.tangu?.openDetached?.([{type:"product",params:{id:a.id}}])},j=a=>{y("coding"),requestAnimationFrame(()=>{G.getState().openProject(a.root,a.name)})},E=async a=>{const e=window.tangu?.productsShortcut;if(e){o(a.id);try{const{key:s,error:c,vars:h}=K(await e(a.id,i("artificial.shortcut.fallbackName")));u(s,h,c)}catch(s){u("artificial.toast.shortcutFailed",{detail:v(s)},!0)}finally{o(null)}}},A=async a=>{const e=window.tangu?.productsUpdate;if(!e)return;const s=(await Q(i("artificial.rename.title"),a.name,{label:i("artificial.rename.label")}))?.trim();if(!(!s||s===a.name)){o(a.id);try{await e(a.id,{name:s}),await r()}catch(c){u("artificial.toast.renameFailed",{detail:v(c)},!0)}finally{o(null)}}},I=async a=>{const e=window.tangu?.productsTrash;if(!(!e||!window.confirm(i(a.external?"artificial.remove.confirm":"artificial.trash.confirm",{name:a.name})))){o(a.id);try{await e(a.id,{action:a.external?"unregister":"trash",dirId:a.dirId}),await r()}catch(s){u("artificial.toast.trashFailed",{detail:v(s)},!0)}finally{o(null)}}},P=a=>{const e=N(a.kind),s=e.icon,c=S===a.id,h=[...e.canLaunch&&window.tangu?.openDetached?[{id:"open-window",label:i("artificial.action.openWindow"),icon:t.jsx(H,{size:14}),onSelect:()=>C(a)}]:[],...w?[{id:"edit",label:i("artificial.action.edit"),icon:t.jsx(Z,{size:14}),onSelect:()=>j(a)}]:[],...e.canShortcut&&window.tangu?.productsShortcut?[{id:"shortcut",label:i("artificial.action.shortcut"),icon:t.jsx(ea,{size:14}),onSelect:()=>{E(a)}}]:[],...window.tangu?.revealHostPath?[{id:"reveal",label:i("artificial.action.reveal"),icon:t.jsx(O,{size:14}),onSelect:()=>{window.tangu?.revealHostPath?.(a.root)}}]:[],...window.tangu?.productsUpdate?[{id:"rename",label:i("artificial.action.rename"),icon:t.jsx(aa,{size:14}),onSelect:()=>{A(a)}}]:[],...window.tangu?.productsTrash?[{id:"trash",label:i(a.external?"artificial.action.remove":"artificial.action.trash"),icon:t.jsx(_,{size:14}),danger:!0,onSelect:()=>{I(a)}}]:[]],b=c||!e.canLaunch&&!w;return t.jsxs("div",{className:"newtab-card art-card","data-artificial-card":!0,"data-product-id":a.id,"data-kind":a.kind,children:[t.jsxs("button",{className:"art-card-main","data-action":"open",disabled:b,"aria-label":e.canLaunch?i("artificial.action.open",{name:a.name}):`${i("artificial.action.edit")} · ${a.name}`,onClick:()=>e.canLaunch?L(a):j(a),children:[t.jsx("span",{className:"newtab-card-ic",children:t.jsx(s,{size:18})}),t.jsx("span",{className:"art-card-name",title:a.name,children:a.name}),!b&&t.jsx(ta,{size:14,className:"art-card-go","aria-hidden":!0})]}),t.jsxs("div",{className:"art-card-foot",children:[t.jsxs("div",{className:"art-card-meta",children:[t.jsx("span",{children:$(a.updatedAt,{now:z,locale:l})}),a.published&&t.jsx("span",{className:"art-badge","data-badge":"published",children:i("artificial.badge.published")}),a.kind==="plugin"&&a.devLoad&&t.jsx("span",{className:"art-badge","data-badge":"devload",children:i("artificial.badge.devLoad")})]}),h.length>0&&t.jsx(J,{label:i("artificial.action.more",{name:a.name}),className:"icon-btn art-card-more",disabled:c,items:h,children:t.jsx(W,{size:14})})]})]},a.id)},x=q(m);return t.jsx("div",{className:"art-root","data-artificial-root":!0,children:t.jsxs("div",{className:"art-inner",children:[t.jsxs("div",{className:"art-head",children:[t.jsx(U,{size:18}),t.jsxs("div",{className:"art-titles",children:[t.jsx("div",{className:"art-title",children:i("view.artificial")}),t.jsx("div",{className:"art-sub",children:i("artificial.subtitle")})]}),t.jsx("button",{className:"icon-btn","data-action":"refresh",title:i("artificial.refresh"),"aria-label":i("artificial.refresh"),onClick:()=>{r()},children:t.jsx(B,{size:14})})]}),n==="loading"&&t.jsxs("div",{className:"art-loading","data-state":"loading",children:[t.jsx(R,{variant:"list"}),t.jsx("span",{className:"art-sr-only",role:"status",children:i("artificial.loading")})]}),n==="error"&&t.jsxs("div",{className:"art-state",role:"alert","data-state":"error",children:[t.jsx("div",{className:"art-state-title",children:i("artificial.loadFailed")}),t.jsx("button",{className:"btn sm","data-action":"retry",onClick:()=>{r()},children:i("common.retry")})]}),n==="ready"&&!x.length&&t.jsxs("div",{className:"art-state","data-state":"empty",children:[t.jsx("div",{className:"art-state-title",children:i("artificial.empty.title")}),t.jsx("p",{children:i("artificial.empty.body")}),w&&t.jsx("button",{className:"btn primary sm","data-action":"go-coding",onClick:()=>y("coding"),children:i("artificial.empty.cta")})]}),n==="ready"&&x.length>0&&t.jsx("div",{className:k?"sk-fade-in":void 0,children:x.map(a=>t.jsxs("div",{className:"newtab-sec","data-kind-group":a.kind,children:[t.jsx("div",{className:"newtab-sec-title",children:i(N(a.kind).labelKey)}),t.jsx("div",{className:"newtab-grid art-grid",children:a.items.map(P)})]},a.kind))})]})})}export{ga as ArtificialView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,j as e,u as xe}from"./index-fDB1l4d-.js";import{p3 as le,b0 as Ze,k9 as Je,k5 as Qe,j2 as et,kc as tt,p4 as at,i as nt,ag as it,p5 as lt,p6 as $e,p7 as Ie,dp as Fe,p8 as Re,hK as be,p9 as st,aW as pe,pa as ot,pb as rt,aU as ut,aV as dt,L as ct,W as mt,iY as ht,pc as bt,pd as pt,l as xt,pe as vt,pf as jt,u as gt}from"./appStore-DDOkzWDA.js";import{p as ft,T as yt,b7 as Nt,bv as _t,aj as Ct,ba as kt,b9 as wt,u as St,Z as De,q as Te,a6 as Et,am as Pt,B as $t,D as Ft,as as Rt}from"./pageStore-CyvNZEYX.js";import{u as ie}from"./dbStore-BIG5Mfh2.js";import{C as Dt}from"./CapabilityMenu-DyHTEYLr.js";import{u as Tt}from"./gestures-ZhFAENNZ.js";import{a as zt,C as Mt}from"./Chrome-C7F6fdDp.js";import{d as It,e as At,f as qt,g as Ht}from"./canvasPrefs-ArsX3NFO.js";import{R as Vt}from"./rotate-ccw-D8kni6Ni.js";import"./messages-GQUjmbwW.js";const Wt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Lt=ft("circle-question-mark",Wt);function Ot({controller:i,open:c,title:b,onClose:C,children:h}){const[j]=o.useState(()=>document.createElement("div"));j.className="auto-extension";const a=o.useRef(null),k=o.useRef(C);k.current=C;const v=o.useRef(b);return v.current=b,o.useEffect(()=>{if(!(!i||!c)){try{a.current=i.open({id:"automation-context",title:()=>v.current,mount:f=>(f.appendChild(j),()=>j.remove()),onClose:()=>k.current()})}catch{k.current()}return()=>{a.current?.close(),a.current=null}}},[i,c,j]),c?i?yt.createPortal(h,j):e.jsx("div",{className:"auto-extension auto-extension-inline",children:h}):null}const oa=["reminder","briefing","table","button"];function Bt(i,c){return i?i==="briefing"||i==="button"?[{...le("agent_run"),prompt:c(`automation.ux.${i}.prompt`)}]:[{...le("notify"),title:c(`automation.ux.${i}.name`),body:c(`automation.ux.${i}.body`)}]:[le("notify")]}function ze(i,c,b){if(i.type==="notify")return i.title.trim()?null:"notify";if(i.type==="agent_run")return i.agentSlug?i.prompt.trim()?null:"prompt":"agent";if(i.type==="db_row_add"||i.type==="db_row_edit"){if(!/\.db$/i.test(i.dbPath.trim()))return"table";if(!i.cells.some(h=>h.k.trim()))return"cells";if(i.type==="db_row_edit"){if(c!=="db_changed"&&(!i.rowId.trim()&&!i.matchColumn.trim()||i.rowFrom.trim()))return"row";if(i.matchColumn.trim()&&!i.matchValue.trim())return"match"}return null}const C=b.find(h=>h.name===i.tool);if(!C)return"tool";if((C.parameters.required||[]).some(h=>!(i.argValues[h]||"").trim()))return"args";for(const[h,j]of Object.entries(i.argValues)){if(!j.trim())continue;const a=C.parameters.properties?.[h];if(a?.type==="number"&&!Number.isFinite(Number(j)))return"args";if(a?.type==="object"||a?.type==="array")try{const k=JSON.parse(j);if(a.type==="array"?!Array.isArray(k):!k||typeof k!="object"||Array.isArray(k))return"json"}catch{return"json"}}return null}function Ut(i){return(i||[]).map(c=>({value:`{{row.${c.id}}}`,label:c.name}))}const Kt=i=>({x:0,y:i*132,w:244,h:84}),Yt=({nodes:i,selected:c,onSelect:b,children:C})=>{const{t:h}=xe(),j=o.useId().replace(/:/g,""),a=o.useRef(null),[k,v]=o.useState({}),[f,$]=o.useState(It),[I,F]=o.useState(At),p=Nt(a),m=new Map(i.map((n,s)=>[n.id,k[n.id]||Kt(s)])),P=i.map(n=>n.id).join(","),x=Tt(a,p,{boxes:()=>m,identity:()=>P,commit:n=>v(s=>({...s,...Object.fromEntries(n)})),hitKey:n=>n.closest("[data-flow-node]")?.dataset.flowNode||null,onEnterEdit:b,onDoubleClick:n=>{n&&b(n)},minW:244,minH:84,repel:!0},f);o.useEffect(()=>x.bind(a.current),[x.bind]),o.useEffect(()=>p.bindWheel(a.current),[p.bindWheel]);const D=o.useRef(()=>p.fitTo([...m.values()],64));D.current=()=>p.fitTo([...m.values()],64),o.useEffect(()=>{v({});const n=requestAnimationFrame(()=>D.current());return()=>cancelAnimationFrame(n)},[P]),o.useEffect(()=>{const n=new ResizeObserver(()=>D.current());return a.current&&n.observe(a.current),()=>n.disconnect()},[]);const A=n=>x.live?.get(n)||m.get(n);return e.jsx("div",{className:"auto-canvas-shell am-app",children:e.jsxs("div",{className:"auto-canvas amx-stage",ref:a,tabIndex:0,"aria-label":h("automation.ux.flow"),onPointerUpCapture:n=>{if(x.busy)return;const s=document.elementFromPoint(n.clientX,n.clientY)?.closest("[data-flow-node]");s&&a.current?.contains(s)&&b(s.dataset.flowNode)},children:[e.jsx("div",{className:"amx-stage-grid",style:_t(p.vp)}),e.jsxs("div",{className:"auto-canvas-world",style:{transform:`translate(${p.vp.x}px, ${p.vp.y}px) scale(${p.vp.z})`},children:[e.jsxs("svg",{className:"auto-canvas-edges","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsx("marker",{id:j,markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,3 L0,6",fill:"none",stroke:"currentColor"})})}),i.slice(1).map((n,s)=>{const y=A(i[s].id),w=A(n.id),q=y.x+y.w/2,H=y.y+y.h,X=w.x+w.w/2,W=w.y;return e.jsx("path",{d:`M${q},${H} C${q},${H+28} ${X},${W-28} ${X},${W}`,markerEnd:`url(#${j})`},n.id)})]}),i.map(n=>{const s=A(n.id);return e.jsxs("div",{"data-flow-node":n.id,role:"button",tabIndex:0,"aria-pressed":c===n.id,className:`auto-flow-node ${c===n.id?"selected":""}`,style:{left:s.x,top:s.y,width:s.w,height:s.h},onClick:()=>b(n.id),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),b(n.id))},children:[e.jsx("span",{className:"auto-flow-icon",children:n.icon}),e.jsx("strong",{children:n.title}),e.jsx("span",{className:"auto-flow-status",title:h(n.ready?"automation.ux.ready":"automation.ux.incomplete"),children:n.ready?e.jsx(Ct,{size:13}):e.jsx(Ze,{size:13})}),e.jsx("span",{className:"auto-flow-subtitle",children:n.subtitle})]},n.id)}),x.marquee&&e.jsx("div",{className:"amx-stage-marquee",style:{left:x.marquee.x,top:x.marquee.y,width:x.marquee.w,height:x.marquee.h}})]}),C&&e.jsx("div",{className:"amx-stage-tools auto-canvas-tools",children:C}),e.jsx(zt,{zoom:p.vp.z,onZoomBy:n=>{const{w:s,h:y}=kt(a.current);p.setVp(wt(p.vp,p.vp.z*n,s/2,y/2))},onFit:()=>D.current(),snap:f,onSnap:n=>{$(n),Ht(n)},mini:I,onMini:n=>{F(n),qt(n)},extra:e.jsx("button",{type:"button",title:h("automation.ux.arrange"),onClick:()=>{v({}),requestAnimationFrame(()=>D.current())},children:e.jsx(Vt,{size:12})})}),I&&e.jsx(Mt,{hostRef:a,vp:p.vp,items:i.map(n=>({key:n.id,kind:"card",box:A(n.id)})),onCenter:p.centerOn})]})})},Me=({label:i,value:c,onChange:b,multiline:C,maxLength:h=4e3,placeholder:j,columns:a,hasRow:k})=>{const{t:v}=xe(),f=o.useId(),$=o.useRef(null),I=o.useRef({start:c.length,end:c.length}),F=m=>{if(!m)return;const{start:P,end:x}=I.current;c.length-(x-P)+m.length>h||(b(c.slice(0,P)+m+c.slice(x)),requestAnimationFrame(()=>{$.current?.focus(),$.current?.setSelectionRange(P+m.length,P+m.length)}))},p={id:f,ref:$,value:c,maxLength:h,placeholder:j,onChange:m=>b(m.target.value),onSelect:m=>{I.current={start:m.currentTarget.selectionStart??c.length,end:m.currentTarget.selectionEnd??c.length}}};return e.jsxs("div",{className:"field auto-template-field",children:[e.jsxs("div",{className:"auto-field-heading",children:[e.jsx("label",{htmlFor:f,children:i}),e.jsxs("select",{"aria-label":v("automation.ux.insertVariable",{field:i}),value:"",onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:v("automation.ux.variables")}),e.jsx("option",{value:"{{today}}",children:v("automation.ux.today")}),e.jsx("option",{value:"{{now}}",children:v("automation.ux.now")}),k&&e.jsxs("optgroup",{label:v("automation.ux.triggerRow"),children:[e.jsx("option",{value:"{{row.id}}",children:v("automation.ux.rowId")}),Ut(a).map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))]})]})]}),C?e.jsx("textarea",{...p}):e.jsx("input",{type:"text",...p})]})};function Gt(){const i=new Date(Date.now()+36e5);i.setMinutes(0,0,0);const c=b=>String(b).padStart(2,"0");return`${i.getFullYear()}-${c(i.getMonth()+1)}-${c(i.getDate())}T${c(i.getHours())}:00`}const Xt=({editing:i,starter:c,fixedManual:b,onSaved:C,onCancel:h,extendView:j})=>{const{t:a}=xe(),k=Je(),v=Qe(),f=v.actionsCatalog,[$,I]=o.useState(i?.desc||(c?a(`automation.ux.${c}.name`):"")),[F,p]=o.useState("trigger"),[m,P]=o.useState(!1),x=t=>{p(t),P(!0)},[D,A]=o.useState(i?.enabled??!!b),n=i?.cond,[s,y]=o.useState(n?n.type==="event_seen"?"event_seen":n.type==="file_chars_gte"?"file_chars_gte":n.type==="manual"?"manual":n.type==="db_changed"?"db_changed":"timer":b||c==="button"?"manual":c==="table"?"db_changed":"timer"),[w,q]=o.useState(n?.type==="at"?"at":n?.type==="every"?"every":"daily_at"),[H,X]=o.useState(n?.type==="daily_at"?n.time:"09:00"),W=!!i&&et(i),[Z,Ae]=o.useState(n?.type==="at"&&!W?n.datetime.replace(" ","T"):Gt()),J=n?.type==="every"?/^(\d+)([mhd])$/.exec(n.interval):null,[Q,qe]=o.useState(J?J[1]:"1"),[ve,He]=o.useState(J?J[2]:"h"),[se,Ve]=o.useState(n?.type==="event_seen"?n.match:""),[oe,We]=o.useState(n?.type==="file_chars_gte"?n.path:""),[re,Le]=o.useState(n?.type==="file_chars_gte"?String(n.n):"100"),[R,Oe]=o.useState(n?.type==="db_changed"?n.path:""),[z,je]=o.useState(n?.type==="db_changed"?n.event:"row_added"),[V,ge]=o.useState(()=>tt(n)),fe=(t,d)=>ge(r=>d?r.includes(t)?r:[...r,t]:r.filter(l=>l!==t)),[ue,Be]=o.useState(n?.type==="db_changed"&&n.equals||""),[L,de]=o.useState(()=>at(n)),ce=(t,d)=>de(r=>r.map((l,u)=>u===t?{...l,...d}:l));o.useEffect(()=>{nt()},[]);const ye=St(t=>t.files),O=o.useMemo(()=>ye.filter(t=>/\.db$/i.test(t)),[ye]);o.useEffect(()=>{for(const t of O)ie.getState().load(t,t)},[O]);const Ne=ie(it(t=>O.filter(d=>t.entries[d]?.data?.source!==void 0))),ee=o.useMemo(()=>O.filter(t=>!Ne.includes(t)),[O,Ne]),B=ie(t=>s==="db_changed"&&R?t.entries[R]?.data?.columns:void 0),U=o.useMemo(()=>B?.filter(t=>t.type!=="formula"&&t.type!=="lookup"),[B]),[S,te]=o.useState(()=>i?lt(i):Bt(c,a)),[me,Ue]=o.useState(i&&!i.actions?.length&&!i.agentSlug&&i.prompt||""),[K,_e]=o.useState(()=>$e(i,s)),Ce=o.useRef(!1);o.useEffect(()=>{!i&&!Ce.current&&_e($e(null,s))},[s,i]);const[Y,ke]=o.useState(!1),[we,ae]=o.useState(""),Ke=t=>{if(S.length>=24)return;const d=le(t);te(r=>[...r,d]),x(String(d.key))},Se=S.some(t=>t.type==="agent_run"),g=(t,d)=>te(r=>r.map(l=>l.key===t?{...l,...d}:l)),Ee=(t,d)=>te(r=>{const l=t+d;if(l<0||l>=r.length)return r;const u=[...r];return[u[t],u[l]]=[u[l],u[t]],u});if(Ie(i))return e.jsxs("div",{className:"auto-builder",children:[e.jsxs("div",{className:"auto-builder-title",children:[e.jsx(Fe,{size:17})," ",a("automation.builder.editTitle")]}),e.jsx("div",{className:"auto-node",children:e.jsx("div",{className:"auto-hint",children:a("automation.builder.unsupported")})}),e.jsx("div",{className:"auto-builder-actions",children:e.jsx("button",{className:"btn ghost",onClick:()=>h?h():v.closeBuilder(),children:a("common.cancel")})})]});const Pe=!(s==="timer"&&(w==="daily_at"&&!/^\d{1,2}:\d{2}$/.test(H)||w==="at"&&!Z||w==="every"&&(!Number.isInteger(Number(Q))||Number(Q)<1))||s==="event_seen"&&!se.trim()||s==="file_chars_gte"&&(!oe.trim()||!(Number(re)>0))||s==="db_changed"&&(!/\.db$/i.test(R.trim())||z==="cell_changed"&&!V.length||L.length>Re||L.some(t=>t.column.trim()&&(t.op==="eq"||t.op==="ne")&&!t.value.trim()))),E=[];$.trim()||E.push({node:"trigger",text:a("automation.ux.issue.name")}),Pe||E.push({node:"trigger",text:a("automation.ux.issue.trigger")}),!S.length&&(!i||s==="manual")&&E.push({node:"review",text:a("automation.ux.issue.steps")}),S.forEach((t,d)=>{const r=ze(t,s,f);r&&E.push({node:String(t.key),text:`${d+1}. ${a(`automation.ux.issue.${r}`)}`})}),s!=="timer"&&s!=="manual"&&(!K.trim()||!Number.isFinite(Number(K))||Number(K)<0)&&E.push({node:"review",text:a("automation.ux.issue.cooldown")});const ne=E.length===0,Ye=async()=>{if(!ne||Y)return;const t=s==="timer"?w:s;if(t==="at"&&(ht(Z)?.getTime()??0)<Date.now()-5*6e4){ae(a("automation.builder.atPast"));return}const d=u=>ie.getState().entries[u]?.data?.source!==void 0;if([...t==="db_changed"?[R.trim()]:[],...S.filter(u=>u.type==="db_row_add"||u.type==="db_row_edit").map(u=>u.dbPath.trim())].filter(Boolean).some(d)){ae(a("automation.builder.dbNoteView"));return}ke(!0),ae("");const l=bt(S,f);try{const u=await pt(xt(),{id:i?.id,actor:"user",desc:$.trim(),cond_type:t,time:t==="daily_at"?H:void 0,datetime:t==="at"?Z:void 0,interval:t==="every"?`${Math.floor(Number(Q))}${ve}`:void 0,match:t==="event_seen"?se.trim():void 0,path:t==="file_chars_gte"?oe.trim():t==="db_changed"?R.trim():void 0,n:t==="file_chars_gte"?Number(re):void 0,event:t==="db_changed"?z:void 0,column_id:t==="db_changed"&&z==="cell_changed"?V[0]:void 0,column_ids:t==="db_changed"&&z==="cell_changed"&&V.length>1?V:void 0,equals:t==="db_changed"&&z==="cell_changed"&&ue.trim()?ue.trim():void 0,where:t==="db_changed"?jt(L):void 0,vault:t==="db_changed"&&i?.cond.type==="db_changed"?i.cond.vault:void 0,prompt:S.length?void 0:me.trim()||void 0,cooldown_hours:vt(s,K),actions:S.length?l:null,enabled:D});if(i?.id||Rt("automation.create"),C){v.bump(),C(u);return}v.acceptSaved(u),gt.getState().toast(a("automation.ux.saved"))}catch(u){ae(String(u?.message||u))}finally{ke(!1)}},he=t=>t==="notify"?e.jsx(ct,{size:14}):t==="agent_run"?e.jsx($t,{size:14}):t==="db_row_add"||t==="db_row_edit"?e.jsx(Ft,{size:14}):e.jsx(mt,{size:14}),Ge=[{id:"trigger",title:a("automation.builder.trigger"),subtitle:a(`automation.builder.${s==="timer"?"condTimer":s==="manual"?"condManual":s==="db_changed"?"condDb":s==="event_seen"?"condEvent":"condFile"}`),icon:e.jsx(De,{size:17}),ready:Pe&&!!$.trim()},...S.map((t,d)=>({id:String(t.key),title:`${d+1}. ${a(`automation.step.${t.type}`)}`,subtitle:t.title||t.prompt||t.dbPath||t.tool||a("automation.ux.setupHint"),icon:he(t.type),ready:!ze(t,s,f)})),...!S.length&&i&&s!=="manual"?[{id:"muse",title:a("automation.builder.museFallback"),subtitle:me||a("automation.builder.museFallbackHint"),icon:e.jsx(Te,{size:17}),ready:!0}]:[],{id:"review",title:a("automation.ux.finish"),subtitle:a(ne?"automation.ux.allReady":"automation.ux.finishHint"),icon:e.jsx(be,{size:17}),ready:ne}],Xe=e.jsxs(e.Fragment,{children:[e.jsxs(Dt,{label:a("automation.ux.addStep"),className:"btn ghost sm",disabled:Y||S.length>=24,items:["notify","agent_run","db_row_add","db_row_edit","tool_call"].map(t=>({id:t,label:a(`automation.step.${t}`),icon:he(t),disabled:t==="tool_call"&&!f.length,onSelect:()=>Ke(t)})),children:[e.jsx(Et,{size:14}),a("automation.ux.addStep")]}),e.jsx("button",{className:"icon-btn",title:a("automation.ux.help"),onClick:()=>x("help"),children:e.jsx(Lt,{size:15})})]});return e.jsxs("div",{className:`auto-builder auto-workflow-builder ${b?"auto-builder-embedded":""}`,children:[e.jsxs("div",{className:"auto-builder-title",children:[e.jsx(Fe,{size:17}),e.jsx("span",{children:a(i?"automation.builder.editTitle":"automation.builder.title")}),e.jsx("button",{className:"btn ghost sm",disabled:Y,onClick:()=>h?h():v.closeBuilder(),children:a("common.cancel")})]}),e.jsx("div",{className:"auto-builder-workspace",hidden:!j&&m,children:e.jsx(Yt,{nodes:Ge,selected:m?F:"",onSelect:x,children:Xe})}),e.jsxs(Ot,{controller:j,open:m,title:a("automation.ux.setup"),onClose:()=>P(!1),children:[!j&&e.jsxs("button",{className:"btn ghost sm auto-inline-back",onClick:()=>P(!1),children:[e.jsx(Pt,{size:14}),a("automation.ux.flow")]}),e.jsxs("div",{className:"auto-inspector","aria-label":a("automation.ux.setup"),children:[e.jsxs("div",{className:"auto-node",hidden:F!=="trigger",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:e.jsx(De,{size:14})}),a("automation.builder.trigger")]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.desc")}),e.jsx("input",{"aria-label":a("automation.builder.desc"),type:"text",value:$,maxLength:200,placeholder:a("automation.builder.descPh"),onChange:t=>I(t.target.value)})]}),!b&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.condType")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:s==="timer"?"active":"",onClick:()=>y("timer"),children:a("automation.builder.condTimer")}),e.jsx("button",{className:s==="event_seen"?"active":"",onClick:()=>y("event_seen"),children:a("automation.builder.condEvent")}),e.jsx("button",{className:s==="file_chars_gte"?"active":"",onClick:()=>y("file_chars_gte"),children:a("automation.builder.condFile")}),e.jsx("button",{className:s==="db_changed"?"active":"",onClick:()=>y("db_changed"),children:a("automation.builder.condDb")}),e.jsx("button",{className:s==="manual"?"active":"",onClick:()=>y("manual"),children:a("automation.builder.condManual")})]})]}),s==="db_changed"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbPath")}),e.jsxs("select",{value:R,onChange:t=>{Oe(t.target.value),ge([])},children:[e.jsx("option",{value:"",children:a("automation.builder.dbPickDb")}),ee.map(t=>e.jsx("option",{value:t,children:t},t)),R&&!ee.includes(R)&&e.jsx("option",{value:R,children:R})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbEvent")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:z==="row_added"?"active":"",onClick:()=>je("row_added"),children:a("automation.builder.dbEventRow")}),e.jsx("button",{className:z==="cell_changed"?"active":"",onClick:()=>je("cell_changed"),children:a("automation.builder.dbEventCell")})]})]}),z==="cell_changed"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbColumn")}),e.jsxs("div",{className:"auto-checks",children:[(U??[]).map(t=>e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:V.includes(t.id),onChange:d=>fe(t.id,d.target.checked)}),t.name]},t.id)),V.filter(t=>!(U??[]).some(d=>d.id===t)).map(t=>e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:!0,onChange:()=>fe(t,!1)}),"(",t,")"]},t)),!U&&e.jsx("span",{className:"auto-hint",children:a("automation.builder.dbColsLoading")})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbColumnsHint")})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbEquals")}),e.jsx("input",{type:"text",value:ue,maxLength:200,placeholder:a("automation.builder.dbEqualsPh"),onChange:t=>Be(t.target.value)})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbWhere")}),L.map((t,d)=>e.jsxs("div",{className:"auto-inline",children:[e.jsxs("select",{value:t.column,onChange:r=>ce(d,{column:r.target.value}),children:[e.jsx("option",{value:"",children:a(B?"automation.builder.dbPickCol":"automation.builder.dbColsLoading")}),(B??[]).map(r=>e.jsx("option",{value:r.id,children:r.name},r.id)),t.column&&!(B??[]).some(r=>r.id===t.column)&&e.jsxs("option",{value:t.column,children:["(",t.column,")"]})]}),e.jsx("select",{value:t.op,onChange:r=>ce(d,{op:r.target.value}),children:st.map(r=>e.jsx("option",{value:r,children:a(r==="eq"?"automation.builder.dbWhereOpEq":r==="ne"?"automation.builder.dbWhereOpNe":r==="empty"?"automation.builder.dbWhereOpEmpty":"automation.builder.dbWhereOpNotEmpty")},r))}),e.jsx("input",{type:"text",value:t.value,maxLength:200,disabled:t.op==="empty"||t.op==="notempty",placeholder:a("automation.builder.dbWhereValPh"),onChange:r=>ce(d,{value:r.target.value})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),onClick:()=>de(r=>r.filter((l,u)=>u!==d)),children:e.jsx(pe,{size:12})})]},d)),e.jsx("button",{className:"icon-btn",title:a("automation.builder.dbWhereAdd"),disabled:L.length>=Re,onClick:()=>de(t=>[...t,{column:"",op:"eq",value:""}]),children:"+"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbWhereHint")})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbHint")})]}),s==="manual"&&e.jsx("div",{className:"auto-hint",children:a("automation.builder.manualHint")}),s==="timer"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.timerMode")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:w==="daily_at"?"active":"",onClick:()=>q("daily_at"),children:a("automation.builder.timerDaily")}),e.jsx("button",{className:w==="at"?"active":"",onClick:()=>q("at"),children:a("automation.builder.timerOnce")}),e.jsx("button",{className:w==="every"?"active":"",onClick:()=>q("every"),children:a("automation.builder.timerEvery")})]})]}),w==="daily_at"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.time")}),e.jsx("input",{type:"time",value:H,onChange:t=>X(t.target.value)})]}),w==="at"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.datetime")}),e.jsx("input",{type:"datetime-local",value:Z,onChange:t=>Ae(t.target.value)}),e.jsx("div",{className:"auto-hint",children:a(W?"automation.builder.expiredReset":"automation.builder.onceHint")})]}),w==="every"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.interval")}),e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"number",value:Q,min:1,style:{width:90},onChange:t=>qe(t.target.value)}),e.jsxs("select",{value:ve,onChange:t=>He(t.target.value),children:[e.jsx("option",{value:"m",children:a("automation.builder.unitM")}),e.jsx("option",{value:"h",children:a("automation.builder.unitH")}),e.jsx("option",{value:"d",children:a("automation.builder.unitD")})]})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.everyHint")})]})]}),s==="event_seen"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.match")}),e.jsx("input",{type:"text",list:"auto-event-catalog",value:se,maxLength:120,placeholder:a("automation.builder.matchPh"),onChange:t=>Ve(t.target.value)}),e.jsxs("datalist",{id:"auto-event-catalog",children:[ot.map(t=>e.jsx("option",{value:t},t)),rt().map(t=>e.jsx("option",{value:t.name,label:t.label},t.name))]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.matchHint")})]}),s==="file_chars_gte"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.path")}),e.jsx("input",{type:"text",value:oe,placeholder:"~/Forsion/Notes/xxx.md",onChange:t=>We(t.target.value)})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.chars")}),e.jsx("input",{type:"number",value:re,min:1,onChange:t=>Le(t.target.value)})]})]})]}),S.map((t,d)=>{const r=t.type==="tool_call"?f.find(l=>l.name===t.tool):void 0;return e.jsxs("div",{className:"auto-node",hidden:F!==String(t.key),children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:he(t.type)}),a("automation.builder.stepN",{n:String(d+1)})," · ",a(`automation.step.${t.type}`),e.jsxs("span",{className:"auto-step-tools",children:[e.jsx("button",{className:"icon-btn",disabled:d===0,title:a("automation.builder.moveUp"),onClick:()=>Ee(d,-1),children:e.jsx(ut,{size:12})}),e.jsx("button",{className:"icon-btn",disabled:d===S.length-1,title:a("automation.builder.moveDown"),onClick:()=>Ee(d,1),children:e.jsx(dt,{size:12})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),onClick:()=>{te(l=>l.filter(u=>u.key!==t.key)),x("trigger")},children:e.jsx(pe,{size:12})})]})]}),t.type==="notify"&&e.jsxs(e.Fragment,{children:[e.jsx(Me,{label:a("automation.builder.notifyTitle"),value:t.title,maxLength:200,placeholder:a("automation.builder.notifyTitlePh"),onChange:l=>g(t.key,{title:l}),columns:U,hasRow:s==="db_changed"}),e.jsx(Me,{label:a("automation.builder.notifyBody"),value:t.body,multiline:!0,onChange:l=>g(t.key,{body:l}),columns:U,hasRow:s==="db_changed"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.notifyHint")})]}),t.type==="agent_run"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.runner")}),e.jsxs("select",{value:t.agentSlug,onChange:l=>g(t.key,{agentSlug:l.target.value}),children:[e.jsx("option",{value:"",children:a("automation.builder.runnerPick")}),k.filter(l=>l.slug!=="muse").map(l=>e.jsx("option",{value:l.slug,children:l.name},l.slug))]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.prompt")}),e.jsx("textarea",{value:t.prompt,maxLength:500,placeholder:a("automation.builder.promptPh"),onChange:l=>g(t.key,{prompt:l.target.value})})]})]}),(t.type==="db_row_add"||t.type==="db_row_edit")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbPath")}),e.jsxs("select",{value:t.dbPath,onChange:l=>g(t.key,{dbPath:l.target.value}),children:[e.jsx("option",{value:"",children:a("automation.builder.dbPickDb")}),ee.map(l=>e.jsx("option",{value:l,children:l},l)),t.dbPath&&!ee.includes(t.dbPath)&&e.jsx("option",{value:t.dbPath,children:t.dbPath})]})]}),t.type==="db_row_edit"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbRowId")}),e.jsx("input",{type:"text",value:t.rowId,placeholder:a(s==="db_changed"?"automation.builder.dbRowIdPh":"automation.builder.dbRowIdRequired"),onChange:l=>g(t.key,{rowId:l.target.value})})]}),t.type==="db_row_edit"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbRowFrom")}),e.jsx("input",{type:"text",value:t.rowFrom,maxLength:200,placeholder:a("automation.builder.dbRowFromPh"),onChange:l=>g(t.key,{rowFrom:l.target.value})})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbMatch")}),e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"text",value:t.matchColumn,maxLength:200,placeholder:a("automation.builder.dbCellKey"),style:{width:120},onChange:l=>g(t.key,{matchColumn:l.target.value})}),e.jsx("input",{type:"text",value:t.matchValue,maxLength:2e3,placeholder:a("automation.builder.dbMatchValPh"),onChange:l=>g(t.key,{matchValue:l.target.value})})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbTargetHint")})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbCells")}),t.cells.map((l,u)=>e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"text",value:l.k,placeholder:a("automation.builder.dbCellKey"),style:{width:120},onChange:M=>g(t.key,{cells:t.cells.map((N,T)=>T===u?{...N,k:M.target.value}:N)})}),e.jsx("input",{type:"text",value:l.v,placeholder:a(u===0?"automation.builder.dbCellValPh":"automation.builder.dbCellVal"),onChange:M=>g(t.key,{cells:t.cells.map((N,T)=>T===u?{...N,v:M.target.value}:N)})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),disabled:t.cells.length<=1,onClick:()=>g(t.key,{cells:t.cells.filter((M,N)=>N!==u)}),children:e.jsx(pe,{size:12})})]},u)),e.jsx("button",{className:"icon-btn",title:a("automation.builder.dbCellAdd"),onClick:()=>g(t.key,{cells:[...t.cells,{k:"",v:""}]}),children:"+"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbCellsHint")})]}),t.type==="db_row_add"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbSkipIfEmpty")}),e.jsx("input",{type:"text",value:t.skipIfEmpty,maxLength:200,placeholder:a("automation.builder.dbSkipIfEmptyPh"),onChange:l=>g(t.key,{skipIfEmpty:l.target.value})})]})]}),t.type==="tool_call"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.tool")}),e.jsxs("select",{value:t.tool,onChange:l=>{const u=f.find(N=>N.name===l.target.value),M=Object.fromEntries((u?.parameters.required||[]).filter(N=>u?.parameters.properties?.[N]?.type==="boolean").map(N=>[N,"false"]));g(t.key,{tool:l.target.value,argValues:M})},children:[e.jsx("option",{value:"",children:a("automation.builder.toolPick")}),f.map(l=>e.jsxs("option",{value:l.name,children:[l.name,l.dangerous?" ⚠":""]},l.name))]}),r&&e.jsxs("div",{className:"auto-hint",children:[r.description,r.dangerous?` · ${a("automation.builder.dangerous")}`:""]})]}),r&&Object.entries(r.parameters.properties||{}).map(([l,u])=>{const M=(r.parameters.required||[]).includes(l),N=`${l}${M?" *":""}`,T=t.argValues[l]||"",G=_=>g(t.key,{argValues:{...t.argValues,[l]:_}});return e.jsxs("div",{className:"field",children:[e.jsx("label",{title:u.description||"",children:N}),u.enum?.length?e.jsxs("select",{value:T,onChange:_=>G(_.target.value),children:[e.jsx("option",{value:""}),u.enum.map(_=>e.jsx("option",{value:_,children:_},_))]}):u.type==="boolean"?e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:T==="true",onChange:_=>G(_.target.checked?"true":"false")})," ",u.description||""]}):u.type==="number"?e.jsx("input",{type:"number",value:T,onChange:_=>G(_.target.value)}):u.type==="string"?e.jsx("textarea",{rows:2,value:T,placeholder:u.description||"",onChange:_=>G(_.target.value)}):e.jsx("textarea",{rows:2,value:T,placeholder:`JSON — ${u.description||""}`,onChange:_=>G(_.target.value)})]},l)})]})]},t.key)}),S.length===0&&i&&s!=="manual"&&e.jsxs("div",{className:"auto-node auto-node-muse",hidden:F!=="muse",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:e.jsx(Te,{size:14})}),a("automation.builder.museFallback")]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.museFallbackHint")}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.prompt")}),e.jsx("textarea",{value:me,maxLength:500,placeholder:a("automation.builder.promptPh"),onChange:t=>Ue(t.target.value)})]})]}),e.jsxs("div",{className:"auto-node auto-review",hidden:F!=="review",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx(be,{size:16}),a("automation.ux.review")]}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.enableHint")}),e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:D,onChange:t=>A(t.target.checked)}),a("automation.ux.enabledLabel")]}),E.length?e.jsxs("div",{className:"auto-validation",role:"status",children:[e.jsx("strong",{children:a("automation.ux.checklist")}),E.map((t,d)=>e.jsx("button",{onClick:()=>x(t.node),children:t.text},d))]}):e.jsxs("p",{className:"auto-ready",children:[e.jsx(be,{size:14}),a("automation.ux.allReady")]}),s!=="timer"&&s!=="manual"&&e.jsxs("div",{className:"auto-guard",children:[e.jsx("label",{children:a("automation.builder.cooldown")}),e.jsx("input",{type:"number",value:K,min:Se?1:s==="db_changed"?0:.25,step:"1",onChange:t=>{Ce.current=!0,_e(t.target.value)}}),e.jsx("span",{className:"auto-hint",children:a(Se?"automation.builder.cooldownAgentHint":s==="db_changed"?"automation.builder.cooldownDbHint":"automation.builder.cooldownHint")})]})]}),e.jsxs("div",{className:"auto-node",hidden:F!=="help",children:[e.jsx("h3",{children:a("automation.ux.flow")}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.canvasOrder")}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.nativeHint")})]})]})]}),e.jsxs("div",{className:"auto-builder-actions auto-builder-footer",children:[e.jsx("div",{className:"auto-save-status","aria-live":"polite",children:we?e.jsx("span",{role:"alert",children:we}):E.length?e.jsxs("button",{onClick:()=>x(E[0].node),children:[E[0].text,E.length>1?` (+${E.length-1})`:""]}):e.jsx("span",{children:a("automation.ux.allReady")})}),e.jsx("button",{className:"btn ghost sm",onClick:()=>x("review"),children:a("automation.ux.review")}),e.jsx("button",{className:"btn sm",disabled:!ne||Y,onClick:()=>{Ye()},children:Y?"…":a(D?"automation.ux.saveEnabled":"automation.ux.savePaused")})]})]})},ra=Object.freeze(Object.defineProperty({__proto__:null,AutomationBuilder:Xt,hasUnsupportedParts:Ie},Symbol.toStringTag,{value:"Module"}));export{Ot as A,Lt as C,oa as S,Xt as a,ra as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,u as H,r as m,a as ea}from"./index-fDB1l4d-.js";import{l as sa,aH as na,aA as ta,u as ca,a6 as la,X as G,D as V}from"./pageStore-CyvNZEYX.js";import"./client-fKy9CWk0.js";import{A as oa}from"./astryxBridge-BL56QfEv.js";import{qA as ra,eT as _,qB as ia,qi as da,qp as ma,q_ as ua,qj as E,qM as ha,qy as fa,qD as ga,qk as pa,qr as xa,qs as ba,qt as ja,q$ as v,ql as y,qm as va,qo as Na,qH as Ca,G as wa,f9 as F,eH as Da,r0 as W,r1 as ya,r2 as U,r3 as Ma,r4 as ka,l0 as za,S as Sa}from"./appStore-DDOkzWDA.js";import{u as qa}from"./dbStore-BIG5Mfh2.js";import{u as I}from"./calendarNavStore-DCi7VBmM.js";import{U as Aa}from"./upload-Dy7svciS.js";import"./react-b7FrqRQR.js";import"./ipc-SAPDwyQ4.js";import"./nativeDownload-DsGyUSJ5.js";import"./drawingStore-CGvTqqYW.js";ea({"calcfg.prevMonth":{zh:"上个月",en:"Previous month"},"calcfg.nextMonth":{zh:"下个月",en:"Next month"},"calcfg.jumpToDay":{zh:"跳转到这一天",en:"Jump to this day"},"calcfg.title":{zh:"日历",en:"Calendars"},"calcfg.empty":{zh:"还没有加入日历的多维表。",en:"No databases added to the calendar yet."},"calcfg.eventColor":{zh:"事件颜色",en:"Event color"},"calcfg.fetchFailed":{zh:"拉取失败",en:"Fetch failed"},"calcfg.default":{zh:"默认",en:"Default"},"calcfg.defaultHint":{zh:"新建的事件落在这里",en:"New events go here"},"calcfg.showName":{zh:"在日历中显示「{name}」",en:"Show “{name}” in the calendar"},"calcfg.srcAgent":{zh:"Agent 日程(只读)",en:"Agent schedule (read-only)"},"calcfg.srcOther":{zh:"{side} 的日历(只读)",en:"Calendar from {side} (read-only)"},"calcfg.srcIcs":{zh:"外部日历(只读)",en:"External calendar (read-only)"},"calcfg.more":{zh:"更多",en:"More"},"calcfg.addCalendar":{zh:"添加日历",en:"Add calendar"},"calcfg.addDatabase":{zh:"添加多维表",en:"Add database"},"calcfg.subscribeExternal":{zh:"订阅外部日历",en:"Subscribe to external calendar"},"calcfg.subscribeHint":{zh:"粘贴 .ics 订阅地址(Google / Outlook / Apple 日历「密钥地址」都行)",en:"Paste an .ics subscription URL (Google, Outlook, or Apple Calendar's private address all work)"},"calcfg.importIcs":{zh:"导入 .ics 文件",en:"Import .ics file"},"calcfg.fileTooLarge":{zh:"文件过大(> {mb}MB)",en:"File too large (over {mb} MB)"},"calcfg.notIcs":{zh:"这不是一个 .ics 日历文件",en:"That isn't an .ics calendar file"},"calcfg.readFailed":{zh:"读取失败:{msg}",en:"Failed to read: {msg}"},"calcfg.renameCalendar":{zh:"重命名日历",en:"Rename calendar"},"calcfg.renameSub":{zh:"重命名订阅",en:"Rename subscription"},"calcfg.rename":{zh:"重命名",en:"Rename"},"calcfg.refreshNow":{zh:"立即刷新",en:"Refresh now"},"calcfg.unsubscribe":{zh:"取消订阅",en:"Unsubscribe"},"calcfg.setDefaultDb":{zh:"设为默认日历",en:"Set as default calendar"},"calcfg.openInNewTab":{zh:"在新标签打开",en:"Open in new tab"},"calcfg.columnMapping":{zh:"日期与完成列…",en:"Date and done columns…"},"calcfg.removeFromCalendar":{zh:"从日历移除",en:"Remove from calendar"},"calcfg.searchDbPlaceholder":{zh:"搜索要加入日历的多维表…",en:"Search databases to add to the calendar…"},"calcfg.noCandidates":{zh:"没有含日期属性的可添加多维表",en:"No databases with a date property available to add"},"calcfg.footHint":{zh:"只有含「日期」属性的多维表会出现在这里",en:"Only databases with a Date property appear here"}});function Wa(){return e.jsx(oa,{children:e.jsxs("div",{className:"amx-calside",children:[e.jsx(Ea,{}),e.jsx(Pa,{})]})})}const T=s=>new Date(s.getFullYear(),s.getMonth(),1);function Ea(){const{t:s}=H(),o=sa(n=>(n.mainTabs,((n.api?na(n.api):null)?.params??{}).__type==="calendar")),f=I(n=>n.visibleStart),g=I(n=>n.visibleEnd),N=I(n=>n.requestJump),x=m.useMemo(()=>ra(new Date),[]),[u,d]=m.useState(()=>T(x));m.useEffect(()=>{if(o&&f&&g){const n=_(f),i=ia(n,Math.floor(da(_(g),n)/2));d(T(i))}},[o,f,g]);const C=ma(),p=m.useMemo(()=>ua(u),[u,C]),w=E(x,!0),c=n=>{if(!o||!f||!g)return!1;const i=E(n,!0);return i>=f&&i<=g},M=n=>{d(T(n)),o&&N(E(n,!0))};return e.jsxs("div",{className:"amx-mini",children:[e.jsxs("div",{className:"amx-mini-head",children:[e.jsx("span",{className:"amx-mini-title",children:ha(u)}),e.jsx("button",{className:"amx-mini-nav",onClick:()=>d(new Date(u.getFullYear(),u.getMonth()-1,1)),"aria-label":s("calcfg.prevMonth"),children:e.jsx(fa,{size:14})}),e.jsx("button",{className:"amx-mini-nav",onClick:()=>d(new Date(u.getFullYear(),u.getMonth()+1,1)),"aria-label":s("calcfg.nextMonth"),children:e.jsx(ta,{size:14})})]}),e.jsx("div",{className:"amx-mini-dow",children:ga().map(n=>e.jsx("span",{children:n},n))}),e.jsx("div",{className:"amx-mini-grid",children:p.map((n,i)=>{const j=n.getMonth()!==u.getMonth(),b=E(n,!0)===w,k=c(n),D=k?`${i%7===0||!c(p[i-1])?" band-start":""}${i%7===6||!p[i+1]||!c(p[i+1])?" band-end":""}`:"";return e.jsx("button",{className:`amx-mini-day${j?" out":""}${b?" today":""}${k?" band":""}${D}`,onClick:()=>M(n),title:o?s("calcfg.jumpToDay"):void 0,children:n.getDate()},+n)})})]})}function Pa(){const{t:s}=H(),o=ca(a=>a.vaultRoot)??"",f=pa(),g=xa(),N=ba(),x=ja(),u=v(a=>a.errors),d=y(a=>a.byVault),C=y(a=>a.setColor),p=y(a=>a.toggleHidden),w=y(a=>a.setDefault),c=y(a=>a.addMember),M=y(a=>a.removeMember),[n,i]=m.useState(!1),[j,b]=m.useState(null),[k,D]=m.useState(null),[t,h]=m.useState(null),[z,q]=m.useState(null);m.useEffect(()=>{if(!t&&!j)return;const a=l=>{l.key==="Escape"&&(l.stopPropagation(),h(null),b(null))};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[t,j]);const Y=m.useMemo(()=>new Set(f.map(a=>a.db.path)),[f]),L=[...f.map(a=>({db:a.db})),...g.map(a=>({db:a,readonly:!0,kind:"agent"})),...N.map(a=>({db:a,readonly:!0,kind:"other"})),...x.map(a=>({db:a,readonly:!0,kind:"ics"}))],O=va(o,d),J=a=>{h(null),F(s("calcfg.renameCalendar"),a.name).then(l=>{const r=l?.trim();r&&r!==a.name&&qa.getState().mutate(a.path,A=>({...A,name:r}))})},S=a=>a.slice(6),R=a=>u[S(a)],X=()=>{F(s("calcfg.subscribeExternal"),"",{label:s("calcfg.subscribeHint")}).then(a=>{const l=a?.trim();l&&v.getState().add(l)})},K=()=>{const a=document.createElement("input");a.type="file",a.accept=".ics,text/calendar",a.onchange=()=>{const l=a.files?.[0];if(l){if(l.size>U){D(s("calcfg.fileTooLarge",{mb:U/1024/1024}));return}D(null),l.text().then(r=>{v.getState().importText(Ma(r)||l.name.replace(/\.ics$/i,""),r)||D(s("calcfg.notIcs"))}).catch(r=>D(s("calcfg.readFailed",{msg:r?.message||String(r)})))}},a.click()},Q=a=>{const l=a.currentTarget.getBoundingClientRect();b({x:Math.max(12,Math.min(l.left,window.innerWidth-200)),y:l.bottom+4})};return e.jsxs("div",{className:"amx-calcfg",children:[e.jsxs("div",{className:"amx-calcfg-head",children:[e.jsx("span",{children:s("calcfg.title")}),e.jsx("button",{className:"amx-calcfg-addbtn","aria-label":s("calcfg.addCalendar"),title:s("calcfg.addCalendar"),onClick:Q,children:e.jsx(la,{size:14})})]}),L.length===0&&e.jsx("div",{className:"amx-calcfg-empty",children:s("calcfg.empty")}),e.jsx("div",{className:"amx-calcfg-list",children:L.map(({db:a,readonly:l,kind:r},A)=>{const $=Na(o,d,a.path,A),P=!Ca(o,d,a.path),Z=!l&&(O?O===a.path:A===0);return e.jsxs("div",{className:"amx-calcfg-row",children:[e.jsx("button",{className:`amx-calcfg-swatch${P?" on":""}`,style:{"--amx-swatch":$},role:"checkbox","aria-checked":P,"aria-label":s("calcfg.showName",{name:a.name}),onClick:()=>p(o,a.path)}),e.jsxs("span",{className:`amx-calcfg-name${P?"":" off"}`,title:R(a.path)||a.name,children:[a.name,r==="ics"&&R(a.path)&&e.jsxs("span",{className:"amx-calcfg-err",children:[" · ",s("calcfg.fetchFailed")]})]}),Z&&e.jsx("span",{className:"amx-calcfg-default",title:s("calcfg.defaultHint"),children:s("calcfg.default")}),e.jsx("button",{className:"amx-calcfg-more",title:s("calcfg.more"),"aria-label":s("calcfg.more"),onClick:aa=>{const B=aa.currentTarget.getBoundingClientRect();h({db:a,kind:r,color:$,x:Math.min(B.left,window.innerWidth-200),y:B.bottom+4})},children:"⋯"})]},a.path)})}),k&&e.jsx("div",{className:"amx-calcfg-hint",style:{color:"var(--danger)"},children:k}),j&&e.jsx("div",{className:"amx-db-popwrap",onMouseDown:()=>b(null),children:e.jsxs(G,{className:"amx-db-pop amx-calcfg-addmenu",x:j.x,y:j.y,onMouseDown:a=>a.stopPropagation(),children:[e.jsxs("button",{className:"amx-db-opt",onClick:()=>{b(null),i(!0)},children:[e.jsx(V,{size:14})," ",s("calcfg.addDatabase")]}),e.jsxs("button",{className:"amx-db-opt",onClick:()=>{b(null),X()},children:[e.jsx(wa,{size:14})," ",s("calcfg.subscribeExternal")]}),e.jsxs("button",{className:"amx-db-opt",onClick:()=>{b(null),K()},children:[e.jsx(Aa,{size:14})," ",s("calcfg.importIcs")]})]})}),t&&e.jsx("div",{className:"amx-db-popwrap",onMouseDown:()=>h(null),children:e.jsxs(G,{className:"amx-db-pop amx-calcfg-menu",x:t.x,y:t.y,onMouseDown:a=>a.stopPropagation(),children:[t.kind&&e.jsx("div",{className:"amx-calcfg-menusrc",children:t.kind==="agent"?s("calcfg.srcAgent"):t.kind==="other"?s("calcfg.srcOther",{side:t.db.vaultLabel||""}):s("calcfg.srcIcs")}),e.jsxs("label",{className:"amx-db-opt amx-calcfg-colorrow",children:[e.jsx("span",{className:"amx-calcfg-colordot",style:{background:t.color}}),s("calcfg.eventColor"),e.jsx("input",{type:"color",value:t.color,onChange:a=>{C(o,t.db.path,a.target.value),h({...t,color:a.target.value})}})]}),t.kind==="agent"||t.kind==="other"?null:t.kind==="ics"?e.jsxs(e.Fragment,{children:[!!v.getState().subs.find(a=>a.id===S(t.db.path))?.url&&e.jsx("button",{className:"amx-db-opt",onClick:()=>{v.getState().refresh(S(t.db.path)),h(null)},children:s("calcfg.refreshNow")}),e.jsx("button",{className:"amx-db-opt",onClick:()=>{const a=S(t.db.path),l=t.db.name;h(null),F(s("calcfg.renameSub"),l).then(r=>{r?.trim()&&v.getState().rename(a,r.trim())})},children:s("calcfg.rename")}),e.jsx("button",{className:"amx-db-opt amx-db-opt-danger",onClick:()=>{v.getState().remove(S(t.db.path)),h(null)},children:s("calcfg.unsubscribe")})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"amx-db-opt",onClick:()=>J(t.db),children:s("calcfg.rename")}),e.jsx("button",{className:"amx-db-opt",onClick:()=>{w(o,t.db.path),h(null)},children:s("calcfg.setDefaultDb")}),e.jsx("button",{className:"amx-db-opt",onClick:()=>{Da(t.db.path),h(null)},children:s("calcfg.openInNewTab")}),e.jsx("button",{className:"amx-db-opt",onClick:()=>{q(t.db),h(null)},children:s("calcfg.columnMapping")}),e.jsx("button",{className:"amx-db-opt amx-db-opt-danger",onClick:()=>{M(o,t.db.path),h(null)},children:s("calcfg.removeFromCalendar")})]})]})}),n&&e.jsx(Fa,{memberPaths:Y,onClose:()=>i(!1),onAdd:(a,l,r)=>{c(o,a.path,l,r),i(!1)}}),z&&e.jsx("div",{className:"amx-db-popwrap",onMouseDown:()=>q(null),children:e.jsx("div",{className:"amx-db-pop amx-calpick-pop",onMouseDown:a=>a.stopPropagation(),children:e.jsx(W,{dbName:z.name,columns:z.columns,initial:ya(o,d,z.path),onCancel:()=>q(null),onConfirm:(a,l)=>{c(o,z.path,a,l),q(null)}})})})]})}function Fa({memberPaths:s,onClose:o,onAdd:f}){const{t:g}=H(),N=ka(),[x,u]=m.useState(""),[d,C]=m.useState(null),p=m.useMemo(()=>N.filter(c=>!s.has(c.path)&&c.columns.some(za)),[N,s]),w=x?p.filter(c=>c.name.toLowerCase().includes(x.toLowerCase())):p;return e.jsx("div",{className:"amx-qf-scrim",onMouseDown:o,children:d?e.jsx("div",{className:"amx-qf-card",onMouseDown:c=>c.stopPropagation(),children:e.jsx(W,{dbName:d.name,columns:d.columns,onCancel:()=>C(null),onConfirm:(c,M)=>f(d,c,M)})}):e.jsxs("div",{className:"amx-qf",onMouseDown:c=>c.stopPropagation(),children:[e.jsxs("div",{className:"amx-qf-head",children:[e.jsx(Sa,{size:16,className:"amx-qf-searchicon"}),e.jsx("input",{autoFocus:!0,className:"amx-qf-input",placeholder:g("calcfg.searchDbPlaceholder"),value:x,onChange:c=>u(c.target.value)})]}),e.jsxs("div",{className:"amx-qf-list",children:[w.map(c=>e.jsxs("button",{className:"amx-qf-row",onClick:()=>C(c),children:[e.jsx("span",{className:"amx-qf-icon",children:e.jsx(V,{size:15})}),e.jsx("span",{className:"amx-qf-title",children:c.name||c.path}),e.jsx("span",{className:"amx-qf-sub",children:c.path.replace(/\\/g,"/").split("/").slice(0,-1).join("/")||"/"})]},c.path)),w.length===0&&e.jsx("div",{className:"amx-qf-empty",children:g("calcfg.noCandidates")})]}),e.jsx("div",{className:"amx-qf-foot",children:g("calcfg.footHint")})]})})}export{Wa as CalendarConfigView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,j as i}from"./index-fDB1l4d-.js";import{TodoListView as s}from"./TodoListView-BkgMe44I.js";import{u as o}from"./calendarNavStore-DCi7VBmM.js";import"./astryxBridge-BL56QfEv.js";import"./appStore-DDOkzWDA.js";import"./react-b7FrqRQR.js";import"./pageStore-CyvNZEYX.js";import"./client-fKy9CWk0.js";import"./ipc-SAPDwyQ4.js";import"./nativeDownload-DsGyUSJ5.js";import"./dbStore-BIG5Mfh2.js";import"./drawingStore-CGvTqqYW.js";import"./draft-CBSW5tHx.js";import"./EventCard-QyYorE1_.js";import"./chevron-up-ChXNh14u.js";import"./Tooltip-DOYi44eY.js";function g(){const r=o(m=>m.setSideEl),t=e.useRef(null);return e.useEffect(()=>(r(t.current),()=>{o.getState().sideEl===t.current&&r(null)}),[r]),i.jsx("div",{className:"amx-calside2",ref:t,children:i.jsx(s,{params:{side:!0}})})}export{g as CalendarSide};
|