mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 00:03:47 +00:00
fix: keep scoped RPC tests native-free
This commit is contained in:
@@ -10,6 +10,7 @@ import type {
|
||||
import type { RuntimeRpcResponse } from '../../shared/runtime-rpc-envelope'
|
||||
import { TERMINAL_FIT_RESTORE_DEADLINE_MS } from '../../shared/terminal-fit-restore-deadline'
|
||||
import { RpcDispatcher } from '../runtime/rpc/dispatcher'
|
||||
import { ALL_RPC_METHODS } from '../runtime/rpc/methods'
|
||||
|
||||
function boundTerminalFitRestore(pending: Promise<boolean>): Promise<boolean> {
|
||||
let timer: ReturnType<typeof setTimeout> | undefined
|
||||
@@ -47,7 +48,7 @@ export function registerRuntimeHandlers(runtime: OrcaRuntimeService): void {
|
||||
_event,
|
||||
args: { method: string; params?: unknown }
|
||||
): Promise<RuntimeRpcResponse<unknown>> => {
|
||||
return (await new RpcDispatcher({ runtime }).dispatch({
|
||||
return (await new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS }).dispatch({
|
||||
id: 'desktop-ipc',
|
||||
authToken: 'desktop-ipc',
|
||||
method: args.method,
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
|
||||
import type { FeatureInteractionId } from '../../../shared/feature-interactions'
|
||||
import { errorResponse, successResponse } from './errors'
|
||||
import { ALL_RPC_METHODS } from './methods'
|
||||
import { emulatorProbe, emulatorProbeError } from '../../emulator/emulator-probe'
|
||||
import type { OrcaRuntimeService } from '../orca-runtime'
|
||||
import {
|
||||
@@ -26,7 +25,7 @@ import { OrchestrationLegacyCompatibility } from './orchestration-legacy-compati
|
||||
import type { RpcDispatchStreamingOptions } from './dispatcher-stream-options'
|
||||
import { invalidArgumentResponse, mapDispatcherError } from './dispatcher-error-response'
|
||||
|
||||
export type DispatcherOptions = { runtime: OrcaRuntimeService; methods?: readonly RpcAnyMethod[] }
|
||||
export type DispatcherOptions = { runtime: OrcaRuntimeService; methods: readonly RpcAnyMethod[] }
|
||||
|
||||
export class RpcDispatcher {
|
||||
private readonly runtime: OrcaRuntimeService
|
||||
@@ -34,7 +33,7 @@ export class RpcDispatcher {
|
||||
private readonly orchestrationMutations: OrchestrationMutationExecutor
|
||||
private readonly legacyOrchestration: OrchestrationLegacyCompatibility
|
||||
|
||||
constructor({ runtime, methods = ALL_RPC_METHODS }: DispatcherOptions) {
|
||||
constructor({ runtime, methods }: DispatcherOptions) {
|
||||
this.runtime = runtime
|
||||
this.registry = buildRegistry(methods)
|
||||
this.orchestrationMutations = getOrchestrationMutationExecutor(runtime)
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
type RuntimeMetadataOwnershipWatch
|
||||
} from './runtime-metadata-ownership-watch'
|
||||
import { RpcDispatcher } from './rpc/dispatcher'
|
||||
import { ALL_RPC_METHODS } from './rpc/methods'
|
||||
import type { RpcRequest, RpcResponse } from './rpc/core'
|
||||
import { errorResponse } from './rpc/errors'
|
||||
import type { RpcMessageContext, RpcTransport } from './rpc/transport'
|
||||
@@ -559,7 +560,7 @@ export class OrcaRuntimeRpcServer {
|
||||
metadataOwnershipPollMs = RUNTIME_METADATA_OWNERSHIP_POLL_MS
|
||||
}: OrcaRuntimeRpcServerOptions) {
|
||||
this.runtime = runtime
|
||||
this.dispatcher = new RpcDispatcher({ runtime })
|
||||
this.dispatcher = new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS })
|
||||
this.userDataPath = userDataPath
|
||||
this.pid = pid
|
||||
this.platform = platform
|
||||
|
||||
@@ -3,8 +3,9 @@ import { randomUUID } from 'node:crypto'
|
||||
import type { RuntimeOrchestrationEnvelope } from '../../shared/runtime-rpc-envelope'
|
||||
import { readOrchestrationCompatibilityEvidence } from '../../shared/orchestration-compatibility-evidence'
|
||||
import { ORCHESTRATION_CONTRACT_VERSION } from '../../shared/protocol-version'
|
||||
import { RpcDispatcher } from '../runtime/rpc/dispatcher'
|
||||
import type { RpcResponse } from '../runtime/rpc/core'
|
||||
import { RpcDispatcher } from '../runtime/rpc/dispatcher'
|
||||
import { ALL_RPC_METHODS } from '../runtime/rpc/methods'
|
||||
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import {
|
||||
HostCliUnavailableError,
|
||||
@@ -100,7 +101,7 @@ async function runLegacyRemoteOrcaCli(
|
||||
json: boolean,
|
||||
passthroughFailure: HostCliUnavailableError
|
||||
): Promise<RemoteOrcaCliResult> {
|
||||
const dispatcher = new RpcDispatcher({ runtime })
|
||||
const dispatcher = new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS })
|
||||
const help = getRemoteLinearHelp(parsed)
|
||||
if (help) {
|
||||
return { stdout: `${help}\n`, stderr: '', exitCode: 0 }
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ORCHESTRATION_CONTRACT_VERSION } from '../../shared/protocol-version'
|
||||
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import type { RpcResponse } from '../runtime/rpc/core'
|
||||
import { RpcDispatcher } from '../runtime/rpc/dispatcher'
|
||||
import { ALL_RPC_METHODS } from '../runtime/rpc/methods'
|
||||
import type {
|
||||
RemoteOrcaCliPostOutput,
|
||||
RemoteOrcaCliRequest
|
||||
@@ -39,7 +40,7 @@ export async function acknowledgeRemoteOrcaCliPostOutput(
|
||||
answerMessageId: args.postOutput.answerMessageId
|
||||
})
|
||||
}
|
||||
const response = await new RpcDispatcher({ runtime }).dispatch({
|
||||
const response = await new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS }).dispatch({
|
||||
id: `remote-cli-post-output-${randomUUID()}`,
|
||||
authToken: 'remote-cli',
|
||||
method: 'orchestration.check',
|
||||
|
||||
Reference in New Issue
Block a user