dsh-home-hosted 0.1.4 → 0.2.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/README.md +70 -20
- package/docs/DESIGN.md +16 -0
- package/lib/client.js +676 -6
- package/lib/index.js +334 -93
- package/lib/index.js.map +3 -3
- package/lib/types/home-hosted/config-file.d.ts +10 -3
- package/lib/types/home-hosted/entries.d.ts +16 -3
- package/lib/types/home-hosted/panel-control.d.ts +4 -1
- package/lib/types/service.d.ts +15 -1
- package/lib/types/shared/contracts.d.ts +47 -3
- package/lib/types/tools.d.ts +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
# dsh-home-hosted
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Manage [home-hosted](https://github.com/NamesMT/home-hosted) — its boot entry, its panel and its servers — from inside DeepSeek Harness.**
|
|
4
4
|
|
|
5
|
-
](https://www.npmjs.com/package/dsh-home-hosted)
|
|
6
|
+
[](https://github.com/NamesMT/dsh-home-hosted/actions/workflows/ci.yml)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
[](https://github.com/deepseek-ai/dsh)
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **Boot autostart** — installs, verifies and removes the OS entry that starts `home-hosted` at boot (systemd on Linux, launchd on macOS, Run key / Task Scheduler on Windows). Off by default; opt in from the plugin's page.
|
|
10
|
-
- **Runs its own home-hosted** — the pinned copy ships as a dependency, so the panel that starts at boot is the version this plugin was built against. The page can start that panel, or replace a running one with it.
|
|
11
|
-
- **Server management** — add, edit, start, stop and restart home-hosted's servers without leaving dsh, with the panel's API as the write path so nothing is restarted behind your back.
|
|
12
|
-
- **Reclaim the harness** — a managed `dsh` entry gets `onPortConflict: kill`, so a leftover process holding the web port is reclaimed at boot instead of blocking forever.
|
|
13
|
-
- **Agent tools** — off by default, allowlisted one by one; every tool that changes something asks for approval first.
|
|
11
|
+

|
|
14
12
|
|
|
15
13
|
## Install
|
|
16
14
|
|
|
@@ -18,9 +16,57 @@ A DeepSeek Harness plugin for [home-hosted](https://github.com/NamesMT/home-host
|
|
|
18
16
|
dsh plugin --profile web add dsh-home-hosted
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
Then open **Settings →
|
|
19
|
+
Then open **Settings → Home Hosted**. Nothing is installed or started until you say so.
|
|
20
|
+
|
|
21
|
+
| | |
|
|
22
|
+
|---|---|
|
|
23
|
+
| 🚀 **Boot autostart** | Installs, verifies and removes the OS entry that starts the panel. Opt in per machine. |
|
|
24
|
+
| 📦 **Ships its own panel** | The pinned `home-hosted` is a dependency, so boot runs the version this plugin is tested against. |
|
|
25
|
+
| 🖥️ **Server control** | Add, edit, start, stop and restart entries — written through the panel's API, so nothing restarts behind your back. |
|
|
26
|
+
| 🤖 **Agent tools** | On by default: the agent can inspect state, manage servers, install autostart and switch the panel's UI. |
|
|
27
|
+
|
|
28
|
+
## Agent tools
|
|
29
|
+
|
|
30
|
+
| Tool | Does |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `home_hosted_status` | Panel, boot entry and managed-entry state |
|
|
33
|
+
| `home_hosted_servers_list` | Every supervised server |
|
|
34
|
+
| `home_hosted_servers_lifecycle` | `start` · `stop` · `restart` |
|
|
35
|
+
| `home_hosted_servers_edit` | `create` · `update` · `delete` |
|
|
36
|
+
| `home_hosted_autostart_manage` | `install` · `uninstall` |
|
|
37
|
+
| `home_hosted_ui_manage` | `status` · `update` · `revert` · `switch` the panel's own UI |
|
|
38
|
+
|
|
39
|
+
A tool that changes something asks for approval **only** when the session is not already Full access.
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary><b>Boot autostart, per platform</b></summary>
|
|
43
|
+
|
|
44
|
+
| Platform | Mechanism | Starts |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Linux | `systemd-user`, `systemd-system`, XDG autostart | login, or boot with a system unit / `loginctl enable-linger` |
|
|
47
|
+
| macOS | `launchd-agent`, `launchd-daemon` | login, or boot with the daemon (one-time `sudo`) |
|
|
48
|
+
| Windows | Run key, Task Scheduler | login |
|
|
49
|
+
|
|
50
|
+
A plugin cannot act at boot: it installs and re-syncs the entry while dsh runs, and the OS takes over from there. When the process cannot elevate, the page prints the exact commands to run instead — including the `launchd-daemon` that starts a Mac **before** login.
|
|
51
|
+
|
|
52
|
+
</details>
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary><b>Which home-hosted runs</b></summary>
|
|
22
56
|
|
|
23
|
-
|
|
57
|
+
The pinned dependency by default. The page can switch to a global install, or install the pinned range globally for you. Boot entries run a small stable launcher the plugin writes, so a `node_modules` path that moves never breaks boot.
|
|
58
|
+
|
|
59
|
+
</details>
|
|
60
|
+
|
|
61
|
+
<details>
|
|
62
|
+
<summary><b>Managed entry and port policy</b></summary>
|
|
63
|
+
|
|
64
|
+
One entry (`dsh`) is managed from the page with a single toggle: the panel keeps it alive, restarts it and reclaims its port. A detached restart is recognised on macOS and Linux (`follow`); Windows cannot prove identity through a `.cmd` shim, so it uses `onPortConflict: kill` — which needs home-hosted 0.6.0 or newer, and the plugin refuses that write against an older panel rather than producing a config it cannot parse.
|
|
65
|
+
|
|
66
|
+
</details>
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
<summary><b>Configuration</b></summary>
|
|
24
70
|
|
|
25
71
|
The Cordis row config is for operator overrides only:
|
|
26
72
|
|
|
@@ -33,16 +79,20 @@ The Cordis row config is for operator overrides only:
|
|
|
33
79
|
defaultEntryId: dsh
|
|
34
80
|
```
|
|
35
81
|
|
|
36
|
-
Everything a person toggles lives in `<stateDir>/settings.json
|
|
82
|
+
Everything a person toggles lives in `<stateDir>/settings.json`. The panel API token it mints is kept `0600` there, and is never rendered or logged.
|
|
37
83
|
|
|
38
|
-
|
|
84
|
+
</details>
|
|
85
|
+
|
|
86
|
+
<details>
|
|
87
|
+
<summary><b>Development</b></summary>
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
pnpm install
|
|
91
|
+
pnpm typecheck && pnpm test && pnpm build
|
|
92
|
+
```
|
|
39
93
|
|
|
40
|
-
|
|
41
|
-
- The plugin ships its own `home-hosted` (pinned range) and runs that copy by default; Options in the page can switch to a global install instead. Boot entries run a small stable launcher it writes, so a `node_modules` path that moves never breaks boot.
|
|
42
|
-
- Boot (pre-login) needs privilege somewhere, and the page shows the exact commands when it cannot elevate: on macOS pick the boot-scope **launchd-daemon** (a one-time `sudo` install), on Linux **systemd-system** or `loginctl enable-linger`. A `LaunchAgent` and an XDG entry start at login only.
|
|
43
|
-
- The panel API token this plugin uses is minted on first write and kept 0600 under the plugin state directory; it is never rendered or logged.
|
|
44
|
-
- `onPortConflict: kill` needs home-hosted 0.6.0 or newer; against an older panel the plugin refuses that write and says so, because that panel cannot parse the config it would produce.
|
|
94
|
+
Node 24+, pnpm, 360 tests. Same four commands CI runs.
|
|
45
95
|
|
|
46
|
-
|
|
96
|
+
</details>
|
|
47
97
|
|
|
48
|
-
MIT
|
|
98
|
+
MIT · [npm](https://www.npmjs.com/package/dsh-home-hosted) · [releases](https://github.com/NamesMT/dsh-home-hosted/releases) · [issues](https://github.com/NamesMT/dsh-home-hosted/issues) · built on [home-hosted](https://github.com/NamesMT/home-hosted)
|
package/docs/DESIGN.md
CHANGED
|
@@ -31,6 +31,22 @@ node_modules (flat or pnpm), then PATH — and forwards its argv, so the entry
|
|
|
31
31
|
survives plugin upgrades and profile reinstalls. The plugin preflights the
|
|
32
32
|
launcher the way the unit invokes it and shows the version it answers.
|
|
33
33
|
|
|
34
|
+
## Agent tools are merged and on by default
|
|
35
|
+
|
|
36
|
+
Six tools, not ten: `servers_lifecycle` carries start/stop/restart, `servers_edit`
|
|
37
|
+
carries create/update/delete, `autostart_manage` carries install/uninstall, and
|
|
38
|
+
`ui_manage` drives the panel's own UI (`ui-update` / `ui-revert` / `ui-switch`).
|
|
39
|
+
They are registered on by default; what gates a mutating call is the session's
|
|
40
|
+
own permission mode, not a plugin-level default.
|
|
41
|
+
|
|
42
|
+
## The dsh entry is the only entry the page manages
|
|
43
|
+
|
|
44
|
+
The page shows one toggle: manage `dsh` as a home-hosted entry, or not. Adding
|
|
45
|
+
one sends a minimal intent (`{ id: 'dsh', autostart: true }`) and the host fills
|
|
46
|
+
the rest from the platform default policy; removing one restores an entry this
|
|
47
|
+
plugin merely adopted, and deletes one it created. Removing an entry the panel
|
|
48
|
+
supervises stops that process — which may be the session asking for it.
|
|
49
|
+
|
|
34
50
|
## Approvals follow the session's sandbox
|
|
35
51
|
|
|
36
52
|
A mutating agent tool asks the approval service only when the calling session is
|