@band-ai/band-sdk-core 1.1.0 → 1.2.1
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/band_sdk_core.js +158 -4
- package/band_sdk_core_bg.wasm +0 -0
- package/index.d.ts +23 -2
- package/package.json +1 -1
package/band_sdk_core.js
CHANGED
|
@@ -791,6 +791,13 @@ class SubscriptionTracker {
|
|
|
791
791
|
}
|
|
792
792
|
return ret[0] !== 0;
|
|
793
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* @returns {Array<any>}
|
|
796
|
+
*/
|
|
797
|
+
agentTopicRejoinCandidates() {
|
|
798
|
+
const ret = wasm.subscriptiontracker_agentTopicRejoinCandidates(this.__wbg_ptr);
|
|
799
|
+
return ret;
|
|
800
|
+
}
|
|
794
801
|
/**
|
|
795
802
|
* @param {any} topic
|
|
796
803
|
* @returns {string}
|
|
@@ -908,10 +915,11 @@ class SubscriptionTracker {
|
|
|
908
915
|
}
|
|
909
916
|
/**
|
|
910
917
|
* @param {any} topic
|
|
918
|
+
* @param {bigint} ticket
|
|
911
919
|
* @returns {boolean}
|
|
912
920
|
*/
|
|
913
|
-
markAgentTopicRejoinFailed(topic) {
|
|
914
|
-
const ret = wasm.subscriptiontracker_markAgentTopicRejoinFailed(this.__wbg_ptr, topic);
|
|
921
|
+
markAgentTopicRejoinFailed(topic, ticket) {
|
|
922
|
+
const ret = wasm.subscriptiontracker_markAgentTopicRejoinFailed(this.__wbg_ptr, topic, ticket);
|
|
915
923
|
if (ret[2]) {
|
|
916
924
|
throw takeFromExternrefTable0(ret[1]);
|
|
917
925
|
}
|
|
@@ -932,10 +940,11 @@ class SubscriptionTracker {
|
|
|
932
940
|
}
|
|
933
941
|
/**
|
|
934
942
|
* @param {any} room_id
|
|
943
|
+
* @param {bigint} ticket
|
|
935
944
|
* @returns {boolean}
|
|
936
945
|
*/
|
|
937
|
-
markRoomRejoinFailed(room_id) {
|
|
938
|
-
const ret = wasm.subscriptiontracker_markRoomRejoinFailed(this.__wbg_ptr, room_id);
|
|
946
|
+
markRoomRejoinFailed(room_id, ticket) {
|
|
947
|
+
const ret = wasm.subscriptiontracker_markRoomRejoinFailed(this.__wbg_ptr, room_id, ticket);
|
|
939
948
|
if (ret[2]) {
|
|
940
949
|
throw takeFromExternrefTable0(ret[1]);
|
|
941
950
|
}
|
|
@@ -963,6 +972,18 @@ class SubscriptionTracker {
|
|
|
963
972
|
}
|
|
964
973
|
return ret[0] !== 0;
|
|
965
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* @param {any} topic
|
|
977
|
+
* @param {bigint} ticket
|
|
978
|
+
* @returns {boolean}
|
|
979
|
+
*/
|
|
980
|
+
recordAgentTopicJoinAmbiguous(topic, ticket) {
|
|
981
|
+
const ret = wasm.subscriptiontracker_recordAgentTopicJoinAmbiguous(this.__wbg_ptr, topic, ticket);
|
|
982
|
+
if (ret[2]) {
|
|
983
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
984
|
+
}
|
|
985
|
+
return ret[0] !== 0;
|
|
986
|
+
}
|
|
966
987
|
/**
|
|
967
988
|
* @param {any} room_id
|
|
968
989
|
* @param {bigint} ticket
|
|
@@ -1000,6 +1021,13 @@ class SubscriptionTracker {
|
|
|
1000
1021
|
}
|
|
1001
1022
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
1002
1023
|
}
|
|
1024
|
+
/**
|
|
1025
|
+
* @returns {Array<any>}
|
|
1026
|
+
*/
|
|
1027
|
+
roomRejoinCandidates() {
|
|
1028
|
+
const ret = wasm.subscriptiontracker_roomRejoinCandidates(this.__wbg_ptr);
|
|
1029
|
+
return ret;
|
|
1030
|
+
}
|
|
1003
1031
|
/**
|
|
1004
1032
|
* @param {any} room_id
|
|
1005
1033
|
* @returns {string}
|
|
@@ -1035,6 +1063,106 @@ class SubscriptionTracker {
|
|
|
1035
1063
|
if (Symbol.dispose) SubscriptionTracker.prototype[Symbol.dispose] = SubscriptionTracker.prototype.free;
|
|
1036
1064
|
exports.SubscriptionTracker = SubscriptionTracker;
|
|
1037
1065
|
|
|
1066
|
+
/**
|
|
1067
|
+
* This platform's Phoenix Channels topic for the `agent_contacts` channel.
|
|
1068
|
+
* @param {any} agentId
|
|
1069
|
+
* @returns {string}
|
|
1070
|
+
*/
|
|
1071
|
+
function agentContactsTopic(agentId) {
|
|
1072
|
+
let deferred2_0;
|
|
1073
|
+
let deferred2_1;
|
|
1074
|
+
try {
|
|
1075
|
+
const ret = wasm.agentContactsTopic(agentId);
|
|
1076
|
+
var ptr1 = ret[0];
|
|
1077
|
+
var len1 = ret[1];
|
|
1078
|
+
if (ret[3]) {
|
|
1079
|
+
ptr1 = 0; len1 = 0;
|
|
1080
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1081
|
+
}
|
|
1082
|
+
deferred2_0 = ptr1;
|
|
1083
|
+
deferred2_1 = len1;
|
|
1084
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1085
|
+
} finally {
|
|
1086
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
exports.agentContactsTopic = agentContactsTopic;
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* This platform's Phoenix Channels topic for the `agent_control` channel.
|
|
1093
|
+
* @param {any} agentId
|
|
1094
|
+
* @returns {string}
|
|
1095
|
+
*/
|
|
1096
|
+
function agentControlTopic(agentId) {
|
|
1097
|
+
let deferred2_0;
|
|
1098
|
+
let deferred2_1;
|
|
1099
|
+
try {
|
|
1100
|
+
const ret = wasm.agentControlTopic(agentId);
|
|
1101
|
+
var ptr1 = ret[0];
|
|
1102
|
+
var len1 = ret[1];
|
|
1103
|
+
if (ret[3]) {
|
|
1104
|
+
ptr1 = 0; len1 = 0;
|
|
1105
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1106
|
+
}
|
|
1107
|
+
deferred2_0 = ptr1;
|
|
1108
|
+
deferred2_1 = len1;
|
|
1109
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1110
|
+
} finally {
|
|
1111
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
exports.agentControlTopic = agentControlTopic;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* This platform's Phoenix Channels topic for the `agent_rooms` channel.
|
|
1118
|
+
* @param {any} agentId
|
|
1119
|
+
* @returns {string}
|
|
1120
|
+
*/
|
|
1121
|
+
function agentRoomsTopic(agentId) {
|
|
1122
|
+
let deferred2_0;
|
|
1123
|
+
let deferred2_1;
|
|
1124
|
+
try {
|
|
1125
|
+
const ret = wasm.agentRoomsTopic(agentId);
|
|
1126
|
+
var ptr1 = ret[0];
|
|
1127
|
+
var len1 = ret[1];
|
|
1128
|
+
if (ret[3]) {
|
|
1129
|
+
ptr1 = 0; len1 = 0;
|
|
1130
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1131
|
+
}
|
|
1132
|
+
deferred2_0 = ptr1;
|
|
1133
|
+
deferred2_1 = len1;
|
|
1134
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1135
|
+
} finally {
|
|
1136
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
exports.agentRoomsTopic = agentRoomsTopic;
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* This platform's Phoenix Channels topic for a room's `chat_room` channel.
|
|
1143
|
+
* @param {any} roomId
|
|
1144
|
+
* @returns {string}
|
|
1145
|
+
*/
|
|
1146
|
+
function chatRoomTopic(roomId) {
|
|
1147
|
+
let deferred2_0;
|
|
1148
|
+
let deferred2_1;
|
|
1149
|
+
try {
|
|
1150
|
+
const ret = wasm.chatRoomTopic(roomId);
|
|
1151
|
+
var ptr1 = ret[0];
|
|
1152
|
+
var len1 = ret[1];
|
|
1153
|
+
if (ret[3]) {
|
|
1154
|
+
ptr1 = 0; len1 = 0;
|
|
1155
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1156
|
+
}
|
|
1157
|
+
deferred2_0 = ptr1;
|
|
1158
|
+
deferred2_1 = len1;
|
|
1159
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1160
|
+
} finally {
|
|
1161
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
exports.chatRoomTopic = chatRoomTopic;
|
|
1165
|
+
|
|
1038
1166
|
/**
|
|
1039
1167
|
* Classify a WebSocket close code. Returns `[terminal, delayRange]`.
|
|
1040
1168
|
* @param {number | null} [closeCode]
|
|
@@ -1064,6 +1192,32 @@ function classifyUpgrade(status) {
|
|
|
1064
1192
|
}
|
|
1065
1193
|
exports.classifyUpgrade = classifyUpgrade;
|
|
1066
1194
|
|
|
1195
|
+
/**
|
|
1196
|
+
* This platform's Phoenix Channels topic for a room's `room_participants`
|
|
1197
|
+
* channel.
|
|
1198
|
+
* @param {any} roomId
|
|
1199
|
+
* @returns {string}
|
|
1200
|
+
*/
|
|
1201
|
+
function roomParticipantsTopic(roomId) {
|
|
1202
|
+
let deferred2_0;
|
|
1203
|
+
let deferred2_1;
|
|
1204
|
+
try {
|
|
1205
|
+
const ret = wasm.roomParticipantsTopic(roomId);
|
|
1206
|
+
var ptr1 = ret[0];
|
|
1207
|
+
var len1 = ret[1];
|
|
1208
|
+
if (ret[3]) {
|
|
1209
|
+
ptr1 = 0; len1 = 0;
|
|
1210
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1211
|
+
}
|
|
1212
|
+
deferred2_0 = ptr1;
|
|
1213
|
+
deferred2_1 = len1;
|
|
1214
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1215
|
+
} finally {
|
|
1216
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
exports.roomParticipantsTopic = roomParticipantsTopic;
|
|
1220
|
+
|
|
1067
1221
|
/**
|
|
1068
1222
|
* Validate and normalize an inbound platform event payload.
|
|
1069
1223
|
*
|
package/band_sdk_core_bg.wasm
CHANGED
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -199,6 +199,24 @@ export function classifyUpgrade(
|
|
|
199
199
|
status: number,
|
|
200
200
|
): [boolean, [number, number] | undefined];
|
|
201
201
|
|
|
202
|
+
/** This platform's Phoenix Channels topic for the `agent_control` channel. */
|
|
203
|
+
export function agentControlTopic(agentId: string): string;
|
|
204
|
+
|
|
205
|
+
/** This platform's Phoenix Channels topic for the `agent_rooms` channel. */
|
|
206
|
+
export function agentRoomsTopic(agentId: string): string;
|
|
207
|
+
|
|
208
|
+
/** This platform's Phoenix Channels topic for the `agent_contacts` channel. */
|
|
209
|
+
export function agentContactsTopic(agentId: string): string;
|
|
210
|
+
|
|
211
|
+
/** This platform's Phoenix Channels topic for a room's `chat_room` channel. */
|
|
212
|
+
export function chatRoomTopic(roomId: string): string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* This platform's Phoenix Channels topic for a room's `room_participants`
|
|
216
|
+
* channel.
|
|
217
|
+
*/
|
|
218
|
+
export function roomParticipantsTopic(roomId: string): string;
|
|
219
|
+
|
|
202
220
|
/** The settled outcome of one {@link Session} call. */
|
|
203
221
|
export class SessionOutcome {
|
|
204
222
|
private constructor();
|
|
@@ -291,19 +309,22 @@ export class SubscriptionTracker {
|
|
|
291
309
|
unsubscribeRoom(roomId: string): bigint | undefined;
|
|
292
310
|
markRoomLeaveComplete(roomId: string, ticket: bigint, outcome: LeaveOutcome): boolean;
|
|
293
311
|
acknowledgeRoomReconciled(roomId: string): boolean;
|
|
294
|
-
|
|
312
|
+
roomRejoinCandidates(): Array<[string, bigint]>;
|
|
313
|
+
markRoomRejoinFailed(roomId: string, ticket: bigint): boolean;
|
|
295
314
|
subscribedRoomIds(): string[];
|
|
296
315
|
onReconnected(): void;
|
|
297
316
|
endSession(): void;
|
|
298
317
|
beginAgentTopicJoin(topic: string): bigint | undefined;
|
|
299
318
|
recordAgentTopicJoin(topic: string, ticket: bigint, joined: boolean): boolean;
|
|
319
|
+
recordAgentTopicJoinAmbiguous(topic: string, ticket: bigint): boolean;
|
|
300
320
|
isAgentTopicJoined(topic: string): boolean;
|
|
301
321
|
isAgentTopicClaimCurrent(topic: string, ticket: bigint): boolean;
|
|
302
322
|
agentTopicStatus(topic: string): AgentTopicStatus;
|
|
303
323
|
leaveAgentTopic(topic: string): bigint | undefined;
|
|
304
324
|
markAgentTopicLeaveComplete(topic: string, ticket: bigint, outcome: LeaveOutcome): boolean;
|
|
305
325
|
acknowledgeAgentTopicReconciled(topic: string): boolean;
|
|
306
|
-
|
|
326
|
+
agentTopicRejoinCandidates(): Array<[string, bigint]>;
|
|
327
|
+
markAgentTopicRejoinFailed(topic: string, ticket: bigint): boolean;
|
|
307
328
|
joinedAgentTopics(): string[];
|
|
308
329
|
}
|
|
309
330
|
|