rivetkit 0.0.0-sqlite-sync-3-0-0-release.14341d0 → 0.0.0-sqlite-query-metrics-v2.f5d3605

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 (137) hide show
  1. package/dist/browser/client.d.ts +59 -99
  2. package/dist/browser/client.js +33 -227
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +2 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/{chunk-AIGW2SKA.js → chunk-3URZ4UV5.js} +2 -2
  7. package/dist/tsup/{chunk-WCVYMFWJ.js → chunk-D4G35VTO.js} +4 -4
  8. package/dist/tsup/{chunk-NE5CUQRN.cjs → chunk-DDS7OOVF.cjs} +179 -360
  9. package/dist/tsup/chunk-DDS7OOVF.cjs.map +1 -0
  10. package/dist/tsup/{chunk-PW6FYEIV.cjs → chunk-DHL2M2E2.cjs} +3 -3
  11. package/dist/tsup/{chunk-PW6FYEIV.cjs.map → chunk-DHL2M2E2.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-X32L7FDD.js → chunk-E2CUROR3.js} +2 -2
  13. package/dist/tsup/{chunk-SLICBKAU.js → chunk-EPRA2TCT.js} +2 -2
  14. package/dist/tsup/{chunk-OX5MX7TO.js → chunk-F7IGTKGM.js} +2 -2
  15. package/dist/tsup/{chunk-XAY2HIZN.cjs → chunk-FYDB45YU.cjs} +10 -10
  16. package/dist/tsup/{chunk-XAY2HIZN.cjs.map → chunk-FYDB45YU.cjs.map} +1 -1
  17. package/dist/tsup/{chunk-WX3JS4XU.cjs → chunk-HO76AEDH.cjs} +3 -3
  18. package/dist/tsup/{chunk-WX3JS4XU.cjs.map → chunk-HO76AEDH.cjs.map} +1 -1
  19. package/dist/tsup/{chunk-A2CF6PFH.js → chunk-JI6GZ2C2.js} +1 -18
  20. package/dist/tsup/chunk-JI6GZ2C2.js.map +1 -0
  21. package/dist/tsup/{chunk-HU4F7H3F.cjs → chunk-JW2WPE6Z.cjs} +4 -4
  22. package/dist/tsup/{chunk-HU4F7H3F.cjs.map → chunk-JW2WPE6Z.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-4H2LT2WB.cjs → chunk-KDT56V3Y.cjs} +11 -10
  24. package/dist/tsup/chunk-KDT56V3Y.cjs.map +1 -0
  25. package/dist/tsup/{chunk-JNJEWQZL.js → chunk-KSP3NXGY.js} +3 -3
  26. package/dist/tsup/{chunk-PSIBTOAR.cjs → chunk-L3Z3W44Q.cjs} +3 -3
  27. package/dist/tsup/{chunk-PSIBTOAR.cjs.map → chunk-L3Z3W44Q.cjs.map} +1 -1
  28. package/dist/tsup/{chunk-RTWH3AX3.cjs → chunk-MYWZCDML.cjs} +2 -19
  29. package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -0
  30. package/dist/tsup/{chunk-2EQ2WCO7.js → chunk-PJ5EXY6F.js} +38 -219
  31. package/dist/tsup/chunk-PJ5EXY6F.js.map +1 -0
  32. package/dist/tsup/{chunk-6WYQ3NJI.cjs → chunk-QR6EAWEC.cjs} +7 -7
  33. package/dist/tsup/{chunk-6WYQ3NJI.cjs.map → chunk-QR6EAWEC.cjs.map} +1 -1
  34. package/dist/tsup/{chunk-6ZJX3KXW.js → chunk-USKGKQZM.js} +11 -10
  35. package/dist/tsup/chunk-USKGKQZM.js.map +1 -0
  36. package/dist/tsup/client/mod.cjs +6 -6
  37. package/dist/tsup/client/mod.d.cts +3 -15
  38. package/dist/tsup/client/mod.d.ts +3 -15
  39. package/dist/tsup/client/mod.js +5 -5
  40. package/dist/tsup/common/log.cjs +2 -2
  41. package/dist/tsup/common/log.js +1 -1
  42. package/dist/tsup/common/websocket.cjs +3 -3
  43. package/dist/tsup/common/websocket.js +2 -2
  44. package/dist/tsup/{config-DK144OAw.d.cts → config-CkmVg2fG.d.cts} +12 -58
  45. package/dist/tsup/{config-B4erdavw.d.ts → config-Cw_BwH_G.d.ts} +12 -58
  46. package/dist/tsup/{config-BfG1qpYz.d.ts → config-D4clT6mq.d.cts} +52 -34
  47. package/dist/tsup/{config-BfG1qpYz.d.cts → config-D4clT6mq.d.ts} +52 -34
  48. package/dist/tsup/{context-Oxi6YWcG.d.ts → context-BYOKTQJi.d.ts} +2 -2
  49. package/dist/tsup/{context-Cvnf3BRe.d.cts → context-_xIcgBnE.d.cts} +2 -2
  50. package/dist/tsup/db/drizzle.cjs +2 -2
  51. package/dist/tsup/db/drizzle.d.cts +1 -1
  52. package/dist/tsup/db/drizzle.d.ts +1 -1
  53. package/dist/tsup/db/drizzle.js +1 -1
  54. package/dist/tsup/db/mod.cjs +3 -3
  55. package/dist/tsup/db/mod.d.cts +2 -2
  56. package/dist/tsup/db/mod.d.ts +2 -2
  57. package/dist/tsup/db/mod.js +2 -2
  58. package/dist/tsup/dynamic/mod.d.cts +2 -2
  59. package/dist/tsup/dynamic/mod.d.ts +2 -2
  60. package/dist/tsup/inspector/mod.cjs +5 -5
  61. package/dist/tsup/inspector/mod.js +4 -4
  62. package/dist/tsup/inspector/workflow.cjs +4 -4
  63. package/dist/tsup/inspector/workflow.js +3 -3
  64. package/dist/tsup/inspector-tab/mod.d.cts +3 -3
  65. package/dist/tsup/inspector-tab/mod.d.ts +3 -3
  66. package/dist/tsup/mod.cjs +203 -554
  67. package/dist/tsup/mod.cjs.map +1 -1
  68. package/dist/tsup/mod.d.cts +4 -4
  69. package/dist/tsup/mod.d.ts +4 -4
  70. package/dist/tsup/mod.js +118 -469
  71. package/dist/tsup/mod.js.map +1 -1
  72. package/dist/tsup/test/mod.cjs +7 -7
  73. package/dist/tsup/test/mod.d.cts +2 -2
  74. package/dist/tsup/test/mod.d.ts +2 -2
  75. package/dist/tsup/test/mod.js +5 -5
  76. package/dist/tsup/unstable/migrations.d.cts +1 -1
  77. package/dist/tsup/unstable/migrations.d.ts +1 -1
  78. package/dist/tsup/utils.cjs +2 -2
  79. package/dist/tsup/utils.js +1 -1
  80. package/dist/tsup/workflow/mod.cjs +17 -17
  81. package/dist/tsup/workflow/mod.cjs.map +1 -1
  82. package/dist/tsup/workflow/mod.d.cts +4 -4
  83. package/dist/tsup/workflow/mod.d.ts +4 -4
  84. package/dist/tsup/workflow/mod.js +5 -5
  85. package/package.json +10 -9
  86. package/src/actor/config.test.ts +78 -0
  87. package/src/actor/keys.test.ts +275 -0
  88. package/src/actor/keys.ts +0 -86
  89. package/src/actor/utils.test.ts +48 -0
  90. package/src/client/actor-conn.ts +24 -136
  91. package/src/client/actor-handle.ts +3 -21
  92. package/src/client/client.ts +0 -6
  93. package/src/client/config.ts +1 -12
  94. package/src/client/lifecycle-errors.ts +1 -29
  95. package/src/client/test.ts +44 -0
  96. package/src/client/token-provider.test.ts +86 -0
  97. package/src/client/utils.ts +2 -13
  98. package/src/common/database/config.ts +52 -46
  99. package/src/common/database/mod.test.ts +364 -0
  100. package/src/common/database/native-database.test.ts +220 -0
  101. package/src/common/database/native-database.ts +27 -247
  102. package/src/common/inline-websocket-adapter.test.ts +51 -0
  103. package/src/common/router.ts +1 -1
  104. package/src/db/drizzle.test.ts +164 -0
  105. package/src/db/mod.ts +1 -0
  106. package/src/engine-api/actors.ts +3 -3
  107. package/src/engine-client/actor-websocket-client.ts +2 -4
  108. package/src/engine-client/api-endpoints.ts +14 -44
  109. package/src/engine-client/mod.ts +2 -2
  110. package/src/registry/config/envoy.ts +1 -1
  111. package/src/registry/config/index.test.ts +25 -0
  112. package/src/registry/config/index.ts +31 -29
  113. package/src/registry/index.ts +21 -66
  114. package/src/registry/napi-runtime.ts +3 -82
  115. package/src/registry/native.ts +52 -184
  116. package/src/registry/run-handler-coordinator.test.ts +252 -0
  117. package/src/registry/runtime.test.ts +124 -0
  118. package/src/registry/runtime.ts +10 -79
  119. package/src/registry/wasm-runtime.ts +3 -94
  120. package/src/unstable/migrations.test.ts +170 -0
  121. package/src/utils/endpoint-parser.test.ts +206 -0
  122. package/src/utils/env-vars.ts +10 -15
  123. package/src/utils.test.ts +34 -0
  124. package/src/workflow/driver.test.ts +62 -0
  125. package/dist/tsup/chunk-2EQ2WCO7.js.map +0 -1
  126. package/dist/tsup/chunk-4H2LT2WB.cjs.map +0 -1
  127. package/dist/tsup/chunk-6ZJX3KXW.js.map +0 -1
  128. package/dist/tsup/chunk-A2CF6PFH.js.map +0 -1
  129. package/dist/tsup/chunk-NE5CUQRN.cjs.map +0 -1
  130. package/dist/tsup/chunk-RTWH3AX3.cjs.map +0 -1
  131. package/src/client/retry-budget.ts +0 -78
  132. /package/dist/tsup/{chunk-AIGW2SKA.js.map → chunk-3URZ4UV5.js.map} +0 -0
  133. /package/dist/tsup/{chunk-WCVYMFWJ.js.map → chunk-D4G35VTO.js.map} +0 -0
  134. /package/dist/tsup/{chunk-X32L7FDD.js.map → chunk-E2CUROR3.js.map} +0 -0
  135. /package/dist/tsup/{chunk-SLICBKAU.js.map → chunk-EPRA2TCT.js.map} +0 -0
  136. /package/dist/tsup/{chunk-OX5MX7TO.js.map → chunk-F7IGTKGM.js.map} +0 -0
  137. /package/dist/tsup/{chunk-JNJEWQZL.js.map → chunk-KSP3NXGY.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 {
@@ -2397,11 +2358,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2397
2358
  publicEndpoint: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodString>, z$2.ZodTransform<string | undefined, string | undefined>>;
2398
2359
  publicToken: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodString>, z$2.ZodTransform<string | undefined, string | undefined>>;
2399
2360
  }, z$2.core.$strip>>>;
2400
- node: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
2361
+ envoy: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
2401
2362
  poolName: z$2.ZodDefault<z$2.ZodString>;
2402
2363
  version: z$2.ZodDefault<z$2.ZodNumber>;
2403
2364
  totalSlots: z$2.ZodDefault<z$2.ZodNumber>;
2404
- nodeKey: z$2.ZodOptional<z$2.ZodString>;
2365
+ envoyKey: z$2.ZodOptional<z$2.ZodString>;
2405
2366
  }, z$2.core.$strip>>>;
2406
2367
  shutdown: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
2407
2368
  gracePeriodMs: z$2.ZodOptional<z$2.ZodNumber>;
@@ -2412,7 +2373,6 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2412
2373
  backend: "local" | "remote";
2413
2374
  } | undefined;
2414
2375
  endpoint: string | undefined;
2415
- engineSpawn: boolean;
2416
2376
  startServices: boolean;
2417
2377
  namespace: string;
2418
2378
  token: string | undefined;
@@ -2452,11 +2412,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2452
2412
  engineHost: string;
2453
2413
  enginePort: number;
2454
2414
  engineVersion: string;
2455
- node: {
2415
+ envoy: {
2456
2416
  poolName: string;
2457
2417
  version: number;
2458
2418
  totalSlots: number;
2459
- nodeKey?: string | undefined;
2419
+ envoyKey?: string | undefined;
2460
2420
  };
2461
2421
  shutdown: {
2462
2422
  disableSignalHandlers: boolean;
@@ -2513,11 +2473,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
2513
2473
  publicEndpoint: string | undefined;
2514
2474
  publicToken: string | undefined;
2515
2475
  };
2516
- node: {
2476
+ envoy: {
2517
2477
  poolName: string;
2518
2478
  version: number;
2519
2479
  totalSlots: number;
2520
- nodeKey?: string | undefined;
2480
+ envoyKey?: string | undefined;
2521
2481
  };
2522
2482
  shutdown: {
2523
2483
  disableSignalHandlers: boolean;