Files
archived-orca/src/shared/remote-runtime/remote-runtime-client-capabilities.ts
T
Neil c10881fa8c refactor(shared): organize execution and automation defining owners (#39776)
* refactor: import journal queue state from defining owners

* refactor(shared): organize execution and automation owners

* fix: retain type imports used by surviving test cases

* refactor: finish work item owners and refresh validation metadata

* test: infer reconnect status fixture type

* test(claude): resolve source files beside same-named directories

* test(runtime): group repository creation mock registrations
2026-11-08 06:46:09 -08:00

62 lines
3.0 KiB
TypeScript

import {
AGENT_SESSION_BACKGROUND_TASK_ROW_STOP_CAPABILITY,
AGENT_SESSION_TURN_ITEM_CAPABILITY,
AGENT_SESSION_BACKGROUND_TASK_STOP_CAPABILITY,
AGENT_SESSION_BOUNDARY_RUNTIME_CAPABILITY
} from '../agent-session/agent-session-runtime-capabilities'
import { AUTOMATION_OWNER_FENCING_RUNTIME_CAPABILITY } from '../automations/automation-runtime-capabilities'
import {
REPO_SEARCH_QUALIFIED_REFS_RUNTIME_CAPABILITY,
WORKTREE_GITHUB_PR_SUPPRESSION_RUNTIME_CAPABILITY,
WORKTREE_VISIBILITY_DEFAULTS_RUNTIME_CAPABILITY,
WORKTREE_VISIBILITY_SOURCE_DEFAULTS_RUNTIME_CAPABILITY
} from '../worktree-runtime-capabilities'
import {
SESSION_TAB_CLOSE_INTENT_RUNTIME_CAPABILITY,
SESSION_TABS_AUTHORITATIVE_INVENTORY_RUNTIME_CAPABILITY
} from '../session-tabs-runtime-capabilities'
import type { RuntimeCapability } from '../protocol-version'
import {
TERMINAL_QUICK_COMMAND_LARGE_LISTS_RUNTIME_CAPABILITY,
TERMINAL_QUICK_COMMAND_LONG_PROMPTS_RUNTIME_CAPABILITY
} from '../terminal/quick-commands/terminal-quick-command-capabilities'
import { AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY } from '../agent-session/agent-session-background-task-child-views-capability'
import { SKILL_INSTALL_RESULT_V2_CAPABILITY } from '../skill-install-capability'
import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../sidebar-inputs-switch'
import { WORKSPACE_UNREAD_HOST_RAISES_CAPABILITY } from '../workspace-unread-raise-capability'
import {
COMPRESSED_FRAMES_CLIENT_CAPABILITY,
compressedFramesDisabled
} from './e2ee/paired-e2ee-compressed-frame'
// Keep every remote request transport on the same mixed-version capability contract.
export function remoteRuntimeClientCapabilities(
additionalCapabilities: readonly RuntimeCapability[] = []
): RuntimeCapability[] {
return Array.from(
new Set([
AGENT_SESSION_BACKGROUND_TASK_STOP_CAPABILITY,
AGENT_SESSION_BACKGROUND_TASK_ROW_STOP_CAPABILITY,
AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY,
AGENT_SESSION_TURN_ITEM_CAPABILITY,
SESSION_TAB_CLOSE_INTENT_RUNTIME_CAPABILITY,
SESSION_TABS_AUTHORITATIVE_INVENTORY_RUNTIME_CAPABILITY,
AGENT_SESSION_BOUNDARY_RUNTIME_CAPABILITY,
SKILL_INSTALL_RESULT_V2_CAPABILITY,
WORKTREE_GITHUB_PR_SUPPRESSION_RUNTIME_CAPABILITY,
WORKTREE_VISIBILITY_DEFAULTS_RUNTIME_CAPABILITY,
WORKTREE_VISIBILITY_SOURCE_DEFAULTS_RUNTIME_CAPABILITY,
AUTOMATION_OWNER_FENCING_RUNTIME_CAPABILITY,
REPO_SEARCH_QUALIFIED_REFS_RUNTIME_CAPABILITY,
TERMINAL_QUICK_COMMAND_LONG_PROMPTS_RUNTIME_CAPABILITY,
TERMINAL_QUICK_COMMAND_LARGE_LISTS_RUNTIME_CAPABILITY,
// Switch point: every desktop socket, browser hosting's included, leaves the unread flag to
// a host that raises it.
...(ORCA_SIDEBAR_INPUTS_IS_MAIN ? [WORKSPACE_UNREAD_HOST_RAISES_CAPABILITY] : []),
// Every client sending this list inflates (desktop/CLI: remote-runtime-sealed-frame; mobile: its channel).
...(compressedFramesDisabled() ? [] : [COMPRESSED_FRAMES_CLIENT_CAPABILITY]),
...additionalCapabilities
])
)
}