@openclaw/stepfun-provider 2026.9.6 → 2026.9.8

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/assets/icon.png CHANGED
Binary file
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { applyStepFunPlanConfig, applyStepFunPlanConfigCn, applyStepFunStandardC
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
- import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
6
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  //#region extensions/stepfun/index.ts
8
8
  const STEPFUN_SURFACES = {
9
9
  standard: {
@@ -38,8 +38,7 @@ const STEPFUN_SURFACES = {
38
38
  }
39
39
  };
40
40
  function trimExplicitBaseUrl(ctx, providerId) {
41
- const explicitProvider = ctx.config.models?.providers?.[providerId];
42
- return (typeof explicitProvider?.baseUrl === "string" ? explicitProvider.baseUrl.trim() : "") || void 0;
41
+ return normalizeOptionalString(ctx.config.models?.providers?.[providerId]?.baseUrl);
43
42
  }
44
43
  function inferRegionFromBaseUrl(baseUrl) {
45
44
  if (!baseUrl) return;
@@ -56,19 +55,13 @@ function inferRegionFromProfileId(profileId) {
56
55
  if (profileId.includes(":cn")) return "cn";
57
56
  if (profileId.includes(":intl")) return "intl";
58
57
  }
59
- function inferRegionFromEnv(env) {
60
- if (env.STEPFUN_API_KEY?.trim()) return "intl";
61
- }
62
- function inferRegionFromExplicitBaseUrls(ctx) {
63
- return inferRegionFromBaseUrl(trimExplicitBaseUrl(ctx, "stepfun")) ?? inferRegionFromBaseUrl(trimExplicitBaseUrl(ctx, "stepfun-plan"));
64
- }
65
58
  async function resolveStepFunCatalog(ctx, params) {
66
59
  const profileAuth = ctx.resolveProviderAuth(params.providerId);
67
60
  const auth = profileAuth.apiKey ? profileAuth : ctx.resolveProviderApiKey(params.providerId);
68
61
  const apiKey = auth.apiKey;
69
62
  if (!apiKey) return null;
70
63
  const explicitBaseUrl = trimExplicitBaseUrl(ctx, params.providerId);
71
- const region = inferRegionFromBaseUrl(explicitBaseUrl) ?? inferRegionFromExplicitBaseUrls(ctx) ?? inferRegionFromProfileId(auth.profileId) ?? inferRegionFromEnv(ctx.env);
64
+ const region = inferRegionFromBaseUrl(explicitBaseUrl) ?? inferRegionFromBaseUrl(trimExplicitBaseUrl(ctx, "stepfun")) ?? inferRegionFromBaseUrl(trimExplicitBaseUrl(ctx, "stepfun-plan")) ?? inferRegionFromProfileId(auth.profileId);
72
65
  const provider = STEPFUN_SURFACES[params.surface];
73
66
  const baseUrl = explicitBaseUrl ?? provider.baseUrls[region ?? "intl"];
74
67
  const providerConfig = provider.buildProvider(baseUrl);
@@ -81,9 +74,6 @@ async function resolveStepFunCatalog(ctx, params) {
81
74
  profileId: auth.profileId
82
75
  });
83
76
  }
84
- function resolveProfileIds(region) {
85
- return region === "cn" ? ["stepfun:cn", "stepfun-plan:cn"] : ["stepfun:intl", "stepfun-plan:intl"];
86
- }
87
77
  function createStepFunApiKeyMethod(surface, region) {
88
78
  const provider = STEPFUN_SURFACES[surface];
89
79
  const methodId = `${surface}-api-key-${region}`;
@@ -98,7 +88,7 @@ function createStepFunApiKeyMethod(surface, region) {
98
88
  flagName: "--stepfun-api-key",
99
89
  envVar: "STEPFUN_API_KEY",
100
90
  promptMessage: `Enter StepFun API key for ${region === "cn" ? "China" : "global"} endpoints`,
101
- profileIds: resolveProfileIds(region),
91
+ profileIds: [`stepfun:${region}`, `stepfun-plan:${region}`],
102
92
  allowProfile: false,
103
93
  defaultModel: provider.defaultModel,
104
94
  preserveExistingPrimary: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/stepfun-provider",
3
- "version": "2026.9.6",
3
+ "version": "2026.9.8",
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.6"
21
+ "pluginApi": ">=2026.9.8"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.9.6",
24
+ "openclawVersion": "2026.9.8",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -40,7 +40,7 @@
40
40
  "assets/activity.svg"
41
41
  ],
42
42
  "peerDependencies": {
43
- "openclaw": ">=2026.9.6"
43
+ "openclaw": ">=2026.9.8"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "openclaw": {