@leadbay/mcp 0.33.3 → 0.34.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.
package/dist/bin.js CHANGED
@@ -312,6 +312,15 @@ var init_client = __esm({
312
312
  this._region = region ?? _LeadbayClient.regionFromBaseUrl(baseUrl);
313
313
  }
314
314
  }
315
+ /**
316
+ * Whether this client may compose text that promotes a purchase. Default
317
+ * true. The MCP server sets it false for a host whose directory forbids
318
+ * promoting upgrades (see BuildServerOptions.includeCommerce); the only
319
+ * effect is that the QUOTA_EXCEEDED hint drops its two selling sentences.
320
+ * Set per client, and the hosted server builds one client per session, so
321
+ * this never leaks across tenants.
322
+ */
323
+ commerce = true;
315
324
  get baseUrl() {
316
325
  return this._baseUrl;
317
326
  }
@@ -631,7 +640,12 @@ var init_client = __esm({
631
640
  // agent can generate the URL itself instead of asking the user to
632
641
  // navigate to a website. Once the user has topped up, the previous
633
642
  // 429 is stale — retry the failed call.
634
- `${hintBase}, OR top up AI credits \u2014 top-ups clear the throttle immediately. Offer the user to generate a Stripe checkout URL via leadbay_create_topup_link, OR direct them to app.leadbay.ai \u2192 Billing. Check leadbay_account_status / leadbay_get_quota to see which resource window (daily/weekly/monthly) was hit. Once the user has topped up, the previous QUOTA_EXCEEDED is stale \u2014 re-call leadbay_account_status to refresh, then RETRY the original operation.`,
643
+ //
644
+ // The two selling sentences are dropped when `commerce` is off — this
645
+ // hint is text the agent reads out, and a host may forbid promoting a
646
+ // purchase. Nothing is reworded; the rest of the hint is unchanged, and
647
+ // "the user topped up (elsewhere), so retry" survives either way.
648
+ `${hintBase}` + (this.commerce ? `, OR top up AI credits \u2014 top-ups clear the throttle immediately. Offer the user to generate a Stripe checkout URL via leadbay_create_topup_link, OR direct them to app.leadbay.ai \u2192 Billing. ` : `. `) + `Check leadbay_account_status / leadbay_get_quota to see which resource window (daily/weekly/monthly) was hit. Once the user has topped up, the previous QUOTA_EXCEEDED is stale \u2014 re-call leadbay_account_status to refresh, then RETRY the original operation.`,
635
649
  endpoint,
636
650
  retryAfter,
637
651
  status
@@ -1283,7 +1297,7 @@ var init_notifications = __esm({
1283
1297
  });
1284
1298
 
1285
1299
  // ../core/dist/tool-descriptions.generated.js
1286
- var leadbay_account_history, leadbay_account_status, leadbay_acknowledge_notification, leadbay_add_contact, leadbay_add_leads_to_campaign, leadbay_add_note, leadbay_adjust_audience, leadbay_answer_clarification, leadbay_artifact_kit, leadbay_bulk_enrich_status, leadbay_bulk_qualify_leads, leadbay_campaign_call_sheet, leadbay_campaign_progression, leadbay_clear_selection, leadbay_clear_user_prompt, leadbay_create_campaign, leadbay_create_custom_field, leadbay_create_lens, leadbay_create_lens_draft, leadbay_create_topup_link, leadbay_delete_custom_field, leadbay_deselect_leads, leadbay_discover_leads, leadbay_dislike_lead, leadbay_dismiss_clarification, leadbay_enrich_contacts, leadbay_enrich_titles, leadbay_extend_lens, leadbay_followups_map, leadbay_get_clarification, leadbay_get_contacts, leadbay_get_enrichment_job_titles, leadbay_get_epilogue_responses, leadbay_get_lead_activities, leadbay_get_lead_custom_fields, leadbay_get_lead_notes, leadbay_get_lead_profile, leadbay_get_lens_filter, leadbay_get_lens_scoring, leadbay_get_prospecting_actions, leadbay_get_qualification_questions, leadbay_get_quota, leadbay_get_selection_ids, leadbay_get_taste_profile, leadbay_get_user_prompt, leadbay_get_web_fetch, leadbay_getting_started, leadbay_import_and_qualify, leadbay_import_leads, leadbay_import_status, leadbay_launch_bulk_enrichment, leadbay_like_lead, leadbay_list_campaigns, leadbay_list_lenses, leadbay_list_locations, leadbay_list_mappable_fields, leadbay_list_sectors, leadbay_login, leadbay_my_lenses, leadbay_new_lens, leadbay_open_billing_portal, leadbay_pick_clarification, leadbay_pin_contact, leadbay_prepare_outreach, leadbay_preview_bulk_enrichment, leadbay_promote_lens, leadbay_pull_followups, leadbay_pull_leads, leadbay_qualify_lead, leadbay_qualify_status, leadbay_recall_ordered_titles, leadbay_refine_prompt, leadbay_remove_contact, leadbay_remove_epilogue, leadbay_remove_leads_from_campaign, leadbay_remove_pushback, leadbay_report_friction, leadbay_report_outreach, leadbay_research_lead_by_id, leadbay_research_lead_by_name_fuzzy, leadbay_resolve_import_rows, leadbay_scan_portfolio_signals, leadbay_seed_candidates, leadbay_select_leads, leadbay_send_feedback, leadbay_set_active_lens, leadbay_set_epilogue_status, leadbay_set_lead_status, leadbay_set_pushback, leadbay_set_qualification_questions, leadbay_set_telemetry, leadbay_set_user_prompt, leadbay_team_activity, leadbay_tour_plan, leadbay_unpin_contact, leadbay_update_contact, leadbay_update_custom_field, leadbay_update_lens, leadbay_update_lens_filter;
1300
+ var leadbay_account_history, leadbay_account_status, leadbay_acknowledge_notification, leadbay_add_contact, leadbay_add_leads_to_campaign, leadbay_add_note, leadbay_adjust_audience, leadbay_answer_clarification, leadbay_artifact_kit, leadbay_bulk_enrich_status, leadbay_bulk_qualify_leads, leadbay_campaign_call_sheet, leadbay_campaign_progression, leadbay_clear_selection, leadbay_clear_user_prompt, leadbay_create_campaign, leadbay_create_custom_field, leadbay_create_lens, leadbay_create_lens_draft, leadbay_create_topup_link, leadbay_delete_custom_field, leadbay_deselect_leads, leadbay_discover_leads, leadbay_dislike_lead, leadbay_dismiss_clarification, leadbay_enrich_contacts, leadbay_enrich_titles, leadbay_extend_lens, leadbay_followups_map, leadbay_get_clarification, leadbay_get_contacts, leadbay_get_enrichment_job_titles, leadbay_get_epilogue_responses, leadbay_get_lead_activities, leadbay_get_lead_custom_fields, leadbay_get_lead_notes, leadbay_get_lead_profile, leadbay_get_lens_filter, leadbay_get_lens_scoring, leadbay_get_prospecting_actions, leadbay_get_qualification_questions, leadbay_get_quota, leadbay_get_selection_ids, leadbay_get_taste_profile, leadbay_get_user_prompt, leadbay_get_web_fetch, leadbay_getting_started, leadbay_import_and_qualify, leadbay_import_leads, leadbay_import_status, leadbay_launch_bulk_enrichment, leadbay_like_lead, leadbay_list_campaigns, leadbay_list_lenses, leadbay_list_locations, leadbay_list_mappable_fields, leadbay_list_sectors, leadbay_login, leadbay_my_lenses, leadbay_new_lens, leadbay_open_billing_portal, leadbay_pick_clarification, leadbay_pin_contact, leadbay_prepare_outreach, leadbay_preview_bulk_enrichment, leadbay_promote_lens, leadbay_pull_followups, leadbay_pull_leads, leadbay_qualify_lead, leadbay_qualify_status, leadbay_recall_ordered_titles, leadbay_refine_prompt, leadbay_remove_contact, leadbay_remove_epilogue, leadbay_remove_leads_from_campaign, leadbay_remove_pushback, leadbay_report_friction, leadbay_report_outreach, leadbay_research_lead_by_id, leadbay_research_lead_by_name_fuzzy, leadbay_resolve_import_rows, leadbay_scan_portfolio_signals, leadbay_seed_candidates, leadbay_select_leads, leadbay_send_feedback, leadbay_set_active_lens, leadbay_set_epilogue_status, leadbay_set_lead_status, leadbay_set_pushback, leadbay_set_qualification_questions, leadbay_set_telemetry, leadbay_set_user_prompt, leadbay_team_activity, leadbay_tour_plan, leadbay_unpin_contact, leadbay_update_contact, leadbay_update_custom_field, leadbay_update_lens, leadbay_update_lens_filter, NO_COMMERCE_TOOL_DESCRIPTIONS;
1287
1301
  var init_tool_descriptions_generated = __esm({
1288
1302
  "../core/dist/tool-descriptions.generated.js"() {
1289
1303
  "use strict";
@@ -2282,15 +2296,41 @@ WHEN NOT TO USE: as a default \u2014 answering with even a free-text reason give
2282
2296
 
2283
2297
  This tool MUTATES state. The caller (agent or human-in-the-loop) is responsible for confirming intent before invocation; the MCP server does not soft-prompt for confirmation. See \`annotations.destructiveHint\`.
2284
2298
  `;
2285
- leadbay_enrich_contacts = `Order email and/or phone enrichment for a specific contact. Tries the paid-contact path and falls back to the org-contact path on NOT_FOUND. Each email reveal and each phone reveal consumes QUOTA. Both \`email\` and \`phone\` default to \`true\` \u2014 a bare call enriches both channels.
2299
+ leadbay_enrich_contacts = `## WHEN TO USE
2300
+
2301
+ Trigger phrases: "enrich this contact", "get this person's email", "find <name>'s phone number", "reveal the email of <name> at <company>", "enrich the managing director, not the president", "enrichir le DG \xE0 la place du pr\xE9sident".
2302
+
2303
+ Do NOT use for: "enrich the CEOs / a job title across my leads" \u2192 \`leadbay_enrich_titles\`; "pin / mark this person as the priority contact" \u2192 \`leadbay_pin_contact\`; "draft an email / prepare outreach for this lead" \u2192 \`leadbay_prepare_outreach\`.
2304
+
2305
+ Prefer when: the user names ONE person on ONE company \u2014 pass the lead id + that contact's own id. A \`source:"paid"\` candidate id from leadbay_research_lead_by_id is valid input. Pinning does not enrich anyone.
2306
+
2307
+ Examples that SHOULD invoke this tool:
2308
+ - "Get me Jane Doe's email at Acme."
2309
+ - "Enrich the managing director at Cromology, not the president."
2310
+ - "Reveal the phone number for this contact."
2311
+
2312
+ Examples that should NOT invoke this tool (sound similar, route elsewhere):
2313
+ - "Enrich the CEOs across my top 10 leads."
2314
+ - "Pin Jane Doe as the main contact on Acme."
2315
+ - "Draft an outreach email for Acme."
2286
2316
 
2287
- WHEN TO USE: when you have a specific \`contact_id\` (from leadbay_get_contacts) and want to enrich just that one.
2317
+ ## RENDER (quick)
2318
+
2319
+ One line: "Enrichment started for <name> (<email / phone>)". Then re-read the
2320
+ lead's contacts every ~30s via leadbay_research_lead_by_id and report when
2321
+ the requested channel has landed. Never print a credits figure.
2288
2322
 
2289
- WHEN NOT TO USE: for bulk enrichment by job title across many leads \u2014 use leadbay_enrich_titles, which handles the selection lifecycle and returns a clean preview/launch flow.
2323
+ ---
2324
+
2325
+ Order email and/or phone enrichment for a specific contact. Tries the paid-contact path and falls back to the org-contact path on NOT_FOUND. Each email reveal and each phone reveal consumes QUOTA. Both \`email\` and \`phone\` default to \`true\` \u2014 a bare call enriches both channels.
2326
+
2327
+ WHEN TO USE: when the user has already picked WHO they want on a company and you hold that person's \`contact_id\` \u2014 from \`leadbay_research_lead_by_id\` (\`reachable\` / \`candidates\` lists) or \`leadbay_get_contacts\` where exposed. A \`source: "paid"\` candidate id is the normal input here: it is the person Leadbay suggested but has not resolved yet, and this tool is what resolves them. What to expect on the re-read depends on which id you passed. **Paid candidate:** the candidate row never carries email or phone; when the provider finds a channel, the person appears as a \`source: "org"\` row (new, or merged into an existing org contact for the same person) with a DIFFERENT id, and that row holds the channel and is pinnable. If nothing is found, the candidate row reads \`enrichment_done: true\` with no channel and no org row is created. **Org contact** (\`source: "org"\`, e.g. adding phone to someone who already has an email): the SAME row is updated in place, same id.
2328
+
2329
+ WHEN NOT TO USE: for bulk enrichment by job title across many leads \u2014 use leadbay_enrich_titles, which handles the selection lifecycle and returns a clean preview/launch flow. Not to mark someone as the priority contact \u2014 that is leadbay_pin_contact, and pinning does not enrich anyone.
2290
2330
 
2291
2331
  ## QUOTA, NOT CREDITS
2292
2332
 
2293
- Enrichment is gated by QUOTA (the per-window allowance in \`leadbay_account_status\`), not a credit balance. **Never pre-refuse because a credit number looks low or zero** \u2014 a freemium/fresh account with quota left can enrich even when its credit counter reads 0. The reveal either fits the remaining quota or the backend returns 429 (\`quota_exceeded\`); only THEN surface the exhausted window + wait-or-top-up choice. The \`credits_remaining\` field on the result is **advisory internal context only \u2014 do NOT display it**. Because it can read \`0\` on an account that still has quota, printing \`_(N credits remaining)_\` would falsely tell the user they're out. Do not render a credits balance at all; if the user asks where they stand, call \`leadbay_account_status\` and show the quota gauge instead. The actual per-contact cost (\`enrichment.credits_used\`) appears on the contact via leadbay_get_contacts after enrichment.
2333
+ Enrichment is gated by QUOTA (the per-window allowance in \`leadbay_account_status\`), not a credit balance. **Never pre-refuse because a credit number looks low or zero** \u2014 a freemium/fresh account with quota left can enrich even when its credit counter reads 0. The reveal either fits the remaining quota or the backend returns 429 (\`quota_exceeded\`); only THEN surface the exhausted window + wait-or-top-up choice. The \`credits_remaining\` field on the result is **advisory internal context only \u2014 do NOT display it**. Because it can read \`0\` on an account that still has quota, printing \`_(N credits remaining)_\` would falsely tell the user they're out. Do not render a credits balance at all; if the user asks where they stand, call \`leadbay_account_status\` and show the quota gauge instead. The actual per-contact cost (\`enrichment.credits_used\`) appears on the contact after enrichment.
2294
2334
 
2295
2335
  **Channels: when the user asks to enrich a contact without naming a channel, confirm scope via \`ask_user_input_v0\`** \u2014 \`"Enrich email only, or email + phone? (phone uses more quota)"\` \u2192 \`["Email only", "Email + phone"]\` \u2014 then pass the chosen \`email\`/\`phone\` flags. Skip the question only if they already said which channel(s) they want.
2296
2336
 
@@ -2300,7 +2340,7 @@ This tool MUTATES state. The caller (agent or human-in-the-loop) is responsible
2300
2340
 
2301
2341
  WHEN TO USE: as the agent's go-to enrichment entry point, immediately before proposing outreach.
2302
2342
 
2303
- WHEN NOT TO USE: to enrich a single contact \u2014 that's leadbay_enrich_contacts (granular). Speculatively, before the user has committed to outreaching \u2014 enrichment consumes quota. **NOT to add "titles" or "LinkedIn" to a list** \u2014 a contact's \`job_title\` and \`linkedin_page\` already ride on the contact record; they are FREE and need no enrichment. If the user asks for "title and LinkedIn only", read those fields directly (e.g. leadbay_get_contacts / leadbay_research_lead_by_id); do NOT launch a job here. This tool is strictly the email / phone reveal, which consumes quota.
2343
+ WHEN NOT TO USE: to enrich a single named contact \u2014 that's leadbay_enrich_contacts. Speculatively, before the user has committed to outreaching \u2014 enrichment consumes quota. **NOT to add "titles" or "LinkedIn" to a list** \u2014 a contact's \`job_title\` and \`linkedin_page\` already ride on the contact record; they are FREE and need no enrichment. If the user asks for "title and LinkedIn only", read those fields directly (e.g. leadbay_get_contacts / leadbay_research_lead_by_id); do NOT launch a job here. This tool is strictly the email / phone reveal, which consumes quota.
2304
2344
 
2305
2345
  ## ENRICHMENT CONSUMES QUOTA \u2014 the model to reason with
2306
2346
 
@@ -3719,10 +3759,10 @@ Passing a \`source: "paid"\` id here returns **\`contact not found\`**. That is
3719
3759
 
3720
3760
  To pin someone who is currently only a candidate, first make them an org contact:
3721
3761
 
3722
- - \`leadbay_enrich_titles\` (or \`leadbay_prepare_outreach\` with \`enrich: true\`) resolves the candidate and writes a NEW org contact for that person. It has a **different \`id\`** from the paid candidate, so re-read the contacts list afterwards and pin the \`source: "org"\` row.
3762
+ - \`leadbay_enrich_contacts\` with the lead id + this candidate's id enriches exactly this person. \`leadbay_enrich_titles\` (or \`leadbay_prepare_outreach\` with \`enrich: true\`) does the same by job title. When the provider finds an email or phone, each writes a NEW org contact for that person (or merges into an existing one). It has a **different \`id\`** from the paid candidate, so re-read the contacts list afterwards and pin the \`source: "org"\` row. If nothing was found, no org contact exists and there is nothing to pin.
3723
3763
  - Or add them directly with \`leadbay_add_contact\`, which returns the new org contact's \`id\` \u2014 that id is pinnable immediately.
3724
3764
 
3725
- **Pinning does not steer enrichment.** It only marks who the priority is on a company the user already has. Enrichment picks people by JOB TITLE, so "enrich the Directeur G\xE9n\xE9ral rather than the Pr\xE9sident" is \`leadbay_enrich_titles\` with the wanted title \u2014 not a pin. Pinning first and enriching after changes nothing about who gets enriched.
3765
+ **Pinning does not steer enrichment.** It only marks who the priority is on a company the user already has. "Enrich the Directeur G\xE9n\xE9ral rather than the Pr\xE9sident" is \`leadbay_enrich_contacts\` with that person's id (or \`leadbay_enrich_titles\` with the wanted title) \u2014 not a pin. Pinning first and enriching after changes nothing about who gets enriched.
3726
3766
 
3727
3767
 
3728
3768
  Backend: \`POST /contacts/{contact_id}/pin\` \u2192 204. Idempotent. The inverse is \`leadbay_unpin_contact\`.
@@ -5704,10 +5744,10 @@ Passing a \`source: "paid"\` id here returns **\`contact not found\`**. That is
5704
5744
 
5705
5745
  To pin someone who is currently only a candidate, first make them an org contact:
5706
5746
 
5707
- - \`leadbay_enrich_titles\` (or \`leadbay_prepare_outreach\` with \`enrich: true\`) resolves the candidate and writes a NEW org contact for that person. It has a **different \`id\`** from the paid candidate, so re-read the contacts list afterwards and pin the \`source: "org"\` row.
5747
+ - \`leadbay_enrich_contacts\` with the lead id + this candidate's id enriches exactly this person. \`leadbay_enrich_titles\` (or \`leadbay_prepare_outreach\` with \`enrich: true\`) does the same by job title. When the provider finds an email or phone, each writes a NEW org contact for that person (or merges into an existing one). It has a **different \`id\`** from the paid candidate, so re-read the contacts list afterwards and pin the \`source: "org"\` row. If nothing was found, no org contact exists and there is nothing to pin.
5708
5748
  - Or add them directly with \`leadbay_add_contact\`, which returns the new org contact's \`id\` \u2014 that id is pinnable immediately.
5709
5749
 
5710
- **Pinning does not steer enrichment.** It only marks who the priority is on a company the user already has. Enrichment picks people by JOB TITLE, so "enrich the Directeur G\xE9n\xE9ral rather than the Pr\xE9sident" is \`leadbay_enrich_titles\` with the wanted title \u2014 not a pin. Pinning first and enriching after changes nothing about who gets enriched.
5750
+ **Pinning does not steer enrichment.** It only marks who the priority is on a company the user already has. "Enrich the Directeur G\xE9n\xE9ral rather than the Pr\xE9sident" is \`leadbay_enrich_contacts\` with that person's id (or \`leadbay_enrich_titles\` with the wanted title) \u2014 not a pin. Pinning first and enriching after changes nothing about who gets enriched.
5711
5751
 
5712
5752
 
5713
5753
  A \`source: "org"\` contact that was never pinned is a no-op here, not an error \u2014 the backend answers 204 either way. Check \`pinned\` on the contact before calling if you need to tell the user whether anything actually changed.
@@ -5834,6 +5874,345 @@ WHEN NOT TO USE: from agent flow \u2014 use leadbay_adjust_audience, which handl
5834
5874
 
5835
5875
  This tool MUTATES state. The caller (agent or human-in-the-loop) is responsible for confirming intent before invocation; the MCP server does not soft-prompt for confirmation. See \`annotations.destructiveHint\`.
5836
5876
  `;
5877
+ NO_COMMERCE_TOOL_DESCRIPTIONS = {
5878
+ leadbay_account_status: `## WHEN TO USE
5879
+
5880
+ Trigger phrases: "what's my account status", "how much quota do I have", "what lens am I on", "I topped up / I bought credits / I added credits".
5881
+
5882
+ Do NOT use for: "show me leads" \u2192 \`leadbay_pull_leads\`.
5883
+
5884
+ Prefer when: meta question about account, quota, active lens, or top-up recovery
5885
+
5886
+ Examples that SHOULD invoke this tool:
5887
+ - "What's my account status?"
5888
+ - "How much quota do I have left this week?"
5889
+
5890
+ Examples that should NOT invoke this tool (sound similar, route elsewhere):
5891
+ - "Show me today's leads."
5892
+ - "What should I follow up on?"
5893
+
5894
+ ## RENDER (quick)
5895
+
5896
+ Report user + org, AND quota whenever readable \u2014 include quota even on a plain
5897
+ "what account?" ask. NEVER mention the lens unless asked (use
5898
+ \`last_requested_lens_name\`, never the id). SILENT on quota ONLY when
5899
+ \`quota_error\` set, \`unlimited_credits\` true, or quota null. Else render
5900
+ Daily/Weekly/Monthly from \`quota.user\` (fall back to \`quota.org\` if \`user\`
5901
+ absent) as \`$used / $cap (N% used) \xB7 resets\` (or a resource-count table when
5902
+ \`spend[]\` empty). Never say raw "credits".
5903
+
5904
+ ---
5905
+
5906
+ Show the user's account state \u2014 admin rights, language, last-active lens, quota usage across daily/weekly/monthly windows, and whether the org's intelligence is mid-regeneration. **Show quota the way the web app does \u2014 a percentage-used + dollar-spend gauge per window, never raw "credits".** Each window in \`quota.<group>.spend[]\` carries \`current_units\` / \`max_units\` in dollar_cents (% used = the ratio, $ = \`/100\`); the \`quota.<group>.resources[]\` list gives the per-resource usage breakdown (\`count\`, plus \`max_units\` when a per-resource cap exists). **Pre-check the \`LENS_EXTRA_REFILL\` resource here before calling \`leadbay_extend_lens\`** \u2014 look in **\`quota.org.resources[]\`** first (admins), and fall back to **\`quota.user.resources[]\`** when \`quota.org\` is absent (non-admin callers only get the \`user\` group), matching the resource type **case-insensitively** (it may arrive as \`LENS_EXTRA_REFILL\` or \`lens_extra_refill\`). Its full requested batch must fit into the remaining daily quota or the call is rejected outright. Quota windows also hint at the user's consumption pace: heavy recent activity (ai_rescore / web_fetch near their window limits) is a signal that Leadbay will deliver a larger fresh batch next time the user logs back in, since batch size is paced by real consumption.
5907
+
5908
+ **After a user tops up, do NOT keep refusing \u2014 RETRY.** If the user signals they topped up / bought credits / added credits, the previous QUOTA_EXCEEDED is invalidated the moment the Stripe webhook lands. RE-CALL \`leadbay_account_status\` to pick up the new state AND retry the originally failed call. The retry itself does not require a successful account_status check first \u2014 a topped-up user has cleared the throttle whether or not your cached snapshot reflects it yet. **A stale quota snapshot is never a reason to gate-keep a topped-up user.**
5909
+
5910
+ **\`notifications\` block.** The response now includes a top-level \`notifications\` array listing background work the user (or agent) initiated that has since completed (\`bulk_enrich\`, \`bulk_qualify\`, \`import\`). These are signals to revise prior agent outputs the just-finished work might have made stale \u2014 they're NOT a pending-task list for the user. After revising (or confirming nothing is affected), call \`leadbay_acknowledge_notification(notification_id)\`. Full handling protocol below.
5911
+
5912
+ ## GATE \u2014 INSPECT \`_meta.notifications\` ON EVERY RESPONSE
5913
+
5914
+ Some Leadbay tool responses include a \`_meta.notifications\` array listing **background work the user (or you) initiated that has since completed**. The three relevant kinds:
5915
+
5916
+ | Kind | What just finished |
5917
+ |---|---|
5918
+ | \`bulk_enrich\` | A bulk contact-enrichment job (emails / phone numbers attached to leads' contacts). |
5919
+ | \`bulk_qualify\` | A bulk lead-qualification job (web-fetch + AI rescore, producing \`ai_agent_lead_score\` and qualification answers). |
5920
+ | \`import\` | A CSV / CRM file import (rows resolved to leads in the user's pipeline). |
5921
+
5922
+ **Your job when you see an entry: revise prior outputs the just-finished work might have made stale.** This is NOT a pending-task list. It's a "your earlier answer used data that has now changed" signal.
5923
+
5924
+ | Kind | Outputs you've produced that may now be stale \u2014 refresh them |
5925
+ |---|---|
5926
+ | \`bulk_enrich\` | Outreach drafts mentioning these leads' contacts; contact lists; recommended-lead lists citing \`contact_count\`; NEXT STEPS that asked the user to wait for emails / phones. Re-fetch via \`leadbay_get_contacts(leadId)\` for the affected leads. |
5927
+ | \`bulk_qualify\` | Lead rankings / shortlists you produced without \`ai_agent_lead_score\`; "today's leads"; followup maps; prepare-outreach picks. Re-pull via \`leadbay_pull_leads\` / \`leadbay_research_lead_by_id\`. |
5928
+ | \`import\` | "Available leads" claims; pulls from the affected lens that ran before the import landed; followup planning that needed the imported set. Re-pull via \`leadbay_pull_leads\` / \`leadbay_pull_followups\`. |
5929
+
5930
+ **After revising (or after confirming no prior output is affected):** call \`leadbay_acknowledge_notification(notification_id)\` so the entry stops resurfacing on every tool response. Ack-and-move-on is correct even when nothing was stale \u2014 that's how the inbox stays focused on what's actually pending.
5931
+
5932
+ **Do NOT** interpret these entries as "things waiting for the user." The user expects you to handle them silently. They are signals to YOU \u2014 agent \u2014 that prior outputs need a refresh.
5933
+
5934
+ **Poll a job you launched THIS turn; don't poll one from a PREVIOUS turn.** The rule splits by *when* the work was kicked off:
5935
+
5936
+ - **Previous turn / before an MCP restart, and the user has NOT asked about it** \u2014 don't poll for it in the background. Simply continue the conversation; the next time you call any tool, the completed-work entry appears in \`_meta.notifications\` (also on \`leadbay_account_status.notifications\`). This is the ambient push path \u2014 leave it to do its job. **But if the user explicitly asks for status or to "wait for it to finish"** (e.g. a multi-turn flow where a job was launched in a prior turn and this turn says "wait for enrichment to finish, then \u2026"), DO poll its status tool now until done, exactly as for a this-turn job below \u2014 the ambient push only surfaces *completed* work, so it can't answer a live "is it done / wait for it" request while the job is still running.
5937
+ - **This turn (you just launched it)** \u2014 the DEFAULT is: do NOT end your turn on the "launched" ack; stay active and poll the job's status tool in a loop until it reports done, then report the finished result yourself, rather than spinning forever or deferring the result to a later turn. (Two exceptions, detailed below: the user explicitly asked NOT to wait / to run it in the background; or it's a large qualification/import that's async by design \u2014 in those cases hand back the handle instead of looping.) Each status tool has its OWN terminal signal \u2014 poll until:
5938
+ - \`leadbay_bulk_enrich_status\` \u2192 \`all_done:true\` \u2014 OR \`overall_progress.done\` holds steady across several SPACED polls (~15\u201330s apart) over at least ~90s\u20132 min of elapsed time (some contacts are unresolvable, so \`all_done\` can stay false forever). Don't call a plateau from the first few back-to-back reads \u2014 early on \`done\` sits flat while the backend spins up. Once the plateau is real, report what resolved and name what didn't.
5939
+ - \`leadbay_qualify_status\` \u2192 \`still_running\` is empty: every launched lead has finished or failed. (\`in_progress\` also reads \`false\` on the fast path, but it can be \`null\` on the legacy/fallback read \u2014 so treat an empty \`still_running\` as terminal on its own; only require \`in_progress:false\` when that field is actually present.) LIKE imports, large qualification runs are async by design: \`leadbay_bulk_qualify_leads\` defaults to \`wait_for_completion:false\` for \`count > 5\` or chained workflows because blocking can time out, and \`leadbay_qualify_status\` may take minutes/hours. So don't force a long polling loop on a big run \u2014 return the handle/progress and let completion arrive via \`_meta.notifications\` \u2014 UNLESS the user explicitly asked to wait, or it's a small run that finishes quickly. A small \`wait_for_completion:true\` run you can poll to \`still_running\` empty inline.
5940
+ - \`leadbay_import_status\` \u2192 \`status:"complete"\` (or \`"failed"\`). BUT imports are the exception to the stay-active loop: a large \`leadbay_import_leads({wait_for_completion:false})\` is meant to return a handle and resolve over minutes, and the tool does ONE refresh pass per call. Don't block the conversation looping on it \u2014 surface the returned progress/handle and let the completion arrive via \`_meta.notifications\` \u2014 UNLESS the user explicitly asked you to wait for the import, or it's a small import that finishes quickly.
5941
+
5942
+ Enrichment polls to completion in-turn BY DEFAULT \u2014 the exception is when the user explicitly said to start it in the background / not wait ("kick it off, I'll check later"), in which case hand back the bulk_id and let completion arrive via \`_meta.notifications\` (only when a notification id exists; if none was returned, tell the user to ask again / that you'll poll later, since nothing will auto-surface). For qualification and imports, poll inline only for small/quick runs or when the user explicitly asked you to wait; otherwise return the handle and let \`_meta.notifications\` deliver it. Either way, the user should never have to ask "is it done yet?" for work you kicked off in the same turn \u2014 you either report it or hand back a clear in-progress handle.
5943
+
5944
+ Also surfaced as a top-level \`notifications\` array on \`leadbay_account_status\` \u2014 same shape, same handling.
5945
+
5946
+
5947
+ ---
5948
+
5949
+ ## RENDERING \u2014 quota windows (percentage + $, like the frontend)
5950
+
5951
+ Mirror the Leadbay web quota widget: three windows side by side \u2014 **Daily**,
5952
+ **Weekly**, **Monthly** \u2014 each headlined by a **% used** gauge and a **$ spend /
5953
+ $ cap** figure, with a per-resource usage breakdown underneath. **Never speak in
5954
+ raw "credits"** for quota \u2014 the unit is a percentage and a dollar spend.
5955
+
5956
+ **Include the quota whenever it is readable** \u2014 as part of the default account
5957
+ answer, even when the user only asked "what account am I connected to?". The
5958
+ sole reason to omit it is the silence gate below (unreadable quota, or an
5959
+ unlimited account); it is NOT gated on the user explicitly asking for quota.
5960
+
5961
+ **Silence gate (check FIRST).** Render NOTHING about quota when any of these
5962
+ holds \u2014 do not mention quota at all, do not say "unreadable", never tell the user
5963
+ to reconnect:
5964
+ - \`quota\` is null, OR \`quota_error\` is set (a 401/403 backend quirk for plan-less
5965
+ orgs \u2014 the same token read user/org fine), OR
5966
+ - \`organization.unlimited_credits\` is true (internal/unlimited account \u2014 stay
5967
+ silent on quota; never announce "unlimited").
5968
+
5969
+ **Pick the group (for DISPLAY only).** Prefer \`quota.user\` (present for every
5970
+ caller). Use \`quota.org\` only when \`quota.user\` is absent (admins receive both \u2014
5971
+ still show the caller's own \`user\` view). Call the chosen group \`<group>\` below.
5972
+
5973
+ **Exception \u2014 lens-refill pre-checks read the refill row, ORG-first.** This
5974
+ user-preference is for the display gauge ONLY. When you pre-check the
5975
+ \`LENS_EXTRA_REFILL\` resource before \`leadbay_extend_lens\`, look for the row in
5976
+ **\`quota.org.resources[]\` first** (admins get the org group, and the refill
5977
+ quota is org-scoped there); when \`quota.org\` is absent \u2014 non-admin callers only
5978
+ receive the \`user\` group \u2014 fall back to **\`quota.user.resources[]\`**. Match the
5979
+ resource type case-insensitively (\`LENS_EXTRA_REFILL\` / \`lens_extra_refill\`).
5980
+ Skipping the \`user\` fallback for non-admins would make the row invisible even
5981
+ when the quota data exists, so the agent burns the write and hits the very 429
5982
+ this pre-check exists to avoid.
5983
+
5984
+ **Per window (fixed order: daily \u2192 weekly \u2192 monthly).** Match entries by
5985
+ \`window_type\` (\`"daily"\` / \`"weekly"\` / \`"monthly"\`).
5986
+
5987
+ **Headline \u2014 when \`<group>.spend[]\` has an entry for the window (the % gauge):**
5988
+ - \`pct = round(current_units / max_units \xD7 100)\` (both are dollar_cents).
5989
+ - \`$used = (current_units / 100).toFixed(2)\`, \`$cap = (max_units / 100).toFixed(2)\`.
5990
+ - 10-segment bar in a SINGLE inline-code span (backticks give it contrast):
5991
+ \`filled = round(pct / 10)\` clamped 0..10; \`bar = "\u25B0"\xD7filled + "\u25B1"\xD7(10 \u2212 filled)\`.
5992
+ Use ONLY \`\u25B0\`/\`\u25B1\` \u2014 do NOT use the \`\u2756\` glyph (that identity belongs to lead
5993
+ discovery, not quota).
5994
+ - Line: **\`<Window>\`** \`\` \`\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\` \`\` \`<pct>% used \xB7 $<used> / $<cap> \xB7 resets <resets_at, relative>\`.
5995
+ e.g. \`**Daily** \` + \`\` \`\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1\` \`\` + \` 7% used \xB7 $0.84 / $12.00 \xB7 resets in ~7 h\`.
5996
+
5997
+ **Fallback \u2014 when \`<group>.spend[]\` is empty** (internal / free orgs have no
5998
+ OVERALL_SPEND quota): no gauge. Render the per-window resource breakdown as a
5999
+ compact table instead \u2014 one row per resource in \`<group>.resources[]\` for that
6000
+ window: the friendly label + \`count\` (append \`/ <max_units>\` only when
6001
+ \`max_units\` is a number). This is the pre-existing behavior, preserved.
6002
+
6003
+ **Resource labels (look up case-insensitively \u2014 lower-case \`resource_type\`
6004
+ first).** Localize to \`user.language\` (FR canonical shown; English in parens):
6005
+ - \`llm_completion\` \u2192 **G\xE9n\xE9rations par IA** (AI generations)
6006
+ - \`ai_rescore\` \u2192 **Leads qualifi\xE9s** (qualified leads)
6007
+ - \`web_fetch\` \u2192 **Informations web** (web insights)
6008
+ - \`contact_enrichment_phone\` \u2192 **T\xE9l\xE9phones enrichis** (phones enriched)
6009
+ - \`contact_enrichment_email\` \u2192 **E-mails enrichis** (emails enriched)
6010
+
6011
+ Skip any resource type not in this map silently \u2014 never dump the raw
6012
+ \`resource_type\` string at the user.
6013
+
6014
+ **\`resets_at\`.** Show as a relative countdown ("resets in ~7 h", "resets in 3
6015
+ days"), computed against now \u2014 mirroring the widget's "r\xE9initialis\xE9 dans X". The
6016
+ raw value is an ISO-8601 timestamp.
6017
+
6018
+ **Top-up (optional, subordinate).** When \`quota.topup\` is present, you MAY add one
6019
+ small line below the windows: \`Top-up: $<remaining_cents/100> of $<total_credit_cents/100> left\`.
6020
+ Keep it secondary \u2014 the three window gauges are the headline. Omit when null.
6021
+
6022
+ **Legend** (once, below): \`\` \`\u25B0\` used \xB7 \`\u25B1\` remaining \`\`.
6023
+
6024
+
6025
+ ---
6026
+
6027
+ WHEN TO USE: at the start of a session to know what the agent can/can't do, after a 429 to explain to the user which resource window was exhausted and when it resets, and after the user signals a top-up so the agent can resume the interrupted workflow.
6028
+
6029
+ WHEN NOT TO USE: as a pre-flight gate before bulk ops \u2014 operations themselves return 429; this tool is for context, not gating. And: a recent quota snapshot showing "exhausted" is NOT a reason to refuse a write call when the user has just topped up \u2014 re-call this tool first, then proceed.
6030
+ `,
6031
+ leadbay_scan_portfolio_signals: `## WHEN TO USE
6032
+
6033
+ Trigger phrases: "which of my leads <did X>", "find leads that <raised / acquired / hired / moved / changed CEO>", "scan my portfolio for <signal>", "identify all the ones that <event> since <date>", "who in Monitor has a <funding / M&A / hiring> signal", "build a campaign from leads with <signal>".
6034
+
6035
+ Do NOT use for: "research one named company" \u2192 \`leadbay_research_lead_by_name_fuzzy\`; "everything about lead <UUID>" \u2192 \`leadbay_research_lead_by_id\`; "qualify my next N leads (they aren't researched yet)" \u2192 \`leadbay_bulk_qualify_leads\`; "just list my follow-ups" \u2192 \`leadbay_pull_followups\`.
6036
+
6037
+ Prefer when: user wants to FILTER a known portfolio by a web-research signal in bulk \u2014 pass \`query\`, optionally \`since\`, \`city\`/\`set_filter\`, or \`leadIds\`; NEVER a country name in \`city\` \u2014 a whole-country ask means NO geo filter
6038
+
6039
+ Examples that SHOULD invoke this tool:
6040
+ - "Which of my leads acquired a company since 2025?"
6041
+ - "Scan my Lyon portfolio for funding signals."
6042
+ - "Find everyone in Monitor who changed CEO and build a campaign."
6043
+
6044
+ Examples that should NOT invoke this tool (sound similar, route elsewhere):
6045
+ - "Look up Acme Corp for me."
6046
+ - "Show me my follow-ups."
6047
+ - "Qualify my next 10 leads."
6048
+
6049
+ ## RENDER (quick)
6050
+
6051
+ Cohort grouped by lead: one block per matched lead (name \xB7 location +
6052
+ its matched signal entries, hot first, source-linked). Open with
6053
+ "N match <query> (M scanned)"; ALWAYS close with an honesty footer \u2014
6054
+ "scanned N \xB7 matched M \xB7 K not yet researched". Never present
6055
+ not_researched leads as "no signal". Full layout below.
6056
+
6057
+ ---
6058
+
6059
+ Scan a known portfolio for a specific web-research signal in one call. This is
6060
+ the bulk, read-only answer to "which of my leads have signal X" \u2014 the question
6061
+ that otherwise forces a per-lead \`leadbay_research_lead_by_id\` loop (one full
6062
+ profile call per lead, slow and quota-heavy).
6063
+
6064
+ **Reads CACHED signals only \u2014 does not trigger new research.** For each lead in
6065
+ scope it reads \`GET /leads/{id}/web_fetch\` (the already-computed web-research
6066
+ signals) and filters the entries against \`query\`. It issues NO web_fetch POST,
6067
+ so it does not consume AI qualification credits and does not re-crawl. Leads
6068
+ that have no cached content (never qualified, or still in progress) are
6069
+ reported in \`not_researched\` \u2014 they are **NOT** silently treated as "no
6070
+ match". Qualify them with \`leadbay_bulk_qualify_leads\`, then re-scan.
6071
+
6072
+ **Scope.** Pass \`leadIds\` for an explicit cohort, or omit it to scan the
6073
+ Monitor portfolio. Narrow the Monitor scope with \`city\` / \`set_filter\` exactly
6074
+ as \`leadbay_pull_followups\` does (store-then-apply server-side filter).
6075
+
6076
+ **One workspace = one country \u2014 a country name is NEVER a location filter.** The admin-area index holds no country nodes, so \`"France"\` matches the *commune of Francs* and \`"United States"\` matches *Statesboro*: the call is silently fenced to one village and every conclusion from it is wrong. City AND country named? Keep the city, drop the country.
6077
+
6078
+ **On \`code: "COUNTRY_LEVEL_LOCATION"\` read \`country_locations[].axis\` and \`[].kind\` \u2014 the recovery differs per case and they are NOT interchangeable, and do NOT retry with another spelling or a nearby city.**
6079
+
6080
+ \`axis: "include"\`:
6081
+
6082
+ - \`home_country\`, or "nationwide" / "everywhere" \u2192 drop that ONE value. Omit the geo argument (\`city\` / \`locations\` / \`location_ids\`) only if nothing else was on it \u2014 then the result covers the whole workspace. If other values remain, keep them and describe the result as those places.
6083
+ - \`foreign_country\` ("leads in France" on a US workspace) \u2192 **unsupported, not unfiltered.** Do NOT re-run without the argument: whole-workspace results are US leads and answer nothing about France. Say the workspace holds only its own country's companies.
6084
+ - \`supranational\` ("EU", "EMEA") \u2192 name what the workspace covers, then offer the whole-workspace view as an explicit choice rather than assuming it.
6085
+ - \`country_indeterminate\` (custom/staging backend) \u2192 its country is unknown, so claim nothing about what it holds.
6086
+
6087
+ \`axis: "exclude"\` reverses all of that \u2014 **never "omit the argument"**, which returns the very companies the user asked to remove. Excluding this workspace's own country would empty it; excluding any other country is a harmless no-op. Either way drop the value and ask what to carve out instead.
6088
+
6089
+ On a lens-WRITING tool (\`new_lens\`, \`adjust_audience\`, \`update_lens_filter\`) write NOTHING, with no re-call in any form: when the country was the only scope; for ANY \`foreign_country\` or \`supranational\` INCLUDE however much else came with it \u2014 the sectors and sizes were QUALIFYING that territory, not a second request, so writing them alone saves a real audience for a territory nobody asked about; and for ANY non-\`foreign_country\` \`exclude\` hit, likewise \u2014 dropping it and writing the rest inverts the ask.
6090
+
6091
+ **Never infer WHICH country this workspace serves from the user's wording** \u2014 "the whole US" does not make it one. Read \`_meta.region\` on any tool result \u2014 it outranks any recalled memory; on \`custom\`, claim nothing.
6092
+
6093
+ Place names never go in \`keywords\`, \`sectors\` or \`refine_prompt\` \u2014 text matches, not geo filters.
6094
+ The
6095
+ scan is bounded by \`max_leads\` (default 200, hard cap 300); when the portfolio
6096
+ is larger, \`truncated_at\` is set and coverage is partial \u2014 say so.
6097
+
6098
+ **Query.** \`query\` is matched case- and accent-insensitively against each
6099
+ signal entry's description, source, and section label. Comma- or
6100
+ space-separated terms are OR'd ("M&A, acquisition, rachet\xE9" matches any). Use
6101
+ \`since\` (ISO date) to keep only entries dated on/after it \u2014 entries with no
6102
+ date are kept (a missing date is not evidence the event is old).
6103
+
6104
+ **Result is campaign-ready.** \`matched[]\` carries \`lead_id\`, \`name\`,
6105
+ \`location\`, and the matching \`matched_signals[]\` (section + hot + source +
6106
+ date + description). Feed the matched \`lead_id\`s straight into
6107
+ \`leadbay_add_leads_to_campaign\` / \`leadbay_create_campaign\`.
6108
+
6109
+ **SIGNAL HONESTY \u2014 never infer signals from freshness.** \`stale_at\`,
6110
+ \`web_fetch_in_progress\`, \`fetch_at\` are freshness markers, not signal
6111
+ indicators \u2014 signal presence is read ONLY from the actual \`signals[]\` /
6112
+ \`web_fetch.content\` entries. For "which of my leads have signal X" across a
6113
+ portfolio, call **\`leadbay_scan_portfolio_signals\`** (bulk-reads cached
6114
+ signals); don't loop \`leadbay_research_lead_by_id\` per lead or guess from
6115
+ freshness. A lead with no cached content is \`not_researched\`, not "no match";
6116
+ never report a signal verdict for a lead you never read.
6117
+
6118
+
6119
+ WHEN TO USE: when the user wants to filter a known
6120
+ portfolio by a web-research signal across many leads at once \u2014 discovering a
6121
+ cohort to act on, not inspecting a single lead.
6122
+
6123
+ WHEN NOT TO USE: for a single named company
6124
+ (leadbay_research_lead_by_name_fuzzy) or one lead by UUID
6125
+ (leadbay_research_lead_by_id); to qualify leads that have no signals yet
6126
+ (leadbay_bulk_qualify_leads); or to just list follow-ups with no signal filter
6127
+ (leadbay_pull_followups).
6128
+
6129
+ ---
6130
+
6131
+ ## RENDERING \u2014 bulk signal-scan results
6132
+
6133
+ The output is a cohort, grouped by lead. Lead with the matches, end with an
6134
+ honesty footer \u2014 never hide what wasn't scanned.
6135
+
6136
+ ### Matched leads
6137
+
6138
+ Open with a one-line headline: \`**N leads match "<query>"** (M scanned).\`
6139
+
6140
+ Then one block per \`matched[]\` lead, ordered with \`hot\` matches first. Emit
6141
+ each as a host-parseable per-lead block so the chat host's place-card
6142
+ auto-detector can render it (per the repo "feed the address auto-detector"
6143
+ convention):
6144
+
6145
+ \`\`\`
6146
+ ### <name> \xB7 <location>
6147
+
6148
+ <for each matched_signal, one bullet>
6149
+ - **<section_emoji> <section_label>** \u2014 <description> <\u{1F525} if hot> ([source](<source>), <date>)
6150
+ \`\`\`
6151
+
6152
+ - **Bold** the description of \`hot: true\` entries; leave cold entries plain.
6153
+ - Render \`source\` as a markdown link \`([source](url), date)\`; omit the date
6154
+ when null, omit the link when \`source\` is empty.
6155
+ - Cap to the 3 strongest signals per lead (hot first, then by date desc); if a
6156
+ lead has more, end its block with \`_+K more signals_\`.
6157
+ - When \`name\` is null (the scan was scoped by \`leadIds\` and the read failed to
6158
+ carry firmographics), fall back to \`### Lead <lead_id>\` \u2014 but prefer to enrich
6159
+ the name via the matched lead's own data when available.
6160
+
6161
+ ### Honesty footer (ALWAYS print)
6162
+
6163
+ A single italic line summarising coverage:
6164
+
6165
+ \`_Scanned N \xB7 matched M \xB7 K had no cached signals (not yet researched)._\`
6166
+
6167
+ - When \`not_researched\` is non-empty, this is load-bearing: state plainly that
6168
+ those K leads were NOT searched and were NOT counted as "no match". Offer to
6169
+ qualify them and re-scan (see NEXT STEPS).
6170
+ - When \`truncated_at\` is set, add: \`_Coverage partial \u2014 only the first <truncated_at>
6171
+ leads were scanned; narrow the scope or raise max_leads._\`
6172
+
6173
+ **Hide:** raw \`lead_id\` in prose (use it only for the campaign call), \`_meta\`,
6174
+ empty arrays, any freshness field. NEVER present \`not_researched\` leads as
6175
+ "no signal found".
6176
+
6177
+
6178
+ ---
6179
+
6180
+ ## NEXT STEPS \u2014 after the signal scan
6181
+
6182
+ **ALWAYS render NEXT STEPS via your host's next-step widget.** Use whichever is in your tool set \u2014 the NAME and SCHEMA differ: **\`ask_user_input_v0\`** (Claude chat / ChatGPT) takes plain-string options with \`type:"single_select"\`; **\`AskUserQuestion\`** (Claude cowork / Claude Code) takes object options \`{label, description}\` plus a required short \`header\` (\u226412 chars) and \`multiSelect\`, NO \`type\` field, and never add an "Other" option (the host adds it). Match the schema to the tool you actually have \u2014 the wrong schema fails silently and you fall back to prose. Prose bullets are the fallback ONLY when NEITHER widget exists. Any turn that would end with a choice must be the widget \u2014 the widget IS the question.
6183
+
6184
+ **If the tool result carries a \`next_steps\` object, that is the source of truth \u2014 use it directly.** Each option has a short \`.label\` (\u22645 words) and a full \`.description\`. Map \`next_steps.options[]\` into your host widget VERBATIM and in order: for \`AskUserQuestion\` (cowork / Claude Code) pass each as \`{label, description}\`; for \`ask_user_input_v0\` (Claude chat / ChatGPT, string options only) pass each option's \`.description\` as the string (it's the full sentence). Do NOT reword, reorder, drop, or prose-ify them \u2014 they're built deterministically by the server so the offer (incl. the artifact option at position 0) fires every time. Fall back to the table below only when there is NO \`next_steps\` field.
6185
+
6186
+ **One exception \u2014 skip the widget** when the user's original message contained a complete sequential instruction chain ("show me X and then do Y") AND all stated steps have been completed. In that case, end with STOP directly \u2014 the user stated their full plan and does not need a "what next?" prompt.
6187
+ - Skip example: "Show me today's leads and then research the top one for me." \u2192 after research completes, emit STOP without the widget.
6188
+ - Do NOT skip for: plain requests ("show me today's leads", "run my check-in"), recurring-language requests ("I do this every day"), or requests where only one action was stated.
6189
+
6190
+ Pick 2\u20134 rows from the (Observation, Suggest, Calls) table below most relevant to the response, then call your host's widget with ITS schema (per the schema rules above \u2014 wrong schema fails silently):
6191
+ - \`ask_user_input_v0\`: \`{questions:[{question,type:"single_select",options:["<Suggest 1>","<Suggest 2>"]}]}\`
6192
+ - \`AskUserQuestion\`: \`{questions:[{question,header:"Next step",multiSelect:false,options:[{label:"<\u22645 words>",description:"<Suggest 1>"}]}]}\`
6193
+
6194
+ User picks \u2192 call the matching \`Calls\` tool. Constraints: 2\u20134 mutually-exclusive options, AskUserQuestion labels \u22645 words (full text in \`description\`), max 3 questions. Table stays internal; never recite it.
6195
+
6196
+ ---
6197
+
6198
+
6199
+
6200
+ The scan exists to BUILD A COHORT, not just to list. The default next move is
6201
+ almost always "turn the matched leads into a campaign."
6202
+
6203
+ | Observation | Suggest | Calls |
6204
+ |---------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------------------------|
6205
+ | \`matched\` non-empty (top of menu) | "Build a campaign from the N matched leads" | leadbay_create_campaign / leadbay_add_leads_to_campaign(matched lead_ids) |
6206
+ | \`not_researched\` non-empty | "K leads aren't researched yet \u2014 qualify them, then re-scan" | leadbay_bulk_qualify_leads(not_researched lead_ids) \u2192 re-run leadbay_scan_portfolio_signals |
6207
+ | Zero matches but leads were researched | "Widen the query (synonyms) or relax \`since\`" | leadbay_scan_portfolio_signals(query: "<broader terms>", since: omit-or-earlier) |
6208
+ | \`truncated_at\` set | "Scan only covered N \u2014 narrow scope or raise the cap" | leadbay_scan_portfolio_signals({city / set_filter}) or raise \`max_leads\` |
6209
+ | One standout matched lead | "Open that lead's full brief" | leadbay_research_lead_by_id(leadId) |
6210
+
6211
+ NEVER report leads in \`not_researched\` as if they had no matching signal \u2014 they
6212
+ were never read. Distinguish "no signal X found" (researched, no match) from
6213
+ "not yet researched" (no data to search) every time.
6214
+ `
6215
+ };
5837
6216
  }
5838
6217
  });
5839
6218
 
@@ -6606,7 +6985,7 @@ var init_enrich_contacts = __esm({
6606
6985
  email_requested: email,
6607
6986
  phone_requested: phone,
6608
6987
  credits_remaining: creditsRemaining,
6609
- hint: "Enrichment started (runs async). Re-check leadbay_get_contacts every ~30s and treat the contact as done only when the REQUESTED channel actually landed \u2014 " + [email ? "`email` present" : null, phone ? "`phone_number` present" : null].filter(Boolean).join(" AND ") + " (contact.enrichment.done alone is NOT enough: a contact previously enriched for the other channel already shows done:true, so a phone reveal can be reported before phone_number arrives). Then report the result \u2014 don't end your turn leaving it for the user to reprompt. Bound the wait: if the requested field hasn't landed after ~90s\u20132min of spaced re-checks, it likely can't be resolved \u2014 report that plainly (naming the channel that didn't resolve) rather than polling forever. EXCEPTION: if the user explicitly asked NOT to wait (background/'I'll check later'), don't run this loop \u2014 hand back the leadId + contactId and tell them to ask again / re-check later."
6988
+ hint: "Enrichment started (runs async). Re-read the lead's contacts every ~30s (leadbay_research_lead_by_id; or leadbay_get_contacts where exposed) and treat the contact as done only when the REQUESTED channel actually landed \u2014 " + [email ? "`email` present" : null, phone ? "`phone_number` present" : null].filter(Boolean).join(" AND ") + " \u2014 on the person's row: for a `source:\"paid\"` candidate that is a NEW `source:\"org\"` row with a different id (the candidate row itself never carries a channel and only flips enrichment_done; done with no org row means nothing was found), for a `source:\"org\"` contact it is the same row (contact.enrichment.done alone is NOT enough: a contact previously enriched for the other channel already shows done:true, so a phone reveal can be reported before phone_number arrives). Then report the result \u2014 don't end your turn leaving it for the user to reprompt. Bound the wait: if the requested field hasn't landed after ~90s\u20132min of spaced re-checks, it likely can't be resolved \u2014 report that plainly (naming the channel that didn't resolve) rather than polling forever. EXCEPTION: if the user explicitly asked NOT to wait (background/'I'll check later'), don't run this loop \u2014 hand back the leadId + contactId and tell them to ask again / re-check later."
6610
6989
  };
6611
6990
  }
6612
6991
  };
@@ -11838,7 +12217,7 @@ var init_pin_contact = __esm({
11838
12217
  "../core/dist/tools/pin-contact.js"() {
11839
12218
  "use strict";
11840
12219
  init_tool_descriptions_generated();
11841
- NOT_PINNABLE_HINT = 'This contact id is not in your organization\'s contact directory, so it cannot be pinned or unpinned. Almost always it is a `source: "paid"` enrichment candidate from leadbay_research_lead_by_id\'s `candidates` list; only `source: "org"` contacts are pinnable. The id is not wrong and the tool is not broken, so do NOT retry it. To act on this person, enrich them by job title with leadbay_enrich_titles, or add them with leadbay_add_contact \u2014 either produces a NEW org contact with a different id, which is pinnable. Note that pinning does not decide who gets enriched; enrichment selects people by job title.';
12220
+ NOT_PINNABLE_HINT = 'This contact id is not in your organization\'s contact directory, so it cannot be pinned or unpinned. Almost always it is a `source: "paid"` enrichment candidate from leadbay_research_lead_by_id\'s `candidates` list; only `source: "org"` contacts are pinnable. The id is not wrong and the tool is not broken, so do NOT retry it. To act on this person, enrich them directly with leadbay_enrich_contacts (the lead id + this contact id), enrich by job title with leadbay_enrich_titles, or add them with leadbay_add_contact \u2014 each produces a NEW org contact with a different id, which is pinnable. Note that pinning does not decide who gets enriched: leadbay_enrich_titles selects people by job title, leadbay_enrich_contacts by the contact id you pass.';
11842
12221
  pinContact = {
11843
12222
  name: "leadbay_pin_contact",
11844
12223
  description: leadbay_pin_contact,
@@ -21666,6 +22045,7 @@ __export(dist_exports, {
21666
22045
  InMemoryBulkStore: () => InMemoryBulkStore,
21667
22046
  LeadbayClient: () => LeadbayClient,
21668
22047
  LocalBulkStore: () => LocalBulkStore,
22048
+ NO_COMMERCE_TOOL_DESCRIPTIONS: () => NO_COMMERCE_TOOL_DESCRIPTIONS,
21669
22049
  NotificationsInbox: () => NotificationsInbox,
21670
22050
  NotificationsWsClient: () => NotificationsWsClient,
21671
22051
  REGIONS: () => REGIONS,
@@ -21891,6 +22271,7 @@ var init_dist = __esm({
21891
22271
  init_artifact_kit();
21892
22272
  init_bulk_store();
21893
22273
  init_getting_started();
22274
+ init_tool_descriptions_generated();
21894
22275
  granularReadTools = [
21895
22276
  listLenses,
21896
22277
  discoverLeads,
@@ -21916,7 +22297,6 @@ var init_dist = __esm({
21916
22297
  ];
21917
22298
  granularWriteTools = [
21918
22299
  qualifyLead,
21919
- enrichContacts,
21920
22300
  addNote,
21921
22301
  selectLeads,
21922
22302
  deselectLeads,
@@ -22068,6 +22448,12 @@ var init_dist = __esm({
22068
22448
  pinContact,
22069
22449
  unpinContact,
22070
22450
  updateContact,
22451
+ // enrichContacts is granular-shaped (one POST per contact) but registered
22452
+ // HERE, not in granularWriteTools: it is the only tool that enriches ONE
22453
+ // chosen person (leadId + contactId) rather than a job title, and hosted
22454
+ // never sets LEADBAY_MCP_ADVANCED, so behind that gate no hosted agent could
22455
+ // act on a person it had already identified (product#4050).
22456
+ enrichContacts,
22071
22457
  // createCustomField is granular-shaped but file-import prompts depend on it
22072
22458
  // to preserve source-system links without requiring advanced-tool exposure.
22073
22459
  createCustomField,
@@ -25693,9 +26079,8 @@ function buildAcknowledgeUpdateTool(opts) {
25693
26079
  var ENRICHMENT_TERMINAL = `A settled-empty enrichment is TERMINAL \u2014 do not re-attempt it on a later run. On any contact record, \`enrichment.done: true\` together with \`enrichment.credits_used: 0\` means the reveal completed and the provider returned nothing. Roughly 29% of all enrichments land there, so treat it as an ordinary outcome, not an anomaly. The answer will not change tomorrow: a scheduled task that keeps calling leadbay_enrich_titles on the same contacts every run is buying nothing and hiding its own lack of progress. Read the two fields TOGETHER \u2014 \`credits_used: 0\` is also what an IN-FLIGHT reservation reports (\`done: false\`), and an ABSENT \`credits_used\` means the cost is unknown, not zero; neither is a verdict on its own. \`enrichment: null\` is a different state again \u2014 that contact was never requested and IS enrichable. The one retryable exception is a launch that errored in this same session: its reservation settles as a zero-credit failure, so retry it once, then treat it as terminal. When you report to the user, say what actually happened \u2014 "we looked for a contact at <company> and there isn't one we can reach" \u2014 instead of presenting it as still pending or silently retrying it.`;
25694
26080
  var FRICTION = `Problem reports: when the user asks you to report a Leadbay problem ("report this", "tell the team this didn't work"), call leadbay_report_friction with {category, message (the user's own words), tool_called?, severity?}. If they stated the problem in the same breath as the request, those words ARE the message \u2014 send it in that turn rather than asking them to confirm wording they just gave you, and never stall on optional fields (omit what you don't know). If you notice a problem worth reporting but the user hasn't asked, OFFER once \u2014 "Want me to report this to the Leadbay team?" \u2014 and call it only if they agree. Never call it unprompted. Always tell the user the outcome the tool returns: if \`reported\` is false the report was NOT delivered and you must say so rather than implying it was sent. Frustration alone is not a reason to call it: keep solving their ask.`;
25695
26081
  var MENTAL_MODEL = `How Leadbay works (mental model): Leadbay is a sales inbox, not a queryable database. Each day the user logs back in, a fresh batch of leads is delivered. Batch size is paced by how many leads the user has actually acted on recently \u2014 some workflows produce a big stream of smaller prospects, others a narrow stream of bigger ones. Pulling more won't produce more; the user acting on leads (outreach, skips, saves) does.`;
25696
- var QUOTA_TOPUP = `Quota & top-ups: when a tool returns QUOTA_EXCEEDED / 429, the user has TWO options \u2014 wait for the window reset (daily / weekly / monthly resets shown in leadbay_account_status), OR top up AI credits (top-ups clear the throttle IMMEDIATELY \u2014 they are not subject to the same window). Always offer BOTH options; default-recommending 'wait until tomorrow' is wrong when a 30-second top-up unblocks the same call. If the host exposes leadbay_create_topup_link, OFFER it on every quota wall: 'Want me to generate a top-up link?' \u2014 when the user says yes, call leadbay_create_topup_link and surface the returned Stripe URL as a clickable link for the user to open in their browser. (Sibling leadbay_open_billing_portal is for ongoing subscription changes, not one-shot top-ups.) AFTER the user has topped up: do NOT keep refusing operations. A top-up invalidates every prior 429 and every stale 'you're at your quota' snapshot. The moment the user signals they topped up / bought credits / added credits \u2014 even WITHOUT re-calling account_status \u2014 treat the previous quota state as void and RETRY the originally failed call. (Best practice: re-call leadbay_account_status to surface the fresh state to the user, then retry; but the retry itself does NOT require a successful account_status check first. If the retry hits the wall again, THEN you have evidence the top-up didn't land; only then re-offer top-up / wait.) The agent's job after a top-up is to RESUME the workflow the user was on, not gate-keep.
25697
-
25698
- Show the refreshed quota AFTER a paid action has actually COMPLETED: when leadbay_bulk_enrich_status reports the job done \u2014 all_done, OR a plateau you've decided is terminal (overall_progress.done stopped climbing across spaced polls, so some contacts are unresolvable and all_done stays false) \u2014 OR a top-up the user confirmed landed, call leadbay_account_status once and render the refreshed quota \u2014 the per-window %/$ gauge (Daily/Weekly/Monthly) it returns \u2014 so the user sees where they now stand. Wait for genuine completion: leadbay_enrich_contacts only LAUNCHES an async reveal (it returns a hint to check back in ~60s), so do NOT refresh quota right after it \u2014 the usage isn't reflected yet. For that single-contact flow, refresh only once leadbay_get_contacts shows the REQUESTED channel actually landed \u2014 the requested email and/or phone_number present \u2014 NOT enrichment.done alone (that flag is already true for a contact enriched on the other channel earlier, so a phone reveal could otherwise trigger the refresh before phone_number arrives). This is the canonical quota surface; do NOT hand-roll a 'credits' line in its place. Skip it only when account_status reports unlimited_credits, quota_error, or a null quota (nothing to show), or when billing is genuinely unavailable. Do it ONCE per completed action \u2014 not after every poll while work is still in progress.`;
26082
+ var QUOTA_REFRESH = `Show the refreshed quota AFTER a paid action has actually COMPLETED: when leadbay_bulk_enrich_status reports the job done \u2014 all_done, OR a plateau you've decided is terminal (overall_progress.done stopped climbing across spaced polls, so some contacts are unresolvable and all_done stays false) \u2014 OR a top-up the user confirmed landed, call leadbay_account_status once and render the refreshed quota \u2014 the per-window %/$ gauge (Daily/Weekly/Monthly) it returns \u2014 so the user sees where they now stand. Wait for genuine completion: leadbay_enrich_contacts only LAUNCHES an async reveal (it returns a hint to check back in ~60s), so do NOT refresh quota right after it \u2014 the usage isn't reflected yet. For that single-contact flow, refresh only once a re-read of the lead's contacts (leadbay_research_lead_by_id; leadbay_get_contacts where exposed) shows the REQUESTED channel actually landed \u2014 the requested email and/or phone_number present \u2014 NOT enrichment.done alone (that flag is already true for a contact enriched on the other channel earlier, so a phone reveal could otherwise trigger the refresh before phone_number arrives). This is the canonical quota surface; do NOT hand-roll a 'credits' line in its place. Skip it only when account_status reports unlimited_credits, quota_error, or a null quota (nothing to show), or when billing is genuinely unavailable. Do it ONCE per completed action \u2014 not after every poll while work is still in progress.`;
26083
+ var QUOTA_TOPUP = `Quota & top-ups: when a tool returns QUOTA_EXCEEDED / 429, the user has TWO options \u2014 wait for the window reset (daily / weekly / monthly resets shown in leadbay_account_status), OR top up AI credits (top-ups clear the throttle IMMEDIATELY \u2014 they are not subject to the same window). Always offer BOTH options; default-recommending 'wait until tomorrow' is wrong when a 30-second top-up unblocks the same call. If the host exposes leadbay_create_topup_link, OFFER it on every quota wall: 'Want me to generate a top-up link?' \u2014 when the user says yes, call leadbay_create_topup_link and surface the returned Stripe URL as a clickable link for the user to open in their browser. (Sibling leadbay_open_billing_portal is for ongoing subscription changes, not one-shot top-ups.) AFTER the user has topped up: do NOT keep refusing operations. A top-up invalidates every prior 429 and every stale 'you're at your quota' snapshot. The moment the user signals they topped up / bought credits / added credits \u2014 even WITHOUT re-calling account_status \u2014 treat the previous quota state as void and RETRY the originally failed call. (Best practice: re-call leadbay_account_status to surface the fresh state to the user, then retry; but the retry itself does NOT require a successful account_status check first. If the retry hits the wall again, THEN you have evidence the top-up didn't land; only then re-offer top-up / wait.) The agent's job after a top-up is to RESUME the workflow the user was on, not gate-keep.`;
25699
26084
  var TRANSIENT_401 = `Transient 401s (DO NOT narrate as an auth problem): Leadbay bearer tokens do NOT expire on a timer, and the client already auto-retried this call once before surfacing it. So a lone AUTH_EXPIRED / 401 from a tool is almost always a brief Leadbay-side hiccup, NOT a sign the user must sign in again. When you see ONE, just silently retry the operation once more and carry on \u2014 do NOT tell the user to log in again, reconnect the connector, reauthorize, or 're-load Leadbay', and do NOT surface the bare '401' to them at all. Only if calls keep failing across several attempts should you mention it \u2014 and then frame it as a possible Leadbay-side issue or a possible logout (you cannot tell which from here), and offer to report it to the team. Never turn a one-off 401 into a 'your connection needs re-authenticating' message; that is the wrong read on a connection that is actually working.`;
25700
26085
  var TRIGGERED_BY = `Trigger provenance (MANDATORY): every Leadbay composite-tool call MUST carry a non-empty \`_triggered_by\` argument \u2014 the verbatim slice of the user's most recent message that this call is acting upon. Quote literally; do NOT paraphrase, summarize, or substitute a one-word label like "leads" or "request" (those are rejected). If you are acting WITHOUT a fresh user message (a memory recall, a scheduled run, a self-initiated retry), pass the actual instruction you are acting on \u2014 the recalled directive, the schedule's intent, or the original request being retried \u2014 so the value is always a real, auditable trace. Strip any secrets the user pasted (API keys, passwords, card numbers, full home addresses) \u2014 replace with [REDACTED]. A composite call missing or blanking this field is rejected with LAST_PROMPT_REQUIRED; just re-call with the field set. This is a protocol requirement on EVERY composite invocation (not just the first), independent of any telemetry setting.`;
25701
26086
  var VERIFICATION = `After every email, call, message, or meeting with a lead's contact, you MUST call leadbay_report_outreach with verification={source, ref} (gmail_message_id from the Gmail send, calendar_event_id from a booking, or user_confirmed='<the user's literal confirmation>'). Skipping or fabricating verification poisons the human team's pipeline.`;
@@ -25839,7 +26224,10 @@ function buildServerInstructions(exposed) {
25839
26224
  }
25840
26225
  parts.push(TRIGGERED_BY);
25841
26226
  parts.push(MENTAL_MODEL);
25842
- parts.push(QUOTA_TOPUP);
26227
+ if (has("leadbay_create_topup_link")) {
26228
+ parts.push(QUOTA_TOPUP);
26229
+ }
26230
+ parts.push(QUOTA_REFRESH);
25843
26231
  if (has("leadbay_enrich_titles")) {
25844
26232
  parts.push(ENRICHMENT_TERMINAL);
25845
26233
  }
@@ -25859,6 +26247,10 @@ function buildServerInstructions(exposed) {
25859
26247
  parts.push(BUILTIN_WIDGETS_PARAGRAPH);
25860
26248
  return parts.join("\n\n");
25861
26249
  }
26250
+ var COMMERCE_TOOL_NAMES = /* @__PURE__ */ new Set([
26251
+ "leadbay_create_topup_link",
26252
+ "leadbay_open_billing_portal"
26253
+ ]);
25862
26254
  function formatErrorForLLM(err) {
25863
26255
  if (err && typeof err === "object" && err.error === true) {
25864
26256
  const parts = [`${err.message}.`, err.hint];
@@ -25946,16 +26338,19 @@ function buildServer(client, opts = {}) {
25946
26338
  if (opts.extraTools) {
25947
26339
  exposedTools.push(...opts.extraTools);
25948
26340
  }
26341
+ const includeCommerce = opts.includeCommerce !== false;
26342
+ client.commerce = includeCommerce;
25949
26343
  const toolByName = /* @__PURE__ */ new Map();
25950
26344
  for (const t of exposedTools) {
25951
- if (!toolByName.has(t.name) && t.name !== "leadbay_login") {
25952
- toolByName.set(
25953
- t.name,
25954
- withTriggeredByMeta(t, {
25955
- mandatory: COMPOSITE_FILE_TOOL_NAMES.has(t.name)
25956
- })
25957
- );
25958
- }
26345
+ if (toolByName.has(t.name) || t.name === "leadbay_login") continue;
26346
+ if (!includeCommerce && COMMERCE_TOOL_NAMES.has(t.name)) continue;
26347
+ const noCommerce = includeCommerce ? void 0 : NO_COMMERCE_TOOL_DESCRIPTIONS[t.name];
26348
+ toolByName.set(
26349
+ t.name,
26350
+ withTriggeredByMeta(noCommerce ? { ...t, description: noCommerce } : t, {
26351
+ mandatory: COMPOSITE_FILE_TOOL_NAMES.has(t.name)
26352
+ })
26353
+ );
25959
26354
  }
25960
26355
  const exposedNames = new Set(toolByName.keys());
25961
26356
  const server = new Server(
@@ -26542,7 +26937,7 @@ import { spawn } from "child_process";
26542
26937
  import { existsSync as existsSync2, readFileSync as readFileSync2, readdirSync as readdirSync2 } from "fs";
26543
26938
  import { join as join2 } from "path";
26544
26939
  import { homedir as homedir2 } from "os";
26545
- var HOSTED_MCP_URL = "https://mcp.leadbay.app/mcp";
26940
+ var HOSTED_MCP_URL_CHATGPT = "https://mcp.leadbay.app/chatgpt/mcp";
26546
26941
  function formatInstallOsLabel(platform2 = process.platform, arch = process.arch) {
26547
26942
  const name = platform2 === "darwin" ? "macOS" : platform2 === "win32" ? "Windows" : platform2 === "linux" ? "Linux" : platform2;
26548
26943
  return `${name} (${arch})`;
@@ -26671,7 +27066,7 @@ async function detectClients() {
26671
27066
  out.push({ id: "claude-desktop", label: "Claude Desktop", detail: claudeDesktopPath, configPath: claudeDesktopPath, mode, supportDir: claudeSupportDir });
26672
27067
  }
26673
27068
  if (await isChatGptDesktopInstalled(home)) {
26674
- out.push({ id: "chatgpt-desktop", label: "ChatGPT Desktop", detail: HOSTED_MCP_URL });
27069
+ out.push({ id: "chatgpt-desktop", label: "ChatGPT Desktop", detail: HOSTED_MCP_URL_CHATGPT });
26675
27070
  }
26676
27071
  const cursorPath = process.platform === "win32" ? `${home}\\.cursor\\mcp.json` : `${home}/.cursor/mcp.json`;
26677
27072
  if (await isCursorInstalled(home)) {
@@ -27971,7 +28366,7 @@ var OAUTH_BASE_URLS = {
27971
28366
  fr: "https://staging.api.leadbay.app"
27972
28367
  }
27973
28368
  };
27974
- var VERSION = "0.33.3";
28369
+ var VERSION = "0.34.0";
27975
28370
  var HELP = `
27976
28371
  leadbay-mcp ${VERSION} \u2014 Leadbay Model Context Protocol server
27977
28372
 
@@ -28988,7 +29383,7 @@ Installing Leadbay MCP into:
28988
29383
  } else if (c.id === "chatgpt-desktop") {
28989
29384
  res = {
28990
29385
  ok: true,
28991
- message: "manual setup required; add this MCP URL in ChatGPT Settings > Apps: " + HOSTED_MCP_URL
29386
+ message: "manual setup required; add this MCP URL in ChatGPT Settings > Apps: " + HOSTED_MCP_URL_CHATGPT
28992
29387
  };
28993
29388
  } else if (c.id === "claude-desktop" && c.mode?.dxt && c.supportDir) {
28994
29389
  const dxtResult = await removeDxtExtension(c.supportDir);