@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,21 @@
|
|
|
1
|
+
// Pi 1.5.0 passes `keyText()` and `keyHint()` to tool renderers and message
|
|
2
|
+
// renderers (`KeybindingHints`). The daemon builds those contexts itself, so it
|
|
3
|
+
// supplies both functions here.
|
|
4
|
+
//
|
|
5
|
+
// Pi's keybindings are terminal shortcuts, and PiChamber binds none of them: a
|
|
6
|
+
// row expands on click, not with `ctrl+o`. So `keyText()` returns no key, and
|
|
7
|
+
// `keyHint()` returns only the description, styled `muted` as in Pi. A Pi hint
|
|
8
|
+
// such as `(40 more lines, ctrl+o to expand)` then reads
|
|
9
|
+
// `(40 more lines, to expand)`.
|
|
10
|
+
|
|
11
|
+
/** `KeybindingHints` for extension renderers. Neither function throws. */
|
|
12
|
+
export function createExtensionKeybindingHints({ theme } = {}) {
|
|
13
|
+
const keyText = () => '';
|
|
14
|
+
|
|
15
|
+
const keyHint = (_keybinding, description) => {
|
|
16
|
+
const text = String(description ?? '');
|
|
17
|
+
return typeof theme?.fg === 'function' ? theme.fg('muted', text) : text;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return { keyText, keyHint };
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { createExtensionKeybindingHints } from './extension-keybindings.js';
|
|
4
|
+
import { createExtensionTheme, THEME_COLORS } from './extension-theme.js';
|
|
5
|
+
|
|
6
|
+
describe('createExtensionKeybindingHints', () => {
|
|
7
|
+
it('returns no key for any keybinding id', () => {
|
|
8
|
+
const { keyText } = createExtensionKeybindingHints({ theme: createExtensionTheme() });
|
|
9
|
+
expect(keyText('app.tools.expand')).toBe('');
|
|
10
|
+
expect(keyText('tui.select.cancel')).toBe('');
|
|
11
|
+
expect(keyText('not.a.keybinding')).toBe('');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('returns only the description, styled muted, with no leading space', () => {
|
|
15
|
+
const theme = createExtensionTheme();
|
|
16
|
+
const { keyHint } = createExtensionKeybindingHints({ theme });
|
|
17
|
+
|
|
18
|
+
const hint = keyHint('app.tools.expand', 'to expand');
|
|
19
|
+
expect(hint).toBe(theme.fg('muted', 'to expand'));
|
|
20
|
+
expect(hint).toContain(`\x1b[38;2;1;1;${THEME_COLORS.indexOf('muted')}m`);
|
|
21
|
+
expect(hint.replace(/\x1b\[[0-9;]*m/g, '')).toBe('to expand');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('keeps a typical Pi hint readable', () => {
|
|
25
|
+
const theme = createExtensionTheme();
|
|
26
|
+
const { keyHint } = createExtensionKeybindingHints({ theme });
|
|
27
|
+
const line = `${theme.fg('muted', '... (40 more lines,')} ${keyHint('app.tools.expand', 'to expand')}${theme.fg('muted', ')')}`;
|
|
28
|
+
expect(line.replace(/\x1b\[[0-9;]*m/g, '')).toBe('... (40 more lines, to expand)');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('returns plain text without a theme and never throws on odd input', () => {
|
|
32
|
+
const { keyText, keyHint } = createExtensionKeybindingHints();
|
|
33
|
+
expect(keyHint('app.tools.expand', 'to expand')).toBe('to expand');
|
|
34
|
+
expect(keyHint(undefined, undefined)).toBe('');
|
|
35
|
+
expect(keyText(undefined)).toBe('');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createExtensionKeybindingHints } from './extension-keybindings.js';
|
|
1
2
|
import { renderComponentLines } from './extension-tool-render.js';
|
|
2
3
|
|
|
3
4
|
// Daemon-side rendering for `pi.registerMessageRenderer(customType, renderer)`.
|
|
4
5
|
// Mirrors the Pi terminal: the renderer is called with the full custom message,
|
|
5
|
-
// `{ expanded, outputPad: 0 }`, and the shared extension
|
|
6
|
-
// and once expanded. A throwing/missing renderer never
|
|
7
|
-
// caller publishes the message with text/details as
|
|
6
|
+
// `{ expanded, outputPad: 0, keyText, keyHint }`, and the shared extension
|
|
7
|
+
// theme, once collapsed and once expanded. A throwing/missing renderer never
|
|
8
|
+
// throws out of here; the caller publishes the message with text/details as
|
|
9
|
+
// usual.
|
|
8
10
|
export const createExtensionMessageRenderer = ({ theme, redactAttachmentPaths = (value) => value } = {}) => {
|
|
11
|
+
const { keyText, keyHint } = createExtensionKeybindingHints({ theme });
|
|
9
12
|
// Memoized per persisted entry object: one entry belongs to one history
|
|
10
13
|
// item, so its renderer input never varies. The owning session is part of
|
|
11
14
|
// the key so a session replacement re-renders instead of reusing stale lines.
|
|
@@ -25,7 +28,7 @@ export const createExtensionMessageRenderer = ({ theme, redactAttachmentPaths =
|
|
|
25
28
|
|
|
26
29
|
const renderSlot = (renderer, message, expanded) => {
|
|
27
30
|
try {
|
|
28
|
-
const component = renderer(message, { expanded, outputPad: 0 }, theme);
|
|
31
|
+
const component = renderer(message, { expanded, outputPad: 0, keyText, keyHint }, theme);
|
|
29
32
|
if (!component) return undefined;
|
|
30
33
|
const lines = renderComponentLines(component);
|
|
31
34
|
if (!lines || lines.length === 0) return undefined;
|
|
@@ -51,12 +51,24 @@ describe('extension-message-render', () => {
|
|
|
51
51
|
expect(render).toEqual({ message: ['short line'], messageExpanded: ['full line'] });
|
|
52
52
|
expect(fn).toHaveBeenCalledTimes(2);
|
|
53
53
|
expect(seen[0][0]).toBe(input);
|
|
54
|
-
expect(seen[0][1]).toEqual({ expanded: false, outputPad: 0 });
|
|
54
|
+
expect(seen[0][1]).toEqual({ expanded: false, outputPad: 0, keyText: expect.any(Function), keyHint: expect.any(Function) });
|
|
55
55
|
expect(seen[0][2]).toBe(theme);
|
|
56
|
-
expect(seen[1][1]).toEqual({ expanded: true, outputPad: 0 });
|
|
56
|
+
expect(seen[1][1]).toEqual({ expanded: true, outputPad: 0, keyText: expect.any(Function), keyHint: expect.any(Function) });
|
|
57
57
|
expect(widths).toEqual([TOOL_RENDER_WIDTH, TOOL_RENDER_WIDTH]);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
it('gives renderers key hints without terminal keys', () => {
|
|
61
|
+
const renderer = createExtensionMessageRenderer({ theme: { fg: (color, text) => `<${color}>${text}` } });
|
|
62
|
+
const fn = vi.fn((_msg, options) => componentReturning([
|
|
63
|
+
`[${options.keyText('app.tools.expand')}] ${options.keyHint('app.tools.expand', options.expanded ? 'to collapse' : 'to expand')}`,
|
|
64
|
+
]));
|
|
65
|
+
|
|
66
|
+
expect(renderer.renderMessage(sessionWith(fn), message())).toEqual({
|
|
67
|
+
message: ['[] <muted>to expand'],
|
|
68
|
+
messageExpanded: ['[] <muted>to collapse'],
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
60
72
|
it('trims trailing spaces and bounds line count and length', () => {
|
|
61
73
|
const renderer = createExtensionMessageRenderer({ theme });
|
|
62
74
|
const longLine = `${'x'.repeat(MAX_TOOL_RENDER_LINE_CHARS + 500)} `;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createExtensionKeybindingHints } from './extension-keybindings.js';
|
|
2
|
+
|
|
1
3
|
export const TOOL_RENDER_WIDTH = 100;
|
|
2
4
|
export const MAX_TOOL_RENDER_LINES = 200;
|
|
3
5
|
export const MAX_TOOL_RENDER_LINE_CHARS = 2000;
|
|
@@ -48,6 +50,7 @@ export function createExtensionToolRenderer({
|
|
|
48
50
|
} = {}) {
|
|
49
51
|
const entries = new Map();
|
|
50
52
|
const settledMemo = new WeakMap();
|
|
53
|
+
const { keyText, keyHint } = createExtensionKeybindingHints({ theme });
|
|
51
54
|
|
|
52
55
|
const renderCallSlot = (entry, definition, args, cwd) => {
|
|
53
56
|
if (typeof definition?.renderCall !== 'function') return undefined;
|
|
@@ -65,6 +68,8 @@ export function createExtensionToolRenderer({
|
|
|
65
68
|
expanded: false,
|
|
66
69
|
showImages: false,
|
|
67
70
|
isError: false,
|
|
71
|
+
keyText,
|
|
72
|
+
keyHint,
|
|
68
73
|
};
|
|
69
74
|
const component = definition.renderCall(args, theme, context);
|
|
70
75
|
if (entry.lastComponents) entry.lastComponents.call = component;
|
|
@@ -90,6 +95,8 @@ export function createExtensionToolRenderer({
|
|
|
90
95
|
expanded,
|
|
91
96
|
showImages: false,
|
|
92
97
|
isError,
|
|
98
|
+
keyText,
|
|
99
|
+
keyHint,
|
|
93
100
|
};
|
|
94
101
|
const component = definition.renderResult(result, { expanded, isPartial }, theme, context);
|
|
95
102
|
if (entry.lastComponents) entry.lastComponents[slot] = component;
|
|
@@ -167,6 +167,32 @@ describe('extension-tool-render', () => {
|
|
|
167
167
|
expect(capturedResultContext.isPartial).toBe(false);
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
+
it('gives renderCall and renderResult key hints without terminal keys', () => {
|
|
171
|
+
const theme = createExtensionTheme();
|
|
172
|
+
const renderer = createExtensionToolRenderer({ theme });
|
|
173
|
+
const strip = (lines) => lines?.map((line) => line.replace(/\x1b\[[0-9;]*m/g, ''));
|
|
174
|
+
|
|
175
|
+
const definition = {
|
|
176
|
+
renderCall: (_args, _th, ctx) => ({ render: () => [`call [${ctx.keyText('app.tools.expand')}]`] }),
|
|
177
|
+
renderResult: (_result, opts, _th, ctx) => ({
|
|
178
|
+
render: () => [ctx.keyHint('app.tools.expand', opts.expanded ? 'to collapse' : 'to expand')],
|
|
179
|
+
}),
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const render = renderer.renderSettled(definition, {
|
|
183
|
+
toolCallId: 't1',
|
|
184
|
+
args: {},
|
|
185
|
+
cwd: '/work',
|
|
186
|
+
result: { content: [] },
|
|
187
|
+
isError: false,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
expect(render.call).toEqual(['call []']);
|
|
191
|
+
expect(strip(render.result)).toEqual(['to expand']);
|
|
192
|
+
expect(strip(render.resultExpanded)).toEqual(['to collapse']);
|
|
193
|
+
expect(render.result[0]).toBe(theme.fg('muted', 'to expand'));
|
|
194
|
+
});
|
|
195
|
+
|
|
170
196
|
it('sanitizes line counts and line lengths', () => {
|
|
171
197
|
const renderer = createExtensionToolRenderer({ theme: createExtensionTheme() });
|
|
172
198
|
const longLine = 'x'.repeat(MAX_TOOL_RENDER_LINE_CHARS + 500);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Open requests: a URL something on the server machine asked PiChamber to
|
|
2
|
+
// show (see the `openUrl.publish` command). The daemon owns attribution
|
|
3
|
+
// because it owns sessions and their busy state; the PiChamber server owns
|
|
4
|
+
// intake and device delivery (lib/open-url).
|
|
5
|
+
|
|
6
|
+
export const OPEN_REQUEST_MAX_URL_LENGTH = 4096;
|
|
7
|
+
|
|
8
|
+
/** Returns the normalized http(s) URL, or null when the value is not one. */
|
|
9
|
+
export const normalizeOpenRequestUrl = (value) => {
|
|
10
|
+
if (typeof value !== 'string') return null;
|
|
11
|
+
const trimmed = value.trim();
|
|
12
|
+
if (trimmed.length === 0 || trimmed.length > OPEN_REQUEST_MAX_URL_LENGTH) return null;
|
|
13
|
+
let parsed;
|
|
14
|
+
try {
|
|
15
|
+
parsed = new URL(trimmed);
|
|
16
|
+
} catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') return null;
|
|
20
|
+
const normalized = parsed.toString();
|
|
21
|
+
return normalized.length > OPEN_REQUEST_MAX_URL_LENGTH ? null : normalized;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Decide which session an Open request belongs to.
|
|
26
|
+
*
|
|
27
|
+
* 1. `requestedSessionId`: the caller said which session (a bash command
|
|
28
|
+
* carries Pi's `PI_SESSION_ID`). Exact; used only when that session is
|
|
29
|
+
* resident in this daemon.
|
|
30
|
+
* 2. Otherwise, when exactly one resident session is busy, the request came
|
|
31
|
+
* from it: an in-process extension opening a page runs inside a turn,
|
|
32
|
+
* tool call, or slash command. This is the one deliberate fallback.
|
|
33
|
+
* 3. Otherwise nobody can tell. The request still needs a session to travel
|
|
34
|
+
* on the event stream, so it rides on the most recently active session
|
|
35
|
+
* with `attributed: false`.
|
|
36
|
+
*
|
|
37
|
+
* `residents` are `{ sessionId, directory, busy }` rows. Returns
|
|
38
|
+
* `{ sessionId, directory, attributed }` or null when no session exists.
|
|
39
|
+
*/
|
|
40
|
+
export const resolveOpenRequestSession = ({ requestedSessionId, residents, recent }) => {
|
|
41
|
+
const rows = Array.isArray(residents) ? residents.filter((row) => (
|
|
42
|
+
row && typeof row.sessionId === 'string' && row.sessionId.length > 0
|
|
43
|
+
&& typeof row.directory === 'string' && row.directory.length > 0
|
|
44
|
+
)) : [];
|
|
45
|
+
|
|
46
|
+
if (typeof requestedSessionId === 'string' && requestedSessionId.length > 0) {
|
|
47
|
+
const match = rows.find((row) => row.sessionId === requestedSessionId);
|
|
48
|
+
if (match) return { sessionId: match.sessionId, directory: match.directory, attributed: true };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const busy = rows.filter((row) => row.busy === true);
|
|
52
|
+
if (busy.length === 1) {
|
|
53
|
+
return { sessionId: busy[0].sessionId, directory: busy[0].directory, attributed: true };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const carrier = (recent && rows.find((row) => row.sessionId === recent.sessionId))
|
|
57
|
+
?? rows[0];
|
|
58
|
+
if (carrier) return { sessionId: carrier.sessionId, directory: carrier.directory, attributed: false };
|
|
59
|
+
return null;
|
|
60
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { normalizeOpenRequestUrl, OPEN_REQUEST_MAX_URL_LENGTH, resolveOpenRequestSession } from './open-request.js';
|
|
4
|
+
|
|
5
|
+
describe('normalizeOpenRequestUrl', () => {
|
|
6
|
+
it('accepts http(s) URLs and rejects everything else', () => {
|
|
7
|
+
expect(normalizeOpenRequestUrl(' http://localhost:3000/review ')).toBe('http://localhost:3000/review');
|
|
8
|
+
expect(normalizeOpenRequestUrl('https://example.com')).toBe('https://example.com/');
|
|
9
|
+
expect(normalizeOpenRequestUrl('file:///etc/passwd')).toBeNull();
|
|
10
|
+
expect(normalizeOpenRequestUrl('javascript:alert(1)')).toBeNull();
|
|
11
|
+
expect(normalizeOpenRequestUrl('/relative')).toBeNull();
|
|
12
|
+
expect(normalizeOpenRequestUrl(42)).toBeNull();
|
|
13
|
+
expect(normalizeOpenRequestUrl(`http://a.test/${'x'.repeat(OPEN_REQUEST_MAX_URL_LENGTH)}`)).toBeNull();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('resolveOpenRequestSession', () => {
|
|
18
|
+
const residents = [
|
|
19
|
+
{ sessionId: 'a', directory: '/repo/a', busy: false },
|
|
20
|
+
{ sessionId: 'b', directory: '/repo/b', busy: true },
|
|
21
|
+
{ sessionId: 'c', directory: '/repo/c', busy: false },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
it('uses the requested session when it is resident', () => {
|
|
25
|
+
expect(resolveOpenRequestSession({ requestedSessionId: 'c', residents })).toEqual({
|
|
26
|
+
sessionId: 'c', directory: '/repo/c', attributed: true,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('falls back to the sole busy session when the requested one is unknown', () => {
|
|
31
|
+
expect(resolveOpenRequestSession({ requestedSessionId: 'gone', residents })).toEqual({
|
|
32
|
+
sessionId: 'b', directory: '/repo/b', attributed: true,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('rides on the most recent session, unattributed, when several are busy', () => {
|
|
37
|
+
const allBusy = residents.map((row) => ({ ...row, busy: true }));
|
|
38
|
+
expect(resolveOpenRequestSession({ residents: allBusy, recent: { sessionId: 'c' } })).toEqual({
|
|
39
|
+
sessionId: 'c', directory: '/repo/c', attributed: false,
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('rides on the first resident when nothing is busy or recent', () => {
|
|
44
|
+
const idle = residents.map((row) => ({ ...row, busy: false }));
|
|
45
|
+
expect(resolveOpenRequestSession({ residents: idle, recent: { sessionId: 'missing' } })).toEqual({
|
|
46
|
+
sessionId: 'a', directory: '/repo/a', attributed: false,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('returns null with no resident sessions', () => {
|
|
51
|
+
expect(resolveOpenRequestSession({ residents: [] })).toBeNull();
|
|
52
|
+
expect(resolveOpenRequestSession({ requestedSessionId: 'a', residents: undefined })).toBeNull();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -322,6 +322,140 @@ describe('prompt preflight acceptance', () => {
|
|
|
322
322
|
finishSlash();
|
|
323
323
|
});
|
|
324
324
|
|
|
325
|
+
it('accepts a registered extension command before its handler returns', async () => {
|
|
326
|
+
const { session } = await startDaemonWithSession();
|
|
327
|
+
session.extensionRunner = { getRegisteredCommands: () => [{ invocationName: 'panel' }] };
|
|
328
|
+
let finishCommand;
|
|
329
|
+
const commandGate = new Promise((resolve) => { finishCommand = resolve; });
|
|
330
|
+
session.promptImpl = async (_text, options) => {
|
|
331
|
+
// Pi runs the handler (here: waiting on a custom() surface) and only
|
|
332
|
+
// then reports `handled`.
|
|
333
|
+
await commandGate;
|
|
334
|
+
options?.preflightResult?.('handled');
|
|
335
|
+
};
|
|
336
|
+
const response = await client.request('sessions.prompt', {
|
|
337
|
+
sessionId: 'session-1',
|
|
338
|
+
text: '/panel',
|
|
339
|
+
messageId: 'msg-panel',
|
|
340
|
+
});
|
|
341
|
+
expect(response.result).toEqual({ accepted: true, messageId: 'msg-panel' });
|
|
342
|
+
finishCommand();
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it('keeps the session busy while a command runs and holds new input, as Pi does', async () => {
|
|
346
|
+
const { session } = await startDaemonWithSession();
|
|
347
|
+
session.extensionRunner = { getRegisteredCommands: () => [{ invocationName: 'panel' }] };
|
|
348
|
+
let finishCommand;
|
|
349
|
+
const commandGate = new Promise((resolve) => { finishCommand = resolve; });
|
|
350
|
+
session.promptImpl = async (text, options) => {
|
|
351
|
+
if (text !== '/panel') return;
|
|
352
|
+
await commandGate;
|
|
353
|
+
options?.preflightResult?.('handled');
|
|
354
|
+
};
|
|
355
|
+
const busy = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.state === 'busy');
|
|
356
|
+
await client.request('sessions.prompt', { sessionId: 'session-1', text: '/panel', messageId: 'msg-panel' });
|
|
357
|
+
await expect(busy).resolves.toMatchObject({ payload: { state: 'busy', command: '/panel' } });
|
|
358
|
+
|
|
359
|
+
// Neither a prompt nor a steer may start a second run behind the command.
|
|
360
|
+
// (A request error ends that connection, so each uses its own.)
|
|
361
|
+
await expect(send('sessions.prompt', { sessionId: 'session-1', text: 'hello', messageId: 'msg-hello' }))
|
|
362
|
+
.rejects.toMatchObject({ code: 'SESSION_BUSY' });
|
|
363
|
+
await expect(send('sessions.steer', { sessionId: 'session-1', text: 'hello', messageId: 'msg-steer' }))
|
|
364
|
+
.rejects.toMatchObject({ code: 'SESSION_BUSY' });
|
|
365
|
+
expect(session.promptCalls.map((call) => call.text)).toEqual(['/panel']);
|
|
366
|
+
|
|
367
|
+
const idle = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.state === 'idle');
|
|
368
|
+
finishCommand();
|
|
369
|
+
await expect(idle).resolves.toMatchObject({ payload: { state: 'idle' } });
|
|
370
|
+
await expect(client.request('sessions.prompt', { sessionId: 'session-1', text: 'hello', messageId: 'msg-after' }))
|
|
371
|
+
.resolves.toMatchObject({ result: { accepted: true } });
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
it('ends a command run when the command returns after the turn it started', async () => {
|
|
375
|
+
const { session } = await startDaemonWithSession();
|
|
376
|
+
session.extensionRunner = { getRegisteredCommands: () => [{ invocationName: 'panel' }] };
|
|
377
|
+
let finishCommand;
|
|
378
|
+
const commandGate = new Promise((resolve) => { finishCommand = resolve; });
|
|
379
|
+
session.promptImpl = async (text, options) => {
|
|
380
|
+
if (text !== '/panel') {
|
|
381
|
+
// A steer into the command's turn queues behind it.
|
|
382
|
+
options?.preflightResult?.('queued');
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
// pi.sendUserMessage(): the command starts an agent turn, then keeps
|
|
386
|
+
// running after it (waitForIdle, a surface, its own work).
|
|
387
|
+
session.isStreaming = true;
|
|
388
|
+
session.emit({ type: 'agent_start' });
|
|
389
|
+
await commandGate;
|
|
390
|
+
options?.preflightResult?.('handled');
|
|
391
|
+
};
|
|
392
|
+
const commandBusy = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.command === '/panel');
|
|
393
|
+
await client.request('sessions.prompt', { sessionId: 'session-1', text: '/panel', messageId: 'msg-panel' });
|
|
394
|
+
// The turn streams, so the command does not mark the session as held.
|
|
395
|
+
await expect(send('sessions.steer', { sessionId: 'session-1', text: 'steer', messageId: 'msg-steer' }))
|
|
396
|
+
.resolves.toMatchObject({ result: { accepted: true } });
|
|
397
|
+
|
|
398
|
+
// The turn ends while the command still runs: busy with the command again.
|
|
399
|
+
const heldAgain = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.command === '/panel');
|
|
400
|
+
session.isStreaming = false;
|
|
401
|
+
session.emit({ type: 'agent_settled' });
|
|
402
|
+
await expect(heldAgain).resolves.toMatchObject({ payload: { state: 'busy', command: '/panel' } });
|
|
403
|
+
await commandBusy.catch(() => {});
|
|
404
|
+
|
|
405
|
+
// The command returning is what ends the run, whatever the send generation.
|
|
406
|
+
const idle = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.state === 'idle');
|
|
407
|
+
finishCommand();
|
|
408
|
+
await expect(idle).resolves.toMatchObject({ payload: { state: 'idle' } });
|
|
409
|
+
await expect(client.request('sessions.prompt', { sessionId: 'session-1', text: 'after', messageId: 'msg-after' }))
|
|
410
|
+
.resolves.toMatchObject({ result: { accepted: true } });
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
it('detects commands the way Pi does: case-sensitive, from the first character', async () => {
|
|
414
|
+
const { session } = await startDaemonWithSession();
|
|
415
|
+
session.extensionRunner = { getRegisteredCommands: () => [{ invocationName: 'panel' }] };
|
|
416
|
+
const pending = [];
|
|
417
|
+
session.promptImpl = async (_text, options) => {
|
|
418
|
+
// Pi runs these as ordinary prompts: accepted, still running.
|
|
419
|
+
options?.preflightResult?.('started');
|
|
420
|
+
await new Promise((resolve) => pending.push(resolve));
|
|
421
|
+
};
|
|
422
|
+
const lifecycle = [];
|
|
423
|
+
client.next((frame) => {
|
|
424
|
+
if (frame.event === 'session.lifecycle') lifecycle.push(frame.payload);
|
|
425
|
+
return false;
|
|
426
|
+
}).catch(() => {});
|
|
427
|
+
for (const text of ['/Panel', ' /panel', '/panelx']) {
|
|
428
|
+
await expect(send('sessions.prompt', { sessionId: 'session-1', text, messageId: `msg-${text.trim()}` }))
|
|
429
|
+
.resolves.toMatchObject({ result: { accepted: true } });
|
|
430
|
+
}
|
|
431
|
+
expect(lifecycle.some((payload) => payload.command)).toBe(false);
|
|
432
|
+
for (const resolve of pending) resolve();
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
it('holds shell commands and compaction while a command runs', async () => {
|
|
436
|
+
const { session } = await startDaemonWithSession();
|
|
437
|
+
session.extensionRunner = { getRegisteredCommands: () => [{ invocationName: 'panel' }] };
|
|
438
|
+
session.compact = async () => {};
|
|
439
|
+
let finishCommand;
|
|
440
|
+
const commandGate = new Promise((resolve) => { finishCommand = resolve; });
|
|
441
|
+
session.promptImpl = async (text, options) => {
|
|
442
|
+
await commandGate;
|
|
443
|
+
options?.preflightResult?.('handled');
|
|
444
|
+
};
|
|
445
|
+
const busy = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.command === '/panel');
|
|
446
|
+
await client.request('sessions.prompt', { sessionId: 'session-1', text: '/panel', messageId: 'msg-panel' });
|
|
447
|
+
await busy;
|
|
448
|
+
await expect(send('sessions.bash', { sessionId: 'session-1', command: 'echo hi' }))
|
|
449
|
+
.rejects.toMatchObject({ code: 'SESSION_BUSY' });
|
|
450
|
+
await expect(send('sessions.compact', { sessionId: 'session-1' }))
|
|
451
|
+
.rejects.toMatchObject({ code: 'SESSION_BUSY' });
|
|
452
|
+
const idle = client.next((frame) => frame.event === 'session.lifecycle' && frame.payload?.state === 'idle');
|
|
453
|
+
finishCommand();
|
|
454
|
+
await idle;
|
|
455
|
+
await expect(send('sessions.compact', { sessionId: 'session-1' }))
|
|
456
|
+
.resolves.toMatchObject({ result: { accepted: true } });
|
|
457
|
+
});
|
|
458
|
+
|
|
325
459
|
it('queued attachment metadata survives prompt resolution until the actual user start', async () => {
|
|
326
460
|
const { session, root } = await startDaemonWithSession();
|
|
327
461
|
const imageFile = join(root, 'queued.png');
|
|
@@ -54,16 +54,18 @@ describe('pinned SDK upgrade compatibility', () => {
|
|
|
54
54
|
};
|
|
55
55
|
const baseline = await ModelRuntime.create(options);
|
|
56
56
|
expect(baseline.getModel('opencode', 'deepseek-v4-flash-free')).toBeUndefined();
|
|
57
|
-
|
|
57
|
+
// 1.5.0 (models.dev v2) replaces deepseek-v4-flash with deepseek-v4.1-flash.
|
|
58
|
+
expect(baseline.getModel('opencode', 'deepseek-v4-flash')).toBeUndefined();
|
|
59
|
+
const flash = baseline.getModel('opencode', 'deepseek-v4.1-flash');
|
|
58
60
|
expect(flash).toBeDefined();
|
|
59
61
|
const cached = { ...flash, id: 'upgrade-cached-model', name: 'Cached model' };
|
|
60
62
|
await writeFile(options.modelsStorePath, JSON.stringify({
|
|
61
63
|
opencode: { models: [cached], checkedAt: Date.now(), lastModified: Date.UTC(2030, 0, 1), etag: '"old-catalog"' },
|
|
62
64
|
}));
|
|
63
65
|
const customConfig = JSON.stringify({ providers: { opencode: {
|
|
64
|
-
baseUrl:
|
|
66
|
+
baseUrl: flash.baseUrl,
|
|
65
67
|
models: [{ id: 'upgrade-custom-model', name: 'My custom model', api: 'openai-completions', contextWindow: 8192, maxTokens: 1024 }],
|
|
66
|
-
modelOverrides: {
|
|
68
|
+
modelOverrides: { [flash.id]: { name: 'My Flash override' } },
|
|
67
69
|
} } });
|
|
68
70
|
await writeFile(options.modelsPath, customConfig);
|
|
69
71
|
const models = await ModelRuntime.create(options);
|
|
@@ -140,7 +142,8 @@ describe('pinned SDK upgrade compatibility', () => {
|
|
|
140
142
|
|
|
141
143
|
runtime = await createPiSessionRuntime({ cwd, agentDir, sessionFile });
|
|
142
144
|
expect(runtime.session.sessionId).toBe(sessionId);
|
|
143
|
-
|
|
145
|
+
// Both IDs are gone from the bundled catalog; the saved selection must not resurrect them.
|
|
146
|
+
expect(runtime.session.model?.id).not.toBe(modelId);
|
|
144
147
|
expect(runtime.session.messages.map((message) => message.content)).toEqual(['Existing question', [{ type: 'text', text: 'Existing answer' }]]);
|
|
145
148
|
const manager = runtime.session.sessionManager;
|
|
146
149
|
expect(manager.getSessionName()).toBe('Existing chat');
|
|
@@ -270,4 +273,18 @@ describe('pinned SDK upgrade compatibility', () => {
|
|
|
270
273
|
}
|
|
271
274
|
expect(getBuiltinExtensionFactories({})).toEqual([]);
|
|
272
275
|
});
|
|
276
|
+
|
|
277
|
+
it('keeps MCP sign-in from opening a browser on the daemon host', () => {
|
|
278
|
+
const calls = [];
|
|
279
|
+
const record = (name) => (...args) => { calls.push({ name, args }); return () => {}; };
|
|
280
|
+
getBuiltinExtensionFactories({
|
|
281
|
+
createCodemodeExtension: record('codemode'),
|
|
282
|
+
createToolSearchExtension: record('tool-search'),
|
|
283
|
+
createMcpExtension: record('mcp'),
|
|
284
|
+
});
|
|
285
|
+
expect(calls.map((call) => [call.name, call.args.length])).toEqual([['codemode', 0], ['tool-search', 0], ['mcp', 1]]);
|
|
286
|
+
const { openUrl } = calls[2].args[0];
|
|
287
|
+
expect(typeof openUrl).toBe('function');
|
|
288
|
+
expect(openUrl('https://auth.example/authorize')).toBeUndefined();
|
|
289
|
+
});
|
|
273
290
|
});
|