@bubblebrain-ai/bubble 0.0.57 → 0.0.58
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 +6 -0
- package/dist/model-catalog.js +8 -5
- package/dist/model-pricing.d.ts +10 -6
- package/dist/model-pricing.js +0 -0
- package/dist/provider-transform.js +3 -0
- package/dist/provider.js +3 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -181,6 +181,12 @@ For Doubao Seed models on Volcengine Ark, run `/provider --add doubao` and paste
|
|
|
181
181
|
|
|
182
182
|
### Custom providers and models
|
|
183
183
|
|
|
184
|
+
For StepFun's standard API, run `/provider --add stepfun-api`, enter your API
|
|
185
|
+
key, then select `/model stepfun-api:water18-0910`. This uses OpenAI-compatible
|
|
186
|
+
Chat Completions at `https://api.stepfun.com/v1`, with streaming and agent tools.
|
|
187
|
+
The existing `stepfun` provider continues to use Step Plan. The API model uses
|
|
188
|
+
server-default reasoning; effort controls and pricing are not assumed.
|
|
189
|
+
|
|
184
190
|
For full control — custom base URLs, self-hosted gateways, extra models, or pinning a protocol — define providers in `~/.bubble/models.json`:
|
|
185
191
|
|
|
186
192
|
```json
|
package/dist/model-catalog.js
CHANGED
|
@@ -25,6 +25,7 @@ export const BUILTIN_PROVIDERS = [
|
|
|
25
25
|
{ id: "minimax", name: "MiniMax Token Plan", baseURL: "https://api.minimaxi.com/anthropic", protocol: "anthropic-messages" },
|
|
26
26
|
{ id: "minimax-anthropic", name: "MiniMax API", baseURL: "https://api.minimaxi.com/anthropic", protocol: "anthropic-messages" },
|
|
27
27
|
{ id: "stepfun", name: "StepFun Step Plan", baseURL: "https://api.stepfun.com/step_plan/v1" },
|
|
28
|
+
{ id: "stepfun-api", name: "StepFun API", baseURL: "https://api.stepfun.com/v1", protocol: "openai-chat" },
|
|
28
29
|
{ id: "moonshot-cn", name: "Moonshot (国内 platform.moonshot.cn)", baseURL: "https://api.moonshot.cn/v1" },
|
|
29
30
|
{ id: "moonshot-intl", name: "Moonshot (海外 platform.moonshot.ai)", baseURL: "https://api.moonshot.ai/v1" },
|
|
30
31
|
{ id: "kimi-for-coding", name: "Kimi for Coding", baseURL: "https://api.kimi.com/coding/v1" },
|
|
@@ -127,11 +128,11 @@ export const BUILTIN_MODELS = [
|
|
|
127
128
|
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6", providerId: "anthropic", tier: "balanced", reasoningLevels: ANTHROPIC_SONNET_EFFORT_LEVELS, defaultReasoningLevel: "high", contextWindow: 1000000 },
|
|
128
129
|
{ id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5", providerId: "anthropic", tier: "fast", reasoningLevels: ANTHROPIC_CHAT_LEVELS, contextWindow: 200000 },
|
|
129
130
|
{ id: "deepseek-v4-flash", name: "deepseek-v4-flash", providerId: "deepseek", tier: "fast", reasoningLevels: DEEPSEEK_V4_LEVELS, defaultReasoningLevel: "high", contextWindow: 1048576 },
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
//
|
|
134
|
-
//
|
|
131
|
+
// V4.1 Flash (2026-09-10): high is the default, not the only effort.
|
|
132
|
+
// https://api-docs.deepseek.com/guides/thinking_mode
|
|
133
|
+
{ id: "deepseek-flash", name: "deepseek-flash", providerId: "deepseek", reasoningLevels: DEEPSEEK_V4_LEVELS, defaultReasoningLevel: "high", contextWindow: 1048576 },
|
|
134
|
+
// Legacy vision alias now routes to V4.1 Flash. Keep its explicit-only
|
|
135
|
+
// routing policy; existing sessions can continue using the old model ID.
|
|
135
136
|
{ id: "deepseek-v4-flash-vision-exp", name: "DeepSeek-V4-Flash-Vision-Exp", providerId: "deepseek", reasoningLevels: DEEPSEEK_V4_LEVELS, defaultReasoningLevel: "high", contextWindow: 1048576 },
|
|
136
137
|
{ id: "deepseek-v4-pro", name: "deepseek-v4-pro", providerId: "deepseek", tier: "strong", reasoningLevels: DEEPSEEK_V4_LEVELS, defaultReasoningLevel: "high", contextWindow: 1048576 },
|
|
137
138
|
// Offline/no-key fallback only: with an API key the registry replaces this
|
|
@@ -192,6 +193,8 @@ export const BUILTIN_MODELS = [
|
|
|
192
193
|
{ id: "step-3.5-flash-2603", name: "Step 3.5 Flash 2603", providerId: "stepfun", reasoningLevels: STEPFUN_REASONING_LEVELS },
|
|
193
194
|
{ id: "step-3.5-flash", name: "Step 3.5 Flash", providerId: "stepfun", reasoningLevels: STEPFUN_REASONING_LEVELS },
|
|
194
195
|
{ id: "step-router-v1", name: "Step Router V1", providerId: "stepfun", reasoningLevels: STEPFUN_REASONING_LEVELS },
|
|
196
|
+
// Use server-default reasoning until this model's effort controls are documented.
|
|
197
|
+
{ id: "water18-0910", name: "water18-0910", providerId: "stepfun-api", reasoningLevels: [] },
|
|
195
198
|
{ id: "kimi-k2.7-code", name: "Kimi K2.7 Code", providerId: "moonshot-cn", tier: "strong", reasoningLevels: KIMI_THINKING_ONLY_LEVELS, contextWindow: 262144 },
|
|
196
199
|
{ id: "kimi-k2.7-code-highspeed", name: "Kimi K2.7 Code Highspeed", providerId: "moonshot-cn", tier: "fast", reasoningLevels: KIMI_THINKING_ONLY_LEVELS, contextWindow: 262144 },
|
|
197
200
|
{ id: "kimi-k3", name: "Kimi K3", providerId: "moonshot-cn", tier: "strong", reasoningLevels: KIMI_K3_LEVELS, defaultReasoningLevel: "high", contextWindow: 1048576 },
|
package/dist/model-pricing.d.ts
CHANGED
|
@@ -19,23 +19,27 @@ export interface UtcPricingWindow {
|
|
|
19
19
|
/** Exclusive minute since 00:00 UTC. */
|
|
20
20
|
endMinute: number;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
23
|
-
providerId: string;
|
|
24
|
-
modelId: string;
|
|
25
|
-
currency: PricingCurrency;
|
|
22
|
+
export interface ModelPricingTariff extends ModelPricingRate {
|
|
26
23
|
/**
|
|
27
24
|
* Optional recurring UTC time-of-use tariff. Top-level rates are the peak
|
|
28
25
|
* tariff; outside these windows, `offPeak` applies. DeepSeek introduced this
|
|
29
26
|
* pricing shape for the V4 family on 2026-08-16.
|
|
30
27
|
*/
|
|
31
28
|
peakWindowsUtc?: UtcPricingWindow[];
|
|
29
|
+
/** UTC weekdays with peak windows (0 = Sunday). Omitted means every day. */
|
|
30
|
+
peakWeekdaysUtc?: number[];
|
|
32
31
|
offPeak?: ModelPricingRate;
|
|
33
32
|
/** When the recurring tariff became effective. */
|
|
34
33
|
effectiveFrom?: string;
|
|
35
34
|
/** Rate used before `effectiveFrom` (for historical session statistics). */
|
|
36
|
-
prior?:
|
|
35
|
+
prior?: ModelPricingTariff;
|
|
37
36
|
effectiveUntil?: string;
|
|
38
|
-
original?:
|
|
37
|
+
original?: ModelPricingTariff;
|
|
38
|
+
}
|
|
39
|
+
export interface ModelPricing extends ModelPricingTariff {
|
|
40
|
+
providerId: string;
|
|
41
|
+
modelId: string;
|
|
42
|
+
currency: PricingCurrency;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Hand-maintained corrections layered over the generated models.dev snapshot.
|
package/dist/model-pricing.js
CHANGED
|
Binary file
|
|
@@ -112,6 +112,9 @@ export function resolveProviderRequestConfig(providerId, modelId, requestedLevel
|
|
|
112
112
|
},
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
+
if (providerId === "stepfun-api") {
|
|
116
|
+
return { effectiveThinkingLevel, reasoningContentEcho: "none" };
|
|
117
|
+
}
|
|
115
118
|
if (providerId === "stepfun") {
|
|
116
119
|
return {
|
|
117
120
|
effectiveThinkingLevel,
|
package/dist/provider.js
CHANGED
|
@@ -314,6 +314,7 @@ function shouldRequestStreamUsage(options) {
|
|
|
314
314
|
|| providerId === "zai-coding-plan"
|
|
315
315
|
// Bailian sends usage either way; ask explicitly so it stays guaranteed.
|
|
316
316
|
|| providerId === "bailian-token-plan"
|
|
317
|
+
|| providerId === "stepfun-api"
|
|
317
318
|
|| isMiniMaxOpenAICompatible(options);
|
|
318
319
|
}
|
|
319
320
|
function shouldUseNonStreamingToolCalls(options, tools, toolChoice) {
|
|
@@ -503,6 +504,7 @@ function usageToStreamChunk(usage) {
|
|
|
503
504
|
usage: {
|
|
504
505
|
promptTokens: typeof usage.prompt_tokens === "number" ? usage.prompt_tokens : 0,
|
|
505
506
|
completionTokens: typeof usage.completion_tokens === "number" ? usage.completion_tokens : 0,
|
|
507
|
+
outputTokensReported: typeof usage.completion_tokens === "number",
|
|
506
508
|
promptCacheHitTokens: typeof usage.prompt_cache_hit_tokens === "number"
|
|
507
509
|
? usage.prompt_cache_hit_tokens
|
|
508
510
|
: typeof usage.prompt_tokens_details?.cached_tokens === "number"
|
|
@@ -673,6 +675,7 @@ export async function* translateOpenAIStream(stream, options = {}) {
|
|
|
673
675
|
usage: {
|
|
674
676
|
promptTokens: typeof usage.prompt_tokens === "number" ? usage.prompt_tokens : 0,
|
|
675
677
|
completionTokens: typeof usage.completion_tokens === "number" ? usage.completion_tokens : 0,
|
|
678
|
+
outputTokensReported: typeof usage.completion_tokens === "number",
|
|
676
679
|
promptCacheHitTokens: typeof usage.prompt_cache_hit_tokens === "number"
|
|
677
680
|
? usage.prompt_cache_hit_tokens
|
|
678
681
|
: typeof usage.prompt_tokens_details?.cached_tokens === "number"
|
package/dist/types.d.ts
CHANGED
|
@@ -322,6 +322,8 @@ export type StreamChunk = {
|
|
|
322
322
|
type: "done";
|
|
323
323
|
};
|
|
324
324
|
export interface TokenUsage {
|
|
325
|
+
/** Whether the upstream response explicitly supplied completion_tokens. */
|
|
326
|
+
outputTokensReported?: boolean;
|
|
325
327
|
promptTokens: number;
|
|
326
328
|
completionTokens: number;
|
|
327
329
|
promptCacheHitTokens?: number;
|