pentesting 0.48.0 → 0.48.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/dist/main.js +29 -5
- package/dist/prompts/base.md +4 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -331,7 +331,7 @@ var ORPHAN_PROCESS_NAMES = [
|
|
|
331
331
|
|
|
332
332
|
// src/shared/constants/agent.ts
|
|
333
333
|
var APP_NAME = "Pentest AI";
|
|
334
|
-
var APP_VERSION = "0.48.
|
|
334
|
+
var APP_VERSION = "0.48.2";
|
|
335
335
|
var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
|
|
336
336
|
var LLM_ROLES = {
|
|
337
337
|
SYSTEM: "system",
|
|
@@ -3237,7 +3237,7 @@ var EpisodicMemory = class {
|
|
|
3237
3237
|
this.events = [];
|
|
3238
3238
|
}
|
|
3239
3239
|
};
|
|
3240
|
-
var MEMORY_FILE = join3(
|
|
3240
|
+
var MEMORY_FILE = join3(WORKSPACE.MEMORY, "persistent-knowledge.json");
|
|
3241
3241
|
var PersistentMemory = class {
|
|
3242
3242
|
knowledge;
|
|
3243
3243
|
constructor() {
|
|
@@ -3328,7 +3328,7 @@ var PersistentMemory = class {
|
|
|
3328
3328
|
}
|
|
3329
3329
|
save() {
|
|
3330
3330
|
try {
|
|
3331
|
-
mkdirSync2(
|
|
3331
|
+
mkdirSync2(WORKSPACE.MEMORY, { recursive: true });
|
|
3332
3332
|
writeFileSync4(MEMORY_FILE, JSON.stringify(this.knowledge, null, 2));
|
|
3333
3333
|
} catch {
|
|
3334
3334
|
}
|
|
@@ -9795,7 +9795,10 @@ function clearWorkspace() {
|
|
|
9795
9795
|
{ path: WORKSPACE.DEBUG, label: "debug logs" },
|
|
9796
9796
|
{ path: WORKSPACE.TMP, label: "temp files" },
|
|
9797
9797
|
{ path: WORKSPACE.OUTPUTS, label: "outputs" },
|
|
9798
|
-
{ path: WORKSPACE.JOURNAL, label: "journal" }
|
|
9798
|
+
{ path: WORKSPACE.JOURNAL, label: "journal" },
|
|
9799
|
+
{ path: WORKSPACE.TURNS, label: "turn records" },
|
|
9800
|
+
{ path: WORKSPACE.LOOT, label: "loot" },
|
|
9801
|
+
{ path: WORKSPACE.REPORTS, label: "reports" }
|
|
9799
9802
|
];
|
|
9800
9803
|
for (const dir of dirsToClean) {
|
|
9801
9804
|
try {
|
|
@@ -11308,6 +11311,26 @@ function rotateOutputFiles() {
|
|
|
11308
11311
|
} catch {
|
|
11309
11312
|
}
|
|
11310
11313
|
}
|
|
11314
|
+
function rotateTurnRecords() {
|
|
11315
|
+
try {
|
|
11316
|
+
const turnsDir = WORKSPACE.TURNS;
|
|
11317
|
+
if (!existsSync8(turnsDir)) return;
|
|
11318
|
+
const files = readdirSync2(turnsDir).filter((f) => f.startsWith(TURN_PREFIX) && f.endsWith(".md")).sort();
|
|
11319
|
+
if (files.length <= MAX_JOURNAL_ENTRIES) return;
|
|
11320
|
+
const toDelete = files.slice(0, files.length - MAX_JOURNAL_ENTRIES);
|
|
11321
|
+
for (const file of toDelete) {
|
|
11322
|
+
try {
|
|
11323
|
+
unlinkSync5(join10(turnsDir, file));
|
|
11324
|
+
} catch {
|
|
11325
|
+
}
|
|
11326
|
+
}
|
|
11327
|
+
debugLog("general", "Turn records rotated", {
|
|
11328
|
+
deleted: toDelete.length,
|
|
11329
|
+
remaining: MAX_JOURNAL_ENTRIES
|
|
11330
|
+
});
|
|
11331
|
+
} catch {
|
|
11332
|
+
}
|
|
11333
|
+
}
|
|
11311
11334
|
|
|
11312
11335
|
// src/agents/prompt-builder.ts
|
|
11313
11336
|
var __dirname3 = dirname5(fileURLToPath3(import.meta.url));
|
|
@@ -12028,7 +12051,7 @@ ${extraction.content.trim()}
|
|
|
12028
12051
|
try {
|
|
12029
12052
|
ensureDirExists(WORKSPACE.TURNS);
|
|
12030
12053
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
12031
|
-
const turnFileName = `turn-${String(this.turnCounter).padStart(
|
|
12054
|
+
const turnFileName = `turn-${String(this.turnCounter).padStart(4, "0")}_${ts}.md`;
|
|
12032
12055
|
const turnPath = join13(WORKSPACE.TURNS, turnFileName);
|
|
12033
12056
|
const turnContent = formatTurnRecord({
|
|
12034
12057
|
turn: this.turnCounter,
|
|
@@ -12073,6 +12096,7 @@ ${turnData}`
|
|
|
12073
12096
|
}
|
|
12074
12097
|
rotateJournalEntries();
|
|
12075
12098
|
rotateOutputFiles();
|
|
12099
|
+
rotateTurnRecords();
|
|
12076
12100
|
} catch {
|
|
12077
12101
|
}
|
|
12078
12102
|
this.turnCounter++;
|
package/dist/prompts/base.md
CHANGED
|
@@ -602,9 +602,9 @@ Your past actions and insights are saved as files. Use them freely:
|
|
|
602
602
|
|
|
603
603
|
```
|
|
604
604
|
.pentesting/memory/turns/
|
|
605
|
-
├── summary.md
|
|
606
|
-
├── turn-
|
|
607
|
-
├── turn-
|
|
605
|
+
├── summary.md ← Full session summary (updated every turn)
|
|
606
|
+
├── turn-0001_2026-02-21T08-30-15.md ← Turn 1 details
|
|
607
|
+
├── turn-0002_2026-02-21T08-31-22.md ← Turn 2 details
|
|
608
608
|
└── ...
|
|
609
609
|
```
|
|
610
610
|
|
|
@@ -615,5 +615,5 @@ Your past actions and insights are saved as files. Use them freely:
|
|
|
615
615
|
|
|
616
616
|
**How to use:**
|
|
617
617
|
- `summary.md` gives you the full picture — read it to understand where you stand
|
|
618
|
-
- Need details of a specific past turn? → `read_file(".pentesting/memory/turns/turn-
|
|
618
|
+
- Need details of a specific past turn? → `read_file(".pentesting/memory/turns/turn-0005_...")`
|
|
619
619
|
- All past findings, credentials, dead ends are preserved — never lost
|