@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
68 lines (67 loc) • 1.55 kB
TypeScript
/**
* Service-related type definitions for NeuroLink
* Service registry, dependency injection, and service management types
*/
import type { UnknownRecord } from "./common.js";
/**
* Service definition with metadata and status
*/
export type ServiceDefinition<T = UnknownRecord> = {
name: string;
version: string;
instance: T;
metadata: ServiceMetadata;
status: ServiceStatus;
};
/**
* Service metadata for describing service capabilities
*/
export type ServiceMetadata = {
description: string;
tags: string[];
dependencies: string[];
capabilities: string[];
};
/**
* Service status enumeration
*/
export type ServiceStatus = "active" | "inactive" | "error" | "initializing";
/**
* Service health information
*/
export type ServiceHealth = {
status: ServiceStatus;
lastChecked: Date;
uptime: number;
errorCount: number;
dependencies: ServiceDependencyHealth[];
};
/**
* Service dependency health status
*/
export type ServiceDependencyHealth = {
name: string;
status: ServiceStatus;
lastChecked: Date;
responseTime?: number;
};
/**
* Service configuration options
*/
export type ServiceConfigOptions = {
singleton?: boolean;
lazy?: boolean;
timeout?: number;
retries?: number;
dependencies?: string[];
};
/**
* Service registry statistics
*/
export type ServiceRegistryStats = {
totalServices: number;
activeServices: number;
failedServices: number;
initializingServices: number;
circularDependencies: string[][];
};