mirror of
https://github.com/stablyai/orca.git
synced 2026-10-27 08:02:51 +00:00
#7598 pushed client-ui.ts to 301 lines, one over the max-lines limit, which breaks repo lint for every PR that merges current main (verify does not run on main pushes). Follow the existing browser-schemas.ts/computer-schemas.ts pattern: zod schemas move to a sibling module, the method registry stays. Co-authored-by: Brennan Benson <>
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import type { PersistedUIState } from '../../../../shared/types'
|
|
import { defineMethod, type RpcMethod } from '../core'
|
|
import {
|
|
FeatureInteractionIdParam,
|
|
PRBotAuthorOverrideUpdate,
|
|
SettingsUpdate,
|
|
UiUpdate
|
|
} from './client-ui-schemas'
|
|
|
|
export const CLIENT_UI_METHODS: RpcMethod[] = [
|
|
defineMethod({
|
|
name: 'settings.get',
|
|
params: null,
|
|
handler: (_params, { runtime }) => ({ settings: runtime.getClientSettings() })
|
|
}),
|
|
defineMethod({
|
|
name: 'settings.update',
|
|
params: SettingsUpdate,
|
|
handler: (params, { runtime }) => ({ settings: runtime.updateClientSettings(params) })
|
|
}),
|
|
defineMethod({
|
|
name: 'settings.updatePRBotAuthorOverride',
|
|
params: PRBotAuthorOverrideUpdate,
|
|
handler: (params, { runtime }) => ({
|
|
settings: runtime.updateClientPRBotAuthorOverride(params)
|
|
})
|
|
}),
|
|
defineMethod({
|
|
name: 'ui.get',
|
|
params: null,
|
|
handler: (_params, { runtime }) => ({ ui: runtime.getUIState() })
|
|
}),
|
|
defineMethod({
|
|
name: 'ui.set',
|
|
params: UiUpdate,
|
|
handler: (params, { runtime }) => ({
|
|
ui: runtime.updateUIState(params as Partial<PersistedUIState>)
|
|
})
|
|
}),
|
|
defineMethod({
|
|
name: 'ui.recordFeatureInteraction',
|
|
params: FeatureInteractionIdParam,
|
|
handler: (params, { runtime }) => ({
|
|
ui: runtime.recordFeatureInteraction(params)
|
|
})
|
|
})
|
|
]
|