@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.
@@ -2705,6 +2705,13 @@ interface KanbanCard {
2705
2705
  executionId?: string;
2706
2706
  /** Summary of the card's current/last run, if any. */
2707
2707
  run?: KanbanRunSummary;
2708
+ /**
2709
+ * When this card next becomes DUE on a scheduled lane (ISO string) — maps to
2710
+ * `agentic_card.next_due_at` (spec §3a / STORY-003/004). Drives the board's
2711
+ * ⧗ "due" chip: `next_due_at ≤ now` → due (the next sweep will pick it up).
2712
+ * OPTIONAL — absent → no due chip (today's render).
2713
+ */
2714
+ nextDueAt?: string;
2708
2715
  /** Who created the card. */
2709
2716
  createdBy?: string;
2710
2717
  /** When the card was created (ISO string). */
@@ -2705,6 +2705,13 @@ interface KanbanCard {
2705
2705
  executionId?: string;
2706
2706
  /** Summary of the card's current/last run, if any. */
2707
2707
  run?: KanbanRunSummary;
2708
+ /**
2709
+ * When this card next becomes DUE on a scheduled lane (ISO string) — maps to
2710
+ * `agentic_card.next_due_at` (spec §3a / STORY-003/004). Drives the board's
2711
+ * ⧗ "due" chip: `next_due_at ≤ now` → due (the next sweep will pick it up).
2712
+ * OPTIONAL — absent → no due chip (today's render).
2713
+ */
2714
+ nextDueAt?: string;
2708
2715
  /** Who created the card. */
2709
2716
  createdBy?: string;
2710
2717
  /** When the card was created (ISO string). */
@@ -669,15 +669,6 @@ var ExecutionStreamControllerImpl = class {
669
669
  sseClient = null;
670
670
  status = "connecting";
671
671
  reconnectAttempts = 0;
672
- // CAD-39 / webchat dual-plane create-connect race. `hasConnected` flips true on
673
- // the first successful SSE open; `notFoundRetries` bounds retries of a 404
674
- // encountered BEFORE we ever connect (the run row is persisted slightly AFTER
675
- // the client opens the stream — the norm on the webchat path where msg-api owns
676
- // the executionId and cadra persists the agent_executions row via an async
677
- // worker callback). See handleConnectionError.
678
- hasConnected = false;
679
- notFoundRetries = 0;
680
- maxConnectRaceRetries = 3;
681
672
  seenEventIds = /* @__PURE__ */ new Set();
682
673
  _lastEventId = null;
683
674
  activityTimeoutId = null;
@@ -817,8 +808,6 @@ var ExecutionStreamControllerImpl = class {
817
808
  if (connected) {
818
809
  this.status = "connected";
819
810
  this.reconnectAttempts = 0;
820
- this.hasConnected = true;
821
- this.notFoundRetries = 0;
822
811
  this.resetActivityTimeout();
823
812
  }
824
813
  this.emit("connectionChange", { connected, usingFallback: false });
@@ -1108,38 +1097,6 @@ var ExecutionStreamControllerImpl = class {
1108
1097
  return;
1109
1098
  }
1110
1099
  const msg = error instanceof Error ? error.message : String(error);
1111
- const isNotFound = /\b404\b/.test(msg);
1112
- const isAuthFailure = /\b40[13]\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg);
1113
- if (isNotFound && !isAuthFailure && !this.hasConnected) {
1114
- if (this.notFoundRetries < this.maxConnectRaceRetries) {
1115
- this.notFoundRetries++;
1116
- this.status = "reconnecting";
1117
- const delay = Math.min(
1118
- this.config.reconnectBaseDelayMs * this.notFoundRetries,
1119
- this.config.reconnectMaxDelayMs
1120
- );
1121
- await new Promise((resolve) => setTimeout(resolve, delay));
1122
- if (this.status === "closed") {
1123
- return;
1124
- }
1125
- try {
1126
- await this.connectSSE();
1127
- } catch (retryError) {
1128
- await this.handleConnectionError(retryError);
1129
- }
1130
- return;
1131
- }
1132
- if (this.pollingEnabled) {
1133
- if (this.sseClient) {
1134
- this.sseClient.disconnect();
1135
- this.sseClient = null;
1136
- }
1137
- this.status = "fallback_polling";
1138
- this.emit("connectionChange", { connected: false, usingFallback: true });
1139
- this.startPolling();
1140
- return;
1141
- }
1142
- }
1143
1100
  if (/\b4\d\d\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg)) {
1144
1101
  if (this.sseClient) {
1145
1102
  this.sseClient.disconnect();
@@ -1389,6 +1346,7 @@ var AgentsAPI = class extends BaseResourceAPI {
1389
1346
  super(http, "/api/v1/agents");
1390
1347
  this.getStreamConfig = getStreamConfig;
1391
1348
  }
1349
+ getStreamConfig;
1392
1350
  // ===== LIST Operations =====
1393
1351
  /**
1394
1352
  * List all agents in the organization
@@ -2294,6 +2252,7 @@ var SessionsAPI = class extends BaseResourceAPI {
2294
2252
  super(http, "/api/v1/sessions");
2295
2253
  this.getStreamConfig = getStreamConfig;
2296
2254
  }
2255
+ getStreamConfig;
2297
2256
  // ===== LIST Operations =====
2298
2257
  /**
2299
2258
  * List all sessions in the organization
@@ -2613,6 +2572,7 @@ var KanbanAPI = class extends BaseResourceAPI {
2613
2572
  super(http, "/api/v1/kanban");
2614
2573
  this.getStreamConfig = getStreamConfig;
2615
2574
  }
2575
+ getStreamConfig;
2616
2576
  // ===== BOARD =====
2617
2577
  /**
2618
2578
  * Get the current org's board (lanes in declared order). Auto-provisions
@@ -2814,6 +2774,7 @@ var RemoteAgentsAPI = class extends BaseResourceAPI {
2814
2774
  super(http, "/api/v1/remote-agents");
2815
2775
  this.getStreamConfig = getStreamConfig;
2816
2776
  }
2777
+ getStreamConfig;
2817
2778
  /**
2818
2779
  * List all remote agents in the organization
2819
2780
  *