@indigoai-us/hq-cli 5.345.156 → 5.345.160
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 +255 -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 +535 -10
- package/dist/command-catalog.generated.js +678 -31
- 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/access.d.ts +6 -0
- package/dist/commands/access.js +18 -1
- package/dist/commands/acl-lock.d.ts +41 -0
- package/dist/commands/acl-lock.js +28 -0
- package/dist/commands/agent-enroll.d.ts +2 -0
- package/dist/commands/agent-enroll.js +9 -4
- package/dist/commands/agent-kit.js +8 -6
- package/dist/commands/agents.js +5 -11
- package/dist/commands/billing-sponsor.d.ts +4 -4
- package/dist/commands/billing-sponsor.js +11 -11
- package/dist/commands/billing-usage.d.ts +22 -8
- package/dist/commands/billing-usage.js +57 -22
- package/dist/commands/billing.d.ts +7 -7
- package/dist/commands/billing.js +13 -13
- 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-provision.js +2 -2
- package/dist/commands/cloud.d.ts +45 -0
- package/dist/commands/cloud.js +157 -17
- 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 +12 -0
- package/dist/commands/crm.js +83 -6
- package/dist/commands/db-remote-deps.js +12 -1
- 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.d.ts +24 -0
- package/dist/commands/files.js +71 -8
- package/dist/commands/integrations-connect.js +7 -3
- 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/meetings.d.ts +4 -4
- package/dist/commands/meetings.js +17 -8
- 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 +21 -0
- package/dist/commands/secrets.js +114 -14
- package/dist/commands/signals.js +17 -5
- package/dist/commands/skill.js +6 -6
- 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/commands/whoami.js +1 -1
- package/dist/hook-engine-path.js +13 -2
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +3392 -1243
- package/dist/hq-cloud-sync-runner/package.json +1 -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/billing/plan-limit-refusals.d.ts +13 -3
- package/dist/lib/billing/plan-limit-refusals.js +26 -3
- package/dist/lib/billing/plan-limit-upgrade-url.d.ts +8 -0
- package/dist/lib/billing/plan-limit-upgrade-url.js +18 -0
- package/dist/lib/billing/plan-lock.d.ts +22 -6
- package/dist/lib/billing/plan-lock.js +58 -30
- package/dist/lib/billing/usage-cost.d.ts +24 -2
- package/dist/lib/billing/usage-cost.js +103 -3
- package/dist/lib/billing/usage-only.d.ts +37 -1
- package/dist/lib/billing/usage-only.js +89 -4
- package/dist/lib/billing/usage-pause.d.ts +27 -0
- package/dist/lib/billing/usage-pause.js +50 -0
- 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/db/control-plane.d.ts +5 -0
- package/dist/lib/db/control-plane.js +10 -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.d.ts +14 -0
- package/dist/lib/hook-engine/resolve.js +55 -1
- package/dist/lib/index-render/company-knowledge.js +1 -3
- package/dist/lib/index-render/projects.js +1 -3
- 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/plan-limit-nag.d.ts +0 -16
- package/dist/lib/plan-limit-nag.js +17 -18
- 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/main.d.ts +0 -2
- package/dist/main.js +19 -57
- package/dist/utils/package-use-lease.js +27 -9
- package/dist/utils/plan-gate-error.d.ts +30 -14
- package/dist/utils/plan-gate-error.js +60 -46
- package/dist/utils/team-upgrade.d.ts +19 -6
- package/dist/utils/team-upgrade.js +37 -39
- package/dist/utils/version-gate.d.ts +7 -0
- package/dist/utils/version-gate.js +66 -0
- package/package.json +8 -8
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-side storage for the supervisor's unit holds and the per-run output
|
|
3
|
+
* read used to classify a unit's exit.
|
|
4
|
+
*
|
|
5
|
+
* holds.json (`DaemonPaths.holdsPath`, ~/.hq/daemon/holds.json) maps a unit id
|
|
6
|
+
* to its UnitHold. The daemon rewrites it whenever a hold starts or clears; a
|
|
7
|
+
* missing or unreadable file means no holds.
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from "node:fs";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
import { ensurePrivateDir } from "./paths.js";
|
|
12
|
+
/** How much of a run's output the exit classifier sees. */
|
|
13
|
+
export const EXIT_OUTPUT_TAIL_BYTES = 16 * 1024;
|
|
14
|
+
function isHold(value) {
|
|
15
|
+
if (!value || typeof value !== "object")
|
|
16
|
+
return false;
|
|
17
|
+
const h = value;
|
|
18
|
+
return ((h.kind === "permanent" || h.kind === "exhausted")
|
|
19
|
+
&& typeof h.cause === "string"
|
|
20
|
+
&& typeof h.detail === "string"
|
|
21
|
+
&& typeof h.since === "number"
|
|
22
|
+
&& typeof h.failures === "number"
|
|
23
|
+
&& typeof h.keyHash === "string");
|
|
24
|
+
}
|
|
25
|
+
export function readUnitHolds(file) {
|
|
26
|
+
let raw;
|
|
27
|
+
try {
|
|
28
|
+
raw = fs.readFileSync(file, "utf8");
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (err.code === "ENOENT")
|
|
32
|
+
return {};
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
const parsed = JSON.parse(raw);
|
|
36
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
37
|
+
return {};
|
|
38
|
+
const holds = {};
|
|
39
|
+
for (const [id, hold] of Object.entries(parsed))
|
|
40
|
+
if (isHold(hold))
|
|
41
|
+
holds[id] = hold;
|
|
42
|
+
return holds;
|
|
43
|
+
}
|
|
44
|
+
export function writeUnitHolds(file, holds) {
|
|
45
|
+
ensurePrivateDir(path.dirname(file));
|
|
46
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
47
|
+
fs.writeFileSync(tmp, `${JSON.stringify(holds, null, 2)}\n`, { mode: 0o600 });
|
|
48
|
+
fs.renameSync(tmp, file);
|
|
49
|
+
}
|
|
50
|
+
/** The size of a log file now, so a later read sees only what was written after. */
|
|
51
|
+
export function logOffset(file) {
|
|
52
|
+
try {
|
|
53
|
+
return fs.statSync(file).size;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* What was appended to `file` since `offset`, at most the last `maxBytes`.
|
|
61
|
+
* A file smaller than `offset` was rotated (copy-and-truncate), so it is read
|
|
62
|
+
* from the start.
|
|
63
|
+
*/
|
|
64
|
+
export function readLogSince(file, offset, maxBytes = EXIT_OUTPUT_TAIL_BYTES) {
|
|
65
|
+
let fd;
|
|
66
|
+
try {
|
|
67
|
+
fd = fs.openSync(file, "r");
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const size = fs.fstatSync(fd).size;
|
|
74
|
+
const from = Math.max(size < offset ? 0 : offset, size - maxBytes);
|
|
75
|
+
const length = size - from;
|
|
76
|
+
if (length <= 0)
|
|
77
|
+
return "";
|
|
78
|
+
const buf = Buffer.alloc(length);
|
|
79
|
+
const read = fs.readSync(fd, buf, 0, length, from);
|
|
80
|
+
return buf.subarray(0, read).toString("utf8");
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
fs.closeSync(fd);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=unit-holds.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type UsagePause } from "../billing/usage-pause.js";
|
|
1
2
|
/**
|
|
2
3
|
* Control-plane client for remote vault DB (US-009).
|
|
3
4
|
* Injectable fetch for tests — never logs response bodies that might hold secrets.
|
|
@@ -167,5 +168,9 @@ export type ControlPlaneHttpError = Error & {
|
|
|
167
168
|
status?: number;
|
|
168
169
|
code?: string;
|
|
169
170
|
reason?: string;
|
|
171
|
+
/** The 402 usage pause (hq-pro `usagePause`), when the server sent one. */
|
|
172
|
+
usagePause?: UsagePause;
|
|
173
|
+
/** The body's customer sentence (`message`), when it sent one. */
|
|
174
|
+
serverMessage?: string;
|
|
170
175
|
};
|
|
171
176
|
//# sourceMappingURL=control-plane.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { planGateErrorFromPayload } from "../../utils/plan-gate-error.js";
|
|
2
|
+
import { usagePauseFromBody } from "../billing/usage-pause.js";
|
|
2
3
|
// Provision may allocate remote resources, so allow two minutes and never retry.
|
|
3
4
|
const DB_PROVISION_TIMEOUT_MS = 120_000;
|
|
4
5
|
// Status is a read-only probe; 15 seconds is longer than its normal response time.
|
|
@@ -195,6 +196,8 @@ function httpError(label, status, text) {
|
|
|
195
196
|
let msg = `${label} failed (${status})`;
|
|
196
197
|
let code;
|
|
197
198
|
let reason;
|
|
199
|
+
let usagePause = null;
|
|
200
|
+
let serverMessage;
|
|
198
201
|
try {
|
|
199
202
|
const j = JSON.parse(text);
|
|
200
203
|
if (typeof j.error === "string")
|
|
@@ -203,6 +206,9 @@ function httpError(label, status, text) {
|
|
|
203
206
|
code = j.code;
|
|
204
207
|
if (typeof j.reason === "string")
|
|
205
208
|
reason = j.reason;
|
|
209
|
+
if (typeof j.message === "string" && j.message.trim())
|
|
210
|
+
serverMessage = j.message.trim();
|
|
211
|
+
usagePause = usagePauseFromBody(j);
|
|
206
212
|
}
|
|
207
213
|
catch {
|
|
208
214
|
/* keep */
|
|
@@ -213,6 +219,10 @@ function httpError(label, status, text) {
|
|
|
213
219
|
err.code = code;
|
|
214
220
|
if (reason)
|
|
215
221
|
err.reason = reason;
|
|
222
|
+
if (usagePause)
|
|
223
|
+
err.usagePause = usagePause;
|
|
224
|
+
if (serverMessage)
|
|
225
|
+
err.serverMessage = serverMessage;
|
|
216
226
|
return err;
|
|
217
227
|
}
|
|
218
228
|
function personalHttpError(label, status, text) {
|