@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,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_ai,
|
|
3
|
+
init_models,
|
|
4
|
+
init_utils
|
|
5
|
+
} from "./cli-6p7d2k55.js";
|
|
6
|
+
import {
|
|
7
|
+
__esm
|
|
8
|
+
} from "./cli-8rxa073f.js";
|
|
9
|
+
|
|
10
|
+
// src/core/ai/index.ts
|
|
11
|
+
var init_ai2 = __esm(() => {
|
|
12
|
+
init_ai();
|
|
13
|
+
init_models();
|
|
14
|
+
init_utils();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { init_ai2 as init_ai };
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-wfmdch3r.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-g8t710ew.js";
|
|
8
|
-
import"./cli-3y0dgy56.js";
|
|
6
|
+
} from "./cli-mswm4k81.js";
|
|
9
7
|
import {
|
|
10
|
-
hasToolCall
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import"./cli-dqt80sw3.js";
|
|
14
|
-
import"./cli-asyas1xb.js";
|
|
15
|
-
import"./cli-gpnb45ck.js";
|
|
16
|
-
import"./cli-nr1cjfr9.js";
|
|
17
|
-
import"./cli-dj1dgw2n.js";
|
|
18
|
-
import"./cli-03z6pswp.js";
|
|
19
|
-
import"./cli-8rxa073f.js";
|
|
8
|
+
hasToolCall,
|
|
9
|
+
init_dist
|
|
10
|
+
} from "./cli-6p7d2k55.js";
|
|
20
11
|
|
|
21
12
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
13
|
+
init_dist();
|
|
22
14
|
import { existsSync, readFileSync } from "fs";
|
|
23
15
|
import { join } from "path";
|
|
24
16
|
|
|
@@ -178,7 +170,8 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
178
170
|
subagentId,
|
|
179
171
|
context,
|
|
180
172
|
environmentVariables,
|
|
181
|
-
enableThinking
|
|
173
|
+
enableThinking,
|
|
174
|
+
openAIReasoningEffort
|
|
182
175
|
} = opts;
|
|
183
176
|
const cm = session.credentialManager;
|
|
184
177
|
super({
|
|
@@ -194,6 +187,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
194
187
|
subagentId,
|
|
195
188
|
environmentVariables,
|
|
196
189
|
enableThinking,
|
|
190
|
+
openAIReasoningEffort,
|
|
197
191
|
toolChoice: "auto",
|
|
198
192
|
activeTools: [
|
|
199
193
|
"execute_command",
|
|
@@ -317,6 +311,5 @@ Authentication ${result.success ? "succeeded" : "failed"}: ${result.summary}`);
|
|
|
317
311
|
|
|
318
312
|
// src/core/api/authentication.ts
|
|
319
313
|
var runAuthenticationAgent2 = runAuthenticationAgent;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
};
|
|
314
|
+
|
|
315
|
+
export { runAuthenticationAgent2 as runAuthenticationAgent };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "./cli-8rxa073f.js";
|
|
4
|
+
|
|
5
|
+
// src/core/http/parse.ts
|
|
6
|
+
var NAME_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
7
|
+
var NAME_CHAR = /[!#$%&'*+\-.^_`|~0-9A-Za-z]/;
|
|
8
|
+
function stripCurlPrefix(input) {
|
|
9
|
+
let s = input.trim();
|
|
10
|
+
if (s.startsWith("-H="))
|
|
11
|
+
s = s.slice(3);
|
|
12
|
+
else if (s.startsWith("--header="))
|
|
13
|
+
s = s.slice(9);
|
|
14
|
+
else if (s.startsWith("-H "))
|
|
15
|
+
s = s.slice(3);
|
|
16
|
+
else if (s.startsWith("--header "))
|
|
17
|
+
s = s.slice(9);
|
|
18
|
+
s = s.trim();
|
|
19
|
+
if (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'")) {
|
|
20
|
+
s = s.slice(1, -1);
|
|
21
|
+
}
|
|
22
|
+
return s;
|
|
23
|
+
}
|
|
24
|
+
function parseHeaderLine(input) {
|
|
25
|
+
const raw = stripCurlPrefix(input);
|
|
26
|
+
const colonIdx = raw.indexOf(":");
|
|
27
|
+
if (colonIdx === -1) {
|
|
28
|
+
return { ok: false, error: { kind: "missing-colon", input } };
|
|
29
|
+
}
|
|
30
|
+
const rawName = raw.slice(0, colonIdx);
|
|
31
|
+
const rawValue = raw.slice(colonIdx + 1);
|
|
32
|
+
const name = rawName.trim();
|
|
33
|
+
if (name.length === 0) {
|
|
34
|
+
return { ok: false, error: { kind: "empty-name", input } };
|
|
35
|
+
}
|
|
36
|
+
if (/\s/.test(name)) {
|
|
37
|
+
return { ok: false, error: { kind: "name-has-whitespace", input } };
|
|
38
|
+
}
|
|
39
|
+
if (!NAME_TOKEN.test(name)) {
|
|
40
|
+
for (let i = 0;i < name.length; i++) {
|
|
41
|
+
if (!NAME_CHAR.test(name[i])) {
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
error: {
|
|
45
|
+
kind: "invalid-name-char",
|
|
46
|
+
input,
|
|
47
|
+
position: i,
|
|
48
|
+
char: name[i]
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const value = rawValue.replace(/^\s+/, "").replace(/\s+$/, "");
|
|
55
|
+
for (let i = 0;i < value.length; i++) {
|
|
56
|
+
const code = value.charCodeAt(i);
|
|
57
|
+
if (code === 13 || code === 10) {
|
|
58
|
+
return {
|
|
59
|
+
ok: false,
|
|
60
|
+
error: { kind: "crlf-in-value", input, position: i }
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (code < 32 && code !== 9) {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
error: { kind: "control-char-in-value", input, position: i }
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
ok: true,
|
|
72
|
+
value: { name, value }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function parseHeaderList(input) {
|
|
76
|
+
const lines = input.split(/\r?\n/);
|
|
77
|
+
const entries = [];
|
|
78
|
+
const errors = [];
|
|
79
|
+
const seenKeys = new Map;
|
|
80
|
+
for (let i = 0;i < lines.length; i++) {
|
|
81
|
+
const line = lines[i];
|
|
82
|
+
const trimmed = line.trim();
|
|
83
|
+
if (trimmed.length === 0)
|
|
84
|
+
continue;
|
|
85
|
+
if (trimmed.startsWith("#"))
|
|
86
|
+
continue;
|
|
87
|
+
const parsed = parseHeaderLine(line);
|
|
88
|
+
if (!parsed.ok) {
|
|
89
|
+
errors.push(parsed.error);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const canonical = parsed.value.name.toLowerCase();
|
|
93
|
+
const firstAt = seenKeys.get(canonical);
|
|
94
|
+
if (firstAt !== undefined) {
|
|
95
|
+
errors.push({
|
|
96
|
+
kind: "duplicate-key-in-bulk",
|
|
97
|
+
key: parsed.value.name,
|
|
98
|
+
firstAt,
|
|
99
|
+
secondAt: i
|
|
100
|
+
});
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
seenKeys.set(canonical, i);
|
|
104
|
+
entries.push(parsed.value);
|
|
105
|
+
}
|
|
106
|
+
if (errors.length > 0) {
|
|
107
|
+
return { ok: false, error: errors };
|
|
108
|
+
}
|
|
109
|
+
return { ok: true, value: entries };
|
|
110
|
+
}
|
|
111
|
+
function parseHeaderRecord(record) {
|
|
112
|
+
const lines = Object.entries(record).map(([k, v]) => `${k}: ${v}`);
|
|
113
|
+
return parseHeaderList(lines.join(`
|
|
114
|
+
`));
|
|
115
|
+
}
|
|
116
|
+
async function parseHeadersFromFile(filePath) {
|
|
117
|
+
const fs = await import("fs/promises");
|
|
118
|
+
let raw;
|
|
119
|
+
try {
|
|
120
|
+
raw = await fs.readFile(filePath, "utf-8");
|
|
121
|
+
} catch (e) {
|
|
122
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
123
|
+
return {
|
|
124
|
+
ok: false,
|
|
125
|
+
error: [{ kind: "file-read-failed", path: filePath, message: msg }]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const firstNonWs = raw.match(/\S/);
|
|
129
|
+
if (firstNonWs && firstNonWs[0] === "{") {
|
|
130
|
+
try {
|
|
131
|
+
const obj = JSON.parse(raw);
|
|
132
|
+
if (typeof obj !== "object" || obj === null || Array.isArray(obj) || Object.values(obj).some((v) => typeof v !== "string")) {
|
|
133
|
+
return {
|
|
134
|
+
ok: false,
|
|
135
|
+
error: [
|
|
136
|
+
{
|
|
137
|
+
kind: "invalid-json",
|
|
138
|
+
input: raw,
|
|
139
|
+
message: "expected a flat object of string values"
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return parseHeaderRecord(obj);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
147
|
+
return {
|
|
148
|
+
ok: false,
|
|
149
|
+
error: [{ kind: "invalid-json", input: raw, message: msg }]
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return parseHeaderList(raw);
|
|
154
|
+
}
|
|
155
|
+
function hintFor(error) {
|
|
156
|
+
switch (error.kind) {
|
|
157
|
+
case "missing-colon":
|
|
158
|
+
return "header name and value must be separated by a colon (Name: Value)";
|
|
159
|
+
case "empty-name":
|
|
160
|
+
return "header name cannot be empty — got a bare colon";
|
|
161
|
+
case "name-has-whitespace":
|
|
162
|
+
return "header names cannot contain whitespace — did you mean to use a hyphen?";
|
|
163
|
+
case "invalid-name-char":
|
|
164
|
+
return `'${error.char}' is not allowed in header names (use letters, digits, hyphens, or any of !#$%&'*+-.^_\`|~)`;
|
|
165
|
+
case "control-char-in-value":
|
|
166
|
+
return "header values cannot contain control characters (CR, LF, NUL, etc.)";
|
|
167
|
+
case "crlf-in-value":
|
|
168
|
+
return "header values cannot contain CR/LF (HTTP header injection risk)";
|
|
169
|
+
case "duplicate-key-in-bulk":
|
|
170
|
+
return `'${error.key}' was set twice in this batch — keep only one (later value would win)`;
|
|
171
|
+
case "invalid-json":
|
|
172
|
+
return 'expected a JSON object like {"X-API-Key": "abc"} with string values only';
|
|
173
|
+
case "file-read-failed":
|
|
174
|
+
return `could not read ${error.path}`;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function formatParseError(error) {
|
|
178
|
+
const hint = hintFor(error);
|
|
179
|
+
switch (error.kind) {
|
|
180
|
+
case "missing-colon":
|
|
181
|
+
case "empty-name":
|
|
182
|
+
case "name-has-whitespace":
|
|
183
|
+
return `reason: ${error.kind}
|
|
184
|
+
hint: ${hint}`;
|
|
185
|
+
case "invalid-name-char":
|
|
186
|
+
return `reason: ${error.kind} at position ${error.position} ('${error.char}')
|
|
187
|
+
hint: ${hint}`;
|
|
188
|
+
case "control-char-in-value":
|
|
189
|
+
case "crlf-in-value":
|
|
190
|
+
return `reason: ${error.kind} at position ${error.position}
|
|
191
|
+
hint: ${hint}`;
|
|
192
|
+
case "duplicate-key-in-bulk":
|
|
193
|
+
return `reason: duplicate key '${error.key}' (lines ${error.firstAt + 1} and ${error.secondAt + 1})
|
|
194
|
+
hint: ${hint}`;
|
|
195
|
+
case "invalid-json":
|
|
196
|
+
return `reason: ${error.kind}: ${error.message}
|
|
197
|
+
hint: ${hint}`;
|
|
198
|
+
case "file-read-failed":
|
|
199
|
+
return `reason: file-read-failed: ${error.message}
|
|
200
|
+
hint: ${hint}`;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export { parseHeaderLine, parseHeadersFromFile, formatParseError };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
get,
|
|
3
|
+
init,
|
|
4
|
+
init_config,
|
|
5
|
+
update
|
|
6
|
+
} from "./cli-gtcd5c3f.js";
|
|
7
|
+
import {
|
|
8
|
+
__esm
|
|
9
|
+
} from "./cli-8rxa073f.js";
|
|
10
|
+
|
|
11
|
+
// src/core/config/index.ts
|
|
12
|
+
var config;
|
|
13
|
+
var init_config2 = __esm(() => {
|
|
14
|
+
init_config();
|
|
15
|
+
config = {
|
|
16
|
+
get,
|
|
17
|
+
init,
|
|
18
|
+
update
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { config, init_config2 as init_config };
|
|
File without changes
|