@indigoai-us/hq-cli 5.345.252 → 5.345.254

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 (67) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/contracts/host-canary-release.json +11 -5
  3. package/dist/command-catalog.generated.d.ts +209 -0
  4. package/dist/command-catalog.generated.js +257 -0
  5. package/dist/command-registration-plan.d.ts +6 -0
  6. package/dist/command-registration-plan.js +1 -0
  7. package/dist/commands/ci-intake.d.ts +32 -0
  8. package/dist/commands/ci-intake.js +294 -0
  9. package/dist/commands/ci-metrics.d.ts +8 -0
  10. package/dist/commands/ci-metrics.js +55 -0
  11. package/dist/commands/ci-priorities.d.ts +56 -0
  12. package/dist/commands/ci-priorities.js +144 -0
  13. package/dist/commands/ci.d.ts +13 -0
  14. package/dist/commands/ci.js +11 -0
  15. package/dist/commands/cloud.d.ts +11 -0
  16. package/dist/commands/cloud.js +76 -0
  17. package/dist/commands/files.d.ts +62 -0
  18. package/dist/commands/files.js +249 -8
  19. package/dist/lib/bot/fleet-cron.d.ts +15 -0
  20. package/dist/lib/bot/fleet-cron.js +119 -20
  21. package/dist/lib/daemon/run.js +4 -3
  22. package/dist/lib/daemon/verified-jq.d.ts +6 -0
  23. package/dist/lib/daemon/verified-jq.js +17 -5
  24. package/dist/lib/delivery/migrations.d.ts +32 -1
  25. package/dist/lib/delivery/migrations.js +69 -8
  26. package/dist/lib/hook-engine/adapter-core-pin.d.ts +2 -1
  27. package/dist/lib/hook-engine/adapter-core-pin.js +2 -1
  28. package/dist/lib/hook-engine/coverage.d.ts +15 -0
  29. package/dist/lib/hook-engine/coverage.js +62 -1
  30. package/dist/lib/hook-engine/fleet-registration.d.ts +4 -0
  31. package/dist/lib/hook-engine/fleet-registration.js +25 -3
  32. package/dist/lib/smart-ci/cost.d.ts +72 -0
  33. package/dist/lib/smart-ci/cost.js +120 -0
  34. package/dist/lib/smart-ci/github.d.ts +112 -0
  35. package/dist/lib/smart-ci/github.js +267 -0
  36. package/dist/lib/smart-ci/intake.d.ts +288 -0
  37. package/dist/lib/smart-ci/intake.js +1078 -0
  38. package/dist/lib/smart-ci/ledger.d.ts +218 -0
  39. package/dist/lib/smart-ci/ledger.js +527 -0
  40. package/dist/lib/smart-ci/metrics.d.ts +137 -0
  41. package/dist/lib/smart-ci/metrics.js +249 -0
  42. package/dist/lib/smart-ci/priorities.d.ts +331 -0
  43. package/dist/lib/smart-ci/priorities.js +964 -0
  44. package/dist/lib/smart-ci/priority-refresh.d.ts +192 -0
  45. package/dist/lib/smart-ci/priority-refresh.js +366 -0
  46. package/dist/lib/smart-ci/priority-snapshots.d.ts +88 -0
  47. package/dist/lib/smart-ci/priority-snapshots.js +233 -0
  48. package/dist/lib/smart-ci/records.d.ts +265 -0
  49. package/dist/lib/smart-ci/records.js +281 -0
  50. package/dist/lib/smart-ci/reducer.d.ts +67 -0
  51. package/dist/lib/smart-ci/reducer.js +261 -0
  52. package/dist/lib/smart-ci/sources.d.ts +294 -0
  53. package/dist/lib/smart-ci/sources.js +659 -0
  54. package/dist/lib/smart-ci/text.d.ts +24 -0
  55. package/dist/lib/smart-ci/text.js +83 -0
  56. package/dist/lib/smart-ci/work-in-flight.d.ts +68 -0
  57. package/dist/lib/smart-ci/work-in-flight.js +154 -0
  58. package/dist/lib/sync/cli-manifest-reconcile.d.ts +20 -0
  59. package/dist/lib/sync/cli-manifest-reconcile.js +170 -0
  60. package/dist/lib/sync-core/engine-holds.d.ts +14 -0
  61. package/dist/lib/sync-core/engine-holds.js +78 -11
  62. package/dist/lib/sync-core/hand-back.d.ts +1 -0
  63. package/dist/lib/sync-core/hand-back.js +7 -2
  64. package/dist/lib/sync-core/reconcile.js +10 -2
  65. package/dist/utils/host-registration.d.ts +1 -0
  66. package/dist/utils/host-registration.js +1 -1
  67. package/package.json +9 -7
@@ -2,11 +2,15 @@ import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { legacySwitchRestorePatch, writeVaultSyncSwitches } from "../vault-sync-switches.js";
4
4
  import { removeEngineOwnership, syncCoreEngineHome } from "./engine-home.js";
5
+ import { readEngineHeldLocalBodies } from "./engine-holds.js";
5
6
  import { removeLegacyJournalExport } from "./legacy-journal-export.js";
6
7
  const reportedRemovalFailures = new Set();
7
8
  export function engineOwnsVault(home, uid) {
8
9
  return fs.existsSync(path.join(syncCoreEngineHome(home, uid), ".hq", "sync-core", "owned", `${uid}.json`));
9
10
  }
11
+ export function engineHoldBlocksHandBack(home, uid) {
12
+ return readEngineHeldLocalBodies(syncCoreEngineHome(home, uid), uid) !== null;
13
+ }
10
14
  /**
11
15
  * Returns vaults whose engine has stopped to the current sync: turns the
12
16
  * old-sync switch back on (not for a vault the user had off before the move),
@@ -15,10 +19,11 @@ export function engineOwnsVault(home, uid) {
15
19
  * before removing any record when menubar.json cannot be written.
16
20
  */
17
21
  export function finishLegacyHandBack(home, vaults, switches, warn = (line) => void process.stderr.write(`${line}\n`), removeExport = removeLegacyJournalExport) {
18
- const patch = legacySwitchRestorePatch(vaults, switches);
22
+ const ready = vaults.filter((vault) => !engineHoldBlocksHandBack(home, vault.uid));
23
+ const patch = legacySwitchRestorePatch(ready, switches);
19
24
  if (patch.personal || Object.keys(patch.companies).length > 0)
20
25
  writeVaultSyncSwitches(home, patch);
21
- for (const vault of vaults) {
26
+ for (const vault of ready) {
22
27
  const key = `${home}\0${vault.uid}`;
23
28
  try {
24
29
  removeExport(home, vault);
@@ -7,7 +7,7 @@ import { clearEngineStatus, engineFirstCycle, isSyncCoreVaultUid, removeEngineOw
7
7
  import { SYNC_CORE_FULL_RELEASE, SYNC_CORE_RELEASE, compareSyncCoreReleases, fullModeAllowed, installedSyncCoreRelease, syncCoreBinaryPath, windowsFullRelease, } from "./release.js";
8
8
  import { readSyncCoreSkips } from "./skip.js";
9
9
  import { isLiveCompanyEntity, joinedCompanySlug, setUpJoinedCompany } from "./company-adoption.js";
10
- import { heldDeletesHandoverLine, readEngineHeldDeletes, writeHandbackKeep } from "./engine-holds.js";
10
+ import { heldDeletesHandoverLine, heldLocalBodiesHandoverLine, readEngineHeldDeletes, readEngineHeldLocalBodies, writeHandbackKeep } from "./engine-holds.js";
11
11
  import { dropStaleLegacyJournalExport, legacyJournalDirs, legacyJournalExportState, markLegacyJournalExportStale, removeLegacyJournalExport, writeLegacyJournalExport, } from "./legacy-journal-export.js";
12
12
  import { SYNC_RUST_ENGINE_ROLLOUT_FLAG } from "./flag.js";
13
13
  import { readSyncCoreRolloutState, syncCoreRolloutStatePath, writeSyncCoreRolloutState, } from "./rollout-state.js";
@@ -400,7 +400,10 @@ export async function reconcileSyncCore(deps) {
400
400
  warnings.push(`could not record the ${heldDeletes.count} deletes the new sync engine held for ${vault.uid}; the current sync may apply them: ${message(error)}`);
401
401
  }
402
402
  }
403
- if (heldDeletes)
403
+ const heldLocalBodies = readEngineHeldLocalBodies(engineHome, vault.uid);
404
+ if (heldLocalBodies)
405
+ handover.push(heldLocalBodiesHandoverLine(vault.uid, heldLocalBodies));
406
+ else if (heldDeletes)
404
407
  handover.push(heldDeletesHandoverLine(vault.uid, heldDeletes, engineHome, deps.home));
405
408
  handedBack.push(vault);
406
409
  }
@@ -410,6 +413,11 @@ export async function reconcileSyncCore(deps) {
410
413
  && !handedBack.some((back) => back.uid === vault.uid)
411
414
  && engineOwnsVault(deps.home, vault.uid)),
412
415
  ];
416
+ for (const vault of handingBack) {
417
+ const heldLocalBodies = readEngineHeldLocalBodies(syncCoreEngineHome(deps.home, vault.uid), vault.uid);
418
+ if (heldLocalBodies)
419
+ warnings.push(heldLocalBodiesHandoverLine(vault.uid, heldLocalBodies));
420
+ }
413
421
  for (const company of companiesHere) {
414
422
  if (desired.some((vault) => vault.uid === company.uid) || handingBack.some((vault) => vault.uid === company.uid))
415
423
  continue;
@@ -51,6 +51,7 @@ export interface EngineCapabilities {
51
51
  events: Record<string, string[]>;
52
52
  /** The old dispatcher's hooks the engine does in full, per event; empty for an engine that does not say. */
53
53
  covers?: Record<string, string[]>;
54
+ handBackQuery?: string;
54
55
  }
55
56
  /** Evaluators `event` needs that `caps` lacks; null when the event has no switch rule. */
56
57
  export declare function missingEvaluators(caps: EngineCapabilities, event: string): string[] | null;
@@ -152,7 +152,7 @@ export function probeEngine(engine) {
152
152
  covers[event] = Array.isArray(ids) ? ids.filter((id) => typeof id === 'string') : [];
153
153
  }
154
154
  }
155
- return { version: version.slice('hq-hook '.length), events, covers, registrationHosts: doc.registration_hosts };
155
+ return { version: version.slice('hq-hook '.length), events, covers, registrationHosts: doc.registration_hosts, ...(typeof doc.hand_back_query === 'string' ? { handBackQuery: doc.hand_back_query } : {}) };
156
156
  }
157
157
  /**
158
158
  * Check that the stable path resolves to the pinned engine before a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.252",
3
+ "version": "5.345.254",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -55,6 +55,8 @@
55
55
  "postinstall": "node scripts/install-hook-engine.mjs || node -e \"process.exit(0)\"",
56
56
  "prepare": "husky || true",
57
57
  "check:no-hermes": "bash scripts/check-no-hermes.sh",
58
+ "changelog:check": "node scripts/changelog-fragment.mjs check",
59
+ "changelog:new": "node scripts/changelog-fragment.mjs new",
58
60
  "prepack": "node scripts/hook-engine-manifest.mjs",
59
61
  "postpublish": "node scripts/hook-engine-manifest.mjs restore",
60
62
  "build:ci": "node scripts/prepare-fixture-privacy-baseline.mjs && pnpm run build"
@@ -126,11 +128,11 @@
126
128
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
127
129
  },
128
130
  "optionalDependencies": {
129
- "@indigoai-us/hq-hook-win32-x64": "5.345.252",
130
- "@indigoai-us/hq-hook-win32-arm64": "5.345.252",
131
- "@indigoai-us/hq-hook-darwin-x64": "5.345.252",
132
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.252",
133
- "@indigoai-us/hq-hook-linux-x64": "5.345.252",
134
- "@indigoai-us/hq-hook-linux-arm64": "5.345.252"
131
+ "@indigoai-us/hq-hook-win32-x64": "5.345.254",
132
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.254",
133
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.254",
134
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.254",
135
+ "@indigoai-us/hq-hook-linux-x64": "5.345.254",
136
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.254"
135
137
  }
136
138
  }