MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / constructor

Method constructor

projects/runtime/src/server.ts:159–197  ·  view source on GitHub ↗
(options: RuntimeServerOptions)

Source from the content-addressed store, hash-verified

157 readonly supervisor: RuntimeSupervisor
158
159 constructor(options: RuntimeServerOptions) {
160 this.serverName = options.serverName
161 this.serverVersion = options.serverVersion
162 this.protocolVersion = options.protocolVersion ?? 1
163 this.notificationLogSize = Math.max(0, Math.floor(options.notificationLogSize ?? DEFAULT_NOTIFICATION_LOG_SIZE))
164 this.clientRequestRetentionMs = Math.max(0, Math.floor(options.clientRequestRetentionMs ?? DEFAULT_CLIENT_REQUEST_RETENTION_MS))
165 this.agentProviders = options.agentProviders ?? []
166 this.supervisor = new RuntimeSupervisor({ checkpointStore: options.checkpointStore, livenessProbe: options.livenessProbe })
167
168 this.register("initialize", (params, context) => this.initialize(params as RuntimeInitializeParams, context), {
169 validateParams: validateRuntimeInitializeParams,
170 })
171 this.register("server/status/read", (_params, context) => this.serverStatus(context))
172 this.register("subscription/update", (params, context) => this.updateSubscription(params as RuntimeSubscriptionUpdateParams, context), {
173 validateParams: validateRuntimeSubscriptionUpdateParams,
174 })
175 this.register("agent/provider/list", () => this.agentProviders)
176 this.register("agent/provider/status", (params) => this.agentProviderStatus(params as AgentProviderIdParams), {
177 validateParams: validateAgentProviderIdParams,
178 })
179 this.register("runtime/list", (params) => this.listRuntimes(params as RuntimeListParams), {
180 validateParams: validateRuntimeListParams,
181 })
182 this.register("runtime/read", (params) => this.readRuntime(params as RuntimeIdParams), {
183 validateParams: validateRuntimeIdParams,
184 })
185 this.register("runtime/reconcile", (params) => this.reconcileRuntime(params as RuntimeIdParams), {
186 validateParams: validateRuntimeIdParams,
187 })
188 this.register("runtime/stop", (params, context) => this.stopRuntime(params as RuntimeStopParams, context), {
189 validateParams: validateRuntimeStopParams,
190 })
191 this.registerNotification("runtime/created")
192 this.registerNotification("runtime/updated")
193 this.registerNotification("runtime/completed")
194 this.registerNotification("runtime/failed")
195 this.registerNotification("runtime/stopped")
196 this.registerNotification("connection/lagged")
197 }
198
199 register(method: string, handler: RuntimeHandler, options: RuntimeRegisterOptions = {}): void {
200 this.handlers.set(method, { handler, validateParams: options.validateParams })

Callers

nothing calls this directly

Calls 10

registerMethod · 0.95
initializeMethod · 0.95
serverStatusMethod · 0.95
updateSubscriptionMethod · 0.95
agentProviderStatusMethod · 0.95
listRuntimesMethod · 0.95
readRuntimeMethod · 0.95
reconcileRuntimeMethod · 0.95
stopRuntimeMethod · 0.95
registerNotificationMethod · 0.95

Tested by

no test coverage detected