codesavant 3.4.0 → 4.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/README.md +826 -0
- package/dist/cli.js +60649 -31377
- package/package.json +31 -6
- package/scripts/postinstall.cjs +103 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codesavant",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "AI-powered coding
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "AI-powered autonomous coding agent CLI with Claude, GPT-4, and 10+ AI providers. Features autonomous /craft workflows, skill marketplace, self-improving brain, design intelligence, 20+ tools, session management, and beautiful terminal UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"codesavant": "
|
|
8
|
+
"codesavant": "dist/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "bun run src/cli.ts",
|
|
@@ -13,19 +13,28 @@
|
|
|
13
13
|
"test:watch": "bun test --watch",
|
|
14
14
|
"test:coverage": "bun test --coverage",
|
|
15
15
|
"build": "bun build src/cli.ts --outdir=dist --target=bun",
|
|
16
|
+
"prepublishOnly": "bun run build",
|
|
16
17
|
"lint": "bunx @biomejs/biome check src/",
|
|
17
18
|
"format": "bunx @biomejs/biome format --write src/",
|
|
18
|
-
"runbook:verify": "bun scripts/runbook-verify.ts"
|
|
19
|
+
"runbook:verify": "bun scripts/runbook-verify.ts",
|
|
20
|
+
"postinstall": "node scripts/postinstall.cjs"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
23
|
+
"@google-cloud/vertexai": "^1.10.0",
|
|
24
|
+
"chalk": "^5.6.2",
|
|
25
|
+
"commander": "^12.0.0",
|
|
26
|
+
"gray-matter": "^4.0.3",
|
|
21
27
|
"ink": "^5.0.0",
|
|
28
|
+
"octokit": "^5.0.5",
|
|
22
29
|
"react": "^18.2.0",
|
|
23
|
-
"
|
|
30
|
+
"semver": "^7.7.4",
|
|
31
|
+
"simple-git": "^3.30.0",
|
|
24
32
|
"zod": "^3.22.0"
|
|
25
33
|
},
|
|
26
34
|
"devDependencies": {
|
|
27
35
|
"@types/bun": "^1.3.8",
|
|
28
36
|
"@types/react": "^18.2.0",
|
|
37
|
+
"@types/semver": "^7.7.1",
|
|
29
38
|
"ink-testing-library": "^4.0.0",
|
|
30
39
|
"react-devtools-core": "^7.0.1",
|
|
31
40
|
"typescript": "^5.4.0"
|
|
@@ -39,16 +48,32 @@
|
|
|
39
48
|
"keywords": [
|
|
40
49
|
"cli",
|
|
41
50
|
"ai",
|
|
51
|
+
"assistant",
|
|
42
52
|
"coding-assistant",
|
|
43
53
|
"bun",
|
|
44
54
|
"llm",
|
|
45
|
-
"
|
|
55
|
+
"claude",
|
|
56
|
+
"gpt-4",
|
|
57
|
+
"anthropic",
|
|
58
|
+
"openai",
|
|
59
|
+
"developer-tools",
|
|
60
|
+
"terminal",
|
|
61
|
+
"repl",
|
|
62
|
+
"copilot",
|
|
63
|
+
"gemini",
|
|
64
|
+
"groq",
|
|
65
|
+
"deepseek",
|
|
66
|
+
"autonomous-agent",
|
|
67
|
+
"skill-marketplace",
|
|
68
|
+
"design-tokens",
|
|
69
|
+
"tdd"
|
|
46
70
|
],
|
|
47
71
|
"engines": {
|
|
48
72
|
"bun": ">=1.0.0"
|
|
49
73
|
},
|
|
50
74
|
"files": [
|
|
51
75
|
"dist/**/*",
|
|
76
|
+
"scripts/postinstall.cjs",
|
|
52
77
|
"package.json",
|
|
53
78
|
"README.md",
|
|
54
79
|
"LICENSE"
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
const { platform } = require("os");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Check if bun is installed on the system.
|
|
9
|
+
* Accepts any version already installed (no version checking per user decision).
|
|
10
|
+
*
|
|
11
|
+
* @returns {boolean} true if bun is available on PATH
|
|
12
|
+
*/
|
|
13
|
+
function isBunInstalled() {
|
|
14
|
+
try {
|
|
15
|
+
execSync("bun --version", { stdio: "ignore" });
|
|
16
|
+
return true;
|
|
17
|
+
} catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get the platform-specific bun install command.
|
|
24
|
+
*
|
|
25
|
+
* @returns {string} shell command to install bun
|
|
26
|
+
*/
|
|
27
|
+
function getInstallCommand() {
|
|
28
|
+
const os = platform();
|
|
29
|
+
if (os === "win32") {
|
|
30
|
+
return 'powershell -c "irm bun.sh/install.ps1 | iex"';
|
|
31
|
+
}
|
|
32
|
+
return "curl -fsSL https://bun.sh/install | bash";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get human-readable manual install instructions for the current platform.
|
|
37
|
+
* Shown when auto-install fails so the user knows exactly what to run.
|
|
38
|
+
*
|
|
39
|
+
* @returns {string} multi-line manual install instructions
|
|
40
|
+
*/
|
|
41
|
+
function getManualInstructions() {
|
|
42
|
+
const os = platform();
|
|
43
|
+
const lines = ["\n Bun is required but could not be auto-installed.\n"];
|
|
44
|
+
if (os === "darwin") {
|
|
45
|
+
lines.push(" Install manually:");
|
|
46
|
+
lines.push(" brew install oven-sh/bun/bun");
|
|
47
|
+
lines.push(" Or:");
|
|
48
|
+
lines.push(" curl -fsSL https://bun.sh/install | bash\n");
|
|
49
|
+
} else if (os === "win32") {
|
|
50
|
+
lines.push(" Install manually (PowerShell):");
|
|
51
|
+
lines.push(' powershell -c "irm bun.sh/install.ps1 | iex"\n');
|
|
52
|
+
} else {
|
|
53
|
+
lines.push(" Install manually:");
|
|
54
|
+
lines.push(" curl -fsSL https://bun.sh/install | bash\n");
|
|
55
|
+
}
|
|
56
|
+
return lines.join("\n");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Main postinstall entry point.
|
|
61
|
+
* - Silent exit when bun already installed
|
|
62
|
+
* - Single spinner line during install attempt
|
|
63
|
+
* - OS-specific manual instructions on failure
|
|
64
|
+
* - Always exits 0 (never blocks npm install)
|
|
65
|
+
*/
|
|
66
|
+
function main() {
|
|
67
|
+
// Per user decision: accept any version already installed
|
|
68
|
+
if (isBunInstalled()) {
|
|
69
|
+
return; // Silent - bun already present
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Per user decision: minimal progress output - single spinner line
|
|
73
|
+
process.stdout.write("Installing bun runtime... ");
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
execSync(getInstallCommand(), { stdio: "ignore" });
|
|
77
|
+
// Verify installation succeeded
|
|
78
|
+
if (isBunInstalled()) {
|
|
79
|
+
console.log("done");
|
|
80
|
+
} else {
|
|
81
|
+
console.log("failed");
|
|
82
|
+
console.error(getManualInstructions());
|
|
83
|
+
// Exit 0 per research recommendation - don't block npm install
|
|
84
|
+
// Runtime startup will catch missing bun
|
|
85
|
+
}
|
|
86
|
+
} catch (err) {
|
|
87
|
+
console.log("failed");
|
|
88
|
+
// Per user decision: show clear error reason + OS-specific manual install commands
|
|
89
|
+
console.error(
|
|
90
|
+
"\n Auto-install failed: " + (err.message || "unknown error"),
|
|
91
|
+
);
|
|
92
|
+
console.error(getManualInstructions());
|
|
93
|
+
// Exit 0 - don't block npm install. Runtime catches missing bun at startup.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Export for testing
|
|
98
|
+
module.exports = { isBunInstalled, getInstallCommand, getManualInstructions };
|
|
99
|
+
|
|
100
|
+
// Only run main when executed directly (not required/imported)
|
|
101
|
+
if (require.main === module) {
|
|
102
|
+
main();
|
|
103
|
+
}
|