litepaseo 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/README.md +113 -39
- package/dist/server/cli.mjs +1346 -150
- package/dist/web/assets/{CodeBlockNode-CehKIzSk.js → CodeBlockNode-fLbELjCG.js} +1 -1
- package/dist/web/assets/CodeBlockNode-fLbELjCG.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-fLbELjCG.js.gz +0 -0
- package/dist/web/assets/{FileViewer-01t53KTX.js → FileViewer-C7zGfiFt.js} +1 -1
- package/dist/web/assets/FileViewer-C7zGfiFt.js.br +0 -0
- package/dist/web/assets/FileViewer-C7zGfiFt.js.gz +0 -0
- package/dist/web/assets/{FilesPanel-B7NknFvl.js → FilesPanel-B1YfdWK8.js} +1 -1
- package/dist/web/assets/FilesPanel-B1YfdWK8.js.br +0 -0
- package/dist/web/assets/FilesPanel-B1YfdWK8.js.gz +0 -0
- package/dist/web/assets/{MarkdownMessage-UlvozPc5.js → MarkdownMessage-C30PkBRA.js} +5 -5
- package/dist/web/assets/MarkdownMessage-C30PkBRA.js.br +0 -0
- package/dist/web/assets/{MarkdownMessage-UlvozPc5.js.gz → MarkdownMessage-C30PkBRA.js.gz} +0 -0
- package/dist/web/assets/{PreCodeBlock-DPQTlYty.js → PreCodeBlock-3ozveRNf.js} +1 -1
- package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-Cdy-YZRP.js → PreCodeBlock.vue_vue_type_style_index_0_lang-BPnMZFbo.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-BPnMZFbo.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-BPnMZFbo.js.gz +0 -0
- package/dist/web/assets/{TerminalPanel-BdmAonFr.js → TerminalPanel-BR2okuCE.js} +1 -1
- package/dist/web/assets/TerminalPanel-BR2okuCE.js.br +0 -0
- package/dist/web/assets/TerminalPanel-BR2okuCE.js.gz +0 -0
- package/dist/web/assets/{Tooltip-BJ2o2M_0.js → Tooltip-Dh7ELGI1.js} +1 -1
- package/dist/web/assets/Tooltip-Dh7ELGI1.js.br +0 -0
- package/dist/web/assets/Tooltip-Dh7ELGI1.js.gz +0 -0
- package/dist/web/assets/index-BJ4CkuXT.js +30 -0
- package/dist/web/assets/index-BJ4CkuXT.js.br +0 -0
- package/dist/web/assets/index-BJ4CkuXT.js.gz +0 -0
- package/dist/web/assets/index-CaFqUnEO.css +1 -0
- package/dist/web/assets/index-CaFqUnEO.css.br +0 -0
- package/dist/web/assets/index-CaFqUnEO.css.gz +0 -0
- package/dist/web/assets/{index10-WpTfisco.js → index10-BXOnBXXV.js} +1 -1
- package/dist/web/assets/index10-BXOnBXXV.js.br +0 -0
- package/dist/web/assets/index10-BXOnBXXV.js.gz +0 -0
- package/dist/web/assets/index3-C1CbKHXb.js +1 -0
- package/dist/web/assets/index4-CE4EA6Rx.js +1 -0
- package/dist/web/assets/{index5-BCbIyN1t.js → index5-BrR0S3K6.js} +1 -1
- package/dist/web/assets/index5-BrR0S3K6.js.br +0 -0
- package/dist/web/assets/index5-BrR0S3K6.js.gz +0 -0
- package/dist/web/assets/{index6-CbdnTDhy.js → index6-DWBoE2gM.js} +1 -1
- package/dist/web/assets/index6-DWBoE2gM.js.br +0 -0
- package/dist/web/assets/index6-DWBoE2gM.js.gz +0 -0
- package/dist/web/assets/{index7-BzNzdNxO.js → index7-CoJTOvQ5.js} +1 -1
- package/dist/web/assets/index7-CoJTOvQ5.js.br +0 -0
- package/dist/web/assets/index7-CoJTOvQ5.js.gz +0 -0
- package/dist/web/assets/{index8-CD8jmACo.js → index8-CQGhir4p.js} +1 -1
- package/dist/web/assets/index8-CQGhir4p.js.br +0 -0
- package/dist/web/assets/index8-CQGhir4p.js.gz +0 -0
- package/dist/web/assets/{index9-9FYLmtt9.js → index9-D_kItRZJ.js} +1 -1
- package/dist/web/assets/index9-D_kItRZJ.js.br +0 -0
- package/dist/web/assets/index9-D_kItRZJ.js.gz +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/docs/cloudflare-access.md +111 -0
- package/docs/performance-plan.md +119 -241
- package/package.json +5 -2
- package/dist/web/assets/CodeBlockNode-CehKIzSk.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-CehKIzSk.js.gz +0 -0
- package/dist/web/assets/FileViewer-01t53KTX.js.br +0 -0
- package/dist/web/assets/FileViewer-01t53KTX.js.gz +0 -0
- package/dist/web/assets/FilesPanel-B7NknFvl.js.br +0 -0
- package/dist/web/assets/FilesPanel-B7NknFvl.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-UlvozPc5.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Cdy-YZRP.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Cdy-YZRP.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-BdmAonFr.js.br +0 -0
- package/dist/web/assets/TerminalPanel-BdmAonFr.js.gz +0 -0
- package/dist/web/assets/Tooltip-BJ2o2M_0.js.br +0 -0
- package/dist/web/assets/Tooltip-BJ2o2M_0.js.gz +0 -0
- package/dist/web/assets/index-D_YTh7Zw.css +0 -1
- package/dist/web/assets/index-D_YTh7Zw.css.br +0 -0
- package/dist/web/assets/index-D_YTh7Zw.css.gz +0 -0
- package/dist/web/assets/index-civcSERr.js +0 -27
- package/dist/web/assets/index-civcSERr.js.br +0 -0
- package/dist/web/assets/index-civcSERr.js.gz +0 -0
- package/dist/web/assets/index10-WpTfisco.js.br +0 -0
- package/dist/web/assets/index10-WpTfisco.js.gz +0 -0
- package/dist/web/assets/index3-C4yf5W5o.js +0 -1
- package/dist/web/assets/index4-Cwl0ij4U.js +0 -1
- package/dist/web/assets/index5-BCbIyN1t.js.br +0 -0
- package/dist/web/assets/index5-BCbIyN1t.js.gz +0 -0
- package/dist/web/assets/index6-CbdnTDhy.js.br +0 -0
- package/dist/web/assets/index6-CbdnTDhy.js.gz +0 -0
- package/dist/web/assets/index7-BzNzdNxO.js.br +0 -0
- package/dist/web/assets/index7-BzNzdNxO.js.gz +0 -0
- package/dist/web/assets/index8-CD8jmACo.js.br +0 -0
- package/dist/web/assets/index8-CD8jmACo.js.gz +0 -0
- package/dist/web/assets/index9-9FYLmtt9.js.br +0 -0
- package/dist/web/assets/index9-9FYLmtt9.js.gz +0 -0
- package/docs/operations.md +0 -143
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Protecting LitePaseo with Cloudflare Access
|
|
2
|
+
|
|
3
|
+
A signed-in LitePaseo session can start agents, approve their permissions and add hosts: it
|
|
4
|
+
effectively runs commands on your machines. LitePaseo's own sign-in (access token plus
|
|
5
|
+
optional authenticator code) is the last line of defence. When the console is reachable from
|
|
6
|
+
the internet through Cloudflare Tunnel, put **Cloudflare Access** in front of it as well, so
|
|
7
|
+
anonymous visitors never reach LitePaseo at all.
|
|
8
|
+
|
|
9
|
+
This guide assumes the tunnel from [HTTPS & remote access](../README.md#https--remote-access)
|
|
10
|
+
already serves `https://agents.example.com` from `http://127.0.0.1:8787`.
|
|
11
|
+
|
|
12
|
+
## What keeps working
|
|
13
|
+
|
|
14
|
+
| Feature | Behind Access |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Push notifications | Work. The server sends them straight to the browser's push service (Apple, Google, Mozilla); they never pass through your hostname. |
|
|
17
|
+
| Live updates (SSE), API, voice input WebSocket | Work. They are same-origin requests and carry the Access cookie. |
|
|
18
|
+
| Tapping a notification | Works. If the Access session expired, you sign in to Access first and then land in the conversation. |
|
|
19
|
+
| PWA install, icons, service worker updates | Need the bypass rule below. Browsers fetch the manifest without cookies, so Access would block it. |
|
|
20
|
+
|
|
21
|
+
When the Access session expires while a page is open, API calls fail (they are redirected to
|
|
22
|
+
Cloudflare's login page, which a script cannot follow) and the console shows as disconnected.
|
|
23
|
+
Reload the page to sign in again. A long session duration keeps this rare.
|
|
24
|
+
|
|
25
|
+
## 1. Protect the hostname
|
|
26
|
+
|
|
27
|
+
In the [Cloudflare One dashboard](https://one.dash.cloudflare.com/):
|
|
28
|
+
|
|
29
|
+
1. Go to **Access → Applications → Add an application → Self-hosted**.
|
|
30
|
+
2. **Application name:** `LitePaseo`. **Session duration:** `1 month` (or what you accept).
|
|
31
|
+
3. **Public hostname:** `agents.example.com`, path left empty (the whole site).
|
|
32
|
+
4. Add a policy:
|
|
33
|
+
- **Action:** Allow
|
|
34
|
+
- **Include:** Emails → your own address (or a login method such as GitHub restricted to
|
|
35
|
+
your account).
|
|
36
|
+
5. Identity: the built-in **One-time PIN** (email code) works with no setup. If you enable a
|
|
37
|
+
single identity provider, turn on **Instant Auth** to skip the provider chooser.
|
|
38
|
+
6. Save. Leave the cookie settings at their defaults.
|
|
39
|
+
|
|
40
|
+
## 2. Bypass the public static files
|
|
41
|
+
|
|
42
|
+
These files contain no data and must load without the Access cookie. Add a **second**
|
|
43
|
+
self-hosted application for the same hostname; Access applies the more specific path first.
|
|
44
|
+
|
|
45
|
+
1. **Access → Applications → Add an application → Self-hosted**, name `LitePaseo static`.
|
|
46
|
+
2. Public hostnames, all on `agents.example.com`:
|
|
47
|
+
- path `manifest.webmanifest`
|
|
48
|
+
- path `sw.js`
|
|
49
|
+
- path `icons/*`
|
|
50
|
+
3. Policy: **Action: Bypass**, **Include: Everyone**.
|
|
51
|
+
|
|
52
|
+
Do **not** bypass `/`, `/assets/*` or anything under `/api/`.
|
|
53
|
+
|
|
54
|
+
## 3. Force HTTPS
|
|
55
|
+
|
|
56
|
+
In the regular Cloudflare dashboard for your domain, under **SSL/TLS → Edge Certificates**:
|
|
57
|
+
|
|
58
|
+
- Turn on **Always Use HTTPS**.
|
|
59
|
+
- Enable **HSTS** (a max-age of 6 months is a reasonable start).
|
|
60
|
+
|
|
61
|
+
LitePaseo marks its session cookie `Secure` when Cloudflare reports the visitor used HTTPS,
|
|
62
|
+
so a plain `http://` visit can never carry or receive it.
|
|
63
|
+
|
|
64
|
+
## 4. Check the result
|
|
65
|
+
|
|
66
|
+
From a machine that is not signed in to Access:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
# The console itself is behind Access: expect 302 to *.cloudflareaccess.com
|
|
70
|
+
curl -sI https://agents.example.com/ | grep -iE '^(HTTP|location)'
|
|
71
|
+
curl -sI https://agents.example.com/api/health | grep -iE '^(HTTP|location)'
|
|
72
|
+
|
|
73
|
+
# Static files are reachable: expect 200
|
|
74
|
+
curl -s -o /dev/null -w '%{http_code}\n' https://agents.example.com/manifest.webmanifest
|
|
75
|
+
curl -s -o /dev/null -w '%{http_code}\n' https://agents.example.com/sw.js
|
|
76
|
+
curl -s -o /dev/null -w '%{http_code}\n' https://agents.example.com/icons/icon-192.png
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Then, in a browser:
|
|
80
|
+
|
|
81
|
+
1. Open the hostname in a private window: Access asks you to sign in, then LitePaseo asks for
|
|
82
|
+
its token and authenticator code.
|
|
83
|
+
2. In developer tools, confirm the `lp_session` cookie is `Secure`, `HttpOnly`,
|
|
84
|
+
`SameSite=Strict`.
|
|
85
|
+
3. Install the app, enable notifications in **Settings → Notifications**, and send a test
|
|
86
|
+
notification with the phone locked.
|
|
87
|
+
|
|
88
|
+
Also check the tunnel's ingress rules: only this hostname should point to
|
|
89
|
+
`http://127.0.0.1:8787`, and the final catch-all rule should be `http_status:404`, so no other
|
|
90
|
+
local service (such as a Paseo daemon) is published by accident.
|
|
91
|
+
|
|
92
|
+
## iPhone and iPad home-screen app
|
|
93
|
+
|
|
94
|
+
An app added to the iOS home screen keeps its cookies apart from Safari, and the Access sign-in
|
|
95
|
+
leaves the app's domain. If the installed app keeps returning to the Access login page:
|
|
96
|
+
|
|
97
|
+
- Install the **Cloudflare One (WARP)** client on the device, enroll it in your Zero Trust
|
|
98
|
+
organization, and change the Access policy to allow your enrolled devices (for example
|
|
99
|
+
**Include: Gateway**, or a device posture check). The app is then admitted without a
|
|
100
|
+
browser sign-in.
|
|
101
|
+
- Otherwise, keep using LitePaseo in Safari itself; notifications on iOS require the
|
|
102
|
+
home-screen app, though.
|
|
103
|
+
|
|
104
|
+
## If something leaks
|
|
105
|
+
|
|
106
|
+
- Lost or stolen device: revoke it in **Settings → Signed-in devices**, or sign everyone out
|
|
107
|
+
with `litepaseo signout-all`. Also revoke its Access session under
|
|
108
|
+
**My Team → Users** in Cloudflare One.
|
|
109
|
+
- Access token exposed: `litepaseo token rotate` (or `litepaseo token set` to choose one).
|
|
110
|
+
The old token stops working at once and every browser is signed out.
|
|
111
|
+
- Lost authenticator: `litepaseo totp-reset` on the server, then enrol again.
|
package/docs/performance-plan.md
CHANGED
|
@@ -1,244 +1,122 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
and
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
CPU is percentage of **one logical core**, so 200% means two cores. Table values
|
|
27
|
-
are medians across three repetitions, except the 60-second idle case. Memory is
|
|
28
|
-
the median of sampled per-repetition peaks, not a continuous high-water mark.
|
|
29
|
-
Latency is the newest event marker to a post-mutation animation-frame callback,
|
|
30
|
-
sampled at most once per second/client; it is neither physical paint latency nor
|
|
31
|
-
the latency of every event. The p95 column is the median of per-repetition p95s.
|
|
32
|
-
|
|
33
|
-
| Workload | Browser CPU | BFF + fixture CPU | Browser peak PSS | Sampled p95 |
|
|
1
|
+
# LitePaseo vs. official Paseo web UI
|
|
2
|
+
|
|
3
|
+
LitePaseo is built for an agent dashboard that stays open for hours: less CPU spent
|
|
4
|
+
on status animation and streaming, less memory occupied by the browser, and smaller
|
|
5
|
+
downloads. The goal is a lightweight console designed with battery life in mind.
|
|
6
|
+
|
|
7
|
+
In the local comparison below, LitePaseo used **91–95% less browser CPU**, **55–73%
|
|
8
|
+
less browser memory**, and downloaded **92% less compressed JavaScript/CSS** than
|
|
9
|
+
the official Paseo web UI. These are measured resource savings; battery runtime
|
|
10
|
+
and energy consumption were not measured.
|
|
11
|
+
|
|
12
|
+
## CPU and memory
|
|
13
|
+
|
|
14
|
+
Measured on **2026-11-12**, using LitePaseo commit
|
|
15
|
+
[`15d873c`](https://github.com/txchen/litepaseo/commit/15d873cabe526e50d153fe0d4baa26312614e1e5)
|
|
16
|
+
with **1 fps decorative animation** and **500 ms message batching**, against the
|
|
17
|
+
published **Paseo 0.15.4 production web UI**. Both ran in the same headless Chromium
|
|
18
|
+
on the same Linux laptop, with normal motion enabled.
|
|
19
|
+
|
|
20
|
+
Values are medians of **five runs per UI per scenario**. CPU ranges are min–max.
|
|
21
|
+
**100% CPU means one logical core**, not the whole machine. Memory is browser
|
|
22
|
+
process-tree PSS: shared memory is apportioned, and each run contributes its largest
|
|
23
|
+
two-second sample during measurement.
|
|
24
|
+
|
|
25
|
+
| Scenario | LitePaseo CPU | Paseo web CPU | LitePaseo memory | Paseo web memory |
|
|
34
26
|
|---|---:|---:|---:|---:|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
contents under churn, tool/approval rendering, input responsiveness, remote network
|
|
63
|
-
latency, macOS/mobile, official Paseo, and energy remain outside this baseline.
|
|
64
|
-
|
|
65
|
-
### Ten-minute streaming
|
|
66
|
-
|
|
67
|
-
All **27 primary cases passed** their final visible-message equality, page-error and
|
|
68
|
-
directory-stream cleanup checks. The ten-minute case used two clients and started a
|
|
69
|
-
new message every three deltas, crossing the designed browser retention threshold.
|
|
70
|
-
It generated 23,700 deltas in total and averaged 66.6% browser CPU and 1.3% BFF +
|
|
71
|
-
fixture CPU, with sampled p95 68 ms.
|
|
72
|
-
Each page retained at most **150 rendered message rows**. Internal browser-store row
|
|
73
|
-
counts were not directly instrumented.
|
|
74
|
-
|
|
75
|
-
| Minute | Browser median PSS | Combined browser JS heap | BFF + fixture median RSS |
|
|
27
|
+
| Running agent waiting, no new output | **1.5%** (1.2–1.7) | 17.8% (17.3–18.4) | **226 MiB** | 499 MiB |
|
|
28
|
+
| Continuous text, one growing paragraph | **10.1%** (9.4–10.5) | 114.7% (111.9–116.5) | **297 MiB** | 763 MiB |
|
|
29
|
+
| Growing code block, 200 → 800 lines | **6.4%** (5.7–6.6) | 140.7% (136.2–141.3) | **283 MiB** | 1,052 MiB |
|
|
30
|
+
|
|
31
|
+
Both streaming cases append exactly **600 chunks at 20 chunks/s over 30 seconds**,
|
|
32
|
+
including Chinese text. The waiting case keeps the agent running and its status
|
|
33
|
+
indicators active; it does not represent a dashboard with every task finished.
|
|
34
|
+
The code case is a rendering stress test. LitePaseo displays plain code blocks;
|
|
35
|
+
Paseo uses syntax highlighting. Both display the same complete source text, with
|
|
36
|
+
new output kept in view, but they do different amounts of presentation work.
|
|
37
|
+
|
|
38
|
+
The table measures the browser. LitePaseo's separate BFF added median **0.03% / 0.64%
|
|
39
|
+
/ 0.68%** of one core for waiting / text / code. The real daemon's CPU is also
|
|
40
|
+
recorded separately. This comparison does not include actual model execution.
|
|
41
|
+
|
|
42
|
+
Sources: [waiting and text results](../benchmarks/runs/2026-11-12T17-33-56.747Z-comparison/summary.md),
|
|
43
|
+
[code results](../benchmarks/runs/2026-11-12T17-52-40.273Z-comparison/summary.md).
|
|
44
|
+
Headline reductions use the unrounded medians; per-pair reductions and full ranges
|
|
45
|
+
are available in the corresponding `summary.json` files.
|
|
46
|
+
|
|
47
|
+
## Smaller downloads
|
|
48
|
+
|
|
49
|
+
The browser fetched these JavaScript and CSS resources while opening a conversation.
|
|
50
|
+
**LitePaseo's deferred Markstream renderer is included**, so this is not just a
|
|
51
|
+
comparison of its small initial entry script against Paseo's complete application.
|
|
52
|
+
|
|
53
|
+
| Loaded JS + CSS | LitePaseo | Paseo web | Reduction |
|
|
76
54
|
|---|---:|---:|---:|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
The
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
The excluded preliminary run, including its interrupted soak samples, is not kept in Git.
|
|
101
|
-
It is not included in the reported medians. The
|
|
102
|
-
[frontend build audit](../benchmarks/runs/2026-11-11T20-31-13.817Z/frontend-build-audit.json)
|
|
103
|
-
records the served files' hashes and their comparison with a fresh production build.
|
|
104
|
-
|
|
105
|
-
### Animation diagnostic and optimization priorities
|
|
106
|
-
|
|
107
|
-
Three alternating-order pairs used the same 1,000-session fixture with running
|
|
108
|
-
badges, no new events and 20-second measurement periods. Enabling the existing
|
|
109
|
-
`prefers-reduced-motion: reduce` CSS changed browser CPU from median **16.8%**
|
|
110
|
-
(16.6–17.0%) to **0.2%** (0.1–0.3%). All six cases passed. This strongly implicates
|
|
111
|
-
the continuously animated status indicators in the observed idle CPU cost; the
|
|
112
|
-
experiment changes a browser media preference, not application source.
|
|
113
|
-
See [paired run results](../benchmarks/runs/2026-11-11T20-53-47.379Z-motion/summary.json).
|
|
114
|
-
|
|
115
|
-
Recommended implementation order:
|
|
116
|
-
|
|
117
|
-
1. Remove or redesign the continuously animated `box-shadow` status pulse. The
|
|
118
|
-
existing reduced-motion setting already provides an immediate workaround.
|
|
119
|
-
2. Avoid reparsing and replacing the full growing Markdown message on every flush;
|
|
120
|
-
investigate incremental code-block updates and batching, then rerun latency and
|
|
121
|
-
long-task measurements to ensure the tradeoff is acceptable.
|
|
122
|
-
3. Keep history pagination in a bounded viewport with a preserved scroll anchor.
|
|
123
|
-
Loading older history currently expands the rendered message count.
|
|
124
|
-
|
|
125
|
-
These were optimization candidates at the baseline commit. The follow-up below
|
|
126
|
-
records the subsequent implementation and calibration.
|
|
127
|
-
|
|
128
|
-
## Follow-up: low-frequency motion and bounded history
|
|
129
|
-
|
|
130
|
-
Final requested configuration: **persistent decorative animation at 2 updates/s,
|
|
131
|
-
timeline message batches every 500 ms**. Input and clicks are not rate limited.
|
|
132
|
-
The implementation is recorded in application commit `61104ca`.
|
|
133
|
-
|
|
134
|
-
The animation experiments used three repetitions per setting, 20 seconds each,
|
|
135
|
-
with a connected 1,000-session directory and no incoming messages. CPU remains
|
|
136
|
-
percentage of one logical core. They showed why CSS `steps()` alone was insufficient:
|
|
137
|
-
|
|
138
|
-
| Animation implementation | Frequency | Median browser CPU |
|
|
55
|
+
| Compressed HTTP response bodies | **290 KiB** | 3,764 KiB | 92% |
|
|
56
|
+
| Decoded source | **1.08 MiB** | 22.85 MiB | 95% |
|
|
57
|
+
|
|
58
|
+
These are actual resource response sizes from fresh browser profiles, excluding
|
|
59
|
+
HTML, fonts, images, headers and conversation traffic. They describe the tested
|
|
60
|
+
conversation route, not every optional feature or the npm installation size.
|
|
61
|
+
[Resource entries and raw counters](../benchmarks/runs/2026-11-12T17-33-56.747Z-comparison/raw-counters.json)
|
|
62
|
+
include the fetched file names and byte counts.
|
|
63
|
+
|
|
64
|
+
## The tradeoff: fewer updates, lower CPU
|
|
65
|
+
|
|
66
|
+
LitePaseo deliberately avoids rendering every incoming chunk. Its
|
|
67
|
+
[status animation clock](../src/web/motion-clock.ts) advances once per second;
|
|
68
|
+
[message updates](../src/server/timeline-view.ts) are batched every 500 ms.
|
|
69
|
+
The 1 fps setting applies to persistent decorative animation, not to the entire
|
|
70
|
+
page or to keyboard input. Its [Markdown configuration](../src/web/MarkdownMessage.vue)
|
|
71
|
+
also disables typewriter effects and uses simplified code blocks.
|
|
72
|
+
|
|
73
|
+
Batching adds visible waiting time. The benchmark records **every chunk's** time
|
|
74
|
+
from provider emission until its text appears in the DOM, including the daemon,
|
|
75
|
+
transport and batching. The following values are medians of each run's p95:
|
|
76
|
+
|
|
77
|
+
| Output | LitePaseo p95 | Paseo web p95 |
|
|
139
78
|
|---|---:|---:|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
### Final configuration results
|
|
186
|
-
|
|
187
|
-
All **12 final-configuration repetitions passed** (three each for idle motion,
|
|
188
|
-
plain streaming, large Markdown and history navigation). `npm run check` also
|
|
189
|
-
passed type checking, production build, 64 tests and browser acceptance.
|
|
190
|
-
|
|
191
|
-
| Workload | Original browser CPU | Final browser CPU | Final sampled peak PSS |
|
|
192
|
-
|---|---:|---:|---:|
|
|
193
|
-
| No new events, running badges | 16.8% | 1.4% | 234 MiB |
|
|
194
|
-
| Plain streaming | 34.7% | 4.9% | 245 MiB |
|
|
195
|
-
| 12,000-line growing code block | 111.6% | 28.1% | 374 MiB |
|
|
196
|
-
|
|
197
|
-
Final data: [motion](../benchmarks/runs/2026-11-11T21-30-45.434Z-motion/summary.json),
|
|
198
|
-
[streaming and history](../benchmarks/runs/2026-11-11T21-32-04.839Z/summary.json),
|
|
199
|
-
[counter CSV](../benchmarks/runs/2026-11-11T21-32-04.839Z/counters.csv).
|
|
200
|
-
These are same-fixture local measurements collected sequentially, not a randomized
|
|
201
|
-
cross-version A/B trial. Host and measurement limitations from the baseline still apply.
|
|
202
|
-
|
|
203
|
-
The code-block case still produced **60 long tasks per repetition**, totaling
|
|
204
|
-
6.1–6.3 seconds over each ~31-second window, versus 431–434 tasks totaling about
|
|
205
|
-
27.1 seconds in the original runs. Lower average CPU does not mean incremental
|
|
206
|
-
Markdown rendering or the complete absence of input stalls. Plain streaming had
|
|
207
|
-
no observed long tasks in its three repetitions.
|
|
208
|
-
|
|
209
|
-
History mounted at most **150 message rows** in all three runs, including after
|
|
210
|
-
20 backward pages and while new output continued. The checks cover backward/forward
|
|
211
|
-
round trips, retained-row scroll positions (within 3 px), historical-content equality,
|
|
212
|
-
and return to the latest output. It used about 2.2% browser CPU, but that is **not a
|
|
213
|
-
like-for-like CPU comparison** with the old 2,066-row live-updating history view:
|
|
214
|
-
the new historical snapshot deliberately stays fixed until the reader navigates.
|
|
215
|
-
|
|
216
|
-
The final sampled newest-marker p95s were 58 ms for plain text and 176 ms for the
|
|
217
|
-
code block. Those figures omit the waiting time of older deltas coalesced into the
|
|
218
|
-
same batch; they must not be described as end-to-end latency for every message.
|
|
219
|
-
Navigation to the initial timeline now took roughly 0.78 seconds in these runs,
|
|
220
|
-
versus about 0.34 seconds in the old 1,000-session runs, because initial timeline
|
|
221
|
-
reset delivery also uses the 500 ms flush cadence. The chosen cadence trades
|
|
222
|
-
update latency for reduced CPU. No energy or real-daemon performance claim is made.
|
|
223
|
-
|
|
224
|
-
## Planned comparisons
|
|
225
|
-
|
|
226
|
-
Compare production builds of official Paseo web and LitePaseo on the same browser/device, plus official native separately if available. Record exact commits, browser/OS/Node versions, build flags, enabled plugins, daemon/provider versions, BFF placement, hardware, power mode, display brightness, refresh rate and thermal state. Run plugins off first, then a separately reported matched plugin scenario. Never compare different amounts of rendered content silently.
|
|
227
|
-
|
|
228
|
-
Use two layers. A deterministic fixture harness replays the same timestamped semantic timeline into each client's normal ingestion path (version-pinned adapters, no real model calls). Capture/sanitize one fixture and publish its hash, event count, bytes, durations and adaptation code. Validate equal final text, tool rows and approvals. This measures rendering/ingestion, not transport parity. A second two-daemon end-to-end run verifies transport and recovery with deterministic provider output where supported. If a mock provider cannot be installed without modifying official code, disclose that limitation and keep real-model runs exploratory because outputs vary.
|
|
229
|
-
|
|
230
|
-
Scenarios: 10-minute connected idle; 5-minute plain-text stream; 5-minute growing code/Markdown stream; large completed history plus new output; simultaneous output from two hosts; hidden tab for 5 minutes then foreground; one-host disconnect/reconnect; approval during streaming. Fix event cadence, text size, history size and exact scripted visibility/scroll/input actions in the fixture manifest. Include a long unfinished code fence and non-ASCII input.
|
|
231
|
-
|
|
232
|
-
## Procedure
|
|
233
|
-
|
|
234
|
-
1. Create a clean browser profile with extensions disabled. Fix screen/network/power conditions and background workloads. Place daemons off the measured laptop for the primary browser experiment.
|
|
235
|
-
2. Warm each production build for two minutes. Randomize A/B order in paired runs; run at least five pairs per scenario. Cool between runs to comparable temperature. Do not profile with DevTools open in the primary energy run.
|
|
236
|
-
3. Collect cumulative process CPU seconds before/after for the entire browser process tree, BFF and daemon separately. Report CPU seconds per wall second (one full core = 1), RSS/peak memory, network bytes, flush/parse/render counts, event-loop delay and browser long tasks. Account for shared browser processes consistently, preferably with only the test profile running.
|
|
237
|
-
4. Linux: use `pidstat`/process accounting for CPU, `perf stat` where available for context switches; use supported RAPL counters or an external power meter for joules. RAPL measures package domains, not process energy or whole-device energy. macOS: use supported Instruments/powermetrics workflows, separating Energy Impact scores from joules. Record tool versions, sampling interval, permissions and unsupported counters. Context switches are not interchangeable with hardware wakeups.
|
|
238
|
-
5. Measure idle baseline with the same instrumentation. Report raw and baseline-adjusted energy, measurement domain and elapsed time. For battery drain, use longer fixed-duration repeated trials with fixed initial charge bands; short percentage drops are too coarse. Use an external whole-device meter when practical, accounting for charging behavior.
|
|
239
|
-
6. Use the intended server-hosted BFF for the primary comparison; optionally run locally as a diagnostic. Report laptop energy and remote BFF CPU/energy separately; only sum comparable measured domains without double counting. Unknown daemon/remote energy stays unknown.
|
|
240
|
-
7. Record receipt-to-visible latency distribution, approval latency, final-state correctness, missing/duplicate rows and recovery time. A lower CPU value with lost events is a failed run.
|
|
241
|
-
|
|
242
|
-
Store `benchmarks/<run-id>/manifest.json`, fixture hashes, raw counter CSV, correctness results and analysis script. Suggested CSV fields: variant, repetition, scenario, wall_seconds, browser_cpu_seconds, bff_cpu_seconds, daemon_cpu_seconds, peak_rss_bytes, energy_joules, energy_domain, visible_latency_p50_ms, visible_latency_p95_ms, final_state_equal. Use null for unavailable measurements, never zero.
|
|
243
|
-
|
|
244
|
-
Report paired differences, medians, spread and confidence intervals with all failures disclosed. Tune batching at 250/750/1500 ms, holding all else constant. Compare Markstream with plain text and a baseline renderer, separately toggling highlighting/diagrams and history windowing to identify costs. Set an acceptance threshold only after establishing baseline variance and a user-acceptable latency budget. Source observations and renderer marketing are not measured performance evidence.
|
|
79
|
+
| Plain text | 567 ms | **142 ms** |
|
|
80
|
+
| Code | 575 ms | **281 ms** |
|
|
81
|
+
|
|
82
|
+
Paseo showed incoming text sooner in these tests. LitePaseo used substantially less
|
|
83
|
+
CPU while updating about twice per second. These timings are DOM observations,
|
|
84
|
+
not physical screen-paint or keyboard-response measurements. Lower average CPU
|
|
85
|
+
also does not guarantee an absence of occasional long tasks; those are recorded
|
|
86
|
+
in the raw data.
|
|
87
|
+
|
|
88
|
+
## What the comparison establishes
|
|
89
|
+
|
|
90
|
+
The result supports LitePaseo's lightweight, battery-conscious design: the tested
|
|
91
|
+
browser has less CPU work to do, a smaller memory footprint, and fewer frontend
|
|
92
|
+
bytes to download. **A 91% CPU reduction does not mean 91% less battery drain.**
|
|
93
|
+
Energy counters were unreadable on this machine, so watts, joules and additional
|
|
94
|
+
hours of battery life remain unmeasured.
|
|
95
|
+
|
|
96
|
+
The test machine was a Core Ultra 7 256V laptop with 8 logical CPUs and 15.2 GiB RAM,
|
|
97
|
+
on AC power with the `powersave` governor, Linux `7.2.13-200.fc44.x86_64`, Node
|
|
98
|
+
`26.12.1` and headless Chromium `158.0.8127.18`, at 1280 × 900. Headless software
|
|
99
|
+
rendering is not a substitute for a GPU-accelerated desktop or phone battery test.
|
|
100
|
+
The host was shared and temperature was not controlled; these short runs do not
|
|
101
|
+
establish long-term memory behavior or performance for every workload.
|
|
102
|
+
|
|
103
|
+
Each run used a fresh isolated **real Paseo daemon**, its deterministic mock-provider
|
|
104
|
+
extension point, and a fresh browser profile. The official UI used WebSocket;
|
|
105
|
+
LitePaseo used its normal SDK-backed BFF and HTTP/SSE. Both frontends were production
|
|
106
|
+
builds, plugins were off, and there was one workspace and one agent. After a
|
|
107
|
+
10-second warmup, each measurement covered 30 seconds plus at least one second
|
|
108
|
+
of drain, waiting for final output before taking final counters. Paired A/B order
|
|
109
|
+
alternated. Servers ran locally and their counters were separated from the browser.
|
|
110
|
+
|
|
111
|
+
All **30 reported runs** passed complete rendered-text equality after Markdown
|
|
112
|
+
fence/whitespace normalization, ordered-marker checks and page-error checks.
|
|
113
|
+
An earlier 1,000-line code fixture grew beyond Paseo's
|
|
114
|
+
[32,000-character rendering cap](https://github.com/getpaseo/paseo/blob/v0.15.4/packages/app/src/components/assistant-message-render-limit.web.ts).
|
|
115
|
+
That incomplete pair was excluded, then replaced by five pairs using the smaller
|
|
116
|
+
code fixture above. The [excluded case and exact capped-prefix verification](../benchmarks/runs/2026-11-12T17-33-56.747Z-comparison/excluded-code-case.json)
|
|
117
|
+
are retained; no performance saving is calculated from missing output.
|
|
118
|
+
|
|
119
|
+
See [benchmark methodology and reproduction commands](../benchmarks/README.md)
|
|
120
|
+
for the runner, per-repetition CSVs, raw samples, per-chunk timings, source and
|
|
121
|
+
production-build hashes. The earlier LitePaseo-only tuning experiments are kept
|
|
122
|
+
in the [historical optimization log](../benchmarks/legacy-baseline.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "litepaseo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A resource-conscious web console for your Paseo agents",
|
|
5
5
|
"bin": {
|
|
6
6
|
"litepaseo": "dist/server/cli.mjs"
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"README.md",
|
|
11
|
-
"
|
|
11
|
+
"CHANGELOG.md",
|
|
12
|
+
"docs/cloudflare-access.md",
|
|
12
13
|
"docs/markstream-integration-validation.md",
|
|
13
14
|
"docs/performance-plan.md"
|
|
14
15
|
],
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
"markstream-vue": "2.0.25",
|
|
33
34
|
"qrcode": "1.5.4",
|
|
34
35
|
"web-push": "3.6.7",
|
|
36
|
+
"ws": "8.22.2",
|
|
35
37
|
"zod": "4.6.7"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
"@types/node": "^24.0.0",
|
|
40
42
|
"@types/qrcode": "1.5.5",
|
|
41
43
|
"@types/web-push": "3.6.4",
|
|
44
|
+
"@types/ws": "^8.18.2",
|
|
42
45
|
"@vitejs/plugin-vue": "6.0.10",
|
|
43
46
|
"@xterm/addon-fit": "0.11.0",
|
|
44
47
|
"@xterm/xterm": "6.0.0",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|