@acosmi/sdk-ts 2.13.0 → 2.14.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to `@acosmi/sdk-ts` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.14.0] - 2026-08-02 — inputModalities 开放值域归一 (open modality domain)
9
+
10
+ 模态标签的值域由**网关托管模型目录**持有,靠运营动作扩张(`video` 自 2026-06-20 起已是合法值),不靠发 SDK 新版。此前 SDK 在两处把它当成封闭集处理:`InputModality` 类型只列 `text|image`,且 `input_modalities`(snake_case)归一化分支按这份硬编码集裁剪数组——而 camelCase 分支从不裁剪。线上 wire 恒为 camelCase,所以那个过滤器从未真正执行过(死代码),但它把错误语义写进了契约。本版收敛为对称透传,并把数据字段的类型开放。
11
+
12
+ 同一形态的封闭枚举在 CrabCode 客户端(Rust 侧)造成过真实事故:一行目录数据声明 `video`,整个网关模型列表在所有客户端上打空数周。**扩模态的次序是硬的:先客户端、再 SDK、最后网关白名单**。
13
+
14
+ ### Changed
15
+
16
+ - **`normalizeInputModalities` 两分支对称** — snake_case 分支不再按 `{text, image}` 白名单裁剪,只做键名归一 + 剔除非字符串元素(畸形值)。camelCase 分支行为不变(本就原样透传)。**行为影响仅限**上游改发 snake_case 的假设场景;现网 camelCase 路径逐字节不变。
17
+ - **`InputModality` 加 `'video'`** — 该联合体现在的定位是「**查询用**的已知标签集」(`modelSupportsInputModality` / `findFirstModelByInputModality` 的 `modality` 参数),保留自动补全。
18
+ - **`ManagedModel.inputModalities` 类型放开为 `InputModalityTag[]`** — 数据字段照收目录里的任何标签,未知模态不再被类型谎报成不可能出现。既有消费方(`includes('image')` 族判定)零改动。
19
+
20
+ ### Added
21
+
22
+ - **`InputModalityTag`(类型)** — 模态标签的**开放**值域(即 `string`;已知取值见 `InputModality`)。规则是「查询用 `InputModality`(有补全),数据用 `InputModalityTag`(照收未知标签)」。
23
+
8
24
  ## [2.13.0] - 2026-08-01 — 邀请奖励窗口重置券 (window-reset credits)
9
25
 
10
26
  邀请奖励从"送 token"改为**送窗口重置次数**:被邀请人激活并达到用量门槛后给邀请人发一张重置券,每张可清空一次滚动窗口已用量(只动窗口用量原语,**月度额度池零触碰**)。SDK 加性新增总览查询与核销两个客户端方法,核销支持 `clientRequestId` 幂等键。全部加性,既有调用零改动。
@@ -69,6 +85,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
69
85
  - **类型** — `EmbeddingRequest`/`EmbeddingData`/`EmbeddingResponse`/`RerankRequest`/`RerankResult`/`RerankResponse`。
70
86
  - **`listModels` / `listModelsWithStatus` 新增 `opts.includeLocked`** — `true` 时请求 `/managed-models?picker=1` 全集模式:网关把越档模型作为 `Locked=true` 补回返全集,供 C 端选择器展示「付费订阅区」+ 置灰升级引导。缺省行为不变(只返有桶模型,向后兼容)。全集模式不写 `modelCache`,避免 locked 模型混入可用模型集。
71
87
 
88
+ ## [2.8.0] - 2026-06-16 — 登录 302 重定向承接(successRedirectURL)
89
+
90
+ > 本条目为 2026-08-02 补记(发版时 CHANGELOG 漏记;事实源 = 独立仓 v2.8.0 tag / npm 2.8.0 / 父仓同步 commit `1f91c394`)。
91
+
92
+ ### Added
93
+
94
+ - **`LoginOptions.successRedirectURL`(可选)** — 登录成功后的 302 重定向目标(issue C「302 重定向发版」承接);不传时行为与 2.7.0 完全一致。additive minor,既有调用零改动。
95
+
72
96
  ## [2.7.0] - 2026-06-11 — 远控管理面补齐 + BYOK 密钥客户端 + Chat Bridge CRUD(Phase 7B)
73
97
 
74
98
  补齐远控核心交互之外的全部管理面(此前下游 CrabCode 只能裸 fetch),新增 BYO 模型密钥客户端,落地 chat-bridge integration/credential 管理面 CRUD——云端控制台与下游调用的是同一组端点同一份租户隔离数据,天然互通。全部方法逐字段对齐 nexus-v4 handler 真实 wire 形状(契约 §12/§14/§18 附录 A)。
@@ -951,6 +975,31 @@ Additive minor。公开类型 / 方法签名零移除、零改名。契约见 `d
951
975
  - 36/36 vitest 全绿,源码 typecheck/lint/build 0 错误
952
976
  - 翻车机制:`prepublishOnly` 仅跑源码 typecheck/vitest/build,不验证 packed product 在 consumer 视角能否解析
953
977
 
978
+ [2.14.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.14.0
979
+ [2.13.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.13.0
980
+ [2.12.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.12.0
981
+ [2.11.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.11.0
982
+ [2.10.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.10.0
983
+ [2.9.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.9.0
984
+ [2.8.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.8.0
985
+ [2.7.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.7.0
986
+ [2.6.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.6.0
987
+ [2.5.1]: https://github.com/acosmi/sdk-ts/releases/tag/v2.5.1
988
+ [2.4.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.4.0
989
+ [2.3.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.3.0
990
+ [2.2.1]: https://github.com/acosmi/sdk-ts/releases/tag/v2.2.1
991
+ [2.2.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.2.0
992
+ [2.1.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.1.0
993
+ [2.0.1]: https://github.com/acosmi/sdk-ts/releases/tag/v2.0.1
994
+ [2.0.0]: https://github.com/acosmi/sdk-ts/releases/tag/v2.0.0
995
+ [1.9.0]: https://github.com/acosmi/sdk-ts/releases/tag/v1.9.0
996
+ [1.6.0]: https://github.com/acosmi/sdk-ts/releases/tag/v1.6.0
997
+ [1.5.1]: https://github.com/acosmi/sdk-ts/releases/tag/v1.5.1
998
+ [1.5.0]: https://github.com/acosmi/sdk-ts/releases/tag/v1.5.0
999
+ [1.4.2]: https://github.com/acosmi/sdk-ts/releases/tag/v1.4.2
1000
+ [1.4.1]: https://github.com/acosmi/sdk-ts/releases/tag/v1.4.1
1001
+ [1.4.0]: https://github.com/acosmi/sdk-ts/releases/tag/v1.4.0
1002
+ [1.3.2]: https://github.com/acosmi/sdk-ts/releases/tag/v1.3.2
954
1003
  [1.3.1]: https://github.com/acosmi/sdk-ts/releases/tag/v1.3.1
955
1004
  [1.3.0]: https://github.com/acosmi/sdk-ts/releases/tag/v1.3.0
956
1005
  [1.2.0]: https://github.com/acosmi/sdk-ts/releases/tag/v1.2.0
@@ -958,3 +1007,6 @@ Additive minor。公开类型 / 方法签名零移除、零改名。契约见 `d
958
1007
  [1.0.2]: https://github.com/acosmi/sdk-ts/releases/tag/v1.0.2
959
1008
  [1.0.1]: https://github.com/acosmi/sdk-ts/releases/tag/v1.0.1
960
1009
  [1.0.0]: https://www.npmjs.com/package/@acosmi/sdk-ts/v/1.0.0
1010
+
1011
+ <!-- 1.7.0 / 1.8.0 / 1.8.1 / 2.5.0 为未单独发版的内部迭代(无 git tag、无 npm 版本,内容并入下一个发布),故无链接定义。
1012
+ 2026-08-02 实证:git ls-remote --tags(v1.6.0 直跳 v1.9.0、v2.4.0 直跳 v2.5.1)+ npm view @acosmi/sdk-ts versions 同形。 -->
@@ -3608,9 +3608,7 @@ function normalizeInputModalities(models) {
3608
3608
  if (Array.isArray(m.inputModalities)) continue;
3609
3609
  const snake = m.input_modalities;
3610
3610
  if (Array.isArray(snake)) {
3611
- m.inputModalities = snake.filter(
3612
- (v) => v === "text" || v === "image"
3613
- );
3611
+ m.inputModalities = snake.filter((v) => typeof v === "string");
3614
3612
  }
3615
3613
  }
3616
3614
  return models;