@segmentstream/ontology 0.139.1 → 0.139.3

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,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.139.3
4
+
5
+ An approved reply in a Slack direct message is archived in the person's direct message, beside
6
+ their messages, whatever thread it answers, where it was archived under the thread. The agent's
7
+ session, the `whenUnsure` review and the inbox now see it there. It is still sent in the thread it
8
+ answers.
9
+
10
+ ## 0.139.2
11
+
12
+ A webhook, the guests' bot check or a workspace channel that moves from a workspace secret to a
13
+ verification value of its connection keeps its value: the deploy that makes the change moves the
14
+ secret's value into the connection without reading it, so nobody pastes it again. `check`'s
15
+ `named-secret-deprecated` warning says so, and the guests' `botCheck.secret` now works until
16
+ 2027-01-19, like every other form that names a workspace secret. `segmentstream deploy` and
17
+ `segmentstream secret list` print `notice[named_secret]` for each place the production deployment
18
+ still reads a workspace secret by name, with the change to make.
19
+
20
+ Action required: a webhook's `signature.secret` or `verification.verifyToken`, the guests'
21
+ `botCheck.secret` and a workspace channel's `channels.<name>.secret` stop working after
22
+ 2027-01-19. Make the change each `notice[named_secret]` names: declare the value on the
23
+ connection (`verification={...}`, or `TurnstileConnection(key="turnstile")` for the bot check),
24
+ name it with `input`, change every place that names the same secret in one commit, and deploy.
25
+ That deploy moves the value; do not ask anyone to paste it, and do not delete the workspace secret.
26
+
3
27
  ## 0.139.1
4
28
 
5
29
  A WhatsApp message Meta accepts and later reports it could not deliver, in a `failed` delivery
package/dist/analyze.js CHANGED
@@ -770,7 +770,13 @@ function resolveWorkflows(input) {
770
770
  /** @legacy ontology.webhook-named-secrets: the last day a webhook reads a workspace secret. */
771
771
  const WEBHOOK_NAMED_SECRETS_END = "2027-01-19";
772
772
  /** @legacy ontology.guest-bot-check-secret: the last day the bot check reads a workspace secret. */
773
- const GUEST_BOT_CHECK_SECRET_ENDS = "2026-12-21";
773
+ const GUEST_BOT_CHECK_SECRET_ENDS = "2027-01-19";
774
+ /**
775
+ * @legacy ontology.webhook-named-secrets: the deploy that replaces a named secret with a connection
776
+ * value moves the secret's value into it.
777
+ */
778
+ const MOVED_AT_DEPLOY = "The deploy that makes this change moves the secret's value into the connection, so nobody " +
779
+ "enters it again: change every place that names the secret in that deploy.";
774
780
  let deliveryJsonSchema;
775
781
  /**
776
782
  * The JSON Schema of `webhookDelivery`, the input every webhook-started workflow declares, as the
@@ -841,7 +847,8 @@ function resolveWebhookTrigger(trigger, at, scope) {
841
847
  for (const path of named) {
842
848
  report("named-secret-deprecated", path, `a workspace secret works for a webhook only until ${WEBHOOK_NAMED_SECRETS_END}: declare ` +
843
849
  "it as a verification value of the webhook's connection, " +
844
- 'verification={"webhook_signing_secret": Secret(...)}, and name it with input.', "warning");
850
+ 'verification={"webhook_signing_secret": Secret(...)}, and name it with input. ' +
851
+ MOVED_AT_DEPLOY, "warning");
845
852
  }
846
853
  }
847
854
  const headers = trigger.headers;
@@ -1893,7 +1900,8 @@ function guestBotCheck(value, report, connections) {
1893
1900
  valid = false;
1894
1901
  }
1895
1902
  if (valid) {
1896
- report("named-secret-deprecated", "guest.botCheck.secret", `a workspace secret works as the bot check's secret key only until ${GUEST_BOT_CHECK_SECRET_ENDS}. ${shape}`, "warning");
1903
+ report("named-secret-deprecated", "guest.botCheck.secret", `a workspace secret works as the bot check's secret key only until ` +
1904
+ `${GUEST_BOT_CHECK_SECRET_ENDS}. ${shape} ${MOVED_AT_DEPLOY}`, "warning");
1897
1905
  }
1898
1906
  return valid && typeof secret === "string"
1899
1907
  ? { scheme: scheme, secret }
@@ -73,6 +73,13 @@ export interface ChatProvider {
73
73
  * only sends replies the agent held for review, such as email. Omitted, it is `true`.
74
74
  */
75
75
  readonly posts?: boolean;
76
+ /**
77
+ * Whether a private chat is one chat whatever thread its messages are in, as a Slack direct
78
+ * message is: the archive keeps a reply to it without a thread, while the reply is still sent in
79
+ * the thread it answers. Omitted, a private chat's thread is part of the chat, as a person's
80
+ * Gmail thread is.
81
+ */
82
+ readonly privateChatSpansThreads?: boolean;
76
83
  /** Whether an id names a chat of this kind on the provider. */
77
84
  readonly isTargetId: (externalId: string, kind: Destination["kind"]) => boolean;
78
85
  /** Whether an id names a message on the provider that a post may reply to. */
@@ -83,6 +83,7 @@ export function sendSlack(input) {
83
83
  export const slackProvider = {
84
84
  provider: "slack",
85
85
  limit: SLACK_MESSAGE_LIMIT,
86
+ privateChatSpansThreads: true,
86
87
  // Channels are `C…`, older private channels `G…`; a private destination is its member's user
87
88
  // id, `U…`, or `W…` in an Enterprise Grid organization.
88
89
  isTargetId: (externalId, kind) => (kind === "group" ? /^[CG][A-Z0-9]{2,32}$/ : /^[UW][A-Z0-9]{2,32}$/).test(externalId),
@@ -88,6 +88,9 @@ export function reviewSender(input) {
88
88
  const chatId = String(review.chat_id);
89
89
  const externalId = typeof review.recipient === "string" && review.recipient !== "" ? review.recipient : chatId;
90
90
  const threadId = typeof review.thread_id === "string" && review.thread_id !== "" ? review.thread_id : null;
91
+ // The reply is sent in the thread it answers and archived in the chat that keeps the
92
+ // person's messages, where the agent and the judge read it.
93
+ const archivedThreadId = kind === "private" && provider.privateChatSpansThreads === true ? null : threadId;
91
94
  // A private chat has one person: the reply needs no quote of their message, which
92
95
  // they may have deleted since.
93
96
  const replyTo = kind === "group" && typeof review.reply_to === "string" && review.reply_to !== ""
@@ -163,7 +166,7 @@ export function reviewSender(input) {
163
166
  provider: providerName,
164
167
  chatId,
165
168
  chatType: kind,
166
- threadId,
169
+ threadId: archivedThreadId,
167
170
  participantIds: target.participantIds,
168
171
  senderId: "agent",
169
172
  senderName: "agent",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/ontology",
3
- "version": "0.139.1",
3
+ "version": "0.139.3",
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",