@cat-factory/server 0.112.1 → 0.112.2
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.
|
@@ -7,6 +7,12 @@ import type { ServerContainer } from '../http/env.js';
|
|
|
7
7
|
* resolves the `waitingEscalationMinutes` threshold (falling back to the default when the
|
|
8
8
|
* settings module isn't wired) and asks the notification service to escalate. Returns the
|
|
9
9
|
* total number escalated. A no-op when the notifications module isn't configured.
|
|
10
|
+
*
|
|
11
|
+
* The per-workspace escalation threshold is resolved in ONE batched read before the loop
|
|
12
|
+
* (`settings.service.getMany`) rather than a `get` point-read per workspace — this sweep
|
|
13
|
+
* runs every couple of minutes across every workspace on both facades, and the perf-item-9
|
|
14
|
+
* settings cache is pass-through on the Worker profile, so only a batch read avoids the N+1
|
|
15
|
+
* here.
|
|
10
16
|
*/
|
|
11
17
|
export declare function escalateStaleNotifications(container: ServerContainer, now: number): Promise<number>;
|
|
12
18
|
//# sourceMappingURL=escalateNotifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escalateNotifications.d.ts","sourceRoot":"","sources":["../../src/runtime/escalateNotifications.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD
|
|
1
|
+
{"version":3,"file":"escalateNotifications.d.ts","sourceRoot":"","sources":["../../src/runtime/escalateNotifications.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,0BAA0B,CAC9C,SAAS,EAAE,eAAe,EAC1B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
|
@@ -7,6 +7,12 @@ import { DEFAULT_WORKSPACE_SETTINGS } from '@cat-factory/kernel';
|
|
|
7
7
|
* resolves the `waitingEscalationMinutes` threshold (falling back to the default when the
|
|
8
8
|
* settings module isn't wired) and asks the notification service to escalate. Returns the
|
|
9
9
|
* total number escalated. A no-op when the notifications module isn't configured.
|
|
10
|
+
*
|
|
11
|
+
* The per-workspace escalation threshold is resolved in ONE batched read before the loop
|
|
12
|
+
* (`settings.service.getMany`) rather than a `get` point-read per workspace — this sweep
|
|
13
|
+
* runs every couple of minutes across every workspace on both facades, and the perf-item-9
|
|
14
|
+
* settings cache is pass-through on the Worker profile, so only a batch read avoids the N+1
|
|
15
|
+
* here.
|
|
10
16
|
*/
|
|
11
17
|
export async function escalateStaleNotifications(container, now) {
|
|
12
18
|
const notifications = container.notifications;
|
|
@@ -14,9 +20,12 @@ export async function escalateStaleNotifications(container, now) {
|
|
|
14
20
|
return 0;
|
|
15
21
|
const settings = container.settings;
|
|
16
22
|
const workspaces = await container.workspaceService.list(null);
|
|
23
|
+
const settingsById = settings
|
|
24
|
+
? await settings.service.getMany(workspaces.map((ws) => ws.id))
|
|
25
|
+
: null;
|
|
17
26
|
let escalated = 0;
|
|
18
27
|
for (const ws of workspaces) {
|
|
19
|
-
const cfg =
|
|
28
|
+
const cfg = settingsById?.get(ws.id) ?? DEFAULT_WORKSPACE_SETTINGS;
|
|
20
29
|
const thresholdMs = cfg.waitingEscalationMinutes * 60_000;
|
|
21
30
|
escalated += await notifications.service.escalateStale(ws.id, thresholdMs, now);
|
|
22
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escalateNotifications.js","sourceRoot":"","sources":["../../src/runtime/escalateNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAGhE
|
|
1
|
+
{"version":3,"file":"escalateNotifications.js","sourceRoot":"","sources":["../../src/runtime/escalateNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAGhE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,SAA0B,EAC1B,GAAW;IAEX,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAA;IAC7C,IAAI,CAAC,aAAa;QAAE,OAAO,CAAC,CAAA;IAC5B,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAA;IACnC,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9D,MAAM,YAAY,GAAG,QAAQ;QAC3B,CAAC,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC,CAAC,IAAI,CAAA;IACR,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,0BAA0B,CAAA;QAClE,MAAM,WAAW,GAAG,GAAG,CAAC,wBAAwB,GAAG,MAAM,CAAA;QACzD,SAAS,IAAI,MAAM,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,CAAA;IACjF,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/server",
|
|
3
|
-
"version": "0.112.
|
|
3
|
+
"version": "0.112.2",
|
|
4
4
|
"description": "Runtime-neutral HTTP layer for the Agent Architecture Board: the Hono controllers, middleware (auth/authz/CORS/error), request helpers and the gateway seams shared by every deployment facade (Cloudflare Worker, Node service).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"hono": "^4.12.27",
|
|
31
31
|
"pino": "^10.3.1",
|
|
32
32
|
"valibot": "^1.4.2",
|
|
33
|
-
"@cat-factory/agents": "0.54.
|
|
34
|
-
"@cat-factory/integrations": "0.81.7",
|
|
33
|
+
"@cat-factory/agents": "0.54.1",
|
|
35
34
|
"@cat-factory/contracts": "0.127.0",
|
|
36
|
-
"@cat-factory/
|
|
37
|
-
"@cat-factory/orchestration": "0.106.
|
|
35
|
+
"@cat-factory/integrations": "0.81.8",
|
|
36
|
+
"@cat-factory/orchestration": "0.106.2",
|
|
37
|
+
"@cat-factory/kernel": "0.121.3",
|
|
38
38
|
"@cat-factory/prompt-fragments": "0.13.13",
|
|
39
|
-
"@cat-factory/spend": "0.12.
|
|
39
|
+
"@cat-factory/spend": "0.12.17"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^26.1.0",
|