dsh-aimail 0.1.10 → 0.1.11-rc.2
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/inbound.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/register-cli.js +8 -4
- package/lib/tools.d.ts +1 -1
- package/package.json +3 -3
package/lib/inbound.js
CHANGED
|
@@ -81,7 +81,7 @@ export function apply(ctx, config = {}) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (!cfg) {
|
|
84
|
-
writeJson(res, 200, { status: 'no_agent', detail:
|
|
84
|
+
writeJson(res, 200, { status: 'no_agent', detail: 'no binding' });
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
// HMAC verify (per-address webhook_secret)
|
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The bundle patch (cordis.patch.yml) self-mounts three subpath entries:
|
|
5
5
|
* dsh-aimail/mail-service → ctx.mail (config resolution binding)
|
|
6
|
-
* dsh-aimail/tools →
|
|
6
|
+
* dsh-aimail/tools → 13 AIMail bare tools
|
|
7
7
|
* dsh-aimail/inbound → node:http inbound endpoint + delivery
|
|
8
8
|
*
|
|
9
9
|
* Installed via: dsh plugin --profile web add dsh-aimail
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The bundle patch (cordis.patch.yml) self-mounts three subpath entries:
|
|
5
5
|
* dsh-aimail/mail-service → ctx.mail (config resolution binding)
|
|
6
|
-
* dsh-aimail/tools →
|
|
6
|
+
* dsh-aimail/tools → 13 AIMail bare tools
|
|
7
7
|
* dsh-aimail/inbound → node:http inbound endpoint + delivery
|
|
8
8
|
*
|
|
9
9
|
* Installed via: dsh plugin --profile web add dsh-aimail
|
package/lib/register-cli.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* [--force]
|
|
22
22
|
*/
|
|
23
23
|
import { randomUUID } from 'node:crypto';
|
|
24
|
-
import { autoBind, emailForAgent, listSystemDirs, loadAgentConfig, readSystemConfig, registerAddress, registerBridgeRoute, saveBinding, } from '@aimail/mail-core';
|
|
24
|
+
import { autoBind, emailForAgent, listSystemDirs, loadAgentConfig, readSystemConfig, registerAddress, registerBridgeRoute, resolveRegisterWebhook, saveBinding, } from '@aimail/mail-core';
|
|
25
25
|
function arg(argv, name) {
|
|
26
26
|
const i = argv.indexOf(name);
|
|
27
27
|
return i >= 0 && i + 1 < argv.length ? argv[i + 1] : '';
|
|
@@ -85,12 +85,16 @@ async function main() {
|
|
|
85
85
|
console.log(JSON.stringify({ ok: true, email, system_id: systemId, registered: true, ...(res.config_path ? { config_path: res.config_path } : {}) }));
|
|
86
86
|
return 0;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
// secret 捕获为一个值:云端注册与本地落盘必须同一 secret
|
|
89
|
+
// (此前内联表达式生成的 secret 只上送云端,落盘的是旧/空值 → verifySignature 恒 401)
|
|
90
|
+
const webhookSecret = existing.webhook_secret || randomUUID().replace(/-/g, '') + randomUUID().replace(/-/g, '');
|
|
91
|
+
// 注册参数三态(push/pull/无 bridge)与 install 主链一致——force 路径不绕过 webhook_host 语义
|
|
92
|
+
const regUrl = resolveRegisterWebhook(gw, localWebhook);
|
|
89
93
|
const reg = await registerAddress({
|
|
90
94
|
systemId,
|
|
91
95
|
email,
|
|
92
|
-
webhookUrl:
|
|
93
|
-
webhookSecret
|
|
96
|
+
webhookUrl: regUrl,
|
|
97
|
+
webhookSecret,
|
|
94
98
|
...(manager ? { managerAddress: manager } : {}),
|
|
95
99
|
});
|
|
96
100
|
void reg; // exists:true expected (refresh); new-key path handled above
|
package/lib/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-aimail tools — registers the
|
|
2
|
+
* dsh-aimail tools — registers the 13 AIMail bare tools for this profile.
|
|
3
3
|
*
|
|
4
4
|
* Semantic text (names, descriptions, parameter descriptions) comes from
|
|
5
5
|
* the shared MAIL_TOOLS registry in @aimail/mail-core (single source of
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-aimail",
|
|
3
3
|
"description": "AIMail plugin for dsh — install via: dsh plugin --profile web add dsh-aimail",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.11-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": true
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"@deepseek-ai/dsh-tools": "^0.0.1-rc.1"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@aimail/mail-core": "^0.1.
|
|
55
|
-
"@aimail/mail": "^0.1.
|
|
54
|
+
"@aimail/mail-core": "^0.1.11-rc.2",
|
|
55
|
+
"@aimail/mail": "^0.1.11-rc.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@deepseek-ai/cordis": "^4.0.1",
|