@indigoai-us/hq-cli 5.292.0 → 5.294.0
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 +40 -0
- package/assets/scaffold/core/scripts/outpost-jobs-reconcile.sh +5 -1
- package/dist/command-catalog.generated.d.ts +45 -24
- package/dist/command-catalog.generated.js +57 -30
- package/dist/commands/core-command-catalog.js +3 -2
- package/dist/commands/core-delegate-w1b.d.ts +2 -0
- package/dist/commands/core-delegate-w1b.js +28 -2
- package/dist/commands/core-delegate.d.ts +3 -1
- package/dist/commands/core-delegate.js +35 -5
- package/dist/commands/core-handoff-fast.d.ts +18 -0
- package/dist/commands/core-handoff-fast.js +103 -0
- package/dist/commands/core-handoff-open-steps.d.ts +21 -0
- package/dist/commands/core-handoff-open-steps.js +264 -0
- package/dist/commands/core-handoff.d.ts +4 -2
- package/dist/commands/core-handoff.js +22 -249
- package/dist/commands/core-jobs-native.d.ts +2 -0
- package/dist/commands/core-jobs-native.js +22 -11
- package/dist/commands/core-knowledge-prefs.d.ts +2 -0
- package/dist/commands/core-knowledge-prefs.js +13 -1
- package/dist/commands/core-ontology-native.d.ts +2 -0
- package/dist/commands/core-ontology-native.js +22 -2
- package/dist/commands/core-policy.d.ts +2 -0
- package/dist/commands/core-policy.js +18 -1
- package/dist/commands/core.js +2 -1
- package/dist/commands/daemon.d.ts +2 -1
- package/dist/commands/daemon.js +22 -7
- package/dist/commands/lanes-autopilot.d.ts +11 -0
- package/dist/commands/lanes-autopilot.js +336 -0
- package/dist/commands/lanes-move.js +54 -1
- package/dist/commands/lanes-questions.js +12 -5
- package/dist/commands/lanes-shared.d.ts +17 -0
- package/dist/commands/lanes-stories.d.ts +14 -0
- package/dist/commands/lanes-stories.js +308 -0
- package/dist/commands/lanes.d.ts +2 -0
- package/dist/commands/lanes.js +158 -314
- package/dist/fast-core.js +53 -25
- package/dist/fast-scaffold.d.ts +15 -2
- package/dist/fast-scaffold.js +167 -7
- package/dist/lib/core-utils/sentry-report.js +2 -2
- package/dist/lib/core-utils/worktree-resume.d.ts +2 -0
- package/dist/lib/core-utils/worktree-resume.js +16 -0
- package/dist/lib/daemon/migrate.d.ts +8 -1
- package/dist/lib/daemon/migrate.js +19 -7
- package/dist/lib/daemon/run.d.ts +11 -0
- package/dist/lib/daemon/run.js +17 -1
- package/dist/lib/lanes/autopilot-metrics.d.ts +99 -0
- package/dist/lib/lanes/autopilot-metrics.js +301 -0
- package/dist/lib/lanes/autopilot.d.ts +13 -1
- package/dist/lib/lanes/autopilot.js +271 -28
- package/dist/lib/lanes/grants.d.ts +1 -1
- package/dist/lib/lanes/grants.js +7 -5
- package/dist/lib/lanes/index.d.ts +1 -1
- package/dist/lib/lanes/keep-alive.d.ts +5 -0
- package/dist/lib/lanes/keep-alive.js +9 -4
- package/dist/lib/lanes/questions.d.ts +2 -1
- package/dist/lib/lanes/questions.js +2 -0
- package/dist/lib/lanes/reconcile.js +186 -9
- package/dist/lib/lanes/spawn.js +4 -0
- package/dist/lib/lanes/store.d.ts +2 -0
- package/dist/lib/lanes/store.js +53 -4
- package/dist/lib/lanes/types.d.ts +13 -1
- package/dist/lib/lanes/types.js +2 -2
- package/dist/lib/lanes/watcher.js +3 -1
- package/dist/native-fast-route.d.ts +3 -1
- package/dist/native-fast-route.js +10 -8
- package/dist/utils/contribution-table.d.ts +1 -1
- package/dist/utils/fast-stream-errors.d.ts +12 -0
- package/dist/utils/fast-stream-errors.js +18 -0
- package/dist/utils/scaffold-fast-import-guard.d.ts +2 -2
- package/dist/utils/scaffold-fast-import-guard.js +6 -3
- package/dist/utils/self-update.d.ts +7 -0
- package/dist/utils/self-update.js +5 -1
- package/dist/utils/version-gate.d.ts +15 -0
- package/dist/utils/version-gate.js +46 -2
- package/package.json +1 -1
|
@@ -63,7 +63,7 @@ import * as path from "node:path";
|
|
|
63
63
|
import semver from "semver";
|
|
64
64
|
import chalk from "chalk";
|
|
65
65
|
import { CLI_NAME, CLI_VERSION } from "../cli-version.js";
|
|
66
|
-
import { buildBunInstallArgv, buildPnpmInstallArgv, buildPrefixedInstallArgv, buildSpawnPlan, checkUpdateConvergence, derivePnpmHome, isBunManagedPackageDir, isLocalDependencyInstall, isPnpmManagedPackageDir, isPrefixWritable, nonWritablePrefixNote, openInstallOutput, pnpmUpdateEnv, resolveRunningInstall, runUpdateCommand, runSupervisedUpdateCommand, } from "./version-gate.js";
|
|
66
|
+
import { buildBunInstallArgv, buildPnpmInstallArgv, buildPrefixedInstallArgv, buildSpawnPlan, checkUpdateConvergence, derivePnpmHome, detachUpdateSupervisor, isBunManagedPackageDir, isLocalDependencyInstall, isPnpmManagedPackageDir, isPrefixWritable, nonWritablePrefixNote, openInstallOutput, pnpmUpdateEnv, resolveRunningInstall, runUpdateCommand, runSupervisedUpdateCommand, } from "./version-gate.js";
|
|
67
67
|
import { canStageInstall, stagedNpmInstall } from "./staged-install.js";
|
|
68
68
|
import { acquireUpdateLock as acquireSharedUpdateLock } from "./update-lock.js";
|
|
69
69
|
import { markLatestIneffective } from "./version-check.js";
|
|
@@ -420,6 +420,9 @@ async function updateAndReexec(argv, flavor, known, deps) {
|
|
|
420
420
|
if (!releaseLock)
|
|
421
421
|
return { action: "skipped", latest };
|
|
422
422
|
const renamePath = deps.renamePath ?? fs.renameSync;
|
|
423
|
+
// The in-place update moves the package aside, and the installer's
|
|
424
|
+
// supervisor ships inside it, so run the installer through a copy.
|
|
425
|
+
const supervisor = staged ? null : (deps.detachSupervisor ?? detachUpdateSupervisor)();
|
|
423
426
|
// The staged install keeps the running package in place until the swap and
|
|
424
427
|
// restores it itself, so it takes no snapshot.
|
|
425
428
|
const installSnapshot = staged ? null : snapshotInstall(install, renamePath);
|
|
@@ -467,6 +470,7 @@ async function updateAndReexec(argv, flavor, known, deps) {
|
|
|
467
470
|
throw error;
|
|
468
471
|
}
|
|
469
472
|
finally {
|
|
473
|
+
supervisor?.dispose();
|
|
470
474
|
releaseLock();
|
|
471
475
|
}
|
|
472
476
|
if (!result.ok) {
|
|
@@ -284,6 +284,21 @@ export { buildSpawnPlan, quoteForWindowsShell };
|
|
|
284
284
|
*/
|
|
285
285
|
export declare function inOwnProcessGroup<T extends object>(options: T): T;
|
|
286
286
|
declare function updateTimeoutMs(env?: NodeJS.ProcessEnv): number;
|
|
287
|
+
/** The supervisor script the next install runs under. */
|
|
288
|
+
export declare function updateSupervisorPath(): string;
|
|
289
|
+
export interface DetachedUpdateSupervisor {
|
|
290
|
+
path: string;
|
|
291
|
+
dispose(): void;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Copies the supervisor to a temp dir and runs installs through the copy until
|
|
295
|
+
* disposed. The in-place self-update moves the whole hq-cli package aside
|
|
296
|
+
* before it starts the installer, and the supervisor ships inside that package
|
|
297
|
+
* (5.290.0-5.292.0 failed every npm global self-update with MODULE_NOT_FOUND).
|
|
298
|
+
* The script needs only Node builtins, so the copy runs on its own. Returns
|
|
299
|
+
* null when the copy cannot be made; the caller then keeps the bundled path.
|
|
300
|
+
*/
|
|
301
|
+
export declare function detachUpdateSupervisor(): DetachedUpdateSupervisor | null;
|
|
287
302
|
/**
|
|
288
303
|
* Where an install's output goes — the other half of surviving a killed parent.
|
|
289
304
|
*
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import { spawnSync } from "node:child_process";
|
|
31
31
|
import { installPathCompatibilityEnabled } from "../lib/install-path-compatibility-flag.js";
|
|
32
32
|
import { buildSpawnPlan, quoteForWindowsShell } from "./windows-spawn.js";
|
|
33
|
-
import { accessSync, closeSync, constants as fsConstants, existsSync, mkdtempSync, openSync, readdirSync, realpathSync, readFileSync, rmSync, } from "node:fs";
|
|
33
|
+
import { accessSync, closeSync, constants as fsConstants, copyFileSync, existsSync, mkdtempSync, openSync, readdirSync, realpathSync, readFileSync, rmSync, } from "node:fs";
|
|
34
34
|
import os from "node:os";
|
|
35
35
|
import path from "node:path";
|
|
36
36
|
import { fileURLToPath } from "node:url";
|
|
@@ -674,6 +674,50 @@ function updateTimeoutMs(env = process.env) {
|
|
|
674
674
|
* compiled module for production and is directly runnable from source tests.
|
|
675
675
|
*/
|
|
676
676
|
const UPDATE_COMMAND_SUPERVISOR = fileURLToPath(new URL("./update-command-supervisor.cjs", import.meta.url));
|
|
677
|
+
/** Set while a self-update runs the installer through a copy of the supervisor. */
|
|
678
|
+
let detachedSupervisor = null;
|
|
679
|
+
/** The supervisor script the next install runs under. */
|
|
680
|
+
export function updateSupervisorPath() {
|
|
681
|
+
return detachedSupervisor ?? UPDATE_COMMAND_SUPERVISOR;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Copies the supervisor to a temp dir and runs installs through the copy until
|
|
685
|
+
* disposed. The in-place self-update moves the whole hq-cli package aside
|
|
686
|
+
* before it starts the installer, and the supervisor ships inside that package
|
|
687
|
+
* (5.290.0-5.292.0 failed every npm global self-update with MODULE_NOT_FOUND).
|
|
688
|
+
* The script needs only Node builtins, so the copy runs on its own. Returns
|
|
689
|
+
* null when the copy cannot be made; the caller then keeps the bundled path.
|
|
690
|
+
*/
|
|
691
|
+
export function detachUpdateSupervisor() {
|
|
692
|
+
if (detachedSupervisor)
|
|
693
|
+
return null;
|
|
694
|
+
let dir;
|
|
695
|
+
try {
|
|
696
|
+
dir = mkdtempSync(path.join(os.tmpdir(), "hq-cli-update-supervisor-"));
|
|
697
|
+
const copy = path.join(dir, "update-command-supervisor.cjs");
|
|
698
|
+
copyFileSync(UPDATE_COMMAND_SUPERVISOR, copy);
|
|
699
|
+
detachedSupervisor = copy;
|
|
700
|
+
const tempDir = dir;
|
|
701
|
+
return {
|
|
702
|
+
path: copy,
|
|
703
|
+
dispose: () => {
|
|
704
|
+
if (detachedSupervisor === copy)
|
|
705
|
+
detachedSupervisor = null;
|
|
706
|
+
try {
|
|
707
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
708
|
+
}
|
|
709
|
+
catch {
|
|
710
|
+
// Best-effort cleanup of a temp dir.
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
catch {
|
|
716
|
+
if (dir)
|
|
717
|
+
rmSync(dir, { recursive: true, force: true });
|
|
718
|
+
return null;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
677
721
|
function readSupervisorSpawnError(errorMarker) {
|
|
678
722
|
try {
|
|
679
723
|
const value = JSON.parse(readFileSync(errorMarker, "utf-8"));
|
|
@@ -754,7 +798,7 @@ export function runSupervisedUpdateCommand(cmd, args, output, env) {
|
|
|
754
798
|
// waits briefly, sends KILL to survivors, and waits for its direct child so
|
|
755
799
|
// the completed result leaves no zombie behind.
|
|
756
800
|
const result = spawnSync(process.execPath, [
|
|
757
|
-
|
|
801
|
+
updateSupervisorPath(),
|
|
758
802
|
JSON.stringify({
|
|
759
803
|
cmd: plan.cmd,
|
|
760
804
|
args: plan.args,
|