pentesting 0.70.11 → 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.
@@ -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 (30K) */
120
- CONTEXT_EXTRACTOR_LIMIT: 3e4
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, process) {
171
- backgroundProcesses.set(processId, process);
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,