UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

56 lines (55 loc) 2.03 kB
/** * Artifact Store * * Pluggable storage for externalized MCP tool outputs. * * When `mcp.outputLimits.strategy = "externalize"` the full tool payload is * written here instead of being sent inline to the LLM. The model receives a * compact surrogate with a preview and an artifact ID. The full payload can be * retrieved on demand via the `retrieve_context` tool. * * Architecture: * ArtifactStore (interface) — canonical types in src/lib/types/artifactTypes.ts * LocalTempArtifactStore — single-process, filesystem-backed implementation * * Distributed backends (S3, Redis blobs) can be added later by implementing * ArtifactStore from types/artifactTypes.ts. * * @module artifacts/artifactStore */ import type { ArtifactMeta, ArtifactRef, ArtifactStore } from "../types/index.js"; /** * Filesystem-backed artifact store using the OS temp directory. * * Files are written with mode 0o600 (owner read/write only). * An in-memory index tracks metadata without a separate index file. * * Suitable for: * - CLI usage * - Single-process SDK deployments * - Multi-process deployments where each process manages its own artifacts * (artifacts created in one process are not visible to others) * * @example * ```typescript * const store = new LocalTempArtifactStore(); * const ref = await store.store(largeJson, { * toolName: "list_files", * serverId: "filesystem-server", * sizeBytes: Buffer.byteLength(largeJson), * contentType: "json", * }); * // Later, via retrieve_context: * const full = await store.retrieve(ref.id); * ``` */ export declare class LocalTempArtifactStore implements ArtifactStore { private readonly dir; private readonly index; constructor(dir?: string); generatePreview(payload: string): string; store(payload: string, meta: Omit<ArtifactMeta, "createdAt">): Promise<ArtifactRef>; retrieve(id: string): Promise<string | null>; delete(id: string): Promise<void>; cleanup(olderThanMs: number): Promise<number>; }