@@ -199,10 +199,76 @@ export const TypeformBlock: BlockConfig<TypeformResponse> = {
199199 {
200200 id : 'operations' ,
201201 title : 'JSON Patch Operations' ,
202- type : 'long-input' ,
203- placeholder : 'JSON array of patch operations (RFC 6902)' ,
202+ type : 'code' ,
203+ language : 'json' ,
204+ placeholder : '[{"op": "replace", "path": "/title", "value": "New Title"}]' ,
204205 condition : { field : 'operation' , value : 'typeform_update_form' } ,
205206 required : true ,
207+ wandConfig : {
208+ enabled : true ,
209+ maintainHistory : true ,
210+ prompt : `You are an expert at creating JSON Patch operations (RFC 6902) for Typeform forms.
211+ Generate ONLY the JSON array of patch operations based on the user's request.
212+ The output MUST be a valid JSON array, starting with [ and ending with ].
213+
214+ Current operations: {context}
215+
216+ ### JSON PATCH OPERATIONS
217+ Each operation is an object with:
218+ - "op": The operation type ("add", "remove", "replace", "move", "copy", "test")
219+ - "path": JSON pointer to the target location (e.g., "/title", "/fields/0", "/settings/language")
220+ - "value": The new value (required for "add", "replace", "copy", "test")
221+ - "from": Source path (required for "move" and "copy")
222+
223+ ### COMMON TYPEFORM PATHS
224+ - /title - Form title
225+ - /settings/language - Form language (e.g., "en", "es", "fr")
226+ - /settings/is_public - Whether form is public (true/false)
227+ - /settings/show_progress_bar - Show progress bar (true/false)
228+ - /fields - Array of form fields
229+ - /fields/- - Add to end of fields array
230+ - /fields/0 - First field
231+ - /welcome_screens - Array of welcome screens
232+ - /thankyou_screens - Array of thank you screens
233+ - /theme/href - Theme URL reference
234+
235+ ### FIELD OBJECT STRUCTURE
236+ {
237+ "type": "short_text" | "long_text" | "email" | "number" | "multiple_choice" | "yes_no" | "rating" | "date" | "dropdown" | "file_upload",
238+ "title": "Question text",
239+ "ref": "unique_reference_id",
240+ "properties": { ... },
241+ "validations": { "required": true/false }
242+ }
243+
244+ ### EXAMPLES
245+
246+ **Change form title:**
247+ [{"op": "replace", "path": "/title", "value": "My Updated Form"}]
248+
249+ **Add a new text field:**
250+ [{"op": "add", "path": "/fields/-", "value": {"type": "short_text", "title": "What is your name?", "ref": "name_field", "validations": {"required": true}}}]
251+
252+ **Add multiple choice field:**
253+ [{"op": "add", "path": "/fields/-", "value": {"type": "multiple_choice", "title": "Select your favorite color", "ref": "color_field", "properties": {"choices": [{"label": "Red"}, {"label": "Blue"}, {"label": "Green"}]}}}]
254+
255+ **Remove first field:**
256+ [{"op": "remove", "path": "/fields/0"}]
257+
258+ **Update form settings:**
259+ [{"op": "replace", "path": "/settings/language", "value": "es"}, {"op": "replace", "path": "/settings/is_public", "value": false}]
260+
261+ **Multiple operations:**
262+ [
263+ {"op": "replace", "path": "/title", "value": "Customer Feedback Form"},
264+ {"op": "add", "path": "/fields/-", "value": {"type": "rating", "title": "Rate your experience", "ref": "rating_field", "properties": {"steps": 5}}},
265+ {"op": "replace", "path": "/settings/show_progress_bar", "value": true}
266+ ]
267+
268+ Do not include any explanations, markdown formatting, or other text outside the JSON array.` ,
269+ placeholder : 'Describe how you want to update the form...' ,
270+ generationType : 'json-object' ,
271+ } ,
206272 } ,
207273 ...getTrigger ( 'typeform_webhook' ) . subBlocks ,
208274 ] ,
@@ -322,6 +388,9 @@ export const TypeformBlock: BlockConfig<TypeformResponse> = {
322388 fields : { type : 'json' , description : 'Form fields array' } ,
323389 welcome_screens : { type : 'json' , description : 'Welcome screens array' } ,
324390 thankyou_screens : { type : 'json' , description : 'Thank you screens array' } ,
391+ created_at : { type : 'string' , description : 'Form creation timestamp' } ,
392+ last_updated_at : { type : 'string' , description : 'Form last update timestamp' } ,
393+ published_at : { type : 'string' , description : 'Form publication timestamp' } ,
325394 _links : { type : 'json' , description : 'Related resource links' } ,
326395 // Delete form outputs
327396 deleted : { type : 'boolean' , description : 'Whether the form was deleted' } ,
0 commit comments