experimental-a2 0.8.0 → 0.9.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/AGENTS.md +11 -0
- package/CHANGELOG.md +36 -0
- package/README.md +29 -0
- package/dist/actor-client.d.ts +46 -0
- package/dist/actor-client.d.ts.map +1 -0
- package/dist/actor-client.js +54 -0
- package/dist/actor-client.js.map +1 -0
- package/dist/actor-react.d.ts +54 -0
- package/dist/actor-react.d.ts.map +1 -0
- package/dist/actor-react.js +79 -0
- package/dist/actor-react.js.map +1 -0
- package/dist/actor-shared-BACubf4x.d.ts +136 -0
- package/dist/actor-shared-BACubf4x.d.ts.map +1 -0
- package/dist/actor-shared-DI7J5upy.js +127 -0
- package/dist/actor-shared-DI7J5upy.js.map +1 -0
- package/dist/actor.browser.d.ts +1 -0
- package/dist/actor.browser.js +13 -0
- package/dist/actor.browser.js.map +1 -0
- package/dist/actor.d.ts +176 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +437 -0
- package/dist/actor.js.map +1 -0
- package/dist/ai-server.d.ts +2 -2
- package/dist/ai-server.js +2 -2
- package/dist/ai.d.ts +2 -2
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/{errors-BQuJpe82.js → errors-DCk6ch5n.js} +16 -2
- package/dist/{errors-BQuJpe82.js.map → errors-DCk6ch5n.js.map} +1 -1
- package/dist/{idempotent-replay-DuqEkYA7.js → idempotent-replay-DVOlyYbx.js} +2 -2
- package/dist/{idempotent-replay-DuqEkYA7.js.map → idempotent-replay-DVOlyYbx.js.map} +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/react.d.ts +1 -1
- package/dist/{contract-jIfaR085.d.ts → reducer-DJKWm3cp.d.ts} +39 -39
- package/dist/reducer-DJKWm3cp.d.ts.map +1 -0
- package/dist/scheduler-qstash.d.ts +2 -2
- package/dist/scheduler-qstash.js +2 -2
- package/dist/scheduler-vercel.d.ts +2 -2
- package/dist/scheduler-vercel.js +1 -1
- package/dist/{server-B2XNevQA.js → server-CBET-jSz.js} +6 -6
- package/dist/server-CBET-jSz.js.map +1 -0
- package/dist/{server-DjPhHnbI.d.ts → server-CKY3_lbw.d.ts} +3 -3
- package/dist/{server-DjPhHnbI.d.ts.map → server-CKY3_lbw.d.ts.map} +1 -1
- package/dist/server.d.ts +3 -3
- package/dist/server.js +1 -1
- package/dist/{store-RJO35BMj.d.ts → store-DGHeBtIQ.d.ts} +2 -2
- package/dist/{store-RJO35BMj.d.ts.map → store-DGHeBtIQ.d.ts.map} +1 -1
- package/dist/store-memory.d.ts +1 -1
- package/dist/store-memory.js +2 -2
- package/dist/store-postgres.d.ts +1 -1
- package/dist/store-postgres.js +2 -2
- package/dist/{store-redis-core-DT01r4GZ.js → store-redis-core-z-ykbyMg.js} +3 -3
- package/dist/{store-redis-core-DT01r4GZ.js.map → store-redis-core-z-ykbyMg.js.map} +1 -1
- package/dist/store-redis-http.d.ts +1 -1
- package/dist/store-redis-http.js +2 -2
- package/dist/store-redis.d.ts +1 -1
- package/dist/store-redis.js +2 -2
- package/dist/store-sqlite.d.ts +1 -1
- package/dist/store-sqlite.js +2 -2
- package/dist/{wire-B6te_wns.js → wire--yji6mO3.js} +2 -2
- package/dist/{wire-B6te_wns.js.map → wire--yji6mO3.js.map} +1 -1
- package/docs/actors/01-introduction.mdx +189 -0
- package/docs/actors/02-concurrency.mdx +154 -0
- package/docs/actors/03-timers.mdx +120 -0
- package/docs/actors/04-routes.mdx +352 -0
- package/docs/actors/meta.ts +1 -0
- package/docs/concepts/meta.ts +1 -0
- package/docs/guides/07-examples.mdx +56 -0
- package/docs/guides/meta.ts +1 -0
- package/docs/index.mdx +16 -0
- package/docs/reference/02-errors.mdx +33 -0
- package/docs/reference/meta.ts +1 -0
- package/examples/README.md +15 -0
- package/examples/playground/AGENTS.md +11 -0
- package/examples/playground/DEPLOY.md +106 -0
- package/examples/playground/README.md +19 -0
- package/examples/playground/activity-feed.test.ts +10 -0
- package/examples/playground/app/agent/[agentId]/agent-client.tsx +376 -0
- package/examples/playground/app/agent/[agentId]/page.tsx +29 -0
- package/examples/playground/app/agent/events/route.ts +4 -0
- package/examples/playground/app/agent/model.ts +3 -0
- package/examples/playground/app/agent/new-agent-session.tsx +98 -0
- package/examples/playground/app/agent/page.tsx +25 -0
- package/examples/playground/app/agent/scheduler/route.ts +5 -0
- package/examples/playground/app/agent/server.ts +153 -0
- package/examples/playground/app/agent/session.ts +13 -0
- package/examples/playground/app/canvas/[canvasId]/canvas-client.tsx +682 -0
- package/examples/playground/app/canvas/[canvasId]/canvas-replay.test.ts +68 -0
- package/examples/playground/app/canvas/[canvasId]/canvas-replay.ts +19 -0
- package/examples/playground/app/canvas/[canvasId]/page.tsx +22 -0
- package/examples/playground/app/canvas/[canvasId]/session.ts +19 -0
- package/examples/playground/app/canvas/events/route.ts +13 -0
- package/examples/playground/app/canvas/model.ts +94 -0
- package/examples/playground/app/canvas/open-canvas.tsx +40 -0
- package/examples/playground/app/canvas/page.tsx +20 -0
- package/examples/playground/app/canvas/server.ts +9 -0
- package/examples/playground/app/chat/[chatId]/agent-stream-drawer.test.tsx +118 -0
- package/examples/playground/app/chat/[chatId]/agent-stream-drawer.tsx +316 -0
- package/examples/playground/app/chat/[chatId]/chat-client.tsx +922 -0
- package/examples/playground/app/chat/[chatId]/chat-view.test.ts +152 -0
- package/examples/playground/app/chat/[chatId]/chat-view.ts +101 -0
- package/examples/playground/app/chat/[chatId]/composer.test.ts +44 -0
- package/examples/playground/app/chat/[chatId]/composer.ts +30 -0
- package/examples/playground/app/chat/[chatId]/page.tsx +30 -0
- package/examples/playground/app/chat/[chatId]/session.ts +7 -0
- package/examples/playground/app/chat/events/route.ts +7 -0
- package/examples/playground/app/chat/model.test.ts +155 -0
- package/examples/playground/app/chat/model.ts +310 -0
- package/examples/playground/app/chat/new-conversation.tsx +16 -0
- package/examples/playground/app/chat/page.tsx +25 -0
- package/examples/playground/app/chat/scheduler/route.ts +5 -0
- package/examples/playground/app/chat/server.ts +184 -0
- package/examples/playground/app/components/activity-feed.tsx +54 -0
- package/examples/playground/app/components/connection-pill.tsx +29 -0
- package/examples/playground/app/counter/counter-client.tsx +72 -0
- package/examples/playground/app/counter/events/route.ts +4 -0
- package/examples/playground/app/counter/model.test.ts +36 -0
- package/examples/playground/app/counter/model.ts +31 -0
- package/examples/playground/app/counter/page.tsx +24 -0
- package/examples/playground/app/counter/server.ts +9 -0
- package/examples/playground/app/counter/session.ts +13 -0
- package/examples/playground/app/documents/[documentId]/code-editor.tsx +80 -0
- package/examples/playground/app/documents/[documentId]/document-client.tsx +525 -0
- package/examples/playground/app/documents/[documentId]/page.tsx +23 -0
- package/examples/playground/app/documents/[documentId]/session.ts +7 -0
- package/examples/playground/app/documents/events/route.ts +4 -0
- package/examples/playground/app/documents/model.ts +55 -0
- package/examples/playground/app/documents/open-document.tsx +40 -0
- package/examples/playground/app/documents/page.tsx +22 -0
- package/examples/playground/app/documents/server.ts +9 -0
- package/examples/playground/app/globals.css +2078 -0
- package/examples/playground/app/layout.tsx +44 -0
- package/examples/playground/app/orders/[orderId]/order-client.tsx +140 -0
- package/examples/playground/app/orders/[orderId]/page.tsx +29 -0
- package/examples/playground/app/orders/[orderId]/session.ts +11 -0
- package/examples/playground/app/orders/create/route.ts +30 -0
- package/examples/playground/app/orders/events/route.ts +4 -0
- package/examples/playground/app/orders/model.ts +79 -0
- package/examples/playground/app/orders/new-order-form.tsx +98 -0
- package/examples/playground/app/orders/page.tsx +22 -0
- package/examples/playground/app/orders/scheduler/route.ts +5 -0
- package/examples/playground/app/orders/server.ts +50 -0
- package/examples/playground/app/page.tsx +111 -0
- package/examples/playground/app/recovery/[recoveryId]/page.tsx +31 -0
- package/examples/playground/app/recovery/[recoveryId]/recovery-client.tsx +144 -0
- package/examples/playground/app/recovery/[recoveryId]/session.ts +7 -0
- package/examples/playground/app/recovery/events/route.ts +3 -0
- package/examples/playground/app/recovery/model.ts +55 -0
- package/examples/playground/app/recovery/new-recovery-session.tsx +20 -0
- package/examples/playground/app/recovery/page.tsx +22 -0
- package/examples/playground/app/recovery/scheduler/route.ts +7 -0
- package/examples/playground/app/recovery/server.ts +53 -0
- package/examples/playground/app/recovery/start/route.ts +41 -0
- package/examples/playground/app/vault/[vaultId]/route.ts +19 -0
- package/examples/playground/app/vault/page.tsx +12 -0
- package/examples/playground/app/vault/server.ts +9 -0
- package/examples/playground/app/vault/vault-client.tsx +124 -0
- package/examples/playground/app/vault/vault.test.ts +147 -0
- package/examples/playground/app/vault/vault.ts +119 -0
- package/examples/playground/css.d.ts +4 -0
- package/examples/playground/lib/store.ts +15 -0
- package/examples/playground/next-env.d.ts +5 -0
- package/examples/playground/next.config.ts +10 -0
- package/examples/playground/package.json +46 -0
- package/examples/playground/tsconfig.json +37 -0
- package/examples/playground/vercel.json +40 -0
- package/package.json +11 -2
- package/src/actor-client.ts +132 -0
- package/src/actor-react.ts +143 -0
- package/src/actor-shared.ts +356 -0
- package/src/actor.browser.ts +12 -0
- package/src/actor.ts +914 -0
- package/src/client.ts +9 -1
- package/src/errors.ts +15 -0
- package/src/index.ts +1 -1
- package/src/server.ts +13 -3
- package/dist/contract-jIfaR085.d.ts.map +0 -1
- package/dist/server-B2XNevQA.js.map +0 -1
|
@@ -61,43 +61,6 @@ declare namespace StandardSchemaV1 {
|
|
|
61
61
|
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
|
-
//#region src/reducer.d.ts
|
|
65
|
-
/**
|
|
66
|
-
* A pure fold over a session's events — `(state, event) => state` —
|
|
67
|
-
* derived from a contract via `contract.reducer(options).fold(fn)`.
|
|
68
|
-
*
|
|
69
|
-
* The name is the reducer's identity. Cached folds (server snapshots,
|
|
70
|
-
* the browser cache) are keyed by it, which makes it the invalidation
|
|
71
|
-
* knob too: changed the fold's logic? Change the name. Snapshots under
|
|
72
|
-
* the old name are ignored and the next read refolds from raw events.
|
|
73
|
-
* See docs/concepts/04-state.mdx.
|
|
74
|
-
*/
|
|
75
|
-
type Reducer<D extends EventDefs = EventDefs, S = unknown, P extends PresenceDefs = Record<never, never>> = {
|
|
76
|
-
/** Identity and cache key. Rename when the fold's logic changes. */
|
|
77
|
-
readonly name: string;
|
|
78
|
-
/** The contract's vocabulary — types every event in the fold. */
|
|
79
|
-
readonly events: Readonly<D>;
|
|
80
|
-
/**
|
|
81
|
-
* The contract's presence vocabulary — carried because the reducer
|
|
82
|
-
* is the client's typed handle on the contract. The fold never sees
|
|
83
|
-
* presence.
|
|
84
|
-
*/
|
|
85
|
-
readonly presence: Readonly<P>;
|
|
86
|
-
readonly fold: (state: S, event: ContractEvent<D>) => S;
|
|
87
|
-
readonly initialState: S;
|
|
88
|
-
/**
|
|
89
|
-
* When present: `initialState` was validated against it at
|
|
90
|
-
* definition, and any cached fold a2 rehydrates (server snapshots,
|
|
91
|
-
* the browser cache) is checked against it — failing snapshots are
|
|
92
|
-
* discarded and refolded, catching shape drift a stale name can't.
|
|
93
|
-
*/
|
|
94
|
-
readonly stateSchema: StandardSchemaV1<unknown, S> | undefined;
|
|
95
|
-
};
|
|
96
|
-
/** The second step of `contract.reducer` — see the method's doc. */
|
|
97
|
-
type ReducerBuilder<D extends EventDefs, S, P extends PresenceDefs = Record<never, never>> = {
|
|
98
|
-
fold(fold: (state: S, event: ContractEvent<D>) => S): Reducer<D, S, P>;
|
|
99
|
-
};
|
|
100
|
-
//#endregion
|
|
101
64
|
//#region src/contract.d.ts
|
|
102
65
|
/** The event vocabulary shape: event name → payload schema. */
|
|
103
66
|
type EventDefs = Record<string, StandardSchemaV1>;
|
|
@@ -215,5 +178,42 @@ declare function contract<D extends EventDefs, P extends PresenceDefs = Record<n
|
|
|
215
178
|
presence?: P;
|
|
216
179
|
}): Contract<D, P>;
|
|
217
180
|
//#endregion
|
|
218
|
-
|
|
219
|
-
|
|
181
|
+
//#region src/reducer.d.ts
|
|
182
|
+
/**
|
|
183
|
+
* A pure fold over a session's events — `(state, event) => state` —
|
|
184
|
+
* derived from a contract via `contract.reducer(options).fold(fn)`.
|
|
185
|
+
*
|
|
186
|
+
* The name is the reducer's identity. Cached folds (server snapshots,
|
|
187
|
+
* the browser cache) are keyed by it, which makes it the invalidation
|
|
188
|
+
* knob too: changed the fold's logic? Change the name. Snapshots under
|
|
189
|
+
* the old name are ignored and the next read refolds from raw events.
|
|
190
|
+
* See docs/concepts/04-state.mdx.
|
|
191
|
+
*/
|
|
192
|
+
type Reducer<D extends EventDefs = EventDefs, S = unknown, P extends PresenceDefs = Record<never, never>> = {
|
|
193
|
+
/** Identity and cache key. Rename when the fold's logic changes. */
|
|
194
|
+
readonly name: string;
|
|
195
|
+
/** The contract's vocabulary — types every event in the fold. */
|
|
196
|
+
readonly events: Readonly<D>;
|
|
197
|
+
/**
|
|
198
|
+
* The contract's presence vocabulary — carried because the reducer
|
|
199
|
+
* is the client's typed handle on the contract. The fold never sees
|
|
200
|
+
* presence.
|
|
201
|
+
*/
|
|
202
|
+
readonly presence: Readonly<P>;
|
|
203
|
+
readonly fold: (state: S, event: ContractEvent<D>) => S;
|
|
204
|
+
readonly initialState: S;
|
|
205
|
+
/**
|
|
206
|
+
* When present: `initialState` was validated against it at
|
|
207
|
+
* definition, and any cached fold a2 rehydrates (server snapshots,
|
|
208
|
+
* the browser cache) is checked against it — failing snapshots are
|
|
209
|
+
* discarded and refolded, catching shape drift a stale name can't.
|
|
210
|
+
*/
|
|
211
|
+
readonly stateSchema: StandardSchemaV1<unknown, S> | undefined;
|
|
212
|
+
};
|
|
213
|
+
/** The second step of `contract.reducer` — see the method's doc. */
|
|
214
|
+
type ReducerBuilder<D extends EventDefs, S, P extends PresenceDefs = Record<never, never>> = {
|
|
215
|
+
fold(fold: (state: S, event: ContractEvent<D>) => S): Reducer<D, S, P>;
|
|
216
|
+
};
|
|
217
|
+
//#endregion
|
|
218
|
+
export { ContractEvent as a, PresenceDefs as c, PresenceSnapshot as d, ReducerOptions as f, StandardSchemaV1 as h, Contract as i, PresenceMap as l, contract as m, ReducerBuilder as n, EventBatchFactory as o, WithPresence as p, AppendInput as r, EventDefs as s, Reducer as t, PresencePatch as u };
|
|
219
|
+
//# sourceMappingURL=reducer-DJKWm3cp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer-DJKWm3cp.d.ts","names":[],"sources":["../src/standard-schema.ts","../src/contract.ts","../src/reducer.ts"],"mappings":";;;;;;;;UAQiB,iBAAiB,iBAAiB,SAAS;;WAEjD,aAAa,iBAAiB,MAAM,OAAO;;kBAG7B;;mBAEN,MAAM,iBAAiB,SAAS;;aAEtC;;aAEA;;aAEA,WACP,mBACG,OAAO,UAAU,QAAQ,OAAO;;aAE5B,QAAQ,MAAM,OAAO;;;cAIpB,OAAO,UAAU,cAAc,UAAU;;mBAGpC,cAAc;;aAEpB,OAAO;;aAEP;;;mBAIM;;aAEN,QAAQ,cAAc;;;mBAIhB;;aAEN;;aAEA,OAAO,cAAc,cAAc;;;mBAI7B;;aAEN,KAAK;;;mBAIC,MAAM,iBAAiB,SAAS;;aAEtC,OAAO;;aAEP,QAAQ;;;cAIP,WAAW,eAAe,oBAAoB,YACxD;;cAIU,YAAY,eAAe,oBAAoB,YACzD;;;;;KC1DQ,YAAY,eAAe;;KAG3B,eAAe,eAAe;;KAG9B,cACV,UAAU,WACV,gBAAgB,mBAAmB,iBAElC,WAAW;EACV;EACA,MAAM;EACN,SAAS,iBAAiB,YAAY,EAAE;EACxC;EACA;EACA,WAAW;KAEb;;KAGU,YAAY,UAAU,gBAC/B,WAAW;EACV,MAAM;EACN,SAAS,iBAAiB,WAAW,EAAE;EACvC;WAEI;KAEI,kBAAkB,UAAU,oBAChC,mBAAmB,YAAY,SAElC,QAAQ,MACR;;;;;;KAOO,cAAc,UAAU,eAAe;EACjD;EACA,WACG,WAAW,cAAc,iBAAiB,YAAY,EAAE;EAE3D;EACA,IAAI;;;;;;;;KASM,YAAY,UAAU,eAAe;GAE5C,yBAAA,WAAW;IACV,OAAO,iBAAiB,YAAY,EAAE;IACtC;IACA,IAAI;;;;;;;;KAUE,iBAAiB,UAAU,eAAe;EACpD,UAAU,YAAY;;;;;;;KAQZ,aACV,UAAU,cACV,iBACQ,4BAA4B;KAE1B,eAAe,MAAM;;;;;EAK/B;;;;;;EAMA,cAAc;;;;;;EAMd,cAAc,iBAAiB,MAAM;;KAG3B,SACV,UAAU,YAAY,WACtB,UAAU,eAAe;;WAGhB;;WAEA,QAAQ,SAAS;;WAEjB,UAAU,SAAS;;WAEnB,OAAO,kBAAkB;;;;;;;;;;;EAWlC,QAAQ,MAAM,IAAI,MAChB,SAAS,eAAe,MAAM,KAC7B,eAAe,GAAG,GAAG;;;;;;;iBAQV,SACd,UAAU,WACV,UAAU,eAAe,sBACzB;;EAEA;;EAEA,QAAQ;;;;;;EAMR,WAAW;IACT,SAAS,GAAG;;;;;;;;;;;;;KCxJJ,QACV,UAAU,YAAY,WACtB,aACA,UAAU,eAAe;;WAGhB;;WAEA,QAAQ,SAAS;;;;;;WAMjB,UAAU,SAAS;WACnB,OAAO,OAAO,GAAG,OAAO,cAAc,OAAO;WAC7C,cAAc;;;;;;;WAOd,aAAa,0BAA0B;;;KAItC,eACV,UAAU,WACV,GACA,UAAU,eAAe;EAEzB,KAAK,OAAO,OAAO,GAAG,OAAO,cAAc,OAAO,IAAI,QAAQ,GAAG,GAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as Clock } from "./store-
|
|
2
|
-
import { T as SchedulerTask, t as A2Scheduler } from "./server-
|
|
1
|
+
import { r as Clock } from "./store-DGHeBtIQ.js";
|
|
2
|
+
import { T as SchedulerTask, t as A2Scheduler } from "./server-CKY3_lbw.js";
|
|
3
3
|
//#region src/scheduler-qstash.d.ts
|
|
4
4
|
type QStashStoreOutage = {
|
|
5
5
|
version: 1;
|
package/dist/scheduler-qstash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as A2Error } from "./errors-
|
|
1
|
+
import { t as A2Error } from "./errors-DCk6ch5n.js";
|
|
2
2
|
import { d as classifySchedulerSendFailure, g as serverInternals, t as DRAIN_TIMINGS, u as assertSchedulerTargets } from "./internal-DRXJ56EI.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as deliverSchedulerAppend, o as platformVercelOidcToken } from "./server-CBET-jSz.js";
|
|
4
4
|
import { t as retryableLazy } from "./retryable-lazy-DZWmHpii.js";
|
|
5
5
|
import { n as SYSTEM_CLOCK } from "./store-N8PXxDAS.js";
|
|
6
6
|
import { t as normalizeSchedulerTask } from "./scheduler-task-BpzhPnRS.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as Clock } from "./store-
|
|
2
|
-
import { T as SchedulerTask, t as A2Scheduler } from "./server-
|
|
1
|
+
import { r as Clock } from "./store-DGHeBtIQ.js";
|
|
2
|
+
import { T as SchedulerTask, t as A2Scheduler } from "./server-CKY3_lbw.js";
|
|
3
3
|
//#region src/scheduler-vercel.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* The "not settled yet" signal for a stalled handler — an expected state,
|
package/dist/scheduler-vercel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as classifySchedulerSendFailure, g as serverInternals, t as DRAIN_TIMINGS, u as assertSchedulerTargets } from "./internal-DRXJ56EI.js";
|
|
2
|
-
import { n as deliverSchedulerAppend } from "./server-
|
|
2
|
+
import { n as deliverSchedulerAppend } from "./server-CBET-jSz.js";
|
|
3
3
|
import { t as retryableLazy } from "./retryable-lazy-DZWmHpii.js";
|
|
4
4
|
import { n as SYSTEM_CLOCK } from "./store-N8PXxDAS.js";
|
|
5
5
|
import { t as normalizeSchedulerTask } from "./scheduler-task-BpzhPnRS.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as validateSync } from "./validate-XKT4FSNn.js";
|
|
2
|
-
import { n as asStoreUnavailable, t as A2Error } from "./errors-
|
|
2
|
+
import { n as NonRetriableError, r as asStoreUnavailable, t as A2Error } from "./errors-DCk6ch5n.js";
|
|
3
3
|
import { c as STREAM_TIMINGS, g as serverInternals, h as nullProtoRecord, i as POLL_TIMINGS, m as markSchedulerSendFailure, o as RESERVED_PARTICIPANT_IDS, s as SOCKET_TIMINGS, t as DRAIN_TIMINGS } from "./internal-DRXJ56EI.js";
|
|
4
4
|
import { t as defaultSleep } from "./store-polling-6DW7F1DT.js";
|
|
5
|
-
import { _ as socketErrorAckFor, a as errorToWire, b as socketUnsubscribedFor, g as socketAckFor, h as presenceSnapshotToWire, i as errorStatus, n as asA2Error, p as presencePatchToWire, s as eventToWire, t as SOCKET_PING_FRAME, v as socketFrameFor, y as socketSubscribedFor } from "./wire
|
|
5
|
+
import { _ as socketErrorAckFor, a as errorToWire, b as socketUnsubscribedFor, g as socketAckFor, h as presenceSnapshotToWire, i as errorStatus, n as asA2Error, p as presencePatchToWire, s as eventToWire, t as SOCKET_PING_FRAME, v as socketFrameFor, y as socketSubscribedFor } from "./wire--yji6mO3.js";
|
|
6
6
|
import { t as retryableLazy } from "./retryable-lazy-DZWmHpii.js";
|
|
7
7
|
//#region src/platform.ts
|
|
8
8
|
const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
|
@@ -1364,7 +1364,7 @@ function createServer(options) {
|
|
|
1364
1364
|
const validated = nullProtoRecord();
|
|
1365
1365
|
for (const [field, value] of Object.entries(patch.values)) {
|
|
1366
1366
|
if (value === void 0) continue;
|
|
1367
|
-
const schema = Object.hasOwn(presenceDefs, field) ? presenceDefs[field] : void 0;
|
|
1367
|
+
const schema = Object.hasOwn(presenceDefs, field) ? presenceDefs[field] : RESERVED_PARTICIPANT_IDS.has(field) ? void 0 : presenceDefs["*"];
|
|
1368
1368
|
if (!schema) throw new A2Error("UNKNOWN_PRESENCE_FIELD", `contract '${name}' has no presence field '${field}'`);
|
|
1369
1369
|
if (value === null) {
|
|
1370
1370
|
validated[field] = null;
|
|
@@ -1870,7 +1870,7 @@ function createServer(options) {
|
|
|
1870
1870
|
index: event.index,
|
|
1871
1871
|
attempt: event.attemptCount,
|
|
1872
1872
|
error: describeError(err),
|
|
1873
|
-
maxFailures: MAX_FAILURES
|
|
1873
|
+
maxFailures: err instanceof NonRetriableError ? 1 : MAX_FAILURES
|
|
1874
1874
|
});
|
|
1875
1875
|
eventSpan.setAttribute("a2.event.outcome", failure.outcome);
|
|
1876
1876
|
return {
|
|
@@ -2157,6 +2157,6 @@ function cloneInitial(initial) {
|
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
2159
|
//#endregion
|
|
2160
|
-
export {
|
|
2160
|
+
export { parsePresenceSibling as a, sseResponse as i, deliverSchedulerAppend as n, platformVercelOidcToken as o, setServerFetchHooks as r, createServer as t };
|
|
2161
2161
|
|
|
2162
|
-
//# sourceMappingURL=server-
|
|
2162
|
+
//# sourceMappingURL=server-CBET-jSz.js.map
|