@aigne/aigne-hub 0.4.9 → 0.5.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 +41 -0
- package/lib/cjs/blocklet-aigne-hub-model.d.ts +1 -1
- package/lib/cjs/blocklet-aigne-hub-model.js +3 -3
- package/lib/cjs/cli-aigne-hub-model.d.ts +1 -1
- package/lib/cjs/cli-aigne-hub-model.js +3 -3
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/util/model.js +8 -8
- package/lib/dts/blocklet-aigne-hub-model.d.ts +1 -1
- package/lib/dts/cli-aigne-hub-model.d.ts +1 -1
- package/lib/esm/blocklet-aigne-hub-model.d.ts +1 -1
- package/lib/esm/blocklet-aigne-hub-model.js +1 -1
- package/lib/esm/cli-aigne-hub-model.d.ts +1 -1
- package/lib/esm/cli-aigne-hub-model.js +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/util/model.js +6 -6
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.1](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.5.0...aigne-hub-v0.5.1) (2025-08-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* resolve circular dependency in aigne-hub ([#355](https://github.com/AIGNE-io/aigne-framework/issues/355)) ([202c1f3](https://github.com/AIGNE-io/aigne-framework/commit/202c1f3acc199f4512580b3c1f73c1dee13e40a5))
|
|
9
|
+
|
|
10
|
+
## [0.5.0](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.4.10...aigne-hub-v0.5.0) (2025-08-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **cli:** support aigne hub commond ([#352](https://github.com/AIGNE-io/aigne-framework/issues/352)) ([0341f19](https://github.com/AIGNE-io/aigne-framework/commit/0341f190229b42c5d2ab8a8616597359f35543a7))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* ensure log prints only once ([#354](https://github.com/AIGNE-io/aigne-framework/issues/354)) ([b5a64f7](https://github.com/AIGNE-io/aigne-framework/commit/b5a64f74ac67854fc6d576aacd1aa8b91a256765))
|
|
21
|
+
|
|
22
|
+
## [0.4.10](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.4.9...aigne-hub-v0.4.10) (2025-08-12)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @aigne/anthropic bumped to 0.11.1
|
|
30
|
+
* @aigne/bedrock bumped to 0.9.1
|
|
31
|
+
* @aigne/core bumped to 1.49.1
|
|
32
|
+
* @aigne/deepseek bumped to 0.7.19
|
|
33
|
+
* @aigne/default-memory bumped to 1.1.1
|
|
34
|
+
* @aigne/gemini bumped to 0.9.1
|
|
35
|
+
* @aigne/ollama bumped to 0.7.19
|
|
36
|
+
* @aigne/open-router bumped to 0.7.19
|
|
37
|
+
* @aigne/openai bumped to 0.11.1
|
|
38
|
+
* @aigne/transport bumped to 0.13.1
|
|
39
|
+
* @aigne/xai bumped to 0.7.19
|
|
40
|
+
* devDependencies
|
|
41
|
+
* @aigne/openai bumped to 0.11.1
|
|
42
|
+
* @aigne/test-utils bumped to 0.5.27
|
|
43
|
+
|
|
3
44
|
## [0.4.9](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.4.8...aigne-hub-v0.4.9) (2025-08-12)
|
|
4
45
|
|
|
5
46
|
|
|
@@ -5,7 +5,7 @@ import type { PromiseOrValue } from "@aigne/core/utils/type-utils.js";
|
|
|
5
5
|
import type { OpenAIChatModelOptions } from "@aigne/openai";
|
|
6
6
|
import type { AIGNEHubChatModelOptions } from "./cli-aigne-hub-model.js";
|
|
7
7
|
export type HubChatModelOptions = AIGNEHubChatModelOptions | AnthropicChatModelOptions | BedrockChatModelOptions | OpenAIChatModelOptions;
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class AIGNEHubChatModel extends ChatModel {
|
|
9
9
|
options: HubChatModelOptions & {
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
baseURL?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AIGNEHubChatModel = void 0;
|
|
4
4
|
const core_1 = require("@aigne/core");
|
|
5
5
|
const constants_js_1 = require("./util/constants.js");
|
|
6
6
|
const model_js_1 = require("./util/model.js");
|
|
7
|
-
class
|
|
7
|
+
class AIGNEHubChatModel extends core_1.ChatModel {
|
|
8
8
|
options;
|
|
9
9
|
client;
|
|
10
10
|
constructor(options) {
|
|
@@ -42,4 +42,4 @@ class BlockletAIGNEHubChatModel extends core_1.ChatModel {
|
|
|
42
42
|
return this.client.invoke(input, options);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
exports.
|
|
45
|
+
exports.AIGNEHubChatModel = AIGNEHubChatModel;
|
|
@@ -8,7 +8,7 @@ export interface AIGNEHubChatModelOptions {
|
|
|
8
8
|
modelOptions?: ChatModelOptions;
|
|
9
9
|
clientOptions?: OpenAIChatModelOptions["clientOptions"];
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class AIGNEHubChatModel extends ChatModel {
|
|
12
12
|
options: AIGNEHubChatModelOptions;
|
|
13
13
|
private client;
|
|
14
14
|
constructor(options: AIGNEHubChatModelOptions);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AIGNEHubChatModel = void 0;
|
|
4
4
|
const core_1 = require("@aigne/core");
|
|
5
5
|
const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
|
|
6
6
|
const base_client_js_1 = require("@aigne/transport/http-client/base-client.js");
|
|
@@ -24,7 +24,7 @@ const aigneHubChatModelOptionsSchema = zod_1.z.object({
|
|
|
24
24
|
.optional(),
|
|
25
25
|
clientOptions: zod_1.z.object({}).optional(),
|
|
26
26
|
});
|
|
27
|
-
class
|
|
27
|
+
class AIGNEHubChatModel extends core_1.ChatModel {
|
|
28
28
|
options;
|
|
29
29
|
client;
|
|
30
30
|
constructor(options) {
|
|
@@ -45,4 +45,4 @@ class CliAIGNEHubChatModel extends core_1.ChatModel {
|
|
|
45
45
|
return this.client.__invoke(undefined, input, options);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
exports.
|
|
48
|
+
exports.AIGNEHubChatModel = AIGNEHubChatModel;
|
package/lib/cjs/index.js
CHANGED
|
@@ -40,7 +40,7 @@ class AIGNEHubChatModel extends core_1.ChatModel {
|
|
|
40
40
|
super();
|
|
41
41
|
this.options = options;
|
|
42
42
|
const isBlocklet = process.env.BLOCKLET_AIGNE_API_URL && process.env.BLOCKLET_AIGNE_API_PROVIDER;
|
|
43
|
-
const AIGNEHubModel = isBlocklet ? blocklet_aigne_hub_model_js_1.
|
|
43
|
+
const AIGNEHubModel = isBlocklet ? blocklet_aigne_hub_model_js_1.AIGNEHubChatModel : cli_aigne_hub_model_js_1.AIGNEHubChatModel;
|
|
44
44
|
this.client = new AIGNEHubModel(options);
|
|
45
45
|
}
|
|
46
46
|
process(input, options) {
|
package/lib/cjs/util/model.js
CHANGED
|
@@ -21,7 +21,7 @@ const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
|
21
21
|
const boxen_1 = __importDefault(require("boxen"));
|
|
22
22
|
const chalk_1 = __importDefault(require("chalk"));
|
|
23
23
|
const https_proxy_agent_1 = require("https-proxy-agent");
|
|
24
|
-
const
|
|
24
|
+
const cli_aigne_hub_model_js_1 = require("../cli-aigne-hub-model.js");
|
|
25
25
|
const constants_js_1 = require("./constants.js");
|
|
26
26
|
const credential_js_1 = require("./credential.js");
|
|
27
27
|
const { MODEL_PROVIDER, MODEL_NAME } = index_js_1.nodejs.env;
|
|
@@ -84,9 +84,9 @@ function availableModels() {
|
|
|
84
84
|
create: (params) => new xai_1.XAIChatModel({ ...params, clientOptions }),
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
name:
|
|
87
|
+
name: cli_aigne_hub_model_js_1.AIGNEHubChatModel.name,
|
|
88
88
|
apiKeyEnvName: "AIGNE_HUB_API_KEY",
|
|
89
|
-
create: (params) => new
|
|
89
|
+
create: (params) => new cli_aigne_hub_model_js_1.AIGNEHubChatModel({ ...params, clientOptions }),
|
|
90
90
|
},
|
|
91
91
|
];
|
|
92
92
|
}
|
|
@@ -152,7 +152,11 @@ function maskApiKey(apiKey) {
|
|
|
152
152
|
const end = apiKey.slice(-4);
|
|
153
153
|
return `${start}${"*".repeat(8)}${end}`;
|
|
154
154
|
}
|
|
155
|
+
let printed = false;
|
|
155
156
|
function printChatModelInfoBox({ provider, model, credential, m, }) {
|
|
157
|
+
if (printed)
|
|
158
|
+
return;
|
|
159
|
+
printed = true;
|
|
156
160
|
const lines = [
|
|
157
161
|
`${chalk_1.default.cyan("Provider")}: ${chalk_1.default.green(provider)}`,
|
|
158
162
|
`${chalk_1.default.cyan("Model")}: ${chalk_1.default.green(model)}`,
|
|
@@ -171,11 +175,7 @@ function printChatModelInfoBox({ provider, model, credential, m, }) {
|
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
177
|
console.log("\n");
|
|
174
|
-
console.log((0, boxen_1.default)(lines.join("\n"), {
|
|
175
|
-
padding: 1,
|
|
176
|
-
borderStyle: "classic",
|
|
177
|
-
borderColor: "cyan",
|
|
178
|
-
}));
|
|
178
|
+
console.log((0, boxen_1.default)(lines.join("\n"), { padding: 1, borderStyle: "classic", borderColor: "cyan" }));
|
|
179
179
|
console.log("\n");
|
|
180
180
|
}
|
|
181
181
|
async function loadModel(model, modelOptions, options) {
|
|
@@ -5,7 +5,7 @@ import type { PromiseOrValue } from "@aigne/core/utils/type-utils.js";
|
|
|
5
5
|
import type { OpenAIChatModelOptions } from "@aigne/openai";
|
|
6
6
|
import type { AIGNEHubChatModelOptions } from "./cli-aigne-hub-model.js";
|
|
7
7
|
export type HubChatModelOptions = AIGNEHubChatModelOptions | AnthropicChatModelOptions | BedrockChatModelOptions | OpenAIChatModelOptions;
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class AIGNEHubChatModel extends ChatModel {
|
|
9
9
|
options: HubChatModelOptions & {
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
baseURL?: string;
|
|
@@ -8,7 +8,7 @@ export interface AIGNEHubChatModelOptions {
|
|
|
8
8
|
modelOptions?: ChatModelOptions;
|
|
9
9
|
clientOptions?: OpenAIChatModelOptions["clientOptions"];
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class AIGNEHubChatModel extends ChatModel {
|
|
12
12
|
options: AIGNEHubChatModelOptions;
|
|
13
13
|
private client;
|
|
14
14
|
constructor(options: AIGNEHubChatModelOptions);
|
|
@@ -5,7 +5,7 @@ import type { PromiseOrValue } from "@aigne/core/utils/type-utils.js";
|
|
|
5
5
|
import type { OpenAIChatModelOptions } from "@aigne/openai";
|
|
6
6
|
import type { AIGNEHubChatModelOptions } from "./cli-aigne-hub-model.js";
|
|
7
7
|
export type HubChatModelOptions = AIGNEHubChatModelOptions | AnthropicChatModelOptions | BedrockChatModelOptions | OpenAIChatModelOptions;
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class AIGNEHubChatModel extends ChatModel {
|
|
9
9
|
options: HubChatModelOptions & {
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
baseURL?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChatModel, } from "@aigne/core";
|
|
2
2
|
import { AIGNE_HUB_URL } from "./util/constants.js";
|
|
3
3
|
import { availableModels, findModel } from "./util/model.js";
|
|
4
|
-
export class
|
|
4
|
+
export class AIGNEHubChatModel extends ChatModel {
|
|
5
5
|
options;
|
|
6
6
|
client;
|
|
7
7
|
constructor(options) {
|
|
@@ -8,7 +8,7 @@ export interface AIGNEHubChatModelOptions {
|
|
|
8
8
|
modelOptions?: ChatModelOptions;
|
|
9
9
|
clientOptions?: OpenAIChatModelOptions["clientOptions"];
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class AIGNEHubChatModel extends ChatModel {
|
|
12
12
|
options: AIGNEHubChatModelOptions;
|
|
13
13
|
private client;
|
|
14
14
|
constructor(options: AIGNEHubChatModelOptions);
|
|
@@ -21,7 +21,7 @@ const aigneHubChatModelOptionsSchema = z.object({
|
|
|
21
21
|
.optional(),
|
|
22
22
|
clientOptions: z.object({}).optional(),
|
|
23
23
|
});
|
|
24
|
-
export class
|
|
24
|
+
export class AIGNEHubChatModel extends ChatModel {
|
|
25
25
|
options;
|
|
26
26
|
client;
|
|
27
27
|
constructor(options) {
|
package/lib/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatModel, } from "@aigne/core";
|
|
2
|
-
import { BlockletAIGNEHubChatModel } from "./blocklet-aigne-hub-model.js";
|
|
3
|
-
import { CliAIGNEHubChatModel } from "./cli-aigne-hub-model.js";
|
|
2
|
+
import { AIGNEHubChatModel as BlockletAIGNEHubChatModel, } from "./blocklet-aigne-hub-model.js";
|
|
3
|
+
import { AIGNEHubChatModel as CliAIGNEHubChatModel, } from "./cli-aigne-hub-model.js";
|
|
4
4
|
import { AIGNE_HUB_URL } from "./util/constants.js";
|
|
5
5
|
import { getAIGNEHubMountPoint } from "./util/credential.js";
|
|
6
6
|
export * from "./util/constants.js";
|
package/lib/esm/util/model.js
CHANGED
|
@@ -11,7 +11,7 @@ import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler";
|
|
|
11
11
|
import boxen from "boxen";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
14
|
-
import { AIGNEHubChatModel } from "../
|
|
14
|
+
import { AIGNEHubChatModel } from "../cli-aigne-hub-model.js";
|
|
15
15
|
import { AGENT_HUB_PROVIDER, DEFAULT_AIGNE_HUB_PROVIDER_MODEL, DEFAULT_MODEL_PROVIDER, } from "./constants.js";
|
|
16
16
|
import { loadCredential } from "./credential.js";
|
|
17
17
|
const { MODEL_PROVIDER, MODEL_NAME } = nodejs.env;
|
|
@@ -140,7 +140,11 @@ export function maskApiKey(apiKey) {
|
|
|
140
140
|
const end = apiKey.slice(-4);
|
|
141
141
|
return `${start}${"*".repeat(8)}${end}`;
|
|
142
142
|
}
|
|
143
|
+
let printed = false;
|
|
143
144
|
function printChatModelInfoBox({ provider, model, credential, m, }) {
|
|
145
|
+
if (printed)
|
|
146
|
+
return;
|
|
147
|
+
printed = true;
|
|
144
148
|
const lines = [
|
|
145
149
|
`${chalk.cyan("Provider")}: ${chalk.green(provider)}`,
|
|
146
150
|
`${chalk.cyan("Model")}: ${chalk.green(model)}`,
|
|
@@ -159,11 +163,7 @@ function printChatModelInfoBox({ provider, model, credential, m, }) {
|
|
|
159
163
|
}
|
|
160
164
|
}
|
|
161
165
|
console.log("\n");
|
|
162
|
-
console.log(boxen(lines.join("\n"), {
|
|
163
|
-
padding: 1,
|
|
164
|
-
borderStyle: "classic",
|
|
165
|
-
borderColor: "cyan",
|
|
166
|
-
}));
|
|
166
|
+
console.log(boxen(lines.join("\n"), { padding: 1, borderStyle: "classic", borderColor: "cyan" }));
|
|
167
167
|
console.log("\n");
|
|
168
168
|
}
|
|
169
169
|
export async function loadModel(model, modelOptions, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/aigne-hub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "AIGNE Hub SDK for integrating with Hub AI models",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -52,18 +52,18 @@
|
|
|
52
52
|
"ufo": "^1.6.1",
|
|
53
53
|
"yaml": "^2.8.0",
|
|
54
54
|
"zod": "^3.25.67",
|
|
55
|
-
"@aigne/anthropic": "^0.11.
|
|
56
|
-
"@aigne/
|
|
57
|
-
"@aigne/
|
|
58
|
-
"@aigne/
|
|
59
|
-
"@aigne/
|
|
60
|
-
"@aigne/
|
|
61
|
-
"@aigne/
|
|
62
|
-
"@aigne/
|
|
63
|
-
"@aigne/open-router": "^0.7.
|
|
55
|
+
"@aigne/anthropic": "^0.11.1",
|
|
56
|
+
"@aigne/bedrock": "^0.9.1",
|
|
57
|
+
"@aigne/deepseek": "^0.7.19",
|
|
58
|
+
"@aigne/default-memory": "^1.1.1",
|
|
59
|
+
"@aigne/gemini": "^0.9.1",
|
|
60
|
+
"@aigne/core": "^1.49.1",
|
|
61
|
+
"@aigne/ollama": "^0.7.19",
|
|
62
|
+
"@aigne/openai": "^0.11.1",
|
|
63
|
+
"@aigne/open-router": "^0.7.19",
|
|
64
64
|
"@aigne/platform-helpers": "^0.6.1",
|
|
65
|
-
"@aigne/transport": "^0.13.
|
|
66
|
-
"@aigne/xai": "^0.7.
|
|
65
|
+
"@aigne/transport": "^0.13.1",
|
|
66
|
+
"@aigne/xai": "^0.7.19"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/bun": "^1.2.18",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"npm-run-all": "^4.1.5",
|
|
73
73
|
"rimraf": "^6.0.1",
|
|
74
74
|
"typescript": "^5.8.3",
|
|
75
|
-
"@aigne/
|
|
76
|
-
"@aigne/
|
|
75
|
+
"@aigne/openai": "^0.11.1",
|
|
76
|
+
"@aigne/test-utils": "^0.5.27"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"lint": "tsc --noEmit",
|