@theia/ai-claude-code 1.67.0-next.56 → 1.67.0-next.86
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/lib/browser/claude-code-chat-agent.d.ts +84 -0
- package/lib/browser/claude-code-chat-agent.d.ts.map +1 -0
- package/lib/browser/claude-code-chat-agent.js +525 -0
- package/lib/browser/claude-code-chat-agent.js.map +1 -0
- package/lib/browser/claude-code-command-contribution.d.ts +16 -0
- package/lib/browser/claude-code-command-contribution.d.ts.map +1 -0
- package/lib/browser/claude-code-command-contribution.js +86 -0
- package/lib/browser/claude-code-command-contribution.js.map +1 -0
- package/lib/browser/claude-code-edit-tool-service.d.ts +63 -0
- package/lib/browser/claude-code-edit-tool-service.d.ts.map +1 -0
- package/lib/browser/claude-code-edit-tool-service.js +225 -0
- package/lib/browser/claude-code-edit-tool-service.js.map +1 -0
- package/lib/browser/claude-code-file-edit-backup-service.d.ts +59 -0
- package/lib/browser/claude-code-file-edit-backup-service.d.ts.map +1 -0
- package/lib/browser/claude-code-file-edit-backup-service.js +98 -0
- package/lib/browser/claude-code-file-edit-backup-service.js.map +1 -0
- package/lib/browser/claude-code-frontend-module.d.ts +5 -0
- package/lib/browser/claude-code-frontend-module.d.ts.map +1 -0
- package/lib/browser/claude-code-frontend-module.js +83 -0
- package/lib/browser/claude-code-frontend-module.js.map +1 -0
- package/lib/browser/claude-code-frontend-service.d.ts +39 -0
- package/lib/browser/claude-code-frontend-service.d.ts.map +1 -0
- package/lib/browser/claude-code-frontend-service.js +189 -0
- package/lib/browser/claude-code-frontend-service.js.map +1 -0
- package/lib/browser/claude-code-slash-commands-contribution.d.ts +34 -0
- package/lib/browser/claude-code-slash-commands-contribution.d.ts.map +1 -0
- package/lib/browser/claude-code-slash-commands-contribution.js +219 -0
- package/lib/browser/claude-code-slash-commands-contribution.js.map +1 -0
- package/lib/browser/claude-code-tool-call-content.d.ts +8 -0
- package/lib/browser/claude-code-tool-call-content.d.ts.map +1 -0
- package/lib/browser/claude-code-tool-call-content.js +30 -0
- package/lib/browser/claude-code-tool-call-content.js.map +1 -0
- package/lib/browser/renderers/bash-tool-renderer.d.ts +10 -0
- package/lib/browser/renderers/bash-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/bash-tool-renderer.js +67 -0
- package/lib/browser/renderers/bash-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/collapsible-tool-renderer.d.ts +13 -0
- package/lib/browser/renderers/collapsible-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/collapsible-tool-renderer.js +48 -0
- package/lib/browser/renderers/collapsible-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/edit-tool-renderer.d.ts +16 -0
- package/lib/browser/renderers/edit-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/edit-tool-renderer.js +135 -0
- package/lib/browser/renderers/edit-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/glob-tool-renderer.d.ts +14 -0
- package/lib/browser/renderers/glob-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/glob-tool-renderer.js +104 -0
- package/lib/browser/renderers/glob-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/grep-tool-renderer.d.ts +14 -0
- package/lib/browser/renderers/grep-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/grep-tool-renderer.js +160 -0
- package/lib/browser/renderers/grep-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/ls-tool-renderer.d.ts +16 -0
- package/lib/browser/renderers/ls-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/ls-tool-renderer.js +116 -0
- package/lib/browser/renderers/ls-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/multiedit-tool-renderer.d.ts +16 -0
- package/lib/browser/renderers/multiedit-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/multiedit-tool-renderer.js +148 -0
- package/lib/browser/renderers/multiedit-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/read-tool-renderer.d.ts +16 -0
- package/lib/browser/renderers/read-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/read-tool-renderer.js +124 -0
- package/lib/browser/renderers/read-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/todo-write-renderer.d.ts +10 -0
- package/lib/browser/renderers/todo-write-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/todo-write-renderer.js +133 -0
- package/lib/browser/renderers/todo-write-renderer.js.map +1 -0
- package/lib/browser/renderers/web-fetch-tool-renderer.d.ts +10 -0
- package/lib/browser/renderers/web-fetch-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/web-fetch-tool-renderer.js +83 -0
- package/lib/browser/renderers/web-fetch-tool-renderer.js.map +1 -0
- package/lib/browser/renderers/write-tool-renderer.d.ts +16 -0
- package/lib/browser/renderers/write-tool-renderer.d.ts.map +1 -0
- package/lib/browser/renderers/write-tool-renderer.js +114 -0
- package/lib/browser/renderers/write-tool-renderer.js.map +1 -0
- package/lib/common/claude-code-preferences.d.ts +5 -0
- package/lib/common/claude-code-preferences.d.ts.map +1 -0
- package/lib/common/claude-code-preferences.js +40 -0
- package/lib/common/claude-code-preferences.js.map +1 -0
- package/lib/common/claude-code-service.d.ts +235 -0
- package/lib/common/claude-code-service.d.ts.map +1 -0
- package/lib/common/claude-code-service.js +82 -0
- package/lib/common/claude-code-service.js.map +1 -0
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +20 -0
- package/lib/common/index.js.map +1 -0
- package/lib/node/claude-code-backend-module.d.ts +4 -0
- package/lib/node/claude-code-backend-module.d.ts.map +1 -0
- package/lib/node/claude-code-backend-module.js +35 -0
- package/lib/node/claude-code-backend-module.js.map +1 -0
- package/lib/node/claude-code-service-impl.d.ts +33 -0
- package/lib/node/claude-code-service-impl.d.ts.map +1 -0
- package/lib/node/claude-code-service-impl.js +468 -0
- package/lib/node/claude-code-service-impl.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +10 -10
- package/src/browser/claude-code-chat-agent.ts +17 -10
- package/src/browser/claude-code-edit-tool-service.ts +10 -7
- package/src/browser/claude-code-file-edit-backup-service.ts +6 -2
- package/src/browser/claude-code-slash-commands-contribution.ts +152 -73
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
export declare const CLAUDE_CODE_SERVICE_PATH = "/services/claude-code";
|
|
2
|
+
/**
|
|
3
|
+
* Message sent from backend to frontend requesting user approval for tool usage.
|
|
4
|
+
*/
|
|
5
|
+
export interface ToolApprovalRequestMessage {
|
|
6
|
+
type: 'tool-approval-request';
|
|
7
|
+
toolName: string;
|
|
8
|
+
toolInput: unknown;
|
|
9
|
+
requestId: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Message sent from frontend to backend with user approval decision.
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolApprovalResponseMessage {
|
|
15
|
+
type: 'tool-approval-response';
|
|
16
|
+
requestId: string;
|
|
17
|
+
approved: boolean;
|
|
18
|
+
message?: string;
|
|
19
|
+
updatedInput?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export declare namespace ToolApprovalRequestMessage {
|
|
22
|
+
function is(obj: unknown): obj is ToolApprovalRequestMessage;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace ToolApprovalResponseMessage {
|
|
25
|
+
function is(obj: unknown): obj is ToolApprovalResponseMessage;
|
|
26
|
+
}
|
|
27
|
+
export type StreamMessage = SDKMessage | ToolApprovalRequestMessage;
|
|
28
|
+
export interface ClaudeCodeRequest {
|
|
29
|
+
prompt: string;
|
|
30
|
+
options?: Partial<ClaudeCodeOptions>;
|
|
31
|
+
}
|
|
32
|
+
export interface ClaudeCodeBackendRequest extends ClaudeCodeRequest {
|
|
33
|
+
apiKey?: string;
|
|
34
|
+
claudeCodePath?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const ClaudeCodeClient: unique symbol;
|
|
37
|
+
export interface ClaudeCodeClient {
|
|
38
|
+
/**
|
|
39
|
+
* @param token `undefined` signals end of stream.
|
|
40
|
+
*/
|
|
41
|
+
sendToken(streamId: string, token?: StreamMessage): void;
|
|
42
|
+
sendError(streamId: string, error: Error): void;
|
|
43
|
+
}
|
|
44
|
+
export declare const ClaudeCodeService: unique symbol;
|
|
45
|
+
export interface ClaudeCodeService {
|
|
46
|
+
/**
|
|
47
|
+
* Send a request to Claude Code.
|
|
48
|
+
* @param request request parameters
|
|
49
|
+
* @param streamId Pre-generated stream ID for tracking streaming responses
|
|
50
|
+
*/
|
|
51
|
+
send(request: ClaudeCodeBackendRequest, streamId: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Cancel a running request to Claude Code.
|
|
54
|
+
* @param streamId Stream ID identifying the request
|
|
55
|
+
*/
|
|
56
|
+
cancel(streamId: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Handle approval response from the frontend.
|
|
59
|
+
* @param response approval response
|
|
60
|
+
*/
|
|
61
|
+
handleApprovalResponse(response: ToolApprovalResponseMessage): void;
|
|
62
|
+
}
|
|
63
|
+
export type PermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
|
|
64
|
+
export interface NonNullableUsage {
|
|
65
|
+
input_tokens: number;
|
|
66
|
+
output_tokens: number;
|
|
67
|
+
cache_creation_input_tokens?: number;
|
|
68
|
+
cache_read_input_tokens?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface Usage {
|
|
71
|
+
input_tokens?: number;
|
|
72
|
+
output_tokens?: number;
|
|
73
|
+
cache_creation_input_tokens?: number;
|
|
74
|
+
cache_read_input_tokens?: number;
|
|
75
|
+
}
|
|
76
|
+
export interface SDKMessageBase {
|
|
77
|
+
uuid: string;
|
|
78
|
+
session_id: string;
|
|
79
|
+
}
|
|
80
|
+
export type SDKUserMessage = SDKMessageBase & {
|
|
81
|
+
type: 'user';
|
|
82
|
+
message: {
|
|
83
|
+
role: 'user';
|
|
84
|
+
content: string | ContentBlock[];
|
|
85
|
+
};
|
|
86
|
+
parent_tool_use_id: string | null;
|
|
87
|
+
};
|
|
88
|
+
export interface TextBlock {
|
|
89
|
+
type: 'text';
|
|
90
|
+
text: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ToolUseContentBlock {
|
|
93
|
+
type: 'tool_use' | 'server_tool_use';
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
input: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
export interface ToolResultBlock {
|
|
99
|
+
type: 'tool_result';
|
|
100
|
+
tool_use_id: string;
|
|
101
|
+
content: unknown;
|
|
102
|
+
is_error?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface ThinkingBlock {
|
|
105
|
+
type: 'thinking';
|
|
106
|
+
thinking: string;
|
|
107
|
+
signature?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface RedactedThinkingBlock {
|
|
110
|
+
type: 'redacted_thinking';
|
|
111
|
+
data: string;
|
|
112
|
+
}
|
|
113
|
+
export interface WebSearchToolResultBlock {
|
|
114
|
+
type: 'web_search_tool_result';
|
|
115
|
+
tool_use_id: string;
|
|
116
|
+
content: Array<{
|
|
117
|
+
title: string;
|
|
118
|
+
url: string;
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
122
|
+
export type ContentBlock = TextBlock | ToolUseContentBlock | ToolResultBlock | ThinkingBlock | RedactedThinkingBlock | WebSearchToolResultBlock;
|
|
123
|
+
export type SDKAssistantMessage = SDKMessageBase & {
|
|
124
|
+
type: 'assistant';
|
|
125
|
+
message: {
|
|
126
|
+
id: string;
|
|
127
|
+
type: 'message';
|
|
128
|
+
role: 'assistant';
|
|
129
|
+
content: ContentBlock[];
|
|
130
|
+
model: string;
|
|
131
|
+
stop_reason: string | null;
|
|
132
|
+
stop_sequence: string | null;
|
|
133
|
+
usage: Usage;
|
|
134
|
+
};
|
|
135
|
+
parent_tool_use_id: string | null;
|
|
136
|
+
};
|
|
137
|
+
export type SDKResultMessage = SDKMessageBase & {
|
|
138
|
+
type: 'result';
|
|
139
|
+
subtype: 'success' | 'error_max_turns' | 'error_during_execution';
|
|
140
|
+
duration_ms: number;
|
|
141
|
+
duration_api_ms: number;
|
|
142
|
+
is_error: boolean;
|
|
143
|
+
num_turns: number;
|
|
144
|
+
total_cost_usd: number;
|
|
145
|
+
usage: NonNullableUsage;
|
|
146
|
+
permission_denials: Array<{
|
|
147
|
+
tool_name: string;
|
|
148
|
+
tool_use_id: string;
|
|
149
|
+
tool_input: Record<string, unknown>;
|
|
150
|
+
}>;
|
|
151
|
+
};
|
|
152
|
+
export type SDKSystemMessage = SDKMessageBase & {
|
|
153
|
+
type: 'system';
|
|
154
|
+
subtype: 'init';
|
|
155
|
+
apiKeySource: string;
|
|
156
|
+
cwd: string;
|
|
157
|
+
tools: string[];
|
|
158
|
+
mcp_servers: Array<{
|
|
159
|
+
name: string;
|
|
160
|
+
status: string;
|
|
161
|
+
}>;
|
|
162
|
+
model: string;
|
|
163
|
+
permissionMode: PermissionMode;
|
|
164
|
+
slash_commands: string[];
|
|
165
|
+
output_style: string;
|
|
166
|
+
};
|
|
167
|
+
export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKResultMessage | SDKSystemMessage;
|
|
168
|
+
export interface ClaudeCodeOptions {
|
|
169
|
+
cwd?: string;
|
|
170
|
+
abortController?: AbortController;
|
|
171
|
+
additionalDirectories?: string[];
|
|
172
|
+
allowedTools?: string[];
|
|
173
|
+
appendSystemPrompt?: string;
|
|
174
|
+
canUseTool?: (toolName: string, input: Record<string, unknown>, options: {
|
|
175
|
+
signal: AbortController['signal'];
|
|
176
|
+
}) => Promise<{
|
|
177
|
+
behavior: 'allow' | 'deny';
|
|
178
|
+
message?: string;
|
|
179
|
+
updatedInput?: unknown;
|
|
180
|
+
}>;
|
|
181
|
+
continue?: boolean;
|
|
182
|
+
systemPrompt?: string | {
|
|
183
|
+
type: 'preset';
|
|
184
|
+
preset: 'claude_code';
|
|
185
|
+
append?: string;
|
|
186
|
+
};
|
|
187
|
+
disallowedTools?: string[];
|
|
188
|
+
env?: Record<string, string>;
|
|
189
|
+
executable?: 'bun' | 'deno' | 'node';
|
|
190
|
+
executableArgs?: string[];
|
|
191
|
+
extraArgs?: Record<string, string | null>;
|
|
192
|
+
fallbackModel?: string;
|
|
193
|
+
maxThinkingTokens?: number;
|
|
194
|
+
maxTurns?: number;
|
|
195
|
+
model?: string;
|
|
196
|
+
pathToClaudeCodeExecutable?: string;
|
|
197
|
+
permissionMode?: PermissionMode;
|
|
198
|
+
permissionPromptToolName?: string;
|
|
199
|
+
resume?: string;
|
|
200
|
+
stderr?: (data: string) => void;
|
|
201
|
+
strictMcpConfig?: boolean;
|
|
202
|
+
}
|
|
203
|
+
export interface TaskInput {
|
|
204
|
+
description: string;
|
|
205
|
+
prompt: string;
|
|
206
|
+
}
|
|
207
|
+
export interface EditInput {
|
|
208
|
+
file_path: string;
|
|
209
|
+
old_string: string;
|
|
210
|
+
new_string: string;
|
|
211
|
+
}
|
|
212
|
+
export interface MultiEditInput {
|
|
213
|
+
file_path: string;
|
|
214
|
+
edits: Array<{
|
|
215
|
+
old_string: string;
|
|
216
|
+
new_string: string;
|
|
217
|
+
}>;
|
|
218
|
+
}
|
|
219
|
+
export interface WriteInput {
|
|
220
|
+
file_path: string;
|
|
221
|
+
content: string;
|
|
222
|
+
}
|
|
223
|
+
export declare namespace TaskInput {
|
|
224
|
+
function is(input: unknown): input is TaskInput;
|
|
225
|
+
}
|
|
226
|
+
export declare namespace EditInput {
|
|
227
|
+
function is(input: unknown): input is EditInput;
|
|
228
|
+
}
|
|
229
|
+
export declare namespace MultiEditInput {
|
|
230
|
+
function is(input: unknown): input is MultiEditInput;
|
|
231
|
+
}
|
|
232
|
+
export declare namespace WriteInput {
|
|
233
|
+
function is(input: unknown): input is WriteInput;
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=claude-code-service.d.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M,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAGD,MAAM,WAAW,SAAS;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,SAAS,CAAC;IACvB,SAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAKrD;CACJ;AAED,yBAAiB,SAAS,CAAC;IACvB,SAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAOrD;CACJ;AAED,yBAAiB,cAAc,CAAC;IAC5B,SAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAM1D;CACJ;AAED,yBAAiB,UAAU,CAAC;IACxB,SAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAMtD;CACJ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.WriteInput = exports.MultiEditInput = exports.EditInput = exports.TaskInput = exports.ClaudeCodeService = exports.ClaudeCodeClient = exports.ToolApprovalResponseMessage = exports.ToolApprovalRequestMessage = exports.CLAUDE_CODE_SERVICE_PATH = void 0;
|
|
19
|
+
exports.CLAUDE_CODE_SERVICE_PATH = '/services/claude-code';
|
|
20
|
+
var ToolApprovalRequestMessage;
|
|
21
|
+
(function (ToolApprovalRequestMessage) {
|
|
22
|
+
function is(obj) {
|
|
23
|
+
return typeof obj === 'object' && obj !== undefined &&
|
|
24
|
+
obj.type === 'tool-approval-request';
|
|
25
|
+
}
|
|
26
|
+
ToolApprovalRequestMessage.is = is;
|
|
27
|
+
})(ToolApprovalRequestMessage || (exports.ToolApprovalRequestMessage = ToolApprovalRequestMessage = {}));
|
|
28
|
+
var ToolApprovalResponseMessage;
|
|
29
|
+
(function (ToolApprovalResponseMessage) {
|
|
30
|
+
function is(obj) {
|
|
31
|
+
return typeof obj === 'object' && obj !== undefined &&
|
|
32
|
+
obj.type === 'tool-approval-response';
|
|
33
|
+
}
|
|
34
|
+
ToolApprovalResponseMessage.is = is;
|
|
35
|
+
})(ToolApprovalResponseMessage || (exports.ToolApprovalResponseMessage = ToolApprovalResponseMessage = {}));
|
|
36
|
+
exports.ClaudeCodeClient = Symbol('ClaudeCodeClient');
|
|
37
|
+
exports.ClaudeCodeService = Symbol('ClaudeCodeService');
|
|
38
|
+
var TaskInput;
|
|
39
|
+
(function (TaskInput) {
|
|
40
|
+
function is(input) {
|
|
41
|
+
// eslint-disable-next-line no-null/no-null
|
|
42
|
+
return typeof input === 'object' && input !== null && 'description' in input && 'prompt' in input &&
|
|
43
|
+
typeof input.description === 'string' &&
|
|
44
|
+
typeof input.prompt === 'string';
|
|
45
|
+
}
|
|
46
|
+
TaskInput.is = is;
|
|
47
|
+
})(TaskInput || (exports.TaskInput = TaskInput = {}));
|
|
48
|
+
var EditInput;
|
|
49
|
+
(function (EditInput) {
|
|
50
|
+
function is(input) {
|
|
51
|
+
// eslint-disable-next-line no-null/no-null
|
|
52
|
+
return typeof input === 'object' && input !== null &&
|
|
53
|
+
'file_path' in input && 'old_string' in input && 'new_string' in input &&
|
|
54
|
+
typeof input.file_path === 'string' &&
|
|
55
|
+
typeof input.old_string === 'string' &&
|
|
56
|
+
typeof input.new_string === 'string';
|
|
57
|
+
}
|
|
58
|
+
EditInput.is = is;
|
|
59
|
+
})(EditInput || (exports.EditInput = EditInput = {}));
|
|
60
|
+
var MultiEditInput;
|
|
61
|
+
(function (MultiEditInput) {
|
|
62
|
+
function is(input) {
|
|
63
|
+
// eslint-disable-next-line no-null/no-null
|
|
64
|
+
return typeof input === 'object' && input !== null &&
|
|
65
|
+
'file_path' in input && 'edits' in input &&
|
|
66
|
+
typeof input.file_path === 'string' &&
|
|
67
|
+
Array.isArray(input.edits);
|
|
68
|
+
}
|
|
69
|
+
MultiEditInput.is = is;
|
|
70
|
+
})(MultiEditInput || (exports.MultiEditInput = MultiEditInput = {}));
|
|
71
|
+
var WriteInput;
|
|
72
|
+
(function (WriteInput) {
|
|
73
|
+
function is(input) {
|
|
74
|
+
// eslint-disable-next-line no-null/no-null
|
|
75
|
+
return typeof input === 'object' && input !== null &&
|
|
76
|
+
'file_path' in input && 'content' in input &&
|
|
77
|
+
typeof input.file_path === 'string' &&
|
|
78
|
+
typeof input.content === 'string';
|
|
79
|
+
}
|
|
80
|
+
WriteInput.is = is;
|
|
81
|
+
})(WriteInput || (exports.WriteInput = WriteInput = {}));
|
|
82
|
+
//# sourceMappingURL=claude-code-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-service.js","sourceRoot":"","sources":["../../src/common/claude-code-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEnE,QAAA,wBAAwB,GAAG,uBAAuB,CAAC;AAuBhE,IAAiB,0BAA0B,CAK1C;AALD,WAAiB,0BAA0B;IACvC,SAAgB,EAAE,CAAC,GAAY;QAC3B,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,SAAS;YAC9C,GAAkC,CAAC,IAAI,KAAK,uBAAuB,CAAC;IAC7E,CAAC;IAHe,6BAAE,KAGjB,CAAA;AACL,CAAC,EALgB,0BAA0B,0CAA1B,0BAA0B,QAK1C;AAED,IAAiB,2BAA2B,CAK3C;AALD,WAAiB,2BAA2B;IACxC,SAAgB,EAAE,CAAC,GAAY;QAC3B,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,SAAS;YAC9C,GAAmC,CAAC,IAAI,KAAK,wBAAwB,CAAC;IAC/E,CAAC;IAHe,8BAAE,KAGjB,CAAA;AACL,CAAC,EALgB,2BAA2B,2CAA3B,2BAA2B,QAK3C;AAcY,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAS9C,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAsM7D,IAAiB,SAAS,CAOzB;AAPD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,UAAU;IACvB,SAAgB,EAAE,CAAC,KAAc;QAC7B,2CAA2C;QAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;YAC9C,WAAW,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK;YAC1C,OAAQ,KAAoB,CAAC,SAAS,KAAK,QAAQ;YACnD,OAAQ,KAAoB,CAAC,OAAO,KAAK,QAAQ,CAAC;IAC1D,CAAC;IANe,aAAE,KAMjB,CAAA;AACL,CAAC,EARgB,UAAU,0BAAV,UAAU,QAQ1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAgBA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
tslib_1.__exportStar(require("./claude-code-service"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,gEAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/claude-code-backend-module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAqB/D,wBAEG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const core_1 = require("@theia/core");
|
|
19
|
+
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const claude_code_service_1 = require("../common/claude-code-service");
|
|
22
|
+
const claude_code_service_impl_1 = require("./claude-code-service-impl");
|
|
23
|
+
const claudeCodeConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind }) => {
|
|
24
|
+
bind(claude_code_service_impl_1.ClaudeCodeServiceImpl).toSelf().inSingletonScope();
|
|
25
|
+
bind(claude_code_service_1.ClaudeCodeService).toService(claude_code_service_impl_1.ClaudeCodeServiceImpl);
|
|
26
|
+
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(claude_code_service_1.CLAUDE_CODE_SERVICE_PATH, client => {
|
|
27
|
+
const server = ctx.container.get(claude_code_service_1.ClaudeCodeService);
|
|
28
|
+
server.setClient(client);
|
|
29
|
+
return server;
|
|
30
|
+
})).inSingletonScope();
|
|
31
|
+
});
|
|
32
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
33
|
+
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(claudeCodeConnectionModule);
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=claude-code-backend-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-backend-module.js","sourceRoot":"","sources":["../../src/node/claude-code-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,sCAAsE;AACtE,4GAAuG;AACvG,4DAA+D;AAC/D,uEAIuC;AACvC,yEAAmE;AAEnE,MAAM,0BAA0B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7E,IAAI,CAAC,gDAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxD,IAAI,CAAC,uCAAiB,CAAC,CAAC,SAAS,CAAC,gDAAqB,CAAC,CAAC;IAEzD,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAAmB,8CAAwB,EAAE,MAAM,CAAC,EAAE;QAC1E,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAwB,uCAAiB,CAAC,CAAC;QAC3E,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC,CACL,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ClaudeCodeBackendRequest, ClaudeCodeClient, ClaudeCodeService, ToolApprovalResponseMessage } from '../common/claude-code-service';
|
|
2
|
+
export declare class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
3
|
+
private logger;
|
|
4
|
+
private client;
|
|
5
|
+
private abortControllers;
|
|
6
|
+
private pendingApprovals;
|
|
7
|
+
setClient(client: ClaudeCodeClient): void;
|
|
8
|
+
send(request: ClaudeCodeBackendRequest, streamId: string): Promise<void>;
|
|
9
|
+
protected isApiKeyError(message: unknown): boolean;
|
|
10
|
+
protected sendMessages(streamId: string, request: ClaudeCodeBackendRequest): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Dynamically imports the Claude Code SDK from the local installation.
|
|
13
|
+
* @param customClaudeCodePath Optional custom path to Claude Code executable (cli.js)
|
|
14
|
+
* @returns An object containing the SDK's query function, user message type, and options type.
|
|
15
|
+
*/
|
|
16
|
+
protected importClaudeCodeSDK(customClaudeCodePath?: string): Promise<{
|
|
17
|
+
query: unknown;
|
|
18
|
+
SDKUserMessage: unknown;
|
|
19
|
+
Options: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
protected resolveClaudeCodePath(): string;
|
|
22
|
+
cancel(streamId: string): void;
|
|
23
|
+
handleApprovalResponse(response: ToolApprovalResponseMessage): void;
|
|
24
|
+
protected requestToolApproval(streamId: string, toolName: string, toolInput: unknown): Promise<{
|
|
25
|
+
behavior: 'allow' | 'deny';
|
|
26
|
+
message?: string;
|
|
27
|
+
updatedInput?: unknown;
|
|
28
|
+
}>;
|
|
29
|
+
protected ensureStopHook(cwd: string): Promise<void>;
|
|
30
|
+
protected ensureFileBackupHook(cwd: string): Promise<void>;
|
|
31
|
+
private ensureClaudeSettings;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=claude-code-service-impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-service-impl.d.ts","sourceRoot":"","sources":["../../src/node/claude-code-service-impl.ts"],"names":[],"mappings":"AAsBA,OAAO,EACH,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EAEjB,2BAA2B,EAC9B,MAAM,+BAA+B,CAAC;AAQvC,qBACa,qBAAsB,YAAW,iBAAiB;IAG3D,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,OAAO,CAAC,gBAAgB,CAA2D;IAEnF,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAInC,IAAI,CAAC,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9E,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;cA4ClC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkGhG;;;;OAIG;cACa,mBAAmB,CAAC,o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