agentk8 2.2.5 → 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 +1 -1
- package/dist/components/App.js +21 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/components/App.js
CHANGED
|
@@ -21,6 +21,7 @@ export const App = ({ mode, version }) => {
|
|
|
21
21
|
const [pendingPlan, setPendingPlan] = useState(null);
|
|
22
22
|
const [awaitingApproval, setAwaitingApproval] = useState(false);
|
|
23
23
|
const [autoAccept, setAutoAccept] = useState(false);
|
|
24
|
+
const [pendingAutoAccept, setPendingAutoAccept] = useState(false);
|
|
24
25
|
// Detect agents mentioned in response
|
|
25
26
|
const detectMentionedAgents = (content) => {
|
|
26
27
|
const agents = [];
|
|
@@ -41,6 +42,17 @@ export const App = ({ mode, version }) => {
|
|
|
41
42
|
handleCommand(input);
|
|
42
43
|
return;
|
|
43
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
|
+
}
|
|
44
56
|
// Handle approval response
|
|
45
57
|
if (awaitingApproval) {
|
|
46
58
|
// Enter (empty input) = approve
|
|
@@ -252,11 +264,14 @@ Ctrl+U - Clear input line`,
|
|
|
252
264
|
}
|
|
253
265
|
// Shift+Tab to toggle auto-accept
|
|
254
266
|
if (key.shift && key.tab) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
267
|
+
if (autoAccept) {
|
|
268
|
+
// Disable silently
|
|
269
|
+
setAutoAccept(false);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
// Show confirmation prompt
|
|
273
|
+
setPendingAutoAccept(true);
|
|
274
|
+
}
|
|
260
275
|
}
|
|
261
276
|
});
|
|
262
277
|
// Prepare items for Static (include welcome box as first item)
|
|
@@ -268,7 +283,7 @@ Ctrl+U - Clear input line`,
|
|
|
268
283
|
return _jsx(WelcomeBox, { version: version, mode: mode }, "welcome");
|
|
269
284
|
}
|
|
270
285
|
return (_jsx(ChatMessage, { role: item.role, agentName: item.agentName, content: item.content, tokens: item.tokens }, item.id));
|
|
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 })] }));
|
|
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 })] }));
|
|
272
287
|
};
|
|
273
288
|
function formatElapsed(start) {
|
|
274
289
|
const secs = Math.floor((Date.now() - start.getTime()) / 1000);
|