@segmentstream/ontology 0.150.0 → 0.150.2

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.150.2
4
+
5
+ `@segmentstream/ontology/whatsapp` exports `WHATSAPP_REFUSALS`, Meta's error codes the chat names
6
+ by its refusal codes (`outside_reply_window`, `recipient_unreachable`, `recipient_opted_out`), so
7
+ the agent keeps a failure Meta reports later with the same code the ontology keeps a refused send
8
+ with.
9
+
10
+ ## 0.150.1
11
+
12
+ The workspace chat store's code takes the time of a message's disposition when Cloud copies what
13
+ the agent did before the store, so a copied decision keeps its own time. The runtime routes are
14
+ unchanged: a disposition the agent records is stamped when it is recorded.
15
+
3
16
  ## 0.150.0
4
17
 
5
18
  The chat store's runtime routes take what the agent's dispatch needs: `release`, a change that gives
@@ -134,6 +134,11 @@ export type ChatMessageChange =
134
134
  readonly reason?: string;
135
135
  readonly sessionId?: string;
136
136
  readonly turnId?: string;
137
+ /**
138
+ * When the agent did it, for a copy of what it did before the store; now otherwise. The
139
+ * runtime routes never take it.
140
+ */
141
+ readonly at?: string;
137
142
  }) | {
138
143
  readonly change: "sent";
139
144
  readonly channel: string;
@@ -406,7 +406,7 @@ export function sqlChatMessageStore(sql) {
406
406
  const expired = `"disposition_at" < now() - interval '${CHAT_CLAIM_MINUTES} minutes'`;
407
407
  const assignments = [
408
408
  `"disposition" = ${params.add(input.disposition, "text")}`,
409
- `"disposition_at" = now()`,
409
+ `"disposition_at" = ${input.at === undefined ? "now()" : params.add(input.at, "timestamptz")}`,
410
410
  input.disposition === "claimed"
411
411
  ? `"reason" = ${reason}`
412
412
  : `"reason" = coalesce(${reason}, "reason")`,
@@ -12,3 +12,9 @@ export declare function literalWhatsAppText(text: string): string;
12
12
  * attribution in italics. Neither can open or close the member's formatting.
13
13
  */
14
14
  export declare function renderWhatsApp(text: string, attribution: string, separator?: string): string;
15
+ /**
16
+ * Meta's refusals the chat names, by Meta's error code: what Meta answers when it refuses a message
17
+ * at once, and what a `failed` delivery status reports later of one it accepted. The agent keeps a
18
+ * status's refusal in the message's `failure` with the same code the ontology keeps a send's with.
19
+ */
20
+ export { REFUSALS as WHATSAPP_REFUSALS } from "./service/chat/providers/whatsapp-refusals.js";
package/dist/whatsapp.js CHANGED
@@ -29,3 +29,9 @@ export function renderWhatsApp(text, attribution, separator = "\n\n") {
29
29
  ? text
30
30
  : `${text}${literalWhatsAppText(separator)}_${literalWhatsAppText(attribution)}_`;
31
31
  }
32
+ /**
33
+ * Meta's refusals the chat names, by Meta's error code: what Meta answers when it refuses a message
34
+ * at once, and what a `failed` delivery status reports later of one it accepted. The agent keeps a
35
+ * status's refusal in the message's `failure` with the same code the ontology keeps a send's with.
36
+ */
37
+ export { REFUSALS as WHATSAPP_REFUSALS } from "./service/chat/providers/whatsapp-refusals.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/ontology",
3
- "version": "0.150.0",
3
+ "version": "0.150.2",
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",