@pensar/apex 2.6.1-canary.e936ec17 → 2.6.1
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-6w7egcf1.js +13 -0
- package/build/agent-9zx75feh.js +13 -0
- package/build/{agent-t2g0e5v1.js → agent-ayreaj6z.js} +5 -5
- package/build/{agent-runs-mw4bp0n5.js → agent-runs-g37vkrjr.js} +16 -16
- package/build/{agent-x8wxd9ma.js → agent-yby11zaq.js} +6 -6
- package/build/{apps-b2x50tm7.js → apps-xn6km9yn.js} +13 -13
- package/build/{auth-0rfqyw3s.js → auth-d105wc64.js} +13 -13
- package/build/{blackboxAgent-7bapanbv.js → blackboxAgent-s56sgx9b.js} +6 -6
- package/build/{blackboxPentest-ngs99vv8.js → blackboxPentest-ps78v3w7.js} +11 -11
- package/build/{cli-tt7d70n9.js → cli-1ve18npr.js} +1 -1
- package/build/{cli-en2trtdx.js → cli-3sp6nd8d.js} +2 -2
- package/build/{cli-k594kwq8.js → cli-65g6rcat.js} +1 -1
- package/build/{cli-w9d2bnf3.js → cli-709rvekb.js} +1 -1
- package/build/{cli-rwnm0p5r.js → cli-7eea4e2y.js} +39 -7
- package/build/{cli-1b0pw0wp.js → cli-ae8jqxqr.js} +2 -2
- package/build/{cli-raavtvwt.js → cli-az3xq70v.js} +1 -1
- package/build/{cli-c2nb79ce.js → cli-c05y640n.js} +1 -1
- package/build/{cli-9d8m1qw2.js → cli-d37a42dc.js} +8 -8
- package/build/{cli-jpa3w5b4.js → cli-dpsw2fe6.js} +5 -5
- package/build/{cli-9a7b3x56.js → cli-fy6vh2a7.js} +1 -1
- package/build/{cli-72aenzba.js → cli-gx71jcke.js} +1 -1
- package/build/{cli-84qrqxjc.js → cli-k2nwxta0.js} +2 -2
- package/build/{cli-ay461rtr.js → cli-kb21qhvm.js} +2 -2
- package/build/{cli-sf6x1vjx.js → cli-n2en7j5b.js} +1 -1
- package/build/{cli-zahhskff.js → cli-ngq9dr8n.js} +3 -3
- package/build/{cli-8q41y2ss.js → cli-qgz1q9g5.js} +12 -12
- package/build/{cli-h68jfmth.js → cli-xtc2t6me.js} +3 -3
- package/build/cli.js +40 -36
- package/build/{config-8eg7v57g.js → config-zpqkd5cz.js} +1 -1
- package/build/{fastStrike-6pejawnd.js → fastStrike-mcjdvwez.js} +5 -5
- package/build/{fixes-94pbkpy6.js → fixes-kytx5dmj.js} +13 -13
- package/build/{index-xavch1zh.js → index-4vqdgb42.js} +19 -19
- package/build/{index-k3vaa38r.js → index-dr3tg1w3.js} +1 -1
- package/build/{index-g8z6kn6v.js → index-fv64eb32.js} +2 -2
- package/build/{index-bsdq9wd9.js → index-je6hcsqr.js} +1 -1
- package/build/{index-c6szs0vn.js → index-n65z6v7b.js} +6 -6
- package/build/{index-jvpmhhqm.js → index-ns4m4s01.js} +4 -4
- package/build/{index-9hnznpdk.js → index-qv4cc65p.js} +28 -14
- package/build/{index-2sc33n6h.js → index-r9yjkfrv.js} +4 -4
- package/build/{index-yt0n80v2.js → index-wqetp6gq.js} +5 -5
- package/build/{issues-hxcq3q0g.js → issues-eb3q9d3a.js} +13 -13
- package/build/knowledge-fqsvtx0f.js +139 -0
- package/build/lib/{chunk-nv32cpyc.js → chunk-1azdancq.js} +1 -1
- package/build/lib/{chunk-9yjz0ynw.js → chunk-1fy8azee.js} +1 -1
- package/build/lib/{chunk-zfp495pt.js → chunk-1jvwqnem.js} +3 -3
- package/build/lib/{chunk-dj3q3fxw.js → chunk-1yct6cra.js} +1 -1
- package/build/lib/{chunk-gt5gf7ps.js → chunk-2qsq76xq.js} +3 -3
- package/build/lib/{chunk-tjch07p0.js → chunk-3c00n0cy.js} +3 -3
- package/build/lib/{chunk-86z9yr32.js → chunk-4hwzqthr.js} +1 -1
- package/build/lib/{chunk-9jfybqs2.js → chunk-7pwa92rn.js} +1 -1
- package/build/lib/{chunk-pcpzbdnn.js → chunk-9tt2021m.js} +9 -9
- package/build/lib/{chunk-xqygd85b.js → chunk-9yksqgzr.js} +52 -13
- package/build/lib/{chunk-xw3w0xzz.js → chunk-acgbyf5h.js} +1 -1
- package/build/lib/{chunk-5wt0sejb.js → chunk-ba41jh41.js} +1 -1
- package/build/lib/{chunk-r18sc80z.js → chunk-bb0ekhkw.js} +8 -8
- package/build/lib/{chunk-shtrgm3j.js → chunk-e8yy2k73.js} +1 -1
- package/build/lib/{chunk-0z4r4r0x.js → chunk-mg03jdmt.js} +1 -1
- package/build/lib/{chunk-nhnhhnk1.js → chunk-nhfax4gb.js} +1 -1
- package/build/lib/{chunk-521eq8kw.js → chunk-r2dkp4tb.js} +1 -1
- package/build/lib/{chunk-mqftsw7s.js → chunk-r4j8ybn9.js} +3 -3
- package/build/lib/{chunk-v8p7j8br.js → chunk-v3dk9j7k.js} +11 -11
- package/build/lib/{chunk-afc4wybp.js → chunk-w66ce82a.js} +1 -1
- package/build/lib/{chunk-ydgsc09t.js → chunk-xhdpgpkm.js} +2 -2
- package/build/lib/{chunk-837ga30c.js → chunk-yrnrbjes.js} +1 -1
- package/build/lib/{chunk-m9anmxyq.js → chunk-z137x08b.js} +5 -5
- package/build/lib/{chunk-pnnj2k0n.js → chunk-z96pbjhd.js} +1 -1
- package/build/lib/core/agents/offSecAgent/index.js +7 -7
- package/build/lib/core/agents/offSecAgent/subagentSpawner.js +5 -5
- package/build/lib/core/agents/offSecAgent/tools/index.js +4 -4
- package/build/lib/core/agents/specialized/attackSurface/blackboxAgent.js +9 -9
- package/build/lib/core/agents/specialized/attackSurface/schemas.js +9 -9
- package/build/lib/core/agents/specialized/authenticationAgent/index.js +10 -10
- package/build/lib/core/agents/specialized/codeAgent/agent.js +9 -9
- package/build/lib/core/agents/specialized/findingJudge/agent.js +8 -8
- package/build/lib/core/agents/specialized/findingJudge/index.js +3 -3
- package/build/lib/core/agents/specialized/patching/index.js +10 -10
- package/build/lib/core/agents/specialized/pentest/agent.js +9 -9
- package/build/lib/core/agents/specialized/whiteboxAttackSurface/index.js +9 -9
- package/build/lib/core/ai/ai.js +2 -2
- package/build/lib/core/ai/index.js +2 -2
- package/build/lib/core/ai/utils.js +2 -2
- package/build/lib/core/api/index.d.ts +2 -0
- package/build/lib/core/api/index.js +34 -20
- package/build/lib/core/api/issues.d.ts +1 -0
- package/build/lib/core/api/knowledge.d.ts +33 -0
- package/build/lib/core/api/targetedPentest.js +10 -10
- package/build/lib/core/config/index.js +1 -1
- package/build/lib/core/findings/registry.js +3 -3
- package/build/lib/core/session/index.js +2 -2
- package/build/lib/core/session/persistence.js +3 -3
- package/build/lib/core/workflows/pentest.js +15 -15
- package/build/lib/core/workflows/seams.js +4 -4
- package/build/lib/core/workflows/whiteboxAttackSurface.js +11 -11
- package/build/lib/index.js +22 -22
- package/build/{logs-szgf3e9j.js → logs-x62b7hk1.js} +13 -13
- package/build/{native-rollout-evidence-zep91dya.js → native-rollout-evidence-c9yhfqcs.js} +3 -3
- package/build/{offesecAgent-g9a7jvmb.js → offesecAgent-5whnpeta.js} +4 -4
- package/build/pentest-e61hc38s.js +22 -0
- package/build/{pentests-pk66smvx.js → pentests-e0f32aqx.js} +21 -14
- package/build/recordedRunClient-dp032c32.js +11 -0
- package/build/{targetedPentest-t7f2vdpk.js → targetedPentest-rcbs4nvp.js} +6 -6
- package/build/{targets-5dp972y7.js → targets-xj9g3q0z.js} +13 -13
- package/build/threatModel-jkxfa40s.js +21 -0
- package/build/{uninstall-qshcasbp.js → uninstall-7s784q4a.js} +1 -1
- package/build/{upload-jy6hp68b.js → upload-4gvhwmvr.js} +4 -4
- package/build/{utils-6z5t7vq1.js → utils-cjrz64pc.js} +3 -3
- package/package.json +1 -1
- package/src/cli/knowledge.test.ts +140 -0
- package/src/cli/knowledge.ts +146 -0
- package/src/cli/pentests.test.ts +15 -0
- package/src/cli/pentests.ts +15 -1
- package/src/cli.ts +4 -0
- package/src/core/api/index.ts +15 -0
- package/src/core/api/issues.ts +1 -0
- package/src/core/api/knowledge.ts +70 -0
- package/build/agent-6pyd6vmv.js +0 -13
- package/build/agent-9wqvzg28.js +0 -13
- package/build/pentest-wx108ypq.js +0 -22
- package/build/recordedRunClient-4yx9czwe.js +0 -11
- package/build/threatModel-cxkg9kd3.js +0 -21
|
@@ -19,22 +19,29 @@ import {
|
|
|
19
19
|
searchAgentLogs2,
|
|
20
20
|
listTargetLogs2,
|
|
21
21
|
searchTargetLogs2,
|
|
22
|
+
KNOWLEDGE_CATEGORIES2,
|
|
23
|
+
KNOWLEDGE_STATUSES2,
|
|
24
|
+
listKnowledge2,
|
|
25
|
+
getKnowledge2,
|
|
26
|
+
createKnowledge2,
|
|
27
|
+
updateKnowledge2,
|
|
28
|
+
archiveKnowledge2,
|
|
22
29
|
runOffensiveSecurityAgent2,
|
|
23
30
|
createOffensiveSecurityAgentClient2,
|
|
24
31
|
runRecordedAgent2,
|
|
25
32
|
RunRecoveryBlockedError2,
|
|
26
33
|
resumeRecordedAgent2,
|
|
27
34
|
serveLocalRunWorker2
|
|
28
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-7eea4e2y.js";
|
|
29
36
|
import"./cli-xcy2vxj2.js";
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
32
|
-
import"./cli-
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
35
|
-
import"./cli-
|
|
36
|
-
import"./cli-
|
|
37
|
-
import"./cli-
|
|
37
|
+
import"./cli-d37a42dc.js";
|
|
38
|
+
import"./cli-n2en7j5b.js";
|
|
39
|
+
import"./cli-ngq9dr8n.js";
|
|
40
|
+
import"./cli-k2nwxta0.js";
|
|
41
|
+
import"./cli-3sp6nd8d.js";
|
|
42
|
+
import"./cli-xtc2t6me.js";
|
|
43
|
+
import"./cli-kb21qhvm.js";
|
|
44
|
+
import"./cli-1ve18npr.js";
|
|
38
45
|
import"./cli-qba2x69h.js";
|
|
39
46
|
import {
|
|
40
47
|
ENDPOINT_TRANSPORTS2,
|
|
@@ -52,22 +59,26 @@ import {
|
|
|
52
59
|
searchEndpoints2,
|
|
53
60
|
listDomains2,
|
|
54
61
|
createDomain2
|
|
55
|
-
} from "./cli-
|
|
56
|
-
import"./cli-
|
|
62
|
+
} from "./cli-qgz1q9g5.js";
|
|
63
|
+
import"./cli-dpsw2fe6.js";
|
|
57
64
|
import {
|
|
58
65
|
getPensarApiUrl2,
|
|
59
66
|
getPensarConsoleUrl2
|
|
60
|
-
} from "./cli-
|
|
67
|
+
} from "./cli-c05y640n.js";
|
|
61
68
|
import"./cli-c2k4xxaw.js";
|
|
62
|
-
import"./cli-
|
|
69
|
+
import"./cli-fy6vh2a7.js";
|
|
63
70
|
export {
|
|
64
71
|
CLOSED_DISPOSITIONS2 as CLOSED_DISPOSITIONS,
|
|
65
72
|
ENDPOINT_TRANSPORTS2 as ENDPOINT_TRANSPORTS,
|
|
73
|
+
KNOWLEDGE_CATEGORIES2 as KNOWLEDGE_CATEGORIES,
|
|
74
|
+
KNOWLEDGE_STATUSES2 as KNOWLEDGE_STATUSES,
|
|
66
75
|
RunRecoveryBlockedError2 as RunRecoveryBlockedError,
|
|
76
|
+
archiveKnowledge2 as archiveKnowledge,
|
|
67
77
|
createApp2 as createApp,
|
|
68
78
|
createDomain2 as createDomain,
|
|
69
79
|
createEndpoint2 as createEndpoint,
|
|
70
80
|
createIssueComment2 as createIssueComment,
|
|
81
|
+
createKnowledge2 as createKnowledge,
|
|
71
82
|
createOffensiveSecurityAgentClient2 as createOffensiveSecurityAgentClient,
|
|
72
83
|
deleteApp2 as deleteApp,
|
|
73
84
|
deleteEndpoint2 as deleteEndpoint,
|
|
@@ -76,6 +87,7 @@ export {
|
|
|
76
87
|
getEndpoint2 as getEndpoint,
|
|
77
88
|
getFix2 as getFix,
|
|
78
89
|
getIssue2 as getIssue,
|
|
90
|
+
getKnowledge2 as getKnowledge,
|
|
79
91
|
getPensarApiUrl2 as getPensarApiUrl,
|
|
80
92
|
getPensarConsoleUrl2 as getPensarConsoleUrl,
|
|
81
93
|
getScan2 as getScan,
|
|
@@ -89,6 +101,7 @@ export {
|
|
|
89
101
|
listIssueComments2 as listIssueComments,
|
|
90
102
|
listIssuePullRequests2 as listIssuePullRequests,
|
|
91
103
|
listIssues2 as listIssues,
|
|
104
|
+
listKnowledge2 as listKnowledge,
|
|
92
105
|
listPentestTargets2 as listPentestTargets,
|
|
93
106
|
listScans2 as listScans,
|
|
94
107
|
listTargetLogs2 as listTargetLogs,
|
|
@@ -103,5 +116,6 @@ export {
|
|
|
103
116
|
serveLocalRunWorker2 as serveLocalRunWorker,
|
|
104
117
|
updateApp2 as updateApp,
|
|
105
118
|
updateEndpoint2 as updateEndpoint,
|
|
106
|
-
updateIssue2 as updateIssue
|
|
119
|
+
updateIssue2 as updateIssue,
|
|
120
|
+
updateKnowledge2 as updateKnowledge
|
|
107
121
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ALL_TOOL_NAMES2,
|
|
3
3
|
SKILL_TOOL_NAMES2
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
4
|
+
} from "./cli-qgz1q9g5.js";
|
|
5
|
+
import"./cli-fy6vh2a7.js";
|
|
6
|
+
import"./cli-c05y640n.js";
|
|
7
|
+
import"./cli-dpsw2fe6.js";
|
|
8
8
|
import"./cli-c2k4xxaw.js";
|
|
9
9
|
export {
|
|
10
10
|
ALL_TOOL_NAMES2 as ALL_TOOL_NAMES,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import"./cli-
|
|
2
|
-
import"./cli-
|
|
1
|
+
import"./cli-fy6vh2a7.js";
|
|
2
|
+
import"./cli-c05y640n.js";
|
|
3
3
|
import {
|
|
4
4
|
generateRandomName,
|
|
5
5
|
generateSessionName,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
init_storage,
|
|
17
17
|
ToolsetStateSchema,
|
|
18
18
|
init_toolset
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-dpsw2fe6.js";
|
|
20
20
|
import {
|
|
21
21
|
schema,
|
|
22
22
|
descending,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
getCurrentVersion,
|
|
43
43
|
init_installation
|
|
44
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-65g6rcat.js";
|
|
45
45
|
|
|
46
46
|
// src/core/session/index.ts
|
|
47
47
|
init_zod();
|
|
@@ -336,7 +336,7 @@ async function create(input) {
|
|
|
336
336
|
} else if (input.inheritEnvironmentConfig === false) {
|
|
337
337
|
snapshotHeaders = {};
|
|
338
338
|
} else {
|
|
339
|
-
const { config: appConfig } = await import("./index-
|
|
339
|
+
const { config: appConfig } = await import("./index-dr3tg1w3.js");
|
|
340
340
|
const cfg = await appConfig.get();
|
|
341
341
|
snapshotHeaders = cfg.defaultHeaders ? { ...cfg.defaultHeaders } : { ...DEFAULT_HEADER_RECORD };
|
|
342
342
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import"./cli-
|
|
3
|
-
import"./cli-
|
|
2
|
+
import"./cli-fy6vh2a7.js";
|
|
3
|
+
import"./cli-c05y640n.js";
|
|
4
4
|
import {
|
|
5
5
|
CLOSED_DISPOSITIONS2,
|
|
6
6
|
listIssues2,
|
|
@@ -11,22 +11,22 @@ import {
|
|
|
11
11
|
retestIssue2,
|
|
12
12
|
linkPullRequest2,
|
|
13
13
|
listIssuePullRequests2
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
14
|
+
} from "./cli-7eea4e2y.js";
|
|
15
|
+
import"./cli-qgz1q9g5.js";
|
|
16
|
+
import"./cli-k2nwxta0.js";
|
|
17
|
+
import"./cli-kb21qhvm.js";
|
|
18
|
+
import"./cli-ngq9dr8n.js";
|
|
19
|
+
import"./cli-d37a42dc.js";
|
|
20
|
+
import"./cli-3sp6nd8d.js";
|
|
21
|
+
import"./cli-xtc2t6me.js";
|
|
22
|
+
import"./cli-n2en7j5b.js";
|
|
23
23
|
import"./cli-xcy2vxj2.js";
|
|
24
24
|
import {
|
|
25
25
|
markCommandFailed
|
|
26
26
|
} from "./cli-z82n3qk1.js";
|
|
27
|
-
import"./cli-
|
|
27
|
+
import"./cli-1ve18npr.js";
|
|
28
28
|
import"./cli-qba2x69h.js";
|
|
29
|
-
import"./cli-
|
|
29
|
+
import"./cli-dpsw2fe6.js";
|
|
30
30
|
import"./cli-c2k4xxaw.js";
|
|
31
31
|
|
|
32
32
|
// src/cli/issues.ts
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import"./cli-fy6vh2a7.js";
|
|
3
|
+
import"./cli-c05y640n.js";
|
|
4
|
+
import {
|
|
5
|
+
KNOWLEDGE_CATEGORIES2,
|
|
6
|
+
KNOWLEDGE_STATUSES2,
|
|
7
|
+
listKnowledge2,
|
|
8
|
+
getKnowledge2,
|
|
9
|
+
createKnowledge2,
|
|
10
|
+
updateKnowledge2,
|
|
11
|
+
archiveKnowledge2
|
|
12
|
+
} from "./cli-7eea4e2y.js";
|
|
13
|
+
import"./cli-qgz1q9g5.js";
|
|
14
|
+
import"./cli-k2nwxta0.js";
|
|
15
|
+
import"./cli-kb21qhvm.js";
|
|
16
|
+
import"./cli-ngq9dr8n.js";
|
|
17
|
+
import"./cli-d37a42dc.js";
|
|
18
|
+
import"./cli-3sp6nd8d.js";
|
|
19
|
+
import"./cli-xtc2t6me.js";
|
|
20
|
+
import"./cli-n2en7j5b.js";
|
|
21
|
+
import"./cli-xcy2vxj2.js";
|
|
22
|
+
import {
|
|
23
|
+
markCommandFailed
|
|
24
|
+
} from "./cli-z82n3qk1.js";
|
|
25
|
+
import"./cli-1ve18npr.js";
|
|
26
|
+
import"./cli-qba2x69h.js";
|
|
27
|
+
import"./cli-dpsw2fe6.js";
|
|
28
|
+
import"./cli-c2k4xxaw.js";
|
|
29
|
+
|
|
30
|
+
// src/cli/knowledge.ts
|
|
31
|
+
import { parseArgs } from "node:util";
|
|
32
|
+
function showHelp() {
|
|
33
|
+
console.log(`pensar knowledge — Read and edit the workspace knowledge base
|
|
34
|
+
|
|
35
|
+
Entries are context that agents use during pentests. A false_positive_pattern
|
|
36
|
+
entry suppresses matching findings.
|
|
37
|
+
|
|
38
|
+
Usage:
|
|
39
|
+
pensar knowledge [filters] List entries
|
|
40
|
+
pensar knowledge get <id> Get one entry
|
|
41
|
+
pensar knowledge add [options] Add an entry
|
|
42
|
+
pensar knowledge update <id> [options] Edit an entry
|
|
43
|
+
pensar knowledge archive <id> Archive an entry
|
|
44
|
+
|
|
45
|
+
Filters and options:
|
|
46
|
+
--title <text> Entry title (required for add)
|
|
47
|
+
--content <text> Entry body (required for add)
|
|
48
|
+
--category <category> ${KNOWLEDGE_CATEGORIES2.join(", ")}
|
|
49
|
+
(required for add)
|
|
50
|
+
--status <status> ${KNOWLEDGE_STATUSES2.join(", ")}
|
|
51
|
+
--tag <tags> Repeat or separate with commas; a list filter
|
|
52
|
+
matches entries carrying every tag
|
|
53
|
+
|
|
54
|
+
Adding, editing and archiving require a user login; a workspace API key can
|
|
55
|
+
only read.
|
|
56
|
+
|
|
57
|
+
Options:
|
|
58
|
+
-h, --help Show this help message`);
|
|
59
|
+
}
|
|
60
|
+
function parseCategory(value) {
|
|
61
|
+
if (value === undefined)
|
|
62
|
+
return;
|
|
63
|
+
if (!KNOWLEDGE_CATEGORIES2.includes(value)) {
|
|
64
|
+
throw new Error(`invalid --category "${value}". Accepted: ${KNOWLEDGE_CATEGORIES2.join(", ")}`);
|
|
65
|
+
}
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
function parseStatus(value) {
|
|
69
|
+
if (value === undefined)
|
|
70
|
+
return;
|
|
71
|
+
if (!KNOWLEDGE_STATUSES2.includes(value)) {
|
|
72
|
+
throw new Error(`invalid --status "${value}". Accepted: ${KNOWLEDGE_STATUSES2.join(", ")}`);
|
|
73
|
+
}
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
async function main() {
|
|
77
|
+
const args = process.argv.slice(2);
|
|
78
|
+
const sub = args[0] && !args[0].startsWith("-") ? args[0] : "list";
|
|
79
|
+
if (sub === "help" || args.includes("--help") || args.includes("-h")) {
|
|
80
|
+
showHelp();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const takesId = sub === "get" || sub === "update" || sub === "archive";
|
|
85
|
+
const id = takesId ? args[1] : undefined;
|
|
86
|
+
if (takesId && (!id || id.startsWith("-"))) {
|
|
87
|
+
throw new Error(`entry ID is required: pensar knowledge ${sub} <id>`);
|
|
88
|
+
}
|
|
89
|
+
const { values } = parseArgs({
|
|
90
|
+
args: args.slice(args[0] === sub ? takesId ? 2 : 1 : 0),
|
|
91
|
+
options: {
|
|
92
|
+
title: { type: "string" },
|
|
93
|
+
content: { type: "string" },
|
|
94
|
+
category: { type: "string" },
|
|
95
|
+
status: { type: "string" },
|
|
96
|
+
tag: { type: "string", multiple: true }
|
|
97
|
+
},
|
|
98
|
+
strict: true,
|
|
99
|
+
allowPositionals: false
|
|
100
|
+
});
|
|
101
|
+
const tags = values.tag?.flatMap((t) => t.split(",")).filter(Boolean);
|
|
102
|
+
const input = {
|
|
103
|
+
title: values.title,
|
|
104
|
+
content: values.content,
|
|
105
|
+
category: parseCategory(values.category),
|
|
106
|
+
status: parseStatus(values.status),
|
|
107
|
+
tags
|
|
108
|
+
};
|
|
109
|
+
let result;
|
|
110
|
+
if (sub === "list") {
|
|
111
|
+
result = await listKnowledge2({
|
|
112
|
+
category: input.category,
|
|
113
|
+
status: input.status,
|
|
114
|
+
tags
|
|
115
|
+
});
|
|
116
|
+
} else if (sub === "get") {
|
|
117
|
+
result = await getKnowledge2(id);
|
|
118
|
+
} else if (sub === "add") {
|
|
119
|
+
if (!input.title || !input.content || !input.category) {
|
|
120
|
+
throw new Error("--title, --content and --category are required");
|
|
121
|
+
}
|
|
122
|
+
result = await createKnowledge2(input);
|
|
123
|
+
} else if (sub === "update") {
|
|
124
|
+
result = await updateKnowledge2(id, input);
|
|
125
|
+
} else if (sub === "archive") {
|
|
126
|
+
result = await archiveKnowledge2(id);
|
|
127
|
+
} else {
|
|
128
|
+
console.error(`Error: Unknown subcommand "${sub}"`);
|
|
129
|
+
showHelp();
|
|
130
|
+
return markCommandFailed();
|
|
131
|
+
}
|
|
132
|
+
console.log(JSON.stringify(result, null, 2));
|
|
133
|
+
} catch (err) {
|
|
134
|
+
console.error(`
|
|
135
|
+
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
136
|
+
return markCommandFailed();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
await main();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLogger,
|
|
3
3
|
scopedLogger
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ba41jh41.js";
|
|
5
5
|
import {
|
|
6
6
|
isMemoryEnabled2
|
|
7
7
|
} from "./chunk-t5bt5vn1.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
REPORT_ERROR_TOOL_NAME2,
|
|
16
16
|
createReportErrorTool2,
|
|
17
17
|
PentestReportedError2
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2qsq76xq.js";
|
|
19
19
|
import {
|
|
20
20
|
GOOGLE_SIGNIN_PROMPT_GUIDANCE,
|
|
21
21
|
browserEngineForGoogleSignIn
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
AgentRuntime,
|
|
28
28
|
defineAgent
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-acgbyf5h.js";
|
|
30
30
|
|
|
31
31
|
// src/core/agents/specialized/pentest/agent.ts
|
|
32
32
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
import {
|
|
45
45
|
getCurrentVersion,
|
|
46
46
|
config2
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-w66ce82a.js";
|
|
48
48
|
import {
|
|
49
49
|
CredentialManager,
|
|
50
50
|
createLogger,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
ensureValidToken,
|
|
54
54
|
signGatewayRequest,
|
|
55
55
|
generateObjectResponse2
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-ba41jh41.js";
|
|
57
57
|
import {
|
|
58
58
|
EndpointTransportEnum2,
|
|
59
59
|
GrpcEndpointMetadataSchema2,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
} from "./chunk-zrbqn62x.js";
|
|
75
75
|
import {
|
|
76
76
|
FindingsRegistry2
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-1azdancq.js";
|
|
78
78
|
|
|
79
79
|
// src/core/agents/offSecAgent/tools/addMemory.ts
|
|
80
80
|
import { tool } from "ai";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWithNativeRolloutSession2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ba41jh41.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentEventBus2
|
|
6
6
|
} from "./chunk-7gjdygcx.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
randomSessionIdFactory2,
|
|
10
10
|
inProcessSeams2,
|
|
11
11
|
resolveItemHooks2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-yrnrbjes.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
15
|
} from "./chunk-n0ba7khr.js";
|
|
@@ -170,7 +170,7 @@ var runBlackboxChild = async (spec, ctx) => {
|
|
|
170
170
|
return { run: () => agent.consume(), drained: () => agent.drained };
|
|
171
171
|
};
|
|
172
172
|
var runAuthChild = async (spec, ctx) => {
|
|
173
|
-
const { runAuthenticationAgent } = await import("./chunk-
|
|
173
|
+
const { runAuthenticationAgent } = await import("./chunk-9tt2021m.js");
|
|
174
174
|
return {
|
|
175
175
|
run: () => runAuthenticationAgent({
|
|
176
176
|
target: spec.target,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AuthenticationAgent2,
|
|
3
3
|
runAuthenticationAgent3
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import"./chunk-
|
|
6
|
-
import"./chunk-
|
|
7
|
-
import"./chunk-
|
|
8
|
-
import"./chunk-
|
|
4
|
+
} from "./chunk-xhdpgpkm.js";
|
|
5
|
+
import"./chunk-acgbyf5h.js";
|
|
6
|
+
import"./chunk-r4j8ybn9.js";
|
|
7
|
+
import"./chunk-3c00n0cy.js";
|
|
8
|
+
import"./chunk-yrnrbjes.js";
|
|
9
9
|
import"./chunk-7gjdygcx.js";
|
|
10
10
|
import"./chunk-b8eq85d2.js";
|
|
11
|
-
import"./chunk-
|
|
11
|
+
import"./chunk-2qsq76xq.js";
|
|
12
12
|
import"./chunk-ja7j565c.js";
|
|
13
13
|
import"./chunk-3q89v4xv.js";
|
|
14
14
|
import"./chunk-fy3bbbqy.js";
|
|
15
|
-
import"./chunk-
|
|
15
|
+
import"./chunk-1azdancq.js";
|
|
16
16
|
import"./chunk-t5bt5vn1.js";
|
|
17
17
|
import"./chunk-eb4h4k1f.js";
|
|
18
18
|
import"./chunk-vx228eeq.js";
|
|
19
|
-
import"./chunk-
|
|
19
|
+
import"./chunk-ba41jh41.js";
|
|
20
20
|
import"./chunk-8vhr65w3.js";
|
|
21
21
|
import"./chunk-2njv7wz3.js";
|
|
22
22
|
import"./chunk-jdjagvgr.js";
|
|
23
|
-
import"./chunk-
|
|
23
|
+
import"./chunk-w66ce82a.js";
|
|
24
24
|
import"./chunk-zrbqn62x.js";
|
|
25
25
|
import"./chunk-mv74mq5n.js";
|
|
26
26
|
import"./chunk-q5e23acz.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCurrentVersion,
|
|
3
3
|
config2
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-w66ce82a.js";
|
|
5
5
|
import {
|
|
6
6
|
newSessionId2,
|
|
7
7
|
isSessionId2
|
|
@@ -34,12 +34,12 @@ import {
|
|
|
34
34
|
getPensarConsoleUrl2,
|
|
35
35
|
buildAuthConfig2,
|
|
36
36
|
normalizeStepUsage2
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ba41jh41.js";
|
|
38
38
|
import {
|
|
39
39
|
buildSessionWorkspaceSection2,
|
|
40
40
|
buildBaseSystemPrompt2,
|
|
41
41
|
OffensiveSecurityAgent2
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-r4j8ybn9.js";
|
|
43
43
|
import {
|
|
44
44
|
ASK_USER_QUESTIONS_TOOL_NAME2,
|
|
45
45
|
apiRequest,
|
|
@@ -62,32 +62,32 @@ import {
|
|
|
62
62
|
createDomain2,
|
|
63
63
|
ALL_TOOL_NAMES2,
|
|
64
64
|
SKILL_TOOL_NAMES2
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-2qsq76xq.js";
|
|
66
66
|
import {
|
|
67
67
|
BlackboxAttackSurfaceAgent2
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-1fy8azee.js";
|
|
69
69
|
import {
|
|
70
70
|
runWhiteboxAttackSurfaceWorkflow2
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-z137x08b.js";
|
|
72
72
|
import {
|
|
73
73
|
runAuthenticationAgent3
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-xhdpgpkm.js";
|
|
75
75
|
import {
|
|
76
76
|
readExecutionMetrics,
|
|
77
77
|
writeExecutionMetrics,
|
|
78
78
|
runPentestWorkflow2
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-v3dk9j7k.js";
|
|
80
80
|
import {
|
|
81
81
|
PatchingAgent2
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-1yct6cra.js";
|
|
83
83
|
import {
|
|
84
84
|
startAgentExecution,
|
|
85
85
|
runTargetedPentestAgent2
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-z96pbjhd.js";
|
|
87
87
|
import {
|
|
88
88
|
AgentRuntime,
|
|
89
89
|
defineAgent
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-acgbyf5h.js";
|
|
91
91
|
import {
|
|
92
92
|
__export
|
|
93
93
|
} from "./chunk-n0ba7khr.js";
|
|
@@ -98,6 +98,8 @@ __export(exports_api, {
|
|
|
98
98
|
CLOSED_DISPOSITIONS: () => CLOSED_DISPOSITIONS2,
|
|
99
99
|
DEFAULT_NATIVE_ROLLOUT_CAPTURE_LIMITS: () => DEFAULT_NATIVE_ROLLOUT_CAPTURE_LIMITS2,
|
|
100
100
|
ENDPOINT_TRANSPORTS: () => ENDPOINT_TRANSPORTS2,
|
|
101
|
+
KNOWLEDGE_CATEGORIES: () => KNOWLEDGE_CATEGORIES2,
|
|
102
|
+
KNOWLEDGE_STATUSES: () => KNOWLEDGE_STATUSES2,
|
|
101
103
|
PENSAR_API_BASE_URL: () => PENSAR_API_BASE_URL2,
|
|
102
104
|
PENSAR_CONSOLE_BASE_URL: () => PENSAR_CONSOLE_BASE_URL2,
|
|
103
105
|
RunRecoveryBlockedError: () => RunRecoveryBlockedError2,
|
|
@@ -105,10 +107,12 @@ __export(exports_api, {
|
|
|
105
107
|
VulnerabilityReproductionResultSchema: () => VulnerabilityReproductionResultSchema2,
|
|
106
108
|
VulnerabilityReproductionStepSchema: () => VulnerabilityReproductionStepSchema2,
|
|
107
109
|
VulnerabilityReproductionVerdictSchema: () => VulnerabilityReproductionVerdictSchema2,
|
|
110
|
+
archiveKnowledge: () => archiveKnowledge2,
|
|
108
111
|
createApp: () => createApp2,
|
|
109
112
|
createDomain: () => createDomain2,
|
|
110
113
|
createEndpoint: () => createEndpoint2,
|
|
111
114
|
createIssueComment: () => createIssueComment2,
|
|
115
|
+
createKnowledge: () => createKnowledge2,
|
|
112
116
|
createNativeRolloutEvidenceCapture: () => createNativeRolloutEvidenceCapture2,
|
|
113
117
|
createOffensiveSecurityAgentClient: () => createOffensiveSecurityAgentClient2,
|
|
114
118
|
deleteApp: () => deleteApp2,
|
|
@@ -119,6 +123,7 @@ __export(exports_api, {
|
|
|
119
123
|
getEndpoint: () => getEndpoint2,
|
|
120
124
|
getFix: () => getFix2,
|
|
121
125
|
getIssue: () => getIssue2,
|
|
126
|
+
getKnowledge: () => getKnowledge2,
|
|
122
127
|
getPensarApiUrl: () => getPensarApiUrl2,
|
|
123
128
|
getPensarConsoleUrl: () => getPensarConsoleUrl2,
|
|
124
129
|
getPensarGatewayUrl: () => getPensarGatewayUrl2,
|
|
@@ -135,6 +140,7 @@ __export(exports_api, {
|
|
|
135
140
|
listIssueComments: () => listIssueComments2,
|
|
136
141
|
listIssuePullRequests: () => listIssuePullRequests2,
|
|
137
142
|
listIssues: () => listIssues2,
|
|
143
|
+
listKnowledge: () => listKnowledge2,
|
|
138
144
|
listPentestTargets: () => listPentestTargets2,
|
|
139
145
|
listScans: () => listScans2,
|
|
140
146
|
listTargetLogs: () => listTargetLogs2,
|
|
@@ -160,7 +166,8 @@ __export(exports_api, {
|
|
|
160
166
|
startVulnerabilityReproductionAgent: () => startVulnerabilityReproductionAgent2,
|
|
161
167
|
updateApp: () => updateApp2,
|
|
162
168
|
updateEndpoint: () => updateEndpoint2,
|
|
163
|
-
updateIssue: () => updateIssue2
|
|
169
|
+
updateIssue: () => updateIssue2,
|
|
170
|
+
updateKnowledge: () => updateKnowledge2
|
|
164
171
|
});
|
|
165
172
|
// src/core/runtime/runEvidence.ts
|
|
166
173
|
import { createHash } from "node:crypto";
|
|
@@ -2552,6 +2559,38 @@ async function listTargetLogs2(targetId, opts) {
|
|
|
2552
2559
|
async function searchTargetLogs2(targetId, query, opts) {
|
|
2553
2560
|
return apiRequest("POST", `/targets/${targetId}/logs/search`, { query, ...opts });
|
|
2554
2561
|
}
|
|
2562
|
+
// src/core/api/knowledge.ts
|
|
2563
|
+
var KNOWLEDGE_CATEGORIES2 = [
|
|
2564
|
+
"false_positive_pattern",
|
|
2565
|
+
"technology_context",
|
|
2566
|
+
"testing_history",
|
|
2567
|
+
"user_note",
|
|
2568
|
+
"agent_learning"
|
|
2569
|
+
];
|
|
2570
|
+
var KNOWLEDGE_STATUSES2 = ["active", "stale", "archived"];
|
|
2571
|
+
async function listKnowledge2(filters) {
|
|
2572
|
+
const params = new URLSearchParams;
|
|
2573
|
+
if (filters?.category)
|
|
2574
|
+
params.set("category", filters.category);
|
|
2575
|
+
if (filters?.status)
|
|
2576
|
+
params.set("status", filters.status);
|
|
2577
|
+
if (filters?.tags?.length)
|
|
2578
|
+
params.set("tags", filters.tags.join(","));
|
|
2579
|
+
const qs = params.toString();
|
|
2580
|
+
return apiRequest("GET", `/knowledge${qs ? `?${qs}` : ""}`);
|
|
2581
|
+
}
|
|
2582
|
+
async function getKnowledge2(id) {
|
|
2583
|
+
return apiRequest("GET", `/knowledge/${id}`);
|
|
2584
|
+
}
|
|
2585
|
+
async function createKnowledge2(input) {
|
|
2586
|
+
return apiRequest("POST", "/knowledge", input);
|
|
2587
|
+
}
|
|
2588
|
+
async function updateKnowledge2(id, input) {
|
|
2589
|
+
return apiRequest("PATCH", `/knowledge/${id}`, input);
|
|
2590
|
+
}
|
|
2591
|
+
async function archiveKnowledge2(id) {
|
|
2592
|
+
return apiRequest("DELETE", `/knowledge/${id}`);
|
|
2593
|
+
}
|
|
2555
2594
|
// src/core/runtime/localRunWorker.ts
|
|
2556
2595
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
2557
2596
|
import { unlink as unlink2 } from "node:fs/promises";
|
|
@@ -7108,4 +7147,4 @@ function startVulnerabilityReproductionAgent2(input) {
|
|
|
7108
7147
|
async function runVulnerabilityReproductionAgent2(input) {
|
|
7109
7148
|
return startVulnerabilityReproductionAgent2(input).result;
|
|
7110
7149
|
}
|
|
7111
|
-
export { inspectSessionEvidence2, openSqliteRunStore2, runAttackSurfaceAgent2, runAuthenticationAgent2, runBenchmarkComparisonAgent2, runPentestAgent2, runEnvironmentAgent2, CLOSED_DISPOSITIONS2, listScans2, getScan2, listPentestTargets2, dispatchPentest2, listIssues2, getIssue2, updateIssue2, listIssueComments2, createIssueComment2, retestIssue2, linkPullRequest2, listIssuePullRequests2, listFixes2, getFix2, listAgentLogs2, searchAgentLogs2, listTargetLogs2, searchTargetLogs2, runOffensiveSecurityAgent2, createOffensiveSecurityAgentClient2, runRecordedAgent2, RunRecoveryBlockedError2, resumeRecordedAgent2, serveLocalRunWorker2, runPatchingAgent2, runThreatModelWorkflow2, TrajectoryExportError2, exportTrajectoryBundle2, VulnerabilityReproductionVerdictSchema2, VulnerabilityReproductionStepSchema2, VulnerabilityReproductionResultSchema2, startVulnerabilityReproductionAgent2, runVulnerabilityReproductionAgent2, exports_api };
|
|
7150
|
+
export { inspectSessionEvidence2, openSqliteRunStore2, runAttackSurfaceAgent2, runAuthenticationAgent2, runBenchmarkComparisonAgent2, runPentestAgent2, runEnvironmentAgent2, CLOSED_DISPOSITIONS2, listScans2, getScan2, listPentestTargets2, dispatchPentest2, listIssues2, getIssue2, updateIssue2, listIssueComments2, createIssueComment2, retestIssue2, linkPullRequest2, listIssuePullRequests2, listFixes2, getFix2, listAgentLogs2, searchAgentLogs2, listTargetLogs2, searchTargetLogs2, KNOWLEDGE_CATEGORIES2, KNOWLEDGE_STATUSES2, listKnowledge2, getKnowledge2, createKnowledge2, updateKnowledge2, archiveKnowledge2, runOffensiveSecurityAgent2, createOffensiveSecurityAgentClient2, runRecordedAgent2, RunRecoveryBlockedError2, resumeRecordedAgent2, serveLocalRunWorker2, runPatchingAgent2, runThreatModelWorkflow2, TrajectoryExportError2, exportTrajectoryBundle2, VulnerabilityReproductionVerdictSchema2, VulnerabilityReproductionStepSchema2, VulnerabilityReproductionResultSchema2, startVulnerabilityReproductionAgent2, runVulnerabilityReproductionAgent2, exports_api };
|