@segmentstream/ontology 0.110.0 → 0.113.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 (56) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +15 -3
  3. package/dist/agent-review.d.ts +2 -0
  4. package/dist/agent-review.js +11 -1
  5. package/dist/analyze.d.ts +38 -34
  6. package/dist/analyze.js +109 -41
  7. package/dist/chat-channel.d.ts +47 -0
  8. package/dist/chat-channel.js +69 -0
  9. package/dist/email-html.d.ts +23 -0
  10. package/dist/email-html.js +249 -0
  11. package/dist/emails.d.ts +38 -6
  12. package/dist/emails.js +71 -2
  13. package/dist/index.d.ts +6 -2
  14. package/dist/index.js +3 -0
  15. package/dist/manifest.d.ts +282 -50
  16. package/dist/manifest.js +41 -6
  17. package/dist/migrate/model.d.ts +126 -18
  18. package/dist/runtime/agents.js +3 -0
  19. package/dist/runtime/resolve-agent-identity.js +4 -1
  20. package/dist/runtime-source.d.ts +4 -0
  21. package/dist/runtime-source.js +5 -0
  22. package/dist/runtime.d.ts +4 -1
  23. package/dist/service/agent/protocol.d.ts +5 -1
  24. package/dist/service/agent/protocol.js +12 -3
  25. package/dist/service/agent/server.js +17 -0
  26. package/dist/service/authentication.d.ts +5 -3
  27. package/dist/service/authentication.js +20 -5
  28. package/dist/service/chat/delivery.d.ts +10 -1
  29. package/dist/service/chat/delivery.js +30 -8
  30. package/dist/service/chat/envelope.d.ts +8 -2
  31. package/dist/service/chat/providers/custom.d.ts +13 -0
  32. package/dist/service/chat/providers/custom.js +103 -0
  33. package/dist/service/chat/providers/index.d.ts +20 -9
  34. package/dist/service/chat/providers/index.js +41 -12
  35. package/dist/service/chat/providers/provider.d.ts +19 -0
  36. package/dist/service/chat/reads.d.ts +6 -3
  37. package/dist/service/chat/reads.js +26 -14
  38. package/dist/service/chat/resolve.d.ts +7 -2
  39. package/dist/service/chat/resolve.js +11 -3
  40. package/dist/service/chat/review-delivery.d.ts +5 -2
  41. package/dist/service/chat/review-delivery.js +23 -9
  42. package/dist/service/chat/routes.js +2 -1
  43. package/dist/service/chat/schemas.d.ts +2 -0
  44. package/dist/service/chat/schemas.js +8 -1
  45. package/dist/service/config.d.ts +6 -2
  46. package/dist/service/mcp/server.js +2 -1
  47. package/dist/service/runtime-contract.d.ts +9 -0
  48. package/dist/service/schemas.d.ts +34 -4
  49. package/dist/service/service.js +6 -1
  50. package/dist/sign-in.d.ts +22 -1
  51. package/dist/sign-in.js +3 -1
  52. package/dist/storage/tables.d.ts +4 -3
  53. package/dist/storage/tables.js +11 -3
  54. package/dist/workspace-channel.d.ts +54 -0
  55. package/dist/workspace-channel.js +36 -0
  56. package/package.json +5 -1
@@ -1,4 +1,5 @@
1
1
  import type { ChatAttributionSettings } from "./chat.js";
2
+ import { CHAT_KINDS } from "./chat-channel.js";
2
3
  import { Effect, Schema } from "effect";
3
4
  import type { ResolvedConnection, ResolvedEntity } from "./analyze.js";
4
5
  import type { ResolvedFeedback } from "./feedback-config.js";
@@ -77,6 +78,17 @@ import { type ResolvedGuest, type ResolvedSignInOptions, type SignInPolicy } fro
77
78
  * guest passes and the workspace secret its verification reads, and `confirmations: true`, written
78
79
  * only when declared. Older readers ignore both: they ask new guests for no challenge, and keep
79
80
  * refusing guests the actions that need a confirmation.
81
+ * Within version 15, `signIn` may also carry `linkEmail` and `codeEmail`, written only when
82
+ * declared: the wire names of the emails the platform sends instead of its own sign-in link and
83
+ * sign-in code; the code email fills `{{code}}`. Older readers ignore both and send the platform's.
84
+ * Within version 15, an email may instead be a document the workspace lays out itself: `subject`,
85
+ * `html` and `text`, whose placeholders include `{{link}}`, the sign-in link. Older readers do not
86
+ * decode such an email and send the platform's own in its place where they can.
87
+ * Within version 15, `chat` may carry `channels`, written only when declared: the agent's channels
88
+ * not named after their kind, such as `sales_whatsapp`, each with its `kind` and connection. Older
89
+ * readers ignore it and send nothing through those channels. A channel the workspace defines in
90
+ * its own code has kind `custom` and no connection, as the agent sends through it; sign-up may open
91
+ * `channel:<name>`, its people's accounts.
80
92
  */
81
93
  export declare const MANIFEST_VERSION = 15;
82
94
  /** The phrase used for a direction the author did not phrase. */
@@ -686,16 +698,22 @@ export declare const SignInManifest: Schema.encodeKeys<Schema.Struct<{
686
698
  }>>;
687
699
  /** The wire name of the email the platform sends instead of its own invitation. */
688
700
  readonly invitationEmail: Schema.optionalKey<Schema.String>;
701
+ /** The wire name of the email the platform sends instead of its own sign-in link. */
702
+ readonly linkEmail: Schema.optionalKey<Schema.String>;
703
+ /** The wire name of the email the platform sends instead of its own sign-in code. */
704
+ readonly codeEmail: Schema.optionalKey<Schema.String>;
689
705
  }>, {
690
706
  readonly onNewUser: "on_new_user";
691
707
  readonly codeLink: "code_link";
692
708
  readonly signUp: "sign_up";
693
709
  readonly onSignUp: "on_sign_up";
694
710
  readonly invitationEmail: "invitation_email";
711
+ readonly linkEmail: "link_email";
712
+ readonly codeEmail: "code_email";
695
713
  }>;
696
714
  export type SignInManifest = typeof SignInManifest.Type;
697
- /** One of the workspace's emails, as `defineOntology({ emails })` declares it; see `EmailTemplate`. */
698
- export declare const EmailTemplateManifest: Schema.encodeKeys<Schema.Struct<{
715
+ /** An email as fields the platform lays out; see `EmailLayout`. */
716
+ export declare const EmailLayoutManifest: Schema.encodeKeys<Schema.Struct<{
699
717
  readonly subject: Schema.String;
700
718
  readonly eyebrow: Schema.optionalKey<Schema.String>;
701
719
  readonly heading: Schema.String;
@@ -725,6 +743,53 @@ export declare const EmailTemplateManifest: Schema.encodeKeys<Schema.Struct<{
725
743
  }>, {
726
744
  readonly replyTo: "reply_to";
727
745
  }>;
746
+ /** An email the workspace lays out itself: subject, HTML and plain text; see `EmailDocument`. */
747
+ export declare const EmailDocumentManifest: Schema.encodeKeys<Schema.Struct<{
748
+ readonly subject: Schema.String;
749
+ readonly html: Schema.String;
750
+ readonly text: Schema.String;
751
+ readonly replyTo: Schema.optionalKey<Schema.String>;
752
+ }>, {
753
+ readonly replyTo: "reply_to";
754
+ }>;
755
+ /** One of the workspace's emails, as `defineOntology({ emails })` declares it; see `EmailTemplate`. */
756
+ export declare const EmailTemplateManifest: Schema.Union<readonly [Schema.encodeKeys<Schema.Struct<{
757
+ readonly subject: Schema.String;
758
+ readonly html: Schema.String;
759
+ readonly text: Schema.String;
760
+ readonly replyTo: Schema.optionalKey<Schema.String>;
761
+ }>, {
762
+ readonly replyTo: "reply_to";
763
+ }>, Schema.encodeKeys<Schema.Struct<{
764
+ readonly subject: Schema.String;
765
+ readonly eyebrow: Schema.optionalKey<Schema.String>;
766
+ readonly heading: Schema.String;
767
+ readonly card: Schema.optionalKey<Schema.Struct<{
768
+ readonly title: Schema.String;
769
+ readonly detail: Schema.optionalKey<Schema.String>;
770
+ }>>;
771
+ readonly note: Schema.optionalKey<Schema.String>;
772
+ readonly paragraphs: Schema.optionalKey<Schema.$Array<Schema.String>>;
773
+ readonly action: Schema.String;
774
+ readonly sections: Schema.optionalKey<Schema.$Array<Schema.Struct<{
775
+ readonly title: Schema.String;
776
+ readonly text: Schema.optionalKey<Schema.String>;
777
+ readonly copy: Schema.optionalKey<Schema.Struct<{
778
+ readonly label: Schema.optionalKey<Schema.String>;
779
+ readonly value: Schema.String;
780
+ }>>;
781
+ readonly items: Schema.optionalKey<Schema.$Array<Schema.Struct<{
782
+ readonly label: Schema.String;
783
+ readonly text: Schema.optionalKey<Schema.String>;
784
+ readonly code: Schema.optionalKey<Schema.String>;
785
+ }>>>;
786
+ readonly note: Schema.optionalKey<Schema.String>;
787
+ }>>>;
788
+ readonly footer: Schema.optionalKey<Schema.String>;
789
+ readonly replyTo: Schema.optionalKey<Schema.String>;
790
+ }>, {
791
+ readonly replyTo: "reply_to";
792
+ }>]>;
728
793
  export type EmailTemplateManifest = typeof EmailTemplateManifest.Type;
729
794
  /** A property in the snake_case wire spelling, for records that store definitions. */
730
795
  export declare const PropertyManifestWire: Schema.encodeKeys<Schema.Struct<{
@@ -997,15 +1062,28 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
997
1062
  }>>;
998
1063
  /** The wire name of the email the platform sends instead of its own invitation. */
999
1064
  readonly invitationEmail: Schema.optionalKey<Schema.String>;
1065
+ /** The wire name of the email the platform sends instead of its own sign-in link. */
1066
+ readonly linkEmail: Schema.optionalKey<Schema.String>;
1067
+ /** The wire name of the email the platform sends instead of its own sign-in code. */
1068
+ readonly codeEmail: Schema.optionalKey<Schema.String>;
1000
1069
  }>, {
1001
1070
  readonly onNewUser: "on_new_user";
1002
1071
  readonly codeLink: "code_link";
1003
1072
  readonly signUp: "sign_up";
1004
1073
  readonly onSignUp: "on_sign_up";
1005
1074
  readonly invitationEmail: "invitation_email";
1075
+ readonly linkEmail: "link_email";
1076
+ readonly codeEmail: "code_email";
1006
1077
  }>>;
1007
1078
  /** The workspace's own emails by wire name. Written only when there are some; absent reads as none. */
1008
- readonly emails: Schema.optionalKey<Schema.$Record<Schema.String, Schema.encodeKeys<Schema.Struct<{
1079
+ readonly emails: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.encodeKeys<Schema.Struct<{
1080
+ readonly subject: Schema.String;
1081
+ readonly html: Schema.String;
1082
+ readonly text: Schema.String;
1083
+ readonly replyTo: Schema.optionalKey<Schema.String>;
1084
+ }>, {
1085
+ readonly replyTo: "reply_to";
1086
+ }>, Schema.encodeKeys<Schema.Struct<{
1009
1087
  readonly subject: Schema.String;
1010
1088
  readonly eyebrow: Schema.optionalKey<Schema.String>;
1011
1089
  readonly heading: Schema.String;
@@ -1034,7 +1112,7 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
1034
1112
  readonly replyTo: Schema.optionalKey<Schema.String>;
1035
1113
  }>, {
1036
1114
  readonly replyTo: "reply_to";
1037
- }>>>;
1115
+ }>]>>>;
1038
1116
  /** The connections the actions call. Written only when there are some; absent reads as none. */
1039
1117
  readonly connections: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1040
1118
  readonly key: Schema.String;
@@ -1043,10 +1121,11 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
1043
1121
  readonly delivers: Schema.optionalKey<Schema.Literal<true>>;
1044
1122
  }>>>;
1045
1123
  /**
1046
- * The providers whose chats the built-in exact chat post delivers to, each through its declared
1047
- * connection, and the attribution it adds. Absent, or without a provider, delivers nowhere.
1048
- * `email`, within version 15, is the mailbox reviewed replies to mail leave from; no chat post
1049
- * goes to it.
1124
+ * The agent's channels whose chats the built-in exact chat post delivers to, each through its
1125
+ * declared connection, and the attribution it adds. Absent, or without a channel, delivers
1126
+ * nowhere. The channel named after each kind has its key; `channels` holds the others by name,
1127
+ * with their kinds. `email`, within version 15, is the mailbox reviewed replies to mail leave
1128
+ * from; no chat post goes to it, nor to another channel of its kind.
1050
1129
  */
1051
1130
  readonly chat: Schema.optionalKey<Schema.Struct<{
1052
1131
  readonly telegram: Schema.optionalKey<Schema.Struct<{
@@ -1061,6 +1140,10 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
1061
1140
  readonly email: Schema.optionalKey<Schema.Struct<{
1062
1141
  readonly connection: Schema.String;
1063
1142
  }>>;
1143
+ readonly channels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
1144
+ readonly kind: Schema.Literals<readonly ["telegram", "slack", "whatsapp", "email", "custom"]>;
1145
+ readonly connection: Schema.optionalKey<Schema.String>;
1146
+ }>>>;
1064
1147
  readonly attribution: Schema.optionalKey<Schema.Struct<{
1065
1148
  readonly template: Schema.optionalKey<Schema.String>;
1066
1149
  readonly separator: Schema.optionalKey<Schema.String>;
@@ -1303,15 +1386,21 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1303
1386
  readonly telegram?: {
1304
1387
  readonly connection: string;
1305
1388
  } | undefined;
1306
- readonly email?: {
1389
+ readonly slack?: {
1307
1390
  readonly connection: string;
1308
1391
  } | undefined;
1309
1392
  readonly whatsapp?: {
1310
1393
  readonly connection: string;
1311
1394
  } | undefined;
1312
- readonly slack?: {
1395
+ readonly email?: {
1313
1396
  readonly connection: string;
1314
1397
  } | undefined;
1398
+ readonly channels?: {
1399
+ readonly [x: string]: {
1400
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
1401
+ readonly connection?: string | undefined;
1402
+ };
1403
+ } | undefined;
1315
1404
  readonly attribution?: {
1316
1405
  readonly template?: string | undefined;
1317
1406
  readonly separator?: string | undefined;
@@ -1414,9 +1503,16 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1414
1503
  } | undefined;
1415
1504
  readonly onSignUp?: string | undefined;
1416
1505
  readonly invitationEmail?: string | undefined;
1506
+ readonly linkEmail?: string | undefined;
1507
+ readonly codeEmail?: string | undefined;
1417
1508
  } | undefined;
1418
1509
  readonly emails?: {
1419
1510
  readonly [x: string]: {
1511
+ readonly subject: string;
1512
+ readonly text: string;
1513
+ readonly html: string;
1514
+ readonly replyTo?: string | undefined;
1515
+ } | {
1420
1516
  readonly subject: string;
1421
1517
  readonly action: string;
1422
1518
  readonly heading: string;
@@ -1599,15 +1695,21 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1599
1695
  readonly telegram?: {
1600
1696
  readonly connection: string;
1601
1697
  } | undefined;
1602
- readonly email?: {
1698
+ readonly slack?: {
1603
1699
  readonly connection: string;
1604
1700
  } | undefined;
1605
1701
  readonly whatsapp?: {
1606
1702
  readonly connection: string;
1607
1703
  } | undefined;
1608
- readonly slack?: {
1704
+ readonly email?: {
1609
1705
  readonly connection: string;
1610
1706
  } | undefined;
1707
+ readonly channels?: {
1708
+ readonly [x: string]: {
1709
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
1710
+ readonly connection?: string | undefined;
1711
+ };
1712
+ } | undefined;
1611
1713
  readonly attribution?: {
1612
1714
  readonly template?: string | undefined;
1613
1715
  readonly separator?: string | undefined;
@@ -1710,9 +1812,16 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1710
1812
  } | undefined;
1711
1813
  readonly onSignUp?: string | undefined;
1712
1814
  readonly invitationEmail?: string | undefined;
1815
+ readonly linkEmail?: string | undefined;
1816
+ readonly codeEmail?: string | undefined;
1713
1817
  } | undefined;
1714
1818
  readonly emails?: {
1715
1819
  readonly [x: string]: {
1820
+ readonly subject: string;
1821
+ readonly text: string;
1822
+ readonly html: string;
1823
+ readonly replyTo?: string | undefined;
1824
+ } | {
1716
1825
  readonly subject: string;
1717
1826
  readonly action: string;
1718
1827
  readonly heading: string;
@@ -1895,15 +2004,21 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1895
2004
  readonly telegram?: {
1896
2005
  readonly connection: string;
1897
2006
  } | undefined;
1898
- readonly email?: {
2007
+ readonly slack?: {
1899
2008
  readonly connection: string;
1900
2009
  } | undefined;
1901
2010
  readonly whatsapp?: {
1902
2011
  readonly connection: string;
1903
2012
  } | undefined;
1904
- readonly slack?: {
2013
+ readonly email?: {
1905
2014
  readonly connection: string;
1906
2015
  } | undefined;
2016
+ readonly channels?: {
2017
+ readonly [x: string]: {
2018
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
2019
+ readonly connection?: string | undefined;
2020
+ };
2021
+ } | undefined;
1907
2022
  readonly attribution?: {
1908
2023
  readonly template?: string | undefined;
1909
2024
  readonly separator?: string | undefined;
@@ -1976,9 +2091,15 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1976
2091
  } | undefined;
1977
2092
  readonly emails?: {
1978
2093
  readonly [x: string]: {
2094
+ readonly subject: string;
2095
+ readonly text: string;
2096
+ readonly html: string;
2097
+ readonly reply_to?: string | undefined;
2098
+ } | {
1979
2099
  readonly subject: string;
1980
2100
  readonly action: string;
1981
2101
  readonly heading: string;
2102
+ readonly reply_to?: string | undefined;
1982
2103
  readonly eyebrow?: string | undefined;
1983
2104
  readonly card?: {
1984
2105
  readonly title: string;
@@ -2001,7 +2122,6 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2001
2122
  } | undefined;
2002
2123
  }[] | undefined;
2003
2124
  readonly footer?: string | undefined;
2004
- readonly reply_to?: string | undefined;
2005
2125
  };
2006
2126
  } | undefined;
2007
2127
  readonly toolsets?: readonly {
@@ -2071,6 +2191,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2071
2191
  } | undefined;
2072
2192
  readonly on_sign_up?: string | undefined;
2073
2193
  readonly invitation_email?: string | undefined;
2194
+ readonly link_email?: string | undefined;
2195
+ readonly code_email?: string | undefined;
2074
2196
  } | undefined;
2075
2197
  } | {
2076
2198
  readonly version: number;
@@ -2191,15 +2313,21 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2191
2313
  readonly telegram?: {
2192
2314
  readonly connection: string;
2193
2315
  } | undefined;
2194
- readonly email?: {
2316
+ readonly slack?: {
2195
2317
  readonly connection: string;
2196
2318
  } | undefined;
2197
2319
  readonly whatsapp?: {
2198
2320
  readonly connection: string;
2199
2321
  } | undefined;
2200
- readonly slack?: {
2322
+ readonly email?: {
2201
2323
  readonly connection: string;
2202
2324
  } | undefined;
2325
+ readonly channels?: {
2326
+ readonly [x: string]: {
2327
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
2328
+ readonly connection?: string | undefined;
2329
+ };
2330
+ } | undefined;
2203
2331
  readonly attribution?: {
2204
2332
  readonly template?: string | undefined;
2205
2333
  readonly separator?: string | undefined;
@@ -2302,12 +2430,20 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2302
2430
  } | undefined;
2303
2431
  readonly on_sign_up?: string | undefined;
2304
2432
  readonly invitation_email?: string | undefined;
2433
+ readonly link_email?: string | undefined;
2434
+ readonly code_email?: string | undefined;
2305
2435
  } | undefined;
2306
2436
  readonly emails?: {
2307
2437
  readonly [x: string]: {
2438
+ readonly subject: string;
2439
+ readonly text: string;
2440
+ readonly html: string;
2441
+ readonly reply_to?: string | undefined;
2442
+ } | {
2308
2443
  readonly subject: string;
2309
2444
  readonly action: string;
2310
2445
  readonly heading: string;
2446
+ readonly reply_to?: string | undefined;
2311
2447
  readonly eyebrow?: string | undefined;
2312
2448
  readonly card?: {
2313
2449
  readonly title: string;
@@ -2330,7 +2466,6 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2330
2466
  } | undefined;
2331
2467
  }[] | undefined;
2332
2468
  readonly footer?: string | undefined;
2333
- readonly reply_to?: string | undefined;
2334
2469
  };
2335
2470
  } | undefined;
2336
2471
  readonly toolsets?: readonly {
@@ -2584,15 +2719,28 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2584
2719
  }>>;
2585
2720
  /** The wire name of the email the platform sends instead of its own invitation. */
2586
2721
  readonly invitationEmail: Schema.optionalKey<Schema.String>;
2722
+ /** The wire name of the email the platform sends instead of its own sign-in link. */
2723
+ readonly linkEmail: Schema.optionalKey<Schema.String>;
2724
+ /** The wire name of the email the platform sends instead of its own sign-in code. */
2725
+ readonly codeEmail: Schema.optionalKey<Schema.String>;
2587
2726
  }>, {
2588
2727
  readonly onNewUser: "on_new_user";
2589
2728
  readonly codeLink: "code_link";
2590
2729
  readonly signUp: "sign_up";
2591
2730
  readonly onSignUp: "on_sign_up";
2592
2731
  readonly invitationEmail: "invitation_email";
2732
+ readonly linkEmail: "link_email";
2733
+ readonly codeEmail: "code_email";
2593
2734
  }>>;
2594
2735
  /** The workspace's own emails by wire name. Written only when there are some; absent reads as none. */
2595
- readonly emails: Schema.optionalKey<Schema.$Record<Schema.String, Schema.encodeKeys<Schema.Struct<{
2736
+ readonly emails: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.encodeKeys<Schema.Struct<{
2737
+ readonly subject: Schema.String;
2738
+ readonly html: Schema.String;
2739
+ readonly text: Schema.String;
2740
+ readonly replyTo: Schema.optionalKey<Schema.String>;
2741
+ }>, {
2742
+ readonly replyTo: "reply_to";
2743
+ }>, Schema.encodeKeys<Schema.Struct<{
2596
2744
  readonly subject: Schema.String;
2597
2745
  readonly eyebrow: Schema.optionalKey<Schema.String>;
2598
2746
  readonly heading: Schema.String;
@@ -2621,7 +2769,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2621
2769
  readonly replyTo: Schema.optionalKey<Schema.String>;
2622
2770
  }>, {
2623
2771
  readonly replyTo: "reply_to";
2624
- }>>>;
2772
+ }>]>>>;
2625
2773
  /** The connections the actions call. Written only when there are some; absent reads as none. */
2626
2774
  readonly connections: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2627
2775
  readonly key: Schema.String;
@@ -2630,10 +2778,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2630
2778
  readonly delivers: Schema.optionalKey<Schema.Literal<true>>;
2631
2779
  }>>>;
2632
2780
  /**
2633
- * The providers whose chats the built-in exact chat post delivers to, each through its declared
2634
- * connection, and the attribution it adds. Absent, or without a provider, delivers nowhere.
2635
- * `email`, within version 15, is the mailbox reviewed replies to mail leave from; no chat post
2636
- * goes to it.
2781
+ * The agent's channels whose chats the built-in exact chat post delivers to, each through its
2782
+ * declared connection, and the attribution it adds. Absent, or without a channel, delivers
2783
+ * nowhere. The channel named after each kind has its key; `channels` holds the others by name,
2784
+ * with their kinds. `email`, within version 15, is the mailbox reviewed replies to mail leave
2785
+ * from; no chat post goes to it, nor to another channel of its kind.
2637
2786
  */
2638
2787
  readonly chat: Schema.optionalKey<Schema.Struct<{
2639
2788
  readonly telegram: Schema.optionalKey<Schema.Struct<{
@@ -2648,6 +2797,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2648
2797
  readonly email: Schema.optionalKey<Schema.Struct<{
2649
2798
  readonly connection: Schema.String;
2650
2799
  }>>;
2800
+ readonly channels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
2801
+ readonly kind: Schema.Literals<readonly ["telegram", "slack", "whatsapp", "email", "custom"]>;
2802
+ readonly connection: Schema.optionalKey<Schema.String>;
2803
+ }>>>;
2651
2804
  readonly attribution: Schema.optionalKey<Schema.Struct<{
2652
2805
  readonly template: Schema.optionalKey<Schema.String>;
2653
2806
  readonly separator: Schema.optionalKey<Schema.String>;
@@ -2974,15 +3127,28 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2974
3127
  }>>;
2975
3128
  /** The wire name of the email the platform sends instead of its own invitation. */
2976
3129
  readonly invitationEmail: Schema.optionalKey<Schema.String>;
3130
+ /** The wire name of the email the platform sends instead of its own sign-in link. */
3131
+ readonly linkEmail: Schema.optionalKey<Schema.String>;
3132
+ /** The wire name of the email the platform sends instead of its own sign-in code. */
3133
+ readonly codeEmail: Schema.optionalKey<Schema.String>;
2977
3134
  }>, {
2978
3135
  readonly onNewUser: "on_new_user";
2979
3136
  readonly codeLink: "code_link";
2980
3137
  readonly signUp: "sign_up";
2981
3138
  readonly onSignUp: "on_sign_up";
2982
3139
  readonly invitationEmail: "invitation_email";
3140
+ readonly linkEmail: "link_email";
3141
+ readonly codeEmail: "code_email";
2983
3142
  }>>;
2984
3143
  /** The workspace's own emails by wire name. Written only when there are some; absent reads as none. */
2985
- readonly emails: Schema.optionalKey<Schema.$Record<Schema.String, Schema.encodeKeys<Schema.Struct<{
3144
+ readonly emails: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.encodeKeys<Schema.Struct<{
3145
+ readonly subject: Schema.String;
3146
+ readonly html: Schema.String;
3147
+ readonly text: Schema.String;
3148
+ readonly replyTo: Schema.optionalKey<Schema.String>;
3149
+ }>, {
3150
+ readonly replyTo: "reply_to";
3151
+ }>, Schema.encodeKeys<Schema.Struct<{
2986
3152
  readonly subject: Schema.String;
2987
3153
  readonly eyebrow: Schema.optionalKey<Schema.String>;
2988
3154
  readonly heading: Schema.String;
@@ -3011,7 +3177,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3011
3177
  readonly replyTo: Schema.optionalKey<Schema.String>;
3012
3178
  }>, {
3013
3179
  readonly replyTo: "reply_to";
3014
- }>>>;
3180
+ }>]>>>;
3015
3181
  /** The connections the actions call. Written only when there are some; absent reads as none. */
3016
3182
  readonly connections: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3017
3183
  readonly key: Schema.String;
@@ -3020,10 +3186,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3020
3186
  readonly delivers: Schema.optionalKey<Schema.Literal<true>>;
3021
3187
  }>>>;
3022
3188
  /**
3023
- * The providers whose chats the built-in exact chat post delivers to, each through its declared
3024
- * connection, and the attribution it adds. Absent, or without a provider, delivers nowhere.
3025
- * `email`, within version 15, is the mailbox reviewed replies to mail leave from; no chat post
3026
- * goes to it.
3189
+ * The agent's channels whose chats the built-in exact chat post delivers to, each through its
3190
+ * declared connection, and the attribution it adds. Absent, or without a channel, delivers
3191
+ * nowhere. The channel named after each kind has its key; `channels` holds the others by name,
3192
+ * with their kinds. `email`, within version 15, is the mailbox reviewed replies to mail leave
3193
+ * from; no chat post goes to it, nor to another channel of its kind.
3027
3194
  */
3028
3195
  readonly chat: Schema.optionalKey<Schema.Struct<{
3029
3196
  readonly telegram: Schema.optionalKey<Schema.Struct<{
@@ -3038,6 +3205,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3038
3205
  readonly email: Schema.optionalKey<Schema.Struct<{
3039
3206
  readonly connection: Schema.String;
3040
3207
  }>>;
3208
+ readonly channels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
3209
+ readonly kind: Schema.Literals<readonly ["telegram", "slack", "whatsapp", "email", "custom"]>;
3210
+ readonly connection: Schema.optionalKey<Schema.String>;
3211
+ }>>>;
3041
3212
  readonly attribution: Schema.optionalKey<Schema.Struct<{
3042
3213
  readonly template: Schema.optionalKey<Schema.String>;
3043
3214
  readonly separator: Schema.optionalKey<Schema.String>;
@@ -3272,15 +3443,21 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3272
3443
  readonly telegram?: {
3273
3444
  readonly connection: string;
3274
3445
  } | undefined;
3275
- readonly email?: {
3446
+ readonly slack?: {
3276
3447
  readonly connection: string;
3277
3448
  } | undefined;
3278
3449
  readonly whatsapp?: {
3279
3450
  readonly connection: string;
3280
3451
  } | undefined;
3281
- readonly slack?: {
3452
+ readonly email?: {
3282
3453
  readonly connection: string;
3283
3454
  } | undefined;
3455
+ readonly channels?: {
3456
+ readonly [x: string]: {
3457
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
3458
+ readonly connection?: string | undefined;
3459
+ };
3460
+ } | undefined;
3284
3461
  readonly attribution?: {
3285
3462
  readonly template?: string | undefined;
3286
3463
  readonly separator?: string | undefined;
@@ -3383,9 +3560,16 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3383
3560
  } | undefined;
3384
3561
  readonly onSignUp?: string | undefined;
3385
3562
  readonly invitationEmail?: string | undefined;
3563
+ readonly linkEmail?: string | undefined;
3564
+ readonly codeEmail?: string | undefined;
3386
3565
  } | undefined;
3387
3566
  readonly emails?: {
3388
3567
  readonly [x: string]: {
3568
+ readonly subject: string;
3569
+ readonly text: string;
3570
+ readonly html: string;
3571
+ readonly replyTo?: string | undefined;
3572
+ } | {
3389
3573
  readonly subject: string;
3390
3574
  readonly action: string;
3391
3575
  readonly heading: string;
@@ -3568,15 +3752,21 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3568
3752
  readonly telegram?: {
3569
3753
  readonly connection: string;
3570
3754
  } | undefined;
3571
- readonly email?: {
3755
+ readonly slack?: {
3572
3756
  readonly connection: string;
3573
3757
  } | undefined;
3574
3758
  readonly whatsapp?: {
3575
3759
  readonly connection: string;
3576
3760
  } | undefined;
3577
- readonly slack?: {
3761
+ readonly email?: {
3578
3762
  readonly connection: string;
3579
3763
  } | undefined;
3764
+ readonly channels?: {
3765
+ readonly [x: string]: {
3766
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
3767
+ readonly connection?: string | undefined;
3768
+ };
3769
+ } | undefined;
3580
3770
  readonly attribution?: {
3581
3771
  readonly template?: string | undefined;
3582
3772
  readonly separator?: string | undefined;
@@ -3679,9 +3869,16 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3679
3869
  } | undefined;
3680
3870
  readonly onSignUp?: string | undefined;
3681
3871
  readonly invitationEmail?: string | undefined;
3872
+ readonly linkEmail?: string | undefined;
3873
+ readonly codeEmail?: string | undefined;
3682
3874
  } | undefined;
3683
3875
  readonly emails?: {
3684
3876
  readonly [x: string]: {
3877
+ readonly subject: string;
3878
+ readonly text: string;
3879
+ readonly html: string;
3880
+ readonly replyTo?: string | undefined;
3881
+ } | {
3685
3882
  readonly subject: string;
3686
3883
  readonly action: string;
3687
3884
  readonly heading: string;
@@ -3870,15 +4067,21 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
3870
4067
  readonly telegram?: {
3871
4068
  readonly connection: string;
3872
4069
  } | undefined;
3873
- readonly email?: {
4070
+ readonly slack?: {
3874
4071
  readonly connection: string;
3875
4072
  } | undefined;
3876
4073
  readonly whatsapp?: {
3877
4074
  readonly connection: string;
3878
4075
  } | undefined;
3879
- readonly slack?: {
4076
+ readonly email?: {
3880
4077
  readonly connection: string;
3881
4078
  } | undefined;
4079
+ readonly channels?: {
4080
+ readonly [x: string]: {
4081
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
4082
+ readonly connection?: string | undefined;
4083
+ };
4084
+ } | undefined;
3882
4085
  readonly attribution?: {
3883
4086
  readonly template?: string | undefined;
3884
4087
  readonly separator?: string | undefined;
@@ -3981,9 +4184,16 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
3981
4184
  } | undefined;
3982
4185
  readonly onSignUp?: string | undefined;
3983
4186
  readonly invitationEmail?: string | undefined;
4187
+ readonly linkEmail?: string | undefined;
4188
+ readonly codeEmail?: string | undefined;
3984
4189
  } | undefined;
3985
4190
  readonly emails?: {
3986
4191
  readonly [x: string]: {
4192
+ readonly subject: string;
4193
+ readonly text: string;
4194
+ readonly html: string;
4195
+ readonly replyTo?: string | undefined;
4196
+ } | {
3987
4197
  readonly subject: string;
3988
4198
  readonly action: string;
3989
4199
  readonly heading: string;
@@ -4166,15 +4376,21 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4166
4376
  readonly telegram?: {
4167
4377
  readonly connection: string;
4168
4378
  } | undefined;
4169
- readonly email?: {
4379
+ readonly slack?: {
4170
4380
  readonly connection: string;
4171
4381
  } | undefined;
4172
4382
  readonly whatsapp?: {
4173
4383
  readonly connection: string;
4174
4384
  } | undefined;
4175
- readonly slack?: {
4385
+ readonly email?: {
4176
4386
  readonly connection: string;
4177
4387
  } | undefined;
4388
+ readonly channels?: {
4389
+ readonly [x: string]: {
4390
+ readonly kind: "telegram" | "slack" | "whatsapp" | "email" | "custom";
4391
+ readonly connection?: string | undefined;
4392
+ };
4393
+ } | undefined;
4178
4394
  readonly attribution?: {
4179
4395
  readonly template?: string | undefined;
4180
4396
  readonly separator?: string | undefined;
@@ -4277,9 +4493,16 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4277
4493
  } | undefined;
4278
4494
  readonly onSignUp?: string | undefined;
4279
4495
  readonly invitationEmail?: string | undefined;
4496
+ readonly linkEmail?: string | undefined;
4497
+ readonly codeEmail?: string | undefined;
4280
4498
  } | undefined;
4281
4499
  readonly emails?: {
4282
4500
  readonly [x: string]: {
4501
+ readonly subject: string;
4502
+ readonly text: string;
4503
+ readonly html: string;
4504
+ readonly replyTo?: string | undefined;
4505
+ } | {
4283
4506
  readonly subject: string;
4284
4507
  readonly action: string;
4285
4508
  readonly heading: string;
@@ -4382,21 +4605,30 @@ export declare function manifestHash(manifest: Readonly<Record<string, unknown>>
4382
4605
  * aggregates, top-level or inside arithmetic: `check` lets them name one property at most.
4383
4606
  */
4384
4607
  export declare function metricsManifest(resolved: ResolvedEntity): ReadonlyArray<MetricManifest>;
4608
+ /** `chat` as the manifest writes it: the channel of each kind, the other channels, attribution. */
4609
+ export interface ChatManifestInput {
4610
+ readonly telegram?: {
4611
+ readonly connection: string;
4612
+ };
4613
+ readonly slack?: {
4614
+ readonly connection: string;
4615
+ };
4616
+ readonly whatsapp?: {
4617
+ readonly connection: string;
4618
+ };
4619
+ readonly email?: {
4620
+ readonly connection: string;
4621
+ };
4622
+ readonly channels?: Readonly<Record<string, {
4623
+ readonly kind: (typeof CHAT_KINDS)[number];
4624
+ readonly connection?: string;
4625
+ }>>;
4626
+ readonly attribution?: ChatAttributionSettings;
4627
+ }
4385
4628
  /** Builds the manifest of a resolved ontology that passed `check`. */
4386
4629
  export declare function buildManifest(input: {
4387
4630
  readonly feedback?: ResolvedFeedback;
4388
- readonly chat?: {
4389
- readonly telegram?: {
4390
- readonly connection: string;
4391
- };
4392
- readonly slack?: {
4393
- readonly connection: string;
4394
- };
4395
- readonly whatsapp?: {
4396
- readonly connection: string;
4397
- };
4398
- readonly attribution?: ChatAttributionSettings;
4399
- };
4631
+ readonly chat?: ChatManifestInput;
4400
4632
  readonly entities: ReadonlyArray<ResolvedEntity>;
4401
4633
  readonly roles: ReadonlyArray<Role>;
4402
4634
  readonly signIn: ResolvedSignInOptions;