@indigoai-us/hq-cli 5.345.221 → 5.345.222

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 (64) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/dist/command-catalog.generated.d.ts +31 -0
  3. package/dist/command-catalog.generated.js +38 -0
  4. package/dist/commands/auth.js +2 -1
  5. package/dist/commands/core-delegate-w1b.js +9 -3
  6. package/dist/commands/daemon.d.ts +1 -0
  7. package/dist/commands/daemon.js +15 -1
  8. package/dist/commands/link.d.ts +2 -0
  9. package/dist/commands/link.js +14 -2
  10. package/dist/commands/mesh.js +23 -3
  11. package/dist/commands/sync-core.d.ts +6 -0
  12. package/dist/commands/sync-core.js +55 -0
  13. package/dist/data/command-states.json +3 -0
  14. package/dist/lib/daemon/catalog.js +2 -0
  15. package/dist/lib/daemon/install.d.ts +2 -1
  16. package/dist/lib/daemon/install.js +9 -0
  17. package/dist/lib/daemon/legacy.d.ts +1 -0
  18. package/dist/lib/daemon/legacy.js +5 -2
  19. package/dist/lib/daemon/machine-check-owner.d.ts +2 -0
  20. package/dist/lib/daemon/machine-check-owner.js +6 -1
  21. package/dist/lib/daemon/machine-checks.d.ts +7 -1
  22. package/dist/lib/daemon/machine-checks.js +10 -1
  23. package/dist/lib/daemon/mesh-owner.d.ts +45 -0
  24. package/dist/lib/daemon/mesh-owner.js +166 -0
  25. package/dist/lib/daemon/native-notice-ledger.d.ts +27 -0
  26. package/dist/lib/daemon/native-notice-ledger.js +113 -0
  27. package/dist/lib/daemon/run.d.ts +15 -0
  28. package/dist/lib/daemon/run.js +71 -3
  29. package/dist/lib/daemon/selfcheck.d.ts +35 -2
  30. package/dist/lib/daemon/selfcheck.js +118 -9
  31. package/dist/lib/hook-engine/coverage.d.ts +9 -0
  32. package/dist/lib/hook-engine/coverage.js +56 -0
  33. package/dist/lib/hook-engine/native-stop-compatibility.json +56 -5
  34. package/dist/lib/mesh/live/daemon/config.d.ts +8 -1
  35. package/dist/lib/mesh/live/daemon/config.js +16 -0
  36. package/dist/lib/mesh/live/daemon/install.d.ts +31 -2
  37. package/dist/lib/mesh/live/daemon/install.js +142 -1
  38. package/dist/lib/mesh/live/daemon/login-home.d.ts +5 -0
  39. package/dist/lib/mesh/live/daemon/login-home.js +27 -0
  40. package/dist/lib/mesh/live/daemon/unit-home.d.ts +49 -0
  41. package/dist/lib/mesh/live/daemon/unit-home.js +134 -0
  42. package/dist/lib/registry/registry.d.ts +35 -7
  43. package/dist/lib/registry/registry.js +88 -13
  44. package/dist/lib/scan-packages/index.js +24 -2
  45. package/dist/lib/search-index/max-doc-bytes.js +2 -1
  46. package/dist/lib/service-manager/startup-migration.d.ts +1 -0
  47. package/dist/lib/service-manager/startup-migration.js +3 -0
  48. package/dist/lib/sync-core/engine-holds.d.ts +14 -0
  49. package/dist/lib/sync-core/engine-holds.js +60 -0
  50. package/dist/lib/sync-core/engine-home.d.ts +2 -0
  51. package/dist/lib/sync-core/reconcile.js +8 -0
  52. package/dist/lib/sync-core/vault-settings.d.ts +21 -0
  53. package/dist/lib/sync-core/vault-settings.js +131 -0
  54. package/dist/lib/windows/install-followup.d.ts +2 -0
  55. package/dist/lib/windows/install-followup.js +4 -1
  56. package/dist/utils/host-registration.js +3 -1
  57. package/dist/utils/pack-contributions.d.ts +3 -0
  58. package/dist/utils/pack-contributions.js +110 -23
  59. package/dist/utils/self-update.d.ts +3 -1
  60. package/dist/utils/self-update.js +56 -11
  61. package/dist/utils/update-lock.d.ts +151 -14
  62. package/dist/utils/update-lock.js +782 -46
  63. package/dist/utils/version-gate.js +12 -2
  64. package/package.json +7 -7
@@ -42,7 +42,7 @@ import { isVersionRequest } from "../version-request.js";
42
42
  import { Sentry } from "../sentry.js";
43
43
  import { isCliTelemetryDisabled } from "./cli-telemetry.js";
44
44
  import { DEFAULT_VAULT_API_URL } from "./cognito-session.js";
45
- import { acquireUpdateLock, } from "./update-lock.js";
45
+ import { acquireUpdateLock, STARTUP_TAKEOVER_WAIT_MS, } from "./update-lock.js";
46
46
  import { HQ_CLI_NPM_UPDATE_COMMAND, hqCliNpmInstallCommand, npmGlobalInstallArgv } from "./npm-install-flags.js";
47
47
  /** Prevent an update package manager's lifecycle child from starting another updater. */
48
48
  export const UPDATE_RECURSION_GUARD_ENV = "HQ_RESCUE_SELF_UPDATED";
@@ -1825,12 +1825,22 @@ function enforceUpdateRequired(decision, deps = {}) {
1825
1825
  // for the cross-repo contract. A fresh holder means someone else is already
1826
1826
  // installing the version we want: skip and continue on the current version
1827
1827
  // (the gate must never break the CLI).
1828
- const lock = (deps.acquireLock ?? acquireUpdateLock)();
1828
+ // Start-up path: a short mutex wait, so a wedged takeover mutex costs every
1829
+ // command at most a second instead of ten.
1830
+ const lock = deps.acquireLock
1831
+ ? deps.acquireLock()
1832
+ : acquireUpdateLock({ takeoverWaitMs: STARTUP_TAKEOVER_WAIT_MS });
1829
1833
  if (!lock) {
1830
1834
  console.error(chalk.dim(" Another hq updater is already installing (update lock held); continuing on the current version."));
1831
1835
  return;
1832
1836
  }
1833
1837
  currentVersionGatePhase = "lock_acquired";
1838
+ // A racing taker may have moved our lock between acquisition and now.
1839
+ if (typeof lock.stillHeld === "function" && !lock.stillHeld()) {
1840
+ lock.release();
1841
+ console.error(chalk.dim(" Another hq updater took over the update lock; continuing on the current version."));
1842
+ return;
1843
+ }
1834
1844
  let attempt;
1835
1845
  try {
1836
1846
  attempt = attemptRequiredUpdate(decision, deps, install);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.221",
3
+ "version": "5.345.222",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -124,11 +124,11 @@
124
124
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
125
125
  },
126
126
  "optionalDependencies": {
127
- "@indigoai-us/hq-hook-win32-x64": "5.345.221",
128
- "@indigoai-us/hq-hook-win32-arm64": "5.345.221",
129
- "@indigoai-us/hq-hook-darwin-x64": "5.345.221",
130
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.221",
131
- "@indigoai-us/hq-hook-linux-x64": "5.345.221",
132
- "@indigoai-us/hq-hook-linux-arm64": "5.345.221"
127
+ "@indigoai-us/hq-hook-win32-x64": "5.345.222",
128
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.222",
129
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.222",
130
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.222",
131
+ "@indigoai-us/hq-hook-linux-x64": "5.345.222",
132
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.222"
133
133
  }
134
134
  }