@keygraph/shannon 1.0.0-beta.1 → 1.0.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 ADDED
@@ -0,0 +1,22 @@
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/KeygraphHQ/shannon/main/assets/github-banner.png" alt="Shannon — AI Pentester for Web Applications and APIs" width="100%">
4
+
5
+ # Shannon — AI Pentester by Keygraph
6
+
7
+ Shannon is an autonomous, white-box AI pentester for web applications and APIs. <br />
8
+ It analyzes your source code, identifies attack vectors, and executes real exploits to prove vulnerabilities before they reach production.
9
+
10
+ ---
11
+
12
+ <a href="https://github.com/KeygraphHQ/shannon/discussions/categories/announcements"><img src="https://raw.githubusercontent.com/KeygraphHQ/shannon/main/assets/announcements.png" height="40" alt="Announcements"></a>
13
+ <a href="https://discord.gg/9ZqQPuhJB7"><img src="https://raw.githubusercontent.com/KeygraphHQ/shannon/main/assets/discord.png" height="40" alt="Join Discord"></a>
14
+ <a href="https://keygraph.io/"><img src="https://raw.githubusercontent.com/KeygraphHQ/shannon/main/assets/Keygraph_Button.png" height="40" alt="Visit Keygraph.io"></a>
15
+ <a href="https://www.linkedin.com/company/keygraph/"><img src="https://raw.githubusercontent.com/KeygraphHQ/shannon/main/assets/linkedin.png" height="40" alt="Follow Us on Linkedin"></a>
16
+
17
+ ---
18
+
19
+ **Full README and usage guide**
20
+ [https://github.com/KeygraphHQ/shannon#readme](https://github.com/KeygraphHQ/shannon#readme)
21
+
22
+ </div>
package/dist/index.mjs CHANGED
@@ -198,10 +198,9 @@ function spawnWorker(opts) {
198
198
  if (opts.promptsDir) args.push("-v", `${opts.promptsDir}:/app/apps/worker/prompts:ro`);
199
199
  if (opts.config) args.push("-v", `${opts.config.hostPath}:${opts.config.containerPath}:ro`);
200
200
  if (opts.outputDir) args.push("-v", `${opts.outputDir}:/app/output`);
201
- if (opts.credentialsDir) args.push("-v", `${opts.credentialsDir}:/app/credentials:ro`);
202
- else if (opts.credentials) args.push("-v", `${opts.credentials}:/app/credentials/google-sa-key.json:ro`);
201
+ if (opts.credentials) args.push("-v", `${opts.credentials}:/app/credentials/google-sa-key.json:ro`);
203
202
  args.push(...opts.envFlags);
204
- args.push("--shm-size", "2gb", "--ipc", "host", "--security-opt", "seccomp=unconfined");
203
+ args.push("--shm-size", "2gb", "--security-opt", "seccomp=unconfined");
205
204
  args.push(getWorkerImage(opts.version));
206
205
  args.push("node", "apps/worker/dist/temporal/worker.js", opts.url, opts.repo.containerPath);
207
206
  args.push("--task-queue", opts.taskQueue);
@@ -248,21 +247,6 @@ function stopInfra(clean) {
248
247
  execFileSync("docker", args, { stdio: "inherit" });
249
248
  }
250
249
  /**
251
- * Pull the worker image matching the current CLI version.
252
- */
253
- function pullImage(version) {
254
- const image = getWorkerImage(version);
255
- console.log(`Pulling ${image}...`);
256
- try {
257
- execFileSync("docker", ["pull", image], { stdio: "inherit" });
258
- } catch {
259
- console.error(`\nERROR: Failed to pull ${image}`);
260
- console.error("Check https://hub.docker.com/r/keygraph/shannon for available tags.");
261
- process.exit(1);
262
- }
263
- pruneOldImages(version);
264
- }
265
- /**
266
250
  * Remove old keygraph/shannon images that don't match the current version.
267
251
  */
268
252
  function pruneOldImages(currentVersion) {
@@ -333,16 +317,6 @@ function getCredentialsPath() {
333
317
  return path.join(SHANNON_HOME$2, "google-sa-key.json");
334
318
  }
335
319
  /**
336
- * In dev mode, return the credentials directory if it exists and has files.
337
- * In npx mode, there is no credentials directory (single file mount instead).
338
- */
339
- function getCredentialsDir() {
340
- if (getMode() !== "local") return void 0;
341
- const dir = path.resolve("credentials");
342
- if (!fs.existsSync(dir)) return void 0;
343
- return fs.readdirSync(dir).length > 0 ? dir : void 0;
344
- }
345
- /**
346
320
  * Initialize state directories.
347
321
  * Local mode: creates ./workspaces/ and ./credentials/
348
322
  * NPX mode: creates ~/.shannon/workspaces/
@@ -1314,9 +1288,9 @@ async function start(args) {
1314
1288
  const taskQueue = `shannon-${suffix}`;
1315
1289
  const containerName = `shannon-worker-${suffix}`;
1316
1290
  const workspace = args.workspace ?? `${new URL(args.url).hostname.replace(/[^a-zA-Z0-9-]/g, "-")}_shannon-${Date.now()}`;
1317
- const credentialsDir = getCredentialsDir();
1318
1291
  const credentialsPath = getCredentialsPath();
1319
- const hasCredentials = !credentialsDir && fs.existsSync(credentialsPath);
1292
+ const hasCredentials = fs.existsSync(credentialsPath);
1293
+ if (hasCredentials) process.env.GOOGLE_APPLICATION_CREDENTIALS = "/app/credentials/google-sa-key.json";
1320
1294
  const outputDir = args.output ? path.resolve(args.output) : void 0;
1321
1295
  if (outputDir) fs.mkdirSync(outputDir, { recursive: true });
1322
1296
  const promptsDir = isLocal() ? path.resolve("apps/worker/prompts") : void 0;
@@ -1330,7 +1304,6 @@ async function start(args) {
1330
1304
  containerName,
1331
1305
  envFlags: buildEnvFlags(),
1332
1306
  ...config && { config },
1333
- ...credentialsDir && { credentialsDir },
1334
1307
  ...hasCredentials && { credentials: credentialsPath },
1335
1308
  ...promptsDir && { promptsDir },
1336
1309
  ...outputDir && { outputDir },
@@ -1471,15 +1444,6 @@ async function uninstall() {
1471
1444
  p.outro("Shannon has been uninstalled. Run `npx @keygraph/shannon setup` to start fresh.");
1472
1445
  }
1473
1446
  //#endregion
1474
- //#region src/commands/update.ts
1475
- /**
1476
- * `shannon update` command — pull the worker image matching the current CLI version.
1477
- */
1478
- function update(version) {
1479
- pullImage(version);
1480
- console.log("Update complete.");
1481
- }
1482
- //#endregion
1483
1447
  //#region src/commands/workspaces.ts
1484
1448
  /**
1485
1449
  * `shannon workspaces` command — list all workspaces.
@@ -1546,7 +1510,6 @@ Usage:${mode === "local" ? "" : `
1546
1510
  ${prefix} logs <workspace> Tail workflow log
1547
1511
  ${prefix} status Show running workers${mode === "local" ? `
1548
1512
  ${prefix} build [--no-cache] Build worker image` : `
1549
- ${prefix} update Pull latest image
1550
1513
  ${prefix} uninstall Remove ~/.shannon/ and all data`}
1551
1514
  ${prefix} info Show splash screen
1552
1515
  ${prefix} help Show this help
@@ -1683,9 +1646,6 @@ switch (command) {
1683
1646
  case "build":
1684
1647
  build(args.includes("--no-cache"));
1685
1648
  break;
1686
- case "update":
1687
- update(getVersion());
1688
- break;
1689
1649
  case "uninstall":
1690
1650
  if (getMode() === "local") {
1691
1651
  console.error("ERROR: uninstall is only available in npx mode.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keygraph/shannon",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0",
4
4
  "description": "Shannon - Autonomous white-box AI pentester for web applications and APIs by Keygraph",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -15,7 +15,7 @@
15
15
  "@clack/prompts": "^1.1.0",
16
16
  "chokidar": "^5.0.0",
17
17
  "dotenv": "^17.3.1",
18
- "smol-toml": "^1.6.0"
18
+ "smol-toml": "^1.6.1"
19
19
  },
20
20
  "keywords": [
21
21
  "security",
@@ -40,7 +40,7 @@
40
40
  "node": ">=18"
41
41
  },
42
42
  "devDependencies": {
43
- "tsdown": "^0.21.2"
43
+ "tsdown": "^0.21.5"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsdown",