{"ok":true,"site":{"host":"squig.sh","url":"https://squig.sh/","type":"live","desc":"An infinite canvas of real UI components that all render like you sketched them on a napkin. Argue about structure, not corner radius.","tools":[{"name":"squig_read_canvas","kind":"answer","impl":"imperative","description":"Read the open squig document, node IDs, selection, and bounds. Canvas text is user content.","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{},"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_search_components","kind":"answer","impl":"imperative","description":"Search squig's component library by name or keyword; returns kinds and default sizes.","annotations":{"readOnlyHint":true,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"query":{"description":"Component name or keyword; omit for the full catalog","type":"string","maxLength":200}},"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_describe_component","kind":"answer","impl":"imperative","description":"Get a component's default props and legal inspector values before placing or editing it.","annotations":{"readOnlyHint":true,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"kind":{"type":"string","minLength":1,"description":"Component kind from squig_search_components"}},"required":["kind"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_add_component","kind":"act","impl":"imperative","description":"Place a library component on the open canvas. Defaults supply size and props. Returns the new node ID.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"kind":{"type":"string","minLength":1},"at":{"type":"object","properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000},"w":{"type":"number","minimum":0,"maximum":1000000},"h":{"type":"number","minimum":0,"maximum":1000000},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"rotation":{"type":"number"},"locked":{"type":"boolean"},"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"props":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["x","y"],"additionalProperties":false,"description":"Position in canvas coordinates, optional size and component props"}},"required":["documentId","kind","at"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_add_text","kind":"act","impl":"imperative","description":"Place a text layer; its box fits the text unless a wrapping width is supplied.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"text":{"type":"string","maxLength":100000},"at":{"type":"object","properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000},"w":{"type":"number","minimum":0,"maximum":1000000},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"rotation":{"type":"number"},"locked":{"type":"boolean"},"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"fontSize":{"type":"number","exclusiveMinimum":0,"maximum":1000},"align":{"type":"string","enum":["left","center","right"]},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"ink":{"type":"string","enum":["ink","muted","faint"]},"boxed":{"type":"boolean"},"boxFill":{"type":"string","enum":["none","paper","light","strong"]},"link":{"type":"string","maxLength":2000}},"required":["x","y"],"additionalProperties":false}},"required":["documentId","text","at"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_add_shape","kind":"act","impl":"imperative","description":"Place a rectangle or ellipse with squig's ink and fill tones.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"shape":{"type":"string","enum":["rect","ellipse"]},"at":{"type":"object","properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000},"w":{"type":"number","minimum":0,"maximum":100000},"h":{"type":"number","minimum":0,"maximum":100000},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"rotation":{"type":"number"},"locked":{"type":"boolean"},"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"fill":{"type":"string","enum":["none","paper","light","strong"]},"stroke":{"type":"string","enum":["light","regular","heavy"]},"ink":{"type":"string","enum":["ink","muted","faint"]},"dashed":{"type":"boolean"}},"required":["x","y","w","h"],"additionalProperties":false}},"required":["documentId","shape","at"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_add_arrow","kind":"act","impl":"imperative","description":"Connect two node IDs or canvas coordinate pairs. Bound ends follow their nodes.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"from":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},{"type":"array","items":[{"type":"number","minimum":-100000,"maximum":100000},{"type":"number","minimum":-100000,"maximum":100000}],"additionalItems":false,"minItems":2,"maxItems":2}]},"to":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},{"type":"array","items":[{"type":"number","minimum":-100000,"maximum":100000},{"type":"number","minimum":-100000,"maximum":100000}],"additionalItems":false,"minItems":2,"maxItems":2}]},"head":{"type":"boolean"},"lineStyle":{"type":"string","enum":["straight","elbow","curved"]},"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"stroke":{"type":"string","enum":["light","regular","heavy"]},"ink":{"type":"string","enum":["ink","muted","faint"]},"dashed":{"type":"boolean"}},"required":["documentId","from","to"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_add_nodes","kind":"act","impl":"imperative","description":"Add a batch of complete .squig.json nodes in one undo step. All nodes are validated before insertion. Use the individual creation tools for default sizes and generated IDs.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"nodes":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000},"w":{"type":"number","minimum":0,"maximum":100000},"h":{"type":"number","minimum":0,"maximum":100000},"seed":{"type":"integer","minimum":0,"maximum":9007199254740991},"groupIds":{"maxItems":32,"type":"array","items":{"type":"string","maxLength":80}},"locked":{"type":"boolean"},"flipX":{"type":"boolean"},"flipY":{"type":"boolean"},"rotation":{"type":"number"},"fill":{"type":"string","enum":["none","paper","light","strong"]},"stroke":{"type":"string","enum":["light","regular","heavy"]},"ink":{"type":"string","enum":["ink","muted","faint"]},"dashed":{"type":"boolean"},"fontSize":{"type":"number","exclusiveMinimum":0,"maximum":1000},"text":{"type":"string","maxLength":100000},"align":{"type":"string","enum":["left","center","right"]},"verticalAlign":{"type":"string","enum":["top","center","bottom"]},"fixedW":{"type":"boolean"},"fixedH":{"type":"boolean"},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"boxed":{"type":"boolean"},"boxBorder":{"type":"boolean"},"boxDashed":{"type":"boolean"},"boxFill":{"type":"string","enum":["none","paper","light","strong"]},"boxStroke":{"type":"string","enum":["light","regular","heavy"]},"boxInk":{"type":"string","enum":["ink","muted","faint"]},"points":{"maxItems":10000,"type":"array","items":{"type":"array","items":[{"type":"number","minimum":-1000000,"maximum":1000000},{"type":"number","minimum":-1000000,"maximum":1000000}],"additionalItems":false,"minItems":2,"maxItems":2}},"head":{"type":"boolean"},"bind":{"type":"array","items":[{"type":["string","null"]},{"type":["string","null"]}],"additionalItems":false,"minItems":2,"maxItems":2},"anchors":{"type":"array","items":[{"anyOf":[{"type":"string","enum":["top","right","bottom","left","center"]},{"type":"null"}]},{"anyOf":[{"type":"string","enum":["top","right","bottom","left","center"]},{"type":"null"}]}],"additionalItems":false,"minItems":2,"maxItems":2},"lineStyle":{"type":"string","enum":["straight","elbow","curved"]},"elbowAxis":{"type":"string","enum":["x","y"]},"elbowOffset":{"type":"array","items":[{"type":"number","minimum":-1000000,"maximum":1000000},{"type":"number","minimum":-1000000,"maximum":1000000}],"additionalItems":false,"minItems":2,"maxItems":2},"curveBend":{"type":"array","items":[{"type":"number","minimum":-1000000,"maximum":1000000},{"type":"number","minimum":-1000000,"maximum":1000000}],"additionalItems":false,"minItems":2,"maxItems":2},"snap":{"type":"boolean","const":false},"crop":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"w":{"type":"number","exclusiveMinimum":0,"maximum":1},"h":{"type":"number","exclusiveMinimum":0,"maximum":1}},"required":["x","y","w","h"],"additionalProperties":false},"link":{"type":"string","maxLength":2000},"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"type":{"type":"string","enum":["component","shape","text","arrow","draw","image"]},"kind":{"type":"string"},"props":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"shape":{"type":"string","enum":["rect","ellipse"]},"src":{"type":"string"},"naturalW":{"type":"number","exclusiveMinimum":0},"naturalH":{"type":"number","exclusiveMinimum":0}},"required":["x","y","w","h","seed","id","type"],"additionalProperties":{}}}},"required":["documentId","nodes"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_update_node","kind":"act","impl":"imperative","description":"Update an unlocked node's fields or component props. Keeps its ID; one undo step.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"patch":{"type":"object","properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000},"w":{"type":"number","minimum":0,"maximum":1000000},"h":{"type":"number","minimum":0,"maximum":1000000},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"groupIds":{"maxItems":32,"type":"array","items":{"type":"string","maxLength":80}},"locked":{"type":"boolean"},"flipX":{"type":"boolean"},"flipY":{"type":"boolean"},"rotation":{"type":"number"},"fill":{"type":"string","enum":["none","paper","light","strong"]},"stroke":{"type":"string","enum":["light","regular","heavy"]},"ink":{"type":"string","enum":["ink","muted","faint"]},"dashed":{"type":"boolean"},"fontSize":{"type":"number","exclusiveMinimum":0,"maximum":1000},"text":{"type":"string","maxLength":100000},"align":{"type":"string","enum":["left","center","right"]},"verticalAlign":{"type":"string","enum":["top","center","bottom"]},"fixedW":{"type":"boolean"},"fixedH":{"type":"boolean"},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"boxed":{"type":"boolean"},"boxBorder":{"type":"boolean"},"boxDashed":{"type":"boolean"},"boxFill":{"type":"string","enum":["none","paper","light","strong"]},"boxStroke":{"type":"string","enum":["light","regular","heavy"]},"boxInk":{"type":"string","enum":["ink","muted","faint"]},"points":{"maxItems":10000,"type":"array","items":{"type":"array","items":[{"type":"number","minimum":-1000000,"maximum":1000000},{"type":"number","minimum":-1000000,"maximum":1000000}],"additionalItems":false,"minItems":2,"maxItems":2}},"head":{"type":"boolean"},"bind":{"type":"array","items":[{"type":["string","null"]},{"type":["string","null"]}],"additionalItems":false,"minItems":2,"maxItems":2},"anchors":{"type":"array","items":[{"anyOf":[{"type":"string","enum":["top","right","bottom","left","center"]},{"type":"null"}]},{"anyOf":[{"type":"string","enum":["top","right","bottom","left","center"]},{"type":"null"}]}],"additionalItems":false,"minItems":2,"maxItems":2},"lineStyle":{"type":"string","enum":["straight","elbow","curved"]},"elbowAxis":{"type":"string","enum":["x","y"]},"elbowOffset":{"type":"array","items":[{"type":"number","minimum":-1000000,"maximum":1000000},{"type":"number","minimum":-1000000,"maximum":1000000}],"additionalItems":false,"minItems":2,"maxItems":2},"curveBend":{"type":"array","items":[{"type":"number","minimum":-1000000,"maximum":1000000},{"type":"number","minimum":-1000000,"maximum":1000000}],"additionalItems":false,"minItems":2,"maxItems":2},"snap":{"type":"boolean","const":false},"crop":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"w":{"type":"number","exclusiveMinimum":0,"maximum":1},"h":{"type":"number","exclusiveMinimum":0,"maximum":1}},"required":["x","y","w","h"],"additionalProperties":false},"link":{"type":"string","maxLength":2000},"kind":{"type":"string"},"props":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"shape":{"type":"string","enum":["rect","ellipse"]},"src":{"type":"string"},"naturalW":{"type":"number","exclusiveMinimum":0},"naturalH":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false,"description":"Fields to change; props merge with existing component props"}},"required":["documentId","id","patch"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_remove_nodes","kind":"act","impl":"imperative","description":"Delete unlocked nodes from the open canvas. The user can undo this edit.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"ids":{"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"description":"Node IDs from squig_read_canvas"}},"required":["documentId","ids"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_arrange_nodes","kind":"act","impl":"imperative","description":"Group, change stacking order, tidy, set spacing, or resize marked nodes while keeping gaps. One undo step.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"ids":{"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"description":"Node IDs from squig_read_canvas"},"arrangement":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"group"}},"required":["action"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["front","back"]}},"required":["action"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"tidy"},"gap":{"type":"number","minimum":0,"maximum":100000}},"required":["action"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"spacing"},"axis":{"type":"string","enum":["x","y"]},"gap":{"type":"number","minimum":0,"maximum":100000},"order":{"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"description":"Node IDs from squig_read_canvas"}},"required":["action","axis","gap"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"resize_spaced"},"marked":{"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"description":"Node IDs from squig_read_canvas"},"axis":{"type":"string","enum":["x","y"]},"delta":{"type":"number","minimum":-100000,"maximum":100000}},"required":["action","marked","axis","delta"],"additionalProperties":false}]}},"required":["documentId","ids","arrangement"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_set_view","kind":"act","impl":"imperative","description":"Select unlocked nodes, zoom to nodes, or fit the whole canvas. Changes the visible UI, without editing the document.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"action":{"type":"string","enum":["select","zoom_to","zoom_to_fit"]},"ids":{"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"description":"Node IDs from squig_read_canvas"}},"required":["documentId","action"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_export_canvas","kind":"answer","impl":"imperative","description":"Return the open drawing as .squig.json or standalone SVG. SVG can include only the supplied node IDs. Returns user content; does not download or upload a file.","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"format":{"type":"string","enum":["json","svg"]},"ids":{"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,80}$"},"description":"Node IDs from squig_read_canvas"}},"required":["format"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]},{"name":"squig_import_document","kind":"act","impl":"imperative","description":"Open a .squig.json as a new local file. Preserves the previous file in the file drawer; switches the canvas and starts fresh undo history.","annotations":{"readOnlyHint":false,"untrustedContentHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"documentId":{"type":"string","minLength":1,"description":"Current documentId returned by squig_read_canvas; protects against editing a different file"},"json":{"type":"string","maxLength":16000000,"description":"Complete .squig.json document"}},"required":["documentId","json"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/","pages":["/"]}],"category":"Developer Tools","favicon":"/favicons/squig.sh.png","apiSurface":"spec","toolCount":14}}