agent-protocols 0.10.1 → 0.11.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 +89 -2
- package/dist/identity.d.ts +14 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +79 -2
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mail-client.d.ts +38 -0
- package/dist/mail-client.d.ts.map +1 -0
- package/dist/mail-client.js +176 -0
- package/dist/mail-client.js.map +1 -0
- package/dist/mail-schema.d.ts +355 -0
- package/dist/mail-schema.d.ts.map +1 -0
- package/dist/mail-schema.js +376 -0
- package/dist/mail-schema.js.map +1 -0
- package/dist/mail.d.ts +244 -0
- package/dist/mail.d.ts.map +1 -0
- package/dist/mail.js +817 -0
- package/dist/mail.js.map +1 -0
- package/package.json +14 -3
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
// Generated from docs/protocols/agent-mail/1.0.schema.json.
|
|
2
|
+
export const MAIL_SCHEMA = {
|
|
3
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
$id: "https://agent-protocols.dev/schemas/agent-mail/1.0.schema.json",
|
|
5
|
+
title: "Agent Mail Protocol 1.0",
|
|
6
|
+
description: "Structural definitions for owner-signed cards, sender-signed encrypted packets, plaintext messages and HTTP records. Signatures, sender/recipient/AAD binding, canonical encoding, time, size, sender policy and logical message deduplication require semantic validation.",
|
|
7
|
+
$defs: {
|
|
8
|
+
agentId: {
|
|
9
|
+
type: "string",
|
|
10
|
+
pattern: "^did:agent:[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$(?![\\s\\S])",
|
|
11
|
+
},
|
|
12
|
+
hash32: {
|
|
13
|
+
type: "string",
|
|
14
|
+
pattern: "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$(?![\\s\\S])",
|
|
15
|
+
},
|
|
16
|
+
id16: {
|
|
17
|
+
type: "string",
|
|
18
|
+
pattern: "^[A-Za-z0-9_-]{21}[AQgw]$(?![\\s\\S])",
|
|
19
|
+
},
|
|
20
|
+
signature: {
|
|
21
|
+
type: "string",
|
|
22
|
+
pattern: "^[A-Za-z0-9_-]{85}[AQgw]$(?![\\s\\S])",
|
|
23
|
+
},
|
|
24
|
+
base64url: {
|
|
25
|
+
type: "string",
|
|
26
|
+
pattern: "^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-][AQgw]|[A-Za-z0-9_-]{2}[AEIMQUYcgkosw048])?$(?![\\s\\S])",
|
|
27
|
+
},
|
|
28
|
+
timestampMs: {
|
|
29
|
+
type: "integer",
|
|
30
|
+
minimum: 0,
|
|
31
|
+
maximum: 9007199254740991,
|
|
32
|
+
},
|
|
33
|
+
positiveSafeInteger: {
|
|
34
|
+
type: "integer",
|
|
35
|
+
minimum: 1,
|
|
36
|
+
maximum: 9007199254740991,
|
|
37
|
+
},
|
|
38
|
+
httpsOrigin: {
|
|
39
|
+
type: "string",
|
|
40
|
+
pattern: "^https://[^/?#@\\s]+$(?![\\s\\S])",
|
|
41
|
+
not: {
|
|
42
|
+
pattern: ":443$(?![\\s\\S])",
|
|
43
|
+
},
|
|
44
|
+
description: "Approximate syntax only. Identity canonical HTTPS origin parsing and serialization are a semantic requirement.",
|
|
45
|
+
},
|
|
46
|
+
mailboxCardPayload: {
|
|
47
|
+
type: "object",
|
|
48
|
+
required: [
|
|
49
|
+
"mailbox_id",
|
|
50
|
+
"expires_at",
|
|
51
|
+
"receive_until",
|
|
52
|
+
"public_key",
|
|
53
|
+
"routes",
|
|
54
|
+
"max_packet_bytes",
|
|
55
|
+
],
|
|
56
|
+
properties: {
|
|
57
|
+
mailbox_id: {
|
|
58
|
+
$ref: "#/$defs/id16",
|
|
59
|
+
},
|
|
60
|
+
expires_at: {
|
|
61
|
+
$ref: "#/$defs/timestampMs",
|
|
62
|
+
},
|
|
63
|
+
receive_until: {
|
|
64
|
+
$ref: "#/$defs/timestampMs",
|
|
65
|
+
},
|
|
66
|
+
public_key: {
|
|
67
|
+
$ref: "#/$defs/hash32",
|
|
68
|
+
},
|
|
69
|
+
routes: {
|
|
70
|
+
type: "array",
|
|
71
|
+
items: {
|
|
72
|
+
$ref: "#/$defs/httpsOrigin",
|
|
73
|
+
},
|
|
74
|
+
minItems: 0,
|
|
75
|
+
maxItems: 8,
|
|
76
|
+
uniqueItems: true,
|
|
77
|
+
},
|
|
78
|
+
max_packet_bytes: {
|
|
79
|
+
type: "integer",
|
|
80
|
+
minimum: 4096,
|
|
81
|
+
maximum: 1048576,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
additionalProperties: false,
|
|
85
|
+
},
|
|
86
|
+
part: {
|
|
87
|
+
type: "object",
|
|
88
|
+
required: ["media_type", "data"],
|
|
89
|
+
properties: {
|
|
90
|
+
media_type: {
|
|
91
|
+
type: "string",
|
|
92
|
+
maxLength: 127,
|
|
93
|
+
pattern: "^[a-z0-9][a-z0-9!#$&^_.+\\-]*/[a-z0-9][a-z0-9!#$&^_.+\\-]*$(?![\\s\\S])",
|
|
94
|
+
},
|
|
95
|
+
data: {
|
|
96
|
+
$ref: "#/$defs/base64url",
|
|
97
|
+
},
|
|
98
|
+
name: {
|
|
99
|
+
type: "string",
|
|
100
|
+
minLength: 1,
|
|
101
|
+
maxLength: 255,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
additionalProperties: false,
|
|
105
|
+
},
|
|
106
|
+
messagePayload: {
|
|
107
|
+
type: "object",
|
|
108
|
+
required: [
|
|
109
|
+
"message_id",
|
|
110
|
+
"from",
|
|
111
|
+
"created_at",
|
|
112
|
+
"to",
|
|
113
|
+
"expires_at",
|
|
114
|
+
"thread_id",
|
|
115
|
+
"parts",
|
|
116
|
+
],
|
|
117
|
+
properties: {
|
|
118
|
+
message_id: {
|
|
119
|
+
$ref: "#/$defs/hash32",
|
|
120
|
+
},
|
|
121
|
+
from: {
|
|
122
|
+
$ref: "#/$defs/agentId",
|
|
123
|
+
},
|
|
124
|
+
created_at: {
|
|
125
|
+
$ref: "#/$defs/timestampMs",
|
|
126
|
+
},
|
|
127
|
+
to: {
|
|
128
|
+
$ref: "#/$defs/agentId",
|
|
129
|
+
},
|
|
130
|
+
expires_at: {
|
|
131
|
+
$ref: "#/$defs/timestampMs",
|
|
132
|
+
},
|
|
133
|
+
thread_id: {
|
|
134
|
+
$ref: "#/$defs/id16",
|
|
135
|
+
},
|
|
136
|
+
parts: {
|
|
137
|
+
type: "array",
|
|
138
|
+
items: {
|
|
139
|
+
$ref: "#/$defs/part",
|
|
140
|
+
},
|
|
141
|
+
minItems: 1,
|
|
142
|
+
maxItems: 32,
|
|
143
|
+
},
|
|
144
|
+
subject: {
|
|
145
|
+
type: "string",
|
|
146
|
+
maxLength: 1024,
|
|
147
|
+
},
|
|
148
|
+
in_reply_to: {
|
|
149
|
+
$ref: "#/$defs/hash32",
|
|
150
|
+
},
|
|
151
|
+
reply_card: {
|
|
152
|
+
$ref: "#/$defs/mailboxCardEnvelope",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
additionalProperties: false,
|
|
156
|
+
},
|
|
157
|
+
mailboxCardEvent: {
|
|
158
|
+
type: "object",
|
|
159
|
+
required: ["protocol", "type", "actor", "created_at", "nonce", "payload"],
|
|
160
|
+
properties: {
|
|
161
|
+
protocol: {
|
|
162
|
+
const: "agent-mail/1.0",
|
|
163
|
+
},
|
|
164
|
+
type: {
|
|
165
|
+
const: "mailbox.publish",
|
|
166
|
+
},
|
|
167
|
+
actor: {
|
|
168
|
+
$ref: "#/$defs/agentId",
|
|
169
|
+
},
|
|
170
|
+
created_at: {
|
|
171
|
+
$ref: "#/$defs/timestampMs",
|
|
172
|
+
},
|
|
173
|
+
nonce: {
|
|
174
|
+
$ref: "#/$defs/positiveSafeInteger",
|
|
175
|
+
},
|
|
176
|
+
payload: {
|
|
177
|
+
$ref: "#/$defs/mailboxCardPayload",
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
additionalProperties: false,
|
|
181
|
+
},
|
|
182
|
+
mailboxCardEnvelope: {
|
|
183
|
+
type: "object",
|
|
184
|
+
required: ["event", "hash", "signature"],
|
|
185
|
+
properties: {
|
|
186
|
+
event: {
|
|
187
|
+
$ref: "#/$defs/mailboxCardEvent",
|
|
188
|
+
},
|
|
189
|
+
hash: {
|
|
190
|
+
$ref: "#/$defs/hash32",
|
|
191
|
+
},
|
|
192
|
+
signature: {
|
|
193
|
+
$ref: "#/$defs/signature",
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
additionalProperties: false,
|
|
197
|
+
},
|
|
198
|
+
envelope: {
|
|
199
|
+
oneOf: [
|
|
200
|
+
{
|
|
201
|
+
$ref: "#/$defs/mailboxCardEnvelope",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
$ref: "#/$defs/packetEnvelope",
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
packetHeader: {
|
|
209
|
+
type: "object",
|
|
210
|
+
required: ["mailbox_id", "card_hash", "expires_at"],
|
|
211
|
+
properties: {
|
|
212
|
+
mailbox_id: {
|
|
213
|
+
$ref: "#/$defs/id16",
|
|
214
|
+
},
|
|
215
|
+
card_hash: {
|
|
216
|
+
$ref: "#/$defs/hash32",
|
|
217
|
+
},
|
|
218
|
+
expires_at: {
|
|
219
|
+
$ref: "#/$defs/timestampMs",
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
additionalProperties: false,
|
|
223
|
+
},
|
|
224
|
+
packetPayload: {
|
|
225
|
+
type: "object",
|
|
226
|
+
required: ["header", "enc", "ciphertext"],
|
|
227
|
+
properties: {
|
|
228
|
+
header: {
|
|
229
|
+
$ref: "#/$defs/packetHeader",
|
|
230
|
+
},
|
|
231
|
+
enc: {
|
|
232
|
+
$ref: "#/$defs/hash32",
|
|
233
|
+
},
|
|
234
|
+
ciphertext: {
|
|
235
|
+
allOf: [
|
|
236
|
+
{
|
|
237
|
+
$ref: "#/$defs/base64url",
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
minLength: 1387,
|
|
241
|
+
maxLength: 1048576,
|
|
242
|
+
description: "Decoded length must be >= 1040 and 16 modulo 1024. Total JCS(packet) length must fit the card and protocol limits; these are semantic checks.",
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
additionalProperties: false,
|
|
246
|
+
},
|
|
247
|
+
cardAcceptedRecord: {
|
|
248
|
+
type: "object",
|
|
249
|
+
required: ["envelope", "accepted_at"],
|
|
250
|
+
properties: {
|
|
251
|
+
envelope: {
|
|
252
|
+
$ref: "#/$defs/mailboxCardEnvelope",
|
|
253
|
+
},
|
|
254
|
+
accepted_at: {
|
|
255
|
+
$ref: "#/$defs/timestampMs",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
additionalProperties: false,
|
|
259
|
+
},
|
|
260
|
+
deliveryResult: {
|
|
261
|
+
type: "object",
|
|
262
|
+
required: ["packet_id", "accepted_at"],
|
|
263
|
+
properties: {
|
|
264
|
+
packet_id: {
|
|
265
|
+
$ref: "#/$defs/hash32",
|
|
266
|
+
},
|
|
267
|
+
accepted_at: {
|
|
268
|
+
$ref: "#/$defs/timestampMs",
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
additionalProperties: false,
|
|
272
|
+
},
|
|
273
|
+
packetRecord: {
|
|
274
|
+
type: "object",
|
|
275
|
+
required: ["packet_id", "packet", "accepted_at", "seq"],
|
|
276
|
+
properties: {
|
|
277
|
+
packet_id: {
|
|
278
|
+
$ref: "#/$defs/hash32",
|
|
279
|
+
},
|
|
280
|
+
packet: {
|
|
281
|
+
$ref: "#/$defs/packetEnvelope",
|
|
282
|
+
},
|
|
283
|
+
accepted_at: {
|
|
284
|
+
$ref: "#/$defs/timestampMs",
|
|
285
|
+
},
|
|
286
|
+
seq: {
|
|
287
|
+
$ref: "#/$defs/positiveSafeInteger",
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
additionalProperties: false,
|
|
291
|
+
},
|
|
292
|
+
packetList: {
|
|
293
|
+
type: "object",
|
|
294
|
+
required: ["result"],
|
|
295
|
+
properties: {
|
|
296
|
+
result: {
|
|
297
|
+
type: "array",
|
|
298
|
+
items: {
|
|
299
|
+
$ref: "#/$defs/packetRecord",
|
|
300
|
+
},
|
|
301
|
+
minItems: 0,
|
|
302
|
+
maxItems: 1000,
|
|
303
|
+
},
|
|
304
|
+
next_cursor: {
|
|
305
|
+
type: "string",
|
|
306
|
+
minLength: 1,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
additionalProperties: true,
|
|
310
|
+
},
|
|
311
|
+
discoveryDocument: {
|
|
312
|
+
type: "object",
|
|
313
|
+
required: ["protocol", "service"],
|
|
314
|
+
properties: {
|
|
315
|
+
protocol: {
|
|
316
|
+
const: "agent-mail/1.0",
|
|
317
|
+
},
|
|
318
|
+
service: {
|
|
319
|
+
$ref: "#/$defs/httpsOrigin",
|
|
320
|
+
},
|
|
321
|
+
features: {
|
|
322
|
+
type: "array",
|
|
323
|
+
items: {
|
|
324
|
+
type: "string",
|
|
325
|
+
},
|
|
326
|
+
uniqueItems: true,
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
additionalProperties: true,
|
|
330
|
+
description: "Mail defines no endpoint names; delivery paths are fixed at each card route. Other members are inert extensions.",
|
|
331
|
+
},
|
|
332
|
+
packetEvent: {
|
|
333
|
+
type: "object",
|
|
334
|
+
required: ["protocol", "type", "actor", "created_at", "nonce", "payload"],
|
|
335
|
+
properties: {
|
|
336
|
+
protocol: {
|
|
337
|
+
const: "agent-mail/1.0",
|
|
338
|
+
},
|
|
339
|
+
type: {
|
|
340
|
+
const: "mail.submit",
|
|
341
|
+
},
|
|
342
|
+
actor: {
|
|
343
|
+
$ref: "#/$defs/agentId",
|
|
344
|
+
},
|
|
345
|
+
created_at: {
|
|
346
|
+
$ref: "#/$defs/timestampMs",
|
|
347
|
+
},
|
|
348
|
+
nonce: {
|
|
349
|
+
$ref: "#/$defs/positiveSafeInteger",
|
|
350
|
+
},
|
|
351
|
+
payload: {
|
|
352
|
+
$ref: "#/$defs/packetPayload",
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
additionalProperties: false,
|
|
356
|
+
},
|
|
357
|
+
packetEnvelope: {
|
|
358
|
+
type: "object",
|
|
359
|
+
required: ["event", "hash", "signature"],
|
|
360
|
+
properties: {
|
|
361
|
+
event: {
|
|
362
|
+
$ref: "#/$defs/packetEvent",
|
|
363
|
+
},
|
|
364
|
+
hash: {
|
|
365
|
+
$ref: "#/$defs/hash32",
|
|
366
|
+
},
|
|
367
|
+
signature: {
|
|
368
|
+
$ref: "#/$defs/signature",
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
additionalProperties: false,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
$ref: "#/$defs/envelope",
|
|
375
|
+
};
|
|
376
|
+
//# sourceMappingURL=mail-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-schema.js","sourceRoot":"","sources":["../src/mail-schema.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,gEAAgE;IACrE,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,6QAA6Q;IAC/Q,KAAK,EAAE;QACL,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,6DAA6D;SACvE;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,mDAAmD;SAC7D;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,uCAAuC;SACjD;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,uCAAuC;SACjD;QACD,SAAS,EAAE;Y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AK;SAC5B;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC;YACxC,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,qBAAqB;iBAC5B;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,gBAAgB;iBACvB;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,mBAAmB;iBAC1B;aACF;YACD,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,IAAI,EAAE,kBAAkB;CAChB,CAAC"}
|
package/dist/mail.d.ts
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { AgentSigner, type NonceStore, type Event, type Envelope, type AcceptedRecord, type ListResponse } from "./identity.js";
|
|
2
|
+
export { MAIL_SCHEMA } from "./mail-schema.js";
|
|
3
|
+
export declare const MAIL_PROTOCOL = "agent-mail/1.0";
|
|
4
|
+
export declare const MAIL_MAX_TTL_MS: number;
|
|
5
|
+
export declare const MAIL_FUTURE_SKEW_MS = 300000;
|
|
6
|
+
export declare const MAIL_MAX_PACKET_BYTES = 1048576;
|
|
7
|
+
export interface MailboxCardPayload {
|
|
8
|
+
mailbox_id: string;
|
|
9
|
+
expires_at: number;
|
|
10
|
+
receive_until: number;
|
|
11
|
+
public_key: string;
|
|
12
|
+
routes: string[];
|
|
13
|
+
max_packet_bytes: number;
|
|
14
|
+
}
|
|
15
|
+
export type MailboxCard = Envelope<MailboxCardPayload>;
|
|
16
|
+
export interface MailPart {
|
|
17
|
+
media_type: string;
|
|
18
|
+
data: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface MailMessagePayload {
|
|
22
|
+
message_id: string;
|
|
23
|
+
from: string;
|
|
24
|
+
created_at: number;
|
|
25
|
+
to: string;
|
|
26
|
+
expires_at: number;
|
|
27
|
+
thread_id: string;
|
|
28
|
+
parts: MailPart[];
|
|
29
|
+
subject?: string;
|
|
30
|
+
in_reply_to?: string;
|
|
31
|
+
reply_card?: MailboxCard;
|
|
32
|
+
}
|
|
33
|
+
/** The signed `mail.submit` envelope: the wire object relays store and recipients open. */
|
|
34
|
+
export type MailPacket = Envelope<MailPacketPayload>;
|
|
35
|
+
export interface MailPacketHeader {
|
|
36
|
+
mailbox_id: string;
|
|
37
|
+
card_hash: string;
|
|
38
|
+
expires_at: number;
|
|
39
|
+
}
|
|
40
|
+
export interface MailPacketPayload {
|
|
41
|
+
header: MailPacketHeader;
|
|
42
|
+
enc: string;
|
|
43
|
+
ciphertext: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MailDeliveryResult {
|
|
46
|
+
packet_id: string;
|
|
47
|
+
accepted_at: number;
|
|
48
|
+
}
|
|
49
|
+
export interface MailPacketRecord extends MailDeliveryResult {
|
|
50
|
+
packet: MailPacket;
|
|
51
|
+
seq: number;
|
|
52
|
+
}
|
|
53
|
+
export interface MailDiscovery {
|
|
54
|
+
protocol: typeof MAIL_PROTOCOL;
|
|
55
|
+
service: string;
|
|
56
|
+
features?: string[];
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
export type MailCardRecord = AcceptedRecord<MailboxCardPayload>;
|
|
60
|
+
export type MailPacketList = ListResponse<MailPacketRecord> & {
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
/** Canonical, strict I-JSON bytes. This never silently drops undefined members. */
|
|
64
|
+
export declare function mailCanonicalBytes(value: unknown): Uint8Array;
|
|
65
|
+
export declare function validateMailSchema(value: unknown, definition?: string): void;
|
|
66
|
+
export declare function decodeMailBytes(value: string, length?: number): Uint8Array;
|
|
67
|
+
export declare function newMailId(): string;
|
|
68
|
+
/** A parsed mailbox address (Mail Section 3.3). `routes` is empty for the stable form. */
|
|
69
|
+
export interface MailAddress {
|
|
70
|
+
owner: string;
|
|
71
|
+
mailbox_id: string;
|
|
72
|
+
routes: string[];
|
|
73
|
+
}
|
|
74
|
+
/** Parse `did:agent:<key>/mail/<mailbox_id>[?route=<origin>...]`. */
|
|
75
|
+
export declare function parseMailAddress(value: unknown): MailAddress;
|
|
76
|
+
/** Format the stable address, or a contact address when routes are given. */
|
|
77
|
+
export declare function formatMailAddress(owner: string, mailboxId: string, routes?: string[]): string;
|
|
78
|
+
export declare function mailTextPart(text: string, name?: string): MailPart;
|
|
79
|
+
/** Returns inert text only; does not render markup or perform network/file actions. */
|
|
80
|
+
export declare function mailPartText(part: MailPart): string;
|
|
81
|
+
/** Historical verification: shape, signature, owner, intrinsic times, routes, and key. */
|
|
82
|
+
export declare function validateMailboxCard(card: unknown, owner?: string): asserts card is MailboxCard;
|
|
83
|
+
/** A card usable for new encryption: not future-dated, open (non-empty routes), unexpired. */
|
|
84
|
+
export declare function validateMailSenderCard(card: unknown, owner: string, now?: number): asserts card is MailboxCard;
|
|
85
|
+
/** Validate immutable plaintext; sender authentication comes from its signed packet. */
|
|
86
|
+
export declare function validateMailMessage(message: unknown): asserts message is MailMessagePayload;
|
|
87
|
+
export declare function mailboxPublishEvent(actor: string, createdAt: number, nonce: number, payload: MailboxCardPayload): Event<MailboxCardPayload>;
|
|
88
|
+
export declare function newMailMessageId(): string;
|
|
89
|
+
export declare function createMailMessage(actor: string, createdAt: number, payload: Omit<MailMessagePayload, "message_id" | "from" | "created_at">): MailMessagePayload;
|
|
90
|
+
export declare function validateMailReply(reply: MailMessagePayload, parent: MailMessagePayload): void;
|
|
91
|
+
export declare function validateMailPacket(packet: unknown, expectedId?: string): asserts packet is MailPacket;
|
|
92
|
+
export declare function mailPacketId(packet: MailPacket): string;
|
|
93
|
+
/** HPKE AAD: the packet's five metadata fields and header, from the verified outer event. */
|
|
94
|
+
export declare function mailPacketAad(event: Event<MailPacketPayload>): Uint8Array;
|
|
95
|
+
export declare function frameMailBytes(bytes: Uint8Array): Uint8Array;
|
|
96
|
+
export declare function unframeMailMessage(frame: Uint8Array): MailMessagePayload;
|
|
97
|
+
/** Independent raw X25519 secret. Never derive this from an Identity signing key. */
|
|
98
|
+
export declare class MailEncryptionKey {
|
|
99
|
+
private secret;
|
|
100
|
+
private destroyed;
|
|
101
|
+
private constructor();
|
|
102
|
+
static generate(): MailEncryptionKey;
|
|
103
|
+
static fromBytes(secret: Uint8Array): MailEncryptionKey;
|
|
104
|
+
publicKey(): string;
|
|
105
|
+
/** Sensitive backup material: store only in an owner-controlled encrypted key store. */
|
|
106
|
+
exportSecret(): Uint8Array;
|
|
107
|
+
destroy(): void;
|
|
108
|
+
}
|
|
109
|
+
/** Stateless encryption with fresh HPKE randomness. Pin the card with MailCardCache first. */
|
|
110
|
+
export declare function sealMailPacket(message: MailMessagePayload, card: MailboxCard, signer: AgentSigner, nonce: number, now?: number): Promise<MailPacket>;
|
|
111
|
+
/** Verify/decrypt a queued packet; expiration of new acceptance is checked by MailInbox. */
|
|
112
|
+
export declare function openMailPacket(packet: MailPacket, card: MailboxCard, key: MailEncryptionKey, owner: string, now?: number, expectedId?: string): Promise<MailMessagePayload>;
|
|
113
|
+
export interface MailCardCacheSnapshot {
|
|
114
|
+
version: 1;
|
|
115
|
+
pins: MailboxCard[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Sender-side card pins: the greatest-nonce card seen per (owner, mailbox),
|
|
119
|
+
* including closed or expired cards. Persist the snapshot after every observe,
|
|
120
|
+
* even one that throws because the new pin is unusable.
|
|
121
|
+
*/
|
|
122
|
+
export declare class MailCardCache {
|
|
123
|
+
private readonly pins;
|
|
124
|
+
constructor(snapshot?: MailCardCacheSnapshot);
|
|
125
|
+
private id;
|
|
126
|
+
snapshot(): MailCardCacheSnapshot;
|
|
127
|
+
/** Pin a verified card, then (by default) require that it is usable for new encryption. */
|
|
128
|
+
observe(card: MailboxCard, owner: string, now?: number, requireUsable?: boolean): MailboxCard;
|
|
129
|
+
/** Drop pins old enough that every earlier card of the mailbox has expired. */
|
|
130
|
+
prune(now?: number): void;
|
|
131
|
+
seal(message: MailMessagePayload, card: MailboxCard, signer: AgentSigner, nonce: number, now?: number): Promise<MailPacket>;
|
|
132
|
+
}
|
|
133
|
+
export interface MailKeyringSnapshot {
|
|
134
|
+
version: 1;
|
|
135
|
+
owner: string;
|
|
136
|
+
entries: {
|
|
137
|
+
card: MailboxCard;
|
|
138
|
+
secret: string;
|
|
139
|
+
}[];
|
|
140
|
+
}
|
|
141
|
+
/** Retained verified cards and their secrets, looked up by card hash until receive_until. */
|
|
142
|
+
export declare class MailKeyring {
|
|
143
|
+
readonly owner: string;
|
|
144
|
+
private readonly entries;
|
|
145
|
+
constructor(owner: string);
|
|
146
|
+
add(card: MailboxCard, key: MailEncryptionKey): void;
|
|
147
|
+
/** Sensitive snapshot, including raw encryption secrets. Protect it separately from logs and application data. */
|
|
148
|
+
exportSnapshot(): MailKeyringSnapshot;
|
|
149
|
+
static restore(snapshot: MailKeyringSnapshot): MailKeyring;
|
|
150
|
+
prune(now?: number): void;
|
|
151
|
+
open(packet: MailPacket, now?: number, expectedId?: string): Promise<MailMessagePayload>;
|
|
152
|
+
/** @internal Open a packet already checked by `packetBytes`; used by `MailInbox`. */
|
|
153
|
+
openChecked(packet: MailPacket, bytes: Uint8Array, now: number): Promise<MailMessagePayload>;
|
|
154
|
+
}
|
|
155
|
+
export interface MailInboxSnapshot {
|
|
156
|
+
version: 1;
|
|
157
|
+
owner: string;
|
|
158
|
+
accepted: [string, number, string][];
|
|
159
|
+
blocked_senders: string[];
|
|
160
|
+
}
|
|
161
|
+
export declare class MailInbox {
|
|
162
|
+
readonly keyring: MailKeyring;
|
|
163
|
+
private readonly accepted;
|
|
164
|
+
private readonly blocked;
|
|
165
|
+
constructor(keyring: MailKeyring, snapshot?: MailInboxSnapshot);
|
|
166
|
+
setSenderBlocked(sender: string, blocked?: boolean): void;
|
|
167
|
+
snapshot(): MailInboxSnapshot;
|
|
168
|
+
has(sender: string, messageId: string): boolean;
|
|
169
|
+
/** Verify the packet once, apply sender policy before decryption, then deduplicate the message. */
|
|
170
|
+
accept(packet: MailPacket, now?: number, expectedId?: string): Promise<{
|
|
171
|
+
kind: "accepted" | "duplicate";
|
|
172
|
+
message: MailMessagePayload;
|
|
173
|
+
}>;
|
|
174
|
+
prune(now?: number): void;
|
|
175
|
+
}
|
|
176
|
+
export declare function validateMailDiscovery(value: unknown, service: string): asserts value is MailDiscovery;
|
|
177
|
+
/** Identity request JWT for this relay origin whose subject is the mailbox owner. */
|
|
178
|
+
export declare function validateMailOwnerJwt(token: string, service: string, owner: string, now?: number): void;
|
|
179
|
+
export declare function validateMailCardRecord(value: unknown, owner?: string, mailboxId?: string, hash?: string): asserts value is MailCardRecord;
|
|
180
|
+
export declare function validateMailDeliveryResult(value: unknown, packet?: MailPacket): asserts value is MailDeliveryResult;
|
|
181
|
+
export declare function validateMailPacketRecord(value: unknown, mailboxId?: string): asserts value is MailPacketRecord;
|
|
182
|
+
export declare function validateMailPacketList(value: unknown, mailboxId: string, limit?: number): asserts value is MailPacketList;
|
|
183
|
+
export interface MailRelaySnapshot {
|
|
184
|
+
version: 1;
|
|
185
|
+
origin: string;
|
|
186
|
+
mailboxes: {
|
|
187
|
+
current: MailCardRecord;
|
|
188
|
+
last_seq: number;
|
|
189
|
+
blocked_senders: string[];
|
|
190
|
+
packets: MailPacketRecord[];
|
|
191
|
+
tombstones: {
|
|
192
|
+
packet_id: string;
|
|
193
|
+
accepted_at: number;
|
|
194
|
+
expires_at: number;
|
|
195
|
+
}[];
|
|
196
|
+
}[];
|
|
197
|
+
}
|
|
198
|
+
export interface MailRelayOptions {
|
|
199
|
+
clock?: () => number;
|
|
200
|
+
/** Service-wide Identity nonce cache for card publishes; packets are not live writes. */
|
|
201
|
+
nonceStore?: NonceStore;
|
|
202
|
+
/** Per-mailbox limits on retained packets. */
|
|
203
|
+
maxPackets?: number;
|
|
204
|
+
maxBytes?: number;
|
|
205
|
+
snapshot?: MailRelaySnapshot;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Synchronous process-local relay model. All validation precedes mutation;
|
|
209
|
+
* persist the snapshot atomically before emitting a successful HTTP response.
|
|
210
|
+
* The short-lived nonce cache is not part of the snapshot.
|
|
211
|
+
*/
|
|
212
|
+
export declare class MailRelayStore {
|
|
213
|
+
readonly origin: string;
|
|
214
|
+
private readonly boxes;
|
|
215
|
+
private readonly nonces;
|
|
216
|
+
private readonly clock;
|
|
217
|
+
private readonly maxPackets;
|
|
218
|
+
private readonly maxBytes;
|
|
219
|
+
constructor(origin: string, options?: MailRelayOptions);
|
|
220
|
+
snapshot(): MailRelaySnapshot;
|
|
221
|
+
discovery(): MailDiscovery;
|
|
222
|
+
publish(card: MailboxCard, now?: number): MailCardRecord;
|
|
223
|
+
card(mailboxId: string): MailCardRecord;
|
|
224
|
+
publishJson(text: string, now?: number): MailCardRecord;
|
|
225
|
+
deliverJson(mailboxId: string, text: string, now?: number): MailDeliveryResult;
|
|
226
|
+
/** Packets are asynchronous signed objects: no live-write window or nonce maximum applies. */
|
|
227
|
+
deliver(mailboxId: string, packet: MailPacket, now?: number): MailDeliveryResult;
|
|
228
|
+
/**
|
|
229
|
+
* Owner sender policy for new packets. Mail defines no management endpoint:
|
|
230
|
+
* the host authenticates the mailbox owner before calling this.
|
|
231
|
+
*/
|
|
232
|
+
setSenderBlocked(mailboxId: string, sender: string, blocked: boolean): void;
|
|
233
|
+
private ownerBox;
|
|
234
|
+
list(mailboxId: string, jwt: string, options?: {
|
|
235
|
+
limit?: number;
|
|
236
|
+
cursor?: string;
|
|
237
|
+
now?: number;
|
|
238
|
+
}): MailPacketList;
|
|
239
|
+
delete(mailboxId: string, packetId: string, jwt: string, now?: number): void;
|
|
240
|
+
/** Drop expired packets and tombstones, then forget mailboxes whose current card's `receive_until` passed. */
|
|
241
|
+
prune(now?: number): void;
|
|
242
|
+
private dropExpired;
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=mail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail.d.ts","sourceRoot":"","sources":["../src/mail.ts"],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