@indigoai-us/hq-cli 5.323.0 → 5.325.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 +11 -1
- package/dist/bin/hq-auth-refresh.d.ts +5 -1
- package/dist/bin/hq-auth-refresh.js +33 -1
- package/dist/command-catalog.generated.d.ts +125 -6
- package/dist/command-catalog.generated.js +162 -6
- package/dist/command-registration-plan.d.ts +24 -0
- package/dist/command-registration-plan.js +4 -0
- package/dist/commands/anywhere-runtime-flag.d.ts +9 -0
- package/dist/commands/anywhere-runtime-flag.js +22 -0
- package/dist/commands/core-derive-trigger-facts-native.js +37 -3
- package/dist/commands/daemon.js +39 -2
- package/dist/commands/db-provision.js +6 -1
- package/dist/commands/doctor.js +8 -4
- package/dist/commands/feedback.d.ts +2 -0
- package/dist/commands/feedback.js +10 -0
- package/dist/commands/install-global.d.ts +46 -0
- package/dist/commands/install-global.js +674 -0
- package/dist/commands/link.d.ts +30 -0
- package/dist/commands/link.js +184 -0
- package/dist/commands/mcp-status.d.ts +6 -0
- package/dist/commands/mcp-status.js +21 -4
- package/dist/commands/pkg-install.js +20 -1
- package/dist/commands/update.d.ts +19 -0
- package/dist/commands/update.js +52 -6
- package/dist/fast-core.d.ts +2 -1
- package/dist/fast-core.js +12 -8
- package/dist/index.js +9 -7
- package/dist/lib/core-utils/timeout-guard-native-flags.d.ts +6 -0
- package/dist/lib/core-utils/timeout-guard-native-flags.js +30 -0
- package/dist/lib/core-utils/timeout-guard-native.d.ts +0 -3
- package/dist/lib/core-utils/timeout-guard-native.js +4 -30
- package/dist/lib/core-utils/timeout-guard.d.ts +2 -0
- package/dist/lib/core-utils/timeout-guard.js +2 -1
- package/dist/lib/daemon/convergence.d.ts +42 -0
- package/dist/lib/daemon/convergence.js +66 -0
- package/dist/lib/daemon/heartbeat.d.ts +43 -0
- package/dist/lib/daemon/heartbeat.js +70 -0
- package/dist/lib/daemon/ops/journal.d.ts +29 -0
- package/dist/lib/daemon/ops/journal.js +141 -0
- package/dist/lib/daemon/ops/memory.d.ts +20 -0
- package/dist/lib/daemon/ops/memory.js +65 -0
- package/dist/lib/daemon/ops/mesh.d.ts +38 -0
- package/dist/lib/daemon/ops/mesh.js +70 -0
- package/dist/lib/daemon/ops/policy.d.ts +78 -0
- package/dist/lib/daemon/ops/policy.js +283 -0
- package/dist/lib/daemon/protocol.d.ts +68 -0
- package/dist/lib/daemon/protocol.js +154 -0
- package/dist/lib/daemon/run.d.ts +10 -0
- package/dist/lib/daemon/run.js +85 -3
- package/dist/lib/daemon/server.d.ts +36 -0
- package/dist/lib/daemon/server.js +306 -0
- package/dist/lib/daemon/session-registry.d.ts +30 -0
- package/dist/lib/daemon/session-registry.js +42 -0
- package/dist/lib/doctor/checks/anywhere.d.ts +38 -0
- package/dist/lib/doctor/checks/anywhere.js +182 -0
- package/dist/lib/doctor/registry.js +6 -0
- package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
- package/dist/lib/flag-registry-worker-source.generated.js +1 -1
- package/dist/lib/install/claude-targets.d.ts +47 -0
- package/dist/lib/install/claude-targets.js +203 -0
- package/dist/lib/install/codex-targets.d.ts +57 -0
- package/dist/lib/install/codex-targets.js +187 -0
- package/dist/lib/mesh/live/session-seq.js +62 -9
- package/dist/lib/registry/normalize-remote.d.ts +21 -0
- package/dist/lib/registry/normalize-remote.js +68 -0
- package/dist/lib/registry/registry.d.ts +75 -0
- package/dist/lib/registry/registry.js +261 -0
- package/dist/utils/cognito-session.d.ts +5 -1
- package/dist/utils/cognito-session.js +8 -12
- package/dist/utils/feedback-diagnostics.d.ts +2 -0
- package/dist/utils/version-check.d.ts +2 -0
- package/dist/utils/version-check.js +7 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
-
## [5.
|
|
5
|
+
## [5.325.0] — 2026-10-02
|
|
6
|
+
- Match Bash pathname expansion in native derive-trigger-facts when a glob has missing suffixes, a trailing slash, or symlink path components.
|
|
7
|
+
|
|
8
|
+
## [5.324.0] — 2026-10-02
|
|
9
|
+
- Keep the bundled shell runner out of native fast-route startup and defer timeout-guard flag snapshot imports until a timeout would block.
|
|
10
|
+
- Reuse the parsed fast-route entry when dispatching the selected command.
|
|
6
11
|
- Add native `hq core derive-trigger-facts` on the fast route behind the default-off `core-native-hook-helpers` flag.
|
|
12
|
+
- Feedback reports can include the current cached hq-cli release when the default-off `feedback.latest-version` flag is enabled.
|
|
13
|
+
- Added flag-gated global Anywhere installation, company linking, and hqd daemon commands.
|
|
14
|
+
- Added flag-gated Anywhere daemon operations, doctor checks, and update convergence.
|
|
15
|
+
- `hq-auth-refresh` accepts `--min-validity-seconds` or `HQ_AUTH_MIN_VALIDITY_SECONDS`; values above 1800 seconds use the resolver's 1800-second cache margin.
|
|
16
|
+
- `hq db provision` now says remote databases are not available yet, instead of printing the server adapter error.
|
|
7
17
|
|
|
8
18
|
## [5.322.0] — 2026-10-02
|
|
9
19
|
- Add an opt-in, default-off CLI prompt for solo companies to invite a teammate after a work-bearing sync.
|
|
@@ -14,6 +14,10 @@ import "../node-preflight.js";
|
|
|
14
14
|
import { acquireCurrentPackageUseLease } from "../utils/package-use-lease.js";
|
|
15
15
|
import "../node-network-compat.js";
|
|
16
16
|
import type { refreshCachedSession } from "../utils/cognito-session.js";
|
|
17
|
-
|
|
17
|
+
type RefreshSession = (options?: {
|
|
18
|
+
minValiditySeconds?: number;
|
|
19
|
+
}) => ReturnType<typeof refreshCachedSession>;
|
|
20
|
+
export declare function runAuthRefresh(refreshSession?: RefreshSession): Promise<number>;
|
|
18
21
|
export declare function startAuthRefresh(acquireLease?: typeof acquireCurrentPackageUseLease): Promise<number>;
|
|
22
|
+
export {};
|
|
19
23
|
//# sourceMappingURL=hq-auth-refresh.d.ts.map
|
|
@@ -17,12 +17,44 @@ import { acquireCurrentPackageUseLease } from "../utils/package-use-lease.js";
|
|
|
17
17
|
import "../node-network-compat.js";
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
19
19
|
import path from "node:path";
|
|
20
|
+
const MIN_VALIDITY_FLAG = "--min-validity-seconds";
|
|
21
|
+
function parseMinimumValiditySeconds(argv, env) {
|
|
22
|
+
let raw;
|
|
23
|
+
let fromFlag = false;
|
|
24
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
25
|
+
const arg = argv[index];
|
|
26
|
+
if (arg === MIN_VALIDITY_FLAG) {
|
|
27
|
+
raw = argv[index + 1];
|
|
28
|
+
fromFlag = true;
|
|
29
|
+
if (!raw || raw.startsWith("--")) {
|
|
30
|
+
throw new Error(`${MIN_VALIDITY_FLAG} requires a non-negative integer`);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
if (arg.startsWith(`${MIN_VALIDITY_FLAG}=`)) {
|
|
35
|
+
raw = arg.slice(MIN_VALIDITY_FLAG.length + 1);
|
|
36
|
+
fromFlag = true;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (!fromFlag)
|
|
41
|
+
raw = env.HQ_AUTH_MIN_VALIDITY_SECONDS || undefined;
|
|
42
|
+
if (raw === undefined)
|
|
43
|
+
return undefined;
|
|
44
|
+
const value = /^\d+$/.test(raw) ? Number(raw) : Number.NaN;
|
|
45
|
+
if (!Number.isSafeInteger(value)) {
|
|
46
|
+
throw new Error("minimum token validity must be a non-negative integer");
|
|
47
|
+
}
|
|
48
|
+
// Values above the provider's cache margin are clamped by cognito-session.
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
20
51
|
export async function runAuthRefresh(refreshSession) {
|
|
21
52
|
const { finishSentrySession, Sentry } = await import("../sentry.js");
|
|
22
53
|
const { refreshCachedSession: refresh } = await import("../utils/cognito-session.js");
|
|
23
54
|
let exitCode = 1;
|
|
24
55
|
try {
|
|
25
|
-
const
|
|
56
|
+
const minValiditySeconds = parseMinimumValiditySeconds(process.argv.slice(2), process.env);
|
|
57
|
+
const result = await (refreshSession ?? refresh)(minValiditySeconds === undefined ? {} : { minValiditySeconds });
|
|
26
58
|
if (result.refreshed) {
|
|
27
59
|
exitCode = 0;
|
|
28
60
|
}
|
|
@@ -96,10 +96,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
96
96
|
readonly description: "Install a package. Sources: bare slug (registry, Cognito-gated), @scope/name[@ver] (npm pack), git URL[#ref], or local path.";
|
|
97
97
|
readonly aliases: readonly [];
|
|
98
98
|
readonly hidden: false;
|
|
99
|
-
readonly usage: "[options]
|
|
99
|
+
readonly usage: "[options] [source]";
|
|
100
100
|
readonly arguments: readonly [{
|
|
101
101
|
readonly name: "source";
|
|
102
|
-
readonly required:
|
|
102
|
+
readonly required: false;
|
|
103
103
|
readonly variadic: false;
|
|
104
104
|
}];
|
|
105
105
|
readonly options: readonly [{
|
|
@@ -114,6 +114,18 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
114
114
|
}, {
|
|
115
115
|
readonly flags: "--branch";
|
|
116
116
|
readonly description: "Follow a ref instead of SHA-pinning (git content-pack flow)";
|
|
117
|
+
}, {
|
|
118
|
+
readonly flags: "--global";
|
|
119
|
+
readonly description: "Install HQ into an agent runtime at user scope (requires the hq-anywhere-runtime flag)";
|
|
120
|
+
}, {
|
|
121
|
+
readonly flags: "--runtime <runtime>";
|
|
122
|
+
readonly description: "Runtime for --global (claude | codex)";
|
|
123
|
+
}, {
|
|
124
|
+
readonly flags: "--dry-run";
|
|
125
|
+
readonly description: "With --global: print every file and config diff without writing";
|
|
126
|
+
}, {
|
|
127
|
+
readonly flags: "--hq-root <dir>";
|
|
128
|
+
readonly description: "With --global: HQ checkout to install from (default: walk up from cwd)";
|
|
117
129
|
}];
|
|
118
130
|
readonly subcommands: readonly [];
|
|
119
131
|
}, {
|
|
@@ -368,10 +380,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
368
380
|
readonly description: "Install a package. Sources: bare slug (registry, Cognito-gated), @scope/name[@ver] (npm pack), git URL[#ref], or local path.";
|
|
369
381
|
readonly aliases: readonly [];
|
|
370
382
|
readonly hidden: false;
|
|
371
|
-
readonly usage: "[options]
|
|
383
|
+
readonly usage: "[options] [source]";
|
|
372
384
|
readonly arguments: readonly [{
|
|
373
385
|
readonly name: "source";
|
|
374
|
-
readonly required:
|
|
386
|
+
readonly required: false;
|
|
375
387
|
readonly variadic: false;
|
|
376
388
|
}];
|
|
377
389
|
readonly options: readonly [{
|
|
@@ -386,6 +398,18 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
386
398
|
}, {
|
|
387
399
|
readonly flags: "--branch";
|
|
388
400
|
readonly description: "Follow a ref instead of SHA-pinning (git content-pack flow)";
|
|
401
|
+
}, {
|
|
402
|
+
readonly flags: "--global";
|
|
403
|
+
readonly description: "Install HQ into an agent runtime at user scope (requires the hq-anywhere-runtime flag)";
|
|
404
|
+
}, {
|
|
405
|
+
readonly flags: "--runtime <runtime>";
|
|
406
|
+
readonly description: "Runtime for --global (claude | codex)";
|
|
407
|
+
}, {
|
|
408
|
+
readonly flags: "--dry-run";
|
|
409
|
+
readonly description: "With --global: print every file and config diff without writing";
|
|
410
|
+
}, {
|
|
411
|
+
readonly flags: "--hq-root <dir>";
|
|
412
|
+
readonly description: "With --global: HQ checkout to install from (default: walk up from cwd)";
|
|
389
413
|
}];
|
|
390
414
|
readonly subcommands: readonly [];
|
|
391
415
|
}, {
|
|
@@ -839,6 +863,79 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
839
863
|
readonly description: "Also report this company's workspace plan state (Starter nag)";
|
|
840
864
|
}];
|
|
841
865
|
readonly subcommands: readonly [];
|
|
866
|
+
}, {
|
|
867
|
+
readonly name: "link";
|
|
868
|
+
readonly description: "Link this folder (or its git remote) to an HQ company";
|
|
869
|
+
readonly aliases: readonly [];
|
|
870
|
+
readonly hidden: false;
|
|
871
|
+
readonly usage: "[options] [company]";
|
|
872
|
+
readonly arguments: readonly [{
|
|
873
|
+
readonly name: "company";
|
|
874
|
+
readonly required: false;
|
|
875
|
+
readonly variadic: false;
|
|
876
|
+
}];
|
|
877
|
+
readonly options: readonly [{
|
|
878
|
+
readonly flags: "--path <dir>";
|
|
879
|
+
readonly description: "Folder to link (default: current directory)";
|
|
880
|
+
}, {
|
|
881
|
+
readonly flags: "--list";
|
|
882
|
+
readonly description: "Print every linked folder";
|
|
883
|
+
}, {
|
|
884
|
+
readonly flags: "--json";
|
|
885
|
+
readonly description: "Print JSON output";
|
|
886
|
+
}, {
|
|
887
|
+
readonly flags: "--seed-manifest <hqRoot>";
|
|
888
|
+
readonly description: "Seed entries from an HQ companies/manifest.yaml";
|
|
889
|
+
}];
|
|
890
|
+
readonly subcommands: readonly [];
|
|
891
|
+
}, {
|
|
892
|
+
readonly name: "unlink";
|
|
893
|
+
readonly description: "Remove the HQ company link for this folder";
|
|
894
|
+
readonly aliases: readonly [];
|
|
895
|
+
readonly hidden: false;
|
|
896
|
+
readonly usage: "[options]";
|
|
897
|
+
readonly arguments: readonly [];
|
|
898
|
+
readonly options: readonly [{
|
|
899
|
+
readonly flags: "--path <dir>";
|
|
900
|
+
readonly description: "Folder to unlink (default: current directory)";
|
|
901
|
+
}];
|
|
902
|
+
readonly subcommands: readonly [];
|
|
903
|
+
}, {
|
|
904
|
+
readonly name: "uninstall";
|
|
905
|
+
readonly description: "Remove the HQ global install from an agent runtime (use with --global)";
|
|
906
|
+
readonly aliases: readonly [];
|
|
907
|
+
readonly hidden: false;
|
|
908
|
+
readonly usage: "[options]";
|
|
909
|
+
readonly arguments: readonly [];
|
|
910
|
+
readonly options: readonly [{
|
|
911
|
+
readonly flags: "--global";
|
|
912
|
+
readonly description: "Reverse `hq install --global`";
|
|
913
|
+
}, {
|
|
914
|
+
readonly flags: "--runtime <runtime>";
|
|
915
|
+
readonly description: "Runtime to uninstall from (claude | codex)";
|
|
916
|
+
}, {
|
|
917
|
+
readonly flags: "--dry-run";
|
|
918
|
+
readonly description: "Print what would change without writing";
|
|
919
|
+
}, {
|
|
920
|
+
readonly flags: "--hq-root <dir>";
|
|
921
|
+
readonly description: "HQ checkout (only needed when install state is missing)";
|
|
922
|
+
}];
|
|
923
|
+
readonly subcommands: readonly [];
|
|
924
|
+
}, {
|
|
925
|
+
readonly name: "resolve-company";
|
|
926
|
+
readonly description: "Print the HQ company linked to this folder (never guesses)";
|
|
927
|
+
readonly aliases: readonly [];
|
|
928
|
+
readonly hidden: false;
|
|
929
|
+
readonly usage: "[options]";
|
|
930
|
+
readonly arguments: readonly [];
|
|
931
|
+
readonly options: readonly [{
|
|
932
|
+
readonly flags: "--path <dir>";
|
|
933
|
+
readonly description: "Folder to resolve (default: current directory)";
|
|
934
|
+
}, {
|
|
935
|
+
readonly flags: "--json";
|
|
936
|
+
readonly description: "Print JSON output";
|
|
937
|
+
}];
|
|
938
|
+
readonly subcommands: readonly [];
|
|
842
939
|
}, {
|
|
843
940
|
readonly name: "version";
|
|
844
941
|
readonly description: "Show HQ, CLI, and latest hq-core versions";
|
|
@@ -9828,6 +9925,25 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
9828
9925
|
readonly description: "Run as a child of this app (only \"desktop\"), which has handed sync over to the daemon";
|
|
9829
9926
|
}];
|
|
9830
9927
|
readonly subcommands: readonly [];
|
|
9928
|
+
}, {
|
|
9929
|
+
readonly name: "call";
|
|
9930
|
+
readonly description: "Send one request to hqd (policy.check, journal.append, memory.get, memory.put, mesh.presence, …) and print the result as JSON";
|
|
9931
|
+
readonly aliases: readonly [];
|
|
9932
|
+
readonly hidden: false;
|
|
9933
|
+
readonly usage: "[options] <op>";
|
|
9934
|
+
readonly arguments: readonly [{
|
|
9935
|
+
readonly name: "op";
|
|
9936
|
+
readonly required: true;
|
|
9937
|
+
readonly variadic: false;
|
|
9938
|
+
}];
|
|
9939
|
+
readonly options: readonly [{
|
|
9940
|
+
readonly flags: "--json <args>";
|
|
9941
|
+
readonly description: "Request args as a JSON object";
|
|
9942
|
+
}, {
|
|
9943
|
+
readonly flags: "--timeout <ms>";
|
|
9944
|
+
readonly description: "Give up after this many milliseconds";
|
|
9945
|
+
}];
|
|
9946
|
+
readonly subcommands: readonly [];
|
|
9831
9947
|
}, {
|
|
9832
9948
|
readonly name: "status";
|
|
9833
9949
|
readonly description: "Show the machine type and each service's state";
|
|
@@ -10000,7 +10116,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
10000
10116
|
readonly subcommands: readonly [];
|
|
10001
10117
|
}, {
|
|
10002
10118
|
readonly name: "restart";
|
|
10003
|
-
readonly description: "Restart one service, or
|
|
10119
|
+
readonly description: "Restart one service, every service, or the daemon process";
|
|
10004
10120
|
readonly aliases: readonly [];
|
|
10005
10121
|
readonly hidden: false;
|
|
10006
10122
|
readonly usage: "[options] [unit]";
|
|
@@ -10009,7 +10125,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
10009
10125
|
readonly required: false;
|
|
10010
10126
|
readonly variadic: false;
|
|
10011
10127
|
}];
|
|
10012
|
-
readonly options: readonly [
|
|
10128
|
+
readonly options: readonly [{
|
|
10129
|
+
readonly flags: "--daemon";
|
|
10130
|
+
readonly description: "Restart the supervisor process itself";
|
|
10131
|
+
}];
|
|
10013
10132
|
readonly subcommands: readonly [];
|
|
10014
10133
|
}, {
|
|
10015
10134
|
readonly name: "trigger";
|
|
@@ -101,11 +101,11 @@ export const COMMAND_CATALOG = [
|
|
|
101
101
|
"description": "Install a package. Sources: bare slug (registry, Cognito-gated), @scope/name[@ver] (npm pack), git URL[#ref], or local path.",
|
|
102
102
|
"aliases": [],
|
|
103
103
|
"hidden": false,
|
|
104
|
-
"usage": "[options]
|
|
104
|
+
"usage": "[options] [source]",
|
|
105
105
|
"arguments": [
|
|
106
106
|
{
|
|
107
107
|
"name": "source",
|
|
108
|
-
"required":
|
|
108
|
+
"required": false,
|
|
109
109
|
"variadic": false
|
|
110
110
|
}
|
|
111
111
|
],
|
|
@@ -125,6 +125,22 @@ export const COMMAND_CATALOG = [
|
|
|
125
125
|
{
|
|
126
126
|
"flags": "--branch",
|
|
127
127
|
"description": "Follow a ref instead of SHA-pinning (git content-pack flow)"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"flags": "--global",
|
|
131
|
+
"description": "Install HQ into an agent runtime at user scope (requires the hq-anywhere-runtime flag)"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"flags": "--runtime <runtime>",
|
|
135
|
+
"description": "Runtime for --global (claude | codex)"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"flags": "--dry-run",
|
|
139
|
+
"description": "With --global: print every file and config diff without writing"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"flags": "--hq-root <dir>",
|
|
143
|
+
"description": "With --global: HQ checkout to install from (default: walk up from cwd)"
|
|
128
144
|
}
|
|
129
145
|
],
|
|
130
146
|
"subcommands": []
|
|
@@ -465,11 +481,11 @@ export const COMMAND_CATALOG = [
|
|
|
465
481
|
"description": "Install a package. Sources: bare slug (registry, Cognito-gated), @scope/name[@ver] (npm pack), git URL[#ref], or local path.",
|
|
466
482
|
"aliases": [],
|
|
467
483
|
"hidden": false,
|
|
468
|
-
"usage": "[options]
|
|
484
|
+
"usage": "[options] [source]",
|
|
469
485
|
"arguments": [
|
|
470
486
|
{
|
|
471
487
|
"name": "source",
|
|
472
|
-
"required":
|
|
488
|
+
"required": false,
|
|
473
489
|
"variadic": false
|
|
474
490
|
}
|
|
475
491
|
],
|
|
@@ -489,6 +505,22 @@ export const COMMAND_CATALOG = [
|
|
|
489
505
|
{
|
|
490
506
|
"flags": "--branch",
|
|
491
507
|
"description": "Follow a ref instead of SHA-pinning (git content-pack flow)"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"flags": "--global",
|
|
511
|
+
"description": "Install HQ into an agent runtime at user scope (requires the hq-anywhere-runtime flag)"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"flags": "--runtime <runtime>",
|
|
515
|
+
"description": "Runtime for --global (claude | codex)"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"flags": "--dry-run",
|
|
519
|
+
"description": "With --global: print every file and config diff without writing"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"flags": "--hq-root <dir>",
|
|
523
|
+
"description": "With --global: HQ checkout to install from (default: walk up from cwd)"
|
|
492
524
|
}
|
|
493
525
|
],
|
|
494
526
|
"subcommands": []
|
|
@@ -1073,6 +1105,100 @@ export const COMMAND_CATALOG = [
|
|
|
1073
1105
|
],
|
|
1074
1106
|
"subcommands": []
|
|
1075
1107
|
},
|
|
1108
|
+
{
|
|
1109
|
+
"name": "link",
|
|
1110
|
+
"description": "Link this folder (or its git remote) to an HQ company",
|
|
1111
|
+
"aliases": [],
|
|
1112
|
+
"hidden": false,
|
|
1113
|
+
"usage": "[options] [company]",
|
|
1114
|
+
"arguments": [
|
|
1115
|
+
{
|
|
1116
|
+
"name": "company",
|
|
1117
|
+
"required": false,
|
|
1118
|
+
"variadic": false
|
|
1119
|
+
}
|
|
1120
|
+
],
|
|
1121
|
+
"options": [
|
|
1122
|
+
{
|
|
1123
|
+
"flags": "--path <dir>",
|
|
1124
|
+
"description": "Folder to link (default: current directory)"
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
"flags": "--list",
|
|
1128
|
+
"description": "Print every linked folder"
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"flags": "--json",
|
|
1132
|
+
"description": "Print JSON output"
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
"flags": "--seed-manifest <hqRoot>",
|
|
1136
|
+
"description": "Seed entries from an HQ companies/manifest.yaml"
|
|
1137
|
+
}
|
|
1138
|
+
],
|
|
1139
|
+
"subcommands": []
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
"name": "unlink",
|
|
1143
|
+
"description": "Remove the HQ company link for this folder",
|
|
1144
|
+
"aliases": [],
|
|
1145
|
+
"hidden": false,
|
|
1146
|
+
"usage": "[options]",
|
|
1147
|
+
"arguments": [],
|
|
1148
|
+
"options": [
|
|
1149
|
+
{
|
|
1150
|
+
"flags": "--path <dir>",
|
|
1151
|
+
"description": "Folder to unlink (default: current directory)"
|
|
1152
|
+
}
|
|
1153
|
+
],
|
|
1154
|
+
"subcommands": []
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"name": "uninstall",
|
|
1158
|
+
"description": "Remove the HQ global install from an agent runtime (use with --global)",
|
|
1159
|
+
"aliases": [],
|
|
1160
|
+
"hidden": false,
|
|
1161
|
+
"usage": "[options]",
|
|
1162
|
+
"arguments": [],
|
|
1163
|
+
"options": [
|
|
1164
|
+
{
|
|
1165
|
+
"flags": "--global",
|
|
1166
|
+
"description": "Reverse `hq install --global`"
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
"flags": "--runtime <runtime>",
|
|
1170
|
+
"description": "Runtime to uninstall from (claude | codex)"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
"flags": "--dry-run",
|
|
1174
|
+
"description": "Print what would change without writing"
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
"flags": "--hq-root <dir>",
|
|
1178
|
+
"description": "HQ checkout (only needed when install state is missing)"
|
|
1179
|
+
}
|
|
1180
|
+
],
|
|
1181
|
+
"subcommands": []
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"name": "resolve-company",
|
|
1185
|
+
"description": "Print the HQ company linked to this folder (never guesses)",
|
|
1186
|
+
"aliases": [],
|
|
1187
|
+
"hidden": false,
|
|
1188
|
+
"usage": "[options]",
|
|
1189
|
+
"arguments": [],
|
|
1190
|
+
"options": [
|
|
1191
|
+
{
|
|
1192
|
+
"flags": "--path <dir>",
|
|
1193
|
+
"description": "Folder to resolve (default: current directory)"
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
"flags": "--json",
|
|
1197
|
+
"description": "Print JSON output"
|
|
1198
|
+
}
|
|
1199
|
+
],
|
|
1200
|
+
"subcommands": []
|
|
1201
|
+
},
|
|
1076
1202
|
{
|
|
1077
1203
|
"name": "version",
|
|
1078
1204
|
"description": "Show HQ, CLI, and latest hq-core versions",
|
|
@@ -12661,6 +12787,31 @@ export const COMMAND_CATALOG = [
|
|
|
12661
12787
|
],
|
|
12662
12788
|
"subcommands": []
|
|
12663
12789
|
},
|
|
12790
|
+
{
|
|
12791
|
+
"name": "call",
|
|
12792
|
+
"description": "Send one request to hqd (policy.check, journal.append, memory.get, memory.put, mesh.presence, …) and print the result as JSON",
|
|
12793
|
+
"aliases": [],
|
|
12794
|
+
"hidden": false,
|
|
12795
|
+
"usage": "[options] <op>",
|
|
12796
|
+
"arguments": [
|
|
12797
|
+
{
|
|
12798
|
+
"name": "op",
|
|
12799
|
+
"required": true,
|
|
12800
|
+
"variadic": false
|
|
12801
|
+
}
|
|
12802
|
+
],
|
|
12803
|
+
"options": [
|
|
12804
|
+
{
|
|
12805
|
+
"flags": "--json <args>",
|
|
12806
|
+
"description": "Request args as a JSON object"
|
|
12807
|
+
},
|
|
12808
|
+
{
|
|
12809
|
+
"flags": "--timeout <ms>",
|
|
12810
|
+
"description": "Give up after this many milliseconds"
|
|
12811
|
+
}
|
|
12812
|
+
],
|
|
12813
|
+
"subcommands": []
|
|
12814
|
+
},
|
|
12664
12815
|
{
|
|
12665
12816
|
"name": "status",
|
|
12666
12817
|
"description": "Show the machine type and each service's state",
|
|
@@ -12879,7 +13030,7 @@ export const COMMAND_CATALOG = [
|
|
|
12879
13030
|
},
|
|
12880
13031
|
{
|
|
12881
13032
|
"name": "restart",
|
|
12882
|
-
"description": "Restart one service, or
|
|
13033
|
+
"description": "Restart one service, every service, or the daemon process",
|
|
12883
13034
|
"aliases": [],
|
|
12884
13035
|
"hidden": false,
|
|
12885
13036
|
"usage": "[options] [unit]",
|
|
@@ -12890,7 +13041,12 @@ export const COMMAND_CATALOG = [
|
|
|
12890
13041
|
"variadic": false
|
|
12891
13042
|
}
|
|
12892
13043
|
],
|
|
12893
|
-
"options": [
|
|
13044
|
+
"options": [
|
|
13045
|
+
{
|
|
13046
|
+
"flags": "--daemon",
|
|
13047
|
+
"description": "Restart the supervisor process itself"
|
|
13048
|
+
}
|
|
13049
|
+
],
|
|
12894
13050
|
"subcommands": []
|
|
12895
13051
|
},
|
|
12896
13052
|
{
|
|
@@ -177,6 +177,30 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
177
177
|
readonly parent: "program";
|
|
178
178
|
readonly module: "./commands/whoami.js";
|
|
179
179
|
readonly exportName: "registerWhoamiCommand";
|
|
180
|
+
}, {
|
|
181
|
+
readonly type: "registrar";
|
|
182
|
+
readonly root: "link";
|
|
183
|
+
readonly parent: "program";
|
|
184
|
+
readonly module: "./commands/link.js";
|
|
185
|
+
readonly exportName: "registerLinkCommand";
|
|
186
|
+
}, {
|
|
187
|
+
readonly type: "registrar";
|
|
188
|
+
readonly root: "unlink";
|
|
189
|
+
readonly parent: "program";
|
|
190
|
+
readonly module: "./commands/link.js";
|
|
191
|
+
readonly exportName: "registerUnlinkCommand";
|
|
192
|
+
}, {
|
|
193
|
+
readonly type: "registrar";
|
|
194
|
+
readonly root: "uninstall";
|
|
195
|
+
readonly parent: "program";
|
|
196
|
+
readonly module: "./commands/install-global.js";
|
|
197
|
+
readonly exportName: "registerUninstallCommand";
|
|
198
|
+
}, {
|
|
199
|
+
readonly type: "registrar";
|
|
200
|
+
readonly root: "resolve-company";
|
|
201
|
+
readonly parent: "program";
|
|
202
|
+
readonly module: "./commands/link.js";
|
|
203
|
+
readonly exportName: "registerResolveCompanyCommand";
|
|
180
204
|
}, {
|
|
181
205
|
readonly type: "registrar";
|
|
182
206
|
readonly root: "version";
|
|
@@ -32,6 +32,10 @@ export const REGISTRATION_PLAN = [
|
|
|
32
32
|
{ type: "registrar", root: "login", parent: "program", module: "./commands/login.js", exportName: "registerLoginCommand" },
|
|
33
33
|
{ type: "registrar", root: "logout", parent: "program", module: "./commands/logout.js", exportName: "registerLogoutCommand" },
|
|
34
34
|
{ type: "registrar", root: "whoami", parent: "program", module: "./commands/whoami.js", exportName: "registerWhoamiCommand" },
|
|
35
|
+
{ type: "registrar", root: "link", parent: "program", module: "./commands/link.js", exportName: "registerLinkCommand" },
|
|
36
|
+
{ type: "registrar", root: "unlink", parent: "program", module: "./commands/link.js", exportName: "registerUnlinkCommand" },
|
|
37
|
+
{ type: "registrar", root: "uninstall", parent: "program", module: "./commands/install-global.js", exportName: "registerUninstallCommand" },
|
|
38
|
+
{ type: "registrar", root: "resolve-company", parent: "program", module: "./commands/link.js", exportName: "registerResolveCompanyCommand" },
|
|
35
39
|
{ type: "registrar", root: "version", parent: "program", module: "./commands/version.js", exportName: "registerVersionCommand" },
|
|
36
40
|
{ type: "registrar", root: "auth", parent: "program", module: "./commands/auth.js", exportName: "registerAuthCommands" },
|
|
37
41
|
{ type: "registrar", root: "secrets", parent: "program", module: "./commands/secrets.js", exportName: "registerSecretsCommand" },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** hq-flags key for the staged HQ Anywhere runtime. The registry default is off. */
|
|
2
|
+
export declare const HQ_ANYWHERE_RUNTIME_FLAG = "hq-anywhere-runtime";
|
|
3
|
+
export declare class AnywhereRuntimeDisabledError extends Error {
|
|
4
|
+
readonly expected: true;
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare function anywhereRuntimeEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
8
|
+
export declare function requireAnywhereRuntime(): void;
|
|
9
|
+
//# sourceMappingURL=anywhere-runtime-flag.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { resolveFlagGate, resolveProcessFlagGate } from "../lib/flag-registry.js";
|
|
2
|
+
/** hq-flags key for the staged HQ Anywhere runtime. The registry default is off. */
|
|
3
|
+
export const HQ_ANYWHERE_RUNTIME_FLAG = "hq-anywhere-runtime";
|
|
4
|
+
export class AnywhereRuntimeDisabledError extends Error {
|
|
5
|
+
expected = true;
|
|
6
|
+
constructor() {
|
|
7
|
+
super("HQ Anywhere is not enabled. Enable the hq-anywhere-runtime flag to use this command.");
|
|
8
|
+
this.name = "AnywhereRuntimeDisabledError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function anywhereRuntimeEnabled(env = process.env) {
|
|
12
|
+
const fallback = () => false;
|
|
13
|
+
const lookup = { fallback: false };
|
|
14
|
+
return env === process.env
|
|
15
|
+
? resolveProcessFlagGate(HQ_ANYWHERE_RUNTIME_FLAG, lookup, fallback)
|
|
16
|
+
: resolveFlagGate(undefined, HQ_ANYWHERE_RUNTIME_FLAG, lookup, fallback, env);
|
|
17
|
+
}
|
|
18
|
+
export function requireAnywhereRuntime() {
|
|
19
|
+
if (!anywhereRuntimeEnabled())
|
|
20
|
+
throw new AnywhereRuntimeDisabledError();
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=anywhere-runtime-flag.js.map
|
|
@@ -62,22 +62,50 @@ function globSegmentMatches(pattern, value) {
|
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
function filesystemPath(candidate, cwd) {
|
|
66
|
+
const value = candidate || ".";
|
|
67
|
+
return path.isAbsolute(value) ? value : `${cwd}${path.sep}${value}`;
|
|
68
|
+
}
|
|
69
|
+
function isDirectoryPath(candidate, cwd) {
|
|
70
|
+
try {
|
|
71
|
+
return fs.statSync(filesystemPath(candidate, cwd)).isDirectory();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function pathEntryExists(candidate, cwd) {
|
|
78
|
+
try {
|
|
79
|
+
fs.lstatSync(filesystemPath(candidate, cwd));
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
65
86
|
function expandBashGlob(token, cwd) {
|
|
66
87
|
if (!hasGlobPattern(token))
|
|
67
88
|
return [token];
|
|
68
89
|
const absolute = token.startsWith(path.sep);
|
|
90
|
+
const trailingSlash = token.endsWith(path.sep);
|
|
69
91
|
const parts = token.split(path.sep).filter((part, index) => !(absolute && index === 0));
|
|
92
|
+
if (trailingSlash)
|
|
93
|
+
parts.pop();
|
|
70
94
|
let candidates = [absolute ? path.sep : ""];
|
|
71
95
|
let matchedPattern = false;
|
|
72
|
-
for (const part of parts) {
|
|
96
|
+
for (const [index, part] of parts.entries()) {
|
|
73
97
|
if (!hasGlobPattern(part)) {
|
|
74
98
|
candidates = candidates.map((parent) => !parent ? part : parent === path.sep ? `${path.sep}${part}` : `${parent}${path.sep}${part}`);
|
|
99
|
+
if (matchedPattern) {
|
|
100
|
+
const needsDirectory = index < parts.length - 1 || trailingSlash;
|
|
101
|
+
candidates = candidates.filter((candidate) => needsDirectory ? isDirectoryPath(candidate, cwd) : pathEntryExists(candidate, cwd));
|
|
102
|
+
}
|
|
75
103
|
continue;
|
|
76
104
|
}
|
|
77
105
|
matchedPattern = true;
|
|
78
106
|
const expanded = [];
|
|
79
107
|
for (const parent of candidates) {
|
|
80
|
-
const directory =
|
|
108
|
+
const directory = filesystemPath(parent || ".", cwd);
|
|
81
109
|
let names;
|
|
82
110
|
try {
|
|
83
111
|
names = fs.readdirSync(directory).sort();
|
|
@@ -97,7 +125,13 @@ function expandBashGlob(token, cwd) {
|
|
|
97
125
|
return [token];
|
|
98
126
|
candidates = expanded;
|
|
99
127
|
}
|
|
100
|
-
|
|
128
|
+
if (trailingSlash) {
|
|
129
|
+
candidates = candidates
|
|
130
|
+
.filter((candidate) => isDirectoryPath(candidate, cwd))
|
|
131
|
+
.map((candidate) => candidate.endsWith(path.sep) ? candidate : `${candidate}${path.sep}`)
|
|
132
|
+
.sort();
|
|
133
|
+
}
|
|
134
|
+
return matchedPattern && candidates.length > 0 ? candidates : [token];
|
|
101
135
|
}
|
|
102
136
|
function bashUnquotedWords(facts, cwd) {
|
|
103
137
|
return facts.join(" ").split(/[\t\n ]+/).filter(Boolean).flatMap((word) => expandBashGlob(word, cwd));
|