@theia/ai-claude-code 1.67.0-next.3 → 1.67.0-next.56
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 +1 -0
- package/package.json +10 -10
- package/lib/browser/claude-code-chat-agent.d.ts +0 -80
- package/lib/browser/claude-code-chat-agent.d.ts.map +0 -1
- package/lib/browser/claude-code-chat-agent.js +0 -517
- package/lib/browser/claude-code-chat-agent.js.map +0 -1
- package/lib/browser/claude-code-command-contribution.d.ts +0 -16
- package/lib/browser/claude-code-command-contribution.d.ts.map +0 -1
- package/lib/browser/claude-code-command-contribution.js +0 -86
- package/lib/browser/claude-code-command-contribution.js.map +0 -1
- package/lib/browser/claude-code-edit-tool-service.d.ts +0 -61
- package/lib/browser/claude-code-edit-tool-service.d.ts.map +0 -1
- package/lib/browser/claude-code-edit-tool-service.js +0 -220
- package/lib/browser/claude-code-edit-tool-service.js.map +0 -1
- package/lib/browser/claude-code-file-edit-backup-service.d.ts +0 -57
- package/lib/browser/claude-code-file-edit-backup-service.d.ts.map +0 -1
- package/lib/browser/claude-code-file-edit-backup-service.js +0 -92
- package/lib/browser/claude-code-file-edit-backup-service.js.map +0 -1
- package/lib/browser/claude-code-frontend-module.d.ts +0 -5
- package/lib/browser/claude-code-frontend-module.d.ts.map +0 -1
- package/lib/browser/claude-code-frontend-module.js +0 -83
- package/lib/browser/claude-code-frontend-module.js.map +0 -1
- package/lib/browser/claude-code-frontend-service.d.ts +0 -39
- package/lib/browser/claude-code-frontend-service.d.ts.map +0 -1
- package/lib/browser/claude-code-frontend-service.js +0 -189
- package/lib/browser/claude-code-frontend-service.js.map +0 -1
- package/lib/browser/claude-code-slash-commands-contribution.d.ts +0 -17
- package/lib/browser/claude-code-slash-commands-contribution.d.ts.map +0 -1
- package/lib/browser/claude-code-slash-commands-contribution.js +0 -155
- package/lib/browser/claude-code-slash-commands-contribution.js.map +0 -1
- package/lib/browser/claude-code-tool-call-content.d.ts +0 -8
- package/lib/browser/claude-code-tool-call-content.d.ts.map +0 -1
- package/lib/browser/claude-code-tool-call-content.js +0 -30
- package/lib/browser/claude-code-tool-call-content.js.map +0 -1
- package/lib/browser/renderers/bash-tool-renderer.d.ts +0 -10
- package/lib/browser/renderers/bash-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/bash-tool-renderer.js +0 -67
- package/lib/browser/renderers/bash-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/collapsible-tool-renderer.d.ts +0 -13
- package/lib/browser/renderers/collapsible-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/collapsible-tool-renderer.js +0 -48
- package/lib/browser/renderers/collapsible-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/edit-tool-renderer.d.ts +0 -16
- package/lib/browser/renderers/edit-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/edit-tool-renderer.js +0 -135
- package/lib/browser/renderers/edit-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/glob-tool-renderer.d.ts +0 -14
- package/lib/browser/renderers/glob-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/glob-tool-renderer.js +0 -104
- package/lib/browser/renderers/glob-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/grep-tool-renderer.d.ts +0 -14
- package/lib/browser/renderers/grep-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/grep-tool-renderer.js +0 -160
- package/lib/browser/renderers/grep-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/ls-tool-renderer.d.ts +0 -16
- package/lib/browser/renderers/ls-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/ls-tool-renderer.js +0 -116
- package/lib/browser/renderers/ls-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/multiedit-tool-renderer.d.ts +0 -16
- package/lib/browser/renderers/multiedit-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/multiedit-tool-renderer.js +0 -148
- package/lib/browser/renderers/multiedit-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/read-tool-renderer.d.ts +0 -16
- package/lib/browser/renderers/read-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/read-tool-renderer.js +0 -124
- package/lib/browser/renderers/read-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/todo-write-renderer.d.ts +0 -10
- package/lib/browser/renderers/todo-write-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/todo-write-renderer.js +0 -133
- package/lib/browser/renderers/todo-write-renderer.js.map +0 -1
- package/lib/browser/renderers/web-fetch-tool-renderer.d.ts +0 -10
- package/lib/browser/renderers/web-fetch-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/web-fetch-tool-renderer.js +0 -83
- package/lib/browser/renderers/web-fetch-tool-renderer.js.map +0 -1
- package/lib/browser/renderers/write-tool-renderer.d.ts +0 -16
- package/lib/browser/renderers/write-tool-renderer.d.ts.map +0 -1
- package/lib/browser/renderers/write-tool-renderer.js +0 -114
- package/lib/browser/renderers/write-tool-renderer.js.map +0 -1
- package/lib/common/claude-code-preferences.d.ts +0 -5
- package/lib/common/claude-code-preferences.d.ts.map +0 -1
- package/lib/common/claude-code-preferences.js +0 -40
- package/lib/common/claude-code-preferences.js.map +0 -1
- package/lib/common/claude-code-service.d.ts +0 -235
- package/lib/common/claude-code-service.d.ts.map +0 -1
- package/lib/common/claude-code-service.js +0 -82
- package/lib/common/claude-code-service.js.map +0 -1
- package/lib/common/index.d.ts +0 -2
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -20
- package/lib/common/index.js.map +0 -1
- package/lib/node/claude-code-backend-module.d.ts +0 -4
- package/lib/node/claude-code-backend-module.d.ts.map +0 -1
- package/lib/node/claude-code-backend-module.js +0 -35
- package/lib/node/claude-code-backend-module.js.map +0 -1
- package/lib/node/claude-code-service-impl.d.ts +0 -33
- package/lib/node/claude-code-service-impl.d.ts.map +0 -1
- package/lib/node/claude-code-service-impl.js +0 -468
- package/lib/node/claude-code-service-impl.js.map +0 -1
- package/lib/package.spec.d.ts +0 -1
- package/lib/package.spec.d.ts.map +0 -1
- package/lib/package.spec.js +0 -26
- package/lib/package.spec.js.map +0 -1
|
@@ -1,468 +0,0 @@
|
|
|
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.ClaudeCodeServiceImpl = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const core_1 = require("@theia/core");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const child_process_1 = require("child_process");
|
|
23
|
-
const fs_1 = require("fs");
|
|
24
|
-
const fs = require("fs/promises");
|
|
25
|
-
const path = require("path");
|
|
26
|
-
let ClaudeCodeServiceImpl = class ClaudeCodeServiceImpl {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.abortControllers = new Map();
|
|
29
|
-
this.pendingApprovals = new Map();
|
|
30
|
-
}
|
|
31
|
-
setClient(client) {
|
|
32
|
-
this.client = client;
|
|
33
|
-
}
|
|
34
|
-
async send(request, streamId) {
|
|
35
|
-
if (!this.client) {
|
|
36
|
-
throw new Error('Claude Code client not initialized');
|
|
37
|
-
}
|
|
38
|
-
this.sendMessages(streamId, request);
|
|
39
|
-
}
|
|
40
|
-
isApiKeyError(message) {
|
|
41
|
-
var _a, _b, _c, _d, _e;
|
|
42
|
-
if (typeof message === 'object' && message) {
|
|
43
|
-
// Check if this is a result message with the API key error
|
|
44
|
-
const resultMessage = message;
|
|
45
|
-
if (resultMessage.type === 'result' && resultMessage.is_error && resultMessage.result) {
|
|
46
|
-
const hasErrorText = resultMessage.result.includes('Invalid API key') && resultMessage.result.includes('/login');
|
|
47
|
-
// Additional check: error results typically have zero token usage
|
|
48
|
-
const hasZeroUsage = ((_a = resultMessage.usage) === null || _a === void 0 ? void 0 : _a.input_tokens) === 0 && ((_b = resultMessage.usage) === null || _b === void 0 ? void 0 : _b.output_tokens) === 0;
|
|
49
|
-
return hasErrorText && (hasZeroUsage || !resultMessage.usage);
|
|
50
|
-
}
|
|
51
|
-
// Check if this is an assistant message with the API key error
|
|
52
|
-
// These messages have model: "<synthetic>" to indicate they're error messages
|
|
53
|
-
const assistantMessage = message;
|
|
54
|
-
if (assistantMessage.type === 'assistant' &&
|
|
55
|
-
((_c = assistantMessage.message) === null || _c === void 0 ? void 0 : _c.model) === '<synthetic>' &&
|
|
56
|
-
((_d = assistantMessage.message) === null || _d === void 0 ? void 0 : _d.role) === 'assistant' &&
|
|
57
|
-
((_e = assistantMessage.message) === null || _e === void 0 ? void 0 : _e.content)) {
|
|
58
|
-
const hasErrorText = assistantMessage.message.content.some(content => content.type === 'text' && content.text &&
|
|
59
|
-
content.text.includes('Invalid API key') && content.text.includes('/login'));
|
|
60
|
-
// Additional check: synthetic error messages have zero token usage
|
|
61
|
-
const usage = assistantMessage.message.usage;
|
|
62
|
-
const hasZeroUsage = (usage === null || usage === void 0 ? void 0 : usage.input_tokens) === 0 && (usage === null || usage === void 0 ? void 0 : usage.output_tokens) === 0;
|
|
63
|
-
return hasErrorText && (hasZeroUsage || !usage);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
async sendMessages(streamId, request) {
|
|
69
|
-
var _a;
|
|
70
|
-
const abortController = new AbortController();
|
|
71
|
-
this.abortControllers.set(streamId, abortController);
|
|
72
|
-
try {
|
|
73
|
-
const cwd = ((_a = request.options) === null || _a === void 0 ? void 0 : _a.cwd) || process.cwd();
|
|
74
|
-
await this.ensureFileBackupHook(cwd);
|
|
75
|
-
await this.ensureStopHook(cwd);
|
|
76
|
-
await this.ensureClaudeSettings(cwd);
|
|
77
|
-
let done = (_) => { };
|
|
78
|
-
const receivedResult = new Promise(resolve => {
|
|
79
|
-
done = resolve;
|
|
80
|
-
});
|
|
81
|
-
const apiKey = request.apiKey || process.env.ANTHROPIC_API_KEY;
|
|
82
|
-
const { query, SDKUserMessage, Options } = await this.importClaudeCodeSDK(request.claudeCodePath);
|
|
83
|
-
const stream = query({
|
|
84
|
-
prompt: (async function* () {
|
|
85
|
-
yield {
|
|
86
|
-
type: 'user',
|
|
87
|
-
message: {
|
|
88
|
-
role: 'user',
|
|
89
|
-
content: request.prompt
|
|
90
|
-
},
|
|
91
|
-
// eslint-disable-next-line no-null/no-null
|
|
92
|
-
parent_tool_use_id: null,
|
|
93
|
-
session_id: (0, core_1.generateUuid)()
|
|
94
|
-
};
|
|
95
|
-
await receivedResult;
|
|
96
|
-
})(),
|
|
97
|
-
options: {
|
|
98
|
-
...request.options,
|
|
99
|
-
abortController,
|
|
100
|
-
cwd,
|
|
101
|
-
settingSources: ['user', 'project', 'local'],
|
|
102
|
-
canUseTool: (toolName, toolInput) => this.requestToolApproval(streamId, toolName, toolInput),
|
|
103
|
-
env: { ...process.env, ANTHROPIC_API_KEY: apiKey, NODE_OPTIONS: '' },
|
|
104
|
-
stderr: (data) => {
|
|
105
|
-
var _a;
|
|
106
|
-
let message = String(data);
|
|
107
|
-
// The current claude code CLI is quite verbose and outputs a lot of
|
|
108
|
-
// non-error info to stderr when spawning.
|
|
109
|
-
// We check for this and log it at debug level instead.
|
|
110
|
-
if (message.startsWith('Spawning Claude Code process:')) {
|
|
111
|
-
// Strip the system prompt if present
|
|
112
|
-
if ((_a = request.options) === null || _a === void 0 ? void 0 : _a.appendSystemPrompt) {
|
|
113
|
-
const systemPrompt = request.options.appendSystemPrompt;
|
|
114
|
-
message = message.replace(systemPrompt, '').trim();
|
|
115
|
-
}
|
|
116
|
-
// Check if the remainder looks like it contains an actual error
|
|
117
|
-
if (message.toLowerCase().includes('error') || message.toLowerCase().includes('failed')) {
|
|
118
|
-
this.logger.error('Claude Code Std Error:', message);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this.logger.debug('Claude Code Verbose Output:', message);
|
|
122
|
-
}
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
// Log all other content as error (actual errors)
|
|
126
|
-
this.logger.error('Claude Code Std Error:', message);
|
|
127
|
-
},
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
for await (const message of stream) {
|
|
131
|
-
// Check for API key error and handle it
|
|
132
|
-
if (this.isApiKeyError(message)) {
|
|
133
|
-
// If this is the result message, send the custom error and stop
|
|
134
|
-
if (message.type === 'result') {
|
|
135
|
-
const errorMessage = core_1.nls.localize('theia/ai/claude-code/apiKeyError', 'Please set a Claude Code API key in the preferences or log into Claude Code on your machine.');
|
|
136
|
-
this.client.sendError(streamId, new Error(errorMessage));
|
|
137
|
-
done();
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
// If this is an assistant message with the error, skip it (don't send to client)
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
this.client.sendToken(streamId, message);
|
|
144
|
-
if (message.type === 'result' || abortController.signal.aborted) {
|
|
145
|
-
done();
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
// Signal stream completion by returning undefined
|
|
150
|
-
abortController.abort('closed after result');
|
|
151
|
-
this.client.sendToken(streamId, undefined);
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
this.logger.error('Claude Code error:', e);
|
|
155
|
-
this.client.sendError(streamId, e instanceof Error ? e : new Error(String(e)));
|
|
156
|
-
}
|
|
157
|
-
finally {
|
|
158
|
-
this.abortControllers.delete(streamId);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Dynamically imports the Claude Code SDK from the local installation.
|
|
163
|
-
* @param customClaudeCodePath Optional custom path to Claude Code executable (cli.js)
|
|
164
|
-
* @returns An object containing the SDK's query function, user message type, and options type.
|
|
165
|
-
*/
|
|
166
|
-
async importClaudeCodeSDK(customClaudeCodePath) {
|
|
167
|
-
let claudeCodePath;
|
|
168
|
-
if (customClaudeCodePath) {
|
|
169
|
-
if (!(0, fs_1.existsSync)(customClaudeCodePath)) {
|
|
170
|
-
throw new Error(core_1.nls.localize('theia/ai/claude-code/executableNotFoundAt', 'Specified Claude Code executable not found at: {0}', customClaudeCodePath));
|
|
171
|
-
}
|
|
172
|
-
const realPath = (0, fs_1.realpathSync)(customClaudeCodePath);
|
|
173
|
-
// Use the directory containing the cli.js file
|
|
174
|
-
claudeCodePath = path.dirname(realPath);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
claudeCodePath = this.resolveClaudeCodePath();
|
|
178
|
-
}
|
|
179
|
-
const sdkPath = path.join(claudeCodePath, 'sdk.mjs');
|
|
180
|
-
// Check if file exists before importing
|
|
181
|
-
if (!(0, fs_1.existsSync)(sdkPath)) {
|
|
182
|
-
throw new Error(core_1.nls.localize('theia/ai/claude-code/installationNotFoundAt', 'Claude Code installation not found. ' +
|
|
183
|
-
'Please install with: `npm install -g @anthropic-ai/claude-agent-sdk` ' +
|
|
184
|
-
'and/or specify the path to the executable in the settings. ' +
|
|
185
|
-
'We looked at {0}', sdkPath));
|
|
186
|
-
}
|
|
187
|
-
const importPath = `file://${sdkPath}`;
|
|
188
|
-
// We can not use dynamic import directly because webpack will try to
|
|
189
|
-
// bundle the module at build time, which we don't want.
|
|
190
|
-
// We also can't use a webpack ignore comment because the comment is stripped
|
|
191
|
-
// during the build and then webpack still tries to resolve the module.
|
|
192
|
-
const dynamicImport = new Function('path', 'return import(path)');
|
|
193
|
-
return dynamicImport(importPath);
|
|
194
|
-
}
|
|
195
|
-
resolveClaudeCodePath() {
|
|
196
|
-
try {
|
|
197
|
-
const globalPath = (0, child_process_1.execSync)('npm root -g', { encoding: 'utf8' }).trim();
|
|
198
|
-
return path.join(globalPath, '@anthropic-ai/claude-agent-sdk');
|
|
199
|
-
}
|
|
200
|
-
catch (error) {
|
|
201
|
-
this.logger.error('Failed to resolve global npm path:', error);
|
|
202
|
-
throw new Error(core_1.nls.localize('theia/ai/claude-code/installationNotFound', 'Claude Code installation not found. ' +
|
|
203
|
-
'Please install with: `npm install -g @anthropic-ai/claude-agent-sdk` ' +
|
|
204
|
-
'and/or specify the path to the executable in the settings.'));
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
cancel(streamId) {
|
|
208
|
-
const abortController = this.abortControllers.get(streamId);
|
|
209
|
-
if (abortController) {
|
|
210
|
-
abortController.abort('user canceled');
|
|
211
|
-
this.abortControllers.delete(streamId);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
handleApprovalResponse(response) {
|
|
215
|
-
const resolver = this.pendingApprovals.get(response.requestId);
|
|
216
|
-
if (resolver) {
|
|
217
|
-
resolver({
|
|
218
|
-
behavior: response.approved ? 'allow' : 'deny',
|
|
219
|
-
message: response.message,
|
|
220
|
-
updatedInput: response.updatedInput
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
async requestToolApproval(streamId, toolName, toolInput) {
|
|
225
|
-
this.logger.info('Requesting tool approval:', toolName, toolInput);
|
|
226
|
-
const requestId = (0, core_1.generateUuid)();
|
|
227
|
-
const approvalRequest = {
|
|
228
|
-
type: 'tool-approval-request',
|
|
229
|
-
toolName,
|
|
230
|
-
toolInput,
|
|
231
|
-
requestId
|
|
232
|
-
};
|
|
233
|
-
this.client.sendToken(streamId, approvalRequest);
|
|
234
|
-
const approvalPromise = new Promise(resolve => {
|
|
235
|
-
this.pendingApprovals.set(requestId, resolve);
|
|
236
|
-
});
|
|
237
|
-
const result = await approvalPromise;
|
|
238
|
-
this.pendingApprovals.delete(requestId);
|
|
239
|
-
return result;
|
|
240
|
-
}
|
|
241
|
-
async ensureStopHook(cwd) {
|
|
242
|
-
const hookPath = path.join(cwd, '.claude', 'hooks', 'session-cleanup-hook.js');
|
|
243
|
-
try {
|
|
244
|
-
await fs.access(hookPath);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
catch {
|
|
248
|
-
// Hook doesn't exist, create it
|
|
249
|
-
}
|
|
250
|
-
await fs.mkdir(path.dirname(hookPath), { recursive: true });
|
|
251
|
-
const hookContent = `#!/usr/bin/env node
|
|
252
|
-
|
|
253
|
-
const fs = require('fs').promises;
|
|
254
|
-
const path = require('path');
|
|
255
|
-
|
|
256
|
-
async function main() {
|
|
257
|
-
try {
|
|
258
|
-
const input = await new Promise((resolve, reject) => {
|
|
259
|
-
let data = '';
|
|
260
|
-
process.stdin.on('data', chunk => data += chunk);
|
|
261
|
-
process.stdin.on('end', () => resolve(data));
|
|
262
|
-
process.stdin.on('error', reject);
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
const hookData = JSON.parse(input);
|
|
266
|
-
|
|
267
|
-
// Delete backup directory for this session
|
|
268
|
-
const backupDir = path.join(hookData.cwd, '.claude', '.edit-baks', hookData.session_id);
|
|
269
|
-
|
|
270
|
-
try {
|
|
271
|
-
await fs.rm(backupDir, { recursive: true, force: true });
|
|
272
|
-
console.log(\`Cleaned up session backups: \${hookData.session_id}\`);
|
|
273
|
-
} catch (error) {
|
|
274
|
-
// Directory might not exist, which is fine
|
|
275
|
-
console.log(\`No backups to clean for session: \${hookData.session_id}\`);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
} catch (error) {
|
|
279
|
-
console.error(\`Cleanup failed: \${error.message}\`, process.stderr);
|
|
280
|
-
process.exit(1);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
main();
|
|
285
|
-
`;
|
|
286
|
-
await fs.writeFile(hookPath, hookContent, { mode: 0o755 });
|
|
287
|
-
}
|
|
288
|
-
async ensureFileBackupHook(cwd) {
|
|
289
|
-
const hookPath = path.join(cwd, '.claude', 'hooks', 'file-backup-hook.js');
|
|
290
|
-
try {
|
|
291
|
-
await fs.access(hookPath);
|
|
292
|
-
// Hook already exists, no need to create it
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
catch {
|
|
296
|
-
// Hook doesn't exist, create it
|
|
297
|
-
}
|
|
298
|
-
// Ensure the hooks directory exists
|
|
299
|
-
await fs.mkdir(path.dirname(hookPath), { recursive: true });
|
|
300
|
-
const hookContent = `#!/usr/bin/env node
|
|
301
|
-
|
|
302
|
-
const fs = require('fs').promises;
|
|
303
|
-
const path = require('path');
|
|
304
|
-
|
|
305
|
-
async function main() {
|
|
306
|
-
try {
|
|
307
|
-
// Read input from stdin
|
|
308
|
-
const input = await new Promise((resolve, reject) => {
|
|
309
|
-
let data = '';
|
|
310
|
-
process.stdin.on('data', chunk => data += chunk);
|
|
311
|
-
process.stdin.on('end', () => resolve(data));
|
|
312
|
-
process.stdin.on('error', reject);
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
const hookData = JSON.parse(input);
|
|
316
|
-
|
|
317
|
-
// Only backup for file modification tools
|
|
318
|
-
const fileModifyingTools = ['Write', 'Edit', 'MultiEdit'];
|
|
319
|
-
if (!fileModifyingTools.includes(hookData.tool_name)) {
|
|
320
|
-
process.exit(0);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// Extract file path from tool input
|
|
324
|
-
let filePath;
|
|
325
|
-
if (hookData.tool_name === 'Write' || hookData.tool_name === 'Edit') {
|
|
326
|
-
filePath = hookData.tool_input?.file_path;
|
|
327
|
-
} else if (hookData.tool_name === 'MultiEdit') {
|
|
328
|
-
// MultiEdit has multiple files - we'll handle the first one for now
|
|
329
|
-
// You might want to extend this to handle all files
|
|
330
|
-
filePath = hookData.tool_input?.files?.[0]?.file_path;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
if (!filePath) {
|
|
334
|
-
process.exit(0);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// Resolve absolute path
|
|
338
|
-
const absoluteFilePath = path.resolve(hookData.cwd, filePath);
|
|
339
|
-
|
|
340
|
-
// Check if file exists (can't backup what doesn't exist)
|
|
341
|
-
try {
|
|
342
|
-
await fs.access(absoluteFilePath);
|
|
343
|
-
} catch {
|
|
344
|
-
// File doesn't exist, nothing to backup
|
|
345
|
-
process.exit(0);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
// Create backup directory structure
|
|
349
|
-
const backupDir = path.join(hookData.cwd, '.claude', '.edit-baks', hookData.session_id);
|
|
350
|
-
await fs.mkdir(backupDir, { recursive: true });
|
|
351
|
-
|
|
352
|
-
// Create backup file path (maintain relative structure)
|
|
353
|
-
const relativePath = path.relative(hookData.cwd, absoluteFilePath);
|
|
354
|
-
const backupFilePath = path.join(backupDir, relativePath);
|
|
355
|
-
|
|
356
|
-
// Ensure backup subdirectories exist
|
|
357
|
-
await fs.mkdir(path.dirname(backupFilePath), { recursive: true });
|
|
358
|
-
|
|
359
|
-
// Only create backup if it doesn't already exist for this session
|
|
360
|
-
try {
|
|
361
|
-
await fs.access(backupFilePath);
|
|
362
|
-
// Backup already exists for this session, don't overwrite
|
|
363
|
-
process.exit(0);
|
|
364
|
-
} catch {
|
|
365
|
-
// Backup doesn't exist, create it
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// Copy the file
|
|
369
|
-
await fs.copyFile(absoluteFilePath, backupFilePath);
|
|
370
|
-
|
|
371
|
-
// Optional: Log the backup (visible in transcript mode with Ctrl-R)
|
|
372
|
-
console.log(\`Backed up: \${relativePath}\`);
|
|
373
|
-
|
|
374
|
-
} catch (error) {
|
|
375
|
-
console.error(\`Backup failed: \${error.message}\`, process.stderr);
|
|
376
|
-
process.exit(1); // Non-blocking error
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
main();
|
|
381
|
-
`;
|
|
382
|
-
await fs.writeFile(hookPath, hookContent, { mode: 0o755 });
|
|
383
|
-
}
|
|
384
|
-
async ensureClaudeSettings(cwd) {
|
|
385
|
-
var _a, _b, _c, _d, _e, _f;
|
|
386
|
-
const settingsPath = path.join(cwd, '.claude', 'settings.local.json');
|
|
387
|
-
const hookConfig = {
|
|
388
|
-
hooks: {
|
|
389
|
-
PreToolUse: [
|
|
390
|
-
{
|
|
391
|
-
matcher: 'Write|Edit|MultiEdit',
|
|
392
|
-
hooks: [
|
|
393
|
-
{
|
|
394
|
-
type: 'command',
|
|
395
|
-
command: 'node $CLAUDE_PROJECT_DIR/.claude/hooks/file-backup-hook.js',
|
|
396
|
-
timeout: 10
|
|
397
|
-
}
|
|
398
|
-
]
|
|
399
|
-
}
|
|
400
|
-
],
|
|
401
|
-
Stop: [
|
|
402
|
-
{
|
|
403
|
-
matcher: '',
|
|
404
|
-
hooks: [
|
|
405
|
-
{
|
|
406
|
-
type: 'command',
|
|
407
|
-
command: 'node $CLAUDE_PROJECT_DIR/.claude/hooks/session-cleanup-hook.js'
|
|
408
|
-
}
|
|
409
|
-
]
|
|
410
|
-
}
|
|
411
|
-
]
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
try {
|
|
415
|
-
// Try to read existing settings
|
|
416
|
-
const existingContent = await fs.readFile(settingsPath, 'utf8');
|
|
417
|
-
const existingSettings = JSON.parse(existingContent);
|
|
418
|
-
// Check if hooks already exist and are properly configured
|
|
419
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
420
|
-
const hasPreHook = (_b = (_a = existingSettings.hooks) === null || _a === void 0 ? void 0 : _a.PreToolUse) === null || _b === void 0 ? void 0 : _b.some((hook) => {
|
|
421
|
-
var _a;
|
|
422
|
-
return hook.matcher === 'Write|Edit|MultiEdit' &&
|
|
423
|
-
(
|
|
424
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
425
|
-
(_a = hook.hooks) === null || _a === void 0 ? void 0 : _a.some((h) => { var _a; return (_a = h.command) === null || _a === void 0 ? void 0 : _a.includes('file-backup-hook.js'); }));
|
|
426
|
-
});
|
|
427
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
428
|
-
const hasStopHook = (_d = (_c = existingSettings.hooks) === null || _c === void 0 ? void 0 : _c.Stop) === null || _d === void 0 ? void 0 : _d.some((hook) => { var _a;
|
|
429
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
430
|
-
return (_a = hook.hooks) === null || _a === void 0 ? void 0 : _a.some((h) => { var _a; return (_a = h.command) === null || _a === void 0 ? void 0 : _a.includes('session-cleanup-hook.js'); }); });
|
|
431
|
-
if (hasPreHook && hasStopHook) {
|
|
432
|
-
// Hooks already configured, no need to modify
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
// Merge with existing settings
|
|
436
|
-
const mergedSettings = {
|
|
437
|
-
...existingSettings,
|
|
438
|
-
hooks: {
|
|
439
|
-
...existingSettings.hooks,
|
|
440
|
-
PreToolUse: [
|
|
441
|
-
...(((_e = existingSettings.hooks) === null || _e === void 0 ? void 0 : _e.PreToolUse) || []),
|
|
442
|
-
...(hasPreHook ? [] : hookConfig.hooks.PreToolUse)
|
|
443
|
-
],
|
|
444
|
-
Stop: [
|
|
445
|
-
...(((_f = existingSettings.hooks) === null || _f === void 0 ? void 0 : _f.Stop) || []),
|
|
446
|
-
...(hasStopHook ? [] : hookConfig.hooks.Stop)
|
|
447
|
-
]
|
|
448
|
-
}
|
|
449
|
-
};
|
|
450
|
-
await fs.writeFile(settingsPath, JSON.stringify(mergedSettings, undefined, 2));
|
|
451
|
-
}
|
|
452
|
-
catch {
|
|
453
|
-
// File doesn't exist or is invalid JSON, create new one
|
|
454
|
-
await fs.mkdir(path.dirname(settingsPath), { recursive: true });
|
|
455
|
-
await fs.writeFile(settingsPath, JSON.stringify(hookConfig, undefined, 2));
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
exports.ClaudeCodeServiceImpl = ClaudeCodeServiceImpl;
|
|
460
|
-
tslib_1.__decorate([
|
|
461
|
-
(0, inversify_1.inject)(core_1.ILogger),
|
|
462
|
-
(0, inversify_1.named)('ClaudeCode'),
|
|
463
|
-
tslib_1.__metadata("design:type", Object)
|
|
464
|
-
], ClaudeCodeServiceImpl.prototype, "logger", void 0);
|
|
465
|
-
exports.ClaudeCodeServiceImpl = ClaudeCodeServiceImpl = tslib_1.__decorate([
|
|
466
|
-
(0, inversify_1.injectable)()
|
|
467
|
-
], ClaudeCodeServiceImpl);
|
|
468
|
-
//# sourceMappingURL=claude-code-service-impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code-service-impl.js","sourceRoot":"","sources":["../../src/node/claude-code-service-impl.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,sCAAyD;AACzD,4DAAyE;AACzE,iDAAyC;AACzC,2BAA8C;AAC9C,kCAAkC;AAClC,6BAA6B;AAgBtB,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAA3B;QAMK,qBAAgB,GAAG,IAAI,GAAG,EAA2B,CAAC;QACtD,qBAAgB,GAAG,IAAI,GAAG,EAAgD,CAAC;IA4dvF,CAAC;IA1dG,SAAS,CAAC,MAAwB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAiC,EAAE,QAAgB;QAC1D,IAAI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IADP,IAAA,kBAAM,EAAC,cAAO,CAAC;IAAE,IAAA,iBAAK,EAAC,YAAY,CAAC;;qDACb;gCAHf,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAmejC"}
|
package/lib/package.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=package.spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
|
package/lib/package.spec.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
/* note: this bogus test file is required so that
|
|
17
|
-
we are able to run mocha unit tests on this
|
|
18
|
-
package, without having any actual unit tests in it.
|
|
19
|
-
This way a coverage report will be generated,
|
|
20
|
-
showing 0% coverage, instead of no report.
|
|
21
|
-
This file can be removed once we have real unit
|
|
22
|
-
tests in place. */
|
|
23
|
-
describe('ai-claude-code package', () => {
|
|
24
|
-
it('support code coverage statistics', () => true);
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=package.spec.js.map
|
package/lib/package.spec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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;;;;;;qBAMqB;AAErB,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
|