@indigoai-us/hq-cli 5.345.0 → 5.345.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.2] — 2026-10-05
6
+ - Build and version-check the hq-cloud sync-runner bundle, then validate and atomically stage it with the daemon child bootstrap before releasing the CLI package-use lease.
7
+ - Defer MCP tool and prompt handler imports until a request needs them so `hq mcp serve` can answer initialize without waiting on the full handler modules.
8
+ - Add regression coverage that a cancelled superseded lane still refuses `hq lanes message` when running-superseded message delivery is enabled.
9
+
10
+ ## [5.345.1] — 2026-10-05
11
+ - Queue low-disk lanes before provider account login validation so the disk safety guard can run on hosts with low free space.
12
+ - Defer mesh daemon and session-validation modules until their command paths need them.
13
+
5
14
  ## [5.345.0] — 2026-10-05
6
15
  - Apply Codex rollout retention, batched stale KPI notices, per-lead error isolation, and autopilot nudge deduplication without rollout gates.
7
16
 
@@ -46,12 +46,16 @@ export async function loadDaemonRunner(release = releaseCurrentPackageUseLease,
46
46
  await releasePackageUseLeaseAfterResidentPreload(preload, reportPreloadFailure, () => {
47
47
  preloadComplete = true;
48
48
  });
49
+ let released = false;
49
50
  return (options) => runDaemon({
50
51
  ...options,
51
52
  onStartupReadsComplete: () => {
52
53
  options.onStartupReadsComplete?.();
53
- if (preloadComplete)
54
- release();
54
+ if (!preloadComplete || released)
55
+ return released;
56
+ released = true;
57
+ release();
58
+ return true;
55
59
  },
56
60
  });
57
61
  }
@@ -59,7 +59,11 @@ export async function runMcpServe(opts = {}) {
59
59
  process.exitCode = 1;
60
60
  return;
61
61
  }
62
- const { tools, prompts } = await loadMcpPackageHandlers();
62
+ let packageHandlers;
63
+ const getPackageHandlers = () => {
64
+ packageHandlers ??= loadMcpPackageHandlers();
65
+ return packageHandlers;
66
+ };
63
67
  const preload = (residentPath, modules) => opts.preloadResidentModules
64
68
  ? opts.preloadResidentModules(residentPath, modules)
65
69
  : preloadResidentPackageModules(residentPath);
@@ -73,8 +77,8 @@ export async function runMcpServe(opts = {}) {
73
77
  process.emitWarning("hq-cli resident package preload completion failed (class=Error, module=unknown)");
74
78
  });
75
79
  };
76
- // Release before the stdio read can remain open indefinitely. The request
77
- // handlers and their declared lazy modules are loaded before this point.
80
+ // Release before the stdio read can remain open indefinitely. Request
81
+ // handlers stay lazy until a request needs them.
78
82
  startResidentPreload();
79
83
  const send = (msg) => {
80
84
  const response = `${JSON.stringify({ jsonrpc: "2.0", ...msg })}\n`;
@@ -83,6 +87,7 @@ export async function runMcpServe(opts = {}) {
83
87
  const reply = (id, result) => send({ id, result });
84
88
  const replyError = (id, code, message) => send({ id, error: { code, message } });
85
89
  const callTool = async (params) => {
90
+ const { tools } = await getPackageHandlers();
86
91
  const name = params.name;
87
92
  if (typeof name !== "string" || !tools.MCP_TOOLS.some((t) => t.name === name)) {
88
93
  return toolError("unknown_tool", `unknown tool ${String(name)}`);
@@ -119,17 +124,22 @@ export async function runMcpServe(opts = {}) {
119
124
  case "ping":
120
125
  reply(id, {});
121
126
  return;
122
- case "tools/list":
127
+ case "tools/list": {
128
+ const { tools } = await getPackageHandlers();
123
129
  reply(id, { tools: tools.MCP_TOOLS });
124
130
  return;
131
+ }
125
132
  case "tools/call":
126
133
  reply(id, await callTool(params));
127
134
  return;
128
- case "prompts/list":
135
+ case "prompts/list": {
136
+ const { prompts } = await getPackageHandlers();
129
137
  reply(id, { prompts: prompts.MCP_PROMPTS });
130
138
  return;
139
+ }
131
140
  case "prompts/get": {
132
141
  const args = params.arguments && typeof params.arguments === "object" ? params.arguments : {};
142
+ const { prompts } = await getPackageHandlers();
133
143
  try {
134
144
  reply(id, prompts.getPrompt(String(params.name), args, readHqRoot(env, home)));
135
145
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Command } from "commander";
9
9
  import { type MeshCompany, type MeshThread } from "../lib/mesh/api.js";
10
- import { type DaemonInstallPlatform, type InstallPaths } from "../lib/mesh/live/daemon/index.js";
10
+ import { type DaemonInstallPlatform, type InstallPaths } from "../lib/mesh/live/daemon/install.js";
11
11
  import { type RunCommand } from "../lib/service-manager/launchd.js";
12
12
  export declare function formatCheckLines(threads: MeshThread[], company: MeshCompany, projectId?: string): string[];
13
13
  /** Test seam for the usage-attribution question asked by `default set`. */
@@ -23,7 +23,6 @@ import { ensureDefaultCompany } from "../lib/work-context/default-company.js";
23
23
  import { personUidFromTokens } from "../lib/work-context/person-identity.js";
24
24
  import { DefaultCompanyUnavailableError, WorkContextError, } from "../lib/work-context/errors.js";
25
25
  import { isValidSessionId } from "../lib/mesh/live/session-identity.js";
26
- import { CLI_KIND_TO_SCHEMA, resolveEnqueueSessionId, } from "../lib/mesh/live/index.js";
27
26
  import { flushSessionEvents } from "../lib/mesh/live/flush.js";
28
27
  import { backfillHeldSessions } from "../lib/mesh/live/backfill-held.js";
29
28
  import { createSessionEventsPoster, resolveVaultApiBase, } from "../lib/mesh/live/session-events-client.js";
@@ -40,7 +39,10 @@ import { generateUlid } from "../lib/mesh/live/ulid.js";
40
39
  import { readLegacyBacklog } from "../lib/mesh/live/emit-replay.js";
41
40
  import { resolveMeshEmitMode, writeMeshConfigMode, } from "../lib/mesh/live/daemon/mode.js";
42
41
  import { workMeshRoot } from "../lib/mesh/live/paths.js";
43
- import { buildInstallPaths, collectDaemonDoctor, daemonServiceIsLoaded, daemonServiceStatus, findAncestorHqRoot, resolveInstallHqRoot, detectPlatform, formatCliIdentityLines, formatDaemonDoctor, installDaemonIfStale, installDaemonService, readDaemonState, resolveAbsoluteNodeBinary, resolveRunningCliEntry, runMeshDaemon, uninstallDaemonService, } from "../lib/mesh/live/daemon/index.js";
42
+ import { buildInstallPaths, daemonServiceIsLoaded, daemonServiceStatus, detectPlatform, installDaemonIfStale, installDaemonService, resolveAbsoluteNodeBinary, resolveRunningCliEntry, uninstallDaemonService, } from "../lib/mesh/live/daemon/install.js";
43
+ import { findAncestorHqRoot, resolveInstallHqRoot, } from "../lib/mesh/live/daemon/config.js";
44
+ import { collectDaemonDoctor, formatCliIdentityLines, formatDaemonDoctor, } from "../lib/mesh/live/daemon/doctor.js";
45
+ import { readDaemonState } from "../lib/mesh/live/daemon/state.js";
44
46
  import { defaultRunCommand } from "../lib/service-manager/launchd.js";
45
47
  import { workContextRoot } from "../lib/work-context/paths.js";
46
48
  import { formatMigrateConfirmation, submitSessionMigration, } from "../lib/work-context/migrate.js";
@@ -1675,6 +1677,7 @@ function workMeshHomeRoot() {
1675
1677
  return workMeshRoot(os.homedir(), process.env);
1676
1678
  }
1677
1679
  async function runSessionEnqueue(cliKind, opts) {
1680
+ const { CLI_KIND_TO_SCHEMA, resolveEnqueueSessionId } = await import("../lib/mesh/live/enqueue.js");
1678
1681
  // `--enqueue` is retained for hook back-compat but now means "emit directly"
1679
1682
  // (owner decision 2026-09-08: sessions POST events to the server over HTTPS;
1680
1683
  // no local spool/daemon on the emit path).
@@ -2250,6 +2253,7 @@ export function registerMeshCommand(program, deps = {}) {
2250
2253
  .action((opts) => wrap(() => runDaemonDoctorCmd(opts))());
2251
2254
  }
2252
2255
  async function runDaemonRun(opts = {}) {
2256
+ const { runMeshDaemon } = await import("../lib/mesh/live/daemon/run.js");
2253
2257
  const hqRoot = opts.hqRoot?.trim() || undefined;
2254
2258
  const handle = await runMeshDaemon({
2255
2259
  ...(hqRoot ? { hqRoot } : {}),