forkoff 1.0.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 +17 -0
- package/README.md +173 -0
- package/dist/api.d.ts +44 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +76 -0
- package/dist/api.js.map +1 -0
- package/dist/approval.d.ts +46 -0
- package/dist/approval.d.ts.map +1 -0
- package/dist/approval.js +119 -0
- package/dist/approval.js.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +209 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +868 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +30 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +84 -0
- package/dist/integration.js.map +1 -0
- package/dist/terminal.d.ts +25 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/terminal.js +171 -0
- package/dist/terminal.js.map +1 -0
- package/dist/tools/claude-hooks.d.ts +97 -0
- package/dist/tools/claude-hooks.d.ts.map +1 -0
- package/dist/tools/claude-hooks.js +348 -0
- package/dist/tools/claude-hooks.js.map +1 -0
- package/dist/tools/claude-process.d.ts +271 -0
- package/dist/tools/claude-process.d.ts.map +1 -0
- package/dist/tools/claude-process.js +931 -0
- package/dist/tools/claude-process.js.map +1 -0
- package/dist/tools/claude-sessions.d.ts +60 -0
- package/dist/tools/claude-sessions.d.ts.map +1 -0
- package/dist/tools/claude-sessions.js +285 -0
- package/dist/tools/claude-sessions.js.map +1 -0
- package/dist/tools/detector.d.ts +64 -0
- package/dist/tools/detector.d.ts.map +1 -0
- package/dist/tools/detector.js +383 -0
- package/dist/tools/detector.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +15 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/transcript-streamer.d.ts +68 -0
- package/dist/transcript-streamer.d.ts.map +1 -0
- package/dist/transcript-streamer.js +459 -0
- package/dist/transcript-streamer.js.map +1 -0
- package/dist/websocket.d.ts +133 -0
- package/dist/websocket.d.ts.map +1 -0
- package/dist/websocket.js +247 -0
- package/dist/websocket.js.map +1 -0
- package/nul +0 -0
- package/package.json +54 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool Detector - Detects installed AI coding tools
|
|
4
|
+
*
|
|
5
|
+
* Supports:
|
|
6
|
+
* - Claude Code (Anthropic CLI)
|
|
7
|
+
* - Cursor IDE
|
|
8
|
+
* - GitHub Copilot (VS Code extension)
|
|
9
|
+
* - Continue.dev (VS Code extension)
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.toolDetector = void 0;
|
|
46
|
+
const child_process_1 = require("child_process");
|
|
47
|
+
const fs = __importStar(require("fs"));
|
|
48
|
+
const path = __importStar(require("path"));
|
|
49
|
+
const os = __importStar(require("os"));
|
|
50
|
+
class ToolDetector {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.platform = this.detectPlatform();
|
|
53
|
+
this.homeDir = os.homedir();
|
|
54
|
+
}
|
|
55
|
+
detectPlatform() {
|
|
56
|
+
switch (os.platform()) {
|
|
57
|
+
case 'win32':
|
|
58
|
+
return 'windows';
|
|
59
|
+
case 'darwin':
|
|
60
|
+
return 'macos';
|
|
61
|
+
default:
|
|
62
|
+
return 'linux';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Detect all supported AI coding tools
|
|
67
|
+
*/
|
|
68
|
+
async detectAll() {
|
|
69
|
+
const tools = [];
|
|
70
|
+
// Detect each tool
|
|
71
|
+
const claudeCode = await this.detectClaudeCode();
|
|
72
|
+
if (claudeCode)
|
|
73
|
+
tools.push(claudeCode);
|
|
74
|
+
const cursor = await this.detectCursor();
|
|
75
|
+
if (cursor)
|
|
76
|
+
tools.push(cursor);
|
|
77
|
+
const copilot = await this.detectCopilot();
|
|
78
|
+
if (copilot)
|
|
79
|
+
tools.push(copilot);
|
|
80
|
+
const continueDev = await this.detectContinue();
|
|
81
|
+
if (continueDev)
|
|
82
|
+
tools.push(continueDev);
|
|
83
|
+
return {
|
|
84
|
+
tools,
|
|
85
|
+
platform: this.platform,
|
|
86
|
+
timestamp: new Date().toISOString(),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Detect Claude Code (Anthropic CLI)
|
|
91
|
+
*/
|
|
92
|
+
async detectClaudeCode() {
|
|
93
|
+
const tool = {
|
|
94
|
+
type: 'claude-code',
|
|
95
|
+
name: 'Claude Code',
|
|
96
|
+
version: null,
|
|
97
|
+
path: null,
|
|
98
|
+
isRunning: false,
|
|
99
|
+
configPath: null,
|
|
100
|
+
status: 'detected',
|
|
101
|
+
};
|
|
102
|
+
// Check for .claude config directory
|
|
103
|
+
const claudeConfigDir = path.join(this.homeDir, '.claude');
|
|
104
|
+
if (fs.existsSync(claudeConfigDir)) {
|
|
105
|
+
tool.configPath = claudeConfigDir;
|
|
106
|
+
tool.status = 'configured';
|
|
107
|
+
}
|
|
108
|
+
// Try to find claude command
|
|
109
|
+
try {
|
|
110
|
+
const claudePath = this.findCommand('claude');
|
|
111
|
+
if (claudePath) {
|
|
112
|
+
tool.path = claudePath;
|
|
113
|
+
// Get version
|
|
114
|
+
try {
|
|
115
|
+
const versionOutput = (0, child_process_1.execSync)('claude --version', {
|
|
116
|
+
encoding: 'utf8',
|
|
117
|
+
timeout: 5000,
|
|
118
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
119
|
+
}).trim();
|
|
120
|
+
// Parse version from output like "claude 1.0.0" or similar
|
|
121
|
+
const versionMatch = versionOutput.match(/[\d]+\.[\d]+\.[\d]+/);
|
|
122
|
+
if (versionMatch) {
|
|
123
|
+
tool.version = versionMatch[0];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
// Command exists but version check failed
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// Claude command not found
|
|
133
|
+
}
|
|
134
|
+
// Check if Claude is running
|
|
135
|
+
tool.isRunning = this.isProcessRunning('claude');
|
|
136
|
+
if (tool.isRunning) {
|
|
137
|
+
tool.status = 'running';
|
|
138
|
+
}
|
|
139
|
+
// Only return if we found evidence of Claude Code
|
|
140
|
+
if (tool.configPath || tool.path) {
|
|
141
|
+
return tool;
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Detect Cursor IDE
|
|
147
|
+
*/
|
|
148
|
+
async detectCursor() {
|
|
149
|
+
const tool = {
|
|
150
|
+
type: 'cursor',
|
|
151
|
+
name: 'Cursor',
|
|
152
|
+
version: null,
|
|
153
|
+
path: null,
|
|
154
|
+
isRunning: false,
|
|
155
|
+
configPath: null,
|
|
156
|
+
status: 'detected',
|
|
157
|
+
};
|
|
158
|
+
// Check for Cursor installation based on platform
|
|
159
|
+
const cursorPaths = {
|
|
160
|
+
windows: [
|
|
161
|
+
path.join(process.env.LOCALAPPDATA || '', 'Programs', 'cursor', 'Cursor.exe'),
|
|
162
|
+
path.join(process.env.LOCALAPPDATA || '', 'cursor', 'Cursor.exe'),
|
|
163
|
+
'C:\\Program Files\\Cursor\\Cursor.exe',
|
|
164
|
+
],
|
|
165
|
+
macos: [
|
|
166
|
+
'/Applications/Cursor.app',
|
|
167
|
+
path.join(this.homeDir, 'Applications', 'Cursor.app'),
|
|
168
|
+
],
|
|
169
|
+
linux: [
|
|
170
|
+
'/usr/bin/cursor',
|
|
171
|
+
'/opt/cursor/cursor',
|
|
172
|
+
path.join(this.homeDir, '.local', 'bin', 'cursor'),
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
for (const cursorPath of cursorPaths[this.platform]) {
|
|
176
|
+
if (fs.existsSync(cursorPath)) {
|
|
177
|
+
tool.path = cursorPath;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Check for Cursor config
|
|
182
|
+
const configPaths = {
|
|
183
|
+
windows: path.join(process.env.APPDATA || '', 'Cursor', 'User'),
|
|
184
|
+
macos: path.join(this.homeDir, 'Library', 'Application Support', 'Cursor', 'User'),
|
|
185
|
+
linux: path.join(this.homeDir, '.config', 'Cursor', 'User'),
|
|
186
|
+
};
|
|
187
|
+
const configPath = configPaths[this.platform];
|
|
188
|
+
if (fs.existsSync(configPath)) {
|
|
189
|
+
tool.configPath = configPath;
|
|
190
|
+
tool.status = 'configured';
|
|
191
|
+
}
|
|
192
|
+
// Check if Cursor is running
|
|
193
|
+
tool.isRunning = this.isProcessRunning('cursor') || this.isProcessRunning('Cursor');
|
|
194
|
+
if (tool.isRunning) {
|
|
195
|
+
tool.status = 'running';
|
|
196
|
+
}
|
|
197
|
+
// Try to get version from package.json or similar
|
|
198
|
+
if (tool.path && this.platform === 'macos') {
|
|
199
|
+
try {
|
|
200
|
+
const plistPath = path.join(tool.path, 'Contents', 'Info.plist');
|
|
201
|
+
if (fs.existsSync(plistPath)) {
|
|
202
|
+
const plistContent = fs.readFileSync(plistPath, 'utf8');
|
|
203
|
+
const versionMatch = plistContent.match(/<key>CFBundleShortVersionString<\/key>\s*<string>([^<]+)<\/string>/);
|
|
204
|
+
if (versionMatch) {
|
|
205
|
+
tool.version = versionMatch[1];
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
// Couldn't read version
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (tool.path || tool.configPath) {
|
|
214
|
+
return tool;
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Detect GitHub Copilot (VS Code extension)
|
|
220
|
+
*/
|
|
221
|
+
async detectCopilot() {
|
|
222
|
+
const tool = {
|
|
223
|
+
type: 'copilot',
|
|
224
|
+
name: 'GitHub Copilot',
|
|
225
|
+
version: null,
|
|
226
|
+
path: null,
|
|
227
|
+
isRunning: false,
|
|
228
|
+
configPath: null,
|
|
229
|
+
status: 'detected',
|
|
230
|
+
};
|
|
231
|
+
// Check for VS Code extensions directory
|
|
232
|
+
const vscodeExtPaths = {
|
|
233
|
+
windows: path.join(this.homeDir, '.vscode', 'extensions'),
|
|
234
|
+
macos: path.join(this.homeDir, '.vscode', 'extensions'),
|
|
235
|
+
linux: path.join(this.homeDir, '.vscode', 'extensions'),
|
|
236
|
+
};
|
|
237
|
+
const extensionsDir = vscodeExtPaths[this.platform];
|
|
238
|
+
if (fs.existsSync(extensionsDir)) {
|
|
239
|
+
try {
|
|
240
|
+
const extensions = fs.readdirSync(extensionsDir);
|
|
241
|
+
const copilotExt = extensions.find(ext => ext.toLowerCase().startsWith('github.copilot-') &&
|
|
242
|
+
!ext.includes('chat'));
|
|
243
|
+
const copilotChatExt = extensions.find(ext => ext.toLowerCase().startsWith('github.copilot-chat'));
|
|
244
|
+
if (copilotExt || copilotChatExt) {
|
|
245
|
+
tool.path = path.join(extensionsDir, copilotExt || copilotChatExt || '');
|
|
246
|
+
tool.configPath = extensionsDir;
|
|
247
|
+
// Extract version from folder name
|
|
248
|
+
const ext = copilotExt || copilotChatExt;
|
|
249
|
+
if (ext) {
|
|
250
|
+
const versionMatch = ext.match(/-(\d+\.\d+\.\d+)$/);
|
|
251
|
+
if (versionMatch) {
|
|
252
|
+
tool.version = versionMatch[1];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
tool.status = 'configured';
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
// Couldn't read extensions directory
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
// Check if VS Code is running (Copilot runs within VS Code)
|
|
263
|
+
tool.isRunning = this.isProcessRunning('code') || this.isProcessRunning('Code');
|
|
264
|
+
if (tool.isRunning && tool.path) {
|
|
265
|
+
tool.status = 'running';
|
|
266
|
+
}
|
|
267
|
+
if (tool.path) {
|
|
268
|
+
return tool;
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Detect Continue.dev (VS Code extension)
|
|
274
|
+
*/
|
|
275
|
+
async detectContinue() {
|
|
276
|
+
const tool = {
|
|
277
|
+
type: 'continue',
|
|
278
|
+
name: 'Continue.dev',
|
|
279
|
+
version: null,
|
|
280
|
+
path: null,
|
|
281
|
+
isRunning: false,
|
|
282
|
+
configPath: null,
|
|
283
|
+
status: 'detected',
|
|
284
|
+
};
|
|
285
|
+
// Check for Continue config
|
|
286
|
+
const continueConfigDir = path.join(this.homeDir, '.continue');
|
|
287
|
+
if (fs.existsSync(continueConfigDir)) {
|
|
288
|
+
tool.configPath = continueConfigDir;
|
|
289
|
+
tool.status = 'configured';
|
|
290
|
+
}
|
|
291
|
+
// Check VS Code extensions
|
|
292
|
+
const extensionsDir = path.join(this.homeDir, '.vscode', 'extensions');
|
|
293
|
+
if (fs.existsSync(extensionsDir)) {
|
|
294
|
+
try {
|
|
295
|
+
const extensions = fs.readdirSync(extensionsDir);
|
|
296
|
+
const continueExt = extensions.find(ext => ext.toLowerCase().startsWith('continue.continue'));
|
|
297
|
+
if (continueExt) {
|
|
298
|
+
tool.path = path.join(extensionsDir, continueExt);
|
|
299
|
+
const versionMatch = continueExt.match(/-(\d+\.\d+\.\d+)$/);
|
|
300
|
+
if (versionMatch) {
|
|
301
|
+
tool.version = versionMatch[1];
|
|
302
|
+
}
|
|
303
|
+
tool.status = 'configured';
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
catch {
|
|
307
|
+
// Couldn't read extensions
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// Check if VS Code is running
|
|
311
|
+
tool.isRunning = this.isProcessRunning('code') || this.isProcessRunning('Code');
|
|
312
|
+
if (tool.isRunning && (tool.path || tool.configPath)) {
|
|
313
|
+
tool.status = 'running';
|
|
314
|
+
}
|
|
315
|
+
if (tool.path || tool.configPath) {
|
|
316
|
+
return tool;
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Find a command in PATH
|
|
322
|
+
*/
|
|
323
|
+
findCommand(command) {
|
|
324
|
+
try {
|
|
325
|
+
const cmd = this.platform === 'windows' ? 'where' : 'which';
|
|
326
|
+
const result = (0, child_process_1.execSync)(`${cmd} ${command}`, {
|
|
327
|
+
encoding: 'utf8',
|
|
328
|
+
timeout: 5000,
|
|
329
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
330
|
+
}).trim();
|
|
331
|
+
return result.split('\n')[0] || null;
|
|
332
|
+
}
|
|
333
|
+
catch {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Check if a process is running
|
|
339
|
+
*/
|
|
340
|
+
isProcessRunning(processName) {
|
|
341
|
+
try {
|
|
342
|
+
let cmd;
|
|
343
|
+
if (this.platform === 'windows') {
|
|
344
|
+
cmd = `tasklist /FI "IMAGENAME eq ${processName}.exe" 2>NUL | find /I "${processName}"`;
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
cmd = `pgrep -x "${processName}" 2>/dev/null || pgrep -f "${processName}" 2>/dev/null`;
|
|
348
|
+
}
|
|
349
|
+
(0, child_process_1.execSync)(cmd, {
|
|
350
|
+
encoding: 'utf8',
|
|
351
|
+
timeout: 5000,
|
|
352
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
353
|
+
});
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Watch for tool status changes
|
|
362
|
+
*/
|
|
363
|
+
watchToolStatus(callback, intervalMs = 5000) {
|
|
364
|
+
let lastStatus = '';
|
|
365
|
+
const checkStatus = async () => {
|
|
366
|
+
const result = await this.detectAll();
|
|
367
|
+
const currentStatus = JSON.stringify(result.tools.map(t => ({ type: t.type, status: t.status })));
|
|
368
|
+
if (currentStatus !== lastStatus) {
|
|
369
|
+
lastStatus = currentStatus;
|
|
370
|
+
callback(result.tools);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
// Initial check
|
|
374
|
+
checkStatus();
|
|
375
|
+
// Set up interval
|
|
376
|
+
const interval = setInterval(checkStatus, intervalMs);
|
|
377
|
+
// Return cleanup function
|
|
378
|
+
return () => clearInterval(interval);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
exports.toolDetector = new ToolDetector();
|
|
382
|
+
exports.default = exports.toolDetector;
|
|
383
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../src/tools/detector.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAgD;AAChD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAkBzB,MAAM,YAAY;IAIhB;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAEO,cAAc;QACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;YACtB,KAAK,OAAO;gBACV,OAAO,SAAS,CAAC;YACnB,KAAK,QAAQ;gBACX,OAAO,OAAO,CAAC;YACjB;gBACE,OAAO,OAAO,CAAC;QACnB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,KAAK,GAAmB,EAAE,CAAC;QAEjC,mBAAmB;QACnB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACjD,IAAI,UAAU;YAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACzC,IAAI,MAAM;YAAE,KA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AG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;YAElG,IAAI,aAAa,KAAK,UAAU,EAAE,CAAC;gBACjC,UAAU,GAAG,aAAa,CAAC;gBAC3B,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC;QAEF,gBAAgB;QAChB,WAAW,EAAE,CAAC;QAEd,kBAAkB;QAClB,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAEtD,0BAA0B;QAC1B,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAC/C,kBAAe,oBAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Module - Detection and integration with AI coding tools
|
|
3
|
+
*/
|
|
4
|
+
export { toolDetector, DetectedTool, ToolDetectionResult } from './detector';
|
|
5
|
+
export { claudeHooksManager, ClaudeHookInput, ClaudeHookOutput } from './claude-hooks';
|
|
6
|
+
export { claudeSessionDetector, ClaudeSessionInfo } from './claude-sessions';
|
|
7
|
+
export { claudeProcessManager } from './claude-process';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tools Module - Detection and integration with AI coding tools
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.claudeProcessManager = exports.claudeSessionDetector = exports.claudeHooksManager = exports.toolDetector = void 0;
|
|
7
|
+
var detector_1 = require("./detector");
|
|
8
|
+
Object.defineProperty(exports, "toolDetector", { enumerable: true, get: function () { return detector_1.toolDetector; } });
|
|
9
|
+
var claude_hooks_1 = require("./claude-hooks");
|
|
10
|
+
Object.defineProperty(exports, "claudeHooksManager", { enumerable: true, get: function () { return claude_hooks_1.claudeHooksManager; } });
|
|
11
|
+
var claude_sessions_1 = require("./claude-sessions");
|
|
12
|
+
Object.defineProperty(exports, "claudeSessionDetector", { enumerable: true, get: function () { return claude_sessions_1.claudeSessionDetector; } });
|
|
13
|
+
var claude_process_1 = require("./claude-process");
|
|
14
|
+
Object.defineProperty(exports, "claudeProcessManager", { enumerable: true, get: function () { return claude_process_1.claudeProcessManager; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAA6E;AAApE,wGAAA,YAAY,OAAA;AACrB,+CAAuF;AAA9E,kHAAA,kBAAkB,OAAA;AAC3B,qDAA6E;AAApE,wHAAA,qBAAqB,OAAA;AAC9B,mDAAwD;AAA/C,sHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
export interface DiffHunk {
|
|
3
|
+
oldStart: number;
|
|
4
|
+
oldLines: number;
|
|
5
|
+
newStart: number;
|
|
6
|
+
newLines: number;
|
|
7
|
+
lines: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface TranscriptEntry {
|
|
10
|
+
id: string;
|
|
11
|
+
parentId?: string;
|
|
12
|
+
type: 'user' | 'assistant' | 'system' | 'tool_use' | 'tool_result';
|
|
13
|
+
timestamp: string;
|
|
14
|
+
lineNumber: number;
|
|
15
|
+
content?: {
|
|
16
|
+
role?: 'user' | 'assistant';
|
|
17
|
+
text?: string;
|
|
18
|
+
toolName?: string;
|
|
19
|
+
toolInput?: any;
|
|
20
|
+
isError?: boolean;
|
|
21
|
+
filePath?: string;
|
|
22
|
+
diff?: DiffHunk[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
interface TranscriptFetchResult {
|
|
26
|
+
entries: TranscriptEntry[];
|
|
27
|
+
totalEntries: number;
|
|
28
|
+
hasMore: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare class TranscriptStreamer extends EventEmitter {
|
|
31
|
+
private watchers;
|
|
32
|
+
private fileSizes;
|
|
33
|
+
private lastLineNumbers;
|
|
34
|
+
private processingLock;
|
|
35
|
+
/**
|
|
36
|
+
* Fetch transcript history from a JSONL file
|
|
37
|
+
* Supports reverse pagination: offset 0 = most recent entries
|
|
38
|
+
*/
|
|
39
|
+
fetchHistory(transcriptPath: string, offset?: number, limit?: number, reverse?: boolean): Promise<TranscriptFetchResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Subscribe to live updates from a transcript file
|
|
42
|
+
*/
|
|
43
|
+
subscribeToUpdates(sessionKey: string, transcriptPath: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Unsubscribe from transcript updates
|
|
46
|
+
*/
|
|
47
|
+
unsubscribeFromUpdates(sessionKey: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Read new lines that were added to the file since last read
|
|
50
|
+
*/
|
|
51
|
+
private readNewLines;
|
|
52
|
+
/**
|
|
53
|
+
* Parse a JSONL line into a TranscriptEntry
|
|
54
|
+
*/
|
|
55
|
+
private parseEntry;
|
|
56
|
+
/**
|
|
57
|
+
* Transform Claude JSONL message format to our TranscriptEntry format
|
|
58
|
+
* Shows all content visible in the Claude terminal
|
|
59
|
+
*/
|
|
60
|
+
private transformMessage;
|
|
61
|
+
/**
|
|
62
|
+
* Clean up all watchers
|
|
63
|
+
*/
|
|
64
|
+
cleanup(): void;
|
|
65
|
+
}
|
|
66
|
+
export declare const transcriptStreamer: TranscriptStreamer;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=transcript-streamer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-streamer.d.ts","sourceRoot":"","sources":["../src/transcript-streamer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;KACnB,CAAC;CACH;AAED,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