@sema-agent/client-core 0.13.0 → 0.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.
@@ -10,9 +10,20 @@
10
10
  *
11
11
  * 泛型约束到定时器句柄型(`setTimeout`/`setInterval` 的回传值):本包 `"types": []` + 默认 DOM
12
12
  * lib 下两者都是 `number`,Node 运行时实际回传 `Timeout` 对象——真身与编译期类型不一致正是
13
- * `unref?.()` 需要可选调用的原因。约束此前是无约束 `<T>`,`unrefTimer(42)` / `unrefTimer(aPromise)`
14
- * 这类明显打错调用点的用法会静默通过;收窄后这些误用编译期就报,而五个既有调用点(均传
15
- * `setTimeout`/`setInterval` 的返回值)不受影响。
13
+ * `unref?.()` 需要可选调用的原因。约束此前是无约束 `<T>`,任何东西都能传进来。
14
+ *
15
+ * 🔴 这条约束**挡得住哪一半、挡不住哪一半**(实测,不是承诺 —— [2393] F-3 纠正:此前这里写的是
16
+ * 「`unrefTimer(42)` / `unrefTimer(aPromise)` 收窄后编译期就报」,而上一段自己写明的前提
17
+ * 「本包下句柄型就是 `number`」直接推翻了它的前半句):
18
+ * · `unrefTimer('x')` / `unrefTimer(aPromise)` —— **编译期红**(TS2345,非 number 挡得住);
19
+ * · `unrefTimer(42)` —— **编译期绿**。`42` 与真句柄在本包的类型系统里不可分辨,挡不住;
20
+ * 运行时也无害(可选调用在 number 上是 no-op),但别指望编译器替你抓这一类打错。
21
+ * 这四条判决由 `scripts/run-client-core-typeshape-test.mjs` 的 D 腿每跑机械核一次:实测与
22
+ * 这段措辞一旦分叉即红。⚠️ 别为了兑现前半句去拧类型 —— 能挡住数字字面量的写法在**装了
23
+ * @types/node 的下游**会把句柄型解成 `Timeout` 对象,五个真调用点全线编译红(用一个假承诺
24
+ * 换一个真的可移植性回归)。
25
+ *
26
+ * 五个既有调用点(均传 `setTimeout`/`setInterval` 的返回值)不受约束影响。
16
27
  */
17
28
  type TimerLikeHandle = ReturnType<typeof setTimeout> | ReturnType<typeof setInterval>;
18
29
  export declare function unrefTimer<T extends TimerLikeHandle>(t: T): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/client-core",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Client-side session runtime shared by every sema human client (TUI / web / desktop): sema wire frames (AgentEvent) -> CC session vocabulary (SDKMessage) with dual-plane output (transcript/chrome), deterministic transcript ids, lane discipline as a type, and the notification/dedup ledgers. Every CC-skin shape is collected here so the wire itself stays neutral. Blackboard [1832] design axioms; [1651]/[1652]/[1653] signed seam design. Renamed from @sema-agent/wire-cc-adapter (0.1.x).",
5
5
  "license": "MIT",
6
6
  "type": "module",