@indigoai-us/hq-cli 5.345.231 → 5.345.233
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 +48 -0
- package/README.md +3 -2
- package/assets/lanes-reconcile/hq-lanes-reconcile.service +1 -1
- package/assets/scaffold/core/scripts/pipeline-conductor.sh +14 -14
- package/assets/scaffold/core/scripts/pipeline-driver.sh +7 -7
- package/assets/scaffold/core/scripts/session-project.sh +19 -4
- package/dist/command-catalog.generated.d.ts +213 -177
- package/dist/command-catalog.generated.js +263 -212
- package/dist/command-registration-plan.d.ts +6 -24
- package/dist/command-registration-plan.js +4 -8
- package/dist/commands/auth.js +3 -2
- package/dist/commands/core-handoff.d.ts +1 -0
- package/dist/commands/core-handoff.js +2 -28
- package/dist/commands/core-pipeline-conductor-command.js +1 -1
- package/dist/commands/core-pipeline-conductor-native.js +5 -5
- package/dist/commands/core-pipeline-driver-native.js +5 -5
- package/dist/commands/daemon.js +7 -36
- package/dist/commands/deploy-access.js +6 -13
- package/dist/commands/deploy-comments.js +5 -13
- package/dist/commands/deploy-domains.js +6 -13
- package/dist/commands/deploy-list.js +25 -11
- package/dist/commands/deploy-mutations.d.ts +3 -0
- package/dist/commands/deploy-mutations.js +147 -0
- package/dist/commands/link.js +29 -0
- package/dist/commands/mcp-serve-gate.d.ts +22 -0
- package/dist/commands/mcp-serve-gate.js +37 -0
- package/dist/commands/mcp-serve.js +2 -8
- package/dist/commands/mesh.js +3 -1
- package/dist/commands/report.js +8 -9
- package/dist/data/command-states.json +10 -7
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +257 -214
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/index.js +6 -1
- package/dist/lib/bot/fleet-bots-update-pass.d.ts +8 -0
- package/dist/lib/bot/fleet-bots-update-pass.js +40 -0
- package/dist/lib/bot/fleet-bots-update-task.d.ts +12 -0
- package/dist/lib/bot/fleet-bots-update-task.js +52 -0
- package/dist/lib/bot/fleet-bots-update-worker-v1.d.ts +2 -0
- package/dist/lib/bot/fleet-bots-update-worker-v1.js +5 -0
- package/dist/lib/daemon/catalog.d.ts +8 -5
- package/dist/lib/daemon/catalog.js +15 -8
- package/dist/lib/daemon/flag.d.ts +2 -0
- package/dist/lib/daemon/flag.js +6 -4
- package/dist/lib/daemon/lock.js +33 -37
- package/dist/lib/daemon/ops/skill-command.d.ts +99 -0
- package/dist/lib/daemon/ops/skill-command.js +260 -0
- package/dist/lib/daemon/protocol.d.ts +1 -1
- package/dist/lib/daemon/protocol.js +1 -0
- package/dist/lib/daemon/run.js +10 -18
- package/dist/lib/daemon/server.js +7 -0
- package/dist/lib/daemon/shared-flag-reads.d.ts +70 -0
- package/dist/lib/daemon/shared-flag-reads.js +173 -0
- package/dist/lib/daemon/supervisor.d.ts +5 -0
- package/dist/lib/daemon/supervisor.js +17 -2
- package/dist/lib/db/app-ref.js +10 -15
- package/dist/lib/deploy-apps.d.ts +29 -0
- package/dist/lib/deploy-apps.js +37 -0
- package/dist/lib/doctor/checks/search-index.d.ts +16 -0
- package/dist/lib/doctor/checks/search-index.js +61 -0
- package/dist/lib/doctor/checks/stranded-lanes.js +1 -1
- package/dist/lib/doctor/registry.js +4 -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/lanes/accounts.js +3 -3
- package/dist/lib/lanes/admission-host.js +1 -1
- package/dist/lib/lanes/admission.js +4 -4
- package/dist/lib/lanes/autopilot.js +2 -2
- package/dist/lib/lanes/blocker-freshness.js +1 -1
- package/dist/lib/lanes/compaction.js +5 -5
- package/dist/lib/lanes/delivery.js +1 -1
- package/dist/lib/lanes/depth-cap.js +1 -1
- package/dist/lib/lanes/disk-guard.js +1 -1
- package/dist/lib/lanes/dropbox.js +1 -1
- package/dist/lib/lanes/hooks-install.js +1 -1
- package/dist/lib/lanes/imported-question.js +1 -1
- package/dist/lib/lanes/keep-alive.d.ts +2 -2
- package/dist/lib/lanes/keep-alive.js +3 -3
- package/dist/lib/lanes/kr-freshness.js +1 -1
- package/dist/lib/lanes/links.js +4 -4
- package/dist/lib/lanes/loop.js +2 -2
- package/dist/lib/lanes/machine-identity.js +3 -3
- package/dist/lib/lanes/models.js +6 -6
- package/dist/lib/lanes/quota.js +1 -1
- package/dist/lib/lanes/reconcile-install.js +3 -3
- package/dist/lib/lanes/reconcile.js +16 -16
- package/dist/lib/lanes/remote-control-lane.js +6 -6
- package/dist/lib/lanes/reviews.js +2 -2
- package/dist/lib/lanes/spawn.js +24 -24
- package/dist/lib/lanes/status-fields.js +4 -4
- package/dist/lib/lanes/wait.js +4 -4
- package/dist/lib/lanes/watch.js +2 -2
- package/dist/lib/lanes/watcher-main.js +1 -1
- package/dist/lib/lanes/watcher.js +38 -38
- package/dist/lib/lanes/worker-process.js +5 -5
- package/dist/lib/mesh/live/daemon/pid-lock.d.ts +2 -4
- package/dist/lib/mesh/live/daemon/pid-lock.js +38 -55
- package/dist/utils/cognito-session.d.ts +2 -56
- package/dist/utils/cognito-session.js +6 -164
- package/dist/utils/exclusive-lock.d.ts +60 -0
- package/dist/utils/exclusive-lock.js +65 -0
- package/package.json +9 -8
- package/dist/commands/staff/listings.d.ts +0 -41
- package/dist/commands/staff/listings.js +0 -160
- package/dist/commands/staff/reset-test-account.d.ts +0 -121
- package/dist/commands/staff/reset-test-account.js +0 -285
- package/dist/commands/staff/test-account.d.ts +0 -51
- package/dist/commands/staff/test-account.js +0 -196
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { ensureCognitoToken } from "../../utils/cognito-session.js";
|
|
3
|
-
import { vaultApiFetch } from "../../utils/vault-api.js";
|
|
4
|
-
import { callerEmailFromToken, isStaffEmail } from "./reset-test-account.js";
|
|
5
|
-
// ── URL-safe base64 encode for the DELETE path parameter ────────────────────
|
|
6
|
-
/**
|
|
7
|
-
* Encode an email as the base64url path segment the DELETE route expects. The
|
|
8
|
-
* server decodes and normalizes (`decodeRegistryEmailKey` → `normalizeRegistryEmail`),
|
|
9
|
-
* so the operator can type `Bohemian.HW@gmail.com` and hit the same row as
|
|
10
|
-
* `bohemianhw@gmail.com`. Local encoding is a pure transform on the raw input;
|
|
11
|
-
* we never persist or print a locally normalized value.
|
|
12
|
-
*/
|
|
13
|
-
export function encodeEmailForPath(email) {
|
|
14
|
-
return Buffer.from(email.trim(), "utf8")
|
|
15
|
-
.toString("base64")
|
|
16
|
-
.replace(/\+/g, "-")
|
|
17
|
-
.replace(/\//g, "_")
|
|
18
|
-
.replace(/=+$/, "");
|
|
19
|
-
}
|
|
20
|
-
// ── Rendering ───────────────────────────────────────────────────────────────
|
|
21
|
-
function renderEntryLine(entry) {
|
|
22
|
-
const flag = entry.active ? chalk.green("active") : chalk.dim("inactive");
|
|
23
|
-
const note = entry.note ? ` ${chalk.dim(entry.note)}` : "";
|
|
24
|
-
return ` ${entry.email.padEnd(40)} ${flag} added ${entry.addedAt} by ${entry.addedBy}${note}`;
|
|
25
|
-
}
|
|
26
|
-
export function renderEntry(entry) {
|
|
27
|
-
const lines = [];
|
|
28
|
-
lines.push(chalk.bold(`\nRegistry entry for ${entry.email}`));
|
|
29
|
-
lines.push(` active: ${entry.active ? chalk.green("yes") : chalk.dim("no")}`);
|
|
30
|
-
lines.push(` added by: ${entry.addedBy}`);
|
|
31
|
-
lines.push(` added at: ${entry.addedAt}`);
|
|
32
|
-
lines.push(` note: ${entry.note ?? chalk.dim("(none)")}`);
|
|
33
|
-
if (entry.removedBy !== undefined) {
|
|
34
|
-
lines.push(` removed by: ${entry.removedBy}`);
|
|
35
|
-
}
|
|
36
|
-
if (entry.removedAt !== undefined) {
|
|
37
|
-
lines.push(` removed at: ${entry.removedAt}`);
|
|
38
|
-
}
|
|
39
|
-
return lines.join("\n");
|
|
40
|
-
}
|
|
41
|
-
export function renderList(entries) {
|
|
42
|
-
if (entries.length === 0) {
|
|
43
|
-
return chalk.dim("\n(no registry entries)");
|
|
44
|
-
}
|
|
45
|
-
const lines = [];
|
|
46
|
-
lines.push(chalk.bold(`\nTest-account registry (${entries.length})`));
|
|
47
|
-
for (const entry of entries) {
|
|
48
|
-
lines.push(renderEntryLine(entry));
|
|
49
|
-
}
|
|
50
|
-
return lines.join("\n");
|
|
51
|
-
}
|
|
52
|
-
// ── Shared HTTP helpers ─────────────────────────────────────────────────────
|
|
53
|
-
async function readBody(res) {
|
|
54
|
-
try {
|
|
55
|
-
return (await res.json());
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
return {};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function renderApiError(status, body) {
|
|
62
|
-
const code = typeof body.code === "string" ? body.code : undefined;
|
|
63
|
-
const message = typeof body.error === "string" ? body.error : `request failed (${status})`;
|
|
64
|
-
return code ? `${code}: ${message}` : message;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Same local preflight the reset command runs. Duplicated in shape (not code)
|
|
68
|
-
* so both commands surface the same message without a circular import; the
|
|
69
|
-
* server remains the authorization boundary.
|
|
70
|
-
*/
|
|
71
|
-
async function requireStaffToken() {
|
|
72
|
-
const token = await ensureCognitoToken();
|
|
73
|
-
const callerEmail = callerEmailFromToken(token);
|
|
74
|
-
if (!callerEmail || !isStaffEmail(callerEmail)) {
|
|
75
|
-
throw new Error("hq staff test-account requires a super-admin (staff) HQ session. " +
|
|
76
|
-
"Sign in with an @getindigo.ai account and retry.");
|
|
77
|
-
}
|
|
78
|
-
return token;
|
|
79
|
-
}
|
|
80
|
-
export async function runAddTestAccount(params) {
|
|
81
|
-
const email = params.email.trim();
|
|
82
|
-
if (email.length === 0) {
|
|
83
|
-
throw new Error("email argument is required");
|
|
84
|
-
}
|
|
85
|
-
const token = await requireStaffToken();
|
|
86
|
-
const body = { email };
|
|
87
|
-
if (params.note !== undefined)
|
|
88
|
-
body.note = params.note;
|
|
89
|
-
const res = await vaultApiFetch({
|
|
90
|
-
token,
|
|
91
|
-
path: "/v1/admin/test-account-registry",
|
|
92
|
-
method: "POST",
|
|
93
|
-
body,
|
|
94
|
-
});
|
|
95
|
-
const parsed = await readBody(res);
|
|
96
|
-
if (!res.ok) {
|
|
97
|
-
throw new Error(renderApiError(res.status, parsed));
|
|
98
|
-
}
|
|
99
|
-
const entry = parsed.entry;
|
|
100
|
-
if (!entry) {
|
|
101
|
-
throw new Error("server did not return the registry entry");
|
|
102
|
-
}
|
|
103
|
-
console.log(renderEntry(entry));
|
|
104
|
-
console.log(chalk.dim("\n(entry added — reset command will now accept this email.)"));
|
|
105
|
-
}
|
|
106
|
-
export async function runRemoveTestAccount(params) {
|
|
107
|
-
const email = params.email.trim();
|
|
108
|
-
if (email.length === 0) {
|
|
109
|
-
throw new Error("email argument is required");
|
|
110
|
-
}
|
|
111
|
-
const token = await requireStaffToken();
|
|
112
|
-
const emailB64 = encodeEmailForPath(email);
|
|
113
|
-
const res = await vaultApiFetch({
|
|
114
|
-
token,
|
|
115
|
-
path: `/v1/admin/test-account-registry/${emailB64}`,
|
|
116
|
-
method: "DELETE",
|
|
117
|
-
});
|
|
118
|
-
const parsed = await readBody(res);
|
|
119
|
-
if (!res.ok) {
|
|
120
|
-
throw new Error(renderApiError(res.status, parsed));
|
|
121
|
-
}
|
|
122
|
-
const entry = parsed.entry;
|
|
123
|
-
if (!entry) {
|
|
124
|
-
throw new Error("server did not return the registry entry");
|
|
125
|
-
}
|
|
126
|
-
console.log(renderEntry(entry));
|
|
127
|
-
console.log(chalk.dim("\n(entry soft-deleted — row stays with active: false.)"));
|
|
128
|
-
}
|
|
129
|
-
export async function runListTestAccounts(params = {}) {
|
|
130
|
-
const token = await requireStaffToken();
|
|
131
|
-
const res = await vaultApiFetch({
|
|
132
|
-
token,
|
|
133
|
-
path: "/v1/admin/test-account-registry",
|
|
134
|
-
method: "GET",
|
|
135
|
-
query: params.includeInactive ? { includeInactive: "true" } : undefined,
|
|
136
|
-
});
|
|
137
|
-
const parsed = await readBody(res);
|
|
138
|
-
if (!res.ok) {
|
|
139
|
-
throw new Error(renderApiError(res.status, parsed));
|
|
140
|
-
}
|
|
141
|
-
const entries = parsed.entries;
|
|
142
|
-
if (!Array.isArray(entries)) {
|
|
143
|
-
throw new Error("server did not return a list of entries");
|
|
144
|
-
}
|
|
145
|
-
console.log(renderList(entries));
|
|
146
|
-
}
|
|
147
|
-
// ── Commander wiring ────────────────────────────────────────────────────────
|
|
148
|
-
function fail(err) {
|
|
149
|
-
console.error(chalk.red(err instanceof Error ? err.message : String(err)));
|
|
150
|
-
process.exit(1);
|
|
151
|
-
}
|
|
152
|
-
export function registerTestAccountCommand(staff) {
|
|
153
|
-
const group = staff
|
|
154
|
-
.command("test-account")
|
|
155
|
-
.description("Manage the designated test-account registry (super-admin only). " +
|
|
156
|
-
"Wraps /v1/admin/test-account-registry.");
|
|
157
|
-
group
|
|
158
|
-
.command("add")
|
|
159
|
-
.description("Add an email to the registry so `hq staff reset-test-account` will sweep it.")
|
|
160
|
-
.argument("<email>", "Designated test-account email")
|
|
161
|
-
.option("--note <text>", "Short reason recorded on the row")
|
|
162
|
-
.action(async (email, opts) => {
|
|
163
|
-
try {
|
|
164
|
-
await runAddTestAccount({ email, note: opts.note });
|
|
165
|
-
}
|
|
166
|
-
catch (err) {
|
|
167
|
-
fail(err);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
group
|
|
171
|
-
.command("remove")
|
|
172
|
-
.description("Soft-delete a registry entry (row stays with active: false).")
|
|
173
|
-
.argument("<email>", "Registered test-account email")
|
|
174
|
-
.action(async (email) => {
|
|
175
|
-
try {
|
|
176
|
-
await runRemoveTestAccount({ email });
|
|
177
|
-
}
|
|
178
|
-
catch (err) {
|
|
179
|
-
fail(err);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
group
|
|
183
|
-
.command("list")
|
|
184
|
-
.description("List active registry entries.")
|
|
185
|
-
.option("--include-inactive", "Also list soft-deleted rows (active: false).")
|
|
186
|
-
.action(async (opts) => {
|
|
187
|
-
try {
|
|
188
|
-
await runListTestAccounts({ includeInactive: opts.includeInactive === true });
|
|
189
|
-
}
|
|
190
|
-
catch (err) {
|
|
191
|
-
fail(err);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
return group;
|
|
195
|
-
}
|
|
196
|
-
//# sourceMappingURL=test-account.js.map
|