@band-ai/band-sdk-core 1.0.1 → 1.1.0

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 CHANGED
@@ -676,11 +676,16 @@ class SessionOutcome {
676
676
  return ret[0] === 0 ? undefined : ret[1];
677
677
  }
678
678
  /**
679
- * @returns {boolean}
679
+ * @returns {string | undefined}
680
680
  */
681
- get stale() {
682
- const ret = wasm.sessionoutcome_stale(this.__wbg_ptr);
683
- return ret !== 0;
681
+ get staleReason() {
682
+ const ret = wasm.sessionoutcome_staleReason(this.__wbg_ptr);
683
+ let v1;
684
+ if (ret[0] !== 0) {
685
+ v1 = getStringFromWasm0(ret[0], ret[1]);
686
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
687
+ }
688
+ return v1;
684
689
  }
685
690
  /**
686
691
  * @returns {string}
@@ -901,6 +906,17 @@ class SubscriptionTracker {
901
906
  }
902
907
  return ret[0] !== 0;
903
908
  }
909
+ /**
910
+ * @param {any} topic
911
+ * @returns {boolean}
912
+ */
913
+ markAgentTopicRejoinFailed(topic) {
914
+ const ret = wasm.subscriptiontracker_markAgentTopicRejoinFailed(this.__wbg_ptr, topic);
915
+ if (ret[2]) {
916
+ throw takeFromExternrefTable0(ret[1]);
917
+ }
918
+ return ret[0] !== 0;
919
+ }
904
920
  /**
905
921
  * @param {any} room_id
906
922
  * @param {bigint} ticket
@@ -914,6 +930,17 @@ class SubscriptionTracker {
914
930
  }
915
931
  return ret[0] !== 0;
916
932
  }
933
+ /**
934
+ * @param {any} room_id
935
+ * @returns {boolean}
936
+ */
937
+ markRoomRejoinFailed(room_id) {
938
+ const ret = wasm.subscriptiontracker_markRoomRejoinFailed(this.__wbg_ptr, room_id);
939
+ if (ret[2]) {
940
+ throw takeFromExternrefTable0(ret[1]);
941
+ }
942
+ return ret[0] !== 0;
943
+ }
917
944
  constructor() {
918
945
  const ret = wasm.subscriptiontracker_new();
919
946
  this.__wbg_ptr = ret;
Binary file
package/index.d.ts CHANGED
@@ -173,6 +173,12 @@ export type SessionState = "connecting" | "up" | "reconnecting" | "dead";
173
173
 
174
174
  export type DeadReason = "classified" | "rapid_disconnect";
175
175
 
176
+ export type StaleReason =
177
+ | "wrong_epoch"
178
+ | "clock_regression"
179
+ | "duplicate_connected"
180
+ | "supersede_predates_epoch";
181
+
176
182
  export type RoomMembership = "unadmitted" | "admitting" | "admitted";
177
183
 
178
184
  /**
@@ -199,7 +205,7 @@ export class SessionOutcome {
199
205
  readonly state: SessionState;
200
206
  readonly retryAfterS: number | undefined;
201
207
  readonly deadReason: DeadReason | undefined;
202
- readonly stale: boolean;
208
+ readonly staleReason: StaleReason | undefined;
203
209
  }
204
210
 
205
211
  /** {@link SessionPolicy}'s constructor fields. */
@@ -285,6 +291,7 @@ export class SubscriptionTracker {
285
291
  unsubscribeRoom(roomId: string): bigint | undefined;
286
292
  markRoomLeaveComplete(roomId: string, ticket: bigint, outcome: LeaveOutcome): boolean;
287
293
  acknowledgeRoomReconciled(roomId: string): boolean;
294
+ markRoomRejoinFailed(roomId: string): boolean;
288
295
  subscribedRoomIds(): string[];
289
296
  onReconnected(): void;
290
297
  endSession(): void;
@@ -296,6 +303,7 @@ export class SubscriptionTracker {
296
303
  leaveAgentTopic(topic: string): bigint | undefined;
297
304
  markAgentTopicLeaveComplete(topic: string, ticket: bigint, outcome: LeaveOutcome): boolean;
298
305
  acknowledgeAgentTopicReconciled(topic: string): boolean;
306
+ markAgentTopicRejoinFailed(topic: string): boolean;
299
307
  joinedAgentTopics(): string[];
300
308
  }
301
309
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@band-ai/band-sdk-core",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Shared Band event-payload validation",
5
5
  "license": "MIT",
6
6
  "repository": {