orca/mobile/scripts
Brennan Benson 5fcf777617
feat(mobile): Quick Commands (terminal + agent-prompt presets) (#9298)
* feat(mobile): add Quick Commands (terminal + agent-prompt presets)

Brings the desktop Terminal Quick Commands feature to mobile: saved
agent-prompt or terminal-command presets that launch a new terminal tab.

Entry point sits in the session tab strip next to the "+" new-terminal
button (with a divider) — quick commands spawn a tab, so they live with
tab creation, mirroring desktop's tab-bar split button.

- Launcher button + Quick Commands bottom sheet (search, This project /
  Global groups, run/edit/delete rows, add row).
- Add/Edit sheet mirroring desktop TerminalQuickCommandDialog: Label,
  Action toggle (Terminal Command | Agent Prompt), Agent select, Prompt /
  Command Text, Advanced (Append Enter, Scope Global/Project), validation
  and save-failure feedback.
- Launch reuses handleCreateTerminal (extended with enter + toast copy):
  agent prompts launch the agent then deliver the prompt; terminal
  commands run the (Enter-appended) command text.
- Expose terminalQuickCommands over the remote/mobile RPC surface
  (getClientSettings/updateClientSettings allowlists, RuntimeStore type,
  and the strict SettingsUpdate zod schema).
- Mirror the agent-prompt support predicate mobile-side (stdin-after-start
  agents are unsupported) with a parity test guarding drift from desktop.
- Mock server: sample quick commands + settings.update handler for QA.

* fix(mobile): harden quick command execution

* fix(mobile): harden quick command persistence and launch

* test(mobile): preserve unexpected quick command errors

* fix(mobile): harden quick command launch performance

* fix(runtime): reject malformed quick command updates

* refactor(mobile): reuse shared quick-command logic instead of mirroring

The mobile quick-commands mirror was built on a false premise — that
runtime-importing src/shared/terminal-quick-commands breaks the RN bundle
/ Vitest. It doesn't: tui-agent-config → orca-cli-command-name is a pure
leaf with no module-load Node APIs (verified via probe + bundle-graph).

- Mobile now reuses the canonical desktop helpers (action/agent/scope/
  matchesRepo/support/flatten) directly from src/shared; only genuinely
  mobile-specific pieces (agent-branded labels, native row truncation,
  the launch plan) stay local.
- Multiline runnable terminal commands now flatten via the shared
  flattenTerminalQuickCommand (";"-join) — unity with desktop, so a
  command saved on one runs identically on the other.
- Drop the MOBILE_TUI_AGENT_PROMPT_COMMAND_UNSUPPORTED mirror + its parity
  test; use the shared supportsTerminalAgentQuickCommand predicate.
- Export the shared MAX_QUICK_COMMAND_* length caps for reuse.

* fix(mobile): protect quick command data boundaries

* fix(mobile): enforce quick command limits

* fix(mobile): make quick command updates atomic

* fix(mobile): keep quick command filters recoverable

* fix(mobile): use filled play icon for quick commands

* Revert "fix(mobile): use filled play icon for quick commands"

This reverts commit 169bf053b060deabda489b92a8bba56c4a0a1ad6.

* fix(mobile): gate quick commands on host capability
2026-07-19 23:42:31 -07:00
..
build-terminal-webview-engine.mjs Fix blank mobile terminal on Android devices with outdated WebViews or blocked CDN (#7186) 2026-07-03 15:22:00 -07:00
mobile-expo-cli.mjs refs/heads/handle-mobile-pull-request-issues (#6598) 2026-06-28 00:58:17 -07:00
mobile-lag-scenario.ts Fix mobile workspace parity (#6207) 2026-06-23 17:07:28 -07:00
mock-server-encryption.ts Mobile: worktree-list sidebar for tablet/foldable layouts (#5505) 2026-06-16 16:50:38 -07:00
mock-server-file-preview-data.ts Show full workspace file tree on mobile (#7289) 2026-07-06 15:41:51 -07:00
mock-server-git-state.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mock-server-rpc-handlers.ts feat(mobile): Quick Commands (terminal + agent-prompt presets) (#9298) 2026-07-19 23:42:31 -07:00
mock-server-terminal-fixtures.ts Fix mobile file previews (#6315) 2026-06-26 12:10:58 -07:00
mock-server.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
prepare-android-release.mjs fix(mobile): keep Android release versionCode committed (#7271) 2026-07-03 15:26:11 -07:00
repro-terminal-colors.ts
repro-workspace-picker-lag.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
repro-worktree-startup-stream.ts
start-emulator-pairing-runtime.mjs Improve mobile emulator pairing startup (#6527) 2026-06-27 18:48:14 -07:00
start-emulator.mjs feat(mobile): show usage reset countdown on accounts screen (#7954) 2026-07-13 18:56:36 -07:00
start-expo.mjs chore(lint): adopt unicorn/prefer-import-meta-properties (error) (#6847) 2026-06-29 23:37:30 -07:00
test-subscribe.ts