@indigoai-us/hq-cli 5.345.10 → 5.345.12

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/assets/scaffold/core/scripts/hq-delegate-grant.sh +11 -4
  3. package/assets/scaffold/core/scripts/hq-delegate-send.sh +11 -4
  4. package/assets/scaffold/core/scripts/hq-job-probe.sh +11 -4
  5. package/assets/scaffold/core/scripts/jobs-validate.sh +11 -4
  6. package/assets/scaffold/core/scripts/register-project.sh +5 -5
  7. package/assets/scaffold/core/scripts/repo-run-registry.sh +8 -8
  8. package/assets/scaffold/core/scripts/resume-thread-lock.sh +4 -4
  9. package/assets/scaffold/core/scripts/session-journal.sh +3 -3
  10. package/assets/scaffold/core/scripts/verify-story-deliverables.sh +1 -1
  11. package/assets/scaffold/core/scripts/worktree-gc.sh +1 -1
  12. package/dist/commands/core-delegate-w1b.js +4 -1
  13. package/dist/commands/core-handoff.js +69 -34
  14. package/dist/commands/core-hq-session-native.js +31 -6
  15. package/dist/commands/core-job-notify-fast.d.ts +2 -0
  16. package/dist/commands/core-job-notify-fast.js +6 -0
  17. package/dist/commands/core-job-probe-fast.d.ts +2 -0
  18. package/dist/commands/core-job-probe-fast.js +11 -0
  19. package/dist/commands/core-job-probe-native.js +1 -1
  20. package/dist/commands/core-job-remediate-fast.d.ts +2 -0
  21. package/dist/commands/core-job-remediate-fast.js +6 -0
  22. package/dist/commands/core-job-run-fast.d.ts +2 -0
  23. package/dist/commands/core-job-run-fast.js +6 -0
  24. package/dist/commands/core-pin-fast.d.ts +2 -0
  25. package/dist/commands/core-pin-fast.js +15 -0
  26. package/dist/commands/core-rebuild-index-fast.d.ts +6 -0
  27. package/dist/commands/core-rebuild-index-fast.js +39 -0
  28. package/dist/commands/core-register-project-native.js +11 -2
  29. package/dist/commands/core-repo-run-registry-native.js +47 -4
  30. package/dist/commands/core-session-journal-native.d.ts +1 -1
  31. package/dist/commands/core-session-journal-native.js +4 -4
  32. package/dist/commands/core-session-project-native.js +2 -1
  33. package/dist/commands/core-share-suggestion-state-native.js +6 -2
  34. package/dist/commands/core-work-mesh-live-rebind-native.js +5 -2
  35. package/dist/commands/core-worker-lint-fast.d.ts +2 -0
  36. package/dist/commands/core-worker-lint-fast.js +11 -0
  37. package/dist/commands/core.js +9 -6
  38. package/dist/fast-scaffold.js +49 -0
  39. package/dist/lib/checkpoint-ontology/merge-copies.d.ts +4 -3
  40. package/dist/lib/core-utils/worktree-resume.d.ts +1 -0
  41. package/dist/lib/core-utils/worktree-resume.js +68 -31
  42. package/dist/lib/daemon/catalog.d.ts +10 -0
  43. package/dist/lib/daemon/catalog.js +8 -0
  44. package/dist/lib/daemon/lanes-reconcile-guard.d.ts +43 -0
  45. package/dist/lib/daemon/lanes-reconcile-guard.js +115 -0
  46. package/dist/lib/daemon/ops/journal.d.ts +0 -1
  47. package/dist/lib/daemon/ops/journal.js +1 -1
  48. package/dist/lib/daemon/ops/mcp.d.ts +0 -1
  49. package/dist/lib/daemon/ops/mcp.js +1 -1
  50. package/dist/lib/daemon/ops/policy.d.ts +0 -7
  51. package/dist/lib/daemon/ops/policy.js +1 -1
  52. package/dist/lib/daemon/run.js +2 -0
  53. package/dist/lib/daemon/supervisor.d.ts +2 -0
  54. package/dist/lib/daemon/supervisor.js +28 -0
  55. package/dist/lib/doctor/checks/sync-health.d.ts +0 -2
  56. package/dist/lib/doctor/checks/sync-health.js +1 -1
  57. package/dist/lib/lanes/admission.d.ts +0 -2
  58. package/dist/lib/lanes/admission.js +2 -2
  59. package/dist/lib/lanes/autopilot-metrics.d.ts +5 -4
  60. package/dist/lib/lanes/autopilot-registry.d.ts +2 -5
  61. package/dist/lib/lanes/autopilot-registry.js +4 -4
  62. package/dist/lib/lanes/compaction.d.ts +2 -1
  63. package/dist/lib/lanes/delivery.d.ts +0 -2
  64. package/dist/lib/lanes/delivery.js +1 -1
  65. package/dist/lib/lanes/hooks-install.d.ts +0 -1
  66. package/dist/lib/lanes/hooks-install.js +1 -1
  67. package/dist/lib/lanes/merge-command.d.ts +2 -1
  68. package/dist/lib/lanes/orphans.d.ts +0 -1
  69. package/dist/lib/lanes/orphans.js +1 -1
  70. package/dist/lib/lanes/outpost-worktree-pruner.d.ts +3 -2
  71. package/dist/lib/lanes/provider-rejection.d.ts +0 -1
  72. package/dist/lib/lanes/provider-rejection.js +1 -1
  73. package/dist/lib/lanes/reconcile.d.ts +0 -5
  74. package/dist/lib/lanes/reconcile.js +4 -4
  75. package/dist/lib/lanes/runaway-tool-guard.d.ts +1 -1
  76. package/dist/lib/lanes/spawn.d.ts +1 -7
  77. package/dist/lib/lanes/spawn.js +4 -4
  78. package/dist/lib/lanes/throttle.d.ts +0 -1
  79. package/dist/lib/lanes/throttle.js +1 -1
  80. package/dist/lib/lanes/types.d.ts +6 -5
  81. package/dist/lib/lanes/watcher.d.ts +0 -9
  82. package/dist/lib/lanes/watcher.js +2 -2
  83. package/dist/lib/mesh/live/daemon/legacy-listen.d.ts +0 -3
  84. package/dist/lib/mesh/live/daemon/legacy-listen.js +3 -3
  85. package/dist/lib/mesh/live/paths.d.ts +0 -1
  86. package/dist/lib/mesh/live/paths.js +1 -1
  87. package/dist/lib/mesh/live/spool.d.ts +0 -8
  88. package/dist/lib/mesh/live/spool.js +3 -3
  89. package/dist/lib/mesh/story-status.d.ts +2 -7
  90. package/dist/lib/mesh/story-status.js +2 -2
  91. package/dist/lib/sync-invalid-entity-warning.d.ts +0 -1
  92. package/dist/lib/sync-invalid-entity-warning.js +1 -1
  93. package/dist/lib/work-context/atomic.d.ts +0 -4
  94. package/dist/lib/work-context/atomic.js +1 -1
  95. package/dist/lib/work-context/contract.d.ts +2 -3
  96. package/dist/lib/work-context/contract.js +1 -1
  97. package/dist/lib/work-context/preflight-contract.d.ts +2 -7
  98. package/dist/lib/work-context/preflight-contract.js +1 -1
  99. package/dist/lib/work-context/repo-remote.d.ts +2 -1
  100. package/dist/utils/manifest.d.ts +0 -2
  101. package/dist/utils/manifest.js +2 -2
  102. package/dist/utils/resident-package-preload.d.ts +0 -5
  103. package/dist/utils/resident-package-preload.js +1 -1
  104. package/dist/utils/run-bundled-script.js +1 -1
  105. package/dist/utils/version-gate.d.ts +2 -2
  106. package/package.json +1 -1
@@ -3,7 +3,7 @@ export interface AutopilotMetricsLead {
3
3
  lane_id: string;
4
4
  project_id: string;
5
5
  }
6
- export interface AutopilotMetricsLane {
6
+ interface AutopilotMetricsLane {
7
7
  lane_id: string;
8
8
  project_id: string;
9
9
  story_id: string;
@@ -67,7 +67,7 @@ export interface BuildAutopilotMetricsReportInput {
67
67
  nudgeDefects: readonly AutopilotMetricsDefect[];
68
68
  seniorResumes: readonly AutopilotMetricsResume[];
69
69
  }
70
- export interface AutopilotMetricsDay {
70
+ interface AutopilotMetricsDay {
71
71
  team: string;
72
72
  day: string;
73
73
  operator_nudges: number;
@@ -76,7 +76,7 @@ export interface AutopilotMetricsDay {
76
76
  review_latency_minutes_average: number | null;
77
77
  idle_slot_minutes_ready_work: number;
78
78
  }
79
- export interface AutopilotReviewLatency {
79
+ interface AutopilotReviewLatency {
80
80
  team: string;
81
81
  lane_id: string;
82
82
  story_id: string;
@@ -85,7 +85,7 @@ export interface AutopilotReviewLatency {
85
85
  minutes: number;
86
86
  end_event: "review_record" | "senior_resume" | "story_closed";
87
87
  }
88
- export interface AutopilotNudgeDefect extends AutopilotMetricsDefect {
88
+ interface AutopilotNudgeDefect extends AutopilotMetricsDefect {
89
89
  wake: null;
90
90
  }
91
91
  export interface AutopilotMetricsReport {
@@ -96,4 +96,5 @@ export interface AutopilotMetricsReport {
96
96
  nudge_defects: AutopilotNudgeDefect[];
97
97
  }
98
98
  export declare function buildAutopilotMetricsReport(input: BuildAutopilotMetricsReportInput): AutopilotMetricsReport;
99
+ export {};
99
100
  //# sourceMappingURL=autopilot-metrics.d.ts.map
@@ -1,7 +1,5 @@
1
1
  import type { LaneCompanyRef, LaneHost } from "./types.js";
2
- export declare const OUTPOST_LEAD_REGISTRY_SCHEMA = "hq-lanes-outpost-lead-registry.v1";
3
- export declare const OUTPOST_LEAD_REGISTRY_MAX_AGE_MS: number;
4
- export declare const OUTPOST_LEAD_REGISTRY_REFRESH_MS: number;
2
+ declare const OUTPOST_LEAD_REGISTRY_SCHEMA = "hq-lanes-outpost-lead-registry.v1";
5
3
  export declare const LEAD_REGISTRY_REL: string;
6
4
  export declare const OUTPOST_LEAD_REGISTRY_STATE_REL: string;
7
5
  export declare const LEAD_AUTOPILOT_FLAG = "lanes.lead-autopilot";
@@ -23,8 +21,6 @@ export declare function buildOutpostLeadRegistry(input: {
23
21
  outpostId: string;
24
22
  generatedAt: string;
25
23
  }): OutpostLeadRegistry;
26
- /** Stage a host-filtered registry on the Outpost using an atomic local rename. */
27
- export declare function buildOutpostLeadRegistryInstallCommand(registry: OutpostLeadRegistry): string;
28
24
  export declare function syncOutpostLeadRegistries(input: {
29
25
  hqRoot: string;
30
26
  outpostIds: readonly string[];
@@ -59,4 +55,5 @@ export declare function validateOutpostLeadRegistry(input: {
59
55
  outpostId: string;
60
56
  now: Date;
61
57
  }): OutpostLeadRegistry;
58
+ export {};
62
59
  //# sourceMappingURL=autopilot-registry.d.ts.map
@@ -4,9 +4,9 @@ import * as path from "node:path";
4
4
  import { joinCommandParts, withRemoteHqDir } from "@indigoai-us/hq-cloud/outposts";
5
5
  import { isControllerAliasOutpostId } from "./admission-host.js";
6
6
  import { LanesError } from "./errors.js";
7
- export const OUTPOST_LEAD_REGISTRY_SCHEMA = "hq-lanes-outpost-lead-registry.v1";
8
- export const OUTPOST_LEAD_REGISTRY_MAX_AGE_MS = 24 * 60 * 60 * 1000;
9
- export const OUTPOST_LEAD_REGISTRY_REFRESH_MS = 6 * 60 * 60 * 1000;
7
+ const OUTPOST_LEAD_REGISTRY_SCHEMA = "hq-lanes-outpost-lead-registry.v1";
8
+ const OUTPOST_LEAD_REGISTRY_MAX_AGE_MS = 24 * 60 * 60 * 1000;
9
+ const OUTPOST_LEAD_REGISTRY_REFRESH_MS = 6 * 60 * 60 * 1000;
10
10
  export const LEAD_REGISTRY_REL = path.join("workspace", "lane-briefs", "juniors.json");
11
11
  export const OUTPOST_LEAD_REGISTRY_STATE_REL = path.join("workspace", "lane-briefs", "autopilot-outpost-registry-state.json");
12
12
  export const LEAD_AUTOPILOT_FLAG = "lanes.lead-autopilot";
@@ -50,7 +50,7 @@ export function buildOutpostLeadRegistry(input) {
50
50
  };
51
51
  }
52
52
  /** Stage a host-filtered registry on the Outpost using an atomic local rename. */
53
- export function buildOutpostLeadRegistryInstallCommand(registry) {
53
+ function buildOutpostLeadRegistryInstallCommand(registry) {
54
54
  const encoded = Buffer.from(`${JSON.stringify(registry)}\n`, "utf8").toString("base64");
55
55
  const script = [
56
56
  'const fs=require("node:fs"),path=require("node:path");',
@@ -65,7 +65,7 @@ export declare function probeProviderCompactions(transcriptPath: string | null,
65
65
  export declare function findSessionTranscript(home: string, sessionId: string): string | null;
66
66
  /** Count compact boundaries in a transcript. Other lines are never parsed. */
67
67
  export declare function probeCompactBoundaries(transcriptPath: string | null): CompactBoundaryProbe;
68
- export interface CompactionCommandResult {
68
+ interface CompactionCommandResult {
69
69
  status: number | null;
70
70
  error?: string;
71
71
  }
@@ -107,4 +107,5 @@ export declare function compactLaneSession(input: CompactLaneSessionInput): Lane
107
107
  * compaction's `resume_at`.
108
108
  */
109
109
  export declare function compactionAfterUsage(lane: LaneRecord): LaneRunUsage | null;
110
+ export {};
110
111
  //# sourceMappingURL=compaction.d.ts.map
@@ -69,8 +69,6 @@ export type LaneDeliveryMechanism = (typeof LANE_DELIVERY_MECHANISMS)[number];
69
69
  /** Additional presentation-only result used by `hq lanes show`. */
70
70
  export type LaneShowDeliveryMechanism = LaneDeliveryMechanism | "questions";
71
71
  export type DeliveryLane = Pick<LaneRecord, "state" | "provider" | "provider_session_id" | "terminal_reason" | "envelope_repair">;
72
- /** Only the terminal result of a failed automatic envelope repair is recoverable. */
73
- export declare function isFailedEnvelopeRepairLane(lane: DeliveryLane): boolean;
74
72
  /**
75
73
  * `dropbox`: a process is (or is about to be) alive to drain the inbox.
76
74
  * `resume`: the process has exited, the provider can resume, the state allows
@@ -88,7 +88,7 @@ export function isResumeCommandState(state) {
88
88
  }
89
89
  export const LANE_DELIVERY_MECHANISMS = ["dropbox", "resume", "none"];
90
90
  /** Only the terminal result of a failed automatic envelope repair is recoverable. */
91
- export function isFailedEnvelopeRepairLane(lane) {
91
+ function isFailedEnvelopeRepairLane(lane) {
92
92
  return (lane.state === "failed" &&
93
93
  lane.terminal_reason === ENVELOPE_INVALID_REASON &&
94
94
  lane.envelope_repair?.attempted === true &&
@@ -20,7 +20,6 @@
20
20
  import type { LaneProvider } from "./types.js";
21
21
  export declare const DRAIN_HOOK_BASENAME = "hq-lanes-drain";
22
22
  export declare const DRAIN_HOOK_TIMEOUT_SECONDS = 30;
23
- export declare function drainHookEntryPath(): string;
24
23
  export declare function lanesHookAssetsDir(): string;
25
24
  export declare const DRAIN_HOOK_REGISTRATION_KINDS: readonly ["hooks_dir", "settings_json", "config_toml"];
26
25
  export type DrainHookRegistrationKind = (typeof DRAIN_HOOK_REGISTRATION_KINDS)[number];
@@ -28,7 +28,7 @@ export const DRAIN_HOOK_TIMEOUT_SECONDS = 30;
28
28
  function shellQuote(value) {
29
29
  return `'${value.replaceAll("'", "'\\''")}'`;
30
30
  }
31
- export function drainHookEntryPath() {
31
+ function drainHookEntryPath() {
32
32
  return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../dist/lanes-drain-hook.js");
33
33
  }
34
34
  export function lanesHookAssetsDir() {
@@ -1,4 +1,4 @@
1
- export interface MergeCommandTarget {
1
+ interface MergeCommandTarget {
2
2
  kind: "pr" | "api" | "graphql" | "git";
3
3
  repo: string | null;
4
4
  pr: number | null;
@@ -12,4 +12,5 @@ export interface MergeCommandParseResult {
12
12
  }
13
13
  export declare function canonicalRepo(raw: string): string;
14
14
  export declare function parseMergeCommands(command: string): MergeCommandParseResult;
15
+ export {};
15
16
  //# sourceMappingURL=merge-command.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { type LaneRecord, type SeniorRef } from "./types.js";
2
- export declare const DEFAULT_ORPHAN_MIN_AGE_MINUTES = 30;
3
2
  export declare const DEFAULT_ORPHAN_USER_IDLE_HOURS = 72;
4
3
  export interface OrphanLaneFinding {
5
4
  lane_id: string;
@@ -1,6 +1,6 @@
1
1
  import { LanesError } from "./errors.js";
2
2
  import { isTerminalLaneState } from "./types.js";
3
- export const DEFAULT_ORPHAN_MIN_AGE_MINUTES = 30;
3
+ const DEFAULT_ORPHAN_MIN_AGE_MINUTES = 30;
4
4
  export const DEFAULT_ORPHAN_USER_IDLE_HOURS = 72;
5
5
  const LIVE_LANE_STATES = new Set(["running", "queued", "blocked", "awaiting_input"]);
6
6
  export function parseOrphanMinAge(value) {
@@ -18,14 +18,14 @@ export interface OutpostWorktreePrunerOptions {
18
18
  /** Test seam for /proc reads; production uses the host filesystem. */
19
19
  processPathReader?: ProcessPathReader;
20
20
  }
21
- export interface ProcessPathReader {
21
+ interface ProcessPathReader {
22
22
  readdirSync(path: string): string[];
23
23
  readlinkSync(path: string): string;
24
24
  uid(path: string): number;
25
25
  /** Test seam for read-only process identity checks used by the cwd exception. */
26
26
  readFileSync?(path: string): string;
27
27
  }
28
- export interface PackageStorePruneResult {
28
+ interface PackageStorePruneResult {
29
29
  attempted: boolean;
30
30
  reason?: string;
31
31
  bytes_freed?: number;
@@ -58,4 +58,5 @@ export interface OutpostWorktreePrunerResult {
58
58
  */
59
59
  export declare function runOutpostWorktreePruner(options: OutpostWorktreePrunerOptions): OutpostWorktreePrunerResult;
60
60
  export declare const OUTPOST_WORKTREE_PRUNER_DEFAULT_MIN_AGE_DAYS = 14;
61
+ export {};
61
62
  //# sourceMappingURL=outpost-worktree-pruner.d.ts.map
@@ -38,7 +38,6 @@ export interface ProviderRejection {
38
38
  event: "codex.turn.failed" | "claude.result.is_error" | "claude.result.login_failure" | "grok.error";
39
39
  }
40
40
  export declare function isProviderLoginFailure(failure: ProviderRejection | null): boolean;
41
- export declare function capMessage(message: string): string;
42
41
  /**
43
42
  * Whether a later run could succeed without the operator changing anything.
44
43
  * A 400 model rejection cannot; a request timeout, a too-early, or a server
@@ -100,7 +100,7 @@ function statusOf(value) {
100
100
  ? value
101
101
  : null;
102
102
  }
103
- export function capMessage(message) {
103
+ function capMessage(message) {
104
104
  return message.length > PROVIDER_REJECTION_MESSAGE_CAP
105
105
  ? `${message.slice(0, PROVIDER_REJECTION_MESSAGE_CAP)}…`
106
106
  : message;
@@ -19,11 +19,6 @@ export declare const QUESTION_AGE_MS: number;
19
19
  export declare const MAX_AGED_ADVANCES: number;
20
20
  /** Aligns with watcher silence: a host that has not reported for this long is dead. */
21
21
  export declare const DEAD_HOST_MS: number;
22
- export declare const RECONCILE_LOCK_STALE_MS = 30000;
23
- export declare const RECONCILE_LOCK_TIMEOUT_MS = 5000;
24
- /** A pickup probe that has not cleared its marker within this window is abandoned. */
25
- export declare const PICKUP_VALIDATION_MAX_AGE_MS: number;
26
- export declare const PICKUP_VALIDATION_TIMEOUT_REASON: "pickup_validation_timeout";
27
22
  export declare const CLOSE_INTERRUPTED_DONE_STORY_WORKERS_FLAG = "lanes.close-interrupted-done-story-workers";
28
23
  export declare const RECONCILE_UNIT_NAME = "hq-lanes-reconcile.service";
29
24
  export declare const RECONCILE_TIMER_NAME = "hq-lanes-reconcile.timer";
@@ -45,11 +45,11 @@ export const QUESTION_AGE_MS = 60 * 60 * 1000;
45
45
  export const MAX_AGED_ADVANCES = MAX_LANE_DEPTH - 1;
46
46
  /** Aligns with watcher silence: a host that has not reported for this long is dead. */
47
47
  export const DEAD_HOST_MS = SILENCE_MS;
48
- export const RECONCILE_LOCK_STALE_MS = 30_000;
49
- export const RECONCILE_LOCK_TIMEOUT_MS = 5_000;
48
+ const RECONCILE_LOCK_STALE_MS = 30_000;
49
+ const RECONCILE_LOCK_TIMEOUT_MS = 5_000;
50
50
  /** A pickup probe that has not cleared its marker within this window is abandoned. */
51
- export const PICKUP_VALIDATION_MAX_AGE_MS = 15 * 60 * 1000;
52
- export const PICKUP_VALIDATION_TIMEOUT_REASON = "pickup_validation_timeout";
51
+ const PICKUP_VALIDATION_MAX_AGE_MS = 15 * 60 * 1000;
52
+ const PICKUP_VALIDATION_TIMEOUT_REASON = "pickup_validation_timeout";
53
53
  export const CLOSE_INTERRUPTED_DONE_STORY_WORKERS_FLAG = "lanes.close-interrupted-done-story-workers";
54
54
  const INTERRUPTED_DONE_STORY_MIN_AGE_MS = 24 * 60 * 60 * 1000;
55
55
  export const RECONCILE_UNIT_NAME = "hq-lanes-reconcile.service";
@@ -10,7 +10,7 @@ export interface RunawayProcessInfo {
10
10
  cwd: string;
11
11
  starttime: number | null;
12
12
  }
13
- export interface RunawayLaneProcess {
13
+ interface RunawayLaneProcess {
14
14
  laneId: string;
15
15
  agentPid: number;
16
16
  agentStarttime: number;
@@ -26,8 +26,6 @@ export declare function providerCommandOnPath(command: string, pathEnv: string |
26
26
  /** Per-provider model flag. A missing entry means --model is refused. */
27
27
  export declare const PROVIDER_MODEL_FLAG: Record<LaneProvider, string>;
28
28
  export declare const CLAUDE_AUTO_COMPACT_ENV = "CLAUDE_CODE_AUTO_COMPACT_WINDOW";
29
- /** Codex CLI overrides required for its ChatGPT fast service tier. */
30
- export declare const CODEX_FAST_MODE_FLAGS: readonly ["-c", "service_tier=\"fast\"", "--enable", "fast_mode"];
31
29
  export declare function parseCliModel(raw: string | undefined): string | undefined;
32
30
  export declare function resolveLaneModel(input: {
33
31
  cliModel?: string;
@@ -39,14 +37,12 @@ type AutomaticAccountChangeReason = Exclude<AccountHistoryEntry["reason"], "oper
39
37
  /** Change account only after a provider/runtime account failure, then re-admit. */
40
38
  export declare function retryLaneOnAlternateAccount(hqRoot: string, lane: LaneRecord, reason: Extract<AutomaticAccountChangeReason, "usage_limit" | "account_unavailable">, writer?: "watcher" | "reconcile", deps?: SpawnLaneDeps): Promise<LaneRecord>;
41
39
  export declare function appendModelFlag(provider: LaneProvider, args: string[], model: string | undefined): string[];
42
- /** Add Codex fast-mode flags before the prompt/positional separator. */
43
- export declare function appendFastModeFlags(provider: LaneProvider, args: string[], enabled: boolean | undefined): string[];
44
40
  export interface ProviderProfileLaunch {
45
41
  systemPrompt: string;
46
42
  settingsPath?: string;
47
43
  ignoredFields?: readonly string[];
48
44
  }
49
- export type DetachedStdio = ["ignore", number, number];
45
+ type DetachedStdio = ["ignore", number, number];
50
46
  export interface DetachedSpawnOptions {
51
47
  detached: true;
52
48
  windowsHide: true;
@@ -120,7 +116,6 @@ export interface PidLivenessProbe {
120
116
  }
121
117
  export declare function missingPidProbe(): PidLivenessProbe;
122
118
  export declare function defaultPidIsAlive(pid: number): boolean;
123
- export declare const STOP_TERM_WAIT_MS = 500;
124
119
  export declare function parseSpawnTerminalReason(value: string): SpawnTerminalReason;
125
120
  export declare function laneRunDir(hqRoot: string, laneId: string): string;
126
121
  export declare function watcherMainPath(): string;
@@ -130,7 +125,6 @@ export declare function readProcStarttimeDetailed(pid: number): {
130
125
  error: string | null;
131
126
  };
132
127
  export declare function readProcStarttime(pid: number): number | null;
133
- export declare function formatPidRecord(rec: PidRecord): string;
134
128
  export declare function parsePidRecord(text: string): PidRecord | null;
135
129
  export declare function readPidRecord(filePath: string): PidRecord | null;
136
130
  export declare function writePidRecord(filePath: string, rec: PidRecord): void;
@@ -148,7 +148,7 @@ export const PROVIDER_MODEL_FLAG = {
148
148
  };
149
149
  export const CLAUDE_AUTO_COMPACT_ENV = "CLAUDE_CODE_AUTO_COMPACT_WINDOW";
150
150
  /** Codex CLI overrides required for its ChatGPT fast service tier. */
151
- export const CODEX_FAST_MODE_FLAGS = [
151
+ const CODEX_FAST_MODE_FLAGS = [
152
152
  "-c",
153
153
  'service_tier="fast"',
154
154
  "--enable",
@@ -625,7 +625,7 @@ export function appendModelFlag(provider, args, model) {
625
625
  return [...args, flag, model];
626
626
  }
627
627
  /** Add Codex fast-mode flags before the prompt/positional separator. */
628
- export function appendFastModeFlags(provider, args, enabled) {
628
+ function appendFastModeFlags(provider, args, enabled) {
629
629
  if (provider !== "codex" || enabled !== true)
630
630
  return args;
631
631
  const flags = [...CODEX_FAST_MODE_FLAGS];
@@ -719,7 +719,7 @@ export function defaultPidIsAlive(pid) {
719
719
  throw err;
720
720
  }
721
721
  }
722
- export const STOP_TERM_WAIT_MS = 500;
722
+ const STOP_TERM_WAIT_MS = 500;
723
723
  const defaultSpawnProcess = (command, args, options) => spawn(command, args, options);
724
724
  function defaultKillProcess(pid, signal = "SIGTERM") {
725
725
  process.kill(pid, signal);
@@ -787,7 +787,7 @@ export function readProcStarttimeDetailed(pid) {
787
787
  export function readProcStarttime(pid) {
788
788
  return readProcStarttimeDetailed(pid).starttime;
789
789
  }
790
- export function formatPidRecord(rec) {
790
+ function formatPidRecord(rec) {
791
791
  return rec.starttime !== undefined ? `${rec.pid} ${rec.starttime}\n` : `${rec.pid}\n`;
792
792
  }
793
793
  export function parsePidRecord(text) {
@@ -13,7 +13,6 @@ import * as fs from "node:fs";
13
13
  import * as os from "node:os";
14
14
  import type { ThrottleConfig } from "./types.js";
15
15
  export declare const CPU_SAMPLE_MS = 5000;
16
- export declare const CPU_CUMULATIVE_MAX_AGE_MS: number;
17
16
  export declare const STARVATION_MAX_DEFERRALS = 10;
18
17
  export declare const STARVATION_MAX_MS: number;
19
18
  export declare const PROC_MEMINFO = "/proc/meminfo";
@@ -16,7 +16,7 @@ import { DEFAULT_CPU_BUSY_PAUSE, DEFAULT_CPU_BUSY_RESUME, DEFAULT_MIN_AVAILABLE_
16
16
  // Reconcile normally measures the interval between cumulative CPU snapshots.
17
17
  // A five-second window establishes a baseline or recovers from stale counters.
18
18
  export const CPU_SAMPLE_MS = 5_000;
19
- export const CPU_CUMULATIVE_MAX_AGE_MS = 5 * 60 * 1000;
19
+ const CPU_CUMULATIVE_MAX_AGE_MS = 5 * 60 * 1000;
20
20
  export const STARVATION_MAX_DEFERRALS = 10;
21
21
  export const STARVATION_MAX_MS = 30 * 60 * 1000;
22
22
  export const PROC_MEMINFO = "/proc/meminfo";
@@ -179,7 +179,7 @@ export declare const LANE_PROVIDERS: readonly ["claude", "codex", "grok"];
179
179
  export type LaneProvider = (typeof LANE_PROVIDERS)[number];
180
180
  export declare const QUEUED_REASONS: readonly ["cap", "provider_cap", "account_cap", "profile_cap", "queue_position", "throttle", "provider_binary_missing", "account_retry", "lead_reserve", "worker_profile_changed", "low_disk", "admit_failed"];
181
181
  export type QueuedReason = (typeof QUEUED_REASONS)[number];
182
- export type QueuedDetails = {
182
+ type QueuedDetails = {
183
183
  reason: "worker_profile_changed";
184
184
  expected_hash: string | null;
185
185
  actual_hash: string;
@@ -308,7 +308,7 @@ export interface SeniorHistoryEntry {
308
308
  by: string;
309
309
  reason: string;
310
310
  }
311
- export interface LaneStopHistoryEntry {
311
+ interface LaneStopHistoryEntry {
312
312
  at: string;
313
313
  reason: string;
314
314
  }
@@ -370,7 +370,7 @@ export interface AttributionHistoryEntry {
370
370
  at: string;
371
371
  story_switch_unacknowledged?: StorySwitchUnacknowledgedNote;
372
372
  }
373
- export interface StorySwitchPending {
373
+ interface StorySwitchPending {
374
374
  previous_project_id: string;
375
375
  previous_story_id: string;
376
376
  project_id: string;
@@ -416,7 +416,7 @@ export interface ManagerStatusGateHistoryEntry {
416
416
  resume_queued?: boolean;
417
417
  resume_skipped_reason?: "open_question" | "blocked" | "miss_limit" | "no_provider_session";
418
418
  }
419
- export interface BlockerFreshnessState {
419
+ interface BlockerFreshnessState {
420
420
  /** Stable hashes of the stale blocker labels seen at the last completed turn. */
421
421
  stale_keys: string[];
422
422
  stale_labels: string[];
@@ -440,7 +440,7 @@ export interface BlockerFreshnessHistoryEntry {
440
440
  reason?: string;
441
441
  delivery_recovered?: true;
442
442
  }
443
- export interface KrFreshnessState {
443
+ interface KrFreshnessState {
444
444
  /** Stable fingerprint of the last stalled KPI set, which is resumed once. */
445
445
  stalled_fingerprint?: string;
446
446
  }
@@ -1044,4 +1044,5 @@ export interface LanesConfig {
1044
1044
  export declare function isIsoDateTime(value: string): boolean;
1045
1045
  export declare function parseMajorSchema(schemaVersion: string, expectedPrefix: string, expectedMajor: number): void;
1046
1046
  export declare function parseLaneEnvelope(raw: unknown): LaneEnvelope;
1047
+ export {};
1047
1048
  //# sourceMappingURL=types.d.ts.map
@@ -42,8 +42,6 @@ import { type EnvelopeRepairSpawnInput, type SpawnLaneDeps } from "./spawn.js";
42
42
  export declare const SILENCE_MS: number;
43
43
  export declare const WATCHER_POLL_MS = 5000;
44
44
  export declare const ENVELOPE_REPAIR_CONTINUE_TEXT = "continue the task; the previous turn ended without an envelope.";
45
- /** Synced last_host_report_at cadence. Reconcile dead-host TTL is 20 minutes. */
46
- export declare const WATCHER_HEARTBEAT_MS: number;
47
45
  /**
48
46
  * Cap on logs/watcher.out. A decision line is typically under 300 bytes, so
49
47
  * 256 KiB holds hundreds of transitions. A stuck lane cannot fill the disk:
@@ -164,13 +162,6 @@ export declare function stalledReason(silenceMs: number): string;
164
162
  export declare function markLaneStalled(hqRoot: string, laneId: string, at: string, reason: string): LaneRecord;
165
163
  export declare function clearLaneStalled(hqRoot: string, laneId: string): LaneRecord;
166
164
  export declare function applyTerminalToLane(hqRoot: string, laneId: string, classification: TerminalClassification, opts?: ApplyTerminalOpts): LaneRecord;
167
- /** Terminal write outcome for emitters: only the CAS winner may publish mesh effects. */
168
- export declare function applyTerminalToLaneWithResult(hqRoot: string, laneId: string, classification: TerminalClassification, opts?: ApplyTerminalOpts): {
169
- record: LaneRecord;
170
- changed: boolean;
171
- envelope?: LaneEnvelope;
172
- classification: TerminalClassification;
173
- };
174
165
  export declare function isPidAlive(pid: number): boolean;
175
166
  export interface LatestEnvelope {
176
167
  envelope: LaneEnvelope;
@@ -63,7 +63,7 @@ export const SILENCE_MS = 20 * 60 * 1000;
63
63
  export const WATCHER_POLL_MS = 5_000;
64
64
  export const ENVELOPE_REPAIR_CONTINUE_TEXT = "continue the task; the previous turn ended without an envelope.";
65
65
  /** Synced last_host_report_at cadence. Reconcile dead-host TTL is 20 minutes. */
66
- export const WATCHER_HEARTBEAT_MS = 60 * 1000;
66
+ const WATCHER_HEARTBEAT_MS = 60 * 1000;
67
67
  /**
68
68
  * Cap on logs/watcher.out. A decision line is typically under 300 bytes, so
69
69
  * 256 KiB holds hundreds of transitions. A stuck lane cannot fill the disk:
@@ -333,7 +333,7 @@ export function applyTerminalToLane(hqRoot, laneId, classification, opts = {}) {
333
333
  return applyTerminalToLaneWithResult(hqRoot, laneId, classification, opts).record;
334
334
  }
335
335
  /** Terminal write outcome for emitters: only the CAS winner may publish mesh effects. */
336
- export function applyTerminalToLaneWithResult(hqRoot, laneId, classification, opts = {}) {
336
+ function applyTerminalToLaneWithResult(hqRoot, laneId, classification, opts = {}) {
337
337
  const at = opts.at ?? new Date().toISOString();
338
338
  const envelopeRef = opts.envelopeRef ?? "envelopes/unknown.json";
339
339
  const existing = readLane(hqRoot, laneId);
@@ -6,9 +6,6 @@
6
6
  * Windows: Scheduled Task ai.getindigo.hq-work-mesh-listen
7
7
  */
8
8
  export type LegacyListenPlatform = "darwin" | "linux" | "win32" | "other";
9
- export declare const LEGACY_LISTEN_LABEL = "ai.getindigo.hq-work-mesh-listen";
10
- export declare const LEGACY_LISTEN_SYSTEMD_UNIT = "hq-work-mesh-listen.service";
11
- export declare const LEGACY_LISTEN_TASK = "ai.getindigo.hq-work-mesh-listen";
12
9
  export declare const LEGACY_LISTENER_DOCTOR_LINE = "legacy listener still installed";
13
10
  export interface CommandResult {
14
11
  status: number | null;
@@ -8,9 +8,9 @@
8
8
  import * as fs from "node:fs";
9
9
  import * as path from "node:path";
10
10
  import { spawnSync } from "node:child_process";
11
- export const LEGACY_LISTEN_LABEL = "ai.getindigo.hq-work-mesh-listen";
12
- export const LEGACY_LISTEN_SYSTEMD_UNIT = "hq-work-mesh-listen.service";
13
- export const LEGACY_LISTEN_TASK = LEGACY_LISTEN_LABEL;
11
+ const LEGACY_LISTEN_LABEL = "ai.getindigo.hq-work-mesh-listen";
12
+ const LEGACY_LISTEN_SYSTEMD_UNIT = "hq-work-mesh-listen.service";
13
+ const LEGACY_LISTEN_TASK = LEGACY_LISTEN_LABEL;
14
14
  export const LEGACY_LISTENER_DOCTOR_LINE = "legacy listener still installed";
15
15
  export function legacyListenPlistPath(home) {
16
16
  return path.join(home, "Library", "LaunchAgents", `${LEGACY_LISTEN_LABEL}.plist`);
@@ -2,7 +2,6 @@
2
2
  * Local Work Mesh Live paths under ~/.hq/work-mesh/.
3
3
  * Injectable root for tests (never touch the real HOME in unit tests).
4
4
  */
5
- export declare const WORK_MESH_DIRNAME = "work-mesh";
6
5
  export declare function workMeshRoot(home?: string, env?: NodeJS.ProcessEnv): string;
7
6
  export declare function workMeshSpoolPath(root?: string): string;
8
7
  export declare function workMeshHeldPath(root?: string): string;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as os from "node:os";
6
6
  import * as path from "node:path";
7
- export const WORK_MESH_DIRNAME = "work-mesh";
7
+ const WORK_MESH_DIRNAME = "work-mesh";
8
8
  export function workMeshRoot(home = os.homedir(), env = process.env) {
9
9
  const override = env.HQ_WORK_MESH_ROOT?.trim();
10
10
  if (override)
@@ -19,8 +19,6 @@ export declare function ensureSpoolFile(filePath: string): void;
19
19
  export declare function appendJsonlLine(filePath: string, line: string): void;
20
20
  export declare function appendSpoolLine(line: string, root?: string): string;
21
21
  export declare function appendHeldLine(line: string, root?: string): string;
22
- /** Append a held envelope only when its eventId is not already held. */
23
- export declare function appendHeldLineIfAbsent(line: string, root?: string): boolean;
24
22
  /** Append a deduplicated held batch under one file lock and one write. */
25
23
  export declare function appendHeldLinesIfAbsent(lines: string[], root?: string): number;
26
24
  export declare function appendDeadLetterLine(line: string, root?: string): string;
@@ -36,12 +34,6 @@ export interface ClaimResult {
36
34
  export declare function claimJsonlByRename(sourcePath: string, claimPath: string): ClaimResult;
37
35
  export declare function claimSpool(root: string, ts?: string): ClaimResult;
38
36
  export declare function claimHeld(root: string, ts?: string): ClaimResult;
39
- /**
40
- * List orphan claim files left by a crash mid-flush.
41
- * Process these before claiming live spool/held (idempotent).
42
- */
43
- export declare function listOrphanClaimFiles(root: string): string[];
44
- export declare function readClaimFileLines(claimPath: string): string[];
45
37
  /**
46
38
  * Recover orphaned claim files: read their lines and return paths to unlink
47
39
  * after the flush dispositions them.
@@ -70,7 +70,7 @@ export function appendHeldLine(line, root) {
70
70
  return held;
71
71
  }
72
72
  /** Append a held envelope only when its eventId is not already held. */
73
- export function appendHeldLineIfAbsent(line, root) {
73
+ function appendHeldLineIfAbsent(line, root) {
74
74
  return appendHeldLinesIfAbsent([line], root) === 1;
75
75
  }
76
76
  /** Append a deduplicated held batch under one file lock and one write. */
@@ -266,7 +266,7 @@ const ORPHAN_CLAIM_RE = /^(spool|held)\..+\.claimed$/;
266
266
  * List orphan claim files left by a crash mid-flush.
267
267
  * Process these before claiming live spool/held (idempotent).
268
268
  */
269
- export function listOrphanClaimFiles(root) {
269
+ function listOrphanClaimFiles(root) {
270
270
  if (!fs.existsSync(root))
271
271
  return [];
272
272
  const names = fs.readdirSync(root);
@@ -278,7 +278,7 @@ export function listOrphanClaimFiles(root) {
278
278
  }
279
279
  return out.sort();
280
280
  }
281
- export function readClaimFileLines(claimPath) {
281
+ function readClaimFileLines(claimPath) {
282
282
  if (!fs.existsSync(claimPath))
283
283
  return [];
284
284
  try {
@@ -1,11 +1,5 @@
1
- export declare const BOARD_STORY_STATUSES: readonly ["queued", "in_progress", "review", "done"];
1
+ declare const BOARD_STORY_STATUSES: readonly ["queued", "in_progress", "review", "done"];
2
2
  export type BoardStoryStatus = (typeof BOARD_STORY_STATUSES)[number];
3
- /**
4
- * The ledger has more states than the Board. `blocked` and the review states
5
- * need attention, while `dropped` is terminal; the Board has only one terminal
6
- * column (`done`).
7
- */
8
- export declare const LEDGER_STATE_TO_BOARD_STATUS: Readonly<Record<string, BoardStoryStatus>>;
9
3
  export declare function mapSourceStoryStatus(story: {
10
4
  status?: unknown;
11
5
  state?: unknown;
@@ -19,4 +13,5 @@ export declare function mapReaderStoryStatus(story: {
19
13
  status?: unknown;
20
14
  state?: unknown;
21
15
  }): string | undefined;
16
+ export {};
22
17
  //# sourceMappingURL=story-status.d.ts.map
@@ -1,11 +1,11 @@
1
- export const BOARD_STORY_STATUSES = ["queued", "in_progress", "review", "done"];
1
+ const BOARD_STORY_STATUSES = ["queued", "in_progress", "review", "done"];
2
2
  const boardStoryStatusSet = new Set(BOARD_STORY_STATUSES);
3
3
  /**
4
4
  * The ledger has more states than the Board. `blocked` and the review states
5
5
  * need attention, while `dropped` is terminal; the Board has only one terminal
6
6
  * column (`done`).
7
7
  */
8
- export const LEDGER_STATE_TO_BOARD_STATUS = {
8
+ const LEDGER_STATE_TO_BOARD_STATUS = {
9
9
  todo: "queued",
10
10
  in_progress: "in_progress",
11
11
  in_review: "review",
@@ -1,7 +1,6 @@
1
1
  import type { FlagClient, FlagClientOptions } from "@indigoai-us/hq-flags-client";
2
2
  export declare const SYNC_INVALID_ENTITY_WARNING_FLAG = "sync.warn-invalid-ontology-entities";
3
3
  export declare const SYNC_INVALID_ENTITY_WARNING_FALLBACK = false;
4
- export declare const SYNC_INVALID_ENTITY_WARNING_TIMEOUT_MS = 1500;
5
4
  type FlagClientLike = Pick<FlagClient, "ready" | "isEnabled" | "close">;
6
5
  export interface InvalidEntityFrontmatter {
7
6
  path: string;
@@ -6,7 +6,7 @@ import * as yaml from "js-yaml";
6
6
  import { resolveFlagRegistryEndpoint } from "./flag-registry-endpoint.js";
7
7
  export const SYNC_INVALID_ENTITY_WARNING_FLAG = "sync.warn-invalid-ontology-entities";
8
8
  export const SYNC_INVALID_ENTITY_WARNING_FALLBACK = false;
9
- export const SYNC_INVALID_ENTITY_WARNING_TIMEOUT_MS = 1500;
9
+ const SYNC_INVALID_ENTITY_WARNING_TIMEOUT_MS = 1500;
10
10
  const ENTITY_TYPES = new Set([
11
11
  "person", "project", "company", "concept", "product", "tool",
12
12
  "tool/technology", "model", "platform", "contact", "deal", "contract",
@@ -10,9 +10,5 @@ export declare function resolveRealTarget(target: string): string;
10
10
  * Ensure parent dir exists as a real directory (not a symlink), mode 0700.
11
11
  */
12
12
  export declare function ensureOwnerDir(dir: string): string;
13
- /**
14
- * Atomically replace target with data at mode 0600 (same-dir tmp + rename).
15
- */
16
- export declare function atomicWriteFile(target: string, data: string | Buffer): void;
17
13
  export declare function atomicWriteJson(target: string, value: unknown): void;
18
14
  //# sourceMappingURL=atomic.d.ts.map
@@ -87,7 +87,7 @@ export function ensureOwnerDir(dir) {
87
87
  /**
88
88
  * Atomically replace target with data at mode 0600 (same-dir tmp + rename).
89
89
  */
90
- export function atomicWriteFile(target, data) {
90
+ function atomicWriteFile(target, data) {
91
91
  const realTarget = resolveRealTarget(target);
92
92
  const dir = ensureOwnerDir(path.dirname(realTarget));
93
93
  const finalPath = path.join(dir, path.basename(realTarget));
@@ -21,9 +21,7 @@ export type LifecycleState = "open" | "terminal";
21
21
  export type ContextResultKind = "bound" | "needs_company" | "company_conflict" | "needs_project" | "needs_task" | "queued" | "untracked" | "migration_pending" | "incompatible" | "error";
22
22
  export declare const CLASSIFICATION_STATES: readonly ClassificationState[];
23
23
  export declare const CONTEXT_RESULT_KINDS: readonly ContextResultKind[];
24
- /** Local-only classification: no tenant read or write. */
25
- export declare const LOCAL_ONLY_CLASSIFICATION: ReadonlySet<ClassificationState>;
26
- export interface SessionIdentity {
24
+ interface SessionIdentity {
27
25
  sessionId: string;
28
26
  providerSessionId?: string;
29
27
  harness?: string;
@@ -91,4 +89,5 @@ export declare function normalizeTaskId(input: {
91
89
  export declare function isLocalOnlyClassification(state: ClassificationState): boolean;
92
90
  /** Content classes prohibited in durable work-context state. */
93
91
  export declare const WORK_CONTEXT_PROHIBITED_CONTENT_CLASSES: readonly ["prompts", "model_output", "transcripts", "message_bodies", "tokens", "credentials"];
92
+ export {};
94
93
  //# sourceMappingURL=contract.d.ts.map