@openclaw/stepfun-provider 2026.9.4 → 2026.9.6
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.
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 84.47 84.47">
|
|
2
|
+
<!--
|
|
3
|
+
Adapted from OpenClaw ui/public/provider-icons/ProviderIcon-stepfun.svg.
|
|
4
|
+
Source: https://github.com/steipete/CodexBar/blob/215efbd39ad58acb4b0cd637c407d63e6183bc8d/Sources/CodexBar/Resources/ProviderIcon-stepfun.svg
|
|
5
|
+
|
|
6
|
+
MIT License
|
|
7
|
+
Copyright (c) 2026 Peter Steinberger
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Names and marks remain the property of their respective owners.
|
|
28
|
+
-->
|
|
29
|
+
<path fill="currentColor" stroke="none" d="M0 0 m42.23,0C18.91,0,0,18.91,0,42.23s18.91,42.23,42.23,42.23,42.23-18.91,42.23-42.23S65.56,0,42.23,0Zm-11.35,69.03h-15.44v-15.44h15.44v15.44Zm19.07,0h-15.44v-15.44h15.44v15.44Zm0-19.08h-15.44v-15.44h15.44v15.44Zm0-19.07h-15.44v-15.44h15.44v15.44Zm19.07,0h-15.44v-15.44h15.44v15.44Z" />
|
|
30
|
+
</svg>
|
package/assets/icon.png
ADDED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,42 @@
|
|
|
1
|
-
import { a as STEPFUN_PLAN_PROVIDER_ID, c as STEPFUN_STANDARD_INTL_BASE_URL, i as STEPFUN_PLAN_INTL_BASE_URL, l as buildStepFunPlanProvider, n as STEPFUN_PLAN_CN_BASE_URL, o as STEPFUN_PROVIDER_ID, r as STEPFUN_PLAN_DEFAULT_MODEL_REF, s as STEPFUN_STANDARD_CN_BASE_URL, t as STEPFUN_DEFAULT_MODEL_REF, u as buildStepFunProvider } from "
|
|
1
|
+
import { a as STEPFUN_PLAN_PROVIDER_ID, c as STEPFUN_STANDARD_INTL_BASE_URL, i as STEPFUN_PLAN_INTL_BASE_URL, l as buildStepFunPlanProvider, n as STEPFUN_PLAN_CN_BASE_URL, o as STEPFUN_PROVIDER_ID, r as STEPFUN_PLAN_DEFAULT_MODEL_REF, s as STEPFUN_STANDARD_CN_BASE_URL, t as STEPFUN_DEFAULT_MODEL_REF, u as buildStepFunProvider } from "./.setup/provider-catalog-BXohNkBo.mjs";
|
|
2
2
|
import { applyStepFunPlanConfig, applyStepFunPlanConfigCn, applyStepFunStandardConfig, applyStepFunStandardConfigCn } from "./onboard.js";
|
|
3
3
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
4
4
|
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
|
5
5
|
import { buildOpenAICompatibleLiveProviderCatalog } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
//#region extensions/stepfun/index.ts
|
|
8
|
+
const STEPFUN_SURFACES = {
|
|
9
|
+
standard: {
|
|
10
|
+
providerId: STEPFUN_PROVIDER_ID,
|
|
11
|
+
label: "StepFun",
|
|
12
|
+
authLabel: "StepFun Standard",
|
|
13
|
+
defaultModel: STEPFUN_DEFAULT_MODEL_REF,
|
|
14
|
+
baseUrls: {
|
|
15
|
+
cn: STEPFUN_STANDARD_CN_BASE_URL,
|
|
16
|
+
intl: STEPFUN_STANDARD_INTL_BASE_URL
|
|
17
|
+
},
|
|
18
|
+
buildProvider: buildStepFunProvider,
|
|
19
|
+
applyConfig: {
|
|
20
|
+
cn: applyStepFunStandardConfigCn,
|
|
21
|
+
intl: applyStepFunStandardConfig
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
plan: {
|
|
25
|
+
providerId: STEPFUN_PLAN_PROVIDER_ID,
|
|
26
|
+
label: "StepFun Step Plan",
|
|
27
|
+
authLabel: "StepFun Step Plan",
|
|
28
|
+
defaultModel: STEPFUN_PLAN_DEFAULT_MODEL_REF,
|
|
29
|
+
baseUrls: {
|
|
30
|
+
cn: STEPFUN_PLAN_CN_BASE_URL,
|
|
31
|
+
intl: STEPFUN_PLAN_INTL_BASE_URL
|
|
32
|
+
},
|
|
33
|
+
buildProvider: buildStepFunPlanProvider,
|
|
34
|
+
applyConfig: {
|
|
35
|
+
cn: applyStepFunPlanConfigCn,
|
|
36
|
+
intl: applyStepFunPlanConfig
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
8
40
|
function trimExplicitBaseUrl(ctx, providerId) {
|
|
9
41
|
const explicitProvider = ctx.config.models?.providers?.[providerId];
|
|
10
42
|
return (typeof explicitProvider?.baseUrl === "string" ? explicitProvider.baseUrl.trim() : "") || void 0;
|
|
@@ -30,10 +62,6 @@ function inferRegionFromEnv(env) {
|
|
|
30
62
|
function inferRegionFromExplicitBaseUrls(ctx) {
|
|
31
63
|
return inferRegionFromBaseUrl(trimExplicitBaseUrl(ctx, "stepfun")) ?? inferRegionFromBaseUrl(trimExplicitBaseUrl(ctx, "stepfun-plan"));
|
|
32
64
|
}
|
|
33
|
-
function resolveDefaultBaseUrl(surface, region) {
|
|
34
|
-
if (surface === "plan") return region === "cn" ? STEPFUN_PLAN_CN_BASE_URL : STEPFUN_PLAN_INTL_BASE_URL;
|
|
35
|
-
return region === "cn" ? STEPFUN_STANDARD_CN_BASE_URL : STEPFUN_STANDARD_INTL_BASE_URL;
|
|
36
|
-
}
|
|
37
65
|
async function resolveStepFunCatalog(ctx, params) {
|
|
38
66
|
const profileAuth = ctx.resolveProviderAuth(params.providerId);
|
|
39
67
|
const auth = profileAuth.apiKey ? profileAuth : ctx.resolveProviderApiKey(params.providerId);
|
|
@@ -41,8 +69,9 @@ async function resolveStepFunCatalog(ctx, params) {
|
|
|
41
69
|
if (!apiKey) return null;
|
|
42
70
|
const explicitBaseUrl = trimExplicitBaseUrl(ctx, params.providerId);
|
|
43
71
|
const region = inferRegionFromBaseUrl(explicitBaseUrl) ?? inferRegionFromExplicitBaseUrls(ctx) ?? inferRegionFromProfileId(auth.profileId) ?? inferRegionFromEnv(ctx.env);
|
|
44
|
-
const
|
|
45
|
-
const
|
|
72
|
+
const provider = STEPFUN_SURFACES[params.surface];
|
|
73
|
+
const baseUrl = explicitBaseUrl ?? provider.baseUrls[region ?? "intl"];
|
|
74
|
+
const providerConfig = provider.buildProvider(baseUrl);
|
|
46
75
|
return await buildOpenAICompatibleLiveProviderCatalog({
|
|
47
76
|
discoveryMode: "strict",
|
|
48
77
|
providerId: params.providerId,
|
|
@@ -55,26 +84,30 @@ async function resolveStepFunCatalog(ctx, params) {
|
|
|
55
84
|
function resolveProfileIds(region) {
|
|
56
85
|
return region === "cn" ? ["stepfun:cn", "stepfun-plan:cn"] : ["stepfun:intl", "stepfun-plan:intl"];
|
|
57
86
|
}
|
|
58
|
-
function createStepFunApiKeyMethod(
|
|
87
|
+
function createStepFunApiKeyMethod(surface, region) {
|
|
88
|
+
const provider = STEPFUN_SURFACES[surface];
|
|
89
|
+
const methodId = `${surface}-api-key-${region}`;
|
|
90
|
+
const label = `${provider.authLabel} API key (${region === "cn" ? "China" : "Global/Intl"})`;
|
|
91
|
+
const hint = `Endpoint: ${provider.baseUrls[region].replace(/^https:\/\//u, "")}`;
|
|
59
92
|
return createProviderApiKeyAuthMethod({
|
|
60
|
-
providerId:
|
|
61
|
-
methodId
|
|
62
|
-
label
|
|
63
|
-
hint
|
|
93
|
+
providerId: provider.providerId,
|
|
94
|
+
methodId,
|
|
95
|
+
label,
|
|
96
|
+
hint,
|
|
64
97
|
optionKey: "stepfunApiKey",
|
|
65
98
|
flagName: "--stepfun-api-key",
|
|
66
99
|
envVar: "STEPFUN_API_KEY",
|
|
67
|
-
promptMessage:
|
|
68
|
-
profileIds: resolveProfileIds(
|
|
100
|
+
promptMessage: `Enter StepFun API key for ${region === "cn" ? "China" : "global"} endpoints`,
|
|
101
|
+
profileIds: resolveProfileIds(region),
|
|
69
102
|
allowProfile: false,
|
|
70
|
-
defaultModel:
|
|
103
|
+
defaultModel: provider.defaultModel,
|
|
71
104
|
preserveExistingPrimary: true,
|
|
72
105
|
expectedProviders: [STEPFUN_PROVIDER_ID, STEPFUN_PLAN_PROVIDER_ID],
|
|
73
|
-
applyConfig:
|
|
106
|
+
applyConfig: provider.applyConfig[region],
|
|
74
107
|
wizard: {
|
|
75
|
-
choiceId:
|
|
76
|
-
choiceLabel:
|
|
77
|
-
choiceHint:
|
|
108
|
+
choiceId: `stepfun-${methodId}`,
|
|
109
|
+
choiceLabel: label,
|
|
110
|
+
choiceHint: hint,
|
|
78
111
|
groupId: "stepfun",
|
|
79
112
|
groupLabel: "StepFun",
|
|
80
113
|
groupHint: "Standard / Step Plan (China / Global)"
|
|
@@ -86,90 +119,27 @@ var stepfun_default = definePluginEntry({
|
|
|
86
119
|
name: "StepFun",
|
|
87
120
|
description: "Bundled StepFun standard and Step Plan provider plugin",
|
|
88
121
|
register(api) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
hint: "Endpoint: api.stepfun.ai/v1",
|
|
111
|
-
region: "intl",
|
|
112
|
-
promptMessage: "Enter StepFun API key for global endpoints",
|
|
113
|
-
defaultModel: STEPFUN_DEFAULT_MODEL_REF,
|
|
114
|
-
choiceId: "stepfun-standard-api-key-intl",
|
|
115
|
-
choiceLabel: "StepFun Standard API key (Global/Intl)",
|
|
116
|
-
choiceHint: "Endpoint: api.stepfun.ai/v1",
|
|
117
|
-
applyConfig: applyStepFunStandardConfig
|
|
118
|
-
})],
|
|
119
|
-
catalog: {
|
|
120
|
-
order: "paired",
|
|
121
|
-
run: async (ctx) => resolveStepFunCatalog(ctx, {
|
|
122
|
-
providerId: STEPFUN_PROVIDER_ID,
|
|
123
|
-
surface: "standard"
|
|
124
|
-
})
|
|
125
|
-
},
|
|
126
|
-
staticCatalog: {
|
|
127
|
-
order: "paired",
|
|
128
|
-
run: async () => ({ provider: buildStepFunProvider() })
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
api.registerProvider({
|
|
132
|
-
id: STEPFUN_PLAN_PROVIDER_ID,
|
|
133
|
-
label: "StepFun Step Plan",
|
|
134
|
-
docsPath: "/providers/stepfun",
|
|
135
|
-
envVars: ["STEPFUN_API_KEY"],
|
|
136
|
-
auth: [createStepFunApiKeyMethod({
|
|
137
|
-
providerId: STEPFUN_PLAN_PROVIDER_ID,
|
|
138
|
-
methodId: "plan-api-key-cn",
|
|
139
|
-
label: "StepFun Step Plan API key (China)",
|
|
140
|
-
hint: "Endpoint: api.stepfun.com/step_plan/v1",
|
|
141
|
-
region: "cn",
|
|
142
|
-
promptMessage: "Enter StepFun API key for China endpoints",
|
|
143
|
-
defaultModel: STEPFUN_PLAN_DEFAULT_MODEL_REF,
|
|
144
|
-
choiceId: "stepfun-plan-api-key-cn",
|
|
145
|
-
choiceLabel: "StepFun Step Plan API key (China)",
|
|
146
|
-
choiceHint: "Endpoint: api.stepfun.com/step_plan/v1",
|
|
147
|
-
applyConfig: applyStepFunPlanConfigCn
|
|
148
|
-
}), createStepFunApiKeyMethod({
|
|
149
|
-
providerId: STEPFUN_PLAN_PROVIDER_ID,
|
|
150
|
-
methodId: "plan-api-key-intl",
|
|
151
|
-
label: "StepFun Step Plan API key (Global/Intl)",
|
|
152
|
-
hint: "Endpoint: api.stepfun.ai/step_plan/v1",
|
|
153
|
-
region: "intl",
|
|
154
|
-
promptMessage: "Enter StepFun API key for global endpoints",
|
|
155
|
-
defaultModel: STEPFUN_PLAN_DEFAULT_MODEL_REF,
|
|
156
|
-
choiceId: "stepfun-plan-api-key-intl",
|
|
157
|
-
choiceLabel: "StepFun Step Plan API key (Global/Intl)",
|
|
158
|
-
choiceHint: "Endpoint: api.stepfun.ai/step_plan/v1",
|
|
159
|
-
applyConfig: applyStepFunPlanConfig
|
|
160
|
-
})],
|
|
161
|
-
catalog: {
|
|
162
|
-
order: "paired",
|
|
163
|
-
run: async (ctx) => resolveStepFunCatalog(ctx, {
|
|
164
|
-
providerId: STEPFUN_PLAN_PROVIDER_ID,
|
|
165
|
-
surface: "plan"
|
|
166
|
-
})
|
|
167
|
-
},
|
|
168
|
-
staticCatalog: {
|
|
169
|
-
order: "paired",
|
|
170
|
-
run: async () => ({ provider: buildStepFunPlanProvider() })
|
|
171
|
-
}
|
|
172
|
-
});
|
|
122
|
+
for (const surface of ["standard", "plan"]) {
|
|
123
|
+
const provider = STEPFUN_SURFACES[surface];
|
|
124
|
+
api.registerProvider({
|
|
125
|
+
id: provider.providerId,
|
|
126
|
+
label: provider.label,
|
|
127
|
+
docsPath: "/providers/stepfun",
|
|
128
|
+
envVars: ["STEPFUN_API_KEY"],
|
|
129
|
+
auth: ["cn", "intl"].map((region) => createStepFunApiKeyMethod(surface, region)),
|
|
130
|
+
catalog: {
|
|
131
|
+
order: "paired",
|
|
132
|
+
run: async (ctx) => resolveStepFunCatalog(ctx, {
|
|
133
|
+
providerId: provider.providerId,
|
|
134
|
+
surface
|
|
135
|
+
})
|
|
136
|
+
},
|
|
137
|
+
staticCatalog: {
|
|
138
|
+
order: "paired",
|
|
139
|
+
run: async () => ({ provider: provider.buildProvider() })
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
173
143
|
}
|
|
174
144
|
});
|
|
175
145
|
//#endregion
|
package/dist/onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as STEPFUN_PLAN_PROVIDER_ID, c as STEPFUN_STANDARD_INTL_BASE_URL, i as STEPFUN_PLAN_INTL_BASE_URL, l as buildStepFunPlanProvider, n as STEPFUN_PLAN_CN_BASE_URL, o as STEPFUN_PROVIDER_ID, r as STEPFUN_PLAN_DEFAULT_MODEL_REF, s as STEPFUN_STANDARD_CN_BASE_URL, t as STEPFUN_DEFAULT_MODEL_REF, u as buildStepFunProvider } from "
|
|
1
|
+
import { a as STEPFUN_PLAN_PROVIDER_ID, c as STEPFUN_STANDARD_INTL_BASE_URL, i as STEPFUN_PLAN_INTL_BASE_URL, l as buildStepFunPlanProvider, n as STEPFUN_PLAN_CN_BASE_URL, o as STEPFUN_PROVIDER_ID, r as STEPFUN_PLAN_DEFAULT_MODEL_REF, s as STEPFUN_STANDARD_CN_BASE_URL, t as STEPFUN_DEFAULT_MODEL_REF, u as buildStepFunProvider } from "./.setup/provider-catalog-BXohNkBo.mjs";
|
|
2
2
|
import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
3
|
//#region extensions/stepfun/onboard.ts
|
|
4
4
|
function createStepFunPresetAppliers(params) {
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as STEPFUN_PLAN_PROVIDER_ID, c as STEPFUN_STANDARD_INTL_BASE_URL, i as STEPFUN_PLAN_INTL_BASE_URL, l as buildStepFunPlanProvider, n as STEPFUN_PLAN_CN_BASE_URL, o as STEPFUN_PROVIDER_ID, r as STEPFUN_PLAN_DEFAULT_MODEL_REF, s as STEPFUN_STANDARD_CN_BASE_URL, t as STEPFUN_DEFAULT_MODEL_REF, u as buildStepFunProvider } from "
|
|
1
|
+
import { a as STEPFUN_PLAN_PROVIDER_ID, c as STEPFUN_STANDARD_INTL_BASE_URL, i as STEPFUN_PLAN_INTL_BASE_URL, l as buildStepFunPlanProvider, n as STEPFUN_PLAN_CN_BASE_URL, o as STEPFUN_PROVIDER_ID, r as STEPFUN_PLAN_DEFAULT_MODEL_REF, s as STEPFUN_STANDARD_CN_BASE_URL, t as STEPFUN_DEFAULT_MODEL_REF, u as buildStepFunProvider } from "./.setup/provider-catalog-BXohNkBo.mjs";
|
|
2
2
|
export { STEPFUN_DEFAULT_MODEL_REF, STEPFUN_PLAN_CN_BASE_URL, STEPFUN_PLAN_DEFAULT_MODEL_REF, STEPFUN_PLAN_INTL_BASE_URL, STEPFUN_PLAN_PROVIDER_ID, STEPFUN_PROVIDER_ID, STEPFUN_STANDARD_CN_BASE_URL, STEPFUN_STANDARD_INTL_BASE_URL, buildStepFunPlanProvider, buildStepFunProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/stepfun-provider",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.6",
|
|
4
4
|
"description": "OpenClaw StepFun provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.9"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.9.
|
|
21
|
+
"pluginApi": ">=2026.9.6"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
24
|
+
"openclawVersion": "2026.9.6",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
"files": [
|
|
36
36
|
"dist/**",
|
|
37
37
|
"openclaw.plugin.json",
|
|
38
|
-
"README.md"
|
|
38
|
+
"README.md",
|
|
39
|
+
"assets/icon.png",
|
|
40
|
+
"assets/activity.svg"
|
|
39
41
|
],
|
|
40
42
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.9.
|
|
43
|
+
"openclaw": ">=2026.9.6"
|
|
42
44
|
},
|
|
43
45
|
"peerDependenciesMeta": {
|
|
44
46
|
"openclaw": {
|
|
File without changes
|