@ericality/dsh-notice-banner 0.11.1

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/lib/index.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @ericality/dsh-notice-banner — Node 侧 host half
3
+ *
4
+ * 职责: 把自定义会话事件类型 `notice/banner` 与 `notice/banner-replace` 注册进
5
+ * KNOWN_SESSION_EVENT_TYPES, 使持久化读取路径 (dsh-session-persistence 的
6
+ * assertEventsSupported) 接受该类型 — 否则会话日志重建时会拒绝未知事件类型,
7
+ * 导致整个会话无法加载。
8
+ * (dsh-notify / dsh-cost-guard 注入该事件; notice/banner-replace 由 cost-guard
9
+ * 用于费用横幅原地替换, 同一会话只保留最新一条; Set.add 幂等, 多插件重复执行无副作用。)
10
+ *
11
+ * 浏览器侧 bundle 在 ./client.js (exports["./client"]), 由宿主 client-modules 注册表
12
+ * 扫描并按包名加载该 client bundle, 渲染横幅。
13
+ */
14
+ import { KNOWN_SESSION_EVENT_TYPES } from "@deepseek-ai/dsh-session";
15
+
16
+ export const name = "dsh-notice-banner";
17
+
18
+ export const apply = () => {
19
+ KNOWN_SESSION_EVENT_TYPES.add("notice/banner");
20
+ KNOWN_SESSION_EVENT_TYPES.add("notice/banner-replace");
21
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@ericality/dsh-notice-banner",
3
+ "description": "Banner UI for DSH (host+client): registers notice/banner event types and renders injected banner events as themed chat cards (cost/queue/ledger/restart).",
4
+ "version": "0.11.1",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./client": {
10
+ "default": "./lib/client.js"
11
+ },
12
+ "./package.json": "./package.json"
13
+ },
14
+ "peerDependencies": {
15
+ "@deepseek-ai/dsh-session": ">=0.1.0-rc.0 <0.2.0",
16
+ "react": "^18.2.0"
17
+ },
18
+ "dsh": {
19
+ "client": {
20
+ "inject": [
21
+ "@deepseek-ai/dsh-client-locale",
22
+ "@deepseek-ai/dsh-client-runtime",
23
+ "@deepseek-ai/dsh-client-ui-conversation"
24
+ ],
25
+ "platform": "web"
26
+ }
27
+ },
28
+ "files": [
29
+ "lib",
30
+ "README.md"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/Ericality/dsh-enhanced.git"
39
+ },
40
+ "homepage": "https://github.com/Ericality/dsh-enhanced"
41
+ }