@antiphony/shared 0.3.0 → 0.4.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.
Files changed (44) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/api-codecs.cjs +74 -147
  3. package/dist/cjs/api-codecs.d.cts +105 -60
  4. package/dist/cjs/index.cjs +84 -197
  5. package/dist/cjs/index.d.cts +89 -7
  6. package/dist/cjs/nsid.cjs +6 -9
  7. package/dist/cjs/nsid.d.cts +7 -8
  8. package/dist/cjs/types/audio.cjs +60 -124
  9. package/dist/cjs/types/audio.d.cts +226 -185
  10. package/dist/cjs/types/blob.cjs +5 -9
  11. package/dist/cjs/types/blob.d.cts +21 -21
  12. package/dist/cjs/types/records.cjs +0 -45
  13. package/dist/cjs/types/records.d.cts +1 -103
  14. package/dist/esm/api-codecs.d.ts +135 -90
  15. package/dist/esm/api-codecs.js +4 -5
  16. package/dist/esm/chunk-D655OH2I.js +35 -0
  17. package/dist/esm/chunk-RUUHUNZ6.js +37 -0
  18. package/dist/esm/{chunk-6LROFBKK.js → chunk-SBYNIQRZ.js} +7 -9
  19. package/dist/esm/chunk-SMK4OZNU.js +17 -0
  20. package/dist/esm/{chunk-F7IHVM34.js → chunk-WL2GSPGC.js} +64 -12
  21. package/dist/esm/index.d.ts +89 -7
  22. package/dist/esm/index.js +5 -7
  23. package/dist/esm/nsid.d.ts +7 -8
  24. package/dist/esm/nsid.js +1 -1
  25. package/dist/esm/types/audio.d.ts +303 -262
  26. package/dist/esm/types/audio.js +3 -4
  27. package/dist/esm/types/blob.d.ts +21 -21
  28. package/dist/esm/types/blob.js +1 -1
  29. package/dist/esm/types/records.d.ts +1 -103
  30. package/dist/esm/types/records.js +1 -1
  31. package/package.json +90 -26
  32. package/dist/cjs/types/api.cjs +0 -166
  33. package/dist/cjs/types/api.d.cts +0 -242
  34. package/dist/cjs/types/views.cjs +0 -179
  35. package/dist/cjs/types/views.d.cts +0 -726
  36. package/dist/esm/chunk-5EHV73BA.js +0 -20
  37. package/dist/esm/chunk-FDM5FDN4.js +0 -46
  38. package/dist/esm/chunk-IHIBHQBJ.js +0 -78
  39. package/dist/esm/chunk-R6SBR3IG.js +0 -97
  40. package/dist/esm/chunk-Y6HNNRVD.js +0 -12
  41. package/dist/esm/types/api.d.ts +0 -242
  42. package/dist/esm/types/api.js +0 -4
  43. package/dist/esm/types/views.d.ts +0 -726
  44. package/dist/esm/types/views.js +0 -3
@@ -3,11 +3,6 @@ import { z } from 'zod';
3
3
  /**
4
4
  * Antiphony canonical audio-post contract (`dev.antiphony.*`).
5
5
  *
6
- * This is the NEW data model from `specs/antiphony-data-model.md`, added
7
- * ADDITIVELY alongside the legacy `PromptRecord`/`ReplyRecord` (Stream 1).
8
- * Nothing here touches the old shapes; Vox Pop keeps running on them until the
9
- * Stream 4 migration deletes the legacy schemas + `com.voxpop.*` lexicons.
10
- *
11
6
  * Mirrors the lexicons in `lexicons/dev/antiphony/`. Key model decisions:
12
7
  * - ONE post collection; `reply` presence discriminates prompt-vs-reply.
13
8
  * - The audio is a standard `embed.audio`; transcript is platform enrichment
@@ -85,20 +80,30 @@ type ReplyRef = z.infer<typeof ReplyRefSchema>;
85
80
  */
86
81
  declare const AudioEmbedSchema: z.ZodObject<{
87
82
  $type: z.ZodLiteral<"dev.antiphony.embed.audio">;
88
- /** The audio bytes as a content-addressed storage ref (CID/path). */
83
+ /** The audio bytes as a content-addressed blob ref (`ref.$link` = CID). */
89
84
  audio: z.ZodObject<{
90
85
  $type: z.ZodLiteral<"blob">;
91
- ref: z.ZodString;
86
+ ref: z.ZodObject<{
87
+ $link: z.ZodString;
88
+ }, "strip", z.ZodTypeAny, {
89
+ $link: string;
90
+ }, {
91
+ $link: string;
92
+ }>;
92
93
  mimeType: z.ZodString;
93
94
  size: z.ZodNumber;
94
95
  }, "strip", z.ZodTypeAny, {
95
96
  $type: "blob";
96
- ref: string;
97
+ ref: {
98
+ $link: string;
99
+ };
97
100
  mimeType: string;
98
101
  size: number;
99
102
  }, {
100
103
  $type: "blob";
101
- ref: string;
104
+ ref: {
105
+ $link: string;
106
+ };
102
107
  mimeType: string;
103
108
  size: number;
104
109
  }>;
@@ -112,7 +117,9 @@ declare const AudioEmbedSchema: z.ZodObject<{
112
117
  $type: "dev.antiphony.embed.audio";
113
118
  audio: {
114
119
  $type: "blob";
115
- ref: string;
120
+ ref: {
121
+ $link: string;
122
+ };
116
123
  mimeType: string;
117
124
  size: number;
118
125
  };
@@ -123,7 +130,9 @@ declare const AudioEmbedSchema: z.ZodObject<{
123
130
  $type: "dev.antiphony.embed.audio";
124
131
  audio: {
125
132
  $type: "blob";
126
- ref: string;
133
+ ref: {
134
+ $link: string;
135
+ };
127
136
  mimeType: string;
128
137
  size: number;
129
138
  };
@@ -140,21 +149,21 @@ declare const TranscriptSegmentSchema: z.ZodEffects<z.ZodObject<{
140
149
  endMs: z.ZodNumber;
141
150
  text: z.ZodString;
142
151
  }, "strip", z.ZodTypeAny, {
143
- text: string;
144
152
  startMs: number;
145
153
  endMs: number;
146
- }, {
147
154
  text: string;
155
+ }, {
148
156
  startMs: number;
149
157
  endMs: number;
150
- }>, {
151
158
  text: string;
159
+ }>, {
152
160
  startMs: number;
153
161
  endMs: number;
154
- }, {
155
162
  text: string;
163
+ }, {
156
164
  startMs: number;
157
165
  endMs: number;
166
+ text: string;
158
167
  }>;
159
168
  type TranscriptSegment = z.infer<typeof TranscriptSegmentSchema>;
160
169
  /**
@@ -168,35 +177,35 @@ declare const TimedTranscriptSchema: z.ZodObject<{
168
177
  endMs: z.ZodNumber;
169
178
  text: z.ZodString;
170
179
  }, "strip", z.ZodTypeAny, {
171
- text: string;
172
180
  startMs: number;
173
181
  endMs: number;
174
- }, {
175
182
  text: string;
183
+ }, {
176
184
  startMs: number;
177
185
  endMs: number;
178
- }>, {
179
186
  text: string;
187
+ }>, {
180
188
  startMs: number;
181
189
  endMs: number;
182
- }, {
183
190
  text: string;
191
+ }, {
184
192
  startMs: number;
185
193
  endMs: number;
194
+ text: string;
186
195
  }>, "many">;
187
196
  text: z.ZodOptional<z.ZodString>;
188
197
  }, "strip", z.ZodTypeAny, {
189
198
  segments: {
190
- text: string;
191
199
  startMs: number;
192
200
  endMs: number;
201
+ text: string;
193
202
  }[];
194
203
  text?: string | undefined;
195
204
  }, {
196
205
  segments: {
197
- text: string;
198
206
  startMs: number;
199
207
  endMs: number;
208
+ text: string;
200
209
  }[];
201
210
  text?: string | undefined;
202
211
  }>;
@@ -219,38 +228,55 @@ declare const AudioEmbedViewSchema: z.ZodObject<{
219
228
  endMs: z.ZodNumber;
220
229
  text: z.ZodString;
221
230
  }, "strip", z.ZodTypeAny, {
222
- text: string;
223
231
  startMs: number;
224
232
  endMs: number;
225
- }, {
226
233
  text: string;
234
+ }, {
227
235
  startMs: number;
228
236
  endMs: number;
229
- }>, {
230
237
  text: string;
238
+ }>, {
231
239
  startMs: number;
232
240
  endMs: number;
233
- }, {
234
241
  text: string;
242
+ }, {
235
243
  startMs: number;
236
244
  endMs: number;
245
+ text: string;
237
246
  }>, "many">;
238
247
  text: z.ZodOptional<z.ZodString>;
239
248
  }, "strip", z.ZodTypeAny, {
240
249
  segments: {
241
- text: string;
242
250
  startMs: number;
243
251
  endMs: number;
252
+ text: string;
244
253
  }[];
245
254
  text?: string | undefined;
246
255
  }, {
247
256
  segments: {
248
- text: string;
249
257
  startMs: number;
250
258
  endMs: number;
259
+ text: string;
251
260
  }[];
252
261
  text?: string | undefined;
253
262
  }>>;
263
+ /**
264
+ * Per-stage audio-processing status (transcribe / denoise), when the app
265
+ * opted into processing on create. Absent otherwise. A `pending` stage
266
+ * means the client should poll (or re-render) for the result. When
267
+ * `denoise === 'ready'`, `url` above already resolves to the cleaned
268
+ * audio variant. See `types/processing.ts`.
269
+ */
270
+ processing: z.ZodOptional<z.ZodObject<{
271
+ transcribe: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
272
+ denoise: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
275
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
276
+ }, {
277
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
278
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
279
+ }>>;
254
280
  }, "strip", z.ZodTypeAny, {
255
281
  $type: "dev.antiphony.embed.audio#view";
256
282
  url: string;
@@ -259,12 +285,16 @@ declare const AudioEmbedViewSchema: z.ZodObject<{
259
285
  waveform?: number[] | undefined;
260
286
  transcript?: {
261
287
  segments: {
262
- text: string;
263
288
  startMs: number;
264
289
  endMs: number;
290
+ text: string;
265
291
  }[];
266
292
  text?: string | undefined;
267
293
  } | undefined;
294
+ processing?: {
295
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
296
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
297
+ } | undefined;
268
298
  }, {
269
299
  $type: "dev.antiphony.embed.audio#view";
270
300
  url: string;
@@ -273,12 +303,16 @@ declare const AudioEmbedViewSchema: z.ZodObject<{
273
303
  waveform?: number[] | undefined;
274
304
  transcript?: {
275
305
  segments: {
276
- text: string;
277
306
  startMs: number;
278
307
  endMs: number;
308
+ text: string;
279
309
  }[];
280
310
  text?: string | undefined;
281
311
  } | undefined;
312
+ processing?: {
313
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
314
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
315
+ } | undefined;
282
316
  }>;
283
317
  type AudioEmbedView = z.infer<typeof AudioEmbedViewSchema>;
284
318
  /**
@@ -293,6 +327,13 @@ type AudioEmbedView = z.infer<typeof AudioEmbedViewSchema>;
293
327
  declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
294
328
  /** Storage id (rkey/doc id). */
295
329
  id: z.ZodString;
330
+ /**
331
+ * Content CID of the canonical lexicon record (CIDv1, dag-cbor, sha2-256
332
+ * — the AT Protocol record-CID rule). Computed at write time over the
333
+ * lexicon projection (public fields only, NOT the storage/tenancy fields
334
+ * below), so StrongRefs built from it are verifiable content addresses.
335
+ */
336
+ cid: z.ZodString;
296
337
  /** Origin app that created this record — the multi-tenant isolation key. */
297
338
  originAppId: z.ZodString;
298
339
  /** Authoring user. A queryable facet, not the tenancy boundary. */
@@ -309,9 +350,39 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
309
350
  * opened the branch. Set on replies (deduped, 1–2 ids); absent on prompts
310
351
  * (a prompt's repliers are the app's audience policy, not a fixed pair).
311
352
  * Inherited down the branch so reply gating is an O(1) field check, never a
312
- * thread walk. See `specs/antiphony-data-model.md` §6 "Reply gating".
353
+ * thread walk.
313
354
  */
314
355
  threadParticipants: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
356
+ /**
357
+ * Author of this reply's thread ROOT (the prompt) — the reply's recipient,
358
+ * the person whose "replies to me" feed it lands in. Denormalized at write
359
+ * time so "replies whose root author is X" is a cheap composite-index query
360
+ * (see `queryByRootAuthor`). Set on replies (`kind === 'reply'`); absent on
361
+ * prompts. Storage-layer facet, NOT in the public lexicon or the record CID.
362
+ */
363
+ rootAuthorId: z.ZodOptional<z.ZodString>;
364
+ /**
365
+ * Async audio-processing state (transcribe / denoise), present iff the app
366
+ * opted into processing on create. Mutated by the processing worker after
367
+ * the post is created — storage-layer, NOT in the lexicon or the record
368
+ * CID. See `types/processing.ts`.
369
+ */
370
+ processing: z.ZodOptional<z.ZodObject<{
371
+ transcribe: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
372
+ denoise: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
373
+ denoisedBlobCid: z.ZodOptional<z.ZodString>;
374
+ updatedAt: z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>;
375
+ }, "strip", z.ZodTypeAny, {
376
+ updatedAt: Date;
377
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
378
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
379
+ denoisedBlobCid?: string | undefined;
380
+ }, {
381
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
382
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
383
+ denoisedBlobCid?: string | undefined;
384
+ updatedAt?: unknown;
385
+ }>>;
315
386
  /** User-authored text (bsky-semantic). May be empty for pure-audio posts. NEVER the transcript. */
316
387
  text: z.ZodString;
317
388
  /** Optional headline; a prompt feature, not the discriminator. */
@@ -319,20 +390,30 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
319
390
  /** Audio (or other) attachment. Audio posts carry an `AudioEmbed`. */
320
391
  embed: z.ZodOptional<z.ZodObject<{
321
392
  $type: z.ZodLiteral<"dev.antiphony.embed.audio">;
322
- /** The audio bytes as a content-addressed storage ref (CID/path). */
393
+ /** The audio bytes as a content-addressed blob ref (`ref.$link` = CID). */
323
394
  audio: z.ZodObject<{
324
395
  $type: z.ZodLiteral<"blob">;
325
- ref: z.ZodString;
396
+ ref: z.ZodObject<{
397
+ $link: z.ZodString;
398
+ }, "strip", z.ZodTypeAny, {
399
+ $link: string;
400
+ }, {
401
+ $link: string;
402
+ }>;
326
403
  mimeType: z.ZodString;
327
404
  size: z.ZodNumber;
328
405
  }, "strip", z.ZodTypeAny, {
329
406
  $type: "blob";
330
- ref: string;
407
+ ref: {
408
+ $link: string;
409
+ };
331
410
  mimeType: string;
332
411
  size: number;
333
412
  }, {
334
413
  $type: "blob";
335
- ref: string;
414
+ ref: {
415
+ $link: string;
416
+ };
336
417
  mimeType: string;
337
418
  size: number;
338
419
  }>;
@@ -346,7 +427,9 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
346
427
  $type: "dev.antiphony.embed.audio";
347
428
  audio: {
348
429
  $type: "blob";
349
- ref: string;
430
+ ref: {
431
+ $link: string;
432
+ };
350
433
  mimeType: string;
351
434
  size: number;
352
435
  };
@@ -357,7 +440,9 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
357
440
  $type: "dev.antiphony.embed.audio";
358
441
  audio: {
359
442
  $type: "blob";
360
- ref: string;
443
+ ref: {
444
+ $link: string;
445
+ };
361
446
  mimeType: string;
362
447
  size: number;
363
448
  };
@@ -413,18 +498,41 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
413
498
  selfLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
414
499
  createdAt: z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>;
415
500
  }, "strip", z.ZodTypeAny, {
501
+ cid: string;
416
502
  text: string;
417
503
  id: string;
418
- createdAt: Date;
419
504
  originAppId: string;
420
505
  authorId: string;
421
- kind: "reply" | "prompt";
506
+ kind: "prompt" | "reply";
507
+ createdAt: Date;
508
+ processing?: {
509
+ updatedAt: Date;
510
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
511
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
512
+ denoisedBlobCid?: string | undefined;
513
+ } | undefined;
514
+ authorDid?: string | undefined;
515
+ orgId?: string | null | undefined;
516
+ reply?: {
517
+ root: {
518
+ uri: string;
519
+ cid: string;
520
+ };
521
+ parent: {
522
+ uri: string;
523
+ cid: string;
524
+ };
525
+ } | undefined;
526
+ threadParticipants?: string[] | undefined;
527
+ rootAuthorId?: string | undefined;
422
528
  title?: string | undefined;
423
529
  embed?: {
424
530
  $type: "dev.antiphony.embed.audio";
425
531
  audio: {
426
532
  $type: "blob";
427
- ref: string;
533
+ ref: {
534
+ $link: string;
535
+ };
428
536
  mimeType: string;
429
537
  size: number;
430
538
  };
@@ -432,6 +540,23 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
432
540
  alt?: string | undefined;
433
541
  waveform?: number[] | undefined;
434
542
  } | undefined;
543
+ langs?: string[] | undefined;
544
+ selfLabels?: string[] | undefined;
545
+ }, {
546
+ cid: string;
547
+ text: string;
548
+ id: string;
549
+ originAppId: string;
550
+ authorId: string;
551
+ kind: "prompt" | "reply";
552
+ processing?: {
553
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
554
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
555
+ denoisedBlobCid?: string | undefined;
556
+ updatedAt?: unknown;
557
+ } | undefined;
558
+ authorDid?: string | undefined;
559
+ orgId?: string | null | undefined;
435
560
  reply?: {
436
561
  root: {
437
562
  uri: string;
@@ -442,23 +567,16 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
442
567
  cid: string;
443
568
  };
444
569
  } | undefined;
445
- langs?: string[] | undefined;
446
- selfLabels?: string[] | undefined;
447
- authorDid?: string | undefined;
448
- orgId?: string | null | undefined;
449
570
  threadParticipants?: string[] | undefined;
450
- }, {
451
- text: string;
452
- id: string;
453
- originAppId: string;
454
- authorId: string;
455
- kind: "reply" | "prompt";
571
+ rootAuthorId?: string | undefined;
456
572
  title?: string | undefined;
457
573
  embed?: {
458
574
  $type: "dev.antiphony.embed.audio";
459
575
  audio: {
460
576
  $type: "blob";
461
- ref: string;
577
+ ref: {
578
+ $link: string;
579
+ };
462
580
  mimeType: string;
463
581
  size: number;
464
582
  };
@@ -466,6 +584,25 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
466
584
  alt?: string | undefined;
467
585
  waveform?: number[] | undefined;
468
586
  } | undefined;
587
+ langs?: string[] | undefined;
588
+ selfLabels?: string[] | undefined;
589
+ createdAt?: unknown;
590
+ }>, {
591
+ cid: string;
592
+ text: string;
593
+ id: string;
594
+ originAppId: string;
595
+ authorId: string;
596
+ kind: "prompt" | "reply";
597
+ createdAt: Date;
598
+ processing?: {
599
+ updatedAt: Date;
600
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
601
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
602
+ denoisedBlobCid?: string | undefined;
603
+ } | undefined;
604
+ authorDid?: string | undefined;
605
+ orgId?: string | null | undefined;
469
606
  reply?: {
470
607
  root: {
471
608
  uri: string;
@@ -476,25 +613,16 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
476
613
  cid: string;
477
614
  };
478
615
  } | undefined;
479
- langs?: string[] | undefined;
480
- selfLabels?: string[] | undefined;
481
- createdAt?: unknown;
482
- authorDid?: string | undefined;
483
- orgId?: string | null | undefined;
484
616
  threadParticipants?: string[] | undefined;
485
- }>, {
486
- text: string;
487
- id: string;
488
- createdAt: Date;
489
- originAppId: string;
490
- authorId: string;
491
- kind: "reply" | "prompt";
617
+ rootAuthorId?: string | undefined;
492
618
  title?: string | undefined;
493
619
  embed?: {
494
620
  $type: "dev.antiphony.embed.audio";
495
621
  audio: {
496
622
  $type: "blob";
497
- ref: string;
623
+ ref: {
624
+ $link: string;
625
+ };
498
626
  mimeType: string;
499
627
  size: number;
500
628
  };
@@ -502,6 +630,23 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
502
630
  alt?: string | undefined;
503
631
  waveform?: number[] | undefined;
504
632
  } | undefined;
633
+ langs?: string[] | undefined;
634
+ selfLabels?: string[] | undefined;
635
+ }, {
636
+ cid: string;
637
+ text: string;
638
+ id: string;
639
+ originAppId: string;
640
+ authorId: string;
641
+ kind: "prompt" | "reply";
642
+ processing?: {
643
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
644
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
645
+ denoisedBlobCid?: string | undefined;
646
+ updatedAt?: unknown;
647
+ } | undefined;
648
+ authorDid?: string | undefined;
649
+ orgId?: string | null | undefined;
505
650
  reply?: {
506
651
  root: {
507
652
  uri: string;
@@ -512,23 +657,16 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
512
657
  cid: string;
513
658
  };
514
659
  } | undefined;
515
- langs?: string[] | undefined;
516
- selfLabels?: string[] | undefined;
517
- authorDid?: string | undefined;
518
- orgId?: string | null | undefined;
519
660
  threadParticipants?: string[] | undefined;
520
- }, {
521
- text: string;
522
- id: string;
523
- originAppId: string;
524
- authorId: string;
525
- kind: "reply" | "prompt";
661
+ rootAuthorId?: string | undefined;
526
662
  title?: string | undefined;
527
663
  embed?: {
528
664
  $type: "dev.antiphony.embed.audio";
529
665
  audio: {
530
666
  $type: "blob";
531
- ref: string;
667
+ ref: {
668
+ $link: string;
669
+ };
532
670
  mimeType: string;
533
671
  size: number;
534
672
  };
@@ -536,22 +674,9 @@ declare const AudioPostRecordSchema: z.ZodEffects<z.ZodObject<{
536
674
  alt?: string | undefined;
537
675
  waveform?: number[] | undefined;
538
676
  } | undefined;
539
- reply?: {
540
- root: {
541
- uri: string;
542
- cid: string;
543
- };
544
- parent: {
545
- uri: string;
546
- cid: string;
547
- };
548
- } | undefined;
549
677
  langs?: string[] | undefined;
550
678
  selfLabels?: string[] | undefined;
551
679
  createdAt?: unknown;
552
- authorDid?: string | undefined;
553
- orgId?: string | null | undefined;
554
- threadParticipants?: string[] | undefined;
555
680
  }>;
556
681
  type AudioPostRecord = z.infer<typeof AudioPostRecordSchema>;
557
682
  /**
@@ -578,35 +703,35 @@ declare const TranscriptEnrichmentRecordSchema: z.ZodObject<{
578
703
  endMs: z.ZodNumber;
579
704
  text: z.ZodString;
580
705
  }, "strip", z.ZodTypeAny, {
581
- text: string;
582
706
  startMs: number;
583
707
  endMs: number;
584
- }, {
585
708
  text: string;
709
+ }, {
586
710
  startMs: number;
587
711
  endMs: number;
588
- }>, {
589
712
  text: string;
713
+ }>, {
590
714
  startMs: number;
591
715
  endMs: number;
592
- }, {
593
716
  text: string;
717
+ }, {
594
718
  startMs: number;
595
719
  endMs: number;
720
+ text: string;
596
721
  }>, "many">;
597
722
  text: z.ZodOptional<z.ZodString>;
598
723
  }, "strip", z.ZodTypeAny, {
599
724
  segments: {
600
- text: string;
601
725
  startMs: number;
602
726
  endMs: number;
727
+ text: string;
603
728
  }[];
604
729
  text?: string | undefined;
605
730
  }, {
606
731
  segments: {
607
- text: string;
608
732
  startMs: number;
609
733
  endMs: number;
734
+ text: string;
610
735
  }[];
611
736
  text?: string | undefined;
612
737
  }>;
@@ -616,16 +741,16 @@ declare const TranscriptEnrichmentRecordSchema: z.ZodObject<{
616
741
  model: z.ZodOptional<z.ZodString>;
617
742
  createdAt: z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>;
618
743
  }, "strip", z.ZodTypeAny, {
619
- id: string;
620
- createdAt: Date;
621
744
  transcript: {
622
745
  segments: {
623
- text: string;
624
746
  startMs: number;
625
747
  endMs: number;
748
+ text: string;
626
749
  }[];
627
750
  text?: string | undefined;
628
751
  };
752
+ id: string;
753
+ createdAt: Date;
629
754
  subject: {
630
755
  uri: string;
631
756
  cid: string;
@@ -633,15 +758,15 @@ declare const TranscriptEnrichmentRecordSchema: z.ZodObject<{
633
758
  lang?: string | undefined;
634
759
  model?: string | undefined;
635
760
  }, {
636
- id: string;
637
761
  transcript: {
638
762
  segments: {
639
- text: string;
640
763
  startMs: number;
641
764
  endMs: number;
765
+ text: string;
642
766
  }[];
643
767
  text?: string | undefined;
644
768
  };
769
+ id: string;
645
770
  subject: {
646
771
  uri: string;
647
772
  cid: string;
@@ -652,7 +777,13 @@ declare const TranscriptEnrichmentRecordSchema: z.ZodObject<{
652
777
  }>;
653
778
  type TranscriptEnrichmentRecord = z.infer<typeof TranscriptEnrichmentRecordSchema>;
654
779
  /**
655
- * `dev.antiphony.actor.profile` — port of `com.voxpop.actor.profile`.
780
+ * `dev.antiphony.actor.profile` — portable actor-profile record shape.
781
+ *
782
+ * Lexicon-only: the core never stores, serves, or CRUDs this record — the
783
+ * caller BFF is the sole authority for profile data. The schema stays in
784
+ * `@antiphony/shared` so a federating/exporting deployment has a well-known
785
+ * shape to project a BFF-owned profile into (see specs/core-bff-boundary.md,
786
+ * "actor.profile lexicon", resolved 2026-07-03).
656
787
  */
657
788
  declare const ActorProfileRecordSchema: z.ZodObject<{
658
789
  handle: z.ZodOptional<z.ZodString>;
@@ -747,7 +878,6 @@ declare const PostRecordPublicSchema: z.ZodObject<{
747
878
  }, "strip", z.ZodTypeAny, {
748
879
  text: string;
749
880
  createdAt: Date;
750
- title?: string | undefined;
751
881
  reply?: {
752
882
  root: {
753
883
  uri: string;
@@ -758,11 +888,11 @@ declare const PostRecordPublicSchema: z.ZodObject<{
758
888
  cid: string;
759
889
  };
760
890
  } | undefined;
891
+ title?: string | undefined;
761
892
  langs?: string[] | undefined;
762
893
  selfLabels?: string[] | undefined;
763
894
  }, {
764
895
  text: string;
765
- title?: string | undefined;
766
896
  reply?: {
767
897
  root: {
768
898
  uri: string;
@@ -773,6 +903,7 @@ declare const PostRecordPublicSchema: z.ZodObject<{
773
903
  cid: string;
774
904
  };
775
905
  } | undefined;
906
+ title?: string | undefined;
776
907
  langs?: string[] | undefined;
777
908
  selfLabels?: string[] | undefined;
778
909
  createdAt?: unknown;
@@ -780,106 +911,27 @@ declare const PostRecordPublicSchema: z.ZodObject<{
780
911
  type PostRecordPublic = z.infer<typeof PostRecordPublicSchema>;
781
912
  /**
782
913
  * `AudioPostView` — the hydrated, client-facing shape (the bsky `postView`
783
- * analogue): record content + author + hydrated embed + per-viewer state.
784
- * Produced by the (batched) hydrator; the default/public view, with
785
- * owner-extra arriving via `viewer` + separate authed endpoints, not fat
786
- * records.
914
+ * analogue): record content + opaque author references + hydrated embed +
915
+ * per-viewer state. Produced by the (batched) hydrator; the default/public
916
+ * view, with owner-extra arriving via `viewer` + separate authed endpoints,
917
+ * not fat records.
918
+ *
919
+ * Author identity is carried as **opaque references**, never a hydrated
920
+ * profile: `authorId` is the app's own user id (attribution facet) and
921
+ * `authorDid` is present only when the caller asserted one. Antiphony holds no
922
+ * user data — the caller BFF hydrates display identity by joining on
923
+ * `authorId` (see specs/core-surface.md, "The author model").
787
924
  */
788
925
  declare const AudioPostViewSchema: z.ZodObject<{
789
926
  /** at:// URI (or internal ref) identifying the post. */
790
927
  uri: z.ZodString;
791
- cid: z.ZodOptional<z.ZodString>;
928
+ /** Content CID of the canonical record (see `AudioPostRecordSchema.cid`). */
929
+ cid: z.ZodString;
792
930
  kind: z.ZodEnum<["prompt", "reply"]>;
793
- author: z.ZodObject<{
794
- id: z.ZodString;
795
- handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
796
- displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
797
- avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
798
- bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
799
- website: z.ZodOptional<z.ZodNullable<z.ZodString>>;
800
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
801
- label: z.ZodString;
802
- url: z.ZodString;
803
- }, "strip", z.ZodTypeAny, {
804
- label: string;
805
- url: string;
806
- }, {
807
- label: string;
808
- url: string;
809
- }>, "many">>;
810
- bluesky: z.ZodOptional<z.ZodObject<{
811
- handle: z.ZodString;
812
- did: z.ZodString;
813
- }, "strip", z.ZodTypeAny, {
814
- handle: string;
815
- did: string;
816
- }, {
817
- handle: string;
818
- did: string;
819
- }>>;
820
- stats: z.ZodOptional<z.ZodObject<{
821
- followers: z.ZodDefault<z.ZodNumber>;
822
- following: z.ZodDefault<z.ZodNumber>;
823
- prompts: z.ZodDefault<z.ZodNumber>;
824
- }, "strip", z.ZodTypeAny, {
825
- followers: number;
826
- following: number;
827
- prompts: number;
828
- }, {
829
- followers?: number | undefined;
830
- following?: number | undefined;
831
- prompts?: number | undefined;
832
- }>>;
833
- badges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
834
- isVerified: z.ZodOptional<z.ZodBoolean>;
835
- createdAt: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>>;
836
- }, "strip", z.ZodTypeAny, {
837
- id: string;
838
- handle?: string | null | undefined;
839
- displayName?: string | null | undefined;
840
- bio?: string | null | undefined;
841
- avatarUrl?: string | null | undefined;
842
- website?: string | null | undefined;
843
- links?: {
844
- label: string;
845
- url: string;
846
- }[] | undefined;
847
- createdAt?: Date | undefined;
848
- bluesky?: {
849
- handle: string;
850
- did: string;
851
- } | undefined;
852
- stats?: {
853
- followers: number;
854
- following: number;
855
- prompts: number;
856
- } | undefined;
857
- badges?: string[] | undefined;
858
- isVerified?: boolean | undefined;
859
- }, {
860
- id: string;
861
- handle?: string | null | undefined;
862
- displayName?: string | null | undefined;
863
- bio?: string | null | undefined;
864
- avatarUrl?: string | null | undefined;
865
- website?: string | null | undefined;
866
- links?: {
867
- label: string;
868
- url: string;
869
- }[] | undefined;
870
- createdAt?: unknown;
871
- bluesky?: {
872
- handle: string;
873
- did: string;
874
- } | undefined;
875
- stats?: {
876
- followers?: number | undefined;
877
- following?: number | undefined;
878
- prompts?: number | undefined;
879
- } | undefined;
880
- badges?: string[] | undefined;
881
- isVerified?: boolean | undefined;
882
- }>;
931
+ /** The acting actor's app-scoped id — an opaque attribution ref, not a profile. */
932
+ authorId: z.ZodString;
933
+ /** The author's app-asserted AT Protocol DID, when the caller provided one. */
934
+ authorDid: z.ZodOptional<z.ZodString>;
883
935
  record: z.ZodObject<{
884
936
  text: z.ZodString;
885
937
  title: z.ZodOptional<z.ZodString>;
@@ -929,7 +981,6 @@ declare const AudioPostViewSchema: z.ZodObject<{
929
981
  }, "strip", z.ZodTypeAny, {
930
982
  text: string;
931
983
  createdAt: Date;
932
- title?: string | undefined;
933
984
  reply?: {
934
985
  root: {
935
986
  uri: string;
@@ -940,11 +991,11 @@ declare const AudioPostViewSchema: z.ZodObject<{
940
991
  cid: string;
941
992
  };
942
993
  } | undefined;
994
+ title?: string | undefined;
943
995
  langs?: string[] | undefined;
944
996
  selfLabels?: string[] | undefined;
945
997
  }, {
946
998
  text: string;
947
- title?: string | undefined;
948
999
  reply?: {
949
1000
  root: {
950
1001
  uri: string;
@@ -955,6 +1006,7 @@ declare const AudioPostViewSchema: z.ZodObject<{
955
1006
  cid: string;
956
1007
  };
957
1008
  } | undefined;
1009
+ title?: string | undefined;
958
1010
  langs?: string[] | undefined;
959
1011
  selfLabels?: string[] | undefined;
960
1012
  createdAt?: unknown;
@@ -973,38 +1025,55 @@ declare const AudioPostViewSchema: z.ZodObject<{
973
1025
  endMs: z.ZodNumber;
974
1026
  text: z.ZodString;
975
1027
  }, "strip", z.ZodTypeAny, {
976
- text: string;
977
1028
  startMs: number;
978
1029
  endMs: number;
979
- }, {
980
1030
  text: string;
1031
+ }, {
981
1032
  startMs: number;
982
1033
  endMs: number;
983
- }>, {
984
1034
  text: string;
1035
+ }>, {
985
1036
  startMs: number;
986
1037
  endMs: number;
987
- }, {
988
1038
  text: string;
1039
+ }, {
989
1040
  startMs: number;
990
1041
  endMs: number;
1042
+ text: string;
991
1043
  }>, "many">;
992
1044
  text: z.ZodOptional<z.ZodString>;
993
1045
  }, "strip", z.ZodTypeAny, {
994
1046
  segments: {
995
- text: string;
996
1047
  startMs: number;
997
1048
  endMs: number;
1049
+ text: string;
998
1050
  }[];
999
1051
  text?: string | undefined;
1000
1052
  }, {
1001
1053
  segments: {
1002
- text: string;
1003
1054
  startMs: number;
1004
1055
  endMs: number;
1056
+ text: string;
1005
1057
  }[];
1006
1058
  text?: string | undefined;
1007
1059
  }>>;
1060
+ /**
1061
+ * Per-stage audio-processing status (transcribe / denoise), when the app
1062
+ * opted into processing on create. Absent otherwise. A `pending` stage
1063
+ * means the client should poll (or re-render) for the result. When
1064
+ * `denoise === 'ready'`, `url` above already resolves to the cleaned
1065
+ * audio variant. See `types/processing.ts`.
1066
+ */
1067
+ processing: z.ZodOptional<z.ZodObject<{
1068
+ transcribe: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
1069
+ denoise: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
1070
+ }, "strip", z.ZodTypeAny, {
1071
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
1072
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
1073
+ }, {
1074
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
1075
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
1076
+ }>>;
1008
1077
  }, "strip", z.ZodTypeAny, {
1009
1078
  $type: "dev.antiphony.embed.audio#view";
1010
1079
  url: string;
@@ -1013,12 +1082,16 @@ declare const AudioPostViewSchema: z.ZodObject<{
1013
1082
  waveform?: number[] | undefined;
1014
1083
  transcript?: {
1015
1084
  segments: {
1016
- text: string;
1017
1085
  startMs: number;
1018
1086
  endMs: number;
1087
+ text: string;
1019
1088
  }[];
1020
1089
  text?: string | undefined;
1021
1090
  } | undefined;
1091
+ processing?: {
1092
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
1093
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
1094
+ } | undefined;
1022
1095
  }, {
1023
1096
  $type: "dev.antiphony.embed.audio#view";
1024
1097
  url: string;
@@ -1027,12 +1100,16 @@ declare const AudioPostViewSchema: z.ZodObject<{
1027
1100
  waveform?: number[] | undefined;
1028
1101
  transcript?: {
1029
1102
  segments: {
1030
- text: string;
1031
1103
  startMs: number;
1032
1104
  endMs: number;
1105
+ text: string;
1033
1106
  }[];
1034
1107
  text?: string | undefined;
1035
1108
  } | undefined;
1109
+ processing?: {
1110
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
1111
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
1112
+ } | undefined;
1036
1113
  }>>;
1037
1114
  viewer: z.ZodObject<{
1038
1115
  /** True when the authenticated caller authored this post. */
@@ -1056,35 +1133,12 @@ declare const AudioPostViewSchema: z.ZodObject<{
1056
1133
  }>;
1057
1134
  }, "strip", z.ZodTypeAny, {
1058
1135
  uri: string;
1059
- kind: "reply" | "prompt";
1060
- author: {
1061
- id: string;
1062
- handle?: string | null | undefined;
1063
- displayName?: string | null | undefined;
1064
- bio?: string | null | undefined;
1065
- avatarUrl?: string | null | undefined;
1066
- website?: string | null | undefined;
1067
- links?: {
1068
- label: string;
1069
- url: string;
1070
- }[] | undefined;
1071
- createdAt?: Date | undefined;
1072
- bluesky?: {
1073
- handle: string;
1074
- did: string;
1075
- } | undefined;
1076
- stats?: {
1077
- followers: number;
1078
- following: number;
1079
- prompts: number;
1080
- } | undefined;
1081
- badges?: string[] | undefined;
1082
- isVerified?: boolean | undefined;
1083
- };
1136
+ cid: string;
1137
+ authorId: string;
1138
+ kind: "prompt" | "reply";
1084
1139
  record: {
1085
1140
  text: string;
1086
1141
  createdAt: Date;
1087
- title?: string | undefined;
1088
1142
  reply?: {
1089
1143
  root: {
1090
1144
  uri: string;
@@ -1095,6 +1149,7 @@ declare const AudioPostViewSchema: z.ZodObject<{
1095
1149
  cid: string;
1096
1150
  };
1097
1151
  } | undefined;
1152
+ title?: string | undefined;
1098
1153
  langs?: string[] | undefined;
1099
1154
  selfLabels?: string[] | undefined;
1100
1155
  };
@@ -1103,6 +1158,7 @@ declare const AudioPostViewSchema: z.ZodObject<{
1103
1158
  canReply: boolean;
1104
1159
  replyDisabledReason?: "unauthenticated" | "not_a_participant" | undefined;
1105
1160
  };
1161
+ authorDid?: string | undefined;
1106
1162
  embed?: {
1107
1163
  $type: "dev.antiphony.embed.audio#view";
1108
1164
  url: string;
@@ -1111,44 +1167,24 @@ declare const AudioPostViewSchema: z.ZodObject<{
1111
1167
  waveform?: number[] | undefined;
1112
1168
  transcript?: {
1113
1169
  segments: {
1114
- text: string;
1115
1170
  startMs: number;
1116
1171
  endMs: number;
1172
+ text: string;
1117
1173
  }[];
1118
1174
  text?: string | undefined;
1119
1175
  } | undefined;
1176
+ processing?: {
1177
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
1178
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
1179
+ } | undefined;
1120
1180
  } | undefined;
1121
- cid?: string | undefined;
1122
1181
  }, {
1123
1182
  uri: string;
1124
- kind: "reply" | "prompt";
1125
- author: {
1126
- id: string;
1127
- handle?: string | null | undefined;
1128
- displayName?: string | null | undefined;
1129
- bio?: string | null | undefined;
1130
- avatarUrl?: string | null | undefined;
1131
- website?: string | null | undefined;
1132
- links?: {
1133
- label: string;
1134
- url: string;
1135
- }[] | undefined;
1136
- createdAt?: unknown;
1137
- bluesky?: {
1138
- handle: string;
1139
- did: string;
1140
- } | undefined;
1141
- stats?: {
1142
- followers?: number | undefined;
1143
- following?: number | undefined;
1144
- prompts?: number | undefined;
1145
- } | undefined;
1146
- badges?: string[] | undefined;
1147
- isVerified?: boolean | undefined;
1148
- };
1183
+ cid: string;
1184
+ authorId: string;
1185
+ kind: "prompt" | "reply";
1149
1186
  record: {
1150
1187
  text: string;
1151
- title?: string | undefined;
1152
1188
  reply?: {
1153
1189
  root: {
1154
1190
  uri: string;
@@ -1159,6 +1195,7 @@ declare const AudioPostViewSchema: z.ZodObject<{
1159
1195
  cid: string;
1160
1196
  };
1161
1197
  } | undefined;
1198
+ title?: string | undefined;
1162
1199
  langs?: string[] | undefined;
1163
1200
  selfLabels?: string[] | undefined;
1164
1201
  createdAt?: unknown;
@@ -1168,6 +1205,7 @@ declare const AudioPostViewSchema: z.ZodObject<{
1168
1205
  canReply?: boolean | undefined;
1169
1206
  replyDisabledReason?: "unauthenticated" | "not_a_participant" | undefined;
1170
1207
  };
1208
+ authorDid?: string | undefined;
1171
1209
  embed?: {
1172
1210
  $type: "dev.antiphony.embed.audio#view";
1173
1211
  url: string;
@@ -1176,14 +1214,17 @@ declare const AudioPostViewSchema: z.ZodObject<{
1176
1214
  waveform?: number[] | undefined;
1177
1215
  transcript?: {
1178
1216
  segments: {
1179
- text: string;
1180
1217
  startMs: number;
1181
1218
  endMs: number;
1219
+ text: string;
1182
1220
  }[];
1183
1221
  text?: string | undefined;
1184
1222
  } | undefined;
1223
+ processing?: {
1224
+ transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
1225
+ denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
1226
+ } | undefined;
1185
1227
  } | undefined;
1186
- cid?: string | undefined;
1187
1228
  }>;
1188
1229
  type AudioPostView = z.infer<typeof AudioPostViewSchema>;
1189
1230