@dsh-plus/notify-email 0.1.18 → 0.1.20
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/client.js +2 -61800
- package/lib/index.d.ts +2 -2
- package/lib/index.js +7 -11
- package/package.json +13 -13
- package/src/index.ts +5 -1
- package/src/service.ts +7 -2
- package/lib/style.css +0 -1639
package/lib/index.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
declare class NotifyEmailService extends Service {
|
|
120
|
-
static
|
|
120
|
+
static inject: string[];
|
|
121
121
|
private readonly triggers;
|
|
122
122
|
private readonly mailer;
|
|
123
123
|
private current;
|
|
@@ -148,7 +148,7 @@ declare class NotifyEmailService extends Service {
|
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/index.d.ts
|
|
150
150
|
declare const name = "dsh-plus-notify-email";
|
|
151
|
-
declare const inject: readonly ["agents", "tools"];
|
|
151
|
+
declare const inject: readonly ["agents", "tools", "credentials"];
|
|
152
152
|
declare function apply(ctx: Context, config: NotifyEmailConfig): void;
|
|
153
153
|
//#endregion
|
|
154
154
|
export { Config, type DecisionCall, type EmailNotice, NotifyEmailService, type NotifyTrigger, type TurnEndInfo, apply, inject, name };
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
|
-
import {
|
|
2
|
+
import { Service } from "@deepseek-ai/cordis";
|
|
3
3
|
import { pluginDataPath } from "@dsh-plus/shared";
|
|
4
4
|
import { appendFile, mkdir } from "node:fs/promises";
|
|
5
5
|
import { dirname } from "node:path";
|
|
@@ -423,21 +423,13 @@ function installTurnEndWatcher(ctx, service, resolveConfig) {
|
|
|
423
423
|
}
|
|
424
424
|
//#endregion
|
|
425
425
|
//#region src/service.ts
|
|
426
|
-
/**
|
|
427
|
-
* NotifyEmailService:通知编排中枢。
|
|
428
|
-
* - 配置:settings.installSection 接入 settings 用户层($DSH_HOME/settings.yaml,热生效),
|
|
429
|
-
* 无 settings provider 时退化为 cordis 行级 config。
|
|
430
|
-
* - 触发器:registerTrigger 是第三方插件的扩展接口;内置官方适配器同路径注册。
|
|
431
|
-
* - 投递:首个非空 EmailNotice 经 Mailer 发送;单个触发器抛错不影响其余。
|
|
432
|
-
* @module @dsh-plus/notify-email
|
|
433
|
-
*/
|
|
434
426
|
/** credentials seam 最小面:inject 硬声明保证时序(credentials-local init 为异步,
|
|
435
427
|
* 构造期探测 get() 可能早于其激活而拿到 undefined,导致密码解析静默降级)。 */
|
|
436
428
|
function credentialsOf(ctx) {
|
|
437
429
|
return ctx.credentials;
|
|
438
430
|
}
|
|
439
431
|
var NotifyEmailService = class extends Service {
|
|
440
|
-
static
|
|
432
|
+
static inject = [
|
|
441
433
|
"agents",
|
|
442
434
|
"tools",
|
|
443
435
|
"credentials"
|
|
@@ -518,7 +510,11 @@ var NotifyEmailService = class extends Service {
|
|
|
518
510
|
//#endregion
|
|
519
511
|
//#region src/index.ts
|
|
520
512
|
const name = "dsh-plus-notify-email";
|
|
521
|
-
const inject = [
|
|
513
|
+
const inject = [
|
|
514
|
+
"agents",
|
|
515
|
+
"tools",
|
|
516
|
+
"credentials"
|
|
517
|
+
];
|
|
522
518
|
function apply(ctx, config) {
|
|
523
519
|
ctx.plugin(NotifyEmailService, config);
|
|
524
520
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/notify-email",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "dsh-plus service+ui plugin: 任务结束/等待决策/出错时向指定邮箱发送邮件通知",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,30 +31,30 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@dsh-plus/shared": "0.1.
|
|
34
|
+
"@dsh-plus/shared": "0.1.13",
|
|
35
35
|
"nodemailer": "9.0.6"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
39
|
-
"@deepseek-ai/dsh-home-paths": "
|
|
40
|
-
"@deepseek-ai/dsh-settings": "
|
|
39
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.5-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-settings": "^0.1.5-alpha.2",
|
|
41
41
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
42
|
-
"@deepseek-ai/dsh-credentials": "
|
|
42
|
+
"@deepseek-ai/dsh-credentials": "^0.1.5-alpha.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@deepseek-ai/cordis": "4.0.2",
|
|
46
|
-
"@deepseek-ai/dsh-agent": "0.1.5-alpha.
|
|
47
|
-
"@deepseek-ai/dsh-home-paths": "0.1.5-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.
|
|
49
|
-
"@deepseek-ai/dsh-llm": "0.1.5-alpha.
|
|
50
|
-
"@deepseek-ai/dsh-session": "0.1.5-alpha.
|
|
51
|
-
"@deepseek-ai/dsh-settings": "0.1.5-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-tools": "0.1.5-alpha.
|
|
46
|
+
"@deepseek-ai/dsh-agent": "0.1.5-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-home-paths": "0.1.5-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-llm": "0.1.5-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-session": "0.1.5-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-settings": "0.1.5-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-tools": "0.1.5-alpha.2",
|
|
53
53
|
"@deepseek-ai/schemastery": "3.18.2",
|
|
54
54
|
"@types/nodemailer": "8.0.1",
|
|
55
55
|
"@types/react": "~18.3.31",
|
|
56
56
|
"react": "^18.2.0",
|
|
57
|
-
"@deepseek-ai/dsh-credentials": "0.1.5-alpha.
|
|
57
|
+
"@deepseek-ai/dsh-credentials": "0.1.5-alpha.2"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -12,7 +12,11 @@ import { NotifyEmailService } from './service.ts'
|
|
|
12
12
|
|
|
13
13
|
export const name = 'dsh-plus-notify-email'
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// 行级 inject:loader 须等这些服务激活后才应用本行。credentials 必须在列:
|
|
16
|
+
// 服务构造期即读取 credentials seam(行级 inject 是 fiber 链上属性解析的
|
|
17
|
+
// 声明来源,服务类 static inject 在 cordis 4.0.2 的类插件挂载里同样生效,
|
|
18
|
+
// 两处同声明互为兜底)。
|
|
19
|
+
export const inject = ['agents', 'tools', 'credentials'] as const
|
|
16
20
|
|
|
17
21
|
export { NotifyEmailService } from './service.ts'
|
|
18
22
|
|
package/src/service.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* - 投递:首个非空 EmailNotice 经 Mailer 发送;单个触发器抛错不影响其余。
|
|
7
7
|
* @module @dsh-plus/notify-email
|
|
8
8
|
*/
|
|
9
|
-
import { Context
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
10
|
+
import { Service } from '@deepseek-ai/cordis'
|
|
10
11
|
import type {} from '@deepseek-ai/dsh-settings'
|
|
11
12
|
import { pluginDataPath } from '@dsh-plus/shared'
|
|
12
13
|
import { createJsonlAuditSink } from './audit.ts'
|
|
@@ -31,7 +32,11 @@ function credentialsOf(ctx: Context): CredentialsSeamLike {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export class NotifyEmailService extends Service {
|
|
34
|
-
|
|
35
|
+
// cordis 4.0.2 以普通静态属性读取插件级 inject(Context.inject 符号在该版本
|
|
36
|
+
// 不存在,computed key 会静默变成字符串 'undefined' 使声明失效——0.1.18 的
|
|
37
|
+
// 553 回归即源于此:credentials 未就绪时构造读 ctx.credentials 抛
|
|
38
|
+
// "cannot get property credentials without inject",服务 fiber 静默 FAILED)。
|
|
39
|
+
static inject = ['agents', 'tools', 'credentials']
|
|
35
40
|
|
|
36
41
|
private readonly triggers: NotifyTrigger[] = []
|
|
37
42
|
private readonly mailer: Mailer
|