@pi-chamber/web 1.0.5 → 1.0.6-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{DiagramView-CrKjR8CR.js → DiagramView-DUxXEKjQ.js} +1 -1
- package/dist/assets/DiffView-DEd3rdnu.js +18 -0
- package/dist/assets/FileSaveConflictDialog-C6o4fYIn.js +3 -0
- package/dist/assets/{FilesView-BRR3N7UA.js → FilesView-Ccl4CxjR.js} +3 -3
- package/dist/assets/{GitHubDetailScaffold-C1UHuETI.js → GitHubDetailScaffold-DlgVm5uD.js} +3 -3
- package/dist/assets/{GitHubLinkPicker-B0O3Vapu.js → GitHubLinkPicker-BgDZR-3K.js} +1 -1
- package/dist/assets/{GitHubListPrimitives-DvQDU--z.js → GitHubListPrimitives-BTeI3B3C.js} +1 -1
- package/dist/assets/{GitView-wAscrRhO.js → GitView-BkrH0HFQ.js} +4 -4
- package/dist/assets/{IssuesSurface-mh50UUQ8.js → IssuesSurface-CD1m8BHP.js} +3 -3
- package/dist/assets/{JsonTreeView-BfErTllU.js → JsonTreeView-RLgBKik9.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-SXAK4uOu.js → MarkdownRendererImpl-BkfhE9NN.js} +2 -2
- package/dist/assets/{PatchDiff-CHr79sJ6.js → PatchDiff-BLNLrGYa.js} +1 -1
- package/dist/assets/{PierreDiffViewer-CGpKcLro.js → PierreDiffViewer-iLnLAFeL.js} +3 -3
- package/dist/assets/PullRequestsSurface-_kgJMFTh.js +2 -0
- package/dist/assets/{SessionSwitcherContent-DEAw6v12.js → SessionSwitcherContent-BCOUKRch.js} +1 -1
- package/dist/assets/SessionSwitcherDropdown-CA64t2xd.js +2 -0
- package/dist/assets/SessionUnreadDot-BZy2DM6H.js +1 -0
- package/dist/assets/SettingsView-TwUy1kXV.js +6 -0
- package/dist/assets/{SettingsWindow-BiY5FmhZ.js → SettingsWindow-BXE4JP-T.js} +1 -1
- package/dist/assets/{StickyHorizontalScrollbar-BMITjK4e.js → StickyHorizontalScrollbar-p7EbL2-E.js} +2 -2
- package/dist/assets/{ToolOutputDialog-B3RRLhR3.js → ToolOutputDialog-tiXT-Xts.js} +4 -4
- package/dist/assets/{ToolPartDiffPreview-D9m_vrht.js → ToolPartDiffPreview-CylbiIKd.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-B8lhZGLu.js → VirtualizedFileDiff-Cccy1L8L.js} +4 -4
- package/dist/assets/{Virtualizer-DP6HbEeC.js → Virtualizer-DNJrJKVb.js} +1 -1
- package/dist/assets/{appThemeRegistry-gegrE2dq.js → appThemeRegistry-Ca8eGRB9.js} +1 -1
- package/dist/assets/{collapsible-9MJx4VhA.js → collapsible-0yfy07W2.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-Bjhk2CQS.js → computeVirtualFileMetrics-ydVGT2RY.js} +2 -2
- package/dist/assets/{contextFileOpenGuard-CsF5Boky.js → contextFileOpenGuard--7BLkncT.js} +1 -1
- package/dist/assets/{document-attachments-BslE4Ns7.js → document-attachments-CZl9rK1z.js} +5 -5
- package/dist/assets/{gitStatusPredicates-B3Zxud6E.js → gitStatusPredicates-BzR54iPh.js} +1 -1
- package/dist/assets/{githubLink-CbGYxsIq.js → githubLink-WO5BkC0U.js} +5 -5
- package/dist/assets/{index-D4n3TVp2.js → index-C2ISrmRR.js} +10 -10
- package/dist/assets/index-DgwThEwf.css +1 -0
- package/dist/assets/index-nOAE6UDy.js +1 -0
- package/dist/assets/{lua-BgMRiT3U.js → lua-VAEuO923.js} +1 -1
- package/dist/assets/main-B4UP1bOp.js +2 -0
- package/dist/assets/main-DxYfmK5D.js +137 -0
- package/dist/assets/{markdown-shiki.worker-DnvH1S1x.js → markdown-shiki.worker-BVA5NZBT.js} +5 -5
- package/dist/assets/markdownCore-DIn2dwA6.js +2 -0
- package/dist/assets/miniChat-CMGH4R_p.js +2 -0
- package/dist/assets/mobile-BJz0lBjK.js +2 -0
- package/dist/assets/{nativeFileSave-BJsGPh58.js → nativeFileSave-Bhafll_7.js} +1 -1
- package/dist/assets/nsis-LY0VT_u5.js +1 -0
- package/dist/assets/permissionStore-zIpxq9Pq.js +1 -0
- package/dist/assets/pi-session-focus-preference-D6vrJGbH.js +9 -0
- package/dist/assets/{registerCustomTheme-DmolaWWZ.js → registerCustomTheme-C-h6lsYW.js} +1 -1
- package/dist/assets/{renderDiffWithHighlighter-BhMEWmHn.js → renderDiffWithHighlighter-JwKOWdBN.js} +1 -1
- package/dist/assets/renderElectronMiniChatApp-DYdkuv5N.js +2 -0
- package/dist/assets/{renderFileWithHighlighter-DUGluXlw.js → renderFileWithHighlighter-RJTrDxFH.js} +1 -1
- package/dist/assets/renderMobileApp-x1P9U65-.js +11 -0
- package/dist/assets/ruby-BK5aLJev.js +1 -0
- package/dist/assets/runtimeEndpointReset-OqTh3bbO.js +62 -0
- package/dist/assets/runtimeSurface-CJN1oo_1.js +1 -0
- package/dist/assets/themeResolver-DrfmQi8i.js +1 -0
- package/dist/assets/useAppFontEffects-CHnpTOtc.js +215 -0
- package/dist/assets/useFilesViewSearch-DeVixiGZ.js +7 -0
- package/dist/assets/{useGitHubRemoteSearch-DYoLQ4ro.js → useGitHubRemoteSearch-GjQca1iD.js} +1 -1
- package/dist/assets/{useSwitcherItems-BS6E199F.js → useSwitcherItems-DYtnl0T2.js} +1 -1
- package/dist/assets/vendor-aparajita-capacitor-secure-storage-BLsm9T1Y.js +1 -0
- package/dist/assets/vendor-base-ui-C7vVMZTg.js +1 -0
- package/dist/assets/{vendor-beautiful-mermaid-DApbjBp2.js → vendor-beautiful-mermaid-b48gT2g0.js} +1 -1
- package/dist/assets/vendor-boot-CoTxysn6.js +65 -0
- package/dist/assets/{vendor-capacitor-app-BaupizkW.js → vendor-capacitor-app-NX6DULfp.js} +1 -1
- package/dist/assets/{vendor-capacitor-keyboard-9BVxykO7.js → vendor-capacitor-keyboard-DJD81I9f.js} +1 -1
- package/dist/assets/{vendor-capacitor-status-bar-BsrUwiaA.js → vendor-capacitor-status-bar-DV24OoQV.js} +1 -1
- package/dist/assets/vendor-codemirror-autocomplete-qsuH4Dh-.js +1 -0
- package/dist/assets/vendor-codemirror-lang-angular-ZHWyBf7j.js +1 -0
- package/dist/assets/vendor-codemirror-lang-cpp-pCTOmv-k.js +1 -0
- package/dist/assets/vendor-codemirror-lang-css-2bFuyM70.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-go-Crwca_X7.js → vendor-codemirror-lang-go-DrG_c7D7.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-html-BV8lrR8v.js +1 -0
- package/dist/assets/vendor-codemirror-lang-java-DrsvH6T2.js +1 -0
- package/dist/assets/vendor-codemirror-lang-javascript-Dkzl3s07.js +13 -0
- package/dist/assets/vendor-codemirror-lang-jinja-8Nn3bnoP.js +1 -0
- package/dist/assets/vendor-codemirror-lang-json-CsdmtHhi.js +1 -0
- package/dist/assets/vendor-codemirror-lang-less-DJuZ4cZe.js +1 -0
- package/dist/assets/vendor-codemirror-lang-liquid-D2RO-Pzr.js +1 -0
- package/dist/assets/vendor-codemirror-lang-markdown-C0Zu3b3n.js +1 -0
- package/dist/assets/vendor-codemirror-lang-php-CuDtt2Zj.js +1 -0
- package/dist/assets/vendor-codemirror-lang-python-Cv2exx_M.js +3 -0
- package/dist/assets/vendor-codemirror-lang-rust-C4TxJ6Rg.js +1 -0
- package/dist/assets/vendor-codemirror-lang-sass-BmtPz8kf.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-sql-B0f-qCZo.js → vendor-codemirror-lang-sql-BF1ZaXqJ.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-vue-DZgXrP2k.js +1 -0
- package/dist/assets/vendor-codemirror-lang-wast-DsnaGtL_.js +1 -0
- package/dist/assets/vendor-codemirror-lang-xml-D8DzzFat.js +1 -0
- package/dist/assets/vendor-codemirror-lang-yaml-D5hBv7m6.js +1 -0
- package/dist/assets/{vendor-codemirror-language-data-CqU7kHmg.js → vendor-codemirror-language-data-vn2RyN9T.js} +2 -2
- package/dist/assets/vendor-codemirror-search-BVCYIV0D.js +2 -0
- package/dist/assets/vendor-dompurify-BGCr_sdL.js +3 -0
- package/dist/assets/vendor-elkjs-D1S1RCAO.js +24 -0
- package/dist/assets/vendor-fuse.js-t_7AcMTv.js +1 -0
- package/dist/assets/{vendor-hast-util-to-html-BKBhbTDb.js → vendor-hast-util-to-html-O3stl53j.js} +1 -1
- package/dist/assets/{vendor-heic2any-pq-UTQQR.js → vendor-heic2any-sztndhZI.js} +1 -1
- package/dist/assets/vendor-lezer-cpp-vqXSn3lv.js +1 -0
- package/dist/assets/vendor-lezer-css-JnEzSyZR.js +1 -0
- package/dist/assets/{vendor-lezer-go-CHIhCNY6.js → vendor-lezer-go-dD2gQMIL.js} +1 -1
- package/dist/assets/{vendor-lezer-html-B3h0MOrG.js → vendor-lezer-html-Cr3U-1pu.js} +1 -1
- package/dist/assets/vendor-lezer-java-CRM0IMCo.js +1 -0
- package/dist/assets/vendor-lezer-javascript-B3s21DIS.js +1 -0
- package/dist/assets/{vendor-lezer-json-BP_UAzLL.js → vendor-lezer-json-DPFM6EBV.js} +1 -1
- package/dist/assets/vendor-lezer-lr-Bllrq8hY.js +1 -0
- package/dist/assets/vendor-lezer-markdown-6-3PLvXG.js +6 -0
- package/dist/assets/vendor-lezer-php-DOyzfHRl.js +1 -0
- package/dist/assets/{vendor-lezer-python-EJ4Im4y2.js → vendor-lezer-python-CdHdN5qt.js} +1 -1
- package/dist/assets/vendor-lezer-rust-CqnW8EMH.js +1 -0
- package/dist/assets/{vendor-lezer-sass-CMi6zfXI.js → vendor-lezer-sass-BbcF4y6A.js} +1 -1
- package/dist/assets/{vendor-lezer-xml-0MHMeZDp.js → vendor-lezer-xml-C31AyWoo.js} +1 -1
- package/dist/assets/{vendor-lezer-yaml-BE2EFjpA.js → vendor-lezer-yaml-Cv908yC2.js} +1 -1
- package/dist/assets/{vendor-lru_map-DOPmc7GU.js → vendor-lru_map-BbiDqlyL.js} +1 -1
- package/dist/assets/vendor-marked-Be78pDn1.js +59 -0
- package/dist/assets/{vendor-oniguruma-parser-C0D4_9rT.js → vendor-oniguruma-parser-BrbMHgHx.js} +1 -1
- package/dist/assets/vendor-oniguruma-to-es-DgwFOwdE.js +94 -0
- package/dist/assets/{vendor-pierre-theming-Dgp7B_O4.js → vendor-pierre-theming-BO6EPniU.js} +1 -1
- package/dist/assets/vendor-property-information-C40bX6nM.js +1 -0
- package/dist/assets/{vendor-qrcode-Dv4uniC1.js → vendor-qrcode-gzL9QFkg.js} +5 -5
- package/dist/assets/vendor-react-Bz1tRBxM.js +1 -0
- package/dist/assets/{vendor-react-drawio-Duu5LgQA.js → vendor-react-drawio-IYnLUY5N.js} +1 -1
- package/dist/assets/vendor-remend-DcBOpbSu.js +24 -0
- package/dist/assets/vendor-replit-codemirror-vim-Cwhyn_5f.js +6 -0
- package/dist/assets/vendor-replit-codemirror-vim-core-FHzKdNUS.js +34 -0
- package/dist/assets/vendor-shiki-BEwTOAFg.js +1 -0
- package/dist/assets/{vendor-shikijs-core-CGM_jqPK.js → vendor-shikijs-core-Ck_OPM_T.js} +1 -1
- package/dist/assets/{vendor-shikijs-engine-javascript-Cme4830A.js → vendor-shikijs-engine-javascript-DL394yyj.js} +1 -1
- package/dist/assets/vendor-shikijs-vscode-textmate-DPFxvYtK.js +3 -0
- package/dist/assets/vendor-tailwind-merge-BKkUfl9q.js +1 -0
- package/dist/assets/vendor-workbox-window-BBnX5xw4.js +2 -0
- package/dist/assets/vendor-zumer-snapdom-SJzqoCHV.js +8 -0
- package/dist/assets/vendor-zustand-CXhN0IMY.js +6 -0
- package/dist/assets/{web-components-DzQ9ybbb.js → web-components-CIPJC1JE.js} +1 -1
- package/dist/assets/worker-CKCfxIfO.js +153 -0
- package/dist/assets/workerFactory-DlGfNFqf.js +1 -0
- package/dist/assets/zig-BB16gwVL.js +1 -0
- package/dist/index.html +8 -8
- package/dist/mini-chat.html +7 -7
- package/dist/mobile.html +7 -7
- package/package.json +54 -53
- package/server/index.js +18 -1
- package/server/lib/client-auth/live-revocation.test.js +4 -0
- package/server/lib/fs/DOCUMENTATION.md +10 -0
- package/server/lib/fs/project-icon.js +243 -0
- package/server/lib/fs/project-icon.test.js +114 -0
- package/server/lib/fs/routes.js +35 -0
- package/server/lib/fs/routes.test.js +74 -0
- package/server/lib/git/DOCUMENTATION.md +2 -1
- package/server/lib/git/routes.js +11 -3
- package/server/lib/git/routes.test.js +80 -0
- package/server/lib/git/service.js +38 -3
- package/server/lib/git/service.test.js +93 -0
- package/server/lib/open-url/DOCUMENTATION.md +35 -0
- package/server/lib/open-url/browser-env.js +199 -0
- package/server/lib/open-url/browser-env.test.js +147 -0
- package/server/lib/open-url/browser-handler.mjs +154 -0
- package/server/lib/open-url/browser-handler.test.js +69 -0
- package/server/lib/open-url/intake.js +187 -0
- package/server/lib/open-url/intake.test.js +75 -0
- package/server/lib/pi/extension-protocol.js +149 -0
- package/server/lib/pi/extension-protocol.test.js +20 -1
- package/server/lib/pi/routes.js +195 -1
- package/server/lib/pi/routes.test.js +129 -0
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +38 -10
- package/server/lib/pi/session-daemon/builtin-extensions.js +14 -4
- package/server/lib/pi/session-daemon/daemon-process.js +13 -0
- package/server/lib/pi/session-daemon/extension-bridge-draft.test.js +6 -1
- package/server/lib/pi/session-daemon/extension-bridge.js +40 -6
- package/server/lib/pi/session-daemon/extension-custom-host.js +1259 -0
- package/server/lib/pi/session-daemon/extension-custom-host.test.js +759 -0
- package/server/lib/pi/session-daemon/extension-keybindings.js +21 -0
- package/server/lib/pi/session-daemon/extension-keybindings.test.js +37 -0
- package/server/lib/pi/session-daemon/extension-message-render.js +7 -4
- package/server/lib/pi/session-daemon/extension-message-render.test.js +14 -2
- package/server/lib/pi/session-daemon/extension-tool-render.js +7 -0
- package/server/lib/pi/session-daemon/extension-tool-render.test.js +26 -0
- package/server/lib/pi/session-daemon/open-request.js +60 -0
- package/server/lib/pi/session-daemon/open-request.test.js +54 -0
- package/server/lib/pi/session-daemon/prompt-preflight.test.js +134 -0
- package/server/lib/pi/session-daemon/sdk-upgrade.test.js +21 -4
- package/server/lib/pi/session-daemon/session-daemon-bash.e2e.test.js +225 -0
- package/server/lib/pi/session-daemon/session-daemon-directory-catalog.e2e.test.js +156 -0
- package/server/lib/pi/session-daemon/session-daemon-directory-catalog.test.js +381 -0
- package/server/lib/pi/session-daemon/session-daemon-engines.test.js +11 -2
- package/server/lib/pi/session-daemon/session-daemon-extensions.test.js +30 -4
- package/server/lib/pi/session-daemon/session-daemon-list-live.test.js +20 -0
- package/server/lib/pi/session-daemon/session-daemon-mcp.e2e.test.js +16 -4
- package/server/lib/pi/session-daemon/session-daemon-turn.e2e.test.js +7 -2
- package/server/lib/pi/session-daemon/session-daemon.js +448 -49
- package/server/lib/pi/session-daemon/session-daemon.test.js +91 -4
- package/server/lib/pi/session-daemon/session-engine-router.js +9 -3
- package/server/lib/pi/session-daemon/session-engine-router.test.js +12 -2
- package/server/lib/pi/session-daemon/session-engines.js +7 -2
- package/server/lib/pi/session-daemon/session-jsonl.js +170 -75
- package/server/lib/pi/session-daemon/session-jsonl.test.js +106 -2
- package/server/lib/pi/session-daemon/supervisor.js +4 -0
- package/server/lib/pi/session-daemon/user-bash.js +326 -0
- package/server/lib/pi/session-daemon/user-bash.test.js +371 -0
- package/server/lib/preview/proxy-runtime.js +140 -45
- package/server/lib/preview/proxy-runtime.test.js +174 -3
- package/server/lib/preview/proxy-runtime.websocket.test.js +89 -0
- package/server/lib/relay/tunnel-host.js +1 -0
- package/server/lib/security/request-security.js +37 -0
- package/server/lib/security/request-security.test.js +54 -0
- package/server/lib/security/server-network-host.js +107 -0
- package/server/lib/security/server-network-host.test.js +70 -0
- package/server/lib/server-browser/DOCUMENTATION.md +243 -0
- package/server/lib/server-browser/browser-tab.js +524 -0
- package/server/lib/server-browser/chrome-executable.js +138 -0
- package/server/lib/server-browser/chrome-launch.js +138 -0
- package/server/lib/server-browser/dev-servers.js +288 -0
- package/server/lib/server-browser/dev-servers.test.js +152 -0
- package/server/lib/server-browser/downloads.js +75 -0
- package/server/lib/server-browser/frame-policy.js +183 -0
- package/server/lib/server-browser/frame-policy.test.js +98 -0
- package/server/lib/server-browser/network-guard.js +235 -0
- package/server/lib/server-browser/page-scripts.js +209 -0
- package/server/lib/server-browser/runtime.integration.test.js +474 -0
- package/server/lib/server-browser/runtime.js +300 -0
- package/server/lib/server-browser/runtime.test.js +50 -0
- package/server/lib/server-browser/server-browser.js +431 -0
- package/server/lib/server-browser/server-browser.test.js +975 -0
- package/server/lib/server-browser/tab-input.js +241 -0
- package/server/lib/server-browser/tab-prompts.js +125 -0
- package/server/lib/server-browser/tab-stream.js +252 -0
- package/server/lib/server-browser/uploads.js +98 -0
- package/server/lib/stt/runtime.js +4 -1
- package/server/lib/stt/runtime.test.js +43 -0
- package/server/lib/terminal/runtime.js +4 -1
- package/server/lib/terminal/runtime.test.js +41 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +29 -1
- package/server/lib/ui-auth/ui-auth.js +1 -0
- package/server/lib/ui-auth/ui-auth.test.js +9 -1
- package/server/lib/workspace/host.js +20 -3
- package/dist/assets/DiffView-CSonR3pr.js +0 -18
- package/dist/assets/FileSaveConflictDialog-Cun0LIbj.js +0 -3
- package/dist/assets/PullRequestsSurface-CfaOpeZn.js +0 -2
- package/dist/assets/SessionSwitcherDropdown-BSutduo7.js +0 -2
- package/dist/assets/SessionUnreadDot-Dav_rix1.js +0 -1
- package/dist/assets/SettingsView-CQJkOPJh.js +0 -6
- package/dist/assets/abap-BdImnpbu.js +0 -1
- package/dist/assets/actionscript-3-CoDkCxhg.js +0 -1
- package/dist/assets/ada-bCR0ucgS.js +0 -1
- package/dist/assets/angular-html-CU67Zn6k.js +0 -1
- package/dist/assets/angular-ts-BwZT4LLn.js +0 -1
- package/dist/assets/apache-Pmp26Uib.js +0 -1
- package/dist/assets/apex-D8_7TLub.js +0 -1
- package/dist/assets/apl-dKokRX4l.js +0 -1
- package/dist/assets/applescript-Co6uUVPk.js +0 -1
- package/dist/assets/ara-BRHolxvo.js +0 -1
- package/dist/assets/asciidoc-Ve4PFQV2.js +0 -1
- package/dist/assets/asm-D_Q5rh1f.js +0 -1
- package/dist/assets/astro-CbQHKStN.js +0 -1
- package/dist/assets/awk-DMzUqQB5.js +0 -1
- package/dist/assets/ballerina-BFfxhgS-.js +0 -1
- package/dist/assets/bat-BkioyH1T.js +0 -1
- package/dist/assets/beancount-k_qm7-4y.js +0 -1
- package/dist/assets/berry-uYugtg8r.js +0 -1
- package/dist/assets/bibtex-CHM0blh-.js +0 -1
- package/dist/assets/bicep-Bmn6On1c.js +0 -1
- package/dist/assets/bird2-DPOp833l.js +0 -1
- package/dist/assets/blade-D4QpJJKB.js +0 -1
- package/dist/assets/bsl-BO_Y6i37.js +0 -1
- package/dist/assets/c-BIGW1oBm.js +0 -1
- package/dist/assets/c3-eo99z4R2.js +0 -1
- package/dist/assets/cadence-Bv_4Rxtq.js +0 -1
- package/dist/assets/cairo-KRGpt6FW.js +0 -1
- package/dist/assets/clarity-D53aC0YG.js +0 -1
- package/dist/assets/clojure-P80f7IUj.js +0 -1
- package/dist/assets/cmake-D1j8_8rp.js +0 -1
- package/dist/assets/cobol-nwyudZeR.js +0 -1
- package/dist/assets/codeowners-Bp6g37R7.js +0 -1
- package/dist/assets/codeql-DsOJ9woJ.js +0 -1
- package/dist/assets/coffee-Ch7k5sss.js +0 -1
- package/dist/assets/common-lisp-Cg-RD9OK.js +0 -1
- package/dist/assets/coq-DkFqJrB1.js +0 -1
- package/dist/assets/cpp-CofmeUqb.js +0 -1
- package/dist/assets/crystal-tKQVLTB8.js +0 -1
- package/dist/assets/csharp-COcwbKMJ.js +0 -1
- package/dist/assets/css-DPfMkruS.js +0 -1
- package/dist/assets/csv-fuZLfV_i.js +0 -1
- package/dist/assets/cue-D82EKSYY.js +0 -1
- package/dist/assets/cypher-COkxafJQ.js +0 -1
- package/dist/assets/d-85-TOEBH.js +0 -1
- package/dist/assets/dart-CF10PKvl.js +0 -1
- package/dist/assets/dax-CEL-wOlO.js +0 -1
- package/dist/assets/desktop-BmXAJ9_W.js +0 -1
- package/dist/assets/diff-D97Zzqfu.js +0 -1
- package/dist/assets/docker-BcOcwvcX.js +0 -1
- package/dist/assets/dotenv-Da5cRb03.js +0 -1
- package/dist/assets/dream-maker-BtqSS_iP.js +0 -1
- package/dist/assets/edge-BkV0erSs.js +0 -1
- package/dist/assets/elixir-CDX3lj18.js +0 -1
- package/dist/assets/elm-DbKCFpqz.js +0 -1
- package/dist/assets/emacs-lisp-C9XAeP06.js +0 -1
- package/dist/assets/erb-B12qg9BL.js +0 -1
- package/dist/assets/erlang-DsQrWhSR.js +0 -1
- package/dist/assets/fennel-BYunw83y.js +0 -1
- package/dist/assets/fish-BvzEVeQv.js +0 -1
- package/dist/assets/fluent-C4IJs8-o.js +0 -1
- package/dist/assets/fortran-fixed-form-CkoXwp7k.js +0 -1
- package/dist/assets/fortran-free-form-BxgE0vQu.js +0 -1
- package/dist/assets/fsharp-CXgrBDvD.js +0 -1
- package/dist/assets/gdresource-BOOCDP_w.js +0 -1
- package/dist/assets/gdscript-C5YyOfLZ.js +0 -1
- package/dist/assets/gdshader-DkwncUOv.js +0 -1
- package/dist/assets/genie-D0YGMca9.js +0 -1
- package/dist/assets/gherkin-DyxjwDmM.js +0 -1
- package/dist/assets/git-commit-F4YmCXRG.js +0 -1
- package/dist/assets/git-rebase-r7XF79zn.js +0 -1
- package/dist/assets/gleam-BspZqrRM.js +0 -1
- package/dist/assets/glimmer-js-Rg0-pVw9.js +0 -1
- package/dist/assets/glimmer-ts-U6CK756n.js +0 -1
- package/dist/assets/glsl-DplSGwfg.js +0 -1
- package/dist/assets/gn-n2N0HUVH.js +0 -1
- package/dist/assets/gnuplot-DdkO51Og.js +0 -1
- package/dist/assets/go-CxLEBnE3.js +0 -1
- package/dist/assets/graphql-ChdNCCLP.js +0 -1
- package/dist/assets/groovy-gcz8RCvz.js +0 -1
- package/dist/assets/hack-CaT9iCJl.js +0 -1
- package/dist/assets/haml-B8DHNrY2.js +0 -1
- package/dist/assets/handlebars-BL8al0AC.js +0 -1
- package/dist/assets/haskell-Df6bDoY_.js +0 -1
- package/dist/assets/haxe-CzTSHFRz.js +0 -1
- package/dist/assets/hcl-BWvSN4gD.js +0 -1
- package/dist/assets/hjson-D5-asLiD.js +0 -1
- package/dist/assets/hlsl-D3lLCCz7.js +0 -1
- package/dist/assets/html-GMplVEZG.js +0 -1
- package/dist/assets/html-derivative-BFtXZ54Q.js +0 -1
- package/dist/assets/http-jrhK8wxY.js +0 -1
- package/dist/assets/hurl-irOxFIW8.js +0 -1
- package/dist/assets/hxml-Bvhsp5Yf.js +0 -1
- package/dist/assets/hy-DFXneXwc.js +0 -1
- package/dist/assets/imba-DGztddWO.js +0 -1
- package/dist/assets/index-B0h6_x5N.js +0 -1
- package/dist/assets/index-BwoW_-vk.css +0 -1
- package/dist/assets/ini-BEwlwnbL.js +0 -1
- package/dist/assets/java-CylS5w8V.js +0 -1
- package/dist/assets/javascript-wDzz0qaB.js +0 -1
- package/dist/assets/jinja-4LBKfQ-Z.js +0 -1
- package/dist/assets/jison-wvAkD_A8.js +0 -1
- package/dist/assets/json-Cp-IABpG.js +0 -1
- package/dist/assets/json5-C9tS-k6U.js +0 -1
- package/dist/assets/jsonc-Des-eS-w.js +0 -1
- package/dist/assets/jsonl-DcaNXYhu.js +0 -1
- package/dist/assets/jsonnet-DFQXde-d.js +0 -1
- package/dist/assets/jssm-C2t-YnRu.js +0 -1
- package/dist/assets/jsx-g9-lgVsj.js +0 -1
- package/dist/assets/julia-CxzCAyBv.js +0 -1
- package/dist/assets/just-Cw27pwNe.js +0 -1
- package/dist/assets/kdl-DV7GczEv.js +0 -1
- package/dist/assets/kotlin-BdnUsdx6.js +0 -1
- package/dist/assets/kusto-DZf3V79B.js +0 -1
- package/dist/assets/latex-CWtU0Tv5.js +0 -1
- package/dist/assets/lean-BZvkOJ9d.js +0 -1
- package/dist/assets/less-B1dDrJ26.js +0 -1
- package/dist/assets/liquid-DYVedYrR.js +0 -1
- package/dist/assets/llvm-DjAJT7YJ.js +0 -1
- package/dist/assets/log-2UxHyX5q.js +0 -1
- package/dist/assets/logo-BtOb2qkB.js +0 -1
- package/dist/assets/lua-BaeVxFsk.js +0 -1
- package/dist/assets/luau-C-HG3fhB.js +0 -1
- package/dist/assets/main-C6i4ph9N.js +0 -2
- package/dist/assets/main-r5elIPBi.js +0 -136
- package/dist/assets/make-CHLpvVh8.js +0 -1
- package/dist/assets/markdown-Cvjx9yec.js +0 -1
- package/dist/assets/markdownCore-C2YQ3Z0q.js +0 -2
- package/dist/assets/marko-CnJfTvn9.js +0 -1
- package/dist/assets/matlab-D7o27uSR.js +0 -1
- package/dist/assets/mdc-BMNejdWA.js +0 -1
- package/dist/assets/mdx-Cmh6b_Ma.js +0 -1
- package/dist/assets/mermaid-mWjccvbQ.js +0 -1
- package/dist/assets/miniChat-d_GCHoIf.js +0 -2
- package/dist/assets/mipsasm-CKIfxQSi.js +0 -1
- package/dist/assets/mobile-BJ3tgyKd.js +0 -2
- package/dist/assets/mojo-rZm6bMo-.js +0 -1
- package/dist/assets/moonbit-_H4v1dQx.js +0 -1
- package/dist/assets/move-IF9eRakj.js +0 -1
- package/dist/assets/narrat-DRg8JJMk.js +0 -1
- package/dist/assets/nextflow-Zz6hmt5N.js +0 -1
- package/dist/assets/nextflow-groovy-BeH2EWoN.js +0 -1
- package/dist/assets/nginx-BpAMiNFr.js +0 -1
- package/dist/assets/nim-CVrawwO9.js +0 -1
- package/dist/assets/nix-CwoSXNpI.js +0 -1
- package/dist/assets/nsis-LdVXkNf5.js +0 -1
- package/dist/assets/nushell-Cz2AlsmD.js +0 -1
- package/dist/assets/objective-c-DXmwc3jG.js +0 -1
- package/dist/assets/objective-cpp-CLxacb5B.js +0 -1
- package/dist/assets/ocaml-C0hk2d4L.js +0 -1
- package/dist/assets/odin-BBf5iR-q.js +0 -1
- package/dist/assets/openscad-C4EeE6gA.js +0 -1
- package/dist/assets/pascal-D93ZcfNL.js +0 -1
- package/dist/assets/perl-C0TMdlhV.js +0 -1
- package/dist/assets/permissionStore-B9Hkrqny.js +0 -1
- package/dist/assets/php-Dhbhpdrm.js +0 -1
- package/dist/assets/pi-session-focus-preference-BFnGFuvP.js +0 -9
- package/dist/assets/pkl-u5AG7uiY.js +0 -1
- package/dist/assets/plsql-ChMvpjG-.js +0 -1
- package/dist/assets/po-BTJTHyun.js +0 -1
- package/dist/assets/polar-C0HS_06l.js +0 -1
- package/dist/assets/postcss-CXtECtnM.js +0 -1
- package/dist/assets/powerquery-CEu0bR-o.js +0 -1
- package/dist/assets/powershell-Dpen1YoG.js +0 -1
- package/dist/assets/prisma-Dd19v3D-.js +0 -1
- package/dist/assets/prolog-CbFg5uaA.js +0 -1
- package/dist/assets/proto-C7zT0LnQ.js +0 -1
- package/dist/assets/pug-CGlum2m_.js +0 -1
- package/dist/assets/puppet-BMWR74SV.js +0 -1
- package/dist/assets/purescript-CklMAg4u.js +0 -1
- package/dist/assets/python-B6aJPvgy.js +0 -1
- package/dist/assets/qml-3beO22l8.js +0 -1
- package/dist/assets/qmldir-C8lEn-DE.js +0 -1
- package/dist/assets/qss-IeuSbFQv.js +0 -1
- package/dist/assets/r-Dspwwk_N.js +0 -1
- package/dist/assets/racket-BqYA7rlc.js +0 -1
- package/dist/assets/raku-DXvB9xmW.js +0 -1
- package/dist/assets/razor-Uh8Bk_45.js +0 -1
- package/dist/assets/reg-C-SQnVFl.js +0 -1
- package/dist/assets/regexp-CDVJQ6XC.js +0 -1
- package/dist/assets/rel-C3B-1QV4.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-Bap5OwgB.js +0 -2
- package/dist/assets/renderMobileApp-DJbslvby.js +0 -11
- package/dist/assets/riscv-BM1_JUlF.js +0 -1
- package/dist/assets/ron-D8l8udqQ.js +0 -1
- package/dist/assets/rosmsg-BJDFO7_C.js +0 -1
- package/dist/assets/rst-BrH8l1NY.js +0 -1
- package/dist/assets/ruby-B2Rjki9n.js +0 -1
- package/dist/assets/ruby-Dw2BHqvy.js +0 -1
- package/dist/assets/runtimeEndpointReset-D22U_Vjs.js +0 -62
- package/dist/assets/runtimeSurface-k1Eit61v.js +0 -1
- package/dist/assets/rust-B1yitclQ.js +0 -1
- package/dist/assets/sas-cz2c8ADy.js +0 -1
- package/dist/assets/sass-Cj5Yp3dK.js +0 -1
- package/dist/assets/scala-C151Ov-r.js +0 -1
- package/dist/assets/scheme-C98Dy4si.js +0 -1
- package/dist/assets/scss-OYdSNvt2.js +0 -1
- package/dist/assets/sdbl-DVxCFoDh.js +0 -1
- package/dist/assets/shaderlab-Dg9Lc6iA.js +0 -1
- package/dist/assets/shellscript-Yzrsuije.js +0 -1
- package/dist/assets/shellsession-BADoaaVG.js +0 -1
- package/dist/assets/smalltalk-BERRCDM3.js +0 -1
- package/dist/assets/solidity-rGO070M0.js +0 -1
- package/dist/assets/soy-Brmx7dQM.js +0 -1
- package/dist/assets/sparql-rVzFXLq3.js +0 -1
- package/dist/assets/splunk-BtCnVYZw.js +0 -1
- package/dist/assets/sql-BLtJtn59.js +0 -1
- package/dist/assets/ssh-config-_ykCGR6B.js +0 -1
- package/dist/assets/stata-BH5u7GGu.js +0 -1
- package/dist/assets/stylus-BEDo0Tqx.js +0 -1
- package/dist/assets/surrealql-Bq5Q-fJD.js +0 -1
- package/dist/assets/svelte-C_ipcX3V.js +0 -1
- package/dist/assets/swift-D82vCrfD.js +0 -1
- package/dist/assets/system-verilog-CnnmHF94.js +0 -1
- package/dist/assets/systemd-4A_iFExJ.js +0 -1
- package/dist/assets/talonscript-CkByrt1z.js +0 -1
- package/dist/assets/tasl-QIJgUcNo.js +0 -1
- package/dist/assets/tcl-dwOrl1Do.js +0 -1
- package/dist/assets/templ-P3uqSqPl.js +0 -1
- package/dist/assets/terraform-BETggiCN.js +0 -1
- package/dist/assets/tex-idrVyKtj.js +0 -1
- package/dist/assets/themeResolver-yJ9XpNMI.js +0 -1
- package/dist/assets/toml-vGWfd6FD.js +0 -1
- package/dist/assets/ts-tags-zn1MmPIZ.js +0 -1
- package/dist/assets/tsv-B_m7g4N7.js +0 -1
- package/dist/assets/tsx-COt5Ahok.js +0 -1
- package/dist/assets/turtle-BsS91CYL.js +0 -1
- package/dist/assets/twig-DNn4PbVi.js +0 -1
- package/dist/assets/typescript-BPQ3VLAy.js +0 -1
- package/dist/assets/typespec-BGHnOYBU.js +0 -1
- package/dist/assets/typst-DHCkPAjA.js +0 -1
- package/dist/assets/useAppFontEffects-CqHhRKmN.js +0 -212
- package/dist/assets/useFilesViewSearch-CqoYEK0U.js +0 -7
- package/dist/assets/v-BcVCzyr7.js +0 -1
- package/dist/assets/vala-CsfeWuGM.js +0 -1
- package/dist/assets/vb-D17OF-Vu.js +0 -1
- package/dist/assets/vendor-aparajita-capacitor-secure-storage-BDrMx_CE.js +0 -1
- package/dist/assets/vendor-base-ui-CKRUCG-f.js +0 -1
- package/dist/assets/vendor-boot-EC6IyLt1.js +0 -69
- package/dist/assets/vendor-codemirror-autocomplete-CGpAsPWp.js +0 -1
- package/dist/assets/vendor-codemirror-lang-angular-CDJoHJSY.js +0 -1
- package/dist/assets/vendor-codemirror-lang-cpp-BmHofQls.js +0 -1
- package/dist/assets/vendor-codemirror-lang-css-RM2HqXZ0.js +0 -1
- package/dist/assets/vendor-codemirror-lang-html-CHSHUpwq.js +0 -1
- package/dist/assets/vendor-codemirror-lang-java-lhQXgWu0.js +0 -1
- package/dist/assets/vendor-codemirror-lang-javascript-Dw4kFO4e.js +0 -13
- package/dist/assets/vendor-codemirror-lang-jinja-_pAC3UTN.js +0 -1
- package/dist/assets/vendor-codemirror-lang-json-B-b1vAv-.js +0 -1
- package/dist/assets/vendor-codemirror-lang-less-xIgOi1ze.js +0 -1
- package/dist/assets/vendor-codemirror-lang-liquid-CP49m5dB.js +0 -1
- package/dist/assets/vendor-codemirror-lang-markdown-BTht2ATe.js +0 -1
- package/dist/assets/vendor-codemirror-lang-php-BguZDhaO.js +0 -1
- package/dist/assets/vendor-codemirror-lang-python-CH6_em9L.js +0 -3
- package/dist/assets/vendor-codemirror-lang-rust-EG_DtGyi.js +0 -1
- package/dist/assets/vendor-codemirror-lang-sass-BknY5Qpo.js +0 -1
- package/dist/assets/vendor-codemirror-lang-vue-CyGn9snv.js +0 -1
- package/dist/assets/vendor-codemirror-lang-wast-CsFfSyyB.js +0 -1
- package/dist/assets/vendor-codemirror-lang-xml-Cdan_Jp1.js +0 -1
- package/dist/assets/vendor-codemirror-lang-yaml-COI5hck8.js +0 -1
- package/dist/assets/vendor-codemirror-search-DUfSCF9S.js +0 -2
- package/dist/assets/vendor-dompurify-r8glNMJW.js +0 -2
- package/dist/assets/vendor-elkjs-D27273Ms.js +0 -24
- package/dist/assets/vendor-fuse.js-Dw8P0qyA.js +0 -1
- package/dist/assets/vendor-lezer-cpp-DMZOJzBa.js +0 -1
- package/dist/assets/vendor-lezer-css-DUkkbMp7.js +0 -1
- package/dist/assets/vendor-lezer-java-tMazV_6X.js +0 -1
- package/dist/assets/vendor-lezer-javascript-ctwLWf4v.js +0 -1
- package/dist/assets/vendor-lezer-lr-B8TQctNw.js +0 -1
- package/dist/assets/vendor-lezer-markdown-aGLZf_3h.js +0 -6
- package/dist/assets/vendor-lezer-php-D5zCNzlt.js +0 -1
- package/dist/assets/vendor-lezer-rust-DO5c7OtA.js +0 -1
- package/dist/assets/vendor-marked-CX41MkDF.js +0 -59
- package/dist/assets/vendor-oniguruma-to-es-DLBnFDCE.js +0 -94
- package/dist/assets/vendor-property-information-rJCbAzvX.js +0 -1
- package/dist/assets/vendor-react-DASdDPIk.js +0 -1
- package/dist/assets/vendor-remend-BWYYytN3.js +0 -22
- package/dist/assets/vendor-replit-codemirror-vim-AnOuN8yJ.js +0 -39
- package/dist/assets/vendor-shiki-Bbf2GEcE.js +0 -2
- package/dist/assets/vendor-shikijs-vscode-textmate-BgLrS_2D.js +0 -3
- package/dist/assets/vendor-tailwind-merge-CPcsbTWB.js +0 -1
- package/dist/assets/vendor-workbox-window-BIl4cyR9.js +0 -2
- package/dist/assets/vendor-zumer-snapdom-Btyu_Xi2.js +0 -8
- package/dist/assets/vendor-zustand-CUi8eEds.js +0 -6
- package/dist/assets/verilog-BQ8w6xss.js +0 -1
- package/dist/assets/vhdl-CeAyd5Ju.js +0 -1
- package/dist/assets/viml-CJc9bBzg.js +0 -1
- package/dist/assets/vue-DN_0RTcg.js +0 -1
- package/dist/assets/vue-html-AaS7Mt5G.js +0 -1
- package/dist/assets/vue-vine-CQOfvN7w.js +0 -1
- package/dist/assets/vyper-CDx5xZoG.js +0 -1
- package/dist/assets/wasm-MzD3tlZU.js +0 -1
- package/dist/assets/wenyan-BV7otONQ.js +0 -1
- package/dist/assets/wgsl-Dx-B1_4e.js +0 -1
- package/dist/assets/wikitext-BhOHFoWU.js +0 -1
- package/dist/assets/wit-5i3qLPDT.js +0 -1
- package/dist/assets/wolfram-lXgVvXCa.js +0 -1
- package/dist/assets/worker-BBk7yuNN.js +0 -153
- package/dist/assets/workerFactory-tw7cIdmV.js +0 -1
- package/dist/assets/xml-sdJ4AIDG.js +0 -1
- package/dist/assets/xsl-CtQFsRM5.js +0 -1
- package/dist/assets/yaml-Buea-lGh.js +0 -1
- package/dist/assets/zenscript-DVFEvuxE.js +0 -1
- package/dist/assets/zig-VOosw3JB.js +0 -1
|
@@ -0,0 +1,759 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
|
|
6
|
+
import { createExtensionCustomHost, normalizeCustomViewport } from './extension-custom-host.js';
|
|
7
|
+
import { MAX_CUSTOM_LINE_CHARS, projectCustomFrame, projectCustomSurface, projectCustomSurfaces } from '../extension-protocol.js';
|
|
8
|
+
|
|
9
|
+
const SESSION = 'session-1';
|
|
10
|
+
const CURSOR = '\x1b_pi:c\x07';
|
|
11
|
+
|
|
12
|
+
const flushPromises = async () => {
|
|
13
|
+
for (let index = 0; index < 5; index += 1) await new Promise((resolve) => setImmediate(resolve));
|
|
14
|
+
};
|
|
15
|
+
const DATABASES = ['PostgreSQL', 'SQLite', 'ClickHouse', 'DuckDB', 'MySQL', 'Redis'];
|
|
16
|
+
|
|
17
|
+
/** A list component like Pi's SelectList: arrows move, Enter picks, Escape cancels. */
|
|
18
|
+
const listComponent = (items, done, extra = {}) => {
|
|
19
|
+
let selected = 0;
|
|
20
|
+
return {
|
|
21
|
+
focused: false,
|
|
22
|
+
render: (width) => items.map((item, index) => `${index === selected ? '>' : ' '} ${item}`.padEnd(width).slice(0, width)),
|
|
23
|
+
handleInput: (data) => {
|
|
24
|
+
if (data === '\x1b[B') selected = Math.min(items.length - 1, selected + 1);
|
|
25
|
+
else if (data === '\x1b[A') selected = Math.max(0, selected - 1);
|
|
26
|
+
else if (data === '\r') done(items[selected]);
|
|
27
|
+
else if (data === '\x1b') done(undefined);
|
|
28
|
+
},
|
|
29
|
+
invalidate: vi.fn(),
|
|
30
|
+
dispose: vi.fn(),
|
|
31
|
+
...extra,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const createHarness = (overrides = {}) => {
|
|
36
|
+
const events = [];
|
|
37
|
+
const transient = [];
|
|
38
|
+
const pending = [];
|
|
39
|
+
const errors = [];
|
|
40
|
+
const settled = [];
|
|
41
|
+
const host = createExtensionCustomHost({
|
|
42
|
+
publish: (event, payload, sessionId) => events.push({ event, payload, sessionId }),
|
|
43
|
+
publishTransient: (event, payload, sessionId) => transient.push({ event, payload, sessionId }),
|
|
44
|
+
pendingInput: {
|
|
45
|
+
open: (entry) => pending.push({ op: 'open', ...entry }),
|
|
46
|
+
close: (sessionId, requestId) => pending.push({ op: 'close', sessionId, requestId }),
|
|
47
|
+
},
|
|
48
|
+
directoryForSession: () => '/repo',
|
|
49
|
+
theme: { fg: (_name, text) => text },
|
|
50
|
+
describeOrigin: () => 'question',
|
|
51
|
+
onSettled: (sessionId) => settled.push(sessionId),
|
|
52
|
+
onError: (sessionId, stage, error) => errors.push({ sessionId, stage, message: String(error?.message ?? error) }),
|
|
53
|
+
...overrides,
|
|
54
|
+
});
|
|
55
|
+
const frames = (surfaceId) => transient.filter((entry) => entry.event === 'extension.custom.frame' && entry.payload.surfaceId === surfaceId);
|
|
56
|
+
const lastMeta = (surfaceId) => events.filter((entry) => entry.event === 'extension.custom' && entry.payload.surfaceId === surfaceId).at(-1)?.payload;
|
|
57
|
+
const opened = () => events.filter((entry) => entry.event === 'extension.custom').map((entry) => entry.payload.surfaceId);
|
|
58
|
+
return { host, events, transient, pending, errors, settled, frames, lastMeta, opened };
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
describe('normalizeCustomViewport', () => {
|
|
62
|
+
it('clamps sizes and defaults the screen to the column width', () => {
|
|
63
|
+
expect(normalizeCustomViewport({ columns: 5, rows: 500 })).toEqual({ columns: 20, screenColumns: 20, rows: 80 });
|
|
64
|
+
expect(normalizeCustomViewport({ columns: 90.7, rows: 30, screenColumns: 1000 })).toEqual({ columns: 90, screenColumns: 400, rows: 30 });
|
|
65
|
+
expect(normalizeCustomViewport({ columns: 'wide', rows: 30 })).toBeUndefined();
|
|
66
|
+
expect(normalizeCustomViewport(null)).toBeUndefined();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe('createExtensionCustomHost', () => {
|
|
71
|
+
// The first custom() loads pi-tui from the installed SDK.
|
|
72
|
+
beforeAll(async () => {
|
|
73
|
+
const harness = createHarness();
|
|
74
|
+
const result = harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['warm'], done));
|
|
75
|
+
await vi.waitFor(() => expect(harness.opened()).toHaveLength(1));
|
|
76
|
+
harness.host.clear(SESSION);
|
|
77
|
+
await result;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
beforeEach(() => {
|
|
81
|
+
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });
|
|
82
|
+
});
|
|
83
|
+
afterEach(() => {
|
|
84
|
+
vi.useRealTimers();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('shows an inline surface, routes keys, and resolves done() with the result', async () => {
|
|
88
|
+
const harness = createHarness();
|
|
89
|
+
const result = harness.host.open(SESSION, (_tui, _theme, keybindings, done) => {
|
|
90
|
+
expect(typeof keybindings?.matches).toBe('function');
|
|
91
|
+
return listComponent(DATABASES, done);
|
|
92
|
+
}, { blocked: { kind: 'question', message: 'Pick a database' } });
|
|
93
|
+
await flushPromises();
|
|
94
|
+
const [surfaceId] = harness.opened();
|
|
95
|
+
expect(harness.lastMeta(surfaceId)).toMatchObject({
|
|
96
|
+
mode: 'inline', capturing: true, focused: true, title: 'question', blocked: { kind: 'question', message: 'Pick a database' },
|
|
97
|
+
});
|
|
98
|
+
expect(harness.pending).toEqual([{ op: 'open', sessionId: SESSION, directory: '/repo', requestId: surfaceId, kind: 'input' }]);
|
|
99
|
+
const first = harness.frames(surfaceId)[0].payload;
|
|
100
|
+
expect(first.lines).toHaveLength(6);
|
|
101
|
+
expect(first.lines[0].startsWith('> PostgreSQL')).toBe(true);
|
|
102
|
+
expect(first.columns).toBe(100);
|
|
103
|
+
|
|
104
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\x1b[B'] })).toEqual({ accepted: true });
|
|
105
|
+
vi.advanceTimersByTime(40);
|
|
106
|
+
const patch = harness.frames(surfaceId).at(-1).payload;
|
|
107
|
+
expect(patch.base).toBe(first.version);
|
|
108
|
+
expect(patch.changes.map((change) => change.index)).toEqual([0, 1]);
|
|
109
|
+
|
|
110
|
+
harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\r'] });
|
|
111
|
+
await expect(result).resolves.toBe('SQLite');
|
|
112
|
+
expect(harness.events.at(-1)).toMatchObject({ event: 'extension.custom.dismiss', payload: { surfaceId, reason: 'done' } });
|
|
113
|
+
expect(harness.pending.at(-1)).toEqual({ op: 'close', sessionId: SESSION, requestId: surfaceId });
|
|
114
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
115
|
+
expect(harness.settled).toEqual([SESSION]);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('draws a key at once after a quiet spell and holds busy redraws to 33 ms', async () => {
|
|
119
|
+
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'] });
|
|
120
|
+
const harness = createHarness();
|
|
121
|
+
void harness.host.open(SESSION, (_tui, _theme, _kb, done) => listComponent(DATABASES, done));
|
|
122
|
+
await flushPromises();
|
|
123
|
+
const [surfaceId] = harness.opened();
|
|
124
|
+
const count = () => harness.frames(surfaceId).length;
|
|
125
|
+
vi.advanceTimersByTime(100);
|
|
126
|
+
const quiet = count();
|
|
127
|
+
|
|
128
|
+
harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\x1b[B'] });
|
|
129
|
+
vi.advanceTimersByTime(0);
|
|
130
|
+
expect(count()).toBe(quiet + 1);
|
|
131
|
+
|
|
132
|
+
// 10 ms after that draw: waits for the rest of the 33 ms.
|
|
133
|
+
vi.advanceTimersByTime(10);
|
|
134
|
+
harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\x1b[B'] });
|
|
135
|
+
vi.advanceTimersByTime(22);
|
|
136
|
+
expect(count()).toBe(quiet + 1);
|
|
137
|
+
vi.advanceTimersByTime(1);
|
|
138
|
+
expect(count()).toBe(quiet + 2);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('maps permission prompts to approval and Close to undefined', async () => {
|
|
142
|
+
const harness = createHarness();
|
|
143
|
+
let component;
|
|
144
|
+
const result = harness.host.open(SESSION, (_tui, _theme, _kb, done) => {
|
|
145
|
+
component = listComponent(['Allow', 'Deny'], done);
|
|
146
|
+
return component;
|
|
147
|
+
}, { blocked: { kind: 'permission', message: 'Run rm?' } });
|
|
148
|
+
await flushPromises();
|
|
149
|
+
const [surfaceId] = harness.opened();
|
|
150
|
+
expect(harness.pending[0].kind).toBe('approval');
|
|
151
|
+
expect(harness.host.close({ sessionId: SESSION, surfaceId })).toEqual({ closed: true });
|
|
152
|
+
await expect(result).resolves.toBeUndefined();
|
|
153
|
+
expect(component.dispose).toHaveBeenCalledOnce();
|
|
154
|
+
expect(harness.events.at(-1).payload).toEqual({ surfaceId, reason: 'cancelled' });
|
|
155
|
+
expect(harness.host.close({ sessionId: SESSION, surfaceId })).toEqual({ closed: false });
|
|
156
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['x'] })).toEqual({ accepted: false });
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('rejects when the factory throws and shows nothing', async () => {
|
|
160
|
+
const harness = createHarness();
|
|
161
|
+
await expect(harness.host.open(SESSION, () => {
|
|
162
|
+
throw new Error('boom');
|
|
163
|
+
})).rejects.toThrow('boom');
|
|
164
|
+
expect(harness.opened()).toEqual([]);
|
|
165
|
+
expect(harness.errors).toEqual([{ sessionId: SESSION, stage: 'factory', message: 'boom' }]);
|
|
166
|
+
expect(harness.pending).toEqual([]);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('never shows a component whose factory already called done()', async () => {
|
|
170
|
+
const harness = createHarness();
|
|
171
|
+
const dispose = vi.fn();
|
|
172
|
+
await expect(harness.host.open(SESSION, (_tui, _theme, _kb, done) => {
|
|
173
|
+
done('early');
|
|
174
|
+
return { render: () => ['x'], dispose };
|
|
175
|
+
})).resolves.toBe('early');
|
|
176
|
+
expect(harness.opened()).toEqual([]);
|
|
177
|
+
expect(dispose).toHaveBeenCalledOnce();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('closes a component whose render throws', async () => {
|
|
181
|
+
const harness = createHarness();
|
|
182
|
+
const result = harness.host.open(SESSION, () => ({ render: () => { throw new Error('bad render'); } }));
|
|
183
|
+
await flushPromises();
|
|
184
|
+
await expect(result).resolves.toBeUndefined();
|
|
185
|
+
expect(harness.errors[0]).toMatchObject({ stage: 'render', message: 'bad render' });
|
|
186
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('ends every surface on session close, reload, and daemon stop', async () => {
|
|
190
|
+
const harness = createHarness();
|
|
191
|
+
const first = harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['a'], done));
|
|
192
|
+
const second = harness.host.open('session-2', (_t, _th, _kb, done) => listComponent(['b'], done));
|
|
193
|
+
await flushPromises();
|
|
194
|
+
harness.host.clear(SESSION, 'reload');
|
|
195
|
+
await expect(first).resolves.toBeUndefined();
|
|
196
|
+
expect(harness.events.filter((entry) => entry.event === 'extension.custom.dismiss').map((entry) => entry.payload.reason)).toEqual(['reload']);
|
|
197
|
+
harness.host.clear(undefined, 'daemon-stopped');
|
|
198
|
+
await expect(second).resolves.toBeUndefined();
|
|
199
|
+
expect(harness.events.filter((entry) => entry.event === 'extension.custom.dismiss').map((entry) => entry.payload.reason)).toEqual(['reload', 'daemon-stopped']);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it('extracts the cursor of the focused surface and strips private markers', async () => {
|
|
203
|
+
const harness = createHarness();
|
|
204
|
+
void harness.host.open(SESSION, () => ({
|
|
205
|
+
focused: false,
|
|
206
|
+
render: () => [`name: ab${CURSOR}\x1b_pi:fc\x07c\x1b_pi:/fc\x07`, '日本 ok'],
|
|
207
|
+
handleInput: () => {},
|
|
208
|
+
}));
|
|
209
|
+
await flushPromises();
|
|
210
|
+
const [surfaceId] = harness.opened();
|
|
211
|
+
const frame = harness.frames(surfaceId)[0].payload;
|
|
212
|
+
expect(frame.cursor).toEqual({ row: 0, col: 8 });
|
|
213
|
+
expect(frame.lines[0]).toBe('name: ab\x1b[7mc\x1b[27m');
|
|
214
|
+
expect(frame.cells).toEqual({ 1: { 0: 2, 1: 2 } });
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it('lays out overlays on the screen with Pi rules and falls back to the component width', async () => {
|
|
218
|
+
const harness = createHarness();
|
|
219
|
+
void harness.host.open(SESSION, () => ({ width: 30, render: (width) => [`${'x'.repeat(width + 10)}`, 'y'] }), { overlay: true });
|
|
220
|
+
await flushPromises();
|
|
221
|
+
const [surfaceId] = harness.opened();
|
|
222
|
+
const frame = harness.frames(surfaceId)[0].payload;
|
|
223
|
+
// 140 x 30 screen, centred 30-wide box of two lines.
|
|
224
|
+
expect(frame.layout).toEqual({ row: 14, col: 55, width: 30, height: 2 });
|
|
225
|
+
expect(frame.lines[0]).toBe('x'.repeat(30));
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('uses the screen for edge-anchored overlays and re-evaluates function options', async () => {
|
|
229
|
+
const harness = createHarness();
|
|
230
|
+
let calls = 0;
|
|
231
|
+
void harness.host.open(SESSION, () => ({ render: () => ['side'] }), {
|
|
232
|
+
overlay: true,
|
|
233
|
+
overlayOptions: () => {
|
|
234
|
+
calls += 1;
|
|
235
|
+
return { anchor: 'right-center', width: '25%', minWidth: 30, margin: { right: 1 }, visible: (columns) => columns >= 100 };
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
await flushPromises();
|
|
239
|
+
const [surfaceId] = harness.opened();
|
|
240
|
+
let frame = harness.frames(surfaceId)[0].payload;
|
|
241
|
+
expect(frame.layout).toMatchObject({ col: 140 - 1 - 35, width: 35 });
|
|
242
|
+
expect(frame.visible).toBe(true);
|
|
243
|
+
expect(calls).toBeGreaterThan(1);
|
|
244
|
+
|
|
245
|
+
harness.host.reportViewport({ sessionId: SESSION, clientId: 'phone', viewport: { columns: 44, rows: 40, screenColumns: 46 } });
|
|
246
|
+
vi.advanceTimersByTime(200);
|
|
247
|
+
frame = harness.frames(surfaceId).at(-1).payload;
|
|
248
|
+
expect(frame.visible).toBe(false);
|
|
249
|
+
expect(frame.screenColumns).toBe(46);
|
|
250
|
+
// Hidden by `visible()`: no focus, and keys are dropped. It is still
|
|
251
|
+
// open, so the answer is not the one that makes a client drop it.
|
|
252
|
+
expect(harness.lastMeta(surfaceId).focused).toBe(false);
|
|
253
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['x'] })).toEqual({ accepted: true, delivered: false });
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('keeps non-capturing overlays out of focus and pending input', async () => {
|
|
257
|
+
const harness = createHarness();
|
|
258
|
+
void harness.host.open(SESSION, () => ({ render: () => ['ci'], handleInput: vi.fn() }), {
|
|
259
|
+
overlay: true,
|
|
260
|
+
overlayOptions: { nonCapturing: true, anchor: 'top-right', width: 20 },
|
|
261
|
+
});
|
|
262
|
+
await flushPromises();
|
|
263
|
+
const [surfaceId] = harness.opened();
|
|
264
|
+
expect(harness.lastMeta(surfaceId)).toMatchObject({ capturing: false, focused: false });
|
|
265
|
+
expect(harness.pending).toEqual([]);
|
|
266
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['x'] })).toEqual({ accepted: true, delivered: false });
|
|
267
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(true);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('gives nested overlays and handles Pi semantics', async () => {
|
|
271
|
+
const harness = createHarness();
|
|
272
|
+
let handle;
|
|
273
|
+
let nestedHandle;
|
|
274
|
+
let tuiRef;
|
|
275
|
+
const result = harness.host.open(SESSION, (tui, _theme, _kb, done) => {
|
|
276
|
+
tuiRef = tui;
|
|
277
|
+
return listComponent(['a'], done);
|
|
278
|
+
}, { overlay: true, onHandle: (value) => { handle = value; } });
|
|
279
|
+
await flushPromises();
|
|
280
|
+
const [parentId] = harness.opened();
|
|
281
|
+
expect(handle.isFocused()).toBe(true);
|
|
282
|
+
expect(handle.getBounds()).toMatchObject({ width: 80, height: 1 });
|
|
283
|
+
expect(tuiRef.terminal.columns).toBe(140);
|
|
284
|
+
expect(() => tuiRef.stop()).toThrow();
|
|
285
|
+
|
|
286
|
+
nestedHandle = tuiRef.showOverlay(listComponent(['nested'], () => {}), { anchor: 'top-left', width: 10 });
|
|
287
|
+
const nestedId = harness.opened().at(-1);
|
|
288
|
+
expect(harness.lastMeta(nestedId)).toMatchObject({ parentId, focused: true });
|
|
289
|
+
// Keys for the parent go to its focused nested overlay.
|
|
290
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId: parentId, items: ['\x1b[B'] })).toEqual({ accepted: true });
|
|
291
|
+
expect(harness.lastMeta(nestedId).focused).toBe(true);
|
|
292
|
+
|
|
293
|
+
nestedHandle.setHidden(true);
|
|
294
|
+
expect(harness.lastMeta(nestedId)).toMatchObject({ hidden: true, focused: false });
|
|
295
|
+
expect(handle.isFocused()).toBe(true);
|
|
296
|
+
|
|
297
|
+
handle.focus();
|
|
298
|
+
nestedHandle.hide();
|
|
299
|
+
expect(harness.events.at(-1)).toMatchObject({ event: 'extension.custom.dismiss', payload: { surfaceId: nestedId } });
|
|
300
|
+
|
|
301
|
+
harness.host.input({ sessionId: SESSION, surfaceId: parentId, items: ['\r'] });
|
|
302
|
+
await expect(result).resolves.toBe('a');
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('adopts overlays a factory shows before its own surface exists', async () => {
|
|
306
|
+
// Pi's /overlay-focus demo: the controller's constructor shows its panels.
|
|
307
|
+
const harness = createHarness();
|
|
308
|
+
const panelKeys = vi.fn();
|
|
309
|
+
const panelHandles = [];
|
|
310
|
+
const result = harness.host.open(SESSION, (tui, _theme, _kb, done) => {
|
|
311
|
+
for (const label of ['alpha', 'beta']) {
|
|
312
|
+
const panel = { render: () => [label], handleInput: panelKeys, invalidate: vi.fn(), dispose: vi.fn() };
|
|
313
|
+
panelHandles.push(tui.showOverlay(panel, { nonCapturing: true, anchor: 'top-left', width: 12 }));
|
|
314
|
+
}
|
|
315
|
+
return listComponent(['controller'], done);
|
|
316
|
+
}, { overlay: true });
|
|
317
|
+
await flushPromises();
|
|
318
|
+
const [alphaId, betaId, controllerId] = harness.opened();
|
|
319
|
+
expect(harness.lastMeta(alphaId)).toMatchObject({ parentId: controllerId });
|
|
320
|
+
expect(harness.lastMeta(betaId)).toMatchObject({ parentId: controllerId });
|
|
321
|
+
|
|
322
|
+
// Keys sent to the controller reach the panel it focused.
|
|
323
|
+
panelHandles[0].focus();
|
|
324
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId: controllerId, items: ['x'] })).toEqual({ accepted: true });
|
|
325
|
+
expect(panelKeys).toHaveBeenCalledWith('x');
|
|
326
|
+
|
|
327
|
+
// Ending the controller takes its panels along.
|
|
328
|
+
harness.host.close({ sessionId: SESSION, surfaceId: controllerId });
|
|
329
|
+
await expect(result).resolves.toBeUndefined();
|
|
330
|
+
const dismissed = harness.events.filter((entry) => entry.event === 'extension.custom.dismiss').map((entry) => entry.payload.surfaceId);
|
|
331
|
+
expect(dismissed).toEqual(expect.arrayContaining([alphaId, betaId, controllerId]));
|
|
332
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('focuses a panel picked in the browser tab stack, as handle.focus() would', async () => {
|
|
336
|
+
const harness = createHarness();
|
|
337
|
+
const keys = { alpha: vi.fn(), beta: vi.fn() };
|
|
338
|
+
const handles = {};
|
|
339
|
+
let controllerRenders = 0;
|
|
340
|
+
void harness.host.open(SESSION, (tui, _theme, _kb, done) => {
|
|
341
|
+
for (const label of ['alpha', 'beta']) {
|
|
342
|
+
const panel = { render: () => [label], handleInput: keys[label], invalidate: vi.fn() };
|
|
343
|
+
handles[label] = tui.showOverlay(panel, { nonCapturing: true, width: 12 });
|
|
344
|
+
}
|
|
345
|
+
return listComponent(['controller'], done, {
|
|
346
|
+
render: (width) => {
|
|
347
|
+
controllerRenders += 1;
|
|
348
|
+
return [`focus: ${handles.beta.isFocused() ? 'beta' : 'other'}`.padEnd(width).slice(0, width)];
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
}, { overlay: true });
|
|
352
|
+
await flushPromises();
|
|
353
|
+
const [alphaId, betaId, controllerId] = [...new Set(harness.opened())];
|
|
354
|
+
|
|
355
|
+
const before = controllerRenders;
|
|
356
|
+
expect(harness.host.focus({ sessionId: SESSION, surfaceId: betaId, clientId: 'desk' })).toEqual({ focused: true });
|
|
357
|
+
expect(handles.beta.isFocused()).toBe(true);
|
|
358
|
+
expect(harness.lastMeta(betaId)).toMatchObject({ focused: true });
|
|
359
|
+
expect(harness.lastMeta(betaId).z).toBeGreaterThan(harness.lastMeta(alphaId).z);
|
|
360
|
+
// The controller redraws, since it reads isFocused() while rendering.
|
|
361
|
+
await vi.advanceTimersByTimeAsync(50);
|
|
362
|
+
expect(controllerRenders).toBeGreaterThan(before);
|
|
363
|
+
harness.host.input({ sessionId: SESSION, surfaceId: controllerId, items: ['k'] });
|
|
364
|
+
expect(keys.beta).toHaveBeenCalledWith('k');
|
|
365
|
+
expect(keys.alpha).not.toHaveBeenCalled();
|
|
366
|
+
|
|
367
|
+
// Only nested panels are tabs; the command's own overlay is not.
|
|
368
|
+
expect(harness.host.focus({ sessionId: SESSION, surfaceId: controllerId })).toEqual({ focused: false });
|
|
369
|
+
handles.alpha.setHidden(true);
|
|
370
|
+
expect(harness.host.focus({ sessionId: SESSION, surfaceId: alphaId })).toEqual({ focused: false });
|
|
371
|
+
expect(harness.host.focus({ sessionId: SESSION, surfaceId: 'custom-missing' })).toEqual({ focused: false });
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
it('never lets a factory without a surface touch other overlays or leave its own behind', async () => {
|
|
375
|
+
const harness = createHarness();
|
|
376
|
+
void harness.host.open(SESSION, () => ({ render: () => ['other'], handleInput: vi.fn() }), { overlay: true });
|
|
377
|
+
await flushPromises();
|
|
378
|
+
const [otherId] = harness.opened();
|
|
379
|
+
|
|
380
|
+
// hideOverlay() from a constructor has nothing of its own to hide.
|
|
381
|
+
const failing = harness.host.open(SESSION, (tui) => {
|
|
382
|
+
tui.hideOverlay();
|
|
383
|
+
tui.showOverlay({ render: () => ['orphan'], invalidate: vi.fn() }, { width: 10 });
|
|
384
|
+
throw new Error('factory failed');
|
|
385
|
+
});
|
|
386
|
+
await expect(failing).rejects.toThrow('factory failed');
|
|
387
|
+
// Focus changes re-publish metadata, so take the last new id.
|
|
388
|
+
const orphanId = [...new Set(harness.opened())].at(-1);
|
|
389
|
+
const dismissed = harness.events.filter((entry) => entry.event === 'extension.custom.dismiss').map((entry) => entry.payload.surfaceId);
|
|
390
|
+
expect(dismissed).toEqual([orphanId]);
|
|
391
|
+
expect(orphanId).not.toBe(otherId);
|
|
392
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(true);
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
it('never shows an overlay a command opens after it ended', async () => {
|
|
396
|
+
// An extension may keep its tui and call showOverlay from a timer after
|
|
397
|
+
// done(). The overlay would point at a removed parent: unreachable, and
|
|
398
|
+
// focusing it walked a parent chain that never ends.
|
|
399
|
+
const harness = createHarness();
|
|
400
|
+
let tuiRef;
|
|
401
|
+
let finish;
|
|
402
|
+
const result = harness.host.open(SESSION, (tui, _theme, _kb, done) => {
|
|
403
|
+
tuiRef = tui;
|
|
404
|
+
finish = done;
|
|
405
|
+
return listComponent(['a'], done);
|
|
406
|
+
}, { overlay: true });
|
|
407
|
+
await flushPromises();
|
|
408
|
+
finish('a');
|
|
409
|
+
await expect(result).resolves.toBe('a');
|
|
410
|
+
const before = harness.opened().length;
|
|
411
|
+
|
|
412
|
+
const late = tuiRef.showOverlay({ render: () => ['late'], invalidate: vi.fn() }, { width: 10 });
|
|
413
|
+
expect(harness.opened()).toHaveLength(before);
|
|
414
|
+
expect(late.isFocused()).toBe(false);
|
|
415
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
416
|
+
|
|
417
|
+
// The same for a factory that called done() while it was constructing.
|
|
418
|
+
let early;
|
|
419
|
+
await harness.host.open(SESSION, (tui, _theme, _kb, done) => {
|
|
420
|
+
done('early');
|
|
421
|
+
early = tui;
|
|
422
|
+
return listComponent(['b'], done);
|
|
423
|
+
});
|
|
424
|
+
early.showOverlay({ render: () => ['late'], invalidate: vi.fn() }, { width: 10 });
|
|
425
|
+
expect(harness.opened()).toHaveLength(before);
|
|
426
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
it('lets one client drive the size: the last one that acted', async () => {
|
|
430
|
+
const harness = createHarness();
|
|
431
|
+
void harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['a'], done));
|
|
432
|
+
await flushPromises();
|
|
433
|
+
const [surfaceId] = harness.opened();
|
|
434
|
+
const { host } = harness;
|
|
435
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'desk', viewport: { columns: 120, rows: 40, screenColumns: 200 } });
|
|
436
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'phone', viewport: { columns: 44, rows: 30, screenColumns: 46 } });
|
|
437
|
+
vi.advanceTimersByTime(200);
|
|
438
|
+
expect(harness.frames(surfaceId).at(-1).payload.columns).toBe(120);
|
|
439
|
+
// Periodic reports from a non-driver change nothing.
|
|
440
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'phone', viewport: { columns: 45, rows: 30, screenColumns: 47 } });
|
|
441
|
+
vi.advanceTimersByTime(200);
|
|
442
|
+
expect(harness.frames(surfaceId).at(-1).payload.columns).toBe(120);
|
|
443
|
+
// Typing on the phone makes it the driver.
|
|
444
|
+
host.input({ sessionId: SESSION, surfaceId, clientId: 'phone', viewport: { columns: 44, rows: 30, screenColumns: 46 }, items: ['\x1b[B'] });
|
|
445
|
+
vi.advanceTimersByTime(200);
|
|
446
|
+
const frame = harness.frames(surfaceId).at(-1).payload;
|
|
447
|
+
expect(frame.columns).toBe(44);
|
|
448
|
+
expect(frame.lines).toBeDefined();
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
it('gives the size to the client whose prompt opened the surface', async () => {
|
|
452
|
+
let opener;
|
|
453
|
+
const harness = createHarness({ openerClientFor: () => opener });
|
|
454
|
+
const { host } = harness;
|
|
455
|
+
// Earlier surface: the desktop drives.
|
|
456
|
+
opener = 'desk';
|
|
457
|
+
void host.open(SESSION, (_t, _th, _kb, done) => listComponent(['a'], done));
|
|
458
|
+
await flushPromises();
|
|
459
|
+
const [first] = harness.opened();
|
|
460
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'desk', viewport: { columns: 120, rows: 40, screenColumns: 200 } });
|
|
461
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'phone', viewport: { columns: 44, rows: 30, screenColumns: 46 } });
|
|
462
|
+
vi.advanceTimersByTime(200);
|
|
463
|
+
expect(harness.frames(first).at(-1).payload.columns).toBe(120);
|
|
464
|
+
host.close({ sessionId: SESSION, surfaceId: first, clientId: 'desk' });
|
|
465
|
+
|
|
466
|
+
// The phone sent the next prompt: its surface is drawn at the phone's size.
|
|
467
|
+
opener = 'phone';
|
|
468
|
+
void host.open(SESSION, (_t, _th, _kb, done) => listComponent(['b'], done));
|
|
469
|
+
await flushPromises();
|
|
470
|
+
const second = harness.opened().at(-1);
|
|
471
|
+
vi.advanceTimersByTime(200);
|
|
472
|
+
expect(harness.frames(second).at(-1).payload.columns).toBe(44);
|
|
473
|
+
|
|
474
|
+
// An opener that has not reported yet takes over on its first report,
|
|
475
|
+
// even after another client reported first.
|
|
476
|
+
host.close({ sessionId: SESSION, surfaceId: second, clientId: 'phone' });
|
|
477
|
+
opener = 'tablet';
|
|
478
|
+
void host.open(SESSION, (_t, _th, _kb, done) => listComponent(['c'], done));
|
|
479
|
+
await flushPromises();
|
|
480
|
+
const third = harness.opened().at(-1);
|
|
481
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'desk', viewport: { columns: 120, rows: 40, screenColumns: 200 } });
|
|
482
|
+
host.reportViewport({ sessionId: SESSION, clientId: 'tablet', viewport: { columns: 80, rows: 30, screenColumns: 90 } });
|
|
483
|
+
vi.advanceTimersByTime(200);
|
|
484
|
+
expect(harness.frames(third).at(-1).payload.columns).toBe(80);
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
it('never lets a throwing overlayOptions() escape into a timer', async () => {
|
|
488
|
+
const harness = createHarness();
|
|
489
|
+
let broken = false;
|
|
490
|
+
void harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['a', 'b'], done), {
|
|
491
|
+
overlay: true,
|
|
492
|
+
overlayOptions: () => {
|
|
493
|
+
if (broken) throw new Error('options boom');
|
|
494
|
+
return { anchor: 'center', width: 30 };
|
|
495
|
+
},
|
|
496
|
+
});
|
|
497
|
+
await flushPromises();
|
|
498
|
+
const [surfaceId] = harness.opened();
|
|
499
|
+
broken = true;
|
|
500
|
+
harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\x1b[B'] });
|
|
501
|
+
expect(() => vi.advanceTimersByTime(40)).not.toThrow();
|
|
502
|
+
harness.host.reportViewport({ sessionId: SESSION, clientId: 'a', viewport: { columns: 60, rows: 30, screenColumns: 80 }, claim: true });
|
|
503
|
+
expect(() => vi.advanceTimersByTime(200)).not.toThrow();
|
|
504
|
+
// The last options it returned still place the overlay.
|
|
505
|
+
expect(harness.frames(surfaceId).at(-1).payload.layout.width).toBe(30);
|
|
506
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(true);
|
|
507
|
+
expect(harness.errors.filter((error) => error.stage === 'overlayOptions')).toHaveLength(1);
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
it('keeps a surface whose options throw from the second call open and closable', async () => {
|
|
511
|
+
const harness = createHarness();
|
|
512
|
+
let calls = 0;
|
|
513
|
+
const result = harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['a'], done), {
|
|
514
|
+
overlay: true,
|
|
515
|
+
overlayOptions: () => {
|
|
516
|
+
calls += 1;
|
|
517
|
+
if (calls > 1) throw new Error('second call');
|
|
518
|
+
return { width: 20 };
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
await flushPromises();
|
|
522
|
+
const [surfaceId] = harness.opened();
|
|
523
|
+
expect(calls).toBeGreaterThan(1);
|
|
524
|
+
expect(harness.frames(surfaceId).at(-1).payload.layout.width).toBe(20);
|
|
525
|
+
expect(harness.host.close({ sessionId: SESSION, surfaceId, clientId: 'a' })).toEqual({ closed: true });
|
|
526
|
+
await expect(result).resolves.toBeUndefined();
|
|
527
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
528
|
+
expect(harness.pending.map((entry) => entry.op)).toEqual(['open', 'close']);
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
it('rejects and cleans up when adding the first surface throws', async () => {
|
|
532
|
+
const harness = createHarness({
|
|
533
|
+
// Publishing the surface fails once: the surface is already in state.
|
|
534
|
+
publish: () => {
|
|
535
|
+
throw new Error('publish failed');
|
|
536
|
+
},
|
|
537
|
+
});
|
|
538
|
+
const result = harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['a'], done));
|
|
539
|
+
await expect(result).rejects.toThrow('publish failed');
|
|
540
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
541
|
+
expect(harness.pending.map((entry) => entry.op)).toEqual(['open', 'close']);
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
it('shows nothing when an async factory resolves after its session closed', async () => {
|
|
545
|
+
const harness = createHarness();
|
|
546
|
+
let release;
|
|
547
|
+
const component = listComponent(['a'], () => {});
|
|
548
|
+
const result = harness.host.open(SESSION, () => new Promise((resolve) => {
|
|
549
|
+
release = () => resolve(component);
|
|
550
|
+
}));
|
|
551
|
+
await flushPromises();
|
|
552
|
+
harness.host.clear(SESSION, 'session-closed');
|
|
553
|
+
release();
|
|
554
|
+
await expect(result).resolves.toBeUndefined();
|
|
555
|
+
expect(component.dispose).toHaveBeenCalled();
|
|
556
|
+
expect(harness.opened()).toEqual([]);
|
|
557
|
+
expect(harness.pending).toEqual([]);
|
|
558
|
+
expect(harness.host.hasOpenSurfaces(SESSION)).toBe(false);
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
it('routes SGR mouse reports as pi-tui events: press, click counts, drag, wheel', async () => {
|
|
562
|
+
const harness = createHarness();
|
|
563
|
+
const seen = [];
|
|
564
|
+
const handleInput = vi.fn();
|
|
565
|
+
void harness.host.open(SESSION, () => ({
|
|
566
|
+
render: (width) => ['one', 'two', 'three'].map((line) => line.padEnd(width).slice(0, width)),
|
|
567
|
+
handleInput,
|
|
568
|
+
handleMouse: (event) => {
|
|
569
|
+
seen.push(event);
|
|
570
|
+
return { handled: true };
|
|
571
|
+
},
|
|
572
|
+
}));
|
|
573
|
+
await flushPromises();
|
|
574
|
+
const [surfaceId] = harness.opened();
|
|
575
|
+
const send = (...items) => harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items });
|
|
576
|
+
const pick = (event) => [event.type, event.button, event.x, event.y, event.clickCount ?? event.wheelDelta];
|
|
577
|
+
|
|
578
|
+
// Press and release on one cell: release, then a click. Twice: count 2.
|
|
579
|
+
expect(send('\x1b[<0;3;2M', '\x1b[<0;3;2m')).toEqual({ accepted: true });
|
|
580
|
+
send('\x1b[<0;3;2M', '\x1b[<0;3;2m');
|
|
581
|
+
expect(seen.map(pick)).toEqual([
|
|
582
|
+
['press', 'left', 2, 1, undefined], ['release', 'left', 2, 1, undefined], ['click', 'left', 2, 1, 1],
|
|
583
|
+
['press', 'left', 2, 1, undefined], ['release', 'left', 2, 1, undefined], ['click', 'left', 2, 1, 2],
|
|
584
|
+
]);
|
|
585
|
+
// The event carries the size the component rendered at and modifiers.
|
|
586
|
+
expect(seen[0]).toMatchObject({ width: 100, height: 3, screenX: 2, screenY: 1, shift: false, alt: false, ctrl: false });
|
|
587
|
+
|
|
588
|
+
// A drag to another cell is no click.
|
|
589
|
+
seen.length = 0;
|
|
590
|
+
send('\x1b[<0;1;1M', '\x1b[<32;4;1M', '\x1b[<0;4;1m');
|
|
591
|
+
expect(seen.map(pick)).toEqual([['press', 'left', 0, 0, undefined], ['drag', 'left', 3, 0, undefined], ['release', 'left', 3, 0, undefined]]);
|
|
592
|
+
|
|
593
|
+
// Wheel steps, right button with Shift and Ctrl.
|
|
594
|
+
seen.length = 0;
|
|
595
|
+
send('\x1b[<65;2;3M', '\x1b[<64;2;3M', '\x1b[<22;1;1M');
|
|
596
|
+
expect(seen.map(pick)).toEqual([['wheel', 'none', 1, 2, 1], ['wheel', 'none', 1, 2, -1], ['press', 'right', 0, 0, undefined]]);
|
|
597
|
+
expect(seen[2]).toMatchObject({ shift: true, ctrl: true, alt: false });
|
|
598
|
+
|
|
599
|
+
// Mouse reports never reach handleInput, even malformed ones.
|
|
600
|
+
send('\x1b[<0;x;1M');
|
|
601
|
+
expect(handleInput).not.toHaveBeenCalled();
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
it('forwards clicks through a Pi Container to the child under the pointer', async () => {
|
|
605
|
+
const sdkEntry = fileURLToPath(import.meta.resolve('@earendil-works/pi-coding-agent'));
|
|
606
|
+
const requireFromSdk = createRequire(join(dirname(dirname(sdkEntry)), 'package.json'));
|
|
607
|
+
const { Container } = await import(pathToFileURL(requireFromSdk.resolve('@earendil-works/pi-tui')).href);
|
|
608
|
+
const harness = createHarness();
|
|
609
|
+
const hits = [];
|
|
610
|
+
const row = (name) => ({
|
|
611
|
+
render: (width) => [name.padEnd(width).slice(0, width)],
|
|
612
|
+
handleMouse: (event) => {
|
|
613
|
+
hits.push([name, event.type, event.y]);
|
|
614
|
+
return event.type === 'press' ? { focus: true } : { handled: true };
|
|
615
|
+
},
|
|
616
|
+
invalidate: () => {},
|
|
617
|
+
});
|
|
618
|
+
const result = harness.host.open(SESSION, (_tui, _theme, _kb, done) => {
|
|
619
|
+
const container = new Container();
|
|
620
|
+
container.addChild(row('first'));
|
|
621
|
+
container.addChild(row('second'));
|
|
622
|
+
container.handleInput = (data) => { if (data === '\r') done('picked'); };
|
|
623
|
+
return container;
|
|
624
|
+
});
|
|
625
|
+
await flushPromises();
|
|
626
|
+
const [surfaceId] = harness.opened();
|
|
627
|
+
harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\x1b[<0;2;2M', '\x1b[<0;2;2m'] });
|
|
628
|
+
// Local to the second child: its own row 0.
|
|
629
|
+
expect(hits).toEqual([['second', 'press', 0], ['second', 'release', 0], ['second', 'click', 0]]);
|
|
630
|
+
// Focus stays with the container that routes keys, as in Pi.
|
|
631
|
+
harness.host.input({ sessionId: SESSION, surfaceId, clientId: 'a', items: ['\r'] });
|
|
632
|
+
await expect(result).resolves.toBe('picked');
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
it('sends the mouse to non-capturing overlays and lets them take focus', async () => {
|
|
636
|
+
const harness = createHarness();
|
|
637
|
+
const seen = [];
|
|
638
|
+
void harness.host.open(SESSION, () => ({
|
|
639
|
+
render: () => ['ci passing'],
|
|
640
|
+
handleInput: vi.fn(),
|
|
641
|
+
handleMouse: (event) => {
|
|
642
|
+
seen.push(event.type);
|
|
643
|
+
return event.type === 'press' ? { focus: true } : undefined;
|
|
644
|
+
},
|
|
645
|
+
}), { overlay: true, overlayOptions: { nonCapturing: true, anchor: 'top-right', width: 20 } });
|
|
646
|
+
await flushPromises();
|
|
647
|
+
const [surfaceId] = harness.opened();
|
|
648
|
+
expect(harness.lastMeta(surfaceId)).toMatchObject({ focused: false });
|
|
649
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['\x1b[<0;1;1M'] })).toEqual({ accepted: true });
|
|
650
|
+
expect(seen).toEqual(['press']);
|
|
651
|
+
expect(harness.lastMeta(surfaceId)).toMatchObject({ focused: true });
|
|
652
|
+
// Focused, it takes keys, as Pi's TUI hands keys to the focused component.
|
|
653
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['x'] })).toEqual({ accepted: true });
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
it('gives keys to a non-capturing overlay only while it holds focus', async () => {
|
|
657
|
+
const harness = createHarness();
|
|
658
|
+
const keys = vi.fn();
|
|
659
|
+
let handle;
|
|
660
|
+
void harness.host.open(SESSION, () => ({ render: () => ['side chat'], handleInput: keys }), {
|
|
661
|
+
overlay: true,
|
|
662
|
+
overlayOptions: { nonCapturing: true, anchor: 'top-center', width: 30 },
|
|
663
|
+
// pi-btw's pattern: a non-capturing modal that focuses itself.
|
|
664
|
+
onHandle: (value) => {
|
|
665
|
+
handle = value;
|
|
666
|
+
value.focus();
|
|
667
|
+
},
|
|
668
|
+
});
|
|
669
|
+
await flushPromises();
|
|
670
|
+
const [surfaceId] = harness.opened();
|
|
671
|
+
expect(harness.lastMeta(surfaceId)).toMatchObject({ capturing: false, focused: true });
|
|
672
|
+
expect(harness.pending).toEqual([]);
|
|
673
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['h', 'i'] })).toEqual({ accepted: true });
|
|
674
|
+
expect(keys.mock.calls).toEqual([['h'], ['i']]);
|
|
675
|
+
|
|
676
|
+
handle.unfocus();
|
|
677
|
+
expect(harness.lastMeta(surfaceId).focused).toBe(false);
|
|
678
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId, items: ['x'] })).toEqual({ accepted: true, delivered: false });
|
|
679
|
+
expect(keys).toHaveBeenCalledTimes(2);
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
it('gives focus to a non-capturing overlay that takes keys when pressed', async () => {
|
|
683
|
+
const harness = createHarness();
|
|
684
|
+
const keys = vi.fn();
|
|
685
|
+
void harness.host.open(SESSION, () => ({ render: () => ['side chat'], handleInput: keys }), {
|
|
686
|
+
overlay: true,
|
|
687
|
+
overlayOptions: { nonCapturing: true, anchor: 'top-center', width: 30 },
|
|
688
|
+
});
|
|
689
|
+
void harness.host.open(SESSION, () => ({ render: () => ['ci passing'] }), {
|
|
690
|
+
overlay: true,
|
|
691
|
+
overlayOptions: { nonCapturing: true, anchor: 'top-right', width: 20 },
|
|
692
|
+
});
|
|
693
|
+
await flushPromises();
|
|
694
|
+
const [chatId, panelId] = harness.opened();
|
|
695
|
+
expect(harness.lastMeta(chatId).focused).toBe(false);
|
|
696
|
+
// A view-only panel has no keys to take, so a press leaves focus alone.
|
|
697
|
+
harness.host.input({ sessionId: SESSION, surfaceId: panelId, items: ['\x1b[<0;1;1M', '\x1b[<0;1;1m'] });
|
|
698
|
+
expect(harness.lastMeta(panelId).focused).toBe(false);
|
|
699
|
+
harness.host.input({ sessionId: SESSION, surfaceId: chatId, items: ['\x1b[<0;2;1M', '\x1b[<0;2;1m'] });
|
|
700
|
+
expect(harness.lastMeta(chatId).focused).toBe(true);
|
|
701
|
+
expect(harness.host.input({ sessionId: SESSION, surfaceId: chatId, items: ['a'] })).toEqual({ accepted: true });
|
|
702
|
+
expect(keys).toHaveBeenCalledWith('a');
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
it('caps a long line without leaving half an escape sequence', async () => {
|
|
706
|
+
const harness = createHarness();
|
|
707
|
+
// pi-doom's half blocks: 24-bit foreground and background on every cell.
|
|
708
|
+
const cell = (index) => `\x1b[38;2;${index % 256};12;34m\x1b[48;2;56;${index % 256};78m\u2580`;
|
|
709
|
+
const line = Array.from({ length: 600 }, (_value, index) => cell(index)).join('') + '\x1b[0m';
|
|
710
|
+
void harness.host.open(SESSION, () => ({ render: () => [line] }));
|
|
711
|
+
await flushPromises();
|
|
712
|
+
const [surfaceId] = harness.opened();
|
|
713
|
+
const [shown] = harness.frames(surfaceId)[0].payload.lines;
|
|
714
|
+
expect(line.length).toBeGreaterThan(MAX_CUSTOM_LINE_CHARS);
|
|
715
|
+
expect(shown.length).toBeLessThanOrEqual(MAX_CUSTOM_LINE_CHARS);
|
|
716
|
+
expect(line.startsWith(shown)).toBe(true);
|
|
717
|
+
// The cut lands between sequences: what is left is whole cells.
|
|
718
|
+
expect(shown.endsWith('\u2580') || shown.endsWith('m')).toBe(true);
|
|
719
|
+
expect(shown.replace(/\x1b\[[0-9;]*m/g, '')).toMatch(/^\u2580+$/);
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
it('keeps a batch of keys with the surface it was sent to', async () => {
|
|
723
|
+
const harness = createHarness();
|
|
724
|
+
const below = vi.fn();
|
|
725
|
+
void harness.host.open(SESSION, () => ({ render: () => ['below'], handleInput: below }));
|
|
726
|
+
await flushPromises();
|
|
727
|
+
const confirm = harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(['Yes'], done));
|
|
728
|
+
await flushPromises();
|
|
729
|
+
const top = harness.opened().at(-1);
|
|
730
|
+
// Enter confirms and closes the top surface; the keys after it must not
|
|
731
|
+
// land in the surface below.
|
|
732
|
+
harness.host.input({ sessionId: SESSION, surfaceId: top, clientId: 'a', items: ['\r', 'x', 'y'] });
|
|
733
|
+
await expect(confirm).resolves.toBe('Yes');
|
|
734
|
+
expect(below).not.toHaveBeenCalled();
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
it('snapshots and keyframes carry full frames that survive public projection', async () => {
|
|
738
|
+
const harness = createHarness();
|
|
739
|
+
void harness.host.open(SESSION, (_t, _th, _kb, done) => listComponent(DATABASES, done));
|
|
740
|
+
await flushPromises();
|
|
741
|
+
const [surfaceId] = harness.opened();
|
|
742
|
+
harness.host.input({ sessionId: SESSION, surfaceId, items: ['\x1b[B'] });
|
|
743
|
+
vi.advanceTimersByTime(40);
|
|
744
|
+
const snapshot = harness.host.snapshot(SESSION);
|
|
745
|
+
expect(snapshot).toHaveLength(1);
|
|
746
|
+
expect(snapshot[0].frame.version).toBe(2);
|
|
747
|
+
const projected = projectCustomSurfaces(snapshot);
|
|
748
|
+
expect(projected[0].frame.lines).toEqual(snapshot[0].frame.lines);
|
|
749
|
+
expect(projected[0]).toMatchObject({ surfaceId, mode: 'inline', focused: true });
|
|
750
|
+
const keyframes = harness.host.keyframes(SESSION);
|
|
751
|
+
expect(keyframes).toHaveLength(1);
|
|
752
|
+
expect(projectCustomFrame(keyframes[0].payload)?.lines).toHaveLength(6);
|
|
753
|
+
expect(harness.host.snapshot('other')).toBeUndefined();
|
|
754
|
+
const patch = harness.frames(surfaceId).at(-1).payload;
|
|
755
|
+
expect(projectCustomFrame(patch)?.changes).toHaveLength(2);
|
|
756
|
+
expect(projectCustomFrame({ ...patch, base: patch.version })).toBeNull();
|
|
757
|
+
expect(projectCustomSurface({ surfaceId, mode: 'floating', z: 1 })).toBeNull();
|
|
758
|
+
});
|
|
759
|
+
});
|