@indigoai-us/hq-cli 5.241.0 → 5.242.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 +12 -0
- package/dist/command-catalog.generated.d.ts +2 -2
- package/dist/command-catalog.generated.js +2 -2
- package/dist/commands/lanes.d.ts +0 -6
- package/dist/commands/lanes.js +23 -62
- package/dist/lib/lanes/dropbox.d.ts +1 -6
- package/dist/lib/lanes/dropbox.js +6 -11
- package/dist/lib/lanes/message-replay.d.ts +0 -1
- package/dist/lib/lanes/message-replay.js +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.242.0] — 2026-09-27
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Removed the completed `lanes.message-compaction-replay`,
|
|
10
|
+
`lanes.outpost-question-visibility`, and
|
|
11
|
+
`lanes.host-scoped-account-homes` gates. Their shipped behaviors now run
|
|
12
|
+
unconditionally.
|
|
13
|
+
- Account-home login and `set-home` no longer require an unrelated active
|
|
14
|
+
company selection when `--company` is omitted; explicit `--company` values
|
|
15
|
+
remain validated.
|
|
16
|
+
|
|
5
17
|
## [5.241.0] — 2026-09-27
|
|
6
18
|
|
|
7
19
|
### Fixed
|
|
@@ -8447,7 +8447,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
8447
8447
|
readonly description: "Host key (defaults to this host's hostname)";
|
|
8448
8448
|
}, {
|
|
8449
8449
|
readonly flags: "--company <slug|uid>";
|
|
8450
|
-
readonly description: "Company scope for
|
|
8450
|
+
readonly description: "Company scope for account-home validation";
|
|
8451
8451
|
}, {
|
|
8452
8452
|
readonly flags: "--json";
|
|
8453
8453
|
readonly description: "JSON on stdout (always)";
|
|
@@ -8473,7 +8473,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
8473
8473
|
readonly description: "Account home directory";
|
|
8474
8474
|
}, {
|
|
8475
8475
|
readonly flags: "--company <slug|uid>";
|
|
8476
|
-
readonly description: "Company scope for
|
|
8476
|
+
readonly description: "Company scope for account-home validation";
|
|
8477
8477
|
}, {
|
|
8478
8478
|
readonly flags: "--device-auth";
|
|
8479
8479
|
readonly description: "Use Codex device authentication instead of localhost callback";
|
|
@@ -10929,7 +10929,7 @@ export const COMMAND_CATALOG = [
|
|
|
10929
10929
|
},
|
|
10930
10930
|
{
|
|
10931
10931
|
"flags": "--company <slug|uid>",
|
|
10932
|
-
"description": "Company scope for
|
|
10932
|
+
"description": "Company scope for account-home validation"
|
|
10933
10933
|
},
|
|
10934
10934
|
{
|
|
10935
10935
|
"flags": "--json",
|
|
@@ -10963,7 +10963,7 @@ export const COMMAND_CATALOG = [
|
|
|
10963
10963
|
},
|
|
10964
10964
|
{
|
|
10965
10965
|
"flags": "--company <slug|uid>",
|
|
10966
|
-
"description": "Company scope for
|
|
10966
|
+
"description": "Company scope for account-home validation"
|
|
10967
10967
|
},
|
|
10968
10968
|
{
|
|
10969
10969
|
"flags": "--device-auth",
|
package/dist/commands/lanes.d.ts
CHANGED
|
@@ -91,18 +91,12 @@ export interface LanesCommandDeps {
|
|
|
91
91
|
isSsmOwnerDispatch?: () => boolean;
|
|
92
92
|
/** Test seam for changing a lane between pre-lock and locked grant reads. */
|
|
93
93
|
withGrantHireLocks?: typeof withLaneHireLocks;
|
|
94
|
-
/** Test seam for the default-off Outpost question visibility gate. */
|
|
95
|
-
laneOutpostQuestionVisibilityEnabled?: (company?: LaneCompanyRef | null) => boolean | Promise<boolean>;
|
|
96
94
|
/** Test seam for the hq-flags gated tracker commands. */
|
|
97
95
|
laneTrackerEnabled?: (company: LaneCompanyRef) => boolean | Promise<boolean>;
|
|
98
|
-
/** Test seam for the default-off host-scoped account-home writer gate. */
|
|
99
|
-
laneHostScopedAccountHomesEnabled?: (company?: LaneCompanyRef | null) => boolean | Promise<boolean>;
|
|
100
96
|
/** Test seam for recording approvals against the active identity. */
|
|
101
97
|
trackerActor?: () => string | null;
|
|
102
98
|
}
|
|
103
99
|
export declare const LANE_OUTPOST_LOAD_BALANCING_FLAG = "lanes.outpost-load-balancing";
|
|
104
|
-
export declare const LANE_OUTPOST_QUESTION_VISIBILITY_FLAG = "lanes.outpost-question-visibility";
|
|
105
|
-
export declare const LANE_HOST_SCOPED_ACCOUNT_HOMES_FLAG = "lanes.host-scoped-account-homes";
|
|
106
100
|
export declare function parseSeniorRef(raw: string): SeniorRef;
|
|
107
101
|
export declare function resolveAnswerChoice(choice: string, options: string[], freeform: boolean): string;
|
|
108
102
|
export declare function parseQuestionBody(raw: unknown): QuestionBody | null;
|
package/dist/commands/lanes.js
CHANGED
|
@@ -10,7 +10,6 @@ import { randomBytes } from "node:crypto";
|
|
|
10
10
|
import * as fs from "node:fs";
|
|
11
11
|
import * as os from "node:os";
|
|
12
12
|
import * as path from "node:path";
|
|
13
|
-
import { readLocalOverride } from "@indigoai-us/hq-flags-client";
|
|
14
13
|
import { Option } from "commander";
|
|
15
14
|
import { registerOutpostPrunerCommand } from "./outpost-pruner.js";
|
|
16
15
|
import { registerLaneChecksCommand } from "./lanes-checks.js";
|
|
@@ -72,29 +71,12 @@ const VENDOR_LOGIN = {
|
|
|
72
71
|
};
|
|
73
72
|
export { emitLaneDecisionEvents };
|
|
74
73
|
export const LANE_OUTPOST_LOAD_BALANCING_FLAG = "lanes.outpost-load-balancing";
|
|
75
|
-
export const LANE_OUTPOST_QUESTION_VISIBILITY_FLAG = "lanes.outpost-question-visibility";
|
|
76
|
-
export const LANE_HOST_SCOPED_ACCOUNT_HOMES_FLAG = "lanes.host-scoped-account-homes";
|
|
77
74
|
function defaultLanePlacementEnabled() {
|
|
78
75
|
return resolveProcessFlagGate(LANE_OUTPOST_LOAD_BALANCING_FLAG, { fallback: false }, () => false);
|
|
79
76
|
}
|
|
80
77
|
function defaultLaneTrackerEnabled(company) {
|
|
81
78
|
return readLanesRegistryFlag(LANES_TRACKER_FLAG, { company });
|
|
82
79
|
}
|
|
83
|
-
function defaultLaneOutpostQuestionVisibilityEnabled(company, env) {
|
|
84
|
-
return readLanesRegistryFlag(LANE_OUTPOST_QUESTION_VISIBILITY_FLAG, {
|
|
85
|
-
company,
|
|
86
|
-
env,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function defaultLaneHostScopedAccountHomesEnabled(company, env) {
|
|
90
|
-
return readLanesRegistryFlag(LANE_HOST_SCOPED_ACCOUNT_HOMES_FLAG, { company, env });
|
|
91
|
-
}
|
|
92
|
-
async function hostScopedAccountHomesEnabled(ctx, company) {
|
|
93
|
-
const localOverride = readLocalOverride(LANE_HOST_SCOPED_ACCOUNT_HOMES_FLAG, ctx.env);
|
|
94
|
-
if (localOverride !== null)
|
|
95
|
-
return localOverride;
|
|
96
|
-
return ctx.laneHostScopedAccountHomesEnabled(company ?? await ctx.resolveCompany());
|
|
97
|
-
}
|
|
98
80
|
async function resolveSelectedAccountHomeCompany(ctx, selector) {
|
|
99
81
|
const company = await ctx.resolveActiveCompany(selector);
|
|
100
82
|
if (!company) {
|
|
@@ -312,11 +294,7 @@ function resolveDeps(deps = {}) {
|
|
|
312
294
|
storyLedgerEnabled: deps.storyLedgerEnabled ?? laneStoryLedgerEnabled,
|
|
313
295
|
isSsmOwnerDispatch: deps.isSsmOwnerDispatch ?? (() => isSsmRunCommandProcess()),
|
|
314
296
|
withGrantHireLocks: deps.withGrantHireLocks ?? withLaneHireLocks,
|
|
315
|
-
laneOutpostQuestionVisibilityEnabled: deps.laneOutpostQuestionVisibilityEnabled ??
|
|
316
|
-
((company) => defaultLaneOutpostQuestionVisibilityEnabled(company, env)),
|
|
317
297
|
laneTrackerEnabled: deps.laneTrackerEnabled ?? defaultLaneTrackerEnabled,
|
|
318
|
-
laneHostScopedAccountHomesEnabled: deps.laneHostScopedAccountHomesEnabled ??
|
|
319
|
-
((company) => defaultLaneHostScopedAccountHomesEnabled(company, env)),
|
|
320
298
|
trackerActor: deps.trackerActor ?? defaultTrackerActor,
|
|
321
299
|
};
|
|
322
300
|
}
|
|
@@ -8260,19 +8238,15 @@ async function loadPrimaryOwnedOutpostQuestions(ctx, hqRoot, companyFilter) {
|
|
|
8260
8238
|
for (const [outpostId, lanes] of [...lanesByOutpost.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
8261
8239
|
for (const group of groupQuestionLanesByCompany(hqRoot, lanes, companyFilter)) {
|
|
8262
8240
|
if (group.company === null) {
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
});
|
|
8268
|
-
}
|
|
8241
|
+
errors.push({
|
|
8242
|
+
host: `outpost:${outpostId}`,
|
|
8243
|
+
error: "outpost_question_company_unavailable",
|
|
8244
|
+
});
|
|
8269
8245
|
continue;
|
|
8270
8246
|
}
|
|
8271
8247
|
if (companyFilter && !questionCompanyRefMatches(group.company, companyFilter))
|
|
8272
8248
|
continue;
|
|
8273
|
-
|
|
8274
|
-
eligibleGroups.push({ outpostId, group });
|
|
8275
|
-
}
|
|
8249
|
+
eligibleGroups.push({ outpostId, group });
|
|
8276
8250
|
}
|
|
8277
8251
|
}
|
|
8278
8252
|
if (eligibleGroups.length === 0) {
|
|
@@ -8978,12 +8952,9 @@ async function runAccountsLogin(ctx, providerRaw, accountId, opts) {
|
|
|
8978
8952
|
if (opts.home !== undefined && !requestedHome) {
|
|
8979
8953
|
throw new LanesError("invalid_account_home", "--home must be a non-empty path", { provider, account: id });
|
|
8980
8954
|
}
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
const hostScopedWriterEnabled = registeredAccount !== undefined && requestedHome !== undefined
|
|
8985
|
-
? await hostScopedAccountHomesEnabled(ctx, company)
|
|
8986
|
-
: false;
|
|
8955
|
+
if (opts.company !== undefined) {
|
|
8956
|
+
await resolveSelectedAccountHomeCompany(ctx, opts.company);
|
|
8957
|
+
}
|
|
8987
8958
|
const homeRaw = requestedHome ??
|
|
8988
8959
|
(registeredAccount !== undefined
|
|
8989
8960
|
? effectiveAccountHome(registeredAccount, hostname).home
|
|
@@ -9001,25 +8972,19 @@ async function runAccountsLogin(ctx, providerRaw, accountId, opts) {
|
|
|
9001
8972
|
const nextAccount = registeredAccount === undefined
|
|
9002
8973
|
? { home, enabled: true }
|
|
9003
8974
|
: { ...registeredAccount, enabled: true };
|
|
9004
|
-
if (registeredAccount !== undefined) {
|
|
9005
|
-
if (
|
|
9006
|
-
if (
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
delete nextAccount.hosts;
|
|
9011
|
-
}
|
|
9012
|
-
}
|
|
9013
|
-
else {
|
|
9014
|
-
nextAccount.hosts = {
|
|
9015
|
-
...(registeredAccount.hosts ?? {}),
|
|
9016
|
-
[hostname]: { home },
|
|
9017
|
-
};
|
|
8975
|
+
if (registeredAccount !== undefined && requestedHome !== undefined) {
|
|
8976
|
+
if (home === registeredAccount.home) {
|
|
8977
|
+
if (nextAccount.hosts !== undefined) {
|
|
8978
|
+
delete nextAccount.hosts[hostname];
|
|
8979
|
+
if (Object.keys(nextAccount.hosts).length === 0)
|
|
8980
|
+
delete nextAccount.hosts;
|
|
9018
8981
|
}
|
|
9019
8982
|
}
|
|
9020
|
-
else
|
|
9021
|
-
|
|
9022
|
-
|
|
8983
|
+
else {
|
|
8984
|
+
nextAccount.hosts = {
|
|
8985
|
+
...(registeredAccount.hosts ?? {}),
|
|
8986
|
+
[hostname]: { home },
|
|
8987
|
+
};
|
|
9023
8988
|
}
|
|
9024
8989
|
}
|
|
9025
8990
|
delete nextAccount.disabled_reason;
|
|
@@ -9076,12 +9041,8 @@ async function runAccountsLogin(ctx, providerRaw, accountId, opts) {
|
|
|
9076
9041
|
printJson({ ok: true, action: "accounts.login", account: status });
|
|
9077
9042
|
}
|
|
9078
9043
|
async function runAccountsSetHome(ctx, providerRaw, accountIdRaw, homeRaw, opts) {
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
: undefined;
|
|
9082
|
-
if (!(await hostScopedAccountHomesEnabled(ctx, company))) {
|
|
9083
|
-
throw new LanesError("host_scoped_account_homes_disabled", "Setting a host-specific account home requires the lanes.host-scoped-account-homes flag", { flag: LANE_HOST_SCOPED_ACCOUNT_HOMES_FLAG });
|
|
9084
|
-
}
|
|
9044
|
+
if (opts.company !== undefined)
|
|
9045
|
+
await resolveSelectedAccountHomeCompany(ctx, opts.company);
|
|
9085
9046
|
const callerCwd = ctx.callerCwd();
|
|
9086
9047
|
const hqRoot = ctx.hqRoot();
|
|
9087
9048
|
const provider = parseLaneProvider(providerRaw);
|
|
@@ -9844,7 +9805,7 @@ export function registerLanesCommand(parent, deps = {}) {
|
|
|
9844
9805
|
.argument("<account-id>", "Existing account id")
|
|
9845
9806
|
.argument("<path>", "Home directory for this host")
|
|
9846
9807
|
.option("--host <hostname>", "Host key (defaults to this host's hostname)")
|
|
9847
|
-
.option("--company <slug|uid>", "Company scope for
|
|
9808
|
+
.option("--company <slug|uid>", "Company scope for account-home validation")
|
|
9848
9809
|
.option("--json", "JSON on stdout (always)")
|
|
9849
9810
|
.action(wrap(async (provider, accountId, home, opts) => {
|
|
9850
9811
|
await runAccountsSetHome(ctx, provider, accountId, home, opts);
|
|
@@ -9855,7 +9816,7 @@ export function registerLanesCommand(parent, deps = {}) {
|
|
|
9855
9816
|
.argument("<provider>", "claude | codex | grok")
|
|
9856
9817
|
.argument("<account-id>", "Open-ended account id")
|
|
9857
9818
|
.option("--home <path>", "Account home directory")
|
|
9858
|
-
.option("--company <slug|uid>", "Company scope for
|
|
9819
|
+
.option("--company <slug|uid>", "Company scope for account-home validation")
|
|
9859
9820
|
.option("--device-auth", "Use Codex device authentication instead of localhost callback")
|
|
9860
9821
|
.action(wrap(async (provider, accountId, opts) => {
|
|
9861
9822
|
await runAccountsLogin(ctx, provider, accountId, opts);
|
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
import * as fs from "node:fs";
|
|
11
11
|
import { probeProviderCompactionsSince } from "./compaction.js";
|
|
12
12
|
import { tryReadLane } from "./store.js";
|
|
13
|
-
import { type
|
|
13
|
+
import { type LaneRecord, type LaneState, type QuestionRecord } from "./types.js";
|
|
14
14
|
export declare const DROPBOX_DIR = "dropbox";
|
|
15
15
|
export declare const INBOX_NAME = "inbox.jsonl";
|
|
16
16
|
export declare const DRAINING_DIR = "draining";
|
|
17
17
|
export declare const DELIVERED_DIR = "delivered";
|
|
18
18
|
export declare const INFLIGHT_DIR = "inflight";
|
|
19
|
-
export { LANE_MESSAGE_COMPACTION_REPLAY_FLAG } from "./message-replay.js";
|
|
20
19
|
export interface DropboxMessage {
|
|
21
20
|
at?: string;
|
|
22
21
|
message_id?: string;
|
|
@@ -59,10 +58,6 @@ export interface LaneDrainHookInput {
|
|
|
59
58
|
hook_event_name?: string;
|
|
60
59
|
}
|
|
61
60
|
export interface RunDrainHookDeps {
|
|
62
|
-
readFlag?: (flag: string, options: {
|
|
63
|
-
company?: LaneCompanyRef | null;
|
|
64
|
-
env: NodeJS.ProcessEnv;
|
|
65
|
-
}) => Promise<boolean>;
|
|
66
61
|
readLane?: typeof tryReadLane;
|
|
67
62
|
probeCompactionsSince?: typeof probeProviderCompactionsSince;
|
|
68
63
|
}
|
|
@@ -12,8 +12,7 @@ import * as fs from "node:fs";
|
|
|
12
12
|
import * as path from "node:path";
|
|
13
13
|
import { probeProviderCompactionsSince, providerTranscriptSize, } from "./compaction.js";
|
|
14
14
|
import { LanesError } from "./errors.js";
|
|
15
|
-
import {
|
|
16
|
-
import { LANE_MESSAGE_COMPACTION_REPLAY_FLAG, MESSAGE_COMPACTION_REPLAY_NOTE, MESSAGE_REPLAY_STATE_NAME, } from "./message-replay.js";
|
|
15
|
+
import { MESSAGE_COMPACTION_REPLAY_NOTE, MESSAGE_REPLAY_STATE_NAME, } from "./message-replay.js";
|
|
17
16
|
import { LANES_RUNS_REL, readProcStarttime } from "./spawn.js";
|
|
18
17
|
import { tryReadLane } from "./store.js";
|
|
19
18
|
export const DROPBOX_DIR = "dropbox";
|
|
@@ -21,7 +20,6 @@ export const INBOX_NAME = "inbox.jsonl";
|
|
|
21
20
|
export const DRAINING_DIR = "draining";
|
|
22
21
|
export const DELIVERED_DIR = "delivered";
|
|
23
22
|
export const INFLIGHT_DIR = "inflight";
|
|
24
|
-
export { LANE_MESSAGE_COMPACTION_REPLAY_FLAG } from "./message-replay.js";
|
|
25
23
|
function defaultDrainDeps() {
|
|
26
24
|
return {
|
|
27
25
|
mkdirSync: fs.mkdirSync.bind(fs),
|
|
@@ -492,8 +490,8 @@ function readReplayState(filePath, turnId) {
|
|
|
492
490
|
(state.flag_enabled !== undefined && typeof state.flag_enabled !== "boolean")) {
|
|
493
491
|
throw new LanesError("message_replay_state_invalid", `Replay state ${filePath} does not match the current provider turn`);
|
|
494
492
|
}
|
|
495
|
-
// Older state files persisted
|
|
496
|
-
// before the next write so the
|
|
493
|
+
// Older state files persisted the removed per-turn flag. Accept it, but
|
|
494
|
+
// remove it before the next write so the stale cache does not live on.
|
|
497
495
|
delete state.flag_enabled;
|
|
498
496
|
return state;
|
|
499
497
|
}
|
|
@@ -602,12 +600,9 @@ export async function runDrainHook(env, input = {}, deps = {}) {
|
|
|
602
600
|
}
|
|
603
601
|
else if (delta.count > 0) {
|
|
604
602
|
state.last_compaction_marker += delta.count;
|
|
605
|
-
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
-
if (replayed.length > 0)
|
|
609
|
-
replayNote = MESSAGE_COMPACTION_REPLAY_NOTE;
|
|
610
|
-
}
|
|
603
|
+
replayed = deliveredMessagesForTurn(hqRoot, laneId, turnId);
|
|
604
|
+
if (replayed.length > 0)
|
|
605
|
+
replayNote = MESSAGE_COMPACTION_REPLAY_NOTE;
|
|
611
606
|
}
|
|
612
607
|
}
|
|
613
608
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const LANE_MESSAGE_COMPACTION_REPLAY_FLAG = "lanes.message-compaction-replay";
|
|
2
1
|
export declare const MESSAGE_REPLAY_STATE_NAME = "message-compaction-replay.json";
|
|
3
2
|
export declare const MESSAGE_COMPACTION_REPLAY_NOTE = "These messages were delivered before a context compaction and still apply.";
|
|
4
3
|
export interface MessageReplayState {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const LANE_MESSAGE_COMPACTION_REPLAY_FLAG = "lanes.message-compaction-replay";
|
|
2
1
|
export const MESSAGE_REPLAY_STATE_NAME = "message-compaction-replay.json";
|
|
3
2
|
export const MESSAGE_COMPACTION_REPLAY_NOTE = "These messages were delivered before a context compaction and still apply.";
|
|
4
3
|
//# sourceMappingURL=message-replay.js.map
|