@merittdev/horus 0.8.1 → 0.8.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.
Files changed (2) hide show
  1. package/dist/index.cjs +22 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -65880,8 +65880,8 @@ init_cjs_shims();
65880
65880
 
65881
65881
  // ../../packages/core/src/version.ts
65882
65882
  init_cjs_shims();
65883
- var HORUS_VERSION = true ? "0.8.1" : "dev";
65884
- var PINNED_SOURCE_VERSION = "1.4.0";
65883
+ var HORUS_VERSION = true ? "0.8.2" : "dev";
65884
+ var PINNED_SOURCE_VERSION = "1.5.0";
65885
65885
 
65886
65886
  // ../../packages/core/src/evidence.ts
65887
65887
  init_cjs_shims();
@@ -71100,6 +71100,21 @@ function removeSpawnedHostRecord(root) {
71100
71100
  } catch {
71101
71101
  }
71102
71102
  }
71103
+ function reconcileSpawnedHostPid(root, port) {
71104
+ try {
71105
+ const backend = readSourceHostPid(root);
71106
+ if (!backend || !Number.isInteger(backend.pid) || backend.pid <= 0) return;
71107
+ if (Number.isFinite(backend.port) && backend.port !== port) return;
71108
+ const spawned = readSpawnedHost(root);
71109
+ if (!spawned || spawned.pid === backend.pid) return;
71110
+ const updated = { ...spawned, pid: backend.pid };
71111
+ (0, import_node_fs3.writeFileSync)(
71112
+ (0, import_node_path3.join)(root, ".horus", SPAWNED_HOST_FILE),
71113
+ JSON.stringify(updated, null, 2) + "\n"
71114
+ );
71115
+ } catch {
71116
+ }
71117
+ }
71103
71118
  async function waitForHost(hostUrl, timeoutMs = 45e3) {
71104
71119
  const deadline = Date.now() + timeoutMs;
71105
71120
  while (Date.now() < deadline) {
@@ -97166,6 +97181,7 @@ async function runIndex(opts) {
97166
97181
  );
97167
97182
  return 1;
97168
97183
  }
97184
+ reconcileSpawnedHostPid(root, port);
97169
97185
  }
97170
97186
  await stitchQueueMap(hostUrl, dbUrl, label);
97171
97187
  buildKnowledgeIndex(root, config2, label, configuredProject, opts);
@@ -110127,7 +110143,10 @@ async function ensureSourceHost(root, hostUrl, opts = {}) {
110127
110143
  const port = parseHostPort(hostUrl);
110128
110144
  if (port === null) return { ok: false, reason: "bad-url" };
110129
110145
  startHost(root, port);
110130
- if (await waitForHost(hostUrl, opts.timeoutMs ?? 2e4)) return { ok: true, hostUrl };
110146
+ if (await waitForHost(hostUrl, opts.timeoutMs ?? 2e4)) {
110147
+ reconcileSpawnedHostPid(root, port);
110148
+ return { ok: true, hostUrl };
110149
+ }
110131
110150
  removeSpawnedHostRecord(root);
110132
110151
  return { ok: false, reason: "unhealthy" };
110133
110152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Local-first, source-aware production-incident investigation engine",
5
5
  "type": "module",
6
6
  "bin": {