pentesting 0.8.30 → 0.8.32

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 +21 -17
  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,
@@ -5091,13 +5092,20 @@ ${this.currentSpec.systemPrompt}`;
5091
5092
  // Enable extended thinking for GLM/Claude models
5092
5093
  thinking: { type: "enabled", budget_tokens: 16e3 }
5093
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
+ });
5094
5107
  stream.on("contentBlock", (block) => {
5095
- if (block.type === "thinking" && block.thinking) {
5096
- this.emit(AGENT_EVENT.THOUGHT, {
5097
- type: "reasoning",
5098
- content: block.thinking.slice(0, 500)
5099
- });
5100
- } else if (block.type === "tool_use") {
5108
+ if (block.type === "tool_use") {
5101
5109
  this.emit(AGENT_EVENT.THOUGHT, {
5102
5110
  type: "action",
5103
5111
  content: `Calling: ${block.name}`
@@ -5106,19 +5114,8 @@ ${this.currentSpec.systemPrompt}`;
5106
5114
  });
5107
5115
  stream.on("text", (text) => {
5108
5116
  streamBuffer += text;
5109
- if (text.trim()) {
5110
- this.emit(AGENT_EVENT.THOUGHT, { type: "thinking", content: text });
5111
- }
5112
5117
  });
5113
5118
  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
5119
  } catch (error) {
5123
5120
  response = await withRetry(
5124
5121
  () => this.client.messages.create({
@@ -7276,6 +7273,13 @@ var App = ({ autoApprove = false, target }) => {
7276
7273
  return;
7277
7274
  }
7278
7275
  }
7276
+ if (trimmed === "/exit" || trimmed === "/quit" || trimmed === "/q") {
7277
+ if (isProcessing && agent) {
7278
+ agent.pause();
7279
+ }
7280
+ exit();
7281
+ return;
7282
+ }
7279
7283
  if (isProcessing && !trimmed.startsWith("/")) return;
7280
7284
  setInput("");
7281
7285
  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.32",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",