@indigoai-us/hq-cli 5.345.9 → 5.345.11

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 (115) hide show
  1. package/CHANGELOG.md +6 -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/session-journal.sh +3 -3
  7. package/dist/commands/core-delegate-w1b.js +4 -1
  8. package/dist/commands/core-hq-session-native.js +5 -1
  9. package/dist/commands/core-session-journal-native.js +2 -2
  10. package/dist/commands/core-session-project-native.js +2 -1
  11. package/dist/commands/lanes.js +52 -4
  12. package/dist/lib/bot/coding-tool-activity.d.ts +2 -8
  13. package/dist/lib/bot/coding-tool-activity.js +1 -5
  14. package/dist/lib/bot/setup-tool-offer.d.ts +0 -4
  15. package/dist/lib/bot/setup-tool-offer.js +2 -2
  16. package/dist/lib/checkpoint-ontology/merge-copies.d.ts +4 -3
  17. package/dist/lib/checkpoint-ontology/tree.d.ts +0 -1
  18. package/dist/lib/checkpoint-ontology/tree.js +1 -1
  19. package/dist/lib/core-utils/qmd-reindex-after-sync.d.ts +0 -2
  20. package/dist/lib/core-utils/qmd-reindex-after-sync.js +2 -2
  21. package/dist/lib/daemon/convergence.d.ts +0 -2
  22. package/dist/lib/daemon/convergence.js +2 -2
  23. package/dist/lib/daemon/flag-monitor.d.ts +0 -2
  24. package/dist/lib/daemon/flag-monitor.js +2 -2
  25. package/dist/lib/daemon/legacy-sync-env.d.ts +0 -1
  26. package/dist/lib/daemon/legacy-sync-env.js +1 -1
  27. package/dist/lib/daemon/ops/journal.d.ts +0 -1
  28. package/dist/lib/daemon/ops/journal.js +1 -1
  29. package/dist/lib/daemon/ops/mcp.d.ts +0 -1
  30. package/dist/lib/daemon/ops/mcp.js +1 -1
  31. package/dist/lib/daemon/ops/memory.d.ts +0 -2
  32. package/dist/lib/daemon/ops/memory.js +2 -2
  33. package/dist/lib/daemon/ops/policy.d.ts +0 -7
  34. package/dist/lib/daemon/ops/policy.js +1 -1
  35. package/dist/lib/daemon/supervisor.d.ts +0 -1
  36. package/dist/lib/daemon/supervisor.js +1 -1
  37. package/dist/lib/daemon/sync-runner-bundle.d.ts +2 -1
  38. package/dist/lib/daemon/sync-runner-bundle.js +1 -1
  39. package/dist/lib/daemon/sync-runner.d.ts +2 -1
  40. package/dist/lib/doctor/checks/runtime-probe.d.ts +2 -16
  41. package/dist/lib/doctor/checks/runtime-probe.js +2 -2
  42. package/dist/lib/doctor/checks/sync-health.d.ts +0 -2
  43. package/dist/lib/doctor/checks/sync-health.js +1 -1
  44. package/dist/lib/doctor/fix/json-output.d.ts +0 -1
  45. package/dist/lib/doctor/fix/json-output.js +1 -1
  46. package/dist/lib/doctor/platform.d.ts +5 -4
  47. package/dist/lib/lanes/admission.d.ts +0 -2
  48. package/dist/lib/lanes/admission.js +2 -2
  49. package/dist/lib/lanes/autopilot-metrics.d.ts +5 -4
  50. package/dist/lib/lanes/blocker-freshness.d.ts +0 -2
  51. package/dist/lib/lanes/blocker-freshness.js +2 -2
  52. package/dist/lib/lanes/compaction.d.ts +2 -1
  53. package/dist/lib/lanes/config.d.ts +1 -5
  54. package/dist/lib/lanes/config.js +4 -4
  55. package/dist/lib/lanes/delivery.d.ts +0 -2
  56. package/dist/lib/lanes/delivery.js +1 -1
  57. package/dist/lib/lanes/hooks-install.d.ts +0 -1
  58. package/dist/lib/lanes/hooks-install.js +1 -1
  59. package/dist/lib/lanes/keep-alive.d.ts +0 -4
  60. package/dist/lib/lanes/keep-alive.js +3 -3
  61. package/dist/lib/lanes/kr-freshness.d.ts +2 -4
  62. package/dist/lib/lanes/kr-freshness.js +4 -4
  63. package/dist/lib/lanes/merge-command.d.ts +2 -1
  64. package/dist/lib/lanes/orphans.d.ts +0 -1
  65. package/dist/lib/lanes/orphans.js +1 -1
  66. package/dist/lib/lanes/outpost-pruner-install.d.ts +0 -3
  67. package/dist/lib/lanes/outpost-pruner-install.js +3 -3
  68. package/dist/lib/lanes/outpost-worktree-pruner.d.ts +3 -2
  69. package/dist/lib/lanes/provider-rejection.d.ts +0 -1
  70. package/dist/lib/lanes/provider-rejection.js +1 -1
  71. package/dist/lib/lanes/reviews.d.ts +3 -4
  72. package/dist/lib/lanes/reviews.js +3 -3
  73. package/dist/lib/lanes/runaway-tool-guard.d.ts +1 -1
  74. package/dist/lib/lanes/spawn.d.ts +1 -7
  75. package/dist/lib/lanes/spawn.js +4 -4
  76. package/dist/lib/lanes/store.js +1 -1
  77. package/dist/lib/lanes/throttle.d.ts +0 -1
  78. package/dist/lib/lanes/throttle.js +1 -1
  79. package/dist/lib/lanes/types.d.ts +1 -1
  80. package/dist/lib/lanes/watcher.d.ts +0 -9
  81. package/dist/lib/lanes/watcher.js +2 -2
  82. package/dist/lib/mesh/live/daemon/legacy-listen.d.ts +0 -3
  83. package/dist/lib/mesh/live/daemon/legacy-listen.js +3 -3
  84. package/dist/lib/mesh/live/paths.d.ts +0 -1
  85. package/dist/lib/mesh/live/paths.js +1 -1
  86. package/dist/lib/mesh/live/spool.d.ts +0 -8
  87. package/dist/lib/mesh/live/spool.js +3 -3
  88. package/dist/lib/mesh/story-status.d.ts +2 -7
  89. package/dist/lib/mesh/story-status.js +2 -2
  90. package/dist/lib/sync-invalid-entity-warning.d.ts +0 -1
  91. package/dist/lib/sync-invalid-entity-warning.js +1 -1
  92. package/dist/lib/work-context/atomic.d.ts +0 -4
  93. package/dist/lib/work-context/atomic.js +1 -1
  94. package/dist/lib/work-context/bind-best.d.ts +0 -19
  95. package/dist/lib/work-context/bind-best.js +3 -3
  96. package/dist/lib/work-context/contract.d.ts +2 -3
  97. package/dist/lib/work-context/contract.js +1 -1
  98. package/dist/lib/work-context/organize.d.ts +3 -11
  99. package/dist/lib/work-context/organize.js +3 -3
  100. package/dist/lib/work-context/preflight-contract.d.ts +2 -7
  101. package/dist/lib/work-context/preflight-contract.js +1 -1
  102. package/dist/lib/work-context/repo-remote.d.ts +2 -1
  103. package/dist/utils/manifest.d.ts +0 -2
  104. package/dist/utils/manifest.js +2 -2
  105. package/dist/utils/pack-contributions.d.ts +1 -3
  106. package/dist/utils/pack-contributions.js +0 -5
  107. package/dist/utils/package-use-lease.d.ts +0 -7
  108. package/dist/utils/package-use-lease.js +1 -1
  109. package/dist/utils/resident-package-preload.d.ts +0 -5
  110. package/dist/utils/resident-package-preload.js +1 -1
  111. package/dist/utils/resolve-executable.d.ts +0 -1
  112. package/dist/utils/resolve-executable.js +1 -1
  113. package/dist/utils/version-gate.d.ts +4 -4
  114. package/dist/utils/version-gate.js +2 -2
  115. package/package.json +1 -1
@@ -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) {
@@ -987,7 +987,7 @@ function parseLaneAccountSelection(value, filePath) {
987
987
  throw failure("account");
988
988
  if (selection.signal !== "usage" && selection.signal !== "recent_usage" && selection.signal !== "lane_count" && selection.signal !== "explicit")
989
989
  throw failure("signal");
990
- if (selection.reason !== "least_loaded" && selection.reason !== "explicit")
990
+ if (selection.reason !== "least_loaded" && selection.reason !== "explicit" && selection.reason !== "profile_pin_unavailable")
991
991
  throw failure("reason");
992
992
  if (typeof selection.selected_at !== "string" || !Number.isFinite(Date.parse(selection.selected_at)))
993
993
  throw failure("selected_at");
@@ -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";
@@ -284,7 +284,7 @@ export interface LaneAccountSelectionConsidered {
284
284
  export interface LaneAccountSelection {
285
285
  account: string;
286
286
  signal: "usage" | "recent_usage" | "lane_count" | "explicit";
287
- reason: "least_loaded" | "explicit";
287
+ reason: "least_loaded" | "explicit" | "profile_pin_unavailable";
288
288
  target_host: LaneHost;
289
289
  selected_at: string;
290
290
  considered: LaneAccountSelectionConsidered[];
@@ -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));
@@ -8,15 +8,6 @@ export interface BindCandidate {
8
8
  title?: string;
9
9
  score: number;
10
10
  }
11
- export interface CatalogProject {
12
- projectId: string;
13
- title?: string;
14
- repos: string[];
15
- journalMtimeMs?: number;
16
- hasPrd: boolean;
17
- hasBoard: boolean;
18
- prdPath?: string;
19
- }
20
11
  export type RefineAction = {
21
12
  action: "keep";
22
13
  } | {
@@ -33,16 +24,6 @@ export type RefineAction = {
33
24
  reason: string;
34
25
  candidates: BindCandidate[];
35
26
  };
36
- export declare function scoreProject(hint: string, row: CatalogProject, repoPath: string | undefined, nowMs: number): number;
37
- export declare function discoverProjects(input: {
38
- hqRoot?: string;
39
- companySlug?: string;
40
- companyUid?: string;
41
- env?: NodeJS.ProcessEnv;
42
- home?: string;
43
- }): CatalogProject[];
44
- /** discoverProjects memoized by source directory and mtime. A hit does not rescan. */
45
- export declare function discoverProjectsCached(input: Parameters<typeof discoverProjects>[0], nowMs?: number): CatalogProject[];
46
27
  export declare function refineProjectBinding(input: {
47
28
  hint?: string;
48
29
  hqRoot?: string;
@@ -16,7 +16,7 @@ function tokens(value) {
16
16
  .split(/[^a-z0-9]+/)
17
17
  .filter((part) => part.length > 2);
18
18
  }
19
- export function scoreProject(hint, row, repoPath, nowMs) {
19
+ function scoreProject(hint, row, repoPath, nowMs) {
20
20
  const hintL = hint.toLowerCase();
21
21
  const idL = row.projectId.toLowerCase();
22
22
  let score = 0;
@@ -162,7 +162,7 @@ function listProjectDirs(parent, map) {
162
162
  absorbDir(map, dir, name);
163
163
  }
164
164
  }
165
- export function discoverProjects(input) {
165
+ function discoverProjects(input) {
166
166
  const map = new Map();
167
167
  const hqRoot = input.hqRoot?.trim();
168
168
  const slug = input.companySlug?.trim();
@@ -223,7 +223,7 @@ function catalogStamp(input) {
223
223
  }).join("|");
224
224
  }
225
225
  /** discoverProjects memoized by source directory and mtime. A hit does not rescan. */
226
- export function discoverProjectsCached(input, nowMs = Date.now()) {
226
+ function discoverProjectsCached(input, nowMs = Date.now()) {
227
227
  const key = `${input.hqRoot ?? ""}|${input.companySlug ?? ""}|${input.companyUid ?? ""}|${input.home ?? ""}|${catalogStamp(input)}`;
228
228
  if (catalogCache && catalogCache.key === key && nowMs - catalogCache.at < CATALOG_CACHE_TTL_MS) {
229
229
  return catalogCache.rows;
@@ -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
@@ -34,7 +34,7 @@ export const CONTEXT_RESULT_KINDS = [
34
34
  "error",
35
35
  ];
36
36
  /** Local-only classification: no tenant read or write. */
37
- export const LOCAL_ONLY_CLASSIFICATION = new Set(["needs_company", "company_conflict", "untracked"]);
37
+ const LOCAL_ONLY_CLASSIFICATION = new Set(["needs_company", "company_conflict", "untracked"]);
38
38
  /**
39
39
  * Normalize taskId / storyId ingress. taskId is canonical; storyId is alias.
40
40
  * Conflicting dual aliases are rejected.
@@ -7,7 +7,7 @@
7
7
  * never invents a project or adhoc target and never repeats the ask.
8
8
  */
9
9
  import { type SessionDecision, type SessionStateFile } from "./state.js";
10
- export interface OrganizeCandidate {
10
+ interface OrganizeCandidate {
11
11
  candidateId: string;
12
12
  projectId: string;
13
13
  taskId?: string;
@@ -22,7 +22,7 @@ export interface CandidatesResponse {
22
22
  decisionExpiresAt: string;
23
23
  candidates: OrganizeCandidate[];
24
24
  }
25
- export type OrganizeDecisionKind = "bind_existing" | "create_project" | "create_task";
25
+ type OrganizeDecisionKind = "bind_existing" | "create_project" | "create_task";
26
26
  export interface OrganizeSubmitDecision {
27
27
  kind: OrganizeDecisionKind;
28
28
  projectId?: string;
@@ -74,15 +74,6 @@ export type PostOrganizeFn = (input: {
74
74
  expectedVersion: number;
75
75
  decisionExpiresAt?: string;
76
76
  }) => Promise<OrganizeReceipt>;
77
- /** Stable decision id for a session + expiry window. */
78
- export declare function stableDecisionId(sessionId: string, decisionExpiresAt: string): string;
79
- export declare function digestOrganizePayload(parts: {
80
- sessionId: string;
81
- companyUid: string;
82
- decision: OrganizeSubmitDecision;
83
- expectedVersion: number;
84
- }): string;
85
- export declare function stableOrganizeOperationId(sessionId: string, decision: OrganizeSubmitDecision): string;
86
77
  /**
87
78
  * Build a pending decision from server candidates. Soft evidence ranks on the
88
79
  * server; the CLI never auto-binds from this list.
@@ -127,4 +118,5 @@ export declare function submitOrganizeDecision(input: {
127
118
  now?: () => Date;
128
119
  postOrganize?: PostOrganizeFn;
129
120
  }): Promise<OrganizeSubmitResult>;
121
+ export {};
130
122
  //# sourceMappingURL=organize.d.ts.map
@@ -12,7 +12,7 @@ import { NotTrackingError } from "./errors.js";
12
12
  import { shouldAskAfter } from "./project.js";
13
13
  import { mergeLocalSessionFields, readSessionState, writeSessionState, } from "./state.js";
14
14
  /** Stable decision id for a session + expiry window. */
15
- export function stableDecisionId(sessionId, decisionExpiresAt) {
15
+ function stableDecisionId(sessionId, decisionExpiresAt) {
16
16
  const h = crypto
17
17
  .createHash("sha256")
18
18
  .update(`dec:v1:${sessionId}:${decisionExpiresAt}`)
@@ -20,7 +20,7 @@ export function stableDecisionId(sessionId, decisionExpiresAt) {
20
20
  .slice(0, 24);
21
21
  return `dec_${h}`;
22
22
  }
23
- export function digestOrganizePayload(parts) {
23
+ function digestOrganizePayload(parts) {
24
24
  const canonical = JSON.stringify({
25
25
  v: 1,
26
26
  sessionId: parts.sessionId,
@@ -30,7 +30,7 @@ export function digestOrganizePayload(parts) {
30
30
  });
31
31
  return crypto.createHash("sha256").update(canonical).digest("hex").slice(0, 64);
32
32
  }
33
- export function stableOrganizeOperationId(sessionId, decision) {
33
+ function stableOrganizeOperationId(sessionId, decision) {
34
34
  const h = crypto
35
35
  .createHash("sha256")
36
36
  .update(`organize:v1:${sessionId}:${decision.kind}:${decision.projectId ?? ""}:${decision.taskId ?? ""}:${decision.title ?? ""}`)
@@ -11,13 +11,7 @@ import { type ContextResult } from "./contract.js";
11
11
  export declare const PREFLIGHT_CONTRACT_VERSION: 1;
12
12
  /** Classifications reconcile actually returns on the offline preflight path. */
13
13
  export declare const OFFLINE_PREFLIGHT_CLASSIFICATIONS: readonly ["unresolved", "needs_company", "company_conflict", "needs_project", "needs_task", "bound", "untracked"];
14
- export type OfflinePreflightClassification = (typeof OFFLINE_PREFLIGHT_CLASSIFICATIONS)[number];
15
- /**
16
- * One representative result per emitted classification, using the kind and
17
- * delivery the offline path actually returns (company-resolved results are
18
- * kind "queued" / delivery "queued"; local-only results are delivery "clean").
19
- */
20
- export declare function preflightFixtureFor(classification: OfflinePreflightClassification): ContextResult;
14
+ type OfflinePreflightClassification = (typeof OFFLINE_PREFLIGHT_CLASSIFICATIONS)[number];
21
15
  export interface PreflightFixtureFile {
22
16
  contractVersion: typeof PREFLIGHT_CONTRACT_VERSION;
23
17
  source: "hq-cli contracts/preflight/v1/fixtures.json";
@@ -25,4 +19,5 @@ export interface PreflightFixtureFile {
25
19
  fixtures: ContextResult[];
26
20
  }
27
21
  export declare function buildPreflightFixtures(): PreflightFixtureFile;
22
+ export {};
28
23
  //# sourceMappingURL=preflight-contract.d.ts.map
@@ -37,7 +37,7 @@ function base(classification, kind, delivery) {
37
37
  * delivery the offline path actually returns (company-resolved results are
38
38
  * kind "queued" / delivery "queued"; local-only results are delivery "clean").
39
39
  */
40
- export function preflightFixtureFor(classification) {
40
+ function preflightFixtureFor(classification) {
41
41
  switch (classification) {
42
42
  case "unresolved":
43
43
  return base("unresolved", "queued", "queued");
@@ -5,7 +5,7 @@
5
5
  * (no git subprocess), normalises to owner/name, and matches against
6
6
  * companies/manifest.yaml repos. Zero or multiple matches → no signal.
7
7
  */
8
- export interface CompaniesManifestEntry {
8
+ interface CompaniesManifestEntry {
9
9
  repos?: unknown;
10
10
  [k: string]: unknown;
11
11
  }
@@ -57,4 +57,5 @@ export declare function deriveRemoteOwnerSlug(opts: {
57
57
  /** Injectable manifest reader (tests). */
58
58
  readManifest?: (hqRoot: string) => CompaniesManifestMap | null;
59
59
  }): string | null;
60
+ export {};
60
61
  //# sourceMappingURL=repo-remote.d.ts.map
@@ -14,8 +14,6 @@ export declare function findHqRoot(): string;
14
14
  * Exported for tests.
15
15
  */
16
16
  export declare function getManifestPath(hqRoot: string): string;
17
- export declare function getLockPath(hqRoot: string): string;
18
- export declare function getStatePath(hqRoot: string): string;
19
17
  export declare function getModulesDir(hqRoot: string): string;
20
18
  export declare function readManifest(hqRoot: string): ModulesManifest | null;
21
19
  export declare function writeManifest(hqRoot: string, manifest: ModulesManifest): void;
@@ -37,10 +37,10 @@ export function getManifestPath(hqRoot) {
37
37
  return flat;
38
38
  return nested; // default for fresh HQs — see getModulesDir()
39
39
  }
40
- export function getLockPath(hqRoot) {
40
+ function getLockPath(hqRoot) {
41
41
  return path.join(hqRoot, LOCK_FILE);
42
42
  }
43
- export function getStatePath(hqRoot) {
43
+ function getStatePath(hqRoot) {
44
44
  return path.join(hqRoot, STATE_FILE);
45
45
  }
46
46
  export function getModulesDir(hqRoot) {
@@ -37,11 +37,9 @@
37
37
  * `merge` rows -- they never produce a symlink.
38
38
  */
39
39
  import type { PackManifest, PackContributeKey } from '../types.js';
40
- import { CONTRIBUTION_TABLE, type WireMode } from './contribution-table.js';
40
+ import { type WireMode } from './contribution-table.js';
41
41
  import { type UnregisterServerResult, type SafeWriteEnv, type AcquireLockOptions } from '../commands/mcp-registration.js';
42
42
  export { readHqVersion, readRecommendedPackages } from './hq-core-yaml.js';
43
- export type { CatalogEntry } from './hq-core-yaml.js';
44
- export { CONTRIBUTION_TABLE };
45
43
  export type { WireMode };
46
44
  /**
47
45
  * Where a contributes key is ROUTED (US-005). Reads the single-source table's
@@ -42,11 +42,6 @@ import * as yaml from 'js-yaml';
42
42
  import { CONTRIBUTION_TABLE, payloadFor } from './contribution-table.js';
43
43
  import { unregisterMcpServers, } from '../commands/mcp-registration.js';
44
44
  export { readHqVersion, readRecommendedPackages } from './hq-core-yaml.js';
45
- // NOTE on dependency direction: this module imports from ../commands/mcp-registration.js
46
- // to un-register `wire:merge` (mcp) servers on uninstall. mcp-registration.ts imports
47
- // ONLY fs/os/path/smol-toml (it does NOT import from pack-contributions.ts), so there
48
- // is NO import cycle. If that ever changes, invert via a callback injected by packs.ts.
49
- export { CONTRIBUTION_TABLE };
50
45
  /**
51
46
  * Where a contributes key is ROUTED (US-005). Reads the single-source table's
52
47
  * `wire` field — `'symlink'` keys go through `linkFor`/`contributionLinks` (a
@@ -8,12 +8,6 @@ export interface PackageUseLease {
8
8
  readonly leasePath: string;
9
9
  release(): void;
10
10
  }
11
- export interface PackageUseLeaseRecord {
12
- pid: number;
13
- start_time_ms: number;
14
- hq_version: string;
15
- purpose?: PackageUseLeasePurpose;
16
- }
17
11
  /** Map only fixed command words to a bounded lease purpose; never persist argv values. */
18
12
  export declare function packageUseLeasePurposeForArgv(argv: readonly string[]): PackageUseLeasePurpose;
19
13
  export interface PackageUseLeaseHandoff {
@@ -23,7 +17,6 @@ export interface PackageUseLeaseHandoff {
23
17
  }
24
18
  export declare function npmPrefix(root: string, platform?: NodeJS.Platform): string | null;
25
19
  export declare function packageUseLeaseDirectory(prefix: string, stateDirectory?: string): string;
26
- export declare function packageUseUpdateRequestPath(prefix: string, stateDirectory?: string): string;
27
20
  declare function waitForUpdateRequest(requestPath: string, timeoutMs: number): void;
28
21
  export declare function acquirePackageUseLease(prefix: string, hqVersion: string, stateDirectory?: string, purpose?: PackageUseLeasePurpose): PackageUseLease;
29
22
  /**
@@ -133,7 +133,7 @@ export function packageUseLeaseDirectory(prefix, stateDirectory = packageUseStat
133
133
  const digest = createHash("sha256").update(normalizedPrefix(prefix), "utf8").digest("hex");
134
134
  return path.join(stateDirectory, digest);
135
135
  }
136
- export function packageUseUpdateRequestPath(prefix, stateDirectory) {
136
+ function packageUseUpdateRequestPath(prefix, stateDirectory) {
137
137
  return path.join(packageUseLeaseDirectory(prefix, stateDirectory), UPDATE_REQUEST);
138
138
  }
139
139
  function waitForUpdateRequest(requestPath, timeoutMs) {
@@ -1,11 +1,6 @@
1
1
  export type ResidentPackagePath = "agent-kit" | "agent-mcp" | "auth-login" | "agents-terminal" | "bot" | "bot-logs-follow" | "childWrapper" | "coreJobRun" | "daemon-call" | "login" | "mcp" | "daemon" | "daemon-logs-follow" | "mesh-daemon" | "lanes-watch" | "monitor-wait" | "monitor-run" | "agents-message-wait" | "integrations-oauth-wait" | "outpost-wait" | "secrets-sandbox" | "pkg-update" | "pack-install";
2
2
  /** Runtime modules that resident commands may need after a wait starts. */
3
3
  export declare const RESIDENT_PACKAGE_MODULES: Record<ResidentPackagePath, readonly string[]>;
4
- export declare class ResidentPackagePreloadError extends Error {
5
- readonly moduleSpecifier: string;
6
- readonly errorClass: string;
7
- constructor(moduleSpecifier: string, errorClass: string);
8
- }
9
4
  /** Report only bounded runtime metadata; never include an exception message or path. */
10
5
  export declare function reportResidentPackagePreloadFailure(error: unknown): void;
11
6
  /** Resolve every lazy package module before a resident command releases its lease. */
@@ -311,7 +311,7 @@ const LOADERS = {
311
311
  () => import("@indigoai-us/hq-cloud"),
312
312
  ],
313
313
  };
314
- export class ResidentPackagePreloadError extends Error {
314
+ class ResidentPackagePreloadError extends Error {
315
315
  moduleSpecifier;
316
316
  errorClass;
317
317
  constructor(moduleSpecifier, errorClass) {
@@ -1,3 +1,2 @@
1
- export declare function executableCandidates(command: string, pathValue?: string, platform?: NodeJS.Platform, pathExt?: string): string[];
2
1
  export declare function isExecutableOnPath(command: string, pathValue?: string, platform?: NodeJS.Platform, pathExt?: string): boolean;
3
2
  //# sourceMappingURL=resolve-executable.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import * as fs from 'node:fs';
2
2
  import * as path from 'node:path';
3
- export function executableCandidates(command, pathValue = process.env.PATH ?? '', platform = process.platform, pathExt = process.env.PATHEXT ?? '.EXE;.CMD;.BAT;.COM') {
3
+ function executableCandidates(command, pathValue = process.env.PATH ?? '', platform = process.platform, pathExt = process.env.PATHEXT ?? '.EXE;.CMD;.BAT;.COM') {
4
4
  const extensions = platform === 'win32'
5
5
  ? (pathExt || '.EXE;.CMD;.BAT;.COM').split(';').filter(Boolean)
6
6
  : [''];