agentic-notify 0.2.1 → 0.3.0

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.2.1.** 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.3.0.** 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
 
@@ -59,10 +59,13 @@ CLI, SDK and MCP talk to that Worker:
59
59
  export NOTIFY_URL=https://notify.example.org NOTIFY_TOKEN=...
60
60
  npx agentic-notify send --to human:ana --type mention --resource doc:d1 --body "Look at this"
61
61
  npx agentic-notify list --unread
62
- npx agentic-notify mcp # tools: list_notifications, read_notification, mark_read,
63
- # mark_all_read, get_preferences, set_preferences, send_notification
62
+ npx agentic-notify mcp # tools: ping, list_notifications, read_notification, mark_read,
63
+ # mark_all_read, get_preferences, set_preferences, unread_count, digest,
64
+ # export_data, erase_data, send_notification
64
65
  ```
65
66
 
67
+ The MCP server needs `NOTIFY_URL` and `NOTIFY_TOKEN`. Without them only `ping` works. `erase_data` needs `confirm: true`.
68
+
66
69
  ```ts
67
70
  import { createClient } from "agentic-notify/sdk";
68
71
  const client = createClient({ baseUrl: process.env.NOTIFY_URL!, token: process.env.NOTIFY_TOKEN! });
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "agentic-notify",
4
- version: "0.2.1",
4
+ version: "0.3.0",
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",
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-PHY45IVQ.js";
13
+ } from "./chunk-O574VONP.js";
14
14
 
15
15
  // src/cli.ts
16
16
  import { realpathSync } from "fs";
@@ -1,7 +1,7 @@
1
- import { R as RecipientExport } from './gdpr-BAg1U1w6.js';
1
+ import { R as RecipientExport } from './gdpr-CUq5MUwo.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-anA8DMQH.js';
4
- import { D as DeliveryChannel, L as Logger } from './types-BdX7UTFu.js';
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';
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-anA8DMQH.js';
1
+ import { R as Recipient, P as Preferences, N as Notification } from './types-C842YAMe.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, N as NotFoundError, c as Notifier, d as NotifierOptions, S as SendResult, e as createDispatcher, f as createNotifier } from './dispatch-xe2IAqWe.js';
1
+ export { D as DispatchResult, a as DispatcherOptions, L as ListOptions, b as ListResult, N as NotFoundError, c as Notifier, d as NotifierOptions, S as SendResult, e as createDispatcher, f as createNotifier } from './dispatch-LBnkLOQg.js';
2
2
  export { Doc, Page, Query, Scalar, Store, StoreOps, createMemoryStore } from 'agentic-identity';
3
- import { R as Recipient } from './types-anA8DMQH.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-anA8DMQH.js';
5
- import { D as DeliveryChannel } from './types-BdX7UTFu.js';
6
- export { a as DeliveryError, L as Logger } from './types-BdX7UTFu.js';
7
- export { E as EmailChannelOptions, a as EmailMessage, b as EmailPort, c as createEmailChannel } from './testing-46doJP5Y.js';
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';
8
8
  export { D1Like, D1_SCHEMA, createD1Store } from 'agentic-identity/cloudflare';
9
- export { R as RecipientExport } from './gdpr-BAg1U1w6.js';
9
+ export { R as RecipientExport } from './gdpr-CUq5MUwo.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-PHY45IVQ.js";
26
+ } from "./chunk-O574VONP.js";
27
27
  export {
28
28
  CHANNELS,
29
29
  D1_SCHEMA,
package/dist/mcp-bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-PHY45IVQ.js";
4
+ } from "./chunk-O574VONP.js";
5
5
 
6
6
  // src/mcp-bin.ts
7
7
  var HELP = `agentic-notify-mcp ${VERSION}
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-anA8DMQH.js';
3
+ import './types-C842YAMe.js';
4
4
  import 'zod';
5
- import './gdpr-BAg1U1w6.js';
5
+ import './gdpr-CUq5MUwo.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-PHY45IVQ.js";
16
+ } from "./chunk-O574VONP.js";
17
17
 
18
18
  // src/mcp.ts
19
19
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -72,6 +72,26 @@ function createMcpServer(client) {
72
72
  inputSchema: preferencesSchema.shape,
73
73
  annotations: write
74
74
  }, (a) => need((c) => c.setPreferences(a))());
75
+ server.registerTool(
76
+ "unread_count",
77
+ { description: "Count your unread notifications.", inputSchema: {}, annotations: read },
78
+ need((c) => c.unreadCount())
79
+ );
80
+ server.registerTool("digest", {
81
+ description: "Group your unread notifications by type. Optional since: epoch milliseconds.",
82
+ inputSchema: { since: z.number().int().min(0).optional() },
83
+ annotations: read
84
+ }, ({ since }) => need((c) => c.digest(since))());
85
+ server.registerTool(
86
+ "export_data",
87
+ { description: "Export all data held about you.", inputSchema: {}, annotations: read },
88
+ need((c) => c.exportData())
89
+ );
90
+ server.registerTool("erase_data", {
91
+ description: "Permanently delete all data held about you. Pass confirm: true. This cannot be undone.",
92
+ inputSchema: { confirm: z.literal(true) },
93
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false }
94
+ }, () => need((c) => c.erase())());
75
95
  server.registerTool("send_notification", {
76
96
  description: "Send a notification. You must hold the send right. You are the actor.",
77
97
  inputSchema: { recipient: recipientSchema, type: typeNameSchema, resource: resourceRefSchema, body: z.string().max(2e3) },
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-anA8DMQH.js';
2
- import { R as RecipientExport } from './gdpr-BAg1U1w6.js';
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';
3
3
  import 'zod';
4
4
 
5
5
  declare class ApiError extends Error {
@@ -46,17 +46,17 @@ declare function createClient(options: ClientOptions): {
46
46
  type: string;
47
47
  id: string;
48
48
  recipient: {
49
- kind: "human" | "agent";
50
49
  id: string;
50
+ kind: "human" | "agent";
51
51
  };
52
52
  resource: {
53
- kind: string;
54
53
  id: string;
54
+ kind: string;
55
55
  url?: string | undefined;
56
56
  };
57
57
  actor: {
58
- kind: "human" | "agent";
59
58
  id: string;
59
+ kind: "human" | "agent";
60
60
  };
61
61
  body: string;
62
62
  createdAt: number;
@@ -66,17 +66,17 @@ declare function createClient(options: ClientOptions): {
66
66
  type: string;
67
67
  id: string;
68
68
  recipient: {
69
- kind: "human" | "agent";
70
69
  id: string;
70
+ kind: "human" | "agent";
71
71
  };
72
72
  resource: {
73
- kind: string;
74
73
  id: string;
74
+ kind: string;
75
75
  url?: string | undefined;
76
76
  };
77
77
  actor: {
78
- kind: "human" | "agent";
79
78
  id: string;
79
+ kind: "human" | "agent";
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-anA8DMQH.js';
3
- import { D as DeliveryChannel } from './types-BdX7UTFu.js';
2
+ import { R as Recipient } from './types-C842YAMe.js';
3
+ import { D as DeliveryChannel } from './types-DONKNIOo.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-46doJP5Y.js';
3
- import './types-anA8DMQH.js';
2
+ export { T as TestEmailAdapter } from './testing-B5slvYDV.js';
3
+ import './types-C842YAMe.js';
4
4
  import 'zod';
5
- import './types-BdX7UTFu.js';
5
+ import './types-DONKNIOo.js';
@@ -1,4 +1,4 @@
1
- import { N as Notification } from './types-anA8DMQH.js';
1
+ import { N as Notification } from './types-C842YAMe.js';
2
2
 
3
3
  /** A delivery channel other than the inbox. */
4
4
  interface DeliveryChannel {
package/dist/worker.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { c as Notifier, e as createDispatcher } from './dispatch-xe2IAqWe.js';
3
- import { R as Recipient } from './types-anA8DMQH.js';
2
+ import { c as Notifier, e as createDispatcher } from './dispatch-LBnkLOQg.js';
3
+ import { R as Recipient } from './types-C842YAMe.js';
4
4
  import { D1Like } from 'agentic-identity/cloudflare';
5
- import './gdpr-BAg1U1w6.js';
5
+ import './gdpr-CUq5MUwo.js';
6
6
  import 'agentic-identity';
7
- import './types-BdX7UTFu.js';
7
+ import './types-DONKNIOo.js';
8
8
 
9
9
  /** Who is calling. `kind` has no default: a missing kind is an error. */
10
10
  declare const principalSchema: z.ZodObject<{
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-PHY45IVQ.js";
12
+ } from "./chunk-O574VONP.js";
13
13
 
14
14
  // src/api.ts
15
15
  import { Hono } from "hono";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-notify",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
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",
@@ -6,11 +6,11 @@ declare const recipientSchema: z.ZodObject<{
6
6
  kind: z.ZodEnum<["human", "agent"]>;
7
7
  id: z.ZodString;
8
8
  }, "strict", z.ZodTypeAny, {
9
- kind: "human" | "agent";
10
9
  id: string;
11
- }, {
12
10
  kind: "human" | "agent";
11
+ }, {
13
12
  id: string;
13
+ kind: "human" | "agent";
14
14
  }>;
15
15
  type Recipient = z.infer<typeof recipientSchema>;
16
16
  declare const resourceRefSchema: z.ZodObject<{
@@ -18,12 +18,12 @@ declare const resourceRefSchema: z.ZodObject<{
18
18
  id: z.ZodString;
19
19
  url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
20
20
  }, "strict", z.ZodTypeAny, {
21
- kind: string;
22
21
  id: string;
22
+ kind: string;
23
23
  url?: string | undefined;
24
24
  }, {
25
- kind: string;
26
25
  id: string;
26
+ kind: string;
27
27
  url?: string | undefined;
28
28
  }>;
29
29
  type ResourceRef = z.infer<typeof resourceRefSchema>;
@@ -31,11 +31,11 @@ declare const actorSchema: z.ZodObject<{
31
31
  kind: z.ZodEnum<["human", "agent"]>;
32
32
  id: z.ZodString;
33
33
  }, "strict", z.ZodTypeAny, {
34
- kind: "human" | "agent";
35
34
  id: string;
36
- }, {
37
35
  kind: "human" | "agent";
36
+ }, {
38
37
  id: string;
38
+ kind: "human" | "agent";
39
39
  }>;
40
40
  type Actor = z.infer<typeof actorSchema>;
41
41
  declare const notificationSchema: z.ZodObject<{
@@ -44,11 +44,11 @@ declare const notificationSchema: z.ZodObject<{
44
44
  kind: z.ZodEnum<["human", "agent"]>;
45
45
  id: z.ZodString;
46
46
  }, "strict", z.ZodTypeAny, {
47
- kind: "human" | "agent";
48
47
  id: string;
49
- }, {
50
48
  kind: "human" | "agent";
49
+ }, {
51
50
  id: string;
51
+ kind: "human" | "agent";
52
52
  }>;
53
53
  type: z.ZodString;
54
54
  resource: z.ZodObject<{
@@ -56,23 +56,23 @@ declare const notificationSchema: z.ZodObject<{
56
56
  id: z.ZodString;
57
57
  url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
58
58
  }, "strict", z.ZodTypeAny, {
59
- kind: string;
60
59
  id: string;
60
+ kind: string;
61
61
  url?: string | undefined;
62
62
  }, {
63
- kind: string;
64
63
  id: string;
64
+ kind: string;
65
65
  url?: string | undefined;
66
66
  }>;
67
67
  actor: z.ZodObject<{
68
68
  kind: z.ZodEnum<["human", "agent"]>;
69
69
  id: z.ZodString;
70
70
  }, "strict", z.ZodTypeAny, {
71
- kind: "human" | "agent";
72
71
  id: string;
73
- }, {
74
72
  kind: "human" | "agent";
73
+ }, {
75
74
  id: string;
75
+ kind: "human" | "agent";
76
76
  }>;
77
77
  body: z.ZodString;
78
78
  createdAt: z.ZodNumber;
@@ -81,17 +81,17 @@ declare const notificationSchema: z.ZodObject<{
81
81
  type: string;
82
82
  id: string;
83
83
  recipient: {
84
- kind: "human" | "agent";
85
84
  id: string;
85
+ kind: "human" | "agent";
86
86
  };
87
87
  resource: {
88
- kind: string;
89
88
  id: string;
89
+ kind: string;
90
90
  url?: string | undefined;
91
91
  };
92
92
  actor: {
93
- kind: "human" | "agent";
94
93
  id: string;
94
+ kind: "human" | "agent";
95
95
  };
96
96
  body: string;
97
97
  createdAt: number;
@@ -100,17 +100,17 @@ declare const notificationSchema: z.ZodObject<{
100
100
  type: string;
101
101
  id: string;
102
102
  recipient: {
103
- kind: "human" | "agent";
104
103
  id: string;
104
+ kind: "human" | "agent";
105
105
  };
106
106
  resource: {
107
- kind: string;
108
107
  id: string;
108
+ kind: string;
109
109
  url?: string | undefined;
110
110
  };
111
111
  actor: {
112
- kind: "human" | "agent";
113
112
  id: string;
113
+ kind: "human" | "agent";
114
114
  };
115
115
  body: string;
116
116
  createdAt: number;
@@ -122,11 +122,11 @@ declare const sendInputSchema: z.ZodObject<{
122
122
  kind: z.ZodEnum<["human", "agent"]>;
123
123
  id: z.ZodString;
124
124
  }, "strict", z.ZodTypeAny, {
125
- kind: "human" | "agent";
126
125
  id: string;
127
- }, {
128
126
  kind: "human" | "agent";
127
+ }, {
129
128
  id: string;
129
+ kind: "human" | "agent";
130
130
  }>;
131
131
  type: z.ZodString;
132
132
  resource: z.ZodObject<{
@@ -134,55 +134,55 @@ declare const sendInputSchema: z.ZodObject<{
134
134
  id: z.ZodString;
135
135
  url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
136
136
  }, "strict", z.ZodTypeAny, {
137
- kind: string;
138
137
  id: string;
138
+ kind: string;
139
139
  url?: string | undefined;
140
140
  }, {
141
- kind: string;
142
141
  id: string;
142
+ kind: string;
143
143
  url?: string | undefined;
144
144
  }>;
145
145
  actor: z.ZodObject<{
146
146
  kind: z.ZodEnum<["human", "agent"]>;
147
147
  id: z.ZodString;
148
148
  }, "strict", z.ZodTypeAny, {
149
- kind: "human" | "agent";
150
149
  id: string;
151
- }, {
152
150
  kind: "human" | "agent";
151
+ }, {
153
152
  id: string;
153
+ kind: "human" | "agent";
154
154
  }>;
155
155
  body: z.ZodString;
156
156
  }, "strict", z.ZodTypeAny, {
157
157
  type: string;
158
158
  recipient: {
159
- kind: "human" | "agent";
160
159
  id: string;
160
+ kind: "human" | "agent";
161
161
  };
162
162
  resource: {
163
- kind: string;
164
163
  id: string;
164
+ kind: string;
165
165
  url?: string | undefined;
166
166
  };
167
167
  actor: {
168
- kind: "human" | "agent";
169
168
  id: string;
169
+ kind: "human" | "agent";
170
170
  };
171
171
  body: string;
172
172
  }, {
173
173
  type: string;
174
174
  recipient: {
175
- kind: "human" | "agent";
176
175
  id: string;
176
+ kind: "human" | "agent";
177
177
  };
178
178
  resource: {
179
- kind: string;
180
179
  id: string;
180
+ kind: string;
181
181
  url?: string | undefined;
182
182
  };
183
183
  actor: {
184
- kind: "human" | "agent";
185
184
  id: string;
185
+ kind: "human" | "agent";
186
186
  };
187
187
  body: string;
188
188
  }>;