import type { CommandSpec } from '../args' import { GLOBAL_FLAGS } from '../args' const COMPUTER_FLAGS = [...GLOBAL_FLAGS, 'worktree', 'session', 'app'] const COMPUTER_WINDOW_TARGET_FLAGS = ['window-id', 'window-index'] const COMPUTER_ACTION_FLAGS = [ ...COMPUTER_FLAGS, ...COMPUTER_WINDOW_TARGET_FLAGS, 'restore-window', 'no-screenshot' ] export const COMPUTER_COMMAND_SPECS: CommandSpec[] = [ { path: ['computer', 'capabilities'], summary: 'Show computer-use provider capabilities', usage: 'orca computer capabilities [--json]', allowedFlags: [...GLOBAL_FLAGS] }, { path: ['computer', 'list-apps'], summary: 'List running apps available to computer-use', usage: 'orca computer list-apps [--json]', allowedFlags: [...GLOBAL_FLAGS] }, { path: ['computer', 'permissions'], summary: 'Open computer-use permission setup', usage: 'orca computer permissions [--id ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'id'] }, { path: ['computer', 'list-windows'], summary: 'List windows for an app available to computer-use', usage: 'orca computer list-windows --app [--json]', allowedFlags: [...GLOBAL_FLAGS, 'app'] }, { path: ['computer', 'get-app-state'], summary: 'Capture a compact accessibility snapshot of an app', usage: 'orca computer get-app-state --app [--window-id | --window-index ] [--worktree | --session ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, ...COMPUTER_WINDOW_TARGET_FLAGS, 'restore-window'] }, { path: ['computer', 'click'], summary: 'Click an app element or window coordinate', usage: 'orca computer click --app (--element-index | --x --y ) [--window-id | --window-index ] [--click-count ] [--mouse-button ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [ ...COMPUTER_ACTION_FLAGS, 'element-index', 'x', 'y', 'click-count', 'mouse-button' ] }, { path: ['computer', 'perform-secondary-action'], summary: 'Perform an advertised secondary accessibility action', usage: 'orca computer perform-secondary-action --app --element-index --action [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'element-index', 'action'] }, { path: ['computer', 'scroll'], summary: 'Scroll an app element or window coordinate', usage: 'orca computer scroll --app (--element-index | --x --y ) --direction [--window-id | --window-index ] [--pages ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'element-index', 'x', 'y', 'direction', 'pages'] }, { path: ['computer', 'drag'], summary: 'Drag between app elements or window coordinates', usage: 'orca computer drag --app (--from-element-index --to-element-index | --from-x --from-y --to-x --to-y ) [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [ ...COMPUTER_ACTION_FLAGS, 'from-element-index', 'to-element-index', 'from-x', 'from-y', 'to-x', 'to-y' ] }, { path: ['computer', 'type-text'], summary: 'Type literal text at the current app focus', usage: 'orca computer type-text --app (--text | --text-stdin) [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'text', 'text-stdin'] }, { path: ['computer', 'press-key'], summary: 'Press a single key such as Return or Escape', usage: 'orca computer press-key --app --key [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'key'] }, { path: ['computer', 'hotkey'], summary: 'Press a platform-aware key combination', usage: 'orca computer hotkey --app --key [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'key'] }, { path: ['computer', 'paste-text'], summary: 'Paste exact text at the current app focus', usage: 'orca computer paste-text --app (--text | --text-stdin) [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'text', 'text-stdin'] }, { path: ['computer', 'set-value'], summary: 'Set the value of a settable app element', usage: 'orca computer set-value --app --element-index (--value | --value-stdin) [--window-id | --window-index ] [--restore-window] [--no-screenshot] [--json]', allowedFlags: [...COMPUTER_ACTION_FLAGS, 'element-index', 'value', 'value-stdin'] } ]