@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/board-host/index.d.cts +74 -6
- package/dist/board-host/index.d.ts +74 -6
- package/dist/board-host/server/index.d.cts +81 -6
- package/dist/board-host/server/index.d.ts +81 -6
- package/dist/chat/index.cjs +4 -43
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +7 -0
- package/dist/chat/index.d.ts +7 -0
- package/dist/chat/index.js +4 -43
- package/dist/chat/index.js.map +1 -1
- package/dist/index.cjs +4 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -43
- package/dist/index.js.map +1 -1
- package/dist/kanban/engine/index.cjs +119 -31
- package/dist/kanban/engine/index.cjs.map +1 -1
- package/dist/kanban/engine/index.d.cts +112 -6
- package/dist/kanban/engine/index.d.ts +112 -6
- package/dist/kanban/engine/index.js +119 -31
- package/dist/kanban/engine/index.js.map +1 -1
- package/dist/kanban/index.cjs +574 -155
- package/dist/kanban/index.cjs.map +1 -1
- package/dist/kanban/index.d.cts +277 -11
- package/dist/kanban/index.d.ts +277 -11
- package/dist/kanban/index.js +569 -156
- package/dist/kanban/index.js.map +1 -1
- package/dist/teams/index.cjs +4 -43
- package/dist/teams/index.cjs.map +1 -1
- package/dist/teams/index.d.cts +7 -0
- package/dist/teams/index.d.ts +7 -0
- package/dist/teams/index.js +4 -43
- package/dist/teams/index.js.map +1 -1
- package/package.json +16 -15
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
|
*
|