@cadraos/sdk 0.3.8 → 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.
@@ -690,15 +690,6 @@ var ExecutionStreamControllerImpl = class {
690
690
  sseClient = null;
691
691
  status = "connecting";
692
692
  reconnectAttempts = 0;
693
- // CAD-39 / webchat dual-plane create-connect race. `hasConnected` flips true on
694
- // the first successful SSE open; `notFoundRetries` bounds retries of a 404
695
- // encountered BEFORE we ever connect (the run row is persisted slightly AFTER
696
- // the client opens the stream — the norm on the webchat path where msg-api owns
697
- // the executionId and cadra persists the agent_executions row via an async
698
- // worker callback). See handleConnectionError.
699
- hasConnected = false;
700
- notFoundRetries = 0;
701
- maxConnectRaceRetries = 3;
702
693
  seenEventIds = /* @__PURE__ */ new Set();
703
694
  _lastEventId = null;
704
695
  activityTimeoutId = null;
@@ -838,8 +829,6 @@ var ExecutionStreamControllerImpl = class {
838
829
  if (connected) {
839
830
  this.status = "connected";
840
831
  this.reconnectAttempts = 0;
841
- this.hasConnected = true;
842
- this.notFoundRetries = 0;
843
832
  this.resetActivityTimeout();
844
833
  }
845
834
  this.emit("connectionChange", { connected, usingFallback: false });
@@ -1129,38 +1118,6 @@ var ExecutionStreamControllerImpl = class {
1129
1118
  return;
1130
1119
  }
1131
1120
  const msg = error instanceof Error ? error.message : String(error);
1132
- const isNotFound = /\b404\b/.test(msg);
1133
- const isAuthFailure = /\b40[13]\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg);
1134
- if (isNotFound && !isAuthFailure && !this.hasConnected) {
1135
- if (this.notFoundRetries < this.maxConnectRaceRetries) {
1136
- this.notFoundRetries++;
1137
- this.status = "reconnecting";
1138
- const delay = Math.min(
1139
- this.config.reconnectBaseDelayMs * this.notFoundRetries,
1140
- this.config.reconnectMaxDelayMs
1141
- );
1142
- await new Promise((resolve) => setTimeout(resolve, delay));
1143
- if (this.status === "closed") {
1144
- return;
1145
- }
1146
- try {
1147
- await this.connectSSE();
1148
- } catch (retryError) {
1149
- await this.handleConnectionError(retryError);
1150
- }
1151
- return;
1152
- }
1153
- if (this.pollingEnabled) {
1154
- if (this.sseClient) {
1155
- this.sseClient.disconnect();
1156
- this.sseClient = null;
1157
- }
1158
- this.status = "fallback_polling";
1159
- this.emit("connectionChange", { connected: false, usingFallback: true });
1160
- this.startPolling();
1161
- return;
1162
- }
1163
- }
1164
1121
  if (/\b4\d\d\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg)) {
1165
1122
  if (this.sseClient) {
1166
1123
  this.sseClient.disconnect();
@@ -1410,6 +1367,7 @@ var AgentsAPI = class extends BaseResourceAPI {
1410
1367
  super(http, "/api/v1/agents");
1411
1368
  this.getStreamConfig = getStreamConfig;
1412
1369
  }
1370
+ getStreamConfig;
1413
1371
  // ===== LIST Operations =====
1414
1372
  /**
1415
1373
  * List all agents in the organization
@@ -2315,6 +2273,7 @@ var SessionsAPI = class extends BaseResourceAPI {
2315
2273
  super(http, "/api/v1/sessions");
2316
2274
  this.getStreamConfig = getStreamConfig;
2317
2275
  }
2276
+ getStreamConfig;
2318
2277
  // ===== LIST Operations =====
2319
2278
  /**
2320
2279
  * List all sessions in the organization
@@ -2634,6 +2593,7 @@ var KanbanAPI = class extends BaseResourceAPI {
2634
2593
  super(http, "/api/v1/kanban");
2635
2594
  this.getStreamConfig = getStreamConfig;
2636
2595
  }
2596
+ getStreamConfig;
2637
2597
  // ===== BOARD =====
2638
2598
  /**
2639
2599
  * Get the current org's board (lanes in declared order). Auto-provisions
@@ -2835,6 +2795,7 @@ var RemoteAgentsAPI = class extends BaseResourceAPI {
2835
2795
  super(http, "/api/v1/remote-agents");
2836
2796
  this.getStreamConfig = getStreamConfig;
2837
2797
  }
2798
+ getStreamConfig;
2838
2799
  /**
2839
2800
  * List all remote agents in the organization
2840
2801
  *