@fungi.computer/carrier 0.0.0-stage → 0.0.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.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +457 -2
  3. package/dist/cloudflare.d.ts +32 -0
  4. package/dist/cloudflare.js +80 -0
  5. package/dist/email.d.ts +2 -0
  6. package/dist/email.js +2 -0
  7. package/dist/index.d.ts +21 -0
  8. package/dist/index.js +28 -0
  9. package/dist/inspection.d.ts +108 -0
  10. package/dist/inspection.js +188 -0
  11. package/dist/internal/cloudflare-send.d.ts +9 -0
  12. package/dist/internal/cloudflare-send.js +79 -0
  13. package/dist/internal/contracts.d.ts +94 -0
  14. package/dist/internal/contracts.js +7 -0
  15. package/dist/internal/owner.d.ts +24 -0
  16. package/dist/internal/owner.js +419 -0
  17. package/dist/internal/policy.d.ts +25 -0
  18. package/dist/internal/policy.js +18 -0
  19. package/dist/internal/post-contract.d.ts +27 -0
  20. package/dist/internal/post-contract.js +22 -0
  21. package/dist/internal/post-execution.d.ts +45 -0
  22. package/dist/internal/post-execution.js +73 -0
  23. package/dist/internal/post-sql.d.ts +51 -0
  24. package/dist/internal/post-sql.js +255 -0
  25. package/dist/internal/receipt-schema.d.ts +3 -0
  26. package/dist/internal/receipt-schema.js +12 -0
  27. package/dist/post-d1.d.ts +36 -0
  28. package/dist/post-d1.js +55 -0
  29. package/dist/post-outbox.d.ts +40 -0
  30. package/dist/post-outbox.js +99 -0
  31. package/dist/post-postgres.d.ts +25 -0
  32. package/dist/post-postgres.js +79 -0
  33. package/dist/post.d.ts +189 -0
  34. package/dist/post.js +436 -0
  35. package/dist/testing.d.ts +16 -0
  36. package/dist/testing.js +20 -0
  37. package/docs/api/README.md +20 -0
  38. package/docs/api/cloudflare.md +100 -0
  39. package/docs/api/email.md +87 -0
  40. package/docs/api/index.md +343 -0
  41. package/docs/api/inspection.md +281 -0
  42. package/docs/api/post-d1.md +184 -0
  43. package/docs/api/post-postgres.md +108 -0
  44. package/docs/api/post.md +620 -0
  45. package/docs/api/testing.md +46 -0
  46. package/package.json +94 -3
@@ -0,0 +1,620 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/carrier**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/carrier](README.md) / post
8
+
9
+ # post
10
+
11
+ ## Classes
12
+
13
+ ### PostError
14
+
15
+ Post rejected an unknown route or conflicting key.
16
+
17
+ #### Extends
18
+
19
+ - `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `message`: `string`;
20
+ \}\>
21
+
22
+ #### Constructors
23
+
24
+ ##### Constructor
25
+
26
+ ```ts
27
+ new PostError(message): PostError;
28
+ ```
29
+
30
+ ###### Parameters
31
+
32
+ | Parameter | Type |
33
+ | --------- | -------- |
34
+ | `message` | `string` |
35
+
36
+ ###### Returns
37
+
38
+ [`PostError`](#posterror)
39
+
40
+ ###### Overrides
41
+
42
+ ```ts
43
+ Data.TaggedError("PostError")<{
44
+ readonly message: string;
45
+ }>.constructor
46
+ ```
47
+
48
+ #### Properties
49
+
50
+ ##### message
51
+
52
+ ```ts
53
+ message: string;
54
+ ```
55
+
56
+ ###### Inherited from
57
+
58
+ ```ts
59
+ Data.TaggedError("PostError").message;
60
+ ```
61
+
62
+ ## Type Aliases
63
+
64
+ ### PostDeliveryResult
65
+
66
+ ```ts
67
+ type PostDeliveryResult =
68
+ | "accepted"
69
+ | "duplicate"
70
+ | "refused"
71
+ | Readonly<{
72
+ status: "accepted" | "duplicate";
73
+ cursor: number;
74
+ }>
75
+ | Readonly<{
76
+ status: "accepted" | "duplicate" | "refused";
77
+ receipt: Schema.Json;
78
+ }>;
79
+ ```
80
+
81
+ Receiver's idempotent admission decision.
82
+
83
+ ---
84
+
85
+ ### PostOutboxStore
86
+
87
+ ```ts
88
+ type PostOutboxStore<E> = Readonly<{
89
+ put: (key, value) => Effect.Effect<void, E>;
90
+ read: (key) => Effect.Effect<string | undefined, E>;
91
+ list: (
92
+ limit,
93
+ afterKey?,
94
+ ) => Effect.Effect<
95
+ readonly Readonly<{
96
+ key: string;
97
+ value: string;
98
+ }>[],
99
+ E
100
+ >;
101
+ delete: (key) => Effect.Effect<void, E>;
102
+ }>;
103
+ ```
104
+
105
+ Durable, string-backed rows. A delivered receipt must outlive source replay.
106
+
107
+ #### Type Parameters
108
+
109
+ | Type Parameter |
110
+ | -------------- |
111
+ | `E` |
112
+
113
+ ---
114
+
115
+ ### PostOutbox
116
+
117
+ ```ts
118
+ type PostOutbox<M, E> = Readonly<{
119
+ enqueue: (message, at?) => Effect.Effect<number | undefined, E>;
120
+ drain: () => Effect.Effect<void, E>;
121
+ deadLetters: (limit, afterKey?) => Effect.Effect<M[], E>;
122
+ }>;
123
+ ```
124
+
125
+ Bounded generic delivery owned by Post.
126
+
127
+ #### Type Parameters
128
+
129
+ | Type Parameter |
130
+ | -------------- |
131
+ | `M` |
132
+ | `E` |
133
+
134
+ ---
135
+
136
+ ### PostEnvelope
137
+
138
+ ```ts
139
+ type PostEnvelope = Schema.Schema.Type<typeof PostEnvelopeSchema>;
140
+ ```
141
+
142
+ One addressed event identified by the producer's stable key.
143
+
144
+ ---
145
+
146
+ ### PostRow
147
+
148
+ ```ts
149
+ type PostRow = Schema.Schema.Type<typeof PostRowSchema>;
150
+ ```
151
+
152
+ Pending row, terminal receipt, or dead letter.
153
+
154
+ ---
155
+
156
+ ### PostRoute
157
+
158
+ ```ts
159
+ type PostRoute<A, E, D, AI, EI, DI> = Readonly<{
160
+ addressKind: string;
161
+ address: Schema.Codec<A, AI>;
162
+ event: Schema.Codec<E, EI>;
163
+ name: (address) => string;
164
+ namespace: Readonly<{
165
+ getByName: (name) => Readonly<{
166
+ deliver: (envelope) => Promise<PostDeliveryResult>;
167
+ }>;
168
+ }>;
169
+ }> &
170
+ | Readonly<{
171
+ prepare: Readonly<{
172
+ event: Schema.Codec<D, DI>;
173
+ run: (address, intent, signal) => Promise<D>;
174
+ }>;
175
+ onDelivered?: (address, event) => void;
176
+ onCursor?: (address, event, cursor) => void;
177
+ onRefused?: (address, event) => void;
178
+ }>
179
+ | Readonly<{
180
+ prepare?: undefined;
181
+ onDelivered?: (address, event) => void;
182
+ onCursor?: (address, event, cursor) => void;
183
+ onRefused?: (address, event) => void;
184
+ }>;
185
+ ```
186
+
187
+ Schema-correlated ordinary events or prepared delivery facts.
188
+
189
+ #### Type Parameters
190
+
191
+ | Type Parameter | Default type |
192
+ | -------------- | ------------ |
193
+ | `A` | - |
194
+ | `E` | - |
195
+ | `D` | `E` |
196
+ | `AI` | `A` |
197
+ | `EI` | `E` |
198
+ | `DI` | `EI` |
199
+
200
+ ---
201
+
202
+ ### PostRegistryRoute
203
+
204
+ ```ts
205
+ type PostRegistryRoute = Readonly<{
206
+ addressKind: string;
207
+ address: Schema.Codec<unknown, unknown>;
208
+ event: Schema.Codec<unknown, unknown>;
209
+ encodeEnvelope: (envelope) => PostEnvelope;
210
+ parseDelivery: (envelope) => PostEnvelope;
211
+ prepareEnvelope?: (envelope, signal) => Promise<PostEnvelope>;
212
+ recordDelivered?: (envelope) => void;
213
+ nameOf: (envelope) => string;
214
+ namespace: PostRoute<never, never>["namespace"];
215
+ recordCursor?: (envelope, cursor) => void;
216
+ recordRefused?: (envelope) => void;
217
+ }>;
218
+ ```
219
+
220
+ Runtime operations that preserve the route's schema evidence.
221
+
222
+ ---
223
+
224
+ ### PostRuntime
225
+
226
+ ```ts
227
+ type PostRuntime<R> = Readonly<{
228
+ send: <K>(input) => void;
229
+ execute: (job) => Promise<
230
+ Readonly<{
231
+ kind: "completed";
232
+ }>
233
+ >;
234
+ enqueueDue: (limit?, afterKey?) => Promise<string | undefined>;
235
+ deadLetters: (
236
+ limit?,
237
+ afterKey?,
238
+ ) => Readonly<{
239
+ letters: readonly Readonly<{
240
+ key: string;
241
+ reason: "refused" | "exhausted";
242
+ envelope: PostEnvelope;
243
+ attempts: number;
244
+ }>[];
245
+ nextCursor: string | undefined;
246
+ }>;
247
+ latest: <K>(
248
+ kind,
249
+ address,
250
+ ) =>
251
+ | Readonly<{
252
+ key: string;
253
+ row: PostRow;
254
+ }>
255
+ | undefined;
256
+ retry: (key) => Promise<void>;
257
+ read: (key) => PostRow | undefined;
258
+ nextWake: () => number | null;
259
+ }>;
260
+ ```
261
+
262
+ One producer's Post operations.
263
+
264
+ #### Type Parameters
265
+
266
+ | Type Parameter |
267
+ | ----------------------------------------------------------------------------- |
268
+ | `R` _extends_ `Record`\<`string`, [`PostRegistryRoute`](#postregistryroute)\> |
269
+
270
+ ## Variables
271
+
272
+ ### PostDeliveryResultSchema
273
+
274
+ ```ts
275
+ const PostDeliveryResultSchema: Union<
276
+ readonly [
277
+ Literals<readonly ["accepted", "duplicate", "refused"]>,
278
+ Struct<{
279
+ status: Literals<readonly ["accepted", "duplicate"]>;
280
+ cursor: Int;
281
+ }>,
282
+ Struct<{
283
+ status: Literals<readonly ["accepted", "duplicate", "refused"]>;
284
+ receipt: Codec<Json, Json, never, never>;
285
+ }>,
286
+ ]
287
+ >;
288
+ ```
289
+
290
+ Accepted receipt, revision cursor, or permanent refusal returned by a receiver.
291
+
292
+ ---
293
+
294
+ ### PostEnvelopeSchema
295
+
296
+ ```ts
297
+ const PostEnvelopeSchema: Struct<{
298
+ key: String;
299
+ kind: String;
300
+ address: Unknown;
301
+ event: Unknown;
302
+ }>;
303
+ ```
304
+
305
+ Wire envelope parsed at the durable row and receiver boundaries.
306
+
307
+ ---
308
+
309
+ ### PostRowSchema
310
+
311
+ ```ts
312
+ const PostRowSchema: fromJsonString<
313
+ Union<
314
+ readonly [
315
+ Struct<{
316
+ state: Literal<"pending">;
317
+ envelope: Struct<{
318
+ key: String;
319
+ kind: String;
320
+ address: Unknown;
321
+ event: Unknown;
322
+ }>;
323
+ attempts: Int;
324
+ nextAttemptAt: Number;
325
+ jobId: optional<String>;
326
+ delivery: optional<
327
+ Struct<{
328
+ key: String;
329
+ kind: String;
330
+ address: Unknown;
331
+ event: Unknown;
332
+ }>
333
+ >;
334
+ nextKey: optional<String>;
335
+ }>,
336
+ Struct<{
337
+ state: Literal<"delivered">;
338
+ receipt: optional<Codec<Json, Json, never, never>>;
339
+ nextKey: optional<String>;
340
+ }>,
341
+ Struct<{
342
+ state: Literal<"dead">;
343
+ envelope: Struct<{
344
+ key: String;
345
+ kind: String;
346
+ address: Unknown;
347
+ event: Unknown;
348
+ }>;
349
+ attempts: Int;
350
+ reason: Literals<readonly ["refused", "exhausted"]>;
351
+ receipt: optional<Codec<Json, Json, never, never>>;
352
+ delivery: optional<
353
+ Struct<{
354
+ key: String;
355
+ kind: String;
356
+ address: Unknown;
357
+ event: Unknown;
358
+ }>
359
+ >;
360
+ nextKey: optional<String>;
361
+ }>,
362
+ ]
363
+ >
364
+ >;
365
+ ```
366
+
367
+ Persisted Post row parser.
368
+
369
+ ## Functions
370
+
371
+ ### retryDelay()
372
+
373
+ ```ts
374
+ function retryDelay(attempts): number;
375
+ ```
376
+
377
+ BirdDog's retained bounded retry schedule.
378
+
379
+ #### Parameters
380
+
381
+ | Parameter | Type |
382
+ | ---------- | -------- |
383
+ | `attempts` | `number` |
384
+
385
+ #### Returns
386
+
387
+ `number`
388
+
389
+ ---
390
+
391
+ ### makePostOutbox()
392
+
393
+ ```ts
394
+ function makePostOutbox<M, E>(options): PostOutbox<M, E>;
395
+ ```
396
+
397
+ The same bounded delivery and receipt machinery serves Post and BirdDog.
398
+
399
+ #### Type Parameters
400
+
401
+ | Type Parameter |
402
+ | -------------- |
403
+ | `M` |
404
+ | `E` |
405
+
406
+ #### Parameters
407
+
408
+ | Parameter | Type |
409
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
410
+ | `options` | `Readonly`\<\{ `message`: `Schema.Codec`\<`M`\>; `key`: (`message`) => `string`; `outbox`: [`PostOutboxStore`](#postoutboxstore)\<`E`\>; `deliver`: (`message`) => `Effect.Effect`\<`boolean`, `E`\>; `scheduleWake`: (`at`) => `Effect.Effect`\<`void`, `E`\>; `now`: () => `number`; `invalidRow`: () => `E`; `encodingFailed`: () => `E`; \}\> |
411
+
412
+ #### Returns
413
+
414
+ [`PostOutbox`](#postoutbox)\<`M`, `E`\>
415
+
416
+ ---
417
+
418
+ ### definePostRoute()
419
+
420
+ #### Call Signature
421
+
422
+ ```ts
423
+ function definePostRoute<A, E, AI, EI>(route): PostRoute<A, E, E, AI, EI, EI> & Omit<Readonly<{
424
+ addressKind: string;
425
+ address: Codec<unknown, unknown>;
426
+ event: Codec<unknown, unknown>;
427
+ encodeEnvelope: (envelope) => object;
428
+ parseDelivery: (envelope) => object;
429
+ prepareEnvelope?: (envelope, signal) => Promise<{
430
+ key: string;
431
+ kind: string;
432
+ address: unknown;
433
+ event: unknown;
434
+ }>;
435
+ recordDelivered?: (envelope) => void;
436
+ nameOf: (envelope) => string;
437
+ namespace: Readonly<{
438
+ getByName: (name) => Readonly<{
439
+ deliver: (envelope) => Promise<...>;
440
+ }>;
441
+ }>;
442
+ recordCursor?: (envelope, cursor) => void;
443
+ recordRefused?: (envelope) => void;
444
+ }>, "address" | "event">;
445
+ ```
446
+
447
+ Preserve each route's inferred address and event types in a registry.
448
+
449
+ ##### Type Parameters
450
+
451
+ | Type Parameter | Default type |
452
+ | -------------- | ------------ |
453
+ | `A` | - |
454
+ | `E` | - |
455
+ | `AI` | `A` |
456
+ | `EI` | `E` |
457
+
458
+ ##### Parameters
459
+
460
+ | Parameter | Type |
461
+ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
462
+ | `route` | `Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`A`, `AI`\>; `event`: `Codec`\<`E`, `EI`\>; `name`: (`address`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<[`PostDeliveryResult`](#postdeliveryresult)\>; \}\>; \}\>; \}\> & `Readonly`\<\{ `prepare?`: `undefined`; `onDelivered?`: (`address`, `event`) => `void`; `onCursor?`: (`address`, `event`, `cursor`) => `void`; `onRefused?`: (`address`, `event`) => `void`; \}\> |
463
+
464
+ ##### Returns
465
+
466
+ [`PostRoute`](#postroute)\<`A`, `E`, `E`, `AI`, `EI`, `EI`\> &
467
+ `Omit`\<`Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`unknown`,
468
+ `unknown`\>; `event`: `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`:
469
+ (`envelope`) => `object`; `parseDelivery`: (`envelope`) => `object`;
470
+ `prepareEnvelope?`: (`envelope`, `signal`) => `Promise`\<\{ `key`: `string`;
471
+ `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \}\>;
472
+ `recordDelivered?`: (`envelope`) => `void`; `nameOf`: (`envelope`) => `string`;
473
+ `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`:
474
+ (`envelope`) => `Promise`\<...\>; \}\>; \}\>; `recordCursor?`: (`envelope`,
475
+ `cursor`) => `void`; `recordRefused?`: (`envelope`) => `void`; \}\>, `"address"`
476
+ \| `"event"`\>
477
+
478
+ #### Call Signature
479
+
480
+ ```ts
481
+ function definePostRoute<A, E, D, AI, EI, DI>(route): PostRoute<A, E, D, AI, EI, DI> & Omit<Readonly<{
482
+ addressKind: string;
483
+ address: Codec<unknown, unknown>;
484
+ event: Codec<unknown, unknown>;
485
+ encodeEnvelope: (envelope) => object;
486
+ parseDelivery: (envelope) => object;
487
+ prepareEnvelope?: (envelope, signal) => Promise<{
488
+ key: string;
489
+ kind: string;
490
+ address: unknown;
491
+ event: unknown;
492
+ }>;
493
+ recordDelivered?: (envelope) => void;
494
+ nameOf: (envelope) => string;
495
+ namespace: Readonly<{
496
+ getByName: (name) => Readonly<{
497
+ deliver: (envelope) => Promise<...>;
498
+ }>;
499
+ }>;
500
+ recordCursor?: (envelope, cursor) => void;
501
+ recordRefused?: (envelope) => void;
502
+ }>, "address" | "event">;
503
+ ```
504
+
505
+ Preserve each route's inferred address and event types in a registry.
506
+
507
+ ##### Type Parameters
508
+
509
+ | Type Parameter | Default type |
510
+ | -------------- | ------------ |
511
+ | `A` | - |
512
+ | `E` | - |
513
+ | `D` | - |
514
+ | `AI` | `A` |
515
+ | `EI` | `E` |
516
+ | `DI` | `EI` |
517
+
518
+ ##### Parameters
519
+
520
+ | Parameter | Type |
521
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
522
+ | `route` | `Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`A`, `AI`\>; `event`: `Codec`\<`E`, `EI`\>; `name`: (`address`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<[`PostDeliveryResult`](#postdeliveryresult)\>; \}\>; \}\>; \}\> & `Readonly`\<\{ `prepare`: `Readonly`\<\{ `event`: `Schema.Codec`\<`D`, `DI`\>; `run`: (`address`, `intent`, `signal`) => `Promise`\<`D`\>; \}\>; `onDelivered?`: (`address`, `event`) => `void`; `onCursor?`: (`address`, `event`, `cursor`) => `void`; `onRefused?`: (`address`, `event`) => `void`; \}\> |
523
+
524
+ ##### Returns
525
+
526
+ [`PostRoute`](#postroute)\<`A`, `E`, `D`, `AI`, `EI`, `DI`\> &
527
+ `Omit`\<`Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`unknown`,
528
+ `unknown`\>; `event`: `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`:
529
+ (`envelope`) => `object`; `parseDelivery`: (`envelope`) => `object`;
530
+ `prepareEnvelope?`: (`envelope`, `signal`) => `Promise`\<\{ `key`: `string`;
531
+ `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \}\>;
532
+ `recordDelivered?`: (`envelope`) => `void`; `nameOf`: (`envelope`) => `string`;
533
+ `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`:
534
+ (`envelope`) => `Promise`\<...\>; \}\>; \}\>; `recordCursor?`: (`envelope`,
535
+ `cursor`) => `void`; `recordRefused?`: (`envelope`) => `void`; \}\>, `"address"`
536
+ \| `"event"`\>
537
+
538
+ ---
539
+
540
+ ### migratePostEvents()
541
+
542
+ ```ts
543
+ function migratePostEvents<A, AI, B, BI>(options): void;
544
+ ```
545
+
546
+ Migrate persisted ordinary events once, before opening their producer. Carrier
547
+ preserves delivery evidence, ordering and Watchdog job identities. A failed
548
+ decoder or transform rolls back both rows and the migration receipt.
549
+
550
+ #### Type Parameters
551
+
552
+ | Type Parameter |
553
+ | -------------- |
554
+ | `A` |
555
+ | `AI` |
556
+ | `B` |
557
+ | `BI` |
558
+
559
+ #### Parameters
560
+
561
+ | Parameter | Type |
562
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
563
+ | `options` | `Readonly`\<\{ `owner`: `WatchdogSqliteOwner`; `id`: `string`; `kind`: `string`; `toKind?`: `string`; `from`: `Schema.Codec`\<`A`, `AI`\>; `to`: `Schema.Codec`\<`B`, `BI`\>; `migrate`: (`event`) => `B`; \}\> |
564
+
565
+ #### Returns
566
+
567
+ `void`
568
+
569
+ ---
570
+
571
+ ### createPost()
572
+
573
+ ```ts
574
+ function createPost<R>(options): PostRuntime<R>;
575
+ ```
576
+
577
+ Decode at both persisted and DO boundaries with the route's Effect Schema.
578
+
579
+ #### Type Parameters
580
+
581
+ | Type Parameter |
582
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
583
+ | `R` _extends_ `Record`\<`string`, `Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`unknown`, `unknown`\>; `event`: `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`: (`envelope`) => `object`; `parseDelivery`: (`envelope`) => `object`; `prepareEnvelope?`: (`envelope`, `signal`) => `Promise`\<\{ `key`: `string`; `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \}\>; `recordDelivered?`: (`envelope`) => `void`; `nameOf`: (`envelope`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<[`PostDeliveryResult`](#postdeliveryresult)\>; \}\>; \}\>; `recordCursor?`: (`envelope`, `cursor`) => `void`; `recordRefused?`: (`envelope`) => `void`; \}\>\> |
584
+
585
+ #### Parameters
586
+
587
+ | Parameter | Type |
588
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
589
+ | `options` | `Readonly`\<\{ `routes`: `R`; `owner`: `WatchdogSqliteOwner`; `transactional`: `WatchdogTransactionalProjection`; `readJob`: `WatchdogRuntime`\[`"read"`\]; `now`: () => `number`; `scheduleWake`: (`at`) => `Promise`\<`void`\>; \}\> |
590
+
591
+ #### Returns
592
+
593
+ [`PostRuntime`](#postruntime)\<`R`\>
594
+
595
+ ---
596
+
597
+ ### admitPost()
598
+
599
+ ```ts
600
+ function admitPost<E, I>(options): PostDeliveryResult;
601
+ ```
602
+
603
+ Consumer admission runs inside the receiver's own SQLite transaction.
604
+
605
+ #### Type Parameters
606
+
607
+ | Type Parameter |
608
+ | -------------- |
609
+ | `E` |
610
+ | `I` |
611
+
612
+ #### Parameters
613
+
614
+ | Parameter | Type |
615
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
616
+ | `options` | `Readonly`\<\{ `key`: `string`; `event`: `unknown`; `schema`: `Schema.Codec`\<`E`, `I`\>; `hasReceipt`: (`key`) => `boolean`; `apply`: (`event`) => [`PostDeliveryResult`](#postdeliveryresult); `putReceipt`: (`key`) => `void`; \}\> |
617
+
618
+ #### Returns
619
+
620
+ [`PostDeliveryResult`](#postdeliveryresult)
@@ -0,0 +1,46 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/carrier**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/carrier](README.md) / testing
8
+
9
+ # testing
10
+
11
+ ## Type Aliases
12
+
13
+ ### MemoryOutbox
14
+
15
+ ```ts
16
+ type MemoryOutbox = Readonly<{
17
+ put: (key, value) => Promise<void>;
18
+ read: (key) => Promise<string | undefined>;
19
+ list: (
20
+ limit,
21
+ afterKey?,
22
+ ) => Promise<
23
+ readonly Readonly<{
24
+ key: string;
25
+ value: string;
26
+ }>[]
27
+ >;
28
+ delete: (key) => Promise<void>;
29
+ }>;
30
+ ```
31
+
32
+ String-row outbox for deterministic tests and quick starts; no persistence.
33
+
34
+ ## Functions
35
+
36
+ ### createMemoryOutbox()
37
+
38
+ ```ts
39
+ function createMemoryOutbox(): MemoryOutbox;
40
+ ```
41
+
42
+ Create an independent in-process outbox for trusted tests and examples.
43
+
44
+ #### Returns
45
+
46
+ [`MemoryOutbox`](#memoryoutbox)