@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
44 lines (43 loc) • 1.82 kB
TypeScript
/**
* CloakingPipeline — runs an ordered chain of CloakingPlugin instances
* against each proxied request (and optionally its response).
*
* Usage:
* const pipeline = new CloakingPipeline();
* pipeline.use(createHeaderScrubber());
* pipeline.use(createSessionIdentity());
* const ctx = await pipeline.processRequest(ctx);
*
* NOTE: The pipeline is currently used for unit testing and is ready for
* integration into the proxy request flow. Callers should instantiate a
* CloakingPipeline from ProxyConfigFile.cloaking, register plugins based
* on the config, and call processRequest/processResponse around the
* upstream fetch in claudeProxyRoutes.ts / oauthFetch.ts.
*/
import type { CloakingPlugin, CloakingContext } from "../../types/index.js";
export declare class CloakingPipeline {
private plugins;
/** Register a plugin. Plugins run in `order` field order during processRequest. */
use(plugin: CloakingPlugin): this;
/** Remove a plugin by name. */
remove(name: string): void;
/**
* Run every enabled plugin's `transformRequest` sorted by `order` (ascending).
*
* Mode dispatch:
* - "never": skip all plugins, return context unchanged
* - "always": always run all enabled plugins
* - "auto": only run plugins if account.type === "oauth"
*/
processRequest(ctx: CloakingContext): Promise<CloakingContext>;
/**
* Run every enabled plugin's `transformResponse` (if defined) in REVERSE order.
*
* Mode dispatch follows the same rules as processRequest.
*/
processResponse(ctx: CloakingContext): Promise<CloakingContext>;
/** Return the number of registered plugins. */
get size(): number;
/** List registered plugin names (useful for diagnostics). */
get pluginNames(): string[];
}