Compare commits

..
Author SHA1 Message Date
Mohamed Boudra 70300fcda0 chore(release): cut 0.17.0 2026-11-21 11:48:43 +01:00
Mohamed Boudra c89a4f18c1 docs(changelog): prepare 0.17.0 stable 2026-11-21 11:40:24 +01:00
1115 changed files with 6379 additions and 134832 deletions
-2
View File
@@ -50,7 +50,6 @@ desktop:
app:
- "packages/app/**"
- "packages/expo-two-way-audio/**"
- "packages/react-native-enriched-markdown/**"
sdk:
- "packages/plugin/**"
@@ -81,7 +80,6 @@ browser:
- "packages/app/index.ts"
- "packages/app/*config.{cjs,js,ts}"
- "packages/app/package.json"
- "packages/react-native-enriched-markdown/**"
relay:
- "packages/relay/**"
+4 -10
View File
@@ -2,7 +2,7 @@ name: CI
on:
push:
branches: [main, "release/**"]
branches: [main]
# Every base branch, so stacked PRs and PRs into any base get the same checks.
pull_request:
merge_group:
@@ -56,7 +56,7 @@ jobs:
filters: .github/ci-paths.yml
- name: Validate CI contracts
run: node --test scripts/ci-workflow.test.mjs scripts/daemon-launch-contract.test.mjs scripts/changelog-utils.test.mjs scripts/release-version-utils.test.mjs scripts/publish-release-packages.test.mjs scripts/push-current-release-tag.test.mjs scripts/reconcile-release.test.mjs scripts/sync-fdroid-changelogs.test.mjs scripts/sync-release-notes-from-changelog.test.mjs scripts/upload-release-assets.test.mjs
run: node --test scripts/ci-workflow.test.mjs scripts/daemon-launch-contract.test.mjs scripts/changelog-utils.test.mjs scripts/sync-fdroid-changelogs.test.mjs scripts/sync-release-notes-from-changelog.test.mjs scripts/upload-release-assets.test.mjs
quality:
name: quality
@@ -278,8 +278,8 @@ jobs:
# native-recursive.ts serves darwin and win32, but windows-latest above is the only
# runner that exercises it. macOS — the platform the reported watcher bug was on —
# otherwise has no server-test coverage. Keep this job scoped to regressions
# reported on macOS.
# otherwise has no server-test coverage. Scoped to the observer/watcher suites to
# bound runtime.
server-tests-macos:
name: server-tests (macos-latest, file observation)
needs: changes
@@ -307,12 +307,6 @@ jobs:
src/server/workspace-git-service.observation.integration.test.ts \
--bail=1
- name: Verify plugin compiler children are reaped
run: |
npm run test:unit --workspace=@getpaseo/server -- \
src/server/plugins/index.posix.test.ts \
-t "reaps compiler children" --bail=1
desktop-tests-ubuntu:
name: desktop-tests (ubuntu-latest)
needs: changes
+2 -3
View File
@@ -2,7 +2,7 @@ name: Desktop Packages
on:
push:
branches: [main, "release/**"]
branches: [main]
# Packaging leaves ordinary PR CI, but a PR that changes what gets packaged
# or how it is smoked still proves the real artifacts before merge.
pull_request:
@@ -11,11 +11,10 @@ on:
- "plugins/**"
- "nix/**"
- ".github/workflows/desktop-packages.yml"
workflow_dispatch:
concurrency:
group: desktop-packages-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
+27 -6
View File
@@ -170,11 +170,33 @@ jobs:
run: |
set -euo pipefail
export PASEO_REAL_XCRUN="$(command -v xcrun)"
xcrun_bin="$(mktemp -d)"
trap 'rm -rf "$xcrun_bin"' EXIT
cp scripts/macos-xcrun-retry.sh "$xcrun_bin/xcrun"
chmod +x "$xcrun_bin/xcrun"
export PATH="$xcrun_bin:$PATH"
stapler_bin="$(mktemp -d)"
trap 'rm -rf "$stapler_bin"' EXIT
cat > "$stapler_bin/xcrun" <<'STAPLER'
#!/bin/bash
if [[ "${1:-}" != stapler || "${2:-}" != staple ]]; then
exec "$PASEO_REAL_XCRUN" "$@"
fi
output="$(mktemp)"
trap 'rm -f "$output"' EXIT
for attempt in 1 2 3 4; do
if "$PASEO_REAL_XCRUN" "$@" >"$output" 2>&1; then
cat "$output"
exit 0
else
status=$?
fi
cat "$output"
if [[ "$status" != 68 || "$attempt" == 4 ]] ||
! grep -Fq 'NSURLErrorDomain Code=-1005' "$output"; then
exit "$status"
fi
echo "::warning::Apple staple connection lost; retrying the same signed app ($attempt/4)" >&2
sleep 30
done
STAPLER
chmod +x "$stapler_bin/xcrun"
export PATH="$stapler_bin:$PATH"
build_args=(-- --publish never --mac --${{ matrix.electron_arch }})
build_args+=("-c.publish.releaseType=$RELEASE_TYPE")
build_args+=("-c.publish.channel=$RELEASE_CHANNEL")
@@ -480,7 +502,6 @@ jobs:
shell: bash
run: |
set -euo pipefail
mkdir -p release-manifests
cd release-manifests
manifests_dir="$PWD/final"
mkdir -p "$manifests_dir"
+2 -2
View File
@@ -29,8 +29,8 @@ on:
- "true"
concurrency:
group: docker-${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.publish == 'true' && format('publish-{0}', inputs.paseo_version || github.run_id) || github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') && !(github.event_name == 'workflow_dispatch' && inputs.publish == 'true') }}
group: docker-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
REGISTRY: ghcr.io
-1
View File
@@ -3,7 +3,6 @@ name: Nix
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
+1 -6
View File
@@ -11,10 +11,5 @@
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"ignorePatterns": [
"*.lock",
"**/*.gen.ts",
"**/*.gen.tsx",
"packages/react-native-enriched-markdown/**"
]
"ignorePatterns": ["*.lock", "**/*.gen.ts", "**/*.gen.tsx"]
}
+1 -1
View File
@@ -3,7 +3,7 @@
"options": {
"typeAware": false
},
"ignorePatterns": [".dev/**", "packages/react-native-enriched-markdown/**"],
"ignorePatterns": [".dev/**"],
"plugins": ["react", "react-perf", "unicorn", "typescript", "oxc", "import", "promise"],
"jsPlugins": ["./scripts/oxlint/paseo-plugin.mjs"],
"categories": {
+28 -36
View File
@@ -1,77 +1,70 @@
# Changelog
## 0.17.1 - 2026-11-21
## 0.17.0 - 2026-11-21
- **Antigravity approvals and history:** Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires [Antigravity CLI 1.5.0 or later](https://paseo.sh/docs/supported-providers/antigravity). ([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from a branch or pull request. ([#10190](https://github.com/getpaseo/paseo/pull/10190))
- **Update providers in Paseo:** See each provider's status and installed version, and update supported CLIs from the app. ([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider quota forecasts:** Usage shows when your current pace will use up a quota before it resets. ([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
- **Watch PRs and MRs:** Ask an agent to watch a pull or merge request for new checks, reviews, and comments. ([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation. ([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
- **Update providers in Paseo:** See each provider's status, installed version, and available updates in the provider list. Open a provider's settings from Settings, setup, or the model picker to update supported CLIs and watch their output. ([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider quota forecasts:** Usage estimates when a quota will run out or how much will remain at reset, based on your current pace. The forecast appears inline with the reset time. ([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
- **Watch PRs and MRs:** Ask an agent to watch a GitHub, GitLab, Gitea, Forgejo, or Codeberg change request for updates to checks, reviews, or comments. Stop a watch from Background work. ([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **Heartbeats in Background work:** See and stop an agent's heartbeats next to its background tasks. ([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
- **Agent messages wait their turn:** By default, messages from other agents wait for the current turn to end. ([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
- **More goose models:** Select models from every provider configured in goose. ([#9719](https://github.com/getpaseo/paseo/pull/9719) by [@i386](https://github.com/i386))
- **Agent messages wait their turn:** Reports and notifications from other agents arrive when the current turn ends instead of interrupting it. ([#9757](https://github.com/getpaseo/paseo/pull/9757))
- **Antigravity approvals and history:** Choose a permission mode, respond to tool approvals, and import or reopen sessions. Use Antigravity CLI 1.5.0 or later on the daemon host, and include `acp` if you override its command. In Hub, reselect the model and thinking level if a saved model ID includes an old effort suffix. ([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **More goose models:** Select models from all providers configured in goose. Existing goose settings and sessions carry over to the bundled plugin. ([#9719](https://github.com/getpaseo/paseo/pull/9719) by [@i386](https://github.com/i386))
- **Plugin agent instructions:** Plugins can add their own instructions to agents. ([#9781](https://github.com/getpaseo/paseo/pull/9781))
### Added
- Added OpenRouter credit balances and API key spending to Usage and `paseo usage` ([#10269](https://github.com/getpaseo/paseo/pull/10269))
- Added Antigravity account quotas to Usage ([#10232](https://github.com/getpaseo/paseo/pull/10232) by [@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- Added Antigravity skills to `/` suggestions ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- Added bundled orchestration skills to Antigravity ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- Added Antigravity skill suggestions when you type `/` inside a prompt ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- Added bundled orchestration skills to Antigravity on hosts where Paseo skills are installed ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- Added shortcuts to open the model picker and cycle thinking levels with Cmd/Ctrl+/ and Cmd/Ctrl+Shift+/ ([#10147](https://github.com/getpaseo/paseo/pull/10147))
- Added agent settings to Command Center search before the first message ([#10182](https://github.com/getpaseo/paseo/pull/10182) by [@cleiter](https://github.com/cleiter))
- Added Rewind to Command Center for the latest turn ([#10144](https://github.com/getpaseo/paseo/pull/10144))
- Added a separate Ultracode toggle for Claude ([#10150](https://github.com/getpaseo/paseo/pull/10150) by [@fivetaku](https://github.com/fivetaku))
- Added a separate Ultracode toggle for eligible Claude models ([#10150](https://github.com/getpaseo/paseo/pull/10150) by [@fivetaku](https://github.com/fivetaku))
- Added Flex speed for Codex ([#9809](https://github.com/getpaseo/paseo/pull/9809) by [@qjqqyy](https://github.com/qjqqyy))
- Added syntax highlighting for shell scripts and Dockerfiles ([#10178](https://github.com/getpaseo/paseo/pull/10178))
- Added project listing on connected daemons for Hub sessions ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- Added project listing on connected daemons for Hub sessions with `hub.execute` ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- Added labels and workspace IDs to `paseo ls --json` ([#10076](https://github.com/getpaseo/paseo/pull/10076))
### Changed
- Changed content width to Default, Wide, and Full presets that also resize open chats and Markdown previews ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Changed Antigravity tool cards to show shell commands, output, and file diffs ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- Changed Appearance content width to Default (820 px), Wide (1,200 px), and Full presets that resize open chats, the composer, and Markdown previews together ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Changed Antigravity tool cards to show shell commands and output, file diffs, and Paseo tool details ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- Changed Clone from GitHub to show matching private repositories first ([#10264](https://github.com/getpaseo/paseo/pull/10264))
- Changed healthy quota bars in Usage to green ([#10397](https://github.com/getpaseo/paseo/pull/10397))
- Changed worktree teardown to keep the worktree when the command times out ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
- Changed workspace navigation on mobile to acknowledge taps sooner ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- Changed workspace Git status to skip its reload after a short reconnect with no file changes ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
- Changed worktree teardown to keep the worktree when the command exceeds one minute or the `worktree.teardownTimeoutMs` limit in `paseo.json` ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
- Changed workspace navigation to acknowledge taps promptly and initially load fewer offscreen chat rows on mobile ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- Changed workspace Git status to reuse its snapshot after a short reconnect when the checkout has not changed ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
- Changed `browser_new_tab` to ask agents to choose a Desktop when several are connected ([#10189](https://github.com/getpaseo/paseo/pull/10189))
### Fixed
- Fixed an online host's workspaces going missing ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- Fixed chat history timing out when many open chats refresh after reconnecting ([#10368](https://github.com/getpaseo/paseo/pull/10368))
- Fixed an online host's workspaces staying missing after the app evicts its cached directory ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- Fixed chat history timing out when many open chats refresh at once after reconnecting ([#10368](https://github.com/getpaseo/paseo/pull/10368))
- Fixed slow reopening of long Claude chats while the daemon is busy ([#10369](https://github.com/getpaseo/paseo/pull/10369))
- Fixed images from a live reply waiting for images in another chat's history to load ([#10371](https://github.com/getpaseo/paseo/pull/10371))
- Fixed agents failing to recover after stopping a foreground daemon with Ctrl+C ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- Fixed long Antigravity chats losing the end of their history after a daemon restart ([#10428](https://github.com/getpaseo/paseo/pull/10428))
- Fixed agent recovery failing and idle agents showing errors after stopping a foreground daemon with Ctrl+C on macOS or Linux ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- Fixed Antigravity turns ending while a background command is still running ([#10310](https://github.com/getpaseo/paseo/pull/10310))
- Fixed the Add model sheet staying open after saving a custom model ([#10432](https://github.com/getpaseo/paseo/pull/10432))
- Fixed slash suggestions failing when a provider reports duplicate command names ([#10275](https://github.com/getpaseo/paseo/pull/10275))
- Fixed resumed Codex sessions using their previous working directory for configuration and MCP servers ([#10390](https://github.com/getpaseo/paseo/pull/10390) by [@tabulius-ux](https://github.com/tabulius-ux))
- Fixed stale Codex subagent statuses after reopening or rewinding the parent chat ([#10171](https://github.com/getpaseo/paseo/pull/10171) by [@AnalyticETH](https://github.com/AnalyticETH))
- Fixed Usage showing the previous Claude account's quota after switching accounts ([#10236](https://github.com/getpaseo/paseo/pull/10236))
- Fixed the sidebar usage row dropping period labels when several usage windows are pinned ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- Fixed Changes failing to recognize a checkout immediately after restoring its worktree ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304), [#10406](https://github.com/getpaseo/paseo/pull/10406))
- Fixed split-pane dividers stopping or lagging during drags ([#5996](https://github.com/getpaseo/paseo/pull/5996))
- Fixed the sidebar usage row dropping period labels such as `5h` and `wk` when multiple usage windows are pinned ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- Fixed Changes failing to recognize a checkout immediately after restoring its worktree ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304))
- Fixed double-click word selection and triple-click line selection in diffs ([#10252](https://github.com/getpaseo/paseo/pull/10252) by [@pedrovieira](https://github.com/pedrovieira))
- Fixed the composer and chat column losing alignment when Chat outline is enabled ([#10277](https://github.com/getpaseo/paseo/pull/10277))
- Fixed the web composer's focus shortcut hint overlapping the placeholder ([#6200](https://github.com/getpaseo/paseo/pull/6200))
- Fixed the archive shortcut failing when the active workspace's sidebar group is collapsed ([#10356](https://github.com/getpaseo/paseo/pull/10356) by [@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
- Fixed other sessions and plugins seeing a workspace as active while another session is archiving it ([#10391](https://github.com/getpaseo/paseo/pull/10391) by [@tabulius-ux](https://github.com/tabulius-ux))
- Fixed Android composer buttons requiring a second tap after typing or zooming a chat image ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
- Fixed swiping a terminal in an Android browser opening the keyboard ([#10225](https://github.com/getpaseo/paseo/pull/10225) by [@tonylt](https://github.com/tonylt))
- Fixed swiping a terminal in an Android browser opening the keyboard when it was closed ([#10225](https://github.com/getpaseo/paseo/pull/10225) by [@tonylt](https://github.com/tonylt))
- Fixed Collapse turns hiding a finished OMP or Pi reply when an idle provider notice appears ([#10135](https://github.com/getpaseo/paseo/pull/10135))
- Fixed repeated finish notifications while an agent responds to background tasks ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- Fixed repeated finish notifications while an agent responds to background tasks and its earlier finish is unread ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- Fixed an empty chat losing the prompt and start of a reply after reconnecting mid-reply ([#9723](https://github.com/getpaseo/paseo/pull/9723) by [@ragokan](https://github.com/ragokan))
- Fixed changing the Claude thinking level stopping its background work ([#10008](https://github.com/getpaseo/paseo/pull/10008) by [@gilad-rubin](https://github.com/gilad-rubin))
- Fixed changes between Claude thinking levels stopping its background work ([#10008](https://github.com/getpaseo/paseo/pull/10008) by [@gilad-rubin](https://github.com/gilad-rubin))
- Fixed OpenCode turns staying running after a shared OpenCode service stops ([#10187](https://github.com/getpaseo/paseo/pull/10187))
- Fixed OMP denying an approved tool call when session or grant choices were offered ([#10126](https://github.com/getpaseo/paseo/pull/10126) by [@dsingal0](https://github.com/dsingal0))
- Fixed a Codex message stopped before its turn starts showing an error instead of canceled ([#9931](https://github.com/getpaseo/paseo/pull/9931) by [@3ae3ae](https://github.com/3ae3ae))
- Fixed Changes failing to open when Git metadata watching reaches its limit ([#10188](https://github.com/getpaseo/paseo/pull/10188))
- Fixed copying selected reply text into plain-text targets with unwanted Markdown syntax ([#10079](https://github.com/getpaseo/paseo/pull/10079) by [@danberindei](https://github.com/danberindei))
- Fixed Markdown previews and source views losing their scroll position when switching between them ([#10195](https://github.com/getpaseo/paseo/pull/10195) by [@apple-ouyang](https://github.com/apple-ouyang))
- Fixed file views losing their scroll position when switching Preview and Source, except HTML previews on iOS ([#10195](https://github.com/getpaseo/paseo/pull/10195) by [@apple-ouyang](https://github.com/apple-ouyang))
- Fixed file tabs in split panes showing or focusing the wrong file ([#9888](https://github.com/getpaseo/paseo/pull/9888) by [@KosmoCHE](https://github.com/KosmoCHE))
- Fixed touch-screen submenus closing as soon as they open ([#10175](https://github.com/getpaseo/paseo/pull/10175) by [@christiantwu](https://github.com/christiantwu))
- Fixed dictation failing after another chat that used the microphone closes ([#10185](https://github.com/getpaseo/paseo/pull/10185) by [@Brandon168](https://github.com/Brandon168))
@@ -81,14 +74,13 @@
- Fixed Mermaid flowcharts with `@` in labels showing source instead of the diagram ([#10165](https://github.com/getpaseo/paseo/pull/10165) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
- Fixed hidden background workspaces triggering the dock badge and favicon ([#9983](https://github.com/getpaseo/paseo/pull/9983))
- Fixed desktop sidebar navigation crowding out workspaces ([#9903](https://github.com/getpaseo/paseo/pull/9903) by [@pentatonic-alex](https://github.com/pentatonic-alex))
- Fixed closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- Fixed historical closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- Fixed plugin agents failing to reopen after their provider closes the session ([#10153](https://github.com/getpaseo/paseo/pull/10153))
- Fixed plugin screens and settings failing to use plugin state hooks ([#10049](https://github.com/getpaseo/paseo/pull/10049))
### Plugins
- Added plugin control of worktree creation, removal, and restoration ([#10278](https://github.com/getpaseo/paseo/pull/10278))
- Added a `focusHost` navigation option that selects the destination host in the sidebar ([#5574](https://github.com/getpaseo/paseo/pull/5574) by [@discwl](https://github.com/discwl))
- Added a `focusHost` navigation option for plugins to select the destination host in the sidebar when opening a workspace or agent ([#5574](https://github.com/getpaseo/paseo/pull/5574) by [@discwl](https://github.com/discwl))
## 0.16.2 - 2026-11-18
+26 -34
View File
@@ -1,69 +1,62 @@
# Changelog
## 0.17.1 - 2026-11-21
## 0.17.0 - 2026-11-21
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。需要 [Antigravity CLI 1.5.0 或更高版本](https://paseo.sh/zh-CN/docs/supported-providers/antigravity)。([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从分支或 PR 创建 worktree。([#10190](https://github.com/getpaseo/paseo/pull/10190))
- **在 Paseo 中更新 Provider**:查看各 Provider 的状态和已安装版本,并在应用内更新受支持的 CLI。([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider 配额预测**:“使用情况”页面会显示配额按当前使用速度将在重置前何时用完。([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
- **监视 PR 和 MR**:让 Agent 监视 PR 或 MR 的检查、审查和评论更新。([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从分支或 PR 创建 worktree。插件可以管理 worktree 的创建、移除和恢复。从 fork 的 PR 或 MR 创建分支时,选择“运行设置”以批准工作区自动化。([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
- **在 Paseo 中更新 Provider**:在 Provider 列表中查看各 Provider 的状态、已安装版本和可用更新。从设置、初次配置或模型选择器打开 Provider 设置,即可更新受支持的 CLI 并查看输出。([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider 配额预测**:“使用情况”页面根据当前使用速度估算配额何时用完,或重置时还会剩下多少。预测结果显示在重置时间同一行中。([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
- **监视 PR 和 MR**:让 Agent 监视 GitHub、GitLab、Gitea、Forgejo 或 Codeberg 上的 PR 或 MR,跟踪检查、审查或评论的变化。你可以在后台任务中停止监视。([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **在后台任务中查看 heartbeat**:在 Agent 的后台任务旁查看和停止 heartbeat。([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
- **Agent 消息排队等待**:默认情况下,其他 Agent 的消息会等当前轮次结束后再送达。([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
- **更多 goose 模型**:从 goose 中已配置的所有 Provider 选择模型。([#9719](https://github.com/getpaseo/paseo/pull/9719),贡献者:[@i386](https://github.com/i386))
- **Agent 消息排队等待**:其他 Agent 的报告和通知会在当前轮次结束后到达,不会打断当前轮次。([#9757](https://github.com/getpaseo/paseo/pull/9757))
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。请在 daemon 主机上使用 Antigravity CLI 1.5.0 或更新版本,如果覆盖了启动命令请包含 `acp`。如果 Hub 中保存的模型 ID 含有旧的推理强度后缀,请重新选择模型和思考级别。([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **更多 goose 模型**:从 goose 中已配置的所有 Provider 选择模型。现有 goose 设置和会话会迁移到内置插件。([#9719](https://github.com/getpaseo/paseo/pull/9719),贡献者:[@i386](https://github.com/i386))
- **插件 Agent 指令**:插件可以向 Agent 添加自己的指令。([#9781](https://github.com/getpaseo/paseo/pull/9781))
### 新增
- 在“使用情况”页面和 `paseo usage` 中新增 OpenRouter 余额和 API 密钥支出 ([#10269](https://github.com/getpaseo/paseo/pull/10269))
- 在“使用情况”页面新增 Antigravity 账号配额 ([#10232](https://github.com/getpaseo/paseo/pull/10232),贡献者:[@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- 在 `/` 建议中新增 Antigravity 技能 ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- 为 Antigravity 新增内置编排技能 ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- 在提示词中输入 `/` 时,新增 Antigravity 技能建议 ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- 在已安装 Paseo 技能的主机上,为 Antigravity 新增内置编排技能 ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- 新增 Cmd/Ctrl+/ 和 Cmd/Ctrl+Shift+/ 快捷键,用于打开模型选择器和切换思考级别 ([#10147](https://github.com/getpaseo/paseo/pull/10147))
- 新增在发送第一条消息前通过命令中心搜索 Agent 设置 ([#10182](https://github.com/getpaseo/paseo/pull/10182),贡献者:[@cleiter](https://github.com/cleiter))
- 新增在命令中心回退最近轮次的操作 ([#10144](https://github.com/getpaseo/paseo/pull/10144))
- 新增 Claude 的独立 Ultracode 开关 ([#10150](https://github.com/getpaseo/paseo/pull/10150),贡献者:[@fivetaku](https://github.com/fivetaku))
- 新增符合条件的 Claude 模型的独立 Ultracode 开关 ([#10150](https://github.com/getpaseo/paseo/pull/10150),贡献者:[@fivetaku](https://github.com/fivetaku))
- 新增 Codex Flex 速度选项 ([#9809](https://github.com/getpaseo/paseo/pull/9809),贡献者:[@qjqqyy](https://github.com/qjqqyy))
- 新增 shell 脚本和 Dockerfile 的语法高亮 ([#10178](https://github.com/getpaseo/paseo/pull/10178))
- 为 Hub 会话新增列出已连接 daemon 项目的能力 ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- 为具有 `hub.execute` 权限的 Hub 会话新增列出已连接 daemon 活跃项目的能力 ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- 新增 `paseo ls --json` 输出的标签和工作区 ID ([#10076](https://github.com/getpaseo/paseo/pull/10076))
### 变更
- 将内容宽度改为默认、宽版和全宽预设,并同时调整已打开对话和 Markdown 预览的宽度 ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Antigravity 工具卡片现在显示 shell 命令、输出和文件 diff ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- 将“外观”中的内容宽度改为默认(820 px)、宽版(1,200 px)和全宽预设,同时调整已打开对话、Composer 和 Markdown 预览的宽度 ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Antigravity 工具卡片现在显示 shell 命令及输出、文件 diff 和 Paseo 工具详情 ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- 从 GitHub 克隆时,优先显示匹配的私有仓库 ([#10264](https://github.com/getpaseo/paseo/pull/10264))
- “使用情况”页面中健康的配额进度条改为绿色 ([#10397](https://github.com/getpaseo/paseo/pull/10397))
- worktree 清理命令超时时保留 worktree ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
- 手机端工作区导航更快响应点击 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- 短暂重连且文件未更改时,工作区 Git 状态不再重新加载 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
- worktree 清理命令在超过默认的一分钟或 `paseo.json` 中 `worktree.teardownTimeoutMs` 限制时保留 worktree ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
- 工作区导航会立即响应点击,并在手机端初始加载时减少屏幕外的对话行数 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- 工作区 Git 状态在短暂重连且检出的内容未更改时复用之前的快照 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
- 连接多个 Desktop 时,`browser_new_tab` 会让 Agent 选择打开标签页的 Desktop ([#10189](https://github.com/getpaseo/paseo/pull/10189))
### 修复
- 修复在线主机的工作区不显示的问题 ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- 修复应用清除主机目录缓存后,在线主机的工作区一直不显示的问题 ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- 修复重新连接后多个已打开的对话同时刷新时,历史记录加载超时的问题 ([#10368](https://github.com/getpaseo/paseo/pull/10368))
- 修复 daemon 繁忙时,重新打开较长的 Claude 对话速度慢的问题 ([#10369](https://github.com/getpaseo/paseo/pull/10369))
- 修复当前回复中的图片等待另一个对话的历史图片加载的问题 ([#10371](https://github.com/getpaseo/paseo/pull/10371))
- 修复用 Ctrl+C 停止前台 daemon 后 Agent 恢复失败的问题 ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- 修复 daemon 重启后较长的 Antigravity 对话丢失末尾历史记录的问题 ([#10428](https://github.com/getpaseo/paseo/pull/10428))
- 修复在 macOS 或 Linux 上用 Ctrl+C 停止前台 daemon 后,Agent 恢复失败且空闲 Agent 显示错误的问题 ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- 修复 Antigravity 后台命令仍在运行时轮次就已结束的问题 ([#10310](https://github.com/getpaseo/paseo/pull/10310))
- 修复保存自定义模型后“添加模型”弹窗一直保持打开的问题 ([#10432](https://github.com/getpaseo/paseo/pull/10432))
- 修复 Provider 返回重复命令名称时,斜杠建议列表出错的问题 ([#10275](https://github.com/getpaseo/paseo/pull/10275))
- 修复恢复的 Codex 会话的配置和 MCP 服务器仍沿用旧工作目录的问题 ([#10390](https://github.com/getpaseo/paseo/pull/10390),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
- 修复重新打开或回退父对话后,Codex 子 Agent 状态未更新的问题 ([#10171](https://github.com/getpaseo/paseo/pull/10171),贡献者:[@AnalyticETH](https://github.com/AnalyticETH))
- 修复切换 Claude 账号后,“使用情况”页面仍显示上一个账号配额的问题 ([#10236](https://github.com/getpaseo/paseo/pull/10236))
- 修复固定多个用量窗口时,侧边栏用量行隐藏周期标签的问题 ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- 修复恢复 worktree 后,“更改”无法立即识别检出目录的问题 ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304), [#10406](https://github.com/getpaseo/paseo/pull/10406))
- 修复拖动分屏分隔条时卡住或跟手缓慢的问题 ([#5996](https://github.com/getpaseo/paseo/pull/5996))
- 修复固定多个用量窗口时,侧边栏用量行隐藏 `5h` 和 `wk` 等周期标签的问题 ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- 修复恢复 worktree 后,“更改”无法立即识别检出目录的问题 ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304))
- 修复 diff 中双击选词和三击选行的问题 ([#10252](https://github.com/getpaseo/paseo/pull/10252),贡献者:[@pedrovieira](https://github.com/pedrovieira))
- 修复启用聊天大纲时,Composer 与对话栏对不齐的问题 ([#10277](https://github.com/getpaseo/paseo/pull/10277))
- 修复网页版 Composer 的聚焦快捷键提示遮挡占位符文字的问题 ([#6200](https://github.com/getpaseo/paseo/pull/6200))
- 修复当前工作区所在的侧边栏分组折叠时,归档快捷键失效的问题 ([#10356](https://github.com/getpaseo/paseo/pull/10356),贡献者:[@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
- 修复一个会话正在归档工作区时,其他会话和插件仍将其显示为活跃状态的问题 ([#10391](https://github.com/getpaseo/paseo/pull/10391),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
- 修复在 Android 上输入文字或缩放对话图片后,首次点击 Composer 按钮无效的问题 ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
- 修复在 Android 浏览器中滑动终端时弹出键盘的问题 ([#10225](https://github.com/getpaseo/paseo/pull/10225),贡献者:[@tonylt](https://github.com/tonylt))
- 修复在 Android 浏览器中滑动终端时弹出已关闭的键盘的问题 ([#10225](https://github.com/getpaseo/paseo/pull/10225),贡献者:[@tonylt](https://github.com/tonylt))
- 修复启用“折叠轮次”时,空闲的 Provider 通知导致已完成的 OMP 或 Pi 回复被隐藏的问题 ([#10135](https://github.com/getpaseo/paseo/pull/10135))
- 修复 Agent 响应后台任务时重复发送完成通知的问题 ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- 修复 Agent 响应后台任务时,在之前的完成状态未读的情况下重复发送完成通知的问题 ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- 修复空对话在回复中途重连后丢失提示词和回复开头的问题 ([#9723](https://github.com/getpaseo/paseo/pull/9723),贡献者:[@ragokan](https://github.com/ragokan))
- 修复切换 Claude 思考级别时停止后台任务的问题 ([#10008](https://github.com/getpaseo/paseo/pull/10008),贡献者:[@gilad-rubin](https://github.com/gilad-rubin))
- 修复共享 OpenCode 服务停止后轮次一直显示为运行中的问题 ([#10187](https://github.com/getpaseo/paseo/pull/10187))
@@ -71,7 +64,7 @@
- 修复 Codex 消息在轮次开始前停止时显示错误而非已取消的问题 ([#9931](https://github.com/getpaseo/paseo/pull/9931),贡献者:[@3ae3ae](https://github.com/3ae3ae))
- 修复 Git 元数据监听达到上限时无法打开“更改”的问题 ([#10188](https://github.com/getpaseo/paseo/pull/10188))
- 修复将选中的回复复制到纯文本目标时出现多余 Markdown 语法的问题 ([#10079](https://github.com/getpaseo/paseo/pull/10079),贡献者:[@danberindei](https://github.com/danberindei))
- 修复在预览和源码之间切换时 Markdown 预览和源码视图丢失滚动位置的问题 ([#10195](https://github.com/getpaseo/paseo/pull/10195),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
- 修复在预览和源码之间切换时文件视图丢失滚动位置的问题,iOS 的 HTML 预览除外 ([#10195](https://github.com/getpaseo/paseo/pull/10195),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
- 修复拆分窗格中的文件标签页显示或聚焦错误文件的问题 ([#9888](https://github.com/getpaseo/paseo/pull/9888),贡献者:[@KosmoCHE](https://github.com/KosmoCHE))
- 修复触摸屏上的子菜单打开后立即关闭的问题 ([#10175](https://github.com/getpaseo/paseo/pull/10175),贡献者:[@christiantwu](https://github.com/christiantwu))
- 修复关闭另一个使用过麦克风的对话后无法听写的问题 ([#10185](https://github.com/getpaseo/paseo/pull/10185),贡献者:[@Brandon168](https://github.com/Brandon168))
@@ -81,14 +74,13 @@
- 修复 Mermaid 流程图标签含有 `@` 时显示源码而非图表的问题 ([#10165](https://github.com/getpaseo/paseo/pull/10165),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
- 修复隐藏的后台工作区触发程序坞徽标和网站图标状态的问题 ([#9983](https://github.com/getpaseo/paseo/pull/9983))
- 修复桌面侧边栏导航占满工作区列表空间的问题 ([#9903](https://github.com/getpaseo/paseo/pull/9903),贡献者:[@pentatonic-alex](https://github.com/pentatonic-alex))
- 修复仓库默认分支显示已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- 修复仓库默认分支显示历史已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- 修复 Provider 关闭会话后插件 Agent 无法重新打开的问题 ([#10153](https://github.com/getpaseo/paseo/pull/10153))
- 修复插件页面和设置无法使用插件状态钩子的问题 ([#10049](https://github.com/getpaseo/paseo/pull/10049))
### 插件
- 新增插件对 worktree 创建、移除和恢复的管理能力 ([#10278](https://github.com/getpaseo/paseo/pull/10278))
- 新增插件导航 `focusHost` 选项,用于在侧边栏选中目标主机 ([#5574](https://github.com/getpaseo/paseo/pull/5574),贡献者:[@discwl](https://github.com/discwl))
- 新增插件导航 `focusHost` 选项,打开工作区或 Agent 时在侧边栏选中目标主机 ([#5574](https://github.com/getpaseo/paseo/pull/5574),贡献者:[@discwl](https://github.com/discwl))
## 0.16.2 - 2026-11-18
+1 -1
View File
@@ -56,7 +56,7 @@ At the start of non-trivial work, list `docs/` and skim anything relevant to the
| [docs/terminal-rendering.md](docs/terminal-rendering.md) | Native terminal view: xterm owns the grid, cluster placement, emoji widths, mixed-direction limits, render regression |
| [docs/agent-stream-performance.md](docs/agent-stream-performance.md) | Assistant text pipeline — coalescing window, paced reveal, why arrival lumps are smoothed at render |
| [docs/agent-stream-disclosure.md](docs/agent-stream-disclosure.md) | Expand/collapse in the chat timeline — hold contract, native anchor sequence, frame spacing, render-window cost |
| [docs/markdown-renderer.md](docs/markdown-renderer.md) | Shared Markdown engine, the vendored library fork, native selection, links, images and library constraints |
| [docs/markdown-renderer.md](docs/markdown-renderer.md) | Shared Markdown engine, native selection, links, images and library constraints |
| [docs/native-text-selection.md](docs/native-text-selection.md) | Native diagram grouping, selection boundaries and leading inline image limitations |
| [docs/file-observation.md](docs/file-observation.md) | Recursive watcher ownership, Linux constraints, teardown invariants, and Parcel comparison |
| [docs/testing.md](docs/testing.md) | TDD workflow, determinism, real dependencies over mocks, test organization |
+5 -21
View File
@@ -150,29 +150,13 @@ Users can also detach an existing subagent from the subagents track. Detach is d
`notifyOnFinish` defaults to `true` for agent-scoped creation and prompt follow-ups because most delegated work needs to report back to the creating agent. Set it to `false` for explicit reporting or no completion callback.
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch. The module keeps one ordered queue per recipient, and the recipient reads its prompts in the order the daemon admitted them. Nothing overtakes an older queued message. A prompt takes its place when the daemon admits it, even while the provider is still starting an earlier turn, and a message stays in the queue until the turn that carries it starts. The turn has started when the agent manager acknowledges the run start; a turn that fails after that point is not delivered again.
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch. Idle recipients retain the two-second quiet window. While a recipient has a running or starting turn (including compaction), messages stay queued across quiet windows and are delivered together after that turn settles, including failure or cancellation. A ready batch is released when the daemon observes the recipient settle; the two-second timer also retries it. Agent callers using `steer`, including the default, wait for the turn to end; only explicit `interrupt` replaces a running turn. An explicit interrupt or a command the provider accepts out of band runs before earlier queued messages. Those messages stay queued and are delivered after the running or replacement turn ends. Human prompts dispatch directly with their existing behavior. Conflicting session-mode choices retain separate ordered dispatches.
An agent sender picks `queue`, `steer`, or `interrupt` with `activeTurnBehavior`. `steer` and `interrupt` mean what they mean for a person. A person's send has no `queue`. Each kind of prompt is released this way:
- **`queue`** (the agent default) waits. An idle recipient gets the queue after two quiet seconds; steady arrivals cannot hold that window open past ten seconds. While the recipient has a running or starting turn (including compaction), the queue waits and is delivered together when that turn ends on its own or fails. The daemon releases it when it observes the recipient settle; a two-second timer also retries. Finish notifications and change-request updates always queue.
- **`steer`** waits for neither the quiet window nor the turn. It is dispatched at admission as one prompt that enters the running turn: the messages queued before it, then the steer. A provider that cannot steer, or that refuses this steer, gets the prompt as a replacing turn instead, the same as a person's steer.
- **`interrupt`** is dispatched at admission the same way, as one prompt that replaces the running turn. An older queued message cannot start a turn after the newer `interrupt` that countermands it.
- **A person's prompt** (app, CLI, top-level MCP) is dispatched directly with its existing steer or interrupt behavior and takes the queue along the same way: the messages admitted before it first, then the person's text, in one provider prompt. Messages admitted after it follow it. The person's text keeps its own transcript row. When the turn does not start, the messages return to the queue in their place. That covers a start the provider rejects and a start that is not acknowledged within 60 seconds; a provider that starts the turn after those 60 seconds receives the messages twice.
- **Stop** (the stop button, Escape, `cancel_agent`, a Hub interrupt) starts nothing. Messages admitted before the Stop are held, not dropped, including an interrupt whose turn had not started yet. They go ahead of the recipient's next prompt, in that prompt's turn: a person's prompt, or an agent message or notification admitted after the Stop. A held steer or interrupt no longer enters the turn; it waits like a queued message. A queue step or dispatch decided before the Stop is void, and the queue is held again when the message that reopened it is withdrawn. A replacing prompt, a reload, and a rewind are not a Stop. Neither is `cancel_agent` on a recipient with no running or starting turn: it stops nothing, reports that it canceled no run, and a queued message keeps its quiet window.
The queued receipt carries the applied behavior and guidance text for the sender. The text comes from two facts known at admission: whether the recipient has a running turn, and whether its provider can steer (`AgentManager.canSteer`, which is true when the session offers `steerActiveTurn`). It does not wait for the outcome. Guidance for a message queued behind a running turn tells the sender to send a short `steer` or `interrupt` follow-up instead of resending, because the follow-up carries the queued message ahead of it and a resend would be read twice. The MCP tool, the WebSocket `send_agent_message_response`, the CLI, and the connected-host path all relay this one text.
Older CLIs and connected hosts send an explicit `steer` for every default agent send. The daemon reads an agent sender's `steer` as `queue` unless the client advertises the `agent_active_turn_behaviors` capability. A new client talking to a daemon without `server_info.features.agentActiveTurnBehaviors` sends no behavior for `queue` and refuses a `steer`.
A command the provider accepts out of band is the one exception to admission order: it runs alone without ending the turn. A queued command runs ahead of older messages, and a `steer` or `interrupt` that runs this way takes no queued message along. A person's command leaves the queue where it is. A prompt is a command when it starts with a slash and a name that has no second slash, so `/compact` is one and `/tmp/build.log is stale` is plain text.
One provider prompt has one session mode. A batch released by a steer, an interrupt, or a person's prompt uses the latest explicit choice in it, the person's own first. Queued messages with conflicting choices keep separate ordered dispatches.
The pending message window is in memory. Clean shutdown flushes it, held messages included, before
closing agents; an abrupt crash can lose queued prompts. A durable send receipt remains pending until actual dispatch
The pending message window is in memory. Clean shutdown flushes it before closing agents; an abrupt
crash can lose queued prompts. A durable send receipt remains pending until actual dispatch
acknowledgment, so a lost window never becomes a completed receipt. Completion waits cover queued
admission within their original timeout and cancellation scope, and return at permission
checkpoints and when a Stop holds the queue.
admission within their original timeout and cancellation scope, and return permission checkpoints
while messages are waiting.
Finish notification intent has a separate daemon-owned lifetime. The finish-subscriptions module
persists caller, child, host, and ownership policy through an injectable store; its JSON adapter uses
+1 -1
View File
@@ -57,7 +57,7 @@ Authoritative terminology. UI label wins. Don't invent synonyms; use what's here
- **Agent controls** — Provider, model, mode, thinking, and provider-feature controls for an agent or draft agent. Code: `AgentControls` / `DraftAgentControls` (`packages/app/src/composer/agent-controls/index.tsx`). Forbidden: "Agent status bar".
- **Composer footer** — Optional area rendered below the composer input but still inside the keyboard-shifted composer layout. Code: `Composer.footer` (`packages/app/src/composer/index.tsx`).
- **Composer track** — A contextual lane at the foot of a pane, by the composer input. Specific tracks use the `<thing> track` form: **Queue track**, **Subagents track**, **Tasks track**. The subagents and tasks tracks are pills floating over the transcript, each opening a panel with its rows; the queue track is a lane inside the composer itself. Code: queue track inside `Composer` (`packages/app/src/composer/index.tsx`), pill and panel frame in `packages/app/src/composer/tracks.tsx`, `SubagentsTrack` (`packages/app/src/subagents/track.tsx`), `AgentTaskList` (`packages/app/src/composer/task-list/index.tsx`).
- **Steer** — A follow-up admitted into an agent's already-running turn instead of interrupting it. Interrupting the turn discards steers the provider has not read yet; there is no take-back short of that, and no provider offers one. The stop button and Escape both interrupt. A steer the provider never read keeps its transcript row, matching Codex. Sending while the agent waits on a permission denies that request first, so the message reaches the same turn instead of stalling behind it. UI: "Send and steer". Code: `steerActiveTurn` (`packages/server/src/server/agent/agent-sdk-types.ts`). Don't confuse with **Queue track**, which holds messages client-side until the turn ends and never enters the running turn. An agent sender's `activeTurnBehavior: "steer"` (CLI `--behavior steer`) means the same as a person's steer. Agent senders default to `queue` instead: the daemon holds the message until the running turn ends, as the queue track does for a person. Forbidden: "Delivery", "Queued prompt".
- **Steer** — A follow-up admitted into an agent's already-running turn instead of interrupting it. Interrupting the turn discards steers the provider has not read yet; there is no take-back short of that, and no provider offers one. The stop button and Escape both interrupt. A steer the provider never read keeps its transcript row, matching Codex. Sending while the agent waits on a permission denies that request first, so the message reaches the same turn instead of stalling behind it. UI: "Send and steer". Code: `steerActiveTurn` (`packages/server/src/server/agent/agent-sdk-types.ts`). Don't confuse with **Queue track**, which holds messages client-side until the turn ends and never enters the running turn. Forbidden: "Delivery", "Queued prompt".
- **Subagent** — User-facing term for an agent session related to a parent agent session. Use **subagents** in UI copy and docs. Internal daemon/provider plumbing may say "child agent" or `child_session`, especially for provider-managed imports; do not surface "child agent" as a product term.
- **Attachment tray** — The selected-attachments row inside the composer input, above the text input. Code: `renderAttachmentTray` (`packages/app/src/composer/index.tsx`). Forbidden: "Attachment bar".
- **Fork** — Starting a NEW agent session seeded with a copy of another session's curated chat history. The history rides along as a `chat_history` composer attachment on a draft; the fork does **not** resume or branch the provider-side session, and the source session keeps running untouched. Two targets, one surface, one RPC (`agent.fork_context`, gated on the `agentForkContext` host feature). UI: the fork menu lives in the assistant turn footer and offers "Fork in a new tab" / "Fork in a new workspace". On a **completed** turn it sits beside the copy button and pins a boundary to that turn, so the fork stops where the turn ended. On the **in-flight** turn it sits beside the progress loader and elapsed timer, and omits the boundary entirely — `selectForkContextRows` projects the whole timeline when no boundary is given, so the fork captures everything **up to now**, including the response still streaming. That omission is what makes mid-run forking work; pinning a boundary there would silently drop the live response. Forbidden on provider-subagent (read-only) panes. Code: `useForkAgent` (`packages/app/src/hooks/use-fork-agent.ts`), `selectForkContextRows` (`packages/server/src/server/agent/activity-curator.ts`). Don't confuse with: git fork (unrelated; Paseo has no such concept), **Worktree** (filesystem isolation, not history copying).
+2 -3
View File
@@ -72,9 +72,8 @@ hashes, never prompts, environment values, or credentials.
Before messaging an archived workspace, call `workspace.recovery.inspect.request`, then
`workspace.recovery.restore.request` and await success. The native message handler unarchives the
agent and loads its persisted provider session. A Hub message is a direct send (no `sourceAgentId`), so
`activeTurnBehavior: "steer"` uses the provider's native steering and interrupts the running turn
when that provider cannot steer. The daemon rejects `queue` on a direct send.
agent and loads its persisted provider session. `activeTurnBehavior: "steer"` uses the provider's
native steering behavior, including Paseo's existing behavior when that provider cannot steer.
Execution completion and arrival-specific output authority remain Hub responsibilities.
The older `hub.execution.*` RPCs remain accepted for existing clients. Their execution ownership
+5 -24
View File
@@ -14,38 +14,19 @@ Workspace file links use the shared file-link resolver. The workspace supplies i
Pass `external` for author-controlled Markdown from outside the host, such as a plugin README. It follows the registry's overview contract in `packages/protocol/src/plugin-overview.ts`, which the website also uses: only absolute https links and images work, and any other destination renders as its label or alt text. The parser still autolinks bare `http://`, `www.` and email text, so a link press checks the URL again and opens only https. None of the workspace recognition above applies, so `Node.js` is prose, not a file. The lines of a paragraph join, as they do on the README's forge.
Resolve workspace image paths over the existing session RPC, then give the library a cached native file URL or web blob URL. HTTP(S) images pass through unchanged. This preserves relay, SSH and local socket connections, which do not expose a daemon HTTP endpoint. Each mounted renderer owns its image acquisition identity, so a later reply reads a rewritten path again while the earlier mounted reply retains its snapshot. Image taps open the attachment lightbox. File previews resolve relative images against the Markdown file's directory. An image alone on its line becomes its own paragraph before the library sees it, so it renders as a block on every platform; the library only treats sole-child paragraph images as blocks, and with hard soft breaks every newline is a break node, which left own-line images inline on iOS and web. Images that share a line with text stay inline at line height and keep their aspect ratio. A linked image counts as an image, so review-bot badges such as `[![Retrigger](badge.svg)](url) Confidence` stay inline on web; the library's web renderer only checked direct paragraph children, so it rendered them as full-width block images (fixed in the fork).
## The fork
The library is a private workspace, `packages/react-native-enriched-markdown`. It is upstream [enriched-markdown](https://github.com/software-mansion/enriched-markdown) at npm `1.2.0-nightly-20261014-766fc0e67` (upstream commit `766fc0e67`) plus Paseo's changes, which lived in a `patch-package` patch until the package moved into the repository. It is never published. Keep the name `react-native-enriched-markdown`: autolinking, the Gradle project `:react-native-enriched-markdown`, the CocoaPods spec and app imports all use it.
The package keeps the npm tarball's layout, including its build output:
- Metro, Vitest and TypeScript load `lib/`, not `src/`. A JavaScript change edits `src/` and the matching `lib/module` and `lib/typescript` files.
- `android/generated` and `ios/generated` are checked-in codegen output (`includesGeneratedCode`). A change to a native component spec regenerates both; `scripts/postinstall-patches.test.mjs` compares them against the specs.
- `src/web/wasm/md4c.js` and `lib/module/web/wasm/md4c.js` are an Emscripten build of `cpp/md4c`. A parser change rebuilds them with upstream's `packages/core/cpp/wasm/build.sh`.
- Upstream's Gradle, CMake and CocoaPods scripts detect upstream's own monorepo by the paths `packages/core` and a root `vendor/`. Do not add either path to this repository.
- `postinstall.mjs` downloads the tree-sitter grammars into the ignored `cpp/highlight/vendor/grammars` and `vendor/tree-sitter`. The `enriched-markdown` block in `packages/app/package.json` chooses the languages.
CI does not build native code or run the fork's Robolectric suites. Run `npm run test:android --workspace=@getpaseo/app` for Android changes. Native changes require a client rebuild; JavaScript refresh cannot enable compiled grammars.
Some fork changes are backports. A sync past the upstream version drops them in favour of upstream's code:
| Fork change | Upstream | Released in |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- |
| Android measurements survive parent clones | [#924](https://github.com/software-mansion/enriched-markdown/pull/924) | after `1.2.0-nightly-20261019-926ef06f0` |
| Android nested list items start their text after their own marker | [#1015](https://github.com/software-mansion/enriched-markdown/pull/1015), [#1023](https://github.com/software-mansion/enriched-markdown/pull/1023) (Android) | `1.2.0` |
Resolve workspace image paths over the existing session RPC, then give the library a cached native file URL or web blob URL. HTTP(S) images pass through unchanged. This preserves relay, SSH and local socket connections, which do not expose a daemon HTTP endpoint. Each mounted renderer owns its image acquisition identity, so a later reply reads a rewritten path again while the earlier mounted reply retains its snapshot. Image taps open the attachment lightbox. File previews resolve relative images against the Markdown file's directory. An image alone on its line becomes its own paragraph before the library sees it, so it renders as a block on every platform; the library only treats sole-child paragraph images as blocks, and with hard soft breaks every newline is a break node, which left own-line images inline on iOS and web. Images that share a line with text stay inline at line height and keep their aspect ratio. A linked image counts as an image, so review-bot badges such as `[![Retrigger](badge.svg)](url) Confidence` stay inline on web; the library's web renderer only checked direct paragraph children, so it rendered them as full-width block images (local patch in `patches/react-native-enriched-markdown+*.patch`).
## Engine constraints
The pinned nightly has the same React Native package and core source trees as upstream commit `73ac5085eb1fdc743973b3473d4dba65abad5261`. Compatibility was checked with React Native 0.81.5. Native dependencies must be rebuilt when changing the highlighting configuration; JavaScript refresh cannot enable compiled grammars.
Math and video are disabled. Task lists and admonitions are enabled; task checkboxes are read-only. Source adaptation spaces adjacent empty GFM table delimiters before escaping prose spoiler delimiters and decodes entity text before the engine can discard it. Code spans and fences keep their literal source. Comment HTML is normalized to Markdown before parsing; details show their summary and body expanded.
Mermaid fences use the existing isolated diagram runtime and fullscreen viewer. Web dispatches them through the library’s code-block override. Native has no block-renderer hook, so the renderer extracts only Mermaid fences and places the existing WebView host between library-rendered segments. This is the only block exception; see [native selection limitations](native-text-selection.md) for diagram grouping and leading inline images. Streaming keeps the last valid diagram visible while the next revision renders.
Native code blocks use the library's copy control and compiled grammars. Web code blocks use `HighlightedCodeBlock` through the library's `renderers.codeBlock` override. Selection copy has to tell links Paseo recognized in the text (paths, forge references, code spans) from links in the Markdown, so the web link renderer marks the recognized ones. Plain-text paste carries them as the text the reply showed, and rich paste keeps them as links only when they point to an `http` or `https` URL. Authored links and parser autolinks such as a bare `www.example.com` copy as links. The fork also keeps the library's block spacing around the web code block override, preserves web list numbering and link titles, marks pending parses with `aria-busy` so Find waits for rendered text, and carries link syntax through native and web tap events. Web inline code inside a link inherits only the link colour; its code font, size and background stay intact. Keep link variants colour-only: native pills replace text runs and prevent paths from wrapping; Android pills also use the surrounding block’s font size. [Upstream PR #997](https://github.com/software-mansion/enriched-markdown/pull/997) tracks these changes.
Native code blocks use the library's copy control and compiled grammars. Web code blocks use `HighlightedCodeBlock` through the library's `renderers.codeBlock` override. Selection copy has to tell links Paseo recognized in the text (paths, forge references, code spans) from links in the Markdown, so the web link renderer marks the recognized ones. Plain-text paste carries them as the text the reply showed, and rich paste keeps them as links only when they point to an `http` or `https` URL. Authored links and parser autolinks such as a bare `www.example.com` copy as links. The patch also keeps the library's block spacing around the web code block override, preserves web list numbering and link titles, marks pending parses with `aria-busy` so Find waits for rendered text, and carries link syntax through native and web tap events. Web inline code inside a link inherits only the link colour; its code font, size and background stay intact. Keep link variants colour-only: native pills replace text runs and prevent paths from wrapping; Android pills also use the surrounding block’s font size. The package patch is tracked by [upstream PR #997](https://github.com/software-mansion/enriched-markdown/pull/997); remove the patch when the pinned release includes it.
The fork also keeps overflowing native horizontal blocks in control of their drags: Android claims parent interception at touch-down and releases it for vertical drags so the chat list can scroll; iOS keeps its scroll recognizer active for outward drags at the leading edge. This prevents compact sidebar pans from taking block scrolling without changing sidebar swipes on prose or non-overflowing blocks. Native changes require a client rebuild.
The package patch also keeps overflowing native horizontal blocks in control of their drags: Android claims parent interception at touch-down and releases it for vertical drags so the chat list can scroll; iOS keeps its scroll recognizer active for outward drags at the leading edge. This prevents compact sidebar pans from taking block scrolling without changing sidebar swipes on prose or non-overflowing blocks. Native changes require a client rebuild.
On iOS a newly mounted Markdown view paints empty for a frame or more after it is laid out at its measured height: the library parses even a view's first content on a background queue and applies it in a later main-queue turn. Expanding a turn in chat therefore shows its rows in place with the text arriving a frame later (165 ms when the mount keeps the main thread busy). Android paints the text in the first frame. Rendering a view's first content synchronously fixes the frame but costs frame time when a fling mounts history rows, so the app keeps the library's behavior until [enriched-markdown #1131](https://github.com/software-mansion/enriched-markdown/issues/1131) is resolved.
+111 -187
View File
@@ -6,26 +6,21 @@ All workspaces share one version and release together.
A release has exactly two steps. The agent does the first, the user authorizes the second.
**Preparation** (reversible — agent does this on the release branch):
**Preparation** (reversible — agent does this):
- resolve the [release base](#release-base-and-source) and get the [release inventory](#release-inventory) approved when one applies
- format, lint, typecheck all green
- resolve the [release base](#release-base-and-source), get the [release inventory](#release-inventory) approved when one applies, and confirm CI for the resulting release source is green
- classify the diff from the previous stable to the release source as patch or minor, then show the
target version and rationale to the user
- draft `CHANGELOG.md` and `CHANGELOG.zh-CN.md`, show the draft to the user, and wait for review
- run the pre-release sanity check (stable only) and surface findings to the user
- commit the approved changelog and any requested ACP update, run format, lint, and typecheck, then
run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag
- push the `release/vX.Y.Z` or `release/vX.Y.Z-beta.N` branch and confirm its `CI` and
`Desktop Packages` runs pass (never wait on `main` CI)
- draft the changelog, show it to the user, wait for review
- run the pre-release sanity check, surface findings to the user
**Go-ahead** (user says "go ahead"):
- run `npm run release:ship` (stable) or `npm run release:ship:beta` (beta), which publishes npm
with retry and registry visibility checks, advances the `beta` dist-tag on stable when newer, and
pushes the tag on the already-verified commit
- commit the approved release inputs locally on the release branch
- run the release, which publishes npm and pushes the release branch and tag
- create the release heartbeat immediately and babysit it to completion
- open the [reconcile `main`](#reconcile-main) PR right away so its CI runs in parallel with release
builds, then delete the remote release branch once the PR merges
- [reconcile `main`](#reconcile-main) with what shipped
Rules that apply to both steps:
@@ -92,42 +87,29 @@ An explicit user instruction can select another base.
1. Fetch `origin` with tags and resolve the base to one commit.
2. Create the release workspace through Paseo MCP on a new branch from the base, named
`release/vX.Y.Z` or `release/vX.Y.Z-beta.N` for the version being cut. `release:push` refuses
`main` and any branch outside `release/*`.
`release/vX.Y.Z` or `release/vX.Y.Z-beta.N` for the version being cut. Run the release from
this workspace: `release:push` pushes `HEAD` to the current branch.
3. Cherry-pick the approved commits in their `main` order with `git cherry-pick -x`, so each
commit records the `main` commit it came from. Include the prerequisites the inventory listed.
Resolve conflicts within the approved changes and report how. A resolution that needs new
behavior is a scope addition: surface it for selection.
4. Commit the approved `CHANGELOG.md`, `CHANGELOG.zh-CN.md`, and any explicitly requested ACP
catalog update on the release branch. Run `npm run format`, `npm run lint`, and
`npm run typecheck`, then run `npm run release:prep:<mode>`. This checks the packages, bumps all
workspace versions, generates stable F-Droid changelogs, updates `package-lock.json`, and creates
`chore(release): cut <version>` without a tag.
5. Push the release branch (`git push -u origin HEAD`). Pushing any `release/**` branch triggers
`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` cancels in-progress
runs on every merge. Wait for both runs on the release branch commit to pass before shipping.
Pushing a `release/**` branch without a `v*` tag triggers no publish workflows.
6. After go-ahead, run `npm run release:ship` (stable) or `npm run release:ship:beta` (beta). This
publishes to npm and pushes the `v*` tag on the already-verified commit. Because the release
branch is already pushed at `HEAD`, no second CI run starts and only the tag release workflows
run.
7. Start [Reconcile `main`](#reconcile-main) immediately so its PR checks overlap with desktop and
EAS builds.
When promoting or branching from a tag created before `release:prep:*`, `release:ship`, and the
`release/**` workflow triggers existed (for example `v0.17.0-beta.1`), either cherry-pick the
release-tooling commit onto the release branch (leaving product code unchanged) or follow the
older tag's scripts (`version:all:*`, manual `gh workflow run ci.yml --ref <branch>`,
`release:publish`, and `release:push`) until the next tag carries the new tooling.
4. Confirm CI for the release source. When the source is a commit whose CI already passed (the
captured `origin/main`, or the beta tag being promoted), use that run and watch pending CI to
completion. Otherwise push the release branch and run `gh workflow run ci.yml --ref <branch>`,
because CI push runs target only `main`.
5. Keep the changelog, any explicitly requested ACP catalog update, lockfile preparation, and the
version commit local until the go-ahead. The release command pushes the release branch and tag
as one batch, and the tag push starts the release workflows. Then run
`gh workflow run ci.yml --ref <branch>` so CI covers the complete release commit.
6. [Reconcile `main`](#reconcile-main).
A stable hotfix can take the version a patch beta line would promote to, such as `0.13.3`
shipping while `0.13.3-beta.2` soaks. Never republish or reuse a shipped version. Continue the line
as the next unused patch beta, `0.13.4-beta.1`, from the tested beta tag. No `version:all:*` mode
computes that from a prerelease, so run `npm run release:check`, bump with
`npm version 0.13.4-beta.1 --include-workspace-root --no-git-tag-version && git commit -m "chore(release): cut 0.13.4-beta.1"`,
push the release branch for `CI` and `Desktop Packages`, then ship with `npm run release:ship:beta`.
Record the tested beta tag as its source so its soak still counts for the unchanged content.
computes that from a prerelease, so follow the [manual steps](#manual-step-by-step) with
`npm version 0.13.4-beta.1 --include-workspace-root --message "chore(release): cut %s"` and
`npm run release:publish:beta`. Record the tested beta tag as its source so its soak still counts
for the unchanged content.
## Release inventory
@@ -155,31 +137,19 @@ For a promotion, every item defaults to defer.
## Reconcile main
Right after the tag push (in parallel with desktop 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`:
After the release push, open a PR into `main` that brings in what shipped and keeps newer
development on `main`:
```bash
git fetch origin --tags
git checkout -b reconcile/vX.Y.Z origin/main
npm run release:reconcile -- --tag vX.Y.Z
```
- The shipped `CHANGELOG.md` and `CHANGELOG.zh-CN.md` entries, exactly as tagged. A beta or
promotion entry replaces the series entry on `main`. A stable hotfix on an older line goes
below any newer entries.
- The shipped version in every `package.json` and `package-lock.json`, unless `main` already
carries a newer version, plus the F-Droid changelog files a stable release generates.
- No claims about unshipped work: a shipped entry describes only the tagged content, and notes
`main` holds for changes that have not shipped stay out of it.
`scripts/reconcile-release.mjs` updates the working tree without cherry-picking stale lockfile
hunks from the release base:
- 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 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, open the PR into `main`, and merge once its checks pass. After the reconcile PR merges and
the release completes, delete the remote release branch (`git push origin --delete release/vX.Y.Z`
or `release/vX.Y.Z-beta.N`). The tag is the record of shipped source; Paseo maintains no release
track besides `main`.
Delete the release branch once the PR merges. The tag is the record of shipped source; Paseo
maintains no release track besides `main`.
## ACP catalog updates
@@ -219,42 +189,35 @@ as described in **Fixing a failed release build**.
## Standard release (stable)
Before preparing a stable release on `release/vX.Y.Z`:
Before running any stable release command:
- Commit the approved `CHANGELOG.md`, `CHANGELOG.zh-CN.md`, and any requested ACP update.
- Run `npm run format`, `npm run lint`, and `npm run typecheck`, commit any resulting changes, and
confirm the working tree is clean.
- Do not use a release command as a substitute for checking whether the current commit is ready.
- Make sure the release source passed CI, the approved release inputs are committed locally on the release branch, and the working tree is clean.
- **Run `npm run format`, `npm run lint`, and `npm run typecheck` and commit any resulting changes BEFORE you start any `release:*` command.** `release:check` runs `npm install --workspaces --include-workspace-root` as part of `release:prepare`, which can mutate `package-lock.json` (e.g. churning `"dev": true` markers on optional deps). The next step, `version:all:*`, runs `npm version` which aborts when the working tree is dirty. If this happens mid-flight you have to commit the lockfile churn before retrying — and the pre-commit format hook will reject a lockfile-only commit because oxfmt internally skips `package-lock.json` while lefthook's glob still matches it. Avoid the whole mess by running format/lint/typecheck first, then `release:prepare` once on its own to absorb any lockfile churn into a normal commit, then start the release.
- Do not use a release command as a substitute for checking whether the current commit is actually ready.
```bash
# 1. Preparation (reversible): run checks and commit the version bump without tagging.
npm run release:prep:patch
# or:
npm run release:prep:minor
# 2. Push the release branch and wait for CI + Desktop Packages on this commit.
git push -u origin HEAD
# 3. After go-ahead and green release-branch checks: publish npm and push the tag.
npm run release:ship
# Run exactly one, matching the approved decision:
npm run release:patch
npm run release:minor
```
`release:ship` runs `scripts/publish-release-packages.mjs` and `scripts/push-current-release-tag.mjs`:
This bumps the version across all workspaces, runs checks, publishes to npm, and pushes the branch + tag. The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, and `Release Notes Sync` on GitHub Actions. The workflows create the GitHub Release as a draft while builds and release-note sync run. EAS picks up the same tag via the EAS GitHub app and starts the iOS + Android store builds in parallel (see "Mobile builds (EAS)" below) — there is no mobile-release workflow under `.github/workflows`.
- Publishes all seven `@getpaseo/*` packages in dependency order, skips versions already on npm,
retries transient 429/5xx/network errors, and waits until each version is visible on npm before
continuing.
- Checks `npm view @getpaseo/cli dist-tags` and moves npm's `beta` dist-tag to the new stable
version across all seven packages whenever the stable version is newer than `beta` (leaving
`beta` untouched during a stable hotfix on an older line).
- Refuses non-`release/*` branches, tags `HEAD` with `vX.Y.Z`, and pushes the tag. Because `HEAD`
is already on the release branch, no second CI run starts.
After the stable release succeeds, check `npm view @getpaseo/cli dist-tags`. When the new stable
is newer than `beta`, move `beta` to it for every published package. This changes dist-tags only;
do not republish the packages:
The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, and `Release Notes Sync` on GitHub Actions. The workflows create the GitHub Release as a draft while builds and release-note sync run. EAS picks up the same tag via the EAS GitHub app and starts the iOS + Android store builds in parallel (see "Mobile builds (EAS)" below) — there is no mobile-release workflow under `.github/workflows`.
```bash
PASEO_VERSION=$(node -p "require('./package.json').version")
for package in highlight relay protocol client plugin server cli; do
npm dist-tag add "@getpaseo/$package@$PASEO_VERSION" beta
done
```
Verify `npm view @getpaseo/cli dist-tags` shows `latest` at the shipped version, and `beta` at the shipped version or an active newer beta, before considering the stable release complete.
Verify `latest` resolves to `PASEO_VERSION`, and `beta` resolves to `PASEO_VERSION` or the
active newer beta, before considering the stable release complete.
The Docker workflow builds images from the checked-out source tree on `main` as non-publishing checks (cancelling superseded `main` runs). Stable `vX.Y.Z` tag pushes publish `ghcr.io/getpaseo/paseo:X.Y.Z` and `ghcr.io/getpaseo/paseo:latest`; beta `vX.Y.Z-beta.N` tag pushes publish only `ghcr.io/getpaseo/paseo:X.Y.Z-beta.N` and never move `latest`.
The Docker workflow builds images from the checked-out source tree on pull requests and on `main` as non-publishing checks. Stable `vX.Y.Z` tag pushes publish `ghcr.io/getpaseo/paseo:X.Y.Z` and `ghcr.io/getpaseo/paseo:latest`; beta `vX.Y.Z-beta.N` tag pushes publish only `ghcr.io/getpaseo/paseo:X.Y.Z-beta.N` and never move `latest`.
The production relay is the Elixir service in [getpaseo/paseo-relay](https://github.com/getpaseo/paseo-relay), with its own deployment process. Paseo releases and pushes to this repository do not deploy it. The Cloudflare relay code and workflow in this repository are legacy and are not used in production.
@@ -265,43 +228,29 @@ The production relay is the Elixir service in [getpaseo/paseo-relay](https://git
```bash
npm run typecheck # Verify the exact commit you intend to release
npm run release:check # Typecheck, build, dry-run pack
# Run exactly one approved version command (commits without tagging):
# Run exactly one approved version command:
npm run version:all:patch
npm run version:all:minor
git push -u origin HEAD # Trigger CI + Desktop Packages on release/vX.Y.Z
# Wait for CI and Desktop Packages on this branch to pass, then after go-ahead:
npm run release:publish # Publish to npm (idempotent, with propagation + beta dist-tag sync)
npm run release:push # Create tag vX.Y.Z on HEAD and push (triggers release workflows)
npm run release:publish # Publish to npm
npm run release:push # Push HEAD + tag (triggers CI workflows)
# Then move npm's beta dist-tag to this stable version when it is newer than beta (see above).
```
## Beta flow
```bash
# 1. Preparation (reversible) on release/vX.Y.Z-beta.N:
npm run release:prep:beta:patch # Start the next patch beta line
# or:
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 wait for CI + Desktop Packages to pass:
git push -u origin HEAD
# 3. After go-ahead:
npm run release:ship:beta
# Later, after soak, promote on release/vX.Y.Z:
npm run release:prep:promote
git push -u origin HEAD
# Wait for CI + Desktop Packages to pass, then after go-ahead:
npm run release:ship
npm run release:beta:patch # Start the next patch beta line
npm run release:beta:minor # Start the next minor beta line
# ... test desktop and APK prerelease assets from GitHub Releases ...
npm run release:beta:next # Optional: cut X.Y.Z-beta.2, beta.3, ...
npm run release:promote # Promote X.Y.Z-beta.N to stable X.Y.Z
```
- Beta tags are published GitHub prereleases like `v0.1.41-beta.1`
- Betas publish npm packages with `--tag beta`, so `npm install @getpaseo/cli@beta` opts in while plain `npm install @getpaseo/cli` stays on `latest`
- The user-facing beta instructions, including the public TestFlight join link for the `Paseo Beta` group, live in `public-docs/updates.md` and its `zh-CN` pair. Update them when a beta path is added or removed.
- Betas publish desktop assets and APKs for testing. They also build iOS, upload it to TestFlight, add it to the `Paseo Beta` external group, and submit it for Beta App Review. They do not submit mobile builds to the production stores.
- `release:prep:promote` + `release:ship` creates a fresh stable tag like `v0.1.41`; the final release never reuses the beta tag
- `release:promote` creates a fresh stable tag like `v0.1.41`; the final release never reuses the beta tag
- Desktop assets now come from the Electron package at `packages/desktop`
- Require the Linux artifact CI checks with both restricted and usable user namespaces to pass before publication; see [packaged desktop smoke](testing.md#packaged-desktop-smoke). Keep the installed-package and AppImage checks together.
- Beta releases use Electron's `beta` update channel. Users on the stable channel only receive stable releases; users on the beta channel receive beta releases and the final stable release when it is published.
@@ -329,17 +278,17 @@ Drafts do not appear in GitHub's releases feed. Updater clients continue to see
### Default behavior
`npm run release:prep:patch` or `npm run release:prep:minor` → push release branch → green checks → `npm run release:ship` → tag push → 36h ramp. No extra action needed.
`npm run release:patch` or `npm run release:minor` → tag push → 36h ramp. No extra action needed.
The `rollout_hours` input on `desktop-release.yml` is **only read on `workflow_dispatch`** — tag-push runs always default to 36. To get any other rollout duration on a fresh release, use the post-publish flip below.
### Instant-admit release (rollout_hours=0)
Tag-push runs from `npm run release:ship` always stamp 36 hours. To admit everyone immediately (hotfix, doc-only change, a release you want out fast), ship the release normally, wait for it to publish, then flip the manifests:
`npm run release:patch` and `npm run release:minor` tag-push, and tag-push runs always stamp 36 hours. To admit everyone immediately (hotfix, doc-only change, a release you want out fast), cut the release normally, wait for it to publish, then flip the manifests:
```bash
# 1. Ship the verified release branch (36h ramp from tag push).
npm run release:ship
# 1. Cut and publish (36h ramp from tag push).
npm run release:patch
# 2. Wait for Desktop Release to publish the GitHub Release.
gh run watch <desktop-release-run-id> --exit-status
@@ -390,7 +339,7 @@ gh workflow run desktop-release.yml \
-f rollout_hours=6
```
This does **not** apply to fresh releases shipped via `npm run release:ship` — tag-push runs always stamp 36. For a fresh release with a custom ramp, ship normally and then dispatch `desktop-rollout.yml` (same pattern as the instant-admit flow above, with your chosen `rollout_hours`).
This does **not** apply to fresh releases cut via `npm run release:patch` or `npm run release:minor` — those paths always tag-push and stamp 36. For a fresh release with a custom ramp, cut normally and then dispatch `desktop-rollout.yml` (same pattern as the instant-admit flow above, with your chosen `rollout_hours`).
### Releasing during an active rollout
@@ -500,11 +449,10 @@ that resumes the release in the current conversation. Create it automatically
with `create_heartbeat`. The heartbeat owns the release until it either reaches
the completion checklist or finds a failure that needs new user authority.
Each heartbeat checks the release tag commit, `CI` and `Desktop Packages` for the release branch,
every tag-triggered GitHub Actions run (`Desktop Release`, `Android APK Release`, `Docker`,
`Release Notes Sync`), npm dist-tags, the GitHub Release body and assets, desktop updater
manifests, the published Docker image, the applicable EAS workflow, the reconcile PR, and remote
release branch cleanup. Inspect the GitHub Release itself and confirm that the macOS, Linux,
Each heartbeat checks the release tag commit, all GitHub Actions runs for the
release branch and tag, npm dist-tags, the GitHub Release body and assets,
desktop updater manifests, the published Docker image, and the applicable EAS
workflow. Inspect the GitHub Release itself and confirm that the macOS, Linux,
Windows, and Android APK assets are present along with the channel manifests
(`latest-mac.yml`, `latest-linux.yml`, and `latest.yml` for stable;
`beta-mac.yml`, `beta-linux.yml`, and `beta.yml` for beta).
@@ -513,9 +461,8 @@ For stable releases, also confirm every required mobile build, external
TestFlight distribution, Beta App Review submission, and store submission job
for the release commit. For betas, confirm
the beta EAS workflow completed its TestFlight distribution and Beta App Review
path. Once the reconcile PR merges and every applicable checklist item passes,
delete the remote release branch (`git push origin --delete release/vX.Y.Z` or
`release/vX.Y.Z-beta.N`), delete the heartbeat, and report the release as shipped.
path. Delete the heartbeat only after every applicable checklist item passes,
then report the release as shipped.
Pattern:
@@ -527,7 +474,7 @@ Pattern:
"timezone": "UTC",
"maxRuns": 120,
"expiresIn": "24h",
"prompt": "Resume the vX.Y.Z release babysit for commit <sha>. Check npm tags; CI and Desktop Packages on release/vX.Y.Z; every tag-triggered GitHub Actions run; the published GitHub Release body, expected desktop/APK assets, and channel manifests; the Docker image; the matching EAS workflow; and the reconcile PR into main. Completion requires every applicable checklist item. For stable, require build_ios, distribute_ios (Paseo Beta external distribution and Beta App Review submission), submit_ios_for_review, build_android, and submit_android to succeed. For beta, require the beta TestFlight distribution and Beta App Review path. If work is pending, wait for the next heartbeat. If a failure can be retried safely for the same version, follow the failed-release procedure; otherwise report the blocker. When every applicable completion-checklist item passes and the reconcile PR is merged, delete origin/release/vX.Y.Z, delete THIS heartbeat, report shipped, and stop.",
"prompt": "Resume the vX.Y.Z release babysit for commit <sha>. Check npm tags; every GitHub Actions run for the release branch and tag; the published GitHub Release body, expected desktop/APK assets, and channel manifests; the Docker image; and the matching EAS workflow. Completion requires every applicable checklist item. For stable, require build_ios, distribute_ios (Paseo Beta external distribution and Beta App Review submission), submit_ios_for_review, build_android, and submit_android to succeed. For beta, require the beta TestFlight distribution and Beta App Review path. If work is pending, wait for the next heartbeat. If a failure can be retried safely for the same version, follow the failed-release procedure; otherwise report the blocker. When every applicable completion-checklist item passes, delete THIS heartbeat, report shipped, and stop.",
}
```
@@ -629,16 +576,12 @@ intentionally unavailable to desktop updater clients.
## Notes
- `version:all:*` bumps root, syncs workspace versions and `@getpaseo/*` dependency versions, and
commits `chore(release): cut <version>` without creating a tag. `release:push` creates and pushes
the tag atomically after release-branch CI passes.
- `release:push` refuses `main` and any branch outside `release/*`.
- The npm `version` lifecycle regenerates F-Droid changelog files from `CHANGELOG.md` for stable releases only (`npm run fdroid:changelogs`) and stages them, so the release commit and tag carry them. Betas are a no-op. A stable run **aborts the release** if `CHANGELOG.md` has no entry for the version being cut — commit the changelog entry first. See [docs/android.md](android.md) for why these files are generated per ABI.
- `release:prepare` refreshes workspace `node_modules` links to prevent stale types.
- `npm run dev:desktop` and `npm run build:desktop` target the Electron desktop package in `packages/desktop`.
- `release:publish` and `release:publish:beta` run `scripts/publish-release-packages.mjs`: if a run
fails partway through, re-running skips versions already published on npm, retries transient
registry errors, and waits for each version to become visible on npm before continuing.
- `version:all:*` bumps root + syncs workspace versions and `@getpaseo/*` dependency versions
- The npm `version` lifecycle regenerates F-Droid changelog files from `CHANGELOG.md` for stable releases only (`npm run fdroid:changelogs`) and stages them, so the release tag carries them. Betas are a no-op. A stable run **aborts the release** if `CHANGELOG.md` has no entry for the version being cut — commit the changelog entry first. See [docs/android.md](android.md) for why these files are generated per ABI.
- `release:prepare` refreshes workspace `node_modules` links to prevent stale types
- `npm run dev:desktop` and `npm run build:desktop` target the Electron desktop package in `packages/desktop`
- If `release:publish` partially fails, re-run it — npm skips already-published versions
- If `release:publish:beta` partially fails, re-run it — npm skips already-published versions and keeps prereleases off `latest` because every publish uses `--tag beta`
- The website uses GitHub's latest published release API for download links, so published beta prereleases do not replace the stable download target.
## Changelog format
@@ -659,7 +602,6 @@ No prefix (`v`), no extra text. `Release Notes Sync` matches the `## X.Y.Z` (or
- `CHANGELOG.md` holds stable releases and at most one entry for the current beta series.
- The first beta of a version inserts a top entry like `## 0.1.60-beta.1 - YYYY-MM-DD`.
- Each subsequent beta rewrites that entry in place: the heading becomes the new beta number and date, and the body describes the full change from the previous stable release to this beta. Never add a second beta entry.
- The entry announces changes and leaves setup steps, click paths, migration notes, configuration keys, hedges and edge cases to product docs. The headline change is the first highlight. [Changelog conciseness](#changelog-conciseness) and [Changelog ordering](#changelog-ordering) hold the rules.
- The entry is a list of changes, not of PRs. When a later beta reverts, reworks, or follows up on something an earlier beta added, rewrite the bullet to the current behavior or delete it. A stable user never saw the earlier beta behavior, so fixes to it are not "Fixed" bullets.
- Anything that already shipped to stable through a patch release on an older line stays out of the beta entry.
- Stable promotion renames the entry to `## 0.1.60 - YYYY-MM-DD` after a final review.
@@ -715,30 +657,14 @@ claims a general improvement, rewrite it with the concrete change.
## Changelog conciseness
An entry announces what changed. Product docs own setup, navigation, migration and edge cases, and the PR link leads to the rest. These rules apply to highlights and section bullets.
Every section bullet must be scannable at a glance. The changelog is not release documentation — it's a list. [Highlights](#changelog-highlights) get more room; every other bullet follows these limits.
- **No instructions.** Cut setup steps, click paths, configuration keys, flags and migration notes. "Open a provider's settings from Settings, setup, or the model picker" is a click path. "Existing goose settings and sessions carry over to the bundled plugin" is a migration note.
- **One warning for a breaking requirement.** When the update stops something working until the user acts, state the requirement in one short sentence after the announcement, and link the product doc that has the steps: "Requires [Antigravity CLI 1.5.0 or later](https://paseo.sh/docs/supported-providers/antigravity)." Nothing else earns a second sentence.
- **No hedges or exception clauses.** Cut "when needed", "for eligible models", "on hosts where…", "except…", "with a hint shown when…" and "across common install shapes". Keep the condition that triggers a fixed failure, as in `Fixed <failure> when <condition>`.
- **The shorter bullet is still true.** When a change reaches only some providers, platforms or file types, name what it covers in the sentence's own words: "update supported CLIs" where one provider has no update command, "Markdown previews and source views" where HTML previews on iOS are left out, "by default" where an explicit interrupt still replaces the turn. Do not widen the claim to remove a clause.
- **State the outcome and stop.** Say what the user gets. Leave out queues, snapshots, caches, timeouts, LAN/WAN topology, TLS handshakes and IPC.
Each row is from the first draft of 0.17.1:
| Avoid | Write |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| Open a provider's settings from Settings, setup, or the model picker to update supported CLIs and watch their output | Update supported CLIs from the app |
| Use Antigravity CLI 1.5.0 or later on the daemon host, and include `acp` if you override its command | Requires Antigravity CLI 1.5.0 or later |
| Reports and notifications from other agents arrive in order when the current turn ends instead of interrupting it. An interrupt or your own prompt carries earlier queued messages in the same turn, and Stop holds queued messages until the next prompt | By default, messages from other agents wait for the current turn to end |
| Changed worktree teardown to keep the worktree when the command exceeds one minute or the `worktree.teardownTimeoutMs` limit in `paseo.json` | Changed worktree teardown to keep the worktree when the command times out |
| Fixed file views losing their scroll position when switching Preview and Source, except HTML previews on iOS | Fixed Markdown previews and source views losing their scroll position when switching between them |
Section bullets also follow these limits:
- **One sentence per bullet, max.** A second sentence is documentation. Cut it.
- **One sentence per bullet, max.** If a bullet contains two sentences, the second one is doing work that belongs in product docs, not the changelog. Cut it.
- **No trailing periods.** Bullets are list items, not prose. Drop the period at the end of every bullet, including the period inside any bolded lead-in. `**Configurable terminal scrollback**` not `**Configurable terminal scrollback.**`.
- **One line per bullet.** If a bullet wraps to three lines in a narrow column, it's too long.
- **Split bullets that pack multiple distinct changes.** If a bullet uses "and", "plus", a comma list, or an em-dash to chain several independent improvements, break them into separate bullets — even when they share a theme or author. One bullet = one user-facing change.
- **Trim qualifying clauses.** Drop "with a hint shown when…", "matching the CLI's behaviour", "across common install shapes". If the detail doesn't change whether a user cares, cut it.
- **Stop after identifying the change.** Do not explain LAN/WAN topology, TLS handshakes, IPC, or other architecture in a changelog bullet. Put necessary background in product docs.
- **Attribution follows the split.** When you split a dense bullet, move each PR/author to the bullet it belongs to. Never duplicate the same PR across multiple bullets.
## Changelog highlights
@@ -751,7 +677,7 @@ reader who stops after the highlights should have missed nothing they would ask
```markdown
## 0.16.0 - 2026-11-20
- **Undo workspace archive:** Restore an archived workspace with Undo or Cmd/Ctrl+Z. ([#8904](https://github.com/getpaseo/paseo/pull/8904))
- **Undo workspace archive:** Archiving a workspace in the app now shows a "Workspace archived" toast for six seconds. Undo, or Cmd/Ctrl+Z, restores the workspace with its tabs and agents. ([#8904](https://github.com/getpaseo/paseo/pull/8904))
### Added
```
@@ -762,19 +688,17 @@ reader who stops after the highlights should have missed nothing they would ask
- **The lead-in is not a place or something Paseo already had.** A device, screen or area names
where the change landed. A feature name that was true of the last release hides the news: Paseo
already had keyboard shortcuts, so the lead-in says they now work on mobile.
- **One short sentence says the plain thing.** Write what a user would tell a friend: Paseo now
- **The first sentence says the plain thing.** Write what a user would tell a friend: Paseo now
shows the background tasks an agent is running. Leave out the conditions and mechanics that make
it true. A second sentence is only for a
[breaking requirement](#changelog-conciseness).
it true.
- **Describe the new behavior, not the old one.** Say what is faster or better now, and do not
dwell on how slow or broken it was before. A number is welcome as a short aside after the new
behavior is stated: seconds, a percentage, a multiple.
- **Do not list what a sentence already covers.** After "the same shortcuts as desktop", naming
five of them adds nothing. Keep a list only when it sets the scope, such as the providers a
feature works with.
- **Sentences end with periods, and the attribution follows the last one.**
[Changelog wording](#changelog-wording) and [Changelog conciseness](#changelog-conciseness)
apply.
- **The description runs one to three sentences.** Sentences end with periods, and the attribution
follows the last one. [Changelog wording](#changelog-wording) applies in full.
- **A highlight replaces the section bullets it covers.** A PR appears once in an entry, so its
attribution moves to the highlight.
- **A highlight is something a user would name.** Everything else stays a section bullet. A patch
@@ -783,13 +707,13 @@ reader who stops after the highlights should have missed nothing they would ask
of related fixes, becomes a highlight only when it passes the same test as a feature, and then
it is written as what works now: `**Fewer reconnects on return:**`.
| Avoid | Write |
| ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| `**iPad and touch screens:**` | `**Touch-sized tablet controls:**` |
| `**Hardware keyboard shortcuts:**` | `**Keyboard shortcuts on mobile:**` |
| When an agent ends its turn while shells it started are still running, a pill lists them | Paseo now shows the background tasks an agent is running |
| A diff no longer waits 4 to 40 seconds behind worktree scans | Opening Changes shows the file tree right away, and diffs load about 6 times sooner |
| The same shortcuts as desktop: command center, file picker, new workspace, workspace jumps | The same shortcuts as desktop, including your custom bindings |
| Avoid | Write |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `**iPad and touch screens:**` | `**Touch-sized tablet controls:**` |
| `**Hardware keyboard shortcuts:**` | `**Keyboard shortcuts on mobile:**` |
| When an agent ends its turn while shells it started are still running, a pill lists them | Paseo now shows the background tasks an agent is running |
| A diff no longer waits 4 to 40 seconds behind worktree scans | Opening Changes shows the file tree right away, and diffs load about 6 times sooner on hosts with many worktrees |
| The same shortcuts as desktop: command center, file picker, new workspace, workspace jumps | The same shortcuts as desktop, including your custom bindings |
Before showing a draft, read only the bold lead-ins top to bottom. Each one must answer "what is
new?" without its description, and each must outrank the one below it.
@@ -839,9 +763,6 @@ question.
for them: `Undo workspace archive`, `Fewer reconnects on return`. Fixes are routine, so one
that earned a highlight still follows everything new or improved.
- **The headline change goes first, whatever its group.** It is the change the release is announced
with. 0.17.1 leads with `Antigravity approvals and history`, which needs one provider. The groups
rank everything after it.
- **Reach decides before kind.** A new capability that needs a hardware keyboard is in group 3.
- **Rank the whole list in one pass.** The order you collected the pull requests in, the alphabet
and the order of the sections below are not rankings.
@@ -881,12 +802,13 @@ Every entry covers `previous stable release → release source`: first beta, lat
### Beta release
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory)
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory), and CI for the release source is green
- [ ] 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:*`
- [ ] 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 cutting the release
- [ ] 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)
- [ ] After go-ahead, `npm run release:ship:beta` published npm and pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run
- [ ] The changelog, ACP, lockfile, and version commits stayed local until the approved release command pushed the release branch and tag
- [ ] `npm run release:beta:patch`, `npm run release:beta:minor`, or `npm run release:beta:next` completes successfully
- [ ] Every GitHub Actions run for the complete release commit and tag is green
- [ ] npm shows 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
@@ -895,21 +817,23 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] GitHub `Docker` workflow is green and the versioned beta image is published without moving `latest`
- [ ] GitHub `Release Notes Sync` mirrored the beta entry into the prerelease body
- [ ] EAS `Release iOS Beta` completed its build, TestFlight distribution, external beta group, and Beta App Review path
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`, and `origin/release/vX.Y.Z-beta.N` was deleted
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
### Stable release (or promotion)
- [ ] Run the pre-release sanity check (see above) and address any findings
- [ ] The diff from the previous stable to the resolved release source is classified as patch or minor, with the target version and rationale approved
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory)
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory), and CI for the release source is green
- [ ] A promotion ships the tested beta's product content after its soak, unless the user explicitly overrode either default
- [ ] Every PR in the release range has been opened, and its full description and every linked issue have been read before drafting the changelog
- [ ] Ensure the approved release inputs are committed locally and the git worktree is clean before running any release command
- [ ] Ensure local `npm run typecheck` passes on that exact commit before running any release command
- [ ] 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)
- [ ] After go-ahead, `npm run release:ship` published npm, updated dist-tags, and pushed the `vX.Y.Z` tag without triggering a second CI run
- [ ] The changelog, ACP, lockfile, and version commits stayed local until the approved release command pushed the release branch and tag
- [ ] `npm run release:patch`, `npm run release:minor`, or `npm run release:promote` completes successfully
- [ ] Every GitHub Actions run for the complete release commit and tag is green
- [ ] `latest` resolves to the new stable, and `beta` resolves to it 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
@@ -924,5 +848,5 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] EAS iOS `submit_ios_for_review` succeeds, putting the build into App Store review
- [ ] EAS Android `build_android` completes for the same tag
- [ ] EAS Android `submit_android` succeeds, putting the build on its Play Store track
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries, F-Droid changelogs, and version into `main`, and `origin/release/vX.Y.Z` was deleted
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
@@ -0,0 +1,3 @@
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,3 @@
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,3 @@
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,3 @@
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
Full notes: https://paseo.sh/changelog
-1
View File
@@ -72,7 +72,6 @@
"project": ["src/**/*.ts"]
}
},
"ignoreWorkspaces": ["packages/react-native-enriched-markdown"],
"ignoreDependencies": [
"sherpa-onnx-node",
"@playwright/test",
-2
View File
@@ -30,8 +30,6 @@ buildNpmPackage {
# Exclude mobile-only platform code (we only need the web/electron build)
!(lib.hasPrefix "/packages/app/android" relPath)
&& !(lib.hasPrefix "/packages/app/ios" relPath)
&& !(lib.hasPrefix "/packages/react-native-enriched-markdown/android" relPath)
&& !(lib.hasPrefix "/packages/react-native-enriched-markdown/ios" relPath)
# Website is unrelated to the desktop app
&& !(lib.hasPrefix "/packages/website" relPath)
# Documentation, CI definitions and agent/editor configuration. None of
+1 -1
View File
@@ -1 +1 @@
sha256-qZCOSeT264mXP2RcV+eD7lEkc3WAH1re6NjTtbQOHqY=
sha256-gUBXG6rGxAAMUDgSXQw6GzkJ8U0xEoL9X/kZkLM4uxg=
+46 -59
View File
@@ -1,18 +1,17 @@
{
"name": "paseo",
"version": "0.17.1",
"version": "0.17.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.17.1",
"version": "0.17.0",
"hasInstallScript": true,
"license": "Apache-2.0",
"workspaces": [
"plugins",
"packages/expo-two-way-audio",
"packages/react-native-enriched-markdown",
"packages/highlight",
"packages/plugin",
"packages/protocol",
@@ -6652,15 +6651,6 @@
"url": "https://github.com/sponsors/ayuhito"
}
},
"node_modules/@fontsource-variable/plus-jakarta-sans": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@fontsource-variable/plus-jakarta-sans/-/plus-jakarta-sans-5.3.0.tgz",
"integrity": "sha512-/l/4r0yyWK9JzAlmA0LiYgGgmJe/Gswt4jTJEzr5QhJfwMbvJZDmYWyW0M4X7yCK69BajMVlV/Lx8g7WDc1+sw==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
"node_modules/@getpaseo/app": {
"resolved": "packages/app",
"link": true
@@ -31903,10 +31893,6 @@
"react-native": "*"
}
},
"node_modules/react-native-enriched-markdown": {
"resolved": "packages/react-native-enriched-markdown",
"link": true
},
"node_modules/react-native-gesture-handler": {
"version": "2.32.0",
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.32.0.tgz",
@@ -37482,7 +37468,7 @@
},
"packages/app": {
"name": "@getpaseo/app",
"version": "0.17.1",
"version": "0.17.0",
"dependencies": {
"@codemirror/commands": "6.10.4",
"@codemirror/language": "6.12.4",
@@ -37566,7 +37552,7 @@
"react-native": "0.86.3",
"react-native-draggable-flatlist": "^4.0.3",
"react-native-edge-to-edge": "^1.7.0",
"react-native-enriched-markdown": "*",
"react-native-enriched-markdown": "1.2.0-nightly-20261014-766fc0e67",
"react-native-gesture-handler": "~2.32.0",
"react-native-keyboard-controller": "1.21.12",
"react-native-nitro-modules": "0.35.5",
@@ -39479,6 +39465,23 @@
"dev": true,
"license": "MIT"
},
"packages/app/node_modules/react-native-enriched-markdown": {
"version": "1.2.0-nightly-20261014-766fc0e67",
"resolved": "https://registry.npmjs.org/react-native-enriched-markdown/-/react-native-enriched-markdown-1.2.0-nightly-20261014-766fc0e67.tgz",
"integrity": "sha512-PyYAAVJAyjlcqHXgSnzxok13MDmyxs/nt46hHIOBdCc0prfaL2Ef6nYkZu7fFCeaETOJXd/xQr4n2/79I+gvdA==",
"hasInstallScript": true,
"license": "MIT",
"peerDependencies": {
"katex": ">=0.16.0",
"react": "*",
"react-native": "*"
},
"peerDependenciesMeta": {
"katex": {
"optional": true
}
}
},
"packages/app/node_modules/react-native-keyboard-controller": {
"version": "1.21.12",
"resolved": "https://registry.npmjs.org/react-native-keyboard-controller/-/react-native-keyboard-controller-1.21.12.tgz",
@@ -39635,13 +39638,13 @@
},
"packages/cli": {
"name": "@getpaseo/cli",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/server": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"@getpaseo/server": "0.17.0",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
@@ -39888,11 +39891,11 @@
},
"packages/client": {
"name": "@getpaseo/client",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/protocol": "0.17.1",
"@getpaseo/relay": "0.17.1",
"@getpaseo/protocol": "0.17.0",
"@getpaseo/relay": "0.17.0",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
@@ -39904,7 +39907,7 @@
},
"packages/desktop": {
"name": "@getpaseo/desktop",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/cli": "*",
@@ -40147,7 +40150,7 @@
},
"packages/expo-two-way-audio": {
"name": "@getpaseo/expo-two-way-audio",
"version": "0.17.1",
"version": "0.17.0",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.14",
@@ -40193,7 +40196,7 @@
},
"packages/highlight": {
"name": "@getpaseo/highlight",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"@codemirror/language": "6.12.4",
@@ -40223,7 +40226,7 @@
},
"packages/plugin": {
"name": "@getpaseo/plugin",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^1.4.0",
@@ -40231,8 +40234,8 @@
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"@types/node": "^20.9.0",
"@types/react": "~19.2.0",
"react": "19.2.3",
@@ -40242,8 +40245,8 @@
"zod": "^4.4.3"
},
"peerDependencies": {
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"react": ">=19.1.0 <20",
"react-native": ">=0.81.5",
"zod": "^4.4.3"
@@ -40265,7 +40268,7 @@
},
"packages/protocol": {
"name": "@getpaseo/protocol",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"semver": "^7.8.5",
@@ -40291,24 +40294,9 @@
"node": ">=10"
}
},
"packages/react-native-enriched-markdown": {
"version": "0.17.1",
"hasInstallScript": true,
"license": "MIT",
"peerDependencies": {
"katex": ">=0.16.0",
"react": "*",
"react-native": "*"
},
"peerDependenciesMeta": {
"katex": {
"optional": true
}
}
},
"packages/relay": {
"name": "@getpaseo/relay",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"dependencies": {
"@noble/ciphers": "^2.4.0",
@@ -40530,17 +40518,17 @@
},
"packages/server": {
"name": "@getpaseo/server",
"version": "0.17.1",
"version": "0.17.0",
"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.17.1",
"@getpaseo/highlight": "0.17.1",
"@getpaseo/plugin": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/relay": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/highlight": "0.17.0",
"@getpaseo/plugin": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"@getpaseo/relay": "0.17.0",
"@isaacs/ttlcache": "^2.1.4",
"@modelcontextprotocol/sdk": "1.29.0",
"@opencode-ai/sdk": "1.14.46",
@@ -41487,12 +41475,11 @@
},
"packages/website": {
"name": "@getpaseo/website",
"version": "0.17.1",
"version": "0.17.0",
"dependencies": {
"@cloudflare/vite-plugin": "^1.29.1",
"@cloudflare/workers-types": "^4.20260317.1",
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/plus-jakarta-sans": "^5.3.0",
"@getpaseo/protocol": "*",
"@tanstack/react-router": "^1.170.16",
"@tanstack/react-start": "^1.168.26",
@@ -43098,7 +43085,7 @@
},
"plugins": {
"name": "@getpaseo/builtin-plugins",
"version": "0.17.1",
"version": "0.17.0",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+13 -17
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.17.1",
"version": "0.17.0",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -23,7 +23,6 @@
"workspaces": [
"plugins",
"packages/expo-two-way-audio",
"packages/react-native-enriched-markdown",
"packages/highlight",
"packages/plugin",
"packages/protocol",
@@ -111,22 +110,19 @@
"version:all:beta:next": "node scripts/set-release-version.mjs --mode beta-next",
"version:all:promote": "node scripts/set-release-version.mjs --mode promote",
"release:check": "npm run release:prepare && npm run typecheck --workspace=@getpaseo/highlight && npm run typecheck --workspace=@getpaseo/relay && npm run typecheck --workspace=@getpaseo/protocol && npm run build:client:clean && npm run typecheck --workspace=@getpaseo/client && npm run typecheck --workspace=@getpaseo/plugin && npm run build:server:clean && npm run typecheck --workspace=@getpaseo/server && npm run typecheck --workspace=@getpaseo/cli && npm pack --dry-run --workspace=@getpaseo/highlight && npm pack --dry-run --workspace=@getpaseo/relay && npm pack --dry-run --workspace=@getpaseo/protocol && npm pack --dry-run --workspace=@getpaseo/client && npm pack --dry-run --workspace=@getpaseo/plugin && npm pack --dry-run --workspace=@getpaseo/server && npm pack --dry-run --workspace=@getpaseo/cli",
"release:prep:patch": "npm run release:check && npm run version:all:patch",
"release:prep:minor": "npm run release:check && npm run version:all:minor",
"release:prep:major": "npm run release:check && npm run version:all:major",
"release:prep:beta:patch": "npm run release:check && npm run version:all:beta:patch",
"release:prep:beta:minor": "npm run release:check && npm run version:all:beta:minor",
"release:prep:beta:major": "npm run release:check && npm run version:all:beta:major",
"release:prep:beta:next": "npm run release:check && npm run version:all:beta:next",
"release:prep:promote": "npm run release:check && npm run version:all:promote",
"release:publish:dry-run": "node scripts/publish-release-packages.mjs --dry-run",
"release:publish:beta:dry-run": "node scripts/publish-release-packages.mjs --beta --dry-run",
"release:publish": "node scripts/publish-release-packages.mjs",
"release:publish:beta": "node scripts/publish-release-packages.mjs --beta",
"release:publish:dry-run": "npm publish --dry-run --workspace=@getpaseo/highlight --access public && npm publish --dry-run --workspace=@getpaseo/relay --access public && npm publish --dry-run --workspace=@getpaseo/protocol --access public && npm publish --dry-run --workspace=@getpaseo/client --access public && npm publish --dry-run --workspace=@getpaseo/plugin --access public && npm publish --dry-run --workspace=@getpaseo/server --access public && npm publish --dry-run --workspace=@getpaseo/cli --access public",
"release:publish:beta:dry-run": "npm publish --dry-run --workspace=@getpaseo/highlight --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/relay --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/protocol --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/client --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/plugin --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/server --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/cli --access public --tag beta",
"release:publish": "npm publish --workspace=@getpaseo/highlight --access public && npm publish --workspace=@getpaseo/relay --access public && npm publish --workspace=@getpaseo/protocol --access public && npm publish --workspace=@getpaseo/client --access public && npm publish --workspace=@getpaseo/plugin --access public && npm publish --workspace=@getpaseo/server --access public && npm publish --workspace=@getpaseo/cli --access public",
"release:publish:beta": "npm publish --workspace=@getpaseo/highlight --access public --tag beta && npm publish --workspace=@getpaseo/relay --access public --tag beta && npm publish --workspace=@getpaseo/protocol --access public --tag beta && npm publish --workspace=@getpaseo/client --access public --tag beta && npm publish --workspace=@getpaseo/plugin --access public --tag beta && npm publish --workspace=@getpaseo/server --access public --tag beta && npm publish --workspace=@getpaseo/cli --access public --tag beta",
"release:push": "node scripts/push-current-release-tag.mjs",
"release:ship": "node scripts/push-current-release-tag.mjs --check && npm run release:publish && npm run release:push",
"release:ship:beta": "node scripts/push-current-release-tag.mjs --check && npm run release:publish:beta && npm run release:push",
"release:reconcile": "node scripts/reconcile-release.mjs"
"release:beta:patch": "npm run release:check && npm run version:all:beta:patch && npm run release:publish:beta && npm run release:push",
"release:beta:minor": "npm run release:check && npm run version:all:beta:minor && npm run release:publish:beta && npm run release:push",
"release:beta:major": "npm run release:check && npm run version:all:beta:major && npm run release:publish:beta && npm run release:push",
"release:beta:next": "npm run release:check && npm run version:all:beta:next && npm run release:publish:beta && npm run release:push",
"release:promote": "npm run release:check && npm run version:all:promote && npm run release:publish && npm run release:push",
"release:patch": "npm run release:check && npm run version:all:patch && npm run release:publish && npm run release:push",
"release:minor": "npm run release:check && npm run version:all:minor && npm run release:publish && npm run release:push",
"release:major": "npm run release:check && npm run version:all:major && npm run release:publish && npm run release:push"
},
"devDependencies": {
"@types/ws": "^8.5.14",
@@ -59,35 +59,6 @@ async function selectClientSlashCommand(page: Page, query: string, label: string
await input.press("Enter");
}
async function typeBeforeMenuFilters(
page: Page,
input: { text: string; key: "Tab" | "Enter" },
): Promise<void> {
await composerLocator(page).evaluate(async (element, { text, key }) => {
if (!(element instanceof HTMLTextAreaElement)) {
throw new Error("Composer input is not a textarea");
}
const setValue = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
if (!setValue) throw new Error("Textarea value setter is unavailable");
setValue.call(element, text);
element.setSelectionRange(text.length, text.length);
element.dispatchEvent(new Event("input", { bubbles: true }));
await Promise.resolve();
element.dispatchEvent(new KeyboardEvent("keydown", { key, bubbles: true, cancelable: true }));
await new Promise((resolve) => requestAnimationFrame(() => setTimeout(resolve, 0)));
}, input);
}
async function showExitSuggestion(page: Page, query: string): Promise<void> {
await composerLocator(page).fill(query);
await expect(page.getByText("/exit", { exact: true }).first()).toBeVisible();
}
async function expectOpenAgentWithInput(page: Page, agentId: string, text: string): Promise<void> {
await expect(composerLocator(page)).toHaveValue(text);
await expectWorkspaceTabVisible(page, agentId);
}
async function expectAgentArchivedInSessions(page: Page, title: string): Promise<void> {
await openSessions(page);
await expectSessionRowArchived(page, title);
@@ -160,16 +131,6 @@ test.describe("Client slash commands", () => {
);
});
for (const key of ["Tab", "Enter"] as const) {
test(`${key} ignores an exit suggestion for an earlier query`, async ({ page }) => {
await withOpenReadyMockAgent(page, { title: "Stale slash command" }, async ({ agentId }) => {
await showExitSuggestion(page, "/e");
await typeBeforeMenuFilters(page, { text: "/co", key });
await expectOpenAgentWithInput(page, agentId, "/co");
});
});
}
test("slash clear replaces the active agent with a matching draft", async ({ page }) => {
await withOpenReadyMockAgent(
page,
@@ -1,143 +0,0 @@
import type { Locator } from "@playwright/test";
import { expect, test, type Page } from "../support/fixtures";
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
const APP_SETTINGS_KEY = "@paseo:app-settings";
async function useLanguage(page: Page, language: string): Promise<void> {
await page.addInitScript(
({ key, language: value }) => {
localStorage.setItem(key, JSON.stringify({ language: value }));
},
{ key: APP_SETTINGS_KEY, language },
);
}
/**
* Lays the placeholder out the way the textarea does, in a mirror element with
* the same box and font, and reports whether any of its lines reach the hint.
*/
async function placeholderOverlaps(input: Locator, hint: Locator): Promise<boolean> {
const hintBox = await hint.boundingBox();
if (!hintBox) throw new Error("Focus hint has no layout box");
return input.evaluate((element, box) => {
const textarea = element as HTMLTextAreaElement;
const style = getComputedStyle(textarea);
const rect = textarea.getBoundingClientRect();
const mirror = document.createElement("div");
for (const property of [
"boxSizing",
"paddingTop",
"paddingRight",
"paddingBottom",
"paddingLeft",
"borderTopWidth",
"borderRightWidth",
"borderBottomWidth",
"borderLeftWidth",
"fontFamily",
"fontSize",
"fontWeight",
"letterSpacing",
"lineHeight",
"textIndent",
"wordSpacing",
] as const) {
mirror.style[property] = style[property];
}
Object.assign(mirror.style, {
position: "fixed",
left: `${rect.left}px`,
top: `${rect.top}px`,
width: `${rect.width}px`,
borderStyle: "solid",
borderColor: "transparent",
whiteSpace: "pre-wrap",
overflowWrap: "break-word",
visibility: "hidden",
});
const text = document.createTextNode(textarea.placeholder);
mirror.appendChild(text);
document.body.appendChild(mirror);
const range = document.createRange();
range.selectNodeContents(text);
const lines = Array.from(range.getClientRects());
mirror.remove();
return lines.some(
(line) =>
line.right > box.x &&
line.left < box.x + box.width &&
line.bottom > box.y &&
line.top < box.y + box.height,
);
}, hintBox);
}
async function recordFirstVisibleHint(page: Page): Promise<void> {
await page.addInitScript(() => {
function sample() {
const root = document.querySelector('[data-testid="message-input-root"]');
const input = root?.querySelector("textarea");
const hint = Array.from(root?.querySelectorAll("div") ?? []).find(
(element) => !element.childElementCount && element.textContent?.endsWith("pour saisir"),
);
if (!input || !hint || Number(getComputedStyle(hint).opacity) === 0) {
requestAnimationFrame(sample);
return;
}
const inputRight = input.getBoundingClientRect().right;
const textRight = inputRight - parseFloat(getComputedStyle(input).paddingRight);
const hintLeft = hint.getBoundingClientRect().left;
Reflect.set(window, "__firstVisibleHintHasSpace", textRight <= hintLeft + 1);
}
requestAnimationFrame(sample);
});
}
async function expectFirstVisibleHintHasSpace(page: Page): Promise<void> {
await expect
.poll(() => page.evaluate(() => Reflect.get(window, "__firstVisibleHintHasSpace")))
.toBe(true);
}
const FRENCH_LAYOUTS = [
{ name: "phone width", width: 390, placeholder: "Message, @fichiers, /commandes" },
{
name: "desktop width",
width: 1024,
placeholder:
"Écrivez à l’agent, mentionnez des @fichiers ou utilisez les /commandes et /skills",
},
];
for (const layout of FRENCH_LAYOUTS) {
test.describe(`French composer at ${layout.name}`, () => {
test.use({ viewport: { width: layout.width, height: 844 } });
test("the focus hint does not cover the placeholder", async ({ page }) => {
const agent = await seedMockAgentWorkspace({
repoPrefix: "composer-focus-hint-",
title: "Composer focus hint",
});
try {
await useLanguage(page, "fr");
await recordFirstVisibleHint(page);
await openAgentRoute(page, agent);
const input = page.getByRole("textbox", { name: "Écrire à l’agent…" }).first();
await expect(input).toBeVisible();
await expect(input).toHaveAttribute("placeholder", layout.placeholder);
await input.blur();
const hint = page.getByText(/pour saisir$/).first();
await expect(hint).toBeVisible();
// The input takes the hint's width on the render after the hint lays out.
await expect.poll(() => placeholderOverlaps(input, hint)).toBe(false);
await expectFirstVisibleHintHasSpace(page);
} finally {
await agent.cleanup();
}
});
});
}
@@ -18,7 +18,6 @@ import {
expectComposerFullscreenControls,
sendComposerWithButton,
queueComposerWithButton,
fillComposerDraft,
configureComposerQueueSend,
activateRetainedComposerTab,
switchComposerTabWithKeyboard,
@@ -451,32 +450,6 @@ test("fullscreen Send keeps the configured queue behavior while an agent runs",
}
});
test("editing a queued draft restores its original height with the focus hint visible", async ({
page,
}) => {
await configureComposerQueueSend(page);
await resizeComposerViewport(page, "portrait");
const agent = await startRunningMockAgent(page, {
prefix: "composer-queued-draft-height-",
model: "one-minute-stream",
prompt: "Stay running while a draft is queued.",
});
try {
const draft = "Please review the latest changes.\nPlease review the latest changes.";
await fillComposerDraft(page, draft);
const originalHeight = await composerHeight(page);
await queueComposerWithButton(page);
await expect(composerLocator(page)).toHaveValue("");
await composerLocator(page).blur();
await expect(page.getByText(/ to focus$/)).toBeVisible();
await page.getByRole("button", { name: "Edit queued message", exact: true }).click();
await expect(composerLocator(page)).toHaveValue(draft);
await expectComposerHeight(page, originalHeight);
} finally {
await agent.cleanup();
}
});
test("image paste stays attached to the active editor across fullscreen entry and exit", async ({
page,
}) => {
@@ -1,21 +1,4 @@
import { execFileSync } from "node:child_process";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import type { createCreationScenario } from "../support/helpers/creation";
import { gotoAppShell } from "../support/helpers/app";
import { fillComposerDraft } from "../support/helpers/composer";
import {
connectNewWorkspaceDaemonClient,
openNewWorkspaceComposer,
selectWorkspaceIsolation,
} from "../support/helpers/new-workspace";
import {
seedTerminalProfiles,
selectLaunchOption,
submitTerminalLaunch,
} from "../support/helpers/new-workspace-launch";
import { waitForSidebarHydration } from "../support/helpers/workspace-ui";
import { expect } from "../support/fixtures";
import { test } from "../support/creation-fixtures";
@@ -133,14 +116,12 @@ for (const scenario of [
test(`retrying failed agent initialization preserves its workspace${scenario.suffix}`, async ({
creation,
startup,
page,
}) => {
await creation.openWorkspaceForm("local");
await creation.submitPrompt("Retry this workspace and agent together.", "Create");
await creation.expectAgentStillStarting();
await startup.fail();
await creation.expectStartupFailure();
await expect(page.getByTestId("app-toast")).toHaveCount(0);
await creation.expectOneCreatedWorkspace();
await scenario.prepare(creation);
await creation.submitPrompt("Retry this workspace and agent together.");
@@ -199,105 +180,6 @@ test("an edited agent draft starts after its first start failed", async ({
await expect(page.getByText(/request_key_conflict/)).toHaveCount(0);
});
test("editing a failed New workspace submission starts without a request key conflict", async ({
page,
}) => {
// An empty git repository naturally rejects worktree creation before workspace_ready.
const repoDir = mkdtempSync(path.join(tmpdir(), "paseo-empty-git-ws-"));
execFileSync("git", ["init"], { cwd: repoDir, stdio: "ignore" });
const client = await connectNewWorkspaceDaemonClient();
let projectId: string | null = null;
try {
const seeded = await client.createWorkspace({
source: { kind: "directory", path: repoDir },
});
if (!seeded.workspace) throw new Error(seeded.error ?? "Failed to seed empty git project");
projectId = seeded.workspace.projectId;
const listed = await client.listProjects();
const project = listed.projects.find((entry) => entry.projectId === projectId);
if (!project?.projectKey) throw new Error("Seeded project has no projectKey");
await gotoAppShell(page);
await waitForSidebarHydration(page);
await openNewWorkspaceComposer(page, {
projectKey: project.projectKey,
projectDisplayName: seeded.workspace.projectDisplayName,
});
await selectWorkspaceIsolation(page, "worktree");
await fillComposerDraft(page, "Start original worktree task.");
await page.getByRole("button", { name: "Create", exact: true }).click();
const composerError = page.getByTestId("composer-error").filter({ visible: true }).first();
await expect(composerError).toContainText("Unable to resolve repository default branch");
// The failure renders once in the composer alert, not duplicated in a top toast.
await expect(page.getByText("Unable to resolve repository default branch")).toHaveCount(1);
await selectWorkspaceIsolation(page, "local");
await fillComposerDraft(page, "hi");
await page.getByRole("button", { name: "Create", exact: true }).click();
await expect(page).toHaveURL(/\/workspace\//);
await expect(page.getByText(/request_key_conflict/)).toHaveCount(0);
await expect(
page.getByTestId("user-message").filter({ hasText: "hi", visible: true }),
).toBeVisible();
} finally {
if (projectId) await client.removeProject(projectId).catch(() => undefined);
await client.close();
rmSync(repoDir, { recursive: true, force: true });
}
});
test("switching only the launch target after a failed New workspace creation starts a new workspace", async ({
creation,
workspaceProvision,
page,
}) => {
const profiles = await seedTerminalProfiles([
{
id: "promptless-shell",
name: "Promptless Shell",
command: "sh",
args: ["-c", "echo ready; sleep 5"],
promptArg: "none",
},
]);
try {
await creation.openWorkspaceForm("local");
await workspaceProvision.fail();
await page.getByRole("button", { name: "Create", exact: true }).click();
await expect(
page.getByTestId("composer-error").filter({ visible: true }).first(),
).toContainText("Workspace provisioning failed for test");
await selectLaunchOption(page, "promptless-shell");
await submitTerminalLaunch(page);
await creation.expectOneCreatedWorkspace();
await expect(
page.locator('[data-testid^="workspace-tab-terminal_"]').filter({ visible: true }).first(),
).toBeVisible();
} finally {
await profiles.restore();
}
});
test("failing New workspace creation after switching workspaces shows an error toast", async ({
creation,
workspaceProvision,
page,
}) => {
await creation.openWorkspaceForm("local");
await workspaceProvision.hold();
await page.getByRole("button", { name: "Create", exact: true }).click();
await page.locator('[data-testid^="sidebar-workspace-row-"]').first().click();
await expect(page).toHaveURL(/\/workspace\//);
await workspaceProvision.fail();
await expect(page.getByTestId("app-toast")).toContainText(
"Workspace provisioning failed for test",
);
});
for (const entry of [
{
name: "agent draft",
@@ -1,5 +1,3 @@
import { mkdir, rm, writeFile } from "node:fs/promises";
import { dirname } from "node:path";
import { expect, test } from "../support/fixtures";
import { gotoAppShell, openSettings } from "../support/helpers/app";
import {
@@ -51,10 +49,8 @@ interface ProviderConfigClient {
}): Promise<unknown>;
}
test("adds and removes a custom model while the provider fails", async ({ page }, testInfo) => {
test("adds and removes a custom model while the provider fails", async ({ page }) => {
test.setTimeout(120_000);
const discoveryGate = testInfo.outputPath("hold-provider-discovery");
await mkdir(dirname(discoveryGate), { recursive: true });
const client = await connectDaemonClient<ProviderConfigClient>({
clientIdPrefix: "custom-model-failing-e2e",
});
@@ -64,14 +60,7 @@ test("adds and removes a custom model while the provider fails", async ({ page }
[FAILING_PROVIDER.id]: {
extends: "acp",
label: FAILING_PROVIDER.name,
command: [
"node",
"-e",
'const { existsSync } = require("node:fs");' +
"const exitIfReleased = () => { if (!existsSync(process.argv[1])) process.exit(1); };" +
"exitIfReleased(); setInterval(exitIfReleased, 25);",
discoveryGate,
],
command: ["node", "-e", "process.exit(1)"],
},
},
});
@@ -87,15 +76,9 @@ test("adds and removes a custom model while the provider fails", async ({ page }
await expect(page.getByRole("textbox", { name: "Search models" })).toHaveCount(0);
});
await test.step("saving closes the Add sheet while provider discovery is still pending", async () => {
await writeFile(discoveryGate, "");
await addCustomModel(page, shortModelId);
});
await rm(discoveryGate);
await expect(page.getByTestId("provider-error")).toBeVisible({ timeout: 30_000 });
await addCustomModel(page, shortModelId);
await removeListedCustomModel(page, shortModelId);
} finally {
await rm(discoveryGate, { force: true });
await client
.patchDaemonConfig({ removeProviders: [FAILING_PROVIDER.id] })
.catch(() => undefined);
@@ -1,101 +0,0 @@
import { expect, type Locator, type Page } from "@playwright/test";
import { test } from "../support/fixtures";
import { runWorkspaceActionFromCommandCenter } from "../support/helpers/command-center-workspace-actions";
import { clickNewChat, gotoWorkspace } from "../support/helpers/launcher";
import { seedWorkspace } from "../support/helpers/seed-client";
import { waitForWorkspaceTabsVisible } from "../support/helpers/workspace-tabs";
const DRAG_DISTANCE = -40;
function splitDividers(page: Page): Locator {
return page.getByTestId("workspace-split-resize-handle").filter({ visible: true });
}
async function dividerX(divider: Locator): Promise<number> {
const box = await divider.boundingBox();
if (!box) throw new Error("Divider has no bounding box");
return box.x;
}
async function dragDivider(divider: Locator, deltaX: number): Promise<void> {
const page = divider.page();
const box = await divider.boundingBox();
if (!box) throw new Error("Divider has no bounding box");
const x = box.x + box.width / 2;
const y = box.y + box.height / 2;
await page.mouse.move(x, y);
await page.mouse.down();
await page.mouse.move(x + deltaX / 2, y, { steps: 4 });
await page.mouse.move(x + deltaX, y, { steps: 4 });
await page.mouse.up();
}
async function expectDividerFollowsDrag({
page,
index,
}: {
page: Page;
index: number;
}): Promise<void> {
const divider = splitDividers(page).nth(index);
const before = await dividerX(divider);
await dragDivider(divider, DRAG_DISTANCE);
await expect
.poll(async () => (await dividerX(divider)) - before, {
message: `divider ${index + 1} should follow the drag`,
})
.toBeLessThan(DRAG_DISTANCE * 0.75);
}
async function splitRight({
page,
expectedDividers,
}: {
page: Page;
expectedDividers: number;
}): Promise<void> {
await runWorkspaceActionFromCommandCenter(page, "Split pane right");
await expect(splitDividers(page)).toHaveCount(expectedDividers);
}
test.describe("Split pane resize", () => {
test("every divider drags in a four-pane row", async ({ page }) => {
await page.setViewportSize({ width: 1600, height: 900 });
const workspace = await seedWorkspace({ repoPrefix: "split-resize-fresh-" });
try {
await gotoWorkspace(page, workspace.workspaceId);
await waitForWorkspaceTabsVisible(page);
await clickNewChat(page);
await splitRight({ page, expectedDividers: 1 });
await splitRight({ page, expectedDividers: 2 });
await splitRight({ page, expectedDividers: 3 });
for (const index of [0, 1, 2]) {
await expectDividerFollowsDrag({ page, index });
}
} finally {
await workspace.cleanup();
}
});
test("every divider drags after panes are added to a resized row", async ({ page }) => {
await page.setViewportSize({ width: 1600, height: 900 });
const workspace = await seedWorkspace({ repoPrefix: "split-resize-grown-" });
try {
await gotoWorkspace(page, workspace.workspaceId);
await waitForWorkspaceTabsVisible(page);
await clickNewChat(page);
await splitRight({ page, expectedDividers: 1 });
await expectDividerFollowsDrag({ page, index: 0 });
await splitRight({ page, expectedDividers: 2 });
await splitRight({ page, expectedDividers: 3 });
for (const index of [0, 1, 2]) {
await expectDividerFollowsDrag({ page, index });
}
} finally {
await workspace.cleanup();
}
});
});
+11 -26
View File
@@ -836,8 +836,6 @@ test("usage percentages state their meaning and follow the selected language", a
}
});
const exhaustionClock = /^runs out (?:[A-Z][a-z]{2} )?\d{1,2}:\d{2}(?: [AP]M)?$/;
test("open usage clocks advance without refreshing or reopening", async ({ page }) => {
test.setTimeout(120_000);
const now = new Date();
@@ -855,16 +853,12 @@ test("open usage clocks advance without refreshing or reopening", async ({ page
const card = page.getByTestId("usage-report-login-journey:account");
await expect(card.getByTestId("usage-freshness")).toHaveText("Updated just now");
await expect(card.getByText("resets in 30m", { exact: false }).first()).toBeVisible();
const forecast = card.getByText(exhaustionClock);
await expect(forecast).toBeVisible();
const forecastTime = (await forecast.innerText()).replace(/^[^0-9]+/, "");
// The shared minute clock is wall-aligned, and the daemon timestamps use real time.
// After two browser minutes the latest displayed tick is one or two minutes old.
await advanceUsageClock(page, 120_000);
await expect(card.getByTestId("usage-freshness")).toHaveText(/^Updated [12]m ago$/);
await expect(card.getByText(/resets in (28|29)m/).first()).toBeVisible();
// The weekday drops off at local midnight, but the forecast time stays fixed.
await expect(forecast).toHaveText(new RegExp(` ${forecastTime}$`));
await expect(card.getByText(/runs out in (28|29)m/)).toBeVisible();
await expect(card.getByTestId("provider-usage-balance-credits-reset")).toHaveText(
/^resets in (28|29)m\s·\s/,
);
@@ -873,7 +867,7 @@ test("open usage clocks advance without refreshing or reopening", async ({ page
}
});
test("Refresh all keeps quota visible after a timeout and shows only reset details when back on track", async ({
test("Refresh all keeps quota visible and restores the forecast after a timeout", async ({
page,
}) => {
const reading = new Date();
@@ -881,7 +875,7 @@ test("Refresh all keeps quota visible after a timeout and shows only reset detai
try {
const transport = await installDaemonWebSocketGate(page);
await openCompactUsageWithClock(page, reading);
await expectQuota(page, "40% used", exhaustionClock);
await expectQuota(page, "40% used", /runs out in /);
await timeOutUsageRefresh(page, transport);
await expectQuota(page, "40% used", null);
@@ -890,7 +884,7 @@ test("Refresh all keeps quota visible after a timeout and shows only reset detai
await login.setReport(usageReading(reading, 10));
transport.releaseHeldClientRequest();
await refreshAllUsage(page);
await expectQuota(page, "10% used", null);
await expectQuota(page, "10% used", "~50% left at reset");
await expectUsageRefreshError(page).toBeHidden();
} finally {
await login.cleanup();
@@ -903,29 +897,23 @@ test("a card refresh timeout is visible alongside a newer quota forecast", async
try {
const transport = await installDaemonWebSocketGate(page);
await openCompactUsageWithClock(page, reading);
await expectQuota(page, "40% used", exhaustionClock);
await expectQuota(page, "40% used", /runs out in /);
await delayCardRefreshResponse(page, transport);
await login.setReport(usageReading(reading, 45));
await login.setReport(usageReading(reading, 10));
await refreshAllUsage(page);
await expectQuota(page, "45% used", exhaustionClock);
await expectQuota(page, "10% used", "~50% left at reset");
await advanceUsageClock(page, 61_000);
await expect(
usageModal(page)
.getByTestId("usage-report-login-journey:account")
.getByTestId("usage-refresh-error"),
).toHaveText("Unable to refresh usage");
await expectQuota(page, "45% used", exhaustionClock);
await expectUsageRefreshError(page).toBeVisible();
await expectQuota(page, "10% used", "~50% left at reset");
} finally {
await login.cleanup();
}
});
function expectUsageRefreshError(page: Page) {
return expect(
usageModal(page).getByRole("alert").getByText("Unable to refresh usage", { exact: true }),
);
return expect(usageModal(page).getByText("Unable to refresh usage", { exact: true }));
}
async function delayCardRefreshResponse(
@@ -959,10 +947,7 @@ async function expectQuota(page: Page, amount: string, forecast: string | RegExp
await expect(usage.getByText(amount, { exact: true })).toBeVisible();
await expect(usage.getByText(/^resets in /)).toBeVisible();
if (forecast === null) {
await expect(usage.getByRole("checkbox", { name: /^Pin Claude Session/ })).toHaveAccessibleName(
/^Pin Claude Session, \d+% used · resets in [^·]+ · [^·]+$/,
);
await expect(usage.getByText(/^runs out /)).toBeHidden();
await expect(usage.getByText(/^runs out in /)).toBeHidden();
return;
}
await expect(usage.getByText(forecast)).toBeVisible();
@@ -28,13 +28,12 @@ bounds cannot establish measurement parity.
compares them with the shipped headers. This catches missing C++ fields in the
measurement path, which the Kotlin tests cannot exercise.
The vendored library (`packages/react-native-enriched-markdown`) contains
`InlineCodeFormattingTest`, which exercises actual Android spans in Robolectric
native graphics mode, covering draw and measurement, span order, code inside
paragraph/heading sizes, bold/italic composition, and links preserving code and
emphasized prose fonts. It runs in `npm run test:android`; CI does not run it.
To run only this regression locally, from `packages/app/android` after Expo
prebuild:
The package patch contains `InlineCodeFormattingTest`, which exercises actual
Android spans in Robolectric native graphics mode, covering draw and measurement,
span order, code inside paragraph/heading sizes, bold/italic composition, and
links preserving code and emphasized prose fonts.
It runs in the existing `test:android` CI job. To run only this regression locally,
from `packages/app/android` after Expo prebuild:
```sh
./gradlew :react-native-enriched-markdown:testDebugUnitTest \
@@ -15,11 +15,6 @@ import { delayBrowserAgentCreatedStatus } from "./helpers/new-workspace";
export const test = base.extend<{
startup: { release(): Promise<void>; fail(): Promise<void> };
workspaceProvision: {
hold(): Promise<void>;
fail(): Promise<void>;
release(): Promise<void>;
};
promptRejection: void;
composerMetadata: { set(patch: Record<string, string>): Promise<void> };
creation: Awaited<ReturnType<typeof createCreationScenario>>;
@@ -75,57 +70,6 @@ export default function contribute(server) {
await client.close();
}
},
workspaceProvision: async ({ page }, provide) => {
void page;
const client = await connectNewWorkspaceDaemonClient();
const plugin = await copyPluginExample("lifecycle-logger");
const gate = path.join(plugin.directory, "workspace-provision.txt");
const holdFile = path.join(plugin.directory, "workspace-provision-hold.txt");
const failFile = path.join(plugin.directory, "workspace-provision-fail.txt");
const previous = await client.getDaemonConfig();
try {
await writeFile(
path.join(plugin.directory, "index.server.ts"),
`
import { readFile, rm } from "node:fs/promises";
export default function contribute(server) {
return server.before("workspace.create", async ({ request }) => {
const gate = ${JSON.stringify(gate)};
let command = await readFile(gate, "utf8").catch(() => "release");
while (command === "hold") {
await new Promise(resolve => setTimeout(resolve, 20));
command = await readFile(gate, "utf8").catch(() => "release");
}
if (command === "fail") {
await rm(gate, { force: true });
throw new Error("Workspace provisioning failed for test");
}
return request;
});
}
`,
);
await client.patchDaemonConfig({ pluginsEnabled: true });
await client.installDirectoryPlugin(plugin.directory);
await provide({
hold: async () => {
await writeFile(holdFile, "hold");
await rename(holdFile, gate);
},
fail: async () => {
await writeFile(failFile, "fail");
await rename(failFile, gate);
},
release: () => rm(gate, { force: true }),
});
} finally {
await rm(gate, { force: true });
await client.removePlugin("lifecycle-logger");
await client.patchDaemonConfig({ pluginsEnabled: previous.config.pluginsEnabled });
await plugin.cleanup();
await client.close();
}
},
promptRejection: async ({ page }, provide) => {
void page;
const client = await connectNewWorkspaceDaemonClient();
@@ -19,6 +19,8 @@ export async function addCustomModel(page: Page, id: string): Promise<void> {
.getByRole("button", { name: "Add", exact: true })
.click();
await expect(page.getByRole("button", { name: `Remove ${id}`, exact: true })).toHaveCount(1);
// Config updates before provider refresh finishes and dismisses the add sheet.
// Resizing or interacting with the model list must wait for that save to finish.
await expect(page.getByTestId("add-custom-model-sheet")).toBeHidden();
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.17.1",
"version": "0.17.0",
"private": true,
"main": "index.ts",
"scripts": {
@@ -40,7 +40,7 @@
"dev:ios": "npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo run:ios",
"build:apk": "npm --prefix ../.. run build:apk",
"build:apk:arm64": "npm --prefix ../.. run build:apk:arm64",
"test:android": "expo prebuild --platform android --no-install && cd android && ./gradlew :paseo-native-trace:testReleaseUnitTest :paseo-hardware-keyboard:testReleaseUnitTest :react-native-enriched-markdown:testReleaseUnitTest --tests '*InlineCodeFormattingTest' --tests '*ListRenderingTest' --tests '*TaskListInteractionTest' --tests '*ListBlockquoteMeasurementTest' --no-daemon --max-workers=2 -Dorg.gradle.parallel=false"
"test:android": "expo prebuild --platform android --no-install && cd android && ./gradlew :paseo-native-trace:testReleaseUnitTest :paseo-hardware-keyboard:testReleaseUnitTest :react-native-enriched-markdown:testReleaseUnitTest --tests '*InlineCodeFormattingTest' --no-daemon --max-workers=2 -Dorg.gradle.parallel=false"
},
"dependencies": {
"@codemirror/commands": "6.10.4",
@@ -125,7 +125,7 @@
"react-native": "0.86.3",
"react-native-draggable-flatlist": "^4.0.3",
"react-native-edge-to-edge": "^1.7.0",
"react-native-enriched-markdown": "*",
"react-native-enriched-markdown": "1.2.0-nightly-20261014-766fc0e67",
"react-native-gesture-handler": "~2.32.0",
"react-native-keyboard-controller": "1.21.12",
"react-native-nitro-modules": "0.35.5",
@@ -462,12 +462,8 @@ function SplitNodeView({
groupId ? state.splitSizesByWorkspace[workspaceKey]?.[groupId] : undefined,
);
const groupChildren = node.kind === "group" ? node.group.children : EMPTY_SPLIT_NODES;
// Dragged sizes live per group id, apart from the layout tree, and a group keeps its id when
// panes are added or removed. They only apply while they still have one entry per child;
// otherwise the dividers past the end of the list could not move.
const layoutGroupSizes = node.kind === "group" ? node.group.sizes : EMPTY_SPLIT_SIZES;
const groupSizes =
storedGroupSizes?.length === groupChildren.length ? storedGroupSizes : layoutGroupSizes;
storedGroupSizes ?? (node.kind === "group" ? node.group.sizes : EMPTY_SPLIT_SIZES);
const visibleFlex = useMemo(
() => resolveVisibleGroupFlex(groupChildren, groupSizes, maximizedPaneId),
[groupChildren, groupSizes, maximizedPaneId],
@@ -12,7 +12,6 @@ import { Composer } from "@/composer";
import { ProjectIconView } from "@/components/project-icon-view";
import { ICON_SIZE } from "@/styles/theme";
import { useToast } from "@/contexts/toast-context";
import { draftCreationKey } from "@/composer/draft/creation-key";
import { useAgentInputDraft } from "@/composer/draft/input-draft";
import { useProjectIcon } from "@/projects/icons";
import { useHostRuntimeClient, useHostRuntimeIsConnected } from "@/runtime/host-runtime";
@@ -97,16 +96,13 @@ async function callWorkspaceCreation({
worktreeSlug: string;
input: { cwd: string; agent?: CreateWorkspaceRequestOptions["agent"] };
}) {
const request: Omit<CreateWorkspaceRequestOptions, "idempotencyKey"> = {
return connectedClient.createWorkspace({
idempotencyKey: creationId,
agent: input.agent,
source:
creationMethod === "create_worktree"
? { kind: "worktree", cwd: input.cwd, worktreeSlug }
: { kind: "directory", path: input.cwd },
};
return connectedClient.createWorkspace({
...request,
idempotencyKey: draftCreationKey(creationId, request),
});
}
@@ -367,9 +363,7 @@ export function WorkspaceSetupDialog() {
} catch (error) {
const message = toErrorMessage(error);
setErrorMessage(message);
if (!getIsStillActive()) {
toast.error(message);
}
toast.error(message);
} finally {
if (getIsStillActive()) {
setPendingAction(null);
@@ -461,10 +455,11 @@ export function WorkspaceSetupDialog() {
commandDraft={composerState?.commandDraft}
agentControls={agentControlsWithDisabled}
inputWrapperStyle={styles.composerInputWrapper}
error={errorMessage}
/>
</KeyboardTranslateView>
</FileDropZone>
{errorMessage ? <Text style={styles.errorText}>{errorMessage}</Text> : null}
</AdaptiveModalSheet>
);
}
@@ -487,6 +482,11 @@ const styles = StyleSheet.create((theme) => ({
marginHorizontal: -theme.spacing[6],
marginVertical: -theme.spacing[2],
},
errorText: {
fontSize: theme.fontSize.base,
color: theme.colors.destructive,
lineHeight: 20,
},
composerSlot: {
paddingBottom: theme.spacing[4],
},
@@ -8,21 +8,6 @@ const request = {
clientMessageId: "draft-1:initial-message",
};
const workspaceRequest = {
source: {
kind: "worktree" as const,
cwd: "/repo",
projectId: "prj_1",
worktreeSlug: "clever-fox",
},
firstAgentContext: { prompt: "Start the original task.", attachments: [] },
agent: {
config: { provider: "codex", cwd: "/repo", model: "gpt-6" },
initialPrompt: "Start the original task.",
clientMessageId: "draft-1:initial-message",
},
};
describe("draftCreationKey", () => {
it("keeps the key for a retry of the same request, whatever its key order", () => {
const reordered = {
@@ -42,52 +27,4 @@ describe("draftCreationKey", () => {
expect(key).not.toBe(draftCreationKey("draft-1", request));
expect(key.startsWith("draft-1:")).toBe(true);
});
it.each([
{
name: "isolation",
edited: {
...workspaceRequest,
source: { kind: "directory" as const, path: "/repo", projectId: "prj_1" },
},
},
{
name: "project",
edited: {
...workspaceRequest,
source: { ...workspaceRequest.source, projectId: "prj_2", cwd: "/other" },
},
},
{
name: "prompt",
edited: {
...workspaceRequest,
firstAgentContext: { prompt: "hi", attachments: [] },
agent: { ...workspaceRequest.agent, initialPrompt: "hi" },
},
},
])(
"gives a New workspace request with edited $name a new key on the same draft",
({ edited }) => {
const key = draftCreationKey("draft-1", edited);
expect(key).not.toBe(draftCreationKey("draft-1", workspaceRequest));
expect(key.startsWith("draft-1:")).toBe(true);
},
);
it("gives a New workspace request with a changed launch target a new key even when the wire request matches", () => {
const emptyRequest = {
source: { kind: "directory" as const, path: "/repo", projectId: "prj_1" },
};
const chatKey = draftCreationKey("draft-1", {
request: emptyRequest,
launchTarget: { kind: "chat" },
});
const terminalKey = draftCreationKey("draft-1", {
request: emptyRequest,
launchTarget: { kind: "terminal", profileId: "shell" },
});
expect(terminalKey).not.toBe(chatKey);
expect(terminalKey.startsWith("draft-1:")).toBe(true);
});
});
@@ -1,7 +1,7 @@
import type { ComposerOptionControls } from "@/agent-controls/option-controls";
import { useCallback, useEffect, useMemo, useRef } from "react";
import type { JsonValue } from "@getpaseo/protocol/agent-types";
import { Keyboard, StyleSheet as RNStyleSheet, View } from "react-native";
import { Keyboard, StyleSheet as RNStyleSheet, Text, View } from "react-native";
import { useTranslation } from "react-i18next";
import { StyleSheet } from "react-native-unistyles";
import { CHAT_COLUMN_RAIL_DATASET } from "@/chat-rail";
@@ -536,6 +536,16 @@ export function WorkspaceDraftComposer({
);
return (
<View style={animatedStaticStyles.inputAreaWrapper} onLayout={onInputAreaLayout}>
{formErrorMessage ? (
<View
style={styles.formErrorRow}
dataSet={isComposerFullscreen ? undefined : CHAT_COLUMN_RAIL_DATASET}
>
<View style={styles.formError}>
<Text style={styles.errorText}>{formErrorMessage}</Text>
</View>
</View>
) : null}
{importPillPress && !isComposerFullscreen ? (
<View style={styles.importPillRow} dataSet={CHAT_COLUMN_RAIL_DATASET}>
<View style={styles.importPillContent}>
@@ -567,7 +577,6 @@ export function WorkspaceDraftComposer({
commandDraft={composerState.commandDraft}
agentControls={composerAgentControls}
isCompactLayout={isCompactComposerLayout}
error={formErrorMessage || null}
/>
</View>
);
@@ -583,6 +592,11 @@ const animatedStaticStyles = RNStyleSheet.create({
});
const styles = StyleSheet.create((theme) => ({
formErrorRow: {
width: "100%",
paddingHorizontal: theme.spacing[4],
alignItems: "center",
},
importPillRow: {
width: "100%",
paddingHorizontal: theme.spacing[4],
@@ -601,4 +615,18 @@ const styles = StyleSheet.create((theme) => ({
maxWidth: theme.contentMaxWidth,
flexDirection: "row",
},
formError: {
width: "100%",
maxWidth: theme.contentMaxWidth,
marginBottom: theme.spacing[2],
paddingHorizontal: theme.spacing[3],
paddingVertical: theme.spacing[2],
borderRadius: theme.borderRadius.md,
backgroundColor: theme.colors.surface2,
borderWidth: 1,
borderColor: theme.colors.destructive,
},
errorText: {
color: theme.colors.destructive,
},
}));
+9 -8
View File
@@ -8,7 +8,6 @@ import { createStore, type StoreApi } from "zustand/vanilla";
import { useStore } from "zustand";
import { getHostRuntimeStore } from "@/runtime/host-runtime";
import { LoadingSpinner } from "@/components/ui/loading-spinner";
import { Alert } from "@/components/ui/alert";
import {
View,
Pressable,
@@ -1017,8 +1016,6 @@ interface ComposerProps {
* `inputMode`.
*/
editingSession?: ComposerEditingSession;
/** Caller-owned submission error rendered in the composer's shared error slot. */
error?: string | null;
}
const EMPTY_ARRAY: readonly QueuedMessage[] = [];
@@ -1322,7 +1319,6 @@ function ComposerContentImpl({
isCompactLayout: isCompactLayoutOverride,
inputMode = "chat",
editingSession: providedEditingSession,
error: externalError,
readOnly = false,
submitLabel,
placeholder,
@@ -2548,13 +2544,14 @@ function ComposerContentImpl({
// Focusing the composer on a touch screen raises the on-screen keyboard over the conversation.
const messageInputAutoFocus = autoFocus && isDesktopWebBreakpoint && hasFinePointer;
const submitLoadingPressHandler = isAgentRunning ? handleCancelAgent : undefined;
const displayError = externalError || sendError;
const sendErrorNode = useMemo(
() =>
displayError ? (
<Alert variant="error" size="sm" description={displayError} testID="composer-error" />
sendError ? (
<Text accessibilityRole="alert" style={styles.sendErrorText}>
{sendError}
</Text>
) : null,
[displayError],
[sendError],
);
const githubEmptyText = githubSearchResultsQuery.isFetching
? t("composer.github.searching")
@@ -2840,6 +2837,10 @@ const styles = StyleSheet.create((theme: Theme) => ({
queueSendButton: {
backgroundColor: theme.colors.accent,
},
sendErrorText: {
color: theme.colors.palette.red[500],
fontSize: theme.fontSize.base,
},
})) as unknown as Record<string, object>;
const ThemedAttachmentSpinner = withUnistyles(LoadingSpinner);
@@ -117,11 +117,10 @@ export function useComposerHeight({
useEffect(() => {
const source = textareaRef.current;
if (!source || typeof ResizeObserver === "undefined") return;
let previousWidth: number | undefined;
const observer = new ResizeObserver(([entry]) => {
// Hint padding changes the width text wraps at even when clientWidth stays fixed.
const nextWidth = entry.contentRect.width;
if (nextWidth === previousWidth) return;
let previousWidth = source.clientWidth;
const observer = new ResizeObserver(() => {
const nextWidth = source.clientWidth;
if (Math.abs(nextWidth - previousWidth) < 1) return;
previousWidth = nextWidth;
measure(paramsRef.current.getText());
});
+24 -39
View File
@@ -677,6 +677,24 @@ function MessageInputOverlay({
return null;
}
function FocusHint({
visible,
focusInputKeys,
label,
}: {
visible: boolean;
focusInputKeys: ShortcutChord | null | undefined;
label: string;
}) {
const { isActiveComposer } = useComposerKeyboardScope();
if (!isActiveComposer || !visible || !focusInputKeys || !label.trim()) return null;
return (
<Text style={styles.focusHintText} pointerEvents="none">
{label}
</Text>
);
}
interface ComposerTextSurfaceProps {
readOnly: boolean;
value: string;
@@ -727,32 +745,6 @@ function ComposerTextSurface(props: ComposerTextSurfaceProps): React.ReactElemen
onRenderedLinesChange(event.nativeEvent.lines.length),
[onRenderedLinesChange],
);
const { isActiveComposer } = useComposerKeyboardScope();
const { focusHintLabel, focusHintVisible, focusInputKeys } = props;
const [focusHintLayout, setFocusHintLayout] = useState<{ label: string; width: number }>();
const handleFocusHintLayout = useCallback(
(event: LayoutChangeEvent) => {
setFocusHintLayout({ label: focusHintLabel, width: event.nativeEvent.layout.width });
},
[focusHintLabel],
);
const shouldShowFocusHint =
isActiveComposer &&
focusHintVisible &&
Boolean(focusInputKeys) &&
focusHintLabel.trim().length > 0;
const focusHintWidth =
shouldShowFocusHint && focusHintLayout?.label === focusHintLabel
? focusHintLayout.width
: undefined;
// Make room for the hint in the same render that reveals it.
const textInputStyle = useMemo(
() =>
focusHintWidth === undefined
? props.textInputStyle
: [props.textInputStyle, { paddingRight: focusHintWidth }],
[focusHintWidth, props.textInputStyle],
);
if (props.readOnly) {
return (
<View style={styles.textInputScrollWrapper}>
@@ -783,7 +775,7 @@ function ComposerTextSurface(props: ComposerTextSurfaceProps): React.ReactElemen
accessibilityLabel={props.accessibilityLabel}
onFocus={props.onFocus}
onBlur={props.onBlur}
style={textInputStyle}
style={props.textInputStyle}
multiline
scrollEnabled={props.scrollEnabled}
editable={props.editable}
@@ -793,16 +785,11 @@ function ComposerTextSurface(props: ComposerTextSurfaceProps): React.ReactElemen
onPasteError={props.onPasteError}
autoFocus={props.autoFocus}
/>
{shouldShowFocusHint ? (
<Text
key={focusHintLabel}
style={[styles.focusHintText, focusHintWidth === undefined && styles.unmeasuredFocusHint]}
pointerEvents="none"
onLayout={handleFocusHintLayout}
>
{focusHintLabel}
</Text>
) : null}
<FocusHint
visible={props.focusHintVisible}
focusInputKeys={props.focusInputKeys}
label={props.focusHintLabel}
/>
</View>
);
}
@@ -2473,12 +2460,10 @@ const styles = StyleSheet.create((theme: Theme) => ({
position: "absolute",
top: 0,
right: 0,
paddingLeft: theme.spacing[2],
fontSize: theme.fontSize.sm,
color: theme.colors.foregroundMuted,
opacity: 0.5,
},
unmeasuredFocusHint: { opacity: 0 },
textInput: {
// Preserve the controls when an ancestor constrains an overlong draft.
flexShrink: 1,
@@ -110,10 +110,6 @@ function resolveAgentAutocompleteSnapshot(input: {
};
}
function isSameSlashCommand(a: SlashCommandRange | null, b: SlashCommandRange | null): boolean {
return a?.start === b?.start && a?.query === b?.query;
}
interface DirectorySuggestionEntry {
path: string;
kind: "file" | "directory";
@@ -750,25 +746,9 @@ export function useAgentAutocomplete(input: UseAgentAutocompleteInput): AgentAut
);
const selectOptionFromKeyPress = useCallback(
(option: AutocompleteOption, event?: AgentAutocompleteKeyPressEvent) => {
// The cursor reaches the menu after paint, so a key can land while the options still
// belong to an older query. Never pick from that list. A click picks what the user sees.
if (
mode === "command" &&
event &&
!isSameSlashCommand(
findActiveSlashCommand({
text: event.input.text,
cursorIndex: event.input.selection.start,
}),
activeSlashCommand,
)
) {
return;
}
onSelectOption(option, event?.input);
},
[activeSlashCommand, mode, onSelectOption],
(option: AutocompleteOption, event?: AgentAutocompleteKeyPressEvent) =>
onSelectOption(option, event?.input),
[onSelectOption],
);
const { selectedIndex, onKeyPress } = useAutocomplete({
+3 -1
View File
@@ -2323,9 +2323,11 @@ export const ar: TranslationResources = {
resetsIn: "تتم إعادة التعيين خلال {{duration}}",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}}، {{time}}",
projectedLeftAtReset: "نحو {{percentage}} متبقية عند إعادة التعيين",
limitReached: "تم بلوغ الحد",
mayHaveRunOut: "ربما نفدت الحصة",
runsOutAt: "ينفد عند {{time}}",
runsOutNow: "ينفد الآن",
runsOutIn: "ينفد خلال {{duration}}",
justNow: "الآن",
daysAgo: "قبل {{value}} يومًا",
daysAgo_zero: "قبل {{value}} يوم",
+3 -1
View File
@@ -2333,9 +2333,11 @@ export const en = {
resetsIn: "resets in {{duration}}",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}}, {{time}}",
projectedLeftAtReset: "~{{percentage}} left at reset",
limitReached: "Limit reached",
mayHaveRunOut: "May have run out",
runsOutAt: "runs out {{time}}",
runsOutNow: "runs out now",
runsOutIn: "runs out in {{duration}}",
justNow: "just now",
daysAgo: "{{value}}d ago",
hoursAgo: "{{value}}h ago",
+3 -1
View File
@@ -2354,9 +2354,11 @@ export const es: TranslationResources = {
resetsIn: "se restablece en {{duration}}",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}}, {{time}}",
projectedLeftAtReset: "~{{percentage}} restante al restablecerse",
limitReached: "Límite alcanzado",
mayHaveRunOut: "Puede que ya se haya agotado",
runsOutAt: "agotamiento previsto {{time}}",
runsOutNow: "se agota ahora",
runsOutIn: "se agota en {{duration}}",
justNow: "ahora mismo",
daysAgo: "hace {{value}} d",
hoursAgo: "hace {{value}} h",
+3 -1
View File
@@ -2355,9 +2355,11 @@ export const fr: TranslationResources = {
resetsIn: "se réinitialise dans {{duration}}",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}}, {{time}}",
projectedLeftAtReset: "~{{percentage}} restant à la réinitialisation",
limitReached: "Limite atteinte",
mayHaveRunOut: "Le quota est peut-être épuisé",
runsOutAt: "épuisement prévu {{time}}",
runsOutNow: "s’épuise maintenant",
runsOutIn: "s’épuise dans {{duration}}",
justNow: "à l’instant",
daysAgo: "il y a {{value}} j",
hoursAgo: "il y a {{value}} h",
+3 -1
View File
@@ -2328,9 +2328,11 @@ export const ja: TranslationResources = {
resetsIn: "{{duration}}後にリセット",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}} {{time}}",
projectedLeftAtReset: "リセット時に約{{percentage}}残る見込み",
limitReached: "上限に達しました",
mayHaveRunOut: "上限に達した可能性があります",
runsOutAt: "{{time}}に上限に到達",
runsOutNow: "まもなく上限に到達",
runsOutIn: "{{duration}}後に上限に到達",
justNow: "たった今",
daysAgo: "{{value}}日前",
hoursAgo: "{{value}}時間前",
+3 -1
View File
@@ -2316,9 +2316,11 @@ export const ko: TranslationResources = {
resetsIn: "{{duration}} 후 재설정",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}} {{time}}",
projectedLeftAtReset: "초기화 시 약 {{percentage}} 남을 예정",
limitReached: "한도에 도달함",
mayHaveRunOut: "한도를 소진했을 수 있음",
runsOutAt: "{{time}}에 한도에 도달",
runsOutNow: "지금 한도에 도달",
runsOutIn: "{{duration}} 후 한도에 도달",
justNow: "방금",
daysAgo: "{{value}}일 전",
hoursAgo: "{{value}}시간 전",
+3 -1
View File
@@ -2339,9 +2339,11 @@ export const ptBR: TranslationResources = {
resetsIn: "redefine em {{duration}}",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}}, {{time}}",
projectedLeftAtReset: "~{{percentage}} restará na renovação",
limitReached: "Limite atingido",
mayHaveRunOut: "A cota pode ter se esgotado",
runsOutAt: "esgotamento previsto para {{time}}",
runsOutNow: "esgota agora",
runsOutIn: "esgota em {{duration}}",
justNow: "agora mesmo",
daysAgo: "há {{value}} d",
hoursAgo: "há {{value}} h",
+3 -1
View File
@@ -2341,9 +2341,11 @@ export const ru: TranslationResources = {
resetsIn: "сброс через {{duration}}",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}}, {{time}}",
projectedLeftAtReset: "К сбросу останется ~{{percentage}}",
limitReached: "Лимит исчерпан",
mayHaveRunOut: "Лимит мог уже исчерпаться",
runsOutAt: "закончится {{time}}",
runsOutNow: "закончится сейчас",
runsOutIn: "закончится через {{duration}}",
justNow: "только что",
daysAgo: "{{value}} дн. назад",
hoursAgo: "{{value}} ч назад",
+3 -1
View File
@@ -2282,9 +2282,11 @@ export const zhCN: TranslationResources = {
resetsIn: "将在 {{duration}}后重置",
resetsAtWeekday: "{{weekday}} {{time}}",
resetsAtDate: "{{date}} {{time}}",
projectedLeftAtReset: "重置时约剩余 {{percentage}}",
limitReached: "已达到上限",
mayHaveRunOut: "额度可能已用完",
runsOutAt: "将在 {{time}} 用尽",
runsOutNow: "即将用尽",
runsOutIn: "将在 {{duration}}后用尽",
justNow: "刚刚",
daysAgo: "{{value}}天前",
hoursAgo: "{{value}}小时前",
@@ -117,7 +117,12 @@ export function ProviderDetail({
action={installation.action}
/>
{sections.models ? (
<ProviderModels serverId={serverId} entry={entry} discovered={sections.models === "all"} />
<ProviderModels
serverId={serverId}
entry={entry}
discovered={sections.models === "all"}
refresh={refresh}
/>
) : null}
<Troubleshooting
serverId={serverId}
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { Text, View } from "react-native";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import type { AgentModelDefinition } from "@getpaseo/protocol/agent-types";
import type { AgentModelDefinition, AgentProvider } from "@getpaseo/protocol/agent-types";
import type { ProviderProfileModel } from "@getpaseo/protocol/provider-config";
import { compareMatchScores, scoreTextFields } from "@getpaseo/protocol/search/text-match";
import {
@@ -52,11 +52,13 @@ export function ProviderModels({
serverId,
entry,
discovered,
refresh,
}: {
serverId: string;
entry: ProviderEntry;
/** List the models the provider reports, with search. Only a running provider reports them. */
discovered: boolean;
refresh: (providers?: AgentProvider[]) => Promise<void>;
}) {
const { t } = useTranslation();
const provider = entry.provider;
@@ -103,11 +105,13 @@ export function ProviderModels({
additionalModels: additionalModels.filter((model) => model.id !== modelId),
},
},
}).finally(() => {
setDeletingModelId((current) => (current === modelId ? null : current));
});
})
.then(() => refresh([provider]))
.finally(() => {
setDeletingModelId((current) => (current === modelId ? null : current));
});
},
[additionalModels, patchConfig, provider],
[additionalModels, patchConfig, provider, refresh],
);
const customTrailing = useMemo(
@@ -200,6 +204,7 @@ export function ProviderModels({
additionalModels={additionalModels}
visible={addSheetOpen}
onClose={handleCloseAddSheet}
refresh={refresh}
/>
</View>
);
@@ -281,12 +286,14 @@ function AddCustomModelSheet({
additionalModels,
visible,
onClose,
refresh,
}: {
serverId: string;
provider: string;
additionalModels: ProviderProfileModel[];
visible: boolean;
onClose: () => void;
refresh: (providers?: AgentProvider[]) => Promise<void>;
}) {
const { t } = useTranslation();
const { patchConfig } = useDaemonConfig(serverId);
@@ -315,12 +322,13 @@ function AddCustomModelSheet({
},
},
})
.then(() => refresh([provider]))
.then(() => onClose())
.catch((err: unknown) => {
setError(err instanceof Error ? err.message : t("settings.providers.models.failedToSave"));
})
.finally(() => setSaving(false));
}, [additionalModels, canAdd, onClose, patchConfig, provider, t, trimmed]);
}, [additionalModels, canAdd, onClose, patchConfig, provider, refresh, t, trimmed]);
const header = useMemo<SheetHeader>(
() => ({ title: t("settings.providers.models.addCustomTitle") }),
+1 -425
View File
@@ -21,7 +21,6 @@ import { useSessionStore, type Agent } from "@/stores/session-store";
import { normalizeAgentSnapshot } from "@/utils/agent-snapshots";
import { isAgentArchiving, setAgentArchiving } from "@/hooks/use-archive-agent";
import { queryClient } from "@/data/query-client";
import { checkoutStatusQueryKey } from "@/git/query-keys";
import {
HostRuntimeController,
HostRuntimeStore,
@@ -1749,7 +1748,7 @@ describe("HostRuntimeController", () => {
});
latencies["relay:relay.paseo.sh:443"] = 30;
await vi.advanceTimersByTimeAsync(240_000);
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
expect(controller.getSnapshot().activeConnectionId).toBe("direct:lan:6767");
@@ -1808,429 +1807,6 @@ describe("HostRuntimeController", () => {
await controller.stop();
});
it("ignores busy active heartbeat spikes when comparing against an idle alternate probe", async () => {
// Replays the recorded 10:04-10:08 relay sequence (#9149): the active relay has a ~250-300 ms
// baseline over its recent heartbeats, spikes to 383/503/491 ms right before each alternate
// probe, and the idle alternate measures 236/322/291 ms.
useHostRuntimeClock();
const host = makeHost({
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
let alternateProbes = 0;
const latencies: Record<string, number | Error> = {
[relayPrimary.id]: 260,
[relayAlternate.id]: 280,
};
const baseDeps = makeDeps(latencies, clients);
const controller = new HostRuntimeController({
host,
deps: {
...baseDeps,
connectToDaemon: async (input) => {
if (input.connection.id === relayAlternate.id) {
alternateProbes += 1;
}
return baseDeps.connectToDaemon(input);
},
},
});
await controller.start({ autoProbe: false });
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
const activeClient = controller.getSnapshot().client as unknown as FakeDaemonClient;
const rounds = [
{ intervalMs: 120_000, baseline: 295, spike: 383, alternate: 236 },
{ intervalMs: 240_000, baseline: 251, spike: 503, alternate: 322 },
{ intervalMs: 480_000, baseline: 341, spike: 491, alternate: 291 },
];
for (const round of rounds) {
await vi.advanceTimersByTimeAsync(round.intervalMs - 10_000);
activeClient.heartbeatReportsRtt(round.baseline);
await controller.runProbeCycleNow();
await vi.advanceTimersByTimeAsync(10_000);
activeClient.heartbeatReportsRtt(round.spike);
latencies[relayAlternate.id] = round.alternate;
await controller.runProbeCycleNow();
}
expect(alternateProbes).toBe(4);
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
expect(controller.getSnapshot().client).toBe(activeClient);
expect(activeClient.isDisposed()).toBe(false);
await controller.stop();
});
it("requires a proportional RTT improvement before switching away from a high-latency link", async () => {
useHostRuntimeClock();
const host = makeHost({
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
const latencies: Record<string, number | Error> = {
[relayPrimary.id]: 300,
[relayAlternate.id]: 320,
};
const controller = new HostRuntimeController({
host,
deps: makeDeps(latencies, clients),
});
await controller.start({ autoProbe: false });
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
const activeClient = controller.getSnapshot().client as unknown as FakeDaemonClient;
// 60 ms faster on a 300 ms link (20%) is noise, not enough to justify a switch.
activeClient.heartbeatReportsRtt(300);
latencies[relayAlternate.id] = 240;
for (let index = 0; index < 3; index += 1) {
await vi.advanceTimersByTimeAsync(30 * 60_000);
await controller.runProbeCycleNow();
}
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
// 150 ms faster on a 300 ms link (50%) is a real win and switches after 3 consecutive probes.
latencies[relayAlternate.id] = 150;
for (let index = 0; index < 3; index += 1) {
await vi.advanceTimersByTimeAsync(index === 0 ? 30 * 60_000 : 120_000);
await controller.runProbeCycleNow();
}
expect(controller.getSnapshot().activeConnectionId).toBe(relayAlternate.id);
await controller.stop();
});
it("exponentially backs off inactive connection probes while the active connection keeps winning", async () => {
useHostRuntimeClock();
const host = makeHost({
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
let alternateProbes = 0;
const baseDeps = makeDeps(
{
[relayPrimary.id]: 250,
[relayAlternate.id]: 260,
},
clients,
);
const controller = new HostRuntimeController({
host,
deps: {
...baseDeps,
connectToDaemon: async (input) => {
if (input.connection.id === relayAlternate.id) {
alternateProbes += 1;
}
return baseDeps.connectToDaemon(input);
},
},
});
await controller.start({ autoProbe: false });
const activeClient = controller.getSnapshot().client as unknown as FakeDaemonClient;
activeClient.heartbeatReportsRtt(250);
expect(alternateProbes).toBe(1);
// First inactive online probe runs at 2m -> active wins, next interval backs off to 4m.
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
expect(alternateProbes).toBe(2);
// At +2m (still < 4m), no inactive probe runs.
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
expect(alternateProbes).toBe(2);
// At +4m total, second inactive probe runs -> backs off to 8m.
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
expect(alternateProbes).toBe(3);
// At +6m (< 8m), still quiet; at +8m, third inactive probe runs -> backs off to 16m.
await vi.advanceTimersByTimeAsync(6 * 60_000);
await controller.runProbeCycleNow();
expect(alternateProbes).toBe(3);
await vi.advanceTimersByTimeAsync(2 * 60_000);
await controller.runProbeCycleNow();
expect(alternateProbes).toBe(4);
// Foreground verification resets backoff back to 2m without forcing an immediate probe.
await vi.advanceTimersByTimeAsync(3 * 60_000);
controller.ensureConnected({ verify: true });
await controller.runProbeCycleNow();
expect(alternateProbes).toBe(5);
await controller.stop();
});
it("keeps the active connection online while connecting the replacement during an adaptive switch", async () => {
useHostRuntimeClock();
const host = makeHost({
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
const latencies: Record<string, number | Error> = {
[relayPrimary.id]: 300,
[relayAlternate.id]: 320,
};
let replacementConnectGate: ReturnType<typeof createDeferred<void>> | null = null;
let shouldFailReplacement = false;
const baseDeps = makeDeps(latencies, clients);
const controller = new HostRuntimeController({
host,
deps: {
...baseDeps,
createClient: (input) => {
const client = baseDeps.createClient(input) as unknown as FakeDaemonClient;
if (input.connection.id === relayAlternate.id) {
const origConnect = client.connect.bind(client);
client.connect = async () => {
if (replacementConnectGate) {
await replacementConnectGate.promise;
}
if (shouldFailReplacement) {
throw new Error("replacement handshake failed");
}
return origConnect();
};
}
return client as unknown as DaemonClient;
},
},
});
await controller.start({ autoProbe: false });
const initialClient = controller.getSnapshot().client as unknown as FakeDaemonClient;
initialClient.heartbeatReportsRtt(300);
latencies[relayAlternate.id] = 100;
const observedSnapshots: Array<{
status: string;
connectionId: string | null;
hasClient: boolean;
}> = [];
const unsubscribe = controller.subscribe(() => {
const snap = controller.getSnapshot();
observedSnapshots.push({
status: snap.connectionStatus,
connectionId: snap.activeConnectionId,
hasClient: snap.client !== null,
});
});
// Two wins first.
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
// Third win triggers a switch, but replacement connect fails: active client must stay online.
shouldFailReplacement = true;
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
expect(controller.getSnapshot().connectionStatus).toBe("online");
expect(controller.getSnapshot().client).toBe(initialClient);
expect(initialClient.isDisposed()).toBe(false);
// Now let replacement succeed after a delay: host must stay online on initialClient while
// replacement connects, and never emit connecting or client=null.
shouldFailReplacement = false;
observedSnapshots.length = 0;
for (let index = 0; index < 2; index += 1) {
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
}
replacementConnectGate = createDeferred<void>();
await vi.advanceTimersByTimeAsync(120_000);
const switchingCycle = controller.runProbeCycleNow();
await vi.advanceTimersByTimeAsync(0);
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
expect(controller.getSnapshot().connectionStatus).toBe("online");
expect(controller.getSnapshot().client).toBe(initialClient);
expect(initialClient.isDisposed()).toBe(false);
replacementConnectGate.resolve();
await switchingCycle;
expect(controller.getSnapshot().activeConnectionId).toBe(relayAlternate.id);
expect(controller.getSnapshot().connectionStatus).toBe("online");
expect(controller.getSnapshot().client).not.toBeNull();
expect(controller.getSnapshot().client).not.toBe(initialClient);
expect(initialClient.isDisposed()).toBe(true);
expect(observedSnapshots.some((snap) => snap.status !== "online" || !snap.hasClient)).toBe(
false,
);
unsubscribe();
await controller.stop();
});
it("keeps active client status updates working after a failed make-before-break upgrade", async () => {
useHostRuntimeClock();
const host = makeHost({
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
const latencies: Record<string, number | Error> = {
[relayPrimary.id]: 300,
[relayAlternate.id]: 320,
};
const baseDeps = makeDeps(latencies, clients);
const controller = new HostRuntimeController({
host,
deps: {
...baseDeps,
createClient: (input) => {
const client = baseDeps.createClient(input) as unknown as FakeDaemonClient;
if (input.connection.id === relayAlternate.id) {
client.connect = async () => {
throw new Error("replacement handshake failed");
};
}
return client as unknown as DaemonClient;
},
},
});
await controller.start({ autoProbe: false });
const initialClient = controller.getSnapshot().client as unknown as FakeDaemonClient;
initialClient.heartbeatReportsRtt(300);
latencies[relayAlternate.id] = 100;
for (let index = 0; index < 3; index += 1) {
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
}
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
expect(controller.getSnapshot().connectionStatus).toBe("online");
initialClient.setConnectionState({ status: "disconnected", reason: "transport closed" });
expect(controller.getSnapshot().connectionStatus).toBe("error");
expect(controller.getSnapshot().lastError).toBe("transport closed");
await controller.stop();
});
it("aborts a pending make-before-break upgrade when the candidate connection is removed", async () => {
useHostRuntimeClock();
const host = makeHost({
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
const latencies: Record<string, number | Error> = {
[relayPrimary.id]: 300,
[relayAlternate.id]: 320,
};
const replacementGate = createDeferred<void>();
const replacementClients: FakeDaemonClient[] = [];
const baseDeps = makeDeps(latencies, clients);
const controller = new HostRuntimeController({
host,
deps: {
...baseDeps,
createClient: (input) => {
const client = baseDeps.createClient(input) as unknown as FakeDaemonClient;
if (input.connection.id === relayAlternate.id) {
replacementClients.push(client);
const origConnect = client.connect.bind(client);
client.connect = async () => {
await replacementGate.promise;
return origConnect();
};
}
return client as unknown as DaemonClient;
},
},
});
await controller.start({ autoProbe: false });
const initialClient = controller.getSnapshot().client as unknown as FakeDaemonClient;
initialClient.heartbeatReportsRtt(300);
latencies[relayAlternate.id] = 100;
for (let index = 0; index < 2; index += 1) {
await vi.advanceTimersByTimeAsync(120_000);
await controller.runProbeCycleNow();
}
await vi.advanceTimersByTimeAsync(120_000);
const switchingCycle = controller.runProbeCycleNow();
await vi.advanceTimersByTimeAsync(0);
expect(replacementClients).toHaveLength(1);
const updatePromise = controller.updateHost({
...host,
connections: [relayPrimary],
});
await vi.advanceTimersByTimeAsync(0);
replacementGate.resolve();
await Promise.all([switchingCycle, updatePromise]);
expect(controller.getSnapshot().activeConnectionId).toBe(relayPrimary.id);
expect(controller.getSnapshot().connectionStatus).toBe("online");
expect(controller.getSnapshot().client).toBe(initialClient);
expect(initialClient.isDisposed()).toBe(false);
expect(replacementClients[0]?.isDisposed()).toBe(true);
await controller.stop();
});
it("runs store cache recovery when a make-before-break adaptive switch advances the online epoch", async () => {
useHostRuntimeClock();
const host = makeHost({
serverId: "srv_upgrade_cache_recovery",
connections: [relayPrimary, relayAlternate],
preferredConnectionId: relayPrimary.id,
});
const clients: FakeDaemonClient[] = [];
const latencies: Record<string, number | Error> = {
[relayPrimary.id]: 300,
[relayAlternate.id]: 320,
};
const store = new HostRuntimeStore({
storage: createMemoryHostRuntimeStorage(),
deps: makeDeps(latencies, clients),
});
const queryKey = checkoutStatusQueryKey(host.serverId, "/repo");
try {
store.syncHosts([host]);
await vi.advanceTimersByTimeAsync(0);
expect(store.getSnapshot(host.serverId)?.connectionStatus).toBe("online");
const initialEpoch = store.getSnapshot(host.serverId)?.connectionEpoch ?? 0;
const activeClient = store.getSnapshot(host.serverId)?.client as unknown as FakeDaemonClient;
const initialHistoryGen =
useSessionStore.getState().sessions[host.serverId]?.historySyncGeneration ?? 0;
queryClient.setQueryData(queryKey, { branch: "main" });
expect(queryClient.getQueryState(queryKey)?.isInvalidated).toBe(false);
activeClient.heartbeatReportsRtt(300);
latencies[relayAlternate.id] = 100;
for (let index = 0; index < 3; index += 1) {
await vi.advanceTimersByTimeAsync(120_000);
await store.runProbeCycleNow(host.serverId);
}
expect(store.getSnapshot(host.serverId)?.activeConnectionId).toBe(relayAlternate.id);
expect(store.getSnapshot(host.serverId)?.connectionStatus).toBe("online");
expect(store.getSnapshot(host.serverId)?.connectionEpoch).toBeGreaterThan(initialEpoch);
expect(queryClient.getQueryState(queryKey)?.isInvalidated).toBe(true);
expect(
useSessionStore.getState().sessions[host.serverId]?.historySyncGeneration ?? 0,
).toBeGreaterThan(initialHistoryGen);
} finally {
queryClient.removeQueries({ queryKey });
store.syncHosts([]);
}
});
it("exposes one snapshot with active connection and status from same source", async () => {
const host = makeHost();
const clients: FakeDaemonClient[] = [];
+63 -242
View File
@@ -245,11 +245,8 @@ export interface HostRuntimeStartOptions {
const PROBE_TICK_MS = 2_000;
const PROBE_STEADY_MS = 10_000;
const PROBE_MAX_BACKOFF_MS = 30_000;
const PROBE_INACTIVE_WHILE_ONLINE_INITIAL_MS = 120_000;
const PROBE_INACTIVE_WHILE_ONLINE_MAX_MS = 30 * 60_000;
const ACTIVE_RTT_WINDOW_MS = 60_000;
const PROBE_INACTIVE_WHILE_ONLINE_MS = 120_000;
const ADAPTIVE_SWITCH_THRESHOLD_MS = 40;
const ADAPTIVE_SWITCH_MIN_IMPROVEMENT_RATIO = 0.35;
const ADAPTIVE_SWITCH_CONSECUTIVE_PROBES = 3;
const CONFIGURED_OVERRIDE_BOOTSTRAP_RETRY_MS = 1_000;
@@ -552,14 +549,13 @@ function probeIntervalForConnection(
firstSeenAt: number,
isActiveOnline: boolean,
hasActiveOnlineConnection: boolean,
inactiveOnlineIntervalMs: number,
now: number,
): number {
if (isActiveOnline) {
return PROBE_STEADY_MS;
}
if (hasActiveOnlineConnection) {
return inactiveOnlineIntervalMs;
return PROBE_INACTIVE_WHILE_ONLINE_MS;
}
const age = now - firstSeenAt;
if (age < 10_000) return 2_000;
@@ -732,8 +728,6 @@ export class HostRuntimeController {
private connectionLastProbedAt = new Map<string, number>();
private switchCandidateConnectionId: string | null = null;
private switchCandidateHitCount = 0;
private inactiveOnlineProbeBackoffStep = 0;
private activeRttSamples: Array<{ at: number; rttMs: number }> = [];
private clientIdPromise: Promise<string> | null = null;
private clientIdHash: string | null = null;
private switchRequestVersion = 0;
@@ -829,9 +823,6 @@ export class HostRuntimeController {
this.activeClient = null;
await prev.close().catch(() => undefined);
}
this.resetSwitchCandidate();
this.clearActiveRttSamples();
this.resetInactiveOnlineProbeBackoff();
this.applyConnectionEvent({ type: "stopped" });
this.updateSnapshot({
...toSnapshotConnectionPatch(this.connectionMachineState, this.connectionEpoch),
@@ -841,15 +832,11 @@ export class HostRuntimeController {
async updateHost(host: HostProfile): Promise<void> {
const passwordChanged = this.host.password !== host.password;
const connectionsChanged = !equal(this.host.connections, host.connections);
if (passwordChanged) {
this.probeRequestVersion += 1;
this.authRejectedConnectionIds.clear();
this.updateSnapshot({ authFailureReason: null });
}
if (passwordChanged || connectionsChanged) {
this.resetInactiveOnlineProbeBackoff();
}
const activeConnectionId = this.snapshot.activeConnectionId;
const previousActiveConnection = findConnectionById(this.host, activeConnectionId);
this.host = host;
@@ -875,9 +862,6 @@ export class HostRuntimeController {
}
ensureConnected(options?: { verify?: boolean }): void {
if (options?.verify) {
this.resetInactiveOnlineProbeBackoff();
}
this.activeClient?.ensureConnected(options);
}
@@ -978,7 +962,6 @@ export class HostRuntimeController {
const activeConnectionId = this.snapshot.activeConnectionId;
const hasActiveOnlineConnection = isOnline && activeConnectionId !== null;
const inactiveOnlineIntervalMs = this.inactiveOnlineProbeIntervalMs();
const connectionsToProbe = this.host.connections.filter((connection) => {
if (this.authRejectedConnectionIds.has(connection.id)) return false;
const lastProbed = this.connectionLastProbedAt.get(connection.id);
@@ -991,7 +974,6 @@ export class HostRuntimeController {
firstSeen,
isActiveOnline,
hasActiveOnlineConnection,
inactiveOnlineIntervalMs,
now,
);
return now - lastProbed >= interval;
@@ -1099,10 +1081,10 @@ export class HostRuntimeController {
// Adaptive switching counts fresh comparisons only. The probe map keeps the last known
// sample per connection for display and failover; a streak hit needs a candidate measured
// in this cycle and a baseline RTT from the socket that is active right now. Using the
// rolling minimum of recent active heartbeats filters out single busy/stalled ticks so a
// loaded working socket does not lose to an idle probe, and a proportional threshold avoids
// flapping on normal jitter on high-RTT links.
// in this cycle and a heartbeat RTT from the socket that is active right now. Re-reading
// the cached map at every ten-second active tick turned one idle-probe sample into three
// "consecutive" wins, and a reconnected socket inherited its predecessor's RTT, so a
// working relay connection was replaced within seconds of coming online.
const sampledCandidates = connectionsToProbe.filter(
(connection) => connection.id !== currentActiveConnectionId,
);
@@ -1120,29 +1102,22 @@ export class HostRuntimeController {
})
.sort((left, right) => left.latencyMs - right.latencyMs)[0] ?? null;
if (!fastest) {
// Every candidate sampled this cycle failed: that breaks the streak and backs off.
// Every candidate sampled this cycle failed: that breaks the streak.
this.resetSwitchCandidate();
this.advanceInactiveOnlineProbeBackoff();
return;
}
const activeRttMs = this.currentActiveSocketBaselineRttMs(performance.now());
const activeRttMs = this.currentActiveSocketRttMs();
if (activeRttMs === null) {
return;
}
const requiredImprovementMs = Math.max(
ADAPTIVE_SWITCH_THRESHOLD_MS,
activeRttMs * ADAPTIVE_SWITCH_MIN_IMPROVEMENT_RATIO,
);
const improvement = activeRttMs - fastest.latencyMs;
if (improvement < requiredImprovementMs) {
if (improvement < ADAPTIVE_SWITCH_THRESHOLD_MS) {
this.resetSwitchCandidate();
this.advanceInactiveOnlineProbeBackoff();
return;
}
this.resetInactiveOnlineProbeBackoff();
if (this.switchCandidateConnectionId === fastest.connectionId) {
this.switchCandidateHitCount += 1;
} else {
@@ -1155,7 +1130,6 @@ export class HostRuntimeController {
await this.switchToConnection({
connectionId: fastest.connectionId,
expectedProbeVersion: requestVersion,
keepActiveUntilConnected: true,
});
}
};
@@ -1220,7 +1194,6 @@ export class HostRuntimeController {
return;
}
if (rttMs !== null) {
this.recordActiveRttSample(rttMs, performance.now());
probeByConnectionId.set(connection.id, {
status: "available",
latencyMs: rttMs,
@@ -1272,45 +1245,6 @@ export class HostRuntimeController {
return client.getLastLivenessRttMs();
}
private recordActiveRttSample(rttMs: number, now: number): void {
this.activeRttSamples = this.activeRttSamples.filter(
(sample) => now - sample.at <= ACTIVE_RTT_WINDOW_MS,
);
this.activeRttSamples.push({ at: now, rttMs });
}
private clearActiveRttSamples(): void {
this.activeRttSamples = [];
}
private currentActiveSocketBaselineRttMs(now: number): number | null {
const currentRttMs = this.currentActiveSocketRttMs();
if (currentRttMs === null) return null;
this.recordActiveRttSample(currentRttMs, now);
let baseline = this.activeRttSamples[0]!.rttMs;
for (const sample of this.activeRttSamples) {
if (sample.rttMs < baseline) baseline = sample.rttMs;
}
return baseline;
}
private inactiveOnlineProbeIntervalMs(): number {
return Math.min(
PROBE_INACTIVE_WHILE_ONLINE_INITIAL_MS * 2 ** this.inactiveOnlineProbeBackoffStep,
PROBE_INACTIVE_WHILE_ONLINE_MAX_MS,
);
}
private advanceInactiveOnlineProbeBackoff(): void {
if (this.inactiveOnlineProbeIntervalMs() < PROBE_INACTIVE_WHILE_ONLINE_MAX_MS) {
this.inactiveOnlineProbeBackoffStep += 1;
}
}
private resetInactiveOnlineProbeBackoff(): void {
this.inactiveOnlineProbeBackoffStep = 0;
}
private resetSwitchCandidate(): void {
this.switchCandidateConnectionId = null;
this.switchCandidateHitCount = 0;
@@ -1500,7 +1434,6 @@ export class HostRuntimeController {
connectionId: string;
expectedProbeVersion?: number;
existingClient?: DaemonClient;
keepActiveUntilConnected?: boolean;
}): Promise<void> {
const { connectionId, expectedProbeVersion, existingClient } = input;
if (!this.canProceedForProbe(expectedProbeVersion)) {
@@ -1522,24 +1455,6 @@ export class HostRuntimeController {
return;
}
const makeBeforeBreak =
Boolean(input.keepActiveUntilConnected) &&
!existingClient &&
this.activeClient !== null &&
this.connectionMachineState.tag === "online";
const nextGeneration = this.snapshot.clientGeneration + 1;
if (makeBeforeBreak) {
await this.switchToConnectionMakeBeforeBreak({
connection,
clientId,
nextGeneration,
requestVersion,
expectedProbeVersion,
});
return;
}
await this.disposePreviousActiveClient();
if (!this.isSwitchStillValid(requestVersion, expectedProbeVersion)) {
@@ -1547,6 +1462,7 @@ export class HostRuntimeController {
return;
}
const nextGeneration = this.snapshot.clientGeneration + 1;
const client =
existingClient ??
this.deps.createClient({
@@ -1563,8 +1479,6 @@ export class HostRuntimeController {
}
this.activeClient = client;
this.clearActiveRttSamples();
this.resetInactiveOnlineProbeBackoff();
this.applyConnectionEvent({
type: "select_connection",
connectionId: connection.id,
@@ -1576,148 +1490,67 @@ export class HostRuntimeController {
client: null,
});
try {
if (!existingClient) await client.connect();
const failConnection = async (error: unknown) => {
if (!this.isCurrentSwitchRequest(requestVersion) || this.activeClient !== client) return;
this.attachActiveClient({ client, connection });
} catch (error) {
await this.failActiveConnection({ client, connection, error });
}
}
private async switchToConnectionMakeBeforeBreak(input: {
connection: HostConnection;
clientId: string;
nextGeneration: number;
requestVersion: number;
expectedProbeVersion?: number;
}): Promise<void> {
const { connection, clientId, nextGeneration, requestVersion, expectedProbeVersion } = input;
const replacement = this.deps.createClient({
host: this.host,
connection,
clientId,
runtimeGeneration: nextGeneration,
});
replacement.setReconnectEnabled(false);
try {
await replacement.connect();
} catch (error) {
const authFailure = getConnectionAuthFailureReason(error);
if (authFailure) this.authRejectedConnectionIds.add(connection.id);
this.unsubscribeClientStatus?.();
this.unsubscribeClientStatus = null;
this.unsubscribeClientHandlers?.();
this.unsubscribeClientHandlers = null;
client.setReconnectEnabled(false);
this.applyConnectionEvent({ type: "connect_failed", message: toErrorMessage(error) });
this.updateSnapshot({
...toSnapshotConnectionPatch(this.connectionMachineState, this.connectionEpoch),
client: null,
authFailureReason: authFailure,
});
if (authFailure) {
this.authRejectedConnectionIds.add(connection.id);
const probes = new Map(this.snapshot.probeByConnectionId);
probes.set(connection.id, { status: "unavailable", latencyMs: null });
this.updateSnapshot({ probeByConnectionId: probes });
}
await replacement.close().catch(() => undefined);
return;
}
const resolveValidTarget = (): HostConnection | null => {
if (!this.isSwitchStillValid(requestVersion, expectedProbeVersion)) return null;
const saved = findConnectionById(this.host, connection.id);
if (!saved || connectionNeedsNewClient(connection, saved, replacement)) return null;
return saved;
};
if (!resolveValidTarget()) {
await replacement.close().catch(() => undefined);
return;
}
replacement.setReconnectEnabled(true);
await this.disposePreviousActiveClient();
const target = resolveValidTarget();
if (!target) {
await replacement.close().catch(() => undefined);
return;
}
this.activeClient = replacement;
this.clearActiveRttSamples();
this.resetInactiveOnlineProbeBackoff();
this.applyConnectionEvent({
type: "select_connection",
connectionId: target.id,
connection: toActiveConnection(target),
});
this.snapshot = { ...this.snapshot, clientGeneration: nextGeneration };
this.attachActiveClient({ client: replacement, connection: target });
}
private attachActiveClient(input: { client: DaemonClient; connection: HostConnection }): void {
const { client, connection } = input;
this.unsubscribeClientHandlers =
this.deps.mountClientHandlers?.({ client, host: this.host, connection }) ?? null;
this.unsubscribeClientStatus = client.subscribeConnectionStatus((state) => {
if (this.activeClient !== client) return;
if (client.authFailureReason) {
void this.failActiveConnection({
client,
connection,
error: new DaemonAuthenticationError(client.authFailureReason),
});
return;
}
if (state.status === "connected") this.learnRelaySecurity(client, connection.id);
// Switch evidence belongs to the socket it was measured against.
if (state.status !== "connected") {
this.resetSwitchCandidate();
this.clearActiveRttSamples();
this.resetInactiveOnlineProbeBackoff();
}
this.applyConnectionEvent({ type: "client_state", state, lastError: client.lastError });
this.updateSnapshot({
...toSnapshotConnectionPatch(this.connectionMachineState, this.connectionEpoch),
...this.buildAgentDirectoryStatusPatch(),
client,
authFailureReason: null,
});
});
}
private async failActiveConnection(input: {
client: DaemonClient;
connection: HostConnection;
error: unknown;
}): Promise<void> {
const { client, connection, error } = input;
if (this.activeClient !== client) return;
const authFailure = getConnectionAuthFailureReason(error);
if (authFailure) this.authRejectedConnectionIds.add(connection.id);
this.unsubscribeClientStatus?.();
this.unsubscribeClientStatus = null;
this.unsubscribeClientHandlers?.();
this.unsubscribeClientHandlers = null;
client.setReconnectEnabled(false);
this.applyConnectionEvent({ type: "connect_failed", message: toErrorMessage(error) });
this.updateSnapshot({
...toSnapshotConnectionPatch(this.connectionMachineState, this.connectionEpoch),
client: null,
authFailureReason: authFailure,
});
if (authFailure) {
const probes = new Map(this.snapshot.probeByConnectionId);
probes.set(connection.id, { status: "unavailable", latencyMs: null });
this.updateSnapshot({ probeByConnectionId: probes });
for (const candidate of this.host.connections) {
if (!this.authRejectedConnectionIds.has(candidate.id)) {
this.connectionLastProbedAt.delete(candidate.id);
for (const candidate of this.host.connections) {
if (!this.authRejectedConnectionIds.has(candidate.id)) {
this.connectionLastProbedAt.delete(candidate.id);
}
}
}
}
try {
await client.close();
} catch {
/* Preserve the compatibility/connection error. */
}
if (
authFailure &&
this.host.connections.some((candidate) => !this.authRejectedConnectionIds.has(candidate.id))
) {
void this.runProbeCycleNow();
}
};
try {
await client.close();
} catch {
/* Preserve the compatibility/connection error. */
}
if (
authFailure &&
this.host.connections.some((candidate) => !this.authRejectedConnectionIds.has(candidate.id))
) {
void this.runProbeCycleNow();
if (!existingClient) await client.connect();
if (!this.isCurrentSwitchRequest(requestVersion) || this.activeClient !== client) return;
this.unsubscribeClientHandlers =
this.deps.mountClientHandlers?.({ client, host: this.host, connection }) ?? null;
this.unsubscribeClientStatus = client.subscribeConnectionStatus((state) => {
if (!this.isCurrentSwitchRequest(requestVersion) || this.activeClient !== client) return;
if (client.authFailureReason) {
void failConnection(new DaemonAuthenticationError(client.authFailureReason));
return;
}
if (state.status === "connected") this.learnRelaySecurity(client, connection.id);
// Switch evidence belongs to the socket it was measured against.
if (state.status !== "connected") this.resetSwitchCandidate();
this.applyConnectionEvent({ type: "client_state", state, lastError: client.lastError });
this.updateSnapshot({
...toSnapshotConnectionPatch(this.connectionMachineState, this.connectionEpoch),
...this.buildAgentDirectoryStatusPatch(),
client,
authFailureReason: null,
});
});
} catch (error) {
await failConnection(error);
}
}
@@ -1860,7 +1693,6 @@ export class HostRuntimeStore {
private hostRegistryStatus: HostRegistryStatus = "loading";
private deps: HostRuntimeControllerDeps;
private lastConnectionStatusByServer = new Map<string, HostRuntimeConnectionStatus>();
private lastOnlineEpochByServer = new Map<string, number>();
private connectionStatusStartedAtByServer = new Map<string, number>();
private queuedAgentDrainInFlight = new Set<string>();
private directorySyncByServer = new Map<string, DirectorySync>();
@@ -2118,7 +1950,6 @@ export class HostRuntimeStore {
rekeyMap(this.controllers, oldServerId, newServerId);
rekeyMap(this.lastConnectionStatusByServer, oldServerId, newServerId);
rekeyMap(this.lastOnlineEpochByServer, oldServerId, newServerId);
rekeyMap(this.connectionStatusStartedAtByServer, oldServerId, newServerId);
this.replicaCache.reconcileServerId(oldServerId, newServerId);
projectIconCache.reconcileServerId(oldServerId, newServerId);
@@ -2611,7 +2442,6 @@ export class HostRuntimeStore {
this.fleetDirectoryDemand.delete(serverId);
this.controllers.delete(serverId);
this.lastConnectionStatusByServer.delete(serverId);
this.lastOnlineEpochByServer.delete(serverId);
this.connectionStatusStartedAtByServer.delete(serverId);
this.directorySyncByServer.get(serverId)?.dispose();
this.directorySyncByServer.delete(serverId);
@@ -2662,9 +2492,6 @@ export class HostRuntimeStore {
);
const initialSnapshot = controller.getSnapshot();
this.lastConnectionStatusByServer.set(host.serverId, initialSnapshot.connectionStatus);
if (initialSnapshot.connectionStatus === "online") {
this.lastOnlineEpochByServer.set(host.serverId, initialSnapshot.connectionEpoch);
}
this.connectionStatusStartedAtByServer.set(host.serverId, Date.now());
controller.subscribe(() => {
const snapshot = controller.getSnapshot();
@@ -2764,7 +2591,6 @@ export class HostRuntimeStore {
const controller = this.controllers.get(serverId);
if (!controller) {
this.lastConnectionStatusByServer.delete(serverId);
this.lastOnlineEpochByServer.delete(serverId);
this.connectionStatusStartedAtByServer.delete(serverId);
return;
}
@@ -2779,7 +2605,6 @@ export class HostRuntimeStore {
},
});
const previousStatus = this.lastConnectionStatusByServer.get(serverId);
const previousOnlineEpoch = this.lastOnlineEpochByServer.get(serverId);
const statusChanged = previousStatus !== snapshot.connectionStatus;
const isUnavailable =
snapshot.connectionStatus !== "online" && snapshot.connectionStatus !== "idle";
@@ -2790,11 +2615,7 @@ export class HostRuntimeStore {
}
this.lastConnectionStatusByServer.set(serverId, snapshot.connectionStatus);
const didTransitionOnline =
snapshot.connectionStatus === "online" &&
(previousStatus !== "online" || previousOnlineEpoch !== snapshot.connectionEpoch);
if (snapshot.connectionStatus === "online") {
this.lastOnlineEpochByServer.set(serverId, snapshot.connectionEpoch);
}
snapshot.connectionStatus === "online" && previousStatus !== "online";
if (didTransitionOnline) {
useSessionStore.getState().bumpHistorySyncGeneration(serverId);
for (const child of this.controllers.values()) void child.reconnectVia(serverId);
@@ -24,7 +24,6 @@ import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region";
import { MenuHeader } from "@/components/headers/menu-header";
import { useIsCompactFormFactor } from "@/constants/layout";
import { useToast } from "@/contexts/toast-context";
import { draftCreationKey } from "@/composer/draft/creation-key";
import { useAgentInputDraft } from "@/composer/draft/input-draft";
import { useForgeSearchQuery } from "@/git/use-forge-search-query";
import { getForgePresentation } from "@/git/forge";
@@ -337,7 +336,6 @@ interface WorkspaceCreationResult {
async function createMultiplicityWorkspace(input: {
idempotencyKey: string;
launchTarget: LaunchTarget;
worktreeSlug: string;
client: NonNullable<ReturnType<typeof useHostRuntimeClient>>;
isolation: "local" | "worktree";
@@ -367,8 +365,10 @@ async function createMultiplicityWorkspace(input: {
prompt: input.prompt,
attachments: input.attachments,
});
const request: Omit<CreateWorkspaceRequestOptions, "idempotencyKey" | "onEvent"> = {
const payload = await input.client.createWorkspace({
idempotencyKey: input.idempotencyKey,
agent: input.agent,
onEvent: input.onEvent,
source: isWorktree
? {
kind: "worktree",
@@ -387,14 +387,6 @@ async function createMultiplicityWorkspace(input: {
},
...(firstAgentContext ? { firstAgentContext } : {}),
...(Object.keys(input.metadata).length > 0 ? { metadata: { ...input.metadata } } : {}),
};
const payload = await input.client.createWorkspace({
...request,
idempotencyKey: draftCreationKey(input.idempotencyKey, {
request,
launchTarget: input.launchTarget,
}),
onEvent: input.onEvent,
});
if (payload.error || !payload.workspace) {
throw new Error(payload.error ?? input.createFailedMessage);
@@ -516,7 +508,7 @@ async function createWorkspaceChatAgent(input: CreateChatAgentInput): Promise<Su
});
const images = await encodeImages(wirePayload.images);
let navigated = false;
const delivery: { outcome: SubmitOutcome } = { outcome: "background" };
let outcome: SubmitOutcome = "background";
const initialAgent: NonNullable<CreateWorkspaceRequestOptions["agent"]> = {
config: {
provider,
@@ -553,7 +545,7 @@ async function createWorkspaceChatAgent(input: CreateChatAgentInput): Promise<Su
provider,
composerState,
});
delivery.outcome = submitWorkspaceDraft({
outcome = submitWorkspaceDraft({
clearConsumedDraft,
draftKey: input.draftKey,
draftContextScopeKey: input.draftContextScopeKey,
@@ -579,15 +571,9 @@ async function createWorkspaceChatAgent(input: CreateChatAgentInput): Promise<Su
};
// A retry after a failed agent start belongs to the ready workspace's draft, not to this creation.
const agentCreation = { result: Promise.resolve().then(() => execute()) };
try {
await agentCreation.result;
} catch (error) {
// Once handed off to the workspace draft tab, that tab owns surfacing agent startup errors.
if (delivery.outcome === "navigated") return delivery.outcome;
throw error;
}
if (delivery.outcome === "background") clearConsumedDraft();
return delivery.outcome;
await agentCreation.result;
if (outcome === "background") clearConsumedDraft();
return outcome;
}
function buildComposerConfig(input: {
@@ -1363,7 +1349,6 @@ export function NewWorkspaceScreen({
: undefined;
const normalizedWorkspace = await createMultiplicityWorkspace({
idempotencyKey: creationIdentity.draftId,
launchTarget,
worktreeSlug: creationIdentity.worktreeSlug,
client: connectedClient,
isolation: createsWorktree ? "worktree" : "local",
@@ -1388,7 +1373,6 @@ export function NewWorkspaceScreen({
creationIdentity,
creationResult,
effectiveIsolation,
launchTarget,
mergeWorkspaces,
queryClient,
selectedItem,
@@ -1459,9 +1443,7 @@ export function NewWorkspaceScreen({
const message = toErrorMessage(error);
setPendingAction(null);
setErrorMessage(message);
if (!isStillOnCreateScreen()) {
toast.error(message);
}
toast.error(message);
}
},
[
@@ -1542,9 +1524,7 @@ export function NewWorkspaceScreen({
const message = toErrorMessage(error);
setPendingAction(null);
setErrorMessage(message);
if (!isStillOnCreateScreen()) {
toast.error(message);
}
toast.error(message);
}
}, [
ensureWorkspace,
@@ -1682,7 +1662,6 @@ export function NewWorkspaceScreen({
clearDraft={noopClearDraft}
autoFocus={terminalTakesPrompt}
autoFocusKey={launchFocusKey}
error={errorMessage}
/>
) : (
<Composer
@@ -1714,7 +1693,6 @@ export function NewWorkspaceScreen({
autoFocusKey={launchFocusKey}
commandDraft={composerState?.commandDraft}
agentControls={agentControlsWithDisabled}
error={errorMessage}
/>
);
return (
@@ -1727,6 +1705,7 @@ export function NewWorkspaceScreen({
onImportSession={importSession.open}
>
{composer}
{errorMessage ? <Text style={styles.errorText}>{errorMessage}</Text> : null}
</NewWorkspaceLayout>
{importSession.sheet}
</FileDropZone>
@@ -1888,6 +1867,11 @@ const styles = StyleSheet.create((theme) => ({
fontWeight: theme.fontWeight.normal,
color: theme.colors.foreground,
},
errorText: {
fontSize: theme.fontSize.base,
color: theme.colors.destructive,
lineHeight: 20,
},
}));
/**
+3 -86
View File
@@ -5,10 +5,8 @@ import { i18n } from "@/i18n/i18next";
import { UsageWindowBar } from "./window-bar";
import type { UsageBalance, UsageWindow } from "./types";
import { UsageBalanceBar } from "./balance-bar";
import { UsageMeter } from "./meter";
const window: UsageWindow = { id: "session", label: "Session", usedPct: 70 };
const exhaustedWindow: UsageWindow = { ...window, usedPct: 100 };
const balance: UsageBalance = { id: "credits", label: "Credits", unit: "usd", remaining: 12 };
const ignorePin = () => {};
@@ -55,97 +53,16 @@ it("translates mounted usage rows when the language changes", async () => {
expect(container.textContent).toContain("クレジット");
});
it("colors healthy quota bars green and keeps the warning and danger colors", () => {
act(() =>
root.render(
<>
<UsageMeter percent={20} tone="default" />
<UsageMeter percent={20} tone="ok" />
<UsageMeter percent={20} tone="warning" />
<UsageMeter percent={20} tone="danger" />
<UsageMeter percent={20} tone="danger" quiet />
</>,
),
);
const colors = Array.from(
container.children,
(track) => getComputedStyle(track.firstElementChild!).backgroundColor,
);
expect(colors).toEqual([
"rgb(21, 128, 61)",
"rgb(21, 128, 61)",
"rgb(217, 119, 6)",
"rgb(185, 28, 28)",
"rgb(212, 212, 216)",
]);
});
it("keeps an exhausted quota red when a failed refresh removes its forecast", () => {
act(() =>
root.render(
<UsageWindowBar
window={exhaustedWindow}
forecastAt={null}
retained
displayAs="used"
pinnable={false}
pinned={false}
onTogglePin={ignorePin}
pinLabel=""
pinTestID=""
/>,
),
);
expect(container.textContent).toBe("Session100% used");
const fill = container.firstElementChild!.children[1].firstElementChild!;
expect(getComputedStyle(fill).backgroundColor).toBe("rgb(185, 28, 28)");
});
const narrowReadingMs = Date.now();
const narrowForecastAt = new Date(narrowReadingMs).toISOString();
const narrowWindow: UsageWindow = {
id: "weekly",
label: "Weekly",
usedPct: 6,
usedPct: 0.2,
durationSeconds: 604_800,
resetsAt: new Date(narrowReadingMs + 165.5 * 3_600_000).toISOString(),
};
const onTrackWindow: UsageWindow = {
id: "session",
label: "Session",
usedPct: 40,
durationSeconds: 18_000,
resetsAt: new Date(narrowReadingMs + 3_600_000).toISOString(),
};
const tightWindow: UsageWindow = { ...onTrackWindow, usedPct: 77 };
it.each([
["green", onTrackWindow, "rgb(21, 128, 61)"],
["amber", tightWindow, "rgb(217, 119, 6)"],
] as const)("shows only the reset details for an on-track %s bar", (_, usageWindow, color) => {
act(() =>
root.render(
<UsageWindowBar
window={usageWindow}
forecastAt={narrowForecastAt}
displayAs="used"
pinnable={false}
pinned={false}
onTogglePin={ignorePin}
pinLabel=""
pinTestID=""
/>,
),
);
const row = container.firstElementChild!;
const [label, track, datapoints] = row.children;
expect(label.textContent).toBe(`Session${usageWindow.usedPct}% used`);
expect(datapoints.textContent).toMatch(/^resets in [^·]+\s· [^·]+$/);
expect(getComputedStyle(track.firstElementChild!).backgroundColor).toBe(color);
});
it("shows the forecast as one more datapoint after the reset countdown, in the same line", async () => {
act(() =>
root.render(
@@ -165,7 +82,7 @@ it("shows the forecast as one more datapoint after the reset countdown, in the s
const line = Array.from(container.querySelectorAll("*")).find((node) =>
node.textContent.startsWith("resets in"),
);
expect(line?.textContent).toMatch(/^resets in [^·]+\s· [^·]+\s· runs out .+$/);
expect(line?.textContent).toMatch(/^resets in .+\s· .+\s· ~\d+% left at reset$/);
});
it("wraps the forecast below the countdown in a narrow French card instead of overlapping it", async () => {
@@ -197,6 +114,6 @@ it("wraps the forecast below the countdown in a narrow French card instead of ov
}
const countdown = textBounds("se réinitialise");
const forecast = textBounds("épuisement prévu");
const forecast = textBounds("~");
expect(forecast.left >= countdown.right || forecast.top >= countdown.bottom).toBe(true);
});
+18 -47
View File
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { i18n } from "@/i18n/i18next";
import {
formatDisplayPct,
@@ -38,9 +38,11 @@ describe("formatAmount", () => {
expect(formatPct(7, "en")).toBe("7%");
expect(formatResetLabel(twoHoursFromNow, false, NOW)).toBe("resets in 2h");
expect(formatRunsOutLabel(twoHoursFromNow, NOW)).toBe("runs out in 2h");
await i18n.changeLanguage("ja");
expect(formatResetLabel(twoHoursFromNow, false, NOW)).toBe("2時間後にリセット");
expect(formatRunsOutLabel(twoHoursFromNow, NOW)).toBe("2時間後に上限に到達");
expect(formatAgo(threeDaysAgo, NOW)).toBe("3日前");
});
@@ -55,15 +57,18 @@ describe("formatAmount", () => {
const daysAgo = new Date(NOW - days * 24 * 60 * 60 * 1000).toISOString();
expect(formatResetLabel(daysFromNow, false, NOW)).toBe("se réinitialise dans 1\u202f234 j");
expect(formatRunsOutLabel(daysFromNow, NOW)).toBe("s’épuise dans 1\u202f234 j");
expect(formatAgo(daysAgo, NOW)).toBe("il y a 1\u202f234 j");
});
it("selects Arabic plural forms for relative durations", async () => {
await i18n.changeLanguage("ar");
const twoHoursFromNow = new Date(NOW + 2 * 60 * 60 * 1000).toISOString();
const threeHoursFromNow = new Date(NOW + 3 * 60 * 60 * 1000).toISOString();
const twoDaysAgo = new Date(NOW - 2 * 24 * 60 * 60 * 1000).toISOString();
expect(formatResetLabel(twoHoursFromNow, false, NOW)).toBe("تتم إعادة التعيين خلال ساعتين");
expect(formatRunsOutLabel(threeHoursFromNow, NOW)).toBe("ينفد خلال 3 ساعات");
expect(formatAgo(twoDaysAgo, NOW)).toBe("قبل يومين");
});
@@ -106,21 +111,20 @@ describe("reset countdown", () => {
});
it("says two units, dropping a unit that is zero", () => {
expect(countdown(DAY + 30 * MINUTE)).toBe("resets in 1d");
expect(countdown(4 * HOUR + 59 * MINUTE)).toBe("resets in 4h 59m");
expect(countdown(HOUR)).toBe("resets in 1h");
expect(countdown(37 * MINUTE)).toBe("resets in 37m");
expect(countdown(59 * 1000)).toBe("resets in 0m");
});
it("shows a single day as 24 hours in the reset countdown", () => {
expect(countdown(DAY)).toBe("resets in 24h");
expect(countdown(DAY + 30 * MINUTE)).toBe("resets in 24h");
expect(countdown(DAY + HOUR)).toBe("resets in 1d 1h");
expect(countdown(2 * DAY)).toBe("resets in 2d");
it("joins the at-risk countdown the same way", () => {
const iso = new Date(NOW + 3 * HOUR + 5 * MINUTE).toISOString();
expect(formatRunsOutLabel(iso, NOW)).toBe("runs out in 3h 5m");
});
});
describe("exact quota times", () => {
describe("exact reset time", () => {
// Local-time dates, so the thresholds hold in any timezone the tests run in.
const now = new Date(2026, 9, 29, 12, 0).getTime();
const at = (...args: [number, number, number, number, number]) =>
@@ -130,51 +134,18 @@ describe("exact quota times", () => {
await i18n.changeLanguage("en");
});
it("shows only the time for the same local day", () => {
it("shows only the time within 24 hours", () => {
expect(at(2026, 9, 29, 15, 0)).toMatch(/^(3:00 PM|15:00)$/);
expect(at(2026, 9, 30, 11, 59)).toMatch(/^(11:59 AM|11:59)$/);
});
it("shows the weekday for tomorrow even when it is less than 24 hours away", () => {
expect(at(2026, 9, 30, 11, 59)).toMatch(/^Fri (11:59 AM|11:59)$/);
expect(at(2026, 10, 4, 15, 0)).toMatch(/^Wed (3:00 PM|15:00)$/);
it("adds the weekday within 7 days", () => {
expect(at(2026, 9, 30, 12, 0)).toMatch(/^Fri (12:00 PM|12:00)$/);
expect(at(2026, 10, 5, 11, 59)).toMatch(/^Thu (11:59 AM|11:59)$/);
});
it("includes the date on the same weekday next week even when fewer than 7 days elapse", () => {
expect(at(2026, 10, 5, 10, 0)).toMatch(/^Thu, Nov 5, (10:00 AM|10:00)$/);
});
it("includes the weekday and date seven or more calendar days out", () => {
expect(at(2026, 10, 5, 12, 0)).toMatch(/^Thu, Nov 5, (12:00 PM|12:00)$/);
expect(at(2026, 10, 6, 15, 0)).toMatch(/^Fri, Nov 6, (3:00 PM|15:00)$/);
});
it("counts calendar days across the spring daylight-saving transition", () => {
vi.stubEnv("TZ", "America/New_York");
try {
const before = new Date(2026, 2, 7, 12);
const after = new Date(2026, 2, 14, 12);
expect(after.getTime() - before.getTime()).toBe(167 * 3_600_000);
expect(formatResetTime(after.toISOString(), before.getTime())).toMatch(/^Sat, Mar 14, /);
} finally {
vi.unstubAllEnvs();
}
});
it("shows the exhaustion clock time with the same weekday and date rules as reset time", () => {
const runsOut = (...args: [number, number, number, number, number]) =>
formatRunsOutLabel(new Date(...args).toISOString(), now)?.replace(/\s/g, " ");
expect(runsOut(2026, 9, 29, 15, 0)).toMatch(/^runs out (3:00 PM|15:00)$/);
expect(runsOut(2026, 9, 30, 9, 32)).toMatch(/^runs out Fri (9:32 AM|09:32|9:32)$/);
expect(runsOut(2026, 10, 5, 15, 30)).toMatch(/^runs out Thu, Nov 5, (3:30 PM|15:30)$/);
});
it("uses the app language for the exhaustion label and weekday", async () => {
await i18n.changeLanguage("ja");
const time = new Date(2026, 9, 30, 15, 30).toISOString();
expect(formatRunsOutLabel(time, now)?.replace(/\s/g, " ")).toMatch(
/^金 (?:3:30 PM|15:30)に上限に到達$/,
);
it("adds the date after 7 days", () => {
expect(at(2026, 10, 5, 12, 0)).toMatch(/^Nov 5, (12:00 PM|12:00)$/);
});
it("names the weekday in the app language", async () => {
+11 -10
View File
@@ -1,6 +1,6 @@
import type { TFunction } from "i18next";
import { i18n } from "@/i18n/i18next";
import { formatTimeOfDay, localCalendarDaysBetween } from "@/utils/time";
import { formatTimeOfDay } from "@/utils/time";
import type { UsageDisplayAs } from "./preferences";
import type { UsageBalanceUnit, UsageReportEntry } from "./types";
@@ -79,7 +79,6 @@ function relativeDuration(iso: string, now: number): RelativeDuration | null {
const days = Math.floor(diffMs / DAY_MS);
const hours = Math.floor((diffMs % DAY_MS) / HOUR_MS);
const minutes = Math.floor((diffMs % HOUR_MS) / MINUTE_MS);
if (days === 1 && hours === 0) return remaining({ unit: "hours", count: 24 });
if (days > 0) return remaining({ unit: "days", count: days }, { unit: "hours", count: hours });
if (hours > 0)
return remaining({ unit: "hours", count: hours }, { unit: "minutes", count: minutes });
@@ -121,8 +120,8 @@ export function formatResetLabel(
}
/**
* A clock time today, a weekday for the next six calendar days, and a weekday plus date after that.
* Names follow the app language. The clock uses the device's 12/24h preference.
* When a window resets on the clock: "3:00 PM" within a day, "Fri 3:00 PM" within a week,
* "Oct 31, 3:00 PM" after that. Names follow the app language; 12/24h follows the device.
* Nothing for a time that has passed, where the countdown already says so.
*/
export function formatResetTime(
@@ -136,13 +135,12 @@ export function formatResetTime(
if (!Number.isFinite(diffMs) || diffMs <= 0) return null;
const time = formatTimeOfDay(at);
const locale = i18n.resolvedLanguage;
const dayDiff = localCalendarDaysBetween(new Date(now), at);
if (dayDiff === 0) return time;
if (dayDiff <= 6) {
if (diffMs < DAY_MS) return time;
if (diffMs < 7 * DAY_MS) {
const weekday = at.toLocaleDateString(locale, { weekday: "short" });
return t("providerUsage.timing.resetsAtWeekday", { weekday, time });
}
const date = at.toLocaleDateString(locale, { weekday: "short", month: "short", day: "numeric" });
const date = at.toLocaleDateString(locale, { month: "short", day: "numeric" });
return t("providerUsage.timing.resetsAtDate", { date, time });
}
@@ -151,8 +149,11 @@ export function formatRunsOutLabel(
now = Date.now(),
t: TFunction = i18n.t,
): string | null {
const time = formatResetTime(iso, now, t);
return time ? t("providerUsage.timing.runsOutAt", { time }) : null;
if (!iso) return null;
const rel = relativeDuration(iso, now);
if (!rel) return null;
if (rel.kind === "now") return t("providerUsage.timing.runsOutNow");
return t("providerUsage.timing.runsOutIn", { duration: formatRelativeDuration(rel, t) });
}
export function formatAgo(
+6 -1
View File
@@ -6,12 +6,14 @@ import type { UsageTone } from "./types";
function fillToneStyle(tone: UsageTone) {
switch (tone) {
case "ok":
return styles.fillOk;
case "warning":
return styles.fillWarning;
case "danger":
return styles.fillDanger;
default:
return styles.fillOk;
return styles.fillDefault;
}
}
@@ -57,6 +59,9 @@ const styles = StyleSheet.create((theme) => ({
fillQuiet: {
backgroundColor: theme.colors.surface4,
},
fillDefault: {
backgroundColor: theme.colors.foregroundMuted,
},
fillOk: {
backgroundColor: theme.colors.statusSuccess,
},
+4 -17
View File
@@ -23,25 +23,12 @@ describe("usage pace", () => {
it("updates after a later reading and works with a remaining percentage", () => {
const close = reading("13:30");
const safe = reading("14:00");
expect(usagePace(window, close, Date.parse(close))).toEqual({ kind: "tight" });
const forecast = usagePace(window, close, Date.parse(close));
expect(forecast.kind).toBe("remaining");
if (forecast.kind === "remaining") expect(forecast.remainingAtResetPct).toBeCloseTo(7.14);
expect(
usagePace({ ...window, usedPct: undefined, remainingPct: 35 }, safe, Date.parse(safe)),
).toEqual({ kind: "onTrack" });
});
it("projects a weekly window after 100 minutes when 6% is already used", () => {
const sampledAt = "2026-11-21T10:28:17.000Z";
const weekly: UsageWindow = {
id: "gemini-weekly",
label: "Gemini · Weekly",
durationSeconds: 604_800,
usedPct: 6,
resetsAt: "2026-11-28T08:48:17.000Z",
};
expect(usagePace(weekly, sampledAt, Date.parse("2026-11-21T10:33:03Z"))).toEqual({
kind: "runsOut",
at: "2026-11-22T12:34:57.000Z",
});
).toEqual({ kind: "remaining", remainingAtResetPct: 18.75 });
});
it("only forecasts with timing and an active, usable reading", () => {
+3 -5
View File
@@ -5,7 +5,7 @@ type UsagePace =
| { kind: "unknown" }
| { kind: "reached" }
| { kind: "runsOut"; at: string }
| { kind: "onTrack" | "tight" };
| { kind: "remaining"; remainingAtResetPct: number };
/** Estimate from the window's average pace as of the reading. The clock only expires the estimate. */
export function usagePace(window: UsageWindow, observedAt: string | null, now: number): UsagePace {
@@ -25,15 +25,13 @@ export function usagePace(window: UsageWindow, observedAt: string | null, now: n
const duration = (window.durationSeconds ?? 0) * 1_000;
const sampled = Date.parse(observedAt);
const elapsed = sampled - (reset - duration);
// Wait for an initial sample without holding back multi-day forecasts for several hours.
const minimumElapsed = Math.max(60_000, Math.min(duration * 0.01, 3_600_000));
if (
used == null ||
!Number.isFinite(used) ||
used < 0 ||
!Number.isFinite(elapsed) ||
sampled >= reset ||
elapsed < minimumElapsed
elapsed < Math.max(60_000, duration * 0.01)
) {
return { kind: "unknown" };
}
@@ -43,5 +41,5 @@ export function usagePace(window: UsageWindow, observedAt: string | null, now: n
const runsOut = sampled + ((100 - used) / used) * elapsed;
return { kind: "runsOut", at: new Date(runsOut).toISOString() };
}
return { kind: projectedAtReset >= 90 ? "tight" : "onTrack" };
return { kind: "remaining", remainingAtResetPct: 100 - projectedAtReset };
}
+23 -18
View File
@@ -7,6 +7,7 @@ import { StyleSheet, withUnistyles } from "react-native-unistyles";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import {
formatDisplayPct,
formatPct,
formatProviderUsageLabel,
formatResetLabel,
formatResetTime,
@@ -17,7 +18,6 @@ import { displayPercent, usageWindowRowLabel } from "./model";
import { usagePace } from "./pace";
import { UsageDatapointLine } from "./datapoint-line";
import type { UsageDisplayAs } from "./preferences";
import { windowTone } from "./tone";
import type { UsageTone, UsageWindow } from "./types";
import { useRelativeTimeTick } from "./use-relative-time-tick";
@@ -55,13 +55,13 @@ export function UsageWindowBar({
const value =
shownPct != null ? formatDisplayPct(shownPct, displayAs, i18n.resolvedLanguage, t) : "—";
const accessibilityState = useMemo(() => ({ checked: pinned }), [pinned]);
const datapoints = [countdown, exactTime, forecast?.label ?? null];
const content = {
label: formatProviderUsageLabel(window.id, window.label, t),
value,
datapoints,
countdown,
exactTime,
forecast,
percent: shownPct ?? 0,
tone: forecast?.tone ?? windowTone(window),
pinned,
};
@@ -81,7 +81,7 @@ export function UsageWindowBar({
accessibilityLabel={usageWindowRowLabel({
pinLabel,
value,
trailing: datapoints.filter(Boolean).join(" · "),
trailing: [countdown, exactTime, forecast?.label].filter(Boolean).join(" · "),
})}
accessibilityState={accessibilityState}
aria-checked={pinned}
@@ -96,17 +96,19 @@ export function UsageWindowBar({
function WindowRowContent({
label,
value,
datapoints,
countdown,
exactTime,
forecast,
percent,
tone,
pinnable,
pinned,
}: {
label: string;
value: string;
datapoints: readonly (string | null)[];
countdown: string | null;
exactTime: string | null;
forecast: PaceLabel | null;
percent: number;
tone: UsageTone;
pinnable: boolean;
pinned: boolean;
}) {
@@ -121,14 +123,14 @@ function WindowRowContent({
</Text>
{pinnable ? <UsagePinGlyph pinned={pinned} /> : null}
</View>
<UsageMeter percent={percent} tone={tone} />
<UsageDatapointLine datapoints={datapoints} />
<UsageMeter percent={percent} tone={forecast?.tone ?? "default"} />
<UsageDatapointLine datapoints={[countdown, exactTime, forecast?.label ?? null]} />
</>
);
}
interface PaceDisplay {
label: string | null;
interface PaceLabel {
label: string;
tone: UsageTone;
}
@@ -136,7 +138,7 @@ function formatPace(
pace: ReturnType<typeof usagePace>,
now: number,
t: TFunction,
): PaceDisplay | null {
): PaceLabel | null {
switch (pace.kind) {
case "reached":
return { label: t("providerUsage.timing.limitReached"), tone: "danger" };
@@ -147,10 +149,13 @@ function formatPace(
: formatRunsOutLabel(pace.at, now, t);
return label ? { label, tone: "danger" } : null;
}
case "tight":
return { label: null, tone: "warning" };
case "onTrack":
return { label: null, tone: "default" };
case "remaining":
return {
label: t("providerUsage.timing.projectedLeftAtReset", {
percentage: formatPct(pace.remainingAtResetPct),
}),
tone: pace.remainingAtResetPct <= 10 ? "warning" : "default",
};
case "unknown":
return null;
}
+8 -4
View File
@@ -97,10 +97,14 @@ export function formatCompactTimeAgoAsProse(label: string): string {
return label;
}
/** Count local calendar dates using equally spaced UTC values for their year, month and day. */
export function localCalendarDaysBetween(earlier: Date, later: Date): number {
const calendarDay = (date: Date) => Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());
return (calendarDay(later) - calendarDay(earlier)) / DAY_MS;
/**
* How many local midnights lie between two instants: 0 for the same day, 1 for yesterday.
* Counted on the calendar rather than in elapsed time, so six days and 23 hours ago on
* today's weekday is 7, and rounded so a DST day of 23 or 25 hours still counts as one.
*/
function localCalendarDaysBetween(earlier: Date, later: Date): number {
const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
return Math.round((startOfDay(later).getTime() - startOfDay(earlier).getTime()) / DAY_MS);
}
// Cached Intl formatter. Explicitly carrying `hourCycle` from the resolved
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/cli",
"version": "0.17.1",
"version": "0.17.0",
"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.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/server": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"@getpaseo/server": "0.17.0",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
+1 -3
View File
@@ -12,11 +12,9 @@ describe("canonical CLI surface", () => {
expect(send.opts().behavior).toBe("interrupt");
await send.parseAsync(["target", "message", "--behavior", "steer"], { from: "user" });
expect(send.opts().behavior).toBe("steer");
await send.parseAsync(["target", "message", "--behavior", "queue"], { from: "user" });
expect(send.opts().behavior).toBe("queue");
send.exitOverride().configureOutput({ writeErr: () => {} });
await expect(
send.parseAsync(["target", "message", "--behavior", "wait"], { from: "user" }),
send.parseAsync(["target", "message", "--behavior", "queue"], { from: "user" }),
).rejects.toThrow();
});
@@ -1,29 +0,0 @@
import { describe, expect, it } from "vitest";
import { buildNoWaitResult } from "./send.js";
const agentId = "11111111-1111-4111-8111-111111111111";
describe("buildNoWaitResult", () => {
it("reports the behavior the host applied to an agent's message", () => {
expect(
buildNoWaitResult(agentId, {
deliveryStatus: "queued",
activeTurnBehavior: "steer",
guidance: "The agent is idle, so your message starts a turn now.",
}),
).toEqual({
agentId,
status: "queued",
activeTurnBehavior: "steer",
message: "The agent is idle, so your message starts a turn now.",
});
});
it("leaves the behavior out when the host does not report one", () => {
expect(buildNoWaitResult(agentId, {})).toEqual({
agentId,
status: "sent",
message: "Message sent, not waiting for completion",
});
});
});
+13 -25
View File
@@ -1,8 +1,7 @@
import { type Command, Option } from "commander";
import type { AgentActiveTurnBehavior } from "@getpaseo/protocol/messages";
import type { ActiveTurnBehavior } from "@getpaseo/protocol/messages";
import { collectMultiple } from "../../utils/command-options.js";
import { connectToDaemon } from "../../utils/client.js";
import type { AgentMessageReceipt } from "@getpaseo/client/internal/daemon-client";
import type {
CommandOptions,
SingleResult,
@@ -16,8 +15,6 @@ import { extname, resolve } from "node:path";
export interface AgentSendResult {
agentId: string;
status: "queued" | "sent" | "completed" | "timeout" | "permission" | "error";
/** What the host applied to an agent's message with a running turn. */
activeTurnBehavior?: AgentActiveTurnBehavior;
message: string;
}
@@ -32,7 +29,7 @@ export const agentSendSchema: OutputSchema<AgentSendResult> = {
};
export interface AgentSendOptions extends CommandOptions {
behavior?: AgentActiveTurnBehavior;
behavior?: ActiveTurnBehavior;
wait?: boolean;
image?: string[];
prompt?: string;
@@ -50,8 +47,8 @@ export function addSendOptions(cmd: Command): Command {
.addOption(
new Option(
"--behavior <behavior>",
"Leave out unless the message cannot wait. From an agent (PASEO_AGENT_ID set): queue (default) waits for the running turn to end, steer joins it, interrupt replaces it. From a person: interrupt (default) or steer",
).choices(["queue", "steer", "interrupt"]),
"Active-turn behavior (agent default: steer waits for turn end; otherwise: interrupt)",
).choices(["interrupt", "steer"]),
)
.option("--no-wait", "Return immediately without waiting for completion");
}
@@ -173,22 +170,6 @@ function buildSendResult(agentIdArg: string, state: SendWaitState): AgentSendRes
return { agentId, status: "completed", message: "Agent completed processing the message" };
}
export function buildNoWaitResult(agentId: string, receipt: AgentMessageReceipt): AgentSendResult {
return {
agentId,
status: receipt.deliveryStatus ?? "sent",
...(receipt.activeTurnBehavior ? { activeTurnBehavior: receipt.activeTurnBehavior } : {}),
message: sendReceiptMessage(receipt),
};
}
function sendReceiptMessage(receipt: AgentMessageReceipt): string {
if (receipt.deliveryStatus !== "queued") return "Message sent, not waiting for completion";
// COMPAT(agentActiveTurnBehaviors): added in v0.17.2, remove after 2027-05-22 once daemon
// floor >= v0.17.2. Older hosts return no guidance.
return receipt.guidance ?? "Message queued for delivery after the current turn ends";
}
export async function runSendCommand(
agentIdArg: string,
prompt: string | undefined,
@@ -223,7 +204,7 @@ export async function runSendCommand(
const receipt = await client.sendAgentMessage(agentIdArg, promptInput, {
images,
sourceAgentId,
activeTurnBehavior: options.behavior,
activeTurnBehavior: options.behavior ?? (sourceAgentId ? "steer" : "interrupt"),
});
// If --no-wait, return immediately
@@ -232,7 +213,14 @@ export async function runSendCommand(
return {
type: "single",
data: buildNoWaitResult(agentIdArg, receipt),
data: {
agentId: agentIdArg,
status: receipt.deliveryStatus ?? "sent",
message:
receipt.deliveryStatus === "queued"
? "Message queued for delivery after two quiet seconds and the current turn ends, unless interrupt was requested"
: "Message sent, not waiting for completion",
},
schema: agentSendSchema,
};
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/client",
"version": "0.17.1",
"version": "0.17.0",
"description": "Paseo client SDK package",
"license": "Apache-2.0",
"files": [
@@ -49,8 +49,8 @@
"measure:diff-materialization": "tsx scripts/measure-diff-materialization.ts"
},
"dependencies": {
"@getpaseo/protocol": "0.17.1",
"@getpaseo/relay": "0.17.1",
"@getpaseo/protocol": "0.17.0",
"@getpaseo/relay": "0.17.0",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
-1
View File
@@ -125,7 +125,6 @@ export class ConnectionSubscriptions extends OwnedSubscriptions {
// Protocol support belongs to the installed client. Only browser hosting needs
// a resource supplied by the caller. Keep this exhaustive as the protocol evolves.
export const DEFAULT_CLIENT_CAPABILITIES = {
[CLIENT_CAPS.agentActiveTurnBehaviors]: true,
[CLIENT_CAPS.terminalChunkedReplay]: true,
[CLIENT_CAPS.binaryChunkingV1]: true,
[CLIENT_CAPS.helloRejection]: true,
-92
View File
@@ -1127,7 +1127,6 @@ test("advertises client capabilities in hello", async () => {
clientType: "cli",
protocolVersion: 1,
capabilities: {
agent_active_turn_behaviors: true,
all_providers: true,
selective_agent_timeline: true,
timeline_replacement_invalidation: true,
@@ -8829,97 +8828,6 @@ test.each([false, true])(
},
);
describe("agent sender active-turn behaviors", () => {
async function connect(features: Record<string, boolean>) {
const transport = createMockTransport();
const client = new DaemonClient({
url: "ws://test",
clientId: "agent-behaviors",
transportFactory: () => transport.transport,
reconnect: { enabled: false },
});
clients.push(client);
const connecting = client.connect();
transport.triggerOpen({ features: { agentMessageProvenance: true, ...features } });
await connecting;
return { client, transport };
}
function respond(
transport: ReturnType<typeof createMockTransport>,
payload: Record<string, unknown> = {},
) {
const request = parseSentFrame(transport.sent.at(-1));
transport.triggerMessage(
wrapSessionMessage({
type: "send_agent_message_response",
payload: {
requestId: request.requestId,
agentId: "recipient",
accepted: true,
error: null,
...payload,
},
}),
);
return request;
}
test("a capable host gets the behavior as asked and returns the applied behavior with guidance", async () => {
const { client, transport } = await connect({ agentActiveTurnBehaviors: true });
const send = client.sendAgentMessage("recipient", "review", {
sourceAgentId: "sender",
activeTurnBehavior: "steer",
});
const request = respond(transport, {
deliveryStatus: "queued",
activeTurnBehavior: "steer",
guidance: "Steering the running turn.",
});
expect(request.activeTurnBehavior).toBe("steer");
await expect(send).resolves.toEqual({
deliveryStatus: "queued",
activeTurnBehavior: "steer",
guidance: "Steering the running turn.",
});
});
test("an older host gets its own agent default for queue and refuses a steer", async () => {
const { client, transport } = await connect({});
const queued = client.sendAgentMessage("recipient", "review", {
sourceAgentId: "sender",
activeTurnBehavior: "queue",
});
const request = respond(transport, { deliveryStatus: "queued" });
expect("activeTurnBehavior" in request).toBe(false);
await expect(queued).resolves.toEqual({ deliveryStatus: "queued" });
const interrupt = client.sendAgentMessage("recipient", "stop", {
sourceAgentId: "sender",
activeTurnBehavior: "interrupt",
});
expect(respond(transport, { deliveryStatus: "queued" }).activeTurnBehavior).toBe("interrupt");
await interrupt;
const sentBefore = transport.sent.length;
await expect(
client.sendAgentMessage("recipient", "now", {
sourceAgentId: "sender",
activeTurnBehavior: "steer",
}),
).rejects.toThrow("Update the Paseo host to steer a running turn from an agent");
expect(transport.sent).toHaveLength(sentBefore);
});
test("queue needs an agent sender", async () => {
const { client, transport } = await connect({ agentActiveTurnBehaviors: true });
await expect(
client.sendAgentMessage("recipient", "review", { activeTurnBehavior: "queue" }),
).rejects.toThrow('activeTurnBehavior "queue" needs an agent sender');
expect(transport.sent).toHaveLength(0);
});
});
test("measures an outbound message in UTF-8 bytes against the daemon's message limit", async () => {
const mock = createMockTransport();
const client = new DaemonClient({
+7 -43
View File
@@ -47,7 +47,7 @@ import {
ShutdownRequestedStatusPayloadSchema,
DaemonUpdateResponseSchema,
SessionInboundMessageSchema,
type AgentActiveTurnBehavior,
type ActiveTurnBehavior,
type ServerInfoStatusPayload,
} from "@getpaseo/protocol/messages";
import { validateWSOutboundMessage } from "@getpaseo/protocol/validation/ws-outbound";
@@ -481,23 +481,13 @@ export interface DaemonClientTrace {
endSection(): void;
}
/** A queued agent message carries the applied behavior and what happens next. */
export interface AgentMessageReceipt {
deliveryStatus?: "queued";
activeTurnBehavior?: AgentActiveTurnBehavior;
guidance?: string;
}
export interface SendMessageOptions {
sourceAgentId?: string;
sourceAgentServerId?: string;
sessionMode?: string;
messageId?: string;
/**
* Agent sources default to queue: wait for the running turn to end. Human sources default to
* interrupt and cannot queue.
*/
activeTurnBehavior?: AgentActiveTurnBehavior;
/** Agent sources wait for turn end unless interrupt is explicit. Human sources default to interrupt. */
activeTurnBehavior?: ActiveTurnBehavior;
images?: Array<{ data: string; mimeType: string }>;
attachments?: SendAgentMessageRequest["attachments"];
}
@@ -4272,7 +4262,7 @@ export class DaemonClient {
agentId: string,
text: string,
options: SendMessageOptions = {},
): Promise<AgentMessageReceipt> {
): Promise<{ deliveryStatus?: "queued" }> {
if (
options.sourceAgentId &&
this.lastServerInfoMessage?.features?.agentMessageProvenance !== true
@@ -4285,7 +4275,6 @@ export class DaemonClient {
) {
throw new Error("Update the Paseo host to send messages with a qualified agent address.");
}
const activeTurnBehavior = this.activeTurnBehaviorForHost(options);
const requestId = this.createRequestId();
const messageId = options.messageId ?? crypto.randomUUID();
const message = SessionInboundMessageSchema.parse({
@@ -4297,7 +4286,7 @@ export class DaemonClient {
sourceAgentServerId: options.sourceAgentServerId,
sessionMode: options.sessionMode,
...(messageId ? { messageId } : {}),
activeTurnBehavior,
activeTurnBehavior: options.activeTurnBehavior,
images: options.images,
attachments: options.attachments,
});
@@ -4318,39 +4307,14 @@ export class DaemonClient {
if (!payload.accepted) {
throw new Error(payload.error ?? "sendAgentMessage rejected");
}
return {
...(payload.deliveryStatus ? { deliveryStatus: payload.deliveryStatus } : {}),
...(payload.activeTurnBehavior ? { activeTurnBehavior: payload.activeTurnBehavior } : {}),
...(payload.guidance ? { guidance: payload.guidance } : {}),
};
}
/** The behavior to put on the wire for this host. */
private activeTurnBehaviorForHost(
options: SendMessageOptions,
): AgentActiveTurnBehavior | undefined {
const requested = options.activeTurnBehavior;
if (!options.sourceAgentId) {
if (requested === "queue")
throw new Error('activeTurnBehavior "queue" needs an agent sender (sourceAgentId).');
return requested;
}
if (this.lastServerInfoMessage?.features?.agentActiveTurnBehaviors === true) return requested;
// COMPAT(agentActiveTurnBehaviors): added in v0.17.2, remove after 2027-05-22 once daemon
// floor >= v0.17.2. Older hosts reject queue and read an agent's steer as queue, so queue
// goes out as the host's own agent default and a real steer needs an update.
if (requested === "steer")
throw new Error(
"Update the Paseo host to steer a running turn from an agent. Leave the behavior out to queue the message, or use interrupt.",
);
return requested === "interrupt" ? "interrupt" : undefined;
return payload.deliveryStatus ? { deliveryStatus: payload.deliveryStatus } : {};
}
async sendMessage(
agentId: string,
text: string,
options?: SendMessageOptions,
): Promise<AgentMessageReceipt> {
): Promise<{ deliveryStatus?: "queued" }> {
return this.sendAgentMessage(agentId, text, options);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/desktop",
"version": "0.17.1",
"version": "0.17.0",
"private": true,
"description": "Paseo desktop app (Electron wrapper)",
"homepage": "https://paseo.sh",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/expo-two-way-audio",
"version": "0.17.1",
"version": "0.17.0",
"description": "Native module for two way audio streaming",
"keywords": [
"ExpoTwoWayAudio",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/highlight",
"version": "0.17.1",
"version": "0.17.0",
"license": "Apache-2.0",
"files": [
"dist",
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/plugin",
"version": "0.17.1",
"version": "0.17.0",
"description": "Paseo plugin SDK package",
"license": "Apache-2.0",
"files": [
@@ -78,8 +78,8 @@
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"@types/node": "^20.9.0",
"@types/react": "~19.2.0",
"react": "19.2.3",
@@ -89,8 +89,8 @@
"zod": "^4.4.3"
},
"peerDependencies": {
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/client": "0.17.0",
"@getpaseo/protocol": "0.17.0",
"react": ">=19.1.0 <20",
"react-native": ">=0.81.5",
"zod": "^4.4.3"
@@ -334,7 +334,7 @@ async function openSession(
onRetired: () => retireSession(state, input.sessionId),
});
try {
const capabilities = await runtime.open(input, state.capabilities, state.isClosed);
const capabilities = await runtime.open(input, state.capabilities);
if (state.isClosed()) {
await runtime.closeSession();
return;
@@ -454,14 +454,12 @@ class AcpRuntime {
* Once ready, suppress late replay rows until the first prompt.
*/
private replayWindow: "replay" | "skip" | null = null;
private lastLoadHistoryAt = 0;
private lastPartialWireAt = 0;
private lastLoadUpdateAt = 0;
private closing = false;
private closePromise: Promise<void> | null = null;
private deferredRetirement: Promise<boolean> | null = null;
private deferredFinalized = false;
private processFailed = false;
private processFailureMessage: string | null = null;
private configTransaction = false;
private stagedTransformerConfig: ProviderConfigState | null = null;
private readonly closeConnector: (options?: {
@@ -485,7 +483,6 @@ class AcpRuntime {
timeoutMs?: number;
}) => Promise<void> = async () => {};
let whenConnectorClosed: () => Promise<void> | null = () => null;
let onPartialWireRead: (() => void) | null = null;
if (options.options.command) {
// COMPAT(pluginProviderLaunch): added in v0.10.0, remove after 2027-03-29 once plugin host floor >= v0.10.0.
// Standalone callers and older hosts do not send a daemon-resolved launch.
@@ -502,10 +499,7 @@ class AcpRuntime {
spawnFailure = new Promise<never>((_resolve, reject) => child!.once("error", reject));
child.stderr.on("data", () => undefined);
const output = Writable.toWeb(child.stdin) as unknown as Parameters<typeof ndJsonStream>[0];
const rawInput = Readable.toWeb(child.stdout) as unknown as ReadableStream<Uint8Array>;
const input = observePartialWireReads(rawInput, () => onPartialWireRead?.()) as Parameters<
typeof ndJsonStream
>[1];
const input = Readable.toWeb(child.stdout) as unknown as Parameters<typeof ndJsonStream>[1];
stream = ndJsonStream(output, input);
} else {
const owned = ownConnectorStream(await options.options.connector());
@@ -514,7 +508,6 @@ class AcpRuntime {
whenConnectorClosed = owned.whenClosed;
}
const runtime = new AcpRuntime(stream, child, closeConnector, whenConnectorClosed, options);
onPartialWireRead = () => runtime.notePartialWireRead();
try {
const initialize = withTimeout(
runtime.call(
@@ -569,7 +562,6 @@ class AcpRuntime {
child?.on("error", (error) => {
const message = describeError(error);
this.processFailed = true;
this.processFailureMessage = message;
this.settlePendingWork(message);
if (this.closing || !this.nativeSessionId) return;
this.emit({
@@ -582,7 +574,6 @@ class AcpRuntime {
if (this.closing || this.processFailed || !this.nativeSessionId) return;
const message = `ACP process exited (${signal ?? code ?? "unknown"})`;
this.processFailed = true;
this.processFailureMessage = message;
this.settlePendingWork(message);
this.emit({
type: "session.runtime_failed",
@@ -595,7 +586,6 @@ class AcpRuntime {
async open(
input: Extract<ProviderInput, { type: "session.open" }>,
connectionCapabilities: readonly ProviderCapability[],
isConnectionClosed: () => boolean,
): Promise<readonly ProviderCapability[]> {
const mcpServers = toAcpMcpServers(input.config);
this.mcpServerNames = mcpServers.map((server) => server.name);
@@ -666,22 +656,15 @@ class AcpRuntime {
cwd: input.config.cwd,
});
this.emitConfig();
await this.finishSessionOpen(isConnectionClosed);
return sessionCapabilities;
}
private async finishSessionOpen(isConnectionClosed: () => boolean): Promise<void> {
if (this.options.options.acpOptions?.waitForInitialCommands) {
await this.waitForInitialCommands();
}
const quietPeriod = this.options.options.acpOptions?.loadReplayQuietPeriodMs;
if (this.replayWindow && quietPeriod && quietPeriod > 0) {
await this.waitForLoadReplay(quietPeriod, isConnectionClosed);
await this.waitForLoadReplay(quietPeriod);
this.replayWindow = "skip";
}
if (this.processFailed && !isConnectionClosed()) {
throw new Error(this.processFailureMessage ?? "ACP process exited during session open");
}
return sessionCapabilities;
}
async discover(cwd?: string): Promise<ProviderCatalog> {
@@ -1299,12 +1282,16 @@ class AcpRuntime {
private sessionUpdate(notification: SessionNotification, wireSeq: number): void {
if (notification.sessionId !== this.nativeSessionId) return;
if (this.replayWindow && isReplayHistoryUpdate(notification.update)) {
this.lastLoadHistoryAt = performance.now();
}
if (this.replayWindow) this.lastLoadUpdateAt = performance.now();
if (this.replayWindow === "skip") {
if (isSessionStateUpdate(notification.update)) {
this.reduceStateUpdate(notification.update, wireSeq);
const update = notification.update;
if (
update.sessionUpdate === "available_commands_update" ||
update.sessionUpdate === "config_option_update" ||
update.sessionUpdate === "current_mode_update" ||
update.sessionUpdate === "usage_update"
) {
this.reduceStateUpdate(update, wireSeq);
}
return;
}
@@ -1647,7 +1634,6 @@ class AcpRuntime {
if (this.closing || this.processFailed) return;
const message = "ACP transport closed unexpectedly";
this.processFailed = true;
this.processFailureMessage = message;
this.settlePendingWork(message);
if (!this.nativeSessionId) return;
this.emit({
@@ -1959,86 +1945,19 @@ class AcpRuntime {
});
}
private notePartialWireRead(): void {
if (this.replayWindow) this.lastPartialWireAt = performance.now();
}
// An agent that streams history after its session/load response sends no end marker,
// so the history ends once a quiet period passes without a history update.
private async waitForLoadReplay(
quietPeriod: number,
isConnectionClosed: () => boolean,
): Promise<void> {
private async waitForLoadReplay(quietPeriod: number): Promise<void> {
const start = performance.now();
while (!this.closing && !this.processFailed && !isConnectionClosed()) {
const lastActivityAt = Math.max(start, this.lastLoadHistoryAt, this.lastPartialWireAt);
const remaining = lastActivityAt + quietPeriod - performance.now();
// A stalled event loop reaches the quiet period with history still unread in the pipe.
// setImmediate lets the loop read pending input once before the silence is trusted.
await new Promise<void>((resolve) => {
if (remaining > 0) setTimeout(resolve, remaining);
else setImmediate(resolve);
});
const deadline = start + 5 * quietPeriod;
while (!this.closing && !this.processFailed) {
const idleAt = Math.max(start, this.lastLoadUpdateAt) + quietPeriod;
const remaining = Math.min(deadline, idleAt) - performance.now();
if (remaining <= 0) return;
await new Promise<void>((resolve) => setTimeout(resolve, remaining));
await this.notificationLane;
if (
remaining <= 0 &&
Math.max(start, this.lastLoadHistoryAt, this.lastPartialWireAt) === lastActivityAt
) {
return;
}
}
}
}
function observePartialWireReads(
input: ReadableStream<Uint8Array>,
onPartialRead: () => void,
): ReadableStream<Uint8Array> {
let incompleteLine = false;
return input.pipeThrough(
new TransformStream<Uint8Array, Uint8Array>({
transform(chunk, controller) {
const wasIncomplete = incompleteLine;
incompleteLine = hasTrailingIncompleteLine(chunk, incompleteLine);
if (wasIncomplete || incompleteLine) onPartialRead();
controller.enqueue(chunk);
},
}),
);
}
function hasTrailingIncompleteLine(chunk: Uint8Array, incompleteLine: boolean): boolean {
const newline = chunk.lastIndexOf(0x0a);
const start = newline === -1 ? 0 : newline + 1;
if (newline !== -1) incompleteLine = false;
for (let index = start; index < chunk.length; index += 1) {
const byte = chunk[index];
if (byte !== 0x20 && byte !== 0x09 && byte !== 0x0d) return true;
}
return incompleteLine;
}
function isReplayHistoryUpdate(update: SessionUpdate): boolean {
return (
update.sessionUpdate === "user_message_chunk" ||
update.sessionUpdate === "agent_message_chunk" ||
update.sessionUpdate === "agent_thought_chunk" ||
update.sessionUpdate === "tool_call" ||
update.sessionUpdate === "tool_call_update" ||
update.sessionUpdate === "plan" ||
update.sessionUpdate === "compaction_update"
);
}
function isSessionStateUpdate(update: SessionUpdate): boolean {
return (
update.sessionUpdate === "available_commands_update" ||
update.sessionUpdate === "config_option_update" ||
update.sessionUpdate === "current_mode_update" ||
update.sessionUpdate === "usage_update"
);
}
function routeIncomingMessages(
stream: Stream,
receiveVendor: (method: string, params: unknown) => void,
-372
View File
@@ -303,378 +303,6 @@ describe("runAcpProvider", () => {
},
);
it("keeps history that streams after session/load for longer than five quiet periods", async () => {
const sessionId = "connector-session";
const historyLength = 40;
let stream: ReturnType<typeof setInterval> | undefined;
const { connector } = connectorHarness({
capabilities: { loadSession: true },
handleRequest(runtime, request) {
if (request.method !== "session/load") return false;
runtime.respond(request, { configOptions: [] });
let sent = 0;
stream = setInterval(() => {
runtime.notify("session/update", {
sessionId,
update: {
sessionUpdate: "agent_message_chunk",
messageId: `answer-${sent}`,
content: { type: "text", text: `previous answer ${sent}` },
},
});
sent += 1;
if (sent === historyLength) clearInterval(stream);
}, 20);
return true;
},
});
const connection = await runAcpProvider({
id: "load",
label: "Load",
connector,
acpOptions: { loadReplayQuietPeriodMs: 100 },
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
const events: ProviderEvent[] = [];
connection.onEvent((event) => events.push(event));
try {
await connection.send({
...openInput(),
history: "replay",
persistence: { version: 1, data: { sessionId } },
});
await waitForEvent(events, (event) => event.type === "session.ready");
expect(events.filter((event) => event.type === "timeline.item")).toHaveLength(historyLength);
} finally {
clearInterval(stream);
await connection.close();
}
});
it("closes without waiting for history that is still streaming after session/load", async () => {
const sessionId = "connector-session";
let stream: ReturnType<typeof setInterval> | undefined;
const { connector } = connectorHarness({
capabilities: { loadSession: true },
handleRequest(runtime, request) {
if (request.method !== "session/load") return false;
runtime.respond(request, { configOptions: [] });
stream = setInterval(() => {
if (runtime.readsCanceled) return;
runtime.notify("session/update", {
sessionId,
update: {
sessionUpdate: "agent_message_chunk",
content: { type: "text", text: "previous answer" },
},
});
}, 20);
return true;
},
});
const connection = await runAcpProvider({
id: "load",
label: "Load",
connector,
acpOptions: { loadReplayQuietPeriodMs: 100 },
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
const events: ProviderEvent[] = [];
connection.onEvent((event) => events.push(event));
try {
await connection.send({
...openInput(),
history: "replay",
persistence: { version: 1, data: { sessionId } },
});
await waitForEvent(events, (event) => event.type === "timeline.item");
const outcome = await Promise.race([
connection.close().then(() => "closed"),
new Promise((resolve) => setTimeout(() => resolve("still replaying"), 1_000)),
]);
expect(outcome).toBe("closed");
} finally {
clearInterval(stream);
}
});
it("keeps history left unread while the event loop stalled past the quiet period", async () => {
const sessionId = "connector-session";
const notifyAnswer = (runtime: ConnectorInstance, text: string) =>
runtime.notify("session/update", {
sessionId,
update: {
sessionUpdate: "agent_message_chunk",
messageId: text,
content: { type: "text", text },
},
});
const { connector } = connectorHarness({
capabilities: { loadSession: true },
handleRequest(runtime, request) {
if (request.method !== "session/load") return false;
runtime.respond(request, { configOptions: [] });
notifyAnswer(runtime, "read before the stall");
// Stall after the timers phase, so the overdue quiet timer runs before the next I/O poll.
const stall = () => {
// Like bytes waiting in the agent's pipe: readable only once the loop polls I/O again.
setImmediate(() => notifyAnswer(runtime, "unread during the stall"));
const stalledUntil = performance.now() + 250;
while (performance.now() < stalledUntil);
};
setTimeout(() => setImmediate(stall), 30);
return true;
},
});
const connection = await runAcpProvider({
id: "load",
label: "Load",
connector,
acpOptions: { loadReplayQuietPeriodMs: 100 },
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
const events: ProviderEvent[] = [];
connection.onEvent((event) => events.push(event));
try {
await connection.send({
...openInput(),
history: "replay",
persistence: { version: 1, data: { sessionId } },
});
await waitForEvent(events, (event) => event.type === "session.ready");
expect(
events.filter((event) => event.type === "timeline.item").map((event) => event.item),
).toEqual([
expect.objectContaining({ text: "read before the stall" }),
expect.objectContaining({ text: "unread during the stall" }),
]);
} finally {
await connection.close();
}
});
it("does not extend the load replay wait for session_info_update notifications", async () => {
const sessionId = "connector-session";
let stream: ReturnType<typeof setInterval> | undefined;
const { connector } = connectorHarness({
capabilities: { loadSession: true },
handleRequest(runtime, request) {
if (request.method !== "session/load") return false;
runtime.respond(request, { configOptions: [] });
runtime.notify("session/update", {
sessionId,
update: {
sessionUpdate: "agent_message_chunk",
messageId: "answer-1",
content: { type: "text", text: "previous answer" },
},
});
stream = setInterval(() => {
if (runtime.readsCanceled) return;
runtime.notify("session/update", {
sessionId,
update: {
sessionUpdate: "session_info_update",
title: "Updated title",
},
});
}, 20);
return true;
},
});
const connection = await runAcpProvider({
id: "load",
label: "Load",
connector,
acpOptions: { loadReplayQuietPeriodMs: 100 },
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
const events: ProviderEvent[] = [];
connection.onEvent((event) => events.push(event));
try {
await connection.send({
...openInput(),
history: "replay",
persistence: { version: 1, data: { sessionId } },
});
const outcome = await Promise.race([
waitForEvent(events, (event) => event.type === "session.ready").then(() => "ready"),
new Promise((resolve) => setTimeout(() => resolve("still waiting"), 1_000)),
]);
expect(outcome).toBe("ready");
expect(events.filter((event) => event.type === "timeline.item")).toHaveLength(1);
} finally {
clearInterval(stream);
await connection.close();
}
});
it("fails session open without emitting session.ready or leaking the session when the ACP process crashes mid-replay", async () => {
const dir = await mkdtemp(path.join(tmpdir(), "paseo-acp-crash-replay-"));
const script = path.join(dir, "crash-replay-agent.mjs");
await writeFile(
script,
`
import { createInterface } from "node:readline";
const send = (msg) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...msg }) + "\\n");
createInterface({ input: process.stdin }).on("line", (line) => {
if (!line.trim()) return;
const msg = JSON.parse(line);
if (msg.method === "initialize") {
send({ id: msg.id, result: { protocolVersion: 1, agentCapabilities: { loadSession: true } } });
} else if (msg.method === "session/load") {
const sid = msg.params.sessionId;
send({ id: msg.id, result: { configOptions: [] } });
send({
method: "session/update",
params: {
sessionId: sid,
update: {
sessionUpdate: "agent_message_chunk",
messageId: "m-1",
content: { type: "text", text: "partial history" },
},
},
});
if (sid === "crash-session") {
setTimeout(() => process.exit(1), 20);
}
} else if (msg.method === "session/close") {
send({ id: msg.id, result: {} });
}
});
`,
);
const connection = await runAcpProvider({
id: "crash-replay",
label: "Crash Replay",
command: [process.execPath, script],
acpOptions: { loadReplayQuietPeriodMs: 100 },
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
const events: ProviderEvent[] = [];
connection.onEvent((event) => events.push(event));
try {
await connection.send({
...openInput(),
requestId: "req-crash",
sessionId: "session-1",
history: "replay",
persistence: { version: 1, data: { sessionId: "crash-session" } },
});
await waitForEvent(
events,
(event) => event.type === "request.failed" && event.requestId === "req-crash",
);
expect(events.some((event) => event.type === "session.ready")).toBe(false);
// The failed open must not leave a dead session registered under "session-1".
await connection.send({
...openInput(),
requestId: "req-retry",
sessionId: "session-1",
history: "replay",
persistence: { version: 1, data: { sessionId: "healthy-session" } },
});
await waitForEvent(
events,
(event) => event.type === "session.ready" && event.requestId === "req-retry",
);
} finally {
await connection.close();
await rm(dir, { recursive: true, force: true });
}
});
it("keeps a multi-read tool result started during an event-loop stall past the quiet period", async () => {
const dir = await mkdtemp(path.join(tmpdir(), "paseo-acp-large-stall-replay-"));
const script = path.join(dir, "large-stall-agent.mjs");
const outputBytes = 256 * 1024;
await writeFile(
script,
`
import { createInterface } from "node:readline";
const send = (msg) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...msg }) + "\\n");
createInterface({ input: process.stdin }).on("line", (line) => {
if (!line.trim()) return;
const msg = JSON.parse(line);
if (msg.method === "initialize") {
send({ id: msg.id, result: { protocolVersion: 1, agentCapabilities: { loadSession: true } } });
} else if (msg.method === "session/load") {
const sid = msg.params.sessionId;
send({
method: "session/update",
params: {
sessionId: sid,
update: {
sessionUpdate: "agent_message_chunk",
messageId: "m-before",
content: { type: "text", text: "before the stall" },
},
},
});
send({ id: msg.id, result: { configOptions: [] } });
setTimeout(() => {
send({
method: "session/update",
params: {
sessionId: sid,
update: {
sessionUpdate: "tool_call",
toolCallId: "shell-large",
name: "run_command",
title: "Large output",
kind: "execute",
status: "completed",
rawInput: { CommandLine: "cat large.log" },
rawOutput: { output: "x".repeat(${outputBytes}), exit_code: 0 },
},
},
});
}, 50);
} else if (msg.method === "session/close") {
send({ id: msg.id, result: {} });
}
});
`,
);
const connection = await runAcpProvider({
id: "large-stall",
label: "Large Stall",
command: [process.execPath, script],
acpOptions: { loadReplayQuietPeriodMs: 200 },
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
const events: ProviderEvent[] = [];
let stalled = false;
const stallEventLoop = () => {
const until = performance.now() + 350;
while (performance.now() < until);
};
const scheduleStall = () => setImmediate(stallEventLoop);
connection.onEvent((event) => {
events.push(event);
if (!stalled && event.type === "session.config") {
stalled = true;
// Stall after the timers phase so the overdue quiet timer runs before the next I/O poll;
// the 256 KiB tool result fills the pipe during the stall and spans multiple stdout reads.
setTimeout(scheduleStall, 20);
}
});
try {
await connection.send({
...openInput(),
history: "replay",
persistence: { version: 1, data: { sessionId: "large-session" } },
});
await waitForEvent(events, (event) => event.type === "session.ready");
const items = events
.filter((event) => event.type === "timeline.item")
.map((event) => event.item);
expect(items).toEqual([
expect.objectContaining({ type: "assistant_message", text: "before the stall" }),
expect.objectContaining({ type: "tool_call", callId: "shell-large", status: "completed" }),
]);
} finally {
await connection.close();
await rm(dir, { recursive: true, force: true });
}
});
it("auto-accepts ordinary permissions only in the unattended mode and refuses to switch while busy", async () => {
const modeConfig = {
id: "mode",
+1 -4
View File
@@ -51,10 +51,7 @@ export interface AcpOptions {
workspaceOnlyCatalog?: boolean;
waitForInitialCommands?: boolean;
initialCommandsTimeoutMs?: number;
/**
* For an agent that streams history after its session/load response: publish the session
* as ready once this long passes without a history update.
*/
/** Allow delayed session/load updates before publishing the session as ready. */
loadReplayQuietPeriodMs?: number;
/**
* Keep a turn open after `end_turn` while qualifying tool calls are still running,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/protocol",
"version": "0.17.1",
"version": "0.17.0",
"description": "Paseo shared protocol schemas and wire types",
"license": "Apache-2.0",
"files": [
@@ -56,10 +56,6 @@ export const CLIENT_CAPS = {
// update subscriptions, because older apps auto-open a tab for every replicated root agent.
backgroundAgents: "background_agents",
browserHost: "browser_host",
// COMPAT(agentActiveTurnBehaviors): added in v0.17.2, remove after 2027-05-22 once client floor >= v0.17.2.
// An agent sender's steer means wait-for-turn-end from clients without it, because older
// CLIs and connected hosts send an explicit steer for every default agent send.
agentActiveTurnBehaviors: "agent_active_turn_behaviors",
} as const;
export type ClientCapability = (typeof CLIENT_CAPS)[keyof typeof CLIENT_CAPS];
@@ -2,8 +2,6 @@ import {
AgentStreamEventPayloadSchema,
AgentTimelineEntryPayloadSchema,
SendAgentMessageRequestSchema,
SendAgentMessageResponseMessageSchema,
SendAgentMessageSchema,
} from "./messages";
import { describe, expect, it } from "vitest";
import { z } from "zod";
@@ -31,46 +29,6 @@ describe("send_agent_message_request active-turn behavior", () => {
});
});
describe("agent sender active-turn behaviors", () => {
it("accepts queue on a send request and reports the applied behavior in the response", () => {
expect(
SendAgentMessageRequestSchema.parse({
type: "send_agent_message_request",
requestId: "request-3",
agentId: "agent-1",
text: "Report when you are done",
sourceAgentId: "parent",
activeTurnBehavior: "queue",
}).activeTurnBehavior,
).toBe("queue");
expect(
SendAgentMessageResponseMessageSchema.parse({
type: "send_agent_message_response",
payload: {
requestId: "request-3",
agentId: "agent-1",
accepted: true,
deliveryStatus: "queued",
activeTurnBehavior: "queue",
guidance: "Queued.",
error: null,
},
}).payload,
).toMatchObject({ activeTurnBehavior: "queue", guidance: "Queued." });
});
it("keeps a person's send_agent_message to interrupt and steer", () => {
expect(
SendAgentMessageSchema.safeParse({
type: "send_agent_message",
agentId: "agent-1",
text: "hello",
activeTurnBehavior: "queue",
}).success,
).toBe(false);
});
});
describe("canonical timeline turn ID compatibility", () => {
it("accepts both new turn-tagged wire rows and legacy rows without IDs", () => {
const entry = {
+1 -11
View File
@@ -1347,9 +1347,6 @@ const ImageAttachmentSchema = z.object({
export const ActiveTurnBehaviorSchema = z.enum(["interrupt", "steer"]);
export type ActiveTurnBehavior = z.infer<typeof ActiveTurnBehaviorSchema>;
/** An agent sender may also queue: wait until the recipient's running turn ends. */
export const AgentActiveTurnBehaviorSchema = z.enum(["interrupt", "steer", "queue"]);
export type AgentActiveTurnBehavior = z.infer<typeof AgentActiveTurnBehaviorSchema>;
export const SendAgentMessageSchema = z.object({
type: z.literal("send_agent_message"),
@@ -1527,8 +1524,7 @@ export const SendAgentMessageRequestSchema = z.object({
sourceAgentServerId: z.string().min(1).optional(),
sessionMode: z.string().optional(),
messageId: z.string().optional(), // Client-provided ID for deduplication
/** queue needs an agent sender. */
activeTurnBehavior: AgentActiveTurnBehaviorSchema.optional(),
activeTurnBehavior: ActiveTurnBehaviorSchema.optional(),
images: z.array(ImageAttachmentSchema).optional(),
attachments: AgentAttachmentsSchema,
});
@@ -4182,8 +4178,6 @@ export const ServerInfoStatusPayloadSchema = z
canonicalSubmittedPrompts: z.boolean().optional(),
agentMessageProvenance: z.boolean().optional(),
agentMessageBatching: z.boolean().optional(),
// COMPAT(agentActiveTurnBehaviors): added in v0.17.2, remove gate after 2027-05-22.
agentActiveTurnBehaviors: z.boolean().optional(),
// COMPAT(agentTurnIdentity): accept peers that observed pre-release v0.2.6 through 2027-01-31.
agentTurnIdentity: z.boolean().optional(),
// COMPAT(stableProjectIdentity): added in v0.1.109, remove gate after 2027-01-15.
@@ -5529,10 +5523,6 @@ export const SendAgentMessageResponseMessageSchema = z.object({
agentId: z.string(),
accepted: z.boolean(),
deliveryStatus: z.literal("queued").optional(),
/** The behavior applied to a queued agent message. */
activeTurnBehavior: AgentActiveTurnBehaviorSchema.optional(),
/** What happens to a queued agent message, and how the sender can change it. */
guidance: z.string().optional(),
error: z.string().nullable(),
}),
});
@@ -1,10 +0,0 @@
# Native assets the postinstall script downloads (see postinstall.mjs).
/cpp/highlight/vendor/grammars/
/cpp/highlight/vendor/tree-sitter/
/ios/vendor/
/ios/vendor.staging/
/ios/vendor.backup/
# Android build output when Gradle builds this library from source.
/android/.cxx/
/android/.gradle/
@@ -1,20 +0,0 @@
MIT License
Copyright (c) 2025 Software Mansion
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,287 +0,0 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/b1efabc5-37df-4ddc-8fbb-6f587fdcb5e6">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/eb844f3b-4b63-4327-bf5e-569e4573dedc">
<img alt="Enriched Markdown by Software Mansion" src="https://github.com/user-attachments/assets/b1efabc5-37df-4ddc-8fbb-6f587fdcb5e6">
</picture>
<a href="https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-react-native-enriched-1&n=1"><img src="https://swm-delivery.com/www/images/zone-gh-react-native-enriched-1?n=1" /></a>
<a href="https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-react-native-enriched-2&n=1"><img src="https://swm-delivery.com/www/images/zone-gh-react-native-enriched-2?n=1" /></a>
<a href="https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-react-native-enriched-3&n=1"><img src="https://swm-delivery.com/www/images/zone-gh-react-native-enriched-3?n=1" /></a>
# react-native-enriched-markdown
`react-native-enriched-markdown` is a powerful React Native library that renders Markdown content as native text and provides a rich text input with Markdown output. It supports iOS, Android, macOS, and Web, and requires the New Architecture (Fabric) for native platforms.
### EnrichedMarkdownText
- ⚡ Fully native text rendering (no WebView)
- 🌐 Web support via [react-native-web](https://necolas.github.io/react-native-web/) + [md4c](https://github.com/mity/md4c) compiled to WebAssembly
- 🎯 High-performance Markdown parsing with [md4c](https://github.com/mity/md4c)
- 📐 CommonMark standard compliant
- 📊 GitHub Flavored Markdown (GFM)
- 🧮 LaTeX math rendering (block `$$...$$` with `flavor="github"`, inline `$...$` in all flavors)
- 🔀 [Markdown Streaming](../../docs-md/MARKDOWN_STREAMING.md) support (via [react-native-streamdown](https://github.com/software-mansion-labs/react-native-streamdown))
- 🎨 Fully customizable styles for all elements
- ✨ Text selection and copy support
- 📌 Custom text selection context menu items
- 🔗 Interactive link handling with [per-URL-pattern styling](../../docs-md/MENTIONS.md#link-variants-styling) (`linkVariants`)
- 💊 [Native link pills](../../docs-md/MENTIONS.md#native-link-pills) — links as rounded chips with an icon and label, per URL pattern or per link (iOS, Android)
- 📎 [Long-press menus for links](../../docs-md/API_REFERENCE.md#linkcontextmenuitems) with your own items per URL pattern (`linkContextMenuItems`, iOS 17+)
- 👤 Renders mentions as styled links (compatible with `EnrichedMarkdownTextInput` mention output)
- 🙈 Spoiler text with animated particle overlay and tap-to-reveal
- 🖼️ Native image interactions (iOS: Copy, Save to Camera Roll)
- 🎬 Native video playback — block-level videos via HTML `<video>` tag
- 🌐 Native platform features (Translate, Look Up, Search Web, Share)
- 🗣️ Accessibility support (VoiceOver on iOS, TalkBack on Android, semantic HTML on web)
- 🔄 Full RTL (right-to-left) support including text, lists, blockquotes, tables, and task lists
### EnrichedMarkdownTextInput
- ✏️ Rich text input with Markdown output
- 🕹️ Imperative API for toggling styles and managing links
- 📋 Native context menu with formatting submenu
- 🔍 Real-time style state detection
- 🔗 Auto-link detection with customizable regex
- 🔄 Smart copy/paste with Markdown preservation
- 🎨 Customizable bold, italic, and link colors
- 👤 [Mentions](../../docs-md/MENTIONS.md) with configurable indicators, suggestion lifecycle events, and per-pattern link styling
Since 2012 [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues.
We can help you build your next dream product –
[Hire us](https://swmansion.com/contact/projects?utm_source=react-native-enriched-markdown&utm_medium=readme).
## Table of Contents
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Native assets (install-time download)](../../docs-md/NATIVE_ASSETS.md)
- [EnrichedMarkdownText](#enrichedmarkdowntext-1)
- [Usage](../../docs-md/TEXT.md#usage)
- [Supported Markdown Elements](../../docs-md/TEXT.md#supported-markdown-elements)
- [Copy Options](../../docs-md/TEXT.md#copy-options)
- [Accessibility](../../docs-md/TEXT.md#accessibility)
- [RTL Support](../../docs-md/TEXT.md#rtl-support)
- [Customizing Styles](../../docs-md/TEXT.md#customizing-styles)
- [LaTeX Math](../../docs-md/LATEX_MATH.md)
- [Image Caching](../../docs-md/IMAGE_CACHING.md)
- [Markdown Streaming](../../docs-md/MARKDOWN_STREAMING.md)
- [EnrichedMarkdownTextInput](#enrichedmarkdowntextinput-1)
- [Usage](../../docs-md/INPUT.md#usage)
- [Inline Styles](../../docs-md/INPUT.md#inline-styles)
- [Links](../../docs-md/INPUT.md#links)
- [Auto-Link Detection](../../docs-md/INPUT.md#auto-link-detection)
- [Mentions](../../docs-md/MENTIONS.md)
- [Style Detection](../../docs-md/INPUT.md#style-detection)
- [Other Events](../../docs-md/INPUT.md#other-events)
- [Customizing Styles](../../docs-md/INPUT.md#customizing-enrichedmarkdowntextinput--styles)
- [API Reference](#api-reference)
- [Testing with Jest](../../docs-md/TESTING.md)
- [Web Support](../../docs-md/WEB.md)
- [macOS Support](../../docs-md/MACOS.md)
- [Compatibility Table](#compatibility-table)
- [Contributing](#contributing)
- [Future Plans](#future-plans)
- [License](#license)
## Prerequisites
**Native (iOS / Android / macOS)**
- Requires [the React Native New Architecture (Fabric)](https://reactnative.dev/architecture/landing-page)
- See [Compatibility Table](#compatibility-table) for supported React Native versions
- macOS support via [react-native-macos](https://github.com/microsoft/react-native-macos) `0.81+`
**Web**
- Requires [`react-native-web`](https://necolas.github.io/react-native-web/) and Metro (or another bundler with `.web.tsx` platform resolution)
- No New Architecture requirement — the web renderer runs entirely in JavaScript via WebAssembly
- Only `EnrichedMarkdownText` is supported on web (`EnrichedMarkdownTextInput` is native-only)
- LaTeX math requires the optional [`katex`](https://katex.org/) peer dependency
## Installation
### Web
No steps beyond having `react-native-web` configured. For LaTeX math, install the optional peer dependency:
```sh
npm install katex
# or
yarn add katex
```
See [Web Support](../../docs-md/WEB.md) for full setup details, supported features, and prop behaviour.
### Bare React Native app (iOS / Android)
#### 1. Install the library
```sh
yarn add react-native-enriched-markdown
```
> [!TIP]
> To try the latest features before they land in a stable release, install the nightly build:
>
> ```sh
> yarn add react-native-enriched-markdown@nightly
> ```
>
> Nightly versions are published to npm automatically and may contain breaking changes.
> [!NOTE]
> On install, a `postinstall` script downloads the large native assets used by code highlighting
> and iOS LaTeX math (kept out of the npm tarball to keep it ~1 MB). This needs network access to
> `registry.npmjs.org` and `github.com`. If you install offline, with `--ignore-scripts`, or with
> **pnpm** (which blocks dependency scripts by default), see
> [Native assets](../../docs-md/NATIVE_ASSETS.md) for how to restore them.
#### Configuration
Add an `"enriched-markdown"` block to your app's `package.json` to configure which features are enabled:
```json
{
"enriched-markdown": {
"enableCodeHighlight": true,
"enableMath": true,
"enableVideo": true,
"codeHighlightLanguages": ["javascript", "typescript", "python", "swift", "kotlin"]
}
}
```
| Key | Type | Default | Description |
|---|---|---|---|
| `enableCodeHighlight` | `boolean` | `true` | Download and compile tree-sitter grammars for syntax highlighting |
| `enableMath` | `boolean` | `true` | Download [RaTeX](https://ratex.lites.dev/) for LaTeX math rendering (iOS) and include the Maven dependency (Android) |
| `enableVideo` | `boolean` | `true` | Enable native video playback. Adds Media3 ExoPlayer (~2-3 MB) on Android; uses built-in AVKit on iOS. Set to `false` to exclude the dependency |
| `codeHighlightLanguages` | `string[]` | all default grammars | Subset of languages to compile (reduces binary size). Ignored when `enableCodeHighlight` is `false`; an empty array `[]` compiles none (same as disabling). |
Your app's `package.json` is the single source of truth. `postinstall` reads it to decide
what to **download** into `node_modules`, and the native build (iOS podspec / Android
`build.gradle`) reads it directly to decide what to **compile and link** — no Podfile ENV
vars or `gradle.properties` edits needed. Changing a value takes effect on your next
`pod install` / native rebuild; **enabling** a feature that was off also needs a reinstall
(`npm install` / `npm rebuild react-native-enriched-markdown`) so its assets get downloaded.
> [!IMPORTANT]
> **iOS applies config at `pod install`, not at build time.** After editing the `enriched-markdown`
> block, run `pod install` (a plain `run-ios` reuses the previously resolved pod). When **disabling** a
> feature that was already compiled in — or narrowing `codeHighlightLanguages` — also do a clean build
> (`Product > Clean Build Folder`), since Xcode's incremental build can link a stale pod library.
> Android reconfigures on every build and needs neither step.
> [!TIP]
> If you don't use a feature, disabling it skips the download **and** excludes it from the native build.
> See [Skipping the download](../../docs-md/NATIVE_ASSETS.md#skipping-the-download-opt-out) for details.
> [!NOTE]
> **Monorepos:** the native build reads the **app's** `package.json` (the one next to
> `ios/`/`android/`), so each app can enable/disable features independently. The download
> opt-out is resolved where you run the install — usually the workspace root — so to skip a
> download entirely, put the opt-out in the **root** `package.json`.
> [!NOTE]
> Migrating from the Expo config plugin or the `ENV` / `gradle.properties` build flags? See
> [Breaking changes](../../docs-md/BREAKING_CHANGES.md).
#### 2. Install iOS / macOS dependencies
The library includes native code so you will need to re-build the native app.
```sh
# iOS
cd ios && bundle install && bundle exec pod install
# macOS (react-native-macos)
cd macos && bundle install && bundle exec pod install
```
### Expo app
#### 1. Install the library
```sh
npx expo install react-native-enriched-markdown
```
#### 2. Run prebuild
The library includes native code so you will need to re-build the native app.
```sh
npx expo prebuild
```
> [!NOTE]
> The library won't work in Expo Go as it needs native changes.
> [!NOTE]
> `npx expo install` runs the same `postinstall` asset download described under
> [Native assets](../../docs-md/NATIVE_ASSETS.md); it needs network access and does not work with Yarn PnP.
> [!IMPORTANT]
> **iOS: Save to Camera Roll**
>
> If your Markdown content includes images and you want users to save them to their photo library, add the following to your `Info.plist`:
>
> ```xml
> <key>NSPhotoLibraryAddUsageDescription</key>
> <string>This app needs access to your photo library to save images.</string>
> ```
## EnrichedMarkdownText
See [EnrichedMarkdownText](../../docs-md/TEXT.md) for detailed documentation on usage examples, GFM tables, task lists, link handling, supported elements, copy options, accessibility, RTL support, and customizing styles. Mentions created by `EnrichedMarkdownTextInput` render as styled links — use [`linkVariants`](../../docs-md/MENTIONS.md#link-variants-styling) to customize their appearance.
## EnrichedMarkdownTextInput
See [EnrichedMarkdownTextInput](../../docs-md/INPUT.md) for detailed documentation on usage examples, inline styles, links, style detection, events, and customizing styles.
## API Reference
See the [API Reference](../../docs-md/API_REFERENCE.md) for a detailed overview of all the props, methods, and events available.
## Web Support
See [Web Support](../../docs-md/WEB.md) for details on supported features, web-specific prop behaviour, and known limitations.
## macOS Support
`react-native-enriched-markdown` supports macOS via [react-native-macos](https://github.com/microsoft/react-native-macos). See [macOS Support](../../docs-md/MACOS.md) for details on macOS-specific features, known limitations, and the example app.
## Future Plans
We're actively working on expanding the capabilities of `react-native-enriched-markdown`. Here's what's on the roadmap:
- `EnrichedMarkdownTextInput`: headings, lists, blockquotes, code blocks, inline images
- `EnrichedMarkdownTextInput` web support
- macOS: block math rendering, VoiceOver accessibility, tail fade-in animation
- Web: spoiler text, streaming animation, configurable link `target`, copy options (Copy as Markdown, multi-format clipboard)
## Compatibility Table
| | 0.82 | 0.83 | 0.84 | 0.85 | 0.86 | 0.87 |
| ----------- | :--: | :--: | :--: | :--: | :--: | :--: |
| **nightly** | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **1.1.x** | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **1.0.x** | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **0.7.0** | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **0.6.0** | ⛔ | ✅ | ✅ | ✅ | ⛔ | ⛔ |
| **0.5.0** | ⛔ | ✅ | ✅ | ✅ | ⛔ | ⛔ |
| **0.4.x** | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ |
| **0.3.0** | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ |
## Contributing
See the [contributing guide](../../CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
`react-native-enriched-markdown` library is licensed under [The MIT License](../../LICENSE).
---
Built by [Software Mansion](https://swmansion.com/).
[<img width="128" height="69" alt="Software Mansion Logo" src="https://github.com/user-attachments/assets/f0e18471-a7aa-4e80-86ac-87686a86fe56" />](https://swmansion.com/)
@@ -1,150 +0,0 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
monorepo = File.exist?(File.expand_path("../core/EnrichedMarkdownCore.podspec", __dir__))
cpp_root = monorepo ? "$(PODS_TARGET_SRCROOT)/../core/cpp" : "$(PODS_TARGET_SRCROOT)/cpp"
require File.join(__dir__, "cpp/highlight/code_highlight_podspec.rb")
# In the monorepo the C++ (including tree-sitter highlighting) compiles in the
# EnrichedMarkdownCore pod; only the published, core-less build compiles it here.
code_highlight = monorepo ? EnrichedMarkdownCodeHighlight.disabled : EnrichedMarkdownCodeHighlight.config(__dir__)
Pod::Spec.new do |s|
s.name = "ReactNativeEnrichedMarkdown"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.platforms = { :ios => min_ios_version_supported, :osx => '14.0' }
s.source = { :git => "https://github.com/software-mansion/enriched-markdown.git", :tag => "#{s.version}" }
if monorepo
s.private_header_files = "ios/**/*.h"
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
s.dependency "EnrichedMarkdownCore"
else
s.private_header_files = "ios/**/*.h", "cpp/**/*.{h,hpp}"
s.source_files = ["ios/**/*.{h,m,mm,cpp,swift}", "cpp/md4c/*.{c,h}", "cpp/parser/*.{hpp,cpp}", "cpp/highlight/*.{hpp,cpp}"] + code_highlight[:source_files]
s.preserve_paths = "cpp/highlight/vendor/**/*" if code_highlight[:enabled]
end
# LaTeX math rendering (RaTeX, iOS only). RaTeX ships as a prebuilt static XCFramework
# vendored under ios/vendor (restored by vendor/vendor-ratex.mjs at postinstall); it
# links under CocoaPods default static linkage and needs neither `use_frameworks!` nor
# SPM interop.
#
# The app package.json "enriched-markdown" block is the source of truth; ENV is a
# deprecated fallback. `math_explicit` tracks an active opt-in (vs the implicit
# default), which decides the missing-framework behavior below.
config = EnrichedMarkdownConfig.consumer_config
# "present" mirrors the code-highlight side (see code_highlight_podspec.rb, which
# gates on grammars/.stamp): the vendor script writes ios/vendor/.stamp only after
# the XCFramework, the four Swift sources, and the fonts have all landed and it
# swaps the tree into place atomically. Gating on the XCFramework directory alone
# would treat a half-finished download (framework extracted, Swift sources/fonts
# still missing) as ready and compile the RaTeX bridge against sources that are not
# there, failing several hundred lines into the pod build with an opaque Swift
# "cannot find type 'RaTeXRenderer' in scope" (#745).
ratex_dir = File.join(__dir__, 'ios/vendor')
# File.file? (not File.exist?) so a stray .stamp/ directory can't pass the check and
# reintroduce the #745 failure mode; the vendor script only ever writes it as a file.
ratex_present = File.directory?(File.join(ratex_dir, 'RaTeX.xcframework')) &&
File.file?(File.join(ratex_dir, '.stamp'))
math_flag = ENV['ENRICHED_MARKDOWN_ENABLE_MATH']
if config.key?('enableMath')
math_requested = config['enableMath'] != false
math_explicit = math_requested
if math_flag
EnrichedMarkdownConfig.warn_once(:math_env, '[ReactNativeEnrichedMarkdown] DEPRECATED: ENV[\'ENRICHED_MARKDOWN_ENABLE_MATH\'] ' \
'is ignored when "enriched-markdown".enableMath is set in your package.json.')
end
elsif math_flag
EnrichedMarkdownConfig.warn_once(:math_env, '[ReactNativeEnrichedMarkdown] DEPRECATED: ENV[\'ENRICHED_MARKDOWN_ENABLE_MATH\'] ' \
'will be removed in a future version. Configure via "enriched-markdown".enableMath in your package.json instead.')
math_requested = math_flag == '1'
math_explicit = math_requested
else
math_requested = true
math_explicit = false
end
# RaTeX is downloaded at postinstall and kept out of the tarball. Reconcile the
# request with the vendored tree: an explicit opt-in with the tree missing or
# incomplete fails loud; on by default but missing (a partial/failed download, or a
# monorepo root opt-out) falls back to a clean build without math.
enable_math = math_requested && ratex_present
if !math_requested
EnrichedMarkdownConfig.warn_once(:math_disabled, '[ReactNativeEnrichedMarkdown] LaTeX math disabled via ' \
'"enriched-markdown".enableMath = false in your app package.json.')
elsif !ratex_present
if math_explicit
raise '[ReactNativeEnrichedMarkdown] LaTeX math is enabled but the vendored RaTeX ' \
'assets are missing or incomplete at ios/vendor (need RaTeX.xcframework, the core ' \
'Swift sources, the fonts, and the .stamp the vendor script writes on success). ' \
'Reinstall to fetch them: `npm rebuild react-native-enriched-markdown`. ' \
'To disable math, set "enriched-markdown".enableMath = false in your app package.json. ' \
'Troubleshooting: https://github.com/software-mansion/enriched-markdown/blob/main/docs-md/NATIVE_ASSETS.md'
end
EnrichedMarkdownConfig.warn_once(:math_disabled, '[ReactNativeEnrichedMarkdown] LaTeX math disabled: the vendored RaTeX ' \
'assets were not found or are incomplete at ios/vendor. If this is unintended, re-run ' \
'`node node_modules/react-native-enriched-markdown/postinstall.mjs`.')
end
# The RaTeX XCFramework bundles its own module.modulemap and headers; never let the
# broad ios/**/*.h and ios/**/*.swift globs treat its internals as pod sources.
exclude = ["ios/vendor/RaTeX.xcframework/**/*"]
# ios/math holds the RaTeX bridge; ios/vendor/*.swift are RaTeX's vendored core Swift
# sources. Both compile into this pod's module only when math is enabled.
exclude += ["ios/math/**/*.swift", "ios/vendor/*.swift"] unless enable_math
s.exclude_files = exclude
# Bounded decoding of native pill icons.
s.frameworks = "ImageIO"
# Video playback (AVKit, built into iOS — no external framework or vendored asset).
# Default on: consumers opt out via "enriched-markdown".enableVideo = false in package.json.
enable_video = config.key?('enableVideo') ? config['enableVideo'] != false : true
preprocessor_defs = "$(inherited) MD4C_USE_UTF8=1#{code_highlight[:defines]}"
if enable_video
preprocessor_defs += ' ENRICHED_MARKDOWN_VIDEO=1'
end
if enable_math
preprocessor_defs += ' ENRICHED_MARKDOWN_MATH=1'
# enable_math already implies ratex_present, i.e. a complete vendored tree marked by
# ios/vendor/.stamp (the reconciliation above raises on an explicit opt-in with a
# missing/incomplete tree and disables the default-on path), so the vendored
# references below always resolve.
# Prebuilt static XCFramework (device + simulator[arm64,x86_64] + macOS). Vendored
# rather than pulled via spm_dependency, which compiled RaTeX's Swift wrapper per
# requested arch (breaking universal simulator builds, #527) and double-collected
# its XCFramework signature during archive assembly (#491).
s.vendored_frameworks = 'ios/vendor/RaTeX.xcframework'
# RaTeXFontLoader.loadFromCocoaPodsBundle() resolves "RaTeXCoreFonts.bundle" by name,
# so this resource-bundle name is load-bearing -- keep it exactly RaTeXCoreFonts.
s.resource_bundles = { 'RaTeXCoreFonts' => ['ios/vendor/Fonts/*.ttf'] }
end
pod_xcconfig = {
'HEADER_SEARCH_PATHS' => ([
"\"#{cpp_root}/md4c\"", "\"#{cpp_root}/parser\"", "\"#{cpp_root}/highlight\"",
"\"$(PODS_TARGET_SRCROOT)/ios/internals\"", "\"$(PODS_TARGET_SRCROOT)/ios/input/internals\""
] + code_highlight[:header_paths].map { |p| "\"$(PODS_TARGET_SRCROOT)/#{p}\"" }).join(" "),
'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_defs,
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
'DEFINES_MODULE' => 'YES'
}
# No EXCLUDED_ARCHS dance: the vendored simulator slice (ios-arm64_x86_64-simulator)
# already contains x86_64, so universal simulator builds resolve on both arches.
s.pod_target_xcconfig = pod_xcconfig
# No script phases: vendoring a single prebuilt XCFramework means there is no
# spm_dependency-generated duplicate RaTeXFFI modulemap to strip, and only one
# signature is collected during archive assembly, so nothing collides.
install_modules_dependencies(s)
end
@@ -1,312 +0,0 @@
buildscript {
ext.getExtOrDefault = {name ->
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['EnrichedMarkdown_' + name]
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.7.2"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
}
}
apply plugin: "com.android.library"
// Android Gradle Plugin 9 ships built-in Kotlin support and applies the Kotlin
// plugin itself. Applying it a second time fails the configuration phase with
// "Cannot add extension with name 'kotlin'". Apply it only when AGP is not
// providing Kotlin: AGP 8 and older, or AGP 9 with android.builtInKotlin=false.
def shouldApplyKotlinPlugin() {
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
if (agpMajor <= 8) {
return true
}
// AGP 10 removes the opt-out: built-in Kotlin is always active there.
if (agpMajor >= 10) {
return false
}
def propertyVal = providers.gradleProperty("android.builtInKotlin").orNull
def builtInKotlinEnabled = propertyVal != null ? propertyVal.toBoolean() : true
return !builtInKotlinEnabled
}
if (shouldApplyKotlinPlugin()) {
apply plugin: "kotlin-android"
}
apply plugin: "com.facebook.react"
def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["EnrichedMarkdown_" + name]).toInteger()
}
// The consumer app's package.json "enriched-markdown" block is the build-time source of
// truth for feature toggles (mirrors the iOS podspecs and react-native-worklets). It is
// read from the Gradle build root -- "<app>/package.json", one level above the "<app>/android"
// dir -- so in a monorepo it resolves to the app being built, not the workspace root.
// Per-app config therefore works; the download side (postinstall) is a separate,
// install-time decision. Gradle properties remain a deprecated fallback.
def consumerConfig = [:]
def consumerAppName = null
def consumerPackageJson = new File(rootProject.projectDir, "../package.json")
if (consumerPackageJson.exists()) {
def parsed = new groovy.json.JsonSlurper().parse(consumerPackageJson)
if (parsed instanceof Map) {
if (parsed["enriched-markdown"] instanceof Map) {
consumerConfig = parsed["enriched-markdown"]
}
consumerAppName = parsed["name"]
}
}
// Filesystem-safe per-app slug: package.json "name", else the app directory name -- the
// same source and fallback the iOS podspec uses (installation root's parent), so both
// platforms derive an identical slug for the same app. It keys the per-app generated
// code-highlight registry (generated-<slug>) below so the artifact layout matches iOS and
// two monorepo apps with different custom language sets never share one dir.
def consumerAppSlug = (consumerAppName ?: rootProject.projectDir.parentFile?.name ?: "app").toString()
.replaceAll('[^A-Za-z0-9._-]+', '-').replaceAll('^-+|-+$', '')
if (!consumerAppSlug) consumerAppSlug = "app"
// Video: package.json > default true. Android video uses Media3 ExoPlayer as a Maven
// dependency. Disable via "enriched-markdown".enableVideo = false to save ~2-3 MB.
def enableVideo = consumerConfig.containsKey("enableVideo") ? consumerConfig.enableVideo != false : true
// Math: package.json > gradle property (deprecated) > default true. Android math is a
// Maven dependency (no downloaded asset), so the flag simply includes or excludes it --
// there is nothing to be missing, hence no throw as on iOS.
def mathProp = rootProject.findProperty("enrichedMarkdown.enableMath") ?: findProperty("enrichedMarkdown.enableMath")
def enableMath
if (consumerConfig.containsKey("enableMath")) {
enableMath = consumerConfig.enableMath != false
if (mathProp != null) {
logger.warn("[ReactNativeEnrichedMarkdown] DEPRECATED: enrichedMarkdown.enableMath gradle property " +
"is ignored when \"enriched-markdown\".enableMath is set in your package.json.")
}
} else if (mathProp != null) {
logger.warn("[ReactNativeEnrichedMarkdown] DEPRECATED: enrichedMarkdown.enableMath gradle property " +
"will be removed in a future version. Configure via \"enriched-markdown\".enableMath in your package.json instead.")
enableMath = mathProp.toString().toBoolean()
} else {
enableMath = true
}
// Default grammar set derived from the single source of truth,
// vendor/grammar-versions.json (every grammar with default:true), so the compiled
// grammars always match the registry gen-registry generates from the same
// manifest. Resolved in both layouts like gen-registry.mjs below:
// "../../../vendor" in the monorepo, "../cpp/highlight" when published.
def grammarManifest = [
new File(projectDir, "../../../vendor/grammar-versions.json"),
new File(projectDir, "../cpp/highlight/grammar-versions.json"),
].find { it.exists() }
if (grammarManifest == null) {
throw new GradleException("[code-highlight] grammar-versions.json not found; cannot resolve the default language set. Build from the monorepo or a published tarball.")
}
def defaultCodeHighlightLanguages = new groovy.json.JsonSlurper().parse(grammarManifest)
.grammars.findAll { id, spec -> spec['default'] }.collect { id, spec -> id }
// Code highlight enable: package.json > gradle property (deprecated) > default on.
// `codeHighlightExplicit` tracks an active opt-in (vs the implicit default), which
// decides the missing-grammars behavior below.
def codeHighlightProp = rootProject.findProperty("enrichedMarkdown.enableCodeHighlight") ?: findProperty("enrichedMarkdown.enableCodeHighlight")
def codeHighlightStamp = new File(projectDir, "../cpp/highlight/vendor/grammars/.stamp")
def codeHighlightRequested
def codeHighlightExplicit
if (consumerConfig.containsKey("enableCodeHighlight")) {
codeHighlightRequested = consumerConfig.enableCodeHighlight != false
codeHighlightExplicit = codeHighlightRequested
if (codeHighlightProp != null) {
logger.warn("[ReactNativeEnrichedMarkdown] DEPRECATED: enrichedMarkdown.enableCodeHighlight gradle property " +
"is ignored when \"enriched-markdown\".enableCodeHighlight is set in your package.json.")
}
} else if (codeHighlightProp != null) {
logger.warn("[ReactNativeEnrichedMarkdown] DEPRECATED: enrichedMarkdown.enableCodeHighlight gradle property " +
"will be removed in a future version. Configure via \"enriched-markdown\".enableCodeHighlight in your package.json instead.")
codeHighlightRequested = codeHighlightProp.toString().toBoolean()
codeHighlightExplicit = codeHighlightRequested
} else {
codeHighlightRequested = true
codeHighlightExplicit = false
}
// The grammars/.stamp marker is written only after every grammar source is fully vendored
// at postinstall. An explicit opt-in with the grammars missing fails loud with the fix; on
// by default but missing (a partial/failed download, or a monorepo root opt-out) falls back
// to a clean no-op build. Gating on the stamp also keeps CMake from being fed missing sources.
def enableCodeHighlight
if (!codeHighlightRequested) {
enableCodeHighlight = false
} else if (codeHighlightStamp.exists()) {
enableCodeHighlight = true
} else if (codeHighlightExplicit) {
throw new GradleException("[ReactNativeEnrichedMarkdown] code highlighting is enabled but the tree-sitter " +
"grammars are not installed. Reinstall to fetch them: `npm rebuild react-native-enriched-markdown`. " +
"To disable, set \"enriched-markdown\".enableCodeHighlight = false in your app package.json. " +
"Troubleshooting: https://github.com/software-mansion/enriched-markdown/blob/main/docs-md/NATIVE_ASSETS.md")
} else {
enableCodeHighlight = false
}
// Languages: package.json > gradle property (deprecated) > manifest defaults. An explicit
// empty array disables all languages (codeHighlightActive below); only the default/property
// paths fall back to the manifest set.
def codeHighlightLanguagesProp = rootProject.findProperty("enrichedMarkdown.codeHighlightLanguages") ?: findProperty("enrichedMarkdown.codeHighlightLanguages")
def codeHighlightLanguages
if (consumerConfig.get("codeHighlightLanguages") instanceof List) {
codeHighlightLanguages = consumerConfig.codeHighlightLanguages.collect { it.toString().trim() }.findAll { it }
if (codeHighlightLanguagesProp != null) {
logger.warn("[ReactNativeEnrichedMarkdown] DEPRECATED: enrichedMarkdown.codeHighlightLanguages gradle property " +
"is ignored when \"enriched-markdown\".codeHighlightLanguages is set in your package.json.")
}
} else if (codeHighlightLanguagesProp) {
logger.warn("[ReactNativeEnrichedMarkdown] DEPRECATED: enrichedMarkdown.codeHighlightLanguages gradle property " +
"will be removed in a future version. Configure via \"enriched-markdown\".codeHighlightLanguages in your package.json instead.")
codeHighlightLanguages = codeHighlightLanguagesProp.toString().split(",").collect { it.trim() }.findAll { it }
} else {
codeHighlightLanguages = defaultCodeHighlightLanguages
}
def codeHighlightActive = enableCodeHighlight && !codeHighlightLanguages.isEmpty()
android {
namespace "com.swmansion.enriched.markdown"
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
consumerProguardFiles "consumer-rules.pro"
buildConfigField "boolean", "ENABLE_MATH", "${enableMath}"
buildConfigField "boolean", "ENABLE_VIDEO", "${enableVideo}"
buildConfigField "boolean", "ENABLE_CODE_HIGHLIGHT", "${codeHighlightActive}"
}
buildFeatures {
buildConfig true
}
testOptions {
unitTests.includeAndroidResources = true
}
buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
disable "GradleCompatible"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
java.srcDirs += [
"generated/java",
"generated/jni"
]
if (enableMath) {
java.srcDirs += ["src/math/java"]
}
if (enableVideo) {
java.srcDirs += ["src/video/java"]
}
}
}
}
// Code-block syntax highlighting (tree-sitter) native wiring. This module owns
// no externalNativeBuild block: RN autolinking compiles src/main/jni/CMakeLists.txt
// as part of the consumer app's native build, so the app -- not this library --
// owns the CMake arguments. The enable flag + selected grammars therefore reach
// CMake through a config file written here during configuration (before any
// native build task runs) and include()d by CMakeLists.txt.
def highlightConfigDir = new File(projectDir, "build/generated/highlight")
highlightConfigDir.mkdirs()
def highlightConfigFile = new File(highlightConfigDir, "highlight-config.cmake")
if (codeHighlightActive) {
def vendorDir = new File(projectDir, "../cpp/highlight/vendor").canonicalPath
def committedGenerated = new File(vendorDir, "generated")
def generatedDir
if (codeHighlightLanguages.toSorted() == defaultCodeHighlightLanguages.toSorted() && committedGenerated.exists()) {
// Common case: the committed default-set registry ships in-tree, no codegen.
generatedDir = committedGenerated
} else {
// Custom language set: regenerate the registry from the vendored .scm files into a
// per-app dir (generated-<slug>), mirroring iOS. Android rewrites this on every
// gradle configure so it never had iOS's persistent clash, but keying per app keeps
// the two platforms' artifact layout identical. (highlight-config.cmake itself stays
// at the CMakeLists-fixed shared path and is rewritten each configure.)
generatedDir = new File(highlightConfigDir, "generated-${consumerAppSlug}")
generatedDir.mkdirs()
def genScript = [
new File(projectDir, "../../../vendor/gen-registry.mjs"),
new File(projectDir, "../cpp/highlight/gen-registry.mjs"),
].find { it.exists() }
if (genScript == null) {
throw new GradleException("enrichedMarkdown.codeHighlightLanguages is customized but vendor/gen-registry.mjs was not found. Use the default language set or build from the monorepo.")
}
// Run node directly via ProcessBuilder rather than Project.exec {}, which was
// removed in Gradle 9. Runs at configuration time (before the native build),
// and surfaces gen-registry's own stderr on failure.
def genCmd = ["node", genScript.canonicalPath, "--vendor-dir", vendorDir,
"--languages", codeHighlightLanguages.join(","), "--out", generatedDir.canonicalPath]
def genProc = new ProcessBuilder(genCmd).redirectErrorStream(true).start()
def genOut = genProc.inputStream.text
def genExit = genProc.waitFor()
if (genExit != 0) {
throw new GradleException("[code-highlight] gen-registry.mjs failed (exit ${genExit}):\n${genOut}")
}
}
highlightConfigFile.text = """\
set(ENRICHED_MARKDOWN_CODE_HIGHLIGHT ON)
set(ENRICHED_MARKDOWN_HIGHLIGHT_LANGUAGES "${codeHighlightLanguages.join(';')}")
set(ENRICHED_MARKDOWN_HIGHLIGHT_GENERATED_DIR "${generatedDir.canonicalPath.replace('\\', '/')}")
"""
} else {
highlightConfigFile.text = "set(ENRICHED_MARKDOWN_CODE_HIGHLIGHT OFF)\n"
}
repositories {
mavenCentral()
google()
}
def kotlin_version = getExtOrDefault("kotlinVersion")
dependencies {
// JVM unit tests (Robolectric) for the library's Kotlin spans/renderers. Run with
// `./gradlew :react-native-enriched-markdown:testDebugUnitTest` from an app that
// autolinks this module (e.g. apps/react-native-example/android). Mirrors the
// standalone @enriched-markdown/android test stack.
testImplementation "junit:junit:4.13.2"
testImplementation "org.robolectric:robolectric:4.14.1"
implementation "com.facebook.react:react-android"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// Baseline Profile installer for AOT compilation hints
implementation "androidx.profileinstaller:profileinstaller:1.3.1"
// LaTeX math rendering (optional — set enrichedMarkdown.enableMath=false in gradle.properties to exclude)
if (enableMath) {
implementation("io.github.erweixin:ratex-android:0.1.14")
}
// Video playback (optional — set "enriched-markdown".enableVideo = false in package.json to exclude)
if (enableVideo) {
implementation("androidx.media3:media3-exoplayer:1.6.0")
implementation("androidx.media3:media3-ui:1.6.0")
}
}
react {
jsRootDir = file("../src/")
libraryName = "EnrichedMarkdownText"
codegenJavaPackageName = "com.swmansion.enriched.markdown"
}
@@ -1,24 +0,0 @@
# ProGuard/R8 consumer rules for react-native-enriched-markdown
#
# JNI: Classes accessed from C++ (jni-adapter.cpp) via FindClass/GetFieldID.
# R8 cannot trace hardcoded string lookups in native code.
-keep class com.swmansion.enriched.markdown.parser.MarkdownASTNode { *; }
-keep class com.swmansion.enriched.markdown.parser.MarkdownASTNode$NodeType { *; }
-keep class com.swmansion.enriched.markdown.parser.Md4cFlags { *; }
-keep class com.swmansion.enriched.markdown.parser.TextLinkMatching { *; }
-keep class com.swmansion.enriched.markdown.utils.common.LinkRegexConfig { *; }
# Reflection: Math classes loaded via Class.forName when enableMath=true.
-keep class com.swmansion.enriched.markdown.spans.MathInlineSpan { *; }
-keep class com.swmansion.enriched.markdown.spans.MathInlinePlaceholderSpan { *; }
-keep class com.swmansion.enriched.markdown.spans.MathMeasureHelper { *; }
-keep class com.swmansion.enriched.markdown.views.MathContainerView { *; }
-keep class com.swmansion.enriched.markdown.renderer.MathInlineRenderer { *; }
# Reflection: Video container loaded via Class.forName when enableVideo=true.
-keep class com.swmansion.enriched.markdown.segments.VideoContainerView { *; }
# RaTeX uses JNI to instantiate Java objects from native code.
# R8 cannot trace these lookups and will strip or rename the referenced classes.
-keep class io.ratex.** { *; }
@@ -1,123 +0,0 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
@SuppressWarnings("deprecation")
public class EnrichedMarkdownManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EnrichedMarkdownManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public EnrichedMarkdownManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "markdown":
mViewManager.setMarkdown(view, value == null ? null : (String) value);
break;
case "markdownStyle":
mViewManager.setMarkdownStyle(view, (ReadableMap) value);
break;
case "enableImagePress":
mViewManager.setEnableImagePress(view, value == null ? false : (boolean) value);
break;
case "enableTaskListItemToggle":
mViewManager.setEnableTaskListItemToggle(view, value == null ? true : (boolean) value);
break;
case "enableCodeBlockPress":
mViewManager.setEnableCodeBlockPress(view, value == null ? false : (boolean) value);
break;
case "enableBlockContextMenu":
mViewManager.setEnableBlockContextMenu(view, value == null ? true : (boolean) value);
break;
case "enableLinkPreview":
mViewManager.setEnableLinkPreview(view, value == null ? true : (boolean) value);
break;
case "selectable":
mViewManager.setSelectable(view, value == null ? false : (boolean) value);
break;
case "selectionColor":
mViewManager.setSelectionColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "selectionHandleColor":
mViewManager.setSelectionHandleColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "md4cFlags":
mViewManager.setMd4cFlags(view, (ReadableMap) value);
break;
case "isGFM":
mViewManager.setIsGFM(view, value == null ? true : (boolean) value);
break;
case "allowFontScaling":
mViewManager.setAllowFontScaling(view, value == null ? true : (boolean) value);
break;
case "maxFontSizeMultiplier":
mViewManager.setMaxFontSizeMultiplier(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "allowTrailingMargin":
mViewManager.setAllowTrailingMargin(view, value == null ? false : (boolean) value);
break;
case "streamingAnimation":
mViewManager.setStreamingAnimation(view, value == null ? false : (boolean) value);
break;
case "streamingConfig":
mViewManager.setStreamingConfig(view, (ReadableMap) value);
break;
case "spoilerOverlay":
mViewManager.setSpoilerOverlay(view, value == null ? "particles" : (String) value);
break;
case "contextMenuItems":
mViewManager.setContextMenuItems(view, (ReadableArray) value);
break;
case "imageRequestHeaders":
mViewManager.setImageRequestHeaders(view, (ReadableArray) value);
break;
case "linkPillContent":
mViewManager.setLinkPillContent(view, (ReadableArray) value);
break;
case "linkRecognition":
mViewManager.setLinkRecognition(view, (ReadableMap) value);
break;
case "linkContextMenuItems":
mViewManager.setLinkContextMenuItems(view, (ReadableArray) value);
break;
case "selectionMenuConfig":
mViewManager.setSelectionMenuConfig(view, (ReadableMap) value);
break;
case "accessibilityLabels":
mViewManager.setAccessibilityLabels(view, (ReadableMap) value);
break;
case "textBreakStrategy":
mViewManager.setTextBreakStrategy(view, value == null ? "highQuality" : (String) value);
break;
case "lineBreakStrategyIOS":
mViewManager.setLineBreakStrategyIOS(view, value == null ? "none" : (String) value);
break;
case "writingDirection":
mViewManager.setWritingDirection(view, value == null ? "first-strong" : (String) value);
break;
case "numberOfLines":
mViewManager.setNumberOfLines(view, value == null ? 0 : ((Double) value).intValue());
break;
case "ellipsizeMode":
mViewManager.setEllipsizeMode(view, value == null ? "tail" : (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -1,49 +0,0 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EnrichedMarkdownManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMarkdown(T view, @Nullable String value);
void setMarkdownStyle(T view, @Nullable ReadableMap value);
void setEnableImagePress(T view, boolean value);
void setEnableTaskListItemToggle(T view, boolean value);
void setEnableCodeBlockPress(T view, boolean value);
void setEnableBlockContextMenu(T view, boolean value);
void setEnableLinkPreview(T view, boolean value);
void setSelectable(T view, boolean value);
void setSelectionColor(T view, @Nullable Integer value);
void setSelectionHandleColor(T view, @Nullable Integer value);
void setMd4cFlags(T view, @Nullable ReadableMap value);
void setIsGFM(T view, boolean value);
void setAllowFontScaling(T view, boolean value);
void setMaxFontSizeMultiplier(T view, float value);
void setAllowTrailingMargin(T view, boolean value);
void setStreamingAnimation(T view, boolean value);
void setStreamingConfig(T view, @Nullable ReadableMap value);
void setSpoilerOverlay(T view, @Nullable String value);
void setContextMenuItems(T view, @Nullable ReadableArray value);
void setImageRequestHeaders(T view, @Nullable ReadableArray value);
void setLinkPillContent(T view, @Nullable ReadableArray value);
void setLinkRecognition(T view, @Nullable ReadableMap value);
void setLinkContextMenuItems(T view, @Nullable ReadableArray value);
void setSelectionMenuConfig(T view, @Nullable ReadableMap value);
void setAccessibilityLabels(T view, @Nullable ReadableMap value);
void setTextBreakStrategy(T view, @Nullable String value);
void setLineBreakStrategyIOS(T view, @Nullable String value);
void setWritingDirection(T view, @Nullable String value);
void setNumberOfLines(T view, int value);
void setEllipsizeMode(T view, @Nullable String value);
}
@@ -1,180 +0,0 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
@SuppressWarnings("deprecation")
public class EnrichedMarkdownTextInputManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EnrichedMarkdownTextInputManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public EnrichedMarkdownTextInputManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "defaultValue":
mViewManager.setDefaultValue(view, value == null ? null : (String) value);
break;
case "placeholder":
mViewManager.setPlaceholder(view, value == null ? null : (String) value);
break;
case "placeholderTextColor":
mViewManager.setPlaceholderTextColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "editable":
mViewManager.setEditable(view, value == null ? false : (boolean) value);
break;
case "autoFocus":
mViewManager.setAutoFocus(view, value == null ? false : (boolean) value);
break;
case "scrollEnabled":
mViewManager.setScrollEnabled(view, value == null ? false : (boolean) value);
break;
case "markdownShortcuts":
mViewManager.setMarkdownShortcuts(view, (ReadableMap) value);
break;
case "autoCapitalize":
mViewManager.setAutoCapitalize(view, value == null ? null : (String) value);
break;
case "multiline":
mViewManager.setMultiline(view, value == null ? false : (boolean) value);
break;
case "cursorColor":
mViewManager.setCursorColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "selectionColor":
mViewManager.setSelectionColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "markdownStyle":
mViewManager.setMarkdownStyle(view, (ReadableMap) value);
break;
case "color":
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fontSize":
mViewManager.setFontSize(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "lineHeight":
mViewManager.setLineHeight(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "fontFamily":
mViewManager.setFontFamily(view, value == null ? null : (String) value);
break;
case "fontWeight":
mViewManager.setFontWeight(view, value == null ? null : (String) value);
break;
case "isOnChangeMarkdownSet":
mViewManager.setIsOnChangeMarkdownSet(view, value == null ? false : (boolean) value);
break;
case "contextMenuItems":
mViewManager.setContextMenuItems(view, (ReadableArray) value);
break;
case "selectionMenuConfig":
mViewManager.setSelectionMenuConfig(view, (ReadableMap) value);
break;
case "formatMenuConfig":
mViewManager.setFormatMenuConfig(view, (ReadableMap) value);
break;
case "linkRegex":
mViewManager.setLinkRegex(view, (ReadableMap) value);
break;
case "mentionIndicators":
mViewManager.setMentionIndicators(view, (ReadableArray) value);
break;
case "writingDirection":
mViewManager.setWritingDirection(view, value == null ? "first-strong" : (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
switch (commandName) {
case "focus":
mViewManager.focus(view);
break;
case "blur":
mViewManager.blur(view);
break;
case "setValue":
mViewManager.setValue(view, args.getString(0));
break;
case "setSelection":
mViewManager.setSelection(view, args.getInt(0), args.getInt(1));
break;
case "toggleBold":
mViewManager.toggleBold(view);
break;
case "toggleItalic":
mViewManager.toggleItalic(view);
break;
case "toggleUnderline":
mViewManager.toggleUnderline(view);
break;
case "toggleStrikethrough":
mViewManager.toggleStrikethrough(view);
break;
case "toggleSpoiler":
mViewManager.toggleSpoiler(view);
break;
case "toggleHeading":
mViewManager.toggleHeading(view, args.getInt(0));
break;
case "toggleUnorderedList":
mViewManager.toggleUnorderedList(view);
break;
case "toggleOrderedList":
mViewManager.toggleOrderedList(view);
break;
case "indentList":
mViewManager.indentList(view);
break;
case "outdentList":
mViewManager.outdentList(view);
break;
case "setLink":
mViewManager.setLink(view, args.getString(0));
break;
case "insertLink":
mViewManager.insertLink(view, args.getString(0), args.getString(1));
break;
case "insertText":
mViewManager.insertText(view, args.getString(0));
break;
case "insertMention":
mViewManager.insertMention(view, args.getString(0), args.getString(1));
break;
case "startMention":
mViewManager.startMention(view, args.getString(0));
break;
case "removeLink":
mViewManager.removeLink(view);
break;
case "copyToClipboard":
mViewManager.copyToClipboard(view);
break;
case "requestMarkdown":
mViewManager.requestMarkdown(view, args.getInt(0));
break;
case "requestCaretRect":
mViewManager.requestCaretRect(view, args.getInt(0));
break;
}
}
}
@@ -1,66 +0,0 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EnrichedMarkdownTextInputManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDefaultValue(T view, @Nullable String value);
void setPlaceholder(T view, @Nullable String value);
void setPlaceholderTextColor(T view, @Nullable Integer value);
void setEditable(T view, boolean value);
void setAutoFocus(T view, boolean value);
void setScrollEnabled(T view, boolean value);
void setMarkdownShortcuts(T view, @Nullable ReadableMap value);
void setAutoCapitalize(T view, @Nullable String value);
void setMultiline(T view, boolean value);
void setCursorColor(T view, @Nullable Integer value);
void setSelectionColor(T view, @Nullable Integer value);
void setMarkdownStyle(T view, @Nullable ReadableMap value);
void setColor(T view, @Nullable Integer value);
void setFontSize(T view, float value);
void setLineHeight(T view, float value);
void setFontFamily(T view, @Nullable String value);
void setFontWeight(T view, @Nullable String value);
void setIsOnChangeMarkdownSet(T view, boolean value);
void setContextMenuItems(T view, @Nullable ReadableArray value);
void setSelectionMenuConfig(T view, @Nullable ReadableMap value);
void setFormatMenuConfig(T view, @Nullable ReadableMap value);
void setLinkRegex(T view, @Nullable ReadableMap value);
void setMentionIndicators(T view, @Nullable ReadableArray value);
void setWritingDirection(T view, @Nullable String value);
void focus(T view);
void blur(T view);
void setValue(T view, String markdown);
void setSelection(T view, int start, int end);
void toggleBold(T view);
void toggleItalic(T view);
void toggleUnderline(T view);
void toggleStrikethrough(T view);
void toggleSpoiler(T view);
void toggleHeading(T view, int level);
void toggleUnorderedList(T view);
void toggleOrderedList(T view);
void indentList(T view);
void outdentList(T view);
void setLink(T view, String url);
void insertLink(T view, String text, String url);
void insertText(T view, String text);
void insertMention(T view, String displayText, String url);
void startMention(T view, String indicator);
void removeLink(T view);
void copyToClipboard(T view);
void requestMarkdown(T view, int requestId);
void requestCaretRect(T view, int requestId);
}
@@ -1,123 +0,0 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
@SuppressWarnings("deprecation")
public class EnrichedMarkdownTextManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EnrichedMarkdownTextManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public EnrichedMarkdownTextManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "markdown":
mViewManager.setMarkdown(view, value == null ? null : (String) value);
break;
case "markdownStyle":
mViewManager.setMarkdownStyle(view, (ReadableMap) value);
break;
case "enableImagePress":
mViewManager.setEnableImagePress(view, value == null ? false : (boolean) value);
break;
case "enableTaskListItemToggle":
mViewManager.setEnableTaskListItemToggle(view, value == null ? true : (boolean) value);
break;
case "enableCodeBlockPress":
mViewManager.setEnableCodeBlockPress(view, value == null ? false : (boolean) value);
break;
case "enableBlockContextMenu":
mViewManager.setEnableBlockContextMenu(view, value == null ? true : (boolean) value);
break;
case "enableLinkPreview":
mViewManager.setEnableLinkPreview(view, value == null ? true : (boolean) value);
break;
case "selectable":
mViewManager.setSelectable(view, value == null ? false : (boolean) value);
break;
case "selectionColor":
mViewManager.setSelectionColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "selectionHandleColor":
mViewManager.setSelectionHandleColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "md4cFlags":
mViewManager.setMd4cFlags(view, (ReadableMap) value);
break;
case "isGFM":
mViewManager.setIsGFM(view, value == null ? false : (boolean) value);
break;
case "allowFontScaling":
mViewManager.setAllowFontScaling(view, value == null ? true : (boolean) value);
break;
case "maxFontSizeMultiplier":
mViewManager.setMaxFontSizeMultiplier(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "allowTrailingMargin":
mViewManager.setAllowTrailingMargin(view, value == null ? false : (boolean) value);
break;
case "streamingAnimation":
mViewManager.setStreamingAnimation(view, value == null ? false : (boolean) value);
break;
case "streamingConfig":
mViewManager.setStreamingConfig(view, (ReadableMap) value);
break;
case "spoilerOverlay":
mViewManager.setSpoilerOverlay(view, value == null ? "particles" : (String) value);
break;
case "contextMenuItems":
mViewManager.setContextMenuItems(view, (ReadableArray) value);
break;
case "imageRequestHeaders":
mViewManager.setImageRequestHeaders(view, (ReadableArray) value);
break;
case "linkPillContent":
mViewManager.setLinkPillContent(view, (ReadableArray) value);
break;
case "linkRecognition":
mViewManager.setLinkRecognition(view, (ReadableMap) value);
break;
case "linkContextMenuItems":
mViewManager.setLinkContextMenuItems(view, (ReadableArray) value);
break;
case "selectionMenuConfig":
mViewManager.setSelectionMenuConfig(view, (ReadableMap) value);
break;
case "accessibilityLabels":
mViewManager.setAccessibilityLabels(view, (ReadableMap) value);
break;
case "textBreakStrategy":
mViewManager.setTextBreakStrategy(view, value == null ? "highQuality" : (String) value);
break;
case "lineBreakStrategyIOS":
mViewManager.setLineBreakStrategyIOS(view, value == null ? "none" : (String) value);
break;
case "writingDirection":
mViewManager.setWritingDirection(view, value == null ? "first-strong" : (String) value);
break;
case "numberOfLines":
mViewManager.setNumberOfLines(view, value == null ? 0 : ((Double) value).intValue());
break;
case "ellipsizeMode":
mViewManager.setEllipsizeMode(view, value == null ? "tail" : (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}

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