@rulvar/cli 1.34.0 → 1.36.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.
package/dist/index.d.ts CHANGED
@@ -248,11 +248,23 @@ interface CreateWorkerOptions {
248
248
  owner?: string;
249
249
  /**
250
250
  * The store's lease ttl; the worker renews at ttl/3 (the normative
251
- * bound). Default: the Appendix A reference 60000 ms.
252
- * MUST match the store's configured ttl.
251
+ * bound). An integer between 1 and 2147483647 ms, refused as a
252
+ * ConfigError at construction. MUST match the store's configured ttl:
253
+ * when the store exposes the optional `leaseTtlMs` capability
254
+ * (SqliteStore does), the match is VERIFIED at construction and a
255
+ * mismatch is a ConfigError; a store without the capability is
256
+ * trusted. Omitted, the worker ADOPTS the store's exposed ttl, falling
257
+ * back to the Appendix A reference 60000 ms.
253
258
  */
254
259
  ttlMs?: number;
255
- /** Idle sweep cadence for start(); default 1000 ms. */
260
+ /**
261
+ * Idle sweep cadence for start(); default 1000 ms. An integer between
262
+ * 1 and 2147483647 ms, refused as a ConfigError at construction (an
263
+ * overflow or a value that is not finite would collapse to the 1 ms floor
264
+ * and storm the store; v1.35.0 review P2-4). Zero is not a manual
265
+ * mode: drive sweeps directly with worker.sweep() instead of
266
+ * start().
267
+ */
256
268
  pollMs?: number;
257
269
  /**
258
270
  * The OQ-21 interim channel: original in-process run arguments are not
package/dist/index.js CHANGED
@@ -583,9 +583,17 @@ function createWorker(engine, options) {
583
583
  const concurrency = options.concurrency ?? 1;
584
584
  if (!Number.isInteger(concurrency) || concurrency < 1) throw new ConfigError(`createWorker concurrency must be a positive integer, got ${concurrency}`);
585
585
  const owner = options.owner ?? workerIdentity();
586
- const ttlMs = options.ttlMs ?? 6e4;
586
+ const requireTimerMs = (value, site) => {
587
+ if (!Number.isInteger(value) || value < 1 || value > 2147483647) throw new ConfigError(`${site} must be an integer between 1 and 2147483647 ms; got ${String(value)}`);
588
+ };
589
+ const storeTtlMs = store.leaseTtlMs;
590
+ if (storeTtlMs !== void 0 && !Number.isInteger(storeTtlMs)) throw new ConfigError(`the store's leaseTtlMs capability must report an integer; got ${String(storeTtlMs)}`);
591
+ const ttlMs = options.ttlMs ?? storeTtlMs ?? 6e4;
592
+ requireTimerMs(ttlMs, "createWorker ttlMs");
593
+ if (storeTtlMs !== void 0 && ttlMs !== storeTtlMs) throw new ConfigError(`createWorker ttlMs ${String(ttlMs)} does not match the store's configured lease ttl ${String(storeTtlMs)} (the store exposes leaseTtlMs; omit createWorker ttlMs to adopt it)`);
587
594
  const renewMs = Math.max(1, Math.floor(ttlMs / 3));
588
595
  const pollMs = options.pollMs ?? 1e3;
596
+ requireTimerMs(pollMs, "createWorker pollMs");
589
597
  const registry = buildDeriverRegistry(options.extraDerivers);
590
598
  const active = /* @__PURE__ */ new Map();
591
599
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.34.0",
3
+ "version": "1.36.0",
4
4
  "description": "Rulvar shell: run/resume/runs/inspect/plan/kb commands, TUI progress, createServer, createWorker, OTel exporter.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,17 +22,17 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.34.0"
25
+ "@rulvar/core": "1.36.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.0",
29
29
  "tsdown": "^0.22.3",
30
30
  "typescript": "~6.0.3",
31
- "@rulvar/store-sqlite": "1.34.0",
32
- "@rulvar/planner": "1.34.0",
33
- "@rulvar/plan": "1.34.0",
34
- "@rulvar/evals": "1.34.0",
35
- "@rulvar/testing": "1.34.0"
31
+ "@rulvar/testing": "1.36.0",
32
+ "@rulvar/store-sqlite": "1.36.0",
33
+ "@rulvar/evals": "1.36.0",
34
+ "@rulvar/planner": "1.36.0",
35
+ "@rulvar/plan": "1.36.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"