@pensar/apex 2.5.0-canary.2bbb0f6f → 2.5.0-canary.2fbcf53e
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-71sn1cjn.js → agent-03dzgvvr.js} +42 -43
- package/build/agent-f409nrpq.js +12 -0
- package/build/agent-vwc0mwjt.js +14 -0
- package/build/agent-z3cwtnxe.js +12 -0
- package/build/{apps-ghf7kp1s.js → apps-jhxy4z5c.js} +26 -36
- package/build/{auth-p1nrv7re.js → auth-hzh7ex0t.js} +53 -62
- package/build/blackboxAgent-jdd0y2v1.js +12 -0
- package/build/blackboxPentest-zbhzbggr.js +58 -0
- package/build/{cli-gbch9xmy.js → cli-44aw4n3f.js} +4 -4
- package/build/{cli-t7rhyqx5.js → cli-586h170q.js} +4 -4
- package/build/{cli-f47dgye3.js → cli-6a720rez.js} +9999 -7754
- package/build/cli-6x8frsp1.js +22 -0
- package/build/{cli-68260ckj.js → cli-7vby0hk6.js} +209 -209
- package/build/{cli-fw7sp0fp.js → cli-80vnzkcx.js} +118 -115
- package/build/{cli-53rm0rrz.js → cli-8w8k4dph.js} +1 -1
- package/build/{cli-3bmqdcfh.js → cli-953pqk7g.js} +2 -2
- package/build/{cli-3ew5fs3f.js → cli-as3caggc.js} +53 -81
- package/build/{cli-knd276ed.js → cli-bb02pjt0.js} +31 -31
- package/build/{cli-7sqb16dd.js → cli-dcn88vnc.js} +328 -307
- package/build/{cli-k71t434r.js → cli-ec2hwkv3.js} +34 -76
- package/build/{cli-a8n64cef.js → cli-ft24awnp.js} +132 -128
- package/build/{cli-14j00zfh.js → cli-gaxrjhm4.js} +32 -47
- package/build/{cli-bc05qbss.js → cli-h6y3bt60.js} +13 -21
- package/build/{cli-g3cb8pj5.js → cli-hhmamgyb.js} +36 -60
- package/build/{cli-4vwnsyep.js → cli-hvj9qass.js} +25623 -25480
- 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-8pk8znhw.js → cli-we90h9j5.js} +5 -5
- package/build/{cli-4mgj070h.js → cli-wxc2m46g.js} +25 -72
- package/build/{cli-ee3axgts.js → cli-xbhr5khz.js} +1 -1
- package/build/{cli-yge44bmk.js → cli-yft4vzhv.js} +43 -38
- package/build/cli.js +115 -104
- package/build/{config-cqw98n5y.js → config-gksmsn4m.js} +16 -19
- package/build/{doctor-vzh1wmfa.js → doctor-q59ver02.js} +4 -10
- package/build/{fastStrike-f441e9nr.js → fastStrike-ynywjj5x.js} +24 -29
- package/build/{fixes-xxz52cf2.js → fixes-admef6ta.js} +18 -28
- package/build/{getMachineId-bsd-xj3bn2fv.js → getMachineId-bsd-zr67nd9p.js} +5 -5
- package/build/{getMachineId-darwin-07jzjcx6.js → getMachineId-darwin-fd1d562d.js} +5 -5
- package/build/{getMachineId-linux-ahngynxd.js → getMachineId-linux-kjmg243j.js} +4 -4
- package/build/{getMachineId-unsupported-vy43b44z.js → getMachineId-unsupported-n4r58vke.js} +4 -4
- package/build/{getMachineId-win-8x66cynz.js → getMachineId-win-yzgpfsrb.js} +5 -5
- package/build/index-a1bg29j1.js +1559 -0
- package/build/{index-cbwn03kz.js → index-a2xycbjs.js} +12 -31
- package/build/index-cc61227s.js +9 -0
- package/build/index-danbbsn4.js +12 -0
- package/build/index-dh1s2k11.js +100 -0
- package/build/index-frtxkg17.js +36 -0
- package/build/{index-psqjpw5m.js → index-nweqptgs.js} +7 -7
- package/build/{index-e7kq5rrd.js → index-pdmpxecy.js} +137 -164
- package/build/{index-3gavwzay.js → index-rrm65ckn.js} +1459 -1444
- package/build/index-vabvbwvr.js +17 -0
- package/build/index-xeryf6bn.js +22 -0
- package/build/{issues-zdag9ayw.js → issues-menj9x1f.js} +22 -32
- package/build/{logs-f492cjgt.js → logs-fv27v7xd.js} +17 -27
- package/build/{multipart-parser-g2xxkezz.js → multipart-parser-vjjdbpd1.js} +10 -10
- package/build/{offesecAgent-pr0cmrqb.js → offesecAgent-px23wstx.js} +6 -14
- package/build/{parse-rtccymzn.js → parse-cqecqrc5.js} +0 -4
- package/build/pentest-m7chwg46.js +21 -0
- package/build/{pentests-vstpzh9j.js → pentests-51dx9vdr.js} +19 -29
- package/build/{targetedPentest-wj3ae355.js → targetedPentest-92vhsdp2.js} +16 -21
- package/build/{targets-806zxf1n.js → targets-pycree6c.js} +17 -27
- package/build/threatModel-f5ba44ct.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-58ak2e2v.js → uninstall-4gdmcwsx.js} +3 -3
- package/build/{upload-kkktzh83.js → upload-nws3amqn.js} +7 -14
- package/build/{utils-1sawtwbj.js → utils-df9v6s80.js} +7 -30
- package/package.json +1 -1
- package/build/agent-20hb6mg7.js +0 -20
- package/build/agent-xnrz4bhp.js +0 -30
- package/build/authentication-m1vj2f0s.js +0 -20
- package/build/blackboxAgent-hjfzgk93.js +0 -20
- package/build/blackboxPentest-9snp9gvp.js +0 -70
- package/build/cli-08fcc6d8.js +0 -414
- package/build/cli-9ya3yktn.js +0 -22
- package/build/cli-a9vq54sx.js +0 -55
- package/build/cli-avmhkjtv.js +0 -22961
- package/build/index-23jj0234.js +0 -12
- package/build/index-4v5jc2td.js +0 -39
- package/build/index-5wh7gq37.js +0 -12858
- package/build/index-fxx38nc9.js +0 -34
- package/build/index-j3dc7dks.js +0 -213
- package/build/index-yc1dnj3n.js +0 -19
- package/build/pentest-1g3fzah5.js +0 -30
- package/build/threatModel-dc4jbhkf.js +0 -29
- /package/build/{cli-c8131c4q.js → cli-0wsh8j2t.js} +0 -0
- /package/build/{cli-9pbk8m32.js → cli-ag6jtndp.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
- /package/build/{cli-7q3ae3ft.js → cli-z82n3qk1.js} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-hvj9qass.js";
|
|
4
|
+
import"./cli-6x8frsp1.js";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
init_zod,
|
|
7
|
+
stepCountIs2,
|
|
8
|
+
init_dist
|
|
9
|
+
} from "./cli-6a720rez.js";
|
|
8
10
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import"./cli-08fcc6d8.js";
|
|
11
|
+
detectOSAndEnhancePrompt
|
|
12
|
+
} from "./cli-44aw4n3f.js";
|
|
13
|
+
import"./cli-qba2x69h.js";
|
|
13
14
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-bc05qbss.js";
|
|
15
|
+
string,
|
|
16
|
+
number,
|
|
17
|
+
boolean,
|
|
18
|
+
array,
|
|
19
|
+
object,
|
|
20
|
+
_enum
|
|
21
|
+
} from "./cli-tjm77pmx.js";
|
|
22
|
+
import"./cli-qktcyj48.js";
|
|
23
23
|
|
|
24
24
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
25
25
|
init_dist();
|
|
@@ -169,17 +169,17 @@ var FINDING_TYPES = [
|
|
|
169
169
|
"informational",
|
|
170
170
|
"expected-behavior"
|
|
171
171
|
];
|
|
172
|
-
var FindingJudgeOutputSchema =
|
|
173
|
-
valid:
|
|
174
|
-
findingType:
|
|
175
|
-
confidence:
|
|
176
|
-
reasoning:
|
|
177
|
-
concerns:
|
|
178
|
-
verificationSteps:
|
|
179
|
-
toolEvidence:
|
|
180
|
-
reproducedPoc:
|
|
181
|
-
webResearchUsed:
|
|
182
|
-
limitations:
|
|
172
|
+
var FindingJudgeOutputSchema = object({
|
|
173
|
+
valid: boolean().describe("Whether the POC demonstrates a currently exploitable vulnerability that should be persisted"),
|
|
174
|
+
findingType: _enum(FINDING_TYPES).describe("Classification: 'vulnerability' for genuine security issues, 'informational' for low-risk observations worth noting, 'expected-behavior' for findings that describe intentional design decisions"),
|
|
175
|
+
confidence: number().min(0).max(1).describe("Confidence in the judgment, a decimal between 0.0 (no confidence) and 1.0 (certain)"),
|
|
176
|
+
reasoning: string().describe("Brief explanation of the key tool observations and analysis that led to this judgment"),
|
|
177
|
+
concerns: array(string()).describe("Specific concerns identified. Empty array only when the finding is a valid high-confidence vulnerability."),
|
|
178
|
+
verificationSteps: array(string()).describe("Concrete verification actions performed before deciding."),
|
|
179
|
+
toolEvidence: array(string()).describe("Specific observations from tool output or provided artifacts."),
|
|
180
|
+
reproducedPoc: boolean().describe("Whether the judge reran or independently reproduced the POC."),
|
|
181
|
+
webResearchUsed: boolean().describe("Whether web_search/get_page materially informed the judgment."),
|
|
182
|
+
limitations: array(string()).describe("Remaining verification gaps or environmental limitations.")
|
|
183
183
|
});
|
|
184
184
|
|
|
185
185
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
@@ -196,25 +196,24 @@ var FINDING_JUDGE_ACTIVE_TOOLS = [
|
|
|
196
196
|
|
|
197
197
|
class FindingJudgeAgent extends OffensiveSecurityAgent {
|
|
198
198
|
constructor(opts) {
|
|
199
|
-
const
|
|
199
|
+
const {
|
|
200
|
+
finding,
|
|
201
|
+
target: targetOpt,
|
|
202
|
+
subagentId,
|
|
203
|
+
subagentName,
|
|
204
|
+
...base
|
|
205
|
+
} = opts;
|
|
206
|
+
const target = finding.target ?? targetOpt ?? base.session.targets[0];
|
|
200
207
|
super({
|
|
208
|
+
...base,
|
|
201
209
|
system: detectOSAndEnhancePrompt(FINDING_JUDGE_SYSTEM_PROMPT),
|
|
202
|
-
prompt: buildFindingJudgePrompt({ ...opts.finding, target }),
|
|
203
|
-
model: opts.model,
|
|
204
|
-
session: opts.session,
|
|
205
|
-
target,
|
|
206
|
-
authConfig: opts.authConfig,
|
|
207
|
-
abortSignal: opts.abortSignal,
|
|
208
|
-
eventBus: opts.eventBus,
|
|
209
|
-
sandbox: opts.sandbox,
|
|
210
|
-
enableThinking: opts.enableThinking,
|
|
211
|
-
thinkingEffort: opts.thinkingEffort,
|
|
212
|
-
openAIReasoningEffort: opts.openAIReasoningEffort,
|
|
213
|
-
subagentId: opts.subagentId ?? "finding-judge",
|
|
214
|
-
subagentName: opts.subagentName ?? "Finding Judge",
|
|
215
210
|
activeTools: [...FINDING_JUDGE_ACTIVE_TOOLS],
|
|
216
211
|
responseSchema: FindingJudgeOutputSchema,
|
|
217
|
-
stopWhen:
|
|
212
|
+
stopWhen: stepCountIs2(60),
|
|
213
|
+
target,
|
|
214
|
+
prompt: buildFindingJudgePrompt({ ...finding, target }),
|
|
215
|
+
subagentId: subagentId ?? "finding-judge",
|
|
216
|
+
subagentName: subagentName ?? "Finding Judge"
|
|
218
217
|
});
|
|
219
218
|
}
|
|
220
219
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent2
|
|
3
|
+
} from "./cli-hhmamgyb.js";
|
|
4
|
+
import"./cli-qba2x69h.js";
|
|
5
|
+
import"./cli-hvj9qass.js";
|
|
6
|
+
import"./cli-44aw4n3f.js";
|
|
7
|
+
import"./cli-6a720rez.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
import"./cli-6x8frsp1.js";
|
|
10
|
+
export {
|
|
11
|
+
CodeAgent2 as CodeAgent
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TargetedPentestAgent2,
|
|
3
|
+
buildPentestSystemPrompt2
|
|
4
|
+
} from "./cli-as3caggc.js";
|
|
5
|
+
import"./cli-qba2x69h.js";
|
|
6
|
+
import"./cli-hvj9qass.js";
|
|
7
|
+
import"./cli-44aw4n3f.js";
|
|
8
|
+
import"./cli-6a720rez.js";
|
|
9
|
+
import"./cli-qktcyj48.js";
|
|
10
|
+
import"./cli-6x8frsp1.js";
|
|
11
|
+
export {
|
|
12
|
+
TargetedPentestAgent2 as TargetedPentestAgent,
|
|
13
|
+
buildPentestSystemPrompt2 as buildPentestSystemPrompt
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAuthenticationAgent2
|
|
3
|
+
} from "./cli-wxc2m46g.js";
|
|
4
|
+
import"./cli-qba2x69h.js";
|
|
5
|
+
import"./cli-hvj9qass.js";
|
|
6
|
+
import"./cli-44aw4n3f.js";
|
|
7
|
+
import"./cli-6a720rez.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
import"./cli-6x8frsp1.js";
|
|
10
|
+
export {
|
|
11
|
+
runAuthenticationAgent2 as runAuthenticationAgent
|
|
12
|
+
};
|
|
@@ -1,47 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
} from "./cli-7q3ae3ft.js";
|
|
5
|
-
import"./cli-a8n64cef.js";
|
|
6
|
-
import"./cli-9pbk8m32.js";
|
|
7
|
-
import"./cli-7sqb16dd.js";
|
|
8
|
-
import"./cli-fw7sp0fp.js";
|
|
9
|
-
import"./cli-14j00zfh.js";
|
|
10
|
-
import"./cli-3ew5fs3f.js";
|
|
11
|
-
import"./cli-yge44bmk.js";
|
|
12
|
-
import"./cli-4mgj070h.js";
|
|
13
|
-
import"./cli-g3cb8pj5.js";
|
|
14
|
-
import"./cli-9fsre5pt.js";
|
|
15
|
-
import"./cli-a9vq54sx.js";
|
|
2
|
+
import"./cli-6x8frsp1.js";
|
|
3
|
+
import"./cli-6a720rez.js";
|
|
16
4
|
import {
|
|
17
5
|
ENDPOINT_TRANSPORTS,
|
|
6
|
+
listApps,
|
|
7
|
+
getApp,
|
|
18
8
|
createApp,
|
|
19
|
-
|
|
20
|
-
createEndpoint,
|
|
9
|
+
updateApp,
|
|
21
10
|
deleteApp,
|
|
22
|
-
deleteEndpoint,
|
|
23
|
-
getApp,
|
|
24
|
-
getEndpoint,
|
|
25
|
-
listApps,
|
|
26
|
-
listDomains,
|
|
27
11
|
listEndpoints,
|
|
12
|
+
getEndpoint,
|
|
13
|
+
createEndpoint,
|
|
14
|
+
updateEndpoint,
|
|
15
|
+
deleteEndpoint,
|
|
28
16
|
searchApps,
|
|
29
17
|
searchEndpoints,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} from "./cli-
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
35
|
-
import"./cli-
|
|
36
|
-
import"./cli-
|
|
37
|
-
import"./cli-
|
|
38
|
-
import"./cli-
|
|
39
|
-
import"./cli-
|
|
40
|
-
import"./cli-
|
|
41
|
-
import"./cli-
|
|
42
|
-
import
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
listDomains,
|
|
19
|
+
createDomain
|
|
20
|
+
} from "./cli-hvj9qass.js";
|
|
21
|
+
import"./cli-44aw4n3f.js";
|
|
22
|
+
import"./cli-gaxrjhm4.js";
|
|
23
|
+
import"./cli-hhmamgyb.js";
|
|
24
|
+
import"./cli-80vnzkcx.js";
|
|
25
|
+
import"./cli-dcn88vnc.js";
|
|
26
|
+
import"./cli-wxc2m46g.js";
|
|
27
|
+
import"./cli-as3caggc.js";
|
|
28
|
+
import"./cli-yft4vzhv.js";
|
|
29
|
+
import"./cli-ft24awnp.js";
|
|
30
|
+
import {
|
|
31
|
+
markCommandFailed
|
|
32
|
+
} from "./cli-z82n3qk1.js";
|
|
33
|
+
import"./cli-qba2x69h.js";
|
|
34
|
+
import"./cli-qktcyj48.js";
|
|
45
35
|
|
|
46
36
|
// src/cli/apps.ts
|
|
47
37
|
var APPLICATION_TYPES = [
|
|
@@ -1,51 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import"./cli-9pbk8m32.js";
|
|
7
|
-
import"./cli-7sqb16dd.js";
|
|
8
|
-
import"./cli-fw7sp0fp.js";
|
|
9
|
-
import"./cli-14j00zfh.js";
|
|
10
|
-
import"./cli-3ew5fs3f.js";
|
|
11
|
-
import"./cli-yge44bmk.js";
|
|
12
|
-
import"./cli-4mgj070h.js";
|
|
13
|
-
import"./cli-g3cb8pj5.js";
|
|
14
|
-
import"./cli-9fsre5pt.js";
|
|
15
|
-
import"./cli-a9vq54sx.js";
|
|
16
|
-
import"./cli-4vwnsyep.js";
|
|
17
|
-
import"./cli-gbch9xmy.js";
|
|
18
|
-
import"./cli-fw5r7pfj.js";
|
|
19
|
-
import"./cli-c8131c4q.js";
|
|
20
|
-
import"./cli-f47dgye3.js";
|
|
3
|
+
config2,
|
|
4
|
+
init_config
|
|
5
|
+
} from "./cli-6x8frsp1.js";
|
|
21
6
|
import {
|
|
22
|
-
createWorkspaceSelection,
|
|
23
|
-
disconnect,
|
|
24
|
-
ensureValidToken,
|
|
25
|
-
fetchWorkspaces,
|
|
26
7
|
getPensarApiUrl,
|
|
27
8
|
getPensarConsoleUrl,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
9
|
+
isConnected2,
|
|
10
|
+
disconnect2,
|
|
11
|
+
startDeviceFlow2,
|
|
12
|
+
pollWorkOSToken2,
|
|
13
|
+
pollLegacyToken2,
|
|
14
|
+
ensureValidToken2,
|
|
15
|
+
fetchWorkspaces2,
|
|
16
|
+
pollForWorkspaceCreation2,
|
|
17
|
+
selectWorkspace2,
|
|
18
|
+
createWorkspaceSelection2,
|
|
19
|
+
pollWorkspaceSelection2,
|
|
20
|
+
init_auth
|
|
21
|
+
} from "./cli-6a720rez.js";
|
|
22
|
+
import"./cli-hvj9qass.js";
|
|
23
|
+
import"./cli-44aw4n3f.js";
|
|
24
|
+
import"./cli-gaxrjhm4.js";
|
|
25
|
+
import"./cli-hhmamgyb.js";
|
|
26
|
+
import"./cli-80vnzkcx.js";
|
|
27
|
+
import"./cli-dcn88vnc.js";
|
|
28
|
+
import"./cli-wxc2m46g.js";
|
|
29
|
+
import"./cli-as3caggc.js";
|
|
30
|
+
import"./cli-yft4vzhv.js";
|
|
31
|
+
import"./cli-ft24awnp.js";
|
|
39
32
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
import"./cli-
|
|
44
|
-
import"./cli-3bmqdcfh.js";
|
|
45
|
-
import"./cli-knd276ed.js";
|
|
33
|
+
markCommandFailed
|
|
34
|
+
} from "./cli-z82n3qk1.js";
|
|
35
|
+
import"./cli-qba2x69h.js";
|
|
36
|
+
import"./cli-qktcyj48.js";
|
|
46
37
|
import {
|
|
47
38
|
__require
|
|
48
|
-
} from "./cli-
|
|
39
|
+
} from "./cli-h6y3bt60.js";
|
|
49
40
|
|
|
50
41
|
// src/cli/auth.ts
|
|
51
42
|
import * as readline from "node:readline";
|
|
@@ -79,7 +70,7 @@ function prompt(question) {
|
|
|
79
70
|
});
|
|
80
71
|
}
|
|
81
72
|
async function selectWorkspaceInBrowser(apiUrl, accessToken) {
|
|
82
|
-
const selection = await
|
|
73
|
+
const selection = await createWorkspaceSelection2(apiUrl, accessToken);
|
|
83
74
|
openUrl(selection.selectionUrl);
|
|
84
75
|
console.log(`
|
|
85
76
|
You have multiple workspaces. Choose one in your browser to continue.
|
|
@@ -87,12 +78,12 @@ If the browser didn't open, visit:
|
|
|
87
78
|
${selection.selectionUrl}
|
|
88
79
|
|
|
89
80
|
Waiting for workspace selection...`);
|
|
90
|
-
return
|
|
81
|
+
return pollWorkspaceSelection2(apiUrl, accessToken, selection.selectionId);
|
|
91
82
|
}
|
|
92
83
|
async function login() {
|
|
93
|
-
const appConfig = await
|
|
94
|
-
const hasStoredCredentials =
|
|
95
|
-
const validToken = hasStoredCredentials ? await
|
|
84
|
+
const appConfig = await config2.get();
|
|
85
|
+
const hasStoredCredentials = isConnected2(appConfig);
|
|
86
|
+
const validToken = hasStoredCredentials ? await ensureValidToken2({
|
|
96
87
|
accessToken: appConfig.accessToken,
|
|
97
88
|
refreshToken: appConfig.refreshToken,
|
|
98
89
|
pensarAPIKey: appConfig.pensarAPIKey
|
|
@@ -115,7 +106,7 @@ Pensar Console — Managed Inference
|
|
|
115
106
|
Connect for usage-based AI inference. No API keys needed.
|
|
116
107
|
`);
|
|
117
108
|
const apiUrl = getPensarApiUrl();
|
|
118
|
-
const flowInfo = await
|
|
109
|
+
const flowInfo = await startDeviceFlow2(apiUrl);
|
|
119
110
|
if (flowInfo.mode === "workos") {
|
|
120
111
|
const { clientId, deviceInfo } = flowInfo;
|
|
121
112
|
openUrl(deviceInfo.verification_uri_complete);
|
|
@@ -126,13 +117,13 @@ If not, open this URL:
|
|
|
126
117
|
Your code: ${deviceInfo.user_code}
|
|
127
118
|
|
|
128
119
|
Waiting for browser authorization...`);
|
|
129
|
-
const tokens = await
|
|
120
|
+
const tokens = await pollWorkOSToken2({
|
|
130
121
|
clientId,
|
|
131
122
|
deviceCode: deviceInfo.device_code,
|
|
132
123
|
interval: deviceInfo.interval,
|
|
133
124
|
expiresIn: deviceInfo.expires_in
|
|
134
125
|
});
|
|
135
|
-
await
|
|
126
|
+
await config2.update({
|
|
136
127
|
accessToken: tokens.accessToken,
|
|
137
128
|
refreshToken: tokens.refreshToken
|
|
138
129
|
});
|
|
@@ -149,7 +140,7 @@ If not, open this URL:
|
|
|
149
140
|
Your code: ${deviceInfo.userCode}
|
|
150
141
|
|
|
151
142
|
Waiting for browser authorization...`);
|
|
152
|
-
const data = await
|
|
143
|
+
const data = await pollLegacyToken2({
|
|
153
144
|
apiUrl,
|
|
154
145
|
deviceCode: deviceInfo.deviceCode,
|
|
155
146
|
interval: deviceInfo.interval,
|
|
@@ -160,12 +151,12 @@ Waiting for browser authorization...`);
|
|
|
160
151
|
if (!apiKey) {
|
|
161
152
|
throw new Error("Pensar Console did not return an API key");
|
|
162
153
|
}
|
|
163
|
-
await
|
|
154
|
+
await config2.update({
|
|
164
155
|
pensarAPIKey: apiKey,
|
|
165
156
|
gatewaySigningKey: data.signingKey ?? null
|
|
166
157
|
});
|
|
167
158
|
if (data.workspace) {
|
|
168
|
-
await
|
|
159
|
+
await config2.update({
|
|
169
160
|
workspaceId: data.workspace.id,
|
|
170
161
|
workspaceSlug: data.workspace.slug
|
|
171
162
|
});
|
|
@@ -181,7 +172,7 @@ Waiting for browser authorization...`);
|
|
|
181
172
|
}
|
|
182
173
|
}
|
|
183
174
|
async function handleWorkspaces(apiUrl, accessToken) {
|
|
184
|
-
const wsResult = await
|
|
175
|
+
const wsResult = await fetchWorkspaces2(apiUrl, accessToken);
|
|
185
176
|
let workspaces = wsResult.workspaces;
|
|
186
177
|
const consoleUrl = wsResult.consoleUrl ?? getPensarConsoleUrl();
|
|
187
178
|
if (workspaces.length === 0) {
|
|
@@ -191,7 +182,7 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
191
182
|
`);
|
|
192
183
|
openUrl(`${consoleUrl}/create-workspace?redirect=/credits`);
|
|
193
184
|
console.log("Waiting for workspace creation...");
|
|
194
|
-
workspaces = await
|
|
185
|
+
workspaces = await pollForWorkspaceCreation2(apiUrl, accessToken);
|
|
195
186
|
}
|
|
196
187
|
let workspaceId;
|
|
197
188
|
if (workspaces.length === 1) {
|
|
@@ -203,9 +194,9 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
203
194
|
} else {
|
|
204
195
|
workspaceId = await selectWorkspaceInBrowser(apiUrl, accessToken);
|
|
205
196
|
}
|
|
206
|
-
const result = await
|
|
197
|
+
const result = await selectWorkspace2(apiUrl, accessToken, workspaceId);
|
|
207
198
|
const workspace = result.workspace;
|
|
208
|
-
await
|
|
199
|
+
await config2.update({
|
|
209
200
|
workspaceId: workspace.id,
|
|
210
201
|
workspaceSlug: workspace.slug,
|
|
211
202
|
gatewaySigningKey: result.signingKey ?? null
|
|
@@ -228,21 +219,21 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
228
219
|
console.log("\nPensar models are now available. Run `pensar` to get started.");
|
|
229
220
|
}
|
|
230
221
|
async function logout() {
|
|
231
|
-
const appConfig = await
|
|
232
|
-
if (!
|
|
222
|
+
const appConfig = await config2.get();
|
|
223
|
+
if (!isConnected2(appConfig)) {
|
|
233
224
|
console.log("Not currently connected to Pensar Console.");
|
|
234
225
|
return;
|
|
235
226
|
}
|
|
236
|
-
await
|
|
227
|
+
await disconnect2();
|
|
237
228
|
console.log("✓ Disconnected from Pensar Console.");
|
|
238
229
|
}
|
|
239
230
|
async function status() {
|
|
240
|
-
const appConfig = await
|
|
241
|
-
if (!
|
|
231
|
+
const appConfig = await config2.get();
|
|
232
|
+
if (!isConnected2(appConfig)) {
|
|
242
233
|
console.log("Not connected to Pensar Console.\n\nRun `pensar login` to connect.");
|
|
243
234
|
return;
|
|
244
235
|
}
|
|
245
|
-
const validToken = await
|
|
236
|
+
const validToken = await ensureValidToken2({
|
|
246
237
|
accessToken: appConfig.accessToken,
|
|
247
238
|
refreshToken: appConfig.refreshToken,
|
|
248
239
|
pensarAPIKey: appConfig.pensarAPIKey
|
|
@@ -260,7 +251,7 @@ async function status() {
|
|
|
260
251
|
if (res.ok) {
|
|
261
252
|
const data = await res.json();
|
|
262
253
|
if (data.workspace) {
|
|
263
|
-
await
|
|
254
|
+
await config2.update({
|
|
264
255
|
workspaceId: data.workspace.id,
|
|
265
256
|
workspaceSlug: data.workspace.slug
|
|
266
257
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent2
|
|
3
|
+
} from "./cli-gaxrjhm4.js";
|
|
4
|
+
import"./cli-qba2x69h.js";
|
|
5
|
+
import"./cli-hvj9qass.js";
|
|
6
|
+
import"./cli-44aw4n3f.js";
|
|
7
|
+
import"./cli-6a720rez.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
import"./cli-6x8frsp1.js";
|
|
10
|
+
export {
|
|
11
|
+
BlackboxAttackSurfaceAgent2 as BlackboxAttackSurfaceAgent
|
|
12
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import"./cli-6x8frsp1.js";
|
|
2
|
+
import {
|
|
3
|
+
init_ai,
|
|
4
|
+
normalizeStepUsage
|
|
5
|
+
} from "./cli-6a720rez.js";
|
|
6
|
+
import"./cli-hvj9qass.js";
|
|
7
|
+
import"./cli-44aw4n3f.js";
|
|
8
|
+
import"./cli-gaxrjhm4.js";
|
|
9
|
+
import"./cli-as3caggc.js";
|
|
10
|
+
import"./cli-yft4vzhv.js";
|
|
11
|
+
import {
|
|
12
|
+
readExecutionMetrics,
|
|
13
|
+
writeExecutionMetrics,
|
|
14
|
+
runPentestWorkflow2
|
|
15
|
+
} from "./cli-dcn88vnc.js";
|
|
16
|
+
import"./cli-hhmamgyb.js";
|
|
17
|
+
import"./cli-80vnzkcx.js";
|
|
18
|
+
import {
|
|
19
|
+
EMPTY_SESSION_TOKEN_USAGE,
|
|
20
|
+
accumulateSessionTokens
|
|
21
|
+
} from "./cli-ag6jtndp.js";
|
|
22
|
+
import"./cli-qba2x69h.js";
|
|
23
|
+
import"./cli-qktcyj48.js";
|
|
24
|
+
|
|
25
|
+
// src/core/api/blackboxPentest.ts
|
|
26
|
+
init_ai();
|
|
27
|
+
async function runPentestAgent(input) {
|
|
28
|
+
const persisted = readExecutionMetrics(input.session.rootPath)?.tokenUsage;
|
|
29
|
+
let tokenUsage = persisted ?? EMPTY_SESSION_TOKEN_USAGE;
|
|
30
|
+
const onStepFinish = async (event) => {
|
|
31
|
+
tokenUsage = accumulateSessionTokens(tokenUsage, normalizeStepUsage(event));
|
|
32
|
+
await input.onStepFinish?.(event);
|
|
33
|
+
};
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
result = await runPentestWorkflow2({
|
|
37
|
+
...input,
|
|
38
|
+
onStepFinish,
|
|
39
|
+
onCacheMetrics: input.onCacheMetrics
|
|
40
|
+
});
|
|
41
|
+
} finally {
|
|
42
|
+
writeExecutionMetrics({
|
|
43
|
+
sessionRootPath: input.session.rootPath,
|
|
44
|
+
tokenUsage
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const { findings, findingsPath, pocsPath, reportPath } = result;
|
|
48
|
+
console.log(`
|
|
49
|
+
Found ${findings.length} vulnerabilities`);
|
|
50
|
+
console.log(`Findings: ${findingsPath}`);
|
|
51
|
+
console.log(`POCs: ${pocsPath}`);
|
|
52
|
+
if (reportPath)
|
|
53
|
+
console.log(`Report: ${reportPath}`);
|
|
54
|
+
return { findings, findingsPath, pocsPath, reportPath };
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
runPentestAgent
|
|
58
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
scopedLogger,
|
|
3
3
|
init_lazyLogger,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./cli-
|
|
4
|
+
createLogger,
|
|
5
|
+
init_structured
|
|
6
|
+
} from "./cli-6a720rez.js";
|
|
7
7
|
|
|
8
8
|
// src/core/agents/specialized/utils.ts
|
|
9
9
|
import { execSync } from "node:child_process";
|