@keygraph/shannon 1.0.0-beta.2 → 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/dist/index.mjs +4 -16
- package/package.json +3 -3
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.
|
|
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", "--
|
|
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);
|
|
@@ -318,16 +317,6 @@ function getCredentialsPath() {
|
|
|
318
317
|
return path.join(SHANNON_HOME$2, "google-sa-key.json");
|
|
319
318
|
}
|
|
320
319
|
/**
|
|
321
|
-
* In dev mode, return the credentials directory if it exists and has files.
|
|
322
|
-
* In npx mode, there is no credentials directory (single file mount instead).
|
|
323
|
-
*/
|
|
324
|
-
function getCredentialsDir() {
|
|
325
|
-
if (getMode() !== "local") return void 0;
|
|
326
|
-
const dir = path.resolve("credentials");
|
|
327
|
-
if (!fs.existsSync(dir)) return void 0;
|
|
328
|
-
return fs.readdirSync(dir).length > 0 ? dir : void 0;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
320
|
* Initialize state directories.
|
|
332
321
|
* Local mode: creates ./workspaces/ and ./credentials/
|
|
333
322
|
* NPX mode: creates ~/.shannon/workspaces/
|
|
@@ -1299,9 +1288,9 @@ async function start(args) {
|
|
|
1299
1288
|
const taskQueue = `shannon-${suffix}`;
|
|
1300
1289
|
const containerName = `shannon-worker-${suffix}`;
|
|
1301
1290
|
const workspace = args.workspace ?? `${new URL(args.url).hostname.replace(/[^a-zA-Z0-9-]/g, "-")}_shannon-${Date.now()}`;
|
|
1302
|
-
const credentialsDir = getCredentialsDir();
|
|
1303
1291
|
const credentialsPath = getCredentialsPath();
|
|
1304
|
-
const hasCredentials =
|
|
1292
|
+
const hasCredentials = fs.existsSync(credentialsPath);
|
|
1293
|
+
if (hasCredentials) process.env.GOOGLE_APPLICATION_CREDENTIALS = "/app/credentials/google-sa-key.json";
|
|
1305
1294
|
const outputDir = args.output ? path.resolve(args.output) : void 0;
|
|
1306
1295
|
if (outputDir) fs.mkdirSync(outputDir, { recursive: true });
|
|
1307
1296
|
const promptsDir = isLocal() ? path.resolve("apps/worker/prompts") : void 0;
|
|
@@ -1315,7 +1304,6 @@ async function start(args) {
|
|
|
1315
1304
|
containerName,
|
|
1316
1305
|
envFlags: buildEnvFlags(),
|
|
1317
1306
|
...config && { config },
|
|
1318
|
-
...credentialsDir && { credentialsDir },
|
|
1319
1307
|
...hasCredentials && { credentials: credentialsPath },
|
|
1320
1308
|
...promptsDir && { promptsDir },
|
|
1321
1309
|
...outputDir && { outputDir },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keygraph/shannon",
|
|
3
|
-
"version": "1.0.0
|
|
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.
|
|
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.
|
|
43
|
+
"tsdown": "^0.21.5"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsdown",
|