@indigoai-us/hq-cli 5.345.215-beta.0 → 5.345.217

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 (241) hide show
  1. package/CHANGELOG.md +206 -1
  2. package/README.md +45 -0
  3. package/assets/scaffold/core/scripts/hq-delegate-verify.sh +5 -2
  4. package/assets/scaffold/core/scripts/lib/epochrealtime.sh +30 -0
  5. package/assets/scaffold/core/scripts/lib/work-mesh-enqueue.sh +12 -5
  6. package/dist/command-catalog.generated.d.ts +105 -10
  7. package/dist/command-catalog.generated.js +127 -10
  8. package/dist/command-help.js +3 -1
  9. package/dist/command-registration-plan.d.ts +6 -0
  10. package/dist/command-registration-plan.js +1 -0
  11. package/dist/commands/auth.d.ts +1 -1
  12. package/dist/commands/auth.js +11 -52
  13. package/dist/commands/bot.js +75 -10
  14. package/dist/commands/capacity.d.ts +4 -1
  15. package/dist/commands/capacity.js +46 -10
  16. package/dist/commands/cloud-demote.d.ts +19 -4
  17. package/dist/commands/cloud-demote.js +85 -12
  18. package/dist/commands/cloud-provision.d.ts +5 -1
  19. package/dist/commands/cloud-provision.js +6 -2
  20. package/dist/commands/cloud.d.ts +36 -0
  21. package/dist/commands/cloud.js +110 -27
  22. package/dist/commands/core-delegate-w1b.js +15 -1
  23. package/dist/commands/core-policy.js +67 -8
  24. package/dist/commands/core.js +1 -0
  25. package/dist/commands/daemon.js +9 -1
  26. package/dist/commands/dm.js +7 -0
  27. package/dist/commands/doctor-usage.d.ts +8 -0
  28. package/dist/commands/doctor-usage.js +20 -0
  29. package/dist/commands/doctor.js +7 -1
  30. package/dist/commands/env.d.ts +18 -0
  31. package/dist/commands/env.js +82 -0
  32. package/dist/commands/files-browse.d.ts +11 -4
  33. package/dist/commands/files-browse.js +21 -4
  34. package/dist/commands/files.d.ts +1 -1
  35. package/dist/commands/files.js +25 -11
  36. package/dist/commands/install-global.js +2 -2
  37. package/dist/commands/integrations-auth-rules.d.ts +27 -0
  38. package/dist/commands/integrations-auth-rules.js +79 -0
  39. package/dist/commands/integrations-import.js +124 -12
  40. package/dist/commands/lanes.js +102 -26
  41. package/dist/commands/logout.d.ts +7 -0
  42. package/dist/commands/logout.js +41 -34
  43. package/dist/commands/mesh.d.ts +2 -0
  44. package/dist/commands/mesh.js +60 -35
  45. package/dist/commands/sources.d.ts +8 -2
  46. package/dist/commands/sources.js +65 -9
  47. package/dist/commands/sync-held.js +5 -2
  48. package/dist/commands/whoami.js +26 -1
  49. package/dist/data/command-states.json +15 -0
  50. package/dist/index.js +52 -4
  51. package/dist/lazy-commands.js +5 -6
  52. package/dist/lib/anywhere-person-setting.d.ts +2 -0
  53. package/dist/lib/anywhere-person-setting.js +6 -3
  54. package/dist/lib/billing/usage-card.d.ts +25 -4
  55. package/dist/lib/billing/usage-card.js +76 -9
  56. package/dist/lib/billing/usage-cost.d.ts +3 -3
  57. package/dist/lib/billing/usage-cost.js +35 -13
  58. package/dist/lib/billing/usage-only.js +4 -2
  59. package/dist/lib/billing/usage-rate-card.d.ts +2 -2
  60. package/dist/lib/billing/usage-rate-card.js +3 -0
  61. package/dist/lib/bot/fleet-cron.d.ts +8 -0
  62. package/dist/lib/bot/fleet-cron.js +126 -7
  63. package/dist/lib/bot/fleet-daemon.d.ts +46 -0
  64. package/dist/lib/bot/fleet-daemon.js +99 -1
  65. package/dist/lib/bot/inflight.d.ts +9 -0
  66. package/dist/lib/bot/inflight.js +10 -0
  67. package/dist/lib/bot/jobs/hot-signal-sync.js +12 -1
  68. package/dist/lib/bot/probe.js +7 -1
  69. package/dist/lib/bot/run.js +20 -1
  70. package/dist/lib/bot/runtime/codex.js +1 -1
  71. package/dist/lib/bot/runtime/grok-acp.d.ts +6 -1
  72. package/dist/lib/bot/runtime/grok-acp.js +32 -14
  73. package/dist/lib/bot/runtime/grok.js +1 -1
  74. package/dist/lib/bot/runtime/index.js +19 -9
  75. package/dist/lib/bot/runtime/messages-stream.js +2 -2
  76. package/dist/lib/bot/runtime/types.d.ts +15 -0
  77. package/dist/lib/bot/runtime/types.js +9 -0
  78. package/dist/lib/bot/runtime-failure.d.ts +23 -0
  79. package/dist/lib/bot/runtime-failure.js +43 -1
  80. package/dist/lib/capacity/accounts.d.ts +8 -0
  81. package/dist/lib/capacity/accounts.js +19 -0
  82. package/dist/lib/capacity/available.d.ts +154 -0
  83. package/dist/lib/capacity/available.js +905 -0
  84. package/dist/lib/capacity/codex-availability.d.ts +14 -1
  85. package/dist/lib/capacity/codex-availability.js +26 -1
  86. package/dist/lib/capacity/collectors/claude-oauth.d.ts +29 -2
  87. package/dist/lib/capacity/collectors/claude-oauth.js +104 -7
  88. package/dist/lib/capacity/collectors/codex.js +10 -7
  89. package/dist/lib/capacity/ledger.d.ts +37 -1
  90. package/dist/lib/capacity/ledger.js +207 -30
  91. package/dist/lib/capacity/project.d.ts +26 -0
  92. package/dist/lib/capacity/project.js +137 -8
  93. package/dist/lib/capacity/refusal-rows.d.ts +31 -0
  94. package/dist/lib/capacity/refusal-rows.js +61 -0
  95. package/dist/lib/capacity/refusal.d.ts +53 -2
  96. package/dist/lib/capacity/refusal.js +284 -65
  97. package/dist/lib/capacity/route.js +46 -11
  98. package/dist/lib/capacity/widget.d.ts +12 -1
  99. package/dist/lib/capacity/widget.js +91 -3
  100. package/dist/lib/daemon/flag-monitor.d.ts +8 -0
  101. package/dist/lib/daemon/flag-monitor.js +17 -6
  102. package/dist/lib/daemon/flag.d.ts +65 -1
  103. package/dist/lib/daemon/flag.js +190 -40
  104. package/dist/lib/daemon/ops/policy.js +62 -5
  105. package/dist/lib/daemon/paths.d.ts +72 -2
  106. package/dist/lib/daemon/paths.js +154 -3
  107. package/dist/lib/daemon/resolver.d.ts +2 -0
  108. package/dist/lib/daemon/resolver.js +3 -0
  109. package/dist/lib/daemon/run.d.ts +9 -0
  110. package/dist/lib/daemon/run.js +79 -21
  111. package/dist/lib/daemon/selfcheck.d.ts +22 -0
  112. package/dist/lib/daemon/selfcheck.js +40 -1
  113. package/dist/lib/daemon/server.d.ts +5 -1
  114. package/dist/lib/daemon/server.js +17 -23
  115. package/dist/lib/daemon/state-file-switch.d.ts +57 -0
  116. package/dist/lib/daemon/state-file-switch.js +88 -0
  117. package/dist/lib/daemon/state-file.d.ts +198 -0
  118. package/dist/lib/daemon/state-file.js +419 -0
  119. package/dist/lib/daemon/tcc-eperm.d.ts +153 -0
  120. package/dist/lib/daemon/tcc-eperm.js +310 -0
  121. package/dist/lib/daemon/timed-flag-monitors.d.ts +47 -0
  122. package/dist/lib/daemon/timed-flag-monitors.js +75 -0
  123. package/dist/lib/delivery/admission.d.ts +86 -0
  124. package/dist/lib/delivery/admission.js +148 -0
  125. package/dist/lib/delivery/artifacts.d.ts +7 -1
  126. package/dist/lib/delivery/artifacts.js +29 -10
  127. package/dist/lib/delivery/attempt-id.d.ts +13 -0
  128. package/dist/lib/delivery/attempt-id.js +16 -0
  129. package/dist/lib/delivery/disposable-target.d.ts +42 -0
  130. package/dist/lib/delivery/disposable-target.js +111 -0
  131. package/dist/lib/delivery/effects.d.ts +136 -0
  132. package/dist/lib/delivery/effects.js +541 -0
  133. package/dist/lib/delivery/enrollment.d.ts +21 -17
  134. package/dist/lib/delivery/enrollment.js +83 -5
  135. package/dist/lib/delivery/escalations.d.ts +51 -0
  136. package/dist/lib/delivery/escalations.js +60 -0
  137. package/dist/lib/delivery/lease.d.ts +80 -0
  138. package/dist/lib/delivery/lease.js +134 -0
  139. package/dist/lib/delivery/migrations.d.ts +120 -4
  140. package/dist/lib/delivery/migrations.js +215 -15
  141. package/dist/lib/delivery/mqtt.d.ts +2 -0
  142. package/dist/lib/delivery/mqtt.js +7 -0
  143. package/dist/lib/delivery/reconciler.d.ts +65 -1
  144. package/dist/lib/delivery/reconciler.js +224 -13
  145. package/dist/lib/delivery/rpc/client.d.ts +22 -0
  146. package/dist/lib/delivery/rpc/client.js +159 -0
  147. package/dist/lib/delivery/rpc/port.d.ts +40 -0
  148. package/dist/lib/delivery/rpc/port.js +16 -0
  149. package/dist/lib/delivery/rpc/server.d.ts +30 -0
  150. package/dist/lib/delivery/rpc/server.js +205 -0
  151. package/dist/lib/delivery/rpc/wire.d.ts +85 -0
  152. package/dist/lib/delivery/rpc/wire.js +143 -0
  153. package/dist/lib/delivery/store.d.ts +2 -0
  154. package/dist/lib/delivery/store.js +4 -0
  155. package/dist/lib/delivery/windows-service-install.d.ts +262 -0
  156. package/dist/lib/delivery/windows-service-install.js +892 -0
  157. package/dist/lib/delivery/workers/macos.d.ts +16 -1
  158. package/dist/lib/delivery/workers/macos.js +54 -12
  159. package/dist/lib/delivery/workers/windows-service-live.d.ts +121 -0
  160. package/dist/lib/delivery/workers/windows-service-live.js +711 -0
  161. package/dist/lib/delivery/workers/windows-service-runner.d.ts +33 -0
  162. package/dist/lib/delivery/workers/windows-service-runner.js +82 -0
  163. package/dist/lib/delivery/workers/windows-service.d.ts +140 -0
  164. package/dist/lib/delivery/workers/windows-service.js +584 -0
  165. package/dist/lib/delivery/workers/windows.d.ts +32 -22
  166. package/dist/lib/delivery/workers/windows.js +50 -64
  167. package/dist/lib/doctor/checks/host-core.d.ts +50 -0
  168. package/dist/lib/doctor/checks/host-core.js +269 -0
  169. package/dist/lib/doctor/checks/replay-recorder.d.ts +39 -0
  170. package/dist/lib/doctor/checks/replay-recorder.js +261 -0
  171. package/dist/lib/doctor/registry.js +4 -0
  172. package/dist/lib/environment/profile.d.ts +239 -0
  173. package/dist/lib/environment/profile.js +251 -0
  174. package/dist/lib/hook-engine/reconcile.js +39 -13
  175. package/dist/lib/hook-engine/registration.d.ts +9 -0
  176. package/dist/lib/hook-engine/registration.js +19 -0
  177. package/dist/lib/hot-channels/adapters/meetings.d.ts +15 -0
  178. package/dist/lib/hot-channels/adapters/meetings.js +36 -3
  179. package/dist/lib/hot-channels/adapters/slack.d.ts +21 -5
  180. package/dist/lib/hot-channels/adapters/slack.js +64 -21
  181. package/dist/lib/hot-channels/alert.d.ts +2 -0
  182. package/dist/lib/hot-channels/alert.js +8 -1
  183. package/dist/lib/hot-channels/contract.d.ts +12 -0
  184. package/dist/lib/hot-channels/contract.js +7 -0
  185. package/dist/lib/hot-channels/loop.js +1 -0
  186. package/dist/lib/hot-channels/run.d.ts +6 -0
  187. package/dist/lib/hot-channels/run.js +4 -0
  188. package/dist/lib/hot-channels/signals-pass.d.ts +74 -1
  189. package/dist/lib/hot-channels/signals-pass.js +82 -41
  190. package/dist/lib/hot-channels/signals-redo.js +10 -2
  191. package/dist/lib/install/claude-targets.d.ts +12 -1
  192. package/dist/lib/install/claude-targets.js +57 -5
  193. package/dist/lib/install/codex-targets.d.ts +2 -2
  194. package/dist/lib/install/codex-targets.js +36 -6
  195. package/dist/lib/install/hook-target.d.ts +3 -0
  196. package/dist/lib/install/hook-target.js +11 -0
  197. package/dist/lib/lanes/canonical-host.d.ts +35 -0
  198. package/dist/lib/lanes/canonical-host.js +65 -0
  199. package/dist/lib/lanes/host-capacity.d.ts +30 -0
  200. package/dist/lib/lanes/host-capacity.js +29 -3
  201. package/dist/lib/lanes/watcher.js +35 -0
  202. package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
  203. package/dist/lib/mesh/live/daemon/run.js +5 -2
  204. package/dist/lib/mesh/live/flush.d.ts +5 -1
  205. package/dist/lib/mesh/live/flush.js +12 -6
  206. package/dist/lib/mesh/live/reporting-privacy.d.ts +32 -0
  207. package/dist/lib/mesh/live/reporting-privacy.js +56 -1
  208. package/dist/lib/mesh/live/spool.d.ts +7 -0
  209. package/dist/lib/mesh/live/spool.js +25 -0
  210. package/dist/lib/person-setting-cache.d.ts +38 -0
  211. package/dist/lib/person-setting-cache.js +98 -0
  212. package/dist/lib/safe-store.d.ts +245 -0
  213. package/dist/lib/safe-store.js +777 -0
  214. package/dist/lib/signals/engine.d.ts +29 -2
  215. package/dist/lib/signals/engine.js +103 -4
  216. package/dist/lib/signals/reply.js +73 -18
  217. package/dist/lib/signals/steps/adapters.js +7 -2
  218. package/dist/lib/signals/steps/extract.d.ts +13 -0
  219. package/dist/lib/signals/steps/extract.js +122 -6
  220. package/dist/main.js +46 -3
  221. package/dist/schemas/hq-available-ai.v1.schema.json +76 -0
  222. package/dist/schemas/hq-environment-profile.v1.schema.json +438 -0
  223. package/dist/utils/auth-expiry.d.ts +8 -0
  224. package/dist/utils/auth-expiry.js +53 -0
  225. package/dist/utils/catalog-runtime-paths.d.ts +34 -0
  226. package/dist/utils/catalog-runtime-paths.js +53 -0
  227. package/dist/utils/cli-telemetry.d.ts +21 -0
  228. package/dist/utils/cli-telemetry.js +34 -0
  229. package/dist/utils/command-usage.d.ts +275 -0
  230. package/dist/utils/command-usage.js +797 -0
  231. package/dist/utils/files-browse-acl.js +1 -1
  232. package/dist/utils/hook-trust.d.ts +7 -0
  233. package/dist/utils/hook-trust.js +31 -4
  234. package/dist/utils/host-registration.d.ts +126 -0
  235. package/dist/utils/host-registration.js +378 -0
  236. package/dist/utils/resident-package-preload.js +2 -0
  237. package/package.json +10 -8
  238. package/scripts/bench-core.mjs +1096 -0
  239. package/scripts/check-function-manifest.mjs +702 -0
  240. package/dist/lib/delivery/workers/windows-boundary.d.ts +0 -453
  241. package/dist/lib/delivery/workers/windows-boundary.js +0 -693
@@ -1,6 +1,6 @@
1
1
  export const ACL_SOURCE_DISPLAY_LABELS = {
2
2
  "shared-with-you": "shared-with-you",
3
- creator: "creator access — creator-only",
3
+ creator: "creator access (you created it; others may also have access)",
4
4
  "role-bypass": "role-bypass",
5
5
  "personal-vault": "personal-vault",
6
6
  "private-folder": "private folder — children are creator-only",
@@ -1,4 +1,5 @@
1
1
  import { findExecutableOnPath } from './resolve-executable.js';
2
+ import { type CoreNextTarget } from './host-registration.js';
2
3
  import { type SpawnPlan } from './windows-spawn.js';
3
4
  export interface CodexRpcClient {
4
5
  request(method: string, params: unknown): Promise<unknown>;
@@ -26,6 +27,12 @@ export interface HookTrustDependencies {
26
27
  * our read and our commit — which no other seam can reach.
27
28
  */
28
29
  readConfigText?: (file: string) => string;
30
+ /**
31
+ * The new-core target for the Grok user hook file (hq-core-rust US-017),
32
+ * or null for the shipped bash bridge. Injected by tests; the default reads
33
+ * flag `core.next`.
34
+ */
35
+ coreNextTarget?: (home: string) => CoreNextTarget | null;
29
36
  /**
30
37
  * Reads the HQ `.codex` hook files exactly as the installed core release
31
38
  * ships them. Used only by the post-rescue re-trust; see
@@ -11,6 +11,7 @@ import { parse as parseToml } from 'smol-toml';
11
11
  import { acquireLock, atomicReplace, backupConfig, realpathOrSelf, releaseLock, restoreFromBackup, } from '../commands/mcp-registration.js';
12
12
  import { findExecutableOnPath } from './resolve-executable.js';
13
13
  import { loadShippedCodexHookFiles } from './shipped-codex-hooks.js';
14
+ import { coreNextTargetOrWarn, grokBridgeJson, replaceFileNoFollow } from './host-registration.js';
14
15
  import { planResolvedCommandSpawn } from './windows-spawn.js';
15
16
  /**
16
17
  * The home directory every runtime's config is resolved under.
@@ -674,11 +675,19 @@ function filesMatch(left, right) {
674
675
  return false;
675
676
  }
676
677
  }
678
+ function textMatches(file, text) {
679
+ try {
680
+ return fs.readFileSync(file, 'utf8') === text;
681
+ }
682
+ catch {
683
+ return false;
684
+ }
685
+ }
677
686
  /** Escape a value for use inside a TOML double-quoted (basic) string key. */
678
687
  function tomlEscapeKey(value) {
679
688
  return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
680
689
  }
681
- function grokTrustIsCurrent(hqRoot, home) {
690
+ function grokTrustIsCurrent(hqRoot, home, wantJson) {
682
691
  const grokHome = path.join(home, '.grok');
683
692
  // The key is written TOML-escaped, so match the escaped form. On POSIX paths
684
693
  // (no backslash/quote) this is identical to the raw path.
@@ -705,7 +714,9 @@ function grokTrustIsCurrent(hqRoot, home) {
705
714
  legacyTrusted &&
706
715
  claudeCompatQuiet &&
707
716
  filesMatch(path.join(sourceHooks, 'hq-grok-user-bridge.sh'), path.join(userHooks, 'hq-hq-bridge.sh')) &&
708
- filesMatch(path.join(sourceHooks, 'hq-grok-user-bridge.json'), path.join(userHooks, 'hq-hq-bridge.json')));
717
+ (wantJson === undefined
718
+ ? filesMatch(path.join(sourceHooks, 'hq-grok-user-bridge.json'), path.join(userHooks, 'hq-hq-bridge.json'))
719
+ : textMatches(path.join(userHooks, 'hq-hq-bridge.json'), wantJson)));
709
720
  }
710
721
  /**
711
722
  * Upsert the `[folders."<hqRoot>"]` trust block in ~/.grok/trusted_folders.toml.
@@ -819,7 +830,20 @@ export function trustGrokProjectHooks(hqRoot, deps = DEFAULT_DEPS) {
819
830
  };
820
831
  }
821
832
  const home = deps.homeDir?.() ?? process.env.HOME ?? os.homedir();
822
- if (grokTrustIsCurrent(hqRoot, home)) {
833
+ // Flag `core.next` on: the user hook file calls the new core's entry point
834
+ // (hq-core-rust US-017) for each event the engine has every guard for. Off,
835
+ // when the engine is not available, or when the shipped file cannot be
836
+ // read as JSON: the shipped file, copied byte for byte as before.
837
+ let wantJson;
838
+ try {
839
+ const target = (deps.coreNextTarget ?? ((h) => coreNextTargetOrWarn(h)))(home);
840
+ wantJson = target ? grokBridgeJson(fs.readFileSync(sourceBridgeJson, 'utf8'), hqRoot, target) : undefined;
841
+ }
842
+ catch (error) {
843
+ process.stderr.write(`hq: warning: the Grok user hook file stays on the old dispatcher (${errorMessage(error)})\n`);
844
+ wantJson = undefined;
845
+ }
846
+ if (grokTrustIsCurrent(hqRoot, home, wantJson)) {
823
847
  return { runtime: 'grok', status: 'unchanged', trusted: 0 };
824
848
  }
825
849
  try {
@@ -835,7 +859,10 @@ export function trustGrokProjectHooks(hqRoot, deps = DEFAULT_DEPS) {
835
859
  quietGrokClaudeCompat(path.join(grokHome, 'config.toml'));
836
860
  fs.copyFileSync(sourceBridgeSh, path.join(userHooks, 'hq-hq-bridge.sh'));
837
861
  fs.chmodSync(path.join(userHooks, 'hq-hq-bridge.sh'), 0o755);
838
- fs.copyFileSync(sourceBridgeJson, path.join(userHooks, 'hq-hq-bridge.json'));
862
+ if (wantJson === undefined)
863
+ fs.copyFileSync(sourceBridgeJson, path.join(userHooks, 'hq-hq-bridge.json'));
864
+ else
865
+ replaceFileNoFollow(path.join(userHooks, 'hq-hq-bridge.json'), wantJson, home);
839
866
  return { runtime: 'grok', status: 'trusted', trusted: 1 };
840
867
  }
841
868
  catch (error) {
@@ -0,0 +1,126 @@
1
+ import { type NativeTarget } from '../lib/hook-engine/registration.js';
2
+ export declare const CORE_NEXT_FLAG = "core.next";
3
+ /** Engine-side kill switch: environment variable and file under the home folder. */
4
+ export declare const CORE_NEXT_KILL_ENV = "HQ_CORE_NEXT";
5
+ export declare const CORE_NEXT_KILL_FILE: string;
6
+ /** The engine-wide kill switch the bridge already honors; the engine checks it too. */
7
+ export declare const ENGINE_KILL_ENV = "HQ_HOOK_ENGINE";
8
+ export declare const ENGINE_KILL_FILE: string;
9
+ /** Name of the release-stable link next to the pinned engine versions. */
10
+ export declare const STABLE_LINK_NAME = "stable";
11
+ export type CoreNextHost = 'claude' | 'codex' | 'grok';
12
+ /**
13
+ * `project`: the HQ root's own registration, always answers.
14
+ * `global`: the user-scope Claude Code entry; answers nothing inside an HQ
15
+ * tree, where the project hooks run (as the old user-scope entry did).
16
+ * `in-tree`: the Grok user bridge; answers nothing outside an HQ tree (as the
17
+ * old bridge did).
18
+ */
19
+ export type CoreNextScope = 'project' | 'global' | 'in-tree';
20
+ /** A registration target with the flag off: the bash dispatcher, the hqd shim, or the pinned launcher. */
21
+ export type FallbackTarget = 'master' | 'shim' | NativeTarget;
22
+ /**
23
+ * Registration target for the new core: the stable engine path, the events
24
+ * whose guards the engine has (only these switch), and what every other event
25
+ * is registered to (the flag-off target; `master` when not given).
26
+ */
27
+ export interface CoreNextTarget {
28
+ coreNext: string;
29
+ events: readonly string[];
30
+ fallback?: FallbackTarget;
31
+ }
32
+ /** The target one event is registered to: the new core only for an event it can take. */
33
+ export declare function targetForEvent(target: FallbackTarget | CoreNextTarget, event: string): FallbackTarget | CoreNextTarget;
34
+ /**
35
+ * The evaluators an event needs before it may leave the old dispatcher: the
36
+ * new-core ports of what the old dispatcher does on that event (hq-core-rust
37
+ * US-010 to US-015). An event not listed here has no port yet and always keeps
38
+ * the old registration.
39
+ */
40
+ export declare const REQUIRED_EVALUATORS: Readonly<Record<string, readonly string[]>>;
41
+ /** Schema of `hq-hook capabilities --json`. */
42
+ export declare const CAPABILITIES_SCHEMA = "hq-hook.capabilities.v1";
43
+ /** What an engine reported: its version and the evaluators it runs per event. */
44
+ export interface EngineCapabilities {
45
+ version: string;
46
+ events: Record<string, string[]>;
47
+ }
48
+ /** Evaluators `event` needs that `caps` lacks; null when the event has no switch rule. */
49
+ export declare function missingEvaluators(caps: EngineCapabilities, event: string): string[] | null;
50
+ /** Events the engine has every required evaluator for. */
51
+ export declare function capableEvents(caps: EngineCapabilities): string[];
52
+ /**
53
+ * Start `engine` the way a host would and read what it evaluates: `--version`
54
+ * must print `hq-hook <version>`, and `capabilities --json` the capability
55
+ * document. Throws when either fails, so the caller keeps the old
56
+ * registrations. Bounded: each call is given five seconds.
57
+ */
58
+ export declare function probeEngine(engine: string): EngineCapabilities;
59
+ /**
60
+ * Check that the stable path resolves to the pinned engine before a
61
+ * registration names it: a missing or dangling `stable` link would leave every
62
+ * new-core registration with nothing to run.
63
+ */
64
+ export declare function checkStableEngine(stable: string, pinned: string): void;
65
+ /** `core.next` for this machine, person or company, offline. */
66
+ export declare function coreNextEnabled(env?: NodeJS.ProcessEnv): boolean;
67
+ /** The stable path that stands for a pinned engine path. */
68
+ export declare function stableEnginePath(pinned: string, home: string): string;
69
+ /**
70
+ * Point `<home>/.hq/bin/hq-hook/stable` at the pinned engine's version folder
71
+ * and return the stable engine path. The link is replaced by rename, so a
72
+ * planted file at the temporary name or the link itself is never followed. A
73
+ * `stable` that is a real folder (not a link) is someone else's and is left
74
+ * alone: the call fails and the caller keeps the current registrations.
75
+ */
76
+ export declare function linkStableEngine(pinned: string, home: string, platform?: NodeJS.Platform): string;
77
+ export interface CoreNextOptions {
78
+ platform?: NodeJS.Platform;
79
+ /** Reads the engine's capabilities; `probeEngine` by default. */
80
+ probe?: (engine: string) => EngineCapabilities;
81
+ }
82
+ /**
83
+ * The new-core target when `core.next` is on, the engine for this CLI is
84
+ * installed, the stable link resolves to it, it runs, and it has every
85
+ * evaluator at least one event needs; else null. Installs the pinned engine
86
+ * as the launcher flag does. Throws when the link or the engine check fails;
87
+ * callers use [`coreNextTargetOrWarn`], which keeps the old registrations.
88
+ *
89
+ * Windows returns null: the new core's Windows path (job objects, the
90
+ * PowerShell forms, junction swaps) is US-022, so every Windows registration
91
+ * stays as it is today.
92
+ */
93
+ export declare function coreNextTarget(home: string, env?: NodeJS.ProcessEnv, options?: CoreNextOptions): CoreNextTarget | null;
94
+ /**
95
+ * [`coreNextTarget`], with any failure turned into one warning and null, so
96
+ * `hq install` and `hq reindex` go on with the old registrations.
97
+ */
98
+ export declare function coreNextTargetOrWarn(home: string, env?: NodeJS.ProcessEnv, options?: CoreNextOptions & {
99
+ warn?: (message: string) => void;
100
+ }): CoreNextTarget | null;
101
+ /** Test hook: forget which warnings were printed. */
102
+ export declare function _resetCoreNextWarningsForTests(): void;
103
+ /** Arguments after the engine path for one host, event and scope. */
104
+ export declare function coreNextArgs(host: CoreNextHost, event: string, root: string, scope: CoreNextScope): string[];
105
+ /** POSIX shell form of a core-next command (Codex and Grok take a command string). */
106
+ export declare function coreNextCommand(engine: string, host: CoreNextHost, event: string, root: string, scope: CoreNextScope): string;
107
+ /** PowerShell form, for hosts that run hook commands through PowerShell on Windows. */
108
+ export declare function coreNextCommandWindows(engine: string, host: CoreNextHost, event: string, root: string, scope: CoreNextScope): string;
109
+ /**
110
+ * The Grok Build user hook file (`~/.grok/hooks/hq-hq-bridge.json`) for a
111
+ * target. With no target it is the shipped source text unchanged. With the
112
+ * new core each entry that calls the bash bridge, on an event the engine can
113
+ * take, calls the engine instead; matchers, timeouts, the other events and
114
+ * every other entry stay as they are.
115
+ */
116
+ export declare function grokBridgeJson(source: string, root: string, target: CoreNextTarget | null, platform?: NodeJS.Platform): string;
117
+ /**
118
+ * Write `content` to `file` through the shared safe store (store rule v2): the
119
+ * folder is held open and checked (a real folder of this user, not a link,
120
+ * not writable by group or others, parents checked up to the home folder),
121
+ * and the file is replaced by rename from a new O_EXCL|O_NOFOLLOW temporary
122
+ * file, so a link planted at `file` is replaced, never written through.
123
+ * Throws on any refusal; the caller keeps the current file.
124
+ */
125
+ export declare function replaceFileNoFollow(file: string, content: string, home?: string): void;
126
+ //# sourceMappingURL=host-registration.d.ts.map
@@ -0,0 +1,378 @@
1
+ /**
2
+ * The registration switch (hq-core-rust US-017): which core each host's hook
3
+ * registration calls.
4
+ *
5
+ * Flag `core.next` off (the default): `hq reindex` writes the registrations it
6
+ * writes today, byte for byte. Flag on: each registration calls the native
7
+ * entry point directly, with no shell wrapper:
8
+ *
9
+ * <home>/.hq/bin/hq-hook/stable/<binary> run --host <host> <Event> --hq-root <root> [scope]
10
+ *
11
+ * `stable` is a link to the pinned engine of the running CLI. A release moves
12
+ * the link and leaves every registration string as it was, so Codex, which
13
+ * trusts a hook by the hash of its definition, keeps trusting it.
14
+ *
15
+ * The flag is read the way `sync.rust-engine-rollout-v3` is: the local
16
+ * override `HQ_FLAG_CORE_NEXT=true|false` first, then the offline flag
17
+ * snapshot (company scope when a company is resolved, person scope otherwise),
18
+ * which carries the server's person, company and machine targeting. No network
19
+ * call: reindex runs from lifecycle hooks.
20
+ *
21
+ * The switch is per event. Before an event is pointed at the new core, the
22
+ * engine behind the stable path is started (`--version`, then `capabilities
23
+ * --json`), and the event switches only when every evaluator it needs
24
+ * ([`REQUIRED_EVALUATORS`]) is registered for it. Every other event keeps the
25
+ * registration it would have with the flag off. Windows keeps the old
26
+ * registrations for every event until US-022.
27
+ *
28
+ * The kill switch lives in the engine (`crates/hq-hook/src/core_next.rs`):
29
+ * `HQ_CORE_NEXT=off` or the file `~/.hq/state/core-next.off` hands the next
30
+ * event to the old dispatcher without a reinstall.
31
+ */
32
+ import { execFileSync } from 'node:child_process';
33
+ import * as fs from 'node:fs';
34
+ import * as path from 'node:path';
35
+ import { readLocalOverride } from '@indigoai-us/hq-flags-client';
36
+ import { readFlagSnapshotFile, readPersonFlagSnapshotFile } from '../lib/flag-snapshot-file.js';
37
+ import { resolveProcessFlagCompanyContext } from '../lib/process-flag-company-context.js';
38
+ import { installHookEngine } from '../lib/hook-engine/resolve.js';
39
+ import { launcherRoot, quotePosix, quoteWindows } from '../lib/hook-engine/registration.js';
40
+ import { openStoreDir } from '../lib/safe-store.js';
41
+ export const CORE_NEXT_FLAG = 'core.next';
42
+ /** Engine-side kill switch: environment variable and file under the home folder. */
43
+ export const CORE_NEXT_KILL_ENV = 'HQ_CORE_NEXT';
44
+ export const CORE_NEXT_KILL_FILE = path.join('.hq', 'state', 'core-next.off');
45
+ /** The engine-wide kill switch the bridge already honors; the engine checks it too. */
46
+ export const ENGINE_KILL_ENV = 'HQ_HOOK_ENGINE';
47
+ export const ENGINE_KILL_FILE = path.join('.hq', 'hook-engine.off');
48
+ /** Name of the release-stable link next to the pinned engine versions. */
49
+ export const STABLE_LINK_NAME = 'stable';
50
+ /** The target one event is registered to: the new core only for an event it can take. */
51
+ export function targetForEvent(target, event) {
52
+ if (typeof target === 'object' && 'coreNext' in target && !target.events.includes(event))
53
+ return target.fallback ?? 'master';
54
+ return target;
55
+ }
56
+ /**
57
+ * The evaluators an event needs before it may leave the old dispatcher: the
58
+ * new-core ports of what the old dispatcher does on that event (hq-core-rust
59
+ * US-010 to US-015). An event not listed here has no port yet and always keeps
60
+ * the old registration.
61
+ */
62
+ export const REQUIRED_EVALUATORS = {
63
+ PreToolUse: ['credential-files', 'company-scope', 'path-search-rules', 'command-rules', 'policy-injection'],
64
+ PostToolUse: ['policy-injection'],
65
+ UserPromptSubmit: ['policy-injection'],
66
+ SessionStart: ['policy-injection'],
67
+ SessionEnd: ['policy-injection'],
68
+ PreCompact: ['stop-check', 'policy-injection'],
69
+ Stop: ['stop-check'],
70
+ };
71
+ /** Schema of `hq-hook capabilities --json`. */
72
+ export const CAPABILITIES_SCHEMA = 'hq-hook.capabilities.v1';
73
+ /** Evaluators `event` needs that `caps` lacks; null when the event has no switch rule. */
74
+ export function missingEvaluators(caps, event) {
75
+ const required = REQUIRED_EVALUATORS[event];
76
+ if (!required)
77
+ return null;
78
+ const present = caps.events[event] ?? [];
79
+ return required.filter((id) => !present.includes(id));
80
+ }
81
+ /** Events the engine has every required evaluator for. */
82
+ export function capableEvents(caps) {
83
+ return Object.keys(REQUIRED_EVALUATORS).filter((event) => missingEvaluators(caps, event)?.length === 0);
84
+ }
85
+ /**
86
+ * Start `engine` the way a host would and read what it evaluates: `--version`
87
+ * must print `hq-hook <version>`, and `capabilities --json` the capability
88
+ * document. Throws when either fails, so the caller keeps the old
89
+ * registrations. Bounded: each call is given five seconds.
90
+ */
91
+ export function probeEngine(engine) {
92
+ const run = (args) => execFileSync(engine, args, {
93
+ encoding: 'utf8',
94
+ timeout: 5000,
95
+ stdio: ['ignore', 'pipe', 'pipe'],
96
+ windowsHide: true,
97
+ });
98
+ let version;
99
+ try {
100
+ version = run(['--version']).trim();
101
+ }
102
+ catch (error) {
103
+ throw new Error(`${engine} --version did not run: ${error.message.split('\n')[0]}`);
104
+ }
105
+ if (!/^hq-hook \S+$/.test(version))
106
+ throw new Error(`${engine} --version printed ${JSON.stringify(version.slice(0, 80))}`);
107
+ let doc;
108
+ try {
109
+ doc = JSON.parse(run(['capabilities', '--json']));
110
+ }
111
+ catch (error) {
112
+ throw new Error(`${engine} capabilities --json failed: ${error.message.split('\n')[0]}`);
113
+ }
114
+ if (doc?.schema !== CAPABILITIES_SCHEMA || !doc.events || typeof doc.events !== 'object' || Array.isArray(doc.events)) {
115
+ throw new Error(`${engine} capabilities --json did not print a ${CAPABILITIES_SCHEMA} document`);
116
+ }
117
+ const events = {};
118
+ for (const [event, ids] of Object.entries(doc.events)) {
119
+ events[event] = Array.isArray(ids) ? ids.filter((id) => typeof id === 'string') : [];
120
+ }
121
+ return { version: version.slice('hq-hook '.length), events };
122
+ }
123
+ /**
124
+ * Check that the stable path resolves to the pinned engine before a
125
+ * registration names it: a missing or dangling `stable` link would leave every
126
+ * new-core registration with nothing to run.
127
+ */
128
+ export function checkStableEngine(stable, pinned) {
129
+ let resolved;
130
+ try {
131
+ resolved = fs.realpathSync(stable);
132
+ }
133
+ catch (error) {
134
+ throw new Error(`${stable} does not resolve (${error.code ?? 'error'})`);
135
+ }
136
+ if (resolved !== fs.realpathSync(pinned))
137
+ throw new Error(`${stable} resolves to ${resolved}, not the pinned engine ${pinned}`);
138
+ if (!fs.statSync(resolved).isFile())
139
+ throw new Error(`${resolved} is not a file`);
140
+ }
141
+ /** `core.next` for this machine, person or company, offline. */
142
+ export function coreNextEnabled(env = process.env) {
143
+ const override = readLocalOverride(CORE_NEXT_FLAG, env);
144
+ if (override !== null)
145
+ return override;
146
+ const { companyUid: uid, companySlug } = resolveProcessFlagCompanyContext(env);
147
+ // An explicit company slug that does not resolve stays off, as for the launcher flag.
148
+ if (!uid && companySlug)
149
+ return false;
150
+ const snapshot = uid ? readFlagSnapshotFile(uid, { env }) : readPersonFlagSnapshotFile({ env });
151
+ return snapshot?.flags[CORE_NEXT_FLAG] === true;
152
+ }
153
+ function hookEngineDir(home) {
154
+ return path.join(home, '.hq', 'bin', 'hq-hook');
155
+ }
156
+ /** The stable path that stands for a pinned engine path. */
157
+ export function stableEnginePath(pinned, home) {
158
+ const relative = path.relative(hookEngineDir(home), pinned);
159
+ const [, ...rest] = relative.split(/[\\/]/);
160
+ if (relative.startsWith('..') || path.isAbsolute(relative) || rest.length === 0) {
161
+ throw new Error(`hook engine ${pinned} is not under ${hookEngineDir(home)}`);
162
+ }
163
+ return path.join(hookEngineDir(home), STABLE_LINK_NAME, ...rest);
164
+ }
165
+ /**
166
+ * Point `<home>/.hq/bin/hq-hook/stable` at the pinned engine's version folder
167
+ * and return the stable engine path. The link is replaced by rename, so a
168
+ * planted file at the temporary name or the link itself is never followed. A
169
+ * `stable` that is a real folder (not a link) is someone else's and is left
170
+ * alone: the call fails and the caller keeps the current registrations.
171
+ */
172
+ export function linkStableEngine(pinned, home, platform = process.platform) {
173
+ const root = hookEngineDir(home);
174
+ const relative = path.relative(root, pinned).split(/[\\/]/);
175
+ const version = relative[0];
176
+ if (!version || version === '..' || version === STABLE_LINK_NAME || path.isAbsolute(path.relative(root, pinned))) {
177
+ throw new Error(`hook engine ${pinned} is not under ${root}`);
178
+ }
179
+ const stable = path.join(root, STABLE_LINK_NAME);
180
+ // Store rule v2: every path component this follows or creates under the home
181
+ // folder is a real folder of this user that group and others cannot write:
182
+ // .hq, .hq/bin, .hq/bin/hq-hook, the version folder and any folder below it
183
+ // up to the engine, and the engine file itself.
184
+ const components = [path.join(home, '.hq'), path.join(home, '.hq', 'bin'), root];
185
+ for (let i = 0; i < relative.length - 1; i += 1)
186
+ components.push(path.join(root, ...relative.slice(0, i + 1)));
187
+ for (const component of components)
188
+ checkOwnedEntry(component, 'folder', platform);
189
+ checkOwnedEntry(pinned, 'file', platform);
190
+ // Windows creates a junction, which needs an absolute target; elsewhere the
191
+ // link is relative so it names the version folder beside it.
192
+ const target = platform === 'win32' ? path.join(root, version) : version;
193
+ let current;
194
+ try {
195
+ current = fs.lstatSync(stable);
196
+ }
197
+ catch (error) {
198
+ if (error.code !== 'ENOENT')
199
+ throw error;
200
+ }
201
+ if (current && !current.isSymbolicLink())
202
+ throw new Error(`${stable} exists and is not a link; leaving it in place`);
203
+ if (current && pointsAt(stable, path.join(root, version)))
204
+ return stableEnginePath(pinned, home);
205
+ if (platform === 'win32') {
206
+ // A junction cannot be renamed over another. A running engine keeps its
207
+ // own image open, which the junction does not hold.
208
+ if (current) {
209
+ try {
210
+ fs.unlinkSync(stable);
211
+ }
212
+ catch {
213
+ fs.rmdirSync(stable);
214
+ }
215
+ }
216
+ fs.symlinkSync(target, stable, 'junction');
217
+ }
218
+ else {
219
+ const staged = path.join(root, `.${STABLE_LINK_NAME}.${process.pid}.tmp`);
220
+ try {
221
+ fs.unlinkSync(staged);
222
+ }
223
+ catch (error) {
224
+ if (error.code !== 'ENOENT')
225
+ throw error;
226
+ }
227
+ fs.symlinkSync(target, staged);
228
+ try {
229
+ fs.renameSync(staged, stable);
230
+ }
231
+ catch (error) {
232
+ try {
233
+ fs.unlinkSync(staged);
234
+ }
235
+ catch { /* already gone */ }
236
+ throw error;
237
+ }
238
+ }
239
+ return stableEnginePath(pinned, home);
240
+ }
241
+ /** A real folder or file (not a link) of this user that group and others cannot write. */
242
+ function checkOwnedEntry(entry, kind, platform) {
243
+ const stat = fs.lstatSync(entry);
244
+ if (stat.isSymbolicLink() || (kind === 'folder' ? !stat.isDirectory() : !stat.isFile()))
245
+ throw new Error(`${entry} is not a ${kind}`);
246
+ if (typeof process.getuid === 'function' && stat.uid !== process.getuid())
247
+ throw new Error(`${entry} is not owned by this user`);
248
+ if (platform !== 'win32' && (stat.mode & 0o022) !== 0)
249
+ throw new Error(`${entry} is writable by group or others`);
250
+ }
251
+ /** True when the link resolves to `folder` (Windows reports junction targets in its own spelling). */
252
+ function pointsAt(link, folder) {
253
+ try {
254
+ return fs.realpathSync(link) === fs.realpathSync(folder);
255
+ }
256
+ catch {
257
+ return false;
258
+ }
259
+ }
260
+ /**
261
+ * The new-core target when `core.next` is on, the engine for this CLI is
262
+ * installed, the stable link resolves to it, it runs, and it has every
263
+ * evaluator at least one event needs; else null. Installs the pinned engine
264
+ * as the launcher flag does. Throws when the link or the engine check fails;
265
+ * callers use [`coreNextTargetOrWarn`], which keeps the old registrations.
266
+ *
267
+ * Windows returns null: the new core's Windows path (job objects, the
268
+ * PowerShell forms, junction swaps) is US-022, so every Windows registration
269
+ * stays as it is today.
270
+ */
271
+ export function coreNextTarget(home, env = process.env, options = {}) {
272
+ const platform = options.platform ?? process.platform;
273
+ if (platform === 'win32')
274
+ return null;
275
+ if (!coreNextEnabled({ ...env, HOME: home, USERPROFILE: home }))
276
+ return null;
277
+ const pinned = installHookEngine({ home });
278
+ if (!pinned)
279
+ throw new Error('the hook engine for this CLI is not installed');
280
+ const stable = linkStableEngine(pinned, home, platform);
281
+ checkStableEngine(stable, pinned);
282
+ const events = capableEvents((options.probe ?? probeEngine)(stable));
283
+ return events.length ? { coreNext: stable, events } : null;
284
+ }
285
+ const warned = new Set();
286
+ /**
287
+ * [`coreNextTarget`], with any failure turned into one warning and null, so
288
+ * `hq install` and `hq reindex` go on with the old registrations.
289
+ */
290
+ export function coreNextTargetOrWarn(home, env = process.env, options = {}) {
291
+ try {
292
+ return coreNextTarget(home, env, options);
293
+ }
294
+ catch (error) {
295
+ const message = `hq: warning: flag ${CORE_NEXT_FLAG} is on, but the new hook core cannot be used (${error.message}); keeping the old hook registrations`;
296
+ if (!warned.has(message)) {
297
+ warned.add(message);
298
+ (options.warn ?? ((text) => process.stderr.write(`${text}\n`)))(message);
299
+ }
300
+ return null;
301
+ }
302
+ }
303
+ /** Test hook: forget which warnings were printed. */
304
+ export function _resetCoreNextWarningsForTests() {
305
+ warned.clear();
306
+ }
307
+ /** Arguments after the engine path for one host, event and scope. */
308
+ export function coreNextArgs(host, event, root, scope) {
309
+ const flag = scope === 'global' ? ['--global'] : scope === 'in-tree' ? ['--in-hq-tree'] : [];
310
+ return ['run', '--host', host, event, '--hq-root', launcherRoot(root), ...flag];
311
+ }
312
+ /** POSIX shell form of a core-next command (Codex and Grok take a command string). */
313
+ export function coreNextCommand(engine, host, event, root, scope) {
314
+ return [engine, ...coreNextArgs(host, event, root, scope)].map(quotePosix).join(' ');
315
+ }
316
+ /** PowerShell form, for hosts that run hook commands through PowerShell on Windows. */
317
+ export function coreNextCommandWindows(engine, host, event, root, scope) {
318
+ return '& ' + [engine, ...coreNextArgs(host, event, root, scope)].map(quoteWindows).join(' ');
319
+ }
320
+ const GROK_BRIDGE_SCRIPT = 'hq-hq-bridge.sh';
321
+ /**
322
+ * The Grok Build user hook file (`~/.grok/hooks/hq-hq-bridge.json`) for a
323
+ * target. With no target it is the shipped source text unchanged. With the
324
+ * new core each entry that calls the bash bridge, on an event the engine can
325
+ * take, calls the engine instead; matchers, timeouts, the other events and
326
+ * every other entry stay as they are.
327
+ */
328
+ export function grokBridgeJson(source, root, target, platform = process.platform) {
329
+ if (!target)
330
+ return source;
331
+ const doc = JSON.parse(source);
332
+ if (!doc.hooks || typeof doc.hooks !== 'object')
333
+ return source;
334
+ if (!Object.keys(doc.hooks).some((event) => target.events.includes(event)))
335
+ return source;
336
+ const hooks = {};
337
+ for (const [event, groups] of Object.entries(doc.hooks)) {
338
+ hooks[event] = !Array.isArray(groups) || !target.events.includes(event) ? groups : groups.map((group) => {
339
+ if (!group || !Array.isArray(group.hooks))
340
+ return group;
341
+ return {
342
+ ...group,
343
+ hooks: group.hooks.map((entry) => {
344
+ if (!entry || typeof entry.command !== 'string' || !entry.command.includes(GROK_BRIDGE_SCRIPT))
345
+ return entry;
346
+ const { env: _env, command: _command, ...rest } = entry;
347
+ const command = platform === 'win32'
348
+ ? coreNextCommandWindows(target.coreNext, 'grok', event, root, 'in-tree')
349
+ : coreNextCommand(target.coreNext, 'grok', event, root, 'in-tree');
350
+ return { ...rest, command };
351
+ }),
352
+ };
353
+ });
354
+ }
355
+ return `${JSON.stringify({ ...doc, hooks }, null, 2)}\n`;
356
+ }
357
+ /**
358
+ * Write `content` to `file` through the shared safe store (store rule v2): the
359
+ * folder is held open and checked (a real folder of this user, not a link,
360
+ * not writable by group or others, parents checked up to the home folder),
361
+ * and the file is replaced by rename from a new O_EXCL|O_NOFOLLOW temporary
362
+ * file, so a link planted at `file` is replaced, never written through.
363
+ * Throws on any refusal; the caller keeps the current file.
364
+ */
365
+ export function replaceFileNoFollow(file, content, home) {
366
+ const opened = openStoreDir(path.dirname(file), home === undefined ? {} : { home });
367
+ if (!opened.ok)
368
+ throw new Error(`${path.dirname(file)}: ${opened.message}`);
369
+ try {
370
+ const written = opened.value.writeAtomic(path.basename(file), content);
371
+ if (!written.ok)
372
+ throw new Error(`${file}: ${written.message}`);
373
+ }
374
+ finally {
375
+ opened.value.close();
376
+ }
377
+ }
378
+ //# sourceMappingURL=host-registration.js.map
@@ -18,6 +18,7 @@ export const RESIDENT_PACKAGE_MODULES = {
18
18
  ],
19
19
  "auth-login": [
20
20
  "../lib/auth-login-provider-state.js",
21
+ "../commands/logout.js",
21
22
  "../lib/daemon/mcp-oauth.js",
22
23
  "../lib/plan-limit-nag.js",
23
24
  "../utils/plan-gate-error.js", "../utils/deleted-company-notice.js",
@@ -165,6 +166,7 @@ const LOADERS = {
165
166
  ],
166
167
  "auth-login": [
167
168
  () => import("../lib/auth-login-provider-state.js"),
169
+ () => import("../commands/logout.js"),
168
170
  () => import("../lib/daemon/mcp-oauth.js"),
169
171
  () => import("../lib/plan-limit-nag.js"),
170
172
  () => import("../utils/plan-gate-error.js"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.215-beta.0",
3
+ "version": "5.345.217",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -23,7 +23,9 @@
23
23
  "contracts",
24
24
  "scripts/mesh-daemon-if-stale.mjs",
25
25
  "scripts/install-hook-engine.mjs",
26
- "scripts/hook-engine-manifest.mjs"
26
+ "scripts/hook-engine-manifest.mjs",
27
+ "scripts/check-function-manifest.mjs",
28
+ "scripts/bench-core.mjs"
27
29
  ],
28
30
  "scripts": {
29
31
  "build": "node scripts/generate-dsn.mjs && node scripts/build-flag-registry-worker.mjs && tsc && node scripts/generate-command-catalog.mjs --check && node scripts/copy-schemas.mjs && node scripts/chmod-bins.mjs && node scripts/bundle-sync-runner.mjs",
@@ -117,11 +119,11 @@
117
119
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
118
120
  },
119
121
  "optionalDependencies": {
120
- "@indigoai-us/hq-hook-win32-x64": "5.345.215-beta.0",
121
- "@indigoai-us/hq-hook-win32-arm64": "5.345.215-beta.0",
122
- "@indigoai-us/hq-hook-darwin-x64": "5.345.215-beta.0",
123
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.215-beta.0",
124
- "@indigoai-us/hq-hook-linux-x64": "5.345.215-beta.0",
125
- "@indigoai-us/hq-hook-linux-arm64": "5.345.215-beta.0"
122
+ "@indigoai-us/hq-hook-win32-x64": "5.345.217",
123
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.217",
124
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.217",
125
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.217",
126
+ "@indigoai-us/hq-hook-linux-x64": "5.345.217",
127
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.217"
126
128
  }
127
129
  }