@lijian-ui/dsh-term 0.1.0
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/LICENSE +21 -0
- package/README.md +36 -0
- package/cordis.patch.yml +8 -0
- package/lib/client.js +7824 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +434 -0
- package/lib/tsconfig.client.tsbuildinfo +1 -0
- package/lib/tsconfig.host.tsbuildinfo +1 -0
- package/lib/types/client/index.d.ts +26 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/term/TerminalPanel.d.ts +24 -0
- package/lib/types/client/term/TerminalPanel.d.ts.map +1 -0
- package/lib/types/client/term/api.d.ts +34 -0
- package/lib/types/client/term/api.d.ts.map +1 -0
- package/lib/types/client/term/xterm-styles.d.ts +9 -0
- package/lib/types/client/term/xterm-styles.d.ts.map +1 -0
- package/lib/types/core/types.d.ts +76 -0
- package/lib/types/core/types.d.ts.map +1 -0
- package/lib/types/host/loopback.d.ts +25 -0
- package/lib/types/host/loopback.d.ts.map +1 -0
- package/lib/types/host/pty-service.d.ts +45 -0
- package/lib/types/host/pty-service.d.ts.map +1 -0
- package/lib/types/host/routes.d.ts +17 -0
- package/lib/types/host/routes.d.ts.map +1 -0
- package/lib/types/index.d.ts +19 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/mount-once.d.ts +25 -0
- package/lib/types/mount-once.d.ts.map +1 -0
- package/package.json +79 -0
- package/src/client/css-modules.d.ts +4 -0
- package/src/client/index.ts +223 -0
- package/src/client/term/TerminalPanel.tsx +259 -0
- package/src/client/term/api.ts +66 -0
- package/src/client/term/term.module.css +153 -0
- package/src/client/term/xterm-styles.ts +182 -0
- package/src/core/types.ts +73 -0
- package/src/host/loopback.ts +63 -0
- package/src/host/pty-service.ts +131 -0
- package/src/host/routes.ts +198 -0
- package/src/index.ts +37 -0
- package/src/mount-once.ts +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lijian-ui
|
|
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.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @lijian-ui/dsh-term
|
|
2
|
+
|
|
3
|
+
Panel-style local terminal for the DSH web GUI.
|
|
4
|
+
|
|
5
|
+
- **Real PTY sessions** via [`node-pty`](https://github.com/microsoft/node-pty) — a genuine local shell, not a curated command runner.
|
|
6
|
+
- **Multi-tab terminal panel** built on [xterm.js](https://xtermjs.org/), docked in the right-side panel (alongside `@lijian-ui/dsh-file-manager`).
|
|
7
|
+
- **Workspace cwd** — each session starts in the current workspace root.
|
|
8
|
+
- **Hot-pluggable** — loaded as a profile bundle; no changes to DSH source are required.
|
|
9
|
+
|
|
10
|
+
> This is the **A edition**: local user terminal only. A planned **B edition** adds SSH connections and per-session shell selection.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
dsh plugin add @lijian-ui/dsh-term
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or add `@lijian-ui/dsh-term` to your profile's `bundles` / `dependencies` and reference it from `cordis.yml`.
|
|
19
|
+
|
|
20
|
+
## Behavior
|
|
21
|
+
|
|
22
|
+
- Default state is **collapsed** (closed). Open it from the right-side panel launcher (the "终端" button) — it docks as the rightmost column next to the file-manager panel.
|
|
23
|
+
- Sessions are managed by a host-side service (`src/host/pty-service.ts`) exposed over loopback-only HTTP + SSE routes (`src/host/routes.ts`). The client renders them with xterm.js and syncs resize/input.
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install
|
|
29
|
+
npm run build # tsc -b && tsdown -> lib/
|
|
30
|
+
npm run watch # rebuild on change
|
|
31
|
+
npm test # vitest
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
Apache-2.0
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# dsh-term bundle patch: inserts the dual-face plugin row into the web
|
|
2
|
+
# profile roster. The node half (exports ".") runs in the host process
|
|
3
|
+
# (node-pty PTY sessions + /dsh-term/* routes), and the `dsh.client`
|
|
4
|
+
# declaration in package.json makes the browser half (exports "./client",
|
|
5
|
+
# served at /plugins/ui-dsh-term/client.js) load in the web GUI.
|
|
6
|
+
- insert:
|
|
7
|
+
- id: ui-dsh-term
|
|
8
|
+
name: '@lijian-ui/dsh-term'
|