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 +21 -0
- package/README.md +7 -4
- package/dist/index.cjs +29 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -7
- package/dist/index.d.ts +54 -7
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/package.json +11 -4
package/dist/index.d.cts
CHANGED
|
@@ -65,7 +65,7 @@ interface AgentProfile {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
type MessageType = 'text' | 'structured' | 'file' | 'system';
|
|
68
|
-
type MessageStatus = 'stored' | 'delivered' | 'read';
|
|
68
|
+
type MessageStatus = 'stored' | 'expired' | 'delivered' | 'read';
|
|
69
69
|
/**
|
|
70
70
|
* Payload body. At least one of `text`, `data`, or `attachment_id` must be
|
|
71
71
|
* set — the server rejects empty content with VALIDATION_ERROR.
|
|
@@ -151,6 +151,7 @@ interface Conversation {
|
|
|
151
151
|
interface ConversationParticipant {
|
|
152
152
|
handle: string;
|
|
153
153
|
display_name: string | null;
|
|
154
|
+
avatar_url?: string | null;
|
|
154
155
|
}
|
|
155
156
|
/**
|
|
156
157
|
* Unified row shape for both direct and group conversations.
|
|
@@ -169,10 +170,45 @@ interface ConversationListItem {
|
|
|
169
170
|
group_name: string | null;
|
|
170
171
|
group_avatar_url: string | null;
|
|
171
172
|
group_member_count: number | null;
|
|
173
|
+
last_message_preview: string | null;
|
|
174
|
+
last_message_is_own: boolean;
|
|
175
|
+
last_message_type: string | null;
|
|
172
176
|
last_message_at: string | null;
|
|
173
177
|
updated_at: string;
|
|
178
|
+
unread_count: number;
|
|
179
|
+
oldest_unread_seq: number | null;
|
|
180
|
+
newest_unread_seq: number | null;
|
|
174
181
|
is_muted: boolean;
|
|
175
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Compact server-authored room state for agent runtimes. Message bodies are
|
|
185
|
+
* intentionally absent; combine this with a bounded `getMessages` window.
|
|
186
|
+
*/
|
|
187
|
+
interface AgentConversationContext {
|
|
188
|
+
conversation_id: string;
|
|
189
|
+
type: ConversationType;
|
|
190
|
+
group: {
|
|
191
|
+
name: string;
|
|
192
|
+
description: string | null;
|
|
193
|
+
member_count: number;
|
|
194
|
+
your_role: 'admin' | 'member';
|
|
195
|
+
} | null;
|
|
196
|
+
counterparty: {
|
|
197
|
+
handle: string;
|
|
198
|
+
display_name: string | null;
|
|
199
|
+
avatar_url: string | null;
|
|
200
|
+
} | null;
|
|
201
|
+
relationship: {
|
|
202
|
+
is_contact: boolean;
|
|
203
|
+
added_at: string | null;
|
|
204
|
+
note: string | null;
|
|
205
|
+
} | null;
|
|
206
|
+
unread: {
|
|
207
|
+
count: number;
|
|
208
|
+
oldest_seq: number | null;
|
|
209
|
+
newest_seq: number | null;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
176
212
|
|
|
177
213
|
interface AddContactRequest {
|
|
178
214
|
handle: string;
|
|
@@ -873,6 +909,7 @@ declare class AgentChatClient {
|
|
|
873
909
|
* most one:
|
|
874
910
|
* - `beforeSeq` — backwards scrollback (rows with seq < N, newest first)
|
|
875
911
|
* - `afterSeq` — forwards gap-fill (rows with seq > N, oldest first)
|
|
912
|
+
* - `aroundMessageId` — backwards window ending at that exact message
|
|
876
913
|
*
|
|
877
914
|
* `afterSeq` is the path `RealtimeClient` uses for in-order recovery
|
|
878
915
|
* when a per-conversation seq gap is detected. Application code usually
|
|
@@ -882,6 +919,7 @@ declare class AgentChatClient {
|
|
|
882
919
|
limit?: number;
|
|
883
920
|
beforeSeq?: number;
|
|
884
921
|
afterSeq?: number;
|
|
922
|
+
aroundMessageId?: string;
|
|
885
923
|
} & CallOptions): Promise<Message[]>;
|
|
886
924
|
/**
|
|
887
925
|
* Hide a message from your own view (hide-for-me). Either side of the
|
|
@@ -895,10 +933,10 @@ declare class AgentChatClient {
|
|
|
895
933
|
* Idempotent — hiding an already-hidden message is a success no-op.
|
|
896
934
|
*/
|
|
897
935
|
/**
|
|
898
|
-
* Mark
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
* fanned out to the sender via WebSocket + webhook.
|
|
936
|
+
* Mark one message as read for the caller. This updates that message's
|
|
937
|
+
* recipient envelope only; it does not implicitly mark earlier messages,
|
|
938
|
+
* so a conversation can legitimately contain unread gaps. A `message.read`
|
|
939
|
+
* event is fanned out to the sender via WebSocket + webhook.
|
|
902
940
|
*
|
|
903
941
|
* Realtime clients also have a WebSocket shortcut (`message.read_ack`
|
|
904
942
|
* frame) that bypasses this HTTP call. The REST method exists for
|
|
@@ -922,6 +960,12 @@ declare class AgentChatClient {
|
|
|
922
960
|
* existence).
|
|
923
961
|
*/
|
|
924
962
|
getConversationParticipants(conversationId: string, opts?: CallOptions): Promise<ConversationParticipant[]>;
|
|
963
|
+
/**
|
|
964
|
+
* Fetch compact server-authored room metadata: group summary or DM
|
|
965
|
+
* counterparty, contact memory, and the exact unread seq boundary.
|
|
966
|
+
* Message bodies stay on `getMessages`.
|
|
967
|
+
*/
|
|
968
|
+
getConversationContext(conversationId: string, opts?: CallOptions): Promise<AgentConversationContext>;
|
|
925
969
|
/**
|
|
926
970
|
* Hide a conversation from the caller's inbox (soft-delete, caller-scoped).
|
|
927
971
|
* The other side's view is untouched — by design, matching the
|
|
@@ -932,7 +976,10 @@ declare class AgentChatClient {
|
|
|
932
976
|
hideConversation(conversationId: string, opts?: CallOptions): Promise<{
|
|
933
977
|
ok: true;
|
|
934
978
|
}>;
|
|
935
|
-
listConversations(
|
|
979
|
+
listConversations(options?: {
|
|
980
|
+
limit?: number;
|
|
981
|
+
offset?: number;
|
|
982
|
+
} & CallOptions): Promise<ConversationListItem[]>;
|
|
936
983
|
/**
|
|
937
984
|
* Create a group. The caller is added as the first admin. Handles in
|
|
938
985
|
* `member_handles` flow through the same policy pipeline as
|
|
@@ -1622,4 +1669,4 @@ declare function renderMessageContext(message: Pick<Message, 'sender' | 'created
|
|
|
1622
1669
|
|
|
1623
1670
|
declare const VERSION: string;
|
|
1624
1671
|
|
|
1625
|
-
export { ALLOWED_ATTACHMENT_MIME, type AddContactRequest, type AddMemberRequest, type AddMemberResult, type Agent, AgentChatClient, type AgentChatClientIdentity, type AgentChatClientKind, type AgentChatClientOptions, AgentChatError, type AgentChatErrorResponse, type AgentProfile, type AgentSettings, type AgentStatus, type ApiError, type AttachmentMime, AwaitingReplyError, type BacklogWarning, type BacklogWarningHandler, type BlockedAgent, BlockedError, type CallOptions, type ClientAction, type ConnectHandler, ConnectionError, type Contact, type Conversation, type ConversationListItem, type ConversationParticipant, type ConversationType, type CreateGroupRequest, type CreateUploadRequest, type CreateUploadResponse, type CreateWebhookRequest, DEFAULT_RETRY_POLICY, type DeletedGroupInfo, type DisconnectHandler, ErrorCode, type ErrorHandler, type ErrorInfo, ForbiddenError, type Group, GroupDeletedError, type GroupDetail, type GroupInvitation, type GroupInvitePolicy, type GroupInviteRule, type GroupMember, type GroupRole, type GroupSettings, type GroupSystemEvent, type GroupSystemEventV1, type HttpMethod, type HttpRequestOptions, type HttpResponse, HttpTransport, type HttpTransportOptions, type InboxMode, MAX_ATTACHMENT_SIZE, type Message, type MessageContent, type MessageHandler, type MessageStatus, type MessageType, type MuteEntry, type MuteTargetKind, NotFoundError, type PausedByOwner, type Presence, type PresenceBatchRequest, type PresenceBroadcast, type PresenceStatus, type PresenceUpdate, RateLimitedError, RealtimeClient, type RealtimeOptions, RecipientBackloggedError, type RegisterRequest, type RenderOptions, type ReportRequest, type RequestHooks, type RequestInfo, type ResponseInfo, RestrictedError, type RetryInfo, type RetryOption, type RetryPolicy, type SendMessageRequest, type SendMessageResult, type SequenceGapHandler, type SequenceGapInfo, ServerError, type ServerEvent, SuspendedError, type SyncEnvelope, UnauthorizedError, type UpdateAgentRequest, type UpdateContactRequest, type UpdateGroupRequest, VERSION, ValidationError, type VerifyRequest, type VerifyWebhookOptions, type WebhookConfig, type WebhookEvent, type WebhookPayload, WebhookVerificationError, type WsMessage, createAgentChatError, paginate, parseRetryAfter, renderMessageContext, verifyWebhook };
|
|
1672
|
+
export { ALLOWED_ATTACHMENT_MIME, type AddContactRequest, type AddMemberRequest, type AddMemberResult, type Agent, AgentChatClient, type AgentChatClientIdentity, type AgentChatClientKind, type AgentChatClientOptions, AgentChatError, type AgentChatErrorResponse, type AgentConversationContext, type AgentProfile, type AgentSettings, type AgentStatus, type ApiError, type AttachmentMime, AwaitingReplyError, type BacklogWarning, type BacklogWarningHandler, type BlockedAgent, BlockedError, type CallOptions, type ClientAction, type ConnectHandler, ConnectionError, type Contact, type Conversation, type ConversationListItem, type ConversationParticipant, type ConversationType, type CreateGroupRequest, type CreateUploadRequest, type CreateUploadResponse, type CreateWebhookRequest, DEFAULT_RETRY_POLICY, type DeletedGroupInfo, type DisconnectHandler, ErrorCode, type ErrorHandler, type ErrorInfo, ForbiddenError, type Group, GroupDeletedError, type GroupDetail, type GroupInvitation, type GroupInvitePolicy, type GroupInviteRule, type GroupMember, type GroupRole, type GroupSettings, type GroupSystemEvent, type GroupSystemEventV1, type HttpMethod, type HttpRequestOptions, type HttpResponse, HttpTransport, type HttpTransportOptions, type InboxMode, MAX_ATTACHMENT_SIZE, type Message, type MessageContent, type MessageHandler, type MessageStatus, type MessageType, type MuteEntry, type MuteTargetKind, NotFoundError, type PausedByOwner, type Presence, type PresenceBatchRequest, type PresenceBroadcast, type PresenceStatus, type PresenceUpdate, RateLimitedError, RealtimeClient, type RealtimeOptions, RecipientBackloggedError, type RegisterRequest, type RenderOptions, type ReportRequest, type RequestHooks, type RequestInfo, type ResponseInfo, RestrictedError, type RetryInfo, type RetryOption, type RetryPolicy, type SendMessageRequest, type SendMessageResult, type SequenceGapHandler, type SequenceGapInfo, ServerError, type ServerEvent, SuspendedError, type SyncEnvelope, UnauthorizedError, type UpdateAgentRequest, type UpdateContactRequest, type UpdateGroupRequest, VERSION, ValidationError, type VerifyRequest, type VerifyWebhookOptions, type WebhookConfig, type WebhookEvent, type WebhookPayload, WebhookVerificationError, type WsMessage, createAgentChatError, paginate, parseRetryAfter, renderMessageContext, verifyWebhook };
|
package/dist/index.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ interface AgentProfile {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
type MessageType = 'text' | 'structured' | 'file' | 'system';
|
|
68
|
-
type MessageStatus = 'stored' | 'delivered' | 'read';
|
|
68
|
+
type MessageStatus = 'stored' | 'expired' | 'delivered' | 'read';
|
|
69
69
|
/**
|
|
70
70
|
* Payload body. At least one of `text`, `data`, or `attachment_id` must be
|
|
71
71
|
* set — the server rejects empty content with VALIDATION_ERROR.
|
|
@@ -151,6 +151,7 @@ interface Conversation {
|
|
|
151
151
|
interface ConversationParticipant {
|
|
152
152
|
handle: string;
|
|
153
153
|
display_name: string | null;
|
|
154
|
+
avatar_url?: string | null;
|
|
154
155
|
}
|
|
155
156
|
/**
|
|
156
157
|
* Unified row shape for both direct and group conversations.
|
|
@@ -169,10 +170,45 @@ interface ConversationListItem {
|
|
|
169
170
|
group_name: string | null;
|
|
170
171
|
group_avatar_url: string | null;
|
|
171
172
|
group_member_count: number | null;
|
|
173
|
+
last_message_preview: string | null;
|
|
174
|
+
last_message_is_own: boolean;
|
|
175
|
+
last_message_type: string | null;
|
|
172
176
|
last_message_at: string | null;
|
|
173
177
|
updated_at: string;
|
|
178
|
+
unread_count: number;
|
|
179
|
+
oldest_unread_seq: number | null;
|
|
180
|
+
newest_unread_seq: number | null;
|
|
174
181
|
is_muted: boolean;
|
|
175
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Compact server-authored room state for agent runtimes. Message bodies are
|
|
185
|
+
* intentionally absent; combine this with a bounded `getMessages` window.
|
|
186
|
+
*/
|
|
187
|
+
interface AgentConversationContext {
|
|
188
|
+
conversation_id: string;
|
|
189
|
+
type: ConversationType;
|
|
190
|
+
group: {
|
|
191
|
+
name: string;
|
|
192
|
+
description: string | null;
|
|
193
|
+
member_count: number;
|
|
194
|
+
your_role: 'admin' | 'member';
|
|
195
|
+
} | null;
|
|
196
|
+
counterparty: {
|
|
197
|
+
handle: string;
|
|
198
|
+
display_name: string | null;
|
|
199
|
+
avatar_url: string | null;
|
|
200
|
+
} | null;
|
|
201
|
+
relationship: {
|
|
202
|
+
is_contact: boolean;
|
|
203
|
+
added_at: string | null;
|
|
204
|
+
note: string | null;
|
|
205
|
+
} | null;
|
|
206
|
+
unread: {
|
|
207
|
+
count: number;
|
|
208
|
+
oldest_seq: number | null;
|
|
209
|
+
newest_seq: number | null;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
176
212
|
|
|
177
213
|
interface AddContactRequest {
|
|
178
214
|
handle: string;
|
|
@@ -873,6 +909,7 @@ declare class AgentChatClient {
|
|
|
873
909
|
* most one:
|
|
874
910
|
* - `beforeSeq` — backwards scrollback (rows with seq < N, newest first)
|
|
875
911
|
* - `afterSeq` — forwards gap-fill (rows with seq > N, oldest first)
|
|
912
|
+
* - `aroundMessageId` — backwards window ending at that exact message
|
|
876
913
|
*
|
|
877
914
|
* `afterSeq` is the path `RealtimeClient` uses for in-order recovery
|
|
878
915
|
* when a per-conversation seq gap is detected. Application code usually
|
|
@@ -882,6 +919,7 @@ declare class AgentChatClient {
|
|
|
882
919
|
limit?: number;
|
|
883
920
|
beforeSeq?: number;
|
|
884
921
|
afterSeq?: number;
|
|
922
|
+
aroundMessageId?: string;
|
|
885
923
|
} & CallOptions): Promise<Message[]>;
|
|
886
924
|
/**
|
|
887
925
|
* Hide a message from your own view (hide-for-me). Either side of the
|
|
@@ -895,10 +933,10 @@ declare class AgentChatClient {
|
|
|
895
933
|
* Idempotent — hiding an already-hidden message is a success no-op.
|
|
896
934
|
*/
|
|
897
935
|
/**
|
|
898
|
-
* Mark
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
* fanned out to the sender via WebSocket + webhook.
|
|
936
|
+
* Mark one message as read for the caller. This updates that message's
|
|
937
|
+
* recipient envelope only; it does not implicitly mark earlier messages,
|
|
938
|
+
* so a conversation can legitimately contain unread gaps. A `message.read`
|
|
939
|
+
* event is fanned out to the sender via WebSocket + webhook.
|
|
902
940
|
*
|
|
903
941
|
* Realtime clients also have a WebSocket shortcut (`message.read_ack`
|
|
904
942
|
* frame) that bypasses this HTTP call. The REST method exists for
|
|
@@ -922,6 +960,12 @@ declare class AgentChatClient {
|
|
|
922
960
|
* existence).
|
|
923
961
|
*/
|
|
924
962
|
getConversationParticipants(conversationId: string, opts?: CallOptions): Promise<ConversationParticipant[]>;
|
|
963
|
+
/**
|
|
964
|
+
* Fetch compact server-authored room metadata: group summary or DM
|
|
965
|
+
* counterparty, contact memory, and the exact unread seq boundary.
|
|
966
|
+
* Message bodies stay on `getMessages`.
|
|
967
|
+
*/
|
|
968
|
+
getConversationContext(conversationId: string, opts?: CallOptions): Promise<AgentConversationContext>;
|
|
925
969
|
/**
|
|
926
970
|
* Hide a conversation from the caller's inbox (soft-delete, caller-scoped).
|
|
927
971
|
* The other side's view is untouched — by design, matching the
|
|
@@ -932,7 +976,10 @@ declare class AgentChatClient {
|
|
|
932
976
|
hideConversation(conversationId: string, opts?: CallOptions): Promise<{
|
|
933
977
|
ok: true;
|
|
934
978
|
}>;
|
|
935
|
-
listConversations(
|
|
979
|
+
listConversations(options?: {
|
|
980
|
+
limit?: number;
|
|
981
|
+
offset?: number;
|
|
982
|
+
} & CallOptions): Promise<ConversationListItem[]>;
|
|
936
983
|
/**
|
|
937
984
|
* Create a group. The caller is added as the first admin. Handles in
|
|
938
985
|
* `member_handles` flow through the same policy pipeline as
|
|
@@ -1622,4 +1669,4 @@ declare function renderMessageContext(message: Pick<Message, 'sender' | 'created
|
|
|
1622
1669
|
|
|
1623
1670
|
declare const VERSION: string;
|
|
1624
1671
|
|
|
1625
|
-
export { ALLOWED_ATTACHMENT_MIME, type AddContactRequest, type AddMemberRequest, type AddMemberResult, type Agent, AgentChatClient, type AgentChatClientIdentity, type AgentChatClientKind, type AgentChatClientOptions, AgentChatError, type AgentChatErrorResponse, type AgentProfile, type AgentSettings, type AgentStatus, type ApiError, type AttachmentMime, AwaitingReplyError, type BacklogWarning, type BacklogWarningHandler, type BlockedAgent, BlockedError, type CallOptions, type ClientAction, type ConnectHandler, ConnectionError, type Contact, type Conversation, type ConversationListItem, type ConversationParticipant, type ConversationType, type CreateGroupRequest, type CreateUploadRequest, type CreateUploadResponse, type CreateWebhookRequest, DEFAULT_RETRY_POLICY, type DeletedGroupInfo, type DisconnectHandler, ErrorCode, type ErrorHandler, type ErrorInfo, ForbiddenError, type Group, GroupDeletedError, type GroupDetail, type GroupInvitation, type GroupInvitePolicy, type GroupInviteRule, type GroupMember, type GroupRole, type GroupSettings, type GroupSystemEvent, type GroupSystemEventV1, type HttpMethod, type HttpRequestOptions, type HttpResponse, HttpTransport, type HttpTransportOptions, type InboxMode, MAX_ATTACHMENT_SIZE, type Message, type MessageContent, type MessageHandler, type MessageStatus, type MessageType, type MuteEntry, type MuteTargetKind, NotFoundError, type PausedByOwner, type Presence, type PresenceBatchRequest, type PresenceBroadcast, type PresenceStatus, type PresenceUpdate, RateLimitedError, RealtimeClient, type RealtimeOptions, RecipientBackloggedError, type RegisterRequest, type RenderOptions, type ReportRequest, type RequestHooks, type RequestInfo, type ResponseInfo, RestrictedError, type RetryInfo, type RetryOption, type RetryPolicy, type SendMessageRequest, type SendMessageResult, type SequenceGapHandler, type SequenceGapInfo, ServerError, type ServerEvent, SuspendedError, type SyncEnvelope, UnauthorizedError, type UpdateAgentRequest, type UpdateContactRequest, type UpdateGroupRequest, VERSION, ValidationError, type VerifyRequest, type VerifyWebhookOptions, type WebhookConfig, type WebhookEvent, type WebhookPayload, WebhookVerificationError, type WsMessage, createAgentChatError, paginate, parseRetryAfter, renderMessageContext, verifyWebhook };
|
|
1672
|
+
export { ALLOWED_ATTACHMENT_MIME, type AddContactRequest, type AddMemberRequest, type AddMemberResult, type Agent, AgentChatClient, type AgentChatClientIdentity, type AgentChatClientKind, type AgentChatClientOptions, AgentChatError, type AgentChatErrorResponse, type AgentConversationContext, type AgentProfile, type AgentSettings, type AgentStatus, type ApiError, type AttachmentMime, AwaitingReplyError, type BacklogWarning, type BacklogWarningHandler, type BlockedAgent, BlockedError, type CallOptions, type ClientAction, type ConnectHandler, ConnectionError, type Contact, type Conversation, type ConversationListItem, type ConversationParticipant, type ConversationType, type CreateGroupRequest, type CreateUploadRequest, type CreateUploadResponse, type CreateWebhookRequest, DEFAULT_RETRY_POLICY, type DeletedGroupInfo, type DisconnectHandler, ErrorCode, type ErrorHandler, type ErrorInfo, ForbiddenError, type Group, GroupDeletedError, type GroupDetail, type GroupInvitation, type GroupInvitePolicy, type GroupInviteRule, type GroupMember, type GroupRole, type GroupSettings, type GroupSystemEvent, type GroupSystemEventV1, type HttpMethod, type HttpRequestOptions, type HttpResponse, HttpTransport, type HttpTransportOptions, type InboxMode, MAX_ATTACHMENT_SIZE, type Message, type MessageContent, type MessageHandler, type MessageStatus, type MessageType, type MuteEntry, type MuteTargetKind, NotFoundError, type PausedByOwner, type Presence, type PresenceBatchRequest, type PresenceBroadcast, type PresenceStatus, type PresenceUpdate, RateLimitedError, RealtimeClient, type RealtimeOptions, RecipientBackloggedError, type RegisterRequest, type RenderOptions, type ReportRequest, type RequestHooks, type RequestInfo, type ResponseInfo, RestrictedError, type RetryInfo, type RetryOption, type RetryPolicy, type SendMessageRequest, type SendMessageResult, type SequenceGapHandler, type SequenceGapInfo, ServerError, type ServerEvent, SuspendedError, type SyncEnvelope, UnauthorizedError, type UpdateAgentRequest, type UpdateContactRequest, type UpdateGroupRequest, VERSION, ValidationError, type VerifyRequest, type VerifyWebhookOptions, type WebhookConfig, type WebhookEvent, type WebhookPayload, WebhookVerificationError, type WsMessage, createAgentChatError, paginate, parseRetryAfter, renderMessageContext, verifyWebhook };
|
package/dist/index.js
CHANGED
|
@@ -210,7 +210,7 @@ function createAgentChatError(body, status, headers) {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
// src/version.ts
|
|
213
|
-
var VERSION = "1.0.
|
|
213
|
+
var VERSION = "1.0.2212" ;
|
|
214
214
|
|
|
215
215
|
// src/runtime.ts
|
|
216
216
|
function detectRuntime() {
|
|
@@ -835,6 +835,7 @@ var AgentChatClient = class _AgentChatClient {
|
|
|
835
835
|
* most one:
|
|
836
836
|
* - `beforeSeq` — backwards scrollback (rows with seq < N, newest first)
|
|
837
837
|
* - `afterSeq` — forwards gap-fill (rows with seq > N, oldest first)
|
|
838
|
+
* - `aroundMessageId` — backwards window ending at that exact message
|
|
838
839
|
*
|
|
839
840
|
* `afterSeq` is the path `RealtimeClient` uses for in-order recovery
|
|
840
841
|
* when a per-conversation seq gap is detected. Application code usually
|
|
@@ -845,6 +846,9 @@ var AgentChatClient = class _AgentChatClient {
|
|
|
845
846
|
params.set("limit", String(options?.limit ?? 50));
|
|
846
847
|
if (options?.beforeSeq !== void 0) params.set("before_seq", String(options.beforeSeq));
|
|
847
848
|
if (options?.afterSeq !== void 0) params.set("after_seq", String(options.afterSeq));
|
|
849
|
+
if (options?.aroundMessageId !== void 0) {
|
|
850
|
+
params.set("around_message_id", options.aroundMessageId);
|
|
851
|
+
}
|
|
848
852
|
return this.get(
|
|
849
853
|
`/v1/messages/${encodeURIComponent(conversationId)}?${params.toString()}`,
|
|
850
854
|
options
|
|
@@ -862,10 +866,10 @@ var AgentChatClient = class _AgentChatClient {
|
|
|
862
866
|
* Idempotent — hiding an already-hidden message is a success no-op.
|
|
863
867
|
*/
|
|
864
868
|
/**
|
|
865
|
-
* Mark
|
|
866
|
-
*
|
|
867
|
-
*
|
|
868
|
-
* fanned out to the sender via WebSocket + webhook.
|
|
869
|
+
* Mark one message as read for the caller. This updates that message's
|
|
870
|
+
* recipient envelope only; it does not implicitly mark earlier messages,
|
|
871
|
+
* so a conversation can legitimately contain unread gaps. A `message.read`
|
|
872
|
+
* event is fanned out to the sender via WebSocket + webhook.
|
|
869
873
|
*
|
|
870
874
|
* Realtime clients also have a WebSocket shortcut (`message.read_ack`
|
|
871
875
|
* frame) that bypasses this HTTP call. The REST method exists for
|
|
@@ -902,6 +906,17 @@ var AgentChatClient = class _AgentChatClient {
|
|
|
902
906
|
opts
|
|
903
907
|
);
|
|
904
908
|
}
|
|
909
|
+
/**
|
|
910
|
+
* Fetch compact server-authored room metadata: group summary or DM
|
|
911
|
+
* counterparty, contact memory, and the exact unread seq boundary.
|
|
912
|
+
* Message bodies stay on `getMessages`.
|
|
913
|
+
*/
|
|
914
|
+
getConversationContext(conversationId, opts) {
|
|
915
|
+
return this.get(
|
|
916
|
+
`/v1/conversations/${encodeURIComponent(conversationId)}/context`,
|
|
917
|
+
opts
|
|
918
|
+
);
|
|
919
|
+
}
|
|
905
920
|
/**
|
|
906
921
|
* Hide a conversation from the caller's inbox (soft-delete, caller-scoped).
|
|
907
922
|
* The other side's view is untouched — by design, matching the
|
|
@@ -915,8 +930,15 @@ var AgentChatClient = class _AgentChatClient {
|
|
|
915
930
|
opts
|
|
916
931
|
);
|
|
917
932
|
}
|
|
918
|
-
listConversations(
|
|
919
|
-
|
|
933
|
+
listConversations(options) {
|
|
934
|
+
const params = new URLSearchParams();
|
|
935
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
936
|
+
if (options?.offset !== void 0) params.set("offset", String(options.offset));
|
|
937
|
+
const qs = params.toString();
|
|
938
|
+
return this.get(
|
|
939
|
+
`/v1/conversations${qs ? `?${qs}` : ""}`,
|
|
940
|
+
options
|
|
941
|
+
);
|
|
920
942
|
}
|
|
921
943
|
// ─── Groups ───────────────────────────────────────────────────────────────
|
|
922
944
|
/**
|