@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 +1 @@
1
- {"name":"hq-cli-daemon-sync-runner","type":"module","version":"6.18.100","bundleSha256":"75a1828c5307937f67a1435a11ad08a0db16a30a3e3701d2a4d0fced3540cb33","formatVersion":1}
1
+ {"name":"hq-cli-daemon-sync-runner","type":"module","version":"6.18.101","bundleSha256":"353f47dca127c7f6c1e00de5c9cdce809c5c32d08b2deb9755020b8e8b822871","formatVersion":1}
@@ -17,7 +17,7 @@
17
17
  */
18
18
  import { CLI_VERSION } from "../../../cli-version.js";
19
19
  import { peekIdToken } from "../../../utils/id-token.js";
20
- import { isRecipientUid } from "../../../lib/notify-recipient.js";
20
+ import { defaultAudienceFor, isAgentUid, isRecipientUid } from "../../../lib/notify-recipient.js";
21
21
  import { redactAgentInboxItem } from "../inbox-redact.js";
22
22
  import { markInboxDone, mergeAgentInbox, readDoneIds, summarizeInboxEntry } from "../inbox-state.js";
23
23
  import { AttachmentCompanyUnresolvedError, fetchChatAttachment } from "./attachments.js";
@@ -214,13 +214,13 @@ export function buildAgentMcpTools(clients) {
214
214
  },
215
215
  {
216
216
  name: "hq_dm_send",
217
- description: "Send an HQ message as this agent to a person (email or prs_…), an agent (agt_…), or a channel or group DM (chn_…). When replying to an inbox item that has a channelId, pass that channelId as `to` so the answer lands in the conversation it came from. Use audience='agent' for progress/status messages that only agents need to see; audience='human' for messages a person must read; audience='both' when unsure.",
217
+ description: "Send an HQ message as this agent to a person (email or prs_…), an agent (agt_…), or a channel or group DM (chn_…). When replying to an inbox item that has a channelId, pass that channelId as `to` so the answer lands in the conversation it came from. Use audience='agent' for progress/status messages that only agents need to see; audience='human' for messages a person must read; audience='both' when unsure. Default: human for a person, agent for an agent, a channel or a group.",
218
218
  inputSchema: {
219
219
  type: "object",
220
220
  properties: {
221
221
  to: { type: "string", description: "Email, prs_… or agt_… uid, or a chn_… channel id" },
222
222
  message: { type: "string" },
223
- audience: { type: "string", enum: ["human", "agent", "both"], description: "Who this message is for (default: human)" },
223
+ audience: { type: "string", enum: ["human", "agent", "both"], description: "Who this message is for (default: human for a person, agent for an agent, channel or group)" },
224
224
  },
225
225
  required: ["to", "message"],
226
226
  additionalProperties: false,
@@ -238,7 +238,7 @@ export function buildAgentMcpTools(clients) {
238
238
  const token = await clients.getToken();
239
239
  const res = await clients.apiJson(token, `/v1/notify/channels/${encodeURIComponent(to)}/messages`, {
240
240
  method: "POST",
241
- body: { body: message, ...(audience ? { audience } : {}) },
241
+ body: { body: message, audience: audience ?? defaultAudienceFor("channel") },
242
242
  });
243
243
  if (res.status < 200 || res.status >= 300) {
244
244
  return errorResult(`Channel send failed (${res.status}): ${describeError(res.body)}`);
@@ -252,8 +252,7 @@ export function buildAgentMcpTools(clients) {
252
252
  : (() => {
253
253
  throw new McpToolInputError('"to" must be an email, prs_… or agt_… uid, or a chn_… channel id');
254
254
  })();
255
- if (audience)
256
- body.audience = audience;
255
+ body.audience = audience ?? defaultAudienceFor(isAgentUid(to) ? "agent" : "person");
257
256
  const token = await clients.getToken();
258
257
  const res = await clients.apiJson(token, "/v1/notify/dm", { method: "POST", body });
259
258
  if (res.status < 200 || res.status >= 300) {
@@ -32,9 +32,14 @@ export interface SyncRuntimeOptions {
32
32
  * - `cloudwatch-metric`: the latency metric publisher was refused.
33
33
  * - `targeted-pull`: the object pull after a change event failed; the
34
34
  * refused keys are named by `sync.runtime.pull-access-denied`.
35
- * - `runner-error`: a runner `error` record outside the receiver.
35
+ *
36
+ * Only the receiver's own records are counted (`type:"receiver"` or an event
37
+ * named `receiver.*`). A runner `error` record from elsewhere, such as
38
+ * `runner.telemetry.outcome_flag_failed` carrying "hq-flags: resolve returned
39
+ * 403" for a company the caller is not a member of, is not a receiver
40
+ * permission refusal and is not counted here.
36
41
  */
37
- export type ReceiverRefusalCall = "subscribe" | "sqs-receive" | "sqs-visibility" | "sqs-delete" | "cloudwatch-metric" | "targeted-pull" | "runner-error" | "other";
42
+ export type ReceiverRefusalCall = "subscribe" | "sqs-receive" | "sqs-visibility" | "sqs-delete" | "cloudwatch-metric" | "targeted-pull" | "other";
38
43
  /** Classify the last hour of sync log lines into privacy-safe results. */
39
44
  export declare function analyzeSyncRuntimeLog(lines: readonly string[], options: SyncRuntimeOptions): CheckResult[];
40
45
  /**
@@ -73,8 +73,6 @@ function classifyRefusal(record, errText) {
73
73
  const byEvent = RECEIVER_EVENT_CALLS[event];
74
74
  if (byEvent)
75
75
  return byEvent;
76
- if (record.type === "error")
77
- return "runner-error";
78
76
  return "other";
79
77
  }
80
78
  const QUEUE_LEG = new Set([
@@ -230,7 +228,7 @@ export function analyzeSyncRuntimeLog(lines, options) {
230
228
  slowReceiptTimes.push(time);
231
229
  }
232
230
  if (time >= since &&
233
- (record.type === "receiver" || record.type === "error" ||
231
+ (record.type === "receiver" ||
234
232
  (typeof event === "string" && event.startsWith("receiver.")))) {
235
233
  const errText = JSON.stringify(record.err ?? record.message ?? "");
236
234
  if (PERMISSION.test(errText)) {