ccjk 14.0.0 → 14.0.1
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/dist/chunks/ccr.mjs +2 -3
- package/dist/chunks/check-updates.mjs +1 -3
- package/dist/chunks/code-type-resolver.mjs +878 -0
- package/dist/chunks/config.mjs +41 -1
- package/dist/chunks/index10.mjs +55 -6
- package/dist/chunks/init.mjs +38 -10
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +1 -3
- package/dist/chunks/status.mjs +63 -16
- package/dist/chunks/uninstall.mjs +1 -3
- package/dist/cli.mjs +58 -17
- package/dist/i18n/locales/en/configuration.json +6 -2
- package/dist/i18n/locales/zh-CN/configuration.json +6 -2
- package/dist/index.d.mts +64 -17
- package/dist/index.d.ts +64 -17
- package/dist/index.mjs +9 -718
- package/dist/shared/ccjk.BO45TPXJ.mjs +807 -0
- package/package.json +1 -1
- package/dist/chunks/intent-engine.mjs +0 -142
- package/dist/chunks/smart-defaults.mjs +0 -425
- package/dist/shared/ccjk.DJuyfrlL.mjs +0 -348
- package/dist/shared/ccjk.yYQMbHH3.mjs +0 -115
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
export { P as ProjectAnalyzer, T as TemplatesClient, d as analyzeDependencies, a as analyzeProject, h as batchAnalyze, b as createTemplatesClient, e as detectProject, f as detectProjectType, g as getTemplatesClient } from './shared/ccjk.Cv13QsGp.mjs';
|
|
2
2
|
import { a as createCloudClient } from './shared/ccjk.Dhu8ia5S.mjs';
|
|
3
3
|
export { C as CachedCloudClient, b as CloudCache, d as CloudClient, F as FallbackCloudClient, R as RetryableCloudClient, T as TelemetryReporter, c as createCompleteCloudClient, g as getTelemetry, i as initializeTelemetry, r as retryUtils, s as stopTelemetry, t as telemetryUtils, e as trackEvent, w as withRetry } from './shared/ccjk.Dhu8ia5S.mjs';
|
|
4
|
+
import { T as ToolRegistry } from './shared/ccjk.BO45TPXJ.mjs';
|
|
5
|
+
export { A as AiderTool, B as BaseCodeTool, C as ClaudeCodeTool, b as ClineTool, c as CodexTool, d as ContinueTool, e as CursorTool, a as getRegistry, g as getRuntimeCapabilityDescriptor } from './shared/ccjk.BO45TPXJ.mjs';
|
|
4
6
|
import { CLOUD_ENDPOINTS } from './chunks/constants.mjs';
|
|
5
7
|
export { C as CloudError, a as CloudErrorCode, b as CloudErrorFactory, f as formatErrorForLogging, g as getRetryDelay, h as handleCloudError, i as isAuthError, c as isRateLimitError, d as isRetryableError, e as isRetryableErrorCode } from './shared/ccjk.vO3d1ABk.mjs';
|
|
6
8
|
import { e as extractString } from './shared/ccjk.C2jHOZVP.mjs';
|
|
7
9
|
export { a as extractDisplayName, i as i18nHelpers, n as normalizeRecommendation, b as normalizeRecommendations } from './shared/ccjk.C2jHOZVP.mjs';
|
|
8
|
-
import { exec, execSync } from 'node:child_process';
|
|
9
|
-
import { promises, existsSync, readdirSync, readFileSync, statSync, createReadStream } from 'node:fs';
|
|
10
|
-
import * as os from 'node:os';
|
|
11
|
-
import { homedir } from 'node:os';
|
|
12
|
-
import * as path from 'node:path';
|
|
13
|
-
import { promisify } from 'node:util';
|
|
14
10
|
import a from './chunks/index5.mjs';
|
|
15
11
|
import { g as getRuntimeVersion } from './shared/ccjk.gDEDGD_t.mjs';
|
|
12
|
+
import { execSync } from 'node:child_process';
|
|
13
|
+
import { existsSync, readdirSync, readFileSync, statSync, promises, createReadStream } from 'node:fs';
|
|
14
|
+
import * as os from 'node:os';
|
|
15
|
+
import { homedir } from 'node:os';
|
|
16
16
|
import { j as join$1 } from './shared/ccjk.bQ7Dh1g4.mjs';
|
|
17
17
|
import { b as buildCommand, c as commandExists, a as escapeArgument, e as executeCommand, d as executeCommandParallel, f as executeCommandSequence, g as executeCommandStream, h as getCommandPath, i as getCommandVersion, p as parseVersion } from './shared/ccjk.BnsY5WxD.mjs';
|
|
18
18
|
export { B as config } from './chunks/config.mjs';
|
|
19
|
+
import * as path from 'node:path';
|
|
19
20
|
export { a as loggerUtils } from './shared/ccjk.8oaxX4iR.mjs';
|
|
20
21
|
export { p as platform } from './chunks/platform.mjs';
|
|
21
22
|
import { Transform } from 'node:stream';
|
|
@@ -25,6 +26,7 @@ import 'tinyglobby';
|
|
|
25
26
|
import './shared/ccjk.BBtCGd_g.mjs';
|
|
26
27
|
import 'node:url';
|
|
27
28
|
import 'node:crypto';
|
|
29
|
+
import 'node:util';
|
|
28
30
|
import './chunks/index2.mjs';
|
|
29
31
|
import 'node:process';
|
|
30
32
|
import './shared/ccjk.BAGoDD49.mjs';
|
|
@@ -1038,717 +1040,6 @@ const userSkillsApi = {
|
|
|
1038
1040
|
sortByLastUsed
|
|
1039
1041
|
};
|
|
1040
1042
|
|
|
1041
|
-
const execAsync = promisify(exec);
|
|
1042
|
-
class BaseCodeTool {
|
|
1043
|
-
config;
|
|
1044
|
-
configPath;
|
|
1045
|
-
constructor(initialConfig) {
|
|
1046
|
-
this.config = {
|
|
1047
|
-
name: this.getMetadata().name,
|
|
1048
|
-
...initialConfig
|
|
1049
|
-
};
|
|
1050
|
-
this.configPath = this.getDefaultConfigPath();
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* Get the default configuration path for this tool
|
|
1054
|
-
*/
|
|
1055
|
-
getDefaultConfigPath() {
|
|
1056
|
-
const homeDir = os.homedir();
|
|
1057
|
-
const configDir = path.join(homeDir, ".ccjk", "tools");
|
|
1058
|
-
return path.join(configDir, `${this.getMetadata().name}.json`);
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* Check if the tool is installed
|
|
1062
|
-
*/
|
|
1063
|
-
async isInstalled() {
|
|
1064
|
-
try {
|
|
1065
|
-
const command = this.getInstallCheckCommand();
|
|
1066
|
-
const { stdout, stderr } = await execAsync(command);
|
|
1067
|
-
const version = this.parseVersion(stdout || stderr);
|
|
1068
|
-
return {
|
|
1069
|
-
installed: true,
|
|
1070
|
-
version,
|
|
1071
|
-
path: await this.findToolPath()
|
|
1072
|
-
};
|
|
1073
|
-
} catch (error) {
|
|
1074
|
-
return {
|
|
1075
|
-
installed: false,
|
|
1076
|
-
error: error instanceof Error ? error.message : "Unknown error"
|
|
1077
|
-
};
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
/**
|
|
1081
|
-
* Install the tool
|
|
1082
|
-
*/
|
|
1083
|
-
async install() {
|
|
1084
|
-
try {
|
|
1085
|
-
const command = this.getInstallCommand();
|
|
1086
|
-
const { stdout, stderr } = await execAsync(command);
|
|
1087
|
-
return {
|
|
1088
|
-
success: true,
|
|
1089
|
-
output: stdout || stderr,
|
|
1090
|
-
exitCode: 0
|
|
1091
|
-
};
|
|
1092
|
-
} catch (error) {
|
|
1093
|
-
return {
|
|
1094
|
-
success: false,
|
|
1095
|
-
error: error instanceof Error ? error.message : "Installation failed",
|
|
1096
|
-
exitCode: 1
|
|
1097
|
-
};
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
/**
|
|
1101
|
-
* Uninstall the tool
|
|
1102
|
-
*/
|
|
1103
|
-
async uninstall() {
|
|
1104
|
-
try {
|
|
1105
|
-
const command = this.getUninstallCommand();
|
|
1106
|
-
const { stdout, stderr } = await execAsync(command);
|
|
1107
|
-
await this.removeConfigFile();
|
|
1108
|
-
return {
|
|
1109
|
-
success: true,
|
|
1110
|
-
output: stdout || stderr,
|
|
1111
|
-
exitCode: 0
|
|
1112
|
-
};
|
|
1113
|
-
} catch (error) {
|
|
1114
|
-
return {
|
|
1115
|
-
success: false,
|
|
1116
|
-
error: error instanceof Error ? error.message : "Uninstallation failed",
|
|
1117
|
-
exitCode: 1
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* Get current configuration
|
|
1123
|
-
*/
|
|
1124
|
-
async getConfig() {
|
|
1125
|
-
try {
|
|
1126
|
-
await this.loadConfig();
|
|
1127
|
-
return { ...this.config };
|
|
1128
|
-
} catch (_error) {
|
|
1129
|
-
return { ...this.config };
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
/**
|
|
1133
|
-
* Update configuration
|
|
1134
|
-
*/
|
|
1135
|
-
async updateConfig(updates) {
|
|
1136
|
-
this.config = {
|
|
1137
|
-
...this.config,
|
|
1138
|
-
...updates
|
|
1139
|
-
};
|
|
1140
|
-
await this.saveConfig();
|
|
1141
|
-
}
|
|
1142
|
-
/**
|
|
1143
|
-
* Configure the tool with full config
|
|
1144
|
-
*/
|
|
1145
|
-
async configure(config) {
|
|
1146
|
-
const isValid = await this.validateConfig(config);
|
|
1147
|
-
if (!isValid) {
|
|
1148
|
-
throw new Error("Invalid configuration");
|
|
1149
|
-
}
|
|
1150
|
-
this.config = { ...config };
|
|
1151
|
-
await this.saveConfig();
|
|
1152
|
-
}
|
|
1153
|
-
/**
|
|
1154
|
-
* Validate configuration
|
|
1155
|
-
*/
|
|
1156
|
-
async validateConfig(config) {
|
|
1157
|
-
if (!config.name) {
|
|
1158
|
-
return false;
|
|
1159
|
-
}
|
|
1160
|
-
return true;
|
|
1161
|
-
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Execute a command with the tool
|
|
1164
|
-
*/
|
|
1165
|
-
async execute(command, args = []) {
|
|
1166
|
-
try {
|
|
1167
|
-
const fullCommand = this.buildCommand(command, args);
|
|
1168
|
-
const { stdout, stderr } = await execAsync(fullCommand, {
|
|
1169
|
-
env: { ...process.env, ...this.config.env }
|
|
1170
|
-
});
|
|
1171
|
-
return {
|
|
1172
|
-
success: true,
|
|
1173
|
-
output: stdout || stderr,
|
|
1174
|
-
exitCode: 0
|
|
1175
|
-
};
|
|
1176
|
-
} catch (error) {
|
|
1177
|
-
return {
|
|
1178
|
-
success: false,
|
|
1179
|
-
error: error.message || "Execution failed",
|
|
1180
|
-
exitCode: error.code || 1
|
|
1181
|
-
};
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
/**
|
|
1185
|
-
* Get tool version
|
|
1186
|
-
*/
|
|
1187
|
-
async getVersion() {
|
|
1188
|
-
const status = await this.isInstalled();
|
|
1189
|
-
return status.version;
|
|
1190
|
-
}
|
|
1191
|
-
/**
|
|
1192
|
-
* Reset tool to default configuration
|
|
1193
|
-
*/
|
|
1194
|
-
async reset() {
|
|
1195
|
-
this.config = {
|
|
1196
|
-
name: this.getMetadata().name
|
|
1197
|
-
};
|
|
1198
|
-
await this.removeConfigFile();
|
|
1199
|
-
}
|
|
1200
|
-
/**
|
|
1201
|
-
* Load configuration from file
|
|
1202
|
-
*/
|
|
1203
|
-
async loadConfig() {
|
|
1204
|
-
try {
|
|
1205
|
-
const data = await promises.readFile(this.configPath, "utf-8");
|
|
1206
|
-
const loadedConfig = JSON.parse(data);
|
|
1207
|
-
this.config = { ...this.config, ...loadedConfig };
|
|
1208
|
-
} catch (_error) {
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
/**
|
|
1212
|
-
* Save configuration to file
|
|
1213
|
-
*/
|
|
1214
|
-
async saveConfig() {
|
|
1215
|
-
try {
|
|
1216
|
-
const configDir = path.dirname(this.configPath);
|
|
1217
|
-
await promises.mkdir(configDir, { recursive: true });
|
|
1218
|
-
await promises.writeFile(this.configPath, JSON.stringify(this.config, null, 2));
|
|
1219
|
-
} catch (error) {
|
|
1220
|
-
throw new Error(`Failed to save configuration: ${error}`);
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
/**
|
|
1224
|
-
* Remove configuration file
|
|
1225
|
-
*/
|
|
1226
|
-
async removeConfigFile() {
|
|
1227
|
-
try {
|
|
1228
|
-
await promises.unlink(this.configPath);
|
|
1229
|
-
} catch (_error) {
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
/**
|
|
1233
|
-
* Build command string from command and arguments
|
|
1234
|
-
*/
|
|
1235
|
-
buildCommand(command, args) {
|
|
1236
|
-
const escapedArgs = args.map((arg) => {
|
|
1237
|
-
return arg.includes(" ") ? `"${arg}"` : arg;
|
|
1238
|
-
});
|
|
1239
|
-
return [command, ...escapedArgs].join(" ");
|
|
1240
|
-
}
|
|
1241
|
-
/**
|
|
1242
|
-
* Parse version from command output
|
|
1243
|
-
*/
|
|
1244
|
-
parseVersion(output) {
|
|
1245
|
-
const patterns = [
|
|
1246
|
-
/version\s+(\d+\.\d+\.\d+)/i,
|
|
1247
|
-
/v?(\d+\.\d+\.\d+)/,
|
|
1248
|
-
/(\d+\.\d+\.\d+)/
|
|
1249
|
-
];
|
|
1250
|
-
for (const pattern of patterns) {
|
|
1251
|
-
const match = output.match(pattern);
|
|
1252
|
-
if (match) {
|
|
1253
|
-
return match[1];
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
return void 0;
|
|
1257
|
-
}
|
|
1258
|
-
/**
|
|
1259
|
-
* Find the tool's installation path
|
|
1260
|
-
*/
|
|
1261
|
-
async findToolPath() {
|
|
1262
|
-
try {
|
|
1263
|
-
const { stdout } = await execAsync(`which ${this.getMetadata().name}`);
|
|
1264
|
-
return stdout.trim();
|
|
1265
|
-
} catch (_error) {
|
|
1266
|
-
return void 0;
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
/**
|
|
1270
|
-
* Create default capabilities object
|
|
1271
|
-
*/
|
|
1272
|
-
createDefaultCapabilities() {
|
|
1273
|
-
return {
|
|
1274
|
-
supportsChat: false,
|
|
1275
|
-
supportsFileEdit: false,
|
|
1276
|
-
supportsCodeGen: false,
|
|
1277
|
-
supportsReview: false,
|
|
1278
|
-
supportsTesting: false,
|
|
1279
|
-
supportsDebugging: false
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
class AiderTool extends BaseCodeTool {
|
|
1285
|
-
getMetadata() {
|
|
1286
|
-
return {
|
|
1287
|
-
name: "aider",
|
|
1288
|
-
displayName: "Aider",
|
|
1289
|
-
description: "AI pair programming in your terminal",
|
|
1290
|
-
version: "1.0.0",
|
|
1291
|
-
homepage: "https://aider.chat",
|
|
1292
|
-
documentation: "https://aider.chat/docs",
|
|
1293
|
-
capabilities: {
|
|
1294
|
-
supportsChat: true,
|
|
1295
|
-
supportsFileEdit: true,
|
|
1296
|
-
supportsCodeGen: true,
|
|
1297
|
-
supportsReview: true,
|
|
1298
|
-
supportsTesting: false,
|
|
1299
|
-
supportsDebugging: true
|
|
1300
|
-
}
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
getInstallCheckCommand() {
|
|
1304
|
-
return "aider --version";
|
|
1305
|
-
}
|
|
1306
|
-
getInstallCommand() {
|
|
1307
|
-
return "pip install aider-chat";
|
|
1308
|
-
}
|
|
1309
|
-
getUninstallCommand() {
|
|
1310
|
-
return "pip uninstall -y aider-chat";
|
|
1311
|
-
}
|
|
1312
|
-
/**
|
|
1313
|
-
* Start a chat session
|
|
1314
|
-
*/
|
|
1315
|
-
async chat(prompt) {
|
|
1316
|
-
return this.execute("aider", ["--message", prompt]);
|
|
1317
|
-
}
|
|
1318
|
-
/**
|
|
1319
|
-
* Continue a chat session
|
|
1320
|
-
*/
|
|
1321
|
-
async continueChat(message) {
|
|
1322
|
-
return this.execute("aider", ["--message", message]);
|
|
1323
|
-
}
|
|
1324
|
-
/**
|
|
1325
|
-
* End chat session
|
|
1326
|
-
*/
|
|
1327
|
-
async endChat() {
|
|
1328
|
-
await this.execute("aider", ["--exit"]);
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
* Edit a file
|
|
1332
|
-
*/
|
|
1333
|
-
async editFile(filePath, instructions) {
|
|
1334
|
-
return this.execute("aider", [filePath, "--message", instructions]);
|
|
1335
|
-
}
|
|
1336
|
-
/**
|
|
1337
|
-
* Edit multiple files
|
|
1338
|
-
*/
|
|
1339
|
-
async editFiles(files, instructions) {
|
|
1340
|
-
return this.execute("aider", [...files, "--message", instructions]);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
class ClaudeCodeTool extends BaseCodeTool {
|
|
1345
|
-
getMetadata() {
|
|
1346
|
-
return {
|
|
1347
|
-
name: "claude-code",
|
|
1348
|
-
displayName: "Claude Code",
|
|
1349
|
-
description: "Anthropic's official CLI tool for Claude AI",
|
|
1350
|
-
version: "1.0.0",
|
|
1351
|
-
homepage: "https://claude.ai",
|
|
1352
|
-
documentation: "https://docs.anthropic.com/claude/docs",
|
|
1353
|
-
capabilities: {
|
|
1354
|
-
supportsChat: true,
|
|
1355
|
-
supportsFileEdit: true,
|
|
1356
|
-
supportsCodeGen: true,
|
|
1357
|
-
supportsReview: true,
|
|
1358
|
-
supportsTesting: true,
|
|
1359
|
-
supportsDebugging: true
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
}
|
|
1363
|
-
getInstallCheckCommand() {
|
|
1364
|
-
return "claude --version";
|
|
1365
|
-
}
|
|
1366
|
-
getInstallCommand() {
|
|
1367
|
-
return "npm install -g @anthropic-ai/claude-code";
|
|
1368
|
-
}
|
|
1369
|
-
getUninstallCommand() {
|
|
1370
|
-
return "npm uninstall -g @anthropic-ai/claude-code";
|
|
1371
|
-
}
|
|
1372
|
-
/**
|
|
1373
|
-
* Start a chat session
|
|
1374
|
-
*/
|
|
1375
|
-
async chat(prompt) {
|
|
1376
|
-
return this.execute("claude", ["chat", prompt]);
|
|
1377
|
-
}
|
|
1378
|
-
/**
|
|
1379
|
-
* Continue a chat session
|
|
1380
|
-
*/
|
|
1381
|
-
async continueChat(message) {
|
|
1382
|
-
return this.execute("claude", ["continue", message]);
|
|
1383
|
-
}
|
|
1384
|
-
/**
|
|
1385
|
-
* End chat session
|
|
1386
|
-
*/
|
|
1387
|
-
async endChat() {
|
|
1388
|
-
await this.execute("claude", ["exit"]);
|
|
1389
|
-
}
|
|
1390
|
-
/**
|
|
1391
|
-
* Edit a file
|
|
1392
|
-
*/
|
|
1393
|
-
async editFile(filePath, instructions) {
|
|
1394
|
-
return this.execute("claude", ["edit", filePath, "--instructions", instructions]);
|
|
1395
|
-
}
|
|
1396
|
-
/**
|
|
1397
|
-
* Edit multiple files
|
|
1398
|
-
*/
|
|
1399
|
-
async editFiles(files, instructions) {
|
|
1400
|
-
const fileArgs = files.flatMap((f) => ["--file", f]);
|
|
1401
|
-
return this.execute("claude", ["edit", ...fileArgs, "--instructions", instructions]);
|
|
1402
|
-
}
|
|
1403
|
-
/**
|
|
1404
|
-
* Generate code
|
|
1405
|
-
*/
|
|
1406
|
-
async generateCode(prompt, outputPath) {
|
|
1407
|
-
const args = ["generate", prompt];
|
|
1408
|
-
if (outputPath) {
|
|
1409
|
-
args.push("--output", outputPath);
|
|
1410
|
-
}
|
|
1411
|
-
return this.execute("claude", args);
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
class ClineTool extends BaseCodeTool {
|
|
1416
|
-
getMetadata() {
|
|
1417
|
-
return {
|
|
1418
|
-
name: "cline",
|
|
1419
|
-
displayName: "Cline",
|
|
1420
|
-
description: "Autonomous coding agent for VS Code",
|
|
1421
|
-
version: "1.0.0",
|
|
1422
|
-
homepage: "https://github.com/cline/cline",
|
|
1423
|
-
documentation: "https://github.com/cline/cline/wiki",
|
|
1424
|
-
capabilities: {
|
|
1425
|
-
supportsChat: true,
|
|
1426
|
-
supportsFileEdit: true,
|
|
1427
|
-
supportsCodeGen: true,
|
|
1428
|
-
supportsReview: true,
|
|
1429
|
-
supportsTesting: true,
|
|
1430
|
-
supportsDebugging: true
|
|
1431
|
-
}
|
|
1432
|
-
};
|
|
1433
|
-
}
|
|
1434
|
-
getInstallCheckCommand() {
|
|
1435
|
-
return "cline --version";
|
|
1436
|
-
}
|
|
1437
|
-
getInstallCommand() {
|
|
1438
|
-
return "npm install -g cline";
|
|
1439
|
-
}
|
|
1440
|
-
getUninstallCommand() {
|
|
1441
|
-
return "npm uninstall -g cline";
|
|
1442
|
-
}
|
|
1443
|
-
/**
|
|
1444
|
-
* Start a chat session
|
|
1445
|
-
*/
|
|
1446
|
-
async chat(prompt) {
|
|
1447
|
-
return this.execute("cline", ["chat", prompt]);
|
|
1448
|
-
}
|
|
1449
|
-
/**
|
|
1450
|
-
* Continue a chat session
|
|
1451
|
-
*/
|
|
1452
|
-
async continueChat(message) {
|
|
1453
|
-
return this.execute("cline", ["continue", message]);
|
|
1454
|
-
}
|
|
1455
|
-
/**
|
|
1456
|
-
* End chat session
|
|
1457
|
-
*/
|
|
1458
|
-
async endChat() {
|
|
1459
|
-
await this.execute("cline", ["exit"]);
|
|
1460
|
-
}
|
|
1461
|
-
/**
|
|
1462
|
-
* Edit a file
|
|
1463
|
-
*/
|
|
1464
|
-
async editFile(filePath, instructions) {
|
|
1465
|
-
return this.execute("cline", ["edit", filePath, "--instructions", instructions]);
|
|
1466
|
-
}
|
|
1467
|
-
/**
|
|
1468
|
-
* Edit multiple files
|
|
1469
|
-
*/
|
|
1470
|
-
async editFiles(files, instructions) {
|
|
1471
|
-
const fileArgs = files.flatMap((f) => ["--file", f]);
|
|
1472
|
-
return this.execute("cline", ["edit", ...fileArgs, "--instructions", instructions]);
|
|
1473
|
-
}
|
|
1474
|
-
/**
|
|
1475
|
-
* Generate code
|
|
1476
|
-
*/
|
|
1477
|
-
async generateCode(prompt, outputPath) {
|
|
1478
|
-
const args = ["generate", prompt];
|
|
1479
|
-
if (outputPath) {
|
|
1480
|
-
args.push("--output", outputPath);
|
|
1481
|
-
}
|
|
1482
|
-
return this.execute("cline", args);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
class CodexTool extends BaseCodeTool {
|
|
1487
|
-
getMetadata() {
|
|
1488
|
-
return {
|
|
1489
|
-
name: "codex",
|
|
1490
|
-
displayName: "OpenAI Codex",
|
|
1491
|
-
description: "OpenAI's code generation model",
|
|
1492
|
-
version: "1.0.0",
|
|
1493
|
-
homepage: "https://openai.com/codex",
|
|
1494
|
-
documentation: "https://platform.openai.com/docs",
|
|
1495
|
-
capabilities: {
|
|
1496
|
-
supportsChat: true,
|
|
1497
|
-
supportsFileEdit: false,
|
|
1498
|
-
supportsCodeGen: true,
|
|
1499
|
-
supportsReview: false,
|
|
1500
|
-
supportsTesting: false,
|
|
1501
|
-
supportsDebugging: false
|
|
1502
|
-
}
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
getInstallCheckCommand() {
|
|
1506
|
-
return "codex --version";
|
|
1507
|
-
}
|
|
1508
|
-
getInstallCommand() {
|
|
1509
|
-
return "pip install openai-codex";
|
|
1510
|
-
}
|
|
1511
|
-
getUninstallCommand() {
|
|
1512
|
-
return "pip uninstall -y openai-codex";
|
|
1513
|
-
}
|
|
1514
|
-
/**
|
|
1515
|
-
* Generate code
|
|
1516
|
-
*/
|
|
1517
|
-
async generateCode(prompt, outputPath) {
|
|
1518
|
-
const args = ["generate", prompt];
|
|
1519
|
-
if (outputPath) {
|
|
1520
|
-
args.push("--output", outputPath);
|
|
1521
|
-
}
|
|
1522
|
-
return this.execute("codex", args);
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
class ContinueTool extends BaseCodeTool {
|
|
1527
|
-
getMetadata() {
|
|
1528
|
-
return {
|
|
1529
|
-
name: "continue",
|
|
1530
|
-
displayName: "Continue",
|
|
1531
|
-
description: "Open-source autopilot for software development",
|
|
1532
|
-
version: "1.0.0",
|
|
1533
|
-
homepage: "https://continue.dev",
|
|
1534
|
-
documentation: "https://continue.dev/docs",
|
|
1535
|
-
capabilities: {
|
|
1536
|
-
supportsChat: true,
|
|
1537
|
-
supportsFileEdit: true,
|
|
1538
|
-
supportsCodeGen: true,
|
|
1539
|
-
supportsReview: true,
|
|
1540
|
-
supportsTesting: true,
|
|
1541
|
-
supportsDebugging: true
|
|
1542
|
-
}
|
|
1543
|
-
};
|
|
1544
|
-
}
|
|
1545
|
-
getInstallCheckCommand() {
|
|
1546
|
-
return "continue --version";
|
|
1547
|
-
}
|
|
1548
|
-
getInstallCommand() {
|
|
1549
|
-
return "npm install -g continue";
|
|
1550
|
-
}
|
|
1551
|
-
getUninstallCommand() {
|
|
1552
|
-
return "npm uninstall -g continue";
|
|
1553
|
-
}
|
|
1554
|
-
/**
|
|
1555
|
-
* Start a chat session
|
|
1556
|
-
*/
|
|
1557
|
-
async chat(prompt) {
|
|
1558
|
-
return this.execute("continue", ["chat", prompt]);
|
|
1559
|
-
}
|
|
1560
|
-
/**
|
|
1561
|
-
* Continue a chat session
|
|
1562
|
-
*/
|
|
1563
|
-
async continueChat(message) {
|
|
1564
|
-
return this.execute("continue", ["chat", message]);
|
|
1565
|
-
}
|
|
1566
|
-
/**
|
|
1567
|
-
* End chat session
|
|
1568
|
-
*/
|
|
1569
|
-
async endChat() {
|
|
1570
|
-
await this.execute("continue", ["exit"]);
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* Generate code
|
|
1574
|
-
*/
|
|
1575
|
-
async generateCode(prompt, outputPath) {
|
|
1576
|
-
const args = ["generate", prompt];
|
|
1577
|
-
if (outputPath) {
|
|
1578
|
-
args.push("--output", outputPath);
|
|
1579
|
-
}
|
|
1580
|
-
return this.execute("continue", args);
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
class CursorTool extends BaseCodeTool {
|
|
1585
|
-
getMetadata() {
|
|
1586
|
-
return {
|
|
1587
|
-
name: "cursor",
|
|
1588
|
-
displayName: "Cursor",
|
|
1589
|
-
description: "AI-first code editor",
|
|
1590
|
-
version: "1.0.0",
|
|
1591
|
-
homepage: "https://cursor.sh",
|
|
1592
|
-
documentation: "https://cursor.sh/docs",
|
|
1593
|
-
capabilities: {
|
|
1594
|
-
supportsChat: true,
|
|
1595
|
-
supportsFileEdit: true,
|
|
1596
|
-
supportsCodeGen: true,
|
|
1597
|
-
supportsReview: true,
|
|
1598
|
-
supportsTesting: true,
|
|
1599
|
-
supportsDebugging: true
|
|
1600
|
-
}
|
|
1601
|
-
};
|
|
1602
|
-
}
|
|
1603
|
-
getInstallCheckCommand() {
|
|
1604
|
-
return "cursor --version";
|
|
1605
|
-
}
|
|
1606
|
-
getInstallCommand() {
|
|
1607
|
-
return 'echo "Please download Cursor from https://cursor.sh"';
|
|
1608
|
-
}
|
|
1609
|
-
getUninstallCommand() {
|
|
1610
|
-
return 'echo "Please uninstall Cursor manually"';
|
|
1611
|
-
}
|
|
1612
|
-
/**
|
|
1613
|
-
* Start a chat session
|
|
1614
|
-
*/
|
|
1615
|
-
async chat(prompt) {
|
|
1616
|
-
return this.execute("cursor", ["chat", prompt]);
|
|
1617
|
-
}
|
|
1618
|
-
/**
|
|
1619
|
-
* Continue a chat session
|
|
1620
|
-
*/
|
|
1621
|
-
async continueChat(message) {
|
|
1622
|
-
return this.execute("cursor", ["chat", message]);
|
|
1623
|
-
}
|
|
1624
|
-
/**
|
|
1625
|
-
* End chat session
|
|
1626
|
-
*/
|
|
1627
|
-
async endChat() {
|
|
1628
|
-
await this.execute("cursor", ["exit"]);
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* Edit a file
|
|
1632
|
-
*/
|
|
1633
|
-
async editFile(filePath, instructions) {
|
|
1634
|
-
return this.execute("cursor", ["edit", filePath, "--instructions", instructions]);
|
|
1635
|
-
}
|
|
1636
|
-
/**
|
|
1637
|
-
* Edit multiple files
|
|
1638
|
-
*/
|
|
1639
|
-
async editFiles(files, instructions) {
|
|
1640
|
-
const fileArgs = files.flatMap((f) => ["--file", f]);
|
|
1641
|
-
return this.execute("cursor", ["edit", ...fileArgs, "--instructions", instructions]);
|
|
1642
|
-
}
|
|
1643
|
-
/**
|
|
1644
|
-
* Generate code
|
|
1645
|
-
*/
|
|
1646
|
-
async generateCode(prompt, outputPath) {
|
|
1647
|
-
const args = ["generate", prompt];
|
|
1648
|
-
if (outputPath) {
|
|
1649
|
-
args.push("--output", outputPath);
|
|
1650
|
-
}
|
|
1651
|
-
return this.execute("cursor", args);
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
class ToolRegistry {
|
|
1656
|
-
static instance;
|
|
1657
|
-
tools;
|
|
1658
|
-
toolClasses;
|
|
1659
|
-
constructor() {
|
|
1660
|
-
this.tools = /* @__PURE__ */ new Map();
|
|
1661
|
-
this.toolClasses = /* @__PURE__ */ new Map();
|
|
1662
|
-
}
|
|
1663
|
-
/**
|
|
1664
|
-
* Get singleton instance
|
|
1665
|
-
*/
|
|
1666
|
-
static getInstance() {
|
|
1667
|
-
if (!ToolRegistry.instance) {
|
|
1668
|
-
ToolRegistry.instance = new ToolRegistry();
|
|
1669
|
-
}
|
|
1670
|
-
return ToolRegistry.instance;
|
|
1671
|
-
}
|
|
1672
|
-
/**
|
|
1673
|
-
* Register a tool class
|
|
1674
|
-
*/
|
|
1675
|
-
registerToolClass(name, toolClass) {
|
|
1676
|
-
this.toolClasses.set(name.toLowerCase(), toolClass);
|
|
1677
|
-
}
|
|
1678
|
-
/**
|
|
1679
|
-
* Register a tool instance
|
|
1680
|
-
*/
|
|
1681
|
-
registerTool(tool) {
|
|
1682
|
-
const metadata = tool.getMetadata();
|
|
1683
|
-
this.tools.set(metadata.name.toLowerCase(), tool);
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* Get a tool instance by name
|
|
1687
|
-
*/
|
|
1688
|
-
getTool(name) {
|
|
1689
|
-
const normalizedName = name.toLowerCase();
|
|
1690
|
-
if (this.tools.has(normalizedName)) {
|
|
1691
|
-
return this.tools.get(normalizedName);
|
|
1692
|
-
}
|
|
1693
|
-
const ToolClass = this.toolClasses.get(normalizedName);
|
|
1694
|
-
if (ToolClass) {
|
|
1695
|
-
const tool = new ToolClass();
|
|
1696
|
-
this.tools.set(normalizedName, tool);
|
|
1697
|
-
return tool;
|
|
1698
|
-
}
|
|
1699
|
-
return void 0;
|
|
1700
|
-
}
|
|
1701
|
-
/**
|
|
1702
|
-
* Get all registered tool names
|
|
1703
|
-
*/
|
|
1704
|
-
getToolNames() {
|
|
1705
|
-
return Array.from(this.toolClasses.keys());
|
|
1706
|
-
}
|
|
1707
|
-
/**
|
|
1708
|
-
* Get all tool instances
|
|
1709
|
-
*/
|
|
1710
|
-
getAllTools() {
|
|
1711
|
-
return Array.from(this.tools.values());
|
|
1712
|
-
}
|
|
1713
|
-
/**
|
|
1714
|
-
* Check if a tool is registered
|
|
1715
|
-
*/
|
|
1716
|
-
hasTool(name) {
|
|
1717
|
-
return this.toolClasses.has(name.toLowerCase());
|
|
1718
|
-
}
|
|
1719
|
-
/**
|
|
1720
|
-
* Unregister a tool
|
|
1721
|
-
*/
|
|
1722
|
-
unregisterTool(name) {
|
|
1723
|
-
const normalizedName = name.toLowerCase();
|
|
1724
|
-
this.tools.delete(normalizedName);
|
|
1725
|
-
this.toolClasses.delete(normalizedName);
|
|
1726
|
-
}
|
|
1727
|
-
/**
|
|
1728
|
-
* Clear all registered tools
|
|
1729
|
-
*/
|
|
1730
|
-
clear() {
|
|
1731
|
-
this.tools.clear();
|
|
1732
|
-
this.toolClasses.clear();
|
|
1733
|
-
}
|
|
1734
|
-
/**
|
|
1735
|
-
* Get metadata for all registered tools
|
|
1736
|
-
*/
|
|
1737
|
-
async getAllMetadata() {
|
|
1738
|
-
const metadata = [];
|
|
1739
|
-
for (const name of this.toolClasses.keys()) {
|
|
1740
|
-
const tool = this.getTool(name);
|
|
1741
|
-
if (tool) {
|
|
1742
|
-
metadata.push(tool.getMetadata());
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
return metadata;
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
function getRegistry() {
|
|
1749
|
-
return ToolRegistry.getInstance();
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
1043
|
class ToolFactory {
|
|
1753
1044
|
registry;
|
|
1754
1045
|
constructor(registry) {
|
|
@@ -4437,4 +3728,4 @@ function assert(condition, message) {
|
|
|
4437
3728
|
}
|
|
4438
3729
|
}
|
|
4439
3730
|
|
|
4440
|
-
export {
|
|
3731
|
+
export { BaseError, ConfigManager, ConfigValidator, ConfigurationError, InternalError, Logger, Mutex, NotFoundError, RatingsApiError, RatingsApiErrorCode, Semaphore, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, index$6 as array, assert, assertDefined, index$5 as async, batchProcessFiles, camelCase, canInstallMore, capitalize, chunk, index$4 as command, commandExists, convertBatchTemplateResponse, convertConfig, convertParameterDefault, convertProjectAnalysisResponse, convertRecommendation, convertTemplate, convertTemplateParameter, copyFile, countLines, createCloudClient, createConfigManager, createLogger, createRating, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, extractString, flatten, flatten$1 as flattenArray, formatError, index$2 as fs, generateCompactWelcome, generateRecommendations, generateWelcome, get, getArchitecture, getCacheDir, getCapabilitiesByType, getCapability, getCloudMcpRecommendations, getCloudRecommendations, getCloudSkillRecommendations, getCommandPath, getCommandVersion, getConfigDir, getDataDir, getDisabledSkills, getEnabledSkills, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getQuotaUsagePercentage, getRecommendations, getSkillRatings, getTempDir, getUserQuota, getUserSkills, has, installSkill, intersection, isArray, isBoolean, isDefined, isDirectory, isDuplicateRatingError, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isRecommendationConfig, isSkillInstalled, isSkillNotFoundError, isString, isTelemetryEventData, isTemplateParameterValue, isURL, isUnauthorizedError, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, moveFile, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, processLargeFile, processLineByLine, ratingsApi, readFile, readJSON, retry, scanCapabilities, sequence, set, shuffle, skillsMarketplaceApi, sleep, slugify, snakeCase, sortByLastUsed, sortByUsage, streamJSON, streamWriteJSON, index as string, template, throttle, timeout, truncate, tryCatch, tryCatchAsync, unflatten, uninstallSkill, union, unique, updateSkill, userSkillsApi, validateBatchTemplateRequest, validateProjectAnalysisRequest, validateUsageReport, validation, validators, waitFor, wrapError, writeFile, writeJSON };
|