@acosmi/sdk-ts 2.19.3 → 2.19.4

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.
@@ -328,6 +328,35 @@ interface WindowLimitStatus {
328
328
  * 严格模式切换入口), 周窗恒 false。老网关不返回时缺失。
329
329
  */
330
330
  overridable?: boolean;
331
+ /**
332
+ * [W-QUAD-CHAIN-20260914] 网关 `quota_summary.go` 的服务端合成位: 该窗已用满, 但用户的「继续」
333
+ * 开关正在放行。新网关恒下发, 老网关缺席 —— 缺席只说明网关没有这个字段, 不能当 false 读。
334
+ */
335
+ fiveHourSoftContinuing?: boolean;
336
+ /**
337
+ * [W-QUAD-CHAIN-20260914 D3-7] 窗口内在途预占 (微 Credits): 已被进行中的请求预扣、尚未结算的额度。
338
+ * `usedCredits` 只计已结算, 准入判定却按「已结算 + 在途」算 —— 本字段就是两者之差。
339
+ * 缺失 / null = 不知道 (老网关或取数失败), 不能当 0 读; 0 = 此刻没有在途。
340
+ */
341
+ inflightHeldCredits?: number | null;
342
+ }
343
+ /**
344
+ * 订阅池视图 — QuotaSummary.subscriptionPool 的形状。
345
+ *
346
+ * 由网关 `quota_summary.go` 从 alive 的 COMMERCIAL (付费) 桶派生。quota / used / remaining 的
347
+ * 数值单位为**微 Credits** (÷1000 = Credits)。
348
+ */
349
+ interface QuotaSummarySubscriptionPool {
350
+ /** 池总额度 (微 Credits) */
351
+ quota: number;
352
+ /** 已用额度 (微 Credits) */
353
+ used: number;
354
+ /** 剩余额度 (微 Credits) */
355
+ remaining: number;
356
+ /** 到期时间; 网关未下发时缺失 */
357
+ expiresAt?: string;
358
+ /** 网关下发的单位标识 */
359
+ unit: string;
331
360
  }
332
361
  /**
333
362
  * GET /api/v4/entitlements/quota-summary 返回体, 调用 client.getQuotaSummary 获取.
@@ -354,6 +383,11 @@ interface QuotaSummary {
354
383
  * 周配额; false=严格模式: 到达即等待恢复)。仅后端启用窗口限额时下发, 否则缺失。
355
384
  */
356
385
  windowFiveHourContinueEnabled?: boolean;
386
+ /**
387
+ * [W-QUAD-CHAIN-20260914] 订阅池: 网关由 alive 的 COMMERCIAL (付费) 桶派生, 数值单位为微 Credits
388
+ * (÷1000 = Credits)。缺席 = 老网关, 或当前没有 alive 付费桶 —— 两种都不可当 0 处理。
389
+ */
390
+ subscriptionPool?: QuotaSummarySubscriptionPool;
357
391
  }
358
392
  /**
359
393
  * GET /api/v4/entitlements/window-reset/summary 返回体, 调用 client.getWindowResetSummary 获取.
@@ -649,30 +683,4 @@ interface ProviderAdapter {
649
683
  };
650
684
  }
651
685
 
652
- /**
653
- * 根据 provider 返回对应的 adapter (v0.5.0 遗留 API, 向后兼容)
654
- * 新代码应使用 getAdapterForModel
655
- */
656
- declare function getAdapter(provider: string): ProviderAdapter;
657
- /**
658
- * 按 ManagedModel 的 preferred_format / supported_formats 选择 adapter
659
- *
660
- * 决策顺序:
661
- * 1. preferred_format 非空 **且** 该格式在 supported_formats 内 (或 supported_formats 未声明)
662
- * → 按其值返回 (anthropic | openai)
663
- * 2. supported_formats 含 "anthropic" → AnthropicAdapter
664
- * 3. supported_formats 含 "openai" → OpenAIAdapter
665
- * 4. 两字段均空 (旧上游) → 回落 provider 名硬编码 (原 getAdapter 行为)
666
- *
667
- * 这使得 dashscope / zhipu / deepseek 等 provider 的模型如果上游启用了
668
- * Anthropic 兼容端点, 也能走 /anthropic 路径, 不再被 provider 字符串硬编码到 /chat
669
- * 导致 tool_reference 400.
670
- *
671
- * [格式一致性护栏 2026-05-29] preferred_format 仅在确被 supported_formats 收录时才采信:
672
- * 防止上游元数据漂移 (preferred_format=anthropic 但 supported_formats=[openai]) 把 SDK
673
- * 路由到模型并不支持的格式端点 (撞 /anthropic "未绑定 Anthropic" 4xx)。这是网关侧
674
- * "同 model_id 双 profile 选行" 根因修复在 SDK 侧的同构护栏。
675
- */
676
- declare function getAdapterForModel(m: ManagedModel): ProviderAdapter;
677
-
678
- export { getAdapter as $, ThinkingHigh as A, BucketClassCommercial as B, type ChatContentBlock as C, ThinkingHighMinMaxTokens as D, type EffortConfig as E, ThinkingLow as F, type GeoLoc as G, ThinkingMax as H, type ImageGenerationRequest as I, ThinkingMaxFallbackMaxTokens as J, ThinkingOff as K, type VideoTaskResponse as L, type ManagedModel as M, type WebSearchSource as N, type OutputConfig as O, type ProviderAdapter as P, type QuotaSummary as Q, type RerankDocument as R, type ServerTool as S, type ThinkingConfig as T, type WindowLimitStatus as U, type VideoGenerationRequest as V, type WebSearchConfig as W, type WindowResetSummary as X, bucketInfoIsCommercial as Y, bucketRowIsCommercial as Z, classifySourcesEvent as _, BucketClassGeneric as a, getAdapterForModel as a0, newThinkingConfig as a1, newWebSearchTool as a2, parseSettlement as a3, parseSourcesEvent as a4, type BucketInfo as b, type BucketRow as c, type ChatMessage as d, type ChatRequest as e, type ChatResponse as f, type ChatUsage as g, type EmbeddingData as h, type EmbeddingRequest as i, type EmbeddingResponse as j, type ImageGenerationResponse as k, type InputModality as l, type InputModalityTag as m, type ModelCapabilities as n, type MultimodalContent as o, ProviderFormat as p, type RerankQuery as q, type RerankRequest as r, type RerankResponse as s, type RerankResult as t, ServerToolTypeWebSearch as u, type SourcesEvent as v, type SourcesEventIssueCode as w, type SourcesEventParseResult as x, type StreamEvent as y, type StreamSettlement as z };
686
+ export { classifySourcesEvent as $, type StreamSettlement as A, BucketClassCommercial as B, type ChatContentBlock as C, ThinkingHigh as D, type EffortConfig as E, ThinkingHighMinMaxTokens as F, type GeoLoc as G, ThinkingLow as H, type ImageGenerationRequest as I, ThinkingMax as J, ThinkingMaxFallbackMaxTokens as K, ThinkingOff as L, type ManagedModel as M, type VideoTaskResponse as N, type OutputConfig as O, type ProviderAdapter as P, type QuotaSummary as Q, type RerankDocument as R, type ServerTool as S, type ThinkingConfig as T, type WebSearchSource as U, type VideoGenerationRequest as V, type WebSearchConfig as W, type WindowLimitStatus as X, type WindowResetSummary as Y, bucketInfoIsCommercial as Z, bucketRowIsCommercial as _, BucketClassGeneric as a, newThinkingConfig as a0, newWebSearchTool as a1, parseSettlement as a2, parseSourcesEvent as a3, type BucketInfo as b, type BucketRow as c, type ChatMessage as d, type ChatRequest as e, type ChatResponse as f, type ChatUsage as g, type EmbeddingData as h, type EmbeddingRequest as i, type EmbeddingResponse as j, type ImageGenerationResponse as k, type InputModality as l, type InputModalityTag as m, type ModelCapabilities as n, type MultimodalContent as o, ProviderFormat as p, type QuotaSummarySubscriptionPool as q, type RerankQuery as r, type RerankRequest as s, type RerankResponse as t, type RerankResult as u, ServerToolTypeWebSearch as v, type SourcesEvent as w, type SourcesEventIssueCode as x, type SourcesEventParseResult as y, type StreamEvent as z };