@pensar/apex 2.0.1 → 2.0.2-canary.09dbe74f

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-x7n47c84.js → agent-067x1n67.js} +9 -9
  2. package/build/{agent-6nhperp2.js → agent-3n8msbqb.js} +10 -8
  3. package/build/agent-m3bsrs09.js +19 -0
  4. package/build/{apps-2ac4vt09.js → apps-7fhwknrj.js} +20 -15
  5. package/build/{auth-bmt98hz0.js → auth-a1z7ew5p.js} +15 -15
  6. package/build/authentication-69q16waz.js +19 -0
  7. package/build/blackboxAgent-80y8j499.js +19 -0
  8. package/build/{blackboxPentest-xngbtdxb.js → blackboxPentest-aay3kx94.js} +13 -13
  9. package/build/{cli-hk03x6fq.js → cli-117ypqqj.js} +2 -1
  10. package/build/{cli-fa7nrded.js → cli-2hw7jen3.js} +5 -5
  11. package/build/{cli-zpdmnz8c.js → cli-2p56h4nq.js} +881 -373
  12. package/build/{cli-mfzkhttr.js → cli-5e5gq617.js} +22 -20
  13. package/build/{cli-ddtmgbqv.js → cli-8q9kr0x9.js} +2 -2
  14. package/build/{cli-z1dapp7v.js → cli-a3pzv462.js} +71 -33
  15. package/build/{cli-eptabm2j.js → cli-eg35gebv.js} +1 -1
  16. package/build/{cli-0yptvbbm.js → cli-hh404jw6.js} +10 -9
  17. package/build/{cli-1f5zzrxj.js → cli-k8zpadm5.js} +1 -1
  18. package/build/{cli-f93g10xk.js → cli-mcn1ar96.js} +2 -2
  19. package/build/{cli-pyzw545d.js → cli-ncecs1a9.js} +76 -11
  20. package/build/{cli-w2st266h.js → cli-pppvjz87.js} +33 -4
  21. package/build/{cli-fxtbkw2f.js → cli-pyz8tnrp.js} +6 -6
  22. package/build/{cli-8xknm7d9.js → cli-q24twygk.js} +1 -1
  23. package/build/{cli-8g5cwvbm.js → cli-r9yh5mka.js} +2 -2
  24. package/build/{cli-cc13ydyx.js → cli-sgrt7t9v.js} +9 -9
  25. package/build/{cli-88bhxzr1.js → cli-tt7ps59g.js} +4 -4
  26. package/build/cli.js +52 -47
  27. package/build/{config-j0gfjhrm.js → config-8rnbn2d0.js} +4 -4
  28. package/build/{doctor-zn8ms7gs.js → doctor-jddjv64a.js} +8 -8
  29. package/build/{fixes-d8ytvyzn.js → fixes-rfrer4t8.js} +15 -15
  30. package/build/{index-hjvqqkem.js → index-0nz7y997.js} +4 -4
  31. package/build/{index-2t2cg8x0.js → index-mk5mxrjd.js} +8 -8
  32. package/build/{index-k6ttkac6.js → index-nw5vbcg9.js} +13 -12
  33. package/build/{index-528cyewc.js → index-pr80jx2t.js} +116 -70
  34. package/build/{index-a1sy2zak.js → index-rg2czyx7.js} +2 -2
  35. package/build/{index-3cbcjqw1.js → index-speg9ebc.js} +9 -9
  36. package/build/{index-9d2es97h.js → index-syz3srk7.js} +3 -3
  37. package/build/{issues-17kdjtdg.js → issues-484xb633.js} +15 -15
  38. package/build/{logs-r4rjar4m.js → logs-kmw11amx.js} +15 -15
  39. package/build/{offesecAgent-azd8ahkm.js → offesecAgent-ykx4cmb1.js} +8 -8
  40. package/build/{parse-15kqmy2v.js → parse-7djk9jyf.js} +1 -1
  41. package/build/pentest-4v06edvf.js +28 -0
  42. package/build/{pentests-npjb5q1h.js → pentests-jpc8hjdm.js} +15 -15
  43. package/build/{targetedPentest-m24wvscc.js → targetedPentest-zkezvsdt.js} +9 -9
  44. package/build/targets-p4d186xd.js +113 -0
  45. package/build/threatModel-k41x41eg.js +26 -0
  46. package/build/{uninstall-7pm6zcah.js → uninstall-s75nx85e.js} +9 -9
  47. package/build/{upload-wg0vxmk0.js → upload-57y9k8gs.js} +6 -6
  48. package/build/{utils-gd1y4t26.js → utils-dwkm0fb2.js} +5 -5
  49. package/package.json +9 -8
  50. package/build/agent-4g69jwmq.js +0 -19
  51. package/build/authentication-c0aj9zaz.js +0 -19
  52. package/build/blackboxAgent-sgph70e4.js +0 -19
  53. package/build/pentest-2vsjf0j8.js +0 -28
  54. package/build/threatModel-7akmfzzm.js +0 -26
@@ -7,21 +7,21 @@ import {
7
7
  buildThreatModelPrompt,
8
8
  createSkillsRegistry,
9
9
  runOffensiveSecurityAgent
10
- } from "./cli-pyzw545d.js";
10
+ } from "./cli-ncecs1a9.js";
11
11
  import {
12
12
  REPORT_FILENAME_MD,
13
13
  convertModelMessagesToUI,
14
14
  loadSubagents,
15
15
  readExecutionMetrics,
16
16
  writeExecutionMetrics
17
- } from "./cli-mfzkhttr.js";
18
- import"./cli-fxtbkw2f.js";
19
- import"./cli-w2st266h.js";
20
- import"./cli-fa7nrded.js";
21
- import"./cli-f93g10xk.js";
22
- import"./cli-ddtmgbqv.js";
17
+ } from "./cli-5e5gq617.js";
18
+ import"./cli-pyz8tnrp.js";
19
+ import"./cli-pppvjz87.js";
20
+ import"./cli-2hw7jen3.js";
21
+ import"./cli-mcn1ar96.js";
22
+ import"./cli-8q9kr0x9.js";
23
23
  import"./cli-9fsre5pt.js";
24
- import"./cli-hk03x6fq.js";
24
+ import"./cli-117ypqqj.js";
25
25
  import {
26
26
  ALL_TOOL_NAMES,
27
27
  ASK_USER_QUESTIONS_TOOL_NAME,
@@ -37,14 +37,14 @@ import {
37
37
  hasPlan,
38
38
  planFilePath,
39
39
  readPlan
40
- } from "./cli-zpdmnz8c.js";
40
+ } from "./cli-2p56h4nq.js";
41
41
  import {
42
42
  detectOSAndEnhancePrompt
43
- } from "./cli-cc13ydyx.js";
43
+ } from "./cli-sgrt7t9v.js";
44
44
  import {
45
45
  formatParseError,
46
46
  parseHeaderLine
47
- } from "./cli-8xknm7d9.js";
47
+ } from "./cli-q24twygk.js";
48
48
  import {
49
49
  createThreatModelPrompt
50
50
  } from "./cli-fw5r7pfj.js";
@@ -56,7 +56,7 @@ import {
56
56
  import {
57
57
  createWeaveTracer,
58
58
  resolveConfig
59
- } from "./cli-1f5zzrxj.js";
59
+ } from "./cli-k8zpadm5.js";
60
60
  import {
61
61
  AVAILABLE_PROVIDERS,
62
62
  init_types
@@ -82,7 +82,7 @@ import {
82
82
  stepCountIs,
83
83
  write,
84
84
  writeErrorLog
85
- } from "./cli-z1dapp7v.js";
85
+ } from "./cli-a3pzv462.js";
86
86
  import {
87
87
  disconnect,
88
88
  fetchWorkspaces,
@@ -96,21 +96,21 @@ import {
96
96
  selectWorkspace,
97
97
  startDeviceFlow,
98
98
  validateGateway
99
- } from "./cli-8g5cwvbm.js";
99
+ } from "./cli-r9yh5mka.js";
100
100
  import"./cli-e6rgwtpb.js";
101
101
  import"./cli-gpnb45ck.js";
102
102
  import {
103
103
  config,
104
104
  init_config as init_config2
105
- } from "./cli-eptabm2j.js";
105
+ } from "./cli-eg35gebv.js";
106
106
  import {
107
107
  init_config,
108
108
  update
109
- } from "./cli-88bhxzr1.js";
109
+ } from "./cli-tt7ps59g.js";
110
110
  import {
111
111
  checkForUpdate,
112
112
  init_installation
113
- } from "./cli-0yptvbbm.js";
113
+ } from "./cli-hh404jw6.js";
114
114
  import {
115
115
  __commonJS,
116
116
  __esm,
@@ -53209,7 +53209,7 @@ function ModelPicker({
53209
53209
  if (expandedProviders.has("local")) {
53210
53210
  items.push({ type: "local-input", field: "url" });
53211
53211
  items.push({ type: "local-input", field: "model" });
53212
- const localModels = groupedModels["local"];
53212
+ const localModels = groupedModels.local;
53213
53213
  if (localModels) {
53214
53214
  for (const m of localModels) {
53215
53215
  items.push({ type: "model", model: m });
@@ -53460,7 +53460,7 @@ function ModelPicker({
53460
53460
  const providerName = providerNames[provider] || provider;
53461
53461
  const isFocused = isProviderFocused(provider);
53462
53462
  if (provider === "local") {
53463
- const localModels = groupedModels["local"];
53463
+ const localModels = groupedModels.local;
53464
53464
  const modelCount = localModels?.length ?? 0;
53465
53465
  const elements2 = [];
53466
53466
  elements2.push(/* @__PURE__ */ jsxDEV4(PickerRow, {
@@ -54246,7 +54246,7 @@ function extractHostLabel(host) {
54246
54246
  }
54247
54247
  function extractHostFromUrl(url) {
54248
54248
  const m = /^https?:\/\/([^\/?#:]+)/i.exec(url);
54249
- return m && m[1] ? m[1] : null;
54249
+ return m?.[1] ? m[1] : null;
54250
54250
  }
54251
54251
  function extractOrgLabel(text) {
54252
54252
  const first = text.trim().split(/\s+/)[0];
@@ -54352,8 +54352,8 @@ function deobfuscate(input) {
54352
54352
  init_config2();
54353
54353
 
54354
54354
  // src/tui/utils/command-flags.ts
54355
- import { readFileSync } from "fs";
54356
- import { isAbsolute, resolve } from "path";
54355
+ import { readFileSync } from "node:fs";
54356
+ import { isAbsolute, resolve } from "node:path";
54357
54357
  init_toolset();
54358
54358
  function combinePromptParts(threatModel, prompt) {
54359
54359
  const parts = [];
@@ -54496,7 +54496,7 @@ function parseWebFlags(args) {
54496
54496
  flags._hostsExplicitlyProvided = true;
54497
54497
  }
54498
54498
  if (raw.ports) {
54499
- flags.ports = String(raw.ports).split(",").map((p) => parseInt(p.trim(), 10)).filter((p) => !isNaN(p));
54499
+ flags.ports = String(raw.ports).split(",").map((p) => parseInt(p.trim(), 10)).filter((p) => !Number.isNaN(p));
54500
54500
  }
54501
54501
  if (flags.target) {
54502
54502
  const parsed = parseTargetUrl(flags.target);
@@ -54804,6 +54804,47 @@ var commands = [
54804
54804
  });
54805
54805
  }
54806
54806
  },
54807
+ {
54808
+ name: "prompt-injection",
54809
+ aliases: ["pi"],
54810
+ description: "Test LLM prompt-injection defenses",
54811
+ category: "Pentesting",
54812
+ options: [
54813
+ {
54814
+ name: "--library",
54815
+ valueHint: "<path>",
54816
+ description: "Local prompt-injection payload library path"
54817
+ },
54818
+ {
54819
+ name: "--target",
54820
+ valueHint: "<url>",
54821
+ description: "Target application or endpoint"
54822
+ }
54823
+ ],
54824
+ handler: async (args, ctx2) => {
54825
+ const skillArgs = {};
54826
+ for (let i = 0;i < args.length; i++) {
54827
+ if (args[i] === "--library" && args[i + 1]) {
54828
+ skillArgs.library = args[++i];
54829
+ } else if (args[i] === "--target" && args[i + 1]) {
54830
+ skillArgs.target = args[++i];
54831
+ }
54832
+ }
54833
+ ctx2.navigate({
54834
+ type: "operator",
54835
+ nonce: Date.now(),
54836
+ initialConfig: {
54837
+ requireApproval: true,
54838
+ target: skillArgs.target,
54839
+ promptInjectionLibrarySource: skillArgs.library
54840
+ },
54841
+ initialSkill: {
54842
+ slug: "prompt-injection",
54843
+ args: skillArgs
54844
+ }
54845
+ });
54846
+ }
54847
+ },
54807
54848
  {
54808
54849
  name: "resume",
54809
54850
  aliases: ["sessions", "s"],
@@ -54817,7 +54858,7 @@ var commands = [
54817
54858
  name: "new",
54818
54859
  description: "Start a new operator session",
54819
54860
  category: "Pentesting",
54820
- handler: async (args, ctx2) => {
54861
+ handler: async (_args, ctx2) => {
54821
54862
  ctx2.navigate({ type: "operator", nonce: Date.now() });
54822
54863
  }
54823
54864
  },
@@ -54826,7 +54867,7 @@ var commands = [
54826
54867
  aliases: ["auth"],
54827
54868
  description: "Connect to Pensar Console for managed inference",
54828
54869
  category: "Configuration",
54829
- handler: async (args, ctx2) => {
54870
+ handler: async (_args, ctx2) => {
54830
54871
  ctx2.openAuthDialog?.();
54831
54872
  }
54832
54873
  },
@@ -54835,7 +54876,7 @@ var commands = [
54835
54876
  aliases: ["buy"],
54836
54877
  description: "Buy credits / check balance",
54837
54878
  category: "Configuration",
54838
- handler: async (args, ctx2) => {
54879
+ handler: async (_args, ctx2) => {
54839
54880
  ctx2.openCreditsDialog?.();
54840
54881
  }
54841
54882
  },
@@ -54843,7 +54884,7 @@ var commands = [
54843
54884
  name: "models",
54844
54885
  description: "Show available AI models",
54845
54886
  category: "Configuration",
54846
- handler: async (args, ctx2) => {
54887
+ handler: async (_args, ctx2) => {
54847
54888
  ctx2.openModelDialog?.();
54848
54889
  }
54849
54890
  },
@@ -54851,7 +54892,7 @@ var commands = [
54851
54892
  name: "providers",
54852
54893
  description: "Manage AI providers and API keys",
54853
54894
  category: "Configuration",
54854
- handler: async (args, ctx2) => {
54895
+ handler: async (_args, ctx2) => {
54855
54896
  ctx2.openProvidersDialog?.();
54856
54897
  }
54857
54898
  },
@@ -54946,7 +54987,7 @@ var commands = [
54946
54987
  name: "help",
54947
54988
  description: "Show help dialog",
54948
54989
  category: "General",
54949
- handler: async (args, ctx2) => {
54990
+ handler: async (_args, ctx2) => {
54950
54991
  ctx2.openHelpDialog?.();
54951
54992
  }
54952
54993
  },
@@ -54972,7 +55013,7 @@ var commands = [
54972
55013
  description: "View and manage active tools (session only)",
54973
55014
  category: "General",
54974
55015
  hidden: true,
54975
- handler: async (args, ctx2) => {
55016
+ handler: async (_args, ctx2) => {
54976
55017
  if (ctx2.route.type !== "operator") {
54977
55018
  return;
54978
55019
  }
@@ -55072,7 +55113,7 @@ function patchFromString() {
55072
55113
  }
55073
55114
  function patchChildrenSetter() {
55074
55115
  const descriptor = Object.getOwnPropertyDescriptor(TextNodeRenderable.prototype, "children");
55075
- if (!descriptor || !descriptor.set) {
55116
+ if (!descriptor?.set) {
55076
55117
  throw new Error("Obfuscation patch: TextNodeRenderable.prototype.children setter not found.");
55077
55118
  }
55078
55119
  const originalSetter = descriptor.set;
@@ -55582,10 +55623,10 @@ function DialogProvider({ children }) {
55582
55623
  children,
55583
55624
  /* @__PURE__ */ jsxDEV11("box", {
55584
55625
  position: "absolute",
55585
- children: stack.length > 0 && (stack[stack.length - 1].bare ? stack[stack.length - 1].element : /* @__PURE__ */ jsxDEV11(Dialog, {
55626
+ children: stack.length > 0 && (stack[stack.length - 1]?.bare ? stack[stack.length - 1]?.element : /* @__PURE__ */ jsxDEV11(Dialog, {
55586
55627
  onClose: clear,
55587
55628
  size,
55588
- children: stack[stack.length - 1].element
55629
+ children: stack[stack.length - 1]?.element
55589
55630
  }, undefined, false, undefined, this))
55590
55631
  }, undefined, false, undefined, this)
55591
55632
  ]
@@ -55715,6 +55756,7 @@ var TOOL_SUMMARY_MAP = {
55715
55756
  browser_screenshot: () => "screenshot",
55716
55757
  nuclei_scan: (args) => `nuclei ${args.templates || "all"} -> ${args.target || ""}`,
55717
55758
  document_finding: (args) => `finding: ${args.title || args.name || ""}`,
55759
+ list_prompt_injections: (args) => args.category ? `prompt injections: ${args.category}` : "prompt injections",
55718
55760
  smart_enumerate: (args) => `smart_enumerate ${args.target || args.url || ""}`,
55719
55761
  get_attack_surface: (args) => `get_attack_surface ${args.target || args.url || ""}`,
55720
55762
  Task: (args) => args.description || "Task",
@@ -55858,7 +55900,7 @@ function DialogControls({ controls }) {
55858
55900
  "]"
55859
55901
  ]
55860
55902
  }, undefined, true, undefined, this),
55861
- " " + control.label
55903
+ ` ${control.label}`
55862
55904
  ]
55863
55905
  }, control.key, true, undefined, this))
55864
55906
  }, undefined, false, undefined, this);
@@ -57123,7 +57165,7 @@ function markdownToStyledText(rawContent, colors2) {
57123
57165
  const mutedColor = colors2?.textMuted ?? RGBA22.fromInts(150, 150, 150, 255);
57124
57166
  const codeColor = colors2?.markdownCode ?? RGBA22.fromInts(100, 255, 100, 255);
57125
57167
  const linkColor = colors2?.markdownLink ?? RGBA22.fromInts(100, 200, 255, 255);
57126
- if (!content || !content.trim()) {
57168
+ if (!content?.trim()) {
57127
57169
  return new StyledText([
57128
57170
  { __isChunk: true, text: content || "", fg: textColor, attributes: 0 }
57129
57171
  ]);
@@ -57219,7 +57261,7 @@ function markdownToStyledText(rawContent, colors2) {
57219
57261
  } else if (token.type === "code") {
57220
57262
  chunks.push({
57221
57263
  __isChunk: true,
57222
- text: token.text + `
57264
+ text: `${token.text}
57223
57265
  `,
57224
57266
  fg: codeColor,
57225
57267
  attributes: 0
@@ -57263,11 +57305,11 @@ function markdownToStyledText(rawContent, colors2) {
57263
57305
  if (lastChunk && lastChunk.text === `
57264
57306
  `) {
57265
57307
  chunks.pop();
57266
- } else if (lastChunk && lastChunk.text.endsWith(`
57308
+ } else if (lastChunk?.text.endsWith(`
57267
57309
 
57268
57310
  `)) {
57269
57311
  lastChunk.text = lastChunk.text.slice(0, -1);
57270
- } else if (lastChunk && lastChunk.text) {
57312
+ } else if (lastChunk?.text) {
57271
57313
  lastChunk.text = lastChunk.text.trimEnd();
57272
57314
  if (lastChunk.text === "") {
57273
57315
  chunks.pop();
@@ -57640,7 +57682,7 @@ var DiscoverySection = memo(function DiscoverySection2({
57640
57682
  visibleTargets.map((t) => {
57641
57683
  const obj = t.objectives.length > 0 ? ` — ${t.objectives.join(", ")}` : "";
57642
57684
  const full = `${t.target}${obj}`;
57643
- const line = full.length > targetMaxWidth ? full.slice(0, targetMaxWidth - 1) + "…" : full;
57685
+ const line = full.length > targetMaxWidth ? `${full.slice(0, targetMaxWidth - 1)}…` : full;
57644
57686
  return /* @__PURE__ */ jsxDEV19("text", {
57645
57687
  fg: colors2.textMuted,
57646
57688
  children: [
@@ -57739,7 +57781,7 @@ var ReportingSection = memo(function ReportingSection2({
57739
57781
  const { colors: colors2 } = useTheme();
57740
57782
  const headerLabel = reporting.status === "complete" ? `Report Complete · ${reporting.findingsCount ?? 0} finding${(reporting.findingsCount ?? 0) !== 1 ? "s" : ""}` : reporting.label || "Report Generation";
57741
57783
  const severityOrder = ["critical", "high", "medium", "low", "info"];
57742
- const severityParts = reporting.findingsBySeverity ? severityOrder.filter((s) => reporting.findingsBySeverity[s]).map((s) => `${reporting.findingsBySeverity[s]} ${s}`) : [];
57784
+ const severityParts = reporting.findingsBySeverity ? severityOrder.filter((s) => reporting.findingsBySeverity?.[s]).map((s) => `${reporting.findingsBySeverity?.[s]} ${s}`) : [];
57743
57785
  return /* @__PURE__ */ jsxDEV19("box", {
57744
57786
  flexDirection: "column",
57745
57787
  children: [
@@ -57778,6 +57820,7 @@ var ReportingSection = memo(function ReportingSection2({
57778
57820
  import { StyledText as StyledText3 } from "@opentui/core";
57779
57821
 
57780
57822
  // src/tui/components/shared/syntax-highlight.ts
57823
+ import { extname } from "node:path";
57781
57824
  import { StyledText as StyledText2 } from "@opentui/core";
57782
57825
 
57783
57826
  // node_modules/highlight.js/es/index.js
@@ -57785,7 +57828,6 @@ var import_lib = __toESM(require_lib(), 1);
57785
57828
  var es_default = import_lib.default;
57786
57829
 
57787
57830
  // src/tui/components/shared/syntax-highlight.ts
57788
- import { extname } from "path";
57789
57831
  function buildClassColorMap(colors2) {
57790
57832
  return {
57791
57833
  "hljs-keyword": colors2.syntaxKeyword,
@@ -59056,15 +59098,15 @@ function extractStreamableContent(args) {
59056
59098
  if (typeof args.evidence === "string")
59057
59099
  text += `
59058
59100
 
59059
- ` + args.evidence;
59101
+ ${args.evidence}`;
59060
59102
  if (typeof args.impact === "string")
59061
59103
  text += `
59062
59104
 
59063
- ` + args.impact;
59105
+ ${args.impact}`;
59064
59106
  if (typeof args.remediation === "string")
59065
59107
  text += `
59066
59108
 
59067
- ` + args.remediation;
59109
+ ${args.remediation}`;
59068
59110
  return text;
59069
59111
  }
59070
59112
  if (typeof args.title === "string" && typeof args.content === "string") {
@@ -59074,7 +59116,7 @@ ${args.content}`;
59074
59116
  return null;
59075
59117
  }
59076
59118
  function tryParsePartialJson(text) {
59077
- if (!text || !text.trimStart().startsWith("{"))
59119
+ if (!text?.trimStart().startsWith("{"))
59078
59120
  return null;
59079
59121
  try {
59080
59122
  const result = JSON.parse(text);
@@ -59141,7 +59183,7 @@ import {
59141
59183
  } from "react";
59142
59184
 
59143
59185
  // src/tui/components/shared/prompt-input-logic.ts
59144
- function computeUpArrow(currentState, history, suggestionsCount) {
59186
+ function computeUpArrow(currentState, history, _suggestionsCount) {
59145
59187
  const inAutocomplete = currentState.selectedSuggestionIndex >= 0;
59146
59188
  if (inAutocomplete) {
59147
59189
  if (currentState.selectedSuggestionIndex <= 0) {
@@ -59435,8 +59477,8 @@ function truncateToLines(text, lineWidth, maxLines) {
59435
59477
  current = word;
59436
59478
  }
59437
59479
  i++;
59438
- } else if ((current + " " + word).length <= lineWidth) {
59439
- current += " " + word;
59480
+ } else if (`${current} ${word}`.length <= lineWidth) {
59481
+ current += ` ${word}`;
59440
59482
  i++;
59441
59483
  } else {
59442
59484
  lines.push(current);
@@ -59448,7 +59490,7 @@ function truncateToLines(text, lineWidth, maxLines) {
59448
59490
  }
59449
59491
  if (i < words.length || wordSliced) {
59450
59492
  const last = lines[lines.length - 1];
59451
- lines[lines.length - 1] = last.length < lineWidth ? last + "…" : last.slice(0, lineWidth - 1) + "…";
59493
+ lines[lines.length - 1] = last.length < lineWidth ? `${last}…` : `${last.slice(0, lineWidth - 1)}…`;
59452
59494
  }
59453
59495
  return lines.join(`
59454
59496
  `);
@@ -59651,7 +59693,7 @@ var PromptInput = forwardRef(function PromptInput2({
59651
59693
  const completionCtx = slashCtx ?? (optCtx ? { token: optCtx.token, start: optCtx.start, end: optCtx.end } : null);
59652
59694
  if (completionCtx) {
59653
59695
  const text = textareaRef.current?.plainText ?? "";
59654
- const completedValue = optCtx && !slashCtx ? tabResult.acceptedValue + " " : tabResult.acceptedValue;
59696
+ const completedValue = optCtx && !slashCtx ? `${tabResult.acceptedValue} ` : tabResult.acceptedValue;
59655
59697
  const { newText, cursorOffset } = computeInlineCompletion(text, completionCtx, completedValue);
59656
59698
  textareaRef.current?.setText(newText);
59657
59699
  setInputValue(newText);
@@ -61692,7 +61734,7 @@ function HelpDialog({ onClose }) {
61692
61734
  const cat = cmd.category || "General";
61693
61735
  if (!byCategory.has(cat))
61694
61736
  byCategory.set(cat, []);
61695
- byCategory.get(cat).push(cmd);
61737
+ byCategory.get(cat)?.push(cmd);
61696
61738
  }
61697
61739
  for (const cat of categories) {
61698
61740
  const cmds = byCategory.get(cat);
@@ -62818,8 +62860,8 @@ import { useCallback as useCallback16, useEffect as useEffect18, useRef as useRe
62818
62860
  init_session();
62819
62861
 
62820
62862
  // src/tui/hooks/use-sessions-list.ts
62821
- import { existsSync, readdirSync } from "fs";
62822
- import { join } from "path";
62863
+ import { existsSync, readdirSync } from "node:fs";
62864
+ import { join } from "node:path";
62823
62865
  import { useCallback as useCallback15, useEffect as useEffect17, useState as useState27 } from "react";
62824
62866
  init_session();
62825
62867
  function countFindings(findingsPath) {
@@ -64026,7 +64068,7 @@ function WebWizard({
64026
64068
  if (state.scope.allowedHosts.length > 0 || state.scope.allowedPorts.length > 0) {
64027
64069
  sessionConfig.scopeConstraints = {
64028
64070
  allowedHosts: state.scope.allowedHosts,
64029
- allowedPorts: state.scope.allowedPorts.map((p) => parseInt(p, 10)).filter((p) => !isNaN(p)),
64071
+ allowedPorts: state.scope.allowedPorts.map((p) => parseInt(p, 10)).filter((p) => !Number.isNaN(p)),
64030
64072
  strictScope: state.scope.strictScope
64031
64073
  };
64032
64074
  }
@@ -64701,7 +64743,7 @@ function ErrorBoundary({ children }) {
64701
64743
  }
64702
64744
 
64703
64745
  // src/tui/components/footer.tsx
64704
- import os from "os";
64746
+ import os from "node:os";
64705
64747
 
64706
64748
  // src/tui/context/session.tsx
64707
64749
  init_session();
@@ -64772,7 +64814,7 @@ function Footer({
64772
64814
  const effectiveCwd = sessionCwd || cwd;
64773
64815
  const relativeCwd = effectiveCwd.split(os.homedir()).pop() || "";
64774
64816
  const segments = relativeCwd.split("/").filter(Boolean);
64775
- const rawDisplayCwd = segments.length <= 2 ? "~/" + segments.join("/") : "…/" + segments.slice(-2).join("/");
64817
+ const rawDisplayCwd = segments.length <= 2 ? `~/${segments.join("/")}` : `…/${segments.slice(-2).join("/")}`;
64776
64818
  const displayCwd = obfuscateEnabled ? "~/[workdir]" : rawDisplayCwd;
64777
64819
  const showCwd = termWidth >= 100;
64778
64820
  const session = useSession();
@@ -64918,9 +64960,9 @@ function ContextProgress({
64918
64960
 
64919
64961
  // src/tui/components/operator-dashboard/index.tsx
64920
64962
  init_dist();
64963
+ import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync } from "node:fs";
64964
+ import { isAbsolute as isAbsolute2, join as join3, resolve as resolve2 } from "node:path";
64921
64965
  import { useKeyboard as useKeyboard25 } from "@opentui/react";
64922
- import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync } from "fs";
64923
- import { isAbsolute as isAbsolute2, join as join3, resolve as resolve2 } from "path";
64924
64966
  import {
64925
64967
  useCallback as useCallback19,
64926
64968
  useEffect as useEffect25,
@@ -65131,7 +65173,7 @@ var SUBAGENT_TOOLS = new Set([
65131
65173
  "spawn_coding_agent",
65132
65174
  "delegate_to_auth_subagent"
65133
65175
  ]);
65134
- function getLoadingState(messages, hasPendingTool, isLastAssistant, pendingToolName) {
65176
+ function getLoadingState(_messages, hasPendingTool, isLastAssistant, pendingToolName) {
65135
65177
  if (hasPendingTool) {
65136
65178
  if (pendingToolName && SUBAGENT_TOOLS.has(pendingToolName)) {
65137
65179
  return "waiting";
@@ -65377,7 +65419,7 @@ var MIN_CONTENT_HEIGHT = 10;
65377
65419
  function normalizeQuestion(q2, index) {
65378
65420
  const fallbackHeader = `Q${index + 1}`;
65379
65421
  const trimmedHeader = (q2.header ?? "").trim();
65380
- const header = trimmedHeader.length === 0 ? fallbackHeader : trimmedHeader.length > 20 ? trimmedHeader.slice(0, 19) + "…" : trimmedHeader;
65422
+ const header = trimmedHeader.length === 0 ? fallbackHeader : trimmedHeader.length > 20 ? `${trimmedHeader.slice(0, 19)}…` : trimmedHeader;
65381
65423
  const options = (q2.options ?? []).slice(0, 4);
65382
65424
  return {
65383
65425
  ...q2,
@@ -65824,7 +65866,7 @@ function TabBar({
65824
65866
  }, undefined, false, undefined, this)
65825
65867
  ]
65826
65868
  }, undefined, true, undefined, this)
65827
- }, isSubmit ? "submit" : q2.id, false, undefined, this);
65869
+ }, isSubmit ? "submit" : q2?.id, false, undefined, this);
65828
65870
  }),
65829
65871
  hiddenAfter > 0 && /* @__PURE__ */ jsxDEV49("text", {
65830
65872
  fg: colors2.textMuted,
@@ -65907,7 +65949,7 @@ function Row({
65907
65949
  children: [
65908
65950
  /* @__PURE__ */ jsxDEV49("text", {
65909
65951
  fg: markerColor,
65910
- children: marker + " "
65952
+ children: `${marker} `
65911
65953
  }, undefined, false, undefined, this),
65912
65954
  /* @__PURE__ */ jsxDEV49("text", {
65913
65955
  children: [
@@ -65931,7 +65973,7 @@ function Row({
65931
65973
  flexDirection: "row",
65932
65974
  children: /* @__PURE__ */ jsxDEV49("text", {
65933
65975
  fg: descColor,
65934
- children: " " + (question.multiSelect ? " " : "") + opt.description
65976
+ children: ` ${question.multiSelect ? " " : ""}${opt.description}`
65935
65977
  }, undefined, false, undefined, this)
65936
65978
  }, undefined, false, undefined, this) : null
65937
65979
  ]
@@ -65947,7 +65989,7 @@ function Row({
65947
65989
  children: [
65948
65990
  /* @__PURE__ */ jsxDEV49("text", {
65949
65991
  fg: markerColor,
65950
- children: marker + " "
65992
+ children: `${marker} `
65951
65993
  }, undefined, false, undefined, this),
65952
65994
  /* @__PURE__ */ jsxDEV49("text", {
65953
65995
  children: [
@@ -65986,7 +66028,7 @@ function Row({
65986
66028
  children: [
65987
66029
  /* @__PURE__ */ jsxDEV49("text", {
65988
66030
  fg: markerColor,
65989
- children: marker + " "
66031
+ children: `${marker} `
65990
66032
  }, undefined, false, undefined, this),
65991
66033
  /* @__PURE__ */ jsxDEV49("text", {
65992
66034
  fg: focused ? colors2.primary : colors2.textMuted,
@@ -66538,7 +66580,7 @@ function QueuedMessages({
66538
66580
  }, undefined, false, undefined, this),
66539
66581
  messages.map((msg, index) => {
66540
66582
  const isSelected = index === selectedIndex;
66541
- const displayText = msg.text.length > 80 ? msg.text.slice(0, 77) + "…" : msg.text;
66583
+ const displayText = msg.text.length > 80 ? `${msg.text.slice(0, 77)}…` : msg.text;
66542
66584
  return /* @__PURE__ */ jsxDEV51("box", {
66543
66585
  flexDirection: "row",
66544
66586
  gap: 1,
@@ -66854,14 +66896,14 @@ function getLastActivity(session, maxLen) {
66854
66896
  const icon = isPending ? "○" : m2.status === "error" ? "✗" : "✓";
66855
66897
  const label = getToolDisplayLabel(m2.toolName, m2.args ?? {});
66856
66898
  const line = `${icon} ${label}`;
66857
- return line.length > maxLen ? line.slice(0, maxLen - 1) + "…" : line;
66899
+ return line.length > maxLen ? `${line.slice(0, maxLen - 1)}…` : line;
66858
66900
  }
66859
66901
  if (m2.role === "assistant" && typeof m2.content === "string" && m2.content.trim()) {
66860
66902
  const lines = m2.content.trim().split(`
66861
66903
  `);
66862
66904
  const last = lines[lines.length - 1].trim();
66863
66905
  if (last) {
66864
- return last.length > maxLen ? last.slice(0, maxLen - 1) + "…" : last;
66906
+ return last.length > maxLen ? `${last.slice(0, maxLen - 1)}…` : last;
66865
66907
  }
66866
66908
  }
66867
66909
  }
@@ -67979,6 +68021,7 @@ Error: ${errMsg}
67979
68021
  enableThinking: reasoningEnabled && modelSupportsThinking(model.id),
67980
68022
  openAIReasoningEffort: modelSupportsOpenAIReasoning(model.id) ? openAIReasoningEffort : undefined,
67981
68023
  surfaceIntegrationEnabled: config2.data?.surfaceIntegrationEnabled,
68024
+ promptInjectionLibrarySource: initialConfig?.promptInjectionLibrarySource ?? (route.data.type === "operator" ? route.data.initialSkill?.args?.library : undefined),
67982
68025
  onStepFinish,
67983
68026
  onCacheMetrics: (metrics) => {
67984
68027
  addCacheUsage(metrics.cacheReadInputTokens, metrics.cacheCreationInputTokens);
@@ -68064,7 +68107,8 @@ Error: ${errMsg}
68064
68107
  agentCwd: initialConfig?.sandbox ? undefined : process.cwd(),
68065
68108
  codebasePath: initialConfig?.sandbox ? undefined : process.cwd(),
68066
68109
  taskDriven: initialConfig?.taskDriven,
68067
- ...initialConfig?.headers !== undefined ? { headers: { ...initialConfig.headers } } : {}
68110
+ ...initialConfig?.headers !== undefined ? { headers: { ...initialConfig.headers } } : {},
68111
+ promptInjectionLibrarySource: initialConfig?.promptInjectionLibrarySource ?? (route.data.type === "operator" ? route.data.initialSkill?.args?.library : undefined)
68068
68112
  };
68069
68113
  agentResult = await runOffensiveSecurityAgent({
68070
68114
  ...commonInput,
@@ -68170,6 +68214,8 @@ Error: ${errMsg}
68170
68214
  initialConfig?.taskDriven,
68171
68215
  initialConfig?.target,
68172
68216
  initialConfig?.headers,
68217
+ initialConfig?.promptInjectionLibrarySource,
68218
+ route.data,
68173
68219
  setSessionCwd,
68174
68220
  subagentStore.setState,
68175
68221
  skillsRegistry.buildCatalog,
@@ -69676,7 +69722,7 @@ function AppContent({
69676
69722
  toast(`Update available: v${currentVersion} → v${latestVersion}. Run: pensar upgrade`, "warn", 8000);
69677
69723
  });
69678
69724
  const checkAuthToken = async () => {
69679
- const { isTokenExpired, isConnected: isConnected2 } = await import("./index-hjvqqkem.js");
69725
+ const { isTokenExpired, isConnected: isConnected2 } = await import("./index-0nz7y997.js");
69680
69726
  if (isConnected2(config2.data) && config2.data.accessToken && isTokenExpired(config2.data.accessToken, 60) && !config2.data.refreshToken && !config2.data.pensarAPIKey) {
69681
69727
  toast("Your Pensar Console session has expired. Run /login to refresh.", "warn", 8000);
69682
69728
  }
@@ -3,8 +3,8 @@ import {
3
3
  init,
4
4
  init_config,
5
5
  update
6
- } from "./cli-88bhxzr1.js";
7
- import"./cli-0yptvbbm.js";
6
+ } from "./cli-tt7ps59g.js";
7
+ import"./cli-hh404jw6.js";
8
8
  import"./cli-8rxa073f.js";
9
9
 
10
10
  // src/core/config/index.ts
@@ -7,19 +7,19 @@ import {
7
7
  WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT,
8
8
  WHITEBOX_DISCOVERY_SYSTEM_PROMPT,
9
9
  WhiteboxAttackSurfaceAgent
10
- } from "./cli-ddtmgbqv.js";
10
+ } from "./cli-8q9kr0x9.js";
11
11
  import"./cli-9fsre5pt.js";
12
- import"./cli-hk03x6fq.js";
13
- import"./cli-zpdmnz8c.js";
14
- import"./cli-cc13ydyx.js";
12
+ import"./cli-117ypqqj.js";
13
+ import"./cli-2p56h4nq.js";
14
+ import"./cli-sgrt7t9v.js";
15
15
  import"./cli-c8131c4q.js";
16
- import"./cli-z1dapp7v.js";
17
- import"./cli-8g5cwvbm.js";
16
+ import"./cli-a3pzv462.js";
17
+ import"./cli-r9yh5mka.js";
18
18
  import"./cli-e6rgwtpb.js";
19
19
  import"./cli-gpnb45ck.js";
20
- import"./cli-eptabm2j.js";
21
- import"./cli-88bhxzr1.js";
22
- import"./cli-0yptvbbm.js";
20
+ import"./cli-eg35gebv.js";
21
+ import"./cli-tt7ps59g.js";
22
+ import"./cli-hh404jw6.js";
23
23
  import"./cli-8rxa073f.js";
24
24
  export {
25
25
  WhiteboxAttackSurfaceAgent,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  config,
3
3
  init_config
4
- } from "./cli-eptabm2j.js";
5
- import"./cli-88bhxzr1.js";
6
- import"./cli-0yptvbbm.js";
4
+ } from "./cli-eg35gebv.js";
5
+ import"./cli-tt7ps59g.js";
6
+ import"./cli-hh404jw6.js";
7
7
  import"./cli-8rxa073f.js";
8
8
  init_config();
9
9