@aigne/core 1.60.2 → 1.60.3

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.60.3](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.60.2...core-v1.60.3) (2025-09-18)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **models:** convert local image to base64 for image model ([#517](https://github.com/AIGNE-io/aigne-framework/issues/517)) ([c0bc971](https://github.com/AIGNE-io/aigne-framework/commit/c0bc971087ef6e1caa641a699aed391a24feb40d))
9
+ * **models:** convert local image to base64 for image model ([#517](https://github.com/AIGNE-io/aigne-framework/issues/517)) ([c0bc971](https://github.com/AIGNE-io/aigne-framework/commit/c0bc971087ef6e1caa641a699aed391a24feb40d))
10
+
3
11
  ## [1.60.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.60.1...core-v1.60.2) (2025-09-11)
4
12
 
5
13
 
@@ -15,6 +15,7 @@ export declare abstract class ImageModel<I extends ImageModelInput = ImageModelI
15
15
  protected preprocess(input: I, options: AgentInvokeOptions): Promise<void>;
16
16
  protected postprocess(input: I, output: O, options: AgentInvokeOptions): Promise<void>;
17
17
  abstract process(input: I, options: AgentInvokeOptions): PromiseOrValue<AgentProcessResult<O>>;
18
+ protected downloadFile(url: string, timeout?: number): Promise<Response>;
18
19
  }
19
20
  export interface ImageModelInput extends Message {
20
21
  model?: string;
@@ -34,6 +34,21 @@ class ImageModel extends agent_js_1.Agent {
34
34
  options.context.usage.aigneHubCredits += usage.aigneHubCredits;
35
35
  }
36
36
  }
37
+ async downloadFile(url, timeout = 30000) {
38
+ const controller = new AbortController();
39
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
40
+ try {
41
+ const response = await fetch(url, { signal: controller.signal });
42
+ if (!response.ok) {
43
+ const text = await response.text().catch(() => null);
44
+ throw new Error(`Failed to download content from ${url}, ${response.status} ${response.statusText} ${text}`);
45
+ }
46
+ return response;
47
+ }
48
+ finally {
49
+ clearTimeout(timeoutId);
50
+ }
51
+ }
37
52
  }
38
53
  exports.ImageModel = ImageModel;
39
54
  exports.imageModelInputSchema = zod_1.z.object({
@@ -239,7 +239,7 @@ class ClientWithReconnect extends index_js_2.Client {
239
239
  super(info, options);
240
240
  this.reconnectOptions = reconnectOptions;
241
241
  }
242
- shouldReconnect(error) {
242
+ shouldReconnect({ error }) {
243
243
  const { transportCreator, shouldReconnect, maxReconnects } = this.reconnectOptions || {};
244
244
  if (!transportCreator || maxReconnects === 0)
245
245
  return false;
@@ -15,6 +15,7 @@ export declare abstract class ImageModel<I extends ImageModelInput = ImageModelI
15
15
  protected preprocess(input: I, options: AgentInvokeOptions): Promise<void>;
16
16
  protected postprocess(input: I, output: O, options: AgentInvokeOptions): Promise<void>;
17
17
  abstract process(input: I, options: AgentInvokeOptions): PromiseOrValue<AgentProcessResult<O>>;
18
+ protected downloadFile(url: string, timeout?: number): Promise<Response>;
18
19
  }
19
20
  export interface ImageModelInput extends Message {
20
21
  model?: string;
@@ -15,6 +15,7 @@ export declare abstract class ImageModel<I extends ImageModelInput = ImageModelI
15
15
  protected preprocess(input: I, options: AgentInvokeOptions): Promise<void>;
16
16
  protected postprocess(input: I, output: O, options: AgentInvokeOptions): Promise<void>;
17
17
  abstract process(input: I, options: AgentInvokeOptions): PromiseOrValue<AgentProcessResult<O>>;
18
+ protected downloadFile(url: string, timeout?: number): Promise<Response>;
18
19
  }
19
20
  export interface ImageModelInput extends Message {
20
21
  model?: string;
@@ -31,6 +31,21 @@ export class ImageModel extends Agent {
31
31
  options.context.usage.aigneHubCredits += usage.aigneHubCredits;
32
32
  }
33
33
  }
34
+ async downloadFile(url, timeout = 30000) {
35
+ const controller = new AbortController();
36
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
37
+ try {
38
+ const response = await fetch(url, { signal: controller.signal });
39
+ if (!response.ok) {
40
+ const text = await response.text().catch(() => null);
41
+ throw new Error(`Failed to download content from ${url}, ${response.status} ${response.statusText} ${text}`);
42
+ }
43
+ return response;
44
+ }
45
+ finally {
46
+ clearTimeout(timeoutId);
47
+ }
48
+ }
34
49
  }
35
50
  export const imageModelInputSchema = z.object({
36
51
  model: z.string().optional(),
@@ -202,7 +202,7 @@ class ClientWithReconnect extends Client {
202
202
  super(info, options);
203
203
  this.reconnectOptions = reconnectOptions;
204
204
  }
205
- shouldReconnect(error) {
205
+ shouldReconnect({ error }) {
206
206
  const { transportCreator, shouldReconnect, maxReconnects } = this.reconnectOptions || {};
207
207
  if (!transportCreator || maxReconnects === 0)
208
208
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "1.60.2",
3
+ "version": "1.60.3",
4
4
  "description": "The functional core of agentic AI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -66,48 +66,48 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@aigne/json-schema-to-zod": "^1.3.3",
69
- "@inquirer/prompts": "^7.8.4",
70
- "@modelcontextprotocol/sdk": "^1.15.0",
69
+ "@inquirer/prompts": "^7.8.6",
70
+ "@modelcontextprotocol/sdk": "^1.18.0",
71
71
  "@opentelemetry/api": "^1.9.0",
72
- "@opentelemetry/sdk-trace-base": "^2.0.1",
72
+ "@opentelemetry/sdk-trace-base": "^2.1.0",
73
73
  "@types/debug": "^4.1.12",
74
74
  "ajv": "^8.17.1",
75
75
  "camelize-ts": "^3.0.0",
76
76
  "content-type": "^1.0.5",
77
- "debug": "^4.4.1",
78
- "eventsource-parser": "^3.0.3",
77
+ "debug": "^4.4.3",
78
+ "eventsource-parser": "^3.0.6",
79
79
  "fast-deep-equal": "^3.1.3",
80
80
  "fastq": "^1.19.1",
81
- "immer": "^10.1.1",
82
- "is-network-error": "^1.1.0",
81
+ "immer": "^10.1.3",
82
+ "is-network-error": "^1.2.0",
83
83
  "jaison": "^2.0.2",
84
- "jsonata": "^2.0.6",
85
- "mime": "^4.0.7",
84
+ "jsonata": "^2.1.0",
85
+ "mime": "^4.1.0",
86
86
  "nunjucks": "^3.2.4",
87
- "p-retry": "^6.2.1",
88
- "raw-body": "^3.0.0",
87
+ "p-retry": "^7.0.0",
88
+ "raw-body": "^3.0.1",
89
89
  "strict-event-emitter": "^0.5.1",
90
90
  "ufo": "^1.6.1",
91
- "uuid": "^11.1.0",
92
- "yaml": "^2.8.0",
91
+ "uuid": "^13.0.0",
92
+ "yaml": "^2.8.1",
93
93
  "zod": "^3.25.67",
94
94
  "zod-to-json-schema": "^3.24.6",
95
- "@aigne/platform-helpers": "^0.6.2",
96
- "@aigne/observability-api": "^0.10.4"
95
+ "@aigne/observability-api": "^0.10.4",
96
+ "@aigne/platform-helpers": "^0.6.2"
97
97
  },
98
98
  "devDependencies": {
99
- "@types/bun": "^1.2.18",
99
+ "@types/bun": "^1.2.22",
100
100
  "@types/compression": "^1.8.1",
101
101
  "@types/content-type": "^1.1.9",
102
102
  "@types/express": "^5.0.3",
103
- "@types/node": "^24.0.12",
103
+ "@types/node": "^24.5.1",
104
104
  "@types/nunjucks": "^3.2.6",
105
- "compression": "^1.8.0",
105
+ "compression": "^1.8.1",
106
106
  "detect-port": "^2.1.0",
107
107
  "express": "^5.1.0",
108
108
  "npm-run-all": "^4.1.5",
109
109
  "rimraf": "^6.0.1",
110
- "typescript": "^5.8.3"
110
+ "typescript": "^5.9.2"
111
111
  },
112
112
  "scripts": {
113
113
  "lint": "tsc --noEmit",