@indigoai-us/hq-cli 5.345.171 → 5.345.172

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/command-catalog.generated.d.ts +74 -2
  3. package/dist/command-catalog.generated.js +88 -2
  4. package/dist/command-registration-plan.d.ts +7 -0
  5. package/dist/command-registration-plan.js +1 -0
  6. package/dist/commands/bot.js +46 -8
  7. package/dist/commands/cloud.js +9 -5
  8. package/dist/commands/daemon.js +16 -1
  9. package/dist/commands/files.d.ts +1 -0
  10. package/dist/commands/files.js +22 -4
  11. package/dist/commands/sync-core.d.ts +22 -0
  12. package/dist/commands/sync-core.js +124 -0
  13. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +278 -224
  14. package/dist/hq-cloud-sync-runner/package.json +1 -1
  15. package/dist/lib/bot/fleet-local.d.ts +16 -1
  16. package/dist/lib/bot/fleet-local.js +99 -48
  17. package/dist/lib/bot/fleet-python.d.ts +47 -0
  18. package/dist/lib/bot/fleet-python.js +218 -0
  19. package/dist/lib/bot/index.d.ts +1 -0
  20. package/dist/lib/bot/index.js +1 -0
  21. package/dist/lib/bot/prompt.d.ts +6 -1
  22. package/dist/lib/bot/prompt.js +8 -3
  23. package/dist/lib/daemon/catalog.d.ts +12 -4
  24. package/dist/lib/daemon/catalog.js +70 -27
  25. package/dist/lib/daemon/config.d.ts +0 -7
  26. package/dist/lib/daemon/config.js +0 -32
  27. package/dist/lib/daemon/run.d.ts +5 -1
  28. package/dist/lib/daemon/run.js +48 -11
  29. package/dist/lib/daemon/supervisor.js +3 -1
  30. package/dist/lib/sync-core/engine-home.d.ts +44 -0
  31. package/dist/lib/sync-core/engine-home.js +193 -0
  32. package/dist/lib/sync-core/flag.d.ts +17 -0
  33. package/dist/lib/sync-core/flag.js +47 -0
  34. package/dist/lib/sync-core/reconcile.d.ts +31 -0
  35. package/dist/lib/sync-core/reconcile.js +196 -0
  36. package/dist/lib/sync-core/release.d.ts +32 -0
  37. package/dist/lib/sync-core/release.js +140 -0
  38. package/dist/lib/sync-core/rollout-state.d.ts +24 -0
  39. package/dist/lib/sync-core/rollout-state.js +94 -0
  40. package/dist/lib/vault-sync-switches.d.ts +5 -0
  41. package/dist/lib/vault-sync-switches.js +43 -0
  42. package/dist/utils/remote-list-not-converging.d.ts +21 -0
  43. package/dist/utils/remote-list-not-converging.js +40 -0
  44. package/package.json +8 -8
  45. package/dist/lib/daemon/sync-core-canary.d.ts +0 -12
  46. package/dist/lib/daemon/sync-core-canary.js +0 -61
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Plain-language rendering for hq-cloud's `RemoteListNotConvergingError`
3
+ * (code `REMOTE_LIST_NOT_CONVERGING`, hq-cloud >= 6.18.102). hq-cloud throws
4
+ * it when a company's vault file listing keeps stopping early (a repeated
5
+ * cursor, or a truncated page with no cursor) after its retries run out.
6
+ *
7
+ * Duck-typed on `code` so hq-cli stays compatible while hq-cloud and the CLI
8
+ * are released independently.
9
+ */
10
+ export const REMOTE_LIST_NOT_CONVERGING_CODE = "REMOTE_LIST_NOT_CONVERGING";
11
+ export const REMOTE_LIST_NOT_CONVERGING_HINT = "HQ could not finish listing this company's files. Try hq sync now again in a minute; " +
12
+ "if it keeps happening, run hq feedback bug.";
13
+ export function isRemoteListNotConvergingError(err) {
14
+ return (typeof err === "object" &&
15
+ err !== null &&
16
+ err.code === REMOTE_LIST_NOT_CONVERGING_CODE);
17
+ }
18
+ /**
19
+ * Returns the user-facing message for a non-converging remote listing, with
20
+ * the original engine detail on a second line for bug reports, or null when
21
+ * `err` is some other failure.
22
+ */
23
+ export function formatRemoteListNotConverging(err) {
24
+ if (!isRemoteListNotConvergingError(err))
25
+ return null;
26
+ const detail = err instanceof Error
27
+ ? err.message
28
+ : typeof err.message === "string"
29
+ ? err.message
30
+ : "";
31
+ return detail.length > 0
32
+ ? `${REMOTE_LIST_NOT_CONVERGING_HINT}\nDetail: ${detail}`
33
+ : REMOTE_LIST_NOT_CONVERGING_HINT;
34
+ }
35
+ /** Remote-list hint when it applies, else the raw error text. */
36
+ export function describeSyncError(err) {
37
+ return (formatRemoteListNotConverging(err) ??
38
+ (err instanceof Error ? err.message : String(err)));
39
+ }
40
+ //# sourceMappingURL=remote-list-not-converging.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.171",
3
+ "version": "5.345.172",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -52,7 +52,7 @@
52
52
  "@aws-sdk/client-iot-data-plane": "^3.1096.0",
53
53
  "@aws-sdk/client-s3": "^3.1049.0",
54
54
  "@aws-sdk/dsql-signer": "^3.1146.0",
55
- "@indigoai-us/hq-cloud": "6.18.102",
55
+ "@indigoai-us/hq-cloud": "6.18.103",
56
56
  "@indigoai-us/hq-flags-client": "^0.1.2",
57
57
  "@modelcontextprotocol/sdk": "1.29.0",
58
58
  "@sentry/node": "^10.49.0",
@@ -114,11 +114,11 @@
114
114
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
115
115
  },
116
116
  "optionalDependencies": {
117
- "@indigoai-us/hq-hook-win32-x64": "5.345.171",
118
- "@indigoai-us/hq-hook-win32-arm64": "5.345.171",
119
- "@indigoai-us/hq-hook-darwin-x64": "5.345.171",
120
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.171",
121
- "@indigoai-us/hq-hook-linux-x64": "5.345.171",
122
- "@indigoai-us/hq-hook-linux-arm64": "5.345.171"
117
+ "@indigoai-us/hq-hook-win32-x64": "5.345.172",
118
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.172",
119
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.172",
120
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.172",
121
+ "@indigoai-us/hq-hook-linux-x64": "5.345.172",
122
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.172"
123
123
  }
124
124
  }
@@ -1,12 +0,0 @@
1
- import type { SyncCoreCanaryConfig } from "./config.js";
2
- export interface SyncCoreCanaryPlan {
3
- binaryPath?: string;
4
- vaultUid?: string;
5
- /** The one file the engine may change; absent when `fullVault` is set. */
6
- canaryPath?: string;
7
- /** The engine applies every planned small file in the vault (`sync.full_vault = true`). */
8
- fullVault?: boolean;
9
- blockedReason?: string;
10
- }
11
- export declare function inspectSyncCoreCanary(home: string, hqRoot: string | undefined, config: SyncCoreCanaryConfig, platform: NodeJS.Platform): SyncCoreCanaryPlan;
12
- //# sourceMappingURL=sync-core-canary.d.ts.map
@@ -1,61 +0,0 @@
1
- import * as fs from "node:fs";
2
- import * as path from "node:path";
3
- import { parse as parseToml } from "smol-toml";
4
- function blocked(config, blockedReason) {
5
- return { ...config, blockedReason };
6
- }
7
- function record(value) {
8
- return value && typeof value === "object" && !Array.isArray(value)
9
- ? value
10
- : undefined;
11
- }
12
- export function inspectSyncCoreCanary(home, hqRoot, config, platform) {
13
- if (platform !== "darwin" && platform !== "linux") {
14
- return blocked(config, "the sync-core canary requires macOS or Linux");
15
- }
16
- try {
17
- if (!fs.statSync(config.binaryPath).isFile())
18
- return blocked(config, "the sync-core binary is missing");
19
- fs.accessSync(config.binaryPath, fs.constants.X_OK);
20
- }
21
- catch {
22
- return blocked(config, "the sync-core binary is missing or not executable");
23
- }
24
- const configPath = path.join(home, ".hq", "sync-core", "config.toml");
25
- let sync;
26
- try {
27
- sync = record(record(parseToml(fs.readFileSync(configPath, "utf8")))?.sync);
28
- }
29
- catch {
30
- return blocked(config, `the sync-core config at ${configPath} is missing or invalid`);
31
- }
32
- if (sync?.engine !== "rust-test" || sync.mode !== "full") {
33
- return blocked(config, "the sync-core config must select engine rust-test in full mode");
34
- }
35
- const vaults = sync.vaults;
36
- if (!Array.isArray(vaults) || vaults.length !== 1 || vaults[0] !== config.vaultUid) {
37
- return blocked(config, `the sync-core config must name exactly ${config.vaultUid}`);
38
- }
39
- if (!hqRoot || typeof sync.hq_root !== "string" || path.resolve(sync.hq_root) !== path.resolve(hqRoot)) {
40
- return blocked(config, "the sync-core config must use the daemon's HQ folder");
41
- }
42
- const canaryPath = typeof sync.canary_path === "string" ? sync.canary_path.trim() : "";
43
- const fullVault = sync.full_vault === true;
44
- if (fullVault && canaryPath) {
45
- return blocked(config, "the sync-core config must set either full_vault = true or canary_path, not both");
46
- }
47
- if (!fullVault && !canaryPath) {
48
- return blocked(config, "the sync-core config must name one canary path or set full_vault = true");
49
- }
50
- const ownedPath = path.join(home, ".hq", "sync-core", "owned", `${config.vaultUid}.json`);
51
- try {
52
- const owned = record(JSON.parse(fs.readFileSync(ownedPath, "utf8")));
53
- if (owned?.vault !== config.vaultUid)
54
- throw new Error("mismatch");
55
- }
56
- catch {
57
- return blocked(config, `the sync-core ownership record for ${config.vaultUid} is missing or invalid`);
58
- }
59
- return fullVault ? { ...config, fullVault: true } : { ...config, canaryPath };
60
- }
61
- //# sourceMappingURL=sync-core-canary.js.map