@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.
@@ -1,4 +1,4 @@
1
- import { P as ProviderAdapter, o as ProviderFormat, m as ModelCapabilities, e as ChatRequest, f as ChatResponse, v as StreamEvent } from './index-BI-Y3iOO.cjs';
1
+ import { P as ProviderAdapter, p as ProviderFormat, n as ModelCapabilities, e as ChatRequest, f as ChatResponse, w as StreamEvent } from './index-BoxWrEq0.cjs';
2
2
 
3
3
  /**
4
4
  * Anthropic 内容块
@@ -1,4 +1,4 @@
1
- import { P as ProviderAdapter, o as ProviderFormat, m as ModelCapabilities, e as ChatRequest, f as ChatResponse, v as StreamEvent } from './index-BI-Y3iOO.js';
1
+ import { P as ProviderAdapter, p as ProviderFormat, n as ModelCapabilities, e as ChatRequest, f as ChatResponse, w as StreamEvent } from './index-BoxWrEq0.js';
2
2
 
3
3
  /**
4
4
  * Anthropic 内容块
@@ -582,6 +582,46 @@ git tag vX.Y.Z
582
582
  git push origin vX.Y.Z
583
583
  ```
584
584
 
585
+ ### 9.2.1 打 tag 的两个坑(2026-08-02 v2.14.0 实测踩过)
586
+
587
+ 发版流程的真实拓扑与本节 Step 1 的描述有出入:**SDK 源码真源在 monorepo 的
588
+ `acosmi-sdk-ts/` 子目录**,由 `mirror-subtrees.yml` subtree-split 后 force-push 到
589
+ 公开仓 `acosmi/sdk-ts`;`release.yml` 只存在于公开仓,tag 也只在公开仓上打。所以
590
+ 「改代码」发生在 monorepo、「打 tag」发生在公开仓,中间隔着一次镜像同步。
591
+
592
+ **坑 1:被 tag 的 commit 的 message 不能带 `[skip ci]`。**
593
+ GitHub 对 `push` 事件一律尊重 `[skip ci]`,**tag push 也算 push**。subtree split 会
594
+ **原样保留原始 commit message**,所以 monorepo 里那个带 `[skip ci]` 的发版 commit
595
+ 镜像过去之后,tag 指向它 → `release.yml` 静默不触发(tag 建得好好的、workflow 是
596
+ active、Actions 权限正常,就是没有 run,排查时极具迷惑性)。
597
+ → **发版那一个 commit 必须不带 `[skip ci]`**。确认方法:
598
+ ```bash
599
+ gh api repos/acosmi/sdk-ts/commits/<被tag的sha> --jq '.commit.message' | head -1
600
+ ```
601
+
602
+ **坑 2:tag 必须用真的 `git push` 推,不能用 REST API 建 ref。**
603
+ `gh api repos/acosmi/sdk-ts/git/refs -X POST -f ref=refs/tags/vX.Y.Z ...` 只产生
604
+ `create` 事件、**不产生 `push` 事件**,而 `release.yml` 监听的是 `on: push: tags`。
605
+ 本地没有公开仓 clone 时,临时建一个最省事:
606
+ ```bash
607
+ git init tmp && cd tmp
608
+ git remote add origin https://github.com/acosmi/sdk-ts.git
609
+ git fetch --depth=1 origin <mirror-main-sha>
610
+ git tag vX.Y.Z <mirror-main-sha>
611
+ git push origin refs/tags/vX.Y.Z # 必须是 git push
612
+ ```
613
+
614
+ **打 tag 前的落地检查**(别拿 tag 试错——`npm publish` 之前还有 typecheck / lint /
615
+ test / build / docs 五道,红了要删 tag 重来):
616
+ ```bash
617
+ gh api repos/acosmi/sdk-ts/contents/package.json --jq .content | base64 -d | grep -m1 version # = 待发版本
618
+ gh api repos/acosmi/sdk-ts/commits/main --jq '.commit.message' | head -1 # 不含 [skip ci]
619
+ npm run typecheck && npm run lint && npm run build && npm run test:pack && npm run docs # 本地先全绿
620
+ ```
621
+ > lint 尤其容易漏:v2.14.0 第一版用了 `InputModality | (string & {})` 这个「保留自动
622
+ > 补全」的类型技巧,撞本仓 `@typescript-eslint/ban-types`,带着它推 tag 会在 publish
623
+ > 前一步失败。
624
+
585
625
  ### 9.3 公开仓清洁度检查(push 前必看)
586
626
 
587
627
  - [ ] 作者 = `acosmi-fushihua <fushihua@acosmi.com>`,提交信息干净
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acosmi/sdk-ts",
3
- "version": "2.13.0",
3
+ "version": "2.14.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",