arcana-ai 0.1.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 +22 -0
- package/bin/arcana.js +94 -0
- package/package.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# arcana
|
|
2
|
+
|
|
3
|
+
Self-improving AI agent CLI — opencode TUI + skills.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx arcana-ai
|
|
7
|
+
npm install -g arcana-ai
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Requires **Bun** runtime. Install from https://bun.sh.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
|
|
14
|
+
- opencode TUI with arcana theme (gold+violet, sigil dialogs)
|
|
15
|
+
- 174 skills across 28 categories
|
|
16
|
+
- CLI subcommands: run, skills, memory, cron, gateway, config, theme, learn, doctor
|
|
17
|
+
|
|
18
|
+
## Update
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx arcana-ai@latest
|
|
22
|
+
```
|
package/bin/arcana.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// arcana launcher — downloads the opencode binary from GitHub releases if needed, then runs it.
|
|
3
|
+
// This is the entrypoint for: npx arcana-ai
|
|
4
|
+
const { spawnSync, execSync } = require("child_process")
|
|
5
|
+
const { existsSync, mkdirSync, chmodSync, writeFileSync, unlinkSync } = require("fs")
|
|
6
|
+
const path = require("path")
|
|
7
|
+
const os = require("os")
|
|
8
|
+
|
|
9
|
+
const REPO = "anomalyco/opencode"
|
|
10
|
+
const VERSION = "v1.17.8" // TODO: fetch latest via GitHub API
|
|
11
|
+
|
|
12
|
+
const PLATFORM_MAP = {
|
|
13
|
+
"win32-x64": { name: "opencode-windows-x64.zip", binary: "opencode.exe" },
|
|
14
|
+
"win32-arm64": { name: "opencode-windows-arm64.zip", binary: "opencode.exe" },
|
|
15
|
+
"linux-x64": { name: "opencode-linux-x64.tar.gz", binary: "opencode" },
|
|
16
|
+
"linux-arm64": { name: "opencode-linux-arm64.tar.gz", binary: "opencode" },
|
|
17
|
+
"darwin-x64": { name: "opencode-darwin-x64.zip", binary: "opencode" },
|
|
18
|
+
"darwin-arm64": { name: "opencode-darwin-arm64.zip", binary: "opencode" },
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const platform = `${os.platform()}-${os.arch()}`
|
|
22
|
+
const entry = PLATFORM_MAP[platform]
|
|
23
|
+
|
|
24
|
+
if (!entry) {
|
|
25
|
+
console.error(`arcana: unsupported platform ${platform}`)
|
|
26
|
+
console.error(`arcana: try installing from source: https://github.com/${REPO}`)
|
|
27
|
+
process.exit(1)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const CACHE_DIR = process.env.ARCANA_CACHE || path.join(os.homedir(), ".arcana", "bin")
|
|
31
|
+
const CACHED_BINARY = path.join(CACHE_DIR, entry.binary)
|
|
32
|
+
|
|
33
|
+
async function downloadAndExtract() {
|
|
34
|
+
const url = `https://github.com/${REPO}/releases/download/${VERSION}/${entry.name}`
|
|
35
|
+
console.error(`arcana: downloading ${entry.name}...`)
|
|
36
|
+
|
|
37
|
+
mkdirSync(CACHE_DIR, { recursive: true })
|
|
38
|
+
|
|
39
|
+
// Download via Node.js fetch
|
|
40
|
+
const res = await fetch(url)
|
|
41
|
+
if (!res.ok) {
|
|
42
|
+
console.error(`arcana: download failed: ${res.status} ${res.statusText}`)
|
|
43
|
+
console.error(`arcana: URL: ${url}`)
|
|
44
|
+
process.exit(1)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Write to temp file
|
|
48
|
+
const tmp = path.join(CACHE_DIR, entry.name)
|
|
49
|
+
const buf = Buffer.from(await res.arrayBuffer())
|
|
50
|
+
writeFileSync(tmp, buf)
|
|
51
|
+
|
|
52
|
+
// Extract
|
|
53
|
+
if (entry.name.endsWith(".tar.gz")) {
|
|
54
|
+
execSync(`tar xzf "${tmp}" -C "${CACHE_DIR}"`, { stdio: "pipe" })
|
|
55
|
+
unlinkSync(tmp)
|
|
56
|
+
} else if (entry.name.endsWith(".zip")) {
|
|
57
|
+
const isWin = os.platform() === "win32"
|
|
58
|
+
if (isWin) {
|
|
59
|
+
execSync(`powershell -Command "Expand-Archive -Path '${tmp}' -DestinationPath '${CACHE_DIR}' -Force"`, { stdio: "pipe" })
|
|
60
|
+
} else {
|
|
61
|
+
execSync(`unzip -o "${tmp}" -d "${CACHE_DIR}"`, { stdio: "pipe" })
|
|
62
|
+
}
|
|
63
|
+
unlinkSync(tmp)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Ensure executable
|
|
67
|
+
if (os.platform() !== "win32") {
|
|
68
|
+
try { chmodSync(CACHED_BINARY, 0o755) } catch {}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
console.error(`arcana: installed to ${CACHED_BINARY}`)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function main() {
|
|
75
|
+
// Download if needed
|
|
76
|
+
if (!existsSync(CACHED_BINARY)) {
|
|
77
|
+
await downloadAndExtract()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (!existsSync(CACHED_BINARY)) {
|
|
81
|
+
console.error(`arcana: binary not found after download: ${CACHED_BINARY}`)
|
|
82
|
+
process.exit(1)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Run binary with same args
|
|
86
|
+
const args = process.argv.slice(2)
|
|
87
|
+
const child = spawnSync(CACHED_BINARY, args, { stdio: "inherit" })
|
|
88
|
+
process.exit(child.status ?? 0)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
main().catch((err) => {
|
|
92
|
+
console.error(`arcana: ${err.message}`)
|
|
93
|
+
process.exit(1)
|
|
94
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "arcana-ai",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Self-improving AI agent CLI — opencode TUI + skills. Installs the arcana binary.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"arcana": "./bin/arcana.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/arcana.js",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"repository": "github:Lento47/arcana",
|
|
13
|
+
"homepage": "https://github.com/Lento47/arcana",
|
|
14
|
+
"keywords": ["ai", "agent", "cli", "tui", "opencode", "arcana", "llm", "coding-assistant"],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
}
|
|
19
|
+
}
|