@namzu/sdk 20.3.0 → 21.0.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 (111) hide show
  1. package/CHANGELOG.md +321 -0
  2. package/dist/bridge/sse/mapper.d.ts +19 -0
  3. package/dist/bridge/sse/mapper.d.ts.map +1 -1
  4. package/dist/bridge/sse/mapper.js +9 -1
  5. package/dist/bridge/sse/mapper.js.map +1 -1
  6. package/dist/contracts/schemas.d.ts +10 -10
  7. package/dist/manager/run/persistence.d.ts +26 -0
  8. package/dist/manager/run/persistence.d.ts.map +1 -1
  9. package/dist/manager/run/persistence.js +40 -0
  10. package/dist/manager/run/persistence.js.map +1 -1
  11. package/dist/public-runtime.d.ts +5 -0
  12. package/dist/public-runtime.d.ts.map +1 -1
  13. package/dist/public-runtime.js +21 -0
  14. package/dist/public-runtime.js.map +1 -1
  15. package/dist/run/drain.d.ts +194 -0
  16. package/dist/run/drain.d.ts.map +1 -0
  17. package/dist/run/drain.js +228 -0
  18. package/dist/run/drain.js.map +1 -0
  19. package/dist/run/index.d.ts +2 -0
  20. package/dist/run/index.d.ts.map +1 -1
  21. package/dist/run/index.js +1 -0
  22. package/dist/run/index.js.map +1 -1
  23. package/dist/runtime/query/checkpoint.d.ts +27 -1
  24. package/dist/runtime/query/checkpoint.d.ts.map +1 -1
  25. package/dist/runtime/query/checkpoint.js +34 -4
  26. package/dist/runtime/query/checkpoint.js.map +1 -1
  27. package/dist/runtime/query/events.d.ts +12 -0
  28. package/dist/runtime/query/events.d.ts.map +1 -1
  29. package/dist/runtime/query/events.js +61 -3
  30. package/dist/runtime/query/events.js.map +1 -1
  31. package/dist/runtime/query/index.d.ts +57 -1
  32. package/dist/runtime/query/index.d.ts.map +1 -1
  33. package/dist/runtime/query/index.js +36 -0
  34. package/dist/runtime/query/index.js.map +1 -1
  35. package/dist/runtime/query/resume-run.d.ts +34 -1
  36. package/dist/runtime/query/resume-run.d.ts.map +1 -1
  37. package/dist/runtime/query/resume-run.js +16 -3
  38. package/dist/runtime/query/resume-run.js.map +1 -1
  39. package/dist/store/index.d.ts +2 -2
  40. package/dist/store/index.d.ts.map +1 -1
  41. package/dist/store/index.js +2 -2
  42. package/dist/store/index.js.map +1 -1
  43. package/dist/store/run/checkpoint-disk.d.ts +18 -2
  44. package/dist/store/run/checkpoint-disk.d.ts.map +1 -1
  45. package/dist/store/run/checkpoint-disk.js +50 -5
  46. package/dist/store/run/checkpoint-disk.js.map +1 -1
  47. package/dist/store/run/checkpoint-memory.d.ts +22 -2
  48. package/dist/store/run/checkpoint-memory.d.ts.map +1 -1
  49. package/dist/store/run/checkpoint-memory.js +99 -4
  50. package/dist/store/run/checkpoint-memory.js.map +1 -1
  51. package/dist/store/run/claim-disk.d.ts +130 -0
  52. package/dist/store/run/claim-disk.d.ts.map +1 -0
  53. package/dist/store/run/claim-disk.js +550 -0
  54. package/dist/store/run/claim-disk.js.map +1 -0
  55. package/dist/store/run/conformance.d.ts +159 -0
  56. package/dist/store/run/conformance.d.ts.map +1 -0
  57. package/dist/store/run/conformance.js +451 -0
  58. package/dist/store/run/conformance.js.map +1 -0
  59. package/dist/store/run/disk.d.ts +30 -2
  60. package/dist/store/run/disk.d.ts.map +1 -1
  61. package/dist/store/run/disk.js +101 -0
  62. package/dist/store/run/disk.js.map +1 -1
  63. package/dist/store/run/listing.d.ts +44 -1
  64. package/dist/store/run/listing.d.ts.map +1 -1
  65. package/dist/store/run/listing.js +92 -1
  66. package/dist/store/run/listing.js.map +1 -1
  67. package/dist/store/run/memory.d.ts +5 -4
  68. package/dist/store/run/memory.d.ts.map +1 -1
  69. package/dist/store/run/memory.js +30 -1
  70. package/dist/store/run/memory.js.map +1 -1
  71. package/dist/types/doctor/check.d.ts +28 -2
  72. package/dist/types/doctor/check.d.ts.map +1 -1
  73. package/dist/types/run/checkpoint-store.d.ts +178 -2
  74. package/dist/types/run/checkpoint-store.d.ts.map +1 -1
  75. package/dist/types/run/event-cursor.d.ts +90 -0
  76. package/dist/types/run/event-cursor.d.ts.map +1 -0
  77. package/dist/types/run/event-cursor.js +47 -0
  78. package/dist/types/run/event-cursor.js.map +1 -0
  79. package/dist/types/run/events.d.ts +71 -1
  80. package/dist/types/run/events.d.ts.map +1 -1
  81. package/dist/types/run/events.js.map +1 -1
  82. package/dist/types/run/index.d.ts +1 -0
  83. package/dist/types/run/index.d.ts.map +1 -1
  84. package/dist/types/run/index.js +1 -0
  85. package/dist/types/run/index.js.map +1 -1
  86. package/dist/types/run/store.d.ts +41 -1
  87. package/dist/types/run/store.d.ts.map +1 -1
  88. package/package.json +6 -1
  89. package/src/bridge/sse/mapper.ts +28 -1
  90. package/src/manager/run/persistence.ts +43 -0
  91. package/src/public-runtime.ts +27 -0
  92. package/src/run/drain.ts +393 -0
  93. package/src/run/index.ts +3 -0
  94. package/src/runtime/query/checkpoint.ts +42 -5
  95. package/src/runtime/query/events.ts +68 -4
  96. package/src/runtime/query/index.ts +113 -1
  97. package/src/runtime/query/resume-run.ts +77 -12
  98. package/src/store/index.ts +5 -1
  99. package/src/store/run/checkpoint-disk.ts +70 -5
  100. package/src/store/run/checkpoint-memory.ts +118 -3
  101. package/src/store/run/claim-disk.ts +593 -0
  102. package/src/store/run/conformance.ts +705 -0
  103. package/src/store/run/disk.ts +106 -2
  104. package/src/store/run/listing.ts +116 -1
  105. package/src/store/run/memory.ts +35 -5
  106. package/src/types/doctor/check.ts +28 -2
  107. package/src/types/run/checkpoint-store.ts +189 -2
  108. package/src/types/run/event-cursor.ts +118 -0
  109. package/src/types/run/events.ts +80 -3
  110. package/src/types/run/index.ts +1 -0
  111. package/src/types/run/store.ts +43 -1
@@ -167,6 +167,16 @@ export interface DurableRunEntry extends CheckpointRunScope {
167
167
  readonly latestCheckpointAt: number;
168
168
  /** Absent when the run has never parked. */
169
169
  readonly park?: ParkSummary;
170
+ /**
171
+ * Absent when no process has ever claimed the run.
172
+ *
173
+ * A SIBLING of {@link DurableRunEntry.park}, not a member of
174
+ * {@link ParkState} — see the note on that union. A park is a question put
175
+ * to a human; a claim is a lease held by a process. A run can have both,
176
+ * neither, or either, and the state a queue worker needs most is parked
177
+ * AND unclaimed, which one union cannot say.
178
+ */
179
+ readonly claim?: ClaimSummary;
170
180
  }
171
181
  /**
172
182
  * Which order a listing comes back in.
@@ -198,6 +208,61 @@ export type DurableRunOrder =
198
208
  * instead of a date nobody recorded.
199
209
  */
200
210
  | 'createdAt';
211
+ /**
212
+ * A monotonically increasing number identifying one holding of a run's claim.
213
+ *
214
+ * The load-bearing word is *fencing*. A mutex answers "may I proceed", and a
215
+ * holder that stalls past its lease — a long GC pause, a suspended container,
216
+ * a partitioned network — answers it "yes" and then writes, long after
217
+ * somebody else legitimately took over. A fence answers a different question
218
+ * at the moment of the WRITE: "is the holding I belong to still the current
219
+ * one". Every claim of a run mints a number strictly greater than the last,
220
+ * so a store can reject a write from a superseded holder without knowing
221
+ * anything about processes, clocks or liveness.
222
+ *
223
+ * Not a random token, deliberately: randomness proves identity and cannot
224
+ * establish *order*, and order is the entire mechanism.
225
+ */
226
+ export type ClaimFence = number;
227
+ /** A holding of a run's claim, as issued to the process that took it. */
228
+ export interface RunClaim {
229
+ /** Opaque caller-supplied identity — a worker id, a pod name. Evidence, not authority. */
230
+ readonly holder: string;
231
+ /** See {@link ClaimFence}. Present it on every durable write. */
232
+ readonly fence: ClaimFence;
233
+ /**
234
+ * Absolute epoch ms after which the claim may be taken by somebody else.
235
+ *
236
+ * Absolute rather than a duration for the same reason a park's deadline
237
+ * is: it has to survive the process that set it. A duration plus an
238
+ * in-process timer cannot — the holder is the thing that dies.
239
+ */
240
+ readonly expiresAt: number;
241
+ }
242
+ /** A run's claim as a listing reports it. */
243
+ export interface ClaimSummary {
244
+ readonly holder: string;
245
+ readonly fence: ClaimFence;
246
+ readonly expiresAt: number;
247
+ /**
248
+ * Whether the claim had expired at the instant the listing was taken.
249
+ *
250
+ * A separate field rather than something the caller derives from
251
+ * `expiresAt`, because the caller would derive it against a DIFFERENT
252
+ * clock than the store used, and one page would then disagree with
253
+ * itself about which rows are available.
254
+ */
255
+ readonly expired: boolean;
256
+ }
257
+ /** What a caller asks for when taking a run. */
258
+ export interface ClaimRunOptions {
259
+ /** Who is taking it. Recorded so an operator can see what holds a stuck run. */
260
+ readonly holder: string;
261
+ /** How long the holding is good for, in ms. */
262
+ readonly ttlMs: number;
263
+ /** Clock, for tests and so one operation judges every expiry against one instant. */
264
+ readonly now?: number;
265
+ }
201
266
  /** Filters and paging for {@link CheckpointStore.listDurableRuns}. */
202
267
  export interface ListDurableRunsOptions {
203
268
  /**
@@ -212,6 +277,16 @@ export interface ListDurableRunsOptions {
212
277
  * to include it.
213
278
  */
214
279
  readonly park?: readonly ParkState[];
280
+ /**
281
+ * Keep only runs that are, or are not, currently held by a worker.
282
+ *
283
+ * `false` is the queue-reader's filter: give me the work nobody has. A
284
+ * claim that has expired counts as NOT held, because that is what expiry
285
+ * means and a reader that skipped expired claims would leave a dead
286
+ * worker's runs invisible forever — the exact failure the lease exists to
287
+ * prevent.
288
+ */
289
+ readonly claimed?: boolean;
215
290
  /** Page size. Defaults to 100, clamped to at least 1. */
216
291
  readonly limit?: number;
217
292
  /** Resume token from the previous page's {@link DurableRunPage.cursor}. */
@@ -266,8 +341,23 @@ export interface DurableRunPage {
266
341
  * proceed.
267
342
  */
268
343
  export interface CheckpointStore {
269
- /** Persist one checkpoint. Overwrites an existing checkpoint with the same id. */
270
- writeCheckpoint(scope: CheckpointRunScope, checkpoint: IterationCheckpoint): Promise<void>;
344
+ /**
345
+ * Persist one checkpoint. Overwrites an existing checkpoint with the same id.
346
+ *
347
+ * @param fence the {@link ClaimFence} of the holding this write belongs
348
+ * to, when the run is claimed. A store that supports claims REFUSES a
349
+ * write whose fence is below the run's current one — that refusal is
350
+ * what makes a claim a lease rather than a suggestion, because a holder
351
+ * stalled past its expiry believes it still holds and is wrong only at
352
+ * the moment it writes.
353
+ *
354
+ * Omit it and the write is unfenced, which is exactly today's behaviour
355
+ * and correct for a single-writer deployment. A store MUST NOT start
356
+ * refusing unfenced writes because some other write carried a fence:
357
+ * that would make adding a claim to one worker break every worker that
358
+ * has not adopted it yet.
359
+ */
360
+ writeCheckpoint(scope: CheckpointRunScope, checkpoint: IterationCheckpoint, fence?: ClaimFence): Promise<void>;
271
361
  /** Load a single checkpoint by id. Returns `null` when it does not exist. */
272
362
  readCheckpoint(scope: CheckpointRunScope, checkpointId: CheckpointId): Promise<IterationCheckpoint | null>;
273
363
  /**
@@ -319,5 +409,91 @@ export interface CheckpointStore {
319
409
  * @param options filters and paging. See {@link ListDurableRunsOptions}.
320
410
  */
321
411
  listDurableRuns?(scope: CheckpointListingScope, options?: ListDurableRunsOptions): Promise<DurableRunPage>;
412
+ /**
413
+ * Take exclusive working possession of a run, or report that somebody
414
+ * else has it. OPTIONAL — see the optional-capability rule on this
415
+ * interface.
416
+ *
417
+ * Returns the holding on success and `null` when the run is currently
418
+ * held by somebody else. `null` is not an error: "another worker got
419
+ * there first" is the ordinary outcome of a queue with more than one
420
+ * reader, and a thrown exception would make the normal case look like a
421
+ * fault.
422
+ *
423
+ * ### What it is for
424
+ *
425
+ * Putting parked runs on a queue and letting more than one worker drain
426
+ * it. Without this, two workers restore the same checkpoint, both execute
427
+ * the run's tools, and both write checkpoints under one run id — each
428
+ * write minting a fresh checkpoint id, so two divergent chains land in
429
+ * one list and the pending lookup returns whichever wrote last. Half the
430
+ * work vanishes and nothing reports an error.
431
+ *
432
+ * ### The lease, and why it expires
433
+ *
434
+ * A claim is a LEASE, not a lock. A lock held by a process that dies is
435
+ * held forever, and the runs behind it are unreachable by anything except
436
+ * a human with a shell. The expiry is what makes a dead holder's work
437
+ * recoverable without one.
438
+ *
439
+ * The expiry is also why a fence exists. A holder does not know it has
440
+ * expired — a long pause, a suspended container and a partition all look
441
+ * from the inside like time not passing — so it wakes and writes as
442
+ * though it still holds. Liveness cannot be checked from here. What CAN
443
+ * be checked, at the write, is whether the holding that write belongs to
444
+ * is still the current one, and that is a comparison of two numbers.
445
+ *
446
+ * ### Reclaiming
447
+ *
448
+ * Calling this on a run whose claim has expired SUCCEEDS and mints a
449
+ * fence strictly greater than the expired holding's. The previous holder
450
+ * is not notified — it cannot be, that is the premise — it simply stops
451
+ * being able to write.
452
+ *
453
+ * Calling it again as the CURRENT holder also succeeds and extends the
454
+ * lease, minting a new fence. Renewal and reclamation are the same
455
+ * operation from the store's side, which is why there is no separate
456
+ * `renew`: two code paths that must agree about who holds a run is one
457
+ * more than can be kept correct.
458
+ *
459
+ * ### What a backend implementing this MUST guarantee
460
+ *
461
+ * These are the properties the fence comparison depends on. None of them
462
+ * is checkable from here, and every one of them was violated by the first
463
+ * built-in implementation, so they are written down rather than assumed:
464
+ *
465
+ * 1. **A fence exceeds every fence ever issued for the run** — including
466
+ * across a release, and across deletion of whatever recorded it. A
467
+ * counter that rewinds re-issues a number a stalled worker still
468
+ * believes it holds, and that worker's writes become legal again.
469
+ * 2. **Fences are unique.** The write check is `fence < current`, so two
470
+ * holders at one number are both admitted. Equality is permissive
471
+ * here, which makes a duplicate worse than a gap.
472
+ * 3. **The fence check is atomic with the write.** Reading the current
473
+ * fence and then writing is check-then-act, and the gap is a race. A
474
+ * database gets this free (`UPDATE … WHERE fence >= ?`); a filesystem
475
+ * does not, and the built-in disk store narrows rather than closes it.
476
+ * 4. **`holder` is unique per process.** It is evidence rather than
477
+ * authority, but it is the only thing distinguishing a RENEWAL from a
478
+ * theft — two workers sharing a holder string take a live, unexpired
479
+ * claim from each other instantly. Use something per-process, not a
480
+ * per-deployment name.
481
+ */
482
+ claimRun?(scope: CheckpointRunScope, options: ClaimRunOptions): Promise<RunClaim | null>;
483
+ /**
484
+ * Give a claim up early. Idempotent: releasing a claim that already
485
+ * expired, was superseded, or never existed succeeds as a no-op.
486
+ *
487
+ * Presenting a stale fence releases NOTHING — a worker that stalled past
488
+ * its lease must not be able to hand away a run somebody else is now
489
+ * holding, and that is the same fencing comparison the write path makes.
490
+ *
491
+ * Optional to call, not optional to matter: a worker that finishes and
492
+ * releases returns the run to the queue immediately, where one that just
493
+ * exits leaves it stuck until the lease expires. That is a latency
494
+ * difference, never a correctness one, which is the property that lets a
495
+ * crashed worker be indistinguishable from a slow one.
496
+ */
497
+ releaseRun?(scope: CheckpointRunScope, fence: ClaimFence): Promise<void>;
322
498
  }
323
499
  //# sourceMappingURL=checkpoint-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint-store.d.ts","sourceRoot":"","sources":["../../../src/types/run/checkpoint-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IAClC,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAA;IAClB,gDAAgD;IAChD,SAAS,EAAE,SAAS,CAAA;IACpB,wCAAwC;IACxC,SAAS,EAAE,SAAS,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,KAAK,CAAA;IACZ;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,sBAAsB;IACtC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAA;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAC9B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS;AACpB,mFAAmF;AACjF,aAAa;AACf,8EAA8E;GAC5E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xE,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,eAAe,CAAC,CACf,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,cAAc,CAAC,CAAA;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqEG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IAExF;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACxE"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Where a reconnecting consumer left off, and whether the kernel can honour it.
3
+ *
4
+ * The shortfall is a VALUE here, not a sentence in a document. A consumer that
5
+ * asks for everything after sequence 400 and silently receives a splice from a
6
+ * different generation of the run is wrong and has no way to find out; a
7
+ * consumer handed `{ status: 'unavailable', reason: 'cursor_ahead' }` re-derives
8
+ * from the transcript and is right. That is refuse-do-not-degrade applied to a
9
+ * subscription rather than to a capability.
10
+ */
11
+ import type { ClaimFence } from './checkpoint-store.js';
12
+ import type { PersistedRunEvent } from './events.js';
13
+ /** What a consumer holds when it comes back. */
14
+ export interface RunEventCursor {
15
+ /**
16
+ * The last `seq` the consumer actually received, from the envelope. Zero —
17
+ * or the field absent — means "from the beginning".
18
+ */
19
+ readonly sinceSeq: number;
20
+ /**
21
+ * The `generation` carried on the events the consumer received, when they
22
+ * carried one.
23
+ *
24
+ * Compared for equality only. Absent on both sides is not a match and not a
25
+ * mismatch: it is an unfenced run, where the sequence is the only evidence
26
+ * available and the log persisting is the assumption.
27
+ */
28
+ readonly generation?: ClaimFence;
29
+ }
30
+ /** Why a cursor could not be honoured. */
31
+ export type RunEventReplayRefusal =
32
+ /**
33
+ * The consumer claims to have seen more than the log holds.
34
+ *
35
+ * The ordinary cause is not a lying client: it is a log that did not
36
+ * survive. An in-memory run store on a restarted process seeds at zero
37
+ * while the consumer still holds 400, and this is the verdict that says so
38
+ * instead of reporting a serene "you are up to date".
39
+ */
40
+ 'cursor_ahead'
41
+ /**
42
+ * The run has been taken over since. The consumer's sequence numbers were
43
+ * minted under an older claim and address a different sequence space, so
44
+ * they are not comparable — not merely stale.
45
+ */
46
+ | 'generation_changed'
47
+ /**
48
+ * The store answered, and its oldest available event is above the one after
49
+ * the cursor. A pruning or windowed backend, caught at the boundary rather
50
+ * than delivered as a continuous stream with a hole in it.
51
+ */
52
+ | 'gap';
53
+ /** What came of a cursor. */
54
+ export type RunEventReplay =
55
+ /** The cursor is already at the log's head. Nothing was missed. */
56
+ {
57
+ readonly status: 'complete';
58
+ }
59
+ /** Contiguous from `sinceSeq + 1`, oldest first. */
60
+ | {
61
+ readonly status: 'replayed';
62
+ readonly events: readonly PersistedRunEvent[];
63
+ }
64
+ /** Nothing is delivered. The consumer re-derives from the transcript. */
65
+ | {
66
+ readonly status: 'unavailable';
67
+ readonly reason: RunEventReplayRefusal;
68
+ };
69
+ /** The log's present state, as the store reports it. */
70
+ export interface RunEventLogHead {
71
+ /** Highest sequence in the log; zero when it is empty. */
72
+ readonly lastSeq: number;
73
+ /** The fence the run is being written under, when it holds a claim. */
74
+ readonly generation?: ClaimFence;
75
+ }
76
+ /**
77
+ * Decide what a cursor is owed, given what the log holds.
78
+ *
79
+ * Pure, and ordered deliberately: a takeover invalidates the sequence space, so
80
+ * comparing sequences across generations would be arithmetic on two different
81
+ * scales. The generation check therefore runs FIRST, before the numbers are
82
+ * allowed to mean anything.
83
+ *
84
+ * `events` is what the store returned for `{ sinceSeq: cursor.sinceSeq }`. It is
85
+ * passed in rather than fetched here so this stays a function of its arguments
86
+ * — the property "no gap, no duplicate" is decidable from the three inputs, and
87
+ * a test can drive every branch without a store.
88
+ */
89
+ export declare function resolveRunEventReplay(cursor: RunEventCursor, head: RunEventLogHead, events: readonly PersistedRunEvent[]): RunEventReplay;
90
+ //# sourceMappingURL=event-cursor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-cursor.d.ts","sourceRoot":"","sources":["../../../src/types/run/event-cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAA;CAChC;AAED,0CAA0C;AAC1C,MAAM,MAAM,qBAAqB;AAChC;;;;;;;GAOG;AACD,cAAc;AAChB;;;;GAIG;GACD,oBAAoB;AACtB;;;;GAIG;GACD,KAAK,CAAA;AAER,6BAA6B;AAC7B,MAAM,MAAM,cAAc;AACzB,mEAAmE;AACjE;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAAE;AACjC,oDAAoD;GAClD;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE;AAChF,yEAAyE;GACvE;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,CAAA;AAE7E,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,uEAAuE;IACvE,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAA;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,SAAS,iBAAiB,EAAE,GAClC,cAAc,CA2BhB"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Where a reconnecting consumer left off, and whether the kernel can honour it.
3
+ *
4
+ * The shortfall is a VALUE here, not a sentence in a document. A consumer that
5
+ * asks for everything after sequence 400 and silently receives a splice from a
6
+ * different generation of the run is wrong and has no way to find out; a
7
+ * consumer handed `{ status: 'unavailable', reason: 'cursor_ahead' }` re-derives
8
+ * from the transcript and is right. That is refuse-do-not-degrade applied to a
9
+ * subscription rather than to a capability.
10
+ */
11
+ /**
12
+ * Decide what a cursor is owed, given what the log holds.
13
+ *
14
+ * Pure, and ordered deliberately: a takeover invalidates the sequence space, so
15
+ * comparing sequences across generations would be arithmetic on two different
16
+ * scales. The generation check therefore runs FIRST, before the numbers are
17
+ * allowed to mean anything.
18
+ *
19
+ * `events` is what the store returned for `{ sinceSeq: cursor.sinceSeq }`. It is
20
+ * passed in rather than fetched here so this stays a function of its arguments
21
+ * — the property "no gap, no duplicate" is decidable from the three inputs, and
22
+ * a test can drive every branch without a store.
23
+ */
24
+ export function resolveRunEventReplay(cursor, head, events) {
25
+ // Both sides must carry one for a mismatch to mean anything. An unfenced run
26
+ // has no generation to disagree with, and treating "absent" as a distinct
27
+ // value would refuse every run that never took a claim — which is most of
28
+ // them.
29
+ if (cursor.generation !== undefined &&
30
+ head.generation !== undefined &&
31
+ cursor.generation !== head.generation) {
32
+ return { status: 'unavailable', reason: 'generation_changed' };
33
+ }
34
+ if (cursor.sinceSeq > head.lastSeq) {
35
+ return { status: 'unavailable', reason: 'cursor_ahead' };
36
+ }
37
+ if (cursor.sinceSeq === head.lastSeq)
38
+ return { status: 'complete' };
39
+ // The log says there is something above the cursor, so an empty answer is
40
+ // the store contradicting its own head rather than "nothing to send".
41
+ const first = events[0];
42
+ if (!first || first.seq !== cursor.sinceSeq + 1) {
43
+ return { status: 'unavailable', reason: 'gap' };
44
+ }
45
+ return { status: 'replayed', events };
46
+ }
47
+ //# sourceMappingURL=event-cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-cursor.js","sourceRoot":"","sources":["../../../src/types/run/event-cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgEH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACpC,MAAsB,EACtB,IAAqB,EACrB,MAAoC;IAEpC,6EAA6E;IAC7E,0EAA0E;IAC1E,0EAA0E;IAC1E,QAAQ;IACR,IACC,MAAM,CAAC,UAAU,KAAK,SAAS;QAC/B,IAAI,CAAC,UAAU,KAAK,SAAS;QAC7B,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,EACpC,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC/D,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACpC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;IACzD,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;IAEnE,0EAA0E;IAC1E,sEAAsE;IACtE,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IACvB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;IAChD,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;AACtC,CAAC"}
@@ -6,6 +6,7 @@ import type { ActivityId, MessageId, PlanId, PluginId, RunId, SandboxId, TaskId,
6
6
  import type { PlanStep } from '../plan/index.js';
7
7
  import type { PluginHookEvent, PluginHookResult } from '../plugin/index.js';
8
8
  import type { TaskStatus } from '../task/index.js';
9
+ import type { ClaimFence } from './checkpoint-store.js';
9
10
  import type { Lineage } from './lineage.js';
10
11
  import type { MessageStopReason, StopReason } from './stop-reason.js';
11
12
  import type { SubsessionIdledEvent, SubsessionMessagedEvent, SubsessionSpawnedEvent } from './subsession-events.js';
@@ -28,6 +29,57 @@ interface RunEventEnvelope {
28
29
  */
29
30
  schemaVersion?: 3;
30
31
  lineage?: Lineage;
32
+ /**
33
+ * This event's position in its OWN run's durable event log, from 1.
34
+ *
35
+ * **Present means recorded.** The emitter takes a candidate number, appends
36
+ * the event stamped with it, and only then advances the counter and hands
37
+ * the event to the live stream — so a `seq` a consumer can see is a `seq`
38
+ * the log contains. That is what makes it usable as a cursor: reconnect,
39
+ * ask for everything above it, and nothing is missed and nothing arrives
40
+ * twice.
41
+ *
42
+ * **Absent means not recoverable**, and three different things arrive that
43
+ * way:
44
+ *
45
+ * - the high-frequency events {@link isEphemeralEvent} names, which are
46
+ * deliberately never persisted;
47
+ * - an event whose durable write FAILED — it still reaches the live
48
+ * stream, unstamped, because losing the news of a failure is worse than
49
+ * delivering it without a cursor;
50
+ * - the delegation lifecycle events (`agent_pending`, `agent_completed`,
51
+ * `agent_failed`, `agent_canceled` and the three sub-session variants),
52
+ * which the agent manager hands straight to a host's listener without
53
+ * passing through the run's event translator at all. They are not in any
54
+ * run's log, and the missing `seq` is how a consumer learns that rather
55
+ * than discovering it after a reconnect.
56
+ *
57
+ * **Per run, not per stream.** A parent's listener also receives its
58
+ * children's events, each numbered in its own run's log, so a consumer
59
+ * keeps one cursor per `runId`. The SSE mapper carries the pair as
60
+ * `<runId>:<seq>` for exactly this reason.
61
+ *
62
+ * Monotonic under a single writer. The run store takes no claim fence
63
+ * today (see `QueryParams.claimFence`), so two workers that both took one
64
+ * run can both append — `generation` is what makes that detectable.
65
+ */
66
+ seq?: number;
67
+ /**
68
+ * The claim fence the run was being written under, when it holds a claim.
69
+ *
70
+ * A sequence alone lies across a takeover: a client at seq 400 reconnects
71
+ * to a run whose store lost its log, the new writer starts at 1, and the
72
+ * client's cursor silently addresses a different sequence space. The fence
73
+ * is already the arbiter of who may write and it only increases, so
74
+ * carrying it here makes a takeover ORDERED rather than merely
75
+ * distinguishable.
76
+ *
77
+ * Absent when the run was written unfenced, which is every run that took no
78
+ * claim. A cursor then relies on the log persisting — the disk store's
79
+ * does, an in-memory store's does not, and `cursor_ahead` is the verdict
80
+ * that catches the difference.
81
+ */
82
+ generation?: ClaimFence;
31
83
  }
32
84
  type CoreRunEvent = {
33
85
  type: 'run_started';
@@ -648,7 +700,25 @@ type CoreRunEvent = {
648
700
  * (`subsession_spawned`, `subsession_messaged`, `subsession_idled`) carry a
649
701
  * required `lineage` — see session-hierarchy.md §10.4.
650
702
  */
651
- export type RunEvent = (CoreRunEvent & RunEventEnvelope) | SubsessionSpawnedEvent | SubsessionMessagedEvent | SubsessionIdledEvent;
703
+ export type RunEvent = (CoreRunEvent & RunEventEnvelope) | (SubsessionSpawnedEvent & RunEventEnvelope) | (SubsessionMessagedEvent & RunEventEnvelope) | (SubsessionIdledEvent & RunEventEnvelope);
652
704
  export type RunEventListener = (event: RunEvent) => void | Promise<void>;
705
+ /**
706
+ * A run event as the durable log gives it back.
707
+ *
708
+ * `seq` and `timestamp` are REQUIRED here and optional on the live envelope,
709
+ * which is the whole difference between the two types: a recorded event has a
710
+ * position and a moment, and a live one may be neither recorded nor
711
+ * recoverable.
712
+ *
713
+ * `timestamp` is not new — both store implementations have always stamped it
714
+ * on write. It was simply never declared anywhere, so the field was persisted
715
+ * by two writers, typed by neither, and read by nobody. Declaring it is what
716
+ * lets the read-back stop casting.
717
+ */
718
+ export type PersistedRunEvent = RunEvent & {
719
+ readonly seq: number;
720
+ /** Epoch ms at which the store recorded the event. */
721
+ readonly timestamp: number;
722
+ };
653
723
  export declare function isEphemeralEvent(event: RunEvent): boolean;
654
724
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/types/run/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,KAAK,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,KAAK,EACX,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,wBAAwB,CAAA;AAE/B,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAErE;;;;;;;;GAQG;AACH,UAAU,gBAAgB;IACzB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAA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
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/types/run/events.ts"],"names":[],"mappings":"AA+qBA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,qBAAqB,GAAkC,IAAI,GAAG,CAAmB;IACtF,YAAY;IACZ,kBAAkB;IAClB,mEAAmE;IACnE,6CAA6C;IAC7C,iBAAiB;IACjB,sEAAsE;IACtE,uEAAuE;IACvE,oCAAoC;IACpC,eAAe;CACf,CAAC,CAAA;AAEF,MAAM,UAAU,gBAAgB,CAAC,KAAe;IAC/C,OAAO,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC7C,CAAC"}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/types/run/events.ts"],"names":[],"mappings":"AA4vBA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,qBAAqB,GAAkC,IAAI,GAAG,CAAmB;IACtF,YAAY;IACZ,kBAAkB;IAClB,mEAAmE;IACnE,6CAA6C;IAC7C,iBAAiB;IACjB,sEAAsE;IACtE,uEAAuE;IACvE,oCAAoC;IACpC,eAAe;CACf,CAAC,CAAA;AAEF,MAAM,UAAU,gBAAgB,CAAC,KAAe;IAC/C,OAAO,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC7C,CAAC"}
@@ -4,6 +4,7 @@ export * from './stop-reason.js';
4
4
  export * from './config.js';
5
5
  export * from './checkpoint-store.js';
6
6
  export * from './store.js';
7
+ export * from './event-cursor.js';
7
8
  export * from './entity.js';
8
9
  export * from './replay.js';
9
10
  export * from './status.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/run/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,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,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAChE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACzF,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA"}
@@ -4,6 +4,7 @@ export * from './stop-reason.js';
4
4
  export * from './config.js';
5
5
  export * from './checkpoint-store.js';
6
6
  export * from './store.js';
7
+ export * from './event-cursor.js';
7
8
  export * from './entity.js';
8
9
  export * from './replay.js';
9
10
  // Domain `RunStatus` (session-hierarchy.md §4.6 state machine). Safe to
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/run/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,wEAAwE;AACxE,4EAA4E;AAC5E,0EAA0E;AAC1E,sBAAsB;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAQ1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/run/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,wEAAwE;AACxE,4EAA4E;AAC5E,0EAA0E;AAC1E,sBAAsB;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAQ1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -27,7 +27,18 @@
27
27
  * re-keyed per call, it happens once, deliberately, as its own change.
28
28
  */
29
29
  import type { Run } from './entity.js';
30
- import type { RunEvent } from './events.js';
30
+ import type { PersistedRunEvent, RunEvent } from './events.js';
31
+ /** What a caller asks the log for. See {@link RunStore.readEvents}. */
32
+ export interface ReadRunEventsOptions {
33
+ /**
34
+ * Return only events ABOVE this sequence — strictly greater, never equal.
35
+ *
36
+ * The exclusive boundary is what makes a cursor round-trip: a consumer that
37
+ * last saw `seq: 12` passes 12 and receives 13 onward, so nothing is
38
+ * delivered twice. Absent means the whole log.
39
+ */
40
+ readonly sinceSeq?: number;
41
+ }
31
42
  /**
32
43
  * One finished tool call, recovered from the run's own transcript.
33
44
  *
@@ -64,6 +75,35 @@ export interface RunStore {
64
75
  * the backend, so a store must not re-filter.
65
76
  */
66
77
  appendEvent(event: RunEvent): Promise<void>;
78
+ /**
79
+ * Read the run's durable event log back, oldest first.
80
+ *
81
+ * Required, unlike {@link RunStore.addToIndex}, and the asymmetry is the
82
+ * point: a store that records a transcript it cannot read back is
83
+ * write-only evidence, which is the defect the whole contract exists to
84
+ * fix one level up. It is also what a reconnecting consumer catches up
85
+ * through — "refresh the page and keep watching the answer arrive" is this
86
+ * method plus a cursor and nothing else.
87
+ *
88
+ * Three obligations, each of which a consumer relies on:
89
+ *
90
+ * 1. **Ascending by `seq`, in the order the events were appended.** Do not
91
+ * sort a log back into order — a log that needs sorting was written by
92
+ * two processes, and hiding that produces a plausible transcript of a
93
+ * run that never happened.
94
+ * 2. **`sinceSeq` is exclusive.** See {@link ReadRunEventsOptions}.
95
+ * 3. **Contiguous, or honestly short.** A backend that prunes may return a
96
+ * first event above `sinceSeq + 1`; that is a gap, the caller detects
97
+ * it, and the reconnect is refused rather than spliced. Do NOT
98
+ * manufacture placeholders to close it.
99
+ *
100
+ * High-frequency events never enter the log (see
101
+ * {@link RunStore.appendEvent}), so what a late subscriber recovers is
102
+ * message-granular, not keystroke-granular. Aggregated assistant text,
103
+ * every tool result and the full message list are all intact; the deltas
104
+ * that composed them are not, and are not meant to be.
105
+ */
106
+ readEvents(options?: ReadRunEventsOptions): Promise<readonly PersistedRunEvent[]>;
67
107
  /**
68
108
  * Persist the run's final report. Returns a location, or `null` when the
69
109
  * backend has none. See {@link RunStore.initRun}.
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/types/run/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,QAAQ;IACxB;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEpE,gEAAgE;IAChE,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErC,8CAA8C;IAC9C,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtC;;;;;;OA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AG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErC,8CAA8C;IAC9C,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtC;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAA;IAEjF;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEpD;;;;;;;;;;;;OAYG;IACH,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAA;IAE/D;;;OAGG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI,CAAA;IAE1B;;;;;;;;;OASG;IACH,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namzu/sdk",
3
- "version": "20.3.0",
3
+ "version": "21.0.0",
4
4
  "description": "Open-source AI agent SDK with a built-in runtime. Nothing between you and your agents.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "type": "module",
@@ -19,6 +19,11 @@
19
19
  "types": "./dist/index.d.ts",
20
20
  "import": "./dist/index.js",
21
21
  "default": "./dist/index.js"
22
+ },
23
+ "./testing": {
24
+ "types": "./dist/store/run/conformance.d.ts",
25
+ "import": "./dist/store/run/conformance.js",
26
+ "default": "./dist/store/run/conformance.js"
22
27
  }
23
28
  },
24
29
  "files": [