appsec-agent 0.1.2 → 0.2.0
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/README.md +5 -5
- package/conf/appsec_agent.yaml +3 -3
- package/dist/agent_actions.d.ts.map +1 -1
- package/dist/agent_actions.js +183 -171
- package/dist/agent_actions.js.map +1 -1
- package/dist/agent_options.d.ts +1 -1
- package/dist/agent_options.d.ts.map +1 -1
- package/dist/agent_options.js +9 -8
- package/dist/agent_options.js.map +1 -1
- package/dist/blinking_cursor.d.ts +25 -0
- package/dist/blinking_cursor.d.ts.map +1 -0
- package/dist/blinking_cursor.js +56 -0
- package/dist/blinking_cursor.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +60 -97
- package/dist/main.js.map +1 -1
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +89 -15
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppSec Agent (TypeScript)
|
|
2
2
|
|
|
3
|
-
A TypeScript package that provides AI-powered agents for Application Security (AppSec) tasks, built on top of the Claude Agent SDK.
|
|
3
|
+
A TypeScript package that provides AI-powered agents for Application Security (AppSec) tasks, built on top of the Claude Agent SDK. It helps automate mundane application security operations and streamline workflows.
|
|
4
4
|
|
|
5
5
|
**📦 Available on npm**: Install with `npm install appsec-agent`
|
|
6
6
|
|
|
@@ -37,7 +37,7 @@ A TypeScript package that provides AI-powered agents for Application Security (A
|
|
|
37
37
|
- Anthropic API key
|
|
38
38
|
|
|
39
39
|
### Step 1: Install Claude Code
|
|
40
|
-
Our agent toolkit is built on top of Claude Agent SDK (v0.1.58)
|
|
40
|
+
Our agent toolkit is built on top of Claude Agent SDK (v0.1.58), which in turn is built on top of Claude Code. To install our toolkit, you need to start with Claude Code. You may want to install it in the global user space:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
$ npm install -g @anthropic-ai/claude-code@2.0.58
|
|
@@ -182,8 +182,7 @@ This package is designed to be thread-safe for use in web applications where mul
|
|
|
182
182
|
1. **Create New Instances Per Request**: Always create a new `AgentActions` instance for each HTTP request:
|
|
183
183
|
|
|
184
184
|
```typescript
|
|
185
|
-
import { AgentActions, AgentArgs } from 'appsec-agent';
|
|
186
|
-
import { loadYaml } from 'appsec-agent';
|
|
185
|
+
import { AgentActions, AgentArgs, loadYaml } from 'appsec-agent';
|
|
187
186
|
|
|
188
187
|
app.post('/api/query', async (req, res) => {
|
|
189
188
|
const confDict = loadYaml('conf/appsec_agent.yaml');
|
|
@@ -252,7 +251,8 @@ appsec-agent/
|
|
|
252
251
|
│ ├── concurrency.test.ts # Concurrency and thread-safety tests
|
|
253
252
|
│ └── ... # Other test files
|
|
254
253
|
├── bin/
|
|
255
|
-
│
|
|
254
|
+
│ ├── agent-run.js # Main CLI script (compiled)
|
|
255
|
+
│ └── agent-run.ts # Main CLI script (source)
|
|
256
256
|
├── conf/
|
|
257
257
|
│ └── appsec_agent.yaml # General configuration file
|
|
258
258
|
├── package.json
|
package/conf/appsec_agent.yaml
CHANGED
|
@@ -12,9 +12,9 @@ default: &default
|
|
|
12
12
|
verbose: True
|
|
13
13
|
code_reviewer:
|
|
14
14
|
options:
|
|
15
|
-
system_prompt: "You are an Application Security (AppSec) expert assistant. You are responsible for performing a thorough code review. List out all the potential security
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
system_prompt: "You are an Application Security (AppSec) expert assistant. You are responsible for performing a thorough code review. List out all the potential security issues found in the code. Provide affected code snippet and security advice and guidance in the code review report."
|
|
16
|
+
output_format: "markdown"
|
|
17
|
+
verbose: True
|
|
18
18
|
threat_modeler:
|
|
19
19
|
options:
|
|
20
20
|
system_prompt: "You are an Application Security (AppSec) expert assistant. You are responsible for performing risk assessment on the source code repository for SOC2 type 2 compliance audit: 1. Start with drawing the ASCII text based Data Flow Diagrm (DFD), with output format as <codebase_data_flow_diagram_text_timestamp>; 2. then proceeding to use STRIDE methodology to perform threat modeling on the DFD, without output report in the format <codebase_threat_model_timestamp>; 3. finally, provide a seperate risk registry report including proposed remediation plan in the format <codebase_risk_registry_text_timestamp>. We're looking for 3 reports in the current working directory as the deliverable."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_actions.d.ts","sourceRoot":"","sources":["../src/agent_actions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"agent_actions.d.ts","sourceRoot":"","sources":["../src/agent_actions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAOD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,mBAAmB,CAA2B;gBAC1C,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAMtE;;OAEG;IACG,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAiJ/F;;OAEG;IACG,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiElE;;OAEG;IACG,6BAA6B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CA6DzE"}
|
package/dist/agent_actions.js
CHANGED
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.AgentActions = void 0;
|
|
9
9
|
const claude_agent_sdk_1 = require("@anthropic-ai/claude-agent-sdk");
|
|
10
10
|
const agent_options_1 = require("./agent_options");
|
|
11
|
+
const blinking_cursor_1 = require("./blinking_cursor");
|
|
11
12
|
class AgentActions {
|
|
12
13
|
confDict;
|
|
13
14
|
environment;
|
|
@@ -25,208 +26,139 @@ class AgentActions {
|
|
|
25
26
|
const agentOptions = new agent_options_1.AgentOptions(this.confDict, this.environment);
|
|
26
27
|
const options = agentOptions.getSimpleQueryAgentOptions(this.args.role, srcDir);
|
|
27
28
|
// Build prompt with conversation history and source directory context
|
|
29
|
+
const sourceDirContext = srcDir
|
|
30
|
+
? `\n\nContext: There is a source code directory available at ${srcDir}. You can search and read files within this directory to answer questions. The directory is located in the current working directory.\n`
|
|
31
|
+
: '';
|
|
28
32
|
let fullPrompt;
|
|
29
|
-
let sourceDirContext = '';
|
|
30
|
-
// Add source directory context if provided
|
|
31
|
-
if (srcDir) {
|
|
32
|
-
sourceDirContext = `\n\nContext: There is a source code directory available at ${srcDir}. You can search and read files within this directory to answer questions. The directory is located in the current working directory.\n`;
|
|
33
|
-
}
|
|
34
33
|
if (this.conversationHistory.length > 0) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
contextPrompt += `User: ${entry.content}\n`;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
contextPrompt += `Assistant: ${entry.content}\n`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
fullPrompt = `${contextPrompt}${sourceDirContext}User: ${yourPrompt}`;
|
|
34
|
+
const contextPrompt = this.conversationHistory
|
|
35
|
+
.map(entry => `${entry.role === 'user' ? 'User' : 'Assistant'}: ${entry.content}`)
|
|
36
|
+
.join('\n');
|
|
37
|
+
fullPrompt = `Previous conversation:\n${contextPrompt}${sourceDirContext}User: ${yourPrompt}`;
|
|
46
38
|
}
|
|
47
39
|
else {
|
|
48
40
|
fullPrompt = `${sourceDirContext}${yourPrompt}`;
|
|
49
41
|
}
|
|
42
|
+
const cursor = new blinking_cursor_1.BlinkingCursor();
|
|
43
|
+
let cursorStopped = false;
|
|
44
|
+
const stopCursor = () => {
|
|
45
|
+
if (!cursorStopped) {
|
|
46
|
+
cursor.stop();
|
|
47
|
+
cursorStopped = true;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
let accumulatedText = '';
|
|
51
|
+
let hasPrintedHeader = false;
|
|
52
|
+
let hasSeenStreamEvents = false;
|
|
53
|
+
let assistantResponseText = '';
|
|
54
|
+
let finalResult = null;
|
|
55
|
+
const printHeader = () => {
|
|
56
|
+
if (!hasPrintedHeader) {
|
|
57
|
+
console.log(`\nClaude:\n`);
|
|
58
|
+
hasPrintedHeader = true;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
50
61
|
try {
|
|
51
|
-
|
|
52
|
-
let hasPrintedHeader = false;
|
|
53
|
-
let hasSeenStreamEvents = false;
|
|
54
|
-
let messageCount = 0;
|
|
55
|
-
let assistantResponseText = '';
|
|
56
|
-
let finalResult = null;
|
|
62
|
+
cursor.start();
|
|
57
63
|
for await (const msg of (0, claude_agent_sdk_1.query)({ prompt: fullPrompt, options })) {
|
|
58
|
-
messageCount++;
|
|
59
|
-
// Debug logging (remove in production)
|
|
60
64
|
if (this.args.verbose) {
|
|
61
|
-
console.error(`[DEBUG] Message
|
|
65
|
+
console.error(`[DEBUG] Message type: ${msg.type}`);
|
|
62
66
|
}
|
|
63
|
-
// Handle stream events (streaming deltas) - these come first
|
|
64
67
|
if (msg.type === 'stream_event') {
|
|
65
68
|
hasSeenStreamEvents = true;
|
|
69
|
+
stopCursor();
|
|
66
70
|
const streamMsg = msg;
|
|
67
|
-
// Handle content block deltas (streaming text)
|
|
68
71
|
if (streamMsg.event?.type === 'content_block_delta' && streamMsg.event.delta?.type === 'text_delta') {
|
|
69
72
|
const deltaText = streamMsg.event.delta.text || '';
|
|
70
73
|
if (deltaText) {
|
|
71
|
-
|
|
72
|
-
console.log(`\nClaude:\n`);
|
|
73
|
-
hasPrintedHeader = true;
|
|
74
|
-
}
|
|
75
|
-
// Accumulate and write streaming deltas directly
|
|
74
|
+
printHeader();
|
|
76
75
|
accumulatedText += deltaText;
|
|
77
76
|
assistantResponseText += deltaText;
|
|
78
77
|
process.stdout.write(deltaText);
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
// Handle content block start (beginning of new content block)
|
|
82
80
|
else if (streamMsg.event?.type === 'content_block_start') {
|
|
83
|
-
|
|
84
|
-
if (!hasPrintedHeader) {
|
|
85
|
-
console.log(`\nClaude:\n`);
|
|
86
|
-
hasPrintedHeader = true;
|
|
87
|
-
}
|
|
88
|
-
// Don't reset accumulatedText here - we want to accumulate ALL text across all blocks
|
|
89
|
-
// Only reset if this is truly a new message (but we can't tell that here)
|
|
90
|
-
// Actually, we should keep accumulating to get the full response
|
|
91
|
-
}
|
|
92
|
-
// Handle message stop (one message/turn is complete, but stream may continue)
|
|
93
|
-
else if (streamMsg.event?.type === 'message_stop') {
|
|
94
|
-
// One message is complete, but the stream may continue with more messages
|
|
95
|
-
// (e.g., after tools execute). Don't treat this as stream end.
|
|
96
|
-
if (hasPrintedHeader && accumulatedText) {
|
|
97
|
-
// This message is done, but more may come
|
|
98
|
-
}
|
|
81
|
+
printHeader();
|
|
99
82
|
}
|
|
100
|
-
|
|
101
|
-
else if (this.args.verbose) {
|
|
83
|
+
else if (this.args.verbose && streamMsg.event?.type !== 'message_stop') {
|
|
102
84
|
console.error(`[DEBUG] Unhandled stream event type: ${streamMsg.event?.type}`);
|
|
103
85
|
}
|
|
104
86
|
}
|
|
105
|
-
// Handle assistant messages (complete messages) - only use if no stream events
|
|
106
|
-
// Note: If we've seen stream events, the content was already printed incrementally
|
|
107
|
-
// BUT: When tools are used, there may be more assistant messages after tools complete
|
|
108
|
-
// So we need to handle both cases
|
|
109
87
|
else if (msg.type === 'assistant') {
|
|
88
|
+
stopCursor();
|
|
110
89
|
const assistantMsg = msg;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
// This is additional content (e.g., after tools complete)
|
|
131
|
-
const newText = currentText.slice(accumulatedText.length);
|
|
132
|
-
if (newText) {
|
|
133
|
-
process.stdout.write(newText);
|
|
134
|
-
accumulatedText = currentText;
|
|
135
|
-
assistantResponseText = currentText;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
else if (currentText.length > accumulatedText.length) {
|
|
139
|
-
// More content than we've accumulated
|
|
140
|
-
const newText = currentText.slice(accumulatedText.length);
|
|
141
|
-
if (newText) {
|
|
142
|
-
process.stdout.write(newText);
|
|
143
|
-
accumulatedText = currentText;
|
|
144
|
-
assistantResponseText = currentText;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
90
|
+
for (const block of assistantMsg.message.content || []) {
|
|
91
|
+
if (block.type === 'text' && block.text) {
|
|
92
|
+
const currentText = block.text;
|
|
93
|
+
if (!hasSeenStreamEvents) {
|
|
94
|
+
// No streaming - print the complete message
|
|
95
|
+
printHeader();
|
|
96
|
+
console.log(currentText);
|
|
97
|
+
accumulatedText = currentText;
|
|
98
|
+
assistantResponseText = currentText;
|
|
99
|
+
}
|
|
100
|
+
else if (currentText.length > accumulatedText.length) {
|
|
101
|
+
// Print only new content not yet streamed
|
|
102
|
+
const newText = currentText.startsWith(accumulatedText)
|
|
103
|
+
? currentText.slice(accumulatedText.length)
|
|
104
|
+
: currentText; // Fallback: print entire text if mismatch
|
|
105
|
+
if (newText) {
|
|
106
|
+
process.stdout.write(newText);
|
|
107
|
+
accumulatedText = currentText;
|
|
108
|
+
assistantResponseText = currentText;
|
|
148
109
|
}
|
|
149
110
|
}
|
|
150
111
|
}
|
|
151
112
|
}
|
|
152
113
|
}
|
|
153
|
-
// Handle result messages - collect but don't display until stream completes
|
|
154
|
-
// IMPORTANT: The stream may continue after a result message if tools are being used
|
|
155
|
-
// We must continue processing until the stream is truly exhausted
|
|
156
114
|
else if (msg.type === 'result') {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
// Check for errors in result messages - display errors immediately
|
|
162
|
-
if (resultMsg.is_error) {
|
|
163
|
-
const errorMsg = resultMsg.errors?.[0] || resultMsg.error_message || 'Unknown error occurred';
|
|
115
|
+
stopCursor();
|
|
116
|
+
finalResult = msg;
|
|
117
|
+
if (finalResult.is_error) {
|
|
118
|
+
const errorMsg = finalResult.errors?.[0] || finalResult.error_message || 'Unknown error occurred';
|
|
164
119
|
console.error(`\nError: ${errorMsg}`);
|
|
165
|
-
if (
|
|
166
|
-
console.error(`Error subtype: ${
|
|
120
|
+
if (finalResult.subtype) {
|
|
121
|
+
console.error(`Error subtype: ${finalResult.subtype}`);
|
|
167
122
|
}
|
|
168
|
-
|
|
169
|
-
if (resultMsg.subtype === 'error_max_turns') {
|
|
123
|
+
if (finalResult.subtype === 'error_max_turns') {
|
|
170
124
|
console.error(`\nNote: The conversation stopped because max_turns (${options.maxTurns || 1}) was reached.`);
|
|
171
125
|
console.error(`To allow the agent to use tools and continue, increase max_turns in the configuration or use the code_reviewer role.`);
|
|
172
126
|
}
|
|
173
127
|
}
|
|
174
|
-
// Debug: log turn count and continue processing (stream may not be done yet)
|
|
175
128
|
if (this.args.verbose) {
|
|
176
|
-
console.error(`[DEBUG] Result: num_turns=${
|
|
177
|
-
console.error(`[DEBUG] Continuing to process stream (may have more messages after tools)`);
|
|
129
|
+
console.error(`[DEBUG] Result: num_turns=${finalResult.num_turns}, is_error=${finalResult.is_error}`);
|
|
178
130
|
}
|
|
179
131
|
}
|
|
180
|
-
// Handle tool progress messages (agent might be using tools)
|
|
181
132
|
else if (msg.type === 'tool_progress') {
|
|
182
|
-
// Tool is being executed - this is normal, just continue
|
|
183
133
|
if (this.args.verbose) {
|
|
184
134
|
const toolMsg = msg;
|
|
185
135
|
console.log(`[Tool Progress] ${toolMsg.tool_name}: ${toolMsg.elapsed_time_seconds}s`);
|
|
186
136
|
}
|
|
187
137
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
// Unknown message type - log it to help debug
|
|
191
|
-
if (this.args.verbose) {
|
|
192
|
-
console.error(`[DEBUG] Received unknown message type: ${msg.type}`);
|
|
193
|
-
console.error(`[DEBUG] Message content:`, JSON.stringify(msg, null, 2));
|
|
194
|
-
}
|
|
138
|
+
else if (this.args.verbose) {
|
|
139
|
+
console.error(`[DEBUG] Unknown message type: ${msg.type}`);
|
|
195
140
|
}
|
|
196
141
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (finalResult) {
|
|
208
|
-
// Ensure we flush any partial output and add newline
|
|
209
|
-
if (hasPrintedHeader) {
|
|
210
|
-
console.log(); // New line after final output
|
|
211
|
-
}
|
|
212
|
-
// Display cost only after stream is completely done
|
|
213
|
-
if (!finalResult.is_error && finalResult.total_cost_usd && finalResult.total_cost_usd > 0) {
|
|
214
|
-
console.log(`\nCost: $${finalResult.total_cost_usd.toFixed(4)}`);
|
|
215
|
-
}
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
stopCursor();
|
|
145
|
+
}
|
|
146
|
+
// Flush stdout writes
|
|
147
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
148
|
+
// Display final result
|
|
149
|
+
if (finalResult) {
|
|
150
|
+
if (hasPrintedHeader) {
|
|
151
|
+
console.log();
|
|
216
152
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// Store the current exchange in conversation history
|
|
220
|
-
this.conversationHistory.push({ role: 'user', content: yourPrompt });
|
|
221
|
-
if (assistantResponseText) {
|
|
222
|
-
this.conversationHistory.push({ role: 'assistant', content: assistantResponseText });
|
|
153
|
+
if (!finalResult.is_error && finalResult.total_cost_usd && finalResult.total_cost_usd > 0) {
|
|
154
|
+
console.log(`\nCost: $${finalResult.total_cost_usd.toFixed(4)}`);
|
|
223
155
|
}
|
|
224
156
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
157
|
+
// Store conversation history
|
|
158
|
+
this.conversationHistory.push({ role: 'user', content: yourPrompt });
|
|
159
|
+
if (assistantResponseText) {
|
|
160
|
+
this.conversationHistory.push({ role: 'assistant', content: assistantResponseText });
|
|
228
161
|
}
|
|
229
|
-
// Add newline for spacing after response (matching Python version)
|
|
230
162
|
console.log();
|
|
231
163
|
return '';
|
|
232
164
|
}
|
|
@@ -236,27 +168,67 @@ class AgentActions {
|
|
|
236
168
|
async codeReviewerWithOptions(userPrompt) {
|
|
237
169
|
const agentOptions = new agent_options_1.AgentOptions(this.confDict, this.environment);
|
|
238
170
|
const options = agentOptions.getCodeReviewerOptions(this.args.role);
|
|
171
|
+
// Declare cursor outside try block so it's accessible in catch
|
|
172
|
+
let cursor = null;
|
|
239
173
|
try {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
174
|
+
// Start blinking cursor to show we're waiting for Claude's response
|
|
175
|
+
cursor = new blinking_cursor_1.BlinkingCursor();
|
|
176
|
+
cursor.start();
|
|
177
|
+
try {
|
|
178
|
+
for await (const message of (0, claude_agent_sdk_1.query)({ prompt: userPrompt, options })) {
|
|
179
|
+
if (message.type === 'stream_event') {
|
|
180
|
+
// Stop cursor when we receive stream events
|
|
181
|
+
if (cursor)
|
|
182
|
+
cursor.stop();
|
|
183
|
+
const streamMsg = message;
|
|
184
|
+
// Handle content block deltas (streaming text)
|
|
185
|
+
if (streamMsg.event?.type === 'content_block_delta' && streamMsg.event.delta?.type === 'text_delta') {
|
|
186
|
+
const deltaText = streamMsg.event.delta.text || '';
|
|
187
|
+
if (deltaText) {
|
|
188
|
+
process.stdout.write(deltaText);
|
|
247
189
|
}
|
|
248
190
|
}
|
|
249
191
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
192
|
+
else if (message.type === 'assistant') {
|
|
193
|
+
// Stop cursor when we receive assistant message
|
|
194
|
+
if (cursor)
|
|
195
|
+
cursor.stop();
|
|
196
|
+
const assistantMsg = message;
|
|
197
|
+
if (assistantMsg.message.content) {
|
|
198
|
+
for (const block of assistantMsg.message.content) {
|
|
199
|
+
if (block.type === 'text') {
|
|
200
|
+
console.log(`Claude: ${block.text}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else if (message.type === 'result') {
|
|
206
|
+
// Stop cursor when we receive result (in case no content was received)
|
|
207
|
+
if (cursor)
|
|
208
|
+
cursor.stop();
|
|
209
|
+
const resultMsg = message;
|
|
210
|
+
if (resultMsg.total_cost_usd && resultMsg.total_cost_usd > 0) {
|
|
211
|
+
console.log(`\nCost: $${resultMsg.total_cost_usd.toFixed(4)}`);
|
|
212
|
+
}
|
|
255
213
|
}
|
|
256
214
|
}
|
|
257
215
|
}
|
|
216
|
+
finally {
|
|
217
|
+
// Always stop the cursor when done, even if there's an error
|
|
218
|
+
if (cursor)
|
|
219
|
+
cursor.stop();
|
|
220
|
+
}
|
|
258
221
|
}
|
|
259
222
|
catch (error) {
|
|
223
|
+
// Ensure cursor is stopped on error
|
|
224
|
+
if (cursor) {
|
|
225
|
+
try {
|
|
226
|
+
cursor.stop();
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
// Ignore if cursor cleanup fails
|
|
230
|
+
}
|
|
231
|
+
}
|
|
260
232
|
console.error('Error during code review:', error);
|
|
261
233
|
throw error;
|
|
262
234
|
}
|
|
@@ -269,27 +241,67 @@ class AgentActions {
|
|
|
269
241
|
async threatModelerAgentWithOptions(userPrompt) {
|
|
270
242
|
const agentOptions = new agent_options_1.AgentOptions(this.confDict, this.environment);
|
|
271
243
|
const options = agentOptions.getThreatModelerOptions(this.args.role);
|
|
244
|
+
// Declare cursor outside try block so it's accessible in catch
|
|
245
|
+
let cursor = null;
|
|
272
246
|
try {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
247
|
+
// Start blinking cursor to show we're waiting for Claude's response
|
|
248
|
+
cursor = new blinking_cursor_1.BlinkingCursor();
|
|
249
|
+
cursor.start();
|
|
250
|
+
try {
|
|
251
|
+
for await (const message of (0, claude_agent_sdk_1.query)({ prompt: userPrompt, options })) {
|
|
252
|
+
if (message.type === 'stream_event') {
|
|
253
|
+
// Stop cursor when we receive stream events
|
|
254
|
+
if (cursor)
|
|
255
|
+
cursor.stop();
|
|
256
|
+
const streamMsg = message;
|
|
257
|
+
// Handle content block deltas (streaming text)
|
|
258
|
+
if (streamMsg.event?.type === 'content_block_delta' && streamMsg.event.delta?.type === 'text_delta') {
|
|
259
|
+
const deltaText = streamMsg.event.delta.text || '';
|
|
260
|
+
if (deltaText) {
|
|
261
|
+
process.stdout.write(deltaText);
|
|
280
262
|
}
|
|
281
263
|
}
|
|
282
264
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
265
|
+
else if (message.type === 'assistant') {
|
|
266
|
+
// Stop cursor when we receive assistant message
|
|
267
|
+
if (cursor)
|
|
268
|
+
cursor.stop();
|
|
269
|
+
const assistantMsg = message;
|
|
270
|
+
if (assistantMsg.message.content) {
|
|
271
|
+
for (const block of assistantMsg.message.content) {
|
|
272
|
+
if (block.type === 'text') {
|
|
273
|
+
console.log(`Claude: ${block.text}`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else if (message.type === 'result') {
|
|
279
|
+
// Stop cursor when we receive result (in case no content was received)
|
|
280
|
+
if (cursor)
|
|
281
|
+
cursor.stop();
|
|
282
|
+
const resultMsg = message;
|
|
283
|
+
if (resultMsg.total_cost_usd && resultMsg.total_cost_usd > 0) {
|
|
284
|
+
console.log(`\nCost: $${resultMsg.total_cost_usd.toFixed(4)}`);
|
|
285
|
+
}
|
|
288
286
|
}
|
|
289
287
|
}
|
|
290
288
|
}
|
|
289
|
+
finally {
|
|
290
|
+
// Always stop the cursor when done, even if there's an error
|
|
291
|
+
if (cursor)
|
|
292
|
+
cursor.stop();
|
|
293
|
+
}
|
|
291
294
|
}
|
|
292
295
|
catch (error) {
|
|
296
|
+
// Ensure cursor is stopped on error
|
|
297
|
+
if (cursor) {
|
|
298
|
+
try {
|
|
299
|
+
cursor.stop();
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
// Ignore if cursor cleanup fails
|
|
303
|
+
}
|
|
304
|
+
}
|
|
293
305
|
console.error('Error during threat modeling:', error);
|
|
294
306
|
throw error;
|
|
295
307
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_actions.js","sourceRoot":"","sources":["../src/agent_actions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qEAA8F;AAC9F,mDAA+C;
|
|
1
|
+
{"version":3,"file":"agent_actions.js","sourceRoot":"","sources":["../src/agent_actions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qEAA8F;AAC9F,mDAA+C;AAE/C,uDAAmD;AAgBnD,MAAa,YAAY;IACf,QAAQ,CAAa;IACrB,WAAW,CAAS;IACpB,IAAI,CAAY;IAChB,mBAAmB,GAAwB,EAAE,CAAC,CAAC,oDAAoD;IAC3G,YAAY,QAAoB,EAAE,WAAmB,EAAE,IAAe;QACpE,IAAI,CAAC,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O,CAAC,OAAO,EAAE,CAAC;gCACjD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oCAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;gCACvC,CAAC;4BACH,CAAC;wBACH,CAAC;oBACH,CAAC;yBAAM,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;wBACrC,uEAAuE;wBACvE,IAAI,MAAM;4BAAE,MAAM,CAAC,IAAI,EAAE,CAAC;wBAC1B,MAAM,SAAS,GAAG,OAA2B,CAAC;wBAC9C,IAAI,SAAS,CAAC,cAAc,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC;4BAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;wBACjE,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;oBAAS,CAAC;gBACT,6DAA6D;gBAC7D,IAAI,MAAM;oBAAE,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,oCAAoC;YACpC,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC;oBACH,MAAM,CAAC,IAAI,EAAE,CAAC;gBAChB,CAAC;gBAAC,MAAM,CAAC;oBACP,iCAAiC;gBACnC,CAAC;YACH,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAnSD,oCAmSC"}
|
package/dist/agent_options.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare class AgentOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
getSimpleQueryAgentOptions(role?: string, srcDir?: string | null): Options;
|
|
35
35
|
/**
|
|
36
|
-
* Get options for code reviewer
|
|
36
|
+
* Get options for security code reviewer
|
|
37
37
|
*/
|
|
38
38
|
getCodeReviewerOptions(role?: string): Options;
|
|
39
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_options.d.ts","sourceRoot":"","sources":["../src/agent_options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAqC,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAsB;gBAE9B,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM;IAKrD;;;OAGG;IACH,eAAe,IAAI,YAAY,EAAE;IAIjC;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAIzB;;OAEG;IACH,sBAAsB,EAAE,UAAU,CAqBjC;IAED;;OAEG;IACH,0BAA0B,CAAC,IAAI,GAAE,MAA6B,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"agent_options.d.ts","sourceRoot":"","sources":["../src/agent_options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAqC,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,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