@pensar/apex 2.2.0 → 2.3.0

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.
Files changed (54) hide show
  1. package/build/agent-71z4e7jg.js +19 -0
  2. package/build/{agent-yayy5x2a.js → agent-9xna7jhw.js} +7 -7
  3. package/build/{agent-q5hwjdtb.js → agent-ga5fecfs.js} +9 -9
  4. package/build/{apps-0es69e2s.js → apps-43pqbz7r.js} +16 -16
  5. package/build/{auth-q73k9bh9.js → auth-c1z670rx.js} +32 -39
  6. package/build/authentication-hgs7ym0m.js +19 -0
  7. package/build/blackboxAgent-gem3mxa9.js +19 -0
  8. package/build/{blackboxPentest-h28nykk5.js → blackboxPentest-tgc2t3y6.js} +14 -14
  9. package/build/{cli-n114n8mk.js → cli-50906d27.js} +2 -2
  10. package/build/{cli-2jn8104w.js → cli-72b18z0n.js} +2 -2
  11. package/build/{cli-s43t5ay0.js → cli-7tw4xfnw.js} +1 -1
  12. package/build/{cli-7e5ad5js.js → cli-baqhqbe5.js} +2 -2
  13. package/build/{cli-1f636vzd.js → cli-barsn8br.js} +1 -1
  14. package/build/{cli-vgg6h2ax.js → cli-bnkgdywr.js} +1 -1
  15. package/build/{cli-1re2kv5v.js → cli-bv2807tj.js} +3 -3
  16. package/build/{cli-7n43wz82.js → cli-eveg9djy.js} +4 -2
  17. package/build/{cli-1cf5vy5m.js → cli-f71s6kcw.js} +58 -26
  18. package/build/{cli-51dkmt5p.js → cli-f7hanqbw.js} +1 -1
  19. package/build/{cli-knqx15w6.js → cli-j0n189ee.js} +2 -2
  20. package/build/{cli-ptzy9ak5.js → cli-jyp2c6th.js} +1 -1
  21. package/build/{cli-xbdn034b.js → cli-n2m2yy5b.js} +3983 -55
  22. package/build/{cli-4tc6888c.js → cli-vckbhnyk.js} +51 -2
  23. package/build/{cli-xpn9tsw0.js → cli-zk1ch6qf.js} +3 -3
  24. package/build/{cli-tz9yg4ew.js → cli-zm8tfpv7.js} +8 -8
  25. package/build/{cli-6kx46ck0.js → cli-zx8gk8xv.js} +19 -6
  26. package/build/cli.js +33 -33
  27. package/build/{config-xcf7rc6x.js → config-jzqjz606.js} +3 -3
  28. package/build/{doctor-98zperf9.js → doctor-q3qws68e.js} +6 -6
  29. package/build/{fastStrike-9tm6bedh.js → fastStrike-ebz1ph9a.js} +9 -9
  30. package/build/{fixes-1dry8j61.js → fixes-86yebsj0.js} +16 -16
  31. package/build/{index-31rwrakh.js → index-32hn8rrw.js} +2 -2
  32. package/build/{index-4hqbyzf5.js → index-468j74f3.js} +8 -8
  33. package/build/{index-f6ttv7np.js → index-8db1d2q3.js} +9 -5
  34. package/build/{index-0j880wqc.js → index-97vx1a24.js} +1080 -898
  35. package/build/{index-34h2nb6x.js → index-ag14v3sg.js} +3 -3
  36. package/build/{index-6dbym5jy.js → index-e8c8zcrf.js} +21 -8
  37. package/build/{index-pxwwcefn.js → index-mr2cseg4.js} +9 -9
  38. package/build/{issues-wjakj8yy.js → issues-kh4wg8c5.js} +44 -16
  39. package/build/{logs-ewyzcspy.js → logs-bj28xmbf.js} +16 -16
  40. package/build/{offesecAgent-7m9smy0t.js → offesecAgent-8ky7gccp.js} +8 -8
  41. package/build/pentest-rs0181nf.js +29 -0
  42. package/build/{pentests-1hcqjyk2.js → pentests-62d6zw6p.js} +16 -16
  43. package/build/{targetedPentest-3x13kqvc.js → targetedPentest-me4jnr3z.js} +9 -9
  44. package/build/{targets-nqz8w37e.js → targets-e5k1mrky.js} +16 -16
  45. package/build/threatModel-k4f3zgqd.js +27 -0
  46. package/build/{uninstall-p1q5pkx2.js → uninstall-jt1bca2p.js} +1 -1
  47. package/build/{upload-x7etpfp4.js → upload-krd8bnex.js} +6 -6
  48. package/build/{utils-kw6yh5yn.js → utils-skmqhyfg.js} +5 -5
  49. package/package.json +1 -1
  50. package/build/agent-3cdfwxcd.js +0 -19
  51. package/build/authentication-tqx2brcv.js +0 -19
  52. package/build/blackboxAgent-d0smgqt7.js +0 -19
  53. package/build/pentest-1cb5t0dt.js +0 -29
  54. package/build/threatModel-7f02av7y.js +0 -27
@@ -0,0 +1,19 @@
1
+ import {
2
+ CodeAgent
3
+ } from "./cli-j0n189ee.js";
4
+ import"./cli-9fsre5pt.js";
5
+ import"./cli-jyp2c6th.js";
6
+ import"./cli-n2m2yy5b.js";
7
+ import"./cli-7tw4xfnw.js";
8
+ import"./cli-c8131c4q.js";
9
+ import"./cli-zx8gk8xv.js";
10
+ import"./cli-vckbhnyk.js";
11
+ import"./cli-3k1x5rn3.js";
12
+ import"./cli-gpnb45ck.js";
13
+ import"./cli-f7hanqbw.js";
14
+ import"./cli-eveg9djy.js";
15
+ import"./cli-barsn8br.js";
16
+ import"./cli-8rxa073f.js";
17
+ export {
18
+ CodeAgent
19
+ };
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-xbdn034b.js";
3
+ } from "./cli-n2m2yy5b.js";
4
4
  import {
5
5
  detectOSAndEnhancePrompt
6
- } from "./cli-s43t5ay0.js";
6
+ } from "./cli-7tw4xfnw.js";
7
7
  import"./cli-c8131c4q.js";
8
8
  import {
9
9
  init_dist,
10
10
  stepCountIs
11
- } from "./cli-6kx46ck0.js";
12
- import"./cli-4tc6888c.js";
11
+ } from "./cli-zx8gk8xv.js";
12
+ import"./cli-vckbhnyk.js";
13
13
  import {
14
14
  exports_external,
15
15
  init_zod
16
16
  } from "./cli-3k1x5rn3.js";
17
17
  import"./cli-gpnb45ck.js";
18
- import"./cli-51dkmt5p.js";
19
- import"./cli-7n43wz82.js";
20
- import"./cli-1f636vzd.js";
18
+ import"./cli-f7hanqbw.js";
19
+ import"./cli-eveg9djy.js";
20
+ import"./cli-barsn8br.js";
21
21
  import"./cli-8rxa073f.js";
22
22
 
23
23
  // src/core/agents/specialized/findingJudge/agent.ts
@@ -4,19 +4,19 @@ import {
4
4
  buildPentestActiveTools,
5
5
  buildPentestPrompt,
6
6
  buildPentestSystemPrompt
7
- } from "./cli-n114n8mk.js";
7
+ } from "./cli-50906d27.js";
8
8
  import"./cli-9fsre5pt.js";
9
- import"./cli-ptzy9ak5.js";
10
- import"./cli-xbdn034b.js";
11
- import"./cli-s43t5ay0.js";
9
+ import"./cli-jyp2c6th.js";
10
+ import"./cli-n2m2yy5b.js";
11
+ import"./cli-7tw4xfnw.js";
12
12
  import"./cli-c8131c4q.js";
13
- import"./cli-6kx46ck0.js";
14
- import"./cli-4tc6888c.js";
13
+ import"./cli-zx8gk8xv.js";
14
+ import"./cli-vckbhnyk.js";
15
15
  import"./cli-3k1x5rn3.js";
16
16
  import"./cli-gpnb45ck.js";
17
- import"./cli-51dkmt5p.js";
18
- import"./cli-7n43wz82.js";
19
- import"./cli-1f636vzd.js";
17
+ import"./cli-f7hanqbw.js";
18
+ import"./cli-eveg9djy.js";
19
+ import"./cli-barsn8br.js";
20
20
  import"./cli-8rxa073f.js";
21
21
  export {
22
22
  buildPentestSystemPrompt,
@@ -12,27 +12,27 @@ import {
12
12
  searchEndpoints,
13
13
  updateApp,
14
14
  updateEndpoint
15
- } from "./cli-1cf5vy5m.js";
16
- import"./cli-tz9yg4ew.js";
17
- import"./cli-1re2kv5v.js";
18
- import"./cli-2jn8104w.js";
19
- import"./cli-n114n8mk.js";
20
- import"./cli-xpn9tsw0.js";
21
- import"./cli-knqx15w6.js";
22
- import"./cli-7e5ad5js.js";
15
+ } from "./cli-f71s6kcw.js";
16
+ import"./cli-zm8tfpv7.js";
17
+ import"./cli-bv2807tj.js";
18
+ import"./cli-72b18z0n.js";
19
+ import"./cli-50906d27.js";
20
+ import"./cli-zk1ch6qf.js";
21
+ import"./cli-j0n189ee.js";
22
+ import"./cli-baqhqbe5.js";
23
23
  import"./cli-9fsre5pt.js";
24
- import"./cli-ptzy9ak5.js";
25
- import"./cli-xbdn034b.js";
26
- import"./cli-s43t5ay0.js";
24
+ import"./cli-jyp2c6th.js";
25
+ import"./cli-n2m2yy5b.js";
26
+ import"./cli-7tw4xfnw.js";
27
27
  import"./cli-fw5r7pfj.js";
28
28
  import"./cli-c8131c4q.js";
29
- import"./cli-6kx46ck0.js";
30
- import"./cli-4tc6888c.js";
29
+ import"./cli-zx8gk8xv.js";
30
+ import"./cli-vckbhnyk.js";
31
31
  import"./cli-3k1x5rn3.js";
32
32
  import"./cli-gpnb45ck.js";
33
- import"./cli-51dkmt5p.js";
34
- import"./cli-7n43wz82.js";
35
- import"./cli-1f636vzd.js";
33
+ import"./cli-f7hanqbw.js";
34
+ import"./cli-eveg9djy.js";
35
+ import"./cli-barsn8br.js";
36
36
  import"./cli-8rxa073f.js";
37
37
 
38
38
  // src/cli/apps.ts
@@ -1,20 +1,21 @@
1
1
  #!/usr/bin/env bun
2
- import"./cli-1cf5vy5m.js";
3
- import"./cli-tz9yg4ew.js";
4
- import"./cli-1re2kv5v.js";
5
- import"./cli-2jn8104w.js";
6
- import"./cli-n114n8mk.js";
7
- import"./cli-xpn9tsw0.js";
8
- import"./cli-knqx15w6.js";
9
- import"./cli-7e5ad5js.js";
2
+ import"./cli-f71s6kcw.js";
3
+ import"./cli-zm8tfpv7.js";
4
+ import"./cli-bv2807tj.js";
5
+ import"./cli-72b18z0n.js";
6
+ import"./cli-50906d27.js";
7
+ import"./cli-zk1ch6qf.js";
8
+ import"./cli-j0n189ee.js";
9
+ import"./cli-baqhqbe5.js";
10
10
  import"./cli-9fsre5pt.js";
11
- import"./cli-ptzy9ak5.js";
12
- import"./cli-xbdn034b.js";
13
- import"./cli-s43t5ay0.js";
11
+ import"./cli-jyp2c6th.js";
12
+ import"./cli-n2m2yy5b.js";
13
+ import"./cli-7tw4xfnw.js";
14
14
  import"./cli-fw5r7pfj.js";
15
15
  import"./cli-c8131c4q.js";
16
- import"./cli-6kx46ck0.js";
16
+ import"./cli-zx8gk8xv.js";
17
17
  import {
18
+ createWorkspaceSelection,
18
19
  disconnect,
19
20
  fetchWorkspaces,
20
21
  getPensarApiUrl,
@@ -24,17 +25,18 @@ import {
24
25
  pollForWorkspaceCreation,
25
26
  pollLegacyToken,
26
27
  pollWorkOSToken,
28
+ pollWorkspaceSelection,
27
29
  selectWorkspace,
28
30
  startDeviceFlow
29
- } from "./cli-4tc6888c.js";
31
+ } from "./cli-vckbhnyk.js";
30
32
  import"./cli-3k1x5rn3.js";
31
33
  import"./cli-gpnb45ck.js";
32
34
  import {
33
35
  config,
34
36
  init_config
35
- } from "./cli-51dkmt5p.js";
36
- import"./cli-7n43wz82.js";
37
- import"./cli-1f636vzd.js";
37
+ } from "./cli-f7hanqbw.js";
38
+ import"./cli-eveg9djy.js";
39
+ import"./cli-barsn8br.js";
38
40
  import {
39
41
  __require
40
42
  } from "./cli-8rxa073f.js";
@@ -70,26 +72,16 @@ function prompt(question) {
70
72
  });
71
73
  });
72
74
  }
73
- async function promptWorkspaceSelection(workspaces) {
75
+ async function selectWorkspaceInBrowser(apiUrl, accessToken) {
76
+ const selection = await createWorkspaceSelection(apiUrl, accessToken);
77
+ openUrl(selection.selectionUrl);
74
78
  console.log(`
75
- Select a workspace:
76
- `);
77
- workspaces.forEach((ws, i) => {
78
- console.log(` ${i + 1}. ${ws.name} (${ws.slug}) — $${ws.balance.toFixed(2)}`);
79
- });
80
- const answer = await prompt(`
81
- Enter number (1-${workspaces.length}): `);
82
- const index = parseInt(answer, 10) - 1;
83
- if (Number.isNaN(index) || index < 0 || index >= workspaces.length) {
84
- console.error("Invalid selection.");
85
- process.exit(1);
86
- }
87
- const workspace = workspaces[index];
88
- if (!workspace) {
89
- console.error("Invalid selection.");
90
- process.exit(1);
91
- }
92
- return workspace;
79
+ You have multiple workspaces. Choose one in your browser to continue.
80
+ If the browser didn't open, visit:
81
+ ${selection.selectionUrl}
82
+
83
+ Waiting for workspace selection...`);
84
+ return pollWorkspaceSelection(apiUrl, accessToken, selection.selectionId);
93
85
  }
94
86
  async function login() {
95
87
  const appConfig = await config.get();
@@ -187,17 +179,18 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
187
179
  console.log("Waiting for workspace creation...");
188
180
  workspaces = await pollForWorkspaceCreation(apiUrl, accessToken);
189
181
  }
190
- let workspace;
182
+ let workspaceId;
191
183
  if (workspaces.length === 1) {
192
184
  const onlyWorkspace = workspaces[0];
193
185
  if (!onlyWorkspace) {
194
186
  throw new Error("No workspace available after workspace lookup");
195
187
  }
196
- workspace = onlyWorkspace;
188
+ workspaceId = onlyWorkspace.id;
197
189
  } else {
198
- workspace = await promptWorkspaceSelection(workspaces);
190
+ workspaceId = await selectWorkspaceInBrowser(apiUrl, accessToken);
199
191
  }
200
- const result = await selectWorkspace(apiUrl, accessToken, workspace.id);
192
+ const result = await selectWorkspace(apiUrl, accessToken, workspaceId);
193
+ const workspace = result.workspace;
201
194
  await config.update({
202
195
  workspaceId: workspace.id,
203
196
  workspaceSlug: workspace.slug,
@@ -0,0 +1,19 @@
1
+ import {
2
+ runAuthenticationAgent
3
+ } from "./cli-zk1ch6qf.js";
4
+ import"./cli-9fsre5pt.js";
5
+ import"./cli-jyp2c6th.js";
6
+ import"./cli-n2m2yy5b.js";
7
+ import"./cli-7tw4xfnw.js";
8
+ import"./cli-c8131c4q.js";
9
+ import"./cli-zx8gk8xv.js";
10
+ import"./cli-vckbhnyk.js";
11
+ import"./cli-3k1x5rn3.js";
12
+ import"./cli-gpnb45ck.js";
13
+ import"./cli-f7hanqbw.js";
14
+ import"./cli-eveg9djy.js";
15
+ import"./cli-barsn8br.js";
16
+ import"./cli-8rxa073f.js";
17
+ export {
18
+ runAuthenticationAgent
19
+ };
@@ -0,0 +1,19 @@
1
+ import {
2
+ BlackboxAttackSurfaceAgent
3
+ } from "./cli-bv2807tj.js";
4
+ import"./cli-9fsre5pt.js";
5
+ import"./cli-jyp2c6th.js";
6
+ import"./cli-n2m2yy5b.js";
7
+ import"./cli-7tw4xfnw.js";
8
+ import"./cli-c8131c4q.js";
9
+ import"./cli-zx8gk8xv.js";
10
+ import"./cli-vckbhnyk.js";
11
+ import"./cli-3k1x5rn3.js";
12
+ import"./cli-gpnb45ck.js";
13
+ import"./cli-f7hanqbw.js";
14
+ import"./cli-eveg9djy.js";
15
+ import"./cli-barsn8br.js";
16
+ import"./cli-8rxa073f.js";
17
+ export {
18
+ BlackboxAttackSurfaceAgent
19
+ };
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  runPentestWorkflow
3
- } from "./cli-tz9yg4ew.js";
4
- import"./cli-1re2kv5v.js";
5
- import"./cli-2jn8104w.js";
6
- import"./cli-n114n8mk.js";
7
- import"./cli-knqx15w6.js";
8
- import"./cli-7e5ad5js.js";
3
+ } from "./cli-zm8tfpv7.js";
4
+ import"./cli-bv2807tj.js";
5
+ import"./cli-72b18z0n.js";
6
+ import"./cli-50906d27.js";
7
+ import"./cli-j0n189ee.js";
8
+ import"./cli-baqhqbe5.js";
9
9
  import"./cli-9fsre5pt.js";
10
- import"./cli-ptzy9ak5.js";
11
- import"./cli-xbdn034b.js";
12
- import"./cli-s43t5ay0.js";
10
+ import"./cli-jyp2c6th.js";
11
+ import"./cli-n2m2yy5b.js";
12
+ import"./cli-7tw4xfnw.js";
13
13
  import"./cli-fw5r7pfj.js";
14
14
  import"./cli-c8131c4q.js";
15
- import"./cli-6kx46ck0.js";
16
- import"./cli-4tc6888c.js";
15
+ import"./cli-zx8gk8xv.js";
16
+ import"./cli-vckbhnyk.js";
17
17
  import"./cli-3k1x5rn3.js";
18
18
  import"./cli-gpnb45ck.js";
19
- import"./cli-51dkmt5p.js";
20
- import"./cli-7n43wz82.js";
21
- import"./cli-1f636vzd.js";
19
+ import"./cli-f7hanqbw.js";
20
+ import"./cli-eveg9djy.js";
21
+ import"./cli-barsn8br.js";
22
22
  import"./cli-8rxa073f.js";
23
23
 
24
24
  // src/core/api/blackboxPentest.ts
@@ -5,7 +5,7 @@ import {
5
5
  createReportErrorTool,
6
6
  isMemoryEnabled,
7
7
  readPlan
8
- } from "./cli-xbdn034b.js";
8
+ } from "./cli-n2m2yy5b.js";
9
9
  import {
10
10
  createLogger,
11
11
  hasToolCall,
@@ -13,7 +13,7 @@ import {
13
13
  init_lazyLogger,
14
14
  init_structured,
15
15
  scopedLogger
16
- } from "./cli-6kx46ck0.js";
16
+ } from "./cli-zx8gk8xv.js";
17
17
  import {
18
18
  exports_external,
19
19
  init_zod
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  EvidenceFileEntrySchema
3
- } from "./cli-ptzy9ak5.js";
3
+ } from "./cli-jyp2c6th.js";
4
4
  import {
5
5
  CweEntrySchema,
6
6
  ValidatedCweEntrySchema,
7
7
  hasCanonicalName
8
- } from "./cli-xbdn034b.js";
8
+ } from "./cli-n2m2yy5b.js";
9
9
  import {
10
10
  exports_external,
11
11
  init_zod
@@ -3,7 +3,7 @@ import {
3
3
  init_lazyLogger,
4
4
  init_structured,
5
5
  scopedLogger
6
- } from "./cli-6kx46ck0.js";
6
+ } from "./cli-zx8gk8xv.js";
7
7
 
8
8
  // src/core/agents/specialized/utils.ts
9
9
  import { execSync } from "node:child_process";
@@ -2,11 +2,11 @@ import {
2
2
  EndpointTransportEnum,
3
3
  GrpcEndpointMetadataSchema,
4
4
  OffensiveSecurityAgent
5
- } from "./cli-xbdn034b.js";
5
+ } from "./cli-n2m2yy5b.js";
6
6
  import {
7
7
  hasToolCall,
8
8
  init_dist
9
- } from "./cli-6kx46ck0.js";
9
+ } from "./cli-zx8gk8xv.js";
10
10
  import {
11
11
  exports_external,
12
12
  init_zod,
@@ -120,7 +120,7 @@ var init_package = __esm(() => {
120
120
  tsc: "tsc --noEmit"
121
121
  },
122
122
  type: "module",
123
- version: "2.2.0"
123
+ version: "2.3.0"
124
124
  };
125
125
  });
126
126
 
@@ -3,7 +3,7 @@ import {
3
3
  init_lazyLogger,
4
4
  init_structured,
5
5
  scopedLogger
6
- } from "./cli-6kx46ck0.js";
6
+ } from "./cli-zx8gk8xv.js";
7
7
 
8
8
  // src/core/integrations/wandb/client.ts
9
9
  init_structured();
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-xbdn034b.js";
3
+ } from "./cli-n2m2yy5b.js";
4
4
  import {
5
5
  detectOSAndEnhancePrompt
6
- } from "./cli-s43t5ay0.js";
6
+ } from "./cli-7tw4xfnw.js";
7
7
  import {
8
8
  hasToolCall,
9
9
  init_dist,
10
10
  stepCountIs
11
- } from "./cli-6kx46ck0.js";
11
+ } from "./cli-zx8gk8xv.js";
12
12
 
13
13
  // src/core/agents/specialized/attackSurface/blackboxAgent.ts
14
14
  init_dist();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getCurrentVersion,
3
3
  init_installation
4
- } from "./cli-1f636vzd.js";
4
+ } from "./cli-barsn8br.js";
5
5
  import {
6
6
  __esm
7
7
  } from "./cli-8rxa073f.js";
@@ -38,6 +38,7 @@ function applyEnvFallbacks(parsedConfig) {
38
38
  ...parsedConfig,
39
39
  responsibleUseAccepted: parsedConfig.responsibleUseAccepted ?? false,
40
40
  defaultHeaders: parsedConfig.defaultHeaders ?? DEFAULT_CONFIG.defaultHeaders,
41
+ strikeMode: parsedConfig.strikeMode ?? DEFAULT_CONFIG.strikeMode,
41
42
  surfaceIntegrationEnabled: parsedConfig.surfaceIntegrationEnabled ?? parseBoolEnv(process.env.PENSAR_SURFACE_INTEGRATION),
42
43
  version,
43
44
  openAiAPIKey: parsedConfig.openAiAPIKey ?? process.env.OPENAI_API_KEY,
@@ -78,7 +79,8 @@ var init_config = __esm(() => {
78
79
  init_installation();
79
80
  DEFAULT_CONFIG = {
80
81
  responsibleUseAccepted: false,
81
- defaultHeaders: { "User-Agent": "pensar-apex" }
82
+ defaultHeaders: { "User-Agent": "pensar-apex" },
83
+ strikeMode: false
82
84
  };
83
85
  });
84
86
 
@@ -4,19 +4,19 @@ import {
4
4
  OffensiveSecurityAgent,
5
5
  SKILL_TOOL_NAMES,
6
6
  buildBaseSystemPrompt
7
- } from "./cli-xbdn034b.js";
7
+ } from "./cli-n2m2yy5b.js";
8
8
  import {
9
9
  init_dist,
10
10
  init_session,
11
11
  sessions,
12
12
  stepCountIs
13
- } from "./cli-6kx46ck0.js";
13
+ } from "./cli-zx8gk8xv.js";
14
14
  import {
15
15
  ensureValidToken,
16
16
  getPensarApiUrl,
17
17
  init_auth,
18
18
  init_constants
19
- } from "./cli-4tc6888c.js";
19
+ } from "./cli-vckbhnyk.js";
20
20
  import {
21
21
  exports_external,
22
22
  init_zod
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  config,
26
26
  init_config
27
- } from "./cli-51dkmt5p.js";
27
+ } from "./cli-f7hanqbw.js";
28
28
  import {
29
29
  __commonJS,
30
30
  __require
@@ -7135,6 +7135,12 @@ async function updateIssue(issueId, data) {
7135
7135
  async function retestIssue(issueId) {
7136
7136
  return apiRequest("POST", `/issues/${issueId}/retest`);
7137
7137
  }
7138
+ async function linkPullRequest(issueId, url) {
7139
+ return apiRequest("POST", `/issues/${issueId}/pull-requests`, { url });
7140
+ }
7141
+ async function listIssuePullRequests(issueId) {
7142
+ return apiRequest("GET", `/issues/${issueId}/pull-requests`);
7143
+ }
7138
7144
  async function listFixes(issueId) {
7139
7145
  return apiRequest("GET", `/issues/${issueId}/fixes`);
7140
7146
  }
@@ -7322,46 +7328,60 @@ async function runOffensiveSecurityAgent(input) {
7322
7328
  return { streamResult: agent.streamResult, session: agent.session };
7323
7329
  }
7324
7330
  // src/core/agents/specialized/patching/prompts.ts
7325
- var PREAMBLE2 = `You are an expert security vulnerability patching agent. Your goal is to analyze security vulnerabilities, provide high-quality fixes, and verify the fixes don't break existing functionality.`;
7331
+ var PREAMBLE2 = `You are an expert security vulnerability patching agent — an autonomous coding agent specialized in fixing security issues. Your goal is to analyze security vulnerabilities, apply high-quality fixes, verify they don't break existing functionality, and return structured PR metadata.`;
7326
7332
  var ORIENT_STEP = `1. **Orient Yourself**:
7327
7333
  - Review the AGENTS.md / project documentation provided in your prompt for build, lint, and test commands
7328
- - Use list_files to explore the repository structure
7334
+ - Use glob / list_files to explore the repository structure (prefer glob for pattern searches like "**/*.ts")
7329
7335
  - Read package.json, Makefile, or equivalent to understand the project's toolchain
7330
- - Identify the lint command, test command, type-check command, and any other verification scripts`;
7331
- var UNDERSTAND_STEP = `2. **Understand the Vulnerability**:
7336
+ - Identify the lint command, test command, type-check command, and any other verification scripts
7337
+ - Optionally call profile_codebase for a high-level map of the repo`;
7338
+ var TASK_STEP = `2. **Track Work with Tasks**:
7339
+ - Use create_task early to decompose the job into concrete steps (orient, understand, edit, verify, finalize)
7340
+ - Update tasks with update_task as you progress (in_progress → completed / failed)
7341
+ - Use list_tasks when you need to recall what's left
7342
+ - Keep tasks atomic — one clear outcome per task`;
7343
+ var UNDERSTAND_STEP = `3. **Understand the Vulnerability**:
7332
7344
  - Carefully read the vulnerability description, CWE mappings, and any dataflow analysis provided
7333
7345
  - Understand the root cause: What makes this code vulnerable?
7334
7346
  - Identify the attack vector: How would an attacker exploit this?
7335
- - Consider the context: What is the application trying to do?`;
7336
- var REVIEW_STEP = `3. **Review the Code**:
7347
+ - Consider the context: What is the application trying to do?
7348
+ - Use web_search / get_page when you need framework-specific security guidance or CVE details`;
7349
+ var REVIEW_STEP = `4. **Review the Code**:
7337
7350
  - Use read_file to read the vulnerable file(s) mentioned in the issue
7338
- - Use grep to search for related code patterns, similar vulnerabilities, or existing security controls
7351
+ - Use grep or run_code_query for structural searches (rg / ast-grep) across related patterns
7339
7352
  - Review related files: imports, dependencies, configuration files
7340
7353
  - Understand the data flow: Where does user input come from? Where does it go?`;
7341
- var PLAN_STEP = `4. **Plan Your Fix**:
7354
+ var PLAN_STEP = `5. **Plan Your Fix**:
7342
7355
  - Identify the exact code that needs to change
7343
7356
  - Determine the appropriate security control (input validation, parameterized queries, access control, etc.)
7344
7357
  - Consider side effects: Will this break existing functionality?
7345
7358
  - Think about edge cases: What other inputs or scenarios need to be handled?
7346
7359
  - Look for framework-specific or language-specific best practices
7347
- - State your complete plan clearly before making changes`;
7348
- var APPLY_STEP = `5. **Apply the Patch**:
7349
- - Use update_file to modify existing files with your security fixes
7360
+ - State your complete plan clearly before making changes, and reflect it in your task list`;
7361
+ var APPLY_STEP = `6. **Apply the Patch**:
7362
+ - Prefer update_file for small, exact string replacements
7363
+ - Prefer apply_patch (unified diff) for multi-hunk or multi-file edits
7350
7364
  - Use create_file if you need to add new security utilities or middleware
7365
+ - Use delete_file only when removing obsolete insecure code that is truly unused
7351
7366
  - Make minimal, targeted changes — don't refactor unrelated code
7352
7367
  - Follow the existing code style and conventions
7353
7368
  - Ensure your changes integrate cleanly with the existing codebase`;
7354
- var RESTART_STEP = `6. **Restart Dev Environment** (if applicable):
7369
+ var GIT_STEP = `7. **Self-Check with Git**:
7370
+ - Use git_status to see which files changed
7371
+ - Use git_diff to review the exact patch before verification
7372
+ - Do NOT commit, push, or open a PR — the host handles that after you finalize`;
7373
+ var RESTART_STEP = `8. **Restart Dev Environment** (if applicable):
7355
7374
  - Use execute_command to restart any dev servers or services so your changes are loaded
7356
7375
  - Wait for the services to become healthy`;
7357
- var VERIFY_STEP = `7. **Verify the Patch**:
7376
+ var VERIFY_STEP = `9. **Verify the Patch**:
7358
7377
  - Use execute_command to run the project's lint command (e.g. \`npm run lint\`, \`ruff check\`, \`cargo clippy\`)
7359
7378
  - Use execute_command to run the project's type-check command if applicable (e.g. \`npx tsc --noEmit\`, \`mypy\`)
7360
7379
  - Use execute_command to run the project's test suite (e.g. \`npm test\`, \`pytest\`, \`cargo test\`)
7361
7380
  - If a Proof of Concept (POC) is provided, run it to verify the vulnerability is fixed — the POC should FAIL (non-zero exit code) after a successful patch
7362
7381
  - If any check fails, read the error output carefully, fix the issues, and re-run until all checks pass
7363
7382
  - If the project has no clear lint/test commands, at minimum verify the changed files parse correctly (e.g. \`node -c file.js\`, \`python -m py_compile file.py\`)`;
7364
- var FINALIZE_STEP = `8. **Finalize**:
7383
+ var FINALIZE_STEP = `10. **Finalize**:
7384
+ - Mark remaining tasks completed
7365
7385
  - Use the response tool to complete the patching process
7366
7386
  - Provide a clear, detailed summary of:
7367
7387
  * Each file you changed and why
@@ -7428,12 +7448,18 @@ var SECURITY_BEST_PRACTICES = `# Security Best Practices by Vulnerability Type
7428
7448
  - Remove sensitive data from client-side code`;
7429
7449
  var TOOL_USAGE2 = `# Tool Usage
7430
7450
 
7431
- - **list_files**: Explore directory structure and find relevant files
7451
+ - **glob**: Find files by pattern (e.g. "**/*.ts", "**/package.json")
7452
+ - **list_files**: Explore directory structure
7432
7453
  - **read_file**: Read file contents to understand code
7433
- - **grep**: Search for patterns across the codebase
7434
- - **update_file**: Modify existing files with security fixes
7435
- - **create_file**: Create new files if needed (utilities, middleware, etc.)
7436
- - **execute_command**: Run shell commands use for linting, type-checking, running tests, restarting services, running POCs, installing dependencies, and verifying your changes
7454
+ - **grep** / **run_code_query**: Search for patterns (run_code_query supports rg / ast-grep / comby)
7455
+ - **profile_codebase**: High-level codebase map when orientation is hard
7456
+ - **web_search** / **get_page**: Look up CVE details, framework security docs
7457
+ - **create_task** / **update_task** / **list_tasks**: Todo tracking for the run
7458
+ - **update_file**: Small exact search-and-replace edits
7459
+ - **apply_patch**: Multi-hunk / multi-file unified diffs
7460
+ - **create_file** / **delete_file**: Add or remove files when needed
7461
+ - **git_status** / **git_diff**: Self-check changes (do not commit/push/PR)
7462
+ - **execute_command**: Lint, type-check, tests, restart services, run POCs
7437
7463
  - **response**: Complete the process with the structured patch result`;
7438
7464
  var REQUIREMENTS = `# Critical Requirements
7439
7465
 
@@ -7445,6 +7471,7 @@ var REQUIREMENTS = `# Critical Requirements
7445
7471
  6. **Test the Fix**: If a POC is provided, run it after patching. The POC should FAIL (non-zero exit code) once the vulnerability is fixed.
7446
7472
  7. **Be Persistent**: It may take multiple iterations to get the fix right — iterate until the POC fails and tests pass.
7447
7473
  8. **Be Complete**: Address the root cause, not just symptoms
7474
+ 9. **Stay Autonomous**: You will not receive follow-up messages — finish the job in this run
7448
7475
 
7449
7476
  # Important Notes
7450
7477
 
@@ -7455,17 +7482,20 @@ var REQUIREMENTS = `# Critical Requirements
7455
7482
  - Follow language and framework conventions
7456
7483
  - When multiple approaches exist, choose the most secure and idiomatic
7457
7484
  - If a fix requires configuration changes or environment variables, note this clearly
7458
- - If AGENTS.md or project docs specify particular lint/test/build commands, use those exact commands`;
7485
+ - If AGENTS.md or project docs specify particular lint/test/build commands, use those exact commands
7486
+ - Do not commit, push, or open a pull request — the host does that after your response`;
7459
7487
  function buildSystemPrompt() {
7460
7488
  return [
7461
7489
  PREAMBLE2,
7462
7490
  "",
7463
7491
  "# Process",
7464
7492
  "",
7465
- "You MUST follow this prescriptive process:",
7493
+ "You MUST follow this autonomous coding-agent process:",
7466
7494
  "",
7467
7495
  ORIENT_STEP,
7468
7496
  "",
7497
+ TASK_STEP,
7498
+ "",
7469
7499
  UNDERSTAND_STEP,
7470
7500
  "",
7471
7501
  REVIEW_STEP,
@@ -7474,6 +7504,8 @@ function buildSystemPrompt() {
7474
7504
  "",
7475
7505
  APPLY_STEP,
7476
7506
  "",
7507
+ GIT_STEP,
7508
+ "",
7477
7509
  RESTART_STEP,
7478
7510
  "",
7479
7511
  VERIFY_STEP,
@@ -8307,4 +8339,4 @@ Working directory: ${input.codebasePath}`;
8307
8339
  });
8308
8340
  return { session, outputPath: input.outputPath };
8309
8341
  }
8310
- export { listApps, getApp, createApp, updateApp, deleteApp, listEndpoints, getEndpoint, createEndpoint, updateEndpoint, deleteEndpoint, searchApps, searchEndpoints, listScans, getScan, listPentestTargets, dispatchPentest, listIssues, getIssue, updateIssue, retestIssue, listFixes, getFix, listAgentLogs, searchAgentLogs, listTargetLogs, searchTargetLogs, runOffensiveSecurityAgent, buildPentestPrompt, buildThreatModelPrompt, createSkillsRegistry, runThreatModelWorkflow };
8342
+ export { listApps, getApp, createApp, updateApp, deleteApp, listEndpoints, getEndpoint, createEndpoint, updateEndpoint, deleteEndpoint, searchApps, searchEndpoints, listScans, getScan, listPentestTargets, dispatchPentest, listIssues, getIssue, updateIssue, retestIssue, linkPullRequest, listIssuePullRequests, listFixes, getFix, listAgentLogs, searchAgentLogs, listTargetLogs, searchTargetLogs, runOffensiveSecurityAgent, buildPentestPrompt, buildThreatModelPrompt, createSkillsRegistry, runThreatModelWorkflow };
@@ -3,7 +3,7 @@ import {
3
3
  init,
4
4
  init_config,
5
5
  update
6
- } from "./cli-7n43wz82.js";
6
+ } from "./cli-eveg9djy.js";
7
7
  import {
8
8
  __esm
9
9
  } from "./cli-8rxa073f.js";