@indigoai-us/hq-cli 5.342.2 → 5.342.3

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,9 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.342.3] — 2026-10-04
6
+ - `hq secrets env` now waits briefly for the company flag snapshot refresh before its synchronous exit, allowing the fast-path gate to use a persisted snapshot on later invocations.
7
+
5
8
  ## [5.342.2] — 2026-10-04
6
9
  - Load the shared `secrets env` action without importing the full secrets command module on the enabled fast route.
7
10
 
@@ -0,0 +1,6 @@
1
+ import { writeSync } from "node:fs";
2
+ /** Write the resolved exports synchronously and exit even if the pipe is closed. */
3
+ export declare function emitEnvExportsAndExit(payload: string, exit?: (code: number) => never, write?: typeof writeSync): never;
4
+ /** Wait for a company snapshot before the synchronous env-command exit. */
5
+ export declare function finishEnvExportsAndExit(payload: string, waitForSnapshot?: (timeoutMs?: number, companyUid?: string) => Promise<void>, exit?: (code: number) => never, write?: typeof writeSync, shouldWaitForSnapshot?: boolean, companyUid?: string): Promise<never>;
6
+ //# sourceMappingURL=secrets-env-exit.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { writeSync } from "node:fs";
2
+ import { waitForRegisteredFlagRegistryRefresh } from "../lib/flag-registry-refresh-wait.js";
3
+ /** Write the resolved exports synchronously and exit even if the pipe is closed. */
4
+ export function emitEnvExportsAndExit(payload, exit = process.exit, write = writeSync) {
5
+ const buf = Buffer.from(payload, "utf8");
6
+ const MAX_EAGAIN_RETRIES = 10_000;
7
+ let offset = 0;
8
+ let eagainRetries = 0;
9
+ while (offset < buf.length) {
10
+ try {
11
+ offset += write(1, buf, offset, buf.length - offset);
12
+ }
13
+ catch (err) {
14
+ const code = err.code;
15
+ if (code === "EAGAIN" && eagainRetries++ < MAX_EAGAIN_RETRIES)
16
+ continue;
17
+ break;
18
+ }
19
+ }
20
+ return exit(0);
21
+ }
22
+ /** Wait for a company snapshot before the synchronous env-command exit. */
23
+ export async function finishEnvExportsAndExit(payload, waitForSnapshot = waitForRegisteredFlagRegistryRefresh, exit = process.exit, write = writeSync, shouldWaitForSnapshot = true, companyUid) {
24
+ if (shouldWaitForSnapshot)
25
+ await waitForSnapshot(500, companyUid);
26
+ return emitEnvExportsAndExit(payload, exit, write);
27
+ }
28
+ //# sourceMappingURL=secrets-env-exit.js.map
@@ -0,0 +1,7 @@
1
+ type FlagRegistryRefreshWaiter = (timeoutMs?: number, companyUid?: string) => Promise<void>;
2
+ /** Install the worker-backed waiter from the CLI's early registry bootstrap. */
3
+ export declare function registerFlagRegistryRefreshWaiter(nextWaiter: FlagRegistryRefreshWaiter): void;
4
+ /** Wait for a registry refresh when the CLI bootstrap installed a worker. */
5
+ export declare function waitForRegisteredFlagRegistryRefresh(timeoutMs?: number, companyUid?: string): Promise<void>;
6
+ export {};
7
+ //# sourceMappingURL=flag-registry-refresh-wait.d.ts.map
@@ -0,0 +1,10 @@
1
+ let waiter = async () => { };
2
+ /** Install the worker-backed waiter from the CLI's early registry bootstrap. */
3
+ export function registerFlagRegistryRefreshWaiter(nextWaiter) {
4
+ waiter = nextWaiter;
5
+ }
6
+ /** Wait for a registry refresh when the CLI bootstrap installed a worker. */
7
+ export function waitForRegisteredFlagRegistryRefresh(timeoutMs = 500, companyUid) {
8
+ return waiter(timeoutMs, companyUid);
9
+ }
10
+ //# sourceMappingURL=flag-registry-refresh-wait.js.map