@cat-factory/node-server 0.86.7 → 0.86.8
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/initiativeLoop.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Clock } from '@cat-factory/kernel';
|
|
2
2
|
import type { Logger, ServerContainer } from '@cat-factory/server';
|
|
3
|
-
/**
|
|
3
|
+
/** Default cadence for the Node initiative-loop sweep (the Worker uses a 2-minute cron). */
|
|
4
4
|
export declare const INITIATIVE_LOOP_SWEEP_INTERVAL_MS: number;
|
|
5
5
|
/**
|
|
6
|
-
* Start the periodic initiative-loop sweep. Runs once immediately then on
|
|
7
|
-
* Best-effort: a failed sweep is logged
|
|
8
|
-
* function that clears the timer.
|
|
6
|
+
* Start the periodic initiative-loop sweep. Runs once immediately then on the resolved interval
|
|
7
|
+
* (default one minute; see {@link resolveSweepInterval}). Best-effort: a failed sweep is logged
|
|
8
|
+
* and retried next tick, never thrown. Returns a stop function that clears the timer.
|
|
9
9
|
*/
|
|
10
|
-
export declare function startInitiativeLoopSweeper(container: ServerContainer, clock: Clock, log: Logger): () => void;
|
|
10
|
+
export declare function startInitiativeLoopSweeper(container: ServerContainer, clock: Clock, log: Logger, intervalMs?: number): () => void;
|
|
11
11
|
//# sourceMappingURL=initiativeLoop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiativeLoop.d.ts","sourceRoot":"","sources":["../src/initiativeLoop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAQlE,
|
|
1
|
+
{"version":3,"file":"initiativeLoop.d.ts","sourceRoot":"","sources":["../src/initiativeLoop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAQlE,4FAA4F;AAC5F,eAAO,MAAM,iCAAiC,QAAY,CAAA;AAc1D;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAM,EACX,UAAU,GAAE,MAA+B,GAC1C,MAAM,IAAI,CAoBZ"}
|
package/dist/initiativeLoop.js
CHANGED
|
@@ -3,14 +3,25 @@
|
|
|
3
3
|
// ticks every executing initiative (reconcile spawned tasks + spawn the next wave). Terminal
|
|
4
4
|
// child runs poke the loop directly; this interval is the backstop cadence. No-op when the
|
|
5
5
|
// initiatives module isn't wired.
|
|
6
|
-
/**
|
|
6
|
+
/** Default cadence for the Node initiative-loop sweep (the Worker uses a 2-minute cron). */
|
|
7
7
|
export const INITIATIVE_LOOP_SWEEP_INTERVAL_MS = 60 * 1000;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* The sweep interval, overridable via `INITIATIVE_LOOP_INTERVAL_MS` (milliseconds) — the same
|
|
10
|
+
* shape as the other Node cadence knobs. Chiefly so a fast integration harness (the e2e suite)
|
|
11
|
+
* can drive the first spawn wave within its timeouts instead of waiting a whole minute for the
|
|
12
|
+
* backstop tick; a non-positive/unparseable value falls back to the default.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
+
function resolveSweepInterval() {
|
|
15
|
+
const raw = process.env.INITIATIVE_LOOP_INTERVAL_MS;
|
|
16
|
+
const parsed = raw ? Number(raw) : Number.NaN;
|
|
17
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : INITIATIVE_LOOP_SWEEP_INTERVAL_MS;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Start the periodic initiative-loop sweep. Runs once immediately then on the resolved interval
|
|
21
|
+
* (default one minute; see {@link resolveSweepInterval}). Best-effort: a failed sweep is logged
|
|
22
|
+
* and retried next tick, never thrown. Returns a stop function that clears the timer.
|
|
23
|
+
*/
|
|
24
|
+
export function startInitiativeLoopSweeper(container, clock, log, intervalMs = resolveSweepInterval()) {
|
|
14
25
|
const initiatives = container.initiatives;
|
|
15
26
|
if (!initiatives)
|
|
16
27
|
return () => { };
|
|
@@ -26,7 +37,7 @@ export function startInitiativeLoopSweeper(container, clock, log) {
|
|
|
26
37
|
}
|
|
27
38
|
};
|
|
28
39
|
void tick();
|
|
29
|
-
const timer = setInterval(() => void tick(),
|
|
40
|
+
const timer = setInterval(() => void tick(), intervalMs);
|
|
30
41
|
timer.unref?.();
|
|
31
42
|
return () => clearInterval(timer);
|
|
32
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiativeLoop.js","sourceRoot":"","sources":["../src/initiativeLoop.ts"],"names":[],"mappings":"AAGA,8FAA8F;AAC9F,+FAA+F;AAC/F,6FAA6F;AAC7F,2FAA2F;AAC3F,kCAAkC;AAElC,
|
|
1
|
+
{"version":3,"file":"initiativeLoop.js","sourceRoot":"","sources":["../src/initiativeLoop.ts"],"names":[],"mappings":"AAGA,8FAA8F;AAC9F,+FAA+F;AAC/F,6FAA6F;AAC7F,2FAA2F;AAC3F,kCAAkC;AAElC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,GAAG,IAAI,CAAA;AAE1D;;;;;GAKG;AACH,SAAS,oBAAoB;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAA;IACnD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAA;IAC7C,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iCAAiC,CAAA;AAC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facade for the Agent Architecture Board: serves the shared @cat-factory/server Hono app via @hono/node-server, wiring Node implementations of the runtime ports (persistence, gateways, model provisioning).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"pg": "^8.22.0",
|
|
33
33
|
"pg-boss": "^12.25.1",
|
|
34
34
|
"ws": "^8.21.0",
|
|
35
|
-
"@cat-factory/agents": "0.48.0",
|
|
36
|
-
"@cat-factory/caching": "0.6.8",
|
|
37
|
-
"@cat-factory/consensus": "0.10.7",
|
|
38
35
|
"@cat-factory/contracts": "0.118.0",
|
|
36
|
+
"@cat-factory/consensus": "0.10.7",
|
|
39
37
|
"@cat-factory/eks": "0.1.31",
|
|
38
|
+
"@cat-factory/agents": "0.48.0",
|
|
40
39
|
"@cat-factory/gates": "0.4.28",
|
|
40
|
+
"@cat-factory/caching": "0.6.8",
|
|
41
41
|
"@cat-factory/gitlab": "0.7.31",
|
|
42
42
|
"@cat-factory/integrations": "0.77.8",
|
|
43
43
|
"@cat-factory/kernel": "0.108.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"drizzle-kit": "1.0.0-rc.4",
|
|
58
58
|
"typescript": "7.0.1-rc",
|
|
59
59
|
"vitest": "^4.1.9",
|
|
60
|
-
"@cat-factory/conformance": "0.10.
|
|
60
|
+
"@cat-factory/conformance": "0.10.63"
|
|
61
61
|
},
|
|
62
62
|
"optionalDependencies": {
|
|
63
63
|
"ioredis": "^5.11.1"
|