dsh-aimail 0.1.22 → 0.1.24

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 CHANGED
@@ -19,7 +19,7 @@ import { fileURLToPath } from 'node:url';
19
19
  import { createServer } from 'node:http';
20
20
  import { randomUUID } from 'node:crypto';
21
21
  import { createUserMessage } from '@deepseek-ai/dsh-llm';
22
- import { processInboundMail, verifySignature, routeAddressFromHeaders, updateAgentConfig, loadAgentConfig, saveAgentConfig } from '@aimail/mail-core';
22
+ import { processInboundMail, verifySignature, routeAddressFromHeaders, updateAgentConfig, loadAgentConfig, saveAgentConfig, INBOUND_PATH, INBOUND_PORTS } from '@aimail/mail-core';
23
23
  import { ensureBridgeRoutesForSystem, formatBridgeRouteLine, isBridgeRouteWarning } from '@aimail/mail-core';
24
24
  export const name = 'mail-inbound';
25
25
  export const inject = ['mail', 'agents'];
@@ -71,8 +71,8 @@ export function apply(ctx, config = {}) {
71
71
  // non-fatal; retried on next plugin start
72
72
  }
73
73
  const host = config.host ?? '127.0.0.1';
74
- const port = config.port ?? Number(process.env.AIMAIL_INBOUND_PORT ?? 9099);
75
- const deliverPath = config.path ?? '/aimail/inbound';
74
+ const port = config.port ?? Number(process.env.AIMAIL_INBOUND_PORT ?? INBOUND_PORTS.dsh);
75
+ const deliverPath = config.path ?? INBOUND_PATH;
76
76
  const server = createServer(async (req, res) => {
77
77
  try {
78
78
  if (req.method !== 'POST' || (req.url ?? '').split('?')[0] !== deliverPath) {
@@ -1,19 +1,18 @@
1
1
  import { resolveByRecipient, resolveByEmail, resolveBySessionId, } from '@aimail/mail';
2
- import { autoBind, emailForAgent, ensureSystem, detectSystemForHome, hasAnySystem, listSystemDirs, readSystemConfig, releaseAllSystems, } from '@aimail/mail-core';
2
+ import { autoBind, emailForAgent, ensureSystem, detectSystemForHome, hasAnySystem, INBOUND_PATH, INBOUND_PORTS, listSystemDirs, readSystemConfig, releaseAllSystems, } from '@aimail/mail-core';
3
3
  import * as os from 'node:os';
4
4
  import * as path from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  export const name = 'mail';
7
7
  export const inject = [];
8
- /** Local inbound path the dsh-aimail/inbound entry listens on (default). */
9
- const INBOUND_PATH = '/aimail/inbound';
10
- /** The local receive endpoint registered as this session's webhook_url. */
8
+ /** The local receive endpoint registered as this session's webhook_url.
9
+ * 路径/端口契约常量唯一副本 = @aimail/mail-core(contract/aimail-contract.json)。 */
11
10
  function inboundWebhookUrl() {
12
11
  const fromEnv = (process.env.AIMAIL_INBOUND_URL ?? '').trim();
13
12
  if (fromEnv)
14
13
  return fromEnv.replace(/\/+$/, '') + INBOUND_PATH;
15
- const port = Number(process.env.AIMAIL_INBOUND_PORT ?? 9099);
16
- const p = Number.isInteger(port) && port > 0 ? port : 9099;
14
+ const port = Number(process.env.AIMAIL_INBOUND_PORT ?? INBOUND_PORTS.dsh);
15
+ const p = Number.isInteger(port) && port > 0 ? port : INBOUND_PORTS.dsh;
17
16
  return `http://127.0.0.1:${p}${INBOUND_PATH}`;
18
17
  }
19
18
  /** Process once-guard per (system, session): at most one auto-bind attempt. */
@@ -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, resolveRegisterWebhook, saveBinding, } from '@aimail/mail-core';
24
+ import { autoBind, emailForAgent, inboundUrl, INBOUND_PORTS, 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] : '';
@@ -36,7 +36,7 @@ async function main() {
36
36
  const manager = arg(argv, '--manager');
37
37
  const sessionId = arg(argv, '--session-id');
38
38
  const preset = arg(argv, '--preset') || 'mail';
39
- const localWebhook = arg(argv, '--local-webhook') || 'http://127.0.0.1:9099/aimail/inbound';
39
+ const localWebhook = arg(argv, '--local-webhook') || inboundUrl(INBOUND_PORTS.dsh);
40
40
  const force = flag(argv, '--force');
41
41
  const systemId = systemIdArg ||
42
42
  process.env.AIMAIL_SYSTEM_ID ||
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.22",
4
+ "version": "0.1.24",
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.22",
55
- "@aimail/mail": "^0.1.22"
54
+ "@aimail/mail-core": "^0.1.24",
55
+ "@aimail/mail": "^0.1.24"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@deepseek-ai/cordis": "^4.0.1",
@@ -1,18 +1,18 @@
1
1
  ---
2
- name: aimail
2
+ name: agentmail
3
3
  description: "Send outbound emails for reporting deliverables, updating project status, requesting decisions/approvals, or engaging in A2A collaboration. Also reply to or forward inbound emails from other agents or humans."
4
4
  version: 1.0.0
5
5
  author: MeterCai
6
6
  license: GPL-3.0
7
7
  metadata:
8
8
  hermes:
9
- tags: [email, mail, aimail, conversation]
10
- toolset: aimail
9
+ tags: [email, mail, agentmail, conversation]
10
+ toolset: agentmail
11
11
  ---
12
12
 
13
- # aimail — Email Conversation Agent
13
+ # agentmail — Email Conversation Agent
14
14
 
15
- Your email: **{profile_name}@{domain}**. You conduct conversations via email — replying or forwarding to incoming messages to continue the dialogue, and proactively sending outbound ones for deliverables, status updates, approval requests, or A2A collaboration. The aimail toolset handles delivery, contacts, and summaries; you focus on understanding, deciding, and composing.
15
+ Your email: **{profile_name}@{domain}**. You conduct conversations via email — replying or forwarding to incoming messages to continue the dialogue, and proactively sending outbound ones for deliverables, status updates, approval requests, or A2A collaboration. The agentmail toolset handles delivery, contacts, and summaries; you focus on understanding, deciding, and composing.
16
16
 
17
17
  ---
18
18
 
@@ -221,7 +221,7 @@ set_contact_profile(address="alice@example.com",
221
221
 
222
222
  ## Tools
223
223
 
224
- The aimail tools are registered with full schemas — parameter names, types, and descriptions are visible to you automatically. This table is a quick reference:
224
+ The agentmail tools are registered with full schemas — parameter names, types, and descriptions are visible to you automatically. This table is a quick reference:
225
225
 
226
226
  | Tool | Use |
227
227
  |------|-----|