@vectrion/types
v0.1.1
Published
Core type definitions and interfaces for the Vectrion AI runtime SDK
Maintainers
Readme
@vectrion/types
Core TypeScript type definitions and interfaces for the Vectrion AI runtime SDK. This package defines the contracts that all other packages implement.
📖 Part of the Vectrion SDK. View the live documentation and architectural specifications at vectrion.vercel.app.
Installation
npm install @vectrion/typesKey Interfaces
ProviderAdapter
The interface all provider adapters must implement:
interface ProviderAdapter {
readonly providerId: string;
readonly capabilities: Record<string, ProviderCapabilities>;
initialize(): Promise<void>;
execute(
ctx: RequestContext,
options?: ExecuteOptions,
): Promise<NormalizedResponse>;
}Middleware
type Middleware = (
ctx: RequestContext,
next: () => Promise<void>,
) => Promise<void>;RouterEngine
interface RouterEngine {
routeAndExecute(
ctx: RequestContext,
providers: Map<string, ProviderAdapter>,
options?: { signal?: AbortSignal },
): Promise<NormalizedResponse>;
}NormalizedResponse
The unified response shape returned by all providers.
RequestContext
The mutable context object passed through the middleware pipeline.
