@antiphony/shared 0.1.0 → 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.
Files changed (54) hide show
  1. package/dist/cjs/api-codecs.cjs +26 -650
  2. package/dist/cjs/api-codecs.d.cts +15 -233
  3. package/dist/cjs/index.cjs +29 -761
  4. package/dist/cjs/index.d.cts +4 -4
  5. package/dist/cjs/nsid.cjs +3 -10
  6. package/dist/cjs/nsid.d.cts +1 -9
  7. package/dist/cjs/types/api.cjs +11 -571
  8. package/dist/cjs/types/api.d.cts +13 -265
  9. package/dist/cjs/types/audio.cjs +26 -547
  10. package/dist/cjs/types/audio.d.cts +93 -52
  11. package/dist/cjs/types/records.cjs +3 -328
  12. package/dist/cjs/types/records.d.cts +7 -729
  13. package/dist/cjs/types/views.cjs +8 -649
  14. package/dist/cjs/types/views.d.cts +43 -9123
  15. package/dist/esm/api-codecs.d.ts +46 -264
  16. package/dist/esm/api-codecs.js +5 -5
  17. package/dist/esm/{chunk-ORMEWXMH.js → chunk-5JBD5THX.js} +1 -16
  18. package/dist/esm/{chunk-XDBKR6LW.js → chunk-6LROFBKK.js} +3 -10
  19. package/dist/esm/{chunk-F2CANZZ7.js → chunk-BNNLHRH7.js} +1 -1
  20. package/dist/esm/{chunk-BUNMR4ZO.js → chunk-F7IHVM34.js} +20 -3
  21. package/dist/esm/chunk-FDM5FDN4.js +46 -0
  22. package/dist/esm/chunk-IHIBHQBJ.js +78 -0
  23. package/dist/esm/chunk-R6SBR3IG.js +97 -0
  24. package/dist/esm/chunk-Y6HNNRVD.js +12 -0
  25. package/dist/esm/errors/index.js +1 -1
  26. package/dist/esm/index.d.ts +4 -4
  27. package/dist/esm/index.js +8 -8
  28. package/dist/esm/nsid.d.ts +1 -9
  29. package/dist/esm/nsid.js +2 -2
  30. package/dist/esm/observability/index.js +2 -2
  31. package/dist/esm/observability/report-error.js +2 -2
  32. package/dist/esm/types/api.d.ts +15 -267
  33. package/dist/esm/types/api.js +4 -5
  34. package/dist/esm/types/audio.d.ts +170 -129
  35. package/dist/esm/types/audio.js +4 -4
  36. package/dist/esm/types/blob.js +1 -1
  37. package/dist/esm/types/records.d.ts +10 -732
  38. package/dist/esm/types/records.js +2 -3
  39. package/dist/esm/types/views.d.ts +51 -9131
  40. package/dist/esm/types/views.js +3 -4
  41. package/dist/esm/utils/index.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/cjs/types/channels.cjs +0 -170
  44. package/dist/cjs/types/channels.d.cts +0 -262
  45. package/dist/cjs/types/storage.cjs +0 -414
  46. package/dist/cjs/types/storage.d.cts +0 -197
  47. package/dist/esm/chunk-3WZJXJNU.js +0 -378
  48. package/dist/esm/chunk-7V44CPRR.js +0 -132
  49. package/dist/esm/chunk-EA4OONDV.js +0 -380
  50. package/dist/esm/chunk-TIZRJORN.js +0 -24
  51. package/dist/esm/types/channels.d.ts +0 -262
  52. package/dist/esm/types/channels.js +0 -162
  53. package/dist/esm/types/storage.d.ts +0 -197
  54. package/dist/esm/types/storage.js +0 -26
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * Create-request codec for the new Antiphony `dev.antiphony.audio.post` model
5
- * (Stream 1, additive does not replace `CreatePromptRequestSchema`). The
6
- * audio is uploaded first (signed-URL flow); the request references it as the
7
- * embed. `reply` presence makes the new post a reply; absence makes it a
8
- * prompt. `originAppId`/`authorId`/`kind` are stamped server-side, not sent.
4
+ * Create-request codec for the canonical Antiphony `dev.antiphony.audio.post`
5
+ * model. The audio is uploaded first (signed-URL flow); the request references
6
+ * it as the embed. `reply` presence makes the new post a reply; absence makes
7
+ * it a prompt. `originAppId`/`authorId`/`kind` are stamped server-side, not sent.
9
8
  */
10
9
  declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
11
10
  /** User-authored text; may be empty for pure-audio posts. */
@@ -105,16 +104,6 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
105
104
  }, "strip", z.ZodTypeAny, {
106
105
  text: string;
107
106
  title?: string | undefined;
108
- reply?: {
109
- root: {
110
- uri: string;
111
- cid: string;
112
- };
113
- parent: {
114
- uri: string;
115
- cid: string;
116
- };
117
- } | undefined;
118
107
  embed?: {
119
108
  $type: "dev.antiphony.embed.audio";
120
109
  audio: {
@@ -127,11 +116,6 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
127
116
  alt?: string | undefined;
128
117
  waveform?: number[] | undefined;
129
118
  } | undefined;
130
- langs?: string[] | undefined;
131
- selfLabels?: string[] | undefined;
132
- }, {
133
- title?: string | undefined;
134
- text?: string | undefined;
135
119
  reply?: {
136
120
  root: {
137
121
  uri: string;
@@ -142,6 +126,11 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
142
126
  cid: string;
143
127
  };
144
128
  } | undefined;
129
+ langs?: string[] | undefined;
130
+ selfLabels?: string[] | undefined;
131
+ }, {
132
+ text?: string | undefined;
133
+ title?: string | undefined;
145
134
  embed?: {
146
135
  $type: "dev.antiphony.embed.audio";
147
136
  audio: {
@@ -154,11 +143,6 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
154
143
  alt?: string | undefined;
155
144
  waveform?: number[] | undefined;
156
145
  } | undefined;
157
- langs?: string[] | undefined;
158
- selfLabels?: string[] | undefined;
159
- }>, {
160
- text: string;
161
- title?: string | undefined;
162
146
  reply?: {
163
147
  root: {
164
148
  uri: string;
@@ -169,6 +153,11 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
169
153
  cid: string;
170
154
  };
171
155
  } | undefined;
156
+ langs?: string[] | undefined;
157
+ selfLabels?: string[] | undefined;
158
+ }>, {
159
+ text: string;
160
+ title?: string | undefined;
172
161
  embed?: {
173
162
  $type: "dev.antiphony.embed.audio";
174
163
  audio: {
@@ -181,11 +170,6 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
181
170
  alt?: string | undefined;
182
171
  waveform?: number[] | undefined;
183
172
  } | undefined;
184
- langs?: string[] | undefined;
185
- selfLabels?: string[] | undefined;
186
- }, {
187
- title?: string | undefined;
188
- text?: string | undefined;
189
173
  reply?: {
190
174
  root: {
191
175
  uri: string;
@@ -196,6 +180,11 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
196
180
  cid: string;
197
181
  };
198
182
  } | undefined;
183
+ langs?: string[] | undefined;
184
+ selfLabels?: string[] | undefined;
185
+ }, {
186
+ text?: string | undefined;
187
+ title?: string | undefined;
199
188
  embed?: {
200
189
  $type: "dev.antiphony.embed.audio";
201
190
  audio: {
@@ -208,11 +197,6 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
208
197
  alt?: string | undefined;
209
198
  waveform?: number[] | undefined;
210
199
  } | undefined;
211
- langs?: string[] | undefined;
212
- selfLabels?: string[] | undefined;
213
- }>, {
214
- text: string;
215
- title?: string | undefined;
216
200
  reply?: {
217
201
  root: {
218
202
  uri: string;
@@ -223,6 +207,11 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
223
207
  cid: string;
224
208
  };
225
209
  } | undefined;
210
+ langs?: string[] | undefined;
211
+ selfLabels?: string[] | undefined;
212
+ }>, {
213
+ text: string;
214
+ title?: string | undefined;
226
215
  embed?: {
227
216
  $type: "dev.antiphony.embed.audio";
228
217
  audio: {
@@ -235,11 +224,6 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
235
224
  alt?: string | undefined;
236
225
  waveform?: number[] | undefined;
237
226
  } | undefined;
238
- langs?: string[] | undefined;
239
- selfLabels?: string[] | undefined;
240
- }, {
241
- title?: string | undefined;
242
- text?: string | undefined;
243
227
  reply?: {
244
228
  root: {
245
229
  uri: string;
@@ -250,6 +234,11 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
250
234
  cid: string;
251
235
  };
252
236
  } | undefined;
237
+ langs?: string[] | undefined;
238
+ selfLabels?: string[] | undefined;
239
+ }, {
240
+ text?: string | undefined;
241
+ title?: string | undefined;
253
242
  embed?: {
254
243
  $type: "dev.antiphony.embed.audio";
255
244
  audio: {
@@ -262,30 +251,24 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
262
251
  alt?: string | undefined;
263
252
  waveform?: number[] | undefined;
264
253
  } | undefined;
254
+ reply?: {
255
+ root: {
256
+ uri: string;
257
+ cid: string;
258
+ };
259
+ parent: {
260
+ uri: string;
261
+ cid: string;
262
+ };
263
+ } | undefined;
265
264
  langs?: string[] | undefined;
266
265
  selfLabels?: string[] | undefined;
267
266
  }>;
268
267
  type CreateAudioPostRequest = z.infer<typeof CreateAudioPostRequestSchema>;
269
- declare const CreatePromptRequestSchema: z.ZodObject<{
270
- title: z.ZodString;
271
- description: z.ZodOptional<z.ZodString>;
272
- audioUrl: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
273
- setAsGreeting: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean, string>]>>;
274
- /** Explicit org context override (normally inferred from auth.currentOrg) */
275
- orgId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
276
- }, "strip", z.ZodTypeAny, {
277
- title: string;
278
- audioUrl: string;
279
- orgId?: string | null | undefined;
280
- description?: string | undefined;
281
- setAsGreeting?: boolean | undefined;
282
- }, {
283
- title: string;
284
- audioUrl: string;
285
- orgId?: string | null | undefined;
286
- description?: string | undefined;
287
- setAsGreeting?: string | boolean | undefined;
288
- }>;
268
+ /**
269
+ * Update-request codec for the authenticated actor's own profile
270
+ * (`PATCH /api/v1/users/me`). Partial-update of identity fields only.
271
+ */
289
272
  declare const UpdateProfileRequestSchema: z.ZodObject<{
290
273
  handle: z.ZodOptional<z.ZodString>;
291
274
  displayName: z.ZodOptional<z.ZodString>;
@@ -314,10 +297,10 @@ declare const UpdateProfileRequestSchema: z.ZodObject<{
314
297
  showBlueskyPublicly: z.ZodOptional<z.ZodBoolean>;
315
298
  }, "strip", z.ZodTypeAny, {
316
299
  handle?: string | undefined;
317
- usageIntent?: string | null | undefined;
318
300
  displayName?: string | undefined;
319
301
  bio?: string | undefined;
320
302
  avatarUrl?: string | null | undefined;
303
+ usageIntent?: string | null | undefined;
321
304
  website?: string | null | undefined;
322
305
  links?: {
323
306
  label: string;
@@ -326,10 +309,10 @@ declare const UpdateProfileRequestSchema: z.ZodObject<{
326
309
  showBlueskyPublicly?: boolean | undefined;
327
310
  }, {
328
311
  handle?: string | undefined;
329
- usageIntent?: string | null | undefined;
330
312
  displayName?: string | undefined;
331
313
  bio?: string | undefined;
332
314
  avatarUrl?: string | null | undefined;
315
+ usageIntent?: string | null | undefined;
333
316
  website?: string | null | undefined;
334
317
  links?: {
335
318
  label: string;
@@ -337,206 +320,5 @@ declare const UpdateProfileRequestSchema: z.ZodObject<{
337
320
  }[] | undefined;
338
321
  showBlueskyPublicly?: boolean | undefined;
339
322
  }>;
340
- declare const FcmTokenRequestSchema: z.ZodObject<{
341
- token: z.ZodString;
342
- }, "strip", z.ZodTypeAny, {
343
- token: string;
344
- }, {
345
- token: string;
346
- }>;
347
- declare const BadgeResetRequestSchema: z.ZodObject<{
348
- type: z.ZodEnum<["new_replier", "unread_reply"]>;
349
- }, "strip", z.ZodTypeAny, {
350
- type: "new_replier" | "unread_reply";
351
- }, {
352
- type: "new_replier" | "unread_reply";
353
- }>;
354
- declare const CreateOrgRequestSchema: z.ZodObject<{
355
- name: z.ZodString;
356
- slug: z.ZodString;
357
- avatarUrl: z.ZodOptional<z.ZodString>;
358
- rssFeedUrl: z.ZodOptional<z.ZodString>;
359
- websiteUrl: z.ZodOptional<z.ZodString>;
360
- description: z.ZodOptional<z.ZodString>;
361
- }, "strip", z.ZodTypeAny, {
362
- name: string;
363
- slug: string;
364
- avatarUrl?: string | undefined;
365
- description?: string | undefined;
366
- rssFeedUrl?: string | undefined;
367
- websiteUrl?: string | undefined;
368
- }, {
369
- name: string;
370
- slug: string;
371
- avatarUrl?: string | undefined;
372
- description?: string | undefined;
373
- rssFeedUrl?: string | undefined;
374
- websiteUrl?: string | undefined;
375
- }>;
376
- declare const UpdateOrgRequestSchema: z.ZodObject<{
377
- name: z.ZodOptional<z.ZodString>;
378
- slug: z.ZodOptional<z.ZodString>;
379
- description: z.ZodOptional<z.ZodString>;
380
- avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
381
- rssFeedUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
- websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
383
- billingEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
384
- domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
385
- }, "strip", z.ZodTypeAny, {
386
- domain?: string | null | undefined;
387
- avatarUrl?: string | null | undefined;
388
- description?: string | undefined;
389
- name?: string | undefined;
390
- slug?: string | undefined;
391
- rssFeedUrl?: string | null | undefined;
392
- websiteUrl?: string | null | undefined;
393
- billingEmail?: string | null | undefined;
394
- }, {
395
- domain?: string | null | undefined;
396
- avatarUrl?: string | null | undefined;
397
- description?: string | undefined;
398
- name?: string | undefined;
399
- slug?: string | undefined;
400
- rssFeedUrl?: string | null | undefined;
401
- websiteUrl?: string | null | undefined;
402
- billingEmail?: string | null | undefined;
403
- }>;
404
- declare const CreateOrgInviteRequestSchema: z.ZodObject<{
405
- email: z.ZodString;
406
- role: z.ZodEnum<["admin", "member"]>;
407
- }, "strip", z.ZodTypeAny, {
408
- role: "admin" | "member";
409
- email: string;
410
- }, {
411
- role: "admin" | "member";
412
- email: string;
413
- }>;
414
- declare const UpdateMemberRoleRequestSchema: z.ZodObject<{
415
- role: z.ZodEnum<["admin", "member"]>;
416
- }, "strip", z.ZodTypeAny, {
417
- role: "admin" | "member";
418
- }, {
419
- role: "admin" | "member";
420
- }>;
421
- declare const SwitchOrgRequestSchema: z.ZodObject<{
422
- /** orgId to switch to, or null to switch to personal context */
423
- orgId: z.ZodNullable<z.ZodString>;
424
- }, "strip", z.ZodTypeAny, {
425
- orgId: string | null;
426
- }, {
427
- orgId: string | null;
428
- }>;
429
- declare const ConnectorConfigInputSchema: z.ZodObject<Omit<{
430
- connectorType: z.ZodEnum<["telephony"]>;
431
- ownerId: z.ZodString;
432
- settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
433
- secretRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
434
- enabled: z.ZodDefault<z.ZodBoolean>;
435
- status: z.ZodDefault<z.ZodObject<{
436
- state: z.ZodDefault<z.ZodEnum<["unconfigured", "pending", "active", "error", "disabled"]>>;
437
- detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
438
- data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
439
- updatedAt: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>>;
440
- }, "strip", z.ZodTypeAny, {
441
- state: "active" | "pending" | "error" | "unconfigured" | "disabled";
442
- updatedAt?: Date | undefined;
443
- detail?: string | null | undefined;
444
- data?: Record<string, unknown> | null | undefined;
445
- }, {
446
- updatedAt?: unknown;
447
- state?: "active" | "pending" | "error" | "unconfigured" | "disabled" | undefined;
448
- detail?: string | null | undefined;
449
- data?: Record<string, unknown> | null | undefined;
450
- }>>;
451
- createdAt: z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>;
452
- updatedAt: z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>;
453
- }, "status" | "createdAt" | "updatedAt" | "connectorType" | "ownerId">, "strip", z.ZodTypeAny, {
454
- enabled: boolean;
455
- settings: Record<string, unknown>;
456
- secretRef?: string | null | undefined;
457
- }, {
458
- enabled?: boolean | undefined;
459
- settings?: Record<string, unknown> | undefined;
460
- secretRef?: string | null | undefined;
461
- }>;
462
- declare const ConnectorConfigUpdateSchema: z.ZodObject<{
463
- enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
464
- settings: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
465
- secretRef: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
466
- }, "strip", z.ZodTypeAny, {
467
- enabled?: boolean | undefined;
468
- settings?: Record<string, unknown> | undefined;
469
- secretRef?: string | null | undefined;
470
- }, {
471
- enabled?: boolean | undefined;
472
- settings?: Record<string, unknown> | undefined;
473
- secretRef?: string | null | undefined;
474
- }>;
475
- declare const PersonNotesUpdateSchema: z.ZodObject<{
476
- notes: z.ZodOptional<z.ZodString>;
477
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
478
- }, "strip", z.ZodTypeAny, {
479
- notes?: string | undefined;
480
- tags?: string[] | undefined;
481
- }, {
482
- notes?: string | undefined;
483
- tags?: string[] | undefined;
484
- }>;
485
- declare const PersonMergeRequestSchema: z.ZodObject<{
486
- alternateUid: z.ZodString;
487
- }, "strip", z.ZodTypeAny, {
488
- alternateUid: string;
489
- }, {
490
- alternateUid: string;
491
- }>;
492
- declare const ScreeningRuleInputSchema: z.ZodObject<{
493
- e164: z.ZodString;
494
- label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
495
- action: z.ZodEnum<["allow", "screen"]>;
496
- expiresAt: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>, string | number | null | undefined, string | number | null | undefined>;
497
- }, "strip", z.ZodTypeAny, {
498
- e164: string;
499
- action: "allow" | "screen";
500
- label?: string | null | undefined;
501
- expiresAt?: string | number | null | undefined;
502
- }, {
503
- e164: string;
504
- action: "allow" | "screen";
505
- label?: string | null | undefined;
506
- expiresAt?: string | number | null | undefined;
507
- }>;
508
- declare const ScreeningRuleUpdateSchema: z.ZodObject<{
509
- e164: z.ZodOptional<z.ZodString>;
510
- label: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
511
- action: z.ZodOptional<z.ZodEnum<["allow", "screen"]>>;
512
- expiresAt: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>, string | number | null | undefined, string | number | null | undefined>>;
513
- }, "strip", z.ZodTypeAny, {
514
- label?: string | null | undefined;
515
- e164?: string | undefined;
516
- action?: "allow" | "screen" | undefined;
517
- expiresAt?: string | number | null | undefined;
518
- }, {
519
- label?: string | null | undefined;
520
- e164?: string | undefined;
521
- action?: "allow" | "screen" | undefined;
522
- expiresAt?: string | number | null | undefined;
523
- }>;
524
- declare const UpdateReplyStatusRequestSchema: z.ZodObject<{
525
- status: z.ZodEnum<["live", "archived", "deleted"]>;
526
- }, "strip", z.ZodTypeAny, {
527
- status: "live" | "archived" | "deleted";
528
- }, {
529
- status: "live" | "archived" | "deleted";
530
- }>;
531
- declare const BulkReplyActionRequestSchema: z.ZodObject<{
532
- replyIds: z.ZodArray<z.ZodString, "many">;
533
- action: z.ZodEnum<["markRead", "archive", "delete", "restore"]>;
534
- }, "strip", z.ZodTypeAny, {
535
- action: "markRead" | "archive" | "delete" | "restore";
536
- replyIds: string[];
537
- }, {
538
- action: "markRead" | "archive" | "delete" | "restore";
539
- replyIds: string[];
540
- }>;
541
323
 
542
- export { BadgeResetRequestSchema, BulkReplyActionRequestSchema, ConnectorConfigInputSchema, ConnectorConfigUpdateSchema, type CreateAudioPostRequest, CreateAudioPostRequestSchema, CreateOrgInviteRequestSchema, CreateOrgRequestSchema, CreatePromptRequestSchema, FcmTokenRequestSchema, PersonMergeRequestSchema, PersonNotesUpdateSchema, ScreeningRuleInputSchema, ScreeningRuleUpdateSchema, SwitchOrgRequestSchema, UpdateMemberRoleRequestSchema, UpdateOrgRequestSchema, UpdateProfileRequestSchema, UpdateReplyStatusRequestSchema };
324
+ export { type CreateAudioPostRequest, CreateAudioPostRequestSchema, UpdateProfileRequestSchema };
@@ -1,6 +1,6 @@
1
- export { BadgeResetRequestSchema, BulkReplyActionRequestSchema, ConnectorConfigInputSchema, ConnectorConfigUpdateSchema, CreateAudioPostRequestSchema, CreateOrgInviteRequestSchema, CreateOrgRequestSchema, CreatePromptRequestSchema, FcmTokenRequestSchema, PersonMergeRequestSchema, PersonNotesUpdateSchema, ScreeningRuleInputSchema, ScreeningRuleUpdateSchema, SwitchOrgRequestSchema, UpdateMemberRoleRequestSchema, UpdateOrgRequestSchema, UpdateProfileRequestSchema, UpdateReplyStatusRequestSchema } from './chunk-7V44CPRR.js';
2
- import './chunk-BUNMR4ZO.js';
3
- import './chunk-EA4OONDV.js';
4
- import './chunk-3WZJXJNU.js';
1
+ export { CreateAudioPostRequestSchema, UpdateProfileRequestSchema } from './chunk-FDM5FDN4.js';
2
+ import './chunk-F7IHVM34.js';
5
3
  import './chunk-5EHV73BA.js';
6
- import './chunk-ORMEWXMH.js';
4
+ import './chunk-R6SBR3IG.js';
5
+ import './chunk-IHIBHQBJ.js';
6
+ import './chunk-5JBD5THX.js';
@@ -1,6 +1,4 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -16,18 +14,5 @@ var __spreadValues = (a, b) => {
16
14
  }
17
15
  return a;
18
16
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
17
 
33
- export { __objRest, __spreadProps, __spreadValues };
18
+ export { __spreadValues };
@@ -1,11 +1,7 @@
1
1
  // nsid.ts
2
2
  var NSID = {
3
- // Legacy Vox Pop record types (deprecated; removed in Stream 4).
4
- Prompt: "com.voxpop.audio.prompt",
5
- Reply: "com.voxpop.audio.reply",
6
- Profile: "com.voxpop.actor.profile",
7
- // Antiphony canonical record types (dev.antiphony.*). Added additively in
8
- // Stream 1; see lexicons/dev/antiphony/ + packages/shared/types/audio.ts.
3
+ // Antiphony canonical record types (dev.antiphony.*).
4
+ // See lexicons/dev/antiphony/ + packages/shared/types/audio.ts.
9
5
  AudioPost: "dev.antiphony.audio.post",
10
6
  AudioTranscript: "dev.antiphony.audio.transcript",
11
7
  ActorProfile: "dev.antiphony.actor.profile"
@@ -15,10 +11,7 @@ var EMBED_NSID = {
15
11
  RecordWithAudio: "dev.antiphony.embed.recordWithAudio"
16
12
  };
17
13
  var COLLECTIONS = {
18
- [NSID.Prompt]: "prompts",
19
- [NSID.Reply]: "replies",
20
- [NSID.Profile]: "users",
21
- // Antiphony: one post collection + the transcript enrichment namespace.
14
+ // One post collection + the transcript enrichment namespace + actors.
22
15
  [NSID.AudioPost]: "posts",
23
16
  [NSID.AudioTranscript]: "audio_transcripts",
24
17
  [NSID.ActorProfile]: "users"
@@ -1,4 +1,4 @@
1
- import { __spreadValues } from './chunk-ORMEWXMH.js';
1
+ import { __spreadValues } from './chunk-5JBD5THX.js';
2
2
 
3
3
  // observability/report-error.ts
4
4
  var REPORTED_ERROR_EVENT_TYPE = "type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent";
@@ -1,6 +1,6 @@
1
- import { ProfileViewBasicSchema } from './chunk-EA4OONDV.js';
2
- import { FirestoreTimestampSchema } from './chunk-3WZJXJNU.js';
3
1
  import { BlobRefSchema } from './chunk-5EHV73BA.js';
2
+ import { ProfileViewBasicSchema } from './chunk-R6SBR3IG.js';
3
+ import { FirestoreTimestampSchema } from './chunk-IHIBHQBJ.js';
4
4
  import { z } from 'zod';
5
5
 
6
6
  var StrongRefSchema = z.object({
@@ -59,6 +59,15 @@ var AudioPostRecordSchema = z.object({
59
59
  orgId: z.string().nullable().optional(),
60
60
  /** Denormalized from `reply` presence: `reply` set ⇒ 'reply', else 'prompt'. */
61
61
  kind: z.enum(["prompt", "reply"]),
62
+ /**
63
+ * Branch participant pair (author ids) for reply gating — the parties to a
64
+ * reply's sub-thread: the creator (thread-root author) + the responder who
65
+ * opened the branch. Set on replies (deduped, 1–2 ids); absent on prompts
66
+ * (a prompt's repliers are the app's audience policy, not a fixed pair).
67
+ * Inherited down the branch so reply gating is an O(1) field check, never a
68
+ * thread walk. See `specs/antiphony-data-model.md` §6 "Reply gating".
69
+ */
70
+ threadParticipants: z.array(z.string()).optional(),
62
71
  // --- Lexicon fields (public contract) ---
63
72
  /** User-authored text (bsky-semantic). May be empty for pure-audio posts. NEVER the transcript. */
64
73
  text: z.string().max(3e3),
@@ -102,7 +111,15 @@ var ActorProfileRecordSchema = z.object({
102
111
  });
103
112
  var ViewerStateSchema = z.object({
104
113
  /** True when the authenticated caller authored this post. */
105
- isAuthor: z.boolean().default(false)
114
+ isAuthor: z.boolean().default(false),
115
+ /**
116
+ * Whether the caller may reply to this post (reply gating, §6). A prompt is
117
+ * repliable by any authenticated viewer (the app's audience-policy default);
118
+ * a reply only by its branch participants (`{ creator, branch responder }`).
119
+ */
120
+ canReply: z.boolean().default(false),
121
+ /** Why `canReply` is false, when it is (omitted when the caller can reply). */
122
+ replyDisabledReason: z.enum(["unauthenticated", "not_a_participant"]).optional()
106
123
  });
107
124
  var PostRecordPublicSchema = z.object({
108
125
  text: z.string(),
@@ -0,0 +1,46 @@
1
+ import { ReplyRefSchema, AudioEmbedSchema } from './chunk-F7IHVM34.js';
2
+ import { z } from 'zod';
3
+
4
+ var CreateAudioPostRequestSchema = z.object({
5
+ /** User-authored text; may be empty for pure-audio posts. */
6
+ text: z.string().max(3e3).default(""),
7
+ /** Optional headline (prompt feature). */
8
+ title: z.string().max(3e3).optional(),
9
+ /** The uploaded audio attachment. */
10
+ embed: AudioEmbedSchema.optional(),
11
+ /** Present ⇒ this is a reply (StrongRef root + parent). */
12
+ reply: ReplyRefSchema.optional(),
13
+ /** BCP-47 language tags. */
14
+ langs: z.array(z.string()).max(3).optional(),
15
+ /** Author self-label values (content warnings). */
16
+ selfLabels: z.array(z.string()).optional()
17
+ }).refine((d) => !(d.reply && d.title), {
18
+ message: "Replies cannot have a title",
19
+ path: ["title"]
20
+ }).refine((d) => d.text.trim().length > 0 || !!d.embed, {
21
+ message: "Post must have text or an audio embed",
22
+ path: ["text"]
23
+ });
24
+ var UpdateProfileRequestSchema = z.object({
25
+ handle: z.string().min(3).max(20).regex(/^[a-zA-Z0-9_]+$/).optional(),
26
+ displayName: z.string().max(50).optional(),
27
+ bio: z.string().max(160).optional(),
28
+ avatarUrl: z.string().url().nullable().optional(),
29
+ usageIntent: z.string().max(200).nullable().optional(),
30
+ /**
31
+ * Personal website surfaced on the public profile. Accepts a URL, empty
32
+ * string, or null from the client; normalizes empty string → null so the
33
+ * value stored on `UserRecord` (which requires `.url() | null`) round-trips
34
+ * cleanly through `UserRecordSchema.parse` on subsequent reads.
35
+ */
36
+ website: z.union([z.string().url(), z.literal(""), z.null()]).optional().transform((v) => v === "" ? null : v),
37
+ /** Up to 5 public links (label + URL) shown under the bio. */
38
+ links: z.array(z.object({
39
+ label: z.string().min(1).max(40),
40
+ url: z.string().url()
41
+ })).max(5).optional(),
42
+ /** When true, surfaces the linked Bluesky identity on the public profile. */
43
+ showBlueskyPublicly: z.boolean().optional()
44
+ });
45
+
46
+ export { CreateAudioPostRequestSchema, UpdateProfileRequestSchema };
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+
3
+ // types/records.ts
4
+ function httpsUrl() {
5
+ return z.string().trim().url().refine((u) => /^https?:\/\//i.test(u), {
6
+ message: "URL must use the http or https scheme"
7
+ });
8
+ }
9
+ var FirestoreTimestampSchema = z.union([
10
+ z.custom((data) => {
11
+ return data && typeof data === "object" && (typeof data.toDate === "function" || "seconds" in data && "nanoseconds" in data);
12
+ }),
13
+ z.string(),
14
+ z.number(),
15
+ z.date()
16
+ ]).transform((data, ctx) => {
17
+ let date;
18
+ if (data instanceof Date) {
19
+ date = data;
20
+ } else if (typeof data === "string") {
21
+ date = new Date(data);
22
+ } else if (typeof data === "number") {
23
+ date = new Date(data);
24
+ } else if (typeof data.toDate === "function") {
25
+ date = data.toDate();
26
+ } else {
27
+ const timestamp = data;
28
+ date = new Date(timestamp.seconds * 1e3 + timestamp.nanoseconds / 1e6);
29
+ }
30
+ if (Number.isNaN(date.getTime())) {
31
+ ctx.addIssue({
32
+ code: z.ZodIssueCode.custom,
33
+ message: "FirestoreTimestamp coerced to Invalid Date"
34
+ });
35
+ return z.NEVER;
36
+ }
37
+ return date;
38
+ });
39
+ var UserRecordSchema = z.object({
40
+ /** Unique Firebase UID */
41
+ id: z.string(),
42
+ /** Public handle (e.g. @brad). Optional for Lite Users. */
43
+ handle: z.string().min(3).max(20).regex(/^[a-zA-Z0-9_]+$/).nullable().optional(),
44
+ /** User stated intent (e.g. "Podcaster", "Listener") */
45
+ usageIntent: z.string().nullable().optional(),
46
+ /** Domain for federated handle support. */
47
+ domain: z.string().default("antiphony.dev"),
48
+ /**
49
+ * Display Name (e.g. "Brad Thorson"). Nullable: Firestore stores `null`
50
+ * when the user clears this field via the settings form, and the schema
51
+ * must match storage reality or `UserRecordSchema.parse` (in
52
+ * `getUserRecordByUid`) will throw.
53
+ */
54
+ displayName: z.string().max(50).nullable().optional(),
55
+ /** Short bio/description — nullable for the same reason as displayName. */
56
+ bio: z.string().max(160).nullable().optional(),
57
+ /** URL to avatar image — nullable for the same reason as displayName. */
58
+ avatarUrl: z.string().url().nullable().optional(),
59
+ /** Optional personal website surfaced on the public profile. */
60
+ website: httpsUrl().nullable().optional(),
61
+ /** Up to 5 additional public links (label + URL) shown under the bio. */
62
+ links: z.array(z.object({
63
+ label: z.string().min(1).max(40),
64
+ url: httpsUrl()
65
+ })).max(5).optional(),
66
+ /** When true and a Bluesky identity is linked, surfaces it on the public profile. */
67
+ showBlueskyPublicly: z.boolean().optional(),
68
+ /** Server timestamp of creation */
69
+ createdAt: FirestoreTimestampSchema,
70
+ /** Individual account tier — free or creator_pro */
71
+ tier: z.enum(["free", "creator_pro"]).default("free"),
72
+ /** Account status. Deactivated accounts retain data but are excluded from lookups. */
73
+ status: z.enum(["active", "deactivated"]).default("active"),
74
+ /** Timestamp when the account was deactivated (soft deleted) */
75
+ deactivatedAt: FirestoreTimestampSchema.optional()
76
+ });
77
+
78
+ export { FirestoreTimestampSchema, UserRecordSchema, httpsUrl };