@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
@@ -0,0 +1,12 @@
1
+ import {
2
+ runAuthenticationAgent2
3
+ } from "./cli-3v9zs5wm.js";
4
+ import"./cli-qba2x69h.js";
5
+ import"./cli-qkb3v2nw.js";
6
+ import"./cli-n4h7ygp5.js";
7
+ import"./cli-j1916nvj.js";
8
+ import"./cli-qktcyj48.js";
9
+ import"./cli-wfb4gde1.js";
10
+ export {
11
+ runAuthenticationAgent2 as runAuthenticationAgent
12
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ TargetedPentestAgent2,
3
+ buildPentestSystemPrompt2
4
+ } from "./cli-4z46kyrk.js";
5
+ import"./cli-qba2x69h.js";
6
+ import"./cli-qkb3v2nw.js";
7
+ import"./cli-n4h7ygp5.js";
8
+ import"./cli-j1916nvj.js";
9
+ import"./cli-qktcyj48.js";
10
+ import"./cli-wfb4gde1.js";
11
+ export {
12
+ TargetedPentestAgent2 as TargetedPentestAgent,
13
+ buildPentestSystemPrompt2 as buildPentestSystemPrompt
14
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ CodeAgent2
3
+ } from "./cli-gq5sk2j3.js";
4
+ import"./cli-qba2x69h.js";
5
+ import"./cli-qkb3v2nw.js";
6
+ import"./cli-n4h7ygp5.js";
7
+ import"./cli-j1916nvj.js";
8
+ import"./cli-qktcyj48.js";
9
+ import"./cli-wfb4gde1.js";
10
+ export {
11
+ CodeAgent2 as CodeAgent
12
+ };
@@ -1,24 +1,25 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-repbyhkk.js";
3
+ } from "./cli-qkb3v2nw.js";
4
+ import"./cli-wfb4gde1.js";
4
5
  import {
5
- detectOSAndEnhancePrompt
6
- } from "./cli-tznv8pf1.js";
7
- import"./cli-c8131c4q.js";
6
+ init_zod,
7
+ stepCountIs2,
8
+ init_dist
9
+ } from "./cli-j1916nvj.js";
8
10
  import {
9
- init_dist,
10
- stepCountIs
11
- } from "./cli-tkc598ey.js";
12
- import"./cli-0n4r54hq.js";
11
+ detectOSAndEnhancePrompt
12
+ } from "./cli-n4h7ygp5.js";
13
+ import"./cli-qba2x69h.js";
13
14
  import {
14
- exports_external,
15
- init_zod
16
- } from "./cli-swpbx60z.js";
17
- import"./cli-j54qa6tm.js";
18
- import"./cli-72cvcqhg.js";
19
- import"./cli-9rhzhgx2.js";
20
- import"./cli-vnynf0js.js";
21
- 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";
22
23
 
23
24
  // src/core/agents/specialized/findingJudge/agent.ts
24
25
  init_dist();
@@ -168,17 +169,17 @@ var FINDING_TYPES = [
168
169
  "informational",
169
170
  "expected-behavior"
170
171
  ];
171
- var FindingJudgeOutputSchema = exports_external.object({
172
- valid: exports_external.boolean().describe("Whether the POC demonstrates a currently exploitable vulnerability that should be persisted"),
173
- findingType: exports_external.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"),
174
- confidence: exports_external.number().min(0).max(1).describe("Confidence in the judgment, a decimal between 0.0 (no confidence) and 1.0 (certain)"),
175
- reasoning: exports_external.string().describe("Brief explanation of the key tool observations and analysis that led to this judgment"),
176
- concerns: exports_external.array(exports_external.string()).describe("Specific concerns identified. Empty array only when the finding is a valid high-confidence vulnerability."),
177
- verificationSteps: exports_external.array(exports_external.string()).describe("Concrete verification actions performed before deciding."),
178
- toolEvidence: exports_external.array(exports_external.string()).describe("Specific observations from tool output or provided artifacts."),
179
- reproducedPoc: exports_external.boolean().describe("Whether the judge reran or independently reproduced the POC."),
180
- webResearchUsed: exports_external.boolean().describe("Whether web_search/get_page materially informed the judgment."),
181
- limitations: exports_external.array(exports_external.string()).describe("Remaining verification gaps or environmental 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.")
182
183
  });
183
184
 
184
185
  // src/core/agents/specialized/findingJudge/agent.ts
@@ -195,25 +196,24 @@ var FINDING_JUDGE_ACTIVE_TOOLS = [
195
196
 
196
197
  class FindingJudgeAgent extends OffensiveSecurityAgent {
197
198
  constructor(opts) {
198
- const target = opts.finding.target ?? opts.target ?? opts.session.targets[0];
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];
199
207
  super({
208
+ ...base,
200
209
  system: detectOSAndEnhancePrompt(FINDING_JUDGE_SYSTEM_PROMPT),
201
- prompt: buildFindingJudgePrompt({ ...opts.finding, target }),
202
- model: opts.model,
203
- session: opts.session,
204
- target,
205
- authConfig: opts.authConfig,
206
- abortSignal: opts.abortSignal,
207
- eventBus: opts.eventBus,
208
- sandbox: opts.sandbox,
209
- enableThinking: opts.enableThinking,
210
- thinkingEffort: opts.thinkingEffort,
211
- openAIReasoningEffort: opts.openAIReasoningEffort,
212
- subagentId: opts.subagentId ?? "finding-judge",
213
- subagentName: opts.subagentName ?? "Finding Judge",
214
210
  activeTools: [...FINDING_JUDGE_ACTIVE_TOOLS],
215
211
  responseSchema: FindingJudgeOutputSchema,
216
- stopWhen: stepCountIs(60)
212
+ stopWhen: stepCountIs2(60),
213
+ target,
214
+ prompt: buildFindingJudgePrompt({ ...finding, target }),
215
+ subagentId: subagentId ?? "finding-judge",
216
+ subagentName: subagentName ?? "Finding Judge"
217
217
  });
218
218
  }
219
219
  }
@@ -1,39 +1,37 @@
1
1
  #!/usr/bin/env bun
2
- import"./cli-vq52kp7j.js";
3
- import"./cli-5k33webc.js";
4
- import"./cli-gq40s5b3.js";
5
- import"./cli-b1adytsy.js";
6
- import"./cli-mavved45.js";
7
- import"./cli-xshasbwe.js";
8
- import"./cli-32z0017y.js";
9
- import"./cli-k8kc47pq.js";
10
- import"./cli-9fsre5pt.js";
11
- import"./cli-qqt4gj1w.js";
2
+ import"./cli-wfb4gde1.js";
3
+ import"./cli-j1916nvj.js";
12
4
  import {
5
+ ENDPOINT_TRANSPORTS,
6
+ listApps,
7
+ getApp,
13
8
  createApp,
14
- createEndpoint,
9
+ updateApp,
15
10
  deleteApp,
16
- deleteEndpoint,
17
- getApp,
18
- getEndpoint,
19
- listApps,
20
11
  listEndpoints,
12
+ getEndpoint,
13
+ createEndpoint,
14
+ updateEndpoint,
15
+ deleteEndpoint,
21
16
  searchApps,
22
17
  searchEndpoints,
23
- updateApp,
24
- updateEndpoint
25
- } from "./cli-repbyhkk.js";
26
- import"./cli-tznv8pf1.js";
27
- import"./cli-fw5r7pfj.js";
28
- import"./cli-c8131c4q.js";
29
- import"./cli-tkc598ey.js";
30
- import"./cli-0n4r54hq.js";
31
- import"./cli-swpbx60z.js";
32
- import"./cli-j54qa6tm.js";
33
- import"./cli-72cvcqhg.js";
34
- import"./cli-9rhzhgx2.js";
35
- import"./cli-vnynf0js.js";
36
- import"./cli-bc05qbss.js";
18
+ listDomains,
19
+ createDomain
20
+ } from "./cli-qkb3v2nw.js";
21
+ import"./cli-n4h7ygp5.js";
22
+ import"./cli-8kkaeb70.js";
23
+ import"./cli-gq5sk2j3.js";
24
+ import"./cli-gamfs2yq.js";
25
+ import"./cli-jw1xftqm.js";
26
+ import"./cli-3v9zs5wm.js";
27
+ import"./cli-4z46kyrk.js";
28
+ import"./cli-q45hcq3f.js";
29
+ import"./cli-vkxx4jzv.js";
30
+ import {
31
+ markCommandFailed
32
+ } from "./cli-z82n3qk1.js";
33
+ import"./cli-qba2x69h.js";
34
+ import"./cli-qktcyj48.js";
37
35
 
38
36
  // src/cli/apps.ts
39
37
  var APPLICATION_TYPES = [
@@ -88,6 +86,14 @@ function parseEndpointType(value) {
88
86
  }
89
87
  return value;
90
88
  }
89
+ function parseTransport(value) {
90
+ if (value === undefined)
91
+ return;
92
+ if (!ENDPOINT_TRANSPORTS.includes(value)) {
93
+ throw new Error(`Invalid --transport "${value}". Must be one of: ${ENDPOINT_TRANSPORTS.join(", ")}`);
94
+ }
95
+ return value;
96
+ }
91
97
  function parseInteger(flag, value) {
92
98
  if (value === undefined)
93
99
  return;
@@ -117,6 +123,8 @@ Usage:
117
123
  pensar apps create [options] Create an app
118
124
  pensar apps update <appId> [options] Update an app
119
125
  pensar apps delete <appId> Delete an app
126
+ pensar apps domains List workspace domains
127
+ pensar apps domain-create <domain> Create/resolve a domain
120
128
  pensar apps endpoints <appId> [filters] List endpoints
121
129
  pensar apps endpoint <endpointId> Show endpoint details
122
130
  pensar apps endpoint-create <appId> [options] Create an endpoint
@@ -130,9 +138,13 @@ App fields (create requires --name and --description):
130
138
  --description <text> Application description
131
139
  --type <type> One of: ${APPLICATION_TYPES.join(", ")}
132
140
  --framework <text> Framework / runtime hint
133
- --domain <id> Linked domain UUID
141
+ --domain <id> Linked domain UUID (see "apps domains")
134
142
  --disallowed-actions <text> Free-form disallowed actions notes
135
143
 
144
+ Domains:
145
+ API-created domains are canonicalized and created idempotently by Console.
146
+ They stay unverified and do not start reconnaissance.
147
+
136
148
  List pagination (for "apps" and "endpoints <appId>"):
137
149
  --limit <n> Page size (default 100, max 200)
138
150
  --offset <n> Page offset (default 0)
@@ -158,6 +170,8 @@ Endpoint fields (create requires --endpoint and --description):
158
170
  --endpoint <text> Endpoint path / URL / route
159
171
  --description <text> Endpoint description
160
172
  --type <type> One of: ${ENDPOINT_TYPES.join(", ")}
173
+ --transport <transport> One of: ${ENDPOINT_TRANSPORTS.join(", ")}
174
+ (defaults to http when omitted)
161
175
  --location <text> Source file (whitebox)
162
176
  --start-line <n> Start line number
163
177
  --end-line <n> End line number
@@ -235,6 +249,7 @@ function parseEndpointCreateOptions(argv) {
235
249
  if (description === undefined)
236
250
  throw new Error("--description is required");
237
251
  const type = parseEndpointType(getFlag("--type", argv));
252
+ const transport = parseTransport(getFlag("--transport", argv));
238
253
  const location = getFlag("--location", argv);
239
254
  const startLineNumber = parseInteger("--start-line", getFlag("--start-line", argv));
240
255
  const endLineNumber = parseInteger("--end-line", getFlag("--end-line", argv));
@@ -246,6 +261,7 @@ function parseEndpointCreateOptions(argv) {
246
261
  endpoint,
247
262
  description,
248
263
  ...type !== undefined ? { type } : {},
264
+ ...transport !== undefined ? { transport } : {},
249
265
  ...location !== undefined ? { location } : {},
250
266
  ...startLineNumber !== undefined ? { startLineNumber } : {},
251
267
  ...endLineNumber !== undefined ? { endLineNumber } : {},
@@ -269,6 +285,9 @@ function parseEndpointUpdateOptions(argv) {
269
285
  const type = parseEndpointType(getFlag("--type", argv));
270
286
  if (type !== undefined)
271
287
  update.type = type;
288
+ const transport = parseTransport(getFlag("--transport", argv));
289
+ if (transport !== undefined)
290
+ update.transport = transport;
272
291
  const location = getFlag("--location", argv);
273
292
  if (location !== undefined)
274
293
  update.location = location;
@@ -305,7 +324,7 @@ async function main() {
305
324
  if (!appId) {
306
325
  console.error("Error: app ID is required");
307
326
  console.error("Usage: pensar apps get <appId>");
308
- process.exit(1);
327
+ return markCommandFailed();
309
328
  }
310
329
  const app = await getApp(appId);
311
330
  console.log(JSON.stringify(app, null, 2));
@@ -318,7 +337,7 @@ async function main() {
318
337
  if (!appId) {
319
338
  console.error("Error: app ID is required");
320
339
  console.error("Usage: pensar apps update <appId> [options]");
321
- process.exit(1);
340
+ return markCommandFailed();
322
341
  }
323
342
  const opts = parseAppUpdateOptions(args);
324
343
  const result = await updateApp(appId, opts);
@@ -328,16 +347,28 @@ async function main() {
328
347
  if (!appId) {
329
348
  console.error("Error: app ID is required");
330
349
  console.error("Usage: pensar apps delete <appId>");
331
- process.exit(1);
350
+ return markCommandFailed();
332
351
  }
333
352
  const result = await deleteApp(appId);
334
353
  console.log(JSON.stringify(result, null, 2));
354
+ } else if (sub === "domains") {
355
+ const result = await listDomains();
356
+ console.log(JSON.stringify(result, null, 2));
357
+ } else if (sub === "domain-create") {
358
+ const url = args[1];
359
+ if (!url) {
360
+ console.error("Error: domain is required");
361
+ console.error("Usage: pensar apps domain-create <domain>");
362
+ return markCommandFailed();
363
+ }
364
+ const result = await createDomain({ url });
365
+ console.log(JSON.stringify(result, null, 2));
335
366
  } else if (sub === "endpoints") {
336
367
  const appId = args[1];
337
368
  if (!appId) {
338
369
  console.error("Error: app ID is required");
339
370
  console.error("Usage: pensar apps endpoints <appId> [filters]");
340
- process.exit(1);
371
+ return markCommandFailed();
341
372
  }
342
373
  const type = parseEndpointType(getFlag("--type", args));
343
374
  const minRiskScore = parseNumber("--min-risk", getFlag("--min-risk", args));
@@ -356,7 +387,7 @@ async function main() {
356
387
  if (!endpointId) {
357
388
  console.error("Error: endpoint ID is required");
358
389
  console.error("Usage: pensar apps endpoint <endpointId>");
359
- process.exit(1);
390
+ return markCommandFailed();
360
391
  }
361
392
  const result = await getEndpoint(endpointId);
362
393
  console.log(JSON.stringify(result, null, 2));
@@ -365,7 +396,7 @@ async function main() {
365
396
  if (!appId) {
366
397
  console.error("Error: app ID is required");
367
398
  console.error("Usage: pensar apps endpoint-create <appId> --endpoint E --description D");
368
- process.exit(1);
399
+ return markCommandFailed();
369
400
  }
370
401
  const opts = parseEndpointCreateOptions(args);
371
402
  const result = await createEndpoint(appId, opts);
@@ -375,7 +406,7 @@ async function main() {
375
406
  if (!endpointId) {
376
407
  console.error("Error: endpoint ID is required");
377
408
  console.error("Usage: pensar apps endpoint-update <endpointId> [options]");
378
- process.exit(1);
409
+ return markCommandFailed();
379
410
  }
380
411
  const opts = parseEndpointUpdateOptions(args);
381
412
  const result = await updateEndpoint(endpointId, opts);
@@ -385,7 +416,7 @@ async function main() {
385
416
  if (!endpointId) {
386
417
  console.error("Error: endpoint ID is required");
387
418
  console.error("Usage: pensar apps endpoint-delete <endpointId>");
388
- process.exit(1);
419
+ return markCommandFailed();
389
420
  }
390
421
  const result = await deleteEndpoint(endpointId);
391
422
  console.log(JSON.stringify(result, null, 2));
@@ -394,7 +425,7 @@ async function main() {
394
425
  if (!query || query.startsWith("--")) {
395
426
  console.error("Error: search query is required");
396
427
  console.error("Usage: pensar apps search <query> [options]");
397
- process.exit(1);
428
+ return markCommandFailed();
398
429
  }
399
430
  const type = parseAppType(getFlag("--type", args));
400
431
  const limit = parseInteger("--limit", getFlag("--limit", args));
@@ -410,7 +441,7 @@ async function main() {
410
441
  if (!query || query.startsWith("--")) {
411
442
  console.error("Error: search query is required");
412
443
  console.error("Usage: pensar apps search-endpoints <query> [options]");
413
- process.exit(1);
444
+ return markCommandFailed();
414
445
  }
415
446
  const applicationId = getFlag("--app", args);
416
447
  const type = parseEndpointType(getFlag("--type", args));
@@ -438,12 +469,12 @@ async function main() {
438
469
  } else {
439
470
  console.error(`Error: Unknown subcommand "${sub}"`);
440
471
  showHelp();
441
- process.exit(1);
472
+ return markCommandFailed();
442
473
  }
443
474
  } catch (err) {
444
475
  console.error(`
445
476
  Error: ${err instanceof Error ? err.message : String(err)}`);
446
- process.exit(1);
477
+ return markCommandFailed();
447
478
  }
448
479
  }
449
- main();
480
+ await main();
@@ -1,46 +1,42 @@
1
1
  #!/usr/bin/env bun
2
- import"./cli-vq52kp7j.js";
3
- import"./cli-5k33webc.js";
4
- import"./cli-gq40s5b3.js";
5
- import"./cli-b1adytsy.js";
6
- import"./cli-mavved45.js";
7
- import"./cli-xshasbwe.js";
8
- import"./cli-32z0017y.js";
9
- import"./cli-k8kc47pq.js";
10
- import"./cli-9fsre5pt.js";
11
- import"./cli-qqt4gj1w.js";
12
- import"./cli-repbyhkk.js";
13
- import"./cli-tznv8pf1.js";
14
- import"./cli-fw5r7pfj.js";
15
- import"./cli-c8131c4q.js";
16
- import"./cli-tkc598ey.js";
17
2
  import {
18
- createWorkspaceSelection,
19
- disconnect,
20
- ensureValidToken,
21
- fetchWorkspaces,
3
+ config2,
4
+ init_config
5
+ } from "./cli-wfb4gde1.js";
6
+ import {
22
7
  getPensarApiUrl,
23
8
  getPensarConsoleUrl,
24
- init_auth,
25
- isConnected,
26
- pollForWorkspaceCreation,
27
- pollLegacyToken,
28
- pollWorkOSToken,
29
- pollWorkspaceSelection,
30
- selectWorkspace,
31
- startDeviceFlow
32
- } from "./cli-0n4r54hq.js";
33
- import"./cli-swpbx60z.js";
34
- import"./cli-j54qa6tm.js";
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-j1916nvj.js";
22
+ import"./cli-qkb3v2nw.js";
23
+ import"./cli-n4h7ygp5.js";
24
+ import"./cli-8kkaeb70.js";
25
+ import"./cli-gq5sk2j3.js";
26
+ import"./cli-gamfs2yq.js";
27
+ import"./cli-jw1xftqm.js";
28
+ import"./cli-3v9zs5wm.js";
29
+ import"./cli-4z46kyrk.js";
30
+ import"./cli-q45hcq3f.js";
31
+ import"./cli-vkxx4jzv.js";
35
32
  import {
36
- config,
37
- init_config
38
- } from "./cli-72cvcqhg.js";
39
- import"./cli-9rhzhgx2.js";
40
- import"./cli-vnynf0js.js";
33
+ markCommandFailed
34
+ } from "./cli-z82n3qk1.js";
35
+ import"./cli-qba2x69h.js";
36
+ import"./cli-qktcyj48.js";
41
37
  import {
42
38
  __require
43
- } from "./cli-bc05qbss.js";
39
+ } from "./cli-h6y3bt60.js";
44
40
 
45
41
  // src/cli/auth.ts
46
42
  import * as readline from "node:readline";
@@ -74,7 +70,7 @@ function prompt(question) {
74
70
  });
75
71
  }
76
72
  async function selectWorkspaceInBrowser(apiUrl, accessToken) {
77
- const selection = await createWorkspaceSelection(apiUrl, accessToken);
73
+ const selection = await createWorkspaceSelection2(apiUrl, accessToken);
78
74
  openUrl(selection.selectionUrl);
79
75
  console.log(`
80
76
  You have multiple workspaces. Choose one in your browser to continue.
@@ -82,12 +78,12 @@ If the browser didn't open, visit:
82
78
  ${selection.selectionUrl}
83
79
 
84
80
  Waiting for workspace selection...`);
85
- return pollWorkspaceSelection(apiUrl, accessToken, selection.selectionId);
81
+ return pollWorkspaceSelection2(apiUrl, accessToken, selection.selectionId);
86
82
  }
87
83
  async function login() {
88
- const appConfig = await config.get();
89
- const hasStoredCredentials = isConnected(appConfig);
90
- const validToken = hasStoredCredentials ? await ensureValidToken({
84
+ const appConfig = await config2.get();
85
+ const hasStoredCredentials = isConnected2(appConfig);
86
+ const validToken = hasStoredCredentials ? await ensureValidToken2({
91
87
  accessToken: appConfig.accessToken,
92
88
  refreshToken: appConfig.refreshToken,
93
89
  pensarAPIKey: appConfig.pensarAPIKey
@@ -110,7 +106,7 @@ Pensar Console — Managed Inference
110
106
  Connect for usage-based AI inference. No API keys needed.
111
107
  `);
112
108
  const apiUrl = getPensarApiUrl();
113
- const flowInfo = await startDeviceFlow(apiUrl);
109
+ const flowInfo = await startDeviceFlow2(apiUrl);
114
110
  if (flowInfo.mode === "workos") {
115
111
  const { clientId, deviceInfo } = flowInfo;
116
112
  openUrl(deviceInfo.verification_uri_complete);
@@ -121,13 +117,13 @@ If not, open this URL:
121
117
  Your code: ${deviceInfo.user_code}
122
118
 
123
119
  Waiting for browser authorization...`);
124
- const tokens = await pollWorkOSToken({
120
+ const tokens = await pollWorkOSToken2({
125
121
  clientId,
126
122
  deviceCode: deviceInfo.device_code,
127
123
  interval: deviceInfo.interval,
128
124
  expiresIn: deviceInfo.expires_in
129
125
  });
130
- await config.update({
126
+ await config2.update({
131
127
  accessToken: tokens.accessToken,
132
128
  refreshToken: tokens.refreshToken
133
129
  });
@@ -144,7 +140,7 @@ If not, open this URL:
144
140
  Your code: ${deviceInfo.userCode}
145
141
 
146
142
  Waiting for browser authorization...`);
147
- const data = await pollLegacyToken({
143
+ const data = await pollLegacyToken2({
148
144
  apiUrl,
149
145
  deviceCode: deviceInfo.deviceCode,
150
146
  interval: deviceInfo.interval,
@@ -155,12 +151,12 @@ Waiting for browser authorization...`);
155
151
  if (!apiKey) {
156
152
  throw new Error("Pensar Console did not return an API key");
157
153
  }
158
- await config.update({
154
+ await config2.update({
159
155
  pensarAPIKey: apiKey,
160
156
  gatewaySigningKey: data.signingKey ?? null
161
157
  });
162
158
  if (data.workspace) {
163
- await config.update({
159
+ await config2.update({
164
160
  workspaceId: data.workspace.id,
165
161
  workspaceSlug: data.workspace.slug
166
162
  });
@@ -176,7 +172,7 @@ Waiting for browser authorization...`);
176
172
  }
177
173
  }
178
174
  async function handleWorkspaces(apiUrl, accessToken) {
179
- const wsResult = await fetchWorkspaces(apiUrl, accessToken);
175
+ const wsResult = await fetchWorkspaces2(apiUrl, accessToken);
180
176
  let workspaces = wsResult.workspaces;
181
177
  const consoleUrl = wsResult.consoleUrl ?? getPensarConsoleUrl();
182
178
  if (workspaces.length === 0) {
@@ -186,7 +182,7 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
186
182
  `);
187
183
  openUrl(`${consoleUrl}/create-workspace?redirect=/credits`);
188
184
  console.log("Waiting for workspace creation...");
189
- workspaces = await pollForWorkspaceCreation(apiUrl, accessToken);
185
+ workspaces = await pollForWorkspaceCreation2(apiUrl, accessToken);
190
186
  }
191
187
  let workspaceId;
192
188
  if (workspaces.length === 1) {
@@ -198,9 +194,9 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
198
194
  } else {
199
195
  workspaceId = await selectWorkspaceInBrowser(apiUrl, accessToken);
200
196
  }
201
- const result = await selectWorkspace(apiUrl, accessToken, workspaceId);
197
+ const result = await selectWorkspace2(apiUrl, accessToken, workspaceId);
202
198
  const workspace = result.workspace;
203
- await config.update({
199
+ await config2.update({
204
200
  workspaceId: workspace.id,
205
201
  workspaceSlug: workspace.slug,
206
202
  gatewaySigningKey: result.signingKey ?? null
@@ -223,21 +219,21 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
223
219
  console.log("\nPensar models are now available. Run `pensar` to get started.");
224
220
  }
225
221
  async function logout() {
226
- const appConfig = await config.get();
227
- if (!isConnected(appConfig)) {
222
+ const appConfig = await config2.get();
223
+ if (!isConnected2(appConfig)) {
228
224
  console.log("Not currently connected to Pensar Console.");
229
225
  return;
230
226
  }
231
- await disconnect();
227
+ await disconnect2();
232
228
  console.log("✓ Disconnected from Pensar Console.");
233
229
  }
234
230
  async function status() {
235
- const appConfig = await config.get();
236
- if (!isConnected(appConfig)) {
231
+ const appConfig = await config2.get();
232
+ if (!isConnected2(appConfig)) {
237
233
  console.log("Not connected to Pensar Console.\n\nRun `pensar login` to connect.");
238
234
  return;
239
235
  }
240
- const validToken = await ensureValidToken({
236
+ const validToken = await ensureValidToken2({
241
237
  accessToken: appConfig.accessToken,
242
238
  refreshToken: appConfig.refreshToken,
243
239
  pensarAPIKey: appConfig.pensarAPIKey
@@ -255,7 +251,7 @@ async function status() {
255
251
  if (res.ok) {
256
252
  const data = await res.json();
257
253
  if (data.workspace) {
258
- await config.update({
254
+ await config2.update({
259
255
  workspaceId: data.workspace.id,
260
256
  workspaceSlug: data.workspace.slug
261
257
  });
@@ -300,12 +296,12 @@ async function main() {
300
296
  } else {
301
297
  console.error(`Unknown auth subcommand: ${subcommand}`);
302
298
  console.error("Run 'pensar login --help' for usage information");
303
- process.exit(1);
299
+ return markCommandFailed();
304
300
  }
305
301
  } catch (err) {
306
302
  console.error(`
307
303
  Error: ${err instanceof Error ? err.message : String(err)}`);
308
- process.exit(1);
304
+ return markCommandFailed();
309
305
  }
310
306
  }
311
- main();
307
+ await main();
@@ -0,0 +1,12 @@
1
+ import {
2
+ BlackboxAttackSurfaceAgent2
3
+ } from "./cli-8kkaeb70.js";
4
+ import"./cli-qba2x69h.js";
5
+ import"./cli-qkb3v2nw.js";
6
+ import"./cli-n4h7ygp5.js";
7
+ import"./cli-j1916nvj.js";
8
+ import"./cli-qktcyj48.js";
9
+ import"./cli-wfb4gde1.js";
10
+ export {
11
+ BlackboxAttackSurfaceAgent2 as BlackboxAttackSurfaceAgent
12
+ };