Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
688c933
feat(profound): add Profound AI visibility and analytics integration
waleedlatif1 Mar 30, 2026
357f44c
fix(profound): fix import ordering and JSON formatting for CI lint
waleedlatif1 Mar 30, 2026
4bb1836
fix(profound): gate metrics mapping on current operation to prevent s…
waleedlatif1 Mar 30, 2026
226987b
fix(profound): guard JSON.parse on filters, fix offset=0 falsy check,…
waleedlatif1 Mar 30, 2026
3fbb67c
lint
waleedlatif1 Mar 30, 2026
217a5ae
fix(docs): fix import ordering and trailing newline for docs lint
waleedlatif1 Mar 30, 2026
af43982
fix(scripts): sort generated imports to match Biome's organizeImports…
waleedlatif1 Mar 30, 2026
a224331
fix(profound): use != null checks for limit param across all tools
waleedlatif1 Mar 30, 2026
18e2218
fix(profound): flatten block output type to 'json' to pass block vali…
waleedlatif1 Mar 30, 2026
50fe6f1
fix(profound): remove invalid 'required' field from block inputs (not…
waleedlatif1 Mar 30, 2026
a2131bf
fix(profound): rename tool files from kebab-case to snake_case for do…
waleedlatif1 Mar 30, 2026
e00be8a
lint
waleedlatif1 Mar 30, 2026
8f629d9
fix(docs): let biome auto-fix import order, revert custom sort in gen…
waleedlatif1 Mar 30, 2026
d8e3875
fix(landing): fix import order in sim icon-mapping via biome
waleedlatif1 Mar 30, 2026
6fc7038
fix(scripts): match Biome's exact import sort order in docs generator
waleedlatif1 Mar 30, 2026
2386503
fix(generate-docs): produce Biome-compatible JSON output
waleedlatif1 Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(profound): guard JSON.parse on filters, fix offset=0 falsy check,…
… remove duplicate prompt_answers in FILTER_OPS
  • Loading branch information
waleedlatif1 committed Mar 30, 2026
commit 226987b7727249be076368a23131f26ad10f6db9
6 changes: 3 additions & 3 deletions apps/sim/blocks/blocks/profound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const DIMENSION_OPS = [
'prompt_volume',
] as const

const FILTER_OPS = [...ALL_REPORT_OPS, 'prompt_answers', 'prompt_volume'] as const
const FILTER_OPS = [...ALL_REPORT_OPS, 'prompt_volume'] as const

export const ProfoundBlock: BlockConfig = {
type: 'profound',
Expand Down Expand Up @@ -372,8 +372,8 @@ export const ProfoundBlock: BlockConfig = {
if (metricsField && params[metricsField]) {
result.metrics = params[metricsField]
}
if (params.limit) result.limit = Number(params.limit)
if (params.offset) result.offset = Number(params.offset)
if (params.limit != null) result.limit = Number(params.limit)
if (params.offset != null) result.offset = Number(params.offset)
return result
Comment thread
waleedlatif1 marked this conversation as resolved.
},
},
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/bot-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export const profoundBotLogsTool: ToolConfig<ProfoundBotLogsParams, ProfoundBotL
body.dimensions = params.dimensions.split(',').map((d) => d.trim())
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/bots-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ export const profoundBotsReportTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/citations-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export const profoundCitationsReportTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/tools/profound/list-optimizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const profoundListOptimizationsTool: ToolConfig<
const url = new URL(
`https://api.tryprofound.com/v1/content/${encodeURIComponent(params.assetId)}/optimization`
)
if (params.limit) url.searchParams.set('limit', String(params.limit))
if (params.offset) url.searchParams.set('offset', String(params.offset))
if (params.limit != null) url.searchParams.set('limit', String(params.limit))
if (params.offset != null) url.searchParams.set('offset', String(params.offset))
return url.toString()
},
method: 'GET',
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/prompt-answers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export const profoundPromptAnswersTool: ToolConfig<
end_date: params.endDate,
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/prompt-volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ export const profoundPromptVolumeTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/query-fanouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export const profoundQueryFanoutsTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/raw-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export const profoundRawLogsTool: ToolConfig<ProfoundRawLogsParams, ProfoundRawL
body.dimensions = params.dimensions.split(',').map((d) => d.trim())
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/referrals-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ export const profoundReferralsReportTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/sentiment-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export const profoundSentimentReportTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
6 changes: 5 additions & 1 deletion apps/sim/tools/profound/visibility-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ export const profoundVisibilityReportTool: ToolConfig<
body.date_interval = params.dateInterval
}
if (params.filters) {
body.filters = JSON.parse(params.filters)
try {
body.filters = JSON.parse(params.filters)
} catch {
throw new Error('Invalid JSON in filters parameter')
}
}
if (params.limit) {
body.pagination = { limit: params.limit }
Expand Down
Loading