@acosmi/sdk-ts 2.5.1 → 2.6.0

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.
@@ -1,4 +1,4 @@
1
- import { P as ProviderAdapter, k as ProviderFormat, j as ModelCapabilities, e as ChatRequest, f as ChatResponse, n as StreamEvent } from './index-BdzF9tmA.cjs';
1
+ import { P as ProviderAdapter, k as ProviderFormat, j as ModelCapabilities, e as ChatRequest, f as ChatResponse, n as StreamEvent } from './index-BrbgHn0E.cjs';
2
2
 
3
3
  /**
4
4
  * Anthropic 内容块
@@ -1,4 +1,4 @@
1
- import { P as ProviderAdapter, k as ProviderFormat, j as ModelCapabilities, e as ChatRequest, f as ChatResponse, n as StreamEvent } from './index-BdzF9tmA.js';
1
+ import { P as ProviderAdapter, k as ProviderFormat, j as ModelCapabilities, e as ChatRequest, f as ChatResponse, n as StreamEvent } from './index-BrbgHn0E.js';
2
2
 
3
3
  /**
4
4
  * Anthropic 内容块
@@ -10,7 +10,7 @@
10
10
  | 项目 | 值 |
11
11
  | -------- | -- |
12
12
  | 实现地位 | **主实现 / 事实标准**;Go SDK 暂停维护,后续从 TS 反向翻译 |
13
- | 当前版本 | **2.5.1**(模型 adapter 格式一致性护栏,patch,2026-05-31;上游 2.1.0 远控 / 2.2.0 图片视频 / 2.3.0 `apiBaseURL` / 2.4.0 `skillMd?` / 2.5.0 健康度审计根因修复,详见 §14 与 CHANGELOG) |
13
+ | 当前版本 | **2.6.0**(会员订阅查询 + 后端契约类型修正 + WS 一次性 ticket 鉴权,minor,2026-06-04;上游 2.1.0 远控 / 2.2.0 图片视频 / 2.3.0 `apiBaseURL` / 2.4.0 `skillMd?` / 2.5.0 健康度审计根因修复 / 2.5.1 adapter 格式护栏,详见 §14 与 CHANGELOG) |
14
14
  | 版本策略 | TS 独立演进;wire-format / API 不兼容变更升 major(v2.0.0 已发,见 §10 / §18) |
15
15
  | 主消费者 | `crabcode` (Anthropic 格式)、`crabdesign` / `crabclaw` 等下游产品 |
16
16
  | 长期保留 | `OpenAIAdapter` (P0 红线,`crabclaw` 暂不用 TS 但保留双格式等地位) |
@@ -244,7 +244,14 @@ git commit -m "fix: ..."
244
244
  - `client.agentRuns.createRemoteRun(req, signal?)` — `req.runtime` 固定 `'crabcode_remote'`,`runner` + `adapter` 必填。
245
245
  - `client.agentRuns.streamRemoteControl(runId, signal?)` — **无 options 参数**(`error` 恒非终结、`done`/`settle` 终结、从不抛异常)。
246
246
  - helper:`parseRemoteControlEvent(raw)`(wire→强类型,未知 type 返回 null)、`isTerminalRemoteEvent(ev)`。
247
- - `chatbridge`(v2.1,Phase 7 types-only):仅导出类型 + 守卫(`isPlatform` / `isRegion` / `isChannelInboundEvent` / `asCredentialRef`),**无 `client.chatBridge.*` 方法**;平台 webhook/凭证/桥接 handler 是 Phase 7B 后端工作,平台 SDK 依赖留在独立 adapter 包,禁进主包。
247
+ - `chatbridge`(v2.1,Phase 7 types-only):仅导出类型 + 守卫(`isPlatform` / `isRegion` / `isChannelInboundEvent` / `asCredentialRef`),**无 `client.chatBridge.*` 方法**;平台 webhook/凭证/桥接 handler 是 Phase 7B 后端工作,平台 SDK 依赖留在独立 adapter 包,禁进主包。**v2.6.0 新增 chat_bridge scope**:`ScopeChatBridge`(+ `:read` / `:write` / `:rotate` 三子项)+ `chatBridgeScopes()`,与 Phase 7B 后端落地配套(仍无 client 方法)。
248
+
249
+ **会员订阅查询(v2.6,C 端会员体系)** — `subscription` 命名空间新增:
250
+
251
+ - `client.subscription.getMembership(signal?)` — 当前会员视图(**取代** `listUserSubscriptions`,后者已废弃)。
252
+ - `client.subscription.getSubscriptionTier(signal?)` — 订阅档位。
253
+ - `client.subscription.subscriptionPrecheck(req, signal?)` — 升级前置校验。
254
+ - 同版本 `ManagedModel` 新增档位门控字段 `locked` / `freeTier` / `minPlanTier` / `chatRuntimeSupported` / `defaultToolIds`,供 C 端聊天模型选择器按会员档位加锁 / 分区。废弃 `ModelCoefficient` / `listCoefficients`(系数退役恒空)与 `ManagedModel.pricePerMTok` / `isDefault`(公开端点不返回)。
248
255
 
249
256
  红线:
250
257
  - 下游产品禁止直连 Nexus 内部 `/api/v4/chat/completions` 或 `/api/v4/managed-models/:id/...` 来实现智能体循环。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acosmi/sdk-ts",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "Acosmi TypeScript SDK:模型网关、Agent Run Gateway 与 Compliance(电子证据、时间章、报告、签署 envelope)统一客户端,支持浏览器 / Node ≥18 / Deno / Bun。",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.cjs",