@indigoai-us/hq-cli 5.345.0 → 5.345.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.1] — 2026-10-05
6
+ - Queue low-disk lanes before provider account login validation so the disk safety guard can run on hosts with low free space.
7
+ - Defer mesh daemon and session-validation modules until their command paths need them.
8
+
5
9
  ## [5.345.0] — 2026-10-05
6
10
  - Apply Codex rollout retention, batched stale KPI notices, per-lead error isolation, and autopilot nudge deduplication without rollout gates.
7
11
 
@@ -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 } : {}),
@@ -1840,6 +1840,35 @@ export function spawnLaneWorker(hqRoot, lane, deps = {}, launch = {}) {
1840
1840
  probe: modelDeps.probe ?? defaultProbe,
1841
1841
  env,
1842
1842
  };
1843
+ if (deps.lowDiskGuardEnabled === true) {
1844
+ const providerConfig = config.providers[existing.provider];
1845
+ const diskAccount = (existing.account !== undefined ? providerConfig.accounts[existing.account] : undefined) ??
1846
+ (providerConfig.default_account !== undefined
1847
+ ? providerConfig.accounts[providerConfig.default_account]
1848
+ : undefined) ??
1849
+ Object.values(providerConfig.accounts).find((account) => account.enabled);
1850
+ if (diskAccount !== undefined) {
1851
+ const free = checkLaneDiskSpace(hqRoot, effectiveAccountHome(diskAccount, hostname).home, deps.statfs, config.low_disk_min_free_bytes);
1852
+ if (free.low) {
1853
+ const measuredAt = (deps.now ?? (() => new Date()))().toISOString();
1854
+ return retryUpdateLane(hqRoot, lane.lane_id, "spawn", (current) => ({
1855
+ ...current,
1856
+ state: "queued",
1857
+ queued_reason: "low_disk",
1858
+ queued_details: {
1859
+ reason: "low_disk",
1860
+ hq_free_bytes: free.hq.free_bytes,
1861
+ provider_free_bytes: free.provider.free_bytes,
1862
+ measured_at: measuredAt,
1863
+ },
1864
+ queued_at: current.queued_at ?? measuredAt,
1865
+ admission_reserved_at: undefined,
1866
+ terminal_reason: undefined,
1867
+ terminal_details: undefined,
1868
+ }));
1869
+ }
1870
+ }
1871
+ }
1843
1872
  let selection;
1844
1873
  try {
1845
1874
  selection = selectSpawnAccount({
@@ -1874,27 +1903,6 @@ export function spawnLaneWorker(hqRoot, lane, deps = {}, launch = {}) {
1874
1903
  if (preservedAccountModel !== undefined)
1875
1904
  pinnedModel = preservedAccountModel;
1876
1905
  const resolved = selection.account;
1877
- if (deps.lowDiskGuardEnabled === true) {
1878
- const free = checkLaneDiskSpace(hqRoot, resolved.home, deps.statfs, config.low_disk_min_free_bytes);
1879
- if (free.low) {
1880
- const measuredAt = (deps.now ?? (() => new Date()))().toISOString();
1881
- return retryUpdateLane(hqRoot, lane.lane_id, "spawn", (current) => ({
1882
- ...current,
1883
- state: "queued",
1884
- queued_reason: "low_disk",
1885
- queued_details: {
1886
- reason: "low_disk",
1887
- hq_free_bytes: free.hq.free_bytes,
1888
- provider_free_bytes: free.provider.free_bytes,
1889
- measured_at: measuredAt,
1890
- },
1891
- queued_at: current.queued_at ?? measuredAt,
1892
- admission_reserved_at: undefined,
1893
- terminal_reason: undefined,
1894
- terminal_details: undefined,
1895
- }));
1896
- }
1897
- }
1898
1906
  const status = accountStatus(lane.provider, resolved.id, config, { existsSync, hostname });
1899
1907
  if (isLoggedOut(status)) {
1900
1908
  const failed = markPreSpawnFailure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.0",
3
+ "version": "5.345.1",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {