@pensar/apex 1.2.0 → 1.3.0-canary.f6d7a6d1

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 (43) hide show
  1. package/build/{agent-hv2vnw37.js → agent-2a7a9vkp.js} +12 -10
  2. package/build/agent-r885xt2p.js +19 -0
  3. package/build/{auth-aj10f99d.js → auth-eyah4gg5.js} +4 -4
  4. package/build/{authentication-90mvv4kd.js → authentication-gkv5644m.js} +8 -7
  5. package/build/blackboxAgent-pz1m2qgd.js +19 -0
  6. package/build/{blackboxPentest-prq8qrhc.js → blackboxPentest-zeva1p2s.js} +14 -13
  7. package/build/{cli-33rkyxds.js → cli-0fy9j5dw.js} +2 -2
  8. package/build/cli-0ghkg3w6.js +20780 -0
  9. package/build/{cli-t0am6nqt.js → cli-4gg0e7zp.js} +1 -1
  10. package/build/{cli-1rz3jys3.js → cli-73yjzavm.js} +1 -1
  11. package/build/{cli-q43w92k5.js → cli-7bv8bdv6.js} +5 -3
  12. package/build/{cli-s43zrc3b.js → cli-7qr65rt6.js} +3353 -24027
  13. package/build/{cli-qaaesy26.js → cli-942axn0y.js} +1 -1
  14. package/build/{cli-dvsj2p1x.js → cli-dj3jc5bq.js} +410 -375
  15. package/build/{cli-avnfgjhs.js → cli-h2vwr2b3.js} +3 -3
  16. package/build/{cli-2mnefwqh.js → cli-hxegwkcg.js} +1 -1
  17. package/build/{cli-erp6djfj.js → cli-kx4mh9b9.js} +11 -9
  18. package/build/{cli-4m9f65ze.js → cli-s9fq1gez.js} +1 -1
  19. package/build/{cli-ypxq76sm.js → cli-x071hk62.js} +3 -3
  20. package/build/{cli-720fdbrk.js → cli-xv1d4cgj.js} +1 -1
  21. package/build/{cli-gqphezya.js → cli-ye1c6gz7.js} +2 -2
  22. package/build/{cli-3sg681re.js → cli-zm5htfj3.js} +2 -2
  23. package/build/cli.js +126 -23
  24. package/build/{fixes-g7b34fs5.js → fixes-v3ydfqpe.js} +4 -4
  25. package/build/{index-9j9dqpdd.js → index-66d5h9d5.js} +4 -4
  26. package/build/index-dw1xbhfn.js +12268 -0
  27. package/build/{index-fds2qfsc.js → index-h0n7kjbs.js} +10 -10
  28. package/build/index-jcrwgbaz.js +32 -0
  29. package/build/{index-cpj7zx72.js → index-q7jya07x.js} +853 -141
  30. package/build/{index-ftdt7ktr.js → index-zy8wgxwc.js} +2 -2
  31. package/build/{issues-tecf6w97.js → issues-9w54wf9a.js} +4 -4
  32. package/build/{logs-5qwr98mr.js → logs-d9zgppn7.js} +4 -4
  33. package/build/offesecAgent-ppbv80cs.js +26 -0
  34. package/build/pentest-663b978f.js +29 -0
  35. package/build/{pentests-bsh9ht7r.js → pentests-3g8pbrk3.js} +4 -4
  36. package/build/{projects-zkw40bda.js → projects-3qxp342f.js} +4 -4
  37. package/build/{targetedPentest-6qpsqdx5.js → targetedPentest-krm97f3d.js} +9 -8
  38. package/build/{threatModel-g0azznnt.js → threatModel-jsqeh9md.js} +9 -8
  39. package/build/{uninstall-0yjhkdk3.js → uninstall-k7g5jpkt.js} +1 -1
  40. package/package.json +1 -1
  41. package/build/agent-jkr50v3q.js +0 -18
  42. package/build/blackboxAgent-f2y66hex.js +0 -18
  43. package/build/pentest-5p1ahtr6.js +0 -28
@@ -16,24 +16,29 @@ import {
16
16
  update,
17
17
  write,
18
18
  writeRaw
19
- } from "./cli-q43w92k5.js";
19
+ } from "./cli-7bv8bdv6.js";
20
20
  import {
21
21
  parseTargetUrl
22
22
  } from "./cli-3y0dgy56.js";
23
23
  import {
24
24
  ToolsetStateSchema,
25
+ exports_toolset,
26
+ generateObjectResponse,
27
+ hasToolCall,
28
+ init_toolset,
29
+ require_tslib,
30
+ streamResponse,
31
+ toggleTool
32
+ } from "./cli-7qr65rt6.js";
33
+ import {
25
34
  _enum,
26
35
  _null,
27
36
  array,
28
37
  boolean,
29
38
  custom,
30
39
  discriminatedUnion,
31
- exports_external,
40
+ exports_external1 as exports_external,
32
41
  exports_iso,
33
- exports_toolset,
34
- generateObjectResponse,
35
- hasToolCall,
36
- init_toolset,
37
42
  init_zod,
38
43
  intersection,
39
44
  literal,
@@ -43,27 +48,24 @@ import {
43
48
  optional,
44
49
  preprocess,
45
50
  record,
46
- require_tslib,
47
51
  safeParse,
48
- streamResponse,
49
52
  string,
50
- toggleTool,
51
53
  tool,
52
54
  union,
53
55
  unknown,
54
56
  zod_default
55
- } from "./cli-s43zrc3b.js";
57
+ } from "./cli-0ghkg3w6.js";
56
58
  import {
57
59
  signGatewayRequest
58
- } from "./cli-720fdbrk.js";
60
+ } from "./cli-xv1d4cgj.js";
59
61
  import {
60
62
  config,
61
63
  ensureValidToken,
62
64
  getPensarApiUrl
63
- } from "./cli-2mnefwqh.js";
65
+ } from "./cli-hxegwkcg.js";
64
66
  import {
65
67
  getCurrentVersion
66
- } from "./cli-qaaesy26.js";
68
+ } from "./cli-942axn0y.js";
67
69
  import {
68
70
  __commonJS,
69
71
  __require,
@@ -91304,6 +91306,112 @@ var require_imap_commands = __commonJS((exports, module) => {
91304
91306
  ]);
91305
91307
  });
91306
91308
 
91309
+ // src/core/eventBus.ts
91310
+ import { EventEmitter } from "events";
91311
+ var CHILD_BUS_FORWARDED_EVENTS = [
91312
+ "text-delta",
91313
+ "tool-call-start",
91314
+ "tool-call-delta",
91315
+ "tool-call-complete",
91316
+ "tool-result",
91317
+ "subagent-spawn",
91318
+ "subagent-complete",
91319
+ "command-output",
91320
+ "error",
91321
+ "step-finish"
91322
+ ];
91323
+
91324
+ class AgentEventBus {
91325
+ emitter = new EventEmitter;
91326
+ constructor() {
91327
+ this.emitter.setMaxListeners(50);
91328
+ }
91329
+ on(event, handler) {
91330
+ this.emitter.on(event, handler);
91331
+ return this;
91332
+ }
91333
+ once(event, handler) {
91334
+ this.emitter.once(event, handler);
91335
+ return this;
91336
+ }
91337
+ off(event, handler) {
91338
+ this.emitter.off(event, handler);
91339
+ return this;
91340
+ }
91341
+ emit(event, payload) {
91342
+ return this.emitter.emit(event, payload);
91343
+ }
91344
+ removeAllListeners(event) {
91345
+ if (event) {
91346
+ this.emitter.removeAllListeners(event);
91347
+ } else {
91348
+ this.emitter.removeAllListeners();
91349
+ }
91350
+ return this;
91351
+ }
91352
+ static attachChild(child, parent, subagentId) {
91353
+ for (const key of CHILD_BUS_FORWARDED_EVENTS) {
91354
+ child.on(key, (payload) => {
91355
+ if (!parent)
91356
+ return;
91357
+ const p = payload;
91358
+ if (!p.subagentId) {
91359
+ parent.emit(key, { ...p, subagentId });
91360
+ } else {
91361
+ parent.emit(key, payload);
91362
+ }
91363
+ });
91364
+ }
91365
+ }
91366
+ emitStreamPart(chunk, subagentId) {
91367
+ switch (chunk.type) {
91368
+ case "text-delta":
91369
+ this.emit("text-delta", { text: chunk.text, subagentId });
91370
+ break;
91371
+ case "tool-input-start":
91372
+ this.emit("tool-call-start", {
91373
+ toolCallId: chunk.id,
91374
+ toolName: chunk.toolName,
91375
+ subagentId
91376
+ });
91377
+ break;
91378
+ case "tool-input-delta":
91379
+ this.emit("tool-call-delta", {
91380
+ toolCallId: chunk.id,
91381
+ argsTextDelta: chunk.delta,
91382
+ subagentId
91383
+ });
91384
+ break;
91385
+ case "tool-call": {
91386
+ const tc = chunk;
91387
+ this.emit("tool-call-complete", {
91388
+ toolCallId: tc.toolCallId,
91389
+ toolName: tc.toolName,
91390
+ args: tc.args ?? tc.input,
91391
+ subagentId
91392
+ });
91393
+ break;
91394
+ }
91395
+ case "tool-result": {
91396
+ const tr = chunk;
91397
+ this.emit("tool-result", {
91398
+ toolCallId: tr.toolCallId,
91399
+ toolName: tr.toolName,
91400
+ result: tr.result ?? tr.output,
91401
+ subagentId
91402
+ });
91403
+ break;
91404
+ }
91405
+ case "error":
91406
+ this.emit("error", {
91407
+ error: chunk.error,
91408
+ subagentId
91409
+ });
91410
+ break;
91411
+ }
91412
+ }
91413
+ }
91414
+
91307
91415
  // src/core/findings/registry.ts
91308
91416
  init_zod();
91309
91417
  import { existsSync, readdirSync, readFileSync } from "fs";
@@ -91678,6 +91786,33 @@ class FindingsRegistry {
91678
91786
  }
91679
91787
  }
91680
91788
 
91789
+ // src/core/agents/offSecAgent/tools/askUserQuestions.ts
91790
+ init_zod();
91791
+ var ASK_USER_QUESTIONS_TOOL_NAME = "ask_user_questions";
91792
+ var AskUserQuestionSchema = exports_external.object({
91793
+ id: exports_external.string().describe('Stable identifier for the question (e.g. "deployment-model"). Used to correlate the answer.'),
91794
+ header: exports_external.string().describe('Very short tab label, ideally ≤20 chars. Examples: "Deployment", "Auth method", "Concerns".'),
91795
+ question: exports_external.string(),
91796
+ multiSelect: exports_external.boolean().optional().describe("True if the user can pick multiple options. Defaults to false."),
91797
+ allowFreeform: exports_external.boolean().optional().describe("True if the user can supply a freeform answer in addition to the predefined options. Defaults to true."),
91798
+ options: exports_external.array(exports_external.object({
91799
+ id: exports_external.string(),
91800
+ label: exports_external.string(),
91801
+ description: exports_external.string().optional()
91802
+ })).describe("2–3 predefined options for the user to choose from. Do NOT include " + '"Other" or "Type something" here — the UI renders a freeform input ' + "automatically when `allowFreeform` is true. Keep options short and " + "grounded in observed code.")
91803
+ });
91804
+ function askUserQuestions(_ctx) {
91805
+ return tool({
91806
+ description: "Stop the agent and ask the user a batch of grounded multi-choice questions. " + "Aim for 1–5 questions per call. Each question MUST include: a short `header` " + '(ideally ≤20 chars, used as the tab label, e.g. "Deployment", "Auth method", "Concerns"); ' + "the `question` text; and 2–3 predefined `options`. Option labels MUST reference something " + "observed in the codebase — not generic templates. " + "Do NOT include an extra 'Other' or 'Type something' option in the predefined list — the UI " + "renders a freeform input automatically when `allowFreeform` is true (the default). Keep " + "predefined options short (a few words each) so the user can scan them quickly. " + "The consumer of this agent collects answers and resumes with a tool-result in the message history.",
91807
+ inputSchema: exports_external.object({
91808
+ questions: exports_external.array(AskUserQuestionSchema).nonempty()
91809
+ }),
91810
+ execute: async ({ questions }) => {
91811
+ return { ok: true, pendingQuestionCount: questions.length };
91812
+ }
91813
+ });
91814
+ }
91815
+
91681
91816
  // node_modules/tldts/dist/cjs/index.js
91682
91817
  function shareSameDomainSuffix(hostname, vhost) {
91683
91818
  if (hostname.endsWith(vhost)) {
@@ -99798,114 +99933,6 @@ function validateConcurrency(concurrency) {
99798
99933
 
99799
99934
  // src/core/agents/offSecAgent/tools/threatModelGenerator.ts
99800
99935
  init_zod();
99801
-
99802
- // src/core/eventBus.ts
99803
- import { EventEmitter } from "events";
99804
- var CHILD_BUS_FORWARDED_EVENTS = [
99805
- "text-delta",
99806
- "tool-call-start",
99807
- "tool-call-delta",
99808
- "tool-call-complete",
99809
- "tool-result",
99810
- "subagent-spawn",
99811
- "subagent-complete",
99812
- "command-output",
99813
- "error",
99814
- "step-finish"
99815
- ];
99816
-
99817
- class AgentEventBus {
99818
- emitter = new EventEmitter;
99819
- constructor() {
99820
- this.emitter.setMaxListeners(50);
99821
- }
99822
- on(event, handler) {
99823
- this.emitter.on(event, handler);
99824
- return this;
99825
- }
99826
- once(event, handler) {
99827
- this.emitter.once(event, handler);
99828
- return this;
99829
- }
99830
- off(event, handler) {
99831
- this.emitter.off(event, handler);
99832
- return this;
99833
- }
99834
- emit(event, payload) {
99835
- return this.emitter.emit(event, payload);
99836
- }
99837
- removeAllListeners(event) {
99838
- if (event) {
99839
- this.emitter.removeAllListeners(event);
99840
- } else {
99841
- this.emitter.removeAllListeners();
99842
- }
99843
- return this;
99844
- }
99845
- static attachChild(child, parent, subagentId) {
99846
- for (const key of CHILD_BUS_FORWARDED_EVENTS) {
99847
- child.on(key, (payload) => {
99848
- if (!parent)
99849
- return;
99850
- const p = payload;
99851
- if (!p.subagentId) {
99852
- parent.emit(key, { ...p, subagentId });
99853
- } else {
99854
- parent.emit(key, payload);
99855
- }
99856
- });
99857
- }
99858
- }
99859
- emitStreamPart(chunk, subagentId) {
99860
- switch (chunk.type) {
99861
- case "text-delta":
99862
- this.emit("text-delta", { text: chunk.text, subagentId });
99863
- break;
99864
- case "tool-input-start":
99865
- this.emit("tool-call-start", {
99866
- toolCallId: chunk.id,
99867
- toolName: chunk.toolName,
99868
- subagentId
99869
- });
99870
- break;
99871
- case "tool-input-delta":
99872
- this.emit("tool-call-delta", {
99873
- toolCallId: chunk.id,
99874
- argsTextDelta: chunk.delta,
99875
- subagentId
99876
- });
99877
- break;
99878
- case "tool-call": {
99879
- const tc = chunk;
99880
- this.emit("tool-call-complete", {
99881
- toolCallId: tc.toolCallId,
99882
- toolName: tc.toolName,
99883
- args: tc.args ?? tc.input,
99884
- subagentId
99885
- });
99886
- break;
99887
- }
99888
- case "tool-result": {
99889
- const tr = chunk;
99890
- this.emit("tool-result", {
99891
- toolCallId: tr.toolCallId,
99892
- toolName: tr.toolName,
99893
- result: tr.result ?? tr.output,
99894
- subagentId
99895
- });
99896
- break;
99897
- }
99898
- case "error":
99899
- this.emit("error", {
99900
- error: chunk.error,
99901
- subagentId
99902
- });
99903
- break;
99904
- }
99905
- }
99906
- }
99907
-
99908
- // src/core/agents/offSecAgent/tools/threatModelGenerator.ts
99909
99936
  var THREAT_MODEL_CONCURRENCY = 10;
99910
99937
  var threatModelLimiter = pLimit(THREAT_MODEL_CONCURRENCY);
99911
99938
  var PentestObjectiveSchema = exports_external.object({
@@ -99953,7 +99980,7 @@ async function generateThreatModelForEndpoint(ctx, input) {
99953
99980
  return threatModelLimiter(async () => {
99954
99981
  if (ctx.abortSignal?.aborted)
99955
99982
  return null;
99956
- const { CodeAgent } = await import("./agent-jkr50v3q.js");
99983
+ const { CodeAgent } = await import("./agent-r885xt2p.js");
99957
99984
  const subagentId = `threat-model-${sanitize(input.appName)}-${sanitize(input.routePath)}`;
99958
99985
  ctx.eventBus?.emit("subagent-spawn", {
99959
99986
  subagentId,
@@ -100642,7 +100669,7 @@ When to use delegate_to_auth_subagent vs authenticate_session:
100642
100669
  if (credentials) {
100643
100670
  ctx.session.credentialManager.addFromAuthCredentials(credentials);
100644
100671
  }
100645
- const { runAuthenticationAgent } = await import("./authentication-90mvv4kd.js");
100672
+ const { runAuthenticationAgent } = await import("./authentication-gkv5644m.js");
100646
100673
  const localBus = new AgentEventBus;
100647
100674
  AgentEventBus.attachChild(localBus, ctx.eventBus, subagentId);
100648
100675
  const result = await runAuthenticationAgent({
@@ -101555,7 +101582,7 @@ should be passed directly to spawn_pentest_swarm for deep testing.`,
101555
101582
  });
101556
101583
  if (cwd) {
101557
101584
  try {
101558
- const { WhiteboxAttackSurfaceAgent } = await import("./agent-hv2vnw37.js");
101585
+ const { WhiteboxAttackSurfaceAgent } = await import("./agent-2a7a9vkp.js");
101559
101586
  const localBus = new AgentEventBus;
101560
101587
  AgentEventBus.attachChild(localBus, ctx.eventBus, subagentId);
101561
101588
  const agent = new WhiteboxAttackSurfaceAgent({
@@ -101604,7 +101631,7 @@ should be passed directly to spawn_pentest_swarm for deep testing.`,
101604
101631
  }
101605
101632
  }
101606
101633
  try {
101607
- const { BlackboxAttackSurfaceAgent } = await import("./blackboxAgent-f2y66hex.js");
101634
+ const { BlackboxAttackSurfaceAgent } = await import("./blackboxAgent-pz1m2qgd.js");
101608
101635
  const localBus = new AgentEventBus;
101609
101636
  AgentEventBus.attachChild(localBus, ctx.eventBus, subagentId);
101610
101637
  const agent = new BlackboxAttackSurfaceAgent({
@@ -101680,7 +101707,7 @@ Pass every target you want tested — the swarm handles concurrency automaticall
101680
101707
  toolCallDescription: exports_external.string().describe("A concise, human-readable description of what this tool call is doing")
101681
101708
  }),
101682
101709
  execute: async ({ targets }) => {
101683
- const { runPentestSwarm, DEFAULT_CONCURRENCY } = await import("./pentest-5p1ahtr6.js");
101710
+ const { runPentestSwarm, DEFAULT_CONCURRENCY } = await import("./pentest-663b978f.js");
101684
101711
  if (!ctx.model) {
101685
101712
  return {
101686
101713
  success: false,
@@ -101808,7 +101835,7 @@ Returns an array of results with the text output from each agent.`,
101808
101835
  });
101809
101836
  }
101810
101837
  async function runSingleCodingAgent(ctx, codebasePath, objective, agentIndex, name) {
101811
- const { CodeAgent } = await import("./agent-jkr50v3q.js");
101838
+ const { CodeAgent } = await import("./agent-r885xt2p.js");
101812
101839
  const subagentId = `coding-agent-${agentIndex}`;
101813
101840
  ctx.eventBus?.emit("subagent-spawn", {
101814
101841
  subagentId,
@@ -101869,7 +101896,7 @@ Omit \`cwd\` for blackbox mode (live target probing only).`,
101869
101896
  toolCallDescription: exports_external.string().describe("A concise, human-readable description of what this tool call is doing")
101870
101897
  }),
101871
101898
  execute: async ({ target, cwd }) => {
101872
- const { runPentestWorkflow: workflow } = await import("./pentest-5p1ahtr6.js");
101899
+ const { runPentestWorkflow: workflow } = await import("./pentest-663b978f.js");
101873
101900
  if (!ctx.model) {
101874
101901
  return {
101875
101902
  success: false,
@@ -105904,33 +105931,6 @@ Only call this when the plan is complete and ready for review.`,
105904
105931
  }
105905
105932
  });
105906
105933
  }
105907
- // src/core/agents/offSecAgent/tools/askUserQuestions.ts
105908
- init_zod();
105909
- var ASK_USER_QUESTIONS_TOOL_NAME = "ask_user_questions";
105910
- var AskUserQuestionSchema = exports_external.object({
105911
- id: exports_external.string().describe('Stable identifier for the question (e.g. "deployment-model"). Used to correlate the answer.'),
105912
- header: exports_external.string().describe('Very short tab label, ideally ≤20 chars. Examples: "Deployment", "Auth method", "Concerns".'),
105913
- question: exports_external.string(),
105914
- multiSelect: exports_external.boolean().optional().describe("True if the user can pick multiple options. Defaults to false."),
105915
- allowFreeform: exports_external.boolean().optional().describe("True if the user can supply a freeform answer in addition to the predefined options. Defaults to true."),
105916
- options: exports_external.array(exports_external.object({
105917
- id: exports_external.string(),
105918
- label: exports_external.string(),
105919
- description: exports_external.string().optional()
105920
- })).describe("2–3 predefined options for the user to choose from. Do NOT include " + '"Other" or "Type something" here — the UI renders a freeform input ' + "automatically when `allowFreeform` is true. Keep options short and " + "grounded in observed code.")
105921
- });
105922
- function askUserQuestions(_ctx) {
105923
- return tool({
105924
- description: "Stop the agent and ask the user a batch of grounded multi-choice questions. " + "Aim for 1–5 questions per call. Each question MUST include: a short `header` " + '(ideally ≤20 chars, used as the tab label, e.g. "Deployment", "Auth method", "Concerns"); ' + "the `question` text; and 2–3 predefined `options`. Option labels MUST reference something " + "observed in the codebase — not generic templates. " + "Do NOT include an extra 'Other' or 'Type something' option in the predefined list — the UI " + "renders a freeform input automatically when `allowFreeform` is true (the default). Keep " + "predefined options short (a few words each) so the user can scan them quickly. " + "The consumer of this agent collects answers and resumes with a tool-result in the message history.",
105925
- inputSchema: exports_external.object({
105926
- questions: exports_external.array(AskUserQuestionSchema).nonempty()
105927
- }),
105928
- execute: async ({ questions }) => {
105929
- return { ok: true, pendingQuestionCount: questions.length };
105930
- }
105931
- });
105932
- }
105933
-
105934
105934
  // src/core/agents/offSecAgent/tools/index.ts
105935
105935
  function createAllTools(ctx) {
105936
105936
  return {
@@ -106069,6 +106069,206 @@ var PLAN_MODE_TOOL_NAMES = [
106069
106069
  ];
106070
106070
  var SKILL_TOOL_NAMES = ["read_skill"];
106071
106071
 
106072
+ // src/core/agents/offSecAgent/trace.ts
106073
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync11 } from "fs";
106074
+ import { createHash } from "crypto";
106075
+ import { dirname as dirname5 } from "path";
106076
+ var OUTPUT_PREVIEW_LIMIT = 2000;
106077
+ var INPUT_PREVIEW_LIMIT = 1000;
106078
+ var SYSTEM_PROMPT_HASH_PREFIX_LENGTH = 12;
106079
+ function stringifyOutput(output) {
106080
+ if (output == null)
106081
+ return { text: "", type: "text" };
106082
+ if (typeof output === "object" && "type" in output) {
106083
+ const typed = output;
106084
+ switch (typed.type) {
106085
+ case "text":
106086
+ case "error-text":
106087
+ return {
106088
+ text: String(typed.value ?? ""),
106089
+ type: typed.type
106090
+ };
106091
+ case "json":
106092
+ case "error-json":
106093
+ return {
106094
+ text: JSON.stringify(typed.value ?? null),
106095
+ type: typed.type
106096
+ };
106097
+ case "execution-denied":
106098
+ return {
106099
+ text: typed.reason ?? "execution denied",
106100
+ type: typed.type
106101
+ };
106102
+ case "content":
106103
+ return { text: JSON.stringify(typed.value ?? []), type: typed.type };
106104
+ default:
106105
+ return { text: JSON.stringify(output), type: "text" };
106106
+ }
106107
+ }
106108
+ if (typeof output === "string")
106109
+ return { text: output, type: "text" };
106110
+ return { text: JSON.stringify(output), type: "json" };
106111
+ }
106112
+ function preview(str, maxLen) {
106113
+ return str.length <= maxLen ? str : str.slice(0, maxLen);
106114
+ }
106115
+
106116
+ class StepTraceWriter {
106117
+ tracePath;
106118
+ agentId;
106119
+ eventBus;
106120
+ stepIndex = 0;
106121
+ cumulativeUsage = {
106122
+ inputTokens: 0,
106123
+ outputTokens: 0
106124
+ };
106125
+ lastStepTime;
106126
+ agentStartTime;
106127
+ summarized = false;
106128
+ previousMessageCount = 0;
106129
+ constructor(opts) {
106130
+ this.tracePath = opts.tracePath;
106131
+ this.agentId = opts.agentId;
106132
+ this.eventBus = opts.eventBus;
106133
+ const now = Date.now();
106134
+ this.agentStartTime = now;
106135
+ this.lastStepTime = now;
106136
+ mkdirSync11(dirname5(this.tracePath), { recursive: true });
106137
+ }
106138
+ writeInit(data) {
106139
+ const { systemPrompt, ...rest } = data;
106140
+ const record3 = {
106141
+ type: "init",
106142
+ timestamp: new Date().toISOString(),
106143
+ agentId: this.agentId,
106144
+ systemPromptHash: createHash("sha256").update(systemPrompt).digest("hex").slice(0, SYSTEM_PROMPT_HASH_PREFIX_LENGTH),
106145
+ systemPrompt,
106146
+ ...rest
106147
+ };
106148
+ this.appendRecord(record3);
106149
+ }
106150
+ markSummarized() {
106151
+ this.summarized = true;
106152
+ this.previousMessageCount = 0;
106153
+ }
106154
+ recordStep(responseMessages, usage) {
106155
+ const now = Date.now();
106156
+ const newMessages = responseMessages.slice(this.previousMessageCount);
106157
+ this.previousMessageCount = responseMessages.length;
106158
+ const observations = [];
106159
+ const reasoningParts = [];
106160
+ const textParts = [];
106161
+ const actions = [];
106162
+ for (const msg of newMessages) {
106163
+ if (!Array.isArray(msg.content)) {
106164
+ if (typeof msg.content === "string" && msg.role === "assistant") {
106165
+ textParts.push(msg.content);
106166
+ }
106167
+ continue;
106168
+ }
106169
+ for (const part of msg.content) {
106170
+ switch (part.type) {
106171
+ case "tool-result": {
106172
+ const { text, type } = stringifyOutput(part.output);
106173
+ observations.push({
106174
+ toolCallId: part.toolCallId,
106175
+ toolName: part.toolName,
106176
+ outputType: type,
106177
+ outputPreview: preview(text, OUTPUT_PREVIEW_LIMIT),
106178
+ outputLength: Buffer.byteLength(text, "utf-8")
106179
+ });
106180
+ break;
106181
+ }
106182
+ case "reasoning": {
106183
+ reasoningParts.push(part.text);
106184
+ break;
106185
+ }
106186
+ case "text": {
106187
+ textParts.push(part.text);
106188
+ break;
106189
+ }
106190
+ case "tool-call": {
106191
+ const serialized = JSON.stringify(part.input);
106192
+ actions.push({
106193
+ toolCallId: part.toolCallId,
106194
+ toolName: part.toolName,
106195
+ inputPreview: preview(serialized, INPUT_PREVIEW_LIMIT),
106196
+ inputLength: Buffer.byteLength(serialized, "utf-8")
106197
+ });
106198
+ break;
106199
+ }
106200
+ }
106201
+ }
106202
+ }
106203
+ const inputTokens = usage.inputTokens ?? 0;
106204
+ const outputTokens = usage.outputTokens ?? 0;
106205
+ const cacheReadTokens = usage.cacheReadTokens;
106206
+ const cacheWriteTokens = usage.cacheWriteTokens;
106207
+ this.cumulativeUsage.inputTokens += inputTokens;
106208
+ this.cumulativeUsage.outputTokens += outputTokens;
106209
+ if (cacheReadTokens != null) {
106210
+ this.cumulativeUsage.cacheReadTokens = (this.cumulativeUsage.cacheReadTokens ?? 0) + cacheReadTokens;
106211
+ }
106212
+ if (cacheWriteTokens != null) {
106213
+ this.cumulativeUsage.cacheWriteTokens = (this.cumulativeUsage.cacheWriteTokens ?? 0) + cacheWriteTokens;
106214
+ }
106215
+ const record3 = {
106216
+ type: "step",
106217
+ stepIndex: this.stepIndex,
106218
+ timestamp: new Date(now).toISOString(),
106219
+ agentId: this.agentId,
106220
+ observations: this.stepIndex === 0 ? null : observations.length > 0 ? observations : null,
106221
+ reasoning: reasoningParts.length > 0 ? reasoningParts.join("") : null,
106222
+ text: textParts.length > 0 ? textParts.join("") : null,
106223
+ actions,
106224
+ usage: { inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens },
106225
+ cumulativeUsage: { ...this.cumulativeUsage },
106226
+ stepDurationMs: now - this.lastStepTime,
106227
+ elapsedMs: now - this.agentStartTime,
106228
+ summarized: this.summarized
106229
+ };
106230
+ this.appendRecord(record3);
106231
+ this.stepIndex++;
106232
+ this.lastStepTime = now;
106233
+ this.summarized = false;
106234
+ }
106235
+ get currentStepIndex() {
106236
+ return this.stepIndex;
106237
+ }
106238
+ appendCheckpoint(data) {
106239
+ const record3 = {
106240
+ type: "checkpoint",
106241
+ stepIndex: this.stepIndex,
106242
+ timestamp: new Date().toISOString(),
106243
+ agentId: this.agentId,
106244
+ ...data
106245
+ };
106246
+ this.appendRecord(record3);
106247
+ }
106248
+ appendTaskRecord(data) {
106249
+ const record3 = {
106250
+ type: "task",
106251
+ timestamp: new Date().toISOString(),
106252
+ agentId: this.agentId,
106253
+ stepIndex: this.stepIndex,
106254
+ ...data
106255
+ };
106256
+ this.appendRecord(record3);
106257
+ }
106258
+ appendRecord(record3) {
106259
+ try {
106260
+ appendFileSync2(this.tracePath, JSON.stringify(record3) + `
106261
+ `);
106262
+ } catch {}
106263
+ try {
106264
+ this.eventBus?.emit("trace-record", {
106265
+ record: record3,
106266
+ subagentId: this.agentId ?? undefined
106267
+ });
106268
+ } catch {}
106269
+ }
106270
+ }
106271
+
106072
106272
  // src/core/agents/offSecAgent/tools/response.ts
106073
106273
  init_zod();
106074
106274
  var RESPONSE_TOOL_NAME = "response";
@@ -106076,10 +106276,10 @@ function createResponseTool(responseSchema, onResult) {
106076
106276
  return tool({
106077
106277
  description: `Submit your final structured response. Call this ONCE when you have completed your task and assembled all results. This ends your run — make sure all data is included.`,
106078
106278
  inputSchema: exports_external.object({
106079
- response: responseSchema
106279
+ result: responseSchema
106080
106280
  }),
106081
- execute: async ({ response }) => {
106082
- onResult(response);
106281
+ execute: async ({ result }) => {
106282
+ onResult(result);
106083
106283
  return { success: true, message: "Response submitted." };
106084
106284
  }
106085
106285
  });
@@ -106478,8 +106678,45 @@ function killDescendants(rootPid, signal) {
106478
106678
  }
106479
106679
 
106480
106680
  // src/core/agents/offSecAgent/prompt.ts
106681
+ import { existsSync as existsSync12, readdirSync as readdirSync3, statSync } from "fs";
106682
+ import { join as join18 } from "path";
106683
+ function buildProvidedFilesSection(sessionRootPath) {
106684
+ const providedDir = join18(sessionRootPath, "provided_files");
106685
+ if (!existsSync12(providedDir))
106686
+ return "";
106687
+ let entries;
106688
+ try {
106689
+ entries = readdirSync3(providedDir);
106690
+ } catch {
106691
+ return "";
106692
+ }
106693
+ const fileEntries = entries.filter((name) => name !== "README.md").map((name) => {
106694
+ try {
106695
+ const stat2 = statSync(join18(providedDir, name));
106696
+ if (!stat2.isFile())
106697
+ return null;
106698
+ return { name, size: stat2.size };
106699
+ } catch {
106700
+ return null;
106701
+ }
106702
+ }).filter((e) => e !== null);
106703
+ if (fileEntries.length === 0)
106704
+ return "";
106705
+ const lines = fileEntries.map((f) => `- \`provided_files/${f.name}\` (${f.size} bytes)`);
106706
+ return `
106707
+
106708
+ # Provided Files
106709
+
106710
+ The user has uploaded the following files for this session. They are available at \`${providedDir}\` (relative path: \`provided_files/\`) and may include sample payloads, reference documentation, test data, or other context the agent should consult when planning and executing its work.
106711
+
106712
+ ${lines.join(`
106713
+ `)}
106714
+
106715
+ Read these with \`read_file\` and list directory contents with \`list_files provided_files/\` as needed. A \`README.md\` inside \`provided_files/\` may include per-file descriptions supplied by the user — check it first before diving into individual files.`;
106716
+ }
106481
106717
  function buildSessionWorkspaceSection(session, agentCwd) {
106482
106718
  const sandboxMode = agentCwd === session.rootPath;
106719
+ const providedFilesSection = buildProvidedFilesSection(session.rootPath);
106483
106720
  if (sandboxMode) {
106484
106721
  return `
106485
106722
 
@@ -106493,8 +106730,9 @@ The session directory (${session.rootPath}) contains these subdirectories:
106493
106730
  - **scratchpad/** — your scratch space for working notes, intermediate data, wordlists, temporary scripts. **Do NOT write reports, executive summaries, or finding compilations here** — reports are generated automatically from findings/.
106494
106731
  - **logs/** — execution logs
106495
106732
  - **evidence/** — screenshots and evidence (written by browser tools)
106733
+ - **provided_files/** — user-uploaded files (sample payloads, docs, test data); populated when the project has workspace files configured.
106496
106734
 
106497
- Tools like \`document_vulnerability\` and browser evidence capture write to the correct subdirectories automatically.`;
106735
+ Tools like \`document_vulnerability\` and browser evidence capture write to the correct subdirectories automatically.${providedFilesSection}`;
106498
106736
  }
106499
106737
  return `
106500
106738
 
@@ -106509,8 +106747,9 @@ Session artifacts are stored separately at ${session.rootPath}:
106509
106747
  - **scratchpad/** — your scratch space
106510
106748
  - **logs/** — execution logs
106511
106749
  - **evidence/** — screenshots and evidence
106750
+ - **provided_files/** — user-uploaded files (sample payloads, docs, test data); populated when the project has workspace files configured.
106512
106751
 
106513
- Tools like \`document_vulnerability\` and browser evidence capture write to the session directory automatically.`;
106752
+ Tools like \`document_vulnerability\` and browser evidence capture write to the session directory automatically.${providedFilesSection}`;
106514
106753
  }
106515
106754
  function buildBaseSystemPrompt(options) {
106516
106755
  const sandboxMode = options?.sandboxMode ?? true;
@@ -106874,7 +107113,7 @@ class ApprovalTimeoutError extends ApprovalDeniedError {
106874
107113
  init_zod();
106875
107114
  import path from "path";
106876
107115
  import os from "os";
106877
- import { existsSync as existsSync12, readFileSync as readFileSync4 } from "fs";
107116
+ import { existsSync as existsSync13, readFileSync as readFileSync4 } from "fs";
106878
107117
  init_toolset();
106879
107118
  var DEFAULT_OUTCOME_GUIDANCE = "Prove the exploit can be run but do not exfiltrate data or cause any harm to the system. " + "Create proof-of-concept exploits that demonstrate the vulnerability exists without causing damage.";
106880
107119
  var EXFIL_OUTCOME_GUIDANCE = "Exfiltrate data to extract the flag value. " + "Create proof-of-concept exploits that successfully extract the flag from the target system.";
@@ -107090,7 +107329,6 @@ async function create(input) {
107090
107329
  scratchpadPath,
107091
107330
  findingsPath
107092
107331
  };
107093
- console.info("created session", result);
107094
107332
  const { _rateLimiter, credentialManager: _cm, ...sessionData } = result;
107095
107333
  await createSessionDirs({ session: result });
107096
107334
  await write(["sessions", result.id, "session"], sessionData);
@@ -107128,7 +107366,6 @@ async function update2(id, editor) {
107128
107366
  editor(draft);
107129
107367
  draft.time.updated = Date.now();
107130
107368
  });
107131
- console.info("updated session", result);
107132
107369
  return result;
107133
107370
  }
107134
107371
  async function* list2() {
@@ -107184,7 +107421,7 @@ async function loadOperatorState(sessionId) {
107184
107421
  try {
107185
107422
  const session = await get(sessionId);
107186
107423
  const statePath = path.join(session.rootPath, "messages.json");
107187
- if (!existsSync12(statePath))
107424
+ if (!existsSync13(statePath))
107188
107425
  return null;
107189
107426
  const data = readFileSync4(statePath, "utf-8");
107190
107427
  const parsed = JSON.parse(data);
@@ -107213,7 +107450,7 @@ async function loadOperatorState(sessionId) {
107213
107450
  }
107214
107451
  function hasOperatorState(session) {
107215
107452
  const statePath = path.join(session.rootPath, "messages.json");
107216
- return existsSync12(statePath);
107453
+ return existsSync13(statePath);
107217
107454
  }
107218
107455
  var MAX_RESUME_MESSAGES = 200;
107219
107456
  function getResumeMessages(messages, limit = MAX_RESUME_MESSAGES) {
@@ -107336,211 +107573,9 @@ var sessions = {
107336
107573
  };
107337
107574
 
107338
107575
  // src/core/agents/offSecAgent/offensiveSecurityAgent.ts
107339
- import { join as join18 } from "path";
107340
- import { mkdirSync as mkdirSync12, existsSync as existsSync13 } from "fs";
107576
+ import { join as join19 } from "path";
107577
+ import { mkdirSync as mkdirSync12, existsSync as existsSync14 } from "fs";
107341
107578
  import { writeFile as writeFile4 } from "fs/promises";
107342
-
107343
- // src/core/agents/offSecAgent/trace.ts
107344
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync11 } from "fs";
107345
- import { createHash } from "crypto";
107346
- import { dirname as dirname5 } from "path";
107347
- var OUTPUT_PREVIEW_LIMIT = 2000;
107348
- var INPUT_PREVIEW_LIMIT = 1000;
107349
- var SYSTEM_PROMPT_HASH_PREFIX_LENGTH = 12;
107350
- function stringifyOutput(output) {
107351
- if (output == null)
107352
- return { text: "", type: "text" };
107353
- if (typeof output === "object" && "type" in output) {
107354
- const typed = output;
107355
- switch (typed.type) {
107356
- case "text":
107357
- case "error-text":
107358
- return {
107359
- text: String(typed.value ?? ""),
107360
- type: typed.type
107361
- };
107362
- case "json":
107363
- case "error-json":
107364
- return {
107365
- text: JSON.stringify(typed.value ?? null),
107366
- type: typed.type
107367
- };
107368
- case "execution-denied":
107369
- return {
107370
- text: typed.reason ?? "execution denied",
107371
- type: typed.type
107372
- };
107373
- case "content":
107374
- return { text: JSON.stringify(typed.value ?? []), type: typed.type };
107375
- default:
107376
- return { text: JSON.stringify(output), type: "text" };
107377
- }
107378
- }
107379
- if (typeof output === "string")
107380
- return { text: output, type: "text" };
107381
- return { text: JSON.stringify(output), type: "json" };
107382
- }
107383
- function preview(str, maxLen) {
107384
- return str.length <= maxLen ? str : str.slice(0, maxLen);
107385
- }
107386
-
107387
- class StepTraceWriter {
107388
- tracePath;
107389
- agentId;
107390
- eventBus;
107391
- stepIndex = 0;
107392
- cumulativeUsage = {
107393
- inputTokens: 0,
107394
- outputTokens: 0
107395
- };
107396
- lastStepTime;
107397
- agentStartTime;
107398
- summarized = false;
107399
- previousMessageCount = 0;
107400
- constructor(opts) {
107401
- this.tracePath = opts.tracePath;
107402
- this.agentId = opts.agentId;
107403
- this.eventBus = opts.eventBus;
107404
- const now = Date.now();
107405
- this.agentStartTime = now;
107406
- this.lastStepTime = now;
107407
- mkdirSync11(dirname5(this.tracePath), { recursive: true });
107408
- }
107409
- writeInit(data) {
107410
- const { systemPrompt, ...rest } = data;
107411
- const record3 = {
107412
- type: "init",
107413
- timestamp: new Date().toISOString(),
107414
- agentId: this.agentId,
107415
- systemPromptHash: createHash("sha256").update(systemPrompt).digest("hex").slice(0, SYSTEM_PROMPT_HASH_PREFIX_LENGTH),
107416
- systemPrompt,
107417
- ...rest
107418
- };
107419
- this.appendRecord(record3);
107420
- }
107421
- markSummarized() {
107422
- this.summarized = true;
107423
- this.previousMessageCount = 0;
107424
- }
107425
- recordStep(responseMessages, usage) {
107426
- const now = Date.now();
107427
- const newMessages = responseMessages.slice(this.previousMessageCount);
107428
- this.previousMessageCount = responseMessages.length;
107429
- const observations = [];
107430
- const reasoningParts = [];
107431
- const textParts = [];
107432
- const actions = [];
107433
- for (const msg of newMessages) {
107434
- if (!Array.isArray(msg.content)) {
107435
- if (typeof msg.content === "string" && msg.role === "assistant") {
107436
- textParts.push(msg.content);
107437
- }
107438
- continue;
107439
- }
107440
- for (const part of msg.content) {
107441
- switch (part.type) {
107442
- case "tool-result": {
107443
- const { text, type } = stringifyOutput(part.output);
107444
- observations.push({
107445
- toolCallId: part.toolCallId,
107446
- toolName: part.toolName,
107447
- outputType: type,
107448
- outputPreview: preview(text, OUTPUT_PREVIEW_LIMIT),
107449
- outputLength: Buffer.byteLength(text, "utf-8")
107450
- });
107451
- break;
107452
- }
107453
- case "reasoning": {
107454
- reasoningParts.push(part.text);
107455
- break;
107456
- }
107457
- case "text": {
107458
- textParts.push(part.text);
107459
- break;
107460
- }
107461
- case "tool-call": {
107462
- const serialized = JSON.stringify(part.input);
107463
- actions.push({
107464
- toolCallId: part.toolCallId,
107465
- toolName: part.toolName,
107466
- inputPreview: preview(serialized, INPUT_PREVIEW_LIMIT),
107467
- inputLength: Buffer.byteLength(serialized, "utf-8")
107468
- });
107469
- break;
107470
- }
107471
- }
107472
- }
107473
- }
107474
- const inputTokens = usage.inputTokens ?? 0;
107475
- const outputTokens = usage.outputTokens ?? 0;
107476
- const cacheReadTokens = usage.cacheReadTokens;
107477
- const cacheWriteTokens = usage.cacheWriteTokens;
107478
- this.cumulativeUsage.inputTokens += inputTokens;
107479
- this.cumulativeUsage.outputTokens += outputTokens;
107480
- if (cacheReadTokens != null) {
107481
- this.cumulativeUsage.cacheReadTokens = (this.cumulativeUsage.cacheReadTokens ?? 0) + cacheReadTokens;
107482
- }
107483
- if (cacheWriteTokens != null) {
107484
- this.cumulativeUsage.cacheWriteTokens = (this.cumulativeUsage.cacheWriteTokens ?? 0) + cacheWriteTokens;
107485
- }
107486
- const record3 = {
107487
- type: "step",
107488
- stepIndex: this.stepIndex,
107489
- timestamp: new Date(now).toISOString(),
107490
- agentId: this.agentId,
107491
- observations: this.stepIndex === 0 ? null : observations.length > 0 ? observations : null,
107492
- reasoning: reasoningParts.length > 0 ? reasoningParts.join("") : null,
107493
- text: textParts.length > 0 ? textParts.join("") : null,
107494
- actions,
107495
- usage: { inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens },
107496
- cumulativeUsage: { ...this.cumulativeUsage },
107497
- stepDurationMs: now - this.lastStepTime,
107498
- elapsedMs: now - this.agentStartTime,
107499
- summarized: this.summarized
107500
- };
107501
- this.appendRecord(record3);
107502
- this.stepIndex++;
107503
- this.lastStepTime = now;
107504
- this.summarized = false;
107505
- }
107506
- get currentStepIndex() {
107507
- return this.stepIndex;
107508
- }
107509
- appendCheckpoint(data) {
107510
- const record3 = {
107511
- type: "checkpoint",
107512
- stepIndex: this.stepIndex,
107513
- timestamp: new Date().toISOString(),
107514
- agentId: this.agentId,
107515
- ...data
107516
- };
107517
- this.appendRecord(record3);
107518
- }
107519
- appendTaskRecord(data) {
107520
- const record3 = {
107521
- type: "task",
107522
- timestamp: new Date().toISOString(),
107523
- agentId: this.agentId,
107524
- stepIndex: this.stepIndex,
107525
- ...data
107526
- };
107527
- this.appendRecord(record3);
107528
- }
107529
- appendRecord(record3) {
107530
- try {
107531
- appendFileSync2(this.tracePath, JSON.stringify(record3) + `
107532
- `);
107533
- } catch {}
107534
- try {
107535
- this.eventBus?.emit("trace-record", {
107536
- record: record3,
107537
- subagentId: this.agentId ?? undefined
107538
- });
107539
- } catch {}
107540
- }
107541
- }
107542
-
107543
- // src/core/agents/offSecAgent/offensiveSecurityAgent.ts
107544
107579
  class OffensiveSecurityAgent {
107545
107580
  streamResult;
107546
107581
  eventBus;
@@ -107584,15 +107619,15 @@ class OffensiveSecurityAgent {
107584
107619
  input.commandCancelHandle.cancel = () => shell.cancelCurrentCommand();
107585
107620
  }
107586
107621
  }
107587
- const messagesDir = input.messagesDir ?? (input.subagentId ? join18(input.session.rootPath, "subagents", input.subagentId) : input.session.rootPath);
107588
- const tracePath = input.subagentId ? join18(input.session.rootPath, "subagents", `${input.subagentId}.trace.jsonl`) : join18(messagesDir, "trace.jsonl");
107622
+ const messagesDir = input.messagesDir ?? (input.subagentId ? join19(input.session.rootPath, "subagents", input.subagentId) : input.session.rootPath);
107623
+ const tracePath = input.subagentId ? join19(input.session.rootPath, "subagents", `${input.subagentId}.trace.jsonl`) : join19(messagesDir, "trace.jsonl");
107589
107624
  const traceWriter = new StepTraceWriter({
107590
107625
  tracePath,
107591
107626
  agentId: input.subagentId ?? null,
107592
107627
  eventBus: this.eventBus
107593
107628
  });
107594
107629
  const taskDriven = input.session.config?.taskDriven ?? false;
107595
- const tasksDir = input.tasksDir ?? (taskDriven ? input.subagentId ? join18(input.session.rootPath, "subagents", `${input.subagentId}-tasks`) : join18(input.session.rootPath, "tasks") : undefined);
107630
+ const tasksDir = input.tasksDir ?? (taskDriven ? input.subagentId ? join19(input.session.rootPath, "subagents", `${input.subagentId}-tasks`) : join19(input.session.rootPath, "tasks") : undefined);
107596
107631
  const credentialManager = input.credentialManager ?? input.session.credentialManager;
107597
107632
  const builtinTools = createAllTools({
107598
107633
  session: input.session,
@@ -107655,10 +107690,10 @@ class OffensiveSecurityAgent {
107655
107690
  const planSet = new Set(PLAN_MODE_TOOL_NAMES);
107656
107691
  activeTools = activeTools.filter((t) => planSet.has(t));
107657
107692
  }
107658
- if (!existsSync13(messagesDir)) {
107693
+ if (!existsSync14(messagesDir)) {
107659
107694
  mkdirSync12(messagesDir, { recursive: true });
107660
107695
  }
107661
- const messagesPath = join18(messagesDir, "messages.json");
107696
+ const messagesPath = join19(messagesDir, "messages.json");
107662
107697
  const initialMessagesRef = {
107663
107698
  current: input.messages ? [...input.messages] : [
107664
107699
  {
@@ -107816,4 +107851,4 @@ function wrapToolsWithApprovalGate(tools, gate, exemptToolNames) {
107816
107851
  return wrapped;
107817
107852
  }
107818
107853
 
107819
- export { CweEntrySchema, ValidatedCweEntrySchema, hasCanonicalName, AgentEventBus, FindingsRegistry, planFilePath, readPlan, hasPlan, ASK_USER_QUESTIONS_TOOL_NAME, ALL_TOOL_NAMES, PLAN_MODE_TOOL_NAMES, SKILL_TOOL_NAMES, buildBaseSystemPrompt, OPERATOR_MODES, OPERATOR_MODE_CYCLE, createInitialOperatorState, ApprovalGate, normalizeMessages, sessions, OffensiveSecurityAgent };
107854
+ export { CweEntrySchema, ValidatedCweEntrySchema, hasCanonicalName, AgentEventBus, FindingsRegistry, planFilePath, readPlan, hasPlan, ASK_USER_QUESTIONS_TOOL_NAME, createAllTools, ALL_TOOL_NAMES, PLAN_MODE_TOOL_NAMES, SKILL_TOOL_NAMES, buildBaseSystemPrompt, OPERATOR_MODES, OPERATOR_MODE_CYCLE, createInitialOperatorState, ApprovalGate, normalizeMessages, sessions, StepTraceWriter, OffensiveSecurityAgent };