Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

1.4 KB
Raw Blame
import type { RemoteRuntimeClientError } from '../remote-runtime-client-error'
import type { RuntimeCapability } from '../../protocol-version'
import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope'
import type { RemoteRuntimeSocketLivenessOptions } from '../remote-runtime-socket-liveness'
import type {
  RemoteRuntimeOutboundMemoryBudget,
  RemoteRuntimeOutboundQueueOptions
} from './remote-runtime-subscription-outbound'

export type RemoteRuntimeTransportSubscription = {
  requestId: string
  close: () => void
  sendBinary: (bytes: Uint8Array<ArrayBufferLike>) => boolean
  sendRequest?: (
    method: string,
    params: unknown,
    timeoutMs: number
  ) => Promise<RuntimeRpcResponse<unknown>>
}

export type RemoteRuntimeTransportSubscriptionCallbacks<TResult = unknown> = {
  onResponse: (response: RuntimeRpcResponse<TResult>) => void
  onBinary?: (bytes: Uint8Array<ArrayBufferLike>) => void
  onError: (error: RemoteRuntimeClientError) => void
  onClose?: () => void
}

export type RemoteRuntimeSubscriptionOptions = RemoteRuntimeSocketLivenessOptions & {
  signal?: AbortSignal
  clientCapabilities?: readonly RuntimeCapability[]
  perMessageDeflate?: boolean
  outboundQueue?: RemoteRuntimeOutboundQueueOptions
  outboundMemoryBudget?: RemoteRuntimeOutboundMemoryBudget
  // Override to test ordering against the subscription-start timeout without production waits.
  connectTimeoutMs?: number
}