pentesting 0.4.0 → 0.4.1

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-LZGHM27D.js";
12
- import "./chunk-IU6YJKJT.js";
11
+ } from "./chunk-TABUHG2A.js";
12
+ import "./chunk-JUHBSTKO.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
@@ -132,7 +132,7 @@ var SENSITIVE_TOOLS = [
132
132
 
133
133
  // src/config/constants.ts
134
134
  var APP_NAME = "pentesting";
135
- var APP_VERSION = "0.4.0";
135
+ var APP_VERSION = "0.4.1";
136
136
  var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
137
137
  var LLM_API_KEY = process.env.PENTEST_API_KEY || process.env.ANTHROPIC_API_KEY || "";
138
138
  var LLM_BASE_URL = process.env.PENTEST_BASE_URL || void 0;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  APP_NAME,
3
3
  APP_VERSION
4
- } from "./chunk-IU6YJKJT.js";
4
+ } from "./chunk-JUHBSTKO.js";
5
5
 
6
6
  // src/core/update/auto-update.ts
7
7
  import { execSync } from "child_process";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  PHASE_STATUS,
16
16
  THOUGHT_TYPE,
17
17
  TOOL_NAME
18
- } from "./chunk-IU6YJKJT.js";
18
+ } from "./chunk-JUHBSTKO.js";
19
19
  import {
20
20
  __require
21
21
  } from "./chunk-3RG5ZIWI.js";
@@ -3155,6 +3155,44 @@ var AutonomousHackingAgent = class extends EventEmitter4 {
3155
3155
  current: this.state.currentPhase
3156
3156
  };
3157
3157
  }
3158
+ // ===== Image Analysis with Vision =====
3159
+ async analyzeImage(base64, mimeType, prompt) {
3160
+ this.think(THOUGHT_TYPE.OBSERVATION, `Analyzing image: ${prompt}`);
3161
+ try {
3162
+ const response = await this.client.messages.create({
3163
+ model: LLM_MODEL,
3164
+ max_tokens: 4096,
3165
+ messages: [{
3166
+ role: "user",
3167
+ content: [
3168
+ {
3169
+ type: "image",
3170
+ source: {
3171
+ type: "base64",
3172
+ media_type: mimeType,
3173
+ data: base64
3174
+ }
3175
+ },
3176
+ {
3177
+ type: "text",
3178
+ text: `${AUTONOMOUS_HACKING_PROMPT}
3179
+
3180
+ Analyze this image from a security perspective:
3181
+ ${prompt}`
3182
+ }
3183
+ ]
3184
+ }]
3185
+ });
3186
+ const textContent = response.content.find((c) => c.type === "text");
3187
+ const result = textContent && "text" in textContent ? textContent.text : "No analysis available";
3188
+ this.think(THOUGHT_TYPE.REFLECTION, `Image analysis complete`);
3189
+ return result;
3190
+ } catch (error) {
3191
+ const errorMsg = error instanceof Error ? error.message : String(error);
3192
+ this.think(THOUGHT_TYPE.STUCK, `Image analysis failed: ${errorMsg}`);
3193
+ throw error;
3194
+ }
3195
+ }
3158
3196
  // ===== Thought Process Recording =====
3159
3197
  think(type, content) {
3160
3198
  const thought = {
@@ -4609,7 +4647,7 @@ function readClipboardImage() {
4609
4647
  if (result === "success" && existsSync3(tmpPath)) {
4610
4648
  const imageBuffer = readFileSync3(tmpPath);
4611
4649
  const base64 = imageBuffer.toString("base64");
4612
- return { path: tmpPath, base64 };
4650
+ return { path: tmpPath, base64, mimeType: "image/png" };
4613
4651
  }
4614
4652
  } else if (os === "linux") {
4615
4653
  try {
@@ -4622,7 +4660,7 @@ function readClipboardImage() {
4622
4660
  if (stats.size > 0) {
4623
4661
  const imageBuffer = readFileSync3(tmpPath);
4624
4662
  const base64 = imageBuffer.toString("base64");
4625
- return { path: tmpPath, base64 };
4663
+ return { path: tmpPath, base64, mimeType: "image/png" };
4626
4664
  }
4627
4665
  }
4628
4666
  } catch {
@@ -4642,7 +4680,7 @@ function readClipboardImage() {
4642
4680
  if (result === "success" && existsSync3(tmpPath)) {
4643
4681
  const imageBuffer = readFileSync3(tmpPath);
4644
4682
  const base64 = imageBuffer.toString("base64");
4645
- return { path: tmpPath, base64 };
4683
+ return { path: tmpPath, base64, mimeType: "image/png" };
4646
4684
  }
4647
4685
  }
4648
4686
  } catch (error) {
@@ -4884,7 +4922,7 @@ var App = ({ autoApprove = false, target }) => {
4884
4922
  setCheckpointCount(contextManagerRef.current?.getCheckpoints().length || 0);
4885
4923
  }
4886
4924
  });
4887
- import("./auto-update-H72IBVEQ.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
4925
+ import("./auto-update-ZU3T3VSG.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
4888
4926
  checkForUpdateAsync().then((result) => {
4889
4927
  if (result.hasUpdate) {
4890
4928
  const notification = formatUpdateNotification(result);
@@ -5237,6 +5275,19 @@ var App = ({ autoApprove = false, target }) => {
5237
5275
  if (img) {
5238
5276
  addMessage(MESSAGE_TYPE.SYSTEM, `\u{1F4F7} Image from clipboard: ${img.path}`);
5239
5277
  addMessage(MESSAGE_TYPE.SYSTEM, ` Size: ${Math.round(img.base64.length / 1024)}KB base64`);
5278
+ const prompt = args.join(" ") || "Analyze this image for security-relevant information";
5279
+ addMessage(MESSAGE_TYPE.SYSTEM, ` Sending to agent: "${prompt}"`);
5280
+ setIsProcessing(true);
5281
+ startTimer();
5282
+ try {
5283
+ const response = await agent.analyzeImage(img.base64, img.mimeType, prompt);
5284
+ const duration = stopTimer();
5285
+ addMessage(MESSAGE_TYPE.ASSISTANT, response, duration);
5286
+ } catch (e) {
5287
+ stopTimer();
5288
+ addMessage(MESSAGE_TYPE.ERROR, `Image analysis failed: ${e instanceof Error ? e.message : String(e)}`);
5289
+ }
5290
+ setIsProcessing(false);
5240
5291
  }
5241
5292
  } else {
5242
5293
  const text = readClipboardText();
@@ -5333,7 +5384,7 @@ var App = ({ autoApprove = false, target }) => {
5333
5384
  return;
5334
5385
  case "update":
5335
5386
  try {
5336
- const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-DNXSBIOM.js");
5387
+ const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-4H3DBFBE.js");
5337
5388
  const result = checkForUpdate(true);
5338
5389
  if (result.hasUpdate) {
5339
5390
  const notification = formatUpdateNotification(result);
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-LZGHM27D.js";
12
- import "./chunk-IU6YJKJT.js";
11
+ } from "./chunk-TABUHG2A.js";
12
+ import "./chunk-JUHBSTKO.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.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",