@vortex-ai/cli 0.1.45 → 0.1.55
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/.turbo/turbo-build.log +5 -5
- package/README.md +7 -2
- package/dist/index.js +14193 -1484
- package/dist/index.mjs +14189 -1480
- package/package.json +1 -1
- package/src/commands/cache.ts +2 -2
- package/src/commands/config.ts +4 -2
- package/src/commands/init.ts +33 -18
- package/src/commands/review.ts +36 -51
- package/src/commands/search.ts +19 -7
- package/src/commands/solve-issue.ts +2 -1
- package/src/commands/solve.ts +152 -49
- package/src/index.ts +27 -51
- package/.vortex-bm25.json +0 -1
- package/.vortex.db +0 -0
- package/src/commands/analyze.ts +0 -74
- package/src/commands/fix-nitbits.ts +0 -63
- package/src/commands/suggest.ts +0 -54
package/.vortex.db
DELETED
|
Binary file
|
package/src/commands/analyze.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { IntelligenceAgent } from "@vortex/engine";
|
|
2
|
-
import { createGithubClient } from "@vortex/github";
|
|
3
|
-
import { getGithubRepoInfo } from "@vortex/git";
|
|
4
|
-
|
|
5
|
-
export async function analyzeCommand(options: {
|
|
6
|
-
pr: number;
|
|
7
|
-
deep?: boolean;
|
|
8
|
-
}) {
|
|
9
|
-
const { default: ora } = await import("ora");
|
|
10
|
-
const { default: chalk } = await import("chalk");
|
|
11
|
-
const { default: boxen } = await import("boxen");
|
|
12
|
-
const { marked } = await import("marked");
|
|
13
|
-
const { default: TerminalRenderer } = await import("marked-terminal");
|
|
14
|
-
|
|
15
|
-
marked.setOptions({
|
|
16
|
-
renderer: new TerminalRenderer() as any,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
console.log(
|
|
20
|
-
chalk.blue.bold(`\nAnalyzing External PR #${options.pr}\n`)
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
if (!process.env.GITHUB_TOKEN) {
|
|
24
|
-
console.error(
|
|
25
|
-
chalk.red("Please set GITHUB_TOKEN environment variable.")
|
|
26
|
-
);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const repoInfo = getGithubRepoInfo(process.cwd());
|
|
31
|
-
const owner = process.env.GITHUB_OWNER || repoInfo?.owner;
|
|
32
|
-
const repo = process.env.GITHUB_REPO || repoInfo?.repo;
|
|
33
|
-
|
|
34
|
-
if (!owner || !repo) {
|
|
35
|
-
console.error(
|
|
36
|
-
chalk.red(
|
|
37
|
-
"Could not determine GitHub repository. Please run this command inside a git repository or set GITHUB_OWNER and GITHUB_REPO."
|
|
38
|
-
)
|
|
39
|
-
);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const spinner = ora(
|
|
44
|
-
`Fetching diff for ${owner}/${repo}#${options.pr}...`
|
|
45
|
-
).start();
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
const github = createGithubClient(process.env.GITHUB_TOKEN);
|
|
49
|
-
const diff = await github.fetchPullRequestDiff(owner, repo, options.pr);
|
|
50
|
-
|
|
51
|
-
spinner.text = "Generating AI analysis...";
|
|
52
|
-
|
|
53
|
-
const agent = new IntelligenceAgent();
|
|
54
|
-
const review = await agent.generateReview(diff);
|
|
55
|
-
|
|
56
|
-
spinner.succeed(chalk.green("Analysis complete!\n"));
|
|
57
|
-
|
|
58
|
-
const parsedReview = await marked.parse(review);
|
|
59
|
-
|
|
60
|
-
const formatted = boxen(parsedReview.trim(), {
|
|
61
|
-
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
|
62
|
-
margin: { top: 1, bottom: 1 },
|
|
63
|
-
borderStyle: "double",
|
|
64
|
-
borderColor: "magenta",
|
|
65
|
-
title: chalk.magenta.bold(" External PR Analysis "),
|
|
66
|
-
titleAlignment: "center",
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
console.log(formatted);
|
|
70
|
-
} catch (err) {
|
|
71
|
-
spinner.fail(chalk.red("Failed to analyze PR"));
|
|
72
|
-
console.error(err);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { IntelligenceAgent } from "@vortex/engine";
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
|
|
4
|
-
export async function fixNitbitsCommand(options: {
|
|
5
|
-
safe?: boolean;
|
|
6
|
-
dryRun?: boolean;
|
|
7
|
-
files?: string;
|
|
8
|
-
}) {
|
|
9
|
-
const { default: ora } = await import("ora");
|
|
10
|
-
const { default: chalk } = await import("chalk");
|
|
11
|
-
|
|
12
|
-
console.log(chalk.blue.bold("\nFixing Repository Nitbits\n"));
|
|
13
|
-
|
|
14
|
-
if (!options.files) {
|
|
15
|
-
console.error(
|
|
16
|
-
chalk.red("Please provide --files to fix (comma-separated list).")
|
|
17
|
-
);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const files = options.files.split(",").map((file: string) => file.trim());
|
|
22
|
-
const agent = new IntelligenceAgent();
|
|
23
|
-
|
|
24
|
-
let fixedCount = 0;
|
|
25
|
-
let failedCount = 0;
|
|
26
|
-
|
|
27
|
-
for (const file of files) {
|
|
28
|
-
if (!fs.existsSync(file)) {
|
|
29
|
-
console.warn(chalk.yellow(`⚠️ File not found: ${file}`));
|
|
30
|
-
failedCount++;
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const spinner = ora(`Auto-fixing ${file}...`).start();
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
const content = fs.readFileSync(file, "utf8");
|
|
38
|
-
const fixedContent = await agent.autoFix(content);
|
|
39
|
-
|
|
40
|
-
if (options.dryRun) {
|
|
41
|
-
spinner.succeed(chalk.cyan(`[DRY RUN] ${file}`));
|
|
42
|
-
console.log(chalk.gray(`\n--- FIXED OUTPUT ---\n`));
|
|
43
|
-
console.log(fixedContent);
|
|
44
|
-
console.log(chalk.gray(`\n--- END ---\n`));
|
|
45
|
-
} else {
|
|
46
|
-
fs.writeFileSync(file, fixedContent, "utf8");
|
|
47
|
-
spinner.succeed(chalk.green(`Fixed and saved ${file}`));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
fixedCount++;
|
|
51
|
-
} catch (err) {
|
|
52
|
-
spinner.fail(chalk.red(`Failed to fix ${file}`));
|
|
53
|
-
console.error(err);
|
|
54
|
-
failedCount++;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
console.log(
|
|
59
|
-
chalk.dim(
|
|
60
|
-
`\n Summary: ${fixedCount} fixed, ${failedCount} failed out of ${files.length} files\n`
|
|
61
|
-
)
|
|
62
|
-
);
|
|
63
|
-
}
|
package/src/commands/suggest.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IntelligenceAgent } from "@vortex/engine";
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
|
|
4
|
-
export async function suggestCommand(options: {
|
|
5
|
-
file: string;
|
|
6
|
-
apply?: boolean;
|
|
7
|
-
deep?: boolean;
|
|
8
|
-
}) {
|
|
9
|
-
const { default: ora } = await import("ora");
|
|
10
|
-
const { default: chalk } = await import("chalk");
|
|
11
|
-
const { default: boxen } = await import("boxen");
|
|
12
|
-
const { marked } = await import("marked");
|
|
13
|
-
const { default: TerminalRenderer } = await import("marked-terminal");
|
|
14
|
-
|
|
15
|
-
marked.setOptions({
|
|
16
|
-
renderer: new TerminalRenderer() as any,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
console.log(
|
|
20
|
-
chalk.blue.bold(`\nGenerating Suggestions for: ${options.file}\n`)
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
if (!fs.existsSync(options.file)) {
|
|
24
|
-
console.error(chalk.red(`File not found: ${options.file}`));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const spinner = ora("Analyzing file...").start();
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
const content = fs.readFileSync(options.file, "utf8");
|
|
32
|
-
const agent = new IntelligenceAgent();
|
|
33
|
-
|
|
34
|
-
const suggestions = await agent.generateSuggestions(content);
|
|
35
|
-
|
|
36
|
-
spinner.succeed(chalk.green("Analysis complete!\n"));
|
|
37
|
-
|
|
38
|
-
const parsedSuggestions = await marked.parse(suggestions);
|
|
39
|
-
|
|
40
|
-
const formatted = boxen(parsedSuggestions.trim(), {
|
|
41
|
-
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
|
42
|
-
margin: { top: 1, bottom: 1 },
|
|
43
|
-
borderStyle: "double",
|
|
44
|
-
borderColor: "cyan",
|
|
45
|
-
title: chalk.cyan.bold(" AI Code Suggestions "),
|
|
46
|
-
titleAlignment: "center",
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
console.log(formatted);
|
|
50
|
-
} catch (err) {
|
|
51
|
-
spinner.fail(chalk.red("Failed to generate suggestions"));
|
|
52
|
-
console.error(err);
|
|
53
|
-
}
|
|
54
|
-
}
|