experimental-a2 0.1.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c2d7f17: Rework `experimental-a2/log-redis` streaming to notify + catch-up: writes to
8
+ watched sessions publish a disposable wake-up, one shared subscriber
9
+ connection per process serves every local feed, and a safety re-read heals
10
+ lost notifications — connections scale with processes, not concurrent
11
+ viewers. Add `experimental-a2/log-redis-http`: the same Redis Streams log
12
+ over a provider REST API (Upstash), connectionless, streaming via the shared
13
+ adaptive poll loop. Breaking for injected clients: `RedisConnection` gains
14
+ `on('message')` (`ioredis` already satisfies it).
15
+
16
+ ## 0.2.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 056cf86: Add `session.append.dispatch(...events)` to persist events and hand pending
21
+ handler work directly to configured recovery instead of starting it inline.
22
+
3
23
  ## 0.1.0
4
24
 
5
25
  ### Minor Changes
package/dist/ai-server.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as A2Error } from "./errors-BJRMd-h6.js";
2
- import { t as createServer } from "./server-BWffWe5A.js";
2
+ import { t as createServer } from "./server-BcLa4RFL.js";
3
3
  import { convertToModelMessages, stepCountIs, streamText, toUIMessageStream } from "ai";
4
4
  //#region src/ai-sdk-step.ts
5
5
  const CONTROLLED_SETTINGS = [
package/dist/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as validateSync } from "./validate-XKT4FSNn.js";
2
2
  import { t as A2Error } from "./errors-BJRMd-h6.js";
3
- import { r as STREAM_TIMINGS } from "./internal-D6wNxTck.js";
3
+ import { i as STREAM_TIMINGS } from "./internal-gCd5qMry.js";
4
4
  import { i as eventFromWire, o as isWireEvent, t as errorFromWire } from "./wire-BVsgR8o9.js";
5
5
  //#region src/client.ts
6
6
  /**
package/dist/http.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as A2Error } from "./errors-BJRMd-h6.js";
2
- import { r as STREAM_TIMINGS } from "./internal-D6wNxTck.js";
2
+ import { i as STREAM_TIMINGS } from "./internal-gCd5qMry.js";
3
3
  import { a as eventToWire, n as errorStatus, r as errorToWire, t as errorFromWire } from "./wire-BVsgR8o9.js";
4
4
  //#region src/http.ts
5
5
  /**
@@ -28,9 +28,17 @@ const POLL_TIMINGS = {
28
28
  activeFloorMs: 25,
29
29
  idleCeilingMs: 250
30
30
  };
31
+ /**
32
+ * Safety-read cadence for the notify-driven redis live stream. A
33
+ * parked feed re-reads the log at this interval even without a
34
+ * pub/sub wake-up, so a lost notification (subscriber reconnect gap,
35
+ * dropped PUBLISH) costs latency, never an event. Mutable only as a
36
+ * white-box test seam.
37
+ */
38
+ const NOTIFY_TIMINGS = { safetyReadMs: 1e4 };
31
39
  const STREAM_TIMINGS = {
32
40
  sseHeartbeatMs: 15e3,
33
41
  stallTimeoutMs: 35e3
34
42
  };
35
43
  //#endregion
36
- export { serverInternals as i, POLL_TIMINGS as n, STREAM_TIMINGS as r, DRAIN_TIMINGS as t };
44
+ export { serverInternals as a, STREAM_TIMINGS as i, NOTIFY_TIMINGS as n, POLL_TIMINGS as r, DRAIN_TIMINGS as t };
@@ -1,4 +1,4 @@
1
- import { n as POLL_TIMINGS } from "./internal-D6wNxTck.js";
1
+ import { r as POLL_TIMINGS } from "./internal-gCd5qMry.js";
2
2
  //#region src/log-polling.ts
3
3
  /**
4
4
  * The shared polling stream — how poll-based backends (sqlite,
@@ -14,6 +14,7 @@ import { n as POLL_TIMINGS } from "./internal-D6wNxTck.js";
14
14
  * on the cadence — each poll is a catch-up read (`index > last`, in
15
15
  * order), so nothing can be missed, only arrive a beat later.
16
16
  */
17
+ /** Unref'd cancellable timer — shared with the redis safety read. */
17
18
  const defaultSleep = (ms) => {
18
19
  let timer;
19
20
  let wake;
@@ -80,4 +81,4 @@ function pollingStream(readAfter, options) {
80
81
  } };
81
82
  }
82
83
  //#endregion
83
- export { pollingStream as t };
84
+ export { pollingStream as n, defaultSleep as t };
@@ -2,7 +2,7 @@ import { t as A2Error } from "./errors-BJRMd-h6.js";
2
2
  import { t as retryableLazy } from "./retryable-lazy-DZWmHpii.js";
3
3
  import { t as idempotentReplay } from "./idempotent-replay-BMyHrP0L.js";
4
4
  import { n as SYSTEM_CLOCK, t as RANDOM_IDS } from "./log-yJbXUf72.js";
5
- import { t as pollingStream } from "./log-polling-6COoN60V.js";
5
+ import { n as pollingStream } from "./log-polling-DZ1MiKLg.js";
6
6
  //#region src/log-postgres.ts
7
7
  /**
8
8
  * experimental-a2/log-postgres — postgres log backend (the production path).