Files
sim/apps/sim/blocks/utils.ts
Waleed Latif b253454723 feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue, added descriptions & param validation & updated docs (#825)
* feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue

* fix

* added description for all outputs, fixed param validation for tools

* cleanup

* add dual validation, once during serialization and once during execution

* improvement(docs): add base exec charge info to docs (#826)

* improvement(doc-tags-subblock): use table for doc tags subblock in create_document tool for KB (#827)

* improvement(doc-tags-subblock): use table for doc tags create doc tool in KB block

* enforce max tags

* remove red warning text

* fix(bugs): fixed rb2b csp, fixed overly-verbose logs, fixed x URLs (#828)

Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>

* fixed serialization errors to appear like execution errors, also fixed contrast on cmdk modal

* fixed required for tools, added tag dropdown for kb tags

* fix remaining tools with required fields

* update utils

* update docs

* fix kb tags

* fix types for exa

* lint

* updated contributing guide + pr template

* Test pre-commit hook with linting

* Test pre-commit hook again

* remove test files

* fixed wealthbox tool

* update telemetry endpoints

---------

Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
2025-07-30 23:36:44 -07:00

20 lines
708 B
TypeScript

import type { BlockOutput, OutputFieldDefinition } from '@/blocks/types'
export function resolveOutputType(
outputs: Record<string, OutputFieldDefinition>
): Record<string, BlockOutput> {
const resolvedOutputs: Record<string, BlockOutput> = {}
for (const [key, outputType] of Object.entries(outputs)) {
// Handle new format: { type: 'string', description: '...' }
if (typeof outputType === 'object' && outputType !== null && 'type' in outputType) {
resolvedOutputs[key] = outputType.type as BlockOutput
} else {
// Handle old format: just the type as string, or other object formats
resolvedOutputs[key] = outputType as BlockOutput
}
}
return resolvedOutputs
}