@juspay/neurolink 9.65.0 → 9.65.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.
- package/CHANGELOG.md +8 -0
- package/dist/adapters/video/videoAnalyzer.d.ts +1 -1
- package/dist/agent/directTools.d.ts +9 -17
- package/dist/agent/directTools.js +12 -8
- package/dist/autoresearch/tools.d.ts +2 -214
- package/dist/autoresearch/tools.js +1 -1
- package/dist/browser/neurolink.min.js +362 -368
- package/dist/client/reactHooks.js +16 -8
- package/dist/client/reactHooks.tsx +24 -9
- package/dist/core/baseProvider.d.ts +1 -6
- package/dist/core/baseProvider.js +1 -1
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +3 -0
- package/dist/core/modules/GenerationHandler.d.ts +2 -2
- package/dist/core/modules/GenerationHandler.js +3 -1
- package/dist/core/modules/MessageBuilder.d.ts +1 -15
- package/dist/core/modules/MessageBuilder.js +0 -14
- package/dist/core/modules/StreamHandler.js +1 -1
- package/dist/core/modules/ToolsManager.d.ts +1 -17
- package/dist/core/modules/ToolsManager.js +1 -17
- package/dist/core/redisConversationMemoryManager.js +0 -6
- package/dist/core/streamAnalytics.js +1 -1
- package/dist/evaluation/contextBuilder.d.ts +1 -4
- package/dist/evaluation/contextBuilder.js +0 -3
- package/dist/evaluation/index.d.ts +1 -4
- package/dist/evaluation/index.js +0 -3
- package/dist/files/fileTools.d.ts +2 -18
- package/dist/files/fileTools.js +3 -19
- package/dist/lib/adapters/video/videoAnalyzer.d.ts +1 -1
- package/dist/lib/agent/directTools.d.ts +9 -17
- package/dist/lib/agent/directTools.js +12 -8
- package/dist/lib/autoresearch/tools.d.ts +2 -214
- package/dist/lib/autoresearch/tools.js +1 -1
- package/dist/lib/client/reactHooks.js +16 -8
- package/dist/lib/core/baseProvider.d.ts +1 -6
- package/dist/lib/core/baseProvider.js +1 -1
- package/dist/lib/core/constants.d.ts +1 -0
- package/dist/lib/core/constants.js +3 -0
- package/dist/lib/core/modules/GenerationHandler.d.ts +2 -2
- package/dist/lib/core/modules/GenerationHandler.js +3 -1
- package/dist/lib/core/modules/MessageBuilder.d.ts +1 -15
- package/dist/lib/core/modules/MessageBuilder.js +0 -14
- package/dist/lib/core/modules/StreamHandler.js +1 -1
- package/dist/lib/core/modules/ToolsManager.d.ts +1 -17
- package/dist/lib/core/modules/ToolsManager.js +1 -17
- package/dist/lib/core/redisConversationMemoryManager.js +0 -6
- package/dist/lib/core/streamAnalytics.js +1 -1
- package/dist/lib/evaluation/contextBuilder.d.ts +1 -4
- package/dist/lib/evaluation/contextBuilder.js +0 -3
- package/dist/lib/evaluation/index.d.ts +1 -4
- package/dist/lib/evaluation/index.js +0 -3
- package/dist/lib/files/fileTools.d.ts +2 -18
- package/dist/lib/files/fileTools.js +3 -19
- package/dist/lib/memory/memoryRetrievalTools.d.ts +2 -126
- package/dist/lib/memory/memoryRetrievalTools.js +1 -9
- package/dist/lib/middleware/builtin/autoEvaluation.d.ts +0 -3
- package/dist/lib/middleware/builtin/autoEvaluation.js +0 -3
- package/dist/lib/middleware/builtin/guardrails.js +1 -1
- package/dist/lib/middleware/builtin/lifecycle.d.ts +0 -9
- package/dist/lib/middleware/builtin/lifecycle.js +0 -9
- package/dist/lib/middleware/factory.d.ts +1 -1
- package/dist/lib/middleware/factory.js +1 -1
- package/dist/lib/middleware/registry.d.ts +1 -1
- package/dist/lib/neurolink.d.ts +14 -2
- package/dist/lib/neurolink.js +46 -18
- package/dist/lib/processors/media/AudioProcessor.js +8 -3
- package/dist/lib/providers/amazonBedrock.js +1 -2
- package/dist/lib/providers/amazonSagemaker.d.ts +1 -7
- package/dist/lib/providers/amazonSagemaker.js +0 -6
- package/dist/lib/providers/anthropic.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +2 -1
- package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/lib/providers/anthropicBaseProvider.js +2 -1
- package/dist/lib/providers/azureOpenai.d.ts +1 -1
- package/dist/lib/providers/azureOpenai.js +2 -1
- package/dist/lib/providers/cloudflare.d.ts +1 -1
- package/dist/lib/providers/cloudflare.js +2 -1
- package/dist/lib/providers/cohere.d.ts +1 -1
- package/dist/lib/providers/cohere.js +2 -1
- package/dist/lib/providers/deepseek.d.ts +1 -1
- package/dist/lib/providers/deepseek.js +2 -1
- package/dist/lib/providers/fireworks.d.ts +1 -1
- package/dist/lib/providers/fireworks.js +2 -1
- package/dist/lib/providers/googleAiStudio.d.ts +1 -1
- package/dist/lib/providers/googleAiStudio.js +82 -6
- package/dist/lib/providers/googleNativeGemini3.d.ts +3 -6
- package/dist/lib/providers/googleNativeGemini3.js +104 -9
- package/dist/lib/providers/googleVertex.d.ts +1 -1
- package/dist/lib/providers/googleVertex.js +466 -165
- package/dist/lib/providers/groq.d.ts +1 -1
- package/dist/lib/providers/groq.js +2 -1
- package/dist/lib/providers/huggingFace.d.ts +1 -1
- package/dist/lib/providers/huggingFace.js +3 -1
- package/dist/lib/providers/ideogram.d.ts +1 -1
- package/dist/lib/providers/jina.d.ts +1 -1
- package/dist/lib/providers/litellm.d.ts +1 -1
- package/dist/lib/providers/litellm.js +12 -6
- package/dist/lib/providers/llamaCpp.d.ts +1 -1
- package/dist/lib/providers/llamaCpp.js +2 -1
- package/dist/lib/providers/lmStudio.d.ts +1 -1
- package/dist/lib/providers/lmStudio.js +2 -1
- package/dist/lib/providers/mistral.d.ts +1 -1
- package/dist/lib/providers/mistral.js +2 -1
- package/dist/lib/providers/nvidiaNim.d.ts +1 -1
- package/dist/lib/providers/nvidiaNim.js +2 -1
- package/dist/lib/providers/ollama.d.ts +1 -1
- package/dist/lib/providers/ollama.js +1 -2
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +3 -1
- package/dist/lib/providers/openRouter.d.ts +1 -1
- package/dist/lib/providers/openRouter.js +3 -1
- package/dist/lib/providers/openaiCompatible.d.ts +1 -1
- package/dist/lib/providers/openaiCompatible.js +3 -1
- package/dist/lib/providers/perplexity.d.ts +1 -1
- package/dist/lib/providers/perplexity.js +2 -1
- package/dist/lib/providers/providerTypeUtils.d.ts +2 -7
- package/dist/lib/providers/providerTypeUtils.js +0 -6
- package/dist/lib/providers/recraft.d.ts +1 -1
- package/dist/lib/providers/replicate.d.ts +1 -1
- package/dist/lib/providers/stability.d.ts +1 -1
- package/dist/lib/providers/togetherAi.d.ts +1 -1
- package/dist/lib/providers/togetherAi.js +2 -1
- package/dist/lib/providers/voyage.d.ts +1 -1
- package/dist/lib/providers/xai.d.ts +1 -1
- package/dist/lib/providers/xai.js +2 -1
- package/dist/lib/proxy/claudeFormat.d.ts +0 -15
- package/dist/lib/proxy/claudeFormat.js +1 -11
- package/dist/lib/rag/ragIntegration.d.ts +1 -12
- package/dist/lib/rag/ragIntegration.js +0 -8
- package/dist/lib/tasks/tools/taskTools.d.ts +2 -117
- package/dist/lib/tasks/tools/taskTools.js +1 -10
- package/dist/lib/types/aliases.d.ts +1 -1
- package/dist/lib/types/conversation.d.ts +17 -0
- package/dist/lib/types/evaluation.d.ts +1 -5
- package/dist/lib/types/evaluation.js +0 -4
- package/dist/lib/types/generate.d.ts +2 -22
- package/dist/lib/types/guardrails.d.ts +1 -1
- package/dist/lib/types/middleware.d.ts +8 -3
- package/dist/lib/types/providers.d.ts +2 -1
- package/dist/lib/types/rag.d.ts +1 -1
- package/dist/lib/types/rag.js +0 -6
- package/dist/lib/types/stream.d.ts +2 -11
- package/dist/lib/types/tools.d.ts +2 -1
- package/dist/lib/utils/generation.d.ts +8 -0
- package/dist/lib/utils/generation.js +9 -0
- package/dist/lib/utils/generationErrors.d.ts +10 -0
- package/dist/lib/utils/generationErrors.js +11 -0
- package/dist/lib/utils/messageBuilder.d.ts +1 -6
- package/dist/lib/utils/messageBuilder.js +0 -5
- package/dist/lib/utils/noOutputSentinel.d.ts +0 -13
- package/dist/lib/utils/noOutputSentinel.js +1 -14
- package/dist/lib/utils/providerRetry.js +1 -1
- package/dist/lib/utils/tool.d.ts +8 -0
- package/dist/lib/utils/tool.js +9 -0
- package/dist/lib/utils/toolCallRepair.d.ts +1 -16
- package/dist/lib/utils/toolCallRepair.js +1 -16
- package/dist/lib/utils/toolChoice.d.ts +1 -1
- package/dist/lib/utils/videoAnalysisProcessor.d.ts +1 -8
- package/dist/lib/utils/videoAnalysisProcessor.js +0 -7
- package/dist/memory/memoryRetrievalTools.d.ts +2 -126
- package/dist/memory/memoryRetrievalTools.js +1 -9
- package/dist/middleware/builtin/autoEvaluation.d.ts +0 -3
- package/dist/middleware/builtin/autoEvaluation.js +0 -3
- package/dist/middleware/builtin/guardrails.js +1 -1
- package/dist/middleware/builtin/lifecycle.d.ts +0 -9
- package/dist/middleware/builtin/lifecycle.js +0 -9
- package/dist/middleware/factory.d.ts +1 -1
- package/dist/middleware/factory.js +1 -1
- package/dist/middleware/registry.d.ts +1 -1
- package/dist/neurolink.d.ts +14 -2
- package/dist/neurolink.js +46 -18
- package/dist/processors/media/AudioProcessor.js +8 -3
- package/dist/providers/amazonBedrock.js +1 -2
- package/dist/providers/amazonSagemaker.d.ts +1 -7
- package/dist/providers/amazonSagemaker.js +0 -6
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +2 -1
- package/dist/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/providers/anthropicBaseProvider.js +2 -1
- package/dist/providers/azureOpenai.d.ts +1 -1
- package/dist/providers/azureOpenai.js +2 -1
- package/dist/providers/cloudflare.d.ts +1 -1
- package/dist/providers/cloudflare.js +2 -1
- package/dist/providers/cohere.d.ts +1 -1
- package/dist/providers/cohere.js +2 -1
- package/dist/providers/deepseek.d.ts +1 -1
- package/dist/providers/deepseek.js +2 -1
- package/dist/providers/fireworks.d.ts +1 -1
- package/dist/providers/fireworks.js +2 -1
- package/dist/providers/googleAiStudio.d.ts +1 -1
- package/dist/providers/googleAiStudio.js +82 -5
- package/dist/providers/googleNativeGemini3.d.ts +3 -6
- package/dist/providers/googleNativeGemini3.js +104 -9
- package/dist/providers/googleVertex.d.ts +1 -1
- package/dist/providers/googleVertex.js +466 -164
- package/dist/providers/groq.d.ts +1 -1
- package/dist/providers/groq.js +2 -1
- package/dist/providers/huggingFace.d.ts +1 -1
- package/dist/providers/huggingFace.js +3 -1
- package/dist/providers/ideogram.d.ts +1 -1
- package/dist/providers/jina.d.ts +1 -1
- package/dist/providers/litellm.d.ts +1 -1
- package/dist/providers/litellm.js +12 -6
- package/dist/providers/llamaCpp.d.ts +1 -1
- package/dist/providers/llamaCpp.js +2 -1
- package/dist/providers/lmStudio.d.ts +1 -1
- package/dist/providers/lmStudio.js +2 -1
- package/dist/providers/mistral.d.ts +1 -1
- package/dist/providers/mistral.js +2 -1
- package/dist/providers/nvidiaNim.d.ts +1 -1
- package/dist/providers/nvidiaNim.js +2 -1
- package/dist/providers/ollama.d.ts +1 -1
- package/dist/providers/ollama.js +1 -2
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +3 -1
- package/dist/providers/openRouter.d.ts +1 -1
- package/dist/providers/openRouter.js +3 -1
- package/dist/providers/openaiCompatible.d.ts +1 -1
- package/dist/providers/openaiCompatible.js +3 -1
- package/dist/providers/perplexity.d.ts +1 -1
- package/dist/providers/perplexity.js +2 -1
- package/dist/providers/providerTypeUtils.d.ts +2 -7
- package/dist/providers/providerTypeUtils.js +0 -6
- package/dist/providers/recraft.d.ts +1 -1
- package/dist/providers/replicate.d.ts +1 -1
- package/dist/providers/stability.d.ts +1 -1
- package/dist/providers/togetherAi.d.ts +1 -1
- package/dist/providers/togetherAi.js +2 -1
- package/dist/providers/voyage.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/xai.js +2 -1
- package/dist/proxy/claudeFormat.d.ts +0 -15
- package/dist/proxy/claudeFormat.js +1 -11
- package/dist/rag/ragIntegration.d.ts +1 -12
- package/dist/rag/ragIntegration.js +0 -8
- package/dist/tasks/tools/taskTools.d.ts +2 -117
- package/dist/tasks/tools/taskTools.js +1 -10
- package/dist/types/aliases.d.ts +1 -1
- package/dist/types/conversation.d.ts +17 -0
- package/dist/types/evaluation.d.ts +1 -5
- package/dist/types/evaluation.js +0 -4
- package/dist/types/generate.d.ts +2 -22
- package/dist/types/guardrails.d.ts +1 -1
- package/dist/types/middleware.d.ts +8 -3
- package/dist/types/providers.d.ts +2 -1
- package/dist/types/rag.d.ts +1 -1
- package/dist/types/rag.js +0 -6
- package/dist/types/stream.d.ts +2 -11
- package/dist/types/tools.d.ts +2 -1
- package/dist/utils/generation.d.ts +8 -0
- package/dist/utils/generation.js +8 -0
- package/dist/utils/generationErrors.d.ts +10 -0
- package/dist/utils/generationErrors.js +10 -0
- package/dist/utils/messageBuilder.d.ts +1 -6
- package/dist/utils/messageBuilder.js +0 -5
- package/dist/utils/noOutputSentinel.d.ts +0 -13
- package/dist/utils/noOutputSentinel.js +1 -14
- package/dist/utils/providerRetry.js +1 -1
- package/dist/utils/tool.d.ts +8 -0
- package/dist/utils/tool.js +8 -0
- package/dist/utils/toolCallRepair.d.ts +1 -16
- package/dist/utils/toolCallRepair.js +1 -16
- package/dist/utils/toolChoice.d.ts +1 -1
- package/dist/utils/videoAnalysisProcessor.d.ts +1 -8
- package/dist/utils/videoAnalysisProcessor.js +0 -7
- package/package.json +2 -3
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in agent tools for TaskManager.
|
|
3
|
-
*
|
|
4
|
-
* These tools allow the AI to self-schedule, manage, and inspect tasks
|
|
5
|
-
* during conversations. Created per-instance via `createTaskTools()` factory,
|
|
6
|
-
* following the same pattern as `createFileTools()` in files/fileTools.ts.
|
|
7
|
-
*
|
|
8
|
-
* @module tasks/tools/taskTools
|
|
9
|
-
*/
|
|
10
1
|
import type { TaskManager } from "../taskManager.js";
|
|
11
|
-
import type {
|
|
2
|
+
import type { Tool } from "../../types/index.js";
|
|
12
3
|
/**
|
|
13
4
|
* Create task management tools bound to a TaskManager instance.
|
|
14
5
|
*
|
|
@@ -26,110 +17,4 @@ import type { TaskSchedule } from "../../types/index.js";
|
|
|
26
17
|
* // tools.createTask, tools.listTasks, tools.getTaskRuns, etc.
|
|
27
18
|
* ```
|
|
28
19
|
*/
|
|
29
|
-
export declare function createTaskTools(manager: TaskManager):
|
|
30
|
-
createTask: import("ai").Tool<{
|
|
31
|
-
name: string;
|
|
32
|
-
prompt: string;
|
|
33
|
-
schedule: {
|
|
34
|
-
type: "once" | "cron" | "interval";
|
|
35
|
-
expression?: string | undefined;
|
|
36
|
-
timezone?: string | undefined;
|
|
37
|
-
every?: number | undefined;
|
|
38
|
-
at?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
mode?: "isolated" | "continuation" | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
success: boolean;
|
|
43
|
-
taskId: string;
|
|
44
|
-
name: string;
|
|
45
|
-
status: import("../../index.js").TaskStatus;
|
|
46
|
-
mode: import("../../index.js").TaskExecutionMode;
|
|
47
|
-
nextRunAt: string | undefined;
|
|
48
|
-
schedule: TaskSchedule;
|
|
49
|
-
error?: undefined;
|
|
50
|
-
} | {
|
|
51
|
-
success: boolean;
|
|
52
|
-
error: string;
|
|
53
|
-
taskId?: undefined;
|
|
54
|
-
name?: undefined;
|
|
55
|
-
status?: undefined;
|
|
56
|
-
mode?: undefined;
|
|
57
|
-
nextRunAt?: undefined;
|
|
58
|
-
schedule?: undefined;
|
|
59
|
-
}>;
|
|
60
|
-
listTasks: import("ai").Tool<{
|
|
61
|
-
status?: "failed" | "pending" | "completed" | "cancelled" | "active" | "paused" | undefined;
|
|
62
|
-
}, {
|
|
63
|
-
success: boolean;
|
|
64
|
-
count: number;
|
|
65
|
-
tasks: {
|
|
66
|
-
taskId: string;
|
|
67
|
-
name: string;
|
|
68
|
-
status: import("../../index.js").TaskStatus;
|
|
69
|
-
mode: import("../../index.js").TaskExecutionMode;
|
|
70
|
-
schedule: TaskSchedule;
|
|
71
|
-
runCount: number;
|
|
72
|
-
lastRunAt: string | undefined;
|
|
73
|
-
nextRunAt: string | undefined;
|
|
74
|
-
}[];
|
|
75
|
-
error?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
success: boolean;
|
|
78
|
-
error: string;
|
|
79
|
-
count?: undefined;
|
|
80
|
-
tasks?: undefined;
|
|
81
|
-
}>;
|
|
82
|
-
getTaskRuns: import("ai").Tool<{
|
|
83
|
-
taskId: string;
|
|
84
|
-
limit?: number | undefined;
|
|
85
|
-
}, {
|
|
86
|
-
success: boolean;
|
|
87
|
-
taskId: string;
|
|
88
|
-
count: number;
|
|
89
|
-
runs: {
|
|
90
|
-
runId: string;
|
|
91
|
-
status: "error" | "success";
|
|
92
|
-
output: string | undefined;
|
|
93
|
-
durationMs: number;
|
|
94
|
-
timestamp: string;
|
|
95
|
-
error: string | undefined;
|
|
96
|
-
}[];
|
|
97
|
-
error?: undefined;
|
|
98
|
-
} | {
|
|
99
|
-
success: boolean;
|
|
100
|
-
error: string;
|
|
101
|
-
taskId?: undefined;
|
|
102
|
-
count?: undefined;
|
|
103
|
-
runs?: undefined;
|
|
104
|
-
}>;
|
|
105
|
-
deleteTask: import("ai").Tool<{
|
|
106
|
-
taskId: string;
|
|
107
|
-
}, {
|
|
108
|
-
success: boolean;
|
|
109
|
-
error: string;
|
|
110
|
-
deletedTask?: undefined;
|
|
111
|
-
taskId?: undefined;
|
|
112
|
-
} | {
|
|
113
|
-
success: boolean;
|
|
114
|
-
deletedTask: string;
|
|
115
|
-
taskId: string;
|
|
116
|
-
error?: undefined;
|
|
117
|
-
}>;
|
|
118
|
-
runTaskNow: import("ai").Tool<{
|
|
119
|
-
taskId: string;
|
|
120
|
-
}, {
|
|
121
|
-
success: boolean;
|
|
122
|
-
runId: string;
|
|
123
|
-
status: "error" | "success";
|
|
124
|
-
output: string | undefined;
|
|
125
|
-
durationMs: number;
|
|
126
|
-
error: string | undefined;
|
|
127
|
-
} | {
|
|
128
|
-
success: boolean;
|
|
129
|
-
error: string;
|
|
130
|
-
runId?: undefined;
|
|
131
|
-
status?: undefined;
|
|
132
|
-
output?: undefined;
|
|
133
|
-
durationMs?: undefined;
|
|
134
|
-
}>;
|
|
135
|
-
};
|
|
20
|
+
export declare function createTaskTools(manager: TaskManager): Record<string, Tool>;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in agent tools for TaskManager.
|
|
3
|
-
*
|
|
4
|
-
* These tools allow the AI to self-schedule, manage, and inspect tasks
|
|
5
|
-
* during conversations. Created per-instance via `createTaskTools()` factory,
|
|
6
|
-
* following the same pattern as `createFileTools()` in files/fileTools.ts.
|
|
7
|
-
*
|
|
8
|
-
* @module tasks/tools/taskTools
|
|
9
|
-
*/
|
|
10
|
-
import { tool } from "ai";
|
|
11
1
|
import { z } from "zod";
|
|
12
2
|
import { logger } from "../../utils/logger.js";
|
|
13
3
|
import { TaskError } from "../errors.js";
|
|
4
|
+
import { tool } from "../../utils/tool.js";
|
|
14
5
|
/**
|
|
15
6
|
* Parse a schedule object from tool input.
|
|
16
7
|
* Accepts: { type: "cron", expression } | { type: "interval", every } | { type: "once", at }
|
package/dist/types/aliases.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Centralizes commonly used complex types to improve readability and maintainability
|
|
4
4
|
*/
|
|
5
5
|
import type { ZodTypeAny } from "zod";
|
|
6
|
-
import type { Schema } from "ai";
|
|
7
6
|
import type { JsonValue, Result, AsyncFunction } from "./common.js";
|
|
8
7
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
8
|
+
import type { Schema } from "./tools.js";
|
|
9
9
|
/**
|
|
10
10
|
* Type alias for complex Zod schema type to improve readability
|
|
11
11
|
* Used across providers and validation systems
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
*/
|
|
35
35
|
import type { HippocampusMemory, HippocampusStorageConfig } from "./memory.js";
|
|
36
36
|
import type { ObservabilityConfig } from "./observability.js";
|
|
37
|
+
export type { ModelMessage, SystemModelMessage, UserModelMessage, AssistantModelMessage, ToolModelMessage, TextPart, ImagePart, FilePart, ToolCallPart, ToolResultPart, AssistantContent, UserContent, ToolContent, DataContent, } from "ai";
|
|
37
38
|
/**
|
|
38
39
|
* Legacy public alias for the Hippocampus storage configuration.
|
|
39
40
|
* The structural definition lives in `./memory.ts`; this re-export keeps
|
|
@@ -544,3 +545,19 @@ export type ProviderDetails = {
|
|
|
544
545
|
provider: string;
|
|
545
546
|
model: string;
|
|
546
547
|
};
|
|
548
|
+
/**
|
|
549
|
+
* Reduced ChatMessage shape used by callers (typically tests and history
|
|
550
|
+
* reconstructors) that pass synthetic entries into the Gemini history
|
|
551
|
+
* reconstructor without filling every `ChatMessage` field. Mirrors the
|
|
552
|
+
* fields actually read by `prependConversationMessages`.
|
|
553
|
+
*/
|
|
554
|
+
export type MinimalChatMessage = {
|
|
555
|
+
role: ChatMessage["role"];
|
|
556
|
+
content: string;
|
|
557
|
+
tool?: string;
|
|
558
|
+
args?: Record<string, unknown>;
|
|
559
|
+
metadata?: {
|
|
560
|
+
stepIndex?: number;
|
|
561
|
+
thoughtSignature?: string;
|
|
562
|
+
};
|
|
563
|
+
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Evaluation type definitions for NeuroLink
|
|
3
|
-
* Provider performance tracking, evaluation configurations, and provider optimization types
|
|
4
|
-
*/
|
|
5
|
-
import type { LanguageModelV3CallOptions } from "@ai-sdk/provider";
|
|
6
1
|
import type { TokenUsage } from "./analytics.js";
|
|
7
2
|
import type { GenerateResult } from "./generate.js";
|
|
8
3
|
import type { ToolExecution } from "./tools.js";
|
|
9
4
|
import type { JsonObject } from "./common.js";
|
|
10
5
|
import type { AggregatedScores, EvaluationTraceContext, PipelineConfig, ReportConfig, ReportFormat, ScoreResult, ScorerInput } from "./scorer.js";
|
|
6
|
+
import type { LanguageModelV3CallOptions } from "./middleware.js";
|
|
11
7
|
/**
|
|
12
8
|
* Evaluation provider type as specified in core module refactoring
|
|
13
9
|
*/
|
package/dist/types/evaluation.js
CHANGED
package/dist/types/generate.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Schema, Tool, ToolChoice, StepResult, LanguageModel } from "ai";
|
|
2
1
|
import type { AIProviderName } from "../constants/enums.js";
|
|
3
2
|
import type { RAGConfig } from "./rag.js";
|
|
4
3
|
import type { AnalyticsData, TokenUsage } from "./analytics.js";
|
|
@@ -17,6 +16,8 @@ import type { StandardRecord, ValidationSchema, ZodUnknownSchema } from "./alias
|
|
|
17
16
|
import type { NeurolinkCredentials } from "./providers.js";
|
|
18
17
|
import type { FileWithMetadata } from "./file.js";
|
|
19
18
|
import type { WorkflowConfig } from "./workflow.js";
|
|
19
|
+
import type { Schema, Tool, ToolChoice } from "./tools.js";
|
|
20
|
+
import type { StepResult, LanguageModel } from "./providers.js";
|
|
20
21
|
/**
|
|
21
22
|
* Generate function options type - Primary method for content generation
|
|
22
23
|
* Supports multimodal content while maintaining backward compatibility
|
|
@@ -467,17 +468,6 @@ export type GenerateOptions = {
|
|
|
467
468
|
* callers can correlate generation traces back to their own request lifecycle.
|
|
468
469
|
*/
|
|
469
470
|
requestId?: string;
|
|
470
|
-
/**
|
|
471
|
-
* File reference registry for on-demand file processing.
|
|
472
|
-
*
|
|
473
|
-
* When set, files above the "tiny" size tier (>10KB) will be registered
|
|
474
|
-
* as lightweight references instead of being fully loaded into the prompt.
|
|
475
|
-
* The LLM can then access file content on-demand via file tools
|
|
476
|
-
* (list_attached_files, read_file_section, search_in_file).
|
|
477
|
-
*
|
|
478
|
-
* @internal Set by NeuroLink SDK — not typically used directly by consumers.
|
|
479
|
-
*/
|
|
480
|
-
fileRegistry?: unknown;
|
|
481
471
|
/** Per-call middleware configuration. */
|
|
482
472
|
middleware?: MiddlewareFactoryOptions;
|
|
483
473
|
/** Callback invoked when generation completes successfully. */
|
|
@@ -988,16 +978,6 @@ export type TextGenerationOptions = {
|
|
|
988
978
|
includeHeaders?: boolean;
|
|
989
979
|
};
|
|
990
980
|
enableSummarization?: boolean;
|
|
991
|
-
/**
|
|
992
|
-
* File reference registry for on-demand file processing (internal).
|
|
993
|
-
*
|
|
994
|
-
* When set, files above the "tiny" size tier (>10KB) will be registered
|
|
995
|
-
* as lightweight references instead of being fully loaded into the prompt.
|
|
996
|
-
* The LLM can then access file content on-demand via file tools.
|
|
997
|
-
*
|
|
998
|
-
* @internal Set by NeuroLink SDK — not typically used directly by consumers.
|
|
999
|
-
*/
|
|
1000
|
-
fileRegistry?: unknown;
|
|
1001
981
|
/**
|
|
1002
982
|
* Skip injecting tool schemas into the system prompt.
|
|
1003
983
|
* When true, tools are ONLY passed natively via the provider's `tools` parameter,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type { LanguageModelMiddleware } from "ai";
|
|
2
1
|
import type { JsonValue } from "../types/common.js";
|
|
3
2
|
import type { EvaluationData, GetPromptFunction } from "./evaluation.js";
|
|
4
3
|
import type { AuthenticatedUser, RouteDefinition, ServerContext } from "./server.js";
|
|
4
|
+
import type { LanguageModelMiddleware as BaseLanguageModelMiddleware } from "ai";
|
|
5
|
+
export type { LanguageModelMiddleware } from "ai";
|
|
6
|
+
export type { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3Message, LanguageModelV3StreamPart, LanguageModelV3ToolCall, LanguageModelV3ToolChoice, LanguageModelV3Source, LanguageModelV3Middleware, JSONSchema7, } from "@ai-sdk/provider";
|
|
7
|
+
import type { LanguageModelV3 } from "@ai-sdk/provider";
|
|
8
|
+
export type LanguageModelV3GenerateResult = Awaited<ReturnType<LanguageModelV3["doGenerate"]>>;
|
|
9
|
+
export type LanguageModelV3StreamResult = Awaited<ReturnType<LanguageModelV3["doStream"]>>;
|
|
5
10
|
/**
|
|
6
11
|
* Metadata type for NeuroLink middleware
|
|
7
12
|
* Provides additional information about middleware without affecting execution
|
|
@@ -24,7 +29,7 @@ export type NeuroLinkMiddlewareMetadata = {
|
|
|
24
29
|
* NeuroLink middleware with metadata
|
|
25
30
|
* Combines standard AI SDK middleware with NeuroLink-specific metadata
|
|
26
31
|
*/
|
|
27
|
-
export type NeuroLinkMiddleware =
|
|
32
|
+
export type NeuroLinkMiddleware = BaseLanguageModelMiddleware & {
|
|
28
33
|
/** Middleware metadata */
|
|
29
34
|
readonly metadata: NeuroLinkMiddlewareMetadata;
|
|
30
35
|
};
|
|
@@ -192,7 +197,7 @@ export type MiddlewareRegistryEntry = {
|
|
|
192
197
|
/**
|
|
193
198
|
* Middleware factory function type
|
|
194
199
|
*/
|
|
195
|
-
export type MiddlewareFactory = (config: Record<string, unknown>) =>
|
|
200
|
+
export type MiddlewareFactory = (config: Record<string, unknown>) => BaseLanguageModelMiddleware;
|
|
196
201
|
/**
|
|
197
202
|
* Middleware validation result
|
|
198
203
|
*/
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
import type { UnknownRecord, JsonValue, StreamingCapability } from "./common.js";
|
|
5
5
|
import type { ProviderError } from "./errors.js";
|
|
6
6
|
import { AIProviderName, AnthropicModels, BedrockModels, DeepSeekModels, GoogleAIModels, LlamaCppModels, LMStudioModels, NvidiaNimModels, OpenAIModels, VertexModels } from "../constants/enums.js";
|
|
7
|
-
import type { Tool } from "ai";
|
|
8
7
|
import type { ValidationSchema } from "./aliases.js";
|
|
9
8
|
import type { EnhancedGenerateResult, GenerateResult, TextGenerationOptions } from "./generate.js";
|
|
10
9
|
import type { StreamOptions, StreamResult } from "./stream.js";
|
|
11
10
|
import type { ExternalMCPToolInfo } from "./externalMcp.js";
|
|
12
11
|
import type { ClaudeSubscriptionTier, AnthropicAuthMethod, AnthropicAuthConfig, SubscriptionInfo, OAuthToken } from "./subscription.js";
|
|
12
|
+
import type { Tool } from "./tools.js";
|
|
13
|
+
export type { LanguageModel, EmbeddingModel, ImageModel, GenerateTextResult, StepResult, ToolCallRepairFunction, PrepareStepFunction, PrepareStepResult, FinishReason, LanguageModelUsage, LanguageModelRequestMetadata, LanguageModelResponseMetadata, } from "ai";
|
|
13
14
|
export type { ClaudeSubscriptionTier, AnthropicAuthMethod, AnthropicAuthConfig, SubscriptionInfo, } from "./subscription.js";
|
|
14
15
|
/**
|
|
15
16
|
* Generic AI SDK model interface
|
package/dist/types/rag.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Tool } from "./tools.js";
|
|
1
2
|
/**
|
|
2
3
|
* RAG Type Definitions
|
|
3
4
|
*
|
|
@@ -525,7 +526,6 @@ export type RAGCircuitBreakerEvents = {
|
|
|
525
526
|
timestamp: Date;
|
|
526
527
|
}];
|
|
527
528
|
};
|
|
528
|
-
import type { Tool } from "ai";
|
|
529
529
|
/** Prepared RAG tool ready for injection into generate/stream. */
|
|
530
530
|
export type RAGPreparedTool = {
|
|
531
531
|
/** The tool to inject into the tools Record */
|
package/dist/types/rag.js
CHANGED
package/dist/types/stream.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { LanguageModel, StepResult, Tool, ToolChoice } from "ai";
|
|
2
1
|
import type { AIProviderName } from "../constants/enums.js";
|
|
3
2
|
import type { EvaluationData } from "./evaluation.js";
|
|
4
3
|
import type { RAGConfig } from "./rag.js";
|
|
@@ -16,6 +15,8 @@ import type { STTOptions, STTResult } from "./stt.js";
|
|
|
16
15
|
import type { StandardRecord, ValidationSchema } from "./aliases.js";
|
|
17
16
|
import type { FileWithMetadata } from "./file.js";
|
|
18
17
|
import type { WorkflowConfig } from "./workflow.js";
|
|
18
|
+
import type { LanguageModel, StepResult } from "./providers.js";
|
|
19
|
+
import type { Tool, ToolChoice } from "./tools.js";
|
|
19
20
|
/**
|
|
20
21
|
* Progress tracking and metadata for streaming operations
|
|
21
22
|
*/
|
|
@@ -433,16 +434,6 @@ export type StreamOptions = {
|
|
|
433
434
|
* ```
|
|
434
435
|
*/
|
|
435
436
|
rag?: RAGConfig;
|
|
436
|
-
/**
|
|
437
|
-
* File reference registry for on-demand file processing (internal).
|
|
438
|
-
*
|
|
439
|
-
* When set, files above the "tiny" size tier (>10KB) will be registered
|
|
440
|
-
* as lightweight references instead of being fully loaded into the prompt.
|
|
441
|
-
* The LLM can then access file content on-demand via file tools.
|
|
442
|
-
*
|
|
443
|
-
* @internal Set by NeuroLink SDK — not typically used directly by consumers.
|
|
444
|
-
*/
|
|
445
|
-
fileRegistry?: unknown;
|
|
446
437
|
/** BZ-1341: Override fallback provider name (takes precedence over env/model config). */
|
|
447
438
|
fallbackProvider?: string;
|
|
448
439
|
/** BZ-1341: Override fallback model name (takes precedence over env/model config). */
|
package/dist/types/tools.d.ts
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* argument patterns, execution metadata, context, and result types.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import type { Tool } from "ai";
|
|
7
6
|
import type { ErrorInfo, JsonObject, JsonValue, Result, UnknownRecord } from "./common.js";
|
|
8
7
|
import type { StandardRecord, StringArray, ZodUnknownSchema } from "./aliases.js";
|
|
9
8
|
import type { ValidationError } from "../utils/parameterValidation.js";
|
|
10
9
|
import type { MCPToolAnnotations } from "./mcp.js";
|
|
11
10
|
import type { Logger } from "./utilities.js";
|
|
12
11
|
import type { HITLExecutionState } from "./hitl.js";
|
|
12
|
+
import type { Tool } from "ai";
|
|
13
|
+
export type { Tool, ToolSet, ToolChoice, ToolCallOptions, ToolExecuteFunction, ToolApprovalRequest, ToolApprovalResponse, InferToolInput, InferToolOutput, Schema, FlexibleSchema, InferSchema, } from "ai";
|
|
13
14
|
/**
|
|
14
15
|
* Commonly used Zod schema type aliases for cleaner type declarations
|
|
15
16
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generation, streaming, embedding, and middleware-composition primitives.
|
|
3
|
+
*
|
|
4
|
+
* Today these resolve through the upstream generation library; this file is
|
|
5
|
+
* the only internal source so the implementation can be replaced without
|
|
6
|
+
* touching call sites.
|
|
7
|
+
*/
|
|
8
|
+
export { generateText, streamText, generateObject, streamObject, embed, embedMany, wrapLanguageModel, experimental_transcribe, } from "ai";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generation, streaming, embedding, and middleware-composition primitives.
|
|
3
|
+
*
|
|
4
|
+
* Today these resolve through the upstream generation library; this file is
|
|
5
|
+
* the only internal source so the implementation can be replaced without
|
|
6
|
+
* touching call sites.
|
|
7
|
+
*/
|
|
8
|
+
export { generateText, streamText, generateObject, streamObject, embed, embedMany, wrapLanguageModel, experimental_transcribe, } from "ai";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error classes surfaced by the generation pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Used with `.isInstance(e)` checks and instanceof guards in retry,
|
|
5
|
+
* tool-call repair, and stream handling. Today these resolve through the
|
|
6
|
+
* upstream generation library; this file is the only internal source so the
|
|
7
|
+
* implementation can be replaced without touching call sites.
|
|
8
|
+
*/
|
|
9
|
+
export { NoOutputGeneratedError, NoObjectGeneratedError, NoSuchToolError, InvalidToolInputError, } from "ai";
|
|
10
|
+
export { APICallError } from "@ai-sdk/provider";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error classes surfaced by the generation pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Used with `.isInstance(e)` checks and instanceof guards in retry,
|
|
5
|
+
* tool-call repair, and stream handling. Today these resolve through the
|
|
6
|
+
* upstream generation library; this file is the only internal source so the
|
|
7
|
+
* implementation can be replaced without touching call sites.
|
|
8
|
+
*/
|
|
9
|
+
export { NoOutputGeneratedError, NoObjectGeneratedError, NoSuchToolError, InvalidToolInputError, } from "ai";
|
|
10
|
+
export { APICallError } from "@ai-sdk/provider";
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Message Builder Utility
|
|
3
|
-
* Centralized logic for building message arrays from TextGenerationOptions
|
|
4
|
-
* Enhanced with multimodal support for images
|
|
5
|
-
*/
|
|
6
|
-
import type { ModelMessage } from "ai";
|
|
7
1
|
import type { GenerateOptions, MultimodalChatMessage, StreamOptions, TextGenerationOptions } from "../types/index.js";
|
|
2
|
+
import type { ModelMessage } from "../types/index.js";
|
|
8
3
|
/**
|
|
9
4
|
* Type-safe conversion from MultimodalChatMessage[] to ModelMessage[]
|
|
10
5
|
* Filters out invalid content and ensures strict ModelMessage contract compliance
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Message Builder Utility
|
|
3
|
-
* Centralized logic for building message arrays from TextGenerationOptions
|
|
4
|
-
* Enhanced with multimodal support for images
|
|
5
|
-
*/
|
|
6
1
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
7
2
|
import { getGlobalDispatcher, interceptors, request } from "undici";
|
|
8
3
|
import { MultimodalLogger, ProviderImageAdapter, } from "../adapters/providerImageAdapter.js";
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Curator P3-6: shared builder for the `NoOutputGeneratedError` sentinel
|
|
3
|
-
* chunk. Each provider's stream-transformation generator catches the AI
|
|
4
|
-
* SDK's `NoOutputGeneratedError` and yields this sentinel so downstream
|
|
5
|
-
* telemetry has finish reason + token usage + provider error context
|
|
6
|
-
* instead of just `{ noOutput: true, errorType: "..." }`.
|
|
7
|
-
*
|
|
8
|
-
* The AI SDK rejects `result.finishReason` / `result.totalUsage` in this
|
|
9
|
-
* branch today (see `ai/src/generate-text/stream-text.ts` ~L1078); we
|
|
10
|
-
* still attempt to await them so a future SDK version surfacing partial
|
|
11
|
-
* values populates the sentinel automatically. When they reject we keep
|
|
12
|
-
* conservative defaults (`finishReason: "error"`, zero usage).
|
|
13
|
-
*/
|
|
14
1
|
import type { StreamNoOutputSentinel, StreamNoOutputSentinelResultLike } from "../types/index.js";
|
|
15
2
|
export declare function buildNoOutputSentinel(error: unknown, result?: StreamNoOutputSentinelResultLike,
|
|
16
3
|
/**
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Curator P3-6: shared builder for the `NoOutputGeneratedError` sentinel
|
|
3
|
-
* chunk. Each provider's stream-transformation generator catches the AI
|
|
4
|
-
* SDK's `NoOutputGeneratedError` and yields this sentinel so downstream
|
|
5
|
-
* telemetry has finish reason + token usage + provider error context
|
|
6
|
-
* instead of just `{ noOutput: true, errorType: "..." }`.
|
|
7
|
-
*
|
|
8
|
-
* The AI SDK rejects `result.finishReason` / `result.totalUsage` in this
|
|
9
|
-
* branch today (see `ai/src/generate-text/stream-text.ts` ~L1078); we
|
|
10
|
-
* still attempt to await them so a future SDK version surfacing partial
|
|
11
|
-
* values populates the sentinel automatically. When they reject we keep
|
|
12
|
-
* conservative defaults (`finishReason: "error"`, zero usage).
|
|
13
|
-
*/
|
|
14
|
-
import { NoOutputGeneratedError } from "ai";
|
|
15
1
|
import { trace, context as otelContext } from "@opentelemetry/api";
|
|
2
|
+
import { NoOutputGeneratedError } from "./generationErrors.js";
|
|
16
3
|
export async function buildNoOutputSentinel(error, result,
|
|
17
4
|
/**
|
|
18
5
|
* Reviewer follow-up: AI SDK v6 wraps the AI SDK's
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @module utils/providerRetry
|
|
15
15
|
*/
|
|
16
|
-
import { APICallError } from "@ai-sdk/provider";
|
|
17
16
|
import { logger } from "./logger.js";
|
|
17
|
+
import { APICallError } from "./generationErrors.js";
|
|
18
18
|
/** Maximum number of retry attempts after the initial call (total = 1 + MAX_PROVIDER_RETRIES). */
|
|
19
19
|
export const MAX_PROVIDER_RETRIES = 2;
|
|
20
20
|
/** Base delay in ms for exponential backoff between retries. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool definition helpers + structured-output spec.
|
|
3
|
+
*
|
|
4
|
+
* Today these resolve through the upstream generation library; this file is
|
|
5
|
+
* the only internal source for them so the implementation can be replaced
|
|
6
|
+
* without touching call sites.
|
|
7
|
+
*/
|
|
8
|
+
export { tool, jsonSchema, Output, stepCountIs } from "ai";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool definition helpers + structured-output spec.
|
|
3
|
+
*
|
|
4
|
+
* Today these resolve through the upstream generation library; this file is
|
|
5
|
+
* the only internal source for them so the implementation can be replaced
|
|
6
|
+
* without touching call sites.
|
|
7
|
+
*/
|
|
8
|
+
export { tool, jsonSchema, Output, stepCountIs } from "ai";
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Schema-Driven Tool Call Repair (BZ-665)
|
|
3
|
-
*
|
|
4
|
-
* Implements `experimental_repairToolCall` for the Vercel AI SDK.
|
|
5
|
-
* When an LLM sends a wrong tool name or wrong parameter names,
|
|
6
|
-
* this module attempts deterministic, schema-driven repair:
|
|
7
|
-
*
|
|
8
|
-
* 1. Tool name: case-insensitive → substring → Levenshtein
|
|
9
|
-
* 2. Param names: compare against JSON schema properties dynamically
|
|
10
|
-
* 3. Type coercion: string→number, JSON string→object/array per schema
|
|
11
|
-
*
|
|
12
|
-
* Zero static alias maps. The tool's JSON schema is the only source of truth.
|
|
13
|
-
*
|
|
14
|
-
* @module utils/toolCallRepair
|
|
15
|
-
*/
|
|
16
|
-
import type { ToolCallRepairFunction, ToolSet } from "ai";
|
|
1
|
+
import type { ToolCallRepairFunction, ToolSet } from "../types/index.js";
|
|
17
2
|
/**
|
|
18
3
|
* Create an `experimental_repairToolCall` handler for streamText/generateText.
|
|
19
4
|
* Fully dynamic — reads the tool schema at repair time, no configuration needed.
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schema-Driven Tool Call Repair (BZ-665)
|
|
3
|
-
*
|
|
4
|
-
* Implements `experimental_repairToolCall` for the Vercel AI SDK.
|
|
5
|
-
* When an LLM sends a wrong tool name or wrong parameter names,
|
|
6
|
-
* this module attempts deterministic, schema-driven repair:
|
|
7
|
-
*
|
|
8
|
-
* 1. Tool name: case-insensitive → substring → Levenshtein
|
|
9
|
-
* 2. Param names: compare against JSON schema properties dynamically
|
|
10
|
-
* 3. Type coercion: string→number, JSON string→object/array per schema
|
|
11
|
-
*
|
|
12
|
-
* Zero static alias maps. The tool's JSON schema is the only source of truth.
|
|
13
|
-
*
|
|
14
|
-
* @module utils/toolCallRepair
|
|
15
|
-
*/
|
|
16
1
|
import { logger } from "./logger.js";
|
|
17
2
|
/**
|
|
18
3
|
* Create an `experimental_repairToolCall` handler for streamText/generateText.
|
|
@@ -21,7 +6,7 @@ import { logger } from "./logger.js";
|
|
|
21
6
|
export function createToolCallRepair() {
|
|
22
7
|
return async ({ toolCall, tools, inputSchema, error }) => {
|
|
23
8
|
// Import error classes lazily to avoid circular deps at module level
|
|
24
|
-
const { NoSuchToolError: NoSuchTool, InvalidToolInputError: InvalidInput } = await import("
|
|
9
|
+
const { NoSuchToolError: NoSuchTool, InvalidToolInputError: InvalidInput } = await import("./generationErrors.js");
|
|
25
10
|
if (NoSuchTool.isInstance(error)) {
|
|
26
11
|
return repairToolName(toolCall, Object.keys(tools));
|
|
27
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool, ToolChoice } from "
|
|
1
|
+
import type { Tool, ToolChoice } from "../types/index.js";
|
|
2
2
|
export declare function resolveToolChoice(options: {
|
|
3
3
|
toolChoice?: ToolChoice<Record<string, Tool>>;
|
|
4
4
|
}, tools: Record<string, Tool> | undefined, shouldUseTools: boolean): ToolChoice<Record<string, Tool>> | "none";
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Video Analysis Processor
|
|
3
|
-
*
|
|
4
|
-
* Formats video analysis results into human-readable text
|
|
5
|
-
*
|
|
6
|
-
* @module utils/videoAnalysisProcessor
|
|
7
|
-
*/
|
|
8
|
-
import type { ModelMessage } from "ai";
|
|
9
1
|
import { AIProviderName } from "../constants/enums.js";
|
|
2
|
+
import type { ModelMessage } from "../types/index.js";
|
|
10
3
|
/**
|
|
11
4
|
* Check if messages contain video frames (images)
|
|
12
5
|
* Only checks user messages to match buildContentParts behavior
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.65.
|
|
3
|
+
"version": "9.65.2",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "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 applications with 21+ providers: OpenAI, Anthropic, Google AI Studio, Google Vertex, AWS Bedrock, Azure OpenAI, Mistral, LiteLLM, SageMaker, Hugging Face, Ollama, OpenAI-compatible, OpenRouter, DeepSeek, NVIDIA NIM, LM Studio, llama.cpp, plus voice (OpenAI TTS, ElevenLabs, Deepgram, Azure Speech).",
|
|
6
6
|
"author": {
|
|
@@ -274,7 +274,6 @@
|
|
|
274
274
|
"jose": "^6.1.3",
|
|
275
275
|
"json-schema-to-zod": "^2.7.0",
|
|
276
276
|
"nanoid": "^5.1.5",
|
|
277
|
-
"ollama-ai-provider": "^1.2.0",
|
|
278
277
|
"open": "^11.0.0",
|
|
279
278
|
"ora": "^9.3.0",
|
|
280
279
|
"p-limit": "^7.3.0",
|
|
@@ -339,6 +338,7 @@
|
|
|
339
338
|
"@changesets/changelog-github": "^0.6.0",
|
|
340
339
|
"@changesets/cli": "^2.29.8",
|
|
341
340
|
"@eslint/js": "^10.0.1",
|
|
341
|
+
"@juspay/hippocampus": "^0.1.6",
|
|
342
342
|
"@opentelemetry/api": "^1.9.0",
|
|
343
343
|
"@opentelemetry/sdk-trace-base": "^2.6.0",
|
|
344
344
|
"@opentelemetry/sdk-trace-node": "^2.6.0",
|
|
@@ -357,7 +357,6 @@
|
|
|
357
357
|
"@types/cors": "^2.8.19",
|
|
358
358
|
"@types/express": "^5.0.6",
|
|
359
359
|
"@types/fluent-ffmpeg": "^2.1.28",
|
|
360
|
-
"@juspay/hippocampus": "^0.1.6",
|
|
361
360
|
"@types/inquirer": "^9.0.9",
|
|
362
361
|
"@types/js-yaml": "^4.0.9",
|
|
363
362
|
"@types/koa": "^3.0.1",
|