@cadraos/sdk 0.3.7 → 0.3.9

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/dist/index.cjs CHANGED
@@ -677,15 +677,6 @@ var ExecutionStreamControllerImpl = class {
677
677
  sseClient = null;
678
678
  status = "connecting";
679
679
  reconnectAttempts = 0;
680
- // CAD-39 / webchat dual-plane create-connect race. `hasConnected` flips true on
681
- // the first successful SSE open; `notFoundRetries` bounds retries of a 404
682
- // encountered BEFORE we ever connect (the run row is persisted slightly AFTER
683
- // the client opens the stream — the norm on the webchat path where msg-api owns
684
- // the executionId and cadra persists the agent_executions row via an async
685
- // worker callback). See handleConnectionError.
686
- hasConnected = false;
687
- notFoundRetries = 0;
688
- maxConnectRaceRetries = 3;
689
680
  seenEventIds = /* @__PURE__ */ new Set();
690
681
  _lastEventId = null;
691
682
  activityTimeoutId = null;
@@ -825,8 +816,6 @@ var ExecutionStreamControllerImpl = class {
825
816
  if (connected) {
826
817
  this.status = "connected";
827
818
  this.reconnectAttempts = 0;
828
- this.hasConnected = true;
829
- this.notFoundRetries = 0;
830
819
  this.resetActivityTimeout();
831
820
  }
832
821
  this.emit("connectionChange", { connected, usingFallback: false });
@@ -1116,38 +1105,6 @@ var ExecutionStreamControllerImpl = class {
1116
1105
  return;
1117
1106
  }
1118
1107
  const msg = error instanceof Error ? error.message : String(error);
1119
- const isNotFound = /\b404\b/.test(msg);
1120
- const isAuthFailure = /\b40[13]\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg);
1121
- if (isNotFound && !isAuthFailure && !this.hasConnected) {
1122
- if (this.notFoundRetries < this.maxConnectRaceRetries) {
1123
- this.notFoundRetries++;
1124
- this.status = "reconnecting";
1125
- const delay = Math.min(
1126
- this.config.reconnectBaseDelayMs * this.notFoundRetries,
1127
- this.config.reconnectMaxDelayMs
1128
- );
1129
- await new Promise((resolve) => setTimeout(resolve, delay));
1130
- if (this.status === "closed") {
1131
- return;
1132
- }
1133
- try {
1134
- await this.connectSSE();
1135
- } catch (retryError) {
1136
- await this.handleConnectionError(retryError);
1137
- }
1138
- return;
1139
- }
1140
- if (this.pollingEnabled) {
1141
- if (this.sseClient) {
1142
- this.sseClient.disconnect();
1143
- this.sseClient = null;
1144
- }
1145
- this.status = "fallback_polling";
1146
- this.emit("connectionChange", { connected: false, usingFallback: true });
1147
- this.startPolling();
1148
- return;
1149
- }
1150
- }
1151
1108
  if (/\b4\d\d\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg)) {
1152
1109
  if (this.sseClient) {
1153
1110
  this.sseClient.disconnect();
@@ -1397,6 +1354,7 @@ var AgentsAPI = class extends BaseResourceAPI {
1397
1354
  super(http, "/api/v1/agents");
1398
1355
  this.getStreamConfig = getStreamConfig;
1399
1356
  }
1357
+ getStreamConfig;
1400
1358
  // ===== LIST Operations =====
1401
1359
  /**
1402
1360
  * List all agents in the organization
@@ -2302,6 +2260,7 @@ var SessionsAPI = class extends BaseResourceAPI {
2302
2260
  super(http, "/api/v1/sessions");
2303
2261
  this.getStreamConfig = getStreamConfig;
2304
2262
  }
2263
+ getStreamConfig;
2305
2264
  // ===== LIST Operations =====
2306
2265
  /**
2307
2266
  * List all sessions in the organization
@@ -2621,6 +2580,7 @@ var KanbanAPI = class extends BaseResourceAPI {
2621
2580
  super(http, "/api/v1/kanban");
2622
2581
  this.getStreamConfig = getStreamConfig;
2623
2582
  }
2583
+ getStreamConfig;
2624
2584
  // ===== BOARD =====
2625
2585
  /**
2626
2586
  * Get the current org's board (lanes in declared order). Auto-provisions
@@ -2822,6 +2782,7 @@ var RemoteAgentsAPI = class extends BaseResourceAPI {
2822
2782
  super(http, "/api/v1/remote-agents");
2823
2783
  this.getStreamConfig = getStreamConfig;
2824
2784
  }
2785
+ getStreamConfig;
2825
2786
  /**
2826
2787
  * List all remote agents in the organization
2827
2788
  *