@juspay/neurolink 7.48.0 → 7.49.0
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 +15 -0
- package/README.md +177 -784
- package/dist/agent/directTools.d.ts +55 -0
- package/dist/agent/directTools.js +266 -0
- package/dist/cli/factories/commandFactory.d.ts +2 -0
- package/dist/cli/factories/commandFactory.js +130 -16
- package/dist/cli/index.js +0 -0
- package/dist/cli/loop/conversationSelector.d.ts +45 -0
- package/dist/cli/loop/conversationSelector.js +222 -0
- package/dist/cli/loop/optionsSchema.d.ts +1 -1
- package/dist/cli/loop/session.d.ts +36 -8
- package/dist/cli/loop/session.js +257 -61
- package/dist/core/baseProvider.js +9 -2
- package/dist/core/evaluation.js +5 -2
- package/dist/factories/providerRegistry.js +2 -2
- package/dist/lib/agent/directTools.d.ts +55 -0
- package/dist/lib/agent/directTools.js +266 -0
- package/dist/lib/core/baseProvider.js +9 -2
- package/dist/lib/core/evaluation.js +5 -2
- package/dist/lib/factories/providerRegistry.js +2 -2
- package/dist/lib/mcp/factory.d.ts +2 -157
- package/dist/lib/mcp/flexibleToolValidator.d.ts +1 -5
- package/dist/lib/mcp/index.d.ts +3 -2
- package/dist/lib/mcp/mcpCircuitBreaker.d.ts +1 -75
- package/dist/lib/mcp/mcpClientFactory.d.ts +1 -20
- package/dist/lib/mcp/mcpClientFactory.js +1 -0
- package/dist/lib/mcp/registry.d.ts +3 -10
- package/dist/lib/mcp/servers/agent/directToolsServer.d.ts +1 -1
- package/dist/lib/mcp/servers/aiProviders/aiCoreServer.d.ts +1 -1
- package/dist/lib/mcp/servers/utilities/utilityServer.d.ts +1 -1
- package/dist/lib/mcp/toolDiscoveryService.d.ts +3 -84
- package/dist/lib/mcp/toolRegistry.d.ts +2 -24
- package/dist/lib/middleware/builtin/guardrails.d.ts +5 -16
- package/dist/lib/middleware/builtin/guardrails.js +44 -39
- package/dist/lib/middleware/utils/guardrailsUtils.d.ts +64 -0
- package/dist/lib/middleware/utils/guardrailsUtils.js +387 -0
- package/dist/lib/neurolink.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +46 -3
- package/dist/lib/providers/azureOpenai.js +8 -2
- package/dist/lib/providers/googleAiStudio.js +8 -2
- package/dist/lib/providers/googleVertex.js +11 -2
- package/dist/lib/providers/huggingFace.js +1 -1
- package/dist/lib/providers/litellm.js +1 -1
- package/dist/lib/providers/mistral.js +1 -1
- package/dist/lib/providers/openAI.js +46 -3
- package/dist/lib/providers/sagemaker/adaptive-semaphore.d.ts +1 -13
- package/dist/lib/providers/sagemaker/client.d.ts +1 -1
- package/dist/lib/providers/sagemaker/config.d.ts +1 -1
- package/dist/lib/providers/sagemaker/detection.d.ts +1 -1
- package/dist/lib/providers/sagemaker/errors.d.ts +1 -1
- package/dist/lib/providers/sagemaker/index.d.ts +1 -1
- package/dist/lib/providers/sagemaker/language-model.d.ts +1 -1
- package/dist/lib/providers/sagemaker/parsers.d.ts +1 -1
- package/dist/lib/providers/sagemaker/streaming.d.ts +1 -1
- package/dist/lib/providers/sagemaker/structured-parser.d.ts +1 -1
- package/dist/lib/session/globalSessionState.d.ts +26 -0
- package/dist/lib/session/globalSessionState.js +49 -0
- package/dist/lib/types/cli.d.ts +28 -0
- package/dist/lib/types/content.d.ts +18 -5
- package/dist/lib/types/contextTypes.d.ts +1 -1
- package/dist/lib/types/conversation.d.ts +55 -4
- package/dist/lib/types/fileTypes.d.ts +65 -0
- package/dist/lib/types/fileTypes.js +4 -0
- package/dist/lib/types/generateTypes.d.ts +12 -0
- package/dist/lib/types/guardrails.d.ts +103 -0
- package/dist/lib/types/guardrails.js +1 -0
- package/dist/lib/types/index.d.ts +4 -2
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/types/mcpTypes.d.ts +407 -14
- package/dist/lib/types/providers.d.ts +469 -0
- package/dist/lib/types/streamTypes.d.ts +7 -0
- package/dist/lib/types/tools.d.ts +132 -35
- package/dist/lib/utils/csvProcessor.d.ts +68 -0
- package/dist/lib/utils/csvProcessor.js +277 -0
- package/dist/lib/utils/fileDetector.d.ts +57 -0
- package/dist/lib/utils/fileDetector.js +457 -0
- package/dist/lib/utils/imageProcessor.d.ts +10 -0
- package/dist/lib/utils/imageProcessor.js +22 -0
- package/dist/lib/utils/loopUtils.d.ts +71 -0
- package/dist/lib/utils/loopUtils.js +262 -0
- package/dist/lib/utils/messageBuilder.d.ts +2 -1
- package/dist/lib/utils/messageBuilder.js +197 -2
- package/dist/lib/utils/optionsUtils.d.ts +1 -1
- package/dist/mcp/factory.d.ts +2 -157
- package/dist/mcp/flexibleToolValidator.d.ts +1 -5
- package/dist/mcp/index.d.ts +3 -2
- package/dist/mcp/mcpCircuitBreaker.d.ts +1 -75
- package/dist/mcp/mcpClientFactory.d.ts +1 -20
- package/dist/mcp/mcpClientFactory.js +1 -0
- package/dist/mcp/registry.d.ts +3 -10
- package/dist/mcp/servers/agent/directToolsServer.d.ts +1 -1
- package/dist/mcp/servers/aiProviders/aiCoreServer.d.ts +1 -1
- package/dist/mcp/servers/utilities/utilityServer.d.ts +1 -1
- package/dist/mcp/toolDiscoveryService.d.ts +3 -84
- package/dist/mcp/toolRegistry.d.ts +2 -24
- package/dist/middleware/builtin/guardrails.d.ts +5 -16
- package/dist/middleware/builtin/guardrails.js +44 -39
- package/dist/middleware/utils/guardrailsUtils.d.ts +64 -0
- package/dist/middleware/utils/guardrailsUtils.js +387 -0
- package/dist/neurolink.d.ts +1 -1
- package/dist/providers/anthropic.js +46 -3
- package/dist/providers/azureOpenai.js +8 -2
- package/dist/providers/googleAiStudio.js +8 -2
- package/dist/providers/googleVertex.js +11 -2
- package/dist/providers/huggingFace.js +1 -1
- package/dist/providers/litellm.js +1 -1
- package/dist/providers/mistral.js +1 -1
- package/dist/providers/openAI.js +46 -3
- package/dist/providers/sagemaker/adaptive-semaphore.d.ts +1 -13
- package/dist/providers/sagemaker/client.d.ts +1 -1
- package/dist/providers/sagemaker/config.d.ts +1 -1
- package/dist/providers/sagemaker/detection.d.ts +1 -1
- package/dist/providers/sagemaker/errors.d.ts +1 -1
- package/dist/providers/sagemaker/index.d.ts +1 -1
- package/dist/providers/sagemaker/language-model.d.ts +3 -3
- package/dist/providers/sagemaker/parsers.d.ts +1 -1
- package/dist/providers/sagemaker/streaming.d.ts +1 -1
- package/dist/providers/sagemaker/structured-parser.d.ts +1 -1
- package/dist/session/globalSessionState.d.ts +26 -0
- package/dist/session/globalSessionState.js +49 -0
- package/dist/types/cli.d.ts +28 -0
- package/dist/types/content.d.ts +18 -5
- package/dist/types/contextTypes.d.ts +1 -1
- package/dist/types/conversation.d.ts +55 -4
- package/dist/types/fileTypes.d.ts +65 -0
- package/dist/types/fileTypes.js +4 -0
- package/dist/types/generateTypes.d.ts +12 -0
- package/dist/types/guardrails.d.ts +103 -0
- package/dist/types/guardrails.js +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js +4 -0
- package/dist/types/mcpTypes.d.ts +407 -14
- package/dist/types/modelTypes.d.ts +6 -6
- package/dist/types/providers.d.ts +469 -0
- package/dist/types/streamTypes.d.ts +7 -0
- package/dist/types/tools.d.ts +132 -35
- package/dist/utils/csvProcessor.d.ts +68 -0
- package/dist/utils/csvProcessor.js +277 -0
- package/dist/utils/fileDetector.d.ts +57 -0
- package/dist/utils/fileDetector.js +457 -0
- package/dist/utils/imageProcessor.d.ts +10 -0
- package/dist/utils/imageProcessor.js +22 -0
- package/dist/utils/loopUtils.d.ts +71 -0
- package/dist/utils/loopUtils.js +262 -0
- package/dist/utils/messageBuilder.d.ts +2 -1
- package/dist/utils/messageBuilder.js +197 -2
- package/dist/utils/optionsUtils.d.ts +1 -1
- package/package.json +9 -3
- package/dist/lib/mcp/contracts/mcpContract.d.ts +0 -106
- package/dist/lib/mcp/contracts/mcpContract.js +0 -5
- package/dist/lib/providers/sagemaker/types.d.ts +0 -456
- package/dist/lib/providers/sagemaker/types.js +0 -7
- package/dist/mcp/contracts/mcpContract.d.ts +0 -106
- package/dist/mcp/contracts/mcpContract.js +0 -5
- package/dist/providers/sagemaker/types.d.ts +0 -456
- package/dist/providers/sagemaker/types.js +0 -7
|
@@ -1,456 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript type definitions for Amazon SageMaker Provider
|
|
3
|
-
*
|
|
4
|
-
* This module contains all interfaces and types for SageMaker integration
|
|
5
|
-
* with the NeuroLink ecosystem and Vercel AI SDK compatibility.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* AWS configuration options for SageMaker client
|
|
9
|
-
*/
|
|
10
|
-
export interface SageMakerConfig {
|
|
11
|
-
/** AWS region for SageMaker service */
|
|
12
|
-
region: string;
|
|
13
|
-
/** AWS access key ID */
|
|
14
|
-
accessKeyId: string;
|
|
15
|
-
/** AWS secret access key */
|
|
16
|
-
secretAccessKey: string;
|
|
17
|
-
/** AWS session token (optional, for temporary credentials) */
|
|
18
|
-
sessionToken?: string;
|
|
19
|
-
/** Request timeout in milliseconds */
|
|
20
|
-
timeout?: number;
|
|
21
|
-
/** Maximum number of retry attempts */
|
|
22
|
-
maxRetries?: number;
|
|
23
|
-
/** Custom SageMaker endpoint URL (optional) */
|
|
24
|
-
endpoint?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Model-specific configuration for SageMaker endpoints
|
|
28
|
-
*/
|
|
29
|
-
export interface SageMakerModelConfig {
|
|
30
|
-
/** SageMaker endpoint name */
|
|
31
|
-
endpointName: string;
|
|
32
|
-
/** Model type for request/response formatting */
|
|
33
|
-
modelType?: "llama" | "mistral" | "claude" | "huggingface" | "jumpstart" | "custom";
|
|
34
|
-
/** Content type for requests */
|
|
35
|
-
contentType?: string;
|
|
36
|
-
/** Accept header for responses */
|
|
37
|
-
accept?: string;
|
|
38
|
-
/** Custom attributes for the endpoint */
|
|
39
|
-
customAttributes?: string;
|
|
40
|
-
/** Input format specification */
|
|
41
|
-
inputFormat?: "huggingface" | "jumpstart" | "custom";
|
|
42
|
-
/** Output format specification */
|
|
43
|
-
outputFormat?: "huggingface" | "jumpstart" | "custom";
|
|
44
|
-
/** Maximum tokens for generation */
|
|
45
|
-
maxTokens?: number;
|
|
46
|
-
/** Temperature parameter */
|
|
47
|
-
temperature?: number;
|
|
48
|
-
/** Top-p parameter */
|
|
49
|
-
topP?: number;
|
|
50
|
-
/** Stop sequences */
|
|
51
|
-
stopSequences?: string[];
|
|
52
|
-
/** Initial concurrency for batch processing */
|
|
53
|
-
initialConcurrency?: number;
|
|
54
|
-
/** Maximum concurrency for batch processing */
|
|
55
|
-
maxConcurrency?: number;
|
|
56
|
-
/** Minimum concurrency for batch processing */
|
|
57
|
-
minConcurrency?: number;
|
|
58
|
-
/** Maximum concurrent detection tests */
|
|
59
|
-
maxConcurrentDetectionTests?: number;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* SageMaker endpoint information and metadata
|
|
63
|
-
*/
|
|
64
|
-
export interface SageMakerEndpointInfo {
|
|
65
|
-
/** Endpoint name */
|
|
66
|
-
endpointName: string;
|
|
67
|
-
/** Endpoint ARN */
|
|
68
|
-
endpointArn: string;
|
|
69
|
-
/** Associated model name */
|
|
70
|
-
modelName: string;
|
|
71
|
-
/** EC2 instance type */
|
|
72
|
-
instanceType: string;
|
|
73
|
-
/** Endpoint creation timestamp */
|
|
74
|
-
creationTime: string;
|
|
75
|
-
/** Last modification timestamp */
|
|
76
|
-
lastModifiedTime: string;
|
|
77
|
-
/** Current endpoint status */
|
|
78
|
-
endpointStatus: "InService" | "Creating" | "Updating" | "SystemUpdating" | "RollingBack" | "Deleting" | "Failed";
|
|
79
|
-
/** Current instance count */
|
|
80
|
-
currentInstanceCount?: number;
|
|
81
|
-
/** Variant weights for A/B testing */
|
|
82
|
-
productionVariants?: Array<{
|
|
83
|
-
variantName: string;
|
|
84
|
-
modelName: string;
|
|
85
|
-
initialInstanceCount: number;
|
|
86
|
-
instanceType: string;
|
|
87
|
-
currentWeight?: number;
|
|
88
|
-
}>;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Token usage and billing information
|
|
92
|
-
*/
|
|
93
|
-
export interface SageMakerUsage {
|
|
94
|
-
/** Number of prompt tokens */
|
|
95
|
-
promptTokens: number;
|
|
96
|
-
/** Number of completion tokens */
|
|
97
|
-
completionTokens: number;
|
|
98
|
-
/** Total tokens used */
|
|
99
|
-
total: number;
|
|
100
|
-
/** Request processing time in milliseconds */
|
|
101
|
-
requestTime?: number;
|
|
102
|
-
/** Model inference time in milliseconds */
|
|
103
|
-
inferenceTime?: number;
|
|
104
|
-
/** Estimated cost in USD */
|
|
105
|
-
estimatedCost?: number;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Parameters for SageMaker endpoint invocation
|
|
109
|
-
*/
|
|
110
|
-
export interface InvokeEndpointParams {
|
|
111
|
-
/** Endpoint name to invoke */
|
|
112
|
-
EndpointName: string;
|
|
113
|
-
/** Request body as string or Uint8Array */
|
|
114
|
-
Body: string | Uint8Array;
|
|
115
|
-
/** Content type of the request */
|
|
116
|
-
ContentType?: string;
|
|
117
|
-
/** Accept header for response format */
|
|
118
|
-
Accept?: string;
|
|
119
|
-
/** Custom attributes for the request */
|
|
120
|
-
CustomAttributes?: string;
|
|
121
|
-
/** Target model for multi-model endpoints */
|
|
122
|
-
TargetModel?: string;
|
|
123
|
-
/** Target variant for A/B testing */
|
|
124
|
-
TargetVariant?: string;
|
|
125
|
-
/** Inference ID for request tracking */
|
|
126
|
-
InferenceId?: string;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Response from SageMaker endpoint invocation
|
|
130
|
-
*/
|
|
131
|
-
export interface InvokeEndpointResponse {
|
|
132
|
-
/** Response body */
|
|
133
|
-
Body?: Uint8Array;
|
|
134
|
-
/** Content type of the response */
|
|
135
|
-
ContentType?: string;
|
|
136
|
-
/** Invoked production variant */
|
|
137
|
-
InvokedProductionVariant?: string;
|
|
138
|
-
/** Custom attributes in the response */
|
|
139
|
-
CustomAttributes?: string;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Streaming response chunk from SageMaker
|
|
143
|
-
*/
|
|
144
|
-
export interface SageMakerStreamChunk {
|
|
145
|
-
/** Text content in the chunk */
|
|
146
|
-
content?: string;
|
|
147
|
-
/** Indicates if this is the final chunk */
|
|
148
|
-
done?: boolean;
|
|
149
|
-
/** Usage information (only in final chunk) */
|
|
150
|
-
usage?: SageMakerUsage;
|
|
151
|
-
/** Error information if chunk contains error */
|
|
152
|
-
error?: string;
|
|
153
|
-
/** Finish reason for generation */
|
|
154
|
-
finishReason?: "stop" | "length" | "tool-calls" | "content-filter" | "unknown";
|
|
155
|
-
/** Tool call in progress (Phase 2.3) */
|
|
156
|
-
toolCall?: SageMakerStreamingToolCall;
|
|
157
|
-
/** Tool result chunk (Phase 2.3) */
|
|
158
|
-
toolResult?: SageMakerStreamingToolResult;
|
|
159
|
-
/** Structured output streaming (Phase 2.3) */
|
|
160
|
-
structuredOutput?: SageMakerStructuredOutput;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Tool call information for function calling
|
|
164
|
-
*/
|
|
165
|
-
export interface SageMakerToolCall {
|
|
166
|
-
/** Tool call identifier */
|
|
167
|
-
id: string;
|
|
168
|
-
/** Tool/function name */
|
|
169
|
-
name: string;
|
|
170
|
-
/** Tool arguments as JSON object */
|
|
171
|
-
arguments: Record<string, unknown>;
|
|
172
|
-
/** Tool call type */
|
|
173
|
-
type: "function";
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Tool result information
|
|
177
|
-
*/
|
|
178
|
-
export interface SageMakerToolResult {
|
|
179
|
-
/** Tool call identifier */
|
|
180
|
-
toolCallId: string;
|
|
181
|
-
/** Tool name */
|
|
182
|
-
toolName: string;
|
|
183
|
-
/** Tool result data */
|
|
184
|
-
result: unknown;
|
|
185
|
-
/** Execution status */
|
|
186
|
-
status: "success" | "error";
|
|
187
|
-
/** Error message if status is error */
|
|
188
|
-
error?: string;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Streaming tool call information (Phase 2.3)
|
|
192
|
-
*/
|
|
193
|
-
export interface SageMakerStreamingToolCall {
|
|
194
|
-
/** Tool call identifier */
|
|
195
|
-
id: string;
|
|
196
|
-
/** Tool/function name */
|
|
197
|
-
name?: string;
|
|
198
|
-
/** Partial or complete arguments as JSON string */
|
|
199
|
-
arguments?: string;
|
|
200
|
-
/** Tool call type */
|
|
201
|
-
type: "function";
|
|
202
|
-
/** Indicates if this tool call is complete */
|
|
203
|
-
complete?: boolean;
|
|
204
|
-
/** Delta text for incremental argument building */
|
|
205
|
-
argumentsDelta?: string;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Streaming tool result information (Phase 2.3)
|
|
209
|
-
*/
|
|
210
|
-
export interface SageMakerStreamingToolResult {
|
|
211
|
-
/** Tool call identifier */
|
|
212
|
-
toolCallId: string;
|
|
213
|
-
/** Tool name */
|
|
214
|
-
toolName: string;
|
|
215
|
-
/** Partial or complete result data */
|
|
216
|
-
result?: unknown;
|
|
217
|
-
/** Result delta for incremental responses */
|
|
218
|
-
resultDelta?: string;
|
|
219
|
-
/** Execution status */
|
|
220
|
-
status: "pending" | "running" | "success" | "error";
|
|
221
|
-
/** Error message if status is error */
|
|
222
|
-
error?: string;
|
|
223
|
-
/** Indicates if this result is complete */
|
|
224
|
-
complete?: boolean;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Structured output streaming information (Phase 2.3)
|
|
228
|
-
*/
|
|
229
|
-
export interface SageMakerStructuredOutput {
|
|
230
|
-
/** Partial JSON object being built */
|
|
231
|
-
partialObject?: Record<string, unknown>;
|
|
232
|
-
/** JSON delta text */
|
|
233
|
-
jsonDelta?: string;
|
|
234
|
-
/** Current parsing path (e.g., "user.name") */
|
|
235
|
-
currentPath?: string;
|
|
236
|
-
/** Schema validation errors */
|
|
237
|
-
validationErrors?: string[];
|
|
238
|
-
/** Indicates if JSON is complete and valid */
|
|
239
|
-
complete?: boolean;
|
|
240
|
-
/** JSON schema being validated against */
|
|
241
|
-
schema?: Record<string, unknown>;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Enhanced generation request options
|
|
245
|
-
*/
|
|
246
|
-
export interface SageMakerGenerationOptions {
|
|
247
|
-
/** Input prompt text */
|
|
248
|
-
prompt: string;
|
|
249
|
-
/** System prompt for context */
|
|
250
|
-
systemPrompt?: string;
|
|
251
|
-
/** Maximum tokens to generate */
|
|
252
|
-
maxTokens?: number;
|
|
253
|
-
/** Temperature for randomness (0-1) */
|
|
254
|
-
temperature?: number;
|
|
255
|
-
/** Top-p nucleus sampling (0-1) */
|
|
256
|
-
topP?: number;
|
|
257
|
-
/** Top-k sampling */
|
|
258
|
-
topK?: number;
|
|
259
|
-
/** Stop sequences to end generation */
|
|
260
|
-
stopSequences?: string[];
|
|
261
|
-
/** Enable streaming response */
|
|
262
|
-
stream?: boolean;
|
|
263
|
-
/** Tools available for function calling */
|
|
264
|
-
tools?: Array<{
|
|
265
|
-
name: string;
|
|
266
|
-
description: string;
|
|
267
|
-
parameters: Record<string, unknown>;
|
|
268
|
-
}>;
|
|
269
|
-
/** Tool choice mode */
|
|
270
|
-
toolChoice?: "auto" | "none" | {
|
|
271
|
-
type: "tool";
|
|
272
|
-
name: string;
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Generation response from SageMaker
|
|
277
|
-
*/
|
|
278
|
-
export interface SageMakerGenerationResponse {
|
|
279
|
-
/** Generated text content */
|
|
280
|
-
text: string;
|
|
281
|
-
/** Token usage information */
|
|
282
|
-
usage: SageMakerUsage;
|
|
283
|
-
/** Finish reason for generation */
|
|
284
|
-
finishReason: "stop" | "length" | "tool-calls" | "content-filter" | "unknown";
|
|
285
|
-
/** Tool calls made during generation */
|
|
286
|
-
toolCalls?: SageMakerToolCall[];
|
|
287
|
-
/** Tool results if tools were executed */
|
|
288
|
-
toolResults?: SageMakerToolResult[];
|
|
289
|
-
/** Additional metadata */
|
|
290
|
-
metadata?: Record<string, unknown>;
|
|
291
|
-
/** Model version or identifier */
|
|
292
|
-
modelVersion?: string;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Error codes specific to SageMaker operations
|
|
296
|
-
*/
|
|
297
|
-
export type SageMakerErrorCode = "VALIDATION_ERROR" | "MODEL_ERROR" | "INTERNAL_ERROR" | "SERVICE_UNAVAILABLE" | "CREDENTIALS_ERROR" | "NETWORK_ERROR" | "ENDPOINT_NOT_FOUND" | "THROTTLING_ERROR" | "UNKNOWN_ERROR";
|
|
298
|
-
/**
|
|
299
|
-
* SageMaker-specific error information
|
|
300
|
-
*/
|
|
301
|
-
export interface SageMakerErrorInfo {
|
|
302
|
-
/** Error code */
|
|
303
|
-
code: SageMakerErrorCode;
|
|
304
|
-
/** Human-readable error message */
|
|
305
|
-
message: string;
|
|
306
|
-
/** HTTP status code if applicable */
|
|
307
|
-
statusCode?: number;
|
|
308
|
-
/** Original error from AWS SDK */
|
|
309
|
-
cause?: Error;
|
|
310
|
-
/** Endpoint name where error occurred */
|
|
311
|
-
endpoint?: string;
|
|
312
|
-
/** Request ID for debugging */
|
|
313
|
-
requestId?: string;
|
|
314
|
-
/** Retry suggestion */
|
|
315
|
-
retryable?: boolean;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Batch inference job configuration
|
|
319
|
-
*/
|
|
320
|
-
export interface BatchInferenceConfig {
|
|
321
|
-
/** Input S3 location */
|
|
322
|
-
inputS3Uri: string;
|
|
323
|
-
/** Output S3 location */
|
|
324
|
-
outputS3Uri: string;
|
|
325
|
-
/** SageMaker model name */
|
|
326
|
-
modelName: string;
|
|
327
|
-
/** Instance type for batch job */
|
|
328
|
-
instanceType: string;
|
|
329
|
-
/** Instance count for batch job */
|
|
330
|
-
instanceCount: number;
|
|
331
|
-
/** Maximum payload size in MB */
|
|
332
|
-
maxPayloadInMB?: number;
|
|
333
|
-
/** Batch strategy */
|
|
334
|
-
batchStrategy?: "MultiRecord" | "SingleRecord";
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Model deployment configuration
|
|
338
|
-
*/
|
|
339
|
-
export interface ModelDeploymentConfig {
|
|
340
|
-
/** Model name */
|
|
341
|
-
modelName: string;
|
|
342
|
-
/** Endpoint name */
|
|
343
|
-
endpointName: string;
|
|
344
|
-
/** EC2 instance type */
|
|
345
|
-
instanceType: string;
|
|
346
|
-
/** Initial instance count */
|
|
347
|
-
initialInstanceCount: number;
|
|
348
|
-
/** Model data S3 location */
|
|
349
|
-
modelDataUrl: string;
|
|
350
|
-
/** Container image URI */
|
|
351
|
-
image: string;
|
|
352
|
-
/** IAM execution role ARN */
|
|
353
|
-
executionRoleArn: string;
|
|
354
|
-
/** Resource tags */
|
|
355
|
-
tags?: Record<string, string>;
|
|
356
|
-
/** Auto scaling configuration */
|
|
357
|
-
autoScaling?: {
|
|
358
|
-
minCapacity: number;
|
|
359
|
-
maxCapacity: number;
|
|
360
|
-
targetValue: number;
|
|
361
|
-
scaleUpCooldown: number;
|
|
362
|
-
scaleDownCooldown: number;
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Endpoint metrics and monitoring data
|
|
367
|
-
*/
|
|
368
|
-
export interface EndpointMetrics {
|
|
369
|
-
/** Endpoint name */
|
|
370
|
-
endpointName: string;
|
|
371
|
-
/** Total invocations */
|
|
372
|
-
invocations: number;
|
|
373
|
-
/** Average latency in milliseconds */
|
|
374
|
-
averageLatency: number;
|
|
375
|
-
/** Error rate percentage */
|
|
376
|
-
errorRate: number;
|
|
377
|
-
/** CPU utilization percentage */
|
|
378
|
-
cpuUtilization?: number;
|
|
379
|
-
/** Memory utilization percentage */
|
|
380
|
-
memoryUtilization?: number;
|
|
381
|
-
/** Instance count */
|
|
382
|
-
instanceCount: number;
|
|
383
|
-
/** Timestamp of metrics */
|
|
384
|
-
timestamp: string;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Cost estimation data
|
|
388
|
-
*/
|
|
389
|
-
export interface CostEstimate {
|
|
390
|
-
/** Estimated cost in USD */
|
|
391
|
-
estimatedCost: number;
|
|
392
|
-
/** Currency code */
|
|
393
|
-
currency: string;
|
|
394
|
-
/** Cost breakdown */
|
|
395
|
-
breakdown: {
|
|
396
|
-
/** Instance hours cost */
|
|
397
|
-
instanceCost: number;
|
|
398
|
-
/** Request-based cost */
|
|
399
|
-
requestCost: number;
|
|
400
|
-
/** Total processing hours */
|
|
401
|
-
totalHours: number;
|
|
402
|
-
};
|
|
403
|
-
/** Time period for estimate */
|
|
404
|
-
period?: {
|
|
405
|
-
start: string;
|
|
406
|
-
end: string;
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* SageMaker generation result interface for better type safety
|
|
411
|
-
*/
|
|
412
|
-
export interface SageMakerGenerateResult {
|
|
413
|
-
text?: string;
|
|
414
|
-
reasoning?: string | Array<{
|
|
415
|
-
type: "text";
|
|
416
|
-
text: string;
|
|
417
|
-
signature?: string;
|
|
418
|
-
} | {
|
|
419
|
-
type: "redacted";
|
|
420
|
-
data: string;
|
|
421
|
-
}>;
|
|
422
|
-
files?: Array<{
|
|
423
|
-
data: string | Uint8Array;
|
|
424
|
-
mimeType: string;
|
|
425
|
-
}>;
|
|
426
|
-
logprobs?: Array<{
|
|
427
|
-
token: string;
|
|
428
|
-
logprob: number;
|
|
429
|
-
topLogprobs: Array<{
|
|
430
|
-
token: string;
|
|
431
|
-
logprob: number;
|
|
432
|
-
}>;
|
|
433
|
-
}>;
|
|
434
|
-
usage: {
|
|
435
|
-
promptTokens: number;
|
|
436
|
-
completionTokens: number;
|
|
437
|
-
totalTokens?: number;
|
|
438
|
-
};
|
|
439
|
-
finishReason: "stop" | "length" | "content-filter" | "tool-calls" | "error" | "unknown";
|
|
440
|
-
warnings?: Array<{
|
|
441
|
-
type: "other";
|
|
442
|
-
message: string;
|
|
443
|
-
}>;
|
|
444
|
-
rawCall: {
|
|
445
|
-
rawPrompt: unknown;
|
|
446
|
-
rawSettings: Record<string, unknown>;
|
|
447
|
-
};
|
|
448
|
-
rawResponse?: {
|
|
449
|
-
headers?: Record<string, string>;
|
|
450
|
-
};
|
|
451
|
-
request?: {
|
|
452
|
-
body?: string;
|
|
453
|
-
};
|
|
454
|
-
toolCalls?: SageMakerToolCall[];
|
|
455
|
-
object?: unknown;
|
|
456
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Contract - Core Type Definitions
|
|
3
|
-
* Industry standard camelCase interfaces for maximum flexibility
|
|
4
|
-
*/
|
|
5
|
-
import type { StandardRecord } from "../../types/typeAliases.js";
|
|
6
|
-
/**
|
|
7
|
-
* Generic execution context for MCP operations
|
|
8
|
-
* All properties optional for maximum flexibility
|
|
9
|
-
*/
|
|
10
|
-
export interface ExecutionContext<T = StandardRecord> {
|
|
11
|
-
sessionId?: string;
|
|
12
|
-
userId?: string;
|
|
13
|
-
config?: T;
|
|
14
|
-
metadata?: StandardRecord;
|
|
15
|
-
cacheOptions?: CacheOptions;
|
|
16
|
-
fallbackOptions?: FallbackOptions;
|
|
17
|
-
timeoutMs?: number;
|
|
18
|
-
startTime?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Cache configuration options
|
|
22
|
-
*/
|
|
23
|
-
export interface CacheOptions {
|
|
24
|
-
enabled?: boolean;
|
|
25
|
-
ttlMs?: number;
|
|
26
|
-
strategy?: "memory" | "writeThrough" | "cacheAside";
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Fallback configuration options
|
|
30
|
-
*/
|
|
31
|
-
export interface FallbackOptions {
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
maxAttempts?: number;
|
|
34
|
-
delayMs?: number;
|
|
35
|
-
circuitBreaker?: boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Tool information with extensibility
|
|
39
|
-
*/
|
|
40
|
-
export interface ToolInfo {
|
|
41
|
-
name: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
category?: string;
|
|
44
|
-
serverId?: string;
|
|
45
|
-
inputSchema?: StandardRecord;
|
|
46
|
-
outputSchema?: StandardRecord;
|
|
47
|
-
[key: string]: unknown;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Discovered MCP server/plugin definition
|
|
51
|
-
*/
|
|
52
|
-
export interface DiscoveredMcp<TTools = StandardRecord> {
|
|
53
|
-
metadata: McpMetadata;
|
|
54
|
-
tools?: TTools;
|
|
55
|
-
capabilities?: string[];
|
|
56
|
-
version?: string;
|
|
57
|
-
configuration?: Record<string, string | number | boolean>;
|
|
58
|
-
[key: string]: unknown;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* MCP server metadata
|
|
62
|
-
*/
|
|
63
|
-
export interface McpMetadata {
|
|
64
|
-
name: string;
|
|
65
|
-
description?: string;
|
|
66
|
-
version?: string;
|
|
67
|
-
author?: string;
|
|
68
|
-
homepage?: string;
|
|
69
|
-
repository?: string;
|
|
70
|
-
category?: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Tool execution result
|
|
74
|
-
*/
|
|
75
|
-
export interface ToolExecutionResult<T = unknown> {
|
|
76
|
-
result: T;
|
|
77
|
-
context?: ExecutionContext;
|
|
78
|
-
performance?: {
|
|
79
|
-
duration: number;
|
|
80
|
-
tokensUsed?: number;
|
|
81
|
-
cost?: number;
|
|
82
|
-
};
|
|
83
|
-
validation?: ValidationResult;
|
|
84
|
-
cached?: boolean;
|
|
85
|
-
fallback?: boolean;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Validation result for runtime checks
|
|
89
|
-
*/
|
|
90
|
-
export interface ValidationResult {
|
|
91
|
-
valid: boolean;
|
|
92
|
-
missing: string[];
|
|
93
|
-
warnings: string[];
|
|
94
|
-
recommendations: string[];
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Provider status information
|
|
98
|
-
*/
|
|
99
|
-
export interface ProviderStatus {
|
|
100
|
-
available: boolean;
|
|
101
|
-
lastCheck: number;
|
|
102
|
-
reason?: string;
|
|
103
|
-
model?: string;
|
|
104
|
-
cost?: number;
|
|
105
|
-
latencyMs?: number;
|
|
106
|
-
}
|