@indigoai-us/hq-cli 5.345.241 → 5.345.242

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 (116) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/assets/scaffold/core/scripts/hq-delegate-grant.sh +170 -8
  3. package/assets/scaffold/core/scripts/hq-delegate-publish.sh +21 -1
  4. package/assets/scaffold/core/scripts/lib/delegate-engine.sh +77 -0
  5. package/dist/command-catalog.generated.d.ts +28 -8
  6. package/dist/command-catalog.generated.js +33 -8
  7. package/dist/commands/cloud-off-gate.d.ts +7 -7
  8. package/dist/commands/cloud-off-gate.js +26 -38
  9. package/dist/commands/core-delegate-w1b.js +307 -26
  10. package/dist/commands/core-delegate.js +2 -0
  11. package/dist/commands/core-handoff.js +1 -1
  12. package/dist/commands/core-job-model-auth.d.ts +95 -0
  13. package/dist/commands/core-job-model-auth.js +247 -0
  14. package/dist/commands/core-job-run-native.js +280 -12
  15. package/dist/commands/core.js +1 -0
  16. package/dist/commands/files-browse.js +2 -0
  17. package/dist/commands/files.js +4 -0
  18. package/dist/commands/integrations-core.d.ts +11 -0
  19. package/dist/commands/integrations-core.js +15 -1
  20. package/dist/commands/lanes-link.js +2 -2
  21. package/dist/commands/lanes-loop.d.ts +2 -2
  22. package/dist/commands/lanes-loop.js +5 -5
  23. package/dist/commands/lanes-questions.js +1 -1
  24. package/dist/commands/lanes-stories.js +1 -1
  25. package/dist/commands/lanes.js +80 -14
  26. package/dist/commands/rescue.d.ts +3 -2
  27. package/dist/commands/rescue.js +48 -34
  28. package/dist/commands/search.d.ts +6 -0
  29. package/dist/commands/search.js +24 -4
  30. package/dist/commands/sources.js +6 -2
  31. package/dist/commands/sync-core.d.ts +8 -0
  32. package/dist/commands/sync-core.js +43 -0
  33. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +1737 -1450
  34. package/dist/hq-cloud-sync-runner/package.json +1 -1
  35. package/dist/lib/capacity/accounts.d.ts +1 -1
  36. package/dist/lib/capacity/accounts.js +1 -1
  37. package/dist/lib/capacity/freshness.d.ts +1 -1
  38. package/dist/lib/capacity/freshness.js +1 -1
  39. package/dist/lib/capacity/route.js +1 -1
  40. package/dist/lib/daemon/catalog.d.ts +3 -0
  41. package/dist/lib/daemon/hook-requests.d.ts +1 -1
  42. package/dist/lib/daemon/hook-requests.js +4 -2
  43. package/dist/lib/daemon/run.js +16 -22
  44. package/dist/lib/environment/work-requirements.d.ts +1 -1
  45. package/dist/lib/environment/work-requirements.js +1 -1
  46. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  47. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  48. package/dist/lib/hook-engine/coverage.js +11 -3
  49. package/dist/lib/hook-engine/git-stop-config.json +510 -510
  50. package/dist/lib/hook-engine/native-precompact-compatibility.json +443 -443
  51. package/dist/lib/hook-engine/native-stop-compatibility.json +359 -359
  52. package/dist/lib/hot-channels/adapters/meetings.d.ts +1 -16
  53. package/dist/lib/hot-channels/adapters/meetings.js +3 -28
  54. package/dist/lib/hot-channels/adapters/slack.d.ts +3 -1
  55. package/dist/lib/hot-channels/adapters/slack.js +4 -1
  56. package/dist/lib/hot-channels/contract.d.ts +14 -0
  57. package/dist/lib/hot-channels/fleet-complete.d.ts +18 -2
  58. package/dist/lib/hot-channels/fleet-complete.js +29 -4
  59. package/dist/lib/hot-channels/meeting-source-ref.d.ts +17 -0
  60. package/dist/lib/hot-channels/meeting-source-ref.js +32 -0
  61. package/dist/lib/hot-channels/prompts/signals-pass.md +6 -1
  62. package/dist/lib/hot-channels/run.d.ts +10 -0
  63. package/dist/lib/hot-channels/run.js +34 -0
  64. package/dist/lib/hot-channels/signals-pass.d.ts +27 -0
  65. package/dist/lib/hot-channels/signals-pass.js +57 -2
  66. package/dist/lib/hot-channels/signals-runtime.js +3 -2
  67. package/dist/lib/lanes/accounts.js +2 -2
  68. package/dist/lib/lanes/claude-balance.d.ts +6 -0
  69. package/dist/lib/lanes/claude-balance.js +124 -0
  70. package/dist/lib/lanes/grants.js +15 -2
  71. package/dist/lib/lanes/hq-root.d.ts +1 -1
  72. package/dist/lib/lanes/hq-root.js +1 -1
  73. package/dist/lib/lanes/links.d.ts +1 -1
  74. package/dist/lib/lanes/liveness.d.ts +3 -0
  75. package/dist/lib/lanes/liveness.js +61 -7
  76. package/dist/lib/lanes/models.d.ts +1 -1
  77. package/dist/lib/lanes/models.js +1 -1
  78. package/dist/lib/lanes/questions.d.ts +1 -1
  79. package/dist/lib/lanes/questions.js +2 -2
  80. package/dist/lib/lanes/spawn.js +4 -6
  81. package/dist/lib/lanes/store.d.ts +13 -2
  82. package/dist/lib/lanes/store.js +13 -5
  83. package/dist/lib/lanes/types.d.ts +7 -7
  84. package/dist/lib/lanes/types.js +1 -1
  85. package/dist/lib/lanes/watcher-main.js +1 -1
  86. package/dist/lib/lanes/watcher.d.ts +1 -1
  87. package/dist/lib/lanes/watcher.js +1 -1
  88. package/dist/lib/onboarding/cli/onboard.js +5 -0
  89. package/dist/lib/signals/sanitize.d.ts +19 -0
  90. package/dist/lib/signals/sanitize.js +103 -7
  91. package/dist/lib/signals/steps/upload.d.ts +40 -1
  92. package/dist/lib/signals/steps/upload.js +122 -6
  93. package/dist/lib/sync-core/access-refresh.d.ts +29 -0
  94. package/dist/lib/sync-core/access-refresh.js +97 -0
  95. package/dist/lib/sync-core/company-adoption.d.ts +33 -0
  96. package/dist/lib/sync-core/company-adoption.js +223 -0
  97. package/dist/lib/sync-core/engine-home.d.ts +1 -0
  98. package/dist/lib/sync-core/engine-owned.d.ts +13 -0
  99. package/dist/lib/sync-core/engine-owned.js +38 -0
  100. package/dist/lib/sync-core/hand-back.d.ts +17 -0
  101. package/dist/lib/sync-core/hand-back.js +23 -0
  102. package/dist/lib/sync-core/post-apply-reindex.d.ts +33 -0
  103. package/dist/lib/sync-core/post-apply-reindex.js +149 -0
  104. package/dist/lib/sync-core/reconcile.d.ts +10 -0
  105. package/dist/lib/sync-core/reconcile.js +117 -12
  106. package/dist/lib/sync-core/rollout-state.d.ts +2 -0
  107. package/dist/lib/sync-core/rollout-state.js +6 -0
  108. package/dist/lib/vault-sync-switches.d.ts +14 -0
  109. package/dist/lib/vault-sync-switches.js +22 -0
  110. package/dist/lib/workers-registry/index.d.ts +1 -1
  111. package/dist/lib/workers-registry/index.js +1 -1
  112. package/dist/utils/github-tag-fallback.d.ts +16 -0
  113. package/dist/utils/github-tag-fallback.js +126 -0
  114. package/dist/utils/version-report.d.ts +2 -1
  115. package/dist/utils/version-report.js +40 -27
  116. package/package.json +8 -8
@@ -1 +1 @@
1
- {"name":"hq-cli-daemon-sync-runner","type":"module","version":"6.18.117","bundleSha256":"425e7b51afda9223d469b19d2a657cd4ea6af5c2c0bbd1354b837dc682faecfc","formatVersion":1}
1
+ {"name":"hq-cli-daemon-sync-runner","type":"module","version":"6.18.118","bundleSha256":"7f7e31221249ffacdaee78e883c2d2e761d189b251d6cb8b57824e97ee185d2f","formatVersion":1}
@@ -23,7 +23,7 @@ export interface CapacityAccount {
23
23
  * `disabled_reason` that marks a registry account as capacity-only. Signing in
24
24
  * for usage visibility must not opt an account into lane work, because lanes
25
25
  * spread work across every enabled account and the accounts can belong to
26
- * different companies. `hq lanes accounts enable` opts one in.
26
+ * different companies. `hq runners accounts enable` opts one in.
27
27
  */
28
28
  export declare const CAPACITY_ONLY_REASON = "capacity-only: read for usage, not used by lanes";
29
29
  export interface ListCapacityAccountsOptions {
@@ -17,7 +17,7 @@ import { LANE_PROVIDERS } from "../lanes/types.js";
17
17
  * `disabled_reason` that marks a registry account as capacity-only. Signing in
18
18
  * for usage visibility must not opt an account into lane work, because lanes
19
19
  * spread work across every enabled account and the accounts can belong to
20
- * different companies. `hq lanes accounts enable` opts one in.
20
+ * different companies. `hq runners accounts enable` opts one in.
21
21
  */
22
22
  export const CAPACITY_ONLY_REASON = "capacity-only: read for usage, not used by lanes";
23
23
  const DEFAULT_DIR = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Capacity view freshness. Kept in lib (not commands/capacity.ts) so resident
3
- * paths such as `hq lanes` can check staleness without pulling in the capacity
3
+ * paths such as `hq runners` can check staleness without pulling in the capacity
4
4
  * command module and its lazy collector imports.
5
5
  */
6
6
  /** now.json older than this is stale: the collector is not keeping the view current. */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Capacity view freshness. Kept in lib (not commands/capacity.ts) so resident
3
- * paths such as `hq lanes` can check staleness without pulling in the capacity
3
+ * paths such as `hq runners` can check staleness without pulling in the capacity
4
4
  * command module and its lazy collector imports.
5
5
  */
6
6
  /** now.json older than this is stale: the collector is not keeping the view current. */
@@ -1,6 +1,6 @@
1
1
  import { codexSnapshotStale, hasCodexCreditRoom } from "./codex-availability.js";
2
2
  /**
3
- * Pure router for `hq capacity route` and `hq lanes create --account auto`.
3
+ * Pure router for `hq capacity route` and `hq runners create --account auto`.
4
4
  *
5
5
  * Port of personal/skills/boss-mode/boss-route.mjs into hq-cli. Owner decision
6
6
  * 2026-10-11: all accounts are one pool across companies; the pick names the
@@ -12,6 +12,7 @@
12
12
  import type { MachineType } from "./machine-type.js";
13
13
  import type { SyncOwner, DaemonConfig } from "./config.js";
14
14
  import { type SyncCoreVaultPlan } from "../sync-core/engine-home.js";
15
+ import type { HandBackVault } from "../sync-core/hand-back.js";
15
16
  import type { RemoteControlPoolsConfig } from "./remote-control-pools.js";
16
17
  import { type SyncRunnerProcess } from "./sync-runner.js";
17
18
  import { type VaultSyncSwitches } from "../vault-sync-switches.js";
@@ -187,6 +188,8 @@ export interface PlanContext {
187
188
  /** Persisted/effective owner selected for this machine. */
188
189
  syncOwner: SyncOwner;
189
190
  syncCoreVaults?: readonly SyncCoreVaultPlan[];
191
+ /** Full vaults leaving the engine (rollout.json handingBack), returned to the current sync once their engine has stopped. */
192
+ syncCoreHandingBack?: readonly HandBackVault[];
190
193
  syncCoreRunning?: SyncCoreRunning;
191
194
  legacySyncReadyForCore?: boolean;
192
195
  legacySyncHolder?: LegacySyncHolder;
@@ -89,7 +89,7 @@ export type HookOperation = {
89
89
  * adapter's payload is the note's `.body` file (`host::fleet_settings`). */
90
90
  | {
91
91
  kind: "fleet-local-settings";
92
- event: "PostToolUse" | "SessionEnd";
92
+ event: "PostToolUse" | "SessionEnd" | "SubagentStop";
93
93
  commands: FleetLocalSettingsCommand[];
94
94
  }
95
95
  /** The Work Mesh register step of a mid-session company bind (`spawn_work_mesh_register`, owner decision 36). */
@@ -332,11 +332,13 @@ export function parseHookRequest(text, stem) {
332
332
  }
333
333
  return { stem, id: value.id, at, root: value.hqRoot, session: value.session, operation };
334
334
  }
335
- /** The args of a `fleet-local-settings` note: exactly `event` (PostToolUse or SessionEnd) and 1 to 64 typed commands. */
335
+ /** The args of a `fleet-local-settings` note: exactly `event` (PostToolUse, SessionEnd or SubagentStop) and 1 to 64 typed commands. */
336
336
  function parseFleetLocalSettings(args) {
337
337
  const keys = Object.keys(args).sort();
338
338
  const event = args.event;
339
- if (keys.length !== 2 || keys[0] !== "commands" || keys[1] !== "event" || (event !== "PostToolUse" && event !== "SessionEnd"))
339
+ if (keys.length !== 2 || keys[0] !== "commands" || keys[1] !== "event")
340
+ return undefined;
341
+ if (event !== "PostToolUse" && event !== "SessionEnd" && event !== "SubagentStop")
340
342
  return undefined;
341
343
  const list = args.commands;
342
344
  if (!Array.isArray(list) || list.length === 0 || list.length > FLEET_LOCAL_SETTINGS_MAX_COMMANDS)
@@ -30,9 +30,10 @@ import { createLegacyHandover, LEGACY_HANDOVER_STUCK_FILE, writeLegacyHandoverSt
30
30
  import { effectiveSyncOwner, readDaemonConfig } from "./config.js";
31
31
  import { backgroundQosCommand } from "./background-qos.js";
32
32
  import { serveQmdWorker } from "../search-index/worker-process.js";
33
- import { inspectEngineHome } from "../sync-core/engine-home.js";
33
+ import { inspectEngineHome, syncCoreUnitId } from "../sync-core/engine-home.js";
34
34
  import { fullModeHold } from "../sync-core/reconcile.js";
35
35
  import { engineVaultCount, readSyncCoreRolloutState } from "../sync-core/rollout-state.js";
36
+ import { engineOwnsVault, finishLegacyHandBack } from "../sync-core/hand-back.js";
36
37
  import { effectiveEngineSettings, readSyncCoreVaultSettings } from "../sync-core/vault-settings.js";
37
38
  import { assertPersonalServiceSessionCapability, readRemoteControlPoolsConfig, remoteControlPoolSecretsEnv, } from "./remote-control-pools.js";
38
39
  import { loadLanesConfig } from "../lanes/config.js";
@@ -48,7 +49,7 @@ import { createLanesReconcileWatcher } from "./lanes-reconcile-watcher.js";
48
49
  import { createLanesReconcileStatus, withLanesReconcileUnit } from "./lanes-reconcile-status.js";
49
50
  import { findLegacyUnits, legacyMeshUnitsToRetire, legacyOwnerLookup, } from "./legacy.js";
50
51
  import { readLegacySyncEnv } from "./legacy-sync-env.js";
51
- import { readVaultSwitchOnTimes, readVaultSyncSwitches, unreadableSwitchesWarning, writeVaultSyncSwitches } from "../vault-sync-switches.js";
52
+ import { legacySwitchRestorePatch, readVaultSwitchOnTimes, readVaultSyncSwitches, unreadableSwitchesWarning } from "../vault-sync-switches.js";
52
53
  import { scheduleDaemonPlistRefresh } from "./plist-refresh.js";
53
54
  import { acquireDaemonLock, isProcessAlive, processCommandLine, releaseDaemonLock } from "./lock.js";
54
55
  import { retireLegacyMeshUnits } from "./migrate.js";
@@ -108,6 +109,7 @@ export function syncCoreVaultPlans(home, hqRoot, platform) {
108
109
  binaryPath: state.binaryPath,
109
110
  release: state.release,
110
111
  ...(vault.legacyOffSince ? { legacyOffSince: vault.legacyOffSince } : {}),
112
+ ...(vault.legacyAlreadyOff ? { legacyAlreadyOff: true } : {}),
111
113
  ...(effective ? { settings: effective } : {}),
112
114
  }, platform);
113
115
  const releaseHold = vault.phase === "full" ? fullModeHold(vault, state.release, platform) : undefined;
@@ -140,27 +142,18 @@ export function planUnitsWithSyncCoreInterlock(services, context, supervisor, re
140
142
  if (context.vaultSync && !context.vaultSync.allOff) {
141
143
  let personalOff = context.vaultSync.personalOff;
142
144
  const offCompanies = new Set(context.vaultSync.offCompanies);
143
- let restorePersonal = false;
144
- const restoreCompanies = {};
145
- for (const vault of context.syncCoreVaults ?? []) {
146
- if (vault.phase !== "full" || runningVaults.has(vault.uid) || !fullModeHold(vault, vault.release, context.platform))
147
- continue;
148
- if (vault.kind === "personal") {
149
- restorePersonal = personalOff;
150
- personalOff = false;
151
- }
152
- else if (vault.slug) {
153
- if (offCompanies.has(vault.slug))
154
- restoreCompanies[vault.slug] = true;
155
- offCompanies.delete(vault.slug);
156
- }
157
- }
158
- if (restorePersonal || Object.keys(restoreCompanies).length > 0) {
145
+ const engineStopped = (uid) => !!supervisor && supervisor.runningPlanKey(syncCoreUnitId(uid)) === undefined;
146
+ const held = (context.syncCoreVaults ?? []).filter((vault) => vault.phase === "full" && engineStopped(vault.uid) && fullModeHold(vault, vault.release, context.platform));
147
+ const handingBack = (context.syncCoreHandingBack ?? []).filter((vault) => engineStopped(vault.uid) && engineOwnsVault(context.home, vault.uid));
148
+ const handBack = [...held, ...handingBack];
149
+ const restore = legacySwitchRestorePatch(handBack, context.vaultSync);
150
+ if (restore.personal)
151
+ personalOff = false;
152
+ for (const slug of Object.keys(restore.companies))
153
+ offCompanies.delete(slug);
154
+ if (handBack.length > 0) {
159
155
  try {
160
- writeVaultSyncSwitches(context.home, {
161
- ...(restorePersonal ? { personal: true } : {}),
162
- companies: restoreCompanies,
163
- });
156
+ finishLegacyHandBack(context.home, handBack, context.vaultSync);
164
157
  }
165
158
  catch {
166
159
  fallbackPersistenceFailed = true;
@@ -1616,6 +1609,7 @@ export async function runDaemon(opts) {
1616
1609
  })(),
1617
1610
  syncOwner,
1618
1611
  syncCoreVaults: syncCoreVaultPlans(home, hqRoot, platform),
1612
+ syncCoreHandingBack: readSyncCoreRolloutState(home)?.handingBack ?? [],
1619
1613
  desktopAppManagesSync: appManagesSync,
1620
1614
  legacySyncUnitManagesSync: legacy.some((u) => u.service === "sync" && !u.migratable),
1621
1615
  syncRunnerProcesses,
@@ -161,7 +161,7 @@ export declare const DERIVED_WORK_SIZE: {
161
161
  */
162
162
  export declare function deriveWorkRequirements(input: DeriveWorkRequirementsInput): WorkRequirements;
163
163
  /**
164
- * A derived document after the work's company was repaired (hq lanes
164
+ * A derived document after the work's company was repaired (hq runners
165
165
  * repair-company). The company and the company line of derived_from are
166
166
  * replaced; a slug outside the schema pattern leaves the document as it is.
167
167
  */
@@ -371,7 +371,7 @@ export function deriveWorkRequirements(input) {
371
371
  return document;
372
372
  }
373
373
  /**
374
- * A derived document after the work's company was repaired (hq lanes
374
+ * A derived document after the work's company was repaired (hq runners
375
375
  * repair-company). The company and the company line of derived_from are
376
376
  * replaced; a slug outside the schema pattern leaves the document as it is.
377
377
  */