UNPKG

@genkit-ai/core

Version:

Genkit AI framework core libraries.

81 lines (77 loc) 2.43 kB
import { a9 as Registry } from './action-2dXSE7GM.js'; import 'json-schema'; import 'zod'; import './context.js'; import './statusTypes.js'; import 'dotprompt'; import 'ajv'; /** * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ interface ReflectionServerV2Options { configuredEnvs?: string[]; name?: string; url: string; } declare class ReflectionServerV2 { private registry; private options; private ws; private url; private index; private activeActions; private reconnectCount; private isStopped; private reconnectTimeout; private baseDelayMs; private maxDelayMs; private pendingRequests; private requestIdCounter; private inputStreams; constructor(registry: Registry, options: ReflectionServerV2Options); start(): Promise<void>; private connect; /** * Closes all open per-request input streams and clears the registry. Used * when the socket closes so action bodies awaiting input can terminate * instead of leaking the channel. */ private closeInputStreams; /** * Surfaces an error into all open per-request input streams and clears the * registry. Used when the socket errors so action bodies awaiting input * reject instead of hanging. */ private failInputStreams; private scheduleReconnect; stop(): Promise<void>; private send; private sendResponse; private sendError; private sendNotification; private sendRequest; private register; get runtimeId(): string; private handleResponse; private handleRequest; private handleListActions; private handleListValues; private handleRunAction; private handleConfigure; private handleCancelAction; private handleSendInputStreamChunk; private handleEndInputStream; } export { ReflectionServerV2, type ReflectionServerV2Options };