@segmentstream/ontology 0.154.0 → 0.155.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.155.0
4
+
5
+ An email thread can be one chat. `"chats": "thread"` on an email channel makes each Gmail thread one chat and one session of the agent, whoever writes in it; `"sender"`, the default, keeps each person's own chat in a thread, as before. Admission stays the sender's: each turn acts as the person who wrote. Each message, and the reply to it, is read by the members it went to, its sender and the members among its `To` and `Cc`, so a person dropped from `Cc` reads none of the thread's later mail. Each admitted person joins the thread's chat in the inbox, which is named after the thread's subject; with `"record": "all"`, any mail the channel records in a thread, even mail the agent does not take from or to members, brings its chat into the inbox where `inbox.channels` lists the channel, and makes no one its member. A reply held for review in a thread's chat is read, once approved, by the same members as a reply the agent sends itself. A new thread chat reads its history from Gmail once, the thread's last 20 messages before it, as imported history. Chats a thread had per person stay, and replies waiting or held there are still sent. A thread's chat replies to all; `"reply": "sender"` is refused with it. Staff answer a thread's chat in Gmail: the inbox's `postMessage` and `send` refuse it. While staff hold a thread's chat, taken over, the agent answers no one in the thread, whatever their role.
6
+
7
+ `POST /api/ontology/agent/chats/seen` takes `shared: true` for a private chat several people share: the member joins its members and none leaves; a member whose roles the inbox does not take joins none, and is answered whether staff hold the chat where it is recorded already. `POST /api/ontology/agent/chats/messages` takes `imported: true` for history a channel read from its provider, never for a send. `POST /api/ontology/agent/reviews` takes `participants`, at most 50 user ids of the members who read a reply in a private chat several people share; `agent_review` keeps them in its new `participants` property, a redraft keeps them, and the approved reply is recorded as read by its `person` and them. An agent on this release whose ontology SDK predates `participants` holds the reply for its person alone.
8
+
3
9
  ## 0.154.0
4
10
 
5
11
  An email channel can reply to all: with `"reply": "all"` in `agent/segmentstream.json`, a reply goes to the person who wrote, in `To`, and copies the other addresses of the `To` and `Cc` of the mail it answers, without the mailbox's own address; files `segmentstream__attachments_send` sends go to the same people. `"sender"`, the default, replies to the person alone, as before. Each state of a reply names whom it goes to in its channel state, so a reply a later wake sends goes to the same people.
@@ -47,10 +47,16 @@ export declare const AGENT_REVIEW_TEXT_LIMIT = 20000;
47
47
  export declare const AGENT_REVIEW_REASON_LIMIT = 2000;
48
48
  /** The longest note a member gives the agent for redrafting a reply. */
49
49
  export declare const AGENT_REVIEW_NOTE_LIMIT = 2000;
50
+ /** The most members a review names as the readers of its reply, as many as a reply to mail goes to. */
51
+ export declare const AGENT_REVIEW_PARTICIPANTS_LIMIT = 50;
50
52
  /** Addresses as a review keeps them in `to` and `cc`: separated by commas. */
51
53
  export declare function reviewAddresses(addresses: ReadonlyArray<string>): string;
52
54
  /** The addresses a review keeps in `to` or `cc`; none for an empty value. */
53
55
  export declare function addressesOfReview(value: unknown): ReadonlyArray<string>;
56
+ /** Members as a review keeps them in `participants`: their user ids, once each, by commas. */
57
+ export declare function reviewParticipants(ids: ReadonlyArray<string>): string;
58
+ /** The members a review keeps in `participants`, once each; anything that is no user id is left out. */
59
+ export declare function participantsOfReview(value: unknown): ReadonlyArray<string>;
54
60
  export declare const AgentReview: import("./entity.js").Entity<"agent_review", {
55
61
  readonly key: import("./property.js").Property<string, false, true>;
56
62
  readonly provider: import("./property.js").Property<string, false, false>;
@@ -59,6 +65,7 @@ export declare const AgentReview: import("./entity.js").Entity<"agent_review", {
59
65
  readonly recipient: import("./property.js").Property<string, false, false>;
60
66
  readonly to: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
61
67
  readonly cc: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
68
+ readonly participants: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
62
69
  readonly chatKind: import("./property.js").Property<"private" | "group", false, false>;
63
70
  readonly threadId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
64
71
  readonly replyTo: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
@@ -122,6 +129,7 @@ export declare const AgentReview: import("./entity.js").Entity<"agent_review", {
122
129
  readonly recipient: string;
123
130
  readonly to: string | null;
124
131
  readonly cc: string | null;
132
+ readonly participants: string | null;
125
133
  readonly chatKind: "private" | "group";
126
134
  readonly threadId: string | null;
127
135
  readonly replyTo: string | null;
@@ -5,6 +5,7 @@ import { EMAIL_RECIPIENTS_LIMIT } from "./email.js";
5
5
  import { entity } from "./entity.js";
6
6
  import { ActionRejected } from "./errors.js";
7
7
  import { EMAIL_PATTERN, p } from "./property.js";
8
+ import { isUuid } from "./query.js";
8
9
  import { rel } from "./relationship.js";
9
10
  /**
10
11
  * A reply the workspace's agent held for review. `agent/segmentstream.json` says, per role of the
@@ -48,6 +49,10 @@ export const AGENT_REVIEW_REASON_LIMIT = 2_000;
48
49
  export const AGENT_REVIEW_NOTE_LIMIT = 2_000;
49
50
  /** The longest list of addresses a review keeps in `to` or `cc`: as many as a reply goes to. */
50
51
  const AGENT_REVIEW_RECIPIENTS_LENGTH = EMAIL_RECIPIENTS_LIMIT * 256;
52
+ /** The most members a review names as the readers of its reply, as many as a reply to mail goes to. */
53
+ export const AGENT_REVIEW_PARTICIPANTS_LIMIT = EMAIL_RECIPIENTS_LIMIT;
54
+ /** The longest list of user ids a review keeps in `participants`. */
55
+ const AGENT_REVIEW_PARTICIPANTS_LENGTH = AGENT_REVIEW_PARTICIPANTS_LIMIT * 38;
51
56
  /** An address a member names for a reply to mail. */
52
57
  const EmailAddress = Schema.String.check(Schema.isMaxLength(254), Schema.isPattern(EMAIL_PATTERN));
53
58
  /** Addresses as a review keeps them in `to` and `cc`: separated by commas. */
@@ -63,6 +68,18 @@ export function addressesOfReview(value) {
63
68
  .map((address) => address.trim())
64
69
  .filter((address) => address !== "");
65
70
  }
71
+ /** Members as a review keeps them in `participants`: their user ids, once each, by commas. */
72
+ export function reviewParticipants(ids) {
73
+ return [...new Set(ids.map((id) => id.toLowerCase()))].join(", ");
74
+ }
75
+ /** The members a review keeps in `participants`, once each; anything that is no user id is left out. */
76
+ export function participantsOfReview(value) {
77
+ return [
78
+ ...new Set(addressesOfReview(value)
79
+ .filter(isUuid)
80
+ .map((id) => id.toLowerCase())),
81
+ ];
82
+ }
66
83
  export const AgentReview = entity("agent_review", {
67
84
  id: "ent_agent_review",
68
85
  label: "Agent reply review",
@@ -110,6 +127,14 @@ export const AgentReview = entity("agent_review", {
110
127
  description: "A reply to mail: the addresses it copies, in Cc, separated by commas, as the thread's " +
111
128
  "other people; once approved, those it was sent to. Empty when it copies no one.",
112
129
  }),
130
+ participants: p.text({
131
+ optional: true,
132
+ managed: true,
133
+ maxLength: AGENT_REVIEW_PARTICIPANTS_LENGTH,
134
+ description: "A reply in a chat several people share, such as an email thread: the members who " +
135
+ "read it in the chat's history, its person among them, by user id, separated by " +
136
+ "commas, as they read the message it answers. Empty when only its person reads it.",
137
+ }),
113
138
  chatKind: p.select([
114
139
  { value: "private", description: "The person's own chat with the agent." },
115
140
  { value: "group", description: "A group chat." },
@@ -5,7 +5,7 @@ import { SqlClient } from "effect/unstable/sql";
5
5
  import { action } from "../action.js";
6
6
  import { AgentChat, agentChatKey } from "../agent-chat.js";
7
7
  import { chatChannelKind } from "../chat-channel.js";
8
- import { addressesOfReview, AgentReview, reviewAddresses } from "../agent-review.js";
8
+ import { addressesOfReview, AgentReview, participantsOfReview, reviewAddresses, reviewParticipants, } from "../agent-review.js";
9
9
  import { AGENT_IDENTITIES_TABLE, AGENT_PAIRINGS_TABLE, CHANNEL_USERS_TABLE, IDENTITY_NOTICES_TABLE, USER_TABLE, } from "../migrate/storage.js";
10
10
  import { inboxChannelsOf, inboxRolesOf, takeoverChannelsOf, takeoverProvidersOf, } from "../manifest.js";
11
11
  import { GUEST_ROLE } from "../names.js";
@@ -228,6 +228,10 @@ export function sqlAgentStore(ontology, sql) {
228
228
  cc: (input.cc ?? []).length === 0 ? null : reviewAddresses(input.cc ?? []),
229
229
  }
230
230
  : {}),
231
+ // A reply in a chat several people share is read by the members the agent named.
232
+ participants: (input.participants ?? []).length === 0
233
+ ? null
234
+ : reviewParticipants(input.participants ?? []),
231
235
  chat_kind: chat?.kind === "group" || chat?.kind === "private" ? chat.kind : kindOf(input),
232
236
  thread_id: input.threadId === "" ? null : input.threadId,
233
237
  reply_to: input.replyTo,
@@ -656,6 +660,9 @@ export function sqlAgentStore(ontology, sql) {
656
660
  .pipe(Effect.orDie),
657
661
  seeInboxChat: (input) => Effect.gen(function* () {
658
662
  const { memberId } = input;
663
+ // Someone the inbox does not take, writing in a chat several people share, such as an
664
+ // email thread: the chat is answered where it is recorded already, and they do not join it.
665
+ let outsider = false;
659
666
  if (memberId === undefined) {
660
667
  // A chat with someone who is no user joins only on a channel the inbox lists, without
661
668
  // members: nobody is created for them, and staff read it within their scope.
@@ -667,9 +674,15 @@ export function sqlAgentStore(ontology, sql) {
667
674
  const roles = inboxRolesOf(ontology.manifest);
668
675
  const member = isRecordId(memberId) ? yield* store.member(memberId) : undefined;
669
676
  // Only the private chats of people whose roles the inbox takes are recorded.
670
- if (member === undefined || !member.principal.roles.some((role) => roles.has(role))) {
677
+ if (member === undefined) {
671
678
  return undefined;
672
679
  }
680
+ if (!member.principal.roles.some((role) => roles.has(role))) {
681
+ if (input.shared !== true) {
682
+ return undefined;
683
+ }
684
+ outsider = true;
685
+ }
673
686
  }
674
687
  return yield* sql.withTransaction(Effect.gen(function* () {
675
688
  yield* beginReplicationWrite(sql);
@@ -691,7 +704,8 @@ export function sqlAgentStore(ontology, sql) {
691
704
  },
692
705
  });
693
706
  // A group chat's id is never a person's private chat.
694
- if (found !== undefined && found.kind !== "private") {
707
+ if ((found !== undefined && found.kind !== "private") ||
708
+ (outsider && found === undefined)) {
695
709
  return undefined;
696
710
  }
697
711
  const now = new Date();
@@ -724,9 +738,11 @@ export function sqlAgentStore(ontology, sql) {
724
738
  values: changes,
725
739
  });
726
740
  // A private chat has one member, its person now: an account paired with someone else
727
- // since leaves the earlier person out. A link already there changes nothing. A report
728
- // without a person leaves the members as they are.
729
- if (memberId !== undefined) {
741
+ // since leaves the earlier person out. A shared chat, such as an email thread several
742
+ // people write in, keeps every member it had: each message names who reads it. A link
743
+ // already there changes nothing. A report without a person, or by someone the inbox
744
+ // does not take, leaves the members as they are.
745
+ if (memberId !== undefined && !outsider) {
730
746
  const members = yield* runtime.related({
731
747
  entity: AgentChat.name,
732
748
  id: String(chat.id),
@@ -734,7 +750,7 @@ export function sqlAgentStore(ontology, sql) {
734
750
  query: { limit: MAX_QUERY_LIMIT },
735
751
  });
736
752
  for (const member of members.items) {
737
- if (String(member.id) !== memberId) {
753
+ if (input.shared !== true && String(member.id) !== memberId) {
738
754
  yield* runtime.unlink({
739
755
  entity: AgentChat.name,
740
756
  relationship: "members",
@@ -899,10 +915,14 @@ export function sqlAgentStore(ontology, sql) {
899
915
  channel: nullableText(previous.channel) ?? String(previous.provider),
900
916
  chatId: String(previous.chat_id),
901
917
  recipient: String(previous.recipient),
902
- // A redraft goes to the people the reply it replaces goes to.
918
+ // A redraft goes to the people the reply it replaces goes to, and is read by the
919
+ // members who read that one.
903
920
  ...(addressesOfReview(previous.to).length === 0
904
921
  ? {}
905
922
  : { to: addressesOfReview(previous.to), cc: addressesOfReview(previous.cc) }),
923
+ ...(participantsOfReview(previous.participants).length === 0
924
+ ? {}
925
+ : { participants: participantsOfReview(previous.participants) }),
906
926
  threadId: nullableText(previous.thread_id) ?? "",
907
927
  replyTo: nullableText(previous.reply_to),
908
928
  memberId: String(previous.person_id),
@@ -31,6 +31,7 @@ export declare const ChatMessageRecordRequest: Schema.Struct<{
31
31
  readonly sessionId: Schema.optionalKey<Schema.String>;
32
32
  readonly turnId: Schema.optionalKey<Schema.String>;
33
33
  readonly meta: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
34
+ readonly imported: Schema.optionalKey<Schema.Literal<true>>;
34
35
  }>;
35
36
  /** `POST /api/ontology/agent/chats/messages/change`: one change to a message. */
36
37
  export declare const ChatMessageChangeRequest: Schema.Union<readonly [Schema.Struct<{
@@ -53,6 +53,9 @@ export const ChatMessageRecordRequest = Schema.Struct({
53
53
  sessionId: Schema.optionalKey(Key),
54
54
  turnId: Schema.optionalKey(Key),
55
55
  meta: Schema.optionalKey(BoundedJson),
56
+ // History the channel read from its provider, from before it recorded the chat: no session reads
57
+ // it as new and no figure counts it, as an import's. Never a send.
58
+ imported: Schema.optionalKey(Schema.Literal(true)),
56
59
  });
57
60
  const Target = { channel: Provider, chatId: ChatId, messageId: MessageId };
58
61
  /** `POST /api/ontology/agent/chats/messages/change`: one change to a message. */
@@ -169,7 +172,7 @@ export function recordChatMessage(store) {
169
172
  if (Result.isFailure(decoded)) {
170
173
  return refused(requestId, 400, "invalid_request", schemaIssues(decoded.failure));
171
174
  }
172
- const { threadId, ...message } = decoded.success;
175
+ const { threadId, imported, ...message } = decoded.success;
173
176
  // A send's replay is told apart from another request by its fingerprint.
174
177
  if ((message.operation === undefined) !== (message.fingerprint === undefined)) {
175
178
  return refused(requestId, 400, "operation_requires_fingerprint");
@@ -177,8 +180,18 @@ export function recordChatMessage(store) {
177
180
  if (message.status !== undefined && message.direction !== "outbound") {
178
181
  return refused(requestId, 400, "status_requires_outbound");
179
182
  }
183
+ // Imported history was sent before the chat was recorded: it is no send of the runtime's.
184
+ if (imported === true &&
185
+ (message.operation !== undefined ||
186
+ (message.status !== undefined && message.status !== "sent"))) {
187
+ return refused(requestId, 400, "imported_send");
188
+ }
180
189
  const recorded = yield* store
181
- .record({ ...message, ...(threadId === undefined || threadId === "" ? {} : { threadId }) })
190
+ .record({
191
+ ...message,
192
+ ...(threadId === undefined || threadId === "" ? {} : { threadId }),
193
+ ...(imported === true ? { importedAt: new Date().toISOString() } : {}),
194
+ })
182
195
  .pipe(Effect.result);
183
196
  if (Result.isFailure(recorded)) {
184
197
  return refused(requestId, 409, recorded.failure.code);
@@ -126,6 +126,7 @@ export declare const ChatSeenRequest: Schema.Struct<{
126
126
  readonly kind: Schema.optionalKey<Schema.Literal<"private">>;
127
127
  readonly recipient: Schema.optionalKey<Schema.String>;
128
128
  readonly threadId: Schema.optionalKey<Schema.String>;
129
+ readonly shared: Schema.optionalKey<Schema.Literal<true>>;
129
130
  }>;
130
131
  /**
131
132
  * `POST /api/ontology/agent/chats/handoff`: the agent hands a person's private chat over to staff,
@@ -149,6 +150,7 @@ export declare const ReviewRequest: Schema.Struct<{
149
150
  readonly recipient: Schema.String;
150
151
  readonly to: Schema.optionalKey<Schema.$Array<Schema.String>>;
151
152
  readonly cc: Schema.optionalKey<Schema.$Array<Schema.String>>;
153
+ readonly participants: Schema.optionalKey<Schema.$Array<Schema.String>>;
152
154
  readonly thread_id: Schema.String;
153
155
  readonly reply_to: Schema.NullOr<Schema.String>;
154
156
  readonly member_id: Schema.String;
@@ -1,5 +1,6 @@
1
1
  import { randomInt } from "node:crypto";
2
2
  import { Schema } from "effect";
3
+ import { AGENT_REVIEW_PARTICIPANTS_LIMIT } from "../../agent-review.js";
3
4
  import { ChatChannelName } from "../../chat-channel.js";
4
5
  import { EMAIL_RECIPIENTS_LIMIT } from "../../email.js";
5
6
  import { EMAIL_PATTERN } from "../../property.js";
@@ -164,6 +165,10 @@ export const ChatSeenRequest = Schema.Struct({
164
165
  description: "Whom a reply in the private chat is sent to, where it differs from externalId.",
165
166
  })),
166
167
  threadId: Schema.optionalKey(ChatId.annotate({ description: "The thread a reply in the private chat stays in." })),
168
+ shared: Schema.optionalKey(Schema.Literal(true).annotate({
169
+ description: "A private chat several people write in, such as an email thread: memberId joins its " +
170
+ "members, and no member leaves it. Each message names who reads it.",
171
+ })),
167
172
  });
168
173
  /**
169
174
  * `POST /api/ontology/agent/chats/handoff`: the agent hands a person's private chat over to staff,
@@ -202,6 +207,12 @@ export const ReviewRequest = Schema.Struct({
202
207
  cc: Schema.optionalKey(Schema.Array(EmailAddress).check(Schema.isMaxLength(EMAIL_RECIPIENTS_LIMIT)).annotate({
203
208
  description: "A reply to mail: the addresses it copies, in Cc, the thread's other people.",
204
209
  })),
210
+ participants: Schema.optionalKey(Schema.Array(Schema.String.check(Schema.isUUID()))
211
+ .check(Schema.isMaxLength(AGENT_REVIEW_PARTICIPANTS_LIMIT))
212
+ .annotate({
213
+ description: "A reply in a chat several people share, such as an email thread: the members who " +
214
+ "read it, by user id, as they read the message it answers; its member alone when absent.",
215
+ })),
205
216
  thread_id: Schema.String.check(Schema.isMaxLength(MAX_EXTERNAL_ID_LENGTH)).annotate({
206
217
  description: "The chat's thread or topic; empty without one.",
207
218
  }),
@@ -312,7 +312,7 @@ function seeChat(store) {
312
312
  if (Result.isFailure(decoded)) {
313
313
  return invalidBody(requestId, schemaIssues(decoded.failure));
314
314
  }
315
- const { kind, recipient, threadId, ...seen } = decoded.success;
315
+ const { kind, recipient, threadId, shared, ...seen } = decoded.success;
316
316
  if (kind === "private") {
317
317
  // A person's private chat joins the inbox, which records nothing for anyone else; one
318
318
  // without a person, someone who is no user, joins on a channel the inbox lists.
@@ -328,6 +328,7 @@ function seeChat(store) {
328
328
  ...(seen.memberId === undefined ? {} : { memberId: seen.memberId }),
329
329
  ...(recipient === undefined ? {} : { recipient }),
330
330
  ...(threadId === undefined ? {} : { threadId }),
331
+ ...(shared === undefined ? {} : { shared }),
331
332
  });
332
333
  if (inboxed === undefined) {
333
334
  return toServerResponse(notFound(requestId, "The chat is not one the inbox takes."));
@@ -391,6 +392,9 @@ function holdReply(store) {
391
392
  recipient: body.recipient,
392
393
  ...(body.to === undefined ? {} : { to: body.to.map((address) => address.toLowerCase()) }),
393
394
  ...(body.cc === undefined ? {} : { cc: body.cc.map((address) => address.toLowerCase()) }),
395
+ ...(body.participants === undefined
396
+ ? {}
397
+ : { participants: [...new Set(body.participants.map((id) => id.toLowerCase()))] }),
394
398
  threadId: body.thread_id,
395
399
  replyTo: body.reply_to,
396
400
  memberId: body.member_id,
@@ -359,7 +359,10 @@ chats) {
359
359
  query: chatPeopleQuery(chat),
360
360
  })
361
361
  .pipe(Effect.mapError((cause) => new ActionRejected({ message: "The chat's person could not be read.", cause })))).items;
362
- if (people.length !== 1) {
362
+ // A thread's chat on a mailbox has no one person to answer: staff answer it in the mail.
363
+ const mailThread = chatKind(ontology.manifest.chat, String(record.provider)) === "email" &&
364
+ !(typeof record.recipient === "string" && record.recipient !== "");
365
+ if (people.length !== 1 || mailThread) {
363
366
  return yield* new ActionRejected({
364
367
  message: "The chat has no person to answer. Nothing was sent.",
365
368
  });
@@ -1,5 +1,5 @@
1
1
  import { Effect } from "effect";
2
- import { addressesOfReview, AGENT_REVIEW_TEXT_LIMIT } from "../../agent-review.js";
2
+ import { addressesOfReview, AGENT_REVIEW_TEXT_LIMIT, participantsOfReview, } from "../../agent-review.js";
3
3
  import { EMAIL_RECIPIENTS_LIMIT, emailRecipients } from "../../email.js";
4
4
  import { ActionRejected, PermissionDenied } from "../../errors.js";
5
5
  import { effectiveScope } from "../../permissions.js";
@@ -183,7 +183,14 @@ export function reviewSender(input) {
183
183
  provider: providerName,
184
184
  external_id: externalId,
185
185
  kind,
186
- participantIds: person === null ? [] : [person],
186
+ // The reply is its person's and, in a chat several people share, such as an email thread,
187
+ // the members the agent named as its readers, as a reply it sent itself would be.
188
+ participantIds: [
189
+ ...new Set([
190
+ ...(person === null ? [] : [person]),
191
+ ...participantsOfReview(review.participants),
192
+ ]),
193
+ ],
187
194
  };
188
195
  const preview = {
189
196
  chatId: target.id,
@@ -664,9 +664,12 @@ export interface AgentStore {
664
664
  }) => Effect.Effect<SeenChat>;
665
665
  /**
666
666
  * Records a person's private chat with the agent for the inbox: creates the `agent_chat` of kind
667
- * `private`, with the person as its one member, or keeps its title, recipient and thread current,
667
+ * `private`, with the person as its one member (one of its members for a `shared` chat, such as
668
+ * an email thread several people write in), or keeps its title, recipient and thread current,
668
669
  * and records when it last had a message, as `seeChat` does. `undefined`, recording nothing,
669
- * unless the person is an active member holding a role of the ontology's `inbox`. Without
670
+ * unless the person is an active member holding a role of the ontology's `inbox`; in a `shared`
671
+ * chat recorded already, a member without one does not join it, and is answered whether staff
672
+ * hold it. Without
670
673
  * `memberId`, the chat is someone's who is no user: recorded without members, whose members it
671
674
  * leaves as they are, and only on a channel `inbox.channels` lists; no user is created. Absent
672
675
  * on stores that predate the inbox.
@@ -744,6 +747,11 @@ export interface HeldReplyInput {
744
747
  readonly to?: ReadonlyArray<string>;
745
748
  /** A reply to mail: the addresses it copies, in `Cc`; none when absent. */
746
749
  readonly cc?: ReadonlyArray<string>;
750
+ /**
751
+ * A reply in a chat several people share, such as an email thread: the members who read it in
752
+ * the chat's history, by user id; its member alone when absent.
753
+ */
754
+ readonly participants?: ReadonlyArray<string>;
747
755
  readonly threadId: string;
748
756
  readonly replyTo: string | null;
749
757
  readonly memberId: string;
@@ -774,6 +782,11 @@ export interface InboxChatInput {
774
782
  readonly recipient?: string;
775
783
  /** The thread a reply stays in. */
776
784
  readonly threadId?: string;
785
+ /**
786
+ * A private chat several people write in, such as an email thread: `memberId` joins its members
787
+ * and no member leaves it. Each message names who reads it.
788
+ */
789
+ readonly shared?: true;
777
790
  }
778
791
  /** The review a held reply became. */
779
792
  export interface HeldReview {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/ontology",
3
- "version": "0.154.0",
3
+ "version": "0.155.0",
4
4
  "description": "Define a SegmentStream workspace app's ontology: entities, relationships, roles and actions, written with Effect.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "SegmentStream",