agentk8 2.2.4 → 2.2.6
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/cli.js
CHANGED
package/dist/components/App.js
CHANGED
|
@@ -20,6 +20,8 @@ export const App = ({ mode, version }) => {
|
|
|
20
20
|
const [completedAgents, setCompletedAgents] = useState([]);
|
|
21
21
|
const [pendingPlan, setPendingPlan] = useState(null);
|
|
22
22
|
const [awaitingApproval, setAwaitingApproval] = useState(false);
|
|
23
|
+
const [autoAccept, setAutoAccept] = useState(false);
|
|
24
|
+
const [pendingAutoAccept, setPendingAutoAccept] = useState(false);
|
|
23
25
|
// Detect agents mentioned in response
|
|
24
26
|
const detectMentionedAgents = (content) => {
|
|
25
27
|
const agents = [];
|
|
@@ -40,6 +42,17 @@ export const App = ({ mode, version }) => {
|
|
|
40
42
|
handleCommand(input);
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
45
|
+
// Handle auto-accept confirmation
|
|
46
|
+
if (pendingAutoAccept) {
|
|
47
|
+
if (input.trim() === '') {
|
|
48
|
+
// Enter = confirm auto-accept
|
|
49
|
+
setAutoAccept(true);
|
|
50
|
+
setPendingAutoAccept(false);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Any other input = cancel and process as normal input
|
|
54
|
+
setPendingAutoAccept(false);
|
|
55
|
+
}
|
|
43
56
|
// Handle approval response
|
|
44
57
|
if (awaitingApproval) {
|
|
45
58
|
// Enter (empty input) = approve
|
|
@@ -94,7 +107,7 @@ Respond with:
|
|
|
94
107
|
4. Questions (if any clarification needed)
|
|
95
108
|
|
|
96
109
|
Format your response clearly with headers.`;
|
|
97
|
-
const result = await runClaude(planPrompt, mode);
|
|
110
|
+
const result = await runClaude(planPrompt, mode, autoAccept);
|
|
98
111
|
const mentioned = detectMentionedAgents(result.response);
|
|
99
112
|
setCompletedAgents(['Orchestrator', ...mentioned]);
|
|
100
113
|
setActiveAgent(undefined);
|
|
@@ -130,7 +143,7 @@ Format your response clearly with headers.`;
|
|
|
130
143
|
setCompletedAgents([]);
|
|
131
144
|
setError(null);
|
|
132
145
|
try {
|
|
133
|
-
const result = await runClaude(input, mode);
|
|
146
|
+
const result = await runClaude(input, mode, autoAccept);
|
|
134
147
|
const mentioned = detectMentionedAgents(result.response);
|
|
135
148
|
setCompletedAgents(['Orchestrator', ...mentioned]);
|
|
136
149
|
setActiveAgent(undefined);
|
|
@@ -244,11 +257,22 @@ Ctrl+U - Clear input line`,
|
|
|
244
257
|
setError(`Unknown command: /${command}`);
|
|
245
258
|
}
|
|
246
259
|
};
|
|
247
|
-
// Handle
|
|
260
|
+
// Handle keyboard shortcuts
|
|
248
261
|
useInput((input, key) => {
|
|
249
262
|
if (key.ctrl && input === 'c') {
|
|
250
263
|
exit();
|
|
251
264
|
}
|
|
265
|
+
// Shift+Tab to toggle auto-accept
|
|
266
|
+
if (key.shift && key.tab) {
|
|
267
|
+
if (autoAccept) {
|
|
268
|
+
// Disable silently
|
|
269
|
+
setAutoAccept(false);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
// Show confirmation prompt
|
|
273
|
+
setPendingAutoAccept(true);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
252
276
|
});
|
|
253
277
|
// Prepare items for Static (include welcome box as first item)
|
|
254
278
|
const staticItems = messages.length === 0
|
|
@@ -259,7 +283,7 @@ Ctrl+U - Clear input line`,
|
|
|
259
283
|
return _jsx(WelcomeBox, { version: version, mode: mode }, "welcome");
|
|
260
284
|
}
|
|
261
285
|
return (_jsx(ChatMessage, { role: item.role, agentName: item.agentName, content: item.content, tokens: item.tokens }, item.id));
|
|
262
|
-
} }), isProcessing && processingStartTime && (_jsx(ThinkingIndicator, { startTime: processingStartTime })), error && (_jsx(Box, { marginY: 1, marginLeft: 1, children: _jsxs(Text, { color: "#e53e3e", children: ["\u2717 Error: ", error] }) })), _jsx(Input, { onSubmit: handleSubmit, disabled: isProcessing, placeholder: awaitingApproval ? "Press Enter to execute, n to cancel" : 'Try "build a password validator"' }), _jsx(StatusBar, { mode: mode, tokens: totalTokens, startTime: startTime, isProcessing: isProcessing, activeAgent: activeAgent, completedAgents: completedAgents })] }));
|
|
286
|
+
} }), isProcessing && processingStartTime && (_jsx(ThinkingIndicator, { startTime: processingStartTime })), error && (_jsx(Box, { marginY: 1, marginLeft: 1, children: _jsxs(Text, { color: "#e53e3e", children: ["\u2717 Error: ", error] }) })), _jsx(Input, { onSubmit: handleSubmit, disabled: isProcessing, placeholder: pendingAutoAccept ? "Auto-accept: edits applied without asking. Enter to confirm" : awaitingApproval ? "Press Enter to execute, n to cancel" : 'Try "build a password validator"' }), _jsx(StatusBar, { mode: mode, tokens: totalTokens, startTime: startTime, isProcessing: isProcessing, activeAgent: activeAgent, completedAgents: completedAgents, autoAccept: autoAccept })] }));
|
|
263
287
|
};
|
|
264
288
|
function formatElapsed(start) {
|
|
265
289
|
const secs = Math.floor((Date.now() - start.getTime()) / 1000);
|
|
@@ -23,7 +23,7 @@ const agentIcons = {
|
|
|
23
23
|
'Data Engineer': '&',
|
|
24
24
|
Evaluator: '^',
|
|
25
25
|
};
|
|
26
|
-
export const StatusBar = ({ mode, tokens, startTime, isProcessing = false, activeAgent, completedAgents = [], }) => {
|
|
26
|
+
export const StatusBar = ({ mode, tokens, startTime, isProcessing = false, activeAgent, completedAgents = [], autoAccept = false, }) => {
|
|
27
27
|
const [elapsed, setElapsed] = useState('');
|
|
28
28
|
const [spinnerFrame, setSpinnerFrame] = useState(0);
|
|
29
29
|
const [pulseFrame, setPulseFrame] = useState(0);
|
|
@@ -82,6 +82,6 @@ export const StatusBar = ({ mode, tokens, startTime, isProcessing = false, activ
|
|
|
82
82
|
const leftBracket = isActive ? pulseBrackets[pulseFrame] : '[';
|
|
83
83
|
const rightBracket = isActive ? pulseBrackets[(pulseFrame + 3) % pulseBrackets.length] === '<' ? '>' : pulseBrackets[(pulseFrame + 3) % pulseBrackets.length] === '{' ? '}' : pulseBrackets[(pulseFrame + 3) % pulseBrackets.length] === '(' ? ')' : ']' : ']';
|
|
84
84
|
return (_jsxs(React.Fragment, { children: [_jsx(Text, { color: getAgentColor(agent), children: leftBracket }), _jsx(Text, { color: getAgentColor(agent), children: agentIcons[agent] }), _jsx(Text, { color: getAgentColor(agent), children: rightBracket }), i < modeAgents.length - 1 && _jsx(Text, { color: theme.dim, children: " " })] }, agent));
|
|
85
|
-
}), _jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.dim, children: "? help" }), isProcessing && (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.highlight, children: icons.spinner[spinnerFrame] })] })), elapsed && (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.dim, children: elapsed })] })), _jsx(Text, { color: theme.dim, children: ' '.repeat(3) }), _jsxs(Text, { color: theme.accent, children: ["\u2191 ", formatTokens(tokens)] }), _jsx(Text, { color: theme.dim, children: " tokens" })] }));
|
|
85
|
+
}), _jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.dim, children: "? help" }), autoAccept && (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.active, children: "AUTO" })] })), isProcessing && (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.highlight, children: icons.spinner[spinnerFrame] })] })), elapsed && (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.border, children: " \u2502 " }), _jsx(Text, { color: theme.dim, children: elapsed })] })), _jsx(Text, { color: theme.dim, children: ' '.repeat(3) }), _jsxs(Text, { color: theme.accent, children: ["\u2191 ", formatTokens(tokens)] }), _jsx(Text, { color: theme.dim, children: " tokens" })] }));
|
|
86
86
|
};
|
|
87
87
|
export default StatusBar;
|
package/dist/lib/claude.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ interface ClaudeResult {
|
|
|
5
5
|
output: number;
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
export declare function runClaude(prompt: string, mode: 'dev' | 'ml'): Promise<ClaudeResult>;
|
|
8
|
+
export declare function runClaude(prompt: string, mode: 'dev' | 'ml', autoAccept?: boolean): Promise<ClaudeResult>;
|
|
9
9
|
export declare function checkClaudeInstalled(): Promise<boolean>;
|
|
10
10
|
export {};
|
package/dist/lib/claude.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
-
export async function runClaude(prompt, mode) {
|
|
2
|
+
export async function runClaude(prompt, mode, autoAccept = false) {
|
|
3
3
|
const systemPrompt = getSystemPrompt(mode);
|
|
4
4
|
return new Promise((resolve, reject) => {
|
|
5
5
|
const args = [
|
|
6
6
|
'--print',
|
|
7
7
|
'--output-format', 'json',
|
|
8
|
+
...(autoAccept ? ['--dangerously-skip-permissions'] : []),
|
|
8
9
|
'--system-prompt', systemPrompt,
|
|
9
10
|
prompt,
|
|
10
11
|
];
|