@aicraftalchemy/aca 0.0.3 → 0.0.5
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 -1
- package/install.cjs +46 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/install.cjs
CHANGED
|
@@ -32,6 +32,33 @@ function platformKey() {
|
|
|
32
32
|
throw new Error(`Unsupported platform: ${p}/${a}`)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Write a file, moving any existing (possibly running) file aside first.
|
|
37
|
+
* Windows locks a running executable against deletion/overwrite but allows
|
|
38
|
+
* renaming it, so parking the old file as `<name>.old` lets an in-session
|
|
39
|
+
* auto-update (`npm install -g` triggered while ACA is running) succeed.
|
|
40
|
+
* Stale `.old` files are cleaned up on the next install.
|
|
41
|
+
*/
|
|
42
|
+
function writeReplacing(dest, buf) {
|
|
43
|
+
const old = `${dest}.old`
|
|
44
|
+
try {
|
|
45
|
+
fs.rmSync(old, { force: true })
|
|
46
|
+
} catch {
|
|
47
|
+
// still locked by a previous session — harmless, retried next install
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
if (fs.existsSync(dest)) fs.renameSync(dest, old)
|
|
51
|
+
} catch {
|
|
52
|
+
// rename failed (rare); fall through and let writeFileSync report it
|
|
53
|
+
}
|
|
54
|
+
fs.writeFileSync(dest, buf)
|
|
55
|
+
try {
|
|
56
|
+
fs.rmSync(old, { force: true })
|
|
57
|
+
} catch {
|
|
58
|
+
// the parked file is the currently running binary — cleaned up next time
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
35
62
|
/** GET a URL following redirects; resolves to a Buffer. */
|
|
36
63
|
function get(url, redirects = 0) {
|
|
37
64
|
return new Promise((resolve, reject) => {
|
|
@@ -70,7 +97,7 @@ async function main() {
|
|
|
70
97
|
const binDir = path.join(__dirname, 'bin')
|
|
71
98
|
fs.mkdirSync(binDir, { recursive: true })
|
|
72
99
|
const dest = path.join(binDir, process.platform === 'win32' ? 'aca.exe' : 'aca')
|
|
73
|
-
|
|
100
|
+
writeReplacing(dest, bin)
|
|
74
101
|
if (process.platform !== 'win32') fs.chmodSync(dest, 0o755)
|
|
75
102
|
|
|
76
103
|
// Also fetch the sibling ripgrep binary. `bun build --compile` does not embed
|
|
@@ -85,13 +112,30 @@ async function main() {
|
|
|
85
112
|
throw new Error(`expected ${info.rg.sha256}, got ${rgSha}`)
|
|
86
113
|
}
|
|
87
114
|
const rgDest = path.join(binDir, process.platform === 'win32' ? 'rg.exe' : 'rg')
|
|
88
|
-
|
|
115
|
+
writeReplacing(rgDest, rgBuf)
|
|
89
116
|
if (process.platform !== 'win32') fs.chmodSync(rgDest, 0o755)
|
|
90
117
|
} catch (e) {
|
|
91
118
|
console.warn(`ACA: bundled ripgrep unavailable (${e.message}); search features may be limited.`)
|
|
92
119
|
}
|
|
93
120
|
}
|
|
94
121
|
|
|
122
|
+
// Also fetch the IDE companion extension (.vsix) — platform-independent. The
|
|
123
|
+
// CLI installs it into VS Code / Cursor / Windsurf from this local file, so
|
|
124
|
+
// there is no VS Code Marketplace dependency. Best-effort: a failure here must
|
|
125
|
+
// not block install (in-editor diffs just won't be available).
|
|
126
|
+
if (manifest.extension) {
|
|
127
|
+
try {
|
|
128
|
+
const vsixBuf = await get(`${BASE}/${manifest.extension.file}`)
|
|
129
|
+
const vsixSha = crypto.createHash('sha256').update(vsixBuf).digest('hex')
|
|
130
|
+
if (vsixSha !== manifest.extension.sha256) {
|
|
131
|
+
throw new Error(`expected ${manifest.extension.sha256}, got ${vsixSha}`)
|
|
132
|
+
}
|
|
133
|
+
fs.writeFileSync(path.join(binDir, 'aca.vsix'), vsixBuf)
|
|
134
|
+
} catch (e) {
|
|
135
|
+
console.warn(`ACA: IDE extension unavailable (${e.message}); in-editor diffs may be limited.`)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
95
139
|
console.log(`ACA ${VERSION} installed for ${key}.`)
|
|
96
140
|
}
|
|
97
141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aicraftalchemy/aca",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "ACA — agentic coding CLI. Any model, any provider (Claude, Gemini, OpenAI, NVIDIA, Groq, Cerebras, OpenRouter, Hugging Face). Developed by Aicraftalchemy.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|