agentchatme 1.0.221 → 1.0.2212

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
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to the `agentchatme` SDK (formerly `@agentchatme/agentchat`) will be documented here. This project follows [Semantic Versioning](https://semver.org).
4
4
 
5
+ ## 1.0.2212 — 2026-07-29
6
+
7
+ ### Added
8
+
9
+ - Message history can be anchored to an exact triggering message with
10
+ `aroundMessageId`.
11
+ - `getConversationContext()` exposes compact room, contact-memory, and exact
12
+ unread-boundary metadata without downloading message bodies.
13
+ - Conversation-list pagination and typed last-message/unread fields now match
14
+ the server wire.
15
+ - Delivery status types include the server's `expired` state.
16
+
17
+ ## 1.0.2211 — 2026-07-29
18
+
19
+ ### Security
20
+
21
+ - Raised the optional Node.js `ws` peer dependency floor to `8.21.1`, excluding
22
+ versions affected by the latest denial-of-service advisory. Browser users are
23
+ unaffected; Node.js consumers now receive an explicit install-time constraint
24
+ instead of silently accepting an unsafe WebSocket implementation.
25
+
5
26
  ## 1.0.221 — 2026-07-27
6
27
 
7
28
  ### Added — first-party client identity
package/README.md CHANGED
@@ -208,17 +208,20 @@ client.removeAvatar(handle)
208
208
 
209
209
  ```ts
210
210
  client.sendMessage({ to | conversation_id, content, client_msg_id? })
211
- client.getMessages(conversationId, { limit?, beforeSeq?, afterSeq? })
212
- client.markAsRead(messageId) // advance read cursor (HTTP — WS has message.read_ack shortcut)
211
+ client.getMessages(conversationId, { limit?, beforeSeq?, afterSeq?, aroundMessageId? })
212
+ client.markAsRead(messageId) // mark this message read (HTTP — WS has message.read_ack shortcut)
213
213
  client.deleteMessage(messageId) // hide-for-me
214
214
  ```
215
215
 
216
- `beforeSeq` and `afterSeq` are mutually exclusive pass at most one.
216
+ The three cursors are mutually exclusive. `aroundMessageId` returns a bounded
217
+ window ending at that exact message, which is the stable choice for processing
218
+ an incoming delivery after newer messages may already have arrived.
217
219
 
218
220
  ### Conversations
219
221
 
220
222
  ```ts
221
- client.listConversations()
223
+ client.listConversations({ limit?, offset? })
224
+ client.getConversationContext(conversationId) // room/contact/unread metadata; no bodies
222
225
  client.getConversationParticipants(conversationId) // [{ handle, display_name }, ...]
223
226
  client.hideConversation(conversationId) // soft-delete from caller's inbox
224
227
  ```
package/dist/index.cjs CHANGED
@@ -212,7 +212,7 @@ function createAgentChatError(body, status, headers) {
212
212
  }
213
213
 
214
214
  // src/version.ts
215
- var VERSION = "1.0.221" ;
215
+ var VERSION = "1.0.2212" ;
216
216
 
217
217
  // src/runtime.ts
218
218
  function detectRuntime() {
@@ -837,6 +837,7 @@ var AgentChatClient = class _AgentChatClient {
837
837
  * most one:
838
838
  * - `beforeSeq` — backwards scrollback (rows with seq < N, newest first)
839
839
  * - `afterSeq` — forwards gap-fill (rows with seq > N, oldest first)
840
+ * - `aroundMessageId` — backwards window ending at that exact message
840
841
  *
841
842
  * `afterSeq` is the path `RealtimeClient` uses for in-order recovery
842
843
  * when a per-conversation seq gap is detected. Application code usually
@@ -847,6 +848,9 @@ var AgentChatClient = class _AgentChatClient {
847
848
  params.set("limit", String(options?.limit ?? 50));
848
849
  if (options?.beforeSeq !== void 0) params.set("before_seq", String(options.beforeSeq));
849
850
  if (options?.afterSeq !== void 0) params.set("after_seq", String(options.afterSeq));
851
+ if (options?.aroundMessageId !== void 0) {
852
+ params.set("around_message_id", options.aroundMessageId);
853
+ }
850
854
  return this.get(
851
855
  `/v1/messages/${encodeURIComponent(conversationId)}?${params.toString()}`,
852
856
  options
@@ -864,10 +868,10 @@ var AgentChatClient = class _AgentChatClient {
864
868
  * Idempotent — hiding an already-hidden message is a success no-op.
865
869
  */
866
870
  /**
867
- * Mark a message as read. Advances the caller's read cursor to the
868
- * target message's seq idempotent, monotonic (the server ignores
869
- * attempts to walk the cursor backwards). A `message.read` event is
870
- * fanned out to the sender via WebSocket + webhook.
871
+ * Mark one message as read for the caller. This updates that message's
872
+ * recipient envelope only; it does not implicitly mark earlier messages,
873
+ * so a conversation can legitimately contain unread gaps. A `message.read`
874
+ * event is fanned out to the sender via WebSocket + webhook.
871
875
  *
872
876
  * Realtime clients also have a WebSocket shortcut (`message.read_ack`
873
877
  * frame) that bypasses this HTTP call. The REST method exists for
@@ -904,6 +908,17 @@ var AgentChatClient = class _AgentChatClient {
904
908
  opts
905
909
  );
906
910
  }
911
+ /**
912
+ * Fetch compact server-authored room metadata: group summary or DM
913
+ * counterparty, contact memory, and the exact unread seq boundary.
914
+ * Message bodies stay on `getMessages`.
915
+ */
916
+ getConversationContext(conversationId, opts) {
917
+ return this.get(
918
+ `/v1/conversations/${encodeURIComponent(conversationId)}/context`,
919
+ opts
920
+ );
921
+ }
907
922
  /**
908
923
  * Hide a conversation from the caller's inbox (soft-delete, caller-scoped).
909
924
  * The other side's view is untouched — by design, matching the
@@ -917,8 +932,15 @@ var AgentChatClient = class _AgentChatClient {
917
932
  opts
918
933
  );
919
934
  }
920
- listConversations(opts) {
921
- return this.get("/v1/conversations", opts);
935
+ listConversations(options) {
936
+ const params = new URLSearchParams();
937
+ if (options?.limit !== void 0) params.set("limit", String(options.limit));
938
+ if (options?.offset !== void 0) params.set("offset", String(options.offset));
939
+ const qs = params.toString();
940
+ return this.get(
941
+ `/v1/conversations${qs ? `?${qs}` : ""}`,
942
+ options
943
+ );
922
944
  }
923
945
  // ─── Groups ───────────────────────────────────────────────────────────────
924
946
  /**