@cat-factory/kernel 0.138.1 → 0.139.1

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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10
  scope: PublicApiScope;
11
11
  /** Hex `HMAC-SHA256(secret, ENCRYPTION_KEY)` of the key's secret portion. */
12
12
  secretHash: string;
13
+ /**
14
+ * The user who minted the key — AUDIT + UI attribution. `null` for keys minted with no
15
+ * signed-in session (dev-open) or predating the column. A key is a workspace-scoped SERVICE
16
+ * credential: it does NOT die when its minter loses workspace access (revocation is an explicit
17
+ * admin action), so this is provenance, never an authorization input.
18
+ */
19
+ createdByUserId: string | null;
13
20
  createdAt: number;
14
21
  /** When the key last authenticated a call (null = never used). */
15
22
  lastUsedAt: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"public-api-key-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/public-api-key-repositories.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,2FAA2F;IAC3F,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,KAAK,EAAE,cAAc,CAAA;IACrB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,kEAAkE;IAClE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,mCAAmC;IACnC,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;IACvD;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAA;IACnE,oFAAoF;IACpF,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,iEAAiE;IACjE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE"}
1
+ {"version":3,"file":"public-api-key-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/public-api-key-repositories.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,2FAA2F;IAC3F,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,KAAK,EAAE,cAAc,CAAA;IACrB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,kEAAkE;IAClE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,mCAAmC;IACnC,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;IACvD;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAA;IACnE,oFAAoF;IACpF,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,iEAAiE;IACjE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/kernel",
3
- "version": "0.138.1",
3
+ "version": "0.139.1",
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.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@vitest/coverage-v8": "^4.1.10",