@juspay/neurolink 13.12.0 → 13.12.2

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +5 -3
  2. package/dist/agent/agentToolRegistrar.js +3 -1
  3. package/dist/auth/middleware/AuthMiddleware.d.ts +1 -1
  4. package/dist/browser/neurolink.min.js +467 -467
  5. package/dist/context/fileSummarizationService.js +2 -0
  6. package/dist/core/baseProvider.d.ts +2 -2
  7. package/dist/core/loopEngine.js +20 -8
  8. package/dist/core/modules/ToolsManager.d.ts +11 -33
  9. package/dist/core/modules/ToolsManager.js +71 -99
  10. package/dist/core/modules/Utilities.js +6 -1
  11. package/dist/core/toolExecutionGuards.js +79 -11
  12. package/dist/evaluation/ragasEvaluator.js +2 -0
  13. package/dist/evaluation/scorers/llm/baseLLMScorer.js +2 -0
  14. package/dist/hitl/hitlErrors.d.ts +8 -0
  15. package/dist/hitl/hitlErrors.js +12 -0
  16. package/dist/hitl/hitlManager.d.ts +25 -7
  17. package/dist/hitl/hitlManager.js +133 -15
  18. package/dist/hitl/index.d.ts +1 -1
  19. package/dist/hitl/index.js +1 -1
  20. package/dist/hitl/toolCallConfirmation.d.ts +57 -0
  21. package/dist/hitl/toolCallConfirmation.js +296 -0
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +4 -1
  24. package/dist/mcp/externalServerManager.d.ts +33 -2
  25. package/dist/mcp/externalServerManager.js +68 -52
  26. package/dist/mcp/toolDiscoveryService.js +8 -1
  27. package/dist/mcp/toolRegistry.d.ts +20 -0
  28. package/dist/mcp/toolRegistry.js +68 -58
  29. package/dist/middleware/utils/guardrailsUtils.js +2 -0
  30. package/dist/neurolink.d.ts +114 -2
  31. package/dist/neurolink.js +492 -71
  32. package/dist/providers/amazonBedrock/client.js +23 -4
  33. package/dist/providers/amazonSagemaker.d.ts +1 -1
  34. package/dist/providers/anthropic/client.js +5 -1
  35. package/dist/providers/catalog/schema.d.ts +1 -1
  36. package/dist/providers/googleNativeGemini3/utils.js +5 -1
  37. package/dist/providers/openaiChatCompletionsBase.js +21 -3
  38. package/dist/providers/sagemaker/language-model.d.ts +2 -2
  39. package/dist/proxy/otelLogSink.d.ts +1 -1
  40. package/dist/rag/metadata/metadataExtractor.js +2 -0
  41. package/dist/rag/pipeline/RAGPipeline.js +4 -0
  42. package/dist/rag/pipeline/contextAssembly.d.ts +1 -0
  43. package/dist/rag/pipeline/contextAssembly.js +2 -0
  44. package/dist/rag/reranker/reranker.js +4 -0
  45. package/dist/server/utils/validation.d.ts +28 -28
  46. package/dist/types/hitl.d.ts +100 -8
  47. package/dist/types/mcp.d.ts +5 -0
  48. package/dist/types/providers.d.ts +23 -2
  49. package/dist/types/tools.d.ts +34 -9
  50. package/dist/utils/async/index.d.ts +2 -1
  51. package/dist/utils/async/index.js +2 -1
  52. package/dist/utils/async/pausableDeadline.d.ts +28 -0
  53. package/dist/utils/async/pausableDeadline.js +88 -0
  54. package/dist/utils/async/withTimeout.d.ts +5 -0
  55. package/dist/utils/async/withTimeout.js +23 -0
  56. package/dist/utils/errorHandling.d.ts +32 -1
  57. package/dist/utils/errorHandling.js +70 -18
  58. package/dist/utils/providerUtils.js +5 -1
  59. package/dist/workflow/config.d.ts +7 -7
  60. package/dist/workflow/core/ensembleExecutor.js +2 -0
  61. package/dist/workflow/core/judgeScorer.js +2 -0
  62. package/dist/workflow/core/responseConditioner.js +2 -0
  63. package/docs-site/static/search-index.json +8 -6
  64. package/package.json +18 -11
@@ -12,6 +12,7 @@ import { bedrockChunksToV3Stream, bedrockConversationFromV3Prompt, bedrockV3Stre
12
12
  import { AuthenticationError, ProviderError, RateLimitError, } from "../../types/index.js";
13
13
  import { classifyProviderError } from "../../utils/errorClassifier.js";
14
14
  import { isAbortError, withTimeout } from "../../utils/errorHandling.js";
15
+ import { abortSignalOf, pauseDeadlineOf } from "../../utils/async/index.js";
15
16
  import { ImageProcessor } from "../../utils/imageProcessor.js";
16
17
  import { logger } from "../../utils/logger.js";
17
18
  import { resolveSamplingParams } from "../../models/modelRegistry.js";
@@ -599,7 +600,7 @@ export class AmazonBedrockProvider extends BaseProvider {
599
600
  * all. The turn's full merged tool set is resolved once by the caller and
600
601
  * handed down.
601
602
  */
602
- async executeSingleTool(tools, toolName, args, _toolUseId) {
603
+ async executeSingleTool(tools, toolName, args, _toolUseId, context) {
603
604
  return bedrockTracer.startActiveSpan("bedrock.tool.execute", {
604
605
  kind: SpanKind.CLIENT,
605
606
  attributes: { "tool.name": toolName },
@@ -636,7 +637,7 @@ export class AmazonBedrockProvider extends BaseProvider {
636
637
  toolArgs[key] = value;
637
638
  }
638
639
  }
639
- const result = await tool.execute(toolArgs);
640
+ const result = await tool.execute(toolArgs, context);
640
641
  logger.debug(`[AmazonBedrockProvider] Tool execution result:`, {
641
642
  toolName,
642
643
  result,
@@ -724,7 +725,19 @@ export class AmazonBedrockProvider extends BaseProvider {
724
725
  const engineTools = {};
725
726
  for (const name of Object.keys(tools)) {
726
727
  engineTools[name] = {
727
- execute: (args) => this.executeSingleTool(tools, name, args),
728
+ // The engine's signal for the call (the turn's abort or its per-tool
729
+ // deadline) goes down to the tool with it, and so does the pause a
730
+ // confirmation puts on that deadline.
731
+ execute: (args, opts) => {
732
+ const abortSignal = abortSignalOf(opts);
733
+ const pauseDeadline = pauseDeadlineOf(opts);
734
+ return this.executeSingleTool(tools, name, args, undefined, abortSignal || pauseDeadline
735
+ ? {
736
+ ...(abortSignal && { abortSignal }),
737
+ ...(pauseDeadline && { pauseDeadline }),
738
+ }
739
+ : undefined);
740
+ },
728
741
  };
729
742
  }
730
743
  return engineTools;
@@ -740,11 +753,17 @@ export class AmazonBedrockProvider extends BaseProvider {
740
753
  result[name] = {
741
754
  description: tool.description,
742
755
  parameters: extractedParams,
743
- execute: async (params) => {
756
+ execute: async (params, context) => {
744
757
  if ("execute" in tool && tool.execute) {
745
758
  const result = await tool.execute(params, {
746
759
  toolCallId: `tool_${Date.now()}`,
747
760
  messages: [],
761
+ ...(context?.abortSignal
762
+ ? { abortSignal: context.abortSignal }
763
+ : {}),
764
+ ...(context?.pauseDeadline
765
+ ? { pauseDeadline: context.pauseDeadline }
766
+ : {}),
748
767
  });
749
768
  return {
750
769
  success: true,
@@ -107,7 +107,7 @@ export declare class AmazonSageMakerProvider extends BaseProvider {
107
107
  provider: string;
108
108
  specificationVersion: "v2";
109
109
  endpointName: string;
110
- modelType: "huggingface" | "mistral" | "custom" | "llama" | "claude" | "jumpstart" | undefined;
110
+ modelType: "custom" | "huggingface" | "mistral" | "llama" | "claude" | "jumpstart" | undefined;
111
111
  region: string;
112
112
  } | {
113
113
  capabilities: {
@@ -34,7 +34,7 @@ import { resolveToolExecutionRecords, toolCallsFromSummaries, } from "../../core
34
34
  import { transformToolExecutions } from "../../utils/transformationUtils.js";
35
35
  import { createAnthropicConfig, getProviderModel, validateApiKey, } from "../../utils/providerConfig.js";
36
36
  import { composeAbortSignals, composeAbortSignalsScoped, createTimeoutController, mergeAbortSignals, TimeoutError, } from "../../utils/timeout.js";
37
- import { raceWithAbort } from "../../utils/async/index.js";
37
+ import { pauseDeadlineOf, raceWithAbort } from "../../utils/async/index.js";
38
38
  import { normalizeResolvedToolChoice, resolveToolChoice, } from "../../utils/toolChoice.js";
39
39
  import { NoOutputGeneratedError } from "../../utils/generationErrors.js";
40
40
  import { buildNoOutputSentinel, stampNoOutputSpan, } from "../../utils/noOutputSentinel.js";
@@ -2303,9 +2303,13 @@ export class AnthropicProvider extends BaseProvider {
2303
2303
  engineTools[name] = {
2304
2304
  execute: async (args, opts) => {
2305
2305
  const ctx = opts;
2306
+ // The engine's pause for its per-tool deadline goes down too, so
2307
+ // a confirmation the call waits on does not spend that bound.
2308
+ const pauseDeadline = pauseDeadlineOf(opts);
2306
2309
  return execute(args, {
2307
2310
  toolCallId: ctx.toolCallId ?? "",
2308
2311
  ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}),
2312
+ ...(pauseDeadline ? { pauseDeadline } : {}),
2309
2313
  messages: [],
2310
2314
  });
2311
2315
  },
@@ -68,11 +68,11 @@ export declare const providerCatalogJsonSchema: z.ZodObject<{
68
68
  pattern: z.ZodOptional<z.ZodString>;
69
69
  patternStatuses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
70
70
  class: z.ZodEnum<{
71
- network: "network";
72
71
  provider: "provider";
73
72
  authentication: "authentication";
74
73
  "rate-limit": "rate-limit";
75
74
  "invalid-model": "invalid-model";
75
+ network: "network";
76
76
  }>;
77
77
  message: z.ZodString;
78
78
  }, z.core.$strict>>;
@@ -16,6 +16,7 @@ import { needsAudioTranscode, toProviderCompatibleAudio, } from "../../adapters/
16
16
  import { canDeliverVideoNatively } from "../../adapters/videoFormatSupport.js";
17
17
  import { logger } from "../../utils/logger.js";
18
18
  import { guardToolExecutor } from "../../core/toolExecutionGuards.js";
19
+ import { isRefusalResult } from "../../hitl/toolCallConfirmation.js";
19
20
  import { resolveSamplingParams } from "../../models/modelRegistry.js";
20
21
  import { convertZodToJsonSchema, ensureNestedSchemaTypes, inlineJsonSchema, isZodSchema, } from "../../utils/schemaConversion.js";
21
22
  import { createNativeThinkingConfig } from "../../utils/thinkingConfig.js";
@@ -61,7 +62,10 @@ export class DedupExecuteMap extends Map {
61
62
  return resultCache.get(key);
62
63
  }
63
64
  const result = await execute(args, options);
64
- resultCache.set(key, result);
65
+ // A HITL refusal is never reused: the identical call asks again.
66
+ if (!isRefusalResult(result)) {
67
+ resultCache.set(key, result);
68
+ }
65
69
  return result;
66
70
  };
67
71
  return wrapped;
@@ -2178,6 +2178,7 @@ export class OpenAIChatCompletionsProvider extends BaseProvider {
2178
2178
  toolExecutionSummaries,
2179
2179
  options,
2180
2180
  stepIndex: step,
2181
+ abortSignal,
2181
2182
  }));
2182
2183
  const executed = toolExecutionSummaries.slice(-stepResult.toolCalls.size);
2183
2184
  stepRecords.push(toPrepareStepRecord({
@@ -2389,7 +2390,7 @@ export class OpenAIChatCompletionsProvider extends BaseProvider {
2389
2390
  });
2390
2391
  }
2391
2392
  async executeToolBatch(args) {
2392
- const { stepResult, conversation, toolsRecord, toolNameFromWire, toolsUsed, toolExecutionSummaries, options, stepIndex, } = args;
2393
+ const { stepResult, conversation, toolsRecord, toolNameFromWire, toolsUsed, toolExecutionSummaries, options, stepIndex, abortSignal, } = args;
2393
2394
  const toolCallsForMessage = [];
2394
2395
  for (const [, t] of stepResult.toolCalls) {
2395
2396
  toolCallsForMessage.push({
@@ -2406,7 +2407,17 @@ export class OpenAIChatCompletionsProvider extends BaseProvider {
2406
2407
  ? { reasoning_content: stepResult.reasoning }
2407
2408
  : {}),
2408
2409
  });
2410
+ let executedCount = 0;
2409
2411
  for (const [, t] of stepResult.toolCalls) {
2412
+ // Honour an abort BETWEEN tool executions, as the loop engine does: a
2413
+ // tool that ignores its signal would otherwise still be started after
2414
+ // the turn was cancelled. The batch stops here so the results of the
2415
+ // tools that did run are still stored; the abort check after the
2416
+ // storage ends the turn the way the next step's request would have.
2417
+ if (abortSignal?.aborted) {
2418
+ break;
2419
+ }
2420
+ executedCount += 1;
2410
2421
  const startedAt = new Date();
2411
2422
  const parsed = parseToolInput(t.argsBuffered);
2412
2423
  let output;
@@ -2441,7 +2452,11 @@ export class OpenAIChatCompletionsProvider extends BaseProvider {
2441
2452
  }
2442
2453
  else {
2443
2454
  try {
2444
- output = await toolDef.execute(input, {});
2455
+ output = await toolDef.execute(input, {
2456
+ toolCallId: t.id,
2457
+ messages: [],
2458
+ ...(abortSignal ? { abortSignal } : {}),
2459
+ });
2445
2460
  }
2446
2461
  catch (err) {
2447
2462
  errorMsg = err instanceof Error ? err.message : String(err);
@@ -2466,7 +2481,7 @@ export class OpenAIChatCompletionsProvider extends BaseProvider {
2466
2481
  content: stringifyToolOutput(output),
2467
2482
  });
2468
2483
  }
2469
- const justExecuted = toolExecutionSummaries.slice(-stepResult.toolCalls.size);
2484
+ const justExecuted = executedCount > 0 ? toolExecutionSummaries.slice(-executedCount) : [];
2470
2485
  // No `tool:end` here: the executor already emitted start/end with the
2471
2486
  // real duration, and a second emission per result doubled every
2472
2487
  // consumer's count.
@@ -2496,6 +2511,9 @@ export class OpenAIChatCompletionsProvider extends BaseProvider {
2496
2511
  error: err instanceof Error ? err.message : String(err),
2497
2512
  });
2498
2513
  }
2514
+ // An abort during the batch's last tool: the turn ends with it even when
2515
+ // no step follows to make a request that would throw it.
2516
+ abortSignal?.throwIfAborted();
2499
2517
  }
2500
2518
  /**
2501
2519
  * Default implementation hits `${baseURL}/models`. Subclasses with a
@@ -162,7 +162,7 @@ export declare class SageMakerLanguageModel implements SageMakerAsLanguageModel
162
162
  provider: string;
163
163
  specificationVersion: "v2";
164
164
  endpointName: string;
165
- modelType: "huggingface" | "mistral" | "custom" | "llama" | "claude" | "jumpstart" | undefined;
165
+ modelType: "custom" | "huggingface" | "mistral" | "llama" | "claude" | "jumpstart" | undefined;
166
166
  region: string;
167
167
  };
168
168
  /**
@@ -209,7 +209,7 @@ export declare class SageMakerLanguageModel implements SageMakerAsLanguageModel
209
209
  provider: string;
210
210
  specificationVersion: "v2";
211
211
  endpointName: string;
212
- modelType: "huggingface" | "mistral" | "custom" | "llama" | "claude" | "jumpstart" | undefined;
212
+ modelType: "custom" | "huggingface" | "mistral" | "llama" | "claude" | "jumpstart" | undefined;
213
213
  region: string;
214
214
  };
215
215
  }
@@ -63,7 +63,7 @@ export declare function getProxyOtelLogSnapshot(): {
63
63
  lastFailureAt: string | undefined;
64
64
  highWaterOutstanding: number;
65
65
  failureHistoryEvicted: number;
66
- kind: "metadata" | "bodies" | "indexes" | "diagnostics";
66
+ kind: "metadata" | "indexes" | "bodies" | "diagnostics";
67
67
  capacity: number;
68
68
  byteCapacity: number;
69
69
  retentionMs: number;
@@ -263,6 +263,8 @@ Return the extracted data as JSON.`;
263
263
  prompt,
264
264
  maxTokens: config.maxTokens || 500,
265
265
  temperature: config.temperature || 0.3,
266
+ // Extracted metadata is text; the extractor is given no tools.
267
+ disableTools: true,
266
268
  });
267
269
  return result?.content || "";
268
270
  }
@@ -765,6 +765,8 @@ export class RAGPipeline {
765
765
  systemPrompt: "You are an image captioning assistant. Provide concise, descriptive captions.",
766
766
  input: { text: "", images: [dataUri] },
767
767
  maxTokens: 100,
768
+ // A caption is text; the captioner is given no tools.
769
+ disableTools: true,
768
770
  }), DEFAULT_TIMEOUT_MS, "Image captioning timed out");
769
771
  return result?.content || "Image";
770
772
  }
@@ -851,6 +853,8 @@ Cite sources when possible using [Source N] format.`;
851
853
  systemPrompt,
852
854
  temperature: temperature ?? this.config.generationModel?.temperature ?? 0.7,
853
855
  maxTokens: this.config.generationModel?.maxTokens ?? 1000,
856
+ // The answer is written from the retrieved context; no tools.
857
+ disableTools: true,
854
858
  }), DEFAULT_TIMEOUT_MS * 2, "Answer generation timed out");
855
859
  return result?.content || "";
856
860
  }
@@ -66,6 +66,7 @@ export declare function summarizeContext(context: string, maxLength?: number, pr
66
66
  prompt: string;
67
67
  maxTokens: number;
68
68
  temperature: number;
69
+ disableTools?: boolean;
69
70
  }) => Promise<{
70
71
  content?: string;
71
72
  } | null>;
@@ -208,6 +208,8 @@ export async function summarizeContext(context, maxLength = 500, provider) {
208
208
  prompt: `Summarize the following context in no more than ${maxLength} words, preserving the key information:\n\n${context}\n\nSummary:`,
209
209
  maxTokens: Math.ceil(maxLength * 1.5),
210
210
  temperature: 0.3,
211
+ // A summary is text; the summarizing model is given no tools.
212
+ disableTools: true,
211
213
  });
212
214
  return result?.content?.trim() || truncateText(context, maxLength * 4);
213
215
  }
@@ -125,6 +125,8 @@ Score:`;
125
125
  prompt,
126
126
  maxTokens: 10,
127
127
  temperature: 0,
128
+ // A relevance score is text; the reranker is given no tools.
129
+ disableTools: true,
128
130
  });
129
131
  const scoreText = result?.content?.trim() || "0";
130
132
  const score = parseFloat(scoreText);
@@ -194,6 +196,8 @@ Respond with only the scores, one per line, in order:`;
194
196
  prompt,
195
197
  maxTokens: 50,
196
198
  temperature: 0,
199
+ // Relevance scores are text; the reranker is given no tools.
200
+ disableTools: true,
197
201
  });
198
202
  // Parse scores from response
199
203
  const scoreLines = (result?.content || "")
@@ -259,8 +259,8 @@ export declare const TranscribeConfigSchema: z.ZodObject<{
259
259
  correction: z.ZodOptional<z.ZodObject<{
260
260
  enabled: z.ZodOptional<z.ZodBoolean>;
261
261
  guard: z.ZodOptional<z.ZodEnum<{
262
- none: "none";
263
262
  decide: "decide";
263
+ none: "none";
264
264
  }>>;
265
265
  decideTimeoutMs: z.ZodOptional<z.ZodNumber>;
266
266
  rewrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodLiteral<"auto">, z.ZodObject<{
@@ -268,14 +268,14 @@ export declare const TranscribeConfigSchema: z.ZodObject<{
268
268
  model: z.ZodOptional<z.ZodString>;
269
269
  timeoutMs: z.ZodOptional<z.ZodNumber>;
270
270
  mode: z.ZodOptional<z.ZodEnum<{
271
- auto: "auto";
272
271
  always: "always";
272
+ auto: "auto";
273
273
  }>>;
274
274
  }, z.core.$strip>]>>;
275
275
  perSentence: z.ZodOptional<z.ZodBoolean>;
276
276
  transliterate: z.ZodOptional<z.ZodEnum<{
277
- native: "native";
278
277
  latin: "latin";
278
+ native: "native";
279
279
  }>>;
280
280
  punctuate: z.ZodOptional<z.ZodBoolean>;
281
281
  cleanup: z.ZodOptional<z.ZodEnum<{
@@ -295,8 +295,8 @@ export declare const TranscribeConfigSchema: z.ZodObject<{
295
295
  model: z.ZodOptional<z.ZodString>;
296
296
  when: z.ZodOptional<z.ZodArray<z.ZodEnum<{
297
297
  error: "error";
298
- empty: "empty";
299
298
  unsure: "unsure";
299
+ empty: "empty";
300
300
  }>>>;
301
301
  }, z.core.$strip>>;
302
302
  routing: z.ZodOptional<z.ZodObject<{
@@ -340,8 +340,8 @@ export declare const TranscribeRequestSchema: z.ZodObject<{
340
340
  correction: z.ZodOptional<z.ZodObject<{
341
341
  enabled: z.ZodOptional<z.ZodBoolean>;
342
342
  guard: z.ZodOptional<z.ZodEnum<{
343
- none: "none";
344
343
  decide: "decide";
344
+ none: "none";
345
345
  }>>;
346
346
  decideTimeoutMs: z.ZodOptional<z.ZodNumber>;
347
347
  rewrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodLiteral<"auto">, z.ZodObject<{
@@ -349,14 +349,14 @@ export declare const TranscribeRequestSchema: z.ZodObject<{
349
349
  model: z.ZodOptional<z.ZodString>;
350
350
  timeoutMs: z.ZodOptional<z.ZodNumber>;
351
351
  mode: z.ZodOptional<z.ZodEnum<{
352
- auto: "auto";
353
352
  always: "always";
353
+ auto: "auto";
354
354
  }>>;
355
355
  }, z.core.$strip>]>>;
356
356
  perSentence: z.ZodOptional<z.ZodBoolean>;
357
357
  transliterate: z.ZodOptional<z.ZodEnum<{
358
- native: "native";
359
358
  latin: "latin";
359
+ native: "native";
360
360
  }>>;
361
361
  punctuate: z.ZodOptional<z.ZodBoolean>;
362
362
  cleanup: z.ZodOptional<z.ZodEnum<{
@@ -376,8 +376,8 @@ export declare const TranscribeRequestSchema: z.ZodObject<{
376
376
  model: z.ZodOptional<z.ZodString>;
377
377
  when: z.ZodOptional<z.ZodArray<z.ZodEnum<{
378
378
  error: "error";
379
- empty: "empty";
380
379
  unsure: "unsure";
380
+ empty: "empty";
381
381
  }>>>;
382
382
  }, z.core.$strip>>;
383
383
  routing: z.ZodOptional<z.ZodObject<{
@@ -437,8 +437,8 @@ export declare const TranscribeStreamConfigSchema: z.ZodObject<{
437
437
  correction: z.ZodOptional<z.ZodObject<{
438
438
  enabled: z.ZodOptional<z.ZodBoolean>;
439
439
  guard: z.ZodOptional<z.ZodEnum<{
440
- none: "none";
441
440
  decide: "decide";
441
+ none: "none";
442
442
  }>>;
443
443
  decideTimeoutMs: z.ZodOptional<z.ZodNumber>;
444
444
  rewrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodLiteral<"auto">, z.ZodObject<{
@@ -446,14 +446,14 @@ export declare const TranscribeStreamConfigSchema: z.ZodObject<{
446
446
  model: z.ZodOptional<z.ZodString>;
447
447
  timeoutMs: z.ZodOptional<z.ZodNumber>;
448
448
  mode: z.ZodOptional<z.ZodEnum<{
449
- auto: "auto";
450
449
  always: "always";
450
+ auto: "auto";
451
451
  }>>;
452
452
  }, z.core.$strip>]>>;
453
453
  perSentence: z.ZodOptional<z.ZodBoolean>;
454
454
  transliterate: z.ZodOptional<z.ZodEnum<{
455
- native: "native";
456
455
  latin: "latin";
456
+ native: "native";
457
457
  }>>;
458
458
  punctuate: z.ZodOptional<z.ZodBoolean>;
459
459
  cleanup: z.ZodOptional<z.ZodEnum<{
@@ -473,8 +473,8 @@ export declare const TranscribeStreamConfigSchema: z.ZodObject<{
473
473
  model: z.ZodOptional<z.ZodString>;
474
474
  when: z.ZodOptional<z.ZodArray<z.ZodEnum<{
475
475
  error: "error";
476
- empty: "empty";
477
476
  unsure: "unsure";
477
+ empty: "empty";
478
478
  }>>>;
479
479
  }, z.core.$strip>>;
480
480
  routing: z.ZodOptional<z.ZodObject<{
@@ -535,7 +535,6 @@ export declare const TranscribeStreamConfigSchema: z.ZodObject<{
535
535
  }, z.core.$strip>>;
536
536
  }, z.core.$strip>;
537
537
  export declare const STTRealtimeProfileSchema: z.ZodObject<{
538
- timeoutMs: z.ZodOptional<z.ZodNumber>;
539
538
  provider: z.ZodOptional<z.ZodString>;
540
539
  output: z.ZodOptional<z.ZodObject<{
541
540
  languages: z.ZodArray<z.ZodString>;
@@ -574,10 +573,9 @@ export declare const STTRealtimeProfileSchema: z.ZodObject<{
574
573
  }, z.core.$strip>>;
575
574
  normalize: z.ZodOptional<z.ZodBoolean>;
576
575
  }, z.core.$strip>>;
577
- prompt: z.ZodOptional<z.ZodString>;
578
576
  language: z.ZodOptional<z.ZodString>;
579
- diarization: z.ZodOptional<z.ZodBoolean>;
580
- wordTimestamps: z.ZodOptional<z.ZodBoolean>;
577
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
578
+ prompt: z.ZodOptional<z.ZodString>;
581
579
  dictionary: z.ZodOptional<z.ZodArray<z.ZodObject<{
582
580
  term: z.ZodString;
583
581
  heardAs: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -586,8 +584,8 @@ export declare const STTRealtimeProfileSchema: z.ZodObject<{
586
584
  correction: z.ZodOptional<z.ZodObject<{
587
585
  enabled: z.ZodOptional<z.ZodBoolean>;
588
586
  guard: z.ZodOptional<z.ZodEnum<{
589
- none: "none";
590
587
  decide: "decide";
588
+ none: "none";
591
589
  }>>;
592
590
  decideTimeoutMs: z.ZodOptional<z.ZodNumber>;
593
591
  rewrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodLiteral<"auto">, z.ZodObject<{
@@ -595,14 +593,14 @@ export declare const STTRealtimeProfileSchema: z.ZodObject<{
595
593
  model: z.ZodOptional<z.ZodString>;
596
594
  timeoutMs: z.ZodOptional<z.ZodNumber>;
597
595
  mode: z.ZodOptional<z.ZodEnum<{
598
- auto: "auto";
599
596
  always: "always";
597
+ auto: "auto";
600
598
  }>>;
601
599
  }, z.core.$strip>]>>;
602
600
  perSentence: z.ZodOptional<z.ZodBoolean>;
603
601
  transliterate: z.ZodOptional<z.ZodEnum<{
604
- native: "native";
605
602
  latin: "latin";
603
+ native: "native";
606
604
  }>>;
607
605
  punctuate: z.ZodOptional<z.ZodBoolean>;
608
606
  cleanup: z.ZodOptional<z.ZodEnum<{
@@ -622,8 +620,8 @@ export declare const STTRealtimeProfileSchema: z.ZodObject<{
622
620
  model: z.ZodOptional<z.ZodString>;
623
621
  when: z.ZodOptional<z.ZodArray<z.ZodEnum<{
624
622
  error: "error";
625
- empty: "empty";
626
623
  unsure: "unsure";
624
+ empty: "empty";
627
625
  }>>>;
628
626
  }, z.core.$strip>>;
629
627
  routing: z.ZodOptional<z.ZodObject<{
@@ -639,6 +637,8 @@ export declare const STTRealtimeProfileSchema: z.ZodObject<{
639
637
  engine: "engine";
640
638
  utterances: "utterances";
641
639
  }>>;
640
+ diarization: z.ZodOptional<z.ZodBoolean>;
641
+ wordTimestamps: z.ZodOptional<z.ZodBoolean>;
642
642
  completed: z.ZodOptional<z.ZodEnum<{
643
643
  final: "final";
644
644
  corrected: "corrected";
@@ -648,7 +648,6 @@ export declare const STTRealtimeProfileSchema: z.ZodObject<{
648
648
  clientTurnDetection: z.ZodOptional<z.ZodBoolean>;
649
649
  }, z.core.$strip>;
650
650
  export declare const STTRealtimeProfilesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
651
- timeoutMs: z.ZodOptional<z.ZodNumber>;
652
651
  provider: z.ZodOptional<z.ZodString>;
653
652
  output: z.ZodOptional<z.ZodObject<{
654
653
  languages: z.ZodArray<z.ZodString>;
@@ -687,10 +686,9 @@ export declare const STTRealtimeProfilesSchema: z.ZodRecord<z.ZodString, z.ZodOb
687
686
  }, z.core.$strip>>;
688
687
  normalize: z.ZodOptional<z.ZodBoolean>;
689
688
  }, z.core.$strip>>;
690
- prompt: z.ZodOptional<z.ZodString>;
691
689
  language: z.ZodOptional<z.ZodString>;
692
- diarization: z.ZodOptional<z.ZodBoolean>;
693
- wordTimestamps: z.ZodOptional<z.ZodBoolean>;
690
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
691
+ prompt: z.ZodOptional<z.ZodString>;
694
692
  dictionary: z.ZodOptional<z.ZodArray<z.ZodObject<{
695
693
  term: z.ZodString;
696
694
  heardAs: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -699,8 +697,8 @@ export declare const STTRealtimeProfilesSchema: z.ZodRecord<z.ZodString, z.ZodOb
699
697
  correction: z.ZodOptional<z.ZodObject<{
700
698
  enabled: z.ZodOptional<z.ZodBoolean>;
701
699
  guard: z.ZodOptional<z.ZodEnum<{
702
- none: "none";
703
700
  decide: "decide";
701
+ none: "none";
704
702
  }>>;
705
703
  decideTimeoutMs: z.ZodOptional<z.ZodNumber>;
706
704
  rewrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodLiteral<"auto">, z.ZodObject<{
@@ -708,14 +706,14 @@ export declare const STTRealtimeProfilesSchema: z.ZodRecord<z.ZodString, z.ZodOb
708
706
  model: z.ZodOptional<z.ZodString>;
709
707
  timeoutMs: z.ZodOptional<z.ZodNumber>;
710
708
  mode: z.ZodOptional<z.ZodEnum<{
711
- auto: "auto";
712
709
  always: "always";
710
+ auto: "auto";
713
711
  }>>;
714
712
  }, z.core.$strip>]>>;
715
713
  perSentence: z.ZodOptional<z.ZodBoolean>;
716
714
  transliterate: z.ZodOptional<z.ZodEnum<{
717
- native: "native";
718
715
  latin: "latin";
716
+ native: "native";
719
717
  }>>;
720
718
  punctuate: z.ZodOptional<z.ZodBoolean>;
721
719
  cleanup: z.ZodOptional<z.ZodEnum<{
@@ -735,8 +733,8 @@ export declare const STTRealtimeProfilesSchema: z.ZodRecord<z.ZodString, z.ZodOb
735
733
  model: z.ZodOptional<z.ZodString>;
736
734
  when: z.ZodOptional<z.ZodArray<z.ZodEnum<{
737
735
  error: "error";
738
- empty: "empty";
739
736
  unsure: "unsure";
737
+ empty: "empty";
740
738
  }>>>;
741
739
  }, z.core.$strip>>;
742
740
  routing: z.ZodOptional<z.ZodObject<{
@@ -752,6 +750,8 @@ export declare const STTRealtimeProfilesSchema: z.ZodRecord<z.ZodString, z.ZodOb
752
750
  engine: "engine";
753
751
  utterances: "utterances";
754
752
  }>>;
753
+ diarization: z.ZodOptional<z.ZodBoolean>;
754
+ wordTimestamps: z.ZodOptional<z.ZodBoolean>;
755
755
  completed: z.ZodOptional<z.ZodEnum<{
756
756
  final: "final";
757
757
  corrected: "corrected";