@indigoai-us/hq-cli 5.345.235 → 5.345.236

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,17 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.236] — 2026-11-19
6
+ - Test the Claude PostToolUse native claim alongside released dispatcher parity.
7
+ - Verify the Codex SessionStart adapter claim alongside released behavior parity.
8
+ - Isolate the cleanup parity tests to their own fixture process snapshots and scratch directories so unrelated helpers cannot skew the counts.
9
+ - Claim native merged-write shadow coverage for Claude and Codex on non-Windows hosts.
10
+ - Start the engine copy in the scope guard tests only after its write handle is published and closed, with no other test spawn in flight.
11
+ - Publish temporary machine-check executable fixtures atomically in the hook test harness.
12
+ - Keep the agent secret-reveal bridge native with the released hook library and read company flags without starting a subprocess.
13
+ - Accept an optional named test reference in replay difference ledgers without changing how differences match.
14
+ - Add scoped deploy commands to list and replace app runtime secret references.
15
+
5
16
  ## [5.345.235] — 2026-11-19
6
17
  - Keep bot command error messages visible when stderr is piped.
7
18
  - `hq bot promote <name> --company <uid> --cancel` cancels a move to the cloud. It waits for the cloud copy to shut down, then removes the hold on this computer and its frozen snapshot, and starts the bot here again if it was running when the move began. The hold is removed only when HQ confirms the cancel or has no move for the bot; any other answer, including a status reply without a readable promotion, keeps the bot stopped and the command exits non-zero. A damaged hold is removed only on a confirmed cancel, since it may belong to a move in another company; otherwise the command says how to free the bot by hand. If HQ will not show the move (the owner lost access to the destination company, or HQ answers 404), a readable hold for that company still asks HQ to cancel its operation, and the hold goes only on a confirmed cancel. If the cloud copy is still shutting down after 8 minutes the command exits non-zero and running it again continues; the wait stays under the bot lock's 10-minute stale age. A bot that is already live in the cloud is left alone. If HQ cannot restore the bot's own sign-in, the command says so and names `hq bot restore --all`, which issues a new machine credential.
@@ -22793,6 +22793,81 @@ export declare const COMMAND_CATALOG: readonly [{
22793
22793
  readonly hidden: false;
22794
22794
  }];
22795
22795
  readonly subcommands: readonly [];
22796
+ }, {
22797
+ readonly name: "runtime-bindings";
22798
+ readonly description: "Manage app runtime references to company vault secrets";
22799
+ readonly aliases: readonly [];
22800
+ readonly hidden: false;
22801
+ readonly helpOption: true;
22802
+ readonly helpCommand: true;
22803
+ readonly usage: "[options] [command]";
22804
+ readonly helpText: readonly [];
22805
+ readonly arguments: readonly [];
22806
+ readonly options: readonly [];
22807
+ readonly subcommands: readonly [{
22808
+ readonly name: "list";
22809
+ readonly description: "List an app's runtime binding references";
22810
+ readonly aliases: readonly [];
22811
+ readonly hidden: false;
22812
+ readonly helpOption: true;
22813
+ readonly helpCommand: false;
22814
+ readonly usage: "[options] <app-id>";
22815
+ readonly helpText: readonly [];
22816
+ readonly arguments: readonly [{
22817
+ readonly name: "app-id";
22818
+ readonly required: true;
22819
+ readonly variadic: false;
22820
+ readonly description: "";
22821
+ }];
22822
+ readonly options: readonly [{
22823
+ readonly flags: "--company <slug>";
22824
+ readonly description: "company owning the app";
22825
+ readonly hidden: false;
22826
+ }, {
22827
+ readonly flags: "--json";
22828
+ readonly description: "print the binding reference metadata as JSON";
22829
+ readonly hidden: false;
22830
+ }];
22831
+ readonly subcommands: readonly [];
22832
+ }, {
22833
+ readonly name: "replace";
22834
+ readonly description: "Replace the complete set of app runtime binding references";
22835
+ readonly aliases: readonly [];
22836
+ readonly hidden: false;
22837
+ readonly helpOption: true;
22838
+ readonly helpCommand: false;
22839
+ readonly usage: "[options] <app-id>";
22840
+ readonly helpText: readonly [];
22841
+ readonly arguments: readonly [{
22842
+ readonly name: "app-id";
22843
+ readonly required: true;
22844
+ readonly variadic: false;
22845
+ readonly description: "";
22846
+ }];
22847
+ readonly options: readonly [{
22848
+ readonly flags: "--company <slug>";
22849
+ readonly description: "company owning the app";
22850
+ readonly hidden: false;
22851
+ }, {
22852
+ readonly flags: "--company-uid <uid>";
22853
+ readonly description: "vault company UID for the same company";
22854
+ readonly hidden: false;
22855
+ }, {
22856
+ readonly flags: "--ref <reference>";
22857
+ readonly description: "repeat with a vault reference path or PATH:ALIAS";
22858
+ readonly hidden: false;
22859
+ readonly defaultValue: readonly [];
22860
+ }, {
22861
+ readonly flags: "--confirm-replace";
22862
+ readonly description: "confirm replacement of the entire binding set";
22863
+ readonly hidden: false;
22864
+ }, {
22865
+ readonly flags: "--json";
22866
+ readonly description: "print the binding reference metadata as JSON";
22867
+ readonly hidden: false;
22868
+ }];
22869
+ readonly subcommands: readonly [];
22870
+ }];
22796
22871
  }];
22797
22872
  }];
22798
22873
  //# sourceMappingURL=command-catalog.generated.d.ts.map
@@ -27827,6 +27827,98 @@ export const COMMAND_CATALOG = [
27827
27827
  }
27828
27828
  ],
27829
27829
  "subcommands": []
27830
+ },
27831
+ {
27832
+ "name": "runtime-bindings",
27833
+ "description": "Manage app runtime references to company vault secrets",
27834
+ "aliases": [],
27835
+ "hidden": false,
27836
+ "helpOption": true,
27837
+ "helpCommand": true,
27838
+ "usage": "[options] [command]",
27839
+ "helpText": [],
27840
+ "arguments": [],
27841
+ "options": [],
27842
+ "subcommands": [
27843
+ {
27844
+ "name": "list",
27845
+ "description": "List an app's runtime binding references",
27846
+ "aliases": [],
27847
+ "hidden": false,
27848
+ "helpOption": true,
27849
+ "helpCommand": false,
27850
+ "usage": "[options] <app-id>",
27851
+ "helpText": [],
27852
+ "arguments": [
27853
+ {
27854
+ "name": "app-id",
27855
+ "required": true,
27856
+ "variadic": false,
27857
+ "description": ""
27858
+ }
27859
+ ],
27860
+ "options": [
27861
+ {
27862
+ "flags": "--company <slug>",
27863
+ "description": "company owning the app",
27864
+ "hidden": false
27865
+ },
27866
+ {
27867
+ "flags": "--json",
27868
+ "description": "print the binding reference metadata as JSON",
27869
+ "hidden": false
27870
+ }
27871
+ ],
27872
+ "subcommands": []
27873
+ },
27874
+ {
27875
+ "name": "replace",
27876
+ "description": "Replace the complete set of app runtime binding references",
27877
+ "aliases": [],
27878
+ "hidden": false,
27879
+ "helpOption": true,
27880
+ "helpCommand": false,
27881
+ "usage": "[options] <app-id>",
27882
+ "helpText": [],
27883
+ "arguments": [
27884
+ {
27885
+ "name": "app-id",
27886
+ "required": true,
27887
+ "variadic": false,
27888
+ "description": ""
27889
+ }
27890
+ ],
27891
+ "options": [
27892
+ {
27893
+ "flags": "--company <slug>",
27894
+ "description": "company owning the app",
27895
+ "hidden": false
27896
+ },
27897
+ {
27898
+ "flags": "--company-uid <uid>",
27899
+ "description": "vault company UID for the same company",
27900
+ "hidden": false
27901
+ },
27902
+ {
27903
+ "flags": "--ref <reference>",
27904
+ "description": "repeat with a vault reference path or PATH:ALIAS",
27905
+ "hidden": false,
27906
+ "defaultValue": []
27907
+ },
27908
+ {
27909
+ "flags": "--confirm-replace",
27910
+ "description": "confirm replacement of the entire binding set",
27911
+ "hidden": false
27912
+ },
27913
+ {
27914
+ "flags": "--json",
27915
+ "description": "print the binding reference metadata as JSON",
27916
+ "hidden": false
27917
+ }
27918
+ ],
27919
+ "subcommands": []
27920
+ }
27921
+ ]
27830
27922
  }
27831
27923
  ]
27832
27924
  }
@@ -600,6 +600,12 @@ export declare const REGISTRATION_PLAN: readonly [{
600
600
  readonly parent: "deploy";
601
601
  readonly module: "./commands/deploy-app-upload.js";
602
602
  readonly exportName: "registerDeployAppUploadCommand";
603
+ }, {
604
+ readonly type: "registrar";
605
+ readonly root: "deploy";
606
+ readonly parent: "deploy";
607
+ readonly module: "./commands/deploy-runtime-bindings.js";
608
+ readonly exportName: "registerDeployRuntimeBindingsCommand";
603
609
  }];
604
610
  export declare function registerAllCommands(program: Command): Promise<void>;
605
611
  /**
@@ -102,6 +102,7 @@ export const REGISTRATION_PLAN = [
102
102
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-app-db.js", exportName: "registerDeployAppDatabaseCommand" },
103
103
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-ssr.js", exportName: "registerDeploySsrCommand" },
104
104
  { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-app-upload.js", exportName: "registerDeployAppUploadCommand" },
105
+ { type: "registrar", root: "deploy", parent: "deploy", module: "./commands/deploy-runtime-bindings.js", exportName: "registerDeployRuntimeBindingsCommand" },
105
106
  // hq-core-rust US-053: the staff-only `hq staff` group left the public CLI.
106
107
  // Its code is deleted from this repo; staff run a staff-only hq-staff tool
107
108
  // kept outside it.
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerDeployRuntimeBindingsCommand(deploy: Command): void;
3
+ //# sourceMappingURL=deploy-runtime-bindings.d.ts.map
@@ -0,0 +1,135 @@
1
+ import { deployApiRequest } from "../lib/deploy-api.js";
2
+ import { cognitoSubjectFromToken, ensureCognitoIdToken, ensureCognitoToken, resolveCognitoTokenSource, } from "../utils/cognito-session.js";
3
+ class BindingError extends Error {
4
+ }
5
+ const REFERENCE_PATH = /^[A-Z][A-Z0-9_]*(\/[A-Z][A-Z0-9_]+)*$/;
6
+ const ALIAS = /^[A-Za-z_][A-Za-z0-9_]*$/;
7
+ const PERSON_SESSION = { tokenSource: "person", interactive: false };
8
+ const CONFIRM_STATE = "List the current bindings before trying again.";
9
+ function projectReference(entry) {
10
+ if (typeof entry !== "object" || entry === null)
11
+ return undefined;
12
+ const { name, envVar } = entry;
13
+ if (typeof name !== "string" || !REFERENCE_PATH.test(name))
14
+ return undefined;
15
+ if (envVar === undefined)
16
+ return { name };
17
+ return typeof envVar === "string" && ALIAS.test(envVar) ? { name, envVar } : undefined;
18
+ }
19
+ function replacement(options) {
20
+ if (options.confirmReplace !== true) {
21
+ throw new BindingError("Review the full reference set before passing --confirm-replace.");
22
+ }
23
+ const { companyUid, ref } = options;
24
+ if (!companyUid || !/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/.test(companyUid)) {
25
+ throw new BindingError("Provide a valid --company-uid for the selected company.");
26
+ }
27
+ if (ref.length === 0)
28
+ throw new BindingError("Provide at least one --ref for the full replacement.");
29
+ const secrets = ref.map((argument) => {
30
+ const [name, envVar, extra] = argument.split(":");
31
+ const projected = projectReference({ name, envVar });
32
+ if (!projected || extra !== undefined) {
33
+ throw new BindingError("Use a vault reference path or a path followed by :ALIAS.");
34
+ }
35
+ return projected;
36
+ });
37
+ const names = new Set(secrets.map((reference) => reference.name));
38
+ const aliases = new Set(secrets.map((reference) => reference.envVar ?? reference.name));
39
+ if (names.size !== secrets.length || aliases.size !== secrets.length) {
40
+ throw new BindingError("Use unique vault reference paths and runtime aliases.");
41
+ }
42
+ return { companyUid, secrets };
43
+ }
44
+ async function scopedRequest(appId, company, update) {
45
+ if (!/^(?:[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}|app_[A-Za-z0-9_-]+)$/i.test(appId)) {
46
+ throw new BindingError("Use the app ID shown by hq deploy list.");
47
+ }
48
+ if (!company || !/^[a-z0-9][a-z0-9-]{0,62}$/.test(company)) {
49
+ throw new BindingError("Provide an explicit --company slug.");
50
+ }
51
+ if (resolveCognitoTokenSource() === "machine") {
52
+ throw new BindingError("Managing runtime bindings requires a person identity.");
53
+ }
54
+ const token = await ensureCognitoToken(PERSON_SESSION).catch(() => {
55
+ throw new BindingError("Could not get an HQ person sign-in. Run hq login and try again.");
56
+ });
57
+ const headers = { "X-Org-Slug": company };
58
+ if (update) {
59
+ const companion = await ensureCognitoIdToken(PERSON_SESSION).catch(() => {
60
+ throw new BindingError("Could not get the HQ Pro companion sign-in. Run hq login and try again.");
61
+ });
62
+ const accessIdentity = cognitoSubjectFromToken(token);
63
+ const companionIdentity = cognitoSubjectFromToken(companion);
64
+ if (!accessIdentity.sub || accessIdentity.sub !== companionIdentity.sub
65
+ || (accessIdentity.entityUid && companionIdentity.entityUid && accessIdentity.entityUid !== companionIdentity.entityUid)) {
66
+ throw new BindingError("Deploy and HQ Pro sign-ins must belong to the same person. Run hq login and try again.");
67
+ }
68
+ headers["X-HQ-Pro-Authorization"] = `Bearer ${companion}`;
69
+ }
70
+ const response = await deployApiRequest(token, `/api/apps/${encodeURIComponent(appId)}/secret-bindings`, update ? "PUT" : "GET", update, headers, { redirect: "error" }).catch(() => {
71
+ throw new BindingError(update
72
+ ? `Could not confirm the binding replacement. ${CONFIRM_STATE}`
73
+ : "Could not read runtime bindings. Check your connection and try again.");
74
+ });
75
+ if (response.status === 200)
76
+ return response;
77
+ if (response.status === 401)
78
+ throw new BindingError("Run hq login and try again.");
79
+ if (response.status === 403 || response.status === 404) {
80
+ throw new BindingError("Could not access runtime bindings. Check the app ID, company and your permissions.");
81
+ }
82
+ if (response.status === 400 && update) {
83
+ throw new BindingError("The deploy service rejected the binding request. Check the app runtime, company UID and reference paths.");
84
+ }
85
+ throw new BindingError(update
86
+ ? `Could not confirm the binding replacement (HTTP ${response.status}). ${CONFIRM_STATE}`
87
+ : `Could not read runtime bindings (HTTP ${response.status}). Try again in a moment.`);
88
+ }
89
+ function canonicalReferences(refs) {
90
+ return JSON.stringify(refs.map(({ name, envVar }) => [name, envVar ?? ""]).sort());
91
+ }
92
+ async function run(appId, options, update) {
93
+ const response = await scopedRequest(appId, options.company, update);
94
+ const receipt = await response.json().catch(() => null);
95
+ const bindingVersion = receipt?.bindingVersion;
96
+ const secrets = Array.isArray(receipt?.secrets) ? receipt.secrets.map(projectReference) : null;
97
+ if (receipt?.appId !== appId || receipt.orgSlug !== options.company || typeof bindingVersion !== "number"
98
+ || !Number.isSafeInteger(bindingVersion) || bindingVersion < (update ? 1 : 0)
99
+ || !secrets || !secrets.every((reference) => reference !== undefined)
100
+ || (update && (receipt.companyUid !== update.companyUid
101
+ || canonicalReferences(secrets) !== canonicalReferences(update.secrets)))) {
102
+ throw new BindingError(update
103
+ ? `The deploy service returned an invalid binding receipt. ${CONFIRM_STATE}`
104
+ : "The deploy service returned invalid runtime binding metadata.");
105
+ }
106
+ console.log(options.json
107
+ ? JSON.stringify({ appId, bindingVersion, secrets })
108
+ : `Runtime bindings for ${appId}: ${secrets.length} references (version ${bindingVersion}).`);
109
+ }
110
+ async function report(action) {
111
+ try {
112
+ await action();
113
+ }
114
+ catch (error) {
115
+ console.error(error instanceof BindingError ? error.message : "Could not confirm the runtime binding operation.");
116
+ process.exitCode = 1;
117
+ }
118
+ }
119
+ export function registerDeployRuntimeBindingsCommand(deploy) {
120
+ const bindings = deploy.command("runtime-bindings").description("Manage app runtime references to company vault secrets");
121
+ bindings.command("list <app-id>")
122
+ .description("List an app's runtime binding references")
123
+ .option("--company <slug>", "company owning the app")
124
+ .option("--json", "print the binding reference metadata as JSON")
125
+ .action((appId, options) => report(() => run(appId, options)));
126
+ bindings.command("replace <app-id>")
127
+ .description("Replace the complete set of app runtime binding references")
128
+ .option("--company <slug>", "company owning the app")
129
+ .option("--company-uid <uid>", "vault company UID for the same company")
130
+ .option("--ref <reference>", "repeat with a vault reference path or PATH:ALIAS", (value, refs) => [...refs, value], [])
131
+ .option("--confirm-replace", "confirm replacement of the entire binding set")
132
+ .option("--json", "print the binding reference metadata as JSON")
133
+ .action((appId, options) => report(() => run(appId, options, replacement(options))));
134
+ }
135
+ //# sourceMappingURL=deploy-runtime-bindings.js.map
@@ -1,7 +1,7 @@
1
1
  /** Shared authenticated request path for the hq-deploy control plane. */
2
2
  export declare const DEPLOY_API_URL: string;
3
3
  export declare function deployHeaders(token: string, json?: boolean, extra?: Record<string, string>): Record<string, string>;
4
- export declare function deployApiRequest(token: string, route: string, method: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<Response>;
4
+ export declare function deployApiRequest(token: string, route: string, method: string, body?: unknown, extraHeaders?: Record<string, string>, options?: Pick<RequestInit, "redirect">): Promise<Response>;
5
5
  /** Submit an app archive on the authenticated multipart route. Fetch owns the boundary. */
6
6
  export declare function deployApiFormRequest(token: string, route: string, body: FormData, extraHeaders: Record<string, string>): Promise<Response>;
7
7
  //# sourceMappingURL=deploy-api.d.ts.map
@@ -12,8 +12,9 @@ export function deployHeaders(token, json = true, extra = {}) {
12
12
  function deployApiUrl(route) {
13
13
  return `${DEPLOY_API_URL.replace(/\/+$/, "")}${route}`;
14
14
  }
15
- export async function deployApiRequest(token, route, method, body, extraHeaders = {}) {
15
+ export async function deployApiRequest(token, route, method, body, extraHeaders = {}, options = {}) {
16
16
  return fetch(deployApiUrl(route), {
17
+ ...options,
17
18
  method,
18
19
  headers: deployHeaders(token, body !== undefined, extraHeaders),
19
20
  ...(body === undefined ? {} : { body: JSON.stringify(body) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.235",
3
+ "version": "5.345.236",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -126,11 +126,11 @@
126
126
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
127
127
  },
128
128
  "optionalDependencies": {
129
- "@indigoai-us/hq-hook-win32-x64": "5.345.235",
130
- "@indigoai-us/hq-hook-win32-arm64": "5.345.235",
131
- "@indigoai-us/hq-hook-darwin-x64": "5.345.235",
132
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.235",
133
- "@indigoai-us/hq-hook-linux-x64": "5.345.235",
134
- "@indigoai-us/hq-hook-linux-arm64": "5.345.235"
129
+ "@indigoai-us/hq-hook-win32-x64": "5.345.236",
130
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.236",
131
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.236",
132
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.236",
133
+ "@indigoai-us/hq-hook-linux-x64": "5.345.236",
134
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.236"
135
135
  }
136
136
  }