Files
orca/src/main/runtime/runtime-store-contract.ts
T
Brennan Benson e463aea99c fix(agent-launch): keep a short-lined multi-line prompt on a local zsh launch line, as main did
#24257 moved every multi-line or over-512-byte prompt off the typed launch line and pasted it after readiness. The phone's AI buttons and review notes, whose multi-line prompts main typed whole into zsh, then reached Claude 0.5-3 s later and their RPC reply waited for the paste.

The host now names the shell a local macOS or Linux line is typed into, the way the spawn picks it, and a multi-line prompt rides a zsh line when every line is at most 512 bytes and the whole line at most 8 KB. A real-zsh test types such a line through Orca's own ready barrier and startup write, including when a slow user config makes the write land early. Elsewhere the measured unsafe cases keep the paste: bash 3.2 runs multi-line lines piecemeal, fish drops an early multi-line write, and any shell loses a line over 1 KB written early.
2026-09-30 23:21:15 -07:00

142 lines
7.8 KiB
TypeScript

import type { Store } from '../persistence'
import type { GlobalSettings } from '../../shared/global-settings-types'
import type { VoiceSettings } from '../../shared/speech-types'
export type RuntimeStore = {
getRepos: Store['getRepos']
getRepo: Store['getRepo']
addRepo: Store['addRepo']
updateRepo: Store['updateRepo']
addRetiredWorktreeName?: Store['addRetiredWorktreeName']
mergeRetiredWorktreeNames?: Store['mergeRetiredWorktreeNames']
getRetiredWorktreeNameRegistry?: Store['getRetiredWorktreeNameRegistry']
getRetiredWorktreeNameRegistryForNamespace?: Store['getRetiredWorktreeNameRegistryForNamespace']
getProjects?: Store['getProjects']
updateProject?: Store['updateProject']
getProjectHostSetups?: Store['getProjectHostSetups']
createProjectHostSetup?: Store['createProjectHostSetup']
updateProjectHostSetup?: Store['updateProjectHostSetup']
deleteProjectHostSetup?: Store['deleteProjectHostSetup']
getProjectGroups?: Store['getProjectGroups']
createProjectGroup?: Store['createProjectGroup']
updateProjectGroup?: Store['updateProjectGroup']
deleteProjectGroup?: Store['deleteProjectGroup']
moveProjectToGroup?: Store['moveProjectToGroup']
getFolderWorkspaces?: Store['getFolderWorkspaces']
createFolderWorkspace?: Store['createFolderWorkspace']
updateFolderWorkspace?: Store['updateFolderWorkspace']
removeFolderWorkspace?: Store['removeFolderWorkspace']
removeProject?: Store['removeProject']
removeProjectForHost?: Store['removeProjectForHost']
reorderRepos?: Store['reorderRepos']
getAllWorktreeMeta: Store['getAllWorktreeMeta']
captureNativeLocalWorktreeMetadataScanExpectation?: Store['captureNativeLocalWorktreeMetadataScanExpectation']
pruneSessionlessMissingLocalWorktreeMetadataForRepo?: Store['pruneSessionlessMissingLocalWorktreeMetadataForRepo']
getProfileStorageDirectory?: Store['getProfileStorageDirectory']
getWorktreeMeta: Store['getWorktreeMeta']
setWorktreeMeta: Store['setWorktreeMeta']
setWorktreeMetaForHost?: Store['setWorktreeMetaForHost']
removeWorktreeMeta: Store['removeWorktreeMeta']
getWorktreeLineage?: Store['getWorktreeLineage']
getAllWorktreeLineage?: Store['getAllWorktreeLineage']
setWorktreeLineage?: Store['setWorktreeLineage']
removeWorktreeLineage?: Store['removeWorktreeLineage']
getAllWorkspaceLineage?: Store['getAllWorkspaceLineage']
setWorkspaceLineage?: Store['setWorkspaceLineage']
removeWorkspaceLineage?: Store['removeWorkspaceLineage']
getGitHubCache: Store['getGitHubCache']
getWorkspaceSession?: Store['getWorkspaceSession']
getWorkspaceSessionHostIds?: Store['getWorkspaceSessionHostIds']
setWorkspaceSession?: Store['setWorkspaceSession']
runDurableMutation?: Store['runDurableMutation']
flushOrThrow?: Store['flushOrThrow']
flushPendingOrThrowAsync?: Store['flushPendingOrThrowAsync']
persistPtyBinding?: Store['persistPtyBinding']
getSshRemotePtyLeases?: Store['getSshRemotePtyLeases']
getUI?: Store['getUI']
updateUI?: Store['updateUI']
recordFeatureInteraction?: Store['recordFeatureInteraction']
listAutomations?: Store['listAutomations']
listAutomationsForScope?: Store['listAutomationsForScope']
assertAutomationOwnerFence?: Store['assertAutomationOwnerFence']
automationOwnerPrecondition?: Store['automationOwnerPrecondition']
automationChangeSelector?: Store['automationChangeSelector']
listAutomationRuns?: Store['listAutomationRuns']
listAutomationRunsPage?: Store['listAutomationRunsPage']
createAutomation?: Store['createAutomation']
updateAutomation?: Store['updateAutomation']
deleteAutomation?: Store['deleteAutomation']
getSparsePresets?: Store['getSparsePresets']
saveSparsePreset?: Store['saveSparsePreset']
getMobileClientTabSelections?: Store['getMobileClientTabSelections']
setMobileClientTabSelections?: Store['setMobileClientTabSelections']
getSettings(): {
workspaceDir: string
nestWorkspaces: boolean
// Read by worktree placement: decides whether this project's worktrees
// mirror into a WSL distro instead of the Windows drive.
localWindowsRuntimeDefault?: GlobalSettings['localWindowsRuntimeDefault']
refreshLocalBaseRefOnWorktreeCreate: boolean
localBaseRefSuggestionDismissed?: boolean
branchPrefix: string
branchPrefixCustom: string
defaultTuiAgent?: GlobalSettings['defaultTuiAgent']
disabledTuiAgents?: GlobalSettings['disabledTuiAgents']
agentCmdOverrides?: GlobalSettings['agentCmdOverrides']
agentDefaultArgs?: GlobalSettings['agentDefaultArgs']
agentDefaultEnv?: GlobalSettings['agentDefaultEnv']
terminalWindowsShell?: GlobalSettings['terminalWindowsShell']
// Read by the launch-line carry rule to name the shell a local line is typed into.
terminalDefaultShell?: GlobalSettings['terminalDefaultShell']
floatingTerminalEnabled?: GlobalSettings['floatingTerminalEnabled']
agentStatusHooksEnabled?: GlobalSettings['agentStatusHooksEnabled']
terminalCopyTrimsGutter?: GlobalSettings['terminalCopyTrimsGutter']
experimentalNativeChat?: GlobalSettings['experimentalNativeChat']
openAgentTabsInChatByDefault?: GlobalSettings['openAgentTabsInChatByDefault']
experimentalStructuredNativeChat?: GlobalSettings['experimentalStructuredNativeChat']
defaultTaskSource?: GlobalSettings['defaultTaskSource']
defaultTaskViewPreset?: GlobalSettings['defaultTaskViewPreset']
visibleTaskProviders?: GlobalSettings['visibleTaskProviders']
defaultRepoSelection?: GlobalSettings['defaultRepoSelection']
defaultLinearTeamSelection?: GlobalSettings['defaultLinearTeamSelection']
githubProjects?: GlobalSettings['githubProjects']
experimentalNewWorktreeCardStyle?: GlobalSettings['experimentalNewWorktreeCardStyle']
compactWorktreeCards?: GlobalSettings['compactWorktreeCards']
minimaxGroupId?: GlobalSettings['minimaxGroupId']
minimaxUsageModels?: GlobalSettings['minimaxUsageModels']
minimaxEndpoint?: GlobalSettings['minimaxEndpoint']
prBotAuthorOverrides?: GlobalSettings['prBotAuthorOverrides']
artifactSharingEnabled?: GlobalSettings['artifactSharingEnabled']
terminalQuickCommands?: GlobalSettings['terminalQuickCommands']
gitlabProjects?: GlobalSettings['gitlabProjects']
mobileAutoRestoreFitMs?: number | null
mobileEmulatorEnabled?: boolean
mobileEmulatorDefaultDeviceUdid?: string | null
machineName?: GlobalSettings['machineName']
voice?: VoiceSettings
claudeAgentTeamsMode?: GlobalSettings['claudeAgentTeamsMode']
// Why: Phase-5 query responder kill switches — read per chunk in
// onPtyData to capture reply ownership at ingestion.
terminalMainSideEffectAuthority?: GlobalSettings['terminalMainSideEffectAuthority']
terminalHiddenDeliveryGate?: GlobalSettings['terminalHiddenDeliveryGate']
terminalModelQueryAuthority?: GlobalSettings['terminalModelQueryAuthority']
worktreeVisibilityDefaults?: GlobalSettings['worktreeVisibilityDefaults']
hostSettingOverrides?: GlobalSettings['hostSettingOverrides']
agentSkillSharingEnabled?: GlobalSettings['agentSkillSharingEnabled']
nativeChatSessionOptions?: GlobalSettings['nativeChatSessionOptions']
nativeChatInheritShellEnvironment?: GlobalSettings['nativeChatInheritShellEnvironment']
nativeChatShellEnvironmentVariables?: GlobalSettings['nativeChatShellEnvironmentVariables']
aiVaultSearch?: GlobalSettings['aiVaultSearch']
sourceControlAi?: GlobalSettings['sourceControlAi']
commitMessageAi?: GlobalSettings['commitMessageAi']
}
// Why: narrow to `unknown` return so test mocks can return void without
// a cast. The runtime never reads the return value — the persisted value
// is read back via getSettings() on the next access.
updateSettings?: (
updates: Partial<GlobalSettings>,
options?: { notifyListeners?: boolean; originWebContentsId?: number }
) => unknown
onSettingsChanged?: Store['onSettingsChanged']
}