@restatedev/sessions 0.11.1 → 0.12.0

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 (96) hide show
  1. package/README.md +330 -178
  2. package/dist/addon.d.ts +1 -0
  3. package/dist/addon.d.ts.map +1 -1
  4. package/dist/addon.js.map +1 -1
  5. package/dist/calls.d.ts +28 -28
  6. package/dist/calls.d.ts.map +1 -1
  7. package/dist/calls.js +25 -25
  8. package/dist/calls.js.map +1 -1
  9. package/dist/database.d.ts +90 -166
  10. package/dist/database.d.ts.map +1 -1
  11. package/dist/database.js +137 -249
  12. package/dist/database.js.map +1 -1
  13. package/dist/driver.d.ts +129 -126
  14. package/dist/driver.d.ts.map +1 -1
  15. package/dist/driver.js +337 -276
  16. package/dist/driver.js.map +1 -1
  17. package/dist/endpoint.d.ts +47 -5
  18. package/dist/endpoint.d.ts.map +1 -1
  19. package/dist/endpoint.js +175 -60
  20. package/dist/endpoint.js.map +1 -1
  21. package/dist/handler.d.ts +20 -17
  22. package/dist/handler.d.ts.map +1 -1
  23. package/dist/handler.js +161 -127
  24. package/dist/handler.js.map +1 -1
  25. package/dist/host.d.ts +29 -0
  26. package/dist/host.d.ts.map +1 -0
  27. package/dist/host.js +2 -0
  28. package/dist/host.js.map +1 -0
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +5 -26
  32. package/dist/index.js.map +1 -1
  33. package/dist/internal.d.ts +11 -11
  34. package/dist/internal.d.ts.map +1 -1
  35. package/dist/internal.js +20 -16
  36. package/dist/internal.js.map +1 -1
  37. package/dist/link.d.ts +1 -2
  38. package/dist/link.d.ts.map +1 -1
  39. package/dist/link.js +4 -5
  40. package/dist/link.js.map +1 -1
  41. package/dist/log.d.ts +14 -0
  42. package/dist/log.d.ts.map +1 -0
  43. package/dist/log.js +21 -0
  44. package/dist/log.js.map +1 -0
  45. package/dist/object.d.ts +217 -142
  46. package/dist/object.d.ts.map +1 -1
  47. package/dist/object.js +195 -241
  48. package/dist/object.js.map +1 -1
  49. package/dist/platform.d.ts +0 -1
  50. package/dist/platform.d.ts.map +1 -1
  51. package/dist/platform.js +4 -6
  52. package/dist/platform.js.map +1 -1
  53. package/dist/schema.d.ts +14 -22
  54. package/dist/schema.d.ts.map +1 -1
  55. package/dist/schema.js +31 -69
  56. package/dist/schema.js.map +1 -1
  57. package/dist/serve.d.ts +11 -17
  58. package/dist/serve.d.ts.map +1 -1
  59. package/dist/serve.js +21 -39
  60. package/dist/serve.js.map +1 -1
  61. package/dist/session.d.ts +58 -236
  62. package/dist/session.d.ts.map +1 -1
  63. package/dist/session.js +206 -513
  64. package/dist/session.js.map +1 -1
  65. package/dist/stop.d.ts +59 -0
  66. package/dist/stop.d.ts.map +1 -0
  67. package/dist/stop.js +220 -0
  68. package/dist/stop.js.map +1 -0
  69. package/dist/vm.d.ts +108 -29
  70. package/dist/vm.d.ts.map +1 -1
  71. package/dist/vm.js +43 -10
  72. package/dist/vm.js.map +1 -1
  73. package/package.json +4 -4
  74. package/src/addon.ts +1 -0
  75. package/src/calls.ts +51 -47
  76. package/src/database.ts +195 -339
  77. package/src/driver.ts +379 -315
  78. package/src/endpoint.ts +217 -62
  79. package/src/handler.ts +183 -164
  80. package/src/host.ts +28 -0
  81. package/src/index.ts +6 -26
  82. package/src/internal.ts +28 -39
  83. package/src/link.ts +4 -5
  84. package/src/log.ts +42 -0
  85. package/src/object.ts +379 -335
  86. package/src/platform.ts +4 -6
  87. package/src/schema.ts +37 -103
  88. package/src/serve.ts +20 -41
  89. package/src/session.ts +236 -613
  90. package/src/stop.ts +225 -0
  91. package/src/vm.ts +151 -55
  92. package/dist/scope.d.ts +0 -38
  93. package/dist/scope.d.ts.map +0 -1
  94. package/dist/scope.js +0 -55
  95. package/dist/scope.js.map +0 -1
  96. package/src/scope.ts +0 -78
package/dist/session.d.ts CHANGED
@@ -1,119 +1,40 @@
1
1
  import type * as restate from '@restatedev/restate-sdk';
2
- import { type Serde } from '@restatedev/restate-sdk-core';
3
- import { type Row, type Connection, type DatabaseWriter, type SqlParam, type DatabaseReader, type SqlValue, type Store, type Working } from './database.ts';
4
- import type { Vm } from './vm.ts';
2
+ import { type Row, type Connection, type DatabaseWriter, type SqlParam, type DatabaseReader, type SqlValue } from './database.ts';
3
+ import type { AttemptHost } from './host.ts';
5
4
  import { type Schema } from './schema.ts';
6
5
  import { type Send } from './calls.ts';
7
6
  export type { DatabaseReader, DatabaseWriter, Row, SqlParam, SqlValue };
8
- /**
9
- * The session's database, `ctx.db`, for the whole handler: each statement
10
- * outside {@link transaction} is its own transaction. Calls run one at a
11
- * time, in call order.
12
- */
7
+ /** `ctx.db`. Each statement outside {@link transaction} is its own transaction. Calls run in call order. */
13
8
  export interface Database extends DatabaseWriter {
14
9
  /**
15
10
  * Run `body` as one transaction: it commits when `body` resolves, and rolls
16
- * back when it rejects. It holds the database: other calls wait until it
17
- * ends, and a call to the database from inside `body` is refused, as it
18
- * would wait for `body`. So `body` uses the `tx` it gets, which is invalid
19
- * once `body` settles.
11
+ * back when it rejects. Other calls wait until it ends. A call to `ctx.db`
12
+ * from inside `body` is refused, because it would wait for `body`: use the
13
+ * `tx` that `body` gets, which is invalid once `body` settles.
20
14
  */
21
15
  transaction<T>(body: (tx: Transaction) => Promise<T>): Promise<T>;
22
16
  }
23
17
  /** One transaction of a {@link Database}: its SQL, and the sends it commits with. */
24
18
  export interface Transaction extends DatabaseWriter {
25
19
  /**
26
- * Sends made right after the transaction commits, and never if it rolls
27
- * back. Each has the idempotency key it is given, or else one of the
28
- * transaction (`transaction/<id>/<index>`), so a send an attempt makes
29
- * again is dropped.
20
+ * Sends that commit with the transaction, and never if it rolls back: on
21
+ * Restate, in the commit's atomic group, so the rows and the sends are
22
+ * stored together or not at all. A delay counts from the commit.
30
23
  */
31
24
  readonly send: Send;
32
- /**
33
- * Settles, and never rejects, once another call to `ctx.db` waits for this
34
- * transaction to end. A body that keeps the transaction open for more work
35
- * can return when it settles, so that the other call waits for one commit
36
- * and no more.
37
- */
38
- readonly queued: Promise<void>;
39
25
  }
40
- /** What the session needs of the handler's context. */
41
- export interface SqlHost {
42
- /** A shared handler's: it reads beside the exclusive one, and stores nothing. */
43
- readonly shared: boolean;
44
- readonly key: string;
45
- /** Rejects when the attempt ends (suspended, or aborted). */
46
- readonly invocationEndPromise: {
47
- readonly promise: Promise<unknown>;
48
- };
49
- readonly defaultSerde: Serde<any>;
50
- request(): {
51
- readonly id: string;
52
- readonly target: {
53
- readonly service: string;
54
- };
55
- };
56
- get(name: string, serde: Serde<Uint8Array>, options: restate.EntryOptions): PromiseLike<Uint8Array | null>;
57
- set(name: string, value: Uint8Array, serde: Serde<Uint8Array>, options: restate.EntryOptions): void;
58
- clear(name: string, options: restate.EntryOptions): void;
59
- /** The object's state keys. */
60
- stateKeys(): PromiseLike<string[]>;
61
- run(name: string, action: () => void): PromiseLike<void>;
62
- /**
63
- * The attempt's VM, when it has one: the addon then reads and writes the
64
- * object's state as the VM's own commands, and none of it crosses into
65
- * JavaScript (see `openOnVm`).
66
- */
67
- readonly vm?: Vm;
68
- /**
69
- * Whether a cancellation is owed to the handler's next await, taking it:
70
- * the attempt's driver has one when a cancellation arrived that failed
71
- * nothing the handler awaits. Absent where the SDK's context serves the
72
- * attempt, whose own awaits fail with it.
73
- */
74
- readonly takeCancellation?: () => boolean;
75
- /**
76
- * Keeps the attempt alive while a call of the database runs: the VM's
77
- * attempt has it (`driver.ts`), the SDK's context does not.
78
- */
79
- readonly working?: Working;
80
- genericSend(send: restate.GenericSend<Uint8Array>): unknown;
81
- }
82
- /** What a session object gives its attempts: its schema, and a wrapper of its store (fault injection, in tests). */
26
+ /** What a session object gives its attempts. */
83
27
  export interface ObjectConfig {
84
- /** The object's own schema, which each of its databases is made by. */
85
28
  readonly schema?: Schema;
86
- wrapStore?: (store: Store) => Store;
29
+ /** The serde of a typed client's `tx.send` to a handler that declares none: the `serde` option, JSON by default. */
30
+ readonly serde?: restate.Serde<unknown>;
87
31
  }
88
32
  /**
89
- * Have `sql` (one statement, no parameters) run just before the next call of
90
- * the transaction `tx`, in the same crossing of the addon: the statement and
91
- * its order are those of a call made now, and what it spares is the call.
92
- * Its failure is the next call's (or the commit's, if none comes). Returns
93
- * false, queuing nothing, if the transaction cannot (a `tx` of another
94
- * kind, or an addon without it): run the statement with `tx.execute`.
95
- */
96
- export declare function deferSql(tx: Transaction, sql: string): boolean;
97
- /** Take back the last `sql` that {@link deferSql} queued on `tx` and no call has taken: it never runs. Whether it was taken back. */
98
- export declare function undeferSql(tx: Transaction, sql: string): boolean;
99
- /**
100
- * `connection`, opened without the SDK (`open`), as a handler's `ctx.db`:
101
- * for a library's tests, and tools. Its transactions send nothing, and a
102
- * library's schema applies to it (`Schema.ensure`).
33
+ * `connection` (opened without the SDK) as a `ctx.db`, for library tests and
34
+ * tools. Its transactions cannot send. `Schema.ensure` works on it.
103
35
  */
104
36
  export declare function asDatabase(connection: Connection): Database;
105
- /**
106
- * Empty the key's database in `tx`, a transaction of an exclusive handler's
107
- * `ctx.db`: every table, view, index and trigger is dropped, the schemas are
108
- * applied again (the object's, and the libraries' the attempt applied), and
109
- * the outbox stays. It commits with `tx`: what `tx` writes after it are the
110
- * new database's first rows, in the same commit.
111
- */
112
- export declare function reset(tx: Transaction): Promise<void>;
113
- /**
114
- * A database that `opener` opens on its first call, as a handler's `ctx.db`
115
- * opens: for tests, which give each attempt one over the same state.
116
- */
37
+ /** A database that `opener` opens on first use, as `ctx.db` does: for tests. */
117
38
  export declare function lazyDatabase(opener: () => Promise<Database>): Database;
118
39
  /** How a handler ended. */
119
40
  type Outcome<T> = {
@@ -121,191 +42,92 @@ type Outcome<T> = {
121
42
  } | {
122
43
  error: unknown;
123
44
  };
124
- /** A write that rides the next commit of a database, in that commit's transaction. */
125
- type Rider = (tx: Transaction) => Promise<void>;
126
- /**
127
- * Have `write` run in the next transaction of `db` that commits, before its
128
- * commit, rather than commit on its own: for bookkeeping that must be stored
129
- * with the next write, not before it. A write by `db.execute` outside a
130
- * transaction, made while a rider is pending, is that transaction; a read
131
- * (`get`, `values`, `query`) is not, and writes nothing. A transaction that
132
- * rolls back leaves the rider pending, and so does one that ends the handler
133
- * before it commits: {@link flushRiders} writes what is left.
134
- *
135
- * A database has one rider per `slot`: a later one replaces the earlier, and
136
- * `undefined` clears it. A rider registered while a commit that runs the
137
- * earlier one is under way is for the commit after. Returns false, registering
138
- * nothing, for a database that cannot (a view's, another kind of
139
- * `Database`): the caller writes at once.
140
- *
141
- * An `urgent` rider waits only for a transaction that is under way: if none
142
- * is at the end of the macrotask it was registered in (or of the one in which
143
- * a transaction ended and left it pending), it is written in a transaction of
144
- * its own. A transaction that is held open (a batch of commits) is under way,
145
- * and writes it when it commits. A write of its own that fails is not
146
- * retried and raises nothing: the rider stays pending for the next commit or
147
- * {@link flushRiders}. A rider that replaces an urgent one stays urgent.
148
- */
149
- export declare function rideCommit(db: Database, slot: string, write: Rider | undefined, { urgent }?: {
150
- urgent?: boolean;
151
- }): boolean;
152
- /** Write what is pending ({@link rideCommit}) in a transaction of its own: nothing, if nothing is. */
153
- export declare function flushRiders(db: Database): Promise<void>;
154
45
  /**
155
- * The database `name` of the key, apart from the object's own (`ctx.db`, of
156
- * the attempt whose session `db` is): for a library whose tables must be
157
- * alone in their database, such as OpenCode's. It opens on its first use,
158
- * and ends with the attempt, as `ctx.db` does. A name is 1 to 64 letters,
159
- * digits, `_`, `-` or `.`.
46
+ * The key's database `name`, separate from `ctx.db` (`db`): for a library
47
+ * whose tables must be alone. It opens on first use and
48
+ * ends with the attempt. A name is 1 to 64 letters, digits, `_`, `-` or `.`.
160
49
  */
161
50
  export declare function database(db: Database, name: string): Database;
162
51
  /**
163
- * An attempt's SQL session: opened on its first use, or as an exclusive
164
- * attempt starts ({@link openNow}), shared by everything the handler does,
165
- * and saved when the handler ends ({@link end}). With `name`, of the key's
166
- * database `name` ({@link database}), which has neither the object's schema
167
- * nor an outbox.
52
+ * The SQL session of an attempt, shared by everything the handler does. With
53
+ * `name`, it is the key's database `name` ({@link database}), which has no
54
+ * object schema and whose transactions cannot send.
168
55
  */
169
56
  export declare class Attempt {
170
- /** `ctx.db`. */
171
57
  readonly db: Database;
172
- private readonly ctx;
173
- /** Its object's: the key's other databases share its store's wrapper, and have none of its schema. */
58
+ private readonly host;
59
+ private readonly view;
174
60
  private readonly config;
175
61
  private readonly name;
176
- /** Whether it is the object's own database of an exclusive handler: the one with an outbox. */
177
- private readonly hasOutbox;
178
- /** The key's other databases this attempt opened, by name. */
62
+ /** Only the object database of an exclusive handler has transactions that send. */
63
+ private readonly sends;
179
64
  private readonly databases;
180
- /** The session, from its first use on. */
181
65
  private session;
182
- /** The calls made on the session that have not reached its connection yet: see {@link call}. */
66
+ /** Calls that have not reached the connection yet: see {@link callNow}. */
183
67
  private unhanded;
184
- /** The ids of the outbox's transactions this attempt made the sends of. */
185
- private readonly made;
186
- /** The writes that ride the next commit, by slot ({@link rideCommit}). */
187
- private readonly riders;
188
- /** The transactions asked for and not finished: one that is under way writes the riders. */
189
- private active;
190
- /** The macrotask at the end of which an urgent rider is written alone, if one is set. */
191
- private urgentTimer;
192
- /** The schemas this attempt's database has all the steps of. */
68
+ /** Schemas applied in this session. A view applies them only in its session. */
193
69
  private readonly ensured;
194
70
  private ended;
195
- constructor(ctx: SqlHost, config?: ObjectConfig, name?: string);
196
- /** The key's database `name`, in this attempt: see {@link database}. */
71
+ /** {@link end} began: the other databases are ending. */
72
+ private ending;
73
+ constructor(host: AttemptHost, view: boolean, config?: ObjectConfig, name?: string);
74
+ /** See {@link database}. */
197
75
  database(name: string): Database;
198
- /** {@link rideCommit}. */
199
- ride(slot: string, write: Rider | undefined, urgent: boolean): boolean;
200
- /** Have the urgent riders written at the end of this macrotask, if any is pending and none is set. */
201
- private arm;
202
- /** {@link flushRiders}, as a transaction of `db`: its commit writes them. */
203
- flushRiders(): Promise<void>;
204
76
  /**
205
- * `call`, which the handler asked for, unless a cancellation is owed to
206
- * it: then the call fails with the cancellation, and does nothing.
207
- *
208
- * This is where the database delivers a cancellation, and the only place.
209
- * What the handler asks for passes through here; what the session does for
210
- * itself does not — the open, the object's schema, the sends a crashed
211
- * attempt left unmade, emptying the outbox after a commit — and a
212
- * cancellation that failed one of those would be delivered to nobody, or
213
- * would report a transaction as cancelled after it committed. And it is
214
- * before the call issues anything, so a call that fails with
215
- * `CancelledError` wrote nothing and sent nothing: a call already under way
216
- * when the cancellation arrives runs to its end, and the cancellation goes
217
- * to what the handler awaits next.
77
+ * Fail with an owed cancellation before anything runs (see stop.ts). Only
78
+ * handler calls pass here: failing the session's own work (the open, the
79
+ * object's schema, the save) would deliver the cancellation to nobody, or
80
+ * report a committed transaction as cancelled.
218
81
  */
219
82
  private asked;
220
- /** {@link asked} for a call that answers with its value when it is ready ({@link callNow}). */
83
+ /** {@link asked} for a call that may answer synchronously ({@link callNow}). */
221
84
  private askedNow;
222
85
  /**
223
- * Open the session now, as the attempt starts, rather than on its first
224
- * call: the open makes the sends a crashed attempt committed and left
225
- * unmade, which must not wait for a handler that uses the database.
86
+ * Open the object database as an exclusive attempt starts, rather than on
87
+ * its first call: its head is read and the object schema applied while the
88
+ * handler gets going.
226
89
  */
227
90
  openNow(): void;
228
- /**
229
- * The handler ended with `outcome`: the key's other databases end, then
230
- * this one ({@link endSession}).
231
- */
91
+ /** The handler ended with `outcome`. The key's other databases end first, as the handler left them. */
232
92
  end<T>(outcome: Outcome<T>): Promise<T>;
233
93
  /**
234
- * `body` as one transaction. In the object's own database of an exclusive
235
- * handler, its sends commit with it, in the outbox, and are made with its
236
- * commit, right after its writes and before it waits for anything
237
- * (`withCommit`): Restate stores an attempt's commands in order, so they
238
- * are stored only if the commit is, and whatever fails the commit's wait
239
- * (the attempt's end, say) comes after them. A second commit empties the outbox
240
- * before `transaction` resolves: left until the handler's end, they would
241
- * be made again by an attempt that resumes a long wait (an approval), past
242
- * the idempotency retention that drops a repeat.
94
+ * `body` as one transaction. In the object database of an exclusive
95
+ * handler, its sends commit with it (see the block above `PendingSend`).
243
96
  */
244
97
  private transaction;
245
- private transacted;
246
- /**
247
- * Commit with `handle` the outbox as committed, but the sends stored since,
248
- * and with `outgoing`, which the commit makes. Unchanged, it is not
249
- * written again.
250
- */
251
- private commitOutbox;
98
+ /** Have the commit of `handle` make `sends`: in its atomic group on the VM, else through the host. */
99
+ private commitSends;
252
100
  /**
253
- * `call` on the session, opening it on the first; its failure as the
254
- * handler fails with it. The call that fails on a session that a failure
255
- * ended is its last: the next opens another, which reads what is stored.
256
- * So the failure of an open made as the attempt started goes to the first
257
- * call, as it would had that call opened it.
101
+ * Run `call`, opening the session on first use. A call that fails on an
102
+ * ended session retires it, and the next call opens a new one. So a failed
103
+ * open at attempt start fails the first call.
258
104
  */
259
105
  private call;
260
106
  /**
261
- * {@link call} for a call that answers with its value when it is ready: it
262
- * is the value, without a promise, which only this package takes so. That
263
- * is for a session that is open, and with no call before it still to reach
264
- * the connection (a call made before it, which waits for the session, must
265
- * run first): anything else is {@link call}.
107
+ * {@link call} that may return the value synchronously: only for an open
108
+ * session with no earlier call still waiting to reach the connection.
266
109
  */
267
110
  private callNow;
268
- /** The session, opening one if there is none, or the one there is was retired. */
111
+ /** The session, opening a new one if there is none or it was retired. */
269
112
  private current;
270
113
  private open;
271
114
  private start;
272
115
  /**
273
- * End the session, then settle as the handler did: an SQL error that
274
- * escaped it becomes terminal. The handler's error stands: what it
275
- * committed is stored, and an outbox left full is made by the next open.
276
- * A failure to end the session fails a handler that succeeded, which a
277
- * retry then ends (a transaction it left open, say).
116
+ * End the session, then settle as the handler did. The handler's error wins
117
+ * (its commits are stored). A failure to end the session fails a handler
118
+ * that succeeded (for example, one that left a transaction open).
278
119
  */
279
120
  private endSession;
280
121
  /**
281
- * Close the session as the attempt ends. A view's closes: it read the
282
- * snapshot it opened on, and one that outlived 16 commits failed its read
283
- * ("is gone"), which is retried. Another is saved, its outbox emptied. One
284
- * that a failure ended closes, and the object's own database is opened
285
- * again and saved: it may hold sends unmade (a crash left them, and this
286
- * attempt's open failed) or made and not emptied (the commit's wait
287
- * failed), and no attempt may follow this one (a cancelled invocation's),
288
- * nor the key's next invocation come within the idempotency retention.
122
+ * Close the session. A view only closes. Otherwise the session is saved; one
123
+ * that a failure ended closes, and what it committed is stored as it was.
289
124
  */
290
125
  private close;
291
- /** Empty the outbox and save the session, which closes if that fails. */
126
+ /** Save the session. The session closes if that fails. */
292
127
  private save;
293
- /** The object's schema, which the key's other databases have none of. */
128
+ /** The object schema. The key's other databases do not get it. */
294
129
  private ownSchema;
295
- /** Empty the database in the transaction `handle` ({@link reset}), and apply the schemas this attempt applied again. */
296
- private reset;
297
- /** Apply the steps of `schemas` that the database lacks, each schema once per attempt. */
130
+ /** Apply the steps of `schemas` that the database lacks, each schema once per session. */
298
131
  private ensureSchemas;
299
- /** Make the sends of a committed transaction: each with an idempotency key of the transaction (or its own), so that making them again is dropped. */
300
- private make;
301
- /** The outbox as committed, but the transactions this attempt made the sends of: a commit made after them stores them first. */
302
- private unstored;
303
- /**
304
- * Empty the outbox, so that a later open does not make its sends again: a
305
- * commit after them, which stores them first.
306
- */
307
- private flush;
308
132
  }
309
- /** Run `handler`, then end `attempt`'s SQL session, if it opened one (see {@link Attempt.end}). */
310
- export declare function withAttempt<T>(handler: () => Promise<T>, attempt: Attempt): Promise<T>;
311
133
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,OAAO,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAA4B,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAGL,KAAK,GAAG,EAGR,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,KAAK,EAEV,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AACvB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