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.
- package/README.en.md +2 -2
- package/README.md +4 -2
- package/cordis.patch.yml +6 -6
- package/lib/client.js +1127 -789
- package/lib/index.js +973 -716
- package/lib/toast-host.ps1 +289 -330
- package/lib/typert.host.js +193 -157
- package/package.json +56 -50
package/lib/typert.host.js
CHANGED
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
}
|