dsh-lite 0.0.0-stage → 0.6.2

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 ADDED
@@ -0,0 +1,183 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.6.2 — 2026-12-05
6
+
7
+ ### Changed
8
+
9
+ - Wide layouts (≥720px) open the session list by default, and the desktop console (≥900px) is now a two-column grid like the foldable range: the list is a persistent sidebar with no backdrop (clicking the chat never closes it) and the console card centres in the remaining width. A user who closes the sidebar keeps it closed for the visit; a viewport that grows wide re-opens it unless they did. Selecting a session no longer closes the sidebar on wide screens.
10
+ - The desktop console header gains a "完整页面 / full page" button, so a desktop shell (where the full page's "Open in Lite" replaces the window, because the Electron host denies `window.open`) always has a one-click way back.
11
+
12
+ ### Added
13
+
14
+ - Install paths that need no npm: `dsh plugin --profile web add github:T-splines/dsh-lite` (any pnpm GitHub spec) and the prebuilt tarball attached to each GitHub Release (`dsh-lite-<version>.tgz`, plus the stable name `dsh-lite.tgz` for `releases/latest/download/`). Both verified in a throwaway profile. The publish workflow now attaches the tarballs; `screenshots.json` declares the six screenshots storefronts show.
15
+
16
+ ## 0.6.1 — 2026-12-02
17
+
18
+ ### Added
19
+
20
+ - `test/release.test.js`: the newest CHANGELOG release must equal the `package.json` version, releases must descend by semver, and an `Unreleased` block must stay on top.
21
+ - `.githooks/pre-commit`: privacy gate that scans staged additions for private home paths, secret-looking assignments, and common token shapes. Enable with `git config core.hooksPath .githooks`.
22
+ - `CONTRIBUTING.md` / `CONTRIBUTING.en.md`: commit conventions, 0.x version levels (incremental change = patch, new capability = minor), and the atomic release checklist.
23
+ - `e2e/`: real-host end-to-end harness (`npm run test:e2e`). It starts a throwaway `dsh web` in an isolated `DSH_HOME` on an OS-picked port, has a fake model call `ask_user_question`, and proves the whole chain — Lite card → Lite answer → the answer reaching the model — without touching a running instance or needing an API key. `npm run verify` chains check, unit tests, and this e2e.
24
+ - CI gains a Windows job and the e2e job; `.github/workflows/publish.yml` publishes to npm through OIDC trusted publishing on `v*` tags, enforces tag == `package.json` == newest CHANGELOG release, and creates the GitHub Release from the CHANGELOG section.
25
+ - `SECURITY.md` and issue templates (bug report, feature / scope question).
26
+ - `docs/parity.md`: every official web capability classified as Lite / full page / never, with reasons and a value-ordered candidate pool.
27
+ - README screenshots are now generated by `e2e/screenshots.mjs` from a throwaway host whose model replays the fictional conversations in `e2e/fake-scripts.mjs` (the fake model gains a `scripted` scenario). Earlier screenshots had been taken by hand from a real instance and showed real session titles and messages despite the README claiming mock data; the generator makes the claim true and reproducible. Unreferenced hand-taken images (theme `*-sheet` variants, the app shots under `docs/design-previews/`) are removed; the design harness and its two exports stay.
28
+ - Two-way navigation between the two pages. The full page's session header "More actions" menu gains "打开 Lite 页面 / Open in Lite" (client bundle `lib/client.js`, registered through the host's `contextMenus` like its own "Open In…" entry), which opens `/lite/?session=<id>`. Lite's session drawer footer gains a "完整页面" button that first writes the full page's session selection (`dsh.sessions.current`) so the full page reopens the same session. A desktop shell has no address bar; the menu item is how its users reach Lite at all. Verified in a real browser against a throwaway host (`e2e/browser-nav.mjs`, optional — needs Playwright).
29
+
30
+ ### Changed
31
+
32
+ - README (Chinese and English) documents the answer-card behaviour for both request shapes and links the contributing guide.
33
+ - Empty-answer prompts on the card now say "choose or type an answer, or skip this question" (or "type an answer, or skip this question" for free text) instead of "answer or skip first", which promised a per-question skip that did not exist.
34
+ - The e2e run covers three scenarios — a single question; three questions with a "(Recommended)" label, a multi-select, and free text; and a middle question skipped — against the same throwaway dsh web.
35
+
36
+ ### Fixed
37
+
38
+ - `ask_user_question` in the default `legacy` blocking mode (no `callId`) is now mirrored on Lite as an answerable card, exactly like timed questions. Lite keys that card by a synthetic id and settles the gateway's pending event by agent plus question identity, so the full-page card still receives its normal cancel frame — and a question can now be answered from Lite even when no full page is connected. Before, Lite only forwarded such requests, which left a phone-only user with nothing but the running-activity line while the card sat on the full page.
39
+ - A question request Lite cannot key (no live agent or session) is forwarded untouched to the full page instead of being rejected with `NO_PROVIDER`.
40
+ - Answer card: every question has its own "Skip this question" toggle, which sends the protocol's explicit `selected: []` for that question only — the host card's semantics. Before, the only way past an unanswered question was the card-level "Skip", which silently discarded every answer already drafted. The card-level button is now "Skip all" and asks for confirmation in-page when any question has been answered.
41
+ - Answer card: when a single-select question has both a chosen option and custom text, Lite now sends `selected: []` with the `custom` (custom replaces the choice, as the host card and `dsh-tool-ask-user` document); multi-select questions still send both. Before, the model received a contradictory choice and free text.
42
+
43
+ ## 0.6.0 — 2026-11-26
44
+
45
+ ### Added
46
+
47
+ - Three visual families — Claude, Codex, and macOS — each with light and dark palettes. The appearance panel in the session drawer footer switches family and mode; Auto follows `prefers-color-scheme` and reacts to OS changes without a reload. The existing header ◐ button still flips light/dark and now records an explicit mode.
48
+ - Theme runtime (`public/theme.js`): `initTheme`, `setThemeFamily`, `setColorMode`, `toggleColorMode`, `getTheme`, and `THEME_FAMILIES` / `COLOR_MODES` metadata. It owns `<html data-theme-family data-theme data-theme-mode>`, the `dsh-lite:themechange` event, `theme-color` / `color-scheme` meta sync, and best-effort persistence under `dsh-lite:theme-family` / `dsh-lite:theme`.
49
+ - Theme layer (`public/theme.css`): semantic `--ds-*` scales (type, spacing, radii, motion, shadows), six palettes, a one-to-one contract that remaps the existing `--bg` … `--desk-shadow` variables, component refinements, and `.ds-*` primitives. Features can use the standard tokens/primitives without knowing the active family.
50
+ - `docs/design-system.md`: DOM contract, API, token inventory, primitive catalogue, family personalities, WCAG contrast results, and a checklist for new features.
51
+ - Theme screenshots for all six combinations and the appearance panel under `docs/themes/`; the design harness and six-up previews live under `docs/design-previews/`.
52
+
53
+ ### Changed
54
+
55
+ - PWA shell bumped to v27; `theme.css` and `theme.js` are served from the plugin whitelist and precached by the service worker. `npm run check` now validates `theme.js`, and tests enforce asset routes plus theme version alignment across `index.html`, `app.js`, and `sw.js`.
56
+ - `npm test` grew theme metadata, setter, palette-contract, asset-route, and version-alignment checks; all 100 tests pass.
57
+ - Source assets now total ~65.5 KB gzip (app, i18n, style, theme, sw), still precached once and no new runtime dependencies.
58
+ - README (Chinese and English) documents the theme layer and links the design system.
59
+
60
+ ## 0.5.1 — 2026-11-26
61
+
62
+ ### Added
63
+
64
+ - The session drawer is now one list grouped by Workspace, with a view menu for Workspace / Flat grouping, Recent / Created / Title sorting, and Hide / Show / Only-archived filtering. Pinned sessions lead every group, groups follow the host's workspace order, ungrouped sessions come last, collapsed groups persist locally, and the current session's group is highlighted.
65
+ - Group waterlines start at 5 rows but automatically rise to cover running sessions (up to 50); “show more” advances in 5-row steps and the last step becomes “collapse”.
66
+ - Search always falls back to a flat result list and labels each row with its folder. Server-side search matches Workspace titles; older hosts are supplemented from already-loaded rows so folder search works before a restart.
67
+ - Bootstrap and paged rows carry `workspaceId` / `workspaceTitle` / `createdAt`, so grouping and creation sorting need no extra request and no full projection load. The registry entity may expose `id` or the wire `workspaceId`; both are accepted.
68
+ - Older hosts that omit `workspaceId` fall back to an exact canonical-cwd match against Workspace paths. This mirrors the registry's own header validation and keeps real Workspaces grouped before the host is restarted; once the field is present (including null) it is authoritative.
69
+ - Responsive pass: a one-row drawer header down to 320px, a real two-pane layout at 720–899px (foldables and small tablets; the drawer becomes a sticky sidebar), compact phone landscape chrome, and unchanged desktop console.
70
+
71
+ ### Changed
72
+
73
+ - Documented the LAN-first network boundary: official support is a LAN or a user-managed private network (WireGuard recommended); Lite ships no public tunnel, relay, or second auth. Cloudflare Named Tunnel + Access is recorded as an experimental, user-managed option only. See `docs/networking.md`.
74
+ - The drawer header shows icon-only notification / new-session actions below 900px, shortens the subtitle, and keeps actions on one line. The view button is icon-only so search keeps the full row at 320px.
75
+ - PWA shell version bumped to v26; refreshed the session drawer, archive, workspace, English, flat, foldable, and landscape screenshots.
76
+
77
+ ## 0.5.0 — 2026-11-25
78
+
79
+ ### Added
80
+
81
+ - Permission approvals now appear as a Lite card while that session is being polled by the phone. Reject or allow exactly once; there is no always-allow. An idle page hands the request back after 45 seconds, and a 5-minute cap fails closed.
82
+ - Image messages: pick or shoot a photo, compress it in the browser to a 1600px long edge in WebP/JPEG (≤ 2 MB each, ≤ 4 per message), and send it with or without text. Image-only messages are accepted; unsent images are memory-only.
83
+ - A running turn now shows one activity line: the latest pending tool name, display target, elapsed time, and parallel count, or “generating a reply” between tools. It reads boundary events only, never full arguments or results.
84
+ - Plan mode now has a header badge: `Plan` while active (tap to run `/plan off`) and `Plan…` while switching.
85
+ - Run insights: tap the context pill, or choose Session settings → Run insights, for context occupancy, cumulative input/output/cache read/write tokens, prompt composition, and plan state. The detail route is fetched on demand and stays out of status polling.
86
+ - Session settings can fork the completed-turn prefix and open the new Session, copy the complete transcript as Markdown (`/api/session.markdown`), or download the host-exported session ZIP (`/api/session.export`). The dialog scrolls on short screens.
87
+ - The session drawer lists the host's Workspaces, accepts a custom directory, and can create the next Session there; Automatic keeps the default location.
88
+ - Session settings can read and switch the host's permission presets. The dialog lists each preset's effect and marks the current one; the switch applies to the current Session immediately.
89
+ - Completion awareness: a live page shows an in-page banner when a turn goes idle. An opt-in Notifications toggle in the session drawer grants a slow hidden-page poll, a browser notification (service worker first, page constructor fallback), an unread title dot, and a `?session=` deep link when the notification is tapped. No push service; a closed or killed page is not guaranteed to notify.
90
+ - Full English UI: the first visit follows the browser language, a one-tap switch in the session drawer persists the choice, and dynamic cards, dialogs, banners, placeholders, and ARIA labels are localized. A completeness test fails if a source string or translation is missing.
91
+ - PWA shell version bumped to v24 and `i18n.js` added to the precache list.
92
+ - Refreshed every README screenshot at v24 and added approval, image input, run insights, new-session location, permission mode, and English UI shots.
93
+
94
+ ## 0.4.5 — 2026-11-25
95
+
96
+ ### Fixed
97
+
98
+ - `ask_user_question` no longer fails with `no answer surface can hold this question` on every call. The blocking tool (mode `legacy`, the default) sends a request without `wait.callId`; Lite treated that as a holdable card, failed to key it, and rejected with `NO_PROVIDER` before the full page ever saw it. Requests without a call id now pass straight through to the full-page answerer, and only call-id-keyed (timed) requests are mirrored.
99
+
100
+ ## 0.4.4 — 2026-11-07
101
+
102
+ ### Changed
103
+
104
+ - Desktop (≥900px) now uses a centered console panel: a floating 1024px frame with an 800px reading column, rounded corners, shadow, dotted backdrop, desktop-sized side drawer and dialogs, hover states, and thin scrollbars.
105
+ - Mobile polish: header subtitle now reads `目录 · 状态`, bubbles cap at 92%, the send target is 44px, conversation spacing is tighter, and the goal row wraps cleanly at 320px.
106
+ - Refreshed all README screenshots and added a 1440×900 desktop shot.
107
+ - Documented the DSH `0.2.2-rc.1` baseline to match `engines.dsh`.
108
+ - PWA shell version bumped to v12.
109
+
110
+ ## 0.4.3 — 2026-11-07
111
+
112
+ ### Changed
113
+
114
+ - The answer card now mirrors on both the full page and Lite instead of being owned by one side. Lite settles the same Remote pending event a full-page tab would, so whichever side answers first makes the gateway cancel the other card. No more switching to the full page to answer a blocking question.
115
+ - A blocking question answered locally after the Remote bridge reports `NO_PROVIDER` still works, and the pending-event lookup retries briefly while the gateway opens the event.
116
+ - On a DSH build without the gateway's pending-event table, the previous one-surface arbitration remains as a runtime feature-detected fallback.
117
+
118
+ ## 0.4.2 — 2026-11-06
119
+
120
+ ### Changed
121
+
122
+ - Declare `engines.dsh: ">=0.2.2-0 <0.3.0-0"` (verified on dsh 0.2.2-rc.1; 64 tests pass).
123
+
124
+ ## 0.4.1 — 2026-11-05
125
+
126
+ ### Fixed
127
+
128
+ - A blocking `ask_user_question` no longer hangs forever when no full page is connected. Lite registers ahead of the host's Remote bridge, claims the question while that session is being polled in Lite, otherwise delegates to a live full page, and holds it as a Lite answer card when neither surface is available (ten-minute limit, cancellation cleanup).
129
+ - If the phone stops polling before answering and a full page is connected, the untouched request is handed to the full page instead of being stranded on a silent phone.
130
+ - Answers to a held question are validated against the exact question IDs before the tool call is resumed.
131
+
132
+ ### Changed
133
+
134
+ - The answer card accepts the new `live` state; its note distinguishes "sent back to the waiting model" from "becomes a new user message".
135
+ - PWA shell version bumped to v11.
136
+
137
+ ## 0.4.0 — 2026-11-04
138
+
139
+ ### Added
140
+
141
+ - Server-side paging and search for active and archived sessions (`/api/lite/sessions`), with totals, load-more, and archive-tab search across the full archive.
142
+ - Answer card for timed-out but still-answerable `ask_user_question` calls: single-select, multi-select, optional detail, custom text, and explicit skip (`/api/lite/answer`).
143
+ - Per-session composer drafts stored in localStorage; restored after switching sessions or reloading.
144
+ - Markdown tables (horizontally scrollable) and strikethrough.
145
+ - A "打开完整页面" link in the waiting bar for questions still held by the full-page answerer.
146
+
147
+ ### Changed
148
+
149
+ - Archive, unarchive, and pin responses no longer echo the full `archivedSessionIds` / `pinnedSessionIds` arrays; they return only the outcome and counts.
150
+ - The active list now reports `activeTotal` / `activeHasMore` and exposes a load-more row.
151
+ - PWA shell version bumped to v10.
152
+ - New `::selection`, focus-visible, question-card, and paging styles.
153
+
154
+ ## 0.3.0 — 2026-11-04
155
+
156
+ ### Added
157
+
158
+ - Session rename, pin/unpin, archive, and restore, with a lazy-loaded archived tab.
159
+ - Archived count and archived state in the session header.
160
+ - Light theme (system-following) plus a manual dark/light toggle.
161
+ - Session avatars, status dots, tabs, skeletons, and an in-page action dialog.
162
+ - Per-code-block copy button and a richer empty state.
163
+ - `npm run check` for syntax validation.
164
+
165
+ ### Changed
166
+
167
+ - PWA shell version bumped to v7.
168
+ - Session list rows are now structured for touch targets and per-session actions.
169
+ - Success notices use a green banner tone instead of the error style.
170
+
171
+ ## 0.2.0 — 2026-11-03
172
+
173
+ ### Added
174
+
175
+ - Context-pressure meter, goal phase/rounds, reasoning-effort selection.
176
+ - New-session preset picker, session search, jump-to-latest, richer Markdown.
177
+ - Preset-scoped slash commands (fixes missing `/compact`, `/goal`, `/plan`).
178
+ - Manual model catalog refresh and command cache refresh.
179
+
180
+ ## 0.1.0 — 2026-11-02
181
+
182
+ - Initial low-traffic mobile surface: compact session list, last-segment loading,
183
+ incremental polling, queue controls, goal controls, model selection, and PWA shell.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DSH Lite contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,250 @@
1
+ # DSH Lite
2
+
3
+ [中文](README.md)
4
+
5
+ [![test](https://github.com/T-splines/dsh-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/T-splines/dsh-lite/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D22-brightgreen.svg)](https://nodejs.org/)
8
+
9
+ A deliberately minimal mobile Web/PWA surface for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness).
10
+
11
+ It is not a compressed clone of the full Web UI. It is a pocket panel that transfers only what a phone actually needs:
12
+
13
+ - recent session titles, running state, search, rename, pin, archive / restore;
14
+ - current model, reasoning effort, context usage, current goal;
15
+ - the newest conversation segment only, with explicit backward paging;
16
+ - queue edit / remove / steer, slash commands;
17
+ - `ask_user_question` mirrored on both the full page and Lite — the default legacy blocking mode as well as `callId`-keyed timed mode; whichever side answers first cancels the other card, including late answers after a timeout;
18
+ - per-session composer drafts that survive switching and reloads;
19
+ - three visual families — Claude, Codex, and macOS — each with light, dark, and auto modes. Themes are a standard layer: features call `--ds-*` tokens and `.ds-*` primitives, never a family-specific color;
20
+ - an offline PWA shell, code-block copy, and Markdown tables;
21
+ - Chinese / English UI that follows the browser language on first visit, with a one-tap switch and a remembered choice;
22
+ - responsive layout: full-screen on phones, a one-row header at narrow widths, a real two-pane sidebar at 720–899px (foldables / small tablets), a compact phone landscape mode, and a centered console panel on desktop, all from the same shell assets.
23
+
24
+ The page itself contains no session data. Every request goes through DSH's existing `connection.fetch` seam and reuses DSH's Host/Origin fence and cookie authentication. There is no second auth scheme.
25
+
26
+ > **Network boundary:** Lite ships no public tunnel, relay, or second auth. Official support is a LAN or a user-managed private network (WireGuard recommended; Tailscale-style overlays also work). Public exposure and Cloudflare Tunnel are outside the supported scope. See [docs/networking.md](docs/networking.md) (Chinese) for the rationale, a WireGuard recipe, and acceptance checks.
27
+
28
+ > Unofficial plugin. It uses public DSH seams (`sessionQuery`, `sessionController`, `sessionProjections`, `commands`, `workspaceController`, `typertGateway.hasLiveClient`). The answer card shares the gateway's Remote pending event with the full page; this is runtime feature-detected, with one-surface arbitration as the fallback. No upstream patch is required.
29
+
30
+ | Dark | Light |
31
+ | --- | --- |
32
+ | ![Dark home](docs/screenshots/main-dark.png) | ![Light home](docs/screenshots/main-light.png) |
33
+ | ![Dark sessions](docs/screenshots/sheet-dark.png) | ![Light sessions](docs/screenshots/sheet-light.png) |
34
+
35
+ | Flat list with folder labels | Foldable two-pane (800px) | Phone landscape |
36
+ | --- | --- | --- |
37
+ | ![Flat list](docs/screenshots/sheet-flat-dark.png) | ![Foldable two-pane](docs/screenshots/foldable-dark.png) | ![Phone landscape](docs/screenshots/landscape-dark.png) |
38
+
39
+ | Approval | Image input | Run insights |
40
+ | --- | --- | --- |
41
+ | ![Approval card](docs/screenshots/approval-dark.png) | ![Image input](docs/screenshots/images-dark.png) | ![Run insights](docs/screenshots/insights-dark.png) |
42
+
43
+ | New-session location | Permission mode | English UI |
44
+ | --- | --- | --- |
45
+ | ![New-session location](docs/screenshots/workspace-dark.png) | ![Permission mode](docs/screenshots/permissions-dark.png) | ![English UI](docs/screenshots/i18n-en-dark.png) |
46
+
47
+ | Session actions | Archived | Answer card |
48
+ | --- | --- | --- |
49
+ | ![Session actions](docs/screenshots/dialog-dark.png) | ![Archived](docs/screenshots/archive-dark.png) | ![Answer card](docs/screenshots/question-dark.png) |
50
+
51
+ On desktop the shell becomes a centered console panel (1440×900):
52
+
53
+ ![Desktop](docs/screenshots/desktop-dark.png)
54
+
55
+ Every screenshot is generated by [`e2e/screenshots.mjs`](e2e/screenshots.mjs) against a throwaway dsh instance with a local fake model; the workspaces, session titles, questions and replies on camera all come from the fictional scripts in [`e2e/fake-scripts.mjs`](e2e/fake-scripts.mjs) — no real session content appears anywhere. The UI ships in both Chinese and English.
56
+
57
+ ## Themes
58
+
59
+ The three families are six palettes inside one standard layer, not three CSS forks. `theme.js` only chooses a family and a color mode; `theme.css` remaps the variables the existing components already read onto semantic tokens. New features use `--ds-*` and `.ds-*` and never need to know the active family. Switching is instant, persists locally, and can follow the OS Appearance. See [docs/design-system.md](docs/design-system.md) for the contract, token table, primitives, and contrast results (Chinese).
60
+
61
+ | Claude | Codex | macOS |
62
+ | --- | --- | --- |
63
+ | ![Claude light](docs/themes/claude-light.png) | ![Codex light](docs/themes/codex-light.png) | ![macOS light](docs/themes/mac-light.png) |
64
+ | ![Claude dark](docs/themes/claude-dark.png) | ![Codex dark](docs/themes/codex-dark.png) | ![macOS dark](docs/themes/mac-dark.png) |
65
+
66
+ The appearance panel in the session drawer footer switches family and mode:
67
+
68
+ ![Appearance panel](docs/themes/appearance-panel.png)
69
+
70
+ ## Low-traffic by design
71
+
72
+ - Bootstrap returns the first 30 session headers, the model catalog, presets, and an archive count; no projection fold.
73
+ - Lists page 30 at a time; search runs server-side across every session or archived row, not just the loaded page.
74
+ - Opening a session returns at most 12 visible messages (12k characters per message).
75
+ - Polling sends `after=cursor`; when nothing changed the server returns `messages: []` and only state fields move.
76
+ - Tool calls, attachments, traces, old turns, and full projections are never loaded.
77
+ - Archive/pin mutations return only the outcome and counts, not the full ID arrays.
78
+ - The PWA shell is precached once; JS/CSS/icons are not requested again until the shell version changes. The theme layer is `theme.css` (11.9 KB gzip) plus `theme.js` (4.2 KB gzip), shared by all six palettes.
79
+ - Theme switching only changes two attributes on `<html>` and CSS variables; it fetches nothing and does not reload the page.
80
+ - The model catalog is cached for 5 minutes server-side, command lists for 30 seconds per session.
81
+
82
+ Context usage comes from DSH's existing `contextPressure` projection. Goals, model selection, and queue state also reuse existing projections. The plugin does not write session files or add its own database.
83
+
84
+ ## Features
85
+
86
+ ### Sessions
87
+
88
+ - one list grouped by Workspace (or flat), with title / directory / folder search and live / idle / cold status;
89
+ - a view menu owns the list: Workspace / Flat; Recent / Created / Title; Hide / Show / Only archived. Pinned first, collapsible groups, a 5-row waterline that automatically rises to cover running sessions, and show-more/collapse; ungrouped sessions last;
90
+ - search always falls back to a flat result list labeled with each session’s folder; new hosts match Workspace titles server-side, older hosts get the same matches supplemented from loaded rows;
91
+ - when an older host omits `workspaceId`, sessions group by an exact cwd match against canonical Workspace paths; after a restart the host’s `workspaceId` is authoritative;
92
+ - create with an optional agent preset;
93
+ - rename (synced back to the full UI);
94
+ - pin / unpin, with pinned sessions sorted first;
95
+ - archive, with an explicit confirmation before stopping running work;
96
+ - lazy-loaded archived tab, 30 rows per page with load-more; search covers the whole archive;
97
+ - active and archived lists show both total and loaded counts.
98
+
99
+ ### Conversation
100
+
101
+ - newest segment by default; “load earlier” pages backward on demand;
102
+ - incremental `after` polling;
103
+ - Markdown headings, lists, quotes, rules, links, inline code, fenced code, tables, and strikethrough;
104
+ - per-code-block copy with a legacy fallback when Clipboard API is unavailable;
105
+ - visible error bubbles for model, command, and compaction failures;
106
+ - sticky “jump to latest” control;
107
+ - multiline composer where Enter inserts a newline; sending is an explicit button;
108
+ - composer drafts persist per session across switches and reloads;
109
+ - images: camera / library picker, compressed in the browser to a 1600px long edge in WebP/JPEG, at most 2 MB each and 4 per message; image-only messages work; unsent images live in memory only and are cleared when switching sessions;
110
+ - `ask_user_question` calls appear as an answer card with single-select, multi-select, custom text, and skip;
111
+ - the card appears on both the full page and Lite; a Lite answer settles the same Remote pending event, so the full-page card receives the normal cancel frame and closes without switching pages;
112
+ - the default `legacy` blocking mode has no `callId`, so Lite recognises the host's pending event by "same agent + same questions" and settles that; the full-page card still cancels normally, and a question can be answered from Lite even when no full page is open;
113
+ - permission `approval` requests appear as a card only while Lite is polling that session; choose Reject or Allow once. There is no Always allow: an idle page hands the request back after 45 seconds, with a 5-minute cap.
114
+
115
+ ### Controls
116
+
117
+ - queue edit / remove / steer;
118
+ - slash-command completion and execution, including preset commands such as `/compact`, `/goal`, and `/plan`;
119
+ - goal pause / resume / edit / delete;
120
+ - model and reasoning-effort selection with manual catalog refresh;
121
+ - while running, one activity line shows the latest pending tool name, display target, elapsed time, and parallel count, or “generating a reply” between tools; it never loads full arguments or results;
122
+ - completion awareness: when a turn goes from running to idle, a live page shows an in-page banner. After you enable Notifications in the session drawer and grant browser permission, a hidden page uses slow polling to detect completion, posts a browser notification, and adds an unread dot to the title. There is no push service; a closed or killed page is not guaranteed to notify;
123
+ - plan-mode badge: while plan mode is active the header shows `Plan`; tap it to run `/plan off`. A switch in progress shows `Plan…` and is temporarily disabled;
124
+ - run insights: tap the rounded context button (or Session settings → Run insights) for context occupancy, cumulative input/output/cache tokens, prompt composition, and plan state. Details are fetched on demand and stay out of polling;
125
+ - session fork: fork the completed-turn prefix from Session settings and open the new Session; Copy Markdown and ZIP export reuse the host's `/api/session.markdown` and `/api/session.export` routes (the deployment must enable session export);
126
+ - new-session location: the drawer can create into a host Workspace from the workspace registry or enter a custom directory; Automatic keeps the default location;
127
+ - permission mode: Session settings reads and switches the host's configured permission presets (read-only / workspace-write / full access); the change applies to the current Session immediately;
128
+ - interface language: the first visit follows the browser language; a one-tap switch at the bottom of the session drawer persists the choice locally;
129
+ - context percentage, goal rounds, running / waiting state.
130
+
131
+ ## Install
132
+
133
+ Requirements: DSH 0.2.2-rc.1 or compatible (`engines.dsh` declares `>=0.2.2-0 <0.3.0-0`), Node.js >= 22, Cordis 4 (peer dependency).
134
+
135
+ ### From GitHub (no npm needed)
136
+
137
+ ```bash
138
+ dsh plugin --profile web add github:T-splines/dsh-lite # follows main
139
+ dsh plugin --profile web add "github:T-splines/dsh-lite#v0.6.1" # pinned to a tag
140
+ ```
141
+
142
+ `dsh plugin add` forwards to pnpm verbatim, so any GitHub spec pnpm understands works; the plugin has zero dependencies and no build step, so a source install never triggers the `allowBuilds` approval. The prebuilt tarball attached to each GitHub Release works too:
143
+
144
+ ```bash
145
+ dsh plugin --profile web add https://github.com/T-splines/dsh-lite/releases/download/v0.6.1/dsh-lite-0.6.1.tgz
146
+ ```
147
+
148
+ ### From npm
149
+
150
+ The package name is `dsh-lite` (unscoped). The first npm release is still pending; once published:
151
+
152
+ ```bash
153
+ dsh plugin --profile web add dsh-lite
154
+ ```
155
+
156
+ ### From source
157
+
158
+ ```bash
159
+ git clone https://github.com/T-splines/dsh-lite.git
160
+ cd dsh-lite
161
+ dsh plugin --profile web add "$PWD"
162
+ ```
163
+
164
+ Either command registers the dependency and bundle in the Web profile; `cordis.patch.yml` is applied automatically by `dsh.bundle.patch`, so never merge it into the profile patch by hand.
165
+
166
+ > ⚠️ **Restart DSH after installing or upgrading.** `/api/lite/*` routes are registered at startup and hot reload covers configuration, not code — the page may open before the restart, but the new routes will not be there.
167
+
168
+ Then open `http://<dsh-host>:<port>/lite/`. Before the first visit from a phone, open the full DSH page once in the same browser so it receives the login cookie; Lite reuses that cookie and has no login of its own.
169
+
170
+ Uninstall: `dsh plugin --profile web remove dsh-lite`.
171
+
172
+ ### Getting between the two pages
173
+
174
+ | Direction | Entry | Session carried over? |
175
+ |:--|:--|:--|
176
+ | Full page → Lite | "Open in Lite" in the session header's "More actions" menu; or open `/lite/` directly | Yes: `/lite/?session=<id>` opens the same session in Lite |
177
+ | Lite → Full page | the "full page" button in the session drawer footer | Yes: Lite writes the full page's session selection (`dsh.sessions.current`) first, so the full page reopens the same session |
178
+
179
+ A desktop app has no address bar, which is why the first row is how desktop users reach Lite — the menu item is there as soon as the plugin is installed in that host. The desktop shell does not let pages open new windows, so Lite replaces the window's current page; on wide screens Lite's header has a "full page" button to go back in one click, and the session list opens by default.
180
+
181
+ ## API
182
+
183
+ All routes are registered on `connection.fetch` and inherit DSH's Host/Origin and cookie checks.
184
+
185
+ | Method | Path | Purpose |
186
+ | --- | --- | --- |
187
+ | `GET` | `/api/lite/bootstrap` | sessions, models, presets, workspaces, archive count |
188
+ | `GET` | `/api/lite/session?id=&after=` | state + newest segment / incremental messages |
189
+ | `GET` | `/api/lite/insights?id=` | on-demand plan / token usage / prompt composition |
190
+ | `GET` | `/api/lite/history?id=&beforeSeq=` | backward paging |
191
+ | `GET` | `/api/lite/sessions?scope=&offset=&q=` | active/archived paging and server-side search |
192
+ | `GET` | `/api/lite/archived?offset=&q=` | archived sessions (legacy-compatible) |
193
+ | `POST` | `/api/lite/queue` | `edit`, `remove`, `steer` |
194
+ | `POST` | `/api/lite/prompt` | queue-mode text with optional compressed image content parts |
195
+ | `POST` | `/api/lite/model` | model + reasoning effort |
196
+ | `POST` | `/api/lite/cancel` | stop the running turn |
197
+ | `POST` | `/api/lite/new` | create a session, optional `agentPreset` / `workspaceId` |
198
+ | `POST` | `/api/lite/fork` | fork a session (latest completed turn by default) |
199
+ | `GET` | `/api/lite/permissions?id=` | current permission preset and selectable options |
200
+ | `POST` | `/api/lite/permissions` | switch the current session's permission preset |
201
+ | `POST` | `/api/lite/rename` | rename a session |
202
+ | `POST` | `/api/lite/archive` | archive, optional `stopActivity` |
203
+ | `POST` | `/api/lite/unarchive` | restore an archived session |
204
+ | `POST` | `/api/lite/pin` | pin / unpin a session |
205
+ | `POST` | `/api/lite/answer` | answer a mirrored question or one still answerable after a timeout |
206
+ | `POST` | `/api/lite/approval` | allow once / reject a permission approval held by Lite |
207
+ | `GET` | `/api/lite/commands?id=` | slash commands visible to the agent |
208
+ | `POST` | `/api/lite/command` | execute a slash command |
209
+
210
+ ## Security and privacy
211
+
212
+ - No new authentication; unauthenticated requests are rejected by DSH's `connection.fetch`.
213
+ - No new network ingress: Lite opens no port and starts no tunnel or relay. Official deployments stay on a LAN or a private network such as WireGuard / Tailscale. Public exposure bypasses that boundary and is the deployer's risk.
214
+ - Strict CSP: `default-src 'self'`, no inline scripts/styles, no external fonts or images.
215
+ - The service worker caches only the `/lite/` shell; `/api/` bypasses the cache and API responses are `no-store`.
216
+ - No telemetry, external requests, or extra server-side persistence. Unsent drafts live only in the browser's localStorage and never leave the device.
217
+ - Unsent images live only in page memory and are cleared when switching sessions; sending hands them to the host like any other message content.
218
+ - An approval card appears only while that session is being polled by Lite. Decisions are not persisted, focus defaults to Reject, and there is no Always allow.
219
+ - Completion notifications require explicit opt-in in the session drawer plus browser permission. Detection uses slow polling only while this page is alive; there is no push service, and a closed or killed page is not guaranteed to notify.
220
+ - Archiving a running session requires explicit confirmation in the UI; the actual stop is enforced by DSH's workspace registry.
221
+
222
+ ## Non-goals
223
+
224
+ File attachments (PDF/text; images are supported), tool traces, file browsing, jobs/schedules, and settings stay in the full UI. Public/port-forwarded exposure, managed relays, and third-party remote gateways (including Cloudflare Quick Tunnel) are not supported. A Cloudflare Named Tunnel + Access setup is documented only as an experimental, user-managed option in [docs/networking.md](docs/networking.md). Push notifications after the app is closed need a thin shell or a host webhook and are deferred to P2. Approvals are held only while Lite is looking at that session; leaving the session hands the request back or fails closed instead of deciding in the background. If a future DSH build removes the gateway's pending-event table, the answer card degrades to one-surface arbitration: the surface being looked at wins, otherwise a connected full page wins. Lite is for “look, reply, stop, adjust, answer one question” on a phone.
225
+
226
+ ## Development
227
+
228
+ No build step. Backend lives in `lib/index.js`; frontend in `public/`. Commit conventions, versioning, and the release checklist live in [CONTRIBUTING.en.md](CONTRIBUTING.en.md).
229
+
230
+ ```bash
231
+ npm run check # syntax-check the backend, frontend, i18n module, and service worker
232
+ npm test
233
+ ```
234
+
235
+ Restart DSH after backend changes. Static files are re-read by mtime, so a page refresh is enough. When changing shell assets, bump `index.html`, the i18n import in `app.js`, the `CACHE` name, and the shell URLs in `sw.js` to the same version; `npm test` checks that they agree.
236
+
237
+ For copy, static nodes use `data-i18n*`; dynamic strings call `t()` from `public/i18n.js`. `npm test` rejects a missing translation, a placeholder mismatch, or a leftover untranslated literal.
238
+
239
+ ## Roadmap
240
+
241
+ The Lite+ phases, acceptance criteria, and hard limits live in [docs/lite-plus-plan.md](docs/lite-plus-plan.md) (Chinese). Which official capability belongs to Lite, to the full page, or to neither is decided in [docs/parity.md](docs/parity.md) (Chinese).
242
+
243
+ - P0 / P1 are complete: approvals, images, activity line, completion awareness, plan badge, run insights, fork/export, Workspaces, permission presets, and the Chinese/English UI;
244
+ - candidate pool, ordered by supervision value: a todo strip, "waiting for answer / approval" markers in the list, agent-preset choice when creating a session, voice input;
245
+ - session deletion is deferred because the host exposes no stable API;
246
+ - P2: evaluate a thin shell only if notifications after the app is closed become mandatory.
247
+
248
+ ## License
249
+
250
+ MIT