@cat-factory/kernel 0.117.2 → 0.117.3

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.
@@ -12,6 +12,17 @@ export interface NotificationRepository {
12
12
  /** Create or replace a notification (keyed by id). Used for status transitions
13
13
  * (dismiss/act/escalate) and block-less cards. */
14
14
  upsert(workspaceId: string, notification: Notification): Promise<void>;
15
+ /**
16
+ * ATOMICALLY claim an OPEN notification for its action: flip `open` → `acted` (stamping
17
+ * `resolvedAt`) in ONE conditional statement and return the claimed row, or `null` when the
18
+ * card was NOT open (already acted/dismissed, or gone). The `act` double-fire guard — two
19
+ * concurrent acts on the same card (double-click, two members' inboxes, an HTTP retry) race
20
+ * here and only the winner gets the row back, so the notification's side effect (merge the
21
+ * PR / retry the run) runs EXACTLY once; the loser sees `null` and skips it. Modeled on
22
+ * {@link PasswordResetTokenRepository.consume}. The service reverts to `open` (via `upsert`)
23
+ * if the side effect then throws, so a failed action stays retryable.
24
+ */
25
+ claimForAction(workspaceId: string, id: string, resolvedAt: number): Promise<Notification | null>;
15
26
  /**
16
27
  * ATOMICALLY create-or-refresh the SINGLE open notification of `notification.type` for
17
28
  * its block, enforced by a partial unique index on `(workspace_id, block_id, type)`
@@ -1 +1 @@
1
- {"version":3,"file":"notification-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/notification-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAMxE,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAClE,iGAAiG;IACjG,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IACtD;;;OAGG;IACH,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAC/B;sDACkD;IAClD,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtE;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAC1F;;;;;OAKG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;CAChF"}
1
+ {"version":3,"file":"notification-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/notification-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAMxE,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAClE,iGAAiG;IACjG,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IACtD;;;OAGG;IACH,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAC/B;sDACkD;IAClD,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtE;;;;;;;;;OASG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IACjG;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAC1F;;;;;OAKG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;CAChF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/kernel",
3
- "version": "0.117.2",
3
+ "version": "0.117.3",
4
4
  "description": "Shared vocabulary, pure logic, and port interfaces for the Agent Architecture Board.",
5
5
  "repository": {
6
6
  "type": "git",