@indigoai-us/hq-cli 5.342.0 → 5.342.2

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.342.2] — 2026-10-04
6
+ - Load the shared `secrets env` action without importing the full secrets command module on the enabled fast route.
7
+
8
+ ## [5.342.1] — 2026-10-04
9
+ - `hq lanes` now continues envelope numbering beyond 999 and records unexpected reconcile admission failures as a distinct queued reason with error details.
10
+ - Reconcile skips configured Codex homes absent on the current host and reports a note; other filesystem errors remain visible as store errors. `--dry-run` no longer compresses rollouts or advances the retention schedule.
11
+
5
12
  ## [5.342.0] — 2026-10-04
6
13
 
7
14
  - Keep `hq integrations call` alive through slow provider calls with bounded async-job polling, safe idempotent retry guidance on timeout, and validation of terminal responses.
@@ -5089,8 +5089,12 @@ async function runList(ctx, opts) {
5089
5089
  ? {
5090
5090
  state: "remote",
5091
5091
  remote_state: lane.state,
5092
- queued_reason: lane.queued_reason === "low_disk" ? lane.queued_reason : undefined,
5093
- queued_details: lane.queued_reason === "low_disk" ? lane.queued_details : undefined,
5092
+ queued_reason: lane.queued_reason === "low_disk" || lane.queued_reason === "admit_failed"
5093
+ ? lane.queued_reason
5094
+ : undefined,
5095
+ queued_details: lane.queued_reason === "low_disk" || lane.queued_reason === "admit_failed"
5096
+ ? lane.queued_details
5097
+ : undefined,
5094
5098
  }
5095
5099
  : {}),
5096
5100
  overdue,
@@ -5142,7 +5146,9 @@ function formatLaneListHuman(lanes) {
5142
5146
  : "no story: " + (lane.no_story_reason ?? "reason not recorded");
5143
5147
  const queueLabel = (lane.state === "queued" || lane.remote_state === "queued") && lane.queued_reason === "low_disk"
5144
5148
  ? ` queued: low_disk (HQ ${lane.queued_details?.reason === "low_disk" ? lane.queued_details.hq_free_bytes : "?"} bytes; provider ${lane.queued_details?.reason === "low_disk" ? lane.queued_details.provider_free_bytes : "?"} bytes free)`
5145
- : "";
5149
+ : (lane.state === "queued" || lane.remote_state === "queued") && lane.queued_reason === "admit_failed"
5150
+ ? ` queued: admit_failed (${lane.queued_details?.reason === "admit_failed" ? `${lane.queued_details.error}: ${lane.queued_details.message}` : "details unavailable"})`
5151
+ : "";
5146
5152
  return lane.lane_id + " " + lane.state + " " + lane.provider + " " + lane.project_id +
5147
5153
  " " + storyLabel + queueLabel;
5148
5154
  });
@@ -5199,9 +5205,11 @@ async function runStatus(ctx, opts) {
5199
5205
  async function runCapacity(ctx) {
5200
5206
  const hqRoot = ctx.hqRoot();
5201
5207
  const host = laneHostFromCtx(ctx);
5208
+ const admissionHost = reconcileHostFromCtx(ctx);
5209
+ const lanes = loadAllLanes(hqRoot);
5202
5210
  const snapshot = buildHostCapacitySnapshot({
5203
5211
  host,
5204
- lanes: loadAllLanes(hqRoot),
5212
+ lanes,
5205
5213
  config: loadLanesConfig(hqRoot),
5206
5214
  existsSync: ctx.existsSync,
5207
5215
  probe: ctx.probeProvider,
@@ -5209,7 +5217,16 @@ async function runCapacity(ctx) {
5209
5217
  hostname: ctx.hostname(),
5210
5218
  now: ctx.now(),
5211
5219
  });
5212
- printJson(snapshot);
5220
+ printJson({
5221
+ ...snapshot,
5222
+ queued_lanes: lanes
5223
+ .filter((lane) => lane.state === "queued" && laneRunsHere(lane, admissionHost))
5224
+ .map((lane) => ({
5225
+ lane_id: lane.lane_id,
5226
+ queued_reason: lane.queued_reason ?? null,
5227
+ ...(lane.queued_details !== undefined ? { queued_details: lane.queued_details } : {}),
5228
+ })),
5229
+ });
5213
5230
  }
5214
5231
  async function runGcRollouts(ctx, opts) {
5215
5232
  const hqRoot = ctx.hqRoot();
@@ -5395,8 +5412,8 @@ async function runShow(ctx, laneId, hasPendingQuestionForLane, resolveLaneTarget
5395
5412
  ...storedLane,
5396
5413
  state: "remote",
5397
5414
  remote_state: storedLane.state,
5398
- queued_reason: storedLane.queued_reason === "low_disk" ? storedLane.queued_reason : undefined,
5399
- queued_details: storedLane.queued_reason === "low_disk" ? storedLane.queued_details : undefined,
5415
+ queued_reason: storedLane.queued_reason,
5416
+ queued_details: storedLane.queued_details,
5400
5417
  }
5401
5418
  : storedLane;
5402
5419
  const askDeliveryFailed = readJsonFile(askDeliveryFailedPath(hqRoot, laneId));
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=secrets-public-types.test-d.d.ts.map
@@ -0,0 +1,18 @@
1
+ const scriptUsage = {
2
+ scriptId: "fixture-script",
3
+ path: "scripts/example.sh",
4
+ sha256: "0".repeat(64),
5
+ attestationLevel: "verified",
6
+ };
7
+ const metadata = {
8
+ tier: "standard",
9
+ cacheTtlMs: 1_000,
10
+ };
11
+ const loadedSecret = {
12
+ ...metadata,
13
+ name: "FIXTURE_NAME",
14
+ value: "fixture-only",
15
+ };
16
+ void [scriptUsage, metadata, loadedSecret];
17
+ export {};
18
+ //# sourceMappingURL=secrets-public-types.test-d.js.map
@@ -1,5 +1,7 @@
1
1
  import type { Command } from "commander";
2
- import { writeSync } from "node:fs";
2
+ export { buildSecretUsage, emitEnvExportsAndExit, loadRevealedSecrets, parseSecretNameList, runSecretsEnvCommand, } from "../secrets-env-action.js";
3
+ export type { SecretLoadResponse, SecretScriptLockMode, SecretTier, SecretUsage, SecretUsageChannel } from "../secrets-env-action.js";
4
+ export type { SecretScriptUsage, SecretMetadata, SecretLoadSuccessRow } from "../secrets-env-action.js";
3
5
  import { vaultApiFetch, getCompanyUid, getEntityUid } from "../utils/vault-api.js";
4
6
  export type { VaultApiOptions } from "../utils/vault-api.js";
5
7
  export { vaultApiFetch, getCompanyUid, getEntityUid };
@@ -10,42 +12,6 @@ export { vaultApiFetch, getCompanyUid, getEntityUid };
10
12
  */
11
13
  export declare const HQ_PRO_RESOURCE_SURFACES: readonly ["api", "bot_invite", "bot_join_now", "calendar_auto_schedule", "calendar_preferences", "cli_secrets_set", "console_secrets_form", "deploy_precheck", "external_connection", "factory_install", "integrations_connect", "oauth_callback", "plan_limit_check", "secrets_input_link", "web"];
12
14
  export declare const CLI_SECRETS_SET_SURFACE = "cli_secrets_set";
13
- export type SecretTier = "standard" | "sensitive" | "nuclear";
14
- export type SecretScriptLockMode = "off" | "enforced";
15
- export type SecretUsageChannel = "run" | "exec" | "env" | "sandbox" | "reveal" | "submit-link";
16
- export interface SecretScriptUsage {
17
- scriptId: string;
18
- path: string;
19
- sha256: string;
20
- attestationLevel: string;
21
- }
22
- export interface SecretUsage {
23
- channel: SecretUsageChannel;
24
- reason?: string;
25
- script?: SecretScriptUsage;
26
- }
27
- export interface SecretMetadata {
28
- tier?: SecretTier;
29
- scriptLock?: {
30
- mode?: SecretScriptLockMode;
31
- requiredAttestation?: string;
32
- };
33
- cacheTtlMs?: number;
34
- revokedAt?: string | null;
35
- }
36
- export interface SecretLoadSuccessRow extends SecretMetadata {
37
- name: string;
38
- value?: string;
39
- version?: number;
40
- }
41
- export interface SecretLoadResponse {
42
- secrets: SecretLoadSuccessRow[];
43
- errors: Array<{
44
- name: string;
45
- code: string;
46
- message?: string;
47
- }>;
48
- }
49
15
  export interface SecretInjectionRecipe {
50
16
  header: string;
51
17
  scheme: "raw" | "bearer";
@@ -60,48 +26,5 @@ export declare function parseDestinationUrl(raw: string): {
60
26
  };
61
27
  export declare function collectSecretNames(value: string, previous?: string[]): string[];
62
28
  export declare function scrubSandboxOutput(text: string, secretNames?: string[]): string;
63
- export declare function loadRevealedSecrets(token: string, companyUid: string, keys: string[], usage?: SecretUsage, options?: {
64
- allowOfflineFallback?: boolean;
65
- }): Promise<Map<string, string>>;
66
- /**
67
- * Emit `hq secrets env` output and terminate deterministically.
68
- *
69
- * The process MUST exit even when the consuming pipe has gone away. The
70
- * orphaned-process leak (personal/projects/hq-secrets-process-leak) was caused
71
- * by relying on `process.stdout.write(payload, () => process.exit(0))`: when the
72
- * parent shell reading `source <(hq secrets env …)` is killed on timeout, the
73
- * stdout pipe loses its reader, the write callback never fires, `process.exit(0)`
74
- * is never reached, and — because `env` forces no other exit — the process parks
75
- * in `epoll_pwait(-1)` forever, reparented to PID 1. Hundreds accumulated this
76
- * way, exhausting swap and driving load into triple digits.
77
- *
78
- * Writing synchronously to fd 1 and then exiting unconditionally removes every
79
- * dependency on the event loop draining and on the reader still being attached:
80
- * - a live reader receives the export lines (synchronous write reaches the
81
- * kernel pipe buffer before we exit, so nothing is truncated);
82
- * - a dead reader surfaces as EPIPE, which we swallow — the secret is already
83
- * resolved and there is nothing left to deliver, so a clean exit is correct;
84
- * - EAGAIN (stdout in non-blocking mode with a momentarily full buffer) is
85
- * retried a bounded number of times. `env` payloads are a few short export
86
- * lines, far under the 64 KiB pipe buffer, so this effectively never spins.
87
- *
88
- * `exit` and `write` are injectable for tests; production uses the real ones.
89
- */
90
- export declare function emitEnvExportsAndExit(payload: string, exit?: (code: number) => never, write?: typeof writeSync): never;
91
- /**
92
- * Shared `secrets env` action for Commander and the default-off lightweight
93
- * entrypoint. The fast entrypoint still runs the same credential, usage-audit,
94
- * server authorization, cache-fallback, redaction, and output code.
95
- */
96
- export declare function runSecretsEnvCommand(opts: {
97
- only: string[];
98
- script?: string;
99
- scriptId?: string;
100
- }, parentScope: {
101
- company?: string;
102
- personal?: boolean;
103
- }, options?: {
104
- fallbackOnAuthFailure?: boolean;
105
- }): Promise<"handled" | "fallback">;
106
29
  export declare function registerSecretsCommand(program: Command): void;
107
30
  //# sourceMappingURL=secrets.d.ts.map