@cadraos/sdk 0.3.12 → 0.3.14-p46.0

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.d.cts CHANGED
@@ -1472,8 +1472,61 @@ interface StreamingConfig {
1472
1472
  reconnectMaxDelayMs: number;
1473
1473
  /** Activity timeout - no events for this long triggers reconnect (ms) */
1474
1474
  activityTimeoutMs: number;
1475
- /** Polling interval for fallback mode (ms) */
1475
+ /**
1476
+ * Base polling interval for fallback mode (ms).
1477
+ *
1478
+ * This is a FLOOR, not a fixed period: the fallback loop starts here and
1479
+ * backs off from it when polls fail or stop learning anything new
1480
+ * (see {@link pollingMaxIntervalMs}).
1481
+ */
1476
1482
  pollingIntervalMs: number;
1483
+ /**
1484
+ * Ceiling the fallback poll delay backs off to (ms). Default 30000.
1485
+ * Bounds the request rate of a fallback loop that is failing or idle.
1486
+ */
1487
+ pollingMaxIntervalMs?: number;
1488
+ /**
1489
+ * Consecutive poll failures (non-429) before the loop gives up and surfaces
1490
+ * an error instead of retrying forever. Default 10.
1491
+ */
1492
+ pollingMaxConsecutiveFailures?: number;
1493
+ /**
1494
+ * Consecutive 429 responses before the loop gives up. Default 3.
1495
+ * A 429 is not transient noise — it means the quota window is spent, and
1496
+ * continuing to probe it starves every other feature on the same key.
1497
+ */
1498
+ pollingMaxConsecutiveRateLimits?: number;
1499
+ /**
1500
+ * Consecutive 4xx responses (excluding 429 and 408) from the status endpoint
1501
+ * before the loop gives up. Default 3. A 4xx will not fix itself by asking
1502
+ * again — a wrong path, a dead run id or rejected auth all land here — but a
1503
+ * poll issued immediately after dispatch can legitimately 404 once, hence a
1504
+ * small tolerance rather than the SSE side's instant termination.
1505
+ */
1506
+ pollingMaxConsecutiveClientErrors?: number;
1507
+ /**
1508
+ * How long the fallback loop may go without learning anything before it gives
1509
+ * up (ms). Default 1800000 (30 min). Measured from the last poll that
1510
+ * observed a new log or a status change — NOT from when the loop started, so
1511
+ * a fallback that is still delivering output is never cut off.
1512
+ */
1513
+ pollingMaxDurationMs?: number;
1514
+ /**
1515
+ * Longest server-named `Retry-After` the loop will sit out (ms). Default
1516
+ * 300000 (5 min). Beyond this the loop gives up rather than silently
1517
+ * holding a session open for a reset that far away.
1518
+ */
1519
+ pollingMaxRetryAfterMs?: number;
1520
+ /**
1521
+ * Positive-only jitter applied to fallback poll delays, as a ratio of the
1522
+ * delay. Default 0.1. Set to 0 for deterministic timing.
1523
+ */
1524
+ pollingJitterRatio?: number;
1525
+ /**
1526
+ * How often to re-attempt SSE while in fallback polling (ms). Default 60000.
1527
+ * A transient outage must not cost the session its stream for good.
1528
+ */
1529
+ sseRetryIntervalMs?: number;
1477
1530
  }
1478
1531
 
1479
1532
  /**
@@ -2742,7 +2795,17 @@ interface KanbanLane {
2742
2795
  * a tick fans out ⌈cap / chunkSize⌉ runs. Ignored for `per-card`/`event` lanes.
2743
2796
  */
2744
2797
  chunkSize?: number;
2798
+ /**
2799
+ * p46 Handoff contract, OPT-IN per lane (D1). Absent ⇒ `off` (existing boards
2800
+ * are byte-identical). `verdict` ⇒ the engine sends
2801
+ * `HANDOFF_VERDICT_JSON_SCHEMA` as the run's `context.outputSchema` and a
2802
+ * completion MUST carry a valid verdict (else the run fails with a FAILED
2803
+ * handoff). Active only on hosts whose adapter implements the ledger group.
2804
+ */
2805
+ handoff?: KanbanLaneHandoffMode;
2745
2806
  }
2807
+ /** Per-lane Handoff mode (p46 D1). */
2808
+ type KanbanLaneHandoffMode = "off" | "verdict";
2746
2809
  /**
2747
2810
  * A declared edge between two lanes in the lifecycle.
2748
2811
  *
package/dist/index.d.ts CHANGED
@@ -1472,8 +1472,61 @@ interface StreamingConfig {
1472
1472
  reconnectMaxDelayMs: number;
1473
1473
  /** Activity timeout - no events for this long triggers reconnect (ms) */
1474
1474
  activityTimeoutMs: number;
1475
- /** Polling interval for fallback mode (ms) */
1475
+ /**
1476
+ * Base polling interval for fallback mode (ms).
1477
+ *
1478
+ * This is a FLOOR, not a fixed period: the fallback loop starts here and
1479
+ * backs off from it when polls fail or stop learning anything new
1480
+ * (see {@link pollingMaxIntervalMs}).
1481
+ */
1476
1482
  pollingIntervalMs: number;
1483
+ /**
1484
+ * Ceiling the fallback poll delay backs off to (ms). Default 30000.
1485
+ * Bounds the request rate of a fallback loop that is failing or idle.
1486
+ */
1487
+ pollingMaxIntervalMs?: number;
1488
+ /**
1489
+ * Consecutive poll failures (non-429) before the loop gives up and surfaces
1490
+ * an error instead of retrying forever. Default 10.
1491
+ */
1492
+ pollingMaxConsecutiveFailures?: number;
1493
+ /**
1494
+ * Consecutive 429 responses before the loop gives up. Default 3.
1495
+ * A 429 is not transient noise — it means the quota window is spent, and
1496
+ * continuing to probe it starves every other feature on the same key.
1497
+ */
1498
+ pollingMaxConsecutiveRateLimits?: number;
1499
+ /**
1500
+ * Consecutive 4xx responses (excluding 429 and 408) from the status endpoint
1501
+ * before the loop gives up. Default 3. A 4xx will not fix itself by asking
1502
+ * again — a wrong path, a dead run id or rejected auth all land here — but a
1503
+ * poll issued immediately after dispatch can legitimately 404 once, hence a
1504
+ * small tolerance rather than the SSE side's instant termination.
1505
+ */
1506
+ pollingMaxConsecutiveClientErrors?: number;
1507
+ /**
1508
+ * How long the fallback loop may go without learning anything before it gives
1509
+ * up (ms). Default 1800000 (30 min). Measured from the last poll that
1510
+ * observed a new log or a status change — NOT from when the loop started, so
1511
+ * a fallback that is still delivering output is never cut off.
1512
+ */
1513
+ pollingMaxDurationMs?: number;
1514
+ /**
1515
+ * Longest server-named `Retry-After` the loop will sit out (ms). Default
1516
+ * 300000 (5 min). Beyond this the loop gives up rather than silently
1517
+ * holding a session open for a reset that far away.
1518
+ */
1519
+ pollingMaxRetryAfterMs?: number;
1520
+ /**
1521
+ * Positive-only jitter applied to fallback poll delays, as a ratio of the
1522
+ * delay. Default 0.1. Set to 0 for deterministic timing.
1523
+ */
1524
+ pollingJitterRatio?: number;
1525
+ /**
1526
+ * How often to re-attempt SSE while in fallback polling (ms). Default 60000.
1527
+ * A transient outage must not cost the session its stream for good.
1528
+ */
1529
+ sseRetryIntervalMs?: number;
1477
1530
  }
1478
1531
 
1479
1532
  /**
@@ -2742,7 +2795,17 @@ interface KanbanLane {
2742
2795
  * a tick fans out ⌈cap / chunkSize⌉ runs. Ignored for `per-card`/`event` lanes.
2743
2796
  */
2744
2797
  chunkSize?: number;
2798
+ /**
2799
+ * p46 Handoff contract, OPT-IN per lane (D1). Absent ⇒ `off` (existing boards
2800
+ * are byte-identical). `verdict` ⇒ the engine sends
2801
+ * `HANDOFF_VERDICT_JSON_SCHEMA` as the run's `context.outputSchema` and a
2802
+ * completion MUST carry a valid verdict (else the run fails with a FAILED
2803
+ * handoff). Active only on hosts whose adapter implements the ledger group.
2804
+ */
2805
+ handoff?: KanbanLaneHandoffMode;
2745
2806
  }
2807
+ /** Per-lane Handoff mode (p46 D1). */
2808
+ type KanbanLaneHandoffMode = "off" | "verdict";
2746
2809
  /**
2747
2810
  * A declared edge between two lanes in the lifecycle.
2748
2811
  *