summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-07-27 02:00:26 -0400
committerGitHub <[email protected]>2025-07-27 06:00:26 +0000
commit576cebc9282cfbe57d45321105d72cc61597ce9b (patch)
tree374dd97245761fe5c40ee87a9b4d5674a26344cf /packages/cli/src/ui/commands
parent9e61b3510c0cd7f333f40f68e87d981aff19aab1 (diff)
feat: Add Shell Command Execution to Custom Commands (#4917)
Diffstat (limited to 'packages/cli/src/ui/commands')
-rw-r--r--packages/cli/src/ui/commands/types.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/cli/src/ui/commands/types.ts b/packages/cli/src/ui/commands/types.ts
index 59b0178c..2844177f 100644
--- a/packages/cli/src/ui/commands/types.ts
+++ b/packages/cli/src/ui/commands/types.ts
@@ -63,6 +63,8 @@ export interface CommandContext {
// Session-specific data
session: {
stats: SessionStatsState;
+ /** A transient list of shell commands the user has approved for this session. */
+ sessionShellAllowlist: Set<string>;
};
}
@@ -118,13 +120,28 @@ export interface SubmitPromptActionReturn {
content: string;
}
+/**
+ * The return type for a command action that needs to pause and request
+ * confirmation for a set of shell commands before proceeding.
+ */
+export interface ConfirmShellCommandsActionReturn {
+ type: 'confirm_shell_commands';
+ /** The list of shell commands that require user confirmation. */
+ commandsToConfirm: string[];
+ /** The original invocation context to be re-run after confirmation. */
+ originalInvocation: {
+ raw: string;
+ };
+}
+
export type SlashCommandActionReturn =
| ToolActionReturn
| MessageActionReturn
| QuitActionReturn
| OpenDialogActionReturn
| LoadHistoryActionReturn
- | SubmitPromptActionReturn;
+ | SubmitPromptActionReturn
+ | ConfirmShellCommandsActionReturn;
export enum CommandKind {
BUILT_IN = 'built-in',