@segmentstream/ontology 0.201.0 → 0.202.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,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.202.0
4
+
5
+ A member of staff answers the chat of someone the agent never admitted. Recording a channel
6
+ (`record: "all"`) with the channel in `inbox.channels` registers such a chat without a member, for
7
+ example a supplier's mail or a WhatsApp number that wrote in. Until now `agent_chat.send` refused
8
+ it in either voice ("The chat has no person to answer"). A member now answers it from their own
9
+ session in their own voice, `as: "me"`, under `agent_chat:post_message` within a scope that holds
10
+ the record. The reply goes to the address or account the chat names, and staff alone read it. The
11
+ agent's voice, workflows, services and `agent_chat.draft` stay refused, since nothing unattended
12
+ answers people no one admitted. A chat of several members outside a shared thread stays refused.
13
+
14
+ ## 0.201.1
15
+
16
+ `chat_send` and `chat_post_message` tell agents to mention the particular people a group-chat
17
+ message is for, @username on Telegram and <@ID> on Slack, from their `user_identity` records:
18
+ a name alone notifies no one.
19
+
3
20
  ## 0.201.0
4
21
 
5
22
  Staff choose whom a reply to mail goes to. In an inbox chat on a mailbox, `agent_chat.send` takes
@@ -392,6 +392,9 @@ export const AgentChat = entity("agent_chat", {
392
392
  "sender attribution, except in your own reply in the inbox where its attribution is none. " +
393
393
  "Nothing else chooses the sender. text is Markdown (bold, italic, code, lists, " +
394
394
  "[text](url)); each channel renders it natively and degrades constructs it can't show. " +
395
+ "To address particular people in a group chat, mention each so they are notified: " +
396
+ "@username on Telegram, <@ID> on Slack, from their user_identity records; a name alone " +
397
+ "notifies no one. " +
395
398
  "Ambiguous titles require an explicit ID; a scoped grant names the chat by its agent_chat " +
396
399
  "record. Confirm the full final text, attribution and destination before calling. The " +
397
400
  "agent's tasks cannot call it, and its sessions do not send as the agent: a task's workflow " +
@@ -413,7 +416,9 @@ export const AgentChat = entity("agent_chat", {
413
416
  "reads, to required with cc; confirm its recipients with the member first. A person's own " +
414
417
  "chat keeps its person among them (refusal recipient_required); addresses that are no " +
415
418
  "plain addresses, or more than 50, are refused with recipients_invalid, and another chat " +
416
- "refuses them with recipients_unsupported, each before the key is spent.",
419
+ "refuses them with recipients_unsupported, each before the key is spent. The chat of someone " +
420
+ "the agent never admitted, which the inbox registered without a member, takes only a " +
421
+ "member's reply as me, to whom it names.",
417
422
  // Each voice needs its own permission, which the delivery checks: either opens the action.
418
423
  permission: ["agent_chat:send", "agent_chat:post_message"],
419
424
  input: ChatSendInput,
@@ -434,7 +439,9 @@ export const AgentChat = entity("agent_chat", {
434
439
  description: "Post to an eligible chat ID or exact title, as send with as me does. text is Markdown " +
435
440
  "(bold, italic, code, lists, [text](url)); each channel renders it natively and degrades " +
436
441
  "constructs it can't show. The exact Markdown source is posted; the platform adds the " +
437
- "sender attribution. Ambiguous titles require an explicit ID. Confirm the full final text, " +
442
+ "sender attribution. To address particular people in a group chat, mention each: @username " +
443
+ "on Telegram, <@ID> on Slack, from their user_identity records. Ambiguous titles require " +
444
+ "an explicit ID. Confirm the full final text, " +
438
445
  "attribution and destination before calling. Reuse the same idempotency key on replay; an " +
439
446
  "uncertain operation is never resent.",
440
447
  input: ChatPostInput,
@@ -445,7 +445,15 @@ chats) {
445
445
  threadId !== null &&
446
446
  channelProvider(ontology.manifest.chat, String(record.provider))?.threadRecipients !==
447
447
  undefined;
448
- if (!shared && people.length !== 1) {
448
+ // A chat of several members outside a shared thread has no one person to answer. A chat no
449
+ // one was admitted to, which recording the channel registered, has none yet: a member of
450
+ // staff answers whom it names in their own voice. The agent never admitted its person, and
451
+ // a workflow or a service would answer it unattended, as an auto-responder to strangers. A
452
+ // member answers from their own session in the app or their own MCP client.
453
+ const staffReply = permission === "agent_chat:post_message" &&
454
+ (context.caller.kind === "member" || context.caller.kind === "oauth") &&
455
+ context.principal.kind === "member";
456
+ if (!shared && (people.length > 1 || (people.length === 0 && !staffReply))) {
449
457
  return yield* new ActionRejected({
450
458
  message: "The chat has no person to answer. Nothing was sent.",
451
459
  });
@@ -461,7 +469,7 @@ chats) {
461
469
  provider: String(record.provider),
462
470
  external_id: recipient,
463
471
  kind: "private",
464
- participantIds: shared ? [] : [String(people[0].id)],
472
+ participantIds: shared || people[0] === undefined ? [] : [String(people[0].id)],
465
473
  },
466
474
  chatId,
467
475
  threadId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/ontology",
3
- "version": "0.201.0",
3
+ "version": "0.202.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",