@agenticmail/api 0.7.6 → 0.7.8

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.md CHANGED
@@ -8,6 +8,14 @@ The API server for [AgenticMail](https://github.com/agenticmail/agenticmail) —
8
8
 
9
9
  This package runs a web server that handles everything: sending email and SMS, reading inboxes, managing agents, phone number access, real-time notifications, inter-agent messaging, spam filtering, outbound security scanning, and gateway configuration. Every feature in AgenticMail is accessible through this API.
10
10
 
11
+ ## ✨ What's new in 0.7.7
12
+
13
+ - **🌐 Lightweight Gmail-style web UI bundled** — `packages/api/public/index.html` is served by `express.static` at the API root. Open `http://127.0.0.1:3829/` in any browser, paste the master key, and you get a Gmail/Outlook-style three-pane email client (agents / inbox / message). Real-time SSE updates, markdown rendering, compose + reply with the new `wake` parameter as a field. Run via `agenticmail web` from the CLI.
14
+ - **Wake allowlist on `POST /mail/send`** — accept a `wake` parameter (array of agent names or comma-separated string). The API normalises it, sets an `X-AgenticMail-Wake` header on the outgoing SMTP envelope, AND surfaces it as `wakeAllowlist` on the SSE event so the dispatcher can decide which CC'd recipients to actually give a Claude turn.
15
+ - **Shared helpers exported from `routes/mail.ts`** — `normalizeWakeList`, `wakeHeaders`, and `pushLocalRecipientWakes` so every send path (`/mail/send`, `/templates/:id/send`, `/drafts/:id/send`, `/mail/pending/:id/approve`) uses the same primitives.
16
+ - **System events SSE** at `GET /system/events` — master-auth stream that emits `account_created` / `account_deleted` / `worker_started` / `worker_finished` events. Powers the dispatcher's zero-wait wake on newly-created agents and the `check_activity` MCP tool.
17
+ - **Dispatcher activity registry** — `GET /dispatcher/activity` returns the currently-active and recently-finished workers; `POST /dispatcher/worker-{started,finished}` lets the dispatcher push updates. Master-auth.
18
+
11
19
  ## Install
12
20
 
13
21
  ```bash
package/dist/index.js CHANGED
@@ -6,6 +6,9 @@ import { networkInterfaces } from "os";
6
6
  import express from "express";
7
7
  import cors from "cors";
8
8
  import rateLimit from "express-rate-limit";
9
+ import { fileURLToPath as fileURLToPath2 } from "url";
10
+ import { dirname as dirname2, join as join2 } from "path";
11
+ import { existsSync } from "fs";
9
12
  import {
10
13
  resolveConfig,
11
14
  getDatabase,
@@ -4846,6 +4849,19 @@ function createApp(configOverrides) {
4846
4849
  message: { error: "Too many requests, please try again later" }
4847
4850
  })
4848
4851
  );
4852
+ const staticDir = (() => {
4853
+ const here = dirname2(fileURLToPath2(import.meta.url));
4854
+ const candidates = [
4855
+ join2(here, "..", "public"),
4856
+ join2(here, "public")
4857
+ ];
4858
+ for (const c of candidates) if (existsSync(c)) return c;
4859
+ return null;
4860
+ })();
4861
+ if (staticDir) {
4862
+ app2.use("/", express.static(staticDir, { index: "index.html", extensions: ["html"] }));
4863
+ app2.get("/ui", (_req, res) => res.sendFile(join2(staticDir, "index.html")));
4864
+ }
4849
4865
  app2.use("/api/agenticmail", createHealthRoutes(stalwart));
4850
4866
  app2.use("/api/agenticmail", createInboundRoutes(accountManager2, config, gatewayManager));
4851
4867
  const integrationFactory = readResolvedFactory(integrationRouteFactoryPromise);
@@ -4874,8 +4890,8 @@ function createApp(configOverrides) {
4874
4890
 
4875
4891
  // src/index.ts
4876
4892
  import { readFileSync as readFileSync2 } from "fs";
4877
- import { fileURLToPath as fileURLToPath2 } from "url";
4878
- import { dirname as dirname2, join as join2 } from "path";
4893
+ import { fileURLToPath as fileURLToPath3 } from "url";
4894
+ import { dirname as dirname3, join as join3 } from "path";
4879
4895
  await prepareIntegrations();
4880
4896
  function getLocalIp() {
4881
4897
  const nets = networkInterfaces();
@@ -4889,8 +4905,8 @@ function getLocalIp() {
4889
4905
  }
4890
4906
  var VERSION = (() => {
4891
4907
  try {
4892
- const __dirname = dirname2(fileURLToPath2(import.meta.url));
4893
- const pkg = JSON.parse(readFileSync2(join2(__dirname, "..", "package.json"), "utf-8"));
4908
+ const __dirname = dirname3(fileURLToPath3(import.meta.url));
4909
+ const pkg = JSON.parse(readFileSync2(join3(__dirname, "..", "package.json"), "utf-8"));
4894
4910
  return pkg.version;
4895
4911
  } catch {
4896
4912
  return "0.5.31";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/api",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "REST API server for AgenticMail — email and SMS endpoints for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "files": [
16
16
  "dist",
17
+ "public",
17
18
  "README.md",
18
19
  "REFERENCE.md",
19
20
  "LICENSE"