Compare commits

..
Author SHA1 Message Date
Mohamed Boudra dd3ce76b84 fix(server): report every turn end and keep following until the child settles
A child that ends its turn while it still has pending work (a background task such as
`npm run dev`, queued messages, or its own delegated agents) now reports `finished` to its
caller at once. The notice names the pending work and says the caller will hear again. The
subscription keeps following the child: each later turn end reports again, and the child
settling with nothing pending, with or without another turn, sends the final `finished`.
The 24-hour follow limit sends a final `finished` with the child's last reply.

Every notice is a plain `agent_finished` tool call. There is no still-working event.

The observation's initial wait no longer repeats a turn end the stream already reported,
which would have sent the first turn end twice.
2026-11-28 11:54:57 +01:00
Mohamed Boudra f73c3a594f fix(server): stop waking the parent when a delegated child ends its turn but is still working
#10864 told the caller "ended its turn but is still working" whenever a child's turn ended
with work pending, and "is still working" after 24 hours of following. The caller could not
act on either notice; it only woke up to wait again. The watch now follows such a child
silently and reports once: finished when it settles, or errored, permission, and closed as
they happen. After 24 hours it reports finished with the child's last reply, so a task that
never ends cannot hold the caller forever.

The still-working event and its agent_still_working tool are gone. Transcripts with #10864's
event="message" notices replay as messages from the child, as clients showed them then.
2026-11-28 11:54:57 +01:00
Mohamed Boudra a579cbe795 fix(server): keep a delivered message's sender when a provider trims the replayed prompt
Claude history replay trims each user prompt, so a body that started with whitespace came
back shorter than the marker's length and replayed as raw text. Drop the body's leading
whitespace before writing the marker.
2026-11-28 11:54:56 +01:00
Mohamed Boudra bfa46ab6c8 refactor(server): let the daemon decide whether an agent message is a tool call or a message
Lifecycle notices (finished, errored, needs permission, closed, still working) now reach
clients as ordinary plain-text tool calls such as "Agent finished · Child". Only peer
send_agent_prompt messages keep the agentMessage sender so they still render as a
"Sent by" bubble. No protocol fields were added.

Delivered prompts carry a trailing <paseo-message .../> marker instead of a leading
<paseo-system> envelope, so the body (including a slash command) stays at character 0
and is no longer XML-escaped. Plain human messages get no marker unless they share a
turn with agent messages or contain marker syntax. Legacy envelopes and legacy
agentMessage notification rows keep rendering (COMPAT tagged).
2026-11-28 11:54:56 +01:00
paseo-bot[bot]andChristoph Leiter b261d207c2 fix(server): reuse provider images across daemon restarts (#7895)
* fix(server): reuse provider images across daemon restarts

Co-authored-by: Christoph Leiter <christoph@leiter.io>

* test(server): isolate provider image fixtures from the daemon home

---------

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Christoph Leiter <christoph@leiter.io>
2026-11-28 10:42:44 +00:00
Mohamed Boudra 9933a302bf feat(server,client): support activeTurnBehavior "queue" without sourceAgentId (#11169)
* feat(server,client): support activeTurnBehavior queue without sourceAgentId

Plugins and human UI surfaces previously had to pass steer or interrupt when sending a prompt without sourceAgentId, which could interrupt in-flight tool calls. Non-agent senders can now pass activeTurnBehavior: "queue" to wait behind a running turn and deliver as a normal user prompt once the turn ends, or start immediately when the agent is idle.

- Allow optional source in AgentMessageDelivery; non-agent queued messages skip the 2-second agent coalescing window when idle, stay unwrapped when dispatched alone, and use kind="user-message" envelopes when sharing a provider prompt with other messages.
- Route non-agent queue requests through Session's message queue with prepareAgentMessage, MessageReceipts deduplication, and clearPendingPermissions: false.
- Advertise features.nonAgentMessageQueue and gate non-agent queue in DaemonClient.activeTurnBehaviorForHost with COMPAT(nonAgentMessageQueue).

* docs: document non-agent activeTurnBehavior queue support

* chore: tag nonAgentMessageQueue COMPAT comments with v0.18.2

* test(cli): update terminal-worker upgrade test for protocol version 7

Commit d9497fb1e (#11163) bumped TERMINAL_WORKER_PROTOCOL_VERSION from 6 to 7 with a v6 draining adapter, leaving protocols 0-5 obsolete. Update 46-daemon-terminal-worker-upgrade.test.ts to match protocol version 7 so cli-tests shard 1 passes.
2026-11-28 17:24:28 +07:00
Mohamed Boudra af8601d060 fix(app): wire plugin host client into plugin Markdown for local images (#11171) 2026-11-28 17:24:22 +07:00
Mohamed BoudraandZayooo 82415b7c15 feat(usage): live Claude and Codex usage telemetry and poll schedule fix (#11170)
* feat(usage): push live Claude and Codex usage telemetry and preserve poll schedule

Stream Claude rate_limit_event and Codex account/rateLimits/updated observations
into cached discovered account reports, push status.usage_report_changed updates
to subscribed clients, preserve the 5-minute poll schedule across sidebar
toggles, and retry failed usage fetches with exponential backoff from 30s.

Closes #11115
Co-authored-by: Zayooo <mrcold135@gmail.com>

* fix(usage): preserve poll schedule on push and schedule trailing post-turn refetch

---------

Co-authored-by: Zayooo <mrcold135@gmail.com>
2026-11-28 17:24:12 +07:00
Mohamed Boudra 1f2a88e58a fix(usage): stop showing wrong local account for Claude and Codex wrappers and env tokens (#11154)
When Claude or Codex runs through a wrapper command (such as TeamClaude or a per-profile proxy wrapper) or an explicit login environment token (CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CODEX_API_KEY, CODEX_ACCESS_TOKEN), Paseo previously fell back to reading local ~/.claude / macOS Keychain or ~/.codex/auth.json from disk and showed another account's quota card or a rejected-login error.

- Add buildProviderUsageLaunch and expose resolved launch metadata from ClaudeAgentClient/ClaudeAgentSession, CodexAppServerAgentClient/CodexAppServerAgentSession, and ProviderSnapshotManager.listProviderEnvironments.
- Allow built-in claude and codex usage sources to declare provider so PluginService attaches resolved launch metadata on global discovery.
- Suppress local ~/.claude / Keychain and ~/.codex/auth.json fallback across global discovery, configured-provider host discovery (selectProviderUsageEnv), and agent session discovery when launched via a wrapper command, login token override, or foreign endpoint/cloud backend.
- Preserve plain OPENAI_API_KEY without OPENAI_BASE_URL for Codex (matching Codex load_auth precedence), legitimate custom CLAUDE_CONFIG_DIR / CODEX_HOME profiles, custom paths to the default claude / codex binary, and independent OpenCode/Pi/OMP harness routes.

Closes #3228
2026-11-28 16:53:13 +07:00
af4bfad1e2 fix(plugins): treat Node type declarations as host types in the type walk (#8618)
Dependency declarations that `import "node"` (e.g. utif2) pulled @types/node
into the install-time type walk, which failed on node: specifiers newer than
the host Node (node:stream/iter on Node 24) or, with @types/node absent,
on the unresolved "node" import. Map bare "node" in declarations to
@types/node and treat any node: specifier as a builtin.

Co-authored-by: Gabriele Magno <gabrigmm@gmail.com>
Co-authored-by: Gabriele Magno <36011800+nkwib@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-28 09:43:55 +00:00
Mohamed Boudra 4011199370 feat(mcp,plugin): expose workspace metadata updates via MCP and plugin snapshots (#11166)
* feat(mcp,plugin): expose workspace metadata updates via MCP and plugin snapshots

* fix(app,server): persist workspace metadata in replica cache and normalize null keys on create
2026-11-28 16:26:05 +07:00
paseo-bot[bot]andAndrew McFague a6054adb97 Show completed Pi background subagents after collecting their results (#11168)
* fix(pi): finish tintinweb subagents collected with get_subagent_result

@tintinweb/pi-subagents returns get_subagent_result as plain text with no
details, and reading a result cancels the completion notification. The
adapter only read details.status, so a background child collected this way
stayed running, and history replay after a restart rebuilt it as running.

Read the status from the result's "Agent: <id> / Type: ... | Status: <status>"
header, and look the child up by the header's id, because agent_id can be
the agent's name instead of its id.

* fix(pi): match tintinweb results to the spawn or resume that produced them

A resumed agent gets a new Agent call and its own row, but results were
matched by agent id to whichever call was latest. A completion notification
built before a resume, or a get_subagent_result that started before one,
could mark the resumed run finished while it was still running.

Notifications now go to the call named in their <tool-use-id>, and a
follow-up goes to the attempt that was latest when it started. A
notification without details is read from its <task-notification> blocks.

* fix(pi): finish tintinweb rows for scheduled spawns

An `Agent` call with `schedule` registers a job and returns only text, with
no `details` and no agent id. The adapter added a running row for the call
and never sent a final status, so every scheduled spawn stayed running.

When a completed `Agent` call with `schedule` has no `details`, the row now
ends `completed` if the text reports the registered job (`Scheduled "<name>"
(id: <id>, type: <type>)`), and `failed` for the extension's refusals, such
as scheduling being disabled.

* fix(pi): match name-based follow-ups to the attempt they started on

get_subagent_result accepts a handle such as `explore` as well as an
agent id. The adapter only saved a target for follow-ups that used an
id, so a follow-up by name fell back to the agent's latest call. If the
agent was resumed before the result arrived, the old result marked the
resumed run finished.

Record each agent's spawn and resume calls in order, and note how many
calls existed when a follow-up started. The result header supplies the
agent id, and the follow-up resolves to that agent's latest call from
before it started, whether it named the agent by id or by handle.

* fix(pi): keep collected subagent results on the right run

History replay visits every call in an assistant message before processing their results. Record attempt order as the calls start and attach the native ID when it arrives, so a collected result can finish the child it belongs to. Keep scheduled job registration outside the scope of this fix.

Co-authored-by: Andrew McFague <144809+amcfague@users.noreply.github.com>

---------

Co-authored-by: Andrew McFague <144809+amcfague@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-28 09:12:54 +00:00
Mohamed BoudraandThePharmer 6fc22514ed fix(claude): show Claude progress updates without repeating blocks (#11160)
Reconcile streamed Claude content blocks per block index instead of
against the whole message, preventing duplicate final thinking/text
blocks in multi-block messages (#6463). Buffer thinking deltas until
each block's completed snapshot arrives so blocks marked in
`narration_block_indexes` render as assistant text (for example before
AskUserQuestion) rather than inside Thinking (#6199), while flushing
any unfinished thinking on message stop or terminal turn events with
their explicit turnId preserved.

Co-authored-by: ThePharmer <metastallion@gmail.com>
2026-11-28 15:59:44 +07:00
Mohamed Boudra ea1f2ffab5 fix(server): order Pi and OMP streamed content blocks by contentIndex (#11159)
Pi and OMP tag streamed assistant deltas with contentIndex and can emit deltas for an earlier block after a later block starts. Forwarding deltas in raw arrival order split thinking blocks and cut answer text mid-word or mid-code-fence during live streaming.

Share a MessageContentStream helper across PiRpcAgentSession and OmpAgentSession that holds later indexed text/thinking blocks behind active earlier blocks until block end, flushes buffered content on message boundaries and on turn abort/interrupt/error paths, and avoids blocking on non-streamed or toolCall entries.
2026-11-28 15:59:27 +07:00
Mohamed BoudraandGlen Stampoultzis d9497fb1e4 fix(terminal): report active light/dark palette for OSC, COLORFGBG, and live DEC 2031 theme switches (#11163)
Send the active terminal defaultColors at creation time and sync live palette
updates from the focused viewer through active-viewer ownership (mirroring
terminal-size-ownership). Derive COLORFGBG at PTY spawn unless already set in
env, keep the daemon as the single OSC 10/11/12 responder, track DEC mode 2031
(CSI ? 2031 h/l + DECRQM) and DSR 996/997 reports on live light/dark polarity
switches, and bump TERMINAL_WORKER_PROTOCOL_VERSION from 6 to 7 with a v6
draining adapter.

Closes #2795
Supersedes #4345

Co-authored-by: Glen Stampoultzis <gstamp@gmail.com>
2026-11-28 15:59:18 +07:00
Mohamed BoudraandJustinJoshi 8c18b1558b fix(app): ignore Android system Bold text adjustment to prevent clipping (#11162)
Android 12+ system "Bold text" sets Configuration.fontWeightAdjustment (+300).
TextView applies that weight increase at draw time to text without an explicit
fontWeight or fontFamily, while React Native 0.86.3's TextLayoutManager measures
the text unbolded. The wider drawn glyphs overflow the measured box and clip
trailing words, characters, and lines app-wide (#4057, #10152, #10850).

Add an Android Expo config plugin that overrides MainActivity.attachBaseContext
to zero fontWeightAdjustment on an empty sparse Configuration(), so measurement
and drawing agree while unrelated configuration fields (uiMode, densityDpi,
orientation, screenWidthDp, fontScale, locales) continue updating across
onConfigurationChanged and compose cleanly with PaseoDisplayMetrics (#9995).

Paseo's own bold styles (Markdown **bold**, headings, bold labels) remain bold.

Co-authored-by: JustinJoshi <JustinJoshi@proton.me>
2026-11-28 15:55:59 +07:00
truelecter 2c2393f0ad fix(app): count native touches and typing as presence (#8070) 2026-11-28 08:43:29 +00:00
Mohamed Boudra f786001454 fix(acp): wait for cancel settlement and retire hung ACP subprocesses (#11152)
* fix(acp): wait for cancel settlement and retire hung ACP subprocesses

* fix(acp): keep 2s post-interrupt settlement timeout and unify stale-session reload
2026-11-28 15:04:34 +07:00
Mohamed BoudraandDaniel Stieglmayr 43aaf62c7d fix: prevent workspace update storms on reconnect and batch client directory commits (#11145)
* fix: prevent workspace update storms and batch client directory commits

Fixes three compounding causes of reconnect stalls, 60s RPC timeouts, and
client freezes/ANRs on hosts with many workspaces (especially sharing a Git
checkout):

1. Seed sequenced workspace subscriptions in Session from the full, untagged,
   visibility-filtered descriptor set instead of syncSeq-tagged or partial
   changes-mode response entries, eliminating redundant workspace_update
   re-emits and preserving includeBackground filtering and git observation.
2. Retain a bounded LRU (2,000 entries) of last-known WorkspaceGitService
   snapshots past the 90s warm release grace, serving retained snapshots
   stale-while-revalidate on non-forced getSnapshot reads while revalidating
   in the background Git lane and staying silent when Git state is unchanged.
3. Coalesce overlapping workspace update flushes per subscription and pace
   multi-workspace workspace_update bursts one drained frame at a time so
   interactive RPC replies are never head-of-line blocked on the transport.
4. Batch incoming workspace_update frames per animation frame/tick in
   DirectorySync and WorkspaceDirectoryReplica so a 200-workspace burst
   produces one mergeWorkspaces store commit and one checkpoint write.

Closes #5530
Refs #9487, #7760

Co-authored-by: Daniel Stieglmayr <theunlimited64@gmail.com>

* fix(server): decouple paced workspace burst queue from flush and bootstrap

---------

Co-authored-by: Daniel Stieglmayr <theunlimited64@gmail.com>
2026-11-28 15:03:54 +07:00
Mohamed BoudraandOleg Puchkov bf23004852 fix(desktop): isolate browser webview focus during agent automation (#11158)
* fix(desktop): isolate browser webview focus during agent automation

Prevent Electron browser guests from stealing keyboard focus from the
chat composer while an agent drives parked or visible split-pane tabs:

- Gate BrowserPane's webview focus/mousedown promoter so non-presented
  panes and agent-guarded presses never call onFocusPane, webview.focus,
  or paseo:browser:focus; mark parked 1x1 surfaces inert with tabindex=-1.
- Focus browser_type and browser_keypress targets via DOM element.focus
  plus caret-to-end positioning instead of CDP mousePressed.
- Bracket CDP pointer presses (browser_click, browser_drag) with a
  ref-counted host focus guard (including IME composition protection,
  50ms late-focus recheck, and Emulation.setFocusEmulationEnabled(true)).

Closes #4679
Supersedes #10603

Co-authored-by: Oleg Puchkov <puchkoff@gmail.com>

* fix(desktop): verify DOM focus in browser_type and require host focus guard in ipc

---------

Co-authored-by: Oleg Puchkov <puchkoff@gmail.com>
2026-11-28 15:03:44 +07:00
Mohamed BoudraandQichang Zheng 3680a4a185 fix(usage): discover configured custom provider accounts with strict source scoping (#11149)
* fix(usage): discover configured custom provider accounts with strict source scoping and locator env allowlist

Host Usage listings previously scanned only the daemon's default login stores,
leaving custom Claude and Codex providers configured with their own
CLAUDE_CONFIG_DIR, CLAUDE_SECURESTORAGE_CONFIG_DIR, or CODEX_HOME invisible in
Usage until one of their agents was opened.

Host Usage now discovers enabled providers that configure usage-locator
environment variables, while enforcing two strict security boundaries:
- Provider-matched dispatch: each configured provider scope is sent ONLY to
  usage sources whose declared `providers` list includes that provider's base
  provider ID (never broadcast to unrelated or third-party usage plugins).
- Explicit locator env allowlist: only non-secret config-directory /
  credential-store locator environment variables (including
  CLAUDE_CONFIG_DIR, CLAUDE_SECURESTORAGE_CONFIG_DIR, CODEX_HOME,
  OPENCODE_CONFIG_DIR, XDG_CONFIG_HOME, XDG_DATA_HOME, HOME, etc.) cross into
  usage discovery. Raw auth tokens, API keys, and arbitrary custom env vars
  are stripped, and foreign-endpoint providers are excluded daemon-side.

Also adds CLAUDE_SECURESTORAGE_CONFIG_DIR support to Claude Keychain route
derivation and preserves cached usage, recovery history, sidebar summary, and
source-toggle behavior across provider renames.

Closes #3589

Co-authored-by: Qichang Zheng <qichang.zheng2000@gmail.com>

* refactor(usage): keep provider env allowlist filtering solely inside UsageSourceRegistry

* fix(usage): allow OPENCODE_DB in host usage discovery locator env allowlist

---------

Co-authored-by: Qichang Zheng <qichang.zheng2000@gmail.com>
2026-11-28 15:01:48 +07:00
Mohamed Boudra 9808fd4198 perf(cli): cut CLI startup overhead with lean client, lazy dispatch, and esbuild bundling (#11155)
* perf(cli): cut CLI startup overhead with lean client, lazy dispatch, and esbuild bundling

- Add lean protocol codec and @getpaseo/client/node/lean entry that skip ws-outbound.aot.js and full Zod message schemas, and dynamically import @getpaseo/relay only for pairing-offer/E2EE targets
- Replace eager command imports in packages/cli/src/cli.ts with a static command manifest + lazy dynamic imports, remove duplicate createCli() in run.ts, and lazy-load yaml/chalk in output rendering
- Extract zero-Zod PID, home, and credential helpers to @getpaseo/server/daemon-files
- Bundle @getpaseo/cli with esbuild code splitting (--splitting --format=esm --minify) and update scripts/trace-daemon.mjs
- Fast-path complete agent UUIDs in resolveAgentEntry() via fetchAgent() without paginating archived agents

* fix(client): generate zero-Zod schema defaults for lean protocol codec

- Generate message-defaults.ts from Zod protocol schemas inside generate-validation-aot.mjs (50 outbound + 11 inbound tables, agent snapshot defaults, legacy transform fallbacks, and hello.rejected reasons)
- Apply generated defaults in leanProtocolCodec so older daemons get the same defaulted fields as strictProtocolCodec without loading Zod or ws-outbound.aot.js
- Add strict-vs-lean parity tests across legacy outbound, inbound, and status payloads
- Deduplicate sync/async CLI renderer dispatch between render.ts and render-async.ts
- Switch startup-boundary runtime hook test to module.registerHooks + synchronous stderr flush and it.skipIf for missing dist

* fix(protocol): support prefault and reject unlisted non-pure schemas in defaults generator

- Support Zod .prefault() nodes directly in message-defaults.ts (e.g., pull_request_timeline_response with omitted payload)
- Fail generate:validators loudly if any new .catch() or .transform()/.preprocess() schema is added without a lean rule or explicit legacy allowlist entry
- Add pull_request_timeline_response omitted-payload parity test to lean.test.ts
2026-11-28 15:01:34 +07:00
Mohamed Boudra 5d4793ddc1 Let plugins expose local HTTP services at public URLs through tunnel providers (#11036)
* feat(plugins): add tunnel provider plugins with cloudflared and tailscale funnel built-ins

Plugins can now register a tunnel provider that turns a local HTTP host:port
into a public HTTPS URL. The daemon's TunnelManager owns exposures and their
lifecycle, so a provider only reports state through report() and stops when
its signal aborts. Exposures close when the owning plugin stops, reloads, is
disabled, or crashes, and when the daemon shuts down.

This is the shared primitive that later work uses to expose MCP servers and
workspace services. Clients gate on server_info.features.tunnelProviders.

* fix(plugins): keep tunnel exposures from reporting wrong URLs or outliving Paseo

- cloudflared: the quick-tunnel URL pattern matched api.trycloudflare.com in
  provisioning errors, so an offline open reported ready with the API endpoint.
- tailscale-funnel: `funnel --bg` stored the Funnel in tailscaled, so a crashed
  plugin or daemon left the target public with no owner. Run the Funnel in the
  foreground instead; tailscaled drops it when the CLI exits.
- tailscale-funnel: a failed `funnel status` counted as "no ports in use" and
  could replace and later remove the user's own handler. Fail the open instead.
- Add the Chinese translation of the tunnel providers reference section.

* fix(plugins): ship cloudflared with quick tunnels only

A named Cloudflare tunnel routes through ingress set in the Cloudflare
dashboard, so its URL never served the exposure target. Two exposures for
different targets both reported ready at the same URL. Named tunnels return
later with per-target routing.

Also mark the tunnel-provider example as requiring 0.18.0-beta.1, like the
notifications example, so the example build test loads it.

* fix(plugins): detect missing tunnel CLIs and run tunnel tests on Windows

On Windows a bare name that is not on PATH runs through cmd.exe, which exits
9009 instead of failing the spawn with ENOENT. The providers reported a
missing tailscale as "not running". Treat exit 9009 as not installed.

The fake CLIs were shebang scripts, which Windows does not run, and the
tests relied on SIGTERM handlers that a Windows force kill skips. The fakes
now get a .cmd launcher on Windows, and the tests check that the fake
process is gone instead of a handler side effect.

* test(plugins): replace the Windows Path variable in tunnel CLI tests

Windows keeps the original case of environment names, usually `Path`.
Spreading process.env and setting `PATH` left the real search path beside
the override, so the missing-CLI tests could still find or query a real CLI.
The missing-CLI tests now assert the exact "not installed" status.

* test(plugin): parse shared declarations once in SDK boundary type checks

Each typeErrors() call built a fresh program and parsed the SDK, library,
and dependency declarations again. On a slow Windows runner one check took
over the 5 s test timeout. The checks now share the parsed configuration
and declaration files, so each one parses only its snippet. The file runs
in about a quarter of the time locally.

* fix(plugins): launch tunnel CLIs without a shell so a missing CLI reads as not installed

On Windows a bare name that is not on PATH ran through cmd.exe, which exits
with a generic code and a localized "not recognized" message. The providers
then reported a missing tailscale or cloudflared as "not running" or "failed
to query". Without a shell the spawn fails with ENOENT on every platform.
Both CLIs ship as executables; a .cmd set as a full binary path still runs
through cmd.exe. This replaces the exit-code 9009 check, which cmd.exe does
not return as the process exit code.
2026-11-28 14:36:10 +07:00
cb5bcb5a60 feat(app): act on files from chat links, file tabs, and a filterable Files tree (#11073)
Shared workspace file actions across file tabs, compact file sheets, chat/Markdown links, Files tree, and Changes pane, plus desktop open-in-default-app, explicit Reveal in Files, workspace-wide Files sidebar filter, shared 16px tree indent guides, and Android link long-press selection fix.

Refs #10699

Co-authored-by: YASICJUNWOO <99794552+YASICJUNWOO@users.noreply.github.com>
Co-authored-by: apple-ouyang <45086632+apple-ouyang@users.noreply.github.com>
Co-authored-by: iqshen <24309546+iqshen@users.noreply.github.com>
Co-authored-by: Ctrl-Creeper <190502953+Ctrl-Creeper@users.noreply.github.com>
Co-authored-by: softyoda <13988751+softyoda@users.noreply.github.com>
2026-11-28 14:34:54 +07:00
73fab19166 fix(usage): discover Cursor credentials across macOS, Windows, and Linux (#11148)
Cursor 3.27+ encrypts `cursorAuth/accessToken` in `state.vscdb` with a
`cursor-safe-storage:v1:` Electron safeStorage prefix, so sending that
value as a bearer token caused Usage to fail with HTTP 401. At the same
time, discovery missed the macOS Keychain (`cursor-access-token` /
`cursor-user`), macOS `~/.cursor/auth.json`, and Windows
`%APPDATA%\Cursor\auth.json`, and stopped at the first candidate instead
of letting the usage registry fall back after a 401.

- Skip `cursor-safe-storage:` values across every token store and reader
  so ciphertext is never sent as a bearer token.
- Add macOS Keychain (`cursor-access-token` / `cursor-user`) and
  `~/.cursor/auth.json` discovery to both global and session lookup.
- Add Windows `%APPDATA%\Cursor\auth.json` discovery to global lookup.
- Return all unique usable credentials in priority order so
  `UsageSourceRegistry.fetchWithFallback` tries the next candidate when
  an earlier credential is rejected.

Co-authored-by: jasonhnd <3293256+jasonhnd@users.noreply.github.com>
Co-authored-by: Kevin <kevin.pierrot@gmail.com>
Co-authored-by: Sian Lerk Lau <kiawin@gmail.com>
Co-authored-by: ChicorSun <125846596+ChicorSun@users.noreply.github.com>
Co-authored-by: Karl Bitz <kb@wardbitz.com>
2026-11-28 14:27:30 +07:00
Mohamed BoudraandJiayang Wu 4842f7e24d fix(usage): support OpenCode v2 usageSession, OpenCode session scopes, and Codex opencode.db logins (#11153)
* fix(usage): support OpenCode v2 usageSession, session scopes, and Codex opencode.db logins

- Implement usageSession() on OpenCodeV2Session with provider "opencode",
  authoritative model tracking (info.model falling back to config.model),
  effective provider + launch harness environment, and a stable sessionKey.
- Read active and migrated OpenAI OAuth logins from OpenCode v2's opencode.db
  in codex-usage-source (honoring absolute/relative OPENCODE_DB, active=1 or
  migrated active IS NULL, falling back to v1 auth.json, and normalizing
  provider to "opencode").
- Add OpenCode session-scope discovery to built-in usage sources OpenCode
  serves (opencode-go, minimax, zai, kimi, grok, copilot, openrouter-host).

Co-authored-by: Jiayang Wu <651475459@qq.com>

* fix(usage): keep Copilot/Kimi default visibility hints and deduplicate session discovery helpers

---------

Co-authored-by: Jiayang Wu <651475459@qq.com>
2026-11-28 14:22:19 +07:00
Mohamed Boudra ada93c7a1a Upload image attachments via file.upload.request instead of inlining base64 (#11137)
* feat(app,server): upload image attachments via file.upload.request

Previously, sending images inlined base64 payloads directly inside
send_agent_message_request and create_agent_request JSON messages,
causing phone photos to exceed relay message limits (#2668) and
multi-photo batches on Android to overflow OkHttp's 16 MiB outbound
WebSocket queue and close with code 1001 (#11117).

- Upload attached images sequentially via DaemonClient.uploadFile
  (file.upload.request + 128 KiB FileChunk frames) across all composer,
  queued send, draft creation, new workspace, and workspace setup paths.
- Pace DaemonClient.uploadFile on unpaced transports (supportsDrain=false)
  with a 1 MiB correlated ping/pong flush barrier so single >16 MiB files
  cannot overflow OkHttp's outbound queue, and start the 60s RPC response
  deadline only after FileEnd so slow uplinks do not time out mid-stream.
- Resolve uploadedImages on the daemon into native { type: "image" }
  provider content blocks after enforcing canonical realpath containment
  inside join(paseoHome, "uploads"), and project UploadedImage metadata
  onto user_message timeline items so thumbnails and lightbox previews
  persist across reloads and devices.
- Preserve full resolution and quality for JPEG/PNG images (picker
  quality: 1, no downscaling for already-supported formats) while keeping
  HEIC/HEIF conversion to resized JPEG for provider vision compatibility.

* test(server): canonicalize temp paseoHome path in prompt-attachments test

* refactor(protocol,app,server): carry uploaded images as uploaded_file attachments with role="image"

Replace the separate top-level `uploadedImages` wire field with an
optional `role: "image"` hint on `UploadedFileAttachmentSchema` inside
the existing `attachments` array.

- On current daemons, `resolveAgentPrompt` partitions `uploaded_file`
  entries with `role: "image"` out of `attachments`, validates canonical
  `realpath` containment in `$PASEO_HOME/uploads`, resolves them into
  native `{ type: "image", data, mimeType }` provider vision blocks, and
  projects `user_message.images` thumbnails.
- On older daemons (v0.1.91-v0.18.1), Zod strips only the unknown
  optional `role` field and preserves the valid `uploaded_file`
  attachment (`type`, `id`, `fileName`, `mimeType`, `size`, `path`), so
  an auto-updated mobile or web app never silently drops photos against
  an older host.
- Plain `Upload file` attachments (without `role: "image"`) remain
  unchanged (`Uploaded file: ... Path: ...`).
- Also reverts the unrelated conditional-spread refactor in
  `DaemonClient.createLegacyAgent`.
2026-11-28 13:51:56 +07:00
Mohamed Boudra e05d39bdde fix(server): serve agent endpoints on loopback and bypass HTTP proxies (#11144)
Local agent subprocesses expect an HTTP loopback URL for Paseo's built-in
MCP server (/mcp/agents) and terminal activity hooks (/api/terminal-activity).
Previously, bootstrap derived both URLs directly from the primary listener,
so Unix-socket and named-pipe daemons returned null (silently omitting MCP
and terminal activity) and non-loopback TCP listeners handed agents a
non-loopback address that fails loopback validation and proxy bypass. In
addition, providers spawned under a user's HTTP_PROXY routed local 127.0.0.1
MCP requests through the proxy and failed with HTTP 502 / handshake errors.

Introduce a daemon-owned loopback agent endpoint that reuses the primary
listener when it is already loopback-reachable TCP and otherwise binds a
dedicated 127.0.0.1:0 HTTP server exposing only /mcp/agents and
/api/terminal-activity with loopback remote-address, Host-header, and bearer
auth checks. Merge 127.0.0.1, localhost, and ::1 into NO_PROXY (and no_proxy
when set) in the shared provider launch environment without clobbering user
entries.
2026-11-28 13:51:48 +07:00
5e568571ba fix(app): fix Android terminal typing, Backspace, CJK/Latin IMEs, and hardware Enter (#11146)
* fix(app): replace hidden Android terminal TextInput with native input view

Android's hidden React Native TextInput splits every IME edit into two
unsynchronized JS events (onChangeText and onKeyPress), hides Android's
active composing span, omits deleteSurroundingTextInCodePoints, and leaves
multiline newline residue after Enter. Those boundary flaws caused doubled
first/initial characters, locked or dropped Backspace, swallowed Latin
candidates in mixed CJK/English keyboards, broken Korean Hangul after
Enter, and duplicate hardware Enter presses.

Replace the hidden Android TextInput with a dedicated 1x1 native Android
PaseoTerminalInputView backed by a custom BaseInputConnection
(TerminalInputConnection) and onKeyDown handler in paseo-terminal. The
native input connection coalesces batch edits, diffs against real Android
composing spans, clears its private Editable after commit/finish, handles
all three Backspace paths, emits a single CR on Enter, and sets
EditorInfo flags directly without ReactFindViewUtil patching.

Co-authored-by: Ouyang Xingyuan <galaxyroaming@qq.com>
Co-authored-by: Lennart Schoch <lennart@usebounce.com>
Co-authored-by: Jason <jaeysin@gmail.com>

* fix(app): expose composing state via ComposingTextOwner and deduplicate terminal input types

React Native's BaseViewManager.setTestId overwrites the unkeyed View.tag
with the string testID, which would hide PaseoTerminalInputView's active
IME composing span from PaseoHardwareKeyboardModule.

Introduce ComposingTextOwner in paseo-hardware-keyboard and implement it
on PaseoTerminalInputView so hardware arrow routing reads composing state
without touching View.tag. Also re-export shared terminal input types
from terminal-input.types.ts in terminal-input.native.tsx and drop its
unreachable Android hardware-keyboard effect.

---------

Co-authored-by: Ouyang Xingyuan <galaxyroaming@qq.com>
Co-authored-by: Lennart Schoch <lennart@usebounce.com>
Co-authored-by: Jason <jaeysin@gmail.com>
2026-11-28 13:51:06 +07:00
paseo-bot[bot]andClaude Opus 5.5 3b5cf28cae fix(terminal): force-kill the program on Windows when killAndWait times out (#11147)
On Windows, node-pty's kill closes the pseudoconsole and kills the
console's processes only after a forked helper reports them. The force
step of killAndWait repeated that same soft kill. The terminal worker
exits right after killAndWait during shutdown, so on a slow machine the
helper's kill never ran and the program outlived its worker. This made
"Restart and close terminals" leave the program running and flaked the
terminal-worker-lifecycle Windows test.

The force step now kills the program's process tree with tree-kill.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 06:50:54 +00:00
Mohamed Boudra feb0d74ab5 chore(website): update Hoplite's sponsor tagline (#11150)
The new tagline is the sponsor's own wording and is much longer. With two
long captions the footer sponsors band pushed "Become a sponsor" onto its
own row in the docs column (max-w-prose, about 700px), so the footer
placement uses narrower captions and a smaller column gap.
2026-11-28 13:47:42 +07:00
cd5b713a1b fix(app): keep terminal text in the code font when an interface font is set (#11099)
The interface font rule applies to every element outside a `data-pmono`
surface. The terminal root had no marker, so xterm's DOM renderer rows took
the interface font while the cell grid was measured with the code font.

Fixes #6903

Co-authored-by: sh0nuff <sh0nuff@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 06:42:58 +00:00
Mohamed Boudra fef4530e4a fix(codex): inject MCP servers as per-server config overrides (#11142)
Codex combines process-level -c overrides and thread/start request config
overrides sequentially in build_cli_overrides_layer. Sending a whole-table
mcp_servers object (including an empty {}) replaces the entire mcp_servers
table built from earlier -c mcp_servers.* flags, wiping out alias-configured
MCP servers.

Emit dotted mcp_servers.<name> keys (and omit MCP keys entirely when empty)
so Paseo-injected MCP servers and tool-policy preapprovals merge alongside
alias -c overrides and config.toml servers. Fall back to a single whole-table
mcp_servers only when a server name contains a dot, which Codex's
path.split('.') override parser cannot represent as one segment.
2026-11-28 13:23:54 +07:00
d77356210e fix(server): close Claude launch race, pre-init idle lock, and unbounded metadata generation (#11143)
Close three verified provider child-process leaks (Part of #4450):

1. Single-flight Claude query launch (`ensureQuery`): concurrent callers
   (such as the app and plugins both requesting commands on resume) now
   share one in-flight `queryStart` promise instead of spawning duplicate
   `claude` processes and overwriting `this.childProcess`. A restart
   requested mid-launch retires the stale query and relaunches once, a
   pre-launch restart mark is consumed when launch options are copied,
   and `queryStarting` is always cleared in `finally`.

2. Pre-init prompt withdrawal (`ClaudeRuntimeSafety`): track `initSeen`
   separately from `turnSeen` so withdrawing every unstarted prompt before
   `system/init` clears `turnSeen` and allows idle collection to stop the
   runtime, while preserving the hold when a turn had already started or
   announced `init`.

3. Bounded structured metadata generation (`generateStructuredAgentResponse`):
   enforce a 300s default deadline across retries and share one deadline
   across `generateStructuredAgentResponseWithFallback`, so stalled
   internal metadata agents always reach `finally` and call `closeAgent`.

Co-authored-by: Desmond Leong <desmond@returning.ai>
Co-authored-by: Nicholas Salgueiro <nickmaglowsch3@gmail.com>
2026-11-28 13:23:40 +07:00
e994be2958 fix(app): send phone photos as downscaled JPEG instead of full-size PNG (#9328)
Add image converted HEIC photos to full-resolution PNG. Inlined as base64,
a sub-5 MB iPhone photo became a 56 MiB message and was rejected by the
32 MiB relay limit (getpaseo/paseo#2668).

HEIC/HEIF now becomes JPEG (quality 0.85); other unsupported formats still
become PNG to keep transparency. Any picked image whose long edge exceeds
2000 px is downscaled to fit, keeping its JPEG/PNG format.

Co-authored-by: Brandon Elliott <923787+Brandon168@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 10:56:29 +07:00
e0eebe3307 Show ACP form elicitations as native question cards (#11135)
* feat(plugin): show ACP form elicitations as native question cards

The shared plugin ACP client advertised empty clientCapabilities and
had no createElicitation handler, so ACP agents like Antigravity (agy)
could not send structured form elicitations and fell back to plain
markdown option lists (leaving ask_question unanswerable via Paseo's
question card).

Advertise clientCapabilities.elicitation.form by default and map ACP
1.x form elicitation schemas onto Paseo's existing kind: "question"
permission card inside packages/plugin/src/server/acp-internal:
- Track tool approvals and form elicitations in one unified pending map
  so deferred turns, mode-switch guards, turn end, interrupt, close,
  and failure cleanup stay consistent.
- Never auto-accept elicitations in autoAcceptMode; decline url mode,
  out-of-turn, mismatched-session, and unsupported/malformed schemas
  cleanly without throwing.
- Fold optional sibling <key>_other string fields into allowOther for
  both no-sentinel (agy) and "other"-sentinel schemas, preserve unique
  headers/labels and ", " multi-select handling, mark defaults, and
  keep __proto__ keys safe via Object.hasOwn and Object.fromEntries.

Co-authored-by: Daniel JB Clark <djbclark@gmail.com>
Co-authored-by: Jake Cattrall <krazyjakee@gmail.com>

* fix(plugin): keep _other separate when required choice has no other sentinel

---------

Co-authored-by: Daniel JB Clark <djbclark@gmail.com>
Co-authored-by: Jake Cattrall <krazyjakee@gmail.com>
2026-11-28 10:40:23 +07:00
paseo-bot[bot]andClaude Opus 5.5 6d8938e260 test(server): wait for a stopped script's program before cleanup (#11127)
On Windows the PTY kill ends the shell at once and the script's node
process later, so the test's temp-dir rm raced it and failed with EBUSY.
The test now records the script's pid and waits for it to exit after
the stopped status.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 00:42:38 +00:00
paseo-bot[bot] b15ac514d9 fix(app): keep Changes responsive when wrapping long diff lines (#11113)
Wrapping a long line with Unicode or code ligatures repeatedly measured most of the remaining line. Start the search near the next wrap so narrow viewports avoid shaping the same text repeatedly.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-27 23:12:44 +00:00
paseo-ai[bot] c539fc1dc6 fix: update lockfile signatures and Nix hash [skip ci] 2026-11-27 18:48:51 +00:00
Mohamed Boudra 1c053e207e feat(desktop): new butterfly app icons on desktop and mobile (#11091)
* feat(desktop): draw the app icons from the new butterfly mark

The desktop and mobile icons still carried the old butterfly, and each
was a hand-exported file. They now come from one script that renders
them from the canonical mark in assets/brand, so a change to the mark
reaches every icon.

The icons are flat. Each platform masks and lights its own icons, and
artwork that arrives already lit ends up lit twice. The lit versions
are kept in assets/brand/app-icons and nothing uses them.

The packaged Mac app now takes its icon from an Icon Composer document
instead of the .icns, so macOS draws the tile, the margin, the lighting
and the dark, tinted and clear variants itself. electron-builder
compiles the document with actool, which needs Xcode 26 or later. The
Nix build has no Xcode and keeps the .icns, and so does the DMG volume
icon, because the .icns actool derives stops at 256 px.

macOS draws a dev build's Dock icon and an .icns exactly as supplied.
Their tile is now 824 of 1024 px with continuous corners, measured from
the icon macOS 27 draws for the document. The old production tile was
88% of the canvas and looked oversized next to other Dock icons.

* test(desktop): put the tunnel heartbeat test on a fake clock

The test ran a 25 ms heartbeat against a 65 ms timeout on the real
clock. A heartbeat tick closes the wire instead of pinging once the
timeout has passed, so when the first tick landed late on a slow
Windows runner the wire closed with no ping sent, and the assertion
that a ping went out failed.

With a fake clock the ticks land at 25, 50 and 75 ms every time: two
pings, then the heartbeat close.
2026-11-28 01:38:26 +07:00
Mohamed Boudra 14734843fd chore(release): reconcile v0.18.1 (#11102) 2026-11-28 01:32:34 +07:00
10a71e6904 Keep a streamed reply whole when a steering message arrives mid-stream (#5267)
* fix(server): keep a streamed assistant message whole across a steer

Steering an agent mid-stream records the user message at the next
timeline seq, between two chunks of the assistant message that is still
streaming. The projection merged assistant chunks only when they were
adjacent, so the interposed user row split one provider message into two
timeline rows at whatever character had arrived, often mid-word.

An assistant message that carries a provider message id now has a
timeline identity, like a tool call does, so its chunks collapse into one
item wherever they land. Chunks without a message id keep the existing
adjacency merge.

* test(server): synchronize the steer regression test on timeline state

Replace the fixed sleeps with polling assertions, and run the coalescer
with a zero window so every chunk flushes on its leading edge.

* fix(server): merge a steered message only across user rows

The identity merge joined every chunk of one provider message into its
first row, whatever rows were recorded between them. Text a provider
wrote after a tool call moved above the tool call, and seeded rows lost
the turn stats on the merged reply.

A chunk now continues the assistant message right before it, or, when
it carries a provider message id, the assistant row before a run of
user rows recorded mid-stream. Any other row in between keeps the
provider's order. The merge carries the stats from the later chunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(app): keep streamed replies whole across steering messages

---------

Co-authored-by: paseo-bot <paseo-bot@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 17:42:54 +00:00
Mohamed Boudra 4810eb2d74 fix(app): keep Command Center result order stable while typing (#11085)
Command Center scored contributions and workspaces with right-edge text-match tiers (TIER_EXACT and TIER_WHOLE_WORD), so rows flipped mid-word whenever a shorter word or title finished on the latest keystroke (for example, typing renam then e flipped Rename workspace and Rename, and typing to jumped Pin to top above Toggle Explorer sidebar). Because CommandCenterInteraction resets active selection to index 0 on every keystroke, Enter executed the wrong action.

Score Command Center matches by left-edge rank only (field start, word start, inside word, scattered) and rank workspaces within the same MatchClass by recency directly instead of raw sub-tiers. Also label the active tab rename action with the existing Rename agent / Rename terminal keys instead of bare Rename.
2026-11-27 23:29:24 +07:00
paseo-bot[bot]andClaude Opus 5.5 79a32f40c6 fix(pi): queue a prompt while Pi runs a turn it started itself (#11077)
Pi starts runs on its own, for example for an extension message or a
background result, and reports them only at agent_start. A prompt sent
in that window had no streamingBehavior, so Pi rejected it with
"Agent is already processing" and the message was lost.

Send prompts with streamingBehavior followUp. Pi queues the prompt into
its running turn, and ignores the option when it is idle.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 16:14:07 +00:00
a997246655 fix(opencode): clear v2 approvals that OpenCode dropped (#11061)
OpenCode v2 removes a pending approval without a `permission.replied`
event when the tool call that asked is interrupted, and answers a later
reply to it with HTTP 404. Paseo kept its copy, so the card stayed and
every answer failed. A message sent while the card was open failed the
same way, because clearing the card threw the 404.

Reconciling a session now drops approvals OpenCode no longer lists, and
a 404 reply resolves the approval instead of failing.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: rhettjay <67493409+rhettjay@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 16:00:29 +00:00
Mohamed Boudra 3b8fd4ab3d fix(gitlab): load fork MR pipeline jobs from the pipeline project (#11074)
glab ci get --merge-request fetches the MR from the target repository, reads
head_pipeline.id, and then requests that pipeline from the target repository
instead of head_pipeline.project_id. For fork merge requests whose pipeline runs
in the fork project, GitLab returns 404 Not Found on every PR status poll and
PR-pane pipeline drill-down.

Query the GitLab REST API directly via glab api using head_pipeline.project_id
(falling back to target_project_id, the MR project path, or :fullpath) for both
fetchPipelineChecks and getCheckDetails, matching how gitlab-change-requests.ts
already resolves fork pipelines.
2026-11-27 22:46:07 +07:00
paseo-bot[bot]andClaude Opus 5.5 9416336d73 Reopen an ACP agent whose process exited while it was idle (#11047)
* Reopen an ACP agent whose process exited while it was idle

When a generic ACP agent's process exits between turns, for example after
an external kill -9, every later message failed with "ACP agent
disconnected" until someone reloaded the agent by hand.

startTurn now reports a dead connection as a stale provider session when
the provider can reopen sessions (session/load or session resume). The
prompt path already reloads a stale session from persistence on a new
process and retries the message, as it does for plugin sessions. A
provider that cannot reopen a session keeps the current error, because a
reload would close the agent without a way back.

The exit handler also logs an unexpected exit, with the pid, the exit
code or signal, and whether a turn was running. Before, an exit while
idle left no line in the daemon log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Wait for the daemon to see the ACP exit in the recovery test

On Windows the test saw the killed process gone before the daemon read
the closed pipes, so the next message started a turn on the dead
connection. The test now waits for the daemon's exit warning, and checks
the disconnect text without the signal, which Windows reports as an exit
code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:52:24 +00:00
Matt CowgerandMatt Cowger 5715467245 fix(omp): preserve tool call intent in metadata (#10727)
Carry OMP tool-call `intent` strings in `ToolCallBase.metadata.intent` across live updates (`running`, `completed`, `failed`, `canceled`) and replayed session history, reusing the existing tool-call `metadata` path through the daemon, app stream, replica cache, and client timeline plugins without changing the shared protocol.

Replay reads only string `content.intent` values (ignoring non-string values and never deriving intent from a tool argument named `i`). Updates `docs/plugins.md` and `public-docs/plugins/reference.md`, and retries Windows temp-dir cleanup in `forge-cli-command.test.ts`.

Fixes #10730

Co-authored-by: Matt Cowger <matt@cowger.us>
2026-11-27 21:41:16 +07:00
paseo-bot[bot]andClaude Opus 5.5 8e8b383f4c Let idle cleanup unload an OpenCode chat while another session runs (#11039)
The v2 runtime safety check vetoed collection whenever any session on
the server was active. The shared server stays up after its last lease
goes, so that veto kept every idle chat resident while one unrelated
session worked. Another session's execution now vetoes only when
releasing the lease would stop the server; the chat's own session and
its descendants still veto as before.

Fixes #10305

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:23:13 +00:00
Mohamed Boudra 1fd744795d Add host-wide instructions for metadata generation (#11064)
* feat(settings): add host-wide instructions for metadata generation

Add a single host-level agents.metadataGeneration.instructions field instead of a language-only switch or per-artifact host overrides. It applies across workspace titles, worktree branch names, commit messages, and pull request drafts alongside Paseo's default styles, while letting per-project paseo.json overrides take precedence on conflict.

Gate the UI field on server_info.features.metadataGenerationInstructions so older daemons that drop the field on patch do not show a no-op editor, and split MutableMetadataGenerationConfigPatchSchema without a default providers array so patching instructions never wipes configured providers.

* fix(server): read host metadata instructions through structured-generation config helper
2026-11-27 20:51:24 +07:00
paseo-bot[bot]andClaude Opus 5.5 bec63111f1 test(cli): let lifecycle test daemons bind their own ports (#11054)
The lifecycle tests reserved a free port, released it, and later started
a daemon on it. Another process could bind the port in between, and the
daemon then exited with EADDRINUSE. That failed "raw log following" on
main. Tests that need no fixed port now configure 127.0.0.1:0, so the
daemon allocates the port itself and publishes it.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 12:31:09 +00:00
Mohamed Boudra dbba977ab8 fix(app): eliminate first-open jank in starting ref popover (#11042)
Opening the Starting ref popover in New Workspace for the first time jumped in two steps: the query was disabled until open, buildPickerOptionData rendered a lone [main] row in a 132px frame, and when branch suggestions arrived the popover grew to 400px while pushing main down below newer branches.

Lock the desktop popover height to 400px (and clamp fixed minHeight to availableHeight in buildDesktopFrameStyle so short viewports do not overflow), warm default branch suggestions and forge wording while the trigger is visible on the focused screen, retain same-project results while filtering, and show the searching state instead of a premature single-row placeholder on cold opens.
2026-11-27 19:22:41 +07:00
Mohamed Boudra 29179ba27f fix(server): clear finished terminals when marking a workspace read (#11040)
A terminal that goes from working to idle records finished attention, and the
workspace status rolls it up as attention. The workspace clear-attention
handler only cleared agents, so a workspace kept green by a terminal stayed
green after Mark as read, with no agent inside showing why.

Terminals are matched by the workspace they belong to, not by cwd: a terminal
can run in a different directory than its workspace. Needs-input attention is
left alone, matching how agent permission prompts are handled.
2026-11-27 19:18:37 +07:00
Mohamed Boudra dcdd327cdf fix(app): show composer autocomplete after closing overlays and hide it while submitting (#11041)
* fix(app): restore composer autocomplete after closing web overlays

Closing a web overlay such as the New Workspace branch picker runs useOverlayRegistration's teardown inside a useLayoutEffect cleanup. React 19 runs layout effect cleanups during the mutation commit phase while its DOM event system is disabled, so calling target.focus() synchronously drops focusin. React's SelectEventPlugin then keeps activeElement unset and skips onSelect/onSelectionChange, leaving the composer cursor stuck at 0 so slash and @ autocomplete never open until another event refocuses the textarea.

Defer focus restoration in addWebOverlay via queueMicrotask so focus runs after React finishes its mutation commit, guarded so a newer overlay opened in the same commit is not stolen from. Also hide ComposerAutocompleteBinding while isComposerLocked is true so autocomplete cannot appear over a submitting composer.

* fix(app): preserve focus claimed during overlay close and guard missing DOM

Skip deferred overlay focus restoration when the closing commit moves focus to a new element (such as an autofocused inline input mounted by a menu action like file explorer Rename, New file, or New folder). Also guard typeof document and typeof HTMLElement in the deferred focus-restore helpers so Node unit tests that tear down DOM stubs before microtasks run do not throw.

* fix(app): restore overlay focus during layout phase before passive effects

Deferring focus restoration to a microtask when active flipped true -> false ran after passive useEffect hooks updated, which let HoverCard's focusin listener re-enable and reopen the workspace hover card when closing a sidebar context menu.

Split registration/deactivation from unmount cleanup in useOverlayRegistration so active: true -> false restores focus synchronously inside the layout effect (after React re-enables DOM events and before passive effects run), reserving queueMicrotask for unmount-while-active where no layout setup runs. Also detach the overlay entry before clearing scopeRef so the departing scope is preserved.
2026-11-27 19:18:24 +07:00
Mohamed Boudra 91613f516d Preserve in-flight iOS App Store reviews and add EAS review queue controls (#11044)
* feat(release): preserve in-flight iOS reviews and add EAS review queue controls

Release builds previously passed reject_if_possible: true to fastlane deliver, which cancelled any in-flight Apple review whenever a quick desktop or daemon patch shipped.

submit_review now checks App Store Connect for active in-flight iOS versions and ReviewSubmissions before submitting. When a review is already in flight and REPLACE_IN_REVIEW is not true, it leaves the active review untouched, logs a machine-scannable IOS_REVIEW_SKIPPED line naming both versions, and exits 0 so Release Mobile stays green while still uploading the new binary to TestFlight.

When replace_in_review=true is explicitly requested, submit_review validates the replacement TestFlight build first and cancels the active ReviewSubmission before calling deliver, avoiding fastlane 2.241.1's verify_version-before-reject_version_if_possible ordering race. Added on-demand EAS workflows and Fastlane lanes to inspect live App Store Connect review status and cancel an in-flight review with an expected_version safety guard.

* fix(release): clear stale UNRESOLVED_ISSUES submissions and re-check review queue after build wait

When Apple rejects an earlier version, fastlane 2.241.1's Deliver::SubmitForReview#create_review_submission fails if the prior ReviewSubmission stays in UNRESOLVED_ISSUES.

Instead of passing reject_if_possible: true on the default path (which could cancel a newly-submitted WAITING_FOR_REVIEW/IN_REVIEW review that arrived during build processing), submit_review now re-checks find_blocking_review after TestFlight processing completes and clears only UNRESOLVED_ISSUES submissions before invoking deliver with reject_if_possible: false.
2026-11-27 18:40:23 +07:00
31aa498a5b fix(app): clear the iOS status bar on wide browser layouts, including the Mermaid viewer (#9970)
* fix(app): clear the iOS status bar on wide browser layouts

In an iOS Home Screen web app at a wide (non-compact) layout there is no
compact header to absorb the top safe-area inset, so the top rows sat
under the status bar and could not be tapped (#9524). The window surface
now consumes the top inset on the web when the layout is not compact;
native window chrome keeps its own top band.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(app): keep the Mermaid fullscreen controls below the status bar

The fullscreen Mermaid viewer is a Modal that covers the whole window,
but it padded its content with the insets of the chat message that
opened it. On wide web layouts the layout surface now spends the top
inset itself and hands its children top 0, so the viewer's zoom and
close buttons moved under the iOS status bar.

Wrap the viewer in WindowSafeArea, as the attachment lightbox does, so
it reads the window's insets.

Co-authored-by: Matt Abar <mattaabar@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(app): keep the overlay left sidebar below the status bar on wide browser layouts

The wide layout surface now pads the status bar itself and hands its
content a top inset of 0. The overlay sidebar is absolutely positioned
against the surface, over that padding, so it starts at the window's top
edge and needs the window's top inset. The docked sidebar keeps reading
the inset the surface leaves its content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(app): keep the autocomplete popover below the status bar from a wide layout surface

The popover clamped its height with the composer's top inset, which a wide
browser layout surface now sets to 0. The root portal host the popover can
render into sits outside that surface, against the window's top edge, so
the popover's top went under the status bar. The frame now reads the inset
where it renders, inside the portal host: the root host gets the window's
inset, and the workspace host, inside the surface, keeps 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: state that the wide web layout surface owns the top inset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Matt Abar <mattaabar@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-27 11:25:08 +00:00
paseo-bot[bot]andAndrii Panasiuk 8037d79330 Deliver Android agent notifications promptly during Doze (#8501)
* fix(server): send push notifications at high priority so Android delivers them on time

* test(push): cover urgent notifications without global stubs

Keep the push transport explicit so the priority regression exercises every batch without replacing global fetch. Production callers retain the native transport by default.

Co-authored-by: Andrii Panasiuk <andrew.panassiouk@gmail.com>

* refactor(push): name notification sender dependencies

Use an options object for the logger, token revocation callback, and HTTP transport while retaining native fetch by default.

---------

Co-authored-by: Andrii Panasiuk <andrew.panassiouk@gmail.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-27 10:59:07 +00:00
Mohamed Boudra 8c002cc750 Parallelize post-approval release shipping (#11033)
* docs(release): parallelize post-approval release shipping

Every tag-triggered GitHub Actions workflow and EAS workflow builds from the checked-out tag commit with local workspace packages, so tag builds do not depend on public npm publication. Update release:ship and release:ship:beta to push the tag before publishing npm, and document the parallel ship fan-out and sync gates in docs/release.md.

* docs(release): document npm publish recovery after tag push
2026-11-27 17:41:46 +07:00
237cfe91f1 Show enterprise spending usage for Claude and Codex (#8976)
* fix(usage): report enterprise spending limits

* fix(usage): complete enterprise spending percentages

Derive missing remaining percentages so CLI spending output matches the Usage card. Preserve explicitly reported percentages and cover missing currency and absent rolling windows.

Co-authored-by: Matt Cowger <matt@cowger.us>
Co-authored-by: JasprW <wang@jaspr.me>

---------

Co-authored-by: Matt Cowger <matt@cowger.us>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: JasprW <wang@jaspr.me>
2026-11-27 10:22:03 +00:00
paseo-ai[bot] d4fd6dcafd fix: update lockfile signatures and Nix hash [skip ci] 2026-11-27 10:13:16 +00:00
Mohamed Boudra 518e58cd63 chore(release): reconcile v0.18.0 (#11030) 2026-11-27 17:04:04 +07:00
paseo-bot[bot]andbenthecarman 82dcf7821e fix(usage): load Kimi usage for global logins (#8505)
* Find Kimi usage for logins to kimi.ai

The Kimi CLI keeps one credential slot per deployment. A login to the
global (kimi.ai) deployment writes its token to
credentials/kimi-code-env-<hash>.json and talks to api.kimi.ai, but the
usage source only read credentials/kimi-code.json and only called
api.kimi.com. Users signed in through kimi.ai saw no Kimi usage, or a
"Login expired. Sign in again." message when an old kimi-code.json from
an earlier login was still on disk.

Discovery now checks the slots of both official deployments and picks
the one with the latest expiry, which is the slot the CLI keeps
refreshing. The usage request goes to the API of that deployment.

Kimi access tokens last 15 minutes, so a CLI token is often expired
while the user is still signed in. Report those with refreshedBy so the
Usage page says to run kimi instead of asking for a new sign-in.

* fix(usage): preserve the selected Kimi credential home

Compare deployment credentials within each home so a newer legacy-home
login cannot override KIMI_CODE_HOME. Cover the expired-default plus live
global workflow through discovery and usage fetching.

Co-authored-by: benthecarman <benthecarman@live.com>

---------

Co-authored-by: benthecarman <benthecarman@live.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-27 09:50:43 +00:00
Mohamed Boudra 5d003d9613 test(cli): report version from fake ACP provider helper (#11032)
antigravity-provider status() now runs --version and requires >= 1.5.1 (#10992). Without a --version handler, supervisor-acp.cjs exited with empty stdout on the version probe and broke 23-daemon-sigint-supervisor.test.ts at createAgent().
2026-11-27 16:36:42 +07:00
paseo-bot[bot]andpeanut_hzm 9868ebc11c fix(usage): discover the GLM Agent login for its Usage card (#8376)
* fix(usage): follow the CLIs' current auth locations for MiniMax and Z.ai

The usage sources look for credentials where the CLIs used to keep them, so
their plan quota never appears in Settings → Usage.

MiniMax Code (`mcode`) moved its OAuth login to
`~/.minimax/auth/<buildEnv>/<region>/<clientId>/auth.json`, with the token
inside a `records` map and the region in a sibling `auth-state.json`. The
source still looked in `~/.mmx/` for the older `access_token` shape. It also
called `/v1/token_plan/remains`, which the agent backend answers with
`status_code 1004` ("Please carry the API secret key in the 'Authorization'
field"); the coding-plan endpoint the CLI itself uses is
`/v1/api/openplatform/coding_plan/remains`.

Z.ai's `glm-acp-agent` reads `Z_AI_API_KEY` and persists it to
`~/.config/glm-acp-agent/credentials.json` as `z_ai_api_key`. The source
looked for `ZAI_API_KEY` and `GLM_API_KEY` only, and never read the
credentials file.

Both keep their existing lookups working, so a configured environment
variable or the older `~/.mmx/` layout still resolves.

* fix(usage): narrow credential discovery repair to the verified GLM path

Keep the independently reproduced GLM discovery fix and isolate its file test from inherited XDG_CONFIG_HOME. Leave MiniMax quota routing for separate verification before changing existing API-key requests.

Co-authored-by: peanut_hzm <peanut_hzm@163.com>

* test(usage): isolate the legacy login locator from inherited credentials

---------

Co-authored-by: peanut_hzm <peanut_hzm@163.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-27 09:21:16 +00:00
652 changed files with 52253 additions and 13104 deletions
+1
View File
@@ -86,6 +86,7 @@ packages/server/src/server/fixtures/dictation/dictation-debug-largest.wav
packages/server/src/server/fixtures/dictation/dictation-debug-largest.transcript.txt
packages/protocol/src/generated/validation/*.aot.ts
packages/protocol/src/generated/validation/ws-outbound-schema-metadata.ts
packages/protocol/src/generated/validation/message-defaults.ts
packages/protocol/codegen/generated/
/artifacts
+1
View File
@@ -15,6 +15,7 @@
"*.lock",
"**/*.gen.ts",
"**/*.gen.tsx",
"**/*.icon/**",
"packages/react-native-enriched-markdown/**"
]
}
+44
View File
@@ -1,5 +1,49 @@
# Changelog
## 0.18.1 - 2026-11-27
- **Host metadata instructions:** Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests. ([#11064](https://github.com/getpaseo/paseo/pull/11064))
- **Enterprise spending usage:** Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times. ([#8976](https://github.com/getpaseo/paseo/pull/8976) by [@mcowger](https://github.com/mcowger), [@JasprW](https://github.com/JasprW))
### Fixed
- Fixed Android agent push notifications arriving minutes late during Doze ([#8501](https://github.com/getpaseo/paseo/pull/8501) by [@truelecter](https://github.com/truelecter))
- Fixed Command Center results reordering mid-word while typing ([#11085](https://github.com/getpaseo/paseo/pull/11085))
- Fixed composer slash and `@` autocomplete stopping after closing a web overlay or opening while a prompt submits ([#11041](https://github.com/getpaseo/paseo/pull/11041))
- Fixed the Starting ref popover in New Workspace jumping in height and shifting rows on first open ([#11042](https://github.com/getpaseo/paseo/pull/11042))
- Fixed the iOS Home Screen web app status bar overlapping focus-mode tabs, the overlay sidebar, and the Mermaid fullscreen viewer on wide layouts ([#9970](https://github.com/getpaseo/paseo/pull/9970) by [@mywaffles](https://github.com/mywaffles))
- Fixed Mark as read on a workspace not clearing finished terminal attention ([#11040](https://github.com/getpaseo/paseo/pull/11040))
- Fixed GitLab merge request checks and pipeline details failing with 404 when the pipeline runs in a fork project ([#11074](https://github.com/getpaseo/paseo/pull/11074))
- Fixed messages sent while Pi runs a turn it started itself failing instead of queuing ([#11077](https://github.com/getpaseo/paseo/pull/11077))
- Fixed OpenCode v2 tool approvals staying stuck after OpenCode already dropped the request ([#11061](https://github.com/getpaseo/paseo/pull/11061) by [@rhettjay](https://github.com/rhettjay))
- Fixed idle cleanup keeping OpenCode v2 chats in memory while another session runs on the shared server ([#11039](https://github.com/getpaseo/paseo/pull/11039))
- Fixed idle ACP agents failing permanently after their process exits instead of reopening on the next message ([#11047](https://github.com/getpaseo/paseo/pull/11047))
- Fixed Kimi usage failing or showing an expired login for global `kimi.ai` accounts ([#8505](https://github.com/getpaseo/paseo/pull/8505) by [@benthecarman](https://github.com/benthecarman))
- Fixed the Z.ai Usage card missing when GLM Agent is signed in via `Z_AI_API_KEY` or its credentials file ([#8376](https://github.com/getpaseo/paseo/pull/8376) by [@Peanut-HZM](https://github.com/Peanut-HZM))
### Plugins
- Added OMP tool-call intent to `item.metadata.intent` for timeline plugins ([#10727](https://github.com/getpaseo/paseo/pull/10727) by [@mcowger](https://github.com/mcowger))
## 0.18.0 - 2026-11-27
- **Remote workspace browser proxy:** Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote `localhost` servers open directly in Paseo. ([#10944](https://github.com/getpaseo/paseo/pull/10944) by [@airon-assustadus](https://github.com/airon-assustadus))
- **Per-device notification preferences:** Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps. ([#10888](https://github.com/getpaseo/paseo/pull/10888))
- **Agent profile system prompts:** Save an optional system prompt on an agent profile to apply it to new agents started from that profile. ([#10996](https://github.com/getpaseo/paseo/pull/10996))
- **More syntax highlighting:** Syntax highlighting now covers diff and patch files along with Ruby, Kotlin, TOML, SQL, Lua, Protobuf, PowerShell, Groovy, Gradle, Scala, CMake, Properties, INI, R, Perl, and LaTeX. ([#11026](https://github.com/getpaseo/paseo/pull/11026) by [@hmalaspina](https://github.com/hmalaspina), [@kukicola](https://github.com/kukicola), [@MaximeConan](https://github.com/MaximeConan), [@singleton11](https://github.com/singleton11), [@chandlerok](https://github.com/chandlerok))
### Changed
- Changed ACP providers to cache model catalogs across daemon restarts instead of probing in the background, and cleaned up Antigravity ACP flags and metadata. Requires [Antigravity CLI 1.5.1 or later](https://paseo.sh/docs/supported-providers/antigravity) ([#10992](https://github.com/getpaseo/paseo/pull/10992))
### Fixed
- Fixed Paseo iOS crashing shortly after connecting when an enabled client plugin imports `react-native` ([#11011](https://github.com/getpaseo/paseo/pull/11011))
- Fixed OpenCode v2 agents staying stuck in running after Stop when stream events were missed or chat history was large ([#10955](https://github.com/getpaseo/paseo/pull/10955))
- Fixed steering a Pi agent during a run it started on its own aborting the run instead of steering it ([#10977](https://github.com/getpaseo/paseo/pull/10977) by [@viiqswim](https://github.com/viiqswim))
- Fixed creating a workspace from a pull request in a fork clone checking out the fork's pull request with the same number ([#10987](https://github.com/getpaseo/paseo/pull/10987))
- Fixed dropping images or files onto the composer leaving the input unfocused ([#11022](https://github.com/getpaseo/paseo/pull/11022))
## 0.17.6 - 2026-11-27
### Improved
+44
View File
@@ -1,5 +1,49 @@
# Changelog
## 0.18.1 - 2026-11-27
- **主机元数据指令**:设置一次主机级指令,即可统一控制自动生成的工作区标题、分支名、提交信息和 PR 的语言、语气与格式。([#11064](https://github.com/getpaseo/paseo/pull/11064))
- **企业消费用量**:使用情况现已显示 Claude 额外消费用量以及 Codex 个人消费限额和重置时间。([#8976](https://github.com/getpaseo/paseo/pull/8976),贡献者:[@mcowger](https://github.com/mcowger), [@JasprW](https://github.com/JasprW))
### 修复
- 修复 Android 在 Doze 休眠模式下 Agent 推送通知延迟数分钟送达的问题 ([#8501](https://github.com/getpaseo/paseo/pull/8501),贡献者:[@truelecter](https://github.com/truelecter))
- 修复在命令中心输入时结果顺序在单词输入中途跳动的问题 ([#11085](https://github.com/getpaseo/paseo/pull/11085))
- 修复关闭网页浮层后 Composer 的斜杠与 `@` 自动补全失效,以及提交提示词时自动补全弹出的问题 ([#11041](https://github.com/getpaseo/paseo/pull/11041))
- 修复在“新建工作区”中首次打开“起始 ref”浮层时高度跳动和行位偏移的问题 ([#11042](https://github.com/getpaseo/paseo/pull/11042))
- 修复宽屏布局下 iOS 主屏幕网页应用的状态栏遮挡专注模式标签栏、覆盖侧边栏和 Mermaid 全屏查看器的问题 ([#9970](https://github.com/getpaseo/paseo/pull/9970),贡献者:[@mywaffles](https://github.com/mywaffles))
- 修复将工作区标记为已读时未清除已完成终端提醒的问题 ([#11040](https://github.com/getpaseo/paseo/pull/11040))
- 修复 GitLab 合并请求的流水线运行在 fork 项目中时,检查状态和流水线详情返回 404 的问题 ([#11074](https://github.com/getpaseo/paseo/pull/11074))
- 修复 Pi 运行其自行启动的轮次时发送的消息直接失败而不是排队的问题 ([#11077](https://github.com/getpaseo/paseo/pull/11077))
- 修复 OpenCode v2 已丢弃工具审批请求后,审批卡片仍一直卡住的问题 ([#11061](https://github.com/getpaseo/paseo/pull/11061),贡献者:[@rhettjay](https://github.com/rhettjay))
- 修复共享服务器上运行其他会话时,空闲清理不会卸载闲置 OpenCode v2 对话的问题 ([#11039](https://github.com/getpaseo/paseo/pull/11039))
- 修复空闲 ACP Agent 的进程意外退出后永久失败,而不是在下一条消息时重新打开会话的问题 ([#11047](https://github.com/getpaseo/paseo/pull/11047))
- 修复使用全局 `kimi.ai` 账号登录时 Kimi 用量加载失败或显示登录已过期的问题 ([#8505](https://github.com/getpaseo/paseo/pull/8505),贡献者:[@benthecarman](https://github.com/benthecarman))
- 修复通过 `Z_AI_API_KEY` 或凭据文件登录 GLM Agent 时缺少 Z.ai 使用情况卡片的问题 ([#8376](https://github.com/getpaseo/paseo/pull/8376),贡献者:[@Peanut-HZM](https://github.com/Peanut-HZM))
### 插件
- 为时间线插件在 `item.metadata.intent` 中新增 OMP 工具调用意图 ([#10727](https://github.com/getpaseo/paseo/pull/10727),贡献者:[@mcowger](https://github.com/mcowger))
## 0.18.0 - 2026-11-27
- **远程工作区浏览器代理**:远程工作区中的桌面端浏览器标签页现在会通过该工作区的 daemon 转发流量,远程 `localhost` 服务可以直接在 Paseo 中打开。([#10944](https://github.com/getpaseo/paseo/pull/10944),贡献者:[@airon-assustadus](https://github.com/airon-assustadus))
- **按设备配置通知偏好**:每台设备都可以分别选择哪些 Agent、终端和插件事件发送通知,插件现在也可以发送通知并处理点击。([#10888](https://github.com/getpaseo/paseo/pull/10888))
- **智能体配置文件系统提示词**:在智能体配置文件中保存可选的系统提示词,以便在通过该配置启动新 Agent 时应用。([#10996](https://github.com/getpaseo/paseo/pull/10996))
- **更多语法高亮语言**:语法高亮现已支持 diff 和 patch 文件,以及 Ruby、Kotlin、TOML、SQL、Lua、Protobuf、PowerShell、Groovy、Gradle、Scala、CMake、Properties、INI、R、Perl 和 LaTeX。([#11026](https://github.com/getpaseo/paseo/pull/11026),贡献者:[@hmalaspina](https://github.com/hmalaspina), [@kukicola](https://github.com/kukicola), [@MaximeConan](https://github.com/MaximeConan), [@singleton11](https://github.com/singleton11), [@chandlerok](https://github.com/chandlerok))
### 变更
- ACP Provider 现在会在 daemon 重启间将已发现的模型目录缓存到磁盘,不再在后台轮询,同时清理了多余的 Antigravity ACP 参数和元数据。需要 [Antigravity CLI 1.5.1 或更高版本](https://paseo.sh/zh-CN/docs/supported-providers/antigravity) ([#10992](https://github.com/getpaseo/paseo/pull/10992))
### 修复
- 修复已启用的客户端插件导入 `react-native` 时,Paseo iOS 在连接后不久崩溃的问题 ([#11011](https://github.com/getpaseo/paseo/pull/11011))
- 修复流事件丢失或对话历史较大时,OpenCode v2 Agent 在点击停止后仍停留在运行中的问题 ([#10955](https://github.com/getpaseo/paseo/pull/10955))
- 修复在 Pi Agent 运行其自行启动的轮次时发送引导消息会中止该轮次而不是引导它的问题 ([#10977](https://github.com/getpaseo/paseo/pull/10977),贡献者:[@viiqswim](https://github.com/viiqswim))
- 修复在 fork 克隆中根据 PR 创建工作区时,检出到 fork 中同编号 PR 的问题 ([#10987](https://github.com/getpaseo/paseo/pull/10987))
- 修复向 Composer 拖放图片或文件后输入框未获得焦点的问题 ([#11022](https://github.com/getpaseo/paseo/pull/11022))
## 0.17.6 - 2026-11-27
### 改进
+1 -1
View File
@@ -58,7 +58,7 @@
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
<table>
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Cloud coding agents</sub></td>
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo のスポンサーになる</a></td>
</tr>
+1 -1
View File
@@ -52,7 +52,7 @@
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
<table>
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Cloud coding agents</sub></td>
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo 스폰서 되기</a></td>
</tr>
+1 -1
View File
@@ -57,7 +57,7 @@ Paseo is an open source agentic development environment for desktop, mobile, web
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
<table>
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="56"></picture></a><br><sub>Cloud coding agents</sub></td>
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="56"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="56"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Become a sponsor</a></td>
</tr>
+1 -1
View File
@@ -58,7 +58,7 @@
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
<table>
<tr valign="top">
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Cloud coding agents</sub></td>
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Hoplite runs swarms of coding agents in the cloud.</sub></td>
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
<td align="center" width="33%"><a href="https://paseo.sh/zh-CN/sponsor">成为 Paseo 赞助商</a></td>
</tr>
+27 -1
View File
@@ -1,6 +1,6 @@
# Brand assets
Canonical marks, lockups, and wordmark font for **Paseo** and **Paseo Hub**. These are the source assets that will replace the existing icons across the app, desktop client, website, docs, and Hub in follow-up work.
Canonical marks, lockups, and wordmark font for **Paseo** and **Paseo Hub**. These are the source assets for the icons across the app, desktop client, website, docs, and Hub.
## Brand architecture
@@ -37,6 +37,10 @@ All lockups (`lockups/*.svg`) share a `144`-unit height (`140`-unit flower ink h
```text
assets/brand/
build.mjs Regenerates all marks and lockups
build-app-icons.mjs Regenerates the desktop and mobile app icons
app-icons/
paseo-lit.png
paseo-dev-lit.png
fonts/
PlusJakartaSans-SemiBold.ttf
OFL.txt
@@ -61,3 +65,25 @@ assets/brand/
```sh
node assets/brand/build.mjs
```
## App icons
`build-app-icons.mjs` renders every desktop and mobile app icon from `marks/paseo-white.svg`: the white butterfly on a black tile, and a blueprint tile for desktop development builds. Regenerate them after changing the butterfly:
```sh
node assets/brand/build-app-icons.mjs
```
The icons that ship are flat. Each platform masks and lights its own icons, so lit artwork ends up lit twice. `app-icons/` keeps a lit version of the two desktop icons, a baked approximation of macOS Liquid Glass. Nothing uses them.
The packaged Mac app takes its icon from `packages/desktop/assets/icon.icon`, an Icon Composer document the script also writes. macOS draws Liquid Glass on it and derives the dark, tinted, and clear variants. electron-builder compiles the document with `actool`, so packaging the Mac app needs Xcode 26 or later. The Nix build has no Xcode and uses `icon.icns`.
To see what macOS draws from the document without packaging the app, export it with Icon Composer's command line tool on a Mac:
```sh
"/Applications/Xcode.app/Contents/Applications/Icon Composer.app/Contents/Executables/ictool" \
packages/desktop/assets/icon.icon --export-image --output-file icon.png \
--platform macOS --rendition Default --width 1024 --height 1024 --scale 1
```
`--rendition` also takes `Dark`, `TintedLight`, `TintedDark`, `ClearLight`, and `ClearDark`.
Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

+464
View File
@@ -0,0 +1,464 @@
// Generates every Paseo app icon from the canonical butterfly mark.
//
// node assets/brand/build-app-icons.mjs
//
// The artwork is the white butterfly on a black tile. A desktop development build gets the same
// tile drawn as a blueprint, so it is never mistaken for an installed app.
//
// The icons that ship are flat. Each platform masks and lights its own icons, and artwork that
// arrives already lit ends up lit twice. The lit finish is a baked approximation of the Liquid
// Glass material macOS draws for Icon Composer icons. It is written to app-icons/ so it stays
// available, and nothing consumes it.
//
// A packaged Mac app gets its icon from the Icon Composer document in the desktop assets, which
// macOS masks and lights itself. macOS draws a dev build's Dock icon and an .icns exactly as
// supplied, so those carry the system's tile in the artwork. Its geometry is measured from the icon
// macOS 27 draws for that document: the tile covers 824 of the 1024 canvas pixels and its corners
// are continuous curves with a radius of 26.4% of the tile.
//
// sharp is not a declared dependency. It resolves from the workspace root, the way opentype.js
// does for build.mjs.
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import sharp from "sharp";
const brandDir = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(brandDir, "../..");
const brandMarkPath = path.join(brandDir, "marks/paseo-white.svg");
const CANVAS = 1024;
const MACOS_TILE_ON_CANVAS = 824 / CANVAS;
// Windows and Linux have no icon grid, and a tile with the macOS margin looks small next to their
// other icons.
const WINDOWS_LINUX_TILE_ON_CANVAS = 928 / CANVAS;
// Artwork is drawn in the brand mark's own 700-unit box, which the tile fills.
const TILE = 700;
const TILE_RADIUS = 185;
const MARK_INK = 527;
// Scaled down, the mark keeps clear of the tile's corners and covers as much of the tile as the
// glyphs in Apple's icons do.
const MARK_SCALE = 0.9;
const MARK_INK_ON_TILE = (MARK_INK * MARK_SCALE) / TILE;
// Android shows the middle 72 of an adaptive icon's 108 units.
const ANDROID_ADAPTIVE_VISIBLE = 72 / 108;
const NOTIFICATION_MARK_INK = 0.75;
// Apple's continuous corner. Each pair is a distance back along the incoming edge and a distance
// along the outgoing edge, in units of the corner radius.
const CORNER_SEGMENTS = [
["C", [1.08849296, 0], [0.86840694, 0], [0.66993427, 0.065496]],
["L", [0.63149399, 0.074911]],
["C", [0.37282392, 0.16905899], [0.16905899, 0.37282392], [0.074911, 0.63149399]],
["L", [0.065496, 0.66993427]],
["C", [0, 0.86840694], [0, 1.08849296], [0, 1.52866483]],
];
const CORNER_START = [1.52866483, 0];
function continuousSquarePath(inset) {
const near = inset;
const far = TILE - inset;
const radius = TILE_RADIUS - inset;
const corners = [
{ at: [far, near], incoming: [1, 0], outgoing: [0, 1] },
{ at: [far, far], incoming: [0, 1], outgoing: [-1, 0] },
{ at: [near, far], incoming: [-1, 0], outgoing: [0, -1] },
{ at: [near, near], incoming: [0, -1], outgoing: [1, 0] },
];
const commands = corners.map(({ at, incoming, outgoing }, cornerIndex) => {
const point = ([back, along]) =>
[0, 1]
.map((axis) => at[axis] - incoming[axis] * back * radius + outgoing[axis] * along * radius)
.map((value) => Number(value.toFixed(2)))
.join(" ");
const segments = CORNER_SEGMENTS.map(
([command, ...points]) => `${command}${points.map(point).join(" ")}`,
);
return `${cornerIndex === 0 ? "M" : "L"}${point(CORNER_START)}${segments.join("")}`;
});
return `${commands.join("")}Z`;
}
const TILE_SHAPE = `<path d="${continuousSquarePath(0)}" />`;
const FILL_TILE = `<rect width="${TILE}" height="${TILE}" fill="url(#surface)" />`;
const PRODUCTION = {
flat: {
defs: `<linearGradient id="surface"><stop stop-color="#000000" /></linearGradient>`,
surface: FILL_TILE,
},
lit: {
defs: `
<linearGradient id="surface" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#202022" />
<stop offset="1" stop-color="#0E0E10" />
</linearGradient>`,
surface: FILL_TILE,
tileEdge: { color: "#000000", opacity: 0.75 },
markEdge: { color: "#4A5568", opacity: 0.45 },
markShadow: { color: "#000000", opacity: 0.5 },
},
};
const GRID_DIVISIONS = 8;
const GRID_MAJOR_EVERY = 2;
const OUTLINE_INSET = 28;
function gridLines(isIncluded) {
const step = TILE / GRID_DIVISIONS;
const segments = [];
for (let index = 1; index < GRID_DIVISIONS; index += 1) {
if (!isIncluded(index)) continue;
const at = index * step;
segments.push(`M${at} 0V${TILE}`, `M0 ${at}H${TILE}`);
}
return segments.join("");
}
const isMajorLine = (index) => index % GRID_MAJOR_EVERY === 0;
const BLUEPRINT_SHEET = {
defs: `
<linearGradient id="surface" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#05C2FE" />
<stop offset="0.5" stop-color="#0191FD" />
<stop offset="1" stop-color="#026CFA" />
</linearGradient>`,
surface: `
${FILL_TILE}
<g fill="none" stroke="#FFFFFF">
<path d="${gridLines((index) => !isMajorLine(index))}" stroke-opacity="0.16" stroke-width="1.5" />
<path d="${gridLines(isMajorLine)}" stroke-opacity="0.34" stroke-width="2" />
<circle cx="${TILE / 2}" cy="${TILE / 2}" r="${TILE / 2 - OUTLINE_INSET}" stroke-opacity="0.45" stroke-width="2" stroke-dasharray="10 8" />
<path d="${continuousSquarePath(OUTLINE_INSET)}" stroke-opacity="0.34" stroke-width="2" />
</g>`,
};
const BLUEPRINT = {
flat: BLUEPRINT_SHEET,
lit: {
...BLUEPRINT_SHEET,
tileEdge: { color: "#0034B4", opacity: 0.55 },
markEdge: { color: "#1E5FD0", opacity: 0.5 },
markShadow: { color: "#00308F", opacity: 0.4 },
},
};
// The lit finish, tuned against Apple's own renders. The light comes from straight above: a
// layer's upward-facing edge gets a bright highlight, its downward-facing edge a fainter one, and
// its side edges darken.
//
// An edge highlight is the part of the layer that a vertically shifted copy does not cover. A
// vertical blur of the shifted copy makes the highlight brightest at the edge and absent on
// vertical edges. A wider, round blur of the same band dims it where the edge turns away from
// the light, which is what keeps the tile's corners quieter than its top.
function glassFilter({ id, edge, edgeWidth, lightWidth, upperLight, lowerLight, shadow }) {
const light = (name, direction, opacity) => `
<feOffset in="SourceAlpha" dy="${direction * lightWidth}" />
<feGaussianBlur stdDeviation="0 ${lightWidth}" result="${name}Shifted" />
<feComposite in="SourceAlpha" in2="${name}Shifted" operator="out" result="${name}Edge" />
<feOffset in="SourceAlpha" dy="${direction * lightWidth * 2}" result="${name}Far" />
<feComposite in="SourceAlpha" in2="${name}Far" operator="out" />
<feGaussianBlur stdDeviation="${lightWidth * 3}" />
<feComponentTransfer><feFuncA type="gamma" exponent="3" amplitude="65" /></feComponentTransfer>
<feComposite in2="${name}Edge" operator="arithmetic" k1="1" result="${name}Shape" />
<feFlood flood-color="#FFFFFF" flood-opacity="${opacity}" />
<feComposite in2="${name}Shape" operator="in" result="${name}" />`;
const dropShadow = shadow
? `
<feGaussianBlur in="SourceAlpha" stdDeviation="${shadow.blur}" />
<feOffset dy="${shadow.offset}" result="shadowShape" />
<feFlood flood-color="${shadow.color}" flood-opacity="${shadow.opacity}" />
<feComposite in2="shadowShape" operator="in" result="shadow" />`
: "";
return `
<filter id="${id}" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">${dropShadow}
<feMorphology in="SourceAlpha" operator="erode" radius="${edgeWidth * 0.6}" />
<feGaussianBlur stdDeviation="${edgeWidth}" result="core" />
<feFlood flood-color="${edge.color}" flood-opacity="${edge.opacity}" />
<feComposite in2="core" operator="out" />
<feComposite in2="SourceAlpha" operator="in" result="edge" />
${light("upper", 1, upperLight)}
${light("lower", -1, lowerLight)}
<feMerge>
${shadow ? '<feMergeNode in="shadow" />' : ""}
<feMergeNode in="SourceGraphic" />
<feMergeNode in="edge" />
<feMergeNode in="upper" />
<feMergeNode in="lower" />
</feMerge>
</filter>`;
}
function litDefs({ tileEdge, markEdge, markShadow }) {
const markBody = `
<linearGradient id="markBody" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#FFFFFF" />
<stop offset="0.4" stop-color="#FFFFFF" />
<stop offset="1" stop-color="#D9DFE9" />
</linearGradient>`;
const tileGlass = glassFilter({
id: "tileGlass",
edge: tileEdge,
edgeWidth: 3,
lightWidth: 3.6,
upperLight: 0.82,
lowerLight: 0.45,
});
const markGlass = glassFilter({
id: "markGlass",
edge: markEdge,
edgeWidth: 1.2,
lightWidth: 1.6,
upperLight: 1,
lowerLight: 0.6,
shadow: { ...markShadow, blur: 9, offset: 8 },
});
return `${markBody}${tileGlass}${markGlass}`;
}
function brandMark(stroke) {
const svg = readFileSync(brandMarkPath, "utf8");
const outline = svg.match(/\bd="([^"]+)"/);
const strokeWidth = svg.match(/\bstroke-width="([^"]+)"/);
if (!outline || !strokeWidth) {
throw new Error(`No stroked mark path in ${brandMarkPath}`);
}
// The path carries its own `fill="none"`: Icon Composer ignores the one on the <svg> element and
// draws a hairline from the end of the stroke back to its start.
return `<path d="${outline[1]}" fill="none" stroke="${stroke}" stroke-width="${strokeWidth[1]}" stroke-linecap="round" stroke-linejoin="round" />`;
}
function scaledAboutCentre(scale, content) {
const centre = TILE / 2;
return `<g transform="translate(${centre} ${centre}) scale(${scale}) translate(${-centre} ${-centre})">${content}</g>`;
}
// A square canvas with the 700-unit artwork box centred on it and covering `boxOnCanvas` of its
// width.
function canvasSvg(boxOnCanvas, content) {
const canvasUnits = TILE / boxOnCanvas;
const origin = (TILE - canvasUnits) / 2;
return [
`<svg width="${CANVAS}" height="${CANVAS}" viewBox="${origin} ${origin} ${canvasUnits} ${canvasUnits}" fill="none" xmlns="http://www.w3.org/2000/svg">`,
content,
"</svg>",
].join("\n");
}
// The tile with the mark on it. A masked tile has the continuous corners cut into the artwork. A
// square tile is for platforms that apply their own mask.
function tileIconSvg({ artwork, finish, tileOnCanvas, corners }) {
const look = artwork[finish];
const isLit = finish === "lit";
const filtered = (id, content) => (isLit ? `<g filter="url(#${id})">${content}</g>` : content);
const tile =
corners === "continuous" ? `<g clip-path="url(#tile)">${look.surface}</g>` : look.surface;
const mark = scaledAboutCentre(MARK_SCALE, brandMark(isLit ? "url(#markBody)" : "#FFFFFF"));
return canvasSvg(
tileOnCanvas,
[
`<defs><clipPath id="tile">${TILE_SHAPE}</clipPath>${look.defs}${isLit ? litDefs(look) : ""}</defs>`,
filtered("tileGlass", tile),
filtered("markGlass", mark),
].join("\n"),
);
}
// The white mark alone on a transparent canvas, its ink covering `inkOnCanvas` of the width.
function markOnlySvg(inkOnCanvas) {
return canvasSvg((inkOnCanvas * TILE) / MARK_INK, brandMark("#FFFFFF"));
}
function rasterizer(svg) {
const source = Buffer.from(svg);
const sized = (size) => sharp(source).resize(size, size);
return {
png: (size) => sized(size).png({ compressionLevel: 9 }).toBuffer(),
opaquePng: (size) => sized(size).removeAlpha().png({ compressionLevel: 9 }).toBuffer(),
rgba: (size) => sized(size).ensureAlpha().raw().toBuffer(),
};
}
// ICO: a directory of PNG-encoded entries. A size byte of 0 means 256.
function encodeIco(entries) {
const header = Buffer.alloc(6);
header.writeUInt16LE(1, 2);
header.writeUInt16LE(entries.length, 4);
let offset = header.length + entries.length * 16;
const directory = entries.map(({ size, png }) => {
const entry = Buffer.alloc(16);
entry.writeUInt8(size % 256, 0);
entry.writeUInt8(size % 256, 1);
entry.writeUInt16LE(1, 4);
entry.writeUInt16LE(32, 6);
entry.writeUInt32LE(png.length, 8);
entry.writeUInt32LE(offset, 12);
offset += png.length;
return entry;
});
return Buffer.concat([header, ...directory, ...entries.map((entry) => entry.png)]);
}
function icnsElement(type, data) {
const header = Buffer.alloc(8);
header.write(type, 0, "latin1");
header.writeUInt32BE(header.length + data.length, 4);
return Buffer.concat([header, data]);
}
// The 16 and 32 pixel ICNS slots predate PNG: three run-length-encoded colour planes plus a
// separate 8-bit alpha mask. A control byte below 128 copies the next (byte + 1) values, so
// literal-only chunks are a valid encoding.
function icnsLegacyElements(colorType, maskType, rgba) {
const pixels = rgba.length / 4;
const chunks = [];
for (let channel = 0; channel < 3; channel += 1) {
for (let start = 0; start < pixels; start += 128) {
const length = Math.min(128, pixels - start);
const chunk = Buffer.alloc(length + 1);
chunk[0] = length - 1;
for (let index = 0; index < length; index += 1) {
chunk[index + 1] = rgba[(start + index) * 4 + channel];
}
chunks.push(chunk);
}
}
const mask = Buffer.alloc(pixels);
for (let index = 0; index < pixels; index += 1) {
mask[index] = rgba[index * 4 + 3];
}
return [icnsElement(colorType, Buffer.concat(chunks)), icnsElement(maskType, mask)];
}
async function encodeIcns(icon) {
const pngSlots = [
["ic07", 128],
["ic08", 256],
["ic09", 512],
["ic10", 1024],
["ic11", 32],
["ic12", 64],
["ic13", 256],
["ic14", 512],
];
const elements = [
...icnsLegacyElements("is32", "s8mk", await icon.rgba(16)),
...icnsLegacyElements("il32", "l8mk", await icon.rgba(32)),
];
for (const [type, size] of pngSlots) {
elements.push(icnsElement(type, await icon.png(size)));
}
const body = Buffer.concat(elements);
const header = Buffer.alloc(8);
header.write("icns", 0, "latin1");
header.writeUInt32BE(header.length + body.length, 4);
return Buffer.concat([header, body]);
}
// The Icon Composer document macOS 26 and later build the app icon from. The canvas is the whole
// tile: macOS adds the mask, the margin, and the lighting. The mark stays opaque so it reads as
// solid white on the black tile.
function iconComposerFiles() {
const layer = "butterfly.svg";
const document = {
fill: { solid: "srgb:0.00000,0.00000,0.00000,1.00000" },
groups: [
{
layers: [{ "image-name": layer, name: "butterfly" }],
shadow: { kind: "neutral", opacity: 0.5 },
translucency: { enabled: false, value: 0.5 },
},
],
"supported-platforms": { squares: ["macOS"] },
};
return [
["icon.json", `${JSON.stringify(document, null, 2)}\n`],
[`Assets/${layer}`, `${markOnlySvg(MARK_INK_ON_TILE)}\n`],
];
}
function write(file, data) {
const target = path.join(repoRoot, file);
mkdirSync(path.dirname(target), { recursive: true });
writeFileSync(target, data);
}
function desktopIcon(artwork, finish, tileOnCanvas) {
return rasterizer(tileIconSvg({ artwork, finish, tileOnCanvas, corners: "continuous" }));
}
async function buildDesktopIcons() {
const production = desktopIcon(PRODUCTION, "flat", WINDOWS_LINUX_TILE_ON_CANVAS);
const assets = "packages/desktop/assets";
const pngFiles = [
["icon.png", 512],
["32x32.png", 32],
["64x64.png", 64],
["128x128.png", 128],
["128x128@2x.png", 256],
];
for (const [file, size] of pngFiles) {
write(`${assets}/${file}`, await production.png(size));
}
const icoEntries = [];
for (const size of [32, 16, 24, 48, 64, 256]) {
icoEntries.push({ size, png: await production.png(size) });
}
write(`${assets}/icon.ico`, encodeIco(icoEntries));
write(
`${assets}/icon.icns`,
await encodeIcns(desktopIcon(PRODUCTION, "flat", MACOS_TILE_ON_CANVAS)),
);
for (const [file, content] of iconComposerFiles()) {
write(`${assets}/icon.icon/${file}`, content);
}
write(
`${assets}/icon-dev.png`,
await desktopIcon(BLUEPRINT, "flat", MACOS_TILE_ON_CANVAS).png(CANVAS),
);
}
async function buildMobileIcons() {
const flat = (corners) =>
rasterizer(tileIconSvg({ artwork: PRODUCTION, finish: "flat", tileOnCanvas: 1, corners }));
// iOS masks these itself, and Expo flattens any transparency in the app icon onto white.
const square = flat("square");
// Shown as supplied, so the corners are part of the artwork.
const masked = flat("continuous");
const adaptiveForeground = rasterizer(markOnlySvg(ANDROID_ADAPTIVE_VISIBLE * MARK_INK_ON_TILE));
const notification = rasterizer(markOnlySvg(NOTIFICATION_MARK_INK));
write("packages/app/assets/images/icon.png", await square.opaquePng(1024));
write("packages/app/public/apple-touch-icon.png", await square.opaquePng(180));
write(
"packages/app/assets/images/android-icon-foreground.png",
await adaptiveForeground.png(1024),
);
write("packages/app/assets/images/notification-icon.png", await notification.png(96));
write("packages/app/assets/images/splash-icon.png", await masked.png(1024));
write("packages/app/public/pwa-icon-192.png", await masked.png(192));
write("packages/app/public/pwa-icon-512.png", await masked.png(512));
write("fastlane/metadata/android/en-US/images/icon.png", await masked.png(512));
}
async function buildLitIcons() {
for (const [file, artwork] of [
["paseo-lit.png", PRODUCTION],
["paseo-dev-lit.png", BLUEPRINT],
]) {
const icon = desktopIcon(artwork, "lit", MACOS_TILE_ON_CANVAS);
write(`assets/brand/app-icons/${file}`, await icon.png(CANVAS));
}
}
await buildDesktopIcons();
await buildMobileIcons();
await buildLitIcons();
+25 -16
View File
@@ -80,7 +80,9 @@ Provider checks follow the signals their runtimes expose:
- Codex queries background terminals for loaded threads, including native children, and protects
pending provider requests. App servers without the terminal-list RPC stay resident.
- OpenCode checks active executions and descendants. V1 checks PTYs; v2 also checks shell and
inbox inventories. The shared server remains leased while a session vetoes collection.
inbox inventories. The shared server remains leased while a session vetoes collection. V2 lets
another session's execution veto only when releasing the lease would stop the server; the shared
server stays up after its last lease goes.
- Pi checks streaming, compaction, pending replies, and adapter-owned operations. Known native
subagent signals also protect their parent through the daemon's subagent store.
- OMP additionally requires `get_state.isSettled: true` and `hasPendingAsyncWork: false`.
@@ -152,17 +154,17 @@ Users can also detach an existing subagent from the subagents track. Detach is d
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.
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:
Any sender picks `queue`, `steer`, or `interrupt` with `activeTurnBehavior`. Agent senders default to `queue`; non-agent senders (app, CLI, plugins, Hub, top-level MCP) default to `interrupt`. 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.
- **`queue`** waits for any running or starting turn (including compaction) to end on its own or fail, then delivers the queued prompts together. The daemon releases it when it observes the recipient settle; a two-second timer also retries. On an idle recipient, agent messages wait two quiet seconds (steady arrivals cannot hold that window open past ten seconds); a non-agent queued message skips that quiet window and starts a turn at once. A non-agent queued message is sent unwrapped when dispatched alone, and in a `kind="user-message"` envelope when it shares a prompt with other messages. 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.
- **A person's direct prompt** (`steer` or `interrupt` from app, CLI, plugins, Hub, or top-level MCP) is dispatched directly 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`.
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 new client talking to a daemon without `server_info.features.nonAgentMessageQueue` refuses a non-agent `queue` before sending.
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.
@@ -196,17 +198,24 @@ outstanding intent. A crash after successful dispatch but before removal commits
notification. Clean shutdown can also flush an already queued callback while retaining its intent,
so that callback can repeat after restart. This is an at-least-once wakeup, without turn attribution or exactly-once delivery.
A turn end is not always a settled child. When the child ends its turn with work that will start its
next turn by itself, the caller gets one `message` notice ("ended its turn but is still working") and
the subscription keeps following the child. That work is a running turn, queued messages, a pending
provider wake-up (`AgentSession.hasPendingWakeup`: Claude background tasks, task notifications, and
one-shot wake-ups), or the child's own outstanding finish subscriptions as a caller. Heartbeats,
recurring crons, change-request watches, and other daemon background items never count: they are
external triggers, not work the caller is waiting for. While following, turn ends and work changes stay
silent until nothing is pending, which sends `finished` and removes the subscription. `followingSince`
is stored before the notice is sent, so restarts resume following without repeating it, and following
ends after 24 hours with an "is still working" notice. Remote children and providers without the probe
report their first turn end as `finished`.
A turn end is not always a settled child. A child can end its turn with work that will start its next
turn by itself: a running turn, queued messages, a pending provider wake-up
(`AgentSession.hasPendingWakeup`: Claude background tasks, task notifications, and one-shot
wake-ups), or the child's own outstanding finish subscriptions as a caller. Heartbeats, recurring
crons, change-request watches, and other daemon background items never count: they are external
triggers, not work the caller is waiting for.
Every turn end reports `finished` at once. When work is still pending, the notice names it and the
subscription follows the child: each later turn end reports `finished` again, and the child settling
with nothing pending sends a final `finished` and removes the subscription, even when the work
drains without another turn. Reporting at once keeps a long-lived task, such as a dev server, from
leaving the caller without the child's reply. Following is what lets the caller hear the reply a
background task wakes up later ([#6346](https://github.com/getpaseo/paseo/issues/6346)). A work change
that leaves work pending sends nothing. Errors, permission requests, and closes report as they
happen. `followingSince` is stored when following starts, so a restart keeps following instead of
waiting for another turn end. After 24 hours of following, the caller gets a final `finished` with
the child's last reply and the subscription ends. Remote children and providers without the probe
report their first turn end as a settled `finished`.
Permission requests are notification checkpoints, not the end of that subscription. The caller is notified again after a permission response when the child finishes, errors, or requests another permission.
The permission notification includes the normalized request plus the child and request IDs, so the caller can inspect it and respond without fetching agent status.
+2 -11
View File
@@ -202,17 +202,8 @@ This is the Android counterpart of the iOS local-simulator flow in [development.
`modules/paseo-scroll` replaces React Native's vertical scroll view with `PaseoScrollView`, which
keeps React Native's scroll manager interface and corrects how the chat timeline holds its position.
[agent-stream-disclosure.md](agent-stream-disclosure.md#scroll-view-corrections) lists the
corrections and the React Native issues they work around.
The timeline's `nativeID` (`agent-chat-scroll-native-virtualized`) also identifies it to the native
scroll owner: a nested panel's edge overshoot and unconsumed fling must leave the timeline still.
Ordinary scroll parents retain Android's handoff. Keep that identity in sync with
`agent-stream/strategy-native.tsx`; the end pin is absent while reading history, so it cannot
identify the timeline for this rule.
Its instrumentation tests run the scroll view in a real window, mounting through React Native's own
mounting manager and injecting touches. `PanelEdgeTest` covers both panel edges, flings,
interior/direct scrolling, and ordinary-parent handoff:
corrections and the React Native issues they work around. Its instrumentation tests run the scroll
view in a real window, mounting through React Native's own mounting manager and injecting touches:
```bash
cd packages/app/android
+3 -2
View File
@@ -240,7 +240,8 @@ snapshot so a mixed edit can apply its live subset and still name the paths that
// `extends` (one of the built-ins or `"acp"`) and `label`. See `provider-launch-config.ts`.
providers: Record<providerId, ProviderOverride>,
metadataGeneration: {
providers: [{ provider, model?, thinkingOptionId? }]
providers: [{ provider, model?, thinkingOptionId? }],
instructions?: string
}
},
pluginsEnabled: boolean,
@@ -319,7 +320,7 @@ Paseo tools; otherwise the provider policy applies. Provider and global policy a
session is created, resumed, imported, or reloaded, so configuration changes affect the next
session rather than an already-running one.
`agents.metadataGeneration.providers` selects the models for daemon-side metadata tasks: commit messages, PR text, branch names, and generated titles. An empty list is Automatic; a non-empty list is Manual and only those models are tried. See [public-docs/metadata-generation.md](../public-docs/metadata-generation.md#how-a-model-is-chosen).
`agents.metadataGeneration.providers` selects the models for daemon-side metadata tasks: commit messages, PR text, branch names, and generated titles. An empty list is Automatic; a non-empty list is Manual and only those models are tried. `agents.metadataGeneration.instructions` adds host-wide guidance to every metadata generation prompt alongside the built-in or per-project style. See [public-docs/metadata-generation.md](../public-docs/metadata-generation.md#how-a-model-is-chosen).
### Git process limits
+1 -1
View File
@@ -177,7 +177,7 @@ Electron window controls are top-corner obstructions, not a compact-layout condi
Windows and Linux controls are fixed window chrome, outside scrolling header content. A tab rail that reaches them ends at their obstruction and shows the shared overflow fade. On macOS, the Explorer toggle occupies a fixed top-right window slot so opening and closing Explorer does not move the pointer target.
Each window edge has one safe-area owner. `WindowLayoutProvider` publishes the bottom inset that every surface reads through `useSafeAreaInsets()`: on iOS 27.1 and later it is UIKit's bottom-bar clearance, which refines the rectangular home-indicator inset to the screen's corners, and elsewhere the system inset. Surfaces apply that value once and never stack their own spacing under it; `WindowLayoutSurface` owns the horizontal insets the same way.
Each window edge has one safe-area owner. `WindowLayoutProvider` publishes the bottom inset that every surface reads through `useSafeAreaInsets()`: on iOS 27.1 and later it is UIKit's bottom-bar clearance, which refines the rectangular home-indicator inset to the screen's corners, and elsewhere the system inset. Surfaces apply that value once and never stack their own spacing under it; `WindowLayoutSurface` owns the horizontal insets the same way, and on wide web layouts it also owns the top inset: it pads the status bar of an iOS Home Screen web app once and gives its content a top inset of 0. Content inside the surface that draws against the window instead of the padded content reads the window's insets; see Gotcha 8 in `docs/floating-panels.md`.
A new list+detail feature copies the settings shell. A new workspace-shaped feature copies the workspace shell. Inventing a third shape happens in design review, not in a PR.
+16 -5
View File
@@ -459,10 +459,15 @@ Wrapping providers _around_ the modal does nothing. They land on the wrong side.
## Gotcha 8 — Read safe-area insets where the overlay draws
A compact sheet tab's body (`SheetBottomInset` in `adaptive-modal-sheet.tsx`) pads the bottom
inset and gives its content a bottom inset of 0, so the composer dock sits the same in a sheet as
in a tab. An overlay opened from that content and calling `useSafeAreaInsets()` at its call site
gets that 0 and draws over the navigation bar.
Two containers spend an inset and give their content 0 for that edge:
- A compact sheet tab's body (`SheetBottomInset` in `adaptive-modal-sheet.tsx`) pads the bottom
inset, so the composer dock sits the same in a sheet as in a tab.
- `WindowLayoutSurface` on a wide web layout pads the top inset, the status bar of an iOS Home
Screen web app (`docs/design.md`, section 9).
An overlay opened from that content and calling `useSafeAreaInsets()` at its call site gets that 0
and draws over the navigation bar or under the status bar. Read the inset where the overlay draws:
- A Gorhom sheet reads the inset inside its children, which render in the app's sheet host. See
`SheetVisibleFrame` (used by `CompactSheetBody` and `ComboboxSheetFrame`) and `MenuSheetScrollView`.
@@ -470,7 +475,13 @@ gets that 0 and draws over the navigation bar.
`WindowSafeArea` from `@/window-layout` and read the inset below that. It provides the insets of
the whole window, published by `WindowLayoutProvider`. Do not put a `SafeAreaProvider` inside the
modal: on Android it measures the dialog window, whose bottom inset reads 24, then 0, then 24
again over the first frames, and everything padded by it jumps. See `attachment-lightbox.tsx`.
again over the first frames, and everything padded by it jumps. See `attachment-lightbox.tsx`
and the Mermaid fullscreen viewer.
- A panel in a `FloatingPanelPortalHost` reads `useSafeAreaInsets()` inside the portal, where it
resolves at the host's position (Gotcha 2): the root host sits outside the layout surface and
gets the window's inset, a workspace host inside it gets 0. See the autocomplete `PopoverFrame`.
- An absolutely positioned view that covers the surface's padding, such as the overlay left
sidebar, reads the window's insets with `useWindowSafeAreaInsets()`.
## Recipe for a new anchored panel
+1 -3
View File
@@ -72,9 +72,7 @@ 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. 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, and `activeTurnBehavior: "queue"` waits for the running turn to end when the host advertises `server_info.features.nonAgentMessageQueue`.
Execution completion and arrival-specific output authority remain Hub responsibilities.
The older `hub.execution.*` RPCs remain accepted for existing clients. Their execution ownership
+3 -3
View File
@@ -95,9 +95,9 @@ A focused terminal excludes that binding. The source leaves terminal Escape alon
terminal Escape/Ctrl forwarding is a separate feature.
Terminal arrows never pass through the shortcut pipeline. The Android hardware
module claims them while the terminal's hidden input (`nativeID`) owns the focus.
`TextInput.onKeyPress` only sees IME keys, and an arrow that falls through moves
the hidden caret and desyncs the next text change, so the pipeline cannot own them.
module claims them while the terminal's native input (`nativeID`) owns the focus,
so Android DPAD focus search cannot move focus away from the terminal view, while
leaving active IME composition spans untouched for candidate navigation.
## Keys shared with text editing
+2
View File
@@ -12,6 +12,8 @@ Every block is separated by one gap, `density.blockGap`: 12 on compact layouts,
Workspace file links use the shared file-link resolver. The workspace supplies its client, root and open-file action once; chat can supply the agent's more specific context. URLs use the same link press path. Recognized inline-code paths stay tappable. The library callback carries the tapped occurrence’s syntax context. Preserve it when opening files: explicit Markdown links decode URL escapes, while recognized inline-code paths preserve literal percent characters and use suffix lookup. Identical URL strings in different occurrences must stay distinct. Explicit absolute workspace links receive a relative hover title; existing authored titles remain intact. Inside a workspace, forge references such as `#12` and `owner/repo#12` are recognized in prose (not code) and open the workspace forge; the reference pattern comes before path recognition so `group/project#12` is not read as a path. See [forge providers](forge-providers.md#gotchas).
Right-click on web and long press on native open one link menu per rendered part (`components/markdown/link-menu`), not one per link: a menu root cannot sit inside a paragraph without producing invalid markup on web. The native long-press event carries only the URL, with no position and no syntax context. The menu takes the position from the touch that started the press, and treats a URL that is no `](destination)` in the source as recognized text.
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).
+2
View File
@@ -63,6 +63,8 @@ An arbitrary Activity launch with data extras does not exercise Expo's FCM path.
Foreground pushes remain in Notification Center without a banner or sound.
This preserves notifications sent with stale presence information.
Native clients have no DOM events, so presence comes from `@/hooks/native-user-activity`: touches on the root `GestureHandlerRootView` and edits in the native `EditingTextInput` refresh `lastActivityAt`. Touches inside a native `Modal` open a separate window and do not reach the root.
## Startup and verification
Wait for the root navigator, host registry, remembered selection, and startup
+11
View File
@@ -103,6 +103,13 @@ The `worktree-include` built-in copies gitignored files selected by
[`.worktreeinclude`](../public-docs/worktrees.md#copy-local-files-with-worktreeinclude)
before setup and agents, through `worktree.create.after`.
The `cloudflared-tunnel` and `tailscale-funnel` built-ins register tunnel providers through
`server.registerTunnelProvider()`. Both start without installed binaries or credentials and report
availability through `status()`. `cloudflared-tunnel` runs quick tunnels only, with `--url` set to
the exposure target. Named Cloudflare tunnels are not supported: the Cloudflare dashboard sets
their routing, so their URL does not serve the exposure target. `tailscale-funnel` runs `tailscale funnel` in the foreground: with
`--bg`, tailscaled keeps the Funnel public after a crash with no owner.
Desktop packaging ships the entire built-in plugin directory as an external resource,
including declarations. The external esbuild compiler cannot read Electron's `app.asar`
filesystem, and packaging dependencies excludes `.d.ts` files needed for import validation.
@@ -972,6 +979,10 @@ reply text once, forks at its message, and shows its duration and stats. Read th
`getAssistantReply` (`packages/app/src/types/stream.ts`) instead of checking `kind ===
"assistant_message"`.
A provider-only fact about a tool call goes in the item's `metadata`, which transformers already
receive. Do not add a shared tool-call field for it. OMP's intent string is
[`metadata.intent`](../public-docs/plugins/reference.md#timeline-items).
Transformers run synchronously and must be deterministic. When several transformers match, the
first one that returns a result owns that source item. Plugin and registration ordering is stable.
See `plugin-examples/timeline-items` for the complete contract.
+1 -1
View File
@@ -21,7 +21,7 @@ The protocol package owns generation.
- `packages/protocol/src/validation/ws-outbound-envelope.ts` defines the tag-only envelope schema and exposes the session message schemas that get their own validators.
- `packages/protocol/scripts/generate-validation-aot.mjs` writes the zod-aot discovery entry and the runtime schema metadata, runs the exact-pinned compiler, and applies the small local compiler patches before generation. It also emits the `type` → validator map the boundary dispatches through.
- `packages/protocol/scripts/watch-validation-aot.mjs` reruns generation while editing protocol sources.
- `packages/protocol/codegen/generated/ws-outbound.compile.ts`, `packages/protocol/src/generated/validation/ws-outbound.aot.ts`, and `packages/protocol/src/generated/validation/ws-outbound-schema-metadata.ts` are generated and gitignored. The metadata module lets generated code reach schema fallback/default values.
- `packages/protocol/codegen/generated/ws-outbound.compile.ts`, `packages/protocol/src/generated/validation/ws-outbound.aot.ts`, `packages/protocol/src/generated/validation/ws-outbound-schema-metadata.ts`, and `packages/protocol/src/generated/validation/message-defaults.ts` are generated and gitignored. The metadata module lets generated code reach schema fallback/default values, and `message-defaults.ts` lets zero-Zod clients (`packages/protocol/src/validation/message-defaults.ts`) apply every schema `.default()` without loading Zod or `ws-outbound.aot.ts`.
Generation runs from protocol-owned lifecycle hooks: `prebuild`, `pretypecheck`, `pretest`, and `watch`. Installs do not run generation: published packages consume protocol from prebuilt `dist`, and local build/typecheck/test flows generate the source file at the point it is actually needed.
+3
View File
@@ -340,6 +340,9 @@ See the [public usage source reference](../public-docs/plugins/reference.md#usag
contract, account and window identity, provider-derived period names, login fallback, and
read-only credential rules. Usage adapters own the interpretation of provider fields; the app
renders their names and resolves pins without provider-specific duration guesses.
Claude's OAuth usage endpoint is undocumented. Extra-usage amounts are reported in minor currency
units and displayed only for USD; the balance contract does not represent other currencies.
Codex individual spending limits provide percentages, not dollar amounts.
---
+109 -71
View File
@@ -4,29 +4,41 @@ All workspaces share one version and release together.
## Two steps
A release has exactly two steps. The agent does the first, the user authorizes the second.
A release has two steps. The agent runs Preparation before approval, and the user authorizes Ship.
**Preparation** (reversible — agent does this on the release branch):
### Preparation
- resolve the [release base](#release-base-and-source) and get the [release inventory](#release-inventory) approved when one applies
- 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)
- run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
Preparation is reversible and runs on the release branch before the user authorizes shipping.
**Go-ahead** (user says "go ahead"):
1. Resolve the [release base](#release-base-and-source) and get the [release inventory](#release-inventory) approved when one applies.
2. Classify the diff from the previous stable release to the release source as patch or minor, then show the target version and rationale to the user.
3. Draft `CHANGELOG.md` and `CHANGELOG.zh-CN.md`, show the draft to the user, and wait for approval.
4. Run the [pre-release sanity check](#pre-release-sanity-check) for stable releases, and report any findings to the user.
5. Commit the approved changelog and any requested ACP update, then run `npm run format`, `npm run lint`, and `npm run typecheck`.
6. Run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag.
7. Push `release/vX.Y.Z` or `release/vX.Y.Z-beta.N` and wait for `CI` and `Desktop Packages` on that branch to pass (never wait on `main` CI).
8. Run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit.
- 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
- 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
### Ship
Ship starts after the user says "go ahead". All tag-triggered GitHub Actions workflows and EAS workflows build from the checked-out tag commit with local workspace packages, so none of them install `@getpaseo/*` from the public npm registry.
1. Run `npm run release:push` first to verify the clean release branch and push `vX.Y.Z` or `vX.Y.Z-beta.N`. Pushing the tag takes a few seconds and starts `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and (for stable tags) `Deploy App` on GitHub Actions, plus `Release Mobile` (stable) or `Release iOS Beta` (beta) on EAS. (`Deploy Website` runs later on the `release: published` event when `Desktop Release` publishes the stable GitHub Release.)
2. Run `npm run release:publish` (stable) or `npm run release:publish:beta` (beta) in parallel with the remote builds. `scripts/publish-release-packages.mjs` publishes the seven `@getpaseo/*` packages in dependency waves and polls npm visibility between packages to avoid `E409` or `E404` propagation races.
3. Open the [reconcile `main`](#reconcile-main) PR from `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N` right after `npm run release:push` finishes, so its CI run overlaps with npm publication and the release builds.
4. Create the release heartbeat immediately with `create_heartbeat` to track every ship step to completion.
### Sync gates
Wait until every gate below passes before deleting the remote release branch or reporting the release as shipped:
- All seven `@getpaseo/*` npm packages are visible on `latest` (stable) or `beta` (beta), and on stable the `beta` dist-tag points to the shipped version unless an active newer beta exists.
- All tag-triggered GitHub Actions workflows are green (`Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` for stable), and `Deploy Website` ran after stable publication.
- The GitHub Release is published and non-draft (marked prerelease for beta) with the synced changelog body, all macOS, Linux, and Windows assets, the Android APK asset, and all three channel manifests (`latest-mac.yml`, `latest-linux.yml`, `latest.yml` for stable; `beta-mac.yml`, `beta-linux.yml`, `beta.yml` for beta).
- The matching EAS workflow is green (`Release Mobile` with all six build, distribution, screenshot, and review-submission jobs for stable; `Release iOS Beta` for beta).
- The reconcile PR is merged into `main`.
Once all sync gates pass, 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.
Rules that apply to both steps:
@@ -110,18 +122,20 @@ An explicit user instruction can select another base.
runs on every merge. Wait for both runs on the release branch commit to pass before shipping.
Complete the [pre-release dependency checks](#pre-release-dependency-checks) on that commit.
Pushing a `release/**` branch without a `v*` tag triggers no publish workflows.
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.
6. After go-ahead, push the tag first with `npm run release:push` so remote builds start right away.
Because the release branch is already pushed at `HEAD`, no second branch CI run starts, and only
the tag release workflows run.
7. Immediately in parallel after `npm run release:push` finishes: publish npm packages with
`npm run release:publish` (stable) or `npm run release:publish:beta` (beta), start
[Reconcile `main`](#reconcile-main) so its PR checks overlap with desktop and EAS builds, and
create the release heartbeat. (`npm run release:ship` and `npm run release:ship:beta` also run
`release:push` before `release:publish`, so tag builds never wait behind npm.)
When promoting or branching from a tag created before `release:prep:*`, `release:ship`, and the
`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.
`release:push`, and `release:publish`) until the next tag carries the new tooling.
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
@@ -130,7 +144,7 @@ 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`, and complete the
[pre-release dependency checks](#pre-release-dependency-checks) before shipping with
`npm run release:ship:beta`.
`npm run release:push` and `npm run release:publish:beta` (or `npm run release:ship:beta`).
Record the tested beta tag as its source so its soak still counts for the unchanged content.
## Release inventory
@@ -159,8 +173,7 @@ 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`:
Right after `npm run release:push` pushes the tag (in parallel with npm publication and all desktop, APK, Docker, and EAS builds), open a PR into `main` from a fresh branch off `origin/main` named `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`. Reconcile reads only the tagged git commit, so it does not wait for npm or any release build:
```bash
git fetch origin --tags
@@ -180,10 +193,10 @@ hunks from the release base:
- 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`.
Commit, open the PR into `main`, and merge once its checks pass. Delete the remote release branch
(`git push origin --delete release/vX.Y.Z` or `release/vX.Y.Z-beta.N`) only after the reconcile PR
merges and every [sync gate](#sync-gates) passes. The tag is the record of shipped source, and
Paseo maintains no release track besides `main`.
## ACP catalog updates
@@ -240,24 +253,30 @@ npm run release:prep:minor
git push -u origin HEAD
# Complete the pre-release dependency checks on this commit.
# 3. After go-ahead and green release-branch checks: publish npm and push the tag.
npm run release:ship
# 3. After go-ahead and green release-branch checks: push the tag first to start builds.
npm run release:push
# 4. Run these in parallel immediately after step 3:
npm run release:publish
# Also open the reconcile/vX.Y.Z PR into main and create the release heartbeat.
# (`npm run release:ship` runs `release:push` before `release:publish` if used standalone.)
```
`release:ship` runs `scripts/publish-release-packages.mjs` and `scripts/push-current-release-tag.mjs`:
`scripts/push-current-release-tag.mjs` refuses non-`release/*` branches, checks that `HEAD` matches `origin/release/*`, tags `HEAD` with `vX.Y.Z`, and pushes the tag. Because `HEAD` is already on the pushed release branch, no second branch CI run starts.
- 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.
`scripts/publish-release-packages.mjs` publishes the seven `@getpaseo/*` packages in dependency-wave order:
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`.
1. Wave 1: `@getpaseo/highlight`, `@getpaseo/relay`, and `@getpaseo/protocol` (no `@getpaseo/*` dependencies).
2. Wave 2: `@getpaseo/client` (depends on `@getpaseo/protocol` and `@getpaseo/relay`).
3. Wave 3: `@getpaseo/plugin` (depends on `@getpaseo/client` and `@getpaseo/protocol`).
4. Wave 4: `@getpaseo/server` (depends on `@getpaseo/client`, `@getpaseo/highlight`, `@getpaseo/plugin`, `@getpaseo/protocol`, and `@getpaseo/relay`).
5. Wave 5: `@getpaseo/cli` (depends on `@getpaseo/client`, `@getpaseo/protocol`, and `@getpaseo/server`).
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.
After each `npm publish`, the script polls `npm view` (up to 12 checks, 5 seconds apart) until the published version is visible on npm before moving to the next package. Waiting for registry visibility prevents dependent publishes and manual retries from hitting `E409` conflicts or `E404` propagation lag. On stable releases, the script also 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).
The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` (`app.paseo.sh`, stable tags only) on GitHub Actions. `Desktop Release` and `Release Notes Sync` create the GitHub Release as a draft while builds and release-note sync run. `Deploy Website` triggers later on `release: published` when `Desktop Release` publishes the non-draft stable GitHub Release. EAS picks up the same tag through the EAS GitHub app and starts `Release Mobile` (iOS and Android store builds) in parallel, with no mobile-release workflow under `.github/workflows`. None of these workflows install `@getpaseo/*` from the public npm registry because all of them build from the checked-out tag commit and workspace packages.
Confirm that `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.
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`.
@@ -276,8 +295,10 @@ 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 and complete the pre-release dependency checks.
# After go-ahead:
npm run release:push # Create tag vX.Y.Z on HEAD and push (starts release builds)
# In parallel right after release:push:
npm run release:publish # Publish to npm (idempotent, with propagation + beta dist-tag sync)
npm run release:push # Create tag vX.Y.Z on HEAD and push (triggers release workflows)
# Open reconcile/vX.Y.Z PR into main and create the release heartbeat.
```
## Beta flow
@@ -294,15 +315,19 @@ npm run release:prep:beta:next # Cut X.Y.Z-beta.2, beta.3, ...
git push -u origin HEAD
# Complete the pre-release dependency checks on this commit.
# 3. After go-ahead:
npm run release:ship:beta
# 3. After go-ahead: push the tag first, then run npm publish, reconcile, and heartbeat in parallel:
npm run release:push
npm run release:publish:beta
# (Or run `npm run release:ship:beta` in one shell while opening reconcile/vX.Y.Z-beta.N.)
# Later, after soak, promote on release/vX.Y.Z:
npm run release:prep:promote
git push -u origin HEAD
# Wait for CI + Desktop Packages and complete the pre-release dependency checks.
# After go-ahead:
npm run release:ship
npm run release:push
npm run release:publish
# Open reconcile/vX.Y.Z PR into main and create the release heartbeat in parallel.
```
- Beta tags are published GitHub prereleases like `v0.1.41-beta.1`
@@ -489,7 +514,7 @@ macOS 13 maps to Darwin 22. The two values use different version domains; do not
iOS and Android store builds are not in `.github/workflows`. They are triggered by the EAS GitHub app the moment the `v*` tag is pushed:
- **Android (Play Store)** — EAS builds with profile `production` and auto-submits to the Play Store via `eas submit` (EAS-managed credentials). A Fastlane lane then replaces the store screenshots.
- **iOS (TestFlight + App Store)** — EAS builds with profile `production`, uploads once through a `testflight` job, distributes the build to the `Paseo Beta` external group with Beta App Review submission, and a Fastlane lane uploads the store screenshots and submits that same build for App Store review.
- **iOS (TestFlight + App Store)** — EAS builds with profile `production`, uploads once through a `testflight` job, distributes the build to the `Paseo Beta` external group with Beta App Review submission, and a Fastlane lane uploads the store screenshots and submits that same build for App Store review. When an earlier iOS version is already in Apple's review or release queue (`WAITING_FOR_REVIEW`, `IN_REVIEW`, `PENDING_APPLE_RELEASE`, `PENDING_DEVELOPER_RELEASE`, `PROCESSING_FOR_DISTRIBUTION`, `WAITING_FOR_EXPORT_COMPLIANCE`, or `ACCEPTED`), `submit_review` leaves it untouched, logs `IOS_REVIEW_SKIPPED` with the in-review version and the waiting TestFlight build, and exits `0` so `Release Mobile` stays green.
- **Android APK (GitHub Release asset)** — separate, via `.github/workflows/android-apk-release.yml`. This is the only Android-related workflow that lives in this repo.
EAS uses the local app version source. `packages/app/app.config.js` derives the native version from the package version. Android `versionCode` is `major * 1_000_000 + minor * 1_000 + patch`. iOS reserves 1,000 build slots per app version: beta `N` uses slot `N`, and stable uses slot `999`. For example, `0.2.6-beta.2` appears in App Store Connect as version `0.2.6` build `2006002`; stable uses build `2006999`. Rebuilding the same tag produces the same native build number; if a store has already accepted a binary and you need a different binary, cut the next beta or patch instead of relying on EAS remote auto-increment.
@@ -535,11 +560,22 @@ npx eas build:view <build-id>
# and submit_ios_for_review.
npx eas workflow:view <workflow-run-id> --json
# Read failed submit/review job logs.
# Read submit/review job logs (also check for IOS_REVIEW_SKIPPED on green runs).
npx eas workflow:logs <workflow-job-id> --all-steps --non-interactive
# Stream logs for a build.
npx eas build:view <build-id> --json | jq '.logFiles[]'
# Check live App Store Connect review state + top 5 recent iOS TestFlight builds.
npx eas workflow:run ios-review-status.yml
# Submit a waiting TestFlight build once the review slot is free (default replace_in_review=false skips if still active).
npx eas workflow:run resubmit-ios-review.yml
# Or force-replace an in-flight review for an urgent iOS hotfix:
npx eas workflow:run resubmit-ios-review.yml -F app_version=0.18.1 -F app_build_version=18001999 -F replace_in_review=true
# Cancel an active in-flight iOS App Store review (pass expected_version to guard against version drift).
npx eas workflow:run cancel-ios-review.yml -F expected_version=0.18.0
```
A build's `gitCommitHash` must match the release tag commit. `status` walks through `NEW` → `IN_QUEUE` → `IN_PROGRESS` → `FINISHED` (or `ERRORED`/`CANCELED`). The EAS workflow run's `gitCommitHash` and `trigger` must also match the release tag.
@@ -555,15 +591,14 @@ For the `Release Mobile` EAS workflow, these jobs must pass:
- `submit_android` — Android binary submitted to the Play Store
- `upload_android_screenshots` — Google Play screenshots replaced from the repo
Do not treat `build_ios: SUCCESS` or `distribute_ios: SUCCESS` as a completed iOS release. `submit_ios_for_review: FAILURE` means the iOS release is blocked even if the build is visible in TestFlight.
Do not treat `build_ios: SUCCESS` or `distribute_ios: SUCCESS` as a completed iOS release. `submit_ios_for_review: FAILURE` means the iOS release is blocked even if the build is visible in TestFlight. Even when `submit_ios_for_review` passes, inspect its log with `npx eas workflow:logs <workflow-job-id> --all-steps --non-interactive` for `IOS_REVIEW_SKIPPED`. If App Store submission was skipped because an earlier version is already in flight, explicitly notify the maintainer with both the in-review version/state and the waiting TestFlight version/build so they can either let the current review finish and run `npx eas workflow:run resubmit-ios-review.yml` later, or replace it with `replace_in_review=true`.
To confirm the submission landed, inspect the EAS workflow with `npx eas workflow:view <workflow-run-id> --json`. App Store Connect (review state for the matching version/build) and the Play Console track are the final ground truth.
## Release completion and heartbeat
A release is **in progress** after npm publication and tag push. Report it as
**shipped** only after every applicable build, publication, asset, manifest, and
store submission passes the completion checklist.
A release is in progress once the tag is pushed. Report it as shipped only after every applicable
[sync gate](#sync-gates) and completion checklist item passes.
Immediately after every beta, stable, or promotion tag push, create a heartbeat
that resumes the release in the current conversation. Create it automatically
@@ -572,9 +607,10 @@ 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,
`Release Notes Sync`, and `Deploy App` for stable), `Deploy Website` after stable release
publication, 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,
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).
@@ -597,7 +633,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; CI and Desktop Packages on release/vX.Y.Z; every tag-triggered GitHub Actions run (Desktop Release, Android APK Release, Docker, Release Notes Sync, and Deploy App on stable) plus Deploy Website after release publish; 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, submit_android, and upload_android_screenshots to succeed, and inspect the submit_ios_for_review log for IOS_REVIEW_SKIPPED (if skipped, explicitly report both the in-review version and the waiting TestFlight build to the maintainer). 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.",
}
```
@@ -622,6 +658,8 @@ The GitHub Release body is populated automatically by the `Release Notes Sync` w
**NEVER bump the version to fix a build problem.** New versions are reserved for meaningful product changes (features, fixes, improvements). Build/CI failures are fixed on the current version.
If `npm run release:publish` or `npm run release:publish:beta` fails after `npm run release:push` pushed the tag, fix the npm authentication, OTP, or local build issue and rerun the publish command on the same commit. Do not move or force-push the `v*` tag, because `scripts/publish-release-packages.mjs` skips packages already visible on npm and resumes from the remaining packages.
**Do not rely on `workflow_dispatch` for tagged code fixes.** The `workflow_dispatch` trigger runs the workflow file from the default branch but checks out the code at the tag ref (`ref: ${{ inputs.tag }}`). That means fixes committed to `main` won't change the tagged source tree being built. `workflow_dispatch` only helps when the fix lives in the workflow file itself.
For Docker-only retries, **do not push or force-push a `v*` release tag**.
@@ -706,9 +744,7 @@ intentionally unavailable to desktop updater clients.
- 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.
- `release:publish` and `release:publish:beta` run `scripts/publish-release-packages.mjs`. They publish the seven `@getpaseo/*` packages in dependency waves, skip versions already visible on npm, retry transient registry errors, and poll `npm view` between packages so dependents do not hit `E409` or `E404` propagation lag. `release:ship` and `release:ship:beta` run `release:push` before `release:publish` or `release:publish: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
@@ -969,8 +1005,8 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] 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)
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
- [ ] 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
- [ ] npm shows the version under the `beta` dist-tag, not `latest`
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run, while `npm run release:publish:beta`, the `reconcile/vX.Y.Z-beta.N` PR, and the release heartbeat started in parallel
- [ ] All seven `@getpaseo/*` npm packages show the version under the `beta` dist-tag, not `latest`
- [ ] The GitHub prerelease was published only after the three beta manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
- [ ] GitHub `Desktop Release` workflow for the `v*-beta.N` tag is green
- [ ] The GitHub prerelease contains `beta-mac.yml`, `beta-linux.yml`, and `beta.yml`
@@ -978,7 +1014,7 @@ 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` and merged before cleanup, and `origin/release/vX.Y.Z-beta.N` was deleted after all sync gates passed
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
### Stable release (or promotion)
@@ -988,13 +1024,13 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory)
- [ ] 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
- [ ] 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
- [ ] 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)
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
- [ ] 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
- [ ] `latest` resolves to the new stable, and `beta` resolves to it too unless an active newer beta holds `beta`
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z` tag without triggering a second CI run, while `npm run release:publish`, the `reconcile/vX.Y.Z` PR, and the release heartbeat started in parallel
- [ ] All seven `@getpaseo/*` npm packages show `latest` at the new stable, and `beta` at the new stable too unless an active newer beta holds `beta`
- [ ] The GitHub Release was published only after the three stable manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
- [ ] GitHub `Desktop Release` workflow for the `v*` tag is green
- [ ] The GitHub Release contains `latest-mac.yml`, `latest-linux.yml`, and `latest.yml`
@@ -1002,11 +1038,13 @@ Every entry covers `previous stable release → release source`: first beta, lat
- [ ] GitHub `Android APK Release` workflow for the same tag is green
- [ ] GitHub `Docker` workflow is green and both the versioned and `latest` images are published
- [ ] GitHub `Release Notes Sync` is green and the release body matches the stable changelog entry
- [ ] GitHub `Deploy App` workflow for the same tag is green, and `Deploy Website` succeeded after the release published
- [ ] EAS `Release Mobile` workflow for the same tag is green
- [ ] EAS iOS `build_ios` completes for the same tag
- [ ] EAS iOS `distribute_ios` succeeds, uploading the binary once, distributing it to `Paseo Beta`, and submitting it for Beta App Review
- [ ] EAS iOS `submit_ios_for_review` succeeds, putting the build into App Store review
- [ ] EAS iOS `submit_ios_for_review` succeeds, putting the build into App Store review (or its log was checked for `IOS_REVIEW_SKIPPED` and the maintainer was notified with both the in-review version and the waiting TestFlight build)
- [ ] 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
- [ ] EAS Android `upload_android_screenshots` succeeds for the same tag
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries, F-Droid changelogs, and version into `main` and merged before cleanup, and `origin/release/vX.Y.Z` was deleted after all sync gates passed
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
+1 -1
View File
@@ -30,7 +30,7 @@ Terminal directory snapshots (`terminalsChanged`) and workspace contribution cha
Each `onChange` delivers both the new snapshot and the `previous` one (`{ state, changedAt }`). The transition flows unchanged up through `TerminalSession.onActivityChange` (as `{ activity, previous }`), the worker protocol's `terminalActivityChange` event, and the manager-level `subscribeTerminalActivity(listener)` stream (`{ terminalId, name, cwd, activity, previous }`).
The daemon consumes these transitions, not snapshots. When a transition moves from `working` to `idle`, the tracker records finished attention, so the terminal shows the same green finished dot as an idle agent that needs review. The websocket layer also fires a "Terminal finished" attention notification. A terminal that exits while still working emits no turn-end notification.
The daemon consumes these transitions, not snapshots. When a transition moves from `working` to `idle`, the tracker records finished attention, so the terminal shows the same green finished dot as an idle agent that needs review. Focusing the terminal tab or using Mark as read on its owning workspace clears finished attention. Mark as read leaves needs-input attention alone, the same way it leaves an agent's pending permission. The websocket layer also fires a "Terminal finished" attention notification. A terminal that exits while still working emits no turn-end notification.
Terminal list visibility is `workspaceId`-scoped: a terminal belongs to the workspace that created it, and same-`cwd` sibling workspaces do not see it in their terminal lists. Terminal status routing starts from that owning workspace, uses the owning workspace's `cwd`, then fans the status bucket out to every active workspace with the same `cwd`.
+24 -8
View File
@@ -330,19 +330,35 @@ that starts or accepts them. Received messages retain sender attribution, while
notifications remain visible events. Collapse, timing and locally mounted history share
these boundaries.
Agent-message XML belongs to the daemon's `agent/agent-messages` boundary. Prompt delivery encodes
Agent-message markup belongs to the daemon's `agent/agent-messages` boundary. Prompt delivery encodes
provenance; acceptance, provider echoes, import, and replay share its projection. The delivery ID is
also the projected call ID, so a provider echo cannot create a second row. Sender IDs are opaque and
do not imply local ownership or authorization. Capture the sender title at delivery: archived or
removed senders must remain understandable without a live directory lookup.
The optional `agentMessage` payload carries event, sender, and delivered text. Shared client
presentation (`protocol/paseo-tool-presentation`) owns its heading and expanded details, next to the
labels for every Paseo MCP tool. The daemon
must not construct UI labels or prepend sender labels to the semantic message body. The existing
`tool_call` / `plain_text` envelope is a compatibility adapter: older clients still parse the row and
expand its body. New clients use the typed payload, never infer the event from a tool name or parse
XML. Stream reduction and disk-cache serialization preserve the payload without rendering it.
Each delivered message keeps its text first and ends with a `<paseo-message … length="N"/>` marker.
Text at character 0 stays the sender's, so a provider still reads a slash command there, and bodies
are never escaped. `length` bounds the text before the marker, so marker syntax inside a body cannot
split it, and a batch splits back into rows by reading markers from the end. A person's prompt gets a
marker only when it shares a provider turn with other deliveries or contains `<paseo-message` or
`<paseo-system`. Transcripts written before markers open with a `<paseo-system>` envelope; the
projection still reads those (`COMPAT(leadingPaseoSystemEnvelope)`).
The daemon decides whether a delivery is a message or a tool call, and clients render what it sends:
- A person's text is a `user_message`.
- A peer message is an `agent_message` tool call whose `agentMessage` carries sender and text. The
wire has no sender on `user_message`, so clients present it as a "Sent by" bubble.
- Lifecycle notifications (`agent_finished`, `agent_errored`, `agent_needs_permission`,
`agent_closed`), schedule fires (`heartbeat`), and change-request updates
are plain tool calls. `plain_text` detail carries the sender in `label`, the body in `text`, and
the icon. Clients render the heading from the tool name, so no notification event reaches them.
`isTimelineTurnTrigger` (`packages/protocol/src/timeline-turn.ts`) lists the delivered tool names that
start a turn. Add a name there when the daemon projects a new delivery. Rows that older daemons stored
with notification `agentMessage` metadata are rewritten to the plain call at presentation
(`COMPAT(agentNotificationMetadata)`). Stream reduction and disk-cache serialization preserve the
payload without rendering it.
The compatibility boundary for older daemons is snapshot normalization: running/idle status becomes an
anonymous active turn or idle state once, and downstream code consumes the same activity shape. The app
@@ -0,0 +1,4 @@
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,4 @@
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,4 @@
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,4 @@
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,8 @@
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
Fixed
- Fixed Android agent push notifications arriving minutes late during Doze
- Fixed Command Center results reordering mid-word while typing
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,8 @@
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
Fixed
- Fixed Android agent push notifications arriving minutes late during Doze
- Fixed Command Center results reordering mid-word while typing
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,8 @@
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
Fixed
- Fixed Android agent push notifications arriving minutes late during Doze
- Fixed Command Center results reordering mid-word while typing
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,8 @@
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
Fixed
- Fixed Android agent push notifications arriving minutes late during Doze
- Fixed Command Center results reordering mid-word while typing
Full notes: https://paseo.sh/changelog
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

+8 -2
View File
@@ -47,8 +47,14 @@
"ignore": ["android/**", "ios/**", ".expo/**", "dist/**", "scripts/reset-project.js"]
},
"packages/cli": {
"entry": ["src/index.ts", "bin/paseo", "src/**/*.test.{ts,tsx}", "tests/**/*.{ts,tsx}"],
"project": ["src/**/*.{ts,tsx}", "tests/**/*.{ts,tsx}"]
"entry": [
"src/index.ts",
"bin/paseo",
"scripts/**/*.mjs",
"src/**/*.test.{ts,tsx}",
"tests/**/*.{ts,tsx}"
],
"project": ["src/**/*.{ts,tsx}", "scripts/**/*.mjs", "tests/**/*.{ts,tsx}"]
},
"packages/relay": {
"entry": ["src/index.ts", "src/e2ee.ts", "src/cloudflare-adapter.ts", "src/**/*.test.ts"],
+4 -1
View File
@@ -128,6 +128,8 @@ buildNpmPackage {
cd packages/desktop
# The Nix output is not a distributable DMG, so leave it unsigned and
# disable the hardened runtime that requires a matching signature.
# Compiling the Icon Composer document needs Xcode, which the build
# does not have, so use the prebuilt icns.
CSC_IDENTITY_AUTO_DISCOVERY=false \
npm exec --offline -- electron-builder \
--config electron-builder.yml \
@@ -138,7 +140,8 @@ buildNpmPackage {
--config.buildVersion=${lib.escapeShellArg buildVersion} \
--config.mac.identity=null \
--config.mac.hardenedRuntime=false \
--config.mac.notarize=false
--config.mac.notarize=false \
--config.mac.icon=assets/icon.icns
)
''}
+1 -1
View File
@@ -1 +1 @@
sha256-kzMT9+KlfYhaEa643XUTzxOA4Y8+zdpdXEs2QguED7w=
sha256-aal9eR571blWuL7CZt1LR+KfA4QPJ0ivVl/GSTWy93o=
+29 -29
View File
@@ -1,12 +1,12 @@
{
"name": "paseo",
"version": "0.17.6",
"version": "0.18.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.17.6",
"version": "0.18.1",
"hasInstallScript": true,
"license": "Apache-2.0",
"workspaces": [
@@ -37541,7 +37541,7 @@
},
"packages/app": {
"name": "@getpaseo/app",
"version": "0.17.6",
"version": "0.18.1",
"dependencies": {
"@codemirror/commands": "6.10.4",
"@codemirror/language": "6.12.4",
@@ -39694,13 +39694,13 @@
},
"packages/cli": {
"name": "@getpaseo/cli",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.17.6",
"@getpaseo/protocol": "0.17.6",
"@getpaseo/server": "0.17.6",
"@getpaseo/client": "0.18.1",
"@getpaseo/protocol": "0.18.1",
"@getpaseo/server": "0.18.1",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
@@ -39947,11 +39947,11 @@
},
"packages/client": {
"name": "@getpaseo/client",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/protocol": "0.17.6",
"@getpaseo/relay": "0.17.6",
"@getpaseo/protocol": "0.18.1",
"@getpaseo/relay": "0.18.1",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
@@ -39963,7 +39963,7 @@
},
"packages/desktop": {
"name": "@getpaseo/desktop",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/cli": "*",
@@ -40206,7 +40206,7 @@
},
"packages/expo-two-way-audio": {
"name": "@getpaseo/expo-two-way-audio",
"version": "0.17.6",
"version": "0.18.1",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.14",
@@ -40252,7 +40252,7 @@
},
"packages/highlight": {
"name": "@getpaseo/highlight",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"@codemirror/language": "6.12.4",
@@ -40282,7 +40282,7 @@
},
"packages/plugin": {
"name": "@getpaseo/plugin",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^1.4.0",
@@ -40290,8 +40290,8 @@
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.17.6",
"@getpaseo/protocol": "0.17.6",
"@getpaseo/client": "0.18.1",
"@getpaseo/protocol": "0.18.1",
"@types/node": "^20.9.0",
"@types/react": "~19.2.0",
"react": "19.2.3",
@@ -40301,8 +40301,8 @@
"zod": "^4.4.3"
},
"peerDependencies": {
"@getpaseo/client": "0.17.6",
"@getpaseo/protocol": "0.17.6",
"@getpaseo/client": "0.18.1",
"@getpaseo/protocol": "0.18.1",
"react": ">=19.1.0 <20",
"react-native": ">=0.81.5",
"zod": "^4.4.3"
@@ -40324,7 +40324,7 @@
},
"packages/protocol": {
"name": "@getpaseo/protocol",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"semver": "^7.8.5",
@@ -40351,7 +40351,7 @@
}
},
"packages/react-native-enriched-markdown": {
"version": "0.17.6",
"version": "0.18.1",
"hasInstallScript": true,
"license": "MIT",
"peerDependencies": {
@@ -40367,7 +40367,7 @@
},
"packages/relay": {
"name": "@getpaseo/relay",
"version": "0.17.6",
"version": "0.18.1",
"license": "Apache-2.0",
"dependencies": {
"@noble/ciphers": "^2.4.0",
@@ -40589,17 +40589,17 @@
},
"packages/server": {
"name": "@getpaseo/server",
"version": "0.17.6",
"version": "0.18.1",
"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.6",
"@getpaseo/highlight": "0.17.6",
"@getpaseo/plugin": "0.17.6",
"@getpaseo/protocol": "0.17.6",
"@getpaseo/relay": "0.17.6",
"@getpaseo/client": "0.18.1",
"@getpaseo/highlight": "0.18.1",
"@getpaseo/plugin": "0.18.1",
"@getpaseo/protocol": "0.18.1",
"@getpaseo/relay": "0.18.1",
"@isaacs/ttlcache": "^2.1.4",
"@modelcontextprotocol/node": "2.1.2",
"@modelcontextprotocol/sdk": "1.29.0",
@@ -41550,7 +41550,7 @@
},
"packages/website": {
"name": "@getpaseo/website",
"version": "0.17.6",
"version": "0.18.1",
"dependencies": {
"@cloudflare/vite-plugin": "^1.29.1",
"@cloudflare/workers-types": "^4.20260317.1",
@@ -43161,7 +43161,7 @@
},
"plugins": {
"name": "@getpaseo/builtin-plugins",
"version": "0.17.6",
"version": "0.18.1",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.17.6",
"version": "0.18.1",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -124,8 +124,8 @@
"release:publish": "node scripts/publish-release-packages.mjs",
"release:publish:beta": "node scripts/publish-release-packages.mjs --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:ship": "npm run release:push && npm run release:publish",
"release:ship:beta": "npm run release:push && npm run release:publish:beta",
"release:reconcile": "node scripts/reconcile-release.mjs"
},
"devDependencies": {
@@ -0,0 +1,27 @@
name: Cancel iOS App Store review
# Cancel an active in-flight iOS App Store review submission on App Store
# Connect. Pass expected_version to abort safely if Apple has already moved on
# to a different version.
on:
workflow_dispatch:
inputs:
expected_version:
type: string
required: false
description: "Expected marketing version currently in review, e.g. 0.18.0. Fails without cancelling if the active submission is for a different version."
jobs:
cancel_ios_review:
name: Cancel iOS App Store review
environment: production
runs_on: macos-medium
steps:
- uses: eas/checkout
- name: Install fastlane
run: bundle install
- name: Cancel review
run: |
export EXPECTED_VERSION="${{ inputs.expected_version }}"
bundle exec fastlane ios cancel_review
@@ -0,0 +1,20 @@
name: Check iOS App Store review status
# Inspect live App Store Connect state for sh.paseo: the live App Store
# version, any active or pending App Store versions, active review submissions,
# and the five most recently uploaded iOS TestFlight builds.
on:
workflow_dispatch: {}
jobs:
check_ios_review_status:
name: Check iOS App Store review status
environment: production
runs_on: macos-medium
steps:
- uses: eas/checkout
- name: Install fastlane
run: bundle install
- name: Check review status
run: bundle exec fastlane ios review_status
@@ -69,4 +69,5 @@ jobs:
run: |
export APP_VERSION="${{ needs.build_ios.outputs.app_version }}"
export APP_BUILD_VERSION="${{ needs.build_ios.outputs.app_build_version }}"
export REPLACE_IN_REVIEW="false"
bundle exec fastlane ios submit_review
@@ -1,9 +1,11 @@
name: Resubmit iOS for App Store review
# Standalone re-trigger for the App Store review submission step. The iOS
# binary is already uploaded to TestFlight via the EAS GitHub app's tag-push
# build; this workflow just runs the fastlane submit_review lane against the
# latest TestFlight build, without rebuilding or re-uploading.
# Standalone trigger for the App Store review submission step. The iOS binary
# is already uploaded to TestFlight via the EAS GitHub app's tag-push build;
# this workflow runs fastlane ios submit_review without rebuilding or
# re-uploading. By default (replace_in_review=false) it skips cleanly if
# another App Store review is already in flight; pass replace_in_review=true
# to cancel an in-flight review and submit an urgent replacement.
on:
workflow_dispatch:
@@ -16,6 +18,11 @@ on:
type: string
required: false
description: "CFBundleVersion to resubmit, e.g. 2. Only used when app_version is set."
replace_in_review:
type: boolean
required: false
default: false
description: "Cancel an in-flight App Store review and submit this build instead. Leave false to skip safely while another review is active."
jobs:
submit_ios_for_review:
@@ -30,4 +37,5 @@ jobs:
run: |
export APP_VERSION="${{ inputs.app_version }}"
export APP_BUILD_VERSION="${{ inputs.app_build_version }}"
export REPLACE_IN_REVIEW="${{ inputs.replace_in_review }}"
bundle exec fastlane ios submit_review
+2
View File
@@ -2,6 +2,7 @@ const fs = require("node:fs");
const path = require("node:path");
const pkg = require("./package.json");
const withAndroidAsyncStorageSize = require("./plugins/with-android-async-storage-size");
const withAndroidIgnoreBoldText = require("./plugins/with-android-ignore-bold-text");
const withAndroidOptionalCamera = require("./plugins/with-android-optional-camera");
const withAndroidProfileable = require("./plugins/with-android-profileable");
const withFdroidAutolinking = require("./plugins/with-fdroid-autolinking");
@@ -148,6 +149,7 @@ export default {
withPasteInput,
withAndroidScroll,
withAndroidDisplayMetrics,
withAndroidIgnoreBoldText,
[withAndroidAsyncStorageSize, 64],
...buildProfile.cameraPlugins,
withAndroidOptionalCamera,
+89
View File
@@ -112,3 +112,92 @@ describe("hardware keyboard scene integration", () => {
expect(configureHardwareKeyboardAppDelegate(configured)).toBe(configured);
});
});
// Android Bold text bolds unstyled text at draw time after React Native measured it
// unbolded, which clips trailing words (#4057, #10152, #10850). The activity must opt out
// with a sparse Configuration() so other configuration fields still update live.
describe("Android Bold text opt-out", () => {
const {
configureIgnoreBoldTextMainActivity,
} = require("./plugins/with-android-ignore-bold-text.js");
const {
configureDisplayMetricsActivity,
} = require("./modules/paseo-display-metrics/app.plugin.js");
const mainActivity = [
"package sh.paseo",
"import expo.modules.splashscreen.SplashScreenManager",
"",
"import android.os.Build",
"import android.os.Bundle",
"",
"import com.facebook.react.ReactActivity",
"",
"class MainActivity : ReactActivity() {",
" override fun onCreate(savedInstanceState: Bundle?) {",
" super.onCreate(null)",
" }",
"}",
"",
].join("\n");
it("zeroes fontWeightAdjustment on a sparse Configuration before attaching and is idempotent", () => {
const configured = configureIgnoreBoldTextMainActivity(mainActivity);
expect(configured).toMatch(/^import android\.content\.Context$/m);
expect(configured).toMatch(/^import android\.content\.res\.Configuration$/m);
expect(configured).toContain("override fun attachBaseContext(newBase: Context)");
expect(configured).toContain("val override = Configuration()");
expect(configured).not.toContain("Configuration(configuration)");
expect(configured).toContain("override.fontWeightAdjustment = 0");
expect(configured).toContain(
"super.attachBaseContext(newBase.createConfigurationContext(override))",
);
expect(configured.indexOf("attachBaseContext")).toBeLessThan(configured.indexOf("onCreate"));
expect(configureIgnoreBoldTextMainActivity(configured)).toBe(configured);
});
it("composes cleanly with withAndroidDisplayMetrics in both plugin orders", () => {
const displayFirst = configureIgnoreBoldTextMainActivity(
configureDisplayMetricsActivity(mainActivity),
);
const boldFirst = configureDisplayMetricsActivity(
configureIgnoreBoldTextMainActivity(mainActivity),
);
for (const configured of [displayFirst, boldFirst]) {
expect(configured).toContain("override fun attachBaseContext(newBase: Context)");
expect(configured).toContain("val override = Configuration()");
expect(configured).toContain("override.fontWeightAdjustment = 0");
expect(configured).toContain("override fun onContentChanged()");
expect(configured).toContain(
"override fun onConfigurationChanged(newConfig: android.content.res.Configuration)",
);
expect(configured).toContain(
"sh.paseo.displaymetrics.PaseoDisplayMetrics.syncWithWindow(this)",
);
expect(configureIgnoreBoldTextMainActivity(configured)).toBe(configured);
expect(configureDisplayMetricsActivity(configured)).toBe(configured);
}
});
it("fails the prebuild when the MainActivity template changes shape", () => {
expect(() => configureIgnoreBoldTextMainActivity("package sh.paseo\n")).toThrow(
/MainActivity class declaration/,
);
});
it("fails the prebuild rather than duplicate an existing attachBaseContext override", () => {
const withExistingOverride = mainActivity.replace(
"override fun onCreate",
"override fun attachBaseContext(newBase: Context) { super.attachBaseContext(newBase) }\n\n override fun onCreate",
);
expect(() => configureIgnoreBoldTextMainActivity(withExistingOverride)).toThrow(
/existing attachBaseContext override/,
);
});
it("is registered in the app config", async () => {
const { exp } = await getPrebuildConfigAsync(__dirname, { platforms: ["android"] });
// Expo records function plugins by name.
expect(exp.plugins).toContain("withAndroidIgnoreBoldText");
}, 30_000);
});
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 43 KiB

@@ -1042,7 +1042,7 @@ test("changes context menu recursively collapses descendant folders", async ({ p
nestedLabel.boundingBox(),
]);
if (!rootBounds || !nestedBounds) throw new Error("Changes tree rows have no bounds");
expect(nestedBounds.x - rootBounds.x).toBe(12);
expect(nestedBounds.x - rootBounds.x).toBe(16);
await tree.getByTestId("diff-folder-src-toggle").click({ button: "right" });
await page.getByTestId("diff-folder-src-collapse-folder").click();
@@ -2,6 +2,7 @@ import type { Locator } from "@playwright/test";
import { test, expect, type Page } from "../support/fixtures";
import { gotoAppShell } from "../support/helpers/app";
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
import { getServerId } from "../support/helpers/server-id";
@@ -142,6 +143,38 @@ test.describe("Command center workspace management", () => {
}
});
test("keeps Rename workspace ahead of Rename agent across renam and rename", async ({ page }) => {
const workspace = await seedMockAgentWorkspace({
repoPrefix: "cc-rename-order-",
title: "Command center rename order",
model: "five-minute-stream",
});
try {
await openAgentRoute(page, workspace);
const panel = await openCommandCenter(page);
const searchInput = panel.getByTestId("command-center-input");
const renameWorkspace = action(panel, "Rename workspace");
const renameAgent = action(panel, "Rename agent");
for (const query of ["renam", "rename"]) {
await searchInput.fill(query);
await expect(renameWorkspace).toBeVisible({ timeout: 15_000 });
await expect(renameAgent).toBeVisible({ timeout: 15_000 });
const workspaceTop = (await renameWorkspace.boundingBox())?.y ?? Number.NaN;
const agentTop = (await renameAgent.boundingBox())?.y ?? Number.NaN;
expect(workspaceTop, query).toBeLessThan(agentTop);
}
await page.keyboard.press("Enter");
await expect(page.getByTestId("workspace-rename-modal-global-input")).toBeFocused({
timeout: 15_000,
});
} finally {
await workspace.cleanup();
}
});
test("copies the workspace path and confirms with a toast", async ({ page }) => {
const workspace = await seedWorkspace({ repoPrefix: "cc-copy-path-" });
@@ -3,6 +3,7 @@ import path from "node:path";
import { expect, test } from "../support/fixtures";
import { expectComposerVisible } from "../support/helpers/composer";
import { installDaemonWebSocketGate } from "../support/helpers/daemon-websocket-gate";
import { installLocalDesktopHost } from "../support/helpers/local-desktop-host";
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
import {
expectSubagentRowGone,
@@ -29,6 +30,89 @@ import {
const FILE_LINK = "linked.ts:3";
test("compact offers file actions from a link and from the file sheet", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
const workspace = await seedMockAgentWorkspace({
repoPrefix: "compact-file-actions-",
title: "File actions",
initialPrompt: promptMentioning(FILE_LINK),
});
try {
await writeFile(path.join(workspace.cwd, "linked.ts"), "one\ntwo\nthree\n", "utf8");
await openAgentRoute(page, { workspaceId: workspace.workspaceId, agentId: workspace.agentId });
const fileLink = page.getByText(FILE_LINK, { exact: true });
await expect(fileLink).toBeVisible({ timeout: 15_000 });
// Native opens the same sheet from a long press.
await fileLink.click({ button: "right" });
const linkMenu = page.getByTestId("markdown-link-menu-content");
await expect(linkMenu.getByRole("menuitem")).toHaveText([
"Open file",
"Reveal in Files",
"Download",
"Copy path",
"Copy relative path",
]);
await linkMenu.getByRole("menuitem", { name: "Open file" }).click();
await expect(sheet(page, "linked.ts")).toBeVisible();
await page.getByTestId("sheet-file-menu-trigger").click();
const sheetMenu = page.getByTestId("sheet-file-menu-content");
await expect(sheetMenu.getByRole("menuitem")).toHaveText([
"Reveal in Files",
"Download",
"Copy path",
"Copy relative path",
]);
await expect(sheetMenu.getByRole("menuitem").last()).toBeInViewport({ ratio: 1 });
await page.screenshot({
path: test.info().outputPath("compact-file-sheet-menu.png"),
animations: "disabled",
});
await sheetMenu.getByRole("menuitem", { name: "Reveal in Files" }).click();
await expectNoSheetOpen(page);
await expect(
page.locator('[data-testid^="file-explorer-row-"][aria-selected="true"]'),
).toContainText("linked.ts");
await page.screenshot({
path: test.info().outputPath("compact-reveal-in-files.png"),
animations: "disabled",
});
} finally {
await workspace.cleanup();
}
});
test("a narrow desktop window keeps the desktop actions in the file sheet menu", async ({
page,
}) => {
await page.setViewportSize({ width: 390, height: 844 });
const workspace = await seedMockAgentWorkspace({
repoPrefix: "narrow-desktop-file-actions-",
title: "File actions",
initialPrompt: promptMentioning(FILE_LINK),
});
try {
await writeFile(path.join(workspace.cwd, "linked.ts"), "one\ntwo\nthree\n", "utf8");
await installLocalDesktopHost(page, workspace.cwd, { fileManager: "Dolphin" });
await openAgentRoute(page, { workspaceId: workspace.workspaceId, agentId: workspace.agentId });
await page.getByText(FILE_LINK, { exact: true }).click();
await expect(sheet(page, "linked.ts")).toBeVisible({ timeout: 15_000 });
await page.getByTestId("sheet-file-menu-trigger").click();
await expect(page.getByTestId("sheet-file-menu-content").getByRole("menuitem")).toHaveText([
"Reveal in Files",
"Reveal in Dolphin",
"Open in default app",
"Download",
"Copy path",
"Copy relative path",
]);
} finally {
await workspace.cleanup();
}
});
test("compact opens files and subagents in a sheet, leaving the tabs for agents", async ({
page,
}) => {
@@ -12,14 +12,25 @@ import {
import { expectWorkspaceTabVisible, openSessions } from "../support/helpers/archive-tab";
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
import { getServerId } from "../support/helpers/server-id";
import { switchWorkspaceViaSidebar } from "../support/helpers/workspace-ui";
import {
switchWorkspaceViaSidebar,
waitForSidebarHydration,
} from "../support/helpers/workspace-ui";
import {
closeMobileAgentSidebar,
expectMobileAgentSidebarHidden,
expectMobileAgentSidebarVisible,
openMobileAgentSidebar,
} from "../support/helpers/sidebar";
import { expectNewWorkspaceProjectSelected } from "../support/helpers/new-workspace";
import {
expectNewWorkspaceProjectSelected,
openGlobalNewWorkspaceComposer,
openStartingRefPicker,
selectBranchInPicker,
selectWorkspaceIsolation,
} from "../support/helpers/new-workspace";
import { gotoAppShell } from "../support/helpers/app";
import { seedWorkspace } from "../support/helpers/seed-client";
const TEST_COMMANDS = [
{
@@ -119,11 +130,18 @@ const TEST_COMMANDS_REPLY: ListCommandsReply = { commands: TEST_COMMANDS, error:
async function installListCommandsStub(
page: Page,
reply: () => ListCommandsReply | Promise<ListCommandsReply> = () => TEST_COMMANDS_REPLY,
options?: {
onClientMessage?: (message: string | Buffer, forward: () => void) => void;
},
): Promise<void> {
await page.routeWebSocket(daemonWsRoutePattern(), (ws) => {
const server = ws.connectToServer();
ws.onMessage((message) => {
if (options?.onClientMessage) {
options.onClientMessage(message, () => server.send(message));
return;
}
server.send(message);
});
@@ -169,6 +187,24 @@ async function installListCommandsStub(
});
}
async function holdWorkspaceCreateWithCommandsStub(page: Page): Promise<{ release: () => void }> {
let release: (() => void) | null = null;
await installListCommandsStub(page, undefined, {
onClientMessage(message, forward) {
if (typeof message === "string" && message.includes('"workspace.create.request"')) {
release = forward;
return;
}
forward();
},
});
return {
release: () => {
release?.();
},
};
}
function createHeldReply(): {
reply: () => Promise<ListCommandsReply>;
release: () => void;
@@ -450,6 +486,44 @@ test.describe("Composer autocomplete", () => {
}
});
test("shows autocomplete after closing the New Workspace branch picker and hides it while submitting", async ({
page,
}) => {
const heldCreate = await holdWorkspaceCreateWithCommandsStub(page);
const seeded = await seedWorkspace({ repoPrefix: "autocomplete-branch-picker-" });
try {
await gotoAppShell(page);
await waitForSidebarHydration(page);
await openGlobalNewWorkspaceComposer(page);
const input = composerLocator(page);
await expect(input).toBeEditable({ timeout: 30_000 });
await selectWorkspaceIsolation(page, "worktree");
await expect(page.getByTestId("new-workspace-ref-picker-trigger")).toBeVisible({
timeout: 30_000,
});
await openStartingRefPicker(page);
await selectBranchInPicker(page, "main");
await expect(input).toBeFocused();
await page.keyboard.type("/h");
const popover = page.getByTestId("composer-autocomplete-popover");
await expect(popover.getByText("/help", { exact: true }).first()).toBeVisible({
timeout: 30_000,
});
// Submitting while locked hides the autocomplete popover instead of leaving it over loading.
await page.getByTestId("workspace-create-submit").click();
await expect(input).not.toBeEditable({ timeout: 10_000 });
await expect(popover).toHaveCount(0);
} finally {
heldCreate.release();
await seeded.cleanup();
}
});
test("keeps New workspace off the running-agent command list before a project is chosen", async ({
page,
}) => {
@@ -0,0 +1,143 @@
import { mkdir, writeFile } from "node:fs/promises";
import path from "node:path";
import { expect, type Page } from "@playwright/test";
import { test } from "../support/fixtures";
import {
expectExplorerEntryHidden,
expectExplorerEntryVisible,
expandFolder,
expectFileTabOpen,
openFileExplorer,
} from "../support/helpers/file-explorer";
import { gotoWorkspace } from "../support/helpers/launcher";
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
let workspace: SeededWorkspace;
test.beforeEach(async () => {
workspace = await seedWorkspace({ repoPrefix: "file-explorer-filter-" });
await mkdir(path.join(workspace.repoPath, "data/nested"), { recursive: true });
await writeFile(path.join(workspace.repoPath, "data/nested/report.csv"), "name,total\n");
await mkdir(path.join(workspace.repoPath, "docs"), { recursive: true });
await writeFile(path.join(workspace.repoPath, "docs/guide.md"), "# Guide\n");
});
test.afterEach(async () => {
await workspace?.cleanup();
});
function filterInput(page: Page) {
return page.getByTestId("files-filter-input");
}
function matches(page: Page) {
return page.locator('[data-testid^="file-filter-row-"][aria-selected]');
}
function match(page: Page, name: string) {
return matches(page).filter({ hasText: name });
}
test("finds files in collapsed folders and acts on them", async ({ page }) => {
await gotoWorkspace(page, workspace.workspaceId);
await openFileExplorer(page);
await expandFolder(page, "docs");
await expectExplorerEntryVisible(page, "guide.md");
await filterInput(page).fill("report");
await expect(matches(page)).toHaveCount(1);
await expect(match(page, "report.csv")).toContainText("data/nested");
// Draggable onto the chat, like a tree row.
await expect(match(page, "report.csv").locator('[draggable="true"]')).toHaveCount(1);
await match(page, "report.csv").click({ button: "right" });
const menu = page.getByTestId(/file-filter-row-\d+-context-menu$/);
for (const name of [
"Reveal in Files",
"Copy path",
"Copy relative path",
"Download",
"Rename",
"Delete",
]) {
await expect(menu.getByRole("menuitem", { name, exact: true })).toBeVisible();
}
await expect(menu.getByRole("menuitem", { name: "New file", exact: true })).toHaveCount(0);
await page.keyboard.press("Escape");
await expect(menu).toHaveCount(0);
await match(page, "report.csv").click();
await expectFileTabOpen(page, "data/nested/report.csv");
// Escape restores the tree with its expanded folders.
await filterInput(page).press("Escape");
await expect(filterInput(page)).toHaveValue("");
await expectExplorerEntryVisible(page, "guide.md");
await expectExplorerEntryHidden(page, "report.csv");
// So does the clear button.
await filterInput(page).fill("zzz-no-such-file");
await expect(page.getByText("No matching files", { exact: true })).toBeVisible();
await page.getByTestId("files-filter-clear").click();
await expect(filterInput(page)).toHaveValue("");
await expectExplorerEntryVisible(page, "guide.md");
// Revealing a match leaves the filter and selects the file in the tree.
await filterInput(page).fill("report");
await match(page, "report.csv").click({ button: "right" });
await page.getByRole("menuitem", { name: "Reveal in Files", exact: true }).click();
await expect(filterInput(page)).toHaveValue("");
await expect(
page.locator('[data-testid^="file-explorer-row-"][aria-selected="true"]'),
).toContainText("report.csv");
});
/** The directory listings the app asks the host for, by path. */
function recordDirectoryListings(page: Page): string[] {
const listed: string[] = [];
page.on("websocket", (socket) => {
socket.on("framesent", ({ payload }) => {
if (typeof payload !== "string") return;
const { message } = JSON.parse(payload);
if (message?.type === "file_explorer_request" && message.mode === "list") {
listed.push(message.path);
}
});
});
return listed;
}
test("opens a matching folder in the tree", async ({ page }) => {
const listed = recordDirectoryListings(page);
await gotoWorkspace(page, workspace.workspaceId);
await openFileExplorer(page);
await filterInput(page).fill("nested");
await match(page, "nested").first().click();
await expect(filterInput(page)).toHaveValue("");
await expectExplorerEntryVisible(page, "report.csv");
await expect(
page.locator('[data-testid^="file-explorer-row-"][aria-selected="true"]'),
).toContainText("nested");
// One walk down to the folder: its collapsed parent is listed once.
expect(listed.filter((directory) => directory === "data")).toEqual(["data"]);
});
test("renames and deletes a match without leaving the filter", async ({ page }) => {
await gotoWorkspace(page, workspace.workspaceId);
await openFileExplorer(page);
await filterInput(page).fill("guide");
await match(page, "guide.md").click({ button: "right" });
await page.getByRole("menuitem", { name: "Rename", exact: true }).click();
const nameInput = page.getByTestId("file-explorer-name-input");
await nameInput.fill("guide-v2.md");
await nameInput.press("Enter");
await expect(match(page, "guide-v2.md")).toBeVisible();
page.once("dialog", (dialog) => void dialog.accept());
await match(page, "guide-v2.md").click({ button: "right" });
await page.getByRole("menuitem", { name: "Delete", exact: true }).click();
await expect(page.getByText("No matching files", { exact: true })).toBeVisible();
});
@@ -0,0 +1,135 @@
import { mkdir, writeFile } from "node:fs/promises";
import path from "node:path";
import { expect, test, type Page } from "../support/fixtures";
import { commandCenterSection, openCommandCenter } from "../support/helpers/command-center";
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
const REPLY = [
"Read [the report](data/report.csv), the [settings](.config/nested/file-55.json),",
"the [data folder](data) or the [website](https://example.test/docs).",
"Nothing is at gone.md.",
].join(" ");
async function seedLinkedFiles() {
const agent = await seedMockAgentWorkspace({
repoPrefix: "file-link-menu-",
title: "File link actions",
initialPrompt: "Show the links",
featureValues: { mockAssistantResponse: REPLY },
});
await mkdir(path.join(agent.cwd, "data"), { recursive: true });
await writeFile(path.join(agent.cwd, "data/report.csv"), "name,total\nalpha,1\n");
await mkdir(path.join(agent.cwd, ".config/nested"), { recursive: true });
// Enough siblings that the target row starts outside the tree's viewport.
await Promise.all(
Array.from({ length: 60 }, (_, index) =>
writeFile(
path.join(agent.cwd, `.config/nested/file-${String(index).padStart(2, "0")}.json`),
"{}\n",
),
),
);
await agent.client.waitForFinish(agent.agentId, 30_000);
return agent;
}
function replyLink(page: Page, name: string) {
return page.getByTestId("assistant-message").getByRole("link", { name, exact: true });
}
function linkMenu(page: Page) {
return page.getByTestId("markdown-link-menu");
}
function selectedTreeRow(page: Page) {
return page.locator('[data-testid^="file-explorer-row-"][aria-selected="true"]');
}
async function expectMenuItems(page: Page, names: string[]) {
await expect(linkMenu(page).getByRole("menuitem")).toHaveText(names);
}
async function dismissMenu(page: Page) {
await page.keyboard.press("Escape");
await expect(linkMenu(page)).toHaveCount(0);
}
async function screenshot(page: Page, name: string) {
await page.screenshot({
path: test.info().outputPath(`${name}.png`),
animations: "disabled",
});
}
test("links in chat and file tabs offer file actions and reveal the file in Files", async ({
page,
}, testInfo) => {
testInfo.setTimeout(180_000);
const agent = await seedLinkedFiles();
try {
await page.addInitScript(() => {
localStorage.setItem(
"panel-state",
JSON.stringify({ state: { explorerShowHiddenFiles: false }, version: 0 }),
);
});
await openAgentRoute(page, agent);
await replyLink(page, "the report").click({ button: "right" });
await expectMenuItems(page, [
"Open file",
"Open to the side",
"Reveal in Files",
"Download",
"Copy path",
"Copy relative path",
]);
await screenshot(page, "chat-file-link-menu");
await dismissMenu(page);
await replyLink(page, "data folder").click({ button: "right" });
await expectMenuItems(page, ["Reveal in Files", "Copy path", "Copy relative path"]);
await dismissMenu(page);
await replyLink(page, "website").click({ button: "right" });
await expectMenuItems(page, ["Open in default browser", "Copy link"]);
await screenshot(page, "chat-web-link-menu");
await dismissMenu(page);
// A bare name is looked up while the menu is open; acting on one that matches nothing says so.
await replyLink(page, "gone.md").click({ button: "right" });
await linkMenu(page).getByRole("menuitem", { name: "Download" }).click();
await expect(page.getByTestId("assistant-file-link-not-found-toast")).toContainText("gone.md");
await replyLink(page, "the report").click({ button: "right" });
await linkMenu(page).getByRole("menuitem", { name: "Reveal in Files" }).click();
await expect(selectedTreeRow(page)).toContainText("report.csv");
await expect(replyLink(page, "the report")).toBeVisible();
await screenshot(page, "reveal-in-files-from-chat-link");
// A hidden folder, a freshly expanded tree and a row far below the fold.
await replyLink(page, "settings").click();
const fileTab = page.getByTestId("workspace-tab-file_.config/nested/file-55.json").first();
await expect(fileTab).toBeVisible();
await fileTab.click({ button: "right" });
const tabMenu = page.getByTestId("workspace-tab-context-file_.config/nested/file-55.json");
await expect(tabMenu.getByRole("menuitem", { name: "Reveal in Files" })).toBeVisible();
await expect(tabMenu.getByRole("menuitem", { name: "Copy relative path" })).toBeVisible();
await screenshot(page, "file-tab-menu");
await tabMenu.getByRole("menuitem", { name: "Reveal in Files" }).click();
await expect(selectedTreeRow(page)).toContainText("file-55.json");
await expect(selectedTreeRow(page)).toBeInViewport();
await screenshot(page, "reveal-in-files-from-file-tab");
// The tree is already mounted and scrolled elsewhere. Command Center reveals the active tab.
await page.getByTestId("file-explorer-tree-scroll").hover();
await page.mouse.wheel(0, -100_000);
await expect(selectedTreeRow(page)).not.toBeInViewport();
const commandCenter = await openCommandCenter(page);
await commandCenter.getByTestId("command-center-input").fill("Reveal in Files");
await commandCenterSection(commandCenter, "Reveal in Files").click();
await expect(selectedTreeRow(page)).toBeInViewport();
} finally {
await agent.cleanup();
}
});
@@ -111,3 +111,102 @@ test("replaces only the first configured metadata model", async ({ page }) => {
}
}
});
test("saves and clears host-wide metadata instructions without overwriting providers", async ({
page,
}, testInfo) => {
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
const previousConfig = await client.getDaemonConfig();
try {
await client.patchDaemonConfig({
metadataGeneration: {
providers: [{ provider: "mock", model: "ten-second-stream" }],
instructions: "",
},
});
await openMetadataGenerationSettings(page);
const instructionsRow = page.getByTestId("metadata-generation-instructions-row");
await expect(instructionsRow).toBeVisible();
await page.screenshot({
path: testInfo.outputPath("metadata-instructions-tucked-empty.png"),
fullPage: true,
});
await instructionsRow.click();
const instructionsSheet = page.getByTestId("metadata-generation-instructions-sheet");
const instructionsInput = page.getByTestId("metadata-generation-instructions-input");
const saveButton = page.getByTestId("metadata-generation-instructions-save");
await expect(instructionsSheet).toBeVisible();
await expect(saveButton).toBeDisabled();
await page.screenshot({
path: testInfo.outputPath("metadata-instructions-sheet-empty.png"),
fullPage: true,
animations: "disabled",
});
await instructionsInput.fill("Write in Simplified Chinese. Do not use em dashes.");
await expect(saveButton).toBeEnabled();
await saveButton.click();
await expect(instructionsSheet).toHaveCount(0);
await expect
.poll(async () => (await client.getDaemonConfig()).config.metadataGeneration)
.toEqual({
providers: [{ provider: "mock", model: "ten-second-stream" }],
instructions: "Write in Simplified Chinese. Do not use em dashes.",
});
await page.reload();
await expect(
page
.getByTestId("metadata-generation-instructions-row")
.getByText("Write in Simplified Chinese. Do not use em dashes."),
).toBeVisible();
await page.screenshot({
path: testInfo.outputPath("metadata-instructions-tucked-saved.png"),
fullPage: true,
});
// Verify compact layout keeps the tucked row and bottom sheet clean.
await page.setViewportSize({ width: 390, height: 844 });
await expect(page.getByTestId("metadata-generation-instructions-row")).toBeVisible();
await page.screenshot({
path: testInfo.outputPath("metadata-instructions-compact-row.png"),
fullPage: true,
});
await page.getByTestId("metadata-generation-instructions-row").click();
await expect(page.getByTestId("metadata-generation-instructions-input")).toHaveValue(
"Write in Simplified Chinese. Do not use em dashes.",
);
await page.screenshot({
path: testInfo.outputPath("metadata-instructions-compact-sheet.png"),
fullPage: true,
});
await page.getByTestId("metadata-generation-instructions-input").fill("");
await expect(page.getByTestId("metadata-generation-instructions-save")).toBeEnabled();
await page.getByTestId("metadata-generation-instructions-save").click();
await expect(page.getByTestId("metadata-generation-instructions-sheet")).toHaveCount(0);
await expect
.poll(async () => (await client.getDaemonConfig()).config.metadataGeneration)
.toEqual({
providers: [{ provider: "mock", model: "ten-second-stream" }],
});
} finally {
try {
await client.patchDaemonConfig({
metadataGeneration: {
providers: previousConfig.config.metadataGeneration.providers,
instructions: previousConfig.config.metadataGeneration.instructions ?? "",
},
});
} finally {
await client.close().catch(() => undefined);
}
}
});
@@ -6,6 +6,7 @@ import {
openStartingRefPicker,
selectBranchInPicker,
selectWorkspaceIsolation,
watchBrowserBranchSuggestions,
} from "../support/helpers/new-workspace";
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
import { getServerId } from "../support/helpers/server-id";
@@ -16,6 +17,21 @@ const LONG_HOST_NAME =
"development-macbook-pro.local-connected-through-a-very-long-private-hostname";
const LONG_BRANCH_NAME =
"feat/app/add-amoled-theme-with-a-very-long-pull-request-and-branch-description";
const MANY_BRANCHES = Array.from(
{ length: 12 },
(_, index) => `feat/branch-${String(index + 1).padStart(2, "0")}`,
);
interface PopoverFrameSample {
t: number;
opacity: number;
top: number;
left: number;
width: number;
height: number;
rowCount: number;
mainTop: number | null;
}
function measureControlRightEdges(controls: HTMLElement[]) {
const measurements: Array<{ label: string | null; right: number }> = [];
@@ -26,13 +42,69 @@ function measureControlRightEdges(controls: HTMLElement[]) {
return measurements;
}
async function startPopoverFrameSampler(page: import("@playwright/test").Page): Promise<void> {
await page.evaluate(() => {
const win = window as unknown as {
__popoverFrames?: PopoverFrameSample[];
__popoverSamplerStop?: () => void;
};
const samples: PopoverFrameSample[] = [];
const start = performance.now();
let stopped = false;
let rafId = 0;
const tick = () => {
if (stopped) return;
const el = document.querySelector<HTMLElement>('[data-testid="combobox-desktop-container"]');
if (el) {
const style = getComputedStyle(el);
const opacity = Number.parseFloat(style.opacity || "1");
const rect = el.getBoundingClientRect();
const rows = el.querySelectorAll("[data-combobox-option-index]");
const mainEl = el.querySelector<HTMLElement>(
'[data-testid="new-workspace-ref-picker-branch-main"]',
);
samples.push({
t: Math.round(performance.now() - start),
opacity,
top: Math.round(rect.top),
left: Math.round(rect.left),
width: Math.round(rect.width),
height: Math.round(rect.height),
rowCount: rows.length,
mainTop: mainEl ? Math.round(mainEl.getBoundingClientRect().top) : null,
});
}
rafId = requestAnimationFrame(tick);
};
rafId = requestAnimationFrame(tick);
win.__popoverFrames = samples;
win.__popoverSamplerStop = () => {
stopped = true;
cancelAnimationFrame(rafId);
};
});
}
async function stopPopoverFrameSampler(
page: import("@playwright/test").Page,
): Promise<PopoverFrameSample[]> {
return page.evaluate(() => {
const win = window as unknown as {
__popoverFrames?: PopoverFrameSample[];
__popoverSamplerStop?: () => void;
};
win.__popoverSamplerStop?.();
return win.__popoverFrames ?? [];
});
}
test.describe("New workspace metadata row layout", () => {
let workspace: SeededWorkspace;
test.beforeEach(async () => {
workspace = await seedWorkspace({
repoPrefix: "new-workspace-layout-",
repo: { branches: [LONG_BRANCH_NAME] },
repo: { branches: [LONG_BRANCH_NAME, ...MANY_BRANCHES] },
});
});
@@ -84,4 +156,110 @@ test.describe("New workspace metadata row layout", () => {
).toBeLessThanOrEqual(composerRightRail + 1);
}
});
test("starting ref popover holds height and row positions on a cold first open", async ({
page,
}) => {
await page.setViewportSize({ width: 1280, height: 900 });
const branchWatch = await watchBrowserBranchSuggestions(page, { hold: true });
await gotoAppShell(page);
await waitForSidebarHydration(page);
await openNewWorkspaceComposer(page, {
projectKey: workspace.projectKey,
projectDisplayName: workspace.projectDisplayName,
});
await selectWorkspaceIsolation(page, "worktree");
await startPopoverFrameSampler(page);
await openStartingRefPicker(page);
const popover = page.getByTestId("combobox-desktop-container");
await expect(popover).toBeVisible({ timeout: 10_000 });
await branchWatch.waitForResponse();
// Give the loading state several frames to paint before releasing the branch list.
await page.waitForTimeout(120);
const loadingBox = await popover.boundingBox();
expect(loadingBox).not.toBeNull();
branchWatch.release();
await expect(page.getByTestId("new-workspace-ref-picker-branch-feat/branch-12")).toBeVisible({
timeout: 10_000,
});
await page.waitForTimeout(80);
const settledBox = await popover.boundingBox();
expect(settledBox).not.toBeNull();
const samples = await stopPopoverFrameSampler(page);
const visibleSamples = samples.filter((s) => s.opacity > 0.9);
expect(visibleSamples.length).toBeGreaterThan(0);
const heights = visibleSamples.map((s) => s.height);
const tops = visibleSamples.map((s) => s.top);
const mainTops = visibleSamples
.map((s) => s.mainTop)
.filter((value): value is number => value !== null);
expect(
Math.max(...heights) - Math.min(...heights),
`popover height shifted across visible frames: ${JSON.stringify(visibleSamples)}`,
).toBeLessThanOrEqual(1);
expect(
Math.max(...tops) - Math.min(...tops),
`popover top shifted across visible frames: ${JSON.stringify(visibleSamples)}`,
).toBeLessThanOrEqual(1);
expect(
mainTops.length > 0 ? Math.max(...mainTops) - Math.min(...mainTops) : 0,
`main row jumped vertically across visible frames: ${JSON.stringify(visibleSamples)}`,
).toBeLessThanOrEqual(1);
// Switching to Pull requests keeps the same frame height.
await page.getByTestId("new-workspace-ref-picker-tab-pull-requests").click();
await page.waitForTimeout(80);
const prBox = await popover.boundingBox();
expect(prBox).not.toBeNull();
expect(Math.abs(prBox!.height - settledBox!.height)).toBeLessThanOrEqual(1);
});
test("starting ref popover prefetches branches before the first click and clamps to short viewports", async ({
page,
}) => {
await page.setViewportSize({ width: 1280, height: 900 });
const branchWatch = await watchBrowserBranchSuggestions(page, { hold: false });
await gotoAppShell(page);
await waitForSidebarHydration(page);
await openNewWorkspaceComposer(page, {
projectKey: workspace.projectKey,
projectDisplayName: workspace.projectDisplayName,
});
await selectWorkspaceIsolation(page, "worktree");
// Branches must prefetch before the user ever clicks the trigger.
await branchWatch.waitForResponse();
await page.waitForTimeout(100);
await startPopoverFrameSampler(page);
await openStartingRefPicker(page);
await expect(page.getByTestId("new-workspace-ref-picker-branch-feat/branch-12")).toBeVisible({
timeout: 10_000,
});
await page.waitForTimeout(80);
const samples = await stopPopoverFrameSampler(page);
const firstVisible = samples.find((s) => s.opacity > 0.9);
expect(firstVisible).toBeDefined();
expect(firstVisible!.rowCount).toBeGreaterThan(5);
// Close and verify short viewport clamping keeps the popover inside the window.
await page.keyboard.press("Escape");
await page.setViewportSize({ width: 1280, height: 500 });
await openStartingRefPicker(page);
const popover = page.getByTestId("combobox-desktop-container");
await expect(popover).toBeVisible({ timeout: 10_000 });
await page.waitForTimeout(100);
const shortBox = await popover.boundingBox();
expect(shortBox).not.toBeNull();
expect(shortBox!.y + shortBox!.height).toBeLessThanOrEqual(500);
});
});
@@ -13,11 +13,17 @@ import { pluginRequirements } from "../support/helpers/plugin-fixture";
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import type { Locator } from "@playwright/test";
import { expect, test, type Page } from "../support/fixtures";
import { gotoAppShell } from "../support/helpers/app";
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
const PLUGIN_ID = "plugin-host-ui-e2e";
const TINY_PNG = Buffer.from(
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==",
"base64",
);
const PLUGIN_SOURCE = `import { usePaseo } from "@getpaseo/plugin/client";
import { Icon, Modal, useToast, Markdown } from "@getpaseo/plugin/client/ui";
@@ -39,6 +45,7 @@ function ModalBody({ onSaved }) {
<Text>Plugin modal contexts ready</Text>
<Markdown>{"## Plugin report"}</Markdown>
<Markdown>{"Checks **passed**. [Documentation](https://paseo.sh/docs/plugins)"}</Markdown>
<Markdown>{"![Modal preview](" + SCREENSHOT_PATH + ")"}</Markdown>
<Markdown>{""}</Markdown>
<Pressable accessibilityRole="button" onPress={save}>
<Text>Save issue</Text>
@@ -56,6 +63,7 @@ function Surface({ playAudio }) {
const [open, setOpen] = useState(false);
return <View>
<Text>{audioStatus}</Text>
<Markdown>{"![Before](" + SCREENSHOT_PATH + ")\\n\\n![After](" + SCREENSHOT_FILE_URL + ")"}</Markdown>
<Pressable accessibilityRole="button" onPress={() => play(AUDIO_BASE64)}><Text>Play plugin audio</Text></Pressable>
<Pressable accessibilityRole="button" onPress={() => play("UklGRg==")}><Text>Play invalid audio</Text></Pressable>
<Pressable accessibilityRole="button" onPress={() => setOpen(true)}>
@@ -105,20 +113,39 @@ async function openPluginModal(page: Page): Promise<void> {
await page.getByRole("button", { name: "Open plugin modal", exact: true }).click();
}
async function expectPluginMarkdown(page: Page): Promise<void> {
await expect(page.getByRole("heading", { name: "Plugin report" })).toBeVisible();
await expect(page.getByText("Checks passed.", { exact: false })).toBeVisible();
await expect(page.getByRole("link", { name: "Documentation", exact: true })).toHaveAttribute(
async function expectLoadedMarkdownImage(scope: Page | Locator, alt: string): Promise<void> {
const image = scope.getByAltText(alt, { exact: true });
await expect(image).toBeVisible();
await expect
.poll(() =>
image.evaluate((node) => {
const img = node as HTMLImageElement;
return {
isBlob: img.src.startsWith("blob:"),
complete: img.complete,
naturalWidth: img.naturalWidth,
};
}),
)
.toEqual({ isBlob: true, complete: true, naturalWidth: 1 });
}
async function expectPluginMarkdown(scope: Page | Locator): Promise<void> {
await expect(scope.getByRole("heading", { name: "Plugin report" })).toBeVisible();
await expect(scope.getByText("Checks passed.", { exact: false })).toBeVisible();
await expect(scope.getByRole("link", { name: "Documentation", exact: true })).toHaveAttribute(
"href",
"https://paseo.sh/docs/plugins",
);
await expectLoadedMarkdownImage(scope, "Modal preview");
await expect(scope.getByText("Image unavailable")).toHaveCount(0);
}
async function expectCenteredPluginDialog(page: Page): Promise<void> {
const dialog = page.getByRole("dialog");
await expect(dialog.getByText("Edit plugin issue", { exact: true })).toBeVisible();
await expect(dialog.getByText("Plugin modal contexts ready", { exact: true })).toBeVisible();
await expectPluginMarkdown(page);
await expectPluginMarkdown(dialog);
}
async function closeCenteredPluginDialog(page: Page): Promise<void> {
@@ -147,10 +174,15 @@ test("plugin modal adapts its presentation and preserves host contexts", async (
path.join(directory, "paseo-plugin.json"),
JSON.stringify({ id: PLUGIN_ID, requirements: pluginRequirements }),
);
const beforePath = path.join(directory, "before.png");
const afterPath = path.join(directory, "after.png");
const afterFileUrl = pathToFileURL(afterPath).href;
await writeFile(beforePath, TINY_PNG);
await writeFile(afterPath, TINY_PNG);
const audio = await readFile(path.resolve(__dirname, "../../assets/audio/thinking-tone.wav"));
await writeFile(
path.join(directory, "index.client.tsx"),
`const AUDIO_BASE64 = ${JSON.stringify(audio.toString("base64"))};\n${PLUGIN_SOURCE}`,
`const AUDIO_BASE64 = ${JSON.stringify(audio.toString("base64"))};\nconst SCREENSHOT_PATH = ${JSON.stringify(beforePath)};\nconst SCREENSHOT_FILE_URL = ${JSON.stringify(afterFileUrl)};\n${PLUGIN_SOURCE}`,
);
try {
@@ -159,6 +191,12 @@ test("plugin modal adapts its presentation and preserves host contexts", async (
await useNonCompactLayout(page);
await openHostUiPlugin(page);
await test.step("plugin screen Markdown renders local absolute and file:// PNG images inline", async () => {
await expectLoadedMarkdownImage(page, "Before");
await expectLoadedMarkdownImage(page, "After");
await expect(page.getByText("Image unavailable")).toHaveCount(0);
});
await test.step("plugin audio finishes, rejects corrupt files, and recovers", async () => {
await playPluginAudio(page, "Play plugin audio", "Audio finished");
await playPluginAudio(page, "Play invalid audio", "Audio rejected");
@@ -0,0 +1,51 @@
import { test, expect } from "../support/fixtures";
import { TerminalE2EHarness, withTerminalInApp } from "../support/helpers/terminal-dsl";
import { waitForTerminalContent } from "../support/helpers/terminal-perf";
const CODE_FONT = "monospace";
const INTERFACE_FONT = "serif";
test("terminal text keeps the code font when an interface font is set", async ({ page }) => {
// Without WebGL2 the terminal falls back to xterm's DOM renderer, whose rows are
// styled by CSS and so can inherit the interface font.
await page.addInitScript(() => {
const getContext = HTMLCanvasElement.prototype.getContext;
HTMLCanvasElement.prototype.getContext = function (
this: HTMLCanvasElement,
type: string,
...rest: unknown[]
) {
if (type === "webgl2") return null;
return (getContext as (...args: unknown[]) => unknown).call(this, type, ...rest);
} as typeof getContext;
});
await page.addInitScript(
(fonts) => {
const saved = JSON.parse(localStorage.getItem("@paseo:app-settings") ?? "{}");
localStorage.setItem("@paseo:app-settings", JSON.stringify({ ...saved, ...fonts }));
},
{ monoFontFamily: CODE_FONT, uiFontFamily: INTERFACE_FONT },
);
const harness = await TerminalE2EHarness.create({ tempPrefix: "terminal-font-family-" });
try {
await withTerminalInApp(page, harness, { name: "font-family" }, async () => {
await harness.setupPrompt(page);
await harness
.terminalSurface(page)
.pressSequentially("clear; printf 'iiiiiiiiii\\nWWWWWWWWWW\\n'\n", { delay: 0 });
await waitForTerminalContent(page, (text) => text.includes("WWWWWWWWWW"), 10_000);
await harness
.terminalSurface(page)
.screenshot({ path: test.info().outputPath("terminal-font-family.png") });
const rowFont = await page
.locator(".xterm-rows")
.evaluate((rows) => getComputedStyle(rows).fontFamily);
expect(rowFont).toBe(CODE_FONT);
});
} finally {
await harness.cleanup();
}
});
@@ -4,7 +4,9 @@ import path from "node:path";
import type { Page } from "@playwright/test";
import { test, expect } from "../support/fixtures";
import { holdFileUploadResponse } from "../support/helpers/file-upload-gate";
import { clickNewTerminal, gotoWorkspace } from "../support/helpers/launcher";
import { installLocalDesktopHost } from "../support/helpers/local-desktop-host";
import { clickSettingsBackToWorkspace, openSettingsSection } from "../support/helpers/settings";
import { TerminalE2EHarness } from "../support/helpers/terminal-dsl";
import { getTerminalBufferText, waitForTerminalContent } from "../support/helpers/terminal-perf";
@@ -23,13 +25,134 @@ if (process.stdin.isTTY) {
process.stdin.resume();
process.stdin.on("data", (chunk) => {
captured = Buffer.concat([captured, chunk]);
if (captured.includes(Buffer.from("rgb:"))) {
finish();
}
});
setTimeout(finish, 700);
`;
const TERMINAL_PALETTE_PROBE_SCRIPT = `
process.stdin.setRawMode(true);
process.stdin.resume();
const mode = process.argv[2];
let buf = "";
const timer = setTimeout(() => {
process.stdout.write("PROBE_TIMEOUT:" + mode + ":" + buf.replace(/\\x1b/g, "ESC") + "\\n");
process.exit(2);
}, 5000);
if (mode === "osc") {
const code = process.argv[3];
process.stdin.on("data", (chunk) => {
buf += chunk.toString("binary");
const match = buf.match(new RegExp("\\\\x1b\\\\]" + code + ";rgb:[0-9a-f/]+\\\\x1b\\\\\\\\"));
if (!match) return;
clearTimeout(timer);
process.stdout.write("OSC_COLOR_OK:" + code + ":" + match[0].replace(/\\x1b/g, "ESC") + "\\n");
process.exit(0);
});
process.stdout.write("\\x1b]" + code + ";?\\x07");
} else if (mode === "dsr996") {
process.stdin.on("data", (chunk) => {
buf += chunk.toString("binary");
const match = buf.match(/\\x1b\\[\\?997;([12])n/);
if (!match) return;
clearTimeout(timer);
process.stdout.write("DSR996_OK:" + match[1] + "\\n");
process.exit(0);
});
process.stdout.write("\\x1b[?996n");
} else if (mode === "watch2031") {
clearTimeout(timer);
process.stdin.on("data", (chunk) => {
buf += chunk.toString("binary");
if (buf.includes("Q")) {
process.stdout.write("\\x1b[?2031lWATCH2031_DONE\\n");
process.exit(0);
}
let match;
while ((match = buf.match(/\\x1b\\[\\?997;([12])n/))) {
process.stdout.write("WATCH2031_EVENT:" + match[1] + "\\n");
buf = buf.slice(match.index + match[0].length);
}
});
process.stdout.write("\\x1b[?2031hWATCH2031_READY\\n");
}
`;
const TERMINAL_PALETTE_SCENARIOS = {
light: {
label: "Light",
colorFgBg: "0;15",
schemeCode: "2",
colors: {
10: "rgb:1a1a/1a1a/1e1e",
11: "rgb:ffff/ffff/ffff",
12: "rgb:1a1a/1a1a/1e1e",
},
},
dark: {
label: "Dark",
colorFgBg: "15;0",
schemeCode: "1",
colors: {
10: "rgb:fafa/fafa/fafa",
11: "rgb:1818/1b1b/1a1a",
12: "rgb:fafa/fafa/fafa",
},
},
} as const;
type TerminalPaletteScenario =
(typeof TERMINAL_PALETTE_SCENARIOS)[keyof typeof TERMINAL_PALETTE_SCENARIOS];
async function selectAppThemeInApp(
page: Page,
label: TerminalPaletteScenario["label"],
): Promise<void> {
await page.getByRole("button", { name: "Settings", exact: true }).click();
await expect(page.getByTestId("settings-sidebar")).toBeVisible();
await openSettingsSection(page, "appearance");
const themeRadio = page.getByRole("radio", { name: label, exact: true });
await themeRadio.click();
await expect(themeRadio).toBeChecked();
await clickSettingsBackToWorkspace(page);
}
function collectBrowserOsc11Replies(page: Page): string[] {
const replies: string[] = [];
page.on("websocket", (ws) => {
ws.on("framesent", ({ payload }) => {
const text = typeof payload === "string" ? payload : payload.toString("latin1");
if (text.includes("]11;rgb:")) {
replies.push(text);
}
});
});
return replies;
}
async function waitForCreatedTerminal(
harness: TerminalE2EHarness,
knownTerminalIds: Set<string>,
): Promise<string> {
let createdTerminalId: string | undefined;
await expect
.poll(
async () => {
const result = await harness.client.listTerminals(harness.tempRepo.path, undefined, {
workspaceId: harness.workspaceId,
});
createdTerminalId = result.terminals.find(
(terminal) => !knownTerminalIds.has(terminal.id),
)?.id;
return createdTerminalId;
},
{ timeout: 10_000 },
)
.toBeTruthy();
return createdTerminalId!;
}
// A TUI stand-in: turns on bracketed paste, reads every quoted path in each
// bracketed paste, and echoes typed lines, so the PTY output proves what reached
// the terminal and where the file was read from.
@@ -158,6 +281,10 @@ test.describe("Terminal protocol queries", () => {
test.beforeAll(async () => {
harness = await TerminalE2EHarness.create({ tempPrefix: "terminal-protocol-query-" });
await writeFile(path.join(harness.tempRepo.path, "osc11-capture.cjs"), OSC11_CAPTURE_SCRIPT);
await writeFile(
path.join(harness.tempRepo.path, "palette-probe.cjs"),
TERMINAL_PALETTE_PROBE_SCRIPT,
);
await writeFile(path.join(harness.tempRepo.path, "file-receiver.cjs"), FILE_RECEIVER_SCRIPT);
});
@@ -166,6 +293,8 @@ test.describe("Terminal protocol queries", () => {
});
test("does not send browser OSC 11 color-query replies back to the PTY", async ({ page }) => {
const browserOscReplies = collectBrowserOsc11Replies(page);
const terminalInstance = await harness.createTerminal({ name: "osc11-query" });
try {
await harness.openTerminal(page, { terminalId: terminalInstance.id });
@@ -178,14 +307,110 @@ test.describe("Terminal protocol queries", () => {
await page.waitForTimeout(500);
const text = await getTerminalBufferText(page);
const captureLine =
text.split("\n").find((line) => line.includes("PASEO_OSC11_CAPTURE:")) ?? "";
const capturedMatches = captureLine.match(/\]11;rgb:[0-9a-f/]+/g) ?? [];
expect(text).toContain("rgb:0b0b/0b0b/0b0b");
expect(text).not.toContain("rgb:ffff/ffff/ffff");
expect(capturedMatches).toHaveLength(1);
expect(browserOscReplies).toEqual([]);
const afterCapture = text.slice(text.indexOf("PASEO_OSC11_CAPTURE:") + captureLine.length);
expect(afterCapture).not.toContain("rgb:");
} finally {
await harness.killTerminal(terminalInstance.id);
}
});
test("reports Light and Dark palettes through OSC 10/11/12, COLORFGBG, DSR 996/997, and live DEC 2031 toggles", async ({
page,
}) => {
const createAppTerminal = async (): Promise<string> => {
const existing = await harness.client.listTerminals(harness.tempRepo.path, undefined, {
workspaceId: harness.workspaceId,
});
const knownIds = new Set(existing.terminals.map((entry) => entry.id));
await clickNewTerminal(page);
const terminalId = await waitForCreatedTerminal(harness, knownIds);
const surface = terminalSurface(page);
await expect(surface).toBeVisible({ timeout: 20_000 });
await surface.click();
const readyTag = `READY_${Date.now()}`;
await surface.pressSequentially(`echo ${readyTag}\n`, { delay: 0 });
await expectTerminalOutput(terminalId, readyTag);
return terminalId;
};
const runPaletteChecks = async (
terminalId: string,
scenario: TerminalPaletteScenario,
options: { checkColorFgBg: boolean },
): Promise<void> => {
const surface = terminalSurface(page);
await surface.click();
if (options.checkColorFgBg) {
await surface.pressSequentially('echo "CFGBG=$COLORFGBG"\n', { delay: 0 });
await expectTerminalOutput(terminalId, `CFGBG=${scenario.colorFgBg}`);
}
for (const code of [10, 11, 12] as const) {
await surface.pressSequentially(`${process.execPath} palette-probe.cjs osc ${code}\n`, {
delay: 0,
});
await expectTerminalOutput(
terminalId,
`OSC_COLOR_OK:${code}:ESC]${code};${scenario.colors[code]}ESC\\`,
);
}
await surface.pressSequentially(`${process.execPath} palette-probe.cjs dsr996\n`, {
delay: 0,
});
await expectTerminalOutput(terminalId, `DSR996_OK:${scenario.schemeCode}`);
};
// 1. Open workspace once, switch to Light in-app, and create a fresh Light terminal.
await gotoWorkspace(page, harness.workspaceId);
await selectAppThemeInApp(page, "Light");
const lightTerminalId = await createAppTerminal();
let darkTerminalId: string | null = null;
try {
await runPaletteChecks(lightTerminalId, TERMINAL_PALETTE_SCENARIOS.light, {
checkColorFgBg: true,
});
// 2. Start DEC 2031 watcher in that running Light terminal, then toggle Light -> Dark -> Light.
await terminalSurface(page).pressSequentially(
`${process.execPath} palette-probe.cjs watch2031\n`,
{ delay: 0 },
);
await expectTerminalOutput(lightTerminalId, "WATCH2031_READY");
await selectAppThemeInApp(page, "Dark");
await expectTerminalOutput(lightTerminalId, "WATCH2031_EVENT:1");
await selectAppThemeInApp(page, "Light");
await expectTerminalOutput(lightTerminalId, "WATCH2031_EVENT:2");
// Stop watcher, toggle to Dark, and verify live OSC 10/11/12 + DSR 996 update on the same PTY.
await terminalSurface(page).click();
await terminalSurface(page).pressSequentially("Q", { delay: 0 });
await expectTerminalOutput(lightTerminalId, "WATCH2031_DONE");
await selectAppThemeInApp(page, "Dark");
await runPaletteChecks(lightTerminalId, TERMINAL_PALETTE_SCENARIOS.dark, {
checkColorFgBg: false,
});
// 3. Fresh Dark terminal reports Dark OSC 10/11/12, COLORFGBG=15;0, and DSR 996 -> dark (1).
darkTerminalId = await createAppTerminal();
await runPaletteChecks(darkTerminalId, TERMINAL_PALETTE_SCENARIOS.dark, {
checkColorFgBg: true,
});
} finally {
await harness.killTerminal(lightTerminalId);
if (darkTerminalId) {
await harness.killTerminal(darkTerminalId);
}
}
});
async function openFileReceiver(page: Page, name: string) {
const terminal = await harness.createTerminal({
name,
@@ -13,8 +13,12 @@ import { test, expect } from "../support/fixtures";
import { expectComposerVisible } from "../support/helpers/composer";
import { withDirectoryPlugin } from "../support/helpers/plugin-timeline";
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
import { getE2EDaemonPort } from "../support/helpers/daemon-port";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
test.use({
e2eInjectPaseoTools: true,
e2eDaemonConfig: {
version: 1,
agents: {
@@ -290,6 +294,89 @@ test("received messages show their sender and open that agent", async ({ page })
}
});
/** Calls a Paseo MCP tool as `callerAgentId`, the way that agent's provider would. */
async function callPaseoToolAs(
callerAgentId: string,
name: string,
args: Record<string, unknown>,
): Promise<Record<string, unknown>> {
const mcp = new Client({ name: "turn-collapse-e2e", version: "1" });
await mcp.connect(
new StreamableHTTPClientTransport(
new URL(`http://127.0.0.1:${getE2EDaemonPort()}/mcp/agents?callerAgentId=${callerAgentId}`),
),
);
try {
const response = await mcp.callTool({ name, arguments: args });
expect(response, name).not.toMatchObject({ isError: true });
return response.structuredContent as Record<string, unknown>;
} finally {
await mcp.close();
}
}
test("a delegated child reports each turn end as a compact tool call until its own delegate is done", async ({
page,
}, testInfo) => {
const frames: string[] = [];
page.on("websocket", (socket) => {
socket.on("framereceived", ({ payload }) => {
if (typeof payload === "string") frames.push(payload);
});
});
const childNoticeFrames = () => frames.filter((frame) => frame.includes('"label":"Child"'));
const parent = await seedMockAgentWorkspace({ repoPrefix: "child-notices-", title: "Lead" });
try {
await openAgentRoute(page, parent);
await expectComposerVisible(page);
const child = await callPaseoToolAs(parent.agentId, "create_agent", {
workspaceId: parent.workspaceId,
title: "Child",
provider: "mock/e2e-fast-stream",
settings: { modeId: "load-test" },
initialPrompt: "Delegate the slow part",
});
const childId = String(child.agentId);
// The child's own delegate outlives the child's first turn.
const grandchild = await callPaseoToolAs(childId, "create_agent", {
workspaceId: parent.workspaceId,
title: "Grandchild",
provider: "mock/ten-second-stream",
settings: { modeId: "load-test" },
initialPrompt: "Take your time",
});
const notices = page.getByRole("button", { name: /^Agent .*Child/ });
const finished = page.getByRole("button", { name: /^Agent finished.*Child/ });
// The child ended its turn while waiting on its delegate: the parent hears it now.
await expect(finished).toHaveCount(1, { timeout: 30_000 });
const delegate = await parent.client.waitForAgentUpsert(String(grandchild.agentId), () => true);
expect(delegate.status, "the delegate must still be running").toBe("running");
expect(
childNoticeFrames().some((frame) => frame.includes("It still has agents it is waiting on.")),
).toBe(true);
// The delegate reports to the child, and the child's settled turn reaches the parent.
await expect(finished).toHaveCount(2, { timeout: 60_000 });
await expect(notices).toHaveCount(2);
await expect(page.getByText(/still working/i)).toHaveCount(0);
await expect(page.getByText(/Sent by/)).toHaveCount(0);
await expect(page.getByText(/<agent-response>/)).toHaveCount(0);
await finished.last().scrollIntoViewIfNeeded();
await page.screenshot({ path: testInfo.outputPath("child-notices.png") });
// Notification events stay on the daemon: clients get only plain tool calls.
expect(frames.filter((frame) => frame.includes('"agentMessage"'))).toEqual([]);
expect(childNoticeFrames().some((frame) => frame.includes('"name":"agent_finished"'))).toBe(
true,
);
expect(childNoticeFrames().filter((frame) => /"name":"agent_(?!finished)/.test(frame))).toEqual(
[],
);
} finally {
await parent.cleanup();
}
});
test("long sender attribution stays on one line in compact chat", async ({ page }, testInfo) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.addInitScript(() =>
@@ -668,3 +668,186 @@ test("sidebar usage falls back to period shorthands before dropping all labels",
await dragSidebarTo(300);
await expectPinnedUsage(page, ["6%", "20%", "100%", "14%", "22%", "97%"]);
});
test("pushed status.usage_report_changed updates sidebar summary and open Usage modal without polling", async ({
page,
}) => {
const [claude] = claudeAndCodexReports();
const initialFetchedAt = new Date(Date.now() - 60_000).toISOString();
const usage = await installUsageReportsFixture(page, {
lists: [
() => [
{
...claude!,
fetchedAt: initialFetchedAt,
successfulAt: initialFetchedAt,
report: {
status: "available",
windows: [
{ id: "five_hour", label: "Session", shortLabel: "5h", summary: true, usedPct: 31 },
{ id: "weekly", label: "Weekly", shortLabel: "wk", summary: true, usedPct: 54 },
],
},
},
],
],
});
await page.setViewportSize(WIDE);
await seedSidebarFooterPreferences(page, [{ key: "usage", visible: true }]);
await gotoAppShell(page);
await expectPinnedUsage(page, ["31% 5h", "54% wk"]);
await usage.waitForUsageReportSubscription();
await openUsageFromItem(page);
const modal = usageModal(page);
await expect(modal.getByText("31% used")).toBeVisible();
const requestsBeforePush = usage.listRequests();
const updatedAt = new Date().toISOString();
usage.pushReportUpdate({
...claude!,
fetchedAt: updatedAt,
successfulAt: updatedAt,
report: {
status: "available",
windows: [
{ id: "five_hour", label: "Session", shortLabel: "5h", summary: true, usedPct: 64 },
{ id: "weekly", label: "Weekly", shortLabel: "wk", summary: true, usedPct: 54 },
],
},
});
await expectPinnedUsage(page, ["64% 5h", "54% wk"]);
await expect(modal.getByText("64% used")).toBeVisible();
expect(usage.listRequests()).toEqual(requestsBeforePush);
});
test("a pushed report for one source does not postpone the five-minute poll of other sources", async ({
page,
}) => {
const [claude, codex] = claudeAndCodexReports();
let codexUsedPct = 7;
let listFetchedAt = "2026-11-28T10:00:00.000Z";
const usage = await installUsageReportsFixture(page, {
lists: [
() => [
{
...claude!,
fetchedAt: listFetchedAt,
report: {
status: "available",
windows: [
{ id: "five_hour", label: "Session", shortLabel: "5h", summary: true, usedPct: 31 },
],
},
},
{
...codex!,
fetchedAt: listFetchedAt,
report: {
status: "available",
windows: [
{
id: "five_hour",
label: "Session",
shortLabel: "5h",
summary: true,
usedPct: codexUsedPct,
},
],
},
},
],
],
});
await page.clock.install();
await page.setViewportSize(WIDE);
await seedSidebarFooterPreferences(page, [{ key: "usage", visible: true }]);
await gotoAppShell(page);
await expectPinnedUsage(page, ["31% 5h", "7% 5h"]);
await usage.waitForUsageReportSubscription();
const initialRequests = usage.listRequests();
// Push a Claude update 2 minutes into the 5-minute poll window.
await page.clock.fastForward(2 * 60_000);
const pushedAt = "2026-11-28T10:02:00.000Z";
usage.pushReportUpdate({
...claude!,
fetchedAt: pushedAt,
successfulAt: pushedAt,
report: {
status: "available",
windows: [
{ id: "five_hour", label: "Session", shortLabel: "5h", summary: true, usedPct: 64 },
],
},
});
await expectPinnedUsage(page, ["64% 5h", "7% 5h"]);
expect(usage.listRequests()).toEqual(initialRequests);
// Only 3 minutes later (t = 5m from initial fetch), the scheduled poll still runs for Codex.
codexUsedPct = 19;
listFetchedAt = "2026-11-28T10:05:00.000Z";
await page.clock.fastForward(3 * 60_000);
await expectPinnedUsage(page, ["31% 5h", "19% 5h"]);
expect(usage.listRequests()).toHaveLength(initialRequests.length + 1);
});
test("hiding and showing the sidebar preserves the five-minute poll schedule and failed reports retry after one minute", async ({
page,
}) => {
const [claude] = claudeAndCodexReports();
let mode: "ok" | "error" = "ok";
let usedPct = 31;
const usage = await installUsageReportsFixture(page, {
lists: [
() => [
{
...claude!,
fetchedAt: new Date().toISOString(),
report:
mode === "error"
? { status: "error", error: "Temporary 503" }
: {
status: "available",
windows: [
{ id: "five_hour", label: "Session", shortLabel: "5h", summary: true, usedPct },
],
},
},
],
],
});
await page.clock.install();
await page.setViewportSize(WIDE);
await seedSidebarFooterPreferences(page, [{ key: "usage", visible: true }]);
await gotoAppShell(page);
await expectPinnedUsage(page, ["31% 5h"]);
const initialRequests = usage.listRequests();
// Hide and reopen the sidebar within the stale window: no extra fetch starts on remount,
// and the original 5-minute poll slot fires on time rather than restarting from zero.
await page.clock.fastForward(20_000);
await page.setViewportSize(COMPACT);
await expect(usageItem(page)).toHaveCount(0);
await page.clock.fastForward(15_000);
await openCompactSidebar(page);
await expectPinnedUsage(page, ["31% 5h"]);
expect(usage.listRequests()).toEqual(initialRequests);
usedPct = 44;
await page.clock.fastForward(4 * 60_000 + 25_000);
await expectPinnedUsage(page, ["44% 5h"]);
expect(usage.listRequests()).toHaveLength(initialRequests.length + 1);
// When a report enters error state, the app retries after 1 minute instead of waiting 5 minutes.
mode = "error";
await page.clock.fastForward(5 * 60_000);
const requestsAfterError = usage.listRequests();
expect(requestsAfterError).toHaveLength(initialRequests.length + 2);
mode = "ok";
usedPct = 58;
await page.clock.fastForward(60_000);
await expectPinnedUsage(page, ["58% 5h"]);
expect(usage.listRequests()).toHaveLength(requestsAfterError.length + 1);
});
@@ -31,7 +31,7 @@ function keyboardState() {
return {
shown: /^ mInputShown=true$/m.test(state),
// The native object identity survives layout/flag changes but not a remount.
input: view.match(/ReactEditText\{(\w+)/)?.[1] ?? null,
input: view.match(/PaseoTerminalInputView\{(\w+)/)?.[1] ?? null,
};
}
async function waitForKeyboard(shown) {
@@ -3,15 +3,35 @@ import type { Page } from "@playwright/test";
// Poses as the desktop app running the e2e daemon as its own managed daemon, so
// `useIsLocalDaemon` reports the host as this machine. `directory` is where the
// desktop bridge claims dropped files live on disk.
export async function installLocalDesktopHost(page: Page, directory: string): Promise<void> {
export async function installLocalDesktopHost(
page: Page,
directory: string,
// `fileManager` adds the editor bridge: a file manager of that name, and the default-app opener.
{ fileManager = null }: { fileManager?: string | null } = {},
): Promise<void> {
const serverId = process.env.E2E_SERVER_ID;
if (!serverId) {
throw new Error("E2E_SERVER_ID is not set");
}
await page.addInitScript(
(localHost: { serverId: string; directory: string }) => {
(localHost: { serverId: string; directory: string; fileManager: string | null }) => {
const editor = localHost.fileManager
? {
listTargets: async () => [
{
id: "file-manager",
label: localHost.fileManager,
kind: "file-manager",
icon: { kind: "symbol", name: "folder" },
},
],
openTarget: async () => undefined,
openDefaultApp: async () => undefined,
}
: undefined;
(window as unknown as { paseoDesktop: unknown }).paseoDesktop = {
platform: "linux",
editor,
invoke: async (command: string) => {
if (command === "desktop_daemon_status") {
return {
@@ -33,6 +53,6 @@ export async function installLocalDesktopHost(page: Page, directory: string): Pr
webUtils: { getPathForFile: (file: File) => `${localHost.directory}/${file.name}` },
};
},
{ serverId, directory },
{ serverId, directory, fileManager },
);
}
@@ -739,6 +739,70 @@ export async function delayBrowserWorkspaceCreatedResponse(
};
}
export interface BranchSuggestionsControl {
release(): void;
waitForRequest(): Promise<void>;
waitForResponse(): Promise<void>;
}
/**
* Intercepts `branch_suggestions_request` / `branch_suggestions_response` frames over the daemon
* WebSocket. Pass `hold: true` to keep responses queued until `release()` is called, or `hold: false`
* to observe prefetched responses without delaying them.
*/
export async function watchBrowserBranchSuggestions(
page: Page,
options: { hold: boolean },
): Promise<BranchSuggestionsControl> {
const frames = await loadSessionMessageReaders();
const daemonPortPattern = daemonWsRoutePattern();
const delayedForwards: Array<() => void> = [];
let releaseRequested = !options.hold;
let resolveRequest: (() => void) | null = null;
let resolveResponse: (() => void) | null = null;
const requestSeen = new Promise<void>((resolve) => {
resolveRequest = resolve;
});
const responseSeen = new Promise<void>((resolve) => {
resolveResponse = resolve;
});
await page.routeWebSocket(daemonPortPattern, (ws) => {
const server = ws.connectToServer();
ws.onMessage((message) => {
const sessionMessage = frames.client(message);
if (sessionMessage?.type === "branch_suggestions_request") {
resolveRequest?.();
}
server.send(message);
});
server.onMessage((message) => {
const sessionMessage = frames.server(message);
if (sessionMessage?.type === "branch_suggestions_response") {
resolveResponse?.();
if (!releaseRequested) {
delayedForwards.push(() => ws.send(message));
return;
}
}
ws.send(message);
});
});
return {
release() {
releaseRequested = true;
for (const forward of delayedForwards.splice(0)) {
forward();
}
},
waitForRequest: () => requestSeen,
waitForResponse: () => responseSeen,
};
}
type WorkspaceEntry = Awaited<
ReturnType<NewWorkspaceDaemonClient["fetchWorkspaces"]>
>["entries"][number];
@@ -1,5 +1,6 @@
import path from "node:path";
import { readFileSync } from "node:fs";
import type { TerminalDefaultColors } from "@getpaseo/protocol/messages";
import type { TerminalActivity } from "@getpaseo/protocol/terminal-activity";
import { connectDaemonClient } from "./daemon-client-loader";
import { withProjectOwnership } from "./project-ownership";
@@ -94,7 +95,13 @@ export interface SeedDaemonClient {
cwd: string,
name?: string,
requestId?: string,
options?: { agentId?: string; command?: string; args?: string[]; workspaceId?: string },
options?: {
agentId?: string;
command?: string;
args?: string[];
workspaceId?: string;
defaultColors?: TerminalDefaultColors;
},
): Promise<{
terminal: { id: string; name: string; cwd: string; activity?: TerminalActivity | null } | null;
error: string | null;
+9 -10
View File
@@ -463,16 +463,15 @@ export async function delegateFleetThroughMcp() {
direction: "tail",
limit: 100,
});
return timeline.entries
.flatMap(({ item }) =>
item.type === "tool_call" && item.agentMessage ? [item.agentMessage] : [],
)
.filter(
(message) =>
message.event === "finished" &&
message.sender.id === child.agentId &&
message.text.includes(`Server: ${child.serverId}`),
).length;
return timeline.entries.filter(
({ item }) =>
item.type === "tool_call" &&
item.name === "agent_finished" &&
item.detail.type === "plain_text" &&
item.detail.label === child.title &&
item.detail.text?.includes(child.agentId) &&
item.detail.text.includes(`Server: ${child.serverId}`),
).length;
})
.toBe(1);
},
@@ -1,4 +1,5 @@
import type { Page } from "@playwright/test";
import type { TerminalDefaultColors } from "@getpaseo/protocol/messages";
import type { TerminalActivity, TerminalActivityState } from "@getpaseo/protocol/terminal-activity";
import { createTempGitRepo } from "./workspace";
import { navigateToTerminal, setupDeterministicPrompt } from "./terminal-perf";
@@ -19,6 +20,7 @@ interface CreateTerminalInput {
name: string;
command?: string;
args?: string[];
defaultColors?: TerminalDefaultColors;
}
function sleep(ms: number): Promise<void> {
@@ -69,14 +71,11 @@ export class TerminalE2EHarness {
}
async createTerminal(input: CreateTerminalInput): Promise<TerminalInstance> {
const options =
input.command || input.args
? {
command: input.command,
args: input.args,
workspaceId: this.workspaceId,
}
: { workspaceId: this.workspaceId };
const options = {
...(input.command || input.args ? { command: input.command, args: input.args } : {}),
workspaceId: this.workspaceId,
...(input.defaultColors ? { defaultColors: input.defaultColors } : {}),
};
const result = await this.client.createTerminal(
this.tempRepo.path,
input.name,
@@ -11,6 +11,10 @@ export interface UsageListRequest {
export interface UsageReportsFixture {
listRequests(): UsageListRequest[];
waitForListRequests(count: number): Promise<void>;
/** Waits until the app holds an active `status.usage_report_changed` subscription. */
waitForUsageReportSubscription(): Promise<void>;
/** Pushes a `status.usage_report_changed` update to every active app subscription. */
pushReportUpdate(report: UsageReportEntry): void;
/** Runs `action`, then waits until the app has received the agent's next usage scope. */
untilUsageScopeChanges(agentId: string, action: () => Promise<unknown>): Promise<void>;
}
@@ -28,6 +32,8 @@ interface UsageReportsFixtureOptions {
*/
usageSupported?: boolean | (() => boolean);
usageSettingSupported?: boolean;
/** Overrides `server_info.features.usageReportUpdates` when set. */
usageReportUpdates?: boolean;
/** Released hosts expose provider.usage.list with no source icons. */
providerUsageListOnly?: boolean;
/** The host daemon's port; defaults to the E2E daemon. */
@@ -67,6 +73,7 @@ function withUsageSupportFeature(
enabled: boolean,
providerUsageListOnly: boolean,
usageSettingSupported: boolean,
usageReportUpdates?: boolean,
): string | null {
const envelope = parseJson(message) as {
type?: unknown;
@@ -93,6 +100,7 @@ function withUsageSupportFeature(
usageSetting: usageSettingSupported ? true : undefined,
usageSources: enabled && !providerUsageListOnly,
providerUsageList: enabled,
...(usageReportUpdates !== undefined ? { usageReportUpdates } : {}),
},
},
},
@@ -143,12 +151,37 @@ function createCounter() {
};
}
function trackUsageReportSubscriptionMessage(
request: Record<string, unknown> | null,
pendingUsageSubRequestIds: Set<string>,
usageReportSubscriptions: Map<string, { send: (payload: string) => void }>,
socketSubIds: Set<string>,
): void {
if (
request?.type === "session.events.set_subscription.request" &&
typeof request.requestId === "string" &&
Array.isArray(request.events) &&
request.events.includes("status.usage_report_changed")
) {
pendingUsageSubRequestIds.add(request.requestId);
}
if (
request?.type === "subscription.release.request" &&
typeof request.subscriptionId === "string"
) {
usageReportSubscriptions.delete(request.subscriptionId);
socketSubIds.delete(request.subscriptionId);
}
}
export async function installUsageReportsFixture(
page: Page,
options: UsageReportsFixtureOptions,
): Promise<UsageReportsFixture> {
const listRequests: UsageListRequest[] = [];
const listCounter = createCounter();
const usageReportSubscriptions = new Map<string, { send: (payload: string) => void }>();
const usageReportSubCounter = createCounter();
const usageScopes = new Map<string, string>();
const usageScopeChanges = new Map<string, ReturnType<typeof createCounter>>();
const usageScopeCounts = new Map<string, number>();
@@ -171,10 +204,23 @@ export async function installUsageReportsFixture(
options.port === undefined ? daemonWsRoutePattern() : wsRoutePatternForPort(`${options.port}`);
await page.routeWebSocket(route, (ws) => {
const server = ws.connectToServer();
const pendingUsageSubRequestIds = new Set<string>();
const socketSubIds = new Set<string>();
ws.onClose(() => {
for (const id of socketSubIds) usageReportSubscriptions.delete(id);
socketSubIds.clear();
});
ws.onMessage((message) => {
const request = getSessionMessage(message);
const requestId = request?.requestId;
trackUsageReportSubscriptionMessage(
request,
pendingUsageSubRequestIds,
usageReportSubscriptions,
socketSubIds,
);
if (request?.type === requestType && typeof requestId === "string") {
const listRequest: UsageListRequest = {
forceRefresh: request.forceRefresh === true,
@@ -262,6 +308,26 @@ export async function installUsageReportsFixture(
});
server.onMessage((message) => {
const sessionMessage = getSessionMessage(message);
const subPayload =
sessionMessage?.type === "session.events.set_subscription.response"
? (sessionMessage.payload as
| { requestId?: unknown; subscriptionId?: unknown }
| undefined)
: undefined;
if (
typeof subPayload?.requestId === "string" &&
pendingUsageSubRequestIds.delete(subPayload.requestId) &&
typeof subPayload.subscriptionId === "string"
) {
usageReportSubscriptions.set(subPayload.subscriptionId, {
send: (payload) => ws.send(payload),
});
socketSubIds.add(subPayload.subscriptionId);
ws.send(message);
usageReportSubCounter.increment();
return;
}
const serverInfo =
typeof message === "string"
? withUsageSupportFeature(
@@ -269,6 +335,7 @@ export async function installUsageReportsFixture(
isUsageSupported(),
providerUsageListOnly,
options.usageSettingSupported ?? true,
options.usageReportUpdates,
)
: null;
const scope = agentUsageScope(message);
@@ -287,6 +354,24 @@ export async function installUsageReportsFixture(
return {
listRequests: () => [...listRequests],
waitForListRequests: (count) => listCounter.waitFor(count),
waitForUsageReportSubscription: () => usageReportSubCounter.waitFor(1),
pushReportUpdate: (report) => {
for (const [subscriptionId, target] of usageReportSubscriptions) {
target.send(
JSON.stringify({
type: "session",
message: {
type: "status",
payload: {
status: "usage_report_changed",
subscriptionId,
report,
},
},
}),
);
}
},
untilUsageScopeChanges: async (agentId, action) => {
const next = (usageScopeCounts.get(agentId) ?? 0) + 1;
await action();
+65 -81
View File
@@ -1,5 +1,6 @@
require "fileutils"
require "tmpdir"
require_relative "ios_review"
default_platform(:ios)
@@ -42,8 +43,20 @@ def stage_google_play_screenshots
root
end
def connect_ios_review_client
client = IosReview::SpaceshipClient.new
client.authenticate!(
key_id: ENV.fetch("ASC_KEY_ID"),
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
key_filepath: ENV.fetch("ASC_KEY_P8"),
)
app = client.find_app(APP_IDENTIFIER)
UI.user_error!("Could not find app #{APP_IDENTIFIER} on App Store Connect") if app.nil?
[client, app]
end
platform :ios do
desc "Submit the latest TestFlight build to App Store Review"
desc "Submit the latest TestFlight build to App Store Review (non-destructive by default)"
lane :submit_review do
api_key = app_store_connect_api_key(
key_id: ENV.fetch("ASC_KEY_ID"),
@@ -51,89 +64,60 @@ platform :ios do
key_filepath: ENV.fetch("ASC_KEY_P8"),
)
require "spaceship"
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(
key_id: ENV.fetch("ASC_KEY_ID"),
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
filepath: ENV.fetch("ASC_KEY_P8"),
client, app = connect_ios_review_client
IosReview.submit_review(
client: client,
app: app,
ui: UI,
target_version: ENV["APP_VERSION"],
target_build: ENV["APP_BUILD_VERSION"],
replace_in_review: IosReview.parse_bool(ENV["REPLACE_IN_REVIEW"]),
deliver_runner: lambda do |app_version:, build_number:, reject_if_possible:|
deliver(
api_key: api_key,
app_identifier: APP_IDENTIFIER,
app_version: app_version,
build_number: build_number.to_s,
submit_for_review: true,
automatic_release: true,
reject_if_possible: reject_if_possible,
release_notes: {
"en-US" => "Bug fixes and improvements.",
},
force: true,
skip_binary_upload: true,
screenshots_path: stage_app_store_screenshots,
overwrite_screenshots: true,
precheck_include_in_app_purchases: false,
submission_information: {
add_id_info_uses_idfa: false,
export_compliance_uses_encryption: false,
},
)
end,
)
app = Spaceship::ConnectAPI::App.find(APP_IDENTIFIER)
UI.user_error!("Could not find app #{APP_IDENTIFIER} on App Store Connect") if app.nil?
end
# The release workflow forwards the marketing version and CFBundleVersion of
# the binary it just built. Use them to identify the exact build, since
# CFBundleVersion is not unique across marketing versions in this project
# (the production profile resets it per app_version). The resubmit workflow
# leaves these unset and falls back to "most recently uploaded iOS build".
target_version = ENV["APP_VERSION"].to_s.strip
target_build = ENV["APP_BUILD_VERSION"].to_s.strip
target_version = nil if target_version.empty?
target_build = nil if target_build.empty?
if target_version
UI.message("Targeting App Store version #{target_version}#{target_build ? " build #{target_build}" : ""} from workflow input")
else
UI.message("No APP_VERSION provided; selecting the most recently uploaded iOS build")
end
valid_build = nil
deadline = Time.now + (30 * 60)
loop do
builds = Spaceship::ConnectAPI::Build.all(
app_id: app.id,
sort: "-uploadedDate",
limit: 100,
).select { |b| b.pre_release_version&.platform == "IOS" }
builds = builds.select { |b| b.pre_release_version&.version == target_version } if target_version
builds = builds.select { |b| b.version == target_build } if target_build
build = builds.first
if build.nil?
UI.user_error!("Timed out waiting for build to appear on App Store Connect.") if Time.now > deadline
UI.message("No matching iOS build visible on App Store Connect yet; waiting...")
sleep(30)
next
end
state = build.processing_state
UI.message("Build #{build.pre_release_version.version} (#{build.version}) processing state: #{state || 'unknown'}")
if state == "VALID"
valid_build = build
break
end
if state == "INVALID" || state == "FAILED"
UI.user_error!("Build #{build.version} failed App Store processing (state: #{state}).")
end
if Time.now > deadline
UI.user_error!("Timed out waiting for build #{build.version} to finish processing on App Store Connect.")
end
sleep(30)
end
app_version = valid_build.pre_release_version.version
build_number = valid_build.version
UI.message("Submitting build #{build_number} as App Store version #{app_version} for review")
deliver(
api_key: api_key,
desc "Print live App Store version, active/pending versions, review submissions, and recent TestFlight builds"
lane :review_status do
client, app = connect_ios_review_client
IosReview.review_status(
client: client,
app: app,
ui: UI,
app_identifier: APP_IDENTIFIER,
app_version: app_version,
build_number: build_number.to_s,
submit_for_review: true,
automatic_release: true,
reject_if_possible: true,
release_notes: {
"en-US" => "Bug fixes and improvements.",
},
force: true,
skip_binary_upload: true,
screenshots_path: stage_app_store_screenshots,
overwrite_screenshots: true,
precheck_include_in_app_purchases: false,
submission_information: {
add_id_info_uses_idfa: false,
export_compliance_uses_encryption: false,
},
)
end
desc "Cancel the active in-flight iOS App Store review submission"
lane :cancel_review do
client, app = connect_ios_review_client
IosReview.cancel_review(
client: client,
app: app,
ui: UI,
expected_version: ENV["EXPECTED_VERSION"],
)
end
end
+635
View File
@@ -0,0 +1,635 @@
# frozen_string_literal: true
module IosReview
PLATFORM_IOS = "IOS"
# Valid App Store Connect API v1 filter[appVersionState] values (fastlane 2.241.1
# Spaceship::ConnectAPI::AppStoreVersion::AppVersionState) that block a new
# App Store review submission.
BLOCKING_API_VERSION_STATES = %w[
WAITING_FOR_REVIEW
IN_REVIEW
PENDING_DEVELOPER_RELEASE
PENDING_APPLE_RELEASE
PROCESSING_FOR_DISTRIBUTION
WAITING_FOR_EXPORT_COMPLIANCE
ACCEPTED
].freeze
# In-memory check also recognizes the deprecated AppStoreState alias
# PROCESSING_FOR_APP_STORE (never sent in filter[appVersionState]).
BLOCKING_VERSION_STATES = (BLOCKING_API_VERSION_STATES + %w[
PROCESSING_FOR_APP_STORE
]).freeze
# Valid filter[appVersionState] values shown in review_status under active/pending versions.
ACTIVE_API_VERSION_STATES = (BLOCKING_API_VERSION_STATES + %w[
PREPARE_FOR_SUBMISSION
READY_FOR_REVIEW
DEVELOPER_REJECTED
REJECTED
METADATA_REJECTED
INVALID_BINARY
]).freeze
# ReviewSubmission states representing an active submission already in Apple's queue
# (or mid-cancellation). UNRESOLVED_ISSUES is intentionally excluded here so a
# rejected version's free slot is not treated as an in-flight review; stale
# UNRESOLVED_ISSUES submissions are cleared separately right before deliver runs.
IN_FLIGHT_SUBMISSION_STATES = %w[
WAITING_FOR_REVIEW
IN_REVIEW
CANCELING
].freeze
UNRESOLVED_SUBMISSION_STATES = %w[
UNRESOLVED_ISSUES
].freeze
# ReviewSubmission states that can be cancelled via ReviewSubmission#cancel_submission
# (or waited on if already CANCELING).
CANCELLABLE_SUBMISSION_STATES = %w[
WAITING_FOR_REVIEW
IN_REVIEW
UNRESOLVED_ISSUES
CANCELING
].freeze
STATUS_SUBMISSION_STATES = %w[
WAITING_FOR_REVIEW
IN_REVIEW
UNRESOLVED_ISSUES
CANCELING
READY_FOR_REVIEW
].freeze
DEFAULT_BUILD_TIMEOUT_SECONDS = 30 * 60
DEFAULT_BUILD_POLL_INTERVAL = 30
DEFAULT_CANCEL_TIMEOUT_SECONDS = 5 * 60
DEFAULT_CANCEL_POLL_INTERVAL = 15
# Thin adapter around Spaceship::ConnectAPI (fastlane 2.241.1).
# Injected into IosReview operations so all workflow logic is unit-testable
# against in-memory fakes without requiring live ASC credentials.
class SpaceshipClient
def authenticate!(key_id:, issuer_id:, key_filepath:)
require "spaceship"
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(
key_id: key_id,
issuer_id: issuer_id,
filepath: key_filepath,
)
end
def find_app(bundle_id)
Spaceship::ConnectAPI::App.find(bundle_id)
end
def live_version(app)
app.get_live_app_store_version(platform: PLATFORM_IOS, includes: "build")
end
def ios_versions(app, states:)
app.get_app_store_versions(
filter: {
platform: PLATFORM_IOS,
appVersionState: states.join(","),
},
includes: "build",
)
end
def get_app_store_version(app_store_version_id)
Spaceship::ConnectAPI::AppStoreVersion.get(
app_store_version_id: app_store_version_id,
includes: "build",
)
end
def review_submissions(app, states:)
app.get_review_submissions(
filter: {
platform: PLATFORM_IOS,
state: states.join(","),
},
includes: "appStoreVersionForReview",
)
end
def get_review_submission(review_submission_id)
Spaceship::ConnectAPI::ReviewSubmission.get(
review_submission_id: review_submission_id,
includes: "appStoreVersionForReview",
)
end
def cancel_review_submission(submission)
submission.cancel_submission
end
def find_ios_builds(app, version: nil, build_number: nil)
if version.nil? && build_number.nil?
return recent_ios_builds(app, limit: 25)
end
Spaceship::ConnectAPI::Build.all(
app_id: app.id,
version: version,
build_number: build_number,
platform: PLATFORM_IOS,
sort: "-uploadedDate",
limit: 100,
)
end
def recent_ios_builds(app, limit: 5)
fetch_limit = [limit * 4, 25].max
builds = Spaceship::ConnectAPI.get_builds(
filter: { app: app.id },
includes: "preReleaseVersion",
sort: "-uploadedDate",
limit: fetch_limit,
).to_models
builds.select { |b| b.pre_release_version&.platform == PLATFORM_IOS }.first(limit)
end
end
module_function
def parse_bool(value)
value.to_s.strip.casecmp("true").zero?
end
def normalize_optional_string(value)
str = value.to_s.strip
str.empty? ? nil : str
end
def version_state(version)
return nil if version.nil?
state = version.respond_to?(:app_version_state) ? version.app_version_state : nil
state = nil if state.to_s.strip.empty?
return state unless state.nil?
fallback = version.respond_to?(:app_store_state) ? version.app_store_state : nil
fallback.to_s.strip.empty? ? nil : fallback
end
def blocking_version_state?(state)
BLOCKING_VERSION_STATES.include?(state.to_s)
end
def sort_versions_descending(versions)
versions.sort_by do |version|
begin
Gem::Version.new(version.version_string.to_s)
rescue ArgumentError
Gem::Version.new("0")
end
end.reverse
end
def find_blocking_review(client:, app:)
versions = client.ios_versions(app, states: BLOCKING_API_VERSION_STATES)
.select { |v| blocking_version_state?(version_state(v)) }
if !versions.empty?
version = sort_versions_descending(versions).first
return {
source: :app_store_version,
version: version.version_string,
state: version_state(version),
build: version.respond_to?(:build) ? version.build&.version : nil,
version_record: version,
}
end
submissions = client.review_submissions(app, states: IN_FLIGHT_SUBMISSION_STATES)
.select { |s| IN_FLIGHT_SUBMISSION_STATES.include?(s.state.to_s) }
if !submissions.empty?
submission = submissions.first
assoc_version = submission.respond_to?(:app_store_version_for_review) ? submission.app_store_version_for_review : nil
return {
source: :review_submission,
version: assoc_version&.version_string || "unknown",
state: submission.state,
build: assoc_version&.respond_to?(:build) ? assoc_version.build&.version : nil,
submission: submission,
version_record: assoc_version,
}
end
nil
end
def wait_for_valid_build(
client:,
app:,
target_version:,
target_build:,
ui:,
timeout_seconds: DEFAULT_BUILD_TIMEOUT_SECONDS,
poll_interval: DEFAULT_BUILD_POLL_INTERVAL,
sleep_fn: Kernel.method(:sleep),
clock: Time.method(:now)
)
if target_version
ui.message("Targeting App Store version #{target_version}#{target_build ? " build #{target_build}" : ""} from workflow input")
else
ui.message("No APP_VERSION provided; selecting the most recently uploaded iOS build")
end
deadline = clock.call + timeout_seconds
loop do
builds = client.find_ios_builds(app, version: target_version, build_number: target_build)
.select { |b| b.pre_release_version&.platform == PLATFORM_IOS }
builds = builds.select { |b| b.pre_release_version&.version == target_version } if target_version
builds = builds.select { |b| b.version.to_s == target_build.to_s } if target_build
build = builds.first
if build.nil?
if clock.call >= deadline
ui.user_error!("Timed out waiting for build to appear on App Store Connect.")
end
ui.message("No matching iOS build visible on App Store Connect yet; waiting...")
sleep_fn.call(poll_interval)
next
end
state = build.processing_state
ui.message("Build #{build.pre_release_version.version} (#{build.version}) processing state: #{state || 'unknown'}")
return build if state == "VALID"
if state == "INVALID" || state == "FAILED"
ui.user_error!("Build #{build.version} failed App Store processing (state: #{state}).")
end
if clock.call >= deadline
ui.user_error!("Timed out waiting for build #{build.version} to finish processing on App Store Connect.")
end
sleep_fn.call(poll_interval)
end
end
def resolve_waiting_build_summary(client:, app:, target_version:, target_build:)
return [target_version, target_build] if target_version && target_build
builds = client.find_ios_builds(app, version: target_version, build_number: target_build)
.select { |b| b.pre_release_version&.platform == PLATFORM_IOS }
builds = builds.select { |b| b.pre_release_version&.version == target_version } if target_version
builds = builds.select { |b| b.version.to_s == target_build.to_s } if target_build
latest = builds.first
[
target_version || latest&.pre_release_version&.version || "unknown",
target_build || latest&.version&.to_s || "unknown",
]
end
def submit_review(
client:,
app:,
ui:,
deliver_runner:,
target_version: nil,
target_build: nil,
replace_in_review: false,
build_timeout_seconds: DEFAULT_BUILD_TIMEOUT_SECONDS,
build_poll_interval: DEFAULT_BUILD_POLL_INTERVAL,
cancel_timeout_seconds: DEFAULT_CANCEL_TIMEOUT_SECONDS,
cancel_poll_interval: DEFAULT_CANCEL_POLL_INTERVAL,
sleep_fn: Kernel.method(:sleep),
clock: Time.method(:now)
)
target_version = normalize_optional_string(target_version)
target_build = normalize_optional_string(target_build)
blocking = find_blocking_review(client: client, app: app)
if blocking && !replace_in_review
return emit_skipped_result(
client: client,
app: app,
ui: ui,
blocking: blocking,
target_version: target_version,
target_build: target_build,
)
end
valid_build = wait_for_valid_build(
client: client,
app: app,
target_version: target_version,
target_build: target_build,
ui: ui,
timeout_seconds: build_timeout_seconds,
poll_interval: build_poll_interval,
sleep_fn: sleep_fn,
clock: clock,
)
app_version = valid_build.pre_release_version.version
build_number = valid_build.version.to_s
if replace_in_review
cancel_result = cancel_review(
client: client,
app: app,
ui: ui,
expected_version: nil,
timeout_seconds: cancel_timeout_seconds,
poll_interval: cancel_poll_interval,
sleep_fn: sleep_fn,
clock: clock,
)
if cancel_result[:status] == :canceled
ui.message("Proceeding to submit replacement build #{build_number} as App Store version #{app_version}")
end
else
# Re-check after waiting for TestFlight processing so a review submitted
# in the meantime is never disturbed.
post_wait_blocking = find_blocking_review(client: client, app: app)
if post_wait_blocking
return emit_skipped_result(
client: client,
app: app,
ui: ui,
blocking: post_wait_blocking,
target_version: app_version,
target_build: build_number,
)
end
# Fastlane's Deliver::SubmitForReview#create_review_submission fails if a
# prior rejected ReviewSubmission remains in UNRESOLVED_ISSUES. Clear only
# UNRESOLVED_ISSUES submissions here while keeping reject_if_possible: false
# so an in-flight WAITING_FOR_REVIEW or IN_REVIEW submission is never cancelled.
clear_unresolved_issues_submissions(
client: client,
app: app,
ui: ui,
timeout_seconds: cancel_timeout_seconds,
poll_interval: cancel_poll_interval,
sleep_fn: sleep_fn,
clock: clock,
)
end
ui.message("Submitting build #{build_number} as App Store version #{app_version} for review (reject_if_possible=#{replace_in_review})")
deliver_runner.call(
app_version: app_version,
build_number: build_number,
reject_if_possible: replace_in_review,
)
{
status: :submitted,
app_version: app_version,
build_number: build_number,
reject_if_possible: replace_in_review,
}
end
def emit_skipped_result(client:, app:, ui:, blocking:, target_version:, target_build:)
waiting_version, waiting_build = resolve_waiting_build_summary(
client: client,
app: app,
target_version: target_version,
target_build: target_build,
)
summary = "IOS_REVIEW_SKIPPED in_review_version=#{blocking[:version]} in_review_state=#{blocking[:state]} waiting_version=#{waiting_version} waiting_build=#{waiting_build}"
ui.important(summary)
ui.message(
"Leaving iOS App Store version #{blocking[:version]} (#{blocking[:state]}) untouched. " \
"TestFlight build #{waiting_version} (#{waiting_build}) is ready to submit later via " \
"resubmit-ios-review.yml (or with replace_in_review=true to replace the in-flight review).",
)
{
status: :skipped,
summary: summary,
in_review_version: blocking[:version],
in_review_state: blocking[:state],
waiting_version: waiting_version,
waiting_build: waiting_build,
}
end
def clear_unresolved_issues_submissions(
client:,
app:,
ui:,
timeout_seconds: DEFAULT_CANCEL_TIMEOUT_SECONDS,
poll_interval: DEFAULT_CANCEL_POLL_INTERVAL,
sleep_fn: Kernel.method(:sleep),
clock: Time.method(:now)
)
stale_submissions = client.review_submissions(app, states: UNRESOLVED_SUBMISSION_STATES)
.select { |s| UNRESOLVED_SUBMISSION_STATES.include?(s.state.to_s) }
stale_submissions.each do |submission|
assoc_version = submission.respond_to?(:app_store_version_for_review) ? submission.app_store_version_for_review : nil
ui.message(
"Clearing stale rejected review submission #{submission.id} " \
"(version #{assoc_version&.version_string || 'unknown'}, state: #{submission.state}) before submitting...",
)
client.cancel_review_submission(submission)
wait_for_submission_cancellation(
client: client,
submission: submission,
assoc_version: assoc_version,
ui: ui,
timeout_seconds: timeout_seconds,
poll_interval: poll_interval,
sleep_fn: sleep_fn,
clock: clock,
)
end
end
def wait_for_submission_cancellation(
client:,
submission:,
assoc_version:,
ui:,
timeout_seconds:,
poll_interval:,
sleep_fn:,
clock:
)
deadline = clock.call + timeout_seconds
final_submission_state = submission.state
final_version_state = version_state(assoc_version)
loop do
refreshed = client.get_review_submission(submission.id)
final_submission_state = refreshed ? refreshed.state : "COMPLETE"
submission_done = refreshed.nil? || !CANCELLABLE_SUBMISSION_STATES.include?(refreshed.state.to_s)
version_done = true
if assoc_version&.id
refreshed_version = client.get_app_store_version(assoc_version.id)
final_version_state = version_state(refreshed_version) || final_version_state
version_done = !%w[WAITING_FOR_REVIEW IN_REVIEW].include?(final_version_state.to_s)
end
return [final_submission_state, final_version_state] if submission_done && version_done
if clock.call >= deadline
ui.user_error!(
"Timed out waiting for iOS review submission #{submission.id} cancellation to complete " \
"(submission_state=#{final_submission_state}, version_state=#{final_version_state || 'unknown'}).",
)
end
ui.message("Waiting for cancellation to take effect (submission=#{final_submission_state}, version=#{final_version_state || 'unknown'})...")
sleep_fn.call(poll_interval)
end
end
def cancel_review(
client:,
app:,
ui:,
expected_version: nil,
timeout_seconds: DEFAULT_CANCEL_TIMEOUT_SECONDS,
poll_interval: DEFAULT_CANCEL_POLL_INTERVAL,
sleep_fn: Kernel.method(:sleep),
clock: Time.method(:now)
)
expected_version = normalize_optional_string(expected_version)
submissions = client.review_submissions(app, states: CANCELLABLE_SUBMISSION_STATES)
.select { |s| CANCELLABLE_SUBMISSION_STATES.include?(s.state.to_s) }
blocking_versions = client.ios_versions(app, states: BLOCKING_API_VERSION_STATES)
.select { |v| blocking_version_state?(version_state(v)) }
if submissions.empty?
non_cancellable = sort_versions_descending(blocking_versions).first
if non_cancellable
state = version_state(non_cancellable)
ui.user_error!(
"Cannot cancel iOS App Store version #{non_cancellable.version_string} (state: #{state}): " \
"no cancellable review submission is in progress on App Store Connect.",
)
end
suffix = expected_version ? " expected_version=#{expected_version}" : ""
summary = "IOS_REVIEW_CANCEL_NOOP reason=no_active_review#{suffix}"
ui.message(summary)
ui.message("No iOS App Store review submission is currently in flight.")
return { status: :noop, summary: summary }
end
submission = submissions.first
assoc_version = submission.respond_to?(:app_store_version_for_review) ? submission.app_store_version_for_review : nil
if assoc_version.nil?
assoc_version = sort_versions_descending(blocking_versions).find do |v|
%w[WAITING_FOR_REVIEW IN_REVIEW].include?(version_state(v))
end
end
active_version = assoc_version&.version_string
if expected_version && active_version != expected_version
ui.user_error!(
"Refusing to cancel iOS review: expected version #{expected_version}, " \
"but active review submission #{submission.id} is for version #{active_version || 'unknown'} (state: #{submission.state}).",
)
end
if submission.state == "CANCELING"
ui.message("Review submission #{submission.id} (version #{active_version || 'unknown'}) is already CANCELING; waiting for completion...")
else
ui.message("Cancelling iOS review submission #{submission.id} for version #{active_version || 'unknown'} (state: #{submission.state})...")
client.cancel_review_submission(submission)
end
final_submission_state, final_version_state = wait_for_submission_cancellation(
client: client,
submission: submission,
assoc_version: assoc_version,
ui: ui,
timeout_seconds: timeout_seconds,
poll_interval: poll_interval,
sleep_fn: sleep_fn,
clock: clock,
)
summary = "IOS_REVIEW_CANCELED version=#{active_version || 'unknown'} submission_id=#{submission.id} submission_state=#{final_submission_state} version_state=#{final_version_state || 'unknown'}"
ui.success(summary)
{
status: :canceled,
summary: summary,
version: active_version,
submission_id: submission.id,
submission_state: final_submission_state,
version_state: final_version_state,
}
end
def review_status(client:, app:, ui:, app_identifier: "sh.paseo", recent_build_limit: 5)
live = client.live_version(app)
active_versions = sort_versions_descending(
client.ios_versions(app, states: ACTIVE_API_VERSION_STATES),
)
active_submissions = client.review_submissions(app, states: STATUS_SUBMISSION_STATES)
recent_builds = client.recent_ios_builds(app, limit: recent_build_limit)
lines = ["=== iOS App Store Review Status (#{app_identifier}) ==="]
lines << "Live App Store version:"
if live
lines << format_version_line(live)
else
lines << " (none)"
end
lines << "Active / pending App Store versions:"
if active_versions.empty?
lines << " (none)"
else
active_versions.each { |v| lines << format_version_line(v) }
end
lines << "Active review submissions:"
if active_submissions.empty?
lines << " (none)"
else
active_submissions.each do |s|
assoc = s.respond_to?(:app_store_version_for_review) ? s.app_store_version_for_review : nil
submitted = s.respond_to?(:submitted_date) && s.submitted_date ? s.submitted_date : "none"
lines << " id=#{s.id} | version=#{assoc&.version_string || 'unknown'} | state=#{s.state} | submitted_date=#{submitted}"
end
end
lines << "Recent iOS TestFlight builds (top #{recent_build_limit}):"
if recent_builds.empty?
lines << " (none)"
else
recent_builds.each_with_index do |b, idx|
ver = b.pre_release_version&.version || "unknown"
lines << " #{idx + 1}. version=#{ver} | build=#{b.version} | processing_state=#{b.processing_state || 'unknown'} | uploaded_date=#{b.uploaded_date || 'unknown'}"
end
end
report = lines.join("\n")
ui.message(report)
{
live_version: live,
active_versions: active_versions,
active_submissions: active_submissions,
recent_builds: recent_builds,
report: report,
}
end
def format_version_line(version)
state = version_state(version) || "unknown"
build_number = version.respond_to?(:build) ? version.build&.version : nil
" version=#{version.version_string} | state=#{state} | build=#{build_number || 'none'}"
end
end
+595
View File
@@ -0,0 +1,595 @@
# frozen_string_literal: true
require "minitest/autorun"
require_relative "ios_review"
class IosReviewTest < Minitest::Test
FakeApp = Struct.new(:id, :bundle_id, keyword_init: true)
FakePreReleaseVersion = Struct.new(:version, :platform, keyword_init: true)
FakeBuild = Struct.new(:version, :processing_state, :uploaded_date, :pre_release_version, keyword_init: true)
FakeAppStoreVersion = Struct.new(:id, :version_string, :app_version_state, :app_store_state, :build, keyword_init: true)
FakeReviewSubmission = Struct.new(:id, :state, :submitted_date, :app_store_version_for_review, keyword_init: true)
class FakeUserError < StandardError; end
class FakeUI
attr_reader :messages, :importants, :successes
def initialize
@messages = []
@importants = []
@successes = []
end
def message(text)
@messages << text
end
def important(text)
@importants << text
end
def success(text)
@successes << text
end
def user_error!(text)
raise FakeUserError, text
end
end
class FakeClock
attr_reader :now
def initialize(start = 1_000)
@now = start
end
def call
@now
end
def advance(seconds)
@now += seconds
end
end
# In-memory fake matching the SpaceshipClient surface.
class FakeClient
attr_accessor :live_version_record, :versions, :submissions, :builds
attr_reader :canceled_submission_ids, :queried_version_state_filters, :queried_submission_state_filters
def initialize(
live_version_record: nil,
versions: [],
submissions: [],
builds: [],
submission_poll_states: nil,
version_poll_states: nil
)
@live_version_record = live_version_record
@versions = versions
@submissions = submissions
@builds = builds
@submission_poll_states = submission_poll_states || {}
@version_poll_states = version_poll_states || {}
@canceled_submission_ids = []
@queried_version_state_filters = []
@queried_submission_state_filters = []
end
def live_version(_app)
@live_version_record
end
def ios_versions(_app, states:)
@queried_version_state_filters << states
@versions.select do |v|
state = IosReview.version_state(v)
states.include?(state) || (state == "PROCESSING_FOR_APP_STORE" && states.include?("PROCESSING_FOR_DISTRIBUTION"))
end
end
def get_app_store_version(app_store_version_id)
version = @versions.find { |v| v.id == app_store_version_id }
return nil if version.nil?
queue = @version_poll_states[app_store_version_id]
if queue && !queue.empty?
next_state = queue.shift
version.app_version_state = next_state
end
version
end
def review_submissions(_app, states:)
@queried_submission_state_filters << states
@submissions.select { |s| states.include?(s.state) }
end
def get_review_submission(review_submission_id)
submission = @submissions.find { |s| s.id == review_submission_id }
return nil if submission.nil?
queue = @submission_poll_states[review_submission_id]
if queue && !queue.empty?
submission.state = queue.shift
end
submission
end
def cancel_review_submission(submission)
@canceled_submission_ids << submission.id
submission.state = "CANCELING"
submission
end
def find_ios_builds(_app, version: nil, build_number: nil)
result = @builds.select { |b| b.pre_release_version&.platform == "IOS" }
result = result.select { |b| b.pre_release_version&.version == version } if version
result = result.select { |b| b.version.to_s == build_number.to_s } if build_number
result
end
def recent_ios_builds(_app, limit: 5)
@builds.select { |b| b.pre_release_version&.platform == "IOS" }.first(limit)
end
end
def setup
@app = FakeApp.new(id: "app-1", bundle_id: "sh.paseo")
@ui = FakeUI.new
@clock = FakeClock.new
@sleep_fn = lambda { |seconds| @clock.advance(seconds) }
end
def make_build(version, build_number, processing_state: "VALID", uploaded_date: "2026-11-27T10:00:00Z", platform: "IOS")
FakeBuild.new(
version: build_number,
processing_state: processing_state,
uploaded_date: uploaded_date,
pre_release_version: FakePreReleaseVersion.new(version: version, platform: platform),
)
end
def test_submit_review_skips_when_blocking_version_is_in_flight_by_default
blocking_states = %w[
WAITING_FOR_REVIEW
IN_REVIEW
PENDING_DEVELOPER_RELEASE
PENDING_APPLE_RELEASE
PROCESSING_FOR_DISTRIBUTION
PROCESSING_FOR_APP_STORE
WAITING_FOR_EXPORT_COMPLIANCE
ACCEPTED
]
blocking_states.each do |state|
ui = FakeUI.new
in_flight = if state == "PROCESSING_FOR_APP_STORE"
FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: nil, app_store_state: state)
else
FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: state)
end
client = FakeClient.new(
versions: [in_flight],
builds: [make_build("0.18.1", "18001999")],
)
deliver_calls = []
result = IosReview.submit_review(
client: client,
app: @app,
ui: ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: false,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :skipped, result[:status], "Expected skip for blocking state #{state}"
assert_equal "0.18.0", result[:in_review_version]
assert_equal state, result[:in_review_state]
assert_equal "0.18.1", result[:waiting_version]
assert_equal "18001999", result[:waiting_build]
assert_empty client.canceled_submission_ids, "Must never cancel when replace_in_review is false (#{state})"
assert_empty deliver_calls, "Must not invoke deliver when skipping (#{state})"
assert_includes ui.importants.first, "IOS_REVIEW_SKIPPED in_review_version=0.18.0 in_review_state=#{state} waiting_version=0.18.1 waiting_build=18001999"
end
end
def test_submit_review_never_sends_deprecated_app_store_state_in_api_filter
client = FakeClient.new(
versions: [FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "READY_FOR_DISTRIBUTION")],
builds: [make_build("0.18.1", "18001999")],
)
IosReview.submit_review(
client: client,
app: @app,
ui: @ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: false,
deliver_runner: ->(_args) {},
sleep_fn: @sleep_fn,
clock: @clock,
)
client.queried_version_state_filters.each do |states|
refute_includes states, "PROCESSING_FOR_APP_STORE"
refute_includes states, "READY_FOR_SALE"
end
end
def test_submit_review_skips_and_resolves_latest_testflight_build_when_inputs_unset
in_flight = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "IN_REVIEW")
client = FakeClient.new(
versions: [in_flight],
builds: [make_build("0.18.2", "18002999")],
)
deliver_calls = []
result = IosReview.submit_review(
client: client,
app: @app,
ui: @ui,
target_version: "",
target_build: "",
replace_in_review: false,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :skipped, result[:status]
assert_equal "0.18.2", result[:waiting_version]
assert_equal "18002999", result[:waiting_build]
assert_empty client.canceled_submission_ids
assert_empty deliver_calls
assert_includes @ui.importants.first, "IOS_REVIEW_SKIPPED in_review_version=0.18.0 in_review_state=IN_REVIEW waiting_version=0.18.2 waiting_build=18002999"
end
def test_submit_review_auto_submits_when_slot_is_free
free_states = %w[
READY_FOR_DISTRIBUTION
READY_FOR_SALE
PREPARE_FOR_SUBMISSION
DEVELOPER_REJECTED
REJECTED
METADATA_REJECTED
]
free_states.each do |state|
ui = FakeUI.new
existing = FakeAppStoreVersion.new(
id: "v-1",
version_string: "0.18.0",
app_version_state: state == "READY_FOR_SALE" ? nil : state,
app_store_state: state == "READY_FOR_SALE" ? state : nil,
)
client = FakeClient.new(
versions: [existing],
builds: [make_build("0.18.1", "18001999")],
)
deliver_calls = []
result = IosReview.submit_review(
client: client,
app: @app,
ui: ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: false,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :submitted, result[:status], "Expected auto-submit when state is #{state}"
assert_equal false, result[:reject_if_possible]
assert_empty client.canceled_submission_ids
assert_equal [{ app_version: "0.18.1", build_number: "18001999", reject_if_possible: false }], deliver_calls
end
end
def test_submit_review_clears_stale_unresolved_issues_submission_on_rejected_version_by_default
rejected = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "REJECTED")
stale_submission = FakeReviewSubmission.new(
id: "sub-rejected",
state: "UNRESOLVED_ISSUES",
app_store_version_for_review: rejected,
)
client = FakeClient.new(
versions: [rejected],
submissions: [stale_submission],
builds: [make_build("0.18.1", "18001999")],
submission_poll_states: { "sub-rejected" => %w[CANCELING COMPLETE] },
version_poll_states: { "v-1" => %w[REJECTED DEVELOPER_REJECTED] },
)
deliver_calls = []
result = IosReview.submit_review(
client: client,
app: @app,
ui: @ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: false,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :submitted, result[:status]
assert_equal false, result[:reject_if_possible]
assert_equal ["sub-rejected"], client.canceled_submission_ids
assert_equal "COMPLETE", stale_submission.state
assert_equal [{ app_version: "0.18.1", build_number: "18001999", reject_if_possible: false }], deliver_calls
end
def test_submit_review_skips_if_review_starts_while_waiting_for_build_processing
processing_build = make_build("0.18.1", "18001999", processing_state: "PROCESSING")
client = FakeClient.new(versions: [], submissions: [], builds: [processing_build])
deliver_calls = []
sleep_and_start_review = lambda do |seconds|
@clock.advance(seconds)
processing_build.processing_state = "VALID"
client.versions << FakeAppStoreVersion.new(id: "v-race", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
end
result = IosReview.submit_review(
client: client,
app: @app,
ui: @ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: false,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: sleep_and_start_review,
clock: @clock,
)
assert_equal :skipped, result[:status]
assert_equal "0.18.0", result[:in_review_version]
assert_equal "WAITING_FOR_REVIEW", result[:in_review_state]
assert_empty client.canceled_submission_ids
assert_empty deliver_calls
assert_includes @ui.importants.first, "IOS_REVIEW_SKIPPED in_review_version=0.18.0 in_review_state=WAITING_FOR_REVIEW waiting_version=0.18.1 waiting_build=18001999"
end
def test_submit_review_with_replace_in_review_cancels_after_validating_build_and_passes_reject_if_possible
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "IN_REVIEW")
submission = FakeReviewSubmission.new(id: "sub-1", state: "IN_REVIEW", app_store_version_for_review: in_flight_version)
client = FakeClient.new(
versions: [in_flight_version],
submissions: [submission],
builds: [make_build("0.18.1", "18001999", processing_state: "VALID")],
submission_poll_states: { "sub-1" => %w[CANCELING COMPLETE] },
version_poll_states: { "v-1" => %w[IN_REVIEW DEVELOPER_REJECTED] },
)
deliver_calls = []
result = IosReview.submit_review(
client: client,
app: @app,
ui: @ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: true,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :submitted, result[:status]
assert_equal true, result[:reject_if_possible]
assert_equal ["sub-1"], client.canceled_submission_ids
assert_equal "DEVELOPER_REJECTED", in_flight_version.app_version_state
assert_equal [{ app_version: "0.18.1", build_number: "18001999", reject_if_possible: true }], deliver_calls
end
def test_submit_review_with_replace_in_review_does_not_cancel_if_replacement_build_is_invalid
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
submission = FakeReviewSubmission.new(id: "sub-1", state: "WAITING_FOR_REVIEW", app_store_version_for_review: in_flight_version)
client = FakeClient.new(
versions: [in_flight_version],
submissions: [submission],
builds: [make_build("0.18.1", "18001999", processing_state: "INVALID")],
)
deliver_calls = []
error = assert_raises(FakeUserError) do
IosReview.submit_review(
client: client,
app: @app,
ui: @ui,
target_version: "0.18.1",
target_build: "18001999",
replace_in_review: true,
deliver_runner: ->(args) { deliver_calls << args },
sleep_fn: @sleep_fn,
clock: @clock,
)
end
assert_match(/failed App Store processing/, error.message)
assert_empty client.canceled_submission_ids, "Must not cancel active review if replacement build is INVALID"
assert_empty deliver_calls
end
def test_cancel_review_cancels_active_submission_and_logs_resulting_state
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
submission = FakeReviewSubmission.new(id: "sub-99", state: "WAITING_FOR_REVIEW", app_store_version_for_review: in_flight_version)
client = FakeClient.new(
versions: [in_flight_version],
submissions: [submission],
submission_poll_states: { "sub-99" => %w[CANCELING COMPLETE] },
version_poll_states: { "v-1" => %w[WAITING_FOR_REVIEW DEVELOPER_REJECTED] },
)
result = IosReview.cancel_review(
client: client,
app: @app,
ui: @ui,
expected_version: "0.18.0",
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :canceled, result[:status]
assert_equal "0.18.0", result[:version]
assert_equal "sub-99", result[:submission_id]
assert_equal "COMPLETE", result[:submission_state]
assert_equal "DEVELOPER_REJECTED", result[:version_state]
assert_equal ["sub-99"], client.canceled_submission_ids
assert_includes @ui.successes.last, "IOS_REVIEW_CANCELED version=0.18.0 submission_id=sub-99 submission_state=COMPLETE version_state=DEVELOPER_REJECTED"
end
def test_cancel_review_refuses_on_expected_version_mismatch
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.1", app_version_state: "IN_REVIEW")
submission = FakeReviewSubmission.new(id: "sub-99", state: "IN_REVIEW", app_store_version_for_review: in_flight_version)
client = FakeClient.new(
versions: [in_flight_version],
submissions: [submission],
)
error = assert_raises(FakeUserError) do
IosReview.cancel_review(
client: client,
app: @app,
ui: @ui,
expected_version: "0.18.0",
sleep_fn: @sleep_fn,
clock: @clock,
)
end
assert_match(/expected version 0\.18\.0.*version 0\.18\.1/i, error.message)
assert_empty client.canceled_submission_ids
end
def test_cancel_review_exits_cleanly_when_no_review_is_in_flight
client = FakeClient.new(versions: [], submissions: [])
result = IosReview.cancel_review(
client: client,
app: @app,
ui: @ui,
expected_version: "0.18.0",
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :noop, result[:status]
assert_empty client.canceled_submission_ids
assert_includes @ui.messages.first, "IOS_REVIEW_CANCEL_NOOP reason=no_active_review expected_version=0.18.0"
end
def test_cancel_review_errors_clearly_when_version_is_already_pending_release
pending = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "PENDING_APPLE_RELEASE")
client = FakeClient.new(versions: [pending], submissions: [])
error = assert_raises(FakeUserError) do
IosReview.cancel_review(
client: client,
app: @app,
ui: @ui,
expected_version: "0.18.0",
sleep_fn: @sleep_fn,
clock: @clock,
)
end
assert_match(/Cannot cancel iOS App Store version 0\.18\.0 \(state: PENDING_APPLE_RELEASE\)/, error.message)
assert_empty client.canceled_submission_ids
end
def test_cancel_review_waits_without_duplicate_cancel_when_already_canceling
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
submission = FakeReviewSubmission.new(id: "sub-5", state: "CANCELING", app_store_version_for_review: in_flight_version)
client = FakeClient.new(
versions: [in_flight_version],
submissions: [submission],
submission_poll_states: { "sub-5" => %w[COMPLETE] },
version_poll_states: { "v-1" => %w[DEVELOPER_REJECTED] },
)
result = IosReview.cancel_review(
client: client,
app: @app,
ui: @ui,
sleep_fn: @sleep_fn,
clock: @clock,
)
assert_equal :canceled, result[:status]
assert_empty client.canceled_submission_ids
assert_equal "DEVELOPER_REJECTED", result[:version_state]
end
def test_review_status_formats_live_active_submissions_and_top_five_testflight_builds
live = FakeAppStoreVersion.new(
id: "v-live",
version_string: "0.17.1",
app_version_state: "READY_FOR_DISTRIBUTION",
build: FakeBuild.new(version: "17001999"),
)
active = FakeAppStoreVersion.new(
id: "v-active",
version_string: "0.18.0",
app_version_state: "WAITING_FOR_REVIEW",
build: FakeBuild.new(version: "18000999"),
)
submission = FakeReviewSubmission.new(
id: "sub-10",
state: "WAITING_FOR_REVIEW",
submitted_date: "2026-11-26T12:00:00Z",
app_store_version_for_review: active,
)
builds = [
make_build("0.18.2", "18002999", processing_state: "PROCESSING", uploaded_date: "2026-11-27T11:00:00Z"),
make_build("0.18.1", "18001999", processing_state: "VALID", uploaded_date: "2026-11-27T09:00:00Z"),
make_build("0.18.0", "18000999", processing_state: "VALID", uploaded_date: "2026-11-26T11:30:00Z"),
make_build("0.18.0", "18000001", processing_state: "VALID", uploaded_date: "2026-11-25T10:00:00Z"),
make_build("0.17.1", "17001999", processing_state: "VALID", uploaded_date: "2026-11-20T08:00:00Z"),
make_build("0.17.0", "17000999", processing_state: "VALID", uploaded_date: "2026-11-15T08:00:00Z"),
]
client = FakeClient.new(
live_version_record: live,
versions: [live, active],
submissions: [submission],
builds: builds,
)
result = IosReview.review_status(client: client, app: @app, ui: @ui)
report = result[:report]
assert_equal 5, result[:recent_builds].length
assert_includes report, "=== iOS App Store Review Status (sh.paseo) ==="
assert_includes report, "version=0.17.1 | state=READY_FOR_DISTRIBUTION | build=17001999"
assert_includes report, "version=0.18.0 | state=WAITING_FOR_REVIEW | build=18000999"
assert_includes report, "id=sub-10 | version=0.18.0 | state=WAITING_FOR_REVIEW | submitted_date=2026-11-26T12:00:00Z"
assert_includes report, "1. version=0.18.2 | build=18002999 | processing_state=PROCESSING | uploaded_date=2026-11-27T11:00:00Z"
assert_includes report, "5. version=0.17.1 | build=17001999 | processing_state=VALID | uploaded_date=2026-11-20T08:00:00Z"
refute_includes report, "0.17.0"
end
def test_review_status_formats_empty_sections_cleanly
client = FakeClient.new
result = IosReview.review_status(client: client, app: @app, ui: @ui)
report = result[:report]
assert_equal 4, report.scan(" (none)").length
end
end
@@ -2,12 +2,16 @@ package sh.paseo.keyboard
import android.app.Activity
import android.content.Intent
import android.text.SpannableStringBuilder
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.BaseInputConnection
import android.widget.EditText
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertSame
import org.junit.Assert.assertTrue
import org.junit.Test
@@ -57,6 +61,44 @@ class TerminalArrowTest {
}
}
@Test fun customTerminalViewExposesComposingStateToHardwareArrows() {
val host = instrumentation.startActivitySync(
Intent(instrumentation.targetContext, Activity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
)
activity = host
val editable = SpannableStringBuilder("한")
lateinit var view: View
instrumentation.runOnMainSync {
view = object : View(host), ComposingTextOwner {
init {
isFocusable = true
isFocusableInTouchMode = true
setTag(com.facebook.react.R.id.view_tag_native_id, "paseo-terminal-input")
// Mirrors React Native BaseViewManager.setTestId, which overwrites the unkeyed View tag.
setTag("terminal-native-input")
}
override fun isComposingText(): Boolean =
BaseInputConnection.getComposingSpanStart(editable) >= 0
}
host.setContentView(view)
view.requestFocus()
HardwareKeyboard.observe(host.window)
}
instrumentation.waitForIdleSync()
instrumentation.runOnMainSync {
assertSame(view, host.window.currentFocus)
// When not composing, hardware arrows are claimed for the terminal.
assertTrue(host.window.callback.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT)))
assertTrue(host.window.callback.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_LEFT)))
// While composing, hardware arrows must NOT be claimed so IME candidate navigation still works.
BaseInputConnection.setComposingSpans(editable)
assertFalse(host.window.callback.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT)))
assertFalse(host.window.callback.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_LEFT)))
}
}
private fun withInput(terminal: Boolean, check: (EditText, Activity) -> Unit) {
val host = instrumentation.startActivitySync(
Intent(instrumentation.targetContext, Activity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
@@ -115,11 +115,23 @@ internal object HardwareKeyboard {
}
}
/**
* Implemented by custom non-EditText editor views so window-level hardware key dispatch can
* detect active IME composition without depending on `View.getTag()` (which React Native's
* `BaseViewManager.setTestId` overwrites with the string `testID`).
*/
interface ComposingTextOwner {
fun isComposingText(): Boolean
}
private class KeyboardWindowCallback(private val window: Window, val previous: Window.Callback) : Window.Callback by previous {
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
val focus = window.currentFocus
val editable = (focus as? EditText)?.text
val composing = editable != null && BaseInputConnection.getComposingSpanStart(editable) >= 0
val composing = when (focus) {
is ComposingTextOwner -> focus.isComposingText()
is EditText -> focus.text != null && BaseInputConnection.getComposingSpanStart(focus.text) >= 0
else -> false
}
val terminalFocused = focus?.getTag(R.id.view_tag_native_id) == TERMINAL_INPUT_NATIVE_ID
return HardwareKeyboard.dispatcher.dispatch(
event,
@@ -1,158 +0,0 @@
package sh.paseo.scroll
import android.app.Activity
import android.content.Intent
import android.os.SystemClock
import android.view.View
import android.widget.FrameLayout
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.react.uimanager.DisplayMetricsHolder
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.views.scroll.ReactScrollView
import com.facebook.react.views.scroll.ReactScrollViewManager
import com.facebook.react.views.view.ReactViewGroup
import com.facebook.soloader.SoLoader
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
/** Forward-order parent, as used by the current Android timeline, and a nested panel at its edge. */
@RunWith(AndroidJUnit4::class)
class PanelEdgeTest {
private val instrumentation = InstrumentationRegistry.getInstrumentation()
private var activity: Activity? = null
private lateinit var manager: ReactScrollViewManager
@After fun finish() {
instrumentation.runOnMainSync { activity?.finish() }
}
@Test fun panelBottomEdgeLeavesTimelineStill() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
child.scrollTo(0, 600)
assertTrue(child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
child.dispatchNestedScroll(0, 0, 0, 100, null)
child.stopNestedScroll()
assertEquals("Panel stays at its bottom", 600, child.scrollY)
assertEquals("Panel overshoot must leave timeline still", 400, parent.scrollY)
}
}
@Test fun panelTopEdgeLeavesTimelineStill() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
child.scrollTo(0, 0)
assertTrue(child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
child.dispatchNestedScroll(0, 0, 0, -100, null)
child.stopNestedScroll()
assertEquals("Panel stays at its top", 0, child.scrollY)
assertEquals("Panel overshoot must leave timeline still", 400, parent.scrollY)
}
}
@Test fun panelFlingLeavesTimelineStill() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
child.scrollTo(0, 600)
assertTrue(child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
child.dispatchNestedFling(0f, 1500f, false)
child.stopNestedScroll()
}
SystemClock.sleep(500)
instrumentation.runOnMainSync {
assertEquals("Panel fling must leave timeline still", 400, parent.scrollY)
}
}
@Test fun disablingChildNestedScrollPreventsHandoff() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
child.isNestedScrollingEnabled = false
assertEquals(false, child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
child.dispatchNestedScroll(0, 0, 0, 100, null)
assertEquals(400, parent.scrollY)
}
}
@Test fun ordinaryParentStillConsumesNestedOvershoot() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
manager.setNativeId(parent, "ordinary-scroll-parent")
assertTrue(child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
child.dispatchNestedScroll(0, 0, 0, 100, null)
child.stopNestedScroll()
assertEquals("Ordinary parent retains framework handoff", 500, parent.scrollY)
}
}
@Test fun ordinaryParentStillConsumesUnconsumedFling() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
manager.setNativeId(parent, "ordinary-scroll-parent")
child.scrollTo(0, 600)
assertTrue(child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
child.dispatchNestedFling(0f, 1500f, false)
child.stopNestedScroll()
}
SystemClock.sleep(500)
instrumentation.runOnMainSync { assertTrue(parent.scrollY > 400) }
}
@Test fun consumedPanelFlingDoesNotStartParentFling() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
assertTrue(child.startNestedScroll(View.SCROLL_AXIS_VERTICAL))
assertEquals(false, child.dispatchNestedFling(0f, 1500f, true))
child.stopNestedScroll()
assertEquals(400, parent.scrollY)
}
}
@Test fun panelInteriorScrollingLeavesTimelineStill() {
val (parent, child) = openPanel()
instrumentation.runOnMainSync {
child.scrollTo(0, 100)
assertEquals(100, child.scrollY)
assertEquals(400, parent.scrollY)
parent.scrollTo(0, 500)
assertEquals("Direct timeline scrolling remains available", 500, parent.scrollY)
}
}
private fun openPanel(): Pair<ReactScrollView, ReactScrollView> {
val started = instrumentation.startActivitySync(
Intent(instrumentation.targetContext, Activity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
)
activity = started
lateinit var parent: ReactScrollView
lateinit var child: ReactScrollView
instrumentation.runOnMainSync {
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(started)
SoLoader.init(started, OpenSourceMergedSoMapping)
val react = MountingReactContext(started.applicationContext)
val context = ThemedReactContext(react, started)
manager = PaseoScrollPackage().createViewManager(react, ReactScrollViewManager.REACT_CLASS) as ReactScrollViewManager
parent = manager.createViewInstance(context)
manager.setNativeId(parent, "agent-chat-scroll-native-virtualized")
child = manager.createViewInstance(context)
child.isNestedScrollingEnabled = true
val content = ReactViewGroup(context)
content.addView(child, FrameLayout.LayoutParams(300, 200).apply { topMargin = 400 })
parent.addView(content)
val childContent = ReactViewGroup(context)
child.addView(childContent)
started.setContentView(FrameLayout(started).apply { addView(parent, FrameLayout.LayoutParams(300, 400)) })
parent.layout(0, 0, 300, 400)
content.layout(0, 0, 300, 2000)
child.layout(0, 400, 300, 600)
childContent.layout(0, 0, 300, 800)
parent.scrollTo(0, 400)
}
return Pair(parent, child)
}
}
@@ -14,13 +14,10 @@ import com.facebook.react.views.scroll.ReactScrollView;
import com.facebook.react.views.scroll.ReactScrollViewHelper;
/**
* React Native's vertical scroll view with six corrections. Java, because the content-position
* React Native's vertical scroll view with five corrections. Java, because the content-position
* config type is internal to React Native's Kotlin module.
*/
final class PaseoScrollView extends ReactScrollView {
// The chat timeline, packages/app/src/agent-stream/strategy-native.tsx.
private static final String TIMELINE_NATIVE_ID = "agent-chat-scroll-native-virtualized";
// The chat timeline's end pin, packages/app/src/agent-stream/native-end-pin.tsx.
private static final String END_PIN_NATIVE_ID = "paseo-end-pin";
@@ -38,26 +35,6 @@ final class PaseoScrollView extends ReactScrollView {
super(context);
}
// A panel owns its gesture through its edges; remaining child motion must not move the chat
// behind it. The timeline's native identity stays present when its end pin is removed for
// reading history. Ordinary parents retain Android's nested-scroll handoff.
@Override
public void onNestedScroll(
View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
if (isTimeline()) return;
super.onNestedScroll(target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
}
@Override
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) {
if (isTimeline() && !consumed) return true;
return super.onNestedFling(target, velocityX, velocityY, consumed);
}
private boolean isTimeline() {
return TIMELINE_NATIVE_ID.equals(getTag(R.id.view_tag_native_id));
}
@Override
public void setMaintainVisibleContentPosition(
@Nullable MaintainVisibleScrollPositionHelper.Config config) {
@@ -18,6 +18,7 @@ android {
}
dependencies {
implementation project(":paseo-hardware-keyboard")
implementation "androidx.customview:customview:1.1.0"
implementation "com.facebook.react:react-android"
testImplementation "junit:junit:4.13.2"
@@ -0,0 +1,337 @@
package sh.paseo.terminal
import android.text.InputType
import android.view.KeyCharacterMap
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
/**
* Exercises `TerminalInputConnection` and `PaseoTerminalInputView` against real Android
* `SpannableStringBuilder`, `BaseInputConnection`, `EditorInfo`, and `KeyEvent` instances.
*/
@RunWith(AndroidJUnit4::class)
class TerminalInputConnectionTest {
private val instrumentation = InstrumentationRegistry.getInstrumentation()
private class RecordedTerminal {
val chunks = mutableListOf<String>()
val keys = mutableListOf<TerminalKeyPayload>()
fun write(data: String) {
chunks.add(data)
}
fun key(payload: TerminalKeyPayload) {
keys.add(payload)
}
val rawStream: String
get() = chunks.joinToString("")
/** Applies `\x7f` rubouts onto a simulated terminal line buffer to verify visible text. */
fun applyToLine(initial: String = ""): String {
val codePoints = mutableListOf<Int>()
initial.codePoints().forEach { codePoints.add(it) }
rawStream.codePoints().forEach { cp ->
if (cp == 0x7f) {
if (codePoints.isNotEmpty()) codePoints.removeAt(codePoints.lastIndex)
} else {
codePoints.add(cp)
}
}
val sb = StringBuilder()
codePoints.forEach { sb.appendCodePoint(it) }
return sb.toString()
}
}
private fun withInputHarness(
block: (View, TerminalInputConnection, EditorInfo, RecordedTerminal) -> Unit,
) {
instrumentation.runOnMainSync {
val context = instrumentation.targetContext
val terminal = RecordedTerminal()
val view = object : View(context) {
init {
isFocusable = true
isFocusableInTouchMode = true
}
}
val editorInfo = EditorInfo()
val connection = TerminalInputConnection(
targetView = view,
onInput = terminal::write,
onTerminalKey = terminal::key,
)
TerminalInputConnection.configureEditorInfo(editorInfo)
block(view, connection, editorInfo, terminal)
}
}
@Test
fun editorInfoDisablesSuggestionsFullscreenAndPersonalizedLearning() {
instrumentation.runOnMainSync {
val context = instrumentation.targetContext
val editorInfo = EditorInfo()
val view = PaseoTerminalInputView.createForTest(context)
assertTrue("Terminal input view must declare itself as a text editor", view.onCheckIsTextEditor())
assertTrue("Terminal input view must be focusable", view.isFocusable && view.isFocusableInTouchMode)
val connection = view.onCreateInputConnection(editorInfo)
assertTrue("onCreateInputConnection must return TerminalInputConnection", connection is TerminalInputConnection)
assertEquals(
InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS,
editorInfo.inputType,
)
assertEquals(EditorInfo.IME_ACTION_NONE, editorInfo.imeOptions and EditorInfo.IME_MASK_ACTION)
assertNotEquals(0, editorInfo.imeOptions and EditorInfo.IME_FLAG_NO_FULLSCREEN)
assertNotEquals(0, editorInfo.imeOptions and EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING)
}
}
@Test
fun batchedCommitTextAndSetComposingTextDoNotDoubleCharacters() {
withInputHarness { _, ic, _, terminal ->
for (ch in listOf("a", "b", "c", "d")) {
ic.beginBatchEdit()
ic.commitText(ch, 1)
ic.endBatchEdit()
}
assertEquals("abcd", terminal.rawStream)
assertEquals("", ic.editable.toString())
// Coalesced setComposingText + finishComposingText inside one batch emits once.
ic.beginBatchEdit()
ic.setComposingText("ef", 1)
ic.finishComposingText()
ic.endBatchEdit()
assertEquals("abcdef", terminal.rawStream)
assertEquals("", ic.editable.toString())
}
}
@Test
fun backspaceWorksAcrossAllThreeImePaths() {
withInputHarness { _, ic, _, terminal ->
ic.commitText("abcd", 1)
assertEquals("abcd", terminal.applyToLine())
// Path 1: deleteSurroundingText (empty editable after commit)
ic.deleteSurroundingText(0, 0)
assertEquals("abcd", terminal.applyToLine())
ic.deleteSurroundingText(1, 0)
assertEquals("abc", terminal.applyToLine())
// Path 2: deleteSurroundingTextInCodePoints (empty editable)
ic.deleteSurroundingTextInCodePoints(1, 0)
assertEquals("ab", terminal.applyToLine())
// Path 2b: deleteSurroundingTextInCodePoints on surrogate-pair emoji in composing buffer
ic.setComposingText("😀", 1)
assertEquals("ab😀", terminal.applyToLine())
ic.deleteSurroundingTextInCodePoints(1, 0)
assertEquals("ab", terminal.applyToLine())
// Path 3: sendKeyEvent(KEYCODE_DEL) emits on ACTION_DOWN only, not ACTION_UP
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL))
assertEquals("a", terminal.applyToLine())
// Multi-char deleteSurroundingText on empty buffer
ic.commitText("xyz", 1)
ic.deleteSurroundingText(2, 0)
assertEquals("ax", terminal.applyToLine())
}
}
@Test
fun hangulCompositionSyllableMigrationBackspaceAndPostEnter() {
withInputHarness { _, ic, _, terminal ->
// ㅎ -> 하 -> 한
ic.setComposingText("ㅎ", 1)
ic.setComposingText("하", 1)
ic.setComposingText("한", 1)
assertEquals("한", terminal.applyToLine())
// Final consonant migration: 한 + ㅏ -> commit 하 + compose 나 in one batch
ic.beginBatchEdit()
ic.commitText("하", 1)
ic.setComposingText("나", 1)
ic.endBatchEdit()
assertEquals("하나", terminal.applyToLine())
// Continue composing second syllable: 나 -> 난
ic.setComposingText("난", 1)
assertEquals("하난", terminal.applyToLine())
// Backspace decomposes 난 -> 나 -> ㄴ -> "" (leaving 하) -> ""
ic.setComposingText("나", 1)
assertEquals("하나", terminal.applyToLine())
ic.setComposingText("ㄴ", 1)
assertEquals("하ㄴ", terminal.applyToLine())
ic.commitText("", 1)
assertEquals("하", terminal.applyToLine())
ic.deleteSurroundingText(1, 0)
assertEquals("", terminal.applyToLine())
// Submit via Enter, then immediately type 한글 with zero stale newline residue (#7164)
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER))
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER))
ic.setComposingText("ㅎ", 1)
ic.setComposingText("하", 1)
ic.setComposingText("한", 1)
ic.beginBatchEdit()
ic.commitText("한", 1)
ic.setComposingText("ㄱ", 1)
ic.endBatchEdit()
ic.setComposingText("그", 1)
ic.setComposingText("글", 1)
ic.finishComposingText()
assertEquals("\r한글", terminal.applyToLine())
}
}
@Test
fun pinyinCompositionAndMixedChineseThenLatinCandidate() {
withInputHarness { _, ic, _, terminal ->
// Pinyin reading: nihao -> ni hao -> 你好
ic.setComposingText("n", 1)
ic.setComposingText("ni", 1)
ic.setComposingText("nih", 1)
ic.setComposingText("niha", 1)
ic.setComposingText("ni hao", 1)
ic.beginBatchEdit()
ic.commitText("你好", 1)
ic.endBatchEdit()
assertEquals("你好", terminal.applyToLine())
// WeChat Keyboard #9121: immediately compose English and pick 2nd suggestion `hello`
ic.setComposingText("h", 1)
ic.setComposingText("he", 1)
ic.setComposingText("hel", 1)
ic.beginBatchEdit()
ic.commitText("hello", 1)
ic.endBatchEdit()
assertEquals("你好hello", terminal.applyToLine())
// Backspace right after Latin candidate deletes from terminal visibly
ic.deleteSurroundingText(1, 0)
assertEquals("你好hell", terminal.applyToLine())
}
}
@Test
fun latinCandidatesAutocorrectAndRepeatedClipboardCommit() {
withInputHarness { _, ic, _, terminal ->
// Candidate completion: hel -> hello
ic.setComposingText("hel", 1)
ic.commitText("hello", 1)
assertEquals("hello", terminal.applyToLine())
// Autocorrect replacement inside composing span: teh -> the
ic.setComposingText("teh", 1)
ic.commitText("the", 1)
assertEquals("hellothe", terminal.applyToLine())
// Repeated clipboard paste of identical text works because editable clears after commit
ic.commitText("echo ok", 1)
ic.commitText("echo ok", 1)
assertEquals("hellotheecho okecho ok", terminal.applyToLine())
}
}
@Test
fun enterKeyAndEditorActionEmitSingleCarriageReturn() {
withInputHarness { _, ic, _, terminal ->
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER))
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER))
assertEquals("\r", terminal.rawStream)
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_NUMPAD_ENTER))
ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_NUMPAD_ENTER))
assertEquals("\r\r", terminal.rawStream)
ic.performEditorAction(EditorInfo.IME_ACTION_NONE)
assertEquals("\r\r\r", terminal.rawStream)
ic.commitText("\n", 1)
assertEquals("\r\r\r\r", terminal.rawStream)
}
}
@Test
fun physicalKeyboardKeysAndDeadKeyAccents() {
instrumentation.runOnMainSync {
val context = instrumentation.targetContext
val terminal = RecordedTerminal()
val view = PaseoTerminalInputView.createForTest(
context = context,
onInput = terminal::write,
onTerminalKey = terminal::key,
)
view.onCreateInputConnection(EditorInfo())
// Enter & Numpad Enter: ACTION_DOWN + ACTION_UP -> single \r each
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_ENTER, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)))
assertTrue(view.onKeyUp(KeyEvent.KEYCODE_ENTER, KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)))
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_NUMPAD_ENTER, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_NUMPAD_ENTER)))
assertTrue(view.onKeyUp(KeyEvent.KEYCODE_NUMPAD_ENTER, KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_NUMPAD_ENTER)))
assertEquals("\r\r", terminal.rawStream)
// Tab, Shift+Tab, Escape, Del
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_TAB, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_TAB)))
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_TAB, KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_TAB, 0, KeyEvent.META_SHIFT_ON)))
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_ESCAPE, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ESCAPE)))
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_DEL, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)))
assertEquals("\r\r\t\u001b[Z\u001b\u007f", terminal.rawStream)
// Ctrl+C and Alt+B
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_C, KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_C, 0, KeyEvent.META_CTRL_ON)))
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_B, KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B, 0, KeyEvent.META_ALT_ON)))
assertEquals("\r\r\t\u001b[Z\u001b\u007f\u0003\u001bb", terminal.rawStream)
// Printable key
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_A, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A)))
assertEquals("\r\r\t\u001b[Z\u001b\u007f\u0003\u001bba", terminal.rawStream)
// Dead key accent (acute + e -> é)
val deadAcuteEvent = object : KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_E) {
override fun getUnicodeChar(metaState: Int): Int =
KeyCharacterMap.COMBINING_ACCENT or '\u00b4'.code
}
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_E, deadAcuteEvent))
assertTrue(view.onKeyDown(KeyEvent.KEYCODE_E, KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_E)))
assertEquals("\r\r\t\u001b[Z\u001b\u007f\u0003\u001bbaé", terminal.rawStream)
// Meta shortcuts pass through unhandled
assertFalse(view.onKeyDown(KeyEvent.KEYCODE_TAB, KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_TAB, 0, KeyEvent.META_META_ON)))
}
}
@Test
fun composingStateIsExposedOnViewForHardwareKeyboardModule() {
instrumentation.runOnMainSync {
val context = instrumentation.targetContext
val view = PaseoTerminalInputView.createForTest(context)
// Mirrors React Native BaseViewManager.setTestId, which overwrites the unkeyed View tag.
view.setTag("terminal-native-input")
val ic = checkNotNull(view.onCreateInputConnection(EditorInfo()))
assertFalse(view.isComposingText())
ic.setComposingText("한", 1)
assertTrue(view.isComposingText())
ic.commitText("한", 1)
assertFalse(view.isComposingText())
}
}
}
@@ -1,69 +0,0 @@
package sh.paseo.terminal
import android.text.InputType
import android.view.inputmethod.EditorInfo
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.facebook.react.bridge.BridgeReactContext
import com.facebook.react.uimanager.DisplayMetricsHolder
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.views.textinput.ReactEditText
import com.facebook.react.views.textinput.ReactTextInputManager
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Test
import org.junit.runner.RunWith
/**
* Builds React Native's own text input and applies `nativeID` through its view manager, which is
* how Fabric mounts the hidden terminal input. The app runs bridgeless, so the context is too.
*/
@RunWith(AndroidJUnit4::class)
class TerminalInputKeyboardTest {
private val instrumentation = InstrumentationRegistry.getInstrumentation()
@Test fun terminalInputAsksTheKeyboardNotToLearnWhatIsTyped() {
onInput("paseo-terminal-input") { input, editorInfo ->
assertNotEquals(
"The keyboard must not learn passwords typed at a terminal prompt",
0,
editorInfo.imeOptions and EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING,
)
assertEquals(
"Suggestions stay off and the input stays multiline",
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or InputType.TYPE_TEXT_FLAG_MULTI_LINE,
editorInfo.inputType and (InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or InputType.TYPE_TEXT_FLAG_MULTI_LINE),
)
val connection = checkNotNull(input.onCreateInputConnection(EditorInfo()))
connection.setComposingText("su", 1)
connection.commitText("sudo ls", 1)
connection.deleteSurroundingText(1, 0)
assertEquals("sudo l", input.text.toString())
}
}
@Test fun otherInputsKeepPersonalizedLearning() {
onInput("message-composer") { _, editorInfo ->
assertEquals(0, editorInfo.imeOptions and EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING)
}
}
private fun onInput(nativeId: String, check: (ReactEditText, EditorInfo) -> Unit) {
TerminalInputKeyboard.install()
instrumentation.runOnMainSync {
val app = instrumentation.targetContext
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(app)
val react = object : BridgeReactContext(app) {
override fun isBridgeless() = true
}
val input = ReactEditText(ThemedReactContext(react, app, null, -1))
input.inputType = InputType.TYPE_CLASS_TEXT or
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or
InputType.TYPE_TEXT_FLAG_MULTI_LINE
ReactTextInputManager().setNativeId(input, nativeId)
val editorInfo = EditorInfo()
input.onCreateInputConnection(editorInfo)
check(input, editorInfo)
}
}
}
@@ -0,0 +1,168 @@
package sh.paseo.terminal
import android.content.Context
import android.graphics.Rect
import android.text.SpannableStringBuilder
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.BaseInputConnection
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputConnection
import android.view.inputmethod.InputMethodManager
import expo.modules.kotlin.viewevent.EventDispatcher
import sh.paseo.keyboard.ComposingTextOwner
/**
* Focusable 1x1 native Android text editor view that owns the terminal's [InputConnection] and
* physical keyboard [onKeyDown] delivery directly, bypassing React Native's `TextInput`.
*
* Implements [ComposingTextOwner] so `PaseoHardwareKeyboardModule` reads active IME composition
* reliably even after React Native's `BaseViewManager.setTestId` overwrites `View.getTag()`.
*/
class PaseoTerminalInputView(context: Context) : View(context), ComposingTextOwner {
private val onTerminalInput by EventDispatcher<Map<String, String>>()
private val onTerminalKey by EventDispatcher<Map<String, Any>>()
private val onFocusChange by EventDispatcher<Map<String, Boolean>>()
private val editable = SpannableStringBuilder()
private var inputSink: ((String) -> Unit)? = null
private var keySink: ((TerminalKeyPayload) -> Unit)? = null
private var focusSink: ((Boolean) -> Unit)? = null
private var inputConnection: TerminalInputConnection? = null
init {
isFocusable = true
isFocusableInTouchMode = true
importantForAutofill = IMPORTANT_FOR_AUTOFILL_NO
contentDescription = "Terminal input"
}
override fun isComposingText(): Boolean =
BaseInputConnection.getComposingSpanStart(editable) >= 0
override fun onCheckIsTextEditor(): Boolean = true
override fun onCreateInputConnection(outAttrs: EditorInfo): InputConnection {
TerminalInputConnection.configureEditorInfo(outAttrs)
val connection = ensureInputConnection()
connection.resetState()
return connection
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (ensureInputConnection().handleKeyDown(keyCode, event)) {
return true
}
return super.onKeyDown(keyCode, event)
}
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
if (ensureInputConnection().handleKeyUp(keyCode, event)) {
return true
}
return super.onKeyUp(keyCode, event)
}
@Suppress("DEPRECATION")
override fun onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent): Boolean {
if (ensureInputConnection().handleKeyMultiple(event)) {
return true
}
return super.onKeyMultiple(keyCode, repeatCount, event)
}
override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
if (!gainFocus) {
inputConnection?.resetState()
}
val sink = focusSink
if (sink != null) {
sink(gainFocus)
} else {
onFocusChange(mapOf("focused" to gainFocus))
}
}
fun focusInput() {
showKeyboard()
}
fun showKeyboard() {
val show: () -> Unit = {
if (!hasFocus()) {
requestFocus()
}
val imm = context.getSystemService(InputMethodManager::class.java)
imm?.showSoftInput(this, 0)
}
if (hasFocus()) {
show()
} else {
requestFocus()
post(show)
}
}
fun blurInput() {
inputConnection?.resetState()
if (hasFocus()) {
clearFocus()
}
val imm = context.getSystemService(InputMethodManager::class.java)
imm?.hideSoftInputFromWindow(windowToken, 0)
}
private fun ensureInputConnection(): TerminalInputConnection {
val existing = inputConnection
if (existing != null) return existing
val created = TerminalInputConnection(
targetView = this,
sharedEditable = editable,
onInput = ::emitInput,
onTerminalKey = ::emitKey,
)
inputConnection = created
return created
}
private fun emitInput(data: String) {
val sink = inputSink
if (sink != null) {
sink(data)
} else {
onTerminalInput(mapOf("data" to data))
}
}
private fun emitKey(payload: TerminalKeyPayload) {
val sink = keySink
if (sink != null) {
sink(payload)
} else {
onTerminalKey(
mapOf(
"key" to payload.key,
"ctrl" to payload.ctrl,
"shift" to payload.shift,
"alt" to payload.alt,
"meta" to payload.meta,
),
)
}
}
companion object {
internal fun createForTest(
context: Context,
onInput: (String) -> Unit = {},
onTerminalKey: (TerminalKeyPayload) -> Unit = {},
onFocus: (Boolean) -> Unit = {},
): PaseoTerminalInputView =
PaseoTerminalInputView(context).apply {
inputSink = onInput
keySink = onTerminalKey
focusSink = onFocus
}
}
}
@@ -7,8 +7,6 @@ class PaseoTerminalModule : Module() {
override fun definition() = ModuleDefinition {
Name("PaseoTerminal")
OnCreate { TerminalInputKeyboard.install() }
View(PaseoTerminalView::class) {
Events("onCellMetrics")
@@ -22,5 +20,13 @@ class PaseoTerminalModule : Module() {
OnViewDidUpdateProps { view: PaseoTerminalView -> view.commit() }
}
View(PaseoTerminalInputView::class) {
Events("onTerminalInput", "onTerminalKey", "onFocusChange")
AsyncFunction("focusInput") { view: PaseoTerminalInputView -> view.focusInput() }
AsyncFunction("showKeyboard") { view: PaseoTerminalInputView -> view.showKeyboard() }
AsyncFunction("blurInput") { view: PaseoTerminalInputView -> view.blurInput() }
}
}
}
@@ -0,0 +1,501 @@
package sh.paseo.terminal
import android.text.Editable
import android.text.InputType
import android.text.Selection
import android.text.SpannableStringBuilder
import android.view.KeyCharacterMap
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.BaseInputConnection
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
internal data class TerminalKeyPayload(
val key: String,
val ctrl: Boolean = false,
val shift: Boolean = false,
val alt: Boolean = false,
val meta: Boolean = false,
)
/**
* Single authoritative IME + key stream for the Android native terminal.
*
* Keeps a private [SpannableStringBuilder] so Android IMEs can compose Hangul, Pinyin, and Latin
* candidates normally, diffs the editable against what was last sent to the PTY once each batch
* edit settles, and clears the editable as soon as no composing span remains.
*/
internal class TerminalInputConnection(
private val targetView: View,
private val sharedEditable: SpannableStringBuilder = SpannableStringBuilder(),
private val onInput: (String) -> Unit,
private val onTerminalKey: (TerminalKeyPayload) -> Unit,
) : BaseInputConnection(targetView, true) {
private var batchEditDepth = 0
private var lastSentText = ""
private var pendingBackspaces = 0
private var deadAccent = 0
private var lastSelStart = 0
private var lastSelEnd = 0
private var lastCompStart = -1
private var lastCompEnd = -1
override fun getEditable(): Editable = sharedEditable
override fun beginBatchEdit(): Boolean {
batchEditDepth += 1
return super.beginBatchEdit()
}
override fun endBatchEdit(): Boolean {
val result = super.endBatchEdit()
if (batchEditDepth > 0) {
batchEditDepth -= 1
}
if (batchEditDepth == 0) {
flush()
}
return result
}
override fun setComposingText(text: CharSequence?, newCursorPosition: Int): Boolean {
val result = super.setComposingText(text, newCursorPosition)
if (batchEditDepth == 0) flush()
return result
}
override fun setComposingRegion(start: Int, end: Int): Boolean {
val result = super.setComposingRegion(start, end)
if (batchEditDepth == 0) flush()
return result
}
override fun commitText(text: CharSequence?, newCursorPosition: Int): Boolean {
val result = super.commitText(text, newCursorPosition)
if (batchEditDepth == 0) flush()
return result
}
override fun finishComposingText(): Boolean {
val result = super.finishComposingText()
if (batchEditDepth == 0) flush()
return result
}
override fun deleteSurroundingText(beforeLength: Int, afterLength: Int): Boolean {
if (beforeLength <= 0 && afterLength <= 0) return true
val lengthBefore = sharedEditable.length
val result = super.deleteSurroundingText(beforeLength, afterLength)
val deletedChars = maxOf(0, lengthBefore - sharedEditable.length)
var remaining = maxOf(0, beforeLength - deletedChars)
if (remaining > 0 && sharedEditable.isNotEmpty()) {
val toTrim = minOf(remaining, sharedEditable.length)
sharedEditable.delete(sharedEditable.length - toTrim, sharedEditable.length)
Selection.setSelection(sharedEditable, sharedEditable.length)
remaining -= toTrim
}
if (remaining > 0) {
pendingBackspaces += remaining
}
if (batchEditDepth == 0) flush()
return result
}
override fun deleteSurroundingTextInCodePoints(beforeLength: Int, afterLength: Int): Boolean {
if (beforeLength <= 0 && afterLength <= 0) return true
val codePointsBefore = Character.codePointCount(sharedEditable, 0, sharedEditable.length)
val result = super.deleteSurroundingTextInCodePoints(beforeLength, afterLength)
val codePointsAfter = Character.codePointCount(sharedEditable, 0, sharedEditable.length)
val deletedCodePoints = maxOf(0, codePointsBefore - codePointsAfter)
var remaining = maxOf(0, beforeLength - deletedCodePoints)
if (remaining > 0 && codePointsAfter > 0) {
val toTrim = minOf(remaining, codePointsAfter)
val trimStart = Character.offsetByCodePoints(sharedEditable, sharedEditable.length, -toTrim)
sharedEditable.delete(trimStart, sharedEditable.length)
Selection.setSelection(sharedEditable, sharedEditable.length)
remaining -= toTrim
}
if (remaining > 0) {
pendingBackspaces += remaining
}
if (batchEditDepth == 0) flush()
return result
}
override fun performEditorAction(editorAction: Int): Boolean {
submitEnter()
return true
}
override fun sendKeyEvent(event: KeyEvent): Boolean {
return when (event.action) {
KeyEvent.ACTION_DOWN -> handleKeyDown(event.keyCode, event)
KeyEvent.ACTION_UP -> isHandledKeyCode(event.keyCode, event)
@Suppress("DEPRECATION")
KeyEvent.ACTION_MULTIPLE -> handleKeyMultiple(event)
else -> false
}
}
override fun closeConnection() {
resetState()
super.closeConnection()
}
internal fun resetState() {
batchEditDepth = 0
pendingBackspaces = 0
deadAccent = 0
lastSentText = ""
clearEditableSilently()
lastSelStart = 0
lastSelEnd = 0
lastCompStart = -1
lastCompEnd = -1
}
internal fun handleKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (KeyEvent.isModifierKey(keyCode)) return false
if (event.isMetaPressed) return false
when (keyCode) {
KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_NUMPAD_ENTER -> {
submitEnter(altPressed = event.isAltPressed && !event.isCtrlPressed && !event.isShiftPressed)
return true
}
KeyEvent.KEYCODE_DEL -> {
handleDeleteKey(altPressed = event.isAltPressed && !event.isCtrlPressed)
return true
}
KeyEvent.KEYCODE_FORWARD_DEL -> {
deadAccent = 0
flushAndClear()
onInput("\u001b[3~")
return true
}
KeyEvent.KEYCODE_TAB -> {
deadAccent = 0
flushAndClear()
val sequence = when {
event.isShiftPressed && !event.isCtrlPressed && !event.isAltPressed -> "\u001b[Z"
event.isAltPressed && !event.isCtrlPressed -> "\u001b\t"
else -> "\t"
}
onInput(sequence)
return true
}
KeyEvent.KEYCODE_ESCAPE -> {
deadAccent = 0
flushAndClear()
onInput("\u001b")
return true
}
KeyEvent.KEYCODE_DPAD_UP,
KeyEvent.KEYCODE_DPAD_DOWN,
KeyEvent.KEYCODE_DPAD_LEFT,
KeyEvent.KEYCODE_DPAD_RIGHT -> {
deadAccent = 0
val name = when (keyCode) {
KeyEvent.KEYCODE_DPAD_UP -> "ArrowUp"
KeyEvent.KEYCODE_DPAD_DOWN -> "ArrowDown"
KeyEvent.KEYCODE_DPAD_LEFT -> "ArrowLeft"
else -> "ArrowRight"
}
onTerminalKey(
TerminalKeyPayload(
key = name,
ctrl = event.isCtrlPressed,
shift = event.isShiftPressed,
alt = event.isAltPressed,
meta = event.isMetaPressed,
),
)
return true
}
}
if (event.isCtrlPressed) {
val ctrlSeq = encodeCtrlKey(keyCode, event) ?: return false
deadAccent = 0
flushAndClear()
onInput(if (event.isAltPressed) "\u001b$ctrlSeq" else ctrlSeq)
return true
}
if (event.isAltPressed) {
val withAlt = event.getUnicodeChar(event.metaState)
val withoutAlt = event.getUnicodeChar(event.metaState and KeyEvent.META_ALT_MASK.inv())
if (withAlt != 0 && withAlt != withoutAlt) {
return handleUnicodeChar(withAlt)
}
if (withoutAlt != 0 && (withoutAlt and KeyCharacterMap.COMBINING_ACCENT) == 0) {
deadAccent = 0
flushAndClear()
onInput("\u001b" + String(Character.toChars(withoutAlt)))
return true
}
return false
}
val unicodeChar = event.getUnicodeChar(event.metaState)
if (unicodeChar != 0) {
return handleUnicodeChar(unicodeChar)
}
return false
}
internal fun handleKeyUp(keyCode: Int, event: KeyEvent): Boolean =
isHandledKeyCode(keyCode, event)
@Suppress("DEPRECATION")
internal fun handleKeyMultiple(event: KeyEvent): Boolean {
val characters = event.characters ?: return false
if (characters.isEmpty()) return false
deadAccent = 0
flushAndClear()
onInput(normalizeLineEndings(characters))
return true
}
private fun isHandledKeyCode(keyCode: Int, event: KeyEvent): Boolean {
if (KeyEvent.isModifierKey(keyCode) || event.isMetaPressed) return false
return when (keyCode) {
KeyEvent.KEYCODE_ENTER,
KeyEvent.KEYCODE_NUMPAD_ENTER,
KeyEvent.KEYCODE_DEL,
KeyEvent.KEYCODE_FORWARD_DEL,
KeyEvent.KEYCODE_TAB,
KeyEvent.KEYCODE_ESCAPE,
KeyEvent.KEYCODE_DPAD_UP,
KeyEvent.KEYCODE_DPAD_DOWN,
KeyEvent.KEYCODE_DPAD_LEFT,
KeyEvent.KEYCODE_DPAD_RIGHT -> true
else -> {
if (event.isCtrlPressed) return encodeCtrlKey(keyCode, event) != null
val plainMeta = event.metaState and KeyEvent.META_ALT_MASK.inv()
event.getUnicodeChar(event.metaState) != 0 ||
(event.isAltPressed && event.getUnicodeChar(plainMeta) != 0)
}
}
}
private fun handleUnicodeChar(unicodeChar: Int): Boolean {
if (unicodeChar and KeyCharacterMap.COMBINING_ACCENT != 0) {
deadAccent = unicodeChar and KeyCharacterMap.COMBINING_ACCENT_MASK
return true
}
var codePoint = unicodeChar
if (deadAccent != 0) {
val combined = KeyEvent.getDeadChar(deadAccent, codePoint)
val previousAccent = deadAccent
deadAccent = 0
if (combined != 0) {
codePoint = combined
} else {
flushAndClear()
val accentChar =
KeyEvent.getDeadChar(previousAccent, ' '.code).takeIf { it != 0 } ?: previousAccent
onInput(String(Character.toChars(accentChar)) + String(Character.toChars(codePoint)))
return true
}
}
flushAndClear()
onInput(String(Character.toChars(codePoint)))
return true
}
private fun handleDeleteKey(altPressed: Boolean) {
deadAccent = 0
if (altPressed) {
flushAndClear()
onInput("\u001b\u007f")
return
}
if (sharedEditable.isNotEmpty()) {
val end = sharedEditable.length
val prevCpStart = Character.offsetByCodePoints(sharedEditable, end, -1)
sharedEditable.delete(prevCpStart, end)
Selection.setSelection(sharedEditable, sharedEditable.length)
flush()
} else {
onInput("\u007f")
}
}
private fun submitEnter(altPressed: Boolean = false) {
deadAccent = 0
flushAndClear()
onInput(if (altPressed) "\u001b\r" else "\r")
}
private fun flush() {
val out = StringBuilder()
if (pendingBackspaces > 0) {
repeat(pendingBackspaces) { out.append('\u007f') }
pendingBackspaces = 0
}
val currentText = sharedEditable.toString()
val diff = computeDiff(lastSentText, currentText)
if (diff.isNotEmpty()) {
out.append(normalizeLineEndings(diff))
}
val compStart = getComposingSpanStart(sharedEditable)
val compEnd = getComposingSpanEnd(sharedEditable)
val isComposing = compStart >= 0 && compEnd > compStart
if (!isComposing) {
val hadText = sharedEditable.isNotEmpty()
if (hadText || compStart >= 0) {
clearEditableSilently()
}
lastSentText = ""
if (hadText) {
// The IME just advanced its cursor for the committed text; report the reset to 0, 0.
forceUpdateSelection(0, 0, -1, -1)
} else {
notifySelectionIfChanged(0, 0, -1, -1)
}
} else {
lastSentText = currentText
val selStart = maxOf(0, Selection.getSelectionStart(sharedEditable))
val selEnd = maxOf(0, Selection.getSelectionEnd(sharedEditable))
notifySelectionIfChanged(selStart, selEnd, compStart, compEnd)
}
if (out.isNotEmpty()) {
onInput(out.toString())
}
}
private fun flushAndClear() {
batchEditDepth = 0
val hadText = sharedEditable.isNotEmpty()
val out = StringBuilder()
if (pendingBackspaces > 0) {
repeat(pendingBackspaces) { out.append('\u007f') }
pendingBackspaces = 0
}
val currentText = sharedEditable.toString()
val diff = computeDiff(lastSentText, currentText)
if (diff.isNotEmpty()) {
out.append(normalizeLineEndings(diff))
}
if (hadText || getComposingSpanStart(sharedEditable) >= 0) {
clearEditableSilently()
}
lastSentText = ""
if (hadText || lastSelStart != 0 || lastSelEnd != 0 || lastCompStart != -1 || lastCompEnd != -1) {
forceUpdateSelection(0, 0, -1, -1)
}
if (out.isNotEmpty()) {
onInput(out.toString())
}
}
private fun clearEditableSilently() {
removeComposingSpans(sharedEditable)
sharedEditable.clear()
Selection.setSelection(sharedEditable, 0)
}
private fun notifySelectionIfChanged(selStart: Int, selEnd: Int, compStart: Int, compEnd: Int) {
if (
selStart == lastSelStart &&
selEnd == lastSelEnd &&
compStart == lastCompStart &&
compEnd == lastCompEnd
) {
return
}
forceUpdateSelection(selStart, selEnd, compStart, compEnd)
}
private fun forceUpdateSelection(selStart: Int, selEnd: Int, compStart: Int, compEnd: Int) {
lastSelStart = selStart
lastSelEnd = selEnd
lastCompStart = compStart
lastCompEnd = compEnd
val imm = targetView.context.getSystemService(InputMethodManager::class.java) ?: return
if (imm.isActive(targetView)) {
imm.updateSelection(targetView, selStart, selEnd, compStart, compEnd)
}
}
companion object {
internal fun configureEditorInfo(outAttrs: EditorInfo) {
outAttrs.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
outAttrs.imeOptions =
EditorInfo.IME_ACTION_NONE or
EditorInfo.IME_FLAG_NO_FULLSCREEN or
EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING
outAttrs.initialSelStart = 0
outAttrs.initialSelEnd = 0
}
private fun normalizeLineEndings(text: String): String =
text.replace("\r\n", "\r").replace("\n", "\r")
private fun computeDiff(previous: String, next: String): String {
if (previous == next) return ""
val prevCps = previous.toCodePoints()
val nextCps = next.toCodePoints()
var common = 0
val limit = minOf(prevCps.size, nextCps.size)
while (common < limit && prevCps[common] == nextCps[common]) {
common += 1
}
val removed = prevCps.size - common
val out = StringBuilder(removed + (nextCps.size - common))
repeat(removed) { out.append('\u007f') }
for (i in common until nextCps.size) {
out.appendCodePoint(nextCps[i])
}
return out.toString()
}
private fun String.toCodePoints(): IntArray {
val count = codePointCount(0, length)
val result = IntArray(count)
var offset = 0
var index = 0
while (offset < length) {
val cp = codePointAt(offset)
result[index++] = cp
offset += Character.charCount(cp)
}
return result
}
private fun encodeCtrlKey(keyCode: Int, event: KeyEvent): String? {
val unctrlMeta =
event.metaState and
KeyEvent.META_CTRL_MASK.inv() and
KeyEvent.META_ALT_MASK.inv() and
KeyEvent.META_META_MASK.inv()
val unicode = event.getUnicodeChar(unctrlMeta)
val ch = when {
unicode != 0 -> unicode.toChar()
keyCode in KeyEvent.KEYCODE_A..KeyEvent.KEYCODE_Z ->
('a'.code + keyCode - KeyEvent.KEYCODE_A).toChar()
keyCode == KeyEvent.KEYCODE_SPACE -> ' '
else -> return null
}
val upper = ch.uppercaseChar()
return when {
upper in 'A'..'Z' -> (upper.code - 64).toChar().toString()
ch == ' ' || ch == '@' || ch == '2' -> "\u0000"
ch == '[' || ch == '3' -> "\u001b"
ch == '\\' || ch == '4' -> "\u001c"
ch == ']' || ch == '5' -> "\u001d"
ch == '^' || ch == '6' -> "\u001e"
ch == '_' || ch == '/' || ch == '7' -> "\u001f"
ch == '8' || ch == '?' -> "\u007f"
else -> null
}
}
}
}
@@ -1,32 +0,0 @@
package sh.paseo.terminal
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.TextView
import com.facebook.react.bridge.UiThreadUtil
import com.facebook.react.uimanager.util.ReactFindViewUtil
// Matched against the hidden terminal input's `nativeID`
// (TERMINAL_INPUT_NATIVE_ID in terminal-input.native.tsx).
private const val TERMINAL_INPUT_NATIVE_ID = "paseo-terminal-input"
/**
* Keeps what is typed at a terminal prompt, such as a `sudo` password, out of the keyboard's
* learned words. React Native's TextInput has no prop for IME_FLAG_NO_PERSONALIZED_LEARNING, so the
* flag is added when the input receives its `nativeID`, before it can take focus.
*
* React Native replaces `imeOptions` when `returnKeyType` or `disableFullscreenUI` is set, so the
* terminal input sets neither.
*/
internal object TerminalInputKeyboard : ReactFindViewUtil.OnMultipleViewsFoundListener {
fun install() {
UiThreadUtil.runOnUiThread {
ReactFindViewUtil.addViewsListener(this, setOf(TERMINAL_INPUT_NATIVE_ID))
}
}
override fun onViewFound(view: View, nativeId: String) {
val input = view as? TextView ?: return
input.imeOptions = input.imeOptions or EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING
}
}
@@ -0,0 +1,57 @@
import { requireNativeView } from "expo";
import { forwardRef, useCallback, type Ref } from "react";
import type { ViewProps } from "react-native";
import type {
PaseoTerminalInputKeyEvent,
PaseoTerminalInputViewHandle,
PaseoTerminalInputViewProps,
} from "./terminal-input-view";
export type {
PaseoTerminalInputKeyEvent,
PaseoTerminalInputViewHandle,
PaseoTerminalInputViewProps,
};
interface NativePaseoTerminalInputViewProps extends ViewProps {
ref?: Ref<PaseoTerminalInputViewHandle>;
onTerminalInput?: (event: { nativeEvent: { data: string } }) => void;
onTerminalKey?: (event: { nativeEvent: PaseoTerminalInputKeyEvent }) => void;
onFocusChange?: (event: { nativeEvent: { focused: boolean } }) => void;
}
const NativePaseoTerminalInputView = requireNativeView<NativePaseoTerminalInputViewProps>(
"PaseoTerminal",
"PaseoTerminalInputView",
);
export const PaseoTerminalInputView = forwardRef<
PaseoTerminalInputViewHandle,
PaseoTerminalInputViewProps
>(function PaseoTerminalInputView(
{ onTerminalInput, onTerminalKey, onFocusChange, ...props },
ref,
) {
const handleTerminalInput = useCallback(
(event: { nativeEvent: { data: string } }) => onTerminalInput?.(event.nativeEvent.data),
[onTerminalInput],
);
const handleTerminalKey = useCallback(
(event: { nativeEvent: PaseoTerminalInputKeyEvent }) => onTerminalKey?.(event.nativeEvent),
[onTerminalKey],
);
const handleFocusChange = useCallback(
(event: { nativeEvent: { focused: boolean } }) => onFocusChange?.(event.nativeEvent.focused),
[onFocusChange],
);
return (
<NativePaseoTerminalInputView
{...props}
ref={ref}
onTerminalInput={handleTerminalInput}
onTerminalKey={handleTerminalKey}
onFocusChange={handleFocusChange}
/>
);
});
@@ -0,0 +1,32 @@
import { forwardRef, type Ref } from "react";
import type { ViewProps } from "react-native";
export interface PaseoTerminalInputViewHandle {
focusInput: () => Promise<void>;
showKeyboard: () => Promise<void>;
blurInput: () => Promise<void>;
}
export interface PaseoTerminalInputKeyEvent {
key: string;
ctrl: boolean;
shift: boolean;
alt: boolean;
meta: boolean;
}
export interface PaseoTerminalInputViewProps extends ViewProps {
onTerminalInput?: (data: string) => void;
onTerminalKey?: (event: PaseoTerminalInputKeyEvent) => void;
onFocusChange?: (focused: boolean) => void;
}
export const PaseoTerminalInputView = forwardRef<
PaseoTerminalInputViewHandle,
PaseoTerminalInputViewProps
>(function PaseoTerminalInputView(
_props: PaseoTerminalInputViewProps,
_ref: Ref<PaseoTerminalInputViewHandle>,
) {
return null;
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.17.6",
"version": "0.18.1",
"private": true,
"main": "index.ts",
"scripts": {
@@ -0,0 +1,70 @@
const { withMainActivity } = require("expo/config-plugins");
// Android 12+ "Bold text" sets Configuration.fontWeightAdjustment, and TextView
// applies it when drawing text that has no explicit fontWeight or fontFamily.
// React Native's TextLayoutManager measures that text without the adjustment, so
// the wider glyphs overflow the measured box and trailing words or lines are
// clipped (#4057, #10152, #10850).
//
// Override only fontWeightAdjustment on an empty sparse Configuration() so
// unrelated configuration fields (uiMode, densityDpi, orientation,
// screenWidthDp, fontScale, locales) keep flowing through onConfigurationChanged.
//
// Remove this plugin once upstream React Native's TextLayoutManager measures
// with Configuration.fontWeightAdjustment.
const IMPORTS = [
"android.content.Context",
"android.content.res.Configuration",
"android.os.Build",
];
const MARKER = "// paseo-ignore-bold-text";
const ATTACH_BASE_CONTEXT = ` ${MARKER}
override fun attachBaseContext(newBase: Context) {
val configuration = newBase.resources.configuration
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && configuration.fontWeightAdjustment != 0) {
val override = Configuration()
override.fontWeightAdjustment = 0
super.attachBaseContext(newBase.createConfigurationContext(override))
return
}
super.attachBaseContext(newBase)
}
`;
const CLASS_DECLARATION = /class MainActivity : ReactActivity\(\) \{\n/;
function configureIgnoreBoldTextMainActivity(source) {
if (source.includes(MARKER)) {
return source;
}
if (!CLASS_DECLARATION.test(source)) {
throw new Error("withAndroidIgnoreBoldText could not find the MainActivity class declaration");
}
if (/override fun attachBaseContext\(/.test(source)) {
throw new Error("withAndroidIgnoreBoldText found an existing attachBaseContext override");
}
let contents = source;
for (const name of IMPORTS) {
if (!contents.includes(`import ${name}\n`)) {
contents = contents.replace(/^package .*\n/m, (line) => `${line}import ${name}\n`);
}
}
return contents.replace(CLASS_DECLARATION, (line) => `${line}${ATTACH_BASE_CONTEXT}\n`);
}
function withAndroidIgnoreBoldText(config) {
return withMainActivity(config, (modConfig) => {
if (modConfig.modResults.language !== "kt") {
throw new Error("withAndroidIgnoreBoldText expects a Kotlin MainActivity");
}
modConfig.modResults.contents = configureIgnoreBoldTextMainActivity(
modConfig.modResults.contents,
);
return modConfig;
});
}
module.exports = withAndroidIgnoreBoldText;
module.exports.configureIgnoreBoldTextMainActivity = configureIgnoreBoldTextMainActivity;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 19 KiB

@@ -783,6 +783,56 @@ it("presents received agent messages as attributed bubbles with the original tur
});
});
it("presents a finished notification as a compact tool call, not a received message", () => {
const call = toolCall("notice", "agent_finished");
if (call.payload.source !== "agent") throw new Error("Expected agent tool");
call.payload.data.detail = {
type: "plain_text",
label: "Child",
text: "Agent child (Child) finished.",
icon: "bot",
};
const result = createStreamPresentation()({
...presentationOptions,
transform: undefined,
tail: [call],
head: [],
});
expect(result.tail).toEqual([call]);
});
// COMPAT(agentNotificationMetadata): rows from daemons that sent notification metadata.
it("presents a legacy notification as the plain tool call current daemons send", () => {
const call = toolCall("legacy", "agent_message");
if (call.payload.source !== "agent") throw new Error("Expected agent tool");
call.turnId = "turn";
call.payload.data.detail = { type: "plain_text", text: "Done", icon: "bot" };
call.payload.data.agentMessage = {
event: "finished",
sender: { id: "child", title: "Child" },
text: "Done",
};
const result = createStreamPresentation()({
...presentationOptions,
transform: undefined,
tail: [call],
head: [],
});
expect(result.tail).toHaveLength(1);
const [presented] = result.tail;
if (presented?.kind !== "tool_call" || presented.payload.source !== "agent")
throw new Error("Expected agent tool");
expect(presented).toMatchObject({ id: call.id, turnId: "turn" });
expect(presented.payload.data).toEqual({
provider: "codex",
callId: "legacy",
name: "agent_finished",
status: "completed",
error: null,
detail: { type: "plain_text", label: "Child", text: "Done", icon: "bot" },
});
});
it("does not reopen the previous turn while a new run waits for its first row", () => {
const timestamp = new Date();
const tail: StreamItem[] = [
+24 -2
View File
@@ -9,7 +9,14 @@ import {
type ToolCallDetailLevel,
type ToolCallDetailProjection,
} from "@/tool-calls/detail-level/projection";
import type { StreamItem, UserMessageItem } from "@/types/stream";
import type { AgentMessage } from "@getpaseo/protocol/agent-message";
import { legacyAgentNotificationToolCall } from "@getpaseo/protocol/paseo-tool-presentation/index";
import {
isAgentToolCallItem,
type AgentToolCallItem,
type StreamItem,
type UserMessageItem,
} from "@/types/stream";
import { collapseTurns, type TurnCollapse } from "./turn-collapse/model";
import type { ReadingRowReplacements } from "./reading-anchor";
@@ -56,6 +63,7 @@ const NO_COLLAPSED_TURNS: StreamPresentation["turns"] = collapseTurns({
/** Source messages reach plugins before display projection. */
export function createStreamPresentation() {
const userMessageCache = new WeakMap<UserMessageItem, UserMessageItem>();
const legacyNotificationCache = new WeakMap<AgentToolCallItem, AgentToolCallItem>();
function presentUserMessage(item: UserMessageItem): UserMessageItem {
const cached = userMessageCache.get(item);
@@ -72,6 +80,19 @@ export function createStreamPresentation() {
return projected;
}
// COMPAT(agentNotificationMetadata): added in v0.18.1, remove after 2027-06-01.
function presentLegacyNotification(item: AgentToolCallItem, message: AgentMessage): StreamItem {
const cached = legacyNotificationCache.get(item);
if (cached) return cached;
const { agentMessage: _legacy, ...data } = item.payload.data;
const presented: AgentToolCallItem = {
...item,
payload: { source: "agent", data: { ...data, ...legacyAgentNotificationToolCall(message) } },
};
legacyNotificationCache.set(item, presented);
return presented;
}
let historySource: StreamItem[] | undefined;
let historyTransform: TimelineItemTransform | undefined;
let historyRows: StreamItem[] = [];
@@ -86,7 +107,7 @@ export function createStreamPresentation() {
let collapsed: TurnCollapse | undefined;
function presentRows(item: StreamItem): StreamItem[] {
if (item.kind === "tool_call" && item.payload.source === "agent") {
if (isAgentToolCallItem(item)) {
const message = item.payload.data.agentMessage;
if (message?.event === "message") {
return [
@@ -101,6 +122,7 @@ export function createStreamPresentation() {
},
];
}
if (message) return [presentLegacyNotification(item, message)];
}
return [item.kind === "user_message" ? presentUserMessage(item) : item];
}
@@ -775,7 +775,6 @@ function NativeStreamViewport(props: StreamRenderInput & { strategy: StreamStrat
extraData={renderHistoryMountedRow}
keyExtractor={keyExtractor}
testID="agent-chat-scroll"
// The Android scroll owner identifies the timeline to contain nested panel gestures.
nativeID="agent-chat-scroll-native-virtualized"
ListHeaderComponent={historyStartContent}
ListFooterComponent={liveAuxiliaryContent ?? undefined}
@@ -162,11 +162,12 @@ describe("collapseTurns", () => {
create.payload.data.detail = { type: "unknown", input: { title: "Side fix" }, output: null };
const finished = shell("finished");
if (finished.payload.source !== "agent") throw new Error("Expected agent tool");
finished.payload.data.name = "agent_notification";
finished.payload.data.agentMessage = {
event: "finished",
sender: { id: "worker", title: "PR helper" },
finished.payload.data.name = "agent_finished";
finished.payload.data.detail = {
type: "plain_text",
label: "PR helper",
text: "Finished",
icon: "bot",
};
const items: StreamItem[] = [
user("u1"),
@@ -77,11 +77,8 @@ describe("canonical turn membership", () => {
delete trigger.turnId;
expect(continuesTurn(previous, trigger)).toBe(false);
trigger.payload.data.name = "agent_message";
trigger.payload.data.agentMessage = {
event: "finished",
sender: { id: "worker" },
text: "Done",
};
expect(continuesTurn(previous, trigger)).toBe(false);
trigger.payload.data.name = "agent_finished";
expect(continuesTurn(previous, trigger)).toBe(false);
});
+10 -2
View File
@@ -744,6 +744,7 @@ const AgentStreamViewComponent = forwardRef<AgentStreamViewHandle, AgentStreamVi
<AssistantFileLinkResolverProvider
client={client}
serverId={resolvedServerId}
workspaceId={context.workspaceId}
workspaceRoot={workspaceRoot}
onOpenWorkspaceFile={handleInlinePathPress}
toast={toast}
@@ -766,7 +767,15 @@ const AgentStreamViewComponent = forwardRef<AgentStreamViewHandle, AgentStreamVi
</AssistantFileLinkResolverProvider>
);
},
[agentId, client, handleInlinePathPress, resolvedServerId, toast, workspaceRoot],
[
agentId,
client,
context.workspaceId,
handleInlinePathPress,
resolvedServerId,
toast,
workspaceRoot,
],
);
const renderThoughtItem = useCallback(
@@ -818,7 +827,6 @@ const AgentStreamViewComponent = forwardRef<AgentStreamViewHandle, AgentStreamVi
cwd={context.cwd}
serverId={resolvedServerId}
metadata={data.metadata}
agentMessage={data.agentMessage}
isLastInSequence={isLastInSequence}
onOpenFilePath={handleToolCallOpenFile}
standalone={options.standalone}
+6 -1
View File
@@ -108,6 +108,7 @@ import { useGlobalNewWorkspaceAction } from "@/hooks/use-global-new-workspace-ac
import { useLatchedBoolean } from "@/hooks/use-latched-boolean";
import { useFaviconStatus } from "@/hooks/use-favicon-status";
import { useKeyboardShortcuts } from "@/keyboard/use-shortcuts";
import { reportNativeUserActivity } from "@/hooks/native-user-activity";
import { KeyboardShiftProvider } from "@/keyboard/shift";
import { useCompactWebViewportZoomLock } from "@/hooks/use-compact-web-viewport-zoom-lock";
import { useOpenProject } from "@/hooks/use-open-project";
@@ -1026,7 +1027,11 @@ function RootProviders({ children }: { children: ReactNode }) {
function RootAppTree() {
return (
<GestureHandlerRootView style={flexStyle}>
<GestureHandlerRootView
style={flexStyle}
onTouchStart={reportNativeUserActivity}
onTouchEnd={reportNativeUserActivity}
>
<View style={layoutStyles.surfaceFill}>
<LucideProvider strokeWidth={ICON_STROKE_WIDTH}>
<AddHostProvider>
@@ -7,6 +7,7 @@ export const ASSISTANT_FILE_EXTENSIONS: ReadonlySet<string> = new Set([
"cpp",
"cs",
"css",
"csv",
"cts",
"cxx",
"env",

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