Skip to content

Commit 51ed4f5

Browse files
committed
updated the rest of the old file patterns, updated mistral outputs for v2
1 parent 59578dd commit 51ed4f5

File tree

14 files changed

+1056
-48
lines changed

14 files changed

+1056
-48
lines changed

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
144144
calendly: CalendlyIcon,
145145
circleback: CirclebackIcon,
146146
clay: ClayIcon,
147-
confluence: ConfluenceIcon,
147+
confluence_v2: ConfluenceIcon,
148148
cursor_v2: CursorIcon,
149149
datadog: DatadogIcon,
150150
discord: DiscordIcon,
@@ -246,7 +246,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
246246
twilio_sms: TwilioIcon,
247247
twilio_voice: TwilioIcon,
248248
typeform: TypeformIcon,
249-
video_generator: VideoIcon,
249+
video_generator_v2: VideoIcon,
250250
vision: EyeIcon,
251251
wealthbox: WealthboxIcon,
252252
webflow: WebflowIcon,

apps/docs/content/docs/en/tools/confluence.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Interact with Confluence
66
import { BlockInfoCard } from "@/components/ui/block-info-card"
77

88
<BlockInfoCard
9-
type="confluence"
9+
type="confluence_v2"
1010
color="#E0E0E0"
1111
/>
1212

apps/docs/content/docs/en/tools/mistral_parse.mdx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,37 @@ Parse PDF documents using Mistral OCR API
5454

5555
| Parameter | Type | Description |
5656
| --------- | ---- | ----------- |
57-
| `success` | boolean | Whether the PDF was parsed successfully |
58-
| `content` | string | Extracted content in the requested format \(markdown, text, or JSON\) |
59-
| `metadata` | object | Processing metadata including jobId, fileType, pageCount, and usage info |
57+
| `pages` | array | Array of page objects from Mistral OCR |
58+
|`index` | number | Page index \(zero-based\) |
59+
|`markdown` | string | Extracted markdown content |
60+
|`images` | array | Images extracted from this page with bounding boxes |
61+
|`id` | string | Image identifier \(e.g., img-0.jpeg\) |
62+
|`top_left_x` | number | Top-left X coordinate in pixels |
63+
|`top_left_y` | number | Top-left Y coordinate in pixels |
64+
|`bottom_right_x` | number | Bottom-right X coordinate in pixels |
65+
|`bottom_right_y` | number | Bottom-right Y coordinate in pixels |
66+
|`image_base64` | string | Base64-encoded image data \(when include_image_base64=true\) |
67+
|`id` | string | Image identifier \(e.g., img-0.jpeg\) |
68+
|`top_left_x` | number | Top-left X coordinate in pixels |
69+
|`top_left_y` | number | Top-left Y coordinate in pixels |
70+
|`bottom_right_x` | number | Bottom-right X coordinate in pixels |
71+
|`bottom_right_y` | number | Bottom-right Y coordinate in pixels |
72+
|`image_base64` | string | Base64-encoded image data \(when include_image_base64=true\) |
73+
|`dimensions` | object | Page dimensions |
74+
|`dpi` | number | Dots per inch |
75+
|`height` | number | Page height in pixels |
76+
|`width` | number | Page width in pixels |
77+
|`dpi` | number | Dots per inch |
78+
|`height` | number | Page height in pixels |
79+
|`width` | number | Page width in pixels |
80+
|`tables` | array | Extracted tables as HTML/markdown \(when table_format is set\). Referenced via placeholders like \[tbl-0.html\] |
81+
|`hyperlinks` | array | Array of URL strings detected in the page \(e.g., \[ |
82+
|`header` | string | Page header content \(when extract_header=true\) |
83+
|`footer` | string | Page footer content \(when extract_footer=true\) |
84+
| `model` | string | Mistral OCR model identifier \(e.g., mistral-ocr-latest\) |
85+
| `usage_info` | object | Usage and processing statistics |
86+
|`pages_processed` | number | Total number of pages processed |
87+
|`doc_size_bytes` | number | Document file size in bytes |
88+
| `document_annotation` | string | Structured annotation data as JSON string \(when applicable\) |
6089

6190

apps/docs/content/docs/en/tools/video_generator.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Generate videos from text using AI
66
import { BlockInfoCard } from "@/components/ui/block-info-card"
77

88
<BlockInfoCard
9-
type="video_generator"
9+
type="video_generator_v2"
1010
color="#181C1E"
1111
/>
1212

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,47 @@ export function FileUpload({
8585
}
8686
}
8787

88+
/**
89+
* Checks if a file's MIME type matches the accepted types
90+
* Supports exact matches, wildcard patterns (e.g., 'image/*'), and '*' for all types
91+
*/
92+
const isFileTypeAccepted = (fileType: string, accepted: string): boolean => {
93+
if (accepted === '*') return true
94+
95+
const acceptedList = accepted.split(',').map((t) => t.trim().toLowerCase())
96+
const normalizedFileType = fileType.toLowerCase()
97+
98+
return acceptedList.some((acceptedType) => {
99+
if (acceptedType === normalizedFileType) return true
100+
101+
if (acceptedType.endsWith('/*')) {
102+
const typePrefix = acceptedType.slice(0, -1) // 'image/' from 'image/*'
103+
return normalizedFileType.startsWith(typePrefix)
104+
}
105+
106+
if (acceptedType.startsWith('.')) {
107+
const extension = acceptedType.slice(1) // 'pdf' from '.pdf'
108+
return (
109+
normalizedFileType.endsWith(`/${extension}`) ||
110+
normalizedFileType.includes(`${extension}`)
111+
)
112+
}
113+
114+
return false
115+
})
116+
}
117+
88118
const availableWorkspaceFiles = workspaceFiles.filter((workspaceFile) => {
89119
const existingFiles = Array.isArray(value) ? value : value ? [value] : []
90-
return !existingFiles.some(
120+
121+
const isAlreadySelected = existingFiles.some(
91122
(existing) =>
92123
existing.name === workspaceFile.name ||
93124
existing.path?.includes(workspaceFile.key) ||
94125
existing.key === workspaceFile.key
95126
)
127+
128+
return !isAlreadySelected
96129
})
97130

98131
useEffect(() => {
@@ -421,23 +454,23 @@ export function FileUpload({
421454
return (
422455
<div
423456
key={fileKey}
424-
className='flex items-center justify-between rounded-[4px] border border-[var(--border-1)] bg-[var(--surface-5)] px-[8px] py-[6px] hover:border-[var(--surface-7)] hover:bg-[var(--surface-5)] dark:bg-[var(--surface-5)] dark:hover:bg-[var(--border-1)]'
457+
className='relative rounded-[4px] border border-[var(--border-1)] bg-[var(--surface-5)] px-[8px] py-[6px] hover:border-[var(--surface-7)] hover:bg-[var(--surface-5)] dark:bg-[var(--surface-5)] dark:hover:bg-[var(--border-1)]'
425458
>
426-
<div className='flex-1 truncate pr-2 text-sm' title={file.name}>
459+
<div className='truncate pr-[24px] text-sm' title={file.name}>
427460
<span className='text-[var(--text-primary)]'>{truncateMiddle(file.name)}</span>
428461
<span className='ml-2 text-[var(--text-muted)]'>({formatFileSize(file.size)})</span>
429462
</div>
430463
<Button
431464
type='button'
432465
variant='ghost'
433-
className='h-5 w-5 shrink-0 p-0'
466+
className='-translate-y-1/2 absolute top-1/2 right-[4px] h-6 w-6 p-0'
434467
onClick={(e) => handleRemoveFile(file, e)}
435468
disabled={isDeleting}
436469
>
437470
{isDeleting ? (
438-
<div className='h-3.5 w-3.5 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
471+
<div className='h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
439472
) : (
440-
<X className='h-3.5 w-3.5' />
473+
<X className='h-4 w-4 opacity-50' />
441474
)}
442475
</Button>
443476
</div>
@@ -468,19 +501,30 @@ export function FileUpload({
468501
const comboboxOptions = useMemo(
469502
() => [
470503
{ label: 'Upload New File', value: '__upload_new__' },
471-
...availableWorkspaceFiles.map((file) => ({
472-
label: file.name,
473-
value: file.id,
474-
})),
504+
...availableWorkspaceFiles.map((file) => {
505+
const isAccepted =
506+
!acceptedTypes || acceptedTypes === '*' || isFileTypeAccepted(file.type, acceptedTypes)
507+
return {
508+
label: file.name,
509+
value: file.id,
510+
disabled: !isAccepted,
511+
}
512+
}),
475513
],
476-
[availableWorkspaceFiles]
514+
[availableWorkspaceFiles, acceptedTypes]
477515
)
478516

479517
const handleComboboxChange = (value: string) => {
480518
setInputValue(value)
481519

482-
const isValidOption =
483-
value === '__upload_new__' || availableWorkspaceFiles.some((file) => file.id === value)
520+
const selectedFile = availableWorkspaceFiles.find((file) => file.id === value)
521+
const isAcceptedType =
522+
selectedFile &&
523+
(!acceptedTypes ||
524+
acceptedTypes === '*' ||
525+
isFileTypeAccepted(selectedFile.type, acceptedTypes))
526+
527+
const isValidOption = value === '__upload_new__' || isAcceptedType
484528

485529
if (!isValidOption) {
486530
return

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,9 @@ const getOutputTypeForPath = (
241241
const blockState = useWorkflowStore.getState().blocks[blockId]
242242
const subBlocks = mergedSubBlocksOverride ?? (blockState?.subBlocks || {})
243243
return getBlockOutputType(block.type, outputPath, subBlocks)
244-
} else {
244+
} else if (blockConfig) {
245245
const operationValue = getSubBlockValue(blockId, 'operation')
246-
if (blockConfig && operationValue) {
247-
return getToolOutputType(blockConfig, operationValue, outputPath)
248-
}
246+
return getToolOutputType(blockConfig, operationValue || '', outputPath)
249247
}
250248
return 'any'
251249
}
@@ -1213,9 +1211,11 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
12131211
} else {
12141212
const operationValue =
12151213
mergedSubBlocks?.operation?.value ?? getSubBlockValue(activeSourceBlockId, 'operation')
1216-
const toolOutputPaths = operationValue
1217-
? getToolOutputPaths(blockConfig, operationValue, mergedSubBlocks)
1218-
: []
1214+
const toolOutputPaths = getToolOutputPaths(
1215+
blockConfig,
1216+
operationValue || '',
1217+
mergedSubBlocks
1218+
)
12191219

12201220
if (toolOutputPaths.length > 0) {
12211221
blockTags = toolOutputPaths.map((path) => `${normalizedBlockName}.${path}`)
@@ -1545,9 +1545,11 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
15451545
} else {
15461546
const operationValue =
15471547
mergedSubBlocks?.operation?.value ?? getSubBlockValue(accessibleBlockId, 'operation')
1548-
const toolOutputPaths = operationValue
1549-
? getToolOutputPaths(blockConfig, operationValue, mergedSubBlocks)
1550-
: []
1548+
const toolOutputPaths = getToolOutputPaths(
1549+
blockConfig,
1550+
operationValue || '',
1551+
mergedSubBlocks
1552+
)
15511553

15521554
if (toolOutputPaths.length > 0) {
15531555
blockTags = toolOutputPaths.map((path) => `${normalizedBlockName}.${path}`)

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export function Editor() {
129129
blockSubBlockValues,
130130
canonicalIndex
131131
)
132-
// When user can edit, respect their toggle; otherwise show if values present
133132
const displayAdvancedOptions = userPermissions.canEdit
134133
? advancedMode
135134
: advancedMode || advancedValuesPresent

apps/sim/blocks/blocks/a2a.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,26 @@ export const A2ABlock: BlockConfig<A2AResponse> = {
107107
condition: { field: 'operation', value: 'a2a_send_message' },
108108
},
109109
{
110-
id: 'files',
110+
id: 'fileUpload',
111111
title: 'Files',
112112
type: 'file-upload',
113+
canonicalParamId: 'files',
113114
placeholder: 'Upload files to send',
114115
description: 'Files to include with the message (FilePart)',
115116
condition: { field: 'operation', value: 'a2a_send_message' },
117+
mode: 'basic',
116118
multiple: true,
117119
},
120+
{
121+
id: 'fileReference',
122+
title: 'Files',
123+
type: 'short-input',
124+
canonicalParamId: 'files',
125+
placeholder: 'Reference files from previous blocks',
126+
description: 'Files to include with the message (FilePart)',
127+
condition: { field: 'operation', value: 'a2a_send_message' },
128+
mode: 'advanced',
129+
},
118130
{
119131
id: 'taskId',
120132
title: 'Task ID',
@@ -233,6 +245,14 @@ export const A2ABlock: BlockConfig<A2AResponse> = {
233245
type: 'array',
234246
description: 'Files to include with the message',
235247
},
248+
fileUpload: {
249+
type: 'array',
250+
description: 'Uploaded files (basic mode)',
251+
},
252+
fileReference: {
253+
type: 'json',
254+
description: 'File reference from previous blocks (advanced mode)',
255+
},
236256
historyLength: {
237257
type: 'number',
238258
description: 'Number of history messages to include',

0 commit comments

Comments
 (0)