@indigoai-us/hq-cli 5.126.0 → 5.127.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 +211 -0
- package/assets/lanes-hooks/hq-lanes-drain.json +15 -0
- package/assets/lanes-hooks/hq-lanes-drain.mjs +254 -0
- package/assets/lanes-hooks/hq-lanes-drain.sh +21 -0
- package/assets/lanes-reconcile/hq-lanes-reconcile.service +11 -0
- package/assets/lanes-reconcile/hq-lanes-reconcile.timer +12 -0
- package/dist/command-catalog.generated.d.ts +245 -11
- package/dist/command-catalog.generated.js +323 -11
- package/dist/command-registration-plan.d.ts +1 -0
- package/dist/command-registration-plan.js +11 -2
- package/dist/commands/agents.d.ts +12 -0
- package/dist/commands/agents.js +46 -2
- package/dist/commands/lanes.d.ts +55 -16
- package/dist/commands/lanes.js +1187 -250
- package/dist/commands/mesh.js +254 -19
- package/dist/lib/lanes/accounts.d.ts +67 -7
- package/dist/lib/lanes/accounts.js +233 -43
- package/dist/lib/lanes/compaction.d.ts +96 -0
- package/dist/lib/lanes/compaction.js +197 -0
- package/dist/lib/lanes/config.d.ts +15 -0
- package/dist/lib/lanes/config.js +65 -8
- package/dist/lib/lanes/delivery.d.ts +151 -0
- package/dist/lib/lanes/delivery.js +354 -0
- package/dist/lib/lanes/dropbox.d.ts +96 -0
- package/dist/lib/lanes/dropbox.js +408 -0
- package/dist/lib/lanes/effort.d.ts +50 -0
- package/dist/lib/lanes/effort.js +109 -0
- package/dist/lib/lanes/errors.d.ts +2 -2
- package/dist/lib/lanes/hooks-install.d.ts +81 -0
- package/dist/lib/lanes/hooks-install.js +326 -0
- package/dist/lib/lanes/hq-root.d.ts +19 -0
- package/dist/lib/lanes/hq-root.js +28 -0
- package/dist/lib/lanes/index.d.ts +35 -5
- package/dist/lib/lanes/index.js +19 -4
- package/dist/lib/lanes/liveness.d.ts +7 -1
- package/dist/lib/lanes/liveness.js +64 -5
- package/dist/lib/lanes/machine-identity.d.ts +34 -0
- package/dist/lib/lanes/machine-identity.js +92 -0
- package/dist/lib/lanes/mesh-events.d.ts +109 -0
- package/dist/lib/lanes/mesh-events.js +275 -0
- package/dist/lib/lanes/outpost-dispatch.d.ts +65 -0
- package/dist/lib/lanes/outpost-dispatch.js +90 -0
- package/dist/lib/lanes/questions.d.ts +75 -0
- package/dist/lib/lanes/questions.js +243 -0
- package/dist/lib/lanes/quota.d.ts +95 -0
- package/dist/lib/lanes/quota.js +320 -0
- package/dist/lib/lanes/reconcile-install.d.ts +69 -0
- package/dist/lib/lanes/reconcile-install.js +221 -0
- package/dist/lib/lanes/reconcile.d.ts +102 -0
- package/dist/lib/lanes/reconcile.js +985 -0
- package/dist/lib/lanes/registry.d.ts +18 -5
- package/dist/lib/lanes/registry.js +293 -19
- package/dist/lib/lanes/spawn.d.ts +274 -0
- package/dist/lib/lanes/spawn.js +1363 -0
- package/dist/lib/lanes/store.d.ts +7 -3
- package/dist/lib/lanes/store.js +150 -32
- package/dist/lib/lanes/types.d.ts +346 -4
- package/dist/lib/lanes/types.js +138 -5
- package/dist/lib/lanes/watcher-main.d.ts +9 -0
- package/dist/lib/lanes/watcher-main.js +22 -0
- package/dist/lib/lanes/watcher.d.ts +216 -0
- package/dist/lib/lanes/watcher.js +859 -0
- package/dist/lib/mesh/api.d.ts +71 -7
- package/dist/lib/mesh/api.js +167 -28
- package/dist/lib/mesh/live/backfill-held.d.ts +18 -7
- package/dist/lib/mesh/live/backfill-held.js +66 -21
- package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
- package/dist/lib/mesh/live/daemon/run.js +111 -54
- package/dist/lib/mesh/live/daemon/state.d.ts +2 -0
- package/dist/lib/mesh/live/daemon/transcript-watch.d.ts +3 -0
- package/dist/lib/mesh/live/daemon/transcript-watch.js +31 -8
- package/dist/lib/scan-packages/index.d.ts +2 -0
- package/dist/lib/scan-packages/index.js +1 -1
- package/dist/lib/work-context/state.d.ts +12 -0
- package/dist/lib/work-context/state.js +131 -3
- package/package.json +3 -1
package/dist/commands/lanes.d.ts
CHANGED
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
* `accounts login`, which hands the terminal to the vendor's own sign-in.
|
|
6
6
|
*/
|
|
7
7
|
import { Command } from "commander";
|
|
8
|
-
import { type
|
|
8
|
+
import { type OutpostDispatchResult } from "../lib/lanes/outpost-dispatch.js";
|
|
9
|
+
import { emitLaneDecisionEvents, type LaneMesh } from "../lib/lanes/mesh-events.js";
|
|
10
|
+
import { type LaneCompanyRef, type LaneRecord, type QuestionRecord, type ResolvedLaneWorker, type SeniorRef, type LivenessDeps, type MachineIdentity, type RunCommand, type ThrottleDeps } from "../lib/lanes/index.js";
|
|
11
|
+
import { questionBodyAbsPath } from "../lib/lanes/questions.js";
|
|
12
|
+
import { type RunCompactionFn } from "../lib/lanes/compaction.js";
|
|
13
|
+
import { spawnLaneWorker, type KillProcessFn, type ProveDetachedFn, type SpawnProcessFn } from "../lib/lanes/spawn.js";
|
|
14
|
+
export { spawnLaneWorker };
|
|
15
|
+
export { questionBodyAbsPath };
|
|
9
16
|
export declare const MAX_LANE_DEPTH = 2;
|
|
10
17
|
export declare const OUTPOST_ID_PATH = "/etc/outpost/outpost-id";
|
|
11
18
|
export declare const OUTPOST_DIR = "/etc/outpost";
|
|
@@ -21,13 +28,13 @@ export type OutpostIdentity = {
|
|
|
21
28
|
export interface SpawnLoginResult {
|
|
22
29
|
status: number;
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
patchStoryStatus: (company: LaneCompanyRef, projectId: string, storyId: string, status: string) => Promise<void>;
|
|
28
|
-
}
|
|
31
|
+
/** The lane → mesh seam. Defined in lib/lanes/mesh-events.ts; the watcher shares it. */
|
|
32
|
+
export type LanesMesh = LaneMesh;
|
|
33
|
+
export { emitLaneDecisionEvents };
|
|
29
34
|
export interface LanesCommandDeps {
|
|
30
35
|
hqRoot?: () => string;
|
|
36
|
+
/** Start HQ-root walk here instead of process.cwd(). Tests only. */
|
|
37
|
+
cwd?: () => string;
|
|
31
38
|
env?: NodeJS.ProcessEnv;
|
|
32
39
|
now?: () => Date;
|
|
33
40
|
hostname?: () => string;
|
|
@@ -46,24 +53,55 @@ export interface LanesCommandDeps {
|
|
|
46
53
|
homedir?: () => string;
|
|
47
54
|
mesh?: LanesMesh;
|
|
48
55
|
sleep?: (ms: number) => Promise<void>;
|
|
56
|
+
spawnProcess?: SpawnProcessFn;
|
|
57
|
+
proveDetached?: ProveDetachedFn;
|
|
58
|
+
killProcess?: KillProcessFn;
|
|
59
|
+
isAlive?: (pid: number) => boolean;
|
|
60
|
+
stopSleepMs?: (ms: number) => void;
|
|
61
|
+
livenessDeps?: LivenessDeps;
|
|
62
|
+
presenceConnected?: boolean;
|
|
63
|
+
systemdRoot?: string;
|
|
64
|
+
runSystemctl?: RunCommand;
|
|
65
|
+
resolveMachineIdentity?: () => MachineIdentity;
|
|
66
|
+
stageOutpostPayload?: (outpostId: string, bytes: Uint8Array) => Promise<{
|
|
67
|
+
getUrl: string;
|
|
68
|
+
}>;
|
|
69
|
+
dispatchOutpostExec?: (input: {
|
|
70
|
+
outpostId: string;
|
|
71
|
+
command: string;
|
|
72
|
+
}) => Promise<OutpostDispatchResult>;
|
|
73
|
+
fetchText?: (url: string) => Promise<string>;
|
|
74
|
+
runCompaction?: RunCompactionFn;
|
|
75
|
+
locateTranscript?: (home: string, sessionId: string) => string | null;
|
|
49
76
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Spawn seam for the worker process (spec §5). Process spawning and the
|
|
52
|
-
* reconcile daemon are out of scope for this command surface; calling this
|
|
53
|
-
* throws rather than faking a running lane.
|
|
54
|
-
*/
|
|
55
|
-
export declare function spawnLaneWorker(lane: LaneRecord): never;
|
|
56
77
|
export declare function readOutpostIdentity(existsSync?: (p: string) => boolean, readFileSync?: (p: string) => string): OutpostIdentity;
|
|
57
78
|
export declare function parseSeniorRef(raw: string): SeniorRef;
|
|
58
79
|
export declare function resolveAnswerChoice(choice: string, options: string[], freeform: boolean): string;
|
|
59
|
-
/**
|
|
60
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Spec §5.1: `hq lanes ask` from inside a lane can hit a binary or dist
|
|
82
|
+
* being replaced mid-call (ENOENT / ETXTBSY / a module that no longer
|
|
83
|
+
* resolves) or a record written by a newer CLI. Three attempts, waits of
|
|
84
|
+
* 5 s then 15 s, 20 s of backoff in total, inside the 30 s bound.
|
|
85
|
+
*/
|
|
86
|
+
export declare const ASK_BACKOFF_MS: readonly [5000, 15000];
|
|
87
|
+
export declare const ASK_ATTEMPTS: number;
|
|
61
88
|
export declare function casUpdateQuestion(hqRoot: string, questionId: string, updater: (current: QuestionRecord) => QuestionRecord): QuestionRecord;
|
|
62
89
|
export declare function casUpdateLane(hqRoot: string, laneId: string, updater: (current: LaneRecord) => LaneRecord): LaneRecord;
|
|
90
|
+
/**
|
|
91
|
+
* Spec §5.3: an approval gate ends the run. The lane stops at each
|
|
92
|
+
* checkpoint with a `decision: ask` envelope whose question names it; the
|
|
93
|
+
* reconcile pass resumes the lane once every question is answered.
|
|
94
|
+
*/
|
|
95
|
+
export declare function checkpointInstruction(worker: Pick<ResolvedLaneWorker, "approvalRequired" | "humanCheckpoints">): string;
|
|
63
96
|
export declare function composeWorkerBrief(worker: ResolvedLaneWorker, taskBrief: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* A lane with no worker still carries the standing authorization paragraph
|
|
99
|
+
* and the foreground-only rule.
|
|
100
|
+
*/
|
|
101
|
+
export declare function composeGeneralBrief(taskBrief: string): string;
|
|
64
102
|
export declare function parseMaxRuntimeSeconds(raw: unknown, workerId: string): number | undefined;
|
|
65
|
-
export declare function emitLaneDecisionEvents(mesh: LanesMesh, lane: LaneRecord, decision: "blocked" | "done", extra?: Record<string, unknown>): Promise<void>;
|
|
66
103
|
export declare const PICKUP_TERMINAL_REASONS: readonly ["account_not_logged_in", "unknown_account", "account_disabled"];
|
|
104
|
+
export declare const DISPATCH_TERMINAL_REASON: "outpost_dispatch_failed";
|
|
67
105
|
export type PickupTerminalReason = (typeof PICKUP_TERMINAL_REASONS)[number];
|
|
68
106
|
/**
|
|
69
107
|
* Outpost-side account bind (spec §5.2). Writes a named terminal reason,
|
|
@@ -71,5 +109,6 @@ export type PickupTerminalReason = (typeof PICKUP_TERMINAL_REASONS)[number];
|
|
|
71
109
|
*/
|
|
72
110
|
export declare function applyOutpostAccountPickup(hqRoot: string, laneId: string): LaneRecord;
|
|
73
111
|
export declare function cancelPendingQuestionsForLane(hqRoot: string, laneId: string, nowIso: string, operatorReason?: string): QuestionRecord[];
|
|
74
|
-
export declare function
|
|
112
|
+
export declare function stopCommittedState(state: LaneRecord["state"]): "cancelled" | "killed";
|
|
113
|
+
export declare function registerLanesCommand(parent: Command, deps?: LanesCommandDeps): Command;
|
|
75
114
|
//# sourceMappingURL=lanes.d.ts.map
|