@yingge/drsg 0.0.0-stage → 2.24.4
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 -2
- package/bin/drsg.js +60 -0
- package/package.json +36 -4
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @yingge/drsg
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A code-intelligence graph for coding agents. Digests a repository into a
|
|
4
|
+
resolved call graph and answers *who calls this*, *what would a change reach*,
|
|
5
|
+
*how does one symbol reach another* and *which HTTP routes meet* — one round
|
|
6
|
+
trip each, with no model in the loop.
|
|
7
|
+
|
|
8
|
+
```console
|
|
9
|
+
$ npx @yingge/drsg init # digest, serve, and write the MCP config
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Your agent then has `context`, `impact`, `trace`, `wire`, `grep` and the rest.
|
|
13
|
+
On this project — 97k lines, 13 parser plugins — the digest takes about three
|
|
14
|
+
seconds, and answering "who calls this and what would a change reach" costs a
|
|
15
|
+
median 925 tokens against 53,720 for grepping the name and reading the files
|
|
16
|
+
that matched.
|
|
17
|
+
|
|
18
|
+
The installed command is `drsg`. Installing the package pulls exactly one
|
|
19
|
+
prebuilt binary, chosen by your platform:
|
|
20
|
+
`drsg-linux-x64`, `drsg-linux-arm64`, `drsg-darwin-x64`, `drsg-darwin-arm64`
|
|
21
|
+
or `drsg-win32-x64`.
|
|
22
|
+
|
|
23
|
+
Full documentation, the measurement method, and the standalone installer:
|
|
24
|
+
**https://github.com/wangyingsm/dr-strange**
|
|
25
|
+
|
|
26
|
+
MIT OR Apache-2.0.
|
package/bin/drsg.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Hand the process to the platform binary npm already installed.
|
|
3
|
+
//
|
|
4
|
+
// Each platform package declares its own `os`/`cpu`, so npm unpacks exactly
|
|
5
|
+
// one of them and skips the rest. Resolving through `require.resolve` means
|
|
6
|
+
// the lookup follows npm's own layout — hoisted, nested, or inside a
|
|
7
|
+
// workspace — rather than guessing at a path.
|
|
8
|
+
//
|
|
9
|
+
// `execFileSync` with `stdio: "inherit"` keeps drsg in charge of the
|
|
10
|
+
// terminal: it is an interactive CLI (`plugin install` prompts) and a
|
|
11
|
+
// long-running server, and both need the real stdin, not a pipe.
|
|
12
|
+
|
|
13
|
+
const { execFileSync } = require("node:child_process");
|
|
14
|
+
|
|
15
|
+
const PLATFORMS = {
|
|
16
|
+
"linux x64": ["drsg-linux-x64", "drsg"],
|
|
17
|
+
"linux arm64": ["drsg-linux-arm64", "drsg"],
|
|
18
|
+
"darwin x64": ["drsg-darwin-x64", "drsg"],
|
|
19
|
+
"darwin arm64": ["drsg-darwin-arm64", "drsg"],
|
|
20
|
+
"win32 x64": ["drsg-win32-x64", "drsg.exe"],
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const key = `${process.platform} ${process.arch}`;
|
|
24
|
+
const entry = PLATFORMS[key];
|
|
25
|
+
|
|
26
|
+
if (!entry) {
|
|
27
|
+
console.error(
|
|
28
|
+
`drsg: no prebuilt binary for ${key}.\n` +
|
|
29
|
+
`Supported: ${Object.keys(PLATFORMS).join(", ")}.\n` +
|
|
30
|
+
`Build from source instead: https://github.com/wangyingsm/dr-strange#install`,
|
|
31
|
+
);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const [pkg, binary] = entry;
|
|
36
|
+
let binPath;
|
|
37
|
+
try {
|
|
38
|
+
binPath = require.resolve(`${pkg}/bin/${binary}`);
|
|
39
|
+
} catch {
|
|
40
|
+
// The platform package is optional, so a failed or skipped install leaves
|
|
41
|
+
// the wrapper with nothing to run rather than failing the whole install.
|
|
42
|
+
console.error(
|
|
43
|
+
`drsg: the binary package ${pkg} is not installed.\n` +
|
|
44
|
+
`This happens when optional dependencies were skipped ` +
|
|
45
|
+
`(--no-optional, --omit=optional, or an offline cache).\n` +
|
|
46
|
+
`Install it directly: npm install ${pkg}\n` +
|
|
47
|
+
`Or use the standalone installer: https://github.com/wangyingsm/dr-strange#install`,
|
|
48
|
+
);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
54
|
+
} catch (err) {
|
|
55
|
+
// A non-zero exit from drsg is drsg's answer, not a wrapper failure: pass
|
|
56
|
+
// the code through so scripts and CI see what they would see natively.
|
|
57
|
+
if (typeof err.status === "number") process.exit(err.status);
|
|
58
|
+
if (err.signal) process.exit(1);
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yingge/drsg",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.24.4",
|
|
4
|
+
"description": "A code-intelligence graph for coding agents: who calls this, what a change reaches, in one round trip.",
|
|
5
|
+
"license": "MIT OR Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/wangyingsm/dr-strange.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/wangyingsm/dr-strange#readme",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"mcp",
|
|
13
|
+
"code-intelligence",
|
|
14
|
+
"graph",
|
|
15
|
+
"agent",
|
|
16
|
+
"call-graph",
|
|
17
|
+
"claude",
|
|
18
|
+
"cursor",
|
|
19
|
+
"codex",
|
|
20
|
+
"rust"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"drsg": "bin/drsg.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"drsg-linux-x64": "2.24.4",
|
|
33
|
+
"drsg-linux-arm64": "2.24.4",
|
|
34
|
+
"drsg-darwin-x64": "2.24.4",
|
|
35
|
+
"drsg-darwin-arm64": "2.24.4",
|
|
36
|
+
"drsg-win32-x64": "2.24.4"
|
|
37
|
+
}
|
|
38
|
+
}
|