@cat-factory/kernel 0.138.1 → 0.139.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.
@@ -9,6 +9,25 @@ export interface NotificationRepository {
9
9
  * a re-driven run doesn't stack identical cards on the same block.
10
10
  */
11
11
  findOpenByBlock(workspaceId: string, blockId: string, type: NotificationType): Promise<Notification | null>;
12
+ /**
13
+ * The open, BLOCK-LESS notification of `type` for a workspace (`block_id IS NULL`), if any.
14
+ * The block-less analogue of {@link findOpenByBlock}: it de-duplicates deployment/workspace-
15
+ * wide cards that aren't about any one block (today `platform_health`) so a periodic sweep
16
+ * re-raising the same card reuses the existing open row instead of stacking a new one each
17
+ * pass. Newest first; block-SCOPED cards of the same type are never returned.
18
+ */
19
+ findOpenByType(workspaceId: string, type: NotificationType): Promise<Notification | null>;
20
+ /**
21
+ * BATCHED {@link findOpenByType}: the open, block-less card of `type` for EACH of
22
+ * `workspaceIds` that has one, as a `Map<workspaceId, Notification>` (newest per workspace;
23
+ * workspaces with none are simply absent). The platform-health sweep enumerates every
24
+ * workspace and would otherwise `findOpenByType` per workspace inside the loop — an N+1 that
25
+ * runs every couple of minutes across the whole deployment. One chunked-`IN` read here lets
26
+ * the sweep skip the point-read for the (steady-state common) healthy workspaces that hold no
27
+ * card, mirroring `WorkspaceSettingsRepository.listByWorkspaceIds` in the escalation sweep.
28
+ * Empty input → empty map.
29
+ */
30
+ listOpenByType(workspaceIds: string[], type: NotificationType): Promise<Map<string, Notification>>;
12
31
  /** Create or replace a notification (keyed by id). Used for status transitions
13
32
  * (dismiss/act/escalate) and block-less cards. */
14
33
  upsert(workspaceId: string, notification: Notification): Promise<void>;
@@ -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;;;;;;;;;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;IAC/E;;;;;;;;OAQG;IACH,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CACzD"}
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,E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2
2
  "name": "@cat-factory/kernel",
3
- "version": "0.138.1",
3
+ "version": "0.139.0",
4
4
  "description": "Shared vocabulary, pure logic, and port interfaces for the Agent Architecture Board.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "ai": "^6.0.224",
28
- "@cat-factory/contracts": "0.146.0"
28
+ "@cat-factory/contracts": "0.147.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@vitest/coverage-v8": "^4.1.10",