From bc305b36f57b471dd18f122a98f0d3233225f966 Mon Sep 17 00:00:00 2001 From: aadamgough Date: Fri, 9 Jan 2026 17:41:31 -0800 Subject: [PATCH 1/2] added wand configs --- apps/sim/blocks/blocks/google_sheets.ts | 27 +++++ apps/sim/blocks/blocks/microsoft_excel.ts | 78 ++++++++++++ apps/sim/blocks/blocks/sharepoint.ts | 141 +++++++++++++++++++++- apps/sim/blocks/blocks/supabase.ts | 32 +++++ apps/sim/blocks/blocks/twilio_voice.ts | 56 +++++++++ apps/sim/triggers/twilio_voice/webhook.ts | 59 +++++++++ 6 files changed, 390 insertions(+), 3 deletions(-) diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index f026fe42cf..c500f5f3d4 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -73,6 +73,33 @@ export const GoogleSheetsBlock: BlockConfig = { title: 'Range', type: 'short-input', placeholder: 'Sheet name and cell range (e.g., Sheet1!A1:D10)', + wandConfig: { + enabled: true, + prompt: `Generate a valid Google Sheets range based on the user's description. + +### VALID FORMATS +1. Sheet name only (for appending to end): Sheet1 +2. Full range (for reading/writing specific cells): Sheet1!A1:D10 + +### RANGE RULES +- Sheet names with spaces must be quoted: 'My Sheet'!A1:B10 +- Column letters are uppercase: A, B, C, ... Z, AA, AB, etc. +- Row numbers start at 1 (not 0) +- Range format: SheetName!StartCell:EndCell (e.g., Sheet1!A2:C10) +- For a single column: Sheet1!A:A +- For a single row: Sheet1!1:1 + +### EXAMPLES +- "the first sheet" -> Sheet1 +- "data sheet from A1 to E100" -> 'Data Sheet'!A1:E100 +- "append to orders sheet" -> Orders +- "cells A1 through C50 on Sheet2" -> Sheet2!A1:C50 +- "column A of inventory" -> Inventory!A:A +- "just the headers row" -> Sheet1!1:1 + +Return ONLY the range string - no explanations, no quotes around the entire output, no extra text.`, + placeholder: 'Describe the range (e.g., "all data from Sheet1" or "A1 to D50")...', + }, }, // Write-specific Fields { diff --git a/apps/sim/blocks/blocks/microsoft_excel.ts b/apps/sim/blocks/blocks/microsoft_excel.ts index 4d64ed4e3f..406942327d 100644 --- a/apps/sim/blocks/blocks/microsoft_excel.ts +++ b/apps/sim/blocks/blocks/microsoft_excel.ts @@ -70,6 +70,33 @@ export const MicrosoftExcelBlock: BlockConfig = { type: 'short-input', placeholder: 'Sheet name and cell range (e.g., Sheet1!A1:D10)', condition: { field: 'operation', value: ['read', 'write', 'update'] }, + wandConfig: { + enabled: true, + prompt: `Generate a valid Microsoft Excel range based on the user's description. + +### FORMAT (REQUIRED) +SheetName!StartCell:EndCell + +Excel ALWAYS requires the full range format with both sheet name and cell range. + +### RANGE RULES +- Sheet names with spaces must be quoted: 'My Sheet'!A1:B10 +- Column letters are uppercase: A, B, C, ... Z, AA, AB, etc. +- Row numbers start at 1 (not 0) +- For entire columns: Sheet1!A:Z +- For entire rows: Sheet1!1:100 + +### EXAMPLES +- "the first sheet" -> Sheet1!A1:Z1000 +- "data sheet from A1 to E100" -> 'Data Sheet'!A1:E100 +- "cells A1 through C50 on Sheet2" -> Sheet2!A1:C50 +- "column A of inventory" -> Inventory!A:A +- "just the headers row on Sheet1" -> Sheet1!1:1 +- "all data on sales sheet" -> 'Sales'!A1:Z1000 + +Return ONLY the range string - no explanations, no quotes around the entire output, no extra text.`, + placeholder: 'Describe the range (e.g., "A1 to D50 on Sheet1")...', + }, }, { id: 'tableName', @@ -95,6 +122,22 @@ export const MicrosoftExcelBlock: BlockConfig = { 'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])', condition: { field: 'operation', value: 'write' }, required: true, + wandConfig: { + enabled: true, + prompt: `Generate Microsoft Excel data as a JSON array based on the user's description. + +Format options: +1. Array of arrays: [["Header1", "Header2"], ["Value1", "Value2"]] +2. Array of objects: [{"column1": "value1", "column2": "value2"}] + +Examples: +- "sales data with product and revenue columns" -> [["Product", "Revenue"], ["Widget A", 1500], ["Widget B", 2300]] +- "list of employees with name and email" -> [{"name": "John Doe", "email": "john@example.com"}, {"name": "Jane Smith", "email": "jane@example.com"}] + +Return ONLY the JSON array - no explanations, no markdown, no extra text.`, + placeholder: 'Describe the data you want to write...', + generationType: 'json-object', + }, }, { id: 'valueInputOption', @@ -114,6 +157,22 @@ export const MicrosoftExcelBlock: BlockConfig = { 'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])', condition: { field: 'operation', value: 'update' }, required: true, + wandConfig: { + enabled: true, + prompt: `Generate Microsoft Excel data as a JSON array based on the user's description. + +Format options: +1. Array of arrays: [["Header1", "Header2"], ["Value1", "Value2"]] +2. Array of objects: [{"column1": "value1", "column2": "value2"}] + +Examples: +- "update with new prices" -> [["Product", "Price"], ["Widget A", 29.99], ["Widget B", 49.99]] +- "quarterly targets" -> [{"Q1": 10000, "Q2": 12000, "Q3": 15000, "Q4": 18000}] + +Return ONLY the JSON array - no explanations, no markdown, no extra text.`, + placeholder: 'Describe the data you want to update...', + generationType: 'json-object', + }, }, { id: 'valueInputOption', @@ -133,6 +192,25 @@ export const MicrosoftExcelBlock: BlockConfig = { 'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])', condition: { field: 'operation', value: 'table_add' }, required: true, + wandConfig: { + enabled: true, + prompt: `Generate Microsoft Excel table row data as a JSON array based on the user's description. + +Format options: +1. Array of arrays: [["Value1", "Value2"], ["Value3", "Value4"]] +2. Array of objects: [{"column1": "value1", "column2": "value2"}] + +Note: When adding to an existing table, do NOT include headers - only data rows. + +Examples: +- "add new sales record" -> [["2024-01-15", "Widget Pro", 5, 249.99]] +- "append customer info" -> [{"name": "Acme Corp", "contact": "John Smith", "status": "Active"}] +- "add multiple rows with name, age, city" -> [["Alice", 28, "NYC"], ["Bob", 35, "LA"]] + +Return ONLY the JSON array - no explanations, no markdown, no extra text.`, + placeholder: 'Describe the data you want to add to the table...', + generationType: 'json-object', + }, }, ], tools: { diff --git a/apps/sim/blocks/blocks/sharepoint.ts b/apps/sim/blocks/blocks/sharepoint.ts index 4030225653..36f86afe1f 100644 --- a/apps/sim/blocks/blocks/sharepoint.ts +++ b/apps/sim/blocks/blocks/sharepoint.ts @@ -132,14 +132,108 @@ export const SharepointBlock: BlockConfig = { type: 'short-input', placeholder: "Template (e.g., 'genericList')", condition: { field: 'operation', value: 'create_list' }, + wandConfig: { + enabled: true, + prompt: `Generate a SharePoint list template name based on the user's description. + +### AVAILABLE TEMPLATES +- genericList - Standard list for general data (default) +- documentLibrary - For storing and managing documents +- survey - For creating surveys and polls +- links - For storing hyperlinks +- announcements - For news and announcements +- contacts - For contact information (name, email, phone) +- events - For calendar events and scheduling +- tasks - For task tracking and project management +- discussionBoard - For team discussions and forums +- pictureLibrary - For storing images and photos +- issue - For issue/bug tracking + +### EXAMPLES +- "I want to track tasks" -> tasks +- "store documents" -> documentLibrary +- "team announcements" -> announcements +- "contact list" -> contacts +- "calendar events" -> events +- "general data" -> genericList +- "bug tracking" -> issue +- "photo gallery" -> pictureLibrary + +Return ONLY the template name - no explanations, no quotes, no extra text.`, + placeholder: 'Describe what kind of list you need...', + }, }, { id: 'pageContent', - title: 'Page Content', + title: 'Column Definitions', type: 'long-input', - placeholder: 'Provide page content', + placeholder: 'Optional: Define custom columns as JSON array', condition: { field: 'operation', value: ['create_list'] }, + wandConfig: { + enabled: true, + prompt: `Generate a JSON array of SharePoint list column definitions based on the user's description. + +### FORMAT +A JSON array of column definition objects. Each column needs at minimum a "name" and column type properties. + +### COLUMN TYPES AND PROPERTIES + +**Text Column:** +{"name": "ColumnName", "text": {}} +- For single line of text + +**Multi-line Text:** +{"name": "ColumnName", "text": {"allowMultipleLines": true}} + +**Number Column:** +{"name": "ColumnName", "number": {}} +- Optional: "minimum", "maximum", "decimalPlaces" + +**DateTime Column:** +{"name": "ColumnName", "dateTime": {"format": "dateOnly"}} +- format: "dateOnly" or "dateTime" + +**Boolean (Yes/No):** +{"name": "ColumnName", "boolean": {}} + +**Choice Column:** +{"name": "ColumnName", "choice": {"choices": ["Option1", "Option2", "Option3"]}} + +**Person Column:** +{"name": "ColumnName", "personOrGroup": {}} + +**Currency:** +{"name": "ColumnName", "currency": {"locale": "en-US"}} + +### EXAMPLES + +"add columns for status (choice: Active, Completed, On Hold), due date, and priority number" +-> [ + {"name": "Status", "choice": {"choices": ["Active", "Completed", "On Hold"]}}, + {"name": "DueDate", "dateTime": {"format": "dateOnly"}}, + {"name": "Priority", "number": {"minimum": 1, "maximum": 5}} +] + +"text column for description, yes/no for completed, date for start" +-> [ + {"name": "Description", "text": {"allowMultipleLines": true}}, + {"name": "Completed", "boolean": {}}, + {"name": "StartDate", "dateTime": {"format": "dateOnly"}} +] + +"assignee (person), budget (currency), category (choice: Marketing, Sales, Engineering)" +-> [ + {"name": "Assignee", "personOrGroup": {}}, + {"name": "Budget", "currency": {"locale": "en-US"}}, + {"name": "Category", "choice": {"choices": ["Marketing", "Sales", "Engineering"]}} +] + +Return ONLY the JSON array - no explanations, no markdown, no extra text.`, + placeholder: + 'Describe the columns you want to add (e.g., "status dropdown, due date, priority number")...', + generationType: 'json-object', + }, }, { id: 'listDescription', @@ -164,9 +258,50 @@ export const SharepointBlock: BlockConfig = { id: 'listItemFields', title: 'List Item Fields', type: 'long-input', - placeholder: 'Enter list item fields', + placeholder: + 'Enter list item fields as JSON (e.g., {"Title": "My Item", "Status": "Active"})', canonicalParamId: 'listItemFields', condition: { field: 'operation', value: ['update_list', 'add_list_items'] }, + wandConfig: { + enabled: true, + prompt: `Generate a JSON object for SharePoint list item fields based on the user's description. + +### FORMAT +A JSON object where keys are column internal names and values are the data to set. + +### RULES +- Use the column's internal name (often same as display name, but spaces become _x0020_) +- Common field names: Title, Status, Description, Priority, DueDate, AssignedTo, Category +- Date fields should use ISO 8601 format: "2024-01-15" or "2024-01-15T10:30:00Z" +- Number fields should be numeric, not strings +- Boolean fields use true/false +- Choice fields use the exact choice value as a string +- Person fields use the person's email or ID + +### READ-ONLY FIELDS (automatically filtered out) +Id, UniqueId, GUID, Created, Modified, Author, Editor, ContentTypeId + +### EXAMPLES + +"set title to Project Alpha and status to In Progress" +-> {"Title": "Project Alpha", "Status": "In Progress"} + +"update priority to high and due date to next Friday" +-> {"Priority": "High", "DueDate": "2024-01-19"} + +"add task with title Review Document, assigned to john@company.com" +-> {"Title": "Review Document", "AssignedToLookupId": "john@company.com"} + +"create contact with name John Smith, email john@example.com, phone 555-1234" +-> {"Title": "John Smith", "Email": "john@example.com", "WorkPhone": "555-1234"} + +"set completed to true and notes to Task finished successfully" +-> {"Completed": true, "Notes": "Task finished successfully"} + +Return ONLY the JSON object - no explanations, no markdown, no extra text.`, + placeholder: 'Describe the fields and values you want to set...', + generationType: 'json-object', + }, }, // Upload File operation fields diff --git a/apps/sim/blocks/blocks/supabase.ts b/apps/sim/blocks/blocks/supabase.ts index b6602362a4..4a60037fcc 100644 --- a/apps/sim/blocks/blocks/supabase.ts +++ b/apps/sim/blocks/blocks/supabase.ts @@ -402,6 +402,38 @@ Return ONLY the PostgREST filter expression - no explanations, no markdown, no e type: 'short-input', placeholder: 'column_name (add DESC for descending)', condition: { field: 'operation', value: 'query' }, + wandConfig: { + enabled: true, + prompt: `Generate a Supabase order by clause based on the user's description. + +### FORMAT +column_name [ASC|DESC] + +### RULES +- Column name only: sorts ascending by default +- Add DESC after column name for descending order +- Add ASC after column name for ascending order (explicit) +- Column names are case-sensitive and should match your database schema + +### COMMON PATTERNS +- Newest first: created_at DESC +- Oldest first: created_at ASC +- Alphabetical: name +- Reverse alphabetical: name DESC +- Highest value first: price DESC +- Lowest value first: price ASC + +### EXAMPLES +- "sort by start time newest first" -> start_time DESC +- "order by name alphabetically" -> name +- "sort by created date oldest first" -> created_at ASC +- "highest scores first" -> score DESC +- "sort by updated timestamp descending" -> updated_at DESC +- "order by email" -> email + +Return ONLY the order by expression - no explanations, no extra text.`, + placeholder: 'Describe how to sort (e.g., "newest first by created_at")...', + }, }, // Optional limit for query operation { diff --git a/apps/sim/blocks/blocks/twilio_voice.ts b/apps/sim/blocks/blocks/twilio_voice.ts index cd3d068261..5ce69f242d 100644 --- a/apps/sim/blocks/blocks/twilio_voice.ts +++ b/apps/sim/blocks/blocks/twilio_voice.ts @@ -86,6 +86,62 @@ export const TwilioVoiceBlock: BlockConfig = { field: 'operation', value: 'make_call', }, + wandConfig: { + enabled: true, + prompt: `Generate TwiML (Twilio Markup Language) for outbound voice calls based on the user's description. + +### IMPORTANT: Use SQUARE BRACKETS instead of angle brackets +- Use [Tag] instead of +- Use [/Tag] instead of +- Use [Tag/] for self-closing tags instead of + +### COMMON TWIML VERBS + +**[Say]** - Text-to-speech +[Say voice="alice"]Hello, this is an automated call.[/Say] +- Voices: alice, man, woman, Polly.Joanna, Polly.Matthew, etc. + +**[Play]** - Play audio file +[Play]https://example.com/audio.mp3[/Play] + +**[Record]** - Record caller's voice +[Record maxLength="120" transcribe="true"/] +- transcribe="true" to get text transcription + +**[Gather]** - Collect keypad input or speech +[Gather input="dtmf speech" timeout="5" numDigits="1"] + [Say]Press 1 to confirm, 2 to cancel.[/Say] +[/Gather] + +**[Dial]** - Connect to another number +[Dial]+14155551234[/Dial] + +**[Pause]** - Add silence +[Pause length="2"/] + +**[Hangup]** - End the call +[Hangup/] + +### EXAMPLES + +"say hello and deliver a reminder message" +-> [Response][Say voice="alice"]Hello! This is a reminder about your appointment tomorrow at 2 PM. Press 1 to confirm or 2 to reschedule.[/Say][Gather input="dtmf" timeout="10" numDigits="1"/][/Response] + +"play a recorded message" +-> [Response][Play]https://example.com/message.mp3[/Play][/Response] + +"say a message and record their response" +-> [Response][Say voice="alice"]Hello! Please leave your feedback after the beep.[/Say][Record maxLength="60" transcribe="true"/][Say voice="alice"]Thank you for your feedback. Goodbye.[/Say][/Response] + +"simple greeting message" +-> [Response][Say voice="alice"]Hello! This is an automated call from your service provider. Have a great day![/Say][/Response] + +"ask a yes or no question" +-> [Response][Say voice="alice"]Hello! Would you like to receive updates? Press 1 for yes, or 2 for no.[/Say][Gather input="dtmf" timeout="10" numDigits="1"/][Say voice="alice"]We didn't receive your response. Goodbye.[/Say][/Response] + +Return ONLY the TwiML with square brackets - no explanations, no markdown, no extra text.`, + placeholder: 'Describe what the call should say or do...', + }, }, { id: 'record', diff --git a/apps/sim/triggers/twilio_voice/webhook.ts b/apps/sim/triggers/twilio_voice/webhook.ts index d3fb1c62b2..c87194b77f 100644 --- a/apps/sim/triggers/twilio_voice/webhook.ts +++ b/apps/sim/triggers/twilio_voice/webhook.ts @@ -48,6 +48,65 @@ export const twilioVoiceWebhookTrigger: TriggerConfig = { 'TwiML instructions to return immediately to Twilio. Use square brackets instead of angle brackets (e.g., [Response] instead of ). This controls what happens when the call comes in (e.g., play a message, record, gather input). Your workflow will execute in the background.', required: false, mode: 'trigger', + wandConfig: { + enabled: true, + prompt: `Generate TwiML (Twilio Markup Language) for voice calls based on the user's description. + +### IMPORTANT: Use SQUARE BRACKETS instead of angle brackets +- Use [Tag] instead of +- Use [/Tag] instead of +- Use [Tag/] for self-closing tags instead of + +### COMMON TWIML VERBS + +**[Say]** - Text-to-speech +[Say voice="alice"]Hello, how can I help you?[/Say] +- Voices: alice, man, woman, Polly.Joanna, Polly.Matthew, etc. + +**[Play]** - Play audio file +[Play]https://example.com/audio.mp3[/Play] + +**[Record]** - Record caller's voice +[Record maxLength="120" transcribe="true"/] +- transcribe="true" to get text transcription + +**[Gather]** - Collect keypad input or speech +[Gather input="dtmf speech" timeout="5" numDigits="1"] + [Say]Press 1 for sales, 2 for support.[/Say] +[/Gather] + +**[Dial]** - Connect to another number +[Dial]+14155551234[/Dial] + +**[Pause]** - Add silence +[Pause length="2"/] + +**[Hangup]** - End the call +[Hangup/] + +**[Redirect]** - Redirect to another URL +[Redirect]https://example.com/next[/Redirect] + +### EXAMPLES + +"say hello and ask them to leave a message" +-> [Response][Say voice="alice"]Hello! Please leave a message after the beep.[/Say][Record maxLength="120" transcribe="true"/][/Response] + +"greet and offer options: press 1 for sales, 2 for support" +-> [Response][Gather input="dtmf" timeout="5" numDigits="1"][Say voice="alice"]Welcome! Press 1 for sales, or press 2 for support.[/Say][/Gather][Say]Sorry, I didn't get that. Goodbye.[/Say][/Response] + +"play hold music" +-> [Response][Say voice="alice"]Please hold while we connect you.[/Say][Play loop="0"]https://api.twilio.com/cowbell.mp3[/Play][/Response] + +"just say please wait" +-> [Response][Say voice="alice"]Please wait while we process your request.[/Say][/Response] + +"record a voicemail with transcription" +-> [Response][Say voice="alice"]You've reached our voicemail. Please leave a message.[/Say][Record transcribe="true" maxLength="180" playBeep="true"/][Say voice="alice"]Thank you for your message. Goodbye.[/Say][/Response] + +Return ONLY the TwiML with square brackets - no explanations, no markdown, no extra text.`, + placeholder: 'Describe what should happen when a call comes in...', + }, }, { id: 'triggerSave', From bbb576fec433021d70dbc7d735f3e745fdb980e6 Mon Sep 17 00:00:00 2001 From: aadamgough Date: Fri, 9 Jan 2026 17:52:03 -0800 Subject: [PATCH 2/2] fixed greptile comments --- apps/sim/blocks/blocks/sharepoint.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/sim/blocks/blocks/sharepoint.ts b/apps/sim/blocks/blocks/sharepoint.ts index 36f86afe1f..5fe1dfb6df 100644 --- a/apps/sim/blocks/blocks/sharepoint.ts +++ b/apps/sim/blocks/blocks/sharepoint.ts @@ -165,7 +165,7 @@ Return ONLY the template name - no explanations, no quotes, no extra text.`, }, { - id: 'pageContent', + id: 'columnDefinitions', title: 'Column Definitions', type: 'long-input', placeholder: 'Optional: Define custom columns as JSON array', @@ -402,6 +402,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, includeItems, uploadFiles, files, + columnDefinitions, ...others } = rest as any @@ -449,7 +450,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, // Handle file upload files parameter const fileParam = uploadFiles || files - const baseParams = { + const baseParams: Record = { credential, siteId: effectiveSiteId || undefined, pageSize: others.pageSize ? Number.parseInt(others.pageSize as string, 10) : undefined, @@ -466,6 +467,10 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, baseParams.files = fileParam } + if (columnDefinitions) { + baseParams.pageContent = columnDefinitions + } + return baseParams }, }, @@ -474,7 +479,10 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, operation: { type: 'string', description: 'Operation to perform' }, credential: { type: 'string', description: 'Microsoft account credential' }, pageName: { type: 'string', description: 'Page name' }, - pageContent: { type: 'string', description: 'Page content' }, + columnDefinitions: { + type: 'string', + description: 'Column definitions for list creation (JSON array)', + }, pageTitle: { type: 'string', description: 'Page title' }, pageId: { type: 'string', description: 'Page ID' }, siteSelector: { type: 'string', description: 'Site selector' },