@juspay/neurolink 13.11.0 → 13.12.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.
@@ -569,15 +569,24 @@ export type StreamOptions = {
569
569
  * the thread fixes has changed (otherwise it starts a new thread), so the
570
570
  * request stops growing with the turn. Off by default.
571
571
  *
572
- * Native Anthropic streaming with API-key auth only; other providers and
573
- * OAuth ignore it. The server keeps a thread for minutes and may drop it, in
572
+ * Native Anthropic (`stream()` and `generate()`) with API-key auth only;
573
+ * other providers and OAuth ignore it. The server keeps a thread for minutes and may drop it, in
574
574
  * which case the step is resent in full; a change to the tools, system
575
575
  * prompt, tool choice or earlier messages starts a new thread. Threads are
576
576
  * not zero-data-retention eligible, and the API has no way to delete one
577
577
  * (it expires within an hour). It was measured to shrink the request, not to
578
578
  * lower time to first token when prompt caching is already on.
579
+ *
580
+ * `"session"` also keeps the thread for the session's next call (same user,
581
+ * session id, credential and endpoint; in memory on the NeuroLink instance,
582
+ * for up to four minutes), so that call sends only its new message. Two
583
+ * things to know. Conversation memory keeps only each turn's final text, so
584
+ * the thread still holds the tool calls and results that memory dropped: the
585
+ * model sees more than it would without a thread. And the thread outlives
586
+ * `clearConversationSession()`: NeuroLink forgets it, the server keeps it
587
+ * until it expires, up to an hour, and cannot be asked to delete it.
579
588
  */
580
- messageThreads?: boolean;
589
+ messageThreads?: boolean | "session";
581
590
  /** Max time with no progress before the turn ends as "stalled" (ms). Native Vertex loops only — see GenerateOptions.stallTimeoutMs. */
582
591
  stallTimeoutMs?: number;
583
592
  /** Remaining-time threshold that triggers the wrap-up nudge (ms). See GenerateOptions.wrapupTimeLeadMs. */
@@ -40,8 +40,8 @@ export declare const JudgeConfigSchema: z.ZodObject<{
40
40
  model: z.ZodString;
41
41
  criteria: z.ZodArray<z.ZodString>;
42
42
  outputFormat: z.ZodEnum<{
43
- scores: "scores";
44
43
  detailed: "detailed";
44
+ scores: "scores";
45
45
  ranking: "ranking";
46
46
  best: "best";
47
47
  }>;
@@ -70,9 +70,9 @@ export declare const ConditioningConfigSchema: z.ZodObject<{
70
70
  low: z.ZodNumber;
71
71
  }, z.core.$strip>>;
72
72
  toneAdjustment: z.ZodOptional<z.ZodEnum<{
73
- neutral: "neutral";
74
73
  soften: "soften";
75
74
  strengthen: "strengthen";
75
+ neutral: "neutral";
76
76
  }>>;
77
77
  includeMetadata: z.ZodOptional<z.ZodBoolean>;
78
78
  metadataFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -139,9 +139,9 @@ export declare const WorkflowConfigSchema: z.ZodObject<{
139
139
  version: z.ZodOptional<z.ZodString>;
140
140
  type: z.ZodEnum<{
141
141
  custom: "custom";
142
- chain: "chain";
143
- ensemble: "ensemble";
144
142
  adaptive: "adaptive";
143
+ ensemble: "ensemble";
144
+ chain: "chain";
145
145
  }>;
146
146
  models: z.ZodArray<z.ZodObject<{
147
147
  provider: z.ZodType<AIProviderName, unknown, z.core.$ZodTypeInternals<AIProviderName, unknown>>;
@@ -194,8 +194,8 @@ export declare const WorkflowConfigSchema: z.ZodObject<{
194
194
  model: z.ZodString;
195
195
  criteria: z.ZodArray<z.ZodString>;
196
196
  outputFormat: z.ZodEnum<{
197
- scores: "scores";
198
197
  detailed: "detailed";
198
+ scores: "scores";
199
199
  ranking: "ranking";
200
200
  best: "best";
201
201
  }>;
@@ -218,8 +218,8 @@ export declare const WorkflowConfigSchema: z.ZodObject<{
218
218
  model: z.ZodString;
219
219
  criteria: z.ZodArray<z.ZodString>;
220
220
  outputFormat: z.ZodEnum<{
221
- scores: "scores";
222
221
  detailed: "detailed";
222
+ scores: "scores";
223
223
  ranking: "ranking";
224
224
  best: "best";
225
225
  }>;
@@ -245,9 +245,9 @@ export declare const WorkflowConfigSchema: z.ZodObject<{
245
245
  low: z.ZodNumber;
246
246
  }, z.core.$strip>>;
247
247
  toneAdjustment: z.ZodOptional<z.ZodEnum<{
248
- neutral: "neutral";
249
248
  soften: "soften";
250
249
  strengthen: "strengthen";
250
+ neutral: "neutral";
251
251
  }>>;
252
252
  includeMetadata: z.ZodOptional<z.ZodBoolean>;
253
253
  metadataFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -4823,6 +4823,7 @@
4823
4823
  {"objectID":"57cf0f7394ea15937bfa56393a1810810e6ac4f8b0ad606cd7884760e89b051d","title":"CLI Usage","url":"/docs/getting-started/providers/anthropic#cli-usage","content":"CLI Usage","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"CLI Usage","lvl3":""}},
4824
4824
  {"objectID":"363647b336363b9f2e8dae713031aec7e297f0f0fa3799cec3280131890f6226","title":"Beta Features","url":"/docs/getting-started/providers/anthropic#beta-features","content":"The Anthropic provider supports beta features via the anthropic-beta header. The following beta headers are included by default when enableBetaFeatures is true:\nclaude-code-20250219 -- Claude Code specific features\ninterleaved-thinking-2025-05-14 -- Interleaved thinking mode\nfine-grained-tool-streaming-2025-05-14 -- Fine-grained tool streaming\n\nThese correspond to the AnthropicBetaFeature enum values in src/lib/constants/enums.ts:\n\nFor OAuth mode, the beta headers are different: oauth-2025-04-20 and interleaved-thinking-2025-05-14 are sent (the claude-code-20250219 header is only included if it was present in the original request headers, as it can trigger authorization errors with OAuth tokens).","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"Beta Features","lvl3":""}},
4825
4825
  {"objectID":"e8a6ea83967bb6e1e6fe7208c5e1d1aa868e114173dca65e43938b6fddca5ae6","title":"Message threads (beta)","url":"/docs/getting-started/providers/anthropic#message-threads-beta","content":"A turn with tools makes several requests, and each one carries the whole conversation so far. With messageThreads: true the first request creates an Anthropic message thread. A later request sends only the messages since the last response, plus the previous response id, while nothing the thread fixes has changed; otherwise it sends the whole conversation as a new thread. It adds the message-threads-2026-08-12 beta header to those requests.\n\nWhat to know before turning it on:\nIt shrinks the request, it did not lower latency in a measurement. Against the Messages API, with prompt caching on in both modes, a tool turn's later requests went from about 79 KB to about 0.3 KB at 25k tokens of context, and from about 337 KB to about 0.3 KB at 110k tokens. Median time to first token was the same either way (672 vs 700 ms, and 739 vs 724 ms; one model, one network, no tools in the loop). The saving is bandwidth, not time.\nStreaming stream() turns on API-key auth only. generate(), other providers and OAuth (subscription) auth ignore the option.\nIt is best-effort and the conversation stays yours. The API keeps a thread in memory for a few minutes. If it cannot continue one (thread_not_found and similar), the same step is resent once in full as a new thread. If it cannot thread the request at all (thread_unsupported_request: HIPAA or inference-hook organisations, for example), that step and the rest of the turn go out unthreaded.\nAnything a thread fixes starts a new one. A change to the tools, the system prompt, the tool choice or the earlier messages (a context reclaim, for example) is sent as a new thread rather than a continue. A forced first-step tool choice therefore makes step 2 a new thread.\nA cut-off, refused or otherwise abnormal response is never continued from.\nRetention. Threads are not zero-data-retention eligible, there is no API to delete one, and each is deleted within an hour of its last use.","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"Message threads (beta)","lvl3":""}},
4826
+ {"objectID":"34441eee0c40860138d19ffcfce73b82e33f0f9125ddee3f426680e1a095c687","title":"Across the calls of a session (messageThreads: \"session\")","url":"/docs/getting-started/providers/anthropic#across-the-calls-of-a-session-messagethreads-session","content":"\"session\" also keeps the thread for the session's next call, so that call sends only its new message instead of the whole history. The thread is found again by user (context.userId), session (context.sessionId), API key (hashed) and endpoint; it lives in memory on the NeuroLink instance for up to four minutes (the API drops an idle thread after five), and another process simply starts a new one. A call continues only if its model, tools, system prompt (without the \"you are continuing a conversation\" note NeuroLink appends once there is history) and tool choice are the same, and the history conversation memory rebuilt matches what the thread holds. Otherwise it is a new thread.\n\nThree things differ from the per-turn option, and the first two are the price of the feature:\nThe model sees more than the unthreaded path would. Conversation memory keeps only each turn's final text plus a one-line [called <tool> → ok] marker per call. The thread still holds the full tool calls and results from earlier turns, so after a tool turn a continued call has context a rebuilt-from-memory call does not. That is deliberate, and it is why this is a separate value rather than the default.\nThe thread outlives clearConversationSession(). NeuroLink forgets it, so the next call starts a new thread, but the server keeps the old one until it expires (up to an hour) and has no delete. It is not zero-data-retention eligible. There is no carve-out for the conversation-erasure write protocol: choose \"session\" only where that is acceptable.\nA continued call runs without the conversation note in its system prompt, since the thread already holds the history the note points at.","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"Across the calls of a session (messageThreads: \"session\")","lvl3":""}},
4826
4827
  {"objectID":"b11311c624dc33cf3ddb6888c5ff085a18e0ce089b0db5cdb15bd2ebe2b70bf7","title":"Multimodal Capabilities","url":"/docs/getting-started/providers/anthropic#multimodal-capabilities","content":"Claude models with vision support can analyze images.","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"Multimodal Capabilities","lvl3":""}},
4827
4828
  {"objectID":"b9d325e6a6e5e5934dc6e4662fa16de4b606dfc6e2184e7a41dc7e60d4d59fe8","title":"Image Analysis","url":"/docs/getting-started/providers/anthropic#image-analysis","content":"Image Analysis","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"Image Analysis","lvl3":""}},
4828
4829
  {"objectID":"173aa07da1c648c3a005ea3cd6bcee2016d7a2fa4401ea8cdfe440615545abe3","title":"PDF Processing","url":"/docs/getting-started/providers/anthropic#pdf-processing","content":"PDF Processing","hierarchy":{"lvl0":"Getting Started","lvl1":"Anthropic Provider Guide","lvl2":"PDF Processing","lvl3":""}},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "13.11.0",
3
+ "version": "13.12.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": {
@@ -563,9 +563,9 @@
563
563
  "diff": "9.0.0",
564
564
  "dotenv": "17.3.1",
565
565
  "eventsource-parser": "3.0.8",
566
- "fast-xml-parser": "5.7.3",
566
+ "fast-xml-parser": "5.12.0",
567
567
  "google-auth-library": "10.6.2",
568
- "hono": "4.13.13",
568
+ "hono": "4.13.16",
569
569
  "iconv-lite": "0.7.2",
570
570
  "inquirer": "13.3.2",
571
571
  "jose": "6.2.2",
@@ -610,7 +610,7 @@
610
610
  "@fastify/cors": "11.3.1",
611
611
  "@fastify/rate-limit": "10.3.0",
612
612
  "@google-cloud/text-to-speech": "6.4.0",
613
- "@hono/node-server": "2.1.5",
613
+ "@hono/node-server": "2.1.6",
614
614
  "@koa/cors": "5.0.0",
615
615
  "@koa/router": "15.4.0",
616
616
  "@livekit/agents": "1.9.3",
@@ -660,9 +660,9 @@
660
660
  "@semantic-release/npm": "13.1.5",
661
661
  "@semantic-release/release-notes-generator": "14.1.0",
662
662
  "@smithy/types": "4.13.1",
663
- "@sveltejs/adapter-auto": "7.0.1",
664
- "@sveltejs/kit": "2.70.3",
665
- "@sveltejs/package": "2.5.7",
663
+ "@sveltejs/adapter-auto": "8.0.0",
664
+ "@sveltejs/kit": "3.0.0",
665
+ "@sveltejs/package": "3.0.2",
666
666
  "@sveltejs/vite-plugin-svelte": "7.0.0",
667
667
  "@types/cors": "2.8.19",
668
668
  "@types/diff": "8.0.0",
@@ -692,7 +692,7 @@
692
692
  "react": "19.2.4",
693
693
  "react-dom": "19.2.4",
694
694
  "semantic-release": "25.0.3",
695
- "svelte": "5.55.7",
695
+ "svelte": "5.57.3",
696
696
  "svelte-check": "4.7.8",
697
697
  "tsx": "4.21.0",
698
698
  "typedoc": "0.28.18",
@@ -795,6 +795,7 @@
795
795
  "glob@>=9.0.0 <14.0.2": ">=14.0.2",
796
796
  "archiver-utils>glob": "14.0.2",
797
797
  "readdir-glob>minimatch": "11.0.2",
798
+ "glob@7>minimatch": "3.1.5",
798
799
  "@semantic-release/npm": "^13.1.4",
799
800
  "@opentelemetry/sdk-trace-base@<2.8.0": "2.8.0",
800
801
  "@opentelemetry/sdk-trace-node@<2.8.0": "2.8.0",
@@ -806,10 +807,12 @@
806
807
  "fast-copy@>=4.0.0 <4.1.0": ">=4.1.0 <5.0.0",
807
808
  "minimatch@>=10.0.0 <10.2.3": ">=10.2.3",
808
809
  "minimatch@>=9.0.0 <9.0.7": ">=9.0.7",
809
- "typedoc>minimatch": ">=10.2.3",
810
+ "typedoc>minimatch": "10.2.4",
811
+ "eslint>minimatch": "11.0.2",
812
+ "@eslint/config-array>minimatch": "11.0.2",
810
813
  "minimatch@>=5.0.0 <5.1.8": ">=5.1.8",
811
814
  "minimatch@>=3.0.0 <3.1.4": ">=3.1.4",
812
- "fast-xml-parser@>=5.0.0 <5.7.0": ">=5.7.0",
815
+ "fast-xml-parser@<5.12.0": ">=5.12.0",
813
816
  "lodash@<4.18.0": ">=4.18.0",
814
817
  "lodash-es@<4.18.0": ">=4.18.0",
815
818
  "undici@>=7.0.0 <7.30.1": ">=7.30.1 <8.0.0",
@@ -851,7 +854,7 @@
851
854
  "markdown-it@<15.0.3": ">=15.0.3 <16"
852
855
  },
853
856
  "patchedDependencies": {
854
- "hono@4.13.13": "patches/hono@4.13.13.patch",
857
+ "hono@4.13.16": "patches/hono@4.13.16.patch",
855
858
  "mammoth@1.12.0": "patches/mammoth@1.12.0.patch"
856
859
  }
857
860
  },