@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
22 lines (21 loc) • 997 B
TypeScript
/**
* Relocate a non-Claude-Code client's `system` blocks into the message stream.
*
* Anthropic's subscription/OAuth path rejects any `system` content it does not
* recognise as the genuine Claude Code system prompt — anti-abuse fingerprinting
* surfaced as a header-less `rate_limit_error: "Error"` (NOT a real rate limit).
* Custom clients (Curator/Tara) send their own system prompt, so we move it into
* a leading user block and keep only the recognised billing+agent blocks in
* `system`. The model still honours the instructions, and any `cache_control` is
* carried over so the prompt prefix stays cacheable.
*
* Shared by both proxy entry points (`oauthFetch.ts` and `claudeProxyRoutes.ts`)
* so the OAuth anti-abuse workaround stays in one place and can't drift between
* the two paths.
*/
export declare function relocateClientSystemIntoMessages(parsed: {
messages?: unknown;
}, instructionBlocks: Array<{
text?: unknown;
cache_control?: unknown;
}>): void;