agentk8 2.2.4 → 2.2.5
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,7 @@ 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);
|
|
23
24
|
// Detect agents mentioned in response
|
|
24
25
|
const detectMentionedAgents = (content) => {
|
|
25
26
|
const agents = [];
|
|
@@ -94,7 +95,7 @@ Respond with:
|
|
|
94
95
|
4. Questions (if any clarification needed)
|
|
95
96
|
|
|
96
97
|
Format your response clearly with headers.`;
|
|
97
|
-
const result = await runClaude(planPrompt, mode);
|
|
98
|
+
const result = await runClaude(planPrompt, mode, autoAccept);
|
|
98
99
|
const mentioned = detectMentionedAgents(result.response);
|
|
99
100
|
setCompletedAgents(['Orchestrator', ...mentioned]);
|
|
100
101
|
setActiveAgent(undefined);
|
|
@@ -130,7 +131,7 @@ Format your response clearly with headers.`;
|
|
|
130
131
|
setCompletedAgents([]);
|
|
131
132
|
setError(null);
|
|
132
133
|
try {
|
|
133
|
-
const result = await runClaude(input, mode);
|
|
134
|
+
const result = await runClaude(input, mode, autoAccept);
|
|
134
135
|
const mentioned = detectMentionedAgents(result.response);
|
|
135
136
|
setCompletedAgents(['Orchestrator', ...mentioned]);
|
|
136
137
|
setActiveAgent(undefined);
|
|
@@ -244,11 +245,19 @@ Ctrl+U - Clear input line`,
|
|
|
244
245
|
setError(`Unknown command: /${command}`);
|
|
245
246
|
}
|
|
246
247
|
};
|
|
247
|
-
// Handle
|
|
248
|
+
// Handle keyboard shortcuts
|
|
248
249
|
useInput((input, key) => {
|
|
249
250
|
if (key.ctrl && input === 'c') {
|
|
250
251
|
exit();
|
|
251
252
|
}
|
|
253
|
+
// Shift+Tab to toggle auto-accept
|
|
254
|
+
if (key.shift && key.tab) {
|
|
255
|
+
setAutoAccept(prev => {
|
|
256
|
+
const newValue = !prev;
|
|
257
|
+
addSystemMessage(newValue ? 'Auto-accept enabled (edits will be applied automatically)' : 'Auto-accept disabled');
|
|
258
|
+
return newValue;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
252
261
|
});
|
|
253
262
|
// Prepare items for Static (include welcome box as first item)
|
|
254
263
|
const staticItems = messages.length === 0
|
|
@@ -259,7 +268,7 @@ Ctrl+U - Clear input line`,
|
|
|
259
268
|
return _jsx(WelcomeBox, { version: version, mode: mode }, "welcome");
|
|
260
269
|
}
|
|
261
270
|
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 })] }));
|
|
271
|
+
} }), 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, autoAccept: autoAccept })] }));
|
|
263
272
|
};
|
|
264
273
|
function formatElapsed(start) {
|
|
265
274
|
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
|
];
|