@synova-cloud/sdk 1.3.1 → 1.5.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/dist/index.cjs CHANGED
@@ -73,7 +73,7 @@ var NetworkSynovaError = class extends SynovaError {
73
73
  };
74
74
 
75
75
  // src/version.ts
76
- var SDK_VERSION = "1.3.1" ;
76
+ var SDK_VERSION = "1.5.0" ;
77
77
 
78
78
  // src/utils/http.ts
79
79
  var HttpClient = class {
package/dist/index.d.cts CHANGED
@@ -2,6 +2,23 @@ type TSynovaMessageRole = 'system' | 'user' | 'assistant' | 'tool';
2
2
  type TSynovaResponseType = 'message' | 'tool_calls' | 'image' | 'audio' | 'error';
3
3
  type TSynovaModelType = 'text' | 'image';
4
4
  type TSynovaUsageType = 'tokens' | 'images' | 'time';
5
+ type TSynovaJsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
6
+ interface ISynovaJsonSchema {
7
+ /** Schema type */
8
+ type?: TSynovaJsonSchemaType;
9
+ /** Description of the field */
10
+ description?: string;
11
+ /** Allowed values (for enum-like fields) */
12
+ enum?: (string | number | boolean | null)[];
13
+ /** Schema for array items (when type='array') */
14
+ items?: ISynovaJsonSchema;
15
+ /** Object properties (when type='object') */
16
+ properties?: Record<string, ISynovaJsonSchema>;
17
+ /** Required property names (when type='object') */
18
+ required?: string[];
19
+ /** Whether additional properties are allowed (when type='object') */
20
+ additionalProperties?: boolean;
21
+ }
5
22
  interface ISynovaLogger {
6
23
  debug: (message: string, ...args: unknown[]) => void;
7
24
  info: (message: string, ...args: unknown[]) => void;
@@ -100,7 +117,7 @@ interface ISynovaExecuteOptions {
100
117
  /** Model parameters (temperature, maxTokens, topP, topK, etc.) */
101
118
  parameters?: Record<string, unknown>;
102
119
  /** JSON Schema for structured output */
103
- responseSchema?: Record<string, unknown>;
120
+ responseSchema?: ISynovaJsonSchema;
104
121
  }
105
122
  interface ISynovaExecutionUsage {
106
123
  /** Usage type: 'tokens' for LLM, 'images' for image generation, 'time' for time-based billing */
@@ -118,13 +135,40 @@ interface ISynovaExecutionUsage {
118
135
  /** Prediction time in seconds (when type='time') */
119
136
  predictTimeSeconds?: number;
120
137
  }
138
+ interface ISynovaProviderResponse {
139
+ /** HTTP status code from the LLM provider */
140
+ statusCode?: number;
141
+ /** Error message from the LLM provider */
142
+ message?: string;
143
+ }
144
+ interface ISynovaExecutionErrorDetails {
145
+ /** Model used for the execution */
146
+ model?: string;
147
+ /** API key ID used for the execution */
148
+ apiKeyId?: string;
149
+ /** API key label (human-readable name) */
150
+ apiKeyLabel?: string;
151
+ /** Prompt ID (if execution was via prompt) */
152
+ promptId?: string;
153
+ /** Prompt version (if execution was via prompt) */
154
+ promptVersion?: string;
155
+ /** Execution log ID for debugging */
156
+ executionLogId?: string;
157
+ /** Input tokens count (for CONTEXT_TOO_LONG errors) */
158
+ inputTokens?: number;
159
+ /** Model context window limit (for CONTEXT_TOO_LONG errors) */
160
+ contextLimit?: number;
161
+ }
121
162
  interface ISynovaExecutionError {
122
163
  code: string;
123
164
  message: string;
124
165
  provider?: string;
125
166
  retryable: boolean;
126
167
  retryAfterMs?: number;
127
- details?: unknown;
168
+ /** Raw response from the LLM provider's API */
169
+ providerResponse?: ISynovaProviderResponse;
170
+ /** Our context details */
171
+ details?: ISynovaExecutionErrorDetails;
128
172
  }
129
173
  interface ISynovaFileThumbnails {
130
174
  /** Small thumbnail URL (120px width) */
@@ -720,4 +764,4 @@ declare class NetworkSynovaError extends SynovaError {
720
764
  constructor(message: string, cause?: Error);
721
765
  }
722
766
 
723
- export { ApiSynovaError, AuthSynovaError, type ISynovaAzureConfig, type ISynovaConfig, type ISynovaCreateLlmProviderKeyOptions, type ISynovaExecuteOptions, type ISynovaExecuteResponse, type ISynovaExecutionError, type ISynovaExecutionUsage, type ISynovaFileAttachment, type ISynovaFileThumbnails, type ISynovaGetPromptOptions, type ISynovaListModelsOptions, type ISynovaLlmProviderKey, type ISynovaLlmProviderKeyListResponse, type ISynovaLogger, type ISynovaMessage, type ISynovaModel, type ISynovaModelCapabilities, type ISynovaModelLimits, type ISynovaModelPricing, type ISynovaModelsResponse, type ISynovaPrompt, type ISynovaPromptVariable, type ISynovaProvider, type ISynovaRetryConfig, type ISynovaToolCall, type ISynovaToolResult, type ISynovaUploadOptions, type ISynovaUploadResponse, type ISynovaUploadedFile, NetworkSynovaError, NotFoundSynovaError, RateLimitSynovaError, ServerSynovaError, SynovaCloudSdk, SynovaError, type TSynovaLlmProvider, type TSynovaMessageRole, type TSynovaModelType, type TSynovaResponseType, type TSynovaRetryStrategy, type TSynovaUsageType, TimeoutSynovaError };
767
+ export { ApiSynovaError, AuthSynovaError, type ISynovaAzureConfig, type ISynovaConfig, type ISynovaCreateLlmProviderKeyOptions, type ISynovaExecuteOptions, type ISynovaExecuteResponse, type ISynovaExecutionError, type ISynovaExecutionErrorDetails, type ISynovaExecutionUsage, type ISynovaFileAttachment, type ISynovaFileThumbnails, type ISynovaGetPromptOptions, type ISynovaListModelsOptions, type ISynovaLlmProviderKey, type ISynovaLlmProviderKeyListResponse, type ISynovaLogger, type ISynovaMessage, type ISynovaModel, type ISynovaModelCapabilities, type ISynovaModelLimits, type ISynovaModelPricing, type ISynovaModelsResponse, type ISynovaPrompt, type ISynovaPromptVariable, type ISynovaProvider, type ISynovaProviderResponse, type ISynovaRetryConfig, type ISynovaToolCall, type ISynovaToolResult, type ISynovaUploadOptions, type ISynovaUploadResponse, type ISynovaUploadedFile, NetworkSynovaError, NotFoundSynovaError, RateLimitSynovaError, ServerSynovaError, SynovaCloudSdk, SynovaError, type TSynovaLlmProvider, type TSynovaMessageRole, type TSynovaModelType, type TSynovaResponseType, type TSynovaRetryStrategy, type TSynovaUsageType, TimeoutSynovaError };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,23 @@ type TSynovaMessageRole = 'system' | 'user' | 'assistant' | 'tool';
2
2
  type TSynovaResponseType = 'message' | 'tool_calls' | 'image' | 'audio' | 'error';
3
3
  type TSynovaModelType = 'text' | 'image';
4
4
  type TSynovaUsageType = 'tokens' | 'images' | 'time';
5
+ type TSynovaJsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
6
+ interface ISynovaJsonSchema {
7
+ /** Schema type */
8
+ type?: TSynovaJsonSchemaType;
9
+ /** Description of the field */
10
+ description?: string;
11
+ /** Allowed values (for enum-like fields) */
12
+ enum?: (string | number | boolean | null)[];
13
+ /** Schema for array items (when type='array') */
14
+ items?: ISynovaJsonSchema;
15
+ /** Object properties (when type='object') */
16
+ properties?: Record<string, ISynovaJsonSchema>;
17
+ /** Required property names (when type='object') */
18
+ required?: string[];
19
+ /** Whether additional properties are allowed (when type='object') */
20
+ additionalProperties?: boolean;
21
+ }
5
22
  interface ISynovaLogger {
6
23
  debug: (message: string, ...args: unknown[]) => void;
7
24
  info: (message: string, ...args: unknown[]) => void;
@@ -100,7 +117,7 @@ interface ISynovaExecuteOptions {
100
117
  /** Model parameters (temperature, maxTokens, topP, topK, etc.) */
101
118
  parameters?: Record<string, unknown>;
102
119
  /** JSON Schema for structured output */
103
- responseSchema?: Record<string, unknown>;
120
+ responseSchema?: ISynovaJsonSchema;
104
121
  }
105
122
  interface ISynovaExecutionUsage {
106
123
  /** Usage type: 'tokens' for LLM, 'images' for image generation, 'time' for time-based billing */
@@ -118,13 +135,40 @@ interface ISynovaExecutionUsage {
118
135
  /** Prediction time in seconds (when type='time') */
119
136
  predictTimeSeconds?: number;
120
137
  }
138
+ interface ISynovaProviderResponse {
139
+ /** HTTP status code from the LLM provider */
140
+ statusCode?: number;
141
+ /** Error message from the LLM provider */
142
+ message?: string;
143
+ }
144
+ interface ISynovaExecutionErrorDetails {
145
+ /** Model used for the execution */
146
+ model?: string;
147
+ /** API key ID used for the execution */
148
+ apiKeyId?: string;
149
+ /** API key label (human-readable name) */
150
+ apiKeyLabel?: string;
151
+ /** Prompt ID (if execution was via prompt) */
152
+ promptId?: string;
153
+ /** Prompt version (if execution was via prompt) */
154
+ promptVersion?: string;
155
+ /** Execution log ID for debugging */
156
+ executionLogId?: string;
157
+ /** Input tokens count (for CONTEXT_TOO_LONG errors) */
158
+ inputTokens?: number;
159
+ /** Model context window limit (for CONTEXT_TOO_LONG errors) */
160
+ contextLimit?: number;
161
+ }
121
162
  interface ISynovaExecutionError {
122
163
  code: string;
123
164
  message: string;
124
165
  provider?: string;
125
166
  retryable: boolean;
126
167
  retryAfterMs?: number;
127
- details?: unknown;
168
+ /** Raw response from the LLM provider's API */
169
+ providerResponse?: ISynovaProviderResponse;
170
+ /** Our context details */
171
+ details?: ISynovaExecutionErrorDetails;
128
172
  }
129
173
  interface ISynovaFileThumbnails {
130
174
  /** Small thumbnail URL (120px width) */
@@ -720,4 +764,4 @@ declare class NetworkSynovaError extends SynovaError {
720
764
  constructor(message: string, cause?: Error);
721
765
  }
722
766
 
723
- export { ApiSynovaError, AuthSynovaError, type ISynovaAzureConfig, type ISynovaConfig, type ISynovaCreateLlmProviderKeyOptions, type ISynovaExecuteOptions, type ISynovaExecuteResponse, type ISynovaExecutionError, type ISynovaExecutionUsage, type ISynovaFileAttachment, type ISynovaFileThumbnails, type ISynovaGetPromptOptions, type ISynovaListModelsOptions, type ISynovaLlmProviderKey, type ISynovaLlmProviderKeyListResponse, type ISynovaLogger, type ISynovaMessage, type ISynovaModel, type ISynovaModelCapabilities, type ISynovaModelLimits, type ISynovaModelPricing, type ISynovaModelsResponse, type ISynovaPrompt, type ISynovaPromptVariable, type ISynovaProvider, type ISynovaRetryConfig, type ISynovaToolCall, type ISynovaToolResult, type ISynovaUploadOptions, type ISynovaUploadResponse, type ISynovaUploadedFile, NetworkSynovaError, NotFoundSynovaError, RateLimitSynovaError, ServerSynovaError, SynovaCloudSdk, SynovaError, type TSynovaLlmProvider, type TSynovaMessageRole, type TSynovaModelType, type TSynovaResponseType, type TSynovaRetryStrategy, type TSynovaUsageType, TimeoutSynovaError };
767
+ export { ApiSynovaError, AuthSynovaError, type ISynovaAzureConfig, type ISynovaConfig, type ISynovaCreateLlmProviderKeyOptions, type ISynovaExecuteOptions, type ISynovaExecuteResponse, type ISynovaExecutionError, type ISynovaExecutionErrorDetails, type ISynovaExecutionUsage, type ISynovaFileAttachment, type ISynovaFileThumbnails, type ISynovaGetPromptOptions, type ISynovaListModelsOptions, type ISynovaLlmProviderKey, type ISynovaLlmProviderKeyListResponse, type ISynovaLogger, type ISynovaMessage, type ISynovaModel, type ISynovaModelCapabilities, type ISynovaModelLimits, type ISynovaModelPricing, type ISynovaModelsResponse, type ISynovaPrompt, type ISynovaPromptVariable, type ISynovaProvider, type ISynovaProviderResponse, type ISynovaRetryConfig, type ISynovaToolCall, type ISynovaToolResult, type ISynovaUploadOptions, type ISynovaUploadResponse, type ISynovaUploadedFile, NetworkSynovaError, NotFoundSynovaError, RateLimitSynovaError, ServerSynovaError, SynovaCloudSdk, SynovaError, type TSynovaLlmProvider, type TSynovaMessageRole, type TSynovaModelType, type TSynovaResponseType, type TSynovaRetryStrategy, type TSynovaUsageType, TimeoutSynovaError };
package/dist/index.js CHANGED
@@ -71,7 +71,7 @@ var NetworkSynovaError = class extends SynovaError {
71
71
  };
72
72
 
73
73
  // src/version.ts
74
- var SDK_VERSION = "1.3.1" ;
74
+ var SDK_VERSION = "1.5.0" ;
75
75
 
76
76
  // src/utils/http.ts
77
77
  var HttpClient = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synova-cloud/sdk",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "Official Node.js SDK for Synova Cloud API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",