@indigoai-us/hq-cli 5.311.1 → 5.311.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 +12 -0
- package/assets/scaffold/core/scripts/hq-delegate-grant.sh +31 -5
- package/assets/scaffold/core/scripts/hq-delegate-send.sh +1 -1
- package/assets/scaffold/core/scripts/hq-delegate-verify.sh +27 -2
- package/dist/commands/core-delegate-w1b.js +54 -7
- package/dist/commands/core-delegate.d.ts +1 -0
- package/dist/commands/core-delegate.js +1 -1
- package/dist/commands/files-browse.d.ts +3 -2
- package/dist/commands/files-browse.js +2 -7
- package/dist/commands/lanes-message.js +18 -7
- package/dist/commands/lanes-shared.d.ts +2 -0
- package/dist/commands/lanes-watch.js +1 -5
- package/dist/commands/lanes.js +10 -13
- package/dist/fast-scaffold.d.ts +4 -0
- package/dist/fast-scaffold.js +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/flag-registry.d.ts +2 -0
- package/dist/lib/flag-registry.js +19 -12
- package/dist/lib/lanes/autopilot.js +19 -2
- package/dist/lib/lanes/delivery.d.ts +1 -0
- package/dist/lib/lanes/keep-alive.d.ts +1 -3
- package/dist/lib/lanes/keep-alive.js +2 -4
- package/dist/lib/lanes/reconcile.js +14 -36
- package/dist/lib/lanes/spawn.d.ts +2 -0
- package/dist/lib/lanes/spawn.js +35 -12
- package/dist/lib/lanes/types.d.ts +2 -2
- package/dist/lib/lanes/watch.d.ts +0 -1
- package/dist/lib/lanes/watch.js +4 -9
- package/dist/main.js +1 -1
- package/dist/node-network-compat-core.d.ts +12 -0
- package/dist/node-network-compat-core.js +41 -0
- package/dist/node-network-compat-fast.d.ts +7 -0
- package/dist/node-network-compat-fast.js +23 -0
- package/dist/node-network-compat.d.ts +2 -18
- package/dist/node-network-compat.js +4 -39
- package/dist/node-preflight.d.ts +7 -1
- package/dist/node-preflight.js +5 -5
- package/dist/utils/files-browse-acl.d.ts +5 -0
- package/dist/utils/files-browse-acl.js +11 -0
- package/dist/utils/hq-core-yaml.d.ts +10 -0
- package/dist/utils/hq-core-yaml.js +40 -0
- package/dist/utils/pack-contributions.d.ts +2 -9
- package/dist/utils/pack-contributions.js +1 -39
- package/dist/utils/scaffold-fast-import-guard.js +5 -1
- package/dist/utils/version-report.js +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Keep this module safe to import immediately after the Node version preflight.
|
|
7
|
-
*/
|
|
8
|
-
import * as nodeNet from "node:net";
|
|
9
|
-
export const HQ_NETWORK_FAMILY_ATTEMPT_TIMEOUT_MS = 1000;
|
|
10
|
-
const ATTEMPT_TIMEOUT_OPTION = "--network-family-autoselection-attempt-timeout";
|
|
11
|
-
function hasExplicitAttemptTimeout(nodeOptions, execArgv) {
|
|
12
|
-
const optionPattern = new RegExp("(?:^|\\s)" + ATTEMPT_TIMEOUT_OPTION + "(?:=|\\s|$)");
|
|
13
|
-
return (optionPattern.test(nodeOptions) ||
|
|
14
|
-
execArgv.some((argument) => argument === ATTEMPT_TIMEOUT_OPTION ||
|
|
15
|
-
argument.startsWith(ATTEMPT_TIMEOUT_OPTION + "=")));
|
|
16
|
-
}
|
|
17
|
-
function resolveSetAttemptTimeout(override) {
|
|
18
|
-
if (override === null)
|
|
19
|
-
return undefined;
|
|
20
|
-
if (override)
|
|
21
|
-
return override;
|
|
22
|
-
const fn = nodeNet.setDefaultAutoSelectFamilyAttemptTimeout;
|
|
23
|
-
return typeof fn === "function" ? fn.bind(nodeNet) : undefined;
|
|
24
|
-
}
|
|
25
|
-
export function configureNodeNetworkCompatibility(options = {}) {
|
|
26
|
-
const nodeOptions = options.nodeOptions ?? process.env.NODE_OPTIONS ?? "";
|
|
27
|
-
const execArgv = options.execArgv ?? process.execArgv;
|
|
28
|
-
if (hasExplicitAttemptTimeout(nodeOptions, execArgv)) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
const setAttemptTimeout = resolveSetAttemptTimeout(options.setAttemptTimeout);
|
|
32
|
-
if (!setAttemptTimeout) {
|
|
33
|
-
// Runtime lacks the API; the Node preflight should already have exited.
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
setAttemptTimeout(HQ_NETWORK_FAMILY_ATTEMPT_TIMEOUT_MS);
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
configureNodeNetworkCompatibility();
|
|
1
|
+
/** Unconditional compatibility setup for the full CLI command graph. */
|
|
2
|
+
import { configureNodeNetworkCompatibilityOnce } from "./node-network-compat-core.js";
|
|
3
|
+
export { configureNodeNetworkCompatibility, HQ_NETWORK_FAMILY_ATTEMPT_TIMEOUT_MS, } from "./node-network-compat-core.js";
|
|
4
|
+
configureNodeNetworkCompatibilityOnce();
|
|
40
5
|
//# sourceMappingURL=node-network-compat.js.map
|
package/dist/node-preflight.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export interface NodeVersionCheck {
|
|
|
23
23
|
major: number;
|
|
24
24
|
message?: string;
|
|
25
25
|
}
|
|
26
|
+
export interface NodePreflightOptions {
|
|
27
|
+
versionString?: string;
|
|
28
|
+
skip?: string;
|
|
29
|
+
stderr?: Pick<NodeJS.WriteStream, "write">;
|
|
30
|
+
exit?: (code: number) => void;
|
|
31
|
+
}
|
|
26
32
|
/**
|
|
27
33
|
* Pure check: is the given Node version string (e.g. "18.19.0") supported?
|
|
28
34
|
* Defaults to the running runtime's version. An unparseable version is treated
|
|
@@ -35,5 +41,5 @@ export declare function checkNodeVersion(versionString?: string): NodeVersionChe
|
|
|
35
41
|
* `HQ_SKIP_NODE_PREFLIGHT=1` to bypass (used by the test runner, which already
|
|
36
42
|
* runs on a supported Node).
|
|
37
43
|
*/
|
|
38
|
-
export declare function enforceNodeVersion(): void;
|
|
44
|
+
export declare function enforceNodeVersion(options?: NodePreflightOptions): void;
|
|
39
45
|
//# sourceMappingURL=node-preflight.d.ts.map
|
package/dist/node-preflight.js
CHANGED
|
@@ -39,13 +39,13 @@ export function checkNodeVersion(versionString = process.versions.node) {
|
|
|
39
39
|
* `HQ_SKIP_NODE_PREFLIGHT=1` to bypass (used by the test runner, which already
|
|
40
40
|
* runs on a supported Node).
|
|
41
41
|
*/
|
|
42
|
-
export function enforceNodeVersion() {
|
|
43
|
-
if (process.env.HQ_SKIP_NODE_PREFLIGHT)
|
|
42
|
+
export function enforceNodeVersion(options = {}) {
|
|
43
|
+
if (options.skip ?? process.env.HQ_SKIP_NODE_PREFLIGHT)
|
|
44
44
|
return;
|
|
45
|
-
const result = checkNodeVersion();
|
|
45
|
+
const result = checkNodeVersion(options.versionString ?? process.versions.node);
|
|
46
46
|
if (!result.ok && result.message) {
|
|
47
|
-
process.stderr.write(`${result.message}\n`);
|
|
48
|
-
process.exit(1);
|
|
47
|
+
(options.stderr ?? process.stderr).write(`${result.message}\n`);
|
|
48
|
+
(options.exit ?? process.exit)(1);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
enforceNodeVersion();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** ACL source values and their stable labels in the hq files browse table. */
|
|
2
|
+
export type AclSource = "shared-with-you" | "creator" | "role-bypass" | "personal-vault" | "private-folder";
|
|
3
|
+
export declare const ACL_SOURCE_DISPLAY_LABELS: Readonly<Record<AclSource, string>>;
|
|
4
|
+
export declare function displayAclSource(source: AclSource): string;
|
|
5
|
+
//# sourceMappingURL=files-browse-acl.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const ACL_SOURCE_DISPLAY_LABELS = {
|
|
2
|
+
"shared-with-you": "shared-with-you",
|
|
3
|
+
creator: "creator access — creator-only",
|
|
4
|
+
"role-bypass": "role-bypass",
|
|
5
|
+
"personal-vault": "personal-vault",
|
|
6
|
+
"private-folder": "private folder — children are creator-only",
|
|
7
|
+
};
|
|
8
|
+
export function displayAclSource(source) {
|
|
9
|
+
return ACL_SOURCE_DISPLAY_LABELS[source];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=files-browse-acl.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function readHqVersion(hqRoot: string): string | null;
|
|
2
|
+
export interface CatalogEntry {
|
|
3
|
+
source: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
conditional?: string;
|
|
6
|
+
auto_install?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Read recommended_packages from core.yaml (the curated content-pack catalog). */
|
|
9
|
+
export declare function readRecommendedPackages(hqRoot: string): CatalogEntry[];
|
|
10
|
+
//# sourceMappingURL=hq-core-yaml.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import * as yaml from "js-yaml";
|
|
4
|
+
/** Locate core.yaml: v14+ nests it under core/, older layouts at the root. */
|
|
5
|
+
function coreYamlPath(hqRoot) {
|
|
6
|
+
const nested = path.join(hqRoot, "core", "core.yaml");
|
|
7
|
+
if (fs.existsSync(nested))
|
|
8
|
+
return nested;
|
|
9
|
+
const flat = path.join(hqRoot, "core.yaml");
|
|
10
|
+
if (fs.existsSync(flat))
|
|
11
|
+
return flat;
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
export function readHqVersion(hqRoot) {
|
|
15
|
+
const filePath = coreYamlPath(hqRoot);
|
|
16
|
+
if (!filePath)
|
|
17
|
+
return null;
|
|
18
|
+
try {
|
|
19
|
+
const config = yaml.load(fs.readFileSync(filePath, "utf-8"));
|
|
20
|
+
return config?.hqVersion ?? null;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Read recommended_packages from core.yaml (the curated content-pack catalog). */
|
|
27
|
+
export function readRecommendedPackages(hqRoot) {
|
|
28
|
+
const filePath = coreYamlPath(hqRoot);
|
|
29
|
+
if (!filePath)
|
|
30
|
+
return [];
|
|
31
|
+
try {
|
|
32
|
+
const config = yaml.load(fs.readFileSync(filePath, "utf-8"));
|
|
33
|
+
const list = config?.recommended_packages;
|
|
34
|
+
return Array.isArray(list) ? list : [];
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=hq-core-yaml.js.map
|
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
import type { PackManifest, PackContributeKey } from '../types.js';
|
|
40
40
|
import { CONTRIBUTION_TABLE, type WireMode } from './contribution-table.js';
|
|
41
41
|
import { type UnregisterServerResult, type SafeWriteEnv, type AcquireLockOptions } from '../commands/mcp-registration.js';
|
|
42
|
+
export { readHqVersion, readRecommendedPackages } from './hq-core-yaml.js';
|
|
43
|
+
export type { CatalogEntry } from './hq-core-yaml.js';
|
|
42
44
|
export { CONTRIBUTION_TABLE };
|
|
43
45
|
export type { WireMode };
|
|
44
46
|
/**
|
|
@@ -163,13 +165,4 @@ export interface UnwirePackMcpOptions {
|
|
|
163
165
|
* @param contributes the pack's `contributes` block (its `mcp` list drives removal)
|
|
164
166
|
*/
|
|
165
167
|
export declare function unwirePackMcp(packName: string, contributes: Partial<Record<PackContributeKey, string[]>>, options?: UnwirePackMcpOptions): UnwireMcpResult;
|
|
166
|
-
export declare function readHqVersion(hqRoot: string): string | null;
|
|
167
|
-
export interface CatalogEntry {
|
|
168
|
-
source: string;
|
|
169
|
-
description?: string;
|
|
170
|
-
conditional?: string;
|
|
171
|
-
auto_install?: boolean;
|
|
172
|
-
}
|
|
173
|
-
/** Read `recommended_packages` from core.yaml (the curated content-pack catalog). */
|
|
174
|
-
export declare function readRecommendedPackages(hqRoot: string): CatalogEntry[];
|
|
175
168
|
//# sourceMappingURL=pack-contributions.d.ts.map
|
|
@@ -41,6 +41,7 @@ import * as path from 'path';
|
|
|
41
41
|
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
|
+
export { readHqVersion, readRecommendedPackages } from './hq-core-yaml.js';
|
|
44
45
|
// NOTE on dependency direction: this module imports from ../commands/mcp-registration.js
|
|
45
46
|
// to un-register `wire:merge` (mcp) servers on uninstall. mcp-registration.ts imports
|
|
46
47
|
// ONLY fs/os/path/smol-toml (it does NOT import from pack-contributions.ts), so there
|
|
@@ -343,43 +344,4 @@ export function unwirePackMcp(packName, contributes, options) {
|
|
|
343
344
|
}
|
|
344
345
|
return { servers };
|
|
345
346
|
}
|
|
346
|
-
// ---------------------------------------------------------------------------
|
|
347
|
-
// Host introspection: hqVersion + recommended_packages catalog
|
|
348
|
-
// ---------------------------------------------------------------------------
|
|
349
|
-
/** Locate core.yaml -- v14+ nests it under `core/`, older layouts at the root. */
|
|
350
|
-
function coreYamlPath(hqRoot) {
|
|
351
|
-
const nested = path.join(hqRoot, 'core', 'core.yaml');
|
|
352
|
-
if (fs.existsSync(nested))
|
|
353
|
-
return nested;
|
|
354
|
-
const flat = path.join(hqRoot, 'core.yaml');
|
|
355
|
-
if (fs.existsSync(flat))
|
|
356
|
-
return flat;
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
export function readHqVersion(hqRoot) {
|
|
360
|
-
const p = coreYamlPath(hqRoot);
|
|
361
|
-
if (!p)
|
|
362
|
-
return null;
|
|
363
|
-
try {
|
|
364
|
-
const c = yaml.load(fs.readFileSync(p, 'utf-8'));
|
|
365
|
-
return c?.hqVersion ?? null;
|
|
366
|
-
}
|
|
367
|
-
catch {
|
|
368
|
-
return null;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
/** Read `recommended_packages` from core.yaml (the curated content-pack catalog). */
|
|
372
|
-
export function readRecommendedPackages(hqRoot) {
|
|
373
|
-
const p = coreYamlPath(hqRoot);
|
|
374
|
-
if (!p)
|
|
375
|
-
return [];
|
|
376
|
-
try {
|
|
377
|
-
const c = yaml.load(fs.readFileSync(p, 'utf-8'));
|
|
378
|
-
const list = c?.recommended_packages;
|
|
379
|
-
return Array.isArray(list) ? list : [];
|
|
380
|
-
}
|
|
381
|
-
catch {
|
|
382
|
-
return [];
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
347
|
//# sourceMappingURL=pack-contributions.js.map
|
|
@@ -6,6 +6,8 @@ function forbiddenFastPathModules(loadedModules, distDirectory, allowedCommandMo
|
|
|
6
6
|
const commands = `${path.join(dist, "commands")}${path.sep}`;
|
|
7
7
|
const flagRegistry = path.join(dist, "lib", "flag-registry.js");
|
|
8
8
|
const coreCommand = path.join(dist, "commands", "core.js");
|
|
9
|
+
const fullNetworkCompat = path.join(dist, "node-network-compat.js");
|
|
10
|
+
const sentryEntrypoint = path.join(dist, "sentry.js");
|
|
9
11
|
const allowedCommands = new Set(allowedCommandModules.map((module) => path.resolve(module)));
|
|
10
12
|
return [...new Set(loadedModules.map((loaded) => {
|
|
11
13
|
if (loaded.startsWith("file:")) {
|
|
@@ -22,7 +24,9 @@ function forbiddenFastPathModules(loadedModules, distDirectory, allowedCommandMo
|
|
|
22
24
|
path.resolve(loaded).startsWith(commands) ||
|
|
23
25
|
path.resolve(loaded) === flagRegistry ||
|
|
24
26
|
path.resolve(loaded) === coreCommand ||
|
|
25
|
-
path.resolve(loaded)
|
|
27
|
+
path.resolve(loaded) === fullNetworkCompat ||
|
|
28
|
+
path.resolve(loaded) === sentryEntrypoint ||
|
|
29
|
+
path.resolve(loaded).includes(`${path.sep}node_modules${path.sep}@sentry${path.sep}`))
|
|
26
30
|
.filter((loaded) => !allowedCommands.has(path.resolve(loaded)) ||
|
|
27
31
|
path.resolve(loaded) === main || path.resolve(loaded) === coreCommand)
|
|
28
32
|
.sort();
|
|
@@ -12,7 +12,7 @@ import semver from "semver";
|
|
|
12
12
|
import { CLI_VERSION } from "../cli-version.js";
|
|
13
13
|
import { wantsJson } from "../version-request.js";
|
|
14
14
|
import { findHqRoot } from "./manifest.js";
|
|
15
|
-
import { readHqVersion } from "./
|
|
15
|
+
import { readHqVersion } from "./hq-core-yaml.js";
|
|
16
16
|
export const HQ_CORE_LATEST_URL = "https://api.github.com/repos/indigoai-us/hq-core/releases/latest";
|
|
17
17
|
export const LATEST_FETCH_TIMEOUT_MS = 3_000;
|
|
18
18
|
export function normalizeHqCoreTag(tag) {
|