@zerowall/dsh-claude-coderun 0.0.0-stage → 0.1.0-preview.2
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.i18n.yaml +16 -0
- package/README.md +23 -2
- package/README.zh.md +24 -0
- package/dsh.bundle.patch.yml +23 -0
- package/lib/client.js +17823 -0
- package/lib/index.js +3754 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +1938 -0
- package/lib/typert.remote-client.d.ts +101 -0
- package/lib/typert.remote-client.d.ts.map +1 -0
- package/lib/typert.remote-client.js +1327 -0
- package/lib/types/client/ClaudeCodeAction.d.ts +13 -0
- package/lib/types/client/ClaudeCodeSettingsSection.d.ts +7 -0
- package/lib/types/client/ClaudePermissionSelect.d.ts +11 -0
- package/lib/types/client/ClaudeStats.d.ts +17 -0
- package/lib/types/client/ClaudeTranscript.d.ts +22 -0
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/locales.d.ts +243 -0
- package/lib/types/client/upstream/GlobalSettingControls.d.ts +39 -0
- package/lib/types/client/upstream/markdown-theme.d.ts +42 -0
- package/lib/types/client/upstream/settings-styles.d.ts +42 -0
- package/lib/types/client/view.d.ts +9 -0
- package/lib/types/host/claude-commands.d.ts +19 -0
- package/lib/types/host/claude-settings.d.ts +19 -0
- package/lib/types/host/cli.d.ts +24 -0
- package/lib/types/host/diagnostic.d.ts +2 -0
- package/lib/types/host/environment.d.ts +2 -0
- package/lib/types/host/index.d.ts +78 -0
- package/lib/types/host/mcp-launcher.d.ts +16 -0
- package/lib/types/host/metrics-projection.d.ts +250 -0
- package/lib/types/host/metrics.d.ts +16 -0
- package/lib/types/host/permission-mode.d.ts +62 -0
- package/lib/types/host/projection.d.ts +124 -0
- package/lib/types/host/resource-status.d.ts +8 -0
- package/lib/types/host/route.d.ts +52 -0
- package/lib/types/host/runtime.d.ts +80 -0
- package/lib/types/host/sdk-driver.d.ts +29 -0
- package/lib/types/host/session-binding.d.ts +25 -0
- package/lib/types/host/subagent-tool.d.ts +6 -0
- package/lib/types/host/tool-journal.d.ts +13 -0
- package/lib/types/shared/metrics.d.ts +57 -0
- package/lib/types/shared/records.d.ts +33 -0
- package/lib/types/shared/types.d.ts +262 -0
- package/lib/types.js +18 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/migration-reference.md +67 -0
- package/package.json +252 -3
- package/plugin-detail.md +11 -0
- package/plugin-detail.zh.md +11 -0
- package/zerowall.plugin.json +65 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const tokenKeys: readonly ["inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens"];
|
|
2
|
+
export type ClaudeTokenKey = (typeof tokenKeys)[number];
|
|
3
|
+
/** SDK counters are disjoint. Undefined means unreported, never an implicit zero. */
|
|
4
|
+
export interface ClaudeTokenCounts {
|
|
5
|
+
inputTokens?: number | undefined;
|
|
6
|
+
outputTokens?: number | undefined;
|
|
7
|
+
cacheReadTokens?: number | undefined;
|
|
8
|
+
cacheWriteTokens?: number | undefined;
|
|
9
|
+
/** Buckets whose totals are partial because one or more requests omitted them. */
|
|
10
|
+
incomplete?: ClaudeTokenKey[] | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface ClaudeContextReading {
|
|
13
|
+
model: string;
|
|
14
|
+
usedTokens: number;
|
|
15
|
+
contextWindow: number;
|
|
16
|
+
}
|
|
17
|
+
/** Complete replacement snapshot for one plugin-owned query invocation. */
|
|
18
|
+
export interface ClaudeRunMetrics {
|
|
19
|
+
runId: string;
|
|
20
|
+
nativeSessionId: string;
|
|
21
|
+
provider: string;
|
|
22
|
+
model: string;
|
|
23
|
+
turn: number;
|
|
24
|
+
main: boolean;
|
|
25
|
+
finished: boolean;
|
|
26
|
+
settled: boolean;
|
|
27
|
+
models: Record<string, ClaudeTokenCounts>;
|
|
28
|
+
steps: number;
|
|
29
|
+
decodeTokens: number;
|
|
30
|
+
decodeMs: number;
|
|
31
|
+
modelMs: number;
|
|
32
|
+
context: ClaudeContextReading | null;
|
|
33
|
+
}
|
|
34
|
+
export interface ClaudeMetrics {
|
|
35
|
+
models: Record<string, ClaudeTokenCounts>;
|
|
36
|
+
usage: ClaudeTokenCounts;
|
|
37
|
+
turns: number;
|
|
38
|
+
steps: number;
|
|
39
|
+
decodeTokens: number;
|
|
40
|
+
decodeMs: number;
|
|
41
|
+
modelMs: number;
|
|
42
|
+
incomplete: boolean;
|
|
43
|
+
context: ClaudeContextReading | null;
|
|
44
|
+
}
|
|
45
|
+
export declare function sumCounts(rows: readonly ClaudeTokenCounts[]): ClaudeTokenCounts;
|
|
46
|
+
export declare function inputTotal(value: ClaudeTokenCounts): number | undefined;
|
|
47
|
+
export declare function tokenTotal(value: ClaudeTokenCounts): number | undefined;
|
|
48
|
+
declare module '@deepseek-ai/dsh-session/types' {
|
|
49
|
+
interface PluginRecordMap {
|
|
50
|
+
'plugin:zerowall-claude/metrics': ClaudeRunMetrics;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
54
|
+
interface SessionProjectionMap {
|
|
55
|
+
zerowallClaudeMetrics: ClaudeMetrics;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type RecordEvent = {
|
|
2
|
+
type: string;
|
|
3
|
+
data: unknown;
|
|
4
|
+
ignorable?: true;
|
|
5
|
+
};
|
|
6
|
+
/** Read a valid Claude turn marker, including records renamed by the V3 migration. */
|
|
7
|
+
export declare function readClaudeTurn(event: RecordEvent): {
|
|
8
|
+
turn: number;
|
|
9
|
+
step: number;
|
|
10
|
+
} | undefined;
|
|
11
|
+
/** Read a saved permission choice without trusting restored JSON. */
|
|
12
|
+
export declare function readClaudePermission(event: RecordEvent): {
|
|
13
|
+
mode: "default" | "dontAsk" | "acceptEdits" | "auto" | "plan" | "bypassPermissions";
|
|
14
|
+
} | undefined;
|
|
15
|
+
/** Read a completed transcript without trusting restored JSON. */
|
|
16
|
+
export declare function readClaudeTranscript(event: RecordEvent): {
|
|
17
|
+
turn: number;
|
|
18
|
+
step: number;
|
|
19
|
+
renderer: "plugin" | "native";
|
|
20
|
+
running: boolean;
|
|
21
|
+
activity: {
|
|
22
|
+
index: number;
|
|
23
|
+
kind: "text" | "reasoning" | "tool-call";
|
|
24
|
+
text: string;
|
|
25
|
+
ended: boolean;
|
|
26
|
+
id?: string | undefined;
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
result?: string | undefined;
|
|
29
|
+
failed?: boolean | undefined;
|
|
30
|
+
answer?: boolean | undefined;
|
|
31
|
+
}[];
|
|
32
|
+
} | undefined;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
export interface ClaudeCodeStatus {
|
|
2
|
+
desktop: boolean;
|
|
3
|
+
installed: boolean;
|
|
4
|
+
version?: string;
|
|
5
|
+
/** Application-managed CLI; never a PATH lookup or the user's Claude install. */
|
|
6
|
+
executablePath?: string;
|
|
7
|
+
rollbackAvailable: boolean;
|
|
8
|
+
running: boolean;
|
|
9
|
+
readiness?: 'installed' | 'unavailable';
|
|
10
|
+
diagnostic?: string;
|
|
11
|
+
}
|
|
12
|
+
export type ClaudePermissionMode = 'default' | 'dontAsk' | 'acceptEdits' | 'auto' | 'plan' | 'bypassPermissions';
|
|
13
|
+
export type ClaudePermissionSelector = 'plugin' | 'native';
|
|
14
|
+
export type ClaudeRenderer = 'plugin' | 'native';
|
|
15
|
+
export type ClaudeProse = 'plain' | 'enhanced';
|
|
16
|
+
/** `auto` keeps the provider default; aliases are retained for old settings.
|
|
17
|
+
* Numeric values allow an explicit token budget from the settings UI. */
|
|
18
|
+
export type ClaudeContextWindow = 'auto' | '200k' | '1m' | number;
|
|
19
|
+
export type ClaudeAutoCompactWindow = 'auto' | number;
|
|
20
|
+
export type ClaudePromptCacheTtl = 'auto' | '5m' | '1h';
|
|
21
|
+
export interface ClaudeNativeSettings {
|
|
22
|
+
outputStyle?: string;
|
|
23
|
+
permissionSelector?: ClaudePermissionSelector;
|
|
24
|
+
permissionMode?: ClaudePermissionMode;
|
|
25
|
+
renderer?: ClaudeRenderer;
|
|
26
|
+
prose?: ClaudeProse;
|
|
27
|
+
maxProcesses?: number;
|
|
28
|
+
contextWindow?: ClaudeContextWindow;
|
|
29
|
+
autoCompactWindow?: ClaudeAutoCompactWindow;
|
|
30
|
+
promptCacheTtl?: ClaudePromptCacheTtl;
|
|
31
|
+
subagentPromptCacheTtl?: ClaudePromptCacheTtl;
|
|
32
|
+
}
|
|
33
|
+
export interface ClaudeEffectiveSetting {
|
|
34
|
+
requested: string;
|
|
35
|
+
effective: string;
|
|
36
|
+
source: 'auto' | 'explicit' | 'external' | 'clamped' | 'unsupported';
|
|
37
|
+
available: boolean;
|
|
38
|
+
reason?: string;
|
|
39
|
+
effect: ClaudeGlobalSettingEffect;
|
|
40
|
+
}
|
|
41
|
+
export interface ClaudeModelCapabilities {
|
|
42
|
+
model: string;
|
|
43
|
+
contextWindow: number;
|
|
44
|
+
supports1m: boolean;
|
|
45
|
+
supportsAutoCompact: boolean;
|
|
46
|
+
source: 'model-id' | 'default';
|
|
47
|
+
}
|
|
48
|
+
export interface ClaudeApiUsage {
|
|
49
|
+
input_tokens?: number;
|
|
50
|
+
output_tokens?: number;
|
|
51
|
+
cache_creation_input_tokens?: number;
|
|
52
|
+
cache_read_input_tokens?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface ClaudeContextUsage {
|
|
55
|
+
totalTokens: number;
|
|
56
|
+
maxTokens: number;
|
|
57
|
+
rawMaxTokens?: number;
|
|
58
|
+
percentage: number;
|
|
59
|
+
autoCompactThreshold?: number;
|
|
60
|
+
/** Present only when the managed Claude runtime reports its real state. */
|
|
61
|
+
isAutoCompactEnabled?: boolean;
|
|
62
|
+
detail: 'summary' | 'full';
|
|
63
|
+
apiUsage?: ClaudeApiUsage;
|
|
64
|
+
}
|
|
65
|
+
export interface ClaudeCommandDescriptor {
|
|
66
|
+
name: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
argumentHint?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface ClaudeCliState {
|
|
71
|
+
active: boolean;
|
|
72
|
+
queued: boolean;
|
|
73
|
+
sessionId?: string;
|
|
74
|
+
model?: string;
|
|
75
|
+
commands: ClaudeCommandDescriptor[];
|
|
76
|
+
output: string;
|
|
77
|
+
contextUsage?: ClaudeContextUsage;
|
|
78
|
+
lastCompact?: {
|
|
79
|
+
trigger: 'manual' | 'auto';
|
|
80
|
+
preTokens: number;
|
|
81
|
+
postTokens?: number;
|
|
82
|
+
durationMs?: number;
|
|
83
|
+
};
|
|
84
|
+
error?: string;
|
|
85
|
+
diagnostics?: {
|
|
86
|
+
model?: string;
|
|
87
|
+
routeCredential: 'injected' | 'missing';
|
|
88
|
+
routeBaseUrl: 'injected' | 'missing';
|
|
89
|
+
claudeOAuth: 'not-used' | 'required';
|
|
90
|
+
skills: {
|
|
91
|
+
synced: number;
|
|
92
|
+
skipped: number;
|
|
93
|
+
};
|
|
94
|
+
mcp: {
|
|
95
|
+
synced: number;
|
|
96
|
+
skipped: number;
|
|
97
|
+
};
|
|
98
|
+
environmentNames: string[];
|
|
99
|
+
skipped: string[];
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export type ClaudeGlobalSettingEffect = 'immediate' | 'new-session' | 'next-turn' | 'next-worktree' | 'restart';
|
|
103
|
+
export interface ClaudeGlobalSettingOption {
|
|
104
|
+
value: string;
|
|
105
|
+
label: string;
|
|
106
|
+
source: 'built-in' | 'user' | 'configured';
|
|
107
|
+
}
|
|
108
|
+
export declare const CLAUDE_CONTEXT_PRESETS: readonly [{
|
|
109
|
+
readonly value: "auto";
|
|
110
|
+
readonly label: "auto";
|
|
111
|
+
}, {
|
|
112
|
+
readonly value: "200000";
|
|
113
|
+
readonly label: "200k";
|
|
114
|
+
}, {
|
|
115
|
+
readonly value: "500000";
|
|
116
|
+
readonly label: "500k";
|
|
117
|
+
}, {
|
|
118
|
+
readonly value: "1000000";
|
|
119
|
+
readonly label: "1m";
|
|
120
|
+
}];
|
|
121
|
+
export declare const CLAUDE_COMPACT_PRESETS: readonly [{
|
|
122
|
+
readonly value: "auto";
|
|
123
|
+
readonly label: "auto";
|
|
124
|
+
}, {
|
|
125
|
+
readonly value: "100000";
|
|
126
|
+
readonly label: "100k";
|
|
127
|
+
}, {
|
|
128
|
+
readonly value: "200000";
|
|
129
|
+
readonly label: "200k";
|
|
130
|
+
}, {
|
|
131
|
+
readonly value: "500000";
|
|
132
|
+
readonly label: "500k";
|
|
133
|
+
}, {
|
|
134
|
+
readonly value: "1000000";
|
|
135
|
+
readonly label: "1m";
|
|
136
|
+
}];
|
|
137
|
+
export type ClaudeGlobalSetting = {
|
|
138
|
+
key: string;
|
|
139
|
+
kind: 'select';
|
|
140
|
+
value: string;
|
|
141
|
+
options: readonly ClaudeGlobalSettingOption[];
|
|
142
|
+
effect: ClaudeGlobalSettingEffect;
|
|
143
|
+
available?: boolean;
|
|
144
|
+
unavailableReason?: string;
|
|
145
|
+
effective?: ClaudeEffectiveSetting;
|
|
146
|
+
} | {
|
|
147
|
+
key: string;
|
|
148
|
+
kind: 'text';
|
|
149
|
+
value: string;
|
|
150
|
+
maxLength: number;
|
|
151
|
+
effect: ClaudeGlobalSettingEffect;
|
|
152
|
+
available?: boolean;
|
|
153
|
+
unavailableReason?: string;
|
|
154
|
+
effective?: ClaudeEffectiveSetting;
|
|
155
|
+
} | {
|
|
156
|
+
key: string;
|
|
157
|
+
kind: 'number';
|
|
158
|
+
value: string;
|
|
159
|
+
min: number;
|
|
160
|
+
max: number;
|
|
161
|
+
step: number;
|
|
162
|
+
presets?: readonly {
|
|
163
|
+
value: string;
|
|
164
|
+
label: string;
|
|
165
|
+
}[];
|
|
166
|
+
effect: ClaudeGlobalSettingEffect;
|
|
167
|
+
available?: boolean;
|
|
168
|
+
unavailableReason?: string;
|
|
169
|
+
effective?: ClaudeEffectiveSetting;
|
|
170
|
+
};
|
|
171
|
+
export interface ClaudeGlobalSettingsView {
|
|
172
|
+
settings: readonly ClaudeGlobalSetting[];
|
|
173
|
+
}
|
|
174
|
+
/** Settings-page operations do not belong to a conversation Agent. */
|
|
175
|
+
export interface ClaudeCodeSettingsApi {
|
|
176
|
+
status: () => Promise<ClaudeCodeStatus>;
|
|
177
|
+
install: () => Promise<ClaudeCodeStatus>;
|
|
178
|
+
rollback: () => Promise<ClaudeCodeStatus>;
|
|
179
|
+
uninstall: () => Promise<ClaudeCodeStatus>;
|
|
180
|
+
settings?: () => Promise<ClaudeNativeSettings>;
|
|
181
|
+
updateSettings?: (settings: Partial<ClaudeNativeSettings>) => Promise<ClaudeNativeSettings>;
|
|
182
|
+
globalSettings?: () => Promise<ClaudeGlobalSettingsView>;
|
|
183
|
+
updateGlobalSettings?: (changes: Record<string, string>) => Promise<ClaudeGlobalSettingsView>;
|
|
184
|
+
}
|
|
185
|
+
export interface ClaudeCodeTurn {
|
|
186
|
+
id: string;
|
|
187
|
+
provider: string;
|
|
188
|
+
model: string;
|
|
189
|
+
/** Absolute CLI entrypoint captured for this turn, before spawning it. */
|
|
190
|
+
executablePath?: string;
|
|
191
|
+
running: boolean;
|
|
192
|
+
output: string;
|
|
193
|
+
exitCode?: number | null;
|
|
194
|
+
message?: string;
|
|
195
|
+
skills: number;
|
|
196
|
+
mcp: number;
|
|
197
|
+
skipped: string[];
|
|
198
|
+
renderer?: ClaudeRenderer;
|
|
199
|
+
turn?: number;
|
|
200
|
+
step?: number;
|
|
201
|
+
activity?: ClaudeActivityBlock[];
|
|
202
|
+
nativeSessionId?: string;
|
|
203
|
+
resumed?: boolean;
|
|
204
|
+
permission?: ClaudePermissionView;
|
|
205
|
+
resources?: ClaudeResourceStatus[];
|
|
206
|
+
diagnostic?: {
|
|
207
|
+
id: string;
|
|
208
|
+
category: string;
|
|
209
|
+
};
|
|
210
|
+
contextUsage?: ClaudeContextUsage;
|
|
211
|
+
lastCompact?: ClaudeCliState['lastCompact'];
|
|
212
|
+
}
|
|
213
|
+
export interface ClaudeResourceStatus {
|
|
214
|
+
kind: 'skill' | 'mcp';
|
|
215
|
+
name: string;
|
|
216
|
+
state: 'synced' | 'manual' | 'disabled' | 'unavailable' | 'failed';
|
|
217
|
+
detail?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface ClaudePermissionView {
|
|
220
|
+
active: boolean;
|
|
221
|
+
source: ClaudePermissionSelector;
|
|
222
|
+
mode: ClaudePermissionMode;
|
|
223
|
+
hostPreset: string;
|
|
224
|
+
hostSandbox: string;
|
|
225
|
+
hostApproval: string;
|
|
226
|
+
runningMode?: ClaudePermissionMode;
|
|
227
|
+
nativeOptions: Array<{
|
|
228
|
+
value: string;
|
|
229
|
+
name: string;
|
|
230
|
+
description?: string;
|
|
231
|
+
}>;
|
|
232
|
+
}
|
|
233
|
+
export interface ClaudeActivityBlock {
|
|
234
|
+
index: number;
|
|
235
|
+
kind: 'text' | 'reasoning' | 'tool-call';
|
|
236
|
+
text: string;
|
|
237
|
+
ended: boolean;
|
|
238
|
+
id?: string;
|
|
239
|
+
name?: string;
|
|
240
|
+
result?: string;
|
|
241
|
+
failed?: boolean;
|
|
242
|
+
answer?: boolean;
|
|
243
|
+
}
|
|
244
|
+
export interface ClaudeTranscript {
|
|
245
|
+
turn: number;
|
|
246
|
+
step: number;
|
|
247
|
+
renderer: ClaudeRenderer;
|
|
248
|
+
running: boolean;
|
|
249
|
+
activity: ClaudeActivityBlock[];
|
|
250
|
+
}
|
|
251
|
+
declare module '@deepseek-ai/dsh-session/types' {
|
|
252
|
+
interface PluginRecordMap {
|
|
253
|
+
'plugin:zerowall-claude/turn': {
|
|
254
|
+
turn: number;
|
|
255
|
+
step: number;
|
|
256
|
+
};
|
|
257
|
+
'plugin:zerowall-claude/transcript': ClaudeTranscript;
|
|
258
|
+
'plugin:zerowall-claude/permission': {
|
|
259
|
+
mode: ClaudePermissionMode;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/shared/types.ts
|
|
2
|
+
var CLAUDE_CONTEXT_PRESETS = [
|
|
3
|
+
{ value: "auto", label: "auto" },
|
|
4
|
+
{ value: "200000", label: "200k" },
|
|
5
|
+
{ value: "500000", label: "500k" },
|
|
6
|
+
{ value: "1000000", label: "1m" }
|
|
7
|
+
];
|
|
8
|
+
var CLAUDE_COMPACT_PRESETS = [
|
|
9
|
+
{ value: "auto", label: "auto" },
|
|
10
|
+
{ value: "100000", label: "100k" },
|
|
11
|
+
{ value: "200000", label: "200k" },
|
|
12
|
+
{ value: "500000", label: "500k" },
|
|
13
|
+
{ value: "1000000", label: "1m" }
|
|
14
|
+
];
|
|
15
|
+
export {
|
|
16
|
+
CLAUDE_COMPACT_PRESETS,
|
|
17
|
+
CLAUDE_CONTEXT_PRESETS
|
|
18
|
+
};
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# ZeroWall Claude Code
|
|
2
|
+
|
|
3
|
+
`@zerowall/dsh-claude-coderun` adds Claude Code as an optional, independently versioned ZeroWall plugin. It is designed for the ZeroWall desktop app 8.4.7 or later and DSH `0.2.1-rc.2`.
|
|
4
|
+
|
|
5
|
+
## Isolation and installation
|
|
6
|
+
|
|
7
|
+
In ZeroWall Desktop, open Settings → Extension Center → Plugins and enable Claude Code. Activation registers the Claude Code settings page and adds Claude API to the new-session mode list. New sessions keep DSH Standard as the default; select Claude API when needed and choose a configured Claude model in the model menu to have that provider generate replies. Claude API mode keeps the standard coding tools and workflow. The Claude Code action also appears in the conversation header; open it and choose Install CLI to provision the isolated runtime.
|
|
8
|
+
|
|
9
|
+
Claude Code is installed only after the user chooses Install or Update. The plugin uses ZeroWall's bundled pnpm and the npmmirror registry to install the pinned `@anthropic-ai/claude-code` CLI into plugin-owned application data. The CLI runs by absolute path with its own config, home and package-store directories. The official Agent SDK is bundled in this independent plugin. It does not adopt, inspect or modify a user's existing Claude Code configuration.
|
|
10
|
+
|
|
11
|
+
The managed CLI receives Anthropic's documented `DISABLE_AUTOUPDATER=1` and `DISABLE_UPDATES=1` flags. Its pinned files therefore stay inside the active runtime generation; install, update and rollback run through ZeroWall's plugin settings.
|
|
12
|
+
|
|
13
|
+
The plugin is available only in the ZeroWall Desktop host. It does not provide a system-wide Claude installation or a PATH command.
|
|
14
|
+
|
|
15
|
+
The settings page's runtime diagnostics show the absolute managed CLI path. Each turn captures its own executable path so a later runtime change cannot change that turn's diagnostic evidence.
|
|
16
|
+
|
|
17
|
+
## Conversation routing and workspace access
|
|
18
|
+
|
|
19
|
+
Each new run reads the selected conversation's current model route. It supports routes explicitly identified as Anthropic Messages compatible and passes the credential to the child process only for that run. Credentials are not written to plugin configuration, logs, UI or conversation history. Other protocols are reported as unsupported; the plugin does not translate requests between protocols.
|
|
20
|
+
|
|
21
|
+
The Claude agent preset routes ordinary conversation turns through the independently managed Claude Code CLI. New conversations keep the DSH Standard preset unless Claude Code is selected. Each turn uses the provider, model, and explicit reasoning effort from DSH's final request, and resolves its credential again for that request. Standard conversations continue using the DSH model adapter.
|
|
22
|
+
|
|
23
|
+
Each conversation binds a persistent native Claude session ID and resumes it across turns and Host restarts. Existing DSH history is imported on first use; subsequent turns send new input. Cancelled or failed turns retain their binding, and pending input UUIDs are checked against native transcripts before retrying. CLI uninstall retains configuration, bindings and history.
|
|
24
|
+
|
|
25
|
+
All Claude execution stays inside the conversation flow through the Claude Agent SDK. The plugin does not create a terminal tab or expose PTY open/close lifecycle controls. Chat turns, slash commands, cancellation and Host tool approvals use the same persistent native session and SDK process ownership.
|
|
26
|
+
|
|
27
|
+
Context capacity and the automatic compaction window offer presets and custom token counts. Capacity overrides apply to unrecognized gateway IDs; recognized Claude models keep their native capacity while compaction is enabled. Use the automatic compaction window (100k–1m, capped to model capacity) to compact earlier. The settings page preserves the requested value and explains when it cannot apply. External `FORCE_PROMPT_CACHING_5M` overrides both main and subagent TTLs. `DISABLE_COMPACT` and `DISABLE_AUTO_COMPACT` are removed so automatic compaction remains enabled.
|
|
28
|
+
|
|
29
|
+
Claude Code runs in the current project using the configured permission selector and the conversation's sandbox policy. Claude plugin control supports default, dontAsk, acceptEdits, auto, plan and bypassPermissions; native control follows ZeroWall's current-session presets. Composer and settings labels follow the application language. Global defaults initialize new conversations, and running turns retain the permissions they started with. SDK authorization requests use Host approval dialogs. Host-bridged tools always pass through Host policy checks.
|
|
30
|
+
|
|
31
|
+
Enabled Skills preserve their model/manual invocation restrictions and source paths. The in-process SDK MCP bridge exposes the current session's visible ZeroWall tools and enabled MCP tools through the existing Host connections, including managed services. Image generation and editing use the selected image route and return real files, receipts and conversation attachments. Environment values and credentials are supplied only to the process and redacted from returned text. The plugin does not rewrite source Skills or MCP definitions.
|
|
32
|
+
|
|
33
|
+
Claude Code `2.1.309` does not support a `cwd` field for stdio MCP servers. An omitted or blank MCP directory inherits the current project; a matching absolute directory is supported directly (case-insensitive on Windows). For a different absolute directory, the plugin generates a temporary protocol relay under that turn's private projection. It runs Node services with ZeroWall's bundled Node/Electron executable, or launches an absolute native executable, using argument arrays and `shell: false`. The relay forwards stdin/stdout/stderr without adding output to the MCP protocol. Launch data contains no resolved credentials; controlled references remain temporary process environment variables. Turn cleanup removes the relay and launch descriptions.
|
|
34
|
+
|
|
35
|
+
Relative or invalid directories, shell-dependent launches in a separate directory, and Windows `.cmd`/`.bat` commands are skipped with an explicit compatibility reason. Use the service's absolute native executable or a Node entry point instead. The unsupported `cwd` field is never written into Claude's MCP configuration, and the source MCP records are preserved. HTTP MCP services are unaffected by this directory restriction.
|
|
36
|
+
|
|
37
|
+
## Conversation statistics
|
|
38
|
+
|
|
39
|
+
The composer dock displays actual Claude tokens, cache-hit share, weighted main-agent decode speed, and the most recent request's context occupancy. Compact and detailed preferences, application language and theme are shared with the standard conversation UI. Details separate uncached input, cache reads, cache writes and output (including thinking), with per-model totals covering SDK internal subagents and compaction. Missing counters or timing boundaries are never replaced with zero or an estimate.
|
|
40
|
+
|
|
41
|
+
Statistics start with this plugin version. Ignorable `zerowall-claude/metrics` events and a plugin-owned session projection preserve them across restarts without changing DSH's global event vocabulary or rewriting old logs. The managed CLI 2.1.309 restores cumulative `result.modelUsage` on resume, contrary to the older SDK 0.3.263 type comment. The collector uses its verified `model_usage_since_last_result` whole-tree delta; older resumed runtimes without that field expose confirmed partial stream statistics only. This avoids importing old spend, counting repeated assistant blocks, or adding the same final result to its provisional stream samples. Context capacity comes from the matching result model's `contextWindow`, never a model-name table or whole-turn token sum.
|
|
42
|
+
|
|
43
|
+
## Version and source
|
|
44
|
+
|
|
45
|
+
- ZeroWall plugin: `0.2.14`
|
|
46
|
+
- Agent SDK: `0.3.263`
|
|
47
|
+
- Claude Code CLI: `2.1.309`
|
|
48
|
+
- Upstream adapter reference: [`Norman-else/dsh-claude`](https://github.com/Norman-else/dsh-claude/tree/fe00e3af0b1ad03acc977b13b4d4ab805086f6da), tag `v0.1.65`, commit `fe00e3af0b1ad03acc977b13b4d4ab805086f6da`
|
|
49
|
+
- License: MIT; see [`LICENSE`](./LICENSE)
|
|
50
|
+
|
|
51
|
+
This ZeroWall plugin is a native adaptation. It does not include the upstream Claude Agent SDK adapter or its behavior of reusing the user's Claude profile.
|
|
52
|
+
|
|
53
|
+
## Claude subagents
|
|
54
|
+
|
|
55
|
+
The plugin mounts the official DSH delegation tool as `claude_subagent` in each Agent scope. It starts a text-only one-shot child with the managed Claude CLI, inherited Skills/MCP/environment, its own working directory and cancellation, and the parent's selected route by default. To delegate from an OpenAI parent, enable DSH's existing subagent model-selection setting and authorize an already configured Anthropic Messages route. `claude_list_subagent_models` discovers those allowed routes; pass exact `provider`, `model` and optional `reasoning_effort` to `claude_subagent`. This changes only the child process. The plugin never enables that setting or changes the parent/default model. Output schemas, continuation and max-token overrides are unsupported and fail explicitly.
|
|
56
|
+
|
|
57
|
+
## Native settings surface
|
|
58
|
+
|
|
59
|
+
The global setting listbox, text controls, chevron, card styles and prose theme reuse the pinned upstream `src/client/ClaudeCodeSettings.tsx`, `styles.ts` and `markdown-theme.ts`. The extracted components live in `src/client/upstream/`, retain the upstream MIT license, and are connected to ZeroWall's managed settings API. Local changes add accessible labels and help-text associations, avoid duplicate text writes on Enter, and support the managed runtime's availability descriptors. The runtime diagnostic card uses ZeroWall's CLI status and install/update/rollback operations.
|
|
60
|
+
|
|
61
|
+
Output style, permission selection, permission defaults, renderer, prose mode and the concurrent process limit are connected to the managed Host. The native conditional display rules hide prose for the native renderer and hide the plugin permission default for the native permission selector. Renderer changes apply to the next turn; prose settings apply to the plugin transcript.
|
|
62
|
+
|
|
63
|
+
Context capacity and automatic compaction windows accept custom integer token counts; clearing either input selects `auto`. The compaction window accepts 100000–1000000 tokens and is capped at the effective model capacity. The settings page reports requested and effective values, precedence, limits and activation timing. Automatic compaction remains enabled. Main-chat and subagent prompt-cache TTLs independently support `auto`, `5m` and `1h`; explicit external overrides are reported without displaying environment secrets.
|
|
64
|
+
|
|
65
|
+
Chat input handles slash commands through the Claude Agent SDK, preserving the current route and native session. `/compact` and `/压缩` confirm success only after a new native `compact_boundary`; optional focus instructions are preserved. `/context`, `/上下文`, `/autocompact`, `/usage`, `/config`, `/clear` and `/help` report unavailable commands explicitly. These controls remain in chat and do not depend on a terminal tab.
|
|
66
|
+
|
|
67
|
+
Unused worktree, idle-process reuse, subscription-usage and Jira cards are hidden. ZeroWall's signed Extension Center manages plugin updates; the runtime card separately manages CLI installation. Settings edited by the CLI are reread when the settings page refreshes. Context and environment changes take effect when a new CLI process starts.
|