@meshagent/meshagent-ts-auth 0.39.4 → 0.39.6

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,3 +1,12 @@
1
+ ## [0.39.6]
2
+ - Chat thread message sending now supports an “agent messages” mode: it selects participants that advertise agent-message support and sends `agent-message` payloads using `meshagent.agent.turn.start` / `meshagent.agent.turn.steer` types (including turn/thread scoping), with Promise-based sending and cancellation when recipients never materialize.
3
+ - Chat UI/logic now determines the correct outbound message type (chat vs steer) and turn context from thread status, and passes that into message sending.
4
+ - DatasetsClient now adds strongly typed `importFromStorage` and `exportToStorage` APIs with dataset storage format + import mode options, optional `namespace`/`branch` scoping, and `batch_size` support that is omitted when unset.
5
+ - Unit tests were updated to verify the new import/export request payload shapes and defaults.
6
+
7
+ ## [0.39.5]
8
+ - Stability
9
+
1
10
  ## [0.39.4]
2
11
  - Updated the Node/TS React dev package dependency graph to the newer `@meshagent/meshagent` and `@meshagent/meshagent-react` versions (`^0.38.4`) and upgraded supporting UI dependencies (including `shadcn` `^4.5.0`, `radix-ui` `^1.4.3`, and `lucide-react` `^0.525.0`).
3
12
  - Updated build tooling in the React dev package (new `build:js` / `build:types` scripts using TS configs) to match the updated packaging workflow.
@@ -30557,6 +30557,32 @@ return true;`);
30557
30557
  }
30558
30558
  });
30559
30559
  }
30560
+ async importFromStorage({ table, path, mode = "create", format = "auto", on, sheet, batchSize, namespace, branch }) {
30561
+ const input = {
30562
+ table,
30563
+ path,
30564
+ mode,
30565
+ format,
30566
+ on: on ?? null,
30567
+ sheet: sheet ?? null,
30568
+ namespace: namespace ?? null,
30569
+ branch: branch ?? null
30570
+ };
30571
+ if (batchSize != null) {
30572
+ input.batch_size = batchSize;
30573
+ }
30574
+ await this.invoke("import_storage", input);
30575
+ }
30576
+ async exportToStorage({ table, path, format, namespace, branch, version: version2 }) {
30577
+ await this.invoke("export_storage", {
30578
+ table,
30579
+ path,
30580
+ format,
30581
+ namespace: namespace ?? null,
30582
+ branch: branch ?? null,
30583
+ version: version2 ?? null
30584
+ });
30585
+ }
30560
30586
  async dropIndex({ table, name, namespace, branch }) {
30561
30587
  await this.room.invoke({
30562
30588
  toolkit: "dataset",
@@ -42126,6 +42152,12 @@ ${newlined}
42126
42152
 
42127
42153
  // ../meshagent-ts/dist/esm/room-client.js
42128
42154
  var room_client_exports = {};
42155
+ function isRetryableStartupClose({ kind, reason }) {
42156
+ if (kind === protocol_12.ProtocolCloseKind.ERROR) {
42157
+ return true;
42158
+ }
42159
+ return (reason ?? "").toLowerCase().includes("1013");
42160
+ }
42129
42161
  function normalizeCloseReason(reason) {
42130
42162
  if (reason == null) {
42131
42163
  return null;
@@ -42768,7 +42800,7 @@ ${newlined}
42768
42800
  await this._openProtocol({ initial: true });
42769
42801
  } catch (error) {
42770
42802
  if (error instanceof ProtocolStartupFailure) {
42771
- if (error.kind !== protocol_12.ProtocolCloseKind.ERROR || this._reconnectTimeout === 0) {
42803
+ if (!isRetryableStartupClose({ kind: error.kind, reason: error.reason }) || this._reconnectTimeout === 0) {
42772
42804
  this._setStartupTerminalState({
42773
42805
  closeKind: error.kind,
42774
42806
  closeReason: error.reason,
@@ -42803,7 +42835,7 @@ ${newlined}
42803
42835
  }
42804
42836
  const closeKind = this._protocolInstance.closeKind;
42805
42837
  const protocolCloseReason = normalizeCloseReason(this._protocolInstance.closeReason);
42806
- if (closeKind != null && closeKind !== protocol_12.ProtocolCloseKind.ERROR) {
42838
+ if (closeKind != null && !isRetryableStartupClose({ kind: closeKind, reason: protocolCloseReason })) {
42807
42839
  this._setStartupTerminalState({
42808
42840
  closeKind,
42809
42841
  closeReason: protocolCloseReason,
@@ -42880,6 +42912,9 @@ ${newlined}
42880
42912
  const remaining = deadline - Date.now();
42881
42913
  return remaining <= 0 ? 0 : remaining;
42882
42914
  }
42915
+ _reconnectRetryDelay({ retryCount }) {
42916
+ return Math.min(_RoomClient.RECONNECT_RETRY_MAX_DELAY_MS, _RoomClient.RECONNECT_RETRY_BASE_DELAY_MS * 2 ** retryCount);
42917
+ }
42883
42918
  async _attemptInitialProtocolStartup({ protocol, remaining }) {
42884
42919
  void protocol;
42885
42920
  if (remaining == null) {
@@ -42973,21 +43008,25 @@ ${newlined}
42973
43008
  };
42974
43009
  const deadline = this._reconnectTimeout == null ? null : Date.now() + this._reconnectTimeout;
42975
43010
  let firstAttempt = true;
43011
+ let retryCount = 0;
42976
43012
  while (!this._closing) {
42977
43013
  if (firstAttempt) {
42978
43014
  firstAttempt = false;
42979
43015
  if (this._reconnectTimeout == null) {
42980
- await new Promise((resolve) => setTimeout(resolve, _RoomClient.RECONNECT_RETRY_INTERVAL_MS));
43016
+ await new Promise((resolve) => setTimeout(resolve, this._reconnectRetryDelay({ retryCount })));
43017
+ retryCount += 1;
42981
43018
  }
42982
43019
  } else {
42983
43020
  const remaining2 = this._remainingReconnectTimeout(deadline);
42984
43021
  if (remaining2 != null && remaining2 === 0) {
42985
43022
  return this._timedOutRetryResult({ disconnectReason: failureReason });
42986
43023
  }
42987
- const delay = remaining2 == null ? _RoomClient.RECONNECT_RETRY_INTERVAL_MS : Math.min(remaining2, _RoomClient.RECONNECT_RETRY_INTERVAL_MS);
43024
+ const backoffDelay = this._reconnectRetryDelay({ retryCount });
43025
+ const delay = remaining2 == null ? backoffDelay : Math.min(remaining2, backoffDelay);
42988
43026
  if (delay > 0) {
42989
43027
  await new Promise((resolve) => setTimeout(resolve, delay));
42990
43028
  }
43029
+ retryCount += 1;
42991
43030
  }
42992
43031
  const remaining = this._remainingReconnectTimeout(deadline);
42993
43032
  if (remaining != null && remaining === 0) {
@@ -43020,7 +43059,7 @@ ${newlined}
43020
43059
  if (error instanceof ProtocolStartupFailure) {
43021
43060
  recordFailureReason(error.reason);
43022
43061
  await this._closeProtocol(nextProtocol);
43023
- if (error.kind !== protocol_12.ProtocolCloseKind.ERROR) {
43062
+ if (!isRetryableStartupClose({ kind: error.kind, reason: error.reason })) {
43024
43063
  return {
43025
43064
  connected: false,
43026
43065
  closeKind: error.kind,
@@ -43512,7 +43551,8 @@ ${newlined}
43512
43551
  }
43513
43552
  };
43514
43553
  exports.RoomClient = RoomClient;
43515
- RoomClient.RECONNECT_RETRY_INTERVAL_MS = 1e3;
43554
+ RoomClient.RECONNECT_RETRY_BASE_DELAY_MS = 500;
43555
+ RoomClient.RECONNECT_RETRY_MAX_DELAY_MS = 3e4;
43516
43556
  }
43517
43557
  });
43518
43558
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshagent/meshagent-ts-auth",
3
- "version": "0.39.4",
3
+ "version": "0.39.6",
4
4
  "description": "Meshagent Typescript Auth",
5
5
  "homepage": "https://github.com/meshagent/meshagent-ts-auth",
6
6
  "scripts": {
@@ -39,7 +39,7 @@
39
39
  "CHANGELOG.md"
40
40
  ],
41
41
  "dependencies": {
42
- "@meshagent/meshagent": "^0.39.4",
42
+ "@meshagent/meshagent": "^0.39.6",
43
43
  "typescript": "^5.8.3"
44
44
  },
45
45
  "devDependencies": {