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 +20 -0
- package/dist/ai-server.js +1 -1
- package/dist/client.js +1 -1
- package/dist/http.js +1 -1
- package/dist/{internal-D6wNxTck.js → internal-gCd5qMry.js} +9 -1
- package/dist/{log-polling-6COoN60V.js → log-polling-DZ1MiKLg.js} +3 -2
- package/dist/log-postgres.js +1 -1
- package/dist/log-redis-core-CyJ5L8yR.js +836 -0
- package/dist/log-redis-http.d.ts +21 -0
- package/dist/log-redis-http.js +62 -0
- package/dist/log-redis.d.ts +10 -4
- package/dist/log-redis.js +165 -828
- package/dist/log-sqlite.js +1 -1
- package/dist/recovery-vercel.js +1 -1
- package/dist/{server-BWffWe5A.js → server-BcLa4RFL.js} +23 -13
- package/dist/server.d.ts +6 -2
- package/dist/server.js +1 -1
- package/docs/01-quickstart.mdx +1 -2
- package/docs/concepts/01-contracts.mdx +3 -4
- package/docs/concepts/03-durability.mdx +14 -9
- package/docs/guides/01-timers.mdx +4 -9
- package/docs/guides/05-production.mdx +39 -2
- package/docs/index.mdx +7 -35
- package/docs/reference/01-api.mdx +26 -0
- package/package.json +2 -1
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-
|
|
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 {
|
|
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 {
|
|
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,
|
|
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 {
|
|
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 };
|
package/dist/log-postgres.js
CHANGED
|
@@ -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 {
|
|
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).
|