@code-abyss/cli 0.3.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 +25 -0
- package/bin/abyss.js +26 -0
- package/install.js +85 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @code-abyss/cli
|
|
2
|
+
|
|
3
|
+
**abyss** — the code graph your agent checks before it edits.
|
|
4
|
+
|
|
5
|
+
npm wrapper that downloads the prebuilt `abyss` binary from
|
|
6
|
+
[GitHub Releases](https://github.com/telagod/abyss/releases) on install
|
|
7
|
+
(Node 18+ fetch + system tar, zero npm dependencies).
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install -g @code-abyss/cli
|
|
11
|
+
abyss index # build the code graph (~150ms on a 100-file repo)
|
|
12
|
+
abyss context <file> # callers / dependencies / hotspot before you edit
|
|
13
|
+
abyss mcp # MCP server (8 tools) over stdio
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- Call-graph resolution: 97.2% gated precision vs SCIP ground truth (gin corpus)
|
|
17
|
+
- Languages: Rust, Go, TypeScript, JavaScript, Python, Java, and more
|
|
18
|
+
- Temporal intelligence: hotspot scores and co-change coupling from git history
|
|
19
|
+
- Agent hooks: `abyss hook pre-edit` warns about external callers before edits
|
|
20
|
+
|
|
21
|
+
Full docs, eval methodology, and source: [telagod/abyss](https://github.com/telagod/abyss).
|
|
22
|
+
|
|
23
|
+
Prefer cargo? `cargo binstall code-abyss` or `cargo install code-abyss`.
|
|
24
|
+
|
|
25
|
+
License: Apache-2.0
|
package/bin/abyss.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Shim: forwards to the platform binary downloaded by install.js.
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const { spawnSync, execFileSync } = require("child_process");
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
|
|
9
|
+
const bin = path.join(
|
|
10
|
+
__dirname,
|
|
11
|
+
process.platform === "win32" ? "abyss-bin.exe" : "abyss-bin"
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
if (!fs.existsSync(bin)) {
|
|
15
|
+
// postinstall may have been skipped (--ignore-scripts); fetch lazily.
|
|
16
|
+
try {
|
|
17
|
+
execFileSync(process.execPath, [path.join(__dirname, "..", "install.js")], {
|
|
18
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
19
|
+
});
|
|
20
|
+
} catch {
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const r = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
26
|
+
process.exit(r.status === null ? 1 : r.status);
|
package/install.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Downloads the prebuilt abyss binary for this platform from GitHub Releases.
|
|
3
|
+
// Zero npm dependencies: node fetch + system tar (bsdtar on Windows handles .zip).
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const os = require("os");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const { execFileSync } = require("child_process");
|
|
10
|
+
|
|
11
|
+
const VERSION = require("./package.json").version;
|
|
12
|
+
const REPO = "telagod/abyss";
|
|
13
|
+
|
|
14
|
+
function target() {
|
|
15
|
+
const arch = { x64: "x86_64", arm64: "aarch64" }[process.arch];
|
|
16
|
+
if (!arch) return null;
|
|
17
|
+
switch (process.platform) {
|
|
18
|
+
case "linux":
|
|
19
|
+
return `${arch}-unknown-linux-gnu`;
|
|
20
|
+
case "darwin":
|
|
21
|
+
return `${arch}-apple-darwin`;
|
|
22
|
+
case "win32":
|
|
23
|
+
return arch === "x86_64" ? "x86_64-pc-windows-msvc" : null;
|
|
24
|
+
default:
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function assetName(t) {
|
|
30
|
+
return process.platform === "win32" ? `abyss-${t}.zip` : `abyss-${t}.tar.gz`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function binPath() {
|
|
34
|
+
return path.join(
|
|
35
|
+
__dirname,
|
|
36
|
+
"bin",
|
|
37
|
+
process.platform === "win32" ? "abyss-bin.exe" : "abyss-bin"
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function main() {
|
|
42
|
+
const t = target();
|
|
43
|
+
if (!t) {
|
|
44
|
+
console.error(
|
|
45
|
+
`[abyss] unsupported platform: ${process.platform}/${process.arch} — ` +
|
|
46
|
+
`build from source: https://github.com/${REPO}#install`
|
|
47
|
+
);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${assetName(t)}`;
|
|
52
|
+
console.error(`[abyss] downloading ${url}`);
|
|
53
|
+
|
|
54
|
+
const res = await fetch(url, { redirect: "follow" });
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
console.error(
|
|
57
|
+
`[abyss] download failed (HTTP ${res.status}). ` +
|
|
58
|
+
`Try: curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash`
|
|
59
|
+
);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "abyss-"));
|
|
64
|
+
const archive = path.join(tmp, assetName(t));
|
|
65
|
+
fs.writeFileSync(archive, Buffer.from(await res.arrayBuffer()));
|
|
66
|
+
|
|
67
|
+
// bsdtar (bundled with Windows 10+) extracts both .tar.gz and .zip
|
|
68
|
+
execFileSync("tar", ["-xf", archive, "-C", tmp]);
|
|
69
|
+
|
|
70
|
+
const extracted = path.join(
|
|
71
|
+
tmp,
|
|
72
|
+
process.platform === "win32" ? "abyss.exe" : "abyss"
|
|
73
|
+
);
|
|
74
|
+
fs.mkdirSync(path.dirname(binPath()), { recursive: true });
|
|
75
|
+
fs.copyFileSync(extracted, binPath());
|
|
76
|
+
fs.chmodSync(binPath(), 0o755);
|
|
77
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
78
|
+
|
|
79
|
+
console.error(`[abyss] installed ${binPath()}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
main().catch((e) => {
|
|
83
|
+
console.error(`[abyss] install failed: ${e.message}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@code-abyss/cli",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "abyss — the code graph your agent checks before it edits. npm wrapper that downloads the prebuilt binary.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"abyss": "bin/abyss.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node install.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin/abyss.js",
|
|
13
|
+
"install.js",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/telagod/abyss.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/telagod/abyss#readme",
|
|
24
|
+
"license": "Apache-2.0",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"code-index",
|
|
27
|
+
"call-graph",
|
|
28
|
+
"mcp",
|
|
29
|
+
"agent",
|
|
30
|
+
"tree-sitter"
|
|
31
|
+
]
|
|
32
|
+
}
|