@indigoai-us/hq-cli 5.242.0 → 5.244.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 +42 -0
- package/assets/bot-workers/setup/skills/agents-and-team.md +17 -4
- package/assets/bot-workers/setup/skills/your-business.md +11 -0
- package/dist/commands/auth.js +73 -16
- package/dist/commands/lanes-accounts.d.ts +25 -0
- package/dist/commands/lanes-accounts.js +527 -0
- package/dist/commands/lanes-questions.d.ts +34 -0
- package/dist/commands/lanes-questions.js +876 -0
- package/dist/commands/lanes-shared.d.ts +155 -0
- package/dist/commands/lanes-shared.js +2 -0
- package/dist/commands/lanes.d.ts +4 -6
- package/dist/commands/lanes.js +128 -1437
- package/dist/commands/safe-extract.d.ts +11 -2
- package/dist/commands/safe-extract.js +37 -8
- package/dist/lib/auth-login-provider-state.d.ts +8 -0
- package/dist/lib/auth-login-provider-state.js +63 -0
- package/dist/lib/bot/progress.d.ts +0 -3
- package/dist/lib/bot/progress.js +0 -3
- package/dist/lib/bot/run.js +5 -7
- package/dist/lib/install-path-compatibility-flag.d.ts +9 -0
- package/dist/lib/install-path-compatibility-flag.js +12 -0
- package/dist/main.js +9 -6
- package/dist/utils/cognito-session.js +2 -1
- package/dist/utils/exclusive-lock.d.ts +32 -0
- package/dist/utils/exclusive-lock.js +75 -0
- package/dist/utils/login-provider.d.ts +7 -0
- package/dist/utils/login-provider.js +34 -0
- package/dist/utils/version-gate.d.ts +3 -3
- package/dist/utils/version-gate.js +19 -10
- package/package.json +2 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { LaneCompanyRef, LaneRecord, LanesConfig, QuestionAnswer, QuestionBody, QuestionRecord, SeniorRef, AccountHistoryEntry, LivenessDeps, MachineIdentity, MonitorEvidenceReader, ReconcileHost, RunCommand, ThrottleDeps, withLaneHireLocks } from "../lib/lanes/index.js";
|
|
2
|
+
import type { OutpostIdentity } from "../lib/lanes/admission-host.js";
|
|
3
|
+
import type { OutpostDispatchResult } from "../lib/lanes/outpost-dispatch.js";
|
|
4
|
+
import type { ProbeCommand } from "../lib/lanes/models.js";
|
|
5
|
+
import type { KillProcessFn, ProveDetachedFn, SpawnProcessFn } from "../lib/lanes/spawn.js";
|
|
6
|
+
import type { WatcherLoopDeps } from "../lib/lanes/watcher.js";
|
|
7
|
+
import type { RunCompactionFn } from "../lib/lanes/compaction.js";
|
|
8
|
+
import type { LaneMesh, LaneMeshEvent } from "../lib/lanes/mesh-events.js";
|
|
9
|
+
import type { BalanceHostGap, BalanceHostSnapshot } from "../lib/lanes/claude-balance.js";
|
|
10
|
+
export interface SpawnLoginResult {
|
|
11
|
+
status: number;
|
|
12
|
+
}
|
|
13
|
+
export type LanesMesh = LaneMesh;
|
|
14
|
+
export interface Ctx {
|
|
15
|
+
hqRoot: () => string;
|
|
16
|
+
cwd: () => string;
|
|
17
|
+
/** Directory the process was in before hq lanes chdir'd to the HQ root. */
|
|
18
|
+
callerCwd: () => string;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
20
|
+
now: () => Date;
|
|
21
|
+
hostname: () => string;
|
|
22
|
+
resolveCompany: (company?: string) => Promise<LaneCompanyRef>;
|
|
23
|
+
resolveActiveCompany: (company: string) => Promise<LaneCompanyRef | null>;
|
|
24
|
+
listOutpostIds: () => Promise<string[]>;
|
|
25
|
+
readOutpostIdentity: () => OutpostIdentity;
|
|
26
|
+
spawnLogin: (opts: {
|
|
27
|
+
command: string;
|
|
28
|
+
args: string[];
|
|
29
|
+
env: NodeJS.ProcessEnv;
|
|
30
|
+
cwd?: string;
|
|
31
|
+
}) => Promise<SpawnLoginResult>;
|
|
32
|
+
throttleDeps: ThrottleDeps;
|
|
33
|
+
existsSync: (p: string) => boolean;
|
|
34
|
+
readFileSync: (p: string, encoding: "utf8") => string;
|
|
35
|
+
readStdin: () => string;
|
|
36
|
+
homedir: () => string;
|
|
37
|
+
mesh: LanesMesh;
|
|
38
|
+
sleep: (ms: number) => Promise<void>;
|
|
39
|
+
spawnProcess?: SpawnProcessFn;
|
|
40
|
+
proveDetached?: ProveDetachedFn;
|
|
41
|
+
killProcess?: KillProcessFn;
|
|
42
|
+
isAlive?: (pid: number) => boolean;
|
|
43
|
+
readStarttime?: (pid: number) => number | null;
|
|
44
|
+
watcherLoopDeps?: Pick<WatcherLoopDeps, "sleep" | "spawnRepair">;
|
|
45
|
+
stopSleepMs?: (ms: number) => void;
|
|
46
|
+
livenessDeps?: LivenessDeps;
|
|
47
|
+
presenceConnected?: boolean;
|
|
48
|
+
systemdRoot?: string;
|
|
49
|
+
runSystemctl?: RunCommand;
|
|
50
|
+
/** Runs a provider CLI probe (`grok models`, `claude --help`) for --model validation. */
|
|
51
|
+
probeProvider?: ProbeCommand;
|
|
52
|
+
resolveMachineIdentity: () => MachineIdentity;
|
|
53
|
+
runCompaction?: RunCompactionFn;
|
|
54
|
+
locateTranscript?: (home: string, sessionId: string) => string | null;
|
|
55
|
+
monitorEvidence: MonitorEvidenceReader;
|
|
56
|
+
stageOutpostPayload: (outpostId: string, bytes: Uint8Array) => Promise<{
|
|
57
|
+
getUrl: string;
|
|
58
|
+
}>;
|
|
59
|
+
dispatchOutpostExec: (input: {
|
|
60
|
+
outpostId: string;
|
|
61
|
+
command: string;
|
|
62
|
+
timeoutSeconds?: number;
|
|
63
|
+
waitMs?: number;
|
|
64
|
+
}) => Promise<OutpostDispatchResult>;
|
|
65
|
+
backfillOutpostIdentity: (expectedId: string) => "created" | "unchanged";
|
|
66
|
+
fetchText: (url: string) => Promise<string>;
|
|
67
|
+
lanePlacementEnabled: () => boolean;
|
|
68
|
+
storyLedgerEnabled: () => boolean;
|
|
69
|
+
isSsmOwnerDispatch: () => boolean;
|
|
70
|
+
withGrantHireLocks: typeof withLaneHireLocks;
|
|
71
|
+
laneTrackerEnabled: (company: LaneCompanyRef) => boolean | Promise<boolean>;
|
|
72
|
+
trackerActor: () => string | null;
|
|
73
|
+
}
|
|
74
|
+
export interface PrimaryOwnedOutpostQuestion {
|
|
75
|
+
question: QuestionRecord;
|
|
76
|
+
lane: LaneRecord;
|
|
77
|
+
host: string;
|
|
78
|
+
audience: SeniorRef;
|
|
79
|
+
}
|
|
80
|
+
export interface OutpostQuestionListError {
|
|
81
|
+
host: string;
|
|
82
|
+
error: string;
|
|
83
|
+
}
|
|
84
|
+
export interface OutpostQuestionLoad {
|
|
85
|
+
questions: PrimaryOwnedOutpostQuestion[];
|
|
86
|
+
errors: OutpostQuestionListError[];
|
|
87
|
+
}
|
|
88
|
+
export interface OutpostQuestionRow {
|
|
89
|
+
question: QuestionRecord;
|
|
90
|
+
audience: SeniorRef;
|
|
91
|
+
}
|
|
92
|
+
export interface QuestionCompanyGroup {
|
|
93
|
+
company: LaneCompanyRef | null;
|
|
94
|
+
lanes: LaneRecord[];
|
|
95
|
+
}
|
|
96
|
+
export interface LaneAccountsHandlerDeps {
|
|
97
|
+
automaticBalanceMoveHistoryReason(ctx: Ctx, lane: LaneRecord): AccountHistoryEntry["reason"];
|
|
98
|
+
ensureDir(dir: string): void;
|
|
99
|
+
laneWithRecoveredProviderSession(hqRoot: string, lane: LaneRecord): LaneRecord;
|
|
100
|
+
loadClaudeBalanceHostSnapshots(ctx: Ctx, hqRoot: string, config: LanesConfig): Promise<{
|
|
101
|
+
snapshots: BalanceHostSnapshot[];
|
|
102
|
+
unavailableHosts: BalanceHostGap[];
|
|
103
|
+
}>;
|
|
104
|
+
parseRemoteJson(stdout: string, surface: string): Record<string, unknown> | null;
|
|
105
|
+
prepareAccountMove(ctx: Ctx, lane: LaneRecord, input: {
|
|
106
|
+
account: string;
|
|
107
|
+
cliModel: undefined;
|
|
108
|
+
accountHistoryReason: AccountHistoryEntry["reason"];
|
|
109
|
+
deferTurnStart: true;
|
|
110
|
+
}): Promise<{
|
|
111
|
+
lane: LaneRecord;
|
|
112
|
+
from: string | null;
|
|
113
|
+
to: string;
|
|
114
|
+
}>;
|
|
115
|
+
printJson(value: unknown): void;
|
|
116
|
+
reconcileHostFromCtx(ctx: Ctx): ReconcileHost;
|
|
117
|
+
resolveCallerPath(callerCwd: string, filePath: string): string;
|
|
118
|
+
}
|
|
119
|
+
export interface LaneQuestionsHandlerDeps {
|
|
120
|
+
CAPACITY_PROBE_TIMEOUT_MS: number;
|
|
121
|
+
MAX_PLACEMENT_OUTPOSTS: number;
|
|
122
|
+
OUTPOST_QUESTION_LOOKUP_CONCURRENCY: number;
|
|
123
|
+
assertLaneRunsHereForOperatorMutation(ctx: Ctx, lane: LaneRecord, action: string): void;
|
|
124
|
+
assertQuestionCompanyMatchesLane(question: QuestionRecord, lane: Pick<LaneRecord, "lane_id" | "company" | "mesh_company" | "project_id">, code: string, hqRoot?: string): void;
|
|
125
|
+
casUpdateQuestion(hqRoot: string, questionId: string, updater: (current: QuestionRecord) => QuestionRecord): QuestionRecord;
|
|
126
|
+
effectiveLaneQuestionCompany(lane: Pick<LaneRecord, "company" | "mesh_company" | "project_id" | "lane_id">, hqRoot?: string): LaneCompanyRef | null;
|
|
127
|
+
emitLaneMeshEvent(ctx: Ctx, company: LaneCompanyRef | null | undefined, threadId: string | undefined, event: LaneMeshEvent, payload: Record<string, unknown>): Promise<void>;
|
|
128
|
+
groupQuestionLanesByCompany(hqRoot: string, lanes: LaneRecord[], fallbackCompany?: LaneCompanyRef): QuestionCompanyGroup[];
|
|
129
|
+
isQuestionAnswer(value: unknown): value is QuestionAnswer;
|
|
130
|
+
laneIsHostedHere(ctx: Ctx, lane: LaneRecord): boolean;
|
|
131
|
+
livenessDepsFromCtx(ctx: Ctx): LivenessDeps;
|
|
132
|
+
loadAllLanes(hqRoot: string): LaneRecord[];
|
|
133
|
+
loadAllQuestions(hqRoot: string): QuestionRecord[];
|
|
134
|
+
mapWithConcurrency<T, R>(values: readonly T[], concurrency: number, map: (value: T, index: number) => Promise<R>): Promise<R[]>;
|
|
135
|
+
mintMessageId(): string;
|
|
136
|
+
parseOutpostQuestionAudience(raw: unknown, outpostId: string, index: number): SeniorRef;
|
|
137
|
+
parseOutpostQuestionBody(raw: unknown, outpostId: string, questionId: string): QuestionBody | null;
|
|
138
|
+
parseRemoteJson(stdout: string, surface: string): Record<string, unknown> | null;
|
|
139
|
+
parseSeniorRef(raw: string): SeniorRef;
|
|
140
|
+
questionCompanyForLane(question: QuestionRecord, lane: Pick<LaneRecord, "company" | "mesh_company" | "project_id" | "lane_id">, hqRoot?: string): LaneCompanyRef | null;
|
|
141
|
+
questionCompanyRefMatches(recordCompany: LaneCompanyRef | null | undefined, filter: LaneCompanyRef): boolean;
|
|
142
|
+
questionListCompanyArg(company: LaneCompanyRef | null): string | undefined;
|
|
143
|
+
readOutpostQuestionRecords(ctx: Ctx, outpostId: string, company: LaneCompanyRef | null): Promise<OutpostQuestionRow[]>;
|
|
144
|
+
readQuestionBody(hqRoot: string, question: QuestionRecord): QuestionBody | null;
|
|
145
|
+
printJson(value: unknown): void;
|
|
146
|
+
readSessionMeta(hqRoot: string, sessionId: string, ctx: Ctx): Record<string, unknown> | null;
|
|
147
|
+
reconcileHostFromCtx(ctx: Ctx): ReconcileHost;
|
|
148
|
+
resolveActiveQuestionCompany(ctx: Ctx, message?: string): Promise<LaneCompanyRef>;
|
|
149
|
+
resolveAudience(hqRoot: string, question: QuestionRecord, ctx: Ctx): SeniorRef;
|
|
150
|
+
sameQuestionAnswer(left: QuestionAnswer | undefined, right: QuestionAnswer): boolean;
|
|
151
|
+
sameQuestionCompany(a: LaneCompanyRef | null, b: LaneCompanyRef | null): boolean;
|
|
152
|
+
seniorOfSession(hqRoot: string, sessionId: string, ctx: Ctx): SeniorRef;
|
|
153
|
+
writeAnswerDeliveryFailed(hqRoot: string, laneId: string, questionId: string, err: unknown, at: string): void;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=lanes-shared.d.ts.map
|
package/dist/commands/lanes.d.ts
CHANGED
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
* `watch` and the monitor reminder are the line-oriented text surfaces.
|
|
7
7
|
*/
|
|
8
8
|
import { Command } from "commander";
|
|
9
|
+
import type { LanesMesh, SpawnLoginResult } from "./lanes-shared.js";
|
|
10
|
+
export type { LanesMesh, SpawnLoginResult } from "./lanes-shared.js";
|
|
11
|
+
export { resolveAnswerChoice } from "./lanes-questions.js";
|
|
9
12
|
import type { OutpostIdentity } from "../lib/lanes/admission-host.js";
|
|
10
13
|
export { OUTPOST_DIR, OUTPOST_ID_PATH, readOutpostIdentity } from "../lib/lanes/admission-host.js";
|
|
11
14
|
export type { OutpostIdentity } from "../lib/lanes/admission-host.js";
|
|
12
15
|
import { type OutpostDispatchResult } from "../lib/lanes/outpost-dispatch.js";
|
|
13
|
-
import { emitLaneDecisionEvents
|
|
16
|
+
import { emitLaneDecisionEvents } from "../lib/lanes/mesh-events.js";
|
|
14
17
|
import { MAX_LANE_DEPTH, withLaneHireLocks, type LaneCompanyRef, type QuestionBody, type LaneRecord, type QuestionRecord, type ResolvedLaneWorker, type SeniorRef, type LivenessDeps, type MachineIdentity, type MonitorEvidenceReader, type RunCommand, type ThrottleDeps } from "../lib/lanes/index.js";
|
|
15
18
|
import { questionBodyAbsPath } from "../lib/lanes/questions.js";
|
|
16
19
|
import { type RunCompactionFn } from "../lib/lanes/compaction.js";
|
|
@@ -21,11 +24,7 @@ export { spawnLaneWorker };
|
|
|
21
24
|
export { questionBodyAbsPath };
|
|
22
25
|
export { MAX_LANE_DEPTH };
|
|
23
26
|
export declare const LANES_RUNS_REL: string;
|
|
24
|
-
export interface SpawnLoginResult {
|
|
25
|
-
status: number;
|
|
26
|
-
}
|
|
27
27
|
/** The lane → mesh seam. Defined in lib/lanes/mesh-events.ts; the watcher shares it. */
|
|
28
|
-
export type LanesMesh = LaneMesh;
|
|
29
28
|
export { emitLaneDecisionEvents };
|
|
30
29
|
export interface LanesCommandDeps {
|
|
31
30
|
hqRoot?: () => string;
|
|
@@ -98,7 +97,6 @@ export interface LanesCommandDeps {
|
|
|
98
97
|
}
|
|
99
98
|
export declare const LANE_OUTPOST_LOAD_BALANCING_FLAG = "lanes.outpost-load-balancing";
|
|
100
99
|
export declare function parseSeniorRef(raw: string): SeniorRef;
|
|
101
|
-
export declare function resolveAnswerChoice(choice: string, options: string[], freeform: boolean): string;
|
|
102
100
|
export declare function parseQuestionBody(raw: unknown): QuestionBody | null;
|
|
103
101
|
/**
|
|
104
102
|
* Spec §5.1: `hq lanes ask` from inside a lane can hit a binary or dist
|