@byok-sdk/core 0.10.2 → 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.
package/dist/mailbox.d.ts CHANGED
@@ -79,10 +79,18 @@ export interface MailboxAdvanceCursorInput {
79
79
  /** Highest seq the device has durably journaled. */
80
80
  readonly ackedSeq: number;
81
81
  }
82
- /** The device's durable acknowledgement position. */
82
+ /** Server-owned proof that a cursor was returned to this device. */
83
+ export interface MailboxRecordDeliveryInput {
84
+ readonly deviceId: string;
85
+ /** Highest cursor the server has returned to this device. */
86
+ readonly deliveredSeq: number;
87
+ }
88
+ /** The device's durable delivery and acknowledgement positions. */
83
89
  export interface MailboxCursorState {
84
90
  readonly tenantId: TenantId;
85
91
  readonly deviceId: string;
92
+ /** Highest cursor the server has returned to this device. */
93
+ readonly deliveredSeq: number;
86
94
  readonly ackedSeq: number;
87
95
  readonly updatedAt: string;
88
96
  }
@@ -112,6 +120,8 @@ export interface MailboxRetentionResult {
112
120
  *
113
121
  * Raises: `mailbox_cursor_regression` (an ack that moves the cursor backwards,
114
122
  * which would silently re-deliver already-journaled work),
123
+ * `mailbox_cursor_ahead_of_delivery` (an ack beyond the highest cursor the
124
+ * server has returned to that device),
115
125
  * `timestamp_not_canonical` (a retention cutoff that is not a canonical
116
126
  * ISO-8601 UTC instant).
117
127
  */
@@ -119,7 +129,9 @@ export interface MailboxStore {
119
129
  append(tenant: TenantId, input: MailboxAppendInput): Promise<MailboxMessage>;
120
130
  /** Pure read. Never advances the cursor, never deletes, never marks acked. */
121
131
  readAfter(tenant: TenantId, query: MailboxReadQuery): Promise<MailboxPage>;
122
- /** The one and only ack. Monotonic; a lower `ackedSeq` is rejected. */
132
+ /** Records the highest cursor a device-facing response is about to return. */
133
+ recordDelivery(tenant: TenantId, input: MailboxRecordDeliveryInput): Promise<MailboxCursorState>;
134
+ /** The one and only ack. Monotonic and bounded by the recorded delivery watermark. */
123
135
  advanceCursor(tenant: TenantId, input: MailboxAdvanceCursorInput): Promise<MailboxCursorState>;
124
136
  readCursor(tenant: TenantId, deviceId: string): Promise<MailboxCursorState>;
125
137
  /** Retention hook: delete acked rows, dead-letter unacked ones. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byok-sdk/core",
3
- "version": "0.10.2",
3
+ "version": "0.12.0",
4
4
  "description": "BYOK SDK platform contracts: branded tenant identity, tenant-first store ports, device proof canonicalization, and the composition conformance reference",
5
5
  "type": "module",
6
6
  "license": "MIT",