pentesting 0.8.32 → 0.8.34

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.
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-N27ISRFF.js";
12
- import "./chunk-IYELGZKK.js";
11
+ } from "./chunk-TTQCHK5V.js";
12
+ import "./chunk-UCB4BWTB.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  APP_NAME,
3
3
  APP_VERSION
4
- } from "./chunk-IYELGZKK.js";
4
+ } from "./chunk-UCB4BWTB.js";
5
5
 
6
6
  // src/core/update/auto-update.ts
7
7
  import { execSync } from "child_process";
@@ -27,14 +27,26 @@ var PHASE_STATUS = {
27
27
  SKIPPED: "skipped"
28
28
  };
29
29
  var THOUGHT_TYPE = {
30
+ THINKING: "thinking",
31
+ // LLM text streaming
32
+ REASONING: "reasoning",
33
+ // LLM extended thinking
34
+ PLANNING: "planning",
35
+ // Strategic planning
30
36
  OBSERVATION: "observation",
37
+ // Observing results
31
38
  HYPOTHESIS: "hypothesis",
32
- PLAN: "plan",
39
+ // Forming hypothesis
40
+ REFLECTION: "reflection",
41
+ // Self-reflection
33
42
  ACTION: "action",
43
+ // Taking action
34
44
  RESULT: "result",
35
- REFLECTION: "reflection",
45
+ // Action result
36
46
  STUCK: "stuck",
47
+ // Detected stuck state
37
48
  BREAKTHROUGH: "breakthrough"
49
+ // Found breakthrough
38
50
  };
39
51
  var AGENT_EVENT = {
40
52
  // Lifecycle
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  PHASE_STATUS,
17
17
  THOUGHT_TYPE,
18
18
  TOOL_NAME
19
- } from "./chunk-IYELGZKK.js";
19
+ } from "./chunk-UCB4BWTB.js";
20
20
  import {
21
21
  __require
22
22
  } from "./chunk-3RG5ZIWI.js";
@@ -4581,7 +4581,7 @@ var AutonomousHackingAgent = class extends EventEmitter4 {
4581
4581
  target: this.state.target.primary
4582
4582
  };
4583
4583
  const result = await executeCommand(cmdName, args, context);
4584
- this.think(THOUGHT_TYPE.PLAN, `Executed command: /${cmdName}`);
4584
+ this.think(THOUGHT_TYPE.PLANNING, `Executed command: /${cmdName}`);
4585
4585
  this.emit(AGENT_EVENT.COMMAND_EXECUTE, { command: cmdName, args });
4586
4586
  return result.output;
4587
4587
  }
@@ -4592,7 +4592,7 @@ var AutonomousHackingAgent = class extends EventEmitter4 {
4592
4592
  );
4593
4593
  if (agent) {
4594
4594
  this.currentAgent = agent;
4595
- this.think(THOUGHT_TYPE.PLAN, `Switching to specialized agent: ${agent.name}`);
4595
+ this.think(THOUGHT_TYPE.PLANNING, `Switching to specialized agent: ${agent.name}`);
4596
4596
  this.emit(AGENT_EVENT.AGENT_SWITCH, { name: agent.name, description: agent.description });
4597
4597
  return true;
4598
4598
  }
@@ -4787,7 +4787,7 @@ ${prompt}`
4787
4787
  this.setPhaseStatus(this.state.currentPhase, PHASE_STATUS.COMPLETED);
4788
4788
  this.state.currentPhase = nextPhase.id;
4789
4789
  this.setPhaseStatus(nextPhase.id, PHASE_STATUS.IN_PROGRESS);
4790
- this.think(THOUGHT_TYPE.PLAN, `Advancing to next phase: ${nextPhase.shortName}`);
4790
+ this.think(THOUGHT_TYPE.PLANNING, `Advancing to next phase: ${nextPhase.shortName}`);
4791
4791
  this.autoSwitchAgentForPhase(nextPhase.id);
4792
4792
  this.resetStuckCounter();
4793
4793
  return true;
@@ -4980,7 +4980,7 @@ What went wrong and what different approach should be tried?
4980
4980
  Target ${this.state.target.primary} - performing full penetration test.
4981
4981
  Goal: Deep penetration to obtain root/system privileges, extract internal data, map entire network.
4982
4982
  `;
4983
- this.think(THOUGHT_TYPE.PLAN, `Autonomous hacking started: ${mainObjective}`);
4983
+ this.think(THOUGHT_TYPE.PLANNING, `Autonomous hacking started: ${mainObjective}`);
4984
4984
  this.state.history.push({
4985
4985
  role: "user",
4986
4986
  content: mainObjective
@@ -5044,13 +5044,13 @@ Goal: Deep penetration to obtain root/system privileges, extract internal data,
5044
5044
  // ===== Step Execution =====
5045
5045
  async executeStep() {
5046
5046
  const contextPrompt = this.buildContextPrompt();
5047
- this.think(THOUGHT_TYPE.PLAN, "Deciding next action...");
5047
+ this.think(THOUGHT_TYPE.PLANNING, "Deciding next action...");
5048
5048
  const contextStatus = this.contextManager.checkStatus(this.state.history);
5049
5049
  if (contextStatus.warning) {
5050
5050
  this.think(THOUGHT_TYPE.OBSERVATION, `Context at ${(contextStatus.percentage * 100).toFixed(1)}% capacity`);
5051
5051
  }
5052
5052
  if (contextStatus.needsCompaction) {
5053
- this.think(THOUGHT_TYPE.PLAN, "Compacting context...");
5053
+ this.think(THOUGHT_TYPE.PLANNING, "Compacting context...");
5054
5054
  const compactResult = await this.contextManager.compactIfNeeded(this.state.history);
5055
5055
  if (compactResult.wasCompacted && compactResult.result) {
5056
5056
  this.state.history = compactResult.messages;
@@ -5092,22 +5092,16 @@ ${this.currentSpec.systemPrompt}`;
5092
5092
  // Enable extended thinking for GLM/Claude models
5093
5093
  thinking: { type: "enabled", budget_tokens: 16e3 }
5094
5094
  });
5095
- stream.on("rawEvent", (event) => {
5096
- if (event.type === "content_block_delta" && event.delta?.type === "thinking_delta") {
5097
- const thinkingText = event.delta.thinking;
5098
- if (thinkingText) {
5099
- thinkingBuffer += thinkingText;
5100
- this.emit(AGENT_EVENT.THOUGHT, {
5101
- type: "reasoning",
5102
- content: thinkingText
5103
- });
5104
- }
5105
- }
5106
- });
5107
5095
  stream.on("contentBlock", (block) => {
5108
- if (block.type === "tool_use") {
5096
+ if (block.type === "thinking" && block.thinking) {
5097
+ thinkingBuffer += block.thinking;
5098
+ this.emit(AGENT_EVENT.THOUGHT, {
5099
+ type: THOUGHT_TYPE.REASONING,
5100
+ content: block.thinking
5101
+ });
5102
+ } else if (block.type === "tool_use") {
5109
5103
  this.emit(AGENT_EVENT.THOUGHT, {
5110
- type: "action",
5104
+ type: THOUGHT_TYPE.ACTION,
5111
5105
  content: `Calling: ${block.name}`
5112
5106
  });
5113
5107
  }
@@ -5382,9 +5376,9 @@ Use report_finding tool for important discoveries.
5382
5376
  async attemptRecovery(error) {
5383
5377
  this.think(THOUGHT_TYPE.REFLECTION, `Attempting recovery: ${error.message}`);
5384
5378
  if (error.message.includes("timeout")) {
5385
- this.think(THOUGHT_TYPE.PLAN, "Timeout - retrying with shorter command");
5379
+ this.think(THOUGHT_TYPE.PLANNING, "Timeout - retrying with shorter command");
5386
5380
  } else if (error.message.includes("permission")) {
5387
- this.think(THOUGHT_TYPE.PLAN, "Permission error - trying different approach");
5381
+ this.think(THOUGHT_TYPE.PLANNING, "Permission error - trying different approach");
5388
5382
  }
5389
5383
  }
5390
5384
  // ===== Final Report Generation =====
@@ -5462,7 +5456,7 @@ ${this.state.findings.filter((f) => f.severity !== "info").map((f) => `- Address
5462
5456
  * This is the main method for interactive TUI conversations
5463
5457
  */
5464
5458
  async chat(userMessage) {
5465
- this.think(THOUGHT_TYPE.PLAN, `Processing: ${userMessage}`);
5459
+ this.think(THOUGHT_TYPE.PLANNING, `Processing: ${userMessage}`);
5466
5460
  this.state.history.push({
5467
5461
  role: "user",
5468
5462
  content: userMessage
@@ -6664,16 +6658,16 @@ var ASCII_BANNER = `
6664
6658
  \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D
6665
6659
  `;
6666
6660
  var THOUGHT_LABELS = {
6667
- thinking: "[think]",
6668
- reasoning: "[reason]",
6669
- planning: "[plan]",
6670
- observation: "[observe]",
6671
- hypothesis: "[hypothesis]",
6672
- reflection: "[reflect]",
6673
- action: "[action]",
6674
- result: "[result]",
6675
- stuck: "[stuck]",
6676
- breakthrough: "[!]"
6661
+ [THOUGHT_TYPE.THINKING]: "[think]",
6662
+ [THOUGHT_TYPE.REASONING]: "[reason]",
6663
+ [THOUGHT_TYPE.PLANNING]: "[plan]",
6664
+ [THOUGHT_TYPE.OBSERVATION]: "[observe]",
6665
+ [THOUGHT_TYPE.HYPOTHESIS]: "[hypothesis]",
6666
+ [THOUGHT_TYPE.REFLECTION]: "[reflect]",
6667
+ [THOUGHT_TYPE.ACTION]: "[action]",
6668
+ [THOUGHT_TYPE.RESULT]: "[result]",
6669
+ [THOUGHT_TYPE.STUCK]: "[stuck]",
6670
+ [THOUGHT_TYPE.BREAKTHROUGH]: "[!]"
6677
6671
  };
6678
6672
 
6679
6673
  // src/cli/components/rich-display.tsx
@@ -7005,7 +6999,7 @@ var App = ({ autoApprove = false, target }) => {
7005
6999
  setCheckpointCount(contextManagerRef.current?.getCheckpoints().length || 0);
7006
7000
  }
7007
7001
  });
7008
- import("./auto-update-NUVK35LG.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
7002
+ import("./auto-update-RJK3Y5UW.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
7009
7003
  checkForUpdateAsync().then((result) => {
7010
7004
  if (result.hasUpdate) {
7011
7005
  const notification = formatUpdateNotification(result);
@@ -7132,25 +7126,26 @@ var App = ({ autoApprove = false, target }) => {
7132
7126
  agent.on(AGENT_EVENT.THOUGHT, (thought) => {
7133
7127
  setCurrentStatus(thought.content.slice(0, 60));
7134
7128
  const label = THOUGHT_LABELS[thought.type] || "[?]";
7135
- if (thought.type === "reasoning") {
7136
- addMessage(MESSAGE_TYPE.SYSTEM, `${label} ${thought.content}`);
7137
- } else if (thought.type === "thinking") {
7129
+ if (thought.type === THOUGHT_TYPE.REASONING) {
7130
+ addMessage(MESSAGE_TYPE.SYSTEM, ` \u2503 \u{1F4AD} ${thought.content.slice(0, 300)}`);
7131
+ } else if (thought.type === THOUGHT_TYPE.THINKING) {
7132
+ addMessage(MESSAGE_TYPE.SYSTEM, ` \u2503 ${thought.content.slice(0, 150)}`);
7138
7133
  } else {
7139
7134
  addMessage(MESSAGE_TYPE.SYSTEM, `${label} ${thought.content.slice(0, 200)}`);
7140
7135
  }
7141
- wireLoggerRef.current?.contentPart(thought.content, thought.type === "thinking" || thought.type === "reasoning");
7136
+ wireLoggerRef.current?.contentPart(thought.content, thought.type === THOUGHT_TYPE.THINKING || thought.type === THOUGHT_TYPE.REASONING);
7142
7137
  });
7143
7138
  agent.on(AGENT_EVENT.TOOL_CALL, (data) => {
7144
7139
  const args = Object.entries(data.input).slice(0, 2).map(([k, v]) => `${k}=${typeof v === "string" ? v.slice(0, 30) : "..."}`).join(" ");
7145
7140
  const cmdPreview = data.name === "bash" && data.input.command ? String(data.input.command).slice(0, 50).replace(/\n/g, " ") : data.name;
7146
7141
  setCurrentStatus(`Executing: ${cmdPreview}`);
7147
- addMessage(MESSAGE_TYPE.TOOL, `${data.name} ${args}`);
7142
+ addMessage(MESSAGE_TYPE.TOOL, ` \u23BF ${data.name} ${args}`);
7148
7143
  wireLoggerRef.current?.toolCall(data.id, data.name, data.input);
7149
7144
  });
7150
7145
  agent.on(AGENT_EVENT.TOOL_RESULT, (data) => {
7151
7146
  const icon = data.result.success ? "\u2713" : "\u2717";
7152
7147
  const preview = data.result.output?.slice(0, 100).replace(/\n/g, " ") || "";
7153
- addMessage(MESSAGE_TYPE.RESULT, `${icon} ${preview}`);
7148
+ addMessage(MESSAGE_TYPE.RESULT, ` ${icon} ${icon} ${preview}`);
7154
7149
  setCurrentStatus("Processing results...");
7155
7150
  wireLoggerRef.current?.toolResult(data.id, data.result, !data.result.success);
7156
7151
  });
@@ -7739,7 +7734,7 @@ ${list}`);
7739
7734
  return;
7740
7735
  case "update":
7741
7736
  try {
7742
- const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-VGGUNUWQ.js");
7737
+ const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-LQDOCICM.js");
7743
7738
  const result = checkForUpdate(true);
7744
7739
  if (result.hasUpdate) {
7745
7740
  const notification = formatUpdateNotification(result);
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-N27ISRFF.js";
12
- import "./chunk-IYELGZKK.js";
11
+ } from "./chunk-TTQCHK5V.js";
12
+ import "./chunk-UCB4BWTB.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.8.32",
3
+ "version": "0.8.34",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",