pentesting 0.70.12 → 0.72.8
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/chunk-6YWYFB6E.js +3160 -0
- package/dist/{chunk-LNA3CY7P.js → chunk-74KL4OOU.js} +107 -4
- package/dist/main.js +4241 -5619
- package/dist/persistence-RDC7AENL.js +13 -0
- package/dist/{process-registry-KBP4X3JS.js → process-registry-BDTYM4MC.js} +1 -1
- package/dist/prompts/base.md +71 -12
- package/dist/prompts/ctf-crypto.md +168 -0
- package/dist/prompts/ctf-forensics.md +182 -0
- package/dist/prompts/ctf-pwn.md +137 -0
- package/dist/prompts/llm/analyst-system.md +69 -0
- package/dist/prompts/llm/context-extractor-system.md +19 -0
- package/dist/prompts/llm/playbook-synthesizer-system.md +10 -0
- package/dist/prompts/llm/reflector-system.md +16 -0
- package/dist/prompts/llm/report-generator-system.md +21 -0
- package/dist/prompts/llm/strategist-fallback.md +9 -0
- package/dist/prompts/llm/summary-regenerator-system.md +14 -0
- package/dist/prompts/llm/triage-system.md +47 -0
- package/dist/prompts/orchestrator.md +9 -2
- package/dist/prompts/strategist-system.md +32 -0
- package/dist/prompts/web.md +33 -0
- package/dist/prompts/zero-day.md +5 -4
- package/package.json +6 -4
|
@@ -56,6 +56,7 @@ var STATUS_MARKERS = {
|
|
|
56
56
|
RUNNING: "[RUNNING]",
|
|
57
57
|
STOPPED: "[STOPPED]",
|
|
58
58
|
WARNING: "[WARNING]",
|
|
59
|
+
INFO: "[INFO]",
|
|
59
60
|
INTERACTIVE: "[INTERACTIVE]",
|
|
60
61
|
EXITED: "[EXITED]"
|
|
61
62
|
};
|
|
@@ -74,7 +75,100 @@ var PROCESS_LIMITS = {
|
|
|
74
75
|
// characters
|
|
75
76
|
};
|
|
76
77
|
|
|
78
|
+
// src/agents/pipeline-config.ts
|
|
79
|
+
import { readFileSync, existsSync } from "fs";
|
|
80
|
+
import { join } from "path";
|
|
81
|
+
import { parse as yamlParse } from "yaml";
|
|
82
|
+
var PROJECT_ROOT = process.cwd();
|
|
83
|
+
var _config = null;
|
|
84
|
+
function getPipelineConfig() {
|
|
85
|
+
if (_config) return _config;
|
|
86
|
+
const yamlPath = join(PROJECT_ROOT, "pipeline.yaml");
|
|
87
|
+
const content = readFileSync(yamlPath, "utf-8");
|
|
88
|
+
_config = yamlParse(content);
|
|
89
|
+
return _config;
|
|
90
|
+
}
|
|
91
|
+
function resolvePromptFile(declaredPath, context) {
|
|
92
|
+
const filePath = join(PROJECT_ROOT, declaredPath);
|
|
93
|
+
if (!existsSync(filePath)) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`[pipeline.yaml] ${context} points to "${declaredPath}" which does not exist at ${filePath}.`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return readFileSync(filePath, "utf-8").trim();
|
|
99
|
+
}
|
|
100
|
+
function llmNodeSystemPrompt(nodeName) {
|
|
101
|
+
const nodeConfig = getPipelineConfig().llm_nodes?.[nodeName];
|
|
102
|
+
if (!nodeConfig) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
`[pipeline.yaml] llm_nodes.${nodeName} is not declared. Add it to pipeline.yaml.`
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
if (nodeConfig.system_prompt_file) {
|
|
108
|
+
return resolvePromptFile(
|
|
109
|
+
nodeConfig.system_prompt_file,
|
|
110
|
+
`llm_nodes.${nodeName}.system_prompt_file`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
if (nodeConfig.fallback_system_prompt_file) {
|
|
114
|
+
return resolvePromptFile(
|
|
115
|
+
nodeConfig.fallback_system_prompt_file,
|
|
116
|
+
`llm_nodes.${nodeName}.fallback_system_prompt_file`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
if (nodeConfig.system_prompt) {
|
|
120
|
+
return nodeConfig.system_prompt.trim();
|
|
121
|
+
}
|
|
122
|
+
if (nodeConfig.fallback_system_prompt) {
|
|
123
|
+
return nodeConfig.fallback_system_prompt.trim();
|
|
124
|
+
}
|
|
125
|
+
throw new Error(
|
|
126
|
+
`[pipeline.yaml] llm_nodes.${nodeName} must declare system_prompt_file, fallback_system_prompt_file, or system_prompt. Add one to pipeline.yaml.`
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function getUserInputQueueConfig() {
|
|
130
|
+
return getPipelineConfig().user_input_queue ?? {
|
|
131
|
+
format: "tagged",
|
|
132
|
+
tag: "user-input",
|
|
133
|
+
inject_position: "messages_end"
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function llmNodeOutputParsing(nodeName) {
|
|
137
|
+
return getPipelineConfig().llm_nodes?.[nodeName]?.output_parsing;
|
|
138
|
+
}
|
|
139
|
+
function llmNodeCooldownPolicy(nodeName) {
|
|
140
|
+
const policy = getPipelineConfig().llm_nodes?.[nodeName]?.cooldown_policy;
|
|
141
|
+
if (!policy) {
|
|
142
|
+
throw new Error(
|
|
143
|
+
`[pipeline.yaml] llm_nodes.${nodeName}.cooldown_policy is required but not set. Add it to pipeline.yaml.`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return policy;
|
|
147
|
+
}
|
|
148
|
+
function getPromptSources() {
|
|
149
|
+
const sources = getPipelineConfig().prompt_sources;
|
|
150
|
+
if (!sources) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
`[pipeline.yaml] prompt_sources section is required but not found. Add it to pipeline.yaml.`
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
return sources;
|
|
156
|
+
}
|
|
157
|
+
function getLimits() {
|
|
158
|
+
const limits = getPipelineConfig().limits;
|
|
159
|
+
if (!limits) {
|
|
160
|
+
throw new Error(
|
|
161
|
+
`[pipeline.yaml] limits section is required but not found. Add it to pipeline.yaml.`
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
return limits;
|
|
165
|
+
}
|
|
166
|
+
function getPromptBuilderConfig() {
|
|
167
|
+
return getPipelineConfig().prompt_builder ?? {};
|
|
168
|
+
}
|
|
169
|
+
|
|
77
170
|
// src/shared/constants/system/limits.ts
|
|
171
|
+
var _msgLimits = getLimits().messages ?? {};
|
|
78
172
|
var SYSTEM_LIMITS = {
|
|
79
173
|
/** Maximum wait time for interactive shell responses (10 seconds) */
|
|
80
174
|
MAX_WAIT_MS_INTERACT: 1e4,
|
|
@@ -116,8 +210,9 @@ var SYSTEM_LIMITS = {
|
|
|
116
210
|
RECENT_EVENTS_DISPLAY: 5,
|
|
117
211
|
/** Number of recent output lines to show per process */
|
|
118
212
|
RECENT_OUTPUT_LINES: 3,
|
|
119
|
-
/** Maximum characters per message for context extraction
|
|
120
|
-
|
|
213
|
+
/** Maximum characters per message for context extraction.
|
|
214
|
+
* pipeline.yaml: limits.messages.context_extractor_per_msg_limit */
|
|
215
|
+
CONTEXT_EXTRACTOR_LIMIT: _msgLimits.context_extractor_per_msg_limit
|
|
121
216
|
};
|
|
122
217
|
|
|
123
218
|
// src/shared/constants/system/detection.ts
|
|
@@ -167,8 +262,8 @@ function logEvent(processId, event, detail) {
|
|
|
167
262
|
function getProcess(processId) {
|
|
168
263
|
return backgroundProcesses.get(processId);
|
|
169
264
|
}
|
|
170
|
-
function setProcess(processId,
|
|
171
|
-
backgroundProcesses.set(processId,
|
|
265
|
+
function setProcess(processId, process2) {
|
|
266
|
+
backgroundProcesses.set(processId, process2);
|
|
172
267
|
}
|
|
173
268
|
function deleteProcess(processId) {
|
|
174
269
|
return backgroundProcesses.delete(processId);
|
|
@@ -207,6 +302,14 @@ export {
|
|
|
207
302
|
STATUS_MARKERS,
|
|
208
303
|
PROCESS_EVENTS,
|
|
209
304
|
PROCESS_LIMITS,
|
|
305
|
+
getPipelineConfig,
|
|
306
|
+
llmNodeSystemPrompt,
|
|
307
|
+
getUserInputQueueConfig,
|
|
308
|
+
llmNodeOutputParsing,
|
|
309
|
+
llmNodeCooldownPolicy,
|
|
310
|
+
getPromptSources,
|
|
311
|
+
getLimits,
|
|
312
|
+
getPromptBuilderConfig,
|
|
210
313
|
SYSTEM_LIMITS,
|
|
211
314
|
DETECTION_PATTERNS,
|
|
212
315
|
ORPHAN_PROCESS_NAMES,
|