Skip to content

Commit fd76e98

Browse files
authored
improvement(wand): added more wands (#2756)
* added wand configs * fixed greptile comments
1 parent 1dbd161 commit fd76e98

File tree

6 files changed

+401
-6
lines changed

6 files changed

+401
-6
lines changed

apps/sim/blocks/blocks/google_sheets.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,33 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
7373
title: 'Range',
7474
type: 'short-input',
7575
placeholder: 'Sheet name and cell range (e.g., Sheet1!A1:D10)',
76+
wandConfig: {
77+
enabled: true,
78+
prompt: `Generate a valid Google Sheets range based on the user's description.
79+
80+
### VALID FORMATS
81+
1. Sheet name only (for appending to end): Sheet1
82+
2. Full range (for reading/writing specific cells): Sheet1!A1:D10
83+
84+
### RANGE RULES
85+
- Sheet names with spaces must be quoted: 'My Sheet'!A1:B10
86+
- Column letters are uppercase: A, B, C, ... Z, AA, AB, etc.
87+
- Row numbers start at 1 (not 0)
88+
- Range format: SheetName!StartCell:EndCell (e.g., Sheet1!A2:C10)
89+
- For a single column: Sheet1!A:A
90+
- For a single row: Sheet1!1:1
91+
92+
### EXAMPLES
93+
- "the first sheet" -> Sheet1
94+
- "data sheet from A1 to E100" -> 'Data Sheet'!A1:E100
95+
- "append to orders sheet" -> Orders
96+
- "cells A1 through C50 on Sheet2" -> Sheet2!A1:C50
97+
- "column A of inventory" -> Inventory!A:A
98+
- "just the headers row" -> Sheet1!1:1
99+
100+
Return ONLY the range string - no explanations, no quotes around the entire output, no extra text.`,
101+
placeholder: 'Describe the range (e.g., "all data from Sheet1" or "A1 to D50")...',
102+
},
76103
},
77104
// Write-specific Fields
78105
{

apps/sim/blocks/blocks/microsoft_excel.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,33 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
7070
type: 'short-input',
7171
placeholder: 'Sheet name and cell range (e.g., Sheet1!A1:D10)',
7272
condition: { field: 'operation', value: ['read', 'write', 'update'] },
73+
wandConfig: {
74+
enabled: true,
75+
prompt: `Generate a valid Microsoft Excel range based on the user's description.
76+
77+
### FORMAT (REQUIRED)
78+
SheetName!StartCell:EndCell
79+
80+
Excel ALWAYS requires the full range format with both sheet name and cell range.
81+
82+
### RANGE RULES
83+
- Sheet names with spaces must be quoted: 'My Sheet'!A1:B10
84+
- Column letters are uppercase: A, B, C, ... Z, AA, AB, etc.
85+
- Row numbers start at 1 (not 0)
86+
- For entire columns: Sheet1!A:Z
87+
- For entire rows: Sheet1!1:100
88+
89+
### EXAMPLES
90+
- "the first sheet" -> Sheet1!A1:Z1000
91+
- "data sheet from A1 to E100" -> 'Data Sheet'!A1:E100
92+
- "cells A1 through C50 on Sheet2" -> Sheet2!A1:C50
93+
- "column A of inventory" -> Inventory!A:A
94+
- "just the headers row on Sheet1" -> Sheet1!1:1
95+
- "all data on sales sheet" -> 'Sales'!A1:Z1000
96+
97+
Return ONLY the range string - no explanations, no quotes around the entire output, no extra text.`,
98+
placeholder: 'Describe the range (e.g., "A1 to D50 on Sheet1")...',
99+
},
73100
},
74101
{
75102
id: 'tableName',
@@ -95,6 +122,22 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
95122
'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}])',
96123
condition: { field: 'operation', value: 'write' },
97124
required: true,
125+
wandConfig: {
126+
enabled: true,
127+
prompt: `Generate Microsoft Excel data as a JSON array based on the user's description.
128+
129+
Format options:
130+
1. Array of arrays: [["Header1", "Header2"], ["Value1", "Value2"]]
131+
2. Array of objects: [{"column1": "value1", "column2": "value2"}]
132+
133+
Examples:
134+
- "sales data with product and revenue columns" -> [["Product", "Revenue"], ["Widget A", 1500], ["Widget B", 2300]]
135+
- "list of employees with name and email" -> [{"name": "John Doe", "email": "[email protected]"}, {"name": "Jane Smith", "email": "[email protected]"}]
136+
137+
Return ONLY the JSON array - no explanations, no markdown, no extra text.`,
138+
placeholder: 'Describe the data you want to write...',
139+
generationType: 'json-object',
140+
},
98141
},
99142
{
100143
id: 'valueInputOption',
@@ -114,6 +157,22 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
114157
'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}])',
115158
condition: { field: 'operation', value: 'update' },
116159
required: true,
160+
wandConfig: {
161+
enabled: true,
162+
prompt: `Generate Microsoft Excel data as a JSON array based on the user's description.
163+
164+
Format options:
165+
1. Array of arrays: [["Header1", "Header2"], ["Value1", "Value2"]]
166+
2. Array of objects: [{"column1": "value1", "column2": "value2"}]
167+
168+
Examples:
169+
- "update with new prices" -> [["Product", "Price"], ["Widget A", 29.99], ["Widget B", 49.99]]
170+
- "quarterly targets" -> [{"Q1": 10000, "Q2": 12000, "Q3": 15000, "Q4": 18000}]
171+
172+
Return ONLY the JSON array - no explanations, no markdown, no extra text.`,
173+
placeholder: 'Describe the data you want to update...',
174+
generationType: 'json-object',
175+
},
117176
},
118177
{
119178
id: 'valueInputOption',
@@ -133,6 +192,25 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
133192
'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}])',
134193
condition: { field: 'operation', value: 'table_add' },
135194
required: true,
195+
wandConfig: {
196+
enabled: true,
197+
prompt: `Generate Microsoft Excel table row data as a JSON array based on the user's description.
198+
199+
Format options:
200+
1. Array of arrays: [["Value1", "Value2"], ["Value3", "Value4"]]
201+
2. Array of objects: [{"column1": "value1", "column2": "value2"}]
202+
203+
Note: When adding to an existing table, do NOT include headers - only data rows.
204+
205+
Examples:
206+
- "add new sales record" -> [["2024-01-15", "Widget Pro", 5, 249.99]]
207+
- "append customer info" -> [{"name": "Acme Corp", "contact": "John Smith", "status": "Active"}]
208+
- "add multiple rows with name, age, city" -> [["Alice", 28, "NYC"], ["Bob", 35, "LA"]]
209+
210+
Return ONLY the JSON array - no explanations, no markdown, no extra text.`,
211+
placeholder: 'Describe the data you want to add to the table...',
212+
generationType: 'json-object',
213+
},
136214
},
137215
],
138216
tools: {

apps/sim/blocks/blocks/sharepoint.ts

Lines changed: 149 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,108 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
132132
type: 'short-input',
133133
placeholder: "Template (e.g., 'genericList')",
134134
condition: { field: 'operation', value: 'create_list' },
135+
wandConfig: {
136+
enabled: true,
137+
prompt: `Generate a SharePoint list template name based on the user's description.
138+
139+
### AVAILABLE TEMPLATES
140+
- genericList - Standard list for general data (default)
141+
- documentLibrary - For storing and managing documents
142+
- survey - For creating surveys and polls
143+
- links - For storing hyperlinks
144+
- announcements - For news and announcements
145+
- contacts - For contact information (name, email, phone)
146+
- events - For calendar events and scheduling
147+
- tasks - For task tracking and project management
148+
- discussionBoard - For team discussions and forums
149+
- pictureLibrary - For storing images and photos
150+
- issue - For issue/bug tracking
151+
152+
### EXAMPLES
153+
- "I want to track tasks" -> tasks
154+
- "store documents" -> documentLibrary
155+
- "team announcements" -> announcements
156+
- "contact list" -> contacts
157+
- "calendar events" -> events
158+
- "general data" -> genericList
159+
- "bug tracking" -> issue
160+
- "photo gallery" -> pictureLibrary
161+
162+
Return ONLY the template name - no explanations, no quotes, no extra text.`,
163+
placeholder: 'Describe what kind of list you need...',
164+
},
135165
},
136166

137167
{
138-
id: 'pageContent',
139-
title: 'Page Content',
168+
id: 'columnDefinitions',
169+
title: 'Column Definitions',
140170
type: 'long-input',
141-
placeholder: 'Provide page content',
171+
placeholder: 'Optional: Define custom columns as JSON array',
142172
condition: { field: 'operation', value: ['create_list'] },
173+
wandConfig: {
174+
enabled: true,
175+
prompt: `Generate a JSON array of SharePoint list column definitions based on the user's description.
176+
177+
### FORMAT
178+
A JSON array of column definition objects. Each column needs at minimum a "name" and column type properties.
179+
180+
### COLUMN TYPES AND PROPERTIES
181+
182+
**Text Column:**
183+
{"name": "ColumnName", "text": {}}
184+
- For single line of text
185+
186+
**Multi-line Text:**
187+
{"name": "ColumnName", "text": {"allowMultipleLines": true}}
188+
189+
**Number Column:**
190+
{"name": "ColumnName", "number": {}}
191+
- Optional: "minimum", "maximum", "decimalPlaces"
192+
193+
**DateTime Column:**
194+
{"name": "ColumnName", "dateTime": {"format": "dateOnly"}}
195+
- format: "dateOnly" or "dateTime"
196+
197+
**Boolean (Yes/No):**
198+
{"name": "ColumnName", "boolean": {}}
199+
200+
**Choice Column:**
201+
{"name": "ColumnName", "choice": {"choices": ["Option1", "Option2", "Option3"]}}
202+
203+
**Person Column:**
204+
{"name": "ColumnName", "personOrGroup": {}}
205+
206+
**Currency:**
207+
{"name": "ColumnName", "currency": {"locale": "en-US"}}
208+
209+
### EXAMPLES
210+
211+
"add columns for status (choice: Active, Completed, On Hold), due date, and priority number"
212+
-> [
213+
{"name": "Status", "choice": {"choices": ["Active", "Completed", "On Hold"]}},
214+
{"name": "DueDate", "dateTime": {"format": "dateOnly"}},
215+
{"name": "Priority", "number": {"minimum": 1, "maximum": 5}}
216+
]
217+
218+
"text column for description, yes/no for completed, date for start"
219+
-> [
220+
{"name": "Description", "text": {"allowMultipleLines": true}},
221+
{"name": "Completed", "boolean": {}},
222+
{"name": "StartDate", "dateTime": {"format": "dateOnly"}}
223+
]
224+
225+
"assignee (person), budget (currency), category (choice: Marketing, Sales, Engineering)"
226+
-> [
227+
{"name": "Assignee", "personOrGroup": {}},
228+
{"name": "Budget", "currency": {"locale": "en-US"}},
229+
{"name": "Category", "choice": {"choices": ["Marketing", "Sales", "Engineering"]}}
230+
]
231+
232+
Return ONLY the JSON array - no explanations, no markdown, no extra text.`,
233+
placeholder:
234+
'Describe the columns you want to add (e.g., "status dropdown, due date, priority number")...',
235+
generationType: 'json-object',
236+
},
143237
},
144238
{
145239
id: 'listDescription',
@@ -164,9 +258,50 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
164258
id: 'listItemFields',
165259
title: 'List Item Fields',
166260
type: 'long-input',
167-
placeholder: 'Enter list item fields',
261+
placeholder:
262+
'Enter list item fields as JSON (e.g., {"Title": "My Item", "Status": "Active"})',
168263
canonicalParamId: 'listItemFields',
169264
condition: { field: 'operation', value: ['update_list', 'add_list_items'] },
265+
wandConfig: {
266+
enabled: true,
267+
prompt: `Generate a JSON object for SharePoint list item fields based on the user's description.
268+
269+
### FORMAT
270+
A JSON object where keys are column internal names and values are the data to set.
271+
272+
### RULES
273+
- Use the column's internal name (often same as display name, but spaces become _x0020_)
274+
- Common field names: Title, Status, Description, Priority, DueDate, AssignedTo, Category
275+
- Date fields should use ISO 8601 format: "2024-01-15" or "2024-01-15T10:30:00Z"
276+
- Number fields should be numeric, not strings
277+
- Boolean fields use true/false
278+
- Choice fields use the exact choice value as a string
279+
- Person fields use the person's email or ID
280+
281+
### READ-ONLY FIELDS (automatically filtered out)
282+
Id, UniqueId, GUID, Created, Modified, Author, Editor, ContentTypeId
283+
284+
### EXAMPLES
285+
286+
"set title to Project Alpha and status to In Progress"
287+
-> {"Title": "Project Alpha", "Status": "In Progress"}
288+
289+
"update priority to high and due date to next Friday"
290+
-> {"Priority": "High", "DueDate": "2024-01-19"}
291+
292+
"add task with title Review Document, assigned to [email protected]"
293+
-> {"Title": "Review Document", "AssignedToLookupId": "[email protected]"}
294+
295+
"create contact with name John Smith, email [email protected], phone 555-1234"
296+
-> {"Title": "John Smith", "Email": "[email protected]", "WorkPhone": "555-1234"}
297+
298+
"set completed to true and notes to Task finished successfully"
299+
-> {"Completed": true, "Notes": "Task finished successfully"}
300+
301+
Return ONLY the JSON object - no explanations, no markdown, no extra text.`,
302+
placeholder: 'Describe the fields and values you want to set...',
303+
generationType: 'json-object',
304+
},
170305
},
171306

172307
// Upload File operation fields
@@ -267,6 +402,7 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
267402
includeItems,
268403
uploadFiles,
269404
files,
405+
columnDefinitions,
270406
...others
271407
} = rest as any
272408

@@ -314,7 +450,7 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
314450

315451
// Handle file upload files parameter
316452
const fileParam = uploadFiles || files
317-
const baseParams = {
453+
const baseParams: Record<string, any> = {
318454
credential,
319455
siteId: effectiveSiteId || undefined,
320456
pageSize: others.pageSize ? Number.parseInt(others.pageSize as string, 10) : undefined,
@@ -331,6 +467,10 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
331467
baseParams.files = fileParam
332468
}
333469

470+
if (columnDefinitions) {
471+
baseParams.pageContent = columnDefinitions
472+
}
473+
334474
return baseParams
335475
},
336476
},
@@ -339,7 +479,10 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
339479
operation: { type: 'string', description: 'Operation to perform' },
340480
credential: { type: 'string', description: 'Microsoft account credential' },
341481
pageName: { type: 'string', description: 'Page name' },
342-
pageContent: { type: 'string', description: 'Page content' },
482+
columnDefinitions: {
483+
type: 'string',
484+
description: 'Column definitions for list creation (JSON array)',
485+
},
343486
pageTitle: { type: 'string', description: 'Page title' },
344487
pageId: { type: 'string', description: 'Page ID' },
345488
siteSelector: { type: 'string', description: 'Site selector' },

apps/sim/blocks/blocks/supabase.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,38 @@ Return ONLY the PostgREST filter expression - no explanations, no markdown, no e
402402
type: 'short-input',
403403
placeholder: 'column_name (add DESC for descending)',
404404
condition: { field: 'operation', value: 'query' },
405+
wandConfig: {
406+
enabled: true,
407+
prompt: `Generate a Supabase order by clause based on the user's description.
408+
409+
### FORMAT
410+
column_name [ASC|DESC]
411+
412+
### RULES
413+
- Column name only: sorts ascending by default
414+
- Add DESC after column name for descending order
415+
- Add ASC after column name for ascending order (explicit)
416+
- Column names are case-sensitive and should match your database schema
417+
418+
### COMMON PATTERNS
419+
- Newest first: created_at DESC
420+
- Oldest first: created_at ASC
421+
- Alphabetical: name
422+
- Reverse alphabetical: name DESC
423+
- Highest value first: price DESC
424+
- Lowest value first: price ASC
425+
426+
### EXAMPLES
427+
- "sort by start time newest first" -> start_time DESC
428+
- "order by name alphabetically" -> name
429+
- "sort by created date oldest first" -> created_at ASC
430+
- "highest scores first" -> score DESC
431+
- "sort by updated timestamp descending" -> updated_at DESC
432+
- "order by email" -> email
433+
434+
Return ONLY the order by expression - no explanations, no extra text.`,
435+
placeholder: 'Describe how to sort (e.g., "newest first by created_at")...',
436+
},
405437
},
406438
// Optional limit for query operation
407439
{

0 commit comments

Comments
 (0)