@norman-else/dsh-claude 0.1.19 → 0.1.21
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 +38 -147
- package/lib/bin.mjs +1 -1
- package/lib/client.d.ts +232 -188
- package/lib/client.js +3060 -442
- package/lib/client.js.map +1 -1
- package/lib/command-bridge-C10-lz6A.mjs +71 -0
- package/lib/command-bridge-C10-lz6A.mjs.map +1 -0
- package/lib/{events-DPJaBReT.mjs → events-BdDs9ebF.mjs} +6 -2
- package/lib/events-BdDs9ebF.mjs.map +1 -0
- package/lib/index.d.mts +36 -1
- package/lib/index.mjs +1221 -262
- package/lib/index.mjs.map +1 -1
- package/lib/{preset-installer-DnoSEKGm.mjs → preset-installer-DMANIjwu.mjs} +2 -2
- package/lib/{preset-installer-DnoSEKGm.mjs.map → preset-installer-DMANIjwu.mjs.map} +1 -1
- package/lib/preset-route.mjs +172 -2
- package/lib/preset-route.mjs.map +1 -1
- package/package.json +1 -1
- package/lib/events-DPJaBReT.mjs.map +0 -1
- package/lib/presenters-DBRIOgJs.mjs +0 -257
- package/lib/presenters-DBRIOgJs.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,150 +1,53 @@
|
|
|
1
1
|
# dsh-claude
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Overview
|
|
4
4
|
|
|
5
|
-
`dsh-claude`
|
|
5
|
+
`dsh-claude` runs the locally installed Claude Code CLI as a first-class conversation provider inside DeepSeek Harness (DSH). It uses Claude Code's official Agent SDK protocol instead of recreating the agent with a separate API client.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Claude Code remains responsible for its agent loop, tools, `CLAUDE.md`, Skills, Hooks, Plugins, MCP servers, settings, and authentication. DSH provides the conversation UI, approval and question surfaces, repository workflow, activity presentation, and managed process lifetime.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- A `claude` DSH model provider with Claude Code's `default`, `opus[1m]`, `fable`, `sonnet`, and `haiku` choices.
|
|
11
|
-
- Long-lived Claude processes with per-session serialization, idle eviction, cancellation, and persisted Claude session resume.
|
|
12
|
-
- DSH approval prompts for Claude tool permission requests and native DSH question forms for Claude clarifications.
|
|
13
|
-
- Durable, redacted plugin-sidecar activity for thinking summaries, tool calls/results, permissions, question lifecycle, subagents, status, usage, and errors.
|
|
14
|
-
- Native turn-tail activity cards and a Settings → Claude Code Doctor panel.
|
|
15
|
-
- A safe CLI for Doctor and managed preset install/remove.
|
|
9
|
+
## 2. Installation and removal
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
### Requirements
|
|
18
12
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Node.js 20 or later.
|
|
13
|
+
- DeepSeek Harness Desktop with compatible public plugin APIs. This package is currently developed against the DSH `0.1.1-rc.2` package line.
|
|
14
|
+
- A local Claude Code installation that is already authenticated.
|
|
15
|
+
- Node.js 20 or later when installing from a source checkout.
|
|
23
16
|
|
|
24
|
-
The plugin never
|
|
17
|
+
The plugin never asks for or stores Claude credentials. Authenticate through the local Claude Code CLI before using the plugin.
|
|
25
18
|
|
|
26
|
-
|
|
19
|
+
### Install from npm
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
Add the published package to the DSH Web profile:
|
|
29
22
|
|
|
30
23
|
```sh
|
|
31
24
|
dsh plugin --profile web add @norman-else/dsh-claude
|
|
32
25
|
```
|
|
33
26
|
|
|
34
|
-
Wait for the
|
|
27
|
+
Wait for the profile rebuild to finish, then restart DSH Desktop if requested. Create a new conversation and select **Claude** from the Agent Preset picker.
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Use
|
|
39
|
-
|
|
40
|
-
1. Open a new DSH conversation.
|
|
41
|
-
2. Choose **Claude** in the Agent Preset picker.
|
|
42
|
-
3. Choose **Default (recommended)**, **Opus (1M context)**, **Fable**, **Sonnet**, or **Haiku**.
|
|
43
|
-
4. Send a normal text prompt.
|
|
44
|
-
5. Answer Claude tool permissions through the existing DSH approval UI and Claude clarifying questions through DSH's native question form.
|
|
45
|
-
6. Expand **Claude Code activity** beneath a completed assistant turn to inspect the redacted execution trail.
|
|
46
|
-
|
|
47
|
-
Native DSH presets remain available and keep the native DSH agent loop.
|
|
48
|
-
|
|
49
|
-
### Current input boundary
|
|
50
|
-
|
|
51
|
-
v0.1 forwards only the newest direct human text in a DSH step. It intentionally ignores the DSH system prompt, DSH tool schemas, and injected plugin messages because Claude Code owns those surfaces. Image-only prompts are rejected with an actionable error.
|
|
52
|
-
|
|
53
|
-
## Permission and sandbox boundary
|
|
54
|
-
|
|
55
|
-
Claude Code runs in its normal local configuration and can read/write `~/.claude` so that authentication, settings, plugins, and session recovery continue to work.
|
|
56
|
-
|
|
57
|
-
Every Claude permission callback is bridged to `ctx.approval.request(...)`:
|
|
58
|
-
|
|
59
|
-
- `allowed-once` is the only granting result.
|
|
60
|
-
- reject, cancel, missing answerer, and audit failure all deny the action.
|
|
61
|
-
- DSH `never` approval policy therefore fails closed.
|
|
62
|
-
- DSH access modes map to Claude permission modes: `read-only` → `plan`, `workspace-write` → `acceptEdits`, and explicitly acknowledged `danger-full-access` → `bypassPermissions`.
|
|
63
|
-
- Claude `AskUserQuestion` is always routed to `ctx.userQuestions`, including under Full access; cancellation or an unavailable question surface denies the interaction, and answer content is not copied into the sidecar.
|
|
64
|
-
|
|
65
|
-
This is a permission-policy bridge, not kernel-level workspace confinement. The supported DSH Desktop contract exposes one writable sandbox root, while full Claude compatibility also requires writable `~/.claude`. The plugin therefore does **not** claim that paths outside the workspace are technically unwritable. It still uses DSH managed subprocess ownership for explicit argv, credential-shaped environment scrubbing, cancellation, and whole-process-tree termination.
|
|
66
|
-
|
|
67
|
-
## Process and recovery behavior
|
|
68
|
-
|
|
69
|
-
- One live streaming-input Claude query per active DSH session.
|
|
70
|
-
- One active top-level turn at a time per session.
|
|
71
|
-
- Default maximum: 4 live Claude processes.
|
|
72
|
-
- Default idle eviction: 30 minutes.
|
|
73
|
-
- The Claude session id and redacted presentation metadata are persisted in a plugin-owned sidecar under `$DSH_HOME/plugins/dsh-claude/sessions`; new DSH logs contain no `claude-code/*` events.
|
|
74
|
-
- After normal eviction or DSH restart, the next prompt resumes that Claude session.
|
|
75
|
-
- A crash after visible Claude/tool activity is reported as **outcome unknown**. The plugin never automatically replays that prompt because its side effects may already have happened.
|
|
76
|
-
- Cancelling a DSH turn interrupts Claude and tears down that session's process entry (bounded interrupt, then close/abort/terminate/join); the next prompt re-establishes the process from the persisted Claude session id. Plugin unload and agent disposal also terminate the owned process tree.
|
|
77
|
-
- DSH outer model retries are disabled for this provider.
|
|
78
|
-
|
|
79
|
-
## Doctor
|
|
80
|
-
|
|
81
|
-
Inside DSH, open **Settings → Claude Code** and run Doctor.
|
|
82
|
-
|
|
83
|
-
From the checkout:
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
node lib/bin.mjs doctor
|
|
87
|
-
node lib/bin.mjs doctor --executable /absolute/path/to/claude
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Doctor reports only the resolved executable, version, coarse authentication category/method/provider/subscription, handshake state, configured limits, and process count. It never returns tokens, email, organization id, settings content, or environment secrets.
|
|
91
|
-
|
|
92
|
-
Executable resolution order:
|
|
93
|
-
|
|
94
|
-
1. configured absolute path
|
|
95
|
-
2. `claude` on DSH's scrubbed PATH
|
|
96
|
-
3. `~/.local/bin/claude`
|
|
97
|
-
4. `/opt/homebrew/bin/claude`
|
|
98
|
-
5. `/usr/local/bin/claude`
|
|
99
|
-
|
|
100
|
-
To configure a nonstandard path, edit the plugin row in the Web profile composition:
|
|
101
|
-
|
|
102
|
-
```yaml
|
|
103
|
-
- id: llm-claude
|
|
104
|
-
name: '@norman-else/dsh-claude'
|
|
105
|
-
config:
|
|
106
|
-
executablePath: /absolute/path/to/claude
|
|
107
|
-
model: default
|
|
108
|
-
idleTimeoutMs: 1800000
|
|
109
|
-
maxProcesses: 4
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## Development
|
|
29
|
+
### Install from source
|
|
113
30
|
|
|
114
31
|
```sh
|
|
115
32
|
git clone https://github.com/Norman-else/dsh-claude.git
|
|
116
33
|
cd dsh-claude
|
|
117
|
-
export PATH="/opt/homebrew/bin:$PATH"
|
|
118
34
|
pnpm install
|
|
119
35
|
pnpm check
|
|
120
36
|
```
|
|
121
37
|
|
|
122
|
-
|
|
38
|
+
Link the checkout to DSH from PowerShell:
|
|
123
39
|
|
|
124
|
-
```
|
|
125
|
-
dsh plugin --profile web add "link:$
|
|
40
|
+
```powershell
|
|
41
|
+
dsh plugin --profile web add "link:$PWD"
|
|
126
42
|
```
|
|
127
43
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
```sh
|
|
131
|
-
pnpm pack --pack-destination ./dist-pack
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Release
|
|
135
|
-
|
|
136
|
-
Update the version in `package.json`, commit it, and push the clean release commit first. Then verify and publish both npm and GitHub releases:
|
|
44
|
+
Or from macOS/Linux:
|
|
137
45
|
|
|
138
46
|
```sh
|
|
139
|
-
|
|
140
|
-
pnpm release
|
|
47
|
+
dsh plugin --profile web add "link:$(pwd)"
|
|
141
48
|
```
|
|
142
49
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
The project uses fixture/state-machine tests and a minimal SDK-level handshake probe (a tool-disabled, one-turn `query()` against the resolved local executable). Full DSH-linked live acceptance (native coexistence, Claude turn, permission allow/deny, cancel, resume, orphan-process check) is run after the Host restart per `INSTALL.md`. The Agent SDK is pinned to `0.3.233`; runtime execution is forced to the resolved local Claude executable through `pathToClaudeCodeExecutable`.
|
|
146
|
-
|
|
147
|
-
## Uninstall
|
|
50
|
+
### Remove the plugin
|
|
148
51
|
|
|
149
52
|
Remove the managed compatibility preset before removing the package:
|
|
150
53
|
|
|
@@ -153,39 +56,27 @@ dsh plugin --profile web exec dsh-claude remove-preset
|
|
|
153
56
|
dsh plugin --profile web remove @norman-else/dsh-claude
|
|
154
57
|
```
|
|
155
58
|
|
|
156
|
-
DSH does not expose a plugin uninstall lifecycle hook
|
|
59
|
+
DSH does not currently expose a plugin uninstall lifecycle hook. If the package was removed before its managed preset was cleaned up, run the matching installed version directly:
|
|
157
60
|
|
|
158
61
|
```sh
|
|
159
62
|
pnpm dlx @norman-else/dsh-claude@<version> remove-preset
|
|
160
63
|
```
|
|
161
64
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
##
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
DSH does not proxy login or store credentials.
|
|
183
|
-
|
|
184
|
-
### A turn says “outcome unknown”
|
|
185
|
-
|
|
186
|
-
Inspect the activity record and workspace before sending a new instruction. Do not repeat a potentially side-effecting prompt blindly.
|
|
187
|
-
|
|
188
|
-
## Architecture records
|
|
189
|
-
|
|
190
|
-
- Product and architecture spec: `docs/aegis/spec/2026-08-15-dsh-claude-spec.md`
|
|
191
|
-
- Implementation plan: `docs/aegis/plan/2026-08-15-dsh-claude-implementation-plan.md`
|
|
65
|
+
Preset cleanup removes only installer-managed content and refuses to delete user-modified preset files.
|
|
66
|
+
|
|
67
|
+
## 3. Features
|
|
68
|
+
|
|
69
|
+
- **Native Claude Code conversations** — Runs Claude Code as the main agent in a normal DSH conversation instead of wrapping it as a tool or secondary chat.
|
|
70
|
+
- **Claude preset and model selection** — Adds a `Claude` Agent Preset and exposes Claude Code's `default`, `opus[1m]`, `fable`, `sonnet`, and `haiku` model choices.
|
|
71
|
+
- **Local Claude environment compatibility** — Preserves the user's existing Claude Code authentication, settings, `CLAUDE.md`, Skills, Hooks, Plugins, tools, and MCP configuration.
|
|
72
|
+
- **Real-time streaming and conversation continuity** — Streams Claude responses and tool activity into DSH while retaining multi-turn context and persisted Claude session resume.
|
|
73
|
+
- **DSH permissions and questions** — Routes Claude tool permission requests through DSH approvals and Claude clarification prompts through DSH's native question forms.
|
|
74
|
+
- **Managed process lifecycle** — Keeps one live Claude process per active session, serializes turns, evicts idle processes, and handles Stop, cancellation, restart, and process-tree cleanup.
|
|
75
|
+
- **Redacted activity timeline** — Displays thinking summaries, tool calls and results, permission events, questions, status changes, usage, errors, and subagent activity without persisting credentials.
|
|
76
|
+
- **Background task tracking** — Shows running and completed Claude subagents or background tasks with task status, recent tools, and expandable activity.
|
|
77
|
+
- **Repository and worktree preparation** — Lets a user choose a branch before submitting, switch an eligible local branch, or create a dedicated Git worktree and DSH workspace while transferring the current draft and attachments.
|
|
78
|
+
- **Repository and pull request status** — Shows the current repository, branch, worktree state, changed-line counts, unpushed commits, GitHub pull request, checks, review state, merge state, and blocking Claude rate limits near the composer.
|
|
79
|
+
- **Diff viewer and review comments** — Provides an expandable or maximized branch diff, including file statistics and line-level review comments that are attached to the next Claude message.
|
|
80
|
+
- **Commit, push, and pull request actions** — Supports Commit, Commit & Push, Push, and draft pull request creation, with repository snapshot validation and optional Claude-generated commit messages.
|
|
81
|
+
- **Claude Code settings and Doctor** — Adds a Settings panel for runtime diagnostics, supported Claude settings, worktree branch prefix, process limits, authentication and handshake status, and safe npm update checks.
|
|
82
|
+
- **Managed preset compatibility** — Installs an idempotent compatibility copy of the Claude preset for supported DSH builds without overwriting user-modified preset content.
|
package/lib/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as parseClaudeVersion, n as ensureManagedPreset, r as removeManagedPreset } from "./preset-installer-
|
|
2
|
+
import { i as parseClaudeVersion, n as ensureManagedPreset, r as removeManagedPreset } from "./preset-installer-DMANIjwu.mjs";
|
|
3
3
|
import { access } from "node:fs/promises";
|
|
4
4
|
import { delimiter, isAbsolute, join } from "node:path";
|
|
5
5
|
import { homedir } from "node:os";
|