@pensar/apex 1.8.0 → 1.8.2-canary.fb75c486
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 +11 -0
- package/build/agent-6dj1qm50.js +221 -0
- package/build/agent-6xr8vpgm.js +28 -0
- package/build/agent-x1htbpe3.js +22 -0
- package/build/apps-t0gmwc7z.js +446 -0
- package/build/{auth-dxjgy41e.js → auth-p4r1m7xq.js} +50 -13
- package/build/authentication-je2b0c3w.js +22 -0
- package/build/blackboxAgent-a4jnt0y5.js +22 -0
- package/build/{blackboxPentest-8ps4yvbk.js → blackboxPentest-b5741n3h.js} +19 -17
- package/build/{cli-y61d9433.js → cli-0tnv1vkp.js} +138 -38
- package/build/{cli-jg7r7y5n.js → cli-4xb21y6g.js} +30 -2
- package/build/{cli-k0tckznm.js → cli-6p7d2k55.js} +39701 -31695
- package/build/cli-87zakjb2.js +17 -0
- package/build/{authentication-e30mfzbe.js → cli-8frjr68r.js} +11 -18
- package/build/cli-8xknm7d9.js +204 -0
- package/build/cli-9egg9azd.js +22 -0
- package/build/cli-9fsre5pt.js +0 -0
- package/build/cli-abbka8n3.js +501 -0
- package/build/{cli-3y0dgy56.js → cli-c8131c4q.js} +2 -2
- package/build/cli-e08r86zk.js +24 -0
- package/build/{cli-0ghkg3w6.js → cli-e6rgwtpb.js} +19950 -18556
- package/build/cli-g5h24ny8.js +197 -0
- package/build/{cli-nr1cjfr9.js → cli-gtcd5c3f.js} +26 -7
- package/build/cli-k0730f59.js +52 -0
- package/build/{cli-tp1tqn3k.js → cli-mswm4k81.js} +1 -1
- package/build/{cli-m788e4f3.js → cli-q8dfq25x.js} +584 -33
- package/build/cli-rhry8mat.js +7213 -0
- package/build/{cli-g8t710ew.js → cli-ryy39d77.js} +253 -250
- package/build/cli-s1nckt4k.js +20 -0
- package/build/{cli-k4hrygff.js → cli-v9ds4jb8.js} +9 -5
- package/build/{cli-dqt80sw3.js → cli-w5990vr6.js} +199 -68
- package/build/{cli-3w2syxpv.js → cli-wfmdch3r.js} +102695 -104816
- package/build/cli.js +351 -280
- package/build/config-3bvtf3j8.js +188 -0
- package/build/{doctor-8tva8j99.js → doctor-2bkpddws.js} +1 -1
- package/build/{fixes-q5bhgxhc.js → fixes-60k3ts71.js} +23 -4
- package/build/{index-pfee23kv.js → index-0gp3x2r8.js} +19306 -18954
- package/build/index-861hkebg.js +12 -0
- package/build/{index-y5xpp21a.js → index-acc00eq4.js} +77 -108
- package/build/index-acdgrqa0.js +36 -0
- package/build/{index-e898mdyh.js → index-cfberehw.js} +4 -2
- package/build/{index-wfeb2gcc.js → index-hxn4rk8f.js} +9 -11
- package/build/{index-dw1xbhfn.js → index-vc29b21w.js} +161 -26
- package/build/index-vwt27stc.js +184 -0
- package/build/{issues-qbmdneej.js → issues-1bynat5q.js} +33 -9
- package/build/{logs-xm5vbymy.js → logs-e78vx2dy.js} +23 -4
- package/build/{main-3d7dfdvs.js → main-3zneyg7p.js} +93 -17
- package/build/{offesecAgent-re6kt2ff.js → offesecAgent-w9m0svwk.js} +14 -11
- package/build/parse-15kqmy2v.js +207 -0
- package/build/pentest-gpvqpvmd.js +31 -0
- package/build/{pentests-e3rj5845.js → pentests-nq7wa8yb.js} +36 -17
- package/build/{targetedPentest-fs0v570s.js → targetedPentest-fjxqn089.js} +15 -12
- package/build/threatModel-9yqx7d7x.js +29 -0
- package/build/{uninstall-qb2xbh2t.js → uninstall-9zbf4cwc.js} +6 -4
- package/build/{utils-jf52rmrb.js → utils-dh1t2r1e.js} +13 -10
- package/package.json +86 -88
- package/build/agent-4d8j2jsw.js +0 -278
- package/build/agent-z2s6h7n2.js +0 -19
- package/build/blackboxAgent-j9pczwym.js +0 -19
- package/build/cli-03z6pswp.js +0 -1423
- package/build/cli-0fy9j5dw.js +0 -61
- package/build/cli-asyas1xb.js +0 -110
- package/build/cli-dj1dgw2n.js +0 -190
- package/build/cli-q7r2sth7.js +0 -103
- package/build/cli-vkwch0bc.js +0 -1207
- package/build/cli-wr7g9qcr.js +0 -645
- package/build/index-bz6f8jry.js +0 -32
- package/build/pentest-mfm4hake.js +0 -29
- package/build/projects-qk22qcbt.js +0 -35
- package/build/threatModel-xfvc6cch.js +0 -67
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm
|
|
3
|
+
} from "./cli-8rxa073f.js";
|
|
4
|
+
|
|
5
|
+
// package.json
|
|
6
|
+
var package_default;
|
|
7
|
+
var init_package = __esm(() => {
|
|
8
|
+
package_default = {
|
|
9
|
+
author: "Pensar",
|
|
10
|
+
bin: {
|
|
11
|
+
pensar: "./bin/pensar.js"
|
|
12
|
+
},
|
|
13
|
+
dependencies: {
|
|
14
|
+
"@ai-sdk/amazon-bedrock": "^4.0.113",
|
|
15
|
+
"@ai-sdk/anthropic": "^3.0.81",
|
|
16
|
+
"@ai-sdk/google": "^3.0.37",
|
|
17
|
+
"@ai-sdk/openai": "3.0.46",
|
|
18
|
+
"@ai-sdk/openai-compatible": "^2.0.35",
|
|
19
|
+
"@ai-sdk/provider": "^3.0.8",
|
|
20
|
+
"@daytonaio/sdk": "^0.112.1",
|
|
21
|
+
"@googleapis/gmail": "^16.1.1",
|
|
22
|
+
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
23
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
24
|
+
"@openrouter/ai-sdk-provider": "^2.2.3",
|
|
25
|
+
"@opentelemetry/api": "^1.9.0",
|
|
26
|
+
"@opentui/core": "^0.1.107",
|
|
27
|
+
"@opentui/react": "^0.1.107",
|
|
28
|
+
"@pensar/surface": "0.2.1",
|
|
29
|
+
"@playwright/mcp": "^0.0.54",
|
|
30
|
+
ai: "^6.0.105",
|
|
31
|
+
glob: "^13.0.0",
|
|
32
|
+
"highlight.js": "^11.11.1",
|
|
33
|
+
imapflow: "^1.2.10",
|
|
34
|
+
mailparser: "^3.9.3",
|
|
35
|
+
marked: "^16.4.0",
|
|
36
|
+
"mime-types": "^3.0.2",
|
|
37
|
+
nodemailer: "^8.0.7",
|
|
38
|
+
"p-limit": "^7.2.0",
|
|
39
|
+
react: "^19.2.0",
|
|
40
|
+
sharp: "^0.34.4",
|
|
41
|
+
tldts: "^7.0.28",
|
|
42
|
+
yaml: "^2.8.2",
|
|
43
|
+
zod: "^3.25.76"
|
|
44
|
+
},
|
|
45
|
+
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
46
|
+
devDependencies: {
|
|
47
|
+
"@biomejs/biome": "2.4.14",
|
|
48
|
+
"@types/bun": "^1.3.0",
|
|
49
|
+
"@types/mailparser": "^3.4.6",
|
|
50
|
+
"@types/mime-types": "^3.0.1",
|
|
51
|
+
"@types/nodemailer": "^8.0.0",
|
|
52
|
+
"@types/react": "^19.2.6",
|
|
53
|
+
dotenv: "^17.2.3",
|
|
54
|
+
knip: "^6.12.0",
|
|
55
|
+
prettier: "^3.8.1",
|
|
56
|
+
vitest: "^2.1.8"
|
|
57
|
+
},
|
|
58
|
+
engines: {
|
|
59
|
+
bun: ">=1.0.0",
|
|
60
|
+
node: ">=18.0.0"
|
|
61
|
+
},
|
|
62
|
+
files: [
|
|
63
|
+
"build",
|
|
64
|
+
"bin",
|
|
65
|
+
"assets",
|
|
66
|
+
"pensar.svg",
|
|
67
|
+
"LICENSE"
|
|
68
|
+
],
|
|
69
|
+
keywords: [
|
|
70
|
+
"penetration-testing",
|
|
71
|
+
"security",
|
|
72
|
+
"pentesting",
|
|
73
|
+
"ai",
|
|
74
|
+
"cli",
|
|
75
|
+
"terminal",
|
|
76
|
+
"tui"
|
|
77
|
+
],
|
|
78
|
+
license: "MIT",
|
|
79
|
+
main: "build/cli.js",
|
|
80
|
+
module: "src/tui/index.tsx",
|
|
81
|
+
name: "@pensar/apex",
|
|
82
|
+
optionalDependencies: {
|
|
83
|
+
weave: "^0.12.1"
|
|
84
|
+
},
|
|
85
|
+
packageManager: "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
|
86
|
+
peerDependencies: {
|
|
87
|
+
typescript: "^5.9.3"
|
|
88
|
+
},
|
|
89
|
+
repository: {
|
|
90
|
+
type: "git",
|
|
91
|
+
url: "https://github.com/pensarai/apex.git"
|
|
92
|
+
},
|
|
93
|
+
scripts: {
|
|
94
|
+
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",
|
|
95
|
+
"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",
|
|
96
|
+
"build:binary": "bun run generate:ascii && bun build src/cli.ts --compile --outfile pensar",
|
|
97
|
+
"build:binary:linux-arm64": "bun build src/cli.ts --compile --target=bun-linux-arm64 --outfile dist/pensar-linux-arm64",
|
|
98
|
+
"build:binary:linux-x64": "bun build src/cli.ts --compile --target=bun-linux-x64 --outfile dist/pensar-linux-x64",
|
|
99
|
+
"build:binary:macos-arm64": "bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile dist/pensar-darwin-arm64",
|
|
100
|
+
"build:binary:macos-x64": "bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile dist/pensar-darwin-x64",
|
|
101
|
+
check: "biome check --write",
|
|
102
|
+
"check:ci": "biome check",
|
|
103
|
+
"daytona-benchmark": "bun run scripts/daytona-benchmark.ts",
|
|
104
|
+
dev: "bun run scripts/watch.ts",
|
|
105
|
+
"dev:debug": "SHOW_CONSOLE=true bun run scripts/watch.ts",
|
|
106
|
+
format: 'biome check --write && prettier --write "**/*.{md,yml,yaml}"',
|
|
107
|
+
"format:check": 'biome check && prettier --check "**/*.{md,yml,yaml}"',
|
|
108
|
+
"generate:ascii": "bun run scripts/generate-ascii-art.ts",
|
|
109
|
+
"generate:models": "bun run scripts/generate-models.ts",
|
|
110
|
+
knip: "knip",
|
|
111
|
+
lint: "biome lint src/",
|
|
112
|
+
"lint:fix": "biome lint --write src/",
|
|
113
|
+
"local-benchmark": "bun run scripts/local-benchmark.ts",
|
|
114
|
+
pensar: "node bin/pensar.js",
|
|
115
|
+
prepublishOnly: "npm run build",
|
|
116
|
+
start: "bun run src/tui/index.tsx",
|
|
117
|
+
test: "vitest run",
|
|
118
|
+
"test:watch": "vitest",
|
|
119
|
+
tsc: "tsc --noEmit"
|
|
120
|
+
},
|
|
121
|
+
type: "module",
|
|
122
|
+
version: "1.8.2-canary.fb75c486"
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// src/core/installation/index.ts
|
|
127
|
+
import { spawnSync } from "child_process";
|
|
128
|
+
function getCurrentVersion() {
|
|
129
|
+
return package_default.version;
|
|
130
|
+
}
|
|
131
|
+
function isNewerVersion(current, latest) {
|
|
132
|
+
const parse = (v) => v.split(".").map((n) => parseInt(n, 10) || 0);
|
|
133
|
+
const c = parse(current);
|
|
134
|
+
const l = parse(latest);
|
|
135
|
+
for (let i = 0;i < Math.max(c.length, l.length); i++) {
|
|
136
|
+
const cv = c[i] ?? 0;
|
|
137
|
+
const lv = l[i] ?? 0;
|
|
138
|
+
if (lv > cv)
|
|
139
|
+
return true;
|
|
140
|
+
if (lv < cv)
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
async function getLatestVersion() {
|
|
146
|
+
const res = await fetch("https://registry.npmjs.org/@pensar/apex/latest");
|
|
147
|
+
if (!res.ok)
|
|
148
|
+
throw new Error(`Failed to fetch latest version: ${res.statusText}`);
|
|
149
|
+
const data = await res.json();
|
|
150
|
+
return String(data.version);
|
|
151
|
+
}
|
|
152
|
+
function detectInstallMethod() {
|
|
153
|
+
const execPath = process.execPath;
|
|
154
|
+
const argv1 = process.argv[1] ?? "";
|
|
155
|
+
if (execPath.includes("homebrew") || execPath.includes("Cellar") || execPath.includes("linuxbrew") || argv1.includes("homebrew") || argv1.includes("Cellar")) {
|
|
156
|
+
return "homebrew";
|
|
157
|
+
}
|
|
158
|
+
if (argv1.includes("node_modules") || argv1.includes(".npm") || argv1.includes("npx")) {
|
|
159
|
+
return "npm";
|
|
160
|
+
}
|
|
161
|
+
const execName = execPath.split("/").pop()?.replace(/\.exe$/, "") ?? "";
|
|
162
|
+
const isInterpreter = execName === "bun" || execName === "node" || execName === "bun-debug";
|
|
163
|
+
if (!isInterpreter) {
|
|
164
|
+
return "binary";
|
|
165
|
+
}
|
|
166
|
+
const npmCheck = spawnSync("npm", ["list", "-g", "@pensar/apex", "--depth=0"], {
|
|
167
|
+
encoding: "utf-8",
|
|
168
|
+
timeout: 1e4
|
|
169
|
+
});
|
|
170
|
+
if (npmCheck.status === 0 && npmCheck.stdout?.includes("@pensar/apex")) {
|
|
171
|
+
return "npm";
|
|
172
|
+
}
|
|
173
|
+
return "binary";
|
|
174
|
+
}
|
|
175
|
+
async function checkForUpdate() {
|
|
176
|
+
const currentVersion = getCurrentVersion();
|
|
177
|
+
let latestVersion;
|
|
178
|
+
try {
|
|
179
|
+
latestVersion = await getLatestVersion();
|
|
180
|
+
} catch {
|
|
181
|
+
return {
|
|
182
|
+
updateAvailable: false,
|
|
183
|
+
currentVersion,
|
|
184
|
+
latestVersion: currentVersion
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
updateAvailable: isNewerVersion(currentVersion, latestVersion),
|
|
189
|
+
currentVersion,
|
|
190
|
+
latestVersion
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
var init_installation = __esm(() => {
|
|
194
|
+
init_package();
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
export { init_package, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
getCurrentVersion
|
|
3
|
-
|
|
2
|
+
getCurrentVersion,
|
|
3
|
+
init_installation
|
|
4
|
+
} from "./cli-g5h24ny8.js";
|
|
5
|
+
import {
|
|
6
|
+
__esm
|
|
7
|
+
} from "./cli-8rxa073f.js";
|
|
4
8
|
|
|
5
9
|
// src/core/config/config.ts
|
|
10
|
+
import fs from "fs/promises";
|
|
6
11
|
import os from "os";
|
|
7
12
|
import path from "path";
|
|
8
|
-
import fs from "fs/promises";
|
|
9
|
-
var DEFAULT_CONFIG = {
|
|
10
|
-
responsibleUseAccepted: false
|
|
11
|
-
};
|
|
12
13
|
async function init() {
|
|
13
14
|
const folder = path.join(os.homedir(), ".pensar");
|
|
14
15
|
const file = path.join(folder, "config.json");
|
|
@@ -23,11 +24,21 @@ async function init() {
|
|
|
23
24
|
const version = getCurrentVersion();
|
|
24
25
|
return { ...DEFAULT_CONFIG, version };
|
|
25
26
|
}
|
|
27
|
+
function parseBoolEnv(value) {
|
|
28
|
+
if (value === undefined || value === "")
|
|
29
|
+
return;
|
|
30
|
+
const normalized = value.trim().toLowerCase();
|
|
31
|
+
if (["0", "false", "no", "off"].includes(normalized))
|
|
32
|
+
return false;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
26
35
|
function applyEnvFallbacks(parsedConfig) {
|
|
27
36
|
const version = getCurrentVersion();
|
|
28
37
|
return {
|
|
29
38
|
...parsedConfig,
|
|
30
39
|
responsibleUseAccepted: parsedConfig.responsibleUseAccepted ?? false,
|
|
40
|
+
defaultHeaders: parsedConfig.defaultHeaders ?? DEFAULT_CONFIG.defaultHeaders,
|
|
41
|
+
surfaceIntegrationEnabled: parsedConfig.surfaceIntegrationEnabled ?? parseBoolEnv(process.env.PENSAR_SURFACE_INTEGRATION),
|
|
31
42
|
version,
|
|
32
43
|
openAiAPIKey: parsedConfig.openAiAPIKey ?? process.env.OPENAI_API_KEY,
|
|
33
44
|
anthropicAPIKey: parsedConfig.anthropicAPIKey ?? process.env.ANTHROPIC_API_KEY,
|
|
@@ -62,5 +73,13 @@ async function update(config) {
|
|
|
62
73
|
const newConfig = { ...currentConfig, ...config };
|
|
63
74
|
await fs.writeFile(file, JSON.stringify(newConfig));
|
|
64
75
|
}
|
|
76
|
+
var DEFAULT_CONFIG;
|
|
77
|
+
var init_config = __esm(() => {
|
|
78
|
+
init_installation();
|
|
79
|
+
DEFAULT_CONFIG = {
|
|
80
|
+
responsibleUseAccepted: false,
|
|
81
|
+
defaultHeaders: { "User-Agent": "pensar-apex" }
|
|
82
|
+
};
|
|
83
|
+
});
|
|
65
84
|
|
|
66
|
-
export { init, get, update };
|
|
85
|
+
export { init, get, update, init_config };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CweEntrySchema,
|
|
3
|
+
ValidatedCweEntrySchema
|
|
4
|
+
} from "./cli-wfmdch3r.js";
|
|
5
|
+
import {
|
|
6
|
+
exports_external1 as exports_external,
|
|
7
|
+
init_zod
|
|
8
|
+
} from "./cli-e6rgwtpb.js";
|
|
9
|
+
|
|
10
|
+
// src/core/agents/offSecAgent/types.ts
|
|
11
|
+
init_zod();
|
|
12
|
+
|
|
13
|
+
// src/lib/evidence/types.ts
|
|
14
|
+
init_zod();
|
|
15
|
+
var EvidenceFileEntrySchema = exports_external.object({
|
|
16
|
+
path: exports_external.string(),
|
|
17
|
+
type: exports_external.enum(["http-response", "screenshot", "poc-output", "raw-evidence"]),
|
|
18
|
+
description: exports_external.string()
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// src/core/agents/offSecAgent/types.ts
|
|
22
|
+
var ApexFindingObject = exports_external.object({
|
|
23
|
+
title: exports_external.string(),
|
|
24
|
+
severity: exports_external.preprocess((val) => {
|
|
25
|
+
if (typeof val === "string") {
|
|
26
|
+
const upper = val.toUpperCase();
|
|
27
|
+
if (upper.includes("CRITICAL"))
|
|
28
|
+
return "CRITICAL";
|
|
29
|
+
if (upper.includes("HIGH"))
|
|
30
|
+
return "HIGH";
|
|
31
|
+
if (upper.includes("MEDIUM"))
|
|
32
|
+
return "MEDIUM";
|
|
33
|
+
if (upper.includes("LOW"))
|
|
34
|
+
return "LOW";
|
|
35
|
+
}
|
|
36
|
+
return val;
|
|
37
|
+
}, exports_external.enum(["CRITICAL", "HIGH", "MEDIUM", "LOW"])),
|
|
38
|
+
description: exports_external.string(),
|
|
39
|
+
impact: exports_external.string(),
|
|
40
|
+
evidence: exports_external.string(),
|
|
41
|
+
endpoint: exports_external.string(),
|
|
42
|
+
pocPath: exports_external.string(),
|
|
43
|
+
remediation: exports_external.string(),
|
|
44
|
+
references: exports_external.string().optional(),
|
|
45
|
+
toolCallDescription: exports_external.string().optional(),
|
|
46
|
+
cwes: exports_external.array(ValidatedCweEntrySchema.or(CweEntrySchema)).optional(),
|
|
47
|
+
rootCauseGroup: exports_external.string().optional(),
|
|
48
|
+
relatedFindings: exports_external.array(exports_external.string()).optional(),
|
|
49
|
+
evidenceFiles: exports_external.array(EvidenceFileEntrySchema).optional()
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { EvidenceFileEntrySchema, ApexFindingObject };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/core/agents/specialized/utils.ts
|
|
2
|
-
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
3
2
|
import { execSync } from "child_process";
|
|
3
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
4
4
|
|
|
5
5
|
// src/core/assets/wordlists.ts
|
|
6
6
|
import { existsSync, readFileSync, statSync } from "fs";
|