@indigoai-us/hq-cli 5.345.215-beta.0 → 5.345.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +206 -1
- package/README.md +45 -0
- package/assets/scaffold/core/scripts/hq-delegate-verify.sh +5 -2
- package/assets/scaffold/core/scripts/lib/epochrealtime.sh +30 -0
- package/assets/scaffold/core/scripts/lib/work-mesh-enqueue.sh +12 -5
- package/dist/command-catalog.generated.d.ts +105 -10
- package/dist/command-catalog.generated.js +127 -10
- package/dist/command-help.js +3 -1
- package/dist/command-registration-plan.d.ts +6 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/auth.d.ts +1 -1
- package/dist/commands/auth.js +11 -52
- package/dist/commands/bot.js +75 -10
- package/dist/commands/capacity.d.ts +4 -1
- package/dist/commands/capacity.js +46 -10
- package/dist/commands/cloud-demote.d.ts +19 -4
- package/dist/commands/cloud-demote.js +85 -12
- package/dist/commands/cloud-provision.d.ts +5 -1
- package/dist/commands/cloud-provision.js +6 -2
- package/dist/commands/cloud.d.ts +36 -0
- package/dist/commands/cloud.js +110 -27
- package/dist/commands/core-delegate-w1b.js +15 -1
- package/dist/commands/core-policy.js +67 -8
- package/dist/commands/core.js +1 -0
- package/dist/commands/daemon.js +9 -1
- package/dist/commands/dm.js +7 -0
- package/dist/commands/doctor-usage.d.ts +8 -0
- package/dist/commands/doctor-usage.js +20 -0
- package/dist/commands/doctor.js +7 -1
- package/dist/commands/env.d.ts +18 -0
- package/dist/commands/env.js +82 -0
- package/dist/commands/files-browse.d.ts +11 -4
- package/dist/commands/files-browse.js +21 -4
- package/dist/commands/files.d.ts +1 -1
- package/dist/commands/files.js +25 -11
- package/dist/commands/install-global.js +2 -2
- package/dist/commands/integrations-auth-rules.d.ts +27 -0
- package/dist/commands/integrations-auth-rules.js +79 -0
- package/dist/commands/integrations-import.js +124 -12
- package/dist/commands/lanes.js +102 -26
- package/dist/commands/logout.d.ts +7 -0
- package/dist/commands/logout.js +41 -34
- package/dist/commands/mesh.d.ts +2 -0
- package/dist/commands/mesh.js +60 -35
- package/dist/commands/sources.d.ts +8 -2
- package/dist/commands/sources.js +65 -9
- package/dist/commands/sync-held.js +5 -2
- package/dist/commands/whoami.js +26 -1
- package/dist/data/command-states.json +15 -0
- package/dist/index.js +52 -4
- package/dist/lazy-commands.js +5 -6
- package/dist/lib/anywhere-person-setting.d.ts +2 -0
- package/dist/lib/anywhere-person-setting.js +6 -3
- package/dist/lib/billing/usage-card.d.ts +25 -4
- package/dist/lib/billing/usage-card.js +76 -9
- package/dist/lib/billing/usage-cost.d.ts +3 -3
- package/dist/lib/billing/usage-cost.js +35 -13
- package/dist/lib/billing/usage-only.js +4 -2
- package/dist/lib/billing/usage-rate-card.d.ts +2 -2
- package/dist/lib/billing/usage-rate-card.js +3 -0
- package/dist/lib/bot/fleet-cron.d.ts +8 -0
- package/dist/lib/bot/fleet-cron.js +126 -7
- package/dist/lib/bot/fleet-daemon.d.ts +46 -0
- package/dist/lib/bot/fleet-daemon.js +99 -1
- package/dist/lib/bot/inflight.d.ts +9 -0
- package/dist/lib/bot/inflight.js +10 -0
- package/dist/lib/bot/jobs/hot-signal-sync.js +12 -1
- package/dist/lib/bot/probe.js +7 -1
- package/dist/lib/bot/run.js +20 -1
- package/dist/lib/bot/runtime/codex.js +1 -1
- package/dist/lib/bot/runtime/grok-acp.d.ts +6 -1
- package/dist/lib/bot/runtime/grok-acp.js +32 -14
- package/dist/lib/bot/runtime/grok.js +1 -1
- package/dist/lib/bot/runtime/index.js +19 -9
- package/dist/lib/bot/runtime/messages-stream.js +2 -2
- package/dist/lib/bot/runtime/types.d.ts +15 -0
- package/dist/lib/bot/runtime/types.js +9 -0
- package/dist/lib/bot/runtime-failure.d.ts +23 -0
- package/dist/lib/bot/runtime-failure.js +43 -1
- package/dist/lib/capacity/accounts.d.ts +8 -0
- package/dist/lib/capacity/accounts.js +19 -0
- package/dist/lib/capacity/available.d.ts +154 -0
- package/dist/lib/capacity/available.js +905 -0
- package/dist/lib/capacity/codex-availability.d.ts +14 -1
- package/dist/lib/capacity/codex-availability.js +26 -1
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +29 -2
- package/dist/lib/capacity/collectors/claude-oauth.js +104 -7
- package/dist/lib/capacity/collectors/codex.js +10 -7
- package/dist/lib/capacity/ledger.d.ts +37 -1
- package/dist/lib/capacity/ledger.js +207 -30
- package/dist/lib/capacity/project.d.ts +26 -0
- package/dist/lib/capacity/project.js +137 -8
- package/dist/lib/capacity/refusal-rows.d.ts +31 -0
- package/dist/lib/capacity/refusal-rows.js +61 -0
- package/dist/lib/capacity/refusal.d.ts +53 -2
- package/dist/lib/capacity/refusal.js +284 -65
- package/dist/lib/capacity/route.js +46 -11
- package/dist/lib/capacity/widget.d.ts +12 -1
- package/dist/lib/capacity/widget.js +91 -3
- package/dist/lib/daemon/flag-monitor.d.ts +8 -0
- package/dist/lib/daemon/flag-monitor.js +17 -6
- package/dist/lib/daemon/flag.d.ts +65 -1
- package/dist/lib/daemon/flag.js +190 -40
- package/dist/lib/daemon/ops/policy.js +62 -5
- package/dist/lib/daemon/paths.d.ts +72 -2
- package/dist/lib/daemon/paths.js +154 -3
- package/dist/lib/daemon/resolver.d.ts +2 -0
- package/dist/lib/daemon/resolver.js +3 -0
- package/dist/lib/daemon/run.d.ts +9 -0
- package/dist/lib/daemon/run.js +79 -21
- package/dist/lib/daemon/selfcheck.d.ts +22 -0
- package/dist/lib/daemon/selfcheck.js +40 -1
- package/dist/lib/daemon/server.d.ts +5 -1
- package/dist/lib/daemon/server.js +17 -23
- package/dist/lib/daemon/state-file-switch.d.ts +57 -0
- package/dist/lib/daemon/state-file-switch.js +88 -0
- package/dist/lib/daemon/state-file.d.ts +198 -0
- package/dist/lib/daemon/state-file.js +419 -0
- package/dist/lib/daemon/tcc-eperm.d.ts +153 -0
- package/dist/lib/daemon/tcc-eperm.js +310 -0
- package/dist/lib/daemon/timed-flag-monitors.d.ts +47 -0
- package/dist/lib/daemon/timed-flag-monitors.js +75 -0
- package/dist/lib/delivery/admission.d.ts +86 -0
- package/dist/lib/delivery/admission.js +148 -0
- package/dist/lib/delivery/artifacts.d.ts +7 -1
- package/dist/lib/delivery/artifacts.js +29 -10
- package/dist/lib/delivery/attempt-id.d.ts +13 -0
- package/dist/lib/delivery/attempt-id.js +16 -0
- package/dist/lib/delivery/disposable-target.d.ts +42 -0
- package/dist/lib/delivery/disposable-target.js +111 -0
- package/dist/lib/delivery/effects.d.ts +136 -0
- package/dist/lib/delivery/effects.js +541 -0
- package/dist/lib/delivery/enrollment.d.ts +21 -17
- package/dist/lib/delivery/enrollment.js +83 -5
- package/dist/lib/delivery/escalations.d.ts +51 -0
- package/dist/lib/delivery/escalations.js +60 -0
- package/dist/lib/delivery/lease.d.ts +80 -0
- package/dist/lib/delivery/lease.js +134 -0
- package/dist/lib/delivery/migrations.d.ts +120 -4
- package/dist/lib/delivery/migrations.js +215 -15
- package/dist/lib/delivery/mqtt.d.ts +2 -0
- package/dist/lib/delivery/mqtt.js +7 -0
- package/dist/lib/delivery/reconciler.d.ts +65 -1
- package/dist/lib/delivery/reconciler.js +224 -13
- package/dist/lib/delivery/rpc/client.d.ts +22 -0
- package/dist/lib/delivery/rpc/client.js +159 -0
- package/dist/lib/delivery/rpc/port.d.ts +40 -0
- package/dist/lib/delivery/rpc/port.js +16 -0
- package/dist/lib/delivery/rpc/server.d.ts +30 -0
- package/dist/lib/delivery/rpc/server.js +205 -0
- package/dist/lib/delivery/rpc/wire.d.ts +85 -0
- package/dist/lib/delivery/rpc/wire.js +143 -0
- package/dist/lib/delivery/store.d.ts +2 -0
- package/dist/lib/delivery/store.js +4 -0
- package/dist/lib/delivery/windows-service-install.d.ts +262 -0
- package/dist/lib/delivery/windows-service-install.js +892 -0
- package/dist/lib/delivery/workers/macos.d.ts +16 -1
- package/dist/lib/delivery/workers/macos.js +54 -12
- package/dist/lib/delivery/workers/windows-service-live.d.ts +121 -0
- package/dist/lib/delivery/workers/windows-service-live.js +711 -0
- package/dist/lib/delivery/workers/windows-service-runner.d.ts +33 -0
- package/dist/lib/delivery/workers/windows-service-runner.js +82 -0
- package/dist/lib/delivery/workers/windows-service.d.ts +140 -0
- package/dist/lib/delivery/workers/windows-service.js +584 -0
- package/dist/lib/delivery/workers/windows.d.ts +32 -22
- package/dist/lib/delivery/workers/windows.js +50 -64
- package/dist/lib/doctor/checks/host-core.d.ts +50 -0
- package/dist/lib/doctor/checks/host-core.js +269 -0
- package/dist/lib/doctor/checks/replay-recorder.d.ts +39 -0
- package/dist/lib/doctor/checks/replay-recorder.js +261 -0
- package/dist/lib/doctor/registry.js +4 -0
- package/dist/lib/environment/profile.d.ts +239 -0
- package/dist/lib/environment/profile.js +251 -0
- package/dist/lib/hook-engine/reconcile.js +39 -13
- package/dist/lib/hook-engine/registration.d.ts +9 -0
- package/dist/lib/hook-engine/registration.js +19 -0
- package/dist/lib/hot-channels/adapters/meetings.d.ts +15 -0
- package/dist/lib/hot-channels/adapters/meetings.js +36 -3
- package/dist/lib/hot-channels/adapters/slack.d.ts +21 -5
- package/dist/lib/hot-channels/adapters/slack.js +64 -21
- package/dist/lib/hot-channels/alert.d.ts +2 -0
- package/dist/lib/hot-channels/alert.js +8 -1
- package/dist/lib/hot-channels/contract.d.ts +12 -0
- package/dist/lib/hot-channels/contract.js +7 -0
- package/dist/lib/hot-channels/loop.js +1 -0
- package/dist/lib/hot-channels/run.d.ts +6 -0
- package/dist/lib/hot-channels/run.js +4 -0
- package/dist/lib/hot-channels/signals-pass.d.ts +74 -1
- package/dist/lib/hot-channels/signals-pass.js +82 -41
- package/dist/lib/hot-channels/signals-redo.js +10 -2
- package/dist/lib/install/claude-targets.d.ts +12 -1
- package/dist/lib/install/claude-targets.js +57 -5
- package/dist/lib/install/codex-targets.d.ts +2 -2
- package/dist/lib/install/codex-targets.js +36 -6
- package/dist/lib/install/hook-target.d.ts +3 -0
- package/dist/lib/install/hook-target.js +11 -0
- package/dist/lib/lanes/canonical-host.d.ts +35 -0
- package/dist/lib/lanes/canonical-host.js +65 -0
- package/dist/lib/lanes/host-capacity.d.ts +30 -0
- package/dist/lib/lanes/host-capacity.js +29 -3
- package/dist/lib/lanes/watcher.js +35 -0
- package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
- package/dist/lib/mesh/live/daemon/run.js +5 -2
- package/dist/lib/mesh/live/flush.d.ts +5 -1
- package/dist/lib/mesh/live/flush.js +12 -6
- package/dist/lib/mesh/live/reporting-privacy.d.ts +32 -0
- package/dist/lib/mesh/live/reporting-privacy.js +56 -1
- package/dist/lib/mesh/live/spool.d.ts +7 -0
- package/dist/lib/mesh/live/spool.js +25 -0
- package/dist/lib/person-setting-cache.d.ts +38 -0
- package/dist/lib/person-setting-cache.js +98 -0
- package/dist/lib/safe-store.d.ts +245 -0
- package/dist/lib/safe-store.js +777 -0
- package/dist/lib/signals/engine.d.ts +29 -2
- package/dist/lib/signals/engine.js +103 -4
- package/dist/lib/signals/reply.js +73 -18
- package/dist/lib/signals/steps/adapters.js +7 -2
- package/dist/lib/signals/steps/extract.d.ts +13 -0
- package/dist/lib/signals/steps/extract.js +122 -6
- package/dist/main.js +46 -3
- package/dist/schemas/hq-available-ai.v1.schema.json +76 -0
- package/dist/schemas/hq-environment-profile.v1.schema.json +438 -0
- package/dist/utils/auth-expiry.d.ts +8 -0
- package/dist/utils/auth-expiry.js +53 -0
- package/dist/utils/catalog-runtime-paths.d.ts +34 -0
- package/dist/utils/catalog-runtime-paths.js +53 -0
- package/dist/utils/cli-telemetry.d.ts +21 -0
- package/dist/utils/cli-telemetry.js +34 -0
- package/dist/utils/command-usage.d.ts +275 -0
- package/dist/utils/command-usage.js +797 -0
- package/dist/utils/files-browse-acl.js +1 -1
- package/dist/utils/hook-trust.d.ts +7 -0
- package/dist/utils/hook-trust.js +31 -4
- package/dist/utils/host-registration.d.ts +126 -0
- package/dist/utils/host-registration.js +378 -0
- package/dist/utils/resident-package-preload.js +2 -0
- package/package.json +10 -8
- package/scripts/bench-core.mjs +1096 -0
- package/scripts/check-function-manifest.mjs +702 -0
- package/dist/lib/delivery/workers/windows-boundary.d.ts +0 -453
- package/dist/lib/delivery/workers/windows-boundary.js +0 -693
|
@@ -1202,7 +1202,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
1202
1202
|
readonly subcommands: readonly [];
|
|
1203
1203
|
}, {
|
|
1204
1204
|
readonly name: "held";
|
|
1205
|
-
readonly description: "Show uploads held
|
|
1205
|
+
readonly description: "Show uploads held until you confirm they belong to the signed-in account";
|
|
1206
1206
|
readonly aliases: readonly [];
|
|
1207
1207
|
readonly hidden: false;
|
|
1208
1208
|
readonly helpOption: true;
|
|
@@ -1448,7 +1448,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
1448
1448
|
readonly subcommands: readonly [];
|
|
1449
1449
|
}, {
|
|
1450
1450
|
readonly name: "whoami";
|
|
1451
|
-
readonly description: "Show
|
|
1451
|
+
readonly description: "Show signed-in user and session expiry";
|
|
1452
1452
|
readonly aliases: readonly [];
|
|
1453
1453
|
readonly hidden: false;
|
|
1454
1454
|
readonly helpOption: true;
|
|
@@ -1884,7 +1884,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
1884
1884
|
readonly subcommands: readonly [];
|
|
1885
1885
|
}, {
|
|
1886
1886
|
readonly name: "logout";
|
|
1887
|
-
readonly description: "
|
|
1887
|
+
readonly description: "Same as `hq logout`: end the session on the server and clear cached tokens";
|
|
1888
1888
|
readonly aliases: readonly [];
|
|
1889
1889
|
readonly hidden: false;
|
|
1890
1890
|
readonly helpOption: true;
|
|
@@ -5444,6 +5444,12 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
5444
5444
|
readonly flags: "--json";
|
|
5445
5445
|
readonly description: "Print the run report as JSON";
|
|
5446
5446
|
readonly hidden: false;
|
|
5447
|
+
}, {
|
|
5448
|
+
readonly flags: "--trigger <trigger>";
|
|
5449
|
+
readonly description: "What the run ledger records as the trigger; the bot's daily job passes scheduled";
|
|
5450
|
+
readonly hidden: false;
|
|
5451
|
+
readonly choices: readonly ["scheduled", "on-demand"];
|
|
5452
|
+
readonly defaultValue: "on-demand";
|
|
5447
5453
|
}, {
|
|
5448
5454
|
readonly flags: "--hq-root <path>";
|
|
5449
5455
|
readonly description: "Local HQ tree root (default: <runtime-path>)";
|
|
@@ -12023,6 +12029,42 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12023
12029
|
readonly hidden: false;
|
|
12024
12030
|
}];
|
|
12025
12031
|
readonly subcommands: readonly [];
|
|
12032
|
+
}, {
|
|
12033
|
+
readonly name: "available";
|
|
12034
|
+
readonly description: "What AI can run now, as one token-free hq-available-ai.v1 document (read-only; a stale view starts one background read)";
|
|
12035
|
+
readonly aliases: readonly [];
|
|
12036
|
+
readonly hidden: false;
|
|
12037
|
+
readonly helpOption: true;
|
|
12038
|
+
readonly helpCommand: false;
|
|
12039
|
+
readonly usage: "[options]";
|
|
12040
|
+
readonly helpText: readonly [];
|
|
12041
|
+
readonly arguments: readonly [];
|
|
12042
|
+
readonly options: readonly [{
|
|
12043
|
+
readonly flags: "--json";
|
|
12044
|
+
readonly description: "Print the document as JSON";
|
|
12045
|
+
readonly hidden: false;
|
|
12046
|
+
}, {
|
|
12047
|
+
readonly flags: "--fresh";
|
|
12048
|
+
readonly description: "Start a read and wait for it, at most 3 seconds";
|
|
12049
|
+
readonly hidden: false;
|
|
12050
|
+
}, {
|
|
12051
|
+
readonly flags: "--include-other";
|
|
12052
|
+
readonly description: "Also list capacity-only accounts, each with its organization";
|
|
12053
|
+
readonly hidden: false;
|
|
12054
|
+
}];
|
|
12055
|
+
readonly subcommands: readonly [];
|
|
12056
|
+
}, {
|
|
12057
|
+
readonly name: "collect-once";
|
|
12058
|
+
readonly description: "One capacity read, started in the background by hq capacity available";
|
|
12059
|
+
readonly aliases: readonly [];
|
|
12060
|
+
readonly hidden: true;
|
|
12061
|
+
readonly helpOption: true;
|
|
12062
|
+
readonly helpCommand: false;
|
|
12063
|
+
readonly usage: "[options]";
|
|
12064
|
+
readonly helpText: readonly [];
|
|
12065
|
+
readonly arguments: readonly [];
|
|
12066
|
+
readonly options: readonly [];
|
|
12067
|
+
readonly subcommands: readonly [];
|
|
12026
12068
|
}, {
|
|
12027
12069
|
readonly name: "route";
|
|
12028
12070
|
readonly description: "Pick the account with the most capacity for a new lane (read-only; port of boss-route)";
|
|
@@ -12115,7 +12157,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12115
12157
|
readonly subcommands: readonly [];
|
|
12116
12158
|
}, {
|
|
12117
12159
|
readonly name: "refusal";
|
|
12118
|
-
readonly description: "Record a classified provider
|
|
12160
|
+
readonly description: "Record a classified provider refusal as a hold on one named account";
|
|
12119
12161
|
readonly aliases: readonly [];
|
|
12120
12162
|
readonly hidden: false;
|
|
12121
12163
|
readonly helpOption: true;
|
|
@@ -12123,7 +12165,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12123
12165
|
readonly usage: "[options]";
|
|
12124
12166
|
readonly helpText: readonly [{
|
|
12125
12167
|
readonly position: "after";
|
|
12126
|
-
readonly text: "\
|
|
12168
|
+
readonly text: "\nA model-CLI bot's turn, hq bot probe and the lane failure path record their\nown refusals. Run this by hand only for a provider failure that was classified\nas a rate-limit refusal (policy\nindigo-provider-failures-classified-not-masked-as-timeout), never for a\ntimeout that was not:\n\n hq capacity ingest refusal --provider <claude|codex|grok> --account <hash> [--limit-id <id>] [--resets-at <iso|epoch>]\n\n--account is required unless --limit-id names a limit that exactly one account\nhas. A limit id that several accounts share, or neither flag, is a usage error:\nnothing is recorded against a guess, even when the provider has one account.\nThe refusal is a hold beside the account's readings, and never replaces one.\n--limit-id names the limit it is about; without it the refusal claims no\nwindow. The hold ends at --resets-at, at that limit's own reset, or after a\nshort default, or sooner when a newer reading of that limit is below 100%.\n";
|
|
12127
12169
|
}];
|
|
12128
12170
|
readonly arguments: readonly [];
|
|
12129
12171
|
readonly options: readonly [{
|
|
@@ -12132,15 +12174,15 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12132
12174
|
readonly hidden: false;
|
|
12133
12175
|
}, {
|
|
12134
12176
|
readonly flags: "--limit-id <id>";
|
|
12135
|
-
readonly description: "
|
|
12177
|
+
readonly description: "The account's limit this refusal is about; without it the refusal claims no window";
|
|
12136
12178
|
readonly hidden: false;
|
|
12137
12179
|
}, {
|
|
12138
12180
|
readonly flags: "--resets-at <when>";
|
|
12139
|
-
readonly description: "UTC timestamp or epoch when
|
|
12181
|
+
readonly description: "UTC timestamp or epoch when the hold ends";
|
|
12140
12182
|
readonly hidden: false;
|
|
12141
12183
|
}, {
|
|
12142
12184
|
readonly flags: "--account <hash>";
|
|
12143
|
-
readonly description: "Hashed account id
|
|
12185
|
+
readonly description: "Hashed account id of the account that refused. Required unless --limit-id names a limit exactly one account has";
|
|
12144
12186
|
readonly hidden: false;
|
|
12145
12187
|
}, {
|
|
12146
12188
|
readonly flags: "--json";
|
|
@@ -12256,6 +12298,39 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12256
12298
|
readonly subcommands: readonly [];
|
|
12257
12299
|
}];
|
|
12258
12300
|
}];
|
|
12301
|
+
}, {
|
|
12302
|
+
readonly name: "env";
|
|
12303
|
+
readonly description: "Environment profiles: the places that can do work (hq-environment-profile.v1)";
|
|
12304
|
+
readonly aliases: readonly [];
|
|
12305
|
+
readonly hidden: false;
|
|
12306
|
+
readonly helpOption: true;
|
|
12307
|
+
readonly helpCommand: true;
|
|
12308
|
+
readonly usage: "[options] [command]";
|
|
12309
|
+
readonly helpText: readonly [];
|
|
12310
|
+
readonly arguments: readonly [];
|
|
12311
|
+
readonly options: readonly [];
|
|
12312
|
+
readonly subcommands: readonly [{
|
|
12313
|
+
readonly name: "validate";
|
|
12314
|
+
readonly description: "Check an environment profile file against hq-environment-profile.v1 (read-only; exit 1 when it is rejected; files up to 5 MB)";
|
|
12315
|
+
readonly aliases: readonly [];
|
|
12316
|
+
readonly hidden: false;
|
|
12317
|
+
readonly helpOption: true;
|
|
12318
|
+
readonly helpCommand: false;
|
|
12319
|
+
readonly usage: "[options] <file>";
|
|
12320
|
+
readonly helpText: readonly [];
|
|
12321
|
+
readonly arguments: readonly [{
|
|
12322
|
+
readonly name: "file";
|
|
12323
|
+
readonly required: true;
|
|
12324
|
+
readonly variadic: false;
|
|
12325
|
+
readonly description: "Path to a profile JSON file";
|
|
12326
|
+
}];
|
|
12327
|
+
readonly options: readonly [{
|
|
12328
|
+
readonly flags: "--json";
|
|
12329
|
+
readonly description: "Print the result as JSON";
|
|
12330
|
+
readonly hidden: false;
|
|
12331
|
+
}];
|
|
12332
|
+
readonly subcommands: readonly [];
|
|
12333
|
+
}];
|
|
12259
12334
|
}, {
|
|
12260
12335
|
readonly name: "doctor";
|
|
12261
12336
|
readonly description: "Verify HQ hook wiring, runtimes, and connection health (read-only; integrations uses one control-plane inventory read).";
|
|
@@ -12263,7 +12338,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12263
12338
|
readonly hidden: false;
|
|
12264
12339
|
readonly helpOption: true;
|
|
12265
12340
|
readonly helpCommand: false;
|
|
12266
|
-
readonly usage: "[options]";
|
|
12341
|
+
readonly usage: "[options] [command]";
|
|
12267
12342
|
readonly helpText: readonly [];
|
|
12268
12343
|
readonly arguments: readonly [];
|
|
12269
12344
|
readonly options: readonly [{
|
|
@@ -12323,7 +12398,23 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12323
12398
|
readonly description: "Let --fix run despite uncommitted changes under .claude/, .codex/, or .grok/.";
|
|
12324
12399
|
readonly hidden: false;
|
|
12325
12400
|
}];
|
|
12326
|
-
readonly subcommands: readonly [
|
|
12401
|
+
readonly subcommands: readonly [{
|
|
12402
|
+
readonly name: "usage";
|
|
12403
|
+
readonly description: "Show how many times each command ran on this computer in the last 30 days (a local file that is never sent).";
|
|
12404
|
+
readonly aliases: readonly [];
|
|
12405
|
+
readonly hidden: false;
|
|
12406
|
+
readonly helpOption: true;
|
|
12407
|
+
readonly helpCommand: false;
|
|
12408
|
+
readonly usage: "[options]";
|
|
12409
|
+
readonly helpText: readonly [];
|
|
12410
|
+
readonly arguments: readonly [];
|
|
12411
|
+
readonly options: readonly [{
|
|
12412
|
+
readonly flags: "--json";
|
|
12413
|
+
readonly description: "Emit the counts as JSON.";
|
|
12414
|
+
readonly hidden: false;
|
|
12415
|
+
}];
|
|
12416
|
+
readonly subcommands: readonly [];
|
|
12417
|
+
}];
|
|
12327
12418
|
}, {
|
|
12328
12419
|
readonly name: "mesh";
|
|
12329
12420
|
readonly description: "Work mesh — register project work, report progress, and warm ~/.hq/work-mesh/cache";
|
|
@@ -12597,6 +12688,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12597
12688
|
readonly flags: "--force";
|
|
12598
12689
|
readonly description: "Take the story even when someone else holds it";
|
|
12599
12690
|
readonly hidden: false;
|
|
12691
|
+
}, {
|
|
12692
|
+
readonly flags: "--no-ensure";
|
|
12693
|
+
readonly description: "Do not register the project from its local prd.json when the story is not on the Board";
|
|
12694
|
+
readonly hidden: false;
|
|
12600
12695
|
}, {
|
|
12601
12696
|
readonly flags: "--company <slug|uid>";
|
|
12602
12697
|
readonly description: "Company slug or cloud uid";
|
|
@@ -1445,7 +1445,7 @@ export const COMMAND_CATALOG = [
|
|
|
1445
1445
|
},
|
|
1446
1446
|
{
|
|
1447
1447
|
"name": "held",
|
|
1448
|
-
"description": "Show uploads held
|
|
1448
|
+
"description": "Show uploads held until you confirm they belong to the signed-in account",
|
|
1449
1449
|
"aliases": [],
|
|
1450
1450
|
"hidden": false,
|
|
1451
1451
|
"helpOption": true,
|
|
@@ -1741,7 +1741,7 @@ export const COMMAND_CATALOG = [
|
|
|
1741
1741
|
},
|
|
1742
1742
|
{
|
|
1743
1743
|
"name": "whoami",
|
|
1744
|
-
"description": "Show
|
|
1744
|
+
"description": "Show signed-in user and session expiry",
|
|
1745
1745
|
"aliases": [],
|
|
1746
1746
|
"hidden": false,
|
|
1747
1747
|
"helpOption": true,
|
|
@@ -2263,7 +2263,7 @@ export const COMMAND_CATALOG = [
|
|
|
2263
2263
|
},
|
|
2264
2264
|
{
|
|
2265
2265
|
"name": "logout",
|
|
2266
|
-
"description": "
|
|
2266
|
+
"description": "Same as `hq logout`: end the session on the server and clear cached tokens",
|
|
2267
2267
|
"aliases": [],
|
|
2268
2268
|
"hidden": false,
|
|
2269
2269
|
"helpOption": true,
|
|
@@ -6602,6 +6602,16 @@ export const COMMAND_CATALOG = [
|
|
|
6602
6602
|
"description": "Print the run report as JSON",
|
|
6603
6603
|
"hidden": false
|
|
6604
6604
|
},
|
|
6605
|
+
{
|
|
6606
|
+
"flags": "--trigger <trigger>",
|
|
6607
|
+
"description": "What the run ledger records as the trigger; the bot's daily job passes scheduled",
|
|
6608
|
+
"hidden": false,
|
|
6609
|
+
"choices": [
|
|
6610
|
+
"scheduled",
|
|
6611
|
+
"on-demand"
|
|
6612
|
+
],
|
|
6613
|
+
"defaultValue": "on-demand"
|
|
6614
|
+
},
|
|
6605
6615
|
{
|
|
6606
6616
|
"flags": "--hq-root <path>",
|
|
6607
6617
|
"description": "Local HQ tree root (default: <runtime-path>)",
|
|
@@ -14625,6 +14635,48 @@ export const COMMAND_CATALOG = [
|
|
|
14625
14635
|
],
|
|
14626
14636
|
"subcommands": []
|
|
14627
14637
|
},
|
|
14638
|
+
{
|
|
14639
|
+
"name": "available",
|
|
14640
|
+
"description": "What AI can run now, as one token-free hq-available-ai.v1 document (read-only; a stale view starts one background read)",
|
|
14641
|
+
"aliases": [],
|
|
14642
|
+
"hidden": false,
|
|
14643
|
+
"helpOption": true,
|
|
14644
|
+
"helpCommand": false,
|
|
14645
|
+
"usage": "[options]",
|
|
14646
|
+
"helpText": [],
|
|
14647
|
+
"arguments": [],
|
|
14648
|
+
"options": [
|
|
14649
|
+
{
|
|
14650
|
+
"flags": "--json",
|
|
14651
|
+
"description": "Print the document as JSON",
|
|
14652
|
+
"hidden": false
|
|
14653
|
+
},
|
|
14654
|
+
{
|
|
14655
|
+
"flags": "--fresh",
|
|
14656
|
+
"description": "Start a read and wait for it, at most 3 seconds",
|
|
14657
|
+
"hidden": false
|
|
14658
|
+
},
|
|
14659
|
+
{
|
|
14660
|
+
"flags": "--include-other",
|
|
14661
|
+
"description": "Also list capacity-only accounts, each with its organization",
|
|
14662
|
+
"hidden": false
|
|
14663
|
+
}
|
|
14664
|
+
],
|
|
14665
|
+
"subcommands": []
|
|
14666
|
+
},
|
|
14667
|
+
{
|
|
14668
|
+
"name": "collect-once",
|
|
14669
|
+
"description": "One capacity read, started in the background by hq capacity available",
|
|
14670
|
+
"aliases": [],
|
|
14671
|
+
"hidden": true,
|
|
14672
|
+
"helpOption": true,
|
|
14673
|
+
"helpCommand": false,
|
|
14674
|
+
"usage": "[options]",
|
|
14675
|
+
"helpText": [],
|
|
14676
|
+
"arguments": [],
|
|
14677
|
+
"options": [],
|
|
14678
|
+
"subcommands": []
|
|
14679
|
+
},
|
|
14628
14680
|
{
|
|
14629
14681
|
"name": "route",
|
|
14630
14682
|
"description": "Pick the account with the most capacity for a new lane (read-only; port of boss-route)",
|
|
@@ -14730,7 +14782,7 @@ export const COMMAND_CATALOG = [
|
|
|
14730
14782
|
},
|
|
14731
14783
|
{
|
|
14732
14784
|
"name": "refusal",
|
|
14733
|
-
"description": "Record a classified provider
|
|
14785
|
+
"description": "Record a classified provider refusal as a hold on one named account",
|
|
14734
14786
|
"aliases": [],
|
|
14735
14787
|
"hidden": false,
|
|
14736
14788
|
"helpOption": true,
|
|
@@ -14739,7 +14791,7 @@ export const COMMAND_CATALOG = [
|
|
|
14739
14791
|
"helpText": [
|
|
14740
14792
|
{
|
|
14741
14793
|
"position": "after",
|
|
14742
|
-
"text": "\
|
|
14794
|
+
"text": "\nA model-CLI bot's turn, hq bot probe and the lane failure path record their\nown refusals. Run this by hand only for a provider failure that was classified\nas a rate-limit refusal (policy\nindigo-provider-failures-classified-not-masked-as-timeout), never for a\ntimeout that was not:\n\n hq capacity ingest refusal --provider <claude|codex|grok> --account <hash> [--limit-id <id>] [--resets-at <iso|epoch>]\n\n--account is required unless --limit-id names a limit that exactly one account\nhas. A limit id that several accounts share, or neither flag, is a usage error:\nnothing is recorded against a guess, even when the provider has one account.\nThe refusal is a hold beside the account's readings, and never replaces one.\n--limit-id names the limit it is about; without it the refusal claims no\nwindow. The hold ends at --resets-at, at that limit's own reset, or after a\nshort default, or sooner when a newer reading of that limit is below 100%.\n"
|
|
14743
14795
|
}
|
|
14744
14796
|
],
|
|
14745
14797
|
"arguments": [],
|
|
@@ -14751,17 +14803,17 @@ export const COMMAND_CATALOG = [
|
|
|
14751
14803
|
},
|
|
14752
14804
|
{
|
|
14753
14805
|
"flags": "--limit-id <id>",
|
|
14754
|
-
"description": "
|
|
14806
|
+
"description": "The account's limit this refusal is about; without it the refusal claims no window",
|
|
14755
14807
|
"hidden": false
|
|
14756
14808
|
},
|
|
14757
14809
|
{
|
|
14758
14810
|
"flags": "--resets-at <when>",
|
|
14759
|
-
"description": "UTC timestamp or epoch when
|
|
14811
|
+
"description": "UTC timestamp or epoch when the hold ends",
|
|
14760
14812
|
"hidden": false
|
|
14761
14813
|
},
|
|
14762
14814
|
{
|
|
14763
14815
|
"flags": "--account <hash>",
|
|
14764
|
-
"description": "Hashed account id
|
|
14816
|
+
"description": "Hashed account id of the account that refused. Required unless --limit-id names a limit exactly one account has",
|
|
14765
14817
|
"hidden": false
|
|
14766
14818
|
},
|
|
14767
14819
|
{
|
|
@@ -14907,6 +14959,46 @@ export const COMMAND_CATALOG = [
|
|
|
14907
14959
|
}
|
|
14908
14960
|
]
|
|
14909
14961
|
},
|
|
14962
|
+
{
|
|
14963
|
+
"name": "env",
|
|
14964
|
+
"description": "Environment profiles: the places that can do work (hq-environment-profile.v1)",
|
|
14965
|
+
"aliases": [],
|
|
14966
|
+
"hidden": false,
|
|
14967
|
+
"helpOption": true,
|
|
14968
|
+
"helpCommand": true,
|
|
14969
|
+
"usage": "[options] [command]",
|
|
14970
|
+
"helpText": [],
|
|
14971
|
+
"arguments": [],
|
|
14972
|
+
"options": [],
|
|
14973
|
+
"subcommands": [
|
|
14974
|
+
{
|
|
14975
|
+
"name": "validate",
|
|
14976
|
+
"description": "Check an environment profile file against hq-environment-profile.v1 (read-only; exit 1 when it is rejected; files up to 5 MB)",
|
|
14977
|
+
"aliases": [],
|
|
14978
|
+
"hidden": false,
|
|
14979
|
+
"helpOption": true,
|
|
14980
|
+
"helpCommand": false,
|
|
14981
|
+
"usage": "[options] <file>",
|
|
14982
|
+
"helpText": [],
|
|
14983
|
+
"arguments": [
|
|
14984
|
+
{
|
|
14985
|
+
"name": "file",
|
|
14986
|
+
"required": true,
|
|
14987
|
+
"variadic": false,
|
|
14988
|
+
"description": "Path to a profile JSON file"
|
|
14989
|
+
}
|
|
14990
|
+
],
|
|
14991
|
+
"options": [
|
|
14992
|
+
{
|
|
14993
|
+
"flags": "--json",
|
|
14994
|
+
"description": "Print the result as JSON",
|
|
14995
|
+
"hidden": false
|
|
14996
|
+
}
|
|
14997
|
+
],
|
|
14998
|
+
"subcommands": []
|
|
14999
|
+
}
|
|
15000
|
+
]
|
|
15001
|
+
},
|
|
14910
15002
|
{
|
|
14911
15003
|
"name": "doctor",
|
|
14912
15004
|
"description": "Verify HQ hook wiring, runtimes, and connection health (read-only; integrations uses one control-plane inventory read).",
|
|
@@ -14914,7 +15006,7 @@ export const COMMAND_CATALOG = [
|
|
|
14914
15006
|
"hidden": false,
|
|
14915
15007
|
"helpOption": true,
|
|
14916
15008
|
"helpCommand": false,
|
|
14917
|
-
"usage": "[options]",
|
|
15009
|
+
"usage": "[options] [command]",
|
|
14918
15010
|
"helpText": [],
|
|
14919
15011
|
"arguments": [],
|
|
14920
15012
|
"options": [
|
|
@@ -14989,7 +15081,27 @@ export const COMMAND_CATALOG = [
|
|
|
14989
15081
|
"hidden": false
|
|
14990
15082
|
}
|
|
14991
15083
|
],
|
|
14992
|
-
"subcommands": [
|
|
15084
|
+
"subcommands": [
|
|
15085
|
+
{
|
|
15086
|
+
"name": "usage",
|
|
15087
|
+
"description": "Show how many times each command ran on this computer in the last 30 days (a local file that is never sent).",
|
|
15088
|
+
"aliases": [],
|
|
15089
|
+
"hidden": false,
|
|
15090
|
+
"helpOption": true,
|
|
15091
|
+
"helpCommand": false,
|
|
15092
|
+
"usage": "[options]",
|
|
15093
|
+
"helpText": [],
|
|
15094
|
+
"arguments": [],
|
|
15095
|
+
"options": [
|
|
15096
|
+
{
|
|
15097
|
+
"flags": "--json",
|
|
15098
|
+
"description": "Emit the counts as JSON.",
|
|
15099
|
+
"hidden": false
|
|
15100
|
+
}
|
|
15101
|
+
],
|
|
15102
|
+
"subcommands": []
|
|
15103
|
+
}
|
|
15104
|
+
]
|
|
14993
15105
|
},
|
|
14994
15106
|
{
|
|
14995
15107
|
"name": "mesh",
|
|
@@ -15325,6 +15437,11 @@ export const COMMAND_CATALOG = [
|
|
|
15325
15437
|
"description": "Take the story even when someone else holds it",
|
|
15326
15438
|
"hidden": false
|
|
15327
15439
|
},
|
|
15440
|
+
{
|
|
15441
|
+
"flags": "--no-ensure",
|
|
15442
|
+
"description": "Do not register the project from its local prd.json when the story is not on the Board",
|
|
15443
|
+
"hidden": false
|
|
15444
|
+
},
|
|
15328
15445
|
{
|
|
15329
15446
|
"flags": "--company <slug|uid>",
|
|
15330
15447
|
"description": "Company slug or cloud uid",
|
package/dist/command-help.js
CHANGED
|
@@ -2,12 +2,14 @@ import { Command } from "commander";
|
|
|
2
2
|
import { CLI_VERSION } from "./cli-version.js";
|
|
3
3
|
import { registerCommandCatalog } from "./lazy-commands.js";
|
|
4
4
|
import { argvWithoutHelpOnUnknownCommand } from "./unknown-command.js";
|
|
5
|
+
import { STILL_USE_FLAG, STILL_USE_FLAG_DESCRIPTION } from "./utils/command-usage.js";
|
|
5
6
|
export async function runCommandHelp(argv) {
|
|
6
7
|
const program = new Command()
|
|
7
8
|
.name("hq")
|
|
8
9
|
.description("HQ management CLI — modules, packages, and cloud sync")
|
|
9
10
|
.version(CLI_VERSION)
|
|
10
|
-
.option("--verbose", "Show verbose diagnostics, including SDK runtime warnings")
|
|
11
|
+
.option("--verbose", "Show verbose diagnostics, including SDK runtime warnings")
|
|
12
|
+
.option(STILL_USE_FLAG, STILL_USE_FLAG_DESCRIPTION);
|
|
11
13
|
registerCommandCatalog(program);
|
|
12
14
|
const { hideStorageInCatalog } = await import("./lib/storage-feature-flag.js");
|
|
13
15
|
hideStorageInCatalog(program);
|
|
@@ -484,6 +484,12 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
484
484
|
readonly parent: "program";
|
|
485
485
|
readonly module: "./commands/capacity.js";
|
|
486
486
|
readonly exportName: "registerCapacityCommand";
|
|
487
|
+
}, {
|
|
488
|
+
readonly type: "registrar";
|
|
489
|
+
readonly root: "env";
|
|
490
|
+
readonly parent: "program";
|
|
491
|
+
readonly module: "./commands/env.js";
|
|
492
|
+
readonly exportName: "registerEnvCommand";
|
|
487
493
|
}, {
|
|
488
494
|
readonly type: "registrar";
|
|
489
495
|
readonly root: "doctor";
|
|
@@ -83,6 +83,7 @@ export const REGISTRATION_PLAN = [
|
|
|
83
83
|
{ type: "registrar", root: "library", parent: "program", module: "./commands/library.js", exportName: "registerLibraryCommand" },
|
|
84
84
|
{ type: "registrar", root: "index", parent: "program", module: "./commands/index-cmd.js", exportName: "registerIndexCommand" },
|
|
85
85
|
{ type: "registrar", root: "capacity", parent: "program", module: "./commands/capacity.js", exportName: "registerCapacityCommand" },
|
|
86
|
+
{ type: "registrar", root: "env", parent: "program", module: "./commands/env.js", exportName: "registerEnvCommand" },
|
|
86
87
|
{ type: "registrar", root: "doctor", parent: "program", module: "./commands/doctor.js", exportName: "registerDoctorCommand" },
|
|
87
88
|
{ type: "registrar", root: "mesh", parent: "program", module: "./commands/mesh.js", exportName: "registerMeshCommand" },
|
|
88
89
|
{ type: "registrar", root: "runners", parent: "program", module: "./commands/lanes.js", exportName: "registerRunnersCommand" },
|
package/dist/commands/auth.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Subcommands:
|
|
5
5
|
* hq auth login — open the Cognito Hosted UI in the browser and cache tokens
|
|
6
|
-
* hq auth logout —
|
|
6
|
+
* hq auth logout — second name for `hq logout` (same sign-out)
|
|
7
7
|
* hq auth refresh — ensure a valid cached Cognito session (non-interactive)
|
|
8
8
|
* hq auth status — show whether a valid session is cached + expiry
|
|
9
9
|
* hq auth machine-session --output <path> — write machine tokens to a private file
|
package/dist/commands/auth.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Subcommands:
|
|
5
5
|
* hq auth login — open the Cognito Hosted UI in the browser and cache tokens
|
|
6
|
-
* hq auth logout —
|
|
6
|
+
* hq auth logout — second name for `hq logout` (same sign-out)
|
|
7
7
|
* hq auth refresh — ensure a valid cached Cognito session (non-interactive)
|
|
8
8
|
* hq auth status — show whether a valid session is cached + expiry
|
|
9
9
|
* hq auth machine-session --output <path> — write machine tokens to a private file
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
* by the deploy + sync skills.
|
|
18
18
|
*/
|
|
19
19
|
import { loginWithBrowserPreference } from "../utils/login-browser.js";
|
|
20
|
+
import { formatAuthExpiry } from "../utils/auth-expiry.js";
|
|
20
21
|
import { releaseCurrentPackageUseLease, releasePackageUseLeaseAfterResidentPreload } from "../utils/package-use-lease.js";
|
|
21
22
|
import { preloadResidentPackageModules, reportResidentPackagePreloadFailure } from "../utils/resident-package-preload.js";
|
|
22
23
|
import * as fs from "node:fs";
|
|
23
24
|
import { open, realpath } from "node:fs/promises";
|
|
24
25
|
import path from "node:path";
|
|
25
26
|
import chalk from "chalk";
|
|
26
|
-
import {
|
|
27
|
+
import { loadCachedTokens, isExpiring, loadMachineCreds, isExternalMachineCreds, CognitoAuthError, } from "@indigoai-us/hq-cloud";
|
|
27
28
|
import { authenticateMachineSession, MachineLoginError } from "../lib/daemon/machine-login.js";
|
|
28
29
|
import { DEFAULT_COGNITO, refreshCachedSession, resolveCognitoTokenSource, ensureMachineSessionTokens, personTokenCacheFile, machineTokenCacheFile, loadMachineCachedTokens, } from "../utils/cognito-session.js";
|
|
29
30
|
// Static (node builtins only): a lazy import here would need a resident
|
|
@@ -49,44 +50,6 @@ function decodeIdTokenClaims(idToken) {
|
|
|
49
50
|
return undefined;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
function formatAuthExpiry(expiresAt, now = Date.now()) {
|
|
53
|
-
const expiresAtMs = typeof expiresAt === "number" ? expiresAt : Date.parse(expiresAt);
|
|
54
|
-
const expiresAtDate = new Date(expiresAtMs);
|
|
55
|
-
if (!Number.isFinite(expiresAtMs) || Number.isNaN(expiresAtDate.getTime())) {
|
|
56
|
-
return String(expiresAt);
|
|
57
|
-
}
|
|
58
|
-
const remainingMs = expiresAtMs - now;
|
|
59
|
-
const absoluteMs = Math.abs(remainingMs);
|
|
60
|
-
let unit;
|
|
61
|
-
let unitMs;
|
|
62
|
-
if (absoluteMs >= 365 * 24 * 60 * 60 * 1_000) {
|
|
63
|
-
unit = "year";
|
|
64
|
-
unitMs = 365 * 24 * 60 * 60 * 1_000;
|
|
65
|
-
}
|
|
66
|
-
else if (absoluteMs >= 30 * 24 * 60 * 60 * 1_000) {
|
|
67
|
-
unit = "month";
|
|
68
|
-
unitMs = 30 * 24 * 60 * 60 * 1_000;
|
|
69
|
-
}
|
|
70
|
-
else if (absoluteMs >= 24 * 60 * 60 * 1_000) {
|
|
71
|
-
unit = "day";
|
|
72
|
-
unitMs = 24 * 60 * 60 * 1_000;
|
|
73
|
-
}
|
|
74
|
-
else if (absoluteMs >= 60 * 60 * 1_000) {
|
|
75
|
-
unit = "hour";
|
|
76
|
-
unitMs = 60 * 60 * 1_000;
|
|
77
|
-
}
|
|
78
|
-
else if (absoluteMs >= 60 * 1_000) {
|
|
79
|
-
unit = "minute";
|
|
80
|
-
unitMs = 60 * 1_000;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
unit = "second";
|
|
84
|
-
unitMs = 1_000;
|
|
85
|
-
}
|
|
86
|
-
const relative = new Intl.RelativeTimeFormat("en", { numeric: "always" })
|
|
87
|
-
.format(Math.round(remainingMs / unitMs), unit);
|
|
88
|
-
return expiresAtDate.toISOString() + " (" + relative + ")";
|
|
89
|
-
}
|
|
90
53
|
function peekIdToken(idToken) {
|
|
91
54
|
const claims = decodeIdTokenClaims(idToken);
|
|
92
55
|
return {
|
|
@@ -311,7 +274,7 @@ export function registerAuthCommands(program) {
|
|
|
311
274
|
const existing = loadCachedTokens();
|
|
312
275
|
if (existing && !isExpiring(existing, 120)) {
|
|
313
276
|
const who = peekIdToken(existing.idToken).email ?? "cached session";
|
|
314
|
-
console.log(chalk.green(`Already signed in (${who}). Run \`hq
|
|
277
|
+
console.log(chalk.green(`Already signed in (${who}). Run \`hq logout\` to switch accounts.`));
|
|
315
278
|
return;
|
|
316
279
|
}
|
|
317
280
|
try {
|
|
@@ -360,17 +323,13 @@ export function registerAuthCommands(program) {
|
|
|
360
323
|
});
|
|
361
324
|
authCmd
|
|
362
325
|
.command("logout")
|
|
363
|
-
.description("
|
|
326
|
+
.description("Same as `hq logout`: end the session on the server and clear cached tokens")
|
|
364
327
|
.action(async () => {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
clearCachedTokens();
|
|
373
|
-
console.log(chalk.green("Signed out — removed ~/.hq/cognito-tokens.json"));
|
|
328
|
+
// Second name for `hq logout`. It signs out exactly as `hq logout` does,
|
|
329
|
+
// so the refresh token is revoked on the server on this path too. It is
|
|
330
|
+
// not marked retiring yet: the shipped /hq-logout skill still runs it.
|
|
331
|
+
const { runLogout } = await import("./logout.js");
|
|
332
|
+
await runLogout();
|
|
374
333
|
});
|
|
375
334
|
authCmd
|
|
376
335
|
.command("keychain")
|
|
@@ -463,7 +422,7 @@ export function registerAuthCommands(program) {
|
|
|
463
422
|
console.log(chalk.dim(`token source: ${tokenSource}`));
|
|
464
423
|
return;
|
|
465
424
|
}
|
|
466
|
-
console.log(chalk.yellow("No cached HQ session — run `hq
|
|
425
|
+
console.log(chalk.yellow("No cached HQ session — run `hq login`"));
|
|
467
426
|
console.log(chalk.dim(`token source: ${tokenSource}`));
|
|
468
427
|
process.exit(1);
|
|
469
428
|
}
|