pentesting 0.8.27 → 0.8.28

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 +22 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5087,7 +5087,22 @@ ${this.currentSpec.systemPrompt}`;
5087
5087
  max_tokens: LLM_MAX_TOKENS,
5088
5088
  system: systemPrompt,
5089
5089
  tools: this.tools,
5090
- messages
5090
+ messages,
5091
+ // Enable extended thinking for GLM/Claude models
5092
+ thinking: { type: "enabled", budget_tokens: 4e3 }
5093
+ });
5094
+ 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") {
5101
+ this.emit(AGENT_EVENT.THOUGHT, {
5102
+ type: "action",
5103
+ content: `Calling: ${block.name}`
5104
+ });
5105
+ }
5091
5106
  });
5092
5107
  stream.on("text", (text) => {
5093
5108
  streamBuffer += text;
@@ -5095,15 +5110,15 @@ ${this.currentSpec.systemPrompt}`;
5095
5110
  this.emit(AGENT_EVENT.THOUGHT, { type: "thinking", content: text });
5096
5111
  }
5097
5112
  });
5098
- stream.on("contentBlock", (block) => {
5099
- if (block.type === "tool_use") {
5113
+ response = await stream.finalMessage();
5114
+ for (const block of response.content) {
5115
+ if (block.type === "thinking" && block.thinking) {
5100
5116
  this.emit(AGENT_EVENT.THOUGHT, {
5101
- type: "action",
5102
- content: `Calling: ${block.name}`
5117
+ type: "reasoning",
5118
+ content: block.thinking
5103
5119
  });
5104
5120
  }
5105
- });
5106
- response = await stream.finalMessage();
5121
+ }
5107
5122
  } catch (error) {
5108
5123
  response = await withRetry(
5109
5124
  () => this.client.messages.create({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.8.27",
3
+ "version": "0.8.28",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",