@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
|
@@ -40,6 +40,24 @@ export declare const ActorRow: Schema.Struct<{
|
|
|
40
40
|
readonly lastEventSequence: Schema.Finite;
|
|
41
41
|
}>;
|
|
42
42
|
export type ActorRow = typeof ActorRow.Type;
|
|
43
|
+
/**
|
|
44
|
+
* An actor as a list shows it, with its last command: the command and commit
|
|
45
|
+
* time of its receipt with the newest recorded commit time among its 256
|
|
46
|
+
* greatest command ids, null when none of them records one.
|
|
47
|
+
*/
|
|
48
|
+
export declare const ActorListRow: Schema.Struct<{
|
|
49
|
+
readonly actorType: Schema.String;
|
|
50
|
+
readonly actorId: Schema.String;
|
|
51
|
+
readonly placement: Schema.NullOr<Schema.String>;
|
|
52
|
+
readonly generation: Schema.Finite;
|
|
53
|
+
readonly created: Schema.Boolean;
|
|
54
|
+
readonly lastEventSequence: Schema.Finite;
|
|
55
|
+
readonly lastCommand: Schema.NullOr<Schema.Struct<{
|
|
56
|
+
readonly command: Schema.String;
|
|
57
|
+
readonly committedAtMs: Schema.Finite;
|
|
58
|
+
}>>;
|
|
59
|
+
}>;
|
|
60
|
+
export type ActorListRow = typeof ActorListRow.Type;
|
|
43
61
|
/** A page of actors; `next` is the identity to continue from, or null at the end. */
|
|
44
62
|
export declare const ActorsPage: Schema.Struct<{
|
|
45
63
|
readonly actors: Schema.$Array<Schema.Struct<{
|
|
@@ -49,6 +67,10 @@ export declare const ActorsPage: Schema.Struct<{
|
|
|
49
67
|
readonly generation: Schema.Finite;
|
|
50
68
|
readonly created: Schema.Boolean;
|
|
51
69
|
readonly lastEventSequence: Schema.Finite;
|
|
70
|
+
readonly lastCommand: Schema.NullOr<Schema.Struct<{
|
|
71
|
+
readonly command: Schema.String;
|
|
72
|
+
readonly committedAtMs: Schema.Finite;
|
|
73
|
+
}>>;
|
|
52
74
|
}>>;
|
|
53
75
|
readonly next: Schema.NullOr<Schema.Struct<{
|
|
54
76
|
actorType: Schema.String;
|
|
@@ -186,7 +208,10 @@ export declare const WorkflowRow: Schema.Struct<{
|
|
|
186
208
|
export type WorkflowRow = typeof WorkflowRow.Type;
|
|
187
209
|
/**
|
|
188
210
|
* A command receipt with its outcome, expiry in epoch milliseconds and the
|
|
189
|
-
* sequences of the events it emitted.
|
|
211
|
+
* sequences of the events it emitted. `startedAtMs` is the database clock its
|
|
212
|
+
* batch's fenced read selected and `committedAtMs` the database clock when
|
|
213
|
+
* its commit wrote it; both are null on a receipt written before the runtime
|
|
214
|
+
* recorded them.
|
|
190
215
|
*/
|
|
191
216
|
export declare const ReceiptRow: Schema.Struct<{
|
|
192
217
|
readonly commandId: Schema.String;
|
|
@@ -203,6 +228,8 @@ export declare const ReceiptRow: Schema.Struct<{
|
|
|
203
228
|
readonly undecodable: Schema.String;
|
|
204
229
|
}>]>>;
|
|
205
230
|
readonly expiresAtMs: Schema.Finite;
|
|
231
|
+
readonly startedAtMs: Schema.NullOr<Schema.Finite>;
|
|
232
|
+
readonly committedAtMs: Schema.NullOr<Schema.Finite>;
|
|
206
233
|
readonly events: Schema.$Array<Schema.Finite>;
|
|
207
234
|
}>;
|
|
208
235
|
export type ReceiptRow = typeof ReceiptRow.Type;
|
|
@@ -257,6 +284,8 @@ export declare const ActorDetail: Schema.Struct<{
|
|
|
257
284
|
readonly undecodable: Schema.String;
|
|
258
285
|
}>]>>;
|
|
259
286
|
readonly expiresAtMs: Schema.Finite;
|
|
287
|
+
readonly startedAtMs: Schema.NullOr<Schema.Finite>;
|
|
288
|
+
readonly committedAtMs: Schema.NullOr<Schema.Finite>;
|
|
260
289
|
readonly events: Schema.$Array<Schema.Finite>;
|
|
261
290
|
}>>;
|
|
262
291
|
readonly events: Schema.$Array<Schema.Struct<{
|
|
@@ -532,6 +561,8 @@ export declare const OperatorActorDetail: Schema.Struct<{
|
|
|
532
561
|
}>]>>;
|
|
533
562
|
readonly outcomeTag: Schema.NullOr<Schema.String>;
|
|
534
563
|
readonly expiresAtMs: Schema.Finite;
|
|
564
|
+
readonly startedAtMs: Schema.NullOr<Schema.Finite>;
|
|
565
|
+
readonly committedAtMs: Schema.NullOr<Schema.Finite>;
|
|
535
566
|
readonly events: Schema.$Array<Schema.Finite>;
|
|
536
567
|
readonly outcome: Schema.optionalKey<Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
|
|
537
568
|
readonly json: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
@@ -693,6 +724,8 @@ export declare const ActorReceiptRow: Schema.Struct<{
|
|
|
693
724
|
readonly undecodable: Schema.String;
|
|
694
725
|
}>]>>;
|
|
695
726
|
readonly expiresAtMs: Schema.Finite;
|
|
727
|
+
readonly startedAtMs: Schema.NullOr<Schema.Finite>;
|
|
728
|
+
readonly committedAtMs: Schema.NullOr<Schema.Finite>;
|
|
696
729
|
readonly events: Schema.$Array<Schema.Finite>;
|
|
697
730
|
}>;
|
|
698
731
|
export type ActorReceiptRow = typeof ActorReceiptRow.Type;
|
|
@@ -718,6 +751,8 @@ export declare const ReceiptsPage: Schema.Struct<{
|
|
|
718
751
|
readonly undecodable: Schema.String;
|
|
719
752
|
}>]>>;
|
|
720
753
|
readonly expiresAtMs: Schema.Finite;
|
|
754
|
+
readonly startedAtMs: Schema.NullOr<Schema.Finite>;
|
|
755
|
+
readonly committedAtMs: Schema.NullOr<Schema.Finite>;
|
|
721
756
|
readonly events: Schema.$Array<Schema.Finite>;
|
|
722
757
|
}>>;
|
|
723
758
|
readonly next: Schema.NullOr<Schema.Struct<{
|
|
@@ -805,3 +840,188 @@ export declare const JobTypesPage: Schema.Struct<{
|
|
|
805
840
|
}>>;
|
|
806
841
|
readonly next: Schema.NullOr<Schema.String>;
|
|
807
842
|
}>;
|
|
843
|
+
/**
|
|
844
|
+
* Which runner answered a live read and what it covers: its name and region
|
|
845
|
+
* as the inspector was configured (null when not), when it began recording,
|
|
846
|
+
* and how many other runners the cluster lists (null when it could not tell).
|
|
847
|
+
* A live answer is this runner's alone; it covers the deployment only when
|
|
848
|
+
* `peers` is 0.
|
|
849
|
+
*/
|
|
850
|
+
export declare const LiveScope: Schema.Struct<{
|
|
851
|
+
readonly runner: Schema.NullOr<Schema.String>;
|
|
852
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
853
|
+
readonly startedAtMs: Schema.Finite;
|
|
854
|
+
readonly peers: Schema.NullOr<Schema.Finite>;
|
|
855
|
+
}>;
|
|
856
|
+
export type LiveScope = typeof LiveScope.Type;
|
|
857
|
+
/**
|
|
858
|
+
* One runner's live view of a tenant: its rates, resident activations and
|
|
859
|
+
* deepest mailbox overall, and per actor type that has either.
|
|
860
|
+
*/
|
|
861
|
+
export declare const LiveOverview: Schema.Struct<{
|
|
862
|
+
readonly scope: Schema.Struct<{
|
|
863
|
+
readonly runner: Schema.NullOr<Schema.String>;
|
|
864
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
865
|
+
readonly startedAtMs: Schema.Finite;
|
|
866
|
+
readonly peers: Schema.NullOr<Schema.Finite>;
|
|
867
|
+
}>;
|
|
868
|
+
readonly total: Schema.Struct<{
|
|
869
|
+
readonly perSecond: Schema.NullOr<Schema.Finite>;
|
|
870
|
+
readonly p50Ms: Schema.NullOr<Schema.Finite>;
|
|
871
|
+
readonly p99Ms: Schema.NullOr<Schema.Finite>;
|
|
872
|
+
readonly awake: Schema.Finite;
|
|
873
|
+
readonly maxMailbox: Schema.NullOr<Schema.Struct<{
|
|
874
|
+
readonly depth: Schema.Finite;
|
|
875
|
+
readonly actorType: Schema.String;
|
|
876
|
+
readonly actorId: Schema.String;
|
|
877
|
+
}>>;
|
|
878
|
+
}>;
|
|
879
|
+
readonly actorTypes: Schema.$Array<Schema.Struct<{
|
|
880
|
+
readonly perSecond: Schema.NullOr<Schema.Finite>;
|
|
881
|
+
readonly p50Ms: Schema.NullOr<Schema.Finite>;
|
|
882
|
+
readonly p99Ms: Schema.NullOr<Schema.Finite>;
|
|
883
|
+
readonly actorType: Schema.String;
|
|
884
|
+
readonly awake: Schema.Finite;
|
|
885
|
+
readonly maxMailbox: Schema.NullOr<Schema.Struct<{
|
|
886
|
+
readonly depth: Schema.Finite;
|
|
887
|
+
readonly actorId: Schema.String;
|
|
888
|
+
}>>;
|
|
889
|
+
}>>;
|
|
890
|
+
}>;
|
|
891
|
+
export type LiveOverview = typeof LiveOverview.Type;
|
|
892
|
+
/**
|
|
893
|
+
* One actor type's commands over a window: the rate at each slot this runner
|
|
894
|
+
* observed (minutes for `1h`, hours otherwise), oldest first, and each
|
|
895
|
+
* command's volume; `activity` is null when the runner cannot say.
|
|
896
|
+
*/
|
|
897
|
+
export declare const LiveActivity: Schema.Struct<{
|
|
898
|
+
readonly scope: Schema.Struct<{
|
|
899
|
+
readonly runner: Schema.NullOr<Schema.String>;
|
|
900
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
901
|
+
readonly startedAtMs: Schema.Finite;
|
|
902
|
+
readonly peers: Schema.NullOr<Schema.Finite>;
|
|
903
|
+
}>;
|
|
904
|
+
readonly activity: Schema.NullOr<Schema.Struct<{
|
|
905
|
+
readonly sinceMs: Schema.Finite;
|
|
906
|
+
readonly points: Schema.$Array<Schema.Struct<{
|
|
907
|
+
readonly atMs: Schema.Finite;
|
|
908
|
+
readonly perSecond: Schema.Finite;
|
|
909
|
+
}>>;
|
|
910
|
+
readonly commands: Schema.$Array<Schema.Struct<{
|
|
911
|
+
readonly command: Schema.String;
|
|
912
|
+
readonly count: Schema.Finite;
|
|
913
|
+
readonly perSecond: Schema.Finite;
|
|
914
|
+
}>>;
|
|
915
|
+
}>>;
|
|
916
|
+
}>;
|
|
917
|
+
export type LiveActivity = typeof LiveActivity.Type;
|
|
918
|
+
/** One actor type's turn times over a window as a histogram and percentiles; null when the runner cannot say. */
|
|
919
|
+
export declare const LiveLatency: Schema.Struct<{
|
|
920
|
+
readonly scope: Schema.Struct<{
|
|
921
|
+
readonly runner: Schema.NullOr<Schema.String>;
|
|
922
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
923
|
+
readonly startedAtMs: Schema.Finite;
|
|
924
|
+
readonly peers: Schema.NullOr<Schema.Finite>;
|
|
925
|
+
}>;
|
|
926
|
+
readonly latency: Schema.NullOr<Schema.Struct<{
|
|
927
|
+
readonly sinceMs: Schema.Finite;
|
|
928
|
+
readonly count: Schema.Finite;
|
|
929
|
+
readonly buckets: Schema.$Array<Schema.Struct<{
|
|
930
|
+
readonly upToMs: Schema.NullOr<Schema.Finite>;
|
|
931
|
+
readonly count: Schema.Finite;
|
|
932
|
+
}>>;
|
|
933
|
+
readonly p50Ms: Schema.NullOr<Schema.Finite>;
|
|
934
|
+
readonly p95Ms: Schema.NullOr<Schema.Finite>;
|
|
935
|
+
readonly p99Ms: Schema.NullOr<Schema.Finite>;
|
|
936
|
+
}>>;
|
|
937
|
+
}>;
|
|
938
|
+
export type LiveLatency = typeof LiveLatency.Type;
|
|
939
|
+
/**
|
|
940
|
+
* Named actors as this runner holds them: whether each is resident, its
|
|
941
|
+
* mailbox depth when it is, its open sockets and its open feeds per event.
|
|
942
|
+
*/
|
|
943
|
+
export declare const LiveActors: Schema.Struct<{
|
|
944
|
+
readonly scope: Schema.Struct<{
|
|
945
|
+
readonly runner: Schema.NullOr<Schema.String>;
|
|
946
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
947
|
+
readonly startedAtMs: Schema.Finite;
|
|
948
|
+
readonly peers: Schema.NullOr<Schema.Finite>;
|
|
949
|
+
}>;
|
|
950
|
+
readonly actors: Schema.$Array<Schema.Struct<{
|
|
951
|
+
readonly actorId: Schema.String;
|
|
952
|
+
readonly awake: Schema.Boolean;
|
|
953
|
+
readonly mailbox: Schema.NullOr<Schema.Finite>;
|
|
954
|
+
readonly sockets: Schema.Finite;
|
|
955
|
+
readonly feeds: Schema.$Array<Schema.Struct<{
|
|
956
|
+
readonly event: Schema.String;
|
|
957
|
+
readonly subscribers: Schema.Finite;
|
|
958
|
+
}>>;
|
|
959
|
+
}>>;
|
|
960
|
+
}>;
|
|
961
|
+
export type LiveActors = typeof LiveActors.Type;
|
|
962
|
+
/** The tenant's open WebSocket sessions and SSE responses on this runner, overall and per actor type. */
|
|
963
|
+
export declare const LiveConnections: Schema.Struct<{
|
|
964
|
+
readonly sockets: Schema.Finite;
|
|
965
|
+
readonly feeds: Schema.Finite;
|
|
966
|
+
readonly streams: Schema.Finite;
|
|
967
|
+
readonly watches: Schema.Finite;
|
|
968
|
+
readonly scope: Schema.Struct<{
|
|
969
|
+
readonly runner: Schema.NullOr<Schema.String>;
|
|
970
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
971
|
+
readonly startedAtMs: Schema.Finite;
|
|
972
|
+
readonly peers: Schema.NullOr<Schema.Finite>;
|
|
973
|
+
}>;
|
|
974
|
+
readonly byActorType: Schema.$Array<Schema.Struct<{
|
|
975
|
+
readonly sockets: Schema.Finite;
|
|
976
|
+
readonly feeds: Schema.Finite;
|
|
977
|
+
readonly streams: Schema.Finite;
|
|
978
|
+
readonly watches: Schema.Finite;
|
|
979
|
+
readonly actorType: Schema.String;
|
|
980
|
+
}>>;
|
|
981
|
+
}>;
|
|
982
|
+
export type LiveConnections = typeof LiveConnections.Type;
|
|
983
|
+
/**
|
|
984
|
+
* One committed command as the command stream sends it: its turn's time on
|
|
985
|
+
* the database clock (`atMs` read after `COMMIT`), its caller key, outcome,
|
|
986
|
+
* the declared failure's tag, and a bounded, redacted payload preview.
|
|
987
|
+
*/
|
|
988
|
+
export declare const StreamCommand: Schema.Struct<{
|
|
989
|
+
readonly id: Schema.String;
|
|
990
|
+
readonly commandId: Schema.String;
|
|
991
|
+
readonly atMs: Schema.Finite;
|
|
992
|
+
readonly durationMs: Schema.Finite;
|
|
993
|
+
readonly actorType: Schema.String;
|
|
994
|
+
readonly actorId: Schema.String;
|
|
995
|
+
readonly command: Schema.String;
|
|
996
|
+
readonly callerKey: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
|
|
997
|
+
readonly json: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
998
|
+
}>, Schema.Struct<{
|
|
999
|
+
readonly undecodable: Schema.String;
|
|
1000
|
+
}>]>>;
|
|
1001
|
+
readonly outcomeTag: Schema.Literals<readonly ["Success", "Failure"]>;
|
|
1002
|
+
readonly errorTag: Schema.NullOr<Schema.String>;
|
|
1003
|
+
readonly payloadPreview: Schema.NullOr<Schema.String>;
|
|
1004
|
+
}>;
|
|
1005
|
+
export type StreamCommand = typeof StreamCommand.Type;
|
|
1006
|
+
/**
|
|
1007
|
+
* Each cron entry the runtime registers, with the tenant's pending ticks of
|
|
1008
|
+
* it, the soonest one's due time, and the newest committed tick among the
|
|
1009
|
+
* type's newest receipts: its command id, commit time, duration and outcome.
|
|
1010
|
+
*/
|
|
1011
|
+
export declare const Schedules: Schema.Struct<{
|
|
1012
|
+
readonly schedules: Schema.$Array<Schema.Struct<{
|
|
1013
|
+
readonly actorType: Schema.String;
|
|
1014
|
+
readonly key: Schema.String;
|
|
1015
|
+
readonly expression: Schema.String;
|
|
1016
|
+
readonly command: Schema.String;
|
|
1017
|
+
readonly pending: Schema.Finite;
|
|
1018
|
+
readonly nextDueAtMs: Schema.NullOr<Schema.Finite>;
|
|
1019
|
+
readonly lastRun: Schema.NullOr<Schema.Struct<{
|
|
1020
|
+
readonly commandId: Schema.String;
|
|
1021
|
+
readonly committedAtMs: Schema.Finite;
|
|
1022
|
+
readonly durationMs: Schema.NullOr<Schema.Finite>;
|
|
1023
|
+
readonly outcomeTag: Schema.NullOr<Schema.String>;
|
|
1024
|
+
}>>;
|
|
1025
|
+
}>>;
|
|
1026
|
+
}>;
|
|
1027
|
+
export type Schedules = typeof Schedules.Type;
|
|
@@ -35,9 +35,18 @@ export const ActorRow = Schema.Struct({
|
|
|
35
35
|
created: Schema.Boolean,
|
|
36
36
|
lastEventSequence: Schema.Finite,
|
|
37
37
|
});
|
|
38
|
+
/**
|
|
39
|
+
* An actor as a list shows it, with its last command: the command and commit
|
|
40
|
+
* time of its receipt with the newest recorded commit time among its 256
|
|
41
|
+
* greatest command ids, null when none of them records one.
|
|
42
|
+
*/
|
|
43
|
+
export const ActorListRow = Schema.Struct({
|
|
44
|
+
...ActorRow.fields,
|
|
45
|
+
lastCommand: Schema.NullOr(Schema.Struct({ command: Schema.String, committedAtMs: Millis })),
|
|
46
|
+
});
|
|
38
47
|
/** A page of actors; `next` is the identity to continue from, or null at the end. */
|
|
39
48
|
export const ActorsPage = Schema.Struct({
|
|
40
|
-
actors: Schema.Array(
|
|
49
|
+
actors: Schema.Array(ActorListRow),
|
|
41
50
|
next: Schema.NullOr(Schema.Struct(Identity)),
|
|
42
51
|
});
|
|
43
52
|
/** A staged intent with its target, attempts, last error and due time in epoch milliseconds. */
|
|
@@ -112,7 +121,10 @@ export const WorkflowRow = Schema.Struct({
|
|
|
112
121
|
});
|
|
113
122
|
/**
|
|
114
123
|
* A command receipt with its outcome, expiry in epoch milliseconds and the
|
|
115
|
-
* sequences of the events it emitted.
|
|
124
|
+
* sequences of the events it emitted. `startedAtMs` is the database clock its
|
|
125
|
+
* batch's fenced read selected and `committedAtMs` the database clock when
|
|
126
|
+
* its commit wrote it; both are null on a receipt written before the runtime
|
|
127
|
+
* recorded them.
|
|
116
128
|
*/
|
|
117
129
|
export const ReceiptRow = Schema.Struct({
|
|
118
130
|
commandId: Schema.String,
|
|
@@ -121,6 +133,8 @@ export const ReceiptRow = Schema.Struct({
|
|
|
121
133
|
outcomeTag: Schema.NullOr(Schema.String),
|
|
122
134
|
outcome: Stored,
|
|
123
135
|
expiresAtMs: Millis,
|
|
136
|
+
startedAtMs: Schema.NullOr(Millis),
|
|
137
|
+
committedAtMs: Schema.NullOr(Millis),
|
|
124
138
|
events: Schema.Array(Schema.Finite),
|
|
125
139
|
});
|
|
126
140
|
/** A stored event with its sequence, size in bytes and emission time in epoch milliseconds. */
|
|
@@ -241,3 +255,138 @@ export const JobTypesPage = Schema.Struct({
|
|
|
241
255
|
jobTypes: Schema.Array(JobTypeRow),
|
|
242
256
|
next: Schema.NullOr(Schema.String),
|
|
243
257
|
});
|
|
258
|
+
/**
|
|
259
|
+
* Which runner answered a live read and what it covers: its name and region
|
|
260
|
+
* as the inspector was configured (null when not), when it began recording,
|
|
261
|
+
* and how many other runners the cluster lists (null when it could not tell).
|
|
262
|
+
* A live answer is this runner's alone; it covers the deployment only when
|
|
263
|
+
* `peers` is 0.
|
|
264
|
+
*/
|
|
265
|
+
export const LiveScope = Schema.Struct({
|
|
266
|
+
runner: Schema.NullOr(Schema.String),
|
|
267
|
+
region: Schema.NullOr(Schema.String),
|
|
268
|
+
startedAtMs: Millis,
|
|
269
|
+
peers: Schema.NullOr(Schema.Finite),
|
|
270
|
+
});
|
|
271
|
+
/**
|
|
272
|
+
* A recent rate and turn times: commands per second over the current minute
|
|
273
|
+
* and the four before it, and the median and 99th percentile turn time over
|
|
274
|
+
* the last hour, each null when the runner cannot say (or, for a percentile,
|
|
275
|
+
* when no turn committed). Percentiles are histogram bucket bounds capped by
|
|
276
|
+
* the slowest turn seen.
|
|
277
|
+
*/
|
|
278
|
+
const LiveRates = {
|
|
279
|
+
perSecond: Schema.NullOr(Schema.Finite),
|
|
280
|
+
p50Ms: Schema.NullOr(Schema.Finite),
|
|
281
|
+
p99Ms: Schema.NullOr(Schema.Finite),
|
|
282
|
+
};
|
|
283
|
+
/** The deepest mailbox among resident activations, null when none is resident. */
|
|
284
|
+
const MaxMailbox = Schema.NullOr(Schema.Struct({ depth: Schema.Finite, actorId: Schema.String }));
|
|
285
|
+
/**
|
|
286
|
+
* One runner's live view of a tenant: its rates, resident activations and
|
|
287
|
+
* deepest mailbox overall, and per actor type that has either.
|
|
288
|
+
*/
|
|
289
|
+
export const LiveOverview = Schema.Struct({
|
|
290
|
+
scope: LiveScope,
|
|
291
|
+
total: Schema.Struct({
|
|
292
|
+
...LiveRates,
|
|
293
|
+
awake: Schema.Finite,
|
|
294
|
+
maxMailbox: Schema.NullOr(Schema.Struct({ depth: Schema.Finite, actorType: Schema.String, actorId: Schema.String })),
|
|
295
|
+
}),
|
|
296
|
+
actorTypes: Schema.Array(Schema.Struct({
|
|
297
|
+
actorType: Schema.String,
|
|
298
|
+
...LiveRates,
|
|
299
|
+
awake: Schema.Finite,
|
|
300
|
+
maxMailbox: MaxMailbox,
|
|
301
|
+
})),
|
|
302
|
+
});
|
|
303
|
+
/**
|
|
304
|
+
* One actor type's commands over a window: the rate at each slot this runner
|
|
305
|
+
* observed (minutes for `1h`, hours otherwise), oldest first, and each
|
|
306
|
+
* command's volume; `activity` is null when the runner cannot say.
|
|
307
|
+
*/
|
|
308
|
+
export const LiveActivity = Schema.Struct({
|
|
309
|
+
scope: LiveScope,
|
|
310
|
+
activity: Schema.NullOr(Schema.Struct({
|
|
311
|
+
sinceMs: Millis,
|
|
312
|
+
points: Schema.Array(Schema.Struct({ atMs: Millis, perSecond: Schema.Finite })),
|
|
313
|
+
commands: Schema.Array(Schema.Struct({ command: Schema.String, count: Schema.Finite, perSecond: Schema.Finite })),
|
|
314
|
+
})),
|
|
315
|
+
});
|
|
316
|
+
/** One actor type's turn times over a window as a histogram and percentiles; null when the runner cannot say. */
|
|
317
|
+
export const LiveLatency = Schema.Struct({
|
|
318
|
+
scope: LiveScope,
|
|
319
|
+
latency: Schema.NullOr(Schema.Struct({
|
|
320
|
+
sinceMs: Millis,
|
|
321
|
+
count: Schema.Finite,
|
|
322
|
+
buckets: Schema.Array(Schema.Struct({ upToMs: Schema.NullOr(Schema.Finite), count: Schema.Finite })),
|
|
323
|
+
p50Ms: Schema.NullOr(Schema.Finite),
|
|
324
|
+
p95Ms: Schema.NullOr(Schema.Finite),
|
|
325
|
+
p99Ms: Schema.NullOr(Schema.Finite),
|
|
326
|
+
})),
|
|
327
|
+
});
|
|
328
|
+
/**
|
|
329
|
+
* Named actors as this runner holds them: whether each is resident, its
|
|
330
|
+
* mailbox depth when it is, its open sockets and its open feeds per event.
|
|
331
|
+
*/
|
|
332
|
+
export const LiveActors = Schema.Struct({
|
|
333
|
+
scope: LiveScope,
|
|
334
|
+
actors: Schema.Array(Schema.Struct({
|
|
335
|
+
actorId: Schema.String,
|
|
336
|
+
awake: Schema.Boolean,
|
|
337
|
+
mailbox: Schema.NullOr(Schema.Finite),
|
|
338
|
+
sockets: Schema.Finite,
|
|
339
|
+
feeds: Schema.Array(Schema.Struct({ event: Schema.String, subscribers: Schema.Finite })),
|
|
340
|
+
})),
|
|
341
|
+
});
|
|
342
|
+
const ConnectionCounts = {
|
|
343
|
+
sockets: Schema.Finite,
|
|
344
|
+
feeds: Schema.Finite,
|
|
345
|
+
streams: Schema.Finite,
|
|
346
|
+
watches: Schema.Finite,
|
|
347
|
+
};
|
|
348
|
+
/** The tenant's open WebSocket sessions and SSE responses on this runner, overall and per actor type. */
|
|
349
|
+
export const LiveConnections = Schema.Struct({
|
|
350
|
+
scope: LiveScope,
|
|
351
|
+
...ConnectionCounts,
|
|
352
|
+
byActorType: Schema.Array(Schema.Struct({ actorType: Schema.String, ...ConnectionCounts })),
|
|
353
|
+
});
|
|
354
|
+
/**
|
|
355
|
+
* One committed command as the command stream sends it: its turn's time on
|
|
356
|
+
* the database clock (`atMs` read after `COMMIT`), its caller key, outcome,
|
|
357
|
+
* the declared failure's tag, and a bounded, redacted payload preview.
|
|
358
|
+
*/
|
|
359
|
+
export const StreamCommand = Schema.Struct({
|
|
360
|
+
id: Schema.String,
|
|
361
|
+
commandId: Schema.String,
|
|
362
|
+
atMs: Millis,
|
|
363
|
+
durationMs: Schema.Finite,
|
|
364
|
+
actorType: Schema.String,
|
|
365
|
+
actorId: Schema.String,
|
|
366
|
+
command: Schema.String,
|
|
367
|
+
callerKey: Stored,
|
|
368
|
+
outcomeTag: Schema.Literals(["Success", "Failure"]),
|
|
369
|
+
errorTag: Schema.NullOr(Schema.String),
|
|
370
|
+
payloadPreview: Schema.NullOr(Schema.String),
|
|
371
|
+
});
|
|
372
|
+
/**
|
|
373
|
+
* Each cron entry the runtime registers, with the tenant's pending ticks of
|
|
374
|
+
* it, the soonest one's due time, and the newest committed tick among the
|
|
375
|
+
* type's newest receipts: its command id, commit time, duration and outcome.
|
|
376
|
+
*/
|
|
377
|
+
export const Schedules = Schema.Struct({
|
|
378
|
+
schedules: Schema.Array(Schema.Struct({
|
|
379
|
+
actorType: Schema.String,
|
|
380
|
+
key: Schema.String,
|
|
381
|
+
expression: Schema.String,
|
|
382
|
+
command: Schema.String,
|
|
383
|
+
pending: Schema.Finite,
|
|
384
|
+
nextDueAtMs: Schema.NullOr(Millis),
|
|
385
|
+
lastRun: Schema.NullOr(Schema.Struct({
|
|
386
|
+
commandId: Schema.String,
|
|
387
|
+
committedAtMs: Millis,
|
|
388
|
+
durationMs: Schema.NullOr(Schema.Finite),
|
|
389
|
+
outcomeTag: Schema.NullOr(Schema.String),
|
|
390
|
+
})),
|
|
391
|
+
})),
|
|
392
|
+
});
|
package/dist/protocol/wire.d.ts
CHANGED
|
@@ -31,33 +31,10 @@ declare const reasonSchemas: {
|
|
|
31
31
|
readonly _tag: Schema.tag<"QuotaExceeded">;
|
|
32
32
|
readonly organizationId: Schema.String;
|
|
33
33
|
readonly period: Schema.String;
|
|
34
|
-
readonly
|
|
35
|
-
readonly usedUnits: Schema.Finite;
|
|
36
|
-
readonly requestedUnits: Schema.Finite;
|
|
37
|
-
readonly unitsPerCommand: Schema.Int;
|
|
38
|
-
readonly retryAfterMs: Schema.Finite;
|
|
39
|
-
}>;
|
|
40
|
-
readonly SpendLimitExceeded: Schema.TaggedStruct<"SpendLimitExceeded", {
|
|
41
|
-
readonly _tag: Schema.tag<"SpendLimitExceeded">;
|
|
42
|
-
readonly organizationId: Schema.String;
|
|
43
|
-
readonly period: Schema.String;
|
|
44
|
-
readonly limitCents: Schema.Finite;
|
|
45
|
-
readonly projectedCents: Schema.Finite;
|
|
46
|
-
}>;
|
|
47
|
-
readonly ConnectionLimitExceeded: Schema.TaggedStruct<"ConnectionLimitExceeded", {
|
|
48
|
-
readonly _tag: Schema.tag<"ConnectionLimitExceeded">;
|
|
49
|
-
readonly organizationId: Schema.String;
|
|
50
|
-
readonly kind: Schema.Literals<readonly ["socket", "sse"]>;
|
|
34
|
+
readonly cap: Schema.Literals<readonly ["compute", "storage", "connections", "spend"]>;
|
|
51
35
|
readonly limit: Schema.Finite;
|
|
52
|
-
readonly
|
|
53
|
-
|
|
54
|
-
readonly StorageQuotaExceeded: Schema.TaggedStruct<"StorageQuotaExceeded", {
|
|
55
|
-
readonly _tag: Schema.tag<"StorageQuotaExceeded">;
|
|
56
|
-
readonly organizationId: Schema.String;
|
|
57
|
-
readonly deployment: Schema.String;
|
|
58
|
-
readonly tenant: Schema.String;
|
|
59
|
-
readonly limitBytes: Schema.Finite;
|
|
60
|
-
readonly usedBytes: Schema.Finite;
|
|
36
|
+
readonly used: Schema.Finite;
|
|
37
|
+
readonly retryAfterMs: Schema.Finite;
|
|
61
38
|
}>;
|
|
62
39
|
readonly InvalidInput: Schema.TaggedStruct<"InvalidInput", {
|
|
63
40
|
readonly _tag: Schema.tag<"InvalidInput">;
|
|
@@ -92,12 +69,6 @@ export declare const envelope: (route: {
|
|
|
92
69
|
}> | Schema.TaggedStruct<"CommandExpired", {
|
|
93
70
|
readonly _tag: Schema.tag<"CommandExpired">;
|
|
94
71
|
readonly commandId: Schema.String;
|
|
95
|
-
}> | Schema.TaggedStruct<"ConnectionLimitExceeded", {
|
|
96
|
-
readonly _tag: Schema.tag<"ConnectionLimitExceeded">;
|
|
97
|
-
readonly organizationId: Schema.String;
|
|
98
|
-
readonly kind: Schema.Literals<readonly ["socket", "sse"]>;
|
|
99
|
-
readonly limit: Schema.Finite;
|
|
100
|
-
readonly open: Schema.Finite;
|
|
101
72
|
}> | Schema.TaggedStruct<"InvalidCommandId", {
|
|
102
73
|
readonly commandId: Schema.String;
|
|
103
74
|
readonly code: Schema.Literals<readonly ["malformed", "future", "window", "version"]>;
|
|
@@ -112,29 +83,15 @@ export declare const envelope: (route: {
|
|
|
112
83
|
readonly _tag: Schema.tag<"QuotaExceeded">;
|
|
113
84
|
readonly organizationId: Schema.String;
|
|
114
85
|
readonly period: Schema.String;
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
117
|
-
readonly
|
|
118
|
-
readonly unitsPerCommand: Schema.Int;
|
|
86
|
+
readonly cap: Schema.Literals<readonly ["compute", "storage", "connections", "spend"]>;
|
|
87
|
+
readonly limit: Schema.Finite;
|
|
88
|
+
readonly used: Schema.Finite;
|
|
119
89
|
readonly retryAfterMs: Schema.Finite;
|
|
120
90
|
}> | Schema.TaggedStruct<"RunnerAtCapacity", {}> | Schema.TaggedStruct<"SessionEnded", {
|
|
121
91
|
readonly _tag: Schema.tag<"SessionEnded">;
|
|
122
92
|
readonly cause: Schema.Literals<readonly ["ClientClosed", "ServerClosed", "SlowConsumer", "HolderShutdown", "HolderLost", "OwnerLost", "ActivationEnded", "ActorUnavailable", "Defect", "Terminated"]>;
|
|
123
93
|
readonly resync: Schema.Boolean;
|
|
124
94
|
readonly retryAfterMs: Schema.optional<Schema.Finite>;
|
|
125
|
-
}> | Schema.TaggedStruct<"SpendLimitExceeded", {
|
|
126
|
-
readonly _tag: Schema.tag<"SpendLimitExceeded">;
|
|
127
|
-
readonly organizationId: Schema.String;
|
|
128
|
-
readonly period: Schema.String;
|
|
129
|
-
readonly limitCents: Schema.Finite;
|
|
130
|
-
readonly projectedCents: Schema.Finite;
|
|
131
|
-
}> | Schema.TaggedStruct<"StorageQuotaExceeded", {
|
|
132
|
-
readonly _tag: Schema.tag<"StorageQuotaExceeded">;
|
|
133
|
-
readonly organizationId: Schema.String;
|
|
134
|
-
readonly deployment: Schema.String;
|
|
135
|
-
readonly tenant: Schema.String;
|
|
136
|
-
readonly limitBytes: Schema.Finite;
|
|
137
|
-
readonly usedBytes: Schema.Finite;
|
|
138
95
|
}> | Schema.TaggedStruct<"Timeout", {
|
|
139
96
|
readonly _tag: Schema.tag<"Timeout">;
|
|
140
97
|
readonly commandId: Schema.optionalKey<Schema.String>;
|
package/dist/protocol/wire.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Match, Option, Schema } from "effect";
|
|
2
|
-
import { ActorError, ActorUnavailable, CommandConflict, CommandExpired,
|
|
2
|
+
import { ActorError, ActorUnavailable, CommandConflict, CommandExpired, InvalidCommandId, InvalidInput, Reason, QuotaExceeded, SessionEnded, Timeout, Unauthorized, withRetryAfter, } from "../errors/actor.js";
|
|
3
3
|
/** The served protocol's major version, sent and checked as `durable-protocol`. */
|
|
4
4
|
export const PROTOCOL = 1;
|
|
5
5
|
const reasonSchemas = {
|
|
@@ -16,9 +16,6 @@ const reasonSchemas = {
|
|
|
16
16
|
MailboxFull: Schema.TaggedStruct("MailboxFull", {}),
|
|
17
17
|
RunnerAtCapacity: Schema.TaggedStruct("RunnerAtCapacity", {}),
|
|
18
18
|
QuotaExceeded: Schema.TaggedStruct("QuotaExceeded", QuotaExceeded.fields),
|
|
19
|
-
SpendLimitExceeded: Schema.TaggedStruct("SpendLimitExceeded", SpendLimitExceeded.fields),
|
|
20
|
-
ConnectionLimitExceeded: Schema.TaggedStruct("ConnectionLimitExceeded", ConnectionLimitExceeded.fields),
|
|
21
|
-
StorageQuotaExceeded: Schema.TaggedStruct("StorageQuotaExceeded", StorageQuotaExceeded.fields),
|
|
22
19
|
InvalidInput: Schema.TaggedStruct("InvalidInput", InvalidInput.fields),
|
|
23
20
|
SessionEnded: Schema.TaggedStruct("SessionEnded", SessionEnded.fields),
|
|
24
21
|
};
|
|
@@ -66,9 +63,6 @@ export const statusOf = (reason) => Match.value(reason).pipe(Match.tagsExhaustiv
|
|
|
66
63
|
ActorUnavailable: () => 503,
|
|
67
64
|
RunnerAtCapacity: () => 503,
|
|
68
65
|
QuotaExceeded: () => 429,
|
|
69
|
-
SpendLimitExceeded: () => 402,
|
|
70
|
-
ConnectionLimitExceeded: () => 429,
|
|
71
|
-
StorageQuotaExceeded: () => 429,
|
|
72
66
|
Timeout: () => 504,
|
|
73
67
|
NotCreated: () => 404,
|
|
74
68
|
MailboxFull: () => 429,
|
|
@@ -81,9 +75,6 @@ export const closeCodeOf = (reason) => Match.value(reason).pipe(Match.tagsExhaus
|
|
|
81
75
|
ActorUnavailable: () => 1013,
|
|
82
76
|
RunnerAtCapacity: () => 1013,
|
|
83
77
|
QuotaExceeded: () => 1008,
|
|
84
|
-
SpendLimitExceeded: () => 1008,
|
|
85
|
-
ConnectionLimitExceeded: () => 1008,
|
|
86
|
-
StorageQuotaExceeded: () => 1008,
|
|
87
78
|
NotCreated: () => 4404,
|
|
88
79
|
Unauthorized: (unauthorized) => unauthorized.code === "reauthorization_unavailable" ? 1013 : 1008,
|
|
89
80
|
InvalidInput: () => 4400,
|
package/dist/runtime/actors.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LiveRuntime } from "./telemetry/live.ts";
|
|
1
2
|
import { Context, type Effect, type Scope, type Stream } from "effect";
|
|
2
3
|
import type { Transport } from "./connections/transport.ts";
|
|
3
4
|
import type { Holder } from "./connections/holder.ts";
|
|
@@ -18,6 +19,8 @@ declare const InternalActors_base: Context.ServiceClass<InternalActors, "@rikala
|
|
|
18
19
|
readonly transport: Transport;
|
|
19
20
|
/** This runner's in-process connection holder. */
|
|
20
21
|
readonly holder: Holder;
|
|
22
|
+
/** What this runner knows only in memory, for the inspector's live reads. */
|
|
23
|
+
readonly live: LiveRuntime["Service"];
|
|
21
24
|
/** Ends the actor's activation on this runner as idle expiry would. */
|
|
22
25
|
readonly hibernate: (ref: ActorRef) => Effect.Effect<void>;
|
|
23
26
|
readonly execute: (request: Request) => Effect.Effect<Executed, ActorError>;
|
|
@@ -42,7 +42,7 @@ const backfillTable = Effect.fnUntraced(function* (target, batch) {
|
|
|
42
42
|
WHERE table_schema = ${target.schema} AND table_name = ${target.table}`;
|
|
43
43
|
if (adoption === undefined)
|
|
44
44
|
return yield* AdoptionRefused.make({
|
|
45
|
-
message: `${name} is not observed; run
|
|
45
|
+
message: `${name} is not observed; run akter adopt observe ${target.table} first`,
|
|
46
46
|
});
|
|
47
47
|
if (adoption.mode === "enforce")
|
|
48
48
|
return yield* AdoptionRefused.make({
|
|
@@ -53,7 +53,7 @@ const enforcementRefusals = Effect.fnUntraced(function* (target, options) {
|
|
|
53
53
|
OR ${identifier(target.tenantColumn)}::text = '' OR ${identifier(target.actorColumn)}::text = '')::text AS unowned
|
|
54
54
|
FROM ${table}`);
|
|
55
55
|
if (Number(counts.unfilled) > 0)
|
|
56
|
-
refusals.push(`${counts.unfilled} rows of ${name} have no routing_key; run
|
|
56
|
+
refusals.push(`${counts.unfilled} rows of ${name} have no routing_key; run akter adopt backfill ${target.table}`);
|
|
57
57
|
if (Number(counts.unowned) > 0)
|
|
58
58
|
refusals.push(`${counts.unowned} rows of ${name} have a NULL or empty ${target.tenantColumn} or ${target.actorColumn}, so no actor owns them`);
|
|
59
59
|
const recent = yield* sql `
|
|
@@ -152,7 +152,7 @@ export const enforceAdoption = Effect.fnUntraced(function* (actors, options) {
|
|
|
152
152
|
WHERE table_schema = ${target.schema} AND table_name = ${target.table} FOR UPDATE`;
|
|
153
153
|
if (adoption === undefined)
|
|
154
154
|
return yield* AdoptionRefused.make({
|
|
155
|
-
message: `${name} is not observed; run
|
|
155
|
+
message: `${name} is not observed; run akter adopt observe ${target.table} first`,
|
|
156
156
|
});
|
|
157
157
|
if (adoption.mode === "enforce")
|
|
158
158
|
return yield* AdoptionRefused.make({ message: `${name} is already enforced` });
|
|
@@ -66,7 +66,7 @@ export const observeAdoption = Effect.fnUntraced(function* (actors, only, lockTi
|
|
|
66
66
|
});
|
|
67
67
|
if (existing?.mode === "enforce")
|
|
68
68
|
return yield* AdoptionRefused.make({
|
|
69
|
-
message: `${name} is enforced; run
|
|
69
|
+
message: `${name} is enforced; run akter adopt release ${target.table} --to observe first`,
|
|
70
70
|
});
|
|
71
71
|
const [column] = yield* sql `
|
|
72
72
|
SELECT t.typname AS type FROM pg_attribute a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/sql";
|
|
3
3
|
import { type AdoptionTarget } from "./target.ts";
|
|
4
|
-
/** What `
|
|
4
|
+
/** What `akter adopt plan` reports for one table; it changes nothing. */
|
|
5
5
|
export interface AdoptionPlan {
|
|
6
6
|
readonly table: string;
|
|
7
7
|
readonly actor: string;
|
|
@@ -32,7 +32,7 @@ export const checkEnforcedTable = Effect.fnUntraced(function* ({ target, writerR
|
|
|
32
32
|
]) {
|
|
33
33
|
const found = triggers.find((trigger) => trigger.name === name);
|
|
34
34
|
if (found === undefined)
|
|
35
|
-
return yield* refuse(`is enforced but its guard trigger ${name} is missing; run
|
|
35
|
+
return yield* refuse(`is enforced but its guard trigger ${name} is missing; run akter adopt release ${target.table} --to observe and enforce it again`);
|
|
36
36
|
if (found.enabled !== "A")
|
|
37
37
|
return yield* refuse(`is enforced but its guard trigger ${name} is not enabled always; run ALTER TABLE ${target.table} ENABLE ALWAYS TRIGGER ${name}`);
|
|
38
38
|
if (found.function !== "actor_adoption_guard" || found.type !== type)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/sql";
|
|
3
|
-
/** One adopted table as `
|
|
3
|
+
/** One adopted table as `akter adopt status` reports it. */
|
|
4
4
|
export interface AdoptionStatus {
|
|
5
5
|
readonly table: string;
|
|
6
6
|
readonly actor: string;
|