Skip to content

feat(profound): add Profound AI visibility and analytics integration#3849

Merged
waleedlatif1 merged 16 commits intostagingfrom
waleedlatif1/add-profound
Mar 30, 2026
Merged

feat(profound): add Profound AI visibility and analytics integration#3849
waleedlatif1 merged 16 commits intostagingfrom
waleedlatif1/add-profound

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add complete Profound integration with 24 tools covering all API endpoints
  • Tools: visibility/sentiment/citations reports, bot/referral traffic (v2), raw/bot logs, prompt answers/volume, query fanouts, citation prompts, content optimization, org management (categories, regions, models, domains, assets, personas, topics, tags)
  • Block config with operation dropdown, conditional fields, per-operation metrics, advanced mode for optional params
  • Icon, registry entries, and docs with manual description

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 30, 2026 11:28pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 30, 2026

PR Summary

Medium Risk
Mostly additive, but introduces a new external API integration surface (24 operations) and updates the integration catalog/mappings; misconfiguration or API contract mismatches could break the new block/tool runtime or landing/docs rendering.

Overview
Adds the new Profound integration end-to-end: a ProfoundBlock with an operation dropdown and conditional inputs (including per-report metrics and advanced filters), plus corresponding tool wiring to call profound_* operations.

Wires Profound into both the docs and landing experiences by adding ProfoundIcon, updating icon mappings and tool metadata, and introducing new documentation at tools/profound.mdx. Also updates the integrations catalog JSON (including many tag formatting-only changes) and registers the block in blocks/registry.ts.

Written by Cursor Bugbot for commit 6fc7038. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR adds a complete Profound AI visibility and analytics integration to Sim, covering 24 tools across all major Profound API endpoints (reports, logs, org management, content optimization, and prompt volumes). The implementation follows established patterns from other multi-operation blocks (e.g., Ahrefs, GitHub) with a single ProfoundBlock config, a dynamic operation dropdown, per-operation conditional subBlocks, and a params function that remaps the operation-specific metrics fields to the canonical metrics key expected by each tool.

Previous review concerns (duplicate prompt_answers in FILTER_OPS, offset=0 falsy checks in the block config and list_optimizations.ts, and unguarded JSON.parse on filters across all ten affected tools) have all been addressed in commit 226987b.

Remaining findings:

  • The block's params function guards the operation-specific metrics lookup with a plain truthiness check (if (metricsField && params[metricsField])), which is inconsistent with the != null pattern already applied to limit and offset in the same function. An explicit empty-string check would prevent a TypeError in the unlikely case that a required metrics field reaches execution as an empty string.
  • ProfoundCitationPromptsResponse.output.data is typed as unknown, providing no structure for consumers or documentation. A Record<string, unknown> with a comment would be an improvement until the Profound citation-prompts response schema is confirmed.

Confidence Score: 5/5

  • Safe to merge; all previously reported P1 issues have been fixed and remaining findings are P2 style/quality suggestions.
  • All critical issues from the prior review round (unguarded JSON.parse, falsy offset=0, duplicate array entry) are confirmed resolved. The two remaining findings are minor: one is a style inconsistency in a guard condition that the required-field validation already protects in practice, and the other is an untyped response payload. Neither blocks correct execution of any of the 24 tools.
  • apps/sim/blocks/blocks/profound.ts (metrics truthy check at line 372) and apps/sim/tools/profound/types.ts (unknown output type for citation prompts at line 419)

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/profound.ts Main block config: defines 24 operations with conditional subBlocks, per-operation metrics mapping, and a params function that remaps operation-specific metric fields. The params function uses a truthy guard for metrics (minor inconsistency with != null pattern used elsewhere); all previously flagged issues (duplicate prompt_answers in FILTER_OPS, offset=0 falsy check) have been resolved.
apps/sim/tools/profound/types.ts Comprehensive type definitions for all 24 tools; well-structured. ProfoundCitationPromptsResponse.output.data is typed as unknown, providing no contract for downstream consumers.
apps/sim/tools/profound/visibility_report.ts POST to /v1/reports/visibility; filters JSON.parse wrapped in try/catch, limit uses != null guard, response shape mapped correctly.
apps/sim/tools/profound/citation_prompts.ts GET to /v1/prompt-volumes/citation-prompts using URLSearchParams; output data typed as json with no properties, mirroring the unknown type issue in types.ts.
apps/sim/tools/profound/raw_logs.ts Hardcodes metrics: ['count'], handles both array and wrapped-object response shapes, filters try/catch present.
apps/sim/tools/profound/category_prompts.ts GET with multi-value query params (topic_id, tag_id, region_id, platform_id) appended via searchParams.append; cursor-based pagination exposed; limit uses != null guard.
apps/sim/tools/profound/list_optimizations.ts GET with offset+limit in query params; both use != null guards (previously-reported issue fixed); response mapped correctly.
apps/sim/tools/registry.ts All 24 profound tools imported and registered correctly; no missing or duplicate entries.
scripts/generate-docs.ts Adds a biomeSortCompare helper to match Biome's organizeImports order for icon mapping generation; clean utility addition with no side-effects.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    UI[ProfoundBlock UI\noperation dropdown] --> OP{operation}

    OP -->|list_categories/regions/\nmodels/domains/assets/personas| LIST[List Tools\nGET /v1/org/...]
    OP -->|category_topics/tags/\nprompts/assets/personas| CAT[Category Tools\nGET /v1/org/categories/:id/...]
    OP -->|visibility_report\nsentiment_report\ncitations_report\nquery_fanouts\nprompt_answers| CREP[Category Report Tools\nPOST /v1/reports/...]
    OP -->|bots_report\nreferrals_report| DREP[Domain Report Tools\nPOST /v2/reports/...]
    OP -->|raw_logs\nbot_logs| LOGS[Log Tools\nPOST /v1/logs/raw...]
    OP -->|list_optimizations\noptimization_analysis| CONT[Content Tools\nGET /v1/content/:assetId/...]
    OP -->|prompt_volume| PVOL[Prompt Volume\nPOST /v1/prompt-volumes/volume]
    OP -->|citation_prompts| CPROM[Citation Prompts\nGET /v1/prompt-volumes/citation-prompts]

    subgraph params_fn [Block params function]
        MF[metricsMap lookup\nvisibilityMetrics → metrics\nbotsMetrics → metrics\netc.] --> MR[result.metrics]
        LIM[limit != null] --> NL[result.limit as Number]
        OFF[offset != null] --> NO[result.offset as Number]
    end

    CREP & DREP & PVOL -->|metrics required| params_fn
    params_fn --> TOOL[Tool executes\nX-API-Key header]
    LIST & CAT & LOGS & CONT & CPROM --> TOOL
Loading

Reviews (4): Last reviewed commit: "fix(generate-docs): produce Biome-compat..." | Re-trigger Greptile

… remove duplicate prompt_answers in FILTER_OPS
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

The generator wrote multi-line arrays for short string arrays (like tags)
and omitted trailing newlines, causing Biome format check failures in CI.
Post-process integrations.json to collapse short arrays onto single lines
and add trailing newlines to both integrations.json and meta.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit e5aef61 into staging Mar 30, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/add-profound branch March 30, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant