@indigoai-us/hq-cli 5.124.0 → 5.126.0

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 (80) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/assets/bot-workers/setup/skills/joining-a-team.md +125 -0
  3. package/assets/bot-workers/setup/skills/your-business.md +270 -0
  4. package/assets/bot-workers/setup/worker.yaml +189 -58
  5. package/dist/command-catalog.generated.d.ts +414 -5
  6. package/dist/command-catalog.generated.js +531 -5
  7. package/dist/command-registration-plan.d.ts +6 -0
  8. package/dist/command-registration-plan.js +1 -0
  9. package/dist/commands/bot.d.ts +10 -0
  10. package/dist/commands/bot.js +6 -0
  11. package/dist/commands/lanes.d.ts +75 -0
  12. package/dist/commands/lanes.js +2032 -0
  13. package/dist/commands/login.js +49 -6
  14. package/dist/commands/mesh.js +133 -28
  15. package/dist/commands/onboard-create-identity.d.ts +26 -0
  16. package/dist/commands/onboard-create-identity.js +23 -0
  17. package/dist/commands/onboard.js +13 -4
  18. package/dist/lib/bot/progress.d.ts +6 -0
  19. package/dist/lib/bot/progress.js +16 -0
  20. package/dist/lib/bot/runtime/grok.d.ts +30 -7
  21. package/dist/lib/bot/runtime/grok.js +86 -8
  22. package/dist/lib/bot/runtime/index.js +15 -8
  23. package/dist/lib/bot/runtime/messages-stream.d.ts +12 -3
  24. package/dist/lib/bot/runtime/messages-stream.js +49 -3
  25. package/dist/lib/doctor/checks/work-context.js +4 -2
  26. package/dist/lib/lanes/accounts.d.ts +43 -0
  27. package/dist/lib/lanes/accounts.js +128 -0
  28. package/dist/lib/lanes/config.d.ts +56 -0
  29. package/dist/lib/lanes/config.js +351 -0
  30. package/dist/lib/lanes/errors.d.ts +39 -0
  31. package/dist/lib/lanes/errors.js +72 -0
  32. package/dist/lib/lanes/index.d.ts +19 -0
  33. package/dist/lib/lanes/index.js +12 -0
  34. package/dist/lib/lanes/liveness.d.ts +89 -0
  35. package/dist/lib/lanes/liveness.js +273 -0
  36. package/dist/lib/lanes/registry.d.ts +103 -0
  37. package/dist/lib/lanes/registry.js +247 -0
  38. package/dist/lib/lanes/store.d.ts +64 -0
  39. package/dist/lib/lanes/store.js +627 -0
  40. package/dist/lib/lanes/throttle.d.ts +89 -0
  41. package/dist/lib/lanes/throttle.js +297 -0
  42. package/dist/lib/lanes/types.d.ts +193 -0
  43. package/dist/lib/lanes/types.js +217 -0
  44. package/dist/lib/mesh/live/backfill-held.d.ts +2 -0
  45. package/dist/lib/mesh/live/backfill-held.js +8 -4
  46. package/dist/lib/mesh/live/daemon/board-refresh.d.ts +3 -0
  47. package/dist/lib/mesh/live/daemon/board-refresh.js +6 -0
  48. package/dist/lib/mesh/live/daemon/config.d.ts +27 -0
  49. package/dist/lib/mesh/live/daemon/config.js +75 -0
  50. package/dist/lib/mesh/live/daemon/doctor.d.ts +3 -0
  51. package/dist/lib/mesh/live/daemon/doctor.js +21 -1
  52. package/dist/lib/mesh/live/daemon/index.d.ts +4 -3
  53. package/dist/lib/mesh/live/daemon/index.js +3 -3
  54. package/dist/lib/mesh/live/daemon/install.d.ts +143 -1
  55. package/dist/lib/mesh/live/daemon/install.js +444 -2
  56. package/dist/lib/mesh/live/daemon/paths.d.ts +2 -0
  57. package/dist/lib/mesh/live/daemon/paths.js +2 -0
  58. package/dist/lib/mesh/live/daemon/run.d.ts +11 -0
  59. package/dist/lib/mesh/live/daemon/run.js +129 -10
  60. package/dist/lib/mesh/live/daemon/state.d.ts +2 -0
  61. package/dist/lib/mesh/live/flush.d.ts +3 -0
  62. package/dist/lib/mesh/live/flush.js +11 -0
  63. package/dist/lib/scan-packages/index.js +17 -12
  64. package/dist/lib/work-context/company.d.ts +8 -0
  65. package/dist/lib/work-context/company.js +62 -18
  66. package/dist/lib/work-context/config.d.ts +55 -0
  67. package/dist/lib/work-context/config.js +333 -67
  68. package/dist/lib/work-context/contract.d.ts +2 -0
  69. package/dist/lib/work-context/default-company.d.ts +43 -0
  70. package/dist/lib/work-context/default-company.js +83 -0
  71. package/dist/lib/work-context/outbox.d.ts +5 -1
  72. package/dist/lib/work-context/outbox.js +5 -0
  73. package/dist/lib/work-context/reconcile.d.ts +4 -0
  74. package/dist/lib/work-context/reconcile.js +86 -9
  75. package/dist/lib/work-context/state.d.ts +2 -0
  76. package/dist/lib/work-context/state.js +14 -0
  77. package/dist/lib/work-context/windows-acl.d.ts +123 -0
  78. package/dist/lib/work-context/windows-acl.js +425 -0
  79. package/dist/utils/pack-contributions.js +5 -4
  80. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,155 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.126.0] — 2026-09-21
6
+
7
+ ### Fixed
8
+
9
+ - `hq mesh start` works for people again. It was sending your email address as
10
+ the claimant, and the server compares that to your person id, so every human
11
+ start failed with "claimedBy must match the authenticated author" and left
12
+ the thread unclaimed. Claims now carry your resolved person id (bots keep
13
+ their agent id).
14
+
15
+ ### Changed
16
+
17
+ - On Windows, the mesh daemon's Scheduled Task now names the HQ root it was
18
+ installed for right in the task command (`mesh daemon run --hq-root <path>`)
19
+ instead of relying on a remembered list of roots. Install only wraps the
20
+ daemon in `conhost.exe --headless` when the machine is new enough to support
21
+ it (Windows 10 1809 or later) and says which mode it chose. `hq mesh daemon
22
+ status` now reports when the task's last start failed, and reminds you that
23
+ the task only runs while you are logged on. macOS and Linux are unchanged.
24
+
25
+ - `hq mesh daemon install` no longer mistakes a code repo for your HQ. It
26
+ accepts `--hq-root <path>`, otherwise uses `HQ_ROOT`, otherwise walks up
27
+ from the current folder to the nearest real HQ tree (one with
28
+ `companies/manifest.yaml` and `core/`, `.claude/`, or `personal/`). A folder
29
+ that only has `.claude/` does not count. If nothing qualifies, install stops
30
+ and tells you to pass `--hq-root` instead of recording the wrong root. The
31
+ install confirmation now leads with the root it chose and how, and `hq mesh
32
+ daemon status` prints the root the task actually carries and warns when that
33
+ folder has since moved or been deleted.
34
+
35
+ - The setup bot now recognises when you have joined a company that someone
36
+ else already built. Instead of asking what kind of business you own and
37
+ offering to connect apps your team connected months ago, it shows you what
38
+ is already there in real names and counts, answers one real question from
39
+ your company's own memory, asks what you do there, and offers only what is
40
+ missing for you. Things only an owner can do now name the owner instead of
41
+ failing.
42
+
43
+ - The setup bot asks which tools you actually use and connects each one
44
+ however that tool needs it, after recommending the few things a business
45
+ like yours should set up. It no longer works from a fixed list of apps.
46
+
47
+ - Setup no longer asks for your name when you are already signed in, and no
48
+ longer offers to skip itself.
49
+
50
+ ### Fixed
51
+
52
+ - The desktop grok bot talks to grok 0.2.56 again. That CLI dropped
53
+ `--output-format streaming-messages-json` (only `plain`, `json`, and
54
+ `streaming-json` remain). The bot now reads the value from `grok --help`
55
+ once and caches it, retries with `streaming-json` if grok rejects the old
56
+ flag, and concatenates `streaming-json` text deltas for the reply instead
57
+ of treating them as Anthropic Messages events.
58
+
59
+ - `hq core scan-packages` writes pack-mount symlinks relative to the host
60
+ directory, so they survive a tree moving between machines. A leftover
61
+ absolute link from another host, or an absolute link that still points at
62
+ this pack's payload, is rewritten to the relative form on the next scan; a
63
+ correct relative link is left alone.
64
+
65
+ - Work Mesh reconcile now owns company attribution explicitly on the acked
66
+ path for every register where `resolvedCompany.uid` is set, not only fully
67
+ bound sessions. Previously the non-bound acked path had no reconcile-owned
68
+ attribution write and relied on an incidental side effect of
69
+ `writeAckedRegisterState` → `writeAcknowledgedRegisterBinding`; that side
70
+ effect already wrote `companyUid`/`companySlug` for ops carrying a uid, so
71
+ the tenant was not dropped in practice, but any future acked path that
72
+ preceded or skipped that call would silently lose it. The fix makes
73
+ attribution explicit: a company-only ack is projected as `needs_project`
74
+ with its tenant intact, the write reflects the true classification, and no
75
+ `projectId`, `taskId`, or binding episode is fabricated on partial paths.
76
+ Note: a company resolved by slug only (no uid) is still not attributed on
77
+ either path.
78
+
79
+ - The setup bot no longer posts the same question twice when a turn takes a
80
+ while: a question asked in an interim update is held back if the final
81
+ answer repeats it.
82
+
83
+ - On Windows, the work-context config safety check now inspects the file's
84
+ Windows ACL instead of POSIX mode bits, so `hq mesh context reconcile` no
85
+ longer refuses every run with "unsafe permissions 666" and session state and
86
+ register operations are written again. The config file and its directory must
87
+ be writable only by the current user, SYSTEM, and Administrators; any other
88
+ principal with write access is rejected, matched by SID so localized account
89
+ names do not matter, and named in the error. When the ACL cannot be read
90
+ at all (icacls missing, non-NTFS volume), the check follows a documented
91
+ reduced-guarantee path: it prints one diagnostic that the config is
92
+ unprotected on this platform and continues rather than blocking. macOS and
93
+ Linux behaviour is unchanged.
94
+
95
+ ### Added
96
+
97
+ - `hq mesh daemon install` now works on Windows. It registers a per-user
98
+ Scheduled Task (`ai.getindigo.hq-mesh-daemon`) that starts the mesh daemon at
99
+ logon, hidden, with no execution time limit and a restart-on-failure policy,
100
+ and starts it right away. `hq mesh daemon status` reports whether the task is
101
+ registered and running, `hq mesh daemon uninstall` ends and removes it, and a
102
+ CLI update restarts it like the macOS and Linux services. Before this the
103
+ three commands answered "No service manager integration on this platform",
104
+ so the session-event spool never drained on Windows. The task definition is
105
+ written as XML under `~/.hq/work-mesh/daemon/` and registered with
106
+ `schtasks.exe`; no new dependencies. macOS and Linux behaviour is unchanged.
107
+
108
+ - `hq bot list --json` reports `busy` and `busySince` for each bot on this
109
+ computer, and `hq bot status` shows an `answering:` line. Apps use this to
110
+ keep a "thinking" indicator up for a whole turn, rather than ending it the
111
+ moment the bot posts a progress note.
112
+
113
+ - Library layer for `hq lanes` (`src/lib/lanes/`): lane/question record store
114
+ with compare-and-set writes, provider-account resolution, CPU/memory throttle,
115
+ session liveness from the work-mesh spool, and path-keyed worker tenancy.
116
+
117
+ - `hq lanes` command surface: create/list/show/message/reparent/logs/stop,
118
+ non-blocking ask, questions list/show/answer/escalate/cancel, accounts
119
+ list/login/enable/disable, and sessions list/show. Create admits against
120
+ provider caps, the bounded queue, and the host throttle, then leaves the
121
+ lane queued — process spawn is an explicit not-implemented seam.
122
+
123
+ ## [5.125.0] — 2026-09-20
124
+
125
+ ### Fixed
126
+
127
+ - Work Mesh now preserves an acknowledged company binding through later
128
+ company-less hook writes, preventing repeated registrations and held events.
129
+ Held recovery accepts only durable registrations, canonical metadata under a
130
+ verified HQ root, or manifest-backed repository ownership; conflicting or
131
+ event-only hints stay unresolved. Its batch cursor rotates across restarts.
132
+ Both legacy and direct-mode daemons detect an upgraded CLI, and systemd units
133
+ use `Restart=always` so the installed service reloads the new code.
134
+
135
+ - Held-session recovery now accepts session metadata only from the daemon's
136
+ configured HQ root, requires current-session evidence before restoring an
137
+ acknowledged registration, and retains batch position when held records are
138
+ compacted. Repeated hook activity no longer re-registers an unchanged binding.
139
+ CLI updates report installed system units that need their host service manager
140
+ to restart them. Daemon installs persist verified HQ-root allowlists, inject
141
+ the primary root into service environments, and rewrite/reload existing user
142
+ units so upgraded daemons restart reliably.
143
+
144
+ ### Added
145
+
146
+ - Work Mesh now activates a device default company automatically when a signed-in
147
+ person has exactly one active membership. Devices with several memberships ask
148
+ for a choice in interactive CLI paths and show the stored state in `hq mesh
149
+ context default get --json`. Clearing the default is a durable opt-out until
150
+ the person explicitly sets one again. Historical held sessions remain unchanged
151
+ unless `hq mesh context backfill-held --use-device-default` is supplied; those
152
+ repaired records are labeled lower-confidence and counted by daemon doctor.
153
+
5
154
  ## [5.124.0] — 2026-09-20
6
155
 
7
156
  ### Added
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: joining-a-team
3
+ title: Joining a team
4
+ description: Set up someone who installed HQ into a company that already exists, by showing them what they just inherited and adding what is missing for them.
5
+ ---
6
+
7
+ # Joining a team
8
+
9
+ Most people who install HQ from here on are not founders. They are the fourth
10
+ person at a company that already has channels, connected apps, meetings,
11
+ knowledge and bots. Their setup is not "build an HQ". It is "here is the HQ you
12
+ just walked into, and here is what I will add for you."
13
+
14
+ Getting this wrong is what makes setup feel generic: asking a new account
15
+ manager what kind of business they own, or offering to connect a note taker
16
+ their company connected months ago.
17
+
18
+ ## 1. Work out that this is an existing company, before you ask anything
19
+
20
+ Their companies come from the "Owner context" block at the top of their
21
+ message. Never use your own `hq` membership for this; that describes you, the
22
+ bot.
23
+
24
+ When the block names a company, look at how much is already in it. Quiet
25
+ reads, one message of output for them at the end, never a transcript of the
26
+ looking:
27
+
28
+ - People: `hq members list` (and `hq people list`) for the company.
29
+ - Conversations: `hq channels`.
30
+ - Apps the company already connected: `hq integrations list`.
31
+ - Bots already working there: `hq agents list`, and `hq bot list --remote`.
32
+ - What the shared memory holds: the company folder under `companies/<slug>/`
33
+ (knowledge, projects, people), `hq meetings list --limit 5`,
34
+ `hq signals list --limit 10`, and `hq search "<a word from their work>"`.
35
+
36
+ Then decide which of these you are in:
37
+
38
+ - **A company with things in it** (more than one person, or any connected app,
39
+ bot, meeting or knowledge). This skill is the whole middle of their setup.
40
+ - **A company that is empty** (they were invited, but nothing has been set up
41
+ yet). Treat it as a founder's setup that happens to have a company already:
42
+ do not create one, and follow `skills/your-business.md` as written.
43
+ - **No company.** This skill does not apply. Go back to
44
+ `skills/first-company.md`.
45
+
46
+ If the owner-context check failed, say you could not check right now. Never
47
+ treat an unreadable check as "you are alone".
48
+
49
+ ## 2. Give them the tour, grounded in what is actually there
50
+
51
+ One short message. Real names and counts from the reads above, never a
52
+ description of HQ as a product:
53
+
54
+ > You're in **Northwind** with Sara, Ali and two others. The team has Slack,
55
+ > Fireflies and Linear connected, 40 meetings recorded, and two bots already
56
+ > running: one that writes the weekly update, one that watches support.
57
+
58
+ Then prove it, in the same breath, with one real answer only their company's
59
+ HQ could give. Pull it yourself and show the answer, not the method:
60
+
61
+ > From last week: the team decided to push the pricing change to November and
62
+ > to keep the legacy plan for existing customers.
63
+
64
+ That single line is what makes the product land. A person who reads it
65
+ understands the shared context layer without being told about it.
66
+
67
+ Then say what it means for them, in their words: everything the team has
68
+ connected is already theirs, every bot they talk to starts from it, and
69
+ anything they add lands for the whole team the same way.
70
+
71
+ Never invent any of this. If a category is empty, say so plainly and make it
72
+ the first thing you offer to fix.
73
+
74
+ ## 3. Ask about them, not about the business
75
+
76
+ You already know the business. Confirm it in half a sentence rather than
77
+ asking. What you do not know is where they fit, so ask that, one question, in
78
+ plain words:
79
+
80
+ > What do you do at Northwind, day to day?
81
+
82
+ Their answer decides everything you offer next. Write it into their profile
83
+ the way step 5 of the walkthrough describes, so every other bot knows it too.
84
+
85
+ If they seem more interested in understanding HQ than in configuring it, let
86
+ that be the session: walk them through what is in their HQ, answer questions,
87
+ and offer the additions at the end. Familiarity is a legitimate outcome of
88
+ setup for a joiner.
89
+
90
+ ## 4. Offer what is missing for them, not for the company
91
+
92
+ Check what exists before offering anything, and say plainly what they already
93
+ have rather than offering it again:
94
+
95
+ > Fireflies is already connected, so your meetings are in here from today.
96
+
97
+ Then offer only the gaps, three at most, each with a reason tied to what they
98
+ just told you:
99
+
100
+ - **Their own tools on this Mac**: the coding tool they use, signed in.
101
+ - **Apps the company has not connected**, or that are personal to them: their
102
+ own calendar and inbox, the board they personally live in.
103
+ - **A home for their own work**: their projects or their clients, alongside
104
+ the company's.
105
+ - **Their first bot**, aimed at their job rather than the company's: what they
106
+ do every morning that a bot could do first.
107
+
108
+ ## 5. Things only an owner can do
109
+
110
+ Inviting people, company-wide credentials and some company files may not be
111
+ theirs to change. When they ask for one, do not attempt it and fail. Say who
112
+ can do it, by name, from the members list, and offer to send that person the
113
+ request from them:
114
+
115
+ > Sara owns Northwind, so the invite has to come from her. Want me to message
116
+ > her and ask?
117
+
118
+ If a read is refused, say so in one line, name the person who can grant it,
119
+ and move on. Never retry, and never guess at what the file said.
120
+
121
+ ## 6. Finish
122
+
123
+ Close the way the walkthrough closes, with their version of it: what they
124
+ inherited, what you added today, and the one thing worth trying tomorrow. If
125
+ they have a bot now, hand them over to it.
@@ -0,0 +1,270 @@
1
+ ---
2
+ name: your-business
3
+ title: Your business
4
+ description: Work out what kind of business the person runs, then recommend and set up the connections and structure that kind of business needs, one confirmed suggestion at a time.
5
+ ---
6
+
7
+ # Your business
8
+
9
+ This step runs right after Import. It is the part of setup that should feel
10
+ like talking to someone who has set up HQ for a hundred businesses like theirs.
11
+ Do not ask the person what they want to connect; you know better than they do
12
+ what a business like theirs needs in HQ. Work out what kind of business it is,
13
+ then recommend specific things, say why each one matters, and set up the ones
14
+ they agree to.
15
+
16
+ ## 1. Work out the business before you ask
17
+
18
+ Look first, quietly. You may already know most of the answer from:
19
+
20
+ - the company they joined or created in the previous step (its name, and
21
+ anything in `companies/{co}/knowledge/`),
22
+ - what Import just found (repository names, project names, note titles, the
23
+ kinds of documents on this machine),
24
+ - the "Owner context" block,
25
+ - their email domain.
26
+
27
+ If the evidence points clearly to one kind of business, say what you think it
28
+ is and ask them to confirm, in one line: "From what I found, it looks like you
29
+ run a marketing agency. Is that right?" If it does not, ask plainly:
30
+
31
+ > **What kind of business do you run?**
32
+
33
+ Accept any answer in their own words. Map it to the closest profile below. If
34
+ it matches none of them, use "Any business" plus your own judgement, and do
35
+ not force it into a category. Ask at most one follow-up if it changes the
36
+ recommendations (for an agency: "About how many clients do you work with right
37
+ now?"; for a brand: "Do you sell mostly on your own store, on Amazon, or in
38
+ retail?").
39
+
40
+ Record the business type and the key facts in the progress note and in
41
+ `personal/knowledge/profile.md`.
42
+
43
+ ## 2. Say what you recommend, then go one at a time
44
+
45
+ Open with one short message that names the business back to them and lists
46
+ the three to five things you recommend, in order, each with a reason of a few
47
+ words. For example:
48
+
49
+ > Great, an agency with about twelve clients. Here's what I'd set up for you:
50
+ > your note taker, so every client call lands in HQ; your project management
51
+ > tool, so bots can see what's due; and a home for each client, so their work
52
+ > stays separate. Want to start with your note taker?
53
+
54
+ Then take them one at a time. For each item: ask the one question it needs
55
+ (which tool they use, or yes/no), do it, say in one line what is now true,
56
+ and move to the next. "Not now" is a fine answer; move on without arguing and
57
+ do not return to it.
58
+
59
+ Recommend only what fits what they told you. Three well-chosen items beat
60
+ eight generic ones. Never show a catalogue of supported apps.
61
+
62
+ ## 3. Find their tools, then get each one working
63
+
64
+ ### Start with what is already there
65
+
66
+ Before asking anything, quietly look for tools they already use:
67
+
68
+ - **Connectors already set up in their Claude app.** Run
69
+ `hq integrations import --dry-run`. If it finds any, offer to bring them
70
+ into their company in one go, then run it for real. Their personal Claude
71
+ connectors do not work reliably for you or for other bots running in the
72
+ background; the HQ copy does. Never lean on their personal Claude
73
+ connectors to read their data.
74
+ - **Apps and signed-in tools on this Mac.** Look in `/Applications` and
75
+ `~/Applications` for the apps behind common work tools (Slack, Zoom,
76
+ Granola, Notion, ClickUp, Linear, Figma), and check which command-line tools
77
+ are installed and signed in (`gh`, `shopify`, `gcloud`, `stripe`, `vercel`).
78
+ - **What Import and the profile already told you.**
79
+
80
+ Then lead with a guess instead of a blank question: "It looks like you use
81
+ Slack, Notion and Granola. Which other tools do you use to run the business
82
+ day to day?" Take what they add in their own words, and add anything from your
83
+ recommendations they did not mention ("You didn't mention a note taker. Do
84
+ you record your calls?").
85
+
86
+ ### Work out how to connect each tool yourself
87
+
88
+ There is no list of supported tools. For each tool, find out how it connects,
89
+ the way a good engineer would, and then do it:
90
+
91
+ 1. **Ask HQ first.** `hq integrations inspect <domain>` (for example
92
+ `shopify.com`) shows what HQ can already resolve for that tool. If it
93
+ resolves, `hq integrations connect <domain>` is usually all it takes.
94
+ 2. **Otherwise, search.** Search the web for the tool's official MCP server
95
+ ("<tool> MCP server") and its API docs ("<tool> API key" or
96
+ "<tool> API authentication"). Read the official docs, not a blog post. Work
97
+ out, in this order of preference:
98
+ - an official remote MCP server (a URL, usually with a browser sign-in),
99
+ - an official API with a key or token,
100
+ - a well-maintained community MCP server,
101
+ - an export, email report or shared sheet, when there is no API.
102
+ Prefer the tool's own route over a third-party app that sits in front of
103
+ it. Only suggest a substitute (for example a commerce aggregator instead of
104
+ Shopify itself) if the direct route is genuinely impossible, and say why.
105
+ 3. **Connect it through HQ, never by hand.**
106
+ - MCP server: `hq integrations connect --mcp-url <url> --display-name
107
+ "<Tool>" --provider <slug>`, or `hq integrations connect --docs-url
108
+ <docsUrl>` / `hq integrations discover <docsUrl>` when you only have a
109
+ docs page.
110
+ - API key: tell them exactly where to create it (the settings page, with a
111
+ direct link when the docs give one, and the permissions to tick, read
112
+ access only unless they want more). They paste it into a one-time vault
113
+ link (`hq secrets generate-link`), never into the chat. Then either
114
+ connect it by piping from the vault
115
+ (`hq secrets exec --only <NAME> -- sh -c 'printf %s "$<NAME>" | hq integrations connect ... --token-stdin'`)
116
+ or, when the tool has no MCP server for HQ to wrap, keep the key in the
117
+ vault and call the API with `hq secrets exec`. Never use `--token`,
118
+ never print a key, never ask for one in the chat.
119
+ - Browser sign-in: `connect` opens the page and then waits for the
120
+ sign-in to come back. That wait must outlive your reply, because
121
+ everything you start ends when your turn ends. So always start it
122
+ detached, with a long timeout and a log:
123
+ `nohup hq integrations connect <app or --mcp-url ...> --timeout 1800 > /tmp/hq-connect-<slug>.log 2>&1 &`
124
+ Then read the log after a few seconds to confirm the page opened (or to
125
+ catch an error right away), and say "I've opened a Shopify sign-in page
126
+ in your browser. Approve it there and I'll see it on my side." Never run
127
+ `connect` for a browser sign-in in the foreground.
128
+ 4. **Check it landed, yourself.** On every turn while a connection is
129
+ pending, check `hq integrations list` (or `show <app>`) and the
130
+ `/tmp/hq-connect-<slug>.log` before you reply. When they tell you they
131
+ approved it, check again; if it is not there yet, wait and re-check a few
132
+ times over about a minute before answering. If it still has not landed,
133
+ say what the log shows in plain words (the page was closed, the sign-in
134
+ timed out, the account said no), restart the detached sign-in if that is
135
+ the fix, and never promise that the next attempt "will hold". You cannot
136
+ watch between messages, so do not say "I'll keep watching"; say you will
137
+ check again as soon as they reply.
138
+ 5. **Prove it works with their own data.** Run one real read
139
+ (`hq integrations tools --provider <slug>`, then a read-only call, or the
140
+ API call through `hq secrets exec`) and show them something real: last
141
+ week's orders, their latest call, the overdue tasks. Then one clause on
142
+ what it means for their team (see "What HQ is" in your instructions). A
143
+ connection is not done until this read works. Never say "connected",
144
+ "done" or "everything is set up" before it does.
145
+
146
+ If a step needs something only they can do (an admin approval, a paid plan),
147
+ say exactly what, record it in the progress note as waiting, and move on to
148
+ the next tool. When you come back to it later, check it again rather than
149
+ assuming.
150
+
151
+ When they name a tool in answer to your question, that is their go-ahead to
152
+ connect it; do not ask again. For tools you suggested yourself, ask once,
153
+ and once for a group is fine ("I can connect Slack, Notion and Granola now;
154
+ each opens a sign-in page. Go?"). Say what you are doing in plain words,
155
+ never the command.
156
+
157
+ If they want you to look at one document right now and the tool it lives in
158
+ is not connected yet, ask them to drop the file into this chat (they can
159
+ export a sheet as .xlsx or .csv and attach it with the paperclip). Start the
160
+ work from that, and connect the tool properly afterwards.
161
+
162
+ Never ask them to make a document publicly shared or "anyone with the link"
163
+ so you can read it. Connect the tool that holds it through HQ instead.
164
+
165
+ ### When something fails
166
+
167
+ Check your own side first. If a read fails, look at the connection's status
168
+ and the error before saying anything. Never tell them something on their side
169
+ is broken, expired or misconfigured unless you have checked it and can say
170
+ how you know. If they tell you something works on their side, believe them,
171
+ look for the problem on yours, and fix it (usually by connecting the tool
172
+ through HQ instead). Never argue.
173
+
174
+ ## Recommendations for every business
175
+
176
+ Always recommend these first, whatever the business, unless they are already
177
+ connected:
178
+
179
+ - **Note taker** (Granola, Fireflies, Otter, Fathom, Read.ai, tl;dv, or
180
+ meeting recordings from Zoom or Google Meet). This is the strongest
181
+ recommendation of all: meeting notes are where decisions, commitments and
182
+ client context live, and HQ turns them into signals, action items and
183
+ meeting prep. Say so in one sentence.
184
+ - **Email and calendar**, if they live in them (Google Workspace or
185
+ Microsoft 365).
186
+ - **Team chat** (Slack or Teams), if they work with a team.
187
+
188
+ ## Profiles
189
+
190
+ ### Agency or services firm
191
+
192
+ Marketing, creative, development, consulting, recruiting, accounting, or any
193
+ business that does work for clients.
194
+
195
+ - **Project management tool** (ClickUp, Asana, Monday, Notion, Linear,
196
+ Teamwork, Jira) so bots can see what is due and who owns it.
197
+ - **A home for each client.** Offer to set one up per active client, so each
198
+ client's knowledge, files and credentials stay separate, and so everyone
199
+ who works on that client, human or bot, sees the same picture. Ask for the list of
200
+ current clients (names only). Create them with `/new-client` once the
201
+ person agrees, confirming the list before you create anything. For more
202
+ than five clients, offer to start with their top three and add the rest
203
+ later.
204
+ - **CRM** (HubSpot, Attio, Pipedrive, Salesforce) if they run their own sales.
205
+ - **Time tracking or billing** (Harvest, Toggl, Everhour, QuickBooks, Xero)
206
+ if they bill by the hour.
207
+ - For marketing agencies, the **ad platforms** they manage for clients (Meta,
208
+ Google Ads, TikTok) and **Klaviyo** if they do email.
209
+ - First bot ideas: a weekly client status report, call prep before each client
210
+ meeting, action items pulled from every call.
211
+
212
+ ### E-commerce or consumer brand
213
+
214
+ - **Store** (Shopify, WooCommerce, BigCommerce, Amazon Seller Central).
215
+ - **Data warehouse or analytics** (BigQuery, Snowflake, Triple Whale,
216
+ Northbeam, Polar, Google Analytics), so bots can answer performance
217
+ questions from real numbers.
218
+ - **Marketing systems**: ad platforms (Meta, Google, TikTok), email and SMS
219
+ (Klaviyo, Postscript, Attentive), reviews (Okendo, Junip, Yotpo).
220
+ - **Project management** (as above).
221
+ - **ERP or operations** (NetSuite, Cin7, Brightpearl, a 3PL portal) if they
222
+ hold inventory.
223
+ - First bot ideas: a daily performance pulse, creative fatigue alerts, a
224
+ weekly business review.
225
+
226
+ ### Software or product company
227
+
228
+ - **Code** (GitHub or GitLab), **issue tracker** (Linear, Jira), **docs**
229
+ (Notion, Confluence).
230
+ - **Product analytics** (PostHog, Amplitude, Mixpanel) and **errors**
231
+ (Sentry).
232
+ - **CRM and support** (HubSpot, Salesforce, Intercom, Zendesk) if they sell or
233
+ support customers directly.
234
+ - **Billing** (Stripe).
235
+ - First bot ideas: a daily digest of what shipped, triage of new bug reports,
236
+ release notes.
237
+
238
+ ### Investor, fund or advisor
239
+
240
+ - **CRM or deal tracker** (Affinity, Attio, DealCloud, a spreadsheet).
241
+ - **Document storage** (Google Drive, Dropbox, Box) where memos and data
242
+ rooms live.
243
+ - A home for each portfolio company or active deal, if they want the work kept
244
+ separate.
245
+ - First bot ideas: deal screening, memo drafting, portfolio update summaries.
246
+
247
+ ### Creator, solo operator or freelancer
248
+
249
+ - **Where the work is published** (YouTube, a newsletter platform, social
250
+ accounts) and **where it is drafted** (Notion, Google Docs).
251
+ - **Payments** (Stripe, Gumroad) if they sell directly.
252
+ - Suggest working alone rather than a company, if that has not been settled.
253
+ - First bot ideas: repurposing one piece of content into several, a weekly
254
+ content plan.
255
+
256
+ ### Any business
257
+
258
+ When nothing above fits, ask what systems hold the truth about their business
259
+ (customers, money, work in progress) and recommend connecting those, plus the
260
+ note taker, email, calendar and chat.
261
+
262
+ ## What carries forward
263
+
264
+ Write the business type, the recommendations made, and what was connected,
265
+ skipped or wanted to the progress note. The later steps use it:
266
+
267
+ - "About you" skips anything you already learned here.
268
+ - "Connect" only offers what was not already covered here.
269
+ - "Your first moves" and the first bot come from the bot ideas that fit this
270
+ business and what they connected, not from generic features.