mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-21 15:55:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70300fcda0 | ||
|
|
c89a4f18c1 |
@@ -2,7 +2,7 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, "release/**"]
|
||||
branches: [main]
|
||||
# Every base branch, so stacked PRs and PRs into any base get the same checks.
|
||||
pull_request:
|
||||
merge_group:
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
filters: .github/ci-paths.yml
|
||||
|
||||
- name: Validate CI contracts
|
||||
run: node --test scripts/ci-workflow.test.mjs scripts/daemon-launch-contract.test.mjs scripts/changelog-utils.test.mjs scripts/release-version-utils.test.mjs scripts/publish-release-packages.test.mjs scripts/push-current-release-tag.test.mjs scripts/reconcile-release.test.mjs scripts/sync-fdroid-changelogs.test.mjs scripts/sync-release-notes-from-changelog.test.mjs scripts/upload-release-assets.test.mjs
|
||||
run: node --test scripts/ci-workflow.test.mjs scripts/daemon-launch-contract.test.mjs scripts/changelog-utils.test.mjs scripts/sync-fdroid-changelogs.test.mjs scripts/sync-release-notes-from-changelog.test.mjs scripts/upload-release-assets.test.mjs
|
||||
|
||||
quality:
|
||||
name: quality
|
||||
|
||||
@@ -2,7 +2,7 @@ name: Desktop Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, "release/**"]
|
||||
branches: [main]
|
||||
# Packaging leaves ordinary PR CI, but a PR that changes what gets packaged
|
||||
# or how it is smoked still proves the real artifacts before merge.
|
||||
pull_request:
|
||||
@@ -11,11 +11,10 @@ on:
|
||||
- "plugins/**"
|
||||
- "nix/**"
|
||||
- ".github/workflows/desktop-packages.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: desktop-packages-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -170,11 +170,33 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export PASEO_REAL_XCRUN="$(command -v xcrun)"
|
||||
xcrun_bin="$(mktemp -d)"
|
||||
trap 'rm -rf "$xcrun_bin"' EXIT
|
||||
cp scripts/macos-xcrun-retry.sh "$xcrun_bin/xcrun"
|
||||
chmod +x "$xcrun_bin/xcrun"
|
||||
export PATH="$xcrun_bin:$PATH"
|
||||
stapler_bin="$(mktemp -d)"
|
||||
trap 'rm -rf "$stapler_bin"' EXIT
|
||||
cat > "$stapler_bin/xcrun" <<'STAPLER'
|
||||
#!/bin/bash
|
||||
if [[ "${1:-}" != stapler || "${2:-}" != staple ]]; then
|
||||
exec "$PASEO_REAL_XCRUN" "$@"
|
||||
fi
|
||||
output="$(mktemp)"
|
||||
trap 'rm -f "$output"' EXIT
|
||||
for attempt in 1 2 3 4; do
|
||||
if "$PASEO_REAL_XCRUN" "$@" >"$output" 2>&1; then
|
||||
cat "$output"
|
||||
exit 0
|
||||
else
|
||||
status=$?
|
||||
fi
|
||||
cat "$output"
|
||||
if [[ "$status" != 68 || "$attempt" == 4 ]] ||
|
||||
! grep -Fq 'NSURLErrorDomain Code=-1005' "$output"; then
|
||||
exit "$status"
|
||||
fi
|
||||
echo "::warning::Apple staple connection lost; retrying the same signed app ($attempt/4)" >&2
|
||||
sleep 30
|
||||
done
|
||||
STAPLER
|
||||
chmod +x "$stapler_bin/xcrun"
|
||||
export PATH="$stapler_bin:$PATH"
|
||||
build_args=(-- --publish never --mac --${{ matrix.electron_arch }})
|
||||
build_args+=("-c.publish.releaseType=$RELEASE_TYPE")
|
||||
build_args+=("-c.publish.channel=$RELEASE_CHANNEL")
|
||||
@@ -480,7 +502,6 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p release-manifests
|
||||
cd release-manifests
|
||||
manifests_dir="$PWD/final"
|
||||
mkdir -p "$manifests_dir"
|
||||
|
||||
@@ -29,8 +29,8 @@ on:
|
||||
- "true"
|
||||
|
||||
concurrency:
|
||||
group: docker-${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.publish == 'true' && format('publish-{0}', inputs.paseo_version || github.run_id) || github.ref }}
|
||||
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') && !(github.event_name == 'workflow_dispatch' && inputs.publish == 'true') }}
|
||||
group: docker-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
|
||||
@@ -3,7 +3,6 @@ name: Nix
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
+40
-10
@@ -1,56 +1,86 @@
|
||||
# Changelog
|
||||
|
||||
## 0.17.0-beta.1 - 2026-11-19
|
||||
## 0.17.0 - 2026-11-21
|
||||
|
||||
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from any branch or pull request. ([#10190](https://github.com/getpaseo/paseo/pull/10190))
|
||||
- **Antigravity approvals and history:** Pick a permission mode, answer tool approvals, import CLI sessions and see your history when you reopen a chat. ([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **Watch pull requests:** Agents can watch a GitHub PR and get notified when checks, reviews or comments change. ([#10148](https://github.com/getpaseo/paseo/pull/10148))
|
||||
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation. ([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
|
||||
- **Update providers in Paseo:** See each provider's status, installed version, and available updates in the provider list. Open a provider's settings from Settings, setup, or the model picker to update supported CLIs and watch their output. ([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
|
||||
- **Provider quota forecasts:** Usage estimates when a quota will run out or how much will remain at reset, based on your current pace. The forecast appears inline with the reset time. ([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
|
||||
- **Watch PRs and MRs:** Ask an agent to watch a GitHub, GitLab, Gitea, Forgejo, or Codeberg change request for updates to checks, reviews, or comments. Stop a watch from Background work. ([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
|
||||
- **Heartbeats in Background work:** See and stop an agent's heartbeats next to its background tasks. ([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
|
||||
- **Agent messages wait their turn:** Reports and notifications from other agents arrive when the current turn ends instead of interrupting it. ([#9757](https://github.com/getpaseo/paseo/pull/9757))
|
||||
- **Antigravity approvals and history:** Choose a permission mode, respond to tool approvals, and import or reopen sessions. Use Antigravity CLI 1.5.0 or later on the daemon host, and include `acp` if you override its command. In Hub, reselect the model and thinking level if a saved model ID includes an old effort suffix. ([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **More goose models:** Select models from all providers configured in goose. Existing goose settings and sessions carry over to the bundled plugin. ([#9719](https://github.com/getpaseo/paseo/pull/9719) by [@i386](https://github.com/i386))
|
||||
- **Plugin agent instructions:** Plugins can add their own instructions to agents. ([#9781](https://github.com/getpaseo/paseo/pull/9781))
|
||||
|
||||
### Added
|
||||
|
||||
- Added OpenRouter credit balances and API key spending to Usage and `paseo usage` ([#10269](https://github.com/getpaseo/paseo/pull/10269))
|
||||
- Added Antigravity account quotas to Usage ([#10232](https://github.com/getpaseo/paseo/pull/10232) by [@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
|
||||
- Added Antigravity skill suggestions when you type `/` inside a prompt ([#10383](https://github.com/getpaseo/paseo/pull/10383))
|
||||
- Added bundled orchestration skills to Antigravity on hosts where Paseo skills are installed ([#10273](https://github.com/getpaseo/paseo/pull/10273))
|
||||
- Added shortcuts to open the model picker and cycle thinking levels with Cmd/Ctrl+/ and Cmd/Ctrl+Shift+/ ([#10147](https://github.com/getpaseo/paseo/pull/10147))
|
||||
- Added agent settings to Command Center search before the first message ([#10182](https://github.com/getpaseo/paseo/pull/10182) by [@cleiter](https://github.com/cleiter))
|
||||
- Added Rewind to Command Center for the latest turn ([#10144](https://github.com/getpaseo/paseo/pull/10144))
|
||||
- Added a separate Ultracode toggle for eligible Claude models ([#10150](https://github.com/getpaseo/paseo/pull/10150) by [@fivetaku](https://github.com/fivetaku))
|
||||
- Added Flex speed for Codex ([#9809](https://github.com/getpaseo/paseo/pull/9809) by [@qjqqyy](https://github.com/qjqqyy))
|
||||
- Added syntax highlighting for shell scripts and Dockerfiles ([#10178](https://github.com/getpaseo/paseo/pull/10178))
|
||||
- Added project listing on connected daemons for Hub sessions with `hub.execute` ([#10392](https://github.com/getpaseo/paseo/pull/10392))
|
||||
- Added labels and workspace IDs to `paseo ls --json` ([#10076](https://github.com/getpaseo/paseo/pull/10076))
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed `browser_new_tab` to ask agents to choose a Desktop when several are connected ([#10189](https://github.com/getpaseo/paseo/pull/10189))
|
||||
- Changed workspace Git status to reuse its snapshot after a short reconnect when the checkout has not changed ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- Changed Appearance content width to Default (820 px), Wide (1,200 px), and Full presets that resize open chats, the composer, and Markdown previews together ([#10231](https://github.com/getpaseo/paseo/pull/10231))
|
||||
- Changed Antigravity tool cards to show shell commands and output, file diffs, and Paseo tool details ([#10379](https://github.com/getpaseo/paseo/pull/10379))
|
||||
- Changed Clone from GitHub to show matching private repositories first ([#10264](https://github.com/getpaseo/paseo/pull/10264))
|
||||
- Changed worktree teardown to keep the worktree when the command exceeds one minute or the `worktree.teardownTimeoutMs` limit in `paseo.json` ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
|
||||
- Changed workspace navigation to acknowledge taps promptly and initially load fewer offscreen chat rows on mobile ([#9887](https://github.com/getpaseo/paseo/pull/9887))
|
||||
- Changed worktree teardown to stop after one minute by default and keep the worktree; set `worktree.teardownTimeoutMs` in `paseo.json` for longer commands ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
|
||||
- Changed workspace Git status to reuse its snapshot after a short reconnect when the checkout has not changed ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- Changed `browser_new_tab` to ask agents to choose a Desktop when several are connected ([#10189](https://github.com/getpaseo/paseo/pull/10189))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an online host's workspaces staying missing after the app evicts its cached directory ([#10318](https://github.com/getpaseo/paseo/pull/10318))
|
||||
- Fixed chat history timing out when many open chats refresh at once after reconnecting ([#10368](https://github.com/getpaseo/paseo/pull/10368))
|
||||
- Fixed slow reopening of long Claude chats while the daemon is busy ([#10369](https://github.com/getpaseo/paseo/pull/10369))
|
||||
- Fixed images from a live reply waiting for images in another chat's history to load ([#10371](https://github.com/getpaseo/paseo/pull/10371))
|
||||
- Fixed agent recovery failing and idle agents showing errors after stopping a foreground daemon with Ctrl+C on macOS or Linux ([#10381](https://github.com/getpaseo/paseo/pull/10381))
|
||||
- Fixed Antigravity turns ending while a background command is still running ([#10310](https://github.com/getpaseo/paseo/pull/10310))
|
||||
- Fixed slash suggestions failing when a provider reports duplicate command names ([#10275](https://github.com/getpaseo/paseo/pull/10275))
|
||||
- Fixed stale Codex subagent statuses after reopening or rewinding the parent chat ([#10171](https://github.com/getpaseo/paseo/pull/10171) by [@AnalyticETH](https://github.com/AnalyticETH))
|
||||
- Fixed Usage showing the previous Claude account's quota after switching accounts ([#10236](https://github.com/getpaseo/paseo/pull/10236))
|
||||
- Fixed the sidebar usage row dropping period labels such as `5h` and `wk` when multiple usage windows are pinned ([#10274](https://github.com/getpaseo/paseo/pull/10274))
|
||||
- Fixed Changes failing to recognize a checkout immediately after restoring its worktree ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304))
|
||||
- Fixed double-click word selection and triple-click line selection in diffs ([#10252](https://github.com/getpaseo/paseo/pull/10252) by [@pedrovieira](https://github.com/pedrovieira))
|
||||
- Fixed the composer and chat column losing alignment when Chat outline is enabled ([#10277](https://github.com/getpaseo/paseo/pull/10277))
|
||||
- Fixed the archive shortcut failing when the active workspace's sidebar group is collapsed ([#10356](https://github.com/getpaseo/paseo/pull/10356) by [@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
|
||||
- Fixed Android composer buttons requiring a second tap after typing or zooming a chat image ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
|
||||
- Fixed swiping a terminal in an Android browser opening the keyboard when it was closed ([#10225](https://github.com/getpaseo/paseo/pull/10225) by [@tonylt](https://github.com/tonylt))
|
||||
- Fixed Collapse turns hiding a finished OMP or Pi reply when an idle provider notice appears ([#10135](https://github.com/getpaseo/paseo/pull/10135))
|
||||
- Fixed repeated finish notifications while an agent responds to background tasks and its earlier finish is unread ([#10200](https://github.com/getpaseo/paseo/pull/10200))
|
||||
- Fixed an empty chat losing the prompt and start of a reply after reconnecting mid-reply ([#9723](https://github.com/getpaseo/paseo/pull/9723) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed changes between Claude thinking levels stopping its background work ([#10008](https://github.com/getpaseo/paseo/pull/10008) by [@gilad-rubin](https://github.com/gilad-rubin))
|
||||
- Fixed OpenCode turns staying running after a shared OpenCode service stops ([#10187](https://github.com/getpaseo/paseo/pull/10187))
|
||||
- Fixed OMP denying an approved tool call when session or grant choices were offered ([#10126](https://github.com/getpaseo/paseo/pull/10126) by [@dsingal0](https://github.com/dsingal0))
|
||||
- Fixed a Codex message stopped before its turn starts showing an error instead of canceled ([#9931](https://github.com/getpaseo/paseo/pull/9931) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed Changes failing to open when Git metadata watching reaches its limit ([#10188](https://github.com/getpaseo/paseo/pull/10188))
|
||||
- Fixed copying selected reply text into plain-text targets with unwanted Markdown syntax ([#10079](https://github.com/getpaseo/paseo/pull/10079) by [@danberindei](https://github.com/danberindei))
|
||||
- Fixed file views losing their scroll position when switching Preview and Source, except HTML previews on iOS ([#10195](https://github.com/getpaseo/paseo/pull/10195) by [@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- Fixed file tabs in split panes showing or focusing the wrong file ([#9888](https://github.com/getpaseo/paseo/pull/9888) by [@KosmoCHE](https://github.com/KosmoCHE))
|
||||
- Fixed touch-screen submenus closing as soon as they open ([#10175](https://github.com/getpaseo/paseo/pull/10175) by [@christiantwu](https://github.com/christiantwu))
|
||||
- Fixed dictation failing after another chat that used the microphone closes ([#10185](https://github.com/getpaseo/paseo/pull/10185) by [@Brandon168](https://github.com/Brandon168))
|
||||
- Fixed composer taps being lost on Android after zooming a chat image ([#10057](https://github.com/getpaseo/paseo/pull/10057))
|
||||
- Fixed clipped text on Samsung DeX ([#9995](https://github.com/getpaseo/paseo/pull/9995) by [@easyhunjune](https://github.com/easyhunjune))
|
||||
- Fixed workspace images in chat failing to load after a slow host connection ([#10111](https://github.com/getpaseo/paseo/pull/10111) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed desktop browser screenshots returning fully transparent images ([#9807](https://github.com/getpaseo/paseo/pull/9807) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- Fixed Mermaid flowcharts with `@` in labels showing source instead of the diagram ([#10165](https://github.com/getpaseo/paseo/pull/10165) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- Fixed hidden background workspaces triggering the dock badge and favicon ([#9983](https://github.com/getpaseo/paseo/pull/9983))
|
||||
- Fixed desktop sidebar navigation crowding out workspaces ([#9903](https://github.com/getpaseo/paseo/pull/9903) by [@pentatonic-alex](https://github.com/pentatonic-alex))
|
||||
- Fixed historical closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
- Fixed plugin agents failing to reopen after their provider closes the session ([#10153](https://github.com/getpaseo/paseo/pull/10153))
|
||||
- Fixed plugin screens and settings failing to use plugin state hooks ([#10049](https://github.com/getpaseo/paseo/pull/10049))
|
||||
- Fixed a Codex message stopped before its turn starts showing an error instead of canceled ([#9931](https://github.com/getpaseo/paseo/pull/9931) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed historical closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
|
||||
### Plugins
|
||||
|
||||
- Added a `focusHost` navigation option for plugins to select the destination host in the sidebar when opening a workspace or agent ([#5574](https://github.com/getpaseo/paseo/pull/5574) by [@discwl](https://github.com/discwl))
|
||||
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
|
||||
+40
-10
@@ -1,56 +1,86 @@
|
||||
# Changelog
|
||||
|
||||
## 0.17.0-beta.1 - 2026-11-19
|
||||
## 0.17.0 - 2026-11-21
|
||||
|
||||
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从任意分支或 PR 创建 worktree。([#10190](https://github.com/getpaseo/paseo/pull/10190))
|
||||
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批、导入 CLI 会话,并在重新打开对话时查看历史记录。([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **监视 PR**:Agent 可以监视 GitHub PR,在检查、审查或评论有变化时收到通知。([#10148](https://github.com/getpaseo/paseo/pull/10148))
|
||||
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从分支或 PR 创建 worktree。插件可以管理 worktree 的创建、移除和恢复。从 fork 的 PR 或 MR 创建分支时,选择“运行设置”以批准工作区自动化。([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
|
||||
- **在 Paseo 中更新 Provider**:在 Provider 列表中查看各 Provider 的状态、已安装版本和可用更新。从设置、初次配置或模型选择器打开 Provider 设置,即可更新受支持的 CLI 并查看输出。([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
|
||||
- **Provider 配额预测**:“使用情况”页面根据当前使用速度估算配额何时用完,或重置时还会剩下多少。预测结果显示在重置时间同一行中。([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
|
||||
- **监视 PR 和 MR**:让 Agent 监视 GitHub、GitLab、Gitea、Forgejo 或 Codeberg 上的 PR 或 MR,跟踪检查、审查或评论的变化。你可以在后台任务中停止监视。([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
|
||||
- **在后台任务中查看 heartbeat**:在 Agent 的后台任务旁查看和停止 heartbeat。([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
|
||||
- **Agent 消息排队等待**:其他 Agent 的报告和通知会在当前轮次结束后到达,不会打断当前轮次。([#9757](https://github.com/getpaseo/paseo/pull/9757))
|
||||
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。请在 daemon 主机上使用 Antigravity CLI 1.5.0 或更新版本,如果覆盖了启动命令请包含 `acp`。如果 Hub 中保存的模型 ID 含有旧的推理强度后缀,请重新选择模型和思考级别。([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **更多 goose 模型**:从 goose 中已配置的所有 Provider 选择模型。现有 goose 设置和会话会迁移到内置插件。([#9719](https://github.com/getpaseo/paseo/pull/9719),贡献者:[@i386](https://github.com/i386))
|
||||
- **插件 Agent 指令**:插件可以向 Agent 添加自己的指令。([#9781](https://github.com/getpaseo/paseo/pull/9781))
|
||||
|
||||
### 新增
|
||||
|
||||
- 在“使用情况”页面和 `paseo usage` 中新增 OpenRouter 余额和 API 密钥支出 ([#10269](https://github.com/getpaseo/paseo/pull/10269))
|
||||
- 在“使用情况”页面新增 Antigravity 账号配额 ([#10232](https://github.com/getpaseo/paseo/pull/10232),贡献者:[@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
|
||||
- 在提示词中输入 `/` 时,新增 Antigravity 技能建议 ([#10383](https://github.com/getpaseo/paseo/pull/10383))
|
||||
- 在已安装 Paseo 技能的主机上,为 Antigravity 新增内置编排技能 ([#10273](https://github.com/getpaseo/paseo/pull/10273))
|
||||
- 新增 Cmd/Ctrl+/ 和 Cmd/Ctrl+Shift+/ 快捷键,用于打开模型选择器和切换思考级别 ([#10147](https://github.com/getpaseo/paseo/pull/10147))
|
||||
- 新增在发送第一条消息前通过命令中心搜索 Agent 设置 ([#10182](https://github.com/getpaseo/paseo/pull/10182),贡献者:[@cleiter](https://github.com/cleiter))
|
||||
- 新增在命令中心回退最近轮次的操作 ([#10144](https://github.com/getpaseo/paseo/pull/10144))
|
||||
- 新增符合条件的 Claude 模型的独立 Ultracode 开关 ([#10150](https://github.com/getpaseo/paseo/pull/10150),贡献者:[@fivetaku](https://github.com/fivetaku))
|
||||
- 新增 Codex Flex 速度选项 ([#9809](https://github.com/getpaseo/paseo/pull/9809),贡献者:[@qjqqyy](https://github.com/qjqqyy))
|
||||
- 新增 shell 脚本和 Dockerfile 的语法高亮 ([#10178](https://github.com/getpaseo/paseo/pull/10178))
|
||||
- 为具有 `hub.execute` 权限的 Hub 会话新增列出已连接 daemon 活跃项目的能力 ([#10392](https://github.com/getpaseo/paseo/pull/10392))
|
||||
- 新增 `paseo ls --json` 输出的标签和工作区 ID ([#10076](https://github.com/getpaseo/paseo/pull/10076))
|
||||
|
||||
### 变更
|
||||
|
||||
- 连接多个 Desktop 时,`browser_new_tab` 会让 Agent 选择打开标签页的 Desktop ([#10189](https://github.com/getpaseo/paseo/pull/10189))
|
||||
- 工作区 Git 状态在短暂重连且检出的内容未更改时复用之前的快照 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- 将“外观”中的内容宽度改为默认(820 px)、宽版(1,200 px)和全宽预设,同时调整已打开对话、Composer 和 Markdown 预览的宽度 ([#10231](https://github.com/getpaseo/paseo/pull/10231))
|
||||
- Antigravity 工具卡片现在显示 shell 命令及输出、文件 diff 和 Paseo 工具详情 ([#10379](https://github.com/getpaseo/paseo/pull/10379))
|
||||
- 从 GitHub 克隆时,优先显示匹配的私有仓库 ([#10264](https://github.com/getpaseo/paseo/pull/10264))
|
||||
- worktree 清理命令在超过默认的一分钟或 `paseo.json` 中 `worktree.teardownTimeoutMs` 限制时保留 worktree ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 工作区导航会立即响应点击,并在手机端初始加载时减少屏幕外的对话行数 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
|
||||
- worktree 清理命令默认在一分钟后停止并保留 worktree;如需更长时间,可在 `paseo.json` 中设置 `worktree.teardownTimeoutMs` ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 工作区 Git 状态在短暂重连且检出的内容未更改时复用之前的快照 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- 连接多个 Desktop 时,`browser_new_tab` 会让 Agent 选择打开标签页的 Desktop ([#10189](https://github.com/getpaseo/paseo/pull/10189))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复应用清除主机目录缓存后,在线主机的工作区一直不显示的问题 ([#10318](https://github.com/getpaseo/paseo/pull/10318))
|
||||
- 修复重新连接后多个已打开的对话同时刷新时,历史记录加载超时的问题 ([#10368](https://github.com/getpaseo/paseo/pull/10368))
|
||||
- 修复 daemon 繁忙时,重新打开较长的 Claude 对话速度慢的问题 ([#10369](https://github.com/getpaseo/paseo/pull/10369))
|
||||
- 修复当前回复中的图片等待另一个对话的历史图片加载的问题 ([#10371](https://github.com/getpaseo/paseo/pull/10371))
|
||||
- 修复在 macOS 或 Linux 上用 Ctrl+C 停止前台 daemon 后,Agent 恢复失败且空闲 Agent 显示错误的问题 ([#10381](https://github.com/getpaseo/paseo/pull/10381))
|
||||
- 修复 Antigravity 后台命令仍在运行时轮次就已结束的问题 ([#10310](https://github.com/getpaseo/paseo/pull/10310))
|
||||
- 修复 Provider 返回重复命令名称时,斜杠建议列表出错的问题 ([#10275](https://github.com/getpaseo/paseo/pull/10275))
|
||||
- 修复重新打开或回退父对话后,Codex 子 Agent 状态未更新的问题 ([#10171](https://github.com/getpaseo/paseo/pull/10171),贡献者:[@AnalyticETH](https://github.com/AnalyticETH))
|
||||
- 修复切换 Claude 账号后,“使用情况”页面仍显示上一个账号配额的问题 ([#10236](https://github.com/getpaseo/paseo/pull/10236))
|
||||
- 修复固定多个用量窗口时,侧边栏用量行隐藏 `5h` 和 `wk` 等周期标签的问题 ([#10274](https://github.com/getpaseo/paseo/pull/10274))
|
||||
- 修复恢复 worktree 后,“更改”无法立即识别检出目录的问题 ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304))
|
||||
- 修复 diff 中双击选词和三击选行的问题 ([#10252](https://github.com/getpaseo/paseo/pull/10252),贡献者:[@pedrovieira](https://github.com/pedrovieira))
|
||||
- 修复启用聊天大纲时,Composer 与对话栏对不齐的问题 ([#10277](https://github.com/getpaseo/paseo/pull/10277))
|
||||
- 修复当前工作区所在的侧边栏分组折叠时,归档快捷键失效的问题 ([#10356](https://github.com/getpaseo/paseo/pull/10356),贡献者:[@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
|
||||
- 修复在 Android 上输入文字或缩放对话图片后,首次点击 Composer 按钮无效的问题 ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
|
||||
- 修复在 Android 浏览器中滑动终端时弹出已关闭的键盘的问题 ([#10225](https://github.com/getpaseo/paseo/pull/10225),贡献者:[@tonylt](https://github.com/tonylt))
|
||||
- 修复启用“折叠轮次”时,空闲的 Provider 通知导致已完成的 OMP 或 Pi 回复被隐藏的问题 ([#10135](https://github.com/getpaseo/paseo/pull/10135))
|
||||
- 修复 Agent 响应后台任务时,在之前的完成状态未读的情况下重复发送完成通知的问题 ([#10200](https://github.com/getpaseo/paseo/pull/10200))
|
||||
- 修复空对话在回复中途重连后丢失提示词和回复开头的问题 ([#9723](https://github.com/getpaseo/paseo/pull/9723),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复切换 Claude 思考级别时停止后台任务的问题 ([#10008](https://github.com/getpaseo/paseo/pull/10008),贡献者:[@gilad-rubin](https://github.com/gilad-rubin))
|
||||
- 修复共享 OpenCode 服务停止后轮次一直显示为运行中的问题 ([#10187](https://github.com/getpaseo/paseo/pull/10187))
|
||||
- 修复 OMP 提供会话或授权选项时拒绝已批准工具调用的问题 ([#10126](https://github.com/getpaseo/paseo/pull/10126),贡献者:[@dsingal0](https://github.com/dsingal0))
|
||||
- 修复 Codex 消息在轮次开始前停止时显示错误而非已取消的问题 ([#9931](https://github.com/getpaseo/paseo/pull/9931),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复 Git 元数据监听达到上限时无法打开“更改”的问题 ([#10188](https://github.com/getpaseo/paseo/pull/10188))
|
||||
- 修复将选中的回复复制到纯文本目标时出现多余 Markdown 语法的问题 ([#10079](https://github.com/getpaseo/paseo/pull/10079),贡献者:[@danberindei](https://github.com/danberindei))
|
||||
- 修复在预览和源码之间切换时文件视图丢失滚动位置的问题,iOS 的 HTML 预览除外 ([#10195](https://github.com/getpaseo/paseo/pull/10195),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- 修复拆分窗格中的文件标签页显示或聚焦错误文件的问题 ([#9888](https://github.com/getpaseo/paseo/pull/9888),贡献者:[@KosmoCHE](https://github.com/KosmoCHE))
|
||||
- 修复触摸屏上的子菜单打开后立即关闭的问题 ([#10175](https://github.com/getpaseo/paseo/pull/10175),贡献者:[@christiantwu](https://github.com/christiantwu))
|
||||
- 修复关闭另一个使用过麦克风的对话后无法听写的问题 ([#10185](https://github.com/getpaseo/paseo/pull/10185),贡献者:[@Brandon168](https://github.com/Brandon168))
|
||||
- 修复 Android 缩放对话图片后 Composer 点击失效的问题 ([#10057](https://github.com/getpaseo/paseo/pull/10057))
|
||||
- 修复 Samsung DeX 上的文字被裁剪的问题 ([#9995](https://github.com/getpaseo/paseo/pull/9995),贡献者:[@easyhunjune](https://github.com/easyhunjune))
|
||||
- 修复主机连接缓慢后对话中的工作区图片无法加载的问题 ([#10111](https://github.com/getpaseo/paseo/pull/10111),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复桌面浏览器截图返回全透明图片的问题 ([#9807](https://github.com/getpaseo/paseo/pull/9807),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- 修复 Mermaid 流程图标签含有 `@` 时显示源码而非图表的问题 ([#10165](https://github.com/getpaseo/paseo/pull/10165),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- 修复隐藏的后台工作区触发程序坞徽标和网站图标状态的问题 ([#9983](https://github.com/getpaseo/paseo/pull/9983))
|
||||
- 修复桌面侧边栏导航占满工作区列表空间的问题 ([#9903](https://github.com/getpaseo/paseo/pull/9903),贡献者:[@pentatonic-alex](https://github.com/pentatonic-alex))
|
||||
- 修复仓库默认分支显示历史已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
- 修复 Provider 关闭会话后插件 Agent 无法重新打开的问题 ([#10153](https://github.com/getpaseo/paseo/pull/10153))
|
||||
- 修复插件页面和设置无法使用插件状态钩子的问题 ([#10049](https://github.com/getpaseo/paseo/pull/10049))
|
||||
- 修复 Codex 消息在轮次开始前停止时显示错误而非已取消的问题 ([#9931](https://github.com/getpaseo/paseo/pull/9931),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复仓库默认分支显示历史已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
|
||||
### 插件
|
||||
|
||||
- 新增插件导航 `focusHost` 选项,打开工作区或 Agent 时在侧边栏选中目标主机 ([#5574](https://github.com/getpaseo/paseo/pull/5574),贡献者:[@discwl](https://github.com/discwl))
|
||||
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
|
||||
+5
-14
@@ -150,22 +150,13 @@ Users can also detach an existing subagent from the subagents track. Detach is d
|
||||
|
||||
`notifyOnFinish` defaults to `true` for agent-scoped creation and prompt follow-ups because most delegated work needs to report back to the creating agent. Set it to `false` for explicit reporting or no completion callback.
|
||||
|
||||
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch. The module keeps one ordered queue per recipient, and the recipient reads its prompts in the order the daemon admitted them. Nothing overtakes an older queued message. A prompt takes its place when the daemon admits it, even while the provider is still starting an earlier turn, and a message stays in the queue until the turn that carries it starts. The turn has started when the agent manager acknowledges the run start; a turn that fails after that point is not delivered again.
|
||||
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch. Idle recipients retain the two-second quiet window. While a recipient has a running or starting turn (including compaction), messages stay queued across quiet windows and are delivered together after that turn settles, including failure or cancellation. A ready batch is released when the daemon observes the recipient settle; the two-second timer also retries it. Agent callers using `steer`, including the default, wait for the turn to end; only explicit `interrupt` replaces a running turn. An explicit interrupt or a command the provider accepts out of band runs before earlier queued messages. Those messages stay queued and are delivered after the running or replacement turn ends. Human prompts dispatch directly with their existing behavior. Conflicting session-mode choices retain separate ordered dispatches.
|
||||
|
||||
- **`steer`** (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.
|
||||
- **`interrupt`** waits for neither the quiet window nor the turn. It is dispatched at admission as one prompt that replaces the running turn: the messages queued before it, then the interrupt. An older `steer` cannot start a turn after the newer `interrupt` that countermands it.
|
||||
- **A person's prompt** (app, CLI, top-level MCP) is dispatched directly with its existing steer or interrupt behavior and takes the queue along the same way: the messages admitted before it first, then the person's text, in one provider prompt. Messages admitted after it follow it. The person's text keeps its own transcript row. When the turn does not start, the messages return to the queue in their place. That covers a start the provider rejects and a start that is not acknowledged within 60 seconds; a provider that starts the turn after those 60 seconds receives the messages twice.
|
||||
- **Stop** (the stop button, Escape, `cancel_agent`, a Hub interrupt) starts nothing. Messages admitted before the Stop are held, not dropped, including an interrupt whose turn had not started yet. They go ahead of the recipient's next prompt, in that prompt's turn: a person's prompt, or an agent message or notification admitted after the Stop. A held interrupt no longer interrupts; it waits like a `steer`. 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 `steer` keeps its quiet window.
|
||||
|
||||
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 an `interrupt` that runs this way takes no queued message along. A person's command leaves the queue where it is. A prompt is a command when it starts with a slash and a name that has no second slash, so `/compact` is one and `/tmp/build.log is stale` is plain text.
|
||||
|
||||
One provider prompt has one session mode. A batch released by an interrupt or a person's prompt uses the latest explicit choice in it, the person's own first. Steers with conflicting choices keep separate ordered dispatches.
|
||||
|
||||
The pending message window is in memory. Clean shutdown flushes it, held messages included, before
|
||||
closing agents; an abrupt crash can lose queued prompts. A durable send receipt remains pending until actual dispatch
|
||||
The pending message window is in memory. Clean shutdown flushes it before closing agents; an abrupt
|
||||
crash can lose queued prompts. A durable send receipt remains pending until actual dispatch
|
||||
acknowledgment, so a lost window never becomes a completed receipt. Completion waits cover queued
|
||||
admission within their original timeout and cancellation scope, and return at permission
|
||||
checkpoints and when a Stop holds the queue.
|
||||
admission within their original timeout and cancellation scope, and return permission checkpoints
|
||||
while messages are waiting.
|
||||
|
||||
Finish notification intent has a separate daemon-owned lifetime. The finish-subscriptions module
|
||||
persists caller, child, host, and ownership policy through an injectable store; its JSON adapter uses
|
||||
|
||||
+95
-149
@@ -6,26 +6,21 @@ All workspaces share one version and release together.
|
||||
|
||||
A release has exactly two steps. The agent does the first, the user authorizes the second.
|
||||
|
||||
**Preparation** (reversible — agent does this on the release branch):
|
||||
**Preparation** (reversible — agent does this):
|
||||
|
||||
- resolve the [release base](#release-base-and-source) and get the [release inventory](#release-inventory) approved when one applies
|
||||
- format, lint, typecheck all green
|
||||
- resolve the [release base](#release-base-and-source), get the [release inventory](#release-inventory) approved when one applies, and confirm CI for the resulting release source is green
|
||||
- classify the diff from the previous stable to the release source as patch or minor, then show the
|
||||
target version and rationale to the user
|
||||
- draft `CHANGELOG.md` and `CHANGELOG.zh-CN.md`, show the draft to the user, and wait for review
|
||||
- run the pre-release sanity check (stable only) and surface findings to the user
|
||||
- commit the approved changelog and any requested ACP update, run format, lint, and typecheck, then
|
||||
run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag
|
||||
- push the `release/vX.Y.Z` or `release/vX.Y.Z-beta.N` branch and confirm its `CI` and
|
||||
`Desktop Packages` runs pass (never wait on `main` CI)
|
||||
- draft the changelog, show it to the user, wait for review
|
||||
- run the pre-release sanity check, surface findings to the user
|
||||
|
||||
**Go-ahead** (user says "go ahead"):
|
||||
|
||||
- run `npm run release:ship` (stable) or `npm run release:ship:beta` (beta), which publishes npm
|
||||
with retry and registry visibility checks, advances the `beta` dist-tag on stable when newer, and
|
||||
pushes the tag on the already-verified commit
|
||||
- commit the approved release inputs locally on the release branch
|
||||
- run the release, which publishes npm and pushes the release branch and tag
|
||||
- create the release heartbeat immediately and babysit it to completion
|
||||
- open the [reconcile `main`](#reconcile-main) PR right away so its CI runs in parallel with release
|
||||
builds, then delete the remote release branch once the PR merges
|
||||
- [reconcile `main`](#reconcile-main) with what shipped
|
||||
|
||||
Rules that apply to both steps:
|
||||
|
||||
@@ -92,42 +87,29 @@ An explicit user instruction can select another base.
|
||||
|
||||
1. Fetch `origin` with tags and resolve the base to one commit.
|
||||
2. Create the release workspace through Paseo MCP on a new branch from the base, named
|
||||
`release/vX.Y.Z` or `release/vX.Y.Z-beta.N` for the version being cut. `release:push` refuses
|
||||
`main` and any branch outside `release/*`.
|
||||
`release/vX.Y.Z` or `release/vX.Y.Z-beta.N` for the version being cut. Run the release from
|
||||
this workspace: `release:push` pushes `HEAD` to the current branch.
|
||||
3. Cherry-pick the approved commits in their `main` order with `git cherry-pick -x`, so each
|
||||
commit records the `main` commit it came from. Include the prerequisites the inventory listed.
|
||||
Resolve conflicts within the approved changes and report how. A resolution that needs new
|
||||
behavior is a scope addition: surface it for selection.
|
||||
4. Commit the approved `CHANGELOG.md`, `CHANGELOG.zh-CN.md`, and any explicitly requested ACP
|
||||
catalog update on the release branch. Run `npm run format`, `npm run lint`, and
|
||||
`npm run typecheck`, then run `npm run release:prep:<mode>`. This checks the packages, bumps all
|
||||
workspace versions, generates stable F-Droid changelogs, updates `package-lock.json`, and creates
|
||||
`chore(release): cut <version>` without a tag.
|
||||
5. Push the release branch (`git push -u origin HEAD`). Pushing any `release/**` branch triggers
|
||||
`CI` (all 21 jobs) and `Desktop Packages` (Linux user-namespace smoke) in their own concurrency
|
||||
groups, isolated from `main` traffic. Never wait on `main` CI, because `main` cancels in-progress
|
||||
runs on every merge. Wait for both runs on the release branch commit to pass before shipping.
|
||||
Pushing a `release/**` branch without a `v*` tag triggers no publish workflows.
|
||||
6. After go-ahead, run `npm run release:ship` (stable) or `npm run release:ship:beta` (beta). This
|
||||
publishes to npm and pushes the `v*` tag on the already-verified commit. Because the release
|
||||
branch is already pushed at `HEAD`, no second CI run starts and only the tag release workflows
|
||||
run.
|
||||
7. Start [Reconcile `main`](#reconcile-main) immediately so its PR checks overlap with desktop and
|
||||
EAS builds.
|
||||
|
||||
When promoting or branching from a tag created before `release:prep:*`, `release:ship`, and the
|
||||
`release/**` workflow triggers existed (for example `v0.17.0-beta.1`), either cherry-pick the
|
||||
release-tooling commit onto the release branch (leaving product code unchanged) or follow the
|
||||
older tag's scripts (`version:all:*`, manual `gh workflow run ci.yml --ref <branch>`,
|
||||
`release:publish`, and `release:push`) until the next tag carries the new tooling.
|
||||
4. Confirm CI for the release source. When the source is a commit whose CI already passed (the
|
||||
captured `origin/main`, or the beta tag being promoted), use that run and watch pending CI to
|
||||
completion. Otherwise push the release branch and run `gh workflow run ci.yml --ref <branch>`,
|
||||
because CI push runs target only `main`.
|
||||
5. Keep the changelog, any explicitly requested ACP catalog update, lockfile preparation, and the
|
||||
version commit local until the go-ahead. The release command pushes the release branch and tag
|
||||
as one batch, and the tag push starts the release workflows. Then run
|
||||
`gh workflow run ci.yml --ref <branch>` so CI covers the complete release commit.
|
||||
6. [Reconcile `main`](#reconcile-main).
|
||||
|
||||
A stable hotfix can take the version a patch beta line would promote to, such as `0.13.3`
|
||||
shipping while `0.13.3-beta.2` soaks. Never republish or reuse a shipped version. Continue the line
|
||||
as the next unused patch beta, `0.13.4-beta.1`, from the tested beta tag. No `version:all:*` mode
|
||||
computes that from a prerelease, so run `npm run release:check`, bump with
|
||||
`npm version 0.13.4-beta.1 --include-workspace-root --no-git-tag-version && git commit -m "chore(release): cut 0.13.4-beta.1"`,
|
||||
push the release branch for `CI` and `Desktop Packages`, then ship with `npm run release:ship:beta`.
|
||||
Record the tested beta tag as its source so its soak still counts for the unchanged content.
|
||||
computes that from a prerelease, so follow the [manual steps](#manual-step-by-step) with
|
||||
`npm version 0.13.4-beta.1 --include-workspace-root --message "chore(release): cut %s"` and
|
||||
`npm run release:publish:beta`. Record the tested beta tag as its source so its soak still counts
|
||||
for the unchanged content.
|
||||
|
||||
## Release inventory
|
||||
|
||||
@@ -155,31 +137,19 @@ For a promotion, every item defaults to defer.
|
||||
|
||||
## Reconcile main
|
||||
|
||||
Right after the tag push (in parallel with desktop and EAS builds), open a PR into `main` from a
|
||||
fresh branch off `origin/main` named `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`:
|
||||
After the release push, open a PR into `main` that brings in what shipped and keeps newer
|
||||
development on `main`:
|
||||
|
||||
```bash
|
||||
git fetch origin --tags
|
||||
git checkout -b reconcile/vX.Y.Z origin/main
|
||||
npm run release:reconcile -- --tag vX.Y.Z
|
||||
```
|
||||
- The shipped `CHANGELOG.md` and `CHANGELOG.zh-CN.md` entries, exactly as tagged. A beta or
|
||||
promotion entry replaces the series entry on `main`. A stable hotfix on an older line goes
|
||||
below any newer entries.
|
||||
- The shipped version in every `package.json` and `package-lock.json`, unless `main` already
|
||||
carries a newer version, plus the F-Droid changelog files a stable release generates.
|
||||
- No claims about unshipped work: a shipped entry describes only the tagged content, and notes
|
||||
`main` holds for changes that have not shipped stay out of it.
|
||||
|
||||
`scripts/reconcile-release.mjs` updates the working tree without cherry-picking stale lockfile
|
||||
hunks from the release base:
|
||||
|
||||
- Copies the tagged `CHANGELOG.md` and `CHANGELOG.zh-CN.md` entries verbatim. A beta or promotion
|
||||
entry replaces the series beta entry on `main`. A stable hotfix on an older line is placed below
|
||||
any newer entries.
|
||||
- Copies the generated F-Droid changelog files from the tag for stable releases.
|
||||
- Updates every `package.json` version and regenerates `package-lock.json` on top of current `main`
|
||||
only when the shipped version is newer than `main`'s version.
|
||||
- Leaves unshipped work on `main` untouched and makes no claims about unshipped work in the
|
||||
changelog entry.
|
||||
|
||||
Commit, open the PR into `main`, and merge once its checks pass. After the reconcile PR merges and
|
||||
the release completes, delete the remote release branch (`git push origin --delete release/vX.Y.Z`
|
||||
or `release/vX.Y.Z-beta.N`). The tag is the record of shipped source; Paseo maintains no release
|
||||
track besides `main`.
|
||||
Delete the release branch once the PR merges. The tag is the record of shipped source; Paseo
|
||||
maintains no release track besides `main`.
|
||||
|
||||
## ACP catalog updates
|
||||
|
||||
@@ -219,42 +189,35 @@ as described in **Fixing a failed release build**.
|
||||
|
||||
## Standard release (stable)
|
||||
|
||||
Before preparing a stable release on `release/vX.Y.Z`:
|
||||
Before running any stable release command:
|
||||
|
||||
- Commit the approved `CHANGELOG.md`, `CHANGELOG.zh-CN.md`, and any requested ACP update.
|
||||
- Run `npm run format`, `npm run lint`, and `npm run typecheck`, commit any resulting changes, and
|
||||
confirm the working tree is clean.
|
||||
- Do not use a release command as a substitute for checking whether the current commit is ready.
|
||||
- Make sure the release source passed CI, the approved release inputs are committed locally on the release branch, and the working tree is clean.
|
||||
- **Run `npm run format`, `npm run lint`, and `npm run typecheck` and commit any resulting changes BEFORE you start any `release:*` command.** `release:check` runs `npm install --workspaces --include-workspace-root` as part of `release:prepare`, which can mutate `package-lock.json` (e.g. churning `"dev": true` markers on optional deps). The next step, `version:all:*`, runs `npm version` which aborts when the working tree is dirty. If this happens mid-flight you have to commit the lockfile churn before retrying — and the pre-commit format hook will reject a lockfile-only commit because oxfmt internally skips `package-lock.json` while lefthook's glob still matches it. Avoid the whole mess by running format/lint/typecheck first, then `release:prepare` once on its own to absorb any lockfile churn into a normal commit, then start the release.
|
||||
- Do not use a release command as a substitute for checking whether the current commit is actually ready.
|
||||
|
||||
```bash
|
||||
# 1. Preparation (reversible): run checks and commit the version bump without tagging.
|
||||
npm run release:prep:patch
|
||||
# or:
|
||||
npm run release:prep:minor
|
||||
|
||||
# 2. Push the release branch and wait for CI + Desktop Packages on this commit.
|
||||
git push -u origin HEAD
|
||||
|
||||
# 3. After go-ahead and green release-branch checks: publish npm and push the tag.
|
||||
npm run release:ship
|
||||
# Run exactly one, matching the approved decision:
|
||||
npm run release:patch
|
||||
npm run release:minor
|
||||
```
|
||||
|
||||
`release:ship` runs `scripts/publish-release-packages.mjs` and `scripts/push-current-release-tag.mjs`:
|
||||
This bumps the version across all workspaces, runs checks, publishes to npm, and pushes the branch + tag. The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, and `Release Notes Sync` on GitHub Actions. The workflows create the GitHub Release as a draft while builds and release-note sync run. EAS picks up the same tag via the EAS GitHub app and starts the iOS + Android store builds in parallel (see "Mobile builds (EAS)" below) — there is no mobile-release workflow under `.github/workflows`.
|
||||
|
||||
- Publishes all seven `@getpaseo/*` packages in dependency order, skips versions already on npm,
|
||||
retries transient 429/5xx/network errors, and waits until each version is visible on npm before
|
||||
continuing.
|
||||
- Checks `npm view @getpaseo/cli dist-tags` and moves npm's `beta` dist-tag to the new stable
|
||||
version across all seven packages whenever the stable version is newer than `beta` (leaving
|
||||
`beta` untouched during a stable hotfix on an older line).
|
||||
- Refuses non-`release/*` branches, tags `HEAD` with `vX.Y.Z`, and pushes the tag. Because `HEAD`
|
||||
is already on the release branch, no second CI run starts.
|
||||
After the stable release succeeds, check `npm view @getpaseo/cli dist-tags`. When the new stable
|
||||
is newer than `beta`, move `beta` to it for every published package. This changes dist-tags only;
|
||||
do not republish the packages:
|
||||
|
||||
The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, and `Release Notes Sync` on GitHub Actions. The workflows create the GitHub Release as a draft while builds and release-note sync run. EAS picks up the same tag via the EAS GitHub app and starts the iOS + Android store builds in parallel (see "Mobile builds (EAS)" below) — there is no mobile-release workflow under `.github/workflows`.
|
||||
```bash
|
||||
PASEO_VERSION=$(node -p "require('./package.json').version")
|
||||
for package in highlight relay protocol client plugin server cli; do
|
||||
npm dist-tag add "@getpaseo/$package@$PASEO_VERSION" beta
|
||||
done
|
||||
```
|
||||
|
||||
Verify `npm view @getpaseo/cli dist-tags` shows `latest` at the shipped version, and `beta` at the shipped version or an active newer beta, before considering the stable release complete.
|
||||
Verify `latest` resolves to `PASEO_VERSION`, and `beta` resolves to `PASEO_VERSION` or the
|
||||
active newer beta, before considering the stable release complete.
|
||||
|
||||
The Docker workflow builds images from the checked-out source tree on `main` as non-publishing checks (cancelling superseded `main` runs). Stable `vX.Y.Z` tag pushes publish `ghcr.io/getpaseo/paseo:X.Y.Z` and `ghcr.io/getpaseo/paseo:latest`; beta `vX.Y.Z-beta.N` tag pushes publish only `ghcr.io/getpaseo/paseo:X.Y.Z-beta.N` and never move `latest`.
|
||||
The Docker workflow builds images from the checked-out source tree on pull requests and on `main` as non-publishing checks. Stable `vX.Y.Z` tag pushes publish `ghcr.io/getpaseo/paseo:X.Y.Z` and `ghcr.io/getpaseo/paseo:latest`; beta `vX.Y.Z-beta.N` tag pushes publish only `ghcr.io/getpaseo/paseo:X.Y.Z-beta.N` and never move `latest`.
|
||||
|
||||
The production relay is the Elixir service in [getpaseo/paseo-relay](https://github.com/getpaseo/paseo-relay), with its own deployment process. Paseo releases and pushes to this repository do not deploy it. The Cloudflare relay code and workflow in this repository are legacy and are not used in production.
|
||||
|
||||
@@ -265,43 +228,29 @@ The production relay is the Elixir service in [getpaseo/paseo-relay](https://git
|
||||
```bash
|
||||
npm run typecheck # Verify the exact commit you intend to release
|
||||
npm run release:check # Typecheck, build, dry-run pack
|
||||
# Run exactly one approved version command (commits without tagging):
|
||||
# Run exactly one approved version command:
|
||||
npm run version:all:patch
|
||||
npm run version:all:minor
|
||||
git push -u origin HEAD # Trigger CI + Desktop Packages on release/vX.Y.Z
|
||||
# Wait for CI and Desktop Packages on this branch to pass, then after go-ahead:
|
||||
npm run release:publish # Publish to npm (idempotent, with propagation + beta dist-tag sync)
|
||||
npm run release:push # Create tag vX.Y.Z on HEAD and push (triggers release workflows)
|
||||
npm run release:publish # Publish to npm
|
||||
npm run release:push # Push HEAD + tag (triggers CI workflows)
|
||||
# Then move npm's beta dist-tag to this stable version when it is newer than beta (see above).
|
||||
```
|
||||
|
||||
## Beta flow
|
||||
|
||||
```bash
|
||||
# 1. Preparation (reversible) on release/vX.Y.Z-beta.N:
|
||||
npm run release:prep:beta:patch # Start the next patch beta line
|
||||
# or:
|
||||
npm run release:prep:beta:minor # Start the next minor beta line
|
||||
# or for follow-up betas:
|
||||
npm run release:prep:beta:next # Cut X.Y.Z-beta.2, beta.3, ...
|
||||
|
||||
# 2. Push the release branch and wait for CI + Desktop Packages to pass:
|
||||
git push -u origin HEAD
|
||||
|
||||
# 3. After go-ahead:
|
||||
npm run release:ship:beta
|
||||
|
||||
# Later, after soak, promote on release/vX.Y.Z:
|
||||
npm run release:prep:promote
|
||||
git push -u origin HEAD
|
||||
# Wait for CI + Desktop Packages to pass, then after go-ahead:
|
||||
npm run release:ship
|
||||
npm run release:beta:patch # Start the next patch beta line
|
||||
npm run release:beta:minor # Start the next minor beta line
|
||||
# ... test desktop and APK prerelease assets from GitHub Releases ...
|
||||
npm run release:beta:next # Optional: cut X.Y.Z-beta.2, beta.3, ...
|
||||
npm run release:promote # Promote X.Y.Z-beta.N to stable X.Y.Z
|
||||
```
|
||||
|
||||
- Beta tags are published GitHub prereleases like `v0.1.41-beta.1`
|
||||
- Betas publish npm packages with `--tag beta`, so `npm install @getpaseo/cli@beta` opts in while plain `npm install @getpaseo/cli` stays on `latest`
|
||||
- The user-facing beta instructions, including the public TestFlight join link for the `Paseo Beta` group, live in `public-docs/updates.md` and its `zh-CN` pair. Update them when a beta path is added or removed.
|
||||
- Betas publish desktop assets and APKs for testing. They also build iOS, upload it to TestFlight, add it to the `Paseo Beta` external group, and submit it for Beta App Review. They do not submit mobile builds to the production stores.
|
||||
- `release:prep:promote` + `release:ship` creates a fresh stable tag like `v0.1.41`; the final release never reuses the beta tag
|
||||
- `release:promote` creates a fresh stable tag like `v0.1.41`; the final release never reuses the beta tag
|
||||
- Desktop assets now come from the Electron package at `packages/desktop`
|
||||
- Require the Linux artifact CI checks with both restricted and usable user namespaces to pass before publication; see [packaged desktop smoke](testing.md#packaged-desktop-smoke). Keep the installed-package and AppImage checks together.
|
||||
- Beta releases use Electron's `beta` update channel. Users on the stable channel only receive stable releases; users on the beta channel receive beta releases and the final stable release when it is published.
|
||||
@@ -329,17 +278,17 @@ Drafts do not appear in GitHub's releases feed. Updater clients continue to see
|
||||
|
||||
### Default behavior
|
||||
|
||||
`npm run release:prep:patch` or `npm run release:prep:minor` → push release branch → green checks → `npm run release:ship` → tag push → 36h ramp. No extra action needed.
|
||||
`npm run release:patch` or `npm run release:minor` → tag push → 36h ramp. No extra action needed.
|
||||
|
||||
The `rollout_hours` input on `desktop-release.yml` is **only read on `workflow_dispatch`** — tag-push runs always default to 36. To get any other rollout duration on a fresh release, use the post-publish flip below.
|
||||
|
||||
### Instant-admit release (rollout_hours=0)
|
||||
|
||||
Tag-push runs from `npm run release:ship` always stamp 36 hours. To admit everyone immediately (hotfix, doc-only change, a release you want out fast), ship the release normally, wait for it to publish, then flip the manifests:
|
||||
`npm run release:patch` and `npm run release:minor` tag-push, and tag-push runs always stamp 36 hours. To admit everyone immediately (hotfix, doc-only change, a release you want out fast), cut the release normally, wait for it to publish, then flip the manifests:
|
||||
|
||||
```bash
|
||||
# 1. Ship the verified release branch (36h ramp from tag push).
|
||||
npm run release:ship
|
||||
# 1. Cut and publish (36h ramp from tag push).
|
||||
npm run release:patch
|
||||
|
||||
# 2. Wait for Desktop Release to publish the GitHub Release.
|
||||
gh run watch <desktop-release-run-id> --exit-status
|
||||
@@ -390,7 +339,7 @@ gh workflow run desktop-release.yml \
|
||||
-f rollout_hours=6
|
||||
```
|
||||
|
||||
This does **not** apply to fresh releases shipped via `npm run release:ship` — tag-push runs always stamp 36. For a fresh release with a custom ramp, ship normally and then dispatch `desktop-rollout.yml` (same pattern as the instant-admit flow above, with your chosen `rollout_hours`).
|
||||
This does **not** apply to fresh releases cut via `npm run release:patch` or `npm run release:minor` — those paths always tag-push and stamp 36. For a fresh release with a custom ramp, cut normally and then dispatch `desktop-rollout.yml` (same pattern as the instant-admit flow above, with your chosen `rollout_hours`).
|
||||
|
||||
### Releasing during an active rollout
|
||||
|
||||
@@ -500,11 +449,10 @@ that resumes the release in the current conversation. Create it automatically
|
||||
with `create_heartbeat`. The heartbeat owns the release until it either reaches
|
||||
the completion checklist or finds a failure that needs new user authority.
|
||||
|
||||
Each heartbeat checks the release tag commit, `CI` and `Desktop Packages` for the release branch,
|
||||
every tag-triggered GitHub Actions run (`Desktop Release`, `Android APK Release`, `Docker`,
|
||||
`Release Notes Sync`), npm dist-tags, the GitHub Release body and assets, desktop updater
|
||||
manifests, the published Docker image, the applicable EAS workflow, the reconcile PR, and remote
|
||||
release branch cleanup. Inspect the GitHub Release itself and confirm that the macOS, Linux,
|
||||
Each heartbeat checks the release tag commit, all GitHub Actions runs for the
|
||||
release branch and tag, npm dist-tags, the GitHub Release body and assets,
|
||||
desktop updater manifests, the published Docker image, and the applicable EAS
|
||||
workflow. Inspect the GitHub Release itself and confirm that the macOS, Linux,
|
||||
Windows, and Android APK assets are present along with the channel manifests
|
||||
(`latest-mac.yml`, `latest-linux.yml`, and `latest.yml` for stable;
|
||||
`beta-mac.yml`, `beta-linux.yml`, and `beta.yml` for beta).
|
||||
@@ -513,9 +461,8 @@ For stable releases, also confirm every required mobile build, external
|
||||
TestFlight distribution, Beta App Review submission, and store submission job
|
||||
for the release commit. For betas, confirm
|
||||
the beta EAS workflow completed its TestFlight distribution and Beta App Review
|
||||
path. Once the reconcile PR merges and every applicable checklist item passes,
|
||||
delete the remote release branch (`git push origin --delete release/vX.Y.Z` or
|
||||
`release/vX.Y.Z-beta.N`), delete the heartbeat, and report the release as shipped.
|
||||
path. Delete the heartbeat only after every applicable checklist item passes,
|
||||
then report the release as shipped.
|
||||
|
||||
Pattern:
|
||||
|
||||
@@ -527,7 +474,7 @@ Pattern:
|
||||
"timezone": "UTC",
|
||||
"maxRuns": 120,
|
||||
"expiresIn": "24h",
|
||||
"prompt": "Resume the vX.Y.Z release babysit for commit <sha>. Check npm tags; CI and Desktop Packages on release/vX.Y.Z; every tag-triggered GitHub Actions run; the published GitHub Release body, expected desktop/APK assets, and channel manifests; the Docker image; the matching EAS workflow; and the reconcile PR into main. Completion requires every applicable checklist item. For stable, require build_ios, distribute_ios (Paseo Beta external distribution and Beta App Review submission), submit_ios_for_review, build_android, and submit_android to succeed. For beta, require the beta TestFlight distribution and Beta App Review path. If work is pending, wait for the next heartbeat. If a failure can be retried safely for the same version, follow the failed-release procedure; otherwise report the blocker. When every applicable completion-checklist item passes and the reconcile PR is merged, delete origin/release/vX.Y.Z, delete THIS heartbeat, report shipped, and stop.",
|
||||
"prompt": "Resume the vX.Y.Z release babysit for commit <sha>. Check npm tags; every GitHub Actions run for the release branch and tag; the published GitHub Release body, expected desktop/APK assets, and channel manifests; the Docker image; and the matching EAS workflow. Completion requires every applicable checklist item. For stable, require build_ios, distribute_ios (Paseo Beta external distribution and Beta App Review submission), submit_ios_for_review, build_android, and submit_android to succeed. For beta, require the beta TestFlight distribution and Beta App Review path. If work is pending, wait for the next heartbeat. If a failure can be retried safely for the same version, follow the failed-release procedure; otherwise report the blocker. When every applicable completion-checklist item passes, delete THIS heartbeat, report shipped, and stop.",
|
||||
}
|
||||
```
|
||||
|
||||
@@ -629,16 +576,12 @@ intentionally unavailable to desktop updater clients.
|
||||
|
||||
## Notes
|
||||
|
||||
- `version:all:*` bumps root, syncs workspace versions and `@getpaseo/*` dependency versions, and
|
||||
commits `chore(release): cut <version>` without creating a tag. `release:push` creates and pushes
|
||||
the tag atomically after release-branch CI passes.
|
||||
- `release:push` refuses `main` and any branch outside `release/*`.
|
||||
- The npm `version` lifecycle regenerates F-Droid changelog files from `CHANGELOG.md` for stable releases only (`npm run fdroid:changelogs`) and stages them, so the release commit and tag carry them. Betas are a no-op. A stable run **aborts the release** if `CHANGELOG.md` has no entry for the version being cut — commit the changelog entry first. See [docs/android.md](android.md) for why these files are generated per ABI.
|
||||
- `release:prepare` refreshes workspace `node_modules` links to prevent stale types.
|
||||
- `npm run dev:desktop` and `npm run build:desktop` target the Electron desktop package in `packages/desktop`.
|
||||
- `release:publish` and `release:publish:beta` run `scripts/publish-release-packages.mjs`: if a run
|
||||
fails partway through, re-running skips versions already published on npm, retries transient
|
||||
registry errors, and waits for each version to become visible on npm before continuing.
|
||||
- `version:all:*` bumps root + syncs workspace versions and `@getpaseo/*` dependency versions
|
||||
- The npm `version` lifecycle regenerates F-Droid changelog files from `CHANGELOG.md` for stable releases only (`npm run fdroid:changelogs`) and stages them, so the release tag carries them. Betas are a no-op. A stable run **aborts the release** if `CHANGELOG.md` has no entry for the version being cut — commit the changelog entry first. See [docs/android.md](android.md) for why these files are generated per ABI.
|
||||
- `release:prepare` refreshes workspace `node_modules` links to prevent stale types
|
||||
- `npm run dev:desktop` and `npm run build:desktop` target the Electron desktop package in `packages/desktop`
|
||||
- If `release:publish` partially fails, re-run it — npm skips already-published versions
|
||||
- If `release:publish:beta` partially fails, re-run it — npm skips already-published versions and keeps prereleases off `latest` because every publish uses `--tag beta`
|
||||
- The website uses GitHub's latest published release API for download links, so published beta prereleases do not replace the stable download target.
|
||||
|
||||
## Changelog format
|
||||
@@ -859,12 +802,13 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
|
||||
### Beta release
|
||||
|
||||
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory)
|
||||
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory), and CI for the release source is green
|
||||
- [ ] Every PR in the release range has been opened, and its full description and every linked issue have been read before drafting the changelog
|
||||
- [ ] Fold this beta into the series' single `CHANGELOG.md` entry (heading `## X.Y.Z-beta.N - YYYY-MM-DD`, previous stable → release source), review it against the changelog policy, get approval, and commit it with its [`CHANGELOG.zh-CN.md` translation](#changelog-translations) before running `release:prep:*`
|
||||
- [ ] Fold this beta into the series' single `CHANGELOG.md` entry (heading `## X.Y.Z-beta.N - YYYY-MM-DD`, previous stable → release source), review it against the changelog policy, get approval, and commit it with its [`CHANGELOG.zh-CN.md` translation](#changelog-translations) before cutting the release
|
||||
- [ ] The diff from the previous stable to the resolved release source is classified as patch or minor, with the target version and rationale approved
|
||||
- [ ] `npm run release:prep:beta:patch`, `release:prep:beta:minor`, or `release:prep:beta:next` created the version commit on `release/vX.Y.Z-beta.N` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI)
|
||||
- [ ] After go-ahead, `npm run release:ship:beta` published npm and pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run
|
||||
- [ ] The changelog, ACP, lockfile, and version commits stayed local until the approved release command pushed the release branch and tag
|
||||
- [ ] `npm run release:beta:patch`, `npm run release:beta:minor`, or `npm run release:beta:next` completes successfully
|
||||
- [ ] Every GitHub Actions run for the complete release commit and tag is green
|
||||
- [ ] npm shows the version under the `beta` dist-tag, not `latest`
|
||||
- [ ] The GitHub prerelease was published only after the three beta manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
|
||||
- [ ] GitHub `Desktop Release` workflow for the `v*-beta.N` tag is green
|
||||
@@ -873,21 +817,23 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] GitHub `Docker` workflow is green and the versioned beta image is published without moving `latest`
|
||||
- [ ] GitHub `Release Notes Sync` mirrored the beta entry into the prerelease body
|
||||
- [ ] EAS `Release iOS Beta` completed its build, TestFlight distribution, external beta group, and Beta App Review path
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`, and `origin/release/vX.Y.Z-beta.N` was deleted
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`
|
||||
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
|
||||
|
||||
### Stable release (or promotion)
|
||||
|
||||
- [ ] Run the pre-release sanity check (see above) and address any findings
|
||||
- [ ] The diff from the previous stable to the resolved release source is classified as patch or minor, with the target version and rationale approved
|
||||
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory)
|
||||
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory), and CI for the release source is green
|
||||
- [ ] A promotion ships the tested beta's product content after its soak, unless the user explicitly overrode either default
|
||||
- [ ] Every PR in the release range has been opened, and its full description and every linked issue have been read before drafting the changelog
|
||||
- [ ] Ensure the approved release inputs are committed locally and the git worktree is clean before running any release command
|
||||
- [ ] Ensure local `npm run typecheck` passes on that exact commit before running any release command
|
||||
- [ ] Update `CHANGELOG.md` with user-facing release notes (features, fixes — not refactors). Promotion renames the series' `## X.Y.Z-beta.N` entry to `## X.Y.Z - YYYY-MM-DD` and re-checks it covers the full release. Commit the matching [`CHANGELOG.zh-CN.md` entry](#changelog-translations) with it
|
||||
- [ ] Verify the changelog heading follows strict `## X.Y.Z - YYYY-MM-DD` format
|
||||
- [ ] Ensure local format, lint, and typecheck pass and the working tree is clean before running `release:prep:*`
|
||||
- [ ] `npm run release:prep:patch`, `release:prep:minor`, or `release:prep:promote` created the version commit on `release/vX.Y.Z` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI)
|
||||
- [ ] After go-ahead, `npm run release:ship` published npm, updated dist-tags, and pushed the `vX.Y.Z` tag without triggering a second CI run
|
||||
- [ ] The changelog, ACP, lockfile, and version commits stayed local until the approved release command pushed the release branch and tag
|
||||
- [ ] `npm run release:patch`, `npm run release:minor`, or `npm run release:promote` completes successfully
|
||||
- [ ] Every GitHub Actions run for the complete release commit and tag is green
|
||||
- [ ] `latest` resolves to the new stable, and `beta` resolves to it too unless an active newer beta holds `beta`
|
||||
- [ ] The GitHub Release was published only after the three stable manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
|
||||
- [ ] GitHub `Desktop Release` workflow for the `v*` tag is green
|
||||
@@ -902,5 +848,5 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] EAS iOS `submit_ios_for_review` succeeds, putting the build into App Store review
|
||||
- [ ] EAS Android `build_android` completes for the same tag
|
||||
- [ ] EAS Android `submit_android` succeeds, putting the build on its Play Store track
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries, F-Droid changelogs, and version into `main`, and `origin/release/vX.Y.Z` was deleted
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`
|
||||
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,3 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,3 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,3 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-esZ6cghL+VfK01yLZlFIK/M94+q0a2e+od3rvA3lPqo=
|
||||
sha256-gUBXG6rGxAAMUDgSXQw6GzkJ8U0xEoL9X/kZkLM4uxg=
|
||||
|
||||
Generated
+28
-38
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -6651,15 +6651,6 @@
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/plus-jakarta-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/plus-jakarta-sans/-/plus-jakarta-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-/l/4r0yyWK9JzAlmA0LiYgGgmJe/Gswt4jTJEzr5QhJfwMbvJZDmYWyW0M4X7yCK69BajMVlV/Lx8g7WDc1+sw==",
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@getpaseo/app": {
|
||||
"resolved": "packages/app",
|
||||
"link": true
|
||||
@@ -37477,7 +37468,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -39647,13 +39638,13 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/server": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@getpaseo/server": "0.17.0",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -39900,11 +39891,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@getpaseo/relay": "0.17.0",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -39916,7 +39907,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40159,7 +40150,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40205,7 +40196,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40235,7 +40226,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40243,8 +40234,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40254,8 +40245,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40277,7 +40268,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40305,7 +40296,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40527,17 +40518,17 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/highlight": "0.17.0-beta.1",
|
||||
"@getpaseo/plugin": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/highlight": "0.17.0",
|
||||
"@getpaseo/plugin": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@getpaseo/relay": "0.17.0",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
@@ -41484,12 +41475,11 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
"@fontsource-variable/geist": "^5.3.0",
|
||||
"@fontsource-variable/plus-jakarta-sans": "^5.3.0",
|
||||
"@getpaseo/protocol": "*",
|
||||
"@tanstack/react-router": "^1.170.16",
|
||||
"@tanstack/react-start": "^1.168.26",
|
||||
@@ -43095,7 +43085,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+13
-16
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
@@ -110,22 +110,19 @@
|
||||
"version:all:beta:next": "node scripts/set-release-version.mjs --mode beta-next",
|
||||
"version:all:promote": "node scripts/set-release-version.mjs --mode promote",
|
||||
"release:check": "npm run release:prepare && npm run typecheck --workspace=@getpaseo/highlight && npm run typecheck --workspace=@getpaseo/relay && npm run typecheck --workspace=@getpaseo/protocol && npm run build:client:clean && npm run typecheck --workspace=@getpaseo/client && npm run typecheck --workspace=@getpaseo/plugin && npm run build:server:clean && npm run typecheck --workspace=@getpaseo/server && npm run typecheck --workspace=@getpaseo/cli && npm pack --dry-run --workspace=@getpaseo/highlight && npm pack --dry-run --workspace=@getpaseo/relay && npm pack --dry-run --workspace=@getpaseo/protocol && npm pack --dry-run --workspace=@getpaseo/client && npm pack --dry-run --workspace=@getpaseo/plugin && npm pack --dry-run --workspace=@getpaseo/server && npm pack --dry-run --workspace=@getpaseo/cli",
|
||||
"release:prep:patch": "npm run release:check && npm run version:all:patch",
|
||||
"release:prep:minor": "npm run release:check && npm run version:all:minor",
|
||||
"release:prep:major": "npm run release:check && npm run version:all:major",
|
||||
"release:prep:beta:patch": "npm run release:check && npm run version:all:beta:patch",
|
||||
"release:prep:beta:minor": "npm run release:check && npm run version:all:beta:minor",
|
||||
"release:prep:beta:major": "npm run release:check && npm run version:all:beta:major",
|
||||
"release:prep:beta:next": "npm run release:check && npm run version:all:beta:next",
|
||||
"release:prep:promote": "npm run release:check && npm run version:all:promote",
|
||||
"release:publish:dry-run": "node scripts/publish-release-packages.mjs --dry-run",
|
||||
"release:publish:beta:dry-run": "node scripts/publish-release-packages.mjs --beta --dry-run",
|
||||
"release:publish": "node scripts/publish-release-packages.mjs",
|
||||
"release:publish:beta": "node scripts/publish-release-packages.mjs --beta",
|
||||
"release:publish:dry-run": "npm publish --dry-run --workspace=@getpaseo/highlight --access public && npm publish --dry-run --workspace=@getpaseo/relay --access public && npm publish --dry-run --workspace=@getpaseo/protocol --access public && npm publish --dry-run --workspace=@getpaseo/client --access public && npm publish --dry-run --workspace=@getpaseo/plugin --access public && npm publish --dry-run --workspace=@getpaseo/server --access public && npm publish --dry-run --workspace=@getpaseo/cli --access public",
|
||||
"release:publish:beta:dry-run": "npm publish --dry-run --workspace=@getpaseo/highlight --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/relay --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/protocol --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/client --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/plugin --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/server --access public --tag beta && npm publish --dry-run --workspace=@getpaseo/cli --access public --tag beta",
|
||||
"release:publish": "npm publish --workspace=@getpaseo/highlight --access public && npm publish --workspace=@getpaseo/relay --access public && npm publish --workspace=@getpaseo/protocol --access public && npm publish --workspace=@getpaseo/client --access public && npm publish --workspace=@getpaseo/plugin --access public && npm publish --workspace=@getpaseo/server --access public && npm publish --workspace=@getpaseo/cli --access public",
|
||||
"release:publish:beta": "npm publish --workspace=@getpaseo/highlight --access public --tag beta && npm publish --workspace=@getpaseo/relay --access public --tag beta && npm publish --workspace=@getpaseo/protocol --access public --tag beta && npm publish --workspace=@getpaseo/client --access public --tag beta && npm publish --workspace=@getpaseo/plugin --access public --tag beta && npm publish --workspace=@getpaseo/server --access public --tag beta && npm publish --workspace=@getpaseo/cli --access public --tag beta",
|
||||
"release:push": "node scripts/push-current-release-tag.mjs",
|
||||
"release:ship": "node scripts/push-current-release-tag.mjs --check && npm run release:publish && npm run release:push",
|
||||
"release:ship:beta": "node scripts/push-current-release-tag.mjs --check && npm run release:publish:beta && npm run release:push",
|
||||
"release:reconcile": "node scripts/reconcile-release.mjs"
|
||||
"release:beta:patch": "npm run release:check && npm run version:all:beta:patch && npm run release:publish:beta && npm run release:push",
|
||||
"release:beta:minor": "npm run release:check && npm run version:all:beta:minor && npm run release:publish:beta && npm run release:push",
|
||||
"release:beta:major": "npm run release:check && npm run version:all:beta:major && npm run release:publish:beta && npm run release:push",
|
||||
"release:beta:next": "npm run release:check && npm run version:all:beta:next && npm run release:publish:beta && npm run release:push",
|
||||
"release:promote": "npm run release:check && npm run version:all:promote && npm run release:publish && npm run release:push",
|
||||
"release:patch": "npm run release:check && npm run version:all:patch && npm run release:publish && npm run release:push",
|
||||
"release:minor": "npm run release:check && npm run version:all:minor && npm run release:publish && npm run release:push",
|
||||
"release:major": "npm run release:check && npm run version:all:major && npm run release:publish && npm run release:push"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ws": "^8.5.14",
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
import { expect, type Locator, type Page } from "@playwright/test";
|
||||
import { test } from "../support/fixtures";
|
||||
import { runWorkspaceActionFromCommandCenter } from "../support/helpers/command-center-workspace-actions";
|
||||
import { clickNewChat, gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { waitForWorkspaceTabsVisible } from "../support/helpers/workspace-tabs";
|
||||
|
||||
const DRAG_DISTANCE = -40;
|
||||
|
||||
function splitDividers(page: Page): Locator {
|
||||
return page.getByTestId("workspace-split-resize-handle").filter({ visible: true });
|
||||
}
|
||||
|
||||
async function dividerX(divider: Locator): Promise<number> {
|
||||
const box = await divider.boundingBox();
|
||||
if (!box) throw new Error("Divider has no bounding box");
|
||||
return box.x;
|
||||
}
|
||||
|
||||
async function dragDivider(divider: Locator, deltaX: number): Promise<void> {
|
||||
const page = divider.page();
|
||||
const box = await divider.boundingBox();
|
||||
if (!box) throw new Error("Divider has no bounding box");
|
||||
const x = box.x + box.width / 2;
|
||||
const y = box.y + box.height / 2;
|
||||
await page.mouse.move(x, y);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(x + deltaX / 2, y, { steps: 4 });
|
||||
await page.mouse.move(x + deltaX, y, { steps: 4 });
|
||||
await page.mouse.up();
|
||||
}
|
||||
|
||||
async function expectDividerFollowsDrag({
|
||||
page,
|
||||
index,
|
||||
}: {
|
||||
page: Page;
|
||||
index: number;
|
||||
}): Promise<void> {
|
||||
const divider = splitDividers(page).nth(index);
|
||||
const before = await dividerX(divider);
|
||||
await dragDivider(divider, DRAG_DISTANCE);
|
||||
await expect
|
||||
.poll(async () => (await dividerX(divider)) - before, {
|
||||
message: `divider ${index + 1} should follow the drag`,
|
||||
})
|
||||
.toBeLessThan(DRAG_DISTANCE * 0.75);
|
||||
}
|
||||
|
||||
async function splitRight({
|
||||
page,
|
||||
expectedDividers,
|
||||
}: {
|
||||
page: Page;
|
||||
expectedDividers: number;
|
||||
}): Promise<void> {
|
||||
await runWorkspaceActionFromCommandCenter(page, "Split pane right");
|
||||
await expect(splitDividers(page)).toHaveCount(expectedDividers);
|
||||
}
|
||||
|
||||
test.describe("Split pane resize", () => {
|
||||
test("every divider drags in a four-pane row", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1600, height: 900 });
|
||||
const workspace = await seedWorkspace({ repoPrefix: "split-resize-fresh-" });
|
||||
try {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await waitForWorkspaceTabsVisible(page);
|
||||
await clickNewChat(page);
|
||||
await splitRight({ page, expectedDividers: 1 });
|
||||
await splitRight({ page, expectedDividers: 2 });
|
||||
await splitRight({ page, expectedDividers: 3 });
|
||||
|
||||
for (const index of [0, 1, 2]) {
|
||||
await expectDividerFollowsDrag({ page, index });
|
||||
}
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("every divider drags after panes are added to a resized row", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1600, height: 900 });
|
||||
const workspace = await seedWorkspace({ repoPrefix: "split-resize-grown-" });
|
||||
try {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await waitForWorkspaceTabsVisible(page);
|
||||
await clickNewChat(page);
|
||||
await splitRight({ page, expectedDividers: 1 });
|
||||
await expectDividerFollowsDrag({ page, index: 0 });
|
||||
|
||||
await splitRight({ page, expectedDividers: 2 });
|
||||
await splitRight({ page, expectedDividers: 3 });
|
||||
|
||||
for (const index of [0, 1, 2]) {
|
||||
await expectDividerFollowsDrag({ page, index });
|
||||
}
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -836,8 +836,6 @@ test("usage percentages state their meaning and follow the selected language", a
|
||||
}
|
||||
});
|
||||
|
||||
const exhaustionClock = /^runs out (?:[A-Z][a-z]{2} )?\d{1,2}:\d{2}(?: [AP]M)?$/;
|
||||
|
||||
test("open usage clocks advance without refreshing or reopening", async ({ page }) => {
|
||||
test.setTimeout(120_000);
|
||||
const now = new Date();
|
||||
@@ -855,16 +853,12 @@ test("open usage clocks advance without refreshing or reopening", async ({ page
|
||||
const card = page.getByTestId("usage-report-login-journey:account");
|
||||
await expect(card.getByTestId("usage-freshness")).toHaveText("Updated just now");
|
||||
await expect(card.getByText("resets in 30m", { exact: false }).first()).toBeVisible();
|
||||
const forecast = card.getByText(exhaustionClock);
|
||||
await expect(forecast).toBeVisible();
|
||||
const forecastTime = (await forecast.innerText()).replace(/^[^0-9]+/, "");
|
||||
// The shared minute clock is wall-aligned, and the daemon timestamps use real time.
|
||||
// After two browser minutes the latest displayed tick is one or two minutes old.
|
||||
await advanceUsageClock(page, 120_000);
|
||||
await expect(card.getByTestId("usage-freshness")).toHaveText(/^Updated [12]m ago$/);
|
||||
await expect(card.getByText(/resets in (28|29)m/).first()).toBeVisible();
|
||||
// The weekday drops off at local midnight, but the forecast time stays fixed.
|
||||
await expect(forecast).toHaveText(new RegExp(` ${forecastTime}$`));
|
||||
await expect(card.getByText(/runs out in (28|29)m/)).toBeVisible();
|
||||
await expect(card.getByTestId("provider-usage-balance-credits-reset")).toHaveText(
|
||||
/^resets in (28|29)m\s·\s/,
|
||||
);
|
||||
@@ -873,7 +867,7 @@ test("open usage clocks advance without refreshing or reopening", async ({ page
|
||||
}
|
||||
});
|
||||
|
||||
test("Refresh all keeps quota visible after a timeout and shows only reset details when back on track", async ({
|
||||
test("Refresh all keeps quota visible and restores the forecast after a timeout", async ({
|
||||
page,
|
||||
}) => {
|
||||
const reading = new Date();
|
||||
@@ -881,7 +875,7 @@ test("Refresh all keeps quota visible after a timeout and shows only reset detai
|
||||
try {
|
||||
const transport = await installDaemonWebSocketGate(page);
|
||||
await openCompactUsageWithClock(page, reading);
|
||||
await expectQuota(page, "40% used", exhaustionClock);
|
||||
await expectQuota(page, "40% used", /runs out in /);
|
||||
|
||||
await timeOutUsageRefresh(page, transport);
|
||||
await expectQuota(page, "40% used", null);
|
||||
@@ -890,7 +884,7 @@ test("Refresh all keeps quota visible after a timeout and shows only reset detai
|
||||
await login.setReport(usageReading(reading, 10));
|
||||
transport.releaseHeldClientRequest();
|
||||
await refreshAllUsage(page);
|
||||
await expectQuota(page, "10% used", null);
|
||||
await expectQuota(page, "10% used", "~50% left at reset");
|
||||
await expectUsageRefreshError(page).toBeHidden();
|
||||
} finally {
|
||||
await login.cleanup();
|
||||
@@ -903,29 +897,23 @@ test("a card refresh timeout is visible alongside a newer quota forecast", async
|
||||
try {
|
||||
const transport = await installDaemonWebSocketGate(page);
|
||||
await openCompactUsageWithClock(page, reading);
|
||||
await expectQuota(page, "40% used", exhaustionClock);
|
||||
await expectQuota(page, "40% used", /runs out in /);
|
||||
|
||||
await delayCardRefreshResponse(page, transport);
|
||||
await login.setReport(usageReading(reading, 45));
|
||||
await login.setReport(usageReading(reading, 10));
|
||||
await refreshAllUsage(page);
|
||||
await expectQuota(page, "45% used", exhaustionClock);
|
||||
await expectQuota(page, "10% used", "~50% left at reset");
|
||||
|
||||
await advanceUsageClock(page, 61_000);
|
||||
await expect(
|
||||
usageModal(page)
|
||||
.getByTestId("usage-report-login-journey:account")
|
||||
.getByTestId("usage-refresh-error"),
|
||||
).toHaveText("Unable to refresh usage");
|
||||
await expectQuota(page, "45% used", exhaustionClock);
|
||||
await expectUsageRefreshError(page).toBeVisible();
|
||||
await expectQuota(page, "10% used", "~50% left at reset");
|
||||
} finally {
|
||||
await login.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
function expectUsageRefreshError(page: Page) {
|
||||
return expect(
|
||||
usageModal(page).getByRole("alert").getByText("Unable to refresh usage", { exact: true }),
|
||||
);
|
||||
return expect(usageModal(page).getByText("Unable to refresh usage", { exact: true }));
|
||||
}
|
||||
|
||||
async function delayCardRefreshResponse(
|
||||
@@ -959,10 +947,7 @@ async function expectQuota(page: Page, amount: string, forecast: string | RegExp
|
||||
await expect(usage.getByText(amount, { exact: true })).toBeVisible();
|
||||
await expect(usage.getByText(/^resets in /)).toBeVisible();
|
||||
if (forecast === null) {
|
||||
await expect(usage.getByRole("checkbox", { name: /^Pin Claude Session/ })).toHaveAccessibleName(
|
||||
/^Pin Claude Session, \d+% used · resets in [^·]+ · [^·]+$/,
|
||||
);
|
||||
await expect(usage.getByText(/^runs out /)).toBeHidden();
|
||||
await expect(usage.getByText(/^runs out in /)).toBeHidden();
|
||||
return;
|
||||
}
|
||||
await expect(usage.getByText(forecast)).toBeVisible();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -462,12 +462,8 @@ function SplitNodeView({
|
||||
groupId ? state.splitSizesByWorkspace[workspaceKey]?.[groupId] : undefined,
|
||||
);
|
||||
const groupChildren = node.kind === "group" ? node.group.children : EMPTY_SPLIT_NODES;
|
||||
// Dragged sizes live per group id, apart from the layout tree, and a group keeps its id when
|
||||
// panes are added or removed. They only apply while they still have one entry per child;
|
||||
// otherwise the dividers past the end of the list could not move.
|
||||
const layoutGroupSizes = node.kind === "group" ? node.group.sizes : EMPTY_SPLIT_SIZES;
|
||||
const groupSizes =
|
||||
storedGroupSizes?.length === groupChildren.length ? storedGroupSizes : layoutGroupSizes;
|
||||
storedGroupSizes ?? (node.kind === "group" ? node.group.sizes : EMPTY_SPLIT_SIZES);
|
||||
const visibleFlex = useMemo(
|
||||
() => resolveVisibleGroupFlex(groupChildren, groupSizes, maximizedPaneId),
|
||||
[groupChildren, groupSizes, maximizedPaneId],
|
||||
|
||||
@@ -2323,9 +2323,11 @@ export const ar: TranslationResources = {
|
||||
resetsIn: "تتم إعادة التعيين خلال {{duration}}",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}}، {{time}}",
|
||||
projectedLeftAtReset: "نحو {{percentage}} متبقية عند إعادة التعيين",
|
||||
limitReached: "تم بلوغ الحد",
|
||||
mayHaveRunOut: "ربما نفدت الحصة",
|
||||
runsOutAt: "ينفد عند {{time}}",
|
||||
runsOutNow: "ينفد الآن",
|
||||
runsOutIn: "ينفد خلال {{duration}}",
|
||||
justNow: "الآن",
|
||||
daysAgo: "قبل {{value}} يومًا",
|
||||
daysAgo_zero: "قبل {{value}} يوم",
|
||||
|
||||
@@ -2333,9 +2333,11 @@ export const en = {
|
||||
resetsIn: "resets in {{duration}}",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}}, {{time}}",
|
||||
projectedLeftAtReset: "~{{percentage}} left at reset",
|
||||
limitReached: "Limit reached",
|
||||
mayHaveRunOut: "May have run out",
|
||||
runsOutAt: "runs out {{time}}",
|
||||
runsOutNow: "runs out now",
|
||||
runsOutIn: "runs out in {{duration}}",
|
||||
justNow: "just now",
|
||||
daysAgo: "{{value}}d ago",
|
||||
hoursAgo: "{{value}}h ago",
|
||||
|
||||
@@ -2354,9 +2354,11 @@ export const es: TranslationResources = {
|
||||
resetsIn: "se restablece en {{duration}}",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}}, {{time}}",
|
||||
projectedLeftAtReset: "~{{percentage}} restante al restablecerse",
|
||||
limitReached: "Límite alcanzado",
|
||||
mayHaveRunOut: "Puede que ya se haya agotado",
|
||||
runsOutAt: "agotamiento previsto {{time}}",
|
||||
runsOutNow: "se agota ahora",
|
||||
runsOutIn: "se agota en {{duration}}",
|
||||
justNow: "ahora mismo",
|
||||
daysAgo: "hace {{value}} d",
|
||||
hoursAgo: "hace {{value}} h",
|
||||
|
||||
@@ -2355,9 +2355,11 @@ export const fr: TranslationResources = {
|
||||
resetsIn: "se réinitialise dans {{duration}}",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}}, {{time}}",
|
||||
projectedLeftAtReset: "~{{percentage}} restant à la réinitialisation",
|
||||
limitReached: "Limite atteinte",
|
||||
mayHaveRunOut: "Le quota est peut-être épuisé",
|
||||
runsOutAt: "épuisement prévu {{time}}",
|
||||
runsOutNow: "s’épuise maintenant",
|
||||
runsOutIn: "s’épuise dans {{duration}}",
|
||||
justNow: "à l’instant",
|
||||
daysAgo: "il y a {{value}} j",
|
||||
hoursAgo: "il y a {{value}} h",
|
||||
|
||||
@@ -2328,9 +2328,11 @@ export const ja: TranslationResources = {
|
||||
resetsIn: "{{duration}}後にリセット",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}} {{time}}",
|
||||
projectedLeftAtReset: "リセット時に約{{percentage}}残る見込み",
|
||||
limitReached: "上限に達しました",
|
||||
mayHaveRunOut: "上限に達した可能性があります",
|
||||
runsOutAt: "{{time}}に上限に到達",
|
||||
runsOutNow: "まもなく上限に到達",
|
||||
runsOutIn: "{{duration}}後に上限に到達",
|
||||
justNow: "たった今",
|
||||
daysAgo: "{{value}}日前",
|
||||
hoursAgo: "{{value}}時間前",
|
||||
|
||||
@@ -2316,9 +2316,11 @@ export const ko: TranslationResources = {
|
||||
resetsIn: "{{duration}} 후 재설정",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}} {{time}}",
|
||||
projectedLeftAtReset: "초기화 시 약 {{percentage}} 남을 예정",
|
||||
limitReached: "한도에 도달함",
|
||||
mayHaveRunOut: "한도를 소진했을 수 있음",
|
||||
runsOutAt: "{{time}}에 한도에 도달",
|
||||
runsOutNow: "지금 한도에 도달",
|
||||
runsOutIn: "{{duration}} 후 한도에 도달",
|
||||
justNow: "방금",
|
||||
daysAgo: "{{value}}일 전",
|
||||
hoursAgo: "{{value}}시간 전",
|
||||
|
||||
@@ -2339,9 +2339,11 @@ export const ptBR: TranslationResources = {
|
||||
resetsIn: "redefine em {{duration}}",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}}, {{time}}",
|
||||
projectedLeftAtReset: "~{{percentage}} restará na renovação",
|
||||
limitReached: "Limite atingido",
|
||||
mayHaveRunOut: "A cota pode ter se esgotado",
|
||||
runsOutAt: "esgotamento previsto para {{time}}",
|
||||
runsOutNow: "esgota agora",
|
||||
runsOutIn: "esgota em {{duration}}",
|
||||
justNow: "agora mesmo",
|
||||
daysAgo: "há {{value}} d",
|
||||
hoursAgo: "há {{value}} h",
|
||||
|
||||
@@ -2341,9 +2341,11 @@ export const ru: TranslationResources = {
|
||||
resetsIn: "сброс через {{duration}}",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}}, {{time}}",
|
||||
projectedLeftAtReset: "К сбросу останется ~{{percentage}}",
|
||||
limitReached: "Лимит исчерпан",
|
||||
mayHaveRunOut: "Лимит мог уже исчерпаться",
|
||||
runsOutAt: "закончится {{time}}",
|
||||
runsOutNow: "закончится сейчас",
|
||||
runsOutIn: "закончится через {{duration}}",
|
||||
justNow: "только что",
|
||||
daysAgo: "{{value}} дн. назад",
|
||||
hoursAgo: "{{value}} ч назад",
|
||||
|
||||
@@ -2282,9 +2282,11 @@ export const zhCN: TranslationResources = {
|
||||
resetsIn: "将在 {{duration}}后重置",
|
||||
resetsAtWeekday: "{{weekday}} {{time}}",
|
||||
resetsAtDate: "{{date}} {{time}}",
|
||||
projectedLeftAtReset: "重置时约剩余 {{percentage}}",
|
||||
limitReached: "已达到上限",
|
||||
mayHaveRunOut: "额度可能已用完",
|
||||
runsOutAt: "将在 {{time}} 用尽",
|
||||
runsOutNow: "即将用尽",
|
||||
runsOutIn: "将在 {{duration}}后用尽",
|
||||
justNow: "刚刚",
|
||||
daysAgo: "{{value}}天前",
|
||||
hoursAgo: "{{value}}小时前",
|
||||
|
||||
@@ -5,10 +5,8 @@ import { i18n } from "@/i18n/i18next";
|
||||
import { UsageWindowBar } from "./window-bar";
|
||||
import type { UsageBalance, UsageWindow } from "./types";
|
||||
import { UsageBalanceBar } from "./balance-bar";
|
||||
import { UsageMeter } from "./meter";
|
||||
|
||||
const window: UsageWindow = { id: "session", label: "Session", usedPct: 70 };
|
||||
const exhaustedWindow: UsageWindow = { ...window, usedPct: 100 };
|
||||
const balance: UsageBalance = { id: "credits", label: "Credits", unit: "usd", remaining: 12 };
|
||||
const ignorePin = () => {};
|
||||
|
||||
@@ -55,97 +53,16 @@ it("translates mounted usage rows when the language changes", async () => {
|
||||
expect(container.textContent).toContain("クレジット");
|
||||
});
|
||||
|
||||
it("colors healthy quota bars green and keeps the warning and danger colors", () => {
|
||||
act(() =>
|
||||
root.render(
|
||||
<>
|
||||
<UsageMeter percent={20} tone="default" />
|
||||
<UsageMeter percent={20} tone="ok" />
|
||||
<UsageMeter percent={20} tone="warning" />
|
||||
<UsageMeter percent={20} tone="danger" />
|
||||
<UsageMeter percent={20} tone="danger" quiet />
|
||||
</>,
|
||||
),
|
||||
);
|
||||
const colors = Array.from(
|
||||
container.children,
|
||||
(track) => getComputedStyle(track.firstElementChild!).backgroundColor,
|
||||
);
|
||||
expect(colors).toEqual([
|
||||
"rgb(21, 128, 61)",
|
||||
"rgb(21, 128, 61)",
|
||||
"rgb(217, 119, 6)",
|
||||
"rgb(185, 28, 28)",
|
||||
"rgb(212, 212, 216)",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps an exhausted quota red when a failed refresh removes its forecast", () => {
|
||||
act(() =>
|
||||
root.render(
|
||||
<UsageWindowBar
|
||||
window={exhaustedWindow}
|
||||
forecastAt={null}
|
||||
retained
|
||||
displayAs="used"
|
||||
pinnable={false}
|
||||
pinned={false}
|
||||
onTogglePin={ignorePin}
|
||||
pinLabel=""
|
||||
pinTestID=""
|
||||
/>,
|
||||
),
|
||||
);
|
||||
expect(container.textContent).toBe("Session100% used");
|
||||
const fill = container.firstElementChild!.children[1].firstElementChild!;
|
||||
expect(getComputedStyle(fill).backgroundColor).toBe("rgb(185, 28, 28)");
|
||||
});
|
||||
|
||||
const narrowReadingMs = Date.now();
|
||||
const narrowForecastAt = new Date(narrowReadingMs).toISOString();
|
||||
const narrowWindow: UsageWindow = {
|
||||
id: "weekly",
|
||||
label: "Weekly",
|
||||
usedPct: 6,
|
||||
usedPct: 0.2,
|
||||
durationSeconds: 604_800,
|
||||
resetsAt: new Date(narrowReadingMs + 165.5 * 3_600_000).toISOString(),
|
||||
};
|
||||
|
||||
const onTrackWindow: UsageWindow = {
|
||||
id: "session",
|
||||
label: "Session",
|
||||
usedPct: 40,
|
||||
durationSeconds: 18_000,
|
||||
resetsAt: new Date(narrowReadingMs + 3_600_000).toISOString(),
|
||||
};
|
||||
const tightWindow: UsageWindow = { ...onTrackWindow, usedPct: 77 };
|
||||
|
||||
it.each([
|
||||
["green", onTrackWindow, "rgb(21, 128, 61)"],
|
||||
["amber", tightWindow, "rgb(217, 119, 6)"],
|
||||
] as const)("shows only the reset details for an on-track %s bar", (_, usageWindow, color) => {
|
||||
act(() =>
|
||||
root.render(
|
||||
<UsageWindowBar
|
||||
window={usageWindow}
|
||||
forecastAt={narrowForecastAt}
|
||||
displayAs="used"
|
||||
pinnable={false}
|
||||
pinned={false}
|
||||
onTogglePin={ignorePin}
|
||||
pinLabel=""
|
||||
pinTestID=""
|
||||
/>,
|
||||
),
|
||||
);
|
||||
|
||||
const row = container.firstElementChild!;
|
||||
const [label, track, datapoints] = row.children;
|
||||
expect(label.textContent).toBe(`Session${usageWindow.usedPct}% used`);
|
||||
expect(datapoints.textContent).toMatch(/^resets in [^·]+\s· [^·]+$/);
|
||||
expect(getComputedStyle(track.firstElementChild!).backgroundColor).toBe(color);
|
||||
});
|
||||
|
||||
it("shows the forecast as one more datapoint after the reset countdown, in the same line", async () => {
|
||||
act(() =>
|
||||
root.render(
|
||||
@@ -165,7 +82,7 @@ it("shows the forecast as one more datapoint after the reset countdown, in the s
|
||||
const line = Array.from(container.querySelectorAll("*")).find((node) =>
|
||||
node.textContent.startsWith("resets in"),
|
||||
);
|
||||
expect(line?.textContent).toMatch(/^resets in [^·]+\s· [^·]+\s· runs out .+$/);
|
||||
expect(line?.textContent).toMatch(/^resets in .+\s· .+\s· ~\d+% left at reset$/);
|
||||
});
|
||||
|
||||
it("wraps the forecast below the countdown in a narrow French card instead of overlapping it", async () => {
|
||||
@@ -197,6 +114,6 @@ it("wraps the forecast below the countdown in a narrow French card instead of ov
|
||||
}
|
||||
|
||||
const countdown = textBounds("se réinitialise");
|
||||
const forecast = textBounds("épuisement prévu");
|
||||
const forecast = textBounds("~");
|
||||
expect(forecast.left >= countdown.right || forecast.top >= countdown.bottom).toBe(true);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { i18n } from "@/i18n/i18next";
|
||||
import {
|
||||
formatDisplayPct,
|
||||
@@ -38,9 +38,11 @@ describe("formatAmount", () => {
|
||||
|
||||
expect(formatPct(7, "en")).toBe("7%");
|
||||
expect(formatResetLabel(twoHoursFromNow, false, NOW)).toBe("resets in 2h");
|
||||
expect(formatRunsOutLabel(twoHoursFromNow, NOW)).toBe("runs out in 2h");
|
||||
|
||||
await i18n.changeLanguage("ja");
|
||||
expect(formatResetLabel(twoHoursFromNow, false, NOW)).toBe("2時間後にリセット");
|
||||
expect(formatRunsOutLabel(twoHoursFromNow, NOW)).toBe("2時間後に上限に到達");
|
||||
expect(formatAgo(threeDaysAgo, NOW)).toBe("3日前");
|
||||
});
|
||||
|
||||
@@ -55,15 +57,18 @@ describe("formatAmount", () => {
|
||||
const daysAgo = new Date(NOW - days * 24 * 60 * 60 * 1000).toISOString();
|
||||
|
||||
expect(formatResetLabel(daysFromNow, false, NOW)).toBe("se réinitialise dans 1\u202f234 j");
|
||||
expect(formatRunsOutLabel(daysFromNow, NOW)).toBe("s’épuise dans 1\u202f234 j");
|
||||
expect(formatAgo(daysAgo, NOW)).toBe("il y a 1\u202f234 j");
|
||||
});
|
||||
|
||||
it("selects Arabic plural forms for relative durations", async () => {
|
||||
await i18n.changeLanguage("ar");
|
||||
const twoHoursFromNow = new Date(NOW + 2 * 60 * 60 * 1000).toISOString();
|
||||
const threeHoursFromNow = new Date(NOW + 3 * 60 * 60 * 1000).toISOString();
|
||||
const twoDaysAgo = new Date(NOW - 2 * 24 * 60 * 60 * 1000).toISOString();
|
||||
|
||||
expect(formatResetLabel(twoHoursFromNow, false, NOW)).toBe("تتم إعادة التعيين خلال ساعتين");
|
||||
expect(formatRunsOutLabel(threeHoursFromNow, NOW)).toBe("ينفد خلال 3 ساعات");
|
||||
expect(formatAgo(twoDaysAgo, NOW)).toBe("قبل يومين");
|
||||
});
|
||||
|
||||
@@ -106,21 +111,20 @@ describe("reset countdown", () => {
|
||||
});
|
||||
|
||||
it("says two units, dropping a unit that is zero", () => {
|
||||
expect(countdown(DAY + 30 * MINUTE)).toBe("resets in 1d");
|
||||
expect(countdown(4 * HOUR + 59 * MINUTE)).toBe("resets in 4h 59m");
|
||||
expect(countdown(HOUR)).toBe("resets in 1h");
|
||||
expect(countdown(37 * MINUTE)).toBe("resets in 37m");
|
||||
expect(countdown(59 * 1000)).toBe("resets in 0m");
|
||||
});
|
||||
|
||||
it("shows a single day as 24 hours in the reset countdown", () => {
|
||||
expect(countdown(DAY)).toBe("resets in 24h");
|
||||
expect(countdown(DAY + 30 * MINUTE)).toBe("resets in 24h");
|
||||
expect(countdown(DAY + HOUR)).toBe("resets in 1d 1h");
|
||||
expect(countdown(2 * DAY)).toBe("resets in 2d");
|
||||
it("joins the at-risk countdown the same way", () => {
|
||||
const iso = new Date(NOW + 3 * HOUR + 5 * MINUTE).toISOString();
|
||||
expect(formatRunsOutLabel(iso, NOW)).toBe("runs out in 3h 5m");
|
||||
});
|
||||
});
|
||||
|
||||
describe("exact quota times", () => {
|
||||
describe("exact reset time", () => {
|
||||
// Local-time dates, so the thresholds hold in any timezone the tests run in.
|
||||
const now = new Date(2026, 9, 29, 12, 0).getTime();
|
||||
const at = (...args: [number, number, number, number, number]) =>
|
||||
@@ -130,51 +134,18 @@ describe("exact quota times", () => {
|
||||
await i18n.changeLanguage("en");
|
||||
});
|
||||
|
||||
it("shows only the time for the same local day", () => {
|
||||
it("shows only the time within 24 hours", () => {
|
||||
expect(at(2026, 9, 29, 15, 0)).toMatch(/^(3:00 PM|15:00)$/);
|
||||
expect(at(2026, 9, 30, 11, 59)).toMatch(/^(11:59 AM|11:59)$/);
|
||||
});
|
||||
|
||||
it("shows the weekday for tomorrow even when it is less than 24 hours away", () => {
|
||||
expect(at(2026, 9, 30, 11, 59)).toMatch(/^Fri (11:59 AM|11:59)$/);
|
||||
expect(at(2026, 10, 4, 15, 0)).toMatch(/^Wed (3:00 PM|15:00)$/);
|
||||
it("adds the weekday within 7 days", () => {
|
||||
expect(at(2026, 9, 30, 12, 0)).toMatch(/^Fri (12:00 PM|12:00)$/);
|
||||
expect(at(2026, 10, 5, 11, 59)).toMatch(/^Thu (11:59 AM|11:59)$/);
|
||||
});
|
||||
|
||||
it("includes the date on the same weekday next week even when fewer than 7 days elapse", () => {
|
||||
expect(at(2026, 10, 5, 10, 0)).toMatch(/^Thu, Nov 5, (10:00 AM|10:00)$/);
|
||||
});
|
||||
|
||||
it("includes the weekday and date seven or more calendar days out", () => {
|
||||
expect(at(2026, 10, 5, 12, 0)).toMatch(/^Thu, Nov 5, (12:00 PM|12:00)$/);
|
||||
expect(at(2026, 10, 6, 15, 0)).toMatch(/^Fri, Nov 6, (3:00 PM|15:00)$/);
|
||||
});
|
||||
|
||||
it("counts calendar days across the spring daylight-saving transition", () => {
|
||||
vi.stubEnv("TZ", "America/New_York");
|
||||
try {
|
||||
const before = new Date(2026, 2, 7, 12);
|
||||
const after = new Date(2026, 2, 14, 12);
|
||||
expect(after.getTime() - before.getTime()).toBe(167 * 3_600_000);
|
||||
expect(formatResetTime(after.toISOString(), before.getTime())).toMatch(/^Sat, Mar 14, /);
|
||||
} finally {
|
||||
vi.unstubAllEnvs();
|
||||
}
|
||||
});
|
||||
|
||||
it("shows the exhaustion clock time with the same weekday and date rules as reset time", () => {
|
||||
const runsOut = (...args: [number, number, number, number, number]) =>
|
||||
formatRunsOutLabel(new Date(...args).toISOString(), now)?.replace(/\s/g, " ");
|
||||
|
||||
expect(runsOut(2026, 9, 29, 15, 0)).toMatch(/^runs out (3:00 PM|15:00)$/);
|
||||
expect(runsOut(2026, 9, 30, 9, 32)).toMatch(/^runs out Fri (9:32 AM|09:32|9:32)$/);
|
||||
expect(runsOut(2026, 10, 5, 15, 30)).toMatch(/^runs out Thu, Nov 5, (3:30 PM|15:30)$/);
|
||||
});
|
||||
|
||||
it("uses the app language for the exhaustion label and weekday", async () => {
|
||||
await i18n.changeLanguage("ja");
|
||||
const time = new Date(2026, 9, 30, 15, 30).toISOString();
|
||||
expect(formatRunsOutLabel(time, now)?.replace(/\s/g, " ")).toMatch(
|
||||
/^金 (?:3:30 PM|15:30)に上限に到達$/,
|
||||
);
|
||||
it("adds the date after 7 days", () => {
|
||||
expect(at(2026, 10, 5, 12, 0)).toMatch(/^Nov 5, (12:00 PM|12:00)$/);
|
||||
});
|
||||
|
||||
it("names the weekday in the app language", async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TFunction } from "i18next";
|
||||
import { i18n } from "@/i18n/i18next";
|
||||
import { formatTimeOfDay, localCalendarDaysBetween } from "@/utils/time";
|
||||
import { formatTimeOfDay } from "@/utils/time";
|
||||
import type { UsageDisplayAs } from "./preferences";
|
||||
import type { UsageBalanceUnit, UsageReportEntry } from "./types";
|
||||
|
||||
@@ -79,7 +79,6 @@ function relativeDuration(iso: string, now: number): RelativeDuration | null {
|
||||
const days = Math.floor(diffMs / DAY_MS);
|
||||
const hours = Math.floor((diffMs % DAY_MS) / HOUR_MS);
|
||||
const minutes = Math.floor((diffMs % HOUR_MS) / MINUTE_MS);
|
||||
if (days === 1 && hours === 0) return remaining({ unit: "hours", count: 24 });
|
||||
if (days > 0) return remaining({ unit: "days", count: days }, { unit: "hours", count: hours });
|
||||
if (hours > 0)
|
||||
return remaining({ unit: "hours", count: hours }, { unit: "minutes", count: minutes });
|
||||
@@ -121,8 +120,8 @@ export function formatResetLabel(
|
||||
}
|
||||
|
||||
/**
|
||||
* A clock time today, a weekday for the next six calendar days, and a weekday plus date after that.
|
||||
* Names follow the app language. The clock uses the device's 12/24h preference.
|
||||
* When a window resets on the clock: "3:00 PM" within a day, "Fri 3:00 PM" within a week,
|
||||
* "Oct 31, 3:00 PM" after that. Names follow the app language; 12/24h follows the device.
|
||||
* Nothing for a time that has passed, where the countdown already says so.
|
||||
*/
|
||||
export function formatResetTime(
|
||||
@@ -136,13 +135,12 @@ export function formatResetTime(
|
||||
if (!Number.isFinite(diffMs) || diffMs <= 0) return null;
|
||||
const time = formatTimeOfDay(at);
|
||||
const locale = i18n.resolvedLanguage;
|
||||
const dayDiff = localCalendarDaysBetween(new Date(now), at);
|
||||
if (dayDiff === 0) return time;
|
||||
if (dayDiff <= 6) {
|
||||
if (diffMs < DAY_MS) return time;
|
||||
if (diffMs < 7 * DAY_MS) {
|
||||
const weekday = at.toLocaleDateString(locale, { weekday: "short" });
|
||||
return t("providerUsage.timing.resetsAtWeekday", { weekday, time });
|
||||
}
|
||||
const date = at.toLocaleDateString(locale, { weekday: "short", month: "short", day: "numeric" });
|
||||
const date = at.toLocaleDateString(locale, { month: "short", day: "numeric" });
|
||||
return t("providerUsage.timing.resetsAtDate", { date, time });
|
||||
}
|
||||
|
||||
@@ -151,8 +149,11 @@ export function formatRunsOutLabel(
|
||||
now = Date.now(),
|
||||
t: TFunction = i18n.t,
|
||||
): string | null {
|
||||
const time = formatResetTime(iso, now, t);
|
||||
return time ? t("providerUsage.timing.runsOutAt", { time }) : null;
|
||||
if (!iso) return null;
|
||||
const rel = relativeDuration(iso, now);
|
||||
if (!rel) return null;
|
||||
if (rel.kind === "now") return t("providerUsage.timing.runsOutNow");
|
||||
return t("providerUsage.timing.runsOutIn", { duration: formatRelativeDuration(rel, t) });
|
||||
}
|
||||
|
||||
export function formatAgo(
|
||||
|
||||
@@ -6,12 +6,14 @@ import type { UsageTone } from "./types";
|
||||
|
||||
function fillToneStyle(tone: UsageTone) {
|
||||
switch (tone) {
|
||||
case "ok":
|
||||
return styles.fillOk;
|
||||
case "warning":
|
||||
return styles.fillWarning;
|
||||
case "danger":
|
||||
return styles.fillDanger;
|
||||
default:
|
||||
return styles.fillOk;
|
||||
return styles.fillDefault;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +59,9 @@ const styles = StyleSheet.create((theme) => ({
|
||||
fillQuiet: {
|
||||
backgroundColor: theme.colors.surface4,
|
||||
},
|
||||
fillDefault: {
|
||||
backgroundColor: theme.colors.foregroundMuted,
|
||||
},
|
||||
fillOk: {
|
||||
backgroundColor: theme.colors.statusSuccess,
|
||||
},
|
||||
|
||||
@@ -23,25 +23,12 @@ describe("usage pace", () => {
|
||||
it("updates after a later reading and works with a remaining percentage", () => {
|
||||
const close = reading("13:30");
|
||||
const safe = reading("14:00");
|
||||
expect(usagePace(window, close, Date.parse(close))).toEqual({ kind: "tight" });
|
||||
const forecast = usagePace(window, close, Date.parse(close));
|
||||
expect(forecast.kind).toBe("remaining");
|
||||
if (forecast.kind === "remaining") expect(forecast.remainingAtResetPct).toBeCloseTo(7.14);
|
||||
expect(
|
||||
usagePace({ ...window, usedPct: undefined, remainingPct: 35 }, safe, Date.parse(safe)),
|
||||
).toEqual({ kind: "onTrack" });
|
||||
});
|
||||
|
||||
it("projects a weekly window after 100 minutes when 6% is already used", () => {
|
||||
const sampledAt = "2026-11-21T10:28:17.000Z";
|
||||
const weekly: UsageWindow = {
|
||||
id: "gemini-weekly",
|
||||
label: "Gemini · Weekly",
|
||||
durationSeconds: 604_800,
|
||||
usedPct: 6,
|
||||
resetsAt: "2026-11-28T08:48:17.000Z",
|
||||
};
|
||||
expect(usagePace(weekly, sampledAt, Date.parse("2026-11-21T10:33:03Z"))).toEqual({
|
||||
kind: "runsOut",
|
||||
at: "2026-11-22T12:34:57.000Z",
|
||||
});
|
||||
).toEqual({ kind: "remaining", remainingAtResetPct: 18.75 });
|
||||
});
|
||||
|
||||
it("only forecasts with timing and an active, usable reading", () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ type UsagePace =
|
||||
| { kind: "unknown" }
|
||||
| { kind: "reached" }
|
||||
| { kind: "runsOut"; at: string }
|
||||
| { kind: "onTrack" | "tight" };
|
||||
| { kind: "remaining"; remainingAtResetPct: number };
|
||||
|
||||
/** Estimate from the window's average pace as of the reading. The clock only expires the estimate. */
|
||||
export function usagePace(window: UsageWindow, observedAt: string | null, now: number): UsagePace {
|
||||
@@ -25,15 +25,13 @@ export function usagePace(window: UsageWindow, observedAt: string | null, now: n
|
||||
const duration = (window.durationSeconds ?? 0) * 1_000;
|
||||
const sampled = Date.parse(observedAt);
|
||||
const elapsed = sampled - (reset - duration);
|
||||
// Wait for an initial sample without holding back multi-day forecasts for several hours.
|
||||
const minimumElapsed = Math.max(60_000, Math.min(duration * 0.01, 3_600_000));
|
||||
if (
|
||||
used == null ||
|
||||
!Number.isFinite(used) ||
|
||||
used < 0 ||
|
||||
!Number.isFinite(elapsed) ||
|
||||
sampled >= reset ||
|
||||
elapsed < minimumElapsed
|
||||
elapsed < Math.max(60_000, duration * 0.01)
|
||||
) {
|
||||
return { kind: "unknown" };
|
||||
}
|
||||
@@ -43,5 +41,5 @@ export function usagePace(window: UsageWindow, observedAt: string | null, now: n
|
||||
const runsOut = sampled + ((100 - used) / used) * elapsed;
|
||||
return { kind: "runsOut", at: new Date(runsOut).toISOString() };
|
||||
}
|
||||
return { kind: projectedAtReset >= 90 ? "tight" : "onTrack" };
|
||||
return { kind: "remaining", remainingAtResetPct: 100 - projectedAtReset };
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { StyleSheet, withUnistyles } from "react-native-unistyles";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import {
|
||||
formatDisplayPct,
|
||||
formatPct,
|
||||
formatProviderUsageLabel,
|
||||
formatResetLabel,
|
||||
formatResetTime,
|
||||
@@ -17,7 +18,6 @@ import { displayPercent, usageWindowRowLabel } from "./model";
|
||||
import { usagePace } from "./pace";
|
||||
import { UsageDatapointLine } from "./datapoint-line";
|
||||
import type { UsageDisplayAs } from "./preferences";
|
||||
import { windowTone } from "./tone";
|
||||
import type { UsageTone, UsageWindow } from "./types";
|
||||
import { useRelativeTimeTick } from "./use-relative-time-tick";
|
||||
|
||||
@@ -55,13 +55,13 @@ export function UsageWindowBar({
|
||||
const value =
|
||||
shownPct != null ? formatDisplayPct(shownPct, displayAs, i18n.resolvedLanguage, t) : "—";
|
||||
const accessibilityState = useMemo(() => ({ checked: pinned }), [pinned]);
|
||||
const datapoints = [countdown, exactTime, forecast?.label ?? null];
|
||||
const content = {
|
||||
label: formatProviderUsageLabel(window.id, window.label, t),
|
||||
value,
|
||||
datapoints,
|
||||
countdown,
|
||||
exactTime,
|
||||
forecast,
|
||||
percent: shownPct ?? 0,
|
||||
tone: forecast?.tone ?? windowTone(window),
|
||||
pinned,
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ export function UsageWindowBar({
|
||||
accessibilityLabel={usageWindowRowLabel({
|
||||
pinLabel,
|
||||
value,
|
||||
trailing: datapoints.filter(Boolean).join(" · "),
|
||||
trailing: [countdown, exactTime, forecast?.label].filter(Boolean).join(" · "),
|
||||
})}
|
||||
accessibilityState={accessibilityState}
|
||||
aria-checked={pinned}
|
||||
@@ -96,17 +96,19 @@ export function UsageWindowBar({
|
||||
function WindowRowContent({
|
||||
label,
|
||||
value,
|
||||
datapoints,
|
||||
countdown,
|
||||
exactTime,
|
||||
forecast,
|
||||
percent,
|
||||
tone,
|
||||
pinnable,
|
||||
pinned,
|
||||
}: {
|
||||
label: string;
|
||||
value: string;
|
||||
datapoints: readonly (string | null)[];
|
||||
countdown: string | null;
|
||||
exactTime: string | null;
|
||||
forecast: PaceLabel | null;
|
||||
percent: number;
|
||||
tone: UsageTone;
|
||||
pinnable: boolean;
|
||||
pinned: boolean;
|
||||
}) {
|
||||
@@ -121,14 +123,14 @@ function WindowRowContent({
|
||||
</Text>
|
||||
{pinnable ? <UsagePinGlyph pinned={pinned} /> : null}
|
||||
</View>
|
||||
<UsageMeter percent={percent} tone={tone} />
|
||||
<UsageDatapointLine datapoints={datapoints} />
|
||||
<UsageMeter percent={percent} tone={forecast?.tone ?? "default"} />
|
||||
<UsageDatapointLine datapoints={[countdown, exactTime, forecast?.label ?? null]} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
interface PaceDisplay {
|
||||
label: string | null;
|
||||
interface PaceLabel {
|
||||
label: string;
|
||||
tone: UsageTone;
|
||||
}
|
||||
|
||||
@@ -136,7 +138,7 @@ function formatPace(
|
||||
pace: ReturnType<typeof usagePace>,
|
||||
now: number,
|
||||
t: TFunction,
|
||||
): PaceDisplay | null {
|
||||
): PaceLabel | null {
|
||||
switch (pace.kind) {
|
||||
case "reached":
|
||||
return { label: t("providerUsage.timing.limitReached"), tone: "danger" };
|
||||
@@ -147,10 +149,13 @@ function formatPace(
|
||||
: formatRunsOutLabel(pace.at, now, t);
|
||||
return label ? { label, tone: "danger" } : null;
|
||||
}
|
||||
case "tight":
|
||||
return { label: null, tone: "warning" };
|
||||
case "onTrack":
|
||||
return { label: null, tone: "default" };
|
||||
case "remaining":
|
||||
return {
|
||||
label: t("providerUsage.timing.projectedLeftAtReset", {
|
||||
percentage: formatPct(pace.remainingAtResetPct),
|
||||
}),
|
||||
tone: pace.remainingAtResetPct <= 10 ? "warning" : "default",
|
||||
};
|
||||
case "unknown":
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -97,10 +97,14 @@ export function formatCompactTimeAgoAsProse(label: string): string {
|
||||
return label;
|
||||
}
|
||||
|
||||
/** Count local calendar dates using equally spaced UTC values for their year, month and day. */
|
||||
export function localCalendarDaysBetween(earlier: Date, later: Date): number {
|
||||
const calendarDay = (date: Date) => Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
return (calendarDay(later) - calendarDay(earlier)) / DAY_MS;
|
||||
/**
|
||||
* How many local midnights lie between two instants: 0 for the same day, 1 for yesterday.
|
||||
* Counted on the calendar rather than in elapsed time, so six days and 23 hours ago on
|
||||
* today's weekday is 7, and rounded so a DST day of 23 or 25 hours still counts as one.
|
||||
*/
|
||||
function localCalendarDaysBetween(earlier: Date, later: Date): number {
|
||||
const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
||||
return Math.round((startOfDay(later).getTime() - startOfDay(earlier).getTime()) / DAY_MS);
|
||||
}
|
||||
|
||||
// Cached Intl formatter. Explicitly carrying `hourCycle` from the resolved
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Paseo CLI - control your AI coding agents from the command line",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -29,9 +29,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/server": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@getpaseo/server": "0.17.0",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
|
||||
@@ -47,7 +47,7 @@ export function addSendOptions(cmd: Command): Command {
|
||||
.addOption(
|
||||
new Option(
|
||||
"--behavior <behavior>",
|
||||
"Active-turn behavior (agent default: steer waits for turn end; otherwise: interrupt). An agent's interrupt delivers the messages queued before it first",
|
||||
"Active-turn behavior (agent default: steer waits for turn end; otherwise: interrupt)",
|
||||
).choices(["interrupt", "steer"]),
|
||||
)
|
||||
.option("--no-wait", "Return immediately without waiting for completion");
|
||||
@@ -218,7 +218,7 @@ export async function runSendCommand(
|
||||
status: receipt.deliveryStatus ?? "sent",
|
||||
message:
|
||||
receipt.deliveryStatus === "queued"
|
||||
? "Message queued for delivery after two quiet seconds and the current turn ends. An interrupt replaces the turn now, after the messages queued before it"
|
||||
? "Message queued for delivery after two quiet seconds and the current turn ends, unless interrupt was requested"
|
||||
: "Message sent, not waiting for completion",
|
||||
},
|
||||
schema: agentSendSchema,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Paseo client SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -49,8 +49,8 @@
|
||||
"measure:diff-materialization": "tsx scripts/measure-diff-materialization.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@getpaseo/relay": "0.17.0",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"private": true,
|
||||
"description": "Paseo desktop app (Electron wrapper)",
|
||||
"homepage": "https://paseo.sh",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Native module for two way audio streaming",
|
||||
"keywords": [
|
||||
"ExpoTwoWayAudio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Paseo plugin SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -78,8 +78,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -89,8 +89,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Paseo shared protocol schemas and wire types",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Paseo relay for bridging daemon and client connections",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Paseo backend server",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -109,11 +109,11 @@
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/highlight": "0.17.0-beta.1",
|
||||
"@getpaseo/plugin": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"@getpaseo/client": "0.17.0",
|
||||
"@getpaseo/highlight": "0.17.0",
|
||||
"@getpaseo/plugin": "0.17.0",
|
||||
"@getpaseo/protocol": "0.17.0",
|
||||
"@getpaseo/relay": "0.17.0",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
|
||||
@@ -7972,75 +7972,6 @@ test("replaceAgentRun does not emit idle or resolve waiters between interrupted
|
||||
unsubscribe();
|
||||
});
|
||||
|
||||
test("onStop hears a stop before the agent settles and ignores a replacing prompt", async () => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-on-stop-"));
|
||||
onTestFinished(() => rmSync(workdir, { recursive: true, force: true }));
|
||||
|
||||
class HeldTurnSession extends TestAgentSession {
|
||||
private turns = 0;
|
||||
private activeTurnId: string | null = null;
|
||||
|
||||
override async startTurn(): Promise<{ turnId: string }> {
|
||||
const turnId = `held-turn-${++this.turns}`;
|
||||
this.activeTurnId = turnId;
|
||||
setTimeout(() => {
|
||||
if (this.activeTurnId === turnId)
|
||||
this.pushEvent({ type: "turn_started", provider: this.provider, turnId });
|
||||
}, 0);
|
||||
return { turnId };
|
||||
}
|
||||
|
||||
override async interrupt(): Promise<void> {
|
||||
const turnId = this.activeTurnId;
|
||||
if (!turnId) return;
|
||||
this.activeTurnId = null;
|
||||
this.pushEvent({
|
||||
type: "turn_canceled",
|
||||
provider: this.provider,
|
||||
reason: "interrupted",
|
||||
turnId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class HeldTurnClient extends TestAgentClient {
|
||||
override async createSession(config: AgentSessionConfig): Promise<AgentSession> {
|
||||
return new HeldTurnSession(config);
|
||||
}
|
||||
}
|
||||
|
||||
const manager = new AgentManager({ clients: { codex: new HeldTurnClient() }, logger });
|
||||
const agent = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
const stops: Array<{ agentId: string; lifecycle: string | undefined }> = [];
|
||||
const unsubscribe = manager.onStop((agentId) => {
|
||||
stops.push({ agentId, lifecycle: manager.getAgent(agentId)?.lifecycle });
|
||||
});
|
||||
const drain = async (run: AsyncGenerator<AgentStreamEvent>) => {
|
||||
for await (const _event of run) {
|
||||
// Drain events so lifecycle updates are applied.
|
||||
}
|
||||
};
|
||||
|
||||
const first = drain(manager.streamAgent(agent.id, "first run"));
|
||||
await manager.waitForAgentRunStart(agent.id);
|
||||
const second = drain(await manager.replaceAgentRun(agent.id, "second run"));
|
||||
await manager.waitForAgentRunStart(agent.id);
|
||||
expect(stops).toEqual([]);
|
||||
|
||||
await expect(manager.cancelAgentRun(agent.id)).resolves.toEqual({ status: "settled" });
|
||||
expect(stops).toEqual([{ agentId: agent.id, lifecycle: "running" }]);
|
||||
expect(manager.getAgent(agent.id)?.lifecycle).toBe("idle");
|
||||
|
||||
// Nothing is running, so there is no turn to stop.
|
||||
await expect(manager.cancelAgentRun(agent.id)).resolves.toEqual({ status: "not_running" });
|
||||
expect(stops).toHaveLength(1);
|
||||
|
||||
unsubscribe();
|
||||
await Promise.all([first, second]);
|
||||
});
|
||||
|
||||
test("replaceAgentRun stays running when a stale old terminal arrives before the replacement turn is current", async () => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-replace-stale-terminal-"));
|
||||
const storagePath = join(workdir, "agents");
|
||||
|
||||
@@ -158,10 +158,8 @@ export class AgentManagerShuttingDownError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
type RunCancellationCause = "reload" | "replace" | "rewind" | "stop";
|
||||
|
||||
export class AgentRunCancellationError extends Error {
|
||||
constructor(agentId: string, action: RunCancellationCause) {
|
||||
constructor(agentId: string, action: "reload" | "replace" | "rewind" | "stop") {
|
||||
super(
|
||||
`Cannot ${action} agent ${agentId} because its active run cancellation was not acknowledged`,
|
||||
);
|
||||
@@ -868,7 +866,6 @@ export class AgentManager {
|
||||
private readonly replacementMutationTails = new Map<string, Promise<void>>();
|
||||
private readonly runs = new AgentRunState();
|
||||
private readonly subscribers = new Set<SubscriptionRecord>();
|
||||
private readonly stopListeners = new Set<(agentId: string) => void>();
|
||||
private readonly idFactory: () => string;
|
||||
private readonly registry?: AgentStorage;
|
||||
private readonly durableTimelineStore?: AgentTimelineStore;
|
||||
@@ -1157,15 +1154,6 @@ export class AgentManager {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify before a running turn is stopped with no prompt replacing it: Stop and `cancel_agent`,
|
||||
* not a replacing prompt, a reload, or a rewind. Listeners run before the agent settles.
|
||||
*/
|
||||
onStop(listener: (agentId: string) => void): () => void {
|
||||
this.stopListeners.add(listener);
|
||||
return () => this.stopListeners.delete(listener);
|
||||
}
|
||||
|
||||
subscribe(callback: AgentSubscriber, options?: SubscribeOptions): () => void {
|
||||
const targetAgentId =
|
||||
options?.agentId == null ? null : validateAgentId(options.agentId, "subscribe");
|
||||
@@ -3774,7 +3762,7 @@ export class AgentManager {
|
||||
this.touchUpdatedAt(agent);
|
||||
this.emitState(agent);
|
||||
try {
|
||||
const result = await this.cancelAgentRunNow(agent.id, "replace");
|
||||
const result = await this.cancelAgentRunNow(agent.id);
|
||||
if (result.status === "refused") {
|
||||
throw new AgentRunCancellationError(agent.id, "replace");
|
||||
}
|
||||
@@ -3970,18 +3958,10 @@ export class AgentManager {
|
||||
}
|
||||
}
|
||||
|
||||
/** Stop the running turn. Nothing replaces it, so `onStop` listeners hear about it first. */
|
||||
cancelAgentRun(agentId: string): Promise<AgentRunCancellationResult> {
|
||||
return this.cancelRun(agentId, "stop");
|
||||
}
|
||||
|
||||
private async cancelRun(
|
||||
agentId: string,
|
||||
cause: RunCancellationCause,
|
||||
): Promise<AgentRunCancellationResult> {
|
||||
async cancelAgentRun(agentId: string): Promise<AgentRunCancellationResult> {
|
||||
const cancellation = this.runForegroundMutation(agentId, () => {
|
||||
this.requireSessionAgent(agentId).pendingReplacement = false;
|
||||
return this.cancelAgentRunNow(agentId, cause);
|
||||
return this.cancelAgentRunNow(agentId);
|
||||
});
|
||||
this.pendingCancellations.set(agentId, cancellation);
|
||||
try {
|
||||
@@ -3993,10 +3973,7 @@ export class AgentManager {
|
||||
}
|
||||
}
|
||||
|
||||
private async cancelAgentRunNow(
|
||||
agentId: string,
|
||||
cause: RunCancellationCause,
|
||||
): Promise<AgentRunCancellationResult> {
|
||||
private async cancelAgentRunNow(agentId: string): Promise<AgentRunCancellationResult> {
|
||||
const agent = this.requireSessionAgent(agentId);
|
||||
const run =
|
||||
this.runs.getRun(agentId) ??
|
||||
@@ -4004,9 +3981,6 @@ export class AgentManager {
|
||||
if (!run) {
|
||||
return { status: "not_running" };
|
||||
}
|
||||
if (cause === "stop") {
|
||||
for (const listener of this.stopListeners) listener(agentId);
|
||||
}
|
||||
|
||||
const interruptAcknowledged = await this.interruptSession(agent.session, agentId);
|
||||
const settlement = await this.waitWithTimeout({
|
||||
@@ -4064,8 +4038,11 @@ export class AgentManager {
|
||||
return { status: "settled" };
|
||||
}
|
||||
|
||||
private async cancelAgentRunBefore(agentId: string, action: "reload" | "rewind"): Promise<void> {
|
||||
const result = await this.cancelRun(agentId, action);
|
||||
private async cancelAgentRunBefore(
|
||||
agentId: string,
|
||||
action: "reload" | "replace" | "rewind",
|
||||
): Promise<void> {
|
||||
const result = await this.cancelAgentRun(agentId);
|
||||
if (result.status === "refused") {
|
||||
throw new AgentRunCancellationError(agentId, action);
|
||||
}
|
||||
|
||||
@@ -389,18 +389,14 @@ test("a turn starting during dispatch preparation keeps receipts queued and join
|
||||
await delivery.close();
|
||||
});
|
||||
|
||||
test("an interrupt takes the messages queued before it along in one replacing dispatch", async () => {
|
||||
test("explicit interrupt bypasses a running turn while ordinary messages keep waiting", async () => {
|
||||
const clock = createClock();
|
||||
const sent: Array<{ ids: readonly string[]; behavior: string; idleOnly: boolean }> = [];
|
||||
const sent: Array<readonly string[]> = [];
|
||||
const delivery = createAgentMessageDelivery({
|
||||
schedule: clock.schedule,
|
||||
isRunning: () => true,
|
||||
dispatch: async (request) => {
|
||||
sent.push({
|
||||
ids: request.messageIds,
|
||||
behavior: request.activeTurnBehavior,
|
||||
idleOnly: request.idleOnly,
|
||||
});
|
||||
sent.push(request.messageIds);
|
||||
return "turn_started";
|
||||
},
|
||||
onError: (error) => {
|
||||
@@ -418,12 +414,12 @@ test("an interrupt takes the messages queued before it along in one replacing di
|
||||
messageId: "interrupt",
|
||||
activeTurnBehavior: "interrupt",
|
||||
});
|
||||
// No quiet window: the interrupt releases at admission.
|
||||
clock.advance(2000);
|
||||
await interrupt.dispatched;
|
||||
expect(sent).toEqual([{ ids: ["wait", "interrupt"], behavior: "interrupt", idleOnly: false }]);
|
||||
expect(delivery.hasPending("parent")).toBe(false);
|
||||
expect(sent).toEqual([["interrupt"]]);
|
||||
expect(delivery.hasPending("parent")).toBe(true);
|
||||
await delivery.close();
|
||||
expect(sent).toHaveLength(1);
|
||||
expect(sent).toEqual([["interrupt"], ["wait"]]);
|
||||
});
|
||||
|
||||
test("shutdown flushes a dispatch that discovered a concurrent turn during preparation", async () => {
|
||||
@@ -507,7 +503,7 @@ test("conflicting modes dispatch on separate turn ends without changing the acti
|
||||
await delivery.close();
|
||||
});
|
||||
|
||||
test("each interrupt releases at admission and keeps its own mode choice", async () => {
|
||||
test("interrupts retain separate mode choices while the recipient is busy", async () => {
|
||||
const clock = createClock();
|
||||
const sent: Array<{ ids: readonly string[]; mode?: string }> = [];
|
||||
const delivery = createAgentMessageDelivery({
|
||||
@@ -527,19 +523,13 @@ test("each interrupt releases at admission and keeps its own mode choice", async
|
||||
prompt: "message",
|
||||
activeTurnBehavior: "interrupt" as const,
|
||||
};
|
||||
await delivery.enqueue({ ...message, messageId: "A", sessionMode: "plan" }).dispatched;
|
||||
await delivery.enqueue({ ...message, messageId: "B", sessionMode: "default" }).dispatched;
|
||||
|
||||
// Sent back to back, the second still goes after the first, as its own prompt.
|
||||
const c = delivery.enqueue({ ...message, messageId: "C", sessionMode: "plan" });
|
||||
const d = delivery.enqueue({ ...message, messageId: "D", sessionMode: "default" });
|
||||
await Promise.all([c.dispatched, d.dispatched]);
|
||||
|
||||
const a = delivery.enqueue({ ...message, messageId: "A", sessionMode: "plan" });
|
||||
const b = delivery.enqueue({ ...message, messageId: "B", sessionMode: "default" });
|
||||
clock.advance(2000);
|
||||
await Promise.all([a.dispatched, b.dispatched]);
|
||||
expect(sent).toEqual([
|
||||
{ ids: ["A"], mode: "plan" },
|
||||
{ ids: ["B"], mode: "default" },
|
||||
{ ids: ["C"], mode: "plan" },
|
||||
{ ids: ["D"], mode: "default" },
|
||||
]);
|
||||
await delivery.close();
|
||||
});
|
||||
@@ -986,780 +976,3 @@ test("a declined child command offer cannot bring back a withdrawn digest", asyn
|
||||
await delivery.close();
|
||||
}
|
||||
});
|
||||
|
||||
interface Dispatched {
|
||||
ids: readonly string[];
|
||||
behavior: string;
|
||||
idleOnly: boolean;
|
||||
mode?: string;
|
||||
}
|
||||
|
||||
/** One recipient with a running turn, observed the way the daemon wires the queue. */
|
||||
function createRecipient(
|
||||
options: { running?: boolean; outOfBand?: (prompt: AgentPromptInput) => boolean } = {},
|
||||
) {
|
||||
const clock = createClock();
|
||||
const sent: Dispatched[] = [];
|
||||
/** Message ids in the order the provider received them, whoever sent the prompt. */
|
||||
const received: string[] = [];
|
||||
const settleListeners = new Set<(recipientId: string) => void>();
|
||||
const stopListeners = new Set<(recipientId: string) => void>();
|
||||
let running = options.running ?? true;
|
||||
const answered = Promise.resolve();
|
||||
let providerAnswer: Promise<void> = answered;
|
||||
let managerReady: Promise<void> = answered;
|
||||
const outOfBand = options.outOfBand;
|
||||
const delivery = createAgentMessageDelivery({
|
||||
schedule: clock.schedule,
|
||||
isRunning: () => running,
|
||||
subscribe: (listener) => {
|
||||
settleListeners.add(listener);
|
||||
return () => settleListeners.delete(listener);
|
||||
},
|
||||
onStop: (listener) => {
|
||||
stopListeners.add(listener);
|
||||
return () => stopListeners.delete(listener);
|
||||
},
|
||||
tryRunOutOfBand: outOfBand
|
||||
? async (request, onAccepted) => {
|
||||
const [message] = parseAgentMessages(String(request.prompt)) ?? [];
|
||||
if (!message || !outOfBand(message.text)) return false;
|
||||
onAccepted();
|
||||
return true;
|
||||
}
|
||||
: undefined,
|
||||
dispatch: async (request) => {
|
||||
// The manager admits the prompt, the provider gets it, and the provider answers.
|
||||
await managerReady;
|
||||
if (!request.admit()) throw new Error("The prompt was not admitted");
|
||||
received.push(...request.messageIds);
|
||||
sent.push({
|
||||
ids: request.messageIds,
|
||||
behavior: request.activeTurnBehavior,
|
||||
idleOnly: request.idleOnly,
|
||||
mode: request.sessionMode,
|
||||
});
|
||||
// An accepted dispatch leaves the recipient with a running turn.
|
||||
running = true;
|
||||
await providerAnswer;
|
||||
return "turn_started";
|
||||
},
|
||||
onError: (error) => {
|
||||
throw error;
|
||||
},
|
||||
});
|
||||
const settle = () => new Promise<void>((resolve) => setImmediate(resolve));
|
||||
let next = 0;
|
||||
return {
|
||||
clock,
|
||||
sent,
|
||||
received,
|
||||
delivery,
|
||||
settle,
|
||||
ids: () => sent.flatMap((dispatch) => dispatch.ids),
|
||||
send(activeTurnBehavior: "steer" | "interrupt", messageId = `m${next++}`, agentId = "sender") {
|
||||
return delivery.enqueue({
|
||||
recipientId: "recipient",
|
||||
source: { kind: "agent-message", agentId },
|
||||
messageId,
|
||||
prompt: messageId,
|
||||
activeTurnBehavior,
|
||||
}).messageId;
|
||||
},
|
||||
/** The manager waits, as it does for a turn that is still starting, before it admits a prompt. */
|
||||
holdAdmission() {
|
||||
let ready!: () => void;
|
||||
managerReady = new Promise<void>((resolve) => {
|
||||
ready = resolve;
|
||||
});
|
||||
return {
|
||||
async release() {
|
||||
ready();
|
||||
managerReady = answered;
|
||||
await settle();
|
||||
},
|
||||
};
|
||||
},
|
||||
/** The provider takes its time to answer the dispatches that follow. */
|
||||
holdProviderAnswer() {
|
||||
let accept!: () => void;
|
||||
let refuse!: (error: Error) => void;
|
||||
providerAnswer = new Promise<void>((resolve, reject) => {
|
||||
accept = resolve;
|
||||
refuse = reject;
|
||||
});
|
||||
void providerAnswer.catch(() => undefined);
|
||||
return {
|
||||
async accept() {
|
||||
accept();
|
||||
providerAnswer = answered;
|
||||
await settle();
|
||||
},
|
||||
/** The turn never started, so the recipient is idle again. */
|
||||
async refuse(error: Error) {
|
||||
running = false;
|
||||
refuse(error);
|
||||
providerAnswer = answered;
|
||||
await settle();
|
||||
},
|
||||
};
|
||||
},
|
||||
/** A person's prompt: the provider turn it starts is running afterwards. */
|
||||
async person(
|
||||
prompt: string,
|
||||
messageId: string,
|
||||
outcome: { fail?: Error; started?: Promise<void> } = {},
|
||||
) {
|
||||
const prompts: AgentPromptInput[] = [];
|
||||
const result = await delivery
|
||||
.sendDirect({ recipientId: "recipient", prompt, messageId }, async (joined) => {
|
||||
prompts.push(joined.prompt);
|
||||
if (outcome.fail) throw outcome.fail;
|
||||
const joinedIds =
|
||||
typeof joined.prompt === "string"
|
||||
? parseAgentMessages(joined.prompt)?.map((message) => message.id)
|
||||
: undefined;
|
||||
received.push(...(joinedIds ?? [messageId]));
|
||||
running = true;
|
||||
return {
|
||||
disposition: "turn_started" as const,
|
||||
started: outcome.started ?? Promise.resolve(),
|
||||
};
|
||||
})
|
||||
.catch((error: unknown) => error);
|
||||
const [sentPrompt] = prompts;
|
||||
return {
|
||||
prompt: sentPrompt,
|
||||
result,
|
||||
ids:
|
||||
typeof sentPrompt === "string"
|
||||
? (parseAgentMessages(sentPrompt)?.map((message) => message.id) ?? null)
|
||||
: null,
|
||||
};
|
||||
},
|
||||
async endTurn() {
|
||||
running = false;
|
||||
for (const listener of settleListeners) listener("recipient");
|
||||
await settle();
|
||||
},
|
||||
/** Stop / cancel_agent: the manager announces the stop, then the turn settles. */
|
||||
async stop() {
|
||||
for (const listener of stopListeners) listener("recipient");
|
||||
running = false;
|
||||
for (const listener of settleListeners) listener("recipient");
|
||||
await settle();
|
||||
},
|
||||
async tick(ms = 2000) {
|
||||
clock.advance(ms);
|
||||
await settle();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
test.each(["sender", "another-sender"])(
|
||||
"a steer that waited ten minutes is delivered ahead of a later interrupt from %s, never after it",
|
||||
async (interrupter) => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "go-ahead", "sender");
|
||||
for (let elapsed = 0; elapsed < 600_000; elapsed += 2000) await recipient.tick();
|
||||
expect(recipient.sent).toEqual([]);
|
||||
|
||||
recipient.send("interrupt", "pause", interrupter);
|
||||
await recipient.settle();
|
||||
expect(recipient.sent).toEqual([
|
||||
{ ids: ["go-ahead", "pause"], behavior: "interrupt", idleOnly: false, mode: undefined },
|
||||
]);
|
||||
|
||||
await recipient.endTurn();
|
||||
await recipient.tick();
|
||||
expect(recipient.sent).toHaveLength(1);
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(false);
|
||||
await recipient.delivery.close();
|
||||
},
|
||||
);
|
||||
|
||||
test("a steer admitted after an interrupt waits for the replacement turn to end", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "A");
|
||||
recipient.send("interrupt", "B");
|
||||
recipient.send("steer", "C");
|
||||
await recipient.tick();
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([["A", "B"]]);
|
||||
|
||||
await recipient.endTurn();
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([["A", "B"], ["C"]]);
|
||||
expect(recipient.sent[1]).toMatchObject({ behavior: "steer", idleOnly: true });
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("an interrupt is dispatched at admission while other messages keep arriving", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("interrupt", "pause");
|
||||
await recipient.settle();
|
||||
expect(recipient.ids()).toEqual(["pause"]);
|
||||
// Reports that keep the quiet window open cannot hold a later interrupt back either.
|
||||
for (let i = 0; i < 5; i++) {
|
||||
recipient.send("steer", `report-${i}`);
|
||||
await recipient.tick(1900);
|
||||
}
|
||||
recipient.send("interrupt", "pause-again");
|
||||
await recipient.settle();
|
||||
expect(recipient.sent.at(-1)).toMatchObject({
|
||||
ids: ["report-0", "report-1", "report-2", "report-3", "report-4", "pause-again"],
|
||||
behavior: "interrupt",
|
||||
});
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("steady arrivals cannot keep an idle recipient's quiet window open past ten seconds", async () => {
|
||||
const recipient = createRecipient({ running: false });
|
||||
for (let i = 0; i < 6; i++) {
|
||||
recipient.send("steer", `report-${i}`);
|
||||
await recipient.tick(1900);
|
||||
}
|
||||
// 11.4 seconds of arrivals under two seconds apart: the window closed at ten.
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([
|
||||
["report-0", "report-1", "report-2", "report-3", "report-4", "report-5"],
|
||||
]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("the provider receives every prompt in admission order for every short interleaving", async () => {
|
||||
const actions = ["steer", "interrupt", "person", "stop", "end-turn", "tick"] as const;
|
||||
const length = 5;
|
||||
for (let scenario = 0; scenario < actions.length ** length; scenario++) {
|
||||
const recipient = createRecipient();
|
||||
const admitted: string[] = [];
|
||||
const script: string[] = [];
|
||||
let rest = scenario;
|
||||
for (let step = 0; step < length; step++) {
|
||||
const action = actions[rest % actions.length]!;
|
||||
rest = Math.floor(rest / actions.length);
|
||||
script.push(action);
|
||||
if (action === "end-turn") await recipient.endTurn();
|
||||
else if (action === "tick") await recipient.tick();
|
||||
else if (action === "stop") await recipient.stop();
|
||||
else if (action === "person") {
|
||||
admitted.push(`person-${step}`);
|
||||
await recipient.person(`person-${step}`, `person-${step}`);
|
||||
} else admitted.push(recipient.send(action));
|
||||
await recipient.settle();
|
||||
}
|
||||
// Let every remaining message out: windows close, turns end, and a last prompt takes
|
||||
// whatever a Stop still holds.
|
||||
for (let i = 0; i < 4; i++) {
|
||||
await recipient.tick();
|
||||
await recipient.endTurn();
|
||||
}
|
||||
await recipient.person("last", "last");
|
||||
expect(recipient.received, script.join(" → ")).toEqual([...admitted, "last"]);
|
||||
expect(recipient.delivery.hasPending("recipient"), script.join(" → ")).toBe(false);
|
||||
await recipient.delivery.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("order and Stop hold for every short interleaving while the provider is slow to answer", async () => {
|
||||
const actions = ["steer", "interrupt", "person", "stop", "tick", "hold", "answer"] as const;
|
||||
const length = 5;
|
||||
for (let scenario = 0; scenario < actions.length ** length; scenario++) {
|
||||
// The provider is offered waiting messages as commands, so closed windows line up queue
|
||||
// steps behind a dispatch the provider has not answered yet.
|
||||
const recipient = createRecipient({ outOfBand: () => false });
|
||||
const admitted: string[] = [];
|
||||
const admittedAt = new Map<string, number>();
|
||||
const script: string[] = [];
|
||||
let provider: ReturnType<typeof recipient.holdProviderAnswer> | undefined;
|
||||
let stoppedWhileHeld = false;
|
||||
let lastStop = -1;
|
||||
let checked = 0;
|
||||
const answer = async () => {
|
||||
// A turn that Stop canceled while it was starting never starts.
|
||||
if (stoppedWhileHeld) await provider?.refuse(new Error("run was canceled"));
|
||||
else await provider?.accept();
|
||||
provider = undefined;
|
||||
stoppedWhileHeld = false;
|
||||
};
|
||||
/** After a Stop, no queue dispatch carries only messages from before it. */
|
||||
const checkStop = () => {
|
||||
for (const dispatch of recipient.sent.slice(checked)) {
|
||||
const newest = Math.max(...dispatch.ids.map((id) => admittedAt.get(id) ?? -1));
|
||||
expect(newest, `${script.join(" → ")}: ${dispatch.ids.join(",")}`).toBeGreaterThan(
|
||||
lastStop,
|
||||
);
|
||||
}
|
||||
checked = recipient.sent.length;
|
||||
};
|
||||
let rest = scenario;
|
||||
for (let step = 0; step < length; step++) {
|
||||
const action = actions[rest % actions.length]!;
|
||||
rest = Math.floor(rest / actions.length);
|
||||
script.push(action);
|
||||
if (action === "tick") await recipient.tick();
|
||||
else if (action === "hold") provider ??= recipient.holdProviderAnswer();
|
||||
else if (action === "answer") await answer();
|
||||
else if (action === "stop") {
|
||||
lastStop = step;
|
||||
stoppedWhileHeld = provider !== undefined;
|
||||
await recipient.stop();
|
||||
} else if (action === "person") {
|
||||
admitted.push(`person-${step}`);
|
||||
admittedAt.set(`person-${step}`, step);
|
||||
void recipient.person(`person-${step}`, `person-${step}`);
|
||||
} else {
|
||||
const id = recipient.send(action);
|
||||
admitted.push(id);
|
||||
admittedAt.set(id, step);
|
||||
}
|
||||
await recipient.settle();
|
||||
checkStop();
|
||||
}
|
||||
await answer();
|
||||
checkStop();
|
||||
// Let every remaining message out: windows close, turns end, and a last prompt takes
|
||||
// whatever a Stop still holds.
|
||||
for (let i = 0; i < 4; i++) {
|
||||
await recipient.tick();
|
||||
await recipient.endTurn();
|
||||
}
|
||||
await recipient.person("last", "last");
|
||||
// A turn the provider refused is sent again, so each prompt counts where it last arrived.
|
||||
const arrived = recipient.received.filter(
|
||||
(id, index) => recipient.received.lastIndexOf(id) === index,
|
||||
);
|
||||
expect(arrived, script.join(" → ")).toEqual([...admitted, "last"]);
|
||||
expect(recipient.delivery.hasPending("recipient"), script.join(" → ")).toBe(false);
|
||||
await recipient.delivery.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("a person's prompt carries the queued messages ahead of it in the same prompt", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "go-ahead");
|
||||
await recipient.tick();
|
||||
|
||||
const { prompt, result } = await recipient.person("pause it", "person-1");
|
||||
expect(result).toMatchObject({ disposition: "turn_started" });
|
||||
expect(typeof prompt === "string" ? parseAgentMessages(prompt) : null).toEqual([
|
||||
{ id: "go-ahead", source: { kind: "agent-message", agentId: "sender" }, text: "go-ahead" },
|
||||
{ id: "person-1", source: null, text: "pause it" },
|
||||
]);
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(false);
|
||||
|
||||
// Nothing is left to start a turn of its own when the person's turn ends.
|
||||
await recipient.endTurn();
|
||||
await recipient.tick();
|
||||
expect(recipient.sent).toEqual([]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a person's prompt is untouched when nothing is queued, and a command travels alone", async () => {
|
||||
const recipient = createRecipient();
|
||||
expect((await recipient.person("hello", "person-1")).prompt).toBe("hello");
|
||||
|
||||
recipient.send("steer", "report");
|
||||
await recipient.tick();
|
||||
// Providers parse commands from raw text, so the queue stays where it is.
|
||||
expect((await recipient.person("/compact", "person-2")).prompt).toBe("/compact");
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(true);
|
||||
await recipient.endTurn();
|
||||
expect(recipient.ids()).toEqual(["report"]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("queued messages survive a person's prompt that fails to send", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "report");
|
||||
await recipient.tick();
|
||||
const failure = new Error("provider refused the prompt");
|
||||
expect((await recipient.person("hello", "person-1", { fail: failure })).result).toBe(failure);
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(true);
|
||||
await recipient.endTurn();
|
||||
expect(recipient.ids()).toEqual(["report"]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("Stop holds the messages queued before it until the recipient's next prompt", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "go-ahead");
|
||||
await recipient.tick();
|
||||
|
||||
await recipient.stop();
|
||||
await recipient.tick();
|
||||
await recipient.tick(60_000);
|
||||
// The stopped recipient stays stopped: no queued message starts a turn.
|
||||
expect(recipient.sent).toEqual([]);
|
||||
// Held messages need a prompt, so neither completion waits nor runtime guards wait for them.
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(false);
|
||||
await recipient.delivery.waitForDispatch("recipient", new AbortController().signal);
|
||||
|
||||
// A message admitted after the Stop is a new prompt: the held one goes ahead of it.
|
||||
recipient.send("steer", "later");
|
||||
await recipient.tick();
|
||||
expect(recipient.sent).toEqual([
|
||||
{ ids: ["go-ahead", "later"], behavior: "steer", idleOnly: true, mode: undefined },
|
||||
]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a person's prompt after Stop carries the held messages", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "go-ahead");
|
||||
await recipient.stop();
|
||||
|
||||
const { prompt } = await recipient.person("continue", "person-1");
|
||||
expect(
|
||||
typeof prompt === "string" ? parseAgentMessages(prompt)?.map((message) => message.id) : null,
|
||||
).toEqual(["go-ahead", "person-1"]);
|
||||
await recipient.endTurn();
|
||||
expect(recipient.sent).toEqual([]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a turn that ends on its own still releases the queue", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "report");
|
||||
await recipient.tick();
|
||||
await recipient.endTurn();
|
||||
expect(recipient.ids()).toEqual(["report"]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a prompt's place in line is decided when it is sent, not when the provider gets to it", async () => {
|
||||
const recipient = createRecipient();
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
|
||||
// All three arrive while the provider has not answered the first dispatch yet.
|
||||
recipient.send("steer", "older");
|
||||
const person = recipient.person("stop and wait", "person-1");
|
||||
recipient.send("steer", "newer");
|
||||
await provider.accept();
|
||||
|
||||
expect((await person).ids).toEqual(["older", "person-1"]);
|
||||
await recipient.tick();
|
||||
await recipient.endTurn();
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([["first"], ["newer"]]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("an interrupt sent after a person's prompt does not take older messages past that prompt", async () => {
|
||||
const recipient = createRecipient();
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
|
||||
recipient.send("steer", "older");
|
||||
const person = recipient.person("stop and wait", "person-1");
|
||||
recipient.send("interrupt", "newer");
|
||||
await provider.accept();
|
||||
|
||||
expect((await person).ids).toEqual(["older", "person-1"]);
|
||||
await recipient.settle();
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([["first"], ["newer"]]);
|
||||
expect(recipient.sent[1]).toMatchObject({ behavior: "interrupt", idleOnly: false });
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a queue step already in line does not pick up an interrupt sent after a person's prompt", async () => {
|
||||
// The provider is offered waiting messages as commands, so a closed window lines up a
|
||||
// queue step behind the dispatch in flight.
|
||||
const recipient = createRecipient({ outOfBand: () => false });
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
recipient.send("steer", "older");
|
||||
await recipient.tick();
|
||||
|
||||
const person = recipient.person("stop and wait", "person-1");
|
||||
recipient.send("interrupt", "newer");
|
||||
recipient.send("steer", "newest");
|
||||
await provider.accept();
|
||||
|
||||
expect((await person).ids).toEqual(["older", "person-1"]);
|
||||
await recipient.settle();
|
||||
expect(recipient.received).toEqual(["first", "older", "person-1", "newer"]);
|
||||
await recipient.tick();
|
||||
await recipient.endTurn();
|
||||
expect(recipient.received).toEqual(["first", "older", "person-1", "newer", "newest"]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("Stop holds an interrupt that was still waiting for the provider", async () => {
|
||||
const recipient = createRecipient();
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
const first = recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
recipient.send("interrupt", "second");
|
||||
await recipient.settle();
|
||||
expect(recipient.ids()).toEqual([first]);
|
||||
|
||||
// Stop cancels the turn that was starting. The interrupt behind it must not start another.
|
||||
await recipient.stop();
|
||||
await provider.refuse(new Error("run was canceled before its turn started"));
|
||||
await recipient.tick();
|
||||
await recipient.tick(60_000);
|
||||
expect(recipient.ids()).toEqual(["first"]);
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(false);
|
||||
|
||||
// Neither message is lost: both go with the recipient's next prompt, in order.
|
||||
expect((await recipient.person("continue", "person-1")).ids).toEqual([
|
||||
"first",
|
||||
"second",
|
||||
"person-1",
|
||||
]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a held interrupt waits like any other message once a later message releases it", async () => {
|
||||
const recipient = createRecipient();
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
recipient.send("interrupt", "second");
|
||||
await recipient.stop();
|
||||
await provider.refuse(new Error("run was canceled before its turn started"));
|
||||
|
||||
recipient.send("steer", "later");
|
||||
await recipient.settle();
|
||||
expect(recipient.ids()).toEqual(["first"]);
|
||||
await recipient.tick();
|
||||
expect(recipient.sent.at(-1)).toEqual({
|
||||
ids: ["first", "second", "later"],
|
||||
behavior: "steer",
|
||||
idleOnly: true,
|
||||
mode: undefined,
|
||||
});
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("queued messages return to the queue when the provider rejects the person's turn", async () => {
|
||||
const recipient = createRecipient();
|
||||
const report = recipient.delivery.enqueue({
|
||||
recipientId: "recipient",
|
||||
source: { kind: "agent-message", agentId: "sender" },
|
||||
messageId: "report",
|
||||
prompt: "report",
|
||||
});
|
||||
await recipient.tick();
|
||||
|
||||
let rejectStart!: (error: Error) => void;
|
||||
const started = new Promise<void>((_resolve, reject) => {
|
||||
rejectStart = reject;
|
||||
});
|
||||
void started.catch(() => undefined);
|
||||
const person = await recipient.person("hello", "person-1", { started });
|
||||
expect(person.result).toMatchObject({ disposition: "turn_started" });
|
||||
expect(person.ids).toEqual(["report", "person-1"]);
|
||||
|
||||
// An interrupt sent while the provider decides must not overtake the older report.
|
||||
recipient.send("interrupt", "pause");
|
||||
await recipient.settle();
|
||||
expect(recipient.sent).toEqual([]);
|
||||
|
||||
rejectStart(new Error("provider rejected the turn"));
|
||||
await recipient.settle();
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([["report", "pause"]]);
|
||||
await expect(report.dispatched).resolves.toBe("turn_started");
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("a person's prompt that begins with a path is plain text and carries the queue", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "go-ahead");
|
||||
await recipient.tick();
|
||||
|
||||
const path = await recipient.person(
|
||||
"/tmp/build.log is stale. Wait for my next prompt.",
|
||||
"person-1",
|
||||
);
|
||||
expect(path.ids).toEqual(["go-ahead", "person-1"]);
|
||||
|
||||
recipient.send("steer", "report");
|
||||
await recipient.tick();
|
||||
for (const command of ["/compact", " /goal pause", "/review focus on tests"]) {
|
||||
expect((await recipient.person(command, "person-2")).prompt).toBe(command);
|
||||
}
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(true);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("an interrupt the provider runs as a command beside the turn takes no queued message along", async () => {
|
||||
const recipient = createRecipient({ outOfBand: (prompt) => prompt === "/compact" });
|
||||
recipient.send("steer", "report");
|
||||
await recipient.tick();
|
||||
|
||||
const compact = recipient.delivery.enqueue({
|
||||
recipientId: "recipient",
|
||||
source: { kind: "agent-message", agentId: "sender" },
|
||||
messageId: "compact",
|
||||
prompt: "/compact",
|
||||
activeTurnBehavior: "interrupt",
|
||||
});
|
||||
await expect(compact.dispatched).resolves.toBe("out_of_band");
|
||||
// The command replaced nothing, so the report still waits for the turn to end.
|
||||
expect(recipient.sent).toEqual([]);
|
||||
await recipient.endTurn();
|
||||
expect(recipient.ids()).toEqual(["report"]);
|
||||
|
||||
// An interrupt the provider declines to run beside the turn replaces it, queue first.
|
||||
recipient.send("steer", "another-report");
|
||||
const plain = recipient.delivery.enqueue({
|
||||
recipientId: "recipient",
|
||||
source: { kind: "agent-message", agentId: "sender" },
|
||||
messageId: "pause",
|
||||
prompt: "pause",
|
||||
activeTurnBehavior: "interrupt",
|
||||
});
|
||||
await expect(plain.dispatched).resolves.toBe("turn_started");
|
||||
expect(recipient.sent.at(-1)).toMatchObject({
|
||||
ids: ["another-report", "pause"],
|
||||
behavior: "interrupt",
|
||||
});
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("an interrupt keeps its place ahead of a later person's prompt when a queue step is already in line", async () => {
|
||||
// The provider is offered waiting messages as commands, so a closed window lines up a
|
||||
// queue step behind the dispatch in flight.
|
||||
const recipient = createRecipient({ outOfBand: () => false });
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
recipient.send("steer", "older");
|
||||
await recipient.tick();
|
||||
|
||||
recipient.send("interrupt", "pause");
|
||||
const person = recipient.person("carry on", "person-1");
|
||||
await provider.accept();
|
||||
|
||||
// The interrupt replaces the turn itself; the person's prompt follows it and carries nothing.
|
||||
expect((await person).prompt).toBe("carry on");
|
||||
expect(recipient.sent.at(-1)).toEqual({
|
||||
ids: ["older", "pause"],
|
||||
behavior: "interrupt",
|
||||
idleOnly: false,
|
||||
mode: undefined,
|
||||
});
|
||||
expect(recipient.received).toEqual(["first", "older", "pause", "person-1"]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("an interrupt that was waiting when Stop arrived stays held when a later message reopens the queue", async () => {
|
||||
const recipient = createRecipient();
|
||||
const manager = recipient.holdAdmission();
|
||||
recipient.send("interrupt", "pause");
|
||||
await recipient.settle();
|
||||
|
||||
// The later steer arrives before the manager gets back to the interrupt.
|
||||
await recipient.stop();
|
||||
recipient.send("steer", "later");
|
||||
await manager.release();
|
||||
expect(recipient.sent).toEqual([]);
|
||||
|
||||
// The held interrupt goes with the later message, as a steer.
|
||||
await recipient.tick();
|
||||
expect(recipient.sent).toEqual([
|
||||
{ ids: ["pause", "later"], behavior: "steer", idleOnly: true, mode: undefined },
|
||||
]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("messages whose starting turn Stop canceled are kept when a later message reopens the queue", async () => {
|
||||
const recipient = createRecipient({ running: false });
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
const report = recipient.delivery.enqueue({
|
||||
recipientId: "recipient",
|
||||
source: { kind: "agent-message", agentId: "sender" },
|
||||
messageId: "report",
|
||||
prompt: "report",
|
||||
});
|
||||
await recipient.tick();
|
||||
expect(recipient.ids()).toEqual(["report"]);
|
||||
|
||||
await recipient.stop();
|
||||
recipient.send("steer", "later");
|
||||
await provider.refuse(new Error("run was canceled before its turn started"));
|
||||
|
||||
await recipient.tick();
|
||||
expect(recipient.sent.at(-1)).toMatchObject({ ids: ["report", "later"] });
|
||||
await expect(report.dispatched).resolves.toBe("turn_started");
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("shutdown delivers the messages a rejected person's turn returns to the queue", async () => {
|
||||
const recipient = createRecipient();
|
||||
const report = recipient.delivery.enqueue({
|
||||
recipientId: "recipient",
|
||||
source: { kind: "agent-message", agentId: "sender" },
|
||||
messageId: "report",
|
||||
prompt: "report",
|
||||
});
|
||||
await recipient.tick();
|
||||
let rejectStart!: (error: Error) => void;
|
||||
const started = new Promise<void>((_resolve, reject) => {
|
||||
rejectStart = reject;
|
||||
});
|
||||
void started.catch(() => undefined);
|
||||
await recipient.person("hello", "person-1", { started });
|
||||
|
||||
// Shutdown begins while the provider is still deciding, then the provider rejects the turn.
|
||||
let closed = false;
|
||||
const closing = recipient.delivery.close().then(() => {
|
||||
closed = true;
|
||||
return undefined;
|
||||
});
|
||||
rejectStart(new Error("provider rejected the turn"));
|
||||
await recipient.settle();
|
||||
await recipient.settle();
|
||||
|
||||
expect(closed).toBe(true);
|
||||
expect(recipient.sent.map((dispatch) => dispatch.ids)).toEqual([["report"]]);
|
||||
await expect(report.dispatched).resolves.toBe("turn_started");
|
||||
await closing;
|
||||
});
|
||||
|
||||
test("a queue step reserved before Stop releases nothing once the queue reopens", async () => {
|
||||
// The provider is offered waiting messages as commands, so a closed window lines up a
|
||||
// queue step behind the dispatch in flight.
|
||||
const recipient = createRecipient({ outOfBand: () => false });
|
||||
const provider = recipient.holdProviderAnswer();
|
||||
recipient.send("interrupt", "first");
|
||||
await recipient.settle();
|
||||
recipient.send("steer", "older");
|
||||
await recipient.tick();
|
||||
|
||||
// The new interrupt arrives before the provider has finished stopping.
|
||||
await recipient.stop();
|
||||
recipient.send("interrupt", "newer");
|
||||
await provider.refuse(new Error("run was canceled before its turn started"));
|
||||
await recipient.settle();
|
||||
|
||||
// One turn after the Stop: the held messages, then the interrupt that follows them.
|
||||
expect(recipient.sent.slice(1)).toEqual([
|
||||
{ ids: ["first", "older", "newer"], behavior: "interrupt", idleOnly: false, mode: undefined },
|
||||
]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
test("held messages stay held when the message that reopened the queue is withdrawn", async () => {
|
||||
const recipient = createRecipient();
|
||||
recipient.send("steer", "older");
|
||||
await recipient.stop();
|
||||
|
||||
// A later message reopens the queue, then its sender takes it back before the window closes.
|
||||
recipient.send("steer", "update", "watcher");
|
||||
expect(
|
||||
recipient.delivery.withdrawPending(
|
||||
"recipient",
|
||||
(source) => source.kind === "agent-message" && source.agentId === "watcher",
|
||||
),
|
||||
).toBe(1);
|
||||
await recipient.tick();
|
||||
await recipient.tick(60_000);
|
||||
expect(recipient.sent).toEqual([]);
|
||||
expect(recipient.delivery.hasPending("recipient")).toBe(false);
|
||||
|
||||
expect((await recipient.person("continue", "person-1")).ids).toEqual(["older", "person-1"]);
|
||||
await recipient.delivery.close();
|
||||
});
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
import {
|
||||
AgentTurnBusyError,
|
||||
type PromptDispatchDisposition,
|
||||
type PromptDispatchResult,
|
||||
} from "../agent-prompt.js";
|
||||
import { AgentTurnBusyError, type PromptDispatchDisposition } from "../agent-prompt.js";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { AgentPromptInput, AgentPromptContentBlock } from "../agent-sdk-types.js";
|
||||
import { envelopeMessage, prepareAgentMessage, type AgentPromptSource } from "./envelope.js";
|
||||
|
||||
/** A message's quiet window closes this long after the latest arrival. */
|
||||
const QUIET_MS = 2000;
|
||||
/** Steady arrivals cannot keep a quiet window open longer than this. */
|
||||
const MAX_COLLECTING_MS = 10_000;
|
||||
import { prepareAgentMessage, type AgentPromptSource } from "./envelope.js";
|
||||
|
||||
interface Message {
|
||||
recipientId: string;
|
||||
@@ -30,164 +21,50 @@ interface Receipt {
|
||||
dispatched: Promise<PromptDispatchDisposition>;
|
||||
}
|
||||
interface Admitted extends Message {
|
||||
/** claimed: a dispatch has it. It leaves the queue when the provider admits the prompt. */
|
||||
state: "queued" | "claimed" | "withdrawn" | "rejected";
|
||||
/** An interrupt that was not released yet. After a Stop it waits like any other message. */
|
||||
urgent: boolean;
|
||||
/** A Stop found it in the queue. It waits for a prompt admitted after that Stop. */
|
||||
held: boolean;
|
||||
sequence: number;
|
||||
state: "queued" | "claimed" | "withdrawn";
|
||||
outOfBandDeclined: boolean;
|
||||
receipt: Receipt;
|
||||
resolve(disposition: PromptDispatchDisposition): void;
|
||||
reject(error: unknown): void;
|
||||
}
|
||||
/**
|
||||
* A recipient's queue. A dispatch in flight for the recipient is its entry in `releasing`:
|
||||
* collecting → waiting → releasing, and Stop moves the queue to held.
|
||||
*/
|
||||
interface Inbox {
|
||||
/**
|
||||
* Admission order. A message stays, in its place, until the provider admits the prompt that
|
||||
* carries it, so a Stop or a later prompt always finds it here.
|
||||
*/
|
||||
messages: Admitted[];
|
||||
phase:
|
||||
| "collecting" // The quiet window is open.
|
||||
| "waiting" // The window closed; released as soon as the recipient is idle.
|
||||
| "held"; // A Stop held it; released with the recipient's next prompt.
|
||||
/** The quiet window while collecting, the busy retry while waiting. */
|
||||
cancelTimer(): void;
|
||||
cancelCap(): void;
|
||||
/** A polling queue step is already in line behind the recipient's current operation. */
|
||||
advancing: boolean;
|
||||
/** Stops seen. A queue step reserved before a Stop is void, whatever is admitted afterwards. */
|
||||
stops: number;
|
||||
}
|
||||
interface DispatchRequest {
|
||||
recipientId: string;
|
||||
messageIds: readonly string[];
|
||||
prompt: AgentPromptInput;
|
||||
activeTurnBehavior: "steer" | "interrupt";
|
||||
idleOnly: boolean;
|
||||
/**
|
||||
* Claim this exact prompt at provider admission. A withdrawn message or a Stop that reached
|
||||
* the recipient first invalidates it.
|
||||
*/
|
||||
/** Claim this exact prompt at provider admission. A withdrawn message invalidates the batch. */
|
||||
admit(): boolean;
|
||||
sessionMode?: string;
|
||||
clearPendingPermissions: boolean;
|
||||
unarchive: boolean;
|
||||
}
|
||||
/** A prompt that does not wait its turn: a person's, or the daemon's own. */
|
||||
interface DirectPrompt {
|
||||
recipientId: string;
|
||||
prompt: AgentPromptInput;
|
||||
source?: AgentPromptSource;
|
||||
messageId?: string;
|
||||
sessionMode?: string;
|
||||
unarchive?: boolean;
|
||||
}
|
||||
/** The provider prompt a direct prompt became. Unchanged when nothing was queued. */
|
||||
interface JoinedPrompt {
|
||||
prompt: AgentPromptInput;
|
||||
messageId?: string;
|
||||
sessionMode?: string;
|
||||
unarchive: boolean;
|
||||
}
|
||||
interface Dependencies {
|
||||
/** Includes admitted starts and provider turns, including compaction. */
|
||||
isRunning?: (recipientId: string) => boolean;
|
||||
hasPendingPermission?: (recipientId: string) => boolean;
|
||||
/** Notify when recipient state changes; admission still checks whether it is idle. */
|
||||
subscribe?: (listener: (recipientId: string) => void) => () => void;
|
||||
/** Notify before a recipient's turn is stopped with no prompt replacing it. */
|
||||
onStop?: (listener: (recipientId: string) => void) => () => void;
|
||||
tryRunOutOfBand?(request: DispatchRequest, onAccepted: () => void): Promise<boolean>;
|
||||
/** Hand a batch to the recipient. Resolves once the provider admitted it. */
|
||||
dispatch(request: DispatchRequest): Promise<PromptDispatchDisposition>;
|
||||
/** Bound the wait for the provider to admit a direct prompt. Unbounded when absent. */
|
||||
awaitStart?(recipientId: string, started: Promise<void>): Promise<void>;
|
||||
onError(error: unknown, request: DispatchRequest): void;
|
||||
/** Return a cancellation function. Production uses the daemon's event loop. */
|
||||
schedule?: (delayMs: number, callback: () => void) => () => void;
|
||||
}
|
||||
export interface AgentMessageDelivery {
|
||||
/** Admit a message that waits its turn. An interrupt releases at once, with everything queued. */
|
||||
enqueue(message: Message): Receipt;
|
||||
/**
|
||||
* Send a prompt that does not wait its turn. The messages admitted before it go ahead of it
|
||||
* in the same provider prompt, so none starts a turn of its own afterwards. Its place is
|
||||
* decided by this call, whenever the recipient gets to it. A command travels alone.
|
||||
*/
|
||||
sendDirect<Result extends PromptDispatchResult>(
|
||||
direct: DirectPrompt,
|
||||
send: (joined: JoinedPrompt) => Promise<Result>,
|
||||
): Promise<Result>;
|
||||
/** Remove matching messages that the queue still owns before dispatcher handoff. */
|
||||
withdrawPending(recipientId: string, matches: (source: AgentPromptSource) => boolean): number;
|
||||
/** Messages and dispatches that will proceed without a new prompt. Held messages do not count. */
|
||||
/** Queued messages and provider dispatches still owned by this recipient. */
|
||||
hasPending(recipientId: string): boolean;
|
||||
/** Stop admission, flush pending messages, and await provider dispatch acknowledgments. */
|
||||
close(): Promise<void>;
|
||||
/** Completion waits include admitted messages, but return at permission checkpoints and holds. */
|
||||
/** Completion waits include admitted messages, but return at permission checkpoints. */
|
||||
waitForDispatch(recipientId: string, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
const isQueued = (message: Admitted): boolean => message.state === "queued";
|
||||
const isWithdrawn = (message: Admitted): boolean => message.state === "withdrawn";
|
||||
const isUrgent = (message: Admitted): boolean => isQueued(message) && message.urgent;
|
||||
const isOfferable = (message: Admitted): boolean =>
|
||||
isQueued(message) && !message.outOfBandDeclined && message.sessionMode === undefined;
|
||||
|
||||
/**
|
||||
* Providers read a command from the raw start of the prompt: a slash and a name with no
|
||||
* second slash in it. A path such as `/tmp/build.log` is plain text.
|
||||
*/
|
||||
function isCommand(prompt: AgentPromptInput): boolean {
|
||||
const first = typeof prompt === "string" ? prompt : prompt[0];
|
||||
if (typeof first !== "string" && first?.type !== "text") return false;
|
||||
const text = typeof first === "string" ? first : first.text;
|
||||
return /^\/[^\s/]+(\s|$)/.test(text.trim());
|
||||
}
|
||||
|
||||
function combine(prompts: AgentPromptInput[]): AgentPromptInput {
|
||||
return prompts.every((entry) => typeof entry === "string")
|
||||
? prompts.join("\n\n")
|
||||
: prompts.flatMap((entry): AgentPromptContentBlock[] =>
|
||||
typeof entry === "string" ? [{ type: "text", text: entry }] : entry,
|
||||
);
|
||||
}
|
||||
|
||||
function envelope(message: Admitted): AgentPromptInput {
|
||||
return prepareAgentMessage(message.prompt, message.source, message.receipt.messageId).prompt;
|
||||
}
|
||||
|
||||
/** Explicitly conflicting session modes require separate, ordered dispatches. */
|
||||
function modeGroups(messages: Admitted[]): Admitted[][] {
|
||||
const groups: Admitted[][] = [];
|
||||
let group: Admitted[] = [];
|
||||
let mode: string | undefined;
|
||||
for (const message of messages) {
|
||||
if (mode && message.sessionMode && mode !== message.sessionMode) {
|
||||
groups.push(group);
|
||||
group = [];
|
||||
mode = undefined;
|
||||
}
|
||||
group.push(message);
|
||||
mode ??= message.sessionMode;
|
||||
}
|
||||
if (group.length) groups.push(group);
|
||||
return groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Owns the order in which prompts reach a recipient. Delivery order equals admission order:
|
||||
* only a prefix of the queue is ever dispatched, except a command a provider runs out of band.
|
||||
*
|
||||
* Every prompt for a recipient takes its place when it is admitted, and one operation at a
|
||||
* time acts on the queue. A message stays in the queue until the provider admits the prompt
|
||||
* that carries it, so agent messages, a person's prompts, and Stop all decide over the same list.
|
||||
*/
|
||||
/** Recipient-owned agent delivery. Human prompts never enter this module. */
|
||||
export function createAgentMessageDelivery(dependencies: Dependencies): AgentMessageDelivery {
|
||||
const schedule =
|
||||
dependencies.schedule ??
|
||||
@@ -195,118 +72,70 @@ export function createAgentMessageDelivery(dependencies: Dependencies): AgentMes
|
||||
const timer = setTimeout(callback, delayMs);
|
||||
return () => clearTimeout(timer);
|
||||
});
|
||||
const inboxes = new Map<string, Inbox>();
|
||||
const releasing = new Map<string, Promise<void>>();
|
||||
const pending = new Map<string, { messages: Admitted[]; ready: boolean; cancel(): void }>();
|
||||
const dispatching = new Map<string, Promise<void>>();
|
||||
const admitted = new Map<string, Set<Admitted>>();
|
||||
let sequence = 0;
|
||||
let closed = false;
|
||||
let closing: Promise<void> | undefined;
|
||||
|
||||
const isRunning = (recipientId: string): boolean =>
|
||||
Boolean(dependencies.isRunning?.(recipientId));
|
||||
const isHeld = (recipientId: string): boolean => inboxes.get(recipientId)?.phase === "held";
|
||||
const isWithdrawn = (message: Admitted): boolean => message.state === "withdrawn";
|
||||
|
||||
/** Tells whether a Stop has reached the recipient since this call. */
|
||||
function watchForStop(inbox: Inbox): () => boolean {
|
||||
const seen = inbox.stops;
|
||||
return () => inbox.stops !== seen;
|
||||
}
|
||||
|
||||
function requestFor(
|
||||
recipientId: string,
|
||||
messages: Admitted[],
|
||||
idleOnly: boolean,
|
||||
stopped: () => boolean,
|
||||
): DispatchRequest {
|
||||
function requestFor(recipientId: string, messages: Admitted[]): DispatchRequest {
|
||||
const prompts = messages.map(
|
||||
(message) =>
|
||||
prepareAgentMessage(message.prompt, message.source, message.receipt.messageId).prompt,
|
||||
);
|
||||
const prompt: AgentPromptInput = prompts.every((entry) => typeof entry === "string")
|
||||
? prompts.join("\n\n")
|
||||
: prompts.flatMap((entry): AgentPromptContentBlock[] =>
|
||||
typeof entry === "string" ? [{ type: "text", text: entry }] : entry,
|
||||
);
|
||||
return {
|
||||
recipientId,
|
||||
idleOnly,
|
||||
idleOnly: !closed && messages[0]!.activeTurnBehavior !== "interrupt",
|
||||
admit() {
|
||||
if (messages.some(isWithdrawn) || stopped()) return false;
|
||||
if (messages.some(isWithdrawn)) return false;
|
||||
for (const message of messages) message.state = "claimed";
|
||||
return true;
|
||||
},
|
||||
messageIds: messages.map((message) => message.receipt.messageId),
|
||||
prompt: combine(messages.map(envelope)),
|
||||
activeTurnBehavior: messages.some((message) => message.urgent) ? "interrupt" : "steer",
|
||||
// An interrupt may follow a message that asked for another mode; the latest choice wins.
|
||||
sessionMode: messages.findLast((message) => message.sessionMode)?.sessionMode,
|
||||
prompt,
|
||||
activeTurnBehavior: messages[0]!.activeTurnBehavior ?? "steer",
|
||||
sessionMode: messages.find((message) => message.sessionMode)?.sessionMode,
|
||||
clearPendingPermissions: messages.some((message) => message.clearPendingPermissions),
|
||||
unarchive: messages.some((message) => message.unarchive !== false),
|
||||
};
|
||||
}
|
||||
|
||||
function retire(recipientId: string, inbox: Inbox): void {
|
||||
inbox.cancelTimer();
|
||||
inbox.cancelCap();
|
||||
if (inboxes.get(recipientId) === inbox) inboxes.delete(recipientId);
|
||||
function withdraw(message: Admitted): void {
|
||||
message.state = "withdrawn";
|
||||
message.reject(new DOMException("Agent message withdrawn", "AbortError"));
|
||||
}
|
||||
|
||||
/** The message reached its end: delivered, failed, or withdrawn. */
|
||||
function settle(message: Admitted, state: "claimed" | "rejected" | "withdrawn"): void {
|
||||
message.state = state;
|
||||
const inbox = inboxes.get(message.recipientId);
|
||||
const index = inbox?.messages.indexOf(message) ?? -1;
|
||||
if (!inbox || index < 0) return;
|
||||
inbox.messages.splice(index, 1);
|
||||
if (!inbox.messages.length) retire(message.recipientId, inbox);
|
||||
}
|
||||
|
||||
function claim(
|
||||
message: Admitted,
|
||||
disposition: PromptDispatchDisposition,
|
||||
request: DispatchRequest,
|
||||
): void {
|
||||
settle(message, "claimed");
|
||||
try {
|
||||
message.onDispatch?.(disposition);
|
||||
} catch (error) {
|
||||
dependencies.onError(error, request);
|
||||
function withdrawPending(recipientId: string, matches: (message: Admitted) => boolean): number {
|
||||
let removed = 0;
|
||||
for (const message of admitted.get(recipientId) ?? []) {
|
||||
if (message.state !== "queued" || !matches(message)) continue;
|
||||
withdraw(message);
|
||||
removed++;
|
||||
}
|
||||
message.resolve(disposition);
|
||||
const entry = pending.get(recipientId);
|
||||
if (entry && removed) {
|
||||
entry.messages = entry.messages.filter((message) => !isWithdrawn(message));
|
||||
if (!entry.messages.length) {
|
||||
entry.cancel();
|
||||
pending.delete(recipientId);
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
/** A dispatch that did not happen leaves its messages queued, each still in its place. */
|
||||
function handBack(messages: Admitted[]): void {
|
||||
for (const message of messages) if (message.state === "claimed") message.state = "queued";
|
||||
}
|
||||
|
||||
function fail(message: Admitted, error: unknown): void {
|
||||
settle(message, "rejected");
|
||||
message.reject(error);
|
||||
}
|
||||
|
||||
/** One operation per recipient at a time, whether the queue or a person started it. */
|
||||
function run(recipientId: string, operation: () => Promise<void>): void {
|
||||
const previous = releasing.get(recipientId) ?? Promise.resolve();
|
||||
const tracked = previous
|
||||
.then(operation)
|
||||
.catch(() => undefined)
|
||||
.then(() => rest(recipientId));
|
||||
releasing.set(recipientId, tracked);
|
||||
void tracked.then(() => {
|
||||
if (releasing.get(recipientId) === tracked) releasing.delete(recipientId);
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
|
||||
/** After an operation, a waiting queue keeps polling for the turn to end. */
|
||||
function rest(recipientId: string): void {
|
||||
const inbox = inboxes.get(recipientId);
|
||||
if (!inbox || inbox.advancing || inbox.phase !== "waiting") return;
|
||||
inbox.cancelTimer();
|
||||
inbox.cancelTimer = schedule(QUIET_MS, () => attempt(recipientId));
|
||||
}
|
||||
|
||||
/** Dispatch one batch. A batch that finds the recipient stopped, or busy when idle-only, stays queued. */
|
||||
async function deliver(
|
||||
recipientId: string,
|
||||
batch: Admitted[],
|
||||
idleOnly: boolean,
|
||||
stopped: () => boolean,
|
||||
): Promise<void> {
|
||||
for (;;) {
|
||||
const messages = batch.filter(isQueued);
|
||||
function dispatch(recipientId: string, batch: Admitted[]): void {
|
||||
queueDispatch(recipientId, async () => {
|
||||
const messages = batch.filter((message) => message.state === "queued");
|
||||
if (!messages.length) return;
|
||||
const request = requestFor(recipientId, messages, idleOnly && !closed, stopped);
|
||||
const request = requestFor(recipientId, messages);
|
||||
try {
|
||||
for (const message of messages) message.beforeDispatch?.();
|
||||
let disposition: PromptDispatchDisposition;
|
||||
@@ -318,236 +147,170 @@ export function createAgentMessageDelivery(dependencies: Dependencies): AgentMes
|
||||
// Shutdown drains admitted messages before closing the recipients.
|
||||
disposition = await dependencies.dispatch({ ...request, idleOnly: false });
|
||||
}
|
||||
for (const message of messages) claim(message, disposition, request);
|
||||
return;
|
||||
for (const message of messages) {
|
||||
message.state = "claimed";
|
||||
try {
|
||||
message.onDispatch?.(disposition);
|
||||
} catch (error) {
|
||||
dependencies.onError(error, request);
|
||||
}
|
||||
message.resolve(disposition);
|
||||
}
|
||||
return undefined;
|
||||
} catch (error) {
|
||||
// A Stop reached the recipient before the provider admitted the prompt.
|
||||
if (stopped()) {
|
||||
handBack(messages);
|
||||
return;
|
||||
}
|
||||
// A withdrawal invalidated this exact prompt; the rest goes again without it.
|
||||
if (messages.some(isWithdrawn)) {
|
||||
handBack(messages);
|
||||
continue;
|
||||
}
|
||||
if (error instanceof AgentTurnBusyError && request.idleOnly) {
|
||||
handBack(messages);
|
||||
requeue(recipientId, messages);
|
||||
if (closed) flush(recipientId);
|
||||
return;
|
||||
}
|
||||
for (const message of messages) fail(message, error);
|
||||
if (error instanceof AgentTurnBusyError && !closed) {
|
||||
requeue(recipientId, messages);
|
||||
return;
|
||||
}
|
||||
for (const message of messages) message.reject(error);
|
||||
dependencies.onError(error, request);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** A provider may run a command beside the turn. Each message is offered once, alone. */
|
||||
async function offerOutOfBand(
|
||||
recipientId: string,
|
||||
candidates: Admitted[],
|
||||
stopped: () => boolean,
|
||||
stillDue: () => boolean = () => true,
|
||||
): Promise<void> {
|
||||
const tryRunOutOfBand = dependencies.tryRunOutOfBand;
|
||||
if (!tryRunOutOfBand) return;
|
||||
for (const message of candidates) {
|
||||
if (closed || stopped() || !stillDue()) return;
|
||||
if (!isOfferable(message)) continue;
|
||||
const request = requestFor(recipientId, [message], true, stopped);
|
||||
try {
|
||||
const accepted = await tryRunOutOfBand(request, () => {
|
||||
if (!request.admit()) throw new Error("Queued agent message was withdrawn");
|
||||
message.beforeDispatch?.();
|
||||
});
|
||||
if (accepted) claim(message, "out_of_band", request);
|
||||
else message.outOfBandDeclined = true;
|
||||
} catch (error) {
|
||||
if (!isQueued(message) || stopped()) continue;
|
||||
fail(message, error);
|
||||
dependencies.onError(error, request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the queue forward: an interrupt takes it now, a closed window once the turn has ended.
|
||||
* `ahead` is what was admitted before this step got in line; it leaves later messages alone.
|
||||
*/
|
||||
async function advance(
|
||||
recipientId: string,
|
||||
inbox: Inbox,
|
||||
ahead: Admitted[],
|
||||
stopped: () => boolean,
|
||||
): Promise<void> {
|
||||
const interrupts = ahead.filter(isUrgent);
|
||||
if (interrupts.length) {
|
||||
// A command the provider runs beside the turn replaces nothing, so it takes nothing along.
|
||||
await offerOutOfBand(recipientId, interrupts, stopped);
|
||||
const last = ahead.findLastIndex(isUrgent);
|
||||
if (last >= 0) {
|
||||
// An interrupt does not jump the queue: everything admitted before it goes first.
|
||||
await deliver(recipientId, ahead.slice(0, last + 1), false, stopped);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (inbox.phase !== "waiting") return;
|
||||
const running = (): boolean => inbox.phase === "waiting" && isRunning(recipientId);
|
||||
if (running()) await offerOutOfBand(recipientId, ahead, stopped, running);
|
||||
// Later mode groups stay queued for the turn ends that follow.
|
||||
if (inbox.phase === "waiting" && !isRunning(recipientId))
|
||||
await deliver(recipientId, modeGroups(ahead.filter(isQueued))[0] ?? [], true, stopped);
|
||||
}
|
||||
|
||||
/**
|
||||
* Line up a queue step behind the recipient's current operation, for what is queued now.
|
||||
* A Stop voids the steps reserved before it: what they covered waits for the next prompt.
|
||||
*/
|
||||
function lineUp(recipientId: string, inbox: Inbox, onStart?: () => void): void {
|
||||
const ahead = [...inbox.messages];
|
||||
const stopped = watchForStop(inbox);
|
||||
run(recipientId, async () => {
|
||||
onStart?.();
|
||||
if (!stopped()) await advance(recipientId, inbox, ahead, stopped);
|
||||
});
|
||||
}
|
||||
|
||||
/** Polling lines up one step at a time; an interrupt always reserves its own place. */
|
||||
function nudge(recipientId: string, inbox: Inbox): void {
|
||||
if (inbox.advancing) return;
|
||||
inbox.advancing = true;
|
||||
lineUp(recipientId, inbox, () => {
|
||||
inbox.advancing = false;
|
||||
});
|
||||
function queueDispatch(recipientId: string, operation: () => Promise<void>): void {
|
||||
const previous = dispatching.get(recipientId) ?? Promise.resolve();
|
||||
const dispatched = previous.catch(() => undefined).then(operation);
|
||||
dispatching.set(recipientId, dispatched);
|
||||
void dispatched
|
||||
.finally(() => {
|
||||
if (dispatching.get(recipientId) === dispatched) dispatching.delete(recipientId);
|
||||
})
|
||||
.catch(() => undefined);
|
||||
}
|
||||
|
||||
/** The quiet window closed, a retry came due, or the recipient settled. */
|
||||
function attempt(recipientId: string): void {
|
||||
const inbox = inboxes.get(recipientId);
|
||||
if (!inbox || inbox.phase === "held") return;
|
||||
inbox.cancelTimer();
|
||||
inbox.cancelCap();
|
||||
inbox.phase = "waiting";
|
||||
const running = isRunning(recipientId);
|
||||
if (running) inbox.cancelTimer = schedule(QUIET_MS, () => attempt(recipientId));
|
||||
const nothingToOffer = !dependencies.tryRunOutOfBand || !inbox.messages.some(isOfferable);
|
||||
if (running && nothingToOffer) return;
|
||||
nudge(recipientId, inbox);
|
||||
}
|
||||
|
||||
function admit(item: Admitted): void {
|
||||
const existing = inboxes.get(item.recipientId);
|
||||
const inbox = existing ?? {
|
||||
function requeue(recipientId: string, messages: Admitted[]): void {
|
||||
const queued = messages.filter((message) => !isWithdrawn(message));
|
||||
if (!queued.length) return;
|
||||
for (const message of queued) message.state = "queued";
|
||||
const entry = pending.get(recipientId) ?? {
|
||||
messages: [],
|
||||
phase: "waiting",
|
||||
cancelTimer: () => {},
|
||||
cancelCap: () => {},
|
||||
advancing: false,
|
||||
stops: 0,
|
||||
ready: true,
|
||||
cancel: () => {},
|
||||
};
|
||||
inboxes.set(item.recipientId, inbox);
|
||||
inbox.messages.push(item);
|
||||
inbox.cancelTimer();
|
||||
if (item.urgent) {
|
||||
// An interrupt does not wait: it closes the window and takes the queue along. Its place
|
||||
// is reserved now, so a prompt admitted after it cannot take it away.
|
||||
inbox.cancelCap();
|
||||
inbox.phase = "waiting";
|
||||
lineUp(item.recipientId, inbox);
|
||||
entry.cancel();
|
||||
entry.messages.push(...queued);
|
||||
entry.messages.sort((a, b) => a.sequence - b.sequence);
|
||||
entry.cancel = schedule(2000, () => flush(recipientId));
|
||||
pending.set(recipientId, entry);
|
||||
}
|
||||
|
||||
function flush(recipientId: string): void {
|
||||
const entry = pending.get(recipientId);
|
||||
if (!entry) return;
|
||||
entry.ready = true;
|
||||
entry.cancel();
|
||||
if (!closed && dependencies.isRunning?.(recipientId)) {
|
||||
const interrupts = entry.messages.filter(
|
||||
(message) => message.activeTurnBehavior === "interrupt",
|
||||
);
|
||||
entry.messages = entry.messages.filter(
|
||||
(message) => message.activeTurnBehavior !== "interrupt",
|
||||
);
|
||||
if (interrupts.length) dispatchGroups(recipientId, interrupts);
|
||||
if (entry.messages.length && dependencies.tryRunOutOfBand) {
|
||||
pending.delete(recipientId);
|
||||
offerOutOfBand(recipientId, entry.messages);
|
||||
} else if (entry.messages.length) {
|
||||
entry.cancel = schedule(2000, () => flush(recipientId));
|
||||
} else {
|
||||
pending.delete(recipientId);
|
||||
}
|
||||
return;
|
||||
}
|
||||
inbox.cancelTimer = schedule(QUIET_MS, () => attempt(item.recipientId));
|
||||
if (inbox.phase === "collecting") return;
|
||||
// A new window. It closes after a quiet spell, and no later than the cap.
|
||||
inbox.phase = "collecting";
|
||||
inbox.cancelCap = schedule(MAX_COLLECTING_MS, () => attempt(item.recipientId));
|
||||
pending.delete(recipientId);
|
||||
dispatchGroups(recipientId, entry.messages);
|
||||
}
|
||||
|
||||
function join(queued: Admitted[], direct: DirectPrompt): JoinedPrompt {
|
||||
if (!queued.length) {
|
||||
const own = prepareAgentMessage(direct.prompt, direct.source, direct.messageId);
|
||||
return {
|
||||
prompt: own.prompt,
|
||||
messageId: own.messageId,
|
||||
sessionMode: direct.sessionMode,
|
||||
unarchive: direct.unarchive !== false,
|
||||
};
|
||||
}
|
||||
// Sharing a prompt with agent messages, a person's text needs its own envelope to stay
|
||||
// a separate row with its own identity.
|
||||
const own = envelopeMessage(direct.prompt, direct.source ?? null, direct.messageId);
|
||||
return {
|
||||
prompt: combine([...queued.map(envelope), own.prompt]),
|
||||
messageId: own.messageId,
|
||||
sessionMode:
|
||||
direct.sessionMode ?? queued.findLast((message) => message.sessionMode)?.sessionMode,
|
||||
unarchive:
|
||||
direct.unarchive !== false || queued.some((message) => message.unarchive !== false),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Messages that rode a direct prompt are delivered when the provider admits that prompt.
|
||||
* Until it answers, nothing later may pass them.
|
||||
*/
|
||||
async function ride(riders: Admitted[], result: PromptDispatchResult): Promise<void> {
|
||||
if (!riders.length) return;
|
||||
const { recipientId } = riders[0]!;
|
||||
if (result.disposition === "turn_started") {
|
||||
try {
|
||||
await (dependencies.awaitStart?.(recipientId, result.started) ?? result.started);
|
||||
} catch {
|
||||
// The provider rejected the prompt that carried them. They go again, in their place.
|
||||
handBack(riders);
|
||||
return;
|
||||
function offerOutOfBand(recipientId: string, messages: Admitted[]): void {
|
||||
queueDispatch(recipientId, async () => {
|
||||
const waiting: Admitted[] = [];
|
||||
for (const message of messages) {
|
||||
if (isWithdrawn(message)) continue;
|
||||
if (
|
||||
message.outOfBandDeclined ||
|
||||
message.sessionMode !== undefined ||
|
||||
closed ||
|
||||
!dependencies.isRunning?.(recipientId)
|
||||
) {
|
||||
waiting.push(message);
|
||||
continue;
|
||||
}
|
||||
const request = requestFor(recipientId, [message]);
|
||||
try {
|
||||
const accepted = await dependencies.tryRunOutOfBand!(request, () => {
|
||||
if (!request.admit()) throw new Error("Queued agent message was withdrawn");
|
||||
message.beforeDispatch?.();
|
||||
});
|
||||
if (!accepted) {
|
||||
message.outOfBandDeclined = true;
|
||||
waiting.push(message);
|
||||
continue;
|
||||
}
|
||||
message.state = "claimed";
|
||||
try {
|
||||
message.onDispatch?.("out_of_band");
|
||||
} catch (error) {
|
||||
dependencies.onError(error, request);
|
||||
}
|
||||
message.resolve("out_of_band");
|
||||
} catch (error) {
|
||||
if (isWithdrawn(message)) continue;
|
||||
message.reject(error);
|
||||
dependencies.onError(error, request);
|
||||
}
|
||||
}
|
||||
}
|
||||
const request = requestFor(recipientId, riders, false, () => false);
|
||||
for (const message of riders) claim(message, result.disposition, request);
|
||||
if (waiting.length) requeue(recipientId, waiting);
|
||||
if (closed || (pending.get(recipientId)?.ready && !dependencies.isRunning?.(recipientId)))
|
||||
flush(recipientId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The stopped recipient stays stopped. Its queue, interrupts included, goes with whatever
|
||||
* prompts it next.
|
||||
*/
|
||||
function hold(inbox: Inbox): void {
|
||||
inbox.cancelTimer();
|
||||
inbox.cancelCap();
|
||||
inbox.phase = "held";
|
||||
inbox.stops++;
|
||||
for (const message of inbox.messages) {
|
||||
message.urgent = false;
|
||||
message.held = true;
|
||||
function dispatchGroups(recipientId: string, messages: Admitted[]): void {
|
||||
const groups: Admitted[][] = [];
|
||||
let group: Admitted[] = [];
|
||||
let mode: string | undefined;
|
||||
for (const message of messages) {
|
||||
// Explicitly conflicting send options require separate, ordered dispatches.
|
||||
if (
|
||||
group.length &&
|
||||
((message.activeTurnBehavior ?? "steer") !== (group[0]!.activeTurnBehavior ?? "steer") ||
|
||||
(mode && message.sessionMode && mode !== message.sessionMode))
|
||||
) {
|
||||
groups.push(group);
|
||||
group = [];
|
||||
mode = undefined;
|
||||
}
|
||||
group.push(message);
|
||||
mode ??= message.sessionMode;
|
||||
}
|
||||
if (group.length) groups.push(group);
|
||||
let started = false;
|
||||
for (const batch of groups) {
|
||||
if (!closed && started && batch[0]!.activeTurnBehavior !== "interrupt") {
|
||||
requeue(recipientId, batch);
|
||||
} else {
|
||||
dispatch(recipientId, batch);
|
||||
started = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const unsubscribe = dependencies.subscribe?.((recipientId) => {
|
||||
if (inboxes.get(recipientId)?.phase === "waiting" && !isRunning(recipientId))
|
||||
attempt(recipientId);
|
||||
});
|
||||
const unsubscribeStop = dependencies.onStop?.((recipientId) => {
|
||||
const inbox = inboxes.get(recipientId);
|
||||
if (inbox) hold(inbox);
|
||||
if (pending.get(recipientId)?.ready && !dependencies.isRunning?.(recipientId))
|
||||
flush(recipientId);
|
||||
});
|
||||
|
||||
return {
|
||||
withdrawPending(recipientId, matches) {
|
||||
const withdrawn = (inboxes.get(recipientId)?.messages ?? []).filter(
|
||||
(message) => isQueued(message) && matches(message.source),
|
||||
);
|
||||
for (const message of withdrawn) {
|
||||
settle(message, "withdrawn");
|
||||
message.reject(new DOMException("Agent message withdrawn", "AbortError"));
|
||||
}
|
||||
// Without the message that reopened it after a Stop, the queue is held again.
|
||||
const inbox = inboxes.get(recipientId);
|
||||
if (withdrawn.length && inbox?.messages.every((message) => message.held)) hold(inbox);
|
||||
return withdrawn.length;
|
||||
},
|
||||
hasPending(recipientId) {
|
||||
const inbox = inboxes.get(recipientId);
|
||||
return inbox !== undefined && inbox.phase !== "held";
|
||||
},
|
||||
withdrawPending: (recipientId, matches) =>
|
||||
withdrawPending(recipientId, (message) => matches(message.source)),
|
||||
hasPending: (recipientId) => pending.has(recipientId) || dispatching.has(recipientId),
|
||||
enqueue(message) {
|
||||
if (closed) throw new Error("Agent message delivery is closed");
|
||||
let resolve!: Admitted["resolve"];
|
||||
@@ -562,59 +325,50 @@ export function createAgentMessageDelivery(dependencies: Dependencies): AgentMes
|
||||
messageId: message.messageId ?? randomUUID(),
|
||||
dispatched,
|
||||
};
|
||||
admit({
|
||||
const item: Admitted = {
|
||||
...message,
|
||||
receipt,
|
||||
resolve,
|
||||
reject,
|
||||
sequence: sequence++,
|
||||
state: "queued",
|
||||
urgent: message.activeTurnBehavior === "interrupt",
|
||||
held: false,
|
||||
outOfBandDeclined: false,
|
||||
});
|
||||
};
|
||||
const owned = admitted.get(message.recipientId) ?? new Set<Admitted>();
|
||||
owned.add(item);
|
||||
admitted.set(message.recipientId, owned);
|
||||
void dispatched
|
||||
.finally(() => {
|
||||
owned.delete(item);
|
||||
if (!owned.size) admitted.delete(message.recipientId);
|
||||
})
|
||||
.catch(() => undefined);
|
||||
const entry = pending.get(message.recipientId) ?? {
|
||||
messages: [],
|
||||
ready: false,
|
||||
cancel: () => {},
|
||||
};
|
||||
entry.cancel();
|
||||
entry.ready = false;
|
||||
entry.messages.push(item);
|
||||
entry.cancel = schedule(2000, () => flush(message.recipientId));
|
||||
pending.set(message.recipientId, entry);
|
||||
return receipt;
|
||||
},
|
||||
sendDirect<Result extends PromptDispatchResult>(
|
||||
direct: DirectPrompt,
|
||||
send: (joined: JoinedPrompt) => Promise<Result>,
|
||||
): Promise<Result> {
|
||||
// Its place in line is decided now: what is queued goes with it, what comes later follows.
|
||||
const ahead =
|
||||
closed || isCommand(direct.prompt)
|
||||
? []
|
||||
: [...(inboxes.get(direct.recipientId)?.messages ?? [])];
|
||||
return new Promise<Result>((resolve, reject) => {
|
||||
run(direct.recipientId, async () => {
|
||||
const riders = ahead.filter(isQueued);
|
||||
for (const message of riders) message.state = "claimed";
|
||||
let result: Result;
|
||||
try {
|
||||
for (const message of riders) message.beforeDispatch?.();
|
||||
result = await send(join(riders, direct));
|
||||
} catch (error) {
|
||||
handBack(riders);
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
resolve(result);
|
||||
await ride(riders, result);
|
||||
});
|
||||
});
|
||||
},
|
||||
async waitForDispatch(recipientId, signal) {
|
||||
signal.throwIfAborted();
|
||||
const waiting = Array.from(inboxes.get(recipientId)?.messages ?? [], (message) =>
|
||||
const waiting = Array.from(admitted.get(recipientId) ?? [], (message) =>
|
||||
message.receipt.dispatched.catch((error) => {
|
||||
if (message.state !== "withdrawn") throw error;
|
||||
return undefined;
|
||||
}),
|
||||
);
|
||||
let unsubscribeCheckpoint: (() => void) | undefined;
|
||||
const checkpoint = new Promise<void>((resolve) => {
|
||||
let unsubscribePermission: (() => void) | undefined;
|
||||
const permission = new Promise<void>((resolve) => {
|
||||
const check = () => {
|
||||
if (dependencies.hasPendingPermission?.(recipientId) || isHeld(recipientId)) resolve();
|
||||
if (dependencies.hasPendingPermission?.(recipientId)) resolve();
|
||||
};
|
||||
unsubscribeCheckpoint = dependencies.subscribe?.((agentId) => {
|
||||
unsubscribePermission = dependencies.subscribe?.((agentId) => {
|
||||
if (agentId === recipientId) check();
|
||||
});
|
||||
check();
|
||||
@@ -626,36 +380,26 @@ export function createAgentMessageDelivery(dependencies: Dependencies): AgentMes
|
||||
});
|
||||
try {
|
||||
await Promise.race([
|
||||
Promise.all([releasing.get(recipientId), ...waiting]),
|
||||
Promise.all([dispatching.get(recipientId), ...waiting]),
|
||||
cancellation,
|
||||
checkpoint,
|
||||
permission,
|
||||
]);
|
||||
} finally {
|
||||
signal.removeEventListener("abort", aborted);
|
||||
unsubscribeCheckpoint?.();
|
||||
unsubscribePermission?.();
|
||||
}
|
||||
},
|
||||
close() {
|
||||
if (closing) return closing;
|
||||
closed = true;
|
||||
unsubscribe?.();
|
||||
unsubscribeStop?.();
|
||||
const receipts: Promise<unknown>[] = [];
|
||||
for (const [recipientId, inbox] of inboxes) {
|
||||
inbox.cancelTimer();
|
||||
inbox.cancelCap();
|
||||
// Shutdown delivers held messages too: nothing in memory survives it.
|
||||
inbox.phase = "waiting";
|
||||
receipts.push(...inbox.messages.map((message) => message.receipt.dispatched));
|
||||
// The drain reads the queue when its turn comes, so it sees what the operation in
|
||||
// flight returns to it.
|
||||
run(recipientId, async () => {
|
||||
for (const group of modeGroups(inbox.messages.filter(isQueued)))
|
||||
await deliver(recipientId, group, false, () => false).catch(() => undefined);
|
||||
});
|
||||
}
|
||||
for (const recipientId of pending.keys()) flush(recipientId);
|
||||
// Each failure is reported and rejects its receipts; shutdown still drains other recipients.
|
||||
closing = Promise.allSettled(receipts).then(() => undefined);
|
||||
closing = Promise.allSettled(
|
||||
[...admitted.values()].flatMap((owned) =>
|
||||
[...owned].map((message) => message.receipt.dispatched),
|
||||
),
|
||||
).then(() => undefined);
|
||||
return closing;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -150,23 +150,11 @@ export function prepareAgentMessage(
|
||||
return { prompt, messageId: id };
|
||||
}
|
||||
}
|
||||
return envelopeMessage(prompt, source ?? null, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap a prompt in its envelope unconditionally. A person's prompt (`source` null) needs one
|
||||
* only when it is quoted or shares a provider prompt with agent messages.
|
||||
*/
|
||||
export function envelopeMessage(
|
||||
prompt: AgentPromptInput,
|
||||
source: AgentPromptSource | null,
|
||||
id?: string,
|
||||
): { prompt: AgentPromptInput; messageId: string } {
|
||||
const messageId = id ?? randomUUID();
|
||||
const text = typeof prompt === "string" ? prompt : prompt.flatMap(renderMessageText).join("\n\n");
|
||||
// Render textual attachments before wrapping, so provider replay still contains one
|
||||
// complete envelope instead of an envelope followed by provider-rendered context.
|
||||
const envelope = formatAgentMessage({ id: messageId, source, text });
|
||||
const envelope = formatAgentMessage({ id: messageId, source: source ?? null, text });
|
||||
return {
|
||||
messageId,
|
||||
prompt:
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
prepareAgentMessage,
|
||||
type AgentMessageDelivery,
|
||||
type AgentPromptSource,
|
||||
} from "./agent-messages/index.js";
|
||||
import { prepareAgentMessage, type AgentPromptSource } from "./agent-messages/index.js";
|
||||
import type { Logger } from "pino";
|
||||
|
||||
import type { AgentPromptInput, AgentRunOptions } from "./agent-sdk-types.js";
|
||||
@@ -281,11 +277,6 @@ export interface SendPromptToAgentParams {
|
||||
logger: Logger;
|
||||
}
|
||||
|
||||
/** A prompt that does not wait its turn. Messages queued for the agent go with it. */
|
||||
export interface SendDirectPromptParams extends SendPromptToAgentParams {
|
||||
agentMessages: Pick<AgentMessageDelivery, "sendDirect">;
|
||||
}
|
||||
|
||||
export interface StartCreatedAgentInitialPromptParams {
|
||||
agentStorage: AgentStorage;
|
||||
agentManager: AgentManager;
|
||||
@@ -371,36 +362,21 @@ async function resolvePromptSource(
|
||||
* chat mentions, notify-on-finish) MUST go through this so behavior can never
|
||||
* drift between them.
|
||||
*
|
||||
* The prompt does not wait in the agent's message queue, and it does not jump it either:
|
||||
* messages already queued for the agent are delivered ahead of it in the same provider prompt.
|
||||
*
|
||||
* When `unarchive` is false and the agent is archived, the call is a silent
|
||||
* no-op (returns the normal turn-start disposition) — the agent is not run.
|
||||
*/
|
||||
export async function sendPromptToAgent(
|
||||
params: SendDirectPromptParams,
|
||||
params: SendPromptToAgentParams,
|
||||
): Promise<PromptDispatchResult> {
|
||||
const { agentMessages, source, messageId, ...send } = params;
|
||||
return agentMessages.sendDirect(
|
||||
{
|
||||
recipientId: params.agentId,
|
||||
prompt: params.prompt,
|
||||
source: await resolvePromptSource(source, params.agentManager, params.agentStorage),
|
||||
messageId,
|
||||
sessionMode: params.sessionMode,
|
||||
unarchive: params.unarchive,
|
||||
},
|
||||
(joined) =>
|
||||
sendPreparedPromptToAgent({
|
||||
...send,
|
||||
prompt: joined.prompt,
|
||||
sessionMode: joined.sessionMode,
|
||||
unarchive: joined.unarchive,
|
||||
runOptions: joined.messageId
|
||||
? { ...send.runOptions, clientMessageId: joined.messageId }
|
||||
: send.runOptions,
|
||||
}),
|
||||
);
|
||||
const source = await resolvePromptSource(params.source, params.agentManager, params.agentStorage);
|
||||
const delivery = prepareAgentMessage(params.prompt, source, params.messageId);
|
||||
return sendPreparedPromptToAgent({
|
||||
...params,
|
||||
prompt: delivery.prompt,
|
||||
runOptions: delivery.messageId
|
||||
? { ...params.runOptions, clientMessageId: delivery.messageId }
|
||||
: params.runOptions,
|
||||
});
|
||||
}
|
||||
|
||||
/** Dispatch daemon-prepared context without reclassifying it as human input. */
|
||||
|
||||
@@ -298,7 +298,7 @@ export function createHostResolver(input: {
|
||||
status: agent.status,
|
||||
guidance:
|
||||
receipt.deliveryStatus === "queued"
|
||||
? "Queued for delivery after two quiet seconds and the current turn ends. An interrupt replaces the turn now, after the messages queued before it. You will get notified when the prompted agent finishes, errors, or needs permission unless notifyOnFinish is false."
|
||||
? "Queued for delivery after two quiet seconds and the current turn ends, unless interrupt was requested. You will get notified when the prompted agent finishes, errors, or needs permission unless notifyOnFinish is false."
|
||||
: "Dispatch acknowledged. Observe completion using get_agent_status/get_agent_activity or SDK/RPC subscriptions and wait APIs.",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -29,17 +29,16 @@ import { AgentStorage, type StoredAgentRecord } from "./agent-storage.js";
|
||||
import { createTestAgentClients } from "../test-utils/fake-agent-client.js";
|
||||
import { OmpAgentClient } from "./providers/omp/agent.js";
|
||||
import { FakeOmp } from "./providers/omp/test-utils/fake-omp.js";
|
||||
import {
|
||||
AgentTurnStartCanceledError,
|
||||
type AgentClient,
|
||||
type AgentMode,
|
||||
type AgentPermissionRequest,
|
||||
type AgentPromptInput,
|
||||
type AgentProvider,
|
||||
type AgentRunResult,
|
||||
type AgentSession,
|
||||
type AgentStreamEvent,
|
||||
type ProviderSnapshotEntry,
|
||||
import type {
|
||||
AgentClient,
|
||||
AgentMode,
|
||||
AgentPermissionRequest,
|
||||
AgentPromptInput,
|
||||
AgentProvider,
|
||||
AgentRunResult,
|
||||
AgentSession,
|
||||
AgentStreamEvent,
|
||||
ProviderSnapshotEntry,
|
||||
} from "./agent-sdk-types.js";
|
||||
import type { ProviderSnapshotManager } from "./provider-snapshot-manager.js";
|
||||
import { createProviderSnapshotManagerStub } from "../test-utils/session-stubs.js";
|
||||
@@ -282,7 +281,6 @@ function buildAgentManagerSpies() {
|
||||
steerOrReplaceActiveTurn: async () => ({ status: "inactive" as const }),
|
||||
tryRunOutOfBand: vi.fn().mockReturnValue(false),
|
||||
subscribe: vi.fn().mockReturnValue(() => {}),
|
||||
onStop: () => () => {},
|
||||
streamAgent: vi.fn(
|
||||
(agentId: string, _prompt: unknown, _options: unknown, start?: ForegroundPromptStart) => {
|
||||
const runs = new AgentRunState();
|
||||
@@ -639,9 +637,6 @@ class BoundaryAgentManagerFake {
|
||||
subscribe() {
|
||||
return () => {};
|
||||
}
|
||||
onStop() {
|
||||
return () => {};
|
||||
}
|
||||
hasPendingPermissions() {
|
||||
return false;
|
||||
}
|
||||
@@ -3502,8 +3497,6 @@ class HeldTurnAgentSession implements AgentSession {
|
||||
private readonly permissions = new Map<string, AgentPermissionRequest>();
|
||||
private activeTurnId: string | null = null;
|
||||
private turnStartGate: Promise<void> | null = null;
|
||||
private cancelHeldStart: (() => void) | null = null;
|
||||
private interruptGate: Promise<void> | null = null;
|
||||
private nextStartError: Error | null = null;
|
||||
|
||||
constructor(
|
||||
@@ -3521,15 +3514,6 @@ class HeldTurnAgentSession implements AgentSession {
|
||||
return release;
|
||||
}
|
||||
|
||||
/** Hold the next interrupt, as a provider that takes a moment to stop does. */
|
||||
holdInterrupt(): () => void {
|
||||
let release!: () => void;
|
||||
this.interruptGate = new Promise((resolve) => {
|
||||
release = resolve;
|
||||
});
|
||||
return release;
|
||||
}
|
||||
|
||||
async run(): Promise<AgentRunResult> {
|
||||
return { sessionId: this.id, finalText: "", timeline: [] };
|
||||
}
|
||||
@@ -3552,19 +3536,7 @@ class HeldTurnAgentSession implements AgentSession {
|
||||
|
||||
async startTurn(prompt: AgentPromptInput): Promise<{ turnId: string }> {
|
||||
this.prompts.push(typeof prompt === "string" ? prompt : JSON.stringify(prompt));
|
||||
if (this.turnStartGate) {
|
||||
// An interrupt that arrives before the acknowledgment cancels the start.
|
||||
const canceled = new Promise<"canceled">((resolve) => {
|
||||
this.cancelHeldStart = () => resolve("canceled");
|
||||
});
|
||||
const outcome = await Promise.race([this.turnStartGate, canceled]);
|
||||
this.cancelHeldStart = null;
|
||||
if (outcome === "canceled") {
|
||||
// The hold belonged to the start that was canceled.
|
||||
this.turnStartGate = null;
|
||||
throw new AgentTurnStartCanceledError();
|
||||
}
|
||||
}
|
||||
await this.turnStartGate;
|
||||
if (this.nextStartError) {
|
||||
const error = this.nextStartError;
|
||||
this.nextStartError = null;
|
||||
@@ -3676,10 +3648,6 @@ class HeldTurnAgentSession implements AgentSession {
|
||||
}
|
||||
|
||||
async interrupt(): Promise<void> {
|
||||
const gate = this.interruptGate;
|
||||
this.interruptGate = null;
|
||||
await gate;
|
||||
this.cancelHeldStart?.();
|
||||
const turnId = this.activeTurnId;
|
||||
if (!turnId) {
|
||||
return;
|
||||
@@ -4531,369 +4499,6 @@ describe("send_agent_prompt MCP tool", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("message order for one recipient", () => {
|
||||
const logger = createTestLogger();
|
||||
const existingCwd = process.cwd();
|
||||
|
||||
/** A sending agent, a person, and a recipient whose turns end only when the test says so. */
|
||||
async function setupRecipient() {
|
||||
const workdir = await mkdtemp(join(tmpdir(), "mcp-message-order-"));
|
||||
const storage = new AgentStorage(join(workdir, "agents"), logger);
|
||||
const client = new HeldTurnAgentClient("codex", true);
|
||||
const agentManager = new AgentManager({
|
||||
clients: { codex: client },
|
||||
registry: storage,
|
||||
logger,
|
||||
});
|
||||
const sender = await agentManager.createAgent(
|
||||
{ provider: "codex", cwd: existingCwd },
|
||||
undefined,
|
||||
{ workspaceId: "wks_parent" },
|
||||
);
|
||||
const recipient = await agentManager.createAgent(
|
||||
{ provider: "codex", cwd: existingCwd },
|
||||
undefined,
|
||||
{ workspaceId: "wks_parent" },
|
||||
);
|
||||
const session = client.sessions[1]!;
|
||||
|
||||
const timers: Array<{ at: number; callback: () => void }> = [];
|
||||
let now = 0;
|
||||
const base = {
|
||||
agentManager,
|
||||
agentStorage: storage,
|
||||
providerSnapshotManager: createOpenCodeManager().manager,
|
||||
logger,
|
||||
};
|
||||
const agentServer = await createAgentMcpServer(
|
||||
{ ...base, callerAgentId: sender.id },
|
||||
undefined,
|
||||
(delayMs, callback) => {
|
||||
const timer = { at: now + delayMs, callback };
|
||||
timers.push(timer);
|
||||
return () => {
|
||||
const index = timers.indexOf(timer);
|
||||
if (index >= 0) timers.splice(index, 1);
|
||||
};
|
||||
},
|
||||
);
|
||||
const delivery = serverDeliveries.get(agentServer)!;
|
||||
let personPromptsAdmitted = 0;
|
||||
// A person reaches the same daemon queue through a server with no caller agent.
|
||||
const personServer = await createAgentMcpServer({
|
||||
...base,
|
||||
agentMessages: () => ({
|
||||
...delivery,
|
||||
sendDirect(direct, send) {
|
||||
const sending = delivery.sendDirect(direct, send);
|
||||
personPromptsAdmitted++;
|
||||
return sending;
|
||||
},
|
||||
}),
|
||||
});
|
||||
const agentSend = registeredTool(agentServer, "send_agent_prompt");
|
||||
const personSend = registeredTool(personServer, "send_agent_prompt");
|
||||
|
||||
function advance(ms: number): void {
|
||||
const end = now + ms;
|
||||
for (;;) {
|
||||
const due = timers.filter((timer) => timer.at <= end).sort((a, b) => a.at - b.at)[0];
|
||||
if (!due) break;
|
||||
timers.splice(timers.indexOf(due), 1);
|
||||
now = due.at;
|
||||
due.callback();
|
||||
}
|
||||
now = end;
|
||||
}
|
||||
/** Everything the queue will deliver without a new prompt has been delivered. */
|
||||
async function settled(): Promise<void> {
|
||||
await delivery.waitForDispatch(recipient.id, new AbortController().signal);
|
||||
expect(delivery.hasPending(recipient.id)).toBe(false);
|
||||
}
|
||||
/** Resolves when the message is queued; an interrupt by default when it is dispatched. */
|
||||
function agentSends(
|
||||
prompt: string,
|
||||
activeTurnBehavior: "steer" | "interrupt" = "steer",
|
||||
awaitDispatch = activeTurnBehavior === "interrupt",
|
||||
) {
|
||||
return invokeToolWithParsedInput(
|
||||
agentSend,
|
||||
{ agentId: recipient.id, prompt, notifyOnFinish: false, activeTurnBehavior },
|
||||
awaitDispatch,
|
||||
);
|
||||
}
|
||||
|
||||
await agentSends("Original work");
|
||||
advance(2000);
|
||||
await settled();
|
||||
expect(session.prompts).toHaveLength(1);
|
||||
|
||||
return {
|
||||
recipientId: recipient.id,
|
||||
session,
|
||||
agentManager,
|
||||
advance,
|
||||
settled,
|
||||
agentSends,
|
||||
personSends: (prompt: string) =>
|
||||
invokeToolWithParsedInput(personSend, { agentId: recipient.id, prompt }),
|
||||
/** The person's prompts that have taken their place in the recipient's queue. */
|
||||
personPromptsAdmitted: () => personPromptsAdmitted,
|
||||
/** Stop reached the queue: what it holds waits for the recipient's next prompt. */
|
||||
queueIsHeld: () => !delivery.hasPending(recipient.id),
|
||||
stop: () =>
|
||||
invokeToolWithParsedInput(registeredTool(agentServer, "cancel_agent"), {
|
||||
agentId: recipient.id,
|
||||
}),
|
||||
/** Who wrote each message of a provider prompt, in the order the recipient reads them. */
|
||||
prompt: (index: number) =>
|
||||
parseAgentMessages(session.prompts[index]!)?.map((message) => ({
|
||||
from: message.source?.kind === "agent-message" ? message.source.agentId : "person",
|
||||
text: message.text,
|
||||
})),
|
||||
senderId: sender.id,
|
||||
cleanup: () => removeAgentStateDir(agentManager, storage, workdir),
|
||||
};
|
||||
}
|
||||
|
||||
it("an interrupt delivers the steer queued before it first, in the same turn", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
await recipient.agentSends("Go ahead and cut the release");
|
||||
recipient.advance(10 * 60_000);
|
||||
expect(recipient.session.prompts).toHaveLength(1);
|
||||
|
||||
await recipient.agentSends("Pause the release", "interrupt");
|
||||
|
||||
expect(recipient.prompt(1)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
{ from: recipient.senderId, text: "Pause the release" },
|
||||
]);
|
||||
// The older steer is spent: the pause turn ending starts nothing.
|
||||
recipient.session.finishTurn();
|
||||
recipient.advance(10 * 60_000);
|
||||
await recipient.settled();
|
||||
expect(recipient.session.prompts).toHaveLength(2);
|
||||
expect(recipient.agentManager.getAgent(recipient.recipientId)?.lifecycle).toBe("idle");
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("a person's prompt takes the queued steer into its own turn", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
await recipient.agentSends("Go ahead and cut the release");
|
||||
recipient.advance(2000);
|
||||
|
||||
await recipient.personSends("Pause the release");
|
||||
|
||||
expect(recipient.prompt(1)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
{ from: "person", text: "Pause the release" },
|
||||
]);
|
||||
const rows = recipient.agentManager.getTimeline(recipient.recipientId);
|
||||
expect(rows.flatMap((row) => (row.type === "user_message" ? [row.text] : []))).toEqual([
|
||||
"Pause the release",
|
||||
]);
|
||||
recipient.session.finishTurn();
|
||||
recipient.advance(10 * 60_000);
|
||||
await recipient.settled();
|
||||
expect(recipient.session.prompts).toHaveLength(2);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("Stop holds the queued steer for the recipient's next prompt", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
await recipient.agentSends("Go ahead and cut the release");
|
||||
recipient.advance(2000);
|
||||
|
||||
await recipient.stop();
|
||||
|
||||
recipient.advance(10 * 60_000);
|
||||
await recipient.settled();
|
||||
expect(recipient.session.prompts).toHaveLength(1);
|
||||
expect(recipient.agentManager.getAgent(recipient.recipientId)?.lifecycle).toBe("idle");
|
||||
|
||||
await recipient.personSends("Carry on");
|
||||
expect(recipient.prompt(1)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
{ from: "person", text: "Carry on" },
|
||||
]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("cancel_agent with no turn to stop holds nothing: a queued steer keeps its quiet window", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
recipient.session.finishTurn();
|
||||
await vi.waitFor(() =>
|
||||
expect(recipient.agentManager.getAgent(recipient.recipientId)?.lifecycle).toBe("idle"),
|
||||
);
|
||||
await recipient.agentSends("Go ahead and cut the release");
|
||||
|
||||
// Nothing is running, so there is no Stop: the tool reports that it canceled no run.
|
||||
const result = await recipient.stop();
|
||||
expect(result.structuredContent).toMatchObject({ success: false });
|
||||
|
||||
recipient.advance(2000);
|
||||
await recipient.settled();
|
||||
expect(recipient.prompt(1)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("prompts sent while the provider is still starting a turn reach it in the order sent", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
const acknowledgeStart = recipient.session.holdTurnStart();
|
||||
const interrupt = recipient.agentSends("Check the logs", "interrupt");
|
||||
await vi.waitFor(() => expect(recipient.session.prompts).toHaveLength(2));
|
||||
|
||||
// The provider has not acknowledged the interrupt's turn when these three arrive.
|
||||
await recipient.agentSends("Go ahead and cut the release");
|
||||
const person = recipient.personSends("Pause the release");
|
||||
await vi.waitFor(() => expect(recipient.personPromptsAdmitted()).toBe(1));
|
||||
await recipient.agentSends("Tests passed");
|
||||
acknowledgeStart();
|
||||
await Promise.all([interrupt, person]);
|
||||
|
||||
expect(recipient.prompt(2)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
{ from: "person", text: "Pause the release" },
|
||||
]);
|
||||
recipient.session.finishTurn();
|
||||
recipient.advance(2000);
|
||||
await recipient.settled();
|
||||
expect(recipient.session.prompts).toHaveLength(4);
|
||||
expect(recipient.prompt(3)).toEqual([{ from: recipient.senderId, text: "Tests passed" }]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("Stop during a starting turn holds the interrupt that was waiting to replace it", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
recipient.session.holdTurnStart();
|
||||
const person = recipient.personSends("Run the migration").catch(() => undefined);
|
||||
await vi.waitFor(() => expect(recipient.session.prompts).toHaveLength(2));
|
||||
// The interrupt waits for the starting turn before it can replace it.
|
||||
await recipient.agentSends("Skip the backup", "interrupt", false);
|
||||
|
||||
await recipient.stop();
|
||||
await person;
|
||||
|
||||
// The next prompt is sent after the interrupt's dispatch has ended, so a turn the
|
||||
// interrupt started on its own would show up as a prompt between the two.
|
||||
await recipient.personSends("Carry on");
|
||||
expect(recipient.session.prompts).toHaveLength(3);
|
||||
expect(recipient.prompt(2)).toEqual([
|
||||
{ from: recipient.senderId, text: "Skip the backup" },
|
||||
{ from: "person", text: "Carry on" },
|
||||
]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("a steer sent while the provider is still stopping does not release the interrupt Stop held", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
recipient.session.holdTurnStart();
|
||||
const person = recipient.personSends("Run the migration").catch(() => undefined);
|
||||
await vi.waitFor(() => expect(recipient.session.prompts).toHaveLength(2));
|
||||
await recipient.agentSends("Skip the backup", "interrupt", false);
|
||||
|
||||
const providerStops = recipient.session.holdInterrupt();
|
||||
const stopping = recipient.stop();
|
||||
await vi.waitFor(() => expect(recipient.queueIsHeld()).toBe(true));
|
||||
await recipient.agentSends("Use the staging database");
|
||||
providerStops();
|
||||
await stopping;
|
||||
await person;
|
||||
expect(recipient.session.prompts).toHaveLength(2);
|
||||
|
||||
// The interrupt from before the Stop waits for the later steer's quiet window.
|
||||
recipient.advance(2000);
|
||||
await recipient.settled();
|
||||
expect(recipient.session.prompts).toHaveLength(3);
|
||||
expect(recipient.prompt(2)).toEqual([
|
||||
{ from: recipient.senderId, text: "Skip the backup" },
|
||||
{ from: recipient.senderId, text: "Use the staging database" },
|
||||
]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("the first interrupt after Stop takes the held messages along in one turn", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
recipient.session.holdTurnStart();
|
||||
const person = recipient.personSends("Run the migration").catch(() => undefined);
|
||||
await vi.waitFor(() => expect(recipient.session.prompts).toHaveLength(2));
|
||||
// The interrupt waits for the starting turn, and the steer's closed window waits behind it.
|
||||
await recipient.agentSends("Skip the backup", "interrupt", false);
|
||||
await recipient.agentSends("Use the staging database");
|
||||
recipient.advance(2000);
|
||||
|
||||
const providerStops = recipient.session.holdInterrupt();
|
||||
const stopping = recipient.stop();
|
||||
await vi.waitFor(() => expect(recipient.queueIsHeld()).toBe(true));
|
||||
await recipient.agentSends("Stop after the schema step", "interrupt", false);
|
||||
providerStops();
|
||||
await stopping;
|
||||
await person;
|
||||
await recipient.settled();
|
||||
|
||||
expect(recipient.session.prompts).toHaveLength(3);
|
||||
expect(recipient.prompt(2)).toEqual([
|
||||
{ from: recipient.senderId, text: "Skip the backup" },
|
||||
{ from: recipient.senderId, text: "Use the staging database" },
|
||||
{ from: recipient.senderId, text: "Stop after the schema step" },
|
||||
]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("a queued steer returns to the queue when the provider rejects the person's turn", async () => {
|
||||
const recipient = await setupRecipient();
|
||||
try {
|
||||
await recipient.agentSends("Go ahead and cut the release");
|
||||
recipient.advance(2000);
|
||||
|
||||
recipient.session.rejectNextTurnStart(new Error("Provider is overloaded"));
|
||||
await expect(recipient.personSends("Pause the release")).rejects.toThrow(
|
||||
"Provider is overloaded",
|
||||
);
|
||||
expect(recipient.prompt(1)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
{ from: "person", text: "Pause the release" },
|
||||
]);
|
||||
|
||||
// The provider never took that prompt, so the steer is delivered on its own.
|
||||
recipient.advance(2000);
|
||||
await recipient.settled();
|
||||
expect(recipient.session.prompts).toHaveLength(3);
|
||||
expect(recipient.prompt(2)).toEqual([
|
||||
{ from: recipient.senderId, text: "Go ahead and cut the release" },
|
||||
]);
|
||||
} finally {
|
||||
await recipient.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("send_agent_prompt MCP tool to an OMP child", () => {
|
||||
const logger = createTestLogger();
|
||||
const existingCwd = process.cwd();
|
||||
|
||||
@@ -2522,24 +2522,6 @@ describe("Codex app-server provider", () => {
|
||||
appServer.assertNoErrors();
|
||||
});
|
||||
|
||||
test("passes a cwd override when loading a persisted Codex thread", async () => {
|
||||
const appServer = createFakeCodexAppServer();
|
||||
const provider = createProviderWithFakeAppServer(appServer);
|
||||
const cwd = "/workspace/new-directory";
|
||||
const session = await provider.resumeSession(
|
||||
{ sessionId: "saved-thread", metadata: { cwd: "/workspace/old-directory" } },
|
||||
{ cwd },
|
||||
);
|
||||
|
||||
try {
|
||||
const resume = appServer.requests().find((request) => request.method === "thread/resume");
|
||||
expect(resume?.params).toMatchObject({ threadId: "saved-thread", cwd });
|
||||
appServer.assertNoErrors();
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("reopening an agent whose timeline Paseo still holds does not read Codex history", async () => {
|
||||
const codex = createReopenableCodexAgent({
|
||||
"saved-thread": [
|
||||
@@ -6854,11 +6836,7 @@ describe("Codex app-server provider", () => {
|
||||
{ method: "thread/loaded/list", params: {} },
|
||||
{
|
||||
method: "thread/resume",
|
||||
params: {
|
||||
threadId: "archived-thread-id",
|
||||
cwd: "/tmp/codex-question-test",
|
||||
excludeTurns: true,
|
||||
},
|
||||
params: { threadId: "archived-thread-id", excludeTurns: true },
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -4524,11 +4524,7 @@ export class CodexAppServerAgentSession implements AgentSession {
|
||||
private async ensureThreadLoaded(): Promise<void> {
|
||||
if (!this.client || !this.currentThreadId) return;
|
||||
// Paseo reads history only when it replays it; the resume response needs no turns.
|
||||
const params: Record<string, unknown> = {
|
||||
threadId: this.currentThreadId,
|
||||
cwd: this.config.cwd ?? null,
|
||||
excludeTurns: true,
|
||||
};
|
||||
const params: Record<string, unknown> = { threadId: this.currentThreadId, excludeTurns: true };
|
||||
if (this.deps.customCodexConfig) {
|
||||
// Resume otherwise prefers the provider stored on the thread, including
|
||||
// the unnamespaced key emitted by earlier Paseo versions.
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
import { createServiceProxySubsystem } from "../../../service-proxy.js";
|
||||
import { WorkspaceScriptRuntimeStore } from "../../../workspace-script-runtime-store.js";
|
||||
import { createTerminalManager } from "../../../../terminal/terminal-manager.js";
|
||||
import { createTestAgentMessages } from "../../../test-utils/agent-messages.js";
|
||||
|
||||
test("bridge preserves tool failure messages and classifies invalid requests as client errors", async () => {
|
||||
const paseoHome = await mkdtemp(path.join(tmpdir(), "paseo-7045-"));
|
||||
@@ -64,12 +63,10 @@ test("bridge preserves tool failure messages and classifies invalid requests as
|
||||
spawnWorkspaceScript: unused,
|
||||
assertAutomationAllowed: unused,
|
||||
});
|
||||
const agentMessages = createTestAgentMessages({ agentManager, agentStorage, logger });
|
||||
const catalog = createPaseoToolCatalog({
|
||||
workspaceScripts,
|
||||
agentManager,
|
||||
agentStorage,
|
||||
agentMessages: () => agentMessages,
|
||||
scheduleService,
|
||||
providerSnapshotManager,
|
||||
logger,
|
||||
@@ -199,7 +196,6 @@ test("bridge preserves tool failure messages and classifies invalid requests as
|
||||
]),
|
||||
});
|
||||
} finally {
|
||||
await agentMessages.close();
|
||||
await bridge.close();
|
||||
await providerSnapshotManager.shutdown();
|
||||
await rm(paseoHome, { recursive: true, force: true });
|
||||
|
||||
@@ -1287,7 +1287,7 @@ function createToolCatalog(
|
||||
.strict();
|
||||
const commonSendAgentPromptInputSchema = {
|
||||
activeTurnBehavior: ActiveTurnBehaviorSchema.optional().describe(
|
||||
'Agent callers: "steer" (default) waits until the current turn ends; "interrupt" replaces it at once and delivers the messages queued before it first, in the same turn. Human callers: "steer" joins the turn, falling back to interrupt; default is interrupt.',
|
||||
'Agent callers: "steer" (default) waits until the current turn ends; "interrupt" replaces it. Human callers: "steer" joins the turn, falling back to interrupt; default is interrupt.',
|
||||
),
|
||||
agentId: z.string(),
|
||||
prompt: z.string(),
|
||||
@@ -1974,7 +1974,7 @@ function createToolCatalog(
|
||||
{
|
||||
title: "Send agent prompt",
|
||||
description:
|
||||
"Send a task. Agent callers receive an immediate queued receipt. The recipient reads messages in the order they were queued: a steer follows two quiet seconds and waits for the current turn to end; an interrupt replaces the turn at once and takes the messages queued before it along. A later message does not cancel an earlier one. Completion reports include the target’s last response by default. Paseo supplies caller identity.",
|
||||
"Send a task. Agent callers receive an immediate queued receipt; delivery follows after two quiet seconds per recipient and waits for the current turn to end unless interrupt is requested. Completion reports include the target’s last response by default. Paseo supplies caller identity.",
|
||||
inputSchema: sendAgentPromptInputSchema,
|
||||
outputSchema: {
|
||||
success: z.boolean(),
|
||||
@@ -2050,17 +2050,14 @@ function createToolCatalog(
|
||||
deliveryStatus: receipt.status,
|
||||
messageId: receipt.messageId,
|
||||
status: agentManager.getAgent(agentId)?.lifecycle ?? "idle",
|
||||
guidance: `${
|
||||
activeTurnBehavior === "interrupt"
|
||||
? "Queued to replace the current turn now, after the messages queued before it."
|
||||
: "Queued for delivery after two quiet seconds and the current turn ends."
|
||||
} ${notifying ? PROMPTED_AGENT_NOTIFICATION_GUIDANCE : "Provider dispatch has not occurred."}`,
|
||||
guidance: notifying
|
||||
? `Queued for delivery after two quiet seconds and the current turn ends. ${PROMPTED_AGENT_NOTIFICATION_GUIDANCE}`
|
||||
: "Queued for delivery after two quiet seconds and the current turn ends; provider dispatch has not occurred.",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const dispatch = await sendPromptToAgent({
|
||||
agentMessages: agentMessages(),
|
||||
agentManager,
|
||||
agentStorage,
|
||||
agentId,
|
||||
|
||||
@@ -1073,18 +1073,8 @@ export async function createPaseoDaemon(
|
||||
}),
|
||||
eligible: async (record) =>
|
||||
!record.workspaceId || !(await workspaceRegistry?.get(record.workspaceId))?.archivedAt,
|
||||
dispatch: (agentId, prompt) => {
|
||||
if (!wsServer) throw new Error("Daemon is not accepting agent messages");
|
||||
return sendPromptToAgent({
|
||||
agentMessages: wsServer.agentMessages,
|
||||
agentId,
|
||||
prompt,
|
||||
agentManager,
|
||||
agentStorage,
|
||||
logger,
|
||||
unarchive: false,
|
||||
});
|
||||
},
|
||||
dispatch: (agentId, prompt) =>
|
||||
sendPromptToAgent({ agentId, prompt, agentManager, agentStorage, logger, unarchive: false }),
|
||||
report: (agentId, err) => logger.error({ agentId, err }, "Agent restart recovery failed"),
|
||||
});
|
||||
await restartRecovery.prepareStartup();
|
||||
@@ -1185,12 +1175,25 @@ export async function createPaseoDaemon(
|
||||
untrustedSource: workspace.untrustedSource,
|
||||
}));
|
||||
};
|
||||
const markWorkspaceArchiving = (workspaceIds: Iterable<string>, archivingAt: string) =>
|
||||
workspaceArchiveOperations.markArchiving(workspaceIds, archivingAt);
|
||||
const clearWorkspaceArchiving = (workspaceIds: Iterable<string>) =>
|
||||
workspaceArchiveOperations.clearArchiving(workspaceIds);
|
||||
const markWorkspaceArchivingExternal = (workspaceIds: Iterable<string>, archivingAt: string) => {
|
||||
const workspaceIdList = Array.from(workspaceIds);
|
||||
for (const session of wsServer?.listSessions() ?? []) {
|
||||
session.markWorkspaceArchivingForExternalMutation(workspaceIdList, archivingAt);
|
||||
}
|
||||
};
|
||||
const clearWorkspaceArchivingExternal = (workspaceIds: Iterable<string>) => {
|
||||
const workspaceIdList = Array.from(workspaceIds);
|
||||
for (const session of wsServer?.listSessions() ?? []) {
|
||||
session.clearWorkspaceArchivingForExternalMutation(workspaceIdList);
|
||||
}
|
||||
};
|
||||
const emitWorkspaceUpdatesExternal = async (workspaceIds: Iterable<string>) => {
|
||||
await wsServer?.publishWorkspaceUpdates(workspaceIds);
|
||||
const workspaceIdList = Array.from(workspaceIds);
|
||||
await Promise.all(
|
||||
(wsServer?.listSessions() ?? []).map((session) =>
|
||||
session.emitWorkspaceUpdatesForExternalWorkspaceIds(workspaceIdList),
|
||||
),
|
||||
);
|
||||
};
|
||||
const ensureWorkspaceForCreateAndBroadcastExternal = async (
|
||||
cwd: string,
|
||||
@@ -1244,8 +1247,8 @@ export async function createPaseoDaemon(
|
||||
getAutoArchivedChangeRequestUrl: async (workspaceId) =>
|
||||
(await workspaceRegistry.get(workspaceId))?.autoArchivedChangeRequestUrl ?? null,
|
||||
archiveWorkspaceRecord: archiveWorkspaceRecordExternal,
|
||||
markWorkspaceArchiving,
|
||||
clearWorkspaceArchiving,
|
||||
markWorkspaceArchiving: markWorkspaceArchivingExternal,
|
||||
clearWorkspaceArchiving: clearWorkspaceArchivingExternal,
|
||||
emitWorkspaceUpdatesForWorkspaceIds: emitWorkspaceUpdatesExternal,
|
||||
});
|
||||
|
||||
@@ -1333,8 +1336,8 @@ export async function createPaseoDaemon(
|
||||
archiveWorkspaceRecord: (workspaceIdToArchive, archivedAt) =>
|
||||
archiveWorkspaceRecordExternal(workspaceIdToArchive, undefined, archivedAt),
|
||||
emitWorkspaceUpdatesForWorkspaceIds: emitWorkspaceUpdatesExternal,
|
||||
markWorkspaceArchiving,
|
||||
clearWorkspaceArchiving,
|
||||
markWorkspaceArchiving: markWorkspaceArchivingExternal,
|
||||
clearWorkspaceArchiving: clearWorkspaceArchivingExternal,
|
||||
killTerminalsForWorkspace: (workspaceIdToKill) =>
|
||||
killTerminalsForWorkspace({ terminalManager, sessionLogger: logger }, workspaceIdToKill),
|
||||
stopWorkspaceSetup: (workspaceIdToStop) => workspaceSetupRuntime.stop(workspaceIdToStop),
|
||||
@@ -1365,8 +1368,8 @@ export async function createPaseoDaemon(
|
||||
emit: emitExternalSessionMessage,
|
||||
emitAgentRemove: async () => undefined,
|
||||
emitWorkspaceUpdatesForWorkspaceIds: emitWorkspaceUpdatesExternal,
|
||||
markWorkspaceArchiving,
|
||||
clearWorkspaceArchiving,
|
||||
markWorkspaceArchiving: markWorkspaceArchivingExternal,
|
||||
clearWorkspaceArchiving: clearWorkspaceArchivingExternal,
|
||||
killTerminalsForWorkspace: (workspaceId) =>
|
||||
killTerminalsForWorkspace({ terminalManager, sessionLogger: logger }, workspaceId),
|
||||
logger,
|
||||
@@ -1462,8 +1465,8 @@ export async function createPaseoDaemon(
|
||||
archiveWorkspaceRecord: (workspaceIdToArchive, archivedAt) =>
|
||||
archiveWorkspaceRecordExternal(workspaceIdToArchive, undefined, archivedAt),
|
||||
emitWorkspaceUpdatesForWorkspaceIds: emitWorkspaceUpdatesExternal,
|
||||
markWorkspaceArchiving,
|
||||
clearWorkspaceArchiving,
|
||||
markWorkspaceArchiving: markWorkspaceArchivingExternal,
|
||||
clearWorkspaceArchiving: clearWorkspaceArchivingExternal,
|
||||
killTerminalsForWorkspace: (workspaceIdToKill) =>
|
||||
killTerminalsForWorkspace(
|
||||
{
|
||||
@@ -1641,8 +1644,8 @@ export async function createPaseoDaemon(
|
||||
assertWorkspaceAutomationAllowedForWorkspace(workspaceRegistry, workspaceId),
|
||||
getGlobalServicePorts: () => daemonConfigStore.readServicePorts(),
|
||||
}),
|
||||
markWorkspaceArchiving,
|
||||
clearWorkspaceArchiving,
|
||||
markWorkspaceArchiving: markWorkspaceArchivingExternal,
|
||||
clearWorkspaceArchiving: clearWorkspaceArchivingExternal,
|
||||
ensureWorkspaceForCreate: createAgentCommandDependencies.ensureWorkspaceForCreate,
|
||||
createPaseoWorktree: createAgentCommandDependencies.createPaseoWorktree,
|
||||
browserToolsEnabled: browserToolsPolicy.isEnabled(),
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
TerminalStreamOpcode,
|
||||
} from "@getpaseo/protocol/binary-frames/index";
|
||||
import { DaemonClient } from "./test-utils/daemon-client.js";
|
||||
import { createTestAgentClients } from "./test-utils/fake-agent-client.js";
|
||||
import { createTestPaseoDaemon } from "./test-utils/paseo-daemon.js";
|
||||
import { withTimeout } from "../utils/promise-timeout.js";
|
||||
import {
|
||||
@@ -1978,77 +1977,6 @@ test("public project subscriptions request updates and release their producer de
|
||||
}
|
||||
});
|
||||
|
||||
test("another session lists and receives the archiving timestamp during agent teardown", async () => {
|
||||
const teardownStarted = Promise.withResolvers<void>();
|
||||
const teardownReleased = Promise.withResolvers<void>();
|
||||
const daemon = await createTestPaseoDaemon({
|
||||
agentClients: createTestAgentClients({
|
||||
closeSession: async () => {
|
||||
teardownStarted.resolve();
|
||||
await teardownReleased.promise;
|
||||
},
|
||||
}),
|
||||
});
|
||||
const url = `ws://127.0.0.1:${daemon.port}/ws`;
|
||||
const initiator = new DaemonClient({ url });
|
||||
const observer = new DaemonClient({ url });
|
||||
const paseo = createPaseoApi(observer);
|
||||
|
||||
try {
|
||||
await Promise.all([initiator.connect(), observer.connect()]);
|
||||
const created = await initiator.createWorkspace({
|
||||
source: { kind: "directory", path: daemon.staticDir },
|
||||
});
|
||||
if (!created.workspace) throw new Error(created.error ?? "Failed to create workspace");
|
||||
const workspaceId = created.workspace.id;
|
||||
await initiator.createAgent({ provider: "codex", cwd: daemon.staticDir, workspaceId });
|
||||
|
||||
const initial = await paseo.workspaces.list({ subscribe: {} });
|
||||
expect(initial.entries.find((entry) => entry.id === workspaceId)?.archivingAt).toBeNull();
|
||||
const timestamps: Array<string | null> = [];
|
||||
initial.subscription.subscribe({
|
||||
snapshot: () => {},
|
||||
update: ({ type, payload }) => {
|
||||
if (
|
||||
type === "workspace_update" &&
|
||||
payload.kind === "upsert" &&
|
||||
payload.workspace.id === workspaceId
|
||||
) {
|
||||
timestamps.push(payload.workspace.archivingAt);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const archive = initiator.archiveWorkspace(workspaceId);
|
||||
try {
|
||||
await Promise.race([
|
||||
teardownStarted.promise,
|
||||
archive.then(() => {
|
||||
throw new Error("Archive completed before agent teardown started");
|
||||
}),
|
||||
]);
|
||||
|
||||
const initiating = await initiator.fetchWorkspaces();
|
||||
const archivingAt = initiating.entries.find((entry) => entry.id === workspaceId)?.archivingAt;
|
||||
expect(archivingAt).toEqual(expect.any(String));
|
||||
|
||||
const observed = await paseo.workspaces.list();
|
||||
expect(observed.entries.find((entry) => entry.id === workspaceId)?.archivingAt).toBe(
|
||||
archivingAt,
|
||||
);
|
||||
expect(timestamps).toContain(archivingAt);
|
||||
} finally {
|
||||
teardownReleased.resolve();
|
||||
await archive;
|
||||
}
|
||||
} finally {
|
||||
teardownReleased.resolve();
|
||||
await paseo.dispose();
|
||||
await Promise.all([initiator.close(), observer.close()]);
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
test.each([
|
||||
{ closed: false, batch: false },
|
||||
{ closed: true, batch: false },
|
||||
|
||||
@@ -506,7 +506,6 @@ export interface SessionOptions {
|
||||
getTransportBufferedAmount?: (source?: object) => number | null;
|
||||
getConnectedHostBufferedAmount?: () => number | null;
|
||||
onLifecycleIntent?: (intent: SessionLifecycleIntent) => void;
|
||||
publishWorkspaceArchiveUpdates?: (workspaceIds: Iterable<string>) => Promise<void>;
|
||||
onWorkspaceRecovered?: (workspace: PersistedWorkspaceRecord) => Promise<void>;
|
||||
publishScriptStatusUpdate?: (message: ScriptStatusUpdateMessage) => void;
|
||||
logger: pino.Logger;
|
||||
@@ -804,7 +803,6 @@ export class Session {
|
||||
| null;
|
||||
private readonly getTransportBufferedAmount: (source?: object) => number | null;
|
||||
private readonly onLifecycleIntent: ((intent: SessionLifecycleIntent) => void) | null;
|
||||
private readonly onWorkspaceArchiveUpdate: SessionOptions["publishWorkspaceArchiveUpdates"];
|
||||
private readonly onWorkspaceRecovered:
|
||||
| ((workspace: PersistedWorkspaceRecord) => Promise<void>)
|
||||
| null;
|
||||
@@ -980,7 +978,6 @@ export class Session {
|
||||
: null;
|
||||
this.getTransportBufferedAmount = getTransportBufferedAmount ?? (() => 0);
|
||||
this.onLifecycleIntent = onLifecycleIntent ?? null;
|
||||
this.onWorkspaceArchiveUpdate = options.publishWorkspaceArchiveUpdates;
|
||||
this.onWorkspaceRecovered = onWorkspaceRecovered ?? null;
|
||||
this.pushNotifications = pushNotifications;
|
||||
this.paseoHome = paseoHome;
|
||||
@@ -1311,7 +1308,8 @@ export class Session {
|
||||
archiveWorkspaceRecord: (workspaceId) => this.archiveWorkspaceRecord(workspaceId),
|
||||
emit: (message) => this.emit(message),
|
||||
emitAgentRemove: (agentId) => this.agentUpdates.removeAgent(agentId),
|
||||
emitWorkspaceUpdatesForWorkspaceIds: this.publishWorkspaceArchiveUpdates,
|
||||
emitWorkspaceUpdatesForWorkspaceIds: (workspaceIds) =>
|
||||
this.emitWorkspaceUpdatesForWorkspaceIds(workspaceIds),
|
||||
markWorkspaceArchiving: (workspaceIds, archivingAt) =>
|
||||
this.markWorkspaceArchiving(workspaceIds, archivingAt),
|
||||
clearWorkspaceArchiving: (workspaceIds) => this.clearWorkspaceArchiving(workspaceIds),
|
||||
@@ -1363,7 +1361,6 @@ export class Session {
|
||||
getGlobalServicePorts: () => this.daemonConfigStore.readServicePorts(),
|
||||
});
|
||||
this.workspaceDirectory = new WorkspaceDirectory({
|
||||
getArchivingAt: (workspaceId) => this.workspaceArchiveOperations.getArchivingAt(workspaceId),
|
||||
logger: this.sessionLogger,
|
||||
projectRegistry: this.projectRegistry,
|
||||
workspaceRegistry: this.workspaceRegistry,
|
||||
@@ -1687,11 +1684,16 @@ export class Session {
|
||||
});
|
||||
}
|
||||
|
||||
private readonly publishWorkspaceArchiveUpdates = (
|
||||
markWorkspaceArchivingForExternalMutation(
|
||||
workspaceIds: Iterable<string>,
|
||||
): Promise<void> =>
|
||||
this.onWorkspaceArchiveUpdate?.(workspaceIds) ??
|
||||
this.emitWorkspaceUpdatesForWorkspaceIds(workspaceIds);
|
||||
archivingAt: string,
|
||||
): void {
|
||||
this.markWorkspaceArchiving(workspaceIds, archivingAt);
|
||||
}
|
||||
|
||||
clearWorkspaceArchivingForExternalMutation(workspaceIds: Iterable<string>): void {
|
||||
this.clearWorkspaceArchiving(workspaceIds);
|
||||
}
|
||||
|
||||
async emitWorkspaceUpdatesForExternalWorkspaceIds(workspaceIds: Iterable<string>): Promise<void> {
|
||||
await this.emitWorkspaceUpdatesForWorkspaceIds(workspaceIds);
|
||||
@@ -1722,14 +1724,6 @@ export class Session {
|
||||
): Promise<void> {
|
||||
try {
|
||||
await this.syncWorkspaceGitObserverForWorkspace(workspace);
|
||||
if (workspace.kind !== "directory" && this.wantsEvent("checkout_status_update")) {
|
||||
// Recovery can refresh Git before this session starts observing again.
|
||||
// Publish the current status to replace any read made while archived.
|
||||
const snapshot = await this.workspaceGitService.getSnapshot(workspace.cwd, {
|
||||
includeForge: false,
|
||||
});
|
||||
this.checkoutSession.emitStatusUpdate(workspace.cwd, snapshot, { force: true });
|
||||
}
|
||||
await this.emitWorkspaceUpdateForWorkspaceId(workspace.workspaceId);
|
||||
} catch (error) {
|
||||
this.sessionLogger.warn(
|
||||
@@ -4223,12 +4217,13 @@ export class Session {
|
||||
.filter((workspace) => !workspace.archivedAt)
|
||||
.map((workspace) => workspace.workspaceId);
|
||||
|
||||
if (activeWorkspaceIds.length > 0) {
|
||||
this.markWorkspaceArchiving(activeWorkspaceIds, new Date().toISOString());
|
||||
await this.emitWorkspaceUpdatesForWorkspaceIds(activeWorkspaceIds);
|
||||
}
|
||||
|
||||
const removedWorkspaceIds: string[] = [];
|
||||
this.markWorkspaceArchiving(activeWorkspaceIds, new Date().toISOString());
|
||||
try {
|
||||
if (activeWorkspaceIds.length > 0) {
|
||||
await this.publishWorkspaceArchiveUpdates(activeWorkspaceIds);
|
||||
}
|
||||
for (const workspaceId of activeWorkspaceIds) {
|
||||
const archivedAt = new Date().toISOString();
|
||||
await archiveWorkspaceContents(
|
||||
@@ -4256,19 +4251,20 @@ export class Session {
|
||||
"Failed to clean up removed project icon",
|
||||
);
|
||||
});
|
||||
|
||||
const updateIds =
|
||||
removedWorkspaceIds.length > 0
|
||||
? removedWorkspaceIds
|
||||
: [projectWorkspaces[0]?.workspaceId ?? projectId];
|
||||
await this.emitWorkspaceUpdatesForWorkspaceIds(updateIds, { removedProjectId: projectId });
|
||||
} finally {
|
||||
this.clearWorkspaceArchiving(activeWorkspaceIds);
|
||||
if (activeWorkspaceIds.length > 0) {
|
||||
await this.publishWorkspaceArchiveUpdates(activeWorkspaceIds);
|
||||
this.clearWorkspaceArchiving(activeWorkspaceIds);
|
||||
}
|
||||
}
|
||||
|
||||
const updateIds =
|
||||
removedWorkspaceIds.length > 0
|
||||
? removedWorkspaceIds
|
||||
: [projectWorkspaces[0]?.workspaceId ?? projectId];
|
||||
await this.emitWorkspaceUpdatesForWorkspaceIds(updateIds, {
|
||||
removedProjectId: projectId,
|
||||
});
|
||||
|
||||
this.emit({
|
||||
type: "project.remove.response",
|
||||
payload: {
|
||||
@@ -4610,7 +4606,6 @@ export class Session {
|
||||
|
||||
try {
|
||||
await sendPromptToAgent({
|
||||
agentMessages: this.agentMessages,
|
||||
agentManager: this.agentManager,
|
||||
agentStorage: this.agentStorage,
|
||||
agentId,
|
||||
@@ -5840,7 +5835,8 @@ export class Session {
|
||||
archiveWorkspaceRecord: (workspaceId, archivedAt) =>
|
||||
this.archiveWorkspaceRecord(workspaceId, archivedAt),
|
||||
emit: (message) => this.emit(message),
|
||||
emitWorkspaceUpdatesForWorkspaceIds: this.publishWorkspaceArchiveUpdates,
|
||||
emitWorkspaceUpdatesForWorkspaceIds: (workspaceIds) =>
|
||||
this.emitWorkspaceUpdatesForWorkspaceIds(workspaceIds),
|
||||
markWorkspaceArchiving: (workspaceIds, archivingAt) =>
|
||||
this.markWorkspaceArchiving(workspaceIds, archivingAt),
|
||||
clearWorkspaceArchiving: (workspaceIds) => this.clearWorkspaceArchiving(workspaceIds),
|
||||
@@ -6407,11 +6403,11 @@ export class Session {
|
||||
}
|
||||
|
||||
markWorkspaceArchiving(workspaceIds: Iterable<string>, archivingAt: string): void {
|
||||
this.workspaceArchiveOperations.markArchiving(workspaceIds, archivingAt);
|
||||
this.workspaceDirectory.markArchiving(workspaceIds, archivingAt);
|
||||
}
|
||||
|
||||
clearWorkspaceArchiving(workspaceIds: Iterable<string>): void {
|
||||
this.workspaceArchiveOperations.clearArchiving(workspaceIds);
|
||||
this.workspaceDirectory.clearArchiving(workspaceIds);
|
||||
}
|
||||
|
||||
private async buildWorkspaceDescriptorMap(options: {
|
||||
@@ -8257,7 +8253,8 @@ export class Session {
|
||||
listActiveWorkspaces: () => this.listActiveWorkspaceRefs(),
|
||||
archiveWorkspaceRecord: (workspaceId, archivedAt) =>
|
||||
this.archiveWorkspaceRecord(workspaceId, archivedAt),
|
||||
emitWorkspaceUpdatesForWorkspaceIds: this.publishWorkspaceArchiveUpdates,
|
||||
emitWorkspaceUpdatesForWorkspaceIds: (workspaceIds) =>
|
||||
this.emitWorkspaceUpdatesForWorkspaceIds(workspaceIds),
|
||||
markWorkspaceArchiving: (workspaceIds, archivingAt) =>
|
||||
this.markWorkspaceArchiving(workspaceIds, archivingAt),
|
||||
clearWorkspaceArchiving: (workspaceIds) => this.clearWorkspaceArchiving(workspaceIds),
|
||||
@@ -9178,7 +9175,6 @@ export class Session {
|
||||
return;
|
||||
}
|
||||
const result = await sendPromptToAgent({
|
||||
agentMessages: this.agentMessages,
|
||||
agentManager: this.agentManager,
|
||||
agentStorage: this.agentStorage,
|
||||
agentId,
|
||||
|
||||
@@ -541,11 +541,7 @@ export class CheckoutSession {
|
||||
}
|
||||
}
|
||||
|
||||
emitStatusUpdate(
|
||||
cwd: string,
|
||||
snapshot: WorkspaceGitRuntimeSnapshot,
|
||||
options?: { force: boolean },
|
||||
): void {
|
||||
emitStatusUpdate(cwd: string, snapshot: WorkspaceGitRuntimeSnapshot): void {
|
||||
try {
|
||||
const requestId = `subscription:${cwd}`;
|
||||
const payload = {
|
||||
@@ -561,7 +557,7 @@ export class CheckoutSession {
|
||||
}),
|
||||
};
|
||||
const fingerprint = JSON.stringify(payload);
|
||||
if (!options?.force && this.statusUpdateFingerprints.get(cwd) === fingerprint) return;
|
||||
if (this.statusUpdateFingerprints.get(cwd) === fingerprint) return;
|
||||
this.statusUpdateFingerprints.set(cwd, fingerprint);
|
||||
this.host.emit({
|
||||
type: "checkout_status_update",
|
||||
|
||||
@@ -31,7 +31,6 @@ export function createTestAgentMessages(params: {
|
||||
},
|
||||
{ replayState: false },
|
||||
),
|
||||
onStop: (notify) => params.agentManager.onStop(notify),
|
||||
schedule:
|
||||
params.schedule ??
|
||||
((_delay, callback) => {
|
||||
@@ -47,7 +46,6 @@ export function createTestAgentMessages(params: {
|
||||
unarchive: request.unarchive,
|
||||
activeTurnBehavior: request.activeTurnBehavior,
|
||||
idleOnly: request.idleOnly,
|
||||
admit: request.admit,
|
||||
clearPendingPermissions: request.clearPendingPermissions,
|
||||
runOptions: { clientMessageId: request.messageIds[0] },
|
||||
});
|
||||
@@ -59,8 +57,6 @@ export function createTestAgentMessages(params: {
|
||||
);
|
||||
return result.disposition;
|
||||
},
|
||||
awaitStart: (agentId, started) =>
|
||||
waitForAgentRunStartWithTimeout(params.agentManager, agentId, started),
|
||||
onError: (error, request) =>
|
||||
params.logger.error(
|
||||
{ err: error, agentId: request.recipientId, messageIds: request.messageIds },
|
||||
|
||||
@@ -283,7 +283,6 @@ function createVoiceAssistantWebSocketServer(params: {
|
||||
const agentManager = {
|
||||
setAgentAttentionCallback() {},
|
||||
subscribe: () => () => {},
|
||||
onStop: () => () => {},
|
||||
getMetricsSnapshot: () => ({
|
||||
total: 0,
|
||||
byLifecycle: {},
|
||||
|
||||
@@ -87,7 +87,6 @@ function createServer(agentManagerOverrides?: Record<string, unknown>) {
|
||||
const pushNotifications = new RecordingPushNotificationSender();
|
||||
const agentManager = {
|
||||
subscribe: vi.fn(() => () => {}),
|
||||
onStop: () => () => {},
|
||||
setAgentAttentionCallback: vi.fn(),
|
||||
getAgent: vi.fn(() => ({ workspaceId: WORKSPACE_ID, pendingPermissions: new Map() })),
|
||||
getLastAssistantMessage: vi.fn(async () => null),
|
||||
|
||||
@@ -269,7 +269,6 @@ function createServer(options?: {
|
||||
"srv_test",
|
||||
createStub<AgentManager>({
|
||||
subscribe: vi.fn(() => () => {}),
|
||||
onStop: () => () => {},
|
||||
setAgentAttentionCallback: vi.fn(),
|
||||
getAgent: vi.fn(() => null),
|
||||
getMetricsSnapshot: vi.fn(() => ({
|
||||
|
||||
@@ -120,7 +120,6 @@ function createServer(terminalManager: TerminalManager, workspaceRegistry?: Work
|
||||
const agentManager = {
|
||||
setAgentAttentionCallback: vi.fn(),
|
||||
subscribe: vi.fn(() => () => {}),
|
||||
onStop: () => () => {},
|
||||
getAgent: vi.fn(() => null),
|
||||
getLastAssistantMessage: vi.fn(async () => null),
|
||||
getMetricsSnapshot: vi.fn(() => ({
|
||||
|
||||
@@ -755,7 +755,6 @@ export class VoiceAssistantWebSocketServer {
|
||||
},
|
||||
{ replayState: false },
|
||||
),
|
||||
onStop: (notify) => agentManager.onStop(notify),
|
||||
dispatch: async (batch) => {
|
||||
const dispatch = await sendPreparedPromptToAgent({
|
||||
agentManager,
|
||||
@@ -775,8 +774,6 @@ export class VoiceAssistantWebSocketServer {
|
||||
await waitForAgentRunStartWithTimeout(agentManager, batch.recipientId, dispatch.started);
|
||||
return dispatch.disposition;
|
||||
},
|
||||
awaitStart: (agentId, started) =>
|
||||
waitForAgentRunStartWithTimeout(agentManager, agentId, started),
|
||||
onError: (err, batch) =>
|
||||
this.logger.error(
|
||||
{ err, agentId: batch.recipientId, messageIds: batch.messageIds },
|
||||
@@ -1089,19 +1086,6 @@ export class VoiceAssistantWebSocketServer {
|
||||
);
|
||||
}
|
||||
|
||||
public async publishWorkspaceUpdates(workspaceIds: Iterable<string>): Promise<void> {
|
||||
const ids = Array.from(workspaceIds);
|
||||
await Promise.all(
|
||||
this.listSessions().map(async (session) => {
|
||||
try {
|
||||
await session.emitWorkspaceUpdatesForExternalWorkspaceIds(ids);
|
||||
} catch (error) {
|
||||
this.logger.warn({ err: error }, "Failed to publish workspace updates");
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public publishProjectUpdate(update: ProjectUpdate): void {
|
||||
for (const session of this.listSessions()) {
|
||||
void session
|
||||
@@ -1705,7 +1689,6 @@ export class VoiceAssistantWebSocketServer {
|
||||
getTransportBufferedAmount: options.getTransportBufferedAmount,
|
||||
onLifecycleIntent: options.onLifecycleIntent,
|
||||
logger: options.connectionLogger.child({ module: "session" }),
|
||||
publishWorkspaceArchiveUpdates: (workspaceIds) => this.publishWorkspaceUpdates(workspaceIds),
|
||||
onWorkspaceRecovered: async (workspace) => {
|
||||
await Promise.all(
|
||||
this.listSessions().map((activeSession) =>
|
||||
|
||||
@@ -48,30 +48,6 @@ export class WorkspaceArchiveOperations {
|
||||
private readonly lanes = new Map<string, LaneEntry>();
|
||||
private readonly checkoutGates = new Map<string, Promise<void>>();
|
||||
|
||||
// Project removal can overlap a checkout-scoped archive of the same workspace.
|
||||
private readonly archiving = new Map<string, { startedAt: string; count: number }>();
|
||||
|
||||
getArchivingAt(workspaceId: string): string | null {
|
||||
return this.archiving.get(workspaceId)?.startedAt ?? null;
|
||||
}
|
||||
|
||||
markArchiving(workspaceIds: Iterable<string>, startedAt: string): void {
|
||||
for (const id of workspaceIds) {
|
||||
const current = this.archiving.get(id);
|
||||
if (current) current.count += 1;
|
||||
else this.archiving.set(id, { startedAt, count: 1 });
|
||||
}
|
||||
}
|
||||
|
||||
clearArchiving(workspaceIds: Iterable<string>): void {
|
||||
for (const id of workspaceIds) {
|
||||
const current = this.archiving.get(id);
|
||||
if (!current) continue;
|
||||
current.count -= 1;
|
||||
if (current.count === 0) this.archiving.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
archive(
|
||||
workspaceId: string,
|
||||
run: (signal: AbortSignal) => Promise<ArchiveResult>,
|
||||
|
||||
@@ -250,17 +250,6 @@ test("existing branch changes remain visible after archive and restore", async (
|
||||
commitFile(repoDir, "feature.txt", "feature change\n");
|
||||
runGit(repoDir, "switch", "main");
|
||||
await client.connect();
|
||||
const events = client.observeEvents(["checkout_status_update"]);
|
||||
const updates: { cwd: string; isGit: boolean; baseRef: string | null }[] = [];
|
||||
events.subscribe({
|
||||
snapshot: () => {},
|
||||
update: (message) => {
|
||||
if (message.type === "checkout_status_update") {
|
||||
updates.push(message.payload);
|
||||
}
|
||||
},
|
||||
});
|
||||
await events.ready;
|
||||
const created = await client.createWorkspace({
|
||||
source: {
|
||||
kind: "worktree",
|
||||
@@ -277,16 +266,9 @@ test("existing branch changes remain visible after archive and restore", async (
|
||||
expect(before.error).toBeNull();
|
||||
expect(before.files.map((file) => file.path)).toEqual(["feature.txt"]);
|
||||
expect((await client.getCheckoutStatus(cwd)).baseRef).toBe("main");
|
||||
const gitStatus = { cwd, isGit: true, baseRef: "main" };
|
||||
await client.checkoutRefresh(cwd);
|
||||
expect(updates).toContainEqual(expect.objectContaining(gitStatus));
|
||||
expect((await client.archiveWorkspace(workspace.id)).error).toBeNull();
|
||||
expect(existsSync(cwd)).toBe(false);
|
||||
await client.checkoutRefresh(cwd);
|
||||
expect((await client.getCheckoutStatus(cwd)).isGit).toBe(false);
|
||||
updates.length = 0;
|
||||
await client.restoreWorkspace(workspace.id);
|
||||
expect(updates).toContainEqual(expect.objectContaining(gitStatus));
|
||||
expect(runGit(cwd, "rev-parse", "HEAD")).toBe(head);
|
||||
expect((await client.getCheckoutStatus(cwd)).baseRef).toBe("main");
|
||||
const after = await client.getCheckoutDiff(cwd, { mode: "base" });
|
||||
|
||||
@@ -79,7 +79,6 @@ class WorkspaceStatus {
|
||||
activity: TerminalActivity | null;
|
||||
}> = [];
|
||||
private readonly directory = new WorkspaceDirectory({
|
||||
getArchivingAt: () => null,
|
||||
logger: createTestLogger(),
|
||||
projectRegistry: { list: async () => [this.project] },
|
||||
workspaceRegistry: {
|
||||
@@ -633,7 +632,6 @@ describe("WorkspaceDirectory empty projects", () => {
|
||||
workspaces: PersistedWorkspaceRecord[];
|
||||
}): WorkspaceDirectory {
|
||||
return new WorkspaceDirectory({
|
||||
getArchivingAt: () => null,
|
||||
logger: createTestLogger(),
|
||||
projectRegistry: { list: async () => input.projects },
|
||||
workspaceRegistry: {
|
||||
@@ -795,7 +793,6 @@ test("Git observation targets exclude archived records without hydrating app des
|
||||
throw new Error("Watcher reconciliation hydrated app data");
|
||||
};
|
||||
const directory = new WorkspaceDirectory({
|
||||
getArchivingAt: () => null,
|
||||
logger: createTestLogger(),
|
||||
projectRegistry: { list: async () => [project("active"), project("archived", NOW)] },
|
||||
workspaceRegistry: {
|
||||
@@ -967,7 +964,6 @@ test("scoped descriptor builds allocate independently of archived history", asyn
|
||||
isStoredProviderAvailable: () => true,
|
||||
});
|
||||
const directory = new WorkspaceDirectory({
|
||||
getArchivingAt: () => null,
|
||||
logger,
|
||||
workspaceRegistry: registry,
|
||||
projectRegistry: {
|
||||
|
||||
@@ -78,7 +78,6 @@ export interface WorkspaceDirectoryDeps {
|
||||
listActive(): Promise<PersistedWorkspaceRecord[]>;
|
||||
get(id: string): Promise<PersistedWorkspaceRecord | null>;
|
||||
};
|
||||
getArchivingAt(workspaceId: string): string | null;
|
||||
listAgentPayloads(workspaceIds?: Iterable<string>): Promise<AgentSnapshotPayload[]>;
|
||||
workspaceLastUserMessageTimes(
|
||||
workspaceIds?: Iterable<string>,
|
||||
@@ -172,6 +171,7 @@ function activeWorkspaceRecords(
|
||||
}
|
||||
|
||||
export class WorkspaceDirectory {
|
||||
private readonly archivingByWorkspaceId = new Map<string, string>();
|
||||
/**
|
||||
* Per-workspace last-seen winning bucket + entered-at. Persists across
|
||||
* `buildDescriptorMap` calls inside the daemon process; reset on cold start.
|
||||
@@ -205,6 +205,18 @@ export class WorkspaceDirectory {
|
||||
|
||||
constructor(private readonly deps: WorkspaceDirectoryDeps) {}
|
||||
|
||||
markArchiving(workspaceIds: Iterable<string>, archivingAt: string): void {
|
||||
for (const workspaceId of workspaceIds) {
|
||||
this.archivingByWorkspaceId.set(workspaceId, archivingAt);
|
||||
}
|
||||
}
|
||||
|
||||
clearArchiving(workspaceIds: Iterable<string>): void {
|
||||
for (const workspaceId of workspaceIds) {
|
||||
this.archivingByWorkspaceId.delete(workspaceId);
|
||||
}
|
||||
}
|
||||
|
||||
async buildDescriptorMap(options: {
|
||||
includeGitData: boolean;
|
||||
workspaceIds?: Iterable<string>;
|
||||
@@ -261,7 +273,7 @@ export class WorkspaceDirectory {
|
||||
...workspaceDescriptors[i],
|
||||
createdAt: includedWorkspaces[i].createdAt,
|
||||
lastUserMessageAt: lastUserMessageTimes.get(workspaceId) ?? null,
|
||||
archivingAt: this.deps.getArchivingAt(workspaceId),
|
||||
archivingAt: this.archivingByWorkspaceId.get(workspaceId) ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
import copy from "../src/i18n/resources/en.json" with { type: "json" };
|
||||
import { expect, test, waitForHydration, type Page } from "./fixtures";
|
||||
|
||||
async function openHub(page: Page, width = 1024) {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
await page.goto("/hub");
|
||||
await expect(page.getByRole("heading", { name: "Paseo Hub", level: 1 })).toBeVisible();
|
||||
}
|
||||
|
||||
async function tabIntoNextPreview(page: Page) {
|
||||
await waitForHydration(page);
|
||||
await page.getByRole("tab", { name: /^Slack/ }).focus();
|
||||
await page.keyboard.press("ArrowRight");
|
||||
await page.keyboard.press("Tab");
|
||||
}
|
||||
|
||||
async function readPreviewOnFocus(page: Page) {
|
||||
return page.getByRole("tabpanel").evaluateHandle((panel) => {
|
||||
const atFocus = { label: "" };
|
||||
panel.addEventListener(
|
||||
"focus",
|
||||
() => {
|
||||
atFocus.label = panel.querySelector('[role="img"]')?.getAttribute("aria-label") ?? "";
|
||||
},
|
||||
{ once: true },
|
||||
);
|
||||
return atFocus;
|
||||
});
|
||||
}
|
||||
|
||||
async function useLargerText(page: Page, size = "125%") {
|
||||
await page.addStyleTag({ content: `html { font-size: ${size}; }` });
|
||||
}
|
||||
|
||||
async function expectSourceLabelFits(page: Page, name: string, text = name) {
|
||||
const label = page.getByRole("tab", { name }).getByText(text, { exact: true });
|
||||
await expect(label).toBeVisible();
|
||||
expect(await label.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||
}
|
||||
|
||||
async function expectPreviewRowsFit(page: Page, source: string, ...rows: string[]) {
|
||||
const name = new RegExp(`^${source}`);
|
||||
await page.getByRole("tab", { name }).click();
|
||||
const preview = page.getByRole("tabpanel", { name });
|
||||
await preview.scrollIntoViewIfNeeded();
|
||||
for (const row of rows) {
|
||||
const text = preview.getByText(row, { exact: true }).filter({ visible: true });
|
||||
await expect(text.first()).toBeVisible();
|
||||
for (const match of await text.all()) {
|
||||
await expect
|
||||
.poll(() =>
|
||||
match.evaluate((element) => {
|
||||
const frame = element.closest('[role="img"]')!.getBoundingClientRect();
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(element);
|
||||
return Array.from(range.getClientRects()).every(
|
||||
(rect) =>
|
||||
rect.left >= frame.left - 1 &&
|
||||
rect.right <= frame.right + 1 &&
|
||||
rect.top >= frame.top - 1 &&
|
||||
rect.bottom <= frame.bottom + 1,
|
||||
);
|
||||
}),
|
||||
)
|
||||
.toBe(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function focusProSeatHelp(page: Page) {
|
||||
const pro = page
|
||||
.getByRole("article")
|
||||
.filter({ has: page.getByRole("heading", { name: "Pro", exact: true }) });
|
||||
const help = pro.getByLabel(/^Seats are Hub members/).locator("..");
|
||||
await help.scrollIntoViewIfNeeded();
|
||||
await help.focus();
|
||||
return pro.getByRole("tooltip");
|
||||
}
|
||||
|
||||
test("Hub fits a viewport narrower than its page frame", async ({ page }) => {
|
||||
await openHub(page);
|
||||
const { contentWidth, viewportWidth } = await page.evaluate(() => ({
|
||||
contentWidth: document.documentElement.scrollWidth,
|
||||
viewportWidth: document.documentElement.clientWidth,
|
||||
}));
|
||||
expect(contentWidth).toBeLessThanOrEqual(viewportWidth);
|
||||
});
|
||||
|
||||
for (const width of [320, 768, 1024]) {
|
||||
test(`the complete Pro seat explanation is visible on keyboard focus at ${width}px`, async ({
|
||||
page,
|
||||
}) => {
|
||||
test.skip(Boolean(process.env.WEBSITE_TEST_URL), "Requires the Hub plans fixture");
|
||||
await openHub(page, width);
|
||||
const tooltip = await focusProSeatHelp(page);
|
||||
await expect(tooltip).toContainText("do not count as seats");
|
||||
await expect(tooltip).toBeInViewport({ ratio: 1 });
|
||||
});
|
||||
}
|
||||
|
||||
test("the Slack starter forwards the mention and declares a thread reply", async ({ page }) => {
|
||||
await openHub(page);
|
||||
const starter = page.locator("pre").filter({ hasText: "name: slack-help" });
|
||||
await expect(starter).toContainText("${{ paseo.prompt }}");
|
||||
await expect(starter).toContainText("hub.reply");
|
||||
await expect(starter).toContainText("slack.reply:");
|
||||
});
|
||||
|
||||
test("keyboard focus enters the selected preview with its current content", async ({ page }) => {
|
||||
await openHub(page);
|
||||
const atFocus = await readPreviewOnFocus(page);
|
||||
await tabIntoNextPreview(page);
|
||||
await expect(page.getByRole("tabpanel", { name: /^GitHub/ })).toBeFocused();
|
||||
expect((await atFocus.jsonValue()).label).toMatch(/^GitHub issue/);
|
||||
});
|
||||
|
||||
test("source names fit on a narrow phone", async ({ page }) => {
|
||||
await openHub(page, 320);
|
||||
await expectSourceLabelFits(page, "Schedules");
|
||||
await expectSourceLabelFits(page, "Webhooks");
|
||||
});
|
||||
|
||||
test("source names remain readable with larger text on a phone", async ({ page }) => {
|
||||
await openHub(page, 375);
|
||||
await useLargerText(page);
|
||||
for (const name of ["GitHub", "Discord", "Schedules", "Webhooks"]) {
|
||||
await expectSourceLabelFits(page, name);
|
||||
}
|
||||
});
|
||||
|
||||
test("desktop source descriptions fit with larger text", async ({ page }) => {
|
||||
await openHub(page, 1280);
|
||||
await useLargerText(page);
|
||||
for (const { name, description } of Object.values(copy.hub.sources)) {
|
||||
await expectSourceLabelFits(page, name, description);
|
||||
}
|
||||
});
|
||||
|
||||
test("Hub previews have room for their final rows with larger text", async ({ page }) => {
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await openHub(page, 1280);
|
||||
await useLargerText(page);
|
||||
await waitForHydration(page);
|
||||
await expectPreviewRowsFit(page, "GitHub", "Open in Paseo");
|
||||
await expectPreviewRowsFit(page, "Discord", "Message #engineering");
|
||||
});
|
||||
|
||||
test("preview results fit on a narrow phone with larger text", async ({ page }) => {
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await openHub(page, 320);
|
||||
await useLargerText(page);
|
||||
await waitForHydration(page);
|
||||
await expectPreviewRowsFit(page, "Discord", "Fix stale worktrees", "getpaseo/paseo#2825");
|
||||
await expectPreviewRowsFit(page, "Schedules", "tests passed");
|
||||
});
|
||||
|
||||
test("Hub previews keep their rows visible with twice the default font size", async ({ page }) => {
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await openHub(page, 320);
|
||||
await useLargerText(page, "200%");
|
||||
await waitForHydration(page);
|
||||
await expectPreviewRowsFit(page, "Slack", "Open in Paseo");
|
||||
await expectPreviewRowsFit(page, "Linear", "PAS-418");
|
||||
await expectPreviewRowsFit(page, "Discord", "tests passed", "Message #engineering");
|
||||
});
|
||||
@@ -149,7 +149,7 @@ test("the opening scene waits until most of the mockup is on screen", async ({ p
|
||||
});
|
||||
|
||||
test("the opening scene starts in a window shorter than most of the mockup", async ({ page }) => {
|
||||
await openHomepage(page, { width: 1400, height: 320 });
|
||||
await openHomepage(page, { width: 1400, height: 400 });
|
||||
const mockup = page.getByRole("img", { name: desktopName, exact: true });
|
||||
const request = mockup.getByText("Fix the issues labeled ready, one worktree each.");
|
||||
await mockup.scrollIntoViewIfNeeded();
|
||||
|
||||
@@ -586,7 +586,6 @@ test.describe("registry fixture layout", () => {
|
||||
] as const) {
|
||||
await page.setViewportSize({ width, height: 720 });
|
||||
await page.goto("/plugins/omercnet/dracula");
|
||||
await expectPageWithinViewport(page);
|
||||
const three = page.getByRole("link", { name: /^Dracula (screenshot|video) \d$/ });
|
||||
const shares = await three.evaluateAll(visibleShares);
|
||||
expect(shares.map((share) => (share > 0.1 && share < 0.5 ? "peeks" : share))).toEqual(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createServer } from "node:http";
|
||||
import registry from "./registry.fixture.json" with { type: "json" };
|
||||
import hubPlans from "../src/hub-plans.fixture.json" with { type: "json" };
|
||||
|
||||
import securityPlugin from "./overview.fixture.json" with { type: "json" };
|
||||
|
||||
@@ -14,10 +13,6 @@ securityPlugin.readme +=
|
||||
// Serve the published registry contract so SSR and browser navigation use the same data.
|
||||
createServer((request, response) => {
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
if (request.url === "/hub-plans") {
|
||||
response.end(JSON.stringify(hubPlans));
|
||||
return;
|
||||
}
|
||||
if (request.url === "/index.json") {
|
||||
response.end(JSON.stringify(registry));
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.0-beta.1",
|
||||
"version": "0.17.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -15,7 +15,6 @@
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
"@fontsource-variable/geist": "^5.3.0",
|
||||
"@fontsource-variable/plus-jakarta-sans": "^5.3.0",
|
||||
"@getpaseo/protocol": "*",
|
||||
"@tanstack/react-router": "^1.170.16",
|
||||
"@tanstack/react-start": "^1.168.26",
|
||||
|
||||
@@ -31,7 +31,6 @@ export default defineConfig({
|
||||
),
|
||||
CLOUDFLARE_INCLUDE_PROCESS_ENV: "true",
|
||||
PLUGINS_REGISTRY_URL: "http://127.0.0.1:8188",
|
||||
VITE_HUB_PLANS_URL: "http://127.0.0.1:8188/hub-plans",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { useLoaderData } from "@tanstack/react-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { LandingPage } from "~/components/landing-page";
|
||||
import { type AgentPageSlug, getAgentPage } from "~/data/agent-pages";
|
||||
import { getTranslator, routeLocale } from "~/i18n";
|
||||
import { pageMeta } from "~/meta";
|
||||
import { getPluginCount } from "~/plugins";
|
||||
|
||||
export function agentRouteOptions(slug: AgentPageSlug) {
|
||||
return {
|
||||
@@ -18,18 +16,10 @@ export function agentRouteOptions(slug: AgentPageSlug) {
|
||||
locale,
|
||||
});
|
||||
},
|
||||
loader: async () => ({ pluginCount: await getPluginCount() }),
|
||||
component: function AgentLandingPage() {
|
||||
const { t } = useTranslation();
|
||||
const data = useLoaderData({ strict: false }) as { pluginCount?: number | null } | undefined;
|
||||
const page = getAgentPage(slug, t);
|
||||
return (
|
||||
<LandingPage
|
||||
title={page.title}
|
||||
subtitle={page.subtitle}
|
||||
pluginCount={data?.pluginCount ?? null}
|
||||
/>
|
||||
);
|
||||
return <LandingPage title={page.title} subtitle={page.subtitle} />;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,20 +45,6 @@ export function SlackIcon(props: React.SVGProps<SVGSVGElement>) {
|
||||
);
|
||||
}
|
||||
|
||||
export function LinearIcon(props: React.SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
{...props}
|
||||
>
|
||||
<path d="M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
export function OpenCollectiveIcon(props: React.SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg
|
||||
|
||||
@@ -2,25 +2,15 @@ import type { ReactNode } from "react";
|
||||
|
||||
export function FAQItem({ question, children }: { question: string; children: ReactNode }) {
|
||||
return (
|
||||
<details className="group py-5 first:pt-4 last:pb-4">
|
||||
<summary className="flex cursor-pointer list-none items-baseline justify-between gap-6 text-[15px] font-medium text-white/90 transition-colors hover:text-white">
|
||||
<span>{question}</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="shrink-0 font-mono text-base leading-none text-white/40 transition-colors group-hover:text-white/70 group-open:hidden"
|
||||
>
|
||||
+
|
||||
</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="hidden shrink-0 font-mono text-base leading-none text-accent-text group-open:inline"
|
||||
>
|
||||
<details className="group">
|
||||
<summary className="font-medium text-sm cursor-pointer list-none grid grid-cols-[1.25rem_1fr] items-baseline">
|
||||
<span className="font-mono text-lg leading-none text-white/40 group-open:hidden">+</span>
|
||||
<span className="font-mono text-lg leading-none text-white/40 hidden group-open:inline">
|
||||
−
|
||||
</span>
|
||||
{question}
|
||||
</summary>
|
||||
<div className="prose mt-3 max-w-2xl space-y-2.5 text-sm leading-relaxed text-muted-foreground">
|
||||
{children}
|
||||
</div>
|
||||
<div className="text-sm text-muted-foreground space-y-2 mt-2 pl-5 prose">{children}</div>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,254 +0,0 @@
|
||||
import { Check, CornerDownRight, GitPullRequest, Hash, PlusCircle } from "lucide-react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { DiscordIcon } from "~/components/brand-icons";
|
||||
import {
|
||||
MoAvatar,
|
||||
MockupStageWindow,
|
||||
MockupStep,
|
||||
OpenInPaseoChip,
|
||||
PaseoBotAvatar,
|
||||
type SourceMockupProps,
|
||||
WindowTrafficLights,
|
||||
} from "./shared";
|
||||
|
||||
const DISCORD_CHANNELS = ["general", "engineering", "bugs", "releases"] as const;
|
||||
|
||||
const STEP_DELAYS = {
|
||||
userMention: 0.06,
|
||||
threadStart: 0.55,
|
||||
botWorking: 1.05,
|
||||
botDone: 1.7,
|
||||
} as const;
|
||||
|
||||
const DISCORD_COMPONENTS = {
|
||||
mention: (
|
||||
<span className="rounded-[3px] bg-[#5865F2]/30 px-1 py-[0.5px] font-medium text-[#C9CDFB]">
|
||||
@paseo-bot
|
||||
</span>
|
||||
),
|
||||
host: (
|
||||
<span className="rounded-[3px] bg-[#1E1F22] px-1.5 py-[1px] font-mono text-[11px] text-[#DBDEE1]" />
|
||||
),
|
||||
issue: <span className="font-mono text-[12px] text-[#00A8FC]">#2799</span>,
|
||||
};
|
||||
|
||||
export function DiscordSourceMockup({ active, reduceMotion }: SourceMockupProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MockupStageWindow
|
||||
ariaLabel={t("hub.demo.discord.alt")}
|
||||
active={active}
|
||||
reduceMotion={reduceMotion}
|
||||
className="border-[#3F4147] bg-[#313338]"
|
||||
>
|
||||
<DiscordChrome />
|
||||
|
||||
<div className="grid min-h-0 flex-1 grid-cols-1 md:grid-cols-[164px_minmax(0,1fr)]">
|
||||
<DiscordSidebar />
|
||||
<div className="flex min-h-0 min-w-0 flex-col bg-[#313338]">
|
||||
<DiscordChannelHeader />
|
||||
<DiscordMessageFeed />
|
||||
<DiscordComposer />
|
||||
</div>
|
||||
</div>
|
||||
</MockupStageWindow>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordMessageFeed() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex-1 space-y-3 px-4 py-3">
|
||||
<MockupStep delay={STEP_DELAYS.userMention}>
|
||||
<DiscordMessage author="mo" time={t("hub.demo.discord.time1")}>
|
||||
<p>
|
||||
<Trans i18nKey="hub.demo.discord.userPrompt" components={DISCORD_COMPONENTS} />
|
||||
</p>
|
||||
</DiscordMessage>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.threadStart}
|
||||
className="flex items-start gap-2 pl-2 text-[11.5px] text-[#949BA4]"
|
||||
>
|
||||
<CornerDownRight className="h-3.5 w-3.5 shrink-0 text-[#949BA4]" aria-hidden="true" />
|
||||
<p>
|
||||
<span className="font-medium text-[#F2F3F5]">paseo-bot</span>{" "}
|
||||
{t("hub.demo.discord.startedThread")}{" "}
|
||||
<span className="font-semibold text-[#F2F3F5]">{t("hub.demo.discord.threadTitle")}</span>
|
||||
</p>
|
||||
</MockupStep>
|
||||
|
||||
<div className="ml-3 space-y-3 border-l-2 border-[#4E5058] pl-3.5">
|
||||
<MockupStep delay={STEP_DELAYS.botWorking}>
|
||||
<DiscordMessage author="paseo-bot" time={t("hub.demo.discord.time1")} bot>
|
||||
<p className="text-[#DBDEE1]">
|
||||
<Trans i18nKey="hub.demo.discord.botStarted" components={DISCORD_COMPONENTS} />
|
||||
</p>
|
||||
</DiscordMessage>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep delay={STEP_DELAYS.botDone}>
|
||||
<DiscordMessage author="paseo-bot" time={t("hub.demo.discord.time2")} bot>
|
||||
<p className="text-[#DBDEE1]">{t("hub.demo.discord.botFinished")}</p>
|
||||
<DiscordPrEmbed />
|
||||
</DiscordMessage>
|
||||
</MockupStep>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordPrEmbed() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="mt-2 space-y-2">
|
||||
<div className="rounded-[4px] border-l-[4px] border-[#2BAC76] bg-[#2B2D31] px-3 py-2.5">
|
||||
<div className="flex items-center gap-1.5 text-[12px] font-semibold text-[#00A8FC]">
|
||||
<GitPullRequest className="h-3.5 w-3.5 shrink-0 text-[#2BAC76]" aria-hidden="true" />
|
||||
<span>getpaseo/paseo#2825</span>
|
||||
</div>
|
||||
<p className="mt-0.5 text-[12px] text-[#DBDEE1]">
|
||||
fix(worktree): prune orphaned branches on close
|
||||
</p>
|
||||
<div className="mt-2 grid grid-cols-3 gap-2 text-[11px] @max-[14rem]:grid-cols-1">
|
||||
<div>
|
||||
<p className="font-semibold text-[#B5BAC1]">{t("hub.demo.discord.fieldHost")}</p>
|
||||
<p className="font-mono text-[#DBDEE1]">devbox</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-semibold text-[#B5BAC1]">{t("hub.demo.discord.fieldDiff")}</p>
|
||||
<p className="font-mono text-[#DBDEE1]">+46 -12</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-semibold text-[#B5BAC1]">{t("hub.demo.discord.fieldChecks")}</p>
|
||||
<p className="inline-flex items-center gap-1 text-[#57F287]">
|
||||
<Check className="h-3 w-3" aria-hidden="true" />
|
||||
{t("hub.demo.shared.testsPassed")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<OpenInPaseoChip variant="discord" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordComposer() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="mx-4 mt-auto mb-3 flex items-center gap-2.5 rounded-[8px] bg-[#383A40] px-3 py-2 text-[12.5px] text-[#80848E] @max-[14rem]:mx-2 @max-[14rem]:px-2"
|
||||
>
|
||||
<PlusCircle className="h-4 w-4 shrink-0 text-[#B5BAC1]" />
|
||||
<span className="truncate">{t("hub.demo.discord.composerPlaceholder")}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordChrome() {
|
||||
return (
|
||||
<div className="flex h-9 shrink-0 items-center justify-between border-b border-[#1E1F22] bg-[#1E1F22] px-3.5">
|
||||
<div className="flex items-center gap-3">
|
||||
<WindowTrafficLights />
|
||||
<span className="text-[12px] font-semibold text-[#B5BAC1]">Discord</span>
|
||||
</div>
|
||||
<DiscordIcon className="h-3.5 w-3.5 text-[#5865F2]" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordSidebar() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<aside
|
||||
aria-hidden="true"
|
||||
className="hidden flex-col border-r border-[#1F2023] bg-[#2B2D31] md:flex"
|
||||
>
|
||||
<div className="border-b border-[#1F2023] px-3.5 py-2.5 text-[13.5px] font-bold text-[#F2F3F5]">
|
||||
Paseo
|
||||
</div>
|
||||
<div className="space-y-0.5 px-2 py-3 text-[12.5px]">
|
||||
<p className="px-2 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-[#949BA4]">
|
||||
{t("hub.demo.discord.textChannels")}
|
||||
</p>
|
||||
{DISCORD_CHANNELS.map((channel) => (
|
||||
<div key={channel}>
|
||||
<div
|
||||
className={`flex items-center gap-1.5 rounded-[5px] px-2 py-1 ${
|
||||
channel === "engineering"
|
||||
? "bg-[#404249] font-medium text-[#F2F3F5]"
|
||||
: "text-[#949BA4]"
|
||||
}`}
|
||||
>
|
||||
<Hash className="h-3.5 w-3.5 shrink-0 opacity-75" />
|
||||
<span className="truncate">{channel}</span>
|
||||
</div>
|
||||
{channel === "engineering" ? (
|
||||
<div className="mt-0.5 ml-3 flex items-center gap-1.5 border-l border-[#4E5058] py-1 pl-2 text-[11.5px] text-[#DBDEE1]">
|
||||
<span className="truncate">{t("hub.demo.discord.threadTitle")}</span>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordChannelHeader() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex shrink-0 items-center justify-between gap-3 border-b border-[#26282C] px-4 py-2">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<Hash className="h-4 w-4 shrink-0 text-[#80848E]" aria-hidden="true" />
|
||||
<span className="text-[14px] font-semibold text-[#F2F3F5]">engineering</span>
|
||||
<span className="hidden h-3.5 w-px bg-[#3F4147] sm:inline-block" aria-hidden="true" />
|
||||
<span className="hidden truncate text-[11.5px] text-[#949BA4] sm:inline">
|
||||
{t("hub.demo.discord.channelTopic")}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiscordMessage({
|
||||
author,
|
||||
time,
|
||||
bot,
|
||||
children,
|
||||
}: {
|
||||
author: string;
|
||||
time: string;
|
||||
bot?: boolean;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex items-start gap-2.5 @max-[14rem]:flex-col @max-[14rem]:gap-1">
|
||||
{bot ? (
|
||||
<PaseoBotAvatar size="md" rounded="rounded-full" className="mt-0.5" />
|
||||
) : (
|
||||
<MoAvatar size="md" rounded="rounded-full" className="mt-0.5" />
|
||||
)}
|
||||
<div className="min-w-0 flex-1 space-y-0.5">
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="text-[13.5px] font-semibold text-[#F2F3F5]">{author}</span>
|
||||
{bot ? (
|
||||
<span className="inline-flex items-center gap-0.5 rounded-[3px] bg-[#5865F2] px-1.5 py-[1px] text-[9.5px] font-semibold uppercase tracking-wide text-white">
|
||||
<Check className="h-2.5 w-2.5" aria-hidden="true" />
|
||||
{t("hub.demo.shared.appBadge")}
|
||||
</span>
|
||||
) : null}
|
||||
<span className="text-[11px] text-[#949BA4]">{time}</span>
|
||||
</div>
|
||||
<div className="text-[13px] leading-[1.45] text-[#DBDEE1]">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
import { Check, CircleDot, GitPullRequest, Tag } from "lucide-react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { GitHubIcon } from "~/components/brand-icons";
|
||||
import {
|
||||
MoAvatar,
|
||||
MockupStageWindow,
|
||||
MockupStep,
|
||||
OpenInPaseoChip,
|
||||
PaseoBotAvatar,
|
||||
type SourceMockupProps,
|
||||
WindowTrafficLights,
|
||||
} from "./shared";
|
||||
|
||||
const STEP_DELAYS = {
|
||||
issue: 0.06,
|
||||
labelEvent: 0.55,
|
||||
botReply: 1.2,
|
||||
checks: 1.85,
|
||||
} as const;
|
||||
|
||||
const GH_COMPONENTS = {
|
||||
mention: <span className="font-semibold text-[#58A6FF]">@paseo-bot</span>,
|
||||
host: (
|
||||
<span className="rounded-[4px] border border-[#30363D] bg-[#161B22] px-1.5 py-[1px] font-mono text-[11px] text-[#E6EDF3]" />
|
||||
),
|
||||
pr: <span className="font-medium text-[#58A6FF] underline decoration-[#58A6FF]/40" />,
|
||||
code: (
|
||||
<code className="rounded-[4px] bg-[#21262D] px-1.5 py-[1px] font-mono text-[11.5px] text-[#E6EDF3]" />
|
||||
),
|
||||
};
|
||||
|
||||
const CHECK_NAMES = ["typecheck", "vitest", "lint", "build"] as const;
|
||||
|
||||
export function GitHubSourceMockup({ active, reduceMotion }: SourceMockupProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MockupStageWindow
|
||||
ariaLabel={t("hub.demo.github.alt")}
|
||||
active={active}
|
||||
reduceMotion={reduceMotion}
|
||||
className="border-[#30363D] bg-[#0D1117]"
|
||||
>
|
||||
<GitHubChrome />
|
||||
<GitHubIssueHeader />
|
||||
<div className="grid min-h-0 flex-1 grid-cols-1 sm:grid-cols-[minmax(0,1fr)_156px]">
|
||||
<GitHubTimeline />
|
||||
<GitHubSidebar />
|
||||
</div>
|
||||
</MockupStageWindow>
|
||||
);
|
||||
}
|
||||
|
||||
function GitHubTimeline() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="relative space-y-3 px-4 py-3.5">
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute top-11 bottom-6 left-[27px] w-[2px] bg-[#21262D]"
|
||||
/>
|
||||
|
||||
<MockupStep delay={STEP_DELAYS.issue} className="relative">
|
||||
<GitHubComment
|
||||
author="mo"
|
||||
badge={t("hub.demo.github.authorBadge")}
|
||||
timestamp={t("hub.demo.github.openedAgo")}
|
||||
>
|
||||
<p>
|
||||
<Trans i18nKey="hub.demo.github.issueBody" components={GH_COMPONENTS} />
|
||||
</p>
|
||||
</GitHubComment>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.labelEvent}
|
||||
className="relative flex items-center gap-2.5 pl-1"
|
||||
>
|
||||
<span className="relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-[#30363D] bg-[#161B22] text-[#8B949E]">
|
||||
<Tag className="h-3 w-3" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="flex flex-wrap items-center gap-1.5 text-[11.5px] text-[#8B949E]">
|
||||
<span className="font-semibold text-[#E6EDF3]">mo</span>
|
||||
<span>{t("hub.demo.github.addedLabel")}</span>
|
||||
<span className="rounded-full border border-[#20744A]/60 bg-[#20744A]/20 px-2 py-[1px] font-mono text-[10.5px] font-medium text-[#6CB17B]">
|
||||
paseo
|
||||
</span>
|
||||
<span>·</span>
|
||||
<span>{t("hub.demo.github.startedOn")}</span>
|
||||
</div>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep delay={STEP_DELAYS.botReply} className="relative">
|
||||
<GitHubComment
|
||||
author="paseo-bot"
|
||||
badge={t("hub.demo.github.botBadge")}
|
||||
timestamp={t("hub.demo.github.repliedAgo")}
|
||||
bot
|
||||
>
|
||||
<p>
|
||||
<Trans i18nKey="hub.demo.github.botReply" components={GH_COMPONENTS} />
|
||||
</p>
|
||||
<GitHubPrSummaryCard />
|
||||
</GitHubComment>
|
||||
</MockupStep>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function GitHubPrSummaryCard() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.checks}
|
||||
className="mt-2.5 overflow-hidden rounded-md border border-[#30363D] bg-[#0D1117]"
|
||||
>
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 border-b border-[#21262D] bg-[#161B22] px-3 py-2">
|
||||
<div className="flex min-w-0 items-center gap-1.5">
|
||||
<GitPullRequest className="h-3.5 w-3.5 shrink-0 text-[#3FB950]" aria-hidden="true" />
|
||||
<span className="text-[12px] font-semibold text-[#E6EDF3]">
|
||||
fix(terminal): drain PTY write queue under burst
|
||||
</span>
|
||||
<span className="font-mono text-[11px] text-[#8B949E]">#2819</span>
|
||||
</div>
|
||||
<span className="shrink-0 font-mono text-[11px]">
|
||||
<span className="text-[#3FB950]">+84</span> <span className="text-[#F85149]">-19</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 px-3 py-2">
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="inline-flex items-center gap-1 text-[11.5px] font-medium text-[#3FB950]">
|
||||
<Check className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
{t("hub.demo.github.checksPassed")}
|
||||
</span>
|
||||
<span className="hidden items-center gap-1 sm:inline-flex">
|
||||
{CHECK_NAMES.map((name) => (
|
||||
<span
|
||||
key={name}
|
||||
className="rounded border border-[#30363D] bg-[#161B22] px-1.5 py-[1px] font-mono text-[10px] text-[#8B949E]"
|
||||
>
|
||||
{name}
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
</div>
|
||||
<OpenInPaseoChip variant="brand" />
|
||||
</div>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function GitHubChrome() {
|
||||
return (
|
||||
<div className="flex h-9 shrink-0 items-center justify-between border-b border-[#21262D] bg-[#010409] px-3.5">
|
||||
<div className="flex items-center gap-3">
|
||||
<WindowTrafficLights />
|
||||
<div className="flex items-center gap-1.5 text-[12px] text-[#8B949E]">
|
||||
<GitHubIcon className="h-3.5 w-3.5 text-[#E6EDF3]" />
|
||||
<span>getpaseo</span>
|
||||
<span className="text-[#484F58]">/</span>
|
||||
<span className="font-semibold text-[#E6EDF3]">paseo</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="hidden items-center gap-4 text-[11.5px] text-[#8B949E] sm:flex"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<span className="relative py-2 font-medium text-[#E6EDF3]">
|
||||
Issues
|
||||
<span className="absolute right-0 -bottom-[3px] left-0 h-[2px] rounded-full bg-[#F78166]" />
|
||||
</span>
|
||||
<span>Pull requests</span>
|
||||
<span>Actions</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function GitHubIssueHeader() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="shrink-0 border-b border-[#21262D] px-4 py-3">
|
||||
<div className="flex flex-wrap items-baseline gap-x-2 gap-y-1">
|
||||
<h4 className="text-[15px] font-semibold text-[#E6EDF3]">
|
||||
{t("hub.demo.github.issueTitle")}
|
||||
</h4>
|
||||
<span className="font-mono text-[14px] text-[#8B949E]">#2811</span>
|
||||
</div>
|
||||
<div className="mt-1.5 flex flex-wrap items-center gap-2 text-[11.5px] text-[#8B949E]">
|
||||
<span className="inline-flex items-center gap-1 rounded-full bg-[#238636] px-2.5 py-0.5 text-[11px] font-semibold text-white">
|
||||
<CircleDot className="h-3 w-3" aria-hidden="true" />
|
||||
Open
|
||||
</span>
|
||||
<span>
|
||||
<strong className="font-semibold text-[#E6EDF3]">mo</strong>{" "}
|
||||
{t("hub.demo.github.issueMeta")}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function GitHubComment({
|
||||
author,
|
||||
badge,
|
||||
timestamp,
|
||||
bot,
|
||||
children,
|
||||
}: {
|
||||
author: string;
|
||||
badge: string;
|
||||
timestamp: string;
|
||||
bot?: boolean;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-start gap-2.5">
|
||||
{bot ? (
|
||||
<PaseoBotAvatar size="sm" rounded="rounded-full" className="relative z-10 mt-0.5 h-7 w-7" />
|
||||
) : (
|
||||
<MoAvatar size="sm" rounded="rounded-full" className="relative z-10 mt-0.5 h-7 w-7" />
|
||||
)}
|
||||
<div className="min-w-0 flex-1 overflow-hidden rounded-md border border-[#30363D] bg-[#0D1117]">
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 border-b border-[#21262D] bg-[#161B22] px-3 py-1.5 text-[11.5px]">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<span className="font-semibold text-[#E6EDF3]">{author}</span>
|
||||
<span className="rounded-full border border-[#30363D] px-1.5 py-[0.5px] text-[10px] font-medium text-[#8B949E]">
|
||||
{badge}
|
||||
</span>
|
||||
</div>
|
||||
<span className="text-[11px] text-[#8B949E]">{timestamp}</span>
|
||||
</div>
|
||||
<div className="px-3 py-2.5 text-[12.5px] leading-[1.5] text-[#C9D1D9]">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function GitHubSidebar() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<aside
|
||||
aria-hidden="true"
|
||||
className="hidden flex-col gap-3.5 border-l border-[#21262D] px-3.5 py-3.5 text-[11.5px] sm:flex"
|
||||
>
|
||||
<div className="space-y-1.5 border-b border-[#21262D] pb-3">
|
||||
<p className="font-medium text-[#8B949E]">{t("hub.demo.github.assignees")}</p>
|
||||
<div className="flex items-center gap-1.5 text-[#E6EDF3]">
|
||||
<PaseoBotAvatar size="xs" rounded="rounded-full" />
|
||||
<span className="font-medium">paseo-bot</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5 border-b border-[#21262D] pb-3">
|
||||
<p className="font-medium text-[#8B949E]">{t("hub.demo.github.labels")}</p>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
<span className="rounded-full border border-[#F85149]/40 bg-[#F85149]/15 px-2 py-[1px] text-[10.5px] font-medium text-[#FF7B72]">
|
||||
bug
|
||||
</span>
|
||||
<span className="rounded-full border border-[#D29922]/40 bg-[#D29922]/15 px-2 py-[1px] text-[10.5px] font-medium text-[#E3B341]">
|
||||
p0
|
||||
</span>
|
||||
<span className="rounded-full border border-[#20744A]/60 bg-[#20744A]/20 px-2 py-[1px] text-[10.5px] font-medium text-[#6CB17B]">
|
||||
paseo
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5 border-b border-[#21262D] pb-3">
|
||||
<p className="font-medium text-[#8B949E]">{t("hub.demo.github.development")}</p>
|
||||
<div className="flex items-center gap-1.5 text-[#58A6FF]">
|
||||
<GitPullRequest className="h-3.5 w-3.5 shrink-0 text-[#3FB950]" />
|
||||
<span className="font-mono text-[11.5px]">#2819</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<p className="font-medium text-[#8B949E]">{t("hub.demo.github.daemon")}</p>
|
||||
<span className="inline-block rounded border border-[#30363D] bg-[#161B22] px-1.5 py-0.5 font-mono text-[11px] text-[#E6EDF3]">
|
||||
macbook-pro
|
||||
</span>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
import { useInView, useReducedMotion } from "framer-motion";
|
||||
import { ArrowRight } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
HUB_TRIGGER_SOURCES,
|
||||
type HubTriggerSource,
|
||||
type HubTriggerSourceId,
|
||||
} from "~/components/hub-flow";
|
||||
import { useLocalizePath } from "~/i18n";
|
||||
import { DiscordSourceMockup } from "./discord-mockup";
|
||||
import { GitHubSourceMockup } from "./github-mockup";
|
||||
import { LinearSourceMockup } from "./linear-mockup";
|
||||
import { SchedulesSourceMockup } from "./schedules-mockup";
|
||||
import type { SourceMockupProps } from "./shared";
|
||||
import { SlackSourceMockup } from "./slack-mockup";
|
||||
import { WebhooksSourceMockup } from "./webhooks-mockup";
|
||||
|
||||
const SHOWCASE_ORDER: readonly HubTriggerSourceId[] = [
|
||||
"slack",
|
||||
"github",
|
||||
"linear",
|
||||
"discord",
|
||||
"schedules",
|
||||
"webhooks",
|
||||
];
|
||||
|
||||
const SOURCE_DOC_PATHS: Record<HubTriggerSourceId, string> = {
|
||||
slack: "/docs/hub/triggers/slack",
|
||||
github: "/docs/hub/triggers/github",
|
||||
linear: "/docs/hub/triggers/linear",
|
||||
discord: "/docs/hub/triggers/discord",
|
||||
schedules: "/docs/hub/triggers/schedules",
|
||||
webhooks: "/docs/hub/triggers/webhooks",
|
||||
};
|
||||
|
||||
const SHOWCASE_SOURCES: readonly HubTriggerSource[] = SHOWCASE_ORDER.map((id) => {
|
||||
const source = HUB_TRIGGER_SOURCES.find((item) => item.id === id);
|
||||
if (!source) {
|
||||
throw new Error(`Missing Hub trigger source metadata for "${id}"`);
|
||||
}
|
||||
return source;
|
||||
});
|
||||
|
||||
const SOURCE_MOCKUPS: Record<HubTriggerSourceId, React.ComponentType<SourceMockupProps>> = {
|
||||
slack: SlackSourceMockup,
|
||||
github: GitHubSourceMockup,
|
||||
linear: LinearSourceMockup,
|
||||
discord: DiscordSourceMockup,
|
||||
schedules: SchedulesSourceMockup,
|
||||
webhooks: WebhooksSourceMockup,
|
||||
};
|
||||
|
||||
const STAGE_IN_VIEW_OPTIONS = { once: true, margin: "-60px" } as const;
|
||||
const PANEL_ID = "hub-source-panel";
|
||||
|
||||
/**
|
||||
* Interactive split showcase for Paseo Hub automation sources:
|
||||
* left clickable pills on desktop (compact pill grid on mobile) paired with a fixed-height
|
||||
* right stage that swaps between authentic, animated dark-mode mockups with zero layout shift.
|
||||
*/
|
||||
export function HubAutomationsShowcase() {
|
||||
const { t } = useTranslation();
|
||||
const localize = useLocalizePath();
|
||||
const reduceMotion = useReducedMotion() === true;
|
||||
const [selected, setSelected] = React.useState<HubTriggerSourceId>("slack");
|
||||
const stageRef = React.useRef<HTMLDivElement | null>(null);
|
||||
const tabRefs = React.useRef<Partial<Record<HubTriggerSourceId, HTMLButtonElement | null>>>({});
|
||||
const isInView = useInView(stageRef, STAGE_IN_VIEW_OPTIONS);
|
||||
|
||||
const ActiveMockup = SOURCE_MOCKUPS[selected];
|
||||
|
||||
const registerTabRef = React.useCallback(
|
||||
(id: HubTriggerSourceId, node: HTMLButtonElement | null) => {
|
||||
tabRefs.current[id] = node;
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const handleNavigate = React.useCallback((index: number, key: string): boolean => {
|
||||
let nextIndex: number | null = null;
|
||||
if (key === "ArrowDown" || key === "ArrowRight") {
|
||||
nextIndex = (index + 1) % SHOWCASE_SOURCES.length;
|
||||
} else if (key === "ArrowUp" || key === "ArrowLeft") {
|
||||
nextIndex = (index - 1 + SHOWCASE_SOURCES.length) % SHOWCASE_SOURCES.length;
|
||||
} else if (key === "Home") {
|
||||
nextIndex = 0;
|
||||
} else if (key === "End") {
|
||||
nextIndex = SHOWCASE_SOURCES.length - 1;
|
||||
}
|
||||
if (nextIndex === null) return false;
|
||||
const nextId = SHOWCASE_SOURCES[nextIndex].id;
|
||||
setSelected(nextId);
|
||||
tabRefs.current[nextId]?.focus();
|
||||
return true;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="grid items-start gap-6 lg:grid-cols-[292px_minmax(0,1fr)] lg:gap-6">
|
||||
<div className="space-y-2.5">
|
||||
<div
|
||||
role="tablist"
|
||||
aria-label={t("hub.demo.shared.tablistLabel")}
|
||||
className="grid grid-cols-2 gap-1.5 min-[375px]:grid-cols-3 sm:gap-2 lg:flex lg:flex-col lg:gap-1.5"
|
||||
>
|
||||
{SHOWCASE_SOURCES.map((source, index) => (
|
||||
<SourceTabButton
|
||||
key={source.id}
|
||||
source={source}
|
||||
index={index}
|
||||
isSelected={source.id === selected}
|
||||
onSelect={setSelected}
|
||||
onNavigate={handleNavigate}
|
||||
registerRef={registerTabRef}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-muted-foreground lg:hidden">
|
||||
{t(`hub.sources.${selected}.description`)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<figure ref={stageRef} className="min-w-0 space-y-3">
|
||||
<div
|
||||
role="tabpanel"
|
||||
id={PANEL_ID}
|
||||
aria-labelledby={`hub-source-tab-${selected}`}
|
||||
tabIndex={0}
|
||||
className="relative focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent-text lg:h-[33rem]"
|
||||
>
|
||||
<ActiveMockup active={isInView} reduceMotion={reduceMotion} />
|
||||
</div>
|
||||
|
||||
<figcaption className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1.5 min-h-[1.25rem] text-sm text-muted-foreground">
|
||||
<span>{t(`hub.demo.${selected}.caption`)}</span>
|
||||
<a
|
||||
href={localize(SOURCE_DOC_PATHS[selected])}
|
||||
className="inline-flex shrink-0 items-center gap-1.5 text-sm text-white/75 transition-colors hover:text-accent-text"
|
||||
>
|
||||
{t("hub.demo.shared.docsLink", { source: t(`hub.sources.${selected}.name`) })}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</a>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SourceTabButton({
|
||||
source,
|
||||
index,
|
||||
isSelected,
|
||||
onSelect,
|
||||
onNavigate,
|
||||
registerRef,
|
||||
}: {
|
||||
source: HubTriggerSource;
|
||||
index: number;
|
||||
isSelected: boolean;
|
||||
onSelect: (id: HubTriggerSourceId) => void;
|
||||
onNavigate: (index: number, key: string) => boolean;
|
||||
registerRef: (id: HubTriggerSourceId, node: HTMLButtonElement | null) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { id, Icon } = source;
|
||||
|
||||
const setRef = React.useCallback(
|
||||
(node: HTMLButtonElement | null) => {
|
||||
registerRef(id, node);
|
||||
},
|
||||
[id, registerRef],
|
||||
);
|
||||
|
||||
const handleClick = React.useCallback(() => {
|
||||
onSelect(id);
|
||||
}, [id, onSelect]);
|
||||
|
||||
const handleKeyDown = React.useCallback(
|
||||
(event: React.KeyboardEvent<HTMLButtonElement>) => {
|
||||
if (onNavigate(index, event.key)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
[index, onNavigate],
|
||||
);
|
||||
|
||||
return (
|
||||
<button
|
||||
ref={setRef}
|
||||
type="button"
|
||||
role="tab"
|
||||
id={`hub-source-tab-${id}`}
|
||||
aria-selected={isSelected}
|
||||
aria-controls={PANEL_ID}
|
||||
tabIndex={isSelected ? 0 : -1}
|
||||
onClick={handleClick}
|
||||
onKeyDown={handleKeyDown}
|
||||
className={`group flex min-h-[42px] cursor-pointer items-center justify-center gap-2 rounded-xl border px-2.5 py-2 text-left transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent-text lg:min-h-0 lg:items-start lg:justify-start lg:gap-3 lg:px-3.5 lg:py-3 ${
|
||||
isSelected
|
||||
? "border-brand-green/55 bg-brand-green/[0.13] text-white"
|
||||
: "border-white/[0.07] bg-white/[0.015] text-white/70 hover:border-white/[0.14] hover:bg-white/[0.035] hover:text-white/90 lg:border-transparent lg:bg-transparent"
|
||||
}`}
|
||||
>
|
||||
<span
|
||||
className={`shrink-0 transition-colors lg:mt-0.5 ${
|
||||
isSelected ? "text-accent-text" : "text-white/55 group-hover:text-white/80"
|
||||
}`}
|
||||
>
|
||||
<Icon className="h-4 w-4 lg:h-[18px] lg:w-[18px]" />
|
||||
</span>
|
||||
|
||||
<span className="min-w-0 flex-1">
|
||||
<span
|
||||
className={`block text-xs leading-5 font-medium wrap-anywhere lg:text-sm ${
|
||||
isSelected ? "text-white" : "text-white/80 group-hover:text-white"
|
||||
}`}
|
||||
>
|
||||
{t(`hub.sources.${id}.name`)}
|
||||
</span>
|
||||
<span
|
||||
className={`mt-0.5 hidden text-xs leading-4 wrap-anywhere lg:block ${
|
||||
isSelected ? "text-white/65" : "text-muted-foreground"
|
||||
}`}
|
||||
>
|
||||
{t(`hub.sources.${id}.description`)}
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export { HubAutomationsShowcase } from "./hub-automations-showcase";
|
||||
@@ -1,242 +0,0 @@
|
||||
import { Check, ChevronRight, GitPullRequest, SignalHigh } from "lucide-react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { LinearIcon } from "~/components/brand-icons";
|
||||
import {
|
||||
MoAvatar,
|
||||
MockupStageWindow,
|
||||
MockupStep,
|
||||
OpenInPaseoChip,
|
||||
PaseoBotAvatar,
|
||||
type SourceMockupProps,
|
||||
WindowTrafficLights,
|
||||
} from "./shared";
|
||||
|
||||
const STEP_DELAYS = {
|
||||
assigned: 0.08,
|
||||
running: 0.65,
|
||||
comment: 1.35,
|
||||
} as const;
|
||||
|
||||
const LINEAR_COMPONENTS = {
|
||||
host: (
|
||||
<span className="rounded bg-[#22252E] px-1.5 py-[1px] font-mono text-[11px] text-[#E3E6F0]" />
|
||||
),
|
||||
code: (
|
||||
<code className="rounded bg-[#22252E] px-1.5 py-[1px] font-mono text-[11px] text-[#C5CCDF]" />
|
||||
),
|
||||
};
|
||||
|
||||
export function LinearSourceMockup({ active, reduceMotion }: SourceMockupProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MockupStageWindow
|
||||
ariaLabel={t("hub.demo.linear.alt")}
|
||||
active={active}
|
||||
reduceMotion={reduceMotion}
|
||||
className="border-[#262932] bg-[#111318]"
|
||||
>
|
||||
<LinearChrome />
|
||||
|
||||
<div className="grid min-h-0 flex-1 grid-cols-1 sm:grid-cols-[minmax(0,1fr)_172px]">
|
||||
<LinearIssuePane />
|
||||
<LinearPropertiesSidebar />
|
||||
</div>
|
||||
</MockupStageWindow>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearIssuePane() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex min-h-0 flex-col px-5 py-4">
|
||||
<div className="space-y-1.5 border-b border-[#22252E] pb-3.5">
|
||||
<p className="font-mono text-[11.5px] text-[#8A8F9E]">PAS-418</p>
|
||||
<h4 className="text-[16px] font-semibold tracking-[-0.01em] text-[#F1F3F8]">
|
||||
{t("hub.demo.linear.issueTitle")}
|
||||
</h4>
|
||||
<p className="text-[12.5px] leading-relaxed text-[#9DA3B4]">
|
||||
{t("hub.demo.linear.issueDescription")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<LinearActivityFeed />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearActivityFeed() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="mt-3.5 flex-1 space-y-3">
|
||||
<p className="text-[11px] font-medium uppercase tracking-wider text-[#6D7385]">
|
||||
{t("hub.demo.linear.activity")}
|
||||
</p>
|
||||
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.assigned}
|
||||
className="flex items-center gap-2 text-[12px] text-[#9DA3B4]"
|
||||
>
|
||||
<MoAvatar size="xs" rounded="rounded-full" />
|
||||
<span className="min-w-0">
|
||||
<strong className="font-medium text-[#ECEEF4]">mo</strong>{" "}
|
||||
{t("hub.demo.linear.assignedEvent")}{" "}
|
||||
<strong className="font-medium text-[#ECEEF4]">paseo-bot</strong>
|
||||
</span>
|
||||
<span className="ml-auto shrink-0 text-[11px] text-[#6D7385]">11m</span>
|
||||
</MockupStep>
|
||||
|
||||
<LinearRunStatusRow />
|
||||
<LinearBotCommentCard />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearRunStatusRow() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.running}
|
||||
className="flex items-center gap-2.5 rounded-lg border border-[#242834] bg-[#171A21] px-3 py-2 text-[12px]"
|
||||
>
|
||||
<PaseoBotAvatar size="sm" rounded="rounded-full" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="font-medium text-[#ECEEF4]">paseo-bot</span>
|
||||
<span className="text-[#6D7385]">·</span>
|
||||
<span className="text-[#9DA3B4]">
|
||||
<Trans i18nKey="hub.demo.linear.runningOn" components={LINEAR_COMPONENTS} />
|
||||
</span>
|
||||
</div>
|
||||
<p className="mt-0.5 font-mono text-[11px] wrap-anywhere text-[#7D8599]">
|
||||
{t("hub.demo.linear.traceLine")}
|
||||
</p>
|
||||
</div>
|
||||
<Check className="h-3.5 w-3.5 shrink-0 text-[#6CB17B]" aria-hidden="true" />
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearBotCommentCard() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.comment}
|
||||
className="rounded-lg border border-[#262A36] bg-[#161820] p-3.5"
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<PaseoBotAvatar size="sm" rounded="rounded-full" />
|
||||
<span className="text-[12.5px] font-semibold text-[#F1F3F8]">paseo-bot</span>
|
||||
<span className="rounded bg-[#252936] px-1.5 py-[1px] text-[10px] font-medium uppercase tracking-wide text-[#9DA3B4]">
|
||||
{t("hub.demo.shared.appBadge")}
|
||||
</span>
|
||||
</div>
|
||||
<span className="text-[11px] text-[#6D7385]">6m</span>
|
||||
</div>
|
||||
|
||||
<p className="mt-2 text-[12.5px] leading-[1.5] text-[#C5CCDF]">
|
||||
<Trans i18nKey="hub.demo.linear.botSummary" components={LINEAR_COMPONENTS} />
|
||||
</p>
|
||||
|
||||
<div className="mt-3 flex flex-wrap items-center justify-between gap-2 border-t border-[#242834] pt-2.5">
|
||||
<span className="inline-flex items-center gap-1.5 rounded-md border border-[#2A2F3D] bg-[#1C1F2A] px-2 py-1 font-mono text-[11px] text-[#C5CCDF]">
|
||||
<GitPullRequest className="h-3 w-3 text-[#6CB17B]" aria-hidden="true" />
|
||||
<span>#2822</span>
|
||||
<span className="text-[#6CB17B]">· {t("hub.demo.shared.testsPassed")}</span>
|
||||
</span>
|
||||
<OpenInPaseoChip variant="brand" />
|
||||
</div>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearChrome() {
|
||||
return (
|
||||
<div className="flex min-h-9 shrink-0 items-center justify-between border-b border-[#22252E] bg-[#15171E] px-3.5 py-1">
|
||||
<div className="flex items-center gap-3">
|
||||
<WindowTrafficLights />
|
||||
<div className="flex flex-wrap items-center gap-1 text-[11.5px] text-[#8A8F9E]">
|
||||
<LinearIcon className="h-3.5 w-3.5 text-[#5E6AD2]" />
|
||||
<span>Paseo</span>
|
||||
<ChevronRight className="h-3 w-3 text-[#555B6E]" aria-hidden="true" />
|
||||
<span>Core</span>
|
||||
<ChevronRight className="h-3 w-3 text-[#555B6E]" aria-hidden="true" />
|
||||
<span className="font-mono text-[#E3E6F0]">PAS-418</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span className="hidden rounded-full border border-[#5E6AD2]/35 bg-[#5E6AD2]/15 px-2 py-0.5 text-[10.5px] font-medium text-[#A4ACEE] sm:inline-block">
|
||||
Cycle 14
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearPropertiesSidebar() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<aside
|
||||
aria-hidden="true"
|
||||
className="hidden flex-col gap-3.5 border-l border-[#22252E] bg-[#13151B] px-3.5 py-4 text-[11.5px] sm:flex"
|
||||
>
|
||||
<p className="text-[11px] font-medium text-[#6D7385]">{t("hub.demo.linear.properties")}</p>
|
||||
|
||||
<LinearPropRow label={t("hub.demo.linear.status")}>
|
||||
<span className="inline-flex items-center gap-1.5 text-[#ECEEF4]">
|
||||
<span className="h-2.5 w-2.5 rounded-full border-2 border-[#6CB17B] bg-[#6CB17B]/35" />
|
||||
<span>In Review</span>
|
||||
</span>
|
||||
</LinearPropRow>
|
||||
|
||||
<LinearPropRow label={t("hub.demo.linear.priority")}>
|
||||
<span className="inline-flex items-center gap-1.5 text-[#ECEEF4]">
|
||||
<SignalHigh className="h-3.5 w-3.5 text-[#F2994A]" />
|
||||
<span>High</span>
|
||||
</span>
|
||||
</LinearPropRow>
|
||||
|
||||
<LinearPropRow label={t("hub.demo.linear.assignee")}>
|
||||
<span className="inline-flex items-center gap-1.5 text-[#ECEEF4]">
|
||||
<PaseoBotAvatar size="xs" rounded="rounded-full" />
|
||||
<span>paseo-bot</span>
|
||||
</span>
|
||||
</LinearPropRow>
|
||||
|
||||
<LinearPropRow label={t("hub.demo.linear.creator")}>
|
||||
<span className="inline-flex items-center gap-1.5 text-[#ECEEF4]">
|
||||
<MoAvatar size="xs" rounded="rounded-full" />
|
||||
<span>mo</span>
|
||||
</span>
|
||||
</LinearPropRow>
|
||||
|
||||
<LinearPropRow label={t("hub.demo.linear.labels")}>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
<span className="inline-flex items-center gap-1 rounded-full border border-[#2A2F3D] bg-[#1A1D26] px-2 py-[1px] text-[10.5px] text-[#C5CCDF]">
|
||||
<span className="h-1.5 w-1.5 rounded-full bg-[#5E6AD2]" />
|
||||
mobile
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1 rounded-full border border-[#2A2F3D] bg-[#1A1D26] px-2 py-[1px] text-[10.5px] text-[#C5CCDF]">
|
||||
<span className="h-1.5 w-1.5 rounded-full bg-[#6CB17B]" />
|
||||
relay
|
||||
</span>
|
||||
</div>
|
||||
</LinearPropRow>
|
||||
|
||||
<LinearPropRow label={t("hub.demo.linear.daemon")}>
|
||||
<span className="rounded border border-[#2A2F3D] bg-[#1A1D26] px-1.5 py-0.5 font-mono text-[10.5px] text-[#C5CCDF]">
|
||||
devbox
|
||||
</span>
|
||||
</LinearPropRow>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
function LinearPropRow({ label, children }: { label: string; children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="space-y-1">
|
||||
<p className="text-[10.5px] text-[#6D7385]">{label}</p>
|
||||
<div>{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
import { Check, Clock, GitPullRequest, Hash, TrendingDown } from "lucide-react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import {
|
||||
MockupStageWindow,
|
||||
MockupStep,
|
||||
OpenInPaseoChip,
|
||||
PaseoBotAvatar,
|
||||
type SourceMockupProps,
|
||||
WindowTrafficLights,
|
||||
} from "./shared";
|
||||
import { SlackColorMark } from "./slack-mockup";
|
||||
|
||||
const STEP_DELAYS = {
|
||||
triggered: 0.06,
|
||||
prOpened: 0.7,
|
||||
slackDigest: 1.4,
|
||||
} as const;
|
||||
|
||||
const SCHEDULE_COMPONENTS = {
|
||||
code: (
|
||||
<code className="rounded bg-white/[0.07] px-1.5 py-[1px] font-mono text-[11px] text-white/90" />
|
||||
),
|
||||
pr: <span className="font-medium text-[#1D9BD1] underline decoration-[#1D9BD1]/40" />,
|
||||
strong: <strong className="font-semibold text-white" />,
|
||||
};
|
||||
|
||||
export function SchedulesSourceMockup({ active, reduceMotion }: SourceMockupProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MockupStageWindow
|
||||
ariaLabel={t("hub.demo.schedules.alt")}
|
||||
active={active}
|
||||
reduceMotion={reduceMotion}
|
||||
className="border-white/[0.1] bg-[#121716]"
|
||||
>
|
||||
<ScheduleChrome />
|
||||
<ScheduleHeaderBar />
|
||||
<div className="flex flex-1 flex-col justify-between gap-3 px-4 py-3.5">
|
||||
<ScheduleStepsList />
|
||||
<ScheduleImpactMetrics />
|
||||
<ScheduleSlackDigestCard />
|
||||
</div>
|
||||
</MockupStageWindow>
|
||||
);
|
||||
}
|
||||
|
||||
function ScheduleChrome() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex min-h-9 shrink-0 items-center justify-between gap-2 border-b border-white/[0.07] bg-[#0D1211] px-3.5 py-1">
|
||||
<div className="flex min-w-0 items-center gap-3">
|
||||
<WindowTrafficLights />
|
||||
<div className="flex min-w-0 items-center gap-1.5 font-mono text-[11.5px] text-white/65">
|
||||
<Clock className="h-3.5 w-3.5 shrink-0 text-accent-text" aria-hidden="true" />
|
||||
<span className="wrap-anywhere">.paseo/triggers/daily-ci-optimizer.yml</span>
|
||||
</div>
|
||||
</div>
|
||||
<span className="inline-flex shrink-0 items-center gap-1.5 rounded-full border border-brand-green/50 bg-brand-green/20 px-2 py-0.5 text-[10.5px] font-medium text-accent-text">
|
||||
<span className="h-1.5 w-1.5 rounded-full bg-[#35C264]" />
|
||||
{t("hub.demo.schedules.active")}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ScheduleHeaderBar() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-white/[0.07] bg-white/[0.02] px-4 py-2.5">
|
||||
<div>
|
||||
<h4 className="text-[14px] font-semibold text-white/95">
|
||||
{t("hub.demo.schedules.jobTitle")}
|
||||
</h4>
|
||||
<p className="text-[11.5px] text-white/55">{t("hub.demo.schedules.cadence")}</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-1.5 font-mono text-[11px]">
|
||||
<span className="rounded border border-white/10 bg-[#0D1211] px-2 py-0.5 text-accent-text">
|
||||
0 7 * * 1-5
|
||||
</span>
|
||||
<span className="rounded border border-white/10 bg-[#0D1211] px-2 py-0.5 text-white/70">
|
||||
devbox · Claude Code
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ScheduleStepsList() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<MockupStep delay={STEP_DELAYS.triggered} className="flex items-start gap-2.5">
|
||||
<span className="mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-brand-green/45 bg-brand-green/15 text-accent-text">
|
||||
<Check className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center justify-between gap-2 text-[12px]">
|
||||
<span className="font-medium text-white/90">{t("hub.demo.schedules.step1Title")}</span>
|
||||
<span className="font-mono text-[11px] text-white/40">7:00 AM</span>
|
||||
</div>
|
||||
<p className="mt-0.5 text-[12px] leading-relaxed text-white/65">
|
||||
<Trans i18nKey="hub.demo.schedules.step1Detail" components={SCHEDULE_COMPONENTS} />
|
||||
</p>
|
||||
</div>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep delay={STEP_DELAYS.prOpened} className="flex items-start gap-2.5">
|
||||
<span className="mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-brand-green/45 bg-brand-green/15 text-accent-text">
|
||||
<GitPullRequest className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center justify-between gap-2 text-[12px]">
|
||||
<span className="font-medium text-white/90">{t("hub.demo.schedules.step2Title")}</span>
|
||||
<span className="font-mono text-[11px] text-white/40">7:04 AM</span>
|
||||
</div>
|
||||
<SchedulePrPill />
|
||||
</div>
|
||||
</MockupStep>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SchedulePrPill() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="mt-1.5 flex flex-wrap items-center justify-between gap-2 rounded-lg border border-white/[0.08] bg-[#171E1D] px-3 py-2">
|
||||
<div className="flex min-w-0 items-center gap-1.5 text-[12px]">
|
||||
<span className="font-medium text-white/90">
|
||||
perf(ci): cache cargo target & stabilize e2e wait
|
||||
</span>
|
||||
<span className="font-mono text-[11px] text-white/45">#2831</span>
|
||||
</div>
|
||||
<div className="flex min-w-0 flex-wrap items-center gap-1.5 font-mono text-[10.5px]">
|
||||
<span className="inline-flex items-center gap-1 rounded bg-[#2BAC76]/15 px-1.5 py-0.5 text-[#6CB17B]">
|
||||
<TrendingDown className="h-3 w-3" aria-hidden="true" />
|
||||
CI -38%
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1 rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5 text-white/70">
|
||||
<Check className="h-3 w-3 text-[#6CB17B]" aria-hidden="true" />
|
||||
{t("hub.demo.shared.testsPassed")}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ScheduleImpactMetrics() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep
|
||||
delay={1.05}
|
||||
className="grid grid-cols-3 divide-x divide-white/[0.07] overflow-hidden rounded-lg border border-white/[0.07] bg-white/[0.02]"
|
||||
>
|
||||
<div className="px-3 py-2">
|
||||
<p className="text-[10.5px] text-white/45">{t("hub.demo.schedules.metricRuntime")}</p>
|
||||
<p className="mt-0.5 font-mono text-[12px] font-medium text-accent-text">7m 12s → 4m 28s</p>
|
||||
</div>
|
||||
<div className="px-3 py-2">
|
||||
<p className="text-[10.5px] text-white/45">{t("hub.demo.schedules.metricFlake")}</p>
|
||||
<p className="mt-0.5 font-mono text-[12px] font-medium text-accent-text">18% → 0%</p>
|
||||
</div>
|
||||
<div className="px-3 py-2">
|
||||
<p className="text-[10.5px] text-white/45">{t("hub.demo.schedules.metricCache")}</p>
|
||||
<p className="mt-0.5 font-mono text-[12px] font-medium text-white/85">94% hit</p>
|
||||
</div>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function ScheduleSlackDigestCard() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.slackDigest}
|
||||
className="overflow-hidden rounded-lg border border-[#35373B] bg-[#1A1D21]"
|
||||
>
|
||||
<div className="flex items-center justify-between border-b border-[#2C2D30] bg-[#14161A] px-3 py-1.5 text-[11px] text-[#ABABAD]">
|
||||
<span className="inline-flex items-center gap-1.5 font-medium text-[#E5E7EB]">
|
||||
<SlackColorMark className="h-3 w-3" />
|
||||
<Hash className="h-3 w-3 text-[#ABABAD]" aria-hidden="true" />
|
||||
engineering
|
||||
</span>
|
||||
<span>{t("hub.demo.schedules.slackPosted")}</span>
|
||||
</div>
|
||||
|
||||
<div className="flex items-start gap-2.5 px-3.5 py-3">
|
||||
<PaseoBotAvatar size="sm" className="mt-0.5 h-8 w-8" />
|
||||
<div className="min-w-0 flex-1 space-y-1.5">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<span className="text-[13px] font-bold text-[#F8F8F8]">paseo-bot</span>
|
||||
<span className="rounded-[3px] bg-[#2C2D30] px-1.5 py-[1px] text-[9.5px] font-semibold uppercase tracking-wide text-[#ABABAD]">
|
||||
{t("hub.demo.shared.appBadge")}
|
||||
</span>
|
||||
<span className="text-[11px] text-[#ABABAD]">7:05 AM</span>
|
||||
</div>
|
||||
<p className="text-[12.5px] leading-[1.45] text-[#D1D2D3]">
|
||||
<Trans i18nKey="hub.demo.schedules.slackSummary" components={SCHEDULE_COMPONENTS} />
|
||||
</p>
|
||||
<div className="flex flex-wrap items-center gap-2 pt-0.5">
|
||||
<OpenInPaseoChip variant="slack" />
|
||||
<span className="text-[11px] text-[#ABABAD]">{t("hub.demo.schedules.notifiedMo")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
import { motion, type Variants } from "framer-motion";
|
||||
import type * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { PaseoMark } from "~/components/paseo-brand";
|
||||
|
||||
export interface SourceMockupProps {
|
||||
/** Whether the section is visible or reduced motion is requested. */
|
||||
active: boolean;
|
||||
reduceMotion: boolean;
|
||||
}
|
||||
|
||||
export const STEP_VARIANTS: Variants = {
|
||||
hidden: { opacity: 0, y: 6 },
|
||||
shown: (delay: number) => ({
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
transition: { delay, duration: 0.32, ease: "easeOut" },
|
||||
}),
|
||||
};
|
||||
|
||||
type AvatarSize = "xs" | "sm" | "md";
|
||||
|
||||
const AVATAR_DIM: Record<AvatarSize, string> = {
|
||||
xs: "h-4 w-4",
|
||||
sm: "h-6 w-6",
|
||||
md: "h-8 w-8 sm:h-9 sm:w-9",
|
||||
};
|
||||
|
||||
const AVATAR_PX: Record<AvatarSize, number> = {
|
||||
xs: 16,
|
||||
sm: 24,
|
||||
md: 36,
|
||||
};
|
||||
|
||||
const BOT_ICON_DIM: Record<AvatarSize, string> = {
|
||||
xs: "h-2.5 w-2.5",
|
||||
sm: "h-3.5 w-3.5",
|
||||
md: "h-4 w-4 sm:h-5 sm:w-5",
|
||||
};
|
||||
|
||||
type OpenChipVariant = "brand" | "slack" | "discord" | "subtle";
|
||||
|
||||
const OPEN_CHIP_STYLES: Record<OpenChipVariant, string> = {
|
||||
brand: "bg-[#20744A] text-white",
|
||||
slack: "bg-[#007A5A] text-white",
|
||||
discord: "bg-[#248046] text-white",
|
||||
subtle: "border border-brand-green/50 bg-brand-green/20 text-[#9FE0B0]",
|
||||
};
|
||||
|
||||
export function MockupStep({
|
||||
delay,
|
||||
className,
|
||||
children,
|
||||
}: {
|
||||
delay: number;
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<motion.div variants={STEP_VARIANTS} custom={delay} className={className}>
|
||||
{children}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Animated root container for a single source mockup. Keeps outer dimensions locked to the stage
|
||||
* so switching tabs or stepping through animations never shifts page layout.
|
||||
*/
|
||||
export function MockupStageWindow({
|
||||
ariaLabel,
|
||||
active,
|
||||
reduceMotion,
|
||||
className = "",
|
||||
children,
|
||||
}: {
|
||||
ariaLabel: string;
|
||||
active: boolean;
|
||||
reduceMotion: boolean;
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<motion.div
|
||||
role="img"
|
||||
aria-label={ariaLabel}
|
||||
initial={reduceMotion ? "shown" : "hidden"}
|
||||
animate={reduceMotion || active ? "shown" : "hidden"}
|
||||
className={`@container flex h-full flex-col overflow-hidden rounded-xl border wrap-anywhere shadow-[0_24px_64px_-24px_rgba(0,0,0,0.75)] ${className}`}
|
||||
>
|
||||
{children}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Mo's photo avatar used consistently across all source mockups. */
|
||||
export function MoAvatar({
|
||||
size = "md",
|
||||
rounded = "rounded-[6px]",
|
||||
className = "",
|
||||
}: {
|
||||
size?: AvatarSize;
|
||||
rounded?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
const px = AVATAR_PX[size];
|
||||
return (
|
||||
<img
|
||||
src="/9viSwGkz_400x400.jpg"
|
||||
alt=""
|
||||
width={px}
|
||||
height={px}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className={`shrink-0 object-cover ${AVATAR_DIM[size]} ${rounded} ${className}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Paseo bot avatar using the canonical Paseo butterfly mark (`PaseoMark`).
|
||||
* Used consistently for `paseo-bot` across Slack, GitHub, Linear, Discord, Schedules, and Webhooks.
|
||||
*/
|
||||
export function PaseoBotAvatar({
|
||||
size = "md",
|
||||
rounded = "rounded-[6px]",
|
||||
className = "",
|
||||
}: {
|
||||
size?: AvatarSize;
|
||||
rounded?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={`inline-flex shrink-0 items-center justify-center border border-white/14 bg-[#101615] ${AVATAR_DIM[size]} ${rounded} ${className}`}
|
||||
>
|
||||
<PaseoMark className={`${BOT_ICON_DIM[size]} text-white`} />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/** Consistent "Open in Paseo" action chip rendered inside source mockups. */
|
||||
export function OpenInPaseoChip({ variant = "brand" }: { variant?: OpenChipVariant }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex max-w-full items-center gap-1.5 rounded-[5px] px-2.5 py-1 text-[11.5px] font-medium ${OPEN_CHIP_STYLES[variant]}`}
|
||||
>
|
||||
<PaseoMark className="h-3.5 w-3.5 shrink-0 text-current" />
|
||||
<span>{t("hub.demo.shared.openInPaseo")}</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/** macOS-style window traffic lights for desktop-style mockup headers. */
|
||||
export function WindowTrafficLights() {
|
||||
return (
|
||||
<div className="flex items-center gap-1.5 @max-[14rem]:hidden" aria-hidden="true">
|
||||
<span className="h-2.5 w-2.5 rounded-full bg-[#FF5F57]/85" />
|
||||
<span className="h-2.5 w-2.5 rounded-full bg-[#FEBC2E]/85" />
|
||||
<span className="h-2.5 w-2.5 rounded-full bg-[#28C840]/85" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,380 +0,0 @@
|
||||
import { motion, type Variants } from "framer-motion";
|
||||
import {
|
||||
AtSign,
|
||||
Check,
|
||||
ChevronDown,
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
Code,
|
||||
GitPullRequest,
|
||||
Hash,
|
||||
Plus,
|
||||
Search,
|
||||
SendHorizontal,
|
||||
SquarePen,
|
||||
} from "lucide-react";
|
||||
import type { ReactNode } from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { PaseoMark } from "~/components/paseo-brand";
|
||||
import {
|
||||
MoAvatar,
|
||||
MockupStageWindow,
|
||||
MockupStep,
|
||||
OpenInPaseoChip,
|
||||
PaseoBotAvatar,
|
||||
type SourceMockupProps,
|
||||
WindowTrafficLights,
|
||||
} from "./shared";
|
||||
|
||||
const DEMO_ISSUES = [
|
||||
{ id: "#2811", title: "Terminal output drops under load" },
|
||||
{ id: "#2804", title: "Relay reconnect loop on Android after sleep" },
|
||||
{ id: "#2799", title: "Worktree cleanup leaves stale branches" },
|
||||
] as const;
|
||||
|
||||
const SIDEBAR_CHANNELS = ["general", "engineering", "incidents", "releases"] as const;
|
||||
|
||||
const STEP_DELAYS = {
|
||||
firstPrompt: 0.06,
|
||||
firstReply: 0.65,
|
||||
followUp: 1.35,
|
||||
finalReply: 2.05,
|
||||
} as const;
|
||||
|
||||
const TYPING_VARIANTS: Variants = {
|
||||
hidden: { opacity: 0 },
|
||||
shown: {
|
||||
opacity: [0, 1, 1, 0, 0, 1, 1, 0],
|
||||
transition: {
|
||||
duration: 2.4,
|
||||
times: [0, 0.08, 0.24, 0.28, 0.56, 0.62, 0.84, 0.9],
|
||||
ease: "linear",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const SLACK_COMPONENTS = {
|
||||
mention: <SlackMention />,
|
||||
host: (
|
||||
<span className="rounded-[3px] border border-white/10 bg-[#222529] px-1.5 py-[1px] font-mono text-[11.5px] text-[#E8912D]" />
|
||||
),
|
||||
pr: <span className="font-medium text-[#1D9BD1] underline decoration-[#1D9BD1]/40" />,
|
||||
};
|
||||
|
||||
export function SlackSourceMockup({ active, reduceMotion }: SourceMockupProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MockupStageWindow
|
||||
ariaLabel={t("hub.demo.slack.alt")}
|
||||
active={active}
|
||||
reduceMotion={reduceMotion}
|
||||
className="border-[#35373B] bg-[#1A1D21]"
|
||||
>
|
||||
<SlackWindowChrome />
|
||||
<div className="grid min-h-0 flex-1 grid-cols-1 md:grid-cols-[164px_minmax(0,1fr)]">
|
||||
<SlackSidebar />
|
||||
<div className="flex min-h-0 min-w-0 flex-col bg-[#1A1D21]">
|
||||
<SlackChannelHeader />
|
||||
<SlackMessageFeed />
|
||||
<SlackComposer />
|
||||
<SlackTypingStatus reduced={reduceMotion} />
|
||||
</div>
|
||||
</div>
|
||||
</MockupStageWindow>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackWindowChrome() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex h-9 shrink-0 items-center justify-between border-b border-[#2C2D30] bg-[#121016] px-3.5">
|
||||
<div className="flex items-center gap-3">
|
||||
<WindowTrafficLights />
|
||||
<div className="hidden items-center gap-1 text-[#ABABAD]/60 sm:flex" aria-hidden="true">
|
||||
<ChevronLeft className="h-3.5 w-3.5" />
|
||||
<ChevronRight className="h-3.5 w-3.5" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex h-6 w-44 min-w-0 items-center gap-1.5 rounded-[5px] bg-white/[0.08] px-2.5 text-[11px] text-[#ABABAD] sm:w-56">
|
||||
<Search className="h-3 w-3 shrink-0 text-[#ABABAD]/75" aria-hidden="true" />
|
||||
<span className="truncate">{t("hub.demo.slack.searchPlaceholder")}</span>
|
||||
</div>
|
||||
|
||||
<SlackColorMark className="h-3.5 w-3.5 shrink-0" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackSidebar() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<aside
|
||||
aria-hidden="true"
|
||||
className="hidden flex-col border-r border-[#2C2D30] bg-[#19171D] md:flex"
|
||||
>
|
||||
<div className="flex items-center justify-between border-b border-white/[0.07] px-3 py-2.5">
|
||||
<div className="flex items-center gap-1 text-[13.5px] font-bold text-[#F8F8F8]">
|
||||
<span>Paseo</span>
|
||||
<ChevronDown className="h-3.5 w-3.5 text-[#ABABAD]" />
|
||||
</div>
|
||||
<SquarePen className="h-3.5 w-3.5 text-[#ABABAD]" />
|
||||
</div>
|
||||
|
||||
<div className="space-y-4 px-2 py-3 text-[12.5px]">
|
||||
<div className="space-y-0.5">
|
||||
<p className="px-2 pb-1 text-[11px] font-medium text-[#ABABAD]/75">
|
||||
{t("hub.demo.slack.channels")}
|
||||
</p>
|
||||
{SIDEBAR_CHANNELS.map((channel) => (
|
||||
<div
|
||||
key={channel}
|
||||
className={`flex items-center gap-1.5 rounded-[6px] px-2 py-1 ${
|
||||
channel === "engineering" ? "bg-[#1164A3] font-medium text-white" : "text-[#ABABAD]"
|
||||
}`}
|
||||
>
|
||||
<Hash className="h-3.5 w-3.5 shrink-0 opacity-80" />
|
||||
<span className="truncate">{channel}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="space-y-0.5">
|
||||
<p className="px-2 pb-1 text-[11px] font-medium text-[#ABABAD]/75">
|
||||
{t("hub.demo.slack.apps")}
|
||||
</p>
|
||||
<div className="flex items-center gap-2 rounded-[6px] px-2 py-1 text-[#D1D2D3]">
|
||||
<span className="relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-[#101615] ring-1 ring-white/15">
|
||||
<PaseoMark className="h-2.5 w-2.5 text-white" />
|
||||
<span className="absolute -right-0.5 -bottom-0.5 h-1.5 w-1.5 rounded-full bg-[#2BAC76] ring-1 ring-[#19171D]" />
|
||||
</span>
|
||||
<span className="truncate">paseo-bot</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackChannelHeader() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex shrink-0 items-center justify-between gap-3 border-b border-[#2C2D30] px-4 py-2">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<div className="flex items-center gap-1 text-[14px] font-bold text-[#F8F8F8]">
|
||||
<Hash className="h-3.5 w-3.5 shrink-0 text-[#D1D2D3]" aria-hidden="true" />
|
||||
<span>engineering</span>
|
||||
</div>
|
||||
<span className="hidden truncate text-[11.5px] text-[#ABABAD] sm:inline">
|
||||
{t("hub.demo.slack.channelTopic")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="flex shrink-0 items-center gap-1.5 rounded-[5px] border border-[#35373B] px-2 py-0.5 text-[11px] text-[#ABABAD]"
|
||||
>
|
||||
<div className="flex -space-x-1">
|
||||
<MoAvatar size="xs" rounded="rounded-[3px]" className="ring-1 ring-[#1A1D21]" />
|
||||
<span className="flex h-4 w-4 items-center justify-center rounded-[3px] bg-[#101615] ring-1 ring-[#1A1D21]">
|
||||
<PaseoMark className="h-2.5 w-2.5 text-white" />
|
||||
</span>
|
||||
</div>
|
||||
<span className="tabular-nums">4</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackMessageFeed() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex-1 space-y-2.5 px-4 py-2.5">
|
||||
<MockupStep delay={STEP_DELAYS.firstPrompt}>
|
||||
<SlackMessage author="mo" time="9:41 AM">
|
||||
<p>
|
||||
<Trans i18nKey="hub.demo.slack.showIssues" components={SLACK_COMPONENTS} />
|
||||
</p>
|
||||
</SlackMessage>
|
||||
</MockupStep>
|
||||
|
||||
<div className="ml-2.5 sm:ml-3.5">
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.firstReply}
|
||||
className="space-y-1.5 border-l-2 border-[#2C2D30] pb-2.5 pl-3 sm:pl-3.5"
|
||||
>
|
||||
<div className="flex items-center gap-2 text-[11px]">
|
||||
<span className="font-medium text-[#1D9BD1]">{t("hub.demo.slack.threadReplies")}</span>
|
||||
<span className="h-px flex-1 bg-[#2C2D30]" aria-hidden="true" />
|
||||
</div>
|
||||
|
||||
<SlackMessage author="paseo-bot" time="9:41 AM" bot>
|
||||
<p>{t("hub.demo.slack.issuesOpen")}</p>
|
||||
<ul className="mt-1 space-y-0.5 border-l-[3px] border-[#36C5F0] pl-2.5 text-[12px]">
|
||||
{DEMO_ISSUES.map((issue) => (
|
||||
<li key={issue.id} className="flex flex-wrap items-baseline gap-x-1.5">
|
||||
<span className="font-mono text-[11.5px] font-medium text-[#1D9BD1]">
|
||||
{issue.id}
|
||||
</span>
|
||||
<span className="text-[#D1D2D3]">{issue.title}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</SlackMessage>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.followUp}
|
||||
className="border-l-2 border-[#2C2D30] pb-2.5 pl-3 sm:pl-3.5"
|
||||
>
|
||||
<SlackMessage author="mo" time="9:43 AM">
|
||||
<p>
|
||||
<Trans i18nKey="hub.demo.slack.createPr" components={SLACK_COMPONENTS} />
|
||||
</p>
|
||||
</SlackMessage>
|
||||
</MockupStep>
|
||||
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.finalReply}
|
||||
className="border-l-2 border-[#2C2D30] pl-3 sm:pl-3.5"
|
||||
>
|
||||
<SlackMessage author="paseo-bot" time="9:48 AM" bot>
|
||||
<p>
|
||||
<Trans i18nKey="hub.demo.slack.ranOn" components={SLACK_COMPONENTS} />
|
||||
</p>
|
||||
<SlackPrAttachment />
|
||||
</SlackMessage>
|
||||
</MockupStep>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackPrAttachment() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="mt-1.5 space-y-1.5 border-l-[3px] border-[#2BAC76] pl-2.5">
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="inline-flex items-center gap-1 rounded-[4px] bg-[#2BAC76]/15 px-2 py-0.5 font-mono text-[11px] text-[#4CD99B]">
|
||||
<GitPullRequest className="h-3 w-3" aria-hidden="true" />
|
||||
{t("hub.demo.slack.filesChanged")}
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1 rounded-[4px] border border-[#35373B] bg-[#222529] px-2 py-0.5 font-mono text-[11px] text-[#ABABAD]">
|
||||
<Check className="h-3 w-3 text-[#2BAC76]" aria-hidden="true" />
|
||||
{t("hub.demo.shared.testsPassed")}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<OpenInPaseoChip variant="slack" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackMessage({
|
||||
author,
|
||||
time,
|
||||
bot,
|
||||
children,
|
||||
}: {
|
||||
author: string;
|
||||
time: string;
|
||||
bot?: boolean;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex items-start gap-2.5 @max-[14rem]:flex-col @max-[14rem]:gap-1">
|
||||
{bot ? (
|
||||
<PaseoBotAvatar size="sm" className="mt-0.5 h-8 w-8" />
|
||||
) : (
|
||||
<MoAvatar size="sm" className="mt-0.5 h-8 w-8" />
|
||||
)}
|
||||
<div className="min-w-0 flex-1 space-y-0.5">
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="text-[13px] font-bold text-[#F8F8F8]">{author}</span>
|
||||
{bot ? (
|
||||
<span className="rounded-[3px] bg-[#2C2D30] px-1.5 py-[1px] text-[9.5px] font-semibold uppercase tracking-wide text-[#ABABAD]">
|
||||
{t("hub.demo.shared.appBadge")}
|
||||
</span>
|
||||
) : null}
|
||||
<span className="text-[10.5px] text-[#ABABAD]">{time}</span>
|
||||
</div>
|
||||
<div className="text-[12.5px] leading-[1.42] text-[#D1D2D3]">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackMention() {
|
||||
return (
|
||||
<span className="rounded-[3px] bg-[#1D9BD1]/20 px-1 py-[1px] font-medium text-[#1D9BD1]">
|
||||
@paseo-bot
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackComposer() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="mx-4 mt-auto rounded-[8px] border border-[#35373B] bg-[#222529]"
|
||||
>
|
||||
<div className="px-3 py-1.5 text-[12.5px] text-[#ABABAD]/70">
|
||||
{t("hub.demo.slack.composerPlaceholder")}
|
||||
</div>
|
||||
<div className="flex items-center justify-between border-t border-white/[0.06] px-2.5 py-1">
|
||||
<div className="flex items-center gap-2.5 text-[#ABABAD]/60">
|
||||
<Plus className="h-3.5 w-3.5" />
|
||||
<AtSign className="h-3.5 w-3.5" />
|
||||
<Code className="h-3.5 w-3.5" />
|
||||
</div>
|
||||
<span className="inline-flex h-5 w-6 items-center justify-center rounded-[4px] bg-[#007A5A]/80 text-white">
|
||||
<SendHorizontal className="h-3 w-3" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SlackTypingStatus({ reduced }: { reduced: boolean }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div aria-hidden="true" className="flex h-6 shrink-0 items-center px-4 pb-1">
|
||||
{reduced ? null : (
|
||||
<motion.span
|
||||
variants={TYPING_VARIANTS}
|
||||
className="inline-flex items-center gap-1.5 text-[11px] text-[#ABABAD]"
|
||||
>
|
||||
<span className="h-1.5 w-1.5 animate-pulse rounded-full bg-[#2BAC76]" />
|
||||
{t("hub.demo.slack.typing")}
|
||||
</motion.span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SlackColorMark(props: React.SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" {...props}>
|
||||
<path
|
||||
fill="#E01E5A"
|
||||
d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z"
|
||||
/>
|
||||
<path
|
||||
fill="#36C5F0"
|
||||
d="M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z"
|
||||
/>
|
||||
<path
|
||||
fill="#2EB67D"
|
||||
d="M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312z"
|
||||
/>
|
||||
<path
|
||||
fill="#ECB22E"
|
||||
d="M15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
import { ArrowDown, Check, Terminal, Webhook } from "lucide-react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import {
|
||||
MockupStageWindow,
|
||||
MockupStep,
|
||||
OpenInPaseoChip,
|
||||
PaseoBotAvatar,
|
||||
type SourceMockupProps,
|
||||
WindowTrafficLights,
|
||||
} from "./shared";
|
||||
|
||||
const STEP_DELAYS = {
|
||||
curl: 0.06,
|
||||
response: 0.65,
|
||||
runCard: 1.25,
|
||||
} as const;
|
||||
|
||||
const WEBHOOK_ID = "wh_4PCfLx4q46HniZpIeiThI4BmNC4zHGFY";
|
||||
const RUN_ID = "0197e5d2-a70c-4ad0-b7aa-a29154a6bc72";
|
||||
const ACCEPTED_RESPONSE = JSON.stringify({ status: "accepted", runId: RUN_ID });
|
||||
|
||||
const WEBHOOK_COMPONENTS = {
|
||||
code: <code className="font-mono text-[11px] text-white/90" />,
|
||||
pr: <span className="font-mono text-[#6CB17B]">#2834</span>,
|
||||
};
|
||||
|
||||
export function WebhooksSourceMockup({ active, reduceMotion }: SourceMockupProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MockupStageWindow
|
||||
ariaLabel={t("hub.demo.webhooks.alt")}
|
||||
active={active}
|
||||
reduceMotion={reduceMotion}
|
||||
className="border-white/[0.1] bg-[#0C1110]"
|
||||
>
|
||||
<WebhookTerminalChrome />
|
||||
|
||||
<div className="flex flex-1 flex-col justify-between gap-2.5 p-4">
|
||||
<div className="space-y-3">
|
||||
<WebhookCurlBlock />
|
||||
<WebhookResponseBlock />
|
||||
</div>
|
||||
<WebhookRouteConnector />
|
||||
<WebhookRunCard />
|
||||
</div>
|
||||
</MockupStageWindow>
|
||||
);
|
||||
}
|
||||
|
||||
function WebhookTerminalChrome() {
|
||||
return (
|
||||
<div className="flex h-9 shrink-0 items-center justify-between gap-2 border-b border-white/[0.08] bg-[#131918] px-3.5">
|
||||
<div className="flex min-w-0 items-center gap-3">
|
||||
<WindowTrafficLights />
|
||||
<span className="inline-flex min-w-0 items-center gap-1.5 truncate font-mono text-[11.5px] text-white/65">
|
||||
<Terminal className="h-3.5 w-3.5 shrink-0 text-white/45" aria-hidden="true" />
|
||||
<span className="truncate">mo@devbox — zsh</span>
|
||||
</span>
|
||||
</div>
|
||||
<span className="hidden shrink-0 items-center gap-1.5 rounded border border-white/10 bg-white/[0.04] px-2 py-0.5 font-mono text-[10.5px] text-accent-text sm:inline-flex">
|
||||
<Webhook className="h-3 w-3" aria-hidden="true" />
|
||||
POST /webhooks/{WEBHOOK_ID}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function WebhookRouteConnector() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep delay={0.95} className="flex items-center gap-2.5 px-1 text-[11px] text-white/45">
|
||||
<span className="h-px flex-1 bg-white/[0.07]" aria-hidden="true" />
|
||||
<span className="inline-flex items-center gap-1.5 font-mono text-accent-text/90">
|
||||
<ArrowDown className="h-3 w-3" aria-hidden="true" />
|
||||
{t("hub.demo.webhooks.routedLine")}
|
||||
</span>
|
||||
<span className="h-px flex-1 bg-white/[0.07]" aria-hidden="true" />
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function WebhookCurlBlock() {
|
||||
return (
|
||||
<MockupStep delay={STEP_DELAYS.curl}>
|
||||
<pre className="font-mono text-[11.5px] leading-[1.6] wrap-anywhere whitespace-pre-wrap text-white/80">
|
||||
<code>
|
||||
<span className="select-none text-accent-text">$ </span>
|
||||
<span className="text-white">curl</span> <span className="text-sky-300/90">-X POST</span>{" "}
|
||||
<span className="text-emerald-300/90">
|
||||
https://hub.paseo.sh/webhooks/
|
||||
<wbr />
|
||||
{WEBHOOK_ID}
|
||||
</span>{" "}
|
||||
<span className="text-white/35">\</span>
|
||||
{"\n"}
|
||||
{" "}
|
||||
<span className="text-sky-300/90">-H</span>{" "}
|
||||
<span className="text-amber-200/85">
|
||||
"Authorization: Bearer $WEBHOOK_TOKEN"
|
||||
</span>{" "}
|
||||
<span className="text-white/35">\</span>
|
||||
{"\n"}
|
||||
{" "}
|
||||
<span className="text-sky-300/90">-H</span>{" "}
|
||||
<span className="text-amber-200/85">"Content-Type: application/json"</span>{" "}
|
||||
<span className="text-white/35">\</span>
|
||||
{"\n"}
|
||||
{" "}
|
||||
<span className="text-sky-300/90">-d</span>{" "}
|
||||
<span className="text-white/75">
|
||||
'{"error":"ECONNRESET"}'
|
||||
</span>
|
||||
</code>
|
||||
</pre>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function WebhookResponseBlock() {
|
||||
return (
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.response}
|
||||
className="rounded-lg border border-brand-green/35 bg-brand-green/[0.08] px-3 py-2 font-mono text-[11.5px] leading-[1.55]"
|
||||
>
|
||||
<div className="flex items-center gap-2 text-[#6CB17B]">
|
||||
<span className="font-semibold">HTTP/2 202 Accepted</span>
|
||||
<span className="text-white/35">·</span>
|
||||
<span className="text-white/55">42ms</span>
|
||||
</div>
|
||||
<div className="mt-0.5 wrap-anywhere text-white/80">{ACCEPTED_RESPONSE}</div>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
|
||||
function WebhookRunCard() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<MockupStep
|
||||
delay={STEP_DELAYS.runCard}
|
||||
className="rounded-lg border border-white/[0.09] bg-[#141B19] p-3.5"
|
||||
>
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 border-b border-white/[0.07] pb-2.5">
|
||||
<div className="flex items-center gap-2">
|
||||
<PaseoBotAvatar size="sm" />
|
||||
<div>
|
||||
<div className="flex items-center gap-1.5 text-[12.5px]">
|
||||
<span className="font-semibold text-white/95">paseo-bot</span>
|
||||
<span className="font-mono text-[11px] text-white/45">{RUN_ID.slice(0, 8)}…</span>
|
||||
</div>
|
||||
<p className="text-[11px] text-white/55">{t("hub.demo.webhooks.runMeta")}</p>
|
||||
</div>
|
||||
</div>
|
||||
<span className="inline-flex items-center gap-1.5 rounded-full border border-brand-green/50 bg-brand-green/20 px-2 py-0.5 text-[10.5px] font-medium text-accent-text">
|
||||
<span className="h-1.5 w-1.5 rounded-full bg-[#35C264]" />
|
||||
{t("hub.demo.webhooks.statusDone")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul className="mt-2.5 space-y-1.5 text-[12px] text-white/75">
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-text" aria-hidden="true" />
|
||||
<span>
|
||||
<Trans i18nKey="hub.demo.webhooks.trace1" components={WEBHOOK_COMPONENTS} />
|
||||
</span>
|
||||
</li>
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-text" aria-hidden="true" />
|
||||
<span>
|
||||
<Trans i18nKey="hub.demo.webhooks.trace2" components={WEBHOOK_COMPONENTS} />
|
||||
</span>
|
||||
</li>
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-text" aria-hidden="true" />
|
||||
<span>
|
||||
<Trans i18nKey="hub.demo.webhooks.trace3" components={WEBHOOK_COMPONENTS} />
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div className="mt-3 flex flex-wrap items-center justify-between gap-2 border-t border-white/[0.07] pt-2.5">
|
||||
<OpenInPaseoChip variant="brand" />
|
||||
<span className="font-mono text-[11px] text-white/45">
|
||||
{t("hub.demo.webhooks.triggeredBy")}
|
||||
</span>
|
||||
</div>
|
||||
</MockupStep>
|
||||
);
|
||||
}
|
||||
@@ -1,245 +0,0 @@
|
||||
import { ArrowDown, ArrowRight, Clock, Webhook } from "lucide-react";
|
||||
import type * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ClaudeCodeIcon, CodexIcon, OpenCodeIcon } from "~/components/agent-icons";
|
||||
import { DiscordIcon, GitHubIcon, LinearIcon, SlackIcon } from "~/components/brand-icons";
|
||||
import { HubLockup, PaseoMark } from "~/components/paseo-brand";
|
||||
|
||||
export type HubTriggerSourceId =
|
||||
| "github"
|
||||
| "linear"
|
||||
| "slack"
|
||||
| "discord"
|
||||
| "schedules"
|
||||
| "webhooks";
|
||||
|
||||
export interface HubTriggerSource {
|
||||
id: HubTriggerSourceId;
|
||||
Icon: React.ComponentType<{ className?: string }>;
|
||||
}
|
||||
|
||||
/** The six automation sources Hub accepts, shared by the homepage and /hub. */
|
||||
export const HUB_TRIGGER_SOURCES: readonly HubTriggerSource[] = [
|
||||
{ id: "github", Icon: GitHubIcon },
|
||||
{ id: "linear", Icon: LinearIcon },
|
||||
{ id: "slack", Icon: SlackIcon },
|
||||
{ id: "discord", Icon: DiscordIcon },
|
||||
{ id: "schedules", Icon: Clock },
|
||||
{ id: "webhooks", Icon: Webhook },
|
||||
] as const;
|
||||
|
||||
/** Examples of agent harnesses on connected daemons. */
|
||||
export const HUB_AGENT_HARNESSES = [
|
||||
{ name: "Claude Code", Icon: ClaudeCodeIcon },
|
||||
{ name: "Codex", Icon: CodexIcon },
|
||||
{ name: "OpenCode", Icon: OpenCodeIcon },
|
||||
] as const;
|
||||
|
||||
const DIAGRAM_DAEMONS = [
|
||||
{ name: "MacBook Pro", agents: HUB_AGENT_HARNESSES },
|
||||
{ name: "Hetzner VM", agents: HUB_AGENT_HARNESSES },
|
||||
] as const;
|
||||
|
||||
const DIAGRAM_CLIENTS = ["desktop", "web", "mobile", "cli"] as const;
|
||||
|
||||
/** Compact flow diagram for the homepage Paseo Hub section, sitting directly on the page background. */
|
||||
export function HubLandingFlow() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="grid items-center gap-5 lg:grid-cols-[minmax(0,1fr)_auto_minmax(0,12rem)_auto_minmax(0,1fr)]">
|
||||
<div className="space-y-2.5">
|
||||
<p className="text-[11px] uppercase tracking-wide text-white/35">
|
||||
{t("landing.hubSection.flowTriggers")}
|
||||
</p>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{HUB_TRIGGER_SOURCES.map(({ id, Icon }) => (
|
||||
<div
|
||||
key={id}
|
||||
className="flex items-center gap-2 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-2"
|
||||
>
|
||||
<Icon className="h-3.5 w-3.5 shrink-0 text-white/70" />
|
||||
<span className="truncate text-xs font-medium text-white/85">
|
||||
{t(`hub.sources.${id}.name`)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FlowArrow />
|
||||
|
||||
<div className="rounded-xl border border-brand-green/50 bg-brand-green/[0.12] px-5 py-5 text-center">
|
||||
<p className="flex justify-center">
|
||||
<HubLockup className="h-5 w-auto text-foreground" />
|
||||
<span className="sr-only">{t("hub.shape.hub")}</span>
|
||||
</p>
|
||||
<p className="mt-2 text-xs text-white/70">{t("hub.shape.hubHosting")}</p>
|
||||
</div>
|
||||
|
||||
<FlowArrow />
|
||||
|
||||
<div className="space-y-2.5">
|
||||
<p className="text-[11px] uppercase tracking-wide text-white/35">
|
||||
{t("landing.hubSection.flowDaemons")}
|
||||
</p>
|
||||
<div className="space-y-2">
|
||||
{DIAGRAM_DAEMONS.map((daemon) => (
|
||||
<CompactDaemonRow key={daemon.name} name={daemon.name} agents={daemon.agents} />
|
||||
))}
|
||||
<div className="flex items-center gap-2 rounded-lg border border-dashed border-white/10 bg-white/[0.015] px-3 py-2 text-xs text-white/60">
|
||||
<PaseoMark className="h-3.5 w-3.5 shrink-0 text-white/75" />
|
||||
<span className="truncate">{t("landing.hubSection.flowOpenSession")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function CompactDaemonRow({
|
||||
name,
|
||||
agents,
|
||||
}: {
|
||||
name: string;
|
||||
agents: readonly { name: string; Icon: React.ComponentType<{ className?: string }> }[];
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-center justify-between gap-2 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-2">
|
||||
<span className="flex min-w-0 items-center gap-2">
|
||||
<MachineIcon className="h-4 w-4 shrink-0 text-white/60" />
|
||||
<span className="truncate text-xs font-medium text-white/85">{name}</span>
|
||||
</span>
|
||||
<span className="flex shrink-0 items-center gap-1.5 text-white/45">
|
||||
{agents.map(({ name: agentName, Icon }) => (
|
||||
<span key={agentName} title={agentName}>
|
||||
<Icon className="h-3.5 w-3.5" />
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Full vertical infrastructure diagram for the /hub page. */
|
||||
export function HubArchitectureDiagram() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="rounded-xl border border-white/[0.08] bg-white/[0.015] p-6 md:p-8">
|
||||
<div className="flex flex-col items-center">
|
||||
<DiagramRow label={t("hub.shape.triggersRow")}>
|
||||
{HUB_TRIGGER_SOURCES.map(({ id, Icon }) => (
|
||||
<DiagramCard key={id} Icon={Icon} name={t(`hub.sources.${id}.name`)} />
|
||||
))}
|
||||
</DiagramRow>
|
||||
|
||||
<Connector label={t("hub.shape.webhooks")} />
|
||||
|
||||
<div className="w-full max-w-xs rounded-xl border border-brand-green/50 bg-brand-green/[0.12] px-6 py-5 text-center">
|
||||
<p className="flex justify-center">
|
||||
<HubLockup className="h-[22px] w-auto text-foreground" />
|
||||
<span className="sr-only">{t("hub.shape.hub")}</span>
|
||||
</p>
|
||||
<p className="mt-1.5 text-xs text-white/70">{t("hub.shape.hubHosting")}</p>
|
||||
</div>
|
||||
|
||||
<Connector label={t("hub.shape.sameRpcs")} />
|
||||
|
||||
<DiagramRow label={t("hub.shape.daemonsRow")}>
|
||||
{DIAGRAM_DAEMONS.map((daemon) => (
|
||||
<div
|
||||
key={daemon.name}
|
||||
className="flex items-center gap-3 rounded-xl border border-white/10 bg-white/[0.03] px-4 py-3"
|
||||
>
|
||||
<span className="text-white/70">
|
||||
<MachineIcon className="h-5 w-5" />
|
||||
</span>
|
||||
<span className="text-sm font-medium">{daemon.name}</span>
|
||||
<span className="flex items-center gap-2 border-l border-white/10 pl-3 text-white/45">
|
||||
{daemon.agents.map(({ name, Icon }) => (
|
||||
<span key={name} title={name}>
|
||||
<Icon className="h-4 w-4" />
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</DiagramRow>
|
||||
|
||||
<Connector label={t("hub.shape.directOrRelay")} />
|
||||
|
||||
<DiagramRow label={t("hub.shape.appsRow")}>
|
||||
{DIAGRAM_CLIENTS.map((client) => (
|
||||
<DiagramCard key={client} name={t(`hub.shape.${client}`)} />
|
||||
))}
|
||||
</DiagramRow>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function FlowArrow() {
|
||||
return (
|
||||
<div className="flex items-center justify-center text-white/30" aria-hidden="true">
|
||||
<ArrowRight className="hidden h-4 w-4 lg:block" />
|
||||
<ArrowDown className="h-4 w-4 lg:hidden" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiagramRow({ label, children }: { label: string; children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="w-full space-y-2.5">
|
||||
<p className="text-center text-xs uppercase tracking-wide text-white/30">{label}</p>
|
||||
<div className="flex flex-wrap justify-center gap-2.5">{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function DiagramCard({
|
||||
name,
|
||||
Icon,
|
||||
}: {
|
||||
name: string;
|
||||
Icon?: React.ComponentType<{ className?: string }>;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-center gap-2 rounded-xl border border-white/10 bg-white/[0.03] px-3.5 py-2.5">
|
||||
{Icon ? (
|
||||
<span className="text-white/70">
|
||||
<Icon className="h-4 w-4" />
|
||||
</span>
|
||||
) : null}
|
||||
<span className="text-sm font-medium">{name}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Connector({ label }: { label: string }) {
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-2 py-4">
|
||||
<div className="h-5 w-px border-l border-dashed border-white/25" />
|
||||
<p className="text-center text-[11px] text-white/35">{label}</p>
|
||||
<div className="h-5 w-px border-l border-dashed border-white/25" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function MachineIcon({ className }: { className?: string }) {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
aria-hidden="true"
|
||||
className={className}
|
||||
>
|
||||
<rect x="2" y="2" width="20" height="8" rx="2" />
|
||||
<rect x="2" y="14" width="20" height="8" rx="2" />
|
||||
<circle cx="6" cy="6" r="1" />
|
||||
<circle cx="6" cy="18" r="1" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -88,15 +88,8 @@ import {
|
||||
OpenCodeIcon,
|
||||
PiIcon,
|
||||
} from "~/components/agent-icons";
|
||||
import { HubLandingFlow } from "~/components/hub-flow";
|
||||
import {
|
||||
ChapterBand,
|
||||
ChapterDivider,
|
||||
HairlineGrid,
|
||||
PageHeaderBand,
|
||||
SectionOpener,
|
||||
} from "~/components/page-frame";
|
||||
import { PaseoHubLockup, PaseoHubMark, PaseoMark } from "~/components/paseo-brand";
|
||||
import { DiscordIcon, GitHubIcon, SlackIcon } from "~/components/brand-icons";
|
||||
import { PaseoHubMark } from "~/components/paseo-brand";
|
||||
import {
|
||||
MobileChat,
|
||||
MobileDiff,
|
||||
@@ -107,146 +100,78 @@ import {
|
||||
} from "~/components/mockup";
|
||||
import { FAQItem } from "~/components/faq-item";
|
||||
import { SiteFooter } from "~/components/site-footer";
|
||||
import { HomepageSponsorsSection } from "~/components/sponsorship";
|
||||
import { SponsorSection, SponsorsSection } from "~/components/sponsorship";
|
||||
import { SiteHeader } from "~/components/site-header";
|
||||
import "~/styles.css";
|
||||
|
||||
interface LandingPageProps {
|
||||
title: React.ReactNode;
|
||||
subtitle: React.ReactNode;
|
||||
pluginCount?: number | null;
|
||||
showHubEyebrow?: boolean;
|
||||
}
|
||||
|
||||
export function LandingPage({
|
||||
title,
|
||||
subtitle,
|
||||
pluginCount = null,
|
||||
showHubEyebrow = false,
|
||||
}: LandingPageProps) {
|
||||
export function LandingPage({ title, subtitle }: LandingPageProps) {
|
||||
return (
|
||||
<CursorFieldProvider>
|
||||
<div className="min-h-screen bg-background">
|
||||
<PageHeaderBand />
|
||||
{/* Hero section with background image */}
|
||||
<div className="relative bg-cover bg-center bg-no-repeat">
|
||||
<div className="relative px-6 pt-4 pb-10 md:px-32 md:pt-6 md:pb-12 max-w-7xl mx-auto">
|
||||
<Nav />
|
||||
<Hero title={title} subtitle={subtitle} />
|
||||
<GetStarted />
|
||||
</div>
|
||||
|
||||
<main>
|
||||
{/* Opening bookend: centered hero, interactive desktop mockup, and phone trio */}
|
||||
<ChapterBand spacing="none" ruled={false} ticks={false} framed={false}>
|
||||
<div className="pt-12 pb-8 md:pt-16 md:pb-10">
|
||||
<Hero title={title} subtitle={subtitle} showHubEyebrow={showHubEyebrow} />
|
||||
<GetStarted />
|
||||
</div>
|
||||
{/* Mockup - inside hero so it's above the gradient, positioned to overflow into black section */}
|
||||
<motion.div
|
||||
initial={FADE_IN_UP_40}
|
||||
animate={FADE_IN}
|
||||
transition={EASE_OUT_08_DELAY_05}
|
||||
className="relative px-6 md:px-8 pt-4 md:pt-8 pb-8 md:pb-16"
|
||||
>
|
||||
<div className="max-w-7xl mx-auto">
|
||||
<HeroMockup />
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
<motion.div
|
||||
initial={FADE_IN_UP_40}
|
||||
animate={FADE_IN}
|
||||
transition={EASE_OUT_08_DELAY_05}
|
||||
className="relative pt-4 pb-10 md:pt-6 md:pb-14"
|
||||
>
|
||||
<div>
|
||||
<HeroMockup />
|
||||
</div>
|
||||
</motion.div>
|
||||
{/* Phone showcase */}
|
||||
<PhoneShowcase />
|
||||
|
||||
<PhoneShowcase />
|
||||
</ChapterBand>
|
||||
|
||||
{/* Chapter 1: Community proof */}
|
||||
<ChapterBand spacing="compact">
|
||||
{/* Content section */}
|
||||
<div className="landing-content bg-background">
|
||||
<main className="p-6 md:p-20 md:pt-40 max-w-5xl mx-auto">
|
||||
<div className="space-y-24">
|
||||
<SocialProofWall />
|
||||
</ChapterBand>
|
||||
|
||||
{/* Chapter 2: The product (Providers, Deployment, Extensibility, Automation) */}
|
||||
<ChapterBand spacing="none">
|
||||
<div className="py-16 md:py-20">
|
||||
<MultiProviderSection />
|
||||
</div>
|
||||
<ChapterDivider />
|
||||
<div className="py-16 md:py-20">
|
||||
<TurnkeySection />
|
||||
</div>
|
||||
<ChapterDivider />
|
||||
<div className="py-16 md:py-20">
|
||||
<ExtensibleSection pluginCount={pluginCount} />
|
||||
</div>
|
||||
<ChapterDivider />
|
||||
<div className="py-16 md:py-20">
|
||||
<AutomationSection />
|
||||
</div>
|
||||
</ChapterBand>
|
||||
|
||||
{/* Chapter 3: Paseo Hub */}
|
||||
<ChapterBand spacing="chapter" tint="subtle">
|
||||
<HubSection />
|
||||
</ChapterBand>
|
||||
|
||||
{/* Chapter 4: Open source philosophy and consolidated sponsorship */}
|
||||
<ChapterBand spacing="none">
|
||||
<div className="py-16 md:py-20">
|
||||
<PhilosophySection />
|
||||
</div>
|
||||
<ChapterDivider />
|
||||
<div className="py-16 md:py-20">
|
||||
<HomepageSponsorsSection />
|
||||
</div>
|
||||
</ChapterBand>
|
||||
|
||||
{/* Chapter 5: FAQ */}
|
||||
<ChapterBand spacing="section">
|
||||
<MultiProviderSection />
|
||||
<TurnkeySection />
|
||||
<ExtensibleSection />
|
||||
<AutomationSection />
|
||||
<SponsorsSection placement="page" />
|
||||
<SponsorSection />
|
||||
<PhilosophySection />
|
||||
<FAQ />
|
||||
</ChapterBand>
|
||||
|
||||
{/* Closing bookend: centered download CTA */}
|
||||
<ChapterBand spacing="chapter" tint="subtle">
|
||||
<ClosingCtaSection />
|
||||
</ChapterBand>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<SiteFooter width="default" sponsors={false} />
|
||||
<SiteFooter sponsors={false} />
|
||||
</div>
|
||||
</CursorFieldProvider>
|
||||
);
|
||||
}
|
||||
|
||||
function Hero({
|
||||
title,
|
||||
subtitle,
|
||||
showHubEyebrow = false,
|
||||
}: {
|
||||
title: React.ReactNode;
|
||||
subtitle: React.ReactNode;
|
||||
showHubEyebrow?: boolean;
|
||||
}) {
|
||||
function Nav() {
|
||||
return (
|
||||
<div className="space-y-6 text-center">
|
||||
{showHubEyebrow ? <HubHeroEyebrow /> : null}
|
||||
<h1 className="font-display text-4xl font-semibold tracking-[-0.025em] leading-[1.02] md:text-6xl">
|
||||
{title}
|
||||
</h1>
|
||||
<p className="mx-auto max-w-lg text-base leading-relaxed text-white/70 md:text-lg">
|
||||
{subtitle}
|
||||
</p>
|
||||
</div>
|
||||
<nav className="mb-20 md:mb-24">
|
||||
<SiteHeader />
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
function HubHeroEyebrow() {
|
||||
const { t } = useTranslation();
|
||||
const localize = useLocalizePath();
|
||||
function Hero({ title, subtitle }: { title: React.ReactNode; subtitle: React.ReactNode }) {
|
||||
return (
|
||||
<div className="flex justify-center">
|
||||
<a
|
||||
href={localize("/hub")}
|
||||
className="group inline-flex max-w-full items-center gap-2 whitespace-nowrap rounded-full border border-white/10 bg-white/[0.04] px-3 py-1 text-xs text-white/75 transition-colors hover:border-white/20 hover:bg-white/[0.08] hover:text-white"
|
||||
>
|
||||
<PaseoHubMark className="h-3.5 w-3.5 shrink-0 text-white/90" />
|
||||
<span className="font-medium text-white/90">{t("landing.hubEyebrow.product")}</span>
|
||||
<span aria-hidden="true" className="h-3 w-px shrink-0 bg-white/15" />
|
||||
<span className="truncate text-white/65">{t("landing.hubEyebrow.label")}</span>
|
||||
<ArrowRight
|
||||
aria-hidden="true"
|
||||
className="h-3.5 w-3.5 shrink-0 text-white/45 transition-transform group-hover:translate-x-0.5 group-hover:text-white/80"
|
||||
/>
|
||||
</a>
|
||||
<div className="space-y-6 text-center">
|
||||
<h1 className="text-4xl md:text-6xl font-medium tracking-tight leading-[0.95]">{title}</h1>
|
||||
<p className="text-base leading-relaxed text-white/70 md:text-lg max-w-lg mx-auto">
|
||||
{subtitle}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -376,14 +301,12 @@ function AgentBadge({ name, Icon }: (typeof FEATURED_AGENTS)[number]) {
|
||||
}
|
||||
|
||||
function FeatureSection({
|
||||
eyebrow,
|
||||
title,
|
||||
description,
|
||||
badge,
|
||||
links,
|
||||
children,
|
||||
}: {
|
||||
eyebrow?: string;
|
||||
title: string;
|
||||
description: string;
|
||||
badge?: string;
|
||||
@@ -397,18 +320,54 @@ function FeatureSection({
|
||||
viewport={VIEWPORT_60}
|
||||
transition={EASE_OUT_05}
|
||||
>
|
||||
<SectionOpener
|
||||
eyebrow={eyebrow}
|
||||
title={title}
|
||||
description={description}
|
||||
badge={badge}
|
||||
links={links}
|
||||
/>
|
||||
<SectionTitle title={title} description={description} badge={badge} links={links} />
|
||||
{children}
|
||||
</motion.section>
|
||||
);
|
||||
}
|
||||
|
||||
function SectionTitle({
|
||||
title,
|
||||
description,
|
||||
badge,
|
||||
links,
|
||||
}: {
|
||||
title: string;
|
||||
description: string;
|
||||
badge?: string;
|
||||
links?: ReadonlyArray<{ href: string; label: string }>;
|
||||
}) {
|
||||
return (
|
||||
<div className="mb-12 space-y-2">
|
||||
<div className="flex items-center gap-3">
|
||||
<h2 className="text-3xl font-medium">{title}</h2>
|
||||
{badge && (
|
||||
<span className="rounded-full bg-emerald-400/10 px-2 py-1 text-xs text-emerald-300">
|
||||
{badge}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-base text-pretty text-muted-foreground max-w-lg">{description}</p>
|
||||
{links ? (
|
||||
<div className="flex flex-wrap gap-x-4 gap-y-1 pt-1 text-xs">
|
||||
{links.map((link) => (
|
||||
<a
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 text-extra-muted-foreground transition-colors hover:text-muted-foreground"
|
||||
>
|
||||
{link.label}
|
||||
<ExternalLink className="h-3 w-3" />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SocialProofWall() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
@@ -418,7 +377,7 @@ function SocialProofWall() {
|
||||
viewport={VIEWPORT_60}
|
||||
transition={EASE_OUT_05}
|
||||
>
|
||||
<SectionOpener
|
||||
<SectionTitle
|
||||
title={t("landing.socialProof.title")}
|
||||
description={t("landing.socialProof.description")}
|
||||
/>
|
||||
@@ -465,7 +424,7 @@ function SocialProofCard({ tweet, inert }: { tweet: SocialProofTweet; inert?: bo
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
tabIndex={inert ? -1 : undefined}
|
||||
className="group flex h-[154px] w-[300px] shrink-0 flex-col justify-between overflow-hidden rounded-xl border border-white/[0.08] bg-white/[0.02] p-4 transition-colors hover:border-white/20 hover:bg-white/[0.04] md:w-[380px]"
|
||||
className="group flex h-[154px] w-[320px] shrink-0 flex-col justify-between overflow-hidden rounded-2xl border border-white/10 bg-white/[0.03] p-4 transition-colors hover:border-white/20 hover:bg-white/[0.05] md:w-[420px]"
|
||||
aria-label={t("landing.socialProof.readPost", { name: tweet.name })}
|
||||
>
|
||||
<div>
|
||||
@@ -494,34 +453,30 @@ function MultiProviderSection() {
|
||||
const localize = useLocalizePath();
|
||||
return (
|
||||
<FeatureSection
|
||||
eyebrow={t("landing.eyebrows.providers")}
|
||||
title={t("landing.providers.title")}
|
||||
description={t("landing.providers.description")}
|
||||
>
|
||||
<HairlineGrid columns="2-3">
|
||||
<div className="grid grid-cols-2 gap-2 sm:grid-cols-3 sm:gap-4">
|
||||
{FEATURED_AGENTS.map((agent) => (
|
||||
<div
|
||||
key={agent.name}
|
||||
className="flex items-center gap-3 bg-background px-5 py-4 transition-colors hover:bg-white/[0.025] sm:px-6 sm:py-5"
|
||||
className="flex items-center justify-center gap-2 rounded-xl border border-white/10 bg-white/[0.03] px-3 py-3 sm:gap-3 sm:px-5 sm:py-4"
|
||||
>
|
||||
<span className="shrink-0 text-white/80">
|
||||
<agent.Icon className="h-5 w-5 sm:h-6 sm:w-6" />
|
||||
</span>
|
||||
<span className="truncate text-sm font-medium text-white/90 sm:text-base">
|
||||
{agent.name}
|
||||
<agent.Icon className="h-5 w-5 sm:h-7 sm:w-7" />
|
||||
</span>
|
||||
<span className="truncate text-sm font-medium sm:text-base">{agent.name}</span>
|
||||
</div>
|
||||
))}
|
||||
<a
|
||||
href={localize("/agents")}
|
||||
className="flex items-center justify-between gap-2 bg-background px-5 py-4 text-white/55 transition-colors hover:bg-white/[0.025] hover:text-accent-text sm:px-6 sm:py-5"
|
||||
className="flex items-center justify-center gap-2 rounded-xl border border-dashed border-white/10 bg-white/[0.01] px-3 py-3 text-white/50 hover:text-white/80 hover:border-white/20 hover:bg-white/[0.03] transition-colors sm:gap-3 sm:px-5 sm:py-4"
|
||||
>
|
||||
<span className="text-sm font-medium sm:text-base">
|
||||
{t("common.more", { count: ADDITIONAL_AGENT_COUNT })}
|
||||
</span>
|
||||
<ArrowRight className="h-4 w-4 shrink-0" aria-hidden="true" />
|
||||
</a>
|
||||
</HairlineGrid>
|
||||
</div>
|
||||
</FeatureSection>
|
||||
);
|
||||
}
|
||||
@@ -534,15 +489,13 @@ function TurnkeySection() {
|
||||
title={t("landing.runAnywhere.title")}
|
||||
description={t("landing.runAnywhere.description")}
|
||||
>
|
||||
<div className="overflow-hidden rounded-xl border border-white/[0.08] bg-white/[0.08]">
|
||||
<div className="bg-background p-6 md:p-7">
|
||||
<ProductLead
|
||||
icon={Monitor}
|
||||
title={t("landing.runAnywhere.desktopTitle")}
|
||||
description={t("landing.runAnywhere.desktopDescription")}
|
||||
/>
|
||||
</div>
|
||||
<div className="grid gap-px border-t border-white/[0.08] md:grid-cols-3">
|
||||
<div className="space-y-8">
|
||||
<ProductLead
|
||||
icon={Monitor}
|
||||
title={t("landing.runAnywhere.desktopTitle")}
|
||||
description={t("landing.runAnywhere.desktopDescription")}
|
||||
/>
|
||||
<div className="grid gap-4 md:grid-cols-3">
|
||||
<TurnkeyExtensionCard
|
||||
icon={Smartphone}
|
||||
title={t("landing.runAnywhere.mobileTitle")}
|
||||
@@ -564,6 +517,7 @@ function TurnkeySection() {
|
||||
ctaHref={localize("/hub")}
|
||||
ctaLabel={t("landing.runAnywhere.teamsCta")}
|
||||
ctaIcon={PASEO_HUB_CTA_ICON}
|
||||
showIntegrationIcons
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -580,6 +534,7 @@ function TurnkeyExtensionCard({
|
||||
ctaHref,
|
||||
ctaLabel,
|
||||
ctaIcon,
|
||||
showIntegrationIcons = false,
|
||||
}: {
|
||||
icon: LucideIcon;
|
||||
title: string;
|
||||
@@ -587,22 +542,34 @@ function TurnkeyExtensionCard({
|
||||
ctaHref: string;
|
||||
ctaLabel: string;
|
||||
ctaIcon?: React.ReactNode;
|
||||
showIntegrationIcons?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<FeatureCell icon={Icon} title={title} description={description}>
|
||||
<a
|
||||
href={ctaHref}
|
||||
className="inline-flex items-center gap-1.5 rounded-full bg-foreground px-3 py-1.5 text-xs font-medium text-background transition-colors hover:bg-foreground/90"
|
||||
>
|
||||
{ctaIcon}
|
||||
{ctaLabel}
|
||||
<ArrowRight className="h-3.5 w-3.5" />
|
||||
</a>
|
||||
</FeatureCell>
|
||||
<FeatureCard icon={Icon} title={title} description={description}>
|
||||
<div className="flex items-center justify-between">
|
||||
<a
|
||||
href={ctaHref}
|
||||
className="inline-flex items-center gap-1.5 rounded-full bg-foreground px-2.5 py-1.5 text-xs text-background transition-colors hover:bg-foreground/90"
|
||||
>
|
||||
{ctaIcon}
|
||||
{ctaLabel}
|
||||
<ArrowRight className="h-3.5 w-3.5" />
|
||||
</a>
|
||||
{showIntegrationIcons ? INTEGRATION_ICONS : null}
|
||||
</div>
|
||||
</FeatureCard>
|
||||
);
|
||||
}
|
||||
|
||||
/** The lead product of a section: an icon tile and title. */
|
||||
const INTEGRATION_ICONS = (
|
||||
<span className="flex items-center gap-2 text-extra-muted-foreground">
|
||||
<GitHubIcon className="h-4 w-4" />
|
||||
<SlackIcon className="h-4 w-4" />
|
||||
<DiscordIcon className="h-4 w-4" />
|
||||
</span>
|
||||
);
|
||||
|
||||
/** The lead product of a section: an icon tile and title on the page background. */
|
||||
function ProductLead({
|
||||
icon: Icon,
|
||||
title,
|
||||
@@ -617,13 +584,13 @@ function ProductLead({
|
||||
return (
|
||||
<div className="flex flex-col gap-6 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="rounded-lg border border-white/[0.08] bg-white/[0.04] p-3 text-accent-text">
|
||||
<Icon className="h-5 w-5" strokeWidth={1.5} />
|
||||
<div className="rounded-xl border border-white/10 bg-white/[0.06] p-3 text-muted-foreground">
|
||||
<Icon className="h-6 w-6" strokeWidth={1.5} />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h3 className="text-lg font-medium text-white/95">{title}</h3>
|
||||
<h3 className="text-xl font-medium text-white/90">{title}</h3>
|
||||
{description ? (
|
||||
<p className="text-sm leading-relaxed text-white/55">{description}</p>
|
||||
<p className="text-sm leading-relaxed text-white/50">{description}</p>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
@@ -632,8 +599,8 @@ function ProductLead({
|
||||
);
|
||||
}
|
||||
|
||||
/** A hairline grid cell: icon and title on one line, the blurb below, an optional action last. */
|
||||
function FeatureCell({
|
||||
/** A small card: icon and title on one line, the blurb below, an optional action last. */
|
||||
function FeatureCard({
|
||||
icon: Icon,
|
||||
title,
|
||||
description,
|
||||
@@ -645,12 +612,12 @@ function FeatureCell({
|
||||
children?: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex flex-col bg-background p-6">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<Icon className="h-4 w-4 shrink-0 text-accent-text" strokeWidth={1.5} />
|
||||
<h3 className="text-sm font-medium text-white/90">{title}</h3>
|
||||
<div className="flex flex-col rounded-xl border border-white/10 bg-white/[0.025] p-5">
|
||||
<div className="flex items-center gap-3">
|
||||
<Icon className="h-5 w-5 shrink-0 text-extra-muted-foreground" strokeWidth={1.5} />
|
||||
<h3 className="font-medium text-white/85">{title}</h3>
|
||||
</div>
|
||||
<p className="mt-2.5 text-sm leading-relaxed text-white/55">{description}</p>
|
||||
<p className="mt-3 text-sm leading-relaxed text-white/45">{description}</p>
|
||||
{children ? <div className="mt-auto pt-5">{children}</div> : null}
|
||||
</div>
|
||||
);
|
||||
@@ -687,11 +654,8 @@ function AutomationSection() {
|
||||
description={t("landing.automation.description")}
|
||||
links={links}
|
||||
>
|
||||
<div className="grid gap-px overflow-hidden rounded-xl border border-white/[0.08] bg-white/[0.08] md:grid-cols-[15rem_minmax(0,1fr)]">
|
||||
<div
|
||||
className="grid grid-cols-3 gap-px bg-white/[0.08] md:grid-cols-1 md:content-start md:bg-background"
|
||||
role="tablist"
|
||||
>
|
||||
<div className="grid gap-4 md:grid-cols-[14rem_minmax(0,1fr)]">
|
||||
<div className="grid self-start gap-2" role="tablist">
|
||||
{AUTOMATION_OPTIONS.map((option) => (
|
||||
<AutomationSelector
|
||||
key={option.kind}
|
||||
@@ -726,22 +690,17 @@ function AutomationSelector({
|
||||
role="tab"
|
||||
aria-selected={active}
|
||||
onClick={handleClick}
|
||||
className={`cursor-pointer border-b-2 p-3.5 text-left transition-colors md:border-b md:border-b-white/[0.07] md:border-l-2 md:p-5 ${
|
||||
className={`flex items-center gap-3 rounded-xl border p-3 text-left transition-colors md:block md:p-4 ${
|
||||
active
|
||||
? "border-b-brand-green bg-white/[0.045] md:border-l-brand-green"
|
||||
: "border-b-transparent bg-background hover:bg-white/[0.025] md:border-l-transparent"
|
||||
? "border-white/20 bg-white/[0.07]"
|
||||
: "border-white/10 bg-white/[0.025] hover:border-white/15 hover:bg-white/[0.04]"
|
||||
}`}
|
||||
>
|
||||
<div className="flex shrink-0 items-center gap-2 font-mono md:mb-1.5">
|
||||
<Icon
|
||||
className={`h-3.5 w-3.5 ${active ? "text-accent-text" : "text-muted-foreground"}`}
|
||||
strokeWidth={1.5}
|
||||
/>
|
||||
<span className={`text-[11px] ${active ? "text-accent-text" : "text-muted-foreground"}`}>
|
||||
{option.label}
|
||||
</span>
|
||||
<div className="flex shrink-0 items-center gap-2 text-muted-foreground md:mb-1">
|
||||
<Icon className="h-3 w-3" strokeWidth={1.5} />
|
||||
<span className="text-[10px]">{option.label}</span>
|
||||
</div>
|
||||
<p className="mt-1 text-xs leading-snug text-white/85 md:mt-0 md:text-sm">
|
||||
<p className="text-xs leading-snug text-white/85 md:text-sm">
|
||||
{t(`landing.automation.${option.kind}Caption`)}
|
||||
</p>
|
||||
</button>
|
||||
@@ -752,7 +711,7 @@ function AutomationDetail({ kind }: { kind: AutomationKind }) {
|
||||
return (
|
||||
<div
|
||||
role="tabpanel"
|
||||
className="min-h-80 min-w-0 overflow-hidden bg-[#0c1110] p-5 md:h-[26rem] md:p-6"
|
||||
className="min-h-80 min-w-0 overflow-hidden rounded-xl border border-white/10 bg-black/20 p-5 md:h-[26rem] md:p-6"
|
||||
>
|
||||
{kind === "mcp" ? <McpAutomationTranscript /> : null}
|
||||
{kind === "cli" ? <CliAutomationExample /> : null}
|
||||
@@ -901,82 +860,37 @@ function SdkAutomationExample() {
|
||||
);
|
||||
}
|
||||
|
||||
function HubSection() {
|
||||
const { t } = useTranslation();
|
||||
const localize = useLocalizePath();
|
||||
return (
|
||||
<motion.section
|
||||
initial={FADE_IN_UP}
|
||||
whileInView={FADE_IN}
|
||||
viewport={VIEWPORT_60}
|
||||
transition={EASE_OUT_05}
|
||||
aria-labelledby="hub-section-heading"
|
||||
>
|
||||
<div className="mb-10 space-y-3 md:mb-12">
|
||||
<h2 id="hub-section-heading">
|
||||
<PaseoHubLockup size="display" className="h-9 w-auto text-foreground md:h-11" />
|
||||
<span className="sr-only">{t("hub.title")}</span>
|
||||
</h2>
|
||||
<p className="max-w-xl text-base text-pretty text-muted-foreground">
|
||||
{t("landing.hubSection.description")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-8">
|
||||
<HubLandingFlow />
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3">
|
||||
<a href={localize("/hub")} className={PRIMARY_CTA_CLASS}>
|
||||
{t("landing.hubSection.exploreCta")}
|
||||
<ArrowRight className="h-4 w-4" aria-hidden="true" />
|
||||
</a>
|
||||
<a href={localize("/docs/hub")} className={SECONDARY_CTA_CLASS}>
|
||||
{t("landing.hubSection.docsCta")}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</motion.section>
|
||||
);
|
||||
}
|
||||
|
||||
function ExtensibleSection({ pluginCount }: { pluginCount?: number | null }) {
|
||||
function ExtensibleSection() {
|
||||
const { t } = useTranslation();
|
||||
const pluginActions = React.useMemo(() => <PluginActions />, []);
|
||||
const libraryTitle =
|
||||
pluginCount && pluginCount > 0
|
||||
? t("landing.plugins.libraryTitleCount", { count: pluginCount })
|
||||
: t("landing.plugins.libraryTitle");
|
||||
return (
|
||||
<FeatureSection
|
||||
eyebrow={t("landing.eyebrows.plugins")}
|
||||
title={t("landing.plugins.title")}
|
||||
description={t("landing.plugins.description")}
|
||||
>
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-12">
|
||||
<SelfModifyDemo />
|
||||
<div className="overflow-hidden rounded-xl border border-white/[0.08] bg-white/[0.08]">
|
||||
<div className="space-y-5 bg-background p-6">
|
||||
<ProductLead
|
||||
icon={Puzzle}
|
||||
title={libraryTitle}
|
||||
description={t("landing.plugins.libraryDescription")}
|
||||
actions={pluginActions}
|
||||
/>
|
||||
<PluginCategoryLinks />
|
||||
</div>
|
||||
<div className="flex flex-col gap-3 border-t border-white/[0.08] bg-background px-6 py-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<p className="text-sm text-white/50">{t("landing.plugins.license")}</p>
|
||||
<a
|
||||
href="https://github.com/getpaseo/paseo"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex shrink-0 items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-accent-text"
|
||||
>
|
||||
<GitFork className="h-4 w-4" strokeWidth={1.5} />
|
||||
{t("landing.plugins.fork")}
|
||||
<ExternalLink className="h-3.5 w-3.5 opacity-70" />
|
||||
</a>
|
||||
</div>
|
||||
<div className="space-y-6">
|
||||
<ProductLead
|
||||
icon={Puzzle}
|
||||
title={t("landing.plugins.libraryTitle")}
|
||||
description={t("landing.plugins.libraryDescription")}
|
||||
actions={pluginActions}
|
||||
/>
|
||||
<PluginCategoryLinks />
|
||||
</div>
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<p className="text-sm text-white/45">{t("landing.plugins.license")}</p>
|
||||
<a
|
||||
href="https://github.com/getpaseo/paseo"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex shrink-0 items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground"
|
||||
>
|
||||
<GitFork className="h-4 w-4" strokeWidth={1.5} />
|
||||
{t("landing.plugins.fork")}
|
||||
<ExternalLink className="h-3.5 w-3.5 opacity-70" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</FeatureSection>
|
||||
@@ -1042,7 +956,7 @@ function SelfModifyDemo() {
|
||||
initial={reduceMotion ? "shown" : "hidden"}
|
||||
whileInView="shown"
|
||||
viewport={VIEWPORT_60}
|
||||
className="grid min-h-[22rem] grid-cols-[minmax(0,1fr)] overflow-hidden rounded-xl border border-white/[0.08] bg-[#0c1110] md:grid-cols-[minmax(0,1fr)_17rem]"
|
||||
className="grid min-h-[22rem] grid-cols-[minmax(0,1fr)] overflow-hidden rounded-xl border border-white/10 bg-black/20 md:grid-cols-[minmax(0,1fr)_17rem]"
|
||||
>
|
||||
<div className="space-y-5 p-5 md:p-6">
|
||||
<DemoItem step={DEMO_STEPS.prompt}>
|
||||
@@ -1173,50 +1087,43 @@ function PhilosophySection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<FeatureSection
|
||||
eyebrow={t("landing.eyebrows.openSource")}
|
||||
title={t("landing.philosophy.title")}
|
||||
description={t("landing.philosophy.description")}
|
||||
>
|
||||
<HairlineGrid columns="3">
|
||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{PRINCIPLES.map((principle) => (
|
||||
<FeatureCell
|
||||
<FeatureCard
|
||||
key={principle.key}
|
||||
icon={principle.icon}
|
||||
title={t(`landing.philosophy.${principle.key}Title`)}
|
||||
description={t(`landing.philosophy.${principle.key}Description`)}
|
||||
/>
|
||||
))}
|
||||
</HairlineGrid>
|
||||
</FeatureSection>
|
||||
);
|
||||
}
|
||||
|
||||
function DownloadActions() {
|
||||
const platform = useVisitorPlatform();
|
||||
return (
|
||||
<div className="mx-auto flex flex-col items-center gap-3 sm:flex-row sm:justify-center">
|
||||
{isMobilePlatform(platform) ? (
|
||||
<StoreButton platform={platform} />
|
||||
) : (
|
||||
<DesktopDownloadButton platform={platform} />
|
||||
)}
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
{isMobilePlatform(platform) ? <DesktopAppLink /> : <StoreIconLinks />}
|
||||
<ServerInstallButton />
|
||||
</div>
|
||||
</div>
|
||||
</FeatureSection>
|
||||
);
|
||||
}
|
||||
|
||||
function GetStarted() {
|
||||
const { t } = useTranslation();
|
||||
const localize = useLocalizePath();
|
||||
const platform = useVisitorPlatform();
|
||||
return (
|
||||
<div className="pt-8">
|
||||
<div className="pt-10">
|
||||
{/* The primary call to action owns its own row on phones so the small icon
|
||||
buttons never wrap and orphan one of themselves onto a line alone. It
|
||||
still hugs its label rather than stretching across the row. */}
|
||||
<DownloadActions />
|
||||
<div className="mx-auto flex flex-col items-center gap-3 sm:flex-row sm:justify-center">
|
||||
{isMobilePlatform(platform) ? (
|
||||
<StoreButton platform={platform} />
|
||||
) : (
|
||||
<DesktopDownloadButton platform={platform} />
|
||||
)}
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
{isMobilePlatform(platform) ? <DesktopAppLink /> : <StoreIconLinks />}
|
||||
<ServerInstallButton />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center justify-center gap-x-2 gap-y-1 pt-6">
|
||||
<span className="text-xs text-muted-foreground">{t("landing.getStarted.supports")}</span>
|
||||
<div className="flex items-center gap-1">
|
||||
@@ -1226,7 +1133,7 @@ function GetStarted() {
|
||||
</div>
|
||||
<a
|
||||
href={localize("/agents")}
|
||||
className="whitespace-nowrap text-xs text-muted-foreground transition-colors hover:text-foreground"
|
||||
className="whitespace-nowrap text-xs text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
{t("common.more", { count: ADDITIONAL_AGENT_COUNT })}
|
||||
</a>
|
||||
@@ -1235,28 +1142,6 @@ function GetStarted() {
|
||||
);
|
||||
}
|
||||
|
||||
function ClosingCtaSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<section aria-labelledby="closing-cta-heading" className="text-center">
|
||||
<div className="mb-6 flex justify-center">
|
||||
<span className="inline-flex h-12 w-12 items-center justify-center rounded-xl border border-brand-green/40 bg-brand-green/15 text-accent-text">
|
||||
<PaseoMark className="h-6 w-6" />
|
||||
</span>
|
||||
</div>
|
||||
<SectionOpener
|
||||
align="center"
|
||||
eyebrow={t("landing.closingCta.eyebrow")}
|
||||
headingId="closing-cta-heading"
|
||||
title={t("landing.closingCta.title")}
|
||||
description={t("landing.closingCta.description")}
|
||||
className="mb-8"
|
||||
/>
|
||||
<DownloadActions />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
const PRIMARY_CTA_CLASS =
|
||||
"inline-flex items-center justify-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background hover:bg-foreground/90 transition-colors";
|
||||
const SECONDARY_CTA_CLASS =
|
||||
@@ -1400,7 +1285,7 @@ function PhoneShowcase() {
|
||||
const textAnimate = React.useMemo(() => (textInView ? FADE_IN : {}), [textInView]);
|
||||
|
||||
return (
|
||||
<div ref={containerRef} className="flex flex-col items-center gap-14 pt-2 pb-12 md:pb-16">
|
||||
<div ref={containerRef} className="flex flex-col items-center pt-4 pb-16 gap-20">
|
||||
{/* Arrow + text */}
|
||||
<motion.div
|
||||
initial={FADE_IN_UP_TINY}
|
||||
@@ -1512,26 +1397,21 @@ function FAQ() {
|
||||
[localize],
|
||||
);
|
||||
return (
|
||||
<motion.section
|
||||
<motion.div
|
||||
initial={FADE_IN_UP}
|
||||
whileInView={FADE_IN}
|
||||
viewport={VIEWPORT_60}
|
||||
transition={EASE_OUT_05}
|
||||
aria-labelledby="home-faq-heading"
|
||||
className="grid items-start gap-10 lg:grid-cols-[minmax(0,17rem)_minmax(0,1fr)] lg:gap-16"
|
||||
className="space-y-6"
|
||||
>
|
||||
<SectionOpener
|
||||
headingId="home-faq-heading"
|
||||
title={t("landing.faq.title")}
|
||||
className="mb-0 self-start"
|
||||
/>
|
||||
<div className="divide-y divide-white/[0.08] border-y border-white/[0.08]">
|
||||
<h2 className="text-3xl font-medium">{t("landing.faq.title")}</h2>
|
||||
<div className="space-y-6">
|
||||
{FAQ_ENTRIES.map((entry) => (
|
||||
<FAQItem key={entry} question={t(`landing.faq.${entry}Question`)}>
|
||||
<Trans i18nKey={`landing.faq.${entry}Answer`} components={links} />
|
||||
</FAQItem>
|
||||
))}
|
||||
</div>
|
||||
</motion.section>
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import type * as React from "react";
|
||||
import { SiteHeader } from "~/components/site-header";
|
||||
|
||||
/** Shared outer container width. Uses a transparent md:border-x when unframed to avoid a 1px shift. */
|
||||
export const PAGE_CONTAINER_CLASS =
|
||||
"mx-auto w-full max-w-[1160px] md:border-x md:border-transparent";
|
||||
|
||||
/** Shared outer rail width and vertical hairlines across marketing pages. */
|
||||
export const PAGE_RAIL_CLASS = "mx-auto w-full max-w-[1160px] md:border-x md:border-white/[0.07]";
|
||||
|
||||
/** Shared inner horizontal padding so every page element shares one left/right rail. */
|
||||
export const PAGE_INSET_CLASS = "px-5 sm:px-8 md:px-14";
|
||||
|
||||
/** Extend scrollable content from the mobile inset to the viewport edges. */
|
||||
export const MOBILE_PAGE_BLEED_CLASS = "-mx-5 px-5";
|
||||
|
||||
/** Full-width header band locking logo and navigation to the same (x, y) across pages. */
|
||||
export function PageHeaderBand({ framed = false }: { framed?: boolean }) {
|
||||
return (
|
||||
<div className={framed ? "border-b border-white/[0.07]" : ""}>
|
||||
<div
|
||||
className={`${framed ? PAGE_RAIL_CLASS : PAGE_CONTAINER_CLASS} ${PAGE_INSET_CLASS} py-4 md:py-5`}
|
||||
>
|
||||
<SiteHeader />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const BAND_PADDING = {
|
||||
chapter: "py-16 md:py-24",
|
||||
section: "py-14 md:py-20",
|
||||
compact: "py-12 md:py-16",
|
||||
hero: "pt-12 pb-14 md:pt-16 md:pb-20",
|
||||
none: "",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* A full-width architectural band separated by a 1px horizontal hairline with quiet crosshair
|
||||
* ticks where the horizontal rule meets the vertical frame rails.
|
||||
*/
|
||||
export function ChapterBand({
|
||||
children,
|
||||
spacing = "chapter",
|
||||
ruled = true,
|
||||
ticks = true,
|
||||
framed = true,
|
||||
tint = "none",
|
||||
className = "",
|
||||
id,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
spacing?: keyof typeof BAND_PADDING;
|
||||
ruled?: boolean;
|
||||
ticks?: boolean;
|
||||
framed?: boolean;
|
||||
tint?: "none" | "subtle";
|
||||
className?: string;
|
||||
id?: string;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
id={id}
|
||||
className={`overflow-x-clip ${ruled ? "border-t border-white/[0.07]" : ""} ${
|
||||
tint === "subtle" ? "bg-white/[0.014]" : ""
|
||||
} ${className}`}
|
||||
>
|
||||
<div
|
||||
className={`relative ${framed ? PAGE_RAIL_CLASS : PAGE_CONTAINER_CLASS} ${PAGE_INSET_CLASS} ${BAND_PADDING[spacing]}`}
|
||||
>
|
||||
{ruled && ticks && framed ? <RailIntersectionTicks /> : null}
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Quiet 9px hairlines centered on the left and right vertical rail intersections. */
|
||||
function RailIntersectionTicks() {
|
||||
return (
|
||||
<>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute -top-[4.5px] -left-[4.5px] hidden h-[9px] w-[9px] md:block"
|
||||
>
|
||||
<span className="absolute top-1/2 left-0 h-px w-full -translate-y-1/2 bg-white/25" />
|
||||
<span className="absolute top-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/25" />
|
||||
</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute -top-[4.5px] -right-[4.5px] hidden h-[9px] w-[9px] md:block"
|
||||
>
|
||||
<span className="absolute top-1/2 left-0 h-px w-full -translate-y-1/2 bg-white/25" />
|
||||
<span className="absolute top-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/25" />
|
||||
</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
/** Internal sub-section divider inside a multi-part chapter, staying inside the frame rails. */
|
||||
export function ChapterDivider({ className = "" }: { className?: string }) {
|
||||
return (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className={`-mx-5 border-t border-white/[0.07] sm:-mx-8 md:-mx-14 ${className}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unified section opener used across `/` and `/hub`:
|
||||
* mono uppercase green eyebrow -> commanding 44px H2 -> concise lede + optional external links.
|
||||
*/
|
||||
export function SectionOpener({
|
||||
eyebrow,
|
||||
title,
|
||||
mutedLead,
|
||||
description,
|
||||
headingId,
|
||||
badge,
|
||||
links,
|
||||
actions,
|
||||
align = "left",
|
||||
className = "mb-10 md:mb-12",
|
||||
}: {
|
||||
eyebrow?: string;
|
||||
title: React.ReactNode;
|
||||
mutedLead?: string;
|
||||
description?: React.ReactNode;
|
||||
headingId?: string;
|
||||
badge?: string;
|
||||
links?: ReadonlyArray<{ href: string; label: string }>;
|
||||
actions?: React.ReactNode;
|
||||
align?: "left" | "center";
|
||||
className?: string;
|
||||
}) {
|
||||
const centered = align === "center";
|
||||
return (
|
||||
<div
|
||||
className={`${className} ${
|
||||
centered
|
||||
? "mx-auto max-w-2xl text-center"
|
||||
: "flex flex-col gap-5 md:flex-row md:items-end md:justify-between"
|
||||
}`}
|
||||
>
|
||||
<div className={`space-y-3 ${centered ? "" : "max-w-2xl"}`}>
|
||||
{eyebrow ? (
|
||||
<p className="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-accent-text">
|
||||
{eyebrow}
|
||||
</p>
|
||||
) : null}
|
||||
<div className={`flex flex-wrap items-center gap-3 ${centered ? "justify-center" : ""}`}>
|
||||
<h2
|
||||
id={headingId}
|
||||
className="font-display text-3xl font-semibold tracking-[-0.025em] leading-[1.1] text-foreground sm:text-4xl md:text-[42px]"
|
||||
>
|
||||
{mutedLead ? (
|
||||
<>
|
||||
<span className="text-white/45">{mutedLead}</span>{" "}
|
||||
</>
|
||||
) : null}
|
||||
{title}
|
||||
</h2>
|
||||
{badge ? (
|
||||
<span className="rounded-full border border-brand-green/40 bg-brand-green/20 px-2.5 py-0.5 text-xs text-accent-text">
|
||||
{badge}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
{description ? (
|
||||
<p
|
||||
className={`text-base leading-relaxed text-pretty text-muted-foreground ${
|
||||
centered ? "mx-auto max-w-lg" : "max-w-xl"
|
||||
}`}
|
||||
>
|
||||
{description}
|
||||
</p>
|
||||
) : null}
|
||||
{links && links.length > 0 ? (
|
||||
<div className="flex flex-wrap gap-x-5 gap-y-1.5 pt-1 text-xs">
|
||||
{links.map((link) => (
|
||||
<a
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-mono text-white/55 transition-colors hover:text-accent-text"
|
||||
>
|
||||
{link.label}
|
||||
<ExternalLink className="h-3 w-3" />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
{actions ? <div className="flex shrink-0 flex-wrap items-center gap-3">{actions}</div> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const GRID_COLUMNS = {
|
||||
"2": "grid-cols-1 lg:grid-cols-2",
|
||||
"3": "grid-cols-1 md:grid-cols-3",
|
||||
"2-3": "grid-cols-2 sm:grid-cols-3",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Hairline-divided shared-border cell grid. Uses 1px background gap so interior hairlines never
|
||||
* double up across responsive column counts.
|
||||
*/
|
||||
export function HairlineGrid({
|
||||
children,
|
||||
columns = "3",
|
||||
className = "",
|
||||
clipContents = true,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
columns?: keyof typeof GRID_COLUMNS;
|
||||
className?: string;
|
||||
clipContents?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className={`grid gap-px rounded-xl border border-white/[0.08] bg-white/[0.08] ${clipContents ? "overflow-hidden" : ""} ${GRID_COLUMNS[columns]} ${className}`}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -50,16 +50,6 @@ describe("paseo brand assets", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("tightens symbol-to-wordmark spacing for display-scale lockups while keeping canonical paths", () => {
|
||||
const html = renderToStaticMarkup(<PaseoHubLockup size="display" className="h-12 w-auto" />);
|
||||
const canonical = readFileSync(path.join(BRAND_ROOT, "lockups/paseo-hub-white.svg"), "utf8");
|
||||
|
||||
expect(html).toContain('viewBox="0 0 798 144"');
|
||||
expect(html).toContain('width="798"');
|
||||
expect(html).toContain('transform="translate(-44 0)"');
|
||||
expect(extractPathData(html)).toEqual(extractPathData(canonical));
|
||||
});
|
||||
|
||||
it("keeps public/logo.svg and public/favicon.svg aligned with assets/brand", () => {
|
||||
const canonicalPaseo = readFileSync(path.join(BRAND_ROOT, "marks/paseo-white.svg"), "utf8");
|
||||
const publicLogo = readFileSync(path.join(WEBSITE_PUBLIC, "logo.svg"), "utf8");
|
||||
|
||||
@@ -99,34 +99,22 @@ function BrandMark({ asset, props }: { asset: ParsedMark; props: React.SVGProps<
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Optical horizontal tightening (in 144-unit lockup coordinates) for display-scale lockups.
|
||||
* Canonical lockups have a ~91-unit ink-to-ink gap calibrated for ~18–22px header sizes; at
|
||||
* 36–48px display sizes that gap reads ~25–30px wide, so `size="display"` pulls the wordmark
|
||||
* 44 units closer (~14–16px visual gap, ~1/3 of the mark width) and trims the viewBox to match.
|
||||
*/
|
||||
const DISPLAY_GAP_TIGHTEN_UNITS = 44;
|
||||
|
||||
export interface BrandLockupProps extends React.SVGProps<SVGSVGElement> {
|
||||
/** Optical spacing scale: `"default"` for small UI/header lockups, `"display"` for large headings. */
|
||||
size?: "default" | "display";
|
||||
}
|
||||
|
||||
function BrandLockup({ asset, props }: { asset: ParsedLockup; props: BrandLockupProps }) {
|
||||
const { size = "default", ...svgProps } = props;
|
||||
const tighten = size === "display" ? DISPLAY_GAP_TIGHTEN_UNITS : 0;
|
||||
const width = asset.width - tighten;
|
||||
const viewBox = tighten > 0 ? `0 0 ${width} ${asset.height}` : asset.viewBox;
|
||||
|
||||
function BrandLockup({
|
||||
asset,
|
||||
props,
|
||||
}: {
|
||||
asset: ParsedLockup;
|
||||
props: React.SVGProps<SVGSVGElement>;
|
||||
}) {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width={width}
|
||||
width={asset.width}
|
||||
height={asset.height}
|
||||
viewBox={viewBox}
|
||||
viewBox={asset.viewBox}
|
||||
fill="none"
|
||||
aria-hidden="true"
|
||||
{...svgProps}
|
||||
{...props}
|
||||
>
|
||||
<path
|
||||
d={asset.path}
|
||||
@@ -135,11 +123,7 @@ function BrandLockup({ asset, props }: { asset: ParsedLockup; props: BrandLockup
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d={asset.wordmarkPath}
|
||||
fill="currentColor"
|
||||
transform={tighten > 0 ? `translate(-${tighten} 0)` : undefined}
|
||||
/>
|
||||
<path d={asset.wordmarkPath} fill="currentColor" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -155,16 +139,16 @@ export function PaseoHubMark(props: React.SVGProps<SVGSVGElement>) {
|
||||
}
|
||||
|
||||
/** Canonical Paseo lockup (butterfly mark at 94% optical scale + Plus Jakarta Sans SemiBold). */
|
||||
export function PaseoLockup(props: BrandLockupProps) {
|
||||
export function PaseoLockup(props: React.SVGProps<SVGSVGElement>) {
|
||||
return <BrandLockup asset={PASEO_LOCKUP} props={props} />;
|
||||
}
|
||||
|
||||
/** Canonical Paseo Hub lockup (flower mark + Plus Jakarta Sans SemiBold). */
|
||||
export function PaseoHubLockup(props: BrandLockupProps) {
|
||||
export function PaseoHubLockup(props: React.SVGProps<SVGSVGElement>) {
|
||||
return <BrandLockup asset={PASEO_HUB_LOCKUP} props={props} />;
|
||||
}
|
||||
|
||||
/** Canonical Hub lockup (flower mark + "Hub"), used where Paseo is already on screen. */
|
||||
export function HubLockup(props: BrandLockupProps) {
|
||||
export function HubLockup(props: React.SVGProps<SVGSVGElement>) {
|
||||
return <BrandLockup asset={HUB_LOCKUP} props={props} />;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { PAGE_INSET_CLASS, PAGE_RAIL_CLASS } from "~/components/page-frame";
|
||||
import { SponsorsSection } from "~/components/sponsorship";
|
||||
import { PLUGINS_LINKED } from "~/plugins/launch";
|
||||
import { getAlternativePages } from "~/data/alternative-pages";
|
||||
import { appStoreUrl, playStoreUrl, webAppUrl } from "~/downloads";
|
||||
import { SponsorsSection } from "~/components/sponsorship";
|
||||
import { useLocale, useLocalizePath } from "~/i18n";
|
||||
import { PLUGINS_LINKED } from "~/plugins/launch";
|
||||
|
||||
interface SiteFooterProps {
|
||||
width?: "default" | "prose" | "wide";
|
||||
@@ -12,17 +11,13 @@ interface SiteFooterProps {
|
||||
sponsors?: boolean;
|
||||
}
|
||||
|
||||
const NON_DEFAULT_WIDTH_CLASSES: Record<
|
||||
Exclude<NonNullable<SiteFooterProps["width"]>, "default">,
|
||||
string
|
||||
> = {
|
||||
const WIDTH_CLASSES: Record<NonNullable<SiteFooterProps["width"]>, string> = {
|
||||
prose: "max-w-prose p-6 md:p-12 md:pt-0",
|
||||
default: "max-w-5xl p-6 md:p-20 md:pt-0",
|
||||
wide: "max-w-7xl p-6 md:p-20 md:pt-0",
|
||||
};
|
||||
|
||||
const LINK_CLASS = "block text-muted-foreground transition-colors hover:text-foreground";
|
||||
const COLUMN_HEADING_CLASS =
|
||||
"font-mono text-[11px] uppercase tracking-[0.12em] text-extra-muted-foreground";
|
||||
const LINK_CLASS = "block text-muted-foreground hover:text-foreground transition-colors";
|
||||
|
||||
function ExternalLink({ href, children }: { href: string; children: React.ReactNode }) {
|
||||
return (
|
||||
@@ -36,91 +31,72 @@ export function SiteFooter({ width = "default", sponsors = true }: SiteFooterPro
|
||||
const { t } = useTranslation();
|
||||
const locale = useLocale();
|
||||
const localize = useLocalizePath();
|
||||
const widthClasses = WIDTH_CLASSES[width];
|
||||
const alternatives = getAlternativePages(locale);
|
||||
const page = (path: string, label: string) => (
|
||||
<a href={localize(path)} className={LINK_CLASS}>
|
||||
{label}
|
||||
</a>
|
||||
);
|
||||
|
||||
const columns = (
|
||||
<div className="grid grid-cols-2 gap-8 text-sm sm:grid-cols-5">
|
||||
<div className="space-y-3">
|
||||
<p className={COLUMN_HEADING_CLASS}>{t("footer.product")}</p>
|
||||
<div className="space-y-2">
|
||||
{page("/blog", t("footer.blog"))}
|
||||
{page("/docs", t("footer.docs"))}
|
||||
{PLUGINS_LINKED && page("/plugins", t("footer.plugins"))}
|
||||
{page("/changelog", t("footer.changelog"))}
|
||||
{page("/hub", t("footer.hub"))}
|
||||
{page("/docs/cli", t("footer.cli"))}
|
||||
{page("/privacy", t("footer.privacy"))}
|
||||
{page("/terms", t("footer.terms"))}
|
||||
{page("/sponsor", t("footer.sponsor"))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className={COLUMN_HEADING_CLASS}>{t("footer.agents")}</p>
|
||||
<div className="space-y-2">
|
||||
{page("/claude-code", "Claude Code")}
|
||||
{page("/codex", "Codex")}
|
||||
{page("/opencode", "OpenCode")}
|
||||
{page("/antigravity", "Antigravity")}
|
||||
{page("/muse-code", "Muse Code")}
|
||||
{page("/agents", t("footer.allProviders"))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className={COLUMN_HEADING_CLASS}>{t("footer.alternatives")}</p>
|
||||
<div className="space-y-2">
|
||||
{alternatives.map((alternative) => (
|
||||
<a key={alternative.slug} href={localize(alternative.href)} className={LINK_CLASS}>
|
||||
{alternative.name}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className={COLUMN_HEADING_CLASS}>{t("footer.community")}</p>
|
||||
<div className="space-y-2">
|
||||
<ExternalLink href="https://discord.gg/jz8T2uahpH">Discord</ExternalLink>
|
||||
<ExternalLink href="https://www.reddit.com/r/PaseoAI/">Reddit</ExternalLink>
|
||||
<ExternalLink href="https://github.com/getpaseo/paseo">GitHub</ExternalLink>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className={COLUMN_HEADING_CLASS}>{t("footer.download")}</p>
|
||||
<div className="space-y-2">
|
||||
<ExternalLink href={appStoreUrl}>App Store</ExternalLink>
|
||||
<ExternalLink href={playStoreUrl}>Google Play</ExternalLink>
|
||||
<ExternalLink href="https://github.com/getpaseo/paseo/releases">
|
||||
{t("footer.desktop")}
|
||||
</ExternalLink>
|
||||
<ExternalLink href={webAppUrl}>{t("footer.webApp")}</ExternalLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
if (width === "default") {
|
||||
return (
|
||||
<footer className="border-t border-white/[0.07]">
|
||||
{sponsors ? (
|
||||
<div className="border-b border-white/[0.07]">
|
||||
<div className={`${PAGE_RAIL_CLASS} ${PAGE_INSET_CLASS}`}>
|
||||
<SponsorsSection placement="footer" />
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
<div className={`${PAGE_RAIL_CLASS} ${PAGE_INSET_CLASS} py-12 md:py-14`}>{columns}</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<footer className={`${NON_DEFAULT_WIDTH_CLASSES[width]} mx-auto mt-12 md:mt-16`}>
|
||||
<footer className={`${widthClasses} mx-auto mt-12 md:mt-16`}>
|
||||
{sponsors ? <SponsorsSection placement="footer" /> : null}
|
||||
<div className="border-t border-white/10 pt-8 pb-4">{columns}</div>
|
||||
<div className="border-t border-white/10 pt-8 pb-4 grid grid-cols-2 sm:grid-cols-5 gap-8 text-sm">
|
||||
<div className="space-y-3">
|
||||
<p className="text-extra-muted-foreground">{t("footer.product")}</p>
|
||||
<div className="space-y-2">
|
||||
{page("/blog", t("footer.blog"))}
|
||||
{page("/docs", t("footer.docs"))}
|
||||
{PLUGINS_LINKED && page("/plugins", t("footer.plugins"))}
|
||||
{page("/changelog", t("footer.changelog"))}
|
||||
{page("/hub", t("footer.hub"))}
|
||||
{page("/docs/cli", t("footer.cli"))}
|
||||
{page("/privacy", t("footer.privacy"))}
|
||||
{page("/terms", t("footer.terms"))}
|
||||
{page("/sponsor", t("footer.sponsor"))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className="text-extra-muted-foreground">{t("footer.agents")}</p>
|
||||
<div className="space-y-2">
|
||||
{page("/claude-code", "Claude Code")}
|
||||
{page("/codex", "Codex")}
|
||||
{page("/opencode", "OpenCode")}
|
||||
{page("/antigravity", "Antigravity")}
|
||||
{page("/muse-code", "Muse Code")}
|
||||
{page("/agents", t("footer.allProviders"))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className="text-extra-muted-foreground">{t("footer.alternatives")}</p>
|
||||
<div className="space-y-2">
|
||||
{alternatives.map((alternative) => (
|
||||
<a key={alternative.slug} href={localize(alternative.href)} className={LINK_CLASS}>
|
||||
{alternative.name}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className="text-extra-muted-foreground">{t("footer.community")}</p>
|
||||
<div className="space-y-2">
|
||||
<ExternalLink href="https://discord.gg/jz8T2uahpH">Discord</ExternalLink>
|
||||
<ExternalLink href="https://www.reddit.com/r/PaseoAI/">Reddit</ExternalLink>
|
||||
<ExternalLink href="https://github.com/getpaseo/paseo">GitHub</ExternalLink>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<p className="text-extra-muted-foreground">{t("footer.download")}</p>
|
||||
<div className="space-y-2">
|
||||
<ExternalLink href={appStoreUrl}>App Store</ExternalLink>
|
||||
<ExternalLink href={playStoreUrl}>Google Play</ExternalLink>
|
||||
<ExternalLink href="https://github.com/getpaseo/paseo/releases">
|
||||
{t("footer.desktop")}
|
||||
</ExternalLink>
|
||||
<ExternalLink href={webAppUrl}>{t("footer.webApp")}</ExternalLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export function SiteHeader() {
|
||||
>
|
||||
<PaseoLockup className="h-[22px] w-auto" />
|
||||
</a>
|
||||
<nav className="flex flex-wrap items-center justify-center gap-4">
|
||||
<div className="flex flex-wrap items-center justify-center gap-4">
|
||||
{PLUGINS_LINKED && (
|
||||
<a href={localize("/plugins")} className={NAV_LINK_CLASS}>
|
||||
{t("nav.plugins")}
|
||||
@@ -63,7 +63,7 @@ export function SiteHeader() {
|
||||
<GitHubIcon width="18" height="18" />
|
||||
{stars && <span className="text-sm">{stars}</span>}
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { PAGE_INSET_CLASS, PAGE_RAIL_CLASS, PageHeaderBand } from "~/components/page-frame";
|
||||
import { SiteFooter } from "~/components/site-footer";
|
||||
import { SiteHeader } from "~/components/site-header";
|
||||
|
||||
@@ -8,26 +7,18 @@ interface SiteShellProps {
|
||||
width: "default" | "prose" | "wide";
|
||||
}
|
||||
|
||||
const MAIN_CLASSES: Record<Exclude<SiteShellProps["width"], "default">, string> = {
|
||||
const MAIN_CLASSES: Record<SiteShellProps["width"], string> = {
|
||||
prose: "max-w-prose p-6 md:p-12 mx-auto",
|
||||
default: "max-w-5xl p-6 md:p-20 mx-auto",
|
||||
wide: "max-w-7xl p-6 md:p-20 mx-auto",
|
||||
};
|
||||
|
||||
export function SiteShell({ children, width }: SiteShellProps) {
|
||||
if (width === "default") {
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<PageHeaderBand framed />
|
||||
<main className={`${PAGE_RAIL_CLASS} ${PAGE_INSET_CLASS} py-14 md:py-20`}>{children}</main>
|
||||
<SiteFooter width="default" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const mainClasses = MAIN_CLASSES[width];
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<main className={MAIN_CLASSES[width]}>
|
||||
<div className="mb-16">
|
||||
<main className={mainClasses}>
|
||||
<div className="mb-20">
|
||||
<SiteHeader />
|
||||
</div>
|
||||
{children}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ArrowRight, Check, ExternalLink, Heart } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { useLocalizePath } from "~/i18n";
|
||||
import { BuyMeACoffeeIcon, GitHubIcon, OpenCollectiveIcon } from "~/components/brand-icons";
|
||||
import { HairlineGrid, SectionOpener } from "~/components/page-frame";
|
||||
import {
|
||||
BUY_ME_A_COFFEE_URL,
|
||||
GITHUB_SPONSORS_URL,
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
openSpotCount,
|
||||
sponsorHref,
|
||||
} from "~/data/sponsors";
|
||||
import { useLocalizePath } from "~/i18n";
|
||||
|
||||
function SectionHeading({
|
||||
as: Heading,
|
||||
@@ -28,13 +27,11 @@ function SectionHeading({
|
||||
badge?: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="mb-10 space-y-2.5">
|
||||
<div className="mb-12 space-y-2">
|
||||
<div className="flex items-center gap-3">
|
||||
<Heading className="font-display text-3xl font-semibold tracking-[-0.025em] md:text-[42px]">
|
||||
{title}
|
||||
</Heading>
|
||||
<Heading className="text-3xl font-medium tracking-tight">{title}</Heading>
|
||||
{badge ? (
|
||||
<span className="rounded-full border border-brand-green/40 bg-brand-green/20 px-2.5 py-0.5 text-xs text-accent-text">
|
||||
<span className="rounded-full bg-emerald-400/10 px-2 py-1 text-xs text-emerald-300">
|
||||
{badge}
|
||||
</span>
|
||||
) : null}
|
||||
@@ -58,7 +55,7 @@ const MAINTAINER_COMPONENTS = {
|
||||
};
|
||||
|
||||
const MAINTAINER_SIGNATURE = (
|
||||
<p className="text-sm text-white/50">
|
||||
<p className="text-white/50">
|
||||
<Trans i18nKey="sponsor.maintainer" components={MAINTAINER_COMPONENTS} />
|
||||
</p>
|
||||
);
|
||||
@@ -144,28 +141,26 @@ export function BackingOptions() {
|
||||
[localize, t],
|
||||
);
|
||||
return (
|
||||
<HairlineGrid columns="2">
|
||||
<div className="grid gap-3 md:grid-cols-2">
|
||||
{options.map((option) => (
|
||||
<a
|
||||
key={option.href}
|
||||
href={option.href}
|
||||
{...(option.external ? { target: "_blank", rel: "noopener noreferrer" } : {})}
|
||||
className="group flex items-center justify-between gap-4 bg-background px-5 py-4 transition-colors hover:bg-white/[0.03]"
|
||||
className="flex items-center gap-4 rounded-xl border border-white/10 bg-white/[0.02] p-4 transition-colors hover:border-white/20 hover:bg-white/[0.05]"
|
||||
>
|
||||
<span className="flex items-center gap-3.5">
|
||||
<option.icon className="h-5 w-5 shrink-0 text-white/60 transition-colors group-hover:text-white/90" />
|
||||
<span className="text-sm font-medium text-white/90 group-hover:text-white">
|
||||
{option.name}
|
||||
</span>
|
||||
</span>
|
||||
{option.external ? (
|
||||
<ExternalLink className="h-3.5 w-3.5 shrink-0 text-white/35 transition-colors group-hover:text-accent-text" />
|
||||
) : (
|
||||
<ArrowRight className="h-3.5 w-3.5 shrink-0 text-white/35 transition-colors group-hover:text-accent-text" />
|
||||
)}
|
||||
<option.icon className="h-6 w-6 shrink-0 text-white/60" />
|
||||
<p className="flex items-center gap-1.5 font-medium text-white">
|
||||
{option.name}
|
||||
{option.external ? (
|
||||
<ExternalLink className="h-3.5 w-3.5 text-white/40" />
|
||||
) : (
|
||||
<ArrowRight className="h-3.5 w-3.5 text-white/40" />
|
||||
)}
|
||||
</p>
|
||||
</a>
|
||||
))}
|
||||
</HairlineGrid>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -189,7 +184,7 @@ export function SponsorSpotSection() {
|
||||
<ul className="grid max-w-2xl gap-3 text-white/70">
|
||||
{SPOT_FEATURES.map((feature) => (
|
||||
<li key={feature} className="flex items-start gap-2.5">
|
||||
<Check aria-hidden="true" className="mt-1 size-4 shrink-0 text-accent-text" />
|
||||
<Check aria-hidden="true" className="mt-1 size-4 shrink-0 text-emerald-300" />
|
||||
<span>{t(`sponsor.company.${feature}`)}</span>
|
||||
</li>
|
||||
))}
|
||||
@@ -198,7 +193,7 @@ export function SponsorSpotSection() {
|
||||
{open > 0 ? (
|
||||
<a
|
||||
href={SPONSOR_SPOT_CHECKOUT_URL}
|
||||
className="inline-flex items-center rounded-lg bg-foreground px-5 py-2.5 text-sm font-medium text-background transition-colors hover:bg-foreground/90"
|
||||
className="inline-flex items-center rounded-md bg-white px-5 py-2.5 text-sm font-medium text-black transition-colors hover:bg-white/90"
|
||||
>
|
||||
{t("sponsor.becomeSponsor")}
|
||||
</a>
|
||||
@@ -229,72 +224,15 @@ export function SponsorPaseoSection() {
|
||||
);
|
||||
}
|
||||
|
||||
/** Standalone short sponsor note + backing options (used on /download/thanks). */
|
||||
/** Homepage: a short version of the note with the same links as /sponsor. */
|
||||
export function SponsorSection() {
|
||||
const { t } = useTranslation();
|
||||
const hubLink = useHubLinkComponents();
|
||||
return (
|
||||
<section>
|
||||
<SectionHeading as="h2" title={t("sponsor.title")} />
|
||||
<div className="space-y-8">
|
||||
<div className="max-w-2xl space-y-4 text-sm leading-relaxed text-white/70">
|
||||
<p>{t("sponsor.note.independent")}</p>
|
||||
<p>{t("sponsor.shortNote.maintained")}</p>
|
||||
<p>
|
||||
<Trans i18nKey="sponsor.shortNote.selfFunded" components={hubLink} />
|
||||
</p>
|
||||
{MAINTAINER_SIGNATURE}
|
||||
</div>
|
||||
<BackingOptions />
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Consolidated homepage Sponsors + Sponsor Paseo section.
|
||||
* Keeps `aria-labelledby="sponsors-heading"` with heading text "Sponsors" so the Sponsors region
|
||||
* contract stays intact while unifying the logo row, founder note, and backing options into one
|
||||
* coherent chapter.
|
||||
*/
|
||||
export function HomepageSponsorsSection() {
|
||||
const { t } = useTranslation();
|
||||
const localize = useLocalizePath();
|
||||
const hubLink = useHubLinkComponents();
|
||||
const open = openSpotCount();
|
||||
|
||||
return (
|
||||
<section aria-labelledby="sponsors-heading">
|
||||
<SectionOpener headingId="sponsors-heading" title={t("sponsor.sponsors")} className="mb-10" />
|
||||
|
||||
<ul className="flex flex-wrap items-center gap-x-14 gap-y-8">
|
||||
{SPONSORS.map((sponsor) => (
|
||||
<li key={sponsor.url}>
|
||||
<a
|
||||
href={sponsorHref(sponsor, "website")}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="block"
|
||||
>
|
||||
<img src={sponsor.logo.onDark} alt={sponsor.name} className="h-12 w-auto" />
|
||||
</a>
|
||||
<p className="mt-2 text-sm text-white/55">{sponsor.description}</p>
|
||||
</li>
|
||||
))}
|
||||
{open > 0 ? (
|
||||
<li>
|
||||
<a
|
||||
href={localize("/sponsor#spot")}
|
||||
className="inline-flex h-11 items-center rounded-lg border border-dashed border-white/15 px-4 text-sm text-white/50 transition-colors hover:border-white/30 hover:text-white/80"
|
||||
>
|
||||
{t("sponsor.becomeSponsor")}
|
||||
</a>
|
||||
</li>
|
||||
) : null}
|
||||
</ul>
|
||||
|
||||
<div className="mt-10 grid gap-10 border-t border-white/[0.07] pt-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] lg:items-start">
|
||||
<div className="space-y-4 text-sm leading-relaxed text-white/70">
|
||||
<div className="space-y-10">
|
||||
<div className="max-w-2xl space-y-5 leading-relaxed text-white/70">
|
||||
<p>{t("sponsor.note.independent")}</p>
|
||||
<p>{t("sponsor.shortNote.maintained")}</p>
|
||||
<p>
|
||||
@@ -319,19 +257,18 @@ const SPONSORS_PLACEMENTS = {
|
||||
button: "h-12 px-5 text-sm",
|
||||
},
|
||||
footer: {
|
||||
section: "space-y-5 py-8",
|
||||
heading:
|
||||
"gap-1.5 font-mono text-[11px] uppercase tracking-[0.12em] text-extra-muted-foreground",
|
||||
section: "space-y-5 border-t border-white/10 py-8",
|
||||
heading: "gap-1.5 text-sm text-extra-muted-foreground",
|
||||
heart: "size-3",
|
||||
link: "opacity-85 transition-opacity hover:opacity-100",
|
||||
logo: "h-9",
|
||||
logo: "h-10",
|
||||
description: "mt-1.5 text-xs text-white/45",
|
||||
button: "h-9 px-3.5 text-xs",
|
||||
button: "h-9 px-3.5 text-sm",
|
||||
},
|
||||
} as const;
|
||||
|
||||
interface SponsorsSectionProps {
|
||||
/** `page` is a standalone section; `footer` is the band above other pages' footers. */
|
||||
/** `page` is a homepage section; `footer` is the band above other pages' footers. */
|
||||
placement: keyof typeof SPONSORS_PLACEMENTS;
|
||||
}
|
||||
|
||||
@@ -376,7 +313,7 @@ export function SponsorsSection({ placement }: SponsorsSectionProps) {
|
||||
<li>
|
||||
<a
|
||||
href={localize("/sponsor#spot")}
|
||||
className={`inline-flex items-center rounded-lg border border-dashed border-white/15 text-white/45 transition-colors hover:border-white/30 hover:text-white/75 ${style.button}`}
|
||||
className={`inline-flex items-center rounded-md border border-dashed border-white/15 text-white/45 transition-colors hover:border-white/30 hover:text-white/75 ${style.button}`}
|
||||
>
|
||||
{t("sponsor.becomeSponsor")}
|
||||
</a>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user