@akasecurity/ai-tc-claude-code 0.8.1
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/.claude-plugin/plugin.json +7 -0
- package/LICENSE +201 -0
- package/README.md +46 -0
- package/commands/audit.md +19 -0
- package/commands/dashboard.md +26 -0
- package/commands/detections.md +30 -0
- package/commands/exceptions.md +26 -0
- package/commands/findings.md +23 -0
- package/commands/health.md +20 -0
- package/commands/recommend.md +21 -0
- package/commands/scan.md +69 -0
- package/commands/setup.md +143 -0
- package/commands/tokens.md +23 -0
- package/hooks/hooks.json +61 -0
- package/package.json +43 -0
- package/scripts/backfill.js +25953 -0
- package/scripts/dashboard.js +46 -0
- package/scripts/filescan.js +25684 -0
- package/scripts/firstrun.js +24845 -0
- package/scripts/intro.js +17145 -0
- package/scripts/onboard.js +17141 -0
- package/scripts/post-tool-use.js +25464 -0
- package/scripts/pre-tool-use.js +25463 -0
- package/scripts/query.js +25261 -0
- package/scripts/reconcile.js +25507 -0
- package/scripts/session-start.js +26108 -0
- package/scripts/statusline.js +24719 -0
- package/scripts/stop.js +17241 -0
- package/scripts/user-prompt-submit.js +25427 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// src/dashboard.ts
|
|
2
|
+
import { spawn, spawnSync } from "child_process";
|
|
3
|
+
|
|
4
|
+
// src/dashboard-launch.ts
|
|
5
|
+
var DEFAULT_PORT = "4319";
|
|
6
|
+
var ROUTE = "/security";
|
|
7
|
+
function parsePort(argv) {
|
|
8
|
+
for (let i = 0; i < argv.length; i++) {
|
|
9
|
+
const arg = argv[i] ?? "";
|
|
10
|
+
if (arg === "--port") return argv[i + 1] ?? DEFAULT_PORT;
|
|
11
|
+
if (arg.startsWith("--port=")) return arg.slice("--port=".length);
|
|
12
|
+
}
|
|
13
|
+
return DEFAULT_PORT;
|
|
14
|
+
}
|
|
15
|
+
function dashboardUrl(port) {
|
|
16
|
+
return `http://localhost:${port}${ROUTE}`;
|
|
17
|
+
}
|
|
18
|
+
function startMessage(url) {
|
|
19
|
+
return `Starting the AKA dashboard at ${url} \u2014 it opens in your browser once ready.
|
|
20
|
+
It serves your local store at ~/.aka/data; leave it running (stop it with Ctrl-C in that process).`;
|
|
21
|
+
}
|
|
22
|
+
var INSTALL_HINT = "The AKA dashboard is launched by the `aka` CLI, which the plugin does not bundle.\nInstall it and run /aka:dashboard again:\n npm i -g @akasecurity/cli # then it is on your PATH as `aka`\nFrom a repo checkout instead: pnpm --filter @akasecurity/cli dev dashboard";
|
|
23
|
+
|
|
24
|
+
// src/dashboard.ts
|
|
25
|
+
var args = process.argv.slice(2);
|
|
26
|
+
function akaMissing() {
|
|
27
|
+
const probe = spawnSync("aka", ["--help"], { stdio: "ignore" });
|
|
28
|
+
return probe.error !== void 0 && probe.error.code === "ENOENT";
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
if (akaMissing()) {
|
|
32
|
+
process.stdout.write(`${INSTALL_HINT}
|
|
33
|
+
`);
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
36
|
+
const child = spawn("aka", ["dashboard", ...args], { detached: true, stdio: "ignore" });
|
|
37
|
+
child.on("error", () => {
|
|
38
|
+
});
|
|
39
|
+
child.unref();
|
|
40
|
+
process.stdout.write(`${startMessage(dashboardUrl(parsePort(args)))}
|
|
41
|
+
`);
|
|
42
|
+
} catch {
|
|
43
|
+
process.stdout.write(`${INSTALL_HINT}
|
|
44
|
+
`);
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|