@1outres/dsh-plugin-claude-subscription 0.0.0-stage → 0.4.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 +22 -0
- package/README.md +146 -2
- package/cordis.patch.yml +6 -0
- package/lib/index.js +3773 -0
- package/lib/inert-mcp.js +33 -0
- package/package.json +52 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 1outres
|
|
4
|
+
Copyright (c) 2026 Nous Research and contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,147 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @1outres/dsh-plugin-claude-subscription
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use your own Claude subscription as an LLM provider in DeepSeek Harness (DSH).
|
|
4
|
+
|
|
5
|
+
This plugin is unofficial. It is not affiliated with or endorsed by Anthropic.
|
|
6
|
+
|
|
7
|
+
DSH keeps its agent loop, tools, approvals and compaction. For each model call,
|
|
8
|
+
the plugin runs the official `claude` CLI once, in `-p` stream-json mode, behind a
|
|
9
|
+
small relay on the loopback address. The relay lets exactly one request reach
|
|
10
|
+
Anthropic and refuses every other request from that process. The CLI's own tools
|
|
11
|
+
are off, so the model can only call the tools DSH offers, and DSH runs them.
|
|
12
|
+
|
|
13
|
+
Install just this plugin:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
dsh plugin add @1outres/dsh-plugin-claude-subscription
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or install it with every plugin in the repository through the
|
|
20
|
+
[`@1outres/dsh-plugins`](../dsh-plugins) bundle. Enable one or the other: both
|
|
21
|
+
insert the same `claude-subscription` row.
|
|
22
|
+
|
|
23
|
+
## Requirements
|
|
24
|
+
|
|
25
|
+
- DSH 0.2.1-rc.5 or newer in the 0.2 line. Windows is not
|
|
26
|
+
supported.
|
|
27
|
+
- The official Claude Code CLI, installed:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm install -g @anthropic-ai/claude-code
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- A login, made as the same user that DSH runs as:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
claude auth login
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The login belongs to the CLI. The plugin never opens or copies credential files,
|
|
40
|
+
has no login flow of its own, and asks for no API key. When the CLI is logged out,
|
|
41
|
+
a call fails with a message that tells you to run `claude auth login`.
|
|
42
|
+
|
|
43
|
+
The plugin refuses to run when the environment of DSH sends the CLI to another
|
|
44
|
+
backend. It fails with `CONFLICTING_ENVIRONMENT` and names the variables, never
|
|
45
|
+
their values. These are `ANTHROPIC_BASE_URL`, `CLAUDE_CODE_USE_BEDROCK`,
|
|
46
|
+
`CLAUDE_CODE_USE_VERTEX` and `CLAUDE_CODE_USE_FOUNDRY`.
|
|
47
|
+
|
|
48
|
+
## Settings
|
|
49
|
+
|
|
50
|
+
The plugin has no settings page. Set these fields in your profile's
|
|
51
|
+
`cordis.patch.yml`:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
- id: claude-subscription
|
|
55
|
+
config:
|
|
56
|
+
claudeConfigDir: ~/.claude-work
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
DSH reads the edit when it recomposes the profile. Without its HMR plugin, restart
|
|
60
|
+
DSH instead.
|
|
61
|
+
|
|
62
|
+
| Field | Default | Meaning |
|
|
63
|
+
| ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `command` | `claude` | Name found through `PATH`, or an absolute path. |
|
|
65
|
+
| `claudeConfigDir` | empty | Config directory of a separate Claude login. Empty uses `CLAUDE_CONFIG_DIR` from the environment, then the CLI's own default. |
|
|
66
|
+
| `claudeCodeTelemetry` | on | Lets the CLI send its telemetry and fetch feature flags. The flags unlock models in its picker, so turning this off can shrink the model list. |
|
|
67
|
+
| `readIdleTimeoutSeconds` | `1800` | Seconds of silence from the CLI before a call fails with `TIMEOUT`. From 1 to 2147483. |
|
|
68
|
+
|
|
69
|
+
Whatever the settings say, the CLI is started with `DISABLE_AUTOUPDATER`,
|
|
70
|
+
`DISABLE_FEEDBACK_COMMAND` and `CLAUDE_CODE_DISABLE_TERMINAL_TITLE`.
|
|
71
|
+
|
|
72
|
+
The relay reads `https_proxy`, `http_proxy` and `NO_PROXY` from the environment of
|
|
73
|
+
DSH. Only an `http://` proxy that supports `CONNECT` works. Any other proxy URL
|
|
74
|
+
fails the call, and the plugin does not connect directly instead. Set
|
|
75
|
+
`CLAUDE_CODE_GZIP_REQUEST_BODIES=0` to send request bodies uncompressed.
|
|
76
|
+
|
|
77
|
+
## Models
|
|
78
|
+
|
|
79
|
+
The model list comes from the CLI's answer about your account. Pinned routes the
|
|
80
|
+
answer leaves out are added after it, except models Anthropic grants per
|
|
81
|
+
organization. If the CLI cannot answer, for example when it is logged out, no
|
|
82
|
+
model is listed, and the message appears on the provider's row under
|
|
83
|
+
**Settings → Models**. The next look at the list asks the CLI again.
|
|
84
|
+
|
|
85
|
+
A pinned 1M model is sent with `[1m]`. An id the plugin does not know is sent as it
|
|
86
|
+
is and reports a 200K window. An unknown id that ends in `[1m]` reports no window.
|
|
87
|
+
|
|
88
|
+
## What the model sees
|
|
89
|
+
|
|
90
|
+
The CLI adds its own text to every request. Besides the DSH system prompt and
|
|
91
|
+
history, the request holds:
|
|
92
|
+
|
|
93
|
+
- A first system block with the CLI's version and the caller name, for example
|
|
94
|
+
`x-anthropic-billing-header: cc_version=2.1.317.173; cc_entrypoint=deepseek-harness;`.
|
|
95
|
+
- A second system block: `You are a Claude agent, built on Anthropic's Claude Agent SDK.`
|
|
96
|
+
- A `# Environment` block, sent as a `system` message after the first user turn.
|
|
97
|
+
It lists the working directory, whether it is a git repository, the platform, the
|
|
98
|
+
shell and the OS version. It adds a note on downloaded files, the model's name
|
|
99
|
+
and id, its knowledge cutoff and today's date.
|
|
100
|
+
|
|
101
|
+
The working directory in that block is a private directory the plugin keeps for the
|
|
102
|
+
CLI, not your workspace. The DSH system prompt names the real one.
|
|
103
|
+
|
|
104
|
+
A user turn that ends in text starting with `/` reaches the model with one leading
|
|
105
|
+
space. Without the space the CLI reads the text as a slash command, even with
|
|
106
|
+
`--disable-slash-commands`, and the call fails.
|
|
107
|
+
|
|
108
|
+
Text in this section was read from a request by Claude Code 2.1.317. Another CLI
|
|
109
|
+
version can differ.
|
|
110
|
+
|
|
111
|
+
## Known limits
|
|
112
|
+
|
|
113
|
+
- Each model call starts a new `claude` process, so a call has more start-up time
|
|
114
|
+
than a direct API call.
|
|
115
|
+
- The plugin relies on how the CLI behaves today: its replay of history, its
|
|
116
|
+
extra-body setting, and its stream-json output. A CLI update can change them.
|
|
117
|
+
- Calls count against your subscription limits. Your account decides whether a model
|
|
118
|
+
uses usage credits. Some rows in the model list say so, and the plugin does not
|
|
119
|
+
block them.
|
|
120
|
+
- DSH shows token counts for a call, but the plugin reports no cost.
|
|
121
|
+
- A reply cut off by the output limit runs no tool call, and DSH sees `max-tokens`.
|
|
122
|
+
- A refusal ends the call with `CONTENT_FILTER` and the reason the service gave. A
|
|
123
|
+
tool call in a refused reply never runs.
|
|
124
|
+
- A reply that ends normally with no text and no tool call, even one with thinking,
|
|
125
|
+
fails with `EMPTY_RESPONSE`, which DSH retries. A reply cut off by the output limit
|
|
126
|
+
reports `max-tokens` instead.
|
|
127
|
+
- A request whose retained images pass 20 MiB as base64 fails with `IMAGE_OFFLOAD_REQUIRED`.
|
|
128
|
+
DSH then offloads the oldest images and retries. A dropped image keeps a text note that
|
|
129
|
+
names its read-only path when DSH has one.
|
|
130
|
+
- `temperature` is checked and then dropped. It never reaches the model.
|
|
131
|
+
- DSH removes variables with `TOKEN` in their names before it starts a child process,
|
|
132
|
+
so `CLAUDE_CODE_OAUTH_TOKEN` in the environment of DSH does not reach the CLI. Log in
|
|
133
|
+
with `claude auth login` instead.
|
|
134
|
+
- The relay trusts Node's bundled certificate list and `NODE_EXTRA_CA_CERTS`. A
|
|
135
|
+
TLS-inspecting proxy whose certificate is only in `SSL_CERT_FILE` fails the call.
|
|
136
|
+
- Every call declares the full active tool list, so adding or removing a tool during a
|
|
137
|
+
conversation rewrites the prompt cache from that point.
|
|
138
|
+
- Signed thinking is replayed only for a message that was not edited, was made by the
|
|
139
|
+
same model that the request names, and holds text or a tool call besides its thinking.
|
|
140
|
+
Any other message, such as an edited one or one from before a model switch, is sent
|
|
141
|
+
again as plain text and tool calls.
|
|
142
|
+
|
|
143
|
+
## Attribution
|
|
144
|
+
|
|
145
|
+
Ported from the `claude-subscription-directsdk` plugin of
|
|
146
|
+
[NousResearch/hermes-official-plugins](https://github.com/NousResearch/hermes-official-plugins),
|
|
147
|
+
at commit `83f0a89`, MIT licensed. See `LICENSE`.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Installs this plugin on its own (dsh plugin add @1outres/dsh-plugin-claude-subscription).
|
|
2
|
+
# The @1outres/dsh-plugins bundle inserts the same "claude-subscription" row, so select
|
|
3
|
+
# one bundle or the other, never both.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: claude-subscription
|
|
6
|
+
name: "@1outres/dsh-plugin-claude-subscription"
|