rivetkit 0.0.0-sqlite-sync-3-0-1-final.5663d2f → 0.0.0-sqlite-query-metrics-2-3-32.5bb1917

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.
Files changed (151) hide show
  1. package/dist/browser/client.d.ts +59 -108
  2. package/dist/browser/client.js +40 -294
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +2 -4
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/{chunk-MT4SROQM.js → chunk-33ENWMMU.js} +2 -2
  7. package/dist/tsup/{chunk-SEKTNJU6.js → chunk-3CR3G6GH.js} +4 -4
  8. package/dist/tsup/{chunk-3ZKCK6NL.js → chunk-45PVI6U7.js} +45 -283
  9. package/dist/tsup/chunk-45PVI6U7.js.map +1 -0
  10. package/dist/tsup/{chunk-G26OT2Q6.cjs → chunk-4DN2KK66.cjs} +3 -3
  11. package/dist/tsup/{chunk-G26OT2Q6.cjs.map → chunk-4DN2KK66.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-YNAEH775.js → chunk-4FJSCX7N.js} +2 -2
  13. package/dist/tsup/{chunk-UXDASKP6.js → chunk-6FEYCVZC.js} +1 -1
  14. package/dist/tsup/chunk-6FEYCVZC.js.map +1 -0
  15. package/dist/tsup/{chunk-DGU2H5IJ.cjs → chunk-BTSZSJRJ.cjs} +3 -3
  16. package/dist/tsup/{chunk-DGU2H5IJ.cjs.map → chunk-BTSZSJRJ.cjs.map} +1 -1
  17. package/dist/tsup/{chunk-XLD6TRSE.cjs → chunk-EHYJKPAP.cjs} +3 -3
  18. package/dist/tsup/{chunk-XLD6TRSE.cjs.map → chunk-EHYJKPAP.cjs.map} +1 -1
  19. package/dist/tsup/{chunk-TTMWSZZA.js → chunk-FUK2CP2K.js} +2 -2
  20. package/dist/tsup/{chunk-T7DJZSPH.js → chunk-FYPBFYOE.js} +2 -2
  21. package/dist/tsup/{chunk-EKERHPCE.cjs → chunk-G6GFLUEH.cjs} +4 -4
  22. package/dist/tsup/{chunk-EKERHPCE.cjs.map → chunk-G6GFLUEH.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-X567WA3N.cjs → chunk-H6N64S5B.cjs} +10 -10
  24. package/dist/tsup/{chunk-X567WA3N.cjs.map → chunk-H6N64S5B.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-SSF2XC33.cjs → chunk-HDVZ6YZG.cjs} +1 -1
  26. package/dist/tsup/chunk-HDVZ6YZG.cjs.map +1 -0
  27. package/dist/tsup/{chunk-GAFMEUAL.js → chunk-ITE3ZB72.js} +3 -3
  28. package/dist/tsup/{chunk-A2CF6PFH.js → chunk-JI6GZ2C2.js} +1 -18
  29. package/dist/tsup/chunk-JI6GZ2C2.js.map +1 -0
  30. package/dist/tsup/{chunk-DU7V4SDK.js → chunk-JWA522P7.js} +7 -12
  31. package/dist/tsup/chunk-JWA522P7.js.map +1 -0
  32. package/dist/tsup/{chunk-YJ2X5STT.cjs → chunk-KSTWQRZE.cjs} +182 -420
  33. package/dist/tsup/chunk-KSTWQRZE.cjs.map +1 -0
  34. package/dist/tsup/{chunk-RTWH3AX3.cjs → chunk-MYWZCDML.cjs} +2 -19
  35. package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -0
  36. package/dist/tsup/{chunk-C2NON6V4.cjs → chunk-TKOYPRNT.cjs} +7 -7
  37. package/dist/tsup/{chunk-C2NON6V4.cjs.map → chunk-TKOYPRNT.cjs.map} +1 -1
  38. package/dist/tsup/{chunk-6UDO6UYM.cjs → chunk-WHVTHUVW.cjs} +7 -12
  39. package/dist/tsup/chunk-WHVTHUVW.cjs.map +1 -0
  40. package/dist/tsup/client/mod.cjs +6 -6
  41. package/dist/tsup/client/mod.d.cts +3 -15
  42. package/dist/tsup/client/mod.d.ts +3 -15
  43. package/dist/tsup/client/mod.js +5 -5
  44. package/dist/tsup/common/log.cjs +2 -2
  45. package/dist/tsup/common/log.js +1 -1
  46. package/dist/tsup/common/websocket.cjs +3 -3
  47. package/dist/tsup/common/websocket.js +2 -2
  48. package/dist/tsup/{config-RMLak20L.d.cts → config-CkmVg2fG.d.cts} +12 -60
  49. package/dist/tsup/{config-CASGH-5t.d.ts → config-Cw_BwH_G.d.ts} +12 -60
  50. package/dist/tsup/{config-BfG1qpYz.d.ts → config-D4clT6mq.d.cts} +52 -34
  51. package/dist/tsup/{config-BfG1qpYz.d.cts → config-D4clT6mq.d.ts} +52 -34
  52. package/dist/tsup/{context-C1tMYvV-.d.ts → context-BYOKTQJi.d.ts} +2 -2
  53. package/dist/tsup/{context-CxNE2KvK.d.cts → context-_xIcgBnE.d.cts} +2 -2
  54. package/dist/tsup/db/drizzle.cjs +2 -2
  55. package/dist/tsup/db/drizzle.d.cts +1 -1
  56. package/dist/tsup/db/drizzle.d.ts +1 -1
  57. package/dist/tsup/db/drizzle.js +1 -1
  58. package/dist/tsup/db/mod.cjs +3 -3
  59. package/dist/tsup/db/mod.d.cts +2 -2
  60. package/dist/tsup/db/mod.d.ts +2 -2
  61. package/dist/tsup/db/mod.js +2 -2
  62. package/dist/tsup/dynamic/mod.cjs +2 -2
  63. package/dist/tsup/dynamic/mod.d.cts +2 -2
  64. package/dist/tsup/dynamic/mod.d.ts +2 -2
  65. package/dist/tsup/dynamic/mod.js +1 -1
  66. package/dist/tsup/inspector/mod.cjs +5 -5
  67. package/dist/tsup/inspector/mod.js +4 -4
  68. package/dist/tsup/inspector/workflow.cjs +4 -4
  69. package/dist/tsup/inspector/workflow.js +3 -3
  70. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  71. package/dist/tsup/inspector-tab/mod.d.cts +3 -3
  72. package/dist/tsup/inspector-tab/mod.d.ts +3 -3
  73. package/dist/tsup/inspector-tab/mod.js +1 -1
  74. package/dist/tsup/mod.cjs +232 -591
  75. package/dist/tsup/mod.cjs.map +1 -1
  76. package/dist/tsup/mod.d.cts +4 -4
  77. package/dist/tsup/mod.d.ts +4 -4
  78. package/dist/tsup/mod.js +124 -483
  79. package/dist/tsup/mod.js.map +1 -1
  80. package/dist/tsup/test/mod.cjs +7 -7
  81. package/dist/tsup/test/mod.d.cts +2 -2
  82. package/dist/tsup/test/mod.d.ts +2 -2
  83. package/dist/tsup/test/mod.js +5 -5
  84. package/dist/tsup/unstable/migrations.d.cts +1 -1
  85. package/dist/tsup/unstable/migrations.d.ts +1 -1
  86. package/dist/tsup/utils.cjs +2 -2
  87. package/dist/tsup/utils.js +1 -1
  88. package/dist/tsup/workflow/mod.cjs +22 -25
  89. package/dist/tsup/workflow/mod.cjs.map +1 -1
  90. package/dist/tsup/workflow/mod.d.cts +4 -4
  91. package/dist/tsup/workflow/mod.d.ts +4 -4
  92. package/dist/tsup/workflow/mod.js +8 -11
  93. package/dist/tsup/workflow/mod.js.map +1 -1
  94. package/package.json +10 -12
  95. package/src/actor/config.test.ts +78 -0
  96. package/src/actor/config.ts +0 -2
  97. package/src/actor/keys.test.ts +275 -0
  98. package/src/actor/keys.ts +0 -86
  99. package/src/actor/utils.test.ts +48 -0
  100. package/src/client/actor-conn.ts +24 -136
  101. package/src/client/actor-handle.ts +10 -64
  102. package/src/client/client.ts +0 -6
  103. package/src/client/config.ts +1 -12
  104. package/src/client/lifecycle-errors.ts +2 -35
  105. package/src/client/raw-utils.ts +3 -17
  106. package/src/client/test.ts +44 -0
  107. package/src/client/token-provider.test.ts +86 -0
  108. package/src/client/utils.ts +2 -17
  109. package/src/common/database/config.ts +52 -46
  110. package/src/common/database/mod.test.ts +364 -0
  111. package/src/common/database/native-database.test.ts +220 -0
  112. package/src/common/database/native-database.ts +27 -247
  113. package/src/common/inline-websocket-adapter.test.ts +51 -0
  114. package/src/common/router.ts +1 -1
  115. package/src/db/drizzle.test.ts +164 -0
  116. package/src/db/mod.ts +1 -0
  117. package/src/engine-api/actors.ts +3 -3
  118. package/src/engine-client/actor-websocket-client.ts +2 -4
  119. package/src/engine-client/api-endpoints.ts +14 -44
  120. package/src/engine-client/mod.ts +2 -2
  121. package/src/registry/config/envoy.ts +1 -1
  122. package/src/registry/config/index.test.ts +25 -0
  123. package/src/registry/config/index.ts +30 -30
  124. package/src/registry/index.ts +21 -66
  125. package/src/registry/napi-runtime.ts +3 -82
  126. package/src/registry/native.ts +65 -204
  127. package/src/registry/run-handler-coordinator.test.ts +252 -0
  128. package/src/registry/runtime.test.ts +124 -0
  129. package/src/registry/runtime.ts +10 -79
  130. package/src/registry/wasm-runtime.ts +3 -94
  131. package/src/unstable/migrations.test.ts +170 -0
  132. package/src/utils/endpoint-parser.test.ts +206 -0
  133. package/src/utils/env-vars.ts +6 -13
  134. package/src/utils.test.ts +34 -0
  135. package/src/workflow/driver.test.ts +62 -0
  136. package/src/workflow/driver.ts +3 -5
  137. package/dist/tsup/chunk-3ZKCK6NL.js.map +0 -1
  138. package/dist/tsup/chunk-6UDO6UYM.cjs.map +0 -1
  139. package/dist/tsup/chunk-A2CF6PFH.js.map +0 -1
  140. package/dist/tsup/chunk-DU7V4SDK.js.map +0 -1
  141. package/dist/tsup/chunk-RTWH3AX3.cjs.map +0 -1
  142. package/dist/tsup/chunk-SSF2XC33.cjs.map +0 -1
  143. package/dist/tsup/chunk-UXDASKP6.js.map +0 -1
  144. package/dist/tsup/chunk-YJ2X5STT.cjs.map +0 -1
  145. package/src/client/retry-budget.ts +0 -78
  146. /package/dist/tsup/{chunk-MT4SROQM.js.map → chunk-33ENWMMU.js.map} +0 -0
  147. /package/dist/tsup/{chunk-SEKTNJU6.js.map → chunk-3CR3G6GH.js.map} +0 -0
  148. /package/dist/tsup/{chunk-YNAEH775.js.map → chunk-4FJSCX7N.js.map} +0 -0
  149. /package/dist/tsup/{chunk-TTMWSZZA.js.map → chunk-FUK2CP2K.js.map} +0 -0
  150. /package/dist/tsup/{chunk-T7DJZSPH.js.map → chunk-FYPBFYOE.js.map} +0 -0
  151. /package/dist/tsup/{chunk-GAFMEUAL.js.map → chunk-ITE3ZB72.js.map} +0 -0
@@ -51,13 +51,18 @@ interface SqliteTransactionOptions {
51
51
  * to change without notice.
52
52
  */
53
53
  interface SqliteProfilingOptions {
54
- /** Exact SQL statements to give fingerprint labels. Profiling defaults to actor
55
- * aggregates without fingerprint labels. Profile logs remain enabled.
56
- * RIVETKIT_SQLITE_PROFILING overrides selection with a JSON object containing
57
- * queries and/or fingerprints arrays. An empty object clears fingerprint selection. */
58
- queries?: string[];
59
- /** Exact query fingerprints to label separately, as reported in profile logs. */
60
- fingerprints?: string[];
54
+ /** Existing v2 switch. Default: true. */
55
+ enabled?: boolean;
56
+ /** Exact SQL filter. Union with filterQueryFingerprints; both empty means all queries. */
57
+ filterQueries?: string[];
58
+ /** Fingerprint filter, including transaction fingerprints. Filters metrics, not diagnostic logs. */
59
+ filterQueryFingerprints?: string[];
60
+ /** Metric defaults apply even when omitted. Disabled metrics allocate no series. */
61
+ metrics?: SqliteProfilingMetricsOptions;
62
+ /** Duration buckets in seconds. Default [0.01, 0.1, 1]. Positive, finite, strictly increasing.
63
+ * All actors in a process enabling the duration histogram must use identical buckets. */
64
+ durationHistogramBucketsSeconds?: number[];
65
+ /** Maximum distinct statement fingerprints per process. Default: 512. */
61
66
  maxTrackedStatementFingerprints?: number;
62
67
  maxTrackedTransactionFingerprints?: number;
63
68
  maxPrometheusSeries?: number;
@@ -69,6 +74,45 @@ interface SqliteProfilingOptions {
69
74
  maxDiagnosticEventsPerMinute?: number;
70
75
  diagnosticEventQueueCapacity?: number;
71
76
  }
77
+ /** SQLite profiling metrics. Physical-request metrics and gauges have no query labels. */
78
+ interface SqliteProfilingMetricsOptions {
79
+ /** Execution count and cumulative seconds. Uses histogram count/sum when enabled, otherwise counters. Default: true. */
80
+ duration?: boolean;
81
+ /** Execution duration histogram. Only applies when duration is enabled. Default: true. */
82
+ durationHistogram?: boolean;
83
+ /** Outcome counters, including success and errors. Default: true. */
84
+ outcomes?: boolean;
85
+ /** Per-query timing phase histograms. Default: false. */
86
+ phaseDurationHistogram?: boolean;
87
+ /** Storage round trips per operation histogram. Default: false. */
88
+ getPagesRoundTripsHistogram?: boolean;
89
+ /** Statements per transaction histogram. Default: false. */
90
+ transactionStatementCountHistogram?: boolean;
91
+ /** Per-query pages returned from storage, including returned prefetch pages. Default: true. */
92
+ pagesFetched?: boolean;
93
+ /** Actor-level page counters by page kind (no query labels). Default: false. */
94
+ localPages?: boolean;
95
+ /** Actor-level byte counters by byte kind (no query labels). Default: false. */
96
+ localBytes?: boolean;
97
+ /** Actor-level physical storage request duration histogram. Default: false. */
98
+ getPagesDurationHistogram?: boolean;
99
+ /** Actor-level pages per storage request histograms, by page kind. Default: false. */
100
+ getPagesPagesHistogram?: boolean;
101
+ /** Actor-level storage response byte histogram. Default: false. */
102
+ getPagesResponseBytesHistogram?: boolean;
103
+ /** Actor-level missing response page counter. Default: false. */
104
+ getPagesMissingPages?: boolean;
105
+ /** Queued SQLite work, aggregated by actor name. Default: true. */
106
+ workerQueueDepth?: boolean;
107
+ /** Executing SQLite work, aggregated by actor name. Default: true. */
108
+ workerInflight?: boolean;
109
+ /** Transaction waiters, aggregated by actor name. Default: true. */
110
+ coordinatorQueueDepth?: boolean;
111
+ /** Counts observations exceeding fingerprint or series limits. Default: true. */
112
+ fingerprintOverflow?: boolean;
113
+ /** Counts diagnostic events dropped by rate limits or backpressure. Default: true. */
114
+ eventDropped?: boolean;
115
+ }
72
116
  interface SqliteNativeMetrics {
73
117
  requestBuildNs: number;
74
118
  serializeNs: number;
@@ -84,46 +128,20 @@ interface SqliteNativeMetrics {
84
128
  }
85
129
  interface SqliteDatabase {
86
130
  exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
87
- execSync?(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
88
131
  execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
89
- executeSync?(sql: string, params?: SqliteBindings): SqliteExecuteResult;
90
132
  executeBatch(statements: SqliteBatchStatement[]): Promise<SqliteExecuteResult[]>;
91
133
  beginTransaction(timeoutMs?: number, name?: string): Promise<SqliteTransactionDatabase>;
92
- beginTransactionSync?(timeoutMs?: number, name?: string): SynchronousSqliteTransactionDatabase;
93
134
  run(sql: string, params?: SqliteBindings): Promise<void>;
94
135
  query(sql: string, params?: SqliteBindings): Promise<SqliteQueryResult>;
95
136
  nativeMetrics?(): SqliteNativeMetrics | Promise<SqliteNativeMetrics | null> | null;
96
- /**
97
- * Returns the ticket of the latest local commit. Synchronous writes return before they are
98
- * durable; pass the ticket to `whenDurable` before releasing output that depends on them.
99
- */
100
- commitTicket?(): number;
101
- /**
102
- * Resolves once the commit `ticket` names and every earlier commit are durable. Rejects with
103
- * `sqlite.durability_failed` once the database broke and the actor is restarting.
104
- */
105
- whenDurable?(ticket: number): Promise<void>;
106
- /**
107
- * Restarts the owning actor from durable state. Every later write fails, including the final
108
- * state save. For native database providers whose in-memory state can no longer be trusted.
109
- */
110
- abortGeneration?(reason: string): void;
111
137
  close(): Promise<void>;
112
138
  }
113
139
  interface SqliteTransactionDatabase {
114
140
  exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
115
- execSync?(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
116
141
  execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
117
- executeSync?(sql: string, params?: SqliteBindings): SqliteExecuteResult;
118
142
  commit(): Promise<void>;
119
143
  rollback(): Promise<void>;
120
144
  }
121
- type SynchronousSqliteTransactionDatabase = SqliteTransactionDatabase & {
122
- execSync(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
123
- executeSync(sql: string, params?: SqliteBindings): SqliteExecuteResult;
124
- commitSync(): void;
125
- rollbackSync(): void;
126
- };
127
145
  /**
128
146
  * Provider for opening native databases from the active runtime.
129
147
  */
@@ -728,7 +746,6 @@ interface RuntimeActorConfig {
728
746
  icon?: string;
729
747
  hasDatabase?: boolean;
730
748
  remoteSqlite?: boolean;
731
- sqliteDeferredCommits?: boolean;
732
749
  sqliteProfiling?: SqliteProfilingOptions;
733
750
  tracing?: RuntimeActorTracingConfig;
734
751
  enableActorRuntimeSocket?: boolean;
@@ -786,8 +803,6 @@ interface RuntimeServeConfig {
786
803
  engineBinaryPath?: string;
787
804
  startServices?: boolean;
788
805
  servicesBinaryPath?: string;
789
- /** Whether config resolution selected a managed local development engine. */
790
- engineSpawn?: boolean;
791
806
  engineHost?: string;
792
807
  enginePort?: number;
793
808
  handleInspectorHttpInRuntime?: boolean;
@@ -876,12 +891,7 @@ interface CoreRuntime {
876
891
  createCancellationToken(): CancellationTokenHandle;
877
892
  cancellationTokenAborted(token: CancellationTokenHandle): boolean;
878
893
  cancelCancellationToken(token: CancellationTokenHandle): void;
879
- /**
880
- * Calls `callback` once when `token` is cancelled. Returns a release
881
- * function that drops the registration without calling `callback`; call it
882
- * once cancellation no longer matters so the native listener is freed.
883
- */
884
- onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): () => void;
894
+ onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): void;
885
895
  actorState(ctx: ActorContextHandle): RuntimeBytes;
886
896
  actorBeginOnStateChange(ctx: ActorContextHandle): void;
887
897
  actorEndOnStateChange(ctx: ActorContextHandle): void;
@@ -955,20 +965,13 @@ interface CoreRuntime {
955
965
  actorKvBatchPut(ctx: ActorContextHandle, entries: RuntimeKvEntry[]): Promise<void>;
956
966
  actorKvBatchDelete(ctx: ActorContextHandle, keys: RuntimeBytes[]): Promise<void>;
957
967
  actorSqlExec(ctx: ActorContextHandle, sql: string): Promise<RuntimeSqlExecResult>;
958
- actorSqlExecSync(ctx: ActorContextHandle, sql: string): RuntimeSqlExecResult;
959
968
  actorSqlExecute(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
960
- actorSqlExecuteSync(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
961
969
  actorSqlExecuteBatch(ctx: ActorContextHandle, statements: RuntimeSqlBatchStatement[]): Promise<RuntimeSqlExecuteResult[]>;
962
970
  actorSqlBeginTransaction(ctx: ActorContextHandle, timeoutMs?: number, name?: string): Promise<SqliteTransactionHandle>;
963
- actorSqlBeginTransactionSync(ctx: ActorContextHandle, timeoutMs?: number, name?: string): SqliteTransactionHandle;
964
971
  actorSqlTransactionExec(transaction: SqliteTransactionHandle, sql: string): Promise<RuntimeSqlExecResult>;
965
- actorSqlTransactionExecSync(transaction: SqliteTransactionHandle, sql: string): RuntimeSqlExecResult;
966
972
  actorSqlTransactionExecute(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
967
- actorSqlTransactionExecuteSync(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
968
973
  actorSqlTransactionCommit(transaction: SqliteTransactionHandle): Promise<void>;
969
- actorSqlTransactionCommitSync(transaction: SqliteTransactionHandle): void;
970
974
  actorSqlTransactionRollback(transaction: SqliteTransactionHandle): Promise<void>;
971
- actorSqlTransactionRollbackSync(transaction: SqliteTransactionHandle): void;
972
975
  actorBeginStateTransaction(ctx: ActorContextHandle, timeoutMs?: number): Promise<ActorStateTransactionHandle>;
973
976
  actorStateTransactionExecute(transaction: ActorStateTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
974
977
  actorStateTransactionCommit(transaction: ActorStateTransactionHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
@@ -977,13 +980,6 @@ interface CoreRuntime {
977
980
  actorSqlRun(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlRunResult>;
978
981
  actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
979
982
  actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
980
- /** Opens the actor database so later synchronous calls never fetch its first pages. */
981
- actorSqlOpen(ctx: ActorContextHandle): Promise<void>;
982
- /** Returns the ticket of the latest local commit. */
983
- actorSqlCommitTicket(ctx: ActorContextHandle): number;
984
- /** Resolves once the commit `ticket` names and every earlier commit are durable. */
985
- actorSqlWhenDurable(ctx: ActorContextHandle, ticket: number): Promise<void>;
986
- actorSqlAbortGeneration(ctx: ActorContextHandle, reason: string): void;
987
983
  actorSqlClose(ctx: ActorContextHandle): Promise<void>;
988
984
  actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
989
985
  actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
@@ -1285,27 +1281,6 @@ declare class ActorConnRaw {
1285
1281
  */
1286
1282
  type ActorConn<AD extends AnyActorDefinition> = Omit<ActorConnRaw, "send" | "on" | "once"> & ActorDefinitionQueueSend<AD> & ActorDefinitionEventSubscriptions<AD> & ActorDefinitionActions<AD>;
1287
1283
 
1288
- /** How many retries a client may spend, as a share of the requests it sends. */
1289
- interface RetryBudgetOptions {
1290
- /** Retries allowed per 100 requests (default 10). */
1291
- percent?: number;
1292
- /** Retries the client can bank for a burst of refusals; the budget starts full (default 100). */
1293
- maxTokens?: number;
1294
- }
1295
- /**
1296
- * Bounds the client's retries of refused requests. Each request adds a fraction of a token and
1297
- * each retry spends one, so retries stay a fixed share of traffic while the service sheds load
1298
- * instead of multiplying it.
1299
- */
1300
- declare class RetryBudget {
1301
- #private;
1302
- constructor(options?: RetryBudgetOptions);
1303
- /** Credits one request sent. */
1304
- deposit(): void;
1305
- /** Spends one token. Returns `false` when the budget is spent. */
1306
- tryWithdraw(): boolean;
1307
- }
1308
-
1309
1284
  /**
1310
1285
  * Provides underlying functions for stateless {@link ActorHandle} for action calls.
1311
1286
  * Similar to ActorConnRaw but doesn't maintain a connection.
@@ -1321,7 +1296,7 @@ declare class ActorHandleRaw {
1321
1296
  *
1322
1297
  * @protected
1323
1298
  */
1324
- constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
1299
+ constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan);
1325
1300
  send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
1326
1301
  send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
1327
1302
  /**
@@ -1405,10 +1380,6 @@ declare const ClientConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
1405
1380
  skipReadyWait: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
1406
1381
  }, z$1.core.$strip>>>;
1407
1382
  getUpgradeWebSocket: z$1.ZodOptional<z$1.ZodCustom<GetUpgradeWebSocket, GetUpgradeWebSocket>>;
1408
- retryBudget: z$1.ZodOptional<z$1.ZodObject<{
1409
- percent: z$1.ZodOptional<z$1.ZodNumber>;
1410
- maxTokens: z$1.ZodOptional<z$1.ZodNumber>;
1411
- }, z$1.core.$strip>>;
1412
1383
  fetch: z$1.ZodOptional<z$1.ZodCustom<typeof fetch, typeof fetch>>;
1413
1384
  disableMetadataLookup: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
1414
1385
  maxInputSize: z$1.ZodDefault<z$1.ZodNumber>;
@@ -1428,10 +1399,6 @@ declare const ClientConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
1428
1399
  devtools: boolean;
1429
1400
  getToken?: GetToken | undefined;
1430
1401
  getUpgradeWebSocket?: GetUpgradeWebSocket | undefined;
1431
- retryBudget?: {
1432
- percent?: number | undefined;
1433
- maxTokens?: number | undefined;
1434
- } | undefined;
1435
1402
  fetch?: typeof fetch | undefined;
1436
1403
  }, {
1437
1404
  endpoint: string;
@@ -1448,10 +1415,6 @@ declare const ClientConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
1448
1415
  devtools: boolean;
1449
1416
  getToken?: GetToken | undefined;
1450
1417
  getUpgradeWebSocket?: GetUpgradeWebSocket | undefined;
1451
- retryBudget?: {
1452
- percent?: number | undefined;
1453
- maxTokens?: number | undefined;
1454
- } | undefined;
1455
1418
  fetch?: typeof fetch | undefined;
1456
1419
  }>>;
1457
1420
  type ClientConfigInput = z$1.input<typeof ClientConfigSchema>;
@@ -1600,8 +1563,6 @@ declare const CREATE_ACTOR_CONN_PROXY: unique symbol;
1600
1563
  interface ClientRawOptions {
1601
1564
  encoding?: Encoding;
1602
1565
  gateway?: ActorGatewayOptions;
1603
- /** Bounds retries of refused requests across every handle of this client. */
1604
- retryBudget?: RetryBudgetOptions;
1605
1566
  }
1606
1567
  /** Runtime-supplied wiring for clients created inside an actor. Set only by the native runtime. */
1607
1568
  interface ActorClientRuntimeOptions {
@@ -1798,13 +1759,6 @@ type CronJobInfo = {
1798
1759
  kind: "every";
1799
1760
  interval: number;
1800
1761
  });
1801
- interface ScheduledFireInfo {
1802
- kind: "at" | "cron" | "every";
1803
- id: string;
1804
- name?: string;
1805
- scheduledAt: number;
1806
- firedAt: number;
1807
- }
1808
1762
  interface CronFire {
1809
1763
  action: string;
1810
1764
  scheduledAt: number;
@@ -1978,8 +1932,6 @@ interface ActorRun {
1978
1932
  runOutsideWorkflowSpan<T>(body: () => T): T;
1979
1933
  }
1980
1934
  type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & {
1981
- /** Present only when a durable schedule or cron invokes this action. */
1982
- readonly scheduledFire?: ScheduledFireInfo;
1983
1935
  conn: Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1984
1936
  };
1985
1937
  type BeforeActionResponseContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
@@ -2406,11 +2358,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2406
2358
  publicEndpoint: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodString>, z$2.ZodTransform<string | undefined, string | undefined>>;
2407
2359
  publicToken: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodString>, z$2.ZodTransform<string | undefined, string | undefined>>;
2408
2360
  }, z$2.core.$strip>>>;
2409
- node: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
2361
+ envoy: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
2410
2362
  poolName: z$2.ZodDefault<z$2.ZodString>;
2411
2363
  version: z$2.ZodDefault<z$2.ZodNumber>;
2412
2364
  totalSlots: z$2.ZodDefault<z$2.ZodNumber>;
2413
- nodeKey: z$2.ZodOptional<z$2.ZodString>;
2365
+ envoyKey: z$2.ZodOptional<z$2.ZodString>;
2414
2366
  }, z$2.core.$strip>>>;
2415
2367
  shutdown: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
2416
2368
  gracePeriodMs: z$2.ZodOptional<z$2.ZodNumber>;
@@ -2421,7 +2373,6 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2421
2373
  backend: "local" | "remote";
2422
2374
  } | undefined;
2423
2375
  endpoint: string | undefined;
2424
- engineSpawn: boolean;
2425
2376
  startServices: boolean;
2426
2377
  namespace: string;
2427
2378
  token: string | undefined;
@@ -2461,11 +2412,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2461
2412
  engineHost: string;
2462
2413
  enginePort: number;
2463
2414
  engineVersion: string;
2464
- node: {
2415
+ envoy: {
2465
2416
  poolName: string;
2466
2417
  version: number;
2467
2418
  totalSlots: number;
2468
- nodeKey?: string | undefined;
2419
+ envoyKey?: string | undefined;
2469
2420
  };
2470
2421
  shutdown: {
2471
2422
  disableSignalHandlers: boolean;
@@ -2522,11 +2473,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2522
2473
  publicEndpoint: string | undefined;
2523
2474
  publicToken: string | undefined;
2524
2475
  };
2525
- node: {
2476
+ envoy: {
2526
2477
  poolName: string;
2527
2478
  version: number;
2528
2479
  totalSlots: number;
2529
- nodeKey?: string | undefined;
2480
+ envoyKey?: string | undefined;
2530
2481
  };
2531
2482
  shutdown: {
2532
2483
  disableSignalHandlers: boolean;