@indigoai-us/hq-cli 5.345.165 → 5.345.168

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 (37) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/assets/scaffold/core/scripts/hq-delegate-send.sh +1 -1
  3. package/assets/scaffold/core/scripts/rebuild-all-indexes.sh +11 -0
  4. package/assets/scaffold/core/scripts/rebuild-orchestrator-index.sh +11 -0
  5. package/assets/scaffold/core/scripts/rebuild-public-knowledge-index.sh +11 -0
  6. package/assets/scaffold/core/scripts/rebuild-reports-index.sh +11 -0
  7. package/assets/scaffold/core/scripts/rebuild-social-drafts-index.sh +11 -0
  8. package/assets/scaffold/core/scripts/rebuild-threads-index.sh +11 -0
  9. package/assets/scaffold/core/scripts/rebuild-workers-index.sh +11 -0
  10. package/dist/command-catalog.generated.d.ts +6 -2
  11. package/dist/command-catalog.generated.js +7 -2
  12. package/dist/commands/access.js +2 -0
  13. package/dist/commands/agents.js +2 -2
  14. package/dist/commands/core-delegate-w1b.js +2 -1
  15. package/dist/commands/core-dm-bind-native.js +3 -1
  16. package/dist/commands/dm.d.ts +13 -2
  17. package/dist/commands/dm.js +42 -9
  18. package/dist/commands/integrations-api.d.ts +15 -0
  19. package/dist/commands/integrations-api.js +27 -0
  20. package/dist/commands/integrations-manage.js +4 -2
  21. package/dist/commands/integrations.js +9 -5
  22. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +210 -197
  23. package/dist/hq-cloud-sync-runner/package.json +1 -1
  24. package/dist/lib/agent-kit/mcp/tools.js +5 -6
  25. package/dist/lib/doctor/checks/sync-runtime.d.ts +7 -2
  26. package/dist/lib/doctor/checks/sync-runtime.js +1 -3
  27. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  28. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  29. package/dist/lib/index-render/index.d.ts +5 -0
  30. package/dist/lib/index-render/index.js +22 -1
  31. package/dist/lib/notify-recipient.d.ts +15 -0
  32. package/dist/lib/notify-recipient.js +15 -0
  33. package/dist/lib/secret-scan/repo-config.d.ts +8 -2
  34. package/dist/lib/secret-scan/repo-config.js +12 -6
  35. package/dist/lib/secret-scan/staged.d.ts +6 -0
  36. package/dist/lib/secret-scan/staged.js +21 -3
  37. package/package.json +8 -8
@@ -1,5 +1,10 @@
1
1
  import { RenderContext, RenderResult } from "./shared.js";
2
2
  export type IndexTarget = "all" | "companies" | "company-knowledge" | "orchestrator" | "projects" | "public-knowledge" | "reports" | "social-drafts" | "threads" | "workers";
3
+ /**
4
+ * One-line summaries for targets without their own option grammar. The CLI,
5
+ * the renderer and the bundled shell fallbacks all print the same help text.
6
+ */
7
+ export declare const GENERIC_INDEX_HELP_SUMMARIES: Readonly<Record<Exclude<IndexTarget, "companies" | "company-knowledge" | "projects">, string>>;
3
8
  export declare function renderIndexTarget(target: IndexTarget, context: RenderContext, args?: string[]): RenderResult;
4
9
  export { atomicWrite, comparePath, immediateEntries, type RenderContext, type RenderResult } from "./shared.js";
5
10
  export { CompanyIndexUserError } from "./companies.js";
@@ -43,15 +43,36 @@ function companyScope(target, context, args) {
43
43
  }
44
44
  return company;
45
45
  }
46
+ /**
47
+ * One-line summaries for targets without their own option grammar. The CLI,
48
+ * the renderer and the bundled shell fallbacks all print the same help text.
49
+ */
50
+ export const GENERIC_INDEX_HELP_SUMMARIES = {
51
+ all: "Regenerate every INDEX.md across the HQ tree",
52
+ orchestrator: "Regenerate the orchestrator workspace INDEX.md",
53
+ "public-knowledge": "Regenerate core/knowledge/public/INDEX.md",
54
+ reports: "Regenerate the reports INDEX.md",
55
+ "social-drafts": "Regenerate workspace/social-drafts/INDEX.md",
56
+ threads: "Regenerate the session-threads INDEX.md",
57
+ workers: "Regenerate the workers INDEX.md",
58
+ };
59
+ function isHelp(args) {
60
+ return args.some((arg) => arg === "--help" || arg === "-h");
61
+ }
46
62
  export function renderIndexTarget(target, context, args = []) {
47
63
  if (target === "company-knowledge" || target === "projects") {
48
- if (args.some((arg) => arg === "--help" || arg === "-h")) {
64
+ if (isHelp(args)) {
49
65
  (context.output ?? ((message) => process.stdout.write(message)))(`Usage: hq core rebuild-index ${target} [<company> | --company <company>] [--accept]\n\nWith a company, rebuild only that company's index. Without a company, retain the all-company rebuild. Help performs no writes.\n`);
50
66
  return { written: [] };
51
67
  }
52
68
  const company = companyScope(target, context, args);
53
69
  return target === "projects" ? renderProjects(context, company) : renderCompanyKnowledge(context, company);
54
70
  }
71
+ if (target !== "companies" && isHelp(args)) {
72
+ // Help must never write, matching the CLI and the bundled shell fallback.
73
+ (context.output ?? ((message) => process.stdout.write(message)))(`Usage: hq core rebuild-index ${target} [--accept]\n\n${GENERIC_INDEX_HELP_SUMMARIES[target]}. Help performs no writes.\n`);
74
+ return { written: [] };
75
+ }
55
76
  switch (target) {
56
77
  case "companies": return renderCompanies(context, args);
57
78
  case "orchestrator": return renderOrchestrator(context);
@@ -4,4 +4,19 @@ export declare const AGENT_UID_PATTERN: RegExp;
4
4
  export declare const EMAIL_PATTERN: RegExp;
5
5
  export declare function isRecipientUid(value: string): boolean;
6
6
  export declare function isAgentUid(value: string): boolean;
7
+ /** Who a notify message is for. */
8
+ export type DmAudience = "human" | "agent" | "both";
9
+ /** What a send is addressed to, for the default audience. */
10
+ export type DmRecipientKind = "person" | "agent" | "channel" | "group";
11
+ /**
12
+ * Classify a single 1:1 recipient (email, prs_ or agt_ uid) for the default
13
+ * audience. Anything that is not an agent uid is a person.
14
+ */
15
+ export declare function recipientKindOf(recipient: string): "person" | "agent";
16
+ /**
17
+ * Default audience by recipient: a 1:1 message to a person is for that
18
+ * person (`human`); a message to an agent, a channel or a group is tagged
19
+ * `agent` and folded away from people by default.
20
+ */
21
+ export declare function defaultAudienceFor(kind: DmRecipientKind): DmAudience;
7
22
  //# sourceMappingURL=notify-recipient.d.ts.map
@@ -8,4 +8,19 @@ export function isRecipientUid(value) {
8
8
  export function isAgentUid(value) {
9
9
  return AGENT_UID_PATTERN.test(value.trim());
10
10
  }
11
+ /**
12
+ * Classify a single 1:1 recipient (email, prs_ or agt_ uid) for the default
13
+ * audience. Anything that is not an agent uid is a person.
14
+ */
15
+ export function recipientKindOf(recipient) {
16
+ return /^agt_/.test(recipient.trim()) ? "agent" : "person";
17
+ }
18
+ /**
19
+ * Default audience by recipient: a 1:1 message to a person is for that
20
+ * person (`human`); a message to an agent, a channel or a group is tagged
21
+ * `agent` and folded away from people by default.
22
+ */
23
+ export function defaultAudienceFor(kind) {
24
+ return kind === "person" ? "human" : "agent";
25
+ }
11
26
  //# sourceMappingURL=notify-recipient.js.map
@@ -26,13 +26,19 @@
26
26
  * there, because a pattern can always be widened, alone or combined with other
27
27
  * entries, to hide a real credential.
28
28
  *
29
- * Fails closed: anything not acceptable is a ScanConfigError, and the scan
30
- * exits 2 rather than running with a guess.
29
+ * An allowlist that is not acceptable is an InvalidAllowlistError. The scan
30
+ * then warns and runs with no repo allowlist at all (stricter, never looser),
31
+ * so a rejected file cannot block the commit that replaces it. Other config
32
+ * problems, such as an unknown --allowlist-rev, are a ScanConfigError and the
33
+ * scan exits 2.
31
34
  */
32
35
  import { type Probe } from "./probes.js";
33
36
  import { type CompiledAllowlist } from "./rules.js";
34
37
  export declare class ScanConfigError extends Error {
35
38
  }
39
+ /** The repo's .gitleaks.toml cannot be used; the scan ignores it (see the top of the file). */
40
+ export declare class InvalidAllowlistError extends ScanConfigError {
41
+ }
36
42
  export declare const REPO_CONFIG_FILE = ".gitleaks.toml";
37
43
  /**
38
44
  * The first probe credential the allowlist would hide, judged as the detector
@@ -26,8 +26,11 @@
26
26
  * there, because a pattern can always be widened, alone or combined with other
27
27
  * entries, to hide a real credential.
28
28
  *
29
- * Fails closed: anything not acceptable is a ScanConfigError, and the scan
30
- * exits 2 rather than running with a guess.
29
+ * An allowlist that is not acceptable is an InvalidAllowlistError. The scan
30
+ * then warns and runs with no repo allowlist at all (stricter, never looser),
31
+ * so a rejected file cannot block the commit that replaces it. Other config
32
+ * problems, such as an unknown --allowlist-rev, are a ScanConfigError and the
33
+ * scan exits 2.
31
34
  */
32
35
  import { execFileSync } from "node:child_process";
33
36
  import { createHash } from "node:crypto";
@@ -38,6 +41,9 @@ import { credentialProbes } from "./probes.js";
38
41
  import { compileAllowlist, compiledRules } from "./rules.js";
39
42
  export class ScanConfigError extends Error {
40
43
  }
44
+ /** The repo's .gitleaks.toml cannot be used; the scan ignores it (see the top of the file). */
45
+ export class InvalidAllowlistError extends ScanConfigError {
46
+ }
41
47
  export const REPO_CONFIG_FILE = ".gitleaks.toml";
42
48
  const KEYS = new Set(["description", "condition", "regexTarget", "paths", "regexes", "stopwords", "commits", "targetRules"]);
43
49
  const MIN_PATH_PREFIX = 3;
@@ -68,7 +74,7 @@ export function suppressedProbe(al) {
68
74
  return probes.find((p, i) => probeBaseline[i] && scanFragment(probeFragment(p.line), rules).length === 0);
69
75
  }
70
76
  function fail(file, where, msg) {
71
- throw new ScanConfigError(`${file}: ${where}: ${msg}`);
77
+ throw new InvalidAllowlistError(`${file}: ${where}: ${msg}`);
72
78
  }
73
79
  function stringList(file, where, key, v) {
74
80
  if (v === undefined)
@@ -292,7 +298,7 @@ function parseToml(text, file) {
292
298
  return parse(text);
293
299
  }
294
300
  catch (err) {
295
- throw new ScanConfigError(`${file}: could not be parsed: ${err instanceof Error ? err.message.split("\n")[0] : String(err)}`);
301
+ throw new InvalidAllowlistError(`${file}: could not be parsed: ${err instanceof Error ? err.message.split("\n")[0] : String(err)}`);
296
302
  }
297
303
  }
298
304
  function git(repoRoot, args) {
@@ -313,10 +319,10 @@ function entry(out, blobField) {
313
319
  }
314
320
  function readEntry(repoRoot, e, where) {
315
321
  if (e.mode === "120000")
316
- throw new ScanConfigError(`${REPO_CONFIG_FILE} (${where}) is a symlink; commit a regular file`);
322
+ throw new InvalidAllowlistError(`${REPO_CONFIG_FILE} (${where}) is a symlink; commit a regular file`);
317
323
  const text = git(repoRoot, ["cat-file", "blob", e.blob]);
318
324
  if (text === null)
319
- throw new ScanConfigError(`${REPO_CONFIG_FILE} (${where}) could not be read from git`);
325
+ throw new InvalidAllowlistError(`${REPO_CONFIG_FILE} (${where}) could not be read from git`);
320
326
  return text;
321
327
  }
322
328
  /**
@@ -13,6 +13,12 @@ export interface ParsedDiff {
13
13
  export declare function parseUnifiedDiff(diff: string): ParsedDiff;
14
14
  export declare function stagedDiff(cwd: string): string;
15
15
  export declare function repoRoot(cwd: string): string;
16
+ /**
17
+ * The repo's allowlists, or none when its .gitleaks.toml is rejected. The
18
+ * warning is fixed text: a validation message can quote a path or other
19
+ * entry, and an entry can hold a credential.
20
+ */
21
+ export declare const ALLOWLIST_IGNORED_WARNING = "HQ secret scan: warning: the repo .gitleaks.toml allowlist was rejected; ignoring it and scanning with no repo allowlist";
16
22
  /**
17
23
  * Built-in rules plus the repo's own .gitleaks.toml allowlists. Diff paths are
18
24
  * relative to the repo root, as gitleaks' allowlist paths are.
@@ -5,7 +5,7 @@ import { execFileSync } from "node:child_process";
5
5
  import { readFileSync, realpathSync, statSync } from "node:fs";
6
6
  import { isAbsolute, relative, resolve, sep } from "node:path";
7
7
  import { scanFragment, scanPath } from "./detect.js";
8
- import { loadCommittedAllowlists, loadRepoAllowlists } from "./repo-config.js";
8
+ import { InvalidAllowlistError, loadCommittedAllowlists, loadRepoAllowlists } from "./repo-config.js";
9
9
  import { compiledRules } from "./rules.js";
10
10
  export class ScanInputError extends Error {
11
11
  }
@@ -101,13 +101,31 @@ export function repoRoot(cwd) {
101
101
  throw new ScanInputError(`could not find the repo root: ${detail || "git rev-parse failed"}`);
102
102
  }
103
103
  }
104
+ /**
105
+ * The repo's allowlists, or none when its .gitleaks.toml is rejected. The
106
+ * warning is fixed text: a validation message can quote a path or other
107
+ * entry, and an entry can hold a credential.
108
+ */
109
+ export const ALLOWLIST_IGNORED_WARNING = "HQ secret scan: warning: the repo .gitleaks.toml allowlist was rejected; ignoring it and scanning with no repo allowlist";
110
+ function repoAllowlistsOrNone(load) {
111
+ try {
112
+ return load();
113
+ }
114
+ catch (err) {
115
+ if (!(err instanceof InvalidAllowlistError))
116
+ throw err;
117
+ process.stderr.write(`${ALLOWLIST_IGNORED_WARNING}\n`);
118
+ return [];
119
+ }
120
+ }
104
121
  /**
105
122
  * Built-in rules plus the repo's own .gitleaks.toml allowlists. Diff paths are
106
123
  * relative to the repo root, as gitleaks' allowlist paths are.
107
124
  */
108
125
  export function scanStaged(cwd) {
109
126
  const diff = stagedDiff(cwd);
110
- const rules = { ...compiledRules(), repo: loadRepoAllowlists(repoRoot(cwd)) };
127
+ const root = repoRoot(cwd);
128
+ const rules = { ...compiledRules(), repo: repoAllowlistsOrNone(() => loadRepoAllowlists(root)) };
111
129
  const { fragments, binaryFiles } = parseUnifiedDiff(diff);
112
130
  return [...fragments.flatMap((f) => scanFragment(f, rules)), ...binaryFiles.flatMap((f) => scanPath(f, rules))];
113
131
  }
@@ -145,7 +163,7 @@ function matchPath(p, repo, snapshotRoot) {
145
163
  }
146
164
  export function scanFiles(paths, opts = {}) {
147
165
  const root = opts.repo !== undefined ? repoRoot(opts.repo) : undefined;
148
- const rules = root !== undefined ? { ...compiledRules(), repo: loadCommittedAllowlists(root, opts.allowlistRev) } : compiledRules();
166
+ const rules = root !== undefined ? { ...compiledRules(), repo: repoAllowlistsOrNone(() => loadCommittedAllowlists(root, opts.allowlistRev)) } : compiledRules();
149
167
  const repo = root !== undefined ? real(root) : undefined;
150
168
  const snapshotRoot = opts.snapshotRoot !== undefined ? real(opts.snapshotRoot) : undefined;
151
169
  const out = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.165",
3
+ "version": "5.345.168",
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.100",
55
+ "@indigoai-us/hq-cloud": "6.18.101",
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.165",
118
- "@indigoai-us/hq-hook-win32-arm64": "5.345.165",
119
- "@indigoai-us/hq-hook-darwin-x64": "5.345.165",
120
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.165",
121
- "@indigoai-us/hq-hook-linux-x64": "5.345.165",
122
- "@indigoai-us/hq-hook-linux-arm64": "5.345.165"
117
+ "@indigoai-us/hq-hook-win32-x64": "5.345.168",
118
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.168",
119
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.168",
120
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.168",
121
+ "@indigoai-us/hq-hook-linux-x64": "5.345.168",
122
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.168"
123
123
  }
124
124
  }