@indigoai-us/hq-cli 5.162.0 → 5.164.0
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 +26 -0
- package/dist/command-catalog.generated.d.ts +188 -0
- package/dist/command-catalog.generated.js +235 -0
- package/dist/command-registration-plan.d.ts +7 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/agent-enroll.d.ts +6 -1
- package/dist/commands/agent-enroll.js +30 -3
- package/dist/commands/agents.js +15 -22
- package/dist/commands/bot.js +56 -6
- package/dist/commands/daemon.d.ts +53 -0
- package/dist/commands/daemon.js +554 -0
- package/dist/commands/lanes.js +7 -0
- package/dist/commands/meetings.js +18 -16
- package/dist/commands/mesh.js +9 -0
- package/dist/lib/daemon/catalog.d.ts +85 -0
- package/dist/lib/daemon/catalog.js +274 -0
- package/dist/lib/daemon/config.d.ts +26 -0
- package/dist/lib/daemon/config.js +85 -0
- package/dist/lib/daemon/handoff.d.ts +53 -0
- package/dist/lib/daemon/handoff.js +136 -0
- package/dist/lib/daemon/install.d.ts +76 -0
- package/dist/lib/daemon/install.js +299 -0
- package/dist/lib/daemon/legacy.d.ts +35 -0
- package/dist/lib/daemon/legacy.js +120 -0
- package/dist/lib/daemon/lock.d.ts +47 -0
- package/dist/lib/daemon/lock.js +138 -0
- package/dist/lib/daemon/machine-type.d.ts +48 -0
- package/dist/lib/daemon/machine-type.js +139 -0
- package/dist/lib/daemon/migrate.d.ts +61 -0
- package/dist/lib/daemon/migrate.js +238 -0
- package/dist/lib/daemon/paths.d.ts +22 -0
- package/dist/lib/daemon/paths.js +42 -0
- package/dist/lib/daemon/remote-control.d.ts +35 -0
- package/dist/lib/daemon/remote-control.js +47 -0
- package/dist/lib/daemon/requests.d.ts +24 -0
- package/dist/lib/daemon/requests.js +63 -0
- package/dist/lib/daemon/run.d.ts +41 -0
- package/dist/lib/daemon/run.js +319 -0
- package/dist/lib/daemon/supervisor.d.ts +87 -0
- package/dist/lib/daemon/supervisor.js +523 -0
- package/dist/lib/daemon/updater.d.ts +39 -0
- package/dist/lib/daemon/updater.js +103 -0
- package/dist/lib/flag-registry.d.ts +7 -1
- package/dist/lib/flag-registry.js +8 -0
- package/dist/lib/mesh/live/backoff.d.ts +2 -2
- package/dist/lib/mesh/live/backoff.js +16 -3
- package/dist/lib/mesh/live/daemon/run.d.ts +2 -2
- package/dist/lib/mesh/live/daemon/run.js +5 -2
- package/dist/lib/mesh/live/flush.d.ts +3 -2
- package/dist/lib/mesh/live/flush.js +34 -7
- package/dist/lib/mesh/live/session-events-client.d.ts +2 -0
- package/dist/lib/mesh/live/session-events-client.js +25 -0
- package/dist/lib/service-manager/systemd.d.ts +2 -2
- package/dist/lib/service-manager/systemd.js +1 -1
- package/dist/lib/service-manager/types.d.ts +2 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.js +53 -13
- package/dist/sentry.js +5 -1
- package/dist/startup-registration.d.ts +3 -1
- package/dist/startup-registration.js +25 -4
- package/dist/utils/cognito-session.d.ts +4 -0
- package/dist/utils/cognito-session.js +11 -10
- package/dist/utils/install-tree-torn.d.ts +29 -10
- package/dist/utils/install-tree-torn.js +262 -29
- package/dist/utils/plan-gate-error.d.ts +27 -13
- package/dist/utils/plan-gate-error.js +133 -58
- package/dist/utils/self-update.d.ts +9 -0
- package/dist/utils/self-update.js +15 -2
- package/dist/utils/sentry-fingerprint.d.ts +7 -1
- package/dist/utils/sentry-fingerprint.js +95 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.164.0] — 2026-09-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- When a startup import fails, hq-cli checks for an update lock, a retired package
|
|
10
|
+
directory, or install-tree changes for 1.5 seconds. If none appears, it exits
|
|
11
|
+
with `npm install -g @indigoai-us/hq-cli@latest` instead of waiting 90 seconds.
|
|
12
|
+
Sentry context replaces the home-directory prefix with `~`.
|
|
13
|
+
- Sentry keeps the `guarded`, `unsettled`, `reexec-failed`, and `lock-held`
|
|
14
|
+
outcomes, adds `stale_tree` and `tree_state`, and tags `updater_source` when
|
|
15
|
+
known. The fingerprint remains `["InstallTreeTornError", "outcome:<token>"]`,
|
|
16
|
+
so the four existing outcome groups keep their keys.
|
|
17
|
+
|
|
18
|
+
## [5.163.0] — 2026-09-24
|
|
19
|
+
|
|
20
|
+
- Workforce plan refusals in the CLI keep direct checkout for eligible companies.
|
|
21
|
+
The server upgrade URL stays visible; personal refusals and checkout failures can
|
|
22
|
+
open it. Non-TTY and JSON runs print only the URL and exit non-zero.
|
|
23
|
+
|
|
24
|
+
- `hq mesh` sends at most 25 replayed events for a session in one flush. It honors `Retry-After` on 429 and 503 responses and stops waiting when the daemon shuts down.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `hq daemon` now also runs the `updater` (hq CLI and Codex updates every six hours, then restarts the daemon onto the new version), `remote-control` (`claude remote-control` in a private tmux session on outposts) and `jobs-reconcile` (the outpost jobs reconcile script every ten minutes). `hq bot`, `hq mesh daemon install` and `hq lanes reconcile install` hand their service to the daemon when it is installed instead of adding their own background unit. `hq daemon migrate --apply` stops the older HQ background units and moves their definitions aside so the daemon runs those services, and `hq daemon uninstall --restore-legacy` puts them back; The desktop app's own sync agent is never taken over.
|
|
29
|
+
- `hq daemon` runs all of a machine's HQ background services under one supervisor. `hq daemon install` works out whether the machine is a desktop, self-hosted server, outpost, agent box or agent kit, installs one background service, and starts that machine type's default services (sync, mesh, heartbeat, bots, lanes cleanup, search indexing and log rotation, depending on the type). `hq daemon enable|disable <service>` changes the list for one machine. `status`, `logs`, `restart` and `trigger` manage the running services. A service that an older background unit already runs is left to that unit, and `hq daemon migrate` only lists what it would take over. The command is hidden from `hq --help` while it rolls out. It needs no feature flag.
|
|
30
|
+
|
|
5
31
|
## [5.162.0] — 2026-09-24
|
|
6
32
|
|
|
7
33
|
### Fixed
|
|
@@ -7639,6 +7639,194 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
7639
7639
|
readonly subcommands: readonly [];
|
|
7640
7640
|
}];
|
|
7641
7641
|
}];
|
|
7642
|
+
}, {
|
|
7643
|
+
readonly name: "daemon";
|
|
7644
|
+
readonly description: "Run all of this machine's HQ background services under one supervisor";
|
|
7645
|
+
readonly aliases: readonly [];
|
|
7646
|
+
readonly hidden: true;
|
|
7647
|
+
readonly usage: "[options] [command]";
|
|
7648
|
+
readonly arguments: readonly [];
|
|
7649
|
+
readonly options: readonly [];
|
|
7650
|
+
readonly subcommands: readonly [{
|
|
7651
|
+
readonly name: "install";
|
|
7652
|
+
readonly description: "Detect this machine's type, install the daemon, and start its default services";
|
|
7653
|
+
readonly aliases: readonly [];
|
|
7654
|
+
readonly hidden: false;
|
|
7655
|
+
readonly usage: "[options]";
|
|
7656
|
+
readonly arguments: readonly [];
|
|
7657
|
+
readonly options: readonly [{
|
|
7658
|
+
readonly flags: "--machine-type <type>";
|
|
7659
|
+
readonly description: "desktop | self-hosted | outpost | agent-box | agent-kit (skips detection)";
|
|
7660
|
+
}, {
|
|
7661
|
+
readonly flags: "--hq-root <path>";
|
|
7662
|
+
readonly description: "HQ folder the services work against";
|
|
7663
|
+
}];
|
|
7664
|
+
readonly subcommands: readonly [];
|
|
7665
|
+
}, {
|
|
7666
|
+
readonly name: "uninstall";
|
|
7667
|
+
readonly description: "Stop the daemon and remove its OS unit";
|
|
7668
|
+
readonly aliases: readonly [];
|
|
7669
|
+
readonly hidden: false;
|
|
7670
|
+
readonly usage: "[options]";
|
|
7671
|
+
readonly arguments: readonly [];
|
|
7672
|
+
readonly options: readonly [{
|
|
7673
|
+
readonly flags: "--purge";
|
|
7674
|
+
readonly description: "Also delete ~/.hq/daemon (settings, state and logs)";
|
|
7675
|
+
}, {
|
|
7676
|
+
readonly flags: "--restore-legacy";
|
|
7677
|
+
readonly description: "Give the services `hq daemon migrate --apply` took over back to their original units";
|
|
7678
|
+
}];
|
|
7679
|
+
readonly subcommands: readonly [];
|
|
7680
|
+
}, {
|
|
7681
|
+
readonly name: "run";
|
|
7682
|
+
readonly description: "Run the supervisor (this is what the OS unit starts)";
|
|
7683
|
+
readonly aliases: readonly [];
|
|
7684
|
+
readonly hidden: false;
|
|
7685
|
+
readonly usage: "[options]";
|
|
7686
|
+
readonly arguments: readonly [];
|
|
7687
|
+
readonly options: readonly [{
|
|
7688
|
+
readonly flags: "--foreground";
|
|
7689
|
+
readonly description: "Also print the supervisor log to the terminal";
|
|
7690
|
+
}, {
|
|
7691
|
+
readonly flags: "--daemon-dir <path>";
|
|
7692
|
+
readonly description: "Use this folder instead of ~/.hq/daemon (how the Windows task passes HQ_DAEMON_DIR)";
|
|
7693
|
+
}, {
|
|
7694
|
+
readonly flags: "--managed";
|
|
7695
|
+
readonly description: "Started by the OS unit, which starts the daemon again whenever it exits";
|
|
7696
|
+
}];
|
|
7697
|
+
readonly subcommands: readonly [];
|
|
7698
|
+
}, {
|
|
7699
|
+
readonly name: "status";
|
|
7700
|
+
readonly description: "Show the machine type and each service's state";
|
|
7701
|
+
readonly aliases: readonly [];
|
|
7702
|
+
readonly hidden: false;
|
|
7703
|
+
readonly usage: "[options]";
|
|
7704
|
+
readonly arguments: readonly [];
|
|
7705
|
+
readonly options: readonly [{
|
|
7706
|
+
readonly flags: "--json";
|
|
7707
|
+
readonly description: "Print machine-readable JSON";
|
|
7708
|
+
}];
|
|
7709
|
+
readonly subcommands: readonly [];
|
|
7710
|
+
}, {
|
|
7711
|
+
readonly name: "logs";
|
|
7712
|
+
readonly description: "Print the supervisor log, or one service's log";
|
|
7713
|
+
readonly aliases: readonly [];
|
|
7714
|
+
readonly hidden: false;
|
|
7715
|
+
readonly usage: "[options] [unit]";
|
|
7716
|
+
readonly arguments: readonly [{
|
|
7717
|
+
readonly name: "unit";
|
|
7718
|
+
readonly required: false;
|
|
7719
|
+
readonly variadic: false;
|
|
7720
|
+
}];
|
|
7721
|
+
readonly options: readonly [{
|
|
7722
|
+
readonly flags: "-f, --follow";
|
|
7723
|
+
readonly description: "Keep printing new lines";
|
|
7724
|
+
}, {
|
|
7725
|
+
readonly flags: "-n, --lines <n>";
|
|
7726
|
+
readonly description: "How many lines to print first";
|
|
7727
|
+
}];
|
|
7728
|
+
readonly subcommands: readonly [];
|
|
7729
|
+
}, {
|
|
7730
|
+
readonly name: "restart";
|
|
7731
|
+
readonly description: "Restart one service, or every running service";
|
|
7732
|
+
readonly aliases: readonly [];
|
|
7733
|
+
readonly hidden: false;
|
|
7734
|
+
readonly usage: "[options] [unit]";
|
|
7735
|
+
readonly arguments: readonly [{
|
|
7736
|
+
readonly name: "unit";
|
|
7737
|
+
readonly required: false;
|
|
7738
|
+
readonly variadic: false;
|
|
7739
|
+
}];
|
|
7740
|
+
readonly options: readonly [];
|
|
7741
|
+
readonly subcommands: readonly [];
|
|
7742
|
+
}, {
|
|
7743
|
+
readonly name: "trigger";
|
|
7744
|
+
readonly description: "Run a scheduled service now (for example search-index)";
|
|
7745
|
+
readonly aliases: readonly [];
|
|
7746
|
+
readonly hidden: false;
|
|
7747
|
+
readonly usage: "[options] <unit>";
|
|
7748
|
+
readonly arguments: readonly [{
|
|
7749
|
+
readonly name: "unit";
|
|
7750
|
+
readonly required: true;
|
|
7751
|
+
readonly variadic: false;
|
|
7752
|
+
}];
|
|
7753
|
+
readonly options: readonly [];
|
|
7754
|
+
readonly subcommands: readonly [];
|
|
7755
|
+
}, {
|
|
7756
|
+
readonly name: "enable";
|
|
7757
|
+
readonly description: "Turn services on for this machine, beyond its defaults";
|
|
7758
|
+
readonly aliases: readonly [];
|
|
7759
|
+
readonly hidden: false;
|
|
7760
|
+
readonly usage: "[options] <services...>";
|
|
7761
|
+
readonly arguments: readonly [{
|
|
7762
|
+
readonly name: "services";
|
|
7763
|
+
readonly required: true;
|
|
7764
|
+
readonly variadic: true;
|
|
7765
|
+
}];
|
|
7766
|
+
readonly options: readonly [];
|
|
7767
|
+
readonly subcommands: readonly [];
|
|
7768
|
+
}, {
|
|
7769
|
+
readonly name: "disable";
|
|
7770
|
+
readonly description: "Turn default services off for this machine";
|
|
7771
|
+
readonly aliases: readonly [];
|
|
7772
|
+
readonly hidden: false;
|
|
7773
|
+
readonly usage: "[options] <services...>";
|
|
7774
|
+
readonly arguments: readonly [{
|
|
7775
|
+
readonly name: "services";
|
|
7776
|
+
readonly required: true;
|
|
7777
|
+
readonly variadic: true;
|
|
7778
|
+
}];
|
|
7779
|
+
readonly options: readonly [];
|
|
7780
|
+
readonly subcommands: readonly [];
|
|
7781
|
+
}, {
|
|
7782
|
+
readonly name: "migrate";
|
|
7783
|
+
readonly description: "List the older HQ background units the daemon would take over; --apply takes them over";
|
|
7784
|
+
readonly aliases: readonly [];
|
|
7785
|
+
readonly hidden: false;
|
|
7786
|
+
readonly usage: "[options]";
|
|
7787
|
+
readonly arguments: readonly [];
|
|
7788
|
+
readonly options: readonly [{
|
|
7789
|
+
readonly flags: "--apply";
|
|
7790
|
+
readonly description: "Stop the older units and let the daemon run their services";
|
|
7791
|
+
}];
|
|
7792
|
+
readonly subcommands: readonly [];
|
|
7793
|
+
}, {
|
|
7794
|
+
readonly name: "service";
|
|
7795
|
+
readonly description: "Entry points the daemon runs for services that have no command of their own";
|
|
7796
|
+
readonly aliases: readonly [];
|
|
7797
|
+
readonly hidden: true;
|
|
7798
|
+
readonly usage: "[options] [command]";
|
|
7799
|
+
readonly arguments: readonly [];
|
|
7800
|
+
readonly options: readonly [];
|
|
7801
|
+
readonly subcommands: readonly [{
|
|
7802
|
+
readonly name: "self-update";
|
|
7803
|
+
readonly description: "Update the hq CLI (and Codex), then restart the daemon onto the new version";
|
|
7804
|
+
readonly aliases: readonly [];
|
|
7805
|
+
readonly hidden: false;
|
|
7806
|
+
readonly usage: "[options]";
|
|
7807
|
+
readonly arguments: readonly [];
|
|
7808
|
+
readonly options: readonly [];
|
|
7809
|
+
readonly subcommands: readonly [];
|
|
7810
|
+
}, {
|
|
7811
|
+
readonly name: "remote-control";
|
|
7812
|
+
readonly description: "Keep `claude remote-control` running in a tmux session in the HQ folder";
|
|
7813
|
+
readonly aliases: readonly [];
|
|
7814
|
+
readonly hidden: false;
|
|
7815
|
+
readonly usage: "[options]";
|
|
7816
|
+
readonly arguments: readonly [];
|
|
7817
|
+
readonly options: readonly [{
|
|
7818
|
+
readonly flags: "--claude <path>";
|
|
7819
|
+
readonly description: "claude binary";
|
|
7820
|
+
}, {
|
|
7821
|
+
readonly flags: "--name <name>";
|
|
7822
|
+
readonly description: "remote-control session name";
|
|
7823
|
+
}, {
|
|
7824
|
+
readonly flags: "--permission-mode <mode>";
|
|
7825
|
+
readonly description: "claude --permission-mode";
|
|
7826
|
+
}];
|
|
7827
|
+
readonly subcommands: readonly [];
|
|
7828
|
+
}];
|
|
7829
|
+
}];
|
|
7642
7830
|
}, {
|
|
7643
7831
|
readonly name: "bot";
|
|
7644
7832
|
readonly description: "Personal local bots that run on this computer with your own model login";
|
|
@@ -9880,6 +9880,241 @@ export const COMMAND_CATALOG = [
|
|
|
9880
9880
|
}
|
|
9881
9881
|
]
|
|
9882
9882
|
},
|
|
9883
|
+
{
|
|
9884
|
+
"name": "daemon",
|
|
9885
|
+
"description": "Run all of this machine's HQ background services under one supervisor",
|
|
9886
|
+
"aliases": [],
|
|
9887
|
+
"hidden": true,
|
|
9888
|
+
"usage": "[options] [command]",
|
|
9889
|
+
"arguments": [],
|
|
9890
|
+
"options": [],
|
|
9891
|
+
"subcommands": [
|
|
9892
|
+
{
|
|
9893
|
+
"name": "install",
|
|
9894
|
+
"description": "Detect this machine's type, install the daemon, and start its default services",
|
|
9895
|
+
"aliases": [],
|
|
9896
|
+
"hidden": false,
|
|
9897
|
+
"usage": "[options]",
|
|
9898
|
+
"arguments": [],
|
|
9899
|
+
"options": [
|
|
9900
|
+
{
|
|
9901
|
+
"flags": "--machine-type <type>",
|
|
9902
|
+
"description": "desktop | self-hosted | outpost | agent-box | agent-kit (skips detection)"
|
|
9903
|
+
},
|
|
9904
|
+
{
|
|
9905
|
+
"flags": "--hq-root <path>",
|
|
9906
|
+
"description": "HQ folder the services work against"
|
|
9907
|
+
}
|
|
9908
|
+
],
|
|
9909
|
+
"subcommands": []
|
|
9910
|
+
},
|
|
9911
|
+
{
|
|
9912
|
+
"name": "uninstall",
|
|
9913
|
+
"description": "Stop the daemon and remove its OS unit",
|
|
9914
|
+
"aliases": [],
|
|
9915
|
+
"hidden": false,
|
|
9916
|
+
"usage": "[options]",
|
|
9917
|
+
"arguments": [],
|
|
9918
|
+
"options": [
|
|
9919
|
+
{
|
|
9920
|
+
"flags": "--purge",
|
|
9921
|
+
"description": "Also delete ~/.hq/daemon (settings, state and logs)"
|
|
9922
|
+
},
|
|
9923
|
+
{
|
|
9924
|
+
"flags": "--restore-legacy",
|
|
9925
|
+
"description": "Give the services `hq daemon migrate --apply` took over back to their original units"
|
|
9926
|
+
}
|
|
9927
|
+
],
|
|
9928
|
+
"subcommands": []
|
|
9929
|
+
},
|
|
9930
|
+
{
|
|
9931
|
+
"name": "run",
|
|
9932
|
+
"description": "Run the supervisor (this is what the OS unit starts)",
|
|
9933
|
+
"aliases": [],
|
|
9934
|
+
"hidden": false,
|
|
9935
|
+
"usage": "[options]",
|
|
9936
|
+
"arguments": [],
|
|
9937
|
+
"options": [
|
|
9938
|
+
{
|
|
9939
|
+
"flags": "--foreground",
|
|
9940
|
+
"description": "Also print the supervisor log to the terminal"
|
|
9941
|
+
},
|
|
9942
|
+
{
|
|
9943
|
+
"flags": "--daemon-dir <path>",
|
|
9944
|
+
"description": "Use this folder instead of ~/.hq/daemon (how the Windows task passes HQ_DAEMON_DIR)"
|
|
9945
|
+
},
|
|
9946
|
+
{
|
|
9947
|
+
"flags": "--managed",
|
|
9948
|
+
"description": "Started by the OS unit, which starts the daemon again whenever it exits"
|
|
9949
|
+
}
|
|
9950
|
+
],
|
|
9951
|
+
"subcommands": []
|
|
9952
|
+
},
|
|
9953
|
+
{
|
|
9954
|
+
"name": "status",
|
|
9955
|
+
"description": "Show the machine type and each service's state",
|
|
9956
|
+
"aliases": [],
|
|
9957
|
+
"hidden": false,
|
|
9958
|
+
"usage": "[options]",
|
|
9959
|
+
"arguments": [],
|
|
9960
|
+
"options": [
|
|
9961
|
+
{
|
|
9962
|
+
"flags": "--json",
|
|
9963
|
+
"description": "Print machine-readable JSON"
|
|
9964
|
+
}
|
|
9965
|
+
],
|
|
9966
|
+
"subcommands": []
|
|
9967
|
+
},
|
|
9968
|
+
{
|
|
9969
|
+
"name": "logs",
|
|
9970
|
+
"description": "Print the supervisor log, or one service's log",
|
|
9971
|
+
"aliases": [],
|
|
9972
|
+
"hidden": false,
|
|
9973
|
+
"usage": "[options] [unit]",
|
|
9974
|
+
"arguments": [
|
|
9975
|
+
{
|
|
9976
|
+
"name": "unit",
|
|
9977
|
+
"required": false,
|
|
9978
|
+
"variadic": false
|
|
9979
|
+
}
|
|
9980
|
+
],
|
|
9981
|
+
"options": [
|
|
9982
|
+
{
|
|
9983
|
+
"flags": "-f, --follow",
|
|
9984
|
+
"description": "Keep printing new lines"
|
|
9985
|
+
},
|
|
9986
|
+
{
|
|
9987
|
+
"flags": "-n, --lines <n>",
|
|
9988
|
+
"description": "How many lines to print first"
|
|
9989
|
+
}
|
|
9990
|
+
],
|
|
9991
|
+
"subcommands": []
|
|
9992
|
+
},
|
|
9993
|
+
{
|
|
9994
|
+
"name": "restart",
|
|
9995
|
+
"description": "Restart one service, or every running service",
|
|
9996
|
+
"aliases": [],
|
|
9997
|
+
"hidden": false,
|
|
9998
|
+
"usage": "[options] [unit]",
|
|
9999
|
+
"arguments": [
|
|
10000
|
+
{
|
|
10001
|
+
"name": "unit",
|
|
10002
|
+
"required": false,
|
|
10003
|
+
"variadic": false
|
|
10004
|
+
}
|
|
10005
|
+
],
|
|
10006
|
+
"options": [],
|
|
10007
|
+
"subcommands": []
|
|
10008
|
+
},
|
|
10009
|
+
{
|
|
10010
|
+
"name": "trigger",
|
|
10011
|
+
"description": "Run a scheduled service now (for example search-index)",
|
|
10012
|
+
"aliases": [],
|
|
10013
|
+
"hidden": false,
|
|
10014
|
+
"usage": "[options] <unit>",
|
|
10015
|
+
"arguments": [
|
|
10016
|
+
{
|
|
10017
|
+
"name": "unit",
|
|
10018
|
+
"required": true,
|
|
10019
|
+
"variadic": false
|
|
10020
|
+
}
|
|
10021
|
+
],
|
|
10022
|
+
"options": [],
|
|
10023
|
+
"subcommands": []
|
|
10024
|
+
},
|
|
10025
|
+
{
|
|
10026
|
+
"name": "enable",
|
|
10027
|
+
"description": "Turn services on for this machine, beyond its defaults",
|
|
10028
|
+
"aliases": [],
|
|
10029
|
+
"hidden": false,
|
|
10030
|
+
"usage": "[options] <services...>",
|
|
10031
|
+
"arguments": [
|
|
10032
|
+
{
|
|
10033
|
+
"name": "services",
|
|
10034
|
+
"required": true,
|
|
10035
|
+
"variadic": true
|
|
10036
|
+
}
|
|
10037
|
+
],
|
|
10038
|
+
"options": [],
|
|
10039
|
+
"subcommands": []
|
|
10040
|
+
},
|
|
10041
|
+
{
|
|
10042
|
+
"name": "disable",
|
|
10043
|
+
"description": "Turn default services off for this machine",
|
|
10044
|
+
"aliases": [],
|
|
10045
|
+
"hidden": false,
|
|
10046
|
+
"usage": "[options] <services...>",
|
|
10047
|
+
"arguments": [
|
|
10048
|
+
{
|
|
10049
|
+
"name": "services",
|
|
10050
|
+
"required": true,
|
|
10051
|
+
"variadic": true
|
|
10052
|
+
}
|
|
10053
|
+
],
|
|
10054
|
+
"options": [],
|
|
10055
|
+
"subcommands": []
|
|
10056
|
+
},
|
|
10057
|
+
{
|
|
10058
|
+
"name": "migrate",
|
|
10059
|
+
"description": "List the older HQ background units the daemon would take over; --apply takes them over",
|
|
10060
|
+
"aliases": [],
|
|
10061
|
+
"hidden": false,
|
|
10062
|
+
"usage": "[options]",
|
|
10063
|
+
"arguments": [],
|
|
10064
|
+
"options": [
|
|
10065
|
+
{
|
|
10066
|
+
"flags": "--apply",
|
|
10067
|
+
"description": "Stop the older units and let the daemon run their services"
|
|
10068
|
+
}
|
|
10069
|
+
],
|
|
10070
|
+
"subcommands": []
|
|
10071
|
+
},
|
|
10072
|
+
{
|
|
10073
|
+
"name": "service",
|
|
10074
|
+
"description": "Entry points the daemon runs for services that have no command of their own",
|
|
10075
|
+
"aliases": [],
|
|
10076
|
+
"hidden": true,
|
|
10077
|
+
"usage": "[options] [command]",
|
|
10078
|
+
"arguments": [],
|
|
10079
|
+
"options": [],
|
|
10080
|
+
"subcommands": [
|
|
10081
|
+
{
|
|
10082
|
+
"name": "self-update",
|
|
10083
|
+
"description": "Update the hq CLI (and Codex), then restart the daemon onto the new version",
|
|
10084
|
+
"aliases": [],
|
|
10085
|
+
"hidden": false,
|
|
10086
|
+
"usage": "[options]",
|
|
10087
|
+
"arguments": [],
|
|
10088
|
+
"options": [],
|
|
10089
|
+
"subcommands": []
|
|
10090
|
+
},
|
|
10091
|
+
{
|
|
10092
|
+
"name": "remote-control",
|
|
10093
|
+
"description": "Keep `claude remote-control` running in a tmux session in the HQ folder",
|
|
10094
|
+
"aliases": [],
|
|
10095
|
+
"hidden": false,
|
|
10096
|
+
"usage": "[options]",
|
|
10097
|
+
"arguments": [],
|
|
10098
|
+
"options": [
|
|
10099
|
+
{
|
|
10100
|
+
"flags": "--claude <path>",
|
|
10101
|
+
"description": "claude binary"
|
|
10102
|
+
},
|
|
10103
|
+
{
|
|
10104
|
+
"flags": "--name <name>",
|
|
10105
|
+
"description": "remote-control session name"
|
|
10106
|
+
},
|
|
10107
|
+
{
|
|
10108
|
+
"flags": "--permission-mode <mode>",
|
|
10109
|
+
"description": "claude --permission-mode"
|
|
10110
|
+
}
|
|
10111
|
+
],
|
|
10112
|
+
"subcommands": []
|
|
10113
|
+
}
|
|
10114
|
+
]
|
|
10115
|
+
}
|
|
10116
|
+
]
|
|
10117
|
+
},
|
|
9883
10118
|
{
|
|
9884
10119
|
"name": "bot",
|
|
9885
10120
|
"description": "Personal local bots that run on this computer with your own model login",
|
|
@@ -407,6 +407,13 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
407
407
|
readonly module: "./commands/lanes.js";
|
|
408
408
|
readonly exportName: "registerLanesCommand";
|
|
409
409
|
readonly hidden: true;
|
|
410
|
+
}, {
|
|
411
|
+
readonly type: "registrar";
|
|
412
|
+
readonly root: "daemon";
|
|
413
|
+
readonly parent: "program";
|
|
414
|
+
readonly module: "./commands/daemon.js";
|
|
415
|
+
readonly exportName: "registerDaemonCommand";
|
|
416
|
+
readonly hidden: true;
|
|
410
417
|
}, {
|
|
411
418
|
readonly type: "registrar";
|
|
412
419
|
readonly root: "bot";
|
|
@@ -70,6 +70,7 @@ export const REGISTRATION_PLAN = [
|
|
|
70
70
|
{ type: "registrar", root: "doctor", parent: "program", module: "./commands/doctor.js", exportName: "registerDoctorCommand" },
|
|
71
71
|
{ type: "registrar", root: "mesh", parent: "program", module: "./commands/mesh.js", exportName: "registerMeshCommand" },
|
|
72
72
|
{ type: "registrar", root: "lanes", parent: "program", module: "./commands/lanes.js", exportName: "registerLanesCommand", hidden: true },
|
|
73
|
+
{ type: "registrar", root: "daemon", parent: "program", module: "./commands/daemon.js", exportName: "registerDaemonCommand", hidden: true },
|
|
73
74
|
{ type: "registrar", root: "bot", parent: "program", module: "./commands/bot.js", exportName: "registerBotCommand" },
|
|
74
75
|
{ type: "registrar", root: "report", parent: "program", module: "./commands/report.js", exportName: "registerReportCommand" },
|
|
75
76
|
];
|
|
@@ -48,14 +48,19 @@ export declare function refusalMessage(existing: ExistingIdentity): string | nul
|
|
|
48
48
|
export declare class EnrollError extends Error {
|
|
49
49
|
readonly status?: number | undefined;
|
|
50
50
|
readonly code?: string | undefined;
|
|
51
|
-
|
|
51
|
+
readonly upgradeUrl?: string | undefined;
|
|
52
|
+
constructor(message: string, status?: number | undefined, code?: string | undefined, upgradeUrl?: string | undefined);
|
|
52
53
|
}
|
|
54
|
+
export declare function formatEnrollFailureMessage(error: EnrollError, options?: {
|
|
55
|
+
urlOnly?: boolean;
|
|
56
|
+
}): string;
|
|
53
57
|
/** Map a non-2xx enroll response to an actionable message (contract codes). */
|
|
54
58
|
export declare function mapEnrollFailure(status: number, body: {
|
|
55
59
|
code?: unknown;
|
|
56
60
|
error?: unknown;
|
|
57
61
|
message?: unknown;
|
|
58
62
|
attemptsRemaining?: unknown;
|
|
63
|
+
upgradeUrl?: unknown;
|
|
59
64
|
}, headers?: {
|
|
60
65
|
retryAfter?: string | null;
|
|
61
66
|
}): EnrollError;
|
|
@@ -21,6 +21,7 @@ import { CLI_VERSION } from "../cli-version.js";
|
|
|
21
21
|
import { DEFAULT_VAULT_API_URL, personTokenCacheFile, } from "../utils/cognito-session.js";
|
|
22
22
|
import { HQ_CLIENT_NAME } from "../utils/vault-api.js";
|
|
23
23
|
import { networkTransportErrorCode } from "../utils/network-transport-error.js";
|
|
24
|
+
import { canOfferTeamUpgrade, formatUpgradeRefusal, isPlanGateError, offerUpgradeLink, planGateErrorFromPayload, } from "../utils/plan-gate-error.js";
|
|
24
25
|
import { generateHostKeyPair, machineCredsFileExists, readExternalMachineCreds, writeHostKeyPair, writeMachineCreds, } from "../lib/agent-kit/creds.js";
|
|
25
26
|
import { DEFAULT_LOCAL_AGENT_NAME, agentKitPaths, localAgentDir, } from "../lib/agent-kit/paths.js";
|
|
26
27
|
export const ENROLL_PATH = "/v1/agents/enroll";
|
|
@@ -81,13 +82,18 @@ export function refusalMessage(existing) {
|
|
|
81
82
|
export class EnrollError extends Error {
|
|
82
83
|
status;
|
|
83
84
|
code;
|
|
84
|
-
|
|
85
|
+
upgradeUrl;
|
|
86
|
+
constructor(message, status, code, upgradeUrl) {
|
|
85
87
|
super(message);
|
|
86
88
|
this.status = status;
|
|
87
89
|
this.code = code;
|
|
90
|
+
this.upgradeUrl = upgradeUrl;
|
|
88
91
|
this.name = "EnrollError";
|
|
89
92
|
}
|
|
90
93
|
}
|
|
94
|
+
export function formatEnrollFailureMessage(error, options = {}) {
|
|
95
|
+
return formatUpgradeRefusal(error.message, error.upgradeUrl, options);
|
|
96
|
+
}
|
|
91
97
|
/** Map a non-2xx enroll response to an actionable message (contract codes). */
|
|
92
98
|
export function mapEnrollFailure(status, body, headers) {
|
|
93
99
|
const code = typeof body.code === "string" ? body.code : undefined;
|
|
@@ -119,7 +125,7 @@ export function mapEnrollFailure(status, body, headers) {
|
|
|
119
125
|
}
|
|
120
126
|
if (status === 402 || code === "billing_required") {
|
|
121
127
|
return new EnrollError(`External agents are available on paid HQ plans only. A company admin must ` +
|
|
122
|
-
`upgrade the plan (\`hq billing\` or the console billing page) before enrolling.${suffix}`, status, code);
|
|
128
|
+
`upgrade the plan (\`hq billing\` or the console billing page) before enrolling.${suffix}`, status, code, typeof body.upgradeUrl === "string" ? body.upgradeUrl : undefined);
|
|
123
129
|
}
|
|
124
130
|
if (status === 429 || code === "rate_limited") {
|
|
125
131
|
const retryAfter = headers?.retryAfter?.trim();
|
|
@@ -253,6 +259,9 @@ export async function enrollHost(opts, deps = {}) {
|
|
|
253
259
|
}
|
|
254
260
|
const body = (await res.json().catch(() => ({})));
|
|
255
261
|
if (!res.ok) {
|
|
262
|
+
const planGate = planGateErrorFromPayload(res.status, body);
|
|
263
|
+
if (planGate)
|
|
264
|
+
throw planGate;
|
|
256
265
|
throw mapEnrollFailure(res.status, body, { retryAfter: res.headers.get("retry-after") });
|
|
257
266
|
}
|
|
258
267
|
const parsed = parseEnrollResponse(body);
|
|
@@ -322,7 +331,25 @@ export function registerAgentEnrollCommand(agent) {
|
|
|
322
331
|
console.log(" hq agent probe # end-to-end check, reported to the console");
|
|
323
332
|
}
|
|
324
333
|
catch (err) {
|
|
325
|
-
|
|
334
|
+
if (isPlanGateError(err)) {
|
|
335
|
+
throw err;
|
|
336
|
+
}
|
|
337
|
+
else if (err instanceof EnrollError && err.upgradeUrl) {
|
|
338
|
+
const interactive = canOfferTeamUpgrade();
|
|
339
|
+
console.error(chalk.red(formatEnrollFailureMessage(err, { urlOnly: !interactive })));
|
|
340
|
+
if (interactive) {
|
|
341
|
+
try {
|
|
342
|
+
await offerUpgradeLink(err.upgradeUrl, { interactive: true });
|
|
343
|
+
}
|
|
344
|
+
catch (openErr) {
|
|
345
|
+
const message = openErr instanceof Error ? openErr.message : String(openErr);
|
|
346
|
+
console.error(chalk.dim(`Could not open the upgrade link automatically: ${message}`));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
console.error(chalk.red(err instanceof Error ? err.message : String(err)));
|
|
352
|
+
}
|
|
326
353
|
process.exit(1);
|
|
327
354
|
}
|
|
328
355
|
});
|
package/dist/commands/agents.js
CHANGED
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
* the caller's single active membership (same as `members.ts`).
|
|
28
28
|
*/
|
|
29
29
|
import chalk from "chalk";
|
|
30
|
-
import open from "open";
|
|
31
30
|
import { randomUUID } from "node:crypto";
|
|
32
31
|
import * as readline from "node:readline";
|
|
33
32
|
import { resolveVaultCredential } from "../utils/resolve-vault-credential.js";
|
|
@@ -37,7 +36,7 @@ import { vaultApiFetch, getCompanyUid } from "../utils/vault-api.js";
|
|
|
37
36
|
import { consoleOrigin } from "./integrations-connect.js";
|
|
38
37
|
import { launchSessionManagerPlugin, SessionManagerPluginLaunchError, TerminalSessionTimeoutError, waitForTerminalSession, } from "@indigoai-us/hq-cloud/outposts/node";
|
|
39
38
|
import { peekIdToken } from "../utils/id-token.js";
|
|
40
|
-
import { isPlanGateError } from "../utils/plan-gate-error.js";
|
|
39
|
+
import { canOfferTeamUpgrade, formatUpgradeRefusal, isPlanGateError, offerUpgradeLink, } from "../utils/plan-gate-error.js";
|
|
41
40
|
import { AGENT_UID_PATTERN, isAgentUid } from "../lib/notify-recipient.js";
|
|
42
41
|
import { confirmChargeOrExit, formatUsd, parseBillingPayload, surfaceBillingBlocked, } from "../utils/billing-gate.js";
|
|
43
42
|
/** Reasoning-effort values hq-pro accepts on `runtime-config`. */
|
|
@@ -120,40 +119,34 @@ function formatServerPrice(amountMinor, currency) {
|
|
|
120
119
|
currency,
|
|
121
120
|
}).format(amountMinor / 100);
|
|
122
121
|
}
|
|
123
|
-
function canOfferAgentCheckout(json) {
|
|
124
|
-
return json !== true &&
|
|
125
|
-
process.stdin.isTTY === true &&
|
|
126
|
-
process.stdout.isTTY === true &&
|
|
127
|
-
!process.env.CI;
|
|
128
|
-
}
|
|
129
122
|
async function offerAgentCheckout(url) {
|
|
130
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.
|
|
123
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
|
|
131
124
|
try {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
await offerUpgradeLink(url, {
|
|
126
|
+
interactive: true,
|
|
127
|
+
ask: (question) => new Promise((resolve) => rl.question(question, resolve)),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
console.error("Could not open the upgrade page automatically. Use the URL above.");
|
|
135
132
|
}
|
|
136
133
|
finally {
|
|
137
134
|
rl.close();
|
|
138
135
|
}
|
|
139
|
-
try {
|
|
140
|
-
await open(url);
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
console.error("Could not open the payment page automatically. Use the URL above.");
|
|
144
|
-
}
|
|
145
136
|
}
|
|
146
137
|
/** Print a server-priced plan block without minting or rewriting its URL. */
|
|
147
138
|
export async function surfaceAgentCreatePlanLimit(planLimit, opts = {}) {
|
|
148
139
|
const price = `${formatServerPrice(planLimit.amountMinor, planLimit.currency)}/month`;
|
|
149
|
-
|
|
140
|
+
const reason = `HQ Workforce plan required to create an agent (${price}).`;
|
|
141
|
+
const argv = opts.json ? [...process.argv, "--json"] : process.argv;
|
|
142
|
+
const interactive = canOfferTeamUpgrade(argv);
|
|
150
143
|
if (!planLimit.checkoutUrl) {
|
|
144
|
+
console.error(reason);
|
|
151
145
|
console.error("Ask a company owner to upgrade before creating an agent.");
|
|
152
146
|
return;
|
|
153
147
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (canOfferAgentCheckout(opts.json))
|
|
148
|
+
console.error(formatUpgradeRefusal(reason, planLimit.checkoutUrl, { urlOnly: !interactive }));
|
|
149
|
+
if (interactive)
|
|
157
150
|
await offerAgentCheckout(planLimit.checkoutUrl);
|
|
158
151
|
}
|
|
159
152
|
/**
|