arcana-ai 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/bin/arcana.js +21 -24
  2. package/package.json +1 -1
package/bin/arcana.js CHANGED
@@ -56,30 +56,27 @@ async function downloadAndExtract() {
56
56
  writeFileSync(tmp, buf)
57
57
  console.error(`arcana: ${(buf.length / 1e6).toFixed(1)}MB, verifying checksum...`)
58
58
 
59
- // Verify binary checksum against GitHub release .sha256 artifact
60
- const shaUrl = url + ".sha256"
61
- try {
62
- const shaRes = await fetch(shaUrl)
63
- if (!shaRes.ok) {
64
- console.error(`arcana: checksum file not found (${shaUrl}), skipping verification`)
65
- } else {
66
- const shaText = (await shaRes.text()).trim()
67
- const expectedHash = shaText.split(/\s+/)[0]
68
- const actualHash = crypto.createHash("sha256").update(buf).digest("hex")
69
- if (expectedHash !== actualHash) {
70
- console.error(`arcana: CHECKSUM MISMATCH for ${zipName}`)
71
- console.error(` expected: ${expectedHash}`)
72
- console.error(` actual: ${actualHash}`)
73
- console.error(`arcana: binary may be corrupted or tampered — deleting`)
74
- try { unlinkSync(tmp) } catch {}
75
- process.exit(1)
76
- }
77
- console.error(`arcana: checksum OK (SHA256: ${actualHash.slice(0, 16)}...)`)
78
- }
79
- } catch (e) {
80
- console.error(`arcana: checksum verification failed: ${e.message}`)
81
- process.exit(1)
82
- }
59
+ // Verify binary integrity — checksum is mandatory, GitHub generates .sha256 for every asset
60
+ const shaUrl = url + ".sha256"
61
+ const shaRes = await fetch(shaUrl)
62
+ if (!shaRes.ok) {
63
+ console.error(`arcana: FATAL — checksum unavailable (${shaUrl})`)
64
+ console.error(`arcana: the binary cannot be verified and will not be executed`)
65
+ try { unlinkSync(tmp) } catch {}
66
+ process.exit(1)
67
+ }
68
+ const shaText = (await shaRes.text()).trim()
69
+ const expectedHash = shaText.split(/\s+/)[0]
70
+ const actualHash = crypto.createHash("sha256").update(buf).digest("hex")
71
+ if (expectedHash !== actualHash) {
72
+ console.error(`arcana: CHECKSUM MISMATCH for ${zipName}`)
73
+ console.error(` expected: ${expectedHash}`)
74
+ console.error(` actual: ${actualHash}`)
75
+ console.error(`arcana: binary may be corrupted or tampered — deleting`)
76
+ try { unlinkSync(tmp) } catch {}
77
+ process.exit(1)
78
+ }
79
+ console.error(`arcana: checksum OK (SHA256: ${actualHash.slice(0, 16)}...)`)
83
80
 
84
81
  console.error(`arcana: extracting...`)
85
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcana-ai",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Self-improving AI agent CLI — opencode TUI + skills. Installs the arcana binary.",
5
5
  "bin": {
6
6
  "arcana": "./bin/arcana.js"