@indigoai-us/hq-cli 5.345.155 → 5.345.159
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 +289 -0
- package/assets/scaffold/core/scripts/rebuild-company-knowledge-index.sh +110 -2
- package/assets/scaffold/core/scripts/rebuild-projects-index.sh +101 -5
- package/assets/scaffold/core/scripts/worktree.sh +4 -0
- package/dist/command-catalog.generated.d.ts +536 -7
- package/dist/command-catalog.generated.js +676 -24
- package/dist/command-registration-plan.d.ts +18 -0
- package/dist/command-registration-plan.js +4 -0
- package/dist/commands/_patterns.d.ts +17 -0
- package/dist/commands/_patterns.js +22 -0
- package/dist/commands/agent-inbox.js +2 -2
- package/dist/commands/agent-kit.js +8 -6
- package/dist/commands/bot.js +7 -4
- package/dist/commands/channel-suggest.d.ts +56 -0
- package/dist/commands/channel-suggest.js +170 -0
- package/dist/commands/channels.js +7 -1
- package/dist/commands/cloud.d.ts +45 -0
- package/dist/commands/cloud.js +150 -10
- package/dist/commands/company.js +4 -3
- package/dist/commands/core-checkpoint-native.d.ts +18 -0
- package/dist/commands/core-checkpoint-native.js +67 -2
- package/dist/commands/core-pipeline-driver-native.d.ts +12 -1
- package/dist/commands/core-pipeline-driver-native.js +131 -5
- package/dist/commands/core.js +13 -1
- package/dist/commands/crm.js +83 -6
- package/dist/commands/deploy-access.d.ts +33 -0
- package/dist/commands/deploy-access.js +322 -0
- package/dist/commands/dm-attach.d.ts +106 -0
- package/dist/commands/dm-attach.js +184 -0
- package/dist/commands/dm.d.ts +37 -0
- package/dist/commands/dm.js +172 -10
- package/dist/commands/feedback-show.d.ts +40 -0
- package/dist/commands/feedback-show.js +261 -0
- package/dist/commands/feedback.d.ts +21 -0
- package/dist/commands/feedback.js +152 -2
- package/dist/commands/files-browse.d.ts +16 -0
- package/dist/commands/files-browse.js +52 -1
- package/dist/commands/files.d.ts +24 -0
- package/dist/commands/files.js +52 -1
- package/dist/commands/integrations-connect.js +7 -3
- package/dist/commands/integrations-core.d.ts +13 -1
- package/dist/commands/integrations-core.js +49 -4
- package/dist/commands/integrations.js +4 -2
- package/dist/commands/lanes-accounts.js +16 -1
- package/dist/commands/lanes-loop.js +14 -4
- package/dist/commands/lanes-message.js +6 -4
- package/dist/commands/lanes-resume.js +36 -13
- package/dist/commands/lanes-shared.d.ts +5 -0
- package/dist/commands/lanes-shared.js +13 -3
- package/dist/commands/lanes-watch.js +1 -0
- package/dist/commands/lanes.d.ts +20 -1
- package/dist/commands/lanes.js +201 -51
- package/dist/commands/mesh.js +149 -1
- package/dist/commands/monitor.d.ts +1 -0
- package/dist/commands/monitor.js +4 -1
- package/dist/commands/repo.d.ts +41 -0
- package/dist/commands/repo.js +331 -0
- package/dist/commands/scan.d.ts +3 -1
- package/dist/commands/scan.js +7 -3
- package/dist/commands/secrets.d.ts +37 -0
- package/dist/commands/secrets.js +185 -16
- package/dist/commands/signals.js +17 -5
- package/dist/commands/staff/listings.d.ts +41 -0
- package/dist/commands/staff/listings.js +160 -0
- package/dist/commands/staff/reset-test-account.d.ts +3 -2
- package/dist/commands/staff/reset-test-account.js +4 -3
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +2629 -1036
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/lib/agent-kit/inbox-state.d.ts +7 -0
- package/dist/lib/agent-kit/inbox-state.js +5 -1
- package/dist/lib/agent-kit/mcp/tools.js +2 -1
- package/dist/lib/agent-kit/run/inbox.js +2 -1
- package/dist/lib/agent-kit/wake-secrets.d.ts +7 -0
- package/dist/lib/agent-kit/wake-secrets.js +32 -0
- package/dist/lib/agent-kit/wake.d.ts +4 -0
- package/dist/lib/agent-kit/wake.js +49 -3
- package/dist/lib/bot/inflight.d.ts +7 -1
- package/dist/lib/bot/inflight.js +10 -2
- package/dist/lib/bot/prompt.js +3 -0
- package/dist/lib/bot/run.js +72 -20
- package/dist/lib/bot/session.d.ts +14 -0
- package/dist/lib/bot/session.js +70 -0
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +6 -0
- package/dist/lib/capacity/collectors/claude-oauth.js +12 -0
- package/dist/lib/capacity/lane-login.d.ts +6 -0
- package/dist/lib/capacity/lane-login.js +5 -0
- package/dist/lib/core-utils/worktree.js +2 -0
- package/dist/lib/daemon/exit-cause.d.ts +43 -0
- package/dist/lib/daemon/exit-cause.js +88 -0
- package/dist/lib/daemon/handoff.d.ts +2 -0
- package/dist/lib/daemon/handoff.js +6 -1
- package/dist/lib/daemon/hq-child-bootstrap.mjs +20 -3
- package/dist/lib/daemon/paths.d.ts +2 -0
- package/dist/lib/daemon/paths.js +1 -0
- package/dist/lib/daemon/run.js +13 -0
- package/dist/lib/daemon/supervisor.d.ts +54 -1
- package/dist/lib/daemon/supervisor.js +297 -21
- package/dist/lib/daemon/unit-holds.d.ts +22 -0
- package/dist/lib/daemon/unit-holds.js +86 -0
- package/dist/lib/doctor/checks/sync-health.d.ts +9 -0
- package/dist/lib/doctor/checks/sync-health.js +66 -1
- package/dist/lib/doctor/company-resolution-state.d.ts +30 -0
- package/dist/lib/doctor/company-resolution-state.js +89 -0
- package/dist/lib/doctor/fix/apply.d.ts +36 -6
- package/dist/lib/doctor/fix/apply.js +128 -12
- package/dist/lib/doctor/types.d.ts +1 -1
- package/dist/lib/doctor/types.js +1 -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/hook-engine/resolve.js +6 -2
- package/dist/lib/index-render/company-knowledge.d.ts +1 -1
- package/dist/lib/index-render/company-knowledge.js +4 -5
- package/dist/lib/index-render/index.js +44 -3
- package/dist/lib/index-render/projects.d.ts +1 -1
- package/dist/lib/index-render/projects.js +5 -5
- package/dist/lib/lanes/account-company.d.ts +28 -0
- package/dist/lib/lanes/account-company.js +53 -0
- package/dist/lib/lanes/accounts.d.ts +22 -3
- package/dist/lib/lanes/accounts.js +38 -2
- package/dist/lib/lanes/claude-balance.d.ts +6 -1
- package/dist/lib/lanes/claude-balance.js +6 -1
- package/dist/lib/lanes/claude-credential.d.ts +78 -0
- package/dist/lib/lanes/claude-credential.js +163 -0
- package/dist/lib/lanes/compaction.d.ts +2 -0
- package/dist/lib/lanes/compaction.js +9 -0
- package/dist/lib/lanes/config.js +6 -0
- package/dist/lib/lanes/envelope-repair-dispatch.js +2 -1
- package/dist/lib/lanes/hooks-install.js +2 -1
- package/dist/lib/lanes/host-capacity.d.ts +2 -0
- package/dist/lib/lanes/host-capacity.js +1 -0
- package/dist/lib/lanes/keep-alive.d.ts +1 -1
- package/dist/lib/lanes/keep-alive.js +3 -1
- package/dist/lib/lanes/links.js +10 -4
- package/dist/lib/lanes/loop.js +16 -1
- package/dist/lib/lanes/node-binary.d.ts +17 -0
- package/dist/lib/lanes/node-binary.js +30 -0
- package/dist/lib/lanes/outpost-dispatch.d.ts +2 -1
- package/dist/lib/lanes/outpost-dispatch.js +1 -0
- package/dist/lib/lanes/reconcile.js +4 -0
- package/dist/lib/lanes/remote-control-lane.js +2 -0
- package/dist/lib/lanes/spawn.d.ts +3 -0
- package/dist/lib/lanes/spawn.js +119 -9
- package/dist/lib/lanes/store.d.ts +6 -0
- package/dist/lib/lanes/store.js +107 -18
- package/dist/lib/lanes/types.d.ts +2 -0
- package/dist/lib/lanes/watch.js +28 -5
- package/dist/lib/lanes/watcher-main.js +4 -3
- package/dist/lib/lanes/watcher.d.ts +4 -0
- package/dist/lib/lanes/watcher.js +110 -21
- package/dist/lib/mesh/api.d.ts +32 -0
- package/dist/lib/mesh/api.js +75 -0
- package/dist/lib/secret-scan/detect.js +9 -0
- package/dist/lib/secret-scan/repo-config.d.ts +41 -0
- package/dist/lib/secret-scan/repo-config.js +237 -0
- package/dist/lib/secret-scan/rules.d.ts +7 -1
- package/dist/lib/secret-scan/rules.js +3 -1
- package/dist/lib/secret-scan/staged.d.ts +5 -0
- package/dist/lib/secret-scan/staged.js +19 -2
- package/dist/lib/secret-scan/types.d.ts +2 -0
- package/dist/lib/sync/server-owned-local-only.d.ts +29 -0
- package/dist/lib/sync/server-owned-local-only.js +75 -0
- package/dist/sentry-before-send.js +1 -0
- package/dist/utils/access-denied-hint.js +6 -0
- package/dist/utils/client-health.d.ts +34 -0
- package/dist/utils/client-health.js +96 -3
- package/dist/utils/package-use-lease.js +27 -9
- package/dist/utils/version-gate.d.ts +7 -0
- package/dist/utils/version-gate.js +66 -0
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
-
import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
3
3
|
import { utimes } from "node:fs/promises";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
@@ -152,6 +152,29 @@ export function packageUseLeaseDirectory(prefix, stateDirectory = packageUseStat
|
|
|
152
152
|
function packageUseUpdateRequestPath(prefix, stateDirectory) {
|
|
153
153
|
return path.join(packageUseLeaseDirectory(prefix, stateDirectory), UPDATE_REQUEST);
|
|
154
154
|
}
|
|
155
|
+
// os.uptime() has whole-second resolution, so allow a small margin before
|
|
156
|
+
// calling a request older than the current boot.
|
|
157
|
+
const BOOT_TIME_MARGIN_MS = 5_000;
|
|
158
|
+
/**
|
|
159
|
+
* An update request is stale when it was written before the current boot (its
|
|
160
|
+
* pid may have been reused by an unrelated process since), or when its pid is
|
|
161
|
+
* gone (ESRCH) or belongs to another user (EPERM). The updater always runs as
|
|
162
|
+
* the same user as the CLI, so a pid we may not signal is not our updater.
|
|
163
|
+
*/
|
|
164
|
+
function updateRequestIsStale(requestPath, pid) {
|
|
165
|
+
const bootTimeMs = Date.now() - os.uptime() * 1000;
|
|
166
|
+
if (statSync(requestPath).mtimeMs < bootTimeMs - BOOT_TIME_MARGIN_MS)
|
|
167
|
+
return true;
|
|
168
|
+
try {
|
|
169
|
+
process.kill(pid, 0);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
const code = error.code;
|
|
173
|
+
if (code === "ESRCH" || code === "EPERM")
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
155
178
|
function waitForUpdateRequest(requestPath, timeoutMs, notify = null) {
|
|
156
179
|
const started = Date.now();
|
|
157
180
|
let notified = false;
|
|
@@ -163,14 +186,9 @@ function waitForUpdateRequest(requestPath, timeoutMs, notify = null) {
|
|
|
163
186
|
if (typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0) {
|
|
164
187
|
throw new Error("invalid update request");
|
|
165
188
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
catch (error) {
|
|
170
|
-
if (error.code === "ESRCH") {
|
|
171
|
-
rmSync(requestPath, { force: true });
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
189
|
+
if (updateRequestIsStale(requestPath, pid)) {
|
|
190
|
+
rmSync(requestPath, { force: true });
|
|
191
|
+
return;
|
|
174
192
|
}
|
|
175
193
|
}
|
|
176
194
|
catch (error) {
|
|
@@ -499,7 +499,14 @@ interface EnforceUpdateDeps {
|
|
|
499
499
|
*/
|
|
500
500
|
checkConvergence?: (targetVersion: string) => boolean | void;
|
|
501
501
|
installNpmPackageStaged?: typeof import("./staged-npm-install.js").installNpmPackageStaged;
|
|
502
|
+
/** Global `hq` paths tried when the running copy is a local dependency. */
|
|
503
|
+
globalHqCandidates?: () => string[];
|
|
504
|
+
probeVersion?: (bin: string) => string | null;
|
|
505
|
+
realpath?: (p: string) => string | null;
|
|
506
|
+
execGlobalHq?: (bin: string, args: string[], env: NodeJS.ProcessEnv) => number | null;
|
|
502
507
|
}
|
|
508
|
+
/** Set on the child when the gate hands a command to a global `hq`. */
|
|
509
|
+
export declare const GATE_GLOBAL_REEXEC_ENV = "HQ_GATE_REEXEC_GLOBAL";
|
|
503
510
|
/**
|
|
504
511
|
* Hard enforcement when the server says we're below `minVersion`. Print a
|
|
505
512
|
* red banner, take the machine-wide update lock, attempt the update, then
|
|
@@ -1692,6 +1692,66 @@ function installedHqEntryPoint(install) {
|
|
|
1692
1692
|
return null;
|
|
1693
1693
|
}
|
|
1694
1694
|
}
|
|
1695
|
+
/** Set on the child when the gate hands a command to a global `hq`. */
|
|
1696
|
+
export const GATE_GLOBAL_REEXEC_ENV = "HQ_GATE_REEXEC_GLOBAL";
|
|
1697
|
+
const DEFAULT_GLOBAL_HQ_CANDIDATES = ["/usr/bin/hq", "/usr/local/bin/hq", "/opt/homebrew/bin/hq"];
|
|
1698
|
+
function realpathOrNull(p) {
|
|
1699
|
+
try {
|
|
1700
|
+
return realpathSync(p);
|
|
1701
|
+
}
|
|
1702
|
+
catch {
|
|
1703
|
+
return null;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
function spawnGlobalHq(bin, args, env) {
|
|
1707
|
+
const result = spawnSync(bin, args, { stdio: "inherit", env });
|
|
1708
|
+
if (result.error)
|
|
1709
|
+
return null;
|
|
1710
|
+
if (result.status !== null)
|
|
1711
|
+
return result.status;
|
|
1712
|
+
return 1;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* When the running copy is a local dependency the gate cannot update it. If a
|
|
1716
|
+
* global `hq` outside that copy reports a version at or above `minVersion`
|
|
1717
|
+
* (and newer than this one), run the user's command with it and return its
|
|
1718
|
+
* exit code. Returns null when there is no such binary, when the global run
|
|
1719
|
+
* could not start, or when this process was itself started by this hand-off.
|
|
1720
|
+
*/
|
|
1721
|
+
function execNewerGlobalHq(decision, install, deps) {
|
|
1722
|
+
if ((deps.platform ?? process.platform) === "win32")
|
|
1723
|
+
return null;
|
|
1724
|
+
if (process.env[GATE_GLOBAL_REEXEC_ENV] === "1")
|
|
1725
|
+
return null;
|
|
1726
|
+
const realpath = deps.realpath ?? realpathOrNull;
|
|
1727
|
+
const probe = deps.probeVersion ?? probeCliVersion;
|
|
1728
|
+
const runningRoot = install.packageRoot ? realpath(install.packageRoot) ?? install.packageRoot : null;
|
|
1729
|
+
const candidates = deps.globalHqCandidates?.() ?? DEFAULT_GLOBAL_HQ_CANDIDATES;
|
|
1730
|
+
for (const candidate of candidates) {
|
|
1731
|
+
const resolved = realpath(candidate);
|
|
1732
|
+
if (!resolved)
|
|
1733
|
+
continue;
|
|
1734
|
+
// A global shim that resolves into the running copy is the same old code.
|
|
1735
|
+
if (runningRoot && (resolved === runningRoot || resolved.startsWith(`${runningRoot}${path.sep}`)))
|
|
1736
|
+
continue;
|
|
1737
|
+
const version = probe(candidate);
|
|
1738
|
+
if (!version || !semver.valid(version))
|
|
1739
|
+
continue;
|
|
1740
|
+
if (!semver.gte(version, decision.minVersion) || !isNewerVersion(version, CLI_VERSION)) {
|
|
1741
|
+
console.error(chalk.dim(` Global ${candidate} is ${version}, also below ${decision.minVersion}; not using it.`));
|
|
1742
|
+
continue;
|
|
1743
|
+
}
|
|
1744
|
+
console.error(chalk.dim(` Running this command with the global ${candidate} (${version}) instead.`));
|
|
1745
|
+
const code = (deps.execGlobalHq ?? spawnGlobalHq)(candidate, process.argv.slice(2), {
|
|
1746
|
+
...process.env,
|
|
1747
|
+
[GATE_GLOBAL_REEXEC_ENV]: "1",
|
|
1748
|
+
});
|
|
1749
|
+
if (code !== null)
|
|
1750
|
+
return code;
|
|
1751
|
+
console.error(chalk.dim(` Could not start ${candidate}.`));
|
|
1752
|
+
}
|
|
1753
|
+
return null;
|
|
1754
|
+
}
|
|
1695
1755
|
/**
|
|
1696
1756
|
* Hard enforcement when the server says we're below `minVersion`. Print a
|
|
1697
1757
|
* red banner, take the machine-wide update lock, attempt the update, then
|
|
@@ -1730,6 +1790,12 @@ function enforceUpdateRequired(decision, deps = {}) {
|
|
|
1730
1790
|
// Say what to fix and stop; do NOT spend an install.
|
|
1731
1791
|
if (isLocalDependencyInstall(install)) {
|
|
1732
1792
|
console.error(chalk.red(` This copy is a local dependency, not a global install: ${install.packageRoot}`));
|
|
1793
|
+
// A shadowing copy (a stale ~/.local/bin shim, a project dependency) must
|
|
1794
|
+
// never run, but a newer global `hq` on the same machine can run the
|
|
1795
|
+
// user's command instead of failing it.
|
|
1796
|
+
const handedOff = execNewerGlobalHq(decision, install, deps);
|
|
1797
|
+
if (handedOff !== null)
|
|
1798
|
+
process.exit(handedOff);
|
|
1733
1799
|
console.error(chalk.dim(" Self-update cannot replace it — an install would land where this copy is never loaded from, and the gate would fire again on the next run."));
|
|
1734
1800
|
console.error(chalk.dim(` Update the project that owns it (e.g. \`pnpm update ${CLI_NAME}\` in its root, or remove the stale dependency), or invoke the global \`hq\` instead.`));
|
|
1735
1801
|
process.exit(75);
|
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.159",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@aws-sdk/client-iot-data-plane": "^3.1096.0",
|
|
53
53
|
"@aws-sdk/client-s3": "^3.1049.0",
|
|
54
54
|
"@aws-sdk/dsql-signer": "^3.1146.0",
|
|
55
|
-
"@indigoai-us/hq-cloud": "
|
|
55
|
+
"@indigoai-us/hq-cloud": "6.18.97",
|
|
56
56
|
"@indigoai-us/hq-flags-client": "^0.1.2",
|
|
57
57
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
58
58
|
"@sentry/node": "^10.49.0",
|
|
@@ -114,11 +114,11 @@
|
|
|
114
114
|
"*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
|
|
115
115
|
},
|
|
116
116
|
"optionalDependencies": {
|
|
117
|
-
"@indigoai-us/hq-hook-win32-x64": "5.345.
|
|
118
|
-
"@indigoai-us/hq-hook-win32-arm64": "5.345.
|
|
119
|
-
"@indigoai-us/hq-hook-darwin-x64": "5.345.
|
|
120
|
-
"@indigoai-us/hq-hook-darwin-arm64": "5.345.
|
|
121
|
-
"@indigoai-us/hq-hook-linux-x64": "5.345.
|
|
122
|
-
"@indigoai-us/hq-hook-linux-arm64": "5.345.
|
|
117
|
+
"@indigoai-us/hq-hook-win32-x64": "5.345.159",
|
|
118
|
+
"@indigoai-us/hq-hook-win32-arm64": "5.345.159",
|
|
119
|
+
"@indigoai-us/hq-hook-darwin-x64": "5.345.159",
|
|
120
|
+
"@indigoai-us/hq-hook-darwin-arm64": "5.345.159",
|
|
121
|
+
"@indigoai-us/hq-hook-linux-x64": "5.345.159",
|
|
122
|
+
"@indigoai-us/hq-hook-linux-arm64": "5.345.159"
|
|
123
123
|
}
|
|
124
124
|
}
|