@rikalabs/akter 0.1.0-alpha.4 → 0.1.0-alpha.5

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.5 (2026-10-09)
4
+
5
+ The framework and CLI release together on the `alpha` and `latest` npm dist-tags. Stored formats and the default Postgres pool sizes are unchanged from alpha.4.
6
+
7
+ - Adds the supported opt-in `Database.postgres({ url, preset: "low-connection" })` preset: one turn, two off-turn and one query session, for four primary Postgres sessions per runner without read replicas. Explicit pool options override the preset. This uses direct Postgres connections; it does not establish transaction-pooler support.
8
+ - Real-Postgres evidence covers a held single turn session, progressing off-turn work, migration serialization, command deduplication and process recovery. See the [low-connection verification](https://docs.akter.dev/verification/low-connection-postgres) and [deployment guidance](https://docs.akter.dev/guides/deploy).
9
+ - Includes the compute-only Akter Cloud guides and deterministic offline/content conformance timing fixes; the CLI and bundled cloud API contract are unchanged from alpha.4.
10
+
3
11
  ## 0.1.0-alpha.4 (2026-10-09)
4
12
 
5
13
  The framework and CLI release together on the `alpha` and `latest` npm dist-tags. The framework runtime and stored formats are unchanged from alpha.3; the hosted quota and cloud API contracts change during alpha.
@@ -223,6 +223,8 @@ export interface Options {
223
223
  */
224
224
  export declare const layer: (options?: Options) => Layer.Layer<Actors | ContentStore | DefectLog | InternalActors | OperatorRuntime | RuntimeControl | TelemetrySampler, import("effect/sql/Migrator").MigrationError | SqlError.SqlError, Crypto.Crypto | SqlClient.SqlClient>;
225
225
  type PostgresOptions = Omit<PgClient.PgPoolConfig, "types"> & {
226
+ /** Four primary sessions: one turn, two off-turn (one reserved by Cluster), and one query. Explicit pool sizes take precedence. */
227
+ readonly preset?: "low-connection";
226
228
  readonly offTurnConnections?: number;
227
229
  readonly queryConnections?: number;
228
230
  readonly replica?: Omit<PgClient.PgPoolConfig, "types"> | undefined;
@@ -245,6 +247,13 @@ type PostgresOptions = Omit<PgClient.PgPoolConfig, "types"> & {
245
247
  * first come, first served. Keep the sum across runners below the server's
246
248
  * `max_connections`.
247
249
  *
250
+ * `preset: "low-connection"` defaults these pools to 1/2/1 instead of
251
+ * 50/10/10. Cluster reserves one off-turn session for its entire lifetime,
252
+ * including with table leases, so the other must remain available for
253
+ * startup and ordinary work. Fleet maintenance and application reservations
254
+ * need additional off-turn capacity; optional pools add to the budget.
255
+ * Explicit pool sizes override the preset.
256
+ *
248
257
  * `replica` is this runner's nearest streaming replica of the same primary.
249
258
  * Queries read there once it has replayed the commit version their caller
250
259
  * last saw, and read the primary when it is behind or fails. Its pool
@@ -913,6 +913,13 @@ export const layer = (options = {}) => {
913
913
  * first come, first served. Keep the sum across runners below the server's
914
914
  * `max_connections`.
915
915
  *
916
+ * `preset: "low-connection"` defaults these pools to 1/2/1 instead of
917
+ * 50/10/10. Cluster reserves one off-turn session for its entire lifetime,
918
+ * including with table leases, so the other must remain available for
919
+ * startup and ordinary work. Fleet maintenance and application reservations
920
+ * need additional off-turn capacity; optional pools add to the budget.
921
+ * Explicit pool sizes override the preset.
922
+ *
916
923
  * `replica` is this runner's nearest streaming replica of the same primary.
917
924
  * Queries read there once it has replayed the commit version their caller
918
925
  * last saw, and read the primary when it is behind or fails. Its pool
@@ -932,9 +939,22 @@ function postgres(options) {
932
939
  ? Result.succeed(new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint32(0))
933
940
  : Result.fail(new PgTypes.CodecError({ message: "Invalid regclass value" })),
934
941
  });
935
- const { offTurnConnections, queryConnections, replica, coordination, ...configured } = options;
942
+ const { preset, offTurnConnections, queryConnections, replica, coordination, ...configured } = options;
936
943
  const pool = withKeepalives(configured);
937
- return Layer.mergeAll(boundedLayer({ ...pool, maxConnections: offTurnConnections ?? 10, types }), turnGroups.pipe(Layer.provideMerge(turnConnections({ ...pool, maxConnections: pool.maxConnections ?? 50, types }))), queryPoolLayer({ ...pool, maxConnections: queryConnections ?? 10, types }), replicaLayer(replica === undefined ? undefined : { ...withKeepalives(replica), types }), coordinationLayer(coordination === undefined ? undefined : { ...withKeepalives(coordination), types }));
944
+ const lowConnection = preset === "low-connection";
945
+ return Layer.mergeAll(boundedLayer({
946
+ ...pool,
947
+ maxConnections: offTurnConnections ?? (lowConnection ? 2 : 10),
948
+ types,
949
+ }), turnGroups.pipe(Layer.provideMerge(turnConnections({
950
+ ...pool,
951
+ maxConnections: pool.maxConnections ?? (lowConnection ? 1 : 50),
952
+ types,
953
+ }))), queryPoolLayer({
954
+ ...pool,
955
+ maxConnections: queryConnections ?? (lowConnection ? 1 : 10),
956
+ types,
957
+ }), replicaLayer(replica === undefined ? undefined : { ...withKeepalives(replica), types }), coordinationLayer(coordination === undefined ? undefined : { ...withKeepalives(coordination), types }));
938
958
  }
939
959
  /** Database layers for `Actors.layer`: `postgres` for real deployments, `pglite` for embedded and test use. */
940
960
  export const Database = {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@rikalabs/akter","version":"0.1.0-alpha.4","files":["dist","CHANGELOG.md","README.md","LICENSE","NOTICE"],"dependencies":{"@effect/platform-node-shared":"4.0.2","@electric-sql/pglite":"0.5.8","@noble/hashes":"2.4.0","@node-rs/xxhash":"1.7.8","koffi":"3.3.2"},"peerDependencies":{"@effect/platform-bun":"^4.0.2","@effect/platform-node":"^4.0.2","@effect/sql-pg":"^4.0.2","@effect/sql-pglite":"^4.0.2","drizzle-orm":"^1.0.0-rc.5-5935859","effect":"^4.0.2"},"publishConfig":{"access":"public"},"description":"The framework for durable, stateful backends that power realtime apps, background work, and agents.","keywords":["actor-model","actors","agents","background-jobs","bun","durable","effect","effect-ts","pglite","postgres","realtime","stateful","transactions","workflows"],"homepage":"https://github.com/Rika-Labs/akter#readme","bugs":"https://github.com/Rika-Labs/akter/issues","license":"Apache-2.0","author":"Rika Labs","repository":{"type":"git","url":"git+https://github.com/Rika-Labs/akter.git","directory":"packages/akter"},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./package.json":"./package.json"},"peerDependenciesMeta":{"@effect/platform-bun":{"optional":true},"@effect/platform-node":{"optional":true}},"engines":{"bun":">=1.4.2","node":">=24.0.0"}}
1
+ {"name":"@rikalabs/akter","version":"0.1.0-alpha.5","files":["dist","CHANGELOG.md","README.md","LICENSE","NOTICE"],"dependencies":{"@effect/platform-node-shared":"4.0.2","@electric-sql/pglite":"0.5.8","@noble/hashes":"2.4.0","@node-rs/xxhash":"1.7.8","koffi":"3.3.2"},"peerDependencies":{"@effect/platform-bun":"^4.0.2","@effect/platform-node":"^4.0.2","@effect/sql-pg":"^4.0.2","@effect/sql-pglite":"^4.0.2","drizzle-orm":"^1.0.0-rc.5-5935859","effect":"^4.0.2"},"publishConfig":{"access":"public"},"description":"The framework for durable, stateful backends that power realtime apps, background work, and agents.","keywords":["actor-model","actors","agents","background-jobs","bun","durable","effect","effect-ts","pglite","postgres","realtime","stateful","transactions","workflows"],"homepage":"https://github.com/Rika-Labs/akter#readme","bugs":"https://github.com/Rika-Labs/akter/issues","license":"Apache-2.0","author":"Rika Labs","repository":{"type":"git","url":"git+https://github.com/Rika-Labs/akter.git","directory":"packages/akter"},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./package.json":"./package.json"},"peerDependenciesMeta":{"@effect/platform-bun":{"optional":true},"@effect/platform-node":{"optional":true}},"engines":{"bun":">=1.4.2","node":">=24.0.0"}}