// @generated by protoc-gen-es-starpc none with parameter "target=ts,ts_nocheck=false" // @generated from file github.com/s4wave/spacewave/bldr/plugin/plugin.proto (package bldr.plugin, syntax proto3) /* eslint-disable */ import { ActivatePluginRequest, ActivatePluginResponse, CheckActivationRequest, CheckActivationResponse, GetPluginInfoRequest, GetPluginInfoResponse, LoadPluginRequest, LoadPluginResponse, PrepareUpdateRequest, PrepareUpdateResponse, WatchPluginStatusRequest, WatchPluginStatusResponse, } from './plugin.pb.js' import { MethodKind } from '@aptre/protobuf-es-lite' import { ExecControllerRequest, ExecControllerResponse, } from '@go/github.com/aperturerobotics/controllerbus/controller/exec/exec.pb.js' import { RpcStreamPacket } from '@go/github.com/aperturerobotics/starpc/rpcstream/rpcstream.pb.js' import { buildDecodeMessageTransform, buildEncodeMessageTransform, MessageStream, ProtoRpc, ServerContext, } from 'starpc' /** * PluginHost is the service exposed by the plugin host. * * Available at service ID plugin-host. * * @generated from service bldr.plugin.PluginHost */ export const PluginHostDefinition = { typeName: 'bldr.plugin.PluginHost', methods: { /** * GetPluginInfo returns the information for the current plugin. * * @generated from rpc bldr.plugin.PluginHost.GetPluginInfo */ GetPluginInfo: { name: 'GetPluginInfo', I: GetPluginInfoRequest, O: GetPluginInfoResponse, kind: MethodKind.Unary, }, /** * ExecController executes a controller configuration on the bus. * * @generated from rpc bldr.plugin.PluginHost.ExecController */ ExecController: { name: 'ExecController', I: ExecControllerRequest, O: ExecControllerResponse, kind: MethodKind.ServerStreaming, }, /** * LoadPlugin requests to load the plugin with the given ID. * The plugin will remain loaded as long as the RPC is active. * Multiple requests to load the same plugin are de-duplicated. * * @generated from rpc bldr.plugin.PluginHost.LoadPlugin */ LoadPlugin: { name: 'LoadPlugin', I: LoadPluginRequest, O: LoadPluginResponse, kind: MethodKind.ServerStreaming, }, /** * PluginRpc forwards an RPC call to a remote plugin. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin id, or plugin id / instance key for instanced plugins. * * @generated from rpc bldr.plugin.PluginHost.PluginRpc */ PluginRpc: { name: 'PluginRpc', I: RpcStreamPacket, O: RpcStreamPacket, kind: MethodKind.BiDiStreaming, }, /** * PluginFsRpc accesses a FSCursorService to access plugin assets or dist filesystems. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin-assets or plugin-dist for current plugin * Component ID: plugin-assets/{plugin-id} or plugin-dist/{plugin-id} for remote plugin * * @generated from rpc bldr.plugin.PluginHost.PluginFsRpc */ PluginFsRpc: { name: 'PluginFsRpc', I: RpcStreamPacket, O: RpcStreamPacket, kind: MethodKind.BiDiStreaming, }, /** * WatchPluginStatus streams the host scheduler's plugin status. * Sends the current snapshot, then each change. * * @generated from rpc bldr.plugin.PluginHost.WatchPluginStatus */ WatchPluginStatus: { name: 'WatchPluginStatus', I: WatchPluginStatusRequest, O: WatchPluginStatusResponse, kind: MethodKind.ServerStreaming, }, }, } as const /** * PluginHost is the service exposed by the plugin host. * * Available at service ID plugin-host. * * @generated from service bldr.plugin.PluginHost */ export interface PluginHost { /** * GetPluginInfo returns the information for the current plugin. * * @generated from rpc bldr.plugin.PluginHost.GetPluginInfo */ GetPluginInfo( request: GetPluginInfoRequest, abortSignal?: AbortSignal, ): Promise /** * ExecController executes a controller configuration on the bus. * * @generated from rpc bldr.plugin.PluginHost.ExecController */ ExecController( request: ExecControllerRequest, abortSignal?: AbortSignal, ): MessageStream /** * LoadPlugin requests to load the plugin with the given ID. * The plugin will remain loaded as long as the RPC is active. * Multiple requests to load the same plugin are de-duplicated. * * @generated from rpc bldr.plugin.PluginHost.LoadPlugin */ LoadPlugin( request: LoadPluginRequest, abortSignal?: AbortSignal, ): MessageStream /** * PluginRpc forwards an RPC call to a remote plugin. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin id, or plugin id / instance key for instanced plugins. * * @generated from rpc bldr.plugin.PluginHost.PluginRpc */ PluginRpc( request: MessageStream, abortSignal?: AbortSignal, ): MessageStream /** * PluginFsRpc accesses a FSCursorService to access plugin assets or dist filesystems. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin-assets or plugin-dist for current plugin * Component ID: plugin-assets/{plugin-id} or plugin-dist/{plugin-id} for remote plugin * * @generated from rpc bldr.plugin.PluginHost.PluginFsRpc */ PluginFsRpc( request: MessageStream, abortSignal?: AbortSignal, ): MessageStream /** * WatchPluginStatus streams the host scheduler's plugin status. * Sends the current snapshot, then each change. * * @generated from rpc bldr.plugin.PluginHost.WatchPluginStatus */ WatchPluginStatus( request: WatchPluginStatusRequest, abortSignal?: AbortSignal, ): MessageStream } /** * PluginHost is the service exposed by the plugin host. * * Available at service ID plugin-host. * * @generated from service bldr.plugin.PluginHost */ export interface PluginHostHandler { /** * GetPluginInfo returns the information for the current plugin. * * @generated from rpc bldr.plugin.PluginHost.GetPluginInfo */ GetPluginInfo( request: GetPluginInfoRequest, abortSignal: AbortSignal, context: ServerContext, ): Promise /** * ExecController executes a controller configuration on the bus. * * @generated from rpc bldr.plugin.PluginHost.ExecController */ ExecController( request: ExecControllerRequest, abortSignal: AbortSignal, context: ServerContext, ): MessageStream /** * LoadPlugin requests to load the plugin with the given ID. * The plugin will remain loaded as long as the RPC is active. * Multiple requests to load the same plugin are de-duplicated. * * @generated from rpc bldr.plugin.PluginHost.LoadPlugin */ LoadPlugin( request: LoadPluginRequest, abortSignal: AbortSignal, context: ServerContext, ): MessageStream /** * PluginRpc forwards an RPC call to a remote plugin. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin id, or plugin id / instance key for instanced plugins. * * @generated from rpc bldr.plugin.PluginHost.PluginRpc */ PluginRpc( request: MessageStream, abortSignal: AbortSignal, context: ServerContext, ): MessageStream /** * PluginFsRpc accesses a FSCursorService to access plugin assets or dist filesystems. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin-assets or plugin-dist for current plugin * Component ID: plugin-assets/{plugin-id} or plugin-dist/{plugin-id} for remote plugin * * @generated from rpc bldr.plugin.PluginHost.PluginFsRpc */ PluginFsRpc( request: MessageStream, abortSignal: AbortSignal, context: ServerContext, ): MessageStream /** * WatchPluginStatus streams the host scheduler's plugin status. * Sends the current snapshot, then each change. * * @generated from rpc bldr.plugin.PluginHost.WatchPluginStatus */ WatchPluginStatus( request: WatchPluginStatusRequest, abortSignal: AbortSignal, context: ServerContext, ): MessageStream } export const PluginHostServiceName = PluginHostDefinition.typeName export class PluginHostClient implements PluginHost { private readonly rpc: ProtoRpc private readonly service: string constructor(rpc: ProtoRpc, opts?: { service?: string }) { this.service = opts?.service || PluginHostServiceName this.rpc = rpc this.GetPluginInfo = this.GetPluginInfo.bind(this) this.ExecController = this.ExecController.bind(this) this.LoadPlugin = this.LoadPlugin.bind(this) this.PluginRpc = this.PluginRpc.bind(this) this.PluginFsRpc = this.PluginFsRpc.bind(this) this.WatchPluginStatus = this.WatchPluginStatus.bind(this) } /** * GetPluginInfo returns the information for the current plugin. * * @generated from rpc bldr.plugin.PluginHost.GetPluginInfo */ async GetPluginInfo( request: GetPluginInfoRequest, abortSignal?: AbortSignal, ): Promise { const requestMsg = GetPluginInfoRequest.create(request) const result = await this.rpc.request( this.service, PluginHostDefinition.methods.GetPluginInfo.name, GetPluginInfoRequest.toBinary(requestMsg), abortSignal || undefined, ) return GetPluginInfoResponse.fromBinary(result) } /** * ExecController executes a controller configuration on the bus. * * @generated from rpc bldr.plugin.PluginHost.ExecController */ ExecController( request: ExecControllerRequest, abortSignal?: AbortSignal, ): MessageStream { const requestMsg = ExecControllerRequest.create(request) const result = this.rpc.serverStreamingRequest( this.service, PluginHostDefinition.methods.ExecController.name, ExecControllerRequest.toBinary(requestMsg), abortSignal || undefined, ) return buildDecodeMessageTransform(ExecControllerResponse)(result) } /** * LoadPlugin requests to load the plugin with the given ID. * The plugin will remain loaded as long as the RPC is active. * Multiple requests to load the same plugin are de-duplicated. * * @generated from rpc bldr.plugin.PluginHost.LoadPlugin */ LoadPlugin( request: LoadPluginRequest, abortSignal?: AbortSignal, ): MessageStream { const requestMsg = LoadPluginRequest.create(request) const result = this.rpc.serverStreamingRequest( this.service, PluginHostDefinition.methods.LoadPlugin.name, LoadPluginRequest.toBinary(requestMsg), abortSignal || undefined, ) return buildDecodeMessageTransform(LoadPluginResponse)(result) } /** * PluginRpc forwards an RPC call to a remote plugin. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin id, or plugin id / instance key for instanced plugins. * * @generated from rpc bldr.plugin.PluginHost.PluginRpc */ PluginRpc( request: MessageStream, abortSignal?: AbortSignal, ): MessageStream { const result = this.rpc.bidirectionalStreamingRequest( this.service, PluginHostDefinition.methods.PluginRpc.name, buildEncodeMessageTransform(RpcStreamPacket)(request), abortSignal || undefined, ) return buildDecodeMessageTransform(RpcStreamPacket)(result) } /** * PluginFsRpc accesses a FSCursorService to access plugin assets or dist filesystems. * The plugin will remain loaded as long as the RPC is active. * Component ID: plugin-assets or plugin-dist for current plugin * Component ID: plugin-assets/{plugin-id} or plugin-dist/{plugin-id} for remote plugin * * @generated from rpc bldr.plugin.PluginHost.PluginFsRpc */ PluginFsRpc( request: MessageStream, abortSignal?: AbortSignal, ): MessageStream { const result = this.rpc.bidirectionalStreamingRequest( this.service, PluginHostDefinition.methods.PluginFsRpc.name, buildEncodeMessageTransform(RpcStreamPacket)(request), abortSignal || undefined, ) return buildDecodeMessageTransform(RpcStreamPacket)(result) } /** * WatchPluginStatus streams the host scheduler's plugin status. * Sends the current snapshot, then each change. * * @generated from rpc bldr.plugin.PluginHost.WatchPluginStatus */ WatchPluginStatus( request: WatchPluginStatusRequest, abortSignal?: AbortSignal, ): MessageStream { const requestMsg = WatchPluginStatusRequest.create(request) const result = this.rpc.serverStreamingRequest( this.service, PluginHostDefinition.methods.WatchPluginStatus.name, WatchPluginStatusRequest.toBinary(requestMsg), abortSignal || undefined, ) return buildDecodeMessageTransform(WatchPluginStatusResponse)(result) } } /** * Plugin is the service exposed by the plugin. * * @generated from service bldr.plugin.Plugin */ export const PluginDefinition = { typeName: 'bldr.plugin.Plugin', methods: { /** * PluginRpc handles an RPC call from a remote plugin. * Component ID: remote plugin id * * @generated from rpc bldr.plugin.Plugin.PluginRpc */ PluginRpc: { name: 'PluginRpc', I: RpcStreamPacket, O: RpcStreamPacket, kind: MethodKind.BiDiStreaming, }, }, } as const /** * Plugin is the service exposed by the plugin. * * @generated from service bldr.plugin.Plugin */ export interface Plugin { /** * PluginRpc handles an RPC call from a remote plugin. * Component ID: remote plugin id * * @generated from rpc bldr.plugin.Plugin.PluginRpc */ PluginRpc( request: MessageStream, abortSignal?: AbortSignal, ): MessageStream } /** * Plugin is the service exposed by the plugin. * * @generated from service bldr.plugin.Plugin */ export interface PluginHandler { /** * PluginRpc handles an RPC call from a remote plugin. * Component ID: remote plugin id * * @generated from rpc bldr.plugin.Plugin.PluginRpc */ PluginRpc( request: MessageStream, abortSignal: AbortSignal, context: ServerContext, ): MessageStream } export const PluginServiceName = PluginDefinition.typeName export class PluginClient implements Plugin { private readonly rpc: ProtoRpc private readonly service: string constructor(rpc: ProtoRpc, opts?: { service?: string }) { this.service = opts?.service || PluginServiceName this.rpc = rpc this.PluginRpc = this.PluginRpc.bind(this) } /** * PluginRpc handles an RPC call from a remote plugin. * Component ID: remote plugin id * * @generated from rpc bldr.plugin.Plugin.PluginRpc */ PluginRpc( request: MessageStream, abortSignal?: AbortSignal, ): MessageStream { const result = this.rpc.bidirectionalStreamingRequest( this.service, PluginDefinition.methods.PluginRpc.name, buildEncodeMessageTransform(RpcStreamPacket)(request), abortSignal || undefined, ) return buildDecodeMessageTransform(RpcStreamPacket)(result) } } /** * UpdateGuard is implemented by plugins whose owned work must quiesce before * replacement. Hosts call it only for explicitly configured guarded plugins. * * @generated from service bldr.plugin.UpdateGuard */ export const UpdateGuardDefinition = { typeName: 'bldr.plugin.UpdateGuard', methods: { /** * Prepare waits for owned work to finish and prevents new work from starting. * Success authorizes replacement of this plugin generation. * * @generated from rpc bldr.plugin.UpdateGuard.Prepare */ Prepare: { name: 'Prepare', I: PrepareUpdateRequest, O: PrepareUpdateResponse, kind: MethodKind.Unary, }, }, } as const /** * UpdateGuard is implemented by plugins whose owned work must quiesce before * replacement. Hosts call it only for explicitly configured guarded plugins. * * @generated from service bldr.plugin.UpdateGuard */ export interface UpdateGuard { /** * Prepare waits for owned work to finish and prevents new work from starting. * Success authorizes replacement of this plugin generation. * * @generated from rpc bldr.plugin.UpdateGuard.Prepare */ Prepare( request: PrepareUpdateRequest, abortSignal?: AbortSignal, ): Promise } /** * UpdateGuard is implemented by plugins whose owned work must quiesce before * replacement. Hosts call it only for explicitly configured guarded plugins. * * @generated from service bldr.plugin.UpdateGuard */ export interface UpdateGuardHandler { /** * Prepare waits for owned work to finish and prevents new work from starting. * Success authorizes replacement of this plugin generation. * * @generated from rpc bldr.plugin.UpdateGuard.Prepare */ Prepare( request: PrepareUpdateRequest, abortSignal: AbortSignal, context: ServerContext, ): Promise } export const UpdateGuardServiceName = UpdateGuardDefinition.typeName export class UpdateGuardClient implements UpdateGuard { private readonly rpc: ProtoRpc private readonly service: string constructor(rpc: ProtoRpc, opts?: { service?: string }) { this.service = opts?.service || UpdateGuardServiceName this.rpc = rpc this.Prepare = this.Prepare.bind(this) } /** * Prepare waits for owned work to finish and prevents new work from starting. * Success authorizes replacement of this plugin generation. * * @generated from rpc bldr.plugin.UpdateGuard.Prepare */ async Prepare( request: PrepareUpdateRequest, abortSignal?: AbortSignal, ): Promise { const requestMsg = PrepareUpdateRequest.create(request) const result = await this.rpc.request( this.service, UpdateGuardDefinition.methods.Prepare.name, PrepareUpdateRequest.toBinary(requestMsg), abortSignal || undefined, ) return PrepareUpdateResponse.fromBinary(result) } } /** * Activation is implemented by plugins that stage their complete registration * set before the scheduler replaces an already running generation. * * @generated from service bldr.plugin.Activation */ export const ActivationDefinition = { typeName: 'bldr.plugin.Activation', methods: { /** * Check confirms support for private startup and atomic registration admission. * * @generated from rpc bldr.plugin.Activation.Check */ Check: { name: 'Check', I: CheckActivationRequest, O: CheckActivationResponse, kind: MethodKind.Unary, }, /** * Activate admits this worker's prepared registrations after startup succeeds. * * @generated from rpc bldr.plugin.Activation.Activate */ Activate: { name: 'Activate', I: ActivatePluginRequest, O: ActivatePluginResponse, kind: MethodKind.Unary, }, }, } as const /** * Activation is implemented by plugins that stage their complete registration * set before the scheduler replaces an already running generation. * * @generated from service bldr.plugin.Activation */ export interface Activation { /** * Check confirms support for private startup and atomic registration admission. * * @generated from rpc bldr.plugin.Activation.Check */ Check( request: CheckActivationRequest, abortSignal?: AbortSignal, ): Promise /** * Activate admits this worker's prepared registrations after startup succeeds. * * @generated from rpc bldr.plugin.Activation.Activate */ Activate( request: ActivatePluginRequest, abortSignal?: AbortSignal, ): Promise } /** * Activation is implemented by plugins that stage their complete registration * set before the scheduler replaces an already running generation. * * @generated from service bldr.plugin.Activation */ export interface ActivationHandler { /** * Check confirms support for private startup and atomic registration admission. * * @generated from rpc bldr.plugin.Activation.Check */ Check( request: CheckActivationRequest, abortSignal: AbortSignal, context: ServerContext, ): Promise /** * Activate admits this worker's prepared registrations after startup succeeds. * * @generated from rpc bldr.plugin.Activation.Activate */ Activate( request: ActivatePluginRequest, abortSignal: AbortSignal, context: ServerContext, ): Promise } export const ActivationServiceName = ActivationDefinition.typeName export class ActivationClient implements Activation { private readonly rpc: ProtoRpc private readonly service: string constructor(rpc: ProtoRpc, opts?: { service?: string }) { this.service = opts?.service || ActivationServiceName this.rpc = rpc this.Check = this.Check.bind(this) this.Activate = this.Activate.bind(this) } /** * Check confirms support for private startup and atomic registration admission. * * @generated from rpc bldr.plugin.Activation.Check */ async Check( request: CheckActivationRequest, abortSignal?: AbortSignal, ): Promise { const requestMsg = CheckActivationRequest.create(request) const result = await this.rpc.request( this.service, ActivationDefinition.methods.Check.name, CheckActivationRequest.toBinary(requestMsg), abortSignal || undefined, ) return CheckActivationResponse.fromBinary(result) } /** * Activate admits this worker's prepared registrations after startup succeeds. * * @generated from rpc bldr.plugin.Activation.Activate */ async Activate( request: ActivatePluginRequest, abortSignal?: AbortSignal, ): Promise { const requestMsg = ActivatePluginRequest.create(request) const result = await this.rpc.request( this.service, ActivationDefinition.methods.Activate.name, ActivatePluginRequest.toBinary(requestMsg), abortSignal || undefined, ) return ActivatePluginResponse.fromBinary(result) } }