@indigoai-us/hq-cli 5.345.250 → 5.345.252

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 (186) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/assets/scaffold/core/scripts/hq-session.sh +9 -0
  3. package/contracts/host-canary-release.json +9 -3
  4. package/dist/command-catalog.generated.d.ts +316 -2
  5. package/dist/command-catalog.generated.js +389 -2
  6. package/dist/commands/bot.js +12 -3
  7. package/dist/commands/core-bucket-c-work-mesh-offer-native.js +1 -1
  8. package/dist/commands/core-hq-session-binding.d.ts +140 -0
  9. package/dist/commands/core-hq-session-binding.js +363 -0
  10. package/dist/commands/core-hq-session-native.d.ts +23 -0
  11. package/dist/commands/core-hq-session-native.js +59 -9
  12. package/dist/commands/core-stop-autosave.js +1 -1
  13. package/dist/commands/core.js +10 -0
  14. package/dist/commands/doctor.d.ts +5 -1
  15. package/dist/commands/doctor.js +42 -5
  16. package/dist/commands/files.js +1 -1
  17. package/dist/commands/install-global.js +4 -2
  18. package/dist/commands/lanes.d.ts +2 -0
  19. package/dist/commands/lanes.js +9 -4
  20. package/dist/commands/logout.js +4 -0
  21. package/dist/commands/ontology-graph.d.ts +11 -2
  22. package/dist/commands/ontology-graph.js +130 -4
  23. package/dist/commands/report.js +35 -2
  24. package/dist/commands/sources.js +26 -8
  25. package/dist/commands/storage-gate.js +1 -1
  26. package/dist/commands/vault-retention-flag.js +2 -1
  27. package/dist/commands/whoami.js +1 -1
  28. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +238 -221
  29. package/dist/hq-cloud-sync-runner/package.json +1 -1
  30. package/dist/index.js +3 -1
  31. package/dist/lib/agent-kit/inbox-poll-backoff-flag.js +1 -1
  32. package/dist/lib/agent-kit/mcp/tools.js +48 -0
  33. package/dist/lib/bot/fleet-bots-update-pass.js +1 -1
  34. package/dist/lib/bot/fleet-cron.d.ts +37 -0
  35. package/dist/lib/bot/fleet-cron.js +59 -12
  36. package/dist/lib/bot/fleet-local.d.ts +18 -0
  37. package/dist/lib/bot/fleet-local.js +51 -5
  38. package/dist/lib/bot/inbox-poll-backoff-flag.js +1 -1
  39. package/dist/lib/bot/signals-engine-flag.d.ts +1 -1
  40. package/dist/lib/bot/signals-engine-flag.js +1 -1
  41. package/dist/lib/cli-invite-nudge.js +1 -1
  42. package/dist/lib/client-version.d.ts +2 -0
  43. package/dist/lib/client-version.js +24 -0
  44. package/dist/lib/company-flag-gate.d.ts +30 -0
  45. package/dist/lib/company-flag-gate.js +104 -0
  46. package/dist/lib/core-utils/hook-timeout-debug-context-flag.js +1 -1
  47. package/dist/lib/daemon/flag.js +2 -1
  48. package/dist/lib/daemon/legacy-journal-gate.js +3 -1
  49. package/dist/lib/daemon/shared-flag-reads.js +1 -1
  50. package/dist/lib/doctor/checks/host-core.js +22 -4
  51. package/dist/lib/doctor/checks/jq.d.ts +27 -6
  52. package/dist/lib/doctor/checks/jq.js +46 -8
  53. package/dist/lib/doctor/client-health-reason-codes-flag.js +1 -1
  54. package/dist/lib/doctor/fix/refresh-sync-handoff.d.ts +1 -1
  55. package/dist/lib/doctor/fix/refresh-sync-handoff.js +1 -1
  56. package/dist/lib/flag-client-gate-headers.d.ts +38 -0
  57. package/dist/lib/flag-client-gate-headers.js +62 -0
  58. package/dist/lib/flag-client-headers.d.ts +15 -0
  59. package/dist/lib/flag-client-headers.js +25 -0
  60. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  61. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  62. package/dist/lib/flag-registry-worker.js +35 -0
  63. package/dist/lib/flag-registry.d.ts +1 -20
  64. package/dist/lib/flag-registry.js +5 -81
  65. package/dist/lib/hook-engine/adapter-core-pin.d.ts +29 -0
  66. package/dist/lib/hook-engine/adapter-core-pin.js +29 -0
  67. package/dist/lib/hook-engine/coverage.d.ts +68 -8
  68. package/dist/lib/hook-engine/coverage.js +167 -25
  69. package/dist/lib/hook-engine/native-stop-compatibility.json +9 -4
  70. package/dist/lib/hook-engine/reconcile.js +3 -2
  71. package/dist/lib/hot-channels/graph-context.d.ts +26 -1
  72. package/dist/lib/hot-channels/graph-context.js +76 -9
  73. package/dist/lib/hot-channels/prompts/signals-pass.md +20 -0
  74. package/dist/lib/hot-channels/run.d.ts +1 -0
  75. package/dist/lib/hot-channels/signal-changes.d.ts +228 -0
  76. package/dist/lib/hot-channels/signal-changes.js +683 -0
  77. package/dist/lib/hot-channels/signals-pass.d.ts +24 -0
  78. package/dist/lib/hot-channels/signals-pass.js +240 -15
  79. package/dist/lib/lanes/outpost-worktree-pruner-flag.d.ts +1 -1
  80. package/dist/lib/lanes/outpost-worktree-pruner-flag.js +1 -1
  81. package/dist/lib/lanes/registry-flag.js +2 -1
  82. package/dist/lib/lanes/spawn.js +11 -1
  83. package/dist/lib/mesh/live/binding-intent.d.ts +61 -0
  84. package/dist/lib/mesh/live/binding-intent.js +201 -0
  85. package/dist/lib/mesh/live/binding-receipt.d.ts +157 -0
  86. package/dist/lib/mesh/live/binding-receipt.js +365 -0
  87. package/dist/lib/mesh/live/company-flag-refresh.js +1 -1
  88. package/dist/lib/mesh/live/daemon/doctor-telemetry.d.ts +39 -0
  89. package/dist/lib/mesh/live/daemon/doctor-telemetry.js +58 -0
  90. package/dist/lib/mesh/live/daemon/install.js +2 -1
  91. package/dist/lib/mesh/live/daemon/presence.js +9 -0
  92. package/dist/lib/mesh/live/daemon/run.d.ts +3 -0
  93. package/dist/lib/mesh/live/daemon/run.js +33 -1
  94. package/dist/lib/ontology-graph/lineage/index.d.ts +401 -0
  95. package/dist/lib/ontology-graph/lineage/index.js +1027 -0
  96. package/dist/lib/ontology-graph/model/files.d.ts +4 -0
  97. package/dist/lib/ontology-graph/model/files.js +23 -0
  98. package/dist/lib/ontology-graph/model/index.d.ts +65 -1
  99. package/dist/lib/ontology-graph/model/index.js +154 -18
  100. package/dist/lib/ontology-graph/model/pass-tasks.d.ts +84 -1
  101. package/dist/lib/ontology-graph/model/pass-tasks.js +173 -4
  102. package/dist/lib/ontology-graph/model/pass.d.ts +11 -0
  103. package/dist/lib/ontology-graph/model/pass.js +17 -10
  104. package/dist/lib/ontology-graph/model/pending-items.d.ts +39 -0
  105. package/dist/lib/ontology-graph/model/pending-items.js +136 -0
  106. package/dist/lib/ontology-graph/model/step.d.ts +47 -2
  107. package/dist/lib/ontology-graph/model/step.js +202 -36
  108. package/dist/lib/ontology-graph/model/tasks.d.ts +28 -4
  109. package/dist/lib/ontology-graph/model/tasks.js +48 -15
  110. package/dist/lib/ontology-graph/pages/render.d.ts +1 -1
  111. package/dist/lib/ontology-graph/pages/render.js +4 -3
  112. package/dist/lib/ontology-graph/read/brief.d.ts +13 -3
  113. package/dist/lib/ontology-graph/read/brief.js +349 -67
  114. package/dist/lib/ontology-graph/read/index.d.ts +5 -1
  115. package/dist/lib/ontology-graph/read/index.js +174 -30
  116. package/dist/lib/ontology-graph/read/lineage.d.ts +101 -0
  117. package/dist/lib/ontology-graph/read/lineage.js +262 -0
  118. package/dist/lib/ontology-graph/read/reader-setting.d.ts +2 -0
  119. package/dist/lib/ontology-graph/read/reader-setting.js +4 -1
  120. package/dist/lib/ontology-graph/remodel/index.d.ts +174 -0
  121. package/dist/lib/ontology-graph/remodel/index.js +450 -0
  122. package/dist/lib/ontology-graph/replay/buffered-store.js +17 -0
  123. package/dist/lib/ontology-graph/replay/engine.d.ts +32 -1
  124. package/dist/lib/ontology-graph/replay/engine.js +213 -8
  125. package/dist/lib/ontology-graph/replay/extractors.d.ts +26 -0
  126. package/dist/lib/ontology-graph/replay/extractors.js +25 -1
  127. package/dist/lib/ontology-graph/replay/index.d.ts +2 -0
  128. package/dist/lib/ontology-graph/replay/index.js +120 -8
  129. package/dist/lib/ontology-graph/replay/signal-changes.d.ts +118 -0
  130. package/dist/lib/ontology-graph/replay/signal-changes.js +687 -0
  131. package/dist/lib/ontology-graph/schema/authority.d.ts +14 -5
  132. package/dist/lib/ontology-graph/schema/authority.js +13 -3
  133. package/dist/lib/ontology-graph/schema/decision-status.d.ts +18 -0
  134. package/dist/lib/ontology-graph/schema/decision-status.js +20 -0
  135. package/dist/lib/ontology-graph/schema/index.d.ts +2 -1
  136. package/dist/lib/ontology-graph/schema/index.js +2 -1
  137. package/dist/lib/ontology-graph/setup/index.d.ts +88 -0
  138. package/dist/lib/ontology-graph/setup/index.js +499 -0
  139. package/dist/lib/ontology-graph/types.d.ts +21 -0
  140. package/dist/lib/ontology-graph/types.js +5 -0
  141. package/dist/lib/search-index/index.d.ts +33 -1
  142. package/dist/lib/search-index/index.js +180 -25
  143. package/dist/lib/search-index/qmd-exit-diagnostics.d.ts +7 -0
  144. package/dist/lib/search-index/qmd-exit-diagnostics.js +25 -1
  145. package/dist/lib/signals/adapters-catalog.js +1 -1
  146. package/dist/lib/signals/failure-alert.js +4 -5
  147. package/dist/lib/signals/steps/adapters.js +3 -0
  148. package/dist/lib/sync-core/engine-holds.d.ts +1 -0
  149. package/dist/lib/sync-core/engine-holds.js +26 -0
  150. package/dist/lib/sync-core/engine-home.d.ts +3 -0
  151. package/dist/lib/sync-core/engine-home.js +41 -1
  152. package/dist/lib/sync-core/flag.js +2 -1
  153. package/dist/lib/sync-core/legacy-journal-export-child.js +5 -3
  154. package/dist/lib/sync-core/legacy-journal-export.d.ts +23 -4
  155. package/dist/lib/sync-core/legacy-journal-export.js +120 -55
  156. package/dist/lib/sync-core/reconcile.d.ts +2 -1
  157. package/dist/lib/sync-core/reconcile.js +30 -5
  158. package/dist/lib/sync-invalid-entity-warning.js +2 -1
  159. package/dist/lib/windows/install-followup.d.ts +41 -0
  160. package/dist/lib/windows/install-followup.js +87 -0
  161. package/dist/lib/windows/jq.d.ts +59 -0
  162. package/dist/lib/windows/jq.js +154 -3
  163. package/dist/lib/windows/user-path.d.ts +5 -0
  164. package/dist/lib/windows/user-path.js +1 -1
  165. package/dist/lib/work-context/auto-bind.d.ts +12 -0
  166. package/dist/lib/work-context/auto-bind.js +49 -3
  167. package/dist/lib/work-context/organize.d.ts +4 -2
  168. package/dist/lib/work-context/organize.js +18 -8
  169. package/dist/lib/work-context/reconcile.js +16 -1
  170. package/dist/main.js +12 -1
  171. package/dist/utils/client-health-contract.d.ts +30 -0
  172. package/dist/utils/client-health-contract.js +111 -0
  173. package/dist/utils/client-health.d.ts +5 -2
  174. package/dist/utils/client-health.js +74 -5
  175. package/dist/utils/exclusive-lock.d.ts +5 -1
  176. package/dist/utils/exclusive-lock.js +9 -2
  177. package/dist/utils/host-registration.d.ts +7 -0
  178. package/dist/utils/host-registration.js +10 -1
  179. package/dist/utils/pid.d.ts +31 -0
  180. package/dist/utils/pid.js +65 -0
  181. package/dist/utils/resident-package-preload.js +12 -4
  182. package/dist/utils/sentry-fingerprint.js +3 -0
  183. package/dist/utils/sync-person.d.ts +15 -0
  184. package/dist/utils/sync-person.js +74 -0
  185. package/package.json +8 -8
  186. package/scripts/install-hook-engine.mjs +5 -3
@@ -6916,6 +6916,152 @@ export const COMMAND_CATALOG = [
6916
6916
  "arguments": [],
6917
6917
  "options": [],
6918
6918
  "subcommands": [
6919
+ {
6920
+ "name": "status",
6921
+ "description": "Show the reader, the model, the graph folder, its counts, pending model work, the last update and the brief (reads only)",
6922
+ "aliases": [],
6923
+ "hidden": false,
6924
+ "helpOption": true,
6925
+ "helpCommand": false,
6926
+ "usage": "[options]",
6927
+ "helpText": [],
6928
+ "arguments": [],
6929
+ "options": [
6930
+ {
6931
+ "flags": "--company <slug>",
6932
+ "description": "company whose graph to use",
6933
+ "hidden": false
6934
+ },
6935
+ {
6936
+ "flags": "--hq-root <path>",
6937
+ "description": "HQ installation to operate on",
6938
+ "hidden": false
6939
+ },
6940
+ {
6941
+ "flags": "--graph-root <path>",
6942
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
6943
+ "hidden": false
6944
+ },
6945
+ {
6946
+ "flags": "--member <person uid>",
6947
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
6948
+ "hidden": false
6949
+ },
6950
+ {
6951
+ "flags": "--audience-key <key>",
6952
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
6953
+ "hidden": false
6954
+ },
6955
+ {
6956
+ "flags": "--json",
6957
+ "description": "print JSON",
6958
+ "hidden": false
6959
+ }
6960
+ ],
6961
+ "subcommands": []
6962
+ },
6963
+ {
6964
+ "name": "reader",
6965
+ "description": "Show or set which ontology this machine's sessions read for the company: graph, or entities (the old files)",
6966
+ "aliases": [],
6967
+ "hidden": false,
6968
+ "helpOption": true,
6969
+ "helpCommand": false,
6970
+ "usage": "[options] [reader]",
6971
+ "helpText": [],
6972
+ "arguments": [
6973
+ {
6974
+ "name": "reader",
6975
+ "required": false,
6976
+ "variadic": false,
6977
+ "description": "graph or entities; leave out to show the setting"
6978
+ }
6979
+ ],
6980
+ "options": [
6981
+ {
6982
+ "flags": "--company <slug>",
6983
+ "description": "company whose graph to use",
6984
+ "hidden": false
6985
+ },
6986
+ {
6987
+ "flags": "--hq-root <path>",
6988
+ "description": "HQ installation to operate on",
6989
+ "hidden": false
6990
+ },
6991
+ {
6992
+ "flags": "--graph-root <path>",
6993
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
6994
+ "hidden": false
6995
+ },
6996
+ {
6997
+ "flags": "--member <person uid>",
6998
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
6999
+ "hidden": false
7000
+ },
7001
+ {
7002
+ "flags": "--audience-key <key>",
7003
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7004
+ "hidden": false
7005
+ },
7006
+ {
7007
+ "flags": "--json",
7008
+ "description": "print JSON",
7009
+ "hidden": false
7010
+ }
7011
+ ],
7012
+ "subcommands": []
7013
+ },
7014
+ {
7015
+ "name": "model",
7016
+ "description": "Show or set the model the graph's model step uses for the company on this machine (per machine; the setting does not sync)",
7017
+ "aliases": [],
7018
+ "hidden": false,
7019
+ "helpOption": true,
7020
+ "helpCommand": false,
7021
+ "usage": "[options] [model]",
7022
+ "helpText": [],
7023
+ "arguments": [
7024
+ {
7025
+ "name": "model",
7026
+ "required": false,
7027
+ "variadic": false,
7028
+ "description": "model name, for example haiku, sonnet or opus; leave out to show the setting"
7029
+ }
7030
+ ],
7031
+ "options": [
7032
+ {
7033
+ "flags": "--company <slug>",
7034
+ "description": "company whose graph to use",
7035
+ "hidden": false
7036
+ },
7037
+ {
7038
+ "flags": "--hq-root <path>",
7039
+ "description": "HQ installation to operate on",
7040
+ "hidden": false
7041
+ },
7042
+ {
7043
+ "flags": "--graph-root <path>",
7044
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
7045
+ "hidden": false
7046
+ },
7047
+ {
7048
+ "flags": "--member <person uid>",
7049
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
7050
+ "hidden": false
7051
+ },
7052
+ {
7053
+ "flags": "--audience-key <key>",
7054
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7055
+ "hidden": false
7056
+ },
7057
+ {
7058
+ "flags": "--json",
7059
+ "description": "print JSON",
7060
+ "hidden": false
7061
+ }
7062
+ ],
7063
+ "subcommands": []
7064
+ },
6919
7065
  {
6920
7066
  "name": "rebuild",
6921
7067
  "description": "Rebuild the graph: import the old entity files, then replay the vault day by day",
@@ -6977,6 +7123,16 @@ export const COMMAND_CATALOG = [
6977
7123
  "description": "stop model calls after this many input tokens; 0 runs rules only",
6978
7124
  "hidden": false
6979
7125
  },
7126
+ {
7127
+ "flags": "--max-input-tokens <n>",
7128
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7129
+ "hidden": false
7130
+ },
7131
+ {
7132
+ "flags": "--max-output-tokens <n>",
7133
+ "description": "model output tokens allowed per day for this run (default 20000)",
7134
+ "hidden": false
7135
+ },
6980
7136
  {
6981
7137
  "flags": "--no-model",
6982
7138
  "description": "rules only: make no model call and leave model work pending",
@@ -7061,6 +7217,11 @@ export const COMMAND_CATALOG = [
7061
7217
  "description": "model output tokens allowed per day for this run (default 20000)",
7062
7218
  "hidden": false
7063
7219
  },
7220
+ {
7221
+ "flags": "--follow-up",
7222
+ "description": "also send model work an earlier run left pending (profiles, retyped links, decisions, summaries), within the daily cap",
7223
+ "hidden": false
7224
+ },
7064
7225
  {
7065
7226
  "flags": "--dry-run",
7066
7227
  "description": "read and count, write nothing",
@@ -7069,6 +7230,227 @@ export const COMMAND_CATALOG = [
7069
7230
  ],
7070
7231
  "subcommands": []
7071
7232
  },
7233
+ {
7234
+ "name": "remodel",
7235
+ "description": "Ask again, on the model in use, what another model wrote, and close that model's rows (history kept)",
7236
+ "aliases": [],
7237
+ "hidden": false,
7238
+ "helpOption": true,
7239
+ "helpCommand": false,
7240
+ "usage": "[options]",
7241
+ "helpText": [],
7242
+ "arguments": [],
7243
+ "options": [
7244
+ {
7245
+ "flags": "--company <slug>",
7246
+ "description": "company whose graph to use",
7247
+ "hidden": false
7248
+ },
7249
+ {
7250
+ "flags": "--hq-root <path>",
7251
+ "description": "HQ installation to operate on",
7252
+ "hidden": false
7253
+ },
7254
+ {
7255
+ "flags": "--graph-root <path>",
7256
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
7257
+ "hidden": false
7258
+ },
7259
+ {
7260
+ "flags": "--member <person uid>",
7261
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
7262
+ "hidden": false
7263
+ },
7264
+ {
7265
+ "flags": "--audience-key <key>",
7266
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7267
+ "hidden": false
7268
+ },
7269
+ {
7270
+ "flags": "--json",
7271
+ "description": "print JSON",
7272
+ "hidden": false
7273
+ },
7274
+ {
7275
+ "flags": "--from <model>",
7276
+ "description": "model whose rows to replace, for example haiku",
7277
+ "hidden": false
7278
+ },
7279
+ {
7280
+ "flags": "--kinds <list>",
7281
+ "description": "ask again only what wrote these fact fields and relationship verbs, comma-separated (role_title,affiliation,works_at)",
7282
+ "hidden": false
7283
+ },
7284
+ {
7285
+ "flags": "--budget-tokens <n>",
7286
+ "description": "stop model calls after this many input tokens",
7287
+ "hidden": false
7288
+ },
7289
+ {
7290
+ "flags": "--max-input-tokens <n>",
7291
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7292
+ "hidden": false
7293
+ },
7294
+ {
7295
+ "flags": "--max-output-tokens <n>",
7296
+ "description": "model output tokens allowed per day for this run (default 20000)",
7297
+ "hidden": false
7298
+ },
7299
+ {
7300
+ "flags": "--dry-run",
7301
+ "description": "count the rows and estimate the tokens; call no model and write nothing",
7302
+ "hidden": false
7303
+ }
7304
+ ],
7305
+ "subcommands": []
7306
+ },
7307
+ {
7308
+ "name": "lineage",
7309
+ "description": "Decision lineage: which decision replaced an earlier one",
7310
+ "aliases": [],
7311
+ "hidden": false,
7312
+ "helpOption": true,
7313
+ "helpCommand": true,
7314
+ "usage": "[options] [command]",
7315
+ "helpText": [],
7316
+ "arguments": [],
7317
+ "options": [],
7318
+ "subcommands": [
7319
+ {
7320
+ "name": "backfill",
7321
+ "description": "Ask the model, day by day from the oldest, whether each decision with no stated change replaces or reverses an earlier open one, and write a link for each that holds (model authority, no status row; each written link is listed in .state/lineage-backfill.jsonl, and `hq ontology lineage undo` removes exactly those). A day with a decision that got no usable reply is not written: the next run sends it again, and after 3 runs it is recorded as unanswered. Exit code 2 when the walk stopped early, 3 when it finished with a decision unanswered in this run. Runs whenever it is invoked, whatever model_tasks says",
7322
+ "aliases": [],
7323
+ "hidden": false,
7324
+ "helpOption": true,
7325
+ "helpCommand": false,
7326
+ "usage": "[options]",
7327
+ "helpText": [],
7328
+ "arguments": [],
7329
+ "options": [
7330
+ {
7331
+ "flags": "--company <slug>",
7332
+ "description": "company whose graph to use",
7333
+ "hidden": false
7334
+ },
7335
+ {
7336
+ "flags": "--hq-root <path>",
7337
+ "description": "HQ installation to operate on",
7338
+ "hidden": false
7339
+ },
7340
+ {
7341
+ "flags": "--graph-root <path>",
7342
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
7343
+ "hidden": false
7344
+ },
7345
+ {
7346
+ "flags": "--member <person uid>",
7347
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
7348
+ "hidden": false
7349
+ },
7350
+ {
7351
+ "flags": "--audience-key <key>",
7352
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7353
+ "hidden": false
7354
+ },
7355
+ {
7356
+ "flags": "--json",
7357
+ "description": "print JSON",
7358
+ "hidden": false
7359
+ },
7360
+ {
7361
+ "flags": "--from <date>",
7362
+ "description": "first decision day to ask about (YYYY-MM-DD)",
7363
+ "hidden": false
7364
+ },
7365
+ {
7366
+ "flags": "--to <date>",
7367
+ "description": "last decision day to ask about (YYYY-MM-DD)",
7368
+ "hidden": false
7369
+ },
7370
+ {
7371
+ "flags": "--restart",
7372
+ "description": "forget what earlier runs settled, their attempt counts and their unanswered decisions, and walk from the first day; answers already given cost nothing",
7373
+ "hidden": false
7374
+ },
7375
+ {
7376
+ "flags": "--retry-unanswered",
7377
+ "description": "send the decisions earlier runs recorded as unanswered again",
7378
+ "hidden": false
7379
+ },
7380
+ {
7381
+ "flags": "--allow-unanswered",
7382
+ "description": "record a decision with no usable reply as unanswered at once instead of holding its day for the next run, and do not exit non-zero for it",
7383
+ "hidden": false
7384
+ },
7385
+ {
7386
+ "flags": "--max-input-tokens <n>",
7387
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7388
+ "hidden": false
7389
+ },
7390
+ {
7391
+ "flags": "--max-output-tokens <n>",
7392
+ "description": "model output tokens allowed per day for this run (default 20000)",
7393
+ "hidden": false
7394
+ },
7395
+ {
7396
+ "flags": "--dry-run",
7397
+ "description": "count the decisions and batches and estimate the tokens and the list-price cost as ranges, with the flags that let the estimate through the daily cap; call no model and write nothing",
7398
+ "hidden": false
7399
+ }
7400
+ ],
7401
+ "subcommands": []
7402
+ },
7403
+ {
7404
+ "name": "undo",
7405
+ "description": "Take back what `hq ontology lineage backfill` wrote: remove the rows .state/lineage-backfill.jsonl lists (each link's edge and its inverse) and clear the walk's state, so a later backfill starts from the first day. A row is removed only when the graph still holds it as the backfill wrote it; a row changed since is left and counted. No other row is touched, and no model is called",
7406
+ "aliases": [],
7407
+ "hidden": false,
7408
+ "helpOption": true,
7409
+ "helpCommand": false,
7410
+ "usage": "[options]",
7411
+ "helpText": [],
7412
+ "arguments": [],
7413
+ "options": [
7414
+ {
7415
+ "flags": "--company <slug>",
7416
+ "description": "company whose graph to use",
7417
+ "hidden": false
7418
+ },
7419
+ {
7420
+ "flags": "--hq-root <path>",
7421
+ "description": "HQ installation to operate on",
7422
+ "hidden": false
7423
+ },
7424
+ {
7425
+ "flags": "--graph-root <path>",
7426
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
7427
+ "hidden": false
7428
+ },
7429
+ {
7430
+ "flags": "--member <person uid>",
7431
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
7432
+ "hidden": false
7433
+ },
7434
+ {
7435
+ "flags": "--audience-key <key>",
7436
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7437
+ "hidden": false
7438
+ },
7439
+ {
7440
+ "flags": "--json",
7441
+ "description": "print JSON",
7442
+ "hidden": false
7443
+ },
7444
+ {
7445
+ "flags": "--dry-run",
7446
+ "description": "count what would be removed and left; write nothing",
7447
+ "hidden": false
7448
+ }
7449
+ ],
7450
+ "subcommands": []
7451
+ }
7452
+ ]
7453
+ },
7072
7454
  {
7073
7455
  "name": "lookup",
7074
7456
  "description": "Find an entity by name and print its facts, each with a source and date",
@@ -7341,7 +7723,7 @@ export const COMMAND_CATALOG = [
7341
7723
  },
7342
7724
  {
7343
7725
  "name": "brief",
7344
- "description": "Write brief.md, the short summary every session starts with",
7726
+ "description": "Write brief.md, the short text every session starts with: a map of the graph and how to look things up",
7345
7727
  "aliases": [],
7346
7728
  "hidden": false,
7347
7729
  "helpOption": true,
@@ -7384,6 +7766,11 @@ export const COMMAND_CATALOG = [
7384
7766
  "flags": "--stdout",
7385
7767
  "description": "print the brief without writing it",
7386
7768
  "hidden": false
7769
+ },
7770
+ {
7771
+ "flags": "--style <style>",
7772
+ "description": "map: what the graph holds, the lookup commands and names worth looking up, with no facts. full: the earlier summary with facts in it. Default: brief_style in the reader setting, else map",
7773
+ "hidden": false
7387
7774
  }
7388
7775
  ],
7389
7776
  "subcommands": []
@@ -17293,7 +17680,7 @@ export const COMMAND_CATALOG = [
17293
17680
  },
17294
17681
  {
17295
17682
  "flags": "--fix-jq",
17296
- "description": "Install the verified jq required by HQ hooks on Windows.",
17683
+ "description": "Install the verified jq required by HQ hooks on Windows, add it to your PATH, and check it.",
17297
17684
  "hidden": false
17298
17685
  },
17299
17686
  {
@@ -14,6 +14,7 @@ import { checkClaudeLoginNow, readSignalsClaudeLogin, recordSignalsPassClaudeLog
14
14
  import { fleetCompleteTargetFor } from "../lib/hot-channels/fleet-complete.js";
15
15
  import { machineTimeZone } from "../lib/bot/job-run.js";
16
16
  import { runCompanyHotChannelSync } from "./sources.js";
17
+ import { resolveSyncPerson } from "../utils/sync-person.js";
17
18
  import { OwnerContextCache, lookupOwnerContext } from "../lib/bot/owner-context.js";
18
19
  import { hasActivePromotion, localPromotionState } from "../lib/bot/promotion-receipt.js";
19
20
  import { botBusyState, readInflightTurns } from "../lib/bot/inflight.js";
@@ -94,6 +95,7 @@ import { gatedInteractiveLogin } from "../utils/interactive-caller.js";
94
95
  import { brainSignInStatus, fleetInstallProgressReporter, fleetRuntimeStatus, runBotAuthStatus, runBotRuntimeInstall, runBotRuntimeStatus, runBotSignIn } from "./bot-runtime.js";
95
96
  import { ensureFleetRuntimeInstalled } from "../lib/bot/fleet-local.js";
96
97
  import { installFleetRuntimeSources, installOptionalFleetRuntimeSources } from "../lib/bot/fleet-runtime-sources.js";
98
+ import { signalPid } from "../utils/pid.js";
97
99
  function collectRepeated(value, previous) {
98
100
  return [...previous, value];
99
101
  }
@@ -258,11 +260,15 @@ async function syncFleetRuntimeJobs(name, dir, config) {
258
260
  if (migrated) {
259
261
  const movedCount = migrated.imported;
260
262
  const moved = `moved ${movedCount} scheduled job${movedCount === 1 ? "" : "s"} into the HQ Fleet Runtime${migrated.alreadyPresent ? ` (${migrated.alreadyPresent} already there)` : ""}`;
263
+ for (const { jobId, note } of migrated.notes ?? [])
264
+ log("info", `scheduled job ${jobId}: ${note}`);
261
265
  if (migrated.skipped.length === 0) {
262
266
  log("info", `${moved}; the old list is kept at ${migrated.renamedTo}`);
263
267
  }
264
268
  else {
265
- const message = `${moved}, but could not move ${migrated.skipped.length} scheduled job(s) (${migrated.skipped.join(", ")}): the HQ Fleet Runtime cannot run their schedule. They are still in ${path.join(dir, "jobs.json")}, which was not renamed, and they will not run until you add them again with hq bot jobs --add using a schedule the runtime supports.`;
269
+ const reasons = new Map((migrated.skippedReasons ?? []).map((entry) => [entry.jobId, entry.reason]));
270
+ const each = migrated.skipped.map((jobId) => `${jobId} (${reasons.get(jobId) ?? "the HQ Fleet Runtime cannot run its schedule"})`).join("; ");
271
+ const message = `${moved}, but could not move ${migrated.skipped.length} scheduled job(s): ${each}. They are left unchanged in ${path.join(dir, "jobs.json")}, which was not renamed, and they will not run until you add them again with hq bot jobs --add using a schedule the runtime supports.`;
266
272
  log("warn", message);
267
273
  console.warn(`Warning: ${name}: ${message}`);
268
274
  }
@@ -303,7 +309,8 @@ async function syncFleetRuntimeJobs(name, dir, config) {
303
309
  executiveCompanies: role.executiveCompanies,
304
310
  };
305
311
  const signalsJobEnabled = await fleetHotSignalSyncEngineCompanies(jobs, undefined, (message) => log("warn", message));
306
- const result = ensureFleetHotSignalSync({ ...jobs, signalsJobEnabled });
312
+ const noPersonIdentity = resolveSyncPerson().kind === "no-person";
313
+ const result = ensureFleetHotSignalSync({ ...jobs, signalsJobEnabled, noPersonIdentity });
307
314
  if (executive === false && result.removed.length > 0) {
308
315
  log("info", `removed the daily hot-signal-sync from this bot (${result.removed.length} job${result.removed.length === 1 ? "" : "s"}): ${executiveBot ? `${executiveBot.name} is the Executive bot now and runs it` : "only the Executive bot runs it"}`);
309
316
  }
@@ -316,6 +323,8 @@ async function syncFleetRuntimeJobs(name, dir, config) {
316
323
  log("info", `registered the daily hot-signal-sync job for ${entry.company} at 06:30 in the HQ Fleet Runtime`);
317
324
  if (entry.heldBy)
318
325
  log("info", `not adding a hot-signal-sync job for ${entry.company}: the bot in ${entry.heldBy} already runs it`);
326
+ if (entry.noPersonIdentity)
327
+ log("warn", `not adding a hot-signal-sync job for ${entry.company}: this computer's HQ sign-in is a machine identity that acts for no person, so the sync would have no one to run for`);
319
328
  }
320
329
  }
321
330
  catch (err) {
@@ -1429,7 +1438,7 @@ async function stopBot(name, dir, config, output) {
1429
1438
  const s = readBotStatus(dir);
1430
1439
  if (s) {
1431
1440
  try {
1432
- process.kill(s.pid, "SIGKILL");
1441
+ signalPid(s.pid, "SIGKILL");
1433
1442
  }
1434
1443
  catch {
1435
1444
  /* ignore */
@@ -1,7 +1,7 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { loadCachedTokens } from "@indigoai-us/hq-cloud";
4
- import { createFlagClient } from "@indigoai-us/hq-flags-client";
4
+ import { createHqFlagClient as createFlagClient } from "../lib/flag-client-headers.js";
5
5
  import { resolveFlagRegistryEndpoint } from "../lib/flag-registry-endpoint.js";
6
6
  const success = (stdout) => ({ code: 0, stdout, stderr: "" });
7
7
  const failure = (stderr) => ({ code: 1, stdout: "", stderr: `${stderr}\n` });
@@ -0,0 +1,140 @@
1
+ /**
2
+ * After a successful `hq core hq-session` company change, write the session's
3
+ * binding receipt (src/lib/mesh/live/binding-receipt.ts).
4
+ *
5
+ * A receipt is written only for a change that reached `hq` from a person, an
6
+ * agent or a launcher:
7
+ *
8
+ * - not when `HQ_HQ_SESSION_NO_CLI=1` is set (a hook wrote meta.yaml itself
9
+ * and told the script not to come here);
10
+ * - not from inside a hook run. master-hook (`export HQ_HOOK_EVENT`) and the
11
+ * native hook host (crates/hq-hook/src/dispatch) set `HQ_HOOK_EVENT` for
12
+ * every child they start, so a bind a hook makes on its own, such as the
13
+ * SessionStart folder-registry bind, carries it. A command the agent runs
14
+ * is started by the host, not by a hook, and does not;
15
+ * - not, as a second guard for hook runtimes that set no such variable,
16
+ * when meta.yaml carries `foreign_cwd` (the registry bind's own line) and
17
+ * the session has not had a turn yet (no Work Mesh sequence file);
18
+ * - not for a session the command found through the global, last-writer-wins
19
+ * `workspace/sessions/.current`. Another session can rewrite that file
20
+ * between the change and this write.
21
+ * - not for a session found through the environment. A child process
22
+ * inherits its parent's session variables: a Codex child has the
23
+ * parent's CLAUDE_CODE_SESSION_ID next to its own CODEX_THREAD_ID, and a
24
+ * Cursor or Antigravity shell started from Claude Code has only the
25
+ * parent's. Only a `--session-id` the caller typed counts, and only when
26
+ * it names a session that no session variable in this environment names:
27
+ * hq-session.sh forwards an id it took from the environment as
28
+ * `--session-id` (and, from the release that has it, says so with
29
+ * `HQ_SESSION_ID_SOURCE=env`), so an id equal to one in the environment
30
+ * cannot be told from an inherited one by the CLI alone. That holds
31
+ * for scripts that do not set the marker too. Such a change gets a
32
+ * receipt only when the hook host confirmed it: the native scope guard
33
+ * leaves a single-use intent for the real session of the tool call that
34
+ * ran it (src/lib/mesh/live/binding-intent.ts), and this command consumes
35
+ * a matching one. Until the hook writes intents, there is none, and the
36
+ * change gets no counting receipt, as before. One rule keeps the
37
+ * receipt from disagreeing with the lock set: when such an unconfirmed
38
+ * change leaves a lock set different from the session's last line in
39
+ * this tree (an unbind, a remove, a switch, or an add that turns one
40
+ * company into two), a line is still written with the new lock set and
41
+ * the source `unconfirmed`, which never counts. Only an exact repeat of
42
+ * the last line's set writes nothing;
43
+ * - not when meta.yaml of that session does not show the change (another
44
+ * writer won).
45
+ *
46
+ * The receipt's source is the source of the bind action itself, never the
47
+ * label meta.yaml happens to carry: a `set company_slug` that got here is an
48
+ * explicit act (`explicit`), unless the caller names its own source in
49
+ * `HQ_SESSION_COMPANY_SOURCE` (a value that is not a plain lowercase word is
50
+ * recorded as no source, which never counts), or the run is unattended
51
+ * (`HQ_SYNC_UNATTENDED`,
52
+ * which `hq core job run` and Outpost units export): that is
53
+ * `scheduled_task`. `set company_source` writes no receipt, so the label
54
+ * cannot turn a default into a choice afterwards.
55
+ *
56
+ * Each line names the HQ tree it was made in, so a reader of another tree
57
+ * never counts it. When `--session-id` names a session other than the
58
+ * caller's own (the session id in the environment), the caller is recorded
59
+ * as `actor`.
60
+ *
61
+ * meta.yaml is read and the line appended under the session's company lock,
62
+ * so the line holds the lock set as the last writer left it.
63
+ *
64
+ * After a receipt line that leaves the session bound to exactly one company,
65
+ * when that bind counts and the company's `work-mesh-company-reporting-required`
66
+ * flag is fresh and on, the command prints "Activity in session <short id>
67
+ * (this session | not this session) is reported to <company>. Required by
68
+ * the company." Nothing records that the line was shown: whether a person
69
+ * saw it is decided by slice 6's person-only channel, not by this command.
70
+ *
71
+ * Nothing here can fail the command: any error means no receipt and no line.
72
+ */
73
+ import { type BindingAction, type BindingLine, type BindingPaths } from "../lib/mesh/live/binding-receipt.js";
74
+ import type { HqSessionTarget } from "./core-hq-session-native.js";
75
+ export interface RecordSessionBindingDeps extends BindingPaths {
76
+ /**
77
+ * The session the command changed and how it was found. Null, or found
78
+ * through `.current`: no receipt.
79
+ */
80
+ target: HqSessionTarget | null;
81
+ /** Writes the member line. Defaults to stdout. */
82
+ write?: (text: string) => void;
83
+ /** The company's cloud uid, for its reporting flag. Defaults to {@link companyCloudUid}. */
84
+ companyUid?: (hqRoot: string, slug: string) => string | null;
85
+ /** Runs the action while holding the session's company lock. */
86
+ withCompanyLock?: <T>(sessionId: string, action: () => T) => T;
87
+ }
88
+ type ReceiptAction = Exclude<BindingAction, "source">;
89
+ /** The company change a `hq-session` command line asks for, or null. */
90
+ export declare function bindingActionOf(argv: readonly string[]): {
91
+ globalArgs: string[];
92
+ action: ReceiptAction;
93
+ slug: string;
94
+ } | null;
95
+ /**
96
+ * The value of the last `--session-id` in the leading global arguments, as
97
+ * hq-session.sh and the native command read it (a later flag wins). Undefined
98
+ * when there is none.
99
+ */
100
+ export declare function lastSessionFlag(globalArgs: readonly string[]): string | undefined;
101
+ /**
102
+ * Every distinct session id the environment's session variables name,
103
+ * lower-cased: session folders and receipt files live on case-insensitive
104
+ * file systems, so ids that differ only in case are the same session.
105
+ */
106
+ export declare function environmentSessionIds(env: NodeJS.ProcessEnv): string[];
107
+ /**
108
+ * The id came from the environment: hq-session.sh said so, or it equals an
109
+ * id a session variable here names (an older script that sets no marker
110
+ * forwards such an id as --session-id, and an inherited id looks the same).
111
+ */
112
+ export declare function sessionIdFromEnvironment(sessionId: string, env: NodeJS.ProcessEnv): boolean;
113
+ /**
114
+ * The company's cloud uid: `companies/<slug>/.company-uid` first, then
115
+ * `companies.<slug>.cloud_uid` in companies/manifest.yaml, the same order as
116
+ * the daemon's recordedUid (src/lib/daemon/hook-requests-mesh.ts). Null when
117
+ * neither holds a valid uid.
118
+ */
119
+ export declare function companyCloudUid(hqRoot: string, slug: string): string | null;
120
+ /** The company's cloud uid from `companies/manifest.yaml` (`companies.<slug>.cloud_uid`), or null. */
121
+ export declare function manifestCompanyUid(hqRoot: string, slug: string): string | null;
122
+ /**
123
+ * The session the bundled hq-session.sh changed, from the two sources it
124
+ * reads before `.current`: the last `--session-id`, then a session id in the
125
+ * environment (same keys and order as core/scripts/lib/session-id.sh). Null
126
+ * when neither names one; the script then fell back to `.current`.
127
+ */
128
+ export declare function scriptSessionTarget(argv: readonly string[], env?: NodeJS.ProcessEnv): HqSessionTarget | null;
129
+ /**
130
+ * The source of this change. `previous` is the receipt's last line: the bind
131
+ * the session already had.
132
+ */
133
+ /** The source of an unconfirmed line that only closes: never on the allowlist. */
134
+ export declare const UNCONFIRMED_SOURCE = "unconfirmed";
135
+ export declare function recordSessionBinding(argv: readonly string[], context: {
136
+ cwd: string;
137
+ hqRoot?: string;
138
+ }, deps: RecordSessionBindingDeps): BindingLine | null;
139
+ export {};
140
+ //# sourceMappingURL=core-hq-session-binding.d.ts.map