@pensar/apex 2.4.0 → 2.5.0-canary.22f2eb52

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 (94) hide show
  1. package/build/agent-7qtpem5z.js +12 -0
  2. package/build/agent-9khcyh5t.js +14 -0
  3. package/build/agent-bsyhck0a.js +12 -0
  4. package/build/{agent-5ejt5vpz.js → agent-ywewzc2h.js} +42 -42
  5. package/build/{apps-17wvz1d7.js → apps-11akynyv.js} +74 -43
  6. package/build/{auth-z3h9859n.js → auth-dd6r9mk4.js} +57 -61
  7. package/build/blackboxAgent-hbra4k00.js +12 -0
  8. package/build/blackboxPentest-bn5evs2z.js +61 -0
  9. package/build/{cli-xshasbwe.js → cli-3v9zs5wm.js} +31 -52
  10. package/build/{cli-mavved45.js → cli-4z46kyrk.js} +86 -93
  11. package/build/cli-7vby0hk6.js +12136 -0
  12. package/build/{cli-gq40s5b3.js → cli-8kkaeb70.js} +33 -46
  13. package/build/cli-8w8k4dph.js +15 -0
  14. package/build/cli-ag6jtndp.js +32 -0
  15. package/build/{cli-2cbwdk78.js → cli-ak78mweh.js} +4 -4
  16. package/build/cli-bb02pjt0.js +1485 -0
  17. package/build/{cli-k71t434r.js → cli-ec2hwkv3.js} +34 -76
  18. package/build/{cli-vnynf0js.js → cli-f5rw841m.js} +11 -5
  19. package/build/{cli-k8kc47pq.js → cli-gamfs2yq.js} +118 -115
  20. package/build/{cli-32z0017y.js → cli-gq5sk2j3.js} +36 -60
  21. package/build/{cli-bc05qbss.js → cli-h6y3bt60.js} +13 -21
  22. package/build/{cli-tkc598ey.js → cli-j1916nvj.js} +10035 -7661
  23. package/build/{cli-5k33webc.js → cli-jw1xftqm.js} +355 -332
  24. package/build/{cli-tznv8pf1.js → cli-n4h7ygp5.js} +4 -4
  25. package/build/{cli-b1adytsy.js → cli-q45hcq3f.js} +67 -39
  26. package/build/{cli-repbyhkk.js → cli-qkb3v2nw.js} +26063 -25373
  27. package/build/{cli-j54qa6tm.js → cli-qktcyj48.js} +1 -1
  28. package/build/cli-retw3rw5.js +12 -0
  29. package/build/cli-tjm77pmx.js +12075 -0
  30. package/build/{cli-dm0fc0bm.js → cli-v1sarr4y.js} +5 -9
  31. package/build/{cli-9rhzhgx2.js → cli-v8ph8hy2.js} +5 -5
  32. package/build/{cli-vq52kp7j.js → cli-vkxx4jzv.js} +147 -128
  33. package/build/cli-wfb4gde1.js +22 -0
  34. package/build/{cli-ee3axgts.js → cli-xbhr5khz.js} +1 -1
  35. package/build/cli-z82n3qk1.js +6 -0
  36. package/build/cli.js +689 -132
  37. package/build/{config-f1mj4nhd.js → config-kv5v9ctn.js} +29 -29
  38. package/build/{doctor-ekneewa3.js → doctor-xs4s5km8.js} +4 -9
  39. package/build/{fastStrike-8zka43xs.js → fastStrike-b8t8f916.js} +26 -28
  40. package/build/{fixes-b89s5haw.js → fixes-kcckqx3s.js} +22 -27
  41. package/build/getMachineId-bsd-zr67nd9p.js +36 -0
  42. package/build/getMachineId-darwin-fd1d562d.js +36 -0
  43. package/build/getMachineId-linux-kjmg243j.js +29 -0
  44. package/build/getMachineId-unsupported-n4r58vke.js +19 -0
  45. package/build/getMachineId-win-yzgpfsrb.js +38 -0
  46. package/build/index-3mzr07h0.js +9 -0
  47. package/build/index-63zf8jxx.js +12 -0
  48. package/build/index-a1bg29j1.js +1559 -0
  49. package/build/{index-cbwn03kz.js → index-a2xycbjs.js} +12 -31
  50. package/build/{index-6d22pyxt.js → index-ae81pvwg.js} +2995 -2432
  51. package/build/index-cbajq2xy.js +17 -0
  52. package/build/index-cn4p95gh.js +100 -0
  53. package/build/index-kas88svr.js +36 -0
  54. package/build/index-mr20g8k4.js +22 -0
  55. package/build/{index-psqjpw5m.js → index-nweqptgs.js} +7 -7
  56. package/build/{index-sf16jm0m.js → index-rx5jn1nz.js} +137 -162
  57. package/build/{issues-xx5bs4md.js → issues-jm28k288.js} +81 -35
  58. package/build/{logs-qtxe51w2.js → logs-r02tbz89.js} +20 -25
  59. package/build/{multipart-parser-g2xxkezz.js → multipart-parser-vjjdbpd1.js} +10 -10
  60. package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-mmfejh1j.js} +6 -13
  61. package/build/{parse-rtccymzn.js → parse-cqecqrc5.js} +0 -4
  62. package/build/pentest-13jcm4cy.js +21 -0
  63. package/build/{pentests-6ks3szc4.js → pentests-jyn4zs7n.js} +23 -28
  64. package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-m3qkbpv6.js} +16 -20
  65. package/build/{targets-sxygyj87.js → targets-rqv57as0.js} +22 -27
  66. package/build/threatModel-scmz36xr.js +19 -0
  67. package/build/{token-3bbp59y6.js → token-n0tmq8n5.js} +2 -2
  68. package/build/{token-util-6xjme11b.js → token-util-bv80pj47.js} +1 -2
  69. package/build/{uninstall-tvsh81v8.js → uninstall-bme62bdg.js} +7 -4
  70. package/build/{upload-7wdyyqmr.js → upload-hwpgx1ha.js} +7 -13
  71. package/build/{utils-7fwdkqk6.js → utils-abtz5mmk.js} +7 -29
  72. package/package.json +8 -2
  73. package/build/agent-mvpgvgks.js +0 -19
  74. package/build/agent-nhs1w5w0.js +0 -29
  75. package/build/authentication-3s97cpk4.js +0 -19
  76. package/build/blackboxAgent-gw0a1ca4.js +0 -19
  77. package/build/blackboxPentest-44333zss.js +0 -37
  78. package/build/cli-0n4r54hq.js +0 -414
  79. package/build/cli-72cvcqhg.js +0 -22
  80. package/build/cli-qqt4gj1w.js +0 -53
  81. package/build/cli-swpbx60z.js +0 -24441
  82. package/build/index-4ad3sdwk.js +0 -39
  83. package/build/index-ghwf5z3v.js +0 -12
  84. package/build/index-hqjdg6fg.js +0 -205
  85. package/build/index-mtq7kmxz.js +0 -12856
  86. package/build/index-rbzhk712.js +0 -33
  87. package/build/index-y5w6n3tb.js +0 -19
  88. package/build/main-mmjp338j.js +0 -324
  89. package/build/pentest-xtc1sjdw.js +0 -29
  90. package/build/threatModel-xsm6fwk5.js +0 -27
  91. /package/build/{cli-c8131c4q.js → cli-0wsh8j2t.js} +0 -0
  92. /package/build/{cli-e08r86zk.js → cli-b3dvxjgk.js} +0 -0
  93. /package/build/{cli-fw5r7pfj.js → cli-q126f6ef.js} +0 -0
  94. /package/build/{cli-9fsre5pt.js → cli-qba2x69h.js} +0 -0
@@ -1,33 +1,31 @@
1
1
  #!/usr/bin/env bun
2
+ import"./cli-wfb4gde1.js";
3
+ import"./cli-j1916nvj.js";
4
+ import"./cli-qkb3v2nw.js";
5
+ import"./cli-n4h7ygp5.js";
6
+ import"./cli-8kkaeb70.js";
7
+ import"./cli-gq5sk2j3.js";
8
+ import"./cli-gamfs2yq.js";
9
+ import"./cli-jw1xftqm.js";
10
+ import"./cli-3v9zs5wm.js";
11
+ import"./cli-4z46kyrk.js";
12
+ import"./cli-q45hcq3f.js";
2
13
  import {
3
- getIssue,
4
- linkPullRequest,
5
- listIssuePullRequests,
14
+ CLOSED_DISPOSITIONS,
6
15
  listIssues,
16
+ getIssue,
17
+ updateIssue,
18
+ listIssueComments,
19
+ createIssueComment,
7
20
  retestIssue,
8
- updateIssue
9
- } from "./cli-vq52kp7j.js";
10
- import"./cli-5k33webc.js";
11
- import"./cli-gq40s5b3.js";
12
- import"./cli-b1adytsy.js";
13
- import"./cli-mavved45.js";
14
- import"./cli-xshasbwe.js";
15
- import"./cli-32z0017y.js";
16
- import"./cli-k8kc47pq.js";
17
- import"./cli-9fsre5pt.js";
18
- import"./cli-qqt4gj1w.js";
19
- import"./cli-repbyhkk.js";
20
- import"./cli-tznv8pf1.js";
21
- import"./cli-fw5r7pfj.js";
22
- import"./cli-c8131c4q.js";
23
- import"./cli-tkc598ey.js";
24
- import"./cli-0n4r54hq.js";
25
- import"./cli-swpbx60z.js";
26
- import"./cli-j54qa6tm.js";
27
- import"./cli-72cvcqhg.js";
28
- import"./cli-9rhzhgx2.js";
29
- import"./cli-vnynf0js.js";
30
- import"./cli-bc05qbss.js";
21
+ linkPullRequest,
22
+ listIssuePullRequests
23
+ } from "./cli-vkxx4jzv.js";
24
+ import {
25
+ markCommandFailed
26
+ } from "./cli-z82n3qk1.js";
27
+ import"./cli-qba2x69h.js";
28
+ import"./cli-qktcyj48.js";
31
29
 
32
30
  // src/cli/issues.ts
33
31
  function getFlag(flag, argv) {
@@ -46,9 +44,14 @@ Usage:
46
44
  pensar issues retest <issueId> Retest an issue
47
45
  pensar issues link-pr <issueId> --url <url> Link a pull request to an issue
48
46
  pensar issues prs <issueId> List pull requests linked to an issue
47
+ pensar issues comments <issueId> List review comments on an issue
48
+ pensar issues comment <issueId> --body <text> Post a comment on an issue
49
49
 
50
50
  <issueId> accepts the issue UUID or its label (e.g. VULN-000123).
51
51
 
52
+ Issue responses include "issueLabel" (e.g. VULN-000123, null for issues created
53
+ before labels existed) and "url", a deep link to the issue in the Console.
54
+
52
55
  List filters:
53
56
  --status <status> Filter: open, closed, false-positive, in-review
54
57
  --severity <sev> Filter: critical, high, medium, low
@@ -59,19 +62,31 @@ Update options:
59
62
  --status <status> New status
60
63
  --closed-reason <reason> Reason for closing
61
64
  --closed-comments <text> Additional comments
65
+ --disposition <value> Why it is closed: resolved, wont-fix, out-of-scope,
66
+ risk-accepted
62
67
  --false-positive Flag as false positive
63
68
  --fp-reason <reason> Reason for false positive flag
64
69
 
65
70
  Link-pr options:
66
71
  --url <url> URL of the pull request to link (required)
67
72
 
73
+ Comments options:
74
+ --page <n> Page number (default 1)
75
+ --page-size <n> Comments per page (default 50, max 200)
76
+
77
+ Comment options:
78
+ --body <text> Comment text (required)
79
+
80
+ Comments are returned oldest first. Posting requires a user login; a workspace
81
+ API key has no author to attribute a comment to.
82
+
68
83
  Options:
69
84
  -h, --help Show this help message`);
70
85
  }
71
86
  async function main() {
72
87
  const args = process.argv.slice(2);
73
88
  const sub = args[0];
74
- if (sub === "--help" || sub === "-h" || sub === "help") {
89
+ if (sub === "help" || args.includes("--help") || args.includes("-h")) {
75
90
  showHelp();
76
91
  return;
77
92
  }
@@ -81,7 +96,7 @@ async function main() {
81
96
  if (!issueId) {
82
97
  console.error("Error: issue ID is required");
83
98
  console.error("Usage: pensar issues get <issueId>");
84
- process.exit(1);
99
+ return markCommandFailed();
85
100
  }
86
101
  const issue = await getIssue(issueId);
87
102
  console.log(JSON.stringify(issue, null, 2));
@@ -90,17 +105,24 @@ async function main() {
90
105
  if (!issueId) {
91
106
  console.error("Error: issue ID is required");
92
107
  console.error("Usage: pensar issues update <issueId> [--status <status>] ...");
93
- process.exit(1);
108
+ return markCommandFailed();
94
109
  }
95
110
  const status = getFlag("--status", args);
96
111
  const closedReason = getFlag("--closed-reason", args);
97
112
  const closedComments = getFlag("--closed-comments", args);
113
+ const dispositionFlag = getFlag("--disposition", args);
114
+ if (dispositionFlag !== undefined && !CLOSED_DISPOSITIONS.includes(dispositionFlag)) {
115
+ console.error(`Error: invalid --disposition "${dispositionFlag}". Accepted: ${CLOSED_DISPOSITIONS.join(", ")}`);
116
+ return markCommandFailed();
117
+ }
118
+ const closedDisposition = dispositionFlag;
98
119
  const userFlaggedFalsePositive = args.includes("--false-positive") ? true : undefined;
99
120
  const userFlaggedFalsePositiveReason = getFlag("--fp-reason", args);
100
121
  const result = await updateIssue(issueId, {
101
122
  status,
102
123
  closedReason,
103
124
  closedComments,
125
+ closedDisposition,
104
126
  userFlaggedFalsePositive,
105
127
  userFlaggedFalsePositiveReason
106
128
  });
@@ -110,7 +132,7 @@ async function main() {
110
132
  if (!issueId) {
111
133
  console.error("Error: issue ID is required");
112
134
  console.error("Usage: pensar issues retest <issueId>");
113
- process.exit(1);
135
+ return markCommandFailed();
114
136
  }
115
137
  const result = await retestIssue(issueId);
116
138
  console.log(JSON.stringify(result, null, 2));
@@ -120,16 +142,40 @@ async function main() {
120
142
  if (!issueId || issueId.startsWith("--") || !url) {
121
143
  console.error("Error: issue ID and --url are required");
122
144
  console.error("Usage: pensar issues link-pr <issueId> --url <prUrl>");
123
- process.exit(1);
145
+ return markCommandFailed();
124
146
  }
125
147
  const result = await linkPullRequest(issueId, url);
126
148
  console.log(JSON.stringify(result, null, 2));
149
+ } else if (sub === "comments") {
150
+ const issueId = args[1];
151
+ if (!issueId || issueId.startsWith("--")) {
152
+ console.error("Error: issue ID is required");
153
+ console.error("Usage: pensar issues comments <issueId>");
154
+ return markCommandFailed();
155
+ }
156
+ const page = getFlag("--page", args);
157
+ const pageSize = getFlag("--page-size", args);
158
+ const result = await listIssueComments(issueId, {
159
+ page: page ? Number(page) : undefined,
160
+ pageSize: pageSize ? Number(pageSize) : undefined
161
+ });
162
+ console.log(JSON.stringify(result, null, 2));
163
+ } else if (sub === "comment") {
164
+ const issueId = args[1];
165
+ const body = getFlag("--body", args);
166
+ if (!issueId || issueId.startsWith("--") || !body) {
167
+ console.error("Error: issue ID and --body are required");
168
+ console.error('Usage: pensar issues comment <issueId> --body "<text>"');
169
+ return markCommandFailed();
170
+ }
171
+ const result = await createIssueComment(issueId, body);
172
+ console.log(JSON.stringify(result, null, 2));
127
173
  } else if (sub === "prs") {
128
174
  const issueId = args[1];
129
175
  if (!issueId) {
130
176
  console.error("Error: issue ID is required");
131
177
  console.error("Usage: pensar issues prs <issueId>");
132
- process.exit(1);
178
+ return markCommandFailed();
133
179
  }
134
180
  const result = await listIssuePullRequests(issueId);
135
181
  console.log(JSON.stringify(result, null, 2));
@@ -144,12 +190,12 @@ async function main() {
144
190
  } else {
145
191
  console.error(`Error: Unknown subcommand "${sub}"`);
146
192
  showHelp();
147
- process.exit(1);
193
+ return markCommandFailed();
148
194
  }
149
195
  } catch (err) {
150
196
  console.error(`
151
197
  Error: ${err instanceof Error ? err.message : String(err)}`);
152
- process.exit(1);
198
+ return markCommandFailed();
153
199
  }
154
200
  }
155
- main();
201
+ await main();
@@ -1,29 +1,24 @@
1
1
  #!/usr/bin/env bun
2
+ import"./cli-wfb4gde1.js";
3
+ import"./cli-j1916nvj.js";
4
+ import"./cli-qkb3v2nw.js";
5
+ import"./cli-n4h7ygp5.js";
6
+ import"./cli-8kkaeb70.js";
7
+ import"./cli-gq5sk2j3.js";
8
+ import"./cli-gamfs2yq.js";
9
+ import"./cli-jw1xftqm.js";
10
+ import"./cli-3v9zs5wm.js";
11
+ import"./cli-4z46kyrk.js";
12
+ import"./cli-q45hcq3f.js";
2
13
  import {
3
14
  listAgentLogs,
4
15
  searchAgentLogs
5
- } from "./cli-vq52kp7j.js";
6
- import"./cli-5k33webc.js";
7
- import"./cli-gq40s5b3.js";
8
- import"./cli-b1adytsy.js";
9
- import"./cli-mavved45.js";
10
- import"./cli-xshasbwe.js";
11
- import"./cli-32z0017y.js";
12
- import"./cli-k8kc47pq.js";
13
- import"./cli-9fsre5pt.js";
14
- import"./cli-qqt4gj1w.js";
15
- import"./cli-repbyhkk.js";
16
- import"./cli-tznv8pf1.js";
17
- import"./cli-fw5r7pfj.js";
18
- import"./cli-c8131c4q.js";
19
- import"./cli-tkc598ey.js";
20
- import"./cli-0n4r54hq.js";
21
- import"./cli-swpbx60z.js";
22
- import"./cli-j54qa6tm.js";
23
- import"./cli-72cvcqhg.js";
24
- import"./cli-9rhzhgx2.js";
25
- import"./cli-vnynf0js.js";
26
- import"./cli-bc05qbss.js";
16
+ } from "./cli-vkxx4jzv.js";
17
+ import {
18
+ markCommandFailed
19
+ } from "./cli-z82n3qk1.js";
20
+ import"./cli-qba2x69h.js";
21
+ import"./cli-qktcyj48.js";
27
22
 
28
23
  // src/cli/logs.ts
29
24
  function getFlag(flag, argv) {
@@ -64,7 +59,7 @@ async function main() {
64
59
  if (!issueId || !query) {
65
60
  console.error("Error: issue ID and query are required");
66
61
  console.error("Usage: pensar logs search <issueId> <query> [--level <level>] [--role <role>] [--context <n>]");
67
- process.exit(1);
62
+ return markCommandFailed();
68
63
  }
69
64
  const level = getFlag("--level", args);
70
65
  const role = getFlag("--role", args);
@@ -88,7 +83,7 @@ async function main() {
88
83
  } catch (err) {
89
84
  console.error(`
90
85
  Error: ${err instanceof Error ? err.message : String(err)}`);
91
- process.exit(1);
86
+ return markCommandFailed();
92
87
  }
93
88
  }
94
- main();
89
+ await main();
@@ -1,12 +1,12 @@
1
1
  import {
2
- FormData,
3
2
  file_default,
3
+ FormData2,
4
4
  init_esm_min,
5
5
  init_from
6
- } from "./cli-k71t434r.js";
6
+ } from "./cli-ec2hwkv3.js";
7
7
  import {
8
8
  __esm
9
- } from "./cli-bc05qbss.js";
9
+ } from "./cli-h6y3bt60.js";
10
10
 
11
11
  // node_modules/gaxios/node_modules/node-fetch/src/utils/multipart-parser.js
12
12
  class MultipartParser {
@@ -53,12 +53,12 @@ class MultipartParser {
53
53
  this[callbackSymbol](ui8a && ui8a.subarray(start, end));
54
54
  }
55
55
  };
56
- const dataCallback = (name, clear2) => {
56
+ const dataCallback = (name, clear) => {
57
57
  const markSymbol = name + "Mark";
58
58
  if (!(markSymbol in this)) {
59
59
  return;
60
60
  }
61
- if (clear2) {
61
+ if (clear) {
62
62
  callback(name, this[markSymbol], i, data);
63
63
  delete this[markSymbol];
64
64
  } else {
@@ -243,7 +243,7 @@ function _fileName(headerValue) {
243
243
  const match = m[2] || m[3] || "";
244
244
  let filename = match.slice(match.lastIndexOf("\\") + 1);
245
245
  filename = filename.replace(/%22/g, '"');
246
- filename = filename.replace(/&#(\d{4});/g, (m2, code) => {
246
+ filename = filename.replace(/&#(\d{4});/g, (m, code) => {
247
247
  return String.fromCharCode(code);
248
248
  });
249
249
  return filename;
@@ -264,7 +264,7 @@ async function toFormData(Body, ct) {
264
264
  let contentType;
265
265
  let filename;
266
266
  const entryChunks = [];
267
- const formData = new FormData;
267
+ const formData = new FormData2;
268
268
  const onPartData = (ui8a) => {
269
269
  entryValue += decoder.decode(ui8a, { stream: true });
270
270
  };
@@ -301,9 +301,9 @@ async function toFormData(Body, ct) {
301
301
  headerValue += decoder.decode();
302
302
  headerField = headerField.toLowerCase();
303
303
  if (headerField === "content-disposition") {
304
- const m2 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
305
- if (m2) {
306
- entryName = m2[2] || m2[3] || "";
304
+ const m = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
305
+ if (m) {
306
+ entryName = m[2] || m[3] || "";
307
307
  }
308
308
  filename = _fileName(headerValue);
309
309
  if (filename) {
@@ -1,18 +1,11 @@
1
- import"./cli-9fsre5pt.js";
2
- import"./cli-qqt4gj1w.js";
3
1
  import {
4
2
  OffensiveSecurityAgent
5
- } from "./cli-repbyhkk.js";
6
- import"./cli-tznv8pf1.js";
7
- import"./cli-c8131c4q.js";
8
- import"./cli-tkc598ey.js";
9
- import"./cli-0n4r54hq.js";
10
- import"./cli-swpbx60z.js";
11
- import"./cli-j54qa6tm.js";
12
- import"./cli-72cvcqhg.js";
13
- import"./cli-9rhzhgx2.js";
14
- import"./cli-vnynf0js.js";
15
- import"./cli-bc05qbss.js";
3
+ } from "./cli-qkb3v2nw.js";
4
+ import"./cli-wfb4gde1.js";
5
+ import"./cli-j1916nvj.js";
6
+ import"./cli-n4h7ygp5.js";
7
+ import"./cli-qba2x69h.js";
8
+ import"./cli-qktcyj48.js";
16
9
 
17
10
  // src/core/api/offesecAgent.ts
18
11
  async function runOffensiveSecurityAgent(input) {
@@ -1,7 +1,3 @@
1
- import {
2
- __require
3
- } from "./cli-bc05qbss.js";
4
-
5
1
  // src/core/http/parse.ts
6
2
  var NAME_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
7
3
  var NAME_CHAR = /[!#$%&'*+\-.^_`|~0-9A-Za-z]/;
@@ -0,0 +1,21 @@
1
+ import {
2
+ DEFAULT_CONCURRENCY2,
3
+ runPentestSwarm2,
4
+ runPentestWorkflow2
5
+ } from "./cli-jw1xftqm.js";
6
+ import"./cli-q45hcq3f.js";
7
+ import"./cli-8kkaeb70.js";
8
+ import"./cli-4z46kyrk.js";
9
+ import"./cli-gq5sk2j3.js";
10
+ import"./cli-gamfs2yq.js";
11
+ import"./cli-qba2x69h.js";
12
+ import"./cli-qkb3v2nw.js";
13
+ import"./cli-n4h7ygp5.js";
14
+ import"./cli-j1916nvj.js";
15
+ import"./cli-qktcyj48.js";
16
+ import"./cli-wfb4gde1.js";
17
+ export {
18
+ DEFAULT_CONCURRENCY2 as DEFAULT_CONCURRENCY,
19
+ runPentestSwarm2 as runPentestSwarm,
20
+ runPentestWorkflow2 as runPentestWorkflow
21
+ };
@@ -1,30 +1,25 @@
1
1
  #!/usr/bin/env bun
2
+ import"./cli-wfb4gde1.js";
3
+ import"./cli-j1916nvj.js";
4
+ import"./cli-qkb3v2nw.js";
5
+ import"./cli-n4h7ygp5.js";
6
+ import"./cli-8kkaeb70.js";
7
+ import"./cli-gq5sk2j3.js";
8
+ import"./cli-gamfs2yq.js";
9
+ import"./cli-jw1xftqm.js";
10
+ import"./cli-3v9zs5wm.js";
11
+ import"./cli-4z46kyrk.js";
12
+ import"./cli-q45hcq3f.js";
2
13
  import {
3
- dispatchPentest,
14
+ listScans,
4
15
  getScan,
5
- listScans
6
- } from "./cli-vq52kp7j.js";
7
- import"./cli-5k33webc.js";
8
- import"./cli-gq40s5b3.js";
9
- import"./cli-b1adytsy.js";
10
- import"./cli-mavved45.js";
11
- import"./cli-xshasbwe.js";
12
- import"./cli-32z0017y.js";
13
- import"./cli-k8kc47pq.js";
14
- import"./cli-9fsre5pt.js";
15
- import"./cli-qqt4gj1w.js";
16
- import"./cli-repbyhkk.js";
17
- import"./cli-tznv8pf1.js";
18
- import"./cli-fw5r7pfj.js";
19
- import"./cli-c8131c4q.js";
20
- import"./cli-tkc598ey.js";
21
- import"./cli-0n4r54hq.js";
22
- import"./cli-swpbx60z.js";
23
- import"./cli-j54qa6tm.js";
24
- import"./cli-72cvcqhg.js";
25
- import"./cli-9rhzhgx2.js";
26
- import"./cli-vnynf0js.js";
27
- import"./cli-bc05qbss.js";
16
+ dispatchPentest
17
+ } from "./cli-vkxx4jzv.js";
18
+ import {
19
+ markCommandFailed
20
+ } from "./cli-z82n3qk1.js";
21
+ import"./cli-qba2x69h.js";
22
+ import"./cli-qktcyj48.js";
28
23
 
29
24
  // src/cli/pentests.ts
30
25
  function getFlag(flag, argv) {
@@ -61,7 +56,7 @@ async function main() {
61
56
  if (!pentestId) {
62
57
  console.error("Error: pentest ID is required");
63
58
  console.error("Usage: pensar pentests get <pentestId>");
64
- process.exit(1);
59
+ return markCommandFailed();
65
60
  }
66
61
  const scan = await getScan(pentestId);
67
62
  console.log(JSON.stringify(scan, null, 2));
@@ -76,12 +71,12 @@ async function main() {
76
71
  } else {
77
72
  console.error(`Error: Unknown subcommand "${sub}"`);
78
73
  showHelp();
79
- process.exit(1);
74
+ return markCommandFailed();
80
75
  }
81
76
  } catch (err) {
82
77
  console.error(`
83
78
  Error: ${err instanceof Error ? err.message : String(err)}`);
84
- process.exit(1);
79
+ return markCommandFailed();
85
80
  }
86
81
  }
87
- main();
82
+ await main();
@@ -1,19 +1,12 @@
1
+ import"./cli-wfb4gde1.js";
2
+ import"./cli-j1916nvj.js";
3
+ import"./cli-qkb3v2nw.js";
4
+ import"./cli-n4h7ygp5.js";
1
5
  import {
2
- TargetedPentestAgent
3
- } from "./cli-mavved45.js";
4
- import"./cli-9fsre5pt.js";
5
- import"./cli-qqt4gj1w.js";
6
- import"./cli-repbyhkk.js";
7
- import"./cli-tznv8pf1.js";
8
- import"./cli-c8131c4q.js";
9
- import"./cli-tkc598ey.js";
10
- import"./cli-0n4r54hq.js";
11
- import"./cli-swpbx60z.js";
12
- import"./cli-j54qa6tm.js";
13
- import"./cli-72cvcqhg.js";
14
- import"./cli-9rhzhgx2.js";
15
- import"./cli-vnynf0js.js";
16
- import"./cli-bc05qbss.js";
6
+ TargetedPentestAgent2
7
+ } from "./cli-4z46kyrk.js";
8
+ import"./cli-qba2x69h.js";
9
+ import"./cli-qktcyj48.js";
17
10
 
18
11
  // src/core/api/targetedPentest.ts
19
12
  function normalizeResult(result) {
@@ -35,7 +28,7 @@ Found ${findings.length} vulnerabilities`);
35
28
  };
36
29
  }
37
30
  function startTargetedPentestAgent(input) {
38
- const agent = new TargetedPentestAgent(input);
31
+ const agent = new TargetedPentestAgent2(input);
39
32
  if (!input.eventBus) {
40
33
  agent.eventBus.on("text-delta", (d) => process.stdout.write(d.text));
41
34
  agent.eventBus.on("tool-call-complete", (d) => console.log(`→ calling ${d.toolName}`));
@@ -44,13 +37,16 @@ function startTargetedPentestAgent(input) {
44
37
  }
45
38
  return {
46
39
  result: agent.consume().then(normalizeResult),
47
- abortAndDrain: () => agent.abortAndDrain()
40
+ abortAndDrain: () => agent.abortAndDrain(),
41
+ drained: agent.drained
48
42
  };
49
43
  }
50
44
  async function runTargetedPentestAgent(input) {
51
- return startTargetedPentestAgent(input).result;
45
+ const { result, drained } = startTargetedPentestAgent(input);
46
+ const findings = await result;
47
+ await drained;
48
+ return findings;
52
49
  }
53
50
  export {
54
- runTargetedPentestAgent,
55
- startTargetedPentestAgent
51
+ runTargetedPentestAgent
56
52
  };
@@ -1,30 +1,25 @@
1
1
  #!/usr/bin/env bun
2
+ import"./cli-wfb4gde1.js";
3
+ import"./cli-j1916nvj.js";
4
+ import"./cli-qkb3v2nw.js";
5
+ import"./cli-n4h7ygp5.js";
6
+ import"./cli-8kkaeb70.js";
7
+ import"./cli-gq5sk2j3.js";
8
+ import"./cli-gamfs2yq.js";
9
+ import"./cli-jw1xftqm.js";
10
+ import"./cli-3v9zs5wm.js";
11
+ import"./cli-4z46kyrk.js";
12
+ import"./cli-q45hcq3f.js";
2
13
  import {
3
14
  listPentestTargets,
4
15
  listTargetLogs,
5
16
  searchTargetLogs
6
- } from "./cli-vq52kp7j.js";
7
- import"./cli-5k33webc.js";
8
- import"./cli-gq40s5b3.js";
9
- import"./cli-b1adytsy.js";
10
- import"./cli-mavved45.js";
11
- import"./cli-xshasbwe.js";
12
- import"./cli-32z0017y.js";
13
- import"./cli-k8kc47pq.js";
14
- import"./cli-9fsre5pt.js";
15
- import"./cli-qqt4gj1w.js";
16
- import"./cli-repbyhkk.js";
17
- import"./cli-tznv8pf1.js";
18
- import"./cli-fw5r7pfj.js";
19
- import"./cli-c8131c4q.js";
20
- import"./cli-tkc598ey.js";
21
- import"./cli-0n4r54hq.js";
22
- import"./cli-swpbx60z.js";
23
- import"./cli-j54qa6tm.js";
24
- import"./cli-72cvcqhg.js";
25
- import"./cli-9rhzhgx2.js";
26
- import"./cli-vnynf0js.js";
27
- import"./cli-bc05qbss.js";
17
+ } from "./cli-vkxx4jzv.js";
18
+ import {
19
+ markCommandFailed
20
+ } from "./cli-z82n3qk1.js";
21
+ import"./cli-qba2x69h.js";
22
+ import"./cli-qktcyj48.js";
28
23
 
29
24
  // src/cli/targets.ts
30
25
  function getFlag(flag, argv) {
@@ -70,7 +65,7 @@ async function main() {
70
65
  if (!targetId) {
71
66
  console.error("Error: target ID is required");
72
67
  console.error("Usage: pensar targets logs <targetId> [--level <level>] [--role <role>] [--limit <n>]");
73
- process.exit(1);
68
+ return markCommandFailed();
74
69
  }
75
70
  const level = getFlag("--level", args);
76
71
  const role = getFlag("--role", args);
@@ -84,7 +79,7 @@ async function main() {
84
79
  if (!targetId || !query) {
85
80
  console.error("Error: target ID and query are required");
86
81
  console.error("Usage: pensar targets search <targetId> <query> [--level <level>] [--role <role>] [--context <n>]");
87
- process.exit(1);
82
+ return markCommandFailed();
88
83
  }
89
84
  const level = getFlag("--level", args);
90
85
  const role = getFlag("--role", args);
@@ -99,7 +94,7 @@ async function main() {
99
94
  } else if (sub.startsWith("--")) {
100
95
  console.error("Error: pentest ID is required");
101
96
  console.error("Usage: pensar targets <pentestId>");
102
- process.exit(1);
97
+ return markCommandFailed();
103
98
  } else {
104
99
  const pentestId = sub;
105
100
  const targets = await listPentestTargets(pentestId);
@@ -108,7 +103,7 @@ async function main() {
108
103
  } catch (err) {
109
104
  console.error(`
110
105
  Error: ${err instanceof Error ? err.message : String(err)}`);
111
- process.exit(1);
106
+ return markCommandFailed();
112
107
  }
113
108
  }
114
- main();
109
+ await main();
@@ -0,0 +1,19 @@
1
+ import"./cli-qkb3v2nw.js";
2
+ import"./cli-wfb4gde1.js";
3
+ import"./cli-j1916nvj.js";
4
+ import"./cli-n4h7ygp5.js";
5
+ import"./cli-8kkaeb70.js";
6
+ import"./cli-gq5sk2j3.js";
7
+ import"./cli-gamfs2yq.js";
8
+ import"./cli-jw1xftqm.js";
9
+ import"./cli-3v9zs5wm.js";
10
+ import"./cli-4z46kyrk.js";
11
+ import"./cli-q45hcq3f.js";
12
+ import {
13
+ runThreatModelWorkflow2
14
+ } from "./cli-vkxx4jzv.js";
15
+ import"./cli-qba2x69h.js";
16
+ import"./cli-qktcyj48.js";
17
+ export {
18
+ runThreatModelWorkflow2 as runThreatModelWorkflow
19
+ };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  require_token_error,
3
3
  require_token_util
4
- } from "./cli-j54qa6tm.js";
4
+ } from "./cli-qktcyj48.js";
5
5
  import {
6
6
  __commonJS
7
- } from "./cli-bc05qbss.js";
7
+ } from "./cli-h6y3bt60.js";
8
8
 
9
9
  // node_modules/@vercel/oidc/dist/token.js
10
10
  var require_token = __commonJS(function(exports, module) {
@@ -1,5 +1,4 @@
1
1
  import {
2
2
  require_token_util
3
- } from "./cli-j54qa6tm.js";
4
- import"./cli-bc05qbss.js";
3
+ } from "./cli-qktcyj48.js";
5
4
  export default require_token_util();
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env bun
2
+ import {
3
+ markCommandFailed
4
+ } from "./cli-z82n3qk1.js";
2
5
  import {
3
6
  detectInstallMethod,
4
7
  init_installation
5
- } from "./cli-vnynf0js.js";
8
+ } from "./cli-f5rw841m.js";
6
9
  import {
7
10
  __require
8
- } from "./cli-bc05qbss.js";
11
+ } from "./cli-h6y3bt60.js";
9
12
 
10
13
  // src/cli/uninstall.ts
11
14
  init_installation();
@@ -227,7 +230,7 @@ async function main() {
227
230
  } catch (err) {
228
231
  console.error(`
229
232
  Error: ${err instanceof Error ? err.message : String(err)}`);
230
- process.exit(1);
233
+ return markCommandFailed();
231
234
  }
232
235
  }
233
- main();
236
+ await main();