@cmgmyr/hive 1.2.0 → 1.2.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.
- package/dist/build-info.json +1 -1
- package/dist/index.js +2 -2
- package/dist/scheduler.js +11 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.2.
|
|
1
|
+
{"version":"1.2.1","sha":"1d14c85","dirty":false,"build_id":"6d50625e-ceaf-412d-8dcf-6b7a922fceaa"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { registerKv } from "./tools/kv.js";
|
|
|
10
10
|
import { registerLeases } from "./tools/leases.js";
|
|
11
11
|
import { registerWakes } from "./tools/wakes.js";
|
|
12
12
|
import { registerPrompts } from "./prompts.js";
|
|
13
|
-
import { startScheduler } from "./scheduler.js";
|
|
13
|
+
import { schedulerIntervalMs, startScheduler } from "./scheduler.js";
|
|
14
14
|
import { enforceStrictInput } from "./strictInput.js";
|
|
15
15
|
const server = enforceStrictInput(new McpServer({ name: "hive", version: "0.1.0" }, {
|
|
16
16
|
instructions: `Hive gives Claude Code sessions shared, persistent state for coordinating work on a project: pads for plans and findings, todos for tracked work with blockers, kv for small shared values, leases for claiming shared work areas, agents for spawning and directing other sessions, and wake-ups for scheduled or idle-triggered check-ins. Search for these tools when a task needs to persist past this conversation, hand off to or watch another session, or track multi-step work with dependencies.
|
|
@@ -30,5 +30,5 @@ registerKv(server);
|
|
|
30
30
|
registerLeases(server);
|
|
31
31
|
registerWakes(server);
|
|
32
32
|
registerPrompts(server);
|
|
33
|
-
startScheduler();
|
|
33
|
+
startScheduler(schedulerIntervalMs());
|
|
34
34
|
await server.connect(new StdioServerTransport());
|
package/dist/scheduler.js
CHANGED
|
@@ -43,7 +43,7 @@ function bestEffortRun(sql, ...params) {
|
|
|
43
43
|
}
|
|
44
44
|
let ticking = false;
|
|
45
45
|
let schedulerInterval;
|
|
46
|
-
export function startScheduler(intervalMs =
|
|
46
|
+
export function startScheduler(intervalMs = DEFAULT_SCHEDULER_INTERVAL_MS) {
|
|
47
47
|
schedulerInterval = setInterval(() => {
|
|
48
48
|
void tick();
|
|
49
49
|
}, intervalMs).unref();
|
|
@@ -1642,3 +1642,13 @@ async function deliver(timer, note, choices, typedSeen, firstHeldAt) {
|
|
|
1642
1642
|
if (!strandedTextWouldHold)
|
|
1643
1643
|
recordTyped();
|
|
1644
1644
|
}
|
|
1645
|
+
export const DEFAULT_SCHEDULER_INTERVAL_MS = 3000;
|
|
1646
|
+
const MIN_SCHEDULER_INTERVAL_MS = 100;
|
|
1647
|
+
// Node clamps a setInterval delay above this to 1ms.
|
|
1648
|
+
const MAX_SCHEDULER_INTERVAL_MS = 2_147_483_647;
|
|
1649
|
+
export function schedulerIntervalMs(raw = process.env.HIVE_SCHEDULER_INTERVAL_MS) {
|
|
1650
|
+
const parsed = Number(raw);
|
|
1651
|
+
return raw && Number.isInteger(parsed) && parsed >= MIN_SCHEDULER_INTERVAL_MS && parsed <= MAX_SCHEDULER_INTERVAL_MS
|
|
1652
|
+
? parsed
|
|
1653
|
+
: DEFAULT_SCHEDULER_INTERVAL_MS;
|
|
1654
|
+
}
|
package/dist/version.js
CHANGED
|
@@ -27,7 +27,7 @@ export function runningBuildChange() {
|
|
|
27
27
|
if (!loadedBuild)
|
|
28
28
|
return null;
|
|
29
29
|
const stat = statSync(join(moduleDir, "build-info.json"));
|
|
30
|
-
const signature = `${stat.ino}:${stat.size}:${stat.mtimeMs}`;
|
|
30
|
+
const signature = `${stat.ino}:${stat.size}:${stat.mtimeMs}:${stat.ctimeMs}`;
|
|
31
31
|
if (signature !== diskSignature) {
|
|
32
32
|
diskBuild = readRunningBuild();
|
|
33
33
|
diskSignature = signature;
|