@indigoai-us/hq-cli 5.345.220 → 5.345.222
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.
- package/CHANGELOG.md +164 -0
- package/dist/command-catalog.generated.d.ts +175 -2
- package/dist/command-catalog.generated.js +213 -2
- package/dist/commands/auth.js +6 -2
- package/dist/commands/bot-runtime.d.ts +18 -5
- package/dist/commands/bot-runtime.js +29 -12
- package/dist/commands/bot.d.ts +39 -2
- package/dist/commands/bot.js +140 -11
- package/dist/commands/core-delegate-w1b.js +9 -3
- package/dist/commands/core-stop-autosave.d.ts +21 -0
- package/dist/commands/core-stop-autosave.js +300 -0
- package/dist/commands/core.js +2 -0
- package/dist/commands/daemon.d.ts +6 -0
- package/dist/commands/daemon.js +46 -8
- package/dist/commands/doctor-usage.d.ts +5 -0
- package/dist/commands/doctor-usage.js +25 -0
- package/dist/commands/env.d.ts +49 -4
- package/dist/commands/env.js +355 -5
- package/dist/commands/lanes-shared.d.ts +3 -0
- package/dist/commands/lanes.d.ts +3 -0
- package/dist/commands/lanes.js +87 -3
- package/dist/commands/link.d.ts +2 -0
- package/dist/commands/link.js +14 -2
- package/dist/commands/mesh.js +23 -3
- package/dist/commands/sources.js +3 -3
- package/dist/commands/sync-core.d.ts +7 -0
- package/dist/commands/sync-core.js +132 -3
- package/dist/commands/whoami.js +96 -80
- package/dist/data/command-states.json +3 -0
- package/dist/lib/bot/config.d.ts +17 -0
- package/dist/lib/bot/config.js +13 -0
- package/dist/lib/bot/fleet-cron.js +24 -2
- package/dist/lib/bot/fleet-local.d.ts +30 -2
- package/dist/lib/bot/fleet-local.js +60 -1
- package/dist/lib/bot/grok-login-scope.d.ts +36 -0
- package/dist/lib/bot/grok-login-scope.js +93 -0
- package/dist/lib/bot/legacy-provider-login.d.ts +32 -9
- package/dist/lib/bot/legacy-provider-login.js +28 -22
- package/dist/lib/bot/runtime-sign-in-check.js +6 -1
- package/dist/lib/bot/runtime-sign-in.d.ts +2 -0
- package/dist/lib/core-utils/sentry-report.js +2 -0
- package/dist/lib/daemon/catalog.js +2 -0
- package/dist/lib/daemon/install.d.ts +2 -1
- package/dist/lib/daemon/install.js +9 -0
- package/dist/lib/daemon/legacy.d.ts +1 -0
- package/dist/lib/daemon/legacy.js +5 -2
- package/dist/lib/daemon/machine-check-owner.d.ts +2 -0
- package/dist/lib/daemon/machine-check-owner.js +6 -1
- package/dist/lib/daemon/machine-checks.d.ts +29 -2
- package/dist/lib/daemon/machine-checks.js +64 -13
- package/dist/lib/daemon/mesh-owner.d.ts +45 -0
- package/dist/lib/daemon/mesh-owner.js +166 -0
- package/dist/lib/daemon/native-notice-ledger.d.ts +27 -0
- package/dist/lib/daemon/native-notice-ledger.js +113 -0
- package/dist/lib/daemon/run.d.ts +15 -0
- package/dist/lib/daemon/run.js +137 -11
- package/dist/lib/daemon/selfcheck.d.ts +35 -2
- package/dist/lib/daemon/selfcheck.js +118 -9
- package/dist/lib/daemon/stop-autosave-lock.d.ts +19 -0
- package/dist/lib/daemon/stop-autosave-lock.js +166 -0
- package/dist/lib/daemon/stop-autosave.d.ts +28 -0
- package/dist/lib/daemon/stop-autosave.js +111 -0
- package/dist/lib/daemon/stop-diagnostics.d.ts +11 -0
- package/dist/lib/daemon/stop-diagnostics.js +136 -0
- package/dist/lib/daemon/stop-job-executor.d.ts +19 -0
- package/dist/lib/daemon/stop-job-executor.js +126 -0
- package/dist/lib/daemon/stop-jobs.d.ts +93 -0
- package/dist/lib/daemon/stop-jobs.js +599 -0
- package/dist/lib/doctor/checks/fleet-hook-core.js +1 -1
- package/dist/lib/doctor/checks/host-core.js +1 -1
- package/dist/lib/environment/access-probes.d.ts +234 -0
- package/dist/lib/environment/access-probes.js +918 -0
- package/dist/lib/environment/profile.d.ts +15 -2
- package/dist/lib/environment/profile.js +55 -20
- package/dist/lib/environment/rfc3339.d.ts +8 -0
- package/dist/lib/environment/rfc3339.js +26 -0
- package/dist/lib/environment/work-requirements.d.ts +169 -0
- package/dist/lib/environment/work-requirements.js +389 -0
- package/dist/lib/hook-engine/coverage.d.ts +146 -7
- package/dist/lib/hook-engine/coverage.js +1480 -4
- package/dist/lib/hook-engine/fleet-registration.js +2 -2
- package/dist/lib/hook-engine/git-stop-config.json +513 -0
- package/dist/lib/hook-engine/native-stop-compatibility.json +362 -0
- package/dist/lib/hook-engine/reconcile.js +2 -2
- package/dist/lib/hot-channels/alert.d.ts +2 -2
- package/dist/lib/hot-channels/alert.js +8 -5
- package/dist/lib/hot-channels/signals-pass.d.ts +126 -17
- package/dist/lib/hot-channels/signals-pass.js +296 -17
- package/dist/lib/hot-channels/signals-runtime.d.ts +30 -0
- package/dist/lib/hot-channels/signals-runtime.js +82 -0
- package/dist/lib/install/hook-target.js +1 -1
- package/dist/lib/lanes/host-capacity.d.ts +26 -2
- package/dist/lib/lanes/host-capacity.js +17 -2
- package/dist/lib/lanes/host-compute.d.ts +90 -0
- package/dist/lib/lanes/host-compute.js +185 -0
- package/dist/lib/lanes/index.d.ts +2 -0
- package/dist/lib/lanes/index.js +1 -0
- package/dist/lib/lanes/reconcile.js +22 -1
- package/dist/lib/lanes/resource-usage.d.ts +155 -0
- package/dist/lib/lanes/resource-usage.js +589 -0
- package/dist/lib/lanes/run-size.d.ts +46 -0
- package/dist/lib/lanes/run-size.js +197 -0
- package/dist/lib/lanes/store.js +27 -0
- package/dist/lib/lanes/throttle.d.ts +36 -1
- package/dist/lib/lanes/throttle.js +47 -10
- package/dist/lib/lanes/types.d.ts +40 -0
- package/dist/lib/lanes/types.js +2 -2
- package/dist/lib/lanes/watcher.js +13 -4
- package/dist/lib/lanes/worker-process.d.ts +25 -2
- package/dist/lib/lanes/worker-process.js +71 -19
- package/dist/lib/mesh/live/daemon/config.d.ts +8 -1
- package/dist/lib/mesh/live/daemon/config.js +16 -0
- package/dist/lib/mesh/live/daemon/install.d.ts +31 -2
- package/dist/lib/mesh/live/daemon/install.js +142 -1
- package/dist/lib/mesh/live/daemon/login-home.d.ts +5 -0
- package/dist/lib/mesh/live/daemon/login-home.js +27 -0
- package/dist/lib/mesh/live/daemon/unit-home.d.ts +49 -0
- package/dist/lib/mesh/live/daemon/unit-home.js +134 -0
- package/dist/lib/placement/match.d.ts +192 -0
- package/dist/lib/placement/match.js +667 -0
- package/dist/lib/registry/registry.d.ts +35 -7
- package/dist/lib/registry/registry.js +88 -13
- package/dist/lib/safe-store.d.ts +14 -0
- package/dist/lib/safe-store.js +77 -4
- package/dist/lib/scan-packages/index.js +24 -2
- package/dist/lib/search-index/index.d.ts +88 -4
- package/dist/lib/search-index/index.js +288 -24
- package/dist/lib/search-index/max-doc-bytes.d.ts +17 -6
- package/dist/lib/search-index/max-doc-bytes.js +49 -23
- package/dist/lib/service-manager/startup-migration.d.ts +1 -0
- package/dist/lib/service-manager/startup-migration.js +3 -0
- package/dist/lib/signals/codex-lockdown.d.ts +79 -0
- package/dist/lib/signals/codex-lockdown.js +271 -0
- package/dist/lib/signals/codex-login.d.ts +37 -0
- package/dist/lib/signals/codex-login.js +83 -0
- package/dist/lib/signals/engine.d.ts +27 -0
- package/dist/lib/signals/engine.js +70 -0
- package/dist/lib/signals/reply.js +22 -1
- package/dist/lib/signals/run-record.js +6 -1
- package/dist/lib/signals/settings.d.ts +5 -0
- package/dist/lib/signals/settings.js +2 -0
- package/dist/lib/signals/steps/extract.d.ts +85 -9
- package/dist/lib/signals/steps/extract.js +317 -68
- package/dist/lib/signals/steps/types.d.ts +2 -0
- package/dist/lib/sync-core/engine-holds.d.ts +14 -0
- package/dist/lib/sync-core/engine-holds.js +60 -0
- package/dist/lib/sync-core/engine-home.d.ts +37 -1
- package/dist/lib/sync-core/engine-home.js +119 -16
- package/dist/lib/sync-core/reconcile.js +8 -0
- package/dist/lib/sync-core/rollout-state.d.ts +2 -1
- package/dist/lib/sync-core/rollout-state.js +5 -2
- package/dist/lib/sync-core/vault-settings.d.ts +21 -0
- package/dist/lib/sync-core/vault-settings.js +131 -0
- package/dist/lib/sync-core/vault-uid.d.ts +2 -0
- package/dist/lib/sync-core/vault-uid.js +4 -0
- package/dist/lib/windows/install-followup.d.ts +2 -0
- package/dist/lib/windows/install-followup.js +4 -1
- package/dist/schemas/hq-work-requirements.v1.schema.json +145 -0
- package/dist/utils/auth-session-check.d.ts +16 -0
- package/dist/utils/auth-session-check.js +16 -0
- package/dist/utils/client-health-contract.d.ts +6 -0
- package/dist/utils/client-health-contract.js +13 -0
- package/dist/utils/client-health.d.ts +7 -0
- package/dist/utils/client-health.js +22 -1
- package/dist/utils/command-usage.d.ts +40 -0
- package/dist/utils/command-usage.js +61 -0
- package/dist/utils/duplicate-command-usage.d.ts +72 -0
- package/dist/utils/duplicate-command-usage.js +125 -0
- package/dist/utils/host-registration.js +5 -2
- package/dist/utils/pack-contributions.d.ts +3 -0
- package/dist/utils/pack-contributions.js +110 -23
- package/dist/utils/resident-package-preload.js +4 -0
- package/dist/utils/self-update.d.ts +3 -1
- package/dist/utils/self-update.js +56 -11
- package/dist/utils/sentry-fingerprint.js +9 -0
- package/dist/utils/update-lock.d.ts +151 -14
- package/dist/utils/update-lock.js +782 -46
- package/dist/utils/version-gate.js +12 -2
- package/dist/utils/windows-bash.d.ts +2 -0
- package/dist/utils/windows-bash.js +2 -1
- package/package.json +9 -8
- package/scripts/bench-core-compare.mjs +313 -0
- package/scripts/bench-core.mjs +399 -12
- package/scripts/check-function-manifest.mjs +116 -3
|
@@ -1769,6 +1769,11 @@ export const COMMAND_CATALOG = [
|
|
|
1769
1769
|
"flags": "--company <slug>",
|
|
1770
1770
|
"description": "Also report this company's billing and usage notice",
|
|
1771
1771
|
"hidden": false
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
"flags": "--check",
|
|
1775
|
+
"description": "Exit 1 when there is no usable session, like `hq auth status`",
|
|
1776
|
+
"hidden": false
|
|
1772
1777
|
}
|
|
1773
1778
|
],
|
|
1774
1779
|
"subcommands": []
|
|
@@ -11995,6 +12000,25 @@ export const COMMAND_CATALOG = [
|
|
|
11995
12000
|
],
|
|
11996
12001
|
"subcommands": []
|
|
11997
12002
|
},
|
|
12003
|
+
{
|
|
12004
|
+
"name": "stop-autosave",
|
|
12005
|
+
"description": "Drain the typed Stop autosave job",
|
|
12006
|
+
"aliases": [],
|
|
12007
|
+
"hidden": false,
|
|
12008
|
+
"helpOption": true,
|
|
12009
|
+
"helpCommand": false,
|
|
12010
|
+
"usage": "[options]",
|
|
12011
|
+
"helpText": [],
|
|
12012
|
+
"arguments": [],
|
|
12013
|
+
"options": [
|
|
12014
|
+
{
|
|
12015
|
+
"flags": "--session-id <id>",
|
|
12016
|
+
"description": "",
|
|
12017
|
+
"hidden": false
|
|
12018
|
+
}
|
|
12019
|
+
],
|
|
12020
|
+
"subcommands": []
|
|
12021
|
+
},
|
|
11998
12022
|
{
|
|
11999
12023
|
"name": "hook-registration-plan",
|
|
12000
12024
|
"description": "Print the offline fleet hook registration plan without changing the installation",
|
|
@@ -15089,6 +15113,94 @@ export const COMMAND_CATALOG = [
|
|
|
15089
15113
|
}
|
|
15090
15114
|
],
|
|
15091
15115
|
"subcommands": []
|
|
15116
|
+
},
|
|
15117
|
+
{
|
|
15118
|
+
"name": "probe",
|
|
15119
|
+
"description": "Run access probes by name and print them as hq-environment-profile.v1 readings.access entries: company vault grant, repos, secrets (exists by HEAD, and resolvable inside hq secrets exec; the value is never printed or stored), integrations and local data (exit 1 when a probe does not pass)",
|
|
15120
|
+
"aliases": [],
|
|
15121
|
+
"hidden": false,
|
|
15122
|
+
"helpOption": true,
|
|
15123
|
+
"helpCommand": false,
|
|
15124
|
+
"usage": "[options]",
|
|
15125
|
+
"helpText": [],
|
|
15126
|
+
"arguments": [],
|
|
15127
|
+
"options": [
|
|
15128
|
+
{
|
|
15129
|
+
"flags": "--company <slug>",
|
|
15130
|
+
"description": "Company whose vault, secrets and integrations are probed (required)",
|
|
15131
|
+
"hidden": false
|
|
15132
|
+
},
|
|
15133
|
+
{
|
|
15134
|
+
"flags": "--repo <name>",
|
|
15135
|
+
"description": "Checkout name under repos/private or repos/public; its origin must answer git ls-remote (repeatable, comma-separated)",
|
|
15136
|
+
"hidden": false
|
|
15137
|
+
},
|
|
15138
|
+
{
|
|
15139
|
+
"flags": "--secret <NAME>",
|
|
15140
|
+
"description": "Secret name to probe: exists, then resolvable by this identity (repeatable, comma-separated)",
|
|
15141
|
+
"hidden": false
|
|
15142
|
+
},
|
|
15143
|
+
{
|
|
15144
|
+
"flags": "--integration <slug>",
|
|
15145
|
+
"description": "App that must be connected and shared with this identity (repeatable, comma-separated)",
|
|
15146
|
+
"hidden": false
|
|
15147
|
+
},
|
|
15148
|
+
{
|
|
15149
|
+
"flags": "--data <path>",
|
|
15150
|
+
"description": "Path relative to the HQ root that must be present and not empty (repeatable, comma-separated)",
|
|
15151
|
+
"hidden": false
|
|
15152
|
+
},
|
|
15153
|
+
{
|
|
15154
|
+
"flags": "--agent",
|
|
15155
|
+
"description": "Also run hq agent probe (identity, vault, presence, DMs); it sends a self-DM and reports to the console",
|
|
15156
|
+
"hidden": false
|
|
15157
|
+
},
|
|
15158
|
+
{
|
|
15159
|
+
"flags": "--write-profile <file>",
|
|
15160
|
+
"description": "Store the readings in this profile's readings.access, replacing entries with the same names; the profile must validate afterwards",
|
|
15161
|
+
"hidden": false
|
|
15162
|
+
},
|
|
15163
|
+
{
|
|
15164
|
+
"flags": "--json",
|
|
15165
|
+
"description": "Print the result as JSON",
|
|
15166
|
+
"hidden": false
|
|
15167
|
+
}
|
|
15168
|
+
],
|
|
15169
|
+
"subcommands": []
|
|
15170
|
+
},
|
|
15171
|
+
{
|
|
15172
|
+
"name": "match",
|
|
15173
|
+
"description": "First ranking of environments for one piece of work: rules R1-R9 with one reason per rejection, then scores (read-only; not a placement, the conductor engine chooses)",
|
|
15174
|
+
"aliases": [],
|
|
15175
|
+
"hidden": false,
|
|
15176
|
+
"helpOption": true,
|
|
15177
|
+
"helpCommand": false,
|
|
15178
|
+
"usage": "[options]",
|
|
15179
|
+
"helpText": [],
|
|
15180
|
+
"arguments": [],
|
|
15181
|
+
"options": [
|
|
15182
|
+
{
|
|
15183
|
+
"flags": "--requirements <file>",
|
|
15184
|
+
"description": "hq-work-requirements.v1 JSON file",
|
|
15185
|
+
"hidden": false
|
|
15186
|
+
},
|
|
15187
|
+
{
|
|
15188
|
+
"flags": "--profiles <dir>",
|
|
15189
|
+
"description": "Directory of hq-environment-profile.v1 JSON files (every *.json in it, not recursive)",
|
|
15190
|
+
"hidden": false
|
|
15191
|
+
},
|
|
15192
|
+
{
|
|
15193
|
+
"flags": "--now <date-time>",
|
|
15194
|
+
"description": "Match time every reading is aged against (RFC 3339; default: the current time)",
|
|
15195
|
+
"hidden": false
|
|
15196
|
+
},
|
|
15197
|
+
{
|
|
15198
|
+
"flags": "--json",
|
|
15199
|
+
"description": "Print the result as JSON",
|
|
15200
|
+
"hidden": false
|
|
15201
|
+
}
|
|
15202
|
+
],
|
|
15203
|
+
"subcommands": []
|
|
15092
15204
|
}
|
|
15093
15205
|
]
|
|
15094
15206
|
},
|
|
@@ -15190,6 +15302,16 @@ export const COMMAND_CATALOG = [
|
|
|
15190
15302
|
"flags": "--json",
|
|
15191
15303
|
"description": "Emit the counts as JSON.",
|
|
15192
15304
|
"hidden": false
|
|
15305
|
+
},
|
|
15306
|
+
{
|
|
15307
|
+
"flags": "--duplicates",
|
|
15308
|
+
"description": "List only the duplicate commands and their runs in the window; exit 0 when none ran, 1 when one did, 2 when the count cannot be read.",
|
|
15309
|
+
"hidden": false
|
|
15310
|
+
},
|
|
15311
|
+
{
|
|
15312
|
+
"flags": "--since <window>",
|
|
15313
|
+
"description": "Window for --duplicates: Nh or Nd, at most 29d (default 1d). Counts are per UTC date, so whole dates are counted.",
|
|
15314
|
+
"hidden": false
|
|
15193
15315
|
}
|
|
15194
15316
|
],
|
|
15195
15317
|
"subcommands": []
|
|
@@ -23333,9 +23455,28 @@ export const COMMAND_CATALOG = [
|
|
|
23333
23455
|
"arguments": [],
|
|
23334
23456
|
"options": [],
|
|
23335
23457
|
"subcommands": [
|
|
23458
|
+
{
|
|
23459
|
+
"name": "list",
|
|
23460
|
+
"description": "List every membership's company and current sync mode (same table as `hq sync mode --show`)",
|
|
23461
|
+
"aliases": [],
|
|
23462
|
+
"hidden": false,
|
|
23463
|
+
"helpOption": true,
|
|
23464
|
+
"helpCommand": false,
|
|
23465
|
+
"usage": "[options]",
|
|
23466
|
+
"helpText": [],
|
|
23467
|
+
"arguments": [],
|
|
23468
|
+
"options": [
|
|
23469
|
+
{
|
|
23470
|
+
"flags": "--json",
|
|
23471
|
+
"description": "Print machine-readable JSON",
|
|
23472
|
+
"hidden": false
|
|
23473
|
+
}
|
|
23474
|
+
],
|
|
23475
|
+
"subcommands": []
|
|
23476
|
+
},
|
|
23336
23477
|
{
|
|
23337
23478
|
"name": "get",
|
|
23338
|
-
"description": "Read a company's current
|
|
23479
|
+
"description": "Read a company's current sync mode",
|
|
23339
23480
|
"aliases": [],
|
|
23340
23481
|
"hidden": false,
|
|
23341
23482
|
"helpOption": true,
|
|
@@ -23361,7 +23502,7 @@ export const COMMAND_CATALOG = [
|
|
|
23361
23502
|
},
|
|
23362
23503
|
{
|
|
23363
23504
|
"name": "set",
|
|
23364
|
-
"description": "Set a company's sync mode to all or
|
|
23505
|
+
"description": "Set a company's sync mode to shared, all or custom",
|
|
23365
23506
|
"aliases": [],
|
|
23366
23507
|
"hidden": false,
|
|
23367
23508
|
"helpOption": true,
|
|
@@ -23383,6 +23524,11 @@ export const COMMAND_CATALOG = [
|
|
|
23383
23524
|
}
|
|
23384
23525
|
],
|
|
23385
23526
|
"options": [
|
|
23527
|
+
{
|
|
23528
|
+
"flags": "--paths <csv>",
|
|
23529
|
+
"description": "Comma-separated allowed prefixes (required when mode is 'custom')",
|
|
23530
|
+
"hidden": false
|
|
23531
|
+
},
|
|
23386
23532
|
{
|
|
23387
23533
|
"flags": "--json",
|
|
23388
23534
|
"description": "Print machine-readable JSON",
|
|
@@ -23919,6 +24065,44 @@ export const COMMAND_CATALOG = [
|
|
|
23919
24065
|
],
|
|
23920
24066
|
"subcommands": []
|
|
23921
24067
|
},
|
|
24068
|
+
{
|
|
24069
|
+
"name": "config",
|
|
24070
|
+
"description": "Show or change this computer's new sync engine settings for one vault: parallel-downloads on|off, download-streams 1-32|default",
|
|
24071
|
+
"aliases": [],
|
|
24072
|
+
"hidden": false,
|
|
24073
|
+
"helpOption": true,
|
|
24074
|
+
"helpCommand": false,
|
|
24075
|
+
"usage": "[options] <vault> [key] [value]",
|
|
24076
|
+
"helpText": [],
|
|
24077
|
+
"arguments": [
|
|
24078
|
+
{
|
|
24079
|
+
"name": "vault",
|
|
24080
|
+
"required": true,
|
|
24081
|
+
"variadic": false,
|
|
24082
|
+
"description": ""
|
|
24083
|
+
},
|
|
24084
|
+
{
|
|
24085
|
+
"name": "key",
|
|
24086
|
+
"required": false,
|
|
24087
|
+
"variadic": false,
|
|
24088
|
+
"description": ""
|
|
24089
|
+
},
|
|
24090
|
+
{
|
|
24091
|
+
"name": "value",
|
|
24092
|
+
"required": false,
|
|
24093
|
+
"variadic": false,
|
|
24094
|
+
"description": ""
|
|
24095
|
+
}
|
|
24096
|
+
],
|
|
24097
|
+
"options": [
|
|
24098
|
+
{
|
|
24099
|
+
"flags": "--json",
|
|
24100
|
+
"description": "Print JSON",
|
|
24101
|
+
"hidden": false
|
|
24102
|
+
}
|
|
24103
|
+
],
|
|
24104
|
+
"subcommands": []
|
|
24105
|
+
},
|
|
23922
24106
|
{
|
|
23923
24107
|
"name": "status",
|
|
23924
24108
|
"description": "Show which vaults are on the new sync engine on this machine",
|
|
@@ -24647,6 +24831,17 @@ export const COMMAND_CATALOG = [
|
|
|
24647
24831
|
"description": "Brain: claude, codex (or chatgpt) or grok",
|
|
24648
24832
|
"hidden": false
|
|
24649
24833
|
},
|
|
24834
|
+
{
|
|
24835
|
+
"flags": "--kind <kind>",
|
|
24836
|
+
"description": "The bot the answer is for: personal (default) or company",
|
|
24837
|
+
"hidden": false
|
|
24838
|
+
},
|
|
24839
|
+
{
|
|
24840
|
+
"flags": "--company <slug>",
|
|
24841
|
+
"description": "The company of a company bot (repeatable); a Grok login is reused only within one company",
|
|
24842
|
+
"hidden": false,
|
|
24843
|
+
"defaultValue": []
|
|
24844
|
+
},
|
|
24650
24845
|
{
|
|
24651
24846
|
"flags": "--json",
|
|
24652
24847
|
"description": "Print machine-readable JSON: { provider, signedIn, source }",
|
|
@@ -24671,6 +24866,17 @@ export const COMMAND_CATALOG = [
|
|
|
24671
24866
|
"description": "Brain: codex (or chatgpt) or grok",
|
|
24672
24867
|
"hidden": false
|
|
24673
24868
|
},
|
|
24869
|
+
{
|
|
24870
|
+
"flags": "--kind <kind>",
|
|
24871
|
+
"description": "The bot the sign-in is for: personal (default) or company",
|
|
24872
|
+
"hidden": false
|
|
24873
|
+
},
|
|
24874
|
+
{
|
|
24875
|
+
"flags": "--company <slug>",
|
|
24876
|
+
"description": "The company of a company bot (repeatable)",
|
|
24877
|
+
"hidden": false,
|
|
24878
|
+
"defaultValue": []
|
|
24879
|
+
},
|
|
24674
24880
|
{
|
|
24675
24881
|
"flags": "--json",
|
|
24676
24882
|
"description": "Print one JSON line per event (device code, messages) and a final result",
|
|
@@ -24815,6 +25021,11 @@ export const COMMAND_CATALOG = [
|
|
|
24815
25021
|
"description": "Thinking level (claude low|medium|high|xhigh|max; codex minimal|low|medium|high|xhigh; grok low|medium|high|xhigh), or default (medium)",
|
|
24816
25022
|
"hidden": false
|
|
24817
25023
|
},
|
|
25024
|
+
{
|
|
25025
|
+
"flags": "--signals-runtime <bot|claude>",
|
|
25026
|
+
"description": "Where hot-channel signals run: bot (the Executive Codex bot's own Codex) or claude (Claude Code, the default). Set on the Executive bot; local to this computer, from the next sync",
|
|
25027
|
+
"hidden": false
|
|
25028
|
+
},
|
|
24818
25029
|
{
|
|
24819
25030
|
"flags": "--json",
|
|
24820
25031
|
"description": "Print machine-readable JSON",
|
package/dist/commands/auth.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { loginWithBrowserPreference } from "../utils/login-browser.js";
|
|
20
20
|
import { formatAuthExpiry } from "../utils/auth-expiry.js";
|
|
21
|
+
import { authStatusExitCode } from "../utils/auth-session-check.js";
|
|
21
22
|
import { releaseCurrentPackageUseLease, releasePackageUseLeaseAfterResidentPreload } from "../utils/package-use-lease.js";
|
|
22
23
|
import { preloadResidentPackageModules, reportResidentPackagePreloadFailure } from "../utils/resident-package-preload.js";
|
|
23
24
|
import * as fs from "node:fs";
|
|
@@ -327,7 +328,8 @@ export function registerAuthCommands(program) {
|
|
|
327
328
|
.action(async () => {
|
|
328
329
|
// Second name for `hq logout`. It signs out exactly as `hq logout` does,
|
|
329
330
|
// so the refresh token is revoked on the server on this path too. It is
|
|
330
|
-
//
|
|
331
|
+
// marked retiring (US-041: the core skills now run `hq logout`), but the
|
|
332
|
+
// retiring gate is off, so this command still runs exactly as before.
|
|
331
333
|
const { runLogout } = await import("./logout.js");
|
|
332
334
|
await runLogout();
|
|
333
335
|
});
|
|
@@ -414,6 +416,8 @@ export function registerAuthCommands(program) {
|
|
|
414
416
|
// machine cache was valid, and could show a stale person session as the
|
|
415
417
|
// machine one.
|
|
416
418
|
const cached = machine ? loadMachineCachedTokens() : loadCachedTokens();
|
|
419
|
+
// Shared with `hq whoami --check`, so both give the same exit status.
|
|
420
|
+
const exitCode = authStatusExitCode({ tokenSource, cached });
|
|
417
421
|
if (!cached) {
|
|
418
422
|
if (machine) {
|
|
419
423
|
// No cached session yet, but machine creds mint one on demand —
|
|
@@ -424,7 +428,7 @@ export function registerAuthCommands(program) {
|
|
|
424
428
|
}
|
|
425
429
|
console.log(chalk.yellow("No cached HQ session — run `hq login`"));
|
|
426
430
|
console.log(chalk.dim(`token source: ${tokenSource}`));
|
|
427
|
-
process.exit(
|
|
431
|
+
process.exit(exitCode);
|
|
428
432
|
}
|
|
429
433
|
const claims = peekIdToken(cached.idToken);
|
|
430
434
|
const who = machine
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ClaudeLoginCheck } from "../lib/bot/claude-login.js";
|
|
2
2
|
import { fleetRuntimeReady, type FleetInstallProgress, type FleetInstallProgressListener, type FleetLocalTargetRelease } from "../lib/bot/fleet-local.js";
|
|
3
3
|
import { installedFleetPython } from "../lib/bot/fleet-python.js";
|
|
4
|
-
import { type FleetSignInHereDeps, type FleetSignInProvider } from "../lib/bot/legacy-provider-login.js";
|
|
5
|
-
import type { LegacyProviderLogin } from "../lib/bot/legacy-convert.js";
|
|
4
|
+
import { type BotLoginScope, type FleetSignInHereDeps, type FleetSignInProvider, type GrokLoginProbeAsyncDeps, type GrokSiblingLogin } from "../lib/bot/legacy-provider-login.js";
|
|
6
5
|
export type FleetProgressMode = "text" | "json" | "silent";
|
|
7
6
|
interface ProgressOutput {
|
|
8
7
|
write(text: string): void;
|
|
@@ -48,19 +47,33 @@ export interface BrainSignInStatus {
|
|
|
48
47
|
provider: BrainProvider;
|
|
49
48
|
signedIn: boolean;
|
|
50
49
|
source: BrainLoginSource | null;
|
|
50
|
+
/**
|
|
51
|
+
* Grok only: another bot on this computer holds, or may hold, a Grok
|
|
52
|
+
* sign-in of a different or unknown company, so none is reused. The text
|
|
53
|
+
* says which.
|
|
54
|
+
*/
|
|
55
|
+
blocked?: string;
|
|
51
56
|
}
|
|
52
57
|
export interface BrainSignInDeps extends FleetSignInHereDeps {
|
|
53
58
|
target?: () => Promise<FleetLocalTargetRelease>;
|
|
54
59
|
claudeLogin?: () => ClaudeLoginCheck;
|
|
55
|
-
grokSiblings?: () => Promise<
|
|
60
|
+
grokSiblings?: () => Promise<GrokSiblingLogin>;
|
|
61
|
+
/** Seams for the scan of the other Fleet bots' Grok sign-ins. */
|
|
62
|
+
grokProbe?: GrokLoginProbeAsyncDeps;
|
|
56
63
|
}
|
|
57
64
|
export declare function parseBrainProvider(value: string): BrainProvider;
|
|
58
65
|
export declare function parseFleetSignInProvider(value: string): FleetSignInProvider;
|
|
59
66
|
export declare function brainSignInStatus(provider: BrainProvider, deps?: BrainSignInDeps): Promise<BrainSignInStatus>;
|
|
67
|
+
/** Which bot auth-status and sign-in answer for: a company bot of --company, else a personal bot, as create defaults. */
|
|
68
|
+
export interface BrainScopeOptions {
|
|
69
|
+
kind?: string;
|
|
70
|
+
company?: string[];
|
|
71
|
+
}
|
|
72
|
+
export declare function brainLoginScope(opts: BrainScopeOptions): BotLoginScope;
|
|
60
73
|
export declare function runBotAuthStatus(opts: {
|
|
61
74
|
provider: string;
|
|
62
75
|
json?: boolean;
|
|
63
|
-
}, deps?: BrainSignInDeps): Promise<(BrainSignInStatus & {
|
|
76
|
+
} & BrainScopeOptions, deps?: BrainSignInDeps): Promise<(BrainSignInStatus & {
|
|
64
77
|
ok: true;
|
|
65
78
|
}) | {
|
|
66
79
|
ok: false;
|
|
@@ -87,7 +100,7 @@ export declare function runBotSignIn(opts: {
|
|
|
87
100
|
provider: string;
|
|
88
101
|
json?: boolean;
|
|
89
102
|
browser?: boolean;
|
|
90
|
-
},
|
|
103
|
+
} & BrainScopeOptions, rawDeps?: BotSignInDeps): Promise<BrainSignInStatus & {
|
|
91
104
|
ok: boolean;
|
|
92
105
|
reason?: string;
|
|
93
106
|
}>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
|
-
import * as os from "node:os";
|
|
4
3
|
import * as path from "node:path";
|
|
5
4
|
import { stripVTControlCharacters } from "node:util";
|
|
6
5
|
import chalk from "chalk";
|
|
@@ -11,7 +10,8 @@ import { cachedFleetLocalTargetRelease, ensureFleetRuntimeInstalled, fleetLocalD
|
|
|
11
10
|
import { installedFleetPython } from "../lib/bot/fleet-python.js";
|
|
12
11
|
import { createInstallProgressTracker } from "../lib/bot/install-progress.js";
|
|
13
12
|
import { botCreateEstimate } from "../lib/bot/readiness.js";
|
|
14
|
-
import { fleetSignInReusableHere,
|
|
13
|
+
import { fleetSignInReusableHere, grokLoginReadableHereAsync, newBotLoginScope, } from "../lib/bot/legacy-provider-login.js";
|
|
14
|
+
import { normalizeBotCompanies } from "../lib/bot/config.js";
|
|
15
15
|
function megabytes(bytes) {
|
|
16
16
|
return `${(bytes / 1_048_576).toFixed(1)} MB`;
|
|
17
17
|
}
|
|
@@ -182,20 +182,29 @@ export async function brainSignInStatus(provider, deps = {}) {
|
|
|
182
182
|
}
|
|
183
183
|
let grok = deps.grok;
|
|
184
184
|
if (provider === "grok" && !grok) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
grok = () => siblings;
|
|
189
|
-
}
|
|
185
|
+
// Always asked, even with a Grok CLI login: the helper copies another bot's login before it reads the Grok CLI's.
|
|
186
|
+
const siblings = await (deps.grokSiblings ?? (() => grokLoginReadableHereAsync("", { ...deps.grokProbe, scope: deps.scope ?? null })))();
|
|
187
|
+
grok = () => siblings;
|
|
190
188
|
}
|
|
191
|
-
const { target: _target, claudeLogin: _claudeLogin, grokSiblings: _grokSiblings, ...hereDeps } = deps;
|
|
189
|
+
const { target: _target, claudeLogin: _claudeLogin, grokSiblings: _grokSiblings, grokProbe: _grokProbe, ...hereDeps } = deps;
|
|
192
190
|
const login = fleetSignInReusableHere(provider, { ...hereDeps, ...(grok ? { grok } : {}), ...(grokCliImport !== undefined ? { grokCliImport } : {}) });
|
|
193
191
|
if (!login.readable)
|
|
194
|
-
return { provider, signedIn: false, source: null };
|
|
192
|
+
return { provider, signedIn: false, source: null, ...(login.blocked ? { blocked: login.detail } : {}) };
|
|
195
193
|
const source = provider === "chatgpt" ? "codex-cli" : login.detail.startsWith("Grok CLI login") ? "grok-cli" : "fleet-bot";
|
|
196
194
|
return { provider, signedIn: true, source };
|
|
197
195
|
}
|
|
198
196
|
const BRAIN_NAMES = { claude: "Claude", chatgpt: "ChatGPT", grok: "Grok" };
|
|
197
|
+
export function brainLoginScope(opts) {
|
|
198
|
+
const kind = opts.kind?.trim().toLowerCase();
|
|
199
|
+
if (kind !== undefined && kind !== "personal" && kind !== "company") {
|
|
200
|
+
throw Object.assign(new Error(`--kind must be personal or company, not ${opts.kind}.`), { expected: true });
|
|
201
|
+
}
|
|
202
|
+
const companies = normalizeBotCompanies(opts.company);
|
|
203
|
+
if (kind === "personal" && companies.length) {
|
|
204
|
+
throw Object.assign(new Error("--company only applies to a company bot; drop it or use --kind company."), { expected: true });
|
|
205
|
+
}
|
|
206
|
+
return newBotLoginScope(kind === "company" || companies.length ? "company" : "personal", companies);
|
|
207
|
+
}
|
|
199
208
|
export async function runBotAuthStatus(opts, deps = {}) {
|
|
200
209
|
let provider;
|
|
201
210
|
try {
|
|
@@ -209,7 +218,7 @@ export async function runBotAuthStatus(opts, deps = {}) {
|
|
|
209
218
|
process.exitCode = 1;
|
|
210
219
|
return failure;
|
|
211
220
|
}
|
|
212
|
-
const status = { ...(await brainSignInStatus(provider, deps)), ok: true };
|
|
221
|
+
const status = { ...(await brainSignInStatus(provider, { scope: brainLoginScope(opts), ...deps })), ok: true };
|
|
213
222
|
if (opts.json) {
|
|
214
223
|
console.log(JSON.stringify(status));
|
|
215
224
|
return status;
|
|
@@ -217,7 +226,9 @@ export async function runBotAuthStatus(opts, deps = {}) {
|
|
|
217
226
|
const name = BRAIN_NAMES[status.provider];
|
|
218
227
|
console.log(status.signedIn
|
|
219
228
|
? `A new ${name} bot signs in with the ${name} login already on this computer.`
|
|
220
|
-
:
|
|
229
|
+
: status.blocked
|
|
230
|
+
? `A new ${name} bot cannot reuse a ${name} login on this computer: ${status.blocked}.`
|
|
231
|
+
: `A new ${name} bot needs a ${name} sign-in first (hq bot sign-in --provider ${status.provider}).`);
|
|
221
232
|
return status;
|
|
222
233
|
}
|
|
223
234
|
function onTerminate(cancel) {
|
|
@@ -302,8 +313,9 @@ function forEachLine(stream, onLine) {
|
|
|
302
313
|
stream.on("error", () => resolve());
|
|
303
314
|
});
|
|
304
315
|
}
|
|
305
|
-
export async function runBotSignIn(opts,
|
|
316
|
+
export async function runBotSignIn(opts, rawDeps = {}) {
|
|
306
317
|
const brain = parseBrainProvider(opts.provider);
|
|
318
|
+
const deps = { scope: brainLoginScope(opts), ...rawDeps };
|
|
307
319
|
const emit = deps.emit ?? ((line) => { process.stdout.write(`${line}\n`); });
|
|
308
320
|
const write = deps.write ?? ((text) => { process.stderr.write(text); });
|
|
309
321
|
const finish = (result) => {
|
|
@@ -321,6 +333,11 @@ export async function runBotSignIn(opts, deps = {}) {
|
|
|
321
333
|
const before = await brainSignInStatus(brain, deps);
|
|
322
334
|
if (before.signedIn)
|
|
323
335
|
return finish({ ...before, ok: true });
|
|
336
|
+
if (before.blocked) {
|
|
337
|
+
// A Grok CLI login would not help: the helper copies the other bot's login first.
|
|
338
|
+
process.exitCode = 1;
|
|
339
|
+
return finish({ ...before, ok: false, reason: "grok-login-held-back" });
|
|
340
|
+
}
|
|
324
341
|
const { cli, browser, device } = BRAIN_SIGN_IN_CLI[brain];
|
|
325
342
|
const args = opts.browser === false ? device : browser;
|
|
326
343
|
const executable = (deps.findCli ?? ((name) => findCliOnPath(name)))(cli);
|
package/dist/commands/bot.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type LegacyMoveState, type LegacyProviderLoginProbe } from "../lib/bot/legacy-convert.js";
|
|
2
|
+
import { type GrokSiblingLogin } from "../lib/bot/legacy-provider-login.js";
|
|
3
|
+
import { type BotSignalsRuntimeSetting } from "../lib/bot/config.js";
|
|
2
4
|
import { type ClaudeLoginNow, type SignalsClaudeLogin } from "../lib/hot-channels/signals-claude-login.js";
|
|
3
5
|
import { Command } from "commander";
|
|
4
6
|
import { type ExecutiveBot } from "../lib/bot/executive.js";
|
|
@@ -73,10 +75,24 @@ export interface BotRow {
|
|
|
73
75
|
signInCommand: string;
|
|
74
76
|
/**
|
|
75
77
|
* The Claude Code login the hot-channel signals pass needs, which can differ
|
|
76
|
-
* from the bot's own runtime login (a Codex bot
|
|
77
|
-
*
|
|
78
|
+
* from the bot's own runtime login (a Codex bot runs signals on Claude Code
|
|
79
|
+
* until it opts in with `hq bot set <name> --signals-runtime bot`). Only for
|
|
80
|
+
* a bot with the hot-signal-sync job whose signals run on Claude Code; null
|
|
81
|
+
* otherwise, including a Codex bot whose signals run on Codex.
|
|
78
82
|
*/
|
|
79
83
|
signalsClaudeSignIn: SignalsClaudeSignIn | null;
|
|
84
|
+
/**
|
|
85
|
+
* The tool the hot-channel signals pass runs on for this bot: "claude", or
|
|
86
|
+
* "codex" for a Codex bot that opted in (its sign-in is `runtimeSignedIn`).
|
|
87
|
+
* Null for a bot without the hot-signal-sync job.
|
|
88
|
+
*/
|
|
89
|
+
signalsRuntime: "claude" | "codex" | null;
|
|
90
|
+
/**
|
|
91
|
+
* When `signalsRuntime` is "codex": the CODEX_HOME the pass uses, from the
|
|
92
|
+
* same function the pass reads (signalsCodexLogin), so status and pass name
|
|
93
|
+
* one login. Null otherwise, or when that login is not usable.
|
|
94
|
+
*/
|
|
95
|
+
signalsCodexHome: string | null;
|
|
80
96
|
/**
|
|
81
97
|
* Set when the bot cannot run until its model provider is signed in, on any
|
|
82
98
|
* engine: a Fleet bot never signed in or whose last turn failed on auth, a
|
|
@@ -209,6 +225,17 @@ export declare const signalsClaudeSeams: {
|
|
|
209
225
|
export declare function signalsClaudeSignInFor(dir: string, fleet: boolean, record?: SignalsClaudeLogin | null, live?: ClaudeLoginNow | null): SignalsClaudeSignIn | null;
|
|
210
226
|
/** The status lines for the Claude Code login signals needs: the answer first, the last signals pass as context. */
|
|
211
227
|
export declare function signalsClaudeSignInLines(s: SignalsClaudeSignIn): string[];
|
|
228
|
+
/**
|
|
229
|
+
* The tool the signals pass runs on for a bot with the hot-signal-sync job
|
|
230
|
+
* (null without the job): the Executive bot's choice, as in the pass.
|
|
231
|
+
*/
|
|
232
|
+
export declare function signalsRuntimeFor(dir: string, fleet: boolean): "claude" | "codex" | null;
|
|
233
|
+
/** The Codex login the pass uses when signals run on Codex (signalsCodexLogin), else null. */
|
|
234
|
+
export declare function signalsCodexHomeFor(dir: string, fleet: boolean): string | null;
|
|
235
|
+
/** Why the Executive bot's Codex login cannot run signals, when signals are set to run on it; else null. */
|
|
236
|
+
export declare function signalsCodexRefusalFor(dir: string, fleet: boolean): string | null;
|
|
237
|
+
/** The status line for a bot whose signals run on its own Codex: the bot's own sign-in answer. */
|
|
238
|
+
export declare function signalsCodexRuntimeLine(companies: readonly string[], runtimeSignedIn: boolean | null): string;
|
|
212
239
|
export interface BrainSignIn {
|
|
213
240
|
provider: BotRuntimeId;
|
|
214
241
|
needed: true;
|
|
@@ -256,6 +283,8 @@ export declare const botCreateSeams: {
|
|
|
256
283
|
claudeLogin: () => ClaudeLoginCheck;
|
|
257
284
|
brainSignIn: typeof brainSignInStatus;
|
|
258
285
|
importBrainLogin: (agentUid: string, runtime: "codex" | "grok") => void;
|
|
286
|
+
/** The same question the helper call asks itself: would a Grok account sign-in for this bot copy a login it may not share? */
|
|
287
|
+
grokSiblingLogin: (config: BotConfig) => GrokSiblingLogin;
|
|
259
288
|
runtimeStatus: typeof fleetRuntimeStatus;
|
|
260
289
|
installRuntime: typeof ensureFleetRuntimeInstalled;
|
|
261
290
|
waitForReady: typeof waitForGatewayReady;
|
|
@@ -359,6 +388,8 @@ export interface BotSetOptions {
|
|
|
359
388
|
model?: string;
|
|
360
389
|
effort?: string;
|
|
361
390
|
displayName?: string;
|
|
391
|
+
/** "bot": a Codex bot runs hot-channel signals on its own Codex; "claude" (the default): on Claude Code. */
|
|
392
|
+
signalsRuntime?: string;
|
|
362
393
|
json?: boolean;
|
|
363
394
|
}
|
|
364
395
|
export interface BotSetDeps {
|
|
@@ -382,6 +413,12 @@ export interface BotSetDeps {
|
|
|
382
413
|
};
|
|
383
414
|
}
|
|
384
415
|
export declare function runBotSet(nameArg: string, opts: BotSetOptions, deps?: BotSetDeps): Promise<void>;
|
|
416
|
+
/**
|
|
417
|
+
* `--signals-runtime`: "bot" only for a Codex bot (a Claude bot already runs
|
|
418
|
+
* signals on Claude Code, and Grok has no isolated signals call yet);
|
|
419
|
+
* "claude" for any bot.
|
|
420
|
+
*/
|
|
421
|
+
export declare function validateSignalsRuntimeSetting(runtime: BotRuntimeId, value: string): BotSignalsRuntimeSetting;
|
|
385
422
|
/** switch-account's test turn: short, so probe, stop, start and a rollback fit the desktop's 5-minute budget. */
|
|
386
423
|
export declare const SWITCH_ACCOUNT_PROBE_TIMEOUT_MS = 60000;
|
|
387
424
|
export interface BotSwitchAccountOptions {
|