pentesting 0.12.13 → 0.16.2

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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.12.13",
3
+ "version": "0.16.2",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
6
+ "main": "dist/main.js",
7
+ "types": "dist/main.d.ts",
8
8
  "bin": {
9
- "pentesting": "dist/index.js"
9
+ "pentesting": "dist/main.js"
10
10
  },
11
11
  "files": [
12
12
  "dist",
@@ -15,9 +15,9 @@
15
15
  "README.md"
16
16
  ],
17
17
  "scripts": {
18
- "dev": "tsx src/index.tsx",
19
- "build": "tsup src/index.tsx --format esm --dts --clean",
20
- "start": "node dist/index.js",
18
+ "dev": "tsx src/platform/tui/main.tsx",
19
+ "build": "tsup src/platform/tui/main.tsx --format esm --dts --clean",
20
+ "start": "node dist/main.js",
21
21
  "test": "vitest run",
22
22
  "test:watch": "vitest",
23
23
  "lint": "tsc --noEmit",
@@ -26,7 +26,7 @@
26
26
  "release:minor": "npm version minor && npm run build && npm publish",
27
27
  "release:major": "npm version major && npm run build && npm publish",
28
28
  "release": "npm run release:patch",
29
- "publish:token": "npm config set //registry.npmjs.org/:_authToken=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 && npm run build && npm publish",
29
+ "publish:token": "npm config set //registry.npmjs.org/:_authToken=${NPM_TOKEN} && npm run build && npm publish",
30
30
  "release:token:patch": "npm version patch && npm run publish:token",
31
31
  "release:token:minor": "npm version minor && npm run publish:token",
32
32
  "release:token:major": "npm version major && npm run publish:token",
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "repository": {
39
39
  "type": "git",
40
- "url": "git+https://github.com/agnusdei1207/pentesting.git"
40
+ "url": "git+https://github.com/agnusdei1207"
41
41
  },
42
- "homepage": "https://github.com/agnusdei1207/pentesting#readme",
42
+ "homepage": "https://agnusdei.kr",
43
43
  "bugs": {
44
- "url": "https://github.com/agnusdei1207/pentesting/issues"
44
+ "url": "https://github.com/agnusdei1207"
45
45
  },
46
46
  "keywords": [
47
47
  "penetration-testing",
@@ -66,7 +66,7 @@
66
66
  "node": ">=18.0.0"
67
67
  },
68
68
  "dependencies": {
69
- "@anthropic-ai/sdk": "^0.39.0",
69
+ "@anthropic-ai/sdk": "^0.74.0",
70
70
  "boxen": "^8.0.1",
71
71
  "chalk": "^5.4.1",
72
72
  "commander": "^13.1.0",
@@ -91,4 +91,4 @@
91
91
  "typescript": "^5.7.3",
92
92
  "vitest": "^4.0.18"
93
93
  }
94
- }
94
+ }
@@ -1,24 +0,0 @@
1
- import {
2
- checkForUpdate,
3
- checkForUpdateAsync,
4
- compareSemver,
5
- doUpdate,
6
- fetchLatestVersion,
7
- formatUpdateNotification,
8
- readVersionCache,
9
- semverTuple,
10
- writeVersionCache
11
- } from "./chunk-5IKQY4A4.js";
12
- import "./chunk-6IXHQS2A.js";
13
- import "./chunk-3RG5ZIWI.js";
14
- export {
15
- checkForUpdate,
16
- checkForUpdateAsync,
17
- compareSemver,
18
- doUpdate,
19
- fetchLatestVersion,
20
- formatUpdateNotification,
21
- readVersionCache,
22
- semverTuple,
23
- writeVersionCache
24
- };
@@ -1,10 +0,0 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
- export {
9
- __require
10
- };
@@ -1,134 +0,0 @@
1
- import {
2
- APP_NAME,
3
- APP_VERSION
4
- } from "./chunk-6IXHQS2A.js";
5
-
6
- // src/core/update/auto-update.ts
7
- import { execSync } from "child_process";
8
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
9
- import { join } from "path";
10
- import { homedir } from "os";
11
- var UPDATE_CHECK_INTERVAL = 24 * 60 * 60 * 1e3;
12
- var VERSION_CACHE_FILE = join(homedir(), ".pentest", "latest_version.json");
13
- function semverTuple(version) {
14
- const match = version.match(/^(\d+)\.(\d+)\.(\d+)/);
15
- if (!match) return [0, 0, 0];
16
- return [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])];
17
- }
18
- function compareSemver(a, b) {
19
- const [a1, a2, a3] = semverTuple(a);
20
- const [b1, b2, b3] = semverTuple(b);
21
- if (a1 !== b1) return a1 < b1 ? -1 : 1;
22
- if (a2 !== b2) return a2 < b2 ? -1 : 1;
23
- if (a3 !== b3) return a3 < b3 ? -1 : 1;
24
- return 0;
25
- }
26
- function readVersionCache() {
27
- try {
28
- if (!existsSync(VERSION_CACHE_FILE)) return null;
29
- const data = JSON.parse(readFileSync(VERSION_CACHE_FILE, "utf-8"));
30
- return data;
31
- } catch {
32
- return null;
33
- }
34
- }
35
- function writeVersionCache(info) {
36
- try {
37
- const dir = join(homedir(), ".pentest");
38
- if (!existsSync(dir)) {
39
- mkdirSync(dir, { recursive: true });
40
- }
41
- writeFileSync(VERSION_CACHE_FILE, JSON.stringify(info, null, 2));
42
- } catch {
43
- }
44
- }
45
- function fetchLatestVersion(packageName = APP_NAME) {
46
- try {
47
- const output = execSync(`npm view ${packageName} version`, {
48
- encoding: "utf-8",
49
- timeout: 1e4,
50
- stdio: ["pipe", "pipe", "pipe"]
51
- });
52
- return output.trim();
53
- } catch {
54
- return null;
55
- }
56
- }
57
- function checkForUpdate(forceCheck = false) {
58
- const currentVersion = APP_VERSION;
59
- const cached = readVersionCache();
60
- const now = Date.now();
61
- if (!forceCheck && cached && now - cached.checkedAt < UPDATE_CHECK_INTERVAL) {
62
- const hasUpdate2 = compareSemver(cached.version, currentVersion) > 0;
63
- return {
64
- hasUpdate: hasUpdate2,
65
- currentVersion,
66
- latestVersion: cached.version
67
- };
68
- }
69
- const latestVersion = fetchLatestVersion();
70
- if (!latestVersion) {
71
- return {
72
- hasUpdate: false,
73
- currentVersion,
74
- latestVersion: null,
75
- error: "Failed to fetch latest version"
76
- };
77
- }
78
- writeVersionCache({
79
- version: latestVersion,
80
- checkedAt: now
81
- });
82
- const hasUpdate = compareSemver(latestVersion, currentVersion) > 0;
83
- return {
84
- hasUpdate,
85
- currentVersion,
86
- latestVersion
87
- };
88
- }
89
- async function checkForUpdateAsync() {
90
- return new Promise((resolve) => {
91
- setImmediate(() => {
92
- resolve(checkForUpdate());
93
- });
94
- });
95
- }
96
- function formatUpdateNotification(result) {
97
- if (!result.hasUpdate || !result.latestVersion) return null;
98
- return `
99
- \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
100
- \u2502 \u{1F195} A new version of ${APP_NAME} is available! \u2502
101
- \u2502 \u2502
102
- \u2502 Current: ${result.currentVersion.padEnd(10)} Latest: ${result.latestVersion.padEnd(10)} \u2502
103
- \u2502 \u2502
104
- \u2502 Run: npm update -g ${APP_NAME} \u2502
105
- \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
106
- `.trim();
107
- }
108
- function doUpdate() {
109
- try {
110
- execSync(`npm update -g ${APP_NAME}`, {
111
- encoding: "utf-8",
112
- timeout: 12e4,
113
- stdio: "inherit"
114
- });
115
- return { success: true, message: `Updated ${APP_NAME} successfully!` };
116
- } catch (e) {
117
- return {
118
- success: false,
119
- message: `Failed to update: ${e instanceof Error ? e.message : String(e)}`
120
- };
121
- }
122
- }
123
-
124
- export {
125
- semverTuple,
126
- compareSemver,
127
- readVersionCache,
128
- writeVersionCache,
129
- fetchLatestVersion,
130
- checkForUpdate,
131
- checkForUpdateAsync,
132
- formatUpdateNotification,
133
- doUpdate
134
- };