feat: add required mode flag to cleanup and close

- Made `mode` a mandatory property in `MultiModelOptions`, `CloseSessionOptions`, and `CleanupOptions`.
- Updated function signatures to accept `mode` and removed default empty option objects where appropriate.
- Passed `mode: "cli"` from CLI commands and `mode: "tool"` from tool commands to cleanup, close, and open operations.
- Adjusted internal handling to use the provided `mode` (removed fallback defaults).
- Updated type definitions and added documentation for the new `mode` field.
This commit is contained in:
2026-03-23 13:59:05 +05:30
parent 415b0624f1
commit 6b07a7ac2a
7 changed files with 13 additions and 4 deletions
+5 -1
View File
@@ -9,7 +9,7 @@ export interface MultiModelOptions {
/** Binary name to use ('opencode' or 'kilo'). Defaults to 'opencode'. */
binaryName?: string;
/** Caller context: 'cli' shows shell commands, 'tool' shows tool instructions. */
mode?: "cli" | "tool";
mode: "cli" | "tool";
}
/**
@@ -40,6 +40,8 @@ export interface CloseSessionOptions {
cleanupWorktrees?: boolean;
/** Skip confirmation prompts. */
force?: boolean;
/** Caller context: 'cli' shows shell commands, 'tool' shows tool instructions. */
mode: "cli" | "tool";
}
/**
@@ -87,6 +89,8 @@ export interface CleanupOptions {
* - If false: only local cleanup (--no-remote flag)
*/
remote?: string | false;
/** Caller context: 'cli' shows shell commands, 'tool' shows tool instructions. */
mode: "cli" | "tool";
}
/**