@juspay/neurolink 13.10.0 → 13.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -5
- package/dist/adapters/providerImageAdapter.js +1 -0
- package/dist/browser/neurolink.min.js +104 -104
- package/dist/core/redisConversationMemoryManager.d.ts +13 -0
- package/dist/core/redisConversationMemoryManager.js +99 -81
- package/dist/neurolink.d.ts +52 -0
- package/dist/neurolink.js +702 -672
- package/dist/voice/CLAUDE.md +3 -1
- package/docs-site/static/search-index.json +6 -6
- package/package.json +1 -1
package/dist/voice/CLAUDE.md
CHANGED
|
@@ -24,7 +24,9 @@ first configured descriptor — `whisper`, `deepgram`, `elevenlabs-stt`,
|
|
|
24
24
|
Reordering the list changes which engine every implicit transcription uses.
|
|
25
25
|
Note that `OPENAI_API_KEY` configures `whisper` and the Google AI Studio keys
|
|
26
26
|
configure `google-stt`, so an ambient text-provider key silently becomes the
|
|
27
|
-
STT default; a test asserting the Whistle default must
|
|
27
|
+
STT default; a test asserting the implicit Whistle default must clear every hosted-provider
|
|
28
|
+
credential (each descriptor's env vars and any credentials slice passed in) and
|
|
29
|
+
leave `NEUROLINK_STT_PROVIDER` unset.
|
|
28
30
|
|
|
29
31
|
**Whistle is the zero-config default, and it ships with the package.**
|
|
30
32
|
`voice/providers/WhistleSTT.ts` runs a 17 MB model in WebAssembly on this
|
|
@@ -2407,7 +2407,7 @@
|
|
|
2407
2407
|
{"objectID":"6653ad7d7db43c9524583b9dadbf6368e9f153396ef5489c318c688f0fe95d24","title":"9. Streaming response shows as raw bytes","url":"/docs/features/claude-proxy-troubleshooting#9-streaming-response-shows-as-raw-bytes","content":"Cause: An earlier version of the Hono handler re-encoded the ReadableStream as a byte array instead of passing it through as a raw SSE stream.\n\nFix: This is fixed in the current version. The proxy returns a raw Response object for streaming requests, preserving the SSE format. If you encounter this, rebuild:","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"9. Streaming response shows as raw bytes","lvl3":""}},
|
|
2408
2408
|
{"objectID":"c11829787189c82bd28cebb8f491b004b2778739e15705556ffaa098ed95dd7a","title":"10. Tools not working / \"0 chunks\"","url":"/docs/features/claude-proxy-troubleshooting#10-tools-not-working-0-chunks","content":"Cause: An earlier architecture had NeuroLink merging 68+ MCP tools with the client's tools, causing tool name conflicts and prefixing issues. Tool definitions were being modified or dropped in the merge.\n\nFix: This is fixed in the current version. The proxy uses passthrough mode for Claude-to-Claude requests: the raw request body is forwarded directly to Anthropic without any parsing, tool merging, or reconstruction. Tool definitions pass through exactly as Claude Code sent them.\n\nIf you are seeing tool issues:\nVerify the proxy is in passthrough mode (check logs for [proxy] POST /v1/messages -- passthrough requests do not show \"translation\" in the log).\nEnsure you are targeting a Claude model (passthrough is only for claude-* models).\nCheck that NEUROLINK_SKIP_MCP=true is set (prevents MCP tool injection).","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"10. Tools not working / \"0 chunks\"","lvl3":""}},
|
|
2409
2409
|
{"objectID":"f5e4bc93c3248b16f666fc22de0855f134d5dde56d25280c5a7c2ae9abddc8ee","title":"11. Account not rotating on 429","url":"/docs/features/claude-proxy-troubleshooting#11-account-not-rotating-on-429","content":"Cause: The proxy uses fill-first routing by design. It keeps sending requests to one account until that account is rate-limited, then switches to the next.\n\nThis is expected behavior. Fill-first is optimal for Anthropic because:\nAnthropic's prompt caching is tied to the account/session. Spreading requests across accounts reduces cache hit rates.\nFill-first maximizes the benefit of each account's rate-limit window before moving on.\n\nOn a 429, the proxy applies exponential backoff to the current account (1s, 2s, 4s, 8s, ... up to 10 minutes) and immediately tries the next non-cooling account.\n\nTo verify rotation is working:","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"11. Account not rotating on 429","lvl3":""}},
|
|
2410
|
-
{"objectID":"bf5a33e57595f9a2e92da78a456ee2cdb2da25664669413c618d314b1e3fa159","title":"12. \"400 invalid_image_reference\" or \"invalid_image_data\" when sending an image","url":"/docs/features/claude-proxy-troubleshooting#12-400-invalid_image_reference-or-invalid_image_data-when-sending-an-image","content":"Cause: A request to a translated route (/v1/chat/completions, Gemini generateContent, or /v1/messages routed to a non-Anthropic provider) was refused locally, before any provider was contacted, for one of two reasons.\ninvalid_image_reference: the image was named as a local file path, an http:// URL, an empty URL or another scheme, or (Gemini) raw base64 in inlineData.data was sent without an image/<subtype> mimeType, or with a length or = padding that is not valid base64. The proxy resolves image references before the SDK sees them. It accepts data: URIs and public https:// URLs, plus a Claude base64 source and Gemini raw base64 with an image/<subtype> mimeType, both of which it converts to a data: URI first. The answer is identical whether or not the file exists, and it never echoes the path.\ninvalid_image_data: the reference was acceptable, but the bytes behind it are not a recognised image. The proxy decodes every data: image (and every download) and reads its file signature; it does not trust the declared type. Text, a path, a page of HTML, a PDF, SVG, a
|
|
2410
|
+
{"objectID":"bf5a33e57595f9a2e92da78a456ee2cdb2da25664669413c618d314b1e3fa159","title":"12. \"400 invalid_image_reference\" or \"invalid_image_data\" when sending an image","url":"/docs/features/claude-proxy-troubleshooting#12-400-invalid_image_reference-or-invalid_image_data-when-sending-an-image","content":"Cause: A request to a translated route (/v1/chat/completions, Gemini generateContent, or /v1/messages routed to a non-Anthropic provider) was refused locally, before any provider was contacted, for one of two reasons.\ninvalid_image_reference: the image was named as a local file path, an http:// URL, an empty URL or another scheme, or (Gemini) raw base64 in inlineData.data was sent without an image/<subtype> mimeType, or with a length or = padding that is not valid base64. The proxy resolves image references before the SDK sees them. It accepts data: URIs and public https:// URLs, plus a Claude base64 source and Gemini raw base64 with an image/<subtype> mimeType, both of which it converts to a data: URI first. The answer is identical whether or not the file exists, and it never echoes the path.\ninvalid_image_data: the reference was acceptable, but the bytes behind it are not a recognised image. The proxy decodes every data: image (and every download) and reads its file signature; it does not trust the declared type. Text, a path, a page of HTML, a PDF, SVG, a payload too short to hold a complete recognised signature, an empty one (a data: URI with nothing after the comma, a Claude base64 source or a Gemini inlineData of an image type whose data is empty or absent), and a data: URI that is not ;base64 all land here. Only the leading signature is checked, so an image cut off after a complete signature is not refused here. An empty slot is refused, never dropped: the request is not sent on without the picture. A Gemini inlineData.data that is a path made only of base64 characters (/var/tmp/photo) is the usual surprise: it is taken for base64, decodes to text, and is refused as data instead of being forwarded for the provider to fail on.\n\nFix: Send the image inline as a data: URI (a Claude base64 source is converted for you), or host it at a public https:// URL that answers without a redirect.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"12. \"400 invalid_image_reference\" or \"invalid_image_data\" when sending an image","lvl3":""}},
|
|
2411
2411
|
{"objectID":"f3a39e51eb140c1d4a2d4a3ca65428fa316193a4e5e8fa94ff94167e1c46fff2","title":"Enable debug logging","url":"/docs/features/claude-proxy-troubleshooting#enable-debug-logging","content":"This outputs detailed information for every request:","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"Enable debug logging","lvl3":""}},
|
|
2412
2412
|
{"objectID":"787ea2a89999f69958b0dd99b8ae0410812df77cd2198c4e2b3d056c2147cdcd","title":"Check request logs","url":"/docs/features/claude-proxy-troubleshooting#check-request-logs","content":"The proxy writes structured JSONL logs to ~/.neurolink/logs/:\n\nEach log entry includes: timestamp, request ID, method, path, model, account label, response status, response time (ms), token usage, and OTel correlation fields (traceId, spanId).","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"Check request logs","lvl3":""}},
|
|
2413
2413
|
{"objectID":"1df2cf3c6943377703033901df111cb673599219d7af3451c0e1b03cc7258d60","title":"Correlate logs with traces","url":"/docs/features/claude-proxy-troubleshooting#correlate-logs-with-traces","content":"When OTEL_EXPORTER_OTLP_ENDPOINT is set, every request log entry includes traceId and spanId fields. Use these to find the corresponding trace in your observability backend (Jaeger, Grafana Tempo, OpenObserve):","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy Troubleshooting","lvl2":"Correlate logs with traces","lvl3":""}},
|
|
@@ -2475,7 +2475,7 @@
|
|
|
2475
2475
|
{"objectID":"7a743b6bb13366c925cd238d4853826a08f0b161659bcb0575d5b2e83709a2e5","title":"429 Rate Limit","url":"/docs/features/claude-proxy#429-rate-limit","content":"Treat top-level anthropic-ratelimit-unified-status: rejected as authoritative, even if sub-windows still say allowed.\nPrefer the rejected 5-hour or 7-day reset and otherwise use Retry-After.\nPersist the cooldown and rotate immediately for authoritative exhaustion.\nReturn the earliest recovery timestamp without another upstream request when all accounts are cooling.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"429 Rate Limit","lvl3":""}},
|
|
2476
2476
|
{"objectID":"1522c22c8467bae6a5a51e9e4c4dca5792a7b45c457b0628ef5536d068d642b3","title":"401/402/403 Authentication Errors","url":"/docs/features/claude-proxy#401402403-authentication-errors","content":"OAuth accounts with refresh token: Serialize refresh, persist the new rotating token, and retry. A rejected refresh credential disables the account until re-authentication; transient refresh infrastructure errors cool and rotate.\nOAuth accounts without refresh token: Disable until re-authentication and rotate.\nAPI key accounts: Rotate after authentication failure.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"401/402/403 Authentication Errors","lvl3":""}},
|
|
2477
2477
|
{"objectID":"b8f1c40c30e2fe7c3e03ca8b9857986dbce8dc17c382f69e1575e3c9b8e22c11","title":"400/422 Request Shape Error","url":"/docs/features/claude-proxy#400422-request-shape-error","content":"Detected via HTTP 422 status or invalid_request_error error type in the response body.\nNo retry or failover. These are client-side errors (malformed request, invalid parameters).\nReturn the error body directly to Claude Code.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"400/422 Request Shape Error","lvl3":""}},
|
|
2478
|
-
{"objectID":"afa3c85f9ffa8a82a4379702baa0f7270668e8c8cd1792431947aadd4e3ed0d1","title":"400 Refused Image Reference","url":"/docs/features/claude-proxy#400-refused-image-reference","content":"A translated request (OpenAI, Gemini, or Claude routed to another provider) named an image the proxy will not resolve: a local path, an http:// URL, another scheme, an https:// URL that could not be fetched safely, an empty URL, or (Gemini) raw base64 whose mimeType is not an image/<subtype> type; or it carried image bytes that are not a recognised image: text, a path, a page, SVG, an empty (or absent) or
|
|
2478
|
+
{"objectID":"afa3c85f9ffa8a82a4379702baa0f7270668e8c8cd1792431947aadd4e3ed0d1","title":"400 Refused Image Reference","url":"/docs/features/claude-proxy#400-refused-image-reference","content":"A translated request (OpenAI, Gemini, or Claude routed to another provider) named an image the proxy will not resolve: a local path, an http:// URL, another scheme, an https:// URL that could not be fetched safely, an empty URL, or (Gemini) raw base64 whose mimeType is not an image/<subtype> type; or it carried image bytes that are not a recognised image: text, a path, a page, SVG, an empty (or absent) payload, or one too short to hold a complete recognised signature.\nAnswered locally before any provider is contacted, with code invalid_image_reference, invalid_image_data, image_url_unfetchable or image_input_too_large. No retry and no fallback.\nSee Image references on translated requests.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"400 Refused Image Reference","lvl3":""}},
|
|
2479
2479
|
{"objectID":"e1f4a02d90c3d80f462b4ab9d516b9be9e53d7f954539837078c9e19088d01fb","title":"404 Not Found","url":"/docs/features/claude-proxy#404-not-found","content":"Typically means the model is not available for this account.\nNo cooldown applied.\nReturn the error body immediately to the client (no failover to next account).","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"404 Not Found","lvl3":""}},
|
|
2480
2480
|
{"objectID":"8ea0d60b8e33eeebfb825eb12ad9fcd0cdad610ee262ac5486db5d7fa3b8406b","title":"5xx / Transient Server Error","url":"/docs/features/claude-proxy#5xx-transient-server-error","content":"Transient errors (408, 500, 502, 503, 504, and Cloudflare 520-526/529).\nAlso matches 400 responses with api_error or overloaded_error types that wrap transient HTML content (e.g., Cloudflare error pages).\nApply bounded same-account retries, then rotate to the next account.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"5xx / Transient Server Error","lvl3":""}},
|
|
2481
2481
|
{"objectID":"195dae3c0ea28fdcfeb0fbf39c456fd580652b07fa5f2ce81b341d4279621cf8","title":"All Accounts Exhausted","url":"/docs/features/claude-proxy#all-accounts-exhausted","content":"When every account is in a cooling state:\nWalk the fallback chain (if configured).\nEach fallback uses NeuroLink's stream() pipeline with the specified provider/model.\nIf all fallbacks also fail, return a 429 with Retry-After set to the earliest account recovery time.","hierarchy":{"lvl0":"Features","lvl1":"Claude Proxy","lvl2":"All Accounts Exhausted","lvl3":""}},
|
|
@@ -8021,12 +8021,12 @@
|
|
|
8021
8021
|
{"objectID":"43776c9da774387f221eb7918931d5a4a59b42c949ef248c30c7afb5512ee7ea","title":"Dev Playground Support","url":"/docs/guides/server-adapters/middleware#dev-playground-support","content":"Requests with an X-NeuroLink-Dev-Playground: true (or X-NeuroLink-Playground: true) header bypass authentication and receive a default developer user context (id: \"playground\", roles: [\"developer\"]), but only when NODE_ENV is exactly development. The variable is read on every request.\n\nWith NODE_ENV unset, production, test, staging or any other value, the header is ignored and the request must carry a valid credential. The bypass is therefore off by default in a deployment that never sets NODE_ENV. Pass skipDevPlayground: false to refuse the header even in development.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Dev Playground Support","lvl3":""}},
|
|
8022
8022
|
{"objectID":"a2d39b213dc8603fb3d7889b019eebc14f3705eb13b1185d7f98bf26d988f4aa","title":"When to Use","url":"/docs/guides/server-adapters/middleware#when-to-use-10","content":"Protecting API endpoints\nUser identification and authorization\nRate limiting by user\nAudit logging","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"When to Use","lvl3":""}},
|
|
8023
8023
|
{"objectID":"961a2c37220a3779b5bb23e6a2a8d360f928344af801a021f6d714754e2a9e5e","title":"Session Middleware","url":"/docs/guides/server-adapters/middleware#session-middleware","content":"Sets ctx.session from a header (or an opt-in cookie) and scopes it to the authenticated user. Register it after authentication, on a server that carries middleware state.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Session Middleware","lvl3":""}},
|
|
8024
|
-
{"objectID":"d2deb08c40f7fc9a32db9d4b2fd251656728c465d71632f4ee15e761652ce04c","title":"The server must carry middleware state","url":"/docs/guides/server-adapters/middleware#the-server-must-carry-middleware-state","content":"The middleware sets ctx.session on the context of its own step, and it prefixes the id with the user that authentication put on the context of an earlier step. Both only work if the server carries middleware state, which is off by default (carryMiddlewareState, see Carrying middleware state). With it off, Express, Fastify and Koa build a fresh context for every middleware step and for the handler, so the session middleware sees no ctx.user and the ctx.session it sets is gone before the handler runs; Hono shares one context only for a request whose client sent its own X-Request-ID. Apart from that Hono case, a server without the carry therefore gets no sessions from this middleware, and nothing warns about it.\n\nThere are two ways to turn the carry on:\nregisterAllRoutes(server, \"/api\", { perUserAuth: true }) turns it on for the server, which is what the usage example below relies on.\ncreateServer(neurolink, { framework, config: { carryMiddlewareState: true } }) turns it on directly. Use it when your own routes read ctx.session, or when you register the routes yourself instead of with registerAllRoutes.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"The server must carry middleware state","lvl3":""}},
|
|
8025
|
-
{"objectID":"0509f1acb589a9fd8e4fbce928f8b5e04d7ab2b0ba93f2f40eef1e03a230ecde","title":"How it relates to perUserAuth","url":"/docs/guides/server-adapters/middleware#how-it-relates-to-peruserauth","content":"Whether the agent routes (/agent/execute, /agent/stream) trust the request body's sessionId depends on perUserAuth (see the security guide):\n\n| perUserAuth | Session the agent routes use |\n| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| true | Only ctx.session, and only for an authenticated request; a body sessionId is ignored. registerAllRoutes turns the carry on for this mode. This middleware is how a signed-in client keeps a conversation, and without it there is no memory
|
|
8024
|
+
{"objectID":"d2deb08c40f7fc9a32db9d4b2fd251656728c465d71632f4ee15e761652ce04c","title":"The server must carry middleware state","url":"/docs/guides/server-adapters/middleware#the-server-must-carry-middleware-state","content":"The middleware sets ctx.session on the context of its own step, and it prefixes the id with the user that authentication put on the context of an earlier step. Both only work if the server carries middleware state, which is off by default (carryMiddlewareState, see Carrying middleware state). With it off, Express, Fastify and Koa build a fresh context for every middleware step and for the handler, so the session middleware sees no ctx.user and the ctx.session it sets is gone before the handler runs; Hono shares one context only for a request whose client sent its own X-Request-ID. Apart from that Hono case, a server without the carry therefore gets no sessions from this middleware, and nothing warns about it.\n\nThere are two ways to turn the carry on:\nregisterAllRoutes(server, \"/api\", { perUserAuth: true }) turns it on for the server, which is what the usage example below relies on. It does so through the adapter's enableMiddlewareStateCarry(), which every built-in adapter has. A custom adapter without that method must carry ctx.user and ctx.session itself, or the routes run without the authenticated session.\ncreateServer(neurolink, { framework, config: { carryMiddlewareState: true } }) turns it on directly. Use it when your own routes read ctx.session, or when you register the routes yourself instead of with registerAllRoutes.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"The server must carry middleware state","lvl3":""}},
|
|
8025
|
+
{"objectID":"0509f1acb589a9fd8e4fbce928f8b5e04d7ab2b0ba93f2f40eef1e03a230ecde","title":"How it relates to perUserAuth","url":"/docs/guides/server-adapters/middleware#how-it-relates-to-peruserauth","content":"Whether the agent routes (/agent/execute, /agent/stream) trust the request body's sessionId depends on perUserAuth (see the security guide):\n\n| perUserAuth | Session the agent routes use |\n| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| true | Only ctx.session, and only for an authenticated request; a body sessionId is ignored. registerAllRoutes turns the carry on for this mode on a built-in adapter. This middleware is how a signed-in client keeps a conversation, and without it there is no memory |\n| true, anonymous | None. A request with no ctx.user (optional authentication) gets no conversation even when it sends X-Session-Id, so anonymous callers never share one |\n| false (default) | The body's sessionId.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"How it relates to perUserAuth","lvl3":""}},
|
|
8026
8026
|
{"objectID":"5030f1bc68100ad92c3ab2b6bafbbb96c9069b282976e5233f3dc1cafdf62811","title":"Configuration","url":"/docs/guides/server-adapters/middleware#configuration-9","content":"Configuration","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Configuration","lvl3":""}},
|
|
8027
|
-
{"objectID":"0e7a4984ab1818dc1207c2dffcaebfdc635a483d79f89525da8359a301c4652e","title":"Usage","url":"/docs/guides/server-adapters/middleware#usage-11","content":"A client sends X-Session-Id: chat-1; the agent routes then keep that conversation, separately for each signed-in user. Without conversationMemory enabled on the NeuroLink instance nothing is remembered, whatever the session id. registerAllRoutes also mounts the memory routes, and perUserAuth scopes them to the caller as well; they list, read and delete the conversations this middleware creates (see What the user prefix does and does not isolate).\n\nRegister the session middleware after authentication. The server runs middleware in registration order, and the order: 12 of this middleware is informational. Registered before authentication, it sees no user and sets the bare, unprefixed id; nothing warns about it. The same holds on a server that does not carry middleware state: there the middleware sees no user whatever the order, and the handler gets no session at all.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Usage","lvl3":""}},
|
|
8027
|
+
{"objectID":"0e7a4984ab1818dc1207c2dffcaebfdc635a483d79f89525da8359a301c4652e","title":"Usage","url":"/docs/guides/server-adapters/middleware#usage-11","content":"A client sends X-Session-Id: chat-1; the agent routes then keep that conversation, separately for each signed-in user. Without conversationMemory enabled on the NeuroLink instance nothing is remembered, whatever the session id. registerAllRoutes also mounts the memory routes, and perUserAuth scopes them to the caller as well; for a user whose id they accept (no :, and not session-only) they list, read and delete the conversations this middleware creates (see What the user prefix does and does not isolate).\n\nRegister the session middleware after authentication. The server runs middleware in registration order, and the order: 12 of this middleware is informational. Registered before authentication, it sees no user and sets the bare, unprefixed id; nothing warns about it. The same holds on a server that does not carry middleware state: there the middleware sees no user whatever the order, and the handler gets no session at all.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Usage","lvl3":""}},
|
|
8028
8028
|
{"objectID":"2eff85cff358391e531f7222a46944f23fc08f676d6ade582e8ba98d3295d415","title":"Behaviour","url":"/docs/guides/server-adapters/middleware#behaviour","content":"| Request | ctx.session.id |\n| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| Authenticated, header chat-1 | <urlencoded-userId>~chat-1, so two users who send chat-1 get different conversations |\n| Not authenticated, header chat-1 | chat-1 (the agent routes ignore it under perUserAuth: true) |\n| No header, or an empty one (and no cookie configured) | not set; no session |\n| No header or an empty one, cookieName set, cookie holds a valid id | the cookie's id, prefixed like a header's |\n| cookieName set, cookie holds an invalid id | the cookie is ignored, as if absent; no session |\n| Header that is not a valid id | 400 |\n\nA valid id is 1 to 128 characters: the first is a letter or digit, the rest are letters, digits, ., _ or -. An id that starts with ., _ or -, or contains :, is not valid.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Behaviour","lvl3":""}},
|
|
8029
|
-
{"objectID":"094629bc45431759611f6c3d97481975303ad413b0d82cf94a36fe7eee97a4af","title":"What the user prefix does and does not isolate","url":"/docs/guides/server-adapters/middleware#what-the-user-prefix-does-and-does-not-isolate","content":"The prefix keeps the conversations the agent routes hold apart: the in-memory conversation manager keys sessions by id alone, so without it one user could read and extend another's conversation by guessing its id. Requested ids contain no ~, so a crafted id cannot imitate another user's prefix. The delimiter is ~ rather than : because Redis session ids and the perUserAuth memory routes reject :.\n\nIt is not an access check on the memory routes. Without perUserAuth they look a session up by the id in the URL: on the in-memory manager by that id alone, on Redis by it together with the userId query parameter. Whether a server limits them to a session's owner then depends on how that server protects those routes, not on this middleware, so a caller who can reach them and knows a prefixed id such as bob~chat-1 reads that session unless the server prevents it. With perUserAuth the memory routes are scoped to the caller (see the security guide), and they refuse a session id that contains :. The ~ form this middleware writes is accepted, so a session it created can be listed, read and deleted through those routes. Memory routes report the prefixed id; treat it as opaque.\n\nThe prefix also depends on ctx.user naming one person. When every client shares one credential (one API key), they share one ctx.user and so one prefix, and the prefix does not tell them apart.\n\nUnder perUserAuth: true an anonymous request (optional authentication) is given no session by the agent routes at all, because with a bare id every anonymous caller that sent the same X-Session-Id would share one conversation.
|
|
8029
|
+
{"objectID":"094629bc45431759611f6c3d97481975303ad413b0d82cf94a36fe7eee97a4af","title":"What the user prefix does and does not isolate","url":"/docs/guides/server-adapters/middleware#what-the-user-prefix-does-and-does-not-isolate","content":"The prefix keeps the conversations the agent routes hold apart: the in-memory conversation manager keys sessions by id alone, so without it one user could read and extend another's conversation by guessing its id. Requested ids contain no ~, so a crafted id cannot imitate another user's prefix. The delimiter is ~ rather than : because Redis session ids and the perUserAuth memory routes reject :.\n\nIt is not an access check on the memory routes. Without perUserAuth they look a session up by the id in the URL: on the in-memory manager by that id alone, on Redis by it together with the userId query parameter. Whether a server limits them to a session's owner then depends on how that server protects those routes, not on this middleware, so a caller who can reach them and knows a prefixed id such as bob~chat-1 reads that session unless the server prevents it. With perUserAuth the memory routes are scoped to the caller (see the security guide), and they refuse a session id that contains :. The ~ form this middleware writes is accepted, so a session it created can be listed, read and deleted through those routes by a user whose id they accept. They refuse an authenticated user id that contains : and the reserved id session-only: a user such as cust:merchant:shop gets a ~ session id from this middleware, because the user part is encoded, but cannot list, read or delete it through the memory routes. Memory routes report the prefixed id; treat it as opaque.\n\nThe prefix also depends on ctx.user naming one person. When every client shares one credential (one API key), they share one ctx.user and so one prefix, and the prefix does not tell them apart.\n\nUnder perUserAuth: true an anonymous request (optional authentication) is given no session by the agent routes at all, because with a bare id every anonymous caller that sent the same X-Session-Id would share one conversation.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"What the user prefix does and does not isolate","lvl3":""}},
|
|
8030
8030
|
{"objectID":"085efce0ee14472c104cec33ac4ca0b7fe6260cb73f1c9bfc3ed907a1cec58b4","title":"Browser clients and CORS","url":"/docs/guides/server-adapters/middleware#browser-clients-and-cors","content":"A page on another origin can send the header only if the server's CORS allowed headers list it. The default list is Content-Type, Authorization, X-Request-ID and X-Session-Id, so the default header works once the page's origin is in cors.origins.\n\nA custom headerName is not in that list. Add it to cors.headers, and note that a list you pass replaces the default rather than extending it, so keep the others your clients send:\n\nA cookie read through cookieName is sent by the browser only when the page asks for credentials, which also needs cors.credentials: true and an explicit origin in cors.origins rather than *.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Browser clients and CORS","lvl3":""}},
|
|
8031
8031
|
{"objectID":"2ae4cb64298f85a7c201fa225bebeb309ffa947d8012d2ffdeddc00c823ab5ee","title":"Header and cookie","url":"/docs/guides/server-adapters/middleware#header-and-cookie","content":"The header wins when both are present. A header that is present but empty counts as absent, so the cookie can still supply the id. A header holding an invalid id is a 400, because the client chose to send it. A cookie holding an invalid id is ignored instead: a browser sends cookies on its own, so a stale or foreign cookie that happens to share the name must not turn every route into a 400. cookieName is off by default for the same reason: a cookie is sent without the client choosing to, so enabling it is the operator's decision.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Header and cookie","lvl3":""}},
|
|
8032
8032
|
{"objectID":"fb39a14f946d17f7771143d4e3c349bc51999e8aa360456371d0b8dec29a6449","title":"Request Validation Middleware","url":"/docs/guides/server-adapters/middleware#request-validation-middleware","content":"Provides schema-based request validation for body, query, params, and headers.","hierarchy":{"lvl0":"Guides","lvl1":"Middleware Reference","lvl2":"Request Validation Middleware","lvl3":""}},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "13.10.
|
|
3
|
+
"version": "13.10.1",
|
|
4
4
|
"packageManager": "pnpm@10.34.9+sha512.f49b5a8ea0fdedb44bb3c0c1d6575092a53c2950d95b7ad15df11f17974877a2de3a01c07e934e9b28ce716e51c09a94962c7306d09be2e1e4b18a8c8762fd32",
|
|
5
5
|
"description": "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/call) for routing, tool selection and context budgeting. MCP-native (4 transports), voice TTS/STT/realtime, RAG, agents, memory, compaction, 9 observability exporters. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · TypeSafe Jev and more.",
|
|
6
6
|
"author": {
|