pentesting 0.8.30 → 0.8.33

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 (2) hide show
  1. package/dist/index.js +14 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5081,6 +5081,7 @@ ${this.currentSpec.systemPrompt}`;
5081
5081
  this.emit(AGENT_EVENT.LLM_START, { model: LLM_MODEL });
5082
5082
  let response;
5083
5083
  let streamBuffer = "";
5084
+ let thinkingBuffer = "";
5084
5085
  try {
5085
5086
  const stream = this.client.messages.stream({
5086
5087
  model: LLM_MODEL,
@@ -5093,9 +5094,10 @@ ${this.currentSpec.systemPrompt}`;
5093
5094
  });
5094
5095
  stream.on("contentBlock", (block) => {
5095
5096
  if (block.type === "thinking" && block.thinking) {
5097
+ thinkingBuffer += block.thinking;
5096
5098
  this.emit(AGENT_EVENT.THOUGHT, {
5097
5099
  type: "reasoning",
5098
- content: block.thinking.slice(0, 500)
5100
+ content: block.thinking
5099
5101
  });
5100
5102
  } else if (block.type === "tool_use") {
5101
5103
  this.emit(AGENT_EVENT.THOUGHT, {
@@ -5106,19 +5108,8 @@ ${this.currentSpec.systemPrompt}`;
5106
5108
  });
5107
5109
  stream.on("text", (text) => {
5108
5110
  streamBuffer += text;
5109
- if (text.trim()) {
5110
- this.emit(AGENT_EVENT.THOUGHT, { type: "thinking", content: text });
5111
- }
5112
5111
  });
5113
5112
  response = await stream.finalMessage();
5114
- for (const block of response.content) {
5115
- if (block.type === "thinking" && block.thinking) {
5116
- this.emit(AGENT_EVENT.THOUGHT, {
5117
- type: "reasoning",
5118
- content: block.thinking
5119
- });
5120
- }
5121
- }
5122
5113
  } catch (error) {
5123
5114
  response = await withRetry(
5124
5115
  () => this.client.messages.create({
@@ -7136,8 +7127,9 @@ var App = ({ autoApprove = false, target }) => {
7136
7127
  setCurrentStatus(thought.content.slice(0, 60));
7137
7128
  const label = THOUGHT_LABELS[thought.type] || "[?]";
7138
7129
  if (thought.type === "reasoning") {
7139
- addMessage(MESSAGE_TYPE.SYSTEM, `${label} ${thought.content}`);
7130
+ addMessage(MESSAGE_TYPE.SYSTEM, ` \u2503 \u{1F4AD} ${thought.content.slice(0, 300)}`);
7140
7131
  } else if (thought.type === "thinking") {
7132
+ addMessage(MESSAGE_TYPE.SYSTEM, ` \u2503 ${thought.content.slice(0, 150)}`);
7141
7133
  } else {
7142
7134
  addMessage(MESSAGE_TYPE.SYSTEM, `${label} ${thought.content.slice(0, 200)}`);
7143
7135
  }
@@ -7147,13 +7139,13 @@ var App = ({ autoApprove = false, target }) => {
7147
7139
  const args = Object.entries(data.input).slice(0, 2).map(([k, v]) => `${k}=${typeof v === "string" ? v.slice(0, 30) : "..."}`).join(" ");
7148
7140
  const cmdPreview = data.name === "bash" && data.input.command ? String(data.input.command).slice(0, 50).replace(/\n/g, " ") : data.name;
7149
7141
  setCurrentStatus(`Executing: ${cmdPreview}`);
7150
- addMessage(MESSAGE_TYPE.TOOL, `${data.name} ${args}`);
7142
+ addMessage(MESSAGE_TYPE.TOOL, ` \u23BF ${data.name} ${args}`);
7151
7143
  wireLoggerRef.current?.toolCall(data.id, data.name, data.input);
7152
7144
  });
7153
7145
  agent.on(AGENT_EVENT.TOOL_RESULT, (data) => {
7154
7146
  const icon = data.result.success ? "\u2713" : "\u2717";
7155
7147
  const preview = data.result.output?.slice(0, 100).replace(/\n/g, " ") || "";
7156
- addMessage(MESSAGE_TYPE.RESULT, `${icon} ${preview}`);
7148
+ addMessage(MESSAGE_TYPE.RESULT, ` ${icon} ${icon} ${preview}`);
7157
7149
  setCurrentStatus("Processing results...");
7158
7150
  wireLoggerRef.current?.toolResult(data.id, data.result, !data.result.success);
7159
7151
  });
@@ -7276,6 +7268,13 @@ var App = ({ autoApprove = false, target }) => {
7276
7268
  return;
7277
7269
  }
7278
7270
  }
7271
+ if (trimmed === "/exit" || trimmed === "/quit" || trimmed === "/q") {
7272
+ if (isProcessing && agent) {
7273
+ agent.pause();
7274
+ }
7275
+ exit();
7276
+ return;
7277
+ }
7279
7278
  if (isProcessing && !trimmed.startsWith("/")) return;
7280
7279
  setInput("");
7281
7280
  addMessage(MESSAGE_TYPE.USER, trimmed);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.8.30",
3
+ "version": "0.8.33",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",