@indigoai-us/hq-cli 5.345.225 → 5.345.228
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 +174 -0
- package/dist/command-catalog.generated.d.ts +215 -0
- package/dist/command-catalog.generated.js +261 -0
- package/dist/commands/auth.d.ts +2 -2
- package/dist/commands/auth.js +3 -3
- package/dist/commands/core-delegate-w1b.js +92 -69
- package/dist/commands/core-delegate.d.ts +19 -1
- package/dist/commands/core-delegate.js +411 -6
- package/dist/commands/core-dm-bind-native.js +2 -1
- package/dist/commands/core-handoff.d.ts +5 -0
- package/dist/commands/core-handoff.js +1008 -14
- package/dist/commands/core-pin-native.d.ts +1 -0
- package/dist/commands/core-pin-native.js +3 -15
- package/dist/commands/core-register-project-native.d.ts +6 -0
- package/dist/commands/core-register-project-native.js +182 -52
- package/dist/commands/core-work-mesh-bind-trusted-native.js +4 -9
- package/dist/commands/daemon.js +3 -3
- package/dist/commands/deploy-domains.js +38 -2
- package/dist/commands/index-cmd.d.ts +3 -1
- package/dist/commands/index-cmd.js +12 -0
- package/dist/commands/lanes-accounts.d.ts +14 -0
- package/dist/commands/lanes-accounts.js +119 -0
- package/dist/commands/lanes-checks.js +1 -1
- package/dist/commands/lanes-move.js +10 -0
- package/dist/commands/lanes-session-start.d.ts +1 -2
- package/dist/commands/lanes-session-start.js +9 -145
- package/dist/commands/lanes-shared.d.ts +3 -0
- package/dist/commands/lanes-shared.js +9 -0
- package/dist/commands/lanes.d.ts +3 -0
- package/dist/commands/lanes.js +231 -39
- package/dist/commands/link.d.ts +8 -3
- package/dist/commands/link.js +14 -17
- package/dist/commands/mcp-registration.d.ts +65 -7
- package/dist/commands/mcp-registration.js +289 -51
- package/dist/commands/mesh.d.ts +12 -0
- package/dist/commands/mesh.js +92 -10
- package/dist/commands/reindex.js +6 -0
- package/dist/commands/repo.d.ts +13 -0
- package/dist/commands/repo.js +39 -1
- package/dist/commands/sync-held.d.ts +22 -0
- package/dist/commands/sync-held.js +167 -18
- package/dist/commands/sync-mode.d.ts +3 -1
- package/dist/commands/sync-mode.js +11 -1
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +4845 -2524
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/lazy-commands.js +3 -4
- package/dist/lib/capacity/accounts.d.ts +4 -0
- package/dist/lib/capacity/accounts.js +4 -0
- package/dist/lib/capacity/route.js +14 -0
- package/dist/lib/capacity/sign-in.d.ts +18 -0
- package/dist/lib/capacity/sign-in.js +34 -1
- package/dist/lib/checkpoint-ontology/entity-file.js +4 -4
- package/dist/lib/checkpoint-ontology/merge-copies.js +7 -11
- package/dist/lib/checkpoint-ontology/plan.js +2 -1
- package/dist/lib/core-utils/archive-old-threads.js +5 -2
- package/dist/lib/core-utils/session-company.d.ts +13 -1
- package/dist/lib/core-utils/session-company.js +75 -4
- package/dist/lib/core-utils/worktree-resume.d.ts +6 -0
- package/dist/lib/core-utils/worktree-resume.js +8 -4
- package/dist/lib/daemon/background-qos.d.ts +7 -0
- package/dist/lib/daemon/background-qos.js +13 -0
- package/dist/lib/daemon/catalog.d.ts +10 -0
- package/dist/lib/daemon/catalog.js +9 -2
- package/dist/lib/daemon/hook-requests-acl-suggest.d.ts +18 -0
- package/dist/lib/daemon/hook-requests-acl-suggest.js +245 -0
- package/dist/lib/daemon/hook-requests-fleet-session-start.d.ts +32 -0
- package/dist/lib/daemon/hook-requests-fleet-session-start.js +214 -0
- package/dist/lib/daemon/hook-requests-mesh-tool-writes.d.ts +44 -0
- package/dist/lib/daemon/hook-requests-mesh-tool-writes.js +292 -0
- package/dist/lib/daemon/hook-requests-mesh.d.ts +54 -0
- package/dist/lib/daemon/hook-requests-mesh.js +559 -0
- package/dist/lib/daemon/hook-requests.d.ts +417 -0
- package/dist/lib/daemon/hook-requests.js +1747 -0
- package/dist/lib/daemon/lanes-reconcile-status.d.ts +35 -0
- package/dist/lib/daemon/lanes-reconcile-status.js +86 -0
- package/dist/lib/daemon/machine-checks.d.ts +12 -2
- package/dist/lib/daemon/machine-checks.js +27 -10
- package/dist/lib/daemon/merge-sections.d.ts +24 -2
- package/dist/lib/daemon/merge-sections.js +58 -16
- package/dist/lib/daemon/ops/policy.d.ts +1 -1
- package/dist/lib/daemon/ops/policy.js +47 -6
- package/dist/lib/daemon/resolver.js +9 -2
- package/dist/lib/daemon/run.d.ts +11 -7
- package/dist/lib/daemon/run.js +195 -18
- package/dist/lib/daemon/search-index-worker-v1.d.ts +2 -0
- package/dist/lib/daemon/search-index-worker-v1.js +25 -0
- package/dist/lib/daemon/server.js +6 -1
- package/dist/lib/daemon/session-registry.d.ts +0 -1
- package/dist/lib/daemon/session-registry.js +0 -3
- package/dist/lib/daemon/supervisor.d.ts +5 -1
- package/dist/lib/daemon/supervisor.js +1 -1
- package/dist/lib/daemon/tcc-eperm.d.ts +59 -4
- package/dist/lib/daemon/tcc-eperm.js +110 -8
- package/dist/lib/doctor/fix/process-identity.d.ts +20 -2
- package/dist/lib/doctor/fix/process-identity.js +48 -5
- 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/hook-engine/canary-gate.js +1 -0
- package/dist/lib/hook-engine/native-stop-compatibility.json +2 -1
- package/dist/lib/hot-channels/adapters/attio.js +2 -1
- package/dist/lib/hot-channels/adapters/meetings.js +2 -1
- package/dist/lib/lanes/account-company.d.ts +7 -1
- package/dist/lib/lanes/account-company.js +22 -4
- package/dist/lib/lanes/account-ownership.d.ts +65 -0
- package/dist/lib/lanes/account-ownership.js +134 -0
- package/dist/lib/lanes/accounts.js +9 -2
- package/dist/lib/lanes/claude-balance.js +9 -3
- package/dist/lib/lanes/company-outposts.d.ts +37 -0
- package/dist/lib/lanes/company-outposts.js +164 -0
- package/dist/lib/lanes/config.js +17 -0
- package/dist/lib/lanes/host-capacity.d.ts +19 -0
- package/dist/lib/lanes/host-capacity.js +37 -0
- package/dist/lib/lanes/liveness.d.ts +6 -0
- package/dist/lib/lanes/liveness.js +49 -8
- package/dist/lib/lanes/orphan-report.d.ts +15 -0
- package/dist/lib/lanes/orphan-report.js +223 -0
- package/dist/lib/lanes/orphan-sweep.d.ts +26 -0
- package/dist/lib/lanes/orphan-sweep.js +152 -0
- package/dist/lib/lanes/reaper.d.ts +2 -0
- package/dist/lib/lanes/reaper.js +11 -8
- package/dist/lib/lanes/reconcile.d.ts +8 -7
- package/dist/lib/lanes/reconcile.js +83 -3
- package/dist/lib/lanes/spawn.d.ts +0 -10
- package/dist/lib/lanes/spawn.js +51 -1
- package/dist/lib/lanes/types.d.ts +12 -0
- package/dist/lib/mesh/live/backfill-held.d.ts +13 -0
- package/dist/lib/mesh/live/backfill-held.js +23 -0
- package/dist/lib/mesh/live/daemon/mode.d.ts +8 -4
- package/dist/lib/mesh/live/daemon/mode.js +8 -4
- package/dist/lib/mesh/live/daemon/run.d.ts +14 -3
- package/dist/lib/mesh/live/daemon/run.js +116 -7
- package/dist/lib/mesh/live/direct-drain.d.ts +123 -0
- package/dist/lib/mesh/live/direct-drain.js +315 -0
- package/dist/lib/mesh/live/emit-replay.d.ts +10 -0
- package/dist/lib/mesh/live/emit-replay.js +10 -0
- package/dist/lib/mesh/live/flush.d.ts +15 -0
- package/dist/lib/mesh/live/flush.js +27 -0
- package/dist/lib/mesh/live/liveness-carry.d.ts +45 -0
- package/dist/lib/mesh/live/liveness-carry.js +141 -0
- package/dist/lib/mesh/live/spool.d.ts +19 -0
- package/dist/lib/mesh/live/spool.js +80 -0
- package/dist/lib/safe-store.d.ts +2 -0
- package/dist/lib/safe-store.js +8 -6
- package/dist/lib/search-index/index.d.ts +9 -3
- package/dist/lib/search-index/index.js +35 -10
- package/dist/lib/search-index/worker-process.d.ts +9 -0
- package/dist/lib/search-index/worker-process.js +171 -0
- package/dist/lib/session-company-lock.d.ts +3 -1
- package/dist/lib/session-company-lock.js +3 -2
- package/dist/utils/delegate-command-supervisor.d.ts +3 -0
- package/dist/utils/delegate-command-supervisor.js +44 -0
- package/dist/utils/delegate-lock.d.ts +12 -0
- package/dist/utils/delegate-lock.js +88 -0
- package/dist/utils/frontmatter.d.ts +27 -0
- package/dist/utils/frontmatter.js +33 -0
- package/dist/utils/hook-trust.d.ts +1 -0
- package/dist/utils/hook-trust.js +18 -2
- package/dist/utils/host-registration.d.ts +13 -1
- package/dist/utils/host-registration.js +98 -5
- package/dist/utils/package-use-lease.d.ts +1 -1
- package/dist/utils/package-use-lease.js +15 -7
- package/docs/anywhere-runtime.md +17 -0
- package/package.json +9 -8
- package/scripts/check-function-manifest.mjs +17 -3
|
@@ -231,7 +231,7 @@ function waitForUpdateRequest(requestPath, timeoutMs, notify = null) {
|
|
|
231
231
|
function notifyWaitingForUpdate() {
|
|
232
232
|
process.stderr.write("hq-cli: waiting for the HQ CLI update to finish...\n");
|
|
233
233
|
}
|
|
234
|
-
export function acquirePackageUseLease(prefix, hqVersion, stateDirectory, purpose = "command") {
|
|
234
|
+
export function acquirePackageUseLease(prefix, hqVersion, stateDirectory, purpose = "command", waitMs = updateWaitTimeoutMs(), onMaxHold) {
|
|
235
235
|
const directory = packageUseLeaseDirectory(prefix, stateDirectory);
|
|
236
236
|
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
237
237
|
const requestPath = path.join(directory, UPDATE_REQUEST);
|
|
@@ -245,6 +245,7 @@ export function acquirePackageUseLease(prefix, hqVersion, stateDirectory, purpos
|
|
|
245
245
|
const tempPath = `${leasePath}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
246
246
|
let released = false;
|
|
247
247
|
let heartbeatInFlight = false;
|
|
248
|
+
let expiryNotified = false;
|
|
248
249
|
let heartbeat = null;
|
|
249
250
|
const acquiredAtMs = Date.now();
|
|
250
251
|
const maxHoldMs = packageUseLeaseMaxHoldMs();
|
|
@@ -253,11 +254,18 @@ export function acquirePackageUseLease(prefix, hqVersion, stateDirectory, purpos
|
|
|
253
254
|
if (released || heartbeatInFlight)
|
|
254
255
|
return;
|
|
255
256
|
const heldMs = Date.now() - acquiredAtMs;
|
|
256
|
-
if (heldMs >= maxHoldMs) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
if (heldMs >= maxHoldMs && !expiryNotified) {
|
|
258
|
+
expiryNotified = true;
|
|
259
|
+
if (onMaxHold) {
|
|
260
|
+
// The owner is responsible for stopping package reads and releasing.
|
|
261
|
+
onMaxHold();
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
process.stderr.write(`hq-cli: released the HQ CLI package-use lease held by pid ${record.pid} (${purpose}) ` +
|
|
265
|
+
`after ${formatHoldDuration(heldMs)} so HQ CLI updates are not blocked\n`);
|
|
266
|
+
release();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
261
269
|
}
|
|
262
270
|
heartbeatInFlight = true;
|
|
263
271
|
const now = new Date();
|
|
@@ -289,7 +297,7 @@ export function acquirePackageUseLease(prefix, hqVersion, stateDirectory, purpos
|
|
|
289
297
|
};
|
|
290
298
|
const releaseOnExit = () => release();
|
|
291
299
|
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
292
|
-
waitForUpdateRequest(requestPath,
|
|
300
|
+
waitForUpdateRequest(requestPath, waitMs, notifyWaitingForUpdate);
|
|
293
301
|
try {
|
|
294
302
|
writeFileSync(tempPath, `${JSON.stringify(record)}\n`, { flag: "wx", mode: 0o600 });
|
|
295
303
|
renameSync(tempPath, leasePath);
|
package/docs/anywhere-runtime.md
CHANGED
|
@@ -33,6 +33,23 @@ The CLI stores the HQ root at `~/.hq/root` and keeps the folder registry in
|
|
|
33
33
|
`~/.hq/registry.json`. These files belong to the current host. They are not
|
|
34
34
|
stored in a repository or synced HQ folder.
|
|
35
35
|
|
|
36
|
+
While it updates a runtime's config file (for example `~/.claude.json`), the
|
|
37
|
+
installer holds a lock file beside it (`~/.claude.json.hqlock`). A second hq
|
|
38
|
+
command that finds the lock waits up to 10 seconds and then stops without
|
|
39
|
+
writing, and its message gives the time at which hq clears the lock by itself.
|
|
40
|
+
hq clears a lock once it is older than the maximum hold time, even when the
|
|
41
|
+
process that wrote it still appears to be running. A lock whose process has
|
|
42
|
+
exited is cleared after 30 seconds. If a lock is past its limit but another
|
|
43
|
+
program has the file open (on Windows, without delete sharing), hq clears it
|
|
44
|
+
once that program closes the file, and the message says so. If the lock
|
|
45
|
+
exists but cannot be read (for example it was left by an hq command run as
|
|
46
|
+
root, the path is a directory, or it is a symlink whose target is missing), hq waits out the 10 seconds, then stops and
|
|
47
|
+
names the lock and the read error; it never clears a lock it cannot read. The default
|
|
48
|
+
maximum hold time is 10 minutes. `HQ_CONFIG_LOCK_MAX_HOLD_MS` changes it, in
|
|
49
|
+
whole milliseconds. Values below 10000 (10 seconds) are raised to 10000, and
|
|
50
|
+
values above 604800000 (7 days) are lowered to 604800000. 0, negative numbers
|
|
51
|
+
and anything that is not a whole number are ignored, and the default applies.
|
|
52
|
+
|
|
36
53
|
Windows requires Windows PowerShell 5.1 or PowerShell 7 for the bundled pipe
|
|
37
54
|
host. If it is unavailable, the pipe cannot be created with a verified
|
|
38
55
|
current-user-only DACL, or another process already owns the pipe name, hqd
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.345.
|
|
3
|
+
"version": "5.345.228",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@aws-sdk/client-iot-data-plane": "^3.1096.0",
|
|
63
63
|
"@aws-sdk/client-s3": "^3.1049.0",
|
|
64
64
|
"@aws-sdk/dsql-signer": "^3.1146.0",
|
|
65
|
-
"@indigoai-us/hq-cloud": "6.18.
|
|
65
|
+
"@indigoai-us/hq-cloud": "6.18.110",
|
|
66
66
|
"@indigoai-us/hq-flags-client": "^0.2.0",
|
|
67
67
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
68
68
|
"@sentry/node": "^10.49.0",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"eslint": "^10.5.0",
|
|
95
95
|
"husky": "^9.1.7",
|
|
96
96
|
"lint-staged": "^15.5.2",
|
|
97
|
+
"tar": "7.5.22",
|
|
97
98
|
"typescript": "^5.7.0",
|
|
98
99
|
"typescript-eslint": "^8.61.1",
|
|
99
100
|
"vitest": "^4.1.2"
|
|
@@ -124,11 +125,11 @@
|
|
|
124
125
|
"*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
|
|
125
126
|
},
|
|
126
127
|
"optionalDependencies": {
|
|
127
|
-
"@indigoai-us/hq-hook-win32-x64": "5.345.
|
|
128
|
-
"@indigoai-us/hq-hook-win32-arm64": "5.345.
|
|
129
|
-
"@indigoai-us/hq-hook-darwin-x64": "5.345.
|
|
130
|
-
"@indigoai-us/hq-hook-darwin-arm64": "5.345.
|
|
131
|
-
"@indigoai-us/hq-hook-linux-x64": "5.345.
|
|
132
|
-
"@indigoai-us/hq-hook-linux-arm64": "5.345.
|
|
128
|
+
"@indigoai-us/hq-hook-win32-x64": "5.345.228",
|
|
129
|
+
"@indigoai-us/hq-hook-win32-arm64": "5.345.228",
|
|
130
|
+
"@indigoai-us/hq-hook-darwin-x64": "5.345.228",
|
|
131
|
+
"@indigoai-us/hq-hook-darwin-arm64": "5.345.228",
|
|
132
|
+
"@indigoai-us/hq-hook-linux-x64": "5.345.228",
|
|
133
|
+
"@indigoai-us/hq-hook-linux-arm64": "5.345.228"
|
|
133
134
|
}
|
|
134
135
|
}
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
// the release leaves out (* within a folder, ** across
|
|
43
43
|
// folders, ?). Repeatable; none are built in
|
|
44
44
|
// --json print the result as JSON
|
|
45
|
+
// --max-seconds <n> time limit for the whole run (default 10). A run that
|
|
46
|
+
// takes n seconds or longer fails (rule time-budget),
|
|
47
|
+
// so the check stays fast enough to run locally
|
|
45
48
|
//
|
|
46
49
|
// Exit 0: no problem. Exit 1: at least one problem. Exit 2: usage error.
|
|
47
50
|
//
|
|
@@ -128,6 +131,8 @@ const DOC_EXT_RE = /\.(md|mdx|mdc|txt|rst|html?)$/i;
|
|
|
128
131
|
const COMMENT_RE = /^\s*(#(?!!)|\/\/|\/\*|\*(\s|$)|<!--|rem\s|::\s)/i;
|
|
129
132
|
const SCRIPT_NAME_RE = /\.(sh|bash|mjs|cjs|js|py|ps1|cmd|awk)$/;
|
|
130
133
|
const MAX_FILE_BYTES = 2_000_000;
|
|
134
|
+
// The check has to run locally in under this many seconds.
|
|
135
|
+
const DEFAULT_MAX_SECONDS = 10;
|
|
131
136
|
|
|
132
137
|
// ---------- small helpers ----------
|
|
133
138
|
const posix = (p) => p.split(path.sep).join("/");
|
|
@@ -666,7 +671,7 @@ function readKeepFile(file) {
|
|
|
666
671
|
|
|
667
672
|
// ---------- main ----------
|
|
668
673
|
function parseArgs(argv) {
|
|
669
|
-
const opt = { json: false, noManifest: false, keep: [], tooling: [] };
|
|
674
|
+
const opt = { json: false, noManifest: false, keep: [], tooling: [], maxSeconds: DEFAULT_MAX_SECONDS };
|
|
670
675
|
const value = (i) => {
|
|
671
676
|
if (argv[i + 1] === undefined) usage(`${argv[i]} needs a value`);
|
|
672
677
|
return argv[i + 1];
|
|
@@ -685,6 +690,11 @@ function parseArgs(argv) {
|
|
|
685
690
|
else if (a === "--keep-file") opt.keep.push(...readKeepFile(path.resolve(value(i++))));
|
|
686
691
|
else if (a === "--tooling") opt.tooling.push(value(i++));
|
|
687
692
|
else if (a === "--json") opt.json = true;
|
|
693
|
+
else if (a === "--max-seconds") {
|
|
694
|
+
const v = value(i++);
|
|
695
|
+
if (!/^\d+(\.\d+)?$/.test(v)) usage(`--max-seconds needs a number of seconds, got ${v}`);
|
|
696
|
+
opt.maxSeconds = Number(v);
|
|
697
|
+
}
|
|
688
698
|
else if (a === "--help" || a === "-h") usage();
|
|
689
699
|
else usage(`unknown argument: ${a}`);
|
|
690
700
|
}
|
|
@@ -692,7 +702,7 @@ function parseArgs(argv) {
|
|
|
692
702
|
}
|
|
693
703
|
function usage(error) {
|
|
694
704
|
if (error) console.error(`check-function-manifest: ${error}`);
|
|
695
|
-
console.error("usage: node scripts/check-function-manifest.mjs [--manifest <file>] [--core-root <dir>] [--cli-root <dir> | --cli-package <dir>] [--cli-states <file> [--require-cli-states]] [--no-manifest] [--installed-core <dir> [--keep <path>]... [--keep-file <file>] [--tooling <glob>]...] [--json]");
|
|
705
|
+
console.error("usage: node scripts/check-function-manifest.mjs [--manifest <file>] [--core-root <dir>] [--cli-root <dir> | --cli-package <dir>] [--cli-states <file> [--require-cli-states]] [--no-manifest] [--installed-core <dir> [--keep <path>]... [--keep-file <file>] [--tooling <glob>]...] [--max-seconds <n>] [--json]");
|
|
696
706
|
process.exit(2);
|
|
697
707
|
}
|
|
698
708
|
|
|
@@ -787,7 +797,11 @@ export async function run(argv) {
|
|
|
787
797
|
}
|
|
788
798
|
if (opt.noManifest) notices.push("--no-manifest: the manifest rules did not run here; they run where the manifest is (hq-core-staging pull requests and a local run with --core-root)");
|
|
789
799
|
|
|
790
|
-
const
|
|
800
|
+
const elapsedMs = Date.now() - started;
|
|
801
|
+
if (elapsedMs >= opt.maxSeconds * 1000) {
|
|
802
|
+
problems.push({ rule: "time-budget", message: `the check took ${(elapsedMs / 1000).toFixed(1)} s; it must finish in under ${opt.maxSeconds} s (--max-seconds) so it stays fast enough to run locally` });
|
|
803
|
+
}
|
|
804
|
+
const seconds = (elapsedMs / 1000).toFixed(1);
|
|
791
805
|
if (opt.json) {
|
|
792
806
|
console.log(JSON.stringify({ ok: problems.length === 0, seconds: Number(seconds), checked, notices, problems }, null, 2));
|
|
793
807
|
} else {
|