@indigoai-us/hq-cli 5.345.238 → 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 (206) hide show
  1. package/CHANGELOG.md +74 -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/hq-delegate-repo.sh +7 -1
  5. package/assets/scaffold/core/scripts/hq-delegate-secrets.sh +95 -20
  6. package/assets/scaffold/core/scripts/hq-delegate-transfer.sh +57 -9
  7. package/assets/scaffold/core/scripts/lib/delegate-engine.sh +77 -0
  8. package/dist/command-catalog.generated.d.ts +212 -10
  9. package/dist/command-catalog.generated.js +260 -10
  10. package/dist/command-registration-plan.d.ts +6 -0
  11. package/dist/command-registration-plan.js +1 -0
  12. package/dist/commands/cloud-off-gate.d.ts +9 -8
  13. package/dist/commands/cloud-off-gate.js +41 -40
  14. package/dist/commands/cloud.d.ts +17 -2
  15. package/dist/commands/cloud.js +126 -24
  16. package/dist/commands/core-delegate-w1b.js +333 -27
  17. package/dist/commands/core-delegate.d.ts +2 -1
  18. package/dist/commands/core-delegate.js +209 -48
  19. package/dist/commands/core-handoff.js +1 -1
  20. package/dist/commands/core-job-model-auth.d.ts +95 -0
  21. package/dist/commands/core-job-model-auth.js +247 -0
  22. package/dist/commands/core-job-run-native.js +280 -12
  23. package/dist/commands/core.js +1 -0
  24. package/dist/commands/deploy-comments.js +8 -2
  25. package/dist/commands/deploy-events.d.ts +40 -0
  26. package/dist/commands/deploy-events.js +300 -0
  27. package/dist/commands/doctor.d.ts +4 -4
  28. package/dist/commands/doctor.js +2 -2
  29. package/dist/commands/feedback.js +2 -3
  30. package/dist/commands/files-browse.js +2 -0
  31. package/dist/commands/files.js +4 -0
  32. package/dist/commands/integrations-core.d.ts +11 -0
  33. package/dist/commands/integrations-core.js +15 -1
  34. package/dist/commands/keyed-sync-pull.d.ts +12 -0
  35. package/dist/commands/keyed-sync-pull.js +151 -0
  36. package/dist/commands/lanes-link.js +2 -2
  37. package/dist/commands/lanes-loop.d.ts +2 -2
  38. package/dist/commands/lanes-loop.js +5 -5
  39. package/dist/commands/lanes-questions.js +1 -1
  40. package/dist/commands/lanes-stories.js +1 -1
  41. package/dist/commands/lanes.js +80 -14
  42. package/dist/commands/library-add.d.ts +5 -2
  43. package/dist/commands/library-add.js +22 -9
  44. package/dist/commands/mcp-registration.d.ts +4 -18
  45. package/dist/commands/mcp-registration.js +9 -29
  46. package/dist/commands/mesh.d.ts +4 -0
  47. package/dist/commands/mesh.js +25 -5
  48. package/dist/commands/pack-install.d.ts +2 -3
  49. package/dist/commands/pack-install.js +6 -8
  50. package/dist/commands/rescue.d.ts +3 -2
  51. package/dist/commands/rescue.js +48 -34
  52. package/dist/commands/search.d.ts +6 -0
  53. package/dist/commands/search.js +24 -4
  54. package/dist/commands/secrets.d.ts +3 -4
  55. package/dist/commands/secrets.js +3 -20
  56. package/dist/commands/sources.js +6 -2
  57. package/dist/commands/sync-core.d.ts +8 -0
  58. package/dist/commands/sync-core.js +43 -0
  59. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +1830 -1468
  60. package/dist/hq-cloud-sync-runner/package.json +1 -1
  61. package/dist/lib/bot/api.d.ts +2 -1
  62. package/dist/lib/bot/api.js +2 -15
  63. package/dist/lib/capacity/accounts.d.ts +1 -1
  64. package/dist/lib/capacity/accounts.js +1 -1
  65. package/dist/lib/capacity/collectors/claude-oauth.d.ts +0 -2
  66. package/dist/lib/capacity/collectors/claude-oauth.js +0 -5
  67. package/dist/lib/capacity/freshness.d.ts +1 -1
  68. package/dist/lib/capacity/freshness.js +1 -1
  69. package/dist/lib/capacity/route.js +1 -1
  70. package/dist/lib/core-utils/delegate-helper-paths.d.ts +26 -0
  71. package/dist/lib/core-utils/delegate-helper-paths.js +33 -0
  72. package/dist/lib/daemon/catalog.d.ts +3 -0
  73. package/dist/lib/daemon/hook-requests.d.ts +1 -1
  74. package/dist/lib/daemon/hook-requests.js +4 -2
  75. package/dist/lib/daemon/jq-provision.d.ts +63 -0
  76. package/dist/lib/daemon/jq-provision.js +155 -0
  77. package/dist/lib/daemon/lanes-reconcile-guard.d.ts +4 -3
  78. package/dist/lib/daemon/lanes-reconcile-guard.js +4 -4
  79. package/dist/lib/daemon/mesh-owner.d.ts +4 -0
  80. package/dist/lib/daemon/mesh-owner.js +20 -0
  81. package/dist/lib/daemon/ops/policy.d.ts +3 -0
  82. package/dist/lib/daemon/ops/policy.js +32 -4
  83. package/dist/lib/daemon/run.js +17 -22
  84. package/dist/lib/daemon/server.d.ts +6 -0
  85. package/dist/lib/daemon/server.js +5 -0
  86. package/dist/lib/daemon/verified-jq.d.ts +96 -0
  87. package/dist/lib/daemon/verified-jq.js +337 -0
  88. package/dist/lib/doctor/checks/jq.js +16 -0
  89. package/dist/lib/doctor/deep/executor.d.ts +7 -0
  90. package/dist/lib/doctor/deep/executor.js +1 -1
  91. package/dist/lib/doctor/deep/parity.js +1 -27
  92. package/dist/lib/doctor/deep/sandbox.d.ts +2 -2
  93. package/dist/lib/doctor/deep/sandbox.js +3 -19
  94. package/dist/lib/doctor/fix/refresh-sync-handoff.js +52 -21
  95. package/dist/lib/doctor/fixtures/discover.d.ts +2 -0
  96. package/dist/lib/doctor/fixtures/discover.js +1 -1
  97. package/dist/lib/doctor/json-output.d.ts +1 -1
  98. package/dist/lib/doctor/registry.d.ts +6 -7
  99. package/dist/lib/doctor/registry.js +6 -7
  100. package/dist/lib/doctor/report.d.ts +9 -10
  101. package/dist/lib/doctor/report.js +4 -4
  102. package/dist/lib/environment/work-requirements.d.ts +1 -1
  103. package/dist/lib/environment/work-requirements.js +1 -1
  104. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  105. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  106. package/dist/lib/hook-engine/coverage.js +11 -3
  107. package/dist/lib/hook-engine/git-stop-config.json +510 -510
  108. package/dist/lib/hook-engine/native-precompact-compatibility.json +443 -443
  109. package/dist/lib/hook-engine/native-stop-compatibility.json +359 -359
  110. package/dist/lib/hot-channels/adapters/meetings.d.ts +1 -16
  111. package/dist/lib/hot-channels/adapters/meetings.js +3 -28
  112. package/dist/lib/hot-channels/adapters/slack.d.ts +3 -1
  113. package/dist/lib/hot-channels/adapters/slack.js +4 -1
  114. package/dist/lib/hot-channels/contract.d.ts +14 -0
  115. package/dist/lib/hot-channels/fleet-complete.d.ts +18 -2
  116. package/dist/lib/hot-channels/fleet-complete.js +29 -4
  117. package/dist/lib/hot-channels/meeting-source-ref.d.ts +17 -0
  118. package/dist/lib/hot-channels/meeting-source-ref.js +32 -0
  119. package/dist/lib/hot-channels/prompts/signals-pass.md +6 -1
  120. package/dist/lib/hot-channels/run.d.ts +10 -0
  121. package/dist/lib/hot-channels/run.js +34 -0
  122. package/dist/lib/hot-channels/signals-pass.d.ts +27 -0
  123. package/dist/lib/hot-channels/signals-pass.js +57 -2
  124. package/dist/lib/hot-channels/signals-runtime.js +3 -2
  125. package/dist/lib/jq/install.d.ts +27 -0
  126. package/dist/lib/jq/install.js +156 -0
  127. package/dist/lib/lanes/accounts.js +2 -2
  128. package/dist/lib/lanes/claude-balance.d.ts +6 -0
  129. package/dist/lib/lanes/claude-balance.js +124 -0
  130. package/dist/lib/lanes/grants.js +15 -2
  131. package/dist/lib/lanes/hq-root.d.ts +1 -1
  132. package/dist/lib/lanes/hq-root.js +1 -1
  133. package/dist/lib/lanes/links.d.ts +1 -1
  134. package/dist/lib/lanes/liveness.d.ts +3 -0
  135. package/dist/lib/lanes/liveness.js +61 -7
  136. package/dist/lib/lanes/models.d.ts +1 -1
  137. package/dist/lib/lanes/models.js +1 -1
  138. package/dist/lib/lanes/outpost-dispatch.d.ts +1 -1
  139. package/dist/lib/lanes/outpost-dispatch.js +13 -13
  140. package/dist/lib/lanes/outpost-pruner-install.js +1 -1
  141. package/dist/lib/lanes/questions.d.ts +1 -1
  142. package/dist/lib/lanes/questions.js +2 -2
  143. package/dist/lib/lanes/spawn.js +4 -6
  144. package/dist/lib/lanes/store.d.ts +13 -2
  145. package/dist/lib/lanes/store.js +13 -5
  146. package/dist/lib/lanes/types.d.ts +7 -7
  147. package/dist/lib/lanes/types.js +1 -1
  148. package/dist/lib/lanes/watcher-main.js +1 -1
  149. package/dist/lib/lanes/watcher.d.ts +1 -1
  150. package/dist/lib/lanes/watcher.js +1 -1
  151. package/dist/lib/mesh/live/daemon/doctor.js +7 -1
  152. package/dist/lib/mesh/live/daemon/install.d.ts +4 -0
  153. package/dist/lib/mesh/live/daemon/install.js +10 -0
  154. package/dist/lib/mesh/live/daemon/run.js +17 -0
  155. package/dist/lib/mesh/live/emit-retry.d.ts +20 -2
  156. package/dist/lib/mesh/live/emit-retry.js +57 -4
  157. package/dist/lib/mesh/live/emit.js +25 -4
  158. package/dist/lib/mesh/live/flush.d.ts +2 -0
  159. package/dist/lib/mesh/live/flush.js +21 -8
  160. package/dist/lib/mesh/live/spool.d.ts +9 -1
  161. package/dist/lib/mesh/live/spool.js +41 -29
  162. package/dist/lib/onboarding/cli/onboard.js +5 -0
  163. package/dist/lib/signals/sanitize.d.ts +19 -0
  164. package/dist/lib/signals/sanitize.js +103 -7
  165. package/dist/lib/signals/steps/upload.d.ts +40 -1
  166. package/dist/lib/signals/steps/upload.js +122 -6
  167. package/dist/lib/sync-core/access-refresh.d.ts +29 -0
  168. package/dist/lib/sync-core/access-refresh.js +97 -0
  169. package/dist/lib/sync-core/company-adoption.d.ts +33 -0
  170. package/dist/lib/sync-core/company-adoption.js +223 -0
  171. package/dist/lib/sync-core/engine-home.d.ts +1 -0
  172. package/dist/lib/sync-core/engine-owned.d.ts +13 -0
  173. package/dist/lib/sync-core/engine-owned.js +38 -0
  174. package/dist/lib/sync-core/hand-back.d.ts +17 -0
  175. package/dist/lib/sync-core/hand-back.js +23 -0
  176. package/dist/lib/sync-core/post-apply-reindex.d.ts +33 -0
  177. package/dist/lib/sync-core/post-apply-reindex.js +149 -0
  178. package/dist/lib/sync-core/reconcile.d.ts +10 -0
  179. package/dist/lib/sync-core/reconcile.js +117 -12
  180. package/dist/lib/sync-core/rollout-state.d.ts +11 -1
  181. package/dist/lib/sync-core/rollout-state.js +40 -4
  182. package/dist/lib/vault-sync-switches.d.ts +14 -0
  183. package/dist/lib/vault-sync-switches.js +22 -0
  184. package/dist/lib/windows/jq.d.ts +4 -0
  185. package/dist/lib/windows/jq.js +10 -39
  186. package/dist/lib/workers-registry/index.d.ts +1 -1
  187. package/dist/lib/workers-registry/index.js +8 -12
  188. package/dist/utils/callback-port-busy.d.ts +2 -2
  189. package/dist/utils/callback-port-busy.js +2 -2
  190. package/dist/utils/cli-network-lifecycle.js +1 -0
  191. package/dist/utils/client-health-contract.d.ts +2 -0
  192. package/dist/utils/client-health-contract.js +1 -1
  193. package/dist/utils/client-health.js +1 -9
  194. package/dist/utils/cognito-config.js +5 -0
  195. package/dist/utils/cognito-session.d.ts +4 -6
  196. package/dist/utils/cognito-session.js +4 -24
  197. package/dist/utils/github-tag-fallback.d.ts +16 -0
  198. package/dist/utils/github-tag-fallback.js +126 -0
  199. package/dist/utils/incomplete-install-error.js +1 -11
  200. package/dist/utils/install-tree-torn.d.ts +11 -0
  201. package/dist/utils/install-tree-torn.js +1 -1
  202. package/dist/utils/resident-package-preload.js +2 -1
  203. package/dist/utils/version-report.d.ts +2 -1
  204. package/dist/utils/version-report.js +40 -27
  205. package/docs/anywhere-runtime.md +8 -0
  206. package/package.json +9 -9
@@ -1127,6 +1127,11 @@ export const COMMAND_CATALOG = [
1127
1127
  "helpText": [],
1128
1128
  "arguments": [],
1129
1129
  "options": [
1130
+ {
1131
+ "flags": "--company-slug <slug>",
1132
+ "description": "Trusted local layout slug; required with HQ_API_KEY and --company cmp_…",
1133
+ "hidden": false
1134
+ },
1130
1135
  {
1131
1136
  "flags": "--hq-root <path>",
1132
1137
  "description": "Local HQ tree root (default: <runtime-path>)",
@@ -8425,6 +8430,11 @@ export const COMMAND_CATALOG = [
8425
8430
  "flags": "--cloud-update",
8426
8431
  "description": "Cloud-update mode",
8427
8432
  "hidden": false
8433
+ },
8434
+ {
8435
+ "flags": "--verbose",
8436
+ "description": "Show diagnostic details when recovery fails",
8437
+ "hidden": false
8428
8438
  }
8429
8439
  ],
8430
8440
  "subcommands": []
@@ -10534,7 +10544,7 @@ export const COMMAND_CATALOG = [
10534
10544
  "options": [
10535
10545
  {
10536
10546
  "flags": "--size <size>",
10537
- "description": "Outpost size: small | medium | large | xlarge. Without it, a terminal shows a menu with prices and medium preselected; a script gets the default, $100/month",
10547
+ "description": "Outpost size: small | medium | large | xlarge. Without it, a terminal shows a menu with prices and small ($100/month) preselected; a script sends no size and is billed the small price",
10538
10548
  "hidden": false
10539
10549
  },
10540
10550
  {
@@ -10627,7 +10637,7 @@ export const COMMAND_CATALOG = [
10627
10637
  },
10628
10638
  {
10629
10639
  "flags": "--size <size>",
10630
- "description": "small, medium, large or xlarge (the server default is medium)",
10640
+ "description": "small, medium, large or xlarge (default medium; the request shows its price)",
10631
10641
  "hidden": false
10632
10642
  },
10633
10643
  {
@@ -10853,7 +10863,7 @@ export const COMMAND_CATALOG = [
10853
10863
  },
10854
10864
  {
10855
10865
  "name": "list",
10856
- "description": "List every Outpost you own, or a company's Outposts with --company",
10866
+ "description": "List your personal Outposts and, grouped by company, the company Outposts you can use. --company lists one company's Outposts",
10857
10867
  "aliases": [],
10858
10868
  "hidden": false,
10859
10869
  "helpOption": true,
@@ -10864,12 +10874,12 @@ export const COMMAND_CATALOG = [
10864
10874
  "options": [
10865
10875
  {
10866
10876
  "flags": "--company <slug>",
10867
- "description": "List the company's Outposts",
10877
+ "description": "List only this company's Outposts",
10868
10878
  "hidden": false
10869
10879
  },
10870
10880
  {
10871
10881
  "flags": "--json",
10872
- "description": "Emit raw JSON",
10882
+ "description": "Emit raw JSON (without --company: your personal Outposts only, as before)",
10873
10883
  "hidden": false
10874
10884
  }
10875
10885
  ],
@@ -11470,23 +11480,23 @@ export const COMMAND_CATALOG = [
11470
11480
  },
11471
11481
  {
11472
11482
  "name": "pull",
11473
- "description": "Download one file from an Outpost through a short-lived download link (for files too large for exec output). <outpost> is the Outpost id (`primary` for your first box). The remote path must be inside the Outpost user's home or HQ dir; relative and ~ paths start at the home dir. The file is saved to [local-path], or to the remote file name in the current directory.",
11483
+ "description": "Download one file from an Outpost through a short-lived download link (for files too large for exec output). <outpost> is your personal Outpost id (`primary` for your first box); for a company Outpost pass --company (and --outpost when the company has more than one) instead. The remote path must be inside the Outpost user's home or HQ dir; relative and ~ paths start at the home dir. The file is saved to [local-path], or to the remote file name in the current directory.",
11474
11484
  "aliases": [],
11475
11485
  "hidden": false,
11476
11486
  "helpOption": true,
11477
11487
  "helpCommand": false,
11478
- "usage": "[options] <outpost> <remote-path> [local-path]",
11488
+ "usage": "<outpost> <remote-path> [local-path] | --company <slug> [--outpost <name|id>] <remote-path> [local-path]",
11479
11489
  "helpText": [],
11480
11490
  "arguments": [
11481
11491
  {
11482
- "name": "outpost",
11492
+ "name": "outpost-or-path",
11483
11493
  "required": true,
11484
11494
  "variadic": false,
11485
11495
  "description": ""
11486
11496
  },
11487
11497
  {
11488
11498
  "name": "remote-path",
11489
- "required": true,
11499
+ "required": false,
11490
11500
  "variadic": false,
11491
11501
  "description": ""
11492
11502
  },
@@ -11498,6 +11508,16 @@ export const COMMAND_CATALOG = [
11498
11508
  }
11499
11509
  ],
11500
11510
  "options": [
11511
+ {
11512
+ "flags": "--company <slug>",
11513
+ "description": "Run on this company's Outpost (owners, admins, and members approved for it; others: hq outposts request-access)",
11514
+ "hidden": false
11515
+ },
11516
+ {
11517
+ "flags": "--outpost <name|id>",
11518
+ "description": "Which company Outpost, when the company has more than one",
11519
+ "hidden": false
11520
+ },
11501
11521
  {
11502
11522
  "flags": "--force",
11503
11523
  "description": "Replace the local file if it already exists",
@@ -11670,6 +11690,11 @@ export const COMMAND_CATALOG = [
11670
11690
  "description": "Which company Outpost, when the company has more than one",
11671
11691
  "hidden": false
11672
11692
  },
11693
+ {
11694
+ "flags": "--no-wait",
11695
+ "description": "With --company: return once HQ has the code, without waiting for the Outpost to confirm sign-in",
11696
+ "hidden": false
11697
+ },
11673
11698
  {
11674
11699
  "flags": "--json",
11675
11700
  "description": "Emit raw JSON",
@@ -21310,6 +21335,11 @@ export const COMMAND_CATALOG = [
21310
21335
  "description": "Confirm the registered Outpost hosting a native lane",
21311
21336
  "hidden": false
21312
21337
  },
21338
+ {
21339
+ "flags": "--company <slug>",
21340
+ "description": "Company that owns the --outpost company Outpost",
21341
+ "hidden": false
21342
+ },
21313
21343
  {
21314
21344
  "flags": "--json",
21315
21345
  "description": "JSON on stdout (always)",
@@ -26384,7 +26414,7 @@ export const COMMAND_CATALOG = [
26384
26414
  "subcommands": [
26385
26415
  {
26386
26416
  "name": "list",
26387
- "description": "List comments on an app in your org",
26417
+ "description": "List comments on an app in your org, or on a personal app with --personal",
26388
26418
  "aliases": [],
26389
26419
  "hidden": false,
26390
26420
  "helpOption": true,
@@ -26405,6 +26435,11 @@ export const COMMAND_CATALOG = [
26405
26435
  "description": "use this company instead of the active company",
26406
26436
  "hidden": false
26407
26437
  },
26438
+ {
26439
+ "flags": "--personal",
26440
+ "description": "read a personal app (personal deploy scope) instead of a company app",
26441
+ "hidden": false
26442
+ },
26408
26443
  {
26409
26444
  "flags": "--json",
26410
26445
  "description": "print the API comment array as JSON",
@@ -26495,6 +26530,221 @@ export const COMMAND_CATALOG = [
26495
26530
  }
26496
26531
  ]
26497
26532
  },
26533
+ {
26534
+ "name": "events",
26535
+ "description": "Read and answer site events that visitors send from your deployed apps",
26536
+ "aliases": [],
26537
+ "hidden": false,
26538
+ "helpOption": true,
26539
+ "helpCommand": true,
26540
+ "usage": "[options] [command]",
26541
+ "helpText": [],
26542
+ "arguments": [],
26543
+ "options": [],
26544
+ "subcommands": [
26545
+ {
26546
+ "name": "enable",
26547
+ "description": "Turn site events on (or off with --off) for an app",
26548
+ "aliases": [],
26549
+ "hidden": false,
26550
+ "helpOption": true,
26551
+ "helpCommand": false,
26552
+ "usage": "[options] <app-id>",
26553
+ "helpText": [],
26554
+ "arguments": [
26555
+ {
26556
+ "name": "app-id",
26557
+ "required": true,
26558
+ "variadic": false,
26559
+ "description": ""
26560
+ }
26561
+ ],
26562
+ "options": [
26563
+ {
26564
+ "flags": "--company <slug>",
26565
+ "description": "company owning the app",
26566
+ "hidden": false
26567
+ },
26568
+ {
26569
+ "flags": "--personal",
26570
+ "description": "use personal scope",
26571
+ "hidden": false
26572
+ },
26573
+ {
26574
+ "flags": "--off",
26575
+ "description": "turn site events off; stored events are kept",
26576
+ "hidden": false
26577
+ },
26578
+ {
26579
+ "flags": "--json",
26580
+ "description": "print {ok, appId, eventsEnabled} as JSON",
26581
+ "hidden": false
26582
+ }
26583
+ ],
26584
+ "subcommands": []
26585
+ },
26586
+ {
26587
+ "name": "list",
26588
+ "description": "List site events on an app",
26589
+ "aliases": [],
26590
+ "hidden": false,
26591
+ "helpOption": true,
26592
+ "helpCommand": false,
26593
+ "usage": "[options] <app-id>",
26594
+ "helpText": [],
26595
+ "arguments": [
26596
+ {
26597
+ "name": "app-id",
26598
+ "required": true,
26599
+ "variadic": false,
26600
+ "description": ""
26601
+ }
26602
+ ],
26603
+ "options": [
26604
+ {
26605
+ "flags": "--company <slug>",
26606
+ "description": "company owning the app",
26607
+ "hidden": false
26608
+ },
26609
+ {
26610
+ "flags": "--personal",
26611
+ "description": "use personal scope",
26612
+ "hidden": false
26613
+ },
26614
+ {
26615
+ "flags": "--after <event-id>",
26616
+ "description": "only events after this event id",
26617
+ "hidden": false
26618
+ },
26619
+ {
26620
+ "flags": "--status <status>",
26621
+ "description": "new or handled",
26622
+ "hidden": false
26623
+ },
26624
+ {
26625
+ "flags": "--limit <n>",
26626
+ "description": "maximum number of events",
26627
+ "hidden": false
26628
+ },
26629
+ {
26630
+ "flags": "--json",
26631
+ "description": "print the API response ({events, nextAfter}) as JSON",
26632
+ "hidden": false
26633
+ }
26634
+ ],
26635
+ "subcommands": []
26636
+ },
26637
+ {
26638
+ "name": "reply",
26639
+ "description": "Reply to a site event and/or set its status",
26640
+ "aliases": [],
26641
+ "hidden": false,
26642
+ "helpOption": true,
26643
+ "helpCommand": false,
26644
+ "usage": "[options] <app-id> <event-id>",
26645
+ "helpText": [],
26646
+ "arguments": [
26647
+ {
26648
+ "name": "app-id",
26649
+ "required": true,
26650
+ "variadic": false,
26651
+ "description": ""
26652
+ },
26653
+ {
26654
+ "name": "event-id",
26655
+ "required": true,
26656
+ "variadic": false,
26657
+ "description": ""
26658
+ }
26659
+ ],
26660
+ "options": [
26661
+ {
26662
+ "flags": "--company <slug>",
26663
+ "description": "company owning the app",
26664
+ "hidden": false
26665
+ },
26666
+ {
26667
+ "flags": "--personal",
26668
+ "description": "use personal scope",
26669
+ "hidden": false
26670
+ },
26671
+ {
26672
+ "flags": "--text <reply>",
26673
+ "description": "reply text the page shows",
26674
+ "hidden": false
26675
+ },
26676
+ {
26677
+ "flags": "--status <status>",
26678
+ "description": "new or handled",
26679
+ "hidden": false
26680
+ },
26681
+ {
26682
+ "flags": "--json",
26683
+ "description": "print {ok, id, status, reply} as JSON",
26684
+ "hidden": false
26685
+ }
26686
+ ],
26687
+ "subcommands": []
26688
+ },
26689
+ {
26690
+ "name": "watch",
26691
+ "description": "Poll for new site events and print one JSON line per event",
26692
+ "aliases": [],
26693
+ "hidden": false,
26694
+ "helpOption": true,
26695
+ "helpCommand": false,
26696
+ "usage": "[options] <app-id>",
26697
+ "helpText": [],
26698
+ "arguments": [
26699
+ {
26700
+ "name": "app-id",
26701
+ "required": true,
26702
+ "variadic": false,
26703
+ "description": ""
26704
+ }
26705
+ ],
26706
+ "options": [
26707
+ {
26708
+ "flags": "--company <slug>",
26709
+ "description": "company owning the app",
26710
+ "hidden": false
26711
+ },
26712
+ {
26713
+ "flags": "--personal",
26714
+ "description": "use personal scope",
26715
+ "hidden": false
26716
+ },
26717
+ {
26718
+ "flags": "--cursor-file <path>",
26719
+ "description": "file that stores the last reported event id",
26720
+ "hidden": false
26721
+ },
26722
+ {
26723
+ "flags": "--label <name>",
26724
+ "description": "name used in the output lines (default: the app id)",
26725
+ "hidden": false
26726
+ },
26727
+ {
26728
+ "flags": "--interval <seconds>",
26729
+ "description": "seconds between polls, at least 30",
26730
+ "hidden": false,
26731
+ "defaultValue": "30"
26732
+ },
26733
+ {
26734
+ "flags": "--status <status>",
26735
+ "description": "new or handled (default: new)",
26736
+ "hidden": false
26737
+ },
26738
+ {
26739
+ "flags": "--once",
26740
+ "description": "poll once and exit",
26741
+ "hidden": false
26742
+ }
26743
+ ],
26744
+ "subcommands": []
26745
+ }
26746
+ ]
26747
+ },
26498
26748
  {
26499
26749
  "name": "list",
26500
26750
  "description": "List deploy apps in your company, optionally filtered by name or subdomain",
@@ -558,6 +558,12 @@ export declare const REGISTRATION_PLAN: readonly [{
558
558
  readonly parent: "deploy";
559
559
  readonly module: "./commands/deploy-comments.js";
560
560
  readonly exportName: "registerDeployCommentsCommand";
561
+ }, {
562
+ readonly type: "registrar";
563
+ readonly root: "deploy";
564
+ readonly parent: "deploy";
565
+ readonly module: "./commands/deploy-events.js";
566
+ readonly exportName: "registerDeployEventsCommand";
561
567
  }, {
562
568
  readonly type: "registrar";
563
569
  readonly root: "deploy";
@@ -95,6 +95,7 @@ export const REGISTRATION_PLAN = [
95
95
  { type: "registrar", root: "report", parent: "program", module: "./commands/report.js", exportName: "registerReportCommand" },
96
96
  { type: "group", root: "deploy", id: "deploy", name: "deploy", description: "Manage deployments in hq-deploy" },
97
97
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-comments.js", exportName: "registerDeployCommentsCommand" },
98
+ { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-events.js", exportName: "registerDeployEventsCommand" },
98
99
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-list.js", exportName: "registerDeployListCommand" },
99
100
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-mutations.js", exportName: "registerDeployMutationsCommand" },
100
101
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-access.js", exportName: "registerDeployAccessCommand" },
@@ -24,6 +24,7 @@
24
24
  * only (`hq daemon sync pause`, the tray pause), and a manual push while
25
25
  * background sync is paused is expected to run.
26
26
  */
27
+ import { engineOwnedVaultsFromState, NO_ENGINE_VAULTS, readEngineOwnedVaults, type EngineOwnedVaults } from "../lib/sync-core/engine-owned.js";
27
28
  import { readVaultSyncSwitches, vaultSkipEnv, type VaultSyncSwitches } from "../lib/vault-sync-switches.js";
28
29
  export { readVaultSyncSwitches, vaultSkipEnv, type VaultSyncSwitches };
29
30
  /**
@@ -37,13 +38,7 @@ export type GatedSyncCommand = "push" | "pull" | "now";
37
38
  export declare function isCloudOff(home?: string): boolean;
38
39
  /** True when `company` (a slug) is a company vault whose switch is off. */
39
40
  export declare function isCompanyVaultOff(switches: VaultSyncSwitches, company: string): boolean;
40
- export interface EngineOwnedVaults {
41
- personal: boolean;
42
- companies: ReadonlySet<string>;
43
- uidSlugs: ReadonlyMap<string, string>;
44
- }
45
- export declare const NO_ENGINE_VAULTS: EngineOwnedVaults;
46
- export declare function readEngineOwnedVaults(home?: string): EngineOwnedVaults;
41
+ export { engineOwnedVaultsFromState, NO_ENGINE_VAULTS, readEngineOwnedVaults, type EngineOwnedVaults };
47
42
  /**
48
43
  * The refusal text when every vault is off. The first line keeps the phrase
49
44
  * "refused immediately": `handoff-sync-prefetch` (shell and native) reports
@@ -53,6 +48,11 @@ export declare function readEngineOwnedVaults(home?: string): EngineOwnedVaults;
53
48
  export declare function cloudOffMessage(command: GatedSyncCommand): string;
54
49
  /** The refusal text when the one vault a command targets is off. */
55
50
  export declare function vaultOffMessage(command: GatedSyncCommand, vaultName: string): string;
51
+ /**
52
+ * The refusal text when the new sync engine owns the vault a pull or sync-now targets. Keeps
53
+ * "refused immediately" on the first line for the same reason as {@link cloudOffMessage}.
54
+ */
55
+ export declare function engineOwnedMessage(command: GatedSyncCommand, vaultName: string): string;
56
56
  /** The refusal text when a company uid cannot be mapped while some vault is off. */
57
57
  export declare function unresolvedVaultMessage(command: GatedSyncCommand, ref: string): string;
58
58
  /** Which vaults a `push|pull|now` invocation targets. */
@@ -131,7 +131,8 @@ export declare function writeVaultRefusal(refusal: VaultRefusal, deps?: Pick<Clo
131
131
  * targets an off vault (or every vault is off); otherwise return what an
132
132
  * `--all` run must skip. Runs before any login, lock or network work, and
133
133
  * outside the client-health report, so a refusal is not counted as a failed
134
- * sync. Warns when the settings file is unreadable.
134
+ * sync. Warns about unreadable switch settings and exits 1 if the rollout
135
+ * state cannot establish which engine owns the vaults.
135
136
  */
136
137
  export declare function refuseSyncForOffVaults(command: GatedSyncCommand, selection: SyncSelection, deps?: CloudOffGateDeps): VaultSkips;
137
138
  /**
@@ -25,10 +25,10 @@
25
25
  * background sync is paused is expected to run.
26
26
  */
27
27
  import * as fs from "node:fs";
28
- import * as os from "node:os";
29
28
  import * as path from "node:path";
30
29
  import { readCompaniesManifestMap } from "../lib/work-context/repo-remote.js";
31
- import { readSyncCoreRolloutState } from "../lib/sync-core/rollout-state.js";
30
+ import { SyncCoreRolloutStateError } from "../lib/sync-core/rollout-state.js";
31
+ import { engineOwnedVaultsFromState, NO_ENGINE_VAULTS, readEngineOwnedVaults, } from "../lib/sync-core/engine-owned.js";
32
32
  import { readVaultSyncSwitches, unreadableSwitchesWarning, vaultSkipEnv, } from "../lib/vault-sync-switches.js";
33
33
  export { readVaultSyncSwitches, vaultSkipEnv };
34
34
  /**
@@ -45,34 +45,7 @@ export function isCloudOff(home) {
45
45
  export function isCompanyVaultOff(switches, company) {
46
46
  return switches.offCompanies.has(company.trim().toLowerCase());
47
47
  }
48
- export const NO_ENGINE_VAULTS = {
49
- personal: false,
50
- companies: new Set(),
51
- uidSlugs: new Map(),
52
- };
53
- export function readEngineOwnedVaults(home = os.homedir()) {
54
- const state = readSyncCoreRolloutState(home);
55
- if (!state)
56
- return NO_ENGINE_VAULTS;
57
- const held = new Set((state.held ?? []).map((h) => h.uid.toLowerCase()));
58
- let personal = false;
59
- const companies = new Set();
60
- const uidSlugs = new Map();
61
- for (const vault of state.vaults) {
62
- if (vault.phase !== "full" || held.has(vault.uid.toLowerCase()))
63
- continue;
64
- if (vault.kind === "personal") {
65
- personal = true;
66
- continue;
67
- }
68
- const slug = vault.slug?.trim().toLowerCase();
69
- if (!slug)
70
- continue;
71
- companies.add(slug);
72
- uidSlugs.set(vault.uid.toLowerCase(), slug);
73
- }
74
- return { personal, companies, uidSlugs };
75
- }
48
+ export { engineOwnedVaultsFromState, NO_ENGINE_VAULTS, readEngineOwnedVaults };
76
49
  const HOW_TO_TURN_ON = "To turn it back on, open HQ and go to Settings > Sync.";
77
50
  const NOTHING_MOVED = "Nothing was uploaded or downloaded. Your local files are unchanged.";
78
51
  /**
@@ -96,6 +69,17 @@ export function vaultOffMessage(command, vaultName) {
96
69
  HOW_TO_TURN_ON,
97
70
  ].join("\n");
98
71
  }
72
+ /**
73
+ * The refusal text when the new sync engine owns the vault a pull or sync-now targets. Keeps
74
+ * "refused immediately" on the first line for the same reason as {@link cloudOffMessage}.
75
+ */
76
+ export function engineOwnedMessage(command, vaultName) {
77
+ return [
78
+ `The new sync is handling ${vaultName} on this computer and keeps it up to date in the background, so \`hq sync ${command}\` is not needed and was refused immediately.`,
79
+ "This command uploaded and downloaded nothing. Your local files are unchanged.",
80
+ "To see what the new sync is doing, run `hq sync-core status`.",
81
+ ].join("\n");
82
+ }
99
83
  /** The refusal text when a company uid cannot be mapped while some vault is off. */
100
84
  export function unresolvedVaultMessage(command, ref) {
101
85
  return [
@@ -146,14 +130,18 @@ function refusalForVault(command, vault, switches, engine) {
146
130
  const enginePush = command === "push";
147
131
  switch (vault.kind) {
148
132
  case "personal":
149
- return switches.personalOff && !(enginePush && engine.personal)
150
- ? { message: vaultOffMessage(command, "your personal vault"), vault: "personal" }
151
- : null;
152
- case "company":
153
- return isCompanyVaultOff(switches, vault.slug) &&
154
- !(enginePush && engine.companies.has(vault.slug.trim().toLowerCase()))
155
- ? { message: vaultOffMessage(command, vault.slug), vault: vault.slug }
156
- : null;
133
+ if (!switches.personalOff || (enginePush && engine.personal))
134
+ return null;
135
+ return {
136
+ message: (engine.personal ? engineOwnedMessage : vaultOffMessage)(command, "your personal vault"),
137
+ vault: "personal",
138
+ };
139
+ case "company": {
140
+ const engineOwned = engine.companies.has(vault.slug.trim().toLowerCase());
141
+ if (!isCompanyVaultOff(switches, vault.slug) || (enginePush && engineOwned))
142
+ return null;
143
+ return { message: (engineOwned ? engineOwnedMessage : vaultOffMessage)(command, vault.slug), vault: vault.slug };
144
+ }
157
145
  case "unknown": {
158
146
  const engineSlug = engine.uidSlugs.get(vault.ref.toLowerCase());
159
147
  if (engineSlug)
@@ -246,12 +234,25 @@ function warnIfUnreadable(switches, deps) {
246
234
  * targets an off vault (or every vault is off); otherwise return what an
247
235
  * `--all` run must skip. Runs before any login, lock or network work, and
248
236
  * outside the client-health report, so a refusal is not counted as a failed
249
- * sync. Warns when the settings file is unreadable.
237
+ * sync. Warns about unreadable switch settings and exits 1 if the rollout
238
+ * state cannot establish which engine owns the vaults.
250
239
  */
251
240
  export function refuseSyncForOffVaults(command, selection, deps = {}) {
252
241
  const switches = readVaultSyncSwitches(deps.home);
253
242
  warnIfUnreadable(switches, deps);
254
- const refusal = refusalFor(command, selection, switches, readEngineOwnedVaults(deps.home));
243
+ let engine;
244
+ try {
245
+ engine = readEngineOwnedVaults(deps.home);
246
+ }
247
+ catch (error) {
248
+ if (!(error instanceof SyncCoreRolloutStateError))
249
+ throw error;
250
+ const writeErr = deps.writeErr ?? ((text) => process.stderr.write(text));
251
+ const message = error.message;
252
+ writeErr(deps.json ? `${JSON.stringify({ type: "fatal", message })}\n` : `${message}\n`);
253
+ return (deps.exit ?? ((code) => process.exit(code)))(1);
254
+ }
255
+ const refusal = refusalFor(command, selection, switches, engine);
255
256
  if (refusal) {
256
257
  writeVaultRefusal(refusal, deps);
257
258
  (deps.exit ?? ((code) => process.exit(code)))(CLOUD_OFF_EXIT_CODE);
@@ -14,7 +14,7 @@
14
14
  * (also `hq daemon sync status --local`)
15
15
  */
16
16
  import { Command } from "commander";
17
- import { type ConflictStrategy, type EntityContext, type MembershipSyncConfig, type SyncMode, type PullScope, type ExplicitGrant, type ShareOptions, type VaultServiceConfig } from "@indigoai-us/hq-cloud";
17
+ import { VaultClient, scopeLookupSkipMessage, SyncScopeLookupError, type ConflictStrategy, type EntityContext, type MembershipSyncConfig, type SyncMode, type PullScope, type ExplicitGrant, type ShareOptions, type VaultServiceConfig } from "@indigoai-us/hq-cloud";
18
18
  import { withSyncWatchdog, type SyncWatchdogLimits } from "../utils/sync-watchdog.js";
19
19
  import { type BannerLevel } from "../lib/narrow-hint-banner.js";
20
20
  import { type PlanLimitRefusalSummary } from "../lib/billing/plan-limit-refusals.js";
@@ -576,6 +576,7 @@ export interface PullAllResult {
576
576
  }>;
577
577
  perCompany: PullAllRow[];
578
578
  }
579
+ export { scopeLookupSkipMessage, SyncScopeLookupError };
579
580
  export declare function pullAll(options: PullAllOptions, deps: PullAllDeps): Promise<PullAllResult>;
580
581
  /**
581
582
  * Drives `hq sync push --all`: same membership + canonical-person fanout as
@@ -661,6 +662,21 @@ export interface PerCompanyPullResolveResult {
661
662
  resolvedMode: MembershipSyncConfig["syncMode"] | undefined;
662
663
  }
663
664
  export declare function resolvePerCompanyPullPlan(client: PerCompanyPullResolveClient, targetCompany: string | undefined): Promise<PerCompanyPullResolveResult>;
665
+ /**
666
+ * Resolve the effective PULL scope (DEV-1768) for a single foreground pull
667
+ * (`hq sync pull` / `hq sync now`), so the membership's REAL syncMode +
668
+ * prefixSet are threaded into `sync()`. Without this the CLI ran `syncMode:
669
+ * "all"` and stamped an all-mode PullRecord that wedged the next menubar sync.
670
+ *
671
+ * Delegates to the shared `resolvePullScope` (same resolver the runner uses),
672
+ * which fails closed since hq-cloud 6.18.117. Returns `undefined` only when no
673
+ * company is named or active (then `sync()` resolves the active company itself
674
+ * and pulls `all`, as before). When the lookup fails it throws (audit item 4):
675
+ * an auth refusal is rethrown as-is so the sign-in message survives, and any
676
+ * other failure is a bounded {@link SyncScopeLookupError}. The command then
677
+ * stops for this company rather than syncing unscoped. Exported for tests.
678
+ */
679
+ export declare function resolveCliPullScope(client: VaultClient, companyRef: string | undefined, hqRoot: string, onResolvedCompanyUid?: (companyUid: string) => void): Promise<PullScope | undefined>;
664
680
  export declare function registerCloudCommands(program: Command): void;
665
681
  /**
666
682
  * `hq sync doctor --reconcile-conflicts [--yes]`.
@@ -825,5 +841,4 @@ export declare function describePushSkips(result: {
825
841
  text: string;
826
842
  warn: boolean;
827
843
  };
828
- export {};
829
844
  //# sourceMappingURL=cloud.d.ts.map