@indigoai-us/hq-cli 5.345.237 → 5.345.241
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 +33 -0
- package/assets/scaffold/core/scripts/hq-delegate-repo.sh +7 -1
- package/assets/scaffold/core/scripts/hq-delegate-secrets.sh +95 -20
- package/assets/scaffold/core/scripts/hq-delegate-transfer.sh +57 -9
- package/dist/command-catalog.generated.d.ts +185 -3
- package/dist/command-catalog.generated.js +228 -3
- package/dist/command-registration-plan.d.ts +6 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/bot.d.ts +2 -0
- package/dist/commands/bot.js +23 -0
- package/dist/commands/cloud-off-gate.d.ts +2 -1
- package/dist/commands/cloud-off-gate.js +17 -4
- package/dist/commands/cloud.d.ts +17 -2
- package/dist/commands/cloud.js +126 -24
- package/dist/commands/core-delegate-w1b.js +35 -10
- package/dist/commands/core-delegate.d.ts +2 -1
- package/dist/commands/core-delegate.js +207 -48
- package/dist/commands/deploy-comments.js +8 -2
- package/dist/commands/deploy-events.d.ts +40 -0
- package/dist/commands/deploy-events.js +300 -0
- package/dist/commands/doctor.d.ts +4 -4
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/feedback.js +2 -3
- package/dist/commands/keyed-sync-pull.d.ts +12 -0
- package/dist/commands/keyed-sync-pull.js +151 -0
- package/dist/commands/library-add.d.ts +5 -2
- package/dist/commands/library-add.js +22 -9
- package/dist/commands/mcp-registration.d.ts +4 -18
- package/dist/commands/mcp-registration.js +9 -29
- package/dist/commands/mesh.d.ts +4 -0
- package/dist/commands/mesh.js +25 -5
- package/dist/commands/pack-install.d.ts +2 -3
- package/dist/commands/pack-install.js +6 -8
- package/dist/commands/secrets.d.ts +3 -4
- package/dist/commands/secrets.js +3 -20
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +307 -232
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/lib/agent-kit/inbox-state.d.ts +2 -1
- package/dist/lib/agent-kit/inbox-state.js +27 -3
- package/dist/lib/bot/api.d.ts +2 -1
- package/dist/lib/bot/api.js +2 -15
- package/dist/lib/bot/promote.d.ts +23 -0
- package/dist/lib/bot/promote.js +73 -0
- package/dist/lib/bot/promotion-hold-reconcile.d.ts +56 -0
- package/dist/lib/bot/promotion-hold-reconcile.js +155 -0
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +0 -2
- package/dist/lib/capacity/collectors/claude-oauth.js +0 -5
- package/dist/lib/core-utils/delegate-helper-paths.d.ts +26 -0
- package/dist/lib/core-utils/delegate-helper-paths.js +33 -0
- package/dist/lib/daemon/jq-provision.d.ts +63 -0
- package/dist/lib/daemon/jq-provision.js +155 -0
- package/dist/lib/daemon/lanes-reconcile-guard.d.ts +4 -3
- package/dist/lib/daemon/lanes-reconcile-guard.js +4 -4
- package/dist/lib/daemon/mesh-owner.d.ts +4 -0
- package/dist/lib/daemon/mesh-owner.js +20 -0
- package/dist/lib/daemon/ops/policy.d.ts +3 -0
- package/dist/lib/daemon/ops/policy.js +32 -4
- package/dist/lib/daemon/run.d.ts +17 -1
- package/dist/lib/daemon/run.js +24 -3
- package/dist/lib/daemon/server.d.ts +6 -0
- package/dist/lib/daemon/server.js +5 -0
- package/dist/lib/daemon/verified-jq.d.ts +96 -0
- package/dist/lib/daemon/verified-jq.js +337 -0
- package/dist/lib/doctor/checks/jq.js +16 -0
- package/dist/lib/doctor/deep/executor.d.ts +7 -0
- package/dist/lib/doctor/deep/executor.js +1 -1
- package/dist/lib/doctor/deep/parity.js +1 -27
- package/dist/lib/doctor/deep/sandbox.d.ts +2 -2
- package/dist/lib/doctor/deep/sandbox.js +3 -19
- package/dist/lib/doctor/fix/refresh-sync-handoff.js +52 -21
- package/dist/lib/doctor/fixtures/discover.d.ts +2 -0
- package/dist/lib/doctor/fixtures/discover.js +1 -1
- package/dist/lib/doctor/json-output.d.ts +1 -1
- package/dist/lib/doctor/registry.d.ts +6 -7
- package/dist/lib/doctor/registry.js +6 -7
- package/dist/lib/doctor/report.d.ts +9 -10
- package/dist/lib/doctor/report.js +4 -4
- package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
- package/dist/lib/flag-registry-worker-source.generated.js +1 -1
- package/dist/lib/jq/install.d.ts +27 -0
- package/dist/lib/jq/install.js +156 -0
- package/dist/lib/lanes/outpost-dispatch.d.ts +1 -1
- package/dist/lib/lanes/outpost-dispatch.js +13 -13
- package/dist/lib/lanes/outpost-pruner-install.js +1 -1
- package/dist/lib/mesh/live/daemon/doctor.js +7 -1
- package/dist/lib/mesh/live/daemon/install.d.ts +4 -0
- package/dist/lib/mesh/live/daemon/install.js +10 -0
- package/dist/lib/mesh/live/daemon/run.js +17 -0
- package/dist/lib/mesh/live/emit-retry.d.ts +20 -2
- package/dist/lib/mesh/live/emit-retry.js +57 -4
- package/dist/lib/mesh/live/emit.js +25 -4
- package/dist/lib/mesh/live/flush.d.ts +2 -0
- package/dist/lib/mesh/live/flush.js +21 -8
- package/dist/lib/mesh/live/spool.d.ts +9 -1
- package/dist/lib/mesh/live/spool.js +41 -29
- package/dist/lib/sync-core/rollout-state.d.ts +9 -1
- package/dist/lib/sync-core/rollout-state.js +34 -4
- package/dist/lib/windows/jq.d.ts +4 -0
- package/dist/lib/windows/jq.js +10 -39
- package/dist/lib/workers-registry/index.js +7 -11
- package/dist/utils/callback-port-busy.d.ts +2 -2
- package/dist/utils/callback-port-busy.js +2 -2
- package/dist/utils/cli-network-lifecycle.js +1 -0
- package/dist/utils/client-health-contract.d.ts +2 -0
- package/dist/utils/client-health-contract.js +1 -1
- package/dist/utils/client-health.js +1 -9
- package/dist/utils/cognito-config.js +5 -0
- package/dist/utils/cognito-session.d.ts +4 -6
- package/dist/utils/cognito-session.js +4 -24
- package/dist/utils/incomplete-install-error.js +1 -11
- package/dist/utils/install-tree-torn.d.ts +11 -0
- package/dist/utils/install-tree-torn.js +1 -1
- package/dist/utils/resident-package-preload.js +2 -1
- package/docs/anywhere-runtime.md +8 -0
- package/package.json +9 -9
|
@@ -134,25 +134,6 @@ export class PartialRegistrationError extends McpRegistrationError {
|
|
|
134
134
|
this.backupDir = backupDir;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Thrown by not-yet-implemented seams (the US-007/US-008 Claude/Codex emitters).
|
|
139
|
-
* Carries a stable `code` so callers/tests can identify it without string-
|
|
140
|
-
* matching the message, and a `story` for at-a-glance attribution. KEPT from the
|
|
141
|
-
* US-005 seam: the merge EMITTERS are still pending after US-006 (which ships the
|
|
142
|
-
* safe-write substrate beneath them).
|
|
143
|
-
*/
|
|
144
|
-
export class NotImplementedError extends Error {
|
|
145
|
-
/** Stable, machine-checkable discriminator. */
|
|
146
|
-
code = 'NotImplemented';
|
|
147
|
-
/** The PRD story that lands the real implementation. */
|
|
148
|
-
story;
|
|
149
|
-
constructor(message, story = 'US-007') {
|
|
150
|
-
super(message);
|
|
151
|
-
this.name = 'NotImplementedError';
|
|
152
|
-
this.story = story;
|
|
153
|
-
Object.setPrototypeOf(this, NotImplementedError.prototype);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
137
|
/** Resolve the env, defaulting `home` to the real `os.homedir()` for production callers. */
|
|
157
138
|
export function resolveEnv(env) {
|
|
158
139
|
const home = env?.home ?? os.homedir();
|
|
@@ -1078,12 +1059,11 @@ function restoreSafely(realTarget, backupDir) {
|
|
|
1078
1059
|
// merges exactly ONE `mcpServers.<name>` entry into the PINNED single Claude
|
|
1079
1060
|
// surface (top-level `~/.claude.json` `mcpServers`) via {@link writeConfigAtomic}.
|
|
1080
1061
|
//
|
|
1081
|
-
// The Codex/TOML emitter is US-008
|
|
1082
|
-
// {@link registerServer} fan-out
|
|
1083
|
-
//
|
|
1084
|
-
//
|
|
1085
|
-
//
|
|
1086
|
-
// desired-state-convergence).
|
|
1062
|
+
// The Codex/TOML emitter is {@link registerCodexServer} (US-008). The
|
|
1063
|
+
// {@link registerServer} fan-out runs both arms; on a host without Codex the
|
|
1064
|
+
// Codex arm is a first-class skip (the substrate's {@link isCodexInstalled}
|
|
1065
|
+
// branch), never a crash and never a fabricated `~/.codex`. Each surface
|
|
1066
|
+
// self-heals on re-run (US-006 desired-state convergence).
|
|
1087
1067
|
//
|
|
1088
1068
|
// SECRET SAFETY (the hard rule from the PRD authModel / US-002 AC):
|
|
1089
1069
|
// - `${secret:NAME}` resolves ONLY here, at emit, via the injected
|
|
@@ -1491,10 +1471,10 @@ export function isMcpRegistrationEnabled(env = process.env) {
|
|
|
1491
1471
|
* `pack-install` routes `wire:'merge'` keys to). For each declared server name it
|
|
1492
1472
|
* loads + shape-checks the manifest, then fans out via {@link registerServer}.
|
|
1493
1473
|
*
|
|
1494
|
-
*
|
|
1495
|
-
*
|
|
1496
|
-
* supplied loader so this stays decoupled from
|
|
1497
|
-
* fully testable in isolation.
|
|
1474
|
+
* It wires the Claude/JSON surface (US-007) and the Codex/TOML surface (US-008);
|
|
1475
|
+
* on a host without Codex the Codex surface is a first-class skip. Manifests are
|
|
1476
|
+
* loaded with a caller-supplied loader so this stays decoupled from
|
|
1477
|
+
* `pack-install`'s payload layout and fully testable in isolation.
|
|
1498
1478
|
*
|
|
1499
1479
|
* @param pkg the pack name (e.g. `hq-pack-vyg-shopify`) — stamped as provenance
|
|
1500
1480
|
* @param names the bare server names from `contributes.mcp`
|
package/dist/commands/mesh.d.ts
CHANGED
|
@@ -92,6 +92,10 @@ export declare function runDaemonStatus(opts: {
|
|
|
92
92
|
/** launchctl/systemctl runner for the loaded probe (tests inject). */
|
|
93
93
|
run?: RunCommand;
|
|
94
94
|
uid?: number;
|
|
95
|
+
hqDaemonMesh?: () => {
|
|
96
|
+
daemonPid: number;
|
|
97
|
+
pid?: number;
|
|
98
|
+
} | null;
|
|
95
99
|
}): Promise<void>;
|
|
96
100
|
/** Work Mesh health report: `hq daemon doctor` (and the retiring `hq mesh daemon doctor`). */
|
|
97
101
|
export declare function runMeshDaemonDoctor(opts: {
|
package/dist/commands/mesh.js
CHANGED
|
@@ -35,7 +35,7 @@ import { appendHeldLine } from "../lib/mesh/live/spool.js";
|
|
|
35
35
|
import { createEmitPoster, buildMeshEmitEvent } from "../lib/mesh/live/emit-client.js";
|
|
36
36
|
import { enrichSessionEndEvent } from "../lib/mesh/live/report-summary.js";
|
|
37
37
|
import { emitEvents, formatEmitRejectionLines } from "../lib/mesh/live/emit.js";
|
|
38
|
-
import { readEmitRetry, writeEmitRetry } from "../lib/mesh/live/emit-retry.js";
|
|
38
|
+
import { appendEmitRetry, readEmitRetry, writeEmitRetry } from "../lib/mesh/live/emit-retry.js";
|
|
39
39
|
import { generateUlid } from "../lib/mesh/live/ulid.js";
|
|
40
40
|
import { readLegacyBacklogForMode } from "../lib/mesh/live/emit-replay.js";
|
|
41
41
|
import { resolveMeshEmitMode, writeMeshConfigMode, } from "../lib/mesh/live/daemon/mode.js";
|
|
@@ -63,7 +63,7 @@ import { deriveRemoteOwnerSlug, deriveRepoIdentityKey, } from "../lib/work-conte
|
|
|
63
63
|
import { promptRepoCompany, } from "../lib/work-context/repo-prompt.js";
|
|
64
64
|
import { requeueQuarantinedOutbox } from "../lib/work-context/outbox.js";
|
|
65
65
|
import { handOffInstallHere } from "../lib/daemon/handoff.js";
|
|
66
|
-
import { repairServiceUnitsFromOtherHome } from "../lib/daemon/mesh-owner.js";
|
|
66
|
+
import { hqDaemonMeshService, repairServiceUnitsFromOtherHome } from "../lib/daemon/mesh-owner.js";
|
|
67
67
|
import { runResidentCommandWithPackageLease } from "../utils/resident-package-preload.js";
|
|
68
68
|
import { exitCli } from "../utils/exit-after-worker.js";
|
|
69
69
|
export function formatCheckLines(threads, company, projectId) {
|
|
@@ -1166,7 +1166,16 @@ async function runPrdSync(opts) {
|
|
|
1166
1166
|
console.error(line);
|
|
1167
1167
|
}
|
|
1168
1168
|
const blocked = new Set(emitted.rejections.map((row) => row.eventId));
|
|
1169
|
-
|
|
1169
|
+
let retryPending;
|
|
1170
|
+
try {
|
|
1171
|
+
retryPending = readEmitRetry(meshRoot);
|
|
1172
|
+
}
|
|
1173
|
+
catch (err) {
|
|
1174
|
+
// Unknown which events still wait for retry: advance none of them.
|
|
1175
|
+
console.error(`work-mesh: prd-sync could not read the emit retry file; no stories advanced: ${(err instanceof Error ? err.message : String(err)).slice(0, 120)}`);
|
|
1176
|
+
retryPending = events;
|
|
1177
|
+
}
|
|
1178
|
+
for (const pending of retryPending) {
|
|
1170
1179
|
const id = typeof pending.eventId === "string" ? pending.eventId : "";
|
|
1171
1180
|
if (id)
|
|
1172
1181
|
blocked.add(id);
|
|
@@ -2630,8 +2639,18 @@ async function runSessionEnqueue(cliKind, opts) {
|
|
|
2630
2639
|
token = null;
|
|
2631
2640
|
}
|
|
2632
2641
|
if (!token) {
|
|
2633
|
-
|
|
2634
|
-
|
|
2642
|
+
let pending;
|
|
2643
|
+
try {
|
|
2644
|
+
pending = readEmitRetry(meshRoot);
|
|
2645
|
+
}
|
|
2646
|
+
catch (err) {
|
|
2647
|
+
// Never replace a retry file that could not be read; add this event to it.
|
|
2648
|
+
console.error(`work-mesh: emit retry file unreadable; appending without rewrite: ${(err instanceof Error ? err.message : String(err)).slice(0, 120)}`);
|
|
2649
|
+
pending = null;
|
|
2650
|
+
}
|
|
2651
|
+
const written = pending
|
|
2652
|
+
? writeEmitRetry(meshRoot, [...pending, event]).written
|
|
2653
|
+
: appendEmitRetry(meshRoot, [event]);
|
|
2635
2654
|
if (opts.json) {
|
|
2636
2655
|
console.log(JSON.stringify({ ok: true, action: "emit", kind, deferred: true, retryDepth: written }, null, 2));
|
|
2637
2656
|
return;
|
|
@@ -3340,6 +3359,7 @@ export async function runDaemonStatus(opts, deps = {}) {
|
|
|
3340
3359
|
platform: deps.platform ?? detectPlatform(),
|
|
3341
3360
|
paths,
|
|
3342
3361
|
isLoaded: daemonServiceIsLoaded(deps.run ?? defaultRunCommand, deps.uid),
|
|
3362
|
+
hqDaemonMesh: (deps.hqDaemonMesh ?? (() => hqDaemonMeshService(paths.home)))(),
|
|
3343
3363
|
});
|
|
3344
3364
|
const state = readDaemonState(paths.daemonDir);
|
|
3345
3365
|
const presenceRefusal = state?.presenceRefusal ?? null;
|
|
@@ -271,9 +271,8 @@ export declare function computeArtifactHash(tarballBytes: Uint8Array): string;
|
|
|
271
271
|
*/
|
|
272
272
|
export declare function verifyArtifact(input: VerifyArtifactInput): void;
|
|
273
273
|
/**
|
|
274
|
-
* Parse + shape-validate one pack's per-server MCP manifest (`mcp/{item}.json`)
|
|
275
|
-
*
|
|
276
|
-
* test (and US-006's registration engine) can call it directly.
|
|
274
|
+
* Parse + shape-validate one pack's per-server MCP manifest (`mcp/{item}.json`).
|
|
275
|
+
* EXPORTED so the acceptance test (and US-006's registration engine) can call it directly.
|
|
277
276
|
*
|
|
278
277
|
* Throws an `Error` (whose message names the pack-relative payload path, e.g.
|
|
279
278
|
* `mcp/foo.json`) when the file does not parse as JSON or violates a transport
|
|
@@ -864,13 +864,12 @@ export function verifyArtifact(input) {
|
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
// ---------------------------------------------------------------------------
|
|
867
|
-
// MCP per-server manifest validation (US-005
|
|
868
|
-
// `validate_mcp_manifest` arm in core/scripts/scan-packages.sh).
|
|
867
|
+
// MCP per-server manifest validation (US-005).
|
|
869
868
|
//
|
|
870
869
|
// The `mcp` contributes key is `wire: 'merge'` — its per-server manifests are
|
|
871
870
|
// NEVER symlinked; they are validated here and (US-006) merged into the agent
|
|
872
|
-
// configs via registerMcpServers. This function
|
|
873
|
-
// rules hand
|
|
871
|
+
// configs via registerMcpServers. This function implements the transport
|
|
872
|
+
// rules by hand against the draft-07 schema
|
|
874
873
|
// (repos/public/knowledge-hq-core/mcp-manifest.schema.json). There is no `ajv`
|
|
875
874
|
// dependency in hq-cli; the schema file is single-source documentation, so the
|
|
876
875
|
// rules are replicated here (dependency-free, robust if the schema is absent).
|
|
@@ -900,9 +899,8 @@ function checkStringMap(errs, label, value) {
|
|
|
900
899
|
}
|
|
901
900
|
}
|
|
902
901
|
/**
|
|
903
|
-
* Parse + shape-validate one pack's per-server MCP manifest (`mcp/{item}.json`)
|
|
904
|
-
*
|
|
905
|
-
* test (and US-006's registration engine) can call it directly.
|
|
902
|
+
* Parse + shape-validate one pack's per-server MCP manifest (`mcp/{item}.json`).
|
|
903
|
+
* EXPORTED so the acceptance test (and US-006's registration engine) can call it directly.
|
|
906
904
|
*
|
|
907
905
|
* Throws an `Error` (whose message names the pack-relative payload path, e.g.
|
|
908
906
|
* `mcp/foo.json`) when the file does not parse as JSON or violates a transport
|
|
@@ -1110,7 +1108,7 @@ export function validateManifest(payloadDir, hqVersion, options = {}) {
|
|
|
1110
1108
|
}
|
|
1111
1109
|
// The `mcp` key (wire: 'merge') is NOT existsSync-only: after the file is
|
|
1112
1110
|
// confirmed present it must PARSE + SHAPE-validate against the per-server
|
|
1113
|
-
// MCP schema (US-005)
|
|
1111
|
+
// MCP schema (US-005) via validateMcpManifest. Other
|
|
1114
1112
|
// (symlink) keys keep their existsSync-only behavior. We dispatch on the
|
|
1115
1113
|
// ROUTE from the single-source table (not a hardcoded key) so the merge
|
|
1116
1114
|
// path is table-driven; the merge itself (registering into the agent
|
|
@@ -25,11 +25,10 @@ import { vaultApiFetch, getCompanyUid, getEntityUid } from "../utils/vault-api.j
|
|
|
25
25
|
export type { VaultApiOptions } from "../utils/vault-api.js";
|
|
26
26
|
export { vaultApiFetch, getCompanyUid, getEntityUid };
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* `src/journey/limited-resource-telemetry.ts
|
|
30
|
-
*
|
|
28
|
+
* Telemetry surface sent with `hq secrets set`. hq-pro accepts it because it is
|
|
29
|
+
* listed in `RESOURCE_SURFACES` in `src/journey/limited-resource-telemetry.ts`;
|
|
30
|
+
* an unlisted surface falls back to the server default.
|
|
31
31
|
*/
|
|
32
|
-
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"];
|
|
33
32
|
export declare const CLI_SECRETS_SET_SURFACE = "cli_secrets_set";
|
|
34
33
|
/**
|
|
35
34
|
* Shown when `secrets share` / `unshare` gets a 403. Changing a secret's
|
package/dist/commands/secrets.js
CHANGED
|
@@ -107,27 +107,10 @@ import { runSandboxJobAfterSubmission } from "../utils/secrets-sandbox-resident.
|
|
|
107
107
|
import { renderSecretInputLink, SECRET_LINK_FORMATS, } from "../lib/secret-input-link.js";
|
|
108
108
|
export { vaultApiFetch, getCompanyUid, getEntityUid };
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
111
|
-
* `src/journey/limited-resource-telemetry.ts
|
|
112
|
-
*
|
|
110
|
+
* Telemetry surface sent with `hq secrets set`. hq-pro accepts it because it is
|
|
111
|
+
* listed in `RESOURCE_SURFACES` in `src/journey/limited-resource-telemetry.ts`;
|
|
112
|
+
* an unlisted surface falls back to the server default.
|
|
113
113
|
*/
|
|
114
|
-
export const HQ_PRO_RESOURCE_SURFACES = [
|
|
115
|
-
"api",
|
|
116
|
-
"bot_invite",
|
|
117
|
-
"bot_join_now",
|
|
118
|
-
"calendar_auto_schedule",
|
|
119
|
-
"calendar_preferences",
|
|
120
|
-
"cli_secrets_set",
|
|
121
|
-
"console_secrets_form",
|
|
122
|
-
"deploy_precheck",
|
|
123
|
-
"external_connection",
|
|
124
|
-
"factory_install",
|
|
125
|
-
"integrations_connect",
|
|
126
|
-
"oauth_callback",
|
|
127
|
-
"plan_limit_check",
|
|
128
|
-
"secrets_input_link",
|
|
129
|
-
"web",
|
|
130
|
-
];
|
|
131
114
|
export const CLI_SECRETS_SET_SURFACE = "cli_secrets_set";
|
|
132
115
|
/**
|
|
133
116
|
* Cognito session for secrets surfaces hq-pro serves on the JWT routes only —
|