agentic-notify 0.4.0 → 0.4.1

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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Notifications for humans and agents: in-app inbox, email and webhook delivery, with a CLI, API, MCP server and SDK.
7
7
 
8
- **Status: 0.4.0.** Breaking for Worker auth, see "Migrating from `NOTIFY_TOKENS`" below. Breaking for 0.1.0 code and databases, see the CHANGELOG upgrade steps. Works today: the notification model, preferences and mute, digest, a store port from agentic-identity with its memory and D1 adapters, signed webhook and email delivery through a dispatcher, an HTTP API in a Worker, an SDK, a CLI, MCP tools, per-recipient export and erase, and a retention sweep. Not done: a real email provider adapter, webhook endpoint management, and a web UI.
8
+ **Status: 0.4.1.** Breaking for Worker auth, see "Migrating from `NOTIFY_TOKENS`" below. Breaking for 0.1.0 code and databases, see the CHANGELOG upgrade steps. Works today: the notification model, preferences and mute, digest, a store port from agentic-identity with its memory and D1 adapters, signed webhook and email delivery through a dispatcher, an HTTP API in a Worker, an SDK, a CLI, MCP tools, per-recipient export and erase, and a retention sweep. Not done: a real email provider adapter, webhook endpoint management, and a web UI.
9
9
 
10
10
  ## Live demo
11
11
 
@@ -63,6 +63,8 @@ npx agentic-notify mcp # tools: ping, list_notifications, read_notification
63
63
  # export_data, erase_data, send_notification
64
64
  ```
65
65
 
66
+ `npx agentic-notify mcp --help` (or `-h`) prints the usage and exits 0. `npx agentic-notify mcp --version` (or `-V` or `-v`) prints the version and exits 0. Neither starts the server.
67
+
66
68
  The MCP server needs `NOTIFY_URL` and `NOTIFY_TOKEN`. Without them only `ping` works. `erase_data` needs `confirm: true` and a key with `notify:admin`. `send_notification` needs `notify-send:write`. A tool that lacks its scope reports 403.
67
69
 
68
70
  ```ts
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "agentic-notify",
4
- version: "0.4.0",
4
+ version: "0.4.1",
5
5
  description: "Notifications for humans and agents: in-app inbox, webhook and email delivery, with SDK, CLI, MCP server and Worker API.",
6
6
  keywords: [
7
7
  "notifications",
@@ -66,10 +66,10 @@ var package_default = {
66
66
  "check:worker": "esbuild src/worker.ts --bundle --platform=neutral --format=esm --log-level=warning --outfile=node_modules/.cache/worker-check.js"
67
67
  },
68
68
  dependencies: {
69
- "@modelcontextprotocol/sdk": "^1.12.0",
70
- "agentic-identity": "^0.6.0",
69
+ "@modelcontextprotocol/sdk": "^1.23.0",
70
+ "agentic-identity": "^0.7.0",
71
71
  hono: "^4.13.14",
72
- zod: "^3.25.0"
72
+ zod: "^4.6.7"
73
73
  },
74
74
  devDependencies: {
75
75
  "@types/node": "^22.0.0",
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import "./chunk-KJKM56FT.js";
10
10
  import "./chunk-ARL7FN6Y.js";
11
11
  import {
12
12
  VERSION
13
- } from "./chunk-EMQ7EWWD.js";
13
+ } from "./chunk-O2W4ELN4.js";
14
14
 
15
15
  // src/cli.ts
16
16
  import { realpathSync } from "fs";
@@ -43,7 +43,7 @@ function helpText() {
43
43
  " mcp Start the MCP server on stdio.",
44
44
  "",
45
45
  "Environment: NOTIFY_URL (server base url), NOTIFY_TOKEN (bearer token).",
46
- "Flags: --help, -h; --version, -V."
46
+ "Flags: --help, -h; --version, -V. mcp also takes -v for --version."
47
47
  ].join("\n");
48
48
  }
49
49
  function flags(args, known) {
@@ -84,6 +84,14 @@ async function runCli(argv, io = defaultIo()) {
84
84
  io.out(VERSION);
85
85
  return 0;
86
86
  }
87
+ if (cmd === "mcp" && args.some((a) => a === "--help" || a === "-h")) {
88
+ io.out(helpText());
89
+ return 0;
90
+ }
91
+ if (cmd === "mcp" && args.some((a) => a === "--version" || a === "-V" || a === "-v")) {
92
+ io.out(VERSION);
93
+ return 0;
94
+ }
87
95
  try {
88
96
  if (cmd === "mcp") {
89
97
  const { startMcp } = await import("./mcp.js");
@@ -1,7 +1,7 @@
1
- import { R as RecipientExport } from './gdpr-CUq5MUwo.js';
1
+ import { R as RecipientExport } from './gdpr-C3YxbZp-.js';
2
2
  import { Store } from 'agentic-identity';
3
- import { S as SendInput, N as Notification, C as Channel, R as Recipient, D as Digest, P as Preferences } from './types-C842YAMe.js';
4
- import { D as DeliveryChannel, L as Logger } from './types-DONKNIOo.js';
3
+ import { S as SendInput, N as Notification, C as Channel, R as Recipient, D as Digest, P as Preferences } from './types-BAG4ZSoy.js';
4
+ import { D as DeliveryChannel, L as Logger } from './types-DhgcIImw.js';
5
5
 
6
6
  interface NotifierOptions {
7
7
  store: Store;
@@ -1,4 +1,4 @@
1
- import { R as Recipient, P as Preferences, N as Notification } from './types-C842YAMe.js';
1
+ import { R as Recipient, P as Preferences, N as Notification } from './types-BAG4ZSoy.js';
2
2
 
3
3
  interface RecipientExport {
4
4
  recipient: Recipient;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { D as DispatchResult, a as DispatcherOptions, L as ListOptions, b as ListResult, d as NotFoundError, N as Notifier, e as NotifierOptions, S as SendResult, c as createDispatcher, f as createNotifier } from './dispatch-CfflYJ-R.js';
1
+ export { D as DispatchResult, a as DispatcherOptions, L as ListOptions, b as ListResult, d as NotFoundError, N as Notifier, e as NotifierOptions, S as SendResult, c as createDispatcher, f as createNotifier } from './dispatch-CH4Ju-_1.js';
2
2
  export { Doc, Page, Query, Scalar, Store, StoreOps, createMemoryStore } from 'agentic-identity';
3
- import { R as Recipient } from './types-C842YAMe.js';
4
- export { A as Actor, b as CHANNELS, C as Channel, c as DEFAULT_CHANNELS, D as Digest, d as DigestGroup, N as Notification, P as Preferences, a as ResourceRef, S as SendInput, e as defaultPreferences, r as recipientKey } from './types-C842YAMe.js';
5
- import { D as DeliveryChannel } from './types-DONKNIOo.js';
6
- export { a as DeliveryError, L as Logger } from './types-DONKNIOo.js';
7
- export { E as EmailChannelOptions, a as EmailMessage, b as EmailPort, c as createEmailChannel } from './testing-B5slvYDV.js';
3
+ import { R as Recipient } from './types-BAG4ZSoy.js';
4
+ export { A as Actor, b as CHANNELS, C as Channel, c as DEFAULT_CHANNELS, D as Digest, d as DigestGroup, N as Notification, P as Preferences, a as ResourceRef, S as SendInput, e as defaultPreferences, r as recipientKey } from './types-BAG4ZSoy.js';
5
+ import { D as DeliveryChannel } from './types-DhgcIImw.js';
6
+ export { a as DeliveryError, L as Logger } from './types-DhgcIImw.js';
7
+ export { E as EmailChannelOptions, a as EmailMessage, b as EmailPort, c as createEmailChannel } from './testing-DEBqTQFK.js';
8
8
  export { D1Like, D1_SCHEMA, createD1Store } from 'agentic-identity/cloudflare';
9
- export { R as RecipientExport } from './gdpr-CUq5MUwo.js';
9
+ export { R as RecipientExport } from './gdpr-C3YxbZp-.js';
10
10
  import 'zod';
11
11
  import 'agentic-identity/testing';
12
12
 
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-ARL7FN6Y.js";
24
24
  import {
25
25
  VERSION
26
- } from "./chunk-EMQ7EWWD.js";
26
+ } from "./chunk-O2W4ELN4.js";
27
27
  export {
28
28
  CHANNELS,
29
29
  D1_SCHEMA,
package/dist/mcp-bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-EMQ7EWWD.js";
4
+ } from "./chunk-O2W4ELN4.js";
5
5
 
6
6
  // src/mcp-bin.ts
7
7
  var HELP = `agentic-notify-mcp ${VERSION}
8
- Usage: agentic-notify-mcp [--help | --version]
8
+ Usage: agentic-notify-mcp [--help | -h | --version | -V]
9
9
 
10
10
  Runs the MCP server on stdio. An MCP client starts it.
11
11
  `;
package/dist/mcp.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { Client } from './sdk.js';
3
- import './types-C842YAMe.js';
3
+ import './types-BAG4ZSoy.js';
4
4
  import 'zod';
5
- import './gdpr-CUq5MUwo.js';
5
+ import './gdpr-C3YxbZp-.js';
6
6
 
7
7
  /** Without a client, only `ping` works and the other tools report that setup is missing. */
8
8
  declare function createMcpServer(client?: Client): McpServer;
package/dist/mcp.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-ARL7FN6Y.js";
14
14
  import {
15
15
  VERSION
16
- } from "./chunk-EMQ7EWWD.js";
16
+ } from "./chunk-O2W4ELN4.js";
17
17
 
18
18
  // src/mcp.ts
19
19
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/sdk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { N as Notification, D as Digest, P as Preferences, R as Recipient, a as ResourceRef } from './types-C842YAMe.js';
2
- import { R as RecipientExport } from './gdpr-CUq5MUwo.js';
1
+ import { N as Notification, D as Digest, P as Preferences, R as Recipient, a as ResourceRef } from './types-BAG4ZSoy.js';
2
+ import { R as RecipientExport } from './gdpr-C3YxbZp-.js';
3
3
  import 'zod';
4
4
 
5
5
  declare class ApiError extends Error {
@@ -43,40 +43,40 @@ declare function createClient(options: ClientOptions): {
43
43
  cursor?: string;
44
44
  }) => Promise<NotificationPage>;
45
45
  get: (id: string) => Promise<{
46
- type: string;
47
46
  id: string;
48
47
  recipient: {
49
- id: string;
50
48
  kind: "human" | "agent";
49
+ id: string;
51
50
  };
51
+ type: string;
52
52
  resource: {
53
- id: string;
54
53
  kind: string;
54
+ id: string;
55
55
  url?: string | undefined;
56
56
  };
57
57
  actor: {
58
- id: string;
59
58
  kind: "human" | "agent";
59
+ id: string;
60
60
  };
61
61
  body: string;
62
62
  createdAt: number;
63
63
  readAt: number | null;
64
64
  }>;
65
65
  markRead: (id: string) => Promise<{
66
- type: string;
67
66
  id: string;
68
67
  recipient: {
69
- id: string;
70
68
  kind: "human" | "agent";
69
+ id: string;
71
70
  };
71
+ type: string;
72
72
  resource: {
73
- id: string;
74
73
  kind: string;
74
+ id: string;
75
75
  url?: string | undefined;
76
76
  };
77
77
  actor: {
78
- id: string;
79
78
  kind: "human" | "agent";
79
+ id: string;
80
80
  };
81
81
  body: string;
82
82
  createdAt: number;
@@ -1,6 +1,6 @@
1
1
  import 'agentic-identity/testing';
2
- import { R as Recipient } from './types-C842YAMe.js';
3
- import { D as DeliveryChannel } from './types-DONKNIOo.js';
2
+ import { R as Recipient } from './types-BAG4ZSoy.js';
3
+ import { D as DeliveryChannel } from './types-DhgcIImw.js';
4
4
 
5
5
  interface EmailMessage {
6
6
  to: string;
package/dist/testing.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { runStoreContract } from 'agentic-identity/testing';
2
- export { T as TestEmailAdapter } from './testing-B5slvYDV.js';
3
- import './types-C842YAMe.js';
2
+ export { T as TestEmailAdapter } from './testing-DEBqTQFK.js';
3
+ import './types-BAG4ZSoy.js';
4
4
  import 'zod';
5
- import './types-DONKNIOo.js';
5
+ import './types-DhgcIImw.js';
@@ -0,0 +1,101 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const CHANNELS: readonly ["inbox", "webhook", "email"];
4
+ type Channel = (typeof CHANNELS)[number];
5
+ declare const recipientSchema: z.ZodObject<{
6
+ kind: z.ZodEnum<{
7
+ human: "human";
8
+ agent: "agent";
9
+ }>;
10
+ id: z.ZodString;
11
+ }, z.core.$strict>;
12
+ type Recipient = z.infer<typeof recipientSchema>;
13
+ declare const resourceRefSchema: z.ZodObject<{
14
+ kind: z.ZodString;
15
+ id: z.ZodString;
16
+ url: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strict>;
18
+ type ResourceRef = z.infer<typeof resourceRefSchema>;
19
+ declare const actorSchema: z.ZodObject<{
20
+ kind: z.ZodEnum<{
21
+ human: "human";
22
+ agent: "agent";
23
+ }>;
24
+ id: z.ZodString;
25
+ }, z.core.$strict>;
26
+ type Actor = z.infer<typeof actorSchema>;
27
+ declare const notificationSchema: z.ZodObject<{
28
+ id: z.ZodString;
29
+ recipient: z.ZodObject<{
30
+ kind: z.ZodEnum<{
31
+ human: "human";
32
+ agent: "agent";
33
+ }>;
34
+ id: z.ZodString;
35
+ }, z.core.$strict>;
36
+ type: z.ZodString;
37
+ resource: z.ZodObject<{
38
+ kind: z.ZodString;
39
+ id: z.ZodString;
40
+ url: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strict>;
42
+ actor: z.ZodObject<{
43
+ kind: z.ZodEnum<{
44
+ human: "human";
45
+ agent: "agent";
46
+ }>;
47
+ id: z.ZodString;
48
+ }, z.core.$strict>;
49
+ body: z.ZodString;
50
+ createdAt: z.ZodNumber;
51
+ readAt: z.ZodNullable<z.ZodNumber>;
52
+ }, z.core.$strict>;
53
+ type Notification = z.infer<typeof notificationSchema>;
54
+ declare const sendInputSchema: z.ZodObject<{
55
+ recipient: z.ZodObject<{
56
+ kind: z.ZodEnum<{
57
+ human: "human";
58
+ agent: "agent";
59
+ }>;
60
+ id: z.ZodString;
61
+ }, z.core.$strict>;
62
+ type: z.ZodString;
63
+ resource: z.ZodObject<{
64
+ kind: z.ZodString;
65
+ id: z.ZodString;
66
+ url: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strict>;
68
+ actor: z.ZodObject<{
69
+ kind: z.ZodEnum<{
70
+ human: "human";
71
+ agent: "agent";
72
+ }>;
73
+ id: z.ZodString;
74
+ }, z.core.$strict>;
75
+ body: z.ZodString;
76
+ }, z.core.$strict>;
77
+ type SendInput = z.infer<typeof sendInputSchema>;
78
+ declare const preferencesSchema: z.ZodObject<{
79
+ channels: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
80
+ inbox: "inbox";
81
+ webhook: "webhook";
82
+ email: "email";
83
+ }>>>;
84
+ muted: z.ZodBoolean;
85
+ mutedTypes: z.ZodArray<z.ZodString>;
86
+ }, z.core.$strict>;
87
+ type Preferences = z.infer<typeof preferencesSchema>;
88
+ declare const DEFAULT_CHANNELS: readonly Channel[];
89
+ declare function defaultPreferences(): Preferences;
90
+ declare function recipientKey(recipient: Recipient): string;
91
+ interface DigestGroup {
92
+ type: string;
93
+ count: number;
94
+ latest: Notification;
95
+ }
96
+ interface Digest {
97
+ total: number;
98
+ groups: DigestGroup[];
99
+ }
100
+
101
+ export { type Actor as A, type Channel as C, type Digest as D, type Notification as N, type Preferences as P, type Recipient as R, type SendInput as S, type ResourceRef as a, CHANNELS as b, DEFAULT_CHANNELS as c, type DigestGroup as d, defaultPreferences as e, recipientKey as r };
@@ -1,4 +1,4 @@
1
- import { N as Notification } from './types-C842YAMe.js';
1
+ import { N as Notification } from './types-BAG4ZSoy.js';
2
2
 
3
3
  /** A delivery channel other than the inbox. */
4
4
  interface DeliveryChannel {
package/dist/worker.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Auth, PrincipalContext, Store } from 'agentic-identity';
2
- import { N as Notifier, c as createDispatcher } from './dispatch-CfflYJ-R.js';
3
- import { R as Recipient } from './types-C842YAMe.js';
2
+ import { N as Notifier, c as createDispatcher } from './dispatch-CH4Ju-_1.js';
3
+ import { R as Recipient } from './types-BAG4ZSoy.js';
4
4
  import { D1Like } from 'agentic-identity/cloudflare';
5
- import './gdpr-CUq5MUwo.js';
6
- import './types-DONKNIOo.js';
5
+ import './gdpr-C3YxbZp-.js';
6
+ import './types-DhgcIImw.js';
7
7
  import 'zod';
8
8
 
9
9
  interface AppOptions {
package/dist/worker.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-ARL7FN6Y.js";
10
10
  import {
11
11
  VERSION
12
- } from "./chunk-EMQ7EWWD.js";
12
+ } from "./chunk-O2W4ELN4.js";
13
13
 
14
14
  // src/api.ts
15
15
  import { Hono } from "hono";
@@ -47,6 +47,9 @@ function recipientOf(context) {
47
47
  }
48
48
 
49
49
  // src/api.ts
50
+ function invalidInput(path, message) {
51
+ return z.string().refine(() => false, { message, path }).safeParse("").error;
52
+ }
50
53
  var sendBody = z.object({ recipient: recipientSchema, type: typeNameSchema, resource: resourceRefSchema, body: z.string().max(2e3) }).strict();
51
54
  var num = z.coerce.number().int().nonnegative();
52
55
  function createApp(options) {
@@ -67,7 +70,7 @@ function createApp(options) {
67
70
  try {
68
71
  return await c.req.json();
69
72
  } catch {
70
- throw new ZodError([{ code: "custom", path: [], message: "body must be JSON" }]);
73
+ throw invalidInput([], "body must be JSON");
71
74
  }
72
75
  }
73
76
  api.get("/notifications", guard(SCOPES.read), async (c) => {
@@ -76,7 +79,7 @@ function createApp(options) {
76
79
  try {
77
80
  return c.json(await notifier.list(c.var.me, { unreadOnly: q.unread === "1" || q.unread === "true", limit, cursor: q.cursor }));
78
81
  } catch (error) {
79
- if (error instanceof RangeError) throw new ZodError([{ code: "custom", path: ["cursor"], message: "bad cursor" }]);
82
+ if (error instanceof RangeError) throw invalidInput(["cursor"], "bad cursor");
80
83
  throw error;
81
84
  }
82
85
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-notify",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Notifications for humans and agents: in-app inbox, webhook and email delivery, with SDK, CLI, MCP server and Worker API.",
5
5
  "keywords": [
6
6
  "notifications",
@@ -65,10 +65,10 @@
65
65
  "check:worker": "esbuild src/worker.ts --bundle --platform=neutral --format=esm --log-level=warning --outfile=node_modules/.cache/worker-check.js"
66
66
  },
67
67
  "dependencies": {
68
- "@modelcontextprotocol/sdk": "^1.12.0",
69
- "agentic-identity": "^0.6.0",
68
+ "@modelcontextprotocol/sdk": "^1.23.0",
69
+ "agentic-identity": "^0.7.0",
70
70
  "hono": "^4.13.14",
71
- "zod": "^3.25.0"
71
+ "zod": "^4.6.7"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/node": "^22.0.0",
@@ -1,217 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const CHANNELS: readonly ["inbox", "webhook", "email"];
4
- type Channel = (typeof CHANNELS)[number];
5
- declare const recipientSchema: z.ZodObject<{
6
- kind: z.ZodEnum<["human", "agent"]>;
7
- id: z.ZodString;
8
- }, "strict", z.ZodTypeAny, {
9
- id: string;
10
- kind: "human" | "agent";
11
- }, {
12
- id: string;
13
- kind: "human" | "agent";
14
- }>;
15
- type Recipient = z.infer<typeof recipientSchema>;
16
- declare const resourceRefSchema: z.ZodObject<{
17
- kind: z.ZodString;
18
- id: z.ZodString;
19
- url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
20
- }, "strict", z.ZodTypeAny, {
21
- id: string;
22
- kind: string;
23
- url?: string | undefined;
24
- }, {
25
- id: string;
26
- kind: string;
27
- url?: string | undefined;
28
- }>;
29
- type ResourceRef = z.infer<typeof resourceRefSchema>;
30
- declare const actorSchema: z.ZodObject<{
31
- kind: z.ZodEnum<["human", "agent"]>;
32
- id: z.ZodString;
33
- }, "strict", z.ZodTypeAny, {
34
- id: string;
35
- kind: "human" | "agent";
36
- }, {
37
- id: string;
38
- kind: "human" | "agent";
39
- }>;
40
- type Actor = z.infer<typeof actorSchema>;
41
- declare const notificationSchema: z.ZodObject<{
42
- id: z.ZodString;
43
- recipient: z.ZodObject<{
44
- kind: z.ZodEnum<["human", "agent"]>;
45
- id: z.ZodString;
46
- }, "strict", z.ZodTypeAny, {
47
- id: string;
48
- kind: "human" | "agent";
49
- }, {
50
- id: string;
51
- kind: "human" | "agent";
52
- }>;
53
- type: z.ZodString;
54
- resource: z.ZodObject<{
55
- kind: z.ZodString;
56
- id: z.ZodString;
57
- url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
58
- }, "strict", z.ZodTypeAny, {
59
- id: string;
60
- kind: string;
61
- url?: string | undefined;
62
- }, {
63
- id: string;
64
- kind: string;
65
- url?: string | undefined;
66
- }>;
67
- actor: z.ZodObject<{
68
- kind: z.ZodEnum<["human", "agent"]>;
69
- id: z.ZodString;
70
- }, "strict", z.ZodTypeAny, {
71
- id: string;
72
- kind: "human" | "agent";
73
- }, {
74
- id: string;
75
- kind: "human" | "agent";
76
- }>;
77
- body: z.ZodString;
78
- createdAt: z.ZodNumber;
79
- readAt: z.ZodNullable<z.ZodNumber>;
80
- }, "strict", z.ZodTypeAny, {
81
- type: string;
82
- id: string;
83
- recipient: {
84
- id: string;
85
- kind: "human" | "agent";
86
- };
87
- resource: {
88
- id: string;
89
- kind: string;
90
- url?: string | undefined;
91
- };
92
- actor: {
93
- id: string;
94
- kind: "human" | "agent";
95
- };
96
- body: string;
97
- createdAt: number;
98
- readAt: number | null;
99
- }, {
100
- type: string;
101
- id: string;
102
- recipient: {
103
- id: string;
104
- kind: "human" | "agent";
105
- };
106
- resource: {
107
- id: string;
108
- kind: string;
109
- url?: string | undefined;
110
- };
111
- actor: {
112
- id: string;
113
- kind: "human" | "agent";
114
- };
115
- body: string;
116
- createdAt: number;
117
- readAt: number | null;
118
- }>;
119
- type Notification = z.infer<typeof notificationSchema>;
120
- declare const sendInputSchema: z.ZodObject<{
121
- recipient: z.ZodObject<{
122
- kind: z.ZodEnum<["human", "agent"]>;
123
- id: z.ZodString;
124
- }, "strict", z.ZodTypeAny, {
125
- id: string;
126
- kind: "human" | "agent";
127
- }, {
128
- id: string;
129
- kind: "human" | "agent";
130
- }>;
131
- type: z.ZodString;
132
- resource: z.ZodObject<{
133
- kind: z.ZodString;
134
- id: z.ZodString;
135
- url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
136
- }, "strict", z.ZodTypeAny, {
137
- id: string;
138
- kind: string;
139
- url?: string | undefined;
140
- }, {
141
- id: string;
142
- kind: string;
143
- url?: string | undefined;
144
- }>;
145
- actor: z.ZodObject<{
146
- kind: z.ZodEnum<["human", "agent"]>;
147
- id: z.ZodString;
148
- }, "strict", z.ZodTypeAny, {
149
- id: string;
150
- kind: "human" | "agent";
151
- }, {
152
- id: string;
153
- kind: "human" | "agent";
154
- }>;
155
- body: z.ZodString;
156
- }, "strict", z.ZodTypeAny, {
157
- type: string;
158
- recipient: {
159
- id: string;
160
- kind: "human" | "agent";
161
- };
162
- resource: {
163
- id: string;
164
- kind: string;
165
- url?: string | undefined;
166
- };
167
- actor: {
168
- id: string;
169
- kind: "human" | "agent";
170
- };
171
- body: string;
172
- }, {
173
- type: string;
174
- recipient: {
175
- id: string;
176
- kind: "human" | "agent";
177
- };
178
- resource: {
179
- id: string;
180
- kind: string;
181
- url?: string | undefined;
182
- };
183
- actor: {
184
- id: string;
185
- kind: "human" | "agent";
186
- };
187
- body: string;
188
- }>;
189
- type SendInput = z.infer<typeof sendInputSchema>;
190
- declare const preferencesSchema: z.ZodObject<{
191
- channels: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodArray<z.ZodEnum<["inbox", "webhook", "email"]>, "many">, ("inbox" | "webhook" | "email")[], ("inbox" | "webhook" | "email")[]>>;
192
- muted: z.ZodBoolean;
193
- mutedTypes: z.ZodArray<z.ZodString, "many">;
194
- }, "strict", z.ZodTypeAny, {
195
- channels: Record<string, ("inbox" | "webhook" | "email")[]>;
196
- muted: boolean;
197
- mutedTypes: string[];
198
- }, {
199
- channels: Record<string, ("inbox" | "webhook" | "email")[]>;
200
- muted: boolean;
201
- mutedTypes: string[];
202
- }>;
203
- type Preferences = z.infer<typeof preferencesSchema>;
204
- declare const DEFAULT_CHANNELS: readonly Channel[];
205
- declare function defaultPreferences(): Preferences;
206
- declare function recipientKey(recipient: Recipient): string;
207
- interface DigestGroup {
208
- type: string;
209
- count: number;
210
- latest: Notification;
211
- }
212
- interface Digest {
213
- total: number;
214
- groups: DigestGroup[];
215
- }
216
-
217
- export { type Actor as A, type Channel as C, type Digest as D, type Notification as N, type Preferences as P, type Recipient as R, type SendInput as S, type ResourceRef as a, CHANNELS as b, DEFAULT_CHANNELS as c, type DigestGroup as d, defaultPreferences as e, recipientKey as r };