dsh-notify-yimit 0.1.2 → 0.1.3

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,158 +1,194 @@
1
- /**
2
- * dsh-notify-yimit 的 Host 面 Typert 清单(由 typert-loader 自动扫描注册)。
3
- * 手写清单,结构与 @deepseek-ai/dsh-typert-generator 产物一致:
4
- * `./typert` 导出 TYPERT,invocations 的 codec 必须是 zod v4 实例。
5
- */
6
-
7
- import { z } from 'zod'
8
-
9
- const kindColorSchema = z.object({
10
- bg: z.string(),
11
- fg: z.string(),
12
- })
13
-
14
- const configSchema = z.object({
15
- enabled: z.boolean(),
16
- mode: z.enum(['system', 'custom', 'off']),
17
- maxVisible: z.number(),
18
- durationMs: z.number(),
19
- browser: z.string(),
20
- bgColor: z.string(),
21
- textColor: z.string(),
22
- colors: z.object({
23
- completed: kindColorSchema,
24
- error: kindColorSchema,
25
- running: kindColorSchema,
26
- approval: kindColorSchema,
27
- question: kindColorSchema,
28
- }),
29
- })
30
-
31
- const notifyEventSchema = z.object({
32
- id: z.string(),
33
- sessionId: z.string(),
34
- title: z.string(),
35
- kind: z.enum(['completed', 'error', 'running', 'approval', 'question']),
36
- text: z.string(),
37
- activity: z.string().optional(),
38
- at: z.number(),
39
- })
40
-
41
- const getStateSchema = z.object({
42
- config: configSchema,
43
- events: z.array(notifyEventSchema),
44
- })
45
-
46
- const updateConfigSchema = z.object({
47
- config: configSchema,
48
- })
49
-
50
- const ackSchema = z.object({
51
- ok: z.boolean(),
52
- })
53
-
54
- const browserSchema = z.object({
55
- id: z.string(),
56
- name: z.string(),
57
- path: z.string(),
58
- })
59
-
60
- const listBrowsersSchema = z.object({
61
- browsers: z.array(browserSchema),
62
- })
63
-
64
- const patchSchema = z.record(z.string(), z.unknown())
65
-
66
- const _state$codec = { mode: 'strict', typeSymbol: 'dsh-notify-yimit#NotifyState', schema: getStateSchema }
67
- const _config$codec = { mode: 'strict', typeSymbol: 'dsh-notify-yimit#NotifyConfig', schema: configSchema }
68
- const _patch$codec = { mode: 'strict', typeSymbol: 'dsh-notify-yimit#NotifyConfigPatch', schema: patchSchema }
69
- const _ack$codec = { mode: 'strict', typeSymbol: 'dsh-notify-yimit#AckResult', schema: ackSchema }
70
- const _browsers$codec = { mode: 'strict', typeSymbol: 'dsh-notify-yimit#BrowserList', schema: listBrowsersSchema }
71
-
72
- export const TYPERT = {
73
- package: 'dsh-notify-yimit',
74
- face: 'host',
75
- schemas: [],
76
- invocations: [
77
- {
78
- id: 'dsh-notify-yimit#notify/getState',
79
- service: 'notify',
80
- namespace: 'notify',
81
- method: 'getState',
82
- invocation: { kind: 'direct' },
83
- parameters: [],
84
- result: _state$codec,
85
- },
86
- {
87
- id: 'dsh-notify-yimit#notify/updateConfig',
88
- service: 'notify',
89
- namespace: 'notify',
90
- method: 'updateConfig',
91
- invocation: { kind: 'direct' },
92
- parameters: [
93
- { name: 'patch', wire: 'patch', source: 'json', codec: _patch$codec },
94
- ],
95
- result: _config$codec,
96
- },
97
- {
98
- id: 'dsh-notify-yimit#notify/ackEvents',
99
- service: 'notify',
100
- namespace: 'notify',
101
- method: 'ackEvents',
102
- invocation: { kind: 'direct' },
103
- parameters: [
104
- { name: 'ids', wire: 'ids', source: 'json', codec: { mode: 'strict', typeSymbol: 'dsh-notify-yimit#EventIds', schema: z.array(z.string()) } },
105
- ],
106
- result: _ack$codec,
107
- },
108
- {
109
- id: 'dsh-notify-yimit#notify/listBrowsers',
110
- service: 'notify',
111
- namespace: 'notify',
112
- method: 'listBrowsers',
113
- invocation: { kind: 'direct' },
114
- parameters: [],
115
- result: _browsers$codec,
116
- },
117
- ],
118
- model: {
119
- services: [
120
- {
121
- description: 'dsh-notify-yimit 通知服务(ctx.notify):插件配置与通知事件队列。Notification config and event queue service (ctx.notify).',
122
- summary: 'dsh-notify-yimit 通知配置与事件队列服务 (dsh-notify-yimit notification config & event queue service)。',
123
- tags: [],
124
- jsDoc: '/** dsh-notify-yimit 通知配置与事件队列服务(ctx.notify)。dsh-notify-yimit notification config & event queue service (ctx.notify). */',
125
- key: 'notify',
126
- exportName: 'NotifyService',
127
- members: [
128
- {
129
- kind: 'method',
130
- name: 'getState',
131
- signature: 'getState(): NotifyState',
132
- summary: '读取当前配置与全部未确认通知事件。Read the current config and all unacknowledged notification events.',
133
- jsDoc: '/**\n * 读取当前配置与全部未确认通知事件。\n * @returns 配置与未确认事件列表。\n * Read the current config and all unacknowledged notification events.\n * @returns The config and unacknowledged events.\n */',
134
- },
135
- {
136
- kind: 'method',
137
- name: 'updateConfig',
138
- signature: 'updateConfig(patch: NotifyConfigPatch): NotifyConfig',
139
- summary: '深合并一份配置补丁并持久化。Deep-merge a config patch and persist it.',
140
- jsDoc: '/**\n * 深合并一份配置补丁并持久化。\n * @param patch - 配置补丁。\n * @returns 更新后的配置。\n * Deep-merge a config patch and persist it.\n * @param patch - The config patch.\n * @returns The updated config.\n */',
141
- },
142
- {
143
- kind: 'method',
144
- name: 'ackEvents',
145
- signature: 'ackEvents(ids: string[]): AckResult',
146
- summary: '回执已消费的事件 id,防止重复提醒。Acknowledge consumed event ids to prevent duplicate alerts.',
147
- jsDoc: '/**\n * 回执已消费的事件 id,从队列移除。\n * @param ids - 已展示的事件 id 列表。\n * @returns 回执结果。\n * Acknowledge consumed event ids, removing them from the queue.\n * @param ids - Ids of events already shown.\n * @returns The acknowledgement result.\n */',
148
- },
149
- ],
150
- types: [],
151
- },
152
- ],
153
- events: [],
154
- objects: [],
155
- },
156
- }
157
-
1
+ /**
2
+ * dsh-notify-yimit 的 Host 面 Typert 清单(由 typert-loader 自动扫描注册)。
3
+ * 手写清单,结构与 @deepseek-ai/dsh-typert-generator 产物一致:
4
+ * `./typert` 导出 TYPERT,invocations 的 codec 必须是 zod v4 实例。
5
+ */
6
+ import {
7
+ z
8
+ } from 'zod'
9
+
10
+ const kindColorSchema = z.object({
11
+ bg: z.string(),
12
+ fg: z.string(),
13
+ })
14
+
15
+ const configSchema = z.object({
16
+ enabled: z.boolean(),
17
+ mode: z.enum(['system', 'custom', 'off']),
18
+ maxVisible: z.number(),
19
+ durationMs: z.number(),
20
+ browser: z.string(),
21
+ bgColor: z.string(),
22
+ textColor: z.string(),
23
+ locale: z.enum(['zh', 'en']),
24
+ colors: z.object({
25
+ completed: kindColorSchema,
26
+ error: kindColorSchema,
27
+ running: kindColorSchema,
28
+ approval: kindColorSchema,
29
+ question: kindColorSchema,
30
+ }),
31
+ })
32
+
33
+ const notifyEventSchema = z.object({
34
+ id: z.string(),
35
+ sessionId: z.string(),
36
+ title: z.string(),
37
+ kind: z.enum(['completed', 'error', 'running', 'approval', 'question']),
38
+ text: z.string(),
39
+ activity: z.string().optional(),
40
+ at: z.number(),
41
+ })
42
+
43
+ const getStateSchema = z.object({
44
+ config: configSchema,
45
+ events: z.array(notifyEventSchema),
46
+ })
47
+
48
+ const updateConfigSchema = z.object({
49
+ config: configSchema,
50
+ })
51
+
52
+ const ackSchema = z.object({
53
+ ok: z.boolean(),
54
+ })
55
+
56
+ const browserSchema = z.object({
57
+ id: z.string(),
58
+ name: z.string(),
59
+ path: z.string(),
60
+ })
61
+
62
+ const listBrowsersSchema = z.object({
63
+ browsers: z.array(browserSchema),
64
+ })
65
+
66
+ const patchSchema = z.record(z.string(), z.unknown())
67
+
68
+ const _state$codec = {
69
+ mode: 'strict',
70
+ typeSymbol: 'dsh-notify-yimit#NotifyState',
71
+ schema: getStateSchema
72
+ }
73
+ const _config$codec = {
74
+ mode: 'strict',
75
+ typeSymbol: 'dsh-notify-yimit#NotifyConfig',
76
+ schema: configSchema
77
+ }
78
+ const _patch$codec = {
79
+ mode: 'strict',
80
+ typeSymbol: 'dsh-notify-yimit#NotifyConfigPatch',
81
+ schema: patchSchema
82
+ }
83
+ const _ack$codec = {
84
+ mode: 'strict',
85
+ typeSymbol: 'dsh-notify-yimit#AckResult',
86
+ schema: ackSchema
87
+ }
88
+ const _browsers$codec = {
89
+ mode: 'strict',
90
+ typeSymbol: 'dsh-notify-yimit#BrowserList',
91
+ schema: listBrowsersSchema
92
+ }
93
+
94
+ export const TYPERT = {
95
+ package: 'dsh-notify-yimit',
96
+ face: 'host',
97
+ schemas: [],
98
+ invocations: [{
99
+ id: 'dsh-notify-yimit#notify/getState',
100
+ service: 'notify',
101
+ namespace: 'notify',
102
+ method: 'getState',
103
+ invocation: {
104
+ kind: 'direct'
105
+ },
106
+ parameters: [],
107
+ result: _state$codec,
108
+ },
109
+ {
110
+ id: 'dsh-notify-yimit#notify/updateConfig',
111
+ service: 'notify',
112
+ namespace: 'notify',
113
+ method: 'updateConfig',
114
+ invocation: {
115
+ kind: 'direct'
116
+ },
117
+ parameters: [{
118
+ name: 'patch',
119
+ wire: 'patch',
120
+ source: 'json',
121
+ codec: _patch$codec
122
+ }, ],
123
+ result: _config$codec,
124
+ },
125
+ {
126
+ id: 'dsh-notify-yimit#notify/ackEvents',
127
+ service: 'notify',
128
+ namespace: 'notify',
129
+ method: 'ackEvents',
130
+ invocation: {
131
+ kind: 'direct'
132
+ },
133
+ parameters: [{
134
+ name: 'ids',
135
+ wire: 'ids',
136
+ source: 'json',
137
+ codec: {
138
+ mode: 'strict',
139
+ typeSymbol: 'dsh-notify-yimit#EventIds',
140
+ schema: z.array(z.string())
141
+ }
142
+ }, ],
143
+ result: _ack$codec,
144
+ },
145
+ {
146
+ id: 'dsh-notify-yimit#notify/listBrowsers',
147
+ service: 'notify',
148
+ namespace: 'notify',
149
+ method: 'listBrowsers',
150
+ invocation: {
151
+ kind: 'direct'
152
+ },
153
+ parameters: [],
154
+ result: _browsers$codec,
155
+ },
156
+ ],
157
+ model: {
158
+ services: [{
159
+ description: 'dsh-notify-yimit notification config & event queue service.',
160
+ summary: 'dsh-notify-yimit notification config & event queue service.',
161
+ tags: [],
162
+ jsDoc: '/** dsh-notify-yimit notification config & event queue service. */',
163
+ key: 'notify',
164
+ exportName: 'NotifyService',
165
+ members: [{
166
+ kind: 'method',
167
+ name: 'getState',
168
+ signature: 'getState(): NotifyState',
169
+ summary: 'Read the current config and all unacknowledged notification events.',
170
+ jsDoc: '/** Read the current config and all unacknowledged notification events. */',
171
+ },
172
+ {
173
+ kind: 'method',
174
+ name: 'updateConfig',
175
+ signature: 'updateConfig(patch: NotifyConfigPatch): NotifyConfig',
176
+ summary: 'Deep-merge a config patch and persist it.',
177
+ jsDoc: '/** Deep-merge a config patch and persist it. */',
178
+ },
179
+ {
180
+ kind: 'method',
181
+ name: 'ackEvents',
182
+ signature: 'ackEvents(ids: string[]): AckResult',
183
+ summary: 'Acknowledge consumed event ids to prevent duplicate alerts.',
184
+ jsDoc: '/** Acknowledge consumed event ids to prevent duplicate alerts. */',
185
+ },
186
+ ],
187
+ types: [],
188
+ }, ],
189
+ events: [],
190
+ objects: [],
191
+ },
192
+ }
193
+
158
194
  export default TYPERT
package/package.json CHANGED
@@ -1,51 +1,57 @@
1
- {
2
- "name": "dsh-notify-yimit",
3
- "version": "0.1.2",
4
- "description": "DeepSeek Harness 通知插件:任务完成 / 任务出错 / 运行中(实时活动)/ 等待审批 / 等待回答 时,通过 Windows 系统通知或插件自定义样式通知提醒用户,支持点击跳转到对应会话;设置页集成在 DSH 设置界面。",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "exports": {
8
- ".": {
9
- "default": "./lib/index.js"
10
- },
11
- "./client": {
12
- "default": "./lib/client.js"
13
- },
14
- "./typert": {
15
- "default": "./lib/typert.host.js"
16
- },
17
- "./package.json": "./package.json"
18
- },
19
- "dsh": {
20
- "bundle": {
21
- "patch": "./cordis.patch.yml"
22
- },
23
- "client": {
24
- "platform": "web"
25
- }
26
- },
27
- "files": [
28
- "lib/index.js",
29
- "lib/typert.host.js",
30
- "lib/client.js",
31
- "lib/toast-host.ps1",
32
- "cordis.patch.yml",
33
- "README.md",
34
- "README.en.md"
35
- ],
36
- "dependencies": {
37
- "@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6",
38
- "zod": "^4.4.3"
39
- },
40
- "keywords": [
41
- "deepseek",
42
- "deepseek-harness",
43
- "dsh",
44
- "dsh-plugin",
45
- "client-plugin",
46
- "notify",
47
- "notification",
48
- "toast"
49
- ],
50
- "license": "MIT"
1
+ {
2
+ "name": "dsh-notify-yimit",
3
+ "version": "0.1.3",
4
+ "description": "DeepSeek Harness 通知插件:任务完成 / 任务出错 / 运行中(实时活动)/ 等待审批 / 等待回答 时,通过 Windows 系统通知或插件自定义样式通知提醒用户,支持点击跳转到对应会话;设置页集成在 DSH 设置界面。",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "default": "./lib/index.js"
10
+ },
11
+ "./client": {
12
+ "default": "./lib/client.js"
13
+ },
14
+ "./typert": {
15
+ "default": "./lib/typert.host.js"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "dsh": {
20
+ "bundle": {
21
+ "patch": "./cordis.patch.yml"
22
+ },
23
+ "client": {
24
+ "inject": [
25
+ "remote",
26
+ "locale"
27
+ ],
28
+ "platform": "web"
29
+ }
30
+ },
31
+ "files": [
32
+ "lib/index.js",
33
+ "lib/typert.host.js",
34
+ "lib/client.js",
35
+ "lib/toast-host.ps1",
36
+ "cordis.patch.yml",
37
+ "README.md",
38
+ "README.en.md"
39
+ ],
40
+ "dependencies": {
41
+ "@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6",
42
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
43
+ "zod": "^4.4.3"
44
+ },
45
+ "peerDependencies": {
46
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@deepseek-ai/dsh-client-locale": {
50
+ "optional": false
51
+ }
52
+ },
53
+ "keywords": [
54
+ "deepseek", "deepseek-harness", "dsh", "dsh-plugin", "client-plugin", "notify", "notification", "toast"
55
+ ],
56
+ "license": "MIT"
51
57
  }