@openclaw/tencent-provider 2026.7.2-beta.7 → 2026.7.33
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/.setup/models-BQhpfSMm.mjs +119 -0
- package/dist/api.js +2 -2
- package/dist/config-compat.js +9 -6
- package/dist/index.js +5 -13
- package/dist/models.js +2 -2
- package/dist/onboard.js +38 -29
- package/dist/provider-catalog.js +3 -3
- package/dist/stream.js +1 -1
- package/openclaw.plugin.json +49 -28
- package/package.json +4 -4
- package/dist/models-CofAdRJ3.js +0 -184
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
//#region extensions/tencent/openclaw.plugin.json
|
|
3
|
+
var modelCatalog = {
|
|
4
|
+
"providers": {
|
|
5
|
+
"tencent-tokenhub": {
|
|
6
|
+
"baseUrl": "https://tokenhub.tencentmaas.com/v1",
|
|
7
|
+
"api": "openai-completions",
|
|
8
|
+
"models": [{
|
|
9
|
+
"id": "hy3-preview",
|
|
10
|
+
"name": "Hy3 preview (TokenHub)",
|
|
11
|
+
"reasoning": true,
|
|
12
|
+
"input": ["text"],
|
|
13
|
+
"contextWindow": 256e3,
|
|
14
|
+
"maxTokens": 64e3,
|
|
15
|
+
"cost": {
|
|
16
|
+
"input": .176,
|
|
17
|
+
"output": .587,
|
|
18
|
+
"cacheRead": .059,
|
|
19
|
+
"cacheWrite": 0,
|
|
20
|
+
"tieredPricing": [
|
|
21
|
+
{
|
|
22
|
+
"input": .176,
|
|
23
|
+
"output": .587,
|
|
24
|
+
"cacheRead": .059,
|
|
25
|
+
"cacheWrite": 0,
|
|
26
|
+
"range": [0, 16e3]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"input": .235,
|
|
30
|
+
"output": .939,
|
|
31
|
+
"cacheRead": .088,
|
|
32
|
+
"cacheWrite": 0,
|
|
33
|
+
"range": [16e3, 32e3]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"input": .293,
|
|
37
|
+
"output": 1.173,
|
|
38
|
+
"cacheRead": .117,
|
|
39
|
+
"cacheWrite": 0,
|
|
40
|
+
"range": [32e3]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"compat": {
|
|
45
|
+
"supportsUsageInStreaming": true,
|
|
46
|
+
"supportsReasoningEffort": true,
|
|
47
|
+
"supportedReasoningEfforts": [
|
|
48
|
+
"none",
|
|
49
|
+
"low",
|
|
50
|
+
"high"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
"id": "hy3",
|
|
55
|
+
"name": "Hy3 (TokenHub)",
|
|
56
|
+
"reasoning": true,
|
|
57
|
+
"input": ["text"],
|
|
58
|
+
"contextWindow": 256e3,
|
|
59
|
+
"maxTokens": 64e3,
|
|
60
|
+
"compat": {
|
|
61
|
+
"supportsUsageInStreaming": true,
|
|
62
|
+
"supportsReasoningEffort": true,
|
|
63
|
+
"supportedReasoningEfforts": ["none", "high"]
|
|
64
|
+
}
|
|
65
|
+
}]
|
|
66
|
+
},
|
|
67
|
+
"tencent-tokenplan": {
|
|
68
|
+
"baseUrl": "https://api.lkeap.cloud.tencent.com/plan/v3",
|
|
69
|
+
"api": "openai-completions",
|
|
70
|
+
"models": [{
|
|
71
|
+
"id": "hy3",
|
|
72
|
+
"name": "Hy3 (TokenPlan)",
|
|
73
|
+
"reasoning": true,
|
|
74
|
+
"input": ["text"],
|
|
75
|
+
"contextWindow": 256e3,
|
|
76
|
+
"maxTokens": 64e3,
|
|
77
|
+
"compat": {
|
|
78
|
+
"supportsUsageInStreaming": true,
|
|
79
|
+
"supportsReasoningEffort": true,
|
|
80
|
+
"supportedReasoningEfforts": ["none", "high"]
|
|
81
|
+
}
|
|
82
|
+
}]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"discovery": {
|
|
86
|
+
"tencent-tokenhub": "static",
|
|
87
|
+
"tencent-tokenplan": "static"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region extensions/tencent/models.ts
|
|
92
|
+
const TOKENHUB_PROVIDER_ID = "tencent-tokenhub";
|
|
93
|
+
const TOKENHUB_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
94
|
+
providerId: TOKENHUB_PROVIDER_ID,
|
|
95
|
+
catalog: modelCatalog.providers[TOKENHUB_PROVIDER_ID]
|
|
96
|
+
});
|
|
97
|
+
const TOKENHUB_BASE_URL = TOKENHUB_MANIFEST_PROVIDER.baseUrl;
|
|
98
|
+
const TOKENHUB_MODEL_CATALOG = TOKENHUB_MANIFEST_PROVIDER.models;
|
|
99
|
+
function buildTokenHubModelDefinition(model) {
|
|
100
|
+
return {
|
|
101
|
+
...model,
|
|
102
|
+
api: "openai-completions"
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const TOKENPLAN_PROVIDER_ID = "tencent-tokenplan";
|
|
106
|
+
const TOKENPLAN_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
107
|
+
providerId: TOKENPLAN_PROVIDER_ID,
|
|
108
|
+
catalog: modelCatalog.providers[TOKENPLAN_PROVIDER_ID]
|
|
109
|
+
});
|
|
110
|
+
const TOKENPLAN_BASE_URL = TOKENPLAN_MANIFEST_PROVIDER.baseUrl;
|
|
111
|
+
const TOKENPLAN_MODEL_CATALOG = TOKENPLAN_MANIFEST_PROVIDER.models;
|
|
112
|
+
function buildTokenPlanModelDefinition(model) {
|
|
113
|
+
return {
|
|
114
|
+
...model,
|
|
115
|
+
api: "openai-completions"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { TOKENPLAN_MODEL_CATALOG as a, buildTokenPlanModelDefinition as c, TOKENPLAN_BASE_URL as i, TOKENHUB_MODEL_CATALOG as n, TOKENPLAN_PROVIDER_ID as o, TOKENHUB_PROVIDER_ID as r, buildTokenHubModelDefinition as s, TOKENHUB_BASE_URL as t };
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as TOKENPLAN_MODEL_CATALOG, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID, t as TOKENHUB_BASE_URL } from "
|
|
1
|
+
import { a as TOKENPLAN_MODEL_CATALOG, c as buildTokenPlanModelDefinition, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID, s as buildTokenHubModelDefinition, t as TOKENHUB_BASE_URL } from "./.setup/models-BQhpfSMm.mjs";
|
|
2
2
|
import { buildTokenHubProvider, buildTokenPlanProvider } from "./provider-catalog.js";
|
|
3
|
-
export { TOKENHUB_BASE_URL, TOKENHUB_MODEL_CATALOG, TOKENHUB_PROVIDER_ID, TOKENPLAN_BASE_URL, TOKENPLAN_MODEL_CATALOG, TOKENPLAN_PROVIDER_ID, buildTokenHubProvider, buildTokenPlanProvider };
|
|
3
|
+
export { TOKENHUB_BASE_URL, TOKENHUB_MODEL_CATALOG, TOKENHUB_PROVIDER_ID, TOKENPLAN_BASE_URL, TOKENPLAN_MODEL_CATALOG, TOKENPLAN_PROVIDER_ID, buildTokenHubModelDefinition, buildTokenHubProvider, buildTokenPlanModelDefinition, buildTokenPlanProvider };
|
package/dist/config-compat.js
CHANGED
|
@@ -4,7 +4,7 @@ const TENCENT_TOKENHUB_PREVIEW_MODEL_REF = "tencent-tokenhub/hy3-preview";
|
|
|
4
4
|
const TOKENHUB_DEFAULT_ALIAS = "Hy3 (TokenHub)";
|
|
5
5
|
const TOKENHUB_PREVIEW_ALIAS = "Hy3 preview (TokenHub)";
|
|
6
6
|
function isTokenHubModelMapConfigured(models) {
|
|
7
|
-
return Object.hasOwn(models,
|
|
7
|
+
return Object.hasOwn(models, "tencent-tokenhub/hy3") || Object.hasOwn(models, "tencent-tokenhub/hy3-preview");
|
|
8
8
|
}
|
|
9
9
|
function withDefaultAlias(entry, alias) {
|
|
10
10
|
return {
|
|
@@ -16,11 +16,11 @@ function needsDefaultAlias(entry) {
|
|
|
16
16
|
return entry?.alias === void 0;
|
|
17
17
|
}
|
|
18
18
|
function migrateDefaultModel(model) {
|
|
19
|
-
if (model ===
|
|
19
|
+
if (model === "tencent-tokenhub/hy3-preview") return {
|
|
20
20
|
model: { primary: TENCENT_TOKENHUB_DEFAULT_MODEL_REF },
|
|
21
21
|
changed: true
|
|
22
22
|
};
|
|
23
|
-
if (model && typeof model === "object" && "primary" in model && model.primary ===
|
|
23
|
+
if (model && typeof model === "object" && "primary" in model && model.primary === "tencent-tokenhub/hy3-preview") return {
|
|
24
24
|
model: {
|
|
25
25
|
...model,
|
|
26
26
|
primary: TENCENT_TOKENHUB_DEFAULT_MODEL_REF
|
|
@@ -38,8 +38,8 @@ function migrateTencentTokenHubModelDefaults(cfg) {
|
|
|
38
38
|
config: cfg,
|
|
39
39
|
changes: []
|
|
40
40
|
};
|
|
41
|
-
const needsDefaultRepair = !Object.hasOwn(existingModels,
|
|
42
|
-
const needsPreviewRepair = !Object.hasOwn(existingModels,
|
|
41
|
+
const needsDefaultRepair = !Object.hasOwn(existingModels, "tencent-tokenhub/hy3") || needsDefaultAlias(existingModels["tencent-tokenhub/hy3"]);
|
|
42
|
+
const needsPreviewRepair = !Object.hasOwn(existingModels, "tencent-tokenhub/hy3-preview") || needsDefaultAlias(existingModels["tencent-tokenhub/hy3-preview"]);
|
|
43
43
|
const migratedModel = migrateDefaultModel(cfg.agents?.defaults?.model);
|
|
44
44
|
if (!needsDefaultRepair && !needsPreviewRepair && !migratedModel.changed) return {
|
|
45
45
|
config: cfg,
|
|
@@ -68,5 +68,8 @@ function migrateTencentTokenHubModelDefaults(cfg) {
|
|
|
68
68
|
changes
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
72
|
+
return migrateTencentTokenHubModelDefaults(cfg);
|
|
73
|
+
}
|
|
71
74
|
//#endregion
|
|
72
|
-
export { migrateTencentTokenHubModelDefaults };
|
|
75
|
+
export { TENCENT_TOKENHUB_DEFAULT_MODEL_REF, TENCENT_TOKENHUB_PREVIEW_MODEL_REF, migrateTencentTokenHubModelDefaults, normalizeCompatibilityConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as TOKENPLAN_MODEL_CATALOG, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID } from "
|
|
2
|
-
import { TOKENHUB_DEFAULT_MODEL_REF, TOKENPLAN_DEFAULT_MODEL_REF, applyTokenHubConfig, applyTokenPlanConfig } from "./onboard.js";
|
|
1
|
+
import { a as TOKENPLAN_MODEL_CATALOG, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID } from "./.setup/models-BQhpfSMm.mjs";
|
|
3
2
|
import { buildTokenHubProvider, buildTokenPlanProvider } from "./provider-catalog.js";
|
|
3
|
+
import { TOKENHUB_DEFAULT_MODEL_REF, TOKENPLAN_DEFAULT_MODEL_REF, applyTokenHubConfig, applyTokenPlanConfig } from "./onboard.js";
|
|
4
4
|
import { wrapTencentProviderStream } from "./stream.js";
|
|
5
5
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
6
6
|
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
|
7
|
-
import {
|
|
7
|
+
import { buildSingleProviderApiKeyCatalog } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
8
8
|
//#region extensions/tencent/index.ts
|
|
9
9
|
function buildStaticCatalogEntries(providerId, catalog) {
|
|
10
10
|
return catalog.map((entry) => ({
|
|
@@ -51,16 +51,12 @@ var tencent_default = definePluginEntry({
|
|
|
51
51
|
auth: [createTokenHubApiKeyAuthMethod()],
|
|
52
52
|
catalog: {
|
|
53
53
|
order: "simple",
|
|
54
|
-
run: (ctx) =>
|
|
54
|
+
run: (ctx) => buildSingleProviderApiKeyCatalog({
|
|
55
55
|
ctx,
|
|
56
56
|
providerId: TOKENHUB_PROVIDER_ID,
|
|
57
57
|
buildProvider: buildTokenHubProvider
|
|
58
58
|
})
|
|
59
59
|
},
|
|
60
|
-
staticCatalog: {
|
|
61
|
-
order: "simple",
|
|
62
|
-
run: async () => ({ provider: buildTokenHubProvider() })
|
|
63
|
-
},
|
|
64
60
|
augmentModelCatalog: () => buildStaticCatalogEntries(TOKENHUB_PROVIDER_ID, TOKENHUB_MODEL_CATALOG),
|
|
65
61
|
wrapStreamFn: wrapTencentProviderStream
|
|
66
62
|
});
|
|
@@ -91,16 +87,12 @@ var tencent_default = definePluginEntry({
|
|
|
91
87
|
})],
|
|
92
88
|
catalog: {
|
|
93
89
|
order: "simple",
|
|
94
|
-
run: (ctx) =>
|
|
90
|
+
run: (ctx) => buildSingleProviderApiKeyCatalog({
|
|
95
91
|
ctx,
|
|
96
92
|
providerId: TOKENPLAN_PROVIDER_ID,
|
|
97
93
|
buildProvider: buildTokenPlanProvider
|
|
98
94
|
})
|
|
99
95
|
},
|
|
100
|
-
staticCatalog: {
|
|
101
|
-
order: "simple",
|
|
102
|
-
run: async () => ({ provider: buildTokenPlanProvider() })
|
|
103
|
-
},
|
|
104
96
|
augmentModelCatalog: () => buildStaticCatalogEntries(TOKENPLAN_PROVIDER_ID, TOKENPLAN_MODEL_CATALOG),
|
|
105
97
|
wrapStreamFn: wrapTencentProviderStream
|
|
106
98
|
});
|
package/dist/models.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TOKENPLAN_MODEL_CATALOG, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID, t as TOKENHUB_BASE_URL } from "
|
|
2
|
-
export { TOKENHUB_BASE_URL, TOKENHUB_MODEL_CATALOG, TOKENHUB_PROVIDER_ID, TOKENPLAN_BASE_URL, TOKENPLAN_MODEL_CATALOG, TOKENPLAN_PROVIDER_ID };
|
|
1
|
+
import { a as TOKENPLAN_MODEL_CATALOG, c as buildTokenPlanModelDefinition, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID, s as buildTokenHubModelDefinition, t as TOKENHUB_BASE_URL } from "./.setup/models-BQhpfSMm.mjs";
|
|
2
|
+
export { TOKENHUB_BASE_URL, TOKENHUB_MODEL_CATALOG, TOKENHUB_PROVIDER_ID, TOKENPLAN_BASE_URL, TOKENPLAN_MODEL_CATALOG, TOKENPLAN_PROVIDER_ID, buildTokenHubModelDefinition, buildTokenPlanModelDefinition };
|
package/dist/onboard.js
CHANGED
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
import { a as TOKENPLAN_MODEL_CATALOG, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID, s as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { a as TOKENPLAN_MODEL_CATALOG, c as buildTokenPlanModelDefinition, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID, s as buildTokenHubModelDefinition, t as TOKENHUB_BASE_URL } from "./.setup/models-BQhpfSMm.mjs";
|
|
2
|
+
import "./api.js";
|
|
3
|
+
import { applyAgentDefaultModelPrimary, applyProviderConfigWithModelCatalog } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
4
|
//#region extensions/tencent/onboard.ts
|
|
5
|
+
const TOKENHUB_DEFAULT_MODEL_REF = `${TOKENHUB_PROVIDER_ID}/hy3`;
|
|
5
6
|
const TOKENHUB_PREVIEW_MODEL_REF = `${TOKENHUB_PROVIDER_ID}/hy3-preview`;
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
function applyTokenHubProviderConfig(cfg) {
|
|
8
|
+
const models = { ...cfg.agents?.defaults?.models };
|
|
9
|
+
models[TOKENHUB_DEFAULT_MODEL_REF] = {
|
|
10
|
+
...models[TOKENHUB_DEFAULT_MODEL_REF],
|
|
11
|
+
alias: models[TOKENHUB_DEFAULT_MODEL_REF]?.alias ?? "Hy3 (TokenHub)"
|
|
12
|
+
};
|
|
13
|
+
models[TOKENHUB_PREVIEW_MODEL_REF] = {
|
|
14
|
+
...models[TOKENHUB_PREVIEW_MODEL_REF],
|
|
15
|
+
alias: models[TOKENHUB_PREVIEW_MODEL_REF]?.alias ?? "Hy3 preview (TokenHub)"
|
|
16
|
+
};
|
|
17
|
+
return applyProviderConfigWithModelCatalog(cfg, {
|
|
18
|
+
agentModels: models,
|
|
10
19
|
providerId: TOKENHUB_PROVIDER_ID,
|
|
11
20
|
api: "openai-completions",
|
|
12
21
|
baseUrl: TOKENHUB_BASE_URL,
|
|
13
|
-
catalogModels:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
catalogModels: TOKENHUB_MODEL_CATALOG.map(buildTokenHubModelDefinition)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function applyTokenHubConfig(cfg) {
|
|
26
|
+
return applyAgentDefaultModelPrimary(applyTokenHubProviderConfig(cfg), TOKENHUB_DEFAULT_MODEL_REF);
|
|
27
|
+
}
|
|
28
|
+
const TOKENPLAN_DEFAULT_MODEL_REF = `${TOKENPLAN_PROVIDER_ID}/hy3`;
|
|
29
|
+
function applyTokenPlanProviderConfig(cfg) {
|
|
30
|
+
const models = { ...cfg.agents?.defaults?.models };
|
|
31
|
+
models[TOKENPLAN_DEFAULT_MODEL_REF] = {
|
|
32
|
+
...models[TOKENPLAN_DEFAULT_MODEL_REF],
|
|
33
|
+
alias: models[TOKENPLAN_DEFAULT_MODEL_REF]?.alias ?? "Hy3 (TokenPlan)"
|
|
34
|
+
};
|
|
35
|
+
return applyProviderConfigWithModelCatalog(cfg, {
|
|
36
|
+
agentModels: models,
|
|
27
37
|
providerId: TOKENPLAN_PROVIDER_ID,
|
|
28
38
|
api: "openai-completions",
|
|
29
39
|
baseUrl: TOKENPLAN_BASE_URL,
|
|
30
|
-
catalogModels:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
40
|
+
catalogModels: TOKENPLAN_MODEL_CATALOG.map(buildTokenPlanModelDefinition)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function applyTokenPlanConfig(cfg) {
|
|
44
|
+
return applyAgentDefaultModelPrimary(applyTokenPlanProviderConfig(cfg), TOKENPLAN_DEFAULT_MODEL_REF);
|
|
45
|
+
}
|
|
37
46
|
//#endregion
|
|
38
|
-
export { TOKENHUB_DEFAULT_MODEL_REF, TOKENPLAN_DEFAULT_MODEL_REF, applyTokenHubConfig, applyTokenPlanConfig };
|
|
47
|
+
export { TOKENHUB_DEFAULT_MODEL_REF, TOKENHUB_PREVIEW_MODEL_REF, TOKENPLAN_DEFAULT_MODEL_REF, applyTokenHubConfig, applyTokenPlanConfig };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as TOKENPLAN_MODEL_CATALOG, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, t as TOKENHUB_BASE_URL } from "
|
|
1
|
+
import { a as TOKENPLAN_MODEL_CATALOG, c as buildTokenPlanModelDefinition, i as TOKENPLAN_BASE_URL, n as TOKENHUB_MODEL_CATALOG, s as buildTokenHubModelDefinition, t as TOKENHUB_BASE_URL } from "./.setup/models-BQhpfSMm.mjs";
|
|
2
2
|
//#region extensions/tencent/provider-catalog.ts
|
|
3
3
|
function buildTokenHubProvider() {
|
|
4
4
|
return {
|
|
5
5
|
baseUrl: TOKENHUB_BASE_URL,
|
|
6
6
|
api: "openai-completions",
|
|
7
|
-
models:
|
|
7
|
+
models: TOKENHUB_MODEL_CATALOG.map(buildTokenHubModelDefinition)
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
function buildTokenPlanProvider() {
|
|
11
11
|
return {
|
|
12
12
|
baseUrl: TOKENPLAN_BASE_URL,
|
|
13
13
|
api: "openai-completions",
|
|
14
|
-
models:
|
|
14
|
+
models: TOKENPLAN_MODEL_CATALOG.map(buildTokenPlanModelDefinition)
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
package/dist/stream.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID } from "
|
|
1
|
+
import { o as TOKENPLAN_PROVIDER_ID, r as TOKENHUB_PROVIDER_ID } from "./.setup/models-BQhpfSMm.mjs";
|
|
2
2
|
import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
3
3
|
//#region extensions/tencent/stream.ts
|
|
4
4
|
const TENCENT_PROVIDER_IDS = /* @__PURE__ */ new Set([TOKENHUB_PROVIDER_ID, TOKENPLAN_PROVIDER_ID]);
|
package/openclaw.plugin.json
CHANGED
|
@@ -4,24 +4,26 @@
|
|
|
4
4
|
"onStartup": false
|
|
5
5
|
},
|
|
6
6
|
"enabledByDefault": true,
|
|
7
|
-
"providerCatalogEntry": "./provider-discovery.
|
|
8
|
-
"providers": [
|
|
7
|
+
"providerCatalogEntry": "./dist/provider-discovery.js",
|
|
8
|
+
"providers": [
|
|
9
|
+
"tencent-tokenhub",
|
|
10
|
+
"tencent-tokenplan"
|
|
11
|
+
],
|
|
9
12
|
"modelCatalog": {
|
|
10
13
|
"providers": {
|
|
11
14
|
"tencent-tokenhub": {
|
|
12
15
|
"baseUrl": "https://tokenhub.tencentmaas.com/v1",
|
|
13
16
|
"api": "openai-completions",
|
|
14
|
-
"defaultModel": "hy3",
|
|
15
17
|
"models": [
|
|
16
18
|
{
|
|
17
19
|
"id": "hy3-preview",
|
|
18
20
|
"name": "Hy3 preview (TokenHub)",
|
|
19
|
-
"status": "deprecated",
|
|
20
|
-
"replacedBy": "hy3",
|
|
21
21
|
"reasoning": true,
|
|
22
|
-
"input": [
|
|
22
|
+
"input": [
|
|
23
|
+
"text"
|
|
24
|
+
],
|
|
23
25
|
"contextWindow": 256000,
|
|
24
|
-
"maxTokens":
|
|
26
|
+
"maxTokens": 64000,
|
|
25
27
|
"cost": {
|
|
26
28
|
"input": 0.176,
|
|
27
29
|
"output": 0.587,
|
|
@@ -33,47 +35,58 @@
|
|
|
33
35
|
"output": 0.587,
|
|
34
36
|
"cacheRead": 0.059,
|
|
35
37
|
"cacheWrite": 0,
|
|
36
|
-
"range": [
|
|
38
|
+
"range": [
|
|
39
|
+
0,
|
|
40
|
+
16000
|
|
41
|
+
]
|
|
37
42
|
},
|
|
38
43
|
{
|
|
39
44
|
"input": 0.235,
|
|
40
45
|
"output": 0.939,
|
|
41
46
|
"cacheRead": 0.088,
|
|
42
47
|
"cacheWrite": 0,
|
|
43
|
-
"range": [
|
|
48
|
+
"range": [
|
|
49
|
+
16000,
|
|
50
|
+
32000
|
|
51
|
+
]
|
|
44
52
|
},
|
|
45
53
|
{
|
|
46
54
|
"input": 0.293,
|
|
47
55
|
"output": 1.173,
|
|
48
56
|
"cacheRead": 0.117,
|
|
49
57
|
"cacheWrite": 0,
|
|
50
|
-
"range": [
|
|
58
|
+
"range": [
|
|
59
|
+
32000
|
|
60
|
+
]
|
|
51
61
|
}
|
|
52
62
|
]
|
|
53
63
|
},
|
|
54
64
|
"compat": {
|
|
55
65
|
"supportsUsageInStreaming": true,
|
|
56
66
|
"supportsReasoningEffort": true,
|
|
57
|
-
"supportedReasoningEfforts": [
|
|
67
|
+
"supportedReasoningEfforts": [
|
|
68
|
+
"none",
|
|
69
|
+
"low",
|
|
70
|
+
"high"
|
|
71
|
+
]
|
|
58
72
|
}
|
|
59
73
|
},
|
|
60
74
|
{
|
|
61
75
|
"id": "hy3",
|
|
62
76
|
"name": "Hy3 (TokenHub)",
|
|
63
77
|
"reasoning": true,
|
|
64
|
-
"input": [
|
|
78
|
+
"input": [
|
|
79
|
+
"text"
|
|
80
|
+
],
|
|
65
81
|
"contextWindow": 256000,
|
|
66
|
-
"maxTokens":
|
|
67
|
-
"cost": {
|
|
68
|
-
"input": 0.147,
|
|
69
|
-
"output": 0.587,
|
|
70
|
-
"cacheRead": 0.037,
|
|
71
|
-
"cacheWrite": 0
|
|
72
|
-
},
|
|
82
|
+
"maxTokens": 64000,
|
|
73
83
|
"compat": {
|
|
74
84
|
"supportsUsageInStreaming": true,
|
|
75
85
|
"supportsReasoningEffort": true,
|
|
76
|
-
"supportedReasoningEfforts": [
|
|
86
|
+
"supportedReasoningEfforts": [
|
|
87
|
+
"none",
|
|
88
|
+
"high"
|
|
89
|
+
]
|
|
77
90
|
}
|
|
78
91
|
}
|
|
79
92
|
]
|
|
@@ -81,38 +94,46 @@
|
|
|
81
94
|
"tencent-tokenplan": {
|
|
82
95
|
"baseUrl": "https://api.lkeap.cloud.tencent.com/plan/v3",
|
|
83
96
|
"api": "openai-completions",
|
|
84
|
-
"defaultModel": "hy3",
|
|
85
97
|
"models": [
|
|
86
98
|
{
|
|
87
99
|
"id": "hy3",
|
|
88
100
|
"name": "Hy3 (TokenPlan)",
|
|
89
101
|
"reasoning": true,
|
|
90
|
-
"input": [
|
|
102
|
+
"input": [
|
|
103
|
+
"text"
|
|
104
|
+
],
|
|
91
105
|
"contextWindow": 256000,
|
|
92
|
-
"maxTokens":
|
|
106
|
+
"maxTokens": 64000,
|
|
93
107
|
"compat": {
|
|
94
108
|
"supportsUsageInStreaming": true,
|
|
95
109
|
"supportsReasoningEffort": true,
|
|
96
|
-
"supportedReasoningEfforts": [
|
|
110
|
+
"supportedReasoningEfforts": [
|
|
111
|
+
"none",
|
|
112
|
+
"high"
|
|
113
|
+
]
|
|
97
114
|
}
|
|
98
115
|
}
|
|
99
116
|
]
|
|
100
117
|
}
|
|
101
118
|
},
|
|
102
119
|
"discovery": {
|
|
103
|
-
"tencent-tokenhub": "
|
|
104
|
-
"tencent-tokenplan": "
|
|
120
|
+
"tencent-tokenhub": "static",
|
|
121
|
+
"tencent-tokenplan": "static"
|
|
105
122
|
}
|
|
106
123
|
},
|
|
107
124
|
"setup": {
|
|
108
125
|
"providers": [
|
|
109
126
|
{
|
|
110
127
|
"id": "tencent-tokenhub",
|
|
111
|
-
"envVars": [
|
|
128
|
+
"envVars": [
|
|
129
|
+
"TOKENHUB_API_KEY"
|
|
130
|
+
]
|
|
112
131
|
},
|
|
113
132
|
{
|
|
114
133
|
"id": "tencent-tokenplan",
|
|
115
|
-
"envVars": [
|
|
134
|
+
"envVars": [
|
|
135
|
+
"TOKENPLAN_API_KEY"
|
|
136
|
+
]
|
|
116
137
|
}
|
|
117
138
|
]
|
|
118
139
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tencent-provider",
|
|
3
|
-
"version": "2026.7.
|
|
3
|
+
"version": "2026.7.33",
|
|
4
4
|
"description": "OpenClaw Tencent Cloud provider plugin (TokenHub + Token Plan)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"minHostVersion": ">=2026.6.9"
|
|
16
16
|
},
|
|
17
17
|
"compat": {
|
|
18
|
-
"pluginApi": ">=2026.7.
|
|
18
|
+
"pluginApi": ">=2026.7.33"
|
|
19
19
|
},
|
|
20
20
|
"build": {
|
|
21
|
-
"openclawVersion": "2026.7.
|
|
21
|
+
"openclawVersion": "2026.7.33",
|
|
22
22
|
"bundledDist": false
|
|
23
23
|
},
|
|
24
24
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"README.md"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.7.
|
|
43
|
+
"openclaw": ">=2026.7.33"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|
package/dist/models-CofAdRJ3.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { buildManifestModelDefinition } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
-
//#region extensions/tencent/openclaw.plugin.json
|
|
3
|
-
var openclaw_plugin_default = {
|
|
4
|
-
id: "tencent",
|
|
5
|
-
activation: { "onStartup": false },
|
|
6
|
-
enabledByDefault: true,
|
|
7
|
-
providerCatalogEntry: "./provider-discovery.ts",
|
|
8
|
-
providers: ["tencent-tokenhub", "tencent-tokenplan"],
|
|
9
|
-
modelCatalog: {
|
|
10
|
-
"providers": {
|
|
11
|
-
"tencent-tokenhub": {
|
|
12
|
-
"baseUrl": "https://tokenhub.tencentmaas.com/v1",
|
|
13
|
-
"api": "openai-completions",
|
|
14
|
-
"defaultModel": "hy3",
|
|
15
|
-
"models": [{
|
|
16
|
-
"id": "hy3-preview",
|
|
17
|
-
"name": "Hy3 preview (TokenHub)",
|
|
18
|
-
"status": "deprecated",
|
|
19
|
-
"replacedBy": "hy3",
|
|
20
|
-
"reasoning": true,
|
|
21
|
-
"input": ["text"],
|
|
22
|
-
"contextWindow": 256e3,
|
|
23
|
-
"maxTokens": 128e3,
|
|
24
|
-
"cost": {
|
|
25
|
-
"input": .176,
|
|
26
|
-
"output": .587,
|
|
27
|
-
"cacheRead": .059,
|
|
28
|
-
"cacheWrite": 0,
|
|
29
|
-
"tieredPricing": [
|
|
30
|
-
{
|
|
31
|
-
"input": .176,
|
|
32
|
-
"output": .587,
|
|
33
|
-
"cacheRead": .059,
|
|
34
|
-
"cacheWrite": 0,
|
|
35
|
-
"range": [0, 16e3]
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"input": .235,
|
|
39
|
-
"output": .939,
|
|
40
|
-
"cacheRead": .088,
|
|
41
|
-
"cacheWrite": 0,
|
|
42
|
-
"range": [16e3, 32e3]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"input": .293,
|
|
46
|
-
"output": 1.173,
|
|
47
|
-
"cacheRead": .117,
|
|
48
|
-
"cacheWrite": 0,
|
|
49
|
-
"range": [32e3]
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
"compat": {
|
|
54
|
-
"supportsUsageInStreaming": true,
|
|
55
|
-
"supportsReasoningEffort": true,
|
|
56
|
-
"supportedReasoningEfforts": [
|
|
57
|
-
"none",
|
|
58
|
-
"low",
|
|
59
|
-
"high"
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
"id": "hy3",
|
|
64
|
-
"name": "Hy3 (TokenHub)",
|
|
65
|
-
"reasoning": true,
|
|
66
|
-
"input": ["text"],
|
|
67
|
-
"contextWindow": 256e3,
|
|
68
|
-
"maxTokens": 128e3,
|
|
69
|
-
"cost": {
|
|
70
|
-
"input": .147,
|
|
71
|
-
"output": .587,
|
|
72
|
-
"cacheRead": .037,
|
|
73
|
-
"cacheWrite": 0
|
|
74
|
-
},
|
|
75
|
-
"compat": {
|
|
76
|
-
"supportsUsageInStreaming": true,
|
|
77
|
-
"supportsReasoningEffort": true,
|
|
78
|
-
"supportedReasoningEfforts": [
|
|
79
|
-
"none",
|
|
80
|
-
"low",
|
|
81
|
-
"high"
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
}]
|
|
85
|
-
},
|
|
86
|
-
"tencent-tokenplan": {
|
|
87
|
-
"baseUrl": "https://api.lkeap.cloud.tencent.com/plan/v3",
|
|
88
|
-
"api": "openai-completions",
|
|
89
|
-
"defaultModel": "hy3",
|
|
90
|
-
"models": [{
|
|
91
|
-
"id": "hy3",
|
|
92
|
-
"name": "Hy3 (TokenPlan)",
|
|
93
|
-
"reasoning": true,
|
|
94
|
-
"input": ["text"],
|
|
95
|
-
"contextWindow": 256e3,
|
|
96
|
-
"maxTokens": 128e3,
|
|
97
|
-
"compat": {
|
|
98
|
-
"supportsUsageInStreaming": true,
|
|
99
|
-
"supportsReasoningEffort": true,
|
|
100
|
-
"supportedReasoningEfforts": [
|
|
101
|
-
"none",
|
|
102
|
-
"low",
|
|
103
|
-
"high"
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
}]
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"discovery": {
|
|
110
|
-
"tencent-tokenhub": "refreshable",
|
|
111
|
-
"tencent-tokenplan": "refreshable"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
setup: { "providers": [{
|
|
115
|
-
"id": "tencent-tokenhub",
|
|
116
|
-
"envVars": ["TOKENHUB_API_KEY"]
|
|
117
|
-
}, {
|
|
118
|
-
"id": "tencent-tokenplan",
|
|
119
|
-
"envVars": ["TOKENPLAN_API_KEY"]
|
|
120
|
-
}] },
|
|
121
|
-
configContracts: { "compatibilityMigrationPaths": [
|
|
122
|
-
"models.providers.tencent-tokenhub",
|
|
123
|
-
"agents.defaults.models.tencent-tokenhub/hy3",
|
|
124
|
-
"agents.defaults.models.tencent-tokenhub/hy3-preview"
|
|
125
|
-
] },
|
|
126
|
-
providerAuthChoices: [{
|
|
127
|
-
"provider": "tencent-tokenhub",
|
|
128
|
-
"method": "api-key",
|
|
129
|
-
"choiceId": "tokenhub-api-key",
|
|
130
|
-
"appGuidedSecret": true,
|
|
131
|
-
"choiceLabel": "Tencent TokenHub",
|
|
132
|
-
"groupId": "tencent",
|
|
133
|
-
"groupLabel": "Tencent Cloud",
|
|
134
|
-
"groupHint": "Tencent TokenHub",
|
|
135
|
-
"optionKey": "tokenhubApiKey",
|
|
136
|
-
"cliFlag": "--tokenhub-api-key",
|
|
137
|
-
"cliOption": "--tokenhub-api-key <key>",
|
|
138
|
-
"cliDescription": "Tencent TokenHub API key"
|
|
139
|
-
}, {
|
|
140
|
-
"provider": "tencent-tokenplan",
|
|
141
|
-
"method": "api-key",
|
|
142
|
-
"choiceId": "tokenplan-api-key",
|
|
143
|
-
"appGuidedSecret": true,
|
|
144
|
-
"choiceLabel": "Tencent TokenPlan",
|
|
145
|
-
"groupId": "tencent",
|
|
146
|
-
"groupLabel": "Tencent Cloud",
|
|
147
|
-
"groupHint": "Tencent TokenPlan",
|
|
148
|
-
"optionKey": "tokenplanApiKey",
|
|
149
|
-
"cliFlag": "--tokenplan-api-key",
|
|
150
|
-
"cliOption": "--tokenplan-api-key <key>",
|
|
151
|
-
"cliDescription": "Tencent TokenPlan API key"
|
|
152
|
-
}],
|
|
153
|
-
configSchema: {
|
|
154
|
-
"type": "object",
|
|
155
|
-
"additionalProperties": false,
|
|
156
|
-
"properties": {}
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
//#endregion
|
|
160
|
-
//#region extensions/tencent/models.ts
|
|
161
|
-
const TOKENHUB_PROVIDER_ID = "tencent-tokenhub";
|
|
162
|
-
const TOKENHUB_BASE_URL = openclaw_plugin_default.modelCatalog.providers[TOKENHUB_PROVIDER_ID].baseUrl;
|
|
163
|
-
const TOKENHUB_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers[TOKENHUB_PROVIDER_ID];
|
|
164
|
-
const TOKENHUB_MODEL_CATALOG = TOKENHUB_MANIFEST_CATALOG.models.map(buildManifestModelDefinition({
|
|
165
|
-
providerId: TOKENHUB_PROVIDER_ID,
|
|
166
|
-
catalog: TOKENHUB_MANIFEST_CATALOG,
|
|
167
|
-
decorate: (model) => ({
|
|
168
|
-
...model,
|
|
169
|
-
api: "openai-completions"
|
|
170
|
-
})
|
|
171
|
-
}));
|
|
172
|
-
const TOKENPLAN_PROVIDER_ID = "tencent-tokenplan";
|
|
173
|
-
const TOKENPLAN_BASE_URL = openclaw_plugin_default.modelCatalog.providers[TOKENPLAN_PROVIDER_ID].baseUrl;
|
|
174
|
-
const TOKENPLAN_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers[TOKENPLAN_PROVIDER_ID];
|
|
175
|
-
const TOKENPLAN_MODEL_CATALOG = TOKENPLAN_MANIFEST_CATALOG.models.map(buildManifestModelDefinition({
|
|
176
|
-
providerId: TOKENPLAN_PROVIDER_ID,
|
|
177
|
-
catalog: TOKENPLAN_MANIFEST_CATALOG,
|
|
178
|
-
decorate: (model) => ({
|
|
179
|
-
...model,
|
|
180
|
-
api: "openai-completions"
|
|
181
|
-
})
|
|
182
|
-
}));
|
|
183
|
-
//#endregion
|
|
184
|
-
export { TOKENPLAN_MODEL_CATALOG as a, TOKENPLAN_BASE_URL as i, TOKENHUB_MODEL_CATALOG as n, TOKENPLAN_PROVIDER_ID as o, TOKENHUB_PROVIDER_ID as r, openclaw_plugin_default as s, TOKENHUB_BASE_URL as t };
|