Skip to content

Commit d77aa0b

Browse files
committed
improvement(block-inputs): must parse json accurately
1 parent 0894278 commit d77aa0b

25 files changed

+140
-53
lines changed

apps/sim/blocks/blocks/apify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`,
151151
operation: { type: 'string', description: 'Operation to perform' },
152152
apiKey: { type: 'string', description: 'Apify API token' },
153153
actorId: { type: 'string', description: 'Actor ID or username/actor-name' },
154-
input: { type: 'string', description: 'Actor input as JSON string' },
154+
input: { type: 'json', description: 'Actor input as JSON string' },
155155
timeout: { type: 'number', description: 'Timeout in seconds' },
156156
build: { type: 'string', description: 'Actor build version' },
157157
waitForFinish: { type: 'number', description: 'Initial wait time in seconds' },

apps/sim/blocks/blocks/apollo.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,26 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
776776
},
777777
inputs: {
778778
operation: { type: 'string', description: 'Apollo operation to perform' },
779+
person_titles: { type: 'json', description: 'Array of job titles' },
780+
person_locations: { type: 'json', description: 'Array of locations' },
781+
organization_names: { type: 'json', description: 'Array of organization names' },
782+
person_seniorities: { type: 'json', description: 'Array of seniority levels' },
783+
contact_stage_ids: { type: 'json', description: 'Array of contact stage IDs' },
784+
organization_locations: { type: 'json', description: 'Array of organization locations' },
785+
organization_num_employees_ranges: {
786+
type: 'json',
787+
description: 'Array of employee count ranges',
788+
},
789+
q_organization_keyword_tags: { type: 'json', description: 'Array of keyword tags' },
790+
account_stage_ids: { type: 'json', description: 'Array of account stage IDs' },
791+
people: { type: 'json', description: 'People data for bulk enrichment' },
792+
organizations: { type: 'json', description: 'Organizations data for bulk enrichment' },
793+
contacts: { type: 'json', description: 'Contacts data for bulk operations' },
794+
accounts: { type: 'json', description: 'Accounts data for bulk operations' },
795+
contact_ids: { type: 'json', description: 'Array of contact IDs' },
796+
account_ids: { type: 'json', description: 'Array of account IDs' },
797+
stage_ids: { type: 'json', description: 'Array of stage IDs' },
798+
owner_ids: { type: 'json', description: 'Array of owner IDs' },
779799
},
780800
outputs: {
781801
success: { type: 'boolean', description: 'Whether the operation was successful' },

apps/sim/blocks/blocks/cursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const CursorBlock: BlockConfig<CursorResponse> = {
155155
ref: { type: 'string', description: 'Branch, tag, or commit reference' },
156156
promptText: { type: 'string', description: 'Instruction text for the agent' },
157157
followupPromptText: { type: 'string', description: 'Follow-up instruction text for the agent' },
158-
promptImages: { type: 'string', description: 'JSON array of image objects' },
158+
promptImages: { type: 'json', description: 'JSON array of image objects' },
159159
model: { type: 'string', description: 'Model to use (empty for auto-selection)' },
160160
branchName: { type: 'string', description: 'Custom branch name' },
161161
autoCreatePr: { type: 'boolean', description: 'Auto-create PR when done' },

apps/sim/blocks/blocks/elasticsearch.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,16 +489,16 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`,
489489
password: { type: 'string', description: 'Password for basic auth' },
490490
index: { type: 'string', description: 'Index name' },
491491
documentId: { type: 'string', description: 'Document ID' },
492-
document: { type: 'string', description: 'Document body as JSON' },
493-
query: { type: 'string', description: 'Search query as JSON' },
492+
document: { type: 'json', description: 'Document body as JSON' },
493+
query: { type: 'json', description: 'Search query as JSON' },
494494
size: { type: 'number', description: 'Number of results' },
495495
from: { type: 'number', description: 'Starting offset' },
496-
sort: { type: 'string', description: 'Sort specification as JSON' },
496+
sort: { type: 'json', description: 'Sort specification as JSON' },
497497
sourceIncludes: { type: 'string', description: 'Fields to include' },
498498
sourceExcludes: { type: 'string', description: 'Fields to exclude' },
499-
operations: { type: 'string', description: 'Bulk operations as NDJSON' },
500-
settings: { type: 'string', description: 'Index settings as JSON' },
501-
mappings: { type: 'string', description: 'Index mappings as JSON' },
499+
operations: { type: 'json', description: 'Bulk operations as NDJSON' },
500+
settings: { type: 'json', description: 'Index settings as JSON' },
501+
mappings: { type: 'json', description: 'Index mappings as JSON' },
502502
refresh: { type: 'string', description: 'Refresh policy' },
503503
waitForStatus: { type: 'string', description: 'Wait for cluster status' },
504504
timeout: { type: 'string', description: 'Timeout for wait operations' },

apps/sim/blocks/blocks/fireflies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ Return ONLY the summary text - no quotes, no labels.`,
550550
audioUrl: { type: 'string', description: 'Public URL to audio file' },
551551
title: { type: 'string', description: 'Meeting title' },
552552
language: { type: 'string', description: 'Language code for transcription' },
553-
attendees: { type: 'string', description: 'JSON array of attendees' },
553+
attendees: { type: 'json', description: 'JSON array of attendees' },
554554
clientReferenceId: { type: 'string', description: 'Custom reference ID for tracking' },
555555
meetingLink: { type: 'string', description: 'Meeting URL (Zoom, Meet, Teams)' },
556556
meetingPassword: { type: 'string', description: 'Meeting password if required' },

apps/sim/blocks/blocks/github.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,9 +1853,9 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
18531853
ref: { type: 'string', description: 'Branch, tag, or commit reference' },
18541854
// Branch parameters
18551855
protected: { type: 'string', description: 'Protection status filter' },
1856-
required_status_checks: { type: 'string', description: 'Required status checks JSON' },
1856+
required_status_checks: { type: 'json', description: 'Required status checks JSON' },
18571857
enforce_admins: { type: 'boolean', description: 'Enforce for admins' },
1858-
required_pull_request_reviews: { type: 'string', description: 'Required PR reviews JSON' },
1858+
required_pull_request_reviews: { type: 'json', description: 'Required PR reviews JSON' },
18591859
// Issue parameters
18601860
labels: { type: 'string', description: 'Comma-separated labels' },
18611861
assignees: { type: 'string', description: 'Comma-separated assignees' },
@@ -1868,7 +1868,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
18681868
workflow_id: { type: 'string', description: 'Workflow ID or filename' },
18691869
run_id: { type: 'number', description: 'Workflow run ID' },
18701870
status: { type: 'string', description: 'Status filter' },
1871-
inputs: { type: 'string', description: 'Workflow inputs JSON' },
1871+
inputs: { type: 'json', description: 'Workflow inputs JSON' },
18721872
// Project parameters
18731873
owner_login: { type: 'string', description: 'Owner login' },
18741874
owner_type: { type: 'string', description: 'Owner type (user or org)' },
@@ -1888,7 +1888,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
18881888
// Gist parameters
18891889
gist_id: { type: 'string', description: 'Gist ID' },
18901890
description: { type: 'string', description: 'Description' },
1891-
files: { type: 'string', description: 'Files JSON object' },
1891+
files: { type: 'json', description: 'Files JSON object' },
18921892
gist_public: { type: 'boolean', description: 'Public gist status' },
18931893
username: { type: 'string', description: 'GitHub username' },
18941894
// Fork parameters

apps/sim/blocks/blocks/google_sheets.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`,
269269
credential: { type: 'string', description: 'Google Sheets access token' },
270270
spreadsheetId: { type: 'string', description: 'Spreadsheet identifier' },
271271
manualSpreadsheetId: { type: 'string', description: 'Manual spreadsheet identifier' },
272-
range: { type: 'string', description: 'Cell range' },
273-
values: { type: 'string', description: 'Cell values data' },
272+
range: { type: 'json', description: 'Cell range' },
273+
values: { type: 'json', description: 'Cell values data' },
274274
valueInputOption: { type: 'string', description: 'Value input option' },
275275
insertDataOption: { type: 'string', description: 'Data insertion option' },
276276
},
@@ -826,13 +826,13 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`,
826826
sheetName: { type: 'string', description: 'Name of the sheet/tab' },
827827
manualSheetName: { type: 'string', description: 'Manual sheet name entry' },
828828
cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' },
829-
values: { type: 'string', description: 'Cell values data' },
829+
values: { type: 'json', description: 'Cell values data' },
830830
valueInputOption: { type: 'string', description: 'Value input option' },
831831
insertDataOption: { type: 'string', description: 'Data insertion option' },
832832
title: { type: 'string', description: 'Title for new spreadsheet' },
833833
sheetTitles: { type: 'string', description: 'Comma-separated sheet names for new spreadsheet' },
834-
ranges: { type: 'string', description: 'JSON array of ranges for batch operations' },
835-
batchData: { type: 'string', description: 'JSON array of data for batch update' },
834+
ranges: { type: 'json', description: 'JSON array of ranges for batch operations' },
835+
batchData: { type: 'json', description: 'JSON array of data for batch update' },
836836
sheetId: { type: 'string', description: 'Numeric sheet ID for copy operation' },
837837
destinationSpreadsheetId: {
838838
type: 'string',

apps/sim/blocks/blocks/google_slides.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers,
806806
// Add slide operation
807807
layout: { type: 'string', description: 'Slide layout' },
808808
insertionIndex: { type: 'number', description: 'Position to insert slide' },
809-
placeholderIdMappings: { type: 'string', description: 'JSON array of placeholder ID mappings' },
809+
placeholderIdMappings: { type: 'json', description: 'JSON array of placeholder ID mappings' },
810810
// Add image operation
811811
pageObjectId: { type: 'string', description: 'Slide object ID for image' },
812812
imageUrl: { type: 'string', description: 'Image URL' },
@@ -824,7 +824,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers,
824824
deleteObjectId: { type: 'string', description: 'Object ID to delete' },
825825
// Duplicate object operation
826826
duplicateObjectId: { type: 'string', description: 'Object ID to duplicate' },
827-
duplicateObjectIds: { type: 'string', description: 'JSON object ID mappings' },
827+
duplicateObjectIds: { type: 'json', description: 'JSON object ID mappings' },
828828
// Reorder slides operation
829829
reorderSlideIds: { type: 'string', description: 'Comma-separated slide IDs to move' },
830830
reorderInsertionIndex: { type: 'number', description: 'New position for slides' },

apps/sim/blocks/blocks/grafana.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ Return ONLY the folder title - no explanations, no quotes, no extra text.`,
657657
title: { type: 'string', description: 'Dashboard or folder title' },
658658
folderUid: { type: 'string', description: 'Folder UID' },
659659
tags: { type: 'string', description: 'Comma-separated tags' },
660-
panels: { type: 'string', description: 'JSON array of panels' },
660+
panels: { type: 'json', description: 'JSON array of panels' },
661661
message: { type: 'string', description: 'Commit message' },
662662
query: { type: 'string', description: 'Search query' },
663663
tag: { type: 'string', description: 'Filter by tag' },
@@ -666,7 +666,7 @@ Return ONLY the folder title - no explanations, no quotes, no extra text.`,
666666
alertTitle: { type: 'string', description: 'Alert rule title' },
667667
ruleGroup: { type: 'string', description: 'Rule group name' },
668668
condition: { type: 'string', description: 'Alert condition refId' },
669-
data: { type: 'string', description: 'Query data JSON' },
669+
data: { type: 'json', description: 'Query data JSON' },
670670
forDuration: { type: 'string', description: 'Duration before firing' },
671671
noDataState: { type: 'string', description: 'State on no data' },
672672
execErrState: { type: 'string', description: 'State on error' },

apps/sim/blocks/blocks/incidentio.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ Return ONLY the JSON array - no explanations or markdown formatting.`,
957957
state: { type: 'string', description: 'Workflow state' },
958958
// Schedule fields
959959
timezone: { type: 'string', description: 'Schedule timezone' },
960+
config: { type: 'json', description: 'Schedule configuration' },
960961
// Custom field fields
961962
description: { type: 'string', description: 'Custom field description' },
962963
field_type: { type: 'string', description: 'Custom field type' },

0 commit comments

Comments
 (0)