@xmoon76/dsh-pi-tui 0.5.7 → 0.5.9
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/README.en.md +64 -26
- package/README.md +64 -26
- package/cordis.patch.yml +13 -0
- package/dist/acp-stdio.mjs +151 -0
- package/dist/{bootstrap-C9nl6e13.mjs → bootstrap-CVyHGQDX.mjs} +22330 -6888
- package/dist/browser-CDUSHIIr.mjs +76 -0
- package/dist/builtins.mjs +2 -2
- package/dist/{client-bootstrap-CGezi85O.mjs → client-bootstrap-4UoeVIHE.mjs} +2407 -1830
- package/dist/client-runtime-BHBlVUf5.mjs +1376 -0
- package/dist/{daemon-launcher-H_1r5Cqs.mjs → daemon-launcher-DxIgjBHW.mjs} +1551 -57
- package/dist/daemon-launcher.d.mts +85 -14
- package/dist/daemon-launcher.mjs +2 -2
- package/dist/diagnostics-Db5iVcuJ.mjs +123 -0
- package/dist/{entry-control-jBfKn1qO.mjs → entry-control-BDLZgg4m.mjs} +1 -1
- package/dist/{extensions-6a5vvJUT.mjs → extensions-Dx7ncPNA.mjs} +1 -4
- package/dist/extensions.mjs +1 -1
- package/dist/handoff-BjoEy3f8.mjs +106 -0
- package/dist/history-search-limits-Cx2UvRC2.mjs +16 -0
- package/dist/history-search-remote-BHuoellG.mjs +113 -0
- package/dist/history-search-remote-BzXdvrxk.mjs +26 -0
- package/dist/history-search-seat-BcHJTpeB.mjs +639 -0
- package/dist/history-search-seat-rZcq0XV6.mjs +639 -0
- package/dist/{host-bootstrap-MVxks641.mjs → host-bootstrap-BfnufpnW.mjs} +37 -72
- package/dist/{host-foundation-probe-DK7n5jDu.mjs → host-foundation-probe-DlD8-N_Q.mjs} +2 -2
- package/dist/host-runtime.mjs +5611 -290
- package/dist/index.d.mts +13 -6
- package/dist/index.mjs +22766 -6893
- package/dist/installed-dsh-BjUiJSwR.mjs +142 -0
- package/dist/interaction-port-D1Yv9zgu.mjs +45 -0
- package/dist/local-acp-control-CC5z4Xbq.mjs +304 -0
- package/dist/local-acp-endpoint-D1jYdJdv.mjs +41 -0
- package/dist/local-acp-listener-Cmgb5M0H.mjs +9493 -0
- package/dist/local-acp-status-B_25Q6kU.mjs +101 -0
- package/dist/local-client.mjs +719 -93
- package/dist/local-daemon-control-BFJAC8Kg.mjs +2199 -0
- package/dist/local-daemon-control-Bm3imctD.mjs +2101 -0
- package/dist/{local-discovery-BPZw1wEd.mjs → local-discovery-BMhaGIiJ.mjs} +254 -544
- package/dist/{local-discovery-BMoNXZjJ.mjs → local-discovery-Ba7_-NNC.mjs} +1 -1
- package/dist/{local-discovery-Bq3jLAn1.mjs → local-discovery-QSbFpjK2.mjs} +301 -544
- package/dist/local-host.mjs +970 -501
- package/dist/local-profile-daemon-admin-otpm69R6.mjs +469 -0
- package/dist/{local-scope-DEuGAy8l.mjs → local-scope-5DEKA_lW.mjs} +1075 -31
- package/dist/{local-transport-X4ZCe2uE.mjs → local-transport-DeWmdZ5E.mjs} +14 -3
- package/dist/{local-web-control-DKWtXIkr.mjs → local-web-control-Dny93N-r.mjs} +10 -7
- package/dist/{local-workspace-object-D06GL0UO.mjs → local-workspace-object-D0RVQt8U.mjs} +33 -9
- package/dist/model-selection-CYlqg2DV.mjs +83 -0
- package/dist/native-client-domains-Dg4srzYt.mjs +2 -0
- package/dist/native-client.d.mts +735 -0
- package/dist/native-client.mjs +3534 -0
- package/dist/{open-CmOBxSjN.mjs → open-QQva8-ar.mjs} +24 -20
- package/dist/{pi-tui-remote-contribution-Do8ECrUy.mjs → pi-tui-remote-contribution-565wiLWp.mjs} +741 -150
- package/dist/preferences.mjs +1 -1
- package/dist/{profile-preferences-migration-CThz4rHH.mjs → profile-preferences-migration-CNOWIdnr.mjs} +1 -1
- package/dist/{profile-preferences-migration-BfUGdPZx.mjs → profile-preferences-migration-IrnXcJWK.mjs} +10 -8
- package/dist/{prompt-sections-DXmjB58H.mjs → prompt-sections-Bi-9_Gr_.mjs} +28 -10
- package/dist/{prompt-sections-DUKmWb8g.mjs → prompt-sections-DFS1dqsY.mjs} +342 -56
- package/dist/{dist-BFgC-5tL.mjs → recall-scope-9Nuoto_i.mjs} +353 -1
- package/dist/rolldown-runtime-8H4AJuhK.mjs +14 -0
- package/dist/schema-CCLvDa7Q.mjs +177 -0
- package/dist/{schema-qE_P09zJ.mjs → schema-t97l3aK8.mjs} +56 -3
- package/dist/{session-DC0XQr5O.mjs → session-Cs8iLCEx.mjs} +784 -342
- package/dist/{session-Cihe8PPS.mjs → session-EBRZF6Ow.mjs} +783 -341
- package/dist/session-create-facts-CkfG5DpQ.mjs +20 -0
- package/dist/{startup-CarQxWwi.d.mts → startup-Dti3Udne.d.mts} +30 -3
- package/dist/{startup-CARqn3kV.mjs → startup-UtFQSDe_.mjs} +90 -15
- package/dist/startup.d.mts +2 -2
- package/dist/startup.mjs +1 -1
- package/dist/task-read-remote-DRtkXDrZ.mjs +1083 -0
- package/dist/{terminal-progress-source-D4DHyXDo.mjs → terminal-progress-source-VsczdXA-.mjs} +610 -335
- package/dist/{transcript-view-a7cROAaI.mjs → transcript-view-B6vCnukn.mjs} +2284 -1166
- package/dist/{transcript-view-hvNVkPtv.mjs → transcript-view-DSSdE2vK.mjs} +2191 -765
- package/dist/write-failure-xNKczXH7.mjs +189 -0
- package/package.json +25 -8
- package/dist/local-acp-listener-CNkguN5-.mjs +0 -2566
- package/dist/local-daemon-control-Bg9s2aYi.mjs +0 -1424
- package/dist/local-daemon-control-Cu_4FIdd.mjs +0 -1585
- package/dist/local-profile-daemon-admin-AXgVH-6y.mjs +0 -91
- package/dist/preset-BcWqOtY7.mjs +0 -46
package/README.en.md
CHANGED
|
@@ -7,7 +7,7 @@ English | [简体中文](README.md)
|
|
|
7
7
|
|
|
8
8
|
**A terminal frontend for DeepSeek Harness. One Host, with TUI, Web and ACP clients accessing the same Agent Session.**
|
|
9
9
|
|
|
10
|
-
**Direct** remains the default, ready-to-use mode.
|
|
10
|
+
**Direct** remains the default, ready-to-use mode. Daemon became available as an opt-in on Linux/macOS in 0.5.8, and 0.5.9 extends it to native Windows 11 x64. An independent local Host retains Sessions and ongoing work as terminal Clients disconnect and reconnect; other TUIs, the official Web frontend and local ACP clients can access Sessions on the same Host.
|
|
11
11
|
|
|
12
12
|
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) remains the authority for the Agent Loop, models, tools, persistence, permissions and concurrent writes. `dsh-pi-tui` is a third-party frontend, not a second Agent Runtime.
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ English | [简体中文](README.md)
|
|
|
21
21
|
|
|
22
22
|
### Stable / latest
|
|
23
23
|
|
|
24
|
-
**0.5.
|
|
24
|
+
**0.5.9 is the stable release described by this README (npm `@latest`).** The recommended DSH pairing is **0.2.2-rc.5**. Install DeepSeek Harness first, then the TUI bundle into the `pi-tui` profile:
|
|
25
25
|
|
|
26
26
|
~~~sh
|
|
27
27
|
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.2-rc.5
|
|
@@ -29,22 +29,25 @@ dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@latest
|
|
|
29
29
|
dsh --profile pi-tui
|
|
30
30
|
~~~
|
|
31
31
|
|
|
32
|
-
### Exact version pairing (0.5.
|
|
32
|
+
### Exact version pairing (0.5.9)
|
|
33
33
|
|
|
34
|
-
**0.5.
|
|
34
|
+
**0.5.9 requires Node.js ≥24.9.0 and DSH ≥0.2.2-rc.3. DSH 0.2.2-rc.5 is recommended** (the exact qualification target for this release). For a reproducible installation, pin both package versions:
|
|
35
35
|
|
|
36
36
|
~~~sh
|
|
37
37
|
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.2-rc.5
|
|
38
|
-
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@0.5.
|
|
38
|
+
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@0.5.9
|
|
39
39
|
dsh --profile pi-tui
|
|
40
40
|
~~~
|
|
41
41
|
|
|
42
42
|
| TUI | DSH | Status |
|
|
43
43
|
|---|---|---|
|
|
44
|
-
| `0.5.
|
|
45
|
-
| `0.5.6` | `0.2.2-rc.1` |
|
|
44
|
+
| `0.5.9` | `>=0.2.2-rc.3`; recommended `0.2.2-rc.5` | **This release** |
|
|
45
|
+
| `0.5.6` | `0.2.2-rc.1` | Historical compatible release |
|
|
46
|
+
| `0.5.5` | `0.2.1-rc.5` | Historical compatible release |
|
|
46
47
|
|
|
47
|
-
**
|
|
48
|
+
**Fresh install:** The DSH plugin command above installs the TUI without manually adding `@deepseek-ai/dsh-client-store`, `zustand` or `immer`. A failed Daemon Client startup reports its own `$DSH_HOME/logs/pi-tui-client/startup-*.log` file; `daemon logs` covers Host logs only.
|
|
49
|
+
|
|
50
|
+
**Upgrade precaution:** Before changing the DSH Runtime, finish in-flight Turns/Jobs, stop the previous Host and back up Profiles, Sessions and required data. Cross-DSH schema downgrade in place is not guaranteed. Do not pair 0.5.9 with rc.2 or earlier. See the [compatibility guide](docs/guides/dsh-compatibility.md) for historical pairs and recovery.
|
|
48
51
|
|
|
49
52
|
### Next / npm line (validation)
|
|
50
53
|
|
|
@@ -60,24 +63,25 @@ dsh --profile pi-tui
|
|
|
60
63
|
|
|
61
64
|
### Two modes, one DSH Session authority
|
|
62
65
|
|
|
63
|
-
| | Direct (default) | Daemon (opt-in
|
|
66
|
+
| | Direct (default) | Daemon (opt-in, Linux/macOS/Windows 11 x64) |
|
|
64
67
|
|---|---|---|
|
|
65
|
-
| Launch | `dsh --profile pi-tui` | `DSH_PI_TUI_BACKEND=daemon dsh --profile pi-tui` |
|
|
68
|
+
| Launch | `dsh --profile pi-tui` | `DSH_PI_TUI_BACKEND=daemon dsh --profile pi-tui` (PowerShell: `$env:DSH_PI_TUI_BACKEND='daemon'; dsh --profile pi-tui`) |
|
|
66
69
|
| Process | TUI and Host in one process | Independent Host; TUI is a detachable Client |
|
|
67
70
|
| Frontends | Current in-process terminal surface | Multiple TUIs + official Web + optional local ACP on one Host/Session |
|
|
68
71
|
| Exit | Ends the Direct application | Normally detaches only the Client; does not stop Host |
|
|
69
|
-
| Service | No separate management | Optional Linux systemd
|
|
72
|
+
| Service | No separate management | Optional Linux systemd user service / macOS LaunchAgent / Windows login task |
|
|
70
73
|
|
|
71
|
-
You can also save `Daemon` under `/settings →
|
|
74
|
+
You can also save `Daemon` under `/settings → Host → Backend` for the **next cold launch**. `DSH_PI_TUI_BACKEND` overrides that preference for one launch without saving it. Selecting a backend does not hot-migrate a Host. Installing an OS user service is optional, not a prerequisite. Sessions and Agents remain Host-owned.
|
|
72
75
|
|
|
73
76
|
### Agents, tasks and sessions
|
|
74
77
|
|
|
75
78
|
- **Agent and tools:** streamed Markdown, Thinking / Tool / Context disclosure, approvals and Questions, model/reasoning-effort selection, Plan, Goal and Todo.
|
|
76
|
-
- **Sessions and workspaces:** `/sessions
|
|
79
|
+
- **Sessions and workspaces:** `/sessions` browses Sessions by workspace with live status, title-first rows and an automatic overview; `F2` opens full Details and `Space` reads the committed Transcript without switching Sessions. Supports `/new`, `/resume`, `/fork`, `/rewind`, `--session` and `--continue`. Daemon can reuse eligible blank Sessions.
|
|
77
80
|
- **Team / Subagent / Job:** toggle Root Agent Team in `/model`; `/tasks` displays Work/Team, nested Subagents and Jobs. Subagents are expanded by default; retained Job history is optionally disclosed.
|
|
78
|
-
- **
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
81
|
+
- **Presets:** bare `/preset` opens a two-page Catalog + Details surface — search, Built-in/Custom groups and state chips; browsing and reading Details never write. Only the explicit bottom actions `Use next` / `Use session` and `Set default` apply a preset or save the new-session default. `/preset status`, `/preset default [<id>]` and `/preset <id>` remain available.
|
|
82
|
+
- **Input and shell:** `@file` completion, image and file attachments, `Ctrl+V` image paste, `!` / `!!` Host Shell, external editor, customizable Footer. On Windows Direct and Daemon, `!` / `!!` run on the Host with the official PowerShell shell; the sandbox uses DSH's ACL backend with partial enforcement, and native command/variable/git completion is unavailable (ordinary path completion remains).
|
|
83
|
+
- **Reading and search:** `/display` switches Full / Focus / Compact (Compact by default when unset; explicit preferences are preserved), with Transcript View / Full search, folding and `Ctrl+R` prompt history search. Daemon uses Host history with cross-Client search, progressive results and automatic paging; Up/Down recalls the current Session, and an unused blank Session can temporarily borrow same-directory history.
|
|
84
|
+
- **Settings and plugins:** unified adaptive Settings layouts, grouped configuration editing, Web Search / Fetch and MCP workbenches, Computer Use application management, provider authorization and credentials, approvals, Plugin Manager, dynamic Extension Settings and Client-local `./tui` plugin loading.
|
|
81
85
|
- **Images and delivery:** terminal-gated image/static SVG/charts, `/view-image`, `/deliverables`, `/export`; Kitty, SIXEL and supported iTerm2 paths.
|
|
82
86
|
- **Optional experimental renderer:** `DSH_PI_TUI_RENDERER=tsp` enables a subset of Tern TSP native Transcript/Work Hub interactions; it does not replace every PiTui Settings/Plugins surface.
|
|
83
87
|
|
|
@@ -87,19 +91,21 @@ You can also save `Daemon` under `/settings → General → Backend` for the **n
|
|
|
87
91
|
|---|---|
|
|
88
92
|
| `/sessions` · `/resume` · `/new` | Find or start sessions |
|
|
89
93
|
| `/model` · `/tasks` · `/plan` · `/goal` | Models, jobs and Agent modes |
|
|
94
|
+
| `/preset` | Browse/apply a session preset or save the new-session default |
|
|
90
95
|
| `/settings` · `/plugins` · `/keybindings` | Configuration and extensions |
|
|
91
96
|
| `/display` · `/export` · `/deliverables` | Reading and exporting |
|
|
92
97
|
| `Ctrl+F` · `Ctrl+Shift+F` | Rendered-view / available Session-history search |
|
|
93
98
|
| `Ctrl+R` · `Ctrl+G` | Prompt history / external editor |
|
|
99
|
+
| `F2` · `Space` (in `/sessions`) | Session Details / full committed Transcript |
|
|
94
100
|
| `Ctrl+O` · `Alt+T` | Tool/Context and Thinking disclosure |
|
|
95
|
-
| `Ctrl+C` · `Ctrl+D` |
|
|
101
|
+
| `Ctrl+C` · `Ctrl+D` | Ctrl+C clears editable drafts first, then cancels work or confirms exit (three-second window); Ctrl+D retains its editor/exit behavior |
|
|
96
102
|
| `!` · `!!` | Host Shell with / without Session persistence |
|
|
97
103
|
|
|
98
|
-
These are default mappings and common entries; `/
|
|
104
|
+
These are default mappings and common entries; `/keybindings` shows the **effective** keys after customizations. Type `/` to search and select commands and available Skills; use `/skill <name> [args]` to invoke a Skill explicitly (including when a same-named command would otherwise win), while bare `/skill` only prints its usage. `/transcript` currently uses the official Direct Markdown export; `/export` creates a separate ZIP archive saved on the Client filesystem. `PI_IMAGE_PROTOCOL=none` disables pixel previews, not attachments.
|
|
99
105
|
|
|
100
|
-
## Daemon quick start (Linux / macOS)
|
|
106
|
+
## Daemon quick start (Linux / macOS / native Windows 11 x64)
|
|
101
107
|
|
|
102
|
-
A system service is not required to start a standalone Host. Try one launch:
|
|
108
|
+
A system service is not required to start a standalone Host. Try one launch (the interactive Daemon Client supports Linux/macOS and native Windows 11 x64 ordinary users on a local fixed-NTFS Profile):
|
|
103
109
|
|
|
104
110
|
~~~sh
|
|
105
111
|
DSH_PI_TUI_BACKEND=daemon dsh --profile pi-tui
|
|
@@ -113,11 +119,16 @@ dsh --profile pi-tui daemon logs --lines 200
|
|
|
113
119
|
dsh --profile pi-tui daemon start
|
|
114
120
|
dsh --profile pi-tui daemon stop
|
|
115
121
|
dsh --profile pi-tui daemon restart
|
|
116
|
-
dsh --profile pi-tui daemon install
|
|
117
|
-
dsh --profile pi-tui daemon
|
|
122
|
+
dsh --profile pi-tui daemon install # Linux / macOS
|
|
123
|
+
dsh --profile pi-tui daemon enable # Linux login startup
|
|
124
|
+
dsh --profile pi-tui daemon disable # Linux withdraw login startup
|
|
125
|
+
dsh --profile pi-tui daemon install --autostart # macOS login + recovery; Windows login-only
|
|
126
|
+
dsh --profile pi-tui daemon uninstall # Linux / macOS; Windows login task
|
|
118
127
|
~~~
|
|
119
128
|
|
|
120
|
-
|
|
129
|
+
Windows supports the independent Host, interactive Daemon Client, management commands, official Web frontend and local ACP (Named Pipe). Plain `daemon install` is unavailable; `daemon install --autostart` registers a login task for the current ordinary user, and `daemon uninstall` removes the task without stopping the independent Host. Windows does not support `/reload-client`; use `/exit` and relaunch to adopt an updated build.
|
|
130
|
+
|
|
131
|
+
`daemon install` only creates or verifies the optional Profile service definition or login task; it does **not** start, enable or migrate the Host. Linux uses install then explicit enable; macOS supports `--autostart` on a fresh install (login and abnormal-exit recovery); Windows `--autostart` is login-only. Existing service definitions are not automatically rewritten. `daemon stop` and `restart` may interrupt in-flight Turns/Jobs across Clients; a running manager is not Host readiness. See the [Daemon guide](docs/guides/daemon.md#optional-os-supervision).
|
|
121
132
|
|
|
122
133
|
Within the **same DSH Runtime and Profile**, update the installed TUI bundle through official plugin management. The old Host may continue serving existing work; explicitly run `daemon restart` when you want its static code replaced (with an interruption). Same-Profile older service definitions do not require a routine uninstall first. **Changing DSH Runtime** is not a hot upgrade; stop, back up and cold start a supported pair. See the [Daemon guide](docs/guides/daemon.md).
|
|
123
134
|
|
|
@@ -133,15 +144,42 @@ dsh --profile pi-tui web status
|
|
|
133
144
|
|
|
134
145
|
Also available: `web disable` / `web open`. The commands do **not** start a Host or create a Session. The `web url` output contains an authentication token: handle it as a secret. The official Web page lets users select sessions held by that Host.
|
|
135
146
|
|
|
136
|
-
|
|
147
|
+
In a connected Daemon TUI, `/web` opens **`Settings → Host → Web UI`** directly: the same page shows the running Host's live state and actions (Open in browser / Copy access link / Enable / Disable, with a confirmation before disabling) and the `Start automatically` preference that applies **only to the next Host start**. Neither changes the other, and the launch link is read only by an explicit Open/Copy and never painted.
|
|
148
|
+
|
|
149
|
+
In a connected Daemon TUI, `/acp` opens **`Settings → Host → ACP access`** directly: the same page shows the running Host's local ACP listener state (Enabled / Disabled / Changing / Unavailable; on Direct it states `Unavailable · Split Host only`), `Enable ACP` and a two-step-confirmed `Disable ACP…`, `Copy client command` — the exact `dsh --profile … acp stdio` command of the proven Profile, read only by that explicit copy — the `Start automatically` preference that applies **only to the next Host start**, and the `Client Setup` guidance. The runtime state and the next-start preference are separate authorities: toggling the running Host never changes the preference, saving the preference never starts or stops the current listener, and leaving the page or the TUI never undoes an accepted Host change.
|
|
150
|
+
|
|
151
|
+
**ACP v1** is a default-off, same-user local interface. An external ACP client joins through the current Profile's public `dsh --profile pi-tui acp stdio` command: it relays that client's stdio to the existing Host's local ACP listener. It creates **no** second Host, Agent, Session or Writer and never starts the Host or enables the listener by itself. It is the stdio command you configure in an ACP client, not a command whose interactive terminal is expected to show a TUI.
|
|
152
|
+
|
|
153
|
+
The listener's runtime state can also be read and toggled without opening a TUI (these commands never start a Host either):
|
|
154
|
+
|
|
155
|
+
~~~sh
|
|
156
|
+
dsh --profile pi-tui acp status
|
|
157
|
+
dsh --profile pi-tui acp enable
|
|
158
|
+
dsh --profile pi-tui acp disable
|
|
159
|
+
~~~
|
|
160
|
+
|
|
161
|
+
`acp status` is read-only and prints one `acp=enabled|disabled|changing|unavailable` line; `acp enable` / `acp disable` send exactly one write and print the state the Host actually reached — a `changing` state or a lost response is never guessed as success. They manage only the running Host of the current Profile: they do not change the next-launch `autoStart`, do not stop the Host/Agent/Session/TUI, and `disable` closes existing ACP peers and stops accepting new ones.
|
|
162
|
+
|
|
163
|
+
Preparation: start and confirm the Host, then switch the listener to **Enabled** from a connected Daemon TUI with `/acp` (or with the headless `acp enable`) — its next-start-only `Start automatically` preference lives in `/settings → Host → ACP access` — confirm `acp=enabled` with `daemon status` or `acp status`, and only then put the command into the external ACP client's stdio command configuration:
|
|
164
|
+
|
|
165
|
+
~~~sh
|
|
166
|
+
dsh --profile pi-tui daemon start
|
|
167
|
+
dsh --profile pi-tui daemon status # host=ready, acp=enabled
|
|
168
|
+
# In the external ACP client's stdio command configuration:
|
|
169
|
+
dsh --profile pi-tui acp stdio
|
|
170
|
+
~~~
|
|
171
|
+
|
|
172
|
+
The trusted default Profile keeps stdout to ACP protocol bytes; third-party plugins that write stdout during early startup can still pollute it. Local ACP supports Session listing, creation, resume, history loading, prompt, cancel and close, with streamed replies, Thinking, tool progress, plans, interactive questions and approvals. Compatible clients can also change Session model, Reasoning Effort, Plan Mode and Agent Team, use available commands and Skills, request manual compaction, exchange images and embedded resources, and append a Session-scoped system prompt. Client-declared stdio and Streamable HTTP MCP servers are supported (up to four in aggregate per Session). One ACP connection may hold up to eight Session Views; each Session permits only one ACP View at a time, with no such limit on TUI Views. ACP remains a same-user local interface (Unix socket on Linux/macOS, Named Pipe on Windows), with no Host-wide MCP management, Legacy SSE, Session deletion or Fork. It is still **Limited ACP v1**. See the [Daemon guide](docs/guides/daemon.md#external-acp-client-over-stdio) for setup and limitations.
|
|
137
173
|
|
|
138
174
|
When launched inside [Herdr](https://github.com/herdrdev/herdr), the TUI can report Agent status and provide Profile-pinned recovery commands for durable Sessions where the Herdr Client supports them.
|
|
139
175
|
|
|
176
|
+
Terminals supporting the [OSC 7577 Program Resume Protocol v0.5](https://www.superlogical.com/rex/docs/build/program-resume), such as Rex, receive an exact resume command for the committed main Session when they inject `OSC7577_TOKEN`. Direct and Daemon support it; compatible Client reload retains the record and normal manual exit clears it. Signals, terminal loss, crashes and HMR do not clear the record. Record acceptance and manual Direct command replay were verified with Rex 0.1.0-preview.25; automatic restart recovery, persistence across Server restart and automatic trust-rule execution remain unverified.
|
|
177
|
+
|
|
140
178
|
## Settings, extensions and development
|
|
141
179
|
|
|
142
|
-
`/settings` is the
|
|
180
|
+
`/settings` is the unified adaptive fullscreen Settings workspace, with grouped editing, Web Search / Fetch and MCP Servers workbenches, and Computer Use application management. `/plugins`, `/footer` and `/keybindings` are shortcuts; `/keybindings conflicts` opens the Keyboard shortcuts Conflicts view. Host configuration uses official readback; an enabled Host package is not necessarily an active `./tui` extension in the current Client.
|
|
143
181
|
|
|
144
|
-
Public extensions have **Stable / Advanced / Unstable** tiers: see the [authoring guide](docs/extensions/authoring.md), [Stable API](docs/extensions/stable.md) and [tier contract](docs/extensions/tiers.md). Version 0.5.
|
|
182
|
+
Public extensions have **Stable / Advanced / Unstable** tiers: see the [authoring guide](docs/extensions/authoring.md), [Stable API](docs/extensions/stable.md) and [tier contract](docs/extensions/tiers.md). Version 0.5.8 adds Client-local `./tui` loading and per-package persisted settings, but **does not deliver Forge or a Plugin Marketplace**.
|
|
145
183
|
|
|
146
184
|
For development:
|
|
147
185
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
**面向 DeepSeek Harness 的终端交互界面;一个 Host,让终端、Web 和 ACP 客户端访问同一个 Agent Session。**
|
|
9
9
|
|
|
10
|
-
默认以 **Direct** 模式运行,开箱即用;从
|
|
10
|
+
默认以 **Direct** 模式运行,开箱即用;从 0.5.8 起,Linux/macOS 用户可显式选择 **Daemon**,0.5.9 将 Daemon 扩展到原生 Windows 11 x64。独立的本地 Host 持有 Session 和执行中的工作,终端 Client 可以断开、重新连接;其他 TUI、官方 Web 与本地 ACP 客户端也可以访问同一 Host 的会话。
|
|
11
11
|
|
|
12
12
|
Agent Loop、模型、工具、持久化、权限和并发写入权威都属于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness);`dsh-pi-tui` 是第三方前端,而不是另一套 Agent Runtime。
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ Agent Loop、模型、工具、持久化、权限和并发写入权威都属于
|
|
|
21
21
|
|
|
22
22
|
### Stable / latest
|
|
23
23
|
|
|
24
|
-
**0.5.
|
|
24
|
+
**0.5.9 是本 README 对应的稳定发布版本(npm `@latest`)**。推荐搭配 **DSH 0.2.2-rc.5**;先安装 DeepSeek Harness,再将 TUI 添加到 `pi-tui` Profile:
|
|
25
25
|
|
|
26
26
|
~~~sh
|
|
27
27
|
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.2-rc.5
|
|
@@ -29,22 +29,25 @@ dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@latest
|
|
|
29
29
|
dsh --profile pi-tui
|
|
30
30
|
~~~
|
|
31
31
|
|
|
32
|
-
### 精确版本配对(0.5.
|
|
32
|
+
### 精确版本配对(0.5.9)
|
|
33
33
|
|
|
34
|
-
**0.5.
|
|
34
|
+
**0.5.9 要求 Node.js ≥24.9.0、DSH ≥0.2.2-rc.3,推荐使用 DSH 0.2.2-rc.5**(本版本的精确验证目标)。需要可复现安装时,固定两个包的版本:
|
|
35
35
|
|
|
36
36
|
~~~sh
|
|
37
37
|
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.2-rc.5
|
|
38
|
-
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@0.5.
|
|
38
|
+
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@0.5.9
|
|
39
39
|
dsh --profile pi-tui
|
|
40
40
|
~~~
|
|
41
41
|
|
|
42
42
|
| TUI | DSH | 状态 |
|
|
43
43
|
|---|---|---|
|
|
44
|
-
| `0.5.
|
|
45
|
-
| `0.5.6` | `0.2.2-rc.1` |
|
|
44
|
+
| `0.5.9` | `>=0.2.2-rc.3`;推荐 `0.2.2-rc.5` | **本发布版本** |
|
|
45
|
+
| `0.5.6` | `0.2.2-rc.1` | 历史兼容版本 |
|
|
46
|
+
| `0.5.5` | `0.2.1-rc.5` | 历史兼容版本 |
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
**干净安装**:只需执行上面的 DSH 插件安装命令,不需要手动安装 `@deepseek-ai/dsh-client-store`、`zustand` 或 `immer`。Daemon Client 自身启动失败时会提供 `$DSH_HOME/logs/pi-tui-client/startup-*.log` 诊断文件位置;`daemon logs` 仅查看 Host 日志。
|
|
49
|
+
|
|
50
|
+
**升级注意**:跨 DSH Runtime 升级必须先完成正在运行的 Turn/Job、停止旧 Host 并备份 Profile、Session 与所需数据;不保证跨 DSH 数据 Schema 的原地回退。不要将 0.5.9 配到 DSH rc.2 或更早版本。完整配对和恢复方法见[兼容性指南](docs/guides/dsh-compatibility.md)。
|
|
48
51
|
|
|
49
52
|
### Next / npm 线(验证)
|
|
50
53
|
|
|
@@ -60,24 +63,25 @@ dsh --profile pi-tui
|
|
|
60
63
|
|
|
61
64
|
### 两种运行方式,同一套 DSH 会话语义
|
|
62
65
|
|
|
63
|
-
| | Direct(默认) | Daemon
|
|
66
|
+
| | Direct(默认) | Daemon(可选,Linux/macOS/Windows 11 x64) |
|
|
64
67
|
|---|---|---|
|
|
65
|
-
| 启动 | `dsh --profile pi-tui` | `DSH_PI_TUI_BACKEND=daemon dsh --profile pi-tui
|
|
68
|
+
| 启动 | `dsh --profile pi-tui` | `DSH_PI_TUI_BACKEND=daemon dsh --profile pi-tui`(PowerShell:`$env:DSH_PI_TUI_BACKEND='daemon'; dsh --profile pi-tui`) |
|
|
66
69
|
| 进程 | TUI 与 Host 同进程 | Host 独立运行,TUI 是可断开的 Client |
|
|
67
70
|
| 多入口 | 当前进程内的交互界面 | 多个 TUI + 官方 Web + 可选本地 ACP 访问同一 Host/Session |
|
|
68
71
|
| 退出 | 结束 Direct 程序 | 默认仅断开 Client,Host 不因此自动停止 |
|
|
69
|
-
| 系统服务 | 无需额外管理 | Linux systemd
|
|
72
|
+
| 系统服务 | 无需额外管理 | 可选 Linux systemd 用户服务 / macOS LaunchAgent / Windows 登录任务 |
|
|
70
73
|
|
|
71
|
-
Daemon 的选择也可以在 `/settings →
|
|
74
|
+
Daemon 的选择也可以在 `/settings → Host → Backend` 保存,**下一次冷启动**生效;`DSH_PI_TUI_BACKEND` 仅覆盖本次启动、不写回设置。安装系统服务不是 Daemon 的前提,切换后端也不会热迁移 Host。所有实例仍由同一 Profile 和 DSH 官方 Session/Agent 权威管理。
|
|
72
75
|
|
|
73
76
|
### Agent、任务与会话
|
|
74
77
|
|
|
75
78
|
- **Agent 与工具**:流式 Markdown、Thinking / Tool / Context 展开、审批与 Question、模型与 Reasoning Effort、Plan、Goal 和 Todo。
|
|
76
|
-
- **Session 与 Workspace**:`/sessions`
|
|
79
|
+
- **Session 与 Workspace**:`/sessions` 按工作区浏览会话,实时状态、标题优先的列表和自动概览;`F2` 查看完整详情,`Space` 阅读已提交 Transcript,无需切换当前 Session。支持 `/new`、`/resume`、`/fork`、`/rewind`、`--session` 和 `--continue`。Daemon 可复用符合条件的空白 Session。
|
|
77
80
|
- **Team / Subagent / Job**:`/model` 可控制 Root Agent Team;`/tasks` 显示 Work/Team、嵌套 Subagent 和 Job。Subagent 默认展开,已完成的 Job 历史可以按需展开。
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
+
- **Preset**:裸 `/preset` 打开两页 Catalog + Details——搜索、Built-in/Custom 分组与状态标记,阅读与打开详情不会写入;只有底部的 `Use next` / `Use session` 和 `Set default` 显式动作才会应用预设或保存新会话默认值。`/preset status`、`/preset default [<id>]` 与 `/preset <id>` 保留。
|
|
82
|
+
- **输入与终端操作**:`@file` 补全、图片/普通文件附件、`Ctrl+V` 图片粘贴、`!` 和 `!!` Shell、外部编辑器和可编辑的 Footer。Windows Direct 与 Daemon 下 `!`/`!!` 均在 Host 使用官方 PowerShell;sandbox 使用 DSH ACL 后端(partial enforcement),Windows 没有原生命令/变量/git 补全(普通路径补全保留)。
|
|
83
|
+
- **阅读与搜索**:`/display` 切换 Full / Focus / Compact(未配置时默认 Compact,已有显式偏好不变);Transcript View / Full 搜索、卡片折叠、`Ctrl+R` 历史输入搜索。Daemon 使用 Host 历史,支持跨 Client 搜索、增量结果及自动分页;上下方向键召回当前 Session 的输入,未使用的空白 Session 可临时借用同目录历史。
|
|
84
|
+
- **Settings / 插件**:统一自适应 Settings 布局、分组配置编辑、Web Search / Fetch 与 MCP 工作台、Computer Use 应用管理、Provider 登录和凭据、审批、Plugin Manager、动态 Extension Settings 及 Client-local `./tui` 扩展加载。
|
|
81
85
|
- **图像与交付**:受终端能力约束的图片、静态 SVG、图表、`/view-image`、`/deliverables`、`/export`;支持 Kitty、SIXEL 和受支持的 iTerm2 图像路径。
|
|
82
86
|
- **可选实验渲染器**:`DSH_PI_TUI_RENDERER=tsp` 使用 Tern TSP,提供部分原生 Transcript/Work Hub 体验;不是所有 PiTui Settings/Plugins 的替代品。
|
|
83
87
|
|
|
@@ -87,19 +91,21 @@ Daemon 的选择也可以在 `/settings → General → Backend` 保存,**下
|
|
|
87
91
|
|---|---|
|
|
88
92
|
| `/sessions` · `/resume` · `/new` | 找回或开始会话 |
|
|
89
93
|
| `/model` · `/tasks` · `/plan` · `/goal` | 模型、任务和 Agent 工作模式 |
|
|
94
|
+
| `/preset` | 浏览、应用会话预设或保存新会话默认值 |
|
|
90
95
|
| `/settings` · `/plugins` · `/keybindings` | 配置与扩展 |
|
|
91
96
|
| `/display` · `/export` · `/deliverables` | 阅读与导出 |
|
|
92
97
|
| `Ctrl+F` · `Ctrl+Shift+F` | 已绘制文本 / 可用 Session 历史搜索 |
|
|
93
98
|
| `Ctrl+R` · `Ctrl+G` | 历史输入 / 外部编辑器 |
|
|
99
|
+
| `F2` · `Space`(`/sessions`) | 会话详情 / 完整已提交 Transcript |
|
|
94
100
|
| `Ctrl+O` · `Alt+T` | Tool / Context 与 Thinking 折叠 |
|
|
95
|
-
| `Ctrl+C` · `Ctrl+D` |
|
|
101
|
+
| `Ctrl+C` · `Ctrl+D` | Ctrl+C 优先清空可编辑草稿,空草稿时取消工作或确认退出(3 秒确认窗口);Ctrl+D 保持编辑/退出语义 |
|
|
96
102
|
| `!` · `!!` | Host Shell:结果入 Session / 不入 Session |
|
|
97
103
|
|
|
98
|
-
这里列出的是默认键位和常见入口;自定义后以 `/
|
|
104
|
+
这里列出的是默认键位和常见入口;自定义后以 `/keybindings` 显示的**实际生效键位**为准。输入 `/` 可搜索并选择命令与可用的 Skills;需要显式调用某个 Skill(包括与同名命令冲突时)使用 `/skill <name> [args]`,裸 `/skill` 只显示用法。`/transcript` 当前的官方 Markdown 导出路径属于 Direct;`/export` 是独立的 ZIP 归档,产物落在 Client 本地目录。`PI_IMAGE_PROTOCOL=none` 只禁止像素预览,不影响附件发送。
|
|
99
105
|
|
|
100
|
-
## Daemon 快速上手(Linux / macOS)
|
|
106
|
+
## Daemon 快速上手(Linux / macOS / 原生 Windows 11 x64)
|
|
101
107
|
|
|
102
|
-
不安装系统服务也可以启动独立 Host
|
|
108
|
+
不安装系统服务也可以启动独立 Host。一次性体验(交互式 Daemon Client 支持 Linux/macOS 及原生 Windows 11 x64 普通用户、本地固定 NTFS Profile):
|
|
103
109
|
|
|
104
110
|
~~~sh
|
|
105
111
|
DSH_PI_TUI_BACKEND=daemon dsh --profile pi-tui
|
|
@@ -113,11 +119,16 @@ dsh --profile pi-tui daemon logs --lines 200
|
|
|
113
119
|
dsh --profile pi-tui daemon start
|
|
114
120
|
dsh --profile pi-tui daemon stop
|
|
115
121
|
dsh --profile pi-tui daemon restart
|
|
116
|
-
dsh --profile pi-tui daemon install
|
|
117
|
-
dsh --profile pi-tui daemon
|
|
122
|
+
dsh --profile pi-tui daemon install # Linux / macOS
|
|
123
|
+
dsh --profile pi-tui daemon enable # Linux 登录自启
|
|
124
|
+
dsh --profile pi-tui daemon disable # Linux 取消登录自启
|
|
125
|
+
dsh --profile pi-tui daemon install --autostart # macOS 登录+恢复;Windows 仅登录
|
|
126
|
+
dsh --profile pi-tui daemon uninstall # Linux / macOS;Windows 登录任务
|
|
118
127
|
~~~
|
|
119
128
|
|
|
120
|
-
|
|
129
|
+
Windows 支持独立 Host、交互式 Daemon Client、管理命令、官方 Web 及本地 ACP(Named Pipe)。普通 `daemon install` 不可用;`daemon install --autostart` 注册当前普通用户登录时启动 Host 的任务,`daemon uninstall` 仅移除登录任务,不停止独立 Host。Windows 不支持 `/reload-client`,采用更新构建时请 `/exit` 后重新启动。
|
|
130
|
+
|
|
131
|
+
`daemon install` 仅创建或验证可选的 Profile 用户服务定义或登录任务,**不会**自动启动、启用或迁移 Host。Linux 先 install 再显式 enable;macOS 新安装可选择 `--autostart`(登录启动及异常退出恢复);Windows 的 `--autostart` 仅在登录时启动。已有服务定义不会被自动重写。`daemon stop` / `restart` 可能中断所有连接 Client 的进行中 Turn/Job;manager 显示运行中不代表 Host 已 Ready。详见 [Daemon 用户指南](docs/guides/daemon.md#optional-os-supervision)。
|
|
121
132
|
|
|
122
133
|
同一 **DSH Runtime + Profile** 下,先通过官方插件命令更新 TUI;旧 Host 可以继续提供服务。需要让 Host 采用新包的代码时,再显式 `daemon restart`(会中断在途工作);无需为同 Profile 的旧安装构建例行先卸载服务定义。**更换 DSH Runtime** 则不是热升级,必须走停止、备份和冷启动流程。详见 [Daemon 用户指南](docs/guides/daemon.md)。
|
|
123
134
|
|
|
@@ -133,15 +144,42 @@ dsh --profile pi-tui web status
|
|
|
133
144
|
|
|
134
145
|
还可使用 `web disable` / `web open`。这些命令**不会启动 Host**,也不会自动创建 Session;`web url` 输出的地址含认证 Token,必须作为敏感凭据处理。官方 Web 页面选择/打开 Session,并与 TUI 访问同一 Host 数据。
|
|
135
146
|
|
|
136
|
-
|
|
147
|
+
已连接的 Daemon TUI 里,`/web` 直接打开 **`Settings → Host → Web UI`** 页面:同一页面分别展示**当前 Host** 的实时状态与操作(Open in browser / Copy access link / Enable / Disable,关闭前需二次确认),以及**只对下次 Host 启动生效**的 `Start automatically` 偏好。两者不会互相改变;链接只在显式 Open/Copy 时读取,从不显示在界面上。
|
|
148
|
+
|
|
149
|
+
已连接的 Daemon TUI 里,`/acp` 直接打开 **`Settings → Host → ACP access`** 页面:同一页面展示**当前 Host** 的本地 ACP Listener 实时状态(监听中 / 未监听 / 切换中 / 不可用,Direct 下明确为 `Unavailable · Split Host only`)、`Enable ACP` 与需二次确认的 `Disable ACP…`、只在显式复制时才读取的 `Copy client command`(即当前已证 Profile 的 `dsh --profile … acp stdio`),以及**只对下次 Host 启动生效**的 `Start automatically` 偏好和 `Client Setup` 接入说明。运行状态与下次启动偏好是两个独立权威:开关当前 Host 不会改动偏好,保存偏好也不会启停当前 Listener;退出页面或断开 TUI 不会撤销已生效的 Host 变更。
|
|
150
|
+
|
|
151
|
+
**ACP v1** 是默认关闭的、同机同用户本地接口。外部 ACP 客户端通过当前安装 Profile 的官方命令 `dsh --profile pi-tui acp stdio` 接入:它把该客户端的 stdio 原样转发给现有 Host 的本地 ACP Listener,**不会**另建 Host、Agent、Session 或 Writer,也**不会**自动启动 Host 或启用 Listener。它是填给 ACP 客户端的 stdio command,不是让用户在交互终端里期待 TUI 画面的命令。
|
|
152
|
+
|
|
153
|
+
Listener 的运行状态也可以用不打开 TUI 的 headless 命令读取和切换(同样**不会启动 Host**):
|
|
154
|
+
|
|
155
|
+
~~~sh
|
|
156
|
+
dsh --profile pi-tui acp status
|
|
157
|
+
dsh --profile pi-tui acp enable
|
|
158
|
+
dsh --profile pi-tui acp disable
|
|
159
|
+
~~~
|
|
160
|
+
|
|
161
|
+
`acp status` 只读,输出一行 `acp=enabled|disabled|changing|unavailable`;`acp enable` / `acp disable` 只发送一次写入并打印 Host 真实达到的状态——`changing` 或响应丢失不会被猜成成功。它们只管理**当前 Profile 已运行 Host** 的运行时 Listener,不改变下次冷启动的 `autoStart`,也不会停止 Host、Agent、Session 或 TUI;`disable` 会断开已有 ACP 连接并停止接受新连接。
|
|
162
|
+
|
|
163
|
+
准备步骤:先启动并确认 Host,再从已连接的 Daemon TUI 用 `/acp`(或 headless 的 `acp enable`)把 Listener 切到 **Enabled**(`/settings → Host → ACP access` 里的 `Start automatically` 只控制下次 Host 冷启动),用 `daemon status` 或 `acp status` 确认 `acp=enabled`,然后才在外部 ACP 客户端的 stdio command 配置里填写该命令:
|
|
164
|
+
|
|
165
|
+
~~~sh
|
|
166
|
+
dsh --profile pi-tui daemon start
|
|
167
|
+
dsh --profile pi-tui daemon status # 确认 host=ready、acp=enabled
|
|
168
|
+
# 在外部 ACP 客户端的 stdio command 配置中:
|
|
169
|
+
dsh --profile pi-tui acp stdio
|
|
170
|
+
~~~
|
|
171
|
+
|
|
172
|
+
受信默认 Profile 的 stdout 只承载 ACP 协议字节;第三方插件若在早期启动阶段直接写 stdout,仍可能污染它。本地 ACP 支持 Session 列表、创建、恢复、历史加载、Prompt、取消及关闭,提供流式回答、Thinking、工具进度、计划、交互式问题和审批。兼容客户端还可修改 Session 模型、Reasoning Effort、Plan Mode、Agent Team,使用可用命令及 Skills、手动压缩、图片和嵌入式资源,以及 Session 级系统提示追加。支持客户端声明的 stdio 与 Streamable HTTP MCP Server(每 Session 合计最多 4 个)。一条 ACP 连接最多持有 8 个不同 Session 的 View;每个 Session 同时只允许一条 ACP 连接持有 View,TUI 不受此限制。ACP 本身仍是同用户本地接口(Linux/macOS 为 Unix socket,Windows 为 Named Pipe),不提供 Host 级 MCP 管理、Legacy SSE、Session 删除或 Fork 等未支持能力,仍属于 **Limited ACP v1**。接入及限制详见 [Daemon 指南](docs/guides/daemon.md#external-acp-client-over-stdio)。
|
|
137
173
|
|
|
138
174
|
在 [Herdr](https://github.com/herdrdev/herdr) Pane 中运行时,TUI 可以上报 Agent 工作状态;对有持久 Session ID 的场景可提供经 Profile 约束的恢复命令,实际能力取决于 Herdr 客户端。
|
|
139
175
|
|
|
176
|
+
支持 [OSC 7577 Program Resume Protocol v0.5](https://www.superlogical.com/rex/docs/build/program-resume) 的终端(如 Rex)会在注入 `OSC7577_TOKEN` 时收到已提交主 Session 的精确恢复命令。Direct 与 Daemon 均支持;兼容的 Client 重载保留记录,正常人工退出时撤销。信号、终端丢失、崩溃与 HMR 不撤销记录。Rex 0.1.0-preview.25 已验证记录接收及 Direct 命令手动重放;自动重启恢复、跨 Server 重启持久化及信任规则自动执行尚未验证。
|
|
177
|
+
|
|
140
178
|
## 设置、扩展与开发
|
|
141
179
|
|
|
142
|
-
`/settings`
|
|
180
|
+
`/settings` 是统一的自适应全屏设置入口,支持分组编辑、Web Search / Fetch 与 MCP Servers 工作台及 Computer Use 应用管理;`/plugins`、`/footer`、`/keybindings` 是快捷入口,`/keybindings conflicts` 直接打开 Keyboard shortcuts 的 Conflicts 视图。Host 配置以官方回读确认,当前 Client 的 `./tui` 激活状态与 Host 包是否启用是不同事实。
|
|
143
181
|
|
|
144
|
-
扩展按 **Stable / Advanced / Unstable** 三层发布,详见 [扩展作者指南](docs/extensions/authoring.md)、[Stable API](docs/extensions/stable.md) 和 [兼容性分层](docs/extensions/tiers.md)。0.5.
|
|
182
|
+
扩展按 **Stable / Advanced / Unstable** 三层发布,详见 [扩展作者指南](docs/extensions/authoring.md)、[Stable API](docs/extensions/stable.md) 和 [兼容性分层](docs/extensions/tiers.md)。0.5.8 增加了 Client-local `./tui` 加载与按包持久设置,但**不代表 Forge 或 Plugin Marketplace 已交付**。
|
|
145
183
|
|
|
146
184
|
从源码开发:
|
|
147
185
|
|
package/cordis.patch.yml
CHANGED
|
@@ -46,6 +46,19 @@
|
|
|
46
46
|
inject: [tuiStartup, sessionProjections]
|
|
47
47
|
disabled: !!js "ctx.get('tuiDaemonStartup') !== undefined"
|
|
48
48
|
|
|
49
|
+
# The OFFICIAL whole-log `sessionStats` projection unit
|
|
50
|
+
# (`@deepseek-ai/dsh-session-stats`): registered EXACTLY ONCE per Host graph
|
|
51
|
+
# through the same `sessionProjections` seam the bundle's own performance
|
|
52
|
+
# unit uses. The id keeps its historical `split-host-` name; this one bundle
|
|
53
|
+
# row is the SINGLE declaration for Direct and the Split Host. The Host-only
|
|
54
|
+
# overlay only retunes its `inject` (see HOST_ONLY_PATCH), never re-declares
|
|
55
|
+
# the package. `tuiStartup` is Direct's command-line admission; the daemon
|
|
56
|
+
# supervisor mounts no Host unit.
|
|
57
|
+
- id: split-host-session-stats
|
|
58
|
+
name: '@deepseek-ai/dsh-session-stats'
|
|
59
|
+
inject: [tuiStartup, sessionProjections]
|
|
60
|
+
disabled: !!js "ctx.get('tuiDaemonStartup') !== undefined"
|
|
61
|
+
|
|
49
62
|
# Workspace file service (the OFFICIAL `@deepseek-ai/dsh-api-workspace-files`):
|
|
50
63
|
# the ONE Host owner of the `workspaceFiles` Remote namespace the delivered-
|
|
51
64
|
# files preview reads through — bounded `stat`/`read` under the Session's
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { n as isSafeLocalAcpEndpoint } from "./local-acp-endpoint-D1jYdJdv.mjs";
|
|
3
|
+
import { closeSync, openSync } from "node:fs";
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
|
+
import { connect } from "node:net";
|
|
6
|
+
//#region src/app/remote-process/acp-stdio-entry.ts
|
|
7
|
+
/**
|
|
8
|
+
* Trusted-profile ACP stdio Adapter.
|
|
9
|
+
*
|
|
10
|
+
* This internal process is the ONE byte relay between the public
|
|
11
|
+
* `dsh --profile pi-tui acp stdio` command's inherited stdin/stdout and the
|
|
12
|
+
* already-running Host-owned ACP v1 local endpoint (Unix socket on POSIX,
|
|
13
|
+
* profile-scoped Named Pipe on Windows). It imports only Node core plus the
|
|
14
|
+
* one pure endpoint-shape module: it is not an ACP SDK server, owns no
|
|
15
|
+
* Session/Agent/Writer/Host Context and performs no JSON parsing, method
|
|
16
|
+
* dispatch, retry or second protocol cache.
|
|
17
|
+
*
|
|
18
|
+
* The Parent overwrites `DSH_PI_TUI_ACP_STDIO_SOCKET_V1` with the authenticated
|
|
19
|
+
* public logical endpoint of THIS canonical Profile. A Linux pathname longer
|
|
20
|
+
* than `sockaddr_un.sun_path` is reached through the documented
|
|
21
|
+
* `/proc/self/fd/<scopeDirFd>/acp.sock` short alias; macOS uses the parent's
|
|
22
|
+
* trusted short public path unchanged.
|
|
23
|
+
*
|
|
24
|
+
* @module app/remote-process/acp-stdio-entry
|
|
25
|
+
*/
|
|
26
|
+
/** The parent-owned target channel. */
|
|
27
|
+
const SOCKET_ENV = "DSH_PI_TUI_ACP_STDIO_SOCKET_V1";
|
|
28
|
+
/** Linux `sockaddr_un.sun_path` includes its trailing NUL. */
|
|
29
|
+
const SUN_PATH_BYTES = 104;
|
|
30
|
+
/** One fixed, sanitized diagnostic line; never a path, errno, stack or payload. */
|
|
31
|
+
function report(code) {
|
|
32
|
+
try {
|
|
33
|
+
process.stderr.write(`dsh-pi-tui acp stdio: ${code}\n`);
|
|
34
|
+
} catch {}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Connect to the Parent-selected public logical path. On Linux the logical
|
|
38
|
+
* scope path commonly exceeds `sun_path`; hold the scope directory fd only
|
|
39
|
+
* until the kernel connect settles, then close it.
|
|
40
|
+
*/
|
|
41
|
+
function connectLocalAcpSocket(socketPath) {
|
|
42
|
+
if (process.platform === "linux" && Buffer.byteLength(socketPath, "utf8") + 1 > SUN_PATH_BYTES) {
|
|
43
|
+
const dirFd = openSync(dirname(socketPath), "r");
|
|
44
|
+
let released = false;
|
|
45
|
+
const release = () => {
|
|
46
|
+
if (released) return;
|
|
47
|
+
released = true;
|
|
48
|
+
try {
|
|
49
|
+
closeSync(dirFd);
|
|
50
|
+
} catch {}
|
|
51
|
+
};
|
|
52
|
+
const socket = connect(`/proc/self/fd/${String(dirFd)}/acp.sock`);
|
|
53
|
+
socket.once("connect", release);
|
|
54
|
+
socket.once("error", release);
|
|
55
|
+
return {
|
|
56
|
+
socket,
|
|
57
|
+
release
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
socket: connect(socketPath),
|
|
62
|
+
release: () => {}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function main() {
|
|
66
|
+
const rawSocketPath = process.env[SOCKET_ENV];
|
|
67
|
+
if (rawSocketPath === void 0 || rawSocketPath === "" || !isSafeLocalAcpEndpoint(rawSocketPath, process.platform)) {
|
|
68
|
+
report("ACP_STDIO_SOCKET_INVALID");
|
|
69
|
+
process.exitCode = 2;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let socket;
|
|
73
|
+
let releaseDirFd = () => {};
|
|
74
|
+
let clientHalfClosed = false;
|
|
75
|
+
let settled = false;
|
|
76
|
+
let stdoutBroken = false;
|
|
77
|
+
/**
|
|
78
|
+
* The ONE settlement path. Close the Adapter's own transport, end stdout
|
|
79
|
+
* after already-written protocol bytes drain, and let Node exit naturally
|
|
80
|
+
* with the fixed code. Idempotent for concurrent error/end/close callbacks.
|
|
81
|
+
*/
|
|
82
|
+
const finish = (code) => {
|
|
83
|
+
if (settled) return;
|
|
84
|
+
settled = true;
|
|
85
|
+
releaseDirFd();
|
|
86
|
+
try {
|
|
87
|
+
process.stdin.unpipe(socket);
|
|
88
|
+
} catch {}
|
|
89
|
+
try {
|
|
90
|
+
socket?.unpipe(process.stdout);
|
|
91
|
+
} catch {}
|
|
92
|
+
try {
|
|
93
|
+
socket?.destroy();
|
|
94
|
+
} catch {}
|
|
95
|
+
process.exitCode = code;
|
|
96
|
+
if (!stdoutBroken) try {
|
|
97
|
+
process.stdout.end();
|
|
98
|
+
} catch {}
|
|
99
|
+
};
|
|
100
|
+
try {
|
|
101
|
+
const opened = connectLocalAcpSocket(rawSocketPath);
|
|
102
|
+
socket = opened.socket;
|
|
103
|
+
releaseDirFd = opened.release;
|
|
104
|
+
} catch {
|
|
105
|
+
report("ACP_STDIO_SOCKET_ERROR");
|
|
106
|
+
finish(4);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
socket.once("connect", () => {
|
|
110
|
+
releaseDirFd();
|
|
111
|
+
if (settled) {
|
|
112
|
+
socket?.destroy();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
process.stdin.pipe(socket);
|
|
116
|
+
socket.pipe(process.stdout, { end: false });
|
|
117
|
+
});
|
|
118
|
+
process.stdin.on("end", () => {
|
|
119
|
+
clientHalfClosed = true;
|
|
120
|
+
});
|
|
121
|
+
process.stdin.on("error", () => {
|
|
122
|
+
report("ACP_STDIO_STDIN_ERROR");
|
|
123
|
+
finish(4);
|
|
124
|
+
});
|
|
125
|
+
socket.on("error", () => {
|
|
126
|
+
report("ACP_STDIO_SOCKET_ERROR");
|
|
127
|
+
finish(4);
|
|
128
|
+
});
|
|
129
|
+
socket.on("end", () => {
|
|
130
|
+
if (!clientHalfClosed) report("ACP_STDIO_HOST_DISCONNECTED");
|
|
131
|
+
finish(clientHalfClosed ? 0 : 4);
|
|
132
|
+
});
|
|
133
|
+
socket.on("close", () => {
|
|
134
|
+
if (settled) return;
|
|
135
|
+
if (!clientHalfClosed) report("ACP_STDIO_HOST_DISCONNECTED");
|
|
136
|
+
finish(clientHalfClosed ? 0 : 4);
|
|
137
|
+
});
|
|
138
|
+
process.stdout.on("error", () => {
|
|
139
|
+
stdoutBroken = true;
|
|
140
|
+
report("ACP_STDIO_STDOUT_EPIPE");
|
|
141
|
+
finish(4);
|
|
142
|
+
});
|
|
143
|
+
const onSignal = (signal) => {
|
|
144
|
+
finish(signal === "SIGINT" ? 130 : 143);
|
|
145
|
+
};
|
|
146
|
+
process.once("SIGTERM", () => onSignal("SIGTERM"));
|
|
147
|
+
process.once("SIGINT", () => onSignal("SIGINT"));
|
|
148
|
+
}
|
|
149
|
+
main();
|
|
150
|
+
//#endregion
|
|
151
|
+
export {};
|