@rikalabs/akter 0.1.0-alpha.0 → 0.1.0-alpha.3
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 +46 -3
- package/README.md +2 -2
- package/dist/actor/definition.d.ts +13 -9
- package/dist/actor/descriptor.d.ts +2 -2
- package/dist/actor/descriptor.js +4 -4
- package/dist/client/calls.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/errors/actor.d.ts +12 -42
- package/dist/errors/actor.js +13 -42
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/members/payload.d.ts +1 -1
- package/dist/protocol/inspection.d.ts +221 -1
- package/dist/protocol/inspection.js +151 -2
- package/dist/protocol/wire.d.ts +6 -49
- package/dist/protocol/wire.js +1 -10
- package/dist/runtime/actors.d.ts +3 -0
- package/dist/runtime/adoption/backfill.js +1 -1
- package/dist/runtime/adoption/enforce.js +2 -2
- package/dist/runtime/adoption/observe.js +1 -1
- package/dist/runtime/adoption/plan.d.ts +1 -1
- package/dist/runtime/adoption/startup.js +1 -1
- package/dist/runtime/adoption/status.d.ts +1 -1
- package/dist/runtime/app.d.ts +65 -0
- package/dist/runtime/app.js +38 -0
- package/dist/runtime/connections/holder.d.ts +11 -1
- package/dist/runtime/connections/holder.js +8 -4
- package/dist/runtime/connections/streams.d.ts +4 -4
- package/dist/runtime/content/store.js +15 -11
- package/dist/runtime/database/bounded.d.ts +4 -18
- package/dist/runtime/database/bounded.js +36 -22
- package/dist/runtime/database/coordination.d.ts +12 -3
- package/dist/runtime/database/coordination.js +29 -36
- package/dist/runtime/database/migrations.d.ts +61 -29
- package/dist/runtime/database/migrations.js +375 -139
- package/dist/runtime/database/replica.d.ts +4 -1
- package/dist/runtime/database/replica.js +4 -1
- package/dist/runtime/database/schema.d.ts +13 -0
- package/dist/runtime/database/schema.js +13 -0
- package/dist/runtime/database/shards.d.ts +31 -13
- package/dist/runtime/database/shards.js +38 -26
- package/dist/runtime/entity/register.d.ts +8 -1
- package/dist/runtime/entity/register.js +58 -7
- package/dist/runtime/fleet/checks.js +4 -4
- package/dist/runtime/fleet/maintainer.d.ts +1 -1
- package/dist/runtime/fleet/maintainer.js +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/inspector/layer.d.ts +20 -0
- package/dist/runtime/inspector/layer.js +224 -5
- package/dist/runtime/inspector/queries.d.ts +54 -8
- package/dist/runtime/inspector/queries.js +84 -15
- package/dist/runtime/layer.d.ts +48 -39
- package/dist/runtime/layer.js +124 -56
- package/dist/runtime/operators/audit.d.ts +3 -0
- package/dist/runtime/operators/audit.js +6 -2
- package/dist/runtime/operators/repair.js +30 -10
- package/dist/runtime/operators/seed.js +4 -2
- package/dist/runtime/payloads/versions.d.ts +4 -4
- package/dist/runtime/payloads/versions.js +24 -15
- package/dist/runtime/queries.js +4 -2
- package/dist/runtime/registration.d.ts +5 -2
- package/dist/runtime/registration.js +3 -3
- package/dist/runtime/runner.d.ts +12 -0
- package/dist/runtime/runner.js +12 -0
- package/dist/runtime/storage/codec.d.ts +19 -7
- package/dist/runtime/storage/codec.js +23 -7
- package/dist/runtime/storage/placements.d.ts +6 -1
- package/dist/runtime/storage/placements.js +98 -6
- package/dist/runtime/storage/retention.d.ts +6 -0
- package/dist/runtime/storage/retention.js +25 -13
- package/dist/runtime/subscriptions/relay.js +47 -44
- package/dist/runtime/subscriptions/storage.d.ts +3 -2
- package/dist/runtime/subscriptions/storage.js +9 -6
- package/dist/runtime/telemetry/live.d.ts +255 -0
- package/dist/runtime/telemetry/live.js +540 -0
- package/dist/runtime/telemetry/metrics.d.ts +2 -0
- package/dist/runtime/telemetry/metrics.js +4 -1
- package/dist/runtime/telemetry/sampler.js +33 -13
- package/dist/runtime/telemetry/spans.d.ts +1 -1
- package/dist/runtime/telemetry/spans.js +1 -1
- package/dist/runtime/topology/locks.d.ts +6 -3
- package/dist/runtime/topology/locks.js +27 -4
- package/dist/runtime/turn/execute.d.ts +2 -0
- package/dist/runtime/turn/execute.js +5 -2
- package/dist/runtime/turn/pipeline.d.ts +5 -12
- package/dist/runtime/turn/pipeline.js +11 -11
- package/dist/runtime/turn/relay.d.ts +13 -3
- package/dist/runtime/turn/relay.js +27 -14
- package/dist/runtime/turn/rows.js +4 -4
- package/dist/runtime/workflows/compatibility.d.ts +1 -1
- package/dist/runtime/workflows/compatibility.js +85 -31
- package/dist/runtime/workflows/engine.js +20 -17
- package/dist/serve/layer.js +3 -2
- package/dist/tables/owned.d.ts +1 -1
- package/dist/tables/owned.js +1 -1
- package/dist/testing/actor-test.d.ts +2 -24
- package/dist/testing/actor-test.js +1 -27
- package/dist/testing/index.d.ts +0 -12
- package/dist/testing/index.js +0 -6
- package/package.json +1 -1
- package/dist/runtime/database/neki/migrations.d.ts +0 -31
- package/dist/runtime/database/neki/migrations.js +0 -276
- package/dist/runtime/database/neki/session.d.ts +0 -23
- package/dist/runtime/database/neki/session.js +0 -31
- package/dist/testing/cluster.d.ts +0 -93
- package/dist/testing/cluster.js +0 -296
- package/dist/testing/conformance/access.d.ts +0 -5
- package/dist/testing/conformance/access.js +0 -531
- package/dist/testing/conformance/admission.d.ts +0 -11
- package/dist/testing/conformance/admission.js +0 -182
- package/dist/testing/conformance/adoption.d.ts +0 -2
- package/dist/testing/conformance/adoption.js +0 -1019
- package/dist/testing/conformance/assertions.d.ts +0 -202
- package/dist/testing/conformance/assertions.js +0 -849
- package/dist/testing/conformance/batches.d.ts +0 -41
- package/dist/testing/conformance/batches.js +0 -388
- package/dist/testing/conformance/blobs.d.ts +0 -14
- package/dist/testing/conformance/blobs.js +0 -405
- package/dist/testing/conformance/capacity.d.ts +0 -8
- package/dist/testing/conformance/capacity.js +0 -433
- package/dist/testing/conformance/client.d.ts +0 -5
- package/dist/testing/conformance/client.js +0 -719
- package/dist/testing/conformance/cold-serve.d.ts +0 -16
- package/dist/testing/conformance/cold-serve.js +0 -254
- package/dist/testing/conformance/connections/actors.d.ts +0 -1143
- package/dist/testing/conformance/connections/actors.js +0 -180
- package/dist/testing/conformance/connections/harness.d.ts +0 -1754
- package/dist/testing/conformance/connections/harness.js +0 -142
- package/dist/testing/conformance/connections/holders.d.ts +0 -4
- package/dist/testing/conformance/connections/holders.js +0 -165
- package/dist/testing/conformance/connections/lifecycle.d.ts +0 -4
- package/dist/testing/conformance/connections/lifecycle.js +0 -113
- package/dist/testing/conformance/connections/limits.d.ts +0 -4
- package/dist/testing/conformance/connections/limits.js +0 -127
- package/dist/testing/conformance/connections/reauthorization.d.ts +0 -4
- package/dist/testing/conformance/connections/reauthorization.js +0 -170
- package/dist/testing/conformance/connections/resync.d.ts +0 -4
- package/dist/testing/conformance/connections/resync.js +0 -360
- package/dist/testing/conformance/connections/takeover.d.ts +0 -4
- package/dist/testing/conformance/connections/takeover.js +0 -287
- package/dist/testing/conformance/connections.d.ts +0 -4
- package/dist/testing/conformance/connections.js +0 -15
- package/dist/testing/conformance/content-blobs.d.ts +0 -16
- package/dist/testing/conformance/content-blobs.js +0 -534
- package/dist/testing/conformance/counter.d.ts +0 -16
- package/dist/testing/conformance/counter.js +0 -813
- package/dist/testing/conformance/cron.d.ts +0 -5
- package/dist/testing/conformance/cron.js +0 -665
- package/dist/testing/conformance/drain.d.ts +0 -26
- package/dist/testing/conformance/drain.js +0 -540
- package/dist/testing/conformance/effect-control.d.ts +0 -38
- package/dist/testing/conformance/effect-control.js +0 -1059
- package/dist/testing/conformance/effects.d.ts +0 -23
- package/dist/testing/conformance/effects.js +0 -432
- package/dist/testing/conformance/events.d.ts +0 -28
- package/dist/testing/conformance/events.js +0 -335
- package/dist/testing/conformance/export.d.ts +0 -2
- package/dist/testing/conformance/export.js +0 -368
- package/dist/testing/conformance/fleet.d.ts +0 -444
- package/dist/testing/conformance/fleet.js +0 -1009
- package/dist/testing/conformance/groups.d.ts +0 -7
- package/dist/testing/conformance/groups.js +0 -353
- package/dist/testing/conformance/heap.d.ts +0 -3
- package/dist/testing/conformance/heap.js +0 -149
- package/dist/testing/conformance/http.d.ts +0 -2809
- package/dist/testing/conformance/http.js +0 -1234
- package/dist/testing/conformance/inspection-views.d.ts +0 -8
- package/dist/testing/conformance/inspection-views.js +0 -272
- package/dist/testing/conformance/inspector.d.ts +0 -7
- package/dist/testing/conformance/inspector.js +0 -650
- package/dist/testing/conformance/mint.d.ts +0 -58
- package/dist/testing/conformance/mint.js +0 -692
- package/dist/testing/conformance/multi-runner.d.ts +0 -8
- package/dist/testing/conformance/multi-runner.js +0 -403
- package/dist/testing/conformance/neki/plan.d.ts +0 -19
- package/dist/testing/conformance/neki/plan.js +0 -30
- package/dist/testing/conformance/observability.d.ts +0 -3
- package/dist/testing/conformance/observability.js +0 -343
- package/dist/testing/conformance/offline.d.ts +0 -4
- package/dist/testing/conformance/offline.js +0 -474
- package/dist/testing/conformance/operator-harness.d.ts +0 -57
- package/dist/testing/conformance/operator-harness.js +0 -78
- package/dist/testing/conformance/operator.d.ts +0 -3
- package/dist/testing/conformance/operator.js +0 -379
- package/dist/testing/conformance/outbox-cross-shard.d.ts +0 -14
- package/dist/testing/conformance/outbox-cross-shard.js +0 -160
- package/dist/testing/conformance/outbox.d.ts +0 -36
- package/dist/testing/conformance/outbox.js +0 -437
- package/dist/testing/conformance/payload-migrations.d.ts +0 -3
- package/dist/testing/conformance/payload-migrations.js +0 -612
- package/dist/testing/conformance/pipeline.d.ts +0 -3
- package/dist/testing/conformance/pipeline.js +0 -1040
- package/dist/testing/conformance/placement.d.ts +0 -22
- package/dist/testing/conformance/placement.js +0 -539
- package/dist/testing/conformance/platform.d.ts +0 -40
- package/dist/testing/conformance/platform.js +0 -101
- package/dist/testing/conformance/progress.d.ts +0 -39
- package/dist/testing/conformance/progress.js +0 -666
- package/dist/testing/conformance/properties.d.ts +0 -6
- package/dist/testing/conformance/properties.js +0 -295
- package/dist/testing/conformance/protocols.d.ts +0 -4
- package/dist/testing/conformance/protocols.js +0 -618
- package/dist/testing/conformance/provider/advertise.d.ts +0 -21
- package/dist/testing/conformance/provider/advertise.js +0 -44
- package/dist/testing/conformance/read-your-writes.d.ts +0 -20
- package/dist/testing/conformance/read-your-writes.js +0 -192
- package/dist/testing/conformance/reducers.d.ts +0 -8
- package/dist/testing/conformance/reducers.js +0 -258
- package/dist/testing/conformance/relay.d.ts +0 -42
- package/dist/testing/conformance/relay.js +0 -1115
- package/dist/testing/conformance/restore.d.ts +0 -43
- package/dist/testing/conformance/restore.js +0 -341
- package/dist/testing/conformance/retention.d.ts +0 -14
- package/dist/testing/conformance/retention.js +0 -463
- package/dist/testing/conformance/rls.d.ts +0 -24
- package/dist/testing/conformance/rls.js +0 -576
- package/dist/testing/conformance/simulation.d.ts +0 -31
- package/dist/testing/conformance/simulation.js +0 -167
- package/dist/testing/conformance/single-shard.d.ts +0 -2
- package/dist/testing/conformance/single-shard.js +0 -125
- package/dist/testing/conformance/singleton.d.ts +0 -3
- package/dist/testing/conformance/singleton.js +0 -293
- package/dist/testing/conformance/statements.d.ts +0 -60
- package/dist/testing/conformance/statements.js +0 -108
- package/dist/testing/conformance/streams.d.ts +0 -7
- package/dist/testing/conformance/streams.js +0 -280
- package/dist/testing/conformance/subscriptions/access.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/access.js +0 -98
- package/dist/testing/conformance/subscriptions/actors.d.ts +0 -4910
- package/dist/testing/conformance/subscriptions/actors.js +0 -372
- package/dist/testing/conformance/subscriptions/cluster.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/cluster.js +0 -89
- package/dist/testing/conformance/subscriptions/delivery.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/delivery.js +0 -253
- package/dist/testing/conformance/subscriptions/deploys.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/deploys.js +0 -162
- package/dist/testing/conformance/subscriptions/epochs.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/epochs.js +0 -169
- package/dist/testing/conformance/subscriptions/failures.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/failures.js +0 -108
- package/dist/testing/conformance/subscriptions/feeds.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/feeds.js +0 -218
- package/dist/testing/conformance/subscriptions/harness.d.ts +0 -124
- package/dist/testing/conformance/subscriptions/harness.js +0 -143
- package/dist/testing/conformance/subscriptions/operator.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/operator.js +0 -128
- package/dist/testing/conformance/subscriptions/retention.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/retention.js +0 -288
- package/dist/testing/conformance/subscriptions/routing.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/routing.js +0 -179
- package/dist/testing/conformance/subscriptions.d.ts +0 -4
- package/dist/testing/conformance/subscriptions.js +0 -19
- package/dist/testing/conformance/tables.d.ts +0 -125
- package/dist/testing/conformance/tables.js +0 -664
- package/dist/testing/conformance/transports/actors.d.ts +0 -1907
- package/dist/testing/conformance/transports/actors.js +0 -163
- package/dist/testing/conformance/transports/client.d.ts +0 -3
- package/dist/testing/conformance/transports/client.js +0 -237
- package/dist/testing/conformance/transports/feeds.d.ts +0 -3
- package/dist/testing/conformance/transports/feeds.js +0 -232
- package/dist/testing/conformance/transports/harness.d.ts +0 -93
- package/dist/testing/conformance/transports/harness.js +0 -84
- package/dist/testing/conformance/transports/streams.d.ts +0 -3
- package/dist/testing/conformance/transports/streams.js +0 -96
- package/dist/testing/conformance/transports/websocket.d.ts +0 -3
- package/dist/testing/conformance/transports/websocket.js +0 -384
- package/dist/testing/conformance/transports/wire.d.ts +0 -141
- package/dist/testing/conformance/transports/wire.js +0 -204
- package/dist/testing/conformance/transports.d.ts +0 -3
- package/dist/testing/conformance/transports.js +0 -11
- package/dist/testing/conformance/watch.d.ts +0 -59
- package/dist/testing/conformance/watch.js +0 -879
- package/dist/testing/conformance/workflow-engine.d.ts +0 -97
- package/dist/testing/conformance/workflow-engine.js +0 -253
- package/dist/testing/conformance/workflow-versions.d.ts +0 -3
- package/dist/testing/conformance/workflow-versions.js +0 -545
- package/dist/testing/conformance/workflows/access.d.ts +0 -4
- package/dist/testing/conformance/workflows/access.js +0 -147
- package/dist/testing/conformance/workflows/actors.d.ts +0 -2317
- package/dist/testing/conformance/workflows/actors.js +0 -305
- package/dist/testing/conformance/workflows/basics.d.ts +0 -4
- package/dist/testing/conformance/workflows/basics.js +0 -144
- package/dist/testing/conformance/workflows/engine.d.ts +0 -4
- package/dist/testing/conformance/workflows/engine.js +0 -80
- package/dist/testing/conformance/workflows/guards.d.ts +0 -4
- package/dist/testing/conformance/workflows/guards.js +0 -172
- package/dist/testing/conformance/workflows/harness.d.ts +0 -14
- package/dist/testing/conformance/workflows/harness.js +0 -44
- package/dist/testing/conformance/workflows/recovery.d.ts +0 -4
- package/dist/testing/conformance/workflows/recovery.js +0 -181
- package/dist/testing/conformance/workflows/starts.d.ts +0 -4
- package/dist/testing/conformance/workflows/starts.js +0 -57
- package/dist/testing/conformance/workflows/suspension.d.ts +0 -4
- package/dist/testing/conformance/workflows/suspension.js +0 -106
- package/dist/testing/conformance/workflows/waits.d.ts +0 -4
- package/dist/testing/conformance/workflows/waits.js +0 -284
- package/dist/testing/conformance/workflows.d.ts +0 -4
- package/dist/testing/conformance/workflows.js +0 -19
- package/dist/testing/conformance.d.ts +0 -330
- package/dist/testing/conformance.js +0 -364
- package/dist/testing/foundation.d.ts +0 -41
- package/dist/testing/foundation.js +0 -517
- package/dist/testing/simulate-cluster.d.ts +0 -112
- package/dist/testing/simulate-cluster.js +0 -257
- package/dist/testing/simulate.d.ts +0 -90
- package/dist/testing/simulate.js +0 -127
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.1.0-alpha.
|
|
3
|
+
## 0.1.0-alpha.3 (2026-10-08)
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The framework and CLI release together on the `alpha` and `latest` npm dist-tags; verified-main canaries use only `next`. This launch release includes the unpublished alpha.2 draft and subsequent changes. Alpha APIs and stored formats can change. Read the [upgrade notes](https://docs.akter.dev/operations/alpha-upgrades), back up the database, and stop every earlier alpha runner before starting alpha.3; mixed-alpha rolling upgrades are not established as safe.
|
|
6
|
+
|
|
7
|
+
### Breaking changes and required upgrades
|
|
8
|
+
|
|
9
|
+
- `QuotaExceeded` now names the hard cap a hosted organization reached: `{ organizationId, period, cap, limit, used, retryAfterMs }`, where `cap` is `compute`, `storage`, `connections` or `spend`, and `limit` and `used` are in that cap's units (compute unit-hours, decimal gigabytes of pooled managed database storage, open connections, or cents). It no longer carries `limitUnits`, `usedUnits`, `requestedUnits` or `unitsPerCommand`, because commands and reads are no longer metered. Update decoders that read those fields. It is still answered 429 and closes a WebSocket with 1008.
|
|
10
|
+
- `SpendLimitExceeded`, `ConnectionLimitExceeded` and `StorageQuotaExceeded` are removed from `ActorError.reason` and from the exports of `@rikalabs/akter` and `@rikalabs/akter/client`; they existed only for the hosted edge. Match `QuotaExceeded` and its `cap` instead. A `connections` refusal is the only retryable one: `isRetryable` is true and the client retries it after `retryAfterMs` with the same command id, as it did for `ConnectionLimitExceeded`. A `spend` refusal is no longer answered 402 but 429.
|
|
11
|
+
- Operator commands read `AKTER_OPERATOR_TOKEN` instead of `DURABLE_OPERATOR_TOKEN`, with no implicit alias. Set the new variable or pass `--token-env` explicitly.
|
|
12
|
+
- The local inspector page and API move from `/_durable/inspector` to `/_akter/inspector`. Update bookmarks and requests; stored `durable` SQL schemas and format identifiers are unchanged.
|
|
13
|
+
- Hosted source deployment uses `src/app.ts` and a platform-generated Dockerfile. The cloud API removes `ContextPath`, exports `SOURCE_ENTRY`, and refuses `source.dockerfile` rather than silently ignoring it. Update source-upload clients and declare the hosted application with `App.make`.
|
|
14
|
+
- Cloud runtime activity and latency responses add `since`; absent latency percentiles are `null`, not zero. Live-only endpoints can return `NotImplemented` with multiple serving runners, and the command stream can end with `CommandStreamGap`. Update decoders and reconnection handling; unknown measurements are not zero.
|
|
15
|
+
- Neki support is removed completely, including the `Database.postgres` option, topology errors, targeted sessions and DDL mode. Postgres and PGlite are the only backends. Existing Neki deployments need a separately rehearsed export/restore to ordinary Postgres, not an in-place framework upgrade.
|
|
16
|
+
- Migration `0033_joined_inspection` removes the single-table `durable.*_v2` variants, including `placements_v2` and `content_sweeps_v2`. Update SQL tools to the original joined views, which already include placement; external dependencies refuse the migration without cascading. Stop every old alpha runner before upgrading. Tenant-to-authority placement conversions also require stopped old runners.
|
|
17
|
+
- `@rikalabs/akter/testing` no longer publishes framework conformance, foundation, cluster and simulation harnesses or `ActorTest.cluster`, `ActorTest.simulate` and `ActorTest.simulateCluster`. App-facing `ActorTest`, database fixtures, cleanup/content sweeps, batch-law checks and fault controls remain. Application tests using the removed alpha-only harnesses need their own process-level tests; framework maintainers use the private `tooling/conformance` workspace.
|
|
18
|
+
|
|
19
|
+
### Runtime reliability, routing and observability
|
|
20
|
+
|
|
21
|
+
- Commands cut off by runtime shutdown, or sent while or after it closes, settle with retryable `ActorUnavailable` instead of waiting indefinitely or exposing interruption. Retry with the original command id; a receipt committed before reply loss can still be replayed.
|
|
22
|
+
- Migration `0030_receipt_timing` records receipt start and commit timing on the database clock. Historical receipts keep unknown timing as `null`. Live telemetry adds bounded in-memory activity, latency, resident-actor, mailbox and connection measurements and a redacted command stream; it is not durable telemetry history or a fleet-wide aggregation.
|
|
23
|
+
- Applied migrations are unchanged; `0033` retires the variants introduced by `0031` transactionally while preserving the original joined-view grants and versions.
|
|
24
|
+
- Migration `0032_authority_placement` permits `placement: "authority"`. Its existing bucket -128 encoding and transactional conversion remain logical grouping, not physical data-shard placement or authorization. Generic routing keys, bucket-range scheduling and independent coordination remain.
|
|
25
|
+
- Launch support is multi-runner on one host through `Runner.socket` and `Runner.mtls`, verified with three Bun processes sharing a Postgres database. Separate hosts and hosting providers still need their own evidence, and this does not certify every feature's multi-process behavior.
|
|
26
|
+
|
|
27
|
+
### First CLI release and public cloud contract
|
|
28
|
+
|
|
29
|
+
- Published Effect, Effect-platform/SQL and Drizzle peers accept compatible caret ranges instead of exact versions, so plain npm installs and applications already using a compatible Effect patch can share one Effect copy. The Effect/platform/SQL cohort and its peer floors are 4.0.2; development verification uses Vitest 5.0.3. Runtime dependencies and the tested workspace catalog remain exact; Effect is not added as a private runtime dependency.
|
|
30
|
+
- First release of `@rikalabs/akter-cli`, exposing the `akter` executable on Node 24+ and Bun 1.4.2+. Compiled ESM, declarations and the bundled inspector work without a Bun build on Node. The framework has no competing CLI bin; `@akter/cloud-api` stays private and ships as compiled JS and declarations at `@rikalabs/akter-cli/cloud-api`. Importing the subpath does not execute the CLI; there is no standalone cloud API npm package.
|
|
31
|
+
- `akter login` defaults to `https://api.akter.dev`; use `--api-url` or `AKTER_API_URL` for a dev preview or local stack. Cloud commands include source deploys and `akter env list`, `set`, `unset` and `import`.
|
|
32
|
+
- `akter logs` reads recent customer runner output for a project and environment (default `production`) or one `--deployment`, bounded by `--since` (1 to 3600 seconds, default 300, clamped by the server to the last hour) and `--limit` (1 to 200 lines per page, default 100). Recent mode reads every page and exits; `--follow` drains pages, then long-polls for up to 20 seconds, resuming from the last successful cursor after transport failures and `Unavailable` responses and stopping after six failed requests in a row. Denied, missing and unsupported requests are not retried, and Ctrl-C exits with code 130. Terminal control characters are replaced, clipped lines end in `…`, and Fly lines show stream `unknown`. See the [logs API contract](https://github.com/Rika-Labs/akter/blob/main/docs/api/07-cloud-logs.md).
|
|
33
|
+
- The cloud API adds authenticated account export and deletion, organization deletion progress, optional deployment `environmentHost`, and card/Link payment-method variants. Account export excludes credentials; accepted organization deletion is not completed deletion.
|
|
34
|
+
- Cloud environment `database` now reports `{ source, state }` without an engine or Neki mode. Billing schemas remove command/read allowances and meters and deprecated compatibility fields, using compute unit-hours and pooled managed database storage instead; customer-owned databases do not count toward that storage pool. Update cloud API clients to the new required fields rather than interpreting missing measurements as zero.
|
|
35
|
+
|
|
36
|
+
### Repository, docs and release safety
|
|
37
|
+
|
|
38
|
+
- Hosted infrastructure, API, edge, console, marketing and provider integrations moved to the private Akter Cloud repository. The public repository retains the framework, CLI, cloud API contract, derived clients and Mintlify docs. Hosted deployment, billing, onboarding and website changes since alpha.1 are platform changes, not additional npm framework guarantees.
|
|
39
|
+
- Quickstart and deployment docs distinguish supported Node/Bun, embedded and server-backed scenarios from provider claims. Community contribution, security and support guidance is included.
|
|
40
|
+
- Verify runs parallel shards on GitHub-hosted runners; scheduled Stress and Nightly properties workflows and lease/fencing fixtures were repaired. Releases require a successful completed Verify run for the exact tagged commit, matching framework/CLI versions and version-specific notes before publication. Tagged pre-1.0 releases also advance `latest`, while verified main canaries publish only to `next`. npm publication has read-only contents permission; GitHub Release creation is a separate job. The CLI's first publication still requires a maintainer bootstrap before OIDC-only workflow publishing.
|
|
41
|
+
|
|
42
|
+
## 0.1.0-alpha.1 (2026-10-04)
|
|
43
|
+
|
|
44
|
+
The first version published by the release workflow, through npm trusted publishing with provenance. The framework code is unchanged from `0.1.0-alpha.0`.
|
|
45
|
+
|
|
46
|
+
## 0.1.0-alpha.0 (2026-10-04)
|
|
47
|
+
|
|
48
|
+
The first published build of Akter, on the `alpha` npm dist-tag. Its release guidance was limited to one runtime process per database; that historical limit is not the current OSS launch claim above. Expect APIs and stored formats to change between alphas without a migration path.
|
|
6
49
|
|
|
7
50
|
- Published as `@rikalabs/akter` with four entries: the root, `/runtime`, `/client`, and `/testing`. Compiled ES modules and type declarations; the runtime requires Bun 1.4.2 or later, and `effect`, `@effect/sql-pg`, `@effect/sql-pglite` and `drizzle-orm` are exact-version peer dependencies.
|
|
8
51
|
- Built on Effect `4.0.0`.
|
|
@@ -10,6 +53,6 @@ The first published build of Akter, on the `alpha` npm dist-tag. It is an **alph
|
|
|
10
53
|
- Keyed state with `Actor.state` migrations, actor-owned Drizzle tables (`Actor.table`), database blobs, tenant-scoped content blobs, and durable events with cursor replay.
|
|
11
54
|
- One actor-shard outbox for intents, timers, and jobs (`Actor.job`, `X.toJobLayer`) with retries, cancellation, and dead letters; workflows, cron and interval schedules, and cross-actor event subscriptions.
|
|
12
55
|
- Connections, streams, and broadcasts; `Actors.serve` over HTTP, WebSocket, SSE, OpenAPI, and MCP; the Promise client in `/client` with optimistic reducers, feeds, watches, and an offline command queue.
|
|
13
|
-
- `Actors.layer` on Postgres or file-backed PGlite; `ActorTest`, fault injection, and the shared conformance suite in `/testing`.
|
|
56
|
+
- `Actors.layer` on a Postgres database or file-backed PGlite; `ActorTest`, fault injection, and the shared conformance suite in `/testing`.
|
|
14
57
|
- A served `Schema.isPattern` check appears in the OpenAPI document only when its regular expression has the `u` flag.
|
|
15
58
|
- Licensed under Apache-2.0.
|
package/README.md
CHANGED
|
@@ -7,10 +7,10 @@ Define each part of your app once: its data, the commands it accepts, the work i
|
|
|
7
7
|
## Start
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
bun add @rikalabs/akter@alpha effect
|
|
10
|
+
bun add @rikalabs/akter@alpha effect @effect/sql-pg @effect/sql-pglite
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The runtime needs [Bun](https://bun.sh) 1.4.2 or later, or [Node.js](https://nodejs.org) 24 or later. Provide `BunCrypto` / `BunHttpServer` from `@effect/platform-bun` on Bun, or `NodeCrypto` / `NodeHttpServer` from `@effect/platform-node` on Node. Effect, its SQL drivers, and Drizzle are peer dependencies
|
|
13
|
+
The runtime needs [Bun](https://bun.sh) 1.4.2 or later, or [Node.js](https://nodejs.org) 24 or later. Provide `BunCrypto` / `BunHttpServer` from `@effect/platform-bun` on Bun, or `NodeCrypto` / `NodeHttpServer` from `@effect/platform-node` on Node. Effect, its SQL drivers, and Drizzle are shared peer dependencies with compatible caret ranges, so your app and the framework use the same peer-provided copy. Keep the generated lockfile; see the [quickstart](https://docs.akter.dev/quickstart) for both runtimes.
|
|
14
14
|
|
|
15
15
|
## Example
|
|
16
16
|
|
|
@@ -33,7 +33,7 @@ type Key = KeySchema | SingletonKey | undefined;
|
|
|
33
33
|
/** Type-only key of `Placed`; no value exists at runtime. */
|
|
34
34
|
export declare const PlacedType: unique symbol;
|
|
35
35
|
/** Type-level record of how a definition is placed and what its ids are. */
|
|
36
|
-
export interface Placed<Kind extends "tenant" | "actor" | "parent", Id> {
|
|
36
|
+
export interface Placed<Kind extends "tenant" | "actor" | "authority" | "parent", Id> {
|
|
37
37
|
readonly [PlacedType]?: {
|
|
38
38
|
readonly kind: Kind;
|
|
39
39
|
readonly id: Id;
|
|
@@ -44,13 +44,14 @@ interface ParentDefinition extends Placed<"actor" | "parent", string> {
|
|
|
44
44
|
readonly name: string;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Which rows share a shard: the tenant's, each actor's own,
|
|
48
|
-
*
|
|
47
|
+
* Which rows share a shard: the tenant's, each actor's own, the tenant's
|
|
48
|
+
* authority-placed actors' on the authoritative shard, or the parent actor's,
|
|
49
|
+
* whose id every child id carries.
|
|
49
50
|
*/
|
|
50
|
-
type PlacementOption = "tenant" | "actor" | {
|
|
51
|
+
type PlacementOption = "tenant" | "actor" | "authority" | {
|
|
51
52
|
readonly parent: ParentDefinition;
|
|
52
53
|
};
|
|
53
|
-
type PlacementKind<Pl> = Pl extends "tenant" | "actor" ? Pl : "parent";
|
|
54
|
+
type PlacementKind<Pl> = Pl extends "tenant" | "actor" | "authority" ? Pl : "parent";
|
|
54
55
|
/** Type-only key of `DefinitionWithInternal`; no value exists at runtime. */
|
|
55
56
|
export declare const InternalHandleType: unique symbol;
|
|
56
57
|
/**
|
|
@@ -264,10 +265,13 @@ interface Definition<Key, Fields extends StateFields, Api extends MemberRecord,
|
|
|
264
265
|
*/
|
|
265
266
|
readonly key?: Key;
|
|
266
267
|
/**
|
|
267
|
-
* Which rows share a shard: the tenant (default), each actor on its own,
|
|
268
|
-
* `{ parent: P }`, the shard of the parent actor whose id
|
|
269
|
-
* carries. `P` is placed by `"actor"` or by a parent, at most
|
|
270
|
-
* below an actor-placed root.
|
|
268
|
+
* Which rows share a shard: the tenant (default), each actor on its own,
|
|
269
|
+
* `"authority"`, or `{ parent: P }`, the shard of the parent actor whose id
|
|
270
|
+
* each child id carries. `P` is placed by `"actor"` or by a parent, at most
|
|
271
|
+
* four levels below an actor-placed root. `"authority"` colocates a
|
|
272
|
+
* tenant's authority-placed actors like `"tenant"`, in the one bucket every
|
|
273
|
+
* split topology keeps on the authoritative shard, for an actor whose turns
|
|
274
|
+
* read or write tables the database does not route.
|
|
271
275
|
*/
|
|
272
276
|
readonly placement?: Pl;
|
|
273
277
|
/** `Actor.state` fields and migrations; an actor without it has no state. */
|
|
@@ -37,7 +37,7 @@ export type KeySchema = Schema.Codec<string, string>;
|
|
|
37
37
|
/** The declaration `Actor.make` compiles, before its type parameters are erased. */
|
|
38
38
|
export interface Declaration {
|
|
39
39
|
readonly key?: KeySchema | SingletonKey | undefined;
|
|
40
|
-
readonly placement?: "tenant" | "actor" | {
|
|
40
|
+
readonly placement?: "tenant" | "actor" | "authority" | {
|
|
41
41
|
readonly parent: object;
|
|
42
42
|
} | undefined;
|
|
43
43
|
readonly state?: ActorState | undefined;
|
|
@@ -143,7 +143,7 @@ export interface Descriptor {
|
|
|
143
143
|
readonly registeredSubscriptions: ReadonlyArray<RegisteredSubscription>;
|
|
144
144
|
/** Event and job chains this actor writes (or only reads, with `writes` false). */
|
|
145
145
|
readonly payloads: (writes: boolean) => ReadonlyArray<PayloadDeclaration>;
|
|
146
|
-
/** What `
|
|
146
|
+
/** What `akter payloads check` and `clear` read. */
|
|
147
147
|
readonly definitionPayloads: DefinitionPayloads;
|
|
148
148
|
readonly served: ServedDefinition;
|
|
149
149
|
/** The handle that reaches `internal` commands too, for test harnesses. */
|
package/dist/actor/descriptor.js
CHANGED
|
@@ -45,15 +45,15 @@ const tagMatches = (api, internal) => {
|
|
|
45
45
|
};
|
|
46
46
|
const placementOf = (name, declared, singleton, createdBy) => {
|
|
47
47
|
const option = declared.placement ?? "tenant";
|
|
48
|
-
if (option === "tenant" || option === "actor")
|
|
48
|
+
if (option === "tenant" || option === "actor" || option === "authority")
|
|
49
49
|
return { placement: option, parent: undefined, depth: 0 };
|
|
50
50
|
if (!Predicate.hasProperty(option, "parent"))
|
|
51
|
-
throw new Error(`placement is "tenant", "actor", or { parent }`);
|
|
51
|
+
throw new Error(`placement is "tenant", "actor", "authority", or { parent }`);
|
|
52
52
|
const parent = descriptorOf(option.parent);
|
|
53
53
|
if (parent === undefined)
|
|
54
54
|
throw new Error("placement.parent takes an Actor.make definition");
|
|
55
|
-
if (parent.placement === "tenant")
|
|
56
|
-
throw new Error(`${name}'s parent ${parent.name} is
|
|
55
|
+
if (parent.placement === "tenant" || parent.placement === "authority")
|
|
56
|
+
throw new Error(`${name}'s parent ${parent.name} is ${parent.placement}-placed, so its children already share its shard; place ${name} by "${parent.placement}"`);
|
|
57
57
|
if (parent.depth + 1 > MAX_PLACEMENT_DEPTH)
|
|
58
58
|
throw new Error(`${name} would be ${parent.depth + 1} levels below its root; parent placement allows ${MAX_PLACEMENT_DEPTH}`);
|
|
59
59
|
if (singleton)
|
package/dist/client/calls.js
CHANGED
|
@@ -92,7 +92,7 @@ const retryDelay = (retry, clock) => (attempted) => Effect.gen(function* () {
|
|
|
92
92
|
return yield* Match.value(failure.reason).pipe(Match.tags({
|
|
93
93
|
ActorUnavailable: () => retryAfterOf(failure),
|
|
94
94
|
RunnerAtCapacity: () => retryAfterOf(failure),
|
|
95
|
-
|
|
95
|
+
QuotaExceeded: (reason) => reason.cap === "connections" ? retryAfterOf(failure) : Effect.succeedNone,
|
|
96
96
|
MailboxFull: () => retryAfterOf(failure),
|
|
97
97
|
Timeout: () => Effect.asSome(jittered(50)),
|
|
98
98
|
TransportError: (reason) => !reason.retryable
|
package/dist/client/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export { fleetClient } from "./fleet.ts";
|
|
|
12
12
|
export type { FleetClient, FleetSubscribeOptions, FleetViewClient } from "./fleet.ts";
|
|
13
13
|
export type { FleetFilter, FleetPage, FleetRow } from "../tables/fleet.ts";
|
|
14
14
|
export type { Failure } from "./transport.ts";
|
|
15
|
-
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, MailboxFull, NotCreated, RunnerAtCapacity, QuotaExceeded,
|
|
15
|
+
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, MailboxFull, NotCreated, RunnerAtCapacity, QuotaExceeded, SessionEnded, Timeout, TransportError, Unauthorized, } from "../errors/actor.ts";
|
|
16
16
|
export { RetentionGap, UnknownCursor } from "../errors/events.ts";
|
|
17
17
|
export { Inspection };
|
package/dist/client/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Inspection from "../protocol/inspection.js";
|
|
2
2
|
export { Offline, OfflineStoreError } from "./offline/store.js";
|
|
3
3
|
export { fleetClient } from "./fleet.js";
|
|
4
|
-
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, MailboxFull, NotCreated, RunnerAtCapacity, QuotaExceeded,
|
|
4
|
+
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, MailboxFull, NotCreated, RunnerAtCapacity, QuotaExceeded, SessionEnded, Timeout, TransportError, Unauthorized, } from "../errors/actor.js";
|
|
5
5
|
export { RetentionGap, UnknownCursor } from "../errors/events.js";
|
|
6
6
|
export { Inspection };
|
package/dist/errors/actor.d.ts
CHANGED
|
@@ -107,52 +107,22 @@ export declare class RunnerAtCapacity extends RunnerAtCapacity_base {
|
|
|
107
107
|
declare const QuotaExceeded_base: Schema.Class<QuotaExceeded, Schema.TaggedStruct<"QuotaExceeded", {
|
|
108
108
|
readonly organizationId: Schema.String;
|
|
109
109
|
readonly period: Schema.String;
|
|
110
|
-
readonly
|
|
111
|
-
readonly
|
|
112
|
-
readonly
|
|
113
|
-
readonly unitsPerCommand: Schema.Int;
|
|
110
|
+
readonly cap: Schema.Literals<readonly ["compute", "storage", "connections", "spend"]>;
|
|
111
|
+
readonly limit: Schema.Finite;
|
|
112
|
+
readonly used: Schema.Finite;
|
|
114
113
|
readonly retryAfterMs: Schema.Finite;
|
|
115
114
|
}>, import("effect/Cause").YieldableError>;
|
|
116
115
|
/**
|
|
117
|
-
* The hosted organization
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
116
|
+
* The hosted organization reached one of its plan's hard caps. `cap` names it,
|
|
117
|
+
* and `limit` and `used` are in that cap's units: cents for `spend`, open
|
|
118
|
+
* connections for `connections`, compute unit-hours this period for
|
|
119
|
+
* `compute`, and decimal gigabytes of pooled managed database storage for
|
|
120
|
+
* `storage`. A `connections` refusal clears as connections close, so it is
|
|
121
|
+
* retryable with the same command id after `retryAfterMs`; the others hold
|
|
122
|
+
* until usage drops, the period resets or the plan changes.
|
|
121
123
|
*/
|
|
122
124
|
export declare class QuotaExceeded extends QuotaExceeded_base {
|
|
123
125
|
}
|
|
124
|
-
declare const SpendLimitExceeded_base: Schema.Class<SpendLimitExceeded, Schema.TaggedStruct<"SpendLimitExceeded", {
|
|
125
|
-
readonly organizationId: Schema.String;
|
|
126
|
-
readonly period: Schema.String;
|
|
127
|
-
readonly limitCents: Schema.Finite;
|
|
128
|
-
readonly projectedCents: Schema.Finite;
|
|
129
|
-
}>, import("effect/Cause").YieldableError>;
|
|
130
|
-
/** The hosted organization's estimated period cost would exceed its spend limit. */
|
|
131
|
-
export declare class SpendLimitExceeded extends SpendLimitExceeded_base {
|
|
132
|
-
}
|
|
133
|
-
declare const ConnectionLimitExceeded_base: Schema.Class<ConnectionLimitExceeded, Schema.TaggedStruct<"ConnectionLimitExceeded", {
|
|
134
|
-
readonly organizationId: Schema.String;
|
|
135
|
-
readonly kind: Schema.Literals<readonly ["socket", "sse"]>;
|
|
136
|
-
readonly limit: Schema.Finite;
|
|
137
|
-
readonly open: Schema.Finite;
|
|
138
|
-
}>, import("effect/Cause").YieldableError>;
|
|
139
|
-
/** The hosted organization already holds its plan's allowed concurrent connections. */
|
|
140
|
-
export declare class ConnectionLimitExceeded extends ConnectionLimitExceeded_base {
|
|
141
|
-
}
|
|
142
|
-
declare const StorageQuotaExceeded_base: Schema.Class<StorageQuotaExceeded, Schema.TaggedStruct<"StorageQuotaExceeded", {
|
|
143
|
-
readonly organizationId: Schema.String;
|
|
144
|
-
readonly deployment: Schema.String;
|
|
145
|
-
readonly tenant: Schema.String;
|
|
146
|
-
readonly limitBytes: Schema.Finite;
|
|
147
|
-
readonly usedBytes: Schema.Finite;
|
|
148
|
-
}>, import("effect/Cause").YieldableError>;
|
|
149
|
-
/**
|
|
150
|
-
* A Free tenant's latest storage sample is at or over its plan's included
|
|
151
|
-
* bytes. Waiting for the next period does not lift it; the tenant must hold
|
|
152
|
-
* less data before new commands are admitted, so it carries no retry time.
|
|
153
|
-
*/
|
|
154
|
-
export declare class StorageQuotaExceeded extends StorageQuotaExceeded_base {
|
|
155
|
-
}
|
|
156
126
|
declare const SessionEnded_base: Schema.Class<SessionEnded, Schema.TaggedStruct<"SessionEnded", {
|
|
157
127
|
readonly cause: Schema.Literals<readonly ["ClientClosed", "ServerClosed", "SlowConsumer", "HolderShutdown", "HolderLost", "OwnerLost", "ActivationEnded", "ActorUnavailable", "Defect", "Terminated"]>;
|
|
158
128
|
readonly resync: Schema.Boolean;
|
|
@@ -166,11 +136,11 @@ export declare class SessionEnded extends SessionEnded_base {
|
|
|
166
136
|
get isRetryable(): boolean;
|
|
167
137
|
}
|
|
168
138
|
/** Every reason an `ActorError` carries. */
|
|
169
|
-
export declare const Reason: Schema.Union<readonly [typeof CommandConflict, typeof CommandExpired, typeof InvalidCommandId, typeof Unauthorized, typeof ActorUnavailable, typeof Timeout, typeof NotCreated, typeof MailboxFull, typeof RunnerAtCapacity, typeof QuotaExceeded, typeof
|
|
139
|
+
export declare const Reason: Schema.Union<readonly [typeof CommandConflict, typeof CommandExpired, typeof InvalidCommandId, typeof Unauthorized, typeof ActorUnavailable, typeof Timeout, typeof NotCreated, typeof MailboxFull, typeof RunnerAtCapacity, typeof QuotaExceeded, typeof SessionEnded, typeof InvalidInput, typeof TransportError]>;
|
|
170
140
|
/** One `Reason` value. */
|
|
171
141
|
export type Reason = typeof Reason.Type;
|
|
172
142
|
declare const ActorError_base: Schema.Class<ActorError, Schema.TaggedStruct<"ActorError", {
|
|
173
|
-
readonly reason: Schema.Union<readonly [typeof CommandConflict, typeof CommandExpired, typeof InvalidCommandId, typeof Unauthorized, typeof ActorUnavailable, typeof Timeout, typeof NotCreated, typeof MailboxFull, typeof RunnerAtCapacity, typeof QuotaExceeded, typeof
|
|
143
|
+
readonly reason: Schema.Union<readonly [typeof CommandConflict, typeof CommandExpired, typeof InvalidCommandId, typeof Unauthorized, typeof ActorUnavailable, typeof Timeout, typeof NotCreated, typeof MailboxFull, typeof RunnerAtCapacity, typeof QuotaExceeded, typeof SessionEnded, typeof InvalidInput, typeof TransportError]>;
|
|
174
144
|
}>, import("effect/Cause").YieldableError>;
|
|
175
145
|
/**
|
|
176
146
|
* The runtime's own failure for a call: `reason` says which. Declared command
|
package/dist/errors/actor.js
CHANGED
|
@@ -120,48 +120,21 @@ export class MailboxFull extends Schema.TaggedError()("MailboxFull", {}) {
|
|
|
120
120
|
export class RunnerAtCapacity extends Schema.TaggedError()("RunnerAtCapacity", {}) {
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* The hosted organization
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
123
|
+
* The hosted organization reached one of its plan's hard caps. `cap` names it,
|
|
124
|
+
* and `limit` and `used` are in that cap's units: cents for `spend`, open
|
|
125
|
+
* connections for `connections`, compute unit-hours this period for
|
|
126
|
+
* `compute`, and decimal gigabytes of pooled managed database storage for
|
|
127
|
+
* `storage`. A `connections` refusal clears as connections close, so it is
|
|
128
|
+
* retryable with the same command id after `retryAfterMs`; the others hold
|
|
129
|
+
* until usage drops, the period resets or the plan changes.
|
|
127
130
|
*/
|
|
128
131
|
export class QuotaExceeded extends Schema.TaggedError()("QuotaExceeded", {
|
|
129
132
|
organizationId: Schema.String,
|
|
130
133
|
period: Schema.String,
|
|
131
|
-
|
|
132
|
-
usedUnits: Schema.Finite,
|
|
133
|
-
requestedUnits: Schema.Finite,
|
|
134
|
-
unitsPerCommand: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
|
|
135
|
-
retryAfterMs: Schema.Finite,
|
|
136
|
-
}) {
|
|
137
|
-
}
|
|
138
|
-
/** The hosted organization's estimated period cost would exceed its spend limit. */
|
|
139
|
-
export class SpendLimitExceeded extends Schema.TaggedError()("SpendLimitExceeded", {
|
|
140
|
-
organizationId: Schema.String,
|
|
141
|
-
period: Schema.String,
|
|
142
|
-
limitCents: Schema.Finite,
|
|
143
|
-
projectedCents: Schema.Finite,
|
|
144
|
-
}) {
|
|
145
|
-
}
|
|
146
|
-
/** The hosted organization already holds its plan's allowed concurrent connections. */
|
|
147
|
-
export class ConnectionLimitExceeded extends Schema.TaggedError()("ConnectionLimitExceeded", {
|
|
148
|
-
organizationId: Schema.String,
|
|
149
|
-
kind: Schema.Literals(["socket", "sse"]),
|
|
134
|
+
cap: Schema.Literals(["compute", "storage", "connections", "spend"]),
|
|
150
135
|
limit: Schema.Finite,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* A Free tenant's latest storage sample is at or over its plan's included
|
|
156
|
-
* bytes. Waiting for the next period does not lift it; the tenant must hold
|
|
157
|
-
* less data before new commands are admitted, so it carries no retry time.
|
|
158
|
-
*/
|
|
159
|
-
export class StorageQuotaExceeded extends Schema.TaggedError()("StorageQuotaExceeded", {
|
|
160
|
-
organizationId: Schema.String,
|
|
161
|
-
deployment: Schema.String,
|
|
162
|
-
tenant: Schema.String,
|
|
163
|
-
limitBytes: Schema.Finite,
|
|
164
|
-
usedBytes: Schema.Finite,
|
|
136
|
+
used: Schema.Finite,
|
|
137
|
+
retryAfterMs: Schema.Finite,
|
|
165
138
|
}) {
|
|
166
139
|
}
|
|
167
140
|
const RETRYABLE_SESSION_ENDS = new Set([
|
|
@@ -208,9 +181,6 @@ export const Reason = Schema.Union([
|
|
|
208
181
|
MailboxFull,
|
|
209
182
|
RunnerAtCapacity,
|
|
210
183
|
QuotaExceeded,
|
|
211
|
-
SpendLimitExceeded,
|
|
212
|
-
ConnectionLimitExceeded,
|
|
213
|
-
StorageQuotaExceeded,
|
|
214
184
|
SessionEnded,
|
|
215
185
|
InvalidInput,
|
|
216
186
|
TransportError,
|
|
@@ -226,6 +196,8 @@ export class ActorError extends Schema.TaggedError()("ActorError", { reason: Rea
|
|
|
226
196
|
return this.reason.isRetryable;
|
|
227
197
|
if (Schema.is(Unauthorized)(this.reason))
|
|
228
198
|
return this.reason.code === "reauthorization_unavailable";
|
|
199
|
+
if (Schema.is(QuotaExceeded)(this.reason))
|
|
200
|
+
return this.reason.cap === "connections";
|
|
229
201
|
if (isTransportError(this.reason))
|
|
230
202
|
return this.reason.retryable;
|
|
231
203
|
return isRetryableReason(this.reason);
|
|
@@ -255,12 +227,11 @@ export class ActorError extends Schema.TaggedError()("ActorError", { reason: Rea
|
|
|
255
227
|
}
|
|
256
228
|
}
|
|
257
229
|
const isTransportError = Schema.is(TransportError);
|
|
258
|
-
const isRetryableReason = Schema.is(Schema.Union([ActorUnavailable, Timeout, MailboxFull, RunnerAtCapacity
|
|
230
|
+
const isRetryableReason = Schema.is(Schema.Union([ActorUnavailable, Timeout, MailboxFull, RunnerAtCapacity]));
|
|
259
231
|
const NOMINAL_RETRY_AFTER = {
|
|
260
232
|
ActorUnavailable: 250,
|
|
261
233
|
RunnerAtCapacity: 1_000,
|
|
262
234
|
MailboxFull: 100,
|
|
263
|
-
ConnectionLimitExceeded: 1_000,
|
|
264
235
|
};
|
|
265
236
|
const jittered = new WeakMap();
|
|
266
237
|
/** Fixes `retryAfter` to a server's already-jittered value, as a client rebuilds a served envelope. */
|
package/dist/index.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export { ContentRef } from "./identity/content.ts";
|
|
|
134
134
|
export type { ContentEntry } from "./identity/content.ts";
|
|
135
135
|
export type { Access, AccessRequest } from "./policies/access.ts";
|
|
136
136
|
export type { Policy } from "./policies/command.ts";
|
|
137
|
-
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, Unauthorized, Timeout, NotCreated, MailboxFull, RunnerAtCapacity, QuotaExceeded,
|
|
137
|
+
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, Unauthorized, Timeout, NotCreated, MailboxFull, RunnerAtCapacity, QuotaExceeded, SessionEnded, } from "./errors/actor.ts";
|
|
138
138
|
export { RetentionGap, UnknownCursor } from "./errors/events.ts";
|
|
139
139
|
export { ContentTooLarge, InvalidContentRef } from "./errors/content.ts";
|
|
140
140
|
export { ActivityOutcomeUnknown, InvalidExecutionId, InvalidExecutionKey, } from "./errors/workflow.ts";
|
package/dist/index.js
CHANGED
|
@@ -89,7 +89,7 @@ export { Intent } from "./handles/intents.js";
|
|
|
89
89
|
export { Content, ContentStore } from "./handles/content.js";
|
|
90
90
|
export { ActorRef, Anonymous, Caller, CurrentCaller, Tenant, User, System, Principal, } from "./identity/caller.js";
|
|
91
91
|
export { ContentRef } from "./identity/content.js";
|
|
92
|
-
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, Unauthorized, Timeout, NotCreated, MailboxFull, RunnerAtCapacity, QuotaExceeded,
|
|
92
|
+
export { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, Unauthorized, Timeout, NotCreated, MailboxFull, RunnerAtCapacity, QuotaExceeded, SessionEnded, } from "./errors/actor.js";
|
|
93
93
|
export { RetentionGap, UnknownCursor } from "./errors/events.js";
|
|
94
94
|
export { ContentTooLarge, InvalidContentRef } from "./errors/content.js";
|
|
95
95
|
export { ActivityOutcomeUnknown, InvalidExecutionId, InvalidExecutionKey, } from "./errors/workflow.js";
|
|
@@ -84,7 +84,7 @@ export interface PayloadDeclaration {
|
|
|
84
84
|
/** Whether this layer writes new values of the class, so it records and heartbeats its write version. */
|
|
85
85
|
readonly writes: boolean;
|
|
86
86
|
}
|
|
87
|
-
/** What `
|
|
87
|
+
/** What `akter payloads check` and `clear` need of an actor definition. */
|
|
88
88
|
export interface DefinitionPayloads {
|
|
89
89
|
readonly declarations: ReadonlyArray<PayloadDeclaration>;
|
|
90
90
|
readonly keepEventsMs: number;
|