@pensar/apex 2.4.0 → 2.5.0-canary.22f2eb52
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/build/agent-7qtpem5z.js +12 -0
- package/build/agent-9khcyh5t.js +14 -0
- package/build/agent-bsyhck0a.js +12 -0
- package/build/{agent-5ejt5vpz.js → agent-ywewzc2h.js} +42 -42
- package/build/{apps-17wvz1d7.js → apps-11akynyv.js} +74 -43
- package/build/{auth-z3h9859n.js → auth-dd6r9mk4.js} +57 -61
- package/build/blackboxAgent-hbra4k00.js +12 -0
- package/build/blackboxPentest-bn5evs2z.js +61 -0
- package/build/{cli-xshasbwe.js → cli-3v9zs5wm.js} +31 -52
- package/build/{cli-mavved45.js → cli-4z46kyrk.js} +86 -93
- package/build/cli-7vby0hk6.js +12136 -0
- package/build/{cli-gq40s5b3.js → cli-8kkaeb70.js} +33 -46
- package/build/cli-8w8k4dph.js +15 -0
- package/build/cli-ag6jtndp.js +32 -0
- package/build/{cli-2cbwdk78.js → cli-ak78mweh.js} +4 -4
- package/build/cli-bb02pjt0.js +1485 -0
- package/build/{cli-k71t434r.js → cli-ec2hwkv3.js} +34 -76
- package/build/{cli-vnynf0js.js → cli-f5rw841m.js} +11 -5
- package/build/{cli-k8kc47pq.js → cli-gamfs2yq.js} +118 -115
- package/build/{cli-32z0017y.js → cli-gq5sk2j3.js} +36 -60
- package/build/{cli-bc05qbss.js → cli-h6y3bt60.js} +13 -21
- package/build/{cli-tkc598ey.js → cli-j1916nvj.js} +10035 -7661
- package/build/{cli-5k33webc.js → cli-jw1xftqm.js} +355 -332
- package/build/{cli-tznv8pf1.js → cli-n4h7ygp5.js} +4 -4
- package/build/{cli-b1adytsy.js → cli-q45hcq3f.js} +67 -39
- package/build/{cli-repbyhkk.js → cli-qkb3v2nw.js} +26063 -25373
- package/build/{cli-j54qa6tm.js → cli-qktcyj48.js} +1 -1
- package/build/cli-retw3rw5.js +12 -0
- package/build/cli-tjm77pmx.js +12075 -0
- package/build/{cli-dm0fc0bm.js → cli-v1sarr4y.js} +5 -9
- package/build/{cli-9rhzhgx2.js → cli-v8ph8hy2.js} +5 -5
- package/build/{cli-vq52kp7j.js → cli-vkxx4jzv.js} +147 -128
- package/build/cli-wfb4gde1.js +22 -0
- package/build/{cli-ee3axgts.js → cli-xbhr5khz.js} +1 -1
- package/build/cli-z82n3qk1.js +6 -0
- package/build/cli.js +689 -132
- package/build/{config-f1mj4nhd.js → config-kv5v9ctn.js} +29 -29
- package/build/{doctor-ekneewa3.js → doctor-xs4s5km8.js} +4 -9
- package/build/{fastStrike-8zka43xs.js → fastStrike-b8t8f916.js} +26 -28
- package/build/{fixes-b89s5haw.js → fixes-kcckqx3s.js} +22 -27
- package/build/getMachineId-bsd-zr67nd9p.js +36 -0
- package/build/getMachineId-darwin-fd1d562d.js +36 -0
- package/build/getMachineId-linux-kjmg243j.js +29 -0
- package/build/getMachineId-unsupported-n4r58vke.js +19 -0
- package/build/getMachineId-win-yzgpfsrb.js +38 -0
- package/build/index-3mzr07h0.js +9 -0
- package/build/index-63zf8jxx.js +12 -0
- package/build/index-a1bg29j1.js +1559 -0
- package/build/{index-cbwn03kz.js → index-a2xycbjs.js} +12 -31
- package/build/{index-6d22pyxt.js → index-ae81pvwg.js} +2995 -2432
- package/build/index-cbajq2xy.js +17 -0
- package/build/index-cn4p95gh.js +100 -0
- package/build/index-kas88svr.js +36 -0
- package/build/index-mr20g8k4.js +22 -0
- package/build/{index-psqjpw5m.js → index-nweqptgs.js} +7 -7
- package/build/{index-sf16jm0m.js → index-rx5jn1nz.js} +137 -162
- package/build/{issues-xx5bs4md.js → issues-jm28k288.js} +81 -35
- package/build/{logs-qtxe51w2.js → logs-r02tbz89.js} +20 -25
- package/build/{multipart-parser-g2xxkezz.js → multipart-parser-vjjdbpd1.js} +10 -10
- package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-mmfejh1j.js} +6 -13
- package/build/{parse-rtccymzn.js → parse-cqecqrc5.js} +0 -4
- package/build/pentest-13jcm4cy.js +21 -0
- package/build/{pentests-6ks3szc4.js → pentests-jyn4zs7n.js} +23 -28
- package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-m3qkbpv6.js} +16 -20
- package/build/{targets-sxygyj87.js → targets-rqv57as0.js} +22 -27
- package/build/threatModel-scmz36xr.js +19 -0
- package/build/{token-3bbp59y6.js → token-n0tmq8n5.js} +2 -2
- package/build/{token-util-6xjme11b.js → token-util-bv80pj47.js} +1 -2
- package/build/{uninstall-tvsh81v8.js → uninstall-bme62bdg.js} +7 -4
- package/build/{upload-7wdyyqmr.js → upload-hwpgx1ha.js} +7 -13
- package/build/{utils-7fwdkqk6.js → utils-abtz5mmk.js} +7 -29
- package/package.json +8 -2
- package/build/agent-mvpgvgks.js +0 -19
- package/build/agent-nhs1w5w0.js +0 -29
- package/build/authentication-3s97cpk4.js +0 -19
- package/build/blackboxAgent-gw0a1ca4.js +0 -19
- package/build/blackboxPentest-44333zss.js +0 -37
- package/build/cli-0n4r54hq.js +0 -414
- package/build/cli-72cvcqhg.js +0 -22
- package/build/cli-qqt4gj1w.js +0 -53
- package/build/cli-swpbx60z.js +0 -24441
- package/build/index-4ad3sdwk.js +0 -39
- package/build/index-ghwf5z3v.js +0 -12
- package/build/index-hqjdg6fg.js +0 -205
- package/build/index-mtq7kmxz.js +0 -12856
- package/build/index-rbzhk712.js +0 -33
- package/build/index-y5w6n3tb.js +0 -19
- package/build/main-mmjp338j.js +0 -324
- package/build/pentest-xtc1sjdw.js +0 -29
- package/build/threatModel-xsm6fwk5.js +0 -27
- /package/build/{cli-c8131c4q.js → cli-0wsh8j2t.js} +0 -0
- /package/build/{cli-e08r86zk.js → cli-b3dvxjgk.js} +0 -0
- /package/build/{cli-fw5r7pfj.js → cli-q126f6ef.js} +0 -0
- /package/build/{cli-9fsre5pt.js → cli-qba2x69h.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
__toESM,
|
|
2
3
|
__commonJS,
|
|
3
4
|
__esm,
|
|
4
|
-
__require
|
|
5
|
-
|
|
6
|
-
} from "./cli-bc05qbss.js";
|
|
5
|
+
__require
|
|
6
|
+
} from "./cli-h6y3bt60.js";
|
|
7
7
|
|
|
8
8
|
// node_modules/fetch-blob/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js
|
|
9
9
|
var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
@@ -23,7 +23,7 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
23
23
|
value: name,
|
|
24
24
|
configurable: true
|
|
25
25
|
});
|
|
26
|
-
} catch (
|
|
26
|
+
} catch (_a) {}
|
|
27
27
|
}
|
|
28
28
|
const originalPromise = Promise;
|
|
29
29
|
const originalPromiseThen = Promise.prototype.then;
|
|
@@ -519,7 +519,7 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
519
519
|
}
|
|
520
520
|
try {
|
|
521
521
|
return x._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
|
|
522
|
-
} catch (
|
|
522
|
+
} catch (_a) {
|
|
523
523
|
return false;
|
|
524
524
|
}
|
|
525
525
|
}
|
|
@@ -1344,9 +1344,9 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
1344
1344
|
return mode;
|
|
1345
1345
|
}
|
|
1346
1346
|
function convertByobReadOptions(options, context) {
|
|
1347
|
-
var
|
|
1347
|
+
var _a;
|
|
1348
1348
|
assertDictionary(options, context);
|
|
1349
|
-
const min = (
|
|
1349
|
+
const min = (_a = options === null || options === undefined ? undefined : options.min) !== null && _a !== undefined ? _a : 1;
|
|
1350
1350
|
return {
|
|
1351
1351
|
min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member 'min' that`)
|
|
1352
1352
|
};
|
|
@@ -1588,7 +1588,7 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
try {
|
|
1590
1590
|
return typeof value.aborted === "boolean";
|
|
1591
|
-
} catch (
|
|
1591
|
+
} catch (_a) {
|
|
1592
1592
|
return false;
|
|
1593
1593
|
}
|
|
1594
1594
|
}
|
|
@@ -1705,12 +1705,12 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
1705
1705
|
return true;
|
|
1706
1706
|
}
|
|
1707
1707
|
function WritableStreamAbort(stream, reason) {
|
|
1708
|
-
var
|
|
1708
|
+
var _a;
|
|
1709
1709
|
if (stream._state === "closed" || stream._state === "errored") {
|
|
1710
1710
|
return promiseResolvedWith(undefined);
|
|
1711
1711
|
}
|
|
1712
1712
|
stream._writableStreamController._abortReason = reason;
|
|
1713
|
-
(
|
|
1713
|
+
(_a = stream._writableStreamController._abortController) === null || _a === undefined || _a.abort(reason);
|
|
1714
1714
|
const state = stream._state;
|
|
1715
1715
|
if (state === "closed" || state === "errored") {
|
|
1716
1716
|
return promiseResolvedWith(undefined);
|
|
@@ -2422,7 +2422,7 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
2422
2422
|
try {
|
|
2423
2423
|
new ctor;
|
|
2424
2424
|
return true;
|
|
2425
|
-
} catch (
|
|
2425
|
+
} catch (_a) {
|
|
2426
2426
|
return false;
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
@@ -2431,7 +2431,7 @@ var require_ponyfill_es2018 = __commonJS(function(exports, module) {
|
|
|
2431
2431
|
return isDOMExceptionConstructor(ctor) ? ctor : undefined;
|
|
2432
2432
|
}
|
|
2433
2433
|
function createPolyfill() {
|
|
2434
|
-
const ctor = function
|
|
2434
|
+
const ctor = function DOMException(message, name) {
|
|
2435
2435
|
this.message = message || "";
|
|
2436
2436
|
this.name = name || "Error";
|
|
2437
2437
|
if (Error.captureStackTrace) {
|
|
@@ -4139,7 +4139,7 @@ async function* toIterator(parts, clone = true) {
|
|
|
4139
4139
|
}
|
|
4140
4140
|
}
|
|
4141
4141
|
}
|
|
4142
|
-
var import_streams, POOL_SIZE = 65536, _Blob,
|
|
4142
|
+
var import_streams, POOL_SIZE = 65536, _Blob, Blob, fetch_blob_default;
|
|
4143
4143
|
var init_fetch_blob = __esm(() => {
|
|
4144
4144
|
import_streams = __toESM(require_streams(), 1);
|
|
4145
4145
|
/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
@@ -4228,20 +4228,20 @@ var init_fetch_blob = __esm(() => {
|
|
|
4228
4228
|
if (added >= span) {
|
|
4229
4229
|
break;
|
|
4230
4230
|
}
|
|
4231
|
-
const
|
|
4232
|
-
if (relativeStart &&
|
|
4233
|
-
relativeStart -=
|
|
4234
|
-
relativeEnd -=
|
|
4231
|
+
const size = ArrayBuffer.isView(part) ? part.byteLength : part.size;
|
|
4232
|
+
if (relativeStart && size <= relativeStart) {
|
|
4233
|
+
relativeStart -= size;
|
|
4234
|
+
relativeEnd -= size;
|
|
4235
4235
|
} else {
|
|
4236
4236
|
let chunk;
|
|
4237
4237
|
if (ArrayBuffer.isView(part)) {
|
|
4238
|
-
chunk = part.subarray(relativeStart, Math.min(
|
|
4238
|
+
chunk = part.subarray(relativeStart, Math.min(size, relativeEnd));
|
|
4239
4239
|
added += chunk.byteLength;
|
|
4240
4240
|
} else {
|
|
4241
|
-
chunk = part.slice(relativeStart, Math.min(
|
|
4241
|
+
chunk = part.slice(relativeStart, Math.min(size, relativeEnd));
|
|
4242
4242
|
added += chunk.size;
|
|
4243
4243
|
}
|
|
4244
|
-
relativeEnd -=
|
|
4244
|
+
relativeEnd -= size;
|
|
4245
4245
|
blobParts.push(chunk);
|
|
4246
4246
|
relativeStart = 0;
|
|
4247
4247
|
}
|
|
@@ -4263,12 +4263,12 @@ var init_fetch_blob = __esm(() => {
|
|
|
4263
4263
|
type: { enumerable: true },
|
|
4264
4264
|
slice: { enumerable: true }
|
|
4265
4265
|
});
|
|
4266
|
-
|
|
4267
|
-
fetch_blob_default =
|
|
4266
|
+
Blob = _Blob;
|
|
4267
|
+
fetch_blob_default = Blob;
|
|
4268
4268
|
});
|
|
4269
4269
|
|
|
4270
4270
|
// node_modules/fetch-blob/file.js
|
|
4271
|
-
var _File,
|
|
4271
|
+
var _File, File, file_default;
|
|
4272
4272
|
var init_file = __esm(() => {
|
|
4273
4273
|
init_fetch_blob();
|
|
4274
4274
|
_File = class File extends fetch_blob_default {
|
|
@@ -4300,8 +4300,8 @@ var init_file = __esm(() => {
|
|
|
4300
4300
|
return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]);
|
|
4301
4301
|
}
|
|
4302
4302
|
};
|
|
4303
|
-
|
|
4304
|
-
file_default =
|
|
4303
|
+
File = _File;
|
|
4304
|
+
file_default = File;
|
|
4305
4305
|
});
|
|
4306
4306
|
|
|
4307
4307
|
// node_modules/formdata-polyfill/esm.min.js
|
|
@@ -4320,12 +4320,12 @@ Content-Type: ${v.type || "application/octet-stream"}\r
|
|
|
4320
4320
|
c.push(`--${b}--`);
|
|
4321
4321
|
return new B(c, { type: "multipart/form-data; boundary=" + b });
|
|
4322
4322
|
}
|
|
4323
|
-
var t, i, h, r, m, f = (a, b, c) => (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c = c !== undefined ? c + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c || b[t] == "blob" ? new file_default([b], c, b) : b] : [a, b + ""]), e = (c,
|
|
4324
|
-
`)).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), x = (n, a,
|
|
4325
|
-
if (a.length <
|
|
4326
|
-
throw new TypeError(`Failed to execute '${n}' on 'FormData': ${
|
|
4323
|
+
var t, i, h, r, m, f = (a, b, c) => (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c = c !== undefined ? c + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c || b[t] == "blob" ? new file_default([b], c, b) : b] : [a, b + ""]), e = (c, f) => (f ? c : c.replace(/\r?\n|\r/g, `\r
|
|
4324
|
+
`)).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), x = (n, a, e) => {
|
|
4325
|
+
if (a.length < e) {
|
|
4326
|
+
throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e} arguments required, but only ${a.length} present.`);
|
|
4327
4327
|
}
|
|
4328
|
-
},
|
|
4328
|
+
}, FormData2;
|
|
4329
4329
|
var init_esm_min = __esm(() => {
|
|
4330
4330
|
init_fetch_blob();
|
|
4331
4331
|
init_file();
|
|
@@ -4333,7 +4333,7 @@ var init_esm_min = __esm(() => {
|
|
|
4333
4333
|
({ toStringTag: t, iterator: i, hasInstance: h } = Symbol);
|
|
4334
4334
|
r = Math.random;
|
|
4335
4335
|
m = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(",");
|
|
4336
|
-
|
|
4336
|
+
FormData2 = class FormData {
|
|
4337
4337
|
#d = [];
|
|
4338
4338
|
constructor(...a) {
|
|
4339
4339
|
if (a.length)
|
|
@@ -4346,7 +4346,7 @@ var init_esm_min = __esm(() => {
|
|
|
4346
4346
|
return this.entries();
|
|
4347
4347
|
}
|
|
4348
4348
|
static [h](o) {
|
|
4349
|
-
return o && typeof o === "object" && o[t] === "FormData" && !m.some((
|
|
4349
|
+
return o && typeof o === "object" && o[t] === "FormData" && !m.some((m) => typeof o[m] != "function");
|
|
4350
4350
|
}
|
|
4351
4351
|
append(...a) {
|
|
4352
4352
|
x("append", arguments, 2);
|
|
@@ -4422,54 +4422,12 @@ var require_node_domexception = __commonJS(function(exports, module) {
|
|
|
4422
4422
|
|
|
4423
4423
|
// node_modules/fetch-blob/from.js
|
|
4424
4424
|
import { statSync, createReadStream, promises as fs } from "node:fs";
|
|
4425
|
-
|
|
4426
|
-
var import_node_domexception, stat, blobFromSync = (path, type) => fromBlob(statSync(path), path, type), blobFrom = (path, type) => stat(path).then((stat2) => fromBlob(stat2, path, type)), fileFrom = (path, type) => stat(path).then((stat2) => fromFile(stat2, path, type)), fileFromSync = (path, type) => fromFile(statSync(path), path, type), fromBlob = (stat2, path, type = "") => new fetch_blob_default([new BlobDataItem({
|
|
4427
|
-
path,
|
|
4428
|
-
size: stat2.size,
|
|
4429
|
-
lastModified: stat2.mtimeMs,
|
|
4430
|
-
start: 0
|
|
4431
|
-
})], { type }), fromFile = (stat2, path, type = "") => new file_default([new BlobDataItem({
|
|
4432
|
-
path,
|
|
4433
|
-
size: stat2.size,
|
|
4434
|
-
lastModified: stat2.mtimeMs,
|
|
4435
|
-
start: 0
|
|
4436
|
-
})], basename(path), { type, lastModified: stat2.mtimeMs }), BlobDataItem;
|
|
4425
|
+
var import_node_domexception, stat;
|
|
4437
4426
|
var init_from = __esm(() => {
|
|
4438
4427
|
init_file();
|
|
4439
4428
|
init_fetch_blob();
|
|
4440
4429
|
import_node_domexception = __toESM(require_node_domexception(), 1);
|
|
4441
4430
|
({ stat } = fs);
|
|
4442
|
-
BlobDataItem = class BlobDataItem {
|
|
4443
|
-
#path;
|
|
4444
|
-
#start;
|
|
4445
|
-
constructor(options) {
|
|
4446
|
-
this.#path = options.path;
|
|
4447
|
-
this.#start = options.start;
|
|
4448
|
-
this.size = options.size;
|
|
4449
|
-
this.lastModified = options.lastModified;
|
|
4450
|
-
}
|
|
4451
|
-
slice(start, end) {
|
|
4452
|
-
return new BlobDataItem({
|
|
4453
|
-
path: this.#path,
|
|
4454
|
-
lastModified: this.lastModified,
|
|
4455
|
-
size: end - start,
|
|
4456
|
-
start: this.#start + start
|
|
4457
|
-
});
|
|
4458
|
-
}
|
|
4459
|
-
async* stream() {
|
|
4460
|
-
const { mtimeMs } = await stat(this.#path);
|
|
4461
|
-
if (mtimeMs > this.lastModified) {
|
|
4462
|
-
throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
|
|
4463
|
-
}
|
|
4464
|
-
yield* createReadStream(this.#path, {
|
|
4465
|
-
start: this.#start,
|
|
4466
|
-
end: this.#start + this.size - 1
|
|
4467
|
-
});
|
|
4468
|
-
}
|
|
4469
|
-
get [Symbol.toStringTag]() {
|
|
4470
|
-
return "Blob";
|
|
4471
|
-
}
|
|
4472
|
-
};
|
|
4473
4431
|
});
|
|
4474
4432
|
|
|
4475
|
-
export { fetch_blob_default, init_fetch_blob, file_default,
|
|
4433
|
+
export { fetch_blob_default, init_fetch_blob, file_default, FormData2, formDataToBlob, init_esm_min, init_from };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__esm
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-h6y3bt60.js";
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
|
-
var package_default;
|
|
6
|
+
var version = "2.5.0-canary.22f2eb52", package_default;
|
|
7
7
|
var init_package = __esm(() => {
|
|
8
8
|
package_default = {
|
|
9
9
|
author: "Pensar",
|
|
@@ -23,6 +23,10 @@ var init_package = __esm(() => {
|
|
|
23
23
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
24
24
|
"@openrouter/ai-sdk-provider": "^2.9.1",
|
|
25
25
|
"@opentelemetry/api": "^1.9.1",
|
|
26
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
|
|
27
|
+
"@opentelemetry/otlp-exporter-base": "^0.221.0",
|
|
28
|
+
"@opentelemetry/otlp-transformer": "^0.221.0",
|
|
29
|
+
"@opentelemetry/resources": "^2.10.0",
|
|
26
30
|
"@opentui/core": "^0.1.107",
|
|
27
31
|
"@opentui/react": "^0.1.107",
|
|
28
32
|
"@pensar/surface": "0.3.0",
|
|
@@ -46,6 +50,8 @@ var init_package = __esm(() => {
|
|
|
46
50
|
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
47
51
|
devDependencies: {
|
|
48
52
|
"@biomejs/biome": "2.4.14",
|
|
53
|
+
"@opentelemetry/context-async-hooks": "^2.10.0",
|
|
54
|
+
"@opentelemetry/sdk-trace-base": "^2.10.0",
|
|
49
55
|
"@types/bun": "^1.3.14",
|
|
50
56
|
"@types/mailparser": "^3.4.6",
|
|
51
57
|
"@types/mime-types": "^3.0.1",
|
|
@@ -92,7 +98,7 @@ var init_package = __esm(() => {
|
|
|
92
98
|
url: "https://github.com/pensarai/apex.git"
|
|
93
99
|
},
|
|
94
100
|
scripts: {
|
|
95
|
-
build: "bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
|
|
101
|
+
build: "rm -rf build && bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
|
|
96
102
|
"build:binaries": "bun run generate:ascii && mkdir -p dist && bun run build:binary:macos-arm64 && bun run build:binary:macos-x64 && bun run build:binary:linux-x64 && bun run build:binary:linux-arm64",
|
|
97
103
|
"build:binary": "bun run generate:ascii && bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --outfile pensar",
|
|
98
104
|
"build:binary:linux-arm64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-linux-arm64 --outfile dist/pensar-linux-arm64",
|
|
@@ -120,7 +126,7 @@ var init_package = __esm(() => {
|
|
|
120
126
|
tsc: "tsc --noEmit"
|
|
121
127
|
},
|
|
122
128
|
type: "module",
|
|
123
|
-
version
|
|
129
|
+
version
|
|
124
130
|
};
|
|
125
131
|
});
|
|
126
132
|
|
|
@@ -195,4 +201,4 @@ var init_installation = __esm(() => {
|
|
|
195
201
|
init_package();
|
|
196
202
|
});
|
|
197
203
|
|
|
198
|
-
export { init_package, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };
|
|
204
|
+
export { init_package, version, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };
|
|
@@ -2,16 +2,22 @@ import {
|
|
|
2
2
|
EndpointTransportEnum,
|
|
3
3
|
GrpcEndpointMetadataSchema,
|
|
4
4
|
OffensiveSecurityAgent
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-qkb3v2nw.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
init_zod,
|
|
8
|
+
stepCountIs2,
|
|
8
9
|
init_dist
|
|
9
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-j1916nvj.js";
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
string,
|
|
13
|
+
number,
|
|
14
|
+
boolean,
|
|
15
|
+
array,
|
|
16
|
+
object,
|
|
17
|
+
union,
|
|
18
|
+
_enum,
|
|
13
19
|
tool
|
|
14
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-tjm77pmx.js";
|
|
15
21
|
|
|
16
22
|
// src/core/agents/specialized/whiteboxAttackSurface/agent.ts
|
|
17
23
|
init_dist();
|
|
@@ -44,7 +50,7 @@ var NO_MANIFEST_HARD_RULES = `**You MUST NOT, under any circumstances:**
|
|
|
44
50
|
These patterns silently truncate at output-token limits and routes get dropped. The only correct workflow is: discover a route → call \`document_endpoint\` for it → discover the next route → call \`document_endpoint\` for it → ... until every route is documented. Repetition is expected and required.`;
|
|
45
51
|
var SUBMODULE_IGNORE_STEP = `**Ignore submodules** — check for a \`.gitmodules\` file or run \`git submodule status\`. Any directories that are git submodules are external dependencies and must be **completely excluded** from your analysis.`;
|
|
46
52
|
var DOCUMENT_IMMEDIATELY_RULE = `**Document each item the instant you discover it** — every output tool call must be made directly, one item per call, immediately after you identify it. Never collect items into a manifest, JSON file, or batch script. If you find yourself thinking "let me list all of these and then document them," stop — that pattern silently drops items when output tokens run out.`;
|
|
47
|
-
var
|
|
53
|
+
var WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT2 = `You are an expert source-code analyst with direct filesystem access. You will be given a specific objective — focus exclusively on completing it.
|
|
48
54
|
|
|
49
55
|
Your focus is on identifying **deployed applications and services** — APIs, web apps, microservices — that listen on a port and serve traffic, as well as **owned cloud resources** (S3 buckets, cloud storage, CDN origins, etc.) that are part of the attack surface. Ignore libraries, shared packages, SDKs, CLI tools, build scripts, and test suites unless they are part of a deployable service.
|
|
50
56
|
|
|
@@ -119,7 +125,7 @@ When you have called \`document_endpoint\` for every endpoint in your input list
|
|
|
119
125
|
3. **Document immediately.** Call \`document_endpoint\` directly per endpoint, the moment you have enough context. Do not collect entries in a buffer to "process later."
|
|
120
126
|
4. **Stay scoped.** Your job is documentation, not discovery. Do not call \`list_files\` or \`grep\` to look for additional routes — the list is final.
|
|
121
127
|
`;
|
|
122
|
-
var
|
|
128
|
+
var WHITEBOX_DISCOVERY_SYSTEM_PROMPT2 = `You are an expert source-code analyst with direct filesystem access. You will be given a specific objective — focus exclusively on completing it.
|
|
123
129
|
|
|
124
130
|
Your focus is on **deployed applications and services** — APIs, web apps, microservices — that listen on a port and serve traffic, as well as **owned cloud resources** (S3 buckets, cloud storage, CDN origins, etc.) that are part of the attack surface. Ignore libraries, shared packages, SDKs, CLI tools, build scripts, and test suites unless they are part of a deployable service.
|
|
125
131
|
|
|
@@ -311,34 +317,36 @@ Then:
|
|
|
311
317
|
|
|
312
318
|
// src/core/agents/specialized/whiteboxAttackSurface/types.ts
|
|
313
319
|
init_zod();
|
|
314
|
-
var RiskScoreBreakdownSchema =
|
|
315
|
-
exposure:
|
|
316
|
-
dataSensitivity:
|
|
317
|
-
functionCriticality:
|
|
318
|
-
securityIndicators:
|
|
320
|
+
var RiskScoreBreakdownSchema = object({
|
|
321
|
+
exposure: number().min(0).max(3).describe("Exposure Level (0-3): 3=Public no auth, 2=Standard user login, 1=Privileged/admin access, 0=Private/internal-only"),
|
|
322
|
+
dataSensitivity: number().min(0).max(3).describe("Data Sensitivity (0-3): 3=PII/PHI/financial/passwords/tokens, 2=Business operations/configs, 1=Low-value user data, 0=No meaningful data"),
|
|
323
|
+
functionCriticality: number().min(0).max(2).describe("Function Criticality (0-2): 2=Auth flows/payments/state-changing mutations, 1=Core product functionality, 0=Non-critical content"),
|
|
324
|
+
securityIndicators: number().min(0).max(2).describe("Security Indicators (0-2): 2=Critical vuln patterns (SQLi, command injection, hardcoded secrets), 1=Moderate concerns (missing validation, weak error handling), 0=No obvious issues")
|
|
319
325
|
});
|
|
320
|
-
var RiskScoreSchema =
|
|
321
|
-
score:
|
|
322
|
-
explanation:
|
|
326
|
+
var RiskScoreSchema = object({
|
|
327
|
+
score: number().min(0).max(10).describe("Total risk score (0-10)"),
|
|
328
|
+
explanation: string().describe("Justification for the risk score"),
|
|
323
329
|
breakdown: RiskScoreBreakdownSchema
|
|
324
330
|
});
|
|
325
|
-
var
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
var MethodSchema = union([string(), array(string())]).transform((m) => Array.isArray(m) ? m.join(", ") : m);
|
|
332
|
+
var StringListSchema = union([string(), array(string())]).transform((v) => Array.isArray(v) ? v : [v]);
|
|
333
|
+
var EndpointSchema2 = object({
|
|
334
|
+
method: MethodSchema.describe("HTTP method (GET, POST, PUT, DELETE, etc.) or 'PAGE' for web pages"),
|
|
335
|
+
path: string().describe("Route path (e.g. /api/users/:id, /dashboard)"),
|
|
336
|
+
handler: string().optional().describe("Handler function or component name, if identifiable"),
|
|
337
|
+
file: string().describe("File where this endpoint is defined"),
|
|
338
|
+
line: number().optional().describe("Line number in the file"),
|
|
339
|
+
authRequired: boolean().optional().describe("Whether this endpoint appears to require authentication"),
|
|
340
|
+
description: string().optional().describe("Brief description of what this endpoint does"),
|
|
341
|
+
pentestObjectives: StringListSchema.default([]).describe("Pentest objectives for this endpoint, derived from the threat model when available " + "(e.g. 'Test for IDOR by enumerating user IDs', 'Test for SQL injection in search parameter')"),
|
|
334
342
|
riskScore: RiskScoreSchema.optional().describe("AI-calculated risk score for prioritizing pentest efforts"),
|
|
335
|
-
threatModel:
|
|
343
|
+
threatModel: string().optional().describe("Endpoint-specific threat model describing attack vectors, data sensitivity, and testing priorities"),
|
|
336
344
|
transport: EndpointTransportEnum.optional().describe("Wire transport; 'grpc'/'grpc_web'/'connect' for gRPC methods, else http"),
|
|
337
345
|
grpc: GrpcEndpointMetadataSchema.optional().describe("gRPC service/method/streaming metadata when transport is a gRPC variant")
|
|
338
346
|
});
|
|
339
|
-
var AppSchema =
|
|
340
|
-
name:
|
|
341
|
-
type:
|
|
347
|
+
var AppSchema = object({
|
|
348
|
+
name: string().describe("Application or service name"),
|
|
349
|
+
type: _enum([
|
|
342
350
|
"web_application",
|
|
343
351
|
"api",
|
|
344
352
|
"full_stack",
|
|
@@ -348,18 +356,18 @@ var AppSchema = exports_external.object({
|
|
|
348
356
|
"cloud_resource",
|
|
349
357
|
"storage"
|
|
350
358
|
]).default("web_application").describe("Type of application (web_application, api, full_stack, database, cloud_resource, storage, etc.)"),
|
|
351
|
-
framework:
|
|
352
|
-
description:
|
|
353
|
-
location:
|
|
354
|
-
pages:
|
|
355
|
-
apiEndpoints:
|
|
359
|
+
framework: string().describe("Framework in use (e.g. Express, Next.js, Django, FastAPI, Rails)"),
|
|
360
|
+
description: string().describe("Brief description of what this app does"),
|
|
361
|
+
location: string().describe("Path to the app root relative to the repository root"),
|
|
362
|
+
pages: array(EndpointSchema2).describe("Web pages / views defined in this app"),
|
|
363
|
+
apiEndpoints: array(EndpointSchema2).describe("API endpoints defined in this app")
|
|
356
364
|
});
|
|
357
|
-
var AppInfoSchema =
|
|
358
|
-
name:
|
|
359
|
-
framework:
|
|
360
|
-
description:
|
|
361
|
-
location:
|
|
362
|
-
type:
|
|
365
|
+
var AppInfoSchema = object({
|
|
366
|
+
name: string().describe("Application or service name"),
|
|
367
|
+
framework: string().describe("Framework or cloud service (e.g. Express, Next.js, Django, FastAPI, Rails, AWS S3, CloudFront)"),
|
|
368
|
+
description: string().describe("Brief description of what this app does"),
|
|
369
|
+
location: string().describe("Path to the app root relative to the repository root, or resource identifier for cloud resources"),
|
|
370
|
+
type: _enum([
|
|
363
371
|
"web_application",
|
|
364
372
|
"api",
|
|
365
373
|
"full_stack",
|
|
@@ -370,72 +378,63 @@ var AppInfoSchema = exports_external.object({
|
|
|
370
378
|
"storage"
|
|
371
379
|
]).default("web_application").describe("Application type — web_application for frontend apps, api for backend services, " + "full_stack for frameworks like Next.js/Remix that serve both, " + "database for databases, cloud_resource for owned cloud infra, storage for S3/GCS/blob storage")
|
|
372
380
|
});
|
|
373
|
-
var
|
|
374
|
-
repoType:
|
|
375
|
-
packageManager:
|
|
376
|
-
apps:
|
|
381
|
+
var AppsDiscoveryResultSchema2 = object({
|
|
382
|
+
repoType: string().describe("e.g. monorepo, single-app, multi-package"),
|
|
383
|
+
packageManager: string().describe("e.g. npm, yarn, pnpm, pip, cargo, go modules"),
|
|
384
|
+
apps: array(AppInfoSchema).describe("All applications/services discovered in the repository")
|
|
377
385
|
});
|
|
378
|
-
var
|
|
379
|
-
endpointsDocumented:
|
|
380
|
-
summary:
|
|
386
|
+
var DiscoverySummarySchema2 = object({
|
|
387
|
+
endpointsDocumented: number().describe("Number of endpoints documented via document_endpoint"),
|
|
388
|
+
summary: string().describe("Brief summary of what was found")
|
|
381
389
|
});
|
|
382
|
-
var WhiteboxAttackSurfaceResultSchema =
|
|
383
|
-
repoType:
|
|
384
|
-
packageManager:
|
|
385
|
-
apps:
|
|
386
|
-
summary:
|
|
387
|
-
totalApps:
|
|
388
|
-
totalPages:
|
|
389
|
-
totalApiEndpoints:
|
|
390
|
-
totalPentestObjectives:
|
|
390
|
+
var WhiteboxAttackSurfaceResultSchema = object({
|
|
391
|
+
repoType: string().describe("Repository structure type (e.g. 'monorepo', 'single-app', 'multi-package')"),
|
|
392
|
+
packageManager: string().describe("Package manager detected (e.g. npm, yarn, pnpm, pip, cargo, go modules)"),
|
|
393
|
+
apps: array(AppSchema).describe("All applications discovered in the repository"),
|
|
394
|
+
summary: object({
|
|
395
|
+
totalApps: number(),
|
|
396
|
+
totalPages: number(),
|
|
397
|
+
totalApiEndpoints: number(),
|
|
398
|
+
totalPentestObjectives: number()
|
|
391
399
|
})
|
|
392
400
|
});
|
|
393
401
|
|
|
394
402
|
// src/core/agents/specialized/whiteboxAttackSurface/agent.ts
|
|
395
|
-
|
|
403
|
+
var SUBMIT_RESULTS_TOOL_NAME = "submit_results";
|
|
404
|
+
var WHITEBOX_MAX_STEPS = 1e4;
|
|
405
|
+
var WHITEBOX_FALLBACK_RESULT = {
|
|
406
|
+
repoType: "unknown",
|
|
407
|
+
packageManager: "unknown",
|
|
408
|
+
apps: [],
|
|
409
|
+
summary: {
|
|
410
|
+
totalApps: 0,
|
|
411
|
+
totalPages: 0,
|
|
412
|
+
totalApiEndpoints: 0,
|
|
413
|
+
totalPentestObjectives: 0
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
class WhiteboxSubmitValidationError extends Error {
|
|
418
|
+
constructor() {
|
|
419
|
+
super("Whitebox attack surface recon called submit_results but no attempt passed " + "schema validation — refusing to silently return an empty attack surface. " + "The run should be retried.");
|
|
420
|
+
this.name = "WhiteboxSubmitValidationError";
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function finalizeWhiteboxResult(capturedResult, submitAttempted) {
|
|
424
|
+
if (capturedResult !== null)
|
|
425
|
+
return capturedResult;
|
|
426
|
+
if (submitAttempted)
|
|
427
|
+
throw new WhiteboxSubmitValidationError;
|
|
428
|
+
return WHITEBOX_FALLBACK_RESULT;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
class WhiteboxAttackSurfaceAgent2 extends OffensiveSecurityAgent {
|
|
396
432
|
constructor(opts) {
|
|
397
|
-
const {
|
|
398
|
-
model,
|
|
399
|
-
codebasePath,
|
|
400
|
-
session,
|
|
401
|
-
authConfig,
|
|
402
|
-
onStepFinish,
|
|
403
|
-
abortSignal,
|
|
404
|
-
eventBus,
|
|
405
|
-
subagentId,
|
|
406
|
-
attackSurfaceRegistry,
|
|
407
|
-
domains,
|
|
408
|
-
enableThinking,
|
|
409
|
-
thinkingEffort,
|
|
410
|
-
openAIReasoningEffort
|
|
411
|
-
} = opts;
|
|
433
|
+
const { codebasePath, domains, ...base } = opts;
|
|
412
434
|
let capturedResult = null;
|
|
413
|
-
const submitResultsTool = tool({
|
|
414
|
-
description: `Submit the final whitebox attack surface analysis results.
|
|
415
|
-
|
|
416
|
-
Call this ONCE at the end with your complete structured findings.
|
|
417
|
-
This ends the agent run — make sure all data is included.`,
|
|
418
|
-
inputSchema: WhiteboxAttackSurfaceResultSchema,
|
|
419
|
-
execute: async (results) => {
|
|
420
|
-
capturedResult = results;
|
|
421
|
-
return { success: true, message: "Results submitted." };
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
435
|
super({
|
|
436
|
+
...base,
|
|
425
437
|
system: WHITEBOX_ATTACK_SURFACE_SYSTEM_PROMPT,
|
|
426
|
-
prompt: buildPrompt(codebasePath, domains, session.config?.prompt),
|
|
427
|
-
model,
|
|
428
|
-
session,
|
|
429
|
-
authConfig,
|
|
430
|
-
onStepFinish,
|
|
431
|
-
abortSignal,
|
|
432
|
-
eventBus,
|
|
433
|
-
subagentId,
|
|
434
|
-
subagentName: opts.subagentName,
|
|
435
|
-
attackSurfaceRegistry,
|
|
436
|
-
enableThinking,
|
|
437
|
-
thinkingEffort,
|
|
438
|
-
openAIReasoningEffort,
|
|
439
438
|
activeTools: [
|
|
440
439
|
"read_file",
|
|
441
440
|
"list_files",
|
|
@@ -445,26 +444,30 @@ This ends the agent run — make sure all data is included.`,
|
|
|
445
444
|
"spawn_coding_agent",
|
|
446
445
|
"submit_results"
|
|
447
446
|
],
|
|
447
|
+
stopWhen: [
|
|
448
|
+
() => capturedResult !== null,
|
|
449
|
+
stepCountIs2(WHITEBOX_MAX_STEPS)
|
|
450
|
+
],
|
|
448
451
|
extraTools: {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
apps: [],
|
|
460
|
-
summary: {
|
|
461
|
-
totalApps: 0,
|
|
462
|
-
totalPages: 0,
|
|
463
|
-
totalApiEndpoints: 0,
|
|
464
|
-
totalPentestObjectives: 0
|
|
452
|
+
...base.extraTools,
|
|
453
|
+
[SUBMIT_RESULTS_TOOL_NAME]: tool({
|
|
454
|
+
description: `Submit the final whitebox attack surface analysis results.
|
|
455
|
+
|
|
456
|
+
Call this ONCE at the end with your complete structured findings.
|
|
457
|
+
This ends the agent run — make sure all data is included.`,
|
|
458
|
+
inputSchema: WhiteboxAttackSurfaceResultSchema,
|
|
459
|
+
execute: async (results) => {
|
|
460
|
+
capturedResult = results;
|
|
461
|
+
return { success: true, message: "Results submitted." };
|
|
465
462
|
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
463
|
+
})
|
|
464
|
+
},
|
|
465
|
+
resolveResult: async (streamResult) => {
|
|
466
|
+
const steps = await streamResult.steps;
|
|
467
|
+
const submitAttempted = steps.some((step) => step.toolCalls.some((call) => call.toolName === SUBMIT_RESULTS_TOOL_NAME));
|
|
468
|
+
return finalizeWhiteboxResult(capturedResult, submitAttempted);
|
|
469
|
+
},
|
|
470
|
+
prompt: buildPrompt(codebasePath, domains, base.session.config?.prompt)
|
|
468
471
|
});
|
|
469
472
|
}
|
|
470
473
|
}
|
|
@@ -507,4 +510,4 @@ When finished, call \`submit_results\` with the complete structured output. Do N
|
|
|
507
510
|
|
|
508
511
|
Begin now.`;
|
|
509
512
|
}
|
|
510
|
-
export {
|
|
513
|
+
export { WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT2, WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT, WHITEBOX_DISCOVERY_SYSTEM_PROMPT2, EndpointSchema2, AppsDiscoveryResultSchema2, DiscoverySummarySchema2, WhiteboxAttackSurfaceAgent2 };
|