duron 0.3.0-beta.12 → 0.3.0-beta.14

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/dist/action.d.ts CHANGED
@@ -141,20 +141,217 @@ export interface ConcurrencyHandlerContext<TInput extends z.ZodObject, TVariable
141
141
  input: z.infer<TInput>;
142
142
  var: TVariables;
143
143
  }
144
- export type ActionDefinition<TInput extends z.ZodObject, TOutput extends z.ZodObject, TVariables = Record<string, unknown>> = z.input<ReturnType<typeof createActionDefinitionSchema<TInput, TOutput, TVariables>>>;
145
- export type Action<TInput extends z.ZodObject, TOutput extends z.ZodObject, TVariables = Record<string, unknown>> = z.infer<ReturnType<typeof createActionDefinitionSchema<TInput, TOutput, TVariables>>>;
146
144
  /**
147
145
  * Retry configuration options for actions and steps.
146
+ * Controls how failed operations are retried with exponential backoff.
148
147
  */
148
+ export interface RetryOptionsInput {
149
+ /**
150
+ * Maximum number of retry attempts.
151
+ * Set to 0 to disable retries.
152
+ *
153
+ * @default 4
154
+ */
155
+ limit?: number;
156
+ /**
157
+ * Exponential backoff factor.
158
+ * The delay between retries is calculated as: `minTimeout * (factor ^ attemptNumber)`
159
+ *
160
+ * @default 2
161
+ */
162
+ factor?: number;
163
+ /**
164
+ * Minimum delay in milliseconds before the first retry.
165
+ * This is the base delay that gets multiplied by the factor.
166
+ *
167
+ * @default 1000
168
+ */
169
+ minTimeout?: number;
170
+ /**
171
+ * Maximum delay in milliseconds between retries.
172
+ * The calculated delay will be capped at this value to prevent
173
+ * excessively long wait times.
174
+ *
175
+ * @default 30000
176
+ */
177
+ maxTimeout?: number;
178
+ }
179
+ /**
180
+ * Configuration options for steps within an action.
181
+ * Controls concurrency, retries, and timeouts for step execution.
182
+ */
183
+ export interface StepsConfigInput {
184
+ /**
185
+ * Maximum number of steps that can run concurrently within this action.
186
+ * Higher values allow more parallelism but may increase resource usage.
187
+ *
188
+ * @default 100
189
+ */
190
+ concurrency?: number;
191
+ /**
192
+ * Retry configuration for steps.
193
+ * These settings apply to all steps unless overridden at the step level.
194
+ *
195
+ * @default { limit: 4, factor: 2, minTimeout: 1000, maxTimeout: 30000 }
196
+ */
197
+ retry?: RetryOptionsInput;
198
+ /**
199
+ * Timeout in milliseconds for each step.
200
+ * Steps that exceed this timeout will be cancelled and may be retried.
201
+ *
202
+ * @default 300000 (5 minutes)
203
+ */
204
+ expire?: number;
205
+ }
206
+ /**
207
+ * Group configuration for concurrency control.
208
+ * Allows grouping jobs by key and controlling concurrency per group.
209
+ */
210
+ export interface GroupsConfigInput<TInput extends z.ZodObject, TVariables = Record<string, unknown>> {
211
+ /**
212
+ * Function to determine the group key for a job.
213
+ * Jobs with the same group key will respect the group concurrency limit.
214
+ * Use this to limit concurrent processing of related jobs (e.g., per user, per tenant).
215
+ *
216
+ * If not provided, all jobs for this action will use the '@default' group key.
217
+ *
218
+ * @param ctx - Context containing the validated input and variables
219
+ * @returns Promise resolving to the group key string
220
+ *
221
+ * @example
222
+ * ```typescript
223
+ * groupKey: async (ctx) => `user:${ctx.input.userId}`
224
+ * ```
225
+ */
226
+ groupKey?: (ctx: ConcurrencyHandlerContext<TInput, TVariables>) => Promise<string>;
227
+ /**
228
+ * Function to dynamically determine the concurrency limit for a job's group.
229
+ * The concurrency limit is stored with each job and used during fetch operations.
230
+ * This allows different groups to have different concurrency limits.
231
+ *
232
+ * If not provided, uses the global `groupConcurrencyLimit` from the client options.
233
+ *
234
+ * @param ctx - Context containing the validated input and variables
235
+ * @returns Promise resolving to the concurrency limit number
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * concurrency: async (ctx) => ctx.input.priority === 'high' ? 10 : 2
240
+ * ```
241
+ */
242
+ concurrency?: (ctx: ConcurrencyHandlerContext<TInput, TVariables>) => Promise<number>;
243
+ }
244
+ /**
245
+ * Definition for creating a Duron action.
246
+ * Actions are type-safe, durable job handlers with built-in retry logic,
247
+ * step-based execution, and concurrency control.
248
+ *
249
+ * @template TInput - Zod schema type for validating the action input
250
+ * @template TOutput - Zod schema type for validating the action output
251
+ * @template TVariables - Type of variables available to the action handler
252
+ */
253
+ export interface ActionDefinitionInput<TInput extends z.ZodObject, TOutput extends z.ZodObject, TVariables = Record<string, unknown>> {
254
+ /**
255
+ * Unique name for this action.
256
+ * Used as the queue name and must be unique across all actions registered with a client.
257
+ * This name is used for job routing, logging, and dashboard display.
258
+ *
259
+ * @example 'send-email', 'process-payment', 'sync-user-data'
260
+ */
261
+ name: string;
262
+ /**
263
+ * Optional version string for the action.
264
+ * Used to track changes to the action and included in the checksum calculation.
265
+ * Changing the version will cause existing jobs to be treated as having a different checksum.
266
+ *
267
+ * @example '1.0.0', '2024-01-15', 'v2'
268
+ */
269
+ version?: string;
270
+ /**
271
+ * Zod schema for validating the action input.
272
+ * If provided, input will be validated before the handler is called.
273
+ * Invalid input will throw a validation error and the job will fail.
274
+ *
275
+ * @example
276
+ * ```typescript
277
+ * input: z.object({
278
+ * email: z.string().email(),
279
+ * subject: z.string().min(1),
280
+ * })
281
+ * ```
282
+ */
283
+ input?: TInput;
284
+ /**
285
+ * Zod schema for validating the action output.
286
+ * If provided, output will be validated after the handler completes.
287
+ * Invalid output will cause the job to fail.
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * output: z.object({
292
+ * success: z.boolean(),
293
+ * messageId: z.string().optional(),
294
+ * })
295
+ * ```
296
+ */
297
+ output?: TOutput;
298
+ /**
299
+ * Group configuration for concurrency control.
300
+ * Allows grouping jobs by a dynamic key and controlling concurrency per group.
301
+ * Useful for rate limiting per user, tenant, or resource.
302
+ */
303
+ groups?: GroupsConfigInput<TInput, TVariables>;
304
+ /**
305
+ * Configuration for steps within this action.
306
+ * Steps are retryable units of work that can be executed within the action handler.
307
+ * These settings apply to all steps unless overridden at the step level.
308
+ *
309
+ * @default { concurrency: 100, retry: { limit: 4, factor: 2, minTimeout: 1000, maxTimeout: 30000 }, expire: 300000 }
310
+ */
311
+ steps?: StepsConfigInput;
312
+ /**
313
+ * Maximum number of jobs for this action that can run concurrently across all workers.
314
+ * This limit is enforced per action, regardless of group.
315
+ *
316
+ * @default 100
317
+ */
318
+ concurrency?: number;
319
+ /**
320
+ * Timeout in milliseconds for the entire action.
321
+ * Jobs that exceed this timeout will be cancelled.
322
+ * Make sure this is greater than the expected total execution time including all steps.
323
+ *
324
+ * @default 900000 (15 minutes)
325
+ */
326
+ expire?: number;
327
+ /**
328
+ * The handler function that executes the action logic.
329
+ * Receives a context object with validated input, variables, logger, and step functions.
330
+ * Must return a Promise that resolves to the action output (matching the output schema if provided).
331
+ *
332
+ * @param ctx - Action handler context with input, variables, and step functions
333
+ * @returns Promise resolving to the action output
334
+ *
335
+ * @example
336
+ * ```typescript
337
+ * handler: async (ctx) => {
338
+ * const result = await ctx.step('send', async () => {
339
+ * return await sendEmail(ctx.input.email, ctx.input.subject)
340
+ * })
341
+ * return { success: true, messageId: result.id }
342
+ * }
343
+ * ```
344
+ */
345
+ handler: (ctx: ActionHandlerContext<TInput, TVariables>) => Promise<z.infer<TOutput>>;
346
+ }
347
+ export type ActionDefinition<TInput extends z.ZodObject, TOutput extends z.ZodObject, TVariables = Record<string, unknown>> = ActionDefinitionInput<TInput, TOutput, TVariables>;
348
+ export type Action<TInput extends z.ZodObject, TOutput extends z.ZodObject, TVariables = Record<string, unknown>> = z.infer<ReturnType<typeof createActionDefinitionSchema<TInput, TOutput, TVariables>>>;
149
349
  export declare const RetryOptionsSchema: z.ZodDefault<z.ZodObject<{
150
350
  limit: z.ZodDefault<z.ZodNumber>;
151
351
  factor: z.ZodDefault<z.ZodNumber>;
152
352
  minTimeout: z.ZodDefault<z.ZodNumber>;
153
353
  maxTimeout: z.ZodDefault<z.ZodNumber>;
154
354
  }, z.core.$strip>>;
155
- /**
156
- * Options for configuring a step within an action.
157
- */
158
355
  export declare const StepOptionsSchema: z.ZodObject<{
159
356
  retry: z.ZodDefault<z.ZodObject<{
160
357
  limit: z.ZodDefault<z.ZodNumber>;
@@ -165,14 +362,6 @@ export declare const StepOptionsSchema: z.ZodObject<{
165
362
  expire: z.ZodDefault<z.ZodNumber>;
166
363
  parallel: z.ZodDefault<z.ZodBoolean>;
167
364
  }, z.core.$strip>;
168
- /**
169
- * Creates a Zod schema for validating action definitions.
170
- *
171
- * @template TInput - Zod schema for the action input
172
- * @template TOutput - Zod schema for the action output
173
- * @template TVariables - Type of variables available to the action
174
- * @returns Zod schema for action definitions
175
- */
176
365
  export declare function createActionDefinitionSchema<TInput extends z.ZodObject, TOutput extends z.ZodObject, TVariables = Record<string, unknown>>(): z.ZodPipe<z.ZodObject<{
177
366
  name: z.ZodString;
178
367
  version: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAGzD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACpG,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,UAAU,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,SAAS,EAAE,gBAAgB,CAAA;IAE3B;;;;;;;OAOG;IACH,IAAI,EAAE,CAAC,OAAO,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,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AAO,CAAC,MAAM,CAAC;;IA8B1F;AAED,eAAO,MAAM,YAAY,GAAI,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACvD,MAAM,SAAS,CAAC,CAAC,SAAS,EAAE,OAAO,SAAS,CAAC,CAAC,SAAS,EAC7D,KAAK,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;4EAvCsB,OAAO,CAAC,MAAM,CAAC;+EAKf,OAAO,CAAC,MAAM,CAAC;;CAwC1F,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAC/G,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,EAC3C,kBAAkB,CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACrD,MAAM,SAAS,CAAC,CAAC,SAAS,EAAE,OAAO,EACzC,KAAK,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,KACpD,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAM9C,CAAA"}
package/dist/action.js CHANGED
@@ -1,104 +1,29 @@
1
1
  import * as z from 'zod';
2
2
  import generateChecksum from './utils/checksum.js';
3
- /**
4
- * Retry configuration options for actions and steps.
5
- */
3
+ const _checkActionDef = true;
6
4
  export const RetryOptionsSchema = z
7
5
  .object({
8
- /**
9
- * Maximum number of retry attempts.
10
- *
11
- * @default 4
12
- */
13
6
  limit: z.number().default(4),
14
- /**
15
- * Exponential backoff factor.
16
- * The delay between retries is calculated as: minTimeout * (factor ^ attemptNumber)
17
- *
18
- * @default 2
19
- */
20
7
  factor: z.number().default(2),
21
- /**
22
- * Minimum delay in milliseconds before the first retry.
23
- *
24
- * @default 1000
25
- */
26
8
  minTimeout: z.number().default(1000),
27
- /**
28
- * Maximum delay in milliseconds between retries.
29
- * The calculated delay will be capped at this value.
30
- *
31
- * @default 30000
32
- */
33
9
  maxTimeout: z.number().default(30000),
34
10
  })
35
- .default({ limit: 4, factor: 2, minTimeout: 1000, maxTimeout: 30000 })
36
- .describe('The retry options');
37
- /**
38
- * Options for configuring a step within an action.
39
- */
11
+ .default({ limit: 4, factor: 2, minTimeout: 1000, maxTimeout: 30000 });
40
12
  export const StepOptionsSchema = z.object({
41
- /**
42
- * Retry configuration for this step.
43
- * If not provided, uses the default retry options from the action or Duron instance.
44
- */
45
13
  retry: RetryOptionsSchema,
46
- /**
47
- * Timeout in milliseconds for this step.
48
- * Steps that exceed this timeout will be cancelled.
49
- *
50
- * @default 300000 (5 minutes)
51
- */
52
- expire: z
53
- .number()
54
- .default(5 * 60 * 1000)
55
- .describe('The expire time for the step (milliseconds)'),
56
- /**
57
- * Whether this step runs in parallel with siblings.
58
- * Parallel steps are independent from siblings during time travel.
59
- * When time traveling to a step, completed parallel siblings are preserved.
60
- *
61
- * @default false
62
- */
63
- parallel: z.boolean().default(false).describe('Whether this step runs in parallel (independent from siblings)'),
14
+ expire: z.number().default(5 * 60 * 1000),
15
+ parallel: z.boolean().default(false),
64
16
  });
65
- /**
66
- * Creates a Zod schema for validating action definitions.
67
- *
68
- * @template TInput - Zod schema for the action input
69
- * @template TOutput - Zod schema for the action output
70
- * @template TVariables - Type of variables available to the action
71
- * @returns Zod schema for action definitions
72
- */
73
17
  export function createActionDefinitionSchema() {
74
18
  return z
75
19
  .object({
76
- /**
77
- * Unique name for this action.
78
- * Used as the queue name and must be unique across all actions.
79
- * Required.
80
- */
81
- name: z.string().describe('The name of the action'),
82
- /**
83
- * Version of the action.
84
- * Used to track changes to the action and generate the checksum.
85
- */
86
- version: z.string().describe('The version of the action').optional(),
87
- /**
88
- * Zod schema for validating the action input.
89
- * If provided, input will be validated before the handler is called.
90
- * If not provided, any input will be accepted.
91
- */
20
+ name: z.string(),
21
+ version: z.string().optional(),
92
22
  input: z
93
23
  .custom((val) => {
94
24
  return !val || ('_zod' in val && 'type' in val && val.type === 'object');
95
25
  })
96
26
  .optional(),
97
- /**
98
- * Zod schema for validating the action output.
99
- * If provided, output will be validated after the handler completes.
100
- * If not provided, any output will be accepted.
101
- */
102
27
  output: z
103
28
  .custom((val) => {
104
29
  return !val || ('_zod' in val && 'type' in val && val.type === 'object');
@@ -106,28 +31,11 @@ export function createActionDefinitionSchema() {
106
31
  .optional(),
107
32
  groups: z
108
33
  .object({
109
- /**
110
- * Function to determine the group key for a job.
111
- * Jobs with the same group key will respect the group concurrency limit.
112
- * If not provided, all jobs for this action will use the '@default' group key.
113
- *
114
- * @param ctx - Context containing the input and variables
115
- * @returns Promise resolving to the group key string
116
- */
117
34
  groupKey: z
118
35
  .custom((val) => {
119
36
  return !val || val instanceof Function;
120
37
  })
121
38
  .optional(),
122
- /**
123
- * Function to determine the concurrency limit for a job.
124
- * The concurrency limit is stored with each job and used during fetch operations.
125
- * When fetching jobs, the latest job's concurrency limit is used for each groupKey.
126
- * If not provided, defaults to 10.
127
- *
128
- * @param ctx - Context containing the input and variables
129
- * @returns Promise resolving to the concurrency limit number
130
- */
131
39
  concurrency: z
132
40
  .custom((val) => {
133
41
  return !val || val instanceof Function;
@@ -137,43 +45,20 @@ export function createActionDefinitionSchema() {
137
45
  .optional(),
138
46
  steps: z
139
47
  .object({
140
- /**
141
- * Function to determine the concurrency limit for a step.
142
- * The concurrency limit is stored with each step and used during fetch operations.
143
- * When fetching steps, the latest step's concurrency limit is used for each stepKey.
144
- * If not provided, defaults to 100.
145
- */
146
- concurrency: z.number().default(100).describe('How many steps can run concurrently for this action'),
147
- retry: RetryOptionsSchema.describe('How to retry on failure for the steps of this action'),
148
- expire: z
149
- .number()
150
- .default(5 * 60 * 1000)
151
- .describe('How long a step can run for (milliseconds)'),
48
+ concurrency: z.number().default(100),
49
+ retry: RetryOptionsSchema,
50
+ expire: z.number().default(5 * 60 * 1000),
152
51
  })
153
52
  .default({
154
53
  concurrency: 100,
155
54
  retry: { limit: 4, factor: 2, minTimeout: 1000, maxTimeout: 30000 },
156
55
  expire: 5 * 60 * 1000,
157
56
  }),
158
- concurrency: z.number().default(100).describe('How many jobs can run concurrently for this action'),
159
- expire: z
160
- .number()
161
- .default(15 * 60 * 1000)
162
- .describe('How long a job can run for (milliseconds)'),
163
- /**
164
- * The handler function that executes the action logic.
165
- * Receives a context object with input, variables, and a step function.
166
- * Must return a Promise that resolves to the action output.
167
- * Required.
168
- *
169
- * @param ctx - Action handler context
170
- * @returns Promise resolving to the action output
171
- */
172
- handler: z
173
- .custom((val) => {
57
+ concurrency: z.number().default(100),
58
+ expire: z.number().default(15 * 60 * 1000),
59
+ handler: z.custom((val) => {
174
60
  return val instanceof Function;
175
- })
176
- .describe('The handler for the action'),
61
+ }),
177
62
  })
178
63
  .transform((def) => {
179
64
  const checksum = [def.name, def.version, def.handler.toString()].filter(Boolean).join(':');
@@ -40,7 +40,7 @@ export declare class PostgresBaseAdapter<Database extends DrizzleDatabase, Conne
40
40
  *
41
41
  * @returns Promise resolving to the job ID, or `null` if creation failed
42
42
  */
43
- protected _createJob({ queue, groupKey, input, timeoutMs, checksum, concurrencyLimit }: CreateJobOptions): Promise<string | null>;
43
+ protected _createJob({ queue, groupKey, input, timeoutMs, checksum, concurrencyLimit, concurrencyStepLimit, }: CreateJobOptions): Promise<string | null>;
44
44
  /**
45
45
  * Internal method to mark a job as completed.
46
46
  *
@@ -183,19 +183,28 @@ export declare class PostgresBaseAdapter<Database extends DrizzleDatabase, Conne
183
183
  protected _insertSpans(spans: InsertSpanOptions[]): Promise<number>;
184
184
  /**
185
185
  * Internal method to get spans for a job or step.
186
+ * For step queries, uses a recursive CTE to find all descendant spans.
186
187
  */
187
188
  protected _getSpans(options: GetSpansOptions): Promise<GetSpansResult>;
189
+ /**
190
+ * Get spans for a step using a recursive CTE to traverse the span hierarchy.
191
+ * This returns the step's span and all its descendant spans (children, grandchildren, etc.)
192
+ */
193
+ protected _getStepSpansRecursive(stepId: string, sortField: string, sortOrder: string, _filters?: GetSpansOptions['filters']): Promise<GetSpansResult>;
188
194
  /**
189
195
  * Internal method to delete all spans for a job.
190
196
  */
191
197
  protected _deleteSpans(options: DeleteSpansOptions): Promise<number>;
192
198
  /**
193
- * Build WHERE clause for spans queries.
194
- * When querying by jobId or stepId, we find all spans that share the same trace_id
195
- * as spans with that job/step. This includes spans from external libraries that
199
+ * Build WHERE clause for spans queries (used for job queries only).
200
+ * When querying by jobId, we find all spans that share the same trace_id
201
+ * as spans with that job. This includes spans from external libraries that
196
202
  * don't have the duron.job.id attribute but are part of the same trace.
203
+ *
204
+ * Note: Step queries are handled separately by _getStepSpansRecursive using
205
+ * a recursive CTE to traverse the span hierarchy.
197
206
  */
198
- protected _buildSpansWhereClause(jobId?: string, stepId?: string, filters?: GetSpansOptions['filters']): import("drizzle-orm").SQL<unknown> | undefined;
207
+ protected _buildSpansWhereClause(jobId?: string, _stepId?: string, filters?: GetSpansOptions['filters']): import("drizzle-orm").SQL<unknown> | undefined;
199
208
  /**
200
209
  * Send a PostgreSQL notification.
201
210
  *
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/adapters/postgres/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,qBAAqB,CAAA;AAapE,OAAO,EACL,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YA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