mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 08:02:35 +00:00
fix(mobile): expose safe host display labels
This commit is contained in:
@@ -23,6 +23,9 @@ describe('OrcaRuntimeService', () => {
|
||||
...store,
|
||||
getSettings: () => ({
|
||||
...store.getSettings(),
|
||||
hostSettingOverrides: {
|
||||
'ssh:target-1': { displayLabel: 'Build host', defaultWorktreeLocation: '/srv/worktrees' }
|
||||
},
|
||||
experimentalNewWorktreeCardStyle: true,
|
||||
compactWorktreeCards: true,
|
||||
minimaxGroupId: 'group-42',
|
||||
@@ -39,6 +42,9 @@ describe('OrcaRuntimeService', () => {
|
||||
minimaxUsageModels: 'general,abab6.5'
|
||||
})
|
||||
expect(runtime.getClientSettings()).not.toHaveProperty('terminalQuickCommands')
|
||||
expect(runtime.getClientSettings().hostSettingOverrides).toEqual({
|
||||
'ssh:target-1': { displayLabel: 'Build host' }
|
||||
})
|
||||
expect(runtime.getClientTerminalQuickCommands()).toEqual(terminalQuickCommands)
|
||||
})
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
} from '../../shared/terminal-quick-commands'
|
||||
import { haveSameDisabledTuiAgents } from '../../shared/tui-agent-selection'
|
||||
import type { GlobalSettings } from '../../shared/global-settings-types'
|
||||
import { getHostDisplayLabelOverrides } from '../../shared/host-setting-overrides'
|
||||
import type { ExecutionHostId } from '../../shared/execution-host'
|
||||
import type { TerminalQuickCommand } from '../../shared/terminal-quick-command-types'
|
||||
import { recordManagedHookInstallFailure } from '../agent-hooks/install-telemetry'
|
||||
import { applyAgentStatusHooksEnabled } from '../agent-hooks/managed-agent-hook-controls'
|
||||
@@ -37,6 +39,13 @@ export type RuntimeClientSettings = Pick<
|
||||
| 'artifactSharingEnabled'
|
||||
| 'worktreeVisibilityDefaults'
|
||||
| 'agentSkillSharingEnabled'
|
||||
> & {
|
||||
hostSettingOverrides: RuntimeHostDisplayLabelOverrides
|
||||
}
|
||||
|
||||
/** Safe paired projection: host labels only; filesystem defaults stay host-private. */
|
||||
export type RuntimeHostDisplayLabelOverrides = Partial<
|
||||
Record<ExecutionHostId, { displayLabel: string }>
|
||||
>
|
||||
|
||||
export type RuntimeClientSettingsUpdate = Pick<
|
||||
@@ -94,7 +103,12 @@ export class RuntimeClientSettingsController {
|
||||
prBotAuthorOverrides: settings.prBotAuthorOverrides ?? [],
|
||||
artifactSharingEnabled: isArtifactSharingEnabled(settings),
|
||||
worktreeVisibilityDefaults: settings.worktreeVisibilityDefaults ?? { external: 'hide' },
|
||||
agentSkillSharingEnabled: isAgentSkillSharingEnabled(settings)
|
||||
agentSkillSharingEnabled: isAgentSkillSharingEnabled(settings),
|
||||
hostSettingOverrides: Object.fromEntries(
|
||||
[
|
||||
...getHostDisplayLabelOverrides({ hostSettingOverrides: settings.hostSettingOverrides })
|
||||
].map(([hostId, displayLabel]) => [hostId, { displayLabel }])
|
||||
) as RuntimeHostDisplayLabelOverrides
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ export type RuntimeStore = {
|
||||
terminalHiddenDeliveryGate?: GlobalSettings['terminalHiddenDeliveryGate']
|
||||
terminalModelQueryAuthority?: GlobalSettings['terminalModelQueryAuthority']
|
||||
worktreeVisibilityDefaults?: GlobalSettings['worktreeVisibilityDefaults']
|
||||
hostSettingOverrides?: GlobalSettings['hostSettingOverrides']
|
||||
agentSkillSharingEnabled?: GlobalSettings['agentSkillSharingEnabled']
|
||||
}
|
||||
// Why: narrow to `unknown` return so test mocks can return void without
|
||||
|
||||
Reference in New Issue
Block a user