@aigne/aigne-hub 0.6.1 → 0.6.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/lib/cjs/blocklet-aigne-hub-model.js +3 -1
- package/lib/cjs/cli-aigne-hub-model.js +3 -1
- package/lib/cjs/util/credential.d.ts +1 -1
- package/lib/cjs/util/credential.js +6 -3
- package/lib/dts/util/credential.d.ts +1 -1
- package/lib/esm/blocklet-aigne-hub-model.js +3 -1
- package/lib/esm/cli-aigne-hub-model.js +3 -1
- package/lib/esm/util/credential.d.ts +1 -1
- package/lib/esm/util/credential.js +6 -3
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.2](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.6.1...aigne-hub-v0.6.2) (2025-08-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cli:** display only the origin URL when linking to hub ([#369](https://github.com/AIGNE-io/aigne-framework/issues/369)) ([b3baf3f](https://github.com/AIGNE-io/aigne-framework/commit/b3baf3f2c98f965d5279dd0dfb282be9f5ffb6c2))
|
|
9
|
+
* **model:** add x-aigne-hub-client-did header for hub model requests ([#371](https://github.com/AIGNE-io/aigne-framework/issues/371)) ([8c29f37](https://github.com/AIGNE-io/aigne-framework/commit/8c29f377d6ef3833723c8ec721a252171026d84d))
|
|
10
|
+
|
|
3
11
|
## [0.6.1](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.6.0...aigne-hub-v0.6.1) (2025-08-15)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -62,7 +62,9 @@ class AIGNEHubChatModel extends core_1.ChatModel {
|
|
|
62
62
|
throw new Error("Client not initialized");
|
|
63
63
|
}
|
|
64
64
|
options.fetchOptions = {
|
|
65
|
-
headers: {
|
|
65
|
+
headers: {
|
|
66
|
+
"x-aigne-hub-client-did": process.env.BLOCKLET_APP_PID || process.env.ABT_NODE_DID || "",
|
|
67
|
+
},
|
|
66
68
|
...options.fetchOptions,
|
|
67
69
|
};
|
|
68
70
|
return this.client.invoke(input, options);
|
|
@@ -48,8 +48,10 @@ class AIGNEHubChatModel extends core_1.ChatModel {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
process(input, options) {
|
|
51
|
+
const { BLOCKLET_APP_PID, ABT_NODE_DID } = process.env;
|
|
52
|
+
const clientId = BLOCKLET_APP_PID || ABT_NODE_DID || `@aigne/aigne-hub:${index_js_1.nodejs.os.hostname()}`;
|
|
51
53
|
options.fetchOptions = {
|
|
52
|
-
headers: { "x-aigne-hub-client-did":
|
|
54
|
+
headers: { "x-aigne-hub-client-did": clientId },
|
|
53
55
|
...options.fetchOptions,
|
|
54
56
|
};
|
|
55
57
|
return this.client.__invoke(undefined, input, options);
|
|
@@ -16,7 +16,7 @@ export declare function connectToAIGNEHub(url: string): Promise<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export declare const checkConnectionStatus: (host: string) => Promise<{
|
|
18
18
|
apiKey: any;
|
|
19
|
-
url:
|
|
19
|
+
url: any;
|
|
20
20
|
}>;
|
|
21
21
|
export declare function loadCredential(options?: LoadCredentialOptions): Promise<{
|
|
22
22
|
apiKey?: string;
|
|
@@ -84,7 +84,7 @@ async function getAIGNEHubMountPoint(url) {
|
|
|
84
84
|
async function connectToAIGNEHub(url) {
|
|
85
85
|
const { origin, host } = new URL(url);
|
|
86
86
|
const connectUrl = (0, ufo_1.joinURL)(origin, constants_js_1.WELLKNOWN_SERVICE_PATH_PREFIX);
|
|
87
|
-
const
|
|
87
|
+
const apiUrl = await getAIGNEHubMountPoint(url);
|
|
88
88
|
try {
|
|
89
89
|
const openFn = constants_js_1.isTest ? () => { } : open_1.default;
|
|
90
90
|
const result = await createConnect({
|
|
@@ -96,7 +96,7 @@ async function connectToAIGNEHub(url) {
|
|
|
96
96
|
});
|
|
97
97
|
const accessKeyOptions = {
|
|
98
98
|
apiKey: result.accessKeySecret,
|
|
99
|
-
url:
|
|
99
|
+
url: apiUrl,
|
|
100
100
|
};
|
|
101
101
|
// After redirection, write the AIGNE Hub access token
|
|
102
102
|
const aigneDir = index_js_1.nodejs.path.join(index_js_1.nodejs.os.homedir(), ".aigne");
|
|
@@ -140,7 +140,7 @@ const checkConnectionStatus = async (host) => {
|
|
|
140
140
|
}
|
|
141
141
|
return {
|
|
142
142
|
apiKey: env.AIGNE_HUB_API_KEY,
|
|
143
|
-
url:
|
|
143
|
+
url: env.AIGNE_HUB_API_URL,
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
146
|
exports.checkConnectionStatus = checkConnectionStatus;
|
|
@@ -217,6 +217,9 @@ async function loadCredential(options) {
|
|
|
217
217
|
}
|
|
218
218
|
credential = await connectToAIGNEHub(aigneHubUrl);
|
|
219
219
|
}
|
|
220
|
+
else {
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
return credential;
|
|
@@ -16,7 +16,7 @@ export declare function connectToAIGNEHub(url: string): Promise<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export declare const checkConnectionStatus: (host: string) => Promise<{
|
|
18
18
|
apiKey: any;
|
|
19
|
-
url:
|
|
19
|
+
url: any;
|
|
20
20
|
}>;
|
|
21
21
|
export declare function loadCredential(options?: LoadCredentialOptions): Promise<{
|
|
22
22
|
apiKey?: string;
|
|
@@ -59,7 +59,9 @@ export class AIGNEHubChatModel extends ChatModel {
|
|
|
59
59
|
throw new Error("Client not initialized");
|
|
60
60
|
}
|
|
61
61
|
options.fetchOptions = {
|
|
62
|
-
headers: {
|
|
62
|
+
headers: {
|
|
63
|
+
"x-aigne-hub-client-did": process.env.BLOCKLET_APP_PID || process.env.ABT_NODE_DID || "",
|
|
64
|
+
},
|
|
63
65
|
...options.fetchOptions,
|
|
64
66
|
};
|
|
65
67
|
return this.client.invoke(input, options);
|
|
@@ -45,8 +45,10 @@ export class AIGNEHubChatModel extends ChatModel {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
process(input, options) {
|
|
48
|
+
const { BLOCKLET_APP_PID, ABT_NODE_DID } = process.env;
|
|
49
|
+
const clientId = BLOCKLET_APP_PID || ABT_NODE_DID || `@aigne/aigne-hub:${nodejs.os.hostname()}`;
|
|
48
50
|
options.fetchOptions = {
|
|
49
|
-
headers: { "x-aigne-hub-client-did":
|
|
51
|
+
headers: { "x-aigne-hub-client-did": clientId },
|
|
50
52
|
...options.fetchOptions,
|
|
51
53
|
};
|
|
52
54
|
return this.client.__invoke(undefined, input, options);
|
|
@@ -16,7 +16,7 @@ export declare function connectToAIGNEHub(url: string): Promise<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export declare const checkConnectionStatus: (host: string) => Promise<{
|
|
18
18
|
apiKey: any;
|
|
19
|
-
url:
|
|
19
|
+
url: any;
|
|
20
20
|
}>;
|
|
21
21
|
export declare function loadCredential(options?: LoadCredentialOptions): Promise<{
|
|
22
22
|
apiKey?: string;
|
|
@@ -73,7 +73,7 @@ export async function getAIGNEHubMountPoint(url) {
|
|
|
73
73
|
export async function connectToAIGNEHub(url) {
|
|
74
74
|
const { origin, host } = new URL(url);
|
|
75
75
|
const connectUrl = joinURL(origin, WELLKNOWN_SERVICE_PATH_PREFIX);
|
|
76
|
-
const
|
|
76
|
+
const apiUrl = await getAIGNEHubMountPoint(url);
|
|
77
77
|
try {
|
|
78
78
|
const openFn = isTest ? () => { } : open;
|
|
79
79
|
const result = await createConnect({
|
|
@@ -85,7 +85,7 @@ export async function connectToAIGNEHub(url) {
|
|
|
85
85
|
});
|
|
86
86
|
const accessKeyOptions = {
|
|
87
87
|
apiKey: result.accessKeySecret,
|
|
88
|
-
url:
|
|
88
|
+
url: apiUrl,
|
|
89
89
|
};
|
|
90
90
|
// After redirection, write the AIGNE Hub access token
|
|
91
91
|
const aigneDir = nodejs.path.join(nodejs.os.homedir(), ".aigne");
|
|
@@ -129,7 +129,7 @@ export const checkConnectionStatus = async (host) => {
|
|
|
129
129
|
}
|
|
130
130
|
return {
|
|
131
131
|
apiKey: env.AIGNE_HUB_API_KEY,
|
|
132
|
-
url:
|
|
132
|
+
url: env.AIGNE_HUB_API_URL,
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
135
|
export async function loadCredential(options) {
|
|
@@ -205,6 +205,9 @@ export async function loadCredential(options) {
|
|
|
205
205
|
}
|
|
206
206
|
credential = await connectToAIGNEHub(aigneHubUrl);
|
|
207
207
|
}
|
|
208
|
+
else {
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
return credential;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/aigne-hub",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "AIGNE Hub SDK for integrating with Hub AI models",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
"yaml": "^2.8.0",
|
|
53
53
|
"zod": "^3.25.67",
|
|
54
54
|
"@aigne/anthropic": "^0.11.2",
|
|
55
|
-
"@aigne/bedrock": "^0.9.2",
|
|
56
55
|
"@aigne/core": "^1.50.0",
|
|
56
|
+
"@aigne/deepseek": "^0.7.20",
|
|
57
57
|
"@aigne/default-memory": "^1.1.2",
|
|
58
|
-
"@aigne/doubao": "^1.0.14",
|
|
59
58
|
"@aigne/gemini": "^0.9.2",
|
|
60
|
-
"@aigne/
|
|
59
|
+
"@aigne/bedrock": "^0.9.2",
|
|
60
|
+
"@aigne/doubao": "^1.0.14",
|
|
61
61
|
"@aigne/ollama": "^0.7.20",
|
|
62
|
-
"@aigne/open-router": "^0.7.20",
|
|
63
62
|
"@aigne/openai": "^0.11.2",
|
|
63
|
+
"@aigne/open-router": "^0.7.20",
|
|
64
64
|
"@aigne/platform-helpers": "^0.6.2",
|
|
65
65
|
"@aigne/poe": "^1.0.0",
|
|
66
|
-
"@aigne/
|
|
67
|
-
"@aigne/
|
|
66
|
+
"@aigne/xai": "^0.7.20",
|
|
67
|
+
"@aigne/transport": "^0.14.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/bun": "^1.2.18",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"npm-run-all": "^4.1.5",
|
|
74
74
|
"rimraf": "^6.0.1",
|
|
75
75
|
"typescript": "^5.8.3",
|
|
76
|
-
"@aigne/
|
|
77
|
-
"@aigne/
|
|
76
|
+
"@aigne/test-utils": "^0.5.28",
|
|
77
|
+
"@aigne/openai": "^0.11.2"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"lint": "tsc --noEmit",
|