@aigne/aigne-hub 0.10.5-beta → 0.10.5-beta.1
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 +28 -0
- package/lib/cjs/utils/blocklet.js +2 -1
- package/lib/cjs/utils/hub.js +3 -8
- package/lib/esm/utils/blocklet.js +1 -0
- package/lib/esm/utils/hub.js +2 -7
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.5-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.10.5-beta...aigne-hub-v0.10.5-beta.1) (2025-11-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add fetch utility with timeout and enhanced error handling ([#694](https://github.com/AIGNE-io/aigne-framework/issues/694)) ([c2d4076](https://github.com/AIGNE-io/aigne-framework/commit/c2d4076ec590150d2751591a4f723721f78381e9))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/anthropic bumped to 0.14.5-beta.1
|
|
16
|
+
* @aigne/bedrock bumped to 0.10.10-beta.1
|
|
17
|
+
* @aigne/core bumped to 1.65.1-beta.1
|
|
18
|
+
* @aigne/deepseek bumped to 0.7.51-beta.1
|
|
19
|
+
* @aigne/doubao bumped to 1.1.5-beta.1
|
|
20
|
+
* @aigne/gemini bumped to 0.14.5-beta.1
|
|
21
|
+
* @aigne/ideogram bumped to 0.4.5-beta.1
|
|
22
|
+
* @aigne/ollama bumped to 0.7.51-beta.1
|
|
23
|
+
* @aigne/open-router bumped to 0.7.51-beta.1
|
|
24
|
+
* @aigne/openai bumped to 0.16.5-beta.1
|
|
25
|
+
* @aigne/poe bumped to 1.0.31-beta.1
|
|
26
|
+
* @aigne/transport bumped to 0.15.14-beta.1
|
|
27
|
+
* @aigne/xai bumped to 0.7.51-beta.1
|
|
28
|
+
* devDependencies
|
|
29
|
+
* @aigne/test-utils bumped to 0.5.58-beta.1
|
|
30
|
+
|
|
3
31
|
## [0.10.5-beta](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.10.4...aigne-hub-v0.10.5-beta) (2025-11-03)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAIGNEHubMountPoint = getAIGNEHubMountPoint;
|
|
4
|
+
const fetch_js_1 = require("@aigne/core/utils/fetch.js");
|
|
4
5
|
const ufo_1 = require("ufo");
|
|
5
6
|
async function getAIGNEHubMountPoint(url, component) {
|
|
6
7
|
const { origin } = new URL(url);
|
|
7
8
|
const BLOCKLET_JSON_PATH = "__blocklet__.js?type=json";
|
|
8
|
-
const blockletInfo = await fetch((0, ufo_1.joinURL)(origin, BLOCKLET_JSON_PATH));
|
|
9
|
+
const blockletInfo = await (0, fetch_js_1.fetch)((0, ufo_1.joinURL)(origin, BLOCKLET_JSON_PATH));
|
|
9
10
|
const blocklet = await blockletInfo.json();
|
|
10
11
|
const comp = (blocklet?.componentMountPoints || []).find((m) => m.did === component);
|
|
11
12
|
if (!comp)
|
package/lib/cjs/utils/hub.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getModels = getModels;
|
|
4
|
+
const fetch_js_1 = require("@aigne/core/utils/fetch.js");
|
|
4
5
|
const ufo_1 = require("ufo");
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
const blocklet_js_1 = require("./blocklet.js");
|
|
@@ -21,15 +22,9 @@ const modelsSchema = zod_1.z.array(zod_1.z.object({
|
|
|
21
22
|
}));
|
|
22
23
|
async function getModels(options) {
|
|
23
24
|
const url = await (0, blocklet_js_1.getAIGNEHubMountPoint)(options.baseURL || (0, constants_js_1.aigneHubBaseUrl)(), constants_js_1.AIGNE_HUB_BLOCKLET_DID);
|
|
24
|
-
const response = await fetch((0, ufo_1.withQuery)((0, ufo_1.joinURL)(url, "/api/ai/models"), {
|
|
25
|
+
const response = await (0, fetch_js_1.fetch)((0, ufo_1.withQuery)((0, ufo_1.joinURL)(url, "/api/ai/models"), {
|
|
25
26
|
type: options.type,
|
|
26
27
|
}));
|
|
27
|
-
|
|
28
|
-
const text = await response.text().catch(() => "");
|
|
29
|
-
throw new Error(`Failed to fetch models: ${response.status} ${response.statusText} ${text}`);
|
|
30
|
-
}
|
|
31
|
-
const json = await response.json().catch((error) => {
|
|
32
|
-
throw new Error(`Failed to parse response as JSON from ${url}: ${error.message}`);
|
|
33
|
-
});
|
|
28
|
+
const json = await response.json();
|
|
34
29
|
return modelsSchema.parse(json);
|
|
35
30
|
}
|
package/lib/esm/utils/hub.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetch } from "@aigne/core/utils/fetch.js";
|
|
1
2
|
import { joinURL, withQuery } from "ufo";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { getAIGNEHubMountPoint } from "./blocklet.js";
|
|
@@ -21,12 +22,6 @@ export async function getModels(options) {
|
|
|
21
22
|
const response = await fetch(withQuery(joinURL(url, "/api/ai/models"), {
|
|
22
23
|
type: options.type,
|
|
23
24
|
}));
|
|
24
|
-
|
|
25
|
-
const text = await response.text().catch(() => "");
|
|
26
|
-
throw new Error(`Failed to fetch models: ${response.status} ${response.statusText} ${text}`);
|
|
27
|
-
}
|
|
28
|
-
const json = await response.json().catch((error) => {
|
|
29
|
-
throw new Error(`Failed to parse response as JSON from ${url}: ${error.message}`);
|
|
30
|
-
});
|
|
25
|
+
const json = await response.json();
|
|
31
26
|
return modelsSchema.parse(json);
|
|
32
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/aigne-hub",
|
|
3
|
-
"version": "0.10.5-beta",
|
|
3
|
+
"version": "0.10.5-beta.1",
|
|
4
4
|
"description": "AIGNE Hub SDK for integrating with Hub AI models",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"https-proxy-agent": "^7.0.6",
|
|
40
40
|
"ufo": "^1.6.1",
|
|
41
41
|
"zod": "^3.25.67",
|
|
42
|
-
"@aigne/anthropic": "^0.14.5-beta",
|
|
43
|
-
"@aigne/bedrock": "^0.10.10-beta",
|
|
44
|
-
"@aigne/
|
|
45
|
-
"@aigne/
|
|
46
|
-
"@aigne/doubao": "^1.1.5-beta",
|
|
47
|
-
"@aigne/gemini": "^0.14.5-beta",
|
|
48
|
-
"@aigne/ideogram": "^0.4.5-beta",
|
|
49
|
-
"@aigne/open-router": "^0.7.51-beta",
|
|
50
|
-
"@aigne/ollama": "^0.7.51-beta",
|
|
51
|
-
"@aigne/openai": "^0.16.5-beta",
|
|
42
|
+
"@aigne/anthropic": "^0.14.5-beta.1",
|
|
43
|
+
"@aigne/bedrock": "^0.10.10-beta.1",
|
|
44
|
+
"@aigne/core": "^1.65.1-beta.1",
|
|
45
|
+
"@aigne/deepseek": "^0.7.51-beta.1",
|
|
46
|
+
"@aigne/doubao": "^1.1.5-beta.1",
|
|
47
|
+
"@aigne/gemini": "^0.14.5-beta.1",
|
|
48
|
+
"@aigne/ideogram": "^0.4.5-beta.1",
|
|
49
|
+
"@aigne/open-router": "^0.7.51-beta.1",
|
|
50
|
+
"@aigne/ollama": "^0.7.51-beta.1",
|
|
51
|
+
"@aigne/openai": "^0.16.5-beta.1",
|
|
52
52
|
"@aigne/platform-helpers": "^0.6.3",
|
|
53
|
-
"@aigne/poe": "^1.0.31-beta",
|
|
54
|
-
"@aigne/transport": "^0.15.14-beta",
|
|
55
|
-
"@aigne/xai": "^0.7.51-beta"
|
|
53
|
+
"@aigne/poe": "^1.0.31-beta.1",
|
|
54
|
+
"@aigne/transport": "^0.15.14-beta.1",
|
|
55
|
+
"@aigne/xai": "^0.7.51-beta.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/bun": "^1.2.22",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"npm-run-all": "^4.1.5",
|
|
62
62
|
"rimraf": "^6.0.1",
|
|
63
63
|
"typescript": "^5.9.2",
|
|
64
|
-
"@aigne/test-utils": "^0.5.58-beta"
|
|
64
|
+
"@aigne/test-utils": "^0.5.58-beta.1"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"lint": "tsc --noEmit",
|