dsh-sidenote 0.4.3 → 0.4.5

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.
Files changed (50) hide show
  1. package/README.md +27 -1
  2. package/lib/client.js +571 -240
  3. package/lib/types/client/annotate/index.d.ts +2 -0
  4. package/lib/types/client/host/contracts.d.ts +16 -0
  5. package/lib/types/client/host/currentSession.d.ts +8 -0
  6. package/lib/types/client/host/icons.d.ts +32 -0
  7. package/lib/types/client/locales.d.ts +6 -1
  8. package/lib/types/client/protocol.d.ts +9 -0
  9. package/lib/types/client/sidechat/composer.d.ts +4 -0
  10. package/lib/types/client/sidechat/identity.d.ts +25 -0
  11. package/lib/types/client/sidechat/lifecycle.d.ts +17 -1
  12. package/lib/types/client/sidechat/metaStore.d.ts +2 -0
  13. package/lib/types/client/sidechat/model.d.ts +3 -0
  14. package/lib/types/client/sidechat/native-tab.d.ts +3 -1
  15. package/lib/types/client/sidechat/open.d.ts +6 -1
  16. package/lib/types/client/sidechat/recentClosed.d.ts +2 -0
  17. package/lib/types/client/sidechat/referenceSource.d.ts +2 -0
  18. package/package.json +1 -1
  19. package/src/client/annotate/chip.tsx +1 -1
  20. package/src/client/annotate/index.tsx +5 -1
  21. package/src/client/annotate/overlay.tsx +6 -2
  22. package/src/client/annotate/send.ts +2 -7
  23. package/src/client/chat/FoldCard.tsx +2 -1
  24. package/src/client/chat/ReasoningRow.tsx +2 -1
  25. package/src/client/chat/ToolCard.tsx +8 -6
  26. package/src/client/host/contracts.ts +14 -0
  27. package/src/client/host/currentSession.ts +18 -0
  28. package/src/client/host/icons.ts +48 -0
  29. package/src/client/locales.ts +12 -2
  30. package/src/client/protocol.ts +15 -0
  31. package/src/client/reflow.ts +2 -1
  32. package/src/client/sidechat/ComposerBar.tsx +1 -1
  33. package/src/client/sidechat/ModelMenu.tsx +2 -1
  34. package/src/client/sidechat/PendingCard.tsx +1 -1
  35. package/src/client/sidechat/PermissionChip.tsx +2 -1
  36. package/src/client/sidechat/SideChatPanel.tsx +46 -11
  37. package/src/client/sidechat/composer.ts +6 -1
  38. package/src/client/sidechat/header.tsx +7 -3
  39. package/src/client/sidechat/identity.ts +86 -0
  40. package/src/client/sidechat/index.tsx +5 -3
  41. package/src/client/sidechat/lifecycle.ts +125 -24
  42. package/src/client/sidechat/metaStore.ts +3 -0
  43. package/src/client/sidechat/model.ts +4 -0
  44. package/src/client/sidechat/native-tab.tsx +8 -5
  45. package/src/client/sidechat/notify.ts +6 -3
  46. package/src/client/sidechat/open.ts +19 -9
  47. package/src/client/sidechat/recentClosed.ts +2 -0
  48. package/src/client/sidechat/referenceSource.ts +60 -44
  49. package/src/client/sidechat/rows.tsx +2 -1
  50. package/src/client/sidechat/slash.ts +14 -4
package/README.md CHANGED
@@ -93,12 +93,38 @@ dsh plugin --profile web add dsh-sidenote
93
93
  | 命令 | 说明 |
94
94
  |---|---|
95
95
  | `pnpm typecheck` | tsc --noEmit |
96
- | `pnpm test` | vitest 单测(213 例) |
96
+ | `pnpm test` | vitest 单测(222 例) |
97
97
  | `pnpm build` | 类型声明 + tsdown(host ESM + client CJS bundle,纯度门) |
98
98
  | `pnpm test:mount` | 挂载冒烟:真实 `dsh web` + 伪造会话日志 + Playwright 十条 journey lane(`BS_VERSION`/`DSH_CMD` 切版本矩阵) |
99
99
 
100
100
  问题与建议欢迎 [Issue](https://github.com/g-yixuan/dsh-sidenote/issues)。
101
101
 
102
+ ## 发版
103
+
104
+ 发布走 [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers)(OIDC):**不需要 npm token,不需要 OTP,本地不需要登录 npm**。`.github/workflows/release.yml` 拿 GitHub Actions 的 OIDC 身份直接换发布权限,并附 SLSA provenance。
105
+
106
+ > **触发条件是「发布一个 GitHub Release」,不是推 tag。**
107
+ > 只 `git push --tags` 不会发布任何东西——tag 会静静躺在那里。
108
+
109
+ ```bash
110
+ # 1. 改 package.json 的 version,提交
111
+ git commit -am "release: vX.Y.Z——<摘要>"
112
+
113
+ # 2. 打 tag 并推送(这一步还没有发布)
114
+ git tag vX.Y.Z && git push origin main --tags
115
+
116
+ # 3. 创建 GitHub Release —— 这一步才真正触发发布
117
+ gh release create vX.Y.Z --title "vX.Y.Z — <标题>" --notes-file <notes.md>
118
+ ```
119
+
120
+ workflow 随后自动跑 build → typecheck → test → `pnpm publish --provenance`,并校验 tag 与 `package.json` 版本一致(不一致直接失败)。
121
+
122
+ 几个已知的坑:
123
+
124
+ - **registry 有复制延迟**:workflow 显示 `✅ Published` 后,`npm view` 仍可能有 1–5 分钟看到旧版本(Fastly `max-age=300`)。以 workflow 日志为准,不要据此判断失败而重试。
125
+ - **别去折腾 npm token**:npm 正在[系统性废止 bypass-2FA 的 granular token](https://github.blog/changelog/2026-07-31-restricting-npm-bypass-2fa-granular-access-tokens/)。本仓库不依赖任何 token,发布失败请先看 workflow 日志,而不是 token 配置。
126
+ - **CI 的 `plugin-mount` lane 失败不阻塞发版**:那是独立 workflow,Release 流程只跑单测,不跑 e2e。
127
+
102
128
  ## License
103
129
 
104
130
  MIT