@openclaw/tencent-provider 0.0.0 → 2026.6.11-beta.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/README.md +12 -2
- package/dist/api.js +3 -0
- package/dist/index.js +61 -0
- package/dist/models-BZXHEe2B.js +67 -0
- package/dist/models.js +2 -0
- package/dist/onboard.js +24 -0
- package/dist/provider-catalog.js +11 -0
- package/dist/provider-discovery.js +14 -0
- package/npm-shrinkwrap.json +12 -0
- package/openclaw.plugin.json +91 -0
- package/package.json +44 -7
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tencent Cloud OpenClaw provider
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official OpenClaw provider plugin for Tencent Cloud.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
openclaw plugins install @openclaw/tencent-provider
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Docs
|
|
12
|
+
|
|
13
|
+
See `docs/providers/tencent.md` in the OpenClaw repository, or the published docs at `https://docs.openclaw.ai/providers/tencent`.
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { i as buildTokenHubModelDefinition, n as TOKENHUB_MODEL_CATALOG, r as TOKENHUB_PROVIDER_ID, t as TOKENHUB_BASE_URL } from "./models-BZXHEe2B.js";
|
|
2
|
+
import { buildTokenHubProvider } from "./provider-catalog.js";
|
|
3
|
+
export { TOKENHUB_BASE_URL, TOKENHUB_MODEL_CATALOG, TOKENHUB_PROVIDER_ID, buildTokenHubModelDefinition, buildTokenHubProvider };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { n as TOKENHUB_MODEL_CATALOG, r as TOKENHUB_PROVIDER_ID } from "./models-BZXHEe2B.js";
|
|
2
|
+
import { buildTokenHubProvider } from "./provider-catalog.js";
|
|
3
|
+
import { TOKENHUB_DEFAULT_MODEL_REF, applyTokenHubConfig } from "./onboard.js";
|
|
4
|
+
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
5
|
+
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
|
6
|
+
import { buildSingleProviderApiKeyCatalog } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
7
|
+
//#region extensions/tencent/index.ts
|
|
8
|
+
function buildStaticCatalogEntries(providerId, catalog) {
|
|
9
|
+
return catalog.map((entry) => ({
|
|
10
|
+
provider: providerId,
|
|
11
|
+
id: entry.id,
|
|
12
|
+
name: entry.name,
|
|
13
|
+
reasoning: entry.reasoning,
|
|
14
|
+
input: [...entry.input],
|
|
15
|
+
contextWindow: entry.contextWindow
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
var tencent_default = definePluginEntry({
|
|
19
|
+
id: "tencent",
|
|
20
|
+
name: "Tencent Cloud Provider",
|
|
21
|
+
description: "Bundled Tencent Cloud provider plugin (TokenHub)",
|
|
22
|
+
register(api) {
|
|
23
|
+
api.registerProvider({
|
|
24
|
+
id: TOKENHUB_PROVIDER_ID,
|
|
25
|
+
label: "Tencent TokenHub",
|
|
26
|
+
docsPath: "/providers/tencent",
|
|
27
|
+
envVars: ["TOKENHUB_API_KEY"],
|
|
28
|
+
auth: [createProviderApiKeyAuthMethod({
|
|
29
|
+
providerId: TOKENHUB_PROVIDER_ID,
|
|
30
|
+
methodId: "api-key",
|
|
31
|
+
label: "Tencent TokenHub",
|
|
32
|
+
hint: "Hy via Tencent TokenHub Gateway",
|
|
33
|
+
optionKey: "tokenhubApiKey",
|
|
34
|
+
flagName: "--tokenhub-api-key",
|
|
35
|
+
envVar: "TOKENHUB_API_KEY",
|
|
36
|
+
promptMessage: "Enter Tencent TokenHub API key",
|
|
37
|
+
defaultModel: TOKENHUB_DEFAULT_MODEL_REF,
|
|
38
|
+
expectedProviders: [TOKENHUB_PROVIDER_ID],
|
|
39
|
+
applyConfig: (cfg) => applyTokenHubConfig(cfg),
|
|
40
|
+
wizard: {
|
|
41
|
+
choiceId: "tokenhub-api-key",
|
|
42
|
+
choiceLabel: "Tencent TokenHub",
|
|
43
|
+
groupId: "tencent",
|
|
44
|
+
groupLabel: "Tencent Cloud",
|
|
45
|
+
groupHint: "Tencent TokenHub"
|
|
46
|
+
}
|
|
47
|
+
})],
|
|
48
|
+
catalog: {
|
|
49
|
+
order: "simple",
|
|
50
|
+
run: (ctx) => buildSingleProviderApiKeyCatalog({
|
|
51
|
+
ctx,
|
|
52
|
+
providerId: TOKENHUB_PROVIDER_ID,
|
|
53
|
+
buildProvider: buildTokenHubProvider
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
augmentModelCatalog: () => buildStaticCatalogEntries(TOKENHUB_PROVIDER_ID, TOKENHUB_MODEL_CATALOG)
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
export { tencent_default as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
//#region extensions/tencent/openclaw.plugin.json
|
|
3
|
+
var modelCatalog = {
|
|
4
|
+
"providers": { "tencent-tokenhub": {
|
|
5
|
+
"baseUrl": "https://tokenhub.tencentmaas.com/v1",
|
|
6
|
+
"api": "openai-completions",
|
|
7
|
+
"models": [{
|
|
8
|
+
"id": "hy3-preview",
|
|
9
|
+
"name": "Hy3 preview (TokenHub)",
|
|
10
|
+
"reasoning": true,
|
|
11
|
+
"input": ["text"],
|
|
12
|
+
"contextWindow": 256e3,
|
|
13
|
+
"maxTokens": 64e3,
|
|
14
|
+
"cost": {
|
|
15
|
+
"input": .176,
|
|
16
|
+
"output": .587,
|
|
17
|
+
"cacheRead": .059,
|
|
18
|
+
"cacheWrite": 0,
|
|
19
|
+
"tieredPricing": [
|
|
20
|
+
{
|
|
21
|
+
"input": .176,
|
|
22
|
+
"output": .587,
|
|
23
|
+
"cacheRead": .059,
|
|
24
|
+
"cacheWrite": 0,
|
|
25
|
+
"range": [0, 16e3]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"input": .235,
|
|
29
|
+
"output": .939,
|
|
30
|
+
"cacheRead": .088,
|
|
31
|
+
"cacheWrite": 0,
|
|
32
|
+
"range": [16e3, 32e3]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"input": .293,
|
|
36
|
+
"output": 1.173,
|
|
37
|
+
"cacheRead": .117,
|
|
38
|
+
"cacheWrite": 0,
|
|
39
|
+
"range": [32e3]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"compat": {
|
|
44
|
+
"supportsUsageInStreaming": true,
|
|
45
|
+
"supportsReasoningEffort": true
|
|
46
|
+
}
|
|
47
|
+
}]
|
|
48
|
+
} },
|
|
49
|
+
"discovery": { "tencent-tokenhub": "static" }
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region extensions/tencent/models.ts
|
|
53
|
+
const TOKENHUB_PROVIDER_ID = "tencent-tokenhub";
|
|
54
|
+
const TOKENHUB_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
55
|
+
providerId: TOKENHUB_PROVIDER_ID,
|
|
56
|
+
catalog: modelCatalog.providers[TOKENHUB_PROVIDER_ID]
|
|
57
|
+
});
|
|
58
|
+
const TOKENHUB_BASE_URL = TOKENHUB_MANIFEST_PROVIDER.baseUrl;
|
|
59
|
+
const TOKENHUB_MODEL_CATALOG = TOKENHUB_MANIFEST_PROVIDER.models;
|
|
60
|
+
function buildTokenHubModelDefinition(model) {
|
|
61
|
+
return {
|
|
62
|
+
...model,
|
|
63
|
+
api: "openai-completions"
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { buildTokenHubModelDefinition as i, TOKENHUB_MODEL_CATALOG as n, TOKENHUB_PROVIDER_ID as r, TOKENHUB_BASE_URL as t };
|
package/dist/models.js
ADDED
package/dist/onboard.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { i as buildTokenHubModelDefinition, n as TOKENHUB_MODEL_CATALOG, r as TOKENHUB_PROVIDER_ID, t as TOKENHUB_BASE_URL } from "./models-BZXHEe2B.js";
|
|
2
|
+
import "./api.js";
|
|
3
|
+
import { applyAgentDefaultModelPrimary, applyProviderConfigWithModelCatalog } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
|
+
//#region extensions/tencent/onboard.ts
|
|
5
|
+
const TOKENHUB_DEFAULT_MODEL_REF = `${TOKENHUB_PROVIDER_ID}/hy3-preview`;
|
|
6
|
+
function applyTokenHubProviderConfig(cfg) {
|
|
7
|
+
const models = { ...cfg.agents?.defaults?.models };
|
|
8
|
+
models[TOKENHUB_DEFAULT_MODEL_REF] = {
|
|
9
|
+
...models[TOKENHUB_DEFAULT_MODEL_REF],
|
|
10
|
+
alias: models[TOKENHUB_DEFAULT_MODEL_REF]?.alias ?? "Hy3 preview (TokenHub)"
|
|
11
|
+
};
|
|
12
|
+
return applyProviderConfigWithModelCatalog(cfg, {
|
|
13
|
+
agentModels: models,
|
|
14
|
+
providerId: TOKENHUB_PROVIDER_ID,
|
|
15
|
+
api: "openai-completions",
|
|
16
|
+
baseUrl: TOKENHUB_BASE_URL,
|
|
17
|
+
catalogModels: TOKENHUB_MODEL_CATALOG.map(buildTokenHubModelDefinition)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function applyTokenHubConfig(cfg) {
|
|
21
|
+
return applyAgentDefaultModelPrimary(applyTokenHubProviderConfig(cfg), TOKENHUB_DEFAULT_MODEL_REF);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { TOKENHUB_DEFAULT_MODEL_REF, applyTokenHubConfig };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { i as buildTokenHubModelDefinition, n as TOKENHUB_MODEL_CATALOG, t as TOKENHUB_BASE_URL } from "./models-BZXHEe2B.js";
|
|
2
|
+
//#region extensions/tencent/provider-catalog.ts
|
|
3
|
+
function buildTokenHubProvider() {
|
|
4
|
+
return {
|
|
5
|
+
baseUrl: TOKENHUB_BASE_URL,
|
|
6
|
+
api: "openai-completions",
|
|
7
|
+
models: TOKENHUB_MODEL_CATALOG.map(buildTokenHubModelDefinition)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { buildTokenHubProvider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { buildTokenHubProvider } from "./provider-catalog.js";
|
|
2
|
+
//#region extensions/tencent/provider-discovery.ts
|
|
3
|
+
const tencentProviderDiscovery = {
|
|
4
|
+
id: "tencent-tokenhub",
|
|
5
|
+
label: "Tencent TokenHub",
|
|
6
|
+
docsPath: "/providers/models",
|
|
7
|
+
auth: [],
|
|
8
|
+
staticCatalog: {
|
|
9
|
+
order: "simple",
|
|
10
|
+
run: async () => ({ provider: buildTokenHubProvider() })
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { tencentProviderDiscovery as default };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "tencent",
|
|
3
|
+
"activation": {
|
|
4
|
+
"onStartup": false
|
|
5
|
+
},
|
|
6
|
+
"enabledByDefault": true,
|
|
7
|
+
"providerCatalogEntry": "./provider-discovery.ts",
|
|
8
|
+
"providers": ["tencent-tokenhub"],
|
|
9
|
+
"modelCatalog": {
|
|
10
|
+
"providers": {
|
|
11
|
+
"tencent-tokenhub": {
|
|
12
|
+
"baseUrl": "https://tokenhub.tencentmaas.com/v1",
|
|
13
|
+
"api": "openai-completions",
|
|
14
|
+
"models": [
|
|
15
|
+
{
|
|
16
|
+
"id": "hy3-preview",
|
|
17
|
+
"name": "Hy3 preview (TokenHub)",
|
|
18
|
+
"reasoning": true,
|
|
19
|
+
"input": ["text"],
|
|
20
|
+
"contextWindow": 256000,
|
|
21
|
+
"maxTokens": 64000,
|
|
22
|
+
"cost": {
|
|
23
|
+
"input": 0.176,
|
|
24
|
+
"output": 0.587,
|
|
25
|
+
"cacheRead": 0.059,
|
|
26
|
+
"cacheWrite": 0,
|
|
27
|
+
"tieredPricing": [
|
|
28
|
+
{
|
|
29
|
+
"input": 0.176,
|
|
30
|
+
"output": 0.587,
|
|
31
|
+
"cacheRead": 0.059,
|
|
32
|
+
"cacheWrite": 0,
|
|
33
|
+
"range": [0, 16000]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"input": 0.235,
|
|
37
|
+
"output": 0.939,
|
|
38
|
+
"cacheRead": 0.088,
|
|
39
|
+
"cacheWrite": 0,
|
|
40
|
+
"range": [16000, 32000]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"input": 0.293,
|
|
44
|
+
"output": 1.173,
|
|
45
|
+
"cacheRead": 0.117,
|
|
46
|
+
"cacheWrite": 0,
|
|
47
|
+
"range": [32000]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"compat": {
|
|
52
|
+
"supportsUsageInStreaming": true,
|
|
53
|
+
"supportsReasoningEffort": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"discovery": {
|
|
60
|
+
"tencent-tokenhub": "static"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"setup": {
|
|
64
|
+
"providers": [
|
|
65
|
+
{
|
|
66
|
+
"id": "tencent-tokenhub",
|
|
67
|
+
"envVars": ["TOKENHUB_API_KEY"]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"providerAuthChoices": [
|
|
72
|
+
{
|
|
73
|
+
"provider": "tencent-tokenhub",
|
|
74
|
+
"method": "api-key",
|
|
75
|
+
"choiceId": "tokenhub-api-key",
|
|
76
|
+
"choiceLabel": "Tencent TokenHub",
|
|
77
|
+
"groupId": "tencent",
|
|
78
|
+
"groupLabel": "Tencent Cloud",
|
|
79
|
+
"groupHint": "Tencent TokenHub",
|
|
80
|
+
"optionKey": "tokenhubApiKey",
|
|
81
|
+
"cliFlag": "--tokenhub-api-key",
|
|
82
|
+
"cliOption": "--tokenhub-api-key <key>",
|
|
83
|
+
"cliDescription": "Tencent TokenHub API key"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"configSchema": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"properties": {}
|
|
90
|
+
}
|
|
91
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tencent-provider",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2026.6.11-beta.2",
|
|
4
|
+
"description": "OpenClaw Tencent Cloud provider plugin (TokenHub + Token Plan)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"openclaw": {
|
|
7
|
+
"extensions": [
|
|
8
|
+
"./index.ts"
|
|
9
|
+
],
|
|
10
|
+
"install": {
|
|
11
|
+
"clawhubSpec": "clawhub:@openclaw/tencent-provider",
|
|
12
|
+
"npmSpec": "@openclaw/tencent-provider",
|
|
13
|
+
"defaultChoice": "npm",
|
|
14
|
+
"minHostVersion": ">=2026.6.9"
|
|
15
|
+
},
|
|
16
|
+
"compat": {
|
|
17
|
+
"pluginApi": ">=2026.6.11-beta.2"
|
|
18
|
+
},
|
|
19
|
+
"build": {
|
|
20
|
+
"openclawVersion": "2026.6.11-beta.2",
|
|
21
|
+
"bundledDist": false
|
|
22
|
+
},
|
|
23
|
+
"release": {
|
|
24
|
+
"publishToClawHub": true,
|
|
25
|
+
"publishToNpm": true
|
|
26
|
+
},
|
|
27
|
+
"runtimeExtensions": [
|
|
28
|
+
"./dist/index.js"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
5
31
|
"repository": {
|
|
6
32
|
"type": "git",
|
|
7
|
-
"url": "
|
|
33
|
+
"url": "https://github.com/openclaw/openclaw"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/**",
|
|
37
|
+
"openclaw.plugin.json",
|
|
38
|
+
"npm-shrinkwrap.json",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"openclaw": ">=2026.6.11-beta.2"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"openclaw": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
8
48
|
},
|
|
9
|
-
"
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
}
|
|
49
|
+
"bundledDependencies": []
|
|
13
50
|
}
|