@indigoai-us/hq-cli 5.345.219 → 5.345.221
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 +170 -0
- package/dist/command-catalog.generated.d.ts +169 -3
- package/dist/command-catalog.generated.js +206 -3
- package/dist/commands/auth.js +4 -1
- package/dist/commands/bot-runtime.d.ts +18 -5
- package/dist/commands/bot-runtime.js +29 -12
- package/dist/commands/bot.d.ts +85 -0
- package/dist/commands/bot.js +245 -16
- package/dist/commands/cloud.d.ts +16 -0
- package/dist/commands/cloud.js +112 -102
- package/dist/commands/core-checkpoint-native.d.ts +13 -0
- package/dist/commands/core-checkpoint-native.js +167 -52
- package/dist/commands/core-hook-registration-plan.js +5 -4
- package/dist/commands/core-stop-autosave.d.ts +21 -0
- package/dist/commands/core-stop-autosave.js +300 -0
- package/dist/commands/core.js +2 -0
- package/dist/commands/daemon.d.ts +5 -0
- package/dist/commands/daemon.js +52 -9
- package/dist/commands/doctor-usage.d.ts +5 -0
- package/dist/commands/doctor-usage.js +25 -0
- package/dist/commands/env.d.ts +49 -4
- package/dist/commands/env.js +355 -5
- package/dist/commands/integrations.js +84 -3
- package/dist/commands/lanes-shared.d.ts +3 -0
- package/dist/commands/lanes.d.ts +3 -0
- package/dist/commands/lanes.js +87 -3
- package/dist/commands/packs.js +23 -0
- package/dist/commands/pkg-update.d.ts +6 -0
- package/dist/commands/pkg-update.js +15 -7
- package/dist/commands/run.js +55 -45
- package/dist/commands/sources.js +4 -3
- package/dist/commands/sync-core.d.ts +1 -0
- package/dist/commands/sync-core.js +77 -3
- package/dist/commands/whoami.js +96 -80
- package/dist/lib/bot/config.d.ts +17 -0
- package/dist/lib/bot/config.js +13 -0
- package/dist/lib/bot/fleet-cron.js +29 -4
- package/dist/lib/bot/fleet-local.d.ts +30 -2
- package/dist/lib/bot/fleet-local.js +60 -1
- package/dist/lib/bot/grok-login-scope.d.ts +36 -0
- package/dist/lib/bot/grok-login-scope.js +93 -0
- package/dist/lib/bot/inflight.d.ts +9 -0
- package/dist/lib/bot/jobs/hot-signal-sync.d.ts +51 -0
- package/dist/lib/bot/jobs/hot-signal-sync.js +90 -9
- package/dist/lib/bot/legacy-provider-login.d.ts +32 -9
- package/dist/lib/bot/legacy-provider-login.js +28 -22
- package/dist/lib/bot/run.d.ts +29 -5
- package/dist/lib/bot/run.js +203 -1
- package/dist/lib/bot/runtime-sign-in-check.js +6 -1
- package/dist/lib/bot/runtime-sign-in.d.ts +2 -0
- package/dist/lib/bot/signals-try-now.d.ts +76 -0
- package/dist/lib/bot/signals-try-now.js +111 -0
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +22 -3
- package/dist/lib/capacity/collectors/claude-oauth.js +78 -22
- package/dist/lib/capacity/scheduler.d.ts +8 -0
- package/dist/lib/capacity/scheduler.js +5 -2
- package/dist/lib/core-utils/sentry-report.js +2 -0
- package/dist/lib/daemon/machine-checks.d.ts +22 -1
- package/dist/lib/daemon/machine-checks.js +54 -12
- package/dist/lib/daemon/run.js +71 -8
- package/dist/lib/daemon/runtime-notifications.d.ts +7 -0
- package/dist/lib/daemon/runtime-notifications.js +50 -0
- package/dist/lib/daemon/stop-autosave-lock.d.ts +19 -0
- package/dist/lib/daemon/stop-autosave-lock.js +166 -0
- package/dist/lib/daemon/stop-autosave.d.ts +28 -0
- package/dist/lib/daemon/stop-autosave.js +111 -0
- package/dist/lib/daemon/stop-diagnostics.d.ts +11 -0
- package/dist/lib/daemon/stop-diagnostics.js +136 -0
- package/dist/lib/daemon/stop-job-executor.d.ts +19 -0
- package/dist/lib/daemon/stop-job-executor.js +126 -0
- package/dist/lib/daemon/stop-jobs.d.ts +93 -0
- package/dist/lib/daemon/stop-jobs.js +599 -0
- package/dist/lib/doctor/checks/fleet-hook-core.d.ts +9 -1
- package/dist/lib/doctor/checks/fleet-hook-core.js +39 -15
- package/dist/lib/doctor/checks/host-core.js +1 -1
- package/dist/lib/environment/access-probes.d.ts +234 -0
- package/dist/lib/environment/access-probes.js +918 -0
- package/dist/lib/environment/profile.d.ts +15 -2
- package/dist/lib/environment/profile.js +55 -20
- package/dist/lib/environment/rfc3339.d.ts +8 -0
- package/dist/lib/environment/rfc3339.js +26 -0
- package/dist/lib/environment/work-requirements.d.ts +169 -0
- package/dist/lib/environment/work-requirements.js +389 -0
- package/dist/lib/hook-engine/coverage.d.ts +137 -7
- package/dist/lib/hook-engine/coverage.js +1424 -4
- package/dist/lib/hook-engine/fleet-registration.d.ts +17 -5
- package/dist/lib/hook-engine/fleet-registration.js +53 -17
- package/dist/lib/hook-engine/git-stop-config.json +513 -0
- package/dist/lib/hook-engine/native-stop-compatibility.json +311 -0
- package/dist/lib/hook-engine/reconcile.js +2 -2
- package/dist/lib/hot-channels/alert.d.ts +10 -1
- package/dist/lib/hot-channels/alert.js +38 -8
- package/dist/lib/hot-channels/signals-claude-login.d.ts +53 -0
- package/dist/lib/hot-channels/signals-claude-login.js +96 -0
- package/dist/lib/hot-channels/signals-pass.d.ts +143 -17
- package/dist/lib/hot-channels/signals-pass.js +324 -17
- package/dist/lib/hot-channels/signals-runtime.d.ts +30 -0
- package/dist/lib/hot-channels/signals-runtime.js +82 -0
- package/dist/lib/install/hook-target.js +1 -1
- package/dist/lib/lanes/host-capacity.d.ts +26 -2
- package/dist/lib/lanes/host-capacity.js +17 -2
- package/dist/lib/lanes/host-compute.d.ts +90 -0
- package/dist/lib/lanes/host-compute.js +185 -0
- package/dist/lib/lanes/index.d.ts +2 -0
- package/dist/lib/lanes/index.js +1 -0
- package/dist/lib/lanes/reconcile.js +22 -1
- package/dist/lib/lanes/resource-usage.d.ts +155 -0
- package/dist/lib/lanes/resource-usage.js +589 -0
- package/dist/lib/lanes/run-size.d.ts +46 -0
- package/dist/lib/lanes/run-size.js +197 -0
- package/dist/lib/lanes/store.js +27 -0
- package/dist/lib/lanes/throttle.d.ts +36 -1
- package/dist/lib/lanes/throttle.js +47 -10
- package/dist/lib/lanes/types.d.ts +40 -0
- package/dist/lib/lanes/types.js +2 -2
- package/dist/lib/lanes/watcher.js +13 -4
- package/dist/lib/lanes/worker-process.d.ts +25 -2
- package/dist/lib/lanes/worker-process.js +71 -19
- package/dist/lib/placement/match.d.ts +192 -0
- package/dist/lib/placement/match.js +667 -0
- package/dist/lib/safe-store.d.ts +14 -0
- package/dist/lib/safe-store.js +77 -4
- package/dist/lib/search-index/index.d.ts +88 -4
- package/dist/lib/search-index/index.js +299 -25
- package/dist/lib/search-index/max-doc-bytes.d.ts +17 -6
- package/dist/lib/search-index/max-doc-bytes.js +48 -23
- package/dist/lib/signals/codex-lockdown.d.ts +79 -0
- package/dist/lib/signals/codex-lockdown.js +271 -0
- package/dist/lib/signals/codex-login.d.ts +37 -0
- package/dist/lib/signals/codex-login.js +83 -0
- package/dist/lib/signals/engine.d.ts +28 -0
- package/dist/lib/signals/engine.js +77 -0
- package/dist/lib/signals/reply.d.ts +48 -0
- package/dist/lib/signals/reply.js +94 -12
- package/dist/lib/signals/run-record.js +6 -1
- package/dist/lib/signals/settings.d.ts +5 -0
- package/dist/lib/signals/settings.js +2 -0
- package/dist/lib/signals/steps/adapters.js +6 -0
- package/dist/lib/signals/steps/extract.d.ts +135 -12
- package/dist/lib/signals/steps/extract.js +416 -84
- package/dist/lib/signals/steps/types.d.ts +21 -0
- package/dist/lib/sync-core/engine-home.d.ts +41 -2
- package/dist/lib/sync-core/engine-home.js +132 -19
- package/dist/lib/sync-core/reconcile.js +1 -1
- package/dist/lib/sync-core/release-compare.d.ts +7 -0
- package/dist/lib/sync-core/release-compare.js +16 -0
- package/dist/lib/sync-core/release.d.ts +2 -1
- package/dist/lib/sync-core/release.js +2 -10
- package/dist/lib/sync-core/rollout-state.d.ts +2 -1
- package/dist/lib/sync-core/rollout-state.js +5 -2
- package/dist/lib/sync-core/vault-uid.d.ts +2 -0
- package/dist/lib/sync-core/vault-uid.js +4 -0
- package/dist/run/schema-env-overrides.d.ts +24 -0
- package/dist/run/schema-env-overrides.js +72 -0
- package/dist/schemas/hq-work-requirements.v1.schema.json +145 -0
- package/dist/utils/auth-session-check.d.ts +16 -0
- package/dist/utils/auth-session-check.js +16 -0
- package/dist/utils/client-health-contract.d.ts +6 -0
- package/dist/utils/client-health-contract.js +13 -0
- package/dist/utils/client-health.d.ts +7 -0
- package/dist/utils/client-health.js +22 -1
- package/dist/utils/command-usage.d.ts +40 -0
- package/dist/utils/command-usage.js +61 -0
- package/dist/utils/duplicate-command-usage.d.ts +72 -0
- package/dist/utils/duplicate-command-usage.js +125 -0
- package/dist/utils/host-registration.d.ts +1 -1
- package/dist/utils/host-registration.js +6 -1
- package/dist/utils/resident-package-preload.js +4 -0
- package/dist/utils/sentry-fingerprint.js +9 -0
- package/dist/utils/windows-bash.d.ts +2 -0
- package/dist/utils/windows-bash.js +2 -1
- package/package.json +15 -10
- package/scripts/bench-core-compare.mjs +313 -0
- package/scripts/bench-core.mjs +399 -12
- package/scripts/check-function-manifest.mjs +121 -7
- package/dist/commands/__fixtures__/access-vault.d.ts +0 -95
- package/dist/commands/__fixtures__/access-vault.js +0 -166
- package/dist/commands/__fixtures__/make-tar.d.ts +0 -38
- package/dist/commands/__fixtures__/make-tar.js +0 -102
- package/dist/commands/secrets-public-types.test-d.d.ts +0 -2
- package/dist/commands/secrets-public-types.test-d.js +0 -18
- package/dist/lib/decisions/fixtures/us001.d.ts +0 -137
- package/dist/lib/decisions/fixtures/us001.js +0 -21
- package/dist/lib/doctor/__testing__/fake-hq-tree.d.ts +0 -226
- package/dist/lib/doctor/__testing__/fake-hq-tree.js +0 -408
- package/dist/lib/doctor/__testing__/run-doctor.d.ts +0 -8
- package/dist/lib/doctor/__testing__/run-doctor.js +0 -69
- package/dist/lib/fingerprint/fixtures.d.ts +0 -19
- package/dist/lib/fingerprint/fixtures.js +0 -61
- package/dist/lib/hot-channels/adapters/__fixtures__/dummy.d.ts +0 -33
- package/dist/lib/hot-channels/adapters/__fixtures__/dummy.js +0 -53
- package/dist/lib/hot-channels/adapters/__fixtures__/meeting-providers.d.ts +0 -38
- package/dist/lib/hot-channels/adapters/__fixtures__/meeting-providers.js +0 -64
- package/dist/lib/mesh/live/daemon/mqtt-events.test-d.d.ts +0 -2
- package/dist/lib/mesh/live/daemon/mqtt-events.test-d.js +0 -10
- package/dist/lib/test-utils/isolated-flag-company-context.d.ts +0 -3
- package/dist/lib/test-utils/isolated-flag-company-context.js +0 -18
- package/scripts/hook-engine-manifest.mjs +0 -22
- package/scripts/mesh-daemon-if-stale.mjs +0 -20
package/dist/lib/safe-store.d.ts
CHANGED
|
@@ -155,6 +155,10 @@ export interface OpenStoreDirOptions {
|
|
|
155
155
|
export interface ReadOptions {
|
|
156
156
|
/** Refuse a file larger than this. Default 1 MiB. */
|
|
157
157
|
maxBytes?: number;
|
|
158
|
+
/** Read a bounded window from an append-only queue rather than the whole file. */
|
|
159
|
+
offset?: number;
|
|
160
|
+
/** Include the opened file's device/inode identity for queue cursors. */
|
|
161
|
+
identity?: boolean;
|
|
158
162
|
}
|
|
159
163
|
export interface AppendOptions {
|
|
160
164
|
/** Refuse to append when the file is already this size or larger. */
|
|
@@ -173,6 +177,7 @@ export interface FileFacts {
|
|
|
173
177
|
/** FileFacts plus the exact modification time in nanoseconds (mtimeMs is a float and can round across a millisecond). */
|
|
174
178
|
export interface ReadFacts extends FileFacts {
|
|
175
179
|
mtimeNs: bigint;
|
|
180
|
+
fileIdentity?: string;
|
|
176
181
|
}
|
|
177
182
|
export interface RenameOptions {
|
|
178
183
|
/** Waits in milliseconds between rename attempts on EPERM, EACCES or EBUSY (Windows). Empty: no retry. */
|
|
@@ -212,9 +217,18 @@ export interface SafeStore {
|
|
|
212
217
|
remove(name: string): SafeStoreResult<boolean>;
|
|
213
218
|
/** The names in the folder. */
|
|
214
219
|
list(): SafeStoreResult<string[]>;
|
|
220
|
+
/** Read directory names in bounded batches without materializing the directory. */
|
|
221
|
+
nameCursor(): SafeStoreResult<SafeStoreNameCursor>;
|
|
215
222
|
/** Release the held folder. Later calls are refused with "closed". */
|
|
216
223
|
close(): void;
|
|
217
224
|
}
|
|
225
|
+
export interface SafeStoreNameCursor {
|
|
226
|
+
read(maxNames: number): SafeStoreResult<{
|
|
227
|
+
names: string[];
|
|
228
|
+
done: boolean;
|
|
229
|
+
}>;
|
|
230
|
+
close(): void;
|
|
231
|
+
}
|
|
218
232
|
/** A plain file name: no separator, no NUL, not "." or "..", at most 255 bytes. */
|
|
219
233
|
export declare function isPlainName(name: string): boolean;
|
|
220
234
|
/** Owner and mode facts a check needs, from fs.Stats or fs.BigIntStats. */
|
package/dist/lib/safe-store.js
CHANGED
|
@@ -602,12 +602,17 @@ class HeldStore {
|
|
|
602
602
|
return opened;
|
|
603
603
|
const { fd, stat } = opened.value;
|
|
604
604
|
try {
|
|
605
|
-
|
|
605
|
+
const offset = options.offset ?? 0;
|
|
606
|
+
if (!Number.isSafeInteger(offset) || offset < 0)
|
|
607
|
+
return refusal("io-error", "invalid read offset");
|
|
608
|
+
if (options.offset === undefined && stat.size > BigInt(maxBytes))
|
|
606
609
|
return refusal("too-large", `the file is larger than ${maxBytes} bytes`);
|
|
607
|
-
const buffer = Buffer.alloc(maxBytes + 1);
|
|
610
|
+
const buffer = Buffer.alloc(maxBytes + (options.offset === undefined ? 1 : 0));
|
|
608
611
|
let length = 0;
|
|
609
612
|
for (;;) {
|
|
610
|
-
|
|
613
|
+
if (length === buffer.length)
|
|
614
|
+
break;
|
|
615
|
+
const count = fs.readSync(fd, buffer, length, buffer.length - length, offset + length);
|
|
611
616
|
if (count === 0)
|
|
612
617
|
break;
|
|
613
618
|
length += count;
|
|
@@ -615,7 +620,8 @@ class HeldStore {
|
|
|
615
620
|
return refusal("too-large", `the file is larger than ${maxBytes} bytes`);
|
|
616
621
|
}
|
|
617
622
|
// Bigint stats round mtimeMs down to a whole millisecond; mtimeNs keeps the fraction.
|
|
618
|
-
const facts = { size: length, mtimeMs: Number(stat.mtimeNs) / 1e6, mtimeNs: stat.mtimeNs
|
|
623
|
+
const facts = { size: length, mtimeMs: Number(stat.mtimeNs) / 1e6, mtimeNs: stat.mtimeNs,
|
|
624
|
+
...(options.identity ? { fileIdentity: `${stat.dev}:${stat.ino}` } : {}) };
|
|
619
625
|
return { ok: true, value: { data: Buffer.from(buffer.subarray(0, length)), facts } };
|
|
620
626
|
}
|
|
621
627
|
catch (error) {
|
|
@@ -759,6 +765,73 @@ class HeldStore {
|
|
|
759
765
|
return afterList;
|
|
760
766
|
return { ok: true, value: names };
|
|
761
767
|
}
|
|
768
|
+
nameCursor() {
|
|
769
|
+
const refused = this.start("list");
|
|
770
|
+
if (refused)
|
|
771
|
+
return refused;
|
|
772
|
+
let directory;
|
|
773
|
+
try {
|
|
774
|
+
directory = fs.opendirSync(this.base, { bufferSize: 32 });
|
|
775
|
+
}
|
|
776
|
+
catch (error) {
|
|
777
|
+
return ioError("opening directory cursor", error);
|
|
778
|
+
}
|
|
779
|
+
let closed = false;
|
|
780
|
+
const close = () => {
|
|
781
|
+
if (closed)
|
|
782
|
+
return;
|
|
783
|
+
closed = true;
|
|
784
|
+
try {
|
|
785
|
+
directory.closeSync();
|
|
786
|
+
}
|
|
787
|
+
catch { /* already closed */ }
|
|
788
|
+
};
|
|
789
|
+
const checked = this.check();
|
|
790
|
+
if (checked) {
|
|
791
|
+
close();
|
|
792
|
+
return checked;
|
|
793
|
+
}
|
|
794
|
+
return { ok: true, value: {
|
|
795
|
+
close,
|
|
796
|
+
read: (maxNames) => {
|
|
797
|
+
const before = this.start("list");
|
|
798
|
+
if (before) {
|
|
799
|
+
close();
|
|
800
|
+
return before;
|
|
801
|
+
}
|
|
802
|
+
if (closed)
|
|
803
|
+
return { ok: true, value: { names: [], done: true } };
|
|
804
|
+
if (!Number.isSafeInteger(maxNames) || maxNames < 1 || maxNames > 256) {
|
|
805
|
+
close();
|
|
806
|
+
return ioError("reading directory cursor", new Error("invalid batch size"));
|
|
807
|
+
}
|
|
808
|
+
const names = [];
|
|
809
|
+
let done = false;
|
|
810
|
+
try {
|
|
811
|
+
while (names.length < maxNames) {
|
|
812
|
+
const entry = directory.readSync();
|
|
813
|
+
if (!entry) {
|
|
814
|
+
done = true;
|
|
815
|
+
close();
|
|
816
|
+
break;
|
|
817
|
+
}
|
|
818
|
+
names.push(entry.name);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
catch (error) {
|
|
822
|
+
close();
|
|
823
|
+
return ioError("reading directory cursor", error);
|
|
824
|
+
}
|
|
825
|
+
this.at("after-list", "list");
|
|
826
|
+
const after = this.check();
|
|
827
|
+
if (after) {
|
|
828
|
+
close();
|
|
829
|
+
return after;
|
|
830
|
+
}
|
|
831
|
+
return { ok: true, value: { names, done } };
|
|
832
|
+
},
|
|
833
|
+
} };
|
|
834
|
+
}
|
|
762
835
|
close() {
|
|
763
836
|
if (this.closed)
|
|
764
837
|
return;
|
|
@@ -141,6 +141,77 @@ export declare class QmdCollectionExistsError extends QmdExitError {
|
|
|
141
141
|
name: string;
|
|
142
142
|
constructor(message: string, args: string[], status: number | null, stdout: string, stderr: string, collectionName: string);
|
|
143
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* qmd's `collection add` exited non-zero because ANOTHER collection already
|
|
146
|
+
* covers exactly this path and pattern (qmd 2.5.3 prints "A collection already
|
|
147
|
+
* exists for this path and pattern:" and then `Name: <other> (qmd://<other>/)`).
|
|
148
|
+
* For unmanaged names, reconciliation skips its own add, prints a notice and
|
|
149
|
+
* carries on. HQ-managed name collisions remain fatal and captured. Before
|
|
150
|
+
* this, the duplicate aborted the whole `hq index sync`, so no collection was
|
|
151
|
+
* ever updated again on that machine (HQ-CLI-GJ).
|
|
152
|
+
*/
|
|
153
|
+
export declare class QmdCollectionPathTakenError extends QmdExitError {
|
|
154
|
+
readonly existingName: string;
|
|
155
|
+
name: string;
|
|
156
|
+
constructor(message: string, args: string[], status: number | null, stdout: string, stderr: string, existingName: string);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* hq or its qmd child was refused READ access to the HQ folder: EPERM/EACCES on
|
|
160
|
+
* `uv_cwd` (qmd's process.cwd() in the HQ root), or on a scandir/open of a path
|
|
161
|
+
* inside the HQ root. On macOS an EPERM there is the privacy (TCC) gate on a
|
|
162
|
+
* protected location such as Documents, Desktop or iCloud Drive. The message is
|
|
163
|
+
* the platform-specific remedy; the carrier is thrown marked expected, so the
|
|
164
|
+
* boundary prints it and skips capture (HQ-CLI-EJ, HQ-CLI-FV, HQ-CLI-BV,
|
|
165
|
+
* HQ-CLI-FF).
|
|
166
|
+
*/
|
|
167
|
+
export declare class QmdAccessDeniedError extends QmdExitError {
|
|
168
|
+
readonly deniedPath: string;
|
|
169
|
+
readonly errnoCode: 'EPERM' | 'EACCES';
|
|
170
|
+
readonly syscall: string;
|
|
171
|
+
name: string;
|
|
172
|
+
constructor(message: string, args: string[], status: number | null, stdout: string, stderr: string, deniedPath: string, errnoCode: 'EPERM' | 'EACCES', syscall: string);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* qmd could not create or write its own settings folder (QMD_CONFIG_DIR,
|
|
176
|
+
* $XDG_CONFIG_HOME/qmd or ~/.config/qmd): EPERM/EACCES on a path at or above
|
|
177
|
+
* that folder. The user's account cannot write there, typically because the
|
|
178
|
+
* folder was created by a command run with sudo. Thrown marked expected with
|
|
179
|
+
* the remedy as its message (HQ-CLI-GJ).
|
|
180
|
+
*/
|
|
181
|
+
export declare class QmdConfigUnwritableError extends QmdExitError {
|
|
182
|
+
readonly configDir: string;
|
|
183
|
+
readonly errnoCode: 'EPERM' | 'EACCES';
|
|
184
|
+
name: string;
|
|
185
|
+
constructor(message: string, args: string[], status: number | null, stdout: string, stderr: string, configDir: string, errnoCode: 'EPERM' | 'EACCES');
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* qmd's SQLite index file is damaged (SQLITE_CORRUPT / SQLITE_NOTADB). qmd
|
|
189
|
+
* reports it as "sqlite-vec extension is unavailable ... Install Homebrew
|
|
190
|
+
* SQLite", which cannot fix a damaged file. hq names the file and the rebuild
|
|
191
|
+
* step instead. Still captured, because a trend of damaged index files would
|
|
192
|
+
* point at a writer bug (HQ-CLI-EJ).
|
|
193
|
+
*/
|
|
194
|
+
export declare class QmdStoreCorruptError extends QmdExitError {
|
|
195
|
+
readonly storeFile: string | undefined;
|
|
196
|
+
name: string;
|
|
197
|
+
constructor(message: string, args: string[], status: number | null, stdout: string, stderr: string, storeFile: string | undefined);
|
|
198
|
+
}
|
|
199
|
+
type QmdPermissionFailure = {
|
|
200
|
+
code: 'EPERM' | 'EACCES';
|
|
201
|
+
syscall: string;
|
|
202
|
+
path?: string;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Parse an unambiguous fatal Node permission error from stderr, for example
|
|
206
|
+
* `Error: EPERM: operation not permitted, uv_cwd` or
|
|
207
|
+
* `[Error: EACCES: permission denied, mkdir '/home/u/.config/qmd']`.
|
|
208
|
+
* Incidental warnings and output containing another thrown error stay captured.
|
|
209
|
+
*/
|
|
210
|
+
export declare function parseQmdPermissionFailure(text: string): QmdPermissionFailure | undefined;
|
|
211
|
+
/** Remedy for a refused read of the HQ folder, worded for the platform. */
|
|
212
|
+
export declare function qmdAccessDeniedMessage(deniedPath: string, code: 'EPERM' | 'EACCES', platform?: NodeJS.Platform): string;
|
|
213
|
+
/** Remedy for a qmd settings folder the user cannot write. */
|
|
214
|
+
export declare function qmdConfigUnwritableMessage(configDir: string, deniedPath: string, syscall: string, platform?: NodeJS.Platform): string;
|
|
144
215
|
/**
|
|
145
216
|
* qmd did NOT exit — it was KILLED BY A SIGNAL before it finished (spawnSync
|
|
146
217
|
* reports `status: null` with a non-null `signal`). hq-cli passes qmd no timeout
|
|
@@ -553,6 +624,13 @@ export type ReconcileCollectionsOptions = {
|
|
|
553
624
|
runner?: QmdProcessRunner;
|
|
554
625
|
/** Test seam for the default-off collection-path repair rollout. */
|
|
555
626
|
repairPathDrift?: boolean;
|
|
627
|
+
/** Where reconciliation notices go (default: process.stderr). */
|
|
628
|
+
writeStderr?: (text: string) => void;
|
|
629
|
+
/**
|
|
630
|
+
* File that records one-time notices already shown (default
|
|
631
|
+
* `<hqRoot>/.hq/search-index-notices.json`); `null` disables the record.
|
|
632
|
+
*/
|
|
633
|
+
noticesFile?: string | null;
|
|
556
634
|
};
|
|
557
635
|
/**
|
|
558
636
|
* Register expected collections that qmd does not yet know about, returning the
|
|
@@ -566,10 +644,16 @@ export type ReconcileCollectionsOptions = {
|
|
|
566
644
|
* NOT a failure. Reconciliation still issues the `context add`, whose qmd-side
|
|
567
645
|
* resyncConfig re-syncs YAML into SQLite and heals the divergence that provoked
|
|
568
646
|
* the retry, then continues with later collections; such a pre-existing
|
|
569
|
-
* collection is excluded from the returned list.
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
647
|
+
* collection is excluded from the returned list.
|
|
648
|
+
*
|
|
649
|
+
* An unmanaged path+pattern duplicate is not fatal: the files are indexed under
|
|
650
|
+
* that name, but scoped search misses them. Print a notice, skip this add and
|
|
651
|
+
* its `context add`, and continue. It used to abort the whole sync, so
|
|
652
|
+
* `qmd update` never ran again on that machine (HQ-CLI-GJ).
|
|
653
|
+
*
|
|
654
|
+
* Every other qmd failure still propagates: a same-name duplicate that named a
|
|
655
|
+
* different collection, a missing collection, a `context add` failure, a
|
|
656
|
+
* missing/unbuilt qmd binary. HQ-CLI-Q (Sentry 7670823899).
|
|
573
657
|
*/
|
|
574
658
|
export declare function reconcileCollections(hqRoot: string, options?: ReconcileCollectionsOptions): SearchCollection[];
|
|
575
659
|
export declare function listRegisteredCollections(hqRoot: string, options?: RunQmdOptions): Set<string>;
|