Compare commits

..
Author SHA1 Message Date
paseo-bot[bot] 41efe8548e fix(app): highlight single-line chat file citations
A single-line target collapsed the editor selection at the first column. Select the cited text while keeping the cursor at that column.
2026-12-02 12:31:45 +00:00
177 changed files with 1102 additions and 5898 deletions
-144
View File
@@ -1,149 +1,5 @@
# Changelog
## 0.19.0-beta.1 - 2026-12-02
- **Switch providers mid-chat:** Switch a chat to another provider and keep the conversation, with chat history now stored on the host. ([#11410](https://github.com/getpaseo/paseo/pull/11410))
- **Queue survives restarts:** Queued messages now live on the host, so they survive app reloads, device switches and daemon restarts. ([#11424](https://github.com/getpaseo/paseo/pull/11424), [#11566](https://github.com/getpaseo/paseo/pull/11566), [#11740](https://github.com/getpaseo/paseo/pull/11740))
- **One switch for agent tools:** Agent tools now sit behind one Enable tools setting with orchestration, schedules, PR watching and browser groups, and are on by default. ([#11189](https://github.com/getpaseo/paseo/pull/11189))
- **Connected devices list:** Settings → Devices now shows which clients and hosts are connected and what each one can access. ([#11209](https://github.com/getpaseo/paseo/pull/11209))
- **Plugin scorecards:** Plugin pages in the app and on paseo.sh show a scorecard, update history, related plugins and sponsor links. ([#11563](https://github.com/getpaseo/paseo/pull/11563), [#11674](https://github.com/getpaseo/paseo/pull/11674), [#11691](https://github.com/getpaseo/paseo/pull/11691))
- **Share services through tunnels:** Share a running workspace service at a public URL from the Scripts menu, and dev servers keep their live-reload connections. Services now open at `localhost:<port>`, and `*.localhost` service URLs are removed. ([#11490](https://github.com/getpaseo/paseo/pull/11490))
- **Lower CPU while agents run:** Running agents use far less CPU, GPU and battery, with lighter status rings, loaders and tool-call animations. ([#11456](https://github.com/getpaseo/paseo/pull/11456), [#11474](https://github.com/getpaseo/paseo/pull/11474), [#11564](https://github.com/getpaseo/paseo/pull/11564), [#11586](https://github.com/getpaseo/paseo/pull/11586), [#11591](https://github.com/getpaseo/paseo/pull/11591) by [@djbclark](https://github.com/djbclark), [@luoph](https://github.com/luoph), [@mariotaku](https://github.com/mariotaku))
- **Steadier streaming replies:** Streaming replies show their final formatting as they arrive, and long replies no longer get slower to render as they grow. ([#11572](https://github.com/getpaseo/paseo/pull/11572), [#11582](https://github.com/getpaseo/paseo/pull/11582) by [@luoph](https://github.com/luoph))
- **Faster mobile launch:** The mobile app shows your last workspace sooner after a cold launch, about 0.7 seconds on Android. ([#11390](https://github.com/getpaseo/paseo/pull/11390) by [@luoph](https://github.com/luoph), [@maci0](https://github.com/maci0))
- **Desktop browser profiles:** Desktop browser tabs can use separate colored profiles, so you can stay signed in to two accounts on one site. ([#10357](https://github.com/getpaseo/paseo/pull/10357) by [@clkao](https://github.com/clkao))
- **Swipe away the iOS keyboard:** Drag the chat down to hide the iOS keyboard, and chat controls now work on the first tap while it is open. ([#11625](https://github.com/getpaseo/paseo/pull/11625))
### Breaking
- Paseo CLI and daemon now require Node.js 22.16.0 or later ([#11410](https://github.com/getpaseo/paseo/pull/11410))
### Added
- Added Antigravity quota to Usage, refreshed only when you select Refresh ([#11585](https://github.com/getpaseo/paseo/pull/11585))
- Added conversation-only rewind for OpenCode v2 agents ([#11675](https://github.com/getpaseo/paseo/pull/11675))
- Added desktop browser tabs for workspaces on hosts connected through another host ([#11561](https://github.com/getpaseo/paseo/pull/11561))
- Added `paseo hub run` to start Hub manual triggers from the terminal ([#11408](https://github.com/getpaseo/paseo/pull/11408))
- Added Claude Enterprise monthly spend to the Usage card and sidebar summary ([#11514](https://github.com/getpaseo/paseo/pull/11514) by [@vivekkalyan](https://github.com/vivekkalyan))
- Added Spend credits amounts for Codex individual spend limits ([#11702](https://github.com/getpaseo/paseo/pull/11702) by [@vivekkalyan](https://github.com/vivekkalyan))
### Improved
- Opened chats faster by skipping Markdown preparation for replies without workspace links ([#11327](https://github.com/getpaseo/paseo/pull/11327))
- Reduced work on each workspace switch by updating Git actions only for the visible workspace ([#11332](https://github.com/getpaseo/paseo/pull/11332))
- Stopped the sidebar re-rendering on agent updates that change only token usage ([#11565](https://github.com/getpaseo/paseo/pull/11565) by [@jl97mcad](https://github.com/jl97mcad))
- Released hidden workspace composers after ten minutes during repeated workspace switches ([#11613](https://github.com/getpaseo/paseo/pull/11613) by [@js2me](https://github.com/js2me))
- Kept typing responsive in long multiline drafts ([#11418](https://github.com/getpaseo/paseo/pull/11418))
- Served the desktop app's web UI with Brotli and gzip compression instead of an uncompressed 25 MB bundle ([#10635](https://github.com/getpaseo/paseo/pull/10635) by [@djbclark](https://github.com/djbclark))
- Changed chat loading to one steady spinner that reveals the chat and composer together, without an Updating messages flash ([#11575](https://github.com/getpaseo/paseo/pull/11575))
- Kept the Restoring screen up until a restored workspace is ready ([#11486](https://github.com/getpaseo/paseo/pull/11486))
- Showed a spinner on a worktree row while archive checks for uncommitted changes ([#11519](https://github.com/getpaseo/paseo/pull/11519), [#11574](https://github.com/getpaseo/paseo/pull/11574) by [@cxroop](https://github.com/cxroop))
- Showed each host's icon with a status dot on host selectors ([#11568](https://github.com/getpaseo/paseo/pull/11568))
- Sent the prompt with hardware-keyboard Return on iPhone, as on iPad ([#11537](https://github.com/getpaseo/paseo/pull/11537))
- Replaced the Direct connection Advanced field with a Form and URI switch, so a pasted `tcp://` URI connects in one tap ([#11402](https://github.com/getpaseo/paseo/pull/11402) by [@thecardcheat](https://github.com/thecardcheat))
### Changed
- Changed archiving to keep a worktree that has uncommitted changes unless you confirm removal ([#11430](https://github.com/getpaseo/paseo/pull/11430))
- Changed closing a New Agent tab with an unsent draft to ask before discarding it ([#11660](https://github.com/getpaseo/paseo/pull/11660))
- Changed Cmd/Ctrl+click on a sidebar workspace to open it instead of entering select mode ([#11472](https://github.com/getpaseo/paseo/pull/11472))
- Changed agents that already reported to their caller with `send_agent_prompt` to skip the extra finished notice ([#11583](https://github.com/getpaseo/paseo/pull/11583))
### Fixed
- Fixed an attached image over 2000 px breaking every later turn in its chat ([#5119](https://github.com/getpaseo/paseo/pull/5119) by [@RUIIIOVO](https://github.com/RUIIIOVO))
- Fixed voice mode agents never speaking back when Paseo tools were off ([#11161](https://github.com/getpaseo/paseo/pull/11161))
- Fixed turning off voice mode without a daemon connection leaving the microphone on ([#11587](https://github.com/getpaseo/paseo/pull/11587) by [@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- Fixed the app taking up to a minute to reconnect after returning from the background ([#10348](https://github.com/getpaseo/paseo/pull/10348) by [@dongsun1](https://github.com/dongsun1))
- Fixed one failed WebSocket handshake doubling the reconnect delay ([#11428](https://github.com/getpaseo/paseo/pull/11428) by [@suniceman](https://github.com/suniceman))
- Fixed chats staying on Reconnecting after the app switched to a faster connection ([#11029](https://github.com/getpaseo/paseo/pull/11029) by [@tmhaha](https://github.com/tmhaha))
- Fixed Updating messages staying visible after reopening a cached chat ([#11464](https://github.com/getpaseo/paseo/pull/11464) by [@oyzh888](https://github.com/oyzh888))
- Fixed terminal output stopping after a reconnect reused its subscription ([#10433](https://github.com/getpaseo/paseo/pull/10433) by [@chirag127](https://github.com/chirag127))
- Fixed Files showing Host is not connected when the app launched before the host connected ([#11679](https://github.com/getpaseo/paseo/pull/11679))
- Fixed Created and Last prompt sorting disappearing while a host is offline ([#11728](https://github.com/getpaseo/paseo/pull/11728))
- Fixed iOS header taps scrolling the chat, Explorer or workspace list to the top ([#11262](https://github.com/getpaseo/paseo/pull/11262) by [@yzim](https://github.com/yzim))
- Fixed a file sheet dismissed while opening leaving an invisible backdrop that blocked taps ([#11317](https://github.com/getpaseo/paseo/pull/11317) by [@LiebeLee](https://github.com/LiebeLee))
- Fixed bottom sheets staying open when dismissed before their open animation started ([#11632](https://github.com/getpaseo/paseo/pull/11632))
- Fixed Android attaching nothing when the app was recreated during image selection ([#7734](https://github.com/getpaseo/paseo/pull/7734))
- Fixed pasting a file into the web composer inserting its path instead of attaching it ([#11718](https://github.com/getpaseo/paseo/pull/11718))
- Fixed Content font size not applying to existing user messages in web chat ([#11469](https://github.com/getpaseo/paseo/pull/11469) by [@bearyjd](https://github.com/bearyjd))
- Fixed `<br>` in a Markdown table cell splitting the table row ([#9587](https://github.com/getpaseo/paseo/pull/9587) by [@apple-ouyang](https://github.com/apple-ouyang))
- Fixed hidden chat rows shifting the reading position on web ([#11538](https://github.com/getpaseo/paseo/pull/11538) by [@kogekiplay](https://github.com/kogekiplay))
- Fixed a plugin slash command with an attachment being sent to the agent as a message ([#11483](https://github.com/getpaseo/paseo/pull/11483) by [@suniceman](https://github.com/suniceman))
- Fixed Archive finished subagents skipping closed subagents ([#10865](https://github.com/getpaseo/paseo/pull/10865) by [@sbhas2k](https://github.com/sbhas2k))
- Fixed Import Session missing the newest ACP sessions ([#10675](https://github.com/getpaseo/paseo/pull/10675))
- Fixed Import Session hiding the provider error while Retry runs ([#11654](https://github.com/getpaseo/paseo/pull/11654))
- Fixed setup dropping project suggestions from providers that answer after 60 seconds ([#11438](https://github.com/getpaseo/paseo/pull/11438) by [@suniceman](https://github.com/suniceman))
- Fixed Open in file manager showing for workspaces on remote hosts ([#11463](https://github.com/getpaseo/paseo/pull/11463) by [@sleroq](https://github.com/sleroq))
- Fixed Reveal in Finder for workspaces rooted at `/` ([#11206](https://github.com/getpaseo/paseo/pull/11206) by [@suniceman](https://github.com/suniceman))
- Fixed large HTML files previewing as a blank pane on desktop ([#11504](https://github.com/getpaseo/paseo/pull/11504))
- Fixed the Paseo RPM failing to install alongside other Electron RPMs ([#11354](https://github.com/getpaseo/paseo/pull/11354))
- Fixed Restart and close terminals leaving terminal programs running on Windows ([#11398](https://github.com/getpaseo/paseo/pull/11398))
- Fixed agent creation hanging behind provider checks for deleted worktrees ([#11646](https://github.com/getpaseo/paseo/pull/11646) by [@ralston](https://github.com/ralston))
- Fixed finished Claude subagents showing as running or canceled after reopening a chat or restarting the daemon ([#10848](https://github.com/getpaseo/paseo/pull/10848), [#11594](https://github.com/getpaseo/paseo/pull/11594), [#11602](https://github.com/getpaseo/paseo/pull/11602) by [@monarchmaisuriya](https://github.com/monarchmaisuriya), [@desmond-rai](https://github.com/desmond-rai))
- Fixed Claude agents started by Paseo missing Claude Code's chat titles ([#11057](https://github.com/getpaseo/paseo/pull/11057) by [@Zayooo00](https://github.com/Zayooo00))
- Fixed turns Claude starts on its own staying hidden in reopened chats until Reload ([#11405](https://github.com/getpaseo/paseo/pull/11405))
- Fixed Claude Code system notices being dropped from the chat ([#11419](https://github.com/getpaseo/paseo/pull/11419) by [@minamorl](https://github.com/minamorl))
- Fixed Claude Code's Goal set reply missing from imported chats ([#11733](https://github.com/getpaseo/paseo/pull/11733))
- Fixed listing commands in an archived Claude chat starting Claude Code ([#11521](https://github.com/getpaseo/paseo/pull/11521) by [@RawSalmon69](https://github.com/RawSalmon69))
- Fixed Stop failing on unresponsive Pi and OMP agents ([#11618](https://github.com/getpaseo/paseo/pull/11618) by [@LouisDeconinck](https://github.com/LouisDeconinck))
- Fixed Pi turns never finishing when an extension handles the prompt ([#10572](https://github.com/getpaseo/paseo/pull/10572) by [@jsilhan](https://github.com/jsilhan))
- Fixed Pi prompts timing out during extension preflight and then running anyway ([#11525](https://github.com/getpaseo/paseo/pull/11525) by [@Stelath](https://github.com/Stelath))
- Fixed Pi showing the prompt twice when an extension sends context before the reply ([#11533](https://github.com/getpaseo/paseo/pull/11533) by [@Stelath](https://github.com/Stelath))
- Fixed Pi chats skipping project skills and settings in trusted workspaces ([#11527](https://github.com/getpaseo/paseo/pull/11527) by [@patrick-motard](https://github.com/patrick-motard))
- Fixed new Pi agents failing with an old extension error after the conflict was fixed ([#11642](https://github.com/getpaseo/paseo/pull/11642))
- Fixed the OMP Fast toggle missing before the first prompt ([#11553](https://github.com/getpaseo/paseo/pull/11553))
- Fixed finished OMP form questions losing the question and chosen answer ([#11697](https://github.com/getpaseo/paseo/pull/11697), [#11706](https://github.com/getpaseo/paseo/pull/11706) by [@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- Fixed Codex sends reporting failure after 60 seconds while Codex was still starting ([#11547](https://github.com/getpaseo/paseo/pull/11547) by [@nonononull](https://github.com/nonononull))
- Fixed Codex features staying hidden behind a wrapper command such as `env codex` ([#11221](https://github.com/getpaseo/paseo/pull/11221) by [@suniceman](https://github.com/suniceman))
- Fixed answers to Codex async questions being rejected ([#11225](https://github.com/getpaseo/paseo/pull/11225) by [@suniceman](https://github.com/suniceman))
- Fixed reopening a Codex chat resetting its last-activity time ([#10760](https://github.com/getpaseo/paseo/pull/10760) by [@Juns-g](https://github.com/Juns-g))
- Fixed Antigravity subagent tool calls splitting streamed replies mid-word ([#11535](https://github.com/getpaseo/paseo/pull/11535) by [@Suhail](https://github.com/Suhail))
- Fixed Antigravity turns ending as completed after an internal executor error ([#10885](https://github.com/getpaseo/paseo/pull/10885) by [@vecyang1](https://github.com/vecyang1), [@luoph](https://github.com/luoph))
- Fixed ACP chats failing to reopen when the provider rejects the saved thinking level ([#10333](https://github.com/getpaseo/paseo/pull/10333))
- Fixed the ACP thinking picker keeping the old level after a mode change ([#11478](https://github.com/getpaseo/paseo/pull/11478) by [@suniceman](https://github.com/suniceman))
- Fixed ACP setting errors leaving out the provider's explanation ([#11431](https://github.com/getpaseo/paseo/pull/11431) by [@suniceman](https://github.com/suniceman))
- Fixed Muse usage losing token totals after a context update ([#11389](https://github.com/getpaseo/paseo/pull/11389) by [@suniceman](https://github.com/suniceman))
- Fixed the Claude Usage card staying rate limited for hours ([#11597](https://github.com/getpaseo/paseo/pull/11597))
- Fixed Claude Usage showing the old plan after a subscription change ([#11685](https://github.com/getpaseo/paseo/pull/11685) by [@matchy233](https://github.com/matchy233))
- Fixed Codex Usage showing 0 credits for accounts without a credit balance ([#11515](https://github.com/getpaseo/paseo/pull/11515) by [@vivekkalyan](https://github.com/vivekkalyan))
- Fixed Copilot Usage failing when the premium request quota is exceeded ([#11006](https://github.com/getpaseo/paseo/pull/11006) by [@nathanmcnulty](https://github.com/nathanmcnulty))
- Fixed Copilot Usage reading the token of another host or account from GitHub CLI ([#11689](https://github.com/getpaseo/paseo/pull/11689))
- Fixed Create PR from a fork opening the pull request on the fork instead of its parent ([#11436](https://github.com/getpaseo/paseo/pull/11436) by [@suniceman](https://github.com/suniceman))
- Fixed a fork pull request disappearing from its worktree workspace after the first push ([#11441](https://github.com/getpaseo/paseo/pull/11441) by [@suniceman](https://github.com/suniceman))
- Fixed Create PR returning the API URL instead of the pull request page ([#11439](https://github.com/getpaseo/paseo/pull/11439) by [@suniceman](https://github.com/suniceman))
- Fixed GitHub check details failing to load annotations ([#11476](https://github.com/getpaseo/paseo/pull/11476) by [@suniceman](https://github.com/suniceman))
- Fixed GitHub check details dropping annotations when a job log is unavailable ([#11509](https://github.com/getpaseo/paseo/pull/11509))
- Fixed Gitea and Forgejo draft pull requests showing as open and conflicting ([#11545](https://github.com/getpaseo/paseo/pull/11545) by [@goodideal](https://github.com/goodideal))
- Fixed workspaces with an IPv6 Git remote not detecting their Gitea or Forgejo forge ([#11692](https://github.com/getpaseo/paseo/pull/11692) by [@jamescordrey-ops](https://github.com/jamescordrey-ops))
- Fixed workspace refreshes stalling when a `gh` or `glab` command ignores its timeout ([#11252](https://github.com/getpaseo/paseo/pull/11252), [#11411](https://github.com/getpaseo/paseo/pull/11411))
- Fixed scheduled runs in a Paseo worktree creating a duplicate project ([#10378](https://github.com/getpaseo/paseo/pull/10378) by [@kotusenka](https://github.com/kotusenka))
- Fixed archiving an agent failing with Unknown agent while another archive or close runs ([#10590](https://github.com/getpaseo/paseo/pull/10590) by [@apple-ouyang](https://github.com/apple-ouyang))
- Fixed an agent's last reply being cut off when a notification arrived mid-reply ([#11578](https://github.com/getpaseo/paseo/pull/11578) by [@KiritoXDone](https://github.com/KiritoXDone))
- Fixed a queued message running in the mode of a prompt sent after it ([#11722](https://github.com/getpaseo/paseo/pull/11722))
- Fixed `paseo ls --json` dropping timestamps and background work ([#11423](https://github.com/getpaseo/paseo/pull/11423) by [@KiritoXDone](https://github.com/KiritoXDone))
- Fixed `paseo inspect` and `paseo ls` hiding the model for Cursor Auto ([#11693](https://github.com/getpaseo/paseo/pull/11693))
- Fixed `paseo workspace ls` reporting a wrong password as a stopped daemon ([#11676](https://github.com/getpaseo/paseo/pull/11676) by [@chirag127](https://github.com/chirag127))
- Fixed `paseo daemon status` leaving out unconfirmed terminal cleanup ([#11658](https://github.com/getpaseo/paseo/pull/11658) by [@chirag127](https://github.com/chirag127))
- Fixed CLI archive, detach and reload scanning all agent history for a full agent ID ([#11617](https://github.com/getpaseo/paseo/pull/11617) by [@maci0](https://github.com/maci0))
### Security
- Blocked client file access to the daemon's own state in the Paseo home directory, and warned when a saved host's daemon key changes ([#11452](https://github.com/getpaseo/paseo/pull/11452))
- Restricted loopback origin matching to `localhost`, `127.0.0.1` and `::1` for daemon WebSocket and HTTP requests ([#11686](https://github.com/getpaseo/paseo/pull/11686))
- Stopped images in pull request comments and reviews from loading files from the host ([#11699](https://github.com/getpaseo/paseo/pull/11699))
- Stopped `.worktreeinclude` from copying local files into worktrees from fork pull requests ([#11709](https://github.com/getpaseo/paseo/pull/11709))
- Rejected schedule IDs that point outside the schedules directory ([#11727](https://github.com/getpaseo/paseo/pull/11727))
### Plugins
- Added a workspace layout API so plugins can open, move and close panes and tabs ([#11328](https://github.com/getpaseo/paseo/pull/11328))
- Added `requirements.app` to set a separate minimum app version from the daemon's ([#11494](https://github.com/getpaseo/paseo/pull/11494) by [@mcowger](https://github.com/mcowger))
- Fixed a plugin error in a press handler or timer closing the iOS and Android app ([#11412](https://github.com/getpaseo/paseo/pull/11412))
- Fixed plugin operations deleting plugin entries added to `config.json` by hand ([#11501](https://github.com/getpaseo/paseo/pull/11501) by [@matchy233](https://github.com/matchy233))
- Fixed registry plugin installs failing with Missing npm artifact when npm leaves registry URLs out of lockfiles ([#11656](https://github.com/getpaseo/paseo/pull/11656) by [@Brandon168](https://github.com/Brandon168))
- Fixed local plugin reloads taking 12 to 21 seconds when the daemon runs under a large directory ([#11653](https://github.com/getpaseo/paseo/pull/11653))
## 0.18.2 - 2026-11-30
- **Redesigned model picker:** Pick models from a two-pane desktop view with cross-provider search, an in-place phone drawer with a thinking slider, and per-provider model lists in settings. ([#11186](https://github.com/getpaseo/paseo/pull/11186), [#11280](https://github.com/getpaseo/paseo/pull/11280), [#11295](https://github.com/getpaseo/paseo/pull/11295), [#11371](https://github.com/getpaseo/paseo/pull/11371), [#11313](https://github.com/getpaseo/paseo/pull/11313))
-144
View File
@@ -1,149 +1,5 @@
# Changelog
## 0.19.0-beta.1 - 2026-12-02
- **对话中切换 Provider**:可将对话切换到其他 Provider 并保留对话内容,对话记录现在存储在主机上。([#11410](https://github.com/getpaseo/paseo/pull/11410))
- **排队消息重启不丢失**:排队消息现在保存在主机上,应用重新加载、切换设备或 daemon 重启后都不会丢失。([#11424](https://github.com/getpaseo/paseo/pull/11424), [#11566](https://github.com/getpaseo/paseo/pull/11566), [#11740](https://github.com/getpaseo/paseo/pull/11740))
- **一键开关 Agent 工具**:Agent 工具现在由一个 **启用工具** 设置统一控制,包含编排、定时任务、PR 监控和浏览器分组,并默认开启。([#11189](https://github.com/getpaseo/paseo/pull/11189))
- **已连接设备列表**:**设置 → 设备** 现在会显示哪些客户端和主机已连接,以及各自可以访问的内容。([#11209](https://github.com/getpaseo/paseo/pull/11209))
- **插件评分卡**:应用和 paseo.sh 上的插件页面现在会显示评分卡、更新历史、相关插件和赞助链接。([#11563](https://github.com/getpaseo/paseo/pull/11563), [#11674](https://github.com/getpaseo/paseo/pull/11674), [#11691](https://github.com/getpaseo/paseo/pull/11691))
- **通过隧道共享服务**:可从 Scripts 菜单将正在运行的工作区服务共享到公网地址,开发服务器也会保留实时重载连接。服务现在通过 `localhost:<port>` 打开,`*.localhost` 服务地址已移除。([#11490](https://github.com/getpaseo/paseo/pull/11490))
- **Agent 运行时更省资源**:运行中的 Agent 占用的 CPU、GPU 和电量大幅减少,状态环、加载指示器和工具调用动画也更轻量。([#11456](https://github.com/getpaseo/paseo/pull/11456), [#11474](https://github.com/getpaseo/paseo/pull/11474), [#11564](https://github.com/getpaseo/paseo/pull/11564), [#11586](https://github.com/getpaseo/paseo/pull/11586), [#11591](https://github.com/getpaseo/paseo/pull/11591),贡献者:[@djbclark](https://github.com/djbclark), [@luoph](https://github.com/luoph), [@mariotaku](https://github.com/mariotaku))
- **更稳定的流式回复**:流式回复在到达时即显示最终格式,长回复的渲染也不再随长度增长而变慢。([#11572](https://github.com/getpaseo/paseo/pull/11572), [#11582](https://github.com/getpaseo/paseo/pull/11582),贡献者:[@luoph](https://github.com/luoph))
- **更快的移动端启动**:移动端冷启动后会更快显示上次的工作区,在 Android 上约快 0.7 秒。([#11390](https://github.com/getpaseo/paseo/pull/11390),贡献者:[@luoph](https://github.com/luoph), [@maci0](https://github.com/maci0))
- **桌面端浏览器配置文件**:桌面端浏览器标签页可以使用不同颜色的独立配置文件,便于在同一网站上同时登录两个账号。([#10357](https://github.com/getpaseo/paseo/pull/10357),贡献者:[@clkao](https://github.com/clkao))
- **下滑收起 iOS 键盘**:向下拖动对话即可收起 iOS 键盘,键盘打开时对话控件首次点击即可生效。([#11625](https://github.com/getpaseo/paseo/pull/11625))
### 破坏性变更
- Paseo CLI 和 daemon 现在需要 Node.js 22.16.0 或更高版本 ([#11410](https://github.com/getpaseo/paseo/pull/11410))
### 新增
- 在用量中新增 Antigravity 配额,仅在选择 **刷新** 时更新 ([#11585](https://github.com/getpaseo/paseo/pull/11585))
- 为 OpenCode v2 Agent 新增仅回退对话的功能 ([#11675](https://github.com/getpaseo/paseo/pull/11675))
- 为通过其他主机连接的主机上的工作区新增桌面端浏览器标签页 ([#11561](https://github.com/getpaseo/paseo/pull/11561))
- 新增 `paseo hub run`,可从终端启动 Hub 手动触发器 ([#11408](https://github.com/getpaseo/paseo/pull/11408))
- 在用量卡片和侧边栏摘要中新增 Claude Enterprise 月度支出 ([#11514](https://github.com/getpaseo/paseo/pull/11514),贡献者:[@vivekkalyan](https://github.com/vivekkalyan))
- 为 Codex 个人支出限额新增 Spend credits 金额显示 ([#11702](https://github.com/getpaseo/paseo/pull/11702),贡献者:[@vivekkalyan](https://github.com/vivekkalyan))
### 改进
- 对不含工作区链接的回复跳过 Markdown 预处理,加快对话打开速度 ([#11327](https://github.com/getpaseo/paseo/pull/11327))
- 仅为可见工作区更新 Git 操作,减少每次切换工作区的开销 ([#11332](https://github.com/getpaseo/paseo/pull/11332))
- 仅改变 token 用量的 Agent 更新不再触发侧边栏重新渲染 ([#11565](https://github.com/getpaseo/paseo/pull/11565),贡献者:[@jl97mcad](https://github.com/jl97mcad))
- 反复切换工作区时,隐藏的工作区 Composer 会在十分钟后释放 ([#11613](https://github.com/getpaseo/paseo/pull/11613),贡献者:[@js2me](https://github.com/js2me))
- 在较长的多行草稿中保持输入流畅 ([#11418](https://github.com/getpaseo/paseo/pull/11418))
- 桌面应用的网页界面改用 Brotli 和 gzip 压缩传输,不再发送未压缩的 25 MB 包 ([#10635](https://github.com/getpaseo/paseo/pull/10635),贡献者:[@djbclark](https://github.com/djbclark))
- 对话加载改为显示一个稳定的加载指示器,并同时显示对话和 Composer,不再闪现 **正在更新消息** ([#11575](https://github.com/getpaseo/paseo/pull/11575))
- 恢复工作区时保持 Restoring 界面,直到工作区就绪 ([#11486](https://github.com/getpaseo/paseo/pull/11486))
- 归档检查未提交的更改时,在 worktree 行上显示加载指示器 ([#11519](https://github.com/getpaseo/paseo/pull/11519), [#11574](https://github.com/getpaseo/paseo/pull/11574),贡献者:[@cxroop](https://github.com/cxroop))
- 在主机选择器上显示各主机的图标和状态圆点 ([#11568](https://github.com/getpaseo/paseo/pull/11568))
- iPhone 上按硬件键盘的 Return 键即可发送提示词,与 iPad 一致 ([#11537](https://github.com/getpaseo/paseo/pull/11537))
- 将 **直接连接** 的 Advanced 字段替换为 **表单** 与 URI 切换,粘贴 `tcp://` URI 后一次点击即可连接 ([#11402](https://github.com/getpaseo/paseo/pull/11402),贡献者:[@thecardcheat](https://github.com/thecardcheat))
### 变更
- 归档时如果 worktree 有未提交的更改,除非确认删除,否则保留该 worktree ([#11430](https://github.com/getpaseo/paseo/pull/11430))
- 关闭带有未发送草稿的 **新建 Agent** 标签页时,会先询问是否丢弃草稿 ([#11660](https://github.com/getpaseo/paseo/pull/11660))
- 在侧边栏中 Cmd/Ctrl+点击工作区改为打开该工作区,而不再进入选择模式 ([#11472](https://github.com/getpaseo/paseo/pull/11472))
- 已通过 `send_agent_prompt` 向调用方汇报的 Agent 不再额外发送完成通知 ([#11583](https://github.com/getpaseo/paseo/pull/11583))
### 修复
- 修复附加超过 2000 px 的图片后,该对话之后的每一轮都失败的问题 ([#5119](https://github.com/getpaseo/paseo/pull/5119),贡献者:[@RUIIIOVO](https://github.com/RUIIIOVO))
- 修复关闭 Paseo 工具时语音模式 Agent 始终不回话的问题 ([#11161](https://github.com/getpaseo/paseo/pull/11161))
- 修复在没有 daemon 连接时关闭语音模式后麦克风仍保持开启的问题 ([#11587](https://github.com/getpaseo/paseo/pull/11587),贡献者:[@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- 修复应用从后台返回后需要长达一分钟才能重新连接的问题 ([#10348](https://github.com/getpaseo/paseo/pull/10348),贡献者:[@dongsun1](https://github.com/dongsun1))
- 修复一次 WebSocket 握手失败就使重连延迟翻倍的问题 ([#11428](https://github.com/getpaseo/paseo/pull/11428),贡献者:[@suniceman](https://github.com/suniceman))
- 修复应用切换到更快的连接后,对话仍停留在 **正在重新连接** 的问题 ([#11029](https://github.com/getpaseo/paseo/pull/11029),贡献者:[@tmhaha](https://github.com/tmhaha))
- 修复重新打开已缓存的对话后 **正在更新消息** 一直显示的问题 ([#11464](https://github.com/getpaseo/paseo/pull/11464),贡献者:[@oyzh888](https://github.com/oyzh888))
- 修复重连复用订阅后终端输出停止的问题 ([#10433](https://github.com/getpaseo/paseo/pull/10433),贡献者:[@chirag127](https://github.com/chirag127))
- 修复应用在主机连接前启动时 **文件** 显示 **Host 未连接** 的问题 ([#11679](https://github.com/getpaseo/paseo/pull/11679))
- 修复主机离线时 **创建时间** 和 **最近提示词** 排序选项消失的问题 ([#11728](https://github.com/getpaseo/paseo/pull/11728))
- 修复在 iOS 上点击标题栏会将对话、Explorer 或工作区列表滚动到顶部的问题 ([#11262](https://github.com/getpaseo/paseo/pull/11262),贡献者:[@yzim](https://github.com/yzim))
- 修复文件面板在打开过程中被关闭后,留下阻挡点击的不可见遮罩的问题 ([#11317](https://github.com/getpaseo/paseo/pull/11317),贡献者:[@LiebeLee](https://github.com/LiebeLee))
- 修复底部面板在打开动画开始前被关闭后仍保持打开的问题 ([#11632](https://github.com/getpaseo/paseo/pull/11632))
- 修复 Android 在选择图片期间重建应用后未附加任何内容的问题 ([#7734](https://github.com/getpaseo/paseo/pull/7734))
- 修复在网页版 Composer 中粘贴文件时插入文件路径而不是添加附件的问题 ([#11718](https://github.com/getpaseo/paseo/pull/11718))
- 修复 **内容字体大小** 未应用到网页端对话中已有用户消息的问题 ([#11469](https://github.com/getpaseo/paseo/pull/11469),贡献者:[@bearyjd](https://github.com/bearyjd))
- 修复 Markdown 表格单元格中的 `<br>` 拆分表格行的问题 ([#9587](https://github.com/getpaseo/paseo/pull/9587),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
- 修复网页端隐藏的对话行导致阅读位置偏移的问题 ([#11538](https://github.com/getpaseo/paseo/pull/11538),贡献者:[@kogekiplay](https://github.com/kogekiplay))
- 修复带附件的插件斜杠命令被当作消息发送给 Agent 的问题 ([#11483](https://github.com/getpaseo/paseo/pull/11483),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 **归档已完成的 subagent** 跳过已关闭子 Agent 的问题 ([#10865](https://github.com/getpaseo/paseo/pull/10865),贡献者:[@sbhas2k](https://github.com/sbhas2k))
- 修复 **导入会话** 遗漏最新 ACP 会话的问题 ([#10675](https://github.com/getpaseo/paseo/pull/10675))
- 修复 **导入会话** 在 **重试** 期间隐藏 Provider 错误的问题 ([#11654](https://github.com/getpaseo/paseo/pull/11654))
- 修复设置时丢弃 60 秒后才响应的 Provider 所给出的项目建议的问题 ([#11438](https://github.com/getpaseo/paseo/pull/11438),贡献者:[@suniceman](https://github.com/suniceman))
- 修复远程主机上的工作区显示 Open in file manager 的问题 ([#11463](https://github.com/getpaseo/paseo/pull/11463),贡献者:[@sleroq](https://github.com/sleroq))
- 修复根目录为 `/` 的工作区无法使用 Reveal in Finder 的问题 ([#11206](https://github.com/getpaseo/paseo/pull/11206),贡献者:[@suniceman](https://github.com/suniceman))
- 修复桌面端预览大型 HTML 文件时显示空白面板的问题 ([#11504](https://github.com/getpaseo/paseo/pull/11504))
- 修复 Paseo RPM 无法与其他 Electron RPM 同时安装的问题 ([#11354](https://github.com/getpaseo/paseo/pull/11354))
- 修复 Windows 上 Restart and close 终端后终端程序仍在运行的问题 ([#11398](https://github.com/getpaseo/paseo/pull/11398))
- 修复已删除 worktree 的 Provider 检查导致 Agent 创建卡住的问题 ([#11646](https://github.com/getpaseo/paseo/pull/11646),贡献者:[@ralston](https://github.com/ralston))
- 修复重新打开对话或重启 daemon 后,已完成的 Claude 子 Agent 显示为运行中或已取消的问题 ([#10848](https://github.com/getpaseo/paseo/pull/10848), [#11594](https://github.com/getpaseo/paseo/pull/11594), [#11602](https://github.com/getpaseo/paseo/pull/11602),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya), [@desmond-rai](https://github.com/desmond-rai))
- 修复由 Paseo 启动的 Claude Agent 缺少 Claude Code 对话标题的问题 ([#11057](https://github.com/getpaseo/paseo/pull/11057),贡献者:[@Zayooo00](https://github.com/Zayooo00))
- 修复 Claude 自行开始的轮次在重新打开的对话中被隐藏、直到 **重新加载** 才显示的问题 ([#11405](https://github.com/getpaseo/paseo/pull/11405))
- 修复 Claude Code 系统通知从对话中丢失的问题 ([#11419](https://github.com/getpaseo/paseo/pull/11419),贡献者:[@minamorl](https://github.com/minamorl))
- 修复导入的 Claude Code 对话中缺少 Goal set 回复的问题 ([#11733](https://github.com/getpaseo/paseo/pull/11733))
- 修复在已归档的 Claude 对话中列出命令时启动 Claude Code 的问题 ([#11521](https://github.com/getpaseo/paseo/pull/11521),贡献者:[@RawSalmon69](https://github.com/RawSalmon69))
- 修复 **停止** 对无响应的 Pi 和 OMP Agent 无效的问题 ([#11618](https://github.com/getpaseo/paseo/pull/11618),贡献者:[@LouisDeconinck](https://github.com/LouisDeconinck))
- 修复扩展处理提示词时 Pi 轮次永远无法结束的问题 ([#10572](https://github.com/getpaseo/paseo/pull/10572),贡献者:[@jsilhan](https://github.com/jsilhan))
- 修复 Pi 提示词在扩展预检期间超时后仍继续执行的问题 ([#11525](https://github.com/getpaseo/paseo/pull/11525),贡献者:[@Stelath](https://github.com/Stelath))
- 修复扩展在回复前发送上下文时 Pi 重复显示提示词的问题 ([#11533](https://github.com/getpaseo/paseo/pull/11533),贡献者:[@Stelath](https://github.com/Stelath))
- 修复在受信任的工作区中 Pi 对话跳过项目技能和设置的问题 ([#11527](https://github.com/getpaseo/paseo/pull/11527),贡献者:[@patrick-motard](https://github.com/patrick-motard))
- 修复冲突解决后新建 Pi Agent 仍报旧扩展错误的问题 ([#11642](https://github.com/getpaseo/paseo/pull/11642))
- 修复首次发送提示词前缺少 OMP **快速** 开关的问题 ([#11553](https://github.com/getpaseo/paseo/pull/11553))
- 修复已完成的 OMP 表单提问不再显示提问内容和所选答案的问题 ([#11697](https://github.com/getpaseo/paseo/pull/11697), [#11706](https://github.com/getpaseo/paseo/pull/11706),贡献者:[@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- 修复 Codex 仍在启动时发送消息于 60 秒后报告失败的问题 ([#11547](https://github.com/getpaseo/paseo/pull/11547),贡献者:[@nonononull](https://github.com/nonononull))
- 修复通过 `env codex` 等包装命令启动时 Codex 功能被隐藏的问题 ([#11221](https://github.com/getpaseo/paseo/pull/11221),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 Codex 异步提问的回答被拒绝的问题 ([#11225](https://github.com/getpaseo/paseo/pull/11225),贡献者:[@suniceman](https://github.com/suniceman))
- 修复重新打开 Codex 对话时重置其最近活动时间的问题 ([#10760](https://github.com/getpaseo/paseo/pull/10760),贡献者:[@Juns-g](https://github.com/Juns-g))
- 修复 Antigravity 子 Agent 工具调用将流式回复从单词中间截断的问题 ([#11535](https://github.com/getpaseo/paseo/pull/11535),贡献者:[@Suhail](https://github.com/Suhail))
- 修复 Antigravity 轮次在内部执行器出错后仍以完成状态结束的问题 ([#10885](https://github.com/getpaseo/paseo/pull/10885),贡献者:[@vecyang1](https://github.com/vecyang1), [@luoph](https://github.com/luoph))
- 修复 Provider 拒绝已保存的思考强度时 ACP 对话无法重新打开的问题 ([#10333](https://github.com/getpaseo/paseo/pull/10333))
- 修复切换模式后 ACP 思考强度选择器仍保留旧级别的问题 ([#11478](https://github.com/getpaseo/paseo/pull/11478),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 ACP 设置错误中缺少 Provider 说明的问题 ([#11431](https://github.com/getpaseo/paseo/pull/11431),贡献者:[@suniceman](https://github.com/suniceman))
- 修复上下文更新后 Muse 用量丢失 token 总数的问题 ([#11389](https://github.com/getpaseo/paseo/pull/11389),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 Claude 用量卡片持续数小时显示受速率限制的问题 ([#11597](https://github.com/getpaseo/paseo/pull/11597))
- 修复订阅变更后 Claude 用量仍显示旧套餐的问题 ([#11685](https://github.com/getpaseo/paseo/pull/11685),贡献者:[@matchy233](https://github.com/matchy233))
- 修复没有额度余额的账号 Codex 用量显示 0 额度的问题 ([#11515](https://github.com/getpaseo/paseo/pull/11515),贡献者:[@vivekkalyan](https://github.com/vivekkalyan))
- 修复超出高级请求配额时 Copilot 用量获取失败的问题 ([#11006](https://github.com/getpaseo/paseo/pull/11006),贡献者:[@nathanmcnulty](https://github.com/nathanmcnulty))
- 修复 Copilot 用量从 GitHub CLI 读取其他 GitHub 主机或账号 token 的问题 ([#11689](https://github.com/getpaseo/paseo/pull/11689))
- 修复从 fork 执行 **创建 PR** 时将 PR 创建在 fork 而非其上游仓库的问题 ([#11436](https://github.com/getpaseo/paseo/pull/11436),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 fork PR 在首次推送后从其 worktree 工作区中消失的问题 ([#11441](https://github.com/getpaseo/paseo/pull/11441),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 **创建 PR** 返回 API 地址而非 PR 页面的问题 ([#11439](https://github.com/getpaseo/paseo/pull/11439),贡献者:[@suniceman](https://github.com/suniceman))
- 修复 GitHub 检查详情无法加载注释的问题 ([#11476](https://github.com/getpaseo/paseo/pull/11476),贡献者:[@suniceman](https://github.com/suniceman))
- 修复作业日志不可用时 GitHub 检查详情丢失注释的问题 ([#11509](https://github.com/getpaseo/paseo/pull/11509))
- 修复 Gitea 和 Forgejo 的草稿 PR 显示为已打开且存在冲突的问题 ([#11545](https://github.com/getpaseo/paseo/pull/11545),贡献者:[@goodideal](https://github.com/goodideal))
- 修复 Git 远程地址为 IPv6 的工作区无法识别其 Gitea 或 Forgejo forge 的问题 ([#11692](https://github.com/getpaseo/paseo/pull/11692),贡献者:[@jamescordrey-ops](https://github.com/jamescordrey-ops))
- 修复 `gh` 或 `glab` 命令忽略超时导致工作区刷新卡住的问题 ([#11252](https://github.com/getpaseo/paseo/pull/11252), [#11411](https://github.com/getpaseo/paseo/pull/11411))
- 修复在 Paseo worktree 中运行定时任务时创建重复项目的问题 ([#10378](https://github.com/getpaseo/paseo/pull/10378),贡献者:[@kotusenka](https://github.com/kotusenka))
- 修复在其他归档或关闭操作进行时归档 Agent 报 Unknown agent 错误的问题 ([#10590](https://github.com/getpaseo/paseo/pull/10590),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
- 修复 Agent 回复过程中收到通知导致最后一条回复被截断的问题 ([#11578](https://github.com/getpaseo/paseo/pull/11578),贡献者:[@KiritoXDone](https://github.com/KiritoXDone))
- 修复排队消息以之后发送的提示词的模式运行的问题 ([#11722](https://github.com/getpaseo/paseo/pull/11722))
- 修复 `paseo ls --json` 丢失时间戳和后台任务的问题 ([#11423](https://github.com/getpaseo/paseo/pull/11423),贡献者:[@KiritoXDone](https://github.com/KiritoXDone))
- 修复 `paseo inspect` 和 `paseo ls` 隐藏 Cursor Auto 模型的问题 ([#11693](https://github.com/getpaseo/paseo/pull/11693))
- 修复 `paseo workspace ls` 将密码错误报告为 daemon 已停止的问题 ([#11676](https://github.com/getpaseo/paseo/pull/11676),贡献者:[@chirag127](https://github.com/chirag127))
- 修复 `paseo daemon status` 遗漏未确认的终端清理的问题 ([#11658](https://github.com/getpaseo/paseo/pull/11658),贡献者:[@chirag127](https://github.com/chirag127))
- 修复 CLI 归档、分离和重新加载时为匹配完整 Agent ID 而扫描全部 Agent 历史记录的问题 ([#11617](https://github.com/getpaseo/paseo/pull/11617),贡献者:[@maci0](https://github.com/maci0))
### 安全
- 阻止客户端访问 Paseo 主目录中 daemon 自身的状态文件,并在已保存主机的 daemon 密钥变化时发出警告 ([#11452](https://github.com/getpaseo/paseo/pull/11452))
- 将 daemon WebSocket 和 HTTP 请求的回环来源匹配限制为 `localhost`、`127.0.0.1` 和 `::1` ([#11686](https://github.com/getpaseo/paseo/pull/11686))
- 禁止 PR 评论和审查中的图片读取主机上的文件 ([#11699](https://github.com/getpaseo/paseo/pull/11699))
- 禁止 `.worktreeinclude` 将本地文件复制到来自 fork PR 的 worktree 中 ([#11709](https://github.com/getpaseo/paseo/pull/11709))
- 拒绝指向定时任务目录之外的定时任务 ID ([#11727](https://github.com/getpaseo/paseo/pull/11727))
### 插件
- 新增工作区布局 API,插件可以打开、移动和关闭面板与标签页 ([#11328](https://github.com/getpaseo/paseo/pull/11328))
- 新增 `requirements.app`,可单独设置与 daemon 不同的最低应用版本 ([#11494](https://github.com/getpaseo/paseo/pull/11494),贡献者:[@mcowger](https://github.com/mcowger))
- 修复插件在按下处理函数或定时器中出错导致 iOS 和 Android 应用关闭的问题 ([#11412](https://github.com/getpaseo/paseo/pull/11412))
- 修复插件操作删除手动添加到 `config.json` 中插件条目的问题 ([#11501](https://github.com/getpaseo/paseo/pull/11501),贡献者:[@matchy233](https://github.com/matchy233))
- 修复 npm 在锁文件中省略 registry 地址时,注册表插件安装报 Missing npm artifact 错误的问题 ([#11656](https://github.com/getpaseo/paseo/pull/11656),贡献者:[@Brandon168](https://github.com/Brandon168))
- 修复 daemon 运行在大型目录下时,本地插件重新加载耗时 12 至 21 秒的问题 ([#11653](https://github.com/getpaseo/paseo/pull/11653))
## 0.18.2 - 2026-11-30
- **重新设计的模型选择器**:桌面端采用支持跨 Provider 搜索的双栏视图,手机端合并为带思考强度滑块的单层抽屉,并支持在设置中按 Provider 筛选常用模型。([#11186](https://github.com/getpaseo/paseo/pull/11186), [#11280](https://github.com/getpaseo/paseo/pull/11280), [#11295](https://github.com/getpaseo/paseo/pull/11295), [#11371](https://github.com/getpaseo/paseo/pull/11371), [#11313](https://github.com/getpaseo/paseo/pull/11313))
+1 -1
View File
@@ -60,7 +60,7 @@
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://logits.com/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/logits-on-dark.svg"><img src="packages/website/public/sponsors/logits-on-light.svg" alt="Logits" height="40"></picture></a><br><sub>Optimized intelligence per token, second, dollar.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo のスポンサーになる</a></td>
</tr>
</table>
+1 -1
View File
@@ -54,7 +54,7 @@
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://logits.com/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/logits-on-dark.svg"><img src="packages/website/public/sponsors/logits-on-light.svg" alt="Logits" height="40"></picture></a><br><sub>Optimized intelligence per token, second, dollar.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo 스폰서 되기</a></td>
</tr>
</table>
+1 -1
View File
@@ -59,7 +59,7 @@ Paseo is an open source agentic development environment for desktop, mobile, web
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="56"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="56"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://logits.com/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/logits-on-dark.svg"><img src="packages/website/public/sponsors/logits-on-light.svg" alt="Logits" height="56"></picture></a><br><sub>Optimized intelligence per token, second, dollar.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Become a sponsor</a></td>
</tr>
</table>
+1 -1
View File
@@ -60,7 +60,7 @@
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://logits.com/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/logits-on-dark.svg"><img src="packages/website/public/sponsors/logits-on-light.svg" alt="Logits" height="40"></picture></a><br><sub>Optimized intelligence per token, second, dollar.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/zh-CN/sponsor">成为 Paseo 赞助商</a></td>
</tr>
</table>
+1 -1
View File
@@ -450,7 +450,7 @@ the message is queued, so any device can open a row's attachments.
Rows take these commands:
- **Send now** promotes the row as `interrupt` when your send behavior setting is `interrupt`, and as `steer` otherwise (including `queue`, where the row is already waiting and Send now should not cancel the turn).
- **Send now** promotes the row with your send behavior setting: `steer`, otherwise `interrupt`.
- **Edit** is offered on your own messages only. It withdraws the row, then replaces the composer
draft with its text and attachments, and stages the row's provider switch again. If the host
already started sending the row, the draft stays as it is.
+1 -8
View File
@@ -219,14 +219,7 @@ file after the daemon confirms persistence.
> **Window-state v1 limitation:** only the _first_ window of a session restores and persists saved geometry (size/position/maximized). Windows opened via ⌘⇧N / second-instance / "Open in new window" open at the default size, OS-cascaded, and do not persist — this avoids every window stacking on the same restored bounds and fighting over the single window-state store. Lifting this needs per-window state keys.
>
> **In-app browser profiles.** A browser tab's Electron partition is the pair (route, profile). The route is local, or a host's browser proxy. The profile is **Default** or a named profile. Electron sets the proxy per session (`session.setProxy`), not per `<webview>`, so the route is part of the partition name. Partition names are the identity, and `packages/desktop/src/features/browser-partition.ts` owns them:
>
> | Route | Default | Named profile |
> | ----- | ------------------------------------ | --------------------------------------------------- |
> | Local | `persist:paseo-browser` | `persist:paseo-profile-<slug>` |
> | Host | `persist:paseo-browser-host-<16hex>` | `persist:paseo-browser-host-<16hex>-profile-<slug>` |
>
> `persist:paseo-browser` keeps cookies from before profiles, and the host Default name predates profiles; do not rename either. A host runs one loopback SOCKS5 server and one tunnel. Every profile session on that host points `setProxy` at the same port, so a new profile never opens a second tunnel. Main binds a host profile's session when the renderer calls `ensureHostProxy` with its slug, and verifies it with `resolveProxy`. The status snapshot lists bound sessions in `profilePartitions`, and the tab mounts only after its profile appears there. A tab can switch profile and route at any time: the `<webview>` is replaced under the new partition and reloads the current URL. Display names and colors live in the main-owned catalog `<userData>/browser-profiles.json`, so editing a name or color keeps sign-ins intact and updates open tabs live. At `will-attach-webview`, main admits local partitions and only those host partitions whose session it bound. The tab's chosen profile slug lives in its `workspace-browser-store` record. After every `did-attach`, the renderer registers its browser id, workspace id, partition, and current guest `WebContents` id. Main accepts it only when that guest belongs to the calling renderer and its session matches the partition, and for a host partition, only when the session is bound to the proxy. Registration is repeated on purpose, because reparenting a retained `<webview>` can replace its guest without replacing the DOM element. Settings > Chat & panes manages profiles on every route: clearing a profile clears its storage and cache on the local route and on each host, then reloads its open tabs. Removing a named profile closes its open tabs, removes it from the catalog, clears its sessions, and deletes each of its `Partitions/` directories. Startup deletes the directories of profiles that are no longer in the catalog. Default cannot be removed.
> **In-app browser profiles.** Each local browser tab runs in a persistent Electron partition and can switch profiles at any time; switching replaces the `<webview>` under the new partition and reloads the current URL in that profile's session. Partition names are the identity: `persist:paseo-browser` is **Default** and preserves cookies from before profiles; `persist:paseo-profile-<slug>` is a named profile. Display names and colors live in the main-owned catalog `<userData>/browser-profiles.json`, so editing a profile's name or color keeps sign-ins intact and updates open tabs live. Main admits only `persist:paseo-browser`, `persist:paseo-profile-<slug>`, and active host-proxy partitions (`persist:paseo-browser-host-<16hex>`) at `will-attach-webview`. The tab's chosen profile slug lives in its `workspace-browser-store` record. After every `did-attach`, the renderer registers its browser id, workspace id, partition, and current guest `WebContents` id, and main accepts it only when that guest belongs to the calling renderer and its session matches the partition. Registration is intentionally repeated because reparenting a retained `<webview>` can replace its guest without replacing the DOM element. Settings > Chat & panes manages profiles: clearing a profile clears its storage/cache and reloads its open tabs; removing a named profile closes its open tabs, removes it from the catalog, clears its session, and deletes its `Partitions/paseo-profile-<slug>` directory from disk. Default cannot be removed.
>
> **In-app browser window opens.** Ordinary link opens, including Shift-clicked links, become Paseo workspace tabs and inherit the opener tab's browser profile. Script-created opens with popup features or a named window target and POST-backed opens remain secured Electron child windows in the opener’s browser profile, preserving `window.opener`, `postMessage`, named-window reuse, request bodies, and `window.close()` for OAuth, payment, and similar popup protocols. Unsupported URL schemes are denied before either path.
>
+3 -5
View File
@@ -216,11 +216,9 @@ its own.
grew once its data arrived left the menu clipped, or hanging over its anchor, until it moved
again. `AnchoredSurface` plays the same keyframes through the Web Animations API on web, which
leaves no inline style; native keeps the Reanimated `Keyframe`.
- **Animate only once placed.** The entering animation must run at the final position, not end
unseen at the off-screen measuring position. Native remounts the surface when its position
resolves, because Reanimated's `entering` runs only on mount. Web keeps the surface mounted and
starts its Web Animations entering animation on placement, so a popover's content mounts once
per open.
- **Animate only once placed.** `AnchoredSurface` remounts the surface when its position resolves,
so the entering animation runs at the final position rather than ending unseen at the
off-screen measuring position.
- **Sheets size to content.** `enableDynamicSizing`, not fixed snap points. A pushed page is
rarely the height of the page before it. A fill page is the one exception.
- **The sheet's content is teleported out of the menu's subtree**, so `MenuSheetSurface` rebuilds
+1 -8
View File
@@ -104,14 +104,7 @@ definition, no longer eligible to begin.
## Integration rules
- Callers request semantic targets through `panel-store`; they never write shared values.
- Gesture behavior comes from the explicit hooks in `mobile-panels/gestures.ts`.
- A horizontal scroller keeps the touches that start on it: no panel opens or closes under it. Use
`ScrollView` or `FlatList` from `components/ui/scroll-view` with `horizontal`; plugins get the same
components from `@getpaseo/plugin/client/ui`. An `Animated.ScrollView` puts
`usePanelAwareHorizontalScrollGesture` on its own `GestureDetector`. The gesture blocks the
provider's pans and the nearest explorer close pan. Browsers scroll an overflow container
themselves and cancel the page's pointer stream, so the web `ScrollView` needs no gesture. The diff
document's scroller differs on purpose: at its leading edge it waits for the explorer close pan.
- Gesture behavior comes from the four explicit hooks in `mobile-panels/gestures.ts`.
- Navigation gestures accept touch pointers only. Mouse and pen fail at touch-down, so dragging a
mouse to select text on a hybrid laptop never moves a panel. Browsers without a touch screen
(`hooks/pointer-capabilities`) never enable them.
+3 -7
View File
@@ -257,13 +257,9 @@ Do not put any other code modules in the plugin root.
Shared files import contract helpers and types from `@getpaseo/plugin`. Server handler files import
`PluginHandlerContext` from `@getpaseo/plugin/server`. Client files import Paseo UI from
`@getpaseo/plugin/client/ui`. The module provides host-rendered `Icon` and `ProviderIcon`
components. `Icon` draws a Lucide name from the client's installed icon set, or any `PluginIcon`
through its `icon` prop; an unknown name or unsafe SVG renders nothing so it cannot break the
plugin surface. `ProviderIcon` resolves a built-in, catalog, or host-scoped plugin provider icon,
defaulting to the installation's host when `hostId` is omitted; unknown providers render the
standard provider fallback. `PluginCatalogSync` hydrates the host's provider snapshot before
installing client contributions so `ProviderIcon` resolves plugin SVGs on initial render.
`@getpaseo/plugin/client/ui`. Its `Icon` draws a Lucide name from the client's installed
icon set, or any `PluginIcon` through its `icon` prop; an unknown name or unsafe SVG renders nothing
so it cannot break the plugin surface.
Its controlled modal keeps presentation metadata on `<Modal title="…" icon={…}>` and body UI in
`<Modal.Content>`. Body layout, sheet-aware scrolling, and clipboard actions follow the
[host UI contract](../public-docs/plugins/reference.md#host-ui).
+25 -36
View File
@@ -16,9 +16,8 @@ Preparation is reversible and runs on the release branch before the user authori
4. Run the [pre-release sanity check](#pre-release-sanity-check) for stable releases, and report any findings to the user.
5. Commit the approved changelog and any requested ACP update, then run `npm run format`, `npm run lint`, and `npm run typecheck`.
6. Run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag.
7. Push `release/vX.Y.Z` or `release/vX.Y.Z-beta.N`.
8. Right after the push, open the unmerged [reconcile `main`](#reconcile-main) PR from `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`, so its CI runs in parallel with the release branch's `CI` and `Desktop Packages`. Do not merge it during Preparation.
9. Wait for `CI` and `Desktop Packages` on the release branch to pass (never wait on `main` CI), and run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit.
7. Push `release/vX.Y.Z` or `release/vX.Y.Z-beta.N` and wait for `CI` and `Desktop Packages` on that branch to pass (never wait on `main` CI).
8. Run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit.
### Ship
@@ -26,7 +25,7 @@ Ship starts after the user says "go ahead". All tag-triggered GitHub Actions wor
1. Run `npm run release:push` first to verify the clean release branch and push `vX.Y.Z` or `vX.Y.Z-beta.N`. Pushing the tag takes a few seconds and starts `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and (for stable tags) `Deploy App` on GitHub Actions, plus `Release Mobile` (stable) or `Release iOS Beta` (beta) on EAS. (`Deploy Website` runs later on the `release: published` event when `Desktop Release` publishes the stable GitHub Release.)
2. Run `npm run release:publish` (stable) or `npm run release:publish:beta` (beta) in parallel with the remote builds. `scripts/publish-release-packages.mjs` publishes the seven `@getpaseo/*` packages in dependency waves and polls npm visibility between packages to avoid `E409` or `E404` propagation races.
3. Check the green [reconcile `main`](#reconcile-main) PR against the pushed tag, then merge it right after `npm run release:push` finishes, in parallel with npm publication and the release builds. Wait for its checks only if the tag check produced changes.
3. Open the [reconcile `main`](#reconcile-main) PR from `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N` right after `npm run release:push` finishes, so its CI run overlaps with npm publication and the release builds.
4. Create the release heartbeat immediately with `create_heartbeat` to track every ship step to completion.
### Sync gates
@@ -121,7 +120,6 @@ An explicit user instruction can select another base.
`CI` (all 21 jobs) and `Desktop Packages` (Linux user-namespace smoke) in their own concurrency
groups, isolated from `main` traffic. Never wait on `main` CI, because `main` runs queue behind
each other and a newer merge replaces the pending one.
Open the [reconcile `main`](#reconcile-main) PR now so its CI runs in parallel with these two.
Wait for both runs on the release branch commit to pass before shipping.
Complete the [pre-release dependency checks](#pre-release-dependency-checks) on that commit.
Pushing a `release/**` branch without a `v*` tag triggers no publish workflows.
@@ -129,8 +127,9 @@ An explicit user instruction can select another base.
Because the release branch is already pushed at `HEAD`, no second branch CI run starts, and only
the tag release workflows run.
7. Immediately in parallel after `npm run release:push` finishes: publish npm packages with
`npm run release:publish` (stable) or `npm run release:publish:beta` (beta), merge the
already-green [reconcile `main`](#reconcile-main) PR, and create the release heartbeat. (`npm run release:ship` and `npm run release:ship:beta` also run
`npm run release:publish` (stable) or `npm run release:publish:beta` (beta), start
[Reconcile `main`](#reconcile-main) so its PR checks overlap with desktop and EAS builds, and
create the release heartbeat. (`npm run release:ship` and `npm run release:ship:beta` also run
`release:push` before `release:publish`, so tag builds never wait behind npm.)
When promoting or branching from a tag created before `release:prep:*`, `release:ship`, and the
@@ -175,35 +174,27 @@ For a promotion, every item defaults to defer.
## Reconcile main
Open the reconcile PR during Preparation, right after pushing `release/vX.Y.Z` or `release/vX.Y.Z-beta.N`. Its CI takes about 30 minutes and npm publication takes about 5, so opening it at Ship would leave Ship waiting on CI. An unmerged PR changes nothing on `main`. Reconcile reads only the release branch commit, so it does not wait for the release branch's `CI` or `Desktop Packages`:
Right after `npm run release:push` pushes the tag (in parallel with npm publication and all desktop, APK, Docker, and EAS builds), open a PR into `main` from a fresh branch off `origin/main` named `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`. Reconcile reads only the tagged git commit, so it does not wait for npm or any release build:
```bash
git fetch origin
git fetch origin --tags
git checkout -b reconcile/vX.Y.Z origin/main
npm run release:reconcile -- --ref origin/release/vX.Y.Z
npm run release:reconcile -- --tag vX.Y.Z
```
Use `release/vX.Y.Z-beta.N` and `reconcile/vX.Y.Z-beta.N` for a beta. `--tag vX.Y.Z` reads a published tag instead, for a release that is already tagged.
`scripts/reconcile-release.mjs` updates the working tree without cherry-picking stale lockfile
hunks from the release base:
- Copies the release branch's `CHANGELOG.md` and `CHANGELOG.zh-CN.md` entries verbatim. A beta or promotion
- Copies the tagged `CHANGELOG.md` and `CHANGELOG.zh-CN.md` entries verbatim. A beta or promotion
entry replaces the series beta entry on `main`. A stable hotfix on an older line is placed below
any newer entries.
- Copies the generated F-Droid changelog files from the release branch for stable releases.
- Copies the generated F-Droid changelog files from the tag for stable releases.
- Updates every `package.json` version and regenerates `package-lock.json` on top of current `main`
only when the shipped version is newer than `main`'s version.
- Leaves unshipped work on `main` untouched and makes no claims about unshipped work in the
changelog entry.
Commit and open the PR into `main`, but do not merge it during Preparation:
- If the release is cancelled, close the PR. `main` is untouched.
- If the release branch changes during Preparation, re-run `npm run release:reconcile -- --ref origin/release/vX.Y.Z` on the same branch and push to the same PR.
- At Ship, right after `npm run release:push` pushes the tag, run `npm run release:reconcile -- --tag vX.Y.Z` on the reconcile branch. A clean `git status` means the PR already matches the tag, so merge it in parallel with `npm run release:publish` and the tag builds. If it shows changes, push them and wait for the PR checks before merging.
Delete the remote release branch
Commit, open the PR into `main`, and merge once its checks pass. Delete the remote release branch
(`git push origin --delete release/vX.Y.Z` or `release/vX.Y.Z-beta.N`) only after the reconcile PR
merges and every [sync gate](#sync-gates) passes. The tag is the record of shipped source, and
Paseo maintains no release track besides `main`.
@@ -259,16 +250,16 @@ npm run release:prep:patch
# or:
npm run release:prep:minor
# 2. Push the release branch, then open the reconcile/vX.Y.Z PR into main (do not merge it).
# 2. Push the release branch and wait for CI + Desktop Packages on this commit.
git push -u origin HEAD
# Wait for CI + Desktop Packages on this commit and complete the pre-release dependency checks.
# Complete the pre-release dependency checks on this commit.
# 3. After go-ahead and green release-branch checks: push the tag first to start builds.
npm run release:push
# 4. Run these in parallel immediately after step 3:
npm run release:publish
# Also merge the green reconcile/vX.Y.Z PR and create the release heartbeat.
# Also open the reconcile/vX.Y.Z PR into main and create the release heartbeat.
# (`npm run release:ship` runs `release:push` before `release:publish` if used standalone.)
```
@@ -303,13 +294,12 @@ npm run release:check # Typecheck, build, dry-run pack
npm run version:all:patch
npm run version:all:minor
git push -u origin HEAD # Trigger CI + Desktop Packages on release/vX.Y.Z
# Open the reconcile/vX.Y.Z PR into main now (do not merge it).
# Wait for CI and Desktop Packages and complete the pre-release dependency checks.
# After go-ahead:
npm run release:push # Create tag vX.Y.Z on HEAD and push (starts release builds)
# In parallel right after release:push:
npm run release:publish # Publish to npm (idempotent, with propagation + beta dist-tag sync)
# Merge the green reconcile/vX.Y.Z PR and create the release heartbeat.
# Open reconcile/vX.Y.Z PR into main and create the release heartbeat.
```
## Beta flow
@@ -322,24 +312,23 @@ npm run release:prep:beta:minor # Start the next minor beta line
# or for follow-up betas:
npm run release:prep:beta:next # Cut X.Y.Z-beta.2, beta.3, ...
# 2. Push the release branch and open the reconcile/vX.Y.Z-beta.N PR into main (do not merge it):
# 2. Push the release branch and wait for CI + Desktop Packages to pass:
git push -u origin HEAD
# Wait for CI + Desktop Packages to pass and complete the pre-release dependency checks.
# Complete the pre-release dependency checks on this commit.
# 3. After go-ahead: push the tag first, then run npm publish, merge the reconcile PR, and heartbeat in parallel:
# 3. After go-ahead: push the tag first, then run npm publish, reconcile, and heartbeat in parallel:
npm run release:push
npm run release:publish:beta
# (Or run `npm run release:ship:beta` in one shell while merging reconcile/vX.Y.Z-beta.N.)
# (Or run `npm run release:ship:beta` in one shell while opening reconcile/vX.Y.Z-beta.N.)
# Later, after soak, promote on release/vX.Y.Z:
npm run release:prep:promote
git push -u origin HEAD
# Open the reconcile/vX.Y.Z PR into main (do not merge it).
# Wait for CI + Desktop Packages and complete the pre-release dependency checks.
# After go-ahead:
npm run release:push
npm run release:publish
# Merge the green reconcile/vX.Y.Z PR and create the release heartbeat in parallel.
# Open reconcile/vX.Y.Z PR into main and create the release heartbeat in parallel.
```
- Beta tags are published GitHub prereleases like `v0.1.41-beta.1`
@@ -1015,9 +1004,9 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] Every PR in the release range has been opened, and its full description and every linked issue have been read before drafting the changelog
- [ ] Fold this beta into the series' single `CHANGELOG.md` entry (heading `## X.Y.Z-beta.N - YYYY-MM-DD`, previous stable → release source), review it against the changelog policy, get approval, and commit it with its [`CHANGELOG.zh-CN.md` translation](#changelog-translations) before running `release:prep:*`
- [ ] The diff from the previous stable to the resolved release source is classified as patch or minor, with the target version and rationale approved
- [ ] `npm run release:prep:beta:patch`, `release:prep:beta:minor`, or `release:prep:beta:next` created the version commit on `release/vX.Y.Z-beta.N` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI), with the unmerged reconcile PR opened right after the branch push
- [ ] `npm run release:prep:beta:patch`, `release:prep:beta:minor`, or `release:prep:beta:next` created the version commit on `release/vX.Y.Z-beta.N` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI)
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run, while `npm run release:publish:beta`, the merge of the green `reconcile/vX.Y.Z-beta.N` PR, and the release heartbeat started in parallel
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run, while `npm run release:publish:beta`, the `reconcile/vX.Y.Z-beta.N` PR, and the release heartbeat started in parallel
- [ ] All seven `@getpaseo/*` npm packages show the version under the `beta` dist-tag, not `latest`
- [ ] The GitHub prerelease was published only after the three beta manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
- [ ] GitHub `Desktop Release` workflow for the `v*-beta.N` tag is green
@@ -1039,9 +1028,9 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] Update `CHANGELOG.md` with user-facing release notes (features, fixes, not refactors). Promotion renames the series' `## X.Y.Z-beta.N` entry to `## X.Y.Z - YYYY-MM-DD` and re-checks it covers the full release. Commit the matching [`CHANGELOG.zh-CN.md` entry](#changelog-translations) with it
- [ ] Verify the changelog heading follows strict `## X.Y.Z - YYYY-MM-DD` format
- [ ] Ensure local format, lint, and typecheck pass and the working tree is clean before running `release:prep:*`
- [ ] `npm run release:prep:patch`, `release:prep:minor`, or `release:prep:promote` created the version commit on `release/vX.Y.Z` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI), with the unmerged reconcile PR opened right after the branch push
- [ ] `npm run release:prep:patch`, `release:prep:minor`, or `release:prep:promote` created the version commit on `release/vX.Y.Z` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI)
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z` tag without triggering a second CI run, while `npm run release:publish`, the merge of the green `reconcile/vX.Y.Z` PR, and the release heartbeat started in parallel
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z` tag without triggering a second CI run, while `npm run release:publish`, the `reconcile/vX.Y.Z` PR, and the release heartbeat started in parallel
- [ ] All seven `@getpaseo/*` npm packages show `latest` at the new stable, and `beta` at the new stable too unless an active newer beta holds `beta`
- [ ] The GitHub Release was published only after the three stable manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
- [ ] GitHub `Desktop Release` workflow for the `v*` tag is green
+1 -1
View File
@@ -1 +1 @@
sha256-oBd6CQ8+BhzMHhrpRIwzojuFPUwqXpgc3ZAPqKPs5QQ=
sha256-x6E6SY98/8pUNLomlPzSNedZ+ZKJPzsQeS9L455i+n0=
+29 -29
View File
@@ -1,12 +1,12 @@
{
"name": "paseo",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"hasInstallScript": true,
"license": "Apache-2.0",
"workspaces": [
@@ -37552,7 +37552,7 @@
},
"packages/app": {
"name": "@getpaseo/app",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"dependencies": {
"@codemirror/commands": "6.10.4",
"@codemirror/language": "6.12.4",
@@ -39705,13 +39705,13 @@
},
"packages/cli": {
"name": "@getpaseo/cli",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.19.0-beta.1",
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/server": "0.19.0-beta.1",
"@getpaseo/client": "0.18.2",
"@getpaseo/protocol": "0.18.2",
"@getpaseo/server": "0.18.2",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
@@ -39961,11 +39961,11 @@
},
"packages/client": {
"name": "@getpaseo/client",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/relay": "0.19.0-beta.1",
"@getpaseo/protocol": "0.18.2",
"@getpaseo/relay": "0.18.2",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
@@ -39977,7 +39977,7 @@
},
"packages/desktop": {
"name": "@getpaseo/desktop",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/cli": "*",
@@ -40221,7 +40221,7 @@
},
"packages/expo-two-way-audio": {
"name": "@getpaseo/expo-two-way-audio",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.14",
@@ -40267,7 +40267,7 @@
},
"packages/highlight": {
"name": "@getpaseo/highlight",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@codemirror/language": "6.12.4",
@@ -40297,7 +40297,7 @@
},
"packages/plugin": {
"name": "@getpaseo/plugin",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^1.4.0",
@@ -40305,8 +40305,8 @@
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.19.0-beta.1",
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/client": "0.18.2",
"@getpaseo/protocol": "0.18.2",
"@types/node": "^20.9.0",
"@types/react": "~19.2.0",
"react": "19.2.3",
@@ -40316,8 +40316,8 @@
"zod": "^4.4.3"
},
"peerDependencies": {
"@getpaseo/client": "0.19.0-beta.1",
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/client": "0.18.2",
"@getpaseo/protocol": "0.18.2",
"react": ">=19.1.0 <20",
"react-native": ">=0.81.5",
"zod": "^4.4.3"
@@ -40339,7 +40339,7 @@
},
"packages/protocol": {
"name": "@getpaseo/protocol",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"semver": "^7.8.5",
@@ -40366,7 +40366,7 @@
}
},
"packages/react-native-enriched-markdown": {
"version": "0.19.0-beta.1",
"version": "0.18.2",
"hasInstallScript": true,
"license": "MIT",
"peerDependencies": {
@@ -40382,7 +40382,7 @@
},
"packages/relay": {
"name": "@getpaseo/relay",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@noble/ciphers": "^2.4.0",
@@ -40604,17 +40604,17 @@
},
"packages/server": {
"name": "@getpaseo/server",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^0.17.1",
"@anthropic-ai/claude-agent-sdk": "0.3.326",
"@anthropic-ai/sdk": "^0.104.2",
"@getpaseo/client": "0.19.0-beta.1",
"@getpaseo/highlight": "0.19.0-beta.1",
"@getpaseo/plugin": "0.19.0-beta.1",
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/relay": "0.19.0-beta.1",
"@getpaseo/client": "0.18.2",
"@getpaseo/highlight": "0.18.2",
"@getpaseo/plugin": "0.18.2",
"@getpaseo/protocol": "0.18.2",
"@getpaseo/relay": "0.18.2",
"@isaacs/ttlcache": "^2.1.4",
"@modelcontextprotocol/node": "2.1.2",
"@modelcontextprotocol/sdk": "1.29.0",
@@ -41579,7 +41579,7 @@
},
"packages/website": {
"name": "@getpaseo/website",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"dependencies": {
"@cloudflare/vite-plugin": "^1.29.1",
"@cloudflare/workers-types": "^4.20260317.1",
@@ -43205,7 +43205,7 @@
},
"plugins": {
"name": "@getpaseo/builtin-plugins",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -1,8 +1,5 @@
import { mkdir, writeFile } from "node:fs/promises";
import path from "node:path";
import { gateNextAgentMessage } from "../support/helpers/agent-message-gate";
import { expectComposerDraft, submitMessage } from "../support/helpers/composer";
import { expectAgentIdle } from "../support/helpers/agent-stream";
import { test, expect, type Page } from "../support/fixtures";
import { seedMockAgentWorkspace, openAgentRoute } from "../support/helpers/mock-agent";
import { openChangesPanel, openChangesTreePanel } from "../support/helpers/workspace-tabs";
@@ -58,45 +55,3 @@ for (const width of [1400, 390]) {
}
});
}
async function addChangedFileToChat(page: Page) {
await openChangesPanel(page);
await page.getByTestId("diff-file-0-toggle").click({ button: "right" });
await page.getByTestId("diff-file-0-add-to-chat").click();
}
async function expectFollowUpAttachment(page: Page) {
await expect(page.getByTestId("composer-workspace-file-attachment-pill")).toContainText(
"follow-up.ts",
);
}
test("keeps a file added from Changes when an earlier send fails", async ({ page }) => {
const gate = await gateNextAgentMessage(page);
const workspace = await seedMockAgentWorkspace({
repoPrefix: "attachment-during-send-",
title: "Target chat",
featureValues: { mockPromptRejections: 1 },
});
try {
await writeFile(path.join(workspace.cwd, "follow-up.ts"), "export const followUp = true;\n");
await workspace.client.checkoutRefresh(workspace.cwd);
await openAgentRoute(page, workspace);
await expectAgentIdle(page);
await submitMessage(page, "Send this first.");
await gate.waitForRequest();
await addChangedFileToChat(page);
await expectFollowUpAttachment(page);
gate.accept();
await expect(
page.getByRole("alert").filter({ hasText: "Requested mock prompt rejection" }),
).toBeVisible();
await expectFollowUpAttachment(page);
await expectComposerDraft(page, "");
} finally {
await workspace.cleanup();
}
});
@@ -1219,30 +1219,6 @@ test.describe("Agent message submission", () => {
await retryRestoredSubmission(page, prompt);
});
test("keeps a follow-up draft after the earlier send is rejected", async ({ page }, testInfo) => {
const gate = await gateNextAgentMessage(page);
const agent = await seedMockAgentWorkspace({
repoPrefix: `pending-rejection-${testInfo.workerIndex}-`,
title: "Pending rejection",
model: "ten-second-stream",
featureValues: { mockPromptRejections: 1 },
});
try {
await openAgentRoute(page, { workspaceId: agent.workspaceId, agentId: agent.agentId });
await expectAgentIdle(page);
await submitMessage(page, "Send this first.");
await gate.waitForRequest();
await fillComposerDraft(page, "Keep this follow-up.");
gate.accept();
await expect(
page.getByRole("alert").filter({ hasText: "Requested mock prompt rejection" }),
).toBeVisible();
await expectComposerDraft(page, "Keep this follow-up.");
} finally {
await agent.cleanup();
}
});
test("restores an ambiguous Steer failure without retrying or interrupting", async ({
page,
}, testInfo) => {
@@ -606,35 +606,6 @@ async function refocusFindAndReplaceQuery(page: Page, shortcut: string) {
await page.keyboard.type("a.b");
await expect(query(page)).toHaveValue("a.b");
await expectHighlight(page, "a.b");
await typeInTheSameTaskAsShortcut(page, shortcut, "x");
await page.keyboard.type(".y");
await expect(query(page)).toHaveValue("x.y");
}
/**
* A fast typist's first key can land before the browser runs any timer queued
* by the shortcut. Pressing the shortcut and typing in one task makes that
* ordering certain instead of left to CI speed.
*/
async function typeInTheSameTaskAsShortcut(page: Page, shortcut: string, text: string) {
await composerLocator(page).click();
await expectComposerFocused(page);
await composerLocator(page).evaluate(
(element, { metaKey, typed }) => {
element.dispatchEvent(
new KeyboardEvent("keydown", {
key: "f",
metaKey,
ctrlKey: !metaKey,
bubbles: true,
cancelable: true,
}),
);
document.execCommand("insertText", false, typed);
},
{ metaKey: shortcut.startsWith("Meta"), typed: text },
);
await expect(query(page)).toBeFocused();
}
async function expectCommandCenterOwnsFindShortcut(page: Page, shortcut: string) {
@@ -4,7 +4,6 @@ import {
attachComposerTestImage,
cancelAgent,
composerLocator,
configureComposerQueueSend,
expectAttachmentPill,
expectComposerDraft,
expectComposerVisible,
@@ -103,27 +102,6 @@ test.describe("Composer queue", () => {
}
});
test("Send now with the queue send behavior steers instead of interrupting", async ({ page }) => {
const prompt = "Fold this into the running turn.";
await configureComposerQueueSend(page);
const agent = await seedAgentWithOpenTurn({ repoPrefix: "queue-steer-", title: "Queue steer" });
try {
await openAgentRoute(page, agent);
await expectComposerVisible(page);
await queueMessage(page, prompt);
await sendQueuedMessageNow(page, prompt);
await expectDeliveredOnce(page, prompt);
// Steering keeps the open turn, so its plan approval is still waiting. An interrupt
// would have replaced the turn and dropped it.
const fetched = await agent.client.fetchAgent({ agentId: agent.agentId });
expect(fetched?.agent.pendingPermissions).toHaveLength(1);
} finally {
await agent.cleanup();
}
});
test("the host delivers a queued prompt with every client closed", async ({ page }) => {
const prompt = "Continue while I am away.";
const agent = await seedAgentWithOpenTurn({
+18 -6
View File
@@ -46,6 +46,22 @@ function fitsViewportWidth(element: HTMLElement): boolean {
return element.scrollWidth === element.clientWidth;
}
async function expectSourceLineHighlighted(page: Page, text: string): Promise<void> {
const source = page.getByTestId("file-source-editor").filter({ visible: true });
const line = source.getByText(text, { exact: true });
await expect(line).toBeInViewport();
// CodeMirror draws selection behind the text in a separate layer.
const highlight = source.locator(".cm-selectionBackground");
await expect(highlight, "The cited source line shows a visible selection").toBeVisible();
const [lineBounds, highlightBounds] = await Promise.all([
line.boundingBox(),
highlight.boundingBox(),
]);
expect(highlightBounds!.y + highlightBounds!.height).toBeGreaterThan(lineBounds!.y);
expect(highlightBounds!.y).toBeLessThan(lineBounds!.y + lineBounds!.height);
}
async function replaceEditorText(page: Page, content: string): Promise<void> {
await editor(page).fill(content);
}
@@ -416,9 +432,7 @@ test.describe("CodeMirror workspace file editing", () => {
await expectFileTabOpen(page, "target.ts");
await expect(page.getByTestId("file-source-editor")).toBeVisible();
await expect(page.getByLabel("Line 42, column 1")).toBeVisible();
await expect(
page.getByTestId("file-source-editor").locator(".cm-line", { hasText: "line42 = 42" }),
).toBeVisible();
await expectSourceLineHighlighted(page, "export const line42 = 42;");
const sourceEditor = editor(page);
await sourceEditor.click();
@@ -433,9 +447,7 @@ test.describe("CodeMirror workspace file editing", () => {
await fileLink.click();
await expect(page.getByLabel("Line 42, column 1")).toBeVisible();
await expect(
page.getByTestId("file-source-editor").locator(".cm-line", { hasText: "line42 = 42" }),
).toBeVisible();
await expectSourceLineHighlighted(page, "export const line42 = 42;");
} finally {
await session.cleanup();
}
@@ -294,22 +294,6 @@ test("Import Session keeps listings tied to their host during a switch and a pen
}
});
test("New workspace imports a session into a new workspace beside the one open at its directory", async ({
page,
}, testInfo) => {
const flow = new ImportSessionFlow(page);
await flow.openWorkspace(scenario.project.workspaceId, { width: 1280, height: 844 });
await flow.openGlobally();
await flow.importSession("fixture-root-07");
await flow.expectImportedIntoNewWorkspace({
existingWorkspaceId: scenario.project.workspaceId,
userText: "Review fixture item 7",
});
await page.screenshot({ path: testInfo.outputPath("new-workspace-import.png") });
});
test("captures the compact import-session journey", async ({ page }, testInfo) => {
const flow = new ImportSessionFlow(page);
await flow.openWorkspace(scenario.project.workspaceId, { width: 390, height: 844 });
@@ -9,8 +9,7 @@ import {
expectRemovedPlugin,
} from "../support/helpers/plugin-reconnect";
import { verifyPluginTranslations } from "../support/helpers/plugin-translations";
import { copyPluginExample, pluginRequirements } from "../support/helpers/plugin-fixture";
import { expectProviderIcon, readIconPaths } from "../support/helpers/plugin-provider-icons";
import { pluginRequirements } from "../support/helpers/plugin-fixture";
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
@@ -27,7 +26,7 @@ const TINY_PNG = Buffer.from(
);
const PLUGIN_SOURCE = `import { usePaseo } from "@getpaseo/plugin/client";
import { Icon, Modal, ProviderIcon, useToast, Markdown } from "@getpaseo/plugin/client/ui";
import { Icon, Modal, useToast, Markdown } from "@getpaseo/plugin/client/ui";
import { useQueryClient } from "@tanstack/react-query";
import React, { useState } from "react";
import { Pressable, Text, View } from "react-native";
@@ -54,7 +53,7 @@ function ModalBody({ onSaved }) {
</View>;
}
function Surface({ host, theme, playAudio }) {
function Surface({ playAudio }) {
const [audioStatus, setAudioStatus] = useState("Audio ready");
async function play(base64) {
setAudioStatus("Playing audio");
@@ -63,18 +62,6 @@ function Surface({ host, theme, playAudio }) {
}
const [open, setOpen] = useState(false);
return <View>
<View testID="plugin-provider-icon-builtin">
<ProviderIcon provider="codex" size={18} color={theme.colors.foreground} />
</View>
<View testID="plugin-provider-icon-plugin">
<ProviderIcon provider="direct-example" hostId={host.id} size={18} color={theme.colors.foreground} />
</View>
<View testID="plugin-provider-icon-fallback">
<ProviderIcon provider="unknown-provider-e2e" size={18} color={theme.colors.foreground} />
</View>
<View testID="plugin-provider-icon-bot-ref">
<Icon name="Bot" size={18} color={theme.colors.foreground} />
</View>
<Text>{audioStatus}</Text>
<Markdown>{"![Before](" + SCREENSHOT_PATH + ")\\n\\n![After](" + SCREENSHOT_FILE_URL + ")"}</Markdown>
<Pressable accessibilityRole="button" onPress={() => play(AUDIO_BASE64)}><Text>Play plugin audio</Text></Pressable>
@@ -99,7 +86,7 @@ function Surface({ host, theme, playAudio }) {
}
export default function contribute(plugin) {
plugin.addSurface("main", (props) => <Surface {...props} playAudio={plugin.playAudio} />);
plugin.addSurface("main", () => <Surface playAudio={plugin.playAudio} />);
plugin.addSidebarItem({
id: "main",
title: "Host UI",
@@ -179,9 +166,8 @@ async function savePluginIssue(page: Page): Promise<void> {
await expect(page.getByText("Plugin modal contexts ready", { exact: true })).not.toBeVisible();
}
test("plugin host UI renders provider icons and preserves modal contexts", async ({ page }) => {
test("plugin modal adapts its presentation and preserves host contexts", async ({ page }) => {
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-host-ui-e2e-"));
const providerPlugin = await copyPluginExample("provider-direct");
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
const previousConfig = await client.getDaemonConfig();
await writeFile(
@@ -201,29 +187,10 @@ test("plugin host UI renders provider icons and preserves modal contexts", async
try {
await client.patchDaemonConfig({ pluginsEnabled: true });
await client.installDirectoryPlugin(providerPlugin.directory);
await client.installDirectoryPlugin(directory);
await useNonCompactLayout(page);
await openHostUiPlugin(page);
await test.step("ProviderIcon renders built-in, daemon plugin SVG, and fallback icons", async () => {
const providerIconPaths = await readIconPaths(page, providerPlugin.directory);
await expectProviderIcon(page.getByTestId("plugin-provider-icon-plugin"), providerIconPaths);
const builtinSvg = page.getByTestId("plugin-provider-icon-builtin").locator("svg");
const fallbackSvg = page.getByTestId("plugin-provider-icon-fallback").locator("svg");
const botRefSvg = page.getByTestId("plugin-provider-icon-bot-ref").locator("svg");
await expect(builtinSvg).toBeVisible();
await expect(fallbackSvg).toBeVisible();
await expect(botRefSvg).toBeVisible();
const fallbackMarkup = await fallbackSvg.innerHTML();
const botRefMarkup = await botRefSvg.innerHTML();
const builtinMarkup = await builtinSvg.innerHTML();
expect(fallbackMarkup).toBe(botRefMarkup);
expect(builtinMarkup).not.toBe(botRefMarkup);
});
await test.step("plugin screen Markdown renders local absolute and file:// PNG images inline", async () => {
await expectLoadedMarkdownImage(page, "Before");
await expectLoadedMarkdownImage(page, "After");
@@ -250,13 +217,11 @@ test("plugin host UI renders provider icons and preserves modal contexts", async
});
} finally {
await client.removePlugin(PLUGIN_ID).catch(() => undefined);
await client.removePlugin("provider-direct-example").catch(() => undefined);
await client
.patchDaemonConfig({ pluginsEnabled: previousConfig.config.pluginsEnabled ?? false })
.catch(() => undefined);
await client.close().catch(() => undefined);
await rm(directory, { recursive: true, force: true });
await providerPlugin.cleanup();
}
});
@@ -18,8 +18,7 @@ function finish() {
process.exit(0);
}
// Raw mode before the query: a reply that arrives while the tty still echoes
// would be printed on the capture line as a second "]11;rgb:".
process.stdout.write("\\x1b]11;?\\x07");
if (process.stdin.isTTY) {
process.stdin.setRawMode(true);
}
@@ -27,7 +26,6 @@ process.stdin.resume();
process.stdin.on("data", (chunk) => {
captured = Buffer.concat([captured, chunk]);
});
process.stdout.write("\\x1b]11;?\\x07");
setTimeout(finish, 700);
`;
@@ -1,10 +1,5 @@
import type { Locator, Page } from "@playwright/test";
import { expect, test } from "../support/fixtures";
import {
clickNewTerminal,
gotoWorkspace,
openNewTabMenuWithShortcut,
} from "../support/helpers/launcher";
import { clickNewTerminal, gotoWorkspace } from "../support/helpers/launcher";
import { seedWorkspace } from "../support/helpers/seed-client";
import { waitForWorkspaceTabsVisible } from "../support/helpers/workspace-tabs";
@@ -35,44 +30,3 @@ test("web switches to the previous and next tab with Alt+Shift+[ and ]", async (
await workspace.cleanup();
}
});
async function openBlankTabAfterTerminal(page: Page) {
await clickNewTerminal(page);
await page.getByRole("button", { name: "Terminal 1", exact: true }).focus();
await openNewTabMenuWithShortcut(page);
return page
.getByRole("button", { name: "New tab", exact: true })
.and(page.locator('[aria-selected="true"]'));
}
async function middleClickWithoutDefaultMouseUp(tab: Locator) {
const release = await tab.evaluateHandle((element) => {
const result = { event: null as Event | null };
element.addEventListener(
"mouseup",
(event) => {
result.event = event;
},
{ once: true },
);
return result;
});
await tab.click({ button: "middle" });
await expect(tab).toHaveCount(0);
// Chromium uses the mouseup default action to paste the X11 selection.
expect(await release.evaluate(({ event }) => event?.defaultPrevented)).toBe(true);
}
test("middle-clicking a tab cancels the mouse release before returning to a terminal", async ({
page,
withWorkspace,
}) => {
const workspace = await withWorkspace({ prefix: "tab-middle-click-" });
await workspace.navigateTo();
const tab = await openBlankTabAfterTerminal(page);
await test.step("close the blank tab without the browser's default middle-button action", async () => {
await middleClickWithoutDefaultMouseUp(tab);
await expect(page.getByRole("textbox", { name: "Terminal input" })).toBeFocused();
});
});
@@ -1,5 +1,5 @@
import { expect, type Page } from "@playwright/test";
import { buildHostWorkspaceRoute, parseHostWorkspaceRouteFromPathname } from "@/utils/host-routes";
import { buildHostWorkspaceRoute } from "@/utils/host-routes";
import { gotoAppShell } from "./app";
import { openCommandCenter } from "./command-center";
import { openGlobalNewWorkspaceComposer } from "./new-workspace";
@@ -194,30 +194,6 @@ export class ImportSessionFlow {
userText,
);
}
/** The import opened in a workspace of its own, listed in the sidebar beside `existingWorkspaceId`. */
async expectImportedIntoNewWorkspace(input: {
existingWorkspaceId: string;
userText: string;
}): Promise<string> {
await expect
.poll(
() => {
const workspaceId = this.currentWorkspaceId();
return workspaceId !== null && workspaceId !== input.existingWorkspaceId;
},
{ timeout: 30_000 },
)
.toBe(true);
const importedWorkspaceId = this.currentWorkspaceId();
if (!importedWorkspaceId) throw new Error("The import left the workspace route");
await this.expectImportedIntoWorkspace(importedWorkspaceId, input.userText);
for (const id of [input.existingWorkspaceId, importedWorkspaceId]) {
await expect(
this.page.getByTestId(`sidebar-workspace-row-${getServerId()}:${id}`),
).toBeVisible();
}
return importedWorkspaceId;
}
async close() {
await this.page.getByRole("button", { name: "Close", exact: true }).last().click();
await expect(this.page.getByTestId("import-session-sheet")).toHaveCount(0);
@@ -242,11 +218,6 @@ export class ImportSessionFlow {
timeout: 30_000,
});
}
private currentWorkspaceId(): string | null {
return (
parseHostWorkspaceRouteFromPathname(new URL(this.page.url()).pathname)?.workspaceId ?? null
);
}
private async rowIds() {
return await this.page
.locator('[data-testid^="import-session-session-claude-"]')
@@ -45,9 +45,6 @@ function Details({ workspaceId, theme, layout, close }) {
owner.subscribe({ snapshot(value) { setOwnerId(value.subscriptionId); }, update() { setUpdates((n) => n + 1); } });
return () => { void owner.release(); };
}, [paseo]);
React.useEffect(() => {
globalThis.__buttonContentMounts = (globalThis.__buttonContentMounts ?? 0) + 1;
}, []);
const rpc = useRpc(summary);
const query = useQuery({ queryKey: ["summary"], queryFn: () => rpc({}) });
if (failed) throw new Error("Button content failed");
@@ -201,13 +198,6 @@ async function expectDetails(page: Page) {
await expect(page.getByText("All systems operational", { exact: true })).toBeInViewport();
}
/** How many times button content has mounted on the page, counted by the content itself. */
async function contentMounts(page: Page): Promise<number> {
return page.evaluate(
() => (globalThis as { __buttonContentMounts?: number }).__buttonContentMounts ?? 0,
);
}
// The details render before the daemon answers their event subscription, and reopened
// details show the cached summary at once, so wait for the subscription id to arrive.
async function readContentObservation(page: Page): Promise<string> {
@@ -241,17 +231,14 @@ async function expectCompactDetails(page: Page) {
await expect(menu.getByText("Presentation: compact", { exact: true })).toBeVisible();
}
/**
* Resolves once `subject` renders the same pixels twice in a row: entering animations are done.
* A remount detaches the element mid-screenshot; that is not still yet, so the poll starts over.
*/
/** Resolves once `subject` renders the same pixels twice in a row: entering animations are done. */
async function expectStill(subject: Locator) {
let previous: Buffer | null = null;
await expect
.poll(
async () => {
const current = await screenshotAttached(subject);
const still = previous !== null && current !== null && current.equals(previous);
const current = await subject.screenshot();
const still = previous !== null && current.equals(previous);
previous = current;
return still;
},
@@ -260,17 +247,6 @@ async function expectStill(subject: Locator) {
.toBe(true);
}
async function screenshotAttached(subject: Locator): Promise<Buffer | null> {
try {
return await subject.screenshot();
} catch (error) {
if (error instanceof Error && error.message.includes("Element is not attached to the DOM")) {
return null;
}
throw error;
}
}
/** Attaches the screen once per colour scheme, for review alongside the run. */
async function captureSchemes(page: Page, info: TestInfo, name: string, subject: Locator) {
for (const colorScheme of ["light", "dark"] as const) {
@@ -384,18 +360,15 @@ export async function withButtonShowcase(
await run({
verifyObservationLifetime: () =>
test.step("closing and crashing content release its owner while sibling buttons and app remain live", async () => {
const mountsBefore = await contentMounts(page);
await press(page, "Header status");
await expectDetails(page);
const first = await readContentObservation(page);
expect(await contentMounts(page)).toBe(mountsBefore + 1);
await press(page, "Close deployment details");
await expect.poll(() => released.has(first)).toBe(true);
await press(page, "Composer status");
await expectDetails(page);
const second = await readContentObservation(page);
expect(second).not.toBe(first);
expect(await contentMounts(page)).toBe(mountsBefore + 2);
await workspace.client.renameProject(workspace.projectId, "Observer control");
await expect(page.getByText("Observed updates: 1", { exact: true })).toBeVisible();
await press(page, "Fail button content");
@@ -15,7 +15,7 @@ const MODEL_LABEL = "Select model (Example 1)";
const WIDE = { width: 1400, height: 950 };
const COMPACT = { width: 390, height: 844 };
export async function readIconPaths(page: Page, pluginDirectory: string): Promise<string[]> {
async function readIconPaths(page: Page, pluginDirectory: string): Promise<string[]> {
const svg = await readFile(path.join(pluginDirectory, "icon.svg"), "utf8");
return page.evaluate(
(source) =>
@@ -33,7 +33,7 @@ function readIconDrawings(icons: SVGElement[]): string[][] {
);
}
export async function expectProviderIcon(surface: Locator, paths: string[]): Promise<void> {
async function expectProviderIcon(surface: Locator, paths: string[]): Promise<void> {
await expect(surface).toBeVisible();
// Provider icons are decorative SVGs without accessible names. Compare the
// plugin asset's drawing, allowing surface-specific size and theme colours.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"private": true,
"main": "index.ts",
"scripts": {
@@ -242,28 +242,6 @@ const longEditDetail = {
newString: "new line\n".repeat(80),
};
describe("tool detail empty state", () => {
it("insets the empty-state text from the disclosure edge", () => {
act(() =>
root.render(
<QueryClientProvider client={queryClient}>
<ToolCallDetailsContent maxHeight={200} />
</QueryClientProvider>,
),
);
const text = view().getByText("No additional details available");
const style = getComputedStyle(text);
expect(style.paddingTop).toBe("12px");
expect(style.paddingRight).toBe("12px");
expect(style.paddingBottom).toBe("12px");
expect(style.paddingLeft).toBe("12px");
const textBox = text.getBoundingClientRect();
const containerBox = container.getBoundingClientRect();
expect(textBox.left).toBeGreaterThanOrEqual(containerBox.left);
expect(textBox.right).toBeLessThanOrEqual(containerBox.right);
});
});
describe("capped tool scrolling", () => {
it.each([longShellDetail, longEditDetail])(
"gives a capped $type detail one vertical scroll owner",
@@ -55,47 +55,6 @@ it("keeps unavailable probes and external paths on the existing file-open path",
}
});
it("opens an existing absolute folder outside the workspace without a trailing slash", async () => {
const root = await mkdtemp(path.join(tmpdir(), "outside-folder-link-"));
roots.push(root);
const workspaceRoot = path.join(root, "workspace");
const folder = path.join(root, "reports").split(path.sep).join("/");
const file = path.join(root, "notes.txt").split(path.sep).join("/");
await mkdir(workspaceRoot);
await mkdir(folder);
await writeFile(file, "notes");
const { classifyForResolution } = await import("./resolver");
const { resolveInlinePathDestination } = await import("./path-open");
const client = {
listDirectory: (cwd: string, requestedPath: string) => {
const absolute = path.resolve(cwd, requestedPath);
if (path.relative(cwd, absolute).split(path.sep)[0] === "..") {
throw new Error("Access outside of workspace is not allowed");
}
return readdir(absolute);
},
getDirectorySuggestions: async () => ({ entries: [], error: null }),
};
const destination = async (href: string) => {
const resolution = classifyForResolution({ href, text: "Open path" }, { workspaceRoot });
if (resolution.kind !== "resolved" || resolution.value.kind !== "file") {
throw new Error("Expected an explicit path link");
}
return resolveInlinePathDestination({ target: resolution.value.target, workspaceRoot, client });
};
await expect(destination(file)).resolves.toMatchObject({
kind: "file",
location: { path: file },
});
await expect(destination(folder + "/")).resolves.toEqual({
kind: "outsideDirectory",
path: folder,
});
await expect(destination(folder)).resolves.toEqual({ kind: "outsideDirectory", path: folder });
});
it("ignores an older probe after a newer file link opens", async () => {
const { createInlinePathOpener } = await import("./path-open");
let rejectProbe!: (error: Error) => void;
@@ -4,7 +4,6 @@ import {
type WorkspaceFileLocation,
type OpenFileDisposition,
} from "@/workspace/file-open";
import { resolveFilePreviewReadTarget } from "@/file-explorer/preview-target";
import { isAbsolutePath } from "@/utils/path";
import { resolveMissingNestedRelativeFile, type GetDirectorySuggestions } from "./resolver";
@@ -27,30 +26,27 @@ function isOutsideWorkspacePath(pathValue: string): boolean {
return isAbsolutePath(pathValue) || pathValue === "~" || pathValue.startsWith("~/");
}
/** Resolve folders from filesystem facts, including names that contain dots. */
/** Resolve workspace folders from filesystem facts, including names that contain dots. */
export async function resolveInlinePathOpen(input: PathOpenInput): Promise<PathOpenTarget> {
if (!input.file) {
return isOutsideWorkspacePath(input.directory)
? { kind: "outsideDirectory", directoryPath: input.directory }
: { kind: "directory", directoryPath: input.directory };
}
if (input.lineStart !== undefined || !input.workspaceRoot.trim() || !input.client) {
if (
input.lineStart !== undefined ||
isAbsolutePath(input.file) ||
!input.workspaceRoot.trim() ||
!input.client
) {
return { kind: "file" };
}
const outside = isOutsideWorkspacePath(input.file);
const probe = outside
? resolveFilePreviewReadTarget({ path: input.file, workspaceRoot: input.workspaceRoot })
: { cwd: input.workspaceRoot, path: input.file };
if (!probe) return { kind: "file" };
try {
await input.client.listDirectory(probe.cwd, probe.path);
await input.client.listDirectory(input.workspaceRoot, input.file);
} catch {
return { kind: "file" };
}
return {
kind: outside ? "outsideDirectory" : "directory",
directoryPath: input.file,
};
return { kind: "directory", directoryPath: input.file };
}
export type InlinePathDestination =
@@ -2,6 +2,7 @@ import { useOverlayRegistration, type KeyboardInputEvent } from "@/keyboard";
import { Modal } from "@/components/ui/modal";
import { type ReactNode, useCallback, useEffect, useMemo, useState } from "react";
import { Pressable, Text, View } from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { StyleSheet } from "react-native-unistyles";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { X } from "lucide-react-native";
@@ -11,6 +12,7 @@ import {
type AttachmentPreviewUrl,
useAttachmentPreviewUrl,
} from "@/attachments/use-attachment-preview-url";
import { isNative } from "@/constants/platform";
import { useRetainedPanelActive } from "@/components/retained-panel";
import { SPACING } from "@/styles/theme";
import { WindowChromeRootRegion } from "@/utils/desktop-window";
@@ -28,6 +30,7 @@ interface AttachmentLightboxProps {
onClose: () => void;
}
const ModalRoot = isNative ? GestureHandlerRootView : View;
const LIGHTBOX_FIT = { padding: SPACING[4], maxWidth: 960, maxHeight: 640 };
export function AttachmentLightbox({ source, onClose }: AttachmentLightboxProps) {
@@ -92,7 +95,7 @@ export function AttachmentLightbox({ source, onClose }: AttachmentLightboxProps)
return (
<Modal transparent animationType="fade" statusBarTranslucent visible onRequestClose={onClose}>
<View style={styles.root}>
<ModalRoot style={styles.root}>
{/* The modal draws over the whole window: its insets are the window's, not the ones left
where the image was opened (inside a sheet tab, the bottom one is already spent). */}
<WindowSafeArea>
@@ -126,7 +129,7 @@ export function AttachmentLightbox({ source, onClose }: AttachmentLightboxProps)
</View>
</WindowChromeRootRegion>
</WindowSafeArea>
</View>
</ModalRoot>
</Modal>
);
}
+3 -6
View File
@@ -10,11 +10,8 @@ import { inlineUnistylesStyle } from "@/styles/unistyles-inline-style";
import { getCodeInsets } from "./code-insets";
import { CODE_SURFACE_DATASET } from "@/styles/code-surface";
import { isWeb } from "@/constants/platform";
import { ScrollView } from "@/components/ui/scroll-view";
// Horizontal code scrolls through the shared ScrollView, which keeps its swipes from the mobile
// panels. Vertical section scrolling keeps its own scroller.
const SectionScrollView = isWeb ? RNScrollView : GHScrollView;
const ScrollView = isWeb ? RNScrollView : GHScrollView;
interface DiffViewerProps {
diffLines: DiffLine[];
@@ -185,14 +182,14 @@ export function DiffViewer({
if (!fillAvailableHeight) return horizontalScroll;
const content = (
<SectionScrollView
<ScrollView
style={outerScrollStyle}
contentContainerStyle={webVerticalContentStyle}
nestedScrollEnabled
showsVerticalScrollIndicator
>
{horizontalScroll}
</SectionScrollView>
</ScrollView>
);
return content;
@@ -371,12 +371,6 @@ describe("resolveImportTarget", () => {
).toEqual({ crossWorkspace: true });
});
it("asks for a new workspace when the sheet was opened to create one", () => {
expect(
resolveImportTarget({ entryCwd: "/repo/paseo", isScopedListing: false, newWorkspace: true }),
).toEqual({ newWorkspace: true, crossWorkspace: true });
});
it("treats a sheet with no workspace as cross-workspace", () => {
expect(resolveImportTarget({ entryCwd: "/repo/paseo", isScopedListing: false })).toEqual({
crossWorkspace: true,
@@ -215,8 +215,6 @@ export interface ImportTarget {
* rejects an import whose cwd does not match the requested workspace.
*/
workspaceId?: string;
/** The host creates a fresh workspace for the row's directory. */
newWorkspace?: true;
/**
* The agent lands in a workspace other than the one the sheet was opened from,
* so the caller has to open that workspace instead of adding a tab here.
@@ -231,12 +229,7 @@ export function resolveImportTarget(input: {
workspaceId?: string | null;
/** The listed rows came from a fetch scoped to `workspaceCwd`. */
isScopedListing: boolean;
/** The sheet was opened to create a workspace, so every import gets its own. */
newWorkspace?: boolean;
}): ImportTarget {
if (input.newWorkspace) {
return { newWorkspace: true, crossWorkspace: true };
}
if (!input.workspaceId || !input.workspaceCwd) {
return { crossWorkspace: true };
}
@@ -73,8 +73,6 @@ interface ImportSessionSheetProps {
serverId: string | null;
cwd?: string | null;
workspaceId?: string | null;
/** Each import gets a fresh workspace instead of joining the one open at its directory. */
newWorkspace?: boolean;
onClose: () => void;
/** The agent belongs to the workspace the sheet was opened from; open it here. */
onImportedAgent?: (agentId: string) => void;
@@ -509,7 +507,6 @@ export function ImportSessionSheet({
serverId,
cwd,
workspaceId,
newWorkspace = false,
onClose,
onImportedAgent,
onImported,
@@ -713,14 +710,12 @@ export function ImportSessionSheet({
workspaceCwd: cwd,
workspaceId,
isScopedListing: scopeCwd !== null,
newWorkspace,
});
const agent = await client.importAgent({
providerId: entry.providerId,
providerHandleId: entry.providerHandleId,
cwd: entry.cwd,
...(target.workspaceId ? { workspaceId: target.workspaceId } : {}),
...(target.newWorkspace ? { newWorkspace: true } : {}),
});
// A pending import keeps the listing and navigation from the host it was sent to.
void queryClient.invalidateQueries({
@@ -1,6 +1,5 @@
import React, { Component, type ErrorInfo, type ReactNode } from "react";
import { Text, View } from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { useTranslation } from "react-i18next";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { StyleSheet } from "react-native-unistyles";
@@ -64,10 +63,8 @@ export function RootErrorFallback({ error, onReload }: RootErrorFallbackProps) {
</Button>
);
// The fallback replaces the app tree, so it sits above the app's gesture root and needs its own:
// the details scroll sideways under a gesture detector on native.
return (
<GestureHandlerRootView
<View
style={[
styles.container,
{
@@ -98,7 +95,7 @@ export function RootErrorFallback({ error, onReload }: RootErrorFallbackProps) {
{isCompact ? null : reload}
</View>
{isCompact ? <View style={styles.footer}>{reload}</View> : null}
</GestureHandlerRootView>
</View>
);
}
@@ -26,11 +26,8 @@ import { HighlightedLines } from "./highlighted-content";
import { DiffViewer } from "./diff-viewer";
import { getCodeInsets } from "./code-insets";
import { isWeb } from "@/constants/platform";
import { ScrollView } from "@/components/ui/scroll-view";
// Horizontal code scrolls through the shared ScrollView, which keeps its swipes from the mobile
// panels. Vertical section scrolling keeps its own scroller.
const SectionScrollView = isWeb ? RNScrollView : GHScrollView;
const ScrollView = isWeb ? RNScrollView : GHScrollView;
// A capped detail scrolls as a whole. Only full-height sheets need section scrollers.
function DetailSectionBody({
@@ -43,13 +40,9 @@ function DetailSectionBody({
const bodyStyle = useMemo(() => [style, contentContainerStyle], [style, contentContainerStyle]);
if (fillAvailableHeight) {
return (
<SectionScrollView
{...scrollProps}
style={style}
contentContainerStyle={contentContainerStyle}
>
<ScrollView {...scrollProps} style={style} contentContainerStyle={contentContainerStyle}>
{children}
</SectionScrollView>
</ScrollView>
);
}
return <View style={bodyStyle}>{children}</View>;
@@ -583,13 +576,13 @@ export function ToolCallDetailsContent({
if (resolvedMaxHeight !== undefined) {
return (
<SectionScrollView
<ScrollView
style={inlineUnistylesStyle({ maxHeight: resolvedMaxHeight })}
contentContainerStyle={ds.fullBleedContainerStyle}
nestedScrollEnabled
>
{sections}
</SectionScrollView>
</ScrollView>
);
}
return <View style={ds.fullBleedContainerStyle}>{sections}</View>;
@@ -754,7 +747,6 @@ const styles = StyleSheet.create((theme) => {
color: theme.colors.destructive,
},
emptyStateText: {
padding: insets.padding,
color: theme.colors.foregroundMuted,
fontSize: theme.fontSize.base,
fontStyle: "italic",
+3 -1
View File
@@ -32,6 +32,7 @@ import { useIsCompactFormFactor } from "@/constants/layout";
import { useRetainedPanelActive } from "@/components/retained-panel";
import { BottomSheetScrollView, type BottomSheetBackgroundProps } from "@gorhom/bottom-sheet";
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { Check, File, Folder, Search } from "lucide-react-native";
import {
flip,
@@ -1409,7 +1410,8 @@ function DesktopComboboxBody(props: DesktopBodyProps): ReactElement | null {
visible={props.isOpen}
onRequestClose={props.handleClose}
>
{overlay}
{/* Android Modal opens a separate window outside the app's gesture root. */}
<GestureHandlerRootView style={styles.desktopOverlay}>{overlay}</GestureHandlerRootView>
</Modal>
);
}
@@ -120,27 +120,6 @@ describe("anchored menu surface on web", () => {
},
);
it("mounts its content once per open", async () => {
const lifecycle: string[] = [];
function RecordsMounts() {
useEffect(() => {
lifecycle.push("mount");
return () => {
lifecycle.push("unmount");
};
}, []);
return <View testID="body" style={SHORT} />;
}
mountMenuAbovePill(<RecordsMounts />);
await wait(SETTLE_MS);
expect(element("panel").getBoundingClientRect().bottom).toBeLessThanOrEqual(
element("pill").getBoundingClientRect().top,
);
expect(lifecycle).toEqual(["mount"]);
});
it("widens when its content widens after the entering animation", async () => {
mountMenuAbovePill(<GrowsAfterOpen afterMs={GROWS_BEFORE_CLEANUP_MS} from={SHORT} to={WIDE} />);
@@ -284,12 +284,9 @@ export function AnchoredSurface({
// The surface is placed once both measurements land. Until then it sits off-screen so it can
// be measured, and it must not animate: an entering animation that ran there would be over
// before anyone saw the menu. Native remounts the surface on placement so Reanimated's
// `entering` starts from the final position. Web keeps it mounted and starts its own animation
// on placement: a remount would mount the content twice per open, running its effects and
// requests again and dropping its first state.
// before anyone saw the menu. Remounting on placement starts the native animation from the
// final position; web starts its own animation on placement.
const placed = position !== null;
const surfaceKey = isWeb || placed ? "placed" : "measuring";
useWebContentEntering({ placed, surfaceNativeID });
@@ -368,7 +365,7 @@ export function AnchoredSurface({
) : null}
<View pointerEvents="box-none" style={frame.holder}>
<FloatingSurface
key={surfaceKey}
key={placed ? "placed" : "measuring"}
collapsable={false}
tabIndex={-1}
nativeID={surfaceNativeID}
+2 -17
View File
@@ -3,12 +3,9 @@ import {
Modal as NativeModal,
Platform,
useWindowDimensions,
StyleSheet,
type ModalProps as NativeModalProps,
} from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { useDismissibleOverlay } from "@/components/ui/overlay-dismissal";
import { isNative } from "@/constants/platform";
// React Native defaults iPhone modals to portrait even when the app supports rotation.
const orientations: NonNullable<NativeModalProps["supportedOrientations"]> = [
@@ -25,26 +22,14 @@ type ModalProps = Omit<NativeModalProps, "onRequestClose"> & {
function noClose() {}
export function Modal({ children, ...props }: ModalProps) {
export function Modal(props: ModalProps) {
const { visible = true, onRequestClose, style } = props;
useDismissibleOverlay(visible && onRequestClose !== undefined, onRequestClose ?? noClose);
const windowFrame = useAndroidWindowFrame();
const containerStyle = useMemo(() => [windowFrame, style], [windowFrame, style]);
return (
<NativeModal supportedOrientations={orientations} {...props} style={containerStyle}>
{isNative ? (
<GestureHandlerRootView style={styles.gestureRoot}>{children}</GestureHandlerRootView>
) : (
children
)}
</NativeModal>
);
return <NativeModal supportedOrientations={orientations} {...props} style={containerStyle} />;
}
// A native modal is a separate window above the app's gesture root. Its content gets its own, so
// gestures recognize there and gesture detectors (a horizontal ScrollView) can mount.
const styles = StyleSheet.create({ gestureRoot: { flex: 1 } });
/**
* On Android, React Native lays out a modal's first frames at the screen size minus the status and
* navigation bars, then grows it to the full window once the dialog reports its size. The app draws
@@ -1,229 +0,0 @@
import React, { act, createRef, type ReactNode } from "react";
import { createRoot, type Root } from "react-dom/client";
import {
ScrollView as ReactNativeScrollView,
View,
type FlatList as ReactNativeFlatList,
} from "react-native";
import { GestureDetector } from "react-native-gesture-handler";
import { afterEach, describe, expect, it } from "vitest";
import { cdp } from "vitest/browser";
import {
FileExplorerCloseGestureContext,
useCloseFileExplorerGesture,
useOpenFileExplorerGesture,
} from "@/mobile-panels/gestures";
import { MobilePanelsProvider } from "@/mobile-panels/provider";
import { usePanelStore } from "@/stores/panel-store";
import { FlatList, ScrollView } from "./scroll-view.native";
import { ScrollView as WebScrollView } from "./scroll-view.web";
Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });
const initialPanelState = usePanelStore.getState();
let root: Root | null = null;
let host: HTMLDivElement | null = null;
let explorerOpens = 0;
function recordExplorerOpen(): void {
explorerOpens += 1;
}
afterEach(async () => {
await act(async () => root?.unmount());
host?.remove();
root = null;
host = null;
usePanelStore.setState(initialPanelState, true);
explorerOpens = 0;
});
const FILL = { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 } as const;
const ROW = { height: 120 } as const;
const WIDE_CONTENT = { width: 2000, height: 120 } as const;
const ITEMS = ["one", "two", "three"];
const WIDE_ITEM = { width: 800, height: 120 } as const;
async function mount(node: ReactNode): Promise<void> {
host = document.createElement("div");
host.style.cssText = "position: fixed; inset: 0;";
document.body.appendChild(host);
const created = createRoot(host);
root = created;
await act(async () => created.render(<MobilePanelsProvider>{node}</MobilePanelsProvider>));
}
function byTestID(testID: string): HTMLElement {
const element = document.querySelector(`[data-testid="${testID}"]`);
if (!(element instanceof HTMLElement)) throw new Error(`${testID} did not render`);
return element;
}
/** Converts a point in the test frame to the top page, which draws the frame scaled to fit. */
function toPage(x: number, y: number): { x: number; y: number } {
const frame = window.frameElement?.getBoundingClientRect();
const scale = frame ? frame.width / window.innerWidth : 1;
return { x: x * scale, y: y * scale };
}
function horizontalPath(direction: "left" | "right"): [number, number] {
const width = window.innerWidth;
return direction === "left" ? [width - 8, 20] : [20, width - 8];
}
/**
* A drag across the row with real pointer input. A browser does not scroll an overflow container
* for a mouse drag, so the row reports only what the gesture handlers decide between themselves:
* the arbitration iOS and Android run for a touch.
*/
async function dragAcross(row: HTMLElement, direction: "left" | "right"): Promise<void> {
const session = cdp();
const y = row.getBoundingClientRect().top + 60;
const [fromX, toX] = horizontalPath(direction);
const mouse = (type: "mousePressed" | "mouseMoved" | "mouseReleased", x: number) =>
session.send("Input.dispatchMouseEvent", {
type,
...toPage(x, y),
button: "left",
buttons: type === "mouseReleased" ? 0 : 1,
clickCount: 1,
});
await mouse("mousePressed", fromX);
const steps = 12;
for (let step = 1; step <= steps; step += 1) {
await mouse("mouseMoved", fromX + ((toX - fromX) * step) / steps);
}
await mouse("mouseReleased", toX);
await new Promise((resolve) => setTimeout(resolve, 100));
}
function ExplorerOpenSurface({ children }: { children: ReactNode }) {
const gesture = useOpenFileExplorerGesture({ enabled: true, onOpen: recordExplorerOpen });
return (
<GestureDetector gesture={gesture} touchAction="pan-y">
<View style={FILL}>{children}</View>
</GestureDetector>
);
}
function ExplorerCloseSurface({ children }: { children: ReactNode }) {
const { gesture, gestureRef } = useCloseFileExplorerGesture(true);
return (
<FileExplorerCloseGestureContext value={gestureRef}>
<GestureDetector gesture={gesture} touchAction="pan-y">
<View style={FILL}>{children}</View>
</GestureDetector>
</FileExplorerCloseGestureContext>
);
}
function wideItem() {
return <View style={WIDE_ITEM} />;
}
const rows = {
plain: () => <View testID="row" style={ROW} />,
verticalScrollView: () => (
<ScrollView testID="row" style={ROW}>
<View style={WIDE_CONTENT} />
</ScrollView>
),
horizontalScrollView: () => (
<ScrollView testID="row" style={ROW} horizontal>
<View style={WIDE_CONTENT} />
</ScrollView>
),
horizontalFlatList: () => (
<FlatList testID="row" style={ROW} horizontal data={ITEMS} renderItem={wideItem} />
),
};
describe("native ScrollView and FlatList beside the mobile panels", () => {
async function swipeToOpenExplorer(row: () => ReactNode): Promise<number> {
await mount(<ExplorerOpenSurface>{row()}</ExplorerOpenSurface>);
await dragAcross(byTestID("row"), "left");
return explorerOpens;
}
it("opens a panel from a swipe on content that does not scroll sideways", async () => {
expect(await swipeToOpenExplorer(rows.plain)).toBe(1);
});
it("leaves a sideways swipe on a vertical ScrollView to the panel", async () => {
expect(await swipeToOpenExplorer(rows.verticalScrollView)).toBe(1);
});
it("keeps a sideways swipe on a horizontal ScrollView from opening a panel", async () => {
expect(await swipeToOpenExplorer(rows.horizontalScrollView)).toBe(0);
});
it("keeps a sideways swipe on a horizontal FlatList from opening a panel", async () => {
expect(await swipeToOpenExplorer(rows.horizontalFlatList)).toBe(0);
});
async function swipeToCloseExplorer(row: () => ReactNode): Promise<string> {
usePanelStore.setState({ mobilePanel: { target: "file-explorer", revision: 1 } });
await mount(<ExplorerCloseSurface>{row()}</ExplorerCloseSurface>);
await dragAcross(byTestID("row"), "right");
return usePanelStore.getState().mobilePanel.target;
}
it("closes an open panel from a swipe on content that does not scroll sideways", async () => {
expect(await swipeToCloseExplorer(rows.plain)).toBe("agent");
});
it("keeps a sideways swipe on a horizontal ScrollView from closing the panel it is in", async () => {
expect(await swipeToCloseExplorer(rows.horizontalScrollView)).toBe("file-explorer");
});
it("forwards refs to the React Native scroll view and list", async () => {
const scrollRef = createRef<ReactNativeScrollView>();
const listRef = createRef<ReactNativeFlatList<string>>();
await mount(
<>
<ScrollView ref={scrollRef} horizontal>
<View style={WIDE_CONTENT} />
</ScrollView>
<FlatList ref={listRef} horizontal data={ITEMS} renderItem={wideItem} />
</>,
);
expect(typeof scrollRef.current?.scrollTo).toBe("function");
expect(typeof listRef.current?.scrollToOffset).toBe("function");
});
});
/** A one-finger swipe with real touch input; the browser scrolls overflow containers for it. */
async function touchSwipeAcross(row: HTMLElement, direction: "left" | "right"): Promise<void> {
const session = cdp();
await session.send("Emulation.setTouchEmulationEnabled", { enabled: true, maxTouchPoints: 1 });
const y = row.getBoundingClientRect().top + 60;
const [fromX, toX] = horizontalPath(direction);
const touch = (type: "touchStart" | "touchMove", x: number) =>
session.send("Input.dispatchTouchEvent", { type, touchPoints: [toPage(x, y)] });
await touch("touchStart", fromX);
const steps = 12;
for (let step = 1; step <= steps; step += 1) {
await touch("touchMove", fromX + ((toX - fromX) * step) / steps);
await new Promise((resolve) => setTimeout(resolve, 16));
}
await session.send("Input.dispatchTouchEvent", { type: "touchEnd", touchPoints: [] });
await new Promise((resolve) => setTimeout(resolve, 200));
}
describe("web ScrollView beside the mobile panels", () => {
// The browser scrolls a horizontal overflow container itself and cancels the page's pointer
// stream, so the plain React Native ScrollView already keeps the swipe on web.
it("scrolls a horizontal ScrollView under a real touch swipe instead of opening a panel", async () => {
await mount(
<ExplorerOpenSurface>
<WebScrollView testID="row" style={ROW} horizontal>
<View style={WIDE_CONTENT} />
</WebScrollView>
</ExplorerOpenSurface>,
);
await touchSwipeAcross(byTestID("row"), "left");
expect(byTestID("row").scrollLeft).toBeGreaterThan(0);
expect(explorerOpens).toBe(0);
});
});
@@ -1,64 +0,0 @@
import { forwardRef, type ReactElement, type Ref } from "react";
import {
ScrollView as NativeScrollView,
FlatList as NativeFlatList,
type ScrollViewProps,
type FlatListProps,
} from "react-native";
import { BottomSheetScrollView, BottomSheetFlatList } from "@gorhom/bottom-sheet";
import { GestureDetector } from "react-native-gesture-handler";
import { usePanelAwareHorizontalScrollGesture } from "@/mobile-panels/gestures";
import { useAttachSheetContentDrag, useIsInsideBottomSheet } from "./bottom-sheet-scope";
import { withContentDrag } from "./content-drag";
// Gorhom forwards to the RN FlatList and ScrollView instances. Its published ref types disagree
// about getScrollResponder; keep that type discrepancy at this boundary.
const SheetScroll = BottomSheetScrollView as unknown as typeof NativeScrollView;
const SheetFlatList = BottomSheetFlatList as unknown as typeof NativeFlatList;
/** The presentation owns gesture integration; callers keep the React Native API. */
export const ScrollView = forwardRef<NativeScrollView, ScrollViewProps>(
function ScrollView(props, ref) {
const inSheet = useIsInsideBottomSheet();
if (props.horizontal) {
return (
<HorizontalScrollGesture>
<NativeScrollView {...props} ref={ref} />
</HorizontalScrollGesture>
);
}
if (inSheet) return <SheetScrollView {...props} ref={ref} />;
return <PageScrollView {...props} ref={ref} />;
},
);
/** Sideways scrolling looks the same in a sheet and on a page: the scroller keeps its touches. */
function HorizontalScrollGesture({ children }: { children: ReactElement }) {
const gesture = usePanelAwareHorizontalScrollGesture();
return <GestureDetector gesture={gesture}>{children}</GestureDetector>;
}
const PageScrollView = withContentDrag<ScrollViewProps, NativeScrollView>(NativeScrollView);
const SheetScrollView = withContentDrag<ScrollViewProps, NativeScrollView>(
SheetScroll,
useAttachSheetContentDrag,
);
function PresentationFlatList<Item>(props: FlatListProps<Item>, ref: Ref<NativeFlatList<Item>>) {
const inSheet = useIsInsideBottomSheet();
if (props.horizontal) {
return (
<HorizontalScrollGesture>
<NativeFlatList {...props} ref={ref} />
</HorizontalScrollGesture>
);
}
if (inSheet) return <SheetFlatList {...props} ref={ref} />;
return <NativeFlatList {...props} ref={ref} />;
}
// forwardRef erases the item generic. Both implementations expose the RN list methods.
export const FlatList = forwardRef(PresentationFlatList) as <Item>(
props: FlatListProps<Item> & { ref?: Ref<NativeFlatList<Item>> },
) => ReactElement;
+66 -2
View File
@@ -1,2 +1,66 @@
// Metro loads scroll-view.native.tsx or scroll-view.web.tsx; TypeScript checks callers against native.
export { ScrollView, FlatList } from "./scroll-view.native";
import { forwardRef, type Ref } from "react";
import {
ScrollView as NativeScrollView,
FlatList as NativeFlatList,
type ScrollViewProps,
type FlatListProps,
} from "react-native";
import { BottomSheetScrollView, BottomSheetFlatList } from "@gorhom/bottom-sheet";
import {
ScrollView as GestureScrollView,
FlatList as GestureFlatList,
type NativeViewGestureHandlerProps,
} from "react-native-gesture-handler";
import { isNative } from "@/constants/platform";
import { useAttachSheetContentDrag, useIsInsideBottomSheet } from "./bottom-sheet-scope";
import { withContentDrag } from "./content-drag";
// Both libraries forward to the RN FlatList and ScrollView instances. Their published ref types
// disagree about getScrollResponder (Gorhom) and include the component function
// in the instance intersection (RNGH); keep that type discrepancy at this boundary.
const SheetScroll = BottomSheetScrollView as unknown as typeof NativeScrollView;
const SheetFlatList = BottomSheetFlatList as unknown as typeof NativeFlatList;
const HorizontalFlatList = GestureFlatList as unknown as <Item>(
props: FlatListProps<Item> & NativeViewGestureHandlerProps & { ref?: Ref<NativeFlatList<Item>> },
) => React.ReactElement;
/** The presentation owns gesture integration; callers keep the React Native API. */
export const ScrollView = forwardRef<NativeScrollView, ScrollViewProps>(
function ScrollView(props, ref) {
const inSheet = useIsInsideBottomSheet();
if (!inSheet) return <PageScrollView {...props} ref={ref} />;
if (props.horizontal) {
return isNative ? (
<GestureScrollView {...props} ref={ref} disallowInterruption />
) : (
<NativeScrollView {...props} ref={ref} />
);
}
return <SheetScrollView {...props} ref={ref} />;
},
);
const PageScrollView = withContentDrag<ScrollViewProps, NativeScrollView>(NativeScrollView);
const SheetScrollView = withContentDrag<ScrollViewProps, NativeScrollView>(
SheetScroll,
useAttachSheetContentDrag,
);
function SheetAwareFlatList<Item>(props: FlatListProps<Item>, ref: Ref<NativeFlatList<Item>>) {
const inSheet = useIsInsideBottomSheet();
if (!inSheet) return <NativeFlatList {...props} ref={ref} />;
if (props.horizontal) {
return isNative ? (
<HorizontalFlatList {...props} ref={ref} disallowInterruption />
) : (
<NativeFlatList {...props} ref={ref} />
);
}
return <SheetFlatList {...props} ref={ref} />;
}
// forwardRef erases the item generic. All three implementations expose the RN list methods.
export const FlatList = forwardRef(SheetAwareFlatList) as <Item>(
props: FlatListProps<Item> & { ref?: Ref<NativeFlatList<Item>> },
) => React.ReactElement;
@@ -467,7 +467,6 @@ export function WorkspaceSetupDialog() {
attachments={chatDraft.attachments}
onChangeAttachments={chatDraft.setAttachments}
cwd={sourceDirectory}
getDraftRevision={chatDraft.getRevision}
clearDraft={chatDraft.clear}
autoFocus
commandDraft={composerState?.commandDraft}
@@ -68,7 +68,6 @@ export interface AgentInputDraft {
textReplacement: TextReplacement;
attachments: UserComposerAttachment[];
setAttachments: (updater: AttachmentUpdater) => void;
getRevision: () => number;
clear: (lifecycle: "sent" | "abandoned") => void;
isHydrated: boolean;
attachmentFocusRequestId: number;
@@ -196,11 +195,6 @@ export function useAgentInputDraft(input: UseAgentInputDraftInput): AgentInputDr
[draftKey],
);
const getRevision = useCallback(
() => useDraftStore.getState().getDraftRevision(draftKey),
[draftKey],
);
const clear = useCallback(
(lifecycle: "sent" | "abandoned") => {
useDraftStore.getState().clearDraftInput({ draftKey, lifecycle });
@@ -387,7 +381,6 @@ export function useAgentInputDraft(input: UseAgentInputDraftInput): AgentInputDr
textReplacement,
attachments,
setAttachments,
getRevision,
clear,
isHydrated,
attachmentFocusRequestId,
@@ -587,7 +587,6 @@ export function WorkspaceDraftComposer({
onOpenWorkspaceAttachment={handleOpenWorkspaceAttachment}
onChangeAttachments={draftInput.setAttachments}
cwd={composerState.workingDir}
getDraftRevision={draftInput.getRevision}
clearDraft={draftInput.clear}
editingSession={editingSession}
autoFocus={shouldAutoFocusWorkspaceDraftComposer({ isPaneFocused, isSubmitting })}
-4
View File
@@ -952,7 +952,6 @@ interface ComposerProps {
onForgeChangeRequestDetected?: () => void;
onForgeChangeRequestAutoAttach?: (item: ForgeSearchItem) => void;
cwd: string;
getDraftRevision: () => number;
clearDraft: (lifecycle: "sent" | "abandoned") => void;
/** When true, auto-focuses the text input on web. */
autoFocus?: boolean;
@@ -1281,7 +1280,6 @@ function ComposerContentImpl({
onForgeChangeRequestDetected,
onForgeChangeRequestAutoAttach,
cwd,
getDraftRevision,
clearDraft,
autoFocus = false,
autoFocusKey,
@@ -1884,7 +1882,6 @@ function ComposerContentImpl({
await submitMessage(submitText, submitAttachments);
},
clearDraft,
getDraftRevision,
setUserInput: replaceUserInput,
setAttachments: (nextAttachments) => {
setSelectedAttachments(composerWorkspaceAttachment.userAttachmentsOnly(nextAttachments));
@@ -1907,7 +1904,6 @@ function ComposerContentImpl({
clearDraft,
completeSubmit,
enqueueMessage,
getDraftRevision,
hasExternalContent,
isAgentRunning,
supportsQueue,
@@ -133,7 +133,7 @@ describe("sendQueuedMessageNow", () => {
it.each([
["steer", "a:steer"],
["interrupt", "a:interrupt"],
["queue", "a:steer"],
["queue", "a:interrupt"],
] as const)("with the %s send behavior promotes as %s", async (sendBehavior, expected) => {
const queue = await queueHolding(queued);
+1 -1
View File
@@ -51,6 +51,6 @@ export async function sendQueuedMessageNow(input: {
}): Promise<void> {
await input.model.promote(
input.messageId,
input.sendBehavior === "interrupt" ? "interrupt" : "steer",
input.sendBehavior === "steer" ? "steer" : "interrupt",
);
}
+1 -1
View File
@@ -49,7 +49,7 @@ const QUEUE_MAX_HEIGHT_COMPACT = 140;
interface ComposerQueueTrackProps {
serverId: string;
agentId: string;
/** The user's send behavior setting. Send now interrupts only when it is `interrupt`; otherwise it steers. */
/** The user's send behavior setting. Send now steers or interrupts accordingly. */
sendBehavior: SendBehavior;
providerLabel: (provider: string) => string;
onRestore: (message: RestoredQueuedMessage) => void;
-53
View File
@@ -35,7 +35,6 @@ describe("submitAgentInput", () => {
canSubmit: true,
queueMessage,
submitMessage,
getDraftRevision: () => 0,
clearDraft,
setUserInput,
setAttachments,
@@ -60,53 +59,6 @@ describe("submitAgentInput", () => {
expect(clearDraft).toHaveBeenCalledWith("sent");
});
it.each([
{ delivery: "send", outcome: "failed" },
{ delivery: "send", outcome: "submitted" },
{ delivery: "queue", outcome: "failed" },
{ delivery: "queue", outcome: "queued" },
] as const)(
"preserves edits made while a $delivery is pending ($outcome)",
async ({ delivery, outcome }) => {
let revision = 0;
let text = "first message";
let attachments = ["first.txt"];
const setUserInput = (next: string) => {
text = next;
revision++;
};
const setAttachments = (next: string[]) => {
attachments = next;
revision++;
};
const deferred = createDeferredPromise<void>();
const result = submitAgentInput({
message: text,
attachments,
isAgentRunning: delivery === "queue",
canSubmit: true,
queueMessage: () => deferred.promise,
submitMessage: () => deferred.promise,
clearDraft: () => {
setUserInput("");
setAttachments([]);
},
setUserInput,
setAttachments,
getDraftRevision: () => revision,
setSendError: vi.fn(),
setIsProcessing: vi.fn(),
});
setUserInput("follow-up");
setAttachments(["second.txt"]);
if (outcome === "failed") deferred.reject(new Error("offline"));
else deferred.resolve();
expect(await result).toBe(outcome);
expect(text).toBe("follow-up");
expect(attachments).toEqual(["second.txt"]);
},
);
it("preserves the composer before an in-flight submit resolves when requested", async () => {
const deferred = createDeferredPromise<void>();
const attachments = [{ id: "img-1" }];
@@ -128,7 +80,6 @@ describe("submitAgentInput", () => {
canSubmit: true,
queueMessage,
submitMessage,
getDraftRevision: () => 0,
clearDraft,
setUserInput,
setAttachments,
@@ -172,7 +123,6 @@ describe("submitAgentInput", () => {
submitMessage: async ({ message }) => {
sent.push(message);
},
getDraftRevision: () => 0,
clearDraft: (lifecycle) => {
composer.draft = lifecycle;
},
@@ -243,7 +193,6 @@ describe("submitAgentInput", () => {
canSubmit: true,
queueMessage,
submitMessage,
getDraftRevision: () => 0,
clearDraft,
setUserInput,
setAttachments,
@@ -283,7 +232,6 @@ describe("submitAgentInput", () => {
submitMessage: async () => {
throw error;
},
getDraftRevision: () => 0,
clearDraft: vi.fn(),
setUserInput,
setAttachments,
@@ -317,7 +265,6 @@ describe("submitAgentInput", () => {
canSubmit: true,
queueMessage,
submitMessage,
getDraftRevision: () => 0,
clearDraft,
setUserInput,
setAttachments,
+2 -6
View File
@@ -17,7 +17,6 @@ export interface AgentInputSubmitActionInput<TAttachment> {
clearDraft: (lifecycle: "sent" | "abandoned") => void;
setUserInput: (text: string) => void;
setAttachments: (attachments: TAttachment[]) => void;
getDraftRevision: () => number;
setSendError: (message: string | null) => void;
setIsProcessing: (isProcessing: boolean) => void;
onSubmitError?: (error: unknown) => void;
@@ -51,21 +50,18 @@ export async function submitAgentInput<TAttachment>(
input.setUserInput("");
input.setAttachments([]);
}
const submittedRevision = shouldClearOnSubmit ? input.getDraftRevision() : null;
input.setSendError(null);
input.setIsProcessing(true);
try {
const deliver = shouldQueue ? input.queueMessage : input.submitMessage;
await deliver({ message: trimmedMessage, attachments });
if (!shouldClearOnSubmit || input.getDraftRevision() === submittedRevision) {
input.clearDraft("sent");
}
input.clearDraft("sent");
input.setIsProcessing(false);
return shouldQueue ? "queued" : "submitted";
} catch (error) {
input.onSubmitError?.(error);
if (shouldClearOnSubmit && input.getDraftRevision() === submittedRevision) {
if (shouldClearOnSubmit) {
input.setUserInput(trimmedMessage);
input.setAttachments(attachments);
}
@@ -1,4 +1,8 @@
import { DEFAULT_BROWSER_PROFILE_SLUG, useBrowserProfileCatalog } from "../profiles";
import {
DEFAULT_BROWSER_PROFILE_SLUG,
getBrowserProfilePartition,
useBrowserProfileCatalog,
} from "../profiles";
import { ProfileSelector } from "./profile-selector.electron";
import {
useCallback,
@@ -827,12 +831,16 @@ export function BrowserPane({
const updateBrowser = useBrowserStore((state) => state.updateBrowser);
const setBrowserViewport = useBrowserStore((state) => state.setBrowserViewport);
const setBrowserRoutingMode = useBrowserStore((state) => state.setBrowserRoutingMode);
const proxyState = useHostBrowserProxy({
serverId,
routingMode: browser?.routingMode,
profileSlug,
});
const activePartition = proxyState.kind === "ready" ? proxyState.partition : null;
const proxyState = useHostBrowserProxy({ serverId, routingMode: browser?.routingMode });
const isLocalProfileMode =
proxyState.kind === "ready" && proxyState.effectiveRoutingMode === "local";
let activePartition: string | null = null;
if (proxyState.kind === "ready") {
activePartition =
proxyState.effectiveRoutingMode === "host"
? proxyState.partition
: getBrowserProfilePartition(profileSlug);
}
const browserViewport = browser?.viewport ?? RESPONSIVE_BROWSER_VIEWPORT;
const browserViewportRef = useRef(browserViewport);
browserViewportRef.current = browserViewport;
@@ -1805,13 +1813,15 @@ export function BrowserPane({
initialValue={draftUrl}
/>
</View>
<ProfileSelector
selectedSlug={profileSlug}
catalog={catalog.data ?? []}
triggerStyle={profileTriggerStyle}
onSelect={selectProfile}
refresh={refreshProfiles}
/>
{isLocalProfileMode ? (
<ProfileSelector
selectedSlug={profileSlug}
catalog={catalog.data ?? []}
triggerStyle={profileTriggerStyle}
onSelect={selectProfile}
refresh={refreshProfiles}
/>
) : null}
<View style={styles.chromeRight}>
<DeviceSizeMenu
selectedId={selectedDeviceSizeId}
@@ -1,5 +1,4 @@
import { getIsElectron } from "@/constants/platform";
import { DEFAULT_BROWSER_PROFILE_SLUG } from "@/desktop/browser/profiles";
import {
getDesktopHost,
type DesktopBrowserProxyStatusSnapshot,
@@ -36,18 +35,13 @@ function notifyStatusListeners(serverId: string): void {
}
}
function hasSameProfilePartitions(a: Record<string, string>, b: Record<string, string>): boolean {
const slugs = Object.keys(a);
return slugs.length === Object.keys(b).length && slugs.every((slug) => a[slug] === b[slug]);
}
function setCachedStatus(snapshot: DesktopBrowserProxyStatusSnapshot): void {
const existing = statusByServerId.get(snapshot.serverId);
if (
existing &&
existing.status === snapshot.status &&
existing.error === snapshot.error &&
hasSameProfilePartitions(existing.profilePartitions, snapshot.profilePartitions) &&
existing.partition === snapshot.partition &&
existing.socksPort === snapshot.socksPort
) {
return;
@@ -59,12 +53,9 @@ function setCachedStatus(snapshot: DesktopBrowserProxyStatusSnapshot): void {
function isStatusSnapshot(value: unknown): value is DesktopBrowserProxyStatusSnapshot {
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
const record = value as Record<string, unknown>;
const profilePartitions = record.profilePartitions;
return (
typeof record.serverId === "string" &&
typeof profilePartitions === "object" &&
profilePartitions !== null &&
Object.values(profilePartitions).every((partition) => typeof partition === "string") &&
typeof record.partition === "string" &&
typeof record.status === "string"
);
}
@@ -277,7 +268,6 @@ export function subscribeBrowserProxyStatus(serverId: string, listener: () => vo
export async function ensureHostBrowserProxy(input: {
serverId: string;
target: SupportedTarget;
profileSlug?: string;
forceReconnect?: boolean;
}): Promise<DesktopBrowserProxyStatusSnapshot | null> {
installBrowserProxyRendererBridge();
@@ -355,15 +345,14 @@ export async function prepareHostBrowserPartition(
message: "Browser proxy bridge is unavailable in this desktop build.",
};
}
const partition = status.profilePartitions[DEFAULT_BROWSER_PROFILE_SLUG];
if (status.status !== "ready" || !partition) {
if (status.status !== "ready") {
return {
ok: false,
reason: "proxy_error",
message: status.error ?? "Unable to connect browser proxy.",
};
}
return { ok: true, partition, isRemoteHost: true };
return { ok: true, partition: status.partition, isRemoteHost: true };
} catch (error) {
return {
ok: false,
@@ -9,7 +9,7 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: { kind: "remote", support: "host_connecting" },
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: null,
ensureError: null,
@@ -27,11 +27,11 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: { kind: "remote", support: "host_offline" },
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: {
serverId: "srv-remote",
profilePartitions: { default: "persist:paseo-browser-host-0123456789abcdef" },
partition: "persist:paseo-browser-host-0123456789abcdef",
status: "connecting",
error: null,
socksPort: null,
@@ -50,7 +50,7 @@ describe("resolveBrowserProxyPaneState", () => {
it("keeps the prepared host partition mounted across transient host disconnects and reconnects", () => {
const preparedSnapshot = {
serverId: "srv-remote",
profilePartitions: { default: "persist:paseo-browser-host-0123456789abcdef" },
partition: "persist:paseo-browser-host-0123456789abcdef",
status: "ready" as const,
error: null,
socksPort: 41234,
@@ -60,7 +60,7 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: { kind: "remote", support: "host_offline" },
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: preparedSnapshot,
ensureError: null,
@@ -68,7 +68,7 @@ describe("resolveBrowserProxyPaneState", () => {
}),
).toEqual({
kind: "ready",
partition: preparedSnapshot.profilePartitions.default,
partition: preparedSnapshot.partition,
isRemoteHost: true,
effectiveRoutingMode: "host",
hostLabel: "devbox",
@@ -79,7 +79,7 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: { kind: "remote", support: "host_connecting" },
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: preparedSnapshot,
ensureError: null,
@@ -87,7 +87,7 @@ describe("resolveBrowserProxyPaneState", () => {
}),
).toEqual({
kind: "ready",
partition: preparedSnapshot.profilePartitions.default,
partition: preparedSnapshot.partition,
isRemoteHost: true,
effectiveRoutingMode: "host",
hostLabel: "devbox",
@@ -106,11 +106,11 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: supportedRouting,
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: {
serverId: "srv-remote",
profilePartitions: { default: "persist:paseo-browser-host-0123456789abcdef" },
partition: "persist:paseo-browser-host-0123456789abcdef",
status: "error",
error: "Host disconnected",
socksPort: 41234,
@@ -133,11 +133,11 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: supportedRouting,
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: {
serverId: "srv-remote",
profilePartitions: { default: "persist:paseo-browser-host-0123456789abcdef" },
partition: "persist:paseo-browser-host-0123456789abcdef",
status: "ready",
error: null,
socksPort: 41234,
@@ -159,11 +159,11 @@ describe("resolveBrowserProxyPaneState", () => {
resolveBrowserProxyPaneState({
routing: supportedRouting,
effectiveRoutingMode: "host",
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "devbox",
proxyStatusSnapshot: {
serverId: "srv-remote",
profilePartitions: { default: "persist:paseo-browser-host-0123456789abcdef" },
partition: "persist:paseo-browser-host-0123456789abcdef",
status: "error",
error: "Unable to create ticket",
socksPort: null,
@@ -185,7 +185,7 @@ describe("resolveBrowserProxyPaneState", () => {
const routedTarget = { via: "unix:///tmp/paseo.sock", serverId: "srv-dev" };
const input = {
effectiveRoutingMode: "host" as const,
profileSlug: "default",
localPartition: "persist:paseo-browser",
hostLabel: "dev",
ensureError: null,
onRetry: noop,
@@ -212,7 +212,7 @@ describe("resolveBrowserProxyPaneState", () => {
routing,
proxyStatusSnapshot: {
serverId: "srv-dev",
profilePartitions: { default: "persist:paseo-browser-host-dev" },
partition: "persist:paseo-browser-host-dev",
status: "ready",
error: null,
socksPort: 41000,
@@ -250,7 +250,7 @@ describe("resolveBrowserProxyPaneState", () => {
routing: { kind: "remote", support: "host_connecting" },
proxyStatusSnapshot: {
serverId: "srv-dev",
profilePartitions: { default: "persist:paseo-browser-host-dev" },
partition: "persist:paseo-browser-host-dev",
status: "ready",
error: null,
socksPort: 41000,
@@ -259,102 +259,4 @@ describe("resolveBrowserProxyPaneState", () => {
).toMatchObject({ kind: "ready", proxyStatus: "reconnecting" });
});
});
describe("browser profiles", () => {
const hostDefault = "persist:paseo-browser-host-0123456789abcdef";
const hostWork = `${hostDefault}-profile-work`;
const supportedRouting = {
kind: "remote" as const,
support: "supported" as const,
target: "tcp://10.0.0.5:6767",
};
const base = {
hostLabel: "devbox",
ensureError: null,
onRetry: noop,
};
it("mounts the local partition of the tab's profile when routing locally", () => {
expect(
resolveBrowserProxyPaneState({
...base,
routing: supportedRouting,
effectiveRoutingMode: "local",
profileSlug: "work",
proxyStatusSnapshot: null,
}),
).toMatchObject({ kind: "ready", partition: "persist:paseo-profile-work" });
});
it("waits for the host to bind the profile's session instead of mounting another profile", () => {
expect(
resolveBrowserProxyPaneState({
...base,
routing: supportedRouting,
effectiveRoutingMode: "host",
profileSlug: "work",
proxyStatusSnapshot: {
serverId: "srv-remote",
profilePartitions: { default: hostDefault },
status: "ready",
error: null,
socksPort: 41234,
},
}),
).toMatchObject({ kind: "connecting", effectiveRoutingMode: "host" });
});
it("waits for a profile whose slug matches an Object property name", () => {
expect(
resolveBrowserProxyPaneState({
...base,
routing: supportedRouting,
effectiveRoutingMode: "host",
profileSlug: "constructor",
proxyStatusSnapshot: {
serverId: "srv-remote",
profilePartitions: { default: hostDefault },
status: "ready",
error: null,
socksPort: 41234,
},
}),
).toMatchObject({ kind: "connecting", effectiveRoutingMode: "host" });
});
it("mounts the host partition of the tab's profile once it is bound", () => {
const snapshot = {
serverId: "srv-remote",
profilePartitions: { default: hostDefault, work: hostWork },
status: "ready" as const,
error: null,
socksPort: 41234,
};
expect(
resolveBrowserProxyPaneState({
...base,
routing: supportedRouting,
effectiveRoutingMode: "host",
profileSlug: "work",
proxyStatusSnapshot: snapshot,
}),
).toEqual({
kind: "ready",
partition: hostWork,
isRemoteHost: true,
effectiveRoutingMode: "host",
hostLabel: "devbox",
proxyStatus: "ready",
});
expect(
resolveBrowserProxyPaneState({
...base,
routing: { kind: "remote", support: "host_offline" },
effectiveRoutingMode: "host",
profileSlug: "work",
proxyStatusSnapshot: snapshot,
}),
).toMatchObject({ kind: "ready", partition: hostWork, proxyStatus: "reconnecting" });
});
});
});
@@ -1,7 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from "react";
import { getIsElectron } from "@/constants/platform";
import type { DesktopBrowserProxyStatus } from "@/desktop/host";
import { getBrowserProfilePartition } from "@/desktop/browser/profiles";
import { getDesktopHost, type DesktopBrowserProxyStatus } from "@/desktop/host";
import { resolveBrowserRoutingMode, type BrowserRoutingMode } from "@/desktop/browser/store";
import { useHosts } from "@/runtime/host-runtime";
import { normalizeHostLabel } from "@/types/host-connection";
@@ -52,35 +51,29 @@ export type BrowserProxyPaneState =
retry: () => void;
};
/** The profile's host partition, once main has bound its session to the host's SOCKS5 port. */
function readPreparedHostPartition(
function hasPreparedHostPartition(
snapshot: ReturnType<typeof getCachedBrowserProxyStatus>,
profileSlug: string,
): string | null {
if (
!snapshot ||
snapshot.socksPort === null ||
!Object.hasOwn(snapshot.profilePartitions, profileSlug)
) {
return null;
}
return snapshot.profilePartitions[profileSlug] ?? null;
): snapshot is NonNullable<ReturnType<typeof getCachedBrowserProxyStatus>> & {
partition: string;
socksPort: number;
} {
return Boolean(snapshot?.partition && snapshot.socksPort !== null);
}
function resolveRemoteUnavailablePaneState(
support: Exclude<Extract<HostBrowserRouting, { kind: "remote" }>["support"], "supported">,
hostLabel: string,
preparedPartition: string | null,
proxyStatusSnapshot: ReturnType<typeof getCachedBrowserProxyStatus>,
): BrowserProxyPaneState {
// Once Electron main has verified and bound this profile's session to the host's
// fixed SOCKS5 port, keep the webview mounted across transient host
// disconnects/reconnects so SPA state, forms, scroll, and DevTools survive.
// Requests still fail closed at the local SOCKS5 listener while the tunnel is down.
// Once Electron main has verified and bound this host's fixed SOCKS5 partition,
// keep the webview mounted across transient host disconnects/reconnects so SPA
// state, forms, scroll, and DevTools survive. Requests still fail closed at the
// local SOCKS5 listener while the tunnel is down.
const isTransientDisconnect = support === "host_connecting" || support === "host_offline";
if (isTransientDisconnect && preparedPartition) {
if (isTransientDisconnect && hasPreparedHostPartition(proxyStatusSnapshot)) {
return {
kind: "ready",
partition: preparedPartition,
partition: proxyStatusSnapshot.partition,
isRemoteHost: true,
effectiveRoutingMode: "host",
hostLabel,
@@ -116,7 +109,7 @@ function resolvePreparedHostPaneStatus(
export function resolveBrowserProxyPaneState(input: {
routing: HostBrowserRouting;
effectiveRoutingMode: BrowserRoutingMode;
profileSlug: string;
localPartition: string;
hostLabel: string;
proxyStatusSnapshot: ReturnType<typeof getCachedBrowserProxyStatus>;
ensureError: string | null;
@@ -125,7 +118,7 @@ export function resolveBrowserProxyPaneState(input: {
const {
routing,
effectiveRoutingMode,
profileSlug,
localPartition,
hostLabel,
proxyStatusSnapshot,
ensureError,
@@ -135,7 +128,7 @@ export function resolveBrowserProxyPaneState(input: {
if (routing.kind === "local" || effectiveRoutingMode === "local") {
return {
kind: "ready",
partition: getBrowserProfilePartition(profileSlug),
partition: localPartition,
isRemoteHost: routing.kind === "remote",
effectiveRoutingMode: "local",
hostLabel,
@@ -143,18 +136,17 @@ export function resolveBrowserProxyPaneState(input: {
};
}
const preparedPartition = readPreparedHostPartition(proxyStatusSnapshot, profileSlug);
if (routing.support !== "supported") {
return resolveRemoteUnavailablePaneState(routing.support, hostLabel, preparedPartition);
return resolveRemoteUnavailablePaneState(routing.support, hostLabel, proxyStatusSnapshot);
}
// Once the profile's session is bound to the fixed-port SOCKS5 proxy, keep the
// webview mounted even if a background poll (e.g. HMR) left the cached tunnel
// status in "error" or "reconnecting" while the host reconnects.
if (proxyStatusSnapshot && preparedPartition) {
// Once the fixed-port SOCKS5 session partition is verified (socksPort !== null),
// keep the webview mounted even if a background poll (e.g. HMR) left the cached
// tunnel status in "error" or "reconnecting" while the host reconnects.
if (hasPreparedHostPartition(proxyStatusSnapshot)) {
return {
kind: "ready",
partition: preparedPartition,
partition: proxyStatusSnapshot.partition,
isRemoteHost: true,
effectiveRoutingMode: "host",
hostLabel,
@@ -187,9 +179,8 @@ export function resolveBrowserProxyPaneState(input: {
export function useHostBrowserProxy(input: {
serverId: string;
routingMode?: BrowserRoutingMode;
profileSlug: string;
}): BrowserProxyPaneState {
const { serverId, routingMode, profileSlug } = input;
const { serverId, routingMode } = input;
const hosts = useHosts();
const host = useMemo(
() => hosts.find((entry) => entry.serverId === serverId) ?? null,
@@ -209,9 +200,6 @@ export function useHostBrowserProxy(input: {
);
const [retryCounter, setRetryCounter] = useState(0);
// A retry replaces the host tunnel once. Later runs (another profile on the same host)
// reuse the tunnel that other tabs on this host share.
const reconnectedRetryRef = useRef(0);
const [ensureError, setEnsureError] = useState<string | null>(null);
const effectiveRoutingMode = resolveBrowserRoutingMode(
@@ -237,13 +225,10 @@ export function useHostBrowserProxy(input: {
installBrowserProxyRendererBridge();
setEnsureError(null);
const forceReconnect = retryCounter > reconnectedRetryRef.current;
reconnectedRetryRef.current = retryCounter;
void ensureHostBrowserProxy({
serverId,
target: supportedTarget,
profileSlug,
forceReconnect,
forceReconnect: retryCounter > 0,
})
.then((snapshot) => {
if (cancelled) return undefined;
@@ -264,12 +249,13 @@ export function useHostBrowserProxy(input: {
};
// targetKey serializes supportedTarget deterministically.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [effectiveRoutingMode, profileSlug, retryCounter, serverId, targetKey]);
}, [effectiveRoutingMode, retryCounter, serverId, targetKey]);
const localPartition = getDesktopHost()?.browser?.profilePartition ?? "persist:paseo-browser";
return resolveBrowserProxyPaneState({
routing,
effectiveRoutingMode,
profileSlug,
localPartition,
hostLabel,
proxyStatusSnapshot,
ensureError,
+1 -3
View File
@@ -177,8 +177,7 @@ export type DesktopBrowserProxyStatus = "idle" | "connecting" | "ready" | "recon
export interface DesktopBrowserProxyStatusSnapshot {
serverId: string;
/** Profile slug -> partition, for every profile session bound to this host's proxy. */
profilePartitions: Record<string, string>;
partition: string;
status: DesktopBrowserProxyStatus;
error: string | null;
socksPort: number | null;
@@ -219,7 +218,6 @@ export interface DesktopBrowserBridge {
ensureHostProxy?: (input: {
serverId: string;
target: HostTransportSpec;
profileSlug?: string;
forceReconnect?: boolean;
}) => Promise<DesktopBrowserProxyStatusSnapshot>;
updateHostProxyTarget?: (input: { serverId: string; target: HostTransportSpec }) => Promise<void>;
@@ -120,8 +120,10 @@ export function FileEditorView({
const lineEnd = Math.min(location.lineEnd ?? lineStart, view.state.doc.lines);
const from = view.state.doc.line(lineStart).from;
const to = view.state.doc.line(Math.max(lineStart, lineEnd)).to;
// Keep the cursor at the first column for a single-line citation.
const selection = lineEnd > lineStart ? { anchor: from, head: to } : { anchor: to, head: from };
view.dispatch({
selection: { anchor: from, head: lineEnd > lineStart ? to : from },
selection,
effects: EditorView.scrollIntoView(from, { y: "center" }),
});
}, [location.lineEnd, location.lineStart, navigationRevision]);
@@ -10,8 +10,6 @@ interface UseImportSessionOptions {
serverId?: string;
cwd?: string;
workspaceId?: string;
/** Each import gets a fresh workspace instead of joining the one open at its directory. */
newWorkspace?: boolean;
}
interface UseImportSessionResult {
@@ -51,7 +49,6 @@ export function useImportSession({
serverId,
cwd,
workspaceId,
newWorkspace,
}: UseImportSessionOptions = {}): UseImportSessionResult {
const { t } = useTranslation();
const chooseHost = useHostChooser();
@@ -87,7 +84,6 @@ export function useImportSession({
serverId={importServerId}
cwd={cwd}
workspaceId={workspaceId}
newWorkspace={newWorkspace}
onClose={close}
onImported={navigateToImportedAgent}
/>
+10 -14
View File
@@ -8,23 +8,19 @@ import { useHorizontalScrollOptional } from "@/contexts/horizontal-scroll-contex
import { usePointerCapabilities } from "@/hooks/pointer-capabilities";
import { usePanelStore } from "@/stores/panel-store";
import { canBeginMobilePanelGesture, isMobilePanelGestureCurrent } from "./model";
import { useMobilePanelGestureRefs, useMobilePanelsRuntime } from "./provider";
import { useMobilePanelsRuntime } from "./provider";
import { resolveMobilePanelGestureIntent } from "./gesture-intent";
/**
* A horizontal scroller keeps the touches that start on it: no mobile panel opens or closes under
* it, and once it scrolls a parent pan such as a sheet's cannot take the touch.
*/
/** A horizontal surface takes the current touch before either panel opens. */
export function usePanelAwareHorizontalScrollGesture() {
const panelGestures = useMobilePanelGestureRefs();
const explorerCloseGesture = useFileExplorerCloseGestureRef();
return useMemo(() => {
const blocked = explorerCloseGesture ? [...panelGestures, explorerCloseGesture] : panelGestures;
return Gesture.Native()
.blocksExternalGesture(...blocked)
.disallowInterruption(true)
.shouldCancelWhenOutside(false);
}, [explorerCloseGesture, panelGestures]);
const { leftOpenGestureRef, rightOpenGestureRef } = useMobilePanelsRuntime();
return useMemo(
() =>
Gesture.Native()
.blocksExternalGesture(leftOpenGestureRef, rightOpenGestureRef)
.disallowInterruption(true),
[leftOpenGestureRef, rightOpenGestureRef],
);
}
function isCurrentSelection(startedRevision: number): boolean {
@@ -301,20 +301,6 @@ export function useMobilePanelsRuntime(): MobilePanelsRuntime {
return context;
}
/**
* The panel pans a surface inside the panels can block. A sheet portaled above the panels has none.
*/
export function useMobilePanelGestureRefs(): readonly RefObject<GestureType | undefined>[] {
const context = useContext(MobilePanelsContext);
const leftOpen = context?.leftOpenGestureRef;
const leftClose = context?.leftCloseGestureRef;
const rightOpen = context?.rightOpenGestureRef;
return useMemo(
() => (leftOpen && leftClose && rightOpen ? [leftOpen, leftClose, rightOpen] : []),
[leftOpen, leftClose, rightOpen],
);
}
/** The resolved left sidebar width shared by the dock, the overlay, and their gestures. */
export function useLeftPanelWidth(): number {
return useMobilePanelsRuntime().leftPanelWidth;
+1 -3
View File
@@ -116,6 +116,7 @@ const FindField = forwardRef<
<TextInput
ref={ref}
autoFocus={autoFocus}
selectTextOnFocus
initialValue={initialValue}
onChangeText={onChangeText}
onKeyPress={onKeyPress}
@@ -160,9 +161,6 @@ export const PaneFind = forwardRef<PaneFindHandle, PaneFindProps>(function PaneF
input.current?.replaceText(text, { start: 0, end: text.length });
}, []);
useImperativeHandle(ref, () => ({ focus }), [focus]);
// Select here rather than with selectTextOnFocus: React Native Web defers that
// selection to a timer, which then swallows keys typed right after the shortcut.
useLayoutEffect(focus, [focus]);
const onKeyPress = useCallback(
(event: NativeSyntheticEvent<TextInputKeyPressEventData>) => {
-4
View File
@@ -1192,7 +1192,6 @@ const ChatAgentReadyContent = memo(function ChatAgentReadyContent({
textReplacement,
attachments,
setAttachments,
getRevision,
clear,
isHydrated,
attachmentFocusRequestId,
@@ -1206,7 +1205,6 @@ const ChatAgentReadyContent = memo(function ChatAgentReadyContent({
textReplacement,
attachments,
setAttachments,
getRevision,
clear,
isHydrated,
attachmentFocusRequestId,
@@ -1219,7 +1217,6 @@ const ChatAgentReadyContent = memo(function ChatAgentReadyContent({
textReplacement,
attachments,
setAttachments,
getRevision,
clear,
isHydrated,
attachmentFocusRequestId,
@@ -1862,7 +1859,6 @@ function ActiveAgentComposer({
onOpenWorkspaceAttachment={handleOpenWorkspaceAttachment}
onChangeAttachments={agentInputDraft.setAttachments}
cwd={cwd}
getDraftRevision={agentInputDraft.getRevision}
clearDraft={agentInputDraft.clear}
editingSession={editingSession}
autoFocus
@@ -3,13 +3,8 @@ import appPackage from "../../package.json";
import { afterEach, expect, it } from "vitest";
import { QueryObserver } from "@tanstack/react-query";
import { DaemonClient } from "@getpaseo/client/internal/daemon-client";
import type {
GetProvidersSnapshotResponseMessage,
SessionOutboundMessage,
} from "@getpaseo/protocol/messages";
import { compactProviderSnapshot } from "@getpaseo/protocol/provider-snapshot-codec";
import type { SessionOutboundMessage } from "@getpaseo/protocol/messages";
import { settingsRpc } from "@getpaseo/plugin";
import { providerSnapshotIcons, replaceProviderSnapshotIcons } from "@/data/provider-icons";
import { syncPluginCatalog } from "./catalog-sync-model";
import { createPluginHosts } from "./hosts";
import { openPluginNotification } from "./notification-open";
@@ -574,90 +569,3 @@ it("keeps catalog loading before server_info arrives so cold-launch plugin taps
expect(h.registry.getCatalogStatus("host")).toBe("ready");
expect(openedRoutes).toEqual(["/h/host/plugin/ci-alerts/surface/alert?param.buildId=77"]);
});
function providerSnapshotPayload(
provider: string,
iconSvg: string,
snapshotHash: string,
): GetProvidersSnapshotResponseMessage["payload"] {
const entries = [
{
provider,
label: provider,
iconSvg,
enabled: true,
available: true,
status: "ready" as const,
updatedAt: "2026-01-01T00:00:00.000Z",
},
];
const compactSnapshot = compactProviderSnapshot(entries);
return {
requestId: "snapshot-req",
snapshotHash,
generatedAt: "2026-01-01T00:00:00.000Z",
entries,
compactSnapshot,
};
}
it("hydrates provider snapshot icons before installing plugins and refreshes them on catalog changes", async () => {
replaceProviderSnapshotIcons("host", []);
const events: string[] = [];
const firstSvg = '<svg viewBox="0 0 24 24"><path d="M2 2h20v20H2z" /></svg>';
const secondSvg = '<svg viewBox="0 0 24 24"><path d="M6 6h12v12H6z" /></svg>';
let current = { svg: firstSvg, hash: "hash-1" };
class SnapshotCatalogClient extends CatalogClient {
override async getProvidersSnapshot() {
events.push(`snapshot:${current.hash}`);
return providerSnapshotPayload("direct-example", current.svg, current.hash);
}
override async getPluginCatalog() {
events.push(
`catalog:${providerSnapshotIcons.getState().get("host")?.get("direct-example") ?? "missing"}`,
);
return super.getPluginCatalog();
}
}
const h = harness();
const client = new SnapshotCatalogClient();
h.sync({ client, supportsProviderSnapshots: true });
await expect.poll(() => h.registry.getCatalogStatus("host")).toBe("ready");
expect(events).toEqual(["snapshot:hash-1", `catalog:${firstSvg}`]);
expect(providerSnapshotIcons.getState().get("host")?.get("direct-example")).toBe(firstSvg);
current = { svg: secondSvg, hash: "hash-2" };
client.update({
type: "status",
payload: { status: "plugin_catalog_changed", pluginId: "direct-example" },
});
await expect
.poll(() => providerSnapshotIcons.getState().get("host")?.get("direct-example"))
.toBe(secondSvg);
expect(events).toEqual([
"snapshot:hash-1",
`catalog:${firstSvg}`,
"snapshot:hash-2",
`catalog:${secondSvg}`,
]);
});
it("still installs the plugin catalog when provider icon hydration fails", async () => {
replaceProviderSnapshotIcons("host", []);
class FailingSnapshotClient extends CatalogClient {
override async getProvidersSnapshot(): Promise<GetProvidersSnapshotResponseMessage["payload"]> {
throw new Error("Snapshot unavailable");
}
}
const h = harness();
h.sync({ client: new FailingSnapshotClient(), supportsProviderSnapshots: true });
await expect.poll(() => h.registry.getCatalogStatus("host")).toBe("ready");
expect(h.installed().id).toBe("reports");
});
+17 -37
View File
@@ -1,7 +1,5 @@
import { CancelledError } from "@tanstack/react-query";
import type { AudioEngine } from "@/audio";
import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
import { fetchProvidersSnapshot } from "@/data/providers-snapshot";
import type { PluginRegistry } from "./registry";
import { pluginSettingsKey, pluginSettingsPrefix } from "./settings/query";
@@ -12,7 +10,6 @@ interface CatalogSyncInput {
connected: boolean;
/** `null` while `server_info` has not yet arrived for this host. */
supported: boolean | null;
supportsProviderSnapshots?: boolean;
registry: Pick<
PluginRegistry,
"installCatalog" | "getSnapshot" | "removeHost" | "setCatalogStatus"
@@ -26,7 +23,6 @@ export function syncPluginCatalog({
audio,
connected,
supported,
supportsProviderSnapshots = false,
registry,
onCatalogChanged,
}: CatalogSyncInput): () => void {
@@ -45,42 +41,27 @@ export function syncPluginCatalog({
registry.setCatalogStatus(serverId, "loading");
const installationOptions = { client, audio };
let cancelled = false;
const abortController = new AbortController();
let refreshQueue = Promise.resolve();
async function prepareProviderIcons() {
if (!supportsProviderSnapshots) return;
try {
await fetchProvidersSnapshot({
client,
serverId,
cwd: null,
signal: abortController.signal,
});
} catch (error) {
if (!cancelled && !(error instanceof CancelledError)) {
console.warn(`[Plugins] Failed to load provider icons for ${serverId}`, error);
}
}
}
function refresh(replacePluginId?: string) {
refreshQueue = refreshQueue.then(async () => {
refreshQueue = refreshQueue.then(() => {
if (cancelled) return undefined;
registry.setCatalogStatus(serverId, "loading");
await prepareProviderIcons();
if (cancelled) return undefined;
try {
const catalog = await client.getPluginCatalog();
if (!cancelled) {
registry.installCatalog(serverId, catalog, { ...installationOptions, replacePluginId });
registry.setCatalogStatus(serverId, "ready");
}
} catch (error) {
if (!cancelled) {
registry.setCatalogStatus(serverId, "error");
console.warn(`[Plugins] Failed to load catalog for ${serverId}`, error);
}
}
return undefined;
return client
.getPluginCatalog()
.then((catalog) => {
if (!cancelled) {
registry.installCatalog(serverId, catalog, { ...installationOptions, replacePluginId });
registry.setCatalogStatus(serverId, "ready");
}
return undefined;
})
.catch((error) => {
if (!cancelled) {
registry.setCatalogStatus(serverId, "error");
console.warn(`[Plugins] Failed to load catalog for ${serverId}`, error);
}
return undefined;
});
});
return refreshQueue;
}
@@ -123,7 +104,6 @@ export function syncPluginCatalog({
});
return () => {
cancelled = true;
abortController.abort();
void observation
.release()
.catch((error) => console.warn("[Plugins] Failed to release catalog", error));
+2 -4
View File
@@ -2,7 +2,7 @@ import { useVoiceAudioEngineOptional } from "@/contexts/voice-context";
import { useEffect } from "react";
import { useQueryClient } from "@tanstack/react-query";
import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
import { useHostFeature, useHostFeatureAvailability } from "@/runtime/host-features";
import { useHostFeatureAvailability } from "@/runtime/host-features";
import { useHostRuntimeIsConnected } from "@/runtime/host-runtime";
import { pluginListQueryKey } from "./plugin-list";
import { pluginRegistry } from "./registry";
@@ -18,7 +18,6 @@ export function PluginCatalogSync({
const audio = useVoiceAudioEngineOptional();
const connected = useHostRuntimeIsConnected(serverId);
const supported = useHostFeatureAvailability(serverId, "plugins");
const supportsProviderSnapshots = useHostFeature(serverId, "providersSnapshot");
const queryClient = useQueryClient();
useEffect(
@@ -29,13 +28,12 @@ export function PluginCatalogSync({
audio,
connected,
supported,
supportsProviderSnapshots,
registry: pluginRegistry,
onCatalogChanged: () => {
void queryClient.invalidateQueries({ queryKey: pluginListQueryKey(serverId) });
},
}),
[audio, client, connected, queryClient, serverId, supported, supportsProviderSnapshots],
[audio, client, connected, queryClient, serverId, supported],
);
useEffect(() => () => pluginRegistry.removeHost(serverId), [serverId]);
+2 -2
View File
@@ -798,10 +798,10 @@ describe("evaluatePluginClientBundle", () => {
const plugin = evaluatePluginClientBundle(
"example",
`(function(require) {
const { Icon, ProviderIcon, Modal, useToast, SettingsSection, SidebarRow, StreamedText } = require("@getpaseo/plugin/client/ui");
const { Icon, Modal, useToast, SettingsSection, SidebarRow, StreamedText } = require("@getpaseo/plugin/client/ui");
const module = { exports: {} };
module.exports.default = function(plugin) {
if (typeof Icon !== "function" || typeof ProviderIcon !== "function" || typeof Modal !== "function" || typeof Modal.Content !== "function" || typeof useToast !== "function" || typeof SettingsSection !== "function" || typeof SidebarRow !== "function" || typeof StreamedText !== "function") {
if (typeof Icon !== "function" || typeof Modal !== "function" || typeof Modal.Content !== "function" || typeof useToast !== "function" || typeof SettingsSection !== "function" || typeof SidebarRow !== "function" || typeof StreamedText !== "function") {
throw new Error("React Native plugin UI is incomplete");
}
plugin.addSurface("main", function Surface() { return null; });
+6 -166
View File
@@ -1,77 +1,14 @@
// @vitest-environment jsdom
import { createPaseoApi } from "@getpaseo/client";
import { DaemonClient } from "@getpaseo/client/internal/daemon-client";
import type { PluginIconProps } from "@getpaseo/plugin";
import { PluginTranslationRuntime } from "@getpaseo/plugin/client/host";
import { QueryClient } from "@tanstack/react-query";
import { act, cleanup, renderHook } from "@testing-library/react";
import { Bot, Settings } from "lucide-react-native";
import { Settings } from "lucide-react-native";
import React, { isValidElement, type ReactElement, type ReactNode } from "react";
import Svg, { SvgXml } from "react-native-svg";
import { afterEach, describe, expect, it } from "vitest";
import { replaceProviderSnapshotIcons } from "@/data/provider-icons";
import { runPluginClientBundle, type PluginClientRuntime } from "./evaluate";
import {
Icon,
parsePluginIcon,
parseSerializablePluginIcon,
PluginIconView,
ProviderIcon,
} from "./icons";
import { PluginInstallationProvider } from "./installation-provider";
import type { InstalledPlugin } from "./types";
import { SvgXml } from "react-native-svg";
import { describe, expect, it } from "vitest";
import type { PluginIconProps } from "@getpaseo/plugin";
import { Icon, parsePluginIcon, parseSerializablePluginIcon, PluginIconView } from "./icons";
const SVG = '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M4 4h16v16H4z" /></svg>';
const SVG_ICON = { svg: SVG };
const GLYPHS = new Set<unknown>([Settings, Bot, Svg, SvgXml]);
afterEach(() => {
cleanup();
replaceProviderSnapshotIcons("host-a", []);
replaceProviderSnapshotIcons("host-b", []);
});
function makePlugin(serverId: string): InstalledPlugin {
return {
id: "icons-test",
serverId,
clientBundle: "",
lifetime: new AbortController(),
locale: "en",
i18n: new PluginTranslationRuntime({ getLocale: () => "en", subscribe: () => () => {} }),
paseo: createPaseoApi(
new DaemonClient({
url: "ws://127.0.0.1:1",
clientId: "icons-test",
reconnect: { enabled: false },
}),
),
invoke: async () => undefined,
subscribe: () => {
throw new Error("Subscriptions are not used here");
},
queryClient: new QueryClient(),
cleanup: () => undefined,
settingsScreens: [],
surfaces: [],
sidebarViews: [],
sidebarItems: { header: [], footer: [] },
legacySidebarItems: [],
workspaceRowBadgeItems: [],
filePanels: [],
composerItems: [],
newWorkspaceItems: [],
workspacePanels: [],
commandCenterItems: [],
clientSlashCommands: [],
attachmentSources: [],
themes: [],
timelineTransformers: [],
timelineRenderers: [],
notificationOpenHandlers: [],
};
}
const GLYPHS = new Set<unknown>([Settings, SvgXml]);
/** Expands function components down to what reaches the screen: a Lucide glyph, SvgXml, or DOM. */
function draw(node: ReactNode): ReactElement | null {
@@ -165,100 +102,3 @@ describe("Icon", () => {
expect(Icon({ icon: { svg: '<svg onload="run()"></svg>' } })).toBeNull();
});
});
describe("ProviderIcon", () => {
function hostWrapper(serverId: string) {
const plugin = makePlugin(serverId);
return function Wrapper({ children }: { children: ReactNode }) {
return <PluginInstallationProvider plugin={plugin}>{children}</PluginInstallationProvider>;
};
}
it("renders built-in, catalog, host-scoped daemon plugin SVGs, reactive updates, and fallback icons", () => {
const evaluated = runPluginClientBundle(
{ serverId: "host-a", pluginId: "icons-test" },
`(function(require) {
const { ProviderIcon } = require("@getpaseo/plugin/client/ui");
return {
default: function(plugin) {
plugin.addSurface("main", function() { return null; });
plugin.__ProviderIcon = ProviderIcon;
return function() {};
},
};
})`,
{} as PluginClientRuntime,
);
expect(evaluated.surfaces.map((s) => s.id)).toEqual(["main"]);
const hostASvg = '<svg viewBox="0 0 24 24"><path d="M4 4h16v16H4z" /></svg>';
const hostBSvg = '<svg viewBox="0 0 24 24"><path d="M12 2L2 22h20z" /></svg>';
replaceProviderSnapshotIcons("host-a", [{ provider: "direct-example", iconSvg: hostASvg }]);
replaceProviderSnapshotIcons("host-b", [{ provider: "direct-example", iconSvg: hostBSvg }]);
const wrapper = hostWrapper("host-a");
// Built-in provider resolves without hostId
const builtin = renderHook(
() => ProviderIcon({ provider: "codex", size: 18, color: "#123456" }),
{ wrapper },
);
expect(draw(builtin.result.current)).toMatchObject({
type: Svg,
props: { width: 18, height: 18, fill: "#123456" },
});
// Catalog provider resolves with defaults
const catalog = renderHook(() => ProviderIcon({ provider: "devin" }), { wrapper });
expect(draw(catalog.result.current)).toMatchObject({
type: SvgXml,
props: { width: 24, height: 24, color: "currentColor" },
});
// Daemon-registered plugin provider defaults to enclosing installation host and reacts to updates
const implicitHost = renderHook(
() => ProviderIcon({ provider: "direct-example", size: 20, color: "#abcdef" }),
{ wrapper },
);
expect(draw(implicitHost.result.current)).toMatchObject({
type: SvgXml,
props: { xml: hostASvg, width: 20, height: 20, color: "#abcdef" },
});
const updatedSvg = '<svg viewBox="0 0 24 24"><path d="M1 1h22v22H1z" /></svg>';
act(() => {
replaceProviderSnapshotIcons("host-a", [{ provider: "direct-example", iconSvg: updatedSvg }]);
});
expect(draw(implicitHost.result.current)).toMatchObject({
type: SvgXml,
props: { xml: updatedSvg, width: 20, height: 20, color: "#abcdef" },
});
// Explicit hostId targets the named host without leaking across hosts
const explicitHost = renderHook(
() =>
ProviderIcon({ provider: "direct-example", hostId: "host-b", size: 16, color: "#654321" }),
{ wrapper },
);
expect(draw(explicitHost.result.current)).toMatchObject({
type: SvgXml,
props: { xml: hostBSvg, width: 16, height: 16, color: "#654321" },
});
// Unknown provider falls back to Bot
const fallback = renderHook(
() =>
ProviderIcon({
provider: "unknown-provider",
hostId: "host-a",
size: 18,
color: "#111111",
}),
{ wrapper },
);
expect(draw(fallback.result.current)).toMatchObject({
type: Bot,
props: { size: 18, color: "#111111" },
});
});
});
+2 -15
View File
@@ -8,9 +8,8 @@ import {
type PluginSvgIcon,
} from "@getpaseo/plugin";
import type { PluginIcon } from "@getpaseo/plugin/client";
import type { IconProps, PluginProviderIconProps } from "@getpaseo/plugin/client/ui";
import { SvgIcon, useProviderIcon } from "@/components/provider-icons";
import { usePluginInstallationServerId } from "./installation-provider";
import type { IconProps } from "@getpaseo/plugin/client/ui";
import { SvgIcon } from "@/components/provider-icons";
/** Host surfaces may thin a Lucide stroke; SVG and plugin components ignore it. */
type HostIconProps = PluginIconProps & { strokeWidth?: number };
@@ -154,15 +153,3 @@ export function Icon(props: IconProps): ReactElement | null {
const color = props.color ?? "currentColor";
return createElement(PluginIconView, { icon, size, color });
}
/** The kit `ProviderIcon`. Resolves built-in, catalog, or host-scoped plugin provider icons. */
export function ProviderIcon({
provider,
hostId,
size = 24,
color = "currentColor",
}: PluginProviderIconProps): ReactElement {
const installationServerId = usePluginInstallationServerId();
const icon = useProviderIcon(provider, hostId ?? installationServerId);
return createElement(icon, { size, color });
}
+1 -1
View File
@@ -20,7 +20,7 @@ export { FilePanelLoading as Loading } from "@/file-panels/loading";
// COMPAT(pluginSettingsGroup): added in v0.13.0, remove after 2027-04-20
export { SettingsGroup } from "@/components/settings";
export { Icon, ProviderIcon } from "../icons";
export { Icon } from "../icons";
export { Action, Combobox, Select, Toggle } from "./composer-controls";
export { Modal } from "./modal";
export { ScrollView, FlatList } from "./scroll-view";
@@ -1,4 +1,3 @@
import { Session } from "node:inspector/promises";
import { getPluginClientApi } from "./client-state/api";
import { filePanelTitle } from "@/file-panels/choice/presentation";
import { i18n } from "@/i18n/i18next";
@@ -237,27 +236,3 @@ test("locale snapshots preserve installation state and observations, then releas
expect(listeners.size).toBe(0);
await expect.poll(() => h.open.size).toBe(0);
});
test("reloading a plugin releases the previous installation", async () => {
const h = registry();
const options = { client: h.client, audio };
const entry = catalog("reloaded");
h.plugins.installCatalog("host", [entry], options);
// The published snapshot is a copy. Its lifetime belongs to the installation itself.
const previous = new WeakRef(h.plugins.getSnapshot()[0]!.lifetime);
h.plugins.installCatalog("host", [entry], { ...options, replacePluginId: entry.id });
expect(h.plugins.getSnapshot()[0]?.lifetime).not.toBe(previous.deref());
const inspector = new Session();
inspector.connect();
try {
await new Promise<void>((resolve) => setImmediate(resolve));
await inspector.post("HeapProfiler.collectGarbage");
expect(previous.deref() === undefined).toBe(true);
expect(h.plugins.getSnapshot()).toHaveLength(1);
} finally {
inspector.disconnect();
h.plugins.removeHost("host");
}
});
+85 -107
View File
@@ -89,15 +89,91 @@ export class PluginRegistry {
this.publish();
for (const plugin of removed) this.dispose(plugin);
}
const installed = catalog.flatMap((entry) =>
this.installPlugin({
serverId,
entry,
preserved,
client: options.client,
audio: options.audio,
}),
);
const installed = catalog.flatMap((entry) => {
const key = `${serverId}/${entry.id}`;
let installation: InstalledPlugin | undefined;
try {
if (!entry.clientBundle) return [];
assertPluginCompatibility({ ...entry, version: this.dependencies.version, runtime: "app" });
const existing = preserved.find(
(plugin) => plugin.id === entry.id && plugin.clientBundle === entry.clientBundle,
);
if (existing) {
this.evaluationErrors.delete(key);
return [existing];
}
const client = options.client;
const lifetime = new AbortController();
installation = {
lifetime,
locale: this.dependencies.localeSource.getLocale(),
i18n: new PluginTranslationRuntime(this.dependencies.localeSource),
paseo: createPaseoApi(client),
invoke: (method, input) => client.invokePluginRpc(entry.id, method, input),
subscribe: createPluginSubscribe({
client,
pluginId: entry.id,
lifetime: lifetime.signal,
}),
id: entry.id,
serverId,
clientBundle: entry.clientBundle,
requirements: entry.requirements,
queryClient: new QueryClient(),
cleanup: () => undefined,
surfaces: [],
settingsScreens: [],
sidebarViews: [],
sidebarItems: { header: [], footer: [] },
legacySidebarItems: [],
workspaceRowBadgeItems: [],
filePanels: [],
composerItems: [],
newWorkspaceItems: [],
workspacePanels: [],
commandCenterItems: [],
clientSlashCommands: [],
attachmentSources: [],
themes: [],
timelineTransformers: [],
timelineRenderers: [],
notificationOpenHandlers: [],
};
const unsubscribeTranslations = installation.i18n.subscribe(() => this.publish());
installation.lifetime.signal.addEventListener("abort", unsubscribeTranslations, {
once: true,
});
const runtime = this.dependencies.createRuntime(installation, options.audio);
const evaluated = runPluginClientBundle(
{ serverId, pluginId: entry.id },
entry.clientBundle,
runtime,
() => this.publish(),
);
Object.assign(installation, evaluated);
const paseo = installation.paseo;
installation.cleanup = async () => {
const results = await Promise.allSettled([paseo.dispose(), evaluated.cleanup()]);
const failures = results.filter((result) => result.status === "rejected");
if (failures.length)
throw new AggregateError(
failures.map((result) => result.reason),
"Plugin cleanup failed",
);
};
this.evaluationErrors.delete(key);
return [installation];
} catch (error) {
installation?.lifetime.abort();
installation?.i18n.dispose();
void installation?.paseo
.dispose()
.catch((failure) => console.warn(`[Plugins] API cleanup failed for ${key}`, failure));
this.evaluationErrors.set(key, error instanceof Error ? error.message : String(error));
console.warn(`[Plugins] Failed to evaluate ${serverId}/${entry.id}`, error);
return [];
}
});
const configuredIds = new Set(catalog.map((entry) => entry.id));
for (const key of this.evaluationErrors.keys()) {
if (key.startsWith(`${serverId}/`) && !configuredIds.has(key.slice(serverId.length + 1))) {
@@ -139,104 +215,6 @@ export class PluginRegistry {
this.publish();
}
// Keep the closures for one installation out of the scope that holds the previous catalog.
private installPlugin({
serverId,
entry,
preserved,
client,
audio,
}: {
serverId: string;
entry: CatalogPlugin;
preserved: InstalledPlugin[];
client: DaemonClient;
audio: Pick<AudioEngine, "play">;
}): InstalledPlugin[] {
const key = `${serverId}/${entry.id}`;
let installation: InstalledPlugin | undefined;
try {
if (!entry.clientBundle) return [];
assertPluginCompatibility({ ...entry, version: this.dependencies.version, runtime: "app" });
const existing = preserved.find(
(plugin) => plugin.id === entry.id && plugin.clientBundle === entry.clientBundle,
);
if (existing) {
this.evaluationErrors.delete(key);
return [existing];
}
const lifetime = new AbortController();
installation = {
lifetime,
locale: this.dependencies.localeSource.getLocale(),
i18n: new PluginTranslationRuntime(this.dependencies.localeSource),
paseo: createPaseoApi(client),
invoke: (method, input) => client.invokePluginRpc(entry.id, method, input),
subscribe: createPluginSubscribe({
client,
pluginId: entry.id,
lifetime: lifetime.signal,
}),
id: entry.id,
serverId,
clientBundle: entry.clientBundle,
requirements: entry.requirements,
queryClient: new QueryClient(),
cleanup: () => undefined,
surfaces: [],
settingsScreens: [],
sidebarViews: [],
sidebarItems: { header: [], footer: [] },
legacySidebarItems: [],
workspaceRowBadgeItems: [],
filePanels: [],
composerItems: [],
newWorkspaceItems: [],
workspacePanels: [],
commandCenterItems: [],
clientSlashCommands: [],
attachmentSources: [],
themes: [],
timelineTransformers: [],
timelineRenderers: [],
notificationOpenHandlers: [],
};
const unsubscribeTranslations = installation.i18n.subscribe(() => this.publish());
installation.lifetime.signal.addEventListener("abort", unsubscribeTranslations, {
once: true,
});
const runtime = this.dependencies.createRuntime(installation, audio);
const evaluated = runPluginClientBundle(
{ serverId, pluginId: entry.id },
entry.clientBundle,
runtime,
() => this.publish(),
);
Object.assign(installation, evaluated);
const paseo = installation.paseo;
installation.cleanup = async () => {
const results = await Promise.allSettled([paseo.dispose(), evaluated.cleanup()]);
const failures = results.filter((result) => result.status === "rejected");
if (failures.length)
throw new AggregateError(
failures.map((result) => result.reason),
"Plugin cleanup failed",
);
};
this.evaluationErrors.delete(key);
return [installation];
} catch (error) {
installation?.lifetime.abort();
installation?.i18n.dispose();
void installation?.paseo
.dispose()
.catch((failure) => console.warn(`[Plugins] API cleanup failed for ${key}`, failure));
this.evaluationErrors.set(key, error instanceof Error ? error.message : String(error));
console.warn(`[Plugins] Failed to evaluate ${serverId}/${entry.id}`, error);
return [];
}
}
private hostEvaluationErrors(serverId: string): string {
const prefix = `${serverId}/`;
return JSON.stringify(
@@ -271,53 +271,6 @@ describe("AgentDirectoryReplica", () => {
store.clearSession(serverId);
});
it("ignores a lagging running snapshot for a turn already closed by stream_close", () => {
const serverId = "agent-replica-stale-running-snapshot";
const store = useSessionStore.getState();
store.initializeSession(serverId, null as unknown as DaemonClient);
const replica = new AgentDirectoryReplica(serverId, () => undefined);
replica.commitSnapshot(
[
entry({
...payload("running"),
status: "running",
activeTurn: { turnId: "turn-1", startedAt: "2026-07-17T00:01:00.000Z" },
}),
],
[],
);
replica.applyTurnLiveness("agent", { type: "stream_close", turnId: "turn-1" });
expect(selectAgentTurnPresentation(store.getSession(serverId), "agent").isActive).toBe(false);
// An empty directory catch-up re-projects the unchanged idle agent as activeTurn: null;
// it must preserve the closed turn marker so a lagging running delta still cannot re-open it.
replica.commitChanges([], [], []);
replica.applyDelta({
kind: "upsert",
agent: {
...payload("stale usage update"),
status: "running",
activeTurn: { turnId: "turn-1", startedAt: "2026-07-17T00:01:00.000Z" },
},
project: entry(payload("project")).project,
});
expect(selectAgentTurnPresentation(store.getSession(serverId), "agent").isActive).toBe(false);
replica.applyDelta({
kind: "upsert",
agent: { ...payload("idle"), status: "idle", activeTurn: null },
project: entry(payload("project")).project,
});
expect(selectAgentTurnPresentation(store.getSession(serverId), "agent").isActive).toBe(false);
expect(store.getSession(serverId)?.agents.get("agent")?.turn).toMatchObject({
phase: "idle",
cancellationRequestId: null,
});
store.clearSession(serverId);
});
it("preserves an unchanged running agent's turn identity during catch-up", () => {
const serverId = "agent-replica-catch-up";
const store = useSessionStore.getState();
@@ -200,7 +200,6 @@ interface NewWorkspaceScreenProps {
const NO_TERMINAL_ATTACHMENTS: UserComposerAttachment[] = [];
function noopChangeAttachments() {}
function noopClearDraft() {}
const getTerminalDraftRevision = () => 0;
// Stable reference so the keyboard-action handler doesn't re-register each render.
const PROJECT_PICK_ACTIONS: readonly KeyboardActionId[] = [
@@ -1659,7 +1658,7 @@ export function NewWorkspaceScreen({
},
});
const importSession = useImportSession({ serverId: selectedServerId, newWorkspace: true });
const importSession = useImportSession({ serverId: selectedServerId });
const isComposerFullscreen = composerEditing.isFullscreen(isTerminalLaunch);
const composer = isTerminalLaunch ? (
@@ -1686,7 +1685,6 @@ export function NewWorkspaceScreen({
attachments={NO_TERMINAL_ATTACHMENTS}
onChangeAttachments={noopChangeAttachments}
cwd={workingDirectory ?? ""}
getDraftRevision={getTerminalDraftRevision}
clearDraft={noopClearDraft}
autoFocus={terminalTakesPrompt}
autoFocusKey={launchFocusKey}
@@ -1718,7 +1716,6 @@ export function NewWorkspaceScreen({
onForgeChangeRequestDetected={handleForgeChangeRequestDetected}
onForgeChangeRequestAutoAttach={handleForgeChangeRequestAutoAttach}
cwd={workingDirectory ?? ""}
getDraftRevision={chatDraft.getRevision}
clearDraft={handleClearDraft}
autoFocus
autoFocusKey={launchFocusKey}
@@ -662,13 +662,6 @@ function useMiddleClickClose(onClose: () => void) {
const node = ref.current as unknown as HTMLElement | null;
if (!node) return;
function handleMouseUp(event: MouseEvent) {
// Chromium can paste the Linux primary selection after auxclick moves focus.
if (event.button === 1) {
event.preventDefault();
}
}
function handleAuxClick(event: MouseEvent) {
if (event.button === 1) {
event.preventDefault();
@@ -676,12 +669,8 @@ function useMiddleClickClose(onClose: () => void) {
}
}
node.addEventListener("mouseup", handleMouseUp);
node.addEventListener("auxclick", handleAuxClick);
return () => {
node.removeEventListener("mouseup", handleMouseUp);
node.removeEventListener("auxclick", handleAuxClick);
};
return () => node.removeEventListener("auxclick", handleAuxClick);
}, [onClose]);
return ref;
@@ -45,7 +45,6 @@ import { hasDraftContent } from "@/composer/draft/input-draft-core";
export type { DraftInput, DraftLifecycleState } from "./state";
interface DraftStoreActions {
getDraftRevision: (draftKey: string) => number;
getDraftInput: (draftKey: string) => DraftInput | undefined;
hydrateDraftInput: (input: { draftKey: string }) => Promise<DraftInput | undefined>;
saveDraftInput: (input: { draftKey: string; draft: DraftInput }) => void;
@@ -284,11 +283,6 @@ export const useDraftStore = create<DraftStore>()(
textReplacementRequestByDraftKey: {},
metadataByDraftKey: {},
getDraftRevision: (draftKey) => {
get().flushDraftText(draftKey);
return get().drafts[draftKey]?.version ?? 0;
},
getDraftInput: (draftKey) => {
const record = get().drafts[draftKey];
return toDraftInputIfReady(record);
@@ -28,12 +28,6 @@ describe("draft-store lifecycle", () => {
expect(editDraftRecordText(edited, "", 3).lifecycle).toBe("active");
expect(editDraftRecordText(undefined, "", 3).lifecycle).toBe("abandoned");
});
it("keeps the version when a cleared draft publishes empty text again", () => {
const cleared = editDraftRecordText(undefined, "", 1);
expect(editDraftRecordText(cleared, "", 2)).toBe(cleared);
expect(editDraftRecordText(cleared, "follow-up", 2).version).toBe(cleared.version + 1);
});
it("prunes finalized tombstones after TTL", () => {
const nowMs = 1_000_000;
const drafts = {
+1 -5
View File
@@ -38,11 +38,7 @@ export function editDraftRecordText(
text: string,
now: number,
): DraftRecord {
if (
record?.input.text === text &&
(record.lifecycle === "active" || record.lifecycle === "abandoned")
)
return record;
if (record?.lifecycle === "active" && record.input.text === text) return record;
const attachments = record?.lifecycle === "active" ? record.input.attachments : [];
return {
input: { text, attachments },
@@ -75,49 +75,4 @@ describe("turn activity", () => {
turnId: null,
});
});
it("does not re-open a turn from a lagging snapshot after stream_close ended it", () => {
const open = reduceTurnLiveness(TURN_LIVENESS_IDLE, {
type: "stream_open",
turn: { turnId: "turn-1", startedAt },
});
const closed = reduceTurnLiveness(open, { type: "stream_close", turnId: "turn-1" });
expect(closed.phase).toBe("idle");
// A stale running snapshot for the just-closed turn must not flash it back to open.
const afterStaleSnapshot = reduceTurnLiveness(closed, {
type: "snapshot",
activeTurn: { turnId: "turn-1", startedAt },
});
expect(afterStaleSnapshot).toBe(closed);
expect(resolveTurnPresentation(afterStaleSnapshot, false).isActive).toBe(false);
// An idle snapshot (including an empty directory catch-up) preserves the closed turn marker
// so a delayed running snapshot for the same turn still cannot re-open it.
const afterIdleSnapshot = reduceTurnLiveness(afterStaleSnapshot, {
type: "snapshot",
activeTurn: null,
});
expect(afterIdleSnapshot).toBe(closed);
expect(
reduceTurnLiveness(afterIdleSnapshot, {
type: "snapshot",
activeTurn: { turnId: "turn-1", startedAt },
}),
).toBe(closed);
// A snapshot for a different turn still opens immediately.
const nextStartedAt = new Date("2026-07-31T10:01:00.000Z");
expect(
reduceTurnLiveness(closed, {
type: "snapshot",
activeTurn: { turnId: "turn-2", startedAt: nextStartedAt },
}),
).toEqual({
phase: "open",
turnId: "turn-2",
startedAt: nextStartedAt,
cancellationRequestId: null,
});
});
});
+7 -38
View File
@@ -4,7 +4,7 @@ export interface ActiveTurnIdentity {
}
export type TurnLiveness =
| { phase: "idle"; cancellationRequestId: number | null; closedTurnId?: string }
| { phase: "idle"; cancellationRequestId: number | null }
| {
phase: "open";
turnId: string | null;
@@ -42,15 +42,8 @@ export function applyTurnLivenessTransition(
const next = transitions.reduce(reduceTurnLiveness, current);
if (next === current) return turns as Map<string, TurnLiveness>;
const updated = new Map(turns);
if (
next.phase === "idle" &&
next.cancellationRequestId === null &&
next.closedTurnId === undefined
) {
updated.delete(agentId);
} else {
updated.set(agentId, next);
}
if (next.phase === "idle" && next.cancellationRequestId === null) updated.delete(agentId);
else updated.set(agentId, next);
return updated;
}
@@ -116,14 +109,7 @@ function closeTurn(current: TurnLiveness, turnId: string | null): TurnLiveness {
turnId !== null &&
current.turnId !== null &&
turnId !== current.turnId;
if (targetsDifferentIdentifiedTurn) return current;
// Remember the closed turn id until a newer turn opens or destructive_close resets liveness,
// so a lagging running snapshot (even after an empty directory catch-up) cannot re-open a turn
// the stream already ended.
const closedTurnId = turnId ?? (current.phase === "open" ? current.turnId : current.closedTurnId);
return closedTurnId
? { phase: "idle", cancellationRequestId: null, closedTurnId }
: TURN_LIVENESS_IDLE;
return targetsDifferentIdentifiedTurn ? current : TURN_LIVENESS_IDLE;
}
function openTurn(current: TurnLiveness, activeTurn: ActiveTurnIdentity): TurnLiveness {
@@ -161,24 +147,7 @@ export function reduceTurnLiveness(
return closeTurn(current, transition.turnId);
}
if (transition.type === "snapshot") {
if (!transition.activeTurn) {
if (current.phase === "idle") {
return current.cancellationRequestId === null
? current
: { ...current, cancellationRequestId: null };
}
return TURN_LIVENESS_IDLE;
}
if (
current.phase === "idle" &&
current.closedTurnId !== undefined &&
transition.activeTurn.turnId === current.closedTurnId
) {
return current;
}
return openTurn(current, transition.activeTurn);
}
return openTurn(current, transition.turn);
const activeTurn = transition.type === "snapshot" ? transition.activeTurn : transition.turn;
if (!activeTurn) return TURN_LIVENESS_IDLE;
return openTurn(current, activeTurn);
}
@@ -11,7 +11,6 @@ export const BottomSheetModalProvider = PassThrough;
export const BottomSheetBackdrop = Stub;
export const BottomSheetHandle = Stub;
export const BottomSheetScrollView = PassThrough;
export const BottomSheetFlatList = PassThrough;
export const BottomSheetView = PassThrough;
export const BottomSheetTextInput = Stub;
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/cli",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"description": "Paseo CLI - control your AI coding agents from the command line",
"license": "Apache-2.0",
"bin": {
@@ -29,9 +29,9 @@
},
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.19.0-beta.1",
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/server": "0.19.0-beta.1",
"@getpaseo/client": "0.18.2",
"@getpaseo/protocol": "0.18.2",
"@getpaseo/server": "0.18.2",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
@@ -81,11 +81,6 @@ describe("buildAgentLsFetchOptions", () => {
});
});
it("preserves empty values and punctuation in repeated label filters", () => {
const options = buildAgentLsFetchOptions({ label: ["tag=v=1,rc", "empty="] });
expect(options.filter?.labels).toEqual({ tag: "v=1,rc", empty: "" });
});
it("asks the daemon for internal agents only with --internal", () => {
expect(buildAgentLsFetchOptions({ background: true, global: true })).toEqual({
filter: { includeBackground: true },
@@ -131,17 +126,6 @@ describe("buildAgentLsFetchOptions", () => {
});
describe("runLsCommand", () => {
it.each(["team", "=blue", " =blue"])(
"rejects the whole listing when a label filter is malformed (%j)",
async (label) => {
await expect(
listAgents({ daemonTarget, label: ["bot=worker", label] }, async () =>
createPagingClient(),
),
).rejects.toMatchObject({ code: "INVALID_LABEL", message: `Invalid label format: ${label}` });
},
);
it("includes agent snapshot metadata in JSON listings", async () => {
const result = await listAgents({ daemonTarget, global: true }, async () =>
createPagingClient(),
+13 -17
View File
@@ -141,20 +141,16 @@ export interface AgentLsOptions extends CommandOptions {
}
function parseLabelFilters(labels: string[] | undefined): Record<string, string> {
return Object.fromEntries(
(labels ?? []).map((label) => {
const separator = label.indexOf("=");
const key = label.slice(0, separator);
if (separator === -1 || !key.trim()) {
throw {
code: "INVALID_LABEL",
message: `Invalid label format: ${label}`,
details: "Labels must include a non-empty key in key=value format",
} satisfies CommandError;
}
return [key, label.slice(separator + 1)];
}),
);
const labelFilters: Record<string, string> = {};
for (const labelStr of labels ?? []) {
const eqIndex = labelStr.indexOf("=");
if (eqIndex !== -1) {
const key = labelStr.slice(0, eqIndex);
const value = labelStr.slice(eqIndex + 1);
labelFilters[key] = value;
}
}
return labelFilters;
}
export function buildAgentLsFetchOptions(
@@ -215,7 +211,6 @@ export async function listAgents(
options: Parameters<typeof connectToDaemon>[0],
) => Promise<AgentLsClient> = connectToDaemon,
): Promise<AgentLsResult> {
const fetchOptions = buildAgentLsFetchOptions(options);
const client = await connect({ target: options.daemonTarget });
try {
@@ -228,6 +223,8 @@ export async function listAgents(
throw error;
}
const labelFilters = parseLabelFilters(options.label);
const fetchOptions = buildAgentLsFetchOptions(options);
let agents = await fetchAllAgents(client, fetchOptions);
// By default, exclude archived agents. `-a` includes them.
@@ -246,8 +243,7 @@ export async function listAgents(
}
// Apply label filtering only when explicitly requested.
const labelFilters = fetchOptions.filter?.labels;
if (labelFilters) {
if (Object.keys(labelFilters).length > 0) {
agents = agents.filter((a) => {
const agentLabels = a.labels;
for (const [key, value] of Object.entries(labelFilters)) {
+2 -4
View File
@@ -12,7 +12,7 @@ import type {
UpdateScheduleNewAgentConfig,
} from "./types.js";
import { parseDuration } from "../../utils/duration.js";
import { parseModelOption, resolveProviderAndModel } from "../../utils/provider-model.js";
import { resolveProviderAndModel } from "../../utils/provider-model.js";
import { everyMsToFiveFieldCron } from "@getpaseo/protocol/schedule/cadence";
export interface ScheduleCommandOptions extends CommandOptions {
@@ -422,7 +422,7 @@ function buildNewAgentConfigPatch(
options: ScheduleUpdateOptionsInput,
): UpdateScheduleNewAgentConfig | undefined {
const patch: UpdateScheduleNewAgentConfig = {};
if (options.provider !== undefined) {
if (options.provider !== undefined || options.model !== undefined) {
const resolved = resolveProviderAndModel({
provider: options.provider,
model: options.model,
@@ -431,8 +431,6 @@ function buildNewAgentConfigPatch(
if (resolved.model !== undefined) {
patch.model = resolved.model;
}
} else if (options.model !== undefined) {
patch.model = parseModelOption(options.model);
}
if (options.mode !== undefined) {
const trimmed = options.mode.trim();
+5 -1
View File
@@ -17,7 +17,11 @@ export async function connectTerminalClient(target: DaemonTarget) {
try {
const daemonClient = await connectToDaemon({ target });
const terminals = createTerminalActions(daemonClient, async (workspaceId) => {
const workspace = await daemonClient.findWorkspace(workspaceId);
const result = await daemonClient.fetchWorkspaces({
filter: { idPrefix: workspaceId, includeBackground: true },
page: { limit: 10 },
});
const workspace = result.entries.find((entry) => entry.id === workspaceId);
if (!workspace?.workspaceDirectory) {
throw new Error(`Workspace ${workspaceId} is not active or has no available directory`);
}
+8 -9
View File
@@ -11,18 +11,11 @@ export interface ResolvedProviderModel {
model: string | undefined;
}
export function parseModelOption(value: string): string {
const model = value.trim();
if (!model) {
throw { code: "INVALID_MODEL", message: "--model cannot be empty" } satisfies CommandError;
}
return model;
}
export function resolveProviderAndModel(
options: ResolveProviderAndModelOptions,
): ResolvedProviderModel {
const providerInput = options.provider?.trim() || options.defaultProvider;
const modelInput = options.model?.trim();
if (!providerInput) {
const error: CommandError = {
@@ -34,7 +27,13 @@ export function resolveProviderAndModel(
throw error;
}
const modelInput = options.model === undefined ? undefined : parseModelOption(options.model);
if (options.model !== undefined && !modelInput) {
const error: CommandError = {
code: "INVALID_MODEL",
message: "--model cannot be empty",
};
throw error;
}
const slashIndex = providerInput.indexOf("/");
if (slashIndex === -1) {
@@ -90,32 +90,14 @@ async function startSupervisor() {
});
let output = "";
const startedWatchers = new Set<string>();
const builtWatchers = new Set<string>();
let watchersBuiltBeforeWorker: string[] | undefined;
// Read whole lines in arrival order, so the worker line is checked against
// only the build lines that came before it.
function readLine(line: string) {
function captureOutput(chunk: Buffer) {
output = (output + chunk.toString()).slice(-32000);
for (const watcher of ["protocol", "client"]) {
if (!line.includes(`[${watcher}]`)) continue;
startedWatchers.add(watcher);
if (line.includes("Watching for file changes")) builtWatchers.add(watcher);
}
if (!watchersBuiltBeforeWorker && line.includes("Starting daemon worker")) {
watchersBuiltBeforeWorker = [...builtWatchers].sort();
if (output.includes(`[${watcher}]`)) startedWatchers.add(watcher);
}
}
function captureOutput(stream: NodeJS.ReadableStream) {
let partial = "";
stream.on("data", (chunk: Buffer) => {
const text = chunk.toString();
output = (output + text).slice(-32000);
const lines = (partial + text).split("\n");
partial = lines.pop() ?? "";
lines.forEach(readLine);
});
}
captureOutput(child.stdout);
captureOutput(child.stderr);
child.stdout.on("data", captureOutput);
child.stderr.on("data", captureOutput);
try {
await Promise.race([
waitFor(
@@ -135,12 +117,6 @@ async function startSupervisor() {
await waitFor(async () => {
if (startedWatchers.size === 2) return true;
}, "dev runner did not start both dependency watchers");
// A worker that starts during a watcher's first build imports half-written dist files.
assert.deepEqual(
watchersBuiltBeforeWorker,
["client", "protocol"],
"daemon worker started before both watchers finished their first build",
);
}
} catch (error) {
await client.close();
@@ -193,18 +169,9 @@ try {
if (process.platform === "win32") {
await interruptForeground(daemon);
} else {
const idle = await daemon.client.createAgent({
provider: "antigravity",
cwd,
});
const running = await daemon.client.createAgent({
provider: "antigravity",
cwd,
});
const crashing = await daemon.client.createAgent({
provider: "antigravity",
cwd,
});
const idle = await daemon.client.createAgent({ provider: "antigravity", cwd });
const running = await daemon.client.createAgent({ provider: "antigravity", cwd });
const crashing = await daemon.client.createAgent({ provider: "antigravity", cwd });
const opened = (await readEvents()).filter((event) => event.type === "session");
const sessions = [idle, running, crashing].map((agent) => {
const handle = agent.persistence?.sessionId;
@@ -219,9 +186,7 @@ try {
const { agent } = (await daemon!.client.fetchAgent(crashing.id)) ?? {};
if (agent?.status === "error" && agent.attentionReason === "error") return agent;
}, "unexpected provider exit did not raise error attention");
const failure = await daemon.client.fetchAgentTimeline(crashing.id, {
limit: 20,
});
const failure = await daemon.client.fetchAgentTimeline(crashing.id, { limit: 20 });
assert.match(JSON.stringify(failure.entries), /\[System Error\].*ACP process exited/);
console.log("Unexpected ACP exit raised error attention and added a timeline entry.");
@@ -260,16 +225,8 @@ try {
assert.deepEqual(
(await readEvents()).filter((event) => event.type === "prompt"),
[
{
type: "prompt",
sessionId: sessions[1].sessionId,
text: "Hold the turn open.",
},
{
type: "prompt",
sessionId: sessions[1].sessionId,
text: resumePrompt,
},
{ type: "prompt", sessionId: sessions[1].sessionId, text: "Hold the turn open." },
{ type: "prompt", sessionId: sessions[1].sessionId, text: resumePrompt },
],
);
console.log(
-14
View File
@@ -97,20 +97,6 @@ try {
assert.strictEqual(inspectedJson.target.config.model, "gpt-5.4");
assert.strictEqual(inspectedJson.target.config.thinkingOptionId, "high");
const updated = await ctx.paseo([
"schedule",
"update",
createdJson.id,
"--model",
"gpt-5.4-mini",
"--json",
]);
assert.strictEqual(updated.exitCode, 0, updated.stderr);
assert.deepStrictEqual(JSON.parse(updated.stdout).target.config, {
...inspectedJson.target.config,
model: "gpt-5.4-mini",
});
const deleted = await ctx.paseo(["schedule", "delete", createdJson.id, "--json"]);
assert.strictEqual(deleted.exitCode, 0, deleted.stderr);
console.log("schedule provider/model syntax works\n");
@@ -73,18 +73,6 @@ try {
await cli(["terminal", "kill", feature.id]);
assert.deepEqual(await cli(["terminal", "ls", "--workspace", second.id]), []);
assert.deepEqual(await cli(["terminal", "ls", "--workspace", first.id]), [main]);
for (let i = 0; i < 9; i++) {
await sdk.workspaces.create({
source: { kind: "directory", path: ctx.workDir },
title: `extra-${i}`,
});
}
const workspaces = await cli(["workspace", "ls"]);
assert.equal(workspaces.length, 11);
const { workspaceId, cwd } = workspaces[10];
const created = await cli(["terminal", "create", "--workspace", workspaceId, "--name", "Older"]);
assert.deepEqual(created, { id: created.id, name: "Older", workspaceId, cwd });
await cli(["terminal", "kill", created.id]);
console.log("Terminal workspace CLI: ownership, lists, input, capture, kill, and errors passed");
} finally {
await sdk.close();
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/client",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"description": "Paseo client SDK package",
"license": "Apache-2.0",
"files": [
@@ -57,8 +57,8 @@
"measure:diff-materialization": "tsx scripts/measure-diff-materialization.ts"
},
"dependencies": {
"@getpaseo/protocol": "0.19.0-beta.1",
"@getpaseo/relay": "0.19.0-beta.1",
"@getpaseo/protocol": "0.18.2",
"@getpaseo/relay": "0.18.2",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
@@ -261,8 +261,6 @@ const PROJECT_GITHUB_CLONE_TIMEOUT_MS = 5 * 60 * 1000;
interface ImportAgentInputBase {
cwd?: string;
workspaceId?: string;
/** Import into a fresh workspace for `cwd` instead of the workspace already open there. */
newWorkspace?: boolean;
labels?: Record<string, string>;
}
@@ -4160,7 +4158,6 @@ export class DaemonClientCore {
: { provider: input.provider, sessionId: input.sessionId }),
...(input.cwd ? { cwd: input.cwd } : {}),
...(input.workspaceId ? { workspaceId: input.workspaceId } : {}),
...(input.newWorkspace ? { newWorkspace: true } : {}),
...(input.labels && Object.keys(input.labels).length > 0 ? { labels: input.labels } : {}),
});
@@ -1,125 +0,0 @@
import { expect } from "@playwright/test";
export async function runBrowserPermissionsRegression({
page,
call,
serverId,
targetUrl,
browserWorkspaceId,
}) {
await page.getByTestId(`sidebar-workspace-row-${serverId}:${browserWorkspaceId}`).click();
await page
.getByTestId(`workspace-deck-entry-${serverId}:${browserWorkspaceId}`)
.waitFor({ state: "visible" });
const created = await call("browser_new_tab", { url: targetUrl });
const browserId = created.browserId;
expect(typeof browserId, "browser_new_tab did not return a browserId").toBe("string");
try {
await call("browser_wait", { browserId, text: "Bridge target" });
const evaluated = await call("browser_evaluate", {
browserId,
function: `async () => {
const query = async (name) => {
try {
return (await navigator.permissions.query({ name })).state;
} catch (error) {
return "error:" + String(error);
}
};
const expectReject = async (fn) => {
try {
await fn();
return "resolved";
} catch (error) {
return "rejected:" + (error && error.name ? error.name : String(error));
}
};
const geoPosition = await new Promise((resolve) => {
navigator.geolocation.getCurrentPosition(
() => resolve("granted"),
(error) => resolve("denied:" + error.code),
{ timeout: 3000 },
);
});
return {
permissions: {
geolocation: await query("geolocation"),
microphone: await query("microphone"),
camera: await query("camera"),
notifications: await query("notifications"),
clipboardRead: await query("clipboard-read"),
clipboardWrite: await query("clipboard-write"),
},
geoPosition,
getUserMediaAudio: await expectReject(() =>
navigator.mediaDevices.getUserMedia({ audio: true }),
),
getUserMediaVideo: await expectReject(() =>
navigator.mediaDevices.getUserMedia({ video: true }),
),
getDisplayMedia: await expectReject(() =>
navigator.mediaDevices.getDisplayMedia({ video: true }),
),
notificationRequest: await Notification.requestPermission(),
midi: await expectReject(() => navigator.requestMIDIAccess()),
clipboardRead: await expectReject(() => navigator.clipboard.readText()),
};
}`,
});
const guestResult = JSON.parse(evaluated.resultJson);
expect(guestResult.permissions).toEqual({
geolocation: "denied",
microphone: "denied",
camera: "denied",
notifications: "denied",
clipboardRead: "denied",
clipboardWrite: "granted",
});
expect(guestResult.geoPosition).toBe("denied:1");
// Headless runners without capture hardware reject getUserMedia with NotFoundError
// before prompting; microphone/camera queries above verify permission denial directly.
expect(["rejected:NotAllowedError", "rejected:NotFoundError"]).toContain(
guestResult.getUserMediaAudio,
);
expect(["rejected:NotAllowedError", "rejected:NotFoundError"]).toContain(
guestResult.getUserMediaVideo,
);
expect(guestResult.getDisplayMedia).toBe("rejected:NotAllowedError");
expect(guestResult.notificationRequest).toBe("denied");
expect(guestResult.midi).toBe("rejected:NotAllowedError");
expect(guestResult.clipboardRead).toBe("rejected:NotAllowedError");
const appResult = await page.evaluate(async () => {
const query = async (name) => (await navigator.permissions.query({ name })).state;
return {
permissions: {
microphone: await query("microphone"),
notifications: await query("notifications"),
clipboardRead: await query("clipboard-read"),
clipboardWrite: await query("clipboard-write"),
camera: await query("camera"),
geolocation: await query("geolocation"),
},
notificationRequest: await Notification.requestPermission(),
};
});
expect(appResult.permissions).toEqual({
microphone: "granted",
notifications: "granted",
clipboardRead: "granted",
clipboardWrite: "granted",
camera: "denied",
geolocation: "denied",
});
expect(appResult.notificationRequest).toBe("granted");
return { guestResult, appResult };
} finally {
await call("browser_close_tab", { browserId });
}
}
+12 -276
View File
@@ -587,236 +587,6 @@ function describeProcess(pid) {
return { pid, serverId: serverId ?? null, command };
}
async function evaluateMainProcess(inspectorPort, expression) {
const [target] = await (await fetch(`http://127.0.0.1:${inspectorPort}/json/list`)).json();
const socket = new WebSocket(target.webSocketDebuggerUrl);
try {
return await new Promise((resolve, reject) => {
socket.once("error", reject);
socket.on("message", (data) => {
const response = JSON.parse(String(data));
if (response.id !== 1) return;
if (response.error || response.result?.exceptionDetails) reject(new Error(String(data)));
else resolve(response.result.result.value);
});
socket.once("open", () =>
socket.send(
JSON.stringify({
id: 1,
method: "Runtime.evaluate",
params: {
expression: `(async () => { const electron = process.mainModule.require('electron'); ${expression} })()`,
returnByValue: true,
awaitPromise: true,
},
}),
),
);
});
} finally {
socket.close();
}
}
/** Accepts the next native confirm dialog by clicking the button labeled `label`. */
async function acceptNextDialog(inspect, label) {
await inspect(`const { dialog } = electron; const show = dialog.showMessageBox;
dialog.showMessageBox = async (owner, options) => {
dialog.showMessageBox = show;
return { response: options.buttons.indexOf(${JSON.stringify(label)}), checkboxChecked: false };
}; return true;`);
}
async function openBrowserProfileSettings(page) {
await page.getByRole("button", { name: "Settings", exact: true }).click();
await page
.locator('[data-testid="settings-sidebar"]:visible')
.getByRole("button", { name: "Chat & panes", exact: true })
.click();
await expect(page.getByTestId("settings-browser-profile-row-default")).toBeVisible();
}
/**
* On a host-proxied tab, creates and switches profiles, and proves each profile on the
* host has its own storage while its requests still leave through the host daemon over
* the host's one tunnel. Then clears and removes the profile from Settings.
*/
async function verifyHostProxiedProfiles({
page,
inspect,
relayBridge,
targetServer,
targetUrl,
hostPartition,
routingPill,
userData,
}) {
const picker = () => page.locator('[data-testid="browser-profile-picker"]:visible');
const hostWorkPartition = `${hostPartition}-profile-work`;
const guestAt = (partition) => readGuestState(page, { exactPartition: partition });
const runInGuest = (partition, code) =>
page.evaluate(
async (input) => {
const wv = [...document.querySelectorAll("webview")].find(
(el) => el.getAttribute("partition") === input.partition,
);
return await wv.executeJavaScript(input.code);
},
{ partition, code },
);
const markGuest = (partition, marker) =>
runInGuest(
partition,
`localStorage.setItem("partition_marker", ${JSON.stringify(marker)}); document.cookie = "profile=${marker}; Path=/; Max-Age=86400";`,
);
const cookieAt = (partition) => runInGuest(partition, "document.cookie");
const choose = async (slug, name) => {
await picker().click();
await page.getByTestId(`browser-profile-option-${slug}`).click();
await expect(picker()).toHaveAttribute("aria-label", `Browser profile: ${name}`);
};
const tunnelStats = () => {
const stats = relayBridge.getStats("e2e-remote-host");
return {
clientConnections: stats.clientConnections,
tunnelBytes: stats.connections[1]?.serverToClientBytes ?? 0,
};
};
const loadedPage = {
found: true,
heading: "Proxied HTTP OK",
wsResult: "WS_OK:ack:hello-tunnel",
};
const poll = (fn) => expect.poll(fn, { timeout: 30_000, intervals: [250, 500, 1000] });
// 1. The profile picker is on the host-proxied tab; create Work there.
await expect(picker()).toHaveAttribute("aria-label", "Browser profile: Default");
const before = tunnelStats();
const wsCountBefore = targetServer.wsClientPorts.length;
await picker().click();
await page.getByTestId("browser-profile-create-trigger").click();
await page.getByTestId("browser-create-profile-input").fill("Work");
await page.getByTestId("browser-create-profile-submit").click();
await expect(picker()).toHaveAttribute("aria-label", "Browser profile: Work");
await poll(() => guestAt(hostWorkPartition)).toMatchObject({ ...loadedPage, marker: null });
// 2. Work still goes through the host: same SOCKS5 port, same tunnel, host daemon egress.
const status = await page.evaluate(
async () => await window.paseoDesktop.browser.getHostProxyStatus("e2e-remote-host"),
);
assert(
status?.status === "ready" &&
status.profilePartitions.default === hostPartition &&
status.profilePartitions.work === hostWorkPartition &&
typeof status.socksPort === "number",
`Expected Default and Work bound to the host proxy, got ${JSON.stringify(status)}`,
);
const resolvedProxy = await inspect(
`return await electron.session.fromPartition(${JSON.stringify(hostWorkPartition)}).resolveProxy("http://localhost:${targetServer.port}/");`,
);
assert(
resolvedProxy.includes(`SOCKS5 127.0.0.1:${status.socksPort}`),
`Expected Work to resolve to the host SOCKS5 port ${status.socksPort}, got ${resolvedProxy}`,
);
const after = tunnelStats();
assert(
after.clientConnections === before.clientConnections && after.tunnelBytes > before.tunnelBytes,
`Expected Work to reuse the host tunnel, before=${JSON.stringify(before)} after=${JSON.stringify(after)}`,
);
const workWsPort = targetServer.wsClientPorts.slice(wsCountBefore).at(-1);
assert(workWsPort, "Expected a guest WebSocket from the Work profile");
const egressPid =
process.platform === "linux"
? processOwningConnection({ localPort: workWsPort, peerPort: targetServer.port })
: null;
const egressProcess = egressPid ? describeProcess(egressPid) : "skipped: needs Linux";
assert(
process.platform !== "linux" || egressProcess.serverId === "e2e-remote-host",
`Expected the remote daemon to own Work's target connection, got ${JSON.stringify(egressProcess)}`,
);
// 3. Default and Work keep separate storage and cookies on the same host.
await markGuest(hostWorkPartition, "host-work");
await choose("default", "Default");
await poll(() => guestAt(hostPartition)).toMatchObject({
...loadedPage,
marker: "from-host-partition",
});
assert(
!(await cookieAt(hostPartition)).includes("profile=host-work"),
"Expected the host Default profile not to see Work's cookie",
);
await choose("work", "Work");
await poll(() => guestAt(hostWorkPartition)).toMatchObject({
...loadedPage,
marker: "host-work",
});
// 4. Work on the local route is a different partition from Work on the host route.
await routingPill.click();
await expect(routingPill).toHaveAttribute(
"aria-label",
"Switch browser routing from Local to Remote Proxy Host",
{ timeout: 15_000 },
);
await poll(() => guestAt("persist:paseo-profile-work")).toMatchObject({
...loadedPage,
marker: null,
});
await routingPill.click();
await expect(routingPill).toHaveAttribute(
"aria-label",
"Switch browser routing from Remote Proxy Host to Local",
{ timeout: 15_000 },
);
await poll(() => guestAt(hostWorkPartition)).toMatchObject({
...loadedPage,
marker: "host-work",
});
// 5. A second host tab on Default, to prove Clear and Remove leave Default alone.
await openNewBrowserTabAndNavigate(page, targetUrl);
await expect(picker()).toHaveAttribute("aria-label", "Browser profile: Default");
await poll(() => guestAt(hostPartition)).toMatchObject({
...loadedPage,
marker: "from-host-partition",
});
// 6. Clear Work in Settings clears it on the host route too; Default keeps its data.
const hostWorkDir = path.join(userData, "Partitions", hostWorkPartition.slice("persist:".length));
await poll(() => fs.existsSync(hostWorkDir)).toBe(true);
await openBrowserProfileSettings(page);
await acceptNextDialog(inspect, "Clear data");
await page.getByTestId("settings-browser-profile-menu-work").click();
await page.getByTestId("settings-browser-profile-clear-work").click();
await expect(page.getByText("Browser data cleared", { exact: true })).toBeVisible();
await poll(() => guestAt(hostWorkPartition)).toMatchObject({ ...loadedPage, marker: null });
assert(
!(await cookieAt(hostWorkPartition)).includes("profile=host-work"),
"Expected Clear data to remove Work's cookie on the host route",
);
await poll(() => guestAt(hostPartition)).toMatchObject({ marker: "from-host-partition" });
// 7. Remove Work closes its host-proxied tab and deletes its host partition directory.
await acceptNextDialog(inspect, "Remove");
await page.getByTestId("settings-browser-profile-menu-work").click();
await page.getByTestId("settings-browser-profile-remove-work").click();
await expect(page.getByTestId("settings-browser-profile-row-work")).toHaveCount(0);
await poll(() => fs.existsSync(hostWorkDir)).toBe(false);
await page.getByTestId("settings-back-to-workspace").click();
await poll(async () => (await guestAt(hostWorkPartition)).found).toBe(false);
await poll(() => guestAt(hostPartition)).toMatchObject({ marker: "from-host-partition" });
return {
hostWorkPartition,
socksPort: status.socksPort,
resolvedProxy,
tunnelConnections: after.clientConnections,
egressProcess,
clearAndRemove: "passed",
};
}
async function waitForAppPage(browser, expoPort) {
const deadline = Date.now() + timeoutMs;
while (Date.now() < deadline) {
@@ -909,10 +679,8 @@ async function openNewBrowserTabAndNavigate(page, url) {
await expect(newTabBtn).toBeVisible({ timeout: 30_000 });
await newTabBtn.click();
// An empty pane lists launchers as buttons; a pane with tabs opens a menu instead.
const browserOption = page
.getByRole("button", { name: /^Browser/i })
.or(page.getByRole("menuitem", { name: /^Browser/i }))
.and(page.locator(":visible"))
.first();
await expect(browserOption).toBeVisible({ timeout: 15_000 });
@@ -982,7 +750,7 @@ async function verifyRoutedHostBrowsing({ page, targetServer, targetUrl }) {
);
assert(
routedProxyStatus?.status === "ready" &&
routedProxyStatus.profilePartitions.default === routedPartition &&
routedProxyStatus.partition === routedPartition &&
typeof routedProxyStatus.socksPort === "number",
`Expected a ready routed host proxy, got ${JSON.stringify(routedProxyStatus)}`,
);
@@ -1025,23 +793,15 @@ async function main() {
const userData = path.join(runtimeDir, "electron-user-data");
const workspaceRoot = path.join(runtimeDir, "workspaces");
const [
localDaemonPort,
remoteDaemonPort,
oldDaemonPort,
routedDaemonPort,
expoPort,
cdpPort,
inspectorPort,
] = await Promise.all([
reservePort(),
reservePort(),
reservePort(),
reservePort(),
reservePort(),
reservePort(),
reservePort(),
]);
const [localDaemonPort, remoteDaemonPort, oldDaemonPort, routedDaemonPort, expoPort, cdpPort] =
await Promise.all([
reservePort(),
reservePort(),
reservePort(),
reservePort(),
reservePort(),
reservePort(),
]);
// The local daemon requires a password the renderer never sees, so the routed
// tunnel can only authenticate to it with the desktop-managed local credential.
const localDaemonPassword = "browser-proxy-e2e-local-password";
@@ -1051,7 +811,6 @@ async function main() {
const children = [];
let legacyAdapter = null;
let browser = null;
let appPage = null;
try {
seedPaseoHome({
@@ -1197,7 +956,6 @@ async function main() {
const desktopArgs = [
process.execPath,
devRunner,
`--inspect=127.0.0.1:${inspectorPort}`,
...(process.platform === "linux" ? ["--no-sandbox"] : []),
];
const desktopCommand = process.platform === "linux" ? "xvfb-run" : desktopArgs.shift();
@@ -1232,7 +990,6 @@ async function main() {
browser = await chromium.connectOverCDP(`http://127.0.0.1:${cdpPort}`);
const page = await waitForAppPage(browser, expoPort);
appPage = page;
await hideDeveloperToasts(page);
await waitForDesktopStatus(page);
@@ -1412,22 +1169,7 @@ async function main() {
});
// -------------------------------------------------------------------------
// 3. Browser profiles on the host-proxied tab
// -------------------------------------------------------------------------
const hostProfiles = await verifyHostProxiedProfiles({
page,
inspect: (expression) => evaluateMainProcess(inspectorPort, expression),
relayBridge,
targetServer,
targetUrl,
hostPartition: hostGuest.partition,
routingPill,
userData,
});
await page.screenshot({ path: path.join(artifactDir, "03-host-profiles.png") });
// -------------------------------------------------------------------------
// 4. Old daemon without features.networkTunnel fails closed + Browse locally
// 3. Old daemon without features.networkTunnel fails closed + Browse locally
// -------------------------------------------------------------------------
const oldWsButton = page
.getByRole("button", {
@@ -1491,7 +1233,7 @@ async function main() {
await page.screenshot({ path: path.join(artifactDir, "04-old-daemon-browse-locally.png") });
// -------------------------------------------------------------------------
// 5. Routed host: desktop -> local daemon -> routed daemon -> target
// 4. Routed host: desktop -> local daemon -> routed daemon -> target
// -------------------------------------------------------------------------
const routedHost = await verifyRoutedHostBrowsing({
page,
@@ -1512,7 +1254,6 @@ async function main() {
binaryFrames: secondaryTunnelConn.binaryFrames,
},
togglePartitionIsolation: "passed",
hostProfiles,
oldDaemonFailClosedAndBrowseLocally: "passed",
routedHost,
artifactDir,
@@ -1521,11 +1262,6 @@ async function main() {
2,
),
);
} catch (error) {
await appPage
?.screenshot({ path: path.join(artifactDir, "failure.png") })
.catch(() => undefined);
throw error;
} finally {
await browser?.close().catch(() => undefined);
legacyAdapter?.close();
+6 -26
View File
@@ -24,7 +24,6 @@ import {
FOCUS_FIXTURE_PATH,
runBrowserFocusIsolationRegression,
} from "./browser-focus.electron.mjs";
import { runBrowserPermissionsRegression } from "./browser-permissions.electron.mjs";
import { runSettingsMemoryRegression } from "./settings-memory.electron.mjs";
import { seedPluginLinks, runPluginLinksRegression } from "./plugin-links.electron.mjs";
@@ -670,10 +669,9 @@ async function clickGuestElement(page, client, browserId, selector) {
}
async function selectDeviceSize(page, label) {
const trigger = page.getByLabel("Device size", { exact: true });
const item = page.getByRole("menuitem", { name: label, exact: true });
await trigger.click();
await item.click({ trial: true, timeout: timeoutMs });
await page.locator('[aria-label="Device size"]').click();
const item = page.getByText(label, { exact: true });
await item.waitFor({ state: "visible", timeout: timeoutMs });
const rect = await item.boundingBox();
assert(rect, `Device size menu item ${label} had no bounds`);
const clip = {
@@ -687,9 +685,9 @@ async function selectDeviceSize(page, label) {
await item.waitFor({ state: "hidden", timeout: timeoutMs });
const closedPixels = await page.screenshot({ clip });
await trigger.click();
// The reopened menu renders off-screen while measuring. Click its current position after layout.
await item.click({ timeout: timeoutMs });
await page.locator('[aria-label="Device size"]').click();
await item.waitFor({ state: "visible", timeout: timeoutMs });
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2);
await page.keyboard.press("Escape");
return !openPixels.equals(closedPixels);
}
@@ -1595,22 +1593,6 @@ async function main() {
resizeWindow: (size) => resizeDesktopWindow(inspectorPort, size),
evaluateMain: (expression) => evaluateDesktopWindow(inspectorPort, expression),
});
const checkPermissions = (browserClient) =>
runBrowserPermissionsRegression({
page,
call: (name, args) => callBrowserTool(browserClient, name, args),
serverId: status.serverId,
targetUrl: target.url,
browserWorkspaceId: workspaceIds[0],
});
if (process.env.PASEO_DESKTOP_BROWSER_PERMISSIONS_ONLY === "1") {
const callerAgentId = await createCallerAgent(daemonPort);
client = await connectBrowserToolClient(daemonPort, callerAgentId);
const permissions = await checkPermissions(client);
writeJson(path.join(artifactDir, "result.json"), { permissions });
console.log("Desktop browser permissions regression passed.");
return;
}
if (process.env.PASEO_DESKTOP_BROWSER_FOCUS_ONLY === "1") {
const callerAgentId = await createCallerAgent(daemonPort);
const typingAgent = {
@@ -1666,7 +1648,6 @@ async function main() {
artifactDir,
});
const focusIsolation = await checkFocusIsolation(client, callerAgentId, typingAgent);
const permissions = await checkPermissions(client);
const pluginLinks = await checkPluginLinks();
const routingClient = await connectBrowserToolClient(daemonPort, typingAgent.agentId);
try {
@@ -1684,7 +1665,6 @@ async function main() {
writeJson(path.join(artifactDir, "result.json"), {
...report,
focusIsolation,
permissions,
settingsMemory,
pluginLinks,
adaptiveTheme,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/desktop",
"version": "0.19.0-beta.1",
"version": "0.18.2",
"private": true,
"description": "Paseo desktop app (Electron wrapper)",
"homepage": "https://paseo.sh",
@@ -1,74 +0,0 @@
import { describe, expect, test } from "vitest";
import { getBrowserPartition, parseBrowserPartition } from "./browser-partition.js";
const LOCAL = { kind: "local" } as const;
const host = (serverId: string) => ({ kind: "host", serverId }) as const;
describe("browser partition naming", () => {
test("keeps the existing local and host default partition names", () => {
expect(getBrowserPartition(LOCAL, "default")).toBe("persist:paseo-browser");
expect(getBrowserPartition(LOCAL, "work")).toBe("persist:paseo-profile-work");
expect(getBrowserPartition(host("srv_alpha_123"), "default")).toMatch(
/^persist:paseo-browser-host-[0-9a-f]{16}$/,
);
});
test("composes a host route with a named profile into its own deterministic partition", () => {
const hostDefault = getBrowserPartition(host("srv_alpha_123"), "default");
const hostWork = getBrowserPartition(host("srv_alpha_123"), "work");
expect(hostWork).toBe(`${hostDefault}-profile-work`);
expect(getBrowserPartition(host("srv_alpha_123"), "work")).toBe(hostWork);
expect(getBrowserPartition(host("srv_beta_456"), "work")).not.toBe(hostWork);
expect(getBrowserPartition(host("srv_alpha_123"), "customer")).not.toBe(hostWork);
});
test("rejects invalid routes and profile slugs", () => {
expect(() => getBrowserPartition(host(" "), "default")).toThrow();
expect(() => getBrowserPartition(LOCAL, "Work")).toThrow();
expect(() => getBrowserPartition(host("srv"), "a--b")).toThrow();
});
test("parses every route and profile combination back", () => {
const hostDefault = getBrowserPartition(host("srv"), "default");
expect(parseBrowserPartition("persist:paseo-browser")).toEqual({
route: "local",
profileSlug: "default",
});
expect(parseBrowserPartition("persist:paseo-profile-work")).toEqual({
route: "local",
profileSlug: "work",
});
expect(parseBrowserPartition(hostDefault)).toEqual({ route: "host", profileSlug: "default" });
expect(parseBrowserPartition(`${hostDefault}-profile-work`)).toEqual({
route: "host",
profileSlug: "work",
});
// A slug may itself look like a host suffix; the local prefix still owns it.
expect(parseBrowserPartition("persist:paseo-profile-work-host-0123456789abcdef")).toEqual({
route: "local",
profileSlug: "work-host-0123456789abcdef",
});
});
test("rejects partitions outside the Paseo browser namespace", () => {
for (const partition of [
undefined,
42,
"persist:foreign",
"paseo-browser",
"persist:paseo-profile-default",
"persist:paseo-profile-Work",
"persist:paseo-browser-tab-a",
"persist:paseo-browser-host-0123456789abcde",
"persist:paseo-browser-host-0123456789ABCDEF",
"persist:paseo-browser-host-0123456789abcdef0",
"persist:paseo-browser-host-0123456789abcdef-profile-",
"persist:paseo-browser-host-0123456789abcdef-profile-default",
"persist:paseo-browser-host-0123456789abcdef-profile-Work",
"persist:paseo-browser-11111111-1111-4111-8111-111111111111",
]) {
expect(parseBrowserPartition(partition)).toBeNull();
}
});
});
@@ -1,81 +0,0 @@
import { createHash } from "node:crypto";
/**
* A browser tab's Electron session partition is the pair (route, profile).
* Electron binds `session.setProxy` per partition, so the route lives in the name,
* and the profile keeps cookies and storage apart on that route.
*
* local + default persist:paseo-browser
* local + <slug> persist:paseo-profile-<slug>
* host + default persist:paseo-browser-host-<16hex>
* host + <slug> persist:paseo-browser-host-<16hex>-profile-<slug>
*
* The first three names predate this module and must not change: they hold the user's
* existing cookies and storage on disk.
*/
export type BrowserRoute = { kind: "local" } | { kind: "host"; serverId: string };
export interface ParsedBrowserPartition {
route: BrowserRoute["kind"];
profileSlug: string;
}
export const DEFAULT_BROWSER_PROFILE_SLUG = "default";
export const PASEO_BROWSER_PROFILE_PARTITION = "persist:paseo-browser";
const PERSIST = "persist:";
const LOCAL_PROFILE_PREFIX = "paseo-profile-";
const HOST_PREFIX = "paseo-browser-host-";
const HOST_PROFILE_INFIX = "-profile-";
const NAMED_SLUG = /^(?=.{1,48}$)[a-z0-9]+(?:-[a-z0-9]+)*$/;
const HOST_PARTITION = /^paseo-browser-host-([0-9a-f]{16})(?:-profile-(.+))?$/;
export function isNamedBrowserProfileSlug(slug: string): boolean {
return NAMED_SLUG.test(slug) && slug !== DEFAULT_BROWSER_PROFILE_SLUG;
}
function hostKey(serverId: string): string {
const normalized = serverId.trim();
if (!normalized) {
throw new Error("Host serverId is required to derive a browser partition");
}
return createHash("sha256").update(normalized, "utf8").digest("hex").slice(0, 16);
}
export function getBrowserPartition(route: BrowserRoute, profileSlug: string): string {
const isDefault = profileSlug === DEFAULT_BROWSER_PROFILE_SLUG;
if (!isDefault && !isNamedBrowserProfileSlug(profileSlug)) {
throw new Error(`Invalid browser profile slug: ${profileSlug}`);
}
if (route.kind === "local") {
return isDefault
? PASEO_BROWSER_PROFILE_PARTITION
: `${PERSIST}${LOCAL_PROFILE_PREFIX}${profileSlug}`;
}
const hostPartition = `${PERSIST}${HOST_PREFIX}${hostKey(route.serverId)}`;
return isDefault ? hostPartition : `${hostPartition}${HOST_PROFILE_INFIX}${profileSlug}`;
}
/** Returns the (route, profile) of a Paseo browser partition, or null for any other partition. */
export function parseBrowserPartition(partition: unknown): ParsedBrowserPartition | null {
if (typeof partition !== "string" || !partition.startsWith(PERSIST)) {
return null;
}
if (partition === PASEO_BROWSER_PROFILE_PARTITION) {
return { route: "local", profileSlug: DEFAULT_BROWSER_PROFILE_SLUG };
}
const name = partition.slice(PERSIST.length);
if (name.startsWith(LOCAL_PROFILE_PREFIX)) {
const slug = name.slice(LOCAL_PROFILE_PREFIX.length);
return isNamedBrowserProfileSlug(slug) ? { route: "local", profileSlug: slug } : null;
}
const host = HOST_PARTITION.exec(name);
if (!host) {
return null;
}
const slug = host[2];
if (slug === undefined) {
return { route: "host", profileSlug: DEFAULT_BROWSER_PROFILE_SLUG };
}
return isNamedBrowserProfileSlug(slug) ? { route: "host", profileSlug: slug } : null;
}

Some files were not shown because too many files have changed in this diff Show More