@ewhauser/world-celld 0.3.0 → 0.3.2

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/worker.d.ts CHANGED
@@ -12,7 +12,9 @@ interface DONamespaceLike {
12
12
  interface WorkerEnv {
13
13
  WORKFLOW_DB: DONamespaceLike;
14
14
  WORKFLOW_STREAMS: DONamespaceLike;
15
- WORKFLOW_INDEX: DONamespaceLike;
15
+ WORKFLOW_RUN_CATALOG: DONamespaceLike;
16
+ WORKFLOW_HOOK_TOKENS: DONamespaceLike;
17
+ WORKFLOW_HOOK_IDS: DONamespaceLike;
16
18
  WORKFLOW_QUEUE: DONamespaceLike;
17
19
  WORLD_SECRET?: string;
18
20
  }
@@ -30,6 +32,8 @@ interface CleanupRecord {
30
32
  dueAt: Date;
31
33
  queueShards: number;
32
34
  phase: CleanupPhase;
35
+ /** Optimistic-concurrency token for alarm/RPC work that awaits another cell. */
36
+ generation: number;
33
37
  attempts: number;
34
38
  lastError?: string;
35
39
  lastAttemptAt?: Date;
@@ -45,7 +49,10 @@ interface RunTombstone {
45
49
  completedAt: Date;
46
50
  expiredAt: Date;
47
51
  tombstonedAt: Date;
52
+ /** Final cleanup accounting retained inside the single authoritative record. */
53
+ cleanup: CleanupRecord;
48
54
  }
55
+ type RunLifecycleStatus = 'active' | 'terminal' | 'expired' | 'missing';
49
56
  type RunReadOutcome<T> = {
50
57
  ok: true;
51
58
  value: T;
@@ -55,29 +62,43 @@ type RunReadOutcome<T> = {
55
62
  message: string;
56
63
  tombstone: RunTombstone;
57
64
  };
58
- interface HookIndexReference {
59
- hookId: string;
60
- token: string;
61
- }
62
- interface ExpireRunIndexesRequest {
63
- runId: string;
64
- keys: string[];
65
- hooks: HookIndexReference[];
66
- expiredAt: number;
67
- }
68
65
  interface ExpireRunIndexesResult {
69
66
  deleted: number;
70
67
  }
71
68
  interface ExpireRunStreamsResult {
72
69
  streams: string[];
73
70
  }
71
+ interface FinalizeRunStreamsResult {
72
+ /** Cumulative registry entries removed for this run. */
73
+ deleted: number;
74
+ done: boolean;
75
+ }
74
76
  interface ExpireStreamResult {
77
+ /** True only when this call installed the stream's expiration fence. */
75
78
  deleted: boolean;
79
+ /** Chunk rows removed by this bounded call. */
76
80
  chunks: number;
81
+ /** Payload bytes represented by the removed chunk rows. */
82
+ bytes: number;
83
+ done: boolean;
77
84
  }
78
- interface ExpireQueueRunResult {
85
+ interface QueueExpiryReceipt {
86
+ expiredAt: number;
79
87
  deleted: number;
80
88
  }
89
+ type ExpireQueueRunResult = {
90
+ /** Cumulative messages removed for this run in this queue shard. */
91
+ deleted: number;
92
+ } & ({
93
+ done: false;
94
+ } | {
95
+ done: true;
96
+ /** Durable receipt which the cleanup coordinator must acknowledge. */
97
+ receipt: QueueExpiryReceipt;
98
+ });
99
+ interface AcknowledgeQueueExpiryResult {
100
+ acknowledged: boolean;
101
+ }
81
102
  interface ScheduleCleanupRequest {
82
103
  retentionMs: number;
83
104
  queueShards: number;
@@ -91,17 +112,19 @@ interface ApplyEventRequest {
91
112
  /** Workflow 5 event-log position and preload options. */
92
113
  params?: CreateEventParams;
93
114
  /**
94
- * Current holder of the hook token per the global KV token index
115
+ * Current holder of the hook token per the sharded token-ownership index
95
116
  * (hook_created only). `null` means the token is unclaimed.
96
117
  */
97
118
  tokenHolder?: {
98
119
  runId: string;
99
120
  hookId: string;
100
121
  } | null;
122
+ /** Exact token/ID reservation fenced on ambiguous-delivery resolution. */
123
+ hookClaimId?: string;
101
124
  /** Internal world-celld retention policy captured with the event. */
102
125
  cleanup?: ScheduleCleanupRequest;
103
126
  }
104
- type ApplyEventErrorCode = 'RUN_NOT_FOUND' | 'STEP_NOT_FOUND' | 'HOOK_NOT_FOUND' | 'WAIT_NOT_FOUND' | 'ENTITY_CONFLICT' | 'RUN_EXPIRED' | 'TOO_EARLY' | 'RUN_NOT_SUPPORTED';
127
+ type ApplyEventErrorCode = 'RUN_NOT_FOUND' | 'STEP_NOT_FOUND' | 'HOOK_NOT_FOUND' | 'WAIT_NOT_FOUND' | 'ENTITY_CONFLICT' | 'HOOK_CLAIM_CANCELLED' | 'RUN_EXPIRED' | 'TOO_EARLY' | 'RUN_NOT_SUPPORTED';
105
128
  interface ApplyEventFailure {
106
129
  ok: false;
107
130
  code: ApplyEventErrorCode;
@@ -121,7 +144,7 @@ interface ApplyEventSuccess {
121
144
  wait?: Wait;
122
145
  /** True when a lazy step_started atomically created its step. */
123
146
  stepCreated?: true;
124
- /** Hooks whose tokens must be released from the global KV index. */
147
+ /** Hooks whose token and ID indexes must be released. */
125
148
  releasedHooks: Array<{
126
149
  hookId: string;
127
150
  token: string;
@@ -131,7 +154,7 @@ interface ApplyEventSuccess {
131
154
  workflowName: string;
132
155
  createdAt: Date;
133
156
  };
134
- /** Set when the global KV hook index must be (re)written. */
157
+ /** Set when the sharded hook indexes must be (re)written. */
135
158
  hookToIndex?: Hook;
136
159
  /** All events (ascending), preloaded for run_started responses. */
137
160
  events?: Event[];
@@ -140,9 +163,38 @@ interface ApplyEventSuccess {
140
163
  hasMore?: boolean;
141
164
  /** Server-owned event ceiling advertised on run lifecycle writes. */
142
165
  maxEvents?: number;
166
+ /** Deadline for publishing this authoritative mutation to derivative indexes. */
167
+ indexPublicationExpiresAt?: number;
143
168
  }
144
169
  type ApplyEventOutcome = ApplyEventSuccess | ApplyEventFailure;
145
170
  //#endregion
171
+ //#region src/stream-protocol.d.ts
172
+ type StreamTerminalState = 'open' | 'closed' | 'errored' | 'expired';
173
+ interface StreamErrorData {
174
+ name: string;
175
+ message: string;
176
+ }
177
+ interface StreamWriteResult {
178
+ startIndex: number;
179
+ count: number;
180
+ tailIndex: number;
181
+ }
182
+ interface StreamReadRequest {
183
+ runId: string;
184
+ startIndex: number;
185
+ maxChunks: number;
186
+ maxBytes: number;
187
+ waitMs: number;
188
+ }
189
+ interface StreamReadResult {
190
+ startIndex: number;
191
+ tailIndex: number;
192
+ chunks: Uint8Array[];
193
+ state: StreamTerminalState;
194
+ timedOut: boolean;
195
+ error?: StreamErrorData;
196
+ }
197
+ //#endregion
146
198
  //#region src/queue.d.ts
147
199
  type Pathname = 'flow';
148
200
  /**
@@ -181,6 +233,29 @@ type EnqueueOutcome = {
181
233
  message: string;
182
234
  };
183
235
  //#endregion
236
+ //#region src/indexes.d.ts
237
+ interface IndexListOptions {
238
+ prefix?: string;
239
+ cursor?: string;
240
+ limit?: number;
241
+ reverse?: boolean;
242
+ }
243
+ interface IndexListPage {
244
+ keys: Array<{
245
+ name: string;
246
+ value: string;
247
+ }>;
248
+ list_complete: boolean;
249
+ cursor?: string;
250
+ }
251
+ interface CellIdLike {
252
+ toString(): string;
253
+ }
254
+ interface CellNamespaceLike<T> {
255
+ idFromName(name: string): CellIdLike;
256
+ get(id: CellIdLike): T;
257
+ }
258
+ //#endregion
184
259
  //#region src/config.d.ts
185
260
  interface HookTokenOwner {
186
261
  runId: string;
@@ -203,53 +278,68 @@ declare class DurableObject<TEnv = unknown> {
203
278
  constructor(ctx: DurableObjectState, env: TEnv);
204
279
  }
205
280
  //#endregion
206
- //#region src/worker/durable-objects/IndexDO.d.ts
207
- /**
208
- * Global index cell, replacing the Workers KV namespace world-cloudflare
209
- * uses for run listing and hook token/id lookup.
210
- *
211
- * A single cell (named `index`) serializes every read and write. Hook-token
212
- * reservation, publication, and release use storage transactions so
213
- * concurrent runs cannot both acquire the same token.
214
- *
215
- * The RPC surface matches the storage-layer KVNamespace interface bit-for-bit
216
- * (including MockKVNamespace's pagination contract: cursor = last returned
217
- * key, `list_complete` reflects whether further keys exist), so the vendored
218
- * storage.ts works against it unchanged.
219
- */
220
- declare class IndexDO extends DurableObject {
221
- get(key: string): Promise<string | null>;
222
- put(key: string, value: string): Promise<void>;
223
- /** Publish a derived index only while its owning run is not expired. */
224
- putOwned(runId: string, key: string, value: string): Promise<{
281
+ //#region src/worker/durable-objects/hook-index-shared.d.ts
282
+ interface RunLifecycleStub {
283
+ getLifecycleStatus(): Promise<RunLifecycleStatus>;
284
+ }
285
+ interface HookIndexEnv {
286
+ WORKFLOW_DB?: CellNamespaceLike<RunLifecycleStub>;
287
+ /** Test seam; celld deployments use Date.now(). */
288
+ clock?: () => number;
289
+ }
290
+ //#endregion
291
+ //#region src/worker/durable-objects/HookIdDO.d.ts
292
+ /** Hook-ID ownership and lookup shard; every hook ID has one transaction domain. */
293
+ declare class HookIdDO extends DurableObject<HookIndexEnv> {
294
+ private now;
295
+ get(hookId: string): Promise<string | null>;
296
+ reserve(hookId: string, owner: HookTokenOwner, proposedClaimId: string): Promise<{
297
+ claimed: true;
298
+ claimId: string;
299
+ } | {
300
+ claimed: false;
301
+ holder: HookTokenOwner;
302
+ }>;
303
+ publish(hookId: string, serializedHook: string, owner: HookTokenOwner, claimId?: string): Promise<{
225
304
  stored: boolean;
226
305
  }>;
227
- delete(key: string): Promise<void>;
228
- list(options?: {
229
- prefix?: string;
230
- cursor?: string;
231
- limit?: number;
232
- reverse?: boolean;
233
- }): Promise<{
234
- keys: Array<{
235
- name: string;
236
- }>;
237
- list_complete: boolean;
238
- cursor?: string;
306
+ releaseClaim(hookId: string, owner: HookTokenOwner, claimId: string): Promise<void>;
307
+ releaseBatch(hooks: Array<{
308
+ hookId: string;
309
+ owner: HookTokenOwner;
310
+ }>): Promise<{
311
+ deleted: number;
239
312
  }>;
240
- reserveHookToken(token: string, owner: HookTokenOwner): Promise<{
241
- claimed: boolean;
242
- holder?: HookTokenOwner;
313
+ alarm(): Promise<void>;
314
+ private armAtMost;
315
+ private compactClaims;
316
+ }
317
+ //#endregion
318
+ //#region src/worker/durable-objects/HookTokenDO.d.ts
319
+ /** Token-ownership shard. A token hashes to exactly one shard and transaction domain. */
320
+ declare class HookTokenDO extends DurableObject<HookIndexEnv> {
321
+ private now;
322
+ get(token: string): Promise<string | null>;
323
+ reserve(token: string, owner: HookTokenOwner, proposedClaimId: string): Promise<{
324
+ claimed: true;
325
+ claimId: string;
326
+ } | {
327
+ claimed: false;
328
+ holder: HookTokenOwner;
243
329
  }>;
244
- finalizeHookIndexes(token: string, hookId: string, serializedHook: string, owner: HookTokenOwner): Promise<void>;
245
- releaseHookToken(token: string, owner: HookTokenOwner): Promise<void>;
246
- deleteHookIndexes(token: string, hookId: string, owner: HookTokenOwner): Promise<void>;
247
- /**
248
- * Fence a run and remove all of its known derived indexes atomically.
249
- * Once the fence exists, putOwned() and hook finalization cannot resurrect
250
- * entries from a delayed request.
251
- */
252
- expireRun(request: ExpireRunIndexesRequest): Promise<ExpireRunIndexesResult>;
330
+ finalize(token: string, serializedHook: string, owner: HookTokenOwner, claimId?: string): Promise<{
331
+ stored: boolean;
332
+ }>;
333
+ releaseClaim(token: string, owner: HookTokenOwner, claimId: string): Promise<void>;
334
+ releaseBatch(hooks: Array<{
335
+ token: string;
336
+ owner: HookTokenOwner;
337
+ }>): Promise<{
338
+ deleted: number;
339
+ }>;
340
+ alarm(): Promise<void>;
341
+ private armAtMost;
342
+ private compactClaims;
253
343
  }
254
344
  //#endregion
255
345
  //#region src/worker/durable-objects/QueueDO.d.ts
@@ -265,11 +355,15 @@ declare class IndexDO extends DurableObject {
265
355
  * cfg pinned QueueCellConfig (first-enqueue wins)
266
356
  * msg:<messageId> MessageRow
267
357
  * due:<paddedMs>:<messageId> schedule index -> messageId
268
- * inflight:<messageId> crash-recovery deadline (epoch ms)
358
+ * inflight-deadline:<paddedMs>:<messageId>
359
+ * ordered crash-recovery index -> messageId
269
360
  * key:<idempotencyKey> active dedup claim -> messageId
270
361
  * dlq:<paddedMs>:<messageId> DeadLetterRow
271
362
  * run:<runId>:<messageId> QueueRunReference for retention cleanup
272
- * expired-run:<runId> run fence preventing delayed enqueue
363
+ * expired-run:<runId> cumulative cleanup receipt; compactable only
364
+ * after RunDO acknowledgement
365
+ * expired-run-gc:<paddedMs>:<runId>
366
+ * ordered compaction deadline -> runId
273
367
  *
274
368
  * celld gotchas designed around:
275
369
  * - celld#144 (alarm handlers can overlap): the storage-only claim phase runs
@@ -329,6 +423,7 @@ declare class QueueDO extends DurableObject {
329
423
  }>;
330
424
  purgeDeadLetters(): Promise<{
331
425
  purged: number;
426
+ hasMore: boolean;
332
427
  }>;
333
428
  /**
334
429
  * Recovery hatch for celld's six-failure alarm abandonment: derive the due
@@ -338,67 +433,76 @@ declare class QueueDO extends DurableObject {
338
433
  alarmAt: number | null;
339
434
  }>;
340
435
  /** Fence a run and purge every live, inflight, and dead-letter message it owns. */
341
- expireRun(runId: string, expiredAt: number): Promise<ExpireQueueRunResult>;
436
+ expireRun(runId: string, expiredAt: number, options?: {
437
+ limit?: number;
438
+ }): Promise<ExpireQueueRunResult>;
439
+ /** Acknowledge a final cleanup receipt before making its marker compactable. */
440
+ acknowledgeExpireRun(runId: string, receipt: QueueExpiryReceipt): Promise<AcknowledgeQueueExpiryResult>;
441
+ }
442
+ //#endregion
443
+ //#region src/worker/durable-objects/RunCatalogDO.d.ts
444
+ /** One of a fixed set of run-catalog shards, routed by the stable run ID hash. */
445
+ declare class RunCatalogDO extends DurableObject {
446
+ private now;
447
+ upsertRun(runId: string, keys: string[], serializedMetadata: string, publicationExpiresAt: number): Promise<{
448
+ stored: boolean;
449
+ }>;
450
+ list(options?: IndexListOptions): Promise<IndexListPage>;
451
+ expireRun(runId: string, keys: string[], expiredAt: number): Promise<ExpireRunIndexesResult>;
452
+ alarm(): Promise<void>;
453
+ private armAtMost;
454
+ private compactExpiryFences;
342
455
  }
343
456
  //#endregion
344
457
  //#region src/worker/durable-objects/StreamDO.d.ts
345
458
  /**
346
459
  * Durable Object backing workflow streams.
347
460
  *
348
- * Two roles, selected by the DO name:
349
- * - `stream:<name>`: chunk storage for a single stream. A monotonic
350
- * per-stream counter (maintained transactionally inside the DO) assigns
351
- * each chunk its index; one chunk per storage key.
352
- * - `run-streams:<runId>`: registry of stream names owned by a run,
353
- * powering `listStreamsByRunId`.
461
+ * Stream cells persist binary chunks under monotonic offset keys. Public
462
+ * reads are bounded long polls, and writes append a bounded ordered batch in
463
+ * one storage transaction. Per-run registry cells retain their existing role.
354
464
  */
355
465
  declare class StreamDO extends DurableObject {
466
+ private meta;
467
+ private metaLoad;
468
+ private mutationTail;
469
+ private changeVersion;
470
+ private readonly waiters;
356
471
  private getMeta;
357
472
  private assertOwner;
473
+ private assertWritable;
474
+ private runMutation;
475
+ private wakeReaders;
476
+ private waitForChange;
477
+ private readSnapshot;
478
+ /** Append one bounded binary batch with contiguous indexes. */
479
+ writeChunks(runId: string, chunks: Uint8Array[]): Promise<StreamWriteResult>;
358
480
  /**
359
- * Append a chunk. The index is allocated inside the transaction, so
360
- * concurrent writers can never collide or skip.
361
- */
362
- writeChunk(runId: string, data: Uint8Array): Promise<number>;
363
- /**
364
- * Close the stream (idempotent). Readers observe `done: true` once all
365
- * previously written chunks have been consumed.
481
+ * Return available binary chunks and terminal metadata in one bounded
482
+ * operation, waiting at most waitMs when the requested offset is idle.
366
483
  */
484
+ readChunks(request: StreamReadRequest, signal?: AbortSignal): Promise<StreamReadResult>;
485
+ /** Close idempotently; the first terminal state wins. */
367
486
  closeStream(runId: string): Promise<void>;
368
- /**
369
- * Read up to `limit` chunks starting at `startIndex` (0-based, inclusive).
370
- */
371
- getChunks(params: {
372
- startIndex: number;
373
- limit: number;
374
- }): Promise<{
375
- chunks: Uint8Array[];
376
- /** Whether the stream is closed. */
377
- done: boolean;
378
- /** Index of the last written chunk, -1 when empty. */
379
- tailIndex: number;
380
- }>;
381
- /**
382
- * Lightweight stream metadata: last chunk index and completion flag.
383
- */
384
- getInfo(): Promise<{
385
- tailIndex: number;
386
- done: boolean;
387
- }>;
388
- /**
389
- * Register a stream name against this per-run registry instance.
390
- */
487
+ /** Persist a terminal stream failure and wake every pending reader. */
488
+ failStream(runId: string, error: StreamErrorData | string): Promise<void>;
489
+ /** Register a stream name against this per-run registry instance. */
391
490
  registerStream(runId: string, name: string): Promise<void>;
392
- /**
393
- * List stream names registered against this per-run registry instance.
394
- */
395
491
  listStreams(): Promise<string[]>;
396
492
  /** Fence a run's registry before any stream cells are removed. */
397
- expireRegistry(runId: string, expiredAt: number): Promise<ExpireRunStreamsResult>;
398
- /** Remove the registry payload after every referenced stream was fenced. */
399
- finalizeRegistry(runId: string): Promise<void>;
400
- /** Delete stream payload while leaving a small ownership tombstone. */
401
- expireStream(runId: string, expiredAt: number): Promise<ExpireStreamResult>;
493
+ expireRegistry(runId: string, expiredAt: number, options?: {
494
+ limit?: number;
495
+ }): Promise<ExpireRunStreamsResult>;
496
+ /** Remove completed registry entries in a bounded, retry-safe batch. */
497
+ finalizeRegistry(runId: string, streams: string[]): Promise<FinalizeRunStreamsResult>;
498
+ /**
499
+ * Fence the stream and delete one bounded page. Listing size keys avoids
500
+ * loading payloads, and the transaction makes a crash retry resume safely.
501
+ */
502
+ expireStream(runId: string, expiredAt: number, options?: {
503
+ limit?: number;
504
+ byteLimit?: number;
505
+ }): Promise<ExpireStreamResult>;
402
506
  }
403
507
  //#endregion
404
508
  //#region src/worker/durable-objects/WorkflowRunDO.d.ts
@@ -414,11 +518,27 @@ declare class StreamDO extends DurableObject {
414
518
  */
415
519
  declare class WorkflowRunDO extends DurableObject {
416
520
  private now;
417
- private expiredTombstone;
521
+ private tombstoneFrom;
522
+ private retentionState;
418
523
  private read;
524
+ private readKey;
419
525
  /** Apply an event and capture all retention metadata in the same transaction. */
420
526
  applyEvent(request: ApplyEventRequest): Promise<ApplyEventOutcome>;
527
+ /**
528
+ * Resolve an ambiguous hook-creation RPC in the same serialization domain as
529
+ * applyEvent. If the hook is absent, the exact reservation is durably fenced
530
+ * before the caller releases its token and hook-ID claims.
531
+ */
532
+ resolveHookTokenClaim(request: {
533
+ hookId: string;
534
+ token: string;
535
+ claimId: string;
536
+ }): Promise<{
537
+ committed: boolean;
538
+ }>;
421
539
  getRun(): Promise<RunReadOutcome<WorkflowRun | null>>;
540
+ /** Single authoritative lifecycle answer used after derivative compaction. */
541
+ getLifecycleStatus(): Promise<RunLifecycleStatus>;
422
542
  getStep(stepId: string): Promise<RunReadOutcome<Step | null>>;
423
543
  listSteps(params?: {
424
544
  limit?: number;
@@ -455,10 +575,20 @@ declare class WorkflowRunDO extends DurableObject {
455
575
  rearmCleanup(): Promise<CleanupRecord | null>;
456
576
  alarm(): Promise<void>;
457
577
  private namespace;
578
+ private workflowIndex;
458
579
  private setCleanupPhase;
580
+ private executeScheduledCleanupPage;
459
581
  private executeCleanup;
582
+ private executeTerminalCleanup;
583
+ private deleteTerminalHookPage;
584
+ private deleteTerminalHookMarkerPage;
585
+ private deleteTerminalWaitPage;
586
+ private deleteIndexPage;
587
+ private deleteStreamPage;
588
+ private deleteQueuePage;
460
589
  private deletePayloadBatch;
461
590
  private recordCleanupFailure;
591
+ private recordTerminalCleanupFailure;
462
592
  claimInflight(params: {
463
593
  messageId: string;
464
594
  staleMs: number;
@@ -473,5 +603,5 @@ declare const _default: {
473
603
  fetch(request: Request, env: WorkerEnv): Promise<Response>;
474
604
  };
475
605
  //#endregion
476
- export { IndexDO, QueueDO, StreamDO, type WorkerEnv, WorkflowRunDO, createRouter, _default as default };
606
+ export { HookIdDO, HookTokenDO, QueueDO, RunCatalogDO, StreamDO, type WorkerEnv, WorkflowRunDO, createRouter, _default as default };
477
607
  //# sourceMappingURL=worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.d.ts","names":[],"sources":["../src/worker/router.ts","../src/retention.ts","../src/apply-event.ts","../src/queue.ts","../src/config.ts","../src/worker/do-base.ts","../src/worker/durable-objects/IndexDO.ts","../src/worker/durable-objects/QueueDO.ts","../src/worker/durable-objects/StreamDO.ts","../src/worker/durable-objects/WorkflowRunDO.ts","../src/worker/worker.ts"],"mappings":";;;UAmBiB;EACf,WAAW;IAAiB;;EAC5B,IAAI;IAAM;;;UAGK;EACf,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB;;iBA6Fc,aAAa,KAAK,aAAS,SAClB,YAAU,QAAQ;;;KCpH/B;UAEK;EACf;EACA;EACA;EACA,WAAW;EACX,aAAa;EACb,gBAAgB;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AU;IACd;IACA;IACA;MACE,QAAQ;IAAiB,MAAM;IAAQ;IAAuB;;EAe5D,oBAAoB,QAAQ;;EAK5B,gBAAgB,SAAS,yBAAyB,QAAQ;EAiC1D,WAAW,SAAS,yBAAyB,QAAQ;EAqBrD,gBAAgB,QAAQ;EAWxB,SAAS;UAQP;UAQM;UAkBA;UAwFA;UAkCA;EAgBR,cAAc;IAClB;IACA;MACE;IAAU;;EAgBR,mBAAmB;;;;;EC7gBnB,MAAK,SAAU,SAAO,KAAO,YAAY,QAAQ"}
1
+ {"version":3,"file":"worker.d.ts","names":[],"sources":["../src/worker/router.ts","../src/retention.ts","../src/apply-event.ts","../src/stream-protocol.ts","../src/queue.ts","../src/indexes.ts","../src/config.ts","../src/worker/do-base.ts","../src/worker/durable-objects/hook-index-shared.ts","../src/worker/durable-objects/HookIdDO.ts","../src/worker/durable-objects/HookTokenDO.ts","../src/worker/durable-objects/QueueDO.ts","../src/worker/durable-objects/RunCatalogDO.ts","../src/worker/durable-objects/StreamDO.ts","../src/worker/durable-objects/WorkflowRunDO.ts","../src/worker/worker.ts"],"mappings":";;;UA8CiB;EACf,WAAW;IAAiB;;EAC5B,IAAI;IAAM;;;UAGK;EACf,aAAa;EACb,kBAAkB;EAClB,sBAAsB;EACtB,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB;;iBA8Ic,aAAa,KAAK,aAAS,SAClB,YAAU,QAAQ;;;KClM/B;UAEK;EACf;EACA;EACA;EACA,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,OAAO;EACP;EACA,OAAO;;EAEP;EACA;EACA;EACA,gBAAgB;EAChB,eAAe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA,gBAAgB;EAChB,aAAa;EACb,WAAW;EACX,cAAc;;EAEd,SAAS;;KAGC;KAEA,eAAe;EACrB;EAAU,OAAO;;EACjB;EAAW;EAAqB;EAAiB,WAAW;;UAiCjD;EACf;;UAGe;EACf;;UAGe;;EAEf;EACA;;UAGe;;E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