@indigoai-us/hq-cli 5.126.0 → 5.128.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 +218 -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/core-utils/sentry-report.d.ts +2 -0
- package/dist/lib/core-utils/sentry-report.js +47 -7
- 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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic reconcile pass (spec §5.7, §6.8, §9).
|
|
3
|
+
*
|
|
4
|
+
* Owned by the machine, not by any lane. Reads never mutate; every write is a
|
|
5
|
+
* compare-and-set. The per-lane watcher owns progress/terminal/silence of a
|
|
6
|
+
* live process — this pass owns the transitions no single lane can own.
|
|
7
|
+
*/
|
|
8
|
+
import { type LivenessDeps } from "./liveness.js";
|
|
9
|
+
import { type EnvelopeRepairSpawnInput, type SpawnLaneDeps } from "./spawn.js";
|
|
10
|
+
import { type ThrottleDeps } from "./throttle.js";
|
|
11
|
+
import type { LaneRecord, LivenessState, QuestionRecord, SeniorRef } from "./types.js";
|
|
12
|
+
import { type LaneMesh } from "./mesh-events.js";
|
|
13
|
+
/** Spec §9: unanswered at the current hop for 60 minutes → one hop. */
|
|
14
|
+
export declare const QUESTION_AGE_MS: number;
|
|
15
|
+
/** Spec §6.6 + §9: v1 permits exactly one aged advance. */
|
|
16
|
+
export declare const MAX_AGED_ADVANCES = 1;
|
|
17
|
+
/** Aligns with watcher silence: a host that has not reported for this long is dead. */
|
|
18
|
+
export declare const DEAD_HOST_MS: number;
|
|
19
|
+
export declare const RECONCILE_LOCK_STALE_MS = 30000;
|
|
20
|
+
export declare const RECONCILE_LOCK_TIMEOUT_MS = 5000;
|
|
21
|
+
export declare const RECONCILE_UNIT_NAME = "hq-lanes-reconcile.service";
|
|
22
|
+
export declare const RECONCILE_TIMER_NAME = "hq-lanes-reconcile.timer";
|
|
23
|
+
export interface ReconcileSkip {
|
|
24
|
+
kind: "lane" | "question" | "store" | "throttle" | "liveness";
|
|
25
|
+
id?: string;
|
|
26
|
+
why: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ReconcileChange {
|
|
29
|
+
id: string;
|
|
30
|
+
from?: string;
|
|
31
|
+
to?: string;
|
|
32
|
+
reason?: string;
|
|
33
|
+
/** The attempted provider PATH when admission found no executable. */
|
|
34
|
+
searched_path?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ReconcileSummary {
|
|
37
|
+
ok: boolean;
|
|
38
|
+
action: "reconcile";
|
|
39
|
+
dry_run: boolean;
|
|
40
|
+
admitted: ReconcileChange[];
|
|
41
|
+
overdue: ReconcileChange[];
|
|
42
|
+
aged: ReconcileChange[];
|
|
43
|
+
advanced: ReconcileChange[];
|
|
44
|
+
resumed: ReconcileChange[];
|
|
45
|
+
dead_host: ReconcileChange[];
|
|
46
|
+
heartbeats: string[];
|
|
47
|
+
skipped: ReconcileSkip[];
|
|
48
|
+
errors: Array<{
|
|
49
|
+
message: string;
|
|
50
|
+
code?: string;
|
|
51
|
+
}>;
|
|
52
|
+
heartbeat_at: string | null;
|
|
53
|
+
}
|
|
54
|
+
export interface ReconcileHost {
|
|
55
|
+
hostname: string;
|
|
56
|
+
outpostId: string | null;
|
|
57
|
+
}
|
|
58
|
+
export interface ReconcileDeps {
|
|
59
|
+
now: () => Date;
|
|
60
|
+
host: ReconcileHost;
|
|
61
|
+
dryRun: boolean;
|
|
62
|
+
spawn?: (hqRoot: string, lane: LaneRecord) => LaneRecord;
|
|
63
|
+
spawnRepair?: (hqRoot: string, lane: LaneRecord, input: EnvelopeRepairSpawnInput) => number;
|
|
64
|
+
spawnLaneDeps?: SpawnLaneDeps;
|
|
65
|
+
throttleDeps?: ThrottleDeps;
|
|
66
|
+
livenessDeps?: LivenessDeps;
|
|
67
|
+
isAlive?: (pid: number) => boolean;
|
|
68
|
+
readSessionSenior?: (sessionId: string) => SeniorRef;
|
|
69
|
+
presenceConnected?: boolean;
|
|
70
|
+
env?: NodeJS.ProcessEnv;
|
|
71
|
+
/** Detached mesh seam for dead-watcher recovery. */
|
|
72
|
+
mesh?: LaneMesh | null;
|
|
73
|
+
/** Bound on one terminal mesh emit during dead-host recovery. Default 10 s. */
|
|
74
|
+
meshEmitTimeoutMs?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Awaited after lane/question records and liveness are loaded, before any
|
|
77
|
+
* CAS write. Test seam so two in-process passes can share a snapshot.
|
|
78
|
+
*/
|
|
79
|
+
afterLoad?: () => Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
export declare function reconcileHeartbeatPath(hqRoot: string): string;
|
|
82
|
+
export declare function timeoutPath(hqRoot: string, laneId: string): string;
|
|
83
|
+
export declare function laneRunsHere(lane: LaneRecord, host: ReconcileHost): boolean;
|
|
84
|
+
export declare function agedAdvanceCount(question: QuestionRecord): number;
|
|
85
|
+
export declare function currentHopStartedAtMs(question: QuestionRecord): number;
|
|
86
|
+
export declare function shouldAgeQuestion(question: QuestionRecord, audience: SeniorRef, nowMs: number): boolean;
|
|
87
|
+
export declare function shouldAdvanceAudienceEnded(audience: SeniorRef, liveness: LivenessState | null): boolean;
|
|
88
|
+
export declare function readTimeoutDeadline(hqRoot: string, laneId: string): {
|
|
89
|
+
deadline_at: string;
|
|
90
|
+
timeout_secs?: number;
|
|
91
|
+
} | null;
|
|
92
|
+
export declare function isDeadlinePassed(deadlineAt: string, nowMs: number): boolean;
|
|
93
|
+
export declare function resolveQuestionAudience(question: QuestionRecord, readLaneSenior: (laneId: string) => SeniorRef, readSessionSenior: (sessionId: string) => SeniorRef): SeniorRef;
|
|
94
|
+
/** Unlocked pass body. `runReconcilePass` takes the process lock around this. */
|
|
95
|
+
export declare function runPassBody(hqRoot: string, deps: ReconcileDeps): Promise<ReconcileSummary>;
|
|
96
|
+
/**
|
|
97
|
+
* One idempotent reconcile pass. Throws only when the store directory itself
|
|
98
|
+
* cannot be listed; per-record failures are logged onto the summary and set
|
|
99
|
+
* `ok: false` rather than being swallowed.
|
|
100
|
+
*/
|
|
101
|
+
export declare function runReconcilePass(hqRoot: string, deps: ReconcileDeps): Promise<ReconcileSummary>;
|
|
102
|
+
//# sourceMappingURL=reconcile.d.ts.map
|