@indigoai-us/hq-cli 5.34.2 → 5.35.1

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.
@@ -104,6 +104,7 @@ export interface ShareCallOptions {
104
104
  message?: string;
105
105
  skipUnchanged?: boolean;
106
106
  propagateDeletes?: boolean;
107
+ propagateDeletePolicy?: "owned-only" | "currency-gated" | "all";
107
108
  }
108
109
  export interface ShareCallResult {
109
110
  filesUploaded: number;
@@ -13,13 +13,40 @@
13
13
  * hq sync status — show local journal summary
14
14
  */
15
15
 
16
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bdaf154f-b17d-5482-9e4d-feaebe606a1b")}catch(e){}}();
16
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="94a293c9-eb80-5100-a3e0-d64c93f7165c")}catch(e){}}();
17
17
  import chalk from "chalk";
18
18
  import * as fs from "fs";
19
19
  import * as path from "path";
20
20
  import { share, sync, readJournal, getJournalPath, loadCachedTokens, VaultClient, computePersonalVaultPaths, } from "@indigoai-us/hq-cloud";
21
21
  import { DEFAULT_HQ_ROOT, ensureCognitoToken, buildVaultConfig, } from "../utils/cognito-session.js";
22
22
  import { emitNarrowHint, isStrictRefusal, resolveBannerLevel, } from "../lib/narrow-hint-banner.js";
23
+ /**
24
+ * Resolve the `propagateDeletePolicy` for share() calls.
25
+ *
26
+ * Mirrors `@indigoai-us/hq-cloud`'s `bin/sync-runner.js` `resolveDeletePolicy`
27
+ * — the same function the AppBar HQ Sync menubar uses — so the CLI and the
28
+ * menubar agree on the policy by default. Inlined here (rather than
29
+ * deep-imported from `dist/bin/sync-runner.js`) to avoid coupling to a
30
+ * non-public subpath.
31
+ *
32
+ * Default is `"currency-gated"` (etag-verified safe delete). Override via
33
+ * the `HQ_SYNC_DELETE_POLICY` env var: `owned-only` (legacy direction-of-
34
+ * origin filter, multi-user safe but stranded down-stream litter on
35
+ * personal vaults until hq-cloud 6.0.1's prs_ override), `currency-gated`
36
+ * (the menubar default), or `all` (emergency-reconcile, no safety gates).
37
+ *
38
+ * Prior to this helper, the CLI passed nothing → share() fell through to
39
+ * its own `"owned-only"` default, leaving CLI users on a stricter (and
40
+ * sometimes wrong, on personal vault) policy than menubar users for
41
+ * months. See `workspace/reports/owned-only-delete-policy-purpose-debug.md`.
42
+ */
43
+ function resolveDeletePolicy() {
44
+ const env = process.env.HQ_SYNC_DELETE_POLICY;
45
+ if (env === "owned-only" || env === "all" || env === "currency-gated") {
46
+ return env;
47
+ }
48
+ return "currency-gated";
49
+ }
23
50
  // Oldest-first by createdAt, ties broken by uid lexicographic — matches
24
51
  // `pickCanonicalPersonEntity` in @indigoai-us/hq-cloud so the CLI lands on
25
52
  // the same person bucket that `hq-sync-runner` picks.
@@ -171,6 +198,7 @@ export async function pushAll(options, deps) {
171
198
  paths: [path.join(options.hqRoot, "companies", slug)],
172
199
  skipUnchanged: true,
173
200
  propagateDeletes: true,
201
+ propagateDeletePolicy: resolveDeletePolicy(),
174
202
  ...(options.onConflict ? { onConflict: options.onConflict } : {}),
175
203
  ...(options.message ? { message: options.message } : {}),
176
204
  },
@@ -188,6 +216,7 @@ export async function pushAll(options, deps) {
188
216
  journalSlug: "personal",
189
217
  skipUnchanged: true,
190
218
  propagateDeletes: true,
219
+ propagateDeletePolicy: resolveDeletePolicy(),
191
220
  ...(options.onConflict ? { onConflict: options.onConflict } : {}),
192
221
  ...(options.message ? { message: options.message } : {}),
193
222
  },
@@ -869,6 +898,9 @@ async function runPushAll(hqRoot, message, onConflict, skipPersonal) {
869
898
  ...(opts.propagateDeletes !== undefined
870
899
  ? { propagateDeletes: opts.propagateDeletes }
871
900
  : {}),
901
+ ...(opts.propagateDeletePolicy !== undefined
902
+ ? { propagateDeletePolicy: opts.propagateDeletePolicy }
903
+ : {}),
872
904
  ...(author ? { author } : {}),
873
905
  }),
874
906
  });
@@ -949,6 +981,7 @@ async function runNowSingle(hqRoot, company, personal, message, onConflict, mode
949
981
  hqRoot,
950
982
  skipUnchanged: true,
951
983
  propagateDeletes: true,
984
+ propagateDeletePolicy: resolveDeletePolicy(),
952
985
  ...(onConflict ? { onConflict } : {}),
953
986
  ...(message ? { message } : {}),
954
987
  ...(personalMode ? { personalMode: true } : {}),
@@ -1130,4 +1163,4 @@ function resolveUploadAuthorFromCache() {
1130
1163
  }
1131
1164
  }
1132
1165
  //# sourceMappingURL=cloud.js.map
1133
- //# debugId=bdaf154f-b17d-5482-9e4d-feaebe606a1b
1166
+ //# debugId=94a293c9-eb80-5100-a3e0-d64c93f7165c
@@ -0,0 +1,15 @@
1
+ /**
2
+ * hq reindex — surface namespaced skills, mirror the personal overlay into
3
+ * core/, and regenerate the workers registry.
4
+ *
5
+ * Thin wrapper over @indigoai-us/hq-cloud's reindex(), which execs the bundled
6
+ * scripts/reindex.sh against the HQ root. This command is what the hq-core
7
+ * reindex hook shim calls on Stop / PostToolUse, and what sync()/rescue() call
8
+ * after they change on-disk sources.
9
+ *
10
+ * Keeps a hidden `master-sync` alias for one release so an updated CLI still
11
+ * answers a not-yet-updated hook shim (and vice-versa) during rollout.
12
+ */
13
+ import { Command } from 'commander';
14
+ export declare function registerReindexCommand(program: Command): void;
15
+ //# sourceMappingURL=reindex.d.ts.map
@@ -1,15 +1,16 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c5486cda-a7fa-5274-ab0a-a61e1958aac7")}catch(e){}}();
3
- import { masterSync } from '@indigoai-us/hq-cloud';
4
- export function registerMasterSyncCommand(program) {
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9d81df7d-0153-5f51-9cfb-60f1409c6b94")}catch(e){}}();
3
+ import { reindex } from '@indigoai-us/hq-cloud';
4
+ export function registerReindexCommand(program) {
5
5
  program
6
- .command('master-sync')
6
+ .command('reindex')
7
+ .alias('master-sync')
7
8
  .description('Surface namespaced skills, mirror the personal overlay into core/, and regenerate the workers registry')
8
9
  .option('--repo-root <path>', 'HQ root to operate on (defaults to the current directory)')
9
10
  .action((opts) => {
10
- const { status } = masterSync({ repoRoot: opts.repoRoot });
11
+ const { status } = reindex({ repoRoot: opts.repoRoot });
11
12
  process.exit(status);
12
13
  });
13
14
  }
14
- //# sourceMappingURL=master-sync.js.map
15
- //# debugId=c5486cda-a7fa-5274-ab0a-a61e1958aac7
15
+ //# sourceMappingURL=reindex.js.map
16
+ //# debugId=9d81df7d-0153-5f51-9cfb-60f1409c6b94
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * HQ CLI - Module management, package management, and cloud sync for HQ
4
4
  */
5
5
 
6
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="004dc716-c660-5745-94db-988ac49d102e")}catch(e){}}();
6
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="202089d2-b89b-5779-aa66-f88531a9b893")}catch(e){}}();
7
7
  import { Command } from "commander";
8
8
  import { initSentry, Sentry } from "./sentry.js";
9
9
  import { registerAddCommand } from "./commands/add.js";
@@ -39,7 +39,7 @@ import { registerFeedbackCommand } from "./commands/feedback.js";
39
39
  import { registerMeetingsCommand } from "./commands/meetings.js";
40
40
  import { registerSourcesCommand } from "./commands/sources.js";
41
41
  import { registerSignalsCommand } from "./commands/signals.js";
42
- import { registerMasterSyncCommand } from "./commands/master-sync.js";
42
+ import { registerReindexCommand } from "./commands/reindex.js";
43
43
  import { registerRescueCommand } from "./commands/rescue.js";
44
44
  import { sanitizeArgv } from "./utils/feedback-diagnostics.js";
45
45
  import { maybeWarnNewVersion, refreshVersionCache, } from "./utils/version-check.js";
@@ -139,10 +139,11 @@ registerMeetingsCommand(program);
139
139
  registerSourcesCommand(program);
140
140
  // Signals read surface (subcommand group — hq signals list|get|types|entities)
141
141
  registerSignalsCommand(program);
142
- // Skill/personal-overlay mirroring + workers-registry regen. Internal command
143
- // invoked by the hq-core master-sync hook shim (formerly the master-sync.sh
144
- // hook body). Implementation lives in @indigoai-us/hq-cloud.
145
- registerMasterSyncCommand(program);
142
+ // Skill/personal-overlay mirroring + workers-registry regen. Invoked by the
143
+ // hq-core reindex hook shim (Stop / PostToolUse) and by sync()/rescue() after
144
+ // they change on-disk sources. Keeps a `master-sync` alias for one release.
145
+ // Implementation lives in @indigoai-us/hq-cloud.
146
+ registerReindexCommand(program);
146
147
  // Drift-preserving HQ-core re-sync (top-level — `hq rescue`). CLI sibling of
147
148
  // the HQ Sync app's "Update / Restore" pill; drives the same replace-rescue.sh
148
149
  // shipped from @indigoai-us/hq-cloud.
@@ -173,4 +174,4 @@ registerRescueCommand(program);
173
174
  }
174
175
  })();
175
176
  //# sourceMappingURL=index.js.map
176
- //# debugId=004dc716-c660-5745-94db-988ac49d102e
177
+ //# debugId=202089d2-b89b-5779-aa66-f88531a9b893
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.34.2",
3
+ "version": "5.35.1",
4
4
  "description": "HQ by Indigo management CLI \u2014 modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  "clean": "rm -rf dist"
16
16
  },
17
17
  "dependencies": {
18
- "@indigoai-us/hq-cloud": "~5.48.4",
18
+ "@indigoai-us/hq-cloud": "^6.0.1",
19
19
  "@indigoai-us/hq-onboarding": "^0.1.0",
20
20
  "@sentry/node": "^10.49.0",
21
21
  "chalk": "^5.3.0",
@@ -45,6 +45,34 @@ import {
45
45
  type BannerLevel,
46
46
  } from "../lib/narrow-hint-banner.js";
47
47
 
48
+ /**
49
+ * Resolve the `propagateDeletePolicy` for share() calls.
50
+ *
51
+ * Mirrors `@indigoai-us/hq-cloud`'s `bin/sync-runner.js` `resolveDeletePolicy`
52
+ * — the same function the AppBar HQ Sync menubar uses — so the CLI and the
53
+ * menubar agree on the policy by default. Inlined here (rather than
54
+ * deep-imported from `dist/bin/sync-runner.js`) to avoid coupling to a
55
+ * non-public subpath.
56
+ *
57
+ * Default is `"currency-gated"` (etag-verified safe delete). Override via
58
+ * the `HQ_SYNC_DELETE_POLICY` env var: `owned-only` (legacy direction-of-
59
+ * origin filter, multi-user safe but stranded down-stream litter on
60
+ * personal vaults until hq-cloud 6.0.1's prs_ override), `currency-gated`
61
+ * (the menubar default), or `all` (emergency-reconcile, no safety gates).
62
+ *
63
+ * Prior to this helper, the CLI passed nothing → share() fell through to
64
+ * its own `"owned-only"` default, leaving CLI users on a stricter (and
65
+ * sometimes wrong, on personal vault) policy than menubar users for
66
+ * months. See `workspace/reports/owned-only-delete-policy-purpose-debug.md`.
67
+ */
68
+ function resolveDeletePolicy(): "owned-only" | "currency-gated" | "all" {
69
+ const env = process.env.HQ_SYNC_DELETE_POLICY;
70
+ if (env === "owned-only" || env === "all" || env === "currency-gated") {
71
+ return env;
72
+ }
73
+ return "currency-gated";
74
+ }
75
+
48
76
  interface CommonSyncOptions {
49
77
  hqRoot: string;
50
78
  company?: string;
@@ -164,6 +192,7 @@ export interface ShareCallOptions {
164
192
  message?: string;
165
193
  skipUnchanged?: boolean;
166
194
  propagateDeletes?: boolean;
195
+ propagateDeletePolicy?: "owned-only" | "currency-gated" | "all";
167
196
  }
168
197
 
169
198
  export interface ShareCallResult {
@@ -397,6 +426,7 @@ export async function pushAll(
397
426
  paths: [path.join(options.hqRoot, "companies", slug)],
398
427
  skipUnchanged: true,
399
428
  propagateDeletes: true,
429
+ propagateDeletePolicy: resolveDeletePolicy(),
400
430
  ...(options.onConflict ? { onConflict: options.onConflict } : {}),
401
431
  ...(options.message ? { message: options.message } : {}),
402
432
  },
@@ -415,6 +445,7 @@ export async function pushAll(
415
445
  journalSlug: "personal",
416
446
  skipUnchanged: true,
417
447
  propagateDeletes: true,
448
+ propagateDeletePolicy: resolveDeletePolicy(),
418
449
  ...(options.onConflict ? { onConflict: options.onConflict } : {}),
419
450
  ...(options.message ? { message: options.message } : {}),
420
451
  },
@@ -1406,6 +1437,9 @@ async function runPushAll(
1406
1437
  ...(opts.propagateDeletes !== undefined
1407
1438
  ? { propagateDeletes: opts.propagateDeletes }
1408
1439
  : {}),
1440
+ ...(opts.propagateDeletePolicy !== undefined
1441
+ ? { propagateDeletePolicy: opts.propagateDeletePolicy }
1442
+ : {}),
1409
1443
  ...(author ? { author } : {}),
1410
1444
  }),
1411
1445
  },
@@ -1505,6 +1539,7 @@ async function runNowSingle(
1505
1539
  hqRoot,
1506
1540
  skipUnchanged: true,
1507
1541
  propagateDeletes: true,
1542
+ propagateDeletePolicy: resolveDeletePolicy(),
1508
1543
  ...(onConflict ? { onConflict } : {}),
1509
1544
  ...(message ? { message } : {}),
1510
1545
  ...(personalMode ? { personalMode: true } : {}),
@@ -0,0 +1,28 @@
1
+ /**
2
+ * hq reindex — surface namespaced skills, mirror the personal overlay into
3
+ * core/, and regenerate the workers registry.
4
+ *
5
+ * Thin wrapper over @indigoai-us/hq-cloud's reindex(), which execs the bundled
6
+ * scripts/reindex.sh against the HQ root. This command is what the hq-core
7
+ * reindex hook shim calls on Stop / PostToolUse, and what sync()/rescue() call
8
+ * after they change on-disk sources.
9
+ *
10
+ * Keeps a hidden `master-sync` alias for one release so an updated CLI still
11
+ * answers a not-yet-updated hook shim (and vice-versa) during rollout.
12
+ */
13
+ import { Command } from 'commander';
14
+ import { reindex } from '@indigoai-us/hq-cloud';
15
+
16
+ export function registerReindexCommand(program: Command): void {
17
+ program
18
+ .command('reindex')
19
+ .alias('master-sync')
20
+ .description(
21
+ 'Surface namespaced skills, mirror the personal overlay into core/, and regenerate the workers registry'
22
+ )
23
+ .option('--repo-root <path>', 'HQ root to operate on (defaults to the current directory)')
24
+ .action((opts: { repoRoot?: string }) => {
25
+ const { status } = reindex({ repoRoot: opts.repoRoot });
26
+ process.exit(status);
27
+ });
28
+ }
package/src/index.ts CHANGED
@@ -39,7 +39,7 @@ import { registerFeedbackCommand } from "./commands/feedback.js";
39
39
  import { registerMeetingsCommand } from "./commands/meetings.js";
40
40
  import { registerSourcesCommand } from "./commands/sources.js";
41
41
  import { registerSignalsCommand } from "./commands/signals.js";
42
- import { registerMasterSyncCommand } from "./commands/master-sync.js";
42
+ import { registerReindexCommand } from "./commands/reindex.js";
43
43
  import { registerRescueCommand } from "./commands/rescue.js";
44
44
  import { sanitizeArgv } from "./utils/feedback-diagnostics.js";
45
45
  import {
@@ -176,10 +176,11 @@ registerSourcesCommand(program);
176
176
  // Signals read surface (subcommand group — hq signals list|get|types|entities)
177
177
  registerSignalsCommand(program);
178
178
 
179
- // Skill/personal-overlay mirroring + workers-registry regen. Internal command
180
- // invoked by the hq-core master-sync hook shim (formerly the master-sync.sh
181
- // hook body). Implementation lives in @indigoai-us/hq-cloud.
182
- registerMasterSyncCommand(program);
179
+ // Skill/personal-overlay mirroring + workers-registry regen. Invoked by the
180
+ // hq-core reindex hook shim (Stop / PostToolUse) and by sync()/rescue() after
181
+ // they change on-disk sources. Keeps a `master-sync` alias for one release.
182
+ // Implementation lives in @indigoai-us/hq-cloud.
183
+ registerReindexCommand(program);
183
184
 
184
185
  // Drift-preserving HQ-core re-sync (top-level — `hq rescue`). CLI sibling of
185
186
  // the HQ Sync app's "Update / Restore" pill; drives the same replace-rescue.sh
@@ -1,11 +0,0 @@
1
- /**
2
- * hq master-sync — surface namespaced skills, mirror the personal overlay into
3
- * core/, and regenerate the workers registry.
4
- *
5
- * Thin wrapper over @indigoai-us/hq-cloud's masterSync(), which execs the
6
- * bundled scripts/master-sync.sh against the HQ root. This command is what the
7
- * hq-core master-sync hook shim calls on Stop / PostToolUse.
8
- */
9
- import { Command } from 'commander';
10
- export declare function registerMasterSyncCommand(program: Command): void;
11
- //# sourceMappingURL=master-sync.d.ts.map
@@ -1,23 +0,0 @@
1
- /**
2
- * hq master-sync — surface namespaced skills, mirror the personal overlay into
3
- * core/, and regenerate the workers registry.
4
- *
5
- * Thin wrapper over @indigoai-us/hq-cloud's masterSync(), which execs the
6
- * bundled scripts/master-sync.sh against the HQ root. This command is what the
7
- * hq-core master-sync hook shim calls on Stop / PostToolUse.
8
- */
9
- import { Command } from 'commander';
10
- import { masterSync } from '@indigoai-us/hq-cloud';
11
-
12
- export function registerMasterSyncCommand(program: Command): void {
13
- program
14
- .command('master-sync')
15
- .description(
16
- 'Surface namespaced skills, mirror the personal overlay into core/, and regenerate the workers registry'
17
- )
18
- .option('--repo-root <path>', 'HQ root to operate on (defaults to the current directory)')
19
- .action((opts: { repoRoot?: string }) => {
20
- const { status } = masterSync({ repoRoot: opts.repoRoot });
21
- process.exit(status);
22
- });
23
- }