Synced from monorepo
Synced from monorepo Changes: - Shell: accept target response id on rewind execute - Shell: stamp response id on chat user message chunks - Worktree: optional rebuild and stale git registration cleanup in auto-GC - Worktree: kind-aware auto-GC TTLs and config knobs - Worktree: macOS process CWD scan and Unix PID liveness for GC guards - Worktree: automatic throttled GC on startup (Linux age-based; non-Linux dead-only) - Pager: add `[ui].combine_queued_prompts` to batch queued follow-ups - Shell: stop overwriting user skills - Tools: read markdown in `skills/` directories untruncated - `/usage` shows per-session token and dollar usage in the TUI - Security: prompt on environment-dumping `ps` variants - Security: always-safe `kubectl` no longer runs arbitrary kubeconfig credential plugins without permission - Tools: make scheduler deletion durable - Shell: add relocation storage primitives - Shell: give side model calls their own conversation ids - Fix five workflow-runtime bugs (budget, pause, cancel, reconnect) - Security: peel `env -S` / `--split-string` operands in the Bash permission gate (managed deny/ask) - Pager: expose doctor in the TUI - Security: block unauthorized RCE via abused safe commands - Pager idle watcher cue: "1 subagent still running" instead of "watching · 1 subagent" - Security: block `rg --pre` arbitrary code execution in auto-mode - Voice: diagnose silent-mic failures (macOS permission) and add doctor/terminal-setup Voice section - App builder deployer: `allow_forking` and `show_built_with_grok` - Pager: stop stacking duplicate "Worked for" markers on parked turns - Shell: support `max` as a distinct reasoning effort tier - Tools: serialize background `/loop` fires on the whole work unit - Shell: add working-directory relocation state primitives - Proto: `ClientToolResult` and `ChatConfig` client-side tools - Shell: model providers - Chat: select App Builder product on the Build path - Shell: attach author identity to feedback when the deployment opts in - Doctor: fix for SSH wrap setup - Workflow authoring skills: create-workflow and import-claude-workflow docs - Add read-only grok doctor - Sandbox: apply Landlock without a controlling TTY - Pager: recover image paste over grok wrap on headless remotes - Pager: make actions screen-mode aware - Shell: resume sessions when the working directory moves - Pager: centralize terminal diagnostics - Workspace: gate inline shell file access - Pager: centralize terminal probes - Pager: edit minimal prompts in an external editor - Pager: standardize backgrounding on Ctrl+B - Shell: recap rides the parent turn's prompt cache - Tools: add scheduler lifecycle version clock Source-Revision: 0f4d7c91b8b2b408333f6de1e8a76cb8eaa71899
This commit is contained in:
parent
a881e6703f
commit
3af4d5d398
556 changed files with 56609 additions and 21892 deletions
|
|
@ -21,11 +21,51 @@ pub fn ctrl_dot_unreliable() -> bool {
|
|||
terminal_context().ctrl_dot_unreliable() || cfg!(target_os = "windows") || crate::host::is_wsl()
|
||||
}
|
||||
|
||||
/// Build the default action definitions.
|
||||
/// Choose the one agent-screen action that owns Ctrl+G for this mode.
|
||||
fn mode_ctrl_g_action(screen_mode: crate::app::ScreenMode) -> ActionDef {
|
||||
if screen_mode.is_minimal() {
|
||||
ActionDef {
|
||||
id: ActionId::EditPromptExternal,
|
||||
label: "edit prompt",
|
||||
description: "Edit prompt in external editor",
|
||||
default_key: key!('g', CONTROL),
|
||||
alt_keys: vec![],
|
||||
category: Category::Input,
|
||||
context: When::AgentScreen,
|
||||
hint_priority: None,
|
||||
hint_key_display: None,
|
||||
requires_confirmation: false,
|
||||
long_help: Some(
|
||||
"Opens the current prompt draft in $VISUAL or $EDITOR, falling back to vi when neither is set.\nSaving and closing the editor returns the updated text to the composer; it does not send the prompt.\nAvailable in minimal mode for ordinary attachment-free drafts.",
|
||||
),
|
||||
}
|
||||
} else {
|
||||
ActionDef {
|
||||
id: ActionId::ToggleTasks,
|
||||
label: "tasks",
|
||||
description: "Toggle tasks pane",
|
||||
default_key: key!('g', CONTROL),
|
||||
alt_keys: vec![],
|
||||
category: Category::Panels,
|
||||
context: When::AgentScreen,
|
||||
hint_priority: None,
|
||||
hint_key_display: None,
|
||||
requires_confirmation: false,
|
||||
long_help: Some(
|
||||
"Shows or hides the tasks pane, which lists background tasks and their status.\nUse it to monitor or return to work you sent to the background with Ctrl+B.\nA side pane; toggle off to reclaim width.",
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Build the default action definitions for a screen mode.
|
||||
///
|
||||
/// `mouse_reporting_toggle_enabled` gates the opt-in `ToggleMouseCapture`
|
||||
/// shortcut (see below); pass `false` for the standard set.
|
||||
pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
||||
pub(super) fn default_actions(
|
||||
screen_mode: crate::app::ScreenMode,
|
||||
mouse_reporting_toggle_enabled: bool,
|
||||
) -> Vec<ActionDef> {
|
||||
let ctx = terminal_context();
|
||||
// xterm.js embeds: no KKP; host often steals Ctrl+I. Share one family flag for
|
||||
// quit / half-page / interject so VS Code-family embeds match VS Code.
|
||||
|
|
@ -33,6 +73,11 @@ pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
|||
let in_vscode = in_vscode_family;
|
||||
let in_apple_terminal = ctx.brand == TerminalName::AppleTerminal;
|
||||
let ctrl_dot_unreliable = ctrl_dot_unreliable();
|
||||
let send_to_background_help = if screen_mode.is_minimal() {
|
||||
"Detaches the running foreground Execute so it keeps working in the background while you read, queue prompts, or start something else.\nTrack background work with /tasks.\nOnly meaningful while a foreground Execute is actually running."
|
||||
} else {
|
||||
"Detaches the running foreground Execute so it keeps working in the background while you read, queue prompts, or start something else.\nTrack and resume it from the tasks pane (Ctrl+G).\nOnly meaningful while a foreground Execute is actually running."
|
||||
};
|
||||
|
||||
let mut actions = vec![
|
||||
// ── Navigation (scrollback) ─────────────────────────────────
|
||||
|
|
@ -487,6 +532,7 @@ pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
|||
),
|
||||
},
|
||||
// ── Panes (agent-level — toggle side panes) ─────────────────
|
||||
mode_ctrl_g_action(screen_mode),
|
||||
ActionDef {
|
||||
id: ActionId::ToggleTodos,
|
||||
label: "todos",
|
||||
|
|
@ -502,21 +548,6 @@ pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
|||
"Shows or hides the todo pane: the agent's live task checklist for the current work.\nWatch what it plans to do and what's left as the turn runs.\nA side pane; toggle it off to reclaim width.",
|
||||
),
|
||||
},
|
||||
ActionDef {
|
||||
id: ActionId::ToggleTasks,
|
||||
label: "tasks",
|
||||
description: "Toggle tasks pane",
|
||||
default_key: key!('b', CONTROL),
|
||||
alt_keys: vec![],
|
||||
category: Category::Panels,
|
||||
context: When::AgentScreen,
|
||||
hint_priority: None,
|
||||
hint_key_display: None,
|
||||
requires_confirmation: false,
|
||||
long_help: Some(
|
||||
"Shows or hides the tasks pane, which lists background tasks and their status.\nUse it to monitor or return to work you sent to the background with Ctrl+G.\nA side pane; toggle off to reclaim width.",
|
||||
),
|
||||
},
|
||||
ActionDef {
|
||||
id: ActionId::ToggleQueue,
|
||||
label: "queue",
|
||||
|
|
@ -584,16 +615,14 @@ pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
|||
id: ActionId::SendToBackground,
|
||||
label: "send to bg",
|
||||
description: "Send running task to background",
|
||||
default_key: key!('g', CONTROL),
|
||||
default_key: key!('b', CONTROL),
|
||||
alt_keys: vec![],
|
||||
category: Category::Panels,
|
||||
context: When::AgentScreen,
|
||||
hint_priority: None,
|
||||
hint_key_display: None,
|
||||
requires_confirmation: false,
|
||||
long_help: Some(
|
||||
"Detaches the running turn so it keeps working in the background while you read, queue prompts, or start something else.\nTrack and resume it from the tasks pane (Ctrl+B).\nOnly meaningful while a turn is actually running.",
|
||||
),
|
||||
long_help: Some(send_to_background_help),
|
||||
},
|
||||
// ── Prompt ───────────────────────────────────────────────────
|
||||
ActionDef {
|
||||
|
|
@ -971,9 +1000,9 @@ pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
|||
description: "Toggle row grouping",
|
||||
// `Ctrl+G` ("group"). `Ctrl+S` was reassigned to the peek /
|
||||
// dispatch "send + open" chord so `Shift+Enter` could be
|
||||
// freed for newline insertion. (`Ctrl+G` is also bound to
|
||||
// `SendToBackground`, but that lives in `When::AgentScreen`,
|
||||
// a context that never overlaps the dashboard.)
|
||||
// freed for newline insertion. (`Ctrl+G` also has a
|
||||
// mode-specific `When::AgentScreen` action, a context that never
|
||||
// overlaps the dashboard.)
|
||||
default_key: key!('g', CONTROL),
|
||||
alt_keys: vec![],
|
||||
category: Category::Dashboard,
|
||||
|
|
@ -1205,5 +1234,17 @@ pub fn default_actions(mouse_reporting_toggle_enabled: bool) -> Vec<ActionDef> {
|
|||
},
|
||||
]);
|
||||
|
||||
// Minimal has no interactive scrollback or dashboard surface. Keep its
|
||||
// logical prompt, agent-screen, and legitimate global actions, but do not
|
||||
// register bindings whose target UI cannot exist in this process mode.
|
||||
if screen_mode.is_minimal() {
|
||||
actions.retain(|def| {
|
||||
!matches!(
|
||||
def.context,
|
||||
When::ScrollbackFocused | When::DashboardFocused | When::DashboardOverlay
|
||||
) && !matches!(def.id, ActionId::OpenDashboard | ActionId::FocusScrollback)
|
||||
});
|
||||
}
|
||||
|
||||
actions
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue