modelstat 0.8.2 → 0.8.3

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/cli.mjs CHANGED
@@ -37193,7 +37193,7 @@ var init_scan = __esm({
37193
37193
  init_api();
37194
37194
  init_config2();
37195
37195
  init_pipeline2();
37196
- DAEMON_VERSION = true ? "daemon-0.8.2" : "daemon-dev";
37196
+ DAEMON_VERSION = true ? "daemon-0.8.3" : "daemon-dev";
37197
37197
  BATCH_MAX_EVENTS = INGEST_BATCH_MAX_EVENTS;
37198
37198
  BATCH_MAX_TOOL_CALLS = 2e4;
37199
37199
  BATCH_BUFFER_HARD_CAP = BATCH_MAX_EVENTS * 2;
@@ -40120,7 +40120,7 @@ var init_daemon = __esm({
40120
40120
  init_scan();
40121
40121
  init_single_flight();
40122
40122
  init_update();
40123
- DAEMON_VERSION2 = true ? "daemon-0.8.2" : "daemon-dev";
40123
+ DAEMON_VERSION2 = true ? "daemon-0.8.3" : "daemon-dev";
40124
40124
  HEARTBEAT_INTERVAL_MS = 1e4;
40125
40125
  SCAN_INTERVAL_MS = 5 * 60 * 1e3;
40126
40126
  DISCOVERY_INTERVAL_MS = 6e4;
@@ -40724,7 +40724,7 @@ function tryOpenBrowser(url) {
40724
40724
  return false;
40725
40725
  }
40726
40726
  }
40727
- var DAEMON_VERSION3 = true ? "daemon-0.8.2" : "daemon-dev";
40727
+ var DAEMON_VERSION3 = true ? "daemon-0.8.3" : "daemon-dev";
40728
40728
  function osFamily() {
40729
40729
  const p = platform6();
40730
40730
  if (p === "darwin") return "macos";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modelstat",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "modelstat daemon — reads local AI-tool usage and ships tokenised events to modelstat.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  "tsx": "^4.19.2",
30
30
  "typescript": "^5.7.3",
31
31
  "@modelstat/daemon-core": "0.0.0",
32
- "@modelstat/parsers": "0.0.0",
33
- "@modelstat/core": "0.0.0"
32
+ "@modelstat/core": "0.0.0",
33
+ "@modelstat/parsers": "0.0.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=20.18.0"
@@ -208,12 +208,19 @@ async function rebootServiceIfInstalled() {
208
208
  );
209
209
  }
210
210
 
211
- // Start back up. `modelstat start` re-runs preflight (incl. the
212
- // processing-version reconcile that wipes cursors when we ship a
213
- // new pipeline), so the upgrade picks up the new behaviour
214
- // immediately. Detached so the daemon survives this script.
211
+ // Start back up. `--force` is REQUIRED, not optional: the stop +
212
+ // killStaleDaemon above happen BEFORE the (slow, up-to-300 s) native
213
+ // `_setup-runtime` restage, and a launchd/systemd KeepAlive can respawn
214
+ // the OLD daemon during that window. A plain `start` would then see a live
215
+ // owner and no-op ("already running — to force-replace it: start --force"),
216
+ // leaving the service stuck on the previous build even though the global
217
+ // package upgraded. `--force` evicts whatever survived and guarantees the
218
+ // freshly-staged bundle is the one running. `start` re-runs preflight (incl.
219
+ // the processing-version reconcile that wipes cursors when we ship a new
220
+ // pipeline), so the upgrade picks up the new behaviour immediately. Detached
221
+ // so the daemon survives this script.
215
222
  const { spawn } = await import("node:child_process");
216
- const child = spawn(process.execPath, [freshBundle, "start"], {
223
+ const child = spawn(process.execPath, [freshBundle, "start", "--force"], {
217
224
  detached: true,
218
225
  stdio: "ignore",
219
226
  });