UNPKG

@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

31 lines (30 loc) • 1.29 kB
/** * Redis-backed skill store. * * Reuses NeuroLink's pooled Redis client (`redis` v5 is already a core * dependency, shared with Redis conversation memory). One JSON value per * skill under `<keyPrefix><id>`; the index is derived with SCAN + MGET — * no separate index document to drift. Skills are persistent (no TTL). */ import type { SkillDefinition, SkillIndexItem, SkillRedisStorageConfig, SkillStore } from "../types/index.js"; export declare class RedisSkillStore implements SkillStore { private readonly keyPrefix; /** * Resources live under `<keyPrefix>__resources__:` — a reserved segment * inside the skill prefix, explicitly excluded from the index SCAN so * resource values are never mistaken for skills, whatever the * configured keyPrefix looks like. */ private readonly resourcePrefix; private readonly normalizedConfig; private clientPromise; constructor(config: SkillRedisStorageConfig); private getClient; private skillKey; getResource(id: string, resourcePath: string): Promise<string | null>; get(id: string): Promise<SkillDefinition | null>; put(skill: SkillDefinition): Promise<void>; delete(id: string): Promise<void>; index(): Promise<SkillIndexItem[]>; private parseSkill; }